summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordpope <daniel.pope@nokia.com>2012-02-03 15:45:25 +1000
committerRohan McGovern <rohan.mcgovern@nokia.com>2012-02-10 07:24:48 +0100
commitbc66ec0bc5f548a72d21557d529f2d03c7417f09 (patch)
tree53aa0444fc698cde712fb8e0486e3da1a56f853d
parent98451b5e136af38b00b008ae58ec8243c981eee4 (diff)
Deprecation of the qt/quick3d repository.HEADmaster
Change-Id: I271146636615ab16f79ad3e66985076e2bd7a95c Reviewed-by: Sarah Jane Smith <sarah.j.smith@nokia.com>
-rw-r--r--.gitignore5
-rw-r--r--3rdparty/assimp/LICENSE47
-rw-r--r--3rdparty/assimp/README79
-rw-r--r--3rdparty/assimp/assimp.pri361
-rw-r--r--3rdparty/assimp/code/3DSConverter.cpp844
-rw-r--r--3rdparty/assimp/code/3DSHelper.h577
-rw-r--r--3rdparty/assimp/code/3DSLoader.cpp1378
-rw-r--r--3rdparty/assimp/code/3DSLoader.h280
-rw-r--r--3rdparty/assimp/code/ACLoader.cpp856
-rw-r--r--3rdparty/assimp/code/ACLoader.h271
-rw-r--r--3rdparty/assimp/code/ASELoader.cpp1302
-rw-r--r--3rdparty/assimp/code/ASELoader.h208
-rw-r--r--3rdparty/assimp/code/ASEParser.cpp2150
-rw-r--r--3rdparty/assimp/code/ASEParser.h669
-rw-r--r--3rdparty/assimp/code/Assimp.cpp731
-rw-r--r--3rdparty/assimp/code/AssimpPCH.cpp70
-rw-r--r--3rdparty/assimp/code/AssimpPCH.h149
-rw-r--r--3rdparty/assimp/code/B3DImporter.cpp672
-rw-r--r--3rdparty/assimp/code/B3DImporter.h126
-rw-r--r--3rdparty/assimp/code/BVHLoader.cpp505
-rw-r--r--3rdparty/assimp/code/BVHLoader.h173
-rw-r--r--3rdparty/assimp/code/BaseImporter.cpp527
-rw-r--r--3rdparty/assimp/code/BaseImporter.h499
-rw-r--r--3rdparty/assimp/code/BaseProcess.cpp96
-rw-r--r--3rdparty/assimp/code/BaseProcess.h289
-rw-r--r--3rdparty/assimp/code/BlenderDNA.cpp372
-rw-r--r--3rdparty/assimp/code/BlenderDNA.h866
-rw-r--r--3rdparty/assimp/code/BlenderDNA.inl638
-rw-r--r--3rdparty/assimp/code/BlenderIntermediate.h183
-rw-r--r--3rdparty/assimp/code/BlenderLoader.cpp1005
-rw-r--r--3rdparty/assimp/code/BlenderLoader.h261
-rw-r--r--3rdparty/assimp/code/BlenderModifier.cpp311
-rw-r--r--3rdparty/assimp/code/BlenderModifier.h155
-rw-r--r--3rdparty/assimp/code/BlenderScene.cpp596
-rw-r--r--3rdparty/assimp/code/BlenderScene.h683
-rw-r--r--3rdparty/assimp/code/BlenderSceneGen.h223
-rw-r--r--3rdparty/assimp/code/BoostWorkaround/boost/LICENSE_1_0.txt23
-rw-r--r--3rdparty/assimp/code/BoostWorkaround/boost/foreach.hpp93
-rw-r--r--3rdparty/assimp/code/BoostWorkaround/boost/format.hpp81
-rw-r--r--3rdparty/assimp/code/BoostWorkaround/boost/lexical_cast.hpp23
-rw-r--r--3rdparty/assimp/code/BoostWorkaround/boost/math/common_factor_rt.hpp37
-rw-r--r--3rdparty/assimp/code/BoostWorkaround/boost/pointer_cast.hpp45
-rw-r--r--3rdparty/assimp/code/BoostWorkaround/boost/scoped_array.hpp79
-rw-r--r--3rdparty/assimp/code/BoostWorkaround/boost/scoped_ptr.hpp79
-rw-r--r--3rdparty/assimp/code/BoostWorkaround/boost/shared_array.hpp228
-rw-r--r--3rdparty/assimp/code/BoostWorkaround/boost/shared_ptr.hpp257
-rw-r--r--3rdparty/assimp/code/BoostWorkaround/boost/static_assert.hpp20
-rw-r--r--3rdparty/assimp/code/BoostWorkaround/boost/timer.hpp72
-rw-r--r--3rdparty/assimp/code/BoostWorkaround/boost/tuple/tuple.hpp285
-rw-r--r--3rdparty/assimp/code/ByteSwap.h245
-rw-r--r--3rdparty/assimp/code/COBLoader.cpp1278
-rw-r--r--3rdparty/assimp/code/COBLoader.h175
-rw-r--r--3rdparty/assimp/code/COBScene.h272
-rw-r--r--3rdparty/assimp/code/CSMLoader.cpp281
-rw-r--r--3rdparty/assimp/code/CSMLoader.h88
-rw-r--r--3rdparty/assimp/code/CalcTangentsProcess.cpp283
-rw-r--r--3rdparty/assimp/code/CalcTangentsProcess.h118
-rw-r--r--3rdparty/assimp/code/ColladaHelper.h601
-rw-r--r--3rdparty/assimp/code/ColladaLoader.cpp1492
-rw-r--r--3rdparty/assimp/code/ColladaLoader.h241
-rw-r--r--3rdparty/assimp/code/ColladaParser.cpp2801
-rw-r--r--3rdparty/assimp/code/ColladaParser.h341
-rw-r--r--3rdparty/assimp/code/ComputeUVMappingProcess.cpp504
-rw-r--r--3rdparty/assimp/code/ComputeUVMappingProcess.h149
-rw-r--r--3rdparty/assimp/code/ConvertToLHProcess.cpp318
-rw-r--r--3rdparty/assimp/code/ConvertToLHProcess.h169
-rw-r--r--3rdparty/assimp/code/DXFLoader.cpp609
-rw-r--r--3rdparty/assimp/code/DXFLoader.h184
-rw-r--r--3rdparty/assimp/code/DefaultIOStream.cpp139
-rw-r--r--3rdparty/assimp/code/DefaultIOStream.h133
-rw-r--r--3rdparty/assimp/code/DefaultIOSystem.cpp167
-rw-r--r--3rdparty/assimp/code/DefaultIOSystem.h83
-rw-r--r--3rdparty/assimp/code/DefaultLogger.cpp419
-rw-r--r--3rdparty/assimp/code/DefaultProgressHandler.h64
-rw-r--r--3rdparty/assimp/code/Exceptional.h122
-rw-r--r--3rdparty/assimp/code/FileLogStream.h64
-rw-r--r--3rdparty/assimp/code/FileSystemFilter.h244
-rw-r--r--3rdparty/assimp/code/FindDegenerates.cpp216
-rw-r--r--3rdparty/assimp/code/FindDegenerates.h110
-rw-r--r--3rdparty/assimp/code/FindInstancesProcess.cpp288
-rw-r--r--3rdparty/assimp/code/FindInstancesProcess.h140
-rw-r--r--3rdparty/assimp/code/FindInvalidDataProcess.cpp419
-rw-r--r--3rdparty/assimp/code/FindInvalidDataProcess.h111
-rw-r--r--3rdparty/assimp/code/FixNormalsStep.cpp176
-rw-r--r--3rdparty/assimp/code/FixNormalsStep.h96
-rw-r--r--3rdparty/assimp/code/GenFaceNormalsProcess.cpp138
-rw-r--r--3rdparty/assimp/code/GenFaceNormalsProcess.h88
-rw-r--r--3rdparty/assimp/code/GenVertexNormalsProcess.cpp228
-rw-r--r--3rdparty/assimp/code/GenVertexNormalsProcess.h118
-rw-r--r--3rdparty/assimp/code/GenericProperty.h112
-rw-r--r--3rdparty/assimp/code/HMPFileData.h134
-rw-r--r--3rdparty/assimp/code/HMPLoader.cpp497
-rw-r--r--3rdparty/assimp/code/HMPLoader.h159
-rw-r--r--3rdparty/assimp/code/HalfLifeFileData.h150
-rw-r--r--3rdparty/assimp/code/Hash.h108
-rw-r--r--3rdparty/assimp/code/IFF.h102
-rw-r--r--3rdparty/assimp/code/IRRLoader.cpp1462
-rw-r--r--3rdparty/assimp/code/IRRLoader.h312
-rw-r--r--3rdparty/assimp/code/IRRMeshLoader.cpp499
-rw-r--r--3rdparty/assimp/code/IRRMeshLoader.h99
-rw-r--r--3rdparty/assimp/code/IRRShared.cpp496
-rw-r--r--3rdparty/assimp/code/IRRShared.h115
-rw-r--r--3rdparty/assimp/code/Importer.cpp1415
-rw-r--r--3rdparty/assimp/code/ImproveCacheLocality.cpp378
-rw-r--r--3rdparty/assimp/code/ImproveCacheLocality.h102
-rw-r--r--3rdparty/assimp/code/JoinVerticesProcess.cpp395
-rw-r--r--3rdparty/assimp/code/JoinVerticesProcess.h105
-rw-r--r--3rdparty/assimp/code/LWOAnimation.cpp585
-rw-r--r--3rdparty/assimp/code/LWOAnimation.h336
-rw-r--r--3rdparty/assimp/code/LWOBLoader.cpp396
-rw-r--r--3rdparty/assimp/code/LWOFileData.h699
-rw-r--r--3rdparty/assimp/code/LWOLoader.cpp1403
-rw-r--r--3rdparty/assimp/code/LWOLoader.h490
-rw-r--r--3rdparty/assimp/code/LWOMaterial.cpp898
-rw-r--r--3rdparty/assimp/code/LWSLoader.cpp885
-rw-r--r--3rdparty/assimp/code/LWSLoader.h242
-rw-r--r--3rdparty/assimp/code/LimitBoneWeightsProcess.cpp204
-rw-r--r--3rdparty/assimp/code/LimitBoneWeightsProcess.h146
-rw-r--r--3rdparty/assimp/code/LineSplitter.h217
-rw-r--r--3rdparty/assimp/code/MD2FileData.h163
-rw-r--r--3rdparty/assimp/code/MD2Loader.cpp414
-rw-r--r--3rdparty/assimp/code/MD2Loader.h126
-rw-r--r--3rdparty/assimp/code/MD2NormalTable.h217
-rw-r--r--3rdparty/assimp/code/MD3FileData.h315
-rw-r--r--3rdparty/assimp/code/MD3Loader.cpp1043
-rw-r--r--3rdparty/assimp/code/MD3Loader.h331
-rw-r--r--3rdparty/assimp/code/MD4FileData.h218
-rw-r--r--3rdparty/assimp/code/MD5Loader.cpp727
-rw-r--r--3rdparty/assimp/code/MD5Loader.h194
-rw-r--r--3rdparty/assimp/code/MD5Parser.cpp471
-rw-r--r--3rdparty/assimp/code/MD5Parser.h460
-rw-r--r--3rdparty/assimp/code/MDCFileData.h199
-rw-r--r--3rdparty/assimp/code/MDCLoader.cpp472
-rw-r--r--3rdparty/assimp/code/MDCLoader.h132
-rw-r--r--3rdparty/assimp/code/MDCNormalTable.h299
-rw-r--r--3rdparty/assimp/code/MDLDefaultColorMap.h118
-rw-r--r--3rdparty/assimp/code/MDLFileData.h959
-rw-r--r--3rdparty/assimp/code/MDLLoader.cpp1929
-rw-r--r--3rdparty/assimp/code/MDLLoader.h460
-rw-r--r--3rdparty/assimp/code/MDLMaterialLoader.cpp823
-rw-r--r--3rdparty/assimp/code/MS3DLoader.cpp645
-rw-r--r--3rdparty/assimp/code/MS3DLoader.h158
-rw-r--r--3rdparty/assimp/code/MakeVerboseFormat.cpp218
-rw-r--r--3rdparty/assimp/code/MakeVerboseFormat.h106
-rw-r--r--3rdparty/assimp/code/MaterialSystem.cpp612
-rw-r--r--3rdparty/assimp/code/MaterialSystem.h246
-rw-r--r--3rdparty/assimp/code/MemoryIOWrapper.h181
-rw-r--r--3rdparty/assimp/code/NDOLoader.cpp289
-rw-r--r--3rdparty/assimp/code/NDOLoader.h116
-rw-r--r--3rdparty/assimp/code/NFFLoader.cpp1256
-rw-r--r--3rdparty/assimp/code/NFFLoader.h216
-rw-r--r--3rdparty/assimp/code/OFFLoader.cpp211
-rw-r--r--3rdparty/assimp/code/OFFLoader.h96
-rw-r--r--3rdparty/assimp/code/ObjFileData.h324
-rw-r--r--3rdparty/assimp/code/ObjFileImporter.cpp521
-rw-r--r--3rdparty/assimp/code/ObjFileImporter.h136
-rw-r--r--3rdparty/assimp/code/ObjFileMtlImporter.cpp294
-rw-r--r--3rdparty/assimp/code/ObjFileMtlImporter.h115
-rw-r--r--3rdparty/assimp/code/ObjFileParser.cpp665
-rw-r--r--3rdparty/assimp/code/ObjFileParser.h137
-rw-r--r--3rdparty/assimp/code/ObjTools.h220
-rw-r--r--3rdparty/assimp/code/OgreImporter.cpp876
-rw-r--r--3rdparty/assimp/code/OgreImporter.h142
-rw-r--r--3rdparty/assimp/code/OgreImporterMaterial.cpp255
-rw-r--r--3rdparty/assimp/code/OgreXmlHelper.h79
-rw-r--r--3rdparty/assimp/code/OptimizeGraph.cpp347
-rw-r--r--3rdparty/assimp/code/OptimizeGraph.h147
-rw-r--r--3rdparty/assimp/code/OptimizeMeshes.cpp243
-rw-r--r--3rdparty/assimp/code/OptimizeMeshes.h187
-rw-r--r--3rdparty/assimp/code/ParsingUtils.h181
-rw-r--r--3rdparty/assimp/code/PlyLoader.cpp1050
-rw-r--r--3rdparty/assimp/code/PlyLoader.h174
-rw-r--r--3rdparty/assimp/code/PlyParser.cpp919
-rw-r--r--3rdparty/assimp/code/PlyParser.h501
-rw-r--r--3rdparty/assimp/code/PretransformVertices.cpp711
-rw-r--r--3rdparty/assimp/code/PretransformVertices.h166
-rw-r--r--3rdparty/assimp/code/ProcessHelper.h564
-rw-r--r--3rdparty/assimp/code/Profiler.h97
-rw-r--r--3rdparty/assimp/code/Q3BSPFileData.h228
-rw-r--r--3rdparty/assimp/code/Q3BSPFileImporter.cpp731
-rw-r--r--3rdparty/assimp/code/Q3BSPFileImporter.h110
-rw-r--r--3rdparty/assimp/code/Q3BSPFileParser.cpp272
-rw-r--r--3rdparty/assimp/code/Q3BSPFileParser.h89
-rw-r--r--3rdparty/assimp/code/Q3BSPZipArchive.cpp196
-rw-r--r--3rdparty/assimp/code/Q3BSPZipArchive.h182
-rw-r--r--3rdparty/assimp/code/Q3DLoader.cpp600
-rw-r--r--3rdparty/assimp/code/Q3DLoader.h135
-rw-r--r--3rdparty/assimp/code/RawLoader.cpp312
-rw-r--r--3rdparty/assimp/code/RawLoader.h123
-rw-r--r--3rdparty/assimp/code/RemoveComments.cpp108
-rw-r--r--3rdparty/assimp/code/RemoveComments.h88
-rw-r--r--3rdparty/assimp/code/RemoveRedundantMaterials.cpp204
-rw-r--r--3rdparty/assimp/code/RemoveRedundantMaterials.h107
-rw-r--r--3rdparty/assimp/code/RemoveVCProcess.cpp328
-rw-r--r--3rdparty/assimp/code/RemoveVCProcess.h123
-rw-r--r--3rdparty/assimp/code/SGSpatialSort.cpp169
-rw-r--r--3rdparty/assimp/code/SGSpatialSort.h139
-rw-r--r--3rdparty/assimp/code/SMDLoader.cpp1129
-rw-r--r--3rdparty/assimp/code/SMDLoader.h420
-rw-r--r--3rdparty/assimp/code/STLLoader.cpp398
-rw-r--r--3rdparty/assimp/code/STLLoader.h119
-rw-r--r--3rdparty/assimp/code/SceneCombiner.cpp1133
-rw-r--r--3rdparty/assimp/code/SceneCombiner.h365
-rw-r--r--3rdparty/assimp/code/ScenePreprocessor.cpp281
-rw-r--r--3rdparty/assimp/code/ScenePreprocessor.h116
-rw-r--r--3rdparty/assimp/code/SkeletonMeshBuilder.cpp267
-rw-r--r--3rdparty/assimp/code/SkeletonMeshBuilder.h122
-rw-r--r--3rdparty/assimp/code/SmoothingGroups.h103
-rw-r--r--3rdparty/assimp/code/SmoothingGroups.inl138
-rw-r--r--3rdparty/assimp/code/SortByPTypeProcess.cpp405
-rw-r--r--3rdparty/assimp/code/SortByPTypeProcess.h88
-rw-r--r--3rdparty/assimp/code/SpatialSort.cpp347
-rw-r--r--3rdparty/assimp/code/SpatialSort.h170
-rw-r--r--3rdparty/assimp/code/SplitLargeMeshes.cpp677
-rw-r--r--3rdparty/assimp/code/SplitLargeMeshes.h216
-rw-r--r--3rdparty/assimp/code/StandardShapes.cpp502
-rw-r--r--3rdparty/assimp/code/StandardShapes.h196
-rw-r--r--3rdparty/assimp/code/StdOStreamLogStream.h52
-rw-r--r--3rdparty/assimp/code/StreamReader.h384
-rw-r--r--3rdparty/assimp/code/StringComparison.h217
-rw-r--r--3rdparty/assimp/code/Subdivision.cpp587
-rw-r--r--3rdparty/assimp/code/Subdivision.h124
-rw-r--r--3rdparty/assimp/code/TargetAnimation.cpp246
-rw-r--r--3rdparty/assimp/code/TargetAnimation.h179
-rw-r--r--3rdparty/assimp/code/TerragenLoader.cpp254
-rw-r--r--3rdparty/assimp/code/TerragenLoader.h107
-rw-r--r--3rdparty/assimp/code/TextureTransform.cpp563
-rw-r--r--3rdparty/assimp/code/TextureTransform.h225
-rw-r--r--3rdparty/assimp/code/TinyFormatter.h141
-rw-r--r--3rdparty/assimp/code/TriangulateProcess.cpp401
-rw-r--r--3rdparty/assimp/code/TriangulateProcess.h98
-rw-r--r--3rdparty/assimp/code/UnrealLoader.cpp426
-rw-r--r--3rdparty/assimp/code/UnrealLoader.h204
-rw-r--r--3rdparty/assimp/code/ValidateDataStructure.cpp968
-rw-r--r--3rdparty/assimp/code/ValidateDataStructure.h187
-rw-r--r--3rdparty/assimp/code/Vertex.h301
-rw-r--r--3rdparty/assimp/code/VertexTriangleAdjacency.cpp132
-rw-r--r--3rdparty/assimp/code/VertexTriangleAdjacency.h124
-rw-r--r--3rdparty/assimp/code/Win32DebugLogStream.h50
-rw-r--r--3rdparty/assimp/code/XFileHelper.h200
-rw-r--r--3rdparty/assimp/code/XFileImporter.cpp672
-rw-r--r--3rdparty/assimp/code/XFileImporter.h159
-rw-r--r--3rdparty/assimp/code/XFileParser.cpp1434
-rw-r--r--3rdparty/assimp/code/XFileParser.h162
-rw-r--r--3rdparty/assimp/code/aiAssert.cpp68
-rw-r--r--3rdparty/assimp/code/assbin_chunks.h196
-rw-r--r--3rdparty/assimp/code/fast_atof.h306
-rw-r--r--3rdparty/assimp/code/irrXMLWrapper.h131
-rw-r--r--3rdparty/assimp/code/pstdint.h729
-rw-r--r--3rdparty/assimp/code/qnan.h110
-rw-r--r--3rdparty/assimp/code/res/resource.h14
-rw-r--r--3rdparty/assimp/contrib/ConvertUTF/ConvertUTF.c539
-rw-r--r--3rdparty/assimp/contrib/ConvertUTF/ConvertUTF.h151
-rw-r--r--3rdparty/assimp/contrib/ConvertUTF/readme.txt43
-rw-r--r--3rdparty/assimp/contrib/irrXML/CXMLReaderImpl.h809
-rw-r--r--3rdparty/assimp/contrib/irrXML/heapsort.h73
-rw-r--r--3rdparty/assimp/contrib/irrXML/irrArray.h444
-rw-r--r--3rdparty/assimp/contrib/irrXML/irrString.h664
-rw-r--r--3rdparty/assimp/contrib/irrXML/irrTypes.h108
-rw-r--r--3rdparty/assimp/contrib/irrXML/irrXML.cpp152
-rw-r--r--3rdparty/assimp/contrib/irrXML/irrXML.h540
-rw-r--r--3rdparty/assimp/contrib/unzip/crypt.h132
-rw-r--r--3rdparty/assimp/contrib/unzip/ioapi.c181
-rw-r--r--3rdparty/assimp/contrib/unzip/ioapi.h75
-rw-r--r--3rdparty/assimp/contrib/unzip/unzip.c1604
-rw-r--r--3rdparty/assimp/contrib/unzip/unzip.h358
-rw-r--r--3rdparty/assimp/contrib/zlib/README115
-rw-r--r--3rdparty/assimp/contrib/zlib/adler32.c169
-rw-r--r--3rdparty/assimp/contrib/zlib/compress.c80
-rw-r--r--3rdparty/assimp/contrib/zlib/crc32.c442
-rw-r--r--3rdparty/assimp/contrib/zlib/crc32.h441
-rw-r--r--3rdparty/assimp/contrib/zlib/deflate.c1834
-rw-r--r--3rdparty/assimp/contrib/zlib/deflate.h342
-rw-r--r--3rdparty/assimp/contrib/zlib/inffast.c340
-rw-r--r--3rdparty/assimp/contrib/zlib/inffast.h11
-rw-r--r--3rdparty/assimp/contrib/zlib/inffixed.h94
-rw-r--r--3rdparty/assimp/contrib/zlib/inflate.c1480
-rw-r--r--3rdparty/assimp/contrib/zlib/inflate.h122
-rw-r--r--3rdparty/assimp/contrib/zlib/inftrees.c330
-rw-r--r--3rdparty/assimp/contrib/zlib/inftrees.h62
-rw-r--r--3rdparty/assimp/contrib/zlib/trees.c1244
-rw-r--r--3rdparty/assimp/contrib/zlib/trees.h128
-rw-r--r--3rdparty/assimp/contrib/zlib/zconf.h428
-rw-r--r--3rdparty/assimp/contrib/zlib/zconf.in.h332
-rw-r--r--3rdparty/assimp/contrib/zlib/zlib.h1613
-rw-r--r--3rdparty/assimp/contrib/zlib/zutil.c318
-rw-r--r--3rdparty/assimp/contrib/zlib/zutil.h274
-rw-r--r--3rdparty/assimp/include/Compiler/poppack1.h22
-rw-r--r--3rdparty/assimp/include/Compiler/pushpack1.h42
-rw-r--r--3rdparty/assimp/include/DefaultLogger.h190
-rw-r--r--3rdparty/assimp/include/IOStream.h135
-rw-r--r--3rdparty/assimp/include/IOSystem.h222
-rw-r--r--3rdparty/assimp/include/LogStream.h93
-rw-r--r--3rdparty/assimp/include/Logger.h234
-rw-r--r--3rdparty/assimp/include/NullLogger.h95
-rw-r--r--3rdparty/assimp/include/ProgressHandler.h93
-rw-r--r--3rdparty/assimp/include/aiAnim.h484
-rw-r--r--3rdparty/assimp/include/aiAssert.h30
-rw-r--r--3rdparty/assimp/include/aiCamera.h223
-rw-r--r--3rdparty/assimp/include/aiColor4D.h94
-rw-r--r--3rdparty/assimp/include/aiColor4D.inl140
-rw-r--r--3rdparty/assimp/include/aiConfig.h634
-rw-r--r--3rdparty/assimp/include/aiDefines.h279
-rw-r--r--3rdparty/assimp/include/aiFileIO.h135
-rw-r--r--3rdparty/assimp/include/aiLight.h233
-rw-r--r--3rdparty/assimp/include/aiMaterial.h1422
-rw-r--r--3rdparty/assimp/include/aiMaterial.inl191
-rw-r--r--3rdparty/assimp/include/aiMatrix3x3.h166
-rw-r--r--3rdparty/assimp/include/aiMatrix3x3.inl250
-rw-r--r--3rdparty/assimp/include/aiMatrix4x4.h240
-rw-r--r--3rdparty/assimp/include/aiMatrix4x4.inl419
-rw-r--r--3rdparty/assimp/include/aiMesh.h733
-rw-r--r--3rdparty/assimp/include/aiPostProcess.h604
-rw-r--r--3rdparty/assimp/include/aiQuaternion.h311
-rw-r--r--3rdparty/assimp/include/aiScene.h417
-rw-r--r--3rdparty/assimp/include/aiTexture.h198
-rw-r--r--3rdparty/assimp/include/aiTypes.h492
-rw-r--r--3rdparty/assimp/include/aiVector2D.h187
-rw-r--r--3rdparty/assimp/include/aiVector3D.h129
-rw-r--r--3rdparty/assimp/include/aiVector3D.inl180
-rw-r--r--3rdparty/assimp/include/aiVersion.h104
-rw-r--r--3rdparty/assimp/include/assimp.h434
-rw-r--r--3rdparty/assimp/include/assimp.hpp609
-rw-r--r--3rdparty/assimp/revision.h1
-rw-r--r--3rdparty/lib3ds/README15
-rw-r--r--3rdparty/lib3ds/atmosphere.c296
-rw-r--r--3rdparty/lib3ds/atmosphere.h100
-rw-r--r--3rdparty/lib3ds/background.c255
-rw-r--r--3rdparty/lib3ds/background.h85
-rw-r--r--3rdparty/lib3ds/camera.c231
-rw-r--r--3rdparty/lib3ds/camera.h61
-rw-r--r--3rdparty/lib3ds/chunk.c320
-rw-r--r--3rdparty/lib3ds/chunk.h290
-rw-r--r--3rdparty/lib3ds/chunktable.h264
-rw-r--r--3rdparty/lib3ds/chunktable.sed62
-rw-r--r--3rdparty/lib3ds/ease.c62
-rw-r--r--3rdparty/lib3ds/ease.h41
-rw-r--r--3rdparty/lib3ds/file.c2029
-rw-r--r--3rdparty/lib3ds/file.h106
-rw-r--r--3rdparty/lib3ds/io.c524
-rw-r--r--3rdparty/lib3ds/io.h82
-rw-r--r--3rdparty/lib3ds/lib3ds.pri44
-rw-r--r--3rdparty/lib3ds/light.c414
-rw-r--r--3rdparty/lib3ds/light.h79
-rw-r--r--3rdparty/lib3ds/material.c1089
-rw-r--r--3rdparty/lib3ds/material.h170
-rw-r--r--3rdparty/lib3ds/matrix.c718
-rw-r--r--3rdparty/lib3ds/matrix.h63
-rw-r--r--3rdparty/lib3ds/mesh.c1056
-rw-r--r--3rdparty/lib3ds/mesh.h157
-rw-r--r--3rdparty/lib3ds/node.c1089
-rw-r--r--3rdparty/lib3ds/node.h188
-rw-r--r--3rdparty/lib3ds/quat.c418
-rw-r--r--3rdparty/lib3ds/quat.h61
-rw-r--r--3rdparty/lib3ds/shadow.c149
-rw-r--r--3rdparty/lib3ds/shadow.h59
-rw-r--r--3rdparty/lib3ds/tcb.c136
-rw-r--r--3rdparty/lib3ds/tcb.h62
-rw-r--r--3rdparty/lib3ds/tracks.c1556
-rw-r--r--3rdparty/lib3ds/tracks.h209
-rw-r--r--3rdparty/lib3ds/types.h159
-rw-r--r--3rdparty/lib3ds/types.txt96
-rw-r--r--3rdparty/lib3ds/vector.c376
-rw-r--r--3rdparty/lib3ds/vector.h58
-rw-r--r--3rdparty/lib3ds/viewport.c413
-rw-r--r--3rdparty/lib3ds/viewport.h137
-rw-r--r--LGPL_EXCEPTION.txt22
-rw-r--r--LICENSE.FDL450
-rw-r--r--LICENSE.LGPL514
-rw-r--r--LICENSE.PREVIEW.COMMERCIAL629
-rw-r--r--README116
-rw-r--r--debian/changelog5
-rw-r--r--debian/compat1
-rw-r--r--debian/control33
-rw-r--r--debian/copyright106
-rw-r--r--debian/docs2
-rw-r--r--debian/libqt4-3d-dev.install2
-rw-r--r--debian/libqt4-3d-examples.install4
-rw-r--r--debian/libqt4-3d.install4
-rwxr-xr-xdebian/rules47
-rw-r--r--demos/demos.pro2
-rw-r--r--demos/qt3d/README14
-rw-r--r--demos/qt3d/cubehouse/cube.qrc7
-rw-r--r--demos/qt3d/cubehouse/cubehouse.desktop7
-rw-r--r--demos/qt3d/cubehouse/cubehouse.pro22
-rw-r--r--demos/qt3d/cubehouse/cubehouse.rc1
-rw-r--r--demos/qt3d/cubehouse/cubeview.cpp460
-rw-r--r--demos/qt3d/cubehouse/cubeview.h108
-rw-r--r--demos/qt3d/cubehouse/main.cpp70
-rw-r--r--demos/qt3d/cubehouse/projectivetextureeffect.cpp148
-rw-r--r--demos/qt3d/cubehouse/projectivetextureeffect.h79
-rw-r--r--demos/qt3d/cubehouse/qt3d.icobin67646 -> 0 bytes
-rw-r--r--demos/qt3d/cubehouse/qt3d.pngbin3677 -> 0 bytes
-rw-r--r--demos/qt3d/cubehouse/qtlogo.pngbin13923 -> 0 bytes
-rw-r--r--demos/qt3d/cubehouse/shaders/depth.frag50
-rw-r--r--demos/qt3d/cubehouse/shaders/depth.vert75
-rw-r--r--demos/qt3d/cubehouse/shaders/depthTestShader.frag91
-rw-r--r--demos/qt3d/cubehouse/shaders/depthTestShader.vert91
-rw-r--r--demos/qt3d/cubehouse/shaders/objectlineartexgen.frag52
-rw-r--r--demos/qt3d/cubehouse/shaders/objectlineartexgen.vert63
-rw-r--r--demos/qt3d/pageflip/gradient.pngbin229 -> 0 bytes
-rw-r--r--demos/qt3d/pageflip/pageflip.cpp388
-rw-r--r--demos/qt3d/pageflip/pageflip.desktop7
-rw-r--r--demos/qt3d/pageflip/pageflip.pro17
-rw-r--r--demos/qt3d/pageflip/pageflip.qrc9
-rw-r--r--demos/qt3d/pageflip/pageflip.rc1
-rw-r--r--demos/qt3d/pageflip/pageflipmath.cpp592
-rw-r--r--demos/qt3d/pageflip/pageflipmath_p.h120
-rw-r--r--demos/qt3d/pageflip/qqpage1.pngbin77887 -> 0 bytes
-rw-r--r--demos/qt3d/pageflip/qqpage2.pngbin74710 -> 0 bytes
-rw-r--r--demos/qt3d/pageflip/qqpage3.pngbin73043 -> 0 bytes
-rw-r--r--demos/qt3d/pageflip/qqpage4.pngbin78092 -> 0 bytes
-rw-r--r--demos/qt3d/pageflip/qt3d.icobin67646 -> 0 bytes
-rw-r--r--demos/qt3d/pageflip/qt3d.pngbin3677 -> 0 bytes
-rw-r--r--demos/qt3d/photobrowser3d/buttons.cpp134
-rw-r--r--demos/qt3d/photobrowser3d/buttons.h62
-rw-r--r--demos/qt3d/photobrowser3d/bytereader.cpp158
-rw-r--r--demos/qt3d/photobrowser3d/bytereader.h69
-rw-r--r--demos/qt3d/photobrowser3d/filescanner.cpp127
-rw-r--r--demos/qt3d/photobrowser3d/filescanner.h79
-rw-r--r--demos/qt3d/photobrowser3d/imagedisplay.cpp224
-rw-r--r--demos/qt3d/photobrowser3d/imagedisplay.h88
-rw-r--r--demos/qt3d/photobrowser3d/imageloader.cpp115
-rw-r--r--demos/qt3d/photobrowser3d/imageloader.h83
-rw-r--r--demos/qt3d/photobrowser3d/imagemanager.cpp133
-rw-r--r--demos/qt3d/photobrowser3d/imagemanager.h78
-rw-r--r--demos/qt3d/photobrowser3d/images/P1000223.JPGbin29760 -> 0 bytes
-rw-r--r--demos/qt3d/photobrowser3d/images/P1000228.JPGbin27685 -> 0 bytes
-rw-r--r--demos/qt3d/photobrowser3d/images/P1000472.JPGbin25850 -> 0 bytes
-rw-r--r--demos/qt3d/photobrowser3d/images/arrows-left.pngbin5303 -> 0 bytes
-rw-r--r--demos/qt3d/photobrowser3d/images/arrows.xcfbin289659 -> 0 bytes
-rw-r--r--demos/qt3d/photobrowser3d/images/default_sky_base.xcfbin93208 -> 0 bytes
-rw-r--r--demos/qt3d/photobrowser3d/images/default_sky_down.pngbin249343 -> 0 bytes
-rw-r--r--demos/qt3d/photobrowser3d/images/default_sky_east.pngbin367747 -> 0 bytes
-rw-r--r--demos/qt3d/photobrowser3d/images/default_sky_north.pngbin331943 -> 0 bytes
-rw-r--r--demos/qt3d/photobrowser3d/images/default_sky_south.pngbin407823 -> 0 bytes
-rw-r--r--demos/qt3d/photobrowser3d/images/default_sky_up.pngbin127393 -> 0 bytes
-rw-r--r--demos/qt3d/photobrowser3d/images/default_sky_west.pngbin362244 -> 0 bytes
-rw-r--r--demos/qt3d/photobrowser3d/images/girder.pngbin196973 -> 0 bytes
-rw-r--r--demos/qt3d/photobrowser3d/launcher.cpp115
-rw-r--r--demos/qt3d/photobrowser3d/main.cpp83
-rw-r--r--demos/qt3d/photobrowser3d/pancontroller.cpp244
-rw-r--r--demos/qt3d/photobrowser3d/pancontroller.h92
-rw-r--r--demos/qt3d/photobrowser3d/photobrowser.rc1
-rw-r--r--demos/qt3d/photobrowser3d/photobrowser3d.desktop7
-rw-r--r--demos/qt3d/photobrowser3d/photobrowser3d.pro71
-rw-r--r--demos/qt3d/photobrowser3d/photobrowser3d.qrc23
-rw-r--r--demos/qt3d/photobrowser3d/photobrowser3dview.cpp446
-rw-r--r--demos/qt3d/photobrowser3d/photobrowser3dview.h116
-rw-r--r--demos/qt3d/photobrowser3d/qatlas.cpp188
-rw-r--r--demos/qt3d/photobrowser3d/qatlas.h104
-rw-r--r--demos/qt3d/photobrowser3d/qfocusadaptor.cpp187
-rw-r--r--demos/qt3d/photobrowser3d/qfocusadaptor.h82
-rw-r--r--demos/qt3d/photobrowser3d/qphotobrowser3dscene.cpp58
-rw-r--r--demos/qt3d/photobrowser3d/qphotobrowser3dscene.h62
-rw-r--r--demos/qt3d/photobrowser3d/qt3d.icobin67646 -> 0 bytes
-rw-r--r--demos/qt3d/photobrowser3d/qt3d.pngbin3677 -> 0 bytes
-rw-r--r--demos/qt3d/photobrowser3d/shaders/replace_texture.fsh54
-rw-r--r--demos/qt3d/photobrowser3d/shaders/replace_texture.vsh58
-rw-r--r--demos/qt3d/photobrowser3d/skybox.cpp223
-rw-r--r--demos/qt3d/photobrowser3d/skybox.h72
-rw-r--r--demos/qt3d/photobrowser3d/threadpool.cpp135
-rw-r--r--demos/qt3d/photobrowser3d/threadpool.h81
-rw-r--r--demos/qt3d/photobrowser3d/thumbnailableimage.cpp302
-rw-r--r--demos/qt3d/photobrowser3d/thumbnailableimage.h101
-rw-r--r--demos/qt3d/photobrowser3d/thumbnaileffect.cpp186
-rw-r--r--demos/qt3d/photobrowser3d/thumbnaileffect.h70
-rw-r--r--demos/qt3d/photobrowser3d/thumbnailnode.cpp281
-rw-r--r--demos/qt3d/photobrowser3d/thumbnailnode.h96
-rw-r--r--demos/qt3d/qt3d.pro2
-rw-r--r--demos/qt3d/qt3d.svg32
-rw-r--r--demos/qt3d/shapes/qt3d.icobin67646 -> 0 bytes
-rw-r--r--demos/qt3d/shapes/qt3d.pngbin3677 -> 0 bytes
-rw-r--r--demos/qt3d/shapes/shapes.cpp430
-rw-r--r--demos/qt3d/shapes/shapes.desktop7
-rw-r--r--demos/qt3d/shapes/shapes.pro14
-rw-r--r--demos/qt3d/shapes/shapes.rc1
-rw-r--r--demos/qt3d/teaservice/README7
-rw-r--r--demos/qt3d/teaservice/meshobject.cpp155
-rw-r--r--demos/qt3d/teaservice/meshobject.h117
-rw-r--r--demos/qt3d/teaservice/per_pixel_lighting.fsh112
-rw-r--r--demos/qt3d/teaservice/per_pixel_lighting.vsh96
-rw-r--r--demos/qt3d/teaservice/perpixeleffect.cpp52
-rw-r--r--demos/qt3d/teaservice/perpixeleffect.h58
-rw-r--r--demos/qt3d/teaservice/qt3d.icobin67646 -> 0 bytes
-rw-r--r--demos/qt3d/teaservice/qt3d.pngbin3677 -> 0 bytes
-rw-r--r--demos/qt3d/teaservice/sceneobject.cpp72
-rw-r--r--demos/qt3d/teaservice/sceneobject.h63
-rw-r--r--demos/qt3d/teaservice/teacup.txt280
-rw-r--r--demos/qt3d/teaservice/teaservice.cpp386
-rw-r--r--demos/qt3d/teaservice/teaservice.desktop7
-rw-r--r--demos/qt3d/teaservice/teaservice.pro17
-rw-r--r--demos/qt3d/teaservice/teaservice.qrc8
-rw-r--r--demos/qt3d/teaservice/teaservice.rc1
-rw-r--r--demos/qt3d/teaservice/teaspoon.txt275
-rw-r--r--demos/quick3d/flickr3d/flickr3d.desktop7
-rw-r--r--demos/quick3d/flickr3d/flickr3d.pro20
-rw-r--r--demos/quick3d/flickr3d/flickr3d.rc1
-rw-r--r--demos/quick3d/flickr3d/main.cpp69
-rw-r--r--demos/quick3d/flickr3d/qml/common/RssModel.qml66
-rw-r--r--demos/quick3d/flickr3d/qml/common/qmldir10
-rw-r--r--demos/quick3d/flickr3d/qml/flickr3d.qml113
-rw-r--r--demos/quick3d/flickr3d/qml/skybox/default_sky_down.pngbin249343 -> 0 bytes
-rw-r--r--demos/quick3d/flickr3d/qml/skybox/default_sky_east.pngbin367747 -> 0 bytes
-rw-r--r--demos/quick3d/flickr3d/qml/skybox/default_sky_north.pngbin331943 -> 0 bytes
-rw-r--r--demos/quick3d/flickr3d/qml/skybox/default_sky_south.pngbin407823 -> 0 bytes
-rw-r--r--demos/quick3d/flickr3d/qml/skybox/default_sky_up.pngbin127393 -> 0 bytes
-rw-r--r--demos/quick3d/flickr3d/qml/skybox/default_sky_west.pngbin362244 -> 0 bytes
-rw-r--r--demos/quick3d/flickr3d/qtquick3d.icobin67646 -> 0 bytes
-rw-r--r--demos/quick3d/model_viewer/main.cpp68
-rw-r--r--demos/quick3d/model_viewer/model_viewer.desktop7
-rw-r--r--demos/quick3d/model_viewer/model_viewer.pro25
-rw-r--r--demos/quick3d/model_viewer/model_viewer.rc1
-rw-r--r--demos/quick3d/model_viewer/qml/FourButtons.qml74
-rw-r--r--demos/quick3d/model_viewer/qml/LongButton.qml69
-rw-r--r--demos/quick3d/model_viewer/qml/MainButton.qml66
-rw-r--r--demos/quick3d/model_viewer/qml/ShortButton.qml71
-rw-r--r--demos/quick3d/model_viewer/qml/images/arrow.pngbin1338 -> 0 bytes
-rw-r--r--demos/quick3d/model_viewer/qml/images/arrow.svg74
-rw-r--r--demos/quick3d/model_viewer/qml/images/cog.svg127
-rw-r--r--demos/quick3d/model_viewer/qml/images/cog2.svg126
-rw-r--r--demos/quick3d/model_viewer/qml/images/knob.pngbin1888 -> 0 bytes
-rw-r--r--demos/quick3d/model_viewer/qml/images/knob.svg867
-rw-r--r--demos/quick3d/model_viewer/qml/images/test.svg136
-rw-r--r--demos/quick3d/model_viewer/qml/images/zoomin.pngbin4970 -> 0 bytes
-rw-r--r--demos/quick3d/model_viewer/qml/images/zoomin.svg74
-rw-r--r--demos/quick3d/model_viewer/qml/images/zoomout.pngbin4798 -> 0 bytes
-rw-r--r--demos/quick3d/model_viewer/qml/images/zoomout.svg169
-rw-r--r--demos/quick3d/model_viewer/qml/meshes/monkey.3dsbin13886 -> 0 bytes
-rw-r--r--demos/quick3d/model_viewer/qml/meshes/penguin.3dsbin36301 -> 0 bytes
-rw-r--r--demos/quick3d/model_viewer/qml/model_viewer.qml272
-rw-r--r--demos/quick3d/model_viewer/qtquick3d.icobin67646 -> 0 bytes
-rw-r--r--demos/quick3d/model_viewer/qtquick3d.pngbin4050 -> 0 bytes
-rw-r--r--demos/quick3d/qmlres.h129
-rw-r--r--demos/quick3d/qtquick3d.svg23
-rw-r--r--demos/quick3d/quick3d.pro2
-rw-r--r--demos/quick3d/robo_bounce/main.cpp71
-rw-r--r--demos/quick3d/robo_bounce/qml/Assets/QML3DSign.pngbin105968 -> 0 bytes
-rw-r--r--demos/quick3d/robo_bounce/qml/Assets/button.pngbin726 -> 0 bytes
-rw-r--r--demos/quick3d/robo_bounce/qml/Assets/calculatorSign.pngbin154325 -> 0 bytes
-rw-r--r--demos/quick3d/robo_bounce/qml/Assets/cubeButton.pngbin1470 -> 0 bytes
-rw-r--r--demos/quick3d/robo_bounce/qml/Assets/hazard.pngbin64685 -> 0 bytes
-rw-r--r--demos/quick3d/robo_bounce/qml/Assets/infobutton.pngbin2252 -> 0 bytes
-rw-r--r--demos/quick3d/robo_bounce/qml/Assets/qtlogo.pngbin48309 -> 0 bytes
-rw-r--r--demos/quick3d/robo_bounce/qml/Assets/roboInfo.pngbin19189 -> 0 bytes
-rw-r--r--demos/quick3d/robo_bounce/qml/Assets/roboticArms.3dsbin68300 -> 0 bytes
-rw-r--r--demos/quick3d/robo_bounce/qml/Assets/roboticBody.3dsbin76250 -> 0 bytes
-rw-r--r--demos/quick3d/robo_bounce/qml/Assets/roboticHead.3dsbin47828 -> 0 bytes
-rw-r--r--demos/quick3d/robo_bounce/qml/Assets/rotateButton2.pngbin1804 -> 0 bytes
-rw-r--r--demos/quick3d/robo_bounce/qml/Assets/sQt3D_logo.pngbin76681 -> 0 bytes
-rw-r--r--demos/quick3d/robo_bounce/qml/Assets/tronscape.pngbin311759 -> 0 bytes
-rw-r--r--demos/quick3d/robo_bounce/qml/Calculator/Calculator.qml187
-rw-r--r--demos/quick3d/robo_bounce/qml/Calculator/CalculatorCore/Button.qml97
-rw-r--r--demos/quick3d/robo_bounce/qml/Calculator/CalculatorCore/Display.qml68
-rw-r--r--demos/quick3d/robo_bounce/qml/Calculator/CalculatorCore/calculator.js91
-rw-r--r--demos/quick3d/robo_bounce/qml/Calculator/CalculatorCore/images/button-.pngbin1288 -> 0 bytes
-rw-r--r--demos/quick3d/robo_bounce/qml/Calculator/CalculatorCore/images/button-blue.pngbin1565 -> 0 bytes
-rw-r--r--demos/quick3d/robo_bounce/qml/Calculator/CalculatorCore/images/button-green.pngbin1543 -> 0 bytes
-rw-r--r--demos/quick3d/robo_bounce/qml/Calculator/CalculatorCore/images/button-purple.pngbin1566 -> 0 bytes
-rw-r--r--demos/quick3d/robo_bounce/qml/Calculator/CalculatorCore/images/button-red.pngbin1586 -> 0 bytes
-rw-r--r--demos/quick3d/robo_bounce/qml/Calculator/CalculatorCore/images/display.pngbin998 -> 0 bytes
-rw-r--r--demos/quick3d/robo_bounce/qml/Calculator/CalculatorCore/qmldir2
-rw-r--r--demos/quick3d/robo_bounce/qml/RobotCore/PushButton.qml69
-rw-r--r--demos/quick3d/robo_bounce/qml/RobotCore/QMLPanels.qml102
-rw-r--r--demos/quick3d/robo_bounce/qml/RobotCore/Robot.qml51
-rw-r--r--demos/quick3d/robo_bounce/qml/RobotCore/TronCube.qml50
-rw-r--r--demos/quick3d/robo_bounce/qml/robobounce.qml609
-rw-r--r--demos/quick3d/robo_bounce/qtquick3d.icobin67646 -> 0 bytes
-rw-r--r--demos/quick3d/robo_bounce/qtquick3d.pngbin4050 -> 0 bytes
-rw-r--r--demos/quick3d/robo_bounce/robo_bounce.desktop7
-rw-r--r--demos/quick3d/robo_bounce/robo_bounce.pro22
-rw-r--r--demos/quick3d/robo_bounce/robo_bounce.qrc34
-rw-r--r--demos/quick3d/robo_bounce/robo_bounce.rc1
-rw-r--r--demos/quick3d/tea_service/main.cpp69
-rw-r--r--demos/quick3d/tea_service/qml/Teacup.qml68
-rw-r--r--demos/quick3d/tea_service/qml/Teaspoon.qml72
-rw-r--r--demos/quick3d/tea_service/qml/teacup.bez280
-rw-r--r--demos/quick3d/tea_service/qml/teapot-body.bez332
-rw-r--r--demos/quick3d/tea_service/qml/teapot-handle.bez312
-rw-r--r--demos/quick3d/tea_service/qml/teapot-spout.bez312
-rw-r--r--demos/quick3d/tea_service/qml/teaservice.qml382
-rw-r--r--demos/quick3d/tea_service/qml/teaservice.qmlproject16
-rw-r--r--demos/quick3d/tea_service/qml/teaspoon.bez275
-rw-r--r--demos/quick3d/tea_service/qtquick3d.icobin67646 -> 0 bytes
-rw-r--r--demos/quick3d/tea_service/qtquick3d.pngbin4050 -> 0 bytes
-rw-r--r--demos/quick3d/tea_service/tea_service.desktop7
-rw-r--r--demos/quick3d/tea_service/tea_service.pro16
-rw-r--r--demos/quick3d/tea_service/tea_service.rc1
-rw-r--r--devices/README5
-rw-r--r--devices/maemo5/debian/changelog5
-rw-r--r--devices/maemo5/debian/compat1
-rw-r--r--devices/maemo5/debian/control33
-rw-r--r--devices/maemo5/debian/copyright106
-rw-r--r--devices/maemo5/debian/docs2
-rw-r--r--devices/maemo5/debian/libqt4-3d-dev.install3
-rw-r--r--devices/maemo5/debian/libqt4-3d-examples.install4
-rw-r--r--devices/maemo5/debian/libqt4-3d-tests.install4
-rw-r--r--devices/maemo5/debian/libqt4-3d.install4
-rwxr-xr-xdevices/maemo5/debian/rules47
-rw-r--r--devices/symbian/examples/examples.pro2
-rw-r--r--devices/symbian/examples/generate_examples_pkg.pl145
-rw-r--r--devices/symbian/symbian.pro62
-rw-r--r--devices/ubuntu/debian/libqt4-3d-examples.install4
-rwxr-xr-xdevices/ubuntu/debian/rules52
-rw-r--r--doc/config/compat.qdocconf31
-rw-r--r--doc/config/images/arrow_down.pngbin177 -> 0 bytes
-rwxr-xr-xdoc/config/images/bg_l.pngbin100 -> 0 bytes
-rwxr-xr-xdoc/config/images/bg_l_blank.pngbin84 -> 0 bytes
-rw-r--r--doc/config/images/bg_ll_blank.pngbin320 -> 0 bytes
-rwxr-xr-xdoc/config/images/bg_r.pngbin96 -> 0 bytes
-rw-r--r--doc/config/images/bg_ul_blank.pngbin304 -> 0 bytes
-rwxr-xr-xdoc/config/images/box_bg.pngbin89 -> 0 bytes
-rwxr-xr-xdoc/config/images/breadcrumb.pngbin134 -> 0 bytes
-rw-r--r--doc/config/images/bullet_dn.pngbin230 -> 0 bytes
-rwxr-xr-xdoc/config/images/bullet_gt.pngbin124 -> 0 bytes
-rwxr-xr-xdoc/config/images/bullet_sq.pngbin74 -> 0 bytes
-rw-r--r--doc/config/images/bullet_up.pngbin210 -> 0 bytes
-rwxr-xr-xdoc/config/images/feedbackground.pngbin263 -> 0 bytes
-rw-r--r--doc/config/images/header_bg.pngbin114 -> 0 bytes
-rwxr-xr-xdoc/config/images/horBar.pngbin2807 -> 0 bytes
-rw-r--r--doc/config/images/page.pngbin3102 -> 0 bytes
-rwxr-xr-xdoc/config/images/page_bg.pngbin84 -> 0 bytes
-rw-r--r--doc/config/images/qt-logo.pngbin5149 -> 0 bytes
-rw-r--r--doc/config/images/spinner.gifbin2037 -> 0 bytes
-rwxr-xr-xdoc/config/images/sprites-combined.pngbin62534 -> 0 bytes
-rw-r--r--doc/config/macros.qdocconf37
-rw-r--r--doc/config/qt-cpp-ignore.qdocconf99
-rw-r--r--doc/config/qt-defines.qdocconf17
-rw-r--r--doc/config/qt-html-default-styles.qdocconf35
-rw-r--r--doc/config/qt-html-online-styles.qdocconf75
-rw-r--r--doc/config/qt-html-templates-online.qdocconf205
-rw-r--r--doc/config/qt-html-templates.qdocconf57
-rw-r--r--doc/config/qt3d-online.qdocconf2
-rw-r--r--doc/config/qt3d-project.qdocconf39
-rw-r--r--doc/config/qt3d.qdocconf2
-rw-r--r--doc/config/scripts/functions.js258
-rw-r--r--doc/config/scripts/jquery.js152
-rw-r--r--doc/config/scripts/narrow.js133
-rw-r--r--doc/config/scripts/superfish.js121
-rw-r--r--doc/config/style/narrow.css271
-rw-r--r--doc/config/style/offline.css673
-rw-r--r--doc/config/style/style.css1731
-rw-r--r--doc/config/style/style_ie6.css54
-rw-r--r--doc/config/style/style_ie7.css19
-rw-r--r--doc/config/style/style_ie8.css0
-rw-r--r--doc/config/style/superfish.css51
-rw-r--r--doc/doc.pri32
-rw-r--r--doc/src/acceptance/qt3d-acceptance.qdoc239
-rw-r--r--doc/src/camera-frustum.qdoc240
-rw-r--r--doc/src/classes.qdoc100
-rw-r--r--doc/src/classic.css284
-rw-r--r--doc/src/demos/monkeygod.qdoc38
-rw-r--r--doc/src/demos/pageflip.qdoc39
-rw-r--r--doc/src/demos/shapes.qdoc38
-rw-r--r--doc/src/demos/teaservice-qml.qdoc44
-rw-r--r--doc/src/demos/teaservice.qdoc43
-rw-r--r--doc/src/examples/basket.qdoc80
-rw-r--r--doc/src/examples/nesting.qdoc134
-rw-r--r--doc/src/examples/teapot-qml.qdoc73
-rw-r--r--doc/src/examples/teapot.qdoc101
-rw-r--r--doc/src/images/REAME-ODF5
-rw-r--r--doc/src/images/affine-transform.odfbin4948 -> 0 bytes
-rw-r--r--doc/src/images/affine-transform.pngbin2739 -> 0 bytes
-rw-r--r--doc/src/images/attenuation.odfbin5273 -> 0 bytes
-rw-r--r--doc/src/images/attenuation.pngbin1894 -> 0 bytes
-rw-r--r--doc/src/images/basket-screenshot.pngbin50121 -> 0 bytes
-rw-r--r--doc/src/images/build-qt3d-qtcreator-1.pngbin176557 -> 0 bytes
-rw-r--r--doc/src/images/build-qt3d-qtcreator-2.pngbin188352 -> 0 bytes
-rw-r--r--doc/src/images/build-qt3d-qtcreator-3.pngbin80302 -> 0 bytes
-rw-r--r--doc/src/images/build-qt3d-qtcreator-4.pngbin196664 -> 0 bytes
-rw-r--r--doc/src/images/build-qt3d-qtcreator-5.pngbin181923 -> 0 bytes
-rw-r--r--doc/src/images/build-qt3d-qtcreator-6.pngbin187095 -> 0 bytes
-rw-r--r--doc/src/images/build-qt3d-qtcreator-7.pngbin142962 -> 0 bytes
-rw-r--r--doc/src/images/build-qt3d-qtcreator-8.pngbin145519 -> 0 bytes
-rw-r--r--doc/src/images/build-qt3d-qtcreator-9.pngbin204220 -> 0 bytes
-rw-r--r--doc/src/images/build-qt3d-qtcreator-set-to-release.pngbin21295 -> 0 bytes
-rw-r--r--doc/src/images/cube-screenshot.pngbin19476 -> 0 bytes
-rw-r--r--doc/src/images/cylinder-texture-coords.pngbin26839 -> 0 bytes
-rw-r--r--doc/src/images/faceted-q.pngbin16750 -> 0 bytes
-rw-r--r--doc/src/images/forest-screenshot.pngbin17397 -> 0 bytes
-rw-r--r--doc/src/images/forest-screenshot2.pngbin17598 -> 0 bytes
-rw-r--r--doc/src/images/forest-screenshot3.pngbin13444 -> 0 bytes
-rw-r--r--doc/src/images/gradient.pngbin222 -> 0 bytes
-rw-r--r--doc/src/images/imports-dir.pngbin22251 -> 0 bytes
-rw-r--r--doc/src/images/line-int-1.pngbin4951 -> 0 bytes
-rw-r--r--doc/src/images/line-int-2.pngbin3430 -> 0 bytes
-rw-r--r--doc/src/images/line-intersection.odfbin4699 -> 0 bytes
-rw-r--r--doc/src/images/line-intersection.pdfbin38106 -> 0 bytes
-rw-r--r--doc/src/images/line-intersection2.odfbin4608 -> 0 bytes
-rw-r--r--doc/src/images/line-intersection2.pdfbin34557 -> 0 bytes
-rw-r--r--doc/src/images/monkeygod-screenshot.pngbin63435 -> 0 bytes
-rw-r--r--doc/src/images/moon-screenshot.pngbin25441 -> 0 bytes
-rw-r--r--doc/src/images/mouse3dtest-screenshot.pngbin21487 -> 0 bytes
-rw-r--r--doc/src/images/nesting-screenshot.pngbin30541 -> 0 bytes
-rw-r--r--doc/src/images/normalized.odfbin5384 -> 0 bytes
-rw-r--r--doc/src/images/pageflip-screenshot.pngbin72355 -> 0 bytes
-rw-r--r--doc/src/images/painter-screenshot.pngbin5301 -> 0 bytes
-rw-r--r--doc/src/images/penguin-0-screenshot.pngbin15847 -> 0 bytes
-rw-r--r--doc/src/images/penguin-screenshot.pngbin11862 -> 0 bytes
-rw-r--r--doc/src/images/pvcolor.pngbin84258 -> 0 bytes
-rw-r--r--doc/src/images/pyramid-screenshot.pngbin30058 -> 0 bytes
-rw-r--r--doc/src/images/qray3d-project.pngbin9210 -> 0 bytes
-rw-r--r--doc/src/images/qt-creator-config-3ds.pngbin23690 -> 0 bytes
-rw-r--r--doc/src/images/qt-creator-lib-path.pngbin56119 -> 0 bytes
-rw-r--r--doc/src/images/qt-creator-plugins.pngbin23085 -> 0 bytes
-rw-r--r--doc/src/images/qt-creator-shadow-build.pngbin25272 -> 0 bytes
-rw-r--r--doc/src/images/qt-logo.pngbin5149 -> 0 bytes
-rw-r--r--doc/src/images/qt3d-logo.pngbin41332 -> 0 bytes
-rw-r--r--doc/src/images/quad-extrude.pngbin24814 -> 0 bytes
-rw-r--r--doc/src/images/quad-extrude.xcfbin65613 -> 0 bytes
-rw-r--r--doc/src/images/quads.pngbin16511 -> 0 bytes
-rw-r--r--doc/src/images/shapes-screenshot.pngbin15746 -> 0 bytes
-rw-r--r--doc/src/images/soup.pngbin107851 -> 0 bytes
-rw-r--r--doc/src/images/sphere-detail.pngbin62359 -> 0 bytes
-rw-r--r--doc/src/images/spiky-teapot.pngbin332191 -> 0 bytes
-rw-r--r--doc/src/images/stereo-nhd-screenshot.pngbin25718 -> 0 bytes
-rw-r--r--doc/src/images/stereo-screenshot-qml.pngbin131278 -> 0 bytes
-rw-r--r--doc/src/images/stereo-screenshot-qml2.pngbin156885 -> 0 bytes
-rw-r--r--doc/src/images/stereo-screenshot.pngbin20521 -> 0 bytes
-rw-r--r--doc/src/images/stereo-wide-screenshot.pngbin29985 -> 0 bytes
-rw-r--r--doc/src/images/teapot-china-screenshot.pngbin17811 -> 0 bytes
-rw-r--r--doc/src/images/teapot-distortion.pngbin13840 -> 0 bytes
-rw-r--r--doc/src/images/teapot-distortion2.pngbin7852 -> 0 bytes
-rw-r--r--doc/src/images/teapot-logo.pngbin3322 -> 0 bytes
-rw-r--r--doc/src/images/teapot-qml-screenshot.pngbin12028 -> 0 bytes
-rw-r--r--doc/src/images/teapot-qt-screenshot.pngbin37868 -> 0 bytes
-rw-r--r--doc/src/images/teapot-rotated.pngbin14324 -> 0 bytes
-rw-r--r--doc/src/images/teapot-screenshot.pngbin11910 -> 0 bytes
-rw-r--r--doc/src/images/teaservice-qml-screenshot.pngbin37272 -> 0 bytes
-rw-r--r--doc/src/images/teaservice-screenshot.pngbin33040 -> 0 bytes
-rw-r--r--doc/src/images/texture-coords-gen.pngbin97886 -> 0 bytes
-rw-r--r--doc/src/images/texture-coords-gen.xcfbin369331 -> 0 bytes
-rw-r--r--doc/src/images/texture-seam.pngbin61028 -> 0 bytes
-rw-r--r--doc/src/images/triangle3d-center.pngbin14042 -> 0 bytes
-rw-r--r--doc/src/images/triangle3d-dimensions.pngbin23779 -> 0 bytes
-rw-r--r--doc/src/images/triangle3d.xcfbin73394 -> 0 bytes
-rw-r--r--doc/src/images/triangulated-face.pngbin17764 -> 0 bytes
-rw-r--r--doc/src/images/triangulated-face.xcfbin51119 -> 0 bytes
-rw-r--r--doc/src/images/tutorials/converting-screenshot.pngbin1945 -> 0 bytes
-rw-r--r--doc/src/images/tutorials/cube1-screenshot.pngbin3213 -> 0 bytes
-rw-r--r--doc/src/images/tutorials/cube2-screenshot.pngbin3794 -> 0 bytes
-rw-r--r--doc/src/images/tutorials/cube3-screenshot.pngbin4315 -> 0 bytes
-rw-r--r--doc/src/images/tutorials/cube4-screenshot.pngbin13243 -> 0 bytes
-rw-r--r--doc/src/images/tutorials/shader-tutorial-varying.pngbin1174 -> 0 bytes
-rw-r--r--doc/src/images/tutorials/shader-tutorial.pngbin21649 -> 0 bytes
-rw-r--r--doc/src/images/vector-mag.odfbin4453 -> 0 bytes
-rw-r--r--doc/src/images/vector-mag.pngbin1720 -> 0 bytes
-rw-r--r--doc/src/images/vector-normalized.pngbin1111 -> 0 bytes
-rw-r--r--doc/src/images/vector-point.odfbin4453 -> 0 bytes
-rw-r--r--doc/src/images/vector-point.pngbin3369 -> 0 bytes
-rw-r--r--doc/src/images/view-frustum-10-degrees-angle-shot.pngbin50995 -> 0 bytes
-rw-r--r--doc/src/images/view-frustum-10-degrees.pngbin10331 -> 0 bytes
-rw-r--r--doc/src/images/view-frustum-20-degrees.pngbin9572 -> 0 bytes
-rw-r--r--doc/src/images/view-frustum-30-degrees.pngbin9289 -> 0 bytes
-rw-r--r--doc/src/images/view-frustum-angle-shot-annotated.pngbin71760 -> 0 bytes
-rw-r--r--doc/src/images/view-frustum-angle-shot.pngbin51382 -> 0 bytes
-rw-r--r--doc/src/images/view-frustum-angle-shot.xcfbin218431 -> 0 bytes
-rw-r--r--doc/src/images/view-frustum-origin.pngbin11648 -> 0 bytes
-rw-r--r--doc/src/index.qdoc103
-rw-r--r--doc/src/qline3d-math.qdoc211
-rw-r--r--doc/src/qt3d-all-classes.qdoc49
-rw-r--r--doc/src/qt3d-all-modules.qdoc57
-rw-r--r--doc/src/qt3d-arrays.qdoc34
-rw-r--r--doc/src/qt3d-building.qdoc275
-rw-r--r--doc/src/qt3d-contrib.qdoc54
-rw-r--r--doc/src/qt3d-examples.qdoc72
-rw-r--r--doc/src/qt3d-geometry.qdoc34
-rw-r--r--doc/src/qt3d-graphicsview.qdoc34
-rw-r--r--doc/src/qt3d-materials.qdoc34
-rw-r--r--doc/src/qt3d-math.qdoc34
-rw-r--r--doc/src/qt3d-painting.qdoc60
-rw-r--r--doc/src/qt3d-qml3d.qdoc55
-rw-r--r--doc/src/qt3d-scene.qdoc34
-rw-r--r--doc/src/qt3d-textures.qdoc34
-rw-r--r--doc/src/qt3d-troubleshooting.qdoc295
-rw-r--r--doc/src/qt3d-viewing.qdoc34
-rw-r--r--doc/src/style/OfflineStyle.css251
-rw-r--r--doc/src/style/narrow.css250
-rw-r--r--doc/src/style/style.css1567
-rw-r--r--doc/src/style/style_ie6.css54
-rw-r--r--doc/src/style/style_ie7.css19
-rw-r--r--doc/src/style/style_ie8.css0
-rw-r--r--doc/src/style/superfish.css51
-rw-r--r--doc/src/style/superfish_skin.css83
-rw-r--r--doc/src/tutorials/penguin.qdoc106
-rw-r--r--doc/src/tutorials/sceneformat.qdoc116
-rw-r--r--doc/src/tutorials/shaders.qdoc388
-rw-r--r--doc/src/tutorials/simpleobject.qdoc106
-rw-r--r--examples/examples.pro2
-rw-r--r--examples/qt3d/README14
-rw-r--r--examples/qt3d/basket/README15
-rw-r--r--examples/qt3d/basket/basket.desktop7
-rw-r--r--examples/qt3d/basket/basket.jpgbin138189 -> 0 bytes
-rw-r--r--examples/qt3d/basket/basket.pro16
-rw-r--r--examples/qt3d/basket/basket.qrc5
-rw-r--r--examples/qt3d/basket/basket.rc1
-rw-r--r--examples/qt3d/basket/basket_data.h404
-rw-r--r--examples/qt3d/basket/basket_data.txt332
-rw-r--r--examples/qt3d/basket/basketview.cpp93
-rw-r--r--examples/qt3d/basket/basketview.h71
-rw-r--r--examples/qt3d/basket/main.cpp63
-rw-r--r--examples/qt3d/basket/qt3d.icobin67646 -> 0 bytes
-rw-r--r--examples/qt3d/basket/qt3d.pngbin3677 -> 0 bytes
-rw-r--r--examples/qt3d/basket/teapot-logo.pngbin3287 -> 0 bytes
-rw-r--r--examples/qt3d/builder/builder.cpp192
-rw-r--r--examples/qt3d/builder/builder.desktop7
-rw-r--r--examples/qt3d/builder/builder.h68
-rw-r--r--examples/qt3d/builder/builder.pro17
-rw-r--r--examples/qt3d/builder/builder.qrc5
-rw-r--r--examples/qt3d/builder/builder.rc1
-rw-r--r--examples/qt3d/builder/main.cpp63
-rw-r--r--examples/qt3d/builder/qt-soup.pngbin91448 -> 0 bytes
-rw-r--r--examples/qt3d/builder/qt3d.icobin67646 -> 0 bytes
-rw-r--r--examples/qt3d/builder/qt3d.pngbin3677 -> 0 bytes
-rw-r--r--examples/qt3d/cube/cube.desktop7
-rw-r--r--examples/qt3d/cube/cube.pro17
-rw-r--r--examples/qt3d/cube/cube.qrc5
-rw-r--r--examples/qt3d/cube/cube.rc1
-rw-r--r--examples/qt3d/cube/cubeview.cpp74
-rw-r--r--examples/qt3d/cube/cubeview.h64
-rw-r--r--examples/qt3d/cube/main.cpp62
-rw-r--r--examples/qt3d/cube/qt3d.icobin67646 -> 0 bytes
-rw-r--r--examples/qt3d/cube/qt3d.pngbin3677 -> 0 bytes
-rw-r--r--examples/qt3d/cube/qtlogo.pngbin13923 -> 0 bytes
-rw-r--r--examples/qt3d/cylinder/cubeview.cpp77
-rw-r--r--examples/qt3d/cylinder/cubeview.h62
-rw-r--r--examples/qt3d/cylinder/cupTexture.pngbin82843 -> 0 bytes
-rw-r--r--examples/qt3d/cylinder/cylinder.desktop7
-rw-r--r--examples/qt3d/cylinder/cylinder.pro17
-rw-r--r--examples/qt3d/cylinder/cylinder.qrc6
-rw-r--r--examples/qt3d/cylinder/cylinder.rc1
-rw-r--r--examples/qt3d/cylinder/cylinderview.cpp101
-rw-r--r--examples/qt3d/cylinder/cylinderview.h64
-rw-r--r--examples/qt3d/cylinder/latte.pngbin294671 -> 0 bytes
-rw-r--r--examples/qt3d/cylinder/main.cpp62
-rw-r--r--examples/qt3d/cylinder/qt3d.icobin67646 -> 0 bytes
-rw-r--r--examples/qt3d/cylinder/qt3d.pngbin3677 -> 0 bytes
-rw-r--r--examples/qt3d/geometry/EarthFlat_512x512.jpgbin183612 -> 0 bytes
-rw-r--r--examples/qt3d/geometry/bullseye.pngbin2737 -> 0 bytes
-rw-r--r--examples/qt3d/geometry/geometry.cpp210
-rw-r--r--examples/qt3d/geometry/geometry.desktop7
-rw-r--r--examples/qt3d/geometry/geometry.h58
-rw-r--r--examples/qt3d/geometry/geometry.pro22
-rw-r--r--examples/qt3d/geometry/geometry.qrc6
-rw-r--r--examples/qt3d/geometry/geometry.rc1
-rw-r--r--examples/qt3d/geometry/geometryview.cpp122
-rw-r--r--examples/qt3d/geometry/geometryview.h88
-rw-r--r--examples/qt3d/geometry/main.cpp62
-rw-r--r--examples/qt3d/geometry/qt3d.icobin67646 -> 0 bytes
-rw-r--r--examples/qt3d/geometry/qt3d.pngbin3677 -> 0 bytes
-rw-r--r--examples/qt3d/geometry/quadplane.cpp92
-rw-r--r--examples/qt3d/geometry/quadplane.h57
-rw-r--r--examples/qt3d/graphicsview/cubeicon.pngbin703 -> 0 bytes
-rw-r--r--examples/qt3d/graphicsview/cubeitem.cpp193
-rw-r--r--examples/qt3d/graphicsview/cubeitem.h61
-rw-r--r--examples/qt3d/graphicsview/edge.cpp151
-rw-r--r--examples/qt3d/graphicsview/edge.h77
-rw-r--r--examples/qt3d/graphicsview/graph.cpp130
-rw-r--r--examples/qt3d/graphicsview/graph.h67
-rw-r--r--examples/qt3d/graphicsview/graphicsview.desktop7
-rw-r--r--examples/qt3d/graphicsview/graphicsview.pro36
-rw-r--r--examples/qt3d/graphicsview/graphicsview.qrc6
-rw-r--r--examples/qt3d/graphicsview/graphicsview.rc1
-rw-r--r--examples/qt3d/graphicsview/main.cpp62
-rw-r--r--examples/qt3d/graphicsview/modelitem.cpp220
-rw-r--r--examples/qt3d/graphicsview/modelitem.h91
-rw-r--r--examples/qt3d/graphicsview/node.cpp185
-rw-r--r--examples/qt3d/graphicsview/node.h83
-rw-r--r--examples/qt3d/graphicsview/qt3d.icobin67646 -> 0 bytes
-rw-r--r--examples/qt3d/graphicsview/qt3d.pngbin3677 -> 0 bytes
-rw-r--r--examples/qt3d/graphicsview/scene.cpp54
-rw-r--r--examples/qt3d/graphicsview/scene.h56
-rw-r--r--examples/qt3d/graphicsview/teapoticon.pngbin4969 -> 0 bytes
-rw-r--r--examples/qt3d/graphicsview/teapotitem.cpp129
-rw-r--r--examples/qt3d/graphicsview/teapotitem.h63
-rw-r--r--examples/qt3d/graphicsview/view.cpp121
-rw-r--r--examples/qt3d/graphicsview/view.h87
-rw-r--r--examples/qt3d/nesting/cubeview.cpp209
-rw-r--r--examples/qt3d/nesting/cubeview.h92
-rw-r--r--examples/qt3d/nesting/main.cpp64
-rw-r--r--examples/qt3d/nesting/nesting.desktop7
-rw-r--r--examples/qt3d/nesting/nesting.pro17
-rw-r--r--examples/qt3d/nesting/nesting.qrc5
-rw-r--r--examples/qt3d/nesting/nesting.rc1
-rw-r--r--examples/qt3d/nesting/qt3d.icobin67646 -> 0 bytes
-rw-r--r--examples/qt3d/nesting/qt3d.pngbin3677 -> 0 bytes
-rw-r--r--examples/qt3d/nesting/qtlogo.pngbin13923 -> 0 bytes
-rw-r--r--examples/qt3d/qt3d.pro2
-rw-r--r--examples/qt3d/qt3d.svg32
-rw-r--r--examples/qt3d/solarsystem/main.cpp65
-rw-r--r--examples/qt3d/solarsystem/qt3d.icobin67646 -> 0 bytes
-rw-r--r--examples/qt3d/solarsystem/qt3d.pngbin3677 -> 0 bytes
-rw-r--r--examples/qt3d/solarsystem/resources/attribution.txt4
-rw-r--r--examples/qt3d/solarsystem/resources/moon-texture.jpgbin111322 -> 0 bytes
-rw-r--r--examples/qt3d/solarsystem/resources/planet.jpgbin87865 -> 0 bytes
-rw-r--r--examples/qt3d/solarsystem/resources/solar.fsh70
-rw-r--r--examples/qt3d/solarsystem/resources/solar.jpgbin103406 -> 0 bytes
-rw-r--r--examples/qt3d/solarsystem/resources/solar.vsh175
-rwxr-xr-xexamples/qt3d/solarsystem/resources/solar2.jpgbin144007 -> 0 bytes
-rw-r--r--examples/qt3d/solarsystem/solarsystem.cpp232
-rw-r--r--examples/qt3d/solarsystem/solarsystem.desktop7
-rw-r--r--examples/qt3d/solarsystem/solarsystem.h96
-rw-r--r--examples/qt3d/solarsystem/solarsystem.pro29
-rw-r--r--examples/qt3d/solarsystem/solarsystem.qrc10
-rw-r--r--examples/qt3d/solarsystem/solarsystem.rc1
-rw-r--r--examples/qt3d/tank/main.cpp69
-rw-r--r--examples/qt3d/tank/qt3d.icobin67646 -> 0 bytes
-rw-r--r--examples/qt3d/tank/qt3d.pngbin3677 -> 0 bytes
-rw-r--r--examples/qt3d/tank/quadplane.cpp107
-rw-r--r--examples/qt3d/tank/quadplane.h55
-rw-r--r--examples/qt3d/tank/tank.cpp136
-rw-r--r--examples/qt3d/tank/tank.desktop7
-rw-r--r--examples/qt3d/tank/tank.h59
-rw-r--r--examples/qt3d/tank/tank.pro21
-rw-r--r--examples/qt3d/tank/tank.rc1
-rw-r--r--examples/qt3d/tank/tankview.cpp114
-rw-r--r--examples/qt3d/tank/tankview.h70
-rw-r--r--examples/qt3d/teapot/main.cpp68
-rw-r--r--examples/qt3d/teapot/qt3d.icobin67646 -> 0 bytes
-rw-r--r--examples/qt3d/teapot/qt3d.pngbin3677 -> 0 bytes
-rw-r--r--examples/qt3d/teapot/teapot.desktop7
-rw-r--r--examples/qt3d/teapot/teapot.pro15
-rw-r--r--examples/qt3d/teapot/teapot.rc1
-rw-r--r--examples/qt3d/teapot/teapotview.cpp68
-rw-r--r--examples/qt3d/teapot/teapotview.h68
-rw-r--r--examples/quick3d/animations/animations.pro19
-rw-r--r--examples/quick3d/animations/animations.qrc7
-rw-r--r--examples/quick3d/animations/animations_qml.desktop7
-rw-r--r--examples/quick3d/animations/animations_qml.rc1
-rw-r--r--examples/quick3d/animations/main.cpp66
-rw-r--r--examples/quick3d/animations/qml/animations.qml57
-rwxr-xr-xexamples/quick3d/animations/qml/cube_rotated.dae561
-rw-r--r--examples/quick3d/animations/qml/stonewal.jpgbin19550 -> 0 bytes
-rw-r--r--examples/quick3d/animations/qtquick3d.icobin67646 -> 0 bytes
-rw-r--r--examples/quick3d/animations/qtquick3d.pngbin4050 -> 0 bytes
-rw-r--r--examples/quick3d/basket/basket.pro18
-rw-r--r--examples/quick3d/basket/basket.qrc7
-rw-r--r--examples/quick3d/basket/basket_qml.desktop7
-rw-r--r--examples/quick3d/basket/basket_qml.rc1
-rw-r--r--examples/quick3d/basket/main.cpp66
-rw-r--r--examples/quick3d/basket/qml/basket.bez332
-rw-r--r--examples/quick3d/basket/qml/basket.jpgbin138189 -> 0 bytes
-rw-r--r--examples/quick3d/basket/qml/basket.qml74
-rw-r--r--examples/quick3d/basket/qtquick3d.icobin67646 -> 0 bytes
-rw-r--r--examples/quick3d/basket/qtquick3d.pngbin4050 -> 0 bytes
-rw-r--r--examples/quick3d/cube/cube.pro16
-rw-r--r--examples/quick3d/cube/cube_qml.desktop7
-rw-r--r--examples/quick3d/cube/cube_qml.rc1
-rw-r--r--examples/quick3d/cube/main.cpp69
-rw-r--r--examples/quick3d/cube/qml/cube.qml63
-rw-r--r--examples/quick3d/cube/qml/qtlogo.pngbin13923 -> 0 bytes
-rw-r--r--examples/quick3d/cube/qtquick3d.icobin67646 -> 0 bytes
-rw-r--r--examples/quick3d/cube/qtquick3d.pngbin4050 -> 0 bytes
-rw-r--r--examples/quick3d/forest/forest.pro17
-rw-r--r--examples/quick3d/forest/forest.qrc9
-rw-r--r--examples/quick3d/forest/forest.rc1
-rw-r--r--examples/quick3d/forest/forest_qml.desktop7
-rw-r--r--examples/quick3d/forest/main.cpp65
-rw-r--r--examples/quick3d/forest/qml/Tree.qml54
-rw-r--r--examples/quick3d/forest/qml/forest.qml81
-rw-r--r--examples/quick3d/forest/qml/ground.obj11
-rw-r--r--examples/quick3d/forest/qml/tree.obj11
-rw-r--r--examples/quick3d/forest/qml/tree.pngbin5631 -> 0 bytes
-rw-r--r--examples/quick3d/forest/qtquick3d.icobin67646 -> 0 bytes
-rw-r--r--examples/quick3d/forest/qtquick3d.pngbin4050 -> 0 bytes
-rw-r--r--examples/quick3d/lander/lander.desktop7
-rw-r--r--examples/quick3d/lander/lander.pro22
-rw-r--r--examples/quick3d/lander/lander.rc1
-rw-r--r--examples/quick3d/lander/main.cpp68
-rw-r--r--examples/quick3d/lander/qml/Jet.qml117
-rw-r--r--examples/quick3d/lander/qml/README5
-rw-r--r--examples/quick3d/lander/qml/dropshadow.pngbin3996 -> 0 bytes
-rw-r--r--examples/quick3d/lander/qml/flame.pngbin9004 -> 0 bytes
-rw-r--r--examples/quick3d/lander/qml/flame.xcfbin43771 -> 0 bytes
-rw-r--r--examples/quick3d/lander/qml/flame2.pngbin9282 -> 0 bytes
-rw-r--r--examples/quick3d/lander/qml/flame2.xcfbin44378 -> 0 bytes
-rw-r--r--examples/quick3d/lander/qml/lander.qml465
-rw-r--r--examples/quick3d/lander/qml/lander.qmlproject56
-rw-r--r--examples/quick3d/lander/qml/lunar-lander.3dsbin17180 -> 0 bytes
-rw-r--r--examples/quick3d/lander/qml/meshes/lunar-lander.3dsbin23456 -> 0 bytes
-rw-r--r--examples/quick3d/lander/qml/meshes/lunar-lander.obj1784
-rw-r--r--examples/quick3d/lander/qml/meshes/lunar-landscape.3dsbin42415 -> 0 bytes
-rw-r--r--examples/quick3d/lander/qml/meshes/lunar-landscape.obj3207
-rw-r--r--examples/quick3d/lander/qml/nebula.jpgbin34643 -> 0 bytes
-rw-r--r--examples/quick3d/lander/qml/rusty.pngbin3885 -> 0 bytes
-rw-r--r--examples/quick3d/lander/qtquick3d.icobin67646 -> 0 bytes
-rw-r--r--examples/quick3d/lander/qtquick3d.pngbin4050 -> 0 bytes
-rw-r--r--examples/quick3d/matrix_animation/main.cpp67
-rw-r--r--examples/quick3d/matrix_animation/matrix_animation.desktop7
-rw-r--r--examples/quick3d/matrix_animation/matrix_animation.pro17
-rw-r--r--examples/quick3d/matrix_animation/matrix_animation.rc1
-rw-r--r--examples/quick3d/matrix_animation/qml/matrix-animation.qml112
-rw-r--r--examples/quick3d/matrix_animation/qml/matrix_animation.fsh13
-rw-r--r--examples/quick3d/matrix_animation/qml/matrix_animation.vsh16
-rw-r--r--examples/quick3d/matrix_animation/qml/qtlogo.pngbin13923 -> 0 bytes
-rw-r--r--examples/quick3d/matrix_animation/qml/teapot.bez340
-rw-r--r--examples/quick3d/matrix_animation/qtquick3d.icobin67646 -> 0 bytes
-rw-r--r--examples/quick3d/matrix_animation/qtquick3d.pngbin4050 -> 0 bytes
-rw-r--r--examples/quick3d/modelview3d/main.cpp69
-rw-r--r--examples/quick3d/modelview3d/modelview3d.pro16
-rw-r--r--examples/quick3d/modelview3d/modelview3d_qml.desktop7
-rw-r--r--examples/quick3d/modelview3d/modelview3d_qml.rc1
-rw-r--r--examples/quick3d/modelview3d/qml/Button.qml63
-rw-r--r--examples/quick3d/modelview3d/qml/axes.pngbin1085 -> 0 bytes
-rw-r--r--examples/quick3d/modelview3d/qml/modelview3d.qml589
-rw-r--r--examples/quick3d/modelview3d/qtquick3d.icobin67646 -> 0 bytes
-rw-r--r--examples/quick3d/modelview3d/qtquick3d.pngbin4050 -> 0 bytes
-rw-r--r--examples/quick3d/monkeygod/main.cpp68
-rw-r--r--examples/quick3d/monkeygod/monkeygod.desktop7
-rw-r--r--examples/quick3d/monkeygod/monkeygod.pro22
-rw-r--r--examples/quick3d/monkeygod/monkeygod.rc1
-rw-r--r--examples/quick3d/monkeygod/qml/Penguin.qml77
-rw-r--r--examples/quick3d/monkeygod/qml/marble.pngbin52383 -> 0 bytes
-rw-r--r--examples/quick3d/monkeygod/qml/meshes/monkey.3dsbin13886 -> 0 bytes
-rw-r--r--examples/quick3d/monkeygod/qml/meshes/penguin.3dsbin36301 -> 0 bytes
-rw-r--r--examples/quick3d/monkeygod/qml/monkeygod.qml122
-rw-r--r--examples/quick3d/monkeygod/qtquick3d.icobin67646 -> 0 bytes
-rw-r--r--examples/quick3d/monkeygod/qtquick3d.pngbin4050 -> 0 bytes
-rw-r--r--examples/quick3d/moon/main.cpp70
-rw-r--r--examples/quick3d/moon/moon.desktop8
-rw-r--r--examples/quick3d/moon/moon.pro20
-rw-r--r--examples/quick3d/moon/moon.rc1
-rw-r--r--examples/quick3d/moon/qml/moon-texture.jpgbin111322 -> 0 bytes
-rw-r--r--examples/quick3d/moon/qml/moon.qml65
-rw-r--r--examples/quick3d/moon/qtquick3d.icobin67646 -> 0 bytes
-rw-r--r--examples/quick3d/moon/qtquick3d.pngbin4050 -> 0 bytes
-rw-r--r--examples/quick3d/photoroom/main.cpp70
-rw-r--r--examples/quick3d/photoroom/photoroom.desktop7
-rw-r--r--examples/quick3d/photoroom/photoroom.pro23
-rw-r--r--examples/quick3d/photoroom/photoroom.rc1
-rw-r--r--examples/quick3d/photoroom/qml/PhotoPane.qml128
-rw-r--r--examples/quick3d/photoroom/qml/photopane.obj11
-rw-r--r--examples/quick3d/photoroom/qml/photoroom.qml164
-rw-r--r--examples/quick3d/photoroom/qml/textures/background.jpgbin69350 -> 0 bytes
-rw-r--r--examples/quick3d/photoroom/qml/textures/basket.jpgbin138189 -> 0 bytes
-rw-r--r--examples/quick3d/photoroom/qml/textures/niagara_falls.jpgbin92234 -> 0 bytes
-rw-r--r--examples/quick3d/photoroom/qml/textures/place.jpgbin62438 -> 0 bytes
-rw-r--r--examples/quick3d/photoroom/qml/textures/qtlogo.pngbin13923 -> 0 bytes
-rw-r--r--examples/quick3d/photoroom/qml/textures/woman-photo-credit.txt5
-rw-r--r--examples/quick3d/photoroom/qml/textures/woman.jpgbin83973 -> 0 bytes
-rw-r--r--examples/quick3d/photoroom/qtquick3d.icobin67646 -> 0 bytes
-rw-r--r--examples/quick3d/photoroom/qtquick3d.pngbin4050 -> 0 bytes
-rw-r--r--examples/quick3d/qmlres.h127
-rw-r--r--examples/quick3d/qtquick3d.svg23
-rw-r--r--examples/quick3d/quick3d.pro15
-rw-r--r--examples/quick3d/shaders/main.cpp68
-rw-r--r--examples/quick3d/shaders/qml/Bouncing.qml124
-rw-r--r--examples/quick3d/shaders/qml/Collapsing.qml125
-rw-r--r--examples/quick3d/shaders/qml/Images.qml144
-rw-r--r--examples/quick3d/shaders/qml/Interpolate.qml124
-rw-r--r--examples/quick3d/shaders/qml/images/basket.jpgbin454145 -> 0 bytes
-rw-r--r--examples/quick3d/shaders/qml/images/qtlogo.pngbin13923 -> 0 bytes
-rw-r--r--examples/quick3d/shaders/qml/images/teapot-logo.pngbin3644 -> 0 bytes
-rw-r--r--examples/quick3d/shaders/qml/meshes/teapot.bez340
-rw-r--r--examples/quick3d/shaders/qml/shaders.qml143
-rw-r--r--examples/quick3d/shaders/qml/shaders.qmlproject56
-rw-r--r--examples/quick3d/shaders/qtquick3d.icobin67646 -> 0 bytes
-rw-r--r--examples/quick3d/shaders/qtquick3d.pngbin4050 -> 0 bytes
-rw-r--r--examples/quick3d/shaders/shaders.desktop7
-rw-r--r--examples/quick3d/shaders/shaders.pro25
-rw-r--r--examples/quick3d/shaders/shaders.rc1
-rw-r--r--examples/quick3d/solarsystem_qml/main.cpp73
-rw-r--r--examples/quick3d/solarsystem_qml/qml/attribution.txt4
-rw-r--r--examples/quick3d/solarsystem_qml/qml/moon-texture.jpgbin111322 -> 0 bytes
-rw-r--r--examples/quick3d/solarsystem_qml/qml/planet.jpgbin90353 -> 0 bytes
-rw-r--r--examples/quick3d/solarsystem_qml/qml/solar.fsh70
-rw-r--r--examples/quick3d/solarsystem_qml/qml/solar.jpgbin103406 -> 0 bytes
-rw-r--r--examples/quick3d/solarsystem_qml/qml/solar.vsh175
-rwxr-xr-xexamples/quick3d/solarsystem_qml/qml/solar2.jpgbin144007 -> 0 bytes
-rw-r--r--examples/quick3d/solarsystem_qml/qml/solarsystem_qml.qml130
-rw-r--r--examples/quick3d/solarsystem_qml/qtquick3d.icobin67646 -> 0 bytes
-rw-r--r--examples/quick3d/solarsystem_qml/qtquick3d.pngbin4050 -> 0 bytes
-rw-r--r--examples/quick3d/solarsystem_qml/solarsystem_qml.desktop7
-rw-r--r--examples/quick3d/solarsystem_qml/solarsystem_qml.pro17
-rw-r--r--examples/quick3d/solarsystem_qml/solarsystem_qml.rc1
-rw-r--r--examples/quick3d/sphere/main.cpp68
-rw-r--r--examples/quick3d/sphere/qml/sphere.qml171
-rw-r--r--examples/quick3d/sphere/qtquick3d.icobin67646 -> 0 bytes
-rw-r--r--examples/quick3d/sphere/qtquick3d.pngbin4050 -> 0 bytes
-rw-r--r--examples/quick3d/sphere/sphere.desktop7
-rw-r--r--examples/quick3d/sphere/sphere.pro16
-rw-r--r--examples/quick3d/sphere/sphere.rc1
-rw-r--r--features/qt3d.prf23
-rw-r--r--features/qt3dquick.prf26
-rw-r--r--header.BSD40
-rw-r--r--header.FDL27
-rw-r--r--header.LGPL41
-rw-r--r--header.LGPL-ONLY22
-rw-r--r--pkg.pri285
-rw-r--r--qtc_packaging/debian_harmattan/README95
-rw-r--r--qtc_packaging/debian_harmattan/changelog5
-rw-r--r--qtc_packaging/debian_harmattan/compat1
-rw-r--r--qtc_packaging/debian_harmattan/control35
-rw-r--r--qtc_packaging/debian_harmattan/copyright22
-rw-r--r--qtc_packaging/debian_harmattan/libqt4-3d-dev.install2
-rw-r--r--qtc_packaging/debian_harmattan/libqt4-3d-examples.install4
-rw-r--r--qtc_packaging/debian_harmattan/libqt4-3d.install4
-rwxr-xr-xqtc_packaging/debian_harmattan/rules126
-rw-r--r--quick3d.pro70
-rw-r--r--src/imports/imports.pro3
-rw-r--r--src/imports/shapes/Capsule.qml55
-rw-r--r--src/imports/shapes/Cube.qml48
-rw-r--r--src/imports/shapes/Cylinder.qml55
-rw-r--r--src/imports/shapes/Quad.qml48
-rw-r--r--src/imports/shapes/README.library_xml15
-rwxr-xr-xsrc/imports/shapes/README.plugins_types34
-rw-r--r--src/imports/shapes/Sphere.qml55
-rw-r--r--src/imports/shapes/Teapot.qml48
-rw-r--r--src/imports/shapes/capsulemesh.cpp352
-rw-r--r--src/imports/shapes/capsulemesh.h94
-rw-r--r--src/imports/shapes/capsulemesh_p.h83
-rw-r--r--src/imports/shapes/cube.h67
-rw-r--r--src/imports/shapes/cube.obj25
-rw-r--r--src/imports/shapes/cube.qdoc87
-rw-r--r--src/imports/shapes/cylindermesh.cpp348
-rw-r--r--src/imports/shapes/cylindermesh.h94
-rw-r--r--src/imports/shapes/cylindermesh_p.h85
-rw-r--r--src/imports/shapes/library.xml54
-rw-r--r--src/imports/shapes/line.cpp164
-rw-r--r--src/imports/shapes/line.h89
-rwxr-xr-xsrc/imports/shapes/plugins.qmltypes159
-rw-r--r--src/imports/shapes/point.cpp169
-rw-r--r--src/imports/shapes/point.h89
-rw-r--r--src/imports/shapes/qmldir7
-rw-r--r--src/imports/shapes/quad.obj12
-rw-r--r--src/imports/shapes/quad.qdoc87
-rw-r--r--src/imports/shapes/shapes.cpp72
-rw-r--r--src/imports/shapes/shapes.pro101
-rw-r--r--src/imports/shapes/spheremesh.cpp393
-rw-r--r--src/imports/shapes/spheremesh.h99
-rw-r--r--src/imports/shapes/spheremesh_p.h87
-rw-r--r--src/imports/shapes/teapot.bez340
-rw-r--r--src/imports/shapes/teapot.h67
-rw-r--r--src/imports/shapes/teapot.qdoc92
-rw-r--r--src/imports/threed/DefaultNavigator.qml181
-rw-r--r--src/imports/threed/README.library_xml15
-rwxr-xr-xsrc/imports/threed/README.plugins_types34
-rw-r--r--src/imports/threed/billboarditem3d.cpp170
-rw-r--r--src/imports/threed/billboarditem3d.h73
-rw-r--r--src/imports/threed/library.xml379
-rwxr-xr-xsrc/imports/threed/plugins.qmltypes499
-rw-r--r--src/imports/threed/qgraphicslookattransform.cpp517
-rw-r--r--src/imports/threed/qgraphicslookattransform.h94
-rw-r--r--src/imports/threed/qmldir1
-rw-r--r--src/imports/threed/qt3dnamespace.cpp100
-rw-r--r--src/imports/threed/qt3dnamespace.h78
-rw-r--r--src/imports/threed/scale3d.cpp74
-rw-r--r--src/imports/threed/scale3d.h80
-rw-r--r--src/imports/threed/shaderprogram.cpp979
-rw-r--r--src/imports/threed/shaderprogram.h95
-rw-r--r--src/imports/threed/shaderprogram_p.h152
-rw-r--r--src/imports/threed/skybox.cpp339
-rw-r--r--src/imports/threed/skybox.h111
-rw-r--r--src/imports/threed/threed.cpp125
-rw-r--r--src/imports/threed/threed.pro74
-rw-r--r--src/imports/threed/viewport.cpp1289
-rw-r--r--src/imports/threed/viewport.h158
-rw-r--r--src/plugins/plugins.pro2
-rw-r--r--src/plugins/qpluginbase.pri21
-rw-r--r--src/plugins/qt_targets.pri4
-rw-r--r--src/plugins/sceneformats/3ds/3ds.pro50
-rw-r--r--src/plugins/sceneformats/3ds/README.txt55
-rw-r--r--src/plugins/sceneformats/3ds/main.cpp70
-rw-r--r--src/plugins/sceneformats/3ds/qgl3dsloader.cpp333
-rw-r--r--src/plugins/sceneformats/3ds/qgl3dsloader.h81
-rw-r--r--src/plugins/sceneformats/3ds/qgl3dsmesh.cpp755
-rw-r--r--src/plugins/sceneformats/3ds/qgl3dsmesh.h95
-rw-r--r--src/plugins/sceneformats/3ds/qgl3dsscene.cpp117
-rw-r--r--src/plugins/sceneformats/3ds/qgl3dsscene.h82
-rw-r--r--src/plugins/sceneformats/3ds/qgl3dsscenehandler.cpp255
-rw-r--r--src/plugins/sceneformats/3ds/qgl3dsscenehandler.h100
-rw-r--r--src/plugins/sceneformats/assimp/README.txt12
-rw-r--r--src/plugins/sceneformats/assimp/ailoaderiostream.cpp124
-rw-r--r--src/plugins/sceneformats/assimp/ailoaderiostream.h70
-rw-r--r--src/plugins/sceneformats/assimp/ailoaderiosystem.cpp160
-rw-r--r--src/plugins/sceneformats/assimp/ailoaderiosystem.h70
-rw-r--r--src/plugins/sceneformats/assimp/assimp.pro62
-rw-r--r--src/plugins/sceneformats/assimp/main.cpp100
-rw-r--r--src/plugins/sceneformats/assimp/qailoader.cpp541
-rw-r--r--src/plugins/sceneformats/assimp/qailoader.h95
-rw-r--r--src/plugins/sceneformats/assimp/qaimesh.cpp143
-rw-r--r--src/plugins/sceneformats/assimp/qaimesh.h72
-rw-r--r--src/plugins/sceneformats/assimp/qaiscene.cpp182
-rw-r--r--src/plugins/sceneformats/assimp/qaiscene.h85
-rw-r--r--src/plugins/sceneformats/assimp/qaiscenehandler.cpp453
-rw-r--r--src/plugins/sceneformats/assimp/qaiscenehandler.h111
-rw-r--r--src/plugins/sceneformats/bezier/bezier.pro38
-rw-r--r--src/plugins/sceneformats/bezier/main.cpp70
-rw-r--r--src/plugins/sceneformats/bezier/qglbezierscene.cpp71
-rw-r--r--src/plugins/sceneformats/bezier/qglbezierscene.h66
-rw-r--r--src/plugins/sceneformats/bezier/qglbezierscenehandler.cpp197
-rw-r--r--src/plugins/sceneformats/bezier/qglbezierscenehandler.h58
-rw-r--r--src/plugins/sceneformats/obj/main.cpp78
-rw-r--r--src/plugins/sceneformats/obj/obj.pro37
-rw-r--r--src/plugins/sceneformats/obj/qglobjscene.cpp74
-rw-r--r--src/plugins/sceneformats/obj/qglobjscene.h74
-rw-r--r--src/plugins/sceneformats/obj/qglobjscenehandler.cpp470
-rw-r--r--src/plugins/sceneformats/obj/qglobjscenehandler.h76
-rw-r--r--src/plugins/sceneformats/sceneformats.pro7
-rw-r--r--src/private/private.pri3
-rw-r--r--src/private/qfactoryloader_p.h97
-rw-r--r--src/private/qglextensions_p.h884
-rw-r--r--src/quick3d/qdeclarativeeffect.cpp479
-rw-r--r--src/quick3d/qdeclarativeeffect.h125
-rw-r--r--src/quick3d/qdeclarativeitem3d.cpp1674
-rw-r--r--src/quick3d/qdeclarativeitem3d.h226
-rw-r--r--src/quick3d/qdeclarativemesh.cpp722
-rw-r--r--src/quick3d/qdeclarativemesh.h140
-rw-r--r--src/quick3d/qdeclarativeview3d.cpp88
-rw-r--r--src/quick3d/qdeclarativeview3d.h70
-rw-r--r--src/quick3d/qdeclarativeviewport.h72
-rw-r--r--src/quick3d/qt3dquickglobal.h73
-rw-r--r--src/quick3d/quick3d.pri18
-rw-r--r--src/quick3d/quick3d.pro123
-rw-r--r--src/scripts/LICENSE.LGPL.txt514
-rw-r--r--src/scripts/README39
-rwxr-xr-xsrc/scripts/build_mac_package.sh125
-rwxr-xr-xsrc/scripts/build_src_package.sh87
-rw-r--r--src/scripts/build_win_package.bat88
-rw-r--r--src/scripts/build_win_package.nsi218
-rwxr-xr-xsrc/scripts/filter-qmldump.pl65
-rw-r--r--src/scripts/mac-install.rtf13
-rw-r--r--src/scripts/mac_installer_background.pngbin89255 -> 0 bytes
-rw-r--r--src/scripts/qtquick3d.icobin51262 -> 0 bytes
-rw-r--r--src/scripts/win_installer_background.bmpbin206038 -> 0 bytes
-rw-r--r--src/scripts/windows-install.rtfbin486 -> 0 bytes
-rw-r--r--src/scripts/windows-install.txt10
-rw-r--r--src/src.pro4
-rw-r--r--src/threed/api/api.pri4
-rw-r--r--src/threed/api/gl-funcs.txt858
-rwxr-xr-xsrc/threed/api/gl-gen-funcs.pl484
-rw-r--r--src/threed/api/qopenglfunctions.cpp3690
-rw-r--r--src/threed/api/qopenglfunctions.h2292
-rw-r--r--src/threed/arrays/arrays.pri28
-rw-r--r--src/threed/arrays/qarray.cpp1022
-rw-r--r--src/threed/arrays/qarray.h1209
-rw-r--r--src/threed/arrays/qcolor4ub.cpp319
-rw-r--r--src/threed/arrays/qcolor4ub.h216
-rw-r--r--src/threed/arrays/qcustomdataarray.cpp909
-rw-r--r--src/threed/arrays/qcustomdataarray.h421
-rw-r--r--src/threed/arrays/qglattributedescription.cpp188
-rw-r--r--src/threed/arrays/qglattributedescription.h149
-rw-r--r--src/threed/arrays/qglattributeset.cpp207
-rw-r--r--src/threed/arrays/qglattributeset.h138
-rw-r--r--src/threed/arrays/qglattributevalue.cpp276
-rw-r--r--src/threed/arrays/qglattributevalue.h207
-rw-r--r--src/threed/arrays/qglindexbuffer.cpp777
-rw-r--r--src/threed/arrays/qglindexbuffer.h108
-rw-r--r--src/threed/arrays/qglvertexbundle.cpp495
-rw-r--r--src/threed/arrays/qglvertexbundle.h111
-rw-r--r--src/threed/arrays/qglvertexbundle_p.h216
-rw-r--r--src/threed/arrays/qvector2darray.cpp275
-rw-r--r--src/threed/arrays/qvector2darray.h124
-rw-r--r--src/threed/arrays/qvector3darray.cpp257
-rw-r--r--src/threed/arrays/qvector3darray.h116
-rw-r--r--src/threed/arrays/qvector4darray.cpp257
-rw-r--r--src/threed/arrays/qvector4darray.h118
-rw-r--r--src/threed/effects/effects.pri26
-rw-r--r--src/threed/effects/qglcolladafxeffect.cpp410
-rw-r--r--src/threed/effects/qglcolladafxeffect.h98
-rw-r--r--src/threed/effects/qglcolladafxeffect_p.h111
-rw-r--r--src/threed/effects/qglcolladafxeffectfactory.cpp1694
-rw-r--r--src/threed/effects/qglcolladafxeffectfactory.h218
-rw-r--r--src/threed/effects/qglcolladafxeffectloader.cpp190
-rw-r--r--src/threed/effects/qglcolladafxeffectloader.h73
-rw-r--r--src/threed/effects/qglflatcoloreffect.cpp350
-rw-r--r--src/threed/effects/qglflatcoloreffect_p.h99
-rw-r--r--src/threed/effects/qglflattextureeffect.cpp373
-rw-r--r--src/threed/effects/qglflattextureeffect_p.h98
-rw-r--r--src/threed/effects/qgllitmaterialeffect.cpp571
-rw-r--r--src/threed/effects/qgllitmaterialeffect_p.h85
-rw-r--r--src/threed/effects/qgllittextureeffect.cpp215
-rw-r--r--src/threed/effects/qgllittextureeffect_p.h86
-rw-r--r--src/threed/effects/qglshaderprogrameffect.cpp1131
-rw-r--r--src/threed/effects/qglshaderprogrameffect.h100
-rw-r--r--src/threed/geometry/geometry.pri28
-rw-r--r--src/threed/geometry/qgeometrydata.cpp2030
-rw-r--r--src/threed/geometry/qgeometrydata.h213
-rw-r--r--src/threed/geometry/qglbezierpatches.cpp815
-rw-r--r--src/threed/geometry/qglbezierpatches.h97
-rw-r--r--src/threed/geometry/qglbuilder.cpp1382
-rw-r--r--src/threed/geometry/qglbuilder.h140
-rw-r--r--src/threed/geometry/qglbuilder_p.h89
-rw-r--r--src/threed/geometry/qglcube.cpp198
-rw-r--r--src/threed/geometry/qglcube.h76
-rw-r--r--src/threed/geometry/qglcylinder.cpp445
-rw-r--r--src/threed/geometry/qglcylinder.h105
-rw-r--r--src/threed/geometry/qgldome.cpp281
-rw-r--r--src/threed/geometry/qgldome.h83
-rw-r--r--src/threed/geometry/qglmaterialcollection.cpp417
-rw-r--r--src/threed/geometry/qglmaterialcollection.h101
-rw-r--r--src/threed/geometry/qglsection.cpp700
-rw-r--r--src/threed/geometry/qglsection_p.h131
-rw-r--r--src/threed/geometry/qglsphere.cpp243
-rw-r--r--src/threed/geometry/qglsphere.h79
-rw-r--r--src/threed/geometry/qglteapot.cpp104
-rw-r--r--src/threed/geometry/qglteapot.h64
-rw-r--r--src/threed/geometry/qglteapot_data_p.h408
-rw-r--r--src/threed/geometry/qlogicalvertex.cpp420
-rw-r--r--src/threed/geometry/qlogicalvertex.h328
-rw-r--r--src/threed/geometry/qvector_utils_p.h110
-rw-r--r--src/threed/global/global.pri7
-rw-r--r--src/threed/global/qglnamespace.cpp290
-rw-r--r--src/threed/global/qglnamespace.h163
-rw-r--r--src/threed/global/qt3dglobal.h74
-rw-r--r--src/threed/graphicsview/graphicsview.pri21
-rw-r--r--src/threed/graphicsview/qglgraphicsviewportitem.cpp365
-rw-r--r--src/threed/graphicsview/qglgraphicsviewportitem.h100
-rw-r--r--src/threed/graphicsview/qgraphicsbillboardtransform.cpp258
-rw-r--r--src/threed/graphicsview/qgraphicsbillboardtransform.h82
-rw-r--r--src/threed/graphicsview/qgraphicsembedscene.cpp469
-rw-r--r--src/threed/graphicsview/qgraphicsembedscene.h88
-rw-r--r--src/threed/graphicsview/qgraphicsrotation3d.cpp274
-rw-r--r--src/threed/graphicsview/qgraphicsrotation3d.h91
-rw-r--r--src/threed/graphicsview/qgraphicsscale3d.cpp339
-rw-r--r--src/threed/graphicsview/qgraphicsscale3d.h88
-rw-r--r--src/threed/graphicsview/qgraphicstransform3d.cpp112
-rw-r--r--src/threed/graphicsview/qgraphicstransform3d.h71
-rw-r--r--src/threed/graphicsview/qgraphicstranslation3d.cpp233
-rw-r--r--src/threed/graphicsview/qgraphicstranslation3d.h87
-rw-r--r--src/threed/materials/materials.pri18
-rw-r--r--src/threed/materials/qglabstractmaterial.cpp239
-rw-r--r--src/threed/materials/qglabstractmaterial.h82
-rw-r--r--src/threed/materials/qglcolormaterial.cpp162
-rw-r--r--src/threed/materials/qglcolormaterial.h85
-rw-r--r--src/threed/materials/qglmaterial.cpp587
-rw-r--r--src/threed/materials/qglmaterial.h149
-rw-r--r--src/threed/materials/qglmaterial_p.h85
-rw-r--r--src/threed/materials/qgltwosidedmaterial.cpp259
-rw-r--r--src/threed/materials/qgltwosidedmaterial.h89
-rw-r--r--src/threed/math3d/math3d.pri12
-rw-r--r--src/threed/math3d/qbox3d.cpp690
-rw-r--r--src/threed/math3d/qbox3d.h218
-rw-r--r--src/threed/math3d/qplane3d.cpp302
-rw-r--r--src/threed/math3d/qplane3d.h161
-rw-r--r--src/threed/math3d/qray3d.cpp301
-rw-r--r--src/threed/math3d/qray3d.h164
-rw-r--r--src/threed/math3d/qsphere3d.cpp385
-rw-r--r--src/threed/math3d/qsphere3d.h164
-rw-r--r--src/threed/math3d/qtriangle3d.cpp379
-rw-r--r--src/threed/math3d/qtriangle3d.h182
-rw-r--r--src/threed/network/network.pri12
-rw-r--r--src/threed/network/qabstractdownloadmanager.cpp86
-rw-r--r--src/threed/network/qabstractdownloadmanager.h71
-rw-r--r--src/threed/network/qdownloadmanager.cpp214
-rw-r--r--src/threed/network/qdownloadmanager.h72
-rw-r--r--src/threed/network/qthreadeddownloadmanager.cpp386
-rw-r--r--src/threed/network/qthreadeddownloadmanager.h78
-rw-r--r--src/threed/network/qthreadeddownloadmanager_p.h114
-rw-r--r--src/threed/painting/painting.pri29
-rw-r--r--src/threed/painting/qglabstracteffect.cpp151
-rw-r--r--src/threed/painting/qglabstracteffect.h68
-rw-r--r--src/threed/painting/qglabstracteffect_p.h70
-rw-r--r--src/threed/painting/qglext.cpp99
-rw-r--r--src/threed/painting/qglext_p.h220
-rw-r--r--src/threed/painting/qgllightmodel.cpp291
-rw-r--r--src/threed/painting/qgllightmodel.h119
-rw-r--r--src/threed/painting/qgllightparameters.cpp828
-rw-r--r--src/threed/painting/qgllightparameters.h150
-rw-r--r--src/threed/painting/qglpainter.cpp2327
-rw-r--r--src/threed/painting/qglpainter.h225
-rw-r--r--src/threed/painting/qglpainter_p.h155
-rw-r--r--src/threed/painting/qglpickcolors.cpp1125
-rw-r--r--src/threed/painting/qglpickcolors_p.h66
-rw-r--r--src/threed/painting/qmatrix4x4stack.cpp380
-rw-r--r--src/threed/painting/qmatrix4x4stack.h105
-rw-r--r--src/threed/painting/qmatrix4x4stack_p.h77
-rw-r--r--src/threed/scene/qglabstractscene.cpp605
-rw-r--r--src/threed/scene/qglabstractscene.h113
-rw-r--r--src/threed/scene/qglpicknode.cpp215
-rw-r--r--src/threed/scene/qglpicknode.h82
-rw-r--r--src/threed/scene/qglrenderorder.cpp318
-rw-r--r--src/threed/scene/qglrenderorder.h203
-rw-r--r--src/threed/scene/qglrenderordercomparator.cpp164
-rw-r--r--src/threed/scene/qglrenderordercomparator.h69
-rw-r--r--src/threed/scene/qglrendersequencer.cpp369
-rw-r--r--src/threed/scene/qglrendersequencer.h87
-rw-r--r--src/threed/scene/qglrenderstate.cpp320
-rw-r--r--src/threed/scene/qglrenderstate.h105
-rw-r--r--src/threed/scene/qglsceneformatplugin.cpp316
-rw-r--r--src/threed/scene/qglsceneformatplugin.h122
-rw-r--r--src/threed/scene/qglscenenode.cpp1884
-rw-r--r--src/threed/scene/qglscenenode.h205
-rw-r--r--src/threed/scene/qglscenenode_p.h145
-rw-r--r--src/threed/scene/scene.pri19
-rw-r--r--src/threed/surfaces/qglabstractsurface.cpp318
-rw-r--r--src/threed/surfaces/qglabstractsurface.h95
-rw-r--r--src/threed/surfaces/qglcontextsurface.cpp70
-rw-r--r--src/threed/surfaces/qglcontextsurface_p.h85
-rw-r--r--src/threed/surfaces/qgldrawbuffersurface.cpp71
-rw-r--r--src/threed/surfaces/qgldrawbuffersurface_p.h86
-rw-r--r--src/threed/surfaces/qglframebufferobjectsurface.cpp209
-rw-r--r--src/threed/surfaces/qglframebufferobjectsurface.h86
-rw-r--r--src/threed/surfaces/qglmaskedsurface.cpp214
-rw-r--r--src/threed/surfaces/qglmaskedsurface_p.h105
-rw-r--r--src/threed/surfaces/qglpaintersurface.cpp72
-rw-r--r--src/threed/surfaces/qglpaintersurface_p.h86
-rw-r--r--src/threed/surfaces/qglpixelbuffersurface.cpp142
-rw-r--r--src/threed/surfaces/qglpixelbuffersurface.h79
-rw-r--r--src/threed/surfaces/qglsubsurface.cpp199
-rw-r--r--src/threed/surfaces/qglsubsurface.h84
-rw-r--r--src/threed/surfaces/qglwidgetsurface.cpp146
-rw-r--r--src/threed/surfaces/qglwidgetsurface.h80
-rw-r--r--src/threed/surfaces/surfaces.pri23
-rw-r--r--src/threed/textures/qareaallocator.cpp877
-rw-r--r--src/threed/textures/qareaallocator.h169
-rw-r--r--src/threed/textures/qglsharedresource.cpp236
-rw-r--r--src/threed/textures/qglsharedresource_p.h96
-rw-r--r--src/threed/textures/qgltexture2d.cpp805
-rw-r--r--src/threed/textures/qgltexture2d.h115
-rw-r--r--src/threed/textures/qgltexture2d_p.h126
-rw-r--r--src/threed/textures/qgltexturecube.cpp549
-rw-r--r--src/threed/textures/qgltexturecube.h112
-rw-r--r--src/threed/textures/qgltextureutils.cpp785
-rw-r--r--src/threed/textures/qgltextureutils_p.h164
-rw-r--r--src/threed/textures/textures.pri15
-rw-r--r--src/threed/threed.pri15
-rw-r--r--src/threed/threed.pro95
-rw-r--r--src/threed/viewing/qglcamera.cpp1328
-rw-r--r--src/threed/viewing/qglcamera.h184
-rw-r--r--src/threed/viewing/qglcameraanimation.cpp543
-rw-r--r--src/threed/viewing/qglcameraanimation.h116
-rw-r--r--src/threed/viewing/qglview.cpp1496
-rw-r--r--src/threed/viewing/qglview.h146
-rw-r--r--src/threed/viewing/viewing.pri12
-rw-r--r--tests/auto/auto.pro2
-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.qml400
-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.qml194
-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.qml270
-rw-r--r--tests/auto/qml3d/picking/tst_picking.qml193
-rw-r--r--tests/auto/qml3d/qml3d.pro23
-rw-r--r--tests/auto/qml3d/scale3d/tst_scale3d.qml109
-rw-r--r--tests/auto/qml3d/shaders/test.pngbin159 -> 0 bytes
-rw-r--r--tests/auto/qml3d/shaders/tst_shaders.qml136
-rw-r--r--tests/auto/qml3d/sphere/tst_sphere.qml126
-rw-r--r--tests/auto/qml3d/tst_qml3d.cpp414
-rw-r--r--tests/auto/qml3d/viewport/tst_viewport.qml138
-rw-r--r--tests/auto/threed/load_model/load_model.pro9
-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.cpp232
-rw-r--r--tests/auto/threed/qareaallocator/qareaallocator.pro6
-rw-r--r--tests/auto/threed/qareaallocator/tst_qareaallocator.cpp280
-rw-r--r--tests/auto/threed/qarray/qarray.pro6
-rw-r--r--tests/auto/threed/qarray/tst_qarray.cpp1862
-rw-r--r--tests/auto/threed/qbox3d/qbox3d.pro6
-rw-r--r--tests/auto/threed/qbox3d/tst_qbox3d.cpp1302
-rw-r--r--tests/auto/threed/qcolor4ub/qcolor4ub.pro6
-rw-r--r--tests/auto/threed/qcolor4ub/tst_qcolor4ub.cpp341
-rw-r--r--tests/auto/threed/qcustomdataarray/qcustomdataarray.pro6
-rw-r--r--tests/auto/threed/qcustomdataarray/tst_qcustomdataarray.cpp139
-rw-r--r--tests/auto/threed/qgeometrydata/qgeometrydata.pro9
-rw-r--r--tests/auto/threed/qgeometrydata/tst_qgeometrydata.cpp629
-rw-r--r--tests/auto/threed/qglabstractsurface/qglabstractsurface.pro6
-rw-r--r--tests/auto/threed/qglabstractsurface/tst_qglabstractsurface.cpp333
-rw-r--r--tests/auto/threed/qglattributedescription/qglattributedescription.pro9
-rw-r--r--tests/auto/threed/qglattributedescription/tst_qglattributedescription.cpp137
-rw-r--r--tests/auto/threed/qglattributeset/qglattributeset.pro6
-rw-r--r--tests/auto/threed/qglattributeset/tst_qglattributeset.cpp211
-rw-r--r--tests/auto/threed/qglattributevalue/qglattributevalue.pro9
-rw-r--r--tests/auto/threed/qglattributevalue/tst_qglattributevalue.cpp262
-rw-r--r--tests/auto/threed/qglbezierpatches/qglbezierpatches.pro6
-rw-r--r--tests/auto/threed/qglbezierpatches/tst_qglbezierpatches.cpp214
-rw-r--r--tests/auto/threed/qglbuilder/qglbuilder.pro8
-rw-r--r--tests/auto/threed/qglbuilder/tst_qglbuilder.cpp888
-rw-r--r--tests/auto/threed/qglcamera/qglcamera.pro10
-rw-r--r--tests/auto/threed/qglcamera/tst_qglcamera.cpp327
-rw-r--r--tests/auto/threed/qglcameraanimation/qglcameraanimation.pro9
-rw-r--r--tests/auto/threed/qglcameraanimation/tst_qglcameraanimation.cpp162
-rw-r--r--tests/auto/threed/qglcolladafxeffectfactory/collada_cube.xml127
-rw-r--r--tests/auto/threed/qglcolladafxeffectfactory/qglcolladafxeffectfactory.pro13
-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.pro7
-rw-r--r--tests/auto/threed/qglcube/tst_qglcube.cpp185
-rw-r--r--tests/auto/threed/qglcylinder/qglcylinder.pro7
-rw-r--r--tests/auto/threed/qglcylinder/tst_qglcylinder.cpp283
-rw-r--r--tests/auto/threed/qglindexbuffer/qglindexbuffer.pro6
-rw-r--r--tests/auto/threed/qglindexbuffer/tst_qglindexbuffer.cpp478
-rw-r--r--tests/auto/threed/qgllightmodel/qgllightmodel.pro6
-rw-r--r--tests/auto/threed/qgllightmodel/tst_qgllightmodel.cpp122
-rw-r--r--tests/auto/threed/qgllightparameters/qgllightparameters.pro6
-rw-r--r--tests/auto/threed/qgllightparameters/tst_qgllightparameters.cpp275
-rw-r--r--tests/auto/threed/qglmaterial/qglmaterial.pro6
-rw-r--r--tests/auto/threed/qglmaterial/tst_qglmaterial.cpp714
-rw-r--r--tests/auto/threed/qglmaterialcollection/qglmaterialcollection.pro6
-rw-r--r--tests/auto/threed/qglmaterialcollection/tst_qglmaterialcollection.cpp236
-rw-r--r--tests/auto/threed/qglpainter/qglpainter.pro15
-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.cpp121
-rw-r--r--tests/auto/threed/qglpainter/qgltestwidget.h75
-rw-r--r--tests/auto/threed/qglpainter/tst_qglpainter.cpp874
-rw-r--r--tests/auto/threed/qglpickcolors/qglpickcolors.pro14
-rw-r--r--tests/auto/threed/qglpickcolors/tst_qglpickcolors.cpp299
-rw-r--r--tests/auto/threed/qglrender/qglrender.pro6
-rw-r--r--tests/auto/threed/qglrender/tst_qglrender.cpp259
-rw-r--r--tests/auto/threed/qglscenenode/qglscenenode.pro7
-rw-r--r--tests/auto/threed/qglscenenode/tst_qglscenenode.cpp751
-rw-r--r--tests/auto/threed/qglsection/qglsection.pro8
-rw-r--r--tests/auto/threed/qglsection/tst_qglsection.cpp674
-rw-r--r--tests/auto/threed/qglsharedresource/qglsharedresource.pro10
-rw-r--r--tests/auto/threed/qglsharedresource/tst_qglsharedresource.cpp158
-rw-r--r--tests/auto/threed/qglsphere/qglsphere.pro7
-rw-r--r--tests/auto/threed/qglsphere/tst_qglsphere.cpp125
-rw-r--r--tests/auto/threed/qglvertexbundle/qglvertexbundle.pro6
-rw-r--r--tests/auto/threed/qglvertexbundle/tst_qglvertexbundle.cpp282
-rw-r--r--tests/auto/threed/qgraphicstransform3d/qgraphicstransform3d.pro6
-rw-r--r--tests/auto/threed/qgraphicstransform3d/tst_qgraphicstransform3d.cpp280
-rw-r--r--tests/auto/threed/qopenglfunctions/qopenglfunctions.pro6
-rw-r--r--tests/auto/threed/qopenglfunctions/tst_qopenglfunctions.cpp245
-rw-r--r--tests/auto/threed/qplane3d/qplane3d.pro6
-rw-r--r--tests/auto/threed/qplane3d/tst_qplane3d.cpp450
-rw-r--r--tests/auto/threed/qray3d/qray3d.pro5
-rw-r--r--tests/auto/threed/qray3d/tst_qray3d.cpp540
-rw-r--r--tests/auto/threed/qsphere3d/qsphere3d.pro5
-rw-r--r--tests/auto/threed/qsphere3d/tst_qsphere3d.cpp238
-rw-r--r--tests/auto/threed/qstereoimage/qstereoimage.pro10
-rw-r--r--tests/auto/threed/qstereoimage/tst_qstereoimage.cpp428
-rw-r--r--tests/auto/threed/qtriangle3d/qtriangle3d.pro6
-rw-r--r--tests/auto/threed/qtriangle3d/tst_qtriangle3d.cpp714
-rw-r--r--tests/auto/threed/qvectorarray/qvectorarray.pro7
-rw-r--r--tests/auto/threed/qvectorarray/tst_qvectorarray.cpp664
-rw-r--r--tests/auto/threed/threed.pro40
-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.pro18
-rw-r--r--tests/benchmarks/matrix_properties/tst_matrix_properties.cpp183
-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.pro10
-rw-r--r--tests/manual/animations/main.cpp63
-rw-r--r--tests/manual/animations/qml/TestCase.qml89
-rw-r--r--tests/manual/animations/qml/tst_animations.qml117
-rw-r--r--tests/manual/animations/qtquick3d.pngbin6565 -> 0 bytes
-rw-r--r--tests/manual/animations/tst_animations_qml.desktop7
-rw-r--r--tests/manual/displaymodel/README16
-rw-r--r--tests/manual/displaymodel/displaymodel.pro10
-rw-r--r--tests/manual/displaymodel/main.cpp63
-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/displaymodel/qtquick3d.pngbin4050 -> 0 bytes
-rw-r--r--tests/manual/lighting/lighting.pro10
-rw-r--r--tests/manual/lighting/main.cpp63
-rw-r--r--tests/manual/lighting/qml/LightingTestCase.qml132
-rw-r--r--tests/manual/lighting/qml/tst_lighting.qml76
-rw-r--r--tests/manual/lighting/qtquick3d.pngbin4050 -> 0 bytes
-rw-r--r--tests/manual/lighting/tst_lighting_qml.desktop7
-rw-r--r--tests/manual/manual.pro13
-rw-r--r--tests/manual/model3ds/README12
-rw-r--r--tests/manual/model3ds/main.cpp63
-rw-r--r--tests/manual/model3ds/model3ds.pro10
-rw-r--r--tests/manual/model3ds/model3ds.qrc10
-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/qtquick3d.pngbin4050 -> 0 bytes
-rw-r--r--tests/manual/model3ds/tst_submesh_qml.desktop7
-rw-r--r--tests/manual/navigation1/README8
-rw-r--r--tests/manual/navigation1/main.cpp63
-rw-r--r--tests/manual/navigation1/navigation1.pro10
-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/navigation1/qtquick3d.pngbin4050 -> 0 bytes
-rw-r--r--tests/manual/qrc/README4
-rw-r--r--tests/manual/qrc/main.cpp67
-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.pro17
-rw-r--r--tests/manual/qrc/qrc.qrc6
-rw-r--r--tests/manual/qrc/qtquick3d.pngbin4050 -> 0 bytes
-rw-r--r--tests/manual/qrc/tst_qrc_qml.desktop7
-rw-r--r--tests/manual/qt3d.svg32
-rw-r--r--tests/manual/qtquick3d.svg23
-rw-r--r--tests/manual/rotation/main.cpp63
-rw-r--r--tests/manual/rotation/qml/TestCase.qml97
-rw-r--r--tests/manual/rotation/qml/tst_rotation.qml102
-rw-r--r--tests/manual/rotation/qtquick3d.pngbin4050 -> 0 bytes
-rw-r--r--tests/manual/rotation/rotation.pro10
-rw-r--r--tests/manual/rotation/tst_rotation_qml.desktop7
-rw-r--r--tests/manual/scaling/main.cpp63
-rw-r--r--tests/manual/scaling/qml/ScalingTestCase.qml122
-rw-r--r--tests/manual/scaling/qml/tst_scaling.qml150
-rw-r--r--tests/manual/scaling/qtquick3d.pngbin4050 -> 0 bytes
-rw-r--r--tests/manual/scaling/scaling.pro10
-rw-r--r--tests/manual/scaling/tst_scaling_qml.desktop7
-rw-r--r--tests/manual/shapes/README6
-rw-r--r--tests/manual/shapes/main.cpp63
-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.pro10
-rw-r--r--tests/manual/shapes/tst_shapes_qml.desktop7
-rw-r--r--tests/manual/submesh/README9
-rw-r--r--tests/manual/submesh/main.cpp63
-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/qtquick3d.pngbin4050 -> 0 bytes
-rw-r--r--tests/manual/submesh/submesh.pro10
-rw-r--r--tests/manual/submesh/tst_submesh_qml.desktop7
-rw-r--r--tests/manual/transformations/main.cpp63
-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/tst_transformations.qml64
-rw-r--r--tests/manual/transformations/qtquick3d.pngbin4050 -> 0 bytes
-rw-r--r--tests/manual/transformations/transformations.pro10
-rw-r--r--tests/manual/transformations/tst_transformations_qml.desktop7
-rw-r--r--tests/manual/translation/README1
-rw-r--r--tests/manual/translation/main.cpp63
-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/tst_translation.qml158
-rw-r--r--tests/manual/translation/qtquick3d.pngbin4050 -> 0 bytes
-rw-r--r--tests/manual/translation/translation.pro10
-rw-r--r--tests/manual/translation/tst_translation_qml.desktop7
-rw-r--r--tests/shared/compareimage.cpp165
-rw-r--r--tests/shared/compareimage.h54
-rw-r--r--tests/shared/qmlres.h129
-rw-r--r--tests/shared/qtest_helpers.h160
-rw-r--r--tests/systemtests/sys_quick3d.pro11
-rw-r--r--tests/systemtests/sys_quick3d.qtt1094
-rw-r--r--tests/tests.pro8
-rw-r--r--tutorials/qt3d/cube1/cube1.pro17
-rw-r--r--tutorials/qt3d/cube1/cubeview.cpp67
-rw-r--r--tutorials/qt3d/cube1/cubeview.h66
-rw-r--r--tutorials/qt3d/cube1/main.cpp50
-rw-r--r--tutorials/qt3d/cube2/cube2.pro17
-rw-r--r--tutorials/qt3d/cube2/cubeview.cpp66
-rw-r--r--tutorials/qt3d/cube2/cubeview.h66
-rw-r--r--tutorials/qt3d/cube2/main.cpp50
-rw-r--r--tutorials/qt3d/cube3/cube3.pro17
-rw-r--r--tutorials/qt3d/cube3/cubeview.cpp69
-rw-r--r--tutorials/qt3d/cube3/cubeview.h66
-rw-r--r--tutorials/qt3d/cube3/main.cpp50
-rw-r--r--tutorials/qt3d/cube4/cube.qml61
-rw-r--r--tutorials/qt3d/cube4/cube.qrc5
-rw-r--r--tutorials/qt3d/cube4/cube4.pro18
-rw-r--r--tutorials/qt3d/cube4/cubeview.cpp76
-rw-r--r--tutorials/qt3d/cube4/cubeview.h70
-rw-r--r--tutorials/qt3d/cube4/main.cpp50
-rw-r--r--tutorials/qt3d/cube4/qtlogo.pngbin13923 -> 0 bytes
-rw-r--r--tutorials/qt3d/penguin/main.cpp51
-rw-r--r--tutorials/qt3d/penguin/model.qrc5
-rw-r--r--tutorials/qt3d/penguin/modelview.cpp64
-rw-r--r--tutorials/qt3d/penguin/modelview.h68
-rw-r--r--tutorials/qt3d/penguin/penguin.3dsbin36301 -> 0 bytes
-rw-r--r--tutorials/qt3d/penguin/penguin.pro21
-rw-r--r--tutorials/qt3d/penguin_advanced/main.cpp51
-rw-r--r--tutorials/qt3d/penguin_advanced/model_advanced.qrc5
-rw-r--r--tutorials/qt3d/penguin_advanced/modelview.cpp76
-rw-r--r--tutorials/qt3d/penguin_advanced/modelview.h68
-rw-r--r--tutorials/qt3d/penguin_advanced/penguin.3dsbin36301 -> 0 bytes
-rw-r--r--tutorials/qt3d/penguin_advanced/penguin_advanced.pro21
-rw-r--r--tutorials/qt3d/qt3d.pro3
-rw-r--r--tutorials/qt3d/qt3d.svg32
-rw-r--r--tutorials/quick3d/qmlres.h129
-rw-r--r--tutorials/quick3d/qtquick3d.svg23
-rw-r--r--tutorials/quick3d/quick3d.pro2
-rw-r--r--tutorials/quick3d/shaders/TutorialTeapot.qml65
-rw-r--r--tutorials/quick3d/shaders/meshes/teapot.bez340
-rw-r--r--tutorials/quick3d/shaders/shader-tutorial-1-textures.qml105
-rw-r--r--tutorials/quick3d/shaders/shader-tutorial-2-vertex-shader.qml117
-rw-r--r--tutorials/quick3d/shaders/shader-tutorial-3-transformed-coordinates.qml126
-rw-r--r--tutorials/quick3d/shaders/shader-tutorial-lighting.qml85
-rw-r--r--tutorials/quick3d/shaders/shader-tutorial-varying.qml77
-rw-r--r--tutorials/quick3d/shaders/shader-tutorial.qml83
-rw-r--r--tutorials/quick3d/shaders/shaders.pro7
-rw-r--r--tutorials/quick3d/shaders/shaders.qmlproject16
-rw-r--r--tutorials/quick3d/teapot_bounce_qml/main.cpp69
-rw-r--r--tutorials/quick3d/teapot_bounce_qml/qml/teapot-bounce.qml76
-rw-r--r--tutorials/quick3d/teapot_bounce_qml/qml/teapot.bez340
-rw-r--r--tutorials/quick3d/teapot_bounce_qml/teapot_bounce_qml.desktop7
-rw-r--r--tutorials/quick3d/teapot_bounce_qml/teapot_bounce_qml.pro25
-rw-r--r--tutorials/quick3d/teapot_bounce_qml/teapot_bounce_qml.rc1
-rw-r--r--tutorials/quick3d/teapot_qml/main.cpp69
-rw-r--r--tutorials/quick3d/teapot_qml/qml/teapot.bez340
-rw-r--r--tutorials/quick3d/teapot_qml/qml/teapot.qml59
-rw-r--r--tutorials/quick3d/teapot_qml/teapot_qml.desktop7
-rw-r--r--tutorials/quick3d/teapot_qml/teapot_qml.pro25
-rw-r--r--tutorials/quick3d/teapot_qml/teapot_qml.rc1
-rw-r--r--tutorials/tutorials.pro9
-rw-r--r--util/gencube/gencube.cpp152
-rw-r--r--util/gencube/genobjcube.cpp106
-rw-r--r--util/meshcvt/README32
-rw-r--r--util/meshcvt/meshcvt.cpp216
-rw-r--r--util/meshcvt/meshcvt.pro8
-rw-r--r--util/meshcvt/teapot.txt340
-rw-r--r--util/qt3d/assetviewer/assetviewer.desktop7
-rw-r--r--util/qt3d/assetviewer/assetviewer.pro25
-rw-r--r--util/qt3d/assetviewer/assetviewer.rc1
-rw-r--r--util/qt3d/assetviewer/main.cpp100
-rw-r--r--util/qt3d/assetviewer/qml/AssetViewer.qml292
-rw-r--r--util/qt3d/assetviewer/qml/BlenderValueSlider.qml175
-rw-r--r--util/qt3d/assetviewer/qml/ButtonBarPane.qml51
-rw-r--r--util/qt3d/assetviewer/qml/CheckBox.qml45
-rw-r--r--util/qt3d/assetviewer/qml/ColorPicker.qml286
-rw-r--r--util/qt3d/assetviewer/qml/ColorUtils.js61
-rw-r--r--util/qt3d/assetviewer/qml/HelpOverlay.qml56
-rw-r--r--util/qt3d/assetviewer/qml/ModelPropertiesPane.qml543
-rw-r--r--util/qt3d/assetviewer/qml/ModelViewport.qml452
-rw-r--r--util/qt3d/assetviewer/qml/SaveButton.qml12
-rw-r--r--util/qt3d/assetviewer/qml/Widgets/BlenderToggle.qml48
-rw-r--r--util/qt3d/assetviewer/qml/Widgets/Checkered.qml27
-rw-r--r--util/qt3d/assetviewer/qml/Widgets/ColorSelector.qml72
-rw-r--r--util/qt3d/assetviewer/qml/Widgets/ColorWidget.qml37
-rw-r--r--util/qt3d/assetviewer/qml/Widgets/HSVColor.qml15
-rw-r--r--util/qt3d/assetviewer/qml/Widgets/InputBox.qml39
-rw-r--r--util/qt3d/assetviewer/qml/Widgets/ModelViewportResize.qml30
-rw-r--r--util/qt3d/assetviewer/qml/Widgets/SliderHandle.qml76
-rw-r--r--util/qt3d/assetviewer/qml/Widgets/ZoomControls.qml41
-rw-r--r--util/qt3d/assetviewer/qml/Widgets/images/grow.pngbin252 -> 0 bytes
-rw-r--r--util/qt3d/assetviewer/qml/Widgets/images/shrink.pngbin249 -> 0 bytes
-rw-r--r--util/qt3d/assetviewer/qml/Widgets/images/zoomin.pngbin187 -> 0 bytes
-rw-r--r--util/qt3d/assetviewer/qml/Widgets/images/zoomout.pngbin155 -> 0 bytes
-rw-r--r--util/qt3d/assetviewer/qml/fileHandling.js106
-rw-r--r--util/qt3d/assetviewer/qml/images/help.pngbin737 -> 0 bytes
-rw-r--r--util/qt3d/assetviewer/qml/images/lock.pngbin273 -> 0 bytes
-rw-r--r--util/qt3d/assetviewer/qml/images/minus.pngbin224 -> 0 bytes
-rw-r--r--util/qt3d/assetviewer/qml/images/model.pngbin754 -> 0 bytes
-rw-r--r--util/qt3d/assetviewer/qml/images/open.pngbin596 -> 0 bytes
-rw-r--r--util/qt3d/assetviewer/qml/images/plus.pngbin224 -> 0 bytes
-rw-r--r--util/qt3d/assetviewer/qml/images/save.pngbin706 -> 0 bytes
-rw-r--r--util/qt3d/assetviewer/qml/images/unlock.pngbin292 -> 0 bytes
-rw-r--r--util/qt3d/assetviewer/qml/meshes/monkey.3dsbin13886 -> 0 bytes
-rw-r--r--util/qt3d/assetviewer/qml/meshes/penguin.3dsbin36301 -> 0 bytes
-rw-r--r--util/qt3d/assetviewer/qtquick3d.icobin67646 -> 0 bytes
-rw-r--r--util/qt3d/assetviewer/qtquick3d.pngbin4050 -> 0 bytes
-rw-r--r--util/qt3d/assetviewer/quickfile.cpp163
-rw-r--r--util/qt3d/assetviewer/quickfile.h46
-rw-r--r--util/qt3d/qglinfo/aboutdialog.cpp72
-rw-r--r--util/qt3d/qglinfo/aboutdialog.h67
-rw-r--r--util/qt3d/qglinfo/aboutdialog.ui54
-rw-r--r--util/qt3d/qglinfo/fpswidget.cpp279
-rw-r--r--util/qt3d/qglinfo/fpswidget.h93
-rw-r--r--util/qt3d/qglinfo/images/teapot-logo.pngbin3322 -> 0 bytes
-rw-r--r--util/qt3d/qglinfo/main.cpp64
-rw-r--r--util/qt3d/qglinfo/qglinfo.cpp344
-rw-r--r--util/qt3d/qglinfo/qglinfo.h78
-rw-r--r--util/qt3d/qglinfo/qglinfo.pro25
-rw-r--r--util/qt3d/qglinfo/qglinfo.qrc5
-rw-r--r--util/qt3d/qglinfo/qglinfo.rc1
-rw-r--r--util/qt3d/qglinfo/qglinfowindow.cpp162
-rw-r--r--util/qt3d/qglinfo/qglinfowindow.h77
-rw-r--r--util/qt3d/qglinfo/qglinfowindow.ui218
-rw-r--r--util/qt3d/qglinfo/qtquick3d.icobin51262 -> 0 bytes
-rw-r--r--util/qt3d/qt3d.pro2
-rw-r--r--util/qt3d/qt3d.svg32
-rw-r--r--util/qt3d/qtquick3d.svg23
-rw-r--r--util/util.pro4
1786 files changed, 30 insertions, 300593 deletions
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index febda036..00000000
--- a/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-doc/html
-*.swp
-*~
-*.user
-*.user.*
diff --git a/3rdparty/assimp/LICENSE b/3rdparty/assimp/LICENSE
deleted file mode 100644
index ade56047..00000000
--- a/3rdparty/assimp/LICENSE
+++ /dev/null
@@ -1,47 +0,0 @@
-Open Asset Import Library (Assimp)
-
-
-Copyright (c) 2006-2010, Assimp Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-
-
-AN EXCEPTION applies to all files in the ./test/models-nonbsd subfolder.
-These are 3d models for testing purposes, from various free sources
-on the internet. They are - unless otherwise stated - copyright of
-their respective creators, which may impose additional requirements
-on the use of their work. For any of these models, see
-<model-name>.source.txt for more legal information. Contact us if you
-are a copyright holder and believe that we credited you inproperly or
-if you don't want your files to appear in the repository.
-
diff --git a/3rdparty/assimp/README b/3rdparty/assimp/README
deleted file mode 100644
index e5592ffb..00000000
--- a/3rdparty/assimp/README
+++ /dev/null
@@ -1,79 +0,0 @@
- Open Asset Import Library (Assimp) Readme
- -----------------------------------------
-
-Here you can find information regarding Open Asset Import Library:
-
- 1. Overview
- 1.1 Supported file formats
- 1.2 File structure
- 2. Build the Asset Import Library
- 3. Help
- 4. License
-
-
-
-1. Overview
-1.1 Supported file formats
-
-The Asset Import Library provides a lot of model formats:
- - 3DS
- - ASE
- - DXF
- - HMP
- - MD2
- - MD3
- - MD5
- - MDC
- - MDL
- - NFF
- - PLY
- - STL
- - X
- - LWO
- - OBJ
- - SMD
-
- - Collada
-
- - LWO
-
- - Ogre XML
-
- - partly LWS
-
- - .. + many more, see http://assimp.sourceforge.net/main_features_formats.html for a full list.
-
-
-1.2 Repository structure
-
-Open Asset Import Library is implemented in C++ and provides a C-interface. The directory structure is:
-
- /bin Binaries of the Asset Import Library.
- /code Code of the Asset Import Library.
- /contrib Third-party-libraries used by the Asset Import Library.
- /doc Documentation (doxygen generated and data structure as a xml file)
- /include Public headers.
- /lib Static library location for Windows.
- /obj Object file location for Windows.
- /port Ports to other languages.
-
- /test Unit- and regression tests, model test suite.
- /tools Tools (viewer, command line `assimp`).
- /workspaces Build enviroments for vc,xcode,...
-
-
-
-2. Build the Asset Import Library
-
-Take a look into the INSTALL file.
-
-
-
-3. Help
-
-For more help go to http://assimp.sourceforge.net/ (or, for germans, http://www.zfx.info). Or take a look into the doc-folder, which contains the doxygen-generated documentation in HTMl format (CHMs for Windows are as well contained in some distributions and located right here in the root folder).
-
-
-4. License
-
-The license of the Asset Import Library is based on the BSD-License. It is contained in the LICENSE file.
diff --git a/3rdparty/assimp/assimp.pri b/3rdparty/assimp/assimp.pri
deleted file mode 100644
index 20eb27d4..00000000
--- a/3rdparty/assimp/assimp.pri
+++ /dev/null
@@ -1,361 +0,0 @@
-# This file mostly g3nerated by "qmake -project" - use that to regenerate if large scale
-# changes occur to this directory
-
-# AssImp expects this to be defined on debug builds
-CONFIG(debug, debug|release) : DEFINES+=_DEBUG
-
-win32:DEFINES+=_CRT_SECURE_NO_WARNINGS
-
-DEPENDPATH += \
- $$PWD \
- $$PWD/code \
- $$PWD/include \
- $$PWD/code/res \
- $$PWD/contrib/ConvertUTF \
- $$PWD/contrib/irrXML \
- $$PWD/contrib/unzip \
- $$PWD/contrib/zlib \
- $$PWD/include/Compiler \
- $$PWD/code/BoostWorkaround/boost \
- $$PWD/code/BoostWorkaround/boost/math \
- $$PWD/code/BoostWorkaround/boost/tuple
-
-VPATH += \
- $$PWD/code \
- $$PWD/contrib/ConvertUTF \
- $$PWD/contrib/zlib \
- $$PWD/contrib/irrXML \
- $$PWD/contrib/unzip
-
-INCLUDEPATH += \
- $$PWD \
- $$PWD/code \
- $$PWD/code/BoostWorkaround \
- $$PWD/include \
- $$PWD/include/Compiler \
- $$PWD/contrib/ConvertUTF \
- $$PWD/contrib/zlib \
- $$PWD/contrib/irrXML \
- $$PWD/contrib/unzip
-
-# Input
-HEADERS += \
- revision.h \
- code/3DSHelper.h \
- code/3DSLoader.h \
- code/ACLoader.h \
- code/ASELoader.h \
- code/ASEParser.h \
- code/assbin_chunks.h \
- code/AssimpPCH.h \
- code/B3DImporter.h \
- code/BaseImporter.h \
- code/BaseProcess.h \
- code/BlenderDNA.h \
- code/BlenderIntermediate.h \
- code/BlenderLoader.h \
- code/BlenderModifier.h \
- code/BlenderScene.h \
- code/BlenderSceneGen.h \
- code/BVHLoader.h \
- code/ByteSwap.h \
- code/CalcTangentsProcess.h \
- code/COBLoader.h \
- code/COBScene.h \
- code/ColladaHelper.h \
- code/ColladaLoader.h \
- code/ColladaParser.h \
- code/ComputeUVMappingProcess.h \
- code/ConvertToLHProcess.h \
- code/CSMLoader.h \
- code/DefaultIOStream.h \
- code/DefaultIOSystem.h \
- code/DefaultProgressHandler.h \
- code/DXFLoader.h \
- code/Exceptional.h \
- code/fast_atof.h \
- code/FileLogStream.h \
- code/FileSystemFilter.h \
- code/FindDegenerates.h \
- code/FindInstancesProcess.h \
- code/FindInvalidDataProcess.h \
- code/FixNormalsStep.h \
- code/GenericProperty.h \
- code/GenFaceNormalsProcess.h \
- code/GenVertexNormalsProcess.h \
- code/HalfLifeFileData.h \
- code/Hash.h \
- code/HMPFileData.h \
- code/HMPLoader.h \
- code/IFF.h \
- code/ImproveCacheLocality.h \
- code/IRRLoader.h \
- code/IRRMeshLoader.h \
- code/IRRShared.h \
- code/irrXMLWrapper.h \
- code/JoinVerticesProcess.h \
- code/LimitBoneWeightsProcess.h \
- code/LineSplitter.h \
- code/LWOAnimation.h \
- code/LWOFileData.h \
- code/LWOLoader.h \
- code/LWSLoader.h \
- code/MakeVerboseFormat.h \
- code/MaterialSystem.h \
- code/MD2FileData.h \
- code/MD2Loader.h \
- code/MD2NormalTable.h \
- code/MD3FileData.h \
- code/MD3Loader.h \
- code/MD4FileData.h \
- code/MD5Loader.h \
- code/MD5Parser.h \
- code/MDCFileData.h \
- code/MDCLoader.h \
- code/MDCNormalTable.h \
- code/MDLDefaultColorMap.h \
- code/MDLFileData.h \
- code/MDLLoader.h \
- code/MemoryIOWrapper.h \
- code/MS3DLoader.h \
- code/NDOLoader.h \
- code/NFFLoader.h \
- code/ObjFileData.h \
- code/ObjFileImporter.h \
- code/ObjFileMtlImporter.h \
- code/ObjFileParser.h \
- code/ObjTools.h \
- code/OFFLoader.h \
- code/OgreImporter.h \
- code/OgreXmlHelper.h \
- code/OptimizeGraph.h \
- code/OptimizeMeshes.h \
- code/ParsingUtils.h \
- code/PlyLoader.h \
- code/PlyParser.h \
- code/PretransformVertices.h \
- code/ProcessHelper.h \
- code/Profiler.h \
- code/pstdint.h \
- code/Q3BSPFileData.h \
- code/Q3BSPFileImporter.h \
- code/Q3BSPFileParser.h \
- code/Q3BSPZipArchive.h \
- code/Q3DLoader.h \
- code/qnan.h \
- code/RawLoader.h \
- code/RemoveComments.h \
- code/RemoveRedundantMaterials.h \
- code/RemoveVCProcess.h \
- code/SceneCombiner.h \
- code/ScenePreprocessor.h \
- code/SGSpatialSort.h \
- code/SkeletonMeshBuilder.h \
- code/SMDLoader.h \
- code/SmoothingGroups.h \
- code/SortByPTypeProcess.h \
- code/SpatialSort.h \
- code/SplitLargeMeshes.h \
- code/StandardShapes.h \
- code/StdOStreamLogStream.h \
- code/STLLoader.h \
- code/StreamReader.h \
- code/StringComparison.h \
- code/Subdivision.h \
- code/TargetAnimation.h \
- code/TerragenLoader.h \
- code/TextureTransform.h \
- code/TinyFormatter.h \
- code/TriangulateProcess.h \
- code/UnrealLoader.h \
- code/ValidateDataStructure.h \
- code/Vertex.h \
- code/VertexTriangleAdjacency.h \
- code/Win32DebugLogStream.h \
- code/XFileHelper.h \
- code/XFileImporter.h \
- code/XFileParser.h \
- include/aiAnim.h \
- include/aiAssert.h \
- include/aiCamera.h \
- include/aiColor4D.h \
- include/aiConfig.h \
- include/aiDefines.h \
- include/aiFileIO.h \
- include/aiLight.h \
- include/aiMaterial.h \
- include/aiMatrix3x3.h \
- include/aiMatrix4x4.h \
- include/aiMesh.h \
- include/aiPostProcess.h \
- include/aiQuaternion.h \
- include/aiScene.h \
- include/aiTexture.h \
- include/aiTypes.h \
- include/aiVector2D.h \
- include/aiVector3D.h \
- include/aiVersion.h \
- include/assimp.h \
- include/assimp.hpp \
- include/DefaultLogger.h \
- include/IOStream.h \
- include/IOSystem.h \
- include/Logger.h \
- include/LogStream.h \
- include/NullLogger.h \
- include/ProgressHandler.h \
- code/res/resource.h \
- contrib/ConvertUTF/ConvertUTF.h \
- contrib/irrXML/CXMLReaderImpl.h \
- contrib/irrXML/heapsort.h \
- contrib/irrXML/irrArray.h \
- contrib/irrXML/irrString.h \
- contrib/irrXML/irrTypes.h \
- contrib/irrXML/irrXML.h \
- contrib/unzip/crypt.h \
- contrib/unzip/ioapi.h \
- contrib/unzip/unzip.h \
- contrib/zlib/crc32.h \
- contrib/zlib/deflate.h \
- contrib/zlib/inffast.h \
- contrib/zlib/inffixed.h \
- contrib/zlib/inflate.h \
- contrib/zlib/inftrees.h \
- contrib/zlib/trees.h \
- contrib/zlib/zconf.h \
- contrib/zlib/zconf.in.h \
- contrib/zlib/zlib.h \
- contrib/zlib/zutil.h \
- include/Compiler/poppack1.h \
- include/Compiler/pushpack1.h \
- code/BoostWorkaround/boost/foreach.hpp \
- code/BoostWorkaround/boost/format.hpp \
- code/BoostWorkaround/boost/lexical_cast.hpp \
- code/BoostWorkaround/boost/pointer_cast.hpp \
- code/BoostWorkaround/boost/scoped_array.hpp \
- code/BoostWorkaround/boost/scoped_ptr.hpp \
- code/BoostWorkaround/boost/shared_array.hpp \
- code/BoostWorkaround/boost/shared_ptr.hpp \
- code/BoostWorkaround/boost/static_assert.hpp \
- code/BoostWorkaround/boost/timer.hpp \
- code/BoostWorkaround/boost/math/common_factor_rt.hpp \
- code/BoostWorkaround/boost/tuple/tuple.hpp \
- include/aiVector3D.inl \
- include/aiColor4D.inl \
- include/aiMatrix3x3.inl \
- include/aiMatrix4x4.inl \
- include/aiMaterial.inl \
- code/SmoothingGroups.inl \
- code/BlenderDNA.inl
-
-SOURCES += \
- code/3DSConverter.cpp \
- code/3DSLoader.cpp \
- code/ACLoader.cpp \
- code/aiAssert.cpp \
- code/ASELoader.cpp \
- code/ASEParser.cpp \
- code/Assimp.cpp \
- code/AssimpPCH.cpp \
- code/B3DImporter.cpp \
- code/BaseImporter.cpp \
- code/BaseProcess.cpp \
- code/BlenderDNA.cpp \
- code/BlenderLoader.cpp \
- code/BlenderModifier.cpp \
- code/BlenderScene.cpp \
- code/BVHLoader.cpp \
- code/CalcTangentsProcess.cpp \
- code/COBLoader.cpp \
- code/ColladaLoader.cpp \
- code/ColladaParser.cpp \
- code/ComputeUVMappingProcess.cpp \
- code/ConvertToLHProcess.cpp \
- code/CSMLoader.cpp \
- code/DefaultIOStream.cpp \
- code/DefaultIOSystem.cpp \
- code/DefaultLogger.cpp \
- code/DXFLoader.cpp \
- code/FindDegenerates.cpp \
- code/FindInstancesProcess.cpp \
- code/FindInvalidDataProcess.cpp \
- code/FixNormalsStep.cpp \
- code/GenFaceNormalsProcess.cpp \
- code/GenVertexNormalsProcess.cpp \
- code/HMPLoader.cpp \
- code/Importer.cpp \
- code/ImproveCacheLocality.cpp \
- code/IRRLoader.cpp \
- code/IRRMeshLoader.cpp \
- code/IRRShared.cpp \
- code/JoinVerticesProcess.cpp \
- code/LimitBoneWeightsProcess.cpp \
- code/LWOAnimation.cpp \
- code/LWOBLoader.cpp \
- code/LWOLoader.cpp \
- code/LWOMaterial.cpp \
- code/LWSLoader.cpp \
- code/MakeVerboseFormat.cpp \
- code/MaterialSystem.cpp \
- code/MD2Loader.cpp \
- code/MD3Loader.cpp \
- code/MD5Loader.cpp \
- code/MD5Parser.cpp \
- code/MDCLoader.cpp \
- code/MDLLoader.cpp \
- code/MDLMaterialLoader.cpp \
- code/MS3DLoader.cpp \
- code/NDOLoader.cpp \
- code/NFFLoader.cpp \
- code/ObjFileImporter.cpp \
- code/ObjFileMtlImporter.cpp \
- code/ObjFileParser.cpp \
- code/OFFLoader.cpp \
- code/OgreImporter.cpp \
- code/OgreImporterMaterial.cpp \
- code/OptimizeGraph.cpp \
- code/OptimizeMeshes.cpp \
- code/PlyLoader.cpp \
- code/PlyParser.cpp \
- code/PretransformVertices.cpp \
- code/Q3BSPFileImporter.cpp \
- code/Q3BSPFileParser.cpp \
- code/Q3BSPZipArchive.cpp \
- code/Q3DLoader.cpp \
- code/RawLoader.cpp \
- code/RemoveComments.cpp \
- code/RemoveRedundantMaterials.cpp \
- code/RemoveVCProcess.cpp \
- code/SceneCombiner.cpp \
- code/ScenePreprocessor.cpp \
- code/SGSpatialSort.cpp \
- code/SkeletonMeshBuilder.cpp \
- code/SMDLoader.cpp \
- code/SortByPTypeProcess.cpp \
- code/SpatialSort.cpp \
- code/SplitLargeMeshes.cpp \
- code/StandardShapes.cpp \
- code/STLLoader.cpp \
- code/Subdivision.cpp \
- code/TargetAnimation.cpp \
- code/TerragenLoader.cpp \
- code/TextureTransform.cpp \
- code/TriangulateProcess.cpp \
- code/UnrealLoader.cpp \
- code/ValidateDataStructure.cpp \
- code/VertexTriangleAdjacency.cpp \
- code/XFileImporter.cpp \
- code/XFileParser.cpp \
- contrib/ConvertUTF/ConvertUTF.c \
- contrib/irrXML/irrXML.cpp \
- contrib/unzip/ioapi.c \
- contrib/unzip/unzip.c \
- contrib/zlib/adler32.c \
- contrib/zlib/compress.c \
- contrib/zlib/crc32.c \
- contrib/zlib/deflate.c \
- contrib/zlib/inffast.c \
- contrib/zlib/inflate.c \
- contrib/zlib/inftrees.c \
- contrib/zlib/trees.c \
- contrib/zlib/zutil.c
diff --git a/3rdparty/assimp/code/3DSConverter.cpp b/3rdparty/assimp/code/3DSConverter.cpp
deleted file mode 100644
index 351d0cca..00000000
--- a/3rdparty/assimp/code/3DSConverter.cpp
+++ /dev/null
@@ -1,844 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file Implementation of the 3ds importer class */
-
-#include "AssimpPCH.h"
-#ifndef ASSIMP_BUILD_NO_3DS_IMPORTER
-
-// internal headers
-#include "3DSLoader.h"
-#include "TargetAnimation.h"
-
-using namespace Assimp;
-
-// ------------------------------------------------------------------------------------------------
-// Setup final material indices, generae a default material if necessary
-void Discreet3DSImporter::ReplaceDefaultMaterial()
-{
-
- // Try to find an existing material that matches the
- // typical default material setting:
- // - no textures
- // - diffuse color (in grey!)
- // NOTE: This is here to workaround the fact that some
- // exporters are writing a default material, too.
- unsigned int idx = 0xcdcdcdcd;
- for (unsigned int i = 0; i < mScene->mMaterials.size();++i)
- {
- std::string s = mScene->mMaterials[i].mName;
- for (std::string::iterator it = s.begin(); it != s.end(); ++it)
- *it = ::tolower(*it);
-
- if (std::string::npos == s.find("default"))continue;
-
- if (mScene->mMaterials[i].mDiffuse.r !=
- mScene->mMaterials[i].mDiffuse.g ||
- mScene->mMaterials[i].mDiffuse.r !=
- mScene->mMaterials[i].mDiffuse.b)continue;
-
- if (mScene->mMaterials[i].sTexDiffuse.mMapName.length() != 0 ||
- mScene->mMaterials[i].sTexBump.mMapName.length() != 0 ||
- mScene->mMaterials[i].sTexOpacity.mMapName.length() != 0 ||
- mScene->mMaterials[i].sTexEmissive.mMapName.length() != 0 ||
- mScene->mMaterials[i].sTexSpecular.mMapName.length() != 0 ||
- mScene->mMaterials[i].sTexShininess.mMapName.length() != 0 )
- {
- continue;
- }
- idx = i;
- }
- if (0xcdcdcdcd == idx)idx = (unsigned int)mScene->mMaterials.size();
-
- // now iterate through all meshes and through all faces and
- // find all faces that are using the default material
- unsigned int cnt = 0;
- for (std::vector<D3DS::Mesh>::iterator
- i = mScene->mMeshes.begin();
- i != mScene->mMeshes.end();++i)
- {
- for (std::vector<unsigned int>::iterator
- a = (*i).mFaceMaterials.begin();
- a != (*i).mFaceMaterials.end();++a)
- {
- // NOTE: The additional check seems to be necessary,
- // some exporters seem to generate invalid data here
- if (0xcdcdcdcd == (*a))
- {
- (*a) = idx;
- ++cnt;
- }
- else if ( (*a) >= mScene->mMaterials.size())
- {
- (*a) = idx;
- DefaultLogger::get()->warn("Material index overflow in 3DS file. Using default material");
- ++cnt;
- }
- }
- }
- if (cnt && idx == mScene->mMaterials.size())
- {
- // We need to create our own default material
- D3DS::Material sMat;
- sMat.mDiffuse = aiColor3D(0.3f,0.3f,0.3f);
- sMat.mName = "%%%DEFAULT";
- mScene->mMaterials.push_back(sMat);
-
- DefaultLogger::get()->info("3DS: Generating default material");
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Check whether all indices are valid. Otherwise we'd crash before the validation step is reached
-void Discreet3DSImporter::CheckIndices(D3DS::Mesh& sMesh)
-{
- for (std::vector< D3DS::Face >::iterator i = sMesh.mFaces.begin(); i != sMesh.mFaces.end();++i)
- {
- // check whether all indices are in range
- for (unsigned int a = 0; a < 3;++a)
- {
- if ((*i).mIndices[a] >= sMesh.mPositions.size())
- {
- DefaultLogger::get()->warn("3DS: Vertex index overflow)");
- (*i).mIndices[a] = (uint32_t)sMesh.mPositions.size()-1;
- }
- if ( !sMesh.mTexCoords.empty() && (*i).mIndices[a] >= sMesh.mTexCoords.size())
- {
- DefaultLogger::get()->warn("3DS: Texture coordinate index overflow)");
- (*i).mIndices[a] = (uint32_t)sMesh.mTexCoords.size()-1;
- }
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Generate out unique verbose format representation
-void Discreet3DSImporter::MakeUnique(D3DS::Mesh& sMesh)
-{
- // TODO: really necessary? I don't think. Just a waste of memory and time
- // to do it now in a separate buffer.
-
- // Allocate output storage
- std::vector<aiVector3D> vNew (sMesh.mFaces.size() * 3);
- std::vector<aiVector3D> vNew2;
- if (sMesh.mTexCoords.size())
- vNew2.resize(sMesh.mFaces.size() * 3);
-
- for (unsigned int i = 0, base = 0; i < sMesh.mFaces.size();++i)
- {
- D3DS::Face& face = sMesh.mFaces[i];
-
- // Positions
- for (unsigned int a = 0; a < 3;++a,++base)
- {
- vNew[base] = sMesh.mPositions[face.mIndices[a]];
- if (sMesh.mTexCoords.size())
- vNew2[base] = sMesh.mTexCoords[face.mIndices[a]];
-
- face.mIndices[a] = base;
- }
- }
- sMesh.mPositions = vNew;
- sMesh.mTexCoords = vNew2;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Convert a 3DS texture to texture keys in an aiMaterial
-void CopyTexture(MaterialHelper& mat, D3DS::Texture& texture, aiTextureType type)
-{
- // Setup the texture name
- aiString tex;
- tex.Set( texture.mMapName);
- mat.AddProperty( &tex, AI_MATKEY_TEXTURE(type,0));
-
- // Setup the texture blend factor
- if (is_not_qnan(texture.mTextureBlend))
- mat.AddProperty<float>( &texture.mTextureBlend, 1, AI_MATKEY_TEXBLEND(type,0));
-
- // Setup the texture mapping mode
- mat.AddProperty<int>((int*)&texture.mMapMode,1,AI_MATKEY_MAPPINGMODE_U(type,0));
- mat.AddProperty<int>((int*)&texture.mMapMode,1,AI_MATKEY_MAPPINGMODE_V(type,0));
-
- // Mirroring - double the scaling values
- // FIXME: this is not really correct ...
- if (texture.mMapMode == aiTextureMapMode_Mirror)
- {
- texture.mScaleU *= 2.f;
- texture.mScaleV *= 2.f;
- texture.mOffsetU /= 2.f;
- texture.mOffsetV /= 2.f;
- }
-
- // Setup texture UV transformations
- mat.AddProperty<float>(&texture.mOffsetU,5,AI_MATKEY_UVTRANSFORM(type,0));
-}
-
-// ------------------------------------------------------------------------------------------------
-// Convert a 3DS material to an aiMaterial
-void Discreet3DSImporter::ConvertMaterial(D3DS::Material& oldMat,
- MaterialHelper& mat)
-{
- // NOTE: Pass the background image to the viewer by bypassing the
- // material system. This is an evil hack, never do it again!
- if (0 != mBackgroundImage.length() && bHasBG)
- {
- aiString tex;
- tex.Set( mBackgroundImage);
- mat.AddProperty( &tex, AI_MATKEY_GLOBAL_BACKGROUND_IMAGE);
-
- // Be sure this is only done for the first material
- mBackgroundImage = std::string("");
- }
-
- // At first add the base ambient color of the scene to the material
- oldMat.mAmbient.r += mClrAmbient.r;
- oldMat.mAmbient.g += mClrAmbient.g;
- oldMat.mAmbient.b += mClrAmbient.b;
-
- aiString name;
- name.Set( oldMat.mName);
- mat.AddProperty( &name, AI_MATKEY_NAME);
-
- // Material colors
- mat.AddProperty( &oldMat.mAmbient, 1, AI_MATKEY_COLOR_AMBIENT);
- mat.AddProperty( &oldMat.mDiffuse, 1, AI_MATKEY_COLOR_DIFFUSE);
- mat.AddProperty( &oldMat.mSpecular, 1, AI_MATKEY_COLOR_SPECULAR);
- mat.AddProperty( &oldMat.mEmissive, 1, AI_MATKEY_COLOR_EMISSIVE);
-
- // Phong shininess and shininess strength
- if (D3DS::Discreet3DS::Phong == oldMat.mShading ||
- D3DS::Discreet3DS::Metal == oldMat.mShading)
- {
- if (!oldMat.mSpecularExponent || !oldMat.mShininessStrength)
- {
- oldMat.mShading = D3DS::Discreet3DS::Gouraud;
- }
- else
- {
- mat.AddProperty( &oldMat.mSpecularExponent, 1, AI_MATKEY_SHININESS);
- mat.AddProperty( &oldMat.mShininessStrength, 1, AI_MATKEY_SHININESS_STRENGTH);
- }
- }
-
- // Opacity
- mat.AddProperty<float>( &oldMat.mTransparency,1,AI_MATKEY_OPACITY);
-
- // Bump height scaling
- mat.AddProperty<float>( &oldMat.mBumpHeight,1,AI_MATKEY_BUMPSCALING);
-
- // Two sided rendering?
- if (oldMat.mTwoSided)
- {
- int i = 1;
- mat.AddProperty<int>(&i,1,AI_MATKEY_TWOSIDED);
- }
-
- // Shading mode
- aiShadingMode eShading = aiShadingMode_NoShading;
- switch (oldMat.mShading)
- {
- case D3DS::Discreet3DS::Flat:
- eShading = aiShadingMode_Flat; break;
-
- // I don't know what "Wire" shading should be,
- // assume it is simple lambertian diffuse shading
- case D3DS::Discreet3DS::Wire:
- {
- // Set the wireframe flag
- unsigned int iWire = 1;
- mat.AddProperty<int>( (int*)&iWire,1,AI_MATKEY_ENABLE_WIREFRAME);
- }
-
- case D3DS::Discreet3DS::Gouraud:
- eShading = aiShadingMode_Gouraud; break;
-
- // assume cook-torrance shading for metals.
- case D3DS::Discreet3DS::Phong :
- eShading = aiShadingMode_Phong; break;
-
- case D3DS::Discreet3DS::Metal :
- eShading = aiShadingMode_CookTorrance; break;
-
- // FIX to workaround a warning with GCC 4 who complained
- // about a missing case Blinn: here - Blinn isn't a valid
- // value in the 3DS Loader, it is just needed for ASE
- case D3DS::Discreet3DS::Blinn :
- eShading = aiShadingMode_Blinn; break;
- }
- mat.AddProperty<int>( (int*)&eShading,1,AI_MATKEY_SHADING_MODEL);
-
- // DIFFUSE texture
- if ( oldMat.sTexDiffuse.mMapName.length() > 0)
- CopyTexture(mat,oldMat.sTexDiffuse, aiTextureType_DIFFUSE);
-
- // SPECULAR texture
- if ( oldMat.sTexSpecular.mMapName.length() > 0)
- CopyTexture(mat,oldMat.sTexSpecular, aiTextureType_SPECULAR);
-
- // OPACITY texture
- if ( oldMat.sTexOpacity.mMapName.length() > 0)
- CopyTexture(mat,oldMat.sTexOpacity, aiTextureType_OPACITY);
-
- // EMISSIVE texture
- if ( oldMat.sTexEmissive.mMapName.length() > 0)
- CopyTexture(mat,oldMat.sTexEmissive, aiTextureType_EMISSIVE);
-
- // BUMP texture
- if ( oldMat.sTexBump.mMapName.length() > 0)
- CopyTexture(mat,oldMat.sTexBump, aiTextureType_HEIGHT);
-
- // SHININESS texture
- if ( oldMat.sTexShininess.mMapName.length() > 0)
- CopyTexture(mat,oldMat.sTexShininess, aiTextureType_SHININESS);
-
- // REFLECTION texture
- if ( oldMat.sTexReflective.mMapName.length() > 0)
- CopyTexture(mat,oldMat.sTexReflective, aiTextureType_REFLECTION);
-
- // Store the name of the material itself, too
- if ( oldMat.mName.length()) {
- aiString tex;
- tex.Set( oldMat.mName);
- mat.AddProperty( &tex, AI_MATKEY_NAME);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Split meshes by their materials and generate output aiMesh'es
-void Discreet3DSImporter::ConvertMeshes(aiScene* pcOut)
-{
- std::vector<aiMesh*> avOutMeshes;
- avOutMeshes.reserve(mScene->mMeshes.size() * 2);
-
- unsigned int iFaceCnt = 0,num = 0;
- aiString name;
-
- // we need to split all meshes by their materials
- for (std::vector<D3DS::Mesh>::iterator i = mScene->mMeshes.begin(); i != mScene->mMeshes.end();++i) {
- boost::scoped_array< std::vector<unsigned int> > aiSplit(new std::vector<unsigned int>[mScene->mMaterials.size()]);
-
- name.length = ASSIMP_itoa10(name.data,num++);
-
- unsigned int iNum = 0;
- for (std::vector<unsigned int>::const_iterator a = (*i).mFaceMaterials.begin();
- a != (*i).mFaceMaterials.end();++a,++iNum)
- {
- aiSplit[*a].push_back(iNum);
- }
- // now generate submeshes
- for (unsigned int p = 0; p < mScene->mMaterials.size();++p)
- {
- if (aiSplit[p].empty()) {
- continue;
- }
- aiMesh* meshOut = new aiMesh();
-
- std::string name_parts((*i).mName);
- name_parts.append("::");
- name_parts.append(mScene->mMaterials.at(p).mName);
- meshOut->mName.Set(name_parts);
-
- meshOut->mPrimitiveTypes = aiPrimitiveType_TRIANGLE;
-
- // be sure to setup the correct material index
- meshOut->mMaterialIndex = p;
-
- // use the color data as temporary storage
- meshOut->mColors[0] = (aiColor4D*)(&*i);
- avOutMeshes.push_back(meshOut);
-
- // convert vertices
- meshOut->mNumFaces = (unsigned int)aiSplit[p].size();
- meshOut->mNumVertices = meshOut->mNumFaces*3;
-
- // allocate enough storage for faces
- meshOut->mFaces = new aiFace[meshOut->mNumFaces];
- iFaceCnt += meshOut->mNumFaces;
-
- meshOut->mVertices = new aiVector3D[meshOut->mNumVertices];
- meshOut->mNormals = new aiVector3D[meshOut->mNumVertices];
- if ((*i).mTexCoords.size())
- {
- meshOut->mTextureCoords[0] = new aiVector3D[meshOut->mNumVertices];
- }
- for (unsigned int q = 0, base = 0; q < aiSplit[p].size();++q)
- {
- register unsigned int index = aiSplit[p][q];
- aiFace& face = meshOut->mFaces[q];
-
- face.mIndices = new unsigned int[3];
- face.mNumIndices = 3;
-
- for (unsigned int a = 0; a < 3;++a,++base)
- {
- unsigned int idx = (*i).mFaces[index].mIndices[a];
- meshOut->mVertices[base] = (*i).mPositions[idx];
- meshOut->mNormals [base] = (*i).mNormals[idx];
-
- if ((*i).mTexCoords.size())
- meshOut->mTextureCoords[0][base] = (*i).mTexCoords[idx];
-
- face.mIndices[a] = base;
- }
- }
- }
- }
-
- // Copy them to the output array
- pcOut->mNumMeshes = (unsigned int)avOutMeshes.size();
- pcOut->mMeshes = new aiMesh*[pcOut->mNumMeshes]();
- for (unsigned int a = 0; a < pcOut->mNumMeshes;++a) {
- pcOut->mMeshes[a] = avOutMeshes[a];
- }
-
- // We should have at least one face here
- if (!iFaceCnt) {
- throw DeadlyImportError("No faces loaded. The mesh is empty");
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Add a node to the scenegraph and setup its final transformation
-void Discreet3DSImporter::AddNodeToGraph(aiScene* pcSOut,aiNode* pcOut,
- D3DS::Node* pcIn, aiMatrix4x4& absTrafo)
-{
- std::vector<unsigned int> iArray;
- iArray.reserve(3);
-
- aiMatrix4x4 abs;
-
- // Find all meshes with the same name as the node
- for (unsigned int a = 0; a < pcSOut->mNumMeshes;++a)
- {
- const D3DS::Mesh* pcMesh = (const D3DS::Mesh*)pcSOut->mMeshes[a]->mColors[0];
- ai_assert(NULL != pcMesh);
-
- if (pcIn->mName == pcMesh->mName)
- iArray.push_back(a);
- }
- if (!iArray.empty())
- {
- // The matrix should be identical for all meshes with the
- // same name. It HAS to be identical for all meshes .....
- D3DS::Mesh* imesh = ((D3DS::Mesh*)pcSOut->mMeshes[iArray[0]]->mColors[0]);
-
- // Compute the inverse of the transformation matrix to move the
- // vertices back to their relative and local space
- aiMatrix4x4 mInv = imesh->mMat, mInvTransposed = imesh->mMat;
- mInv.Inverse();mInvTransposed.Transpose();
- aiVector3D pivot = pcIn->vPivot;
-
- pcOut->mNumMeshes = (unsigned int)iArray.size();
- pcOut->mMeshes = new unsigned int[iArray.size()];
- for (unsigned int i = 0;i < iArray.size();++i) {
- const unsigned int iIndex = iArray[i];
- aiMesh* const mesh = pcSOut->mMeshes[iIndex];
-
- // Transform the vertices back into their local space
- // fixme: consider computing normals after this, so we don't need to transform them
- const aiVector3D* const pvEnd = mesh->mVertices+mesh->mNumVertices;
- aiVector3D* pvCurrent = mesh->mVertices, *t2 = mesh->mNormals;
-
- for (;pvCurrent != pvEnd;++pvCurrent,++t2) {
- *pvCurrent = mInv * (*pvCurrent);
- *t2 = mInvTransposed * (*t2);
- }
-
- // Handle negative transformation matrix determinant -> invert vertex x
- if (imesh->mMat.Determinant() < 0.0f)
- {
- /* we *must* have normals */
- for (pvCurrent = mesh->mVertices,t2 = mesh->mNormals;pvCurrent != pvEnd;++pvCurrent,++t2) {
- pvCurrent->x *= -1.f;
- t2->x *= -1.f;
- }
- DefaultLogger::get()->info("3DS: Flipping mesh X-Axis");
- }
-
- // Handle pivot point
- if (pivot.x || pivot.y || pivot.z)
- {
- for (pvCurrent = mesh->mVertices;pvCurrent != pvEnd;++pvCurrent) {
- *pvCurrent -= pivot;
- }
- }
-
- // Setup the mesh index
- pcOut->mMeshes[i] = iIndex;
- }
- }
-
- // Setup the name of the node
- pcOut->mName.Set(pcIn->mName);
-
- // Now build the transformation matrix of the node
- // ROTATION
- if (pcIn->aRotationKeys.size()){
-
- // FIX to get to Assimp's quaternion conventions
- for (std::vector<aiQuatKey>::iterator it = pcIn->aRotationKeys.begin(); it != pcIn->aRotationKeys.end(); ++it) {
- (*it).mValue.w *= -1.f;
- }
-
- pcOut->mTransformation = aiMatrix4x4( pcIn->aRotationKeys[0].mValue.GetMatrix() );
- }
- else if (pcIn->aCameraRollKeys.size())
- {
- aiMatrix4x4::RotationZ(AI_DEG_TO_RAD(- pcIn->aCameraRollKeys[0].mValue),
- pcOut->mTransformation);
- }
-
- // SCALING
- aiMatrix4x4& m = pcOut->mTransformation;
- if (pcIn->aScalingKeys.size())
- {
- const aiVector3D& v = pcIn->aScalingKeys[0].mValue;
- m.a1 *= v.x; m.b1 *= v.x; m.c1 *= v.x;
- m.a2 *= v.y; m.b2 *= v.y; m.c2 *= v.y;
- m.a3 *= v.z; m.b3 *= v.z; m.c3 *= v.z;
- }
-
- // TRANSLATION
- if (pcIn->aPositionKeys.size())
- {
- const aiVector3D& v = pcIn->aPositionKeys[0].mValue;
- m.a4 += v.x;
- m.b4 += v.y;
- m.c4 += v.z;
- }
-
- // Generate animation channels for the node
- if (pcIn->aPositionKeys.size() > 1 || pcIn->aRotationKeys.size() > 1 ||
- pcIn->aScalingKeys.size() > 1 || pcIn->aCameraRollKeys.size() > 1 ||
- pcIn->aTargetPositionKeys.size() > 1)
- {
- aiAnimation* anim = pcSOut->mAnimations[0];
- ai_assert(NULL != anim);
-
- if (pcIn->aCameraRollKeys.size() > 1)
- {
- DefaultLogger::get()->debug("3DS: Converting camera roll track ...");
-
- // Camera roll keys - in fact they're just rotations
- // around the camera's z axis. The angles are given
- // in degrees (and they're clockwise).
- pcIn->aRotationKeys.resize(pcIn->aCameraRollKeys.size());
- for (unsigned int i = 0; i < pcIn->aCameraRollKeys.size();++i)
- {
- aiQuatKey& q = pcIn->aRotationKeys[i];
- aiFloatKey& f = pcIn->aCameraRollKeys[i];
-
- q.mTime = f.mTime;
-
- // FIX to get to Assimp quaternion conventions
- q.mValue = aiQuaternion(0.f,0.f,AI_DEG_TO_RAD( /*-*/ f.mValue));
- }
- }
-#if 0
- if (pcIn->aTargetPositionKeys.size() > 1)
- {
- DefaultLogger::get()->debug("3DS: Converting target track ...");
-
- // Camera or spot light - need to convert the separate
- // target position channel to our representation
- TargetAnimationHelper helper;
-
- if (pcIn->aPositionKeys.empty())
- {
- // We can just pass zero here ...
- helper.SetFixedMainAnimationChannel(aiVector3D());
- }
- else helper.SetMainAnimationChannel(&pcIn->aPositionKeys);
- helper.SetTargetAnimationChannel(&pcIn->aTargetPositionKeys);
-
- // Do the conversion
- std::vector<aiVectorKey> distanceTrack;
- helper.Process(&distanceTrack);
-
- // Now add a new node as child, name it <ourName>.Target
- // and assign the distance track to it. This is that the
- // information where the target is and how it moves is
- // not lost
- D3DS::Node* nd = new D3DS::Node();
- pcIn->push_back(nd);
-
- nd->mName = pcIn->mName + ".Target";
-
- aiNodeAnim* nda = anim->mChannels[anim->mNumChannels++] = new aiNodeAnim();
- nda->mNodeName.Set(nd->mName);
-
- nda->mNumPositionKeys = (unsigned int)distanceTrack.size();
- nda->mPositionKeys = new aiVectorKey[nda->mNumPositionKeys];
- ::memcpy(nda->mPositionKeys,&distanceTrack[0],
- sizeof(aiVectorKey)*nda->mNumPositionKeys);
- }
-#endif
-
- // Cameras or lights define their transformation in their parent node and in the
- // corresponding light or camera chunks. However, we read and process the latter
- // to to be able to return valid cameras/lights even if no scenegraph is given.
- for (unsigned int n = 0; n < pcSOut->mNumCameras;++n) {
- if (pcSOut->mCameras[n]->mName == pcOut->mName) {
- pcSOut->mCameras[n]->mLookAt = aiVector3D(0.f,0.f,1.f);
- }
- }
- for (unsigned int n = 0; n < pcSOut->mNumLights;++n) {
- if (pcSOut->mLights[n]->mName == pcOut->mName) {
- pcSOut->mLights[n]->mDirection = aiVector3D(0.f,0.f,1.f);
- }
- }
-
- // Allocate a new node anim and setup its name
- aiNodeAnim* nda = anim->mChannels[anim->mNumChannels++] = new aiNodeAnim();
- nda->mNodeName.Set(pcIn->mName);
-
- // POSITION keys
- if (pcIn->aPositionKeys.size() > 0)
- {
- nda->mNumPositionKeys = (unsigned int)pcIn->aPositionKeys.size();
- nda->mPositionKeys = new aiVectorKey[nda->mNumPositionKeys];
- ::memcpy(nda->mPositionKeys,&pcIn->aPositionKeys[0],
- sizeof(aiVectorKey)*nda->mNumPositionKeys);
- }
-
- // ROTATION keys
- if (pcIn->aRotationKeys.size() > 0)
- {
- nda->mNumRotationKeys = (unsigned int)pcIn->aRotationKeys.size();
- nda->mRotationKeys = new aiQuatKey[nda->mNumRotationKeys];
-
- // Rotations are quaternion offsets
- aiQuaternion abs;
- for (unsigned int n = 0; n < nda->mNumRotationKeys;++n)
- {
- const aiQuatKey& q = pcIn->aRotationKeys[n];
-
- abs = (n ? abs * q.mValue : q.mValue);
- nda->mRotationKeys[n].mTime = q.mTime;
- nda->mRotationKeys[n].mValue = abs.Normalize();
- }
- }
-
- // SCALING keys
- if (pcIn->aScalingKeys.size() > 0)
- {
- nda->mNumScalingKeys = (unsigned int)pcIn->aScalingKeys.size();
- nda->mScalingKeys = new aiVectorKey[nda->mNumScalingKeys];
- ::memcpy(nda->mScalingKeys,&pcIn->aScalingKeys[0],
- sizeof(aiVectorKey)*nda->mNumScalingKeys);
- }
- }
-
- // Allocate storage for children
- pcOut->mNumChildren = (unsigned int)pcIn->mChildren.size();
- pcOut->mChildren = new aiNode*[pcIn->mChildren.size()];
-
- // Recursively process all children
- const unsigned int size = pcIn->mChildren.size();
- for (unsigned int i = 0; i < size;++i)
- {
- pcOut->mChildren[i] = new aiNode();
- pcOut->mChildren[i]->mParent = pcOut;
- AddNodeToGraph(pcSOut,pcOut->mChildren[i],pcIn->mChildren[i],abs);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Find out how many node animation channels we'll have finally
-void CountTracks(D3DS::Node* node, unsigned int& cnt)
-{
- //////////////////////////////////////////////////////////////////////////////
- // We will never generate more than one channel for a node, so
- // this is rather easy here.
-
- if (node->aPositionKeys.size() > 1 || node->aRotationKeys.size() > 1 ||
- node->aScalingKeys.size() > 1 || node->aCameraRollKeys.size() > 1 ||
- node->aTargetPositionKeys.size() > 1)
- {
- ++cnt;
-
- // account for the additional channel for the camera/spotlight target position
- if (node->aTargetPositionKeys.size() > 1)++cnt;
- }
-
- // Recursively process all children
- for (unsigned int i = 0; i < node->mChildren.size();++i)
- CountTracks(node->mChildren[i],cnt);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Generate the output node graph
-void Discreet3DSImporter::GenerateNodeGraph(aiScene* pcOut)
-{
- pcOut->mRootNode = new aiNode();
- if (0 == mRootNode->mChildren.size())
- {
- //////////////////////////////////////////////////////////////////////////////
- // It seems the file is so fucked up that it has not even a hierarchy.
- // generate a flat hiearachy which looks like this:
- //
- // ROOT_NODE
- // |
- // ----------------------------------------
- // | | | | |
- // MESH_0 MESH_1 MESH_2 ... MESH_N CAMERA_0 ....
- //
- DefaultLogger::get()->warn("No hierarchy information has been found in the file. ");
-
- pcOut->mRootNode->mNumChildren = pcOut->mNumMeshes +
- mScene->mCameras.size() + mScene->mLights.size();
-
- pcOut->mRootNode->mChildren = new aiNode* [ pcOut->mRootNode->mNumChildren ];
- pcOut->mRootNode->mName.Set("<3DSDummyRoot>");
-
- // Build dummy nodes for all meshes
- unsigned int a = 0;
- for (unsigned int i = 0; i < pcOut->mNumMeshes;++i,++a)
- {
- aiNode* pcNode = pcOut->mRootNode->mChildren[a] = new aiNode();
- pcNode->mParent = pcOut->mRootNode;
- pcNode->mMeshes = new unsigned int[1];
- pcNode->mMeshes[0] = i;
- pcNode->mNumMeshes = 1;
-
- // Build a name for the node
- pcNode->mName.length = sprintf(pcNode->mName.data,"3DSMesh_%i",i);
- }
-
- // Build dummy nodes for all cameras
- for (unsigned int i = 0; i < (unsigned int )mScene->mCameras.size();++i,++a)
- {
- aiNode* pcNode = pcOut->mRootNode->mChildren[a] = new aiNode();
- pcNode->mParent = pcOut->mRootNode;
-
- // Build a name for the node
- pcNode->mName = mScene->mCameras[i]->mName;
- }
-
- // Build dummy nodes for all lights
- for (unsigned int i = 0; i < (unsigned int )mScene->mLights.size();++i,++a)
- {
- aiNode* pcNode = pcOut->mRootNode->mChildren[a] = new aiNode();
- pcNode->mParent = pcOut->mRootNode;
-
- // Build a name for the node
- pcNode->mName = mScene->mLights[i]->mName;
- }
- }
- else
- {
- // First of all: find out how many scaling, rotation and translation
- // animation tracks we'll have afterwards
- unsigned int numChannel = 0;
- CountTracks(mRootNode,numChannel);
-
- if (numChannel)
- {
- // Allocate a primary animation channel
- pcOut->mNumAnimations = 1;
- pcOut->mAnimations = new aiAnimation*[1];
- aiAnimation* anim = pcOut->mAnimations[0] = new aiAnimation();
-
- anim->mName.Set("3DSMasterAnim");
-
- // Allocate enough storage for all node animation channels,
- // but don't set the mNumChannels member - we'll use it to
- // index into the array
- anim->mChannels = new aiNodeAnim*[numChannel];
- }
-
- aiMatrix4x4 m;
- AddNodeToGraph(pcOut, pcOut->mRootNode, mRootNode,m);
- }
-
- // We used the first vertex color set to store some emporary values so we need to cleanup here
- for (unsigned int a = 0; a < pcOut->mNumMeshes;++a)
- pcOut->mMeshes[a]->mColors[0] = NULL;
-
- // Now rotate the whole scene 90 degrees around the x axis to convert to internal coordinate system
- pcOut->mRootNode->mTransformation = aiMatrix4x4(1.f,0.f,0.f,0.f,
- 0.f,0.f,1.f,0.f,0.f,-1.f,0.f,0.f,0.f,0.f,0.f,1.f) * pcOut->mRootNode->mTransformation;
-
- // If the root node is unnamed name it "<3DSRoot>"
- if (::strstr( pcOut->mRootNode->mName.data, "UNNAMED" ) ||
- (pcOut->mRootNode->mName.data[0] == '$' && pcOut->mRootNode->mName.data[1] == '$') )
- {
- pcOut->mRootNode->mName.Set("<3DSRoot>");
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Convert all meshes in the scene and generate the final output scene.
-void Discreet3DSImporter::ConvertScene(aiScene* pcOut)
-{
- // Allocate enough storage for all output materials
- pcOut->mNumMaterials = (unsigned int)mScene->mMaterials.size();
- pcOut->mMaterials = new aiMaterial*[pcOut->mNumMaterials];
-
- // ... and convert the 3DS materials to aiMaterial's
- for (unsigned int i = 0; i < pcOut->mNumMaterials;++i)
- {
- MaterialHelper* pcNew = new MaterialHelper();
- ConvertMaterial(mScene->mMaterials[i],*pcNew);
- pcOut->mMaterials[i] = pcNew;
- }
-
- // Generate the output mesh list
- ConvertMeshes(pcOut);
-
- // Now copy all light sources to the output scene
- pcOut->mNumLights = (unsigned int)mScene->mLights.size();
- if (pcOut->mNumLights)
- {
- pcOut->mLights = new aiLight*[pcOut->mNumLights];
- ::memcpy(pcOut->mLights,&mScene->mLights[0],sizeof(void*)*pcOut->mNumLights);
- }
-
- // Now copy all cameras to the output scene
- pcOut->mNumCameras = (unsigned int)mScene->mCameras.size();
- if (pcOut->mNumCameras)
- {
- pcOut->mCameras = new aiCamera*[pcOut->mNumCameras];
- ::memcpy(pcOut->mCameras,&mScene->mCameras[0],sizeof(void*)*pcOut->mNumCameras);
- }
-}
-
-#endif // !! ASSIMP_BUILD_NO_3DS_IMPORTER
diff --git a/3rdparty/assimp/code/3DSHelper.h b/3rdparty/assimp/code/3DSHelper.h
deleted file mode 100644
index 90da85c6..00000000
--- a/3rdparty/assimp/code/3DSHelper.h
+++ /dev/null
@@ -1,577 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file Defines helper data structures for the import of 3DS files */
-
-#ifndef AI_3DSFILEHELPER_H_INC
-#define AI_3DSFILEHELPER_H_INC
-
-
-#include "SpatialSort.h"
-#include "SmoothingGroups.h"
-
-namespace Assimp {
-namespace D3DS {
-
-#include "./../include/Compiler/pushpack1.h"
-
-// ---------------------------------------------------------------------------
-/** Discreet3DS class: Helper class for loading 3ds files. Defines chunks
-* and data structures.
-*/
-class Discreet3DS
-{
-private:
- inline Discreet3DS() {}
-
-public:
-
- //! data structure for a single chunk in a .3ds file
- struct Chunk
- {
- uint16_t Flag;
- uint32_t Size;
- } PACK_STRUCT;
-
-
- //! Used for shading field in material3ds structure
- //! From AutoDesk 3ds SDK
- typedef enum
- {
- // translated to gouraud shading with wireframe active
- Wire = 0x0,
-
- // if this material is set, no vertex normals will
- // be calculated for the model. Face normals + gouraud
- Flat = 0x1,
-
- // standard gouraud shading
- Gouraud = 0x2,
-
- // phong shading
- Phong = 0x3,
-
- // cooktorrance or anistropic phong shading ...
- // the exact meaning is unknown, if you know it
- // feel free to tell me ;-)
- Metal = 0x4,
-
- // required by the ASE loader
- Blinn = 0x5
- } shadetype3ds;
-
- // Flags for animated keys
- enum
- {
- KEY_USE_TENS = 0x1,
- KEY_USE_CONT = 0x2,
- KEY_USE_BIAS = 0x4,
- KEY_USE_EASE_TO = 0x8,
- KEY_USE_EASE_FROM = 0x10
- } ;
-
- enum
- {
-
- // ********************************************************************
- // Basic chunks which can be found everywhere in the file
- CHUNK_VERSION = 0x0002,
- CHUNK_RGBF = 0x0010, // float4 R; float4 G; float4 B
- CHUNK_RGBB = 0x0011, // int1 R; int1 G; int B
-
- // Linear color values (gamma = 2.2?)
- CHUNK_LINRGBF = 0x0013, // float4 R; float4 G; float4 B
- CHUNK_LINRGBB = 0x0012, // int1 R; int1 G; int B
-
- CHUNK_PERCENTW = 0x0030, // int2 percentage
- CHUNK_PERCENTF = 0x0031, // float4 percentage
- // ********************************************************************
-
- // Prj master chunk
- CHUNK_PRJ = 0xC23D,
-
- // MDLI master chunk
- CHUNK_MLI = 0x3DAA,
-
- // Primary main chunk of the .3ds file
- CHUNK_MAIN = 0x4D4D,
-
- // Mesh main chunk
- CHUNK_OBJMESH = 0x3D3D,
-
- // Specifies the background color of the .3ds file
- // This is passed through the material system for
- // viewing purposes.
- CHUNK_BKGCOLOR = 0x1200,
-
- // Specifies the ambient base color of the scene.
- // This is added to all materials in the file
- CHUNK_AMBCOLOR = 0x2100,
-
- // Specifies the background image for the whole scene
- // This value is passed through the material system
- // to the viewer
- CHUNK_BIT_MAP = 0x1100,
- CHUNK_BIT_MAP_EXISTS = 0x1101,
-
- // ********************************************************************
- // Viewport related stuff. Ignored
- CHUNK_DEFAULT_VIEW = 0x3000,
- CHUNK_VIEW_TOP = 0x3010,
- CHUNK_VIEW_BOTTOM = 0x3020,
- CHUNK_VIEW_LEFT = 0x3030,
- CHUNK_VIEW_RIGHT = 0x3040,
- CHUNK_VIEW_FRONT = 0x3050,
- CHUNK_VIEW_BACK = 0x3060,
- CHUNK_VIEW_USER = 0x3070,
- CHUNK_VIEW_CAMERA = 0x3080,
- // ********************************************************************
-
- // Mesh chunks
- CHUNK_OBJBLOCK = 0x4000,
- CHUNK_TRIMESH = 0x4100,
- CHUNK_VERTLIST = 0x4110,
- CHUNK_VERTFLAGS = 0x4111,
- CHUNK_FACELIST = 0x4120,
- CHUNK_FACEMAT = 0x4130,
- CHUNK_MAPLIST = 0x4140,
- CHUNK_SMOOLIST = 0x4150,
- CHUNK_TRMATRIX = 0x4160,
- CHUNK_MESHCOLOR = 0x4165,
- CHUNK_TXTINFO = 0x4170,
- CHUNK_LIGHT = 0x4600,
- CHUNK_CAMERA = 0x4700,
- CHUNK_HIERARCHY = 0x4F00,
-
- // Specifies the global scaling factor. This is applied
- // to the root node's transformation matrix
- CHUNK_MASTER_SCALE = 0x0100,
-
- // ********************************************************************
- // Material chunks
- CHUNK_MAT_MATERIAL = 0xAFFF,
-
- // asciiz containing the name of the material
- CHUNK_MAT_MATNAME = 0xA000,
- CHUNK_MAT_AMBIENT = 0xA010, // followed by color chunk
- CHUNK_MAT_DIFFUSE = 0xA020, // followed by color chunk
- CHUNK_MAT_SPECULAR = 0xA030, // followed by color chunk
-
- // Specifies the shininess of the material
- // followed by percentage chunk
- CHUNK_MAT_SHININESS = 0xA040,
- CHUNK_MAT_SHININESS_PERCENT = 0xA041 ,
-
- // Specifies the shading mode to be used
- // followed by a short
- CHUNK_MAT_SHADING = 0xA100,
-
- // NOTE: Emissive color (self illumination) seems not
- // to be a color but a single value, type is unknown.
- // Make the parser accept both of them.
- // followed by percentage chunk (?)
- CHUNK_MAT_SELF_ILLUM = 0xA080,
-
- // Always followed by percentage chunk (?)
- CHUNK_MAT_SELF_ILPCT = 0xA084,
-
- // Always followed by percentage chunk
- CHUNK_MAT_TRANSPARENCY = 0xA050,
-
- // Diffuse texture channel 0
- CHUNK_MAT_TEXTURE = 0xA200,
-
- // Contains opacity information for each texel
- CHUNK_MAT_OPACMAP = 0xA210,
-
- // Contains a reflection map to be used to reflect
- // the environment. This is partially supported.
- CHUNK_MAT_REFLMAP = 0xA220,
-
- // Self Illumination map (emissive colors)
- CHUNK_MAT_SELFIMAP = 0xA33d,
-
- // Bumpmap. Not specified whether it is a heightmap
- // or a normal map. Assme it is a heightmap since
- // artist normally prefer this format.
- CHUNK_MAT_BUMPMAP = 0xA230,
-
- // Specular map. Seems to influence the specular color
- CHUNK_MAT_SPECMAP = 0xA204,
-
- // Holds shininess data.
- CHUNK_MAT_MAT_SHINMAP = 0xA33C,
-
- // Scaling in U/V direction.
- // (need to gen separate UV coordinate set
- // and do this by hand)
- CHUNK_MAT_MAP_USCALE = 0xA354,
- CHUNK_MAT_MAP_VSCALE = 0xA356,
-
- // Translation in U/V direction.
- // (need to gen separate UV coordinate set
- // and do this by hand)
- CHUNK_MAT_MAP_UOFFSET = 0xA358,
- CHUNK_MAT_MAP_VOFFSET = 0xA35a,
-
- // UV-coordinates rotation around the z-axis
- // Assumed to be in radians.
- CHUNK_MAT_MAP_ANG = 0xA35C,
-
- // Tiling flags for 3DS files
- CHUNK_MAT_MAP_TILING = 0xa351,
-
- // Specifies the file name of a texture
- CHUNK_MAPFILE = 0xA300,
-
- // Specifies whether a materail requires two-sided rendering
- CHUNK_MAT_TWO_SIDE = 0xA081,
- // ********************************************************************
-
- // Main keyframer chunk. Contains translation/rotation/scaling data
- CHUNK_KEYFRAMER = 0xB000,
-
- // Supported sub chunks
- CHUNK_TRACKINFO = 0xB002,
- CHUNK_TRACKOBJNAME = 0xB010,
- CHUNK_TRACKDUMMYOBJNAME = 0xB011,
- CHUNK_TRACKPIVOT = 0xB013,
- CHUNK_TRACKPOS = 0xB020,
- CHUNK_TRACKROTATE = 0xB021,
- CHUNK_TRACKSCALE = 0xB022,
-
- // ********************************************************************
- // Keyframes for various other stuff in the file
- // Partially ignored
- CHUNK_AMBIENTKEY = 0xB001,
- CHUNK_TRACKMORPH = 0xB026,
- CHUNK_TRACKHIDE = 0xB029,
- CHUNK_OBJNUMBER = 0xB030,
- CHUNK_TRACKCAMERA = 0xB003,
- CHUNK_TRACKFOV = 0xB023,
- CHUNK_TRACKROLL = 0xB024,
- CHUNK_TRACKCAMTGT = 0xB004,
- CHUNK_TRACKLIGHT = 0xB005,
- CHUNK_TRACKLIGTGT = 0xB006,
- CHUNK_TRACKSPOTL = 0xB007,
- CHUNK_FRAMES = 0xB008,
- // ********************************************************************
-
- // light sub-chunks
- CHUNK_DL_OFF = 0x4620,
- CHUNK_DL_OUTER_RANGE = 0x465A,
- CHUNK_DL_INNER_RANGE = 0x4659,
- CHUNK_DL_MULTIPLIER = 0x465B,
- CHUNK_DL_EXCLUDE = 0x4654,
- CHUNK_DL_ATTENUATE = 0x4625,
- CHUNK_DL_SPOTLIGHT = 0x4610,
-
- // camera sub-chunks
- CHUNK_CAM_RANGES = 0x4720
- };
-};
-
-// ---------------------------------------------------------------------------
-/** Helper structure representing a 3ds mesh face */
-struct Face : public FaceWithSmoothingGroup
-{
-};
-
-// ---------------------------------------------------------------------------
-/** Helper structure representing a texture */
-struct Texture
-{
- //! Default constructor
- Texture()
- : mOffsetU (0.0f)
- , mOffsetV (0.0f)
- , mScaleU (1.0f)
- , mScaleV (1.0f)
- , mRotation (0.0f)
- , mMapMode (aiTextureMapMode_Wrap)
- , iUVSrc (0)
- {
- mTextureBlend = get_qnan();
- }
-
- //! Specifies the blend factor for the texture
- float mTextureBlend;
-
- //! Specifies the filename of the texture
- std::string mMapName;
-
- //! Specifies texture coordinate offsets/scaling/rotations
- float mOffsetU;
- float mOffsetV;
- float mScaleU;
- float mScaleV;
- float mRotation;
-
- //! Specifies the mapping mode to be used for the texture
- aiTextureMapMode mMapMode;
-
- //! Used internally
- bool bPrivate;
- int iUVSrc;
-};
-
-#include "./../include/Compiler/poppack1.h"
-
-// ---------------------------------------------------------------------------
-/** Helper structure representing a 3ds material */
-struct Material
-{
- //! Default constructor. Builds a default name for the material
- Material()
- :
- mDiffuse (0.6f,0.6f,0.6f), // FIX ... we won't want object to be black
- mSpecularExponent (0.0f),
- mShininessStrength (1.0f),
- mShading(Discreet3DS::Gouraud),
- mTransparency (1.0f),
- mBumpHeight (1.0f),
- mTwoSided (false)
- {
- static int iCnt = 0;
-
- char szTemp[128];
- sprintf(szTemp,"UNNAMED_%i",iCnt++);
- mName = szTemp;
- }
-
- //! Name of the material
- std::string mName;
- //! Diffuse color of the material
- aiColor3D mDiffuse;
- //! Specular exponent
- float mSpecularExponent;
- //! Shininess strength, in percent
- float mShininessStrength;
- //! Specular color of the material
- aiColor3D mSpecular;
- //! Ambient color of the material
- aiColor3D mAmbient;
- //! Shading type to be used
- Discreet3DS::shadetype3ds mShading;
- //! Opacity of the material
- float mTransparency;
- //! Diffuse texture channel
- Texture sTexDiffuse;
- //! Opacity texture channel
- Texture sTexOpacity;
- //! Specular texture channel
- Texture sTexSpecular;
- //! Reflective texture channel
- Texture sTexReflective;
- //! Bump texture channel
- Texture sTexBump;
- //! Emissive texture channel
- Texture sTexEmissive;
- //! Shininess texture channel
- Texture sTexShininess;
- //! Scaling factor for the bump values
- float mBumpHeight;
- //! Emissive color
- aiColor3D mEmissive;
- //! Ambient texture channel
- //! (used by the ASE format)
- Texture sTexAmbient;
- //! True if the material must be rendered from two sides
- bool mTwoSided;
-};
-
-// ---------------------------------------------------------------------------
-/** Helper structure to represent a 3ds file mesh */
-struct Mesh : public MeshWithSmoothingGroups<D3DS::Face>
-{
- //! Default constructor
- Mesh()
- {
- static int iCnt = 0;
-
- // Generate a default name for the mesh
- char szTemp[128];
- ::sprintf(szTemp,"UNNAMED_%i",iCnt++);
- mName = szTemp;
- }
-
- //! Name of the mesh
- std::string mName;
-
- //! Texture coordinates
- std::vector<aiVector3D> mTexCoords;
-
- //! Face materials
- std::vector<unsigned int> mFaceMaterials;
-
- //! Local transformation matrix
- aiMatrix4x4 mMat;
-};
-
-// ---------------------------------------------------------------------------
-/** Float key - quite similar to aiVectorKey and aiQuatKey. Both are in the
- C-API, so it would be difficult to make them a template. */
-struct aiFloatKey
-{
- double mTime; ///< The time of this key
- float mValue; ///< The value of this key
-
-#ifdef __cplusplus
-
- // time is not compared
- bool operator == (const aiFloatKey& o) const
- {return o.mValue == this->mValue;}
-
- bool operator != (const aiFloatKey& o) const
- {return o.mValue != this->mValue;}
-
- // Only time is compared. This operator is defined
- // for use with std::sort
- bool operator < (const aiFloatKey& o) const
- {return mTime < o.mTime;}
-
- bool operator > (const aiFloatKey& o) const
- {return mTime < o.mTime;}
-
-#endif
-};
-
-// ---------------------------------------------------------------------------
-/** Helper structure to represent a 3ds file node */
-struct Node
-{
- Node()
-
- : mHierarchyPos (0)
- , mHierarchyIndex (0)
-
- {
- static int iCnt = 0;
-
- // Generate a default name for the node
- char szTemp[128];
- ::sprintf(szTemp,"UNNAMED_%i",iCnt++);
- mName = szTemp;
-
- aRotationKeys.reserve (20);
- aPositionKeys.reserve (20);
- aScalingKeys.reserve (20);
- }
-
- ~Node()
- {
- for (unsigned int i = 0; i < mChildren.size();++i)
- delete mChildren[i];
- }
-
- //! Pointer to the parent node
- Node* mParent;
-
- //! Holds all child nodes
- std::vector<Node*> mChildren;
-
- //! Name of the node
- std::string mName;
-
- //! Dummy nodes: real name to be combined with the $$$DUMMY
- std::string mDummyName;
-
- //! Position of the node in the hierarchy (tree depth)
- int16_t mHierarchyPos;
-
- //! Index of the node
- int16_t mHierarchyIndex;
-
- //! Rotation keys loaded from the file
- std::vector<aiQuatKey> aRotationKeys;
-
- //! Position keys loaded from the file
- std::vector<aiVectorKey> aPositionKeys;
-
- //! Scaling keys loaded from the file
- std::vector<aiVectorKey> aScalingKeys;
-
-
- // For target lights (spot lights and directional lights):
- // The position of the target
- std::vector< aiVectorKey > aTargetPositionKeys;
-
- // For cameras: the camera roll angle
- std::vector< aiFloatKey > aCameraRollKeys;
-
- //! Pivot position loaded from the file
- aiVector3D vPivot;
-
- //! Add a child node, setup the right parent node for it
- //! \param pc Node to be 'adopted'
- inline Node& push_back(Node* pc)
- {
- mChildren.push_back(pc);
- pc->mParent = this;
- return *this;
- }
-};
-// ---------------------------------------------------------------------------
-/** Helper structure analogue to aiScene */
-struct Scene
-{
- //! List of all materials loaded
- //! NOTE: 3ds references materials globally
- std::vector<Material> mMaterials;
-
- //! List of all meshes loaded
- std::vector<Mesh> mMeshes;
-
- //! List of all cameras loaded
- std::vector<aiCamera*> mCameras;
-
- //! List of all lights loaded
- std::vector<aiLight*> mLights;
-
- //! Pointer to the root node of the scene
- // --- moved to main class
- // Node* pcRootNode;
-};
-
-
-} // end of namespace D3DS
-} // end of namespace Assimp
-
-#endif // AI_XFILEHELPER_H_INC
diff --git a/3rdparty/assimp/code/3DSLoader.cpp b/3rdparty/assimp/code/3DSLoader.cpp
deleted file mode 100644
index 169256b2..00000000
--- a/3rdparty/assimp/code/3DSLoader.cpp
+++ /dev/null
@@ -1,1378 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file 3DSLoader.cpp
- * @brief Implementation of the 3ds importer class
- *
- * http://www.the-labs.com/Blender/3DS-details.html
- */
-
-#include "AssimpPCH.h"
-#ifndef ASSIMP_BUILD_NO_3DS_IMPORTER
-
-// internal headers
-#include "3DSLoader.h"
-
-using namespace Assimp;
-
-// ------------------------------------------------------------------------------------------------
-// Begins a new parsing block
-// - Reads the current chunk and validates it
-// - computes its length
-#define ASSIMP_3DS_BEGIN_CHUNK() \
- while (true) { \
- if (stream->GetRemainingSizeToLimit() < sizeof(Discreet3DS::Chunk)){ \
- return; \
- } \
- Discreet3DS::Chunk chunk; \
- ReadChunk(&chunk); \
- int chunkSize = chunk.Size-sizeof(Discreet3DS::Chunk); \
- const int oldReadLimit = stream->GetReadLimit(); \
- stream->SetReadLimit(stream->GetCurrentPos() + chunkSize); \
-
-
-// ------------------------------------------------------------------------------------------------
-// End a parsing block
-// Must follow at the end of each parsing block, reset chunk end marker to previous value
-#define ASSIMP_3DS_END_CHUNK() \
- stream->SkipToReadLimit(); \
- stream->SetReadLimit(oldReadLimit); \
- if (stream->GetRemainingSizeToLimit() == 0) \
- return; \
- }
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-Discreet3DSImporter::Discreet3DSImporter()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-Discreet3DSImporter::~Discreet3DSImporter()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the class can handle the format of the given file.
-bool Discreet3DSImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const
-{
- std::string extension = GetExtension(pFile);
- if (extension == "3ds" || extension == "prj" ) {
- return true;
- }
- if (!extension.length() || checkSig) {
- uint16_t token[3];
- token[0] = 0x4d4d;
- token[1] = 0x3dc2;
- //token[2] = 0x3daa;
- return CheckMagicToken(pIOHandler,pFile,token,2,0,2);
- }
- return false;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Get list of all extension supported by this loader
-void Discreet3DSImporter::GetExtensionList(std::set<std::string>& extensions)
-{
- extensions.insert("3ds");
- extensions.insert("prj");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Setup configuration properties
-void Discreet3DSImporter::SetupProperties(const Importer* pImp)
-{
- // nothing to be done for the moment
-}
-
-// ------------------------------------------------------------------------------------------------
-// Imports the given file into the given scene structure.
-void Discreet3DSImporter::InternReadFile( const std::string& pFile,
- aiScene* pScene, IOSystem* pIOHandler)
-{
- StreamReaderLE stream(pIOHandler->Open(pFile,"rb"));
- this->stream = &stream;
-
- // We should have at least one chunk
- if (stream.GetRemainingSize() < 16) {
- throw DeadlyImportError("3DS file is either empty or corrupt: " + pFile);
- }
-
- // Allocate our temporary 3DS representation
- mScene = new D3DS::Scene();
-
- // Initialize members
- mLastNodeIndex = -1;
- mCurrentNode = new D3DS::Node();
- mRootNode = mCurrentNode;
- mRootNode->mHierarchyPos = -1;
- mRootNode->mHierarchyIndex = -1;
- mRootNode->mParent = NULL;
- mMasterScale = 1.0f;
- mBackgroundImage = "";
- bHasBG = false;
- bIsPrj = false;
-
- // Parse the file
- ParseMainChunk();
-
- // Process all meshes in the file. First check whether all
- // face indices haev valid values. The generate our
- // internal verbose representation. Finally compute normal
- // vectors from the smoothing groups we read from the
- // file.
- for (std::vector<D3DS::Mesh>::iterator i = mScene->mMeshes.begin(),
- end = mScene->mMeshes.end(); i != end;++i) {
- CheckIndices(*i);
- MakeUnique (*i);
- ComputeNormalsWithSmoothingsGroups<D3DS::Face>(*i);
- }
-
- // Replace all occurences of the default material with a
- // valid material. Generate it if no material containing
- // DEFAULT in its name has been found in the file
- ReplaceDefaultMaterial();
-
- // Convert the scene from our internal representation to an
- // aiScene object. This involves copying all meshes, lights
- // and cameras to the scene
- ConvertScene(pScene);
-
- // Generate the node graph for the scene. This is a little bit
- // tricky since we'll need to split some meshes into submeshes
- GenerateNodeGraph(pScene);
-
- // Now apply the master scaling factor to the scene
- ApplyMasterScale(pScene);
-
- // Delete our internal scene representation and the root
- // node, so the whole hierarchy will follow
- delete mRootNode;
- delete mScene;
-
- AI_DEBUG_INVALIDATE_PTR(mRootNode);
- AI_DEBUG_INVALIDATE_PTR(mScene);
- AI_DEBUG_INVALIDATE_PTR(this->stream);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Applies a master-scaling factor to the imported scene
-void Discreet3DSImporter::ApplyMasterScale(aiScene* pScene)
-{
- // There are some 3DS files with a zero scaling factor
- if (!mMasterScale)mMasterScale = 1.0f;
- else mMasterScale = 1.0f / mMasterScale;
-
- // Construct an uniform scaling matrix and multiply with it
- pScene->mRootNode->mTransformation *= aiMatrix4x4(
- mMasterScale,0.0f, 0.0f, 0.0f,
- 0.0f, mMasterScale,0.0f, 0.0f,
- 0.0f, 0.0f, mMasterScale,0.0f,
- 0.0f, 0.0f, 0.0f, 1.0f);
-
- // Check whether a scaling track is assigned to the root node.
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads a new chunk from the file
-void Discreet3DSImporter::ReadChunk(Discreet3DS::Chunk* pcOut)
-{
- ai_assert(pcOut != NULL);
-
- pcOut->Flag = stream->GetI2();
- pcOut->Size = stream->GetI4();
-
- if (pcOut->Size - sizeof(Discreet3DS::Chunk) > stream->GetRemainingSize())
- throw DeadlyImportError("Chunk is too large");
-
- if (pcOut->Size - sizeof(Discreet3DS::Chunk) > stream->GetRemainingSizeToLimit())
- DefaultLogger::get()->error("3DS: Chunk overflow");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Skip a chunk
-void Discreet3DSImporter::SkipChunk()
-{
- Discreet3DS::Chunk psChunk;
- ReadChunk(&psChunk);
-
- stream->IncPtr(psChunk.Size-sizeof(Discreet3DS::Chunk));
- return;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Process the primary chunk of the file
-void Discreet3DSImporter::ParseMainChunk()
-{
- ASSIMP_3DS_BEGIN_CHUNK();
-
- // get chunk type
- switch (chunk.Flag)
- {
-
- case Discreet3DS::CHUNK_PRJ:
- bIsPrj = true;
- case Discreet3DS::CHUNK_MAIN:
- ParseEditorChunk();
- break;
- };
-
- ASSIMP_3DS_END_CHUNK();
- // recursively continue processing this hierarchy level
- return ParseMainChunk();
-}
-
-// ------------------------------------------------------------------------------------------------
-void Discreet3DSImporter::ParseEditorChunk()
-{
- ASSIMP_3DS_BEGIN_CHUNK();
-
- // get chunk type
- switch (chunk.Flag)
- {
- case Discreet3DS::CHUNK_OBJMESH:
-
- ParseObjectChunk();
- break;
-
- // NOTE: In several documentations in the internet this
- // chunk appears at different locations
- case Discreet3DS::CHUNK_KEYFRAMER:
-
- ParseKeyframeChunk();
- break;
-
- case Discreet3DS::CHUNK_VERSION:
- {
- // print the version number
- char buff[10];
- ASSIMP_itoa10(buff,stream->GetI2());
- DefaultLogger::get()->info(std::string("3DS file format version: ") + buff);
- }
- break;
- };
- ASSIMP_3DS_END_CHUNK();
-}
-
-// ------------------------------------------------------------------------------------------------
-void Discreet3DSImporter::ParseObjectChunk()
-{
- ASSIMP_3DS_BEGIN_CHUNK();
-
- // get chunk type
- switch (chunk.Flag)
- {
- case Discreet3DS::CHUNK_OBJBLOCK:
- {
- unsigned int cnt = 0;
- const char* sz = (const char*)stream->GetPtr();
-
- // Get the name of the geometry object
- while (stream->GetI1())++cnt;
- ParseChunk(sz,cnt);
- }
- break;
-
- case Discreet3DS::CHUNK_MAT_MATERIAL:
-
- // Add a new material to the list
- mScene->mMaterials.push_back(D3DS::Material());
- ParseMaterialChunk();
- break;
-
- case Discreet3DS::CHUNK_AMBCOLOR:
-
- // This is the ambient base color of the scene.
- // We add it to the ambient color of all materials
- ParseColorChunk(&mClrAmbient,true);
- if (is_qnan(mClrAmbient.r))
- {
- // We failed to read the ambient base color.
- DefaultLogger::get()->error("3DS: Failed to read ambient base color");
- mClrAmbient.r = mClrAmbient.g = mClrAmbient.b = 0.0f;
- }
- break;
-
- case Discreet3DS::CHUNK_BIT_MAP:
- {
- // Specifies the background image. The string should already be
- // properly 0 terminated but we need to be sure
- unsigned int cnt = 0;
- const char* sz = (const char*)stream->GetPtr();
- while (stream->GetI1())++cnt;
- mBackgroundImage = std::string(sz,cnt);
- }
- break;
-
- case Discreet3DS::CHUNK_BIT_MAP_EXISTS:
- bHasBG = true;
- break;
-
- case Discreet3DS::CHUNK_MASTER_SCALE:
- // Scene master scaling factor
- mMasterScale = stream->GetF4();
- break;
- };
- ASSIMP_3DS_END_CHUNK();
-}
-
-// ------------------------------------------------------------------------------------------------
-void Discreet3DSImporter::ParseChunk(const char* name, unsigned int num)
-{
- ASSIMP_3DS_BEGIN_CHUNK();
-
- // IMPLEMENTATION NOTE;
- // Cameras or lights define their transformation in their parent node and in the
- // corresponding light or camera chunks. However, we read and process the latter
- // to to be able to return valid cameras/lights even if no scenegraph is given.
-
- // get chunk type
- switch (chunk.Flag)
- {
- case Discreet3DS::CHUNK_TRIMESH:
- {
- // this starts a new triangle mesh
- mScene->mMeshes.push_back(D3DS::Mesh());
- D3DS::Mesh& m = mScene->mMeshes.back();
-
- // Setup the name of the mesh
- m.mName = std::string(name, num);
-
- // Read mesh chunks
- ParseMeshChunk();
- }
- break;
-
- case Discreet3DS::CHUNK_LIGHT:
- {
- // This starts a new light
- aiLight* light = new aiLight();
- mScene->mLights.push_back(light);
-
- light->mName.Set(std::string(name, num));
-
- // First read the position of the light
- light->mPosition.x = stream->GetF4();
- light->mPosition.y = stream->GetF4();
- light->mPosition.z = stream->GetF4();
-
- light->mColorDiffuse = aiColor3D(1.f,1.f,1.f);
-
- // Now check for further subchunks
- if (!bIsPrj) /* fixme */
- ParseLightChunk();
-
- // The specular light color is identical the the diffuse light color. The ambient light color
- // is equal to the ambient base color of the whole scene.
- light->mColorSpecular = light->mColorDiffuse;
- light->mColorAmbient = mClrAmbient;
-
- if (light->mType == aiLightSource_UNDEFINED)
- {
- // It must be a point light
- light->mType = aiLightSource_POINT;
- }}
- break;
-
- case Discreet3DS::CHUNK_CAMERA:
- {
- // This starts a new camera
- aiCamera* camera = new aiCamera();
- mScene->mCameras.push_back(camera);
- camera->mName.Set(std::string(name, num));
-
- // First read the position of the camera
- camera->mPosition.x = stream->GetF4();
- camera->mPosition.y = stream->GetF4();
- camera->mPosition.z = stream->GetF4();
-
- // Then the camera target
- camera->mLookAt.x = stream->GetF4() - camera->mPosition.x;
- camera->mLookAt.y = stream->GetF4() - camera->mPosition.y;
- camera->mLookAt.z = stream->GetF4() - camera->mPosition.z;
- float len = camera->mLookAt.Length();
- if (len < 1e-5f) {
-
- // There are some files with lookat == position. Don't know why or whether it's ok or not.
- DefaultLogger::get()->error("3DS: Unable to read proper camera look-at vector");
- camera->mLookAt = aiVector3D(0.f,1.f,0.f);
-
- }
- else camera->mLookAt /= len;
-
- // And finally - the camera rotation angle, in counter clockwise direction
- const float angle = AI_DEG_TO_RAD( stream->GetF4() );
- aiQuaternion quat(camera->mLookAt,angle);
- camera->mUp = quat.GetMatrix() * aiVector3D(0.f,1.f,0.f);
-
- // Read the lense angle
- camera->mHorizontalFOV = AI_DEG_TO_RAD ( stream->GetF4() );
- if (camera->mHorizontalFOV < 0.001f) {
- camera->mHorizontalFOV = AI_DEG_TO_RAD(45.f);
- }
-
- // Now check for further subchunks
- if (!bIsPrj) /* fixme */ {
- ParseCameraChunk();
- }}
- break;
- };
- ASSIMP_3DS_END_CHUNK();
-}
-
-// ------------------------------------------------------------------------------------------------
-void Discreet3DSImporter::ParseLightChunk()
-{
- ASSIMP_3DS_BEGIN_CHUNK();
- aiLight* light = mScene->mLights.back();
-
- // get chunk type
- switch (chunk.Flag)
- {
- case Discreet3DS::CHUNK_DL_SPOTLIGHT:
- // Now we can be sure that the light is a spot light
- light->mType = aiLightSource_SPOT;
-
- // We wouldn't need to normalize here, but we do it
- light->mDirection.x = stream->GetF4() - light->mPosition.x;
- light->mDirection.y = stream->GetF4() - light->mPosition.y;
- light->mDirection.z = stream->GetF4() - light->mPosition.z;
- light->mDirection.Normalize();
-
- // Now the hotspot and falloff angles - in degrees
- light->mAngleInnerCone = AI_DEG_TO_RAD( stream->GetF4() );
-
- // FIX: the falloff angle is just an offset
- light->mAngleOuterCone = light->mAngleInnerCone+AI_DEG_TO_RAD( stream->GetF4() );
- break;
-
- // intensity multiplier
- case Discreet3DS::CHUNK_DL_MULTIPLIER:
- light->mColorDiffuse = light->mColorDiffuse * stream->GetF4();
- break;
-
- // light color
- case Discreet3DS::CHUNK_RGBF:
- case Discreet3DS::CHUNK_LINRGBF:
- light->mColorDiffuse.r *= stream->GetF4();
- light->mColorDiffuse.g *= stream->GetF4();
- light->mColorDiffuse.b *= stream->GetF4();
- break;
-
- // light attenuation
- case Discreet3DS::CHUNK_DL_ATTENUATE:
- light->mAttenuationLinear = stream->GetF4();
- break;
- };
-
- ASSIMP_3DS_END_CHUNK();
-}
-
-// ------------------------------------------------------------------------------------------------
-void Discreet3DSImporter::ParseCameraChunk()
-{
- ASSIMP_3DS_BEGIN_CHUNK();
- aiCamera* camera = mScene->mCameras.back();
-
- // get chunk type
- switch (chunk.Flag)
- {
- // near and far clip plane
- case Discreet3DS::CHUNK_CAM_RANGES:
- camera->mClipPlaneNear = stream->GetF4();
- camera->mClipPlaneFar = stream->GetF4();
- break;
- }
-
- ASSIMP_3DS_END_CHUNK();
-}
-
-// ------------------------------------------------------------------------------------------------
-void Discreet3DSImporter::ParseKeyframeChunk()
-{
- ASSIMP_3DS_BEGIN_CHUNK();
-
- // get chunk type
- switch (chunk.Flag)
- {
- case Discreet3DS::CHUNK_TRACKCAMTGT:
- case Discreet3DS::CHUNK_TRACKSPOTL:
- case Discreet3DS::CHUNK_TRACKCAMERA:
- case Discreet3DS::CHUNK_TRACKINFO:
- case Discreet3DS::CHUNK_TRACKLIGHT:
- case Discreet3DS::CHUNK_TRACKLIGTGT:
-
- // this starts a new mesh hierarchy chunk
- ParseHierarchyChunk(chunk.Flag);
- break;
- };
-
- ASSIMP_3DS_END_CHUNK();
-}
-
-// ------------------------------------------------------------------------------------------------
-// Little helper function for ParseHierarchyChunk
-void Discreet3DSImporter::InverseNodeSearch(D3DS::Node* pcNode,D3DS::Node* pcCurrent)
-{
- if (!pcCurrent) {
- mRootNode->push_back(pcNode);
- return;
- }
-
- if (pcCurrent->mHierarchyPos == pcNode->mHierarchyPos) {
- if (pcCurrent->mParent) {
- pcCurrent->mParent->push_back(pcNode);
- }
- else pcCurrent->push_back(pcNode);
- return;
- }
- return InverseNodeSearch(pcNode,pcCurrent->mParent);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Find a node with a specific name in the import hierarchy
-D3DS::Node* FindNode(D3DS::Node* root, const std::string& name)
-{
- if (root->mName == name)
- return root;
- for (std::vector<D3DS::Node*>::iterator it = root->mChildren.begin();it != root->mChildren.end(); ++it) {
- D3DS::Node* nd;
- if (( nd = FindNode(*it,name)))
- return nd;
- }
- return NULL;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Binary predicate for std::unique()
-template <class T>
-bool KeyUniqueCompare(const T& first, const T& second)
-{
- return first.mTime == second.mTime;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Skip some additional import data.
-void Discreet3DSImporter::SkipTCBInfo()
-{
- unsigned int flags = stream->GetI2();
-
- if (!flags) {
- // Currently we can't do anything with these values. They occur
- // quite rare, so it wouldn't be worth the effort implementing
- // them. 3DS ist not really suitable for complex animations,
- // so full support is not required.
- DefaultLogger::get()->warn("3DS: Skipping TCB animation info");
- }
-
- if (flags & Discreet3DS::KEY_USE_TENS) {
- stream->IncPtr(4);
- }
- if (flags & Discreet3DS::KEY_USE_BIAS) {
- stream->IncPtr(4);
- }
- if (flags & Discreet3DS::KEY_USE_CONT) {
- stream->IncPtr(4);
- }
- if (flags & Discreet3DS::KEY_USE_EASE_FROM) {
- stream->IncPtr(4);
- }
- if (flags & Discreet3DS::KEY_USE_EASE_TO) {
- stream->IncPtr(4);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Read hierarchy and keyframe info
-void Discreet3DSImporter::ParseHierarchyChunk(uint16_t parent)
-{
- ASSIMP_3DS_BEGIN_CHUNK();
-
- // get chunk type
- switch (chunk.Flag)
- {
- case Discreet3DS::CHUNK_TRACKOBJNAME:
-
- // This is the name of the object to which the track applies. The chunk also
- // defines the position of this object in the hierarchy.
- {
-
- // First of all: get the name of the object
- unsigned int cnt = 0;
- const char* sz = (const char*)stream->GetPtr();
-
- while (stream->GetI1())++cnt;
- std::string name = std::string(sz,cnt);
-
- // Now find out whether we have this node already (target animation channels
- // are stored with a separate object ID)
- D3DS::Node* pcNode = FindNode(mRootNode,name);
- if (pcNode)
- {
- // Make this node the current node
- mCurrentNode = pcNode;
- break;
- }
- pcNode = new D3DS::Node();
- pcNode->mName = name;
-
- // There are two unknown values which we can safely ignore
- stream->IncPtr(4);
-
- // Now read the hierarchy position of the object
- uint16_t hierarchy = stream->GetI2() + 1;
- pcNode->mHierarchyPos = hierarchy;
- pcNode->mHierarchyIndex = mLastNodeIndex;
-
- // And find a proper position in the graph for it
- if (mCurrentNode && mCurrentNode->mHierarchyPos == hierarchy) {
-
- // add to the parent of the last touched node
- mCurrentNode->mParent->push_back(pcNode);
- mLastNodeIndex++;
- }
- else if (hierarchy >= mLastNodeIndex) {
-
- // place it at the current position in the hierarchy
- mCurrentNode->push_back(pcNode);
- mLastNodeIndex = hierarchy;
- }
- else {
- // need to go back to the specified position in the hierarchy.
- InverseNodeSearch(pcNode,mCurrentNode);
- mLastNodeIndex++;
- }
- // Make this node the current node
- mCurrentNode = pcNode;
- }
- break;
-
- case Discreet3DS::CHUNK_TRACKDUMMYOBJNAME:
-
- // This is the "real" name of a $$$DUMMY object
- {
- const char* sz = (const char*) stream->GetPtr();
- while (stream->GetI1());
-
- // If object name is DUMMY, take this one instead
- if (mCurrentNode->mName == "$$$DUMMY") {
- //DefaultLogger::get()->warn("3DS: Skipping dummy object name for non-dummy object");
- mCurrentNode->mName = std::string(sz);
- break;
- }
- }
- break;
-
- case Discreet3DS::CHUNK_TRACKPIVOT:
-
- if ( Discreet3DS::CHUNK_TRACKINFO != parent)
- {
- DefaultLogger::get()->warn("3DS: Skipping pivot subchunk for non usual object");
- break;
- }
-
- // Pivot = origin of rotation and scaling
- mCurrentNode->vPivot.x = stream->GetF4();
- mCurrentNode->vPivot.y = stream->GetF4();
- mCurrentNode->vPivot.z = stream->GetF4();
- break;
-
-
- // ////////////////////////////////////////////////////////////////////
- // POSITION KEYFRAME
- case Discreet3DS::CHUNK_TRACKPOS:
- {
- stream->IncPtr(10);
- const unsigned int numFrames = stream->GetI4();
- bool sortKeys = false;
-
- // This could also be meant as the target position for
- // (targeted) lights and cameras
- std::vector<aiVectorKey>* l;
- if ( Discreet3DS::CHUNK_TRACKCAMTGT == parent || Discreet3DS::CHUNK_TRACKLIGTGT == parent) {
- l = & mCurrentNode->aTargetPositionKeys;
- }
- else l = & mCurrentNode->aPositionKeys;
-
- l->reserve(numFrames);
- for (unsigned int i = 0; i < numFrames;++i) {
- const unsigned int fidx = stream->GetI4();
-
- // Setup a new position key
- aiVectorKey v;
- v.mTime = (double)fidx;
-
- SkipTCBInfo();
- v.mValue.x = stream->GetF4();
- v.mValue.y = stream->GetF4();
- v.mValue.z = stream->GetF4();
-
- // check whether we'll need to sort the keys
- if (!l->empty() && v.mTime <= l->back().mTime)
- sortKeys = true;
-
- // Add the new keyframe to the list
- l->push_back(v);
- }
-
- // Sort all keys with ascending time values and remove duplicates?
- if (sortKeys) {
- std::stable_sort(l->begin(),l->end());
- l->erase ( std::unique (l->begin(),l->end(),&KeyUniqueCompare<aiVectorKey>), l->end() );
- }}
-
- break;
-
- // ////////////////////////////////////////////////////////////////////
- // CAMERA ROLL KEYFRAME
- case Discreet3DS::CHUNK_TRACKROLL:
- {
- // roll keys are accepted for cameras only
- if (parent != Discreet3DS::CHUNK_TRACKCAMERA) {
- DefaultLogger::get()->warn("3DS: Ignoring roll track for non-camera object");
- break;
- }
- bool sortKeys = false;
- std::vector<aiFloatKey>* l = &mCurrentNode->aCameraRollKeys;
-
- stream->IncPtr(10);
- const unsigned int numFrames = stream->GetI4();
- l->reserve(numFrames);
- for (unsigned int i = 0; i < numFrames;++i) {
- const unsigned int fidx = stream->GetI4();
-
- // Setup a new position key
- aiFloatKey v;
- v.mTime = (double)fidx;
-
- // This is just a single float
- SkipTCBInfo();
- v.mValue = stream->GetF4();
-
- // Check whether we'll need to sort the keys
- if (!l->empty() && v.mTime <= l->back().mTime)
- sortKeys = true;
-
- // Add the new keyframe to the list
- l->push_back(v);
- }
-
- // Sort all keys with ascending time values and remove duplicates?
- if (sortKeys) {
- std::stable_sort(l->begin(),l->end());
- l->erase ( std::unique (l->begin(),l->end(),&KeyUniqueCompare<aiFloatKey>), l->end() );
- }}
- break;
-
-
- // ////////////////////////////////////////////////////////////////////
- // CAMERA FOV KEYFRAME
- case Discreet3DS::CHUNK_TRACKFOV:
- {
- DefaultLogger::get()->error("3DS: Skipping FOV animation track. "
- "This is not supported");
- }
- break;
-
-
- // ////////////////////////////////////////////////////////////////////
- // ROTATION KEYFRAME
- case Discreet3DS::CHUNK_TRACKROTATE:
- {
- stream->IncPtr(10);
- const unsigned int numFrames = stream->GetI4();
-
- bool sortKeys = false;
- std::vector<aiQuatKey>* l = &mCurrentNode->aRotationKeys;
- l->reserve(numFrames);
-
- for (unsigned int i = 0; i < numFrames;++i) {
- const unsigned int fidx = stream->GetI4();
- SkipTCBInfo();
-
- aiQuatKey v;
- v.mTime = (double)fidx;
-
- // The rotation keyframe is given as an axis-angle pair
- const float rad = stream->GetF4();
- aiVector3D axis;
- axis.x = stream->GetF4();
- axis.y = stream->GetF4();
- axis.z = stream->GetF4();
-
- if (!axis.x && !axis.y && !axis.z)
- axis.y = 1.f;
-
- // Construct a rotation quaternion from the axis-angle pair
- v.mValue = aiQuaternion(axis,rad);
-
- // Check whether we'll need to sort the keys
- if (!l->empty() && v.mTime <= l->back().mTime)
- sortKeys = true;
-
- // add the new keyframe to the list
- l->push_back(v);
- }
- // Sort all keys with ascending time values and remove duplicates?
- if (sortKeys) {
- std::stable_sort(l->begin(),l->end());
- l->erase ( std::unique (l->begin(),l->end(),&KeyUniqueCompare<aiQuatKey>), l->end() );
- }}
- break;
-
- // ////////////////////////////////////////////////////////////////////
- // SCALING KEYFRAME
- case Discreet3DS::CHUNK_TRACKSCALE:
- {
- stream->IncPtr(10);
- const unsigned int numFrames = stream->GetI2();
- stream->IncPtr(2);
-
- bool sortKeys = false;
- std::vector<aiVectorKey>* l = &mCurrentNode->aScalingKeys;
- l->reserve(numFrames);
-
- for (unsigned int i = 0; i < numFrames;++i) {
- const unsigned int fidx = stream->GetI4();
- SkipTCBInfo();
-
- // Setup a new key
- aiVectorKey v;
- v.mTime = (double)fidx;
-
- // ... and read its value
- v.mValue.x = stream->GetF4();
- v.mValue.y = stream->GetF4();
- v.mValue.z = stream->GetF4();
-
- // check whether we'll need to sort the keys
- if (!l->empty() && v.mTime <= l->back().mTime)
- sortKeys = true;
-
- // Remove zero-scalings on singular axes - they've been reported to be there erroneously in some strange files
- if (!v.mValue.x) v.mValue.x = 1.f;
- if (!v.mValue.y) v.mValue.y = 1.f;
- if (!v.mValue.z) v.mValue.z = 1.f;
-
- l->push_back(v);
- }
- // Sort all keys with ascending time values and remove duplicates?
- if (sortKeys) {
- std::stable_sort(l->begin(),l->end());
- l->erase ( std::unique (l->begin(),l->end(),&KeyUniqueCompare<aiVectorKey>), l->end() );
- }}
- break;
- };
-
- ASSIMP_3DS_END_CHUNK();
-}
-
-// ------------------------------------------------------------------------------------------------
-// Read a face chunk - it contains smoothing groups and material assignments
-void Discreet3DSImporter::ParseFaceChunk()
-{
- ASSIMP_3DS_BEGIN_CHUNK();
-
- // Get the mesh we're currently working on
- D3DS::Mesh& mMesh = mScene->mMeshes.back();
-
- // Get chunk type
- switch (chunk.Flag)
- {
- case Discreet3DS::CHUNK_SMOOLIST:
- {
- // This is the list of smoothing groups - a bitfield for every face.
- // Up to 32 smoothing groups assigned to a single face.
- unsigned int num = chunkSize/4, m = 0;
- for (std::vector<D3DS::Face>::iterator i = mMesh.mFaces.begin(); m != num;++i, ++m) {
- // nth bit is set for nth smoothing group
- (*i).iSmoothGroup = stream->GetI4();
- }}
- break;
-
- case Discreet3DS::CHUNK_FACEMAT:
- {
- // at fist an asciiz with the material name
- const char* sz = (const char*)stream->GetPtr();
- while (stream->GetI1());
-
- // find the index of the material
- unsigned int idx = 0xcdcdcdcd, cnt = 0;
- for (std::vector<D3DS::Material>::const_iterator i = mScene->mMaterials.begin();i != mScene->mMaterials.end();++i,++cnt) {
- // use case independent comparisons. hopefully it will work.
- if ((*i).mName.length() && !ASSIMP_stricmp(sz, (*i).mName.c_str())) {
- idx = cnt;
- break;
- }
- }
- if (0xcdcdcdcd == idx) {
- DefaultLogger::get()->error(std::string("3DS: Unknown material: ") + sz);
- }
-
- // Now continue and read all material indices
- cnt = (uint16_t)stream->GetI2();
- for (unsigned int i = 0; i < cnt;++i) {
- unsigned int fidx = (uint16_t)stream->GetI2();
-
- // check range
- if (fidx >= mMesh.mFaceMaterials.size()) {
- DefaultLogger::get()->error("3DS: Invalid face index in face material list");
- }
- else mMesh.mFaceMaterials[fidx] = idx;
- }}
- break;
- };
- ASSIMP_3DS_END_CHUNK();
-}
-
-// ------------------------------------------------------------------------------------------------
-// Read a mesh chunk. Here's the actual mesh data
-void Discreet3DSImporter::ParseMeshChunk()
-{
- ASSIMP_3DS_BEGIN_CHUNK();
-
- // Get the mesh we're currently working on
- D3DS::Mesh& mMesh = mScene->mMeshes.back();
-
- // get chunk type
- switch (chunk.Flag)
- {
- case Discreet3DS::CHUNK_VERTLIST:
- {
- // This is the list of all vertices in the current mesh
- int num = (int)(uint16_t)stream->GetI2();
- mMesh.mPositions.reserve(num);
- while (num-- > 0) {
- aiVector3D v;
- v.x = stream->GetF4();
- v.y = stream->GetF4();
- v.z = stream->GetF4();
- mMesh.mPositions.push_back(v);
- }}
- break;
- case Discreet3DS::CHUNK_TRMATRIX:
- {
- // This is the RLEATIVE transformation matrix of the current mesh. Vertices are
- // pretransformed by this matrix wonder.
- mMesh.mMat.a1 = stream->GetF4();
- mMesh.mMat.b1 = stream->GetF4();
- mMesh.mMat.c1 = stream->GetF4();
- mMesh.mMat.a2 = stream->GetF4();
- mMesh.mMat.b2 = stream->GetF4();
- mMesh.mMat.c2 = stream->GetF4();
- mMesh.mMat.a3 = stream->GetF4();
- mMesh.mMat.b3 = stream->GetF4();
- mMesh.mMat.c3 = stream->GetF4();
- mMesh.mMat.a4 = stream->GetF4();
- mMesh.mMat.b4 = stream->GetF4();
- mMesh.mMat.c4 = stream->GetF4();
- }
- break;
-
- case Discreet3DS::CHUNK_MAPLIST:
- {
- // This is the list of all UV coords in the current mesh
- int num = (int)(uint16_t)stream->GetI2();
- mMesh.mTexCoords.reserve(num);
- while (num-- > 0) {
- aiVector3D v;
- v.x = stream->GetF4();
- v.y = stream->GetF4();
- mMesh.mTexCoords.push_back(v);
- }}
- break;
-
- case Discreet3DS::CHUNK_FACELIST:
- {
- // This is the list of all faces in the current mesh
- int num = (int)(uint16_t)stream->GetI2();
- mMesh.mFaces.reserve(num);
- while (num-- > 0) {
- // 3DS faces are ALWAYS triangles
- mMesh.mFaces.push_back(D3DS::Face());
- D3DS::Face& sFace = mMesh.mFaces.back();
-
- sFace.mIndices[0] = (uint16_t)stream->GetI2();
- sFace.mIndices[1] = (uint16_t)stream->GetI2();
- sFace.mIndices[2] = (uint16_t)stream->GetI2();
-
- stream->IncPtr(2); // skip edge visibility flag
- }
-
- // Resize the material array (0xcdcdcdcd marks the default material; so if a face is
- // not referenced by a material, $$DEFAULT will be assigned to it)
- mMesh.mFaceMaterials.resize(mMesh.mFaces.size(),0xcdcdcdcd);
-
- // Larger 3DS files could have multiple FACE chunks here
- chunkSize = stream->GetRemainingSizeToLimit();
- if ( chunkSize > (int) sizeof(Discreet3DS::Chunk ) )
- ParseFaceChunk();
- }
- break;
- };
- ASSIMP_3DS_END_CHUNK();
-}
-
-// ------------------------------------------------------------------------------------------------
-// Read a 3DS material chunk
-void Discreet3DSImporter::ParseMaterialChunk()
-{
- ASSIMP_3DS_BEGIN_CHUNK();
- switch (chunk.Flag)
- {
- case Discreet3DS::CHUNK_MAT_MATNAME:
-
- {
- // The material name string is already zero-terminated, but we need to be sure ...
- const char* sz = (const char*)stream->GetPtr();
- unsigned int cnt = 0;
- while (stream->GetI1())
- ++cnt;
-
- if (!cnt) {
- // This may not be, we use the default name instead
- DefaultLogger::get()->error("3DS: Empty material name");
- }
- else mScene->mMaterials.back().mName = std::string(sz,cnt);
- }
- break;
-
- case Discreet3DS::CHUNK_MAT_DIFFUSE:
- {
- // This is the diffuse material color
- aiColor3D* pc = &mScene->mMaterials.back().mDiffuse;
- ParseColorChunk(pc);
- if (is_qnan(pc->r)) {
- // color chunk is invalid. Simply ignore it
- DefaultLogger::get()->error("3DS: Unable to read DIFFUSE chunk");
- pc->r = pc->g = pc->b = 1.0f;
- }}
- break;
-
- case Discreet3DS::CHUNK_MAT_SPECULAR:
- {
- // This is the specular material color
- aiColor3D* pc = &mScene->mMaterials.back().mSpecular;
- ParseColorChunk(pc);
- if (is_qnan(pc->r)) {
- // color chunk is invalid. Simply ignore it
- DefaultLogger::get()->error("3DS: Unable to read SPECULAR chunk");
- pc->r = pc->g = pc->b = 1.0f;
- }}
- break;
-
- case Discreet3DS::CHUNK_MAT_AMBIENT:
- {
- // This is the ambient material color
- aiColor3D* pc = &mScene->mMaterials.back().mAmbient;
- ParseColorChunk(pc);
- if (is_qnan(pc->r)) {
- // color chunk is invalid. Simply ignore it
- DefaultLogger::get()->error("3DS: Unable to read AMBIENT chunk");
- pc->r = pc->g = pc->b = 0.0f;
- }}
- break;
-
- case Discreet3DS::CHUNK_MAT_SELF_ILLUM:
- {
- // This is the emissive material color
- aiColor3D* pc = &mScene->mMaterials.back().mEmissive;
- ParseColorChunk(pc);
- if (is_qnan(pc->r)) {
- // color chunk is invalid. Simply ignore it
- DefaultLogger::get()->error("3DS: Unable to read EMISSIVE chunk");
- pc->r = pc->g = pc->b = 0.0f;
- }}
- break;
-
- case Discreet3DS::CHUNK_MAT_TRANSPARENCY:
- {
- // This is the material's transparency
- float* pcf = &mScene->mMaterials.back().mTransparency;
- *pcf = ParsePercentageChunk();
-
- // NOTE: transparency, not opacity
- if (is_qnan(*pcf))
- *pcf = 1.0f;
- else *pcf = 1.0f - *pcf * (float)0xFFFF / 100.0f;
- }
- break;
-
- case Discreet3DS::CHUNK_MAT_SHADING:
- // This is the material shading mode
- mScene->mMaterials.back().mShading = (D3DS::Discreet3DS::shadetype3ds)stream->GetI2();
- break;
-
- case Discreet3DS::CHUNK_MAT_TWO_SIDE:
- // This is the two-sided flag
- mScene->mMaterials.back().mTwoSided = true;
- break;
-
- case Discreet3DS::CHUNK_MAT_SHININESS:
- { // This is the shininess of the material
- float* pcf = &mScene->mMaterials.back().mSpecularExponent;
- *pcf = ParsePercentageChunk();
- if (is_qnan(*pcf))
- *pcf = 0.0f;
- else *pcf *= (float)0xFFFF;
- }
- break;
-
- case Discreet3DS::CHUNK_MAT_SHININESS_PERCENT:
- { // This is the shininess strength of the material
- float* pcf = &mScene->mMaterials.back().mShininessStrength;
- *pcf = ParsePercentageChunk();
- if (is_qnan(*pcf))
- *pcf = 0.0f;
- else *pcf *= (float)0xffff / 100.0f;
- }
- break;
-
- case Discreet3DS::CHUNK_MAT_SELF_ILPCT:
- { // This is the self illumination strength of the material
- float f = ParsePercentageChunk();
- if (is_qnan(f))
- f = 0.0f;
- else f *= (float)0xFFFF / 100.0f;
- mScene->mMaterials.back().mEmissive = aiColor3D(f,f,f);
- }
- break;
-
- // Parse texture chunks
- case Discreet3DS::CHUNK_MAT_TEXTURE:
- // Diffuse texture
- ParseTextureChunk(&mScene->mMaterials.back().sTexDiffuse);
- break;
- case Discreet3DS::CHUNK_MAT_BUMPMAP:
- // Height map
- ParseTextureChunk(&mScene->mMaterials.back().sTexBump);
- break;
- case Discreet3DS::CHUNK_MAT_OPACMAP:
- // Opacity texture
- ParseTextureChunk(&mScene->mMaterials.back().sTexOpacity);
- break;
- case Discreet3DS::CHUNK_MAT_MAT_SHINMAP:
- // Shininess map
- ParseTextureChunk(&mScene->mMaterials.back().sTexShininess);
- break;
- case Discreet3DS::CHUNK_MAT_SPECMAP:
- // Specular map
- ParseTextureChunk(&mScene->mMaterials.back().sTexSpecular);
- break;
- case Discreet3DS::CHUNK_MAT_SELFIMAP:
- // Self-illumination (emissive) map
- ParseTextureChunk(&mScene->mMaterials.back().sTexEmissive);
- break;
- case Discreet3DS::CHUNK_MAT_REFLMAP:
- // Reflection map
- ParseTextureChunk(&mScene->mMaterials.back().sTexReflective);
- break;
- };
- ASSIMP_3DS_END_CHUNK();
-}
-
-// ------------------------------------------------------------------------------------------------
-void Discreet3DSImporter::ParseTextureChunk(D3DS::Texture* pcOut)
-{
- ASSIMP_3DS_BEGIN_CHUNK();
-
- // get chunk type
- switch (chunk.Flag)
- {
- case Discreet3DS::CHUNK_MAPFILE:
- {
- // The material name string is already zero-terminated, but we need to be sure ...
- const char* sz = (const char*)stream->GetPtr();
- unsigned int cnt = 0;
- while (stream->GetI1())
- ++cnt;
- pcOut->mMapName = std::string(sz,cnt);
- }
- break;
-
-
- case Discreet3DS::CHUNK_PERCENTF:
- // Manually parse the blend factor
- pcOut->mTextureBlend = stream->GetF4();
- break;
-
- case Discreet3DS::CHUNK_PERCENTW:
- // Manually parse the blend factor
- pcOut->mTextureBlend = (float)((uint16_t)stream->GetI2()) / 100.0f;
- break;
-
- case Discreet3DS::CHUNK_MAT_MAP_USCALE:
- // Texture coordinate scaling in the U direction
- pcOut->mScaleU = stream->GetF4();
- if (0.0f == pcOut->mScaleU)
- {
- DefaultLogger::get()->warn("Texture coordinate scaling in the x direction is zero. Assuming 1.");
- pcOut->mScaleU = 1.0f;
- }
- break;
- case Discreet3DS::CHUNK_MAT_MAP_VSCALE:
- // Texture coordinate scaling in the V direction
- pcOut->mScaleV = stream->GetF4();
- if (0.0f == pcOut->mScaleV)
- {
- DefaultLogger::get()->warn("Texture coordinate scaling in the y direction is zero. Assuming 1.");
- pcOut->mScaleV = 1.0f;
- }
- break;
-
- case Discreet3DS::CHUNK_MAT_MAP_UOFFSET:
- // Texture coordinate offset in the U direction
- pcOut->mOffsetU = -stream->GetF4();
- break;
-
- case Discreet3DS::CHUNK_MAT_MAP_VOFFSET:
- // Texture coordinate offset in the V direction
- pcOut->mOffsetV = stream->GetF4();
- break;
-
- case Discreet3DS::CHUNK_MAT_MAP_ANG:
- // Texture coordinate rotation, CCW in DEGREES
- pcOut->mRotation = -AI_DEG_TO_RAD( stream->GetF4() );
- break;
-
- case Discreet3DS::CHUNK_MAT_MAP_TILING:
- {
- const uint16_t iFlags = stream->GetI2();
-
- // Get the mapping mode (for both axes)
- if (iFlags & 0x2u)
- pcOut->mMapMode = aiTextureMapMode_Mirror;
-
- else if (iFlags & 0x10u)
- pcOut->mMapMode = aiTextureMapMode_Decal;
-
- // wrapping in all remaining cases
- else pcOut->mMapMode = aiTextureMapMode_Wrap;
- }
- break;
- };
-
- ASSIMP_3DS_END_CHUNK();
-}
-
-// ------------------------------------------------------------------------------------------------
-// Read a percentage chunk
-float Discreet3DSImporter::ParsePercentageChunk()
-{
- Discreet3DS::Chunk chunk;
- ReadChunk(&chunk);
-
- if (Discreet3DS::CHUNK_PERCENTF == chunk.Flag)
- return stream->GetF4();
- else if (Discreet3DS::CHUNK_PERCENTW == chunk.Flag)
- return (float)((uint16_t)stream->GetI2()) / (float)0xFFFF;
- return get_qnan();
-}
-
-// ------------------------------------------------------------------------------------------------
-// Read a color chunk. If a percentage chunk is found instead it is read as a grayscale color
-void Discreet3DSImporter::ParseColorChunk(aiColor3D* out,
- bool acceptPercent)
-{
- ai_assert(out != NULL);
-
- // error return value
- const float qnan = get_qnan();
- static const aiColor3D clrError = aiColor3D(qnan,qnan,qnan);
-
- Discreet3DS::Chunk chunk;
- ReadChunk(&chunk);
- const unsigned int diff = chunk.Size - sizeof(Discreet3DS::Chunk);
-
- bool bGamma = false;
-
- // Get the type of the chunk
- switch(chunk.Flag)
- {
- case Discreet3DS::CHUNK_LINRGBF:
- bGamma = true;
-
- case Discreet3DS::CHUNK_RGBF:
- if (sizeof(float) * 3 > diff) {
- *out = clrError;
- return;
- }
- out->r = stream->GetF4();
- out->g = stream->GetF4();
- out->b = stream->GetF4();
- break;
-
- case Discreet3DS::CHUNK_LINRGBB:
- bGamma = true;
- case Discreet3DS::CHUNK_RGBB:
- if (sizeof(char) * 3 > diff) {
- *out = clrError;
- return;
- }
- out->r = (float)(uint8_t)stream->GetI1() / 255.0f;
- out->g = (float)(uint8_t)stream->GetI1() / 255.0f;
- out->b = (float)(uint8_t)stream->GetI1() / 255.0f;
- break;
-
- // Percentage chunks are accepted, too.
- case Discreet3DS::CHUNK_PERCENTF:
- if (acceptPercent && 4 <= diff) {
- out->g = out->b = out->r = stream->GetF4();
- break;
- }
- *out = clrError;
- return;
-
- case Discreet3DS::CHUNK_PERCENTW:
- if (acceptPercent && 1 <= diff) {
- out->g = out->b = out->r = (float)(uint8_t)stream->GetI1() / 255.0f;
- break;
- }
- *out = clrError;
- return;
-
- default:
- stream->IncPtr(diff);
- // Skip unknown chunks, hope this won't cause any problems.
- return ParseColorChunk(out,acceptPercent);
- };
-}
-
-#endif // !! ASSIMP_BUILD_NO_3DS_IMPORTER
diff --git a/3rdparty/assimp/code/3DSLoader.h b/3rdparty/assimp/code/3DSLoader.h
deleted file mode 100644
index 133a7c8e..00000000
--- a/3rdparty/assimp/code/3DSLoader.h
+++ /dev/null
@@ -1,280 +0,0 @@
-
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file 3DSLoader.h
- * @brief 3DS File format loader
- */
-#ifndef AI_3DSIMPORTER_H_INC
-#define AI_3DSIMPORTER_H_INC
-
-#include "BaseImporter.h"
-#include "../include/aiTypes.h"
-
-struct aiNode;
-#include "3DSHelper.h"
-
-namespace Assimp {
-class MaterialHelper;
-
-using namespace D3DS;
-
-// ---------------------------------------------------------------------------------
-/** Importer class for 3D Studio r3 and r4 3DS files
- */
-class Discreet3DSImporter : public BaseImporter
-{
- friend class Importer;
-
-protected:
- /** Constructor to be privately used by Importer */
- Discreet3DSImporter();
-
- /** Destructor, private as well */
- ~Discreet3DSImporter();
-
-public:
-
- // -------------------------------------------------------------------
- /** Returns whether the class can handle the format of the given file.
- * See BaseImporter::CanRead() for details.
- */
- bool CanRead( const std::string& pFile, IOSystem* pIOHandler,
- bool checkSig) const;
-
- // -------------------------------------------------------------------
- /** Called prior to ReadFile().
- * The function is a request to the importer to update its configuration
- * basing on the Importer's configuration property list.
- */
- void SetupProperties(const Importer* pImp);
-
-protected:
-
- // -------------------------------------------------------------------
- /** Called by Importer::GetExtensionList() for each loaded importer.
- * See BaseImporter::GetExtensionList() for details
- */
- void GetExtensionList(std::set<std::string>& extensions);
-
- // -------------------------------------------------------------------
- /** Imports the given file into the given scene structure.
- * See BaseImporter::InternReadFile() for details
- */
- void InternReadFile( const std::string& pFile, aiScene* pScene,
- IOSystem* pIOHandler);
-
- // -------------------------------------------------------------------
- /** Converts a temporary material to the outer representation
- */
- void ConvertMaterial(D3DS::Material& p_cMat,
- MaterialHelper& p_pcOut);
-
- // -------------------------------------------------------------------
- /** Read a chunk
- *
- * @param pcOut Receives the current chunk
- */
- void ReadChunk(Discreet3DS::Chunk* pcOut);
-
- // -------------------------------------------------------------------
- /** Parse a percentage chunk. mCurrent will point to the next
- * chunk behind afterwards. If no percentage chunk is found
- * QNAN is returned.
- */
- float ParsePercentageChunk();
-
- // -------------------------------------------------------------------
- /** Parse a color chunk. mCurrent will point to the next
- * chunk behind afterwards. If no color chunk is found
- * QNAN is returned in all members.
- */
- void ParseColorChunk(aiColor3D* p_pcOut,
- bool p_bAcceptPercent = true);
-
-
- // -------------------------------------------------------------------
- /** Skip a chunk in the file
- */
- void SkipChunk();
-
- // -------------------------------------------------------------------
- /** Generate the nodegraph
- */
- void GenerateNodeGraph(aiScene* pcOut);
-
- // -------------------------------------------------------------------
- /** Parse a main top-level chunk in the file
- */
- void ParseMainChunk();
-
- // -------------------------------------------------------------------
- /** Parse a top-level chunk in the file
- */
- void ParseChunk(const char* name, unsigned int num);
-
- // -------------------------------------------------------------------
- /** Parse a top-level editor chunk in the file
- */
- void ParseEditorChunk();
-
- // -------------------------------------------------------------------
- /** Parse a top-level object chunk in the file
- */
- void ParseObjectChunk();
-
- // -------------------------------------------------------------------
- /** Parse a material chunk in the file
- */
- void ParseMaterialChunk();
-
- // -------------------------------------------------------------------
- /** Parse a mesh chunk in the file
- */
- void ParseMeshChunk();
-
- // -------------------------------------------------------------------
- /** Parse a light chunk in the file
- */
- void ParseLightChunk();
-
- // -------------------------------------------------------------------
- /** Parse a camera chunk in the file
- */
- void ParseCameraChunk();
-
- // -------------------------------------------------------------------
- /** Parse a face list chunk in the file
- */
- void ParseFaceChunk();
-
- // -------------------------------------------------------------------
- /** Parse a keyframe chunk in the file
- */
- void ParseKeyframeChunk();
-
- // -------------------------------------------------------------------
- /** Parse a hierarchy chunk in the file
- */
- void ParseHierarchyChunk(uint16_t parent);
-
- // -------------------------------------------------------------------
- /** Parse a texture chunk in the file
- */
- void ParseTextureChunk(D3DS::Texture* pcOut);
-
- // -------------------------------------------------------------------
- /** Convert the meshes in the file
- */
- void ConvertMeshes(aiScene* pcOut);
-
- // -------------------------------------------------------------------
- /** Replace the default material in the scene
- */
- void ReplaceDefaultMaterial();
-
- // -------------------------------------------------------------------
- /** Convert the whole scene
- */
- void ConvertScene(aiScene* pcOut);
-
- // -------------------------------------------------------------------
- /** generate unique vertices for a mesh
- */
- void MakeUnique(D3DS::Mesh& sMesh);
-
- // -------------------------------------------------------------------
- /** Add a node to the node graph
- */
- void AddNodeToGraph(aiScene* pcSOut,aiNode* pcOut,D3DS::Node* pcIn,
- aiMatrix4x4& absTrafo);
-
- // -------------------------------------------------------------------
- /** Search for a node in the graph.
- * Called recursively
- */
- void InverseNodeSearch(D3DS::Node* pcNode,D3DS::Node* pcCurrent);
-
- // -------------------------------------------------------------------
- /** Apply the master scaling factor to the mesh
- */
- void ApplyMasterScale(aiScene* pScene);
-
- // -------------------------------------------------------------------
- /** Clamp all indices in the file to a valid range
- */
- void CheckIndices(D3DS::Mesh& sMesh);
-
- // -------------------------------------------------------------------
- /** Skip the TCB info in a track key
- */
- void SkipTCBInfo();
-
-protected:
-
- /** Stream to read from */
- StreamReaderLE* stream;
-
- /** Last touched node index */
- short mLastNodeIndex;
-
- /** Current node, root node */
- D3DS::Node* mCurrentNode, *mRootNode;
-
- /** Scene under construction */
- D3DS::Scene* mScene;
-
- /** Ambient base color of the scene */
- aiColor3D mClrAmbient;
-
- /** Master scaling factor of the scene */
- float mMasterScale;
-
- /** Path to the background image of the scene */
- std::string mBackgroundImage;
- bool bHasBG;
-
- /** true if PRJ file */
- bool bIsPrj;
-};
-
-} // end of namespace Assimp
-
-#endif // AI_3DSIMPORTER_H_INC
diff --git a/3rdparty/assimp/code/ACLoader.cpp b/3rdparty/assimp/code/ACLoader.cpp
deleted file mode 100644
index c0fd3178..00000000
--- a/3rdparty/assimp/code/ACLoader.cpp
+++ /dev/null
@@ -1,856 +0,0 @@
-
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file Implementation of the AC3D importer class */
-
-#include "AssimpPCH.h"
-
-#ifndef ASSIMP_BUILD_NO_AC_IMPORTER
-
-// internal headers
-#include "ACLoader.h"
-#include "ParsingUtils.h"
-#include "fast_atof.h"
-#include "Subdivision.h"
-
-using namespace Assimp;
-
-
-// ------------------------------------------------------------------------------------------------
-// skip to the next token
-#define AI_AC_SKIP_TO_NEXT_TOKEN() \
- if (!SkipSpaces(&buffer)) \
- { \
- DefaultLogger::get()->error("AC3D: Unexpected EOF/EOL"); \
- continue; \
- }
-
-// ------------------------------------------------------------------------------------------------
-// read a string (may be enclosed in double quotation marks). buffer must point to "
-#define AI_AC_GET_STRING(out) \
- ++buffer; \
- const char* sz = buffer; \
- while ('\"' != *buffer) \
- { \
- if (IsLineEnd( *buffer )) \
- { \
- DefaultLogger::get()->error("AC3D: Unexpected EOF/EOL in string"); \
- out = "ERROR"; \
- break; \
- } \
- ++buffer; \
- } \
- if (IsLineEnd( *buffer ))continue; \
- out = std::string(sz,(unsigned int)(buffer-sz)); \
- ++buffer;
-
-
-// ------------------------------------------------------------------------------------------------
-// read 1 to n floats prefixed with an optional predefined identifier
-#define AI_AC_CHECKED_LOAD_FLOAT_ARRAY(name,name_length,num,out) \
- AI_AC_SKIP_TO_NEXT_TOKEN(); \
- if (name_length) \
- { \
- if (strncmp(buffer,name,name_length) || !IsSpace(buffer[name_length])) \
- { \
- DefaultLogger::get()->error("AC3D: Unexpexted token. " name " was expected."); \
- continue; \
- } \
- buffer += name_length+1; \
- } \
- for (unsigned int i = 0; i < num;++i) \
- { \
- AI_AC_SKIP_TO_NEXT_TOKEN(); \
- buffer = fast_atof_move(buffer,((float*)out)[i]); \
- }
-
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-AC3DImporter::AC3DImporter()
-{
- // nothing to be done here
-}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-AC3DImporter::~AC3DImporter()
-{
- // nothing to be done here
-}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the class can handle the format of the given file.
-bool AC3DImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const
-{
- std::string extension = GetExtension(pFile);
-
- // fixme: are acc and ac3d *really* used? Some sources say they are
- if (extension == "ac" || extension == "ac3d" || extension == "acc") {
- return true;
- }
- if (!extension.length() || checkSig) {
- uint32_t token = AI_MAKE_MAGIC("AC3D");
- return CheckMagicToken(pIOHandler,pFile,&token,1,0);
- }
- return false;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Get list of file extensions handled by this loader
-void AC3DImporter::GetExtensionList(std::set<std::string>& extensions)
-{
- extensions.insert("ac");
- extensions.insert("acc");
- extensions.insert("ac3d");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Get a pointer to the next line from the file
-bool AC3DImporter::GetNextLine( )
-{
- SkipLine(&buffer);
- return SkipSpaces(&buffer);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Parse an object section in an AC file
-void AC3DImporter::LoadObjectSection(std::vector<Object>& objects)
-{
- if (!TokenMatch(buffer,"OBJECT",6))
- return;
-
- SkipSpaces(&buffer);
-
- ++mNumMeshes;
-
- objects.push_back(Object());
- Object& obj = objects.back();
-
- aiLight* light = NULL;
- if (!ASSIMP_strincmp(buffer,"light",5))
- {
- // This is a light source. Add it to the list
- mLights->push_back(light = new aiLight());
-
- // Return a point light with no attenuation
- light->mType = aiLightSource_POINT;
- light->mColorDiffuse = light->mColorSpecular = aiColor3D(1.f,1.f,1.f);
- light->mAttenuationConstant = 1.f;
-
- // Generate a default name for both the light source and the node
- // FIXME - what's the right way to print a size_t? Is 'zu' universally available? stick with the safe version.
- light->mName.length = ::sprintf(light->mName.data,"ACLight_%i",static_cast<unsigned int>(mLights->size())-1);
- obj.name = std::string( light->mName.data );
-
- DefaultLogger::get()->debug("AC3D: Light source encountered");
- obj.type = Object::Light;
- }
- else if (!ASSIMP_strincmp(buffer,"group",5))
- {
- obj.type = Object::Group;
- }
- else if (!ASSIMP_strincmp(buffer,"world",5))
- {
- obj.type = Object::World;
- }
- else obj.type = Object::Poly;
- while (GetNextLine())
- {
- if (TokenMatch(buffer,"kids",4))
- {
- SkipSpaces(&buffer);
- unsigned int num = strtol10(buffer,&buffer);
- GetNextLine();
- if (num)
- {
- // load the children of this object recursively
- obj.children.reserve(num);
- for (unsigned int i = 0; i < num; ++i)
- LoadObjectSection(obj.children);
- }
- return;
- }
- else if (TokenMatch(buffer,"name",4))
- {
- SkipSpaces(&buffer);
- AI_AC_GET_STRING(obj.name);
-
- // If this is a light source, we'll also need to store
- // the name of the node in it.
- if (light)
- {
- light->mName.Set(obj.name);
- }
- }
- else if (TokenMatch(buffer,"texture",7))
- {
- SkipSpaces(&buffer);
- AI_AC_GET_STRING(obj.texture);
- }
- else if (TokenMatch(buffer,"texrep",6))
- {
- SkipSpaces(&buffer);
- AI_AC_CHECKED_LOAD_FLOAT_ARRAY("",0,2,&obj.texRepeat);
- if (!obj.texRepeat.x || !obj.texRepeat.y)
- obj.texRepeat = aiVector2D (1.f,1.f);
- }
- else if (TokenMatch(buffer,"texoff",6))
- {
- SkipSpaces(&buffer);
- AI_AC_CHECKED_LOAD_FLOAT_ARRAY("",0,2,&obj.texOffset);
- }
- else if (TokenMatch(buffer,"rot",3))
- {
- SkipSpaces(&buffer);
- AI_AC_CHECKED_LOAD_FLOAT_ARRAY("",0,9,&obj.rotation);
- }
- else if (TokenMatch(buffer,"loc",3))
- {
- SkipSpaces(&buffer);
- AI_AC_CHECKED_LOAD_FLOAT_ARRAY("",0,3,&obj.translation);
- }
- else if (TokenMatch(buffer,"subdiv",6))
- {
- SkipSpaces(&buffer);
- obj.subDiv = strtol10(buffer,&buffer);
- }
- else if (TokenMatch(buffer,"crease",6))
- {
- SkipSpaces(&buffer);
- obj.crease = fast_atof(buffer);
- }
- else if (TokenMatch(buffer,"numvert",7))
- {
- SkipSpaces(&buffer);
-
- unsigned int t = strtol10(buffer,&buffer);
- obj.vertices.reserve(t);
- for (unsigned int i = 0; i < t;++i)
- {
- if (!GetNextLine())
- {
- DefaultLogger::get()->error("AC3D: Unexpected EOF: not all vertices have been parsed yet");
- break;
- }
- else if (!IsNumeric(*buffer))
- {
- DefaultLogger::get()->error("AC3D: Unexpected token: not all vertices have been parsed yet");
- --buffer; // make sure the line is processed a second time
- break;
- }
- obj.vertices.push_back(aiVector3D());
- aiVector3D& v = obj.vertices.back();
- AI_AC_CHECKED_LOAD_FLOAT_ARRAY("",0,3,&v.x);
- }
- }
- else if (TokenMatch(buffer,"numsurf",7))
- {
- SkipSpaces(&buffer);
-
- bool Q3DWorkAround = false;
-
- const unsigned int t = strtol10(buffer,&buffer);
- obj.surfaces.reserve(t);
- for (unsigned int i = 0; i < t;++i)
- {
- GetNextLine();
- if (!TokenMatch(buffer,"SURF",4))
- {
- // FIX: this can occur for some files - Quick 3D for
- // example writes no surf chunks
- if (!Q3DWorkAround)
- {
- DefaultLogger::get()->warn("AC3D: SURF token was expected");
- DefaultLogger::get()->debug("Continuing with Quick3D Workaround enabled");
- }
- --buffer; // make sure the line is processed a second time
- // break; --- see fix notes above
-
- Q3DWorkAround = true;
- }
- SkipSpaces(&buffer);
- obj.surfaces.push_back(Surface());
- Surface& surf = obj.surfaces.back();
- surf.flags = strtol_cppstyle(buffer);
-
- while (1)
- {
- if (!GetNextLine())
- {
- DefaultLogger::get()->error("AC3D: Unexpected EOF: surface is incomplete");
- break;
- }
- if (TokenMatch(buffer,"mat",3))
- {
- SkipSpaces(&buffer);
- surf.mat = strtol10(buffer);
- }
- else if (TokenMatch(buffer,"refs",4))
- {
- // --- see fix notes above
- if (Q3DWorkAround)
- {
- if (!surf.entries.empty())
- {
- buffer -= 6;
- break;
- }
- }
-
- SkipSpaces(&buffer);
- const unsigned int m = strtol10(buffer);
- surf.entries.reserve(m);
-
- obj.numRefs += m;
-
- for (unsigned int k = 0; k < m; ++k)
- {
- if (!GetNextLine())
- {
- DefaultLogger::get()->error("AC3D: Unexpected EOF: surface references are incomplete");
- break;
- }
- surf.entries.push_back(Surface::SurfaceEntry());
- Surface::SurfaceEntry& entry = surf.entries.back();
-
- entry.first = strtol10(buffer,&buffer);
- SkipSpaces(&buffer);
- AI_AC_CHECKED_LOAD_FLOAT_ARRAY("",0,2,&entry.second);
- }
- }
- else
- {
-
- --buffer; // make sure the line is processed a second time
- break;
- }
- }
- }
- }
- }
- DefaultLogger::get()->error("AC3D: Unexpected EOF: \'kids\' line was expected");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Convert a material from AC3DImporter::Material to aiMaterial
-void AC3DImporter::ConvertMaterial(const Object& object,
- const Material& matSrc,
- MaterialHelper& matDest)
-{
- aiString s;
-
- if (matSrc.name.length())
- {
- s.Set(matSrc.name);
- matDest.AddProperty(&s,AI_MATKEY_NAME);
- }
- if (object.texture.length())
- {
- s.Set(object.texture);
- matDest.AddProperty(&s,AI_MATKEY_TEXTURE_DIFFUSE(0));
-
- // UV transformation
- if (1.f != object.texRepeat.x || 1.f != object.texRepeat.y ||
- object.texOffset.x || object.texOffset.y)
- {
- aiUVTransform transform;
- transform.mScaling = object.texRepeat;
- transform.mTranslation = object.texOffset;
- matDest.AddProperty(&transform,1,AI_MATKEY_UVTRANSFORM_DIFFUSE(0));
- }
- }
-
- matDest.AddProperty<aiColor3D>(&matSrc.rgb,1, AI_MATKEY_COLOR_DIFFUSE);
- matDest.AddProperty<aiColor3D>(&matSrc.amb,1, AI_MATKEY_COLOR_AMBIENT);
- matDest.AddProperty<aiColor3D>(&matSrc.emis,1,AI_MATKEY_COLOR_EMISSIVE);
- matDest.AddProperty<aiColor3D>(&matSrc.spec,1,AI_MATKEY_COLOR_SPECULAR);
-
- int n;
- if (matSrc.shin)
- {
- n = aiShadingMode_Phong;
- matDest.AddProperty<float>(&matSrc.shin,1,AI_MATKEY_SHININESS);
- }
- else n = aiShadingMode_Gouraud;
- matDest.AddProperty<int>(&n,1,AI_MATKEY_SHADING_MODEL);
-
- float f = 1.f - matSrc.trans;
- matDest.AddProperty<float>(&f,1,AI_MATKEY_OPACITY);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Converts the loaded data to the internal verbose representation
-aiNode* AC3DImporter::ConvertObjectSection(Object& object,
- std::vector<aiMesh*>& meshes,
- std::vector<MaterialHelper*>& outMaterials,
- const std::vector<Material>& materials,
- aiNode* parent)
-{
- aiNode* node = new aiNode();
- node->mParent = parent;
- if (object.vertices.size())
- {
- if (!object.surfaces.size() || !object.numRefs)
- {
- /* " An object with 7 vertices (no surfaces, no materials defined).
- This is a good way of getting point data into AC3D.
- The Vertex->create convex-surface/object can be used on these
- vertices to 'wrap' a 3d shape around them "
- (http://www.opencity.info/html/ac3dfileformat.html)
-
- therefore: if no surfaces are defined return point data only
- */
-
- DefaultLogger::get()->info("AC3D: No surfaces defined in object definition, "
- "a point list is returned");
-
- meshes.push_back(new aiMesh());
- aiMesh* mesh = meshes.back();
-
- mesh->mNumFaces = mesh->mNumVertices = (unsigned int)object.vertices.size();
- aiFace* faces = mesh->mFaces = new aiFace[mesh->mNumFaces];
- aiVector3D* verts = mesh->mVertices = new aiVector3D[mesh->mNumVertices];
-
- for (unsigned int i = 0; i < mesh->mNumVertices;++i,++faces,++verts)
- {
- *verts = object.vertices[i];
- faces->mNumIndices = 1;
- faces->mIndices = new unsigned int[1];
- faces->mIndices[0] = i;
- }
-
- // use the primary material in this case. this should be the
- // default material if all objects of the file contain points
- // and no faces.
- mesh->mMaterialIndex = 0;
- outMaterials.push_back(new MaterialHelper());
- ConvertMaterial(object, materials[0], *outMaterials.back());
- }
- else
- {
- // need to generate one or more meshes for this object.
- // find out how many different materials we have
- typedef std::pair< unsigned int, unsigned int > IntPair;
- typedef std::vector< IntPair > MatTable;
- MatTable needMat(materials.size(),IntPair(0,0));
-
- std::vector<Surface>::iterator it,end = object.surfaces.end();
- std::vector<Surface::SurfaceEntry>::iterator it2,end2;
-
- for (it = object.surfaces.begin(); it != end; ++it)
- {
- register unsigned int idx = (*it).mat;
- if (idx >= needMat.size())
- {
- DefaultLogger::get()->error("AC3D: material index is out of range");
- idx = 0;
- }
- if ((*it).entries.empty())
- {
- DefaultLogger::get()->warn("AC3D: surface her zero vertex references");
- }
-
- // validate all vertex indices to make sure we won't crash here
- for (it2 = (*it).entries.begin(),
- end2 = (*it).entries.end(); it2 != end2; ++it2)
- {
- if ((*it2).first >= object.vertices.size())
- {
- DefaultLogger::get()->warn("AC3D: Invalid vertex reference");
- (*it2).first = 0;
- }
- }
-
- if (!needMat[idx].first)++node->mNumMeshes;
-
- switch ((*it).flags & 0xf)
- {
- // closed line
- case 0x1:
-
- needMat[idx].first += (unsigned int)(*it).entries.size();
- needMat[idx].second += (unsigned int)(*it).entries.size()<<1u;
- break;
-
- // unclosed line
- case 0x2:
-
- needMat[idx].first += (unsigned int)(*it).entries.size()-1;
- needMat[idx].second += ((unsigned int)(*it).entries.size()-1)<<1u;
- break;
-
- // 0 == polygon, else unknown
- default:
-
- if ((*it).flags & 0xf)
- {
- DefaultLogger::get()->warn("AC3D: The type flag of a surface is unknown");
- (*it).flags &= ~(0xf);
- }
-
- // the number of faces increments by one, the number
- // of vertices by surface.numref.
- needMat[idx].first++;
- needMat[idx].second += (unsigned int)(*it).entries.size();
- };
- }
- unsigned int* pip = node->mMeshes = new unsigned int[node->mNumMeshes];
- unsigned int mat = 0;
- const size_t oldm = meshes.size();
- for (MatTable::const_iterator cit = needMat.begin(), cend = needMat.end();
- cit != cend; ++cit, ++mat)
- {
- if (!(*cit).first)continue;
-
- // allocate a new aiMesh object
- *pip++ = (unsigned int)meshes.size();
- aiMesh* mesh = new aiMesh();
- meshes.push_back(mesh);
-
- mesh->mMaterialIndex = (unsigned int)outMaterials.size();
- outMaterials.push_back(new MaterialHelper());
- ConvertMaterial(object, materials[mat], *outMaterials.back());
-
- // allocate storage for vertices and normals
- mesh->mNumFaces = (*cit).first;
- aiFace* faces = mesh->mFaces = new aiFace[mesh->mNumFaces];
-
- mesh->mNumVertices = (*cit).second;
- aiVector3D* vertices = mesh->mVertices = new aiVector3D[mesh->mNumVertices];
- unsigned int cur = 0;
-
- // allocate UV coordinates, but only if the texture name for the
- // surface is not empty
- aiVector3D* uv = NULL;
- if (object.texture.length())
- {
- uv = mesh->mTextureCoords[0] = new aiVector3D[mesh->mNumVertices];
- mesh->mNumUVComponents[0] = 2;
- }
-
- for (it = object.surfaces.begin(); it != end; ++it)
- {
- if (mat == (*it).mat)
- {
- const Surface& src = *it;
-
- // closed polygon
- unsigned int type = (*it).flags & 0xf;
- if (!type)
- {
- aiFace& face = *faces++;
- if ((face.mNumIndices = (unsigned int)src.entries.size()))
- {
- face.mIndices = new unsigned int[face.mNumIndices];
- for (unsigned int i = 0; i < face.mNumIndices;++i,++vertices)
- {
- const Surface::SurfaceEntry& entry = src.entries[i];
- face.mIndices[i] = cur++;
-
- // copy vertex positions
- *vertices = object.vertices[entry.first] + object.translation;
-
-
- // copy texture coordinates
- if (uv)
- {
- uv->x = entry.second.x;
- uv->y = entry.second.y;
- ++uv;
- }
- }
- }
- }
- else
- {
-
- it2 = (*it).entries.begin();
-
- // either a closed or an unclosed line
- register unsigned int tmp = (unsigned int)(*it).entries.size();
- if (0x2 == type)--tmp;
- for (unsigned int m = 0; m < tmp;++m)
- {
- aiFace& face = *faces++;
-
- face.mNumIndices = 2;
- face.mIndices = new unsigned int[2];
- face.mIndices[0] = cur++;
- face.mIndices[1] = cur++;
-
- // copy vertex positions
- *vertices++ = object.vertices[(*it2).first];
-
- // copy texture coordinates
- if (uv)
- {
- uv->x = (*it2).second.x;
- uv->y = (*it2).second.y;
- ++uv;
- }
-
-
- if (0x1 == type && tmp-1 == m)
- {
- // if this is a closed line repeat its beginning now
- it2 = (*it).entries.begin();
- }
- else ++it2;
-
- // second point
- *vertices++ = object.vertices[(*it2).first];
-
- if (uv)
- {
- uv->x = (*it2).second.x;
- uv->y = (*it2).second.y;
- ++uv;
- }
- }
- }
- }
- }
- }
-
- // Now apply catmull clark subdivision if necessary. We split meshes into
- // materials which is not done by AC3D during smoothing, so we need to
- // collect all meshes using the same material group.
- if (object.subDiv) {
- if (configEvalSubdivision) {
- boost::scoped_ptr<Subdivider> div(Subdivider::Create(Subdivider::CATMULL_CLARKE));
- DefaultLogger::get()->info("AC3D: Evaluating subdivision surface: "+object.name);
-
- std::vector<aiMesh*> cpy(meshes.size()-oldm,NULL);
- div->Subdivide(&meshes[oldm],cpy.size(),&cpy.front(),object.subDiv,true);
- std::copy(cpy.begin(),cpy.end(),meshes.begin()+oldm);
-
- // previous meshes are deleted vy Subdivide().
- }
- else {
- DefaultLogger::get()->info("AC3D: Letting the subdivision surface untouched due to my configuration: "
- +object.name);
- }
- }
- }
- }
-
- if (object.name.length())
- node->mName.Set(object.name);
- else
- {
- // generate a name depending on the type of the node
- switch (object.type)
- {
- case Object::Group:
- node->mName.length = ::sprintf(node->mName.data,"ACGroup_%i",groups++);
- break;
- case Object::Poly:
- node->mName.length = ::sprintf(node->mName.data,"ACPoly_%i",polys++);
- break;
- case Object::Light:
- node->mName.length = ::sprintf(node->mName.data,"ACLight_%i",lights++);
- break;
-
- // there shouldn't be more than one world, but we don't care
- case Object::World:
- node->mName.length = ::sprintf(node->mName.data,"ACWorld_%i",worlds++);
- break;
- }
- }
-
-
- // setup the local transformation matrix of the object
- // compute the transformation offset to the parent node
- node->mTransformation = aiMatrix4x4 ( object.rotation );
-
- if (object.type == Object::Group || !object.numRefs)
- {
- node->mTransformation.a4 = object.translation.x;
- node->mTransformation.b4 = object.translation.y;
- node->mTransformation.c4 = object.translation.z;
- }
-
- // add children to the object
- if (object.children.size())
- {
- node->mNumChildren = (unsigned int)object.children.size();
- node->mChildren = new aiNode*[node->mNumChildren];
- for (unsigned int i = 0; i < node->mNumChildren;++i)
- {
- node->mChildren[i] = ConvertObjectSection(object.children[i],meshes,outMaterials,materials,node);
- }
- }
-
- return node;
-}
-
-// ------------------------------------------------------------------------------------------------
-void AC3DImporter::SetupProperties(const Importer* pImp)
-{
- configSplitBFCull = pImp->GetPropertyInteger(AI_CONFIG_IMPORT_AC_SEPARATE_BFCULL,1) ? true : false;
- configEvalSubdivision = pImp->GetPropertyInteger(AI_CONFIG_IMPORT_AC_EVAL_SUBDIVISION,1) ? true : false;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Imports the given file into the given scene structure.
-void AC3DImporter::InternReadFile( const std::string& pFile,
- aiScene* pScene, IOSystem* pIOHandler)
-{
- boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
-
- // Check whether we can read from the file
- if ( file.get() == NULL)
- throw DeadlyImportError( "Failed to open AC3D file " + pFile + ".");
-
- // allocate storage and copy the contents of the file to a memory buffer
- std::vector<char> mBuffer2;
- TextFileToBuffer(file.get(),mBuffer2);
-
- buffer = &mBuffer2[0];
- mNumMeshes = 0;
-
- lights = polys = worlds = groups = 0;
-
- if (::strncmp(buffer,"AC3D",4)) {
- throw DeadlyImportError("AC3D: No valid AC3D file, magic sequence not found");
- }
-
- // print the file format version to the console
- unsigned int version = HexDigitToDecimal( buffer[4] );
- char msg[3];
- ASSIMP_itoa10(msg,3,version);
- DefaultLogger::get()->info(std::string("AC3D file format version: ") + msg);
-
- std::vector<Material> materials;
- materials.reserve(5);
-
- std::vector<Object> rootObjects;
- rootObjects.reserve(5);
-
- std::vector<aiLight*> lights;
- mLights = & lights;
-
- while (GetNextLine())
- {
- if (TokenMatch(buffer,"MATERIAL",8))
- {
- materials.push_back(Material());
- Material& mat = materials.back();
-
- // manually parse the material ... sscanf would use the buldin atof ...
- // Format: (name) rgb %f %f %f amb %f %f %f emis %f %f %f spec %f %f %f shi %d trans %f
-
- AI_AC_SKIP_TO_NEXT_TOKEN();
- if ('\"' == *buffer)
- {
- AI_AC_GET_STRING(mat.name);
- AI_AC_SKIP_TO_NEXT_TOKEN();
- }
-
- AI_AC_CHECKED_LOAD_FLOAT_ARRAY("rgb",3,3,&mat.rgb);
- AI_AC_CHECKED_LOAD_FLOAT_ARRAY("amb",3,3,&mat.amb);
- AI_AC_CHECKED_LOAD_FLOAT_ARRAY("emis",4,3,&mat.emis);
- AI_AC_CHECKED_LOAD_FLOAT_ARRAY("spec",4,3,&mat.spec);
- AI_AC_CHECKED_LOAD_FLOAT_ARRAY("shi",3,1,&mat.shin);
- AI_AC_CHECKED_LOAD_FLOAT_ARRAY("trans",5,1,&mat.trans);
- }
- LoadObjectSection(rootObjects);
- }
-
- if (rootObjects.empty() || !mNumMeshes)
- {
- throw DeadlyImportError("AC3D: No meshes have been loaded");
- }
- if (materials.empty())
- {
- DefaultLogger::get()->warn("AC3D: No material has been found");
- materials.push_back(Material());
- }
-
- mNumMeshes += (mNumMeshes>>2u) + 1;
- std::vector<aiMesh*> meshes;
- meshes.reserve(mNumMeshes);
-
- std::vector<MaterialHelper*> omaterials;
- materials.reserve(mNumMeshes);
-
- // generate a dummy root if there are multiple objects on the top layer
- Object* root;
- if (1 == rootObjects.size())
- root = &rootObjects[0];
- else
- {
- root = new Object();
- }
-
- // now convert the imported stuff to our output data structure
- pScene->mRootNode = ConvertObjectSection(*root,meshes,omaterials,materials);
- if (1 != rootObjects.size())delete root;
-
- if (!::strncmp( pScene->mRootNode->mName.data, "Node", 4))
- pScene->mRootNode->mName.Set("<AC3DWorld>");
-
- // copy meshes
- if (meshes.empty())
- {
- throw DeadlyImportError("An unknown error occured during converting");
- }
- pScene->mNumMeshes = (unsigned int)meshes.size();
- pScene->mMeshes = new aiMesh*[pScene->mNumMeshes];
- ::memcpy(pScene->mMeshes,&meshes[0],pScene->mNumMeshes*sizeof(void*));
-
- // copy materials
- pScene->mNumMaterials = (unsigned int)omaterials.size();
- pScene->mMaterials = new aiMaterial*[pScene->mNumMaterials];
- ::memcpy(pScene->mMaterials,&omaterials[0],pScene->mNumMaterials*sizeof(void*));
-
- // copy lights
- pScene->mNumLights = (unsigned int)lights.size();
- if (lights.size())
- {
- pScene->mLights = new aiLight*[lights.size()];
- ::memcpy(pScene->mLights,&lights[0],lights.size()*sizeof(void*));
- }
-}
-
-#endif //!defined ASSIMP_BUILD_NO_AC_IMPORTER
diff --git a/3rdparty/assimp/code/ACLoader.h b/3rdparty/assimp/code/ACLoader.h
deleted file mode 100644
index f11d6b4a..00000000
--- a/3rdparty/assimp/code/ACLoader.h
+++ /dev/null
@@ -1,271 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file ACLoader.h
- * @brief Declaration of the .ac importer class.
- */
-#ifndef AI_AC3DLOADER_H_INCLUDED
-#define AI_AC3DLOADER_H_INCLUDED
-
-#include <vector>
-
-#include "BaseImporter.h"
-#include "../include/aiTypes.h"
-
-namespace Assimp {
-
-// ---------------------------------------------------------------------------
-/** AC3D (*.ac) importer class
-*/
-class AC3DImporter : public BaseImporter
-{
- friend class Importer;
-
-protected:
- /** Constructor to be privately used by Importer */
- AC3DImporter();
-
- /** Destructor, private as well */
- ~AC3DImporter();
-
-
- // Represents an AC3D material
- struct Material
- {
- Material()
- : rgb (0.6f,0.6f,0.6f)
- , spec (1.f,1.f,1.f)
- , shin (0.f)
- , trans (0.f)
- {}
-
- // base color of the material
- aiColor3D rgb;
-
- // ambient color of the material
- aiColor3D amb;
-
- // emissive color of the material
- aiColor3D emis;
-
- // specular color of the material
- aiColor3D spec;
-
- // shininess exponent
- float shin;
-
- // transparency. 0 == opaque
- float trans;
-
- // name of the material. optional.
- std::string name;
- };
-
- // Represents an AC3D surface
- struct Surface
- {
- Surface()
- : mat (0)
- , flags (0)
- {}
-
- unsigned int mat,flags;
-
- typedef std::pair<unsigned int, aiVector2D > SurfaceEntry;
- std::vector< SurfaceEntry > entries;
- };
-
- // Represents an AC3D object
- struct Object
- {
- Object()
- : type (World)
- , name( "" )
- , children()
- , texture( "" )
- , texRepeat( 1.f, 1.f )
- , texOffset( 0.0f, 0.0f )
- , rotation()
- , translation()
- , vertices()
- , surfaces()
- , numRefs (0)
- , subDiv (0)
- {}
-
- // Type description
- enum Type
- {
- World = 0x0,
- Poly = 0x1,
- Group = 0x2,
- Light = 0x4
- } type;
-
- // name of the object
- std::string name;
-
- // object children
- std::vector<Object> children;
-
- // texture to be assigned to all surfaces of the object
- std::string texture;
-
- // texture repat factors (scaling for all coordinates)
- aiVector2D texRepeat, texOffset;
-
- // rotation matrix
- aiMatrix3x3 rotation;
-
- // translation vector
- aiVector3D translation;
-
- // vertices
- std::vector<aiVector3D> vertices;
-
- // surfaces
- std::vector<Surface> surfaces;
-
- // number of indices (= num verts in verbose format)
- unsigned int numRefs;
-
- // number of subdivisions to be performed on the
- // imported data
- unsigned int subDiv;
-
- // max angle limit for smoothing
- float crease;
- };
-
-
-public:
-
- // -------------------------------------------------------------------
- /** Returns whether the class can handle the format of the given file.
- * See BaseImporter::CanRead() for details.
- */
- bool CanRead( const std::string& pFile, IOSystem* pIOHandler,
- bool checkSig) const;
-
-protected:
-
- // -------------------------------------------------------------------
- /** Called by Importer::GetExtensionList() for each loaded importer.
- * See BaseImporter::GetExtensionList() for details */
- void GetExtensionList(std::set<std::string>& extensions);
-
- // -------------------------------------------------------------------
- /** Imports the given file into the given scene structure.
- * See BaseImporter::InternReadFile() for details*/
- void InternReadFile( const std::string& pFile, aiScene* pScene,
- IOSystem* pIOHandler);
-
- // -------------------------------------------------------------------
- /** Called prior to ReadFile().
- * The function is a request to the importer to update its configuration
- * basing on the Importer's configuration property list.*/
- void SetupProperties(const Importer* pImp);
-
-private:
-
- // -------------------------------------------------------------------
- /** Get the next line from the file.
- * @return false if the end of the file was reached*/
- bool GetNextLine();
-
- // -------------------------------------------------------------------
- /** Load the object section. This method is called recursively to
- * load subobjects, the method returns after a 'kids 0' was
- * encountered.
- * @objects List of output objects*/
- void LoadObjectSection(std::vector<Object>& objects);
-
- // -------------------------------------------------------------------
- /** Convert all objects into meshes and nodes.
- * @param object Current object to work on
- * @param meshes Pointer to the list of output meshes
- * @param outMaterials List of output materials
- * @param materials Material list
- * @param Scenegraph node for the object */
- aiNode* ConvertObjectSection(Object& object,
- std::vector<aiMesh*>& meshes,
- std::vector<MaterialHelper*>& outMaterials,
- const std::vector<Material>& materials,
- aiNode* parent = NULL);
-
- // -------------------------------------------------------------------
- /** Convert a material
- * @param object Current object
- * @param matSrc Source material description
- * @param matDest Destination material to be filled */
- void ConvertMaterial(const Object& object,
- const Material& matSrc,
- MaterialHelper& matDest);
-
-private:
-
-
- // points to the next data line
- const char* buffer;
-
- // Configuration option: if enabled, up to two meshes
- // are generated per material: those faces who have
- // their bf cull flags set are separated.
- bool configSplitBFCull;
-
- // Configuration switch: subdivision surfaces are only
- // evaluated if the value is true.
- bool configEvalSubdivision;
-
- // counts how many objects we have in the tree.
- // basing on this information we can find a
- // good estimate how many meshes we'll have in the final scene.
- unsigned int mNumMeshes;
-
- // current list of light sources
- std::vector<aiLight*>* mLights;
-
- // name counters
- unsigned int lights, groups, polys, worlds;
-};
-
-} // end of namespace Assimp
-
-#endif // AI_AC3DIMPORTER_H_INC
diff --git a/3rdparty/assimp/code/ASELoader.cpp b/3rdparty/assimp/code/ASELoader.cpp
deleted file mode 100644
index fc3df8b9..00000000
--- a/3rdparty/assimp/code/ASELoader.cpp
+++ /dev/null
@@ -1,1302 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file ASELoader.cpp
- * @brief Implementation of the ASE importer class
- */
-
-#include "AssimpPCH.h"
-#ifndef ASSIMP_BUILD_NO_ASE_IMPORTER
-
-// internal headers
-#include "ASELoader.h"
-#include "MaterialSystem.h"
-#include "StringComparison.h"
-#include "SkeletonMeshBuilder.h"
-#include "TargetAnimation.h"
-
-// utilities
-#include "fast_atof.h"
-
-using namespace Assimp;
-using namespace Assimp::ASE;
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-ASEImporter::ASEImporter()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-ASEImporter::~ASEImporter()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the class can handle the format of the given file.
-bool ASEImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool cs) const
-{
- // check file extension
- const std::string extension = GetExtension(pFile);
-
- if ( extension == "ase" || extension == "ask")
- return true;
-
- if ((!extension.length() || cs) && pIOHandler) {
- const char* tokens[] = {"*3dsmax_asciiexport"};
- return SearchFileHeaderForToken(pIOHandler,pFile,tokens,1);
- }
- return false;
-}
-
-// ------------------------------------------------------------------------------------------------
-void ASEImporter::GetExtensionList(std::set<std::string>& extensions)
-{
- extensions.insert("ase");
- extensions.insert("ask");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Setup configuration options
-void ASEImporter::SetupProperties(const Importer* pImp)
-{
- configRecomputeNormals = (pImp->GetPropertyInteger(
- AI_CONFIG_IMPORT_ASE_RECONSTRUCT_NORMALS,1) ? true : false);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Imports the given file into the given scene structure.
-void ASEImporter::InternReadFile( const std::string& pFile,
- aiScene* pScene, IOSystem* pIOHandler)
-{
- boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
-
- // Check whether we can read from the file
- if ( file.get() == NULL) {
- throw DeadlyImportError( "Failed to open ASE file " + pFile + ".");
- }
-
- // Allocate storage and copy the contents of the file to a memory buffer
- std::vector<char> mBuffer2;
- TextFileToBuffer(file.get(),mBuffer2);
-
- this->mBuffer = &mBuffer2[0];
- this->pcScene = pScene;
-
- // ------------------------------------------------------------------
- // Guess the file format by looking at the extension
- // ASC is considered to be the older format 110,
- // ASE is the actual version 200 (that is currently written by max)
- // ------------------------------------------------------------------
- unsigned int defaultFormat;
- std::string::size_type s = pFile.length()-1;
- switch (pFile.c_str()[s]) {
-
- case 'C':
- case 'c':
- defaultFormat = AI_ASE_OLD_FILE_FORMAT;
- break;
- default:
- defaultFormat = AI_ASE_NEW_FILE_FORMAT;
- };
-
- // Construct an ASE parser and parse the file
- ASE::Parser parser(mBuffer,defaultFormat);
- mParser = &parser;
- mParser->Parse();
-
- //------------------------------------------------------------------
- // Check whether we god at least one mesh. If we did - generate
- // materials and copy meshes.
- // ------------------------------------------------------------------
- if ( !mParser->m_vMeshes.empty()) {
-
- // If absolutely no material has been loaded from the file
- // we need to generate a default material
- GenerateDefaultMaterial();
-
- // process all meshes
- bool tookNormals = false;
- std::vector<aiMesh*> avOutMeshes;
- avOutMeshes.reserve(mParser->m_vMeshes.size()*2);
- for (std::vector<ASE::Mesh>::iterator i = mParser->m_vMeshes.begin();i != mParser->m_vMeshes.end();++i) {
- if ((*i).bSkip) {
- continue;
- }
- BuildUniqueRepresentation(*i);
-
- // Need to generate proper vertex normals if necessary
- if (GenerateNormals(*i)) {
- tookNormals = true;
- }
-
- // Convert all meshes to aiMesh objects
- ConvertMeshes(*i,avOutMeshes);
- }
- if (tookNormals) {
- DefaultLogger::get()->debug("ASE: Taking normals from the file. Use "
- "the AI_CONFIG_IMPORT_ASE_RECONSTRUCT_NORMALS setting if you "
- "experience problems");
- }
-
- // Now build the output mesh list. Remove dummies
- pScene->mNumMeshes = (unsigned int)avOutMeshes.size();
- aiMesh** pp = pScene->mMeshes = new aiMesh*[pScene->mNumMeshes];
- for (std::vector<aiMesh*>::const_iterator i = avOutMeshes.begin();i != avOutMeshes.end();++i) {
- if (!(*i)->mNumFaces) {
- continue;
- }
- *pp++ = *i;
- }
- pScene->mNumMeshes = (unsigned int)(pp - pScene->mMeshes);
-
- // Build final material indices (remove submaterials and setup
- // the final list)
- BuildMaterialIndices();
- }
-
- // ------------------------------------------------------------------
- // Copy all scene graph nodes - lights, cameras, dummies and meshes
- // into one huge list.
- //------------------------------------------------------------------
- std::vector<BaseNode*> nodes;
- nodes.reserve(mParser->m_vMeshes.size() +mParser->m_vLights.size()
- + mParser->m_vCameras.size() + mParser->m_vDummies.size());
-
- // Lights
- for (std::vector<ASE::Light>::iterator it = mParser->m_vLights.begin(),
- end = mParser->m_vLights.end();it != end; ++it)nodes.push_back(&(*it));
- // Cameras
- for (std::vector<ASE::Camera>::iterator it = mParser->m_vCameras.begin(),
- end = mParser->m_vCameras.end();it != end; ++it)nodes.push_back(&(*it));
- // Meshes
- for (std::vector<ASE::Mesh>::iterator it = mParser->m_vMeshes.begin(),
- end = mParser->m_vMeshes.end();it != end; ++it)nodes.push_back(&(*it));
- // Dummies
- for (std::vector<ASE::Dummy>::iterator it = mParser->m_vDummies.begin(),
- end = mParser->m_vDummies.end();it != end; ++it)nodes.push_back(&(*it));
-
- // build the final node graph
- BuildNodes(nodes);
-
- // build output animations
- BuildAnimations(nodes);
-
- // build output cameras
- BuildCameras();
-
- // build output lights
- BuildLights();
-
- // ------------------------------------------------------------------
- // If we have no meshes use the SkeletonMeshBuilder helper class
- // to build a mesh for the animation skeleton
- // FIXME: very strange results
- // ------------------------------------------------------------------
- if (!pScene->mNumMeshes) {
- pScene->mFlags |= AI_SCENE_FLAGS_INCOMPLETE;
- SkeletonMeshBuilder skeleton(pScene);
- }
-}
-// ------------------------------------------------------------------------------------------------
-void ASEImporter::GenerateDefaultMaterial()
-{
- ai_assert(NULL != mParser);
-
- bool bHas = false;
- for (std::vector<ASE::Mesh>::iterator i = mParser->m_vMeshes.begin();i != mParser->m_vMeshes.end();++i) {
- if ((*i).bSkip)continue;
- if (ASE::Face::DEFAULT_MATINDEX == (*i).iMaterialIndex) {
- (*i).iMaterialIndex = (unsigned int)mParser->m_vMaterials.size();
- bHas = true;
- }
- }
- if (bHas || mParser->m_vMaterials.empty()) {
- // add a simple material without submaterials to the parser's list
- mParser->m_vMaterials.push_back ( ASE::Material() );
- ASE::Material& mat = mParser->m_vMaterials.back();
-
- mat.mDiffuse = aiColor3D(0.6f,0.6f,0.6f);
- mat.mSpecular = aiColor3D(1.0f,1.0f,1.0f);
- mat.mAmbient = aiColor3D(0.05f,0.05f,0.05f);
- mat.mShading = Discreet3DS::Gouraud;
- mat.mName = AI_DEFAULT_MATERIAL_NAME;
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void ASEImporter::BuildAnimations(const std::vector<BaseNode*>& nodes)
-{
- // check whether we have at least one mesh which has animations
- std::vector<ASE::BaseNode*>::const_iterator i = nodes.begin();
- unsigned int iNum = 0;
- for (;i != nodes.end();++i) {
-
- // TODO: Implement Bezier & TCB support
- if ((*i)->mAnim.mPositionType != ASE::Animation::TRACK) {
- DefaultLogger::get()->warn("ASE: Position controller uses Bezier/TCB keys. "
- "This is not supported.");
- }
- if ((*i)->mAnim.mRotationType != ASE::Animation::TRACK) {
- DefaultLogger::get()->warn("ASE: Rotation controller uses Bezier/TCB keys. "
- "This is not supported.");
- }
- if ((*i)->mAnim.mScalingType != ASE::Animation::TRACK) {
- DefaultLogger::get()->warn("ASE: Position controller uses Bezier/TCB keys. "
- "This is not supported.");
- }
-
- // We compare against 1 here - firstly one key is not
- // really an animation and secondly MAX writes dummies
- // that represent the node transformation.
- if ((*i)->mAnim.akeyPositions.size()>1 || (*i)->mAnim.akeyRotations.size()>1 || (*i)->mAnim.akeyScaling.size()>1){
- ++iNum;
- }
- if ((*i)->mTargetAnim.akeyPositions.size() > 1 && is_not_qnan( (*i)->mTargetPosition.x )) {
- ++iNum;
- }
- }
- if (iNum) {
- // Generate a new animation channel and setup everything for it
- pcScene->mNumAnimations = 1;
- pcScene->mAnimations = new aiAnimation*[1];
- aiAnimation* pcAnim = pcScene->mAnimations[0] = new aiAnimation();
- pcAnim->mNumChannels = iNum;
- pcAnim->mChannels = new aiNodeAnim*[iNum];
- pcAnim->mTicksPerSecond = mParser->iFrameSpeed * mParser->iTicksPerFrame;
-
- iNum = 0;
-
- // Now iterate through all meshes and collect all data we can find
- for (i = nodes.begin();i != nodes.end();++i) {
-
- ASE::BaseNode* me = *i;
- if ( me->mTargetAnim.akeyPositions.size() > 1 && is_not_qnan( me->mTargetPosition.x )) {
- // Generate an extra channel for the camera/light target.
- // BuildNodes() does also generate an extra node, named
- // <baseName>.Target.
- aiNodeAnim* nd = pcAnim->mChannels[iNum++] = new aiNodeAnim();
- nd->mNodeName.Set(me->mName + ".Target");
-
- // If there is no input position channel we will need
- // to supply the default position from the node's
- // local transformation matrix.
- /*TargetAnimationHelper helper;
- if (me->mAnim.akeyPositions.empty())
- {
- aiMatrix4x4& mat = (*i)->mTransform;
- helper.SetFixedMainAnimationChannel(aiVector3D(
- mat.a4, mat.b4, mat.c4));
- }
- else helper.SetMainAnimationChannel (&me->mAnim.akeyPositions);
- helper.SetTargetAnimationChannel (&me->mTargetAnim.akeyPositions);
-
- helper.Process(&me->mTargetAnim.akeyPositions);*/
-
- // Allocate the key array and fill it
- nd->mNumPositionKeys = (unsigned int) me->mTargetAnim.akeyPositions.size();
- nd->mPositionKeys = new aiVectorKey[nd->mNumPositionKeys];
-
- ::memcpy(nd->mPositionKeys,&me->mTargetAnim.akeyPositions[0],
- nd->mNumPositionKeys * sizeof(aiVectorKey));
- }
-
- if (me->mAnim.akeyPositions.size() > 1 || me->mAnim.akeyRotations.size() > 1 || me->mAnim.akeyScaling.size() > 1) {
- // Begin a new node animation channel for this node
- aiNodeAnim* nd = pcAnim->mChannels[iNum++] = new aiNodeAnim();
- nd->mNodeName.Set(me->mName);
-
- // copy position keys
- if (me->mAnim.akeyPositions.size() > 1 )
- {
- // Allocate the key array and fill it
- nd->mNumPositionKeys = (unsigned int) me->mAnim.akeyPositions.size();
- nd->mPositionKeys = new aiVectorKey[nd->mNumPositionKeys];
-
- ::memcpy(nd->mPositionKeys,&me->mAnim.akeyPositions[0],
- nd->mNumPositionKeys * sizeof(aiVectorKey));
- }
- // copy rotation keys
- if (me->mAnim.akeyRotations.size() > 1 ) {
- // Allocate the key array and fill it
- nd->mNumRotationKeys = (unsigned int) me->mAnim.akeyRotations.size();
- nd->mRotationKeys = new aiQuatKey[nd->mNumRotationKeys];
-
- // --------------------------------------------------------------------
- // Rotation keys are offsets to the previous keys.
- // We have the quaternion representations of all
- // of them, so we just need to concatenate all
- // (unit-length) quaternions to get the absolute
- // rotations.
- // Rotation keys are ABSOLUTE for older files
- // --------------------------------------------------------------------
-
- aiQuaternion cur;
- for (unsigned int a = 0; a < nd->mNumRotationKeys;++a) {
- aiQuatKey q = me->mAnim.akeyRotations[a];
-
- if (mParser->iFileFormat > 110) {
- cur = (a ? cur*q.mValue : q.mValue);
- q.mValue = cur.Normalize();
- }
- nd->mRotationKeys[a] = q;
-
- // need this to get to Assimp quaternion conventions
- nd->mRotationKeys[a].mValue.w *= -1.f;
- }
- }
- // copy scaling keys
- if (me->mAnim.akeyScaling.size() > 1 ) {
- // Allocate the key array and fill it
- nd->mNumScalingKeys = (unsigned int) me->mAnim.akeyScaling.size();
- nd->mScalingKeys = new aiVectorKey[nd->mNumScalingKeys];
-
- ::memcpy(nd->mScalingKeys,&me->mAnim.akeyScaling[0],
- nd->mNumScalingKeys * sizeof(aiVectorKey));
- }
- }
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Build output cameras
-void ASEImporter::BuildCameras()
-{
- if (!mParser->m_vCameras.empty()) {
- pcScene->mNumCameras = (unsigned int)mParser->m_vCameras.size();
- pcScene->mCameras = new aiCamera*[pcScene->mNumCameras];
-
- for (unsigned int i = 0; i < pcScene->mNumCameras;++i) {
- aiCamera* out = pcScene->mCameras[i] = new aiCamera();
- ASE::Camera& in = mParser->m_vCameras[i];
-
- // copy members
- out->mClipPlaneFar = in.mFar;
- out->mClipPlaneNear = (in.mNear ? in.mNear : 0.1f);
- out->mHorizontalFOV = in.mFOV;
-
- out->mName.Set(in.mName);
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Build output lights
-void ASEImporter::BuildLights()
-{
- if (!mParser->m_vLights.empty()) {
- pcScene->mNumLights = (unsigned int)mParser->m_vLights.size();
- pcScene->mLights = new aiLight*[pcScene->mNumLights];
-
- for (unsigned int i = 0; i < pcScene->mNumLights;++i) {
- aiLight* out = pcScene->mLights[i] = new aiLight();
- ASE::Light& in = mParser->m_vLights[i];
-
- // The direction is encoded in the transformation matrix of the node.
- // In 3DS MAX the light source points into negative Z direction if
- // the node transformation is the identity.
- out->mDirection = aiVector3D(0.f,0.f,-1.f);
-
- out->mName.Set(in.mName);
- switch (in.mLightType)
- {
- case ASE::Light::TARGET:
- out->mType = aiLightSource_SPOT;
- out->mAngleInnerCone = AI_DEG_TO_RAD(in.mAngle);
- out->mAngleOuterCone = (in.mFalloff ? AI_DEG_TO_RAD(in.mFalloff) : out->mAngleInnerCone);
- break;
-
- case ASE::Light::DIRECTIONAL:
- out->mType = aiLightSource_DIRECTIONAL;
- break;
-
- default:
- //case ASE::Light::OMNI:
- out->mType = aiLightSource_POINT;
- break;
- };
- out->mColorDiffuse = out->mColorSpecular = in.mColor * in.mIntensity;
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void ASEImporter::AddNodes(const std::vector<BaseNode*>& nodes,
- aiNode* pcParent,const char* szName)
-{
- aiMatrix4x4 m;
- AddNodes(nodes,pcParent,szName,m);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Add meshes to a given node
-void ASEImporter::AddMeshes(const ASE::BaseNode* snode,aiNode* node)
-{
- for (unsigned int i = 0; i < pcScene->mNumMeshes;++i) {
- // Get the name of the mesh (the mesh instance has been temporarily stored in the third vertex color)
- const aiMesh* pcMesh = pcScene->mMeshes[i];
- const ASE::Mesh* mesh = (const ASE::Mesh*)pcMesh->mColors[2];
-
- if (mesh == snode) {
- ++node->mNumMeshes;
- }
- }
-
- if (node->mNumMeshes) {
- node->mMeshes = new unsigned int[node->mNumMeshes];
- for (unsigned int i = 0, p = 0; i < pcScene->mNumMeshes;++i) {
-
- const aiMesh* pcMesh = pcScene->mMeshes[i];
- const ASE::Mesh* mesh = (const ASE::Mesh*)pcMesh->mColors[2];
- if (mesh == snode) {
- node->mMeshes[p++] = i;
-
- // Transform all vertices of the mesh back into their local space ->
- // at the moment they are pretransformed
- aiMatrix4x4 m = mesh->mTransform;
- m.Inverse();
-
- aiVector3D* pvCurPtr = pcMesh->mVertices;
- const aiVector3D* pvEndPtr = pvCurPtr + pcMesh->mNumVertices;
- while (pvCurPtr != pvEndPtr) {
- *pvCurPtr = m * (*pvCurPtr);
- pvCurPtr++;
- }
-
- // Do the same for the normal vectors, if we have them.
- // As always, inverse transpose.
- if (pcMesh->mNormals) {
- aiMatrix3x3 m3 = aiMatrix3x3( mesh->mTransform );
- m3.Transpose();
-
- pvCurPtr = pcMesh->mNormals;
- pvEndPtr = pvCurPtr + pcMesh->mNumVertices;
- while (pvCurPtr != pvEndPtr) {
- *pvCurPtr = m3 * (*pvCurPtr);
- pvCurPtr++;
- }
- }
- }
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Add child nodes to a given parent node
-void ASEImporter::AddNodes (const std::vector<BaseNode*>& nodes,
- aiNode* pcParent, const char* szName,
- const aiMatrix4x4& mat)
-{
- const size_t len = szName ? ::strlen(szName) : 0;
- ai_assert(4 <= AI_MAX_NUMBER_OF_COLOR_SETS);
-
- // Receives child nodes for the pcParent node
- std::vector<aiNode*> apcNodes;
-
- // Now iterate through all nodes in the scene and search for one
- // which has *us* as parent.
- for (std::vector<BaseNode*>::const_iterator it = nodes.begin(), end = nodes.end(); it != end; ++it) {
- const BaseNode* snode = *it;
- if (szName) {
- if (len != snode->mParent.length() || ::strcmp(szName,snode->mParent.c_str()))
- continue;
- }
- else if (snode->mParent.length())
- continue;
-
- (*it)->mProcessed = true;
-
- // Allocate a new node and add it to the output data structure
- apcNodes.push_back(new aiNode());
- aiNode* node = apcNodes.back();
-
- node->mName.Set((snode->mName.length() ? snode->mName.c_str() : "Unnamed_Node"));
- node->mParent = pcParent;
-
- // Setup the transformation matrix of the node
- aiMatrix4x4 mParentAdjust = mat;
- mParentAdjust.Inverse();
- node->mTransformation = mParentAdjust*snode->mTransform;
-
- // Add sub nodes - prevent stack overflow due to recursive parenting
- if (node->mName != node->mParent->mName) {
- AddNodes(nodes,node,node->mName.data,snode->mTransform);
- }
-
- // Further processing depends on the type of the node
- if (snode->mType == ASE::BaseNode::Mesh) {
- // If the type of this node is "Mesh" we need to search
- // the list of output meshes in the data structure for
- // all those that belonged to this node once. This is
- // slightly inconvinient here and a better solution should
- // be used when this code is refactored next.
- AddMeshes(snode,node);
- }
- else if (is_not_qnan( snode->mTargetPosition.x )) {
- // If this is a target camera or light we generate a small
- // child node which marks the position of the camera
- // target (the direction information is contained in *this*
- // node's animation track but the exact target position
- // would be lost otherwise)
- if (!node->mNumChildren) {
- node->mChildren = new aiNode*[1];
- }
-
- aiNode* nd = new aiNode();
-
- nd->mName.Set ( snode->mName + ".Target" );
-
- nd->mTransformation.a4 = snode->mTargetPosition.x - snode->mTransform.a4;
- nd->mTransformation.b4 = snode->mTargetPosition.y - snode->mTransform.b4;
- nd->mTransformation.c4 = snode->mTargetPosition.z - snode->mTransform.c4;
-
- nd->mParent = node;
-
- // The .Target node is always the first child node
- for (unsigned int m = 0; m < node->mNumChildren;++m)
- node->mChildren[m+1] = node->mChildren[m];
-
- node->mChildren[0] = nd;
- node->mNumChildren++;
-
- // What we did is so great, it is at least worth a debug message
- DefaultLogger::get()->debug("ASE: Generating separate target node ("+snode->mName+")");
- }
- }
-
- // Allocate enough space for the child nodes
- // We allocate one slot more in case this is a target camera/light
- pcParent->mNumChildren = (unsigned int)apcNodes.size();
- if (pcParent->mNumChildren) {
- pcParent->mChildren = new aiNode*[apcNodes.size()+1 /* PLUS ONE !!! */];
-
- // now build all nodes for our nice new children
- for (unsigned int p = 0; p < apcNodes.size();++p)
- pcParent->mChildren[p] = apcNodes[p];
- }
- return;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Build the output node graph
-void ASEImporter::BuildNodes(std::vector<BaseNode*>& nodes) {
- ai_assert(NULL != pcScene);
-
- // allocate the one and only root node
- aiNode* root = pcScene->mRootNode = new aiNode();
- root->mName.Set("<ASERoot>");
-
- // Setup the coordinate system transformation
- pcScene->mRootNode->mNumChildren = 1;
- pcScene->mRootNode->mChildren = new aiNode*[1];
- aiNode* ch = pcScene->mRootNode->mChildren[0] = new aiNode();
- ch->mParent = root;
-
- // Change the transformation matrix of all nodes
- for (std::vector<BaseNode*>::iterator it = nodes.begin(), end = nodes.end();it != end; ++it) {
- aiMatrix4x4& m = (*it)->mTransform;
- m.Transpose(); // row-order vs column-order
- }
-
- // add all nodes
- AddNodes(nodes,ch,NULL);
-
- // now iterate through al nodes and find those that have not yet
- // been added to the nodegraph (= their parent could not be recognized)
- std::vector<const BaseNode*> aiList;
- for (std::vector<BaseNode*>::iterator it = nodes.begin(), end = nodes.end();it != end; ++it) {
- if ((*it)->mProcessed) {
- continue;
- }
-
- // check whether our parent is known
- bool bKnowParent = false;
-
- // search the list another time, starting *here* and try to find out whether
- // there is a node that references *us* as a parent
- for (std::vector<BaseNode*>::const_iterator it2 = nodes.begin();it2 != end; ++it2) {
- if (it2 == it) {
- continue;
- }
-
- if ((*it2)->mName == (*it)->mParent) {
- bKnowParent = true;
- break;
- }
- }
- if (!bKnowParent) {
- aiList.push_back(*it);
- }
- }
-
- // Are there ane orphaned nodes?
- if (!aiList.empty()) {
- std::vector<aiNode*> apcNodes;
- apcNodes.reserve(aiList.size() + pcScene->mRootNode->mNumChildren);
-
- for (unsigned int i = 0; i < pcScene->mRootNode->mNumChildren;++i)
- apcNodes.push_back(pcScene->mRootNode->mChildren[i]);
-
- delete[] pcScene->mRootNode->mChildren;
- for (std::vector<const BaseNode*>::/*const_*/iterator i = aiList.begin();i != aiList.end();++i) {
- const ASE::BaseNode* src = *i;
-
- // The parent is not known, so we can assume that we must add
- // this node to the root node of the whole scene
- aiNode* pcNode = new aiNode();
- pcNode->mParent = pcScene->mRootNode;
- pcNode->mName.Set(src->mName);
- AddMeshes(src,pcNode);
- AddNodes(nodes,pcNode,pcNode->mName.data);
- apcNodes.push_back(pcNode);
- }
-
- // Regenerate our output array
- pcScene->mRootNode->mChildren = new aiNode*[apcNodes.size()];
- for (unsigned int i = 0; i < apcNodes.size();++i)
- pcScene->mRootNode->mChildren[i] = apcNodes[i];
-
- pcScene->mRootNode->mNumChildren = (unsigned int)apcNodes.size();
- }
-
- // Reset the third color set to NULL - we used this field to store a temporary pointer
- for (unsigned int i = 0; i < pcScene->mNumMeshes;++i)
- pcScene->mMeshes[i]->mColors[2] = NULL;
-
- // The root node should not have at least one child or the file is valid
- if (!pcScene->mRootNode->mNumChildren) {
- throw DeadlyImportError("ASE: No nodes loaded. The file is either empty or corrupt");
- }
-
- // Now rotate the whole scene 90 degrees around the x axis to convert to internal coordinate system
- pcScene->mRootNode->mTransformation = aiMatrix4x4(1.f,0.f,0.f,0.f,
- 0.f,0.f,1.f,0.f,0.f,-1.f,0.f,0.f,0.f,0.f,0.f,1.f);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Convert the imported data to the internal verbose representation
-void ASEImporter::BuildUniqueRepresentation(ASE::Mesh& mesh) {
- // allocate output storage
- std::vector<aiVector3D> mPositions;
- std::vector<aiVector3D> amTexCoords[AI_MAX_NUMBER_OF_TEXTURECOORDS];
- std::vector<aiColor4D> mVertexColors;
- std::vector<aiVector3D> mNormals;
- std::vector<BoneVertex> mBoneVertices;
-
- unsigned int iSize = (unsigned int)mesh.mFaces.size() * 3;
- mPositions.resize(iSize);
-
- // optional texture coordinates
- for (unsigned int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS;++i) {
- if (!mesh.amTexCoords[i].empty()) {
- amTexCoords[i].resize(iSize);
- }
- }
- // optional vertex colors
- if (!mesh.mVertexColors.empty()) {
- mVertexColors.resize(iSize);
- }
-
- // optional vertex normals (vertex normals can simply be copied)
- if (!mesh.mNormals.empty()) {
- mNormals.resize(iSize);
- }
- // bone vertices. There is no need to change the bone list
- if (!mesh.mBoneVertices.empty()) {
- mBoneVertices.resize(iSize);
- }
-
- // iterate through all faces in the mesh
- unsigned int iCurrent = 0, fi = 0;
- for (std::vector<ASE::Face>::iterator i = mesh.mFaces.begin();i != mesh.mFaces.end();++i,++fi) {
- for (unsigned int n = 0; n < 3;++n,++iCurrent)
- {
- mPositions[iCurrent] = mesh.mPositions[(*i).mIndices[n]];
-
- // add texture coordinates
- for (unsigned int c = 0; c < AI_MAX_NUMBER_OF_TEXTURECOORDS;++c) {
- if (mesh.amTexCoords[c].empty())break;
- amTexCoords[c][iCurrent] = mesh.amTexCoords[c][(*i).amUVIndices[c][n]];
- }
- // add vertex colors
- if (!mesh.mVertexColors.empty()) {
- mVertexColors[iCurrent] = mesh.mVertexColors[(*i).mColorIndices[n]];
- }
- // add normal vectors
- if (!mesh.mNormals.empty()) {
- mNormals[iCurrent] = mesh.mNormals[fi*3+n];
- mNormals[iCurrent].Normalize();
- }
-
- // handle bone vertices
- if ((*i).mIndices[n] < mesh.mBoneVertices.size()) {
- // (sometimes this will cause bone verts to be duplicated
- // however, I' quite sure Schrompf' JoinVerticesStep
- // will fix that again ...)
- mBoneVertices[iCurrent] = mesh.mBoneVertices[(*i).mIndices[n]];
- }
- (*i).mIndices[n] = iCurrent;
- }
- }
-
- // replace the old arrays
- mesh.mNormals = mNormals;
- mesh.mPositions = mPositions;
- mesh.mVertexColors = mVertexColors;
-
- for (unsigned int c = 0; c < AI_MAX_NUMBER_OF_TEXTURECOORDS;++c)
- mesh.amTexCoords[c] = amTexCoords[c];
-}
-
-// ------------------------------------------------------------------------------------------------
-// Copy a texture from the ASE structs to the output material
-void CopyASETexture(MaterialHelper& mat, ASE::Texture& texture, aiTextureType type)
-{
- // Setup the texture name
- aiString tex;
- tex.Set( texture.mMapName);
- mat.AddProperty( &tex, AI_MATKEY_TEXTURE(type,0));
-
- // Setup the texture blend factor
- if (is_not_qnan(texture.mTextureBlend))
- mat.AddProperty<float>( &texture.mTextureBlend, 1, AI_MATKEY_TEXBLEND(type,0));
-
- // Setup texture UV transformations
- mat.AddProperty<float>(&texture.mOffsetU,5,AI_MATKEY_UVTRANSFORM(type,0));
-}
-
-// ------------------------------------------------------------------------------------------------
-// Convert from ASE material to output material
-void ASEImporter::ConvertMaterial(ASE::Material& mat)
-{
- // LARGE TODO: Much code her is copied from 3DS ... join them maybe?
-
- // Allocate the output material
- mat.pcInstance = new MaterialHelper();
-
- // At first add the base ambient color of the
- // scene to the material
- mat.mAmbient.r += mParser->m_clrAmbient.r;
- mat.mAmbient.g += mParser->m_clrAmbient.g;
- mat.mAmbient.b += mParser->m_clrAmbient.b;
-
- aiString name;
- name.Set( mat.mName);
- mat.pcInstance->AddProperty( &name, AI_MATKEY_NAME);
-
- // material colors
- mat.pcInstance->AddProperty( &mat.mAmbient, 1, AI_MATKEY_COLOR_AMBIENT);
- mat.pcInstance->AddProperty( &mat.mDiffuse, 1, AI_MATKEY_COLOR_DIFFUSE);
- mat.pcInstance->AddProperty( &mat.mSpecular, 1, AI_MATKEY_COLOR_SPECULAR);
- mat.pcInstance->AddProperty( &mat.mEmissive, 1, AI_MATKEY_COLOR_EMISSIVE);
-
- // shininess
- if (0.0f != mat.mSpecularExponent && 0.0f != mat.mShininessStrength)
- {
- mat.pcInstance->AddProperty( &mat.mSpecularExponent, 1, AI_MATKEY_SHININESS);
- mat.pcInstance->AddProperty( &mat.mShininessStrength, 1, AI_MATKEY_SHININESS_STRENGTH);
- }
- // If there is no shininess, we can disable phong lighting
- else if (D3DS::Discreet3DS::Metal == mat.mShading ||
- D3DS::Discreet3DS::Phong == mat.mShading ||
- D3DS::Discreet3DS::Blinn == mat.mShading)
- {
- mat.mShading = D3DS::Discreet3DS::Gouraud;
- }
-
- // opacity
- mat.pcInstance->AddProperty<float>( &mat.mTransparency,1,AI_MATKEY_OPACITY);
-
- // Two sided rendering?
- if (mat.mTwoSided)
- {
- int i = 1;
- mat.pcInstance->AddProperty<int>(&i,1,AI_MATKEY_TWOSIDED);
- }
-
- // shading mode
- aiShadingMode eShading = aiShadingMode_NoShading;
- switch (mat.mShading)
- {
- case D3DS::Discreet3DS::Flat:
- eShading = aiShadingMode_Flat; break;
- case D3DS::Discreet3DS::Phong :
- eShading = aiShadingMode_Phong; break;
- case D3DS::Discreet3DS::Blinn :
- eShading = aiShadingMode_Blinn; break;
-
- // I don't know what "Wire" shading should be,
- // assume it is simple lambertian diffuse (L dot N) shading
- case D3DS::Discreet3DS::Wire:
- {
- // set the wireframe flag
- unsigned int iWire = 1;
- mat.pcInstance->AddProperty<int>( (int*)&iWire,1,AI_MATKEY_ENABLE_WIREFRAME);
- }
- case D3DS::Discreet3DS::Gouraud:
- eShading = aiShadingMode_Gouraud; break;
- case D3DS::Discreet3DS::Metal :
- eShading = aiShadingMode_CookTorrance; break;
- }
- mat.pcInstance->AddProperty<int>( (int*)&eShading,1,AI_MATKEY_SHADING_MODEL);
-
- // DIFFUSE texture
- if ( mat.sTexDiffuse.mMapName.length() > 0)
- CopyASETexture(*mat.pcInstance,mat.sTexDiffuse, aiTextureType_DIFFUSE);
-
- // SPECULAR texture
- if ( mat.sTexSpecular.mMapName.length() > 0)
- CopyASETexture(*mat.pcInstance,mat.sTexSpecular, aiTextureType_SPECULAR);
-
- // AMBIENT texture
- if ( mat.sTexAmbient.mMapName.length() > 0)
- CopyASETexture(*mat.pcInstance,mat.sTexAmbient, aiTextureType_AMBIENT);
-
- // OPACITY texture
- if ( mat.sTexOpacity.mMapName.length() > 0)
- CopyASETexture(*mat.pcInstance,mat.sTexOpacity, aiTextureType_OPACITY);
-
- // EMISSIVE texture
- if ( mat.sTexEmissive.mMapName.length() > 0)
- CopyASETexture(*mat.pcInstance,mat.sTexEmissive, aiTextureType_EMISSIVE);
-
- // BUMP texture
- if ( mat.sTexBump.mMapName.length() > 0)
- CopyASETexture(*mat.pcInstance,mat.sTexBump, aiTextureType_HEIGHT);
-
- // SHININESS texture
- if ( mat.sTexShininess.mMapName.length() > 0)
- CopyASETexture(*mat.pcInstance,mat.sTexShininess, aiTextureType_SHININESS);
-
- // store the name of the material itself, too
- if ( mat.mName.length() > 0) {
- aiString tex;tex.Set( mat.mName);
- mat.pcInstance->AddProperty( &tex, AI_MATKEY_NAME);
- }
- return;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Build output meshes
-void ASEImporter::ConvertMeshes(ASE::Mesh& mesh, std::vector<aiMesh*>& avOutMeshes)
-{
- // validate the material index of the mesh
- if (mesh.iMaterialIndex >= mParser->m_vMaterials.size()) {
- mesh.iMaterialIndex = (unsigned int)mParser->m_vMaterials.size()-1;
- DefaultLogger::get()->warn("Material index is out of range");
- }
-
- // If the material the mesh is assigned to is consisting of submeshes, split it
- if (!mParser->m_vMaterials[mesh.iMaterialIndex].avSubMaterials.empty()) {
- std::vector<ASE::Material> vSubMaterials = mParser->
- m_vMaterials[mesh.iMaterialIndex].avSubMaterials;
-
- std::vector<unsigned int>* aiSplit = new std::vector<unsigned int>[vSubMaterials.size()];
-
- // build a list of all faces per submaterial
- for (unsigned int i = 0; i < mesh.mFaces.size();++i) {
- // check range
- if (mesh.mFaces[i].iMaterial >= vSubMaterials.size()) {
- DefaultLogger::get()->warn("Submaterial index is out of range");
-
- // use the last material instead
- aiSplit[vSubMaterials.size()-1].push_back(i);
- }
- else aiSplit[mesh.mFaces[i].iMaterial].push_back(i);
- }
-
- // now generate submeshes
- for (unsigned int p = 0; p < vSubMaterials.size();++p) {
- if (!aiSplit[p].empty()) {
-
- aiMesh* p_pcOut = new aiMesh();
- p_pcOut->mPrimitiveTypes = aiPrimitiveType_TRIANGLE;
-
- // let the sub material index
- p_pcOut->mMaterialIndex = p;
-
- // we will need this material
- mParser->m_vMaterials[mesh.iMaterialIndex].avSubMaterials[p].bNeed = true;
-
- // store the real index here ... color channel 3
- p_pcOut->mColors[3] = (aiColor4D*)(uintptr_t)mesh.iMaterialIndex;
-
- // store a pointer to the mesh in color channel 2
- p_pcOut->mColors[2] = (aiColor4D*) &mesh;
- avOutMeshes.push_back(p_pcOut);
-
- // convert vertices
- p_pcOut->mNumVertices = (unsigned int)aiSplit[p].size()*3;
- p_pcOut->mNumFaces = (unsigned int)aiSplit[p].size();
-
- // receive output vertex weights
- std::vector<std::pair<unsigned int, float> > *avOutputBones = NULL;
- if (!mesh.mBones.empty()) {
- avOutputBones = new std::vector<std::pair<unsigned int, float> >[mesh.mBones.size()];
- }
-
- // allocate enough storage for faces
- p_pcOut->mFaces = new aiFace[p_pcOut->mNumFaces];
-
- unsigned int iBase = 0,iIndex;
- if (p_pcOut->mNumVertices) {
- p_pcOut->mVertices = new aiVector3D[p_pcOut->mNumVertices];
- p_pcOut->mNormals = new aiVector3D[p_pcOut->mNumVertices];
- for (unsigned int q = 0; q < aiSplit[p].size();++q) {
-
- iIndex = aiSplit[p][q];
-
- p_pcOut->mFaces[q].mIndices = new unsigned int[3];
- p_pcOut->mFaces[q].mNumIndices = 3;
-
- for (unsigned int t = 0; t < 3;++t, ++iBase) {
- const uint32_t iIndex2 = mesh.mFaces[iIndex].mIndices[t];
-
- p_pcOut->mVertices[iBase] = mesh.mPositions [iIndex2];
- p_pcOut->mNormals [iBase] = mesh.mNormals [iIndex2];
-
- // convert bones, if existing
- if (!mesh.mBones.empty()) {
- // check whether there is a vertex weight for this vertex index
- if (iIndex2 < mesh.mBoneVertices.size()) {
-
- for (std::vector<std::pair<int,float> >::const_iterator
- blubb = mesh.mBoneVertices[iIndex2].mBoneWeights.begin();
- blubb != mesh.mBoneVertices[iIndex2].mBoneWeights.end();++blubb) {
-
- // NOTE: illegal cases have already been filtered out
- avOutputBones[(*blubb).first].push_back(std::pair<unsigned int, float>(
- iBase,(*blubb).second));
- }
- }
- }
- p_pcOut->mFaces[q].mIndices[t] = iBase;
- }
- }
- }
- // convert texture coordinates (up to AI_MAX_NUMBER_OF_TEXTURECOORDS sets supported)
- for (unsigned int c = 0; c < AI_MAX_NUMBER_OF_TEXTURECOORDS;++c) {
- if (!mesh.amTexCoords[c].empty())
- {
- p_pcOut->mTextureCoords[c] = new aiVector3D[p_pcOut->mNumVertices];
- iBase = 0;
- for (unsigned int q = 0; q < aiSplit[p].size();++q) {
- iIndex = aiSplit[p][q];
- for (unsigned int t = 0; t < 3;++t) {
- p_pcOut->mTextureCoords[c][iBase++] = mesh.amTexCoords[c][mesh.mFaces[iIndex].mIndices[t]];
- }
- }
- // Setup the number of valid vertex components
- p_pcOut->mNumUVComponents[c] = mesh.mNumUVComponents[c];
- }
- }
-
- // Convert vertex colors (only one set supported)
- if (!mesh.mVertexColors.empty()){
- p_pcOut->mColors[0] = new aiColor4D[p_pcOut->mNumVertices];
- iBase = 0;
- for (unsigned int q = 0; q < aiSplit[p].size();++q) {
- iIndex = aiSplit[p][q];
- for (unsigned int t = 0; t < 3;++t) {
- p_pcOut->mColors[0][iBase++] = mesh.mVertexColors[mesh.mFaces[iIndex].mIndices[t]];
- }
- }
- }
- // Copy bones
- if (!mesh.mBones.empty()) {
- p_pcOut->mNumBones = 0;
- for (unsigned int mrspock = 0; mrspock < mesh.mBones.size();++mrspock)
- if (!avOutputBones[mrspock].empty())p_pcOut->mNumBones++;
-
- p_pcOut->mBones = new aiBone* [ p_pcOut->mNumBones ];
- aiBone** pcBone = p_pcOut->mBones;
- for (unsigned int mrspock = 0; mrspock < mesh.mBones.size();++mrspock)
- {
- if (!avOutputBones[mrspock].empty()) {
- // we will need this bone. add it to the output mesh and
- // add all per-vertex weights
- aiBone* pc = *pcBone = new aiBone();
- pc->mName.Set(mesh.mBones[mrspock].mName);
-
- pc->mNumWeights = (unsigned int)avOutputBones[mrspock].size();
- pc->mWeights = new aiVertexWeight[pc->mNumWeights];
-
- for (unsigned int captainkirk = 0; captainkirk < pc->mNumWeights;++captainkirk)
- {
- const std::pair<unsigned int,float>& ref = avOutputBones[mrspock][captainkirk];
- pc->mWeights[captainkirk].mVertexId = ref.first;
- pc->mWeights[captainkirk].mWeight = ref.second;
- }
- ++pcBone;
- }
- }
- // delete allocated storage
- delete[] avOutputBones;
- }
- }
- }
- // delete storage
- delete[] aiSplit;
- }
- else
- {
- // Otherwise we can simply copy the data to one output mesh
- // This codepath needs less memory and uses fast memcpy()s
- // to do the actual copying. So I think it is worth the
- // effort here.
-
- aiMesh* p_pcOut = new aiMesh();
- p_pcOut->mPrimitiveTypes = aiPrimitiveType_TRIANGLE;
-
- // set an empty sub material index
- p_pcOut->mMaterialIndex = ASE::Face::DEFAULT_MATINDEX;
- mParser->m_vMaterials[mesh.iMaterialIndex].bNeed = true;
-
- // store the real index here ... in color channel 3
- p_pcOut->mColors[3] = (aiColor4D*)(uintptr_t)mesh.iMaterialIndex;
-
- // store a pointer to the mesh in color channel 2
- p_pcOut->mColors[2] = (aiColor4D*) &mesh;
- avOutMeshes.push_back(p_pcOut);
-
- // If the mesh hasn't faces or vertices, there are two cases
- // possible: 1. the model is invalid. 2. This is a dummy
- // helper object which we are going to remove later ...
- if (mesh.mFaces.empty() || mesh.mPositions.empty()) {
- return;
- }
-
- // convert vertices
- p_pcOut->mNumVertices = (unsigned int)mesh.mPositions.size();
- p_pcOut->mNumFaces = (unsigned int)mesh.mFaces.size();
-
- // allocate enough storage for faces
- p_pcOut->mFaces = new aiFace[p_pcOut->mNumFaces];
-
- // copy vertices
- p_pcOut->mVertices = new aiVector3D[mesh.mPositions.size()];
- memcpy(p_pcOut->mVertices,&mesh.mPositions[0],
- mesh.mPositions.size() * sizeof(aiVector3D));
-
- // copy normals
- p_pcOut->mNormals = new aiVector3D[mesh.mNormals.size()];
- memcpy(p_pcOut->mNormals,&mesh.mNormals[0],
- mesh.mNormals.size() * sizeof(aiVector3D));
-
- // copy texture coordinates
- for (unsigned int c = 0; c < AI_MAX_NUMBER_OF_TEXTURECOORDS;++c) {
- if (!mesh.amTexCoords[c].empty()) {
- p_pcOut->mTextureCoords[c] = new aiVector3D[mesh.amTexCoords[c].size()];
- memcpy(p_pcOut->mTextureCoords[c],&mesh.amTexCoords[c][0],
- mesh.amTexCoords[c].size() * sizeof(aiVector3D));
-
- // setup the number of valid vertex components
- p_pcOut->mNumUVComponents[c] = mesh.mNumUVComponents[c];
- }
- }
-
- // copy vertex colors
- if (!mesh.mVertexColors.empty()) {
- p_pcOut->mColors[0] = new aiColor4D[mesh.mVertexColors.size()];
- memcpy(p_pcOut->mColors[0],&mesh.mVertexColors[0],
- mesh.mVertexColors.size() * sizeof(aiColor4D));
- }
-
- // copy faces
- for (unsigned int iFace = 0; iFace < p_pcOut->mNumFaces;++iFace) {
- p_pcOut->mFaces[iFace].mNumIndices = 3;
- p_pcOut->mFaces[iFace].mIndices = new unsigned int[3];
-
- // copy indices
- p_pcOut->mFaces[iFace].mIndices[0] = mesh.mFaces[iFace].mIndices[0];
- p_pcOut->mFaces[iFace].mIndices[1] = mesh.mFaces[iFace].mIndices[1];
- p_pcOut->mFaces[iFace].mIndices[2] = mesh.mFaces[iFace].mIndices[2];
- }
-
- // copy vertex bones
- if (!mesh.mBones.empty() && !mesh.mBoneVertices.empty()) {
- std::vector<aiVertexWeight>* avBonesOut = new std::vector<aiVertexWeight>[mesh.mBones.size()];
-
- // find all vertex weights for this bone
- unsigned int quak = 0;
- for (std::vector<BoneVertex>::const_iterator harrypotter = mesh.mBoneVertices.begin();
- harrypotter != mesh.mBoneVertices.end();++harrypotter,++quak) {
-
- for (std::vector<std::pair<int,float> >::const_iterator
- ronaldweasley = (*harrypotter).mBoneWeights.begin();
- ronaldweasley != (*harrypotter).mBoneWeights.end();++ronaldweasley)
- {
- aiVertexWeight weight;
- weight.mVertexId = quak;
- weight.mWeight = (*ronaldweasley).second;
- avBonesOut[(*ronaldweasley).first].push_back(weight);
- }
- }
-
- // now build a final bone list
- p_pcOut->mNumBones = 0;
- for (unsigned int jfkennedy = 0; jfkennedy < mesh.mBones.size();++jfkennedy)
- if (!avBonesOut[jfkennedy].empty())p_pcOut->mNumBones++;
-
- p_pcOut->mBones = new aiBone*[p_pcOut->mNumBones];
- aiBone** pcBone = p_pcOut->mBones;
- for (unsigned int jfkennedy = 0; jfkennedy < mesh.mBones.size();++jfkennedy) {
- if (!avBonesOut[jfkennedy].empty()) {
- aiBone* pc = *pcBone = new aiBone();
- pc->mName.Set(mesh.mBones[jfkennedy].mName);
- pc->mNumWeights = (unsigned int)avBonesOut[jfkennedy].size();
- pc->mWeights = new aiVertexWeight[pc->mNumWeights];
- ::memcpy(pc->mWeights,&avBonesOut[jfkennedy][0],
- sizeof(aiVertexWeight) * pc->mNumWeights);
- ++pcBone;
- }
- }
-
- // delete allocated storage
- delete[] avBonesOut;
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Setup proper material indices and build output materials
-void ASEImporter::BuildMaterialIndices()
-{
- ai_assert(NULL != pcScene);
-
- // iterate through all materials and check whether we need them
- for (unsigned int iMat = 0; iMat < mParser->m_vMaterials.size();++iMat)
- {
- ASE::Material& mat = mParser->m_vMaterials[iMat];
- if (mat.bNeed) {
- // Convert it to the aiMaterial layout
- ConvertMaterial(mat);
- ++pcScene->mNumMaterials;
- }
- for (unsigned int iSubMat = 0; iSubMat < mat.avSubMaterials.size();++iSubMat)
- {
- ASE::Material& submat = mat.avSubMaterials[iSubMat];
- if (submat.bNeed) {
- // Convert it to the aiMaterial layout
- ConvertMaterial(submat);
- ++pcScene->mNumMaterials;
- }
- }
- }
-
- // allocate the output material array
- pcScene->mMaterials = new aiMaterial*[pcScene->mNumMaterials];
- D3DS::Material** pcIntMaterials = new D3DS::Material*[pcScene->mNumMaterials];
-
- unsigned int iNum = 0;
- for (unsigned int iMat = 0; iMat < mParser->m_vMaterials.size();++iMat) {
- ASE::Material& mat = mParser->m_vMaterials[iMat];
- if (mat.bNeed)
- {
- ai_assert(NULL != mat.pcInstance);
- pcScene->mMaterials[iNum] = mat.pcInstance;
-
- // Store the internal material, too
- pcIntMaterials[iNum] = &mat;
-
- // Iterate through all meshes and search for one which is using
- // this top-level material index
- for (unsigned int iMesh = 0; iMesh < pcScene->mNumMeshes;++iMesh)
- {
- aiMesh* mesh = pcScene->mMeshes[iMesh];
- if (ASE::Face::DEFAULT_MATINDEX == mesh->mMaterialIndex &&
- iMat == (uintptr_t)mesh->mColors[3])
- {
- mesh->mMaterialIndex = iNum;
- mesh->mColors[3] = NULL;
- }
- }
- iNum++;
- }
- for (unsigned int iSubMat = 0; iSubMat < mat.avSubMaterials.size();++iSubMat) {
- ASE::Material& submat = mat.avSubMaterials[iSubMat];
- if (submat.bNeed) {
- ai_assert(NULL != submat.pcInstance);
- pcScene->mMaterials[iNum] = submat.pcInstance;
-
- // Store the internal material, too
- pcIntMaterials[iNum] = &submat;
-
- // Iterate through all meshes and search for one which is using
- // this sub-level material index
- for (unsigned int iMesh = 0; iMesh < pcScene->mNumMeshes;++iMesh) {
- aiMesh* mesh = pcScene->mMeshes[iMesh];
-
- if (iSubMat == mesh->mMaterialIndex && iMat == (uintptr_t)mesh->mColors[3]) {
- mesh->mMaterialIndex = iNum;
- mesh->mColors[3] = NULL;
- }
- }
- iNum++;
- }
- }
- }
-
- // Dekete our temporary array
- delete[] pcIntMaterials;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Generate normal vectors basing on smoothing groups
-bool ASEImporter::GenerateNormals(ASE::Mesh& mesh) {
-
- if (!mesh.mNormals.empty() && !configRecomputeNormals)
- {
- // Check whether there are only uninitialized normals. If there are
- // some, skip all normals from the file and compute them on our own
- for (std::vector<aiVector3D>::const_iterator qq = mesh.mNormals.begin();qq != mesh.mNormals.end();++qq) {
- if ((*qq).x || (*qq).y || (*qq).z)
- {
- return true;
- }
- }
- }
- // The array is reused.
- ComputeNormalsWithSmoothingsGroups<ASE::Face>(mesh);
- return false;
-}
-
-#endif // !! ASSIMP_BUILD_NO_BASE_IMPORTER
diff --git a/3rdparty/assimp/code/ASELoader.h b/3rdparty/assimp/code/ASELoader.h
deleted file mode 100644
index 5a117ba2..00000000
--- a/3rdparty/assimp/code/ASELoader.h
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file ASELoader.h
- * @brief Definition of the .ASE importer class.
- */
-#ifndef AI_ASELOADER_H_INCLUDED
-#define AI_ASELOADER_H_INCLUDED
-
-#include "BaseImporter.h"
-#include "../include/aiTypes.h"
-
-struct aiNode;
-#include "ASEParser.h"
-
-namespace Assimp {
-class MaterialHelper;
-
-// --------------------------------------------------------------------------------
-/** Importer class for the 3DS ASE ASCII format.
- *
- */
-class ASEImporter : public BaseImporter {
- friend class Importer;
-
-protected:
- /** Constructor to be privately used by Importer */
- ASEImporter();
-
- /** Destructor, private as well */
- ~ASEImporter();
-
-public:
-
- // -------------------------------------------------------------------
- /** Returns whether the class can handle the format of the given file.
- * See BaseImporter::CanRead() for details.
- */
- bool CanRead( const std::string& pFile, IOSystem* pIOHandler,
- bool checkSig) const;
-
-protected:
-
- // -------------------------------------------------------------------
- /** Called by Importer::GetExtensionList() for each loaded importer.
- * See BaseImporter::GetExtensionList() for details
- */
- void GetExtensionList(std::set<std::string>& extensions);
-
-
- // -------------------------------------------------------------------
- /** Imports the given file into the given scene structure.
- * See BaseImporter::InternReadFile() for details
- */
- void InternReadFile( const std::string& pFile, aiScene* pScene,
- IOSystem* pIOHandler);
-
-
- // -------------------------------------------------------------------
- /** Called prior to ReadFile().
- * The function is a request to the importer to update its configuration
- * basing on the Importer's configuration property list.
- */
- void SetupProperties(const Importer* pImp);
-
-
-private:
-
- // -------------------------------------------------------------------
- /** Generate normal vectors basing on smoothing groups
- * (in some cases the normal are already contained in the file)
- * \param mesh Mesh to work on
- * \return false if the normals have been recomputed
- */
- bool GenerateNormals(ASE::Mesh& mesh);
-
-
- // -------------------------------------------------------------------
- /** Create valid vertex/normal/UV/color/face lists.
- * All elements are unique, faces have only one set of indices
- * after this step occurs.
- * \param mesh Mesh to work on
- */
- void BuildUniqueRepresentation(ASE::Mesh& mesh);
-
-
- /** Create one-material-per-mesh meshes ;-)
- * \param mesh Mesh to work with
- * \param Receives the list of all created meshes
- */
- void ConvertMeshes(ASE::Mesh& mesh, std::vector<aiMesh*>& avOut);
-
-
- // -------------------------------------------------------------------
- /** Convert a material to a MaterialHelper object
- * \param mat Input material
- */
- void ConvertMaterial(ASE::Material& mat);
-
-
- // -------------------------------------------------------------------
- /** Setup the final material indices for each mesh
- */
- void BuildMaterialIndices();
-
-
- // -------------------------------------------------------------------
- /** Build the node graph
- */
- void BuildNodes(std::vector<ASE::BaseNode*>& nodes);
-
-
- // -------------------------------------------------------------------
- /** Build output cameras
- */
- void BuildCameras();
-
-
- // -------------------------------------------------------------------
- /** Build output lights
- */
- void BuildLights();
-
-
- // -------------------------------------------------------------------
- /** Build output animations
- */
- void BuildAnimations(const std::vector<ASE::BaseNode*>& nodes);
-
-
- // -------------------------------------------------------------------
- /** Add sub nodes to a node
- * \param pcParent parent node to be filled
- * \param szName Name of the parent node
- * \param matrix Current transform
- */
- void AddNodes(const std::vector<ASE::BaseNode*>& nodes,
- aiNode* pcParent,const char* szName);
-
- void AddNodes(const std::vector<ASE::BaseNode*>& nodes,
- aiNode* pcParent,const char* szName,
- const aiMatrix4x4& matrix);
-
- void AddMeshes(const ASE::BaseNode* snode,aiNode* node);
-
- // -------------------------------------------------------------------
- /** Generate a default material and add it to the parser's list
- * Called if no material has been found in the file (rare for ASE,
- * but not impossible)
- */
- void GenerateDefaultMaterial();
-
-protected:
-
- /** Parser instance */
- ASE::Parser* mParser;
-
- /** Buffer to hold the loaded file */
- char* mBuffer;
-
- /** Scene to be filled */
- aiScene* pcScene;
-
- /** Config options: Recompute the normals in every case - WA
- for 3DS Max broken ASE normal export */
- bool configRecomputeNormals;
-};
-
-} // end of namespace Assimp
-
-#endif // AI_3DSIMPORTER_H_INC
diff --git a/3rdparty/assimp/code/ASEParser.cpp b/3rdparty/assimp/code/ASEParser.cpp
deleted file mode 100644
index a37fb869..00000000
--- a/3rdparty/assimp/code/ASEParser.cpp
+++ /dev/null
@@ -1,2150 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file ASEParser.cpp
- * @brief Implementation of the ASE parser class
- */
-
-#include "AssimpPCH.h"
-
-// internal headers
-#include "TextureTransform.h"
-#include "ASELoader.h"
-#include "MaterialSystem.h"
-#include "fast_atof.h"
-
-using namespace Assimp;
-using namespace Assimp::ASE;
-
-
-// ------------------------------------------------------------------------------------------------
-// Begin an ASE parsing function
-
-#define AI_ASE_PARSER_INIT() \
- int iDepth = 0;
-
-// ------------------------------------------------------------------------------------------------
-// Handle a "top-level" section in the file. EOF is no error in this case.
-
-#define AI_ASE_HANDLE_TOP_LEVEL_SECTION() \
- else if ('{' == *filePtr)iDepth++; \
- else if ('}' == *filePtr) \
- { \
- if (0 == --iDepth) \
- { \
- ++filePtr; \
- SkipToNextToken(); \
- return; \
- } \
- } \
- else if ('\0' == *filePtr) \
- { \
- return; \
- } \
- if(IsLineEnd(*filePtr) && !bLastWasEndLine) \
- { \
- ++iLineNumber; \
- bLastWasEndLine = true; \
- } else bLastWasEndLine = false; \
- ++filePtr;
-
-// ------------------------------------------------------------------------------------------------
-// Handle a nested section in the file. EOF is an error in this case
-// @param level "Depth" of the section
-// @param msg Full name of the section (including the asterisk)
-
-#define AI_ASE_HANDLE_SECTION(level, msg) \
- if ('{' == *filePtr)iDepth++; \
- else if ('}' == *filePtr) \
- { \
- if (0 == --iDepth) \
- { \
- ++filePtr; \
- SkipToNextToken(); \
- return; \
- } \
- } \
- else if ('\0' == *filePtr) \
- { \
- LogError("Encountered unexpected EOL while parsing a " msg \
- " chunk (Level " level ")"); \
- } \
- if(IsLineEnd(*filePtr) && !bLastWasEndLine) \
- { \
- ++iLineNumber; \
- bLastWasEndLine = true; \
- } else bLastWasEndLine = false; \
- ++filePtr;
-
-// ------------------------------------------------------------------------------------------------
-Parser::Parser (const char* szFile, unsigned int fileFormatDefault)
-{
- ai_assert(NULL != szFile);
- filePtr = szFile;
- iFileFormat = fileFormatDefault;
-
- // make sure that the color values are invalid
- m_clrBackground.r = get_qnan();
- m_clrAmbient.r = get_qnan();
-
- // setup some default values
- iLineNumber = 0;
- iFirstFrame = 0;
- iLastFrame = 0;
- iFrameSpeed = 30; // use 30 as default value for this property
- iTicksPerFrame = 1; // use 1 as default value for this property
- bLastWasEndLine = false; // need to handle \r\n seqs due to binary file mapping
-}
-
-// ------------------------------------------------------------------------------------------------
-void Parser::LogWarning(const char* szWarn)
-{
- ai_assert(NULL != szWarn);
-
- char szTemp[1024];
-#if _MSC_VER >= 1400
- sprintf_s(szTemp,"Line %i: %s",iLineNumber,szWarn);
-#else
- snprintf(szTemp,1024,"Line %i: %s",iLineNumber,szWarn);
-#endif
-
- // output the warning to the logger ...
- DefaultLogger::get()->warn(szTemp);
-}
-
-// ------------------------------------------------------------------------------------------------
-void Parser::LogInfo(const char* szWarn)
-{
- ai_assert(NULL != szWarn);
-
- char szTemp[1024];
-#if _MSC_VER >= 1400
- sprintf_s(szTemp,"Line %i: %s",iLineNumber,szWarn);
-#else
- snprintf(szTemp,1024,"Line %i: %s",iLineNumber,szWarn);
-#endif
-
- // output the information to the logger ...
- DefaultLogger::get()->info(szTemp);
-}
-
-// ------------------------------------------------------------------------------------------------
-void Parser::LogError(const char* szWarn)
-{
- ai_assert(NULL != szWarn);
-
- char szTemp[1024];
-#if _MSC_VER >= 1400
- sprintf_s(szTemp,"Line %i: %s",iLineNumber,szWarn);
-#else
- snprintf(szTemp,1024,"Line %i: %s",iLineNumber,szWarn);
-#endif
-
- // throw an exception
- throw DeadlyImportError(szTemp);
-}
-
-// ------------------------------------------------------------------------------------------------
-bool Parser::SkipToNextToken()
-{
- while (true)
- {
- char me = *filePtr;
-
- // increase the line number counter if necessary
- if (IsLineEnd(me) && !bLastWasEndLine)
- {
- ++iLineNumber;
- bLastWasEndLine = true;
- }
- else bLastWasEndLine = false;
- if ('*' == me || '}' == me || '{' == me)return true;
- if ('\0' == me)return false;
-
- ++filePtr;
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-bool Parser::SkipSection()
-{
- // must handle subsections ...
- int iCnt = 0;
- while (true)
- {
- if ('}' == *filePtr)
- {
- --iCnt;
- if (0 == iCnt)
- {
- // go to the next valid token ...
- ++filePtr;
- SkipToNextToken();
- return true;
- }
- }
- else if ('{' == *filePtr)
- {
- ++iCnt;
- }
- else if ('\0' == *filePtr)
- {
- LogWarning("Unable to parse block: Unexpected EOF, closing bracket \'}\' was expected [#1]");
- return false;
- }
- else if(IsLineEnd(*filePtr))++iLineNumber;
- ++filePtr;
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void Parser::Parse()
-{
- AI_ASE_PARSER_INIT();
- while (true)
- {
- if ('*' == *filePtr)
- {
- ++filePtr;
-
- // Version should be 200. Validate this ...
- if (TokenMatch(filePtr,"3DSMAX_ASCIIEXPORT",18))
- {
- unsigned int fmt;
- ParseLV4MeshLong(fmt);
-
- if (fmt > 200)
- {
- LogWarning("Unknown file format version: *3DSMAX_ASCIIEXPORT should \
- be <= 200");
- }
- // *************************************************************
- // - fmt will be 0 if we're unable to read the version number
- // there are some faulty files without a version number ...
- // in this case we'll guess the exact file format by looking
- // at the file extension (ASE, ASK, ASC)
- // *************************************************************
-
- if (fmt)iFileFormat = fmt;
- continue;
- }
- // main scene information
- if (TokenMatch(filePtr,"SCENE",5))
- {
- ParseLV1SceneBlock();
- continue;
- }
- // "group" - no implementation yet, in facte
- // we're just ignoring them for the moment
- if (TokenMatch(filePtr,"GROUP",5))
- {
- Parse();
- continue;
- }
- // material list
- if (TokenMatch(filePtr,"MATERIAL_LIST",13))
- {
- ParseLV1MaterialListBlock();
- continue;
- }
- // geometric object (mesh)
- if (TokenMatch(filePtr,"GEOMOBJECT",10))
-
- {
- m_vMeshes.push_back(Mesh());
- ParseLV1ObjectBlock(m_vMeshes.back());
- continue;
- }
- // helper object = dummy in the hierarchy
- if (TokenMatch(filePtr,"HELPEROBJECT",12))
-
- {
- m_vDummies.push_back(Dummy());
- ParseLV1ObjectBlock(m_vDummies.back());
- continue;
- }
- // light object
- if (TokenMatch(filePtr,"LIGHTOBJECT",11))
-
- {
- m_vLights.push_back(Light());
- ParseLV1ObjectBlock(m_vLights.back());
- continue;
- }
- // camera object
- if (TokenMatch(filePtr,"CAMERAOBJECT",12))
- {
- m_vCameras.push_back(Camera());
- ParseLV1ObjectBlock(m_vCameras.back());
- continue;
- }
- // comment - print it on the console
- if (TokenMatch(filePtr,"COMMENT",7))
- {
- std::string out = "<unknown>";
- ParseString(out,"*COMMENT");
- LogInfo(("Comment: " + out).c_str());
- continue;
- }
- // ASC bone weights
- if (AI_ASE_IS_OLD_FILE_FORMAT() && TokenMatch(filePtr,"MESH_SOFTSKINVERTS",18))
- {
- ParseLV1SoftSkinBlock();
- }
- }
- AI_ASE_HANDLE_TOP_LEVEL_SECTION();
- }
- return;
-}
-
-// ------------------------------------------------------------------------------------------------
-void Parser::ParseLV1SoftSkinBlock()
-{
- // TODO: fix line counting here
-
- // **************************************************************
- // The soft skin block is formatted differently. There are no
- // nested sections supported and the single elements aren't
- // marked by keywords starting with an asterisk.
-
- /**
- FORMAT BEGIN
-
- *MESH_SOFTSKINVERTS {
- <nodename>
- <number of vertices>
-
- [for <number of vertices> times:]
- <number of weights> [for <number of weights> times:] <bone name> <weight>
- }
-
- FORMAT END
- */
- // **************************************************************
- while (true)
- {
- if (*filePtr == '}' ) {++filePtr;return;}
- else if (*filePtr == '\0') return;
- else if (*filePtr == '{' ) ++filePtr;
-
- else // if (!IsSpace(*filePtr) && !IsLineEnd(*filePtr))
- {
- ASE::Mesh* curMesh = NULL;
- unsigned int numVerts = 0;
-
- const char* sz = filePtr;
- while (!IsSpaceOrNewLine(*filePtr))++filePtr;
-
- const unsigned int diff = (unsigned int)(filePtr-sz);
- if (diff)
- {
- std::string name = std::string(sz,diff);
- for (std::vector<ASE::Mesh>::iterator it = m_vMeshes.begin();
- it != m_vMeshes.end(); ++it)
- {
- if ((*it).mName == name)
- {
- curMesh = & (*it);
- break;
- }
- }
- if (!curMesh)
- {
- LogWarning("Encountered unknown mesh in *MESH_SOFTSKINVERTS section");
-
- // Skip the mesh data - until we find a new mesh
- // or the end of the *MESH_SOFTSKINVERTS section
- while (true)
- {
- SkipSpacesAndLineEnd(&filePtr);
- if (*filePtr == '}')
- {++filePtr;return;}
- else if (!IsNumeric(*filePtr))
- break;
-
- SkipLine(&filePtr);
- }
- }
- else
- {
- SkipSpacesAndLineEnd(&filePtr);
- ParseLV4MeshLong(numVerts);
-
- // Reserve enough storage
- curMesh->mBoneVertices.reserve(numVerts);
-
- for (unsigned int i = 0; i < numVerts;++i)
- {
- SkipSpacesAndLineEnd(&filePtr);
- unsigned int numWeights;
- ParseLV4MeshLong(numWeights);
-
- curMesh->mBoneVertices.push_back(ASE::BoneVertex());
- ASE::BoneVertex& vert = curMesh->mBoneVertices.back();
-
- // Reserve enough storage
- vert.mBoneWeights.reserve(numWeights);
-
- for (unsigned int w = 0; w < numWeights;++w)
- {
- std::string bone;
- ParseString(bone,"*MESH_SOFTSKINVERTS.Bone");
-
- // Find the bone in the mesh's list
- std::pair<int,float> me;
- me.first = -1;
-
- for (unsigned int n = 0; n < curMesh->mBones.size();++n)
- {
- if (curMesh->mBones[n].mName == bone)
- {
- me.first = n;
- break;
- }
- }
- if (-1 == me.first)
- {
- // We don't have this bone yet, so add it to the list
- me.first = (int)curMesh->mBones.size();
- curMesh->mBones.push_back(ASE::Bone(bone));
- }
- ParseLV4MeshFloat( me.second );
-
- // Add the new bone weight to list
- vert.mBoneWeights.push_back(me);
- }
- }
- }
- }
- }
- ++filePtr;
- SkipSpacesAndLineEnd(&filePtr);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void Parser::ParseLV1SceneBlock()
-{
- AI_ASE_PARSER_INIT();
- while (true)
- {
- if ('*' == *filePtr)
- {
- ++filePtr;
- if (TokenMatch(filePtr,"SCENE_BACKGROUND_STATIC",23))
-
- {
- // parse a color triple and assume it is really the bg color
- ParseLV4MeshFloatTriple( &m_clrBackground.r );
- continue;
- }
- if (TokenMatch(filePtr,"SCENE_AMBIENT_STATIC",20))
-
- {
- // parse a color triple and assume it is really the bg color
- ParseLV4MeshFloatTriple( &m_clrAmbient.r );
- continue;
- }
- if (TokenMatch(filePtr,"SCENE_FIRSTFRAME",16))
- {
- ParseLV4MeshLong(iFirstFrame);
- continue;
- }
- if (TokenMatch(filePtr,"SCENE_LASTFRAME",15))
- {
- ParseLV4MeshLong(iLastFrame);
- continue;
- }
- if (TokenMatch(filePtr,"SCENE_FRAMESPEED",16))
- {
- ParseLV4MeshLong(iFrameSpeed);
- continue;
- }
- if (TokenMatch(filePtr,"SCENE_TICKSPERFRAME",19))
- {
- ParseLV4MeshLong(iTicksPerFrame);
- continue;
- }
- }
- AI_ASE_HANDLE_TOP_LEVEL_SECTION();
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void Parser::ParseLV1MaterialListBlock()
-{
- AI_ASE_PARSER_INIT();
-
- unsigned int iMaterialCount = 0;
- unsigned int iOldMaterialCount = (unsigned int)m_vMaterials.size();
- while (true)
- {
- if ('*' == *filePtr)
- {
- ++filePtr;
- if (TokenMatch(filePtr,"MATERIAL_COUNT",14))
- {
- ParseLV4MeshLong(iMaterialCount);
-
- // now allocate enough storage to hold all materials
- m_vMaterials.resize(iOldMaterialCount+iMaterialCount);
- continue;
- }
- if (TokenMatch(filePtr,"MATERIAL",8))
- {
- unsigned int iIndex = 0;
- ParseLV4MeshLong(iIndex);
-
- if (iIndex >= iMaterialCount)
- {
- LogWarning("Out of range: material index is too large");
- iIndex = iMaterialCount-1;
- }
-
- // get a reference to the material
- Material& sMat = m_vMaterials[iIndex+iOldMaterialCount];
- // parse the material block
- ParseLV2MaterialBlock(sMat);
- continue;
- }
- }
- AI_ASE_HANDLE_TOP_LEVEL_SECTION();
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void Parser::ParseLV2MaterialBlock(ASE::Material& mat)
-{
- AI_ASE_PARSER_INIT();
-
- unsigned int iNumSubMaterials = 0;
- while (true)
- {
- if ('*' == *filePtr)
- {
- ++filePtr;
- if (TokenMatch(filePtr,"MATERIAL_NAME",13))
- {
- if (!ParseString(mat.mName,"*MATERIAL_NAME"))
- SkipToNextToken();
- continue;
- }
- // ambient material color
- if (TokenMatch(filePtr,"MATERIAL_AMBIENT",16))
- {
- ParseLV4MeshFloatTriple(&mat.mAmbient.r);
- continue;
- }
- // diffuse material color
- if (TokenMatch(filePtr,"MATERIAL_DIFFUSE",16) )
- {
- ParseLV4MeshFloatTriple(&mat.mDiffuse.r);
- continue;
- }
- // specular material color
- if (TokenMatch(filePtr,"MATERIAL_SPECULAR",17))
- {
- ParseLV4MeshFloatTriple(&mat.mSpecular.r);
- continue;
- }
- // material shading type
- if (TokenMatch(filePtr,"MATERIAL_SHADING",16))
- {
- if (TokenMatch(filePtr,"Blinn",5))
- {
- mat.mShading = Discreet3DS::Blinn;
- }
- else if (TokenMatch(filePtr,"Phong",5))
- {
- mat.mShading = Discreet3DS::Phong;
- }
- else if (TokenMatch(filePtr,"Flat",4))
- {
- mat.mShading = Discreet3DS::Flat;
- }
- else if (TokenMatch(filePtr,"Wire",4))
- {
- mat.mShading = Discreet3DS::Wire;
- }
- else
- {
- // assume gouraud shading
- mat.mShading = Discreet3DS::Gouraud;
- SkipToNextToken();
- }
- continue;
- }
- // material transparency
- if (TokenMatch(filePtr,"MATERIAL_TRANSPARENCY",21))
- {
- ParseLV4MeshFloat(mat.mTransparency);
- mat.mTransparency = 1.0f - mat.mTransparency;continue;
- }
- // material self illumination
- if (TokenMatch(filePtr,"MATERIAL_SELFILLUM",18))
- {
- float f = 0.0f;
- ParseLV4MeshFloat(f);
-
- mat.mEmissive.r = f;
- mat.mEmissive.g = f;
- mat.mEmissive.b = f;
- continue;
- }
- // material shininess
- if (TokenMatch(filePtr,"MATERIAL_SHINE",14) )
- {
- ParseLV4MeshFloat(mat.mSpecularExponent);
- mat.mSpecularExponent *= 15;
- continue;
- }
- // two-sided material
- if (TokenMatch(filePtr,"MATERIAL_TWOSIDED",17) )
- {
- mat.mTwoSided = true;
- continue;
- }
- // material shininess strength
- if (TokenMatch(filePtr,"MATERIAL_SHINESTRENGTH",22))
- {
- ParseLV4MeshFloat(mat.mShininessStrength);
- continue;
- }
- // diffuse color map
- if (TokenMatch(filePtr,"MAP_DIFFUSE",11))
- {
- // parse the texture block
- ParseLV3MapBlock(mat.sTexDiffuse);
- continue;
- }
- // ambient color map
- if (TokenMatch(filePtr,"MAP_AMBIENT",11))
- {
- // parse the texture block
- ParseLV3MapBlock(mat.sTexAmbient);
- continue;
- }
- // specular color map
- if (TokenMatch(filePtr,"MAP_SPECULAR",12))
- {
- // parse the texture block
- ParseLV3MapBlock(mat.sTexSpecular);
- continue;
- }
- // opacity map
- if (TokenMatch(filePtr,"MAP_OPACITY",11))
- {
- // parse the texture block
- ParseLV3MapBlock(mat.sTexOpacity);
- continue;
- }
- // emissive map
- if (TokenMatch(filePtr,"MAP_SELFILLUM",13))
- {
- // parse the texture block
- ParseLV3MapBlock(mat.sTexEmissive);
- continue;
- }
- // bump map
- if (TokenMatch(filePtr,"MAP_BUMP",8))
- {
- // parse the texture block
- ParseLV3MapBlock(mat.sTexBump);
- }
- // specular/shininess map
- if (TokenMatch(filePtr,"MAP_SHINESTRENGTH",17))
- {
- // parse the texture block
- ParseLV3MapBlock(mat.sTexShininess);
- continue;
- }
- // number of submaterials
- if (TokenMatch(filePtr,"NUMSUBMTLS",10))
- {
- ParseLV4MeshLong(iNumSubMaterials);
-
- // allocate enough storage
- mat.avSubMaterials.resize(iNumSubMaterials);
- }
- // submaterial chunks
- if (TokenMatch(filePtr,"SUBMATERIAL",11))
- {
-
- unsigned int iIndex = 0;
- ParseLV4MeshLong(iIndex);
-
- if (iIndex >= iNumSubMaterials)
- {
- LogWarning("Out of range: submaterial index is too large");
- iIndex = iNumSubMaterials-1;
- }
-
- // get a reference to the material
- Material& sMat = mat.avSubMaterials[iIndex];
-
- // parse the material block
- ParseLV2MaterialBlock(sMat);
- continue;
- }
- }
- AI_ASE_HANDLE_SECTION("2","*MATERIAL");
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void Parser::ParseLV3MapBlock(Texture& map)
-{
- AI_ASE_PARSER_INIT();
-
- // ***********************************************************
- // *BITMAP should not be there if *MAP_CLASS is not BITMAP,
- // but we need to expect that case ... if the path is
- // empty the texture won't be used later.
- // ***********************************************************
- bool parsePath = true;
- while (true)
- {
- if ('*' == *filePtr)
- {
- ++filePtr;
- // type of map
- if (TokenMatch(filePtr,"MAP_CLASS" ,9))
- {
- std::string temp;
- if(!ParseString(temp,"*MAP_CLASS"))
- SkipToNextToken();
- if (temp != "Bitmap")
- {
- DefaultLogger::get()->warn("ASE: Skipping unknown map type: " + temp);
- parsePath = false;
- }
- continue;
- }
- // path to the texture
- if (parsePath && TokenMatch(filePtr,"BITMAP" ,6))
- {
- if(!ParseString(map.mMapName,"*BITMAP"))
- SkipToNextToken();
-
- if (map.mMapName == "None")
- {
- // Files with 'None' as map name are produced by
- // an Maja to ASE exporter which name I forgot ..
- DefaultLogger::get()->warn("ASE: Skipping invalid map entry");
- map.mMapName = "";
- }
-
- continue;
- }
- // offset on the u axis
- if (TokenMatch(filePtr,"UVW_U_OFFSET" ,12))
- {
- ParseLV4MeshFloat(map.mOffsetU);
- continue;
- }
- // offset on the v axis
- if (TokenMatch(filePtr,"UVW_V_OFFSET" ,12))
- {
- ParseLV4MeshFloat(map.mOffsetV);
- continue;
- }
- // tiling on the u axis
- if (TokenMatch(filePtr,"UVW_U_TILING" ,12))
- {
- ParseLV4MeshFloat(map.mScaleU);
- continue;
- }
- // tiling on the v axis
- if (TokenMatch(filePtr,"UVW_V_TILING" ,12))
- {
- ParseLV4MeshFloat(map.mScaleV);
- continue;
- }
- // rotation around the z-axis
- if (TokenMatch(filePtr,"UVW_ANGLE" ,9))
- {
- ParseLV4MeshFloat(map.mRotation);
- continue;
- }
- // map blending factor
- if (TokenMatch(filePtr,"MAP_AMOUNT" ,10))
- {
- ParseLV4MeshFloat(map.mTextureBlend);
- continue;
- }
- }
- AI_ASE_HANDLE_SECTION("3","*MAP_XXXXXX");
- }
- return;
-}
-
-// ------------------------------------------------------------------------------------------------
-bool Parser::ParseString(std::string& out,const char* szName)
-{
- char szBuffer[1024];
- if (!SkipSpaces(&filePtr))
- {
-
- sprintf(szBuffer,"Unable to parse %s block: Unexpected EOL",szName);
- LogWarning(szBuffer);
- return false;
- }
- // there must be '"'
- if ('\"' != *filePtr)
- {
-
- sprintf(szBuffer,"Unable to parse %s block: Strings are expected "
- "to be enclosed in double quotation marks",szName);
- LogWarning(szBuffer);
- return false;
- }
- ++filePtr;
- const char* sz = filePtr;
- while (true)
- {
- if ('\"' == *sz)break;
- else if ('\0' == *sz)
- {
- sprintf(szBuffer,"Unable to parse %s block: Strings are expected to "
- "be enclosed in double quotation marks but EOF was reached before "
- "a closing quotation mark was encountered",szName);
- LogWarning(szBuffer);
- return false;
- }
- sz++;
- }
- out = std::string(filePtr,(uintptr_t)sz-(uintptr_t)filePtr);
- filePtr = sz+1;
- return true;
-}
-
-// ------------------------------------------------------------------------------------------------
-void Parser::ParseLV1ObjectBlock(ASE::BaseNode& node)
-{
- AI_ASE_PARSER_INIT();
- while (true)
- {
- if ('*' == *filePtr)
- {
- ++filePtr;
-
- // first process common tokens such as node name and transform
- // name of the mesh/node
- if (TokenMatch(filePtr,"NODE_NAME" ,9))
- {
- if(!ParseString(node.mName,"*NODE_NAME"))
- SkipToNextToken();
- continue;
- }
- // name of the parent of the node
- if (TokenMatch(filePtr,"NODE_PARENT" ,11) )
- {
- if(!ParseString(node.mParent,"*NODE_PARENT"))
- SkipToNextToken();
- continue;
- }
- // transformation matrix of the node
- if (TokenMatch(filePtr,"NODE_TM" ,7))
- {
- ParseLV2NodeTransformBlock(node);
- continue;
- }
- // animation data of the node
- if (TokenMatch(filePtr,"TM_ANIMATION" ,12))
- {
- ParseLV2AnimationBlock(node);
- continue;
- }
-
- if (node.mType == BaseNode::Light)
- {
- // light settings
- if (TokenMatch(filePtr,"LIGHT_SETTINGS" ,14))
- {
- ParseLV2LightSettingsBlock((ASE::Light&)node);
- continue;
- }
- // type of the light source
- if (TokenMatch(filePtr,"LIGHT_TYPE" ,10))
- {
- if (!ASSIMP_strincmp("omni",filePtr,4))
- {
- ((ASE::Light&)node).mLightType = ASE::Light::OMNI;
- }
- else if (!ASSIMP_strincmp("target",filePtr,6))
- {
- ((ASE::Light&)node).mLightType = ASE::Light::TARGET;
- }
- else if (!ASSIMP_strincmp("free",filePtr,4))
- {
- ((ASE::Light&)node).mLightType = ASE::Light::FREE;
- }
- else if (!ASSIMP_strincmp("directional",filePtr,11))
- {
- ((ASE::Light&)node).mLightType = ASE::Light::DIRECTIONAL;
- }
- else
- {
- LogWarning("Unknown kind of light source");
- }
- continue;
- }
- }
- else if (node.mType == BaseNode::Camera)
- {
- // Camera settings
- if (TokenMatch(filePtr,"CAMERA_SETTINGS" ,15))
- {
- ParseLV2CameraSettingsBlock((ASE::Camera&)node);
- continue;
- }
- else if (TokenMatch(filePtr,"CAMERA_TYPE" ,11))
- {
- if (!ASSIMP_strincmp("target",filePtr,6))
- {
- ((ASE::Camera&)node).mCameraType = ASE::Camera::TARGET;
- }
- else if (!ASSIMP_strincmp("free",filePtr,4))
- {
- ((ASE::Camera&)node).mCameraType = ASE::Camera::FREE;
- }
- else
- {
- LogWarning("Unknown kind of camera");
- }
- continue;
- }
- }
- else if (node.mType == BaseNode::Mesh)
- {
- // mesh data
- // FIX: Older files use MESH_SOFTSKIN
- if (TokenMatch(filePtr,"MESH" ,4) ||
- TokenMatch(filePtr,"MESH_SOFTSKIN",13))
- {
- ParseLV2MeshBlock((ASE::Mesh&)node);
- continue;
- }
- // mesh material index
- if (TokenMatch(filePtr,"MATERIAL_REF" ,12))
- {
- ParseLV4MeshLong(((ASE::Mesh&)node).iMaterialIndex);
- continue;
- }
- }
- }
- AI_ASE_HANDLE_TOP_LEVEL_SECTION();
- }
- return;
-}
-
-// ------------------------------------------------------------------------------------------------
-void Parser::ParseLV2CameraSettingsBlock(ASE::Camera& camera)
-{
- AI_ASE_PARSER_INIT();
- while (true)
- {
- if ('*' == *filePtr)
- {
- ++filePtr;
- if (TokenMatch(filePtr,"CAMERA_NEAR" ,11))
- {
- ParseLV4MeshFloat(camera.mNear);
- continue;
- }
- if (TokenMatch(filePtr,"CAMERA_FAR" ,10))
- {
- ParseLV4MeshFloat(camera.mFar);
- continue;
- }
- if (TokenMatch(filePtr,"CAMERA_FOV" ,10))
- {
- ParseLV4MeshFloat(camera.mFOV);
- continue;
- }
- }
- AI_ASE_HANDLE_SECTION("2","CAMERA_SETTINGS");
- }
- return;
-}
-
-// ------------------------------------------------------------------------------------------------
-void Parser::ParseLV2LightSettingsBlock(ASE::Light& light)
-{
- AI_ASE_PARSER_INIT();
- while (true)
- {
- if ('*' == *filePtr)
- {
- ++filePtr;
- if (TokenMatch(filePtr,"LIGHT_COLOR" ,11))
- {
- ParseLV4MeshFloatTriple(&light.mColor.r);
- continue;
- }
- if (TokenMatch(filePtr,"LIGHT_INTENS" ,12))
- {
- ParseLV4MeshFloat(light.mIntensity);
- continue;
- }
- if (TokenMatch(filePtr,"LIGHT_HOTSPOT" ,13))
- {
- ParseLV4MeshFloat(light.mAngle);
- continue;
- }
- if (TokenMatch(filePtr,"LIGHT_FALLOFF" ,13))
- {
- ParseLV4MeshFloat(light.mFalloff);
- continue;
- }
- }
- AI_ASE_HANDLE_SECTION("2","LIGHT_SETTINGS");
- }
- return;
-}
-
-// ------------------------------------------------------------------------------------------------
-void Parser::ParseLV2AnimationBlock(ASE::BaseNode& mesh)
-{
- AI_ASE_PARSER_INIT();
-
- ASE::Animation* anim = &mesh.mAnim;
- while (true)
- {
- if ('*' == *filePtr)
- {
- ++filePtr;
- if (TokenMatch(filePtr,"NODE_NAME" ,9))
- {
- std::string temp;
- if(!ParseString(temp,"*NODE_NAME"))
- SkipToNextToken();
-
- // If the name of the node contains .target it
- // represents an animated camera or spot light
- // target.
- if (std::string::npos != temp.find(".Target"))
- {
- if ((mesh.mType != BaseNode::Camera || ((ASE::Camera&)mesh).mCameraType != ASE::Camera::TARGET) &&
- ( mesh.mType != BaseNode::Light || ((ASE::Light&)mesh).mLightType != ASE::Light::TARGET))
- {
-
- DefaultLogger::get()->error("ASE: Found target animation channel "
- "but the node is neither a camera nor a spot light");
- anim = NULL;
- }
- else anim = &mesh.mTargetAnim;
- }
- continue;
- }
-
- // position keyframes
- if (TokenMatch(filePtr,"CONTROL_POS_TRACK" ,17) ||
- TokenMatch(filePtr,"CONTROL_POS_BEZIER" ,18) ||
- TokenMatch(filePtr,"CONTROL_POS_TCB" ,15))
- {
- if (!anim)SkipSection();
- else ParseLV3PosAnimationBlock(*anim);
- continue;
- }
- // scaling keyframes
- if (TokenMatch(filePtr,"CONTROL_SCALE_TRACK" ,19) ||
- TokenMatch(filePtr,"CONTROL_SCALE_BEZIER" ,20) ||
- TokenMatch(filePtr,"CONTROL_SCALE_TCB" ,17))
- {
- if (!anim || anim == &mesh.mTargetAnim)
- {
- // Target animation channels may have no rotation channels
- DefaultLogger::get()->error("ASE: Ignoring scaling channel in target animation");
- SkipSection();
- }
- else ParseLV3ScaleAnimationBlock(*anim);
- continue;
- }
- // rotation keyframes
- if (TokenMatch(filePtr,"CONTROL_ROT_TRACK" ,17) ||
- TokenMatch(filePtr,"CONTROL_ROT_BEZIER" ,18) ||
- TokenMatch(filePtr,"CONTROL_ROT_TCB" ,15))
- {
- if (!anim || anim == &mesh.mTargetAnim)
- {
- // Target animation channels may have no rotation channels
- DefaultLogger::get()->error("ASE: Ignoring rotation channel in target animation");
- SkipSection();
- }
- else ParseLV3RotAnimationBlock(*anim);
- continue;
- }
- }
- AI_ASE_HANDLE_SECTION("2","TM_ANIMATION");
- }
-}
-// ------------------------------------------------------------------------------------------------
-void Parser::ParseLV3ScaleAnimationBlock(ASE::Animation& anim)
-{
- AI_ASE_PARSER_INIT();
- unsigned int iIndex;
-
- while (true)
- {
- if ('*' == *filePtr)
- {
- ++filePtr;
-
- bool b = false;
-
- // For the moment we're just reading the three floats -
- // we ignore the ádditional information for bezier's and TCBs
-
- // simple scaling keyframe
- if (TokenMatch(filePtr,"CONTROL_SCALE_SAMPLE" ,20))
- {
- b = true;
- anim.mScalingType = ASE::Animation::TRACK;
- }
-
- // Bezier scaling keyframe
- if (TokenMatch(filePtr,"CONTROL_BEZIER_SCALE_KEY" ,24))
- {
- b = true;
- anim.mScalingType = ASE::Animation::BEZIER;
- }
- // TCB scaling keyframe
- if (TokenMatch(filePtr,"CONTROL_TCB_SCALE_KEY" ,21))
- {
- b = true;
- anim.mScalingType = ASE::Animation::TCB;
- }
- if (b)
- {
- anim.akeyScaling.push_back(aiVectorKey());
- aiVectorKey& key = anim.akeyScaling.back();
- ParseLV4MeshFloatTriple(&key.mValue.x,iIndex);
- key.mTime = (double)iIndex;
- }
- }
- AI_ASE_HANDLE_SECTION("3","*CONTROL_POS_TRACK");
- }
-}
-// ------------------------------------------------------------------------------------------------
-void Parser::ParseLV3PosAnimationBlock(ASE::Animation& anim)
-{
- AI_ASE_PARSER_INIT();
- unsigned int iIndex;
- while (true)
- {
- if ('*' == *filePtr)
- {
- ++filePtr;
-
- bool b = false;
-
- // For the moment we're just reading the three floats -
- // we ignore the ádditional information for bezier's and TCBs
-
- // simple scaling keyframe
- if (TokenMatch(filePtr,"CONTROL_POS_SAMPLE" ,18))
- {
- b = true;
- anim.mPositionType = ASE::Animation::TRACK;
- }
-
- // Bezier scaling keyframe
- if (TokenMatch(filePtr,"CONTROL_BEZIER_POS_KEY" ,22))
- {
- b = true;
- anim.mPositionType = ASE::Animation::BEZIER;
- }
- // TCB scaling keyframe
- if (TokenMatch(filePtr,"CONTROL_TCB_POS_KEY" ,19))
- {
- b = true;
- anim.mPositionType = ASE::Animation::TCB;
- }
- if (b)
- {
- anim.akeyPositions.push_back(aiVectorKey());
- aiVectorKey& key = anim.akeyPositions.back();
- ParseLV4MeshFloatTriple(&key.mValue.x,iIndex);
- key.mTime = (double)iIndex;
- }
- }
- AI_ASE_HANDLE_SECTION("3","*CONTROL_POS_TRACK");
- }
-}
-// ------------------------------------------------------------------------------------------------
-void Parser::ParseLV3RotAnimationBlock(ASE::Animation& anim)
-{
- AI_ASE_PARSER_INIT();
- unsigned int iIndex;
- while (true)
- {
- if ('*' == *filePtr)
- {
- ++filePtr;
-
- bool b = false;
-
- // For the moment we're just reading the floats -
- // we ignore the ádditional information for bezier's and TCBs
-
- // simple scaling keyframe
- if (TokenMatch(filePtr,"CONTROL_ROT_SAMPLE" ,18))
- {
- b = true;
- anim.mRotationType = ASE::Animation::TRACK;
- }
-
- // Bezier scaling keyframe
- if (TokenMatch(filePtr,"CONTROL_BEZIER_ROT_KEY" ,22))
- {
- b = true;
- anim.mRotationType = ASE::Animation::BEZIER;
- }
- // TCB scaling keyframe
- if (TokenMatch(filePtr,"CONTROL_TCB_ROT_KEY" ,19))
- {
- b = true;
- anim.mRotationType = ASE::Animation::TCB;
- }
- if (b)
- {
- anim.akeyRotations.push_back(aiQuatKey());
- aiQuatKey& key = anim.akeyRotations.back();
- aiVector3D v;float f;
- ParseLV4MeshFloatTriple(&v.x,iIndex);
- ParseLV4MeshFloat(f);
- key.mTime = (double)iIndex;
- key.mValue = aiQuaternion(v,f);
- }
- }
- AI_ASE_HANDLE_SECTION("3","*CONTROL_ROT_TRACK");
- }
-}
-// ------------------------------------------------------------------------------------------------
-void Parser::ParseLV2NodeTransformBlock(ASE::BaseNode& mesh)
-{
- AI_ASE_PARSER_INIT();
- int mode = 0;
- while (true)
- {
- if ('*' == *filePtr)
- {
- ++filePtr;
- // name of the node
- if (TokenMatch(filePtr,"NODE_NAME" ,9))
- {
- std::string temp;
- if(!ParseString(temp,"*NODE_NAME"))
- SkipToNextToken();
-
- std::string::size_type s;
- if (temp == mesh.mName)
- {
- mode = 1;
- }
- else if (std::string::npos != (s = temp.find(".Target")) &&
- mesh.mName == temp.substr(0,s))
- {
- // This should be either a target light or a target camera
- if ( (mesh.mType == BaseNode::Light && ((ASE::Light&)mesh) .mLightType == ASE::Light::TARGET) ||
- (mesh.mType == BaseNode::Camera && ((ASE::Camera&)mesh).mCameraType == ASE::Camera::TARGET))
- {
- mode = 2;
- }
- else DefaultLogger::get()->error("ASE: Ignoring target transform, "
- "this is no spot light or target camera");
- }
- else
- {
- DefaultLogger::get()->error("ASE: Unknown node transformation: " + temp);
- // mode = 0
- }
- continue;
- }
- if (mode)
- {
- // fourth row of the transformation matrix - and also the
- // only information here that is interesting for targets
- if (TokenMatch(filePtr,"TM_ROW3" ,7))
- {
- ParseLV4MeshFloatTriple((mode == 1 ? mesh.mTransform[3] : &mesh.mTargetPosition.x));
- continue;
- }
- if (mode == 1)
- {
- // first row of the transformation matrix
- if (TokenMatch(filePtr,"TM_ROW0" ,7))
- {
- ParseLV4MeshFloatTriple(mesh.mTransform[0]);
- continue;
- }
- // second row of the transformation matrix
- if (TokenMatch(filePtr,"TM_ROW1" ,7))
- {
- ParseLV4MeshFloatTriple(mesh.mTransform[1]);
- continue;
- }
- // third row of the transformation matrix
- if (TokenMatch(filePtr,"TM_ROW2" ,7))
- {
- ParseLV4MeshFloatTriple(mesh.mTransform[2]);
- continue;
- }
- // inherited position axes
- if (TokenMatch(filePtr,"INHERIT_POS" ,11))
- {
- unsigned int aiVal[3];
- ParseLV4MeshLongTriple(aiVal);
-
- for (unsigned int i = 0; i < 3;++i)
- mesh.inherit.abInheritPosition[i] = aiVal[i] != 0;
- continue;
- }
- // inherited rotation axes
- if (TokenMatch(filePtr,"INHERIT_ROT" ,11))
- {
- unsigned int aiVal[3];
- ParseLV4MeshLongTriple(aiVal);
-
- for (unsigned int i = 0; i < 3;++i)
- mesh.inherit.abInheritRotation[i] = aiVal[i] != 0;
- continue;
- }
- // inherited scaling axes
- if (TokenMatch(filePtr,"INHERIT_SCL" ,11))
- {
- unsigned int aiVal[3];
- ParseLV4MeshLongTriple(aiVal);
-
- for (unsigned int i = 0; i < 3;++i)
- mesh.inherit.abInheritScaling[i] = aiVal[i] != 0;
- continue;
- }
- }
- }
- }
- AI_ASE_HANDLE_SECTION("2","*NODE_TM");
- }
- return;
-}
-// ------------------------------------------------------------------------------------------------
-void Parser::ParseLV2MeshBlock(ASE::Mesh& mesh)
-{
- AI_ASE_PARSER_INIT();
-
- unsigned int iNumVertices = 0;
- unsigned int iNumFaces = 0;
- unsigned int iNumTVertices = 0;
- unsigned int iNumTFaces = 0;
- unsigned int iNumCVertices = 0;
- unsigned int iNumCFaces = 0;
- while (true)
- {
- if ('*' == *filePtr)
- {
- ++filePtr;
- // Number of vertices in the mesh
- if (TokenMatch(filePtr,"MESH_NUMVERTEX" ,14))
- {
- ParseLV4MeshLong(iNumVertices);
- continue;
- }
- // Number of texture coordinates in the mesh
- if (TokenMatch(filePtr,"MESH_NUMTVERTEX" ,15))
- {
- ParseLV4MeshLong(iNumTVertices);
- continue;
- }
- // Number of vertex colors in the mesh
- if (TokenMatch(filePtr,"MESH_NUMCVERTEX" ,15))
- {
- ParseLV4MeshLong(iNumCVertices);
- continue;
- }
- // Number of regular faces in the mesh
- if (TokenMatch(filePtr,"MESH_NUMFACES" ,13))
- {
- ParseLV4MeshLong(iNumFaces);
- continue;
- }
- // Number of UVWed faces in the mesh
- if (TokenMatch(filePtr,"MESH_NUMTVFACES" ,15))
- {
- ParseLV4MeshLong(iNumTFaces);
- continue;
- }
- // Number of colored faces in the mesh
- if (TokenMatch(filePtr,"MESH_NUMCVFACES" ,15))
- {
- ParseLV4MeshLong(iNumCFaces);
- continue;
- }
- // mesh vertex list block
- if (TokenMatch(filePtr,"MESH_VERTEX_LIST" ,16))
- {
- ParseLV3MeshVertexListBlock(iNumVertices,mesh);
- continue;
- }
- // mesh face list block
- if (TokenMatch(filePtr,"MESH_FACE_LIST" ,14))
- {
- ParseLV3MeshFaceListBlock(iNumFaces,mesh);
- continue;
- }
- // mesh texture vertex list block
- if (TokenMatch(filePtr,"MESH_TVERTLIST" ,14))
- {
- ParseLV3MeshTListBlock(iNumTVertices,mesh);
- continue;
- }
- // mesh texture face block
- if (TokenMatch(filePtr,"MESH_TFACELIST" ,14))
- {
- ParseLV3MeshTFaceListBlock(iNumTFaces,mesh);
- continue;
- }
- // mesh color vertex list block
- if (TokenMatch(filePtr,"MESH_CVERTLIST" ,14))
- {
- ParseLV3MeshCListBlock(iNumCVertices,mesh);
- continue;
- }
- // mesh color face block
- if (TokenMatch(filePtr,"MESH_CFACELIST" ,14))
- {
- ParseLV3MeshCFaceListBlock(iNumCFaces,mesh);
- continue;
- }
- // mesh normals
- if (TokenMatch(filePtr,"MESH_NORMALS" ,12))
- {
- ParseLV3MeshNormalListBlock(mesh);
- continue;
- }
- // another mesh UV channel ...
- if (TokenMatch(filePtr,"MESH_MAPPINGCHANNEL" ,19))
- {
-
- unsigned int iIndex = 0;
- ParseLV4MeshLong(iIndex);
-
- if (iIndex < 2)
- {
- LogWarning("Mapping channel has an invalid index. Skipping UV channel");
- // skip it ...
- SkipSection();
- }
- if (iIndex > AI_MAX_NUMBER_OF_TEXTURECOORDS)
- {
- LogWarning("Too many UV channels specified. Skipping channel ..");
- // skip it ...
- SkipSection();
- }
- else
- {
- // parse the mapping channel
- ParseLV3MappingChannel(iIndex-1,mesh);
- }
- continue;
- }
- // mesh animation keyframe. Not supported
- if (TokenMatch(filePtr,"MESH_ANIMATION" ,14))
- {
-
- LogWarning("Found *MESH_ANIMATION element in ASE/ASK file. "
- "Keyframe animation is not supported by Assimp, this element "
- "will be ignored");
- //SkipSection();
- continue;
- }
- if (TokenMatch(filePtr,"MESH_WEIGHTS" ,12))
- {
- ParseLV3MeshWeightsBlock(mesh);continue;
- }
- }
- AI_ASE_HANDLE_SECTION("2","*MESH");
- }
- return;
-}
-// ------------------------------------------------------------------------------------------------
-void Parser::ParseLV3MeshWeightsBlock(ASE::Mesh& mesh)
-{
- AI_ASE_PARSER_INIT();
-
- unsigned int iNumVertices = 0, iNumBones = 0;
- while (true)
- {
- if ('*' == *filePtr)
- {
- ++filePtr;
-
- // Number of bone vertices ...
- if (TokenMatch(filePtr,"MESH_NUMVERTEX" ,14))
- {
- ParseLV4MeshLong(iNumVertices);
- continue;
- }
- // Number of bones
- if (TokenMatch(filePtr,"MESH_NUMBONE" ,11))
- {
- ParseLV4MeshLong(iNumBones);
- continue;
- }
- // parse the list of bones
- if (TokenMatch(filePtr,"MESH_BONE_LIST" ,14))
- {
- ParseLV4MeshBones(iNumBones,mesh);
- continue;
- }
- // parse the list of bones vertices
- if (TokenMatch(filePtr,"MESH_BONE_VERTEX_LIST" ,21) )
- {
- ParseLV4MeshBonesVertices(iNumVertices,mesh);
- continue;
- }
- }
- AI_ASE_HANDLE_SECTION("3","*MESH_WEIGHTS");
- }
- return;
-}
-// ------------------------------------------------------------------------------------------------
-void Parser::ParseLV4MeshBones(unsigned int iNumBones,ASE::Mesh& mesh)
-{
- AI_ASE_PARSER_INIT();
- mesh.mBones.resize(iNumBones);
- while (true)
- {
- if ('*' == *filePtr)
- {
- ++filePtr;
-
- // Mesh bone with name ...
- if (TokenMatch(filePtr,"MESH_BONE_NAME" ,16))
- {
- // parse an index ...
- if(SkipSpaces(&filePtr))
- {
- unsigned int iIndex = strtol10(filePtr,&filePtr);
- if (iIndex >= iNumBones)
- {
- continue;
- LogWarning("Bone index is out of bounds");
- }
- if (!ParseString(mesh.mBones[iIndex].mName,"*MESH_BONE_NAME"))
- SkipToNextToken();
- continue;
- }
- }
- }
- AI_ASE_HANDLE_SECTION("3","*MESH_BONE_LIST");
- }
-}
-// ------------------------------------------------------------------------------------------------
-void Parser::ParseLV4MeshBonesVertices(unsigned int iNumVertices,ASE::Mesh& mesh)
-{
- AI_ASE_PARSER_INIT();
- mesh.mBoneVertices.resize(iNumVertices);
- while (true)
- {
- if ('*' == *filePtr)
- {
- ++filePtr;
-
- // Mesh bone vertex
- if (TokenMatch(filePtr,"MESH_BONE_VERTEX" ,16))
- {
- // read the vertex index
- unsigned int iIndex = strtol10(filePtr,&filePtr);
- if (iIndex >= mesh.mPositions.size())
- {
- iIndex = (unsigned int)mesh.mPositions.size()-1;
- LogWarning("Bone vertex index is out of bounds. Using the largest valid "
- "bone vertex index instead");
- }
-
- // --- ignored
- float afVert[3];
- ParseLV4MeshFloatTriple(afVert);
-
- std::pair<int,float> pairOut;
- while (true)
- {
- // first parse the bone index ...
- if (!SkipSpaces(&filePtr))break;
- pairOut.first = strtol10(filePtr,&filePtr);
-
- // then parse the vertex weight
- if (!SkipSpaces(&filePtr))break;
- filePtr = fast_atof_move(filePtr,pairOut.second);
-
- // -1 marks unused entries
- if (-1 != pairOut.first)
- {
- mesh.mBoneVertices[iIndex].mBoneWeights.push_back(pairOut);
- }
- }
- continue;
- }
- }
- AI_ASE_HANDLE_SECTION("4","*MESH_BONE_VERTEX");
- }
- return;
-}
-// ------------------------------------------------------------------------------------------------
-void Parser::ParseLV3MeshVertexListBlock(
- unsigned int iNumVertices, ASE::Mesh& mesh)
-{
- AI_ASE_PARSER_INIT();
-
- // allocate enough storage in the array
- mesh.mPositions.resize(iNumVertices);
- while (true)
- {
- if ('*' == *filePtr)
- {
- ++filePtr;
-
- // Vertex entry
- if (TokenMatch(filePtr,"MESH_VERTEX" ,11))
- {
-
- aiVector3D vTemp;
- unsigned int iIndex;
- ParseLV4MeshFloatTriple(&vTemp.x,iIndex);
-
- if (iIndex >= iNumVertices)
- {
- LogWarning("Invalid vertex index. It will be ignored");
- }
- else mesh.mPositions[iIndex] = vTemp;
- continue;
- }
- }
- AI_ASE_HANDLE_SECTION("3","*MESH_VERTEX_LIST");
- }
- return;
-}
-// ------------------------------------------------------------------------------------------------
-void Parser::ParseLV3MeshFaceListBlock(unsigned int iNumFaces, ASE::Mesh& mesh)
-{
- AI_ASE_PARSER_INIT();
-
- // allocate enough storage in the face array
- mesh.mFaces.resize(iNumFaces);
- while (true)
- {
- if ('*' == *filePtr)
- {
- ++filePtr;
-
- // Face entry
- if (TokenMatch(filePtr,"MESH_FACE" ,9))
- {
-
- ASE::Face mFace;
- ParseLV4MeshFace(mFace);
-
- if (mFace.iFace >= iNumFaces)
- {
- LogWarning("Face has an invalid index. It will be ignored");
- }
- else mesh.mFaces[mFace.iFace] = mFace;
- continue;
- }
- }
- AI_ASE_HANDLE_SECTION("3","*MESH_FACE_LIST");
- }
- return;
-}
-// ------------------------------------------------------------------------------------------------
-void Parser::ParseLV3MeshTListBlock(unsigned int iNumVertices,
- ASE::Mesh& mesh, unsigned int iChannel)
-{
- AI_ASE_PARSER_INIT();
-
- // allocate enough storage in the array
- mesh.amTexCoords[iChannel].resize(iNumVertices);
- while (true)
- {
- if ('*' == *filePtr)
- {
- ++filePtr;
-
- // Vertex entry
- if (TokenMatch(filePtr,"MESH_TVERT" ,10))
- {
- aiVector3D vTemp;
- unsigned int iIndex;
- ParseLV4MeshFloatTriple(&vTemp.x,iIndex);
-
- if (iIndex >= iNumVertices)
- {
- LogWarning("Tvertex has an invalid index. It will be ignored");
- }
- else mesh.amTexCoords[iChannel][iIndex] = vTemp;
-
- if (0.0f != vTemp.z)
- {
- // we need 3 coordinate channels
- mesh.mNumUVComponents[iChannel] = 3;
- }
- continue;
- }
- }
- AI_ASE_HANDLE_SECTION("3","*MESH_TVERT_LIST");
- }
- return;
-}
-// ------------------------------------------------------------------------------------------------
-void Parser::ParseLV3MeshTFaceListBlock(unsigned int iNumFaces,
- ASE::Mesh& mesh, unsigned int iChannel)
-{
- AI_ASE_PARSER_INIT();
- while (true)
- {
- if ('*' == *filePtr)
- {
- ++filePtr;
-
- // Face entry
- if (TokenMatch(filePtr,"MESH_TFACE" ,10))
- {
- unsigned int aiValues[3];
- unsigned int iIndex = 0;
-
- ParseLV4MeshLongTriple(aiValues,iIndex);
- if (iIndex >= iNumFaces || iIndex >= mesh.mFaces.size())
- {
- LogWarning("UV-Face has an invalid index. It will be ignored");
- }
- else
- {
- // copy UV indices
- mesh.mFaces[iIndex].amUVIndices[iChannel][0] = aiValues[0];
- mesh.mFaces[iIndex].amUVIndices[iChannel][1] = aiValues[1];
- mesh.mFaces[iIndex].amUVIndices[iChannel][2] = aiValues[2];
- }
- continue;
- }
- }
- AI_ASE_HANDLE_SECTION("3","*MESH_TFACE_LIST");
- }
- return;
-}
-// ------------------------------------------------------------------------------------------------
-void Parser::ParseLV3MappingChannel(unsigned int iChannel, ASE::Mesh& mesh)
-{
- AI_ASE_PARSER_INIT();
-
- unsigned int iNumTVertices = 0;
- unsigned int iNumTFaces = 0;
- while (true)
- {
- if ('*' == *filePtr)
- {
- ++filePtr;
-
- // Number of texture coordinates in the mesh
- if (TokenMatch(filePtr,"MESH_NUMTVERTEX" ,15))
- {
- ParseLV4MeshLong(iNumTVertices);
- continue;
- }
- // Number of UVWed faces in the mesh
- if (TokenMatch(filePtr,"MESH_NUMTVFACES" ,15))
- {
- ParseLV4MeshLong(iNumTFaces);
- continue;
- }
- // mesh texture vertex list block
- if (TokenMatch(filePtr,"MESH_TVERTLIST" ,14))
- {
- ParseLV3MeshTListBlock(iNumTVertices,mesh,iChannel);
- continue;
- }
- // mesh texture face block
- if (TokenMatch(filePtr,"MESH_TFACELIST" ,14))
- {
- ParseLV3MeshTFaceListBlock(iNumTFaces,mesh, iChannel);
- continue;
- }
- }
- AI_ASE_HANDLE_SECTION("3","*MESH_MAPPING_CHANNEL");
- }
- return;
-}
-// ------------------------------------------------------------------------------------------------
-void Parser::ParseLV3MeshCListBlock(unsigned int iNumVertices, ASE::Mesh& mesh)
-{
- AI_ASE_PARSER_INIT();
-
- // allocate enough storage in the array
- mesh.mVertexColors.resize(iNumVertices);
- while (true)
- {
- if ('*' == *filePtr)
- {
- ++filePtr;
-
- // Vertex entry
- if (TokenMatch(filePtr,"MESH_VERTCOL" ,12))
- {
- aiColor4D vTemp;
- vTemp.a = 1.0f;
- unsigned int iIndex;
- ParseLV4MeshFloatTriple(&vTemp.r,iIndex);
-
- if (iIndex >= iNumVertices)
- {
- LogWarning("Vertex color has an invalid index. It will be ignored");
- }
- else mesh.mVertexColors[iIndex] = vTemp;
- continue;
- }
- }
- AI_ASE_HANDLE_SECTION("3","*MESH_CVERTEX_LIST");
- }
- return;
-}
-// ------------------------------------------------------------------------------------------------
-void Parser::ParseLV3MeshCFaceListBlock(unsigned int iNumFaces, ASE::Mesh& mesh)
-{
- AI_ASE_PARSER_INIT();
- while (true)
- {
- if ('*' == *filePtr)
- {
- ++filePtr;
-
- // Face entry
- if (TokenMatch(filePtr,"MESH_CFACE" ,11))
- {
- unsigned int aiValues[3];
- unsigned int iIndex = 0;
-
- ParseLV4MeshLongTriple(aiValues,iIndex);
- if (iIndex >= iNumFaces || iIndex >= mesh.mFaces.size())
- {
- LogWarning("UV-Face has an invalid index. It will be ignored");
- }
- else
- {
- // copy color indices
- mesh.mFaces[iIndex].mColorIndices[0] = aiValues[0];
- mesh.mFaces[iIndex].mColorIndices[1] = aiValues[1];
- mesh.mFaces[iIndex].mColorIndices[2] = aiValues[2];
- }
- continue;
- }
- }
- AI_ASE_HANDLE_SECTION("3","*MESH_CFACE_LIST");
- }
- return;
-}
-// ------------------------------------------------------------------------------------------------
-void Parser::ParseLV3MeshNormalListBlock(ASE::Mesh& sMesh)
-{
- AI_ASE_PARSER_INIT();
-
- // Allocate enough storage for the normals
- sMesh.mNormals.resize(sMesh.mFaces.size()*3,aiVector3D( 0.f, 0.f, 0.f ));
- unsigned int index, faceIdx = 0xffffffff;
-
- // FIXME: rewrite this and find out how to interpret the normals
- // correctly. This is crap.
-
- // Smooth the vertex and face normals together. The result
- // will be edgy then, but otherwise everything would be soft ...
- while (true) {
- if ('*' == *filePtr) {
- ++filePtr;
- if (faceIdx != 0xffffffff && TokenMatch(filePtr,"MESH_VERTEXNORMAL",17)) {
- aiVector3D vNormal;
- ParseLV4MeshFloatTriple(&vNormal.x,index);
- if (faceIdx >= sMesh.mFaces.size())
- continue;
-
- // Make sure we assign it to the correct face
- const ASE::Face& face = sMesh.mFaces[faceIdx];
- if (index == face.mIndices[0])
- index = 0;
- else if (index == face.mIndices[1])
- index = 1;
- else if (index == face.mIndices[2])
- index = 2;
- else {
- DefaultLogger::get()->error("ASE: Invalid vertex index in MESH_VERTEXNORMAL section");
- continue;
- }
- // We'll renormalize later
- sMesh.mNormals[faceIdx*3+index] += vNormal;
- continue;
- }
- if (TokenMatch(filePtr,"MESH_FACENORMAL",15)) {
- aiVector3D vNormal;
- ParseLV4MeshFloatTriple(&vNormal.x,faceIdx);
-
- if (faceIdx >= sMesh.mFaces.size()) {
- DefaultLogger::get()->error("ASE: Invalid vertex index in MESH_FACENORMAL section");
- continue;
- }
-
- // We'll renormalize later
- sMesh.mNormals[faceIdx*3] += vNormal;
- sMesh.mNormals[faceIdx*3+1] += vNormal;
- sMesh.mNormals[faceIdx*3+2] += vNormal;
- continue;
- }
- }
- AI_ASE_HANDLE_SECTION("3","*MESH_NORMALS");
- }
- return;
-}
-// ------------------------------------------------------------------------------------------------
-void Parser::ParseLV4MeshFace(ASE::Face& out)
-{
- // skip spaces and tabs
- if(!SkipSpaces(&filePtr))
- {
- LogWarning("Unable to parse *MESH_FACE Element: Unexpected EOL [#1]");
- SkipToNextToken();
- return;
- }
-
- // parse the face index
- out.iFace = strtol10(filePtr,&filePtr);
-
- // next character should be ':'
- if(!SkipSpaces(&filePtr))
- {
- // FIX: there are some ASE files which haven't got : here ....
- LogWarning("Unable to parse *MESH_FACE Element: Unexpected EOL. \':\' expected [#2]");
- SkipToNextToken();
- return;
- }
- // FIX: There are some ASE files which haven't got ':' here
- if(':' == *filePtr)++filePtr;
-
- // Parse all mesh indices
- for (unsigned int i = 0; i < 3;++i)
- {
- unsigned int iIndex = 0;
- if(!SkipSpaces(&filePtr))
- {
- LogWarning("Unable to parse *MESH_FACE Element: Unexpected EOL");
- SkipToNextToken();
- return;
- }
- switch (*filePtr)
- {
- case 'A':
- case 'a':
- break;
- case 'B':
- case 'b':
- iIndex = 1;
- break;
- case 'C':
- case 'c':
- iIndex = 2;
- break;
- default:
- LogWarning("Unable to parse *MESH_FACE Element: Unexpected EOL. "
- "A,B or C expected [#3]");
- SkipToNextToken();
- return;
- };
- ++filePtr;
-
- // next character should be ':'
- if(!SkipSpaces(&filePtr) || ':' != *filePtr)
- {
- LogWarning("Unable to parse *MESH_FACE Element: "
- "Unexpected EOL. \':\' expected [#2]");
- SkipToNextToken();
- return;
- }
-
- ++filePtr;
- if(!SkipSpaces(&filePtr))
- {
- LogWarning("Unable to parse *MESH_FACE Element: Unexpected EOL. "
- "Vertex index ecpected [#4]");
- SkipToNextToken();
- return;
- }
- out.mIndices[iIndex] = strtol10(filePtr,&filePtr);
- }
-
- // now we need to skip the AB, BC, CA blocks.
- while (true)
- {
- if ('*' == *filePtr)break;
- if (IsLineEnd(*filePtr))
- {
- //iLineNumber++;
- return;
- }
- filePtr++;
- }
-
- // parse the smoothing group of the face
- if (TokenMatch(filePtr,"*MESH_SMOOTHING",15))
- {
- if(!SkipSpaces(&filePtr))
- {
- LogWarning("Unable to parse *MESH_SMOOTHING Element: "
- "Unexpected EOL. Smoothing group(s) expected [#5]");
- SkipToNextToken();
- return;
- }
-
- // Parse smoothing groups until we don't anymore see commas
- // FIX: There needn't always be a value, sad but true
- while (true)
- {
- if (*filePtr < '9' && *filePtr >= '0')
- {
- out.iSmoothGroup |= (1 << strtol10(filePtr,&filePtr));
- }
- SkipSpaces(&filePtr);
- if (',' != *filePtr)
- {
- break;
- }
- ++filePtr;
- SkipSpaces(&filePtr);
- }
- }
-
- // *MESH_MTLID is optional, too
- while (true)
- {
- if ('*' == *filePtr)break;
- if (IsLineEnd(*filePtr))
- {
- return;
- }
- filePtr++;
- }
-
- if (TokenMatch(filePtr,"*MESH_MTLID",11))
- {
- if(!SkipSpaces(&filePtr))
- {
- LogWarning("Unable to parse *MESH_MTLID Element: Unexpected EOL. "
- "Material index expected [#6]");
- SkipToNextToken();
- return;
- }
- out.iMaterial = strtol10(filePtr,&filePtr);
- }
- return;
-}
-// ------------------------------------------------------------------------------------------------
-void Parser::ParseLV4MeshLongTriple(unsigned int* apOut)
-{
- ai_assert(NULL != apOut);
-
- for (unsigned int i = 0; i < 3;++i)
- ParseLV4MeshLong(apOut[i]);
-}
-// ------------------------------------------------------------------------------------------------
-void Parser::ParseLV4MeshLongTriple(unsigned int* apOut, unsigned int& rIndexOut)
-{
- ai_assert(NULL != apOut);
-
- // parse the index
- ParseLV4MeshLong(rIndexOut);
-
- // parse the three others
- ParseLV4MeshLongTriple(apOut);
-}
-// ------------------------------------------------------------------------------------------------
-void Parser::ParseLV4MeshFloatTriple(float* apOut, unsigned int& rIndexOut)
-{
- ai_assert(NULL != apOut);
-
- // parse the index
- ParseLV4MeshLong(rIndexOut);
-
- // parse the three others
- ParseLV4MeshFloatTriple(apOut);
-}
-// ------------------------------------------------------------------------------------------------
-void Parser::ParseLV4MeshFloatTriple(float* apOut)
-{
- ai_assert(NULL != apOut);
-
- for (unsigned int i = 0; i < 3;++i)
- ParseLV4MeshFloat(apOut[i]);
-}
-// ------------------------------------------------------------------------------------------------
-void Parser::ParseLV4MeshFloat(float& fOut)
-{
- // skip spaces and tabs
- if(!SkipSpaces(&filePtr))
- {
- // LOG
- LogWarning("Unable to parse float: unexpected EOL [#1]");
- fOut = 0.0f;
- ++iLineNumber;
- return;
- }
- // parse the first float
- filePtr = fast_atof_move(filePtr,fOut);
-}
-// ------------------------------------------------------------------------------------------------
-void Parser::ParseLV4MeshLong(unsigned int& iOut)
-{
- // Skip spaces and tabs
- if(!SkipSpaces(&filePtr))
- {
- // LOG
- LogWarning("Unable to parse long: unexpected EOL [#1]");
- iOut = 0;
- ++iLineNumber;
- return;
- }
- // parse the value
- iOut = strtol10(filePtr,&filePtr);
-}
diff --git a/3rdparty/assimp/code/ASEParser.h b/3rdparty/assimp/code/ASEParser.h
deleted file mode 100644
index 57fb6c55..00000000
--- a/3rdparty/assimp/code/ASEParser.h
+++ /dev/null
@@ -1,669 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-
-/** @file Defines the helper data structures for importing ASE files */
-#ifndef AI_ASEFILEHELPER_H_INC
-#define AI_ASEFILEHELPER_H_INC
-
-// STL/CRT headers
-#include <string>
-#include <vector>
-#include <list>
-
-// public ASSIMP headers
-#include "../include/aiTypes.h"
-#include "../include/aiMesh.h"
-#include "../include/aiAnim.h"
-
-// for some helper routines like IsSpace()
-#include "ParsingUtils.h"
-#include "qnan.h"
-
-// ASE is quite similar to 3ds. We can reuse some structures
-#include "3DSLoader.h"
-
-namespace Assimp {
-namespace ASE {
-
-using namespace D3DS;
-
-// ---------------------------------------------------------------------------
-/** Helper structure representing an ASE material */
-struct Material : public D3DS::Material
-{
- //! Default constructor
- Material() : pcInstance(NULL), bNeed (false)
- {}
-
- //! Contains all sub materials of this material
- std::vector<Material> avSubMaterials;
-
- //! MaterialHelper object
- MaterialHelper* pcInstance;
-
- //! Can we remove this material?
- bool bNeed;
-};
-
-// ---------------------------------------------------------------------------
-/** Helper structure to represent an ASE file face */
-struct Face : public FaceWithSmoothingGroup
-{
- //! Default constructor. Initializes everything with 0
- Face()
- {
- mColorIndices[0] = mColorIndices[1] = mColorIndices[2] = 0;
- for (unsigned int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS;++i)
- {
- amUVIndices[i][0] = amUVIndices[i][1] = amUVIndices[i][2] = 0;
- }
-
- iMaterial = DEFAULT_MATINDEX;
- iFace = 0;
- }
-
- //! special value to indicate that no material index has
- //! been assigned to a face. The default material index
- //! will replace this value later.
- static const unsigned int DEFAULT_MATINDEX = 0xFFFFFFFF;
-
-
-
- //! Indices into each list of texture coordinates
- unsigned int amUVIndices[AI_MAX_NUMBER_OF_TEXTURECOORDS][3];
-
- //! Index into the list of vertex colors
- unsigned int mColorIndices[3];
-
- //! (Sub)Material index to be assigned to this face
- unsigned int iMaterial;
-
- //! Index of the face. It is not specified whether it is
- //! a requirement of the file format that all faces are
- //! written in sequential order, so we have to expect this case
- unsigned int iFace;
-};
-
-// ---------------------------------------------------------------------------
-/** Helper structure to represent an ASE file bone */
-struct Bone
-{
- //! Constructor
- Bone()
- {
- static int iCnt = 0;
-
- // Generate a default name for the bone
- char szTemp[128];
- ::sprintf(szTemp,"UNNAMED_%i",iCnt++);
- mName = szTemp;
- }
-
- //! Construction from an existing name
- Bone( const std::string& name)
- : mName (name)
- {}
-
- //! Name of the bone
- std::string mName;
-};
-
-// ---------------------------------------------------------------------------
-/** Helper structure to represent an ASE file bone vertex */
-struct BoneVertex
-{
- //! Bone and corresponding vertex weight.
- //! -1 for unrequired bones ....
- std::vector<std::pair<int,float> > mBoneWeights;
-
- //! Position of the bone vertex.
- //! MUST be identical to the vertex position
- //aiVector3D mPosition;
-};
-
-// ---------------------------------------------------------------------------
-/** Helper structure to represent an ASE file animation */
-struct Animation
-{
- enum Type
- {
- TRACK = 0x0,
- BEZIER = 0x1,
- TCB = 0x2
- } mRotationType, mScalingType, mPositionType;
-
- Animation()
- : mRotationType (TRACK)
- , mScalingType (TRACK)
- , mPositionType (TRACK)
- {}
-
- //! List of track rotation keyframes
- std::vector< aiQuatKey > akeyRotations;
-
- //! List of track position keyframes
- std::vector< aiVectorKey > akeyPositions;
-
- //! List of track scaling keyframes
- std::vector< aiVectorKey > akeyScaling;
-
-};
-
-// ---------------------------------------------------------------------------
-/** Helper structure to represent the inheritance information of an ASE node */
-struct InheritanceInfo
-{
- //! Default constructor
- InheritanceInfo()
- {
- // set the inheritance flag for all axes by default to true
- for (unsigned int i = 0; i < 3;++i)
- abInheritPosition[i] = abInheritRotation[i] = abInheritScaling[i] = true;
- }
-
- //! Inherit the parent's position?, axis order is x,y,z
- bool abInheritPosition[3];
-
- //! Inherit the parent's rotation?, axis order is x,y,z
- bool abInheritRotation[3];
-
- //! Inherit the parent's scaling?, axis order is x,y,z
- bool abInheritScaling[3];
-};
-
-// ---------------------------------------------------------------------------
-/** Represents an ASE file node. Base class for mesh, light and cameras */
-struct BaseNode
-{
- enum Type {Light, Camera, Mesh, Dummy} mType;
-
- //! Constructor. Creates a default name for the node
- BaseNode(Type _mType)
- : mType (_mType)
- , mProcessed (false)
- {
- // generate a default name for the node
- static int iCnt = 0;
- char szTemp[128]; // should be sufficiently large
- ::sprintf(szTemp,"UNNAMED_%i",iCnt++);
- mName = szTemp;
-
- // Set mTargetPosition to qnan
- const float qnan = get_qnan();
- mTargetPosition.x = qnan;
- }
-
- //! Name of the mesh
- std::string mName;
-
- //! Name of the parent of the node
- //! "" if there is no parent ...
- std::string mParent;
-
- //! Transformation matrix of the node
- aiMatrix4x4 mTransform;
-
- //! Target position (target lights and cameras)
- aiVector3D mTargetPosition;
-
- //! Specifies which axes transformations a node inherits
- //! from its parent ...
- InheritanceInfo inherit;
-
- //! Animation channels for the node
- Animation mAnim;
-
- //! Needed for lights and cameras: target animation channel
- //! Should contain position keys only.
- Animation mTargetAnim;
-
- bool mProcessed;
-};
-
-// ---------------------------------------------------------------------------
-/** Helper structure to represent an ASE file mesh */
-struct Mesh : public MeshWithSmoothingGroups<ASE::Face>, public BaseNode
-{
- //! Constructor.
- Mesh()
- : BaseNode (BaseNode::Mesh)
- , bSkip (false)
- {
- // use 2 texture vertex components by default
- for (unsigned int c = 0; c < AI_MAX_NUMBER_OF_TEXTURECOORDS;++c)
- this->mNumUVComponents[c] = 2;
-
- // setup the default material index by default
- iMaterialIndex = Face::DEFAULT_MATINDEX;
- }
-
- //! List of all texture coordinate sets
- std::vector<aiVector3D> amTexCoords[AI_MAX_NUMBER_OF_TEXTURECOORDS];
-
- //! List of all vertex color sets.
- std::vector<aiColor4D> mVertexColors;
-
- //! List of all bone vertices
- std::vector<BoneVertex> mBoneVertices;
-
- //! List of all bones
- std::vector<Bone> mBones;
-
- //! Material index of the mesh
- unsigned int iMaterialIndex;
-
- //! Number of vertex components for each UVW set
- unsigned int mNumUVComponents[AI_MAX_NUMBER_OF_TEXTURECOORDS];
-
- //! used internally
- bool bSkip;
-};
-
-// ---------------------------------------------------------------------------
-/** Helper structure to represent an ASE light source */
-struct Light : public BaseNode
-{
- enum LightType
- {
- OMNI,
- TARGET,
- FREE,
- DIRECTIONAL
- };
-
- //! Constructor.
- Light()
- : BaseNode (BaseNode::Light)
- , mLightType (OMNI)
- , mColor (1.f,1.f,1.f)
- , mIntensity (1.f) // light is white by default
- , mAngle (45.f)
- , mFalloff (0.f)
- {
- }
-
- LightType mLightType;
- aiColor3D mColor;
- float mIntensity;
- float mAngle; // in degrees
- float mFalloff;
-};
-
-// ---------------------------------------------------------------------------
-/** Helper structure to represent an ASE camera */
-struct Camera : public BaseNode
-{
- enum CameraType
- {
- FREE,
- TARGET
- };
-
- //! Constructor
- Camera()
- : BaseNode (BaseNode::Camera)
- , mFOV (0.75f) // in radians
- , mNear (0.1f)
- , mFar (1000.f) // could be zero
- , mCameraType (FREE)
- {
- }
-
- float mFOV, mNear, mFar;
- CameraType mCameraType;
-};
-
-// ---------------------------------------------------------------------------
-/** Helper structure to represent an ASE helper object (dummy) */
-struct Dummy : public BaseNode
-{
- //! Constructor
- Dummy()
- : BaseNode (BaseNode::Dummy)
- {
- }
-};
-
-// Parameters to Parser::Parse()
-#define AI_ASE_NEW_FILE_FORMAT 200
-#define AI_ASE_OLD_FILE_FORMAT 110
-
-// Internally we're a little bit more tolerant
-#define AI_ASE_IS_NEW_FILE_FORMAT() (iFileFormat >= 200)
-#define AI_ASE_IS_OLD_FILE_FORMAT() (iFileFormat < 200)
-
-// -------------------------------------------------------------------------------
-/** \brief Class to parse ASE files
- */
-class Parser
-{
-
-private:
-
- Parser() {}
-
-public:
-
- // -------------------------------------------------------------------
- //! Construct a parser from a given input file which is
- //! guaranted to be terminated with zero.
- //! @param szFile Input file
- //! @param fileFormatDefault Assumed file format version. If the
- //! file format is specified in the file the new value replaces
- //! the default value.
- Parser (const char* szFile, unsigned int fileFormatDefault);
-
- // -------------------------------------------------------------------
- //! Parses the file into the parsers internal representation
- void Parse();
-
-
-private:
-
- // -------------------------------------------------------------------
- //! Parse the *SCENE block in a file
- void ParseLV1SceneBlock();
-
- // -------------------------------------------------------------------
- //! Parse the *MESH_SOFTSKINVERTS block in a file
- void ParseLV1SoftSkinBlock();
-
- // -------------------------------------------------------------------
- //! Parse the *MATERIAL_LIST block in a file
- void ParseLV1MaterialListBlock();
-
- // -------------------------------------------------------------------
- //! Parse a *<xxx>OBJECT block in a file
- //! \param mesh Node to be filled
- void ParseLV1ObjectBlock(BaseNode& mesh);
-
- // -------------------------------------------------------------------
- //! Parse a *MATERIAL blocks in a material list
- //! \param mat Material structure to be filled
- void ParseLV2MaterialBlock(Material& mat);
-
- // -------------------------------------------------------------------
- //! Parse a *NODE_TM block in a file
- //! \param mesh Node (!) object to be filled
- void ParseLV2NodeTransformBlock(BaseNode& mesh);
-
- // -------------------------------------------------------------------
- //! Parse a *TM_ANIMATION block in a file
- //! \param mesh Mesh object to be filled
- void ParseLV2AnimationBlock(BaseNode& mesh);
- void ParseLV3PosAnimationBlock(ASE::Animation& anim);
- void ParseLV3ScaleAnimationBlock(ASE::Animation& anim);
- void ParseLV3RotAnimationBlock(ASE::Animation& anim);
-
- // -------------------------------------------------------------------
- //! Parse a *MESH block in a file
- //! \param mesh Mesh object to be filled
- void ParseLV2MeshBlock(Mesh& mesh);
-
- // -------------------------------------------------------------------
- //! Parse a *LIGHT_SETTINGS block in a file
- //! \param light Light object to be filled
- void ParseLV2LightSettingsBlock(Light& light);
-
- // -------------------------------------------------------------------
- //! Parse a *CAMERA_SETTINGS block in a file
- //! \param cam Camera object to be filled
- void ParseLV2CameraSettingsBlock(Camera& cam);
-
- // -------------------------------------------------------------------
- //! Parse the *MAP_XXXXXX blocks in a material
- //! \param map Texture structure to be filled
- void ParseLV3MapBlock(Texture& map);
-
- // -------------------------------------------------------------------
- //! Parse a *MESH_VERTEX_LIST block in a file
- //! \param iNumVertices Value of *MESH_NUMVERTEX, if present.
- //! Otherwise zero. This is used to check the consistency of the file.
- //! A warning is sent to the logger if the validations fails.
- //! \param mesh Mesh object to be filled
- void ParseLV3MeshVertexListBlock(
- unsigned int iNumVertices,Mesh& mesh);
-
- // -------------------------------------------------------------------
- //! Parse a *MESH_FACE_LIST block in a file
- //! \param iNumFaces Value of *MESH_NUMFACES, if present.
- //! Otherwise zero. This is used to check the consistency of the file.
- //! A warning is sent to the logger if the validations fails.
- //! \param mesh Mesh object to be filled
- void ParseLV3MeshFaceListBlock(
- unsigned int iNumFaces,Mesh& mesh);
-
- // -------------------------------------------------------------------
- //! Parse a *MESH_TVERT_LIST block in a file
- //! \param iNumVertices Value of *MESH_NUMTVERTEX, if present.
- //! Otherwise zero. This is used to check the consistency of the file.
- //! A warning is sent to the logger if the validations fails.
- //! \param mesh Mesh object to be filled
- //! \param iChannel Output UVW channel
- void ParseLV3MeshTListBlock(
- unsigned int iNumVertices,Mesh& mesh, unsigned int iChannel = 0);
-
- // -------------------------------------------------------------------
- //! Parse a *MESH_TFACELIST block in a file
- //! \param iNumFaces Value of *MESH_NUMTVFACES, if present.
- //! Otherwise zero. This is used to check the consistency of the file.
- //! A warning is sent to the logger if the validations fails.
- //! \param mesh Mesh object to be filled
- //! \param iChannel Output UVW channel
- void ParseLV3MeshTFaceListBlock(
- unsigned int iNumFaces,Mesh& mesh, unsigned int iChannel = 0);
-
- // -------------------------------------------------------------------
- //! Parse an additional mapping channel
- //! (specified via *MESH_MAPPINGCHANNEL)
- //! \param iChannel Channel index to be filled
- //! \param mesh Mesh object to be filled
- void ParseLV3MappingChannel(
- unsigned int iChannel, Mesh& mesh);
-
- // -------------------------------------------------------------------
- //! Parse a *MESH_CVERTLIST block in a file
- //! \param iNumVertices Value of *MESH_NUMCVERTEX, if present.
- //! Otherwise zero. This is used to check the consistency of the file.
- //! A warning is sent to the logger if the validations fails.
- //! \param mesh Mesh object to be filled
- void ParseLV3MeshCListBlock(
- unsigned int iNumVertices, Mesh& mesh);
-
- // -------------------------------------------------------------------
- //! Parse a *MESH_CFACELIST block in a file
- //! \param iNumFaces Value of *MESH_NUMCVFACES, if present.
- //! Otherwise zero. This is used to check the consistency of the file.
- //! A warning is sent to the logger if the validations fails.
- //! \param mesh Mesh object to be filled
- void ParseLV3MeshCFaceListBlock(
- unsigned int iNumFaces, Mesh& mesh);
-
- // -------------------------------------------------------------------
- //! Parse a *MESH_NORMALS block in a file
- //! \param mesh Mesh object to be filled
- void ParseLV3MeshNormalListBlock(Mesh& mesh);
-
- // -------------------------------------------------------------------
- //! Parse a *MESH_WEIGHTSblock in a file
- //! \param mesh Mesh object to be filled
- void ParseLV3MeshWeightsBlock(Mesh& mesh);
-
- // -------------------------------------------------------------------
- //! Parse the bone list of a file
- //! \param mesh Mesh object to be filled
- //! \param iNumBones Number of bones in the mesh
- void ParseLV4MeshBones(unsigned int iNumBones,Mesh& mesh);
-
- // -------------------------------------------------------------------
- //! Parse the bone vertices list of a file
- //! \param mesh Mesh object to be filled
- //! \param iNumVertices Number of vertices to be parsed
- void ParseLV4MeshBonesVertices(unsigned int iNumVertices,Mesh& mesh);
-
- // -------------------------------------------------------------------
- //! Parse a *MESH_FACE block in a file
- //! \param out receive the face data
- void ParseLV4MeshFace(ASE::Face& out);
-
- // -------------------------------------------------------------------
- //! Parse a *MESH_VERT block in a file
- //! (also works for MESH_TVERT, MESH_CFACE, MESH_VERTCOL ...)
- //! \param apOut Output buffer (3 floats)
- //! \param rIndexOut Output index
- void ParseLV4MeshFloatTriple(float* apOut, unsigned int& rIndexOut);
-
- // -------------------------------------------------------------------
- //! Parse a *MESH_VERT block in a file
- //! (also works for MESH_TVERT, MESH_CFACE, MESH_VERTCOL ...)
- //! \param apOut Output buffer (3 floats)
- void ParseLV4MeshFloatTriple(float* apOut);
-
- // -------------------------------------------------------------------
- //! Parse a *MESH_TFACE block in a file
- //! (also works for MESH_CFACE)
- //! \param apOut Output buffer (3 ints)
- //! \param rIndexOut Output index
- void ParseLV4MeshLongTriple(unsigned int* apOut, unsigned int& rIndexOut);
-
- // -------------------------------------------------------------------
- //! Parse a *MESH_TFACE block in a file
- //! (also works for MESH_CFACE)
- //! \param apOut Output buffer (3 ints)
- void ParseLV4MeshLongTriple(unsigned int* apOut);
-
- // -------------------------------------------------------------------
- //! Parse a single float element
- //! \param fOut Output float
- void ParseLV4MeshFloat(float& fOut);
-
- // -------------------------------------------------------------------
- //! Parse a single int element
- //! \param iOut Output integer
- void ParseLV4MeshLong(unsigned int& iOut);
-
- // -------------------------------------------------------------------
- //! Skip everything to the next: '*' or '\0'
- bool SkipToNextToken();
-
- // -------------------------------------------------------------------
- //! Skip the current section until the token after the closing }.
- //! This function handles embedded subsections correctly
- bool SkipSection();
-
- // -------------------------------------------------------------------
- //! Output a warning to the logger
- //! \param szWarn Warn message
- void LogWarning(const char* szWarn);
-
- // -------------------------------------------------------------------
- //! Output a message to the logger
- //! \param szWarn Message
- void LogInfo(const char* szWarn);
-
- // -------------------------------------------------------------------
- //! Output an error to the logger
- //! \param szWarn Error message
- void LogError(const char* szWarn);
-
- // -------------------------------------------------------------------
- //! Parse a string, enclosed in double quotation marks
- //! \param out Output string
- //! \param szName Name of the enclosing element -> used in error
- //! messages.
- //! \return false if an error occured
- bool ParseString(std::string& out,const char* szName);
-
-public:
-
- //! Pointer to current data
- const char* filePtr;
-
- //! background color to be passed to the viewer
- //! QNAN if none was found
- aiColor3D m_clrBackground;
-
- //! Base ambient color to be passed to all materials
- //! QNAN if none was found
- aiColor3D m_clrAmbient;
-
- //! List of all materials found in the file
- std::vector<Material> m_vMaterials;
-
- //! List of all meshes found in the file
- std::vector<Mesh> m_vMeshes;
-
- //! List of all dummies found in the file
- std::vector<Dummy> m_vDummies;
-
- //! List of all lights found in the file
- std::vector<Light> m_vLights;
-
- //! List of all cameras found in the file
- std::vector<Camera> m_vCameras;
-
- //! Current line in the file
- unsigned int iLineNumber;
-
- //! First frame
- unsigned int iFirstFrame;
-
- //! Last frame
- unsigned int iLastFrame;
-
- //! Frame speed - frames per second
- unsigned int iFrameSpeed;
-
- //! Ticks per frame
- unsigned int iTicksPerFrame;
-
- //! true if the last character read was an end-line character
- bool bLastWasEndLine;
-
- //! File format version
- unsigned int iFileFormat;
-};
-
-
-} // Namespace ASE
-} // Namespace ASSIMP
-
-#endif // !! include guard
diff --git a/3rdparty/assimp/code/Assimp.cpp b/3rdparty/assimp/code/Assimp.cpp
deleted file mode 100644
index e2a1f2f7..00000000
--- a/3rdparty/assimp/code/Assimp.cpp
+++ /dev/null
@@ -1,731 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-/** @file Assimp.cpp
- * @brief Implementation of the Plain-C API
- */
-
-#include "AssimpPCH.h"
-#include "../include/assimp.h"
-#include "../include/aiFileIO.h"
-
-#include "GenericProperty.h"
-
-// ------------------------------------------------------------------------------------------------
-#ifdef AI_C_THREADSAFE
-# include <boost/thread/thread.hpp>
-# include <boost/thread/mutex.hpp>
-#endif
-// ------------------------------------------------------------------------------------------------
-using namespace Assimp;
-
-namespace Assimp
-{
- /** Stores the importer objects for all active import processes */
- typedef std::map<const aiScene*, Assimp::Importer*> ImporterMap;
-
- /** Stores the LogStream objects for all active C log streams */
- struct mpred {
- bool operator () (const aiLogStream& s0, const aiLogStream& s1) const {
- return s0.callback<s1.callback&&s0.user<s1.user;
- }
- };
- typedef std::map<aiLogStream, Assimp::LogStream*, mpred> LogStreamMap;
-
- /** Stores the LogStream objects allocated by #aiGetPredefinedLogStream */
- typedef std::list<Assimp::LogStream*> PredefLogStreamMap;
-
- /** Local storage of all active import processes */
- static ImporterMap gActiveImports;
-
- /** Local storage of all active log streams */
- static LogStreamMap gActiveLogStreams;
-
- /** Local storage of LogStreams allocated by #aiGetPredefinedLogStream */
- static PredefLogStreamMap gPredefinedStreams;
-
- /** Error message of the last failed import process */
- static std::string gLastErrorString;
-
- /** Verbose logging active or not? */
- static aiBool gVerboseLogging = false;
-}
-
-/** Configuration properties */
-static ImporterPimpl::IntPropertyMap gIntProperties;
-static ImporterPimpl::FloatPropertyMap gFloatProperties;
-static ImporterPimpl::StringPropertyMap gStringProperties;
-
-#ifdef AI_C_THREADSAFE
-/** Global mutex to manage the access to the importer map */
-static boost::mutex gMutex;
-
-/** Global mutex to manage the access to the logstream map */
-static boost::mutex gLogStreamMutex;
-#endif
-
-class CIOSystemWrapper;
-class CIOStreamWrapper;
-
-// ------------------------------------------------------------------------------------------------
-// Custom IOStream implementation for the C-API
-class CIOStreamWrapper : public IOStream
-{
- friend class CIOSystemWrapper;
-public:
-
- CIOStreamWrapper(aiFile* pFile)
- : mFile(pFile)
- {}
-
- // ...................................................................
- size_t Read(void* pvBuffer,
- size_t pSize,
- size_t pCount
- ){
- // need to typecast here as C has no void*
- return mFile->ReadProc(mFile,(char*)pvBuffer,pSize,pCount);
- }
-
- // ...................................................................
- size_t Write(const void* pvBuffer,
- size_t pSize,
- size_t pCount
- ){
- // need to typecast here as C has no void*
- return mFile->WriteProc(mFile,(const char*)pvBuffer,pSize,pCount);
- }
-
- // ...................................................................
- aiReturn Seek(size_t pOffset,
- aiOrigin pOrigin
- ){
- return mFile->SeekProc(mFile,pOffset,pOrigin);
- }
-
- // ...................................................................
- size_t Tell(void) const {
- return mFile->TellProc(mFile);
- }
-
- // ...................................................................
- size_t FileSize() const {
- return mFile->FileSizeProc(mFile);
- }
-
- // ...................................................................
- void Flush () {
- return mFile->FlushProc(mFile);
- }
-
-private:
- aiFile* mFile;
-};
-
-// ------------------------------------------------------------------------------------------------
-// Custom IOStream implementation for the C-API
-class CIOSystemWrapper : public IOSystem
-{
-public:
- CIOSystemWrapper(aiFileIO* pFile)
- : mFileSystem(pFile)
- {}
-
- // ...................................................................
- bool Exists( const char* pFile) const {
- CIOSystemWrapper* pip = const_cast<CIOSystemWrapper*>(this);
- IOStream* p = pip->Open(pFile);
- if (p){
- pip->Close(p);
- return true;
- }
- return false;
- }
-
- // ...................................................................
- char getOsSeparator() const {
-#ifndef _WIN32
- return '/';
-#else
- return '\\';
-#endif
- }
-
- // ...................................................................
- IOStream* Open(const char* pFile,const char* pMode = "rb") {
- aiFile* p = mFileSystem->OpenProc(mFileSystem,pFile,pMode);
- if (!p) {
- return NULL;
- }
- return new CIOStreamWrapper(p);
- }
-
- // ...................................................................
- void Close( IOStream* pFile) {
- if (!pFile) {
- return;
- }
- mFileSystem->CloseProc(mFileSystem,((CIOStreamWrapper*) pFile)->mFile);
- delete pFile;
- }
-private:
- aiFileIO* mFileSystem;
-};
-
-// ------------------------------------------------------------------------------------------------
-// Custom LogStream implementation for the C-API
-class LogToCallbackRedirector : public LogStream
-{
-public:
- LogToCallbackRedirector(const aiLogStream& s)
- : stream (s) {
- ai_assert(NULL != s.callback);
- }
-
- ~LogToCallbackRedirector() {
-#ifdef AI_C_THREADSAFE
- boost::mutex::scoped_lock lock(gLogStreamMutex);
-#endif
- // (HACK) Check whether the 'stream.user' pointer points to a
- // custom LogStream allocated by #aiGetPredefinedLogStream.
- // In this case, we need to delete it, too. Of course, this
- // might cause strange problems, but the chance is quite low.
-
- PredefLogStreamMap::iterator it = std::find(gPredefinedStreams.begin(),
- gPredefinedStreams.end(), (Assimp::LogStream*)stream.user);
-
- if (it != gPredefinedStreams.end()) {
- delete *it;
- gPredefinedStreams.erase(it);
- }
- }
-
- /** @copydoc LogStream::write */
- void write(const char* message) {
- stream.callback(message,stream.user);
- }
-
-private:
- aiLogStream stream;
-};
-
-// ------------------------------------------------------------------------------------------------
-void ReportSceneNotFoundError()
-{
- DefaultLogger::get()->error("Unable to find the Assimp::Importer for this aiScene. "
- "Are you playing fools with us? Don't mix cpp and c API. Thanks.");
-
- assert(false);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads the given file and returns its content.
-const aiScene* aiImportFile( const char* pFile, unsigned int pFlags)
-{
- return aiImportFileEx(pFile,pFlags,NULL);
-}
-
-// ------------------------------------------------------------------------------------------------
-const aiScene* aiImportFileEx( const char* pFile, unsigned int pFlags,
- aiFileIO* pFS)
-{
- ai_assert(NULL != pFile);
-
- const aiScene* scene = NULL;
- ASSIMP_BEGIN_EXCEPTION_REGION();
-
- // create an Importer for this file
- Assimp::Importer* imp = new Assimp::Importer();
-
-#ifdef AI_C_THREADSAFE
- boost::mutex::scoped_lock lock(gMutex);
-#endif
- // copy the global property lists to the Importer instance
- imp->pimpl->mIntProperties = gIntProperties;
- imp->pimpl->mFloatProperties = gFloatProperties;
- imp->pimpl->mStringProperties = gStringProperties;
-
-#ifdef AI_C_THREADSAFE
- lock.unlock();
-#endif
-
- // setup a custom IO system if necessary
- if (pFS) {
- imp->SetIOHandler( new CIOSystemWrapper (pFS) );
- }
-
- // and have it read the file
- scene = imp->ReadFile( pFile, pFlags);
-
- // if succeeded, place it in the collection of active processes
- if ( scene) {
-#ifdef AI_C_THREADSAFE
- lock.lock();
-#endif
- gActiveImports[scene] = imp;
- }
- else {
- // if failed, extract error code and destroy the import
- gLastErrorString = imp->GetErrorString();
- delete imp;
- }
-
- // return imported data. If the import failed the pointer is NULL anyways
- ASSIMP_END_EXCEPTION_REGION(const aiScene*);
- return scene;
-}
-
-// ------------------------------------------------------------------------------------------------
-const aiScene* aiImportFileFromMemory(
- const char* pBuffer,
- unsigned int pLength,
- unsigned int pFlags,
- const char* pHint)
-{
- ai_assert(NULL != pBuffer && 0 != pLength);
-
- const aiScene* scene = NULL;
- ASSIMP_BEGIN_EXCEPTION_REGION();
-
- // create an Importer for this file
- Assimp::Importer* imp = new Assimp::Importer();
-
-#ifdef AI_C_THREADSAFE
- boost::mutex::scoped_lock lock(gMutex);
-#endif
- // copy the global property lists to the Importer instance
- imp->pimpl->mIntProperties = gIntProperties;
- imp->pimpl->mFloatProperties = gFloatProperties;
- imp->pimpl->mStringProperties = gStringProperties;
-
-#ifdef AI_C_THREADSAFE
- lock.unlock();
-#endif
-
- // and have it read the file from the memory buffer
- scene = imp->ReadFileFromMemory( pBuffer, pLength, pFlags,pHint);
-
- // if succeeded, place it in the collection of active processes
- if ( scene) {
-#ifdef AI_C_THREADSAFE
- lock.lock();
-#endif
- gActiveImports[scene] = imp;
- }
- else {
- // if failed, extract error code and destroy the import
- gLastErrorString = imp->GetErrorString();
- delete imp;
- }
- // return imported data. If the import failed the pointer is NULL anyways
- ASSIMP_END_EXCEPTION_REGION(const aiScene*);
- return scene;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Releases all resources associated with the given import process.
-void aiReleaseImport( const aiScene* pScene)
-{
- if (!pScene) {
- return;
- }
-
- ASSIMP_BEGIN_EXCEPTION_REGION();
-
-#ifdef AI_C_THREADSAFE
- boost::mutex::scoped_lock lock(gMutex);
-#endif
-
- // find the importer associated with this data
- ImporterMap::iterator it = gActiveImports.find( pScene);
- // it should be there... else the user is playing fools with us
- if ( it == gActiveImports.end()) {
- ReportSceneNotFoundError();
- return;
- }
-
- // kill the importer, the data dies with it
- delete it->second;
- gActiveImports.erase( it);
- ASSIMP_END_EXCEPTION_REGION(void);
-}
-
-// ------------------------------------------------------------------------------------------------
-ASSIMP_API const aiScene* aiApplyPostProcessing(const aiScene* pScene,
- unsigned int pFlags)
-{
- const aiScene* sc = NULL;
-
-
- ASSIMP_BEGIN_EXCEPTION_REGION();
-
-#ifdef AI_C_THREADSAFE
- boost::mutex::scoped_lock lock(gMutex);
-#endif
- // find the importer associated with this data
- ImporterMap::iterator it = gActiveImports.find( pScene);
- // it should be there... else the user is playing fools with us
- if ( it == gActiveImports.end()) {
- ReportSceneNotFoundError();
- return NULL;
- }
-#ifdef AI_C_THREADSAFE
- lock.unlock();
-#endif
- sc = it->second->ApplyPostProcessing(pFlags);
-#ifdef AI_C_THREADSAFE
- lock.lock();
-#endif
- if (!sc) {
- // kill the importer, the data dies with it
- delete it->second;
- gActiveImports.erase( it);
- return NULL;
- }
-
- ASSIMP_END_EXCEPTION_REGION(const aiScene*);
- return sc;
-}
-
-// ------------------------------------------------------------------------------------------------
-void CallbackToLogRedirector (const char* msg, char* dt)
-{
- ai_assert(NULL != msg && NULL != dt);
- LogStream* s = (LogStream*)dt;
-
- s->write(msg);
-}
-
-// ------------------------------------------------------------------------------------------------
-ASSIMP_API aiLogStream aiGetPredefinedLogStream(aiDefaultLogStream pStream,const char* file)
-{
- aiLogStream sout;
-
- ASSIMP_BEGIN_EXCEPTION_REGION();
- LogStream* stream = LogStream::createDefaultStream(pStream,file);
- if (!stream) {
- sout.callback = NULL;
- sout.user = NULL;
- }
- else {
- sout.callback = &CallbackToLogRedirector;
- sout.user = (char*)stream;
- }
- gPredefinedStreams.push_back(stream);
- ASSIMP_END_EXCEPTION_REGION(aiLogStream);
- return sout;
-}
-
-// ------------------------------------------------------------------------------------------------
-ASSIMP_API void aiAttachLogStream( const aiLogStream* stream )
-{
- ASSIMP_BEGIN_EXCEPTION_REGION();
-
-#ifdef AI_C_THREADSAFE
- boost::mutex::scoped_lock lock(gLogStreamMutex);
-#endif
-
- LogStream* lg = new LogToCallbackRedirector(*stream);
- gActiveLogStreams[*stream] = lg;
-
- if (DefaultLogger::isNullLogger()) {
- DefaultLogger::create(NULL,(gVerboseLogging == AI_TRUE ? Logger::VERBOSE : Logger::NORMAL));
- }
- DefaultLogger::get()->attachStream(lg);
- ASSIMP_END_EXCEPTION_REGION(void);
-}
-
-// ------------------------------------------------------------------------------------------------
-ASSIMP_API aiReturn aiDetachLogStream( const aiLogStream* stream)
-{
- ASSIMP_BEGIN_EXCEPTION_REGION();
-
-#ifdef AI_C_THREADSAFE
- boost::mutex::scoped_lock lock(gLogStreamMutex);
-#endif
- // find the logstream associated with this data
- LogStreamMap::iterator it = gActiveLogStreams.find( *stream);
- // it should be there... else the user is playing fools with us
- if ( it == gActiveLogStreams.end()) {
- return AI_FAILURE;
- }
- DefaultLogger::get()->detatchStream( it->second );
- delete it->second;
-
- gActiveLogStreams.erase( it);
-
- if (gActiveLogStreams.empty()) {
- DefaultLogger::kill();
- }
- ASSIMP_END_EXCEPTION_REGION(aiReturn);
- return AI_SUCCESS;
-}
-
-// ------------------------------------------------------------------------------------------------
-ASSIMP_API void aiDetachAllLogStreams(void)
-{
- ASSIMP_BEGIN_EXCEPTION_REGION();
-#ifdef AI_C_THREADSAFE
- boost::mutex::scoped_lock lock(gLogStreamMutex);
-#endif
- for (LogStreamMap::iterator it = gActiveLogStreams.begin(); it != gActiveLogStreams.end(); ++it) {
- DefaultLogger::get()->detatchStream( it->second );
- delete it->second;
- }
- gActiveLogStreams.clear();
- DefaultLogger::kill();
- ASSIMP_END_EXCEPTION_REGION(void);
-}
-
-// ------------------------------------------------------------------------------------------------
-ASSIMP_API void aiEnableVerboseLogging(aiBool d)
-{
- if (!DefaultLogger::isNullLogger()) {
- DefaultLogger::get()->setLogSeverity((d == AI_TRUE ? Logger::VERBOSE : Logger::NORMAL));
- }
- gVerboseLogging = d;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Returns the error text of the last failed import process.
-const char* aiGetErrorString()
-{
- return gLastErrorString.c_str();
-}
-
-// ------------------------------------------------------------------------------------------------
-// Returns the error text of the last failed import process.
-aiBool aiIsExtensionSupported(const char* szExtension)
-{
- ai_assert(NULL != szExtension);
- aiBool candoit=AI_FALSE;
- ASSIMP_BEGIN_EXCEPTION_REGION();
-
-#ifdef AI_C_THREADSAFE
- boost::mutex::scoped_lock lock(gMutex);
-#endif
-
- if (!gActiveImports.empty()) {
- return ((*(gActiveImports.begin())).second->IsExtensionSupported( szExtension )) ? AI_TRUE : AI_FALSE;
- }
-
- // fixme: no need to create a temporary Importer instance just for that ..
- Assimp::Importer tmp;
- candoit = tmp.IsExtensionSupported(std::string(szExtension)) ? AI_TRUE : AI_FALSE;
-
- ASSIMP_END_EXCEPTION_REGION(aiBool);
- return candoit;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Get a list of all file extensions supported by ASSIMP
-void aiGetExtensionList(aiString* szOut)
-{
- ai_assert(NULL != szOut);
- ASSIMP_BEGIN_EXCEPTION_REGION();
-
-#ifdef AI_C_THREADSAFE
- boost::mutex::scoped_lock lock(gMutex);
-#endif
-
- if (!gActiveImports.empty()) {
- (*(gActiveImports.begin())).second->GetExtensionList(*szOut);
- return;
- }
- // fixme: no need to create a temporary Importer instance just for that ..
- Assimp::Importer tmp;
- tmp.GetExtensionList(*szOut);
-
- ASSIMP_END_EXCEPTION_REGION(void);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Get the memory requirements for a particular import.
-void aiGetMemoryRequirements(const C_STRUCT aiScene* pIn,
- C_STRUCT aiMemoryInfo* in)
-{
- ASSIMP_BEGIN_EXCEPTION_REGION();
-#ifdef AI_C_THREADSAFE
- boost::mutex::scoped_lock lock(gMutex);
-#endif
-
- // find the importer associated with this data
- ImporterMap::iterator it = gActiveImports.find( pIn);
- // it should be there... else the user is playing fools with us
- if ( it == gActiveImports.end()) {
- ReportSceneNotFoundError();
- return;
- }
- // get memory statistics
-#ifdef AI_C_THREADSAFE
- lock.unlock();
-#endif
- it->second->GetMemoryRequirements(*in);
- ASSIMP_END_EXCEPTION_REGION(void);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Importer::SetPropertyInteger
-ASSIMP_API void aiSetImportPropertyInteger(const char* szName, int value)
-{
- ASSIMP_BEGIN_EXCEPTION_REGION();
-#ifdef AI_C_THREADSAFE
- boost::mutex::scoped_lock lock(gMutex);
-#endif
- SetGenericProperty<int>(gIntProperties,szName,value,NULL);
- ASSIMP_END_EXCEPTION_REGION(void);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Importer::SetPropertyFloat
-ASSIMP_API void aiSetImportPropertyFloat(const char* szName, float value)
-{
- ASSIMP_BEGIN_EXCEPTION_REGION();
-#ifdef AI_C_THREADSAFE
- boost::mutex::scoped_lock lock(gMutex);
-#endif
- SetGenericProperty<float>(gFloatProperties,szName,value,NULL);
- ASSIMP_END_EXCEPTION_REGION(void);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Importer::SetPropertyString
-ASSIMP_API void aiSetImportPropertyString(const char* szName,
- const C_STRUCT aiString* st)
-{
- if (!st) {
- return;
- }
- ASSIMP_BEGIN_EXCEPTION_REGION();
-#ifdef AI_C_THREADSAFE
- boost::mutex::scoped_lock lock(gMutex);
-#endif
- SetGenericProperty<std::string>(gStringProperties,szName,
- std::string( st->data ),NULL);
- ASSIMP_END_EXCEPTION_REGION(void);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Rotation matrix to quaternion
-ASSIMP_API void aiCreateQuaternionFromMatrix(aiQuaternion* quat,const aiMatrix3x3* mat)
-{
- ai_assert(NULL != quat && NULL != mat);
- *quat = aiQuaternion(*mat);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Matrix decomposition
-ASSIMP_API void aiDecomposeMatrix(const aiMatrix4x4* mat,aiVector3D* scaling,
- aiQuaternion* rotation,
- aiVector3D* position)
-{
- ai_assert(NULL != rotation && NULL != position && NULL != scaling && NULL != mat);
- mat->Decompose(*scaling,*rotation,*position);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Matrix transpose
-ASSIMP_API void aiTransposeMatrix3(aiMatrix3x3* mat)
-{
- ai_assert(NULL != mat);
- mat->Transpose();
-}
-
-// ------------------------------------------------------------------------------------------------
-ASSIMP_API void aiTransposeMatrix4(aiMatrix4x4* mat)
-{
- ai_assert(NULL != mat);
- mat->Transpose();
-}
-
-// ------------------------------------------------------------------------------------------------
-// Vector transformation
-ASSIMP_API void aiTransformVecByMatrix3(C_STRUCT aiVector3D* vec,
- const C_STRUCT aiMatrix3x3* mat)
-{
- ai_assert(NULL != mat && NULL != vec);
- *vec *= (*mat);
-}
-
-// ------------------------------------------------------------------------------------------------
-ASSIMP_API void aiTransformVecByMatrix4(C_STRUCT aiVector3D* vec,
- const C_STRUCT aiMatrix4x4* mat)
-{
- ai_assert(NULL != mat && NULL != vec);
- *vec *= (*mat);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Matrix multiplication
-ASSIMP_API void aiMultiplyMatrix4(
- C_STRUCT aiMatrix4x4* dst,
- const C_STRUCT aiMatrix4x4* src)
-{
- ai_assert(NULL != dst && NULL != src);
- *dst = (*dst) * (*src);
-}
-
-// ------------------------------------------------------------------------------------------------
-ASSIMP_API void aiMultiplyMatrix3(
- C_STRUCT aiMatrix3x3* dst,
- const C_STRUCT aiMatrix3x3* src)
-{
- ai_assert(NULL != dst && NULL != src);
- *dst = (*dst) * (*src);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Matrix identity
-ASSIMP_API void aiIdentityMatrix3(
- C_STRUCT aiMatrix3x3* mat)
-{
- ai_assert(NULL != mat);
- *mat = aiMatrix3x3();
-}
-
-// ------------------------------------------------------------------------------------------------
-ASSIMP_API void aiIdentityMatrix4(
- C_STRUCT aiMatrix4x4* mat)
-{
- ai_assert(NULL != mat);
- *mat = aiMatrix4x4();
-}
-
-
diff --git a/3rdparty/assimp/code/AssimpPCH.cpp b/3rdparty/assimp/code/AssimpPCH.cpp
deleted file mode 100644
index cdc007c5..00000000
--- a/3rdparty/assimp/code/AssimpPCH.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-
-// Actually just a dummy, used by the compiler to build the precompiled header.
-
-#include "AssimpPCH.h"
-#include "./../include/aiVersion.h"
-
-// --------------------------------------------------------------------------------
-// Legal information string - dont't remove from image!
-static const char* LEGAL_INFORMATION =
-
-"Open Asset Import Library (Assimp).\n"
-"A free C/C++ library to import various 3D file formats into applications\n\n"
-
-"(c) 2008-2010, ASSIMP Development Team\n"
-"License under the terms and conditions of the 3-clause BSD license\n"
-"http://assimp.sourceforge.net\n"
-;
-
-// ------------------------------------------------------------------------------------------------
-// Get legal string
-ASSIMP_API const char* aiGetLegalString () {
- return LEGAL_INFORMATION;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Get Assimp minor version
-ASSIMP_API unsigned int aiGetVersionMinor () {
- return 0;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Get Assimp major version
-ASSIMP_API unsigned int aiGetVersionMajor () {
- return 2;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Get flags used for compilation
-ASSIMP_API unsigned int aiGetCompileFlags () {
-
- unsigned int flags = 0;
-
-#ifdef ASSIMP_BUILD_BOOST_WORKAROUND
- flags |= ASSIMP_CFLAGS_NOBOOST;
-#endif
-#ifdef ASSIMP_BUILD_SINGLETHREADED
- flags |= ASSIMP_CFLAGS_SINGLETHREADED;
-#endif
-#ifdef ASSIMP_BUILD_DEBUG
- flags |= ASSIMP_CFLAGS_DEBUG;
-#endif
-#ifdef ASSIMP_BUILD_DLL_EXPORT
- flags |= ASSIMP_CFLAGS_SHARED;
-#endif
-#ifdef _STLPORT_VERSION
- flags |= ASSIMP_CFLAGS_STLPORT;
-#endif
-
- return flags;
-}
-
-// include current build revision, which is even updated from time to time -- :-)
-#include "../revision.h"
-
-// ------------------------------------------------------------------------------------------------
-ASSIMP_API unsigned int aiGetVersionRevision ()
-{
- return SVNRevision;
-}
-
diff --git a/3rdparty/assimp/code/AssimpPCH.h b/3rdparty/assimp/code/AssimpPCH.h
deleted file mode 100644
index a0eb1fae..00000000
--- a/3rdparty/assimp/code/AssimpPCH.h
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file AssimpPCH.h
- * PCH master include. Every unit in Assimp has to include it.
- */
-
-#ifndef ASSIMP_PCH_INCLUDED
-#define ASSIMP_PCH_INCLUDED
-#define ASSIMP_INTERNAL_BUILD
-
-// ----------------------------------------------------------------------------------------
-/* General compile config taken from aiDefines.h. It is important that the user compiles
- * using exactly the same settings in aiDefines.h. Settings in AssimpPCH.h may differ,
- * they won't affect the public API.
- */
-#include "../include/aiDefines.h"
-
-/* Include our stdint.h replacement header for MSVC, take the global header for gcc/mingw
- */
-#ifdef _MSC_VER
-# include "pstdint.h"
-#else
-# include <stdint.h>
-#endif
-
-/* Undefine the min/max macros defined by some platform headers (namely Windows.h) to
- * avoid obvious conflicts with std::min() and std::max().
- */
-#undef min
-#undef max
-
-/* Concatenate two tokens after evaluating them
- */
-#define _AI_CONCAT(a,b) a ## b
-#define AI_CONCAT(a,b) _AI_CONCAT(a,b)
-
-/* Helper macro to set a pointer to NULL in debug builds
- */
-#if (defined _DEBUG)
-# define AI_DEBUG_INVALIDATE_PTR(x) x = NULL;
-#else
-# define AI_DEBUG_INVALIDATE_PTR(x)
-#endif
-
-/* Beginning with MSVC8 some C string manipulation functions are mapped to their _safe_
- * counterparts (e.g. _itoa_s). This avoids a lot of trouble with deprecation warnings.
- */
-#if _MSC_VER >= 1400 && !(defined _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES)
-# define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES 1
-#endif
-
-/* size_t to unsigned int, possible loss of data. The compiler is right with his warning
- * but this loss of data won't be a problem for us. So shut up, little boy.
- */
-#ifdef _MSC_VER
-# pragma warning (disable : 4267)
-#endif
-
-// ----------------------------------------------------------------------------------------
-/* Actually that's not required for MSVC. It is included somewhere in the deeper parts of
- * the MSVC STL but it's necessary for proper build with STLport.
- */
-#include <ctype.h>
-
-// Runtime/STL headers
-#include <vector>
-#include <list>
-#include <map>
-#include <set>
-#include <string>
-#include <sstream>
-#include <iomanip>
-#include <cassert>
-#include <stack>
-#include <queue>
-#include <iostream>
-#include <algorithm>
-#include <numeric>
-#include <new>
-#include <cstdio>
-
-// Boost headers
-#include <boost/pointer_cast.hpp>
-#include <boost/scoped_ptr.hpp>
-#include <boost/scoped_array.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/shared_array.hpp>
-//#include <boost/make_shared.hpp>
-#include <boost/format.hpp>
-#include <boost/foreach.hpp>
-#include <boost/static_assert.hpp>
-#include <boost/lexical_cast.hpp>
-
-// Public ASSIMP headers
-#include "../include/DefaultLogger.h"
-#include "../include/IOStream.h"
-#include "../include/IOSystem.h"
-#include "../include/aiScene.h"
-#include "../include/aiPostProcess.h"
-#include "../include/assimp.hpp"
-
-// Internal utility headers
-#include "BaseImporter.h"
-#include "MaterialSystem.h"
-#include "StringComparison.h"
-#include "StreamReader.h"
-#include "qnan.h"
-
-
-#endif // !! ASSIMP_PCH_INCLUDED
diff --git a/3rdparty/assimp/code/B3DImporter.cpp b/3rdparty/assimp/code/B3DImporter.cpp
deleted file mode 100644
index 983d0db5..00000000
--- a/3rdparty/assimp/code/B3DImporter.cpp
+++ /dev/null
@@ -1,672 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file B3DImporter.cpp
- * @brief Implementation of the b3d importer class
- */
-
-#include "AssimpPCH.h"
-#ifndef ASSIMP_BUILD_NO_B3D_IMPORTER
-
-// internal headers
-#include "B3DImporter.h"
-#include "TextureTransform.h"
-#include "ConvertToLHProcess.h"
-
-using namespace Assimp;
-using namespace std;
-
-// (fixme, Aramis) quick workaround to get rid of all those signed to unsigned warnings
-#ifdef _MSC_VER
-# pragma warning (disable: 4018)
-#endif
-
-//#define DEBUG_B3D
-
-// ------------------------------------------------------------------------------------------------
-bool B3DImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const{
-
- size_t pos=pFile.find_last_of( '.' );
- if ( pos==string::npos ) return false;
-
- string ext=pFile.substr( pos+1 );
- if ( ext.size()!=3 ) return false;
-
- return (ext[0]=='b' || ext[0]=='B') && (ext[1]=='3') && (ext[2]=='d' || ext[2]=='D');
-}
-
-// ------------------------------------------------------------------------------------------------
-void B3DImporter::GetExtensionList( std::set<std::string>& extensions ){
- extensions.insert("b3d");
-}
-
-#ifdef DEBUG_B3D
- extern "C"{ void _stdcall AllocConsole(); }
-#endif
-// ------------------------------------------------------------------------------------------------
-void B3DImporter::InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler){
-
-#ifdef DEBUG_B3D
- AllocConsole();
- freopen( "conin$","r",stdin );
- freopen( "conout$","w",stdout );
- freopen( "conout$","w",stderr );
- cout<<"Hello world from the B3DImporter!"<<endl;
-#endif
-
- boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile));
-
- // Check whether we can read from the file
- if ( file.get() == NULL)
- throw DeadlyImportError( "Failed to open B3D file " + pFile + ".");
-
- // check whether the .b3d file is large enough to contain
- // at least one chunk.
- size_t fileSize = file->FileSize();
- if ( fileSize<8 ) throw DeadlyImportError( "B3D File is too small.");
-
- _pos=0;
- _buf.resize( fileSize );
- file->Read( &_buf[0],1,fileSize );
- _stack.clear();
-
- ReadBB3D( pScene );
-}
-
-// ------------------------------------------------------------------------------------------------
-void B3DImporter::Oops(){
- throw DeadlyImportError( "B3D Importer - INTERNAL ERROR" );
-}
-
-// ------------------------------------------------------------------------------------------------
-void B3DImporter::Fail( string str ){
-#ifdef DEBUG_B3D
- cout<<"Error in B3D file data: "<<str<<endl;
-#endif
- throw DeadlyImportError( "B3D Importer - error in B3D file data: "+str );
-}
-
-// ------------------------------------------------------------------------------------------------
-int B3DImporter::ReadByte(){
- if ( _pos<_buf.size() ) return _buf[_pos++];
- Fail( "EOF" );
- return 0;
-}
-
-// ------------------------------------------------------------------------------------------------
-int B3DImporter::ReadInt(){
- if ( _pos+4<=_buf.size() ){
- int n=*(int*)&_buf[_pos];
- _pos+=4;
- return n;
- }
- Fail( "EOF" );
- return 0;
-}
-
-// ------------------------------------------------------------------------------------------------
-float B3DImporter::ReadFloat(){
- if ( _pos+4<=_buf.size() ){
- float n=*(float*)&_buf[_pos];
- _pos+=4;
- return n;
- }
- Fail( "EOF" );
- return 0.0f;
-}
-
-// ------------------------------------------------------------------------------------------------
-aiVector2D B3DImporter::ReadVec2(){
- float x=ReadFloat();
- float y=ReadFloat();
- return aiVector2D( x,y );
-}
-
-// ------------------------------------------------------------------------------------------------
-aiVector3D B3DImporter::ReadVec3(){
- float x=ReadFloat();
- float y=ReadFloat();
- float z=ReadFloat();
- return aiVector3D( x,y,z );
-}
-
-// ------------------------------------------------------------------------------------------------
-aiQuaternion B3DImporter::ReadQuat(){
- // (aramis_acg) Fix to adapt the loader to changed quat orientation
- float w=-ReadFloat();
- float x=ReadFloat();
- float y=ReadFloat();
- float z=ReadFloat();
- return aiQuaternion( w,x,y,z );
-}
-
-// ------------------------------------------------------------------------------------------------
-string B3DImporter::ReadString(){
- string str;
- while ( _pos<_buf.size() ){
- char c=(char)ReadByte();
- if ( !c ) return str;
- str+=c;
- }
- Fail( "EOF" );
- return string();
-}
-
-// ------------------------------------------------------------------------------------------------
-string B3DImporter::ReadChunk(){
- string tag;
- for ( int i=0;i<4;++i ){
- tag+=char( ReadByte() );
- }
-#ifdef DEBUG_B3D
-// cout<<"ReadChunk:"<<tag<<endl;
-#endif
- unsigned sz=(unsigned)ReadInt();
- _stack.push_back( _pos+sz );
- return tag;
-}
-
-// ------------------------------------------------------------------------------------------------
-void B3DImporter::ExitChunk(){
- _pos=_stack.back();
- _stack.pop_back();
-}
-
-// ------------------------------------------------------------------------------------------------
-unsigned B3DImporter::ChunkSize(){
- return _stack.back()-_pos;
-}
-// ------------------------------------------------------------------------------------------------
-
-template<class T>
-T *B3DImporter::to_array( const vector<T> &v ){
- if ( !v.size() ) return 0;
- T *p=new T[v.size()];
- for ( size_t i=0;i<v.size();++i ){
- p[i]=v[i];
- }
- return p;
-}
-
-// ------------------------------------------------------------------------------------------------
-void B3DImporter::ReadTEXS(){
- while ( ChunkSize() ){
- string name=ReadString();
- /*int flags=*/ReadInt();
- /*int blend=*/ReadInt();
- /*aiVector2D pos=*/ReadVec2();
- /*aiVector2D scale=*/ReadVec2();
- /*float rot=*/ReadFloat();
-
- _textures.push_back( name );
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void B3DImporter::ReadBRUS(){
- int n_texs=ReadInt();
- if ( n_texs<0 || n_texs>8 ){
- Fail( "Bad texture count" );
- }
- while ( ChunkSize() ){
- string name=ReadString();
- aiVector3D color=ReadVec3();
- float alpha=ReadFloat();
- float shiny=ReadFloat();
- /*int blend=**/ReadInt();
- int fx=ReadInt();
-
- MaterialHelper *mat=new MaterialHelper;
- _materials.push_back( mat );
-
- // Name
- aiString ainame( name );
- mat->AddProperty( &ainame,AI_MATKEY_NAME );
-
- // Diffuse color
- mat->AddProperty( &color,1,AI_MATKEY_COLOR_DIFFUSE );
-
- // Opacity
- mat->AddProperty( &alpha,1,AI_MATKEY_OPACITY );
-
- // Specular color
- aiColor3D speccolor( shiny,shiny,shiny );
- mat->AddProperty( &speccolor,1,AI_MATKEY_COLOR_SPECULAR );
-
- // Specular power
- float specpow=shiny*128;
- mat->AddProperty( &specpow,1,AI_MATKEY_SHININESS );
-
- // Double sided
- if ( fx & 0x10 ){
- int i=1;
- mat->AddProperty( &i,1,AI_MATKEY_TWOSIDED );
- }
-
- //Textures
- for ( int i=0;i<n_texs;++i ){
- int texid=ReadInt();
- if ( texid<-1 || (texid>=0 && texid>=static_cast<int>(_textures.size())) ){
- Fail( "Bad texture id" );
- }
- if ( i==0 && texid>=0 ){
- aiString texname( _textures[texid] );
- mat->AddProperty( &texname,AI_MATKEY_TEXTURE_DIFFUSE(0) );
- }
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void B3DImporter::ReadVRTS(){
- _vflags=ReadInt();
- _tcsets=ReadInt();
- _tcsize=ReadInt();
- if ( _tcsets<0 || _tcsets>4 || _tcsize<0 || _tcsize>4 ){
- Fail( "Bad texcoord data" );
- }
-
- int sz=12+(_vflags&1?12:0)+(_vflags&2?16:0)+(_tcsets*_tcsize*4);
- int n_verts=ChunkSize()/sz;
-
- int v0=_vertices.size();
- _vertices.resize( v0+n_verts );
-
- for ( int i=0;i<n_verts;++i ){
- Vertex &v=_vertices[v0+i];
-
- memset( v.bones,0,sizeof(v.bones) );
- memset( v.weights,0,sizeof(v.weights) );
-
- v.vertex=ReadVec3();
-
- if ( _vflags & 1 ) v.normal=ReadVec3();
-
- if ( _vflags & 2 ) ReadQuat(); //skip v 4bytes...
-
- for ( int i=0;i<_tcsets;++i ){
- float t[4]={0,0,0,0};
- for ( int j=0;j<_tcsize;++j ){
- t[j]=ReadFloat();
- }
- t[1]=1-t[1];
- if ( !i ) v.texcoords=aiVector3D( t[0],t[1],t[2] );
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void B3DImporter::ReadTRIS( int v0 ){
- int matid=ReadInt();
- if ( matid==-1 ){
- matid=0;
- }else if ( matid<0 || matid>=(int)_materials.size() ){
-#ifdef DEBUG_B3D
- cout<<"material id="<<matid<<endl;
-#endif
- Fail( "Bad material id" );
- }
-
- aiMesh *mesh=new aiMesh;
- _meshes.push_back( mesh );
-
- mesh->mMaterialIndex=matid;
- mesh->mNumFaces=0;
- mesh->mPrimitiveTypes=aiPrimitiveType_TRIANGLE;
-
- int n_tris=ChunkSize()/12;
- aiFace *face=mesh->mFaces=new aiFace[n_tris];
-
- for ( int i=0;i<n_tris;++i ){
- int i0=ReadInt()+v0;
- int i1=ReadInt()+v0;
- int i2=ReadInt()+v0;
- if ( i0<0 || i0>=(int)_vertices.size() || i1<0 || i1>=(int)_vertices.size() || i2<0 || i2>=(int)_vertices.size() ){
-#ifdef DEBUG_B3D
- cout<<"Bad triangle index: i0="<<i0<<", i1="<<i1<<", i2="<<i2<<endl;
-#endif
- Fail( "Bad triangle index" );
- continue;
- }
- face->mNumIndices=3;
- face->mIndices=new unsigned[3];
- face->mIndices[0]=i0;
- face->mIndices[1]=i1;
- face->mIndices[2]=i2;
- ++mesh->mNumFaces;
- ++face;
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void B3DImporter::ReadMESH(){
- /*int matid=*/ReadInt();
-
- int v0=_vertices.size();
-
- while ( ChunkSize() ){
- string t=ReadChunk();
- if ( t=="VRTS" ){
- ReadVRTS();
- }else if ( t=="TRIS" ){
- ReadTRIS( v0 );
- }
- ExitChunk();
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void B3DImporter::ReadBONE( int id ){
- while ( ChunkSize() ){
- int vertex=ReadInt();
- float weight=ReadFloat();
- if ( vertex<0 || vertex>=(int)_vertices.size() ){
- Fail( "Bad vertex index" );
- }
-
- Vertex &v=_vertices[vertex];
- int i;
- for ( i=0;i<4;++i ){
- if ( !v.weights[i] ){
- v.bones[i]=id;
- v.weights[i]=weight;
- break;
- }
- }
-#ifdef DEBUG_B3D
- if ( i==4 ){
- cout<<"Too many bone weights"<<endl;
- }
-#endif
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void B3DImporter::ReadKEYS( aiNodeAnim *nodeAnim ){
- vector<aiVectorKey> trans,scale;
- vector<aiQuatKey> rot;
- int flags=ReadInt();
- while ( ChunkSize() ){
- int frame=ReadInt();
- if ( flags & 1 ){
- trans.push_back( aiVectorKey( frame,ReadVec3() ) );
- }
- if ( flags & 2 ){
- scale.push_back( aiVectorKey( frame,ReadVec3() ) );
- }
- if ( flags & 4 ){
- rot.push_back( aiQuatKey( frame,ReadQuat() ) );
- }
- }
-
- if ( flags & 1 ){
- nodeAnim->mNumPositionKeys=trans.size();
- nodeAnim->mPositionKeys=to_array( trans );
- }
-
- if ( flags & 2 ){
- nodeAnim->mNumScalingKeys=scale.size();
- nodeAnim->mScalingKeys=to_array( scale );
- }
-
- if ( flags & 4 ){
- nodeAnim->mNumRotationKeys=rot.size();
- nodeAnim->mRotationKeys=to_array( rot );
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void B3DImporter::ReadANIM(){
- /*int flags=*/ReadInt();
- int frames=ReadInt();
- float fps=ReadFloat();
-
- aiAnimation *anim=new aiAnimation;
- _animations.push_back( anim );
-
- anim->mDuration=frames;
- anim->mTicksPerSecond=fps;
-}
-
-// ------------------------------------------------------------------------------------------------
-aiNode *B3DImporter::ReadNODE( aiNode *parent ){
-
- string name=ReadString();
- aiVector3D t=ReadVec3();
- aiVector3D s=ReadVec3();
- aiQuaternion r=ReadQuat();
-
- aiMatrix4x4 trans,scale,rot;
-
- aiMatrix4x4::Translation( t,trans );
- aiMatrix4x4::Scaling( s,scale );
- rot=aiMatrix4x4( r.GetMatrix() );
-
- aiMatrix4x4 tform=trans * rot * scale;
-
- int nodeid=_nodes.size();
-
- aiNode *node=new aiNode( name );
- _nodes.push_back( node );
-
- node->mParent=parent;
- node->mTransformation=tform;
-
- aiNodeAnim *nodeAnim=0;
- vector<unsigned> meshes;
- vector<aiNode*> children;
-
- while ( ChunkSize() ){
- string t=ReadChunk();
- if ( t=="MESH" ){
- int n=_meshes.size();
- ReadMESH();
- for ( int i=n;i<(int)_meshes.size();++i ){
- meshes.push_back( i );
- }
- }else if ( t=="BONE" ){
- ReadBONE( nodeid );
- }else if ( t=="ANIM" ){
- ReadANIM();
- }else if ( t=="KEYS" ){
- if ( !nodeAnim ){
- nodeAnim=new aiNodeAnim;
- _nodeAnims.push_back( nodeAnim );
- nodeAnim->mNodeName=node->mName;
- }
- ReadKEYS( nodeAnim );
- }else if ( t=="NODE" ){
- aiNode *child=ReadNODE( node );
- children.push_back( child );
- }
- ExitChunk();
- }
-
- node->mNumMeshes=meshes.size();
- node->mMeshes=to_array( meshes );
-
- node->mNumChildren=children.size();
- node->mChildren=to_array( children );
-
- return node;
-}
-
-// ------------------------------------------------------------------------------------------------
-void B3DImporter::ReadBB3D( aiScene *scene ){
-
- _textures.clear();
- _materials.size();
-
- _vertices.clear();
- _meshes.clear();
-
- _nodes.clear();
- _nodeAnims.clear();
- _animations.clear();
-
- string t=ReadChunk();
- if ( t=="BB3D" ){
- int version=ReadInt();
-
- if (!DefaultLogger::isNullLogger()) {
- char dmp[128];
- sprintf(dmp,"B3D file format version: %i",version);
- DefaultLogger::get()->info(dmp);
- }
-
- while ( ChunkSize() ){
- string t=ReadChunk();
- if ( t=="TEXS" ){
- ReadTEXS();
- }else if ( t=="BRUS" ){
- ReadBRUS();
- }else if ( t=="NODE" ){
- ReadNODE( 0 );
- }
- ExitChunk();
- }
- }
- ExitChunk();
-
- if ( !_nodes.size() ) Fail( "No nodes" );
-
- if ( !_meshes.size() ) Fail( "No meshes" );
-
- //Fix nodes/meshes/bones
- for (size_t i=0;i<_nodes.size();++i ){
- aiNode *node=_nodes[i];
-
- for ( size_t j=0;j<node->mNumMeshes;++j ){
- aiMesh *mesh=_meshes[node->mMeshes[j]];
-
- int n_tris=mesh->mNumFaces;
- int n_verts=mesh->mNumVertices=n_tris * 3;
-
- aiVector3D *mv=mesh->mVertices=new aiVector3D[ n_verts ],*mn=0,*mc=0;
- if ( _vflags & 1 ) mn=mesh->mNormals=new aiVector3D[ n_verts ];
- if ( _tcsets ) mc=mesh->mTextureCoords[0]=new aiVector3D[ n_verts ];
-
- aiFace *face=mesh->mFaces;
-
- vector< vector<aiVertexWeight> > vweights( _nodes.size() );
-
- for ( int i=0;i<n_verts;i+=3 ){
- for ( int j=0;j<3;++j ){
- Vertex &v=_vertices[face->mIndices[j]];
-
- *mv++=v.vertex;
- if ( mn ) *mn++=v.normal;
- if ( mc ) *mc++=v.texcoords;
-
- face->mIndices[j]=i+j;
-
- for ( int k=0;k<4;++k ){
- if ( !v.weights[k] ) break;
-
- int bone=v.bones[k];
- float weight=v.weights[k];
-
- vweights[bone].push_back( aiVertexWeight(i+j,weight) );
- }
- }
- ++face;
- }
-
- vector<aiBone*> bones;
- for (size_t i=0;i<vweights.size();++i ){
- vector<aiVertexWeight> &weights=vweights[i];
- if ( !weights.size() ) continue;
-
- aiBone *bone=new aiBone;
- bones.push_back( bone );
-
- aiNode *bnode=_nodes[i];
-
- bone->mName=bnode->mName;
- bone->mNumWeights=weights.size();
- bone->mWeights=to_array( weights );
-
- aiMatrix4x4 mat=bnode->mTransformation;
- while ( bnode->mParent ){
- bnode=bnode->mParent;
- mat=bnode->mTransformation * mat;
- }
- bone->mOffsetMatrix=mat.Inverse();
- }
- mesh->mNumBones=bones.size();
- mesh->mBones=to_array( bones );
- }
- }
-
- //nodes
- scene->mRootNode=_nodes[0];
-
- //material
- if ( !_materials.size() ){
- _materials.push_back( new MaterialHelper );
- }
- scene->mNumMaterials=_materials.size();
- scene->mMaterials=to_array( _materials );
-
- //meshes
- scene->mNumMeshes=_meshes.size();
- scene->mMeshes=to_array( _meshes );
-
- //animations
- if ( _animations.size()==1 && _nodeAnims.size() ){
-
- aiAnimation *anim=_animations.back();
- anim->mNumChannels=_nodeAnims.size();
- anim->mChannels=to_array( _nodeAnims );
-
- scene->mNumAnimations=_animations.size();
- scene->mAnimations=to_array( _animations );
- }
-
- // convert to RH
- MakeLeftHandedProcess makeleft;
- makeleft.Execute( scene );
-
- FlipWindingOrderProcess flip;
- flip.Execute( scene );
-}
-
-#endif // !! ASSIMP_BUILD_NO_B3D_IMPORTER
diff --git a/3rdparty/assimp/code/B3DImporter.h b/3rdparty/assimp/code/B3DImporter.h
deleted file mode 100644
index fa627694..00000000
--- a/3rdparty/assimp/code/B3DImporter.h
+++ /dev/null
@@ -1,126 +0,0 @@
-
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file Definition of the .b3d importer class. */
-
-#ifndef AI_B3DIMPORTER_H_INC
-#define AI_B3DIMPORTER_H_INC
-
-#include "../include/aiTypes.h"
-#include "../include/aiMesh.h"
-#include "../include/aiMaterial.h"
-
-#include <string>
-#include <vector>
-
-namespace Assimp{
-
-class B3DImporter : public BaseImporter{
-public:
-
- virtual bool CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const;
-
-protected:
-
- virtual void GetExtensionList(std::set<std::string>& extensions);
- virtual void InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler);
-
-private:
-
- int ReadByte();
- int ReadInt();
- float ReadFloat();
- aiVector2D ReadVec2();
- aiVector3D ReadVec3();
- aiQuaternion ReadQuat();
- std::string ReadString();
- std::string ReadChunk();
- void ExitChunk();
- unsigned ChunkSize();
-
- template<class T>
- T *to_array( const std::vector<T> &v );
-
- struct Vertex{
- aiVector3D vertex;
- aiVector3D normal;
- aiVector3D texcoords;
- unsigned char bones[4];
- float weights[4];
- };
-
- void Oops();
- void Fail( std::string str );
-
- void ReadTEXS();
- void ReadBRUS();
-
- void ReadVRTS();
- void ReadTRIS( int v0 );
- void ReadMESH();
- void ReadBONE( int id );
- void ReadKEYS( aiNodeAnim *nodeAnim );
- void ReadANIM();
-
- aiNode *ReadNODE( aiNode *parent );
-
- void ReadBB3D( aiScene *scene );
-
- unsigned _pos;
-// unsigned _size;
- std::vector<unsigned char> _buf;
- std::vector<unsigned> _stack;
-
- std::vector<std::string> _textures;
- std::vector<aiMaterial*> _materials;
-
- int _vflags,_tcsets,_tcsize;
- std::vector<Vertex> _vertices;
-
- std::vector<aiNode*> _nodes;
- std::vector<aiMesh*> _meshes;
- std::vector<aiNodeAnim*> _nodeAnims;
- std::vector<aiAnimation*> _animations;
-};
-
-}
-
-#endif
diff --git a/3rdparty/assimp/code/BVHLoader.cpp b/3rdparty/assimp/code/BVHLoader.cpp
deleted file mode 100644
index 8272ce62..00000000
--- a/3rdparty/assimp/code/BVHLoader.cpp
+++ /dev/null
@@ -1,505 +0,0 @@
-/** Implementation of the BVH loader */
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
-copyright notice, this list of conditions and the
-following disclaimer.
-
-* Redistributions in binary form must reproduce the above
-copyright notice, this list of conditions and the
-following disclaimer in the documentation and/or other
-materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
-contributors may be used to endorse or promote products
-derived from this software without specific prior
-written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-#include "AssimpPCH.h"
-#ifndef ASSIMP_BUILD_NO_BVH_IMPORTER
-
-#include "BVHLoader.h"
-#include "fast_atof.h"
-#include "SkeletonMeshBuilder.h"
-
-using namespace Assimp;
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-BVHLoader::BVHLoader()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-BVHLoader::~BVHLoader()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the class can handle the format of the given file.
-bool BVHLoader::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool cs) const
-{
- // check file extension
- const std::string extension = GetExtension(pFile);
-
- if ( extension == "bvh")
- return true;
-
- if ((!extension.length() || cs) && pIOHandler) {
- const char* tokens[] = {"HIERARCHY"};
- return SearchFileHeaderForToken(pIOHandler,pFile,tokens,1);
- }
- return false;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Imports the given file into the given scene structure.
-void BVHLoader::InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler)
-{
- mFileName = pFile;
-
- // read file into memory
- boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile));
- if ( file.get() == NULL)
- throw DeadlyImportError( "Failed to open file " + pFile + ".");
-
- size_t fileSize = file->FileSize();
- if ( fileSize == 0)
- throw DeadlyImportError( "File is too small.");
-
- mBuffer.resize( fileSize);
- file->Read( &mBuffer.front(), 1, fileSize);
-
- // start reading
- mReader = mBuffer.begin();
- mLine = 1;
- ReadStructure( pScene);
-
- // build a dummy mesh for the skeleton so that we see something at least
- SkeletonMeshBuilder meshBuilder( pScene);
-
- // construct an animation from all the motion data we read
- CreateAnimation( pScene);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads the file
-void BVHLoader::ReadStructure( aiScene* pScene)
-{
- // first comes hierarchy
- std::string header = GetNextToken();
- if ( header != "HIERARCHY")
- ThrowException( "Expected header string \"HIERARCHY\".");
- ReadHierarchy( pScene);
-
- // then comes the motion data
- std::string motion = GetNextToken();
- if ( motion != "MOTION")
- ThrowException( "Expected beginning of motion data \"MOTION\".");
- ReadMotion( pScene);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads the hierarchy
-void BVHLoader::ReadHierarchy( aiScene* pScene)
-{
- std::string root = GetNextToken();
- if ( root != "ROOT")
- ThrowException( "Expected root node \"ROOT\".");
-
- // Go read the hierarchy from here
- pScene->mRootNode = ReadNode();
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads a node and recursively its childs and returns the created node;
-aiNode* BVHLoader::ReadNode()
-{
- // first token is name
- std::string nodeName = GetNextToken();
- if ( nodeName.empty() || nodeName == "{")
- ThrowException( boost::str( boost::format( "Expected node name, but found \"%s\".") % nodeName));
-
- // then an opening brace should follow
- std::string openBrace = GetNextToken();
- if ( openBrace != "{")
- ThrowException( boost::str( boost::format( "Expected opening brace \"{\", but found \"%s\".") % openBrace));
-
- // Create a node
- aiNode* node = new aiNode( nodeName);
- std::vector<aiNode*> childNodes;
-
- // and create an bone entry for it
- mNodes.push_back( Node( node));
- Node& internNode = mNodes.back();
-
- // now read the node's contents
- while ( 1)
- {
- std::string token = GetNextToken();
-
- // node offset to parent node
- if ( token == "OFFSET")
- ReadNodeOffset( node);
- else if ( token == "CHANNELS")
- ReadNodeChannels( internNode);
- else if ( token == "JOINT")
- {
- // child node follows
- aiNode* child = ReadNode();
- child->mParent = node;
- childNodes.push_back( child);
- }
- else if ( token == "End")
- {
- // The real symbol is "End Site". Second part comes in a separate token
- std::string siteToken = GetNextToken();
- if ( siteToken != "Site")
- ThrowException( boost::str( boost::format( "Expected \"End Site\" keyword, but found \"%s %s\".") % token % siteToken));
-
- aiNode* child = ReadEndSite( nodeName);
- child->mParent = node;
- childNodes.push_back( child);
- }
- else if ( token == "}")
- {
- // we're done with that part of the hierarchy
- break;
- } else
- {
- // everything else is a parse error
- ThrowException( boost::str( boost::format( "Unknown keyword \"%s\".") % token));
- }
- }
-
- // add the child nodes if there are any
- if ( childNodes.size() > 0)
- {
- node->mNumChildren = childNodes.size();
- node->mChildren = new aiNode*[node->mNumChildren];
- std::copy( childNodes.begin(), childNodes.end(), node->mChildren);
- }
-
- // and return the sub-hierarchy we built here
- return node;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads an end node and returns the created node.
-aiNode* BVHLoader::ReadEndSite( const std::string& pParentName)
-{
- // check opening brace
- std::string openBrace = GetNextToken();
- if ( openBrace != "{")
- ThrowException( boost::str( boost::format( "Expected opening brace \"{\", but found \"%s\".") % openBrace));
-
- // Create a node
- aiNode* node = new aiNode( "EndSite_" + pParentName);
-
- // now read the node's contents. Only possible entry is "OFFSET"
- while ( 1)
- {
- std::string token = GetNextToken();
-
- // end node's offset
- if ( token == "OFFSET")
- {
- ReadNodeOffset( node);
- }
- else if ( token == "}")
- {
- // we're done with the end node
- break;
- } else
- {
- // everything else is a parse error
- ThrowException( boost::str( boost::format( "Unknown keyword \"%s\".") % token));
- }
- }
-
- // and return the sub-hierarchy we built here
- return node;
-}
-// ------------------------------------------------------------------------------------------------
-// Reads a node offset for the given node
-void BVHLoader::ReadNodeOffset( aiNode* pNode)
-{
- // Offset consists of three floats to read
- aiVector3D offset;
- offset.x = GetNextTokenAsFloat();
- offset.y = GetNextTokenAsFloat();
- offset.z = GetNextTokenAsFloat();
-
- // build a transformation matrix from it
- pNode->mTransformation = aiMatrix4x4( 1.0f, 0.0f, 0.0f, offset.x, 0.0f, 1.0f, 0.0f, offset.y,
- 0.0f, 0.0f, 1.0f, offset.z, 0.0f, 0.0f, 0.0f, 1.0f);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads the animation channels for the given node
-void BVHLoader::ReadNodeChannels( BVHLoader::Node& pNode)
-{
- // number of channels. Use the float reader because we're lazy
- float numChannelsFloat = GetNextTokenAsFloat();
- unsigned int numChannels = (unsigned int) numChannelsFloat;
-
- for ( unsigned int a = 0; a < numChannels; a++)
- {
- std::string channelToken = GetNextToken();
-
- if ( channelToken == "Xposition")
- pNode.mChannels.push_back( Channel_PositionX);
- else if ( channelToken == "Yposition")
- pNode.mChannels.push_back( Channel_PositionY);
- else if ( channelToken == "Zposition")
- pNode.mChannels.push_back( Channel_PositionZ);
- else if ( channelToken == "Xrotation")
- pNode.mChannels.push_back( Channel_RotationX);
- else if ( channelToken == "Yrotation")
- pNode.mChannels.push_back( Channel_RotationY);
- else if ( channelToken == "Zrotation")
- pNode.mChannels.push_back( Channel_RotationZ);
- else
- ThrowException( boost::str( boost::format( "Invalid channel specifier \"%s\".") % channelToken));
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads the motion data
-void BVHLoader::ReadMotion( aiScene* pScene)
-{
- // Read number of frames
- std::string tokenFrames = GetNextToken();
- if ( tokenFrames != "Frames:")
- ThrowException( boost::str( boost::format( "Expected frame count \"Frames:\", but found \"%s\".") % tokenFrames));
-
- float numFramesFloat = GetNextTokenAsFloat();
- mAnimNumFrames = (unsigned int) numFramesFloat;
-
- // Read frame duration
- std::string tokenDuration1 = GetNextToken();
- std::string tokenDuration2 = GetNextToken();
- if ( tokenDuration1 != "Frame" || tokenDuration2 != "Time:")
- ThrowException( boost::str( boost::format( "Expected frame duration \"Frame Time:\", but found \"%s %s\".") % tokenDuration1 % tokenDuration2));
-
- mAnimTickDuration = GetNextTokenAsFloat();
-
- // resize value vectors for each node
- for ( std::vector<Node>::iterator it = mNodes.begin(); it != mNodes.end(); ++it)
- it->mChannelValues.reserve( it->mChannels.size() * mAnimNumFrames);
-
- // now read all the data and store it in the corresponding node's value vector
- for ( unsigned int frame = 0; frame < mAnimNumFrames; ++frame)
- {
- // on each line read the values for all nodes
- for ( std::vector<Node>::iterator it = mNodes.begin(); it != mNodes.end(); ++it)
- {
- // get as many values as the node has channels
- for ( unsigned int c = 0; c < it->mChannels.size(); ++c)
- it->mChannelValues.push_back( GetNextTokenAsFloat());
- }
-
- // after one frame worth of values for all nodes there should be a newline, but we better don't rely on it
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Retrieves the next token
-std::string BVHLoader::GetNextToken()
-{
- // skip any preceeding whitespace
- while ( mReader != mBuffer.end())
- {
- if ( !isspace( *mReader))
- break;
-
- // count lines
- if ( *mReader == '\n')
- mLine++;
-
- ++mReader;
- }
-
- // collect all chars till the next whitespace. BVH is easy in respect to that.
- std::string token;
- while ( mReader != mBuffer.end())
- {
- if ( isspace( *mReader))
- break;
-
- token.push_back( *mReader);
- ++mReader;
-
- // little extra logic to make sure braces are counted correctly
- if ( token == "{" || token == "}")
- break;
- }
-
- // empty token means end of file, which is just fine
- return token;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads the next token as a float
-float BVHLoader::GetNextTokenAsFloat()
-{
- std::string token = GetNextToken();
- if ( token.empty())
- ThrowException( "Unexpected end of file while trying to read a float");
-
- // check if the float is valid by testing if the atof() function consumed every char of the token
- const char* ctoken = token.c_str();
- float result = 0.0f;
- ctoken = fast_atof_move( ctoken, result);
-
- if ( ctoken != token.c_str() + token.length())
- ThrowException( boost::str( boost::format( "Expected a floating point number, but found \"%s\".") % token));
-
- return result;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Aborts the file reading with an exception
-void BVHLoader::ThrowException( const std::string& pError)
-{
- throw DeadlyImportError( boost::str( boost::format( "%s:%d - %s") % mFileName % mLine % pError));
-}
-
-// ------------------------------------------------------------------------------------------------
-// Constructs an animation for the motion data and stores it in the given scene
-void BVHLoader::CreateAnimation( aiScene* pScene)
-{
- // create the animation
- pScene->mNumAnimations = 1;
- pScene->mAnimations = new aiAnimation*[1];
- aiAnimation* anim = new aiAnimation;
- pScene->mAnimations[0] = anim;
-
- // put down the basic parameters
- anim->mName.Set( "Motion");
- anim->mTicksPerSecond = 1.0 / double( mAnimTickDuration);
- anim->mDuration = double( mAnimNumFrames - 1);
-
- // now generate the tracks for all nodes
- anim->mNumChannels = mNodes.size();
- anim->mChannels = new aiNodeAnim*[anim->mNumChannels];
-
- // FIX: set the array elements to NULL to ensure proper deletion if an exception is thrown
- for (unsigned int i = 0; i < anim->mNumChannels;++i)
- anim->mChannels[i] = NULL;
-
- for ( unsigned int a = 0; a < anim->mNumChannels; a++)
- {
- const Node& node = mNodes[a];
- const std::string nodeName = std::string( node.mNode->mName.data );
- aiNodeAnim* nodeAnim = new aiNodeAnim;
- anim->mChannels[a] = nodeAnim;
- nodeAnim->mNodeName.Set( nodeName);
-
- // translational part, if given
- if ( node.mChannels.size() == 6)
- {
- nodeAnim->mNumPositionKeys = mAnimNumFrames;
- nodeAnim->mPositionKeys = new aiVectorKey[mAnimNumFrames];
- aiVectorKey* poskey = nodeAnim->mPositionKeys;
- for ( unsigned int fr = 0; fr < mAnimNumFrames; ++fr)
- {
- poskey->mTime = double( fr);
-
- // Now compute all translations in the right order
- for ( unsigned int channel = 0; channel < 3; ++channel)
- {
- switch( node.mChannels[channel])
- {
- case Channel_PositionX: poskey->mValue.x = node.mChannelValues[fr * node.mChannels.size() + channel]; break;
- case Channel_PositionY: poskey->mValue.y = node.mChannelValues[fr * node.mChannels.size() + channel]; break;
- case Channel_PositionZ: poskey->mValue.z = node.mChannelValues[fr * node.mChannels.size() + channel]; break;
- default: throw DeadlyImportError( "Unexpected animation channel setup at node " + nodeName );
- }
- }
- ++poskey;
- }
- } else
- {
- // if no translation part is given, put a default sequence
- aiVector3D nodePos( node.mNode->mTransformation.a4, node.mNode->mTransformation.b4, node.mNode->mTransformation.c4);
- nodeAnim->mNumPositionKeys = 1;
- nodeAnim->mPositionKeys = new aiVectorKey[1];
- nodeAnim->mPositionKeys[0].mTime = 0.0;
- nodeAnim->mPositionKeys[0].mValue = nodePos;
- }
-
- // rotation part. Always present. First find value offsets
- {
- unsigned int rotOffset = 0;
- if ( node.mChannels.size() == 6)
- {
- // Offset all further calculations
- rotOffset = 3;
- }
-
- // Then create the number of rotation keys
- nodeAnim->mNumRotationKeys = mAnimNumFrames;
- nodeAnim->mRotationKeys = new aiQuatKey[mAnimNumFrames];
- aiQuatKey* rotkey = nodeAnim->mRotationKeys;
- for ( unsigned int fr = 0; fr < mAnimNumFrames; ++fr)
- {
- aiMatrix4x4 temp;
- aiMatrix3x3 rotMatrix;
-
- for ( unsigned int channel = 0; channel < 3; ++channel)
- {
- // translate ZXY euler angels into a quaternion
- const float angle = node.mChannelValues[fr * node.mChannels.size() + rotOffset + channel] * float( AI_MATH_PI) / 180.0f;
-
- // Compute rotation transformations in the right order
- switch (node.mChannels[rotOffset+channel])
- {
- case Channel_RotationX: aiMatrix4x4::RotationX( angle, temp); rotMatrix *= aiMatrix3x3( temp); break;
- case Channel_RotationY: aiMatrix4x4::RotationY( angle, temp); rotMatrix *= aiMatrix3x3( temp); break;
- case Channel_RotationZ: aiMatrix4x4::RotationZ( angle, temp); rotMatrix *= aiMatrix3x3( temp); break;
- default: throw DeadlyImportError( "Unexpected animation channel setup at node " + nodeName );
- }
- }
-
- rotkey->mTime = double( fr);
- rotkey->mValue = aiQuaternion( rotMatrix);
- ++rotkey;
- }
- }
-
- // scaling part. Always just a default track
- {
- nodeAnim->mNumScalingKeys = 1;
- nodeAnim->mScalingKeys = new aiVectorKey[1];
- nodeAnim->mScalingKeys[0].mTime = 0.0;
- nodeAnim->mScalingKeys[0].mValue.Set( 1.0f, 1.0f, 1.0f);
- }
- }
-}
-
-#endif // !! ASSIMP_BUILD_NO_BVH_IMPORTER
diff --git a/3rdparty/assimp/code/BVHLoader.h b/3rdparty/assimp/code/BVHLoader.h
deleted file mode 100644
index 74800a18..00000000
--- a/3rdparty/assimp/code/BVHLoader.h
+++ /dev/null
@@ -1,173 +0,0 @@
-/** Defines the BHV motion capturing loader class */
-
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
-copyright notice, this list of conditions and the
-following disclaimer.
-
-* Redistributions in binary form must reproduce the above
-copyright notice, this list of conditions and the
-following disclaimer in the documentation and/or other
-materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
-contributors may be used to endorse or promote products
-derived from this software without specific prior
-written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file BVHLoader.h
- * @brief Biovision BVH import
- */
-
-#ifndef AI_BVHLOADER_H_INC
-#define AI_BVHLOADER_H_INC
-
-#include "BaseImporter.h"
-
-namespace Assimp
-{
-
-// --------------------------------------------------------------------------------
-/** Loader class to read Motion Capturing data from a .bvh file.
- *
- * This format only contains a hierarchy of joints and a series of keyframes for
- * the hierarchy. It contains no actual mesh data, but we generate a dummy mesh
- * inside the loader just to be able to see something.
-*/
-class BVHLoader : public BaseImporter
-{
- friend class Importer;
-
- /** Possible animation channels for which the motion data holds the values */
- enum ChannelType
- {
- Channel_PositionX,
- Channel_PositionY,
- Channel_PositionZ,
- Channel_RotationX,
- Channel_RotationY,
- Channel_RotationZ
- };
-
- /** Collected list of node. Will be bones of the dummy mesh some day, addressed by their array index */
- struct Node
- {
- const aiNode* mNode;
- std::vector<ChannelType> mChannels;
- std::vector<float> mChannelValues; // motion data values for that node. Of size NumChannels * NumFrames
-
- Node() { }
- Node( const aiNode* pNode) : mNode( pNode) { }
- };
-
-protected:
- /** Constructor to be privately used by Importer */
- BVHLoader();
-
- /** Destructor, private as well */
- ~BVHLoader();
-
-public:
- /** Returns whether the class can handle the format of the given file.
- * See BaseImporter::CanRead() for details. */
- bool CanRead( const std::string& pFile, IOSystem* pIOHandler, bool cs) const;
-
-protected:
- /** Called by Importer::GetExtensionList() for each loaded importer.
- * See BaseImporter::GetExtensionList() for details
- */
- void GetExtensionList(std::set<std::string>& extensions)
- {
- extensions.insert("bvh");
- }
-
- /** Imports the given file into the given scene structure.
- * See BaseImporter::InternReadFile() for details
- */
- void InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler);
-
-protected:
- /** Reads the file */
- void ReadStructure( aiScene* pScene);
-
- /** Reads the hierarchy */
- void ReadHierarchy( aiScene* pScene);
-
- /** Reads a node and recursively its childs and returns the created node. */
- aiNode* ReadNode();
-
- /** Reads an end node and returns the created node. */
- aiNode* ReadEndSite( const std::string& pParentName);
-
- /** Reads a node offset for the given node */
- void ReadNodeOffset( aiNode* pNode);
-
- /** Reads the animation channels into the given node */
- void ReadNodeChannels( BVHLoader::Node& pNode);
-
- /** Reads the motion data */
- void ReadMotion( aiScene* pScene);
-
- /** Retrieves the next token */
- std::string GetNextToken();
-
- /** Reads the next token as a float */
- float GetNextTokenAsFloat();
-
- /** Aborts the file reading with an exception */
- void ThrowException( const std::string& pError);
-
- /** Constructs an animation for the motion data and stores it in the given scene */
- void CreateAnimation( aiScene* pScene);
-
-protected:
- /** Filename, for a verbose error message */
- std::string mFileName;
-
- /** Buffer to hold the loaded file */
- std::vector<char> mBuffer;
-
- /** Next char to read from the buffer */
- std::vector<char>::const_iterator mReader;
-
- /** Current line, for error messages */
- unsigned int mLine;
-
- /** Collected list of nodes. Will be bones of the dummy mesh some day, addressed by their array index.
- * Also contain the motion data for the node's channels
- */
- std::vector<Node> mNodes;
-
- /** basic Animation parameters */
- float mAnimTickDuration;
- unsigned int mAnimNumFrames;
-};
-
-} // end of namespace Assimp
-
-#endif // AI_BVHLOADER_H_INC
diff --git a/3rdparty/assimp/code/BaseImporter.cpp b/3rdparty/assimp/code/BaseImporter.cpp
deleted file mode 100644
index 06422679..00000000
--- a/3rdparty/assimp/code/BaseImporter.cpp
+++ /dev/null
@@ -1,527 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file BaseImporter.cpp
- * @brief Implementation of BaseImporter
- */
-
-#include "AssimpPCH.h"
-#include "BaseImporter.h"
-#include "FileSystemFilter.h"
-
-using namespace Assimp;
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-BaseImporter::BaseImporter()
-: progress()
-{
- // nothing to do here
-}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-BaseImporter::~BaseImporter()
-{
- // nothing to do here
-}
-
-// ------------------------------------------------------------------------------------------------
-// Imports the given file and returns the imported data.
-aiScene* BaseImporter::ReadFile(const Importer* pImp, const std::string& pFile, IOSystem* pIOHandler)
-{
- progress = pImp->GetProgressHandler();
- ai_assert(progress);
-
- // Gather configuration properties for this run
- SetupProperties( pImp );
-
- // Construct a file system filter to improve our success ratio at reading external files
- FileSystemFilter filter(pFile,pIOHandler);
-
- // create a scene object to hold the data
- ScopeGuard<aiScene> sc(new aiScene());
-
- // dispatch importing
- try
- {
- InternReadFile( pFile, sc, &filter);
-
- } catch( const std::exception& err ) {
- // extract error description
- mErrorText = err.what();
- DefaultLogger::get()->error(mErrorText);
- return NULL;
- }
-
- // return what we gathered from the import.
- sc.dismiss();
- return sc;
-}
-
-// ------------------------------------------------------------------------------------------------
-void BaseImporter::SetupProperties(const Importer* pImp)
-{
- // the default implementation does nothing
-}
-
-// ------------------------------------------------------------------------------------------------
-/*static*/ bool BaseImporter::SearchFileHeaderForToken(IOSystem* pIOHandler,
- const std::string& pFile,
- const char** tokens,
- unsigned int numTokens,
- unsigned int searchBytes /* = 200 */)
-{
- ai_assert(NULL != tokens && 0 != numTokens && 0 != searchBytes);
- if (!pIOHandler)
- return false;
-
- boost::scoped_ptr<IOStream> pStream (pIOHandler->Open(pFile));
- if (pStream.get() ) {
- // read 200 characters from the file
- boost::scoped_array<char> _buffer (new char[searchBytes+1 /* for the '\0' */]);
- char* buffer = _buffer.get();
-
- const unsigned int read = pStream->Read(buffer,1,searchBytes);
- if (!read)
- return false;
-
- for (unsigned int i = 0; i < read;++i)
- buffer[i] = ::tolower(buffer[i]);
-
- // It is not a proper handling of unicode files here ...
- // ehm ... but it works in most cases.
- char* cur = buffer,*cur2 = buffer,*end = &buffer[read];
- while (cur != end) {
- if (*cur)
- *cur2++ = *cur;
- ++cur;
- }
- *cur2 = '\0';
-
- for (unsigned int i = 0; i < numTokens;++i) {
- ai_assert(NULL != tokens[i]);
-
- if (::strstr(buffer,tokens[i])) {
- DefaultLogger::get()->debug(std::string("Found positive match for header keyword: ") + tokens[i]);
- return true;
- }
- }
- }
- return false;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Simple check for file extension
-/*static*/ bool BaseImporter::SimpleExtensionCheck (const std::string& pFile,
- const char* ext0,
- const char* ext1,
- const char* ext2)
-{
- std::string::size_type pos = pFile.find_last_of('.');
-
- // no file extension - can't read
- if ( pos == std::string::npos)
- return false;
-
- const char* ext_real = & pFile[ pos+1 ];
- if ( !ASSIMP_stricmp(ext_real,ext0) )
- return true;
-
- // check for other, optional, file extensions
- if (ext1 && !ASSIMP_stricmp(ext_real,ext1))
- return true;
-
- if (ext2 && !ASSIMP_stricmp(ext_real,ext2))
- return true;
-
- return false;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Get file extension from path
-/*static*/ std::string BaseImporter::GetExtension (const std::string& pFile)
-{
- std::string::size_type pos = pFile.find_last_of('.');
-
- // no file extension at all
- if ( pos == std::string::npos)
- return "";
-
- std::string ret = pFile.substr(pos+1);
- std::transform(ret.begin(),ret.end(),ret.begin(),::tolower); // thanks to Andy Maloney for the hint
- return ret;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Check for magic bytes at the beginning of the file.
-/* static */ bool BaseImporter::CheckMagicToken(IOSystem* pIOHandler, const std::string& pFile,
- const void* _magic, unsigned int num, unsigned int offset, unsigned int size)
-{
- ai_assert(size <= 16 && _magic);
-
- if (!pIOHandler) {
- return false;
- }
- union {
- const char* magic;
- const uint16_t* magic_u16;
- const uint32_t* magic_u32;
- };
- magic = reinterpret_cast<const char*>(_magic);
- boost::scoped_ptr<IOStream> pStream (pIOHandler->Open(pFile));
- if (pStream.get() ) {
-
- // skip to offset
- pStream->Seek(offset,aiOrigin_SET);
-
- // read 'size' characters from the file
- union {
- char data[16];
- uint16_t data_u16[8];
- uint32_t data_u32[4];
- };
- if (size != pStream->Read(data,1,size)) {
- return false;
- }
-
- for (unsigned int i = 0; i < num; ++i) {
- // also check against big endian versions of tokens with size 2,4
- // that's just for convinience, the chance that we cause conflicts
- // is quite low and it can save some lines and prevent nasty bugs
- if (2 == size) {
- uint16_t rev = *magic_u16;
- ByteSwap::Swap(&rev);
- if (data_u16[0] == *magic_u16 || data_u16[0] == rev) {
- return true;
- }
- }
- else if (4 == size) {
- uint32_t rev = *magic_u32;
- ByteSwap::Swap(&rev);
- if (data_u32[0] == *magic_u32 || data_u32[0] == rev) {
- return true;
- }
- }
- else {
- // any length ... just compare
- if (!memcmp(magic,data,size)) {
- return true;
- }
- }
- magic += size;
- }
- }
- return false;
-}
-
-#include "../contrib/ConvertUTF/ConvertUTF.h"
-
-// ------------------------------------------------------------------------------------------------
-void ReportResult(ConversionResult res)
-{
- if (res == sourceExhausted) {
- DefaultLogger::get()->error("Source ends with incomplete character sequence, transformation to UTF-8 fails");
- }
- else if (res == sourceIllegal) {
- DefaultLogger::get()->error("Source contains illegal character sequence, transformation to UTF-8 fails");
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Convert to UTF8 data
-void BaseImporter::ConvertToUTF8(std::vector<char>& data)
-{
- ConversionResult result;
- if (data.size() < 8) {
- throw DeadlyImportError("File is too small");
- }
-
- // UTF 8 with BOM
- if ((uint8_t)data[0] == 0xEF && (uint8_t)data[1] == 0xBB && (uint8_t)data[2] == 0xBF) {
- DefaultLogger::get()->debug("Found UTF-8 BOM ...");
-
- std::copy(data.begin()+3,data.end(),data.begin());
- data.resize(data.size()-3);
- return;
- }
-
- // UTF 32 BE with BOM
- if (*((uint32_t*)&data.front()) == 0xFFFE0000) {
-
- // swap the endianess ..
- for (uint32_t* p = (uint32_t*)&data.front(), *end = (uint32_t*)&data.back(); p <= end; ++p) {
- AI_SWAP4P(p);
- }
- }
-
- // UTF 32 LE with BOM
- if (*((uint32_t*)&data.front()) == 0x0000FFFE) {
- DefaultLogger::get()->debug("Found UTF-32 BOM ...");
-
- const uint32_t* sstart = (uint32_t*)&data.front()+1, *send = (uint32_t*)&data.back()+1;
- char* dstart,*dend;
- std::vector<char> output;
- do {
- output.resize(output.size()?output.size()*3/2:data.size()/2);
- dstart = &output.front(),dend = &output.back()+1;
-
- result = ConvertUTF32toUTF8((const UTF32**)&sstart,(const UTF32*)send,(UTF8**)&dstart,(UTF8*)dend,lenientConversion);
- } while (result == targetExhausted);
-
- ReportResult(result);
-
- // copy to output buffer.
- const size_t outlen = (size_t)(dstart-&output.front());
- data.assign(output.begin(),output.begin()+outlen);
- return;
- }
-
- // UTF 16 BE with BOM
- if (*((uint16_t*)&data.front()) == 0xFFFE) {
-
- // swap the endianess ..
- for (uint16_t* p = (uint16_t*)&data.front(), *end = (uint16_t*)&data.back(); p <= end; ++p) {
- ByteSwap::Swap2(p);
- }
- }
-
- // UTF 16 LE with BOM
- if (*((uint16_t*)&data.front()) == 0xFEFF) {
- DefaultLogger::get()->debug("Found UTF-16 BOM ...");
-
- const uint16_t* sstart = (uint16_t*)&data.front()+1, *send = (uint16_t*)&data.back()+1;
- char* dstart,*dend;
- std::vector<char> output;
- do {
- output.resize(output.size()?output.size()*3/2:data.size()*3/4);
- dstart = &output.front(),dend = &output.back()+1;
-
- result = ConvertUTF16toUTF8((const UTF16**)&sstart,(const UTF16*)send,(UTF8**)&dstart,(UTF8*)dend,lenientConversion);
- } while (result == targetExhausted);
-
- ReportResult(result);
-
- // copy to output buffer.
- const size_t outlen = (size_t)(dstart-&output.front());
- data.assign(output.begin(),output.begin()+outlen);
- return;
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void BaseImporter::TextFileToBuffer(IOStream* stream,
- std::vector<char>& data)
-{
- ai_assert(NULL != stream);
-
- const size_t fileSize = stream->FileSize();
- if (!fileSize) {
- throw DeadlyImportError("File is empty");
- }
-
- data.reserve(fileSize+1);
- data.resize(fileSize);
- if (fileSize != stream->Read( &data[0], 1, fileSize)) {
- throw DeadlyImportError("File read error");
- }
-
- ConvertToUTF8(data);
-
- // append a binary zero to simplify string parsing
- data.push_back(0);
-}
-
-// ------------------------------------------------------------------------------------------------
-namespace Assimp
-{
- // Represents an import request
- struct LoadRequest
- {
- LoadRequest(const std::string& _file, unsigned int _flags,const BatchLoader::PropertyMap* _map, unsigned int _id)
- : file(_file), flags(_flags), refCnt(1),scene(NULL), loaded(false), id(_id)
- {
- if (_map)
- map = *_map;
- }
-
- const std::string file;
- unsigned int flags;
- unsigned int refCnt;
- aiScene* scene;
- bool loaded;
- BatchLoader::PropertyMap map;
- unsigned int id;
-
- bool operator== (const std::string& f) {
- return file == f;
- }
- };
-}
-
-// ------------------------------------------------------------------------------------------------
-// BatchLoader::pimpl data structure
-struct Assimp::BatchData
-{
- BatchData()
- : next_id(0xffff)
- {}
-
- // IO system to be used for all imports
- IOSystem* pIOSystem;
-
- // Importer used to load all meshes
- Importer* pImporter;
-
- // List of all imports
- std::list<LoadRequest> requests;
-
- // Base path
- std::string pathBase;
-
- // Id for next item
- unsigned int next_id;
-};
-
-// ------------------------------------------------------------------------------------------------
-BatchLoader::BatchLoader(IOSystem* pIO)
-{
- ai_assert(NULL != pIO);
-
- data = new BatchData();
- data->pIOSystem = pIO;
-
- data->pImporter = new Importer();
- data->pImporter->SetIOHandler(data->pIOSystem);
-}
-
-// ------------------------------------------------------------------------------------------------
-BatchLoader::~BatchLoader()
-{
- // delete all scenes wthat have not been polled by the user
- for (std::list<LoadRequest>::iterator it = data->requests.begin();it != data->requests.end(); ++it) {
-
- delete (*it).scene;
- }
- data->pImporter->SetIOHandler(NULL); /* get pointer back into our posession */
- delete data->pImporter;
- delete data;
-}
-
-
-// ------------------------------------------------------------------------------------------------
-unsigned int BatchLoader::AddLoadRequest (const std::string& file,
- unsigned int steps /*= 0*/, const PropertyMap* map /*= NULL*/)
-{
- ai_assert(!file.empty());
-
- // check whether we have this loading request already
- std::list<LoadRequest>::iterator it;
- for (it = data->requests.begin();it != data->requests.end(); ++it) {
-
- // Call IOSystem's path comparison function here
- if (data->pIOSystem->ComparePaths((*it).file,file)) {
-
- if (map) {
- if (!((*it).map == *map))
- continue;
- }
- else if (!(*it).map.empty())
- continue;
-
- (*it).refCnt++;
- return (*it).id;
- }
- }
-
- // no, we don't have it. So add it to the queue ...
- data->requests.push_back(LoadRequest(file,steps,map,data->next_id));
- return data->next_id++;
-}
-
-// ------------------------------------------------------------------------------------------------
-aiScene* BatchLoader::GetImport (unsigned int which)
-{
- for (std::list<LoadRequest>::iterator it = data->requests.begin();it != data->requests.end(); ++it) {
-
- if ((*it).id == which && (*it).loaded) {
-
- aiScene* sc = (*it).scene;
- if (!(--(*it).refCnt)) {
- data->requests.erase(it);
- }
- return sc;
- }
- }
- return NULL;
-}
-
-// ------------------------------------------------------------------------------------------------
-void BatchLoader::LoadAll()
-{
- // no threaded implementation for the moment
- for (std::list<LoadRequest>::iterator it = data->requests.begin();it != data->requests.end(); ++it) {
- // force validation in debug builds
- unsigned int pp = (*it).flags;
-#ifdef _DEBUG
- pp |= aiProcess_ValidateDataStructure;
-#endif
- // setup config properties if necessary
- data->pImporter->pimpl->mFloatProperties = (*it).map.floats;
- data->pImporter->pimpl->mIntProperties = (*it).map.ints;
- data->pImporter->pimpl->mStringProperties = (*it).map.strings;
-
- if (!DefaultLogger::isNullLogger())
- {
- DefaultLogger::get()->info("%%% BEGIN EXTERNAL FILE %%%");
- DefaultLogger::get()->info("File: " + (*it).file);
- }
- data->pImporter->ReadFile((*it).file,pp);
- (*it).scene = const_cast<aiScene*>(data->pImporter->GetOrphanedScene());
- (*it).loaded = true;
-
- DefaultLogger::get()->info("%%% END EXTERNAL FILE %%%");
- }
-}
-
-
-
-
diff --git a/3rdparty/assimp/code/BaseImporter.h b/3rdparty/assimp/code/BaseImporter.h
deleted file mode 100644
index 39ac3bf5..00000000
--- a/3rdparty/assimp/code/BaseImporter.h
+++ /dev/null
@@ -1,499 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file Definition of the base class for all importer worker classes. */
-#ifndef INCLUDED_AI_BASEIMPORTER_H
-#define INCLUDED_AI_BASEIMPORTER_H
-
-#include "Exceptional.h"
-
-#include <string>
-#include <map>
-#include <vector>
-#include "./../include/aiTypes.h"
-
-struct aiScene;
-
-namespace Assimp {
-
-class IOSystem;
-class Importer;
-class BaseImporter;
-class BaseProcess;
-class SharedPostProcessInfo;
-class IOStream;
-
-// utility to do char4 to uint32 in a portable manner
-#define AI_MAKE_MAGIC(string) ((uint32_t)((string[0] << 24) + \
- (string[1] << 16) + (string[2] << 8) + string[3]))
-
-// ---------------------------------------------------------------------------
-template <typename T>
-struct ScopeGuard
-{
- ScopeGuard(T* obj) : obj(obj), mdismiss() {}
- ~ScopeGuard () throw() {
- if (!mdismiss) {
- delete obj;
- }
- obj = NULL;
- }
-
- T* dismiss() {
- mdismiss=true;
- return obj;
- }
-
- operator T*() {
- return obj;
- }
-
- T* operator -> () {
- return obj;
- }
-
-private:
- T* obj;
- bool mdismiss;
-};
-
-//! @cond never
-// ---------------------------------------------------------------------------
-/** @brief Internal PIMPL implementation for Assimp::Importer
- *
- * Using this idiom here allows us to drop the dependency from
- * std::vector and std::map in the public headers. Furthermore we are dropping
- * any STL interface problems caused by mismatching STL settings. All
- * size calculation are now done by us, not the app heap. */
-class ASSIMP_API ImporterPimpl
-{
-public:
-
- // Data type to store the key hash
- typedef unsigned int KeyType;
-
- // typedefs for our three configuration maps.
- // We don't need more, so there is no need for a generic solution
- typedef std::map<KeyType, int> IntPropertyMap;
- typedef std::map<KeyType, float> FloatPropertyMap;
- typedef std::map<KeyType, std::string> StringPropertyMap;
-
-public:
-
- /** IO handler to use for all file accesses. */
- IOSystem* mIOHandler;
- bool mIsDefaultHandler;
-
- /** Progress handler for feedback. */
- ProgressHandler* mProgressHandler;
- bool mIsDefaultProgressHandler;
-
- /** Format-specific importer worker objects - one for each format we can read.*/
- std::vector<BaseImporter*> mImporter;
-
- /** Post processing steps we can apply at the imported data. */
- std::vector<BaseProcess*> mPostProcessingSteps;
-
- /** The imported data, if ReadFile() was successful, NULL otherwise. */
- aiScene* mScene;
-
- /** The error description, if there was one. */
- std::string mErrorString;
-
- /** List of integer properties */
- IntPropertyMap mIntProperties;
-
- /** List of floating-point properties */
- FloatPropertyMap mFloatProperties;
-
- /** List of string properties */
- StringPropertyMap mStringProperties;
-
- /** Used for testing - extra verbose mode causes the ValidateDataStructure-Step
- * to be executed before and after every single postprocess step */
- bool bExtraVerbose;
-
- /** Used by post-process steps to share data */
- SharedPostProcessInfo* mPPShared;
-};
-//! @endcond
-
-// ---------------------------------------------------------------------------
-/** FOR IMPORTER PLUGINS ONLY: The BaseImporter defines a common interface
- * for all importer worker classes.
- *
- * The interface defines two functions: CanRead() is used to check if the
- * importer can handle the format of the given file. If an implementation of
- * this function returns true, the importer then calls ReadFile() which
- * imports the given file. ReadFile is not overridable, it just calls
- * InternReadFile() and catches any ImportErrorException that might occur.
- */
-class ASSIMP_API BaseImporter
-{
- friend class Importer;
-
-protected:
-
- /** Constructor to be privately used by #Importer */
- BaseImporter();
-
- /** Destructor, private as well */
- virtual ~BaseImporter();
-
-public:
- // -------------------------------------------------------------------
- /** Returns whether the class can handle the format of the given file.
- *
- * The implementation should be as quick as possible. A check for
- * the file extension is enough. If no suitable loader is found with
- * this strategy, CanRead() is called again, the 'checkSig' parameter
- * set to true this time. Now the implementation is expected to
- * perform a full check of the file structure, possibly searching the
- * first bytes of the file for magic identifiers or keywords.
- *
- * @param pFile Path and file name of the file to be examined.
- * @param pIOHandler The IO handler to use for accessing any file.
- * @param checkSig Set to true if this method is called a second time.
- * This time, the implementation may take more time to examine the
- * contents of the file to be loaded for magic bytes, keywords, etc
- * to be able to load files with unknown/not existent file extensions.
- * @return true if the class can read this file, false if not.
- */
- virtual bool CanRead(
- const std::string& pFile,
- IOSystem* pIOHandler,
- bool checkSig
- ) const = 0;
-
- // -------------------------------------------------------------------
- /** Imports the given file and returns the imported data.
- * If the import succeeds, ownership of the data is transferred to
- * the caller. If the import fails, NULL is returned. The function
- * takes care that any partially constructed data is destroyed
- * beforehand.
- *
- * @param pImp #Importer object hosting this loader.
- * @param pFile Path of the file to be imported.
- * @param pIOHandler IO-Handler used to open this and possible other files.
- * @return The imported data or NULL if failed. If it failed a
- * human-readable error description can be retrieved by calling
- * GetErrorText()
- *
- * @note This function is not intended to be overridden. Implement
- * InternReadFile() to do the import. If an exception is thrown somewhere
- * in InternReadFile(), this function will catch it and transform it into
- * a suitable response to the caller.
- */
- aiScene* ReadFile(
- const Importer* pImp,
- const std::string& pFile,
- IOSystem* pIOHandler
- );
-
- // -------------------------------------------------------------------
- /** Returns the error description of the last error that occured.
- * @return A description of the last error that occured. An empty
- * string if there was no error.
- */
- const std::string& GetErrorText() const {
- return mErrorText;
- }
-
- // -------------------------------------------------------------------
- /** Called prior to ReadFile().
- * The function is a request to the importer to update its configuration
- * basing on the Importer's configuration property list.
- * @param pImp Importer instance
- */
- virtual void SetupProperties(
- const Importer* pImp
- );
-
-protected:
-
- // -------------------------------------------------------------------
- /** Called by Importer::GetExtensionList() for each loaded importer.
- * Implementations are expected to insert() all file extensions
- * handled by them into the extension set. A loader capable of
- * reading certain files with the extension BLA would place the
- * string bla (lower-case!) in the output set.
- * @param extensions Output set. */
- virtual void GetExtensionList(
- std::set<std::string>& extensions
- ) = 0;
-
- // -------------------------------------------------------------------
- /** Imports the given file into the given scene structure. The
- * function is expected to throw an ImportErrorException if there is
- * an error. If it terminates normally, the data in aiScene is
- * expected to be correct. Override this function to implement the
- * actual importing.
- * <br>
- * The output scene must meet the following requirements:<br>
- * <ul>
- * <li>At least a root node must be there, even if its only purpose
- * is to reference one mesh.</li>
- * <li>aiMesh::mPrimitiveTypes may be 0. The types of primitives
- * in the mesh are determined automatically in this case.</li>
- * <li>the vertex data is stored in a pseudo-indexed "verbose" format.
- * In fact this means that every vertex that is referenced by
- * a face is unique. Or the other way round: a vertex index may
- * not occur twice in a single aiMesh.</li>
- * <li>aiAnimation::mDuration may be -1. Assimp determines the length
- * of the animation automatically in this case as the length of
- * the longest animation channel.</li>
- * <li>aiMesh::mBitangents may be NULL if tangents and normals are
- * given. In this case bitangents are computed as the cross product
- * between normal and tangent.</li>
- * <li>There needn't be a material. If none is there a default material
- * is generated. However, it is recommended practice for loaders
- * to generate a default material for yourself that matches the
- * default material setting for the file format better than Assimp's
- * generic default material. Note that default materials *should*
- * be named AI_DEFAULT_MATERIAL_NAME if they're just color-shaded
- * or AI_DEFAULT_TEXTURED_MATERIAL_NAME if they define a (dummy)
- * texture. </li>
- * </ul>
- * If the AI_SCENE_FLAGS_INCOMPLETE-Flag is <b>not</b> set:<ul>
- * <li> at least one mesh must be there</li>
- * <li> there may be no meshes with 0 vertices or faces</li>
- * </ul>
- * This won't be checked (except by the validation step): Assimp will
- * crash if one of the conditions is not met!
- *
- * @param pFile Path of the file to be imported.
- * @param pScene The scene object to hold the imported data.
- * NULL is not a valid parameter.
- * @param pIOHandler The IO handler to use for any file access.
- * NULL is not a valid parameter. */
- virtual void InternReadFile(
- const std::string& pFile,
- aiScene* pScene,
- IOSystem* pIOHandler
- ) = 0;
-
-public: // static utilities
-
- // -------------------------------------------------------------------
- /** A utility for CanRead().
- *
- * The function searches the header of a file for a specific token
- * and returns true if this token is found. This works for text
- * files only. There is a rudimentary handling of UNICODE files.
- * The comparison is case independent.
- *
- * @param pIOSystem IO System to work with
- * @param file File name of the file
- * @param tokens List of tokens to search for
- * @param numTokens Size of the token array
- * @param searchBytes Number of bytes to be searched for the tokens.
- */
- static bool SearchFileHeaderForToken(
- IOSystem* pIOSystem,
- const std::string& file,
- const char** tokens,
- unsigned int numTokens,
- unsigned int searchBytes = 200);
-
-
- // -------------------------------------------------------------------
- /** @brief Check whether a file has a specific file extension
- * @param pFile Input file
- * @param ext0 Extension to check for. Lowercase characters only, no dot!
- * @param ext1 Optional second extension
- * @param ext2 Optional third extension
- * @note Case-insensitive
- */
- static bool SimpleExtensionCheck (
- const std::string& pFile,
- const char* ext0,
- const char* ext1 = NULL,
- const char* ext2 = NULL);
-
- // -------------------------------------------------------------------
- /** @brief Extract file extension from a string
- * @param pFile Input file
- * @return Extension without trailing dot, all lowercase
- */
- static std::string GetExtension (
- const std::string& pFile);
-
- // -------------------------------------------------------------------
- /** @brief Check whether a file starts with one or more magic tokens
- * @param pFile Input file
- * @param pIOHandler IO system to be used
- * @param magic n magic tokens
- * @params num Size of magic
- * @param offset Offset from file start where tokens are located
- * @param Size of one token, in bytes. Maximally 16 bytes.
- * @return true if one of the given tokens was found
- *
- * @note For convinence, the check is also performed for the
- * byte-swapped variant of all tokens (big endian). Only for
- * tokens of size 2,4.
- */
- static bool CheckMagicToken(
- IOSystem* pIOHandler,
- const std::string& pFile,
- const void* magic,
- unsigned int num,
- unsigned int offset = 0,
- unsigned int size = 4);
-
- // -------------------------------------------------------------------
- /** An utility for all text file loaders. It converts a file to our
- * UTF8 character set. Errors are reported, but ignored.
- *
- * @param data File buffer to be converted to UTF8 data. The buffer
- * is resized as appropriate. */
- static void ConvertToUTF8(
- std::vector<char>& data);
-
- // -------------------------------------------------------------------
- /** Utility for text file loaders which copies the contents of the
- * file into a memory buffer and converts it to our UTF8
- * representation.
- * @param stream Stream to read from.
- * @param data Output buffer to be resized and filled with the
- * converted text file data. The buffer is terminated with
- * a binary 0. */
- static void TextFileToBuffer(
- IOStream* stream,
- std::vector<char>& data);
-
-protected:
-
- /** Error description in case there was one. */
- std::string mErrorText;
-
- /** Currently set progress handler */
- ProgressHandler* progress;
-};
-
-struct BatchData;
-
-// ---------------------------------------------------------------------------
-/** FOR IMPORTER PLUGINS ONLY: A helper class for the pleasure of importers
- * which need to load many extern meshes recursively.
- *
- * The class uses several threads to load these meshes (or at least it
- * could, this has not yet been implemented at the moment).
- *
- * @note The class may not be used by more than one thread*/
-class ASSIMP_API BatchLoader
-{
- // friend of Importer
-
-public:
-
- //! @cond never
- // -------------------------------------------------------------------
- /** Wraps a full list of configuration properties for an importer.
- * Properties can be set using SetGenericProperty */
- struct PropertyMap
- {
- ImporterPimpl::IntPropertyMap ints;
- ImporterPimpl::FloatPropertyMap floats;
- ImporterPimpl::StringPropertyMap strings;
-
- bool operator == (const PropertyMap& prop) const {
- // fixme: really isocpp? gcc complains
- return ints == prop.ints && floats == prop.floats && strings == prop.strings;
- }
-
- bool empty () const {
- return ints.empty() && floats.empty() && strings.empty();
- }
- };
- //! @endcond
-
-public:
-
-
- // -------------------------------------------------------------------
- /** Construct a batch loader from a given IO system to be used
- * to acess external files */
- BatchLoader(IOSystem* pIO);
- ~BatchLoader();
-
-
- // -------------------------------------------------------------------
- /** Add a new file to the list of files to be loaded.
- * @param file File to be loaded
- * @param steps Post-processing steps to be executed on the file
- * @param map Optional configuration properties
- * @return 'Load request channel' - an unique ID that can later
- * be used to access the imported file data.
- * @see GetImport */
- unsigned int AddLoadRequest (
- const std::string& file,
- unsigned int steps = 0,
- const PropertyMap* map = NULL
- );
-
-
- // -------------------------------------------------------------------
- /** Get an imported scene.
- * This polls the import from the internal request list.
- * If an import is requested several times, this function
- * can be called several times, too.
- *
- * @param which LRWC returned by AddLoadRequest().
- * @return NULL if there is no scene with this file name
- * in the queue of the scene hasn't been loaded yet. */
- aiScene* GetImport(
- unsigned int which
- );
-
-
- // -------------------------------------------------------------------
- /** Waits until all scenes have been loaded. This returns
- * immediately if no scenes are queued.*/
- void LoadAll();
-
-private:
-
- // No need to have that in the public API ...
- BatchData* data;
-};
-
-} // end of namespace Assimp
-
-#endif // AI_BASEIMPORTER_H_INC
diff --git a/3rdparty/assimp/code/BaseProcess.cpp b/3rdparty/assimp/code/BaseProcess.cpp
deleted file mode 100644
index ce8fbce9..00000000
--- a/3rdparty/assimp/code/BaseProcess.cpp
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file Implementation of BaseProcess */
-
-#include "AssimpPCH.h"
-#include "BaseImporter.h"
-#include "BaseProcess.h"
-
-using namespace Assimp;
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-BaseProcess::BaseProcess()
-: shared()
-, progress()
-{
-}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-BaseProcess::~BaseProcess()
-{
- // nothing to do here
-}
-
-// ------------------------------------------------------------------------------------------------
-void BaseProcess::ExecuteOnScene( Importer* pImp)
-{
- ai_assert(NULL != pImp && NULL != pImp->pimpl->mScene);
-
- progress = pImp->GetProgressHandler();
- ai_assert(progress);
-
- SetupProperties( pImp );
-
- // catch exceptions thrown inside the PostProcess-Step
- try
- {
- Execute(pImp->pimpl->mScene);
-
- } catch( const std::exception& err ) {
-
- // extract error description
- pImp->pimpl->mErrorString = err.what();
- DefaultLogger::get()->error(pImp->pimpl->mErrorString);
-
- // and kill the partially imported data
- delete pImp->pimpl->mScene;
- pImp->pimpl->mScene = NULL;
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void BaseProcess::SetupProperties(const Importer* pImp)
-{
- // the default implementation does nothing
-}
diff --git a/3rdparty/assimp/code/BaseProcess.h b/3rdparty/assimp/code/BaseProcess.h
deleted file mode 100644
index 6d32d441..00000000
--- a/3rdparty/assimp/code/BaseProcess.h
+++ /dev/null
@@ -1,289 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file Base class of all import post processing steps */
-#ifndef INCLUDED_AI_BASEPROCESS_H
-#define INCLUDED_AI_BASEPROCESS_H
-
-#include <map>
-
-#include "../include/aiTypes.h"
-#include "GenericProperty.h"
-
-struct aiScene;
-
-namespace Assimp {
-
-class Importer;
-
-// ---------------------------------------------------------------------------
-/** Helper class to allow post-processing steps to interact with each other.
- *
- * The class maintains a simple property list that can be used by pp-steps
- * to provide additional information to other steps. This is primarily
- * intended for cross-step optimizations.
- */
-class ASSIMP_API SharedPostProcessInfo
-{
-public:
-
- struct Base
- {
- virtual ~Base()
- {}
- };
-
- //! Represents data that is allocated on the heap, thus needs to be deleted
- template <typename T>
- struct THeapData : public Base
- {
- THeapData(T* in)
- : data (in)
- {}
-
- ~THeapData()
- {
- delete data;
- }
- T* data;
- };
-
- //! Represents static, by-value data not allocated on the heap
- template <typename T>
- struct TStaticData : public Base
- {
- TStaticData(T in)
- : data (in)
- {}
-
- ~TStaticData()
- {}
-
- T data;
- };
-
- // some typedefs for cleaner code
- typedef unsigned int KeyType;
- typedef std::map<KeyType, Base*> PropertyMap;
-
-public:
-
- //! Destructor
- ~SharedPostProcessInfo()
- {
- Clean();
- }
-
- //! Remove all stored properties from the table
- void Clean()
- {
- // invoke the virtual destructor for all stored properties
- for (PropertyMap::iterator it = pmap.begin(), end = pmap.end();
- it != end; ++it)
- {
- delete (*it).second;
- }
- pmap.clear();
- }
-
- //! Add a heap property to the list
- template <typename T>
- void AddProperty( const char* name, T* in ){
- AddProperty(name,(Base*)new THeapData<T>(in));
- }
-
- //! Add a static by-value property to the list
- template <typename T>
- void AddProperty( const char* name, T in ){
- AddProperty(name,(Base*)new TStaticData<T>(in));
- }
-
-
- //! Get a heap property
- template <typename T>
- bool GetProperty( const char* name, T*& out ) const
- {
- THeapData<T>* t = (THeapData<T>*)GetPropertyInternal(name);
- if (!t)
- {
- out = NULL;
- return false;
- }
- out = t->data;
- return true;
- }
-
- //! Get a static, by-value property
- template <typename T>
- bool GetProperty( const char* name, T& out ) const
- {
- TStaticData<T>* t = (TStaticData<T>*)GetPropertyInternal(name);
- if (!t)return false;
- out = t->data;
- return true;
- }
-
- //! Remove a property of a specific type
- void RemoveProperty( const char* name) {
- SetGenericPropertyPtr<Base>(pmap,name,NULL);
- }
-
-private:
-
- void AddProperty( const char* name, Base* data) {
- SetGenericPropertyPtr<Base>(pmap,name,data);
- }
-
- Base* GetPropertyInternal( const char* name) const {
- return GetGenericProperty<Base*>(pmap,name,NULL);
- }
-
-private:
-
- //! Map of all stored properties
- PropertyMap pmap;
-};
-
-#if 0
-
-// ---------------------------------------------------------------------------
-/** @brief Represents a dependency table for a postprocessing steps.
- *
- * For future use.
- */
- struct PPDependencyTable
- {
- unsigned int execute_me_before_these;
- unsigned int execute_me_after_these;
- unsigned int only_if_these_are_not_specified;
- unsigned int mutually_exclusive_with;
- };
-
-#endif
-
-
-#define AI_SPP_SPATIAL_SORT "$Spat"
-
-// ---------------------------------------------------------------------------
-/** The BaseProcess defines a common interface for all post processing steps.
- * A post processing step is run after a successful import if the caller
- * specified the corresponding flag when calling ReadFile().
- * Enum #aiPostProcessSteps defines which flags are available.
- * After a successful import the Importer iterates over its internal array
- * of processes and calls IsActive() on each process to evaluate if the step
- * should be executed. If the function returns true, the class' Execute()
- * function is called subsequently.
- */
-class ASSIMP_API BaseProcess
-{
- friend class Importer;
-
-public:
-
- /** Constructor to be privately used by Importer */
- BaseProcess();
-
- /** Destructor, private as well */
- virtual ~BaseProcess();
-
-public:
-
- // -------------------------------------------------------------------
- /** Returns whether the processing step is present in the given flag.
- * @param pFlags The processing flags the importer was called with. A
- * bitwise combination of #aiPostProcessSteps.
- * @return true if the process is present in this flag fields,
- * false if not.
- */
- virtual bool IsActive( unsigned int pFlags) const = 0;
-
- // -------------------------------------------------------------------
- /** Executes the post processing step on the given imported data.
- * The function deletes the scene if the postprocess step fails (
- * the object pointer will be set to NULL).
- * @param pImp Importer instance (pImp->mScene must be valid)
- */
- void ExecuteOnScene( Importer* pImp);
-
- // -------------------------------------------------------------------
- /** Called prior to ExecuteOnScene().
- * The function is a request to the process to update its configuration
- * basing on the Importer's configuration property list.
- */
- virtual void SetupProperties(const Importer* pImp);
-
- // -------------------------------------------------------------------
- /** Executes the post processing step on the given imported data.
- * A process should throw an ImportErrorException* if it fails.
- * This method must be implemented by deriving classes.
- * @param pScene The imported data to work at.
- */
- virtual void Execute( aiScene* pScene) = 0;
-
-
- // -------------------------------------------------------------------
- /** Assign a new SharedPostProcessInfo to the step. This object
- * allows multiple postprocess steps to share data.
- * @param sh May be NULL
- */
- inline void SetSharedData(SharedPostProcessInfo* sh) {
- shared = sh;
- }
-
- // -------------------------------------------------------------------
- /** Get the shared data that is assigned to the step.
- */
- inline SharedPostProcessInfo* GetSharedData() {
- return shared;
- }
-
-protected:
-
- /** See the doc of #SharedPostProcessInfo for more details */
- SharedPostProcessInfo* shared;
-
- /** Currently active progress handler */
- ProgressHandler* progress;
-};
-
-
-} // end of namespace Assimp
-
-#endif // AI_BASEPROCESS_H_INC
diff --git a/3rdparty/assimp/code/BlenderDNA.cpp b/3rdparty/assimp/code/BlenderDNA.cpp
deleted file mode 100644
index f7cf8e65..00000000
--- a/3rdparty/assimp/code/BlenderDNA.cpp
+++ /dev/null
@@ -1,372 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file BlenderDNA.cpp
- * @brief Implementation of the Blender `DNA`, that is its own
- * serialized set of data structures.
- */
-#include "AssimpPCH.h"
-
-#ifndef ASSIMP_BUILD_NO_BLEND_IMPORTER
-#include "BlenderDNA.h"
-#include "StreamReader.h"
-#include "fast_atof.h"
-
-using namespace Assimp;
-using namespace Assimp::Blender;
-using namespace Assimp::Formatter;
-
-#define for_each BOOST_FOREACH
-bool match4(StreamReaderAny& stream, const char* string) {
- char tmp[] = {
- (stream).GetI1(),
- (stream).GetI1(),
- (stream).GetI1(),
- (stream).GetI1()
- };
- return (tmp[0]==string[0] && tmp[1]==string[1] && tmp[2]==string[2] && tmp[3]==string[3]);
-}
-
-struct Type {
- size_t size;
- std::string name;
-};
-
-// ------------------------------------------------------------------------------------------------
-void DNAParser :: Parse ()
-{
- StreamReaderAny& stream = *db.reader.get();
- DNA& dna = db.dna;
-
- if (!match4(stream,"SDNA")) {
- throw DeadlyImportError("BlenderDNA: Expected SDNA chunk");
- }
-
- // name dictionary
- if (!match4(stream,"NAME")) {
- throw DeadlyImportError("BlenderDNA: Expected NAME field");
- }
-
- std::vector<std::string> names (stream.GetI4());
- for_each(std::string& s, names) {
- while (char c = stream.GetI1()) {
- s += c;
- }
- }
-
- // type dictionary
- for (;stream.GetCurrentPos() & 0x3; stream.GetI1());
- if (!match4(stream,"TYPE")) {
- throw DeadlyImportError("BlenderDNA: Expected TYPE field");
- }
-
- std::vector<Type> types (stream.GetI4());
- for_each(Type& s, types) {
- while (char c = stream.GetI1()) {
- s.name += c;
- }
- }
-
- // type length dictionary
- for (;stream.GetCurrentPos() & 0x3; stream.GetI1());
- if (!match4(stream,"TLEN")) {
- throw DeadlyImportError("BlenderDNA: Expected TLEN field");
- }
-
- for_each(Type& s, types) {
- s.size = stream.GetI2();
- }
-
- // structures dictionary
- for (;stream.GetCurrentPos() & 0x3; stream.GetI1());
- if (!match4(stream,"STRC")) {
- throw DeadlyImportError("BlenderDNA: Expected STRC field");
- }
-
- size_t end = stream.GetI4(), fields = 0;
-
- dna.structures.reserve(end);
- for (size_t i = 0; i != end; ++i) {
-
- uint16_t n = stream.GetI2();
- if (n >= types.size()) {
- throw DeadlyImportError((format(),
- "BlenderDNA: Invalid type index in structure name" ,n,
- " (there are only ", types.size(), " entries)"
- ));
- }
-
- // maintain separate indexes
- dna.indices[types[n].name] = dna.structures.size();
-
- dna.structures.push_back(Structure());
- Structure& s = dna.structures.back();
- s.name = types[n].name;
- //s.index = dna.structures.size()-1;
-
- n = stream.GetI2();
- s.fields.reserve(n);
-
- size_t offset = 0;
- for (size_t m = 0; m < n; ++m, ++fields) {
-
- uint16_t j = stream.GetI2();
- if (j >= types.size()) {
- throw DeadlyImportError((format(),
- "BlenderDNA: Invalid type index in structure field ", j,
- " (there are only ", types.size(), " entries)"
- ));
- }
- s.fields.push_back(Field());
- Field& f = s.fields.back();
- f.offset = offset;
-
- f.type = types[j].name;
- f.size = types[j].size;
-
- j = stream.GetI2();
- if (j >= names.size()) {
- throw DeadlyImportError((format(),
- "BlenderDNA: Invalid name index in structure field ", j,
- " (there are only ", names.size(), " entries)"
- ));
- }
-
- f.name = names[j];
- f.flags = 0u;
-
- // pointers always specify the size of the pointee instead of their own.
- // The pointer asterisk remains a property of the lookup name.
- if (f.name[0] == '*') {
- f.size = db.i64bit ? 8 : 4;
- f.flags |= FieldFlag_Pointer;
- }
-
- // arrays, however, specify the size of a single element so we
- // need to parse the (possibly multi-dimensional) array declaration
- // in order to obtain the actual size of the array in the file.
- // Also we need to alter the lookup name to include no array
- // brackets anymore or size fixup won't work (if our size does
- // not match the size read from the DNA).
- if (*f.name.rbegin() == ']') {
- const std::string::size_type rb = f.name.find('[');
- if (rb == std::string::npos) {
- throw DeadlyImportError((format(),
- "BlenderDNA: Encountered invalid array declaration ",
- f.name
- ));
- }
-
- f.flags |= FieldFlag_Array;
- DNA::ExtractArraySize(f.name,f.array_sizes);
- f.name = f.name.substr(0,rb);
-
- f.size *= f.array_sizes[0] * f.array_sizes[1];
- }
-
- // maintain separate indexes
- s.indices[f.name] = s.fields.size()-1;
- offset += f.size;
- }
- s.size = offset;
- }
-
- DefaultLogger::get()->debug((format(),"BlenderDNA: Got ",dna.structures.size(),
- " structures with totally ",fields," fields"));
-
-#ifdef ASSIMP_BUILD_BLENDER_DEBUG
- dna.DumpToFile();
-#endif
-
- dna.AddPrimitiveStructures();
- dna.RegisterConverters();
-}
-
-
-#ifdef ASSIMP_BUILD_BLENDER_DEBUG
-
-#include <fstream>
-// ------------------------------------------------------------------------------------------------
-void DNA :: DumpToFile()
-{
- // we dont't bother using the VFS here for this is only for debugging.
- // (and all your bases are belong to us).
-
- std::ofstream f("dna.txt");
- if (f.fail()) {
- DefaultLogger::get()->error("Could not dump dna to dna.txt");
- return;
- }
- f << "Field format: type name offset size" << "\n";
- f << "Structure format: name size" << "\n";
-
- for_each(const Structure& s, structures) {
- f << s.name << " " << s.size << "\n\n";
- for_each(const Field& ff, s.fields) {
- f << "\t" << ff.type << " " << ff.name << " " << ff.offset << " " << ff.size << std::endl;
- }
- f << std::endl;
- }
- DefaultLogger::get()->info("BlenderDNA: Dumped dna to dna.txt");
-}
-#endif
-
-// ------------------------------------------------------------------------------------------------
-/*static*/ void DNA :: ExtractArraySize(
- const std::string& out,
- size_t array_sizes[2]
-)
-{
- array_sizes[0] = array_sizes[1] = 1;
- std::string::size_type pos = out.find('[');
- if (pos++ == std::string::npos) {
- return;
- }
- array_sizes[0] = strtol10(&out[pos]);
-
- pos = out.find('[',pos);
- if (pos++ == std::string::npos) {
- return;
- }
- array_sizes[1] = strtol10(&out[pos]);
-}
-
-// ------------------------------------------------------------------------------------------------
-boost::shared_ptr< ElemBase > DNA :: ConvertBlobToStructure(
- const Structure& structure,
- const FileDatabase& db
-) const
-{
- std::map<std::string, FactoryPair >::const_iterator it = converters.find(structure.name);
- if (it == converters.end()) {
- return boost::shared_ptr< ElemBase >();
- }
-
- boost::shared_ptr< ElemBase > ret = (structure.*((*it).second.first))();
- (structure.*((*it).second.second))(ret,db);
-
- return ret;
-}
-
-// ------------------------------------------------------------------------------------------------
-DNA::FactoryPair DNA :: GetBlobToStructureConverter(
- const Structure& structure,
- const FileDatabase& db
-) const
-{
- std::map<std::string, FactoryPair>::const_iterator it = converters.find(structure.name);
- return it == converters.end() ? FactoryPair() : (*it).second;
-}
-
-// basing on http://www.blender.org/development/architecture/notes-on-sdna/
-// ------------------------------------------------------------------------------------------------
-void DNA :: AddPrimitiveStructures()
-{
- // NOTE: these are just dummies. Their presence enforces
- // Structure::Convert<target_type> to be called on these
- // empty structures. These converters are special
- // overloads which scan the name of the structure and
- // perform the required data type conversion if one
- // of these special names is found in the structure
- // in question.
-
- indices["int"] = structures.size();
- structures.push_back( Structure() );
- structures.back().name = "int";
- structures.back().size = 4;
-
- indices["short"] = structures.size();
- structures.push_back( Structure() );
- structures.back().name = "short";
- structures.back().size = 2;
-
-
- indices["char"] = structures.size();
- structures.push_back( Structure() );
- structures.back().name = "char";
- structures.back().size = 1;
-
-
- indices["float"] = structures.size();
- structures.push_back( Structure() );
- structures.back().name = "float";
- structures.back().size = 4;
-
-
- indices["double"] = structures.size();
- structures.push_back( Structure() );
- structures.back().name = "double";
- structures.back().size = 8;
-
- // no long, seemingly.
-}
-
-// ------------------------------------------------------------------------------------------------
-void SectionParser :: Next()
-{
- stream.SetCurrentPos(current.start + current.size);
-
- const char tmp[] = {
- stream.GetI1(),
- stream.GetI1(),
- stream.GetI1(),
- stream.GetI1()
- };
- current.id = std::string(tmp,tmp[3]?4:tmp[2]?3:tmp[1]?2:1);
-
- current.size = stream.GetI4();
- current.address.val = ptr64 ? stream.GetU8() : stream.GetU4();
-
- current.dna_index = stream.GetI4();
- current.num = stream.GetI4();
-
- current.start = stream.GetCurrentPos();
- if (stream.GetRemainingSizeToLimit() < current.size) {
- throw DeadlyImportError("BLEND: invalid size of file block");
- }
-
-#ifdef ASSIMP_BUILD_BLENDER_DEBUG
- DefaultLogger::get()->debug(current.id);
-#endif
-}
-
-
-
-#endif
diff --git a/3rdparty/assimp/code/BlenderDNA.h b/3rdparty/assimp/code/BlenderDNA.h
deleted file mode 100644
index 3e24c60b..00000000
--- a/3rdparty/assimp/code/BlenderDNA.h
+++ /dev/null
@@ -1,866 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file BlenderDNA.h
- * @brief Blender `DNA` (file format specification embedded in
- * blend file itself) loader.
- */
-#ifndef INCLUDED_AI_BLEND_DNA_H
-#define INCLUDED_AI_BLEND_DNA_H
-
-#include "BaseImporter.h"
-#include "TinyFormatter.h"
-
-// enable verbose log output. really verbose, so be careful.
-#ifdef _DEBUG
-# define ASSIMP_BUILD_BLENDER_DEBUG
-#endif
-
-// #define ASSIMP_BUILD_BLENDER_NO_STATS
-
-namespace Assimp {
- template <bool,bool> class StreamReader;
- typedef StreamReader<true,true> StreamReaderAny;
-
- namespace Blender {
- class FileDatabase;
- struct FileBlockHead;
-
- template <template <typename> class TOUT>
- class ObjectCache;
-
-// -------------------------------------------------------------------------------
-/** Exception class used by the blender loader to selectively catch exceptions
- * thrown in its own code (DeadlyImportErrors thrown in general utility
- * functions are untouched then). If such an exception is not caught by
- * the loader itself, it will still be caught by Assimp due to its
- * ancestry. */
-// -------------------------------------------------------------------------------
-struct Error : DeadlyImportError
-{
- Error (const std::string& s)
- : DeadlyImportError(s)
- {}
-};
-
-// -------------------------------------------------------------------------------
-/** The only purpose of this structure is to feed a virtual dtor into its
- * descendents. It serves as base class for all data structure fields. */
-// -------------------------------------------------------------------------------
-struct ElemBase
-{
- virtual ~ElemBase() {}
-
- /** Type name of the element. The type
- * string points is the `c_str` of the `name` attribute of the
- * corresponding `Structure`, that is, it is only valid as long
- * as the DNA is not modified. The dna_type is only set if the
- * data type is not static, i.e. a boost::shared_ptr<ElemBase>
- * in the scene description would have its type resolved
- * at runtime, so this member is always set. */
- const char* dna_type;
-};
-
-
-// -------------------------------------------------------------------------------
-/** Represents a generic pointer to a memory location, which can be either 32
- * or 64 bits. These pointers are loaded from the BLEND file and finally
- * fixed to point to the real, converted representation of the objects
- * they used to point to.*/
-// -------------------------------------------------------------------------------
-struct Pointer
-{
- Pointer() : val() {}
- uint64_t val;
-};
-
-// -------------------------------------------------------------------------------
-/** Represents a generic offset within a BLEND file */
-// -------------------------------------------------------------------------------
-struct FileOffset
-{
- FileOffset() : val() {}
- uint64_t val;
-};
-
-// -------------------------------------------------------------------------------
-/** Dummy derivate of std::vector to be able to use it in templates simultaenously
- * with boost::shared_ptr, which takes only one template argument
- * while std::vector takes three. Also we need to provide some special member
- * functions of shared_ptr */
-// -------------------------------------------------------------------------------
-template <typename T>
-class vector : public std::vector<T>
-{
-public:
- using std::vector<T>::resize;
- using std::vector<T>::empty;
-
- void reset() {
- resize(0);
- }
-
- operator bool () const {
- return !empty();
- }
-};
-
-// -------------------------------------------------------------------------------
-/** Mixed flags for use in #Field */
-// -------------------------------------------------------------------------------
-enum FieldFlags
-{
- FieldFlag_Pointer = 0x1,
- FieldFlag_Array = 0x2
-};
-
-// -------------------------------------------------------------------------------
-/** Represents a single member of a data structure in a BLEND file */
-// -------------------------------------------------------------------------------
-struct Field
-{
- std::string name;
- std::string type;
-
- size_t size;
- size_t offset;
-
- /** Size of each array dimension. For flat arrays,
- * the second dimension is set to 1. */
- size_t array_sizes[2];
-
- /** Any of the #FieldFlags enumerated values */
- unsigned int flags;
-};
-
-// -------------------------------------------------------------------------------
-/** Range of possible behaviours for fields absend in the input file. Some are
- * mission critical so we need them, while others can silently be default
- * initialized and no animations are harmed. */
-// -------------------------------------------------------------------------------
-enum ErrorPolicy
-{
- /** Substitute default value and ignore */
- ErrorPolicy_Igno,
- /** Substitute default value and write to log */
- ErrorPolicy_Warn,
- /** Substitute a massive error message and crash the whole matrix. Its time for another zion */
- ErrorPolicy_Fail
-};
-
-#ifdef ASSIMP_BUILD_BLENDER_DEBUG
-# define ErrorPolicy_Igno ErrorPolicy_Warn
-#endif
-
-// -------------------------------------------------------------------------------
-/** Represents a data structure in a BLEND file. A Structure defines n fields
- * and their locatios and encodings the input stream. Usually, every
- * Structure instance pertains to one equally-named data structure in the
- * BlenderScene.h header. This class defines various utilities to map a
- * binary `blob` read from the file to such a structure instance with
- * meaningful contents. */
-// -------------------------------------------------------------------------------
-class Structure
-{
- template <template <typename> class> friend class ObjectCache;
-
-public:
-
- Structure()
- : cache_idx(-1)
- {}
-
-public:
-
- // publicly accessible members
- std::string name;
- vector< Field > fields;
- std::map<std::string, size_t> indices;
-
- size_t size;
-
-public:
-
- // --------------------------------------------------------
- /** Access a field of the structure by its canonical name. The pointer version
- * returns NULL on failure while the reference version raises an import error. */
- inline const Field& operator [] (const std::string& ss) const;
- inline const Field* Get (const std::string& ss) const;
-
- // --------------------------------------------------------
- /** Access a field of the structure by its index */
- inline const Field& operator [] (const size_t i) const;
-
- // --------------------------------------------------------
- inline bool operator== (const Structure& other) const {
- return name == other.name; // name is meant to be an unique identifier
- }
-
- // --------------------------------------------------------
- inline bool operator!= (const Structure& other) const {
- return name != other.name;
- }
-
-public:
-
- // --------------------------------------------------------
- /** Try to read an instance of the structure from the stream
- * and attempt to convert to `T`. This is done by
- * an appropriate specialization. If none is available,
- * a compiler complain is the result.
- * @param dest Destination value to be written
- * @param db File database, including input stream. */
- template <typename T> inline void Convert (T& dest,
- const FileDatabase& db) const;
-
-
-
- // --------------------------------------------------------
- // generic converter
- template <typename T>
- void Convert(boost::shared_ptr<ElemBase> in,const FileDatabase& db) const;
-
- // --------------------------------------------------------
- // generic allocator
- template <typename T> boost::shared_ptr<ElemBase> Allocate() const;
-
-
-
- // --------------------------------------------------------
- // field parsing for 1d arrays
- template <int error_policy, typename T, size_t M>
- void ReadFieldArray(T (& out)[M], const char* name,
- const FileDatabase& db) const;
-
- // --------------------------------------------------------
- // field parsing for 2d arrays
- template <int error_policy, typename T, size_t M, size_t N>
- void ReadFieldArray2(T (& out)[M][N], const char* name,
- const FileDatabase& db) const;
-
- // --------------------------------------------------------
- // field parsing for pointer or dynamic array types
- // (boost::shared_ptr or boost::shared_array)
- template <int error_policy, template <typename> class TOUT, typename T>
- void ReadFieldPtr(TOUT<T>& out, const char* name,
- const FileDatabase& db) const;
-
- // --------------------------------------------------------
- // field parsing for static arrays of pointer or dynamic
- // array types (boost::shared_ptr[] or boost::shared_array[])
- template <int error_policy, template <typename> class TOUT, typename T, size_t N>
- void ReadFieldPtr(TOUT<T> (&out)[N], const char* name,
- const FileDatabase& db) const;
-
- // --------------------------------------------------------
- // field parsing for `normal` values
- template <int error_policy, typename T>
- void ReadField(T& out, const char* name,
- const FileDatabase& db) const;
-
-private:
-
- // --------------------------------------------------------
- template <template <typename> class TOUT, typename T>
- void ResolvePointer(TOUT<T>& out, const Pointer & ptrval,
- const FileDatabase& db, const Field& f) const;
-
- // --------------------------------------------------------
- template <template <typename> class TOUT, typename T>
- void ResolvePointer(vector< TOUT<T> >& out, const Pointer & ptrval,
- const FileDatabase& db, const Field& f) const;
-
- // --------------------------------------------------------
- void ResolvePointer( boost::shared_ptr< FileOffset >& out, const Pointer & ptrval,
- const FileDatabase& db, const Field& f) const;
-
- // --------------------------------------------------------
- inline const FileBlockHead* LocateFileBlockForAddress(
- const Pointer & ptrval,
- const FileDatabase& db) const;
-
-private:
-
- // ------------------------------------------------------------------------------
- template <typename T> T* _allocate(boost::shared_ptr<T>& out, size_t& s) const {
- out = boost::shared_ptr<T>(new T());
- s = 1;
- return out.get();
- }
-
- template <typename T> T* _allocate(vector<T>& out, size_t& s) const {
- out.resize(s);
- return s ? &out.front() : NULL;
- }
-
- // --------------------------------------------------------
- template <int error_policy>
- struct _defaultInitializer {
-
- template <typename T, unsigned int N>
- void operator ()(T (& out)[N], const char* = NULL) {
- for (unsigned int i = 0; i < N; ++i) {
- out[i] = T();
- }
- }
-
- template <typename T, unsigned int N, unsigned int M>
- void operator ()(T (& out)[N][M], const char* = NULL) {
- for (unsigned int i = 0; i < N; ++i) {
- for (unsigned int j = 0; j < M; ++j) {
- out[i][j] = T();
- }
- }
- }
-
- template <typename T>
- void operator ()(T& out, const char* = NULL) {
- out = T();
- }
- };
-
-private:
-
- mutable size_t cache_idx;
-};
-
-// --------------------------------------------------------
-template <> struct Structure :: _defaultInitializer<ErrorPolicy_Warn> {
-
- template <typename T>
- void operator ()(T& out, const char* reason = "<add reason>") {
- DefaultLogger::get()->warn(reason);
-
- // ... and let the show go on
- _defaultInitializer<0 /*ErrorPolicy_Igno*/>()(out);
- }
-};
-
-template <> struct Structure :: _defaultInitializer<ErrorPolicy_Fail> {
-
- template <typename T>
- void operator ()(T& out,const char* = "") {
- // obviously, it is crucial that _DefaultInitializer is used
- // only from within a catch clause.
- throw;
- }
-};
-
-// -------------------------------------------------------------------------------------------------------
-template <> inline void Structure :: ResolvePointer<boost::shared_ptr,ElemBase>(boost::shared_ptr<ElemBase>& out,
- const Pointer & ptrval,
- const FileDatabase& db,
- const Field& f
- ) const;
-
-
-// -------------------------------------------------------------------------------
-/** Represents the full data structure information for a single BLEND file.
- * This data is extracted from the DNA1 chunk in the file.
- * #DNAParser does the reading and represents currently the only place where
- * DNA is altered.*/
-// -------------------------------------------------------------------------------
-class DNA
-{
-public:
-
- typedef void (Structure::*ConvertProcPtr) (
- boost::shared_ptr<ElemBase> in,
- const FileDatabase&
- ) const;
-
- typedef boost::shared_ptr<ElemBase> (
- Structure::*AllocProcPtr) () const;
-
- typedef std::pair< AllocProcPtr, ConvertProcPtr > FactoryPair;
-
-public:
-
- std::map<std::string, FactoryPair > converters;
- vector<Structure > structures;
- std::map<std::string, size_t> indices;
-
-public:
-
- // --------------------------------------------------------
- /** Access a structure by its canonical name, the pointer version returns NULL on failure
- * while the reference version raises an error. */
- inline const Structure& operator [] (const std::string& ss) const;
- inline const Structure* Get (const std::string& ss) const;
-
- // --------------------------------------------------------
- /** Access a structure by its index */
- inline const Structure& operator [] (const size_t i) const;
-
-public:
-
- // --------------------------------------------------------
- /** Add structure definitions for all the primitive types,
- * i.e. integer, short, char, float */
- void AddPrimitiveStructures();
-
- // --------------------------------------------------------
- /** Fill the @c converters member with converters for all
- * known data types. The implementation of this method is
- * in BlenderScene.cpp and is machine-generated.
- * Converters are used to quickly handle objects whose
- * exact data type is a runtime-property and not yet
- * known at compile time (consier Object::data).*/
- void RegisterConverters();
-
-
- // --------------------------------------------------------
- /** Take an input blob from the stream, interpret it according to
- * a its structure name and convert it to the intermediate
- * representation.
- * @param structure Destination structure definition
- * @param db File database.
- * @return A null pointer if no appropriate converter is available.*/
- boost::shared_ptr< ElemBase > ConvertBlobToStructure(
- const Structure& structure,
- const FileDatabase& db
- ) const;
-
- // --------------------------------------------------------
- /** Find a suitable conversion function for a given Structure.
- * Such a converter function takes a blob from the input
- * stream, reads as much as it needs, and builds up a
- * complete object in intermediate representation.
- * @param structure Destination structure definition
- * @param db File database.
- * @return A null pointer in .first if no appropriate converter is available.*/
- FactoryPair GetBlobToStructureConverter(
- const Structure& structure,
- const FileDatabase& db
- ) const;
-
-
-#ifdef ASSIMP_BUILD_BLENDER_DEBUG
- // --------------------------------------------------------
- /** Dump the DNA to a text file. This is for debugging purposes.
- * The output file is `dna.txt` in the current working folder*/
- void DumpToFile();
-#endif
-
- // --------------------------------------------------------
- /** Extract array dimensions from a C array declaration, such
- * as `...[4][6]`. Returned string would be `...[][]`.
- * @param out
- * @param array_sizes Receive maximally two array dimensions,
- * the second element is set to 1 if the array is flat.
- * Both are set to 1 if the input is not an array.
- * @throw DeadlyImportError if more than 2 dimensions are
- * encountered. */
- static void ExtractArraySize(
- const std::string& out,
- size_t array_sizes[2]
- );
-};
-
-// special converters for primitive types
-template <> inline void Structure :: Convert<int> (int& dest,const FileDatabase& db) const;
-template <> inline void Structure :: Convert<short> (short& dest,const FileDatabase& db) const;
-template <> inline void Structure :: Convert<char> (char& dest,const FileDatabase& db) const;
-template <> inline void Structure :: Convert<float> (float& dest,const FileDatabase& db) const;
-template <> inline void Structure :: Convert<double> (double& dest,const FileDatabase& db) const;
-template <> inline void Structure :: Convert<Pointer> (Pointer& dest,const FileDatabase& db) const;
-
-// -------------------------------------------------------------------------------
-/** Describes a master file block header. Each master file sections holds n
- * elements of a certain SDNA structure (or otherwise unspecified data). */
-// -------------------------------------------------------------------------------
-struct FileBlockHead
-{
- // points right after the header of the file block
- StreamReaderAny::pos start;
-
- std::string id;
- size_t size;
-
- // original memory address of the data
- Pointer address;
-
- // index into DNA
- unsigned int dna_index;
-
- // number of structure instances to follow
- size_t num;
-
-
-
- // file blocks are sorted by address to quickly locate specific memory addresses
- bool operator < (const FileBlockHead& o) const {
- return address.val < o.address.val;
- }
-
- // for std::upper_bound
- operator const Pointer& () const {
- return address;
- }
-};
-
-// for std::upper_bound
-inline bool operator< (const Pointer& a, const Pointer& b) {
- return a.val < b.val;
-}
-
-// -------------------------------------------------------------------------------
-/** Utility to read all master file blocks in turn. */
-// -------------------------------------------------------------------------------
-class SectionParser
-{
-public:
-
- // --------------------------------------------------------
- /** @param stream Inout stream, must point to the
- * first section in the file. Call Next() once
- * to have it read.
- * @param ptr64 Pointer size in file is 64 bits? */
- SectionParser(StreamReaderAny& stream,bool ptr64)
- : stream(stream)
- , ptr64(ptr64)
- {
- current.size = current.start = 0;
- }
-
-public:
-
- // --------------------------------------------------------
- const FileBlockHead& GetCurrent() const {
- return current;
- }
-
-
-public:
-
- // --------------------------------------------------------
- /** Advance to the next section.
- * @throw DeadlyImportError if the last chunk was passed. */
- void Next();
-
-public:
-
- FileBlockHead current;
- StreamReaderAny& stream;
- bool ptr64;
-};
-
-
-#ifndef ASSIMP_BUILD_BLENDER_NO_STATS
-// -------------------------------------------------------------------------------
-/** Import statistics, i.e. number of file blocks read*/
-// -------------------------------------------------------------------------------
-class Statistics {
-
-public:
-
- Statistics ()
- : fields_read ()
- , pointers_resolved ()
- , cache_hits ()
-// , blocks_read ()
- , cached_objects ()
- {}
-
-public:
-
- /** total number of fields we read */
- unsigned int fields_read;
-
- /** total number of resolved pointers */
- unsigned int pointers_resolved;
-
- /** number of pointers resolved from the cache */
- unsigned int cache_hits;
-
- /** number of blocks (from FileDatabase::entries)
- we did actually read from. */
- // unsigned int blocks_read;
-
- /** objects in FileData::cache */
- unsigned int cached_objects;
-};
-#endif
-
-// -------------------------------------------------------------------------------
-/** The object cache - all objects addressed by pointers are added here. This
- * avoids circular references and avoids object duplication. */
-// -------------------------------------------------------------------------------
-template <template <typename> class TOUT>
-class ObjectCache
-{
-public:
-
- typedef std::map< Pointer, TOUT<ElemBase> > StructureCache;
-
-public:
-
- ObjectCache(const FileDatabase& db)
- : db(db)
- {
- // currently there are only ~400 structure records per blend file.
- // we read only a small part of them and don't cache objects
- // which we don't need, so this should suffice.
- caches.reserve(64);
- }
-
-public:
-
- // --------------------------------------------------------
- /** Check whether a specific item is in the cache.
- * @param s Data type of the item
- * @param out Output pointer. Unchanged if the
- * cache doens't know the item yet.
- * @param ptr Item address to look for. */
- template <typename T> void get (
- const Structure& s,
- TOUT<T>& out,
- const Pointer& ptr) const;
-
- // --------------------------------------------------------
- /** Add an item to the cache after the item has
- * been fully read. Do not insert anything that
- * may be faulty or might cause the loading
- * to abort.
- * @param s Data type of the item
- * @param out Item to insert into the cache
- * @param ptr address (cache key) of the item. */
- template <typename T> void set
- (const Structure& s,
- const TOUT<T>& out,
- const Pointer& ptr);
-
-private:
-
- mutable vector<StructureCache> caches;
- const FileDatabase& db;
-};
-
-// -------------------------------------------------------------------------------
-// -------------------------------------------------------------------------------
-template <> class ObjectCache<Blender::vector>
-{
-public:
-
- ObjectCache(const FileDatabase&) {}
-
- template <typename T> void get(const Structure&, vector<T>&t, const Pointer&) {}
- template <typename T> void set(const Structure&, const vector<T>&, const Pointer&) {}
-};
-
-#ifdef _MSC_VER
-# pragma warning(disable:4355)
-#endif
-
-// -------------------------------------------------------------------------------
-/** Memory representation of a full BLEND file and all its dependencies. The
- * output aiScene is constructed from an instance of this data structure. */
-// -------------------------------------------------------------------------------
-class FileDatabase
-{
- template <template <typename> class TOUT> friend class ObjectCache;
-
-public:
-
-
- FileDatabase()
- : next_cache_idx()
- , _cacheArrays(*this)
- , _cache(*this)
- {}
-
-public:
-
- // publicly accessible fields
- bool i64bit;
- bool little;
-
- DNA dna;
- boost::shared_ptr< StreamReaderAny > reader;
- vector< FileBlockHead > entries;
-
-public:
-
- Statistics& stats() const {
- return _stats;
- }
-
- // For all our templates to work on both shared_ptr's and vector's
- // using the same code, a dummy cache for arrays is provided. Actually,
- // arrays of objects are never cached because we can't easily
- // ensure their proper destruction.
- template <typename T>
- ObjectCache<boost::shared_ptr>& cache(boost::shared_ptr<T>& in) const {
- return _cache;
- }
-
- template <typename T>
- ObjectCache<vector>& cache(vector<T>& in) const {
- return _cacheArrays;
- }
-
-private:
-
-
-#ifndef ASSIMP_BUILD_BLENDER_NO_STATS
- mutable Statistics _stats;
-#endif
-
- mutable ObjectCache<vector> _cacheArrays;
- mutable ObjectCache<boost::shared_ptr> _cache;
-
- mutable size_t next_cache_idx;
-};
-
-#ifdef _MSC_VER
-# pragma warning(default:4355)
-#endif
-
-// -------------------------------------------------------------------------------
-/** Factory to extract a #DNA from the DNA1 file block in a BLEND file. */
-// -------------------------------------------------------------------------------
-class DNAParser
-{
-
-public:
-
- /** Bind the parser to a empty DNA and an input stream */
- DNAParser(FileDatabase& db)
- : db(db)
- {}
-
-public:
-
- // --------------------------------------------------------
- /** Locate the DNA in the file and parse it. The input
- * stream is expected to point to the beginning of the DN1
- * chunk at the time this method is called and is
- * undefined afterwards.
- * @throw DeadlyImportError if the DNA cannot be read.
- * @note The position of the stream pointer is undefined
- * afterwards.*/
- void Parse ();
-
-public:
-
- /** Obtain a reference to the extracted DNA information */
- const Blender::DNA& GetDNA() const {
- return db.dna;
- }
-
-private:
-
- FileDatabase& db;
-};
-
-//--------------------------------------------------------------------------------
-template <> inline void Structure :: ResolvePointer<boost::shared_ptr,ElemBase>(boost::shared_ptr<ElemBase>& out,
- const Pointer & ptrval,
- const FileDatabase& db,
- const Field& /* f */
- ) const
-{
- // Special case when the data type needs to be determined at runtime.
- // Less secure than in the `strongly-typed` case.
-
- out.reset();
- if (!ptrval.val) {
- return;
- }
-
- // find the file block the pointer is pointing to
- const FileBlockHead* block = LocateFileBlockForAddress(ptrval,db);
-
- // determine the target type from the block header
- const Structure& s = db.dna[block->dna_index];
-
- // try to retrieve the object from the cache
- db.cache(out).get(s,out,ptrval);
- if (out) {
- return;
- }
-
- // seek to this location, but save the previous stream pointer.
- const StreamReaderAny::pos pold = db.reader->GetCurrentPos();
- db.reader->SetCurrentPos(block->start+ static_cast<size_t>((ptrval.val - block->address.val) ));
- // FIXME: basically, this could cause problems with 64 bit pointers on 32 bit systems.
- // I really ought to improve StreamReader to work with 64 bit indices exclusively.
-
- // continue conversion after allocating the required storage
- DNA::FactoryPair builders = db.dna.GetBlobToStructureConverter(s,db);
- if (!builders.first) {
- // this might happen if DNA::RegisterConverters hasn't been called so far
- // or if the target type is not contained in `our` DNA.
- out.reset();
- DefaultLogger::get()->warn((Formatter::format(),
- "Failed to find a converter for the `",s.name,"` structure"
- ));
- return;
- }
-
- // allocate the object hull
- out = (s.*builders.first)();
-
- // cache the object immediately to prevent infinite recursion in a
- // circular list with a single element (i.e. a self-referencing element).
- db.cache(out).set(s,out,ptrval);
-
- // and do the actual conversion
- (s.*builders.second)(out,db);
- db.reader->SetCurrentPos(pold);
-
- // store a pointer to the name string of the actual type
- // in the object itself. This allows the conversion code
- // to perform additional type checking.
- out->dna_type = s.name.c_str();
-
-
-
-#ifndef ASSIMP_BUILD_BLENDER_NO_STATS
- ++db.stats().pointers_resolved;
-#endif
-}
-
- } // end Blend
-} // end Assimp
-
-#include "BlenderDNA.inl"
-
-#endif
diff --git a/3rdparty/assimp/code/BlenderDNA.inl b/3rdparty/assimp/code/BlenderDNA.inl
deleted file mode 100644
index 511e7878..00000000
--- a/3rdparty/assimp/code/BlenderDNA.inl
+++ /dev/null
@@ -1,638 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file BlenderDNA.inl
- * @brief Blender `DNA` (file format specification embedded in
- * blend file itself) loader.
- */
-#ifndef INCLUDED_AI_BLEND_DNA_INL
-#define INCLUDED_AI_BLEND_DNA_INL
-
-namespace Assimp {
- namespace Blender {
-
-//--------------------------------------------------------------------------------
-const Field& Structure :: operator [] (const std::string& ss) const
-{
- std::map<std::string, size_t>::const_iterator it = indices.find(ss);
- if (it == indices.end()) {
- throw Error((Formatter::format(),
- "BlendDNA: Did not find a field named `",ss,"` in structure `",name,"`"
- ));
- }
-
- return fields[(*it).second];
-}
-
-//--------------------------------------------------------------------------------
-const Field* Structure :: Get (const std::string& ss) const
-{
- std::map<std::string, size_t>::const_iterator it = indices.find(ss);
- return it == indices.end() ? NULL : &fields[(*it).second];
-}
-
-//--------------------------------------------------------------------------------
-const Field& Structure :: operator [] (const size_t i) const
-{
- if (i >= fields.size()) {
- throw Error((Formatter::format(),
- "BlendDNA: There is no field with index `",i,"` in structure `",name,"`"
- ));
- }
-
- return fields[i];
-}
-
-//--------------------------------------------------------------------------------
-template <typename T> boost::shared_ptr<ElemBase> Structure :: Allocate() const
-{
- return boost::shared_ptr<T>(new T());
-}
-
-//--------------------------------------------------------------------------------
-template <typename T> void Structure :: Convert(
- boost::shared_ptr<ElemBase> in,
- const FileDatabase& db) const
-{
- Convert<T> (*static_cast<T*> ( in.get() ),db);
-}
-
-//--------------------------------------------------------------------------------
-template <int error_policy, typename T, size_t M>
-void Structure :: ReadFieldArray(T (& out)[M], const char* name, const FileDatabase& db) const
-{
- const StreamReaderAny::pos old = db.reader->GetCurrentPos();
- try {
- const Field& f = (*this)[name];
- const Structure& s = db.dna[f.type];
-
- // is the input actually an array?
- if (!(f.flags & FieldFlag_Array)) {
- throw Error((Formatter::format(),"Field `",name,"` of structure `",
- this->name,"` ought to be an array of size ",M
- ));
- }
-
- db.reader->IncPtr(f.offset);
-
- // size conversions are always allowed, regardless of error_policy
- unsigned int i = 0;
- for (; i < std::min(f.array_sizes[0],M); ++i) {
- s.Convert(out[i],db);
- }
- for (; i < M; ++i) {
- _defaultInitializer<ErrorPolicy_Igno>()(out[i]);
- }
- }
- catch (const Error& e) {
- _defaultInitializer<error_policy>()(out,e.what());
- }
-
- // and recover the previous stream position
- db.reader->SetCurrentPos(old);
-
-#ifndef ASSIMP_BUILD_BLENDER_NO_STATS
- ++db.stats().fields_read;
-#endif
-}
-
-//--------------------------------------------------------------------------------
-template <int error_policy, typename T, size_t M, size_t N>
-void Structure :: ReadFieldArray2(T (& out)[M][N], const char* name, const FileDatabase& db) const
-{
- const StreamReaderAny::pos old = db.reader->GetCurrentPos();
- try {
- const Field& f = (*this)[name];
- const Structure& s = db.dna[f.type];
-
- // is the input actually an array?
- if (!(f.flags & FieldFlag_Array)) {
- throw Error((Formatter::format(),"Field `",name,"` of structure `",
- this->name,"` ought to be an array of size ",M,"*",N
- ));
- }
-
- db.reader->IncPtr(f.offset);
-
- // size conversions are always allowed, regardless of error_policy
- unsigned int i = 0;
- for (; i < std::min(f.array_sizes[0],M); ++i) {
- unsigned int j = 0;
- for (; j < std::min(f.array_sizes[1],N); ++j) {
- s.Convert(out[i][j],db);
- }
- for (; j < N; ++j) {
- _defaultInitializer<ErrorPolicy_Igno>()(out[i][j]);
- }
- }
- for (; i < M; ++i) {
- _defaultInitializer<ErrorPolicy_Igno>()(out[i]);
- }
- }
- catch (const Error& e) {
- _defaultInitializer<error_policy>()(out,e.what());
- }
-
- // and recover the previous stream position
- db.reader->SetCurrentPos(old);
-
-#ifndef ASSIMP_BUILD_BLENDER_NO_STATS
- ++db.stats().fields_read;
-#endif
-}
-
-//--------------------------------------------------------------------------------
-template <int error_policy, template <typename> class TOUT, typename T>
-void Structure :: ReadFieldPtr(TOUT<T>& out, const char* name, const FileDatabase& db) const
-{
- const StreamReaderAny::pos old = db.reader->GetCurrentPos();
- Pointer ptrval;
- const Field* f;
- try {
- f = &(*this)[name];
-
- // sanity check, should never happen if the genblenddna script is right
- if (!(f->flags & FieldFlag_Pointer)) {
- throw Error((Formatter::format(),"Field `",name,"` of structure `",
- this->name,"` ought to be a pointer"));
- }
-
- db.reader->IncPtr(f->offset);
- Convert(ptrval,db);
- // actually it is meaningless on which Structure the Convert is called
- // because the `Pointer` argument triggers a special implementation.
- }
- catch (const Error& e) {
- _defaultInitializer<error_policy>()(out,e.what());
-
- out.reset();
- return;
- }
-
- // resolve the pointer and load the corresponding structure
- ResolvePointer(out,ptrval,db,*f);
-
- // and recover the previous stream position
- db.reader->SetCurrentPos(old);
-
-#ifndef ASSIMP_BUILD_BLENDER_NO_STATS
- ++db.stats().fields_read;
-#endif
-}
-
-//--------------------------------------------------------------------------------
-template <int error_policy, template <typename> class TOUT, typename T, size_t N>
-void Structure :: ReadFieldPtr(TOUT<T> (&out)[N], const char* name,
- const FileDatabase& db) const
-{
- // XXX see if we can reduce this to call to the 'normal' ReadFieldPtr
- const StreamReaderAny::pos old = db.reader->GetCurrentPos();
- Pointer ptrval[N];
- const Field* f;
- try {
- f = &(*this)[name];
-
- // sanity check, should never happen if the genblenddna script is right
- if ((FieldFlag_Pointer|FieldFlag_Pointer) != (f->flags & (FieldFlag_Pointer|FieldFlag_Pointer))) {
- throw Error((Formatter::format(),"Field `",name,"` of structure `",
- this->name,"` ought to be a pointer AND an array"));
- }
-
- db.reader->IncPtr(f->offset);
-
- size_t i = 0;
- for (; i < std::min(f->array_sizes[0],N); ++i) {
- Convert(ptrval[i],db);
- }
- for (; i < N; ++i) {
- _defaultInitializer<ErrorPolicy_Igno>()(ptrval[i]);
- }
-
- // actually it is meaningless on which Structure the Convert is called
- // because the `Pointer` argument triggers a special implementation.
- }
- catch (const Error& e) {
- _defaultInitializer<error_policy>()(out,e.what());
- for (size_t i = 0; i < N; ++i) {
- out[i].reset();
- }
- return;
- }
- for (size_t i = 0; i < N; ++i) {
- // resolve the pointer and load the corresponding structure
- ResolvePointer(out[i],ptrval[i],db,*f);
- }
-
- // and recover the previous stream position
- db.reader->SetCurrentPos(old);
-
-#ifndef ASSIMP_BUILD_BLENDER_NO_STATS
- ++db.stats().fields_read;
-#endif
-}
-
-//--------------------------------------------------------------------------------
-template <int error_policy, typename T>
-void Structure :: ReadField(T& out, const char* name, const FileDatabase& db) const
-{
- const StreamReaderAny::pos old = db.reader->GetCurrentPos();
- try {
- const Field& f = (*this)[name];
- // find the structure definition pertaining to this field
- const Structure& s = db.dna[f.type];
-
- db.reader->IncPtr(f.offset);
- s.Convert(out,db);
- }
- catch (const Error& e) {
- _defaultInitializer<error_policy>()(out,e.what());
- }
-
- // and recover the previous stream position
- db.reader->SetCurrentPos(old);
-
-#ifndef ASSIMP_BUILD_BLENDER_NO_STATS
- ++db.stats().fields_read;
-#endif
-}
-
-
-//--------------------------------------------------------------------------------
-template <template <typename> class TOUT, typename T>
-void Structure :: ResolvePointer(TOUT<T>& out, const Pointer & ptrval, const FileDatabase& db, const Field& f) const
-{
- out.reset();
- if (!ptrval.val) {
- return;
- }
- const Structure& s = db.dna[f.type];
- // find the file block the pointer is pointing to
- const FileBlockHead* block = LocateFileBlockForAddress(ptrval,db);
-
- // also determine the target type from the block header
- // and check if it matches the type which we expect.
- const Structure& ss = db.dna[block->dna_index];
- if (ss != s) {
- throw Error((Formatter::format(),"Expected target to be of type `",s.name,
- "` but seemingly it is a `",ss.name,"` instead"
- ));
- }
-
- // try to retrieve the object from the cache
- db.cache(out).get(s,out,ptrval);
- if (out) {
- return;
- }
-
- // seek to this location, but save the previous stream pointer.
- const StreamReaderAny::pos pold = db.reader->GetCurrentPos();
- db.reader->SetCurrentPos(block->start+ static_cast<size_t>((ptrval.val - block->address.val) ));
- // FIXME: basically, this could cause problems with 64 bit pointers on 32 bit systems.
- // I really ought to improve StreamReader to work with 64 bit indices exclusively.
-
- // continue conversion after allocating the required storage
- size_t num = block->size / ss.size;
- T* o = _allocate(out,num);
-
- // cache the object before we convert it to avoid cyclic recursion.
- db.cache(out).set(s,out,ptrval);
-
- for (size_t i = 0; i < num; ++i,++o) {
- s.Convert(*o,db);
- }
-
- db.reader->SetCurrentPos(pold);
-
-#ifndef ASSIMP_BUILD_BLENDER_NO_STATS
- if (out) {
- ++db.stats().pointers_resolved;
- }
-#endif
-}
-
-//--------------------------------------------------------------------------------
-inline void Structure :: ResolvePointer( boost::shared_ptr< FileOffset >& out, const Pointer & ptrval, const FileDatabase& db, const Field& /* f */ ) const
-{
- // Currently used exclusively by PackedFile::data to represent
- // a simple offset into the mapped BLEND file.
- out.reset();
- if (!ptrval.val) {
- return;
- }
-
- // find the file block the pointer is pointing to
- const FileBlockHead* block = LocateFileBlockForAddress(ptrval,db);
-
- out = boost::shared_ptr< FileOffset > (new FileOffset());
- out->val = block->start+ static_cast<size_t>((ptrval.val - block->address.val) );
-}
-
-//--------------------------------------------------------------------------------
-template <template <typename> class TOUT, typename T>
-void Structure :: ResolvePointer(vector< TOUT<T> >& out, const Pointer & ptrval, const FileDatabase& db, const Field& f) const
-{
- // This is a function overload, not a template specialization. According to
- // the partial ordering rules, it should be selected by the compiler
- // for array-of-pointer inputs, i.e. Object::mats.
-
- out.reset();
- if (!ptrval.val) {
- return;
- }
-
- // find the file block the pointer is pointing to
- const FileBlockHead* block = LocateFileBlockForAddress(ptrval,db);
- const size_t num = block->size / (db.i64bit?8:4);
-
- // keep the old stream position
- const StreamReaderAny::pos pold = db.reader->GetCurrentPos();
- db.reader->SetCurrentPos(block->start+ static_cast<size_t>((ptrval.val - block->address.val) ));
-
- // allocate raw storage for the array
- out.resize(num);
- for (size_t i = 0; i< num; ++i) {
- Pointer val;
- Convert(val,db);
-
- // and resolve the pointees
- ResolvePointer(out[i],val,db,f);
- }
-
- db.reader->SetCurrentPos(pold);
-}
-
-//--------------------------------------------------------------------------------
-const FileBlockHead* Structure :: LocateFileBlockForAddress(const Pointer & ptrval, const FileDatabase& db) const
-{
- // the file blocks appear in list sorted by
- // with ascending base addresses so we can run a
- // binary search to locate the pointee quickly.
-
- // NOTE: Blender seems to distinguish between side-by-side
- // data (stored in the same data block) and far pointers,
- // which are only used for structures starting with an ID.
- // We don't need to make this distinction, our algorithm
- // works regardless where the data is stored.
- vector<FileBlockHead>::const_iterator it = std::lower_bound(db.entries.begin(),db.entries.end(),ptrval);
- if (it == db.entries.end()) {
- // this is crucial, pointers may not be invalid.
- // this is either a corrupted file or an attempted attack.
- throw DeadlyImportError((Formatter::format(),"Failure resolving pointer 0x",
- std::hex,ptrval.val,", no file block falls into this address range"
- ));
- }
- if (ptrval.val >= (*it).address.val + (*it).size) {
- throw DeadlyImportError((Formatter::format(),"Failure resolving pointer 0x",
- std::hex,ptrval.val,", nearest file block starting at 0x",
- (*it).address.val," ends at 0x",
- (*it).address.val + (*it).size
- ));
- }
- return &*it;
-}
-
-// ------------------------------------------------------------------------------------------------
-// NOTE: The MSVC debugger keeps showing up this annoying `a cast to a smaller data type has
-// caused a loss of data`-warning. Avoid this warning by a masking with an appropriate bitmask.
-
-template <typename T> struct signless;
-template <> struct signless<char> {typedef unsigned char type;};
-template <> struct signless<short> {typedef unsigned short type;};
-template <> struct signless<int> {typedef unsigned int type;};
-
-template <typename T>
-struct static_cast_silent {
- template <typename V>
- T operator()(V in) {
- return static_cast<T>(in & static_cast<typename signless<T>::type>(-1));
- }
-};
-
-template <> struct static_cast_silent<float> {
- template <typename V> float operator()(V in) {
- return static_cast<float> (in);
- }
-};
-
-template <> struct static_cast_silent<double> {
- template <typename V> double operator()(V in) {
- return static_cast<double>(in);
- }
-};
-
-// ------------------------------------------------------------------------------------------------
-template <typename T> inline void ConvertDispatcher(T& out, const Structure& in,const FileDatabase& db)
-{
- if (in.name == "int") {
- out = static_cast_silent<T>()(db.reader->GetU4());
- }
- else if (in.name == "short") {
- out = static_cast_silent<T>()(db.reader->GetU2());
- }
- else if (in.name == "char") {
- out = static_cast_silent<T>()(db.reader->GetU1());
- }
- else if (in.name == "float") {
- out = static_cast<T>(db.reader->GetF4());
- }
- else if (in.name == "double") {
- out = static_cast<T>(db.reader->GetF8());
- }
- else {
- throw DeadlyImportError("Unknown source for conversion to primitive data type: "+in.name);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-template <> inline void Structure :: Convert<int> (int& dest,const FileDatabase& db) const
-{
- ConvertDispatcher(dest,*this,db);
-}
-
-// ------------------------------------------------------------------------------------------------
-template <> inline void Structure :: Convert<short> (short& dest,const FileDatabase& db) const
-{
- // automatic rescaling from short to float and vice versa (seems to be used by normals)
- if (name == "float") {
- dest = static_cast<short>(db.reader->GetF4() * 32767.f);
- //db.reader->IncPtr(-4);
- return;
- }
- else if (name == "double") {
- dest = static_cast<short>(db.reader->GetF8() * 32767.);
- //db.reader->IncPtr(-8);
- return;
- }
- ConvertDispatcher(dest,*this,db);
-}
-
-// ------------------------------------------------------------------------------------------------
-template <> inline void Structure :: Convert<char> (char& dest,const FileDatabase& db) const
-{
- // automatic rescaling from char to float and vice versa (seems useful for RGB colors)
- if (name == "float") {
- dest = static_cast<char>(db.reader->GetF4() * 255.f);
- return;
- }
- else if (name == "double") {
- dest = static_cast<char>(db.reader->GetF8() * 255.f);
- return;
- }
- ConvertDispatcher(dest,*this,db);
-}
-
-// ------------------------------------------------------------------------------------------------
-template <> inline void Structure :: Convert<float> (float& dest,const FileDatabase& db) const
-{
- // automatic rescaling from char to float and vice versa (seems useful for RGB colors)
- if (name == "char") {
- dest = db.reader->GetI1() / 255.f;
- return;
- }
- // automatic rescaling from short to float and vice versa (used by normals)
- else if (name == "short") {
- dest = db.reader->GetI2() / 32767.f;
- return;
- }
- ConvertDispatcher(dest,*this,db);
-}
-
-// ------------------------------------------------------------------------------------------------
-template <> inline void Structure :: Convert<double> (double& dest,const FileDatabase& db) const
-{
- if (name == "char") {
- dest = db.reader->GetI1() / 255.;
- return;
- }
- else if (name == "short") {
- dest = db.reader->GetI2() / 32767.;
- return;
- }
- ConvertDispatcher(dest,*this,db);
-}
-
-// ------------------------------------------------------------------------------------------------
-template <> inline void Structure :: Convert<Pointer> (Pointer& dest,const FileDatabase& db) const
-{
- if (db.i64bit) {
- dest.val = db.reader->GetU8();
- //db.reader->IncPtr(-8);
- return;
- }
- dest.val = db.reader->GetU4();
- //db.reader->IncPtr(-4);
-}
-
-//--------------------------------------------------------------------------------
-const Structure& DNA :: operator [] (const std::string& ss) const
-{
- std::map<std::string, size_t>::const_iterator it = indices.find(ss);
- if (it == indices.end()) {
- throw Error((Formatter::format(),
- "BlendDNA: Did not find a structure named `",ss,"`"
- ));
- }
-
- return structures[(*it).second];
-}
-
-//--------------------------------------------------------------------------------
-const Structure* DNA :: Get (const std::string& ss) const
-{
- std::map<std::string, size_t>::const_iterator it = indices.find(ss);
- return it == indices.end() ? NULL : &structures[(*it).second];
-}
-
-//--------------------------------------------------------------------------------
-const Structure& DNA :: operator [] (const size_t i) const
-{
- if (i >= structures.size()) {
- throw Error((Formatter::format(),
- "BlendDNA: There is no structure with index `",i,"`"
- ));
- }
-
- return structures[i];
-}
-
-//--------------------------------------------------------------------------------
-template <template <typename> class TOUT> template <typename T> void ObjectCache<TOUT> :: get (
- const Structure& s,
- TOUT<T>& out,
- const Pointer& ptr
-) const {
-
- if (s.cache_idx == static_cast<size_t>(-1)) {
- s.cache_idx = db.next_cache_idx++;
- caches.resize(db.next_cache_idx);
- return;
- }
-
- typename StructureCache::const_iterator it = caches[s.cache_idx].find(ptr);
- if (it != caches[s.cache_idx].end()) {
- out = boost::static_pointer_cast<T>( (*it).second );
-
-#ifndef ASSIMP_BUILD_BLENDER_NO_STATS
- ++db.stats().cache_hits;
-#endif
- }
- // otherwise, out remains untouched
-}
-
-
-//--------------------------------------------------------------------------------
-template <template <typename> class TOUT> template <typename T> void ObjectCache<TOUT> :: set (
- const Structure& s,
- const TOUT<T>& out,
- const Pointer& ptr
-) {
- if (s.cache_idx == static_cast<size_t>(-1)) {
- s.cache_idx = db.next_cache_idx++;
- caches.resize(db.next_cache_idx);
- }
- caches[s.cache_idx][ptr] = boost::static_pointer_cast<ElemBase>( out );
-
-#ifndef ASSIMP_BUILD_BLENDER_NO_STATS
- ++db.stats().cached_objects;
-#endif
-}
-
-}}
-#endif
diff --git a/3rdparty/assimp/code/BlenderIntermediate.h b/3rdparty/assimp/code/BlenderIntermediate.h
deleted file mode 100644
index 99e0e64e..00000000
--- a/3rdparty/assimp/code/BlenderIntermediate.h
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file BlenderIntermediate.h
- * @brief Internal utility structures for the BlenderLoader. It also serves
- * as master include file for the whole (internal) Blender subsystem.
- */
-#ifndef INCLUDED_AI_BLEND_INTERMEDIATE_H
-#define INCLUDED_AI_BLEND_INTERMEDIATE_H
-
-#include "BlenderLoader.h"
-#include "BlenderDNA.h"
-#include "BlenderScene.h"
-#include "BlenderSceneGen.h"
-
-#define for_each(x,y) BOOST_FOREACH(x,y)
-
-namespace Assimp {
-namespace Blender {
-
- // --------------------------------------------------------------------
- /** Mini smart-array to avoid pulling in even more boost stuff. usable with vector and deque */
- // --------------------------------------------------------------------
- template <template <typename,typename> class TCLASS, typename T>
- struct TempArray {
- typedef TCLASS< T*,std::allocator<T*> > mywrap;
-
- TempArray() {
- }
-
- ~TempArray () {
- for_each(T* elem, arr) {
- delete elem;
- }
- }
-
- void dismiss() {
- arr.clear();
- }
-
- mywrap* operator -> () {
- return &arr;
- }
-
- operator mywrap& () {
- return arr;
- }
-
- operator const mywrap& () const {
- return arr;
- }
-
- mywrap& get () {
- return arr;
- }
-
- const mywrap& get () const {
- return arr;
- }
-
- T* operator[] (size_t idx) const {
- return arr[idx];
- }
-
- T*& operator[] (size_t idx) {
- return arr[idx];
- }
-
- private:
- // no copy semantics
- void operator= (const TempArray&) {
- }
-
- TempArray(const TempArray& arr) {
- }
-
- private:
- mywrap arr;
- };
-
-#ifdef _MSC_VER
-# pragma warning(disable:4351)
-#endif
- // --------------------------------------------------------------------
- /** ConversionData acts as intermediate storage location for
- * the various ConvertXXX routines in BlenderImporter.*/
- // --------------------------------------------------------------------
- struct ConversionData
- {
- ConversionData(const FileDatabase& db)
- : sentinel_cnt()
- , next_texture()
- , db(db)
- {}
-
- std::set<const Object*> objects;
-
- TempArray <std::vector, aiMesh> meshes;
- TempArray <std::vector, aiCamera> cameras;
- TempArray <std::vector, aiLight> lights;
- TempArray <std::vector, aiMaterial> materials;
- TempArray <std::vector, aiTexture> textures;
-
- // set of all materials referenced by at least one mesh in the scene
- std::deque< boost::shared_ptr< Material > > materials_raw;
-
- // counter to name sentinel textures inserted as substitutes for procedural textures.
- unsigned int sentinel_cnt;
-
- // next texture ID for each texture type, respectively
- unsigned int next_texture[aiTextureType_UNKNOWN+1];
-
- // original file data
- const FileDatabase& db;
- };
-#ifdef _MSC_VER
-# pragma warning(default:4351)
-#endif
-
-// ------------------------------------------------------------------------------------------------
-inline const char* GetTextureTypeDisplayString(Tex::Type t)
-{
- switch (t) {
- case Tex::Type_CLOUDS : return "Clouds";
- case Tex::Type_WOOD : return "Wood";
- case Tex::Type_MARBLE : return "Marble";
- case Tex::Type_MAGIC : return "Magic";
- case Tex::Type_BLEND : return "Blend";
- case Tex::Type_STUCCI : return "Stucci";
- case Tex::Type_NOISE : return "Noise";
- case Tex::Type_PLUGIN : return "Plugin";
- case Tex::Type_MUSGRAVE : return "Musgrave";
- case Tex::Type_VORONOI : return "Voronoi";
- case Tex::Type_DISTNOISE : return "DistortedNoise";
- case Tex::Type_ENVMAP : return "EnvMap";
- case Tex::Type_IMAGE : return "Image";
- default:
- break;
- }
- return "<Unknown>";
-}
-
-} // ! Blender
-} // ! Assimp
-
-#endif // ! INCLUDED_AI_BLEND_INTERMEDIATE_H
diff --git a/3rdparty/assimp/code/BlenderLoader.cpp b/3rdparty/assimp/code/BlenderLoader.cpp
deleted file mode 100644
index 3d587b0f..00000000
--- a/3rdparty/assimp/code/BlenderLoader.cpp
+++ /dev/null
@@ -1,1005 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file BlenderLoader.cpp
- * @brief Implementation of the Blender3D importer class.
- */
-#include "AssimpPCH.h"
-
-//#define ASSIMP_BUILD_NO_COMPRESSED_BLEND
-// Uncomment this to disable support for (gzip)compressed .BLEND files
-
-#ifndef ASSIMP_BUILD_NO_BLEND_IMPORTER
-
-#include "BlenderIntermediate.h"
-#include "BlenderModifier.h"
-
-#include "StreamReader.h"
-#include "TinyFormatter.h"
-#include "MemoryIOWrapper.h"
-
-// zlib is needed for compressed blend files
-#ifndef ASSIMP_BUILD_NO_COMPRESSED_BLEND
-# ifdef ASSIMP_BUILD_NO_OWN_ZLIB
-# include <zlib.h>
-# else
-# include "../contrib/zlib/zlib.h"
-# endif
-#endif
-
-using namespace Assimp;
-using namespace Assimp::Blender;
-using namespace Assimp::Formatter;
-
-
-static const aiLoaderDesc blenderDesc = {
- "Blender 3D Importer \nhttp://www.blender3d.org",
- "Assimp Team",
- "",
- "",
- aiLoaderFlags_SupportBinaryFlavour | aiLoaderFlags_Experimental,
- 0,
- 0,
- 2,
- 50
-};
-
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-BlenderImporter::BlenderImporter()
-: modifier_cache(new BlenderModifierShowcase())
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-BlenderImporter::~BlenderImporter()
-{
- delete modifier_cache;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the class can handle the format of the given file.
-bool BlenderImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const
-{
- const std::string& extension = GetExtension(pFile);
- if (extension == "blend") {
- return true;
- }
-
- else if ((!extension.length() || checkSig) && pIOHandler) {
- // note: this won't catch compressed files
- const char* tokens[] = {"BLENDER"};
- return SearchFileHeaderForToken(pIOHandler,pFile,tokens,1);
- }
- return false;
-}
-
-// ------------------------------------------------------------------------------------------------
-// List all extensions handled by this loader
-void BlenderImporter::GetExtensionList(std::set<std::string>& app)
-{
- app.insert("blend");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Loader registry entry
-const aiLoaderDesc& BlenderImporter::GetInfo () const
-{
- return blenderDesc;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Setup configuration properties for the loader
-void BlenderImporter::SetupProperties(const Importer* pImp)
-{
- // nothing to be done for the moment
-}
-
-struct free_it
-{
- free_it(void* free) : free(free) {}
- ~free_it() {
- ::free(this->free);
- }
-
- void* free;
-};
-
-// ------------------------------------------------------------------------------------------------
-// Imports the given file into the given scene structure.
-void BlenderImporter::InternReadFile( const std::string& pFile,
- aiScene* pScene, IOSystem* pIOHandler)
-{
-#ifndef ASSIMP_BUILD_NO_COMPRESSED_BLEND
- Bytef* dest = NULL;
- free_it free_it_really(dest);
-#endif
-
- FileDatabase file;
- boost::shared_ptr<IOStream> stream(pIOHandler->Open(pFile,"rb"));
- if (!stream) {
- ThrowException("Could not open file for reading");
- }
-
- char magic[8] = {0};
- stream->Read(magic,7,1);
- if (strcmp(magic,"BLENDER")) {
- // Check for presence of the gzip header. If yes, assume it is a
- // compressed blend file and try uncompressing it, else fail. This is to
- // avoid uncompressing random files which our loader might end up with.
-#ifdef ASSIMP_BUILD_NO_COMPRESSED_BLEND
- ThrowException("BLENDER magic bytes are missing, is this file compressed (Assimp was built without decompression support)?");
-#else
-
- if (magic[0] != 0x1f || static_cast<uint8_t>(magic[1]) != 0x8b) {
- ThrowException("BLENDER magic bytes are missing, couldn't find GZIP header either");
- }
-
- LogDebug("Found no BLENDER magic word but a GZIP header, might be a compressed file");
- if (magic[2] != 8) {
- ThrowException("Unsupported GZIP compression method");
- }
-
- // http://www.gzip.org/zlib/rfc-gzip.html#header-trailer
- stream->Seek(0L,aiOrigin_SET);
- boost::shared_ptr<StreamReaderLE> reader = boost::shared_ptr<StreamReaderLE>(new StreamReaderLE(stream));
-
- // build a zlib stream
- z_stream zstream;
- zstream.opaque = Z_NULL;
- zstream.zalloc = Z_NULL;
- zstream.zfree = Z_NULL;
- zstream.data_type = Z_BINARY;
-
- // http://hewgill.com/journal/entries/349-how-to-decompress-gzip-stream-with-zlib
- inflateInit2(&zstream, 16+MAX_WBITS);
-
- zstream.next_in = reinterpret_cast<Bytef*>( reader->GetPtr() );
- zstream.avail_in = reader->GetRemainingSize();
-
- size_t total = 0l;
-
- // and decompress the data .... do 1k chunks in the hope that we won't kill the stack
-#define MYBLOCK 1024
- Bytef block[MYBLOCK];
- int ret;
- do {
- zstream.avail_out = MYBLOCK;
- zstream.next_out = block;
- ret = inflate(&zstream, Z_NO_FLUSH);
-
- if (ret != Z_STREAM_END && ret != Z_OK) {
- ThrowException("Failure decompressing this file using gzip, seemingly it is NOT a compressed .BLEND file");
- }
- const size_t have = MYBLOCK - zstream.avail_out;
- total += have;
- dest = reinterpret_cast<Bytef*>( realloc(dest,total) );
- memcpy(dest + total - have,block,have);
- }
- while (ret != Z_STREAM_END);
-
- // terminate zlib
- inflateEnd(&zstream);
-
- // replace the input stream with a memory stream
- stream.reset(new MemoryIOStream(reinterpret_cast<uint8_t*>(dest),total));
-
- // .. and retry
- stream->Read(magic,7,1);
- if (strcmp(magic,"BLENDER")) {
- ThrowException("Found no BLENDER magic word in decompressed GZIP file");
- }
-#endif
- }
-
- file.i64bit = (stream->Read(magic,1,1),magic[0]=='-');
- file.little = (stream->Read(magic,1,1),magic[0]=='v');
-
- stream->Read(magic,3,1);
- magic[3] = '\0';
-
- LogInfo((format(),"Blender version is ",magic[0],".",magic+1,
- " (64bit: ",file.i64bit?"true":"false",
- ", little endian: ",file.little?"true":"false",")"
- ));
-
- ParseBlendFile(file,stream);
-
- Scene scene;
- ExtractScene(scene,file);
-
- ConvertBlendFile(pScene,scene,file);
-}
-
-// ------------------------------------------------------------------------------------------------
-void BlenderImporter::ParseBlendFile(FileDatabase& out, boost::shared_ptr<IOStream> stream)
-{
- out.reader = boost::shared_ptr<StreamReaderAny>(new StreamReaderAny(stream,out.little));
-
- DNAParser dna_reader(out);
- const DNA* dna = NULL;
-
- out.entries.reserve(128); { // even small BLEND files tend to consist of many file blocks
- SectionParser parser(*out.reader.get(),out.i64bit);
-
- // first parse the file in search for the DNA and insert all other sections into the database
- while ((parser.Next(),1)) {
- const FileBlockHead& head = parser.GetCurrent();
-
- if (head.id == "ENDB") {
- break; // only valid end of the file
- }
- else if (head.id == "DNA1") {
- dna_reader.Parse();
- dna = &dna_reader.GetDNA();
- continue;
- }
-
- out.entries.push_back(head);
- }
- }
- if (!dna) {
- ThrowException("SDNA not found");
- }
-
- std::sort(out.entries.begin(),out.entries.end());
-}
-
-// ------------------------------------------------------------------------------------------------
-void BlenderImporter::ExtractScene(Scene& out, const FileDatabase& file)
-{
- const FileBlockHead* block = NULL;
- std::map<std::string,size_t>::const_iterator it = file.dna.indices.find("Scene");
- if (it == file.dna.indices.end()) {
- ThrowException("There is no `Scene` structure record");
- }
-
- const Structure& ss = file.dna.structures[(*it).second];
-
- // we need a scene somewhere to start with.
- for_each(const FileBlockHead& bl,file.entries) {
- if (bl.id == "SC") {
- block = &bl;
- break;
- }
- }
-
- if (!block) {
- ThrowException("There is not a single `Scene` record to load");
- }
-
- file.reader->SetCurrentPos(block->start);
- ss.Convert(out,file);
-
-#ifndef ASSIMP_BUILD_BLENDER_NO_STATS
- DefaultLogger::get()->info((format(),
- "(Stats) Fields read: " ,file.stats().fields_read,
- ", pointers resolved: " ,file.stats().pointers_resolved,
- ", cache hits: " ,file.stats().cache_hits,
- ", cached objects: " ,file.stats().cached_objects
- ));
-#endif
-}
-
-// ------------------------------------------------------------------------------------------------
-void BlenderImporter::ConvertBlendFile(aiScene* out, const Scene& in,const FileDatabase& file)
-{
- ConversionData conv(file);
-
- // FIXME it must be possible to take the hierarchy directly from
- // the file. This is terrible. Here, we're first looking for
- // all objects which don't have parent objects at all -
- std::deque<const Object*> no_parents;
- for (boost::shared_ptr<Base> cur = boost::static_pointer_cast<Base> ( in.base.first ); cur; cur = cur->next) {
- if (cur->object) {
- if (!cur->object->parent) {
- no_parents.push_back(cur->object.get());
- }
- else conv.objects.insert(cur->object.get());
- }
- }
- for (boost::shared_ptr<Base> cur = in.basact; cur; cur = cur->next) {
- if (cur->object) {
- if (cur->object->parent) {
- conv.objects.insert(cur->object.get());
- }
- }
- }
-
- if (no_parents.empty()) {
- ThrowException("Expected at least one object with no parent");
- }
-
- aiNode* root = out->mRootNode = new aiNode("<BlenderRoot>");
-
- root->mNumChildren = static_cast<unsigned int>(no_parents.size());
- root->mChildren = new aiNode*[root->mNumChildren]();
- for (unsigned int i = 0; i < root->mNumChildren; ++i) {
- root->mChildren[i] = ConvertNode(in, no_parents[i], conv);
- root->mChildren[i]->mParent = root;
- }
-
- BuildMaterials(conv);
-
- if (conv.meshes->size()) {
- out->mMeshes = new aiMesh*[out->mNumMeshes = static_cast<unsigned int>( conv.meshes->size() )];
- std::copy(conv.meshes->begin(),conv.meshes->end(),out->mMeshes);
- conv.meshes.dismiss();
- }
-
- if (conv.lights->size()) {
- out->mLights = new aiLight*[out->mNumLights = static_cast<unsigned int>( conv.lights->size() )];
- std::copy(conv.lights->begin(),conv.lights->end(),out->mLights);
- conv.lights.dismiss();
- }
-
- if (conv.cameras->size()) {
- out->mCameras = new aiCamera*[out->mNumCameras = static_cast<unsigned int>( conv.cameras->size() )];
- std::copy(conv.cameras->begin(),conv.cameras->end(),out->mCameras);
- conv.cameras.dismiss();
- }
-
- if (conv.materials->size()) {
- out->mMaterials = new aiMaterial*[out->mNumMaterials = static_cast<unsigned int>( conv.materials->size() )];
- std::copy(conv.materials->begin(),conv.materials->end(),out->mMaterials);
- conv.materials.dismiss();
- }
-
- if (conv.textures->size()) {
- out->mTextures = new aiTexture*[out->mNumTextures = static_cast<unsigned int>( conv.textures->size() )];
- std::copy(conv.textures->begin(),conv.textures->end(),out->mTextures);
- conv.textures.dismiss();
- }
-
- // acknowledge that the scene might come out incomplete
- // by Assimps definition of `complete`: blender scenes
- // can consist of thousands of cameras or lights with
- // not a single mesh between them.
- if (!out->mNumMeshes) {
- out->mFlags |= AI_SCENE_FLAGS_INCOMPLETE;
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void BlenderImporter::ResolveImage(MaterialHelper* out, const Material* mat, const MTex* tex, const Image* img, ConversionData& conv_data)
-{
- mat; tex; conv_data;
- aiString name;
-
- // check if the file contents are bundled with the BLEND file
- if (img->packedfile) {
- name.data[0] = '*';
- name.length = 1+ ASSIMP_itoa10(name.data+1,MAXLEN-1,conv_data.textures->size());
-
- conv_data.textures->push_back(new aiTexture());
- aiTexture* tex = conv_data.textures->back();
-
- // usually 'img->name' will be the original file name of the embedded textures,
- // so we can extract the file extension from it.
- const size_t nlen = strlen( img->name );
- const char* s = img->name+nlen, *e = s;
-
- while (s >= img->name && *s != '.')--s;
-
- tex->achFormatHint[0] = s+1>e ? '\0' : s[1];
- tex->achFormatHint[1] = s+2>e ? '\0' : s[2];
- tex->achFormatHint[2] = s+3>e ? '\0' : s[3];
- tex->achFormatHint[3] = '\0';
-
- // tex->mHeight = 0;
- tex->mWidth = img->packedfile->size;
- uint8_t* ch = new uint8_t[tex->mWidth];
-
- conv_data.db.reader->SetCurrentPos(static_cast<size_t>( img->packedfile->data->val));
- conv_data.db.reader->CopyAndAdvance(ch,tex->mWidth);
-
- tex->pcData = reinterpret_cast<aiTexel*>(ch);
-
- LogInfo("Reading embedded texture, original file was "+std::string(img->name));
- }
- else {
- name = aiString( img->name );
- }
- out->AddProperty(&name,AI_MATKEY_TEXTURE_DIFFUSE(
- conv_data.next_texture[aiTextureType_DIFFUSE]++)
- );
-}
-
-// ------------------------------------------------------------------------------------------------
-void BlenderImporter::AddSentinelTexture(MaterialHelper* out, const Material* mat, const MTex* tex, ConversionData& conv_data)
-{
- mat; tex; conv_data;
-
- aiString name;
- name.length = sprintf(name.data, "Procedural,num=%i,type=%s",conv_data.sentinel_cnt++,
- GetTextureTypeDisplayString(tex->tex->type)
- );
- out->AddProperty(&name,AI_MATKEY_TEXTURE_DIFFUSE(
- conv_data.next_texture[aiTextureType_DIFFUSE]++)
- );
-}
-
-// ------------------------------------------------------------------------------------------------
-void BlenderImporter::ResolveTexture(MaterialHelper* out, const Material* mat, const MTex* tex, ConversionData& conv_data)
-{
- const Tex* rtex = tex->tex.get();
- if (!rtex || !rtex->type) {
- return;
- }
-
- // We can't support most of the texture types because the're mostly procedural.
- // These are substituted by a dummy texture.
- const char* dispnam = "";
- switch( rtex->type )
- {
- // these are listed in blender's UI
- case Tex::Type_CLOUDS :
- case Tex::Type_WOOD :
- case Tex::Type_MARBLE :
- case Tex::Type_MAGIC :
- case Tex::Type_BLEND :
- case Tex::Type_STUCCI :
- case Tex::Type_NOISE :
- case Tex::Type_PLUGIN :
- case Tex::Type_MUSGRAVE :
- case Tex::Type_VORONOI :
- case Tex::Type_DISTNOISE :
- case Tex::Type_ENVMAP :
-
- // these do no appear in the UI, why?
- case Tex::Type_POINTDENSITY :
- case Tex::Type_VOXELDATA :
-
- LogWarn(std::string("Encountered a texture with an unsupported type: ")+dispnam);
- AddSentinelTexture(out, mat, tex, conv_data);
- break;
-
- case Tex::Type_IMAGE :
- if (!rtex->ima) {
- LogError("A texture claims to be an Image, but no image reference is given");
- break;
- }
- ResolveImage(out, mat, tex, rtex->ima.get(),conv_data);
- break;
-
- default:
- ai_assert(false);
- };
-}
-
-// ------------------------------------------------------------------------------------------------
-void BlenderImporter::BuildMaterials(ConversionData& conv_data)
-{
- conv_data.materials->reserve(conv_data.materials_raw.size());
-
- // add a default material if necessary
- unsigned int index = static_cast<unsigned int>( -1 );
- for_each( aiMesh* mesh, conv_data.meshes.get() ) {
- if (mesh->mMaterialIndex == static_cast<unsigned int>( -1 )) {
-
- if (index == static_cast<unsigned int>( -1 )) {
-
- // ok, we need to add a dedicated default material for some poor material-less meshes
- boost::shared_ptr<Material> p(new Material());
- strcpy( p->id.name+2, AI_DEFAULT_MATERIAL_NAME );
-
- p->r = p->g = p->b = 0.6f;
- p->specr = p->specg = p->specb = 0.6f;
- p->ambir = p->ambig = p->ambib = 0.0f;
- p->mirr = p->mirg = p->mirb = 0.0f;
- p->emit = 0.f;
- p->alpha = 0.f;
-
- // XXX add more / or add default c'tor to Material
-
- index = static_cast<unsigned int>( conv_data.materials_raw.size() );
- conv_data.materials_raw.push_back(p);
-
- LogInfo("Adding default material ...");
- }
- mesh->mMaterialIndex = index;
- }
- }
-
- for_each(boost::shared_ptr<Material> mat, conv_data.materials_raw) {
-
- // reset per material global counters
- for (size_t i = 0; i < sizeof(conv_data.next_texture)/sizeof(conv_data.next_texture[0]);++i) {
- conv_data.next_texture[i] = 0 ;
- }
-
- MaterialHelper* mout = new MaterialHelper();
- conv_data.materials->push_back(mout);
-
- // set material name
- aiString name = aiString(mat->id.name+2); // skip over the name prefix 'MA'
- mout->AddProperty(&name,AI_MATKEY_NAME);
-
-
- // basic material colors
- aiColor3D col(mat->r,mat->g,mat->b);
- if (mat->r || mat->g || mat->b ) {
-
- // Usually, zero diffuse color means no diffuse color at all in the equation - seemingly.
- // So we ommit this member to express this intent.
- mout->AddProperty(&col,1,AI_MATKEY_COLOR_DIFFUSE);
- }
-
- col = aiColor3D(mat->specr,mat->specg,mat->specb);
- mout->AddProperty(&col,1,AI_MATKEY_COLOR_SPECULAR);
-
- col = aiColor3D(mat->ambir,mat->ambig,mat->ambib);
- mout->AddProperty(&col,1,AI_MATKEY_COLOR_AMBIENT);
-
- col = aiColor3D(mat->mirr,mat->mirg,mat->mirb);
- mout->AddProperty(&col,1,AI_MATKEY_COLOR_REFLECTIVE);
-
- for (size_t i = 0; i < sizeof(mat->mtex) / sizeof(mat->mtex[0]); ++i) {
- if (!mat->mtex[i]) {
- continue;
- }
-
- ResolveTexture(mout,mat.get(),mat->mtex[i].get(),conv_data);
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void BlenderImporter::CheckActualType(const ElemBase* dt, const char* check)
-{
- ai_assert(dt);
- if (strcmp(dt->dna_type,check)) {
- ThrowException((format(),
- "Expected object at ",std::hex,dt," to be of type `",check,
- "`, but it claims to be a `",dt->dna_type,"`instead"
- ));
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void BlenderImporter::NotSupportedObjectType(const Object* obj, const char* type)
-{
- LogWarn((format(), "Object `",obj->id.name,"` - type is unsupported: `",type, "`, skipping" ));
-}
-
-// ------------------------------------------------------------------------------------------------
-void BlenderImporter::ConvertMesh(const Scene& in, const Object* obj, const Mesh* mesh,
- ConversionData& conv_data, TempArray<std::vector,aiMesh>& temp
- )
-{
- typedef std::pair<const int,size_t> MyPair;
- if (!mesh->totface || !mesh->totvert) {
- return;
- }
-
- // some sanity checks
- if (static_cast<size_t> ( mesh->totface ) > mesh->mface.size() ){
- ThrowException("Number of faces is larger than the corresponding array");
- }
-
- if (static_cast<size_t> ( mesh->totvert ) > mesh->mvert.size()) {
- ThrowException("Number of vertices is larger than the corresponding array");
- }
-
- // collect per-submesh numbers
- std::map<int,size_t> per_mat;
- for (int i = 0; i < mesh->totface; ++i) {
-
- const MFace& mf = mesh->mface[i];
- per_mat[ mf.mat_nr ]++;
- }
-
- // ... and allocate the corresponding meshes
- const size_t old = temp->size();
- temp->reserve(temp->size() + per_mat.size());
-
- std::map<size_t,size_t> mat_num_to_mesh_idx;
- for_each(MyPair& it, per_mat) {
-
- mat_num_to_mesh_idx[it.first] = temp->size();
- temp->push_back(new aiMesh());
-
- aiMesh* out = temp->back();
- out->mVertices = new aiVector3D[it.second*4];
- out->mNormals = new aiVector3D[it.second*4];
-
- //out->mNumFaces = 0
- //out->mNumVertices = 0
- out->mFaces = new aiFace[it.second]();
-
- // all submeshes created from this mesh are named equally. this allows
- // curious users to recover the original adjacency.
- out->mName = aiString(mesh->id.name+2);
- // skip over the name prefix 'ME'
-
- // resolve the material reference and add this material to the set of
- // output materials. The (temporary) material index is the index
- // of the material entry within the list of resolved materials.
- if (mesh->mat) {
-
- if (static_cast<size_t> ( it.first ) >= mesh->mat.size() ) {
- ThrowException("Material index is out of range");
- }
-
- boost::shared_ptr<Material> mat = mesh->mat[it.first];
- const std::deque< boost::shared_ptr<Material> >::iterator has = std::find(
- conv_data.materials_raw.begin(),
- conv_data.materials_raw.end(),mat
- );
-
- if (has != conv_data.materials_raw.end()) {
- out->mMaterialIndex = static_cast<unsigned int>( std::distance(conv_data.materials_raw.begin(),has));
- }
- else {
- out->mMaterialIndex = static_cast<unsigned int>( conv_data.materials_raw.size() );
- conv_data.materials_raw.push_back(mat);
- }
- }
- else out->mMaterialIndex = static_cast<unsigned int>( -1 );
- }
-
- for (int i = 0; i < mesh->totface; ++i) {
-
- const MFace& mf = mesh->mface[i];
-
- aiMesh* const out = temp[ mat_num_to_mesh_idx[ mf.mat_nr ] ];
- aiFace& f = out->mFaces[out->mNumFaces++];
-
- f.mIndices = new unsigned int[ f.mNumIndices = mf.v4?4:3 ];
- aiVector3D* vo = out->mVertices + out->mNumVertices;
- aiVector3D* vn = out->mNormals + out->mNumVertices;
-
- // XXX we can't fold this easily, because we are restricted
- // to the member names from the BLEND file (v1,v2,v3,v4)
- // which are assigned by the genblenddna.py script and
- // cannot be changed without breaking the entire
- // import process.
-
- if (mf.v1 >= mesh->totvert) {
- ThrowException("Vertex index v1 out of range");
- }
- const MVert* v = &mesh->mvert[mf.v1];
- vo->x = v->co[0];
- vo->y = v->co[1];
- vo->z = v->co[2];
- vn->x = v->no[0];
- vn->y = v->no[1];
- vn->z = v->no[2];
- f.mIndices[0] = out->mNumVertices++;
- ++vo;
- ++vn;
-
- // if (f.mNumIndices >= 2) {
- if (mf.v2 >= mesh->totvert) {
- ThrowException("Vertex index v2 out of range");
- }
- v = &mesh->mvert[mf.v2];
- vo->x = v->co[0];
- vo->y = v->co[1];
- vo->z = v->co[2];
- vn->x = v->no[0];
- vn->y = v->no[1];
- vn->z = v->no[2];
- f.mIndices[1] = out->mNumVertices++;
- ++vo;
- ++vn;
-
- if (mf.v3 >= mesh->totvert) {
- ThrowException("Vertex index v3 out of range");
- }
- // if (f.mNumIndices >= 3) {
- v = &mesh->mvert[mf.v3];
- vo->x = v->co[0];
- vo->y = v->co[1];
- vo->z = v->co[2];
- vn->x = v->no[0];
- vn->y = v->no[1];
- vn->z = v->no[2];
- f.mIndices[2] = out->mNumVertices++;
- ++vo;
- ++vn;
-
- if (mf.v4 >= mesh->totvert) {
- ThrowException("Vertex index v4 out of range");
- }
- // if (f.mNumIndices >= 4) {
- if (mf.v4) {
- v = &mesh->mvert[mf.v4];
- vo->x = v->co[0];
- vo->y = v->co[1];
- vo->z = v->co[2];
- vn->x = v->no[0];
- vn->y = v->no[1];
- vn->z = v->no[2];
- f.mIndices[3] = out->mNumVertices++;
- ++vo;
- ++vn;
-
- out->mPrimitiveTypes |= aiPrimitiveType_POLYGON;
- }
- else out->mPrimitiveTypes |= aiPrimitiveType_TRIANGLE;
-
- // }
- // }
- // }
- }
-
- // collect texture coordinates, they're stored in a separate per-face buffer
- if (mesh->mtface) {
- if (mesh->totface > static_cast<int> ( mesh->mtface.size())) {
- ThrowException("Number of UV faces is larger than the corresponding UV face array (#1)");
- }
- for (std::vector<aiMesh*>::iterator it = temp->begin()+old; it != temp->end(); ++it) {
- ai_assert((*it)->mNumVertices && (*it)->mNumFaces);
-
- (*it)->mTextureCoords[0] = new aiVector3D[(*it)->mNumVertices];
- (*it)->mNumFaces = (*it)->mNumVertices = 0;
- }
-
- for (int i = 0; i < mesh->totface; ++i) {
- const MTFace* v = &mesh->mtface[i];
-
- aiMesh* const out = temp[ mat_num_to_mesh_idx[ mesh->mface[i].mat_nr ] ];
- const aiFace& f = out->mFaces[out->mNumFaces++];
-
- aiVector3D* vo = &out->mTextureCoords[0][out->mNumVertices];
- for (unsigned int i = 0; i < f.mNumIndices; ++i,++vo,++out->mNumVertices) {
- vo->x = v->uv[i][0];
- vo->y = v->uv[i][1];
- }
- }
- }
-
- // collect texture coordinates, old-style (marked as deprecated in current blender sources)
- if (mesh->tface) {
- if (mesh->totface > static_cast<int> ( mesh->mtface.size())) {
- ThrowException("Number of faces is larger than the corresponding UV face array (#2)");
- }
- for (std::vector<aiMesh*>::iterator it = temp->begin()+old; it != temp->end(); ++it) {
- ai_assert((*it)->mNumVertices && (*it)->mNumFaces);
-
- (*it)->mTextureCoords[0] = new aiVector3D[(*it)->mNumVertices];
- (*it)->mNumFaces = (*it)->mNumVertices = 0;
- }
-
- for (int i = 0; i < mesh->totface; ++i) {
- const TFace* v = &mesh->tface[i];
-
- aiMesh* const out = temp[ mat_num_to_mesh_idx[ mesh->mface[i].mat_nr ] ];
- const aiFace& f = out->mFaces[out->mNumFaces++];
-
- aiVector3D* vo = &out->mTextureCoords[0][out->mNumVertices];
- for (unsigned int i = 0; i < f.mNumIndices; ++i,++vo,++out->mNumVertices) {
- vo->x = v->uv[i][0];
- vo->y = v->uv[i][1];
- }
- }
- }
-
- // collect vertex colors, stored separately as well
- if (mesh->mcol) {
- if (mesh->totface > static_cast<int> ( (mesh->mcol.size()/4)) ) {
- ThrowException("Number of faces is larger than the corresponding color face array");
- }
- for (std::vector<aiMesh*>::iterator it = temp->begin()+old; it != temp->end(); ++it) {
- ai_assert((*it)->mNumVertices && (*it)->mNumFaces);
-
- (*it)->mColors[0] = new aiColor4D[(*it)->mNumVertices];
- (*it)->mNumFaces = (*it)->mNumVertices = 0;
- }
-
- for (int i = 0; i < mesh->totface; ++i) {
-
- aiMesh* const out = temp[ mat_num_to_mesh_idx[ mesh->mface[i].mat_nr ] ];
- const aiFace& f = out->mFaces[out->mNumFaces++];
-
- aiColor4D* vo = &out->mColors[0][out->mNumVertices];
- for (unsigned int n = 0; n < f.mNumIndices; ++n, ++vo,++out->mNumVertices) {
- const MCol* col = &mesh->mcol[(i<<2)+n];
-
- vo->r = col->r;
- vo->g = col->g;
- vo->b = col->b;
- vo->a = col->a;
- }
- for (unsigned int n = f.mNumIndices; n < 4; ++n);
- }
- }
-
- return;
-}
-
-// ------------------------------------------------------------------------------------------------
-aiCamera* BlenderImporter::ConvertCamera(const Scene& in, const Object* obj, const Camera* mesh, ConversionData& conv_data)
-{
- ScopeGuard<aiCamera> out(new aiCamera());
-
- return NULL ; //out.dismiss();
-}
-
-// ------------------------------------------------------------------------------------------------
-aiLight* BlenderImporter::ConvertLight(const Scene& in, const Object* obj, const Lamp* mesh, ConversionData& conv_data)
-{
- ScopeGuard<aiLight> out(new aiLight());
-
- return NULL ; //out.dismiss();
-}
-
-// ------------------------------------------------------------------------------------------------
-aiNode* BlenderImporter::ConvertNode(const Scene& in, const Object* obj, ConversionData& conv_data)
-{
- std::deque<const Object*> children;
- for (std::set<const Object*>::iterator it = conv_data.objects.begin(); it != conv_data.objects.end() ;) {
- const Object* object = *it;
- if (object->parent.get() == obj) {
- children.push_back(object);
-
- conv_data.objects.erase(it++);
- continue;
- }
- ++it;
- }
-
- ScopeGuard<aiNode> node(new aiNode(obj->id.name+2)); // skip over the name prefix 'OB'
- if (obj->data) {
- switch (obj->type)
- {
- case Object :: Type_EMPTY:
- break; // do nothing
-
-
- // supported object types
- case Object :: Type_MESH: {
- const size_t old = conv_data.meshes->size();
-
- CheckActualType(obj->data.get(),"Mesh");
- ConvertMesh(in,obj,static_cast<const Mesh*>(obj->data.get()),conv_data,conv_data.meshes);
-
- if (conv_data.meshes->size() > old) {
- node->mMeshes = new unsigned int[node->mNumMeshes = static_cast<unsigned int>(conv_data.meshes->size()-old)];
- for (unsigned int i = 0; i < node->mNumMeshes; ++i) {
- node->mMeshes[i] = i + old;
- }
- }}
- break;
- case Object :: Type_LAMP: {
- CheckActualType(obj->data.get(),"Lamp");
- aiLight* mesh = ConvertLight(in,obj,static_cast<const Lamp*>(
- obj->data.get()),conv_data);
-
- if (mesh) {
- conv_data.lights->push_back(mesh);
- }}
- break;
- case Object :: Type_CAMERA: {
- CheckActualType(obj->data.get(),"Camera");
- aiCamera* mesh = ConvertCamera(in,obj,static_cast<const Camera*>(
- obj->data.get()),conv_data);
-
- if (mesh) {
- conv_data.cameras->push_back(mesh);
- }}
- break;
-
-
- // unsupported object types / log, but do not break
- case Object :: Type_CURVE:
- NotSupportedObjectType(obj,"Curve");
- break;
- case Object :: Type_SURF:
- NotSupportedObjectType(obj,"Surface");
- break;
- case Object :: Type_FONT:
- NotSupportedObjectType(obj,"Font");
- break;
- case Object :: Type_MBALL:
- NotSupportedObjectType(obj,"MetaBall");
- break;
- case Object :: Type_WAVE:
- NotSupportedObjectType(obj,"Wave");
- break;
- case Object :: Type_LATTICE:
- NotSupportedObjectType(obj,"Lattice");
- break;
-
- // invalid or unknown type
- default:
- break;
- }
- }
-
- for (unsigned int x = 0; x < 4; ++x) {
- for (unsigned int y = 0; y < 4; ++y) {
- node->mTransformation[y][x] = obj->parentinv[x][y];
- }
- }
-
- aiMatrix4x4 m;
- for (unsigned int x = 0; x < 4; ++x) {
- for (unsigned int y = 0; y < 4; ++y) {
- m[y][x] = obj->obmat[x][y];
- }
- }
-
- node->mTransformation = m*node->mTransformation;
-
- if (children.size()) {
- node->mNumChildren = static_cast<unsigned int>(children.size());
- aiNode** nd = node->mChildren = new aiNode*[node->mNumChildren]();
- for_each (const Object* nobj,children) {
- *nd = ConvertNode(in,nobj,conv_data);
- (*nd++)->mParent = node;
- }
- }
-
- // apply modifiers
- modifier_cache->ApplyModifiers(*node,conv_data,in,*obj);
-
- return node.dismiss();
-}
-
-// ------------------------------------------------------------------------------------------------
-/*static*/ void BlenderImporter::ThrowException(const std::string& msg)
-{
- throw DeadlyImportError("BLEND: "+msg);
-}
-
-// ------------------------------------------------------------------------------------------------
-/*static*/ void BlenderImporter::LogWarn(const Formatter::format& message) {
- DefaultLogger::get()->warn(std::string("BLEND: ")+=message);
-}
-
-// ------------------------------------------------------------------------------------------------
-/*static*/ void BlenderImporter::LogError(const Formatter::format& message) {
- DefaultLogger::get()->error(std::string("BLEND: ")+=message);
-}
-
-// ------------------------------------------------------------------------------------------------
-/*static*/ void BlenderImporter::LogInfo(const Formatter::format& message) {
- DefaultLogger::get()->info(std::string("BLEND: ")+=message);
-}
-
-// ------------------------------------------------------------------------------------------------
-/*static*/ void BlenderImporter::LogDebug(const Formatter::format& message) {
- DefaultLogger::get()->debug(std::string("BLEND: ")+=message);
-}
-
-#endif
diff --git a/3rdparty/assimp/code/BlenderLoader.h b/3rdparty/assimp/code/BlenderLoader.h
deleted file mode 100644
index ee95de83..00000000
--- a/3rdparty/assimp/code/BlenderLoader.h
+++ /dev/null
@@ -1,261 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file BlenderLoader.h
- * @brief Declaration of the Blender 3D (*.blend) importer class.
- */
-#ifndef INCLUDED_AI_BLEND_LOADER_H
-#define INCLUDED_AI_BLEND_LOADER_H
-
-#include "BaseImporter.h"
-namespace Assimp {
-
- // TinyFormatter.h
- namespace Formatter {
- template <typename T,typename TR, typename A> class basic_formatter;
- typedef class basic_formatter< char, std::char_traits<char>, std::allocator<char> > format;
- }
-
- // BlenderDNA.h
- namespace Blender {
- class FileDatabase;
- struct ElemBase;
- }
-
- // BlenderScene.h
- namespace Blender {
- struct Scene;
- struct Object;
- struct Mesh;
- struct Camera;
- struct Lamp;
- struct MTex;
- struct Image;
- struct Material;
- }
-
- // BlenderIntermediate.h
- namespace Blender {
- struct ConversionData;
- template <template <typename,typename> class TCLASS, typename T> struct TempArray;
- }
-
- // BlenderModifier.h
- namespace Blender {
- class BlenderModifierShowcase;
- class BlenderModifier;
- }
-
-enum aiLoaderFlags
-{
- aiLoaderFlags_SupportAsciiFlavour = 0x1,
- aiLoaderFlags_SupportBinaryFlavour = 0x2,
- aiLoaderFlags_SupportCompressedFlavour = 0x4,
-
- aiLoaderFlags_LimitedSupport = 0x8,
-
- aiLoaderFlags_Experimental = 0x10,
- aiLoaderFlags_Testing = 0x20,
- aiLoaderFlags_Production = 0x40,
-};
-
-struct aiLoaderDesc
-{
- const char* mName;
- const char* mAuthor;
- const char* mMaintainer;
- const char* mComments;
- unsigned int mFlags;
-
- unsigned int mMinMajor;
- unsigned int mMinMinor;
- unsigned int mMaxMajor;
- unsigned int mMaxMinor;
-};
-
-
-// -------------------------------------------------------------------------------------------
-/** Load blenders official binary format. The actual file structure (the `DNA` how they
- * call it is outsourced to BlenderDNA.cpp/BlenderDNA.h. This class only performs the
- * conversion from intermediate format to aiScene. */
-// -------------------------------------------------------------------------------------------
-class BlenderImporter : public BaseImporter
-{
- friend class Importer;
-
-protected:
-
- /** Constructor to be privately used by Importer */
- BlenderImporter();
-
- /** Destructor, private as well */
- ~BlenderImporter();
-
-public:
-
- // --------------------
- bool CanRead( const std::string& pFile,
- IOSystem* pIOHandler,
- bool checkSig
- ) const;
-
-protected:
-
- // --------------------
- const aiLoaderDesc& GetInfo () const;
-
- // --------------------
- void GetExtensionList(std::set<std::string>& app);
-
- // --------------------
- void SetupProperties(const Importer* pImp);
-
- // --------------------
- void InternReadFile( const std::string& pFile,
- aiScene* pScene,
- IOSystem* pIOHandler
- );
-
- // --------------------
- void ParseBlendFile(Blender::FileDatabase& out,
- boost::shared_ptr<IOStream> stream
- );
-
- // --------------------
- void ExtractScene(Blender::Scene& out,
- const Blender::FileDatabase& file
- );
-
- // --------------------
- void ConvertBlendFile(aiScene* out,
- const Blender::Scene& in,
- const Blender::FileDatabase& file
- );
-
-private:
-
- // --------------------
- aiNode* ConvertNode(const Blender::Scene& in,
- const Blender::Object* obj,
- Blender::ConversionData& conv_info
- );
-
- // --------------------
- void ConvertMesh(const Blender::Scene& in,
- const Blender::Object* obj,
- const Blender::Mesh* mesh,
- Blender::ConversionData& conv_data,
- Blender::TempArray<std::vector,aiMesh>& temp
- );
-
- // --------------------
- aiLight* ConvertLight(const Blender::Scene& in,
- const Blender::Object* obj,
- const Blender::Lamp* mesh,
- Blender::ConversionData& conv_data
- );
-
- // --------------------
- aiCamera* ConvertCamera(const Blender::Scene& in,
- const Blender::Object* obj,
- const Blender::Camera* mesh,
- Blender::ConversionData& conv_data
- );
-
- // --------------------
- void BuildMaterials(
- Blender::ConversionData& conv_data
- ) ;
-
- // --------------------
- void ResolveTexture(
- MaterialHelper* out,
- const Blender::Material* mat,
- const Blender::MTex* tex,
- Blender::ConversionData& conv_data
- );
-
- // --------------------
- void ResolveImage(
- MaterialHelper* out,
- const Blender::Material* mat,
- const Blender::MTex* tex,
- const Blender::Image* img,
- Blender::ConversionData& conv_data
- );
-
- void AddSentinelTexture(
- MaterialHelper* out,
- const Blender::Material* mat,
- const Blender::MTex* tex,
- Blender::ConversionData& conv_data
- );
-
-private: // static stuff, mostly logging and error reporting.
-
- // --------------------
- static void CheckActualType(const Blender::ElemBase* dt,
- const char* check
- );
-
- // --------------------
- static void NotSupportedObjectType(const Blender::Object* obj,
- const char* type
- );
-
- // -------------------------------------------------------------------
- /** Prepend 'BLEND: ' and throw msg.*/
- static void ThrowException(const std::string& msg);
-
- // -------------------------------------------------------------------
- /** @defgroup blog Prepend 'BLEND: ' and write @c message to log.*/
- static void LogWarn (const Formatter::format& message); //! @ingroup blog
- static void LogError (const Formatter::format& message); //! @ingroup blog
- static void LogInfo (const Formatter::format& message); //! @ingroup blog
- static void LogDebug (const Formatter::format& message); //! @ingroup blog
-
-private:
-
- Blender::BlenderModifierShowcase* modifier_cache;
-
-}; // !class BlenderImporter
-
-} // end of namespace Assimp
-#endif // AI_UNREALIMPORTER_H_INC
diff --git a/3rdparty/assimp/code/BlenderModifier.cpp b/3rdparty/assimp/code/BlenderModifier.cpp
deleted file mode 100644
index 64711346..00000000
--- a/3rdparty/assimp/code/BlenderModifier.cpp
+++ /dev/null
@@ -1,311 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file BlenderModifier.cpp
- * @brief Implementation of some blender modifiers (i.e subdivision, mirror).
- */
-#include "AssimpPCH.h"
-
-#ifndef ASSIMP_BUILD_NO_BLEND_IMPORTER
-#include "BlenderModifier.h"
-#include "SceneCombiner.h"
-#include "Subdivision.h"
-
-using namespace Assimp;
-using namespace Assimp::Blender;
-
-template <typename T> BlenderModifier* god() {
- return new T();
-}
-
-// add all available modifiers here
-typedef BlenderModifier* (*fpCreateModifier)();
-static const fpCreateModifier creators[] = {
- &god<BlenderModifier_Mirror>,
- &god<BlenderModifier_Subdivision>,
-
- NULL // sentinel
-};
-
-// ------------------------------------------------------------------------------------------------
-// just testing out some new macros to simplify logging
-#define ASSIMP_LOG_WARN_F(string,...)\
- DefaultLogger::get()->warn((Formatter::format(string),__VA_ARGS__))
-
-#define ASSIMP_LOG_ERROR_F(string,...)\
- DefaultLogger::get()->error((Formatter::format(string),__VA_ARGS__))
-
-#define ASSIMP_LOG_DEBUG_F(string,...)\
- DefaultLogger::get()->debug((Formatter::format(string),__VA_ARGS__))
-
-#define ASSIMP_LOG_INFO_F(string,...)\
- DefaultLogger::get()->info((Formatter::format(string),__VA_ARGS__))
-
-
-#define ASSIMP_LOG_WARN(string)\
- DefaultLogger::get()->warn(string)
-
-#define ASSIMP_LOG_ERROR(string)\
- DefaultLogger::get()->error(string)
-
-#define ASSIMP_LOG_DEBUG(string)\
- DefaultLogger::get()->debug(string)
-
-#define ASSIMP_LOG_INFO(string)\
- DefaultLogger::get()->info(string)
-
-
-// ------------------------------------------------------------------------------------------------
-struct SharedModifierData : ElemBase
-{
- ModifierData modifier;
-};
-
-// ------------------------------------------------------------------------------------------------
-void BlenderModifierShowcase::ApplyModifiers(aiNode& out, ConversionData& conv_data, const Scene& in, const Object& orig_object )
-{
- size_t cnt = 0u, ful = 0u;
-
- // NOTE: this cast is potentially unsafe by design, so we need to perform type checks before
- // we're allowed to dereference the pointers without risking to crash. We might still be
- // invoking UB btw - we're assuming that the ModifierData member of the respective modifier
- // structures is at offset sizeof(vftable) with no padding.
- const SharedModifierData* cur = boost::static_pointer_cast<const SharedModifierData> ( orig_object.modifiers.first.get() );
- for (; cur; cur = boost::static_pointer_cast<const SharedModifierData> ( cur->modifier.next.get() ), ++ful) {
- ai_assert(cur->dna_type);
-
- const Structure* s = conv_data.db.dna.Get( cur->dna_type );
- if (!s) {
- ASSIMP_LOG_WARN_F("BlendModifier: could not resolve DNA name: ",cur->dna_type);
- continue;
- }
-
- // this is a common trait of all XXXMirrorData structures in BlenderDNA
- const Field* f = s->Get("modifier");
- if (!f || f->offset != 0) {
- ASSIMP_LOG_WARN("BlendModifier: expected a `modifier` member at offset 0");
- continue;
- }
-
- s = conv_data.db.dna.Get( f->type );
- if (!s || s->name != "ModifierData") {
- ASSIMP_LOG_WARN("BlendModifier: expected a ModifierData structure as first member");
- continue;
- }
-
- // now, we can be sure that we should be fine to dereference *cur* as
- // ModifierData (with the above note).
- const ModifierData& dat = cur->modifier;
-
- const fpCreateModifier* curgod = creators;
- std::vector< BlenderModifier* >::iterator curmod = cached_modifiers->begin(), endmod = cached_modifiers->end();
-
- for (;*curgod;++curgod,++curmod) { // allocate modifiers on the fly
- if (curmod == endmod) {
- cached_modifiers->push_back((*curgod)());
-
- endmod = cached_modifiers->end();
- curmod = endmod-1;
- }
-
- BlenderModifier* const modifier = *curmod;
- if (modifier->IsActive(dat)) {
- modifier->DoIt(out,conv_data,*boost::static_pointer_cast<const ElemBase>(cur),in,orig_object);
- cnt++;
-
- curgod = NULL;
- break;
- }
- }
- if (curgod) {
- ASSIMP_LOG_WARN_F("Couldn't find a handler for modifier: ",dat.name);
- }
- }
-
- // Even though we managed to resolve some or all of the modifiers on this
- // object, we still can't say whether our modifier implementations were
- // able to fully do their job.
- if (ful) {
- ASSIMP_LOG_DEBUG_F("BlendModifier: found handlers for ",cnt," of ",ful," modifiers on `",orig_object.id.name,
- "`, check log messages above for errors");
- }
-}
-
-
-
-// ------------------------------------------------------------------------------------------------
-bool BlenderModifier_Mirror :: IsActive (const ModifierData& modin)
-{
- return modin.type == ModifierData::eModifierType_Mirror;
-}
-
-// ------------------------------------------------------------------------------------------------
-void BlenderModifier_Mirror :: DoIt(aiNode& out, ConversionData& conv_data, const ElemBase& orig_modifier,
- const Scene& in,
- const Object& orig_object )
-{
- // hijacking the ABI, see the big note in BlenderModifierShowcase::ApplyModifiers()
- const MirrorModifierData& mir = static_cast<const MirrorModifierData&>(orig_modifier);
- ai_assert(mir.modifier.type == ModifierData::eModifierType_Mirror);
-
- // XXX not entirely correct, mirroring on two axes results in 4 distinct objects in blender ...
-
- // take all input meshes and clone them
- for (unsigned int i = 0; i < out.mNumMeshes; ++i) {
- aiMesh* mesh;
- SceneCombiner::Copy(&mesh,conv_data.meshes[out.mMeshes[i]]);
-
- const float xs = mir.flag & MirrorModifierData::Flags_AXIS_X ? -1.f : 1.f;
- const float ys = mir.flag & MirrorModifierData::Flags_AXIS_Y ? -1.f : 1.f;
- const float zs = mir.flag & MirrorModifierData::Flags_AXIS_Z ? -1.f : 1.f;
-
- if (mir.mirror_ob) {
- const aiVector3D center( mir.mirror_ob->obmat[3][0],mir.mirror_ob->obmat[3][1],mir.mirror_ob->obmat[3][2] );
- for (unsigned int i = 0; i < mesh->mNumVertices; ++i) {
- aiVector3D& v = mesh->mVertices[i];
-
- v.x = center.x + xs*(center.x - v.x);
- v.y = center.y + ys*(center.y - v.y);
- v.z = center.z + zs*(center.z - v.z);
- }
- }
- else {
- for (unsigned int i = 0; i < mesh->mNumVertices; ++i) {
- aiVector3D& v = mesh->mVertices[i];
- v.x *= xs;v.y *= ys;v.z *= zs;
- }
- }
-
- if (mesh->mNormals) {
- for (unsigned int i = 0; i < mesh->mNumVertices; ++i) {
- aiVector3D& v = mesh->mNormals[i];
- v.x *= xs;v.y *= ys;v.z *= zs;
- }
- }
-
- if (mesh->mTangents) {
- for (unsigned int i = 0; i < mesh->mNumVertices; ++i) {
- aiVector3D& v = mesh->mTangents[i];
- v.x *= xs;v.y *= ys;v.z *= zs;
- }
- }
-
- if (mesh->mBitangents) {
- for (unsigned int i = 0; i < mesh->mNumVertices; ++i) {
- aiVector3D& v = mesh->mBitangents[i];
- v.x *= xs;v.y *= ys;v.z *= zs;
- }
- }
-
- const float us = mir.flag & MirrorModifierData::Flags_MIRROR_U ? -1.f : 1.f;
- const float vs = mir.flag & MirrorModifierData::Flags_MIRROR_V ? -1.f : 1.f;
-
- for (unsigned int n = 0; mesh->HasTextureCoords(n); ++n) {
- for (unsigned int i = 0; i < mesh->mNumVertices; ++i) {
- aiVector3D& v = mesh->mTextureCoords[n][i];
- v.x *= us;v.y *= vs;
- }
- }
-
- conv_data.meshes->push_back(mesh);
- }
- unsigned int* nind = new unsigned int[out.mNumMeshes*2];
-
- std::copy(out.mMeshes,out.mMeshes+out.mNumMeshes,nind);
- std::transform(out.mMeshes,out.mMeshes+out.mNumMeshes,nind+out.mNumMeshes,
- std::bind1st(std::plus< unsigned int >(),out.mNumMeshes));
-
- delete[] out.mMeshes;
- out.mMeshes = nind;
- out.mNumMeshes *= 2;
-
- ASSIMP_LOG_INFO_F("BlendModifier: Applied the `Mirror` modifier to `",
- orig_object.id.name,"`");
-}
-
-
-
-
-// ------------------------------------------------------------------------------------------------
-bool BlenderModifier_Subdivision :: IsActive (const ModifierData& modin)
-{
- return modin.type == ModifierData::eModifierType_Subsurf;
-}
-
-// ------------------------------------------------------------------------------------------------
-void BlenderModifier_Subdivision :: DoIt(aiNode& out, ConversionData& conv_data, const ElemBase& orig_modifier,
- const Scene& in,
- const Object& orig_object )
-{
- // hijacking the ABI, see the big note in BlenderModifierShowcase::ApplyModifiers()
- const SubsurfModifierData& mir = static_cast<const SubsurfModifierData&>(orig_modifier);
- ai_assert(mir.modifier.type == ModifierData::eModifierType_Subsurf);
-
- Subdivider::Algorithm algo;
- switch (mir.subdivType)
- {
- case SubsurfModifierData::TYPE_CatmullClarke:
- algo = Subdivider::CATMULL_CLARKE;
- break;
-
- case SubsurfModifierData::TYPE_Simple:
- ASSIMP_LOG_WARN("BlendModifier: The `SIMPLE` subdivision algorithm is not currently implemented, using Catmull-Clarke");
- algo = Subdivider::CATMULL_CLARKE;
- break;
-
- default:
- ASSIMP_LOG_WARN_F("BlendModifier: Unrecognized subdivision algorithm: ",mir.subdivType);
- return;
- };
-
- boost::scoped_ptr<Subdivider> subd(Subdivider::Create(algo));
- ai_assert(subd);
-
- aiMesh** const meshes = &conv_data.meshes[conv_data.meshes->size() - out.mNumMeshes];
- boost::scoped_array<aiMesh*> tempmeshes(new aiMesh*[out.mNumMeshes]());
-
- subd->Subdivide(meshes,out.mNumMeshes,tempmeshes.get(),std::max( mir.renderLevels, mir.levels ),true);
- std::copy(tempmeshes.get(),tempmeshes.get()+out.mNumMeshes,meshes);
-
- ASSIMP_LOG_INFO_F("BlendModifier: Applied the `Subdivision` modifier to `",
- orig_object.id.name,"`");
-}
-
-#endif
diff --git a/3rdparty/assimp/code/BlenderModifier.h b/3rdparty/assimp/code/BlenderModifier.h
deleted file mode 100644
index c5e6bd43..00000000
--- a/3rdparty/assimp/code/BlenderModifier.h
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file BlenderModifier.h
- * @brief Declare dedicated helper classes to simulate some blender modifiers (i.e. mirror)
- */
-#ifndef INCLUDED_AI_BLEND_MODIFIER_H
-#define INCLUDED_AI_BLEND_MODIFIER_H
-
-#include "BlenderIntermediate.h"
-#include "TinyFormatter.h"
-namespace Assimp {
- namespace Blender {
-
-// -------------------------------------------------------------------------------------------
-/** Dummy base class for all blender modifiers. Modifiers are reused between imports, so
- * they should be stateless and not try to cache model data. */
-// -------------------------------------------------------------------------------------------
-class BlenderModifier
-{
-public:
-
- virtual ~BlenderModifier() {
- }
-
-public:
-
- // --------------------
- /** Check if *this* modifier is active, given a ModifierData& block.*/
- virtual bool IsActive( const ModifierData& modin) {
- return false;
- }
-
- // --------------------
- /** Apply the modifier to a given output node. The original data used
- * to construct the node is given as well. Not called unless IsActive()
- * was called and gave positive response. */
- virtual void DoIt(aiNode& out,
- ConversionData& conv_data,
- const ElemBase& orig_modifier,
- const Scene& in,
- const Object& orig_object
- ) {
- DefaultLogger::get()->warn((Formatter::format("This modifier is not supported, skipping: "),orig_modifier.dna_type));
- return;
- }
-};
-
-
-// -------------------------------------------------------------------------------------------
-/** Manage all known modifiers and instance and apply them if necessary */
-// -------------------------------------------------------------------------------------------
-class BlenderModifierShowcase
-{
-public:
-
- // --------------------
- /** Apply all requested modifiers provided we support them. */
- void ApplyModifiers(aiNode& out,
- ConversionData& conv_data,
- const Scene& in,
- const Object& orig_object
- );
-
-private:
-
- TempArray< std::vector,BlenderModifier > cached_modifiers;
-};
-
-
-
-
-
-// MODIFIERS
-
-
-
-// -------------------------------------------------------------------------------------------
-/** Mirror modifier. Status: implemented. */
-// -------------------------------------------------------------------------------------------
-class BlenderModifier_Mirror : public BlenderModifier
-{
-public:
-
- // --------------------
- virtual bool IsActive( const ModifierData& modin);
-
- // --------------------
- virtual void DoIt(aiNode& out,
- ConversionData& conv_data,
- const ElemBase& orig_modifier,
- const Scene& in,
- const Object& orig_object
- ) ;
-};
-
-// -------------------------------------------------------------------------------------------
-/** Subdivision modifier. Status: dummy. */
-// -------------------------------------------------------------------------------------------
-class BlenderModifier_Subdivision : public BlenderModifier
-{
-public:
-
- // --------------------
- virtual bool IsActive( const ModifierData& modin);
-
- // --------------------
- virtual void DoIt(aiNode& out,
- ConversionData& conv_data,
- const ElemBase& orig_modifier,
- const Scene& in,
- const Object& orig_object
- ) ;
-};
-
-
-}}
-#endif // !INCLUDED_AI_BLEND_MODIFIER_H
diff --git a/3rdparty/assimp/code/BlenderScene.cpp b/3rdparty/assimp/code/BlenderScene.cpp
deleted file mode 100644
index f8d13e17..00000000
--- a/3rdparty/assimp/code/BlenderScene.cpp
+++ /dev/null
@@ -1,596 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file BlenderScene.cpp
- * @brief MACHINE GENERATED BY ./scripts/BlenderImporter/genblenddna.py
- */
-#include "AssimpPCH.h"
-#ifndef AI_BUILD_NO_BLEND_IMPORTER
-
-#include "BlenderDNA.h"
-#include "BlenderScene.h"
-#include "BlenderSceneGen.h"
-
-using namespace Assimp;
-using namespace Assimp::Blender;
-
-//--------------------------------------------------------------------------------
-template <> void Structure :: Convert<Object> (
- Object& dest,
- const FileDatabase& db
- ) const
-{
-
- ReadField<ErrorPolicy_Fail>(dest.id,"id",db);
- ReadField<ErrorPolicy_Fail>((int&)dest.type,"type",db);
- ReadFieldArray2<ErrorPolicy_Warn>(dest.obmat,"obmat",db);
- ReadFieldArray2<ErrorPolicy_Warn>(dest.parentinv,"parentinv",db);
- ReadFieldArray<ErrorPolicy_Warn>(dest.parsubstr,"parsubstr",db);
- ReadFieldPtr<ErrorPolicy_Warn>(dest.parent,"*parent",db);
- ReadFieldPtr<ErrorPolicy_Warn>(dest.track,"*track",db);
- ReadFieldPtr<ErrorPolicy_Warn>(dest.proxy,"*proxy",db);
- ReadFieldPtr<ErrorPolicy_Warn>(dest.proxy_from,"*proxy_from",db);
- ReadFieldPtr<ErrorPolicy_Warn>(dest.proxy_group,"*proxy_group",db);
- ReadFieldPtr<ErrorPolicy_Warn>(dest.dup_group,"*dup_group",db);
- ReadFieldPtr<ErrorPolicy_Fail>(dest.data,"*data",db);
- ReadField<ErrorPolicy_Igno>(dest.modifiers,"modifiers",db);
-
- db.reader->IncPtr(size);
-}
-
-//--------------------------------------------------------------------------------
-template <> void Structure :: Convert<Group> (
- Group& dest,
- const FileDatabase& db
- ) const
-{
-
- ReadField<ErrorPolicy_Fail>(dest.id,"id",db);
- ReadField<ErrorPolicy_Igno>(dest.layer,"layer",db);
- ReadFieldPtr<ErrorPolicy_Igno>(dest.gobject,"*gobject",db);
-
- db.reader->IncPtr(size);
-}
-
-//--------------------------------------------------------------------------------
-template <> void Structure :: Convert<MTex> (
- MTex& dest,
- const FileDatabase& db
- ) const
-{
-
- ReadField<ErrorPolicy_Igno>((int&)dest.blendtype,"blendtype",db);
- ReadFieldPtr<ErrorPolicy_Igno>(dest.object,"*object",db);
- ReadFieldPtr<ErrorPolicy_Igno>(dest.tex,"*tex",db);
- ReadFieldArray<ErrorPolicy_Igno>(dest.uvname,"uvname",db);
- ReadField<ErrorPolicy_Igno>((int&)dest.projx,"projx",db);
- ReadField<ErrorPolicy_Igno>((int&)dest.projy,"projy",db);
- ReadField<ErrorPolicy_Igno>((int&)dest.projz,"projz",db);
- ReadField<ErrorPolicy_Igno>(dest.mapping,"mapping",db);
- ReadFieldArray<ErrorPolicy_Igno>(dest.ofs,"ofs",db);
- ReadFieldArray<ErrorPolicy_Igno>(dest.size,"size",db);
- ReadField<ErrorPolicy_Igno>(dest.rot,"rot",db);
- ReadField<ErrorPolicy_Igno>(dest.texflag,"texflag",db);
- ReadField<ErrorPolicy_Igno>(dest.colormodel,"colormodel",db);
- ReadField<ErrorPolicy_Igno>(dest.pmapto,"pmapto",db);
- ReadField<ErrorPolicy_Igno>(dest.pmaptoneg,"pmaptoneg",db);
- ReadField<ErrorPolicy_Warn>(dest.r,"r",db);
- ReadField<ErrorPolicy_Warn>(dest.g,"g",db);
- ReadField<ErrorPolicy_Warn>(dest.b,"b",db);
- ReadField<ErrorPolicy_Warn>(dest.k,"k",db);
- ReadField<ErrorPolicy_Igno>(dest.colspecfac,"colspecfac",db);
- ReadField<ErrorPolicy_Igno>(dest.mirrfac,"mirrfac",db);
- ReadField<ErrorPolicy_Igno>(dest.alphafac,"alphafac",db);
- ReadField<ErrorPolicy_Igno>(dest.difffac,"difffac",db);
- ReadField<ErrorPolicy_Igno>(dest.specfac,"specfac",db);
- ReadField<ErrorPolicy_Igno>(dest.emitfac,"emitfac",db);
- ReadField<ErrorPolicy_Igno>(dest.hardfac,"hardfac",db);
-
- db.reader->IncPtr(size);
-}
-
-//--------------------------------------------------------------------------------
-template <> void Structure :: Convert<TFace> (
- TFace& dest,
- const FileDatabase& db
- ) const
-{
-
- ReadFieldArray2<ErrorPolicy_Fail>(dest.uv,"uv",db);
- ReadFieldArray<ErrorPolicy_Fail>(dest.col,"col",db);
- ReadField<ErrorPolicy_Igno>(dest.flag,"flag",db);
- ReadField<ErrorPolicy_Igno>(dest.mode,"mode",db);
- ReadField<ErrorPolicy_Igno>(dest.tile,"tile",db);
- ReadField<ErrorPolicy_Igno>(dest.unwrap,"unwrap",db);
-
- db.reader->IncPtr(size);
-}
-
-//--------------------------------------------------------------------------------
-template <> void Structure :: Convert<SubsurfModifierData> (
- SubsurfModifierData& dest,
- const FileDatabase& db
- ) const
-{
-
- ReadField<ErrorPolicy_Fail>(dest.modifier,"modifier",db);
- ReadField<ErrorPolicy_Igno>(dest.subdivType,"subdivType",db);
- ReadField<ErrorPolicy_Igno>(dest.levels,"levels",db);
- ReadField<ErrorPolicy_Igno>(dest.renderLevels,"renderLevels",db);
- ReadField<ErrorPolicy_Igno>(dest.flags,"flags",db);
-
- db.reader->IncPtr(size);
-}
-
-//--------------------------------------------------------------------------------
-template <> void Structure :: Convert<MFace> (
- MFace& dest,
- const FileDatabase& db
- ) const
-{
-
- ReadField<ErrorPolicy_Fail>(dest.v1,"v1",db);
- ReadField<ErrorPolicy_Fail>(dest.v2,"v2",db);
- ReadField<ErrorPolicy_Fail>(dest.v3,"v3",db);
- ReadField<ErrorPolicy_Fail>(dest.v4,"v4",db);
- ReadField<ErrorPolicy_Fail>(dest.mat_nr,"mat_nr",db);
- ReadField<ErrorPolicy_Igno>(dest.flag,"flag",db);
-
- db.reader->IncPtr(size);
-}
-
-//--------------------------------------------------------------------------------
-template <> void Structure :: Convert<Lamp> (
- Lamp& dest,
- const FileDatabase& db
- ) const
-{
-
- ReadField<ErrorPolicy_Fail>(dest.id,"id",db);
- ReadField<ErrorPolicy_Fail>((int&)dest.type,"type",db);
- ReadField<ErrorPolicy_Igno>(dest.flags,"flags",db);
- ReadField<ErrorPolicy_Igno>(dest.colormodel,"colormodel",db);
- ReadField<ErrorPolicy_Igno>(dest.totex,"totex",db);
- ReadField<ErrorPolicy_Warn>(dest.r,"r",db);
- ReadField<ErrorPolicy_Warn>(dest.g,"g",db);
- ReadField<ErrorPolicy_Warn>(dest.b,"b",db);
- ReadField<ErrorPolicy_Warn>(dest.k,"k",db);
- ReadField<ErrorPolicy_Igno>(dest.energy,"energy",db);
- ReadField<ErrorPolicy_Igno>(dest.dist,"dist",db);
- ReadField<ErrorPolicy_Igno>(dest.spotsize,"spotsize",db);
- ReadField<ErrorPolicy_Igno>(dest.spotblend,"spotblend",db);
- ReadField<ErrorPolicy_Igno>(dest.att1,"att1",db);
- ReadField<ErrorPolicy_Igno>(dest.att2,"att2",db);
- ReadField<ErrorPolicy_Igno>((int&)dest.falloff_type,"falloff_type",db);
- ReadField<ErrorPolicy_Igno>(dest.sun_brightness,"sun_brightness",db);
-
- db.reader->IncPtr(size);
-}
-
-//--------------------------------------------------------------------------------
-template <> void Structure :: Convert<MDeformWeight> (
- MDeformWeight& dest,
- const FileDatabase& db
- ) const
-{
-
- ReadField<ErrorPolicy_Fail>(dest.def_nr,"def_nr",db);
- ReadField<ErrorPolicy_Fail>(dest.weight,"weight",db);
-
- db.reader->IncPtr(size);
-}
-
-//--------------------------------------------------------------------------------
-template <> void Structure :: Convert<PackedFile> (
- PackedFile& dest,
- const FileDatabase& db
- ) const
-{
-
- ReadField<ErrorPolicy_Warn>(dest.size,"size",db);
- ReadField<ErrorPolicy_Warn>(dest.seek,"seek",db);
- ReadFieldPtr<ErrorPolicy_Warn>(dest.data,"*data",db);
-
- db.reader->IncPtr(size);
-}
-
-//--------------------------------------------------------------------------------
-template <> void Structure :: Convert<Base> (
- Base& dest,
- const FileDatabase& db
- ) const
-{
-
- ReadFieldPtr<ErrorPolicy_Warn>(dest.prev,"*prev",db);
- ReadFieldPtr<ErrorPolicy_Warn>(dest.next,"*next",db);
- ReadFieldPtr<ErrorPolicy_Warn>(dest.object,"*object",db);
-
- db.reader->IncPtr(size);
-}
-
-//--------------------------------------------------------------------------------
-template <> void Structure :: Convert<MTFace> (
- MTFace& dest,
- const FileDatabase& db
- ) const
-{
-
- ReadFieldArray2<ErrorPolicy_Fail>(dest.uv,"uv",db);
- ReadField<ErrorPolicy_Igno>(dest.flag,"flag",db);
- ReadField<ErrorPolicy_Igno>(dest.mode,"mode",db);
- ReadField<ErrorPolicy_Igno>(dest.tile,"tile",db);
- ReadField<ErrorPolicy_Igno>(dest.unwrap,"unwrap",db);
-
- db.reader->IncPtr(size);
-}
-
-//--------------------------------------------------------------------------------
-template <> void Structure :: Convert<Material> (
- Material& dest,
- const FileDatabase& db
- ) const
-{
-
- ReadField<ErrorPolicy_Fail>(dest.id,"id",db);
- ReadField<ErrorPolicy_Warn>(dest.r,"r",db);
- ReadField<ErrorPolicy_Warn>(dest.g,"g",db);
- ReadField<ErrorPolicy_Warn>(dest.b,"b",db);
- ReadField<ErrorPolicy_Warn>(dest.specr,"specr",db);
- ReadField<ErrorPolicy_Warn>(dest.specg,"specg",db);
- ReadField<ErrorPolicy_Warn>(dest.specb,"specb",db);
- ReadField<ErrorPolicy_Warn>(dest.ambir,"ambir",db);
- ReadField<ErrorPolicy_Warn>(dest.ambig,"ambig",db);
- ReadField<ErrorPolicy_Warn>(dest.ambib,"ambib",db);
- ReadField<ErrorPolicy_Igno>(dest.mirr,"mirr",db);
- ReadField<ErrorPolicy_Igno>(dest.mirg,"mirg",db);
- ReadField<ErrorPolicy_Igno>(dest.mirb,"mirb",db);
- ReadField<ErrorPolicy_Warn>(dest.emit,"emit",db);
- ReadField<ErrorPolicy_Warn>(dest.alpha,"alpha",db);
- ReadField<ErrorPolicy_Igno>(dest.ref,"ref",db);
- ReadField<ErrorPolicy_Igno>(dest.translucency,"translucency",db);
- ReadField<ErrorPolicy_Igno>(dest.roughness,"roughness",db);
- ReadField<ErrorPolicy_Igno>(dest.darkness,"darkness",db);
- ReadField<ErrorPolicy_Igno>(dest.refrac,"refrac",db);
- ReadFieldPtr<ErrorPolicy_Igno>(dest.group,"*group",db);
- ReadField<ErrorPolicy_Warn>(dest.diff_shader,"diff_shader",db);
- ReadField<ErrorPolicy_Warn>(dest.spec_shader,"spec_shader",db);
- ReadFieldPtr<ErrorPolicy_Igno>(dest.mtex,"*mtex",db);
-
- db.reader->IncPtr(size);
-}
-
-//--------------------------------------------------------------------------------
-template <> void Structure :: Convert<Mesh> (
- Mesh& dest,
- const FileDatabase& db
- ) const
-{
-
- ReadField<ErrorPolicy_Fail>(dest.id,"id",db);
- ReadField<ErrorPolicy_Fail>(dest.totface,"totface",db);
- ReadField<ErrorPolicy_Fail>(dest.totedge,"totedge",db);
- ReadField<ErrorPolicy_Fail>(dest.totvert,"totvert",db);
- ReadField<ErrorPolicy_Igno>(dest.subdiv,"subdiv",db);
- ReadField<ErrorPolicy_Igno>(dest.subdivr,"subdivr",db);
- ReadField<ErrorPolicy_Igno>(dest.subsurftype,"subsurftype",db);
- ReadField<ErrorPolicy_Igno>(dest.smoothresh,"smoothresh",db);
- ReadFieldPtr<ErrorPolicy_Fail>(dest.mface,"*mface",db);
- ReadFieldPtr<ErrorPolicy_Igno>(dest.mtface,"*mtface",db);
- ReadFieldPtr<ErrorPolicy_Igno>(dest.tface,"*tface",db);
- ReadFieldPtr<ErrorPolicy_Fail>(dest.mvert,"*mvert",db);
- ReadFieldPtr<ErrorPolicy_Warn>(dest.medge,"*medge",db);
- ReadFieldPtr<ErrorPolicy_Igno>(dest.dvert,"*dvert",db);
- ReadFieldPtr<ErrorPolicy_Igno>(dest.mcol,"*mcol",db);
- ReadFieldPtr<ErrorPolicy_Fail>(dest.mat,"**mat",db);
-
- db.reader->IncPtr(size);
-}
-
-//--------------------------------------------------------------------------------
-template <> void Structure :: Convert<MDeformVert> (
- MDeformVert& dest,
- const FileDatabase& db
- ) const
-{
-
- ReadFieldPtr<ErrorPolicy_Warn>(dest.dw,"*dw",db);
- ReadField<ErrorPolicy_Igno>(dest.totweight,"totweight",db);
-
- db.reader->IncPtr(size);
-}
-
-//--------------------------------------------------------------------------------
-template <> void Structure :: Convert<World> (
- World& dest,
- const FileDatabase& db
- ) const
-{
-
- ReadField<ErrorPolicy_Fail>(dest.id,"id",db);
-
- db.reader->IncPtr(size);
-}
-
-//--------------------------------------------------------------------------------
-template <> void Structure :: Convert<MVert> (
- MVert& dest,
- const FileDatabase& db
- ) const
-{
-
- ReadFieldArray<ErrorPolicy_Fail>(dest.co,"co",db);
- ReadFieldArray<ErrorPolicy_Fail>(dest.no,"no",db);
- ReadField<ErrorPolicy_Igno>(dest.flag,"flag",db);
- ReadField<ErrorPolicy_Warn>(dest.mat_nr,"mat_nr",db);
- ReadField<ErrorPolicy_Igno>(dest.bweight,"bweight",db);
-
- db.reader->IncPtr(size);
-}
-
-//--------------------------------------------------------------------------------
-template <> void Structure :: Convert<MEdge> (
- MEdge& dest,
- const FileDatabase& db
- ) const
-{
-
- ReadField<ErrorPolicy_Fail>(dest.v1,"v1",db);
- ReadField<ErrorPolicy_Fail>(dest.v2,"v2",db);
- ReadField<ErrorPolicy_Igno>(dest.crease,"crease",db);
- ReadField<ErrorPolicy_Igno>(dest.bweight,"bweight",db);
- ReadField<ErrorPolicy_Igno>(dest.flag,"flag",db);
-
- db.reader->IncPtr(size);
-}
-
-//--------------------------------------------------------------------------------
-template <> void Structure :: Convert<GroupObject> (
- GroupObject& dest,
- const FileDatabase& db
- ) const
-{
-
- ReadFieldPtr<ErrorPolicy_Fail>(dest.prev,"*prev",db);
- ReadFieldPtr<ErrorPolicy_Fail>(dest.next,"*next",db);
- ReadFieldPtr<ErrorPolicy_Igno>(dest.ob,"*ob",db);
-
- db.reader->IncPtr(size);
-}
-
-//--------------------------------------------------------------------------------
-template <> void Structure :: Convert<ListBase> (
- ListBase& dest,
- const FileDatabase& db
- ) const
-{
-
- ReadFieldPtr<ErrorPolicy_Igno>(dest.first,"*first",db);
- ReadFieldPtr<ErrorPolicy_Igno>(dest.last,"*last",db);
-
- db.reader->IncPtr(size);
-}
-
-//--------------------------------------------------------------------------------
-template <> void Structure :: Convert<ModifierData> (
- ModifierData& dest,
- const FileDatabase& db
- ) const
-{
-
- ReadFieldPtr<ErrorPolicy_Warn>(dest.next,"*next",db);
- ReadFieldPtr<ErrorPolicy_Warn>(dest.prev,"*prev",db);
- ReadField<ErrorPolicy_Igno>(dest.type,"type",db);
- ReadField<ErrorPolicy_Igno>(dest.mode,"mode",db);
- ReadFieldArray<ErrorPolicy_Igno>(dest.name,"name",db);
-
- db.reader->IncPtr(size);
-}
-
-//--------------------------------------------------------------------------------
-template <> void Structure :: Convert<ID> (
- ID& dest,
- const FileDatabase& db
- ) const
-{
-
- ReadFieldArray<ErrorPolicy_Warn>(dest.name,"name",db);
- ReadField<ErrorPolicy_Igno>(dest.flag,"flag",db);
-
- db.reader->IncPtr(size);
-}
-
-//--------------------------------------------------------------------------------
-template <> void Structure :: Convert<MCol> (
- MCol& dest,
- const FileDatabase& db
- ) const
-{
-
- ReadField<ErrorPolicy_Fail>(dest.r,"r",db);
- ReadField<ErrorPolicy_Fail>(dest.g,"g",db);
- ReadField<ErrorPolicy_Fail>(dest.b,"b",db);
- ReadField<ErrorPolicy_Fail>(dest.a,"a",db);
-
- db.reader->IncPtr(size);
-}
-
-//--------------------------------------------------------------------------------
-template <> void Structure :: Convert<Image> (
- Image& dest,
- const FileDatabase& db
- ) const
-{
-
- ReadField<ErrorPolicy_Fail>(dest.id,"id",db);
- ReadFieldArray<ErrorPolicy_Warn>(dest.name,"name",db);
- ReadField<ErrorPolicy_Igno>(dest.ok,"ok",db);
- ReadField<ErrorPolicy_Igno>(dest.flag,"flag",db);
- ReadField<ErrorPolicy_Igno>(dest.source,"source",db);
- ReadField<ErrorPolicy_Igno>(dest.type,"type",db);
- ReadField<ErrorPolicy_Igno>(dest.pad,"pad",db);
- ReadField<ErrorPolicy_Igno>(dest.pad1,"pad1",db);
- ReadField<ErrorPolicy_Igno>(dest.lastframe,"lastframe",db);
- ReadField<ErrorPolicy_Igno>(dest.tpageflag,"tpageflag",db);
- ReadField<ErrorPolicy_Igno>(dest.totbind,"totbind",db);
- ReadField<ErrorPolicy_Igno>(dest.xrep,"xrep",db);
- ReadField<ErrorPolicy_Igno>(dest.yrep,"yrep",db);
- ReadField<ErrorPolicy_Igno>(dest.twsta,"twsta",db);
- ReadField<ErrorPolicy_Igno>(dest.twend,"twend",db);
- ReadFieldPtr<ErrorPolicy_Igno>(dest.packedfile,"*packedfile",db);
- ReadField<ErrorPolicy_Igno>(dest.lastupdate,"lastupdate",db);
- ReadField<ErrorPolicy_Igno>(dest.lastused,"lastused",db);
- ReadField<ErrorPolicy_Igno>(dest.animspeed,"animspeed",db);
- ReadField<ErrorPolicy_Igno>(dest.gen_x,"gen_x",db);
- ReadField<ErrorPolicy_Igno>(dest.gen_y,"gen_y",db);
- ReadField<ErrorPolicy_Igno>(dest.gen_type,"gen_type",db);
-
- db.reader->IncPtr(size);
-}
-
-//--------------------------------------------------------------------------------
-template <> void Structure :: Convert<Scene> (
- Scene& dest,
- const FileDatabase& db
- ) const
-{
-
- ReadField<ErrorPolicy_Fail>(dest.id,"id",db);
- ReadFieldPtr<ErrorPolicy_Warn>(dest.camera,"*camera",db);
- ReadFieldPtr<ErrorPolicy_Warn>(dest.world,"*world",db);
- ReadFieldPtr<ErrorPolicy_Warn>(dest.basact,"*basact",db);
- ReadField<ErrorPolicy_Igno>(dest.base,"base",db);
-
- db.reader->IncPtr(size);
-}
-
-//--------------------------------------------------------------------------------
-template <> void Structure :: Convert<Library> (
- Library& dest,
- const FileDatabase& db
- ) const
-{
-
- ReadField<ErrorPolicy_Fail>(dest.id,"id",db);
- ReadFieldArray<ErrorPolicy_Warn>(dest.name,"name",db);
- ReadFieldArray<ErrorPolicy_Fail>(dest.filename,"filename",db);
- ReadFieldPtr<ErrorPolicy_Warn>(dest.parent,"*parent",db);
-
- db.reader->IncPtr(size);
-}
-
-//--------------------------------------------------------------------------------
-template <> void Structure :: Convert<Tex> (
- Tex& dest,
- const FileDatabase& db
- ) const
-{
-
- ReadField<ErrorPolicy_Fail>((int&)dest.type,"type",db);
- ReadFieldPtr<ErrorPolicy_Warn>(dest.ima,"*ima",db);
-
- db.reader->IncPtr(size);
-}
-
-//--------------------------------------------------------------------------------
-template <> void Structure :: Convert<Camera> (
- Camera& dest,
- const FileDatabase& db
- ) const
-{
-
- ReadField<ErrorPolicy_Fail>(dest.id,"id",db);
- ReadField<ErrorPolicy_Warn>((int&)dest.type,"type",db);
- ReadField<ErrorPolicy_Warn>((int&)dest.flag,"flag",db);
- ReadField<ErrorPolicy_Warn>(dest.angle,"angle",db);
-
- db.reader->IncPtr(size);
-}
-
-//--------------------------------------------------------------------------------
-template <> void Structure :: Convert<MirrorModifierData> (
- MirrorModifierData& dest,
- const FileDatabase& db
- ) const
-{
-
- ReadField<ErrorPolicy_Fail>(dest.modifier,"modifier",db);
- ReadField<ErrorPolicy_Igno>(dest.axis,"axis",db);
- ReadField<ErrorPolicy_Igno>(dest.flag,"flag",db);
- ReadField<ErrorPolicy_Igno>(dest.tolerance,"tolerance",db);
- ReadFieldPtr<ErrorPolicy_Igno>(dest.mirror_ob,"*mirror_ob",db);
-
- db.reader->IncPtr(size);
-}
-
-//--------------------------------------------------------------------------------
-void DNA::RegisterConverters() {
-
- converters["Object"] = DNA::FactoryPair( static_cast<AllocProcPtr>(&Structure::Allocate<Object>), static_cast<ConvertProcPtr>(&Structure::Convert<Object>) );
- converters["Group"] = DNA::FactoryPair( static_cast<AllocProcPtr>(&Structure::Allocate<Group>), static_cast<ConvertProcPtr>(&Structure::Convert<Group>) );
- converters["MTex"] = DNA::FactoryPair( static_cast<AllocProcPtr>(&Structure::Allocate<MTex>), static_cast<ConvertProcPtr>(&Structure::Convert<MTex>) );
- converters["TFace"] = DNA::FactoryPair( static_cast<AllocProcPtr>(&Structure::Allocate<TFace>), static_cast<ConvertProcPtr>(&Structure::Convert<TFace>) );
- converters["SubsurfModifierData"] = DNA::FactoryPair( static_cast<AllocProcPtr>(&Structure::Allocate<SubsurfModifierData>), static_cast<ConvertProcPtr>(&Structure::Convert<SubsurfModifierData>) );
- converters["MFace"] = DNA::FactoryPair( static_cast<AllocProcPtr>(&Structure::Allocate<MFace>), static_cast<ConvertProcPtr>(&Structure::Convert<MFace>) );
- converters["Lamp"] = DNA::FactoryPair( static_cast<AllocProcPtr>(&Structure::Allocate<Lamp>), static_cast<ConvertProcPtr>(&Structure::Convert<Lamp>) );
- converters["MDeformWeight"] = DNA::FactoryPair( static_cast<AllocProcPtr>(&Structure::Allocate<MDeformWeight>), static_cast<ConvertProcPtr>(&Structure::Convert<MDeformWeight>) );
- converters["PackedFile"] = DNA::FactoryPair( static_cast<AllocProcPtr>(&Structure::Allocate<PackedFile>), static_cast<ConvertProcPtr>(&Structure::Convert<PackedFile>) );
- converters["Base"] = DNA::FactoryPair( static_cast<AllocProcPtr>(&Structure::Allocate<Base>), static_cast<ConvertProcPtr>(&Structure::Convert<Base>) );
- converters["MTFace"] = DNA::FactoryPair( static_cast<AllocProcPtr>(&Structure::Allocate<MTFace>), static_cast<ConvertProcPtr>(&Structure::Convert<MTFace>) );
- converters["Material"] = DNA::FactoryPair( static_cast<AllocProcPtr>(&Structure::Allocate<Material>), static_cast<ConvertProcPtr>(&Structure::Convert<Material>) );
- converters["Mesh"] = DNA::FactoryPair( static_cast<AllocProcPtr>(&Structure::Allocate<Mesh>), static_cast<ConvertProcPtr>(&Structure::Convert<Mesh>) );
- converters["MDeformVert"] = DNA::FactoryPair( static_cast<AllocProcPtr>(&Structure::Allocate<MDeformVert>), static_cast<ConvertProcPtr>(&Structure::Convert<MDeformVert>) );
- converters["World"] = DNA::FactoryPair( static_cast<AllocProcPtr>(&Structure::Allocate<World>), static_cast<ConvertProcPtr>(&Structure::Convert<World>) );
- converters["MVert"] = DNA::FactoryPair( static_cast<AllocProcPtr>(&Structure::Allocate<MVert>), static_cast<ConvertProcPtr>(&Structure::Convert<MVert>) );
- converters["MEdge"] = DNA::FactoryPair( static_cast<AllocProcPtr>(&Structure::Allocate<MEdge>), static_cast<ConvertProcPtr>(&Structure::Convert<MEdge>) );
- converters["GroupObject"] = DNA::FactoryPair( static_cast<AllocProcPtr>(&Structure::Allocate<GroupObject>), static_cast<ConvertProcPtr>(&Structure::Convert<GroupObject>) );
- converters["ListBase"] = DNA::FactoryPair( static_cast<AllocProcPtr>(&Structure::Allocate<ListBase>), static_cast<ConvertProcPtr>(&Structure::Convert<ListBase>) );
- converters["ModifierData"] = DNA::FactoryPair( static_cast<AllocProcPtr>(&Structure::Allocate<ModifierData>), static_cast<ConvertProcPtr>(&Structure::Convert<ModifierData>) );
- converters["ID"] = DNA::FactoryPair( static_cast<AllocProcPtr>(&Structure::Allocate<ID>), static_cast<ConvertProcPtr>(&Structure::Convert<ID>) );
- converters["MCol"] = DNA::FactoryPair( static_cast<AllocProcPtr>(&Structure::Allocate<MCol>), static_cast<ConvertProcPtr>(&Structure::Convert<MCol>) );
- converters["Image"] = DNA::FactoryPair( static_cast<AllocProcPtr>(&Structure::Allocate<Image>), static_cast<ConvertProcPtr>(&Structure::Convert<Image>) );
- converters["Scene"] = DNA::FactoryPair( static_cast<AllocProcPtr>(&Structure::Allocate<Scene>), static_cast<ConvertProcPtr>(&Structure::Convert<Scene>) );
- converters["Library"] = DNA::FactoryPair( static_cast<AllocProcPtr>(&Structure::Allocate<Library>), static_cast<ConvertProcPtr>(&Structure::Convert<Library>) );
- converters["Tex"] = DNA::FactoryPair( static_cast<AllocProcPtr>(&Structure::Allocate<Tex>), static_cast<ConvertProcPtr>(&Structure::Convert<Tex>) );
- converters["Camera"] = DNA::FactoryPair( static_cast<AllocProcPtr>(&Structure::Allocate<Camera>), static_cast<ConvertProcPtr>(&Structure::Convert<Camera>) );
- converters["MirrorModifierData"] = DNA::FactoryPair( static_cast<AllocProcPtr>(&Structure::Allocate<MirrorModifierData>), static_cast<ConvertProcPtr>(&Structure::Convert<MirrorModifierData>) );
-}
-
-
-#endif
diff --git a/3rdparty/assimp/code/BlenderScene.h b/3rdparty/assimp/code/BlenderScene.h
deleted file mode 100644
index 5cfb7092..00000000
--- a/3rdparty/assimp/code/BlenderScene.h
+++ /dev/null
@@ -1,683 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file BlenderScene.h
- * @brief Intermediate representation of a BLEND scene.
- */
-#ifndef INCLUDED_AI_BLEND_SCENE_H
-#define INCLUDED_AI_BLEND_SCENE_H
-
-namespace Assimp {
- namespace Blender {
-
-// Minor parts of this file are extracts from blender data structures,
-// declared in the ./source/blender/makesdna directory.
-// Stuff that is not used by Assimp is commented.
-
-
-// NOTE
-// this file serves as input data to the `./scripts/genblenddna.py`
-// script. This script generates the actual binding code to read a
-// blender file with a possibly different DNA into our structures.
-// Only `struct` declarations are considered and the following
-// rules must be obeyed in order for the script to work properly:
-//
-// * C++ style comments only
-//
-// * Structures may include the primitive types char, int, short,
-// float, double. Signedness specifiers are not allowed on
-// integers. Enum types are allowed, but they must have been
-// defined in this header.
-//
-// * Structures may aggregate other structures, unless not defined
-// in this header.
-//
-// * Pointers to other structures or primitive types are allowed.
-// No references or double pointers or arrays of pointers.
-// A pointer to a T is written as boost::shared_ptr, while a
-// pointer to an array of elements is written as boost::
-// shared_array.
-//
-// * Arrays can have maximally two-dimensions. Any non-pointer
-// type can form them.
-//
-// * Multiple fields can be declare in a single line (i.e `int a,b;`)
-// provided they are neither pointers nor arrays.
-//
-// * One of WARN, FAIL can be appended to the declaration (
-// prior to the semiolon to specifiy the error handling policy if
-// this field is missing in the input DNA). If none of those
-// is specified the default policy is to subtitute a default
-// value for the field.
-//
-
-#define WARN // warn if field is missing, substitute default value
-#define FAIL // fail the import if the field does not exist
-
-struct Object;
-struct MTex;
-
-#define AI_BLEND_MESH_MAX_VERTS 2000000000L
-
-// -------------------------------------------------------------------------------
-struct ID : ElemBase {
-
- char name[24] WARN;
- short flag;
-};
-
-// -------------------------------------------------------------------------------
-struct ListBase : ElemBase {
-
- boost::shared_ptr<ElemBase> first;
- boost::shared_ptr<ElemBase> last;
-};
-
-
-// -------------------------------------------------------------------------------
-struct PackedFile : ElemBase {
- int size WARN;
- int seek WARN;
- boost::shared_ptr< FileOffset > data WARN;
-};
-
-// -------------------------------------------------------------------------------
-struct GroupObject : ElemBase {
-
- boost::shared_ptr<GroupObject> prev,next FAIL;
- boost::shared_ptr<Object> ob;
-};
-
-// -------------------------------------------------------------------------------
-struct Group : ElemBase {
- ID id FAIL;
- int layer;
-
- boost::shared_ptr<GroupObject> gobject;
-};
-
-// -------------------------------------------------------------------------------
-struct World : ElemBase {
- ID id FAIL;
-
-};
-
-// -------------------------------------------------------------------------------
-struct MVert : ElemBase {
- float co[3] FAIL;
- float no[3] FAIL;
- char flag;
- int mat_nr WARN;
- int bweight;
-};
-
-// -------------------------------------------------------------------------------
-struct MEdge : ElemBase {
- int v1, v2 FAIL;
- char crease, bweight;
- short flag;
-};
-
-// -------------------------------------------------------------------------------
-struct MCol : ElemBase {
- char r,g,b,a FAIL;
-};
-
-// -------------------------------------------------------------------------------
-struct MFace : ElemBase {
- int v1,v2,v3,v4 FAIL;
- int mat_nr FAIL;
- char flag;
-};
-
-// -------------------------------------------------------------------------------
-struct TFace : ElemBase {
- float uv[4][2] FAIL;
- int col[4] FAIL;
- char flag;
- short mode;
- short tile;
- short unwrap;
-};
-
-// -------------------------------------------------------------------------------
-struct MTFace : ElemBase {
-
- float uv[4][2] FAIL;
- char flag;
- short mode;
- short tile;
- short unwrap;
-
- // boost::shared_ptr<Image> tpage;
-};
-
-// -------------------------------------------------------------------------------
-struct MDeformWeight : ElemBase {
- int def_nr FAIL;
- float weight FAIL;
-};
-
-// -------------------------------------------------------------------------------
-struct MDeformVert : ElemBase {
-
- vector<MDeformWeight> dw WARN;
- int totweight;
-};
-
-// -------------------------------------------------------------------------------
-struct Material : ElemBase {
- ID id FAIL;
-
- float r,g,b WARN;
- float specr,specg,specb WARN;
- float ambir,ambig,ambib WARN;
- float mirr,mirg,mirb;
- float emit WARN;
- float alpha WARN;
- float ref;
- float translucency;
- float roughness;
- float darkness;
- float refrac;
-
- boost::shared_ptr<Group> group;
-
- short diff_shader WARN;
- short spec_shader WARN;
-
- boost::shared_ptr<MTex> mtex[18];
-};
-
-// -------------------------------------------------------------------------------
-struct Mesh : ElemBase {
- ID id FAIL;
-
- int totface FAIL;
- int totedge FAIL;
- int totvert FAIL;
-
- short subdiv;
- short subdivr;
- short subsurftype;
- short smoothresh;
-
- vector<MFace> mface FAIL;
- vector<MTFace> mtface;
- vector<TFace> tface;
- vector<MVert> mvert FAIL;
- vector<MEdge> medge WARN;
- vector<MDeformVert> dvert;
- vector<MCol> mcol;
-
- vector< boost::shared_ptr<Material> > mat FAIL;
-};
-
-// -------------------------------------------------------------------------------
-struct Library : ElemBase {
- ID id FAIL;
-
- char name[240] WARN;
- char filename[240] FAIL;
- boost::shared_ptr<Library> parent WARN;
-};
-
-// -------------------------------------------------------------------------------
-struct Camera : ElemBase {
- enum Type {
- Type_PERSP = 0
- ,Type_ORTHO = 1
- };
-
- ID id FAIL;
-
- // struct AnimData *adt;
-
- Type type,flag WARN;
- float angle WARN;
- //float passepartalpha, angle;
- //float clipsta, clipend;
- //float lens, ortho_scale, drawsize;
- //float shiftx, shifty;
-
- //float YF_dofdist, YF_aperture;
- //short YF_bkhtype, YF_bkhbias;
- //float YF_bkhrot;
-};
-
-
-// -------------------------------------------------------------------------------
-struct Lamp : ElemBase {
-
- enum FalloffType {
- FalloffType_Constant = 0x0
- ,FalloffType_InvLinear = 0x1
- ,FalloffType_InvSquare = 0x2
- //,FalloffType_Curve = 0x3
- //,FalloffType_Sliders = 0x4
- };
-
- enum Type {
- Type_Local = 0x0
- ,Type_Sun = 0x1
- ,Type_Spot = 0x2
- ,Type_Hemi = 0x3
- ,Type_Area = 0x4
- //,Type_YFPhoton = 0x5
- };
-
- ID id FAIL;
- //AnimData *adt;
-
- Type type FAIL;
- short flags;
-
- //int mode;
-
- short colormodel, totex;
- float r,g,b,k WARN;
- //float shdwr, shdwg, shdwb;
-
- float energy, dist, spotsize, spotblend;
- //float haint;
-
- float att1, att2;
- //struct CurveMapping *curfalloff;
- FalloffType falloff_type;
-
- //float clipsta, clipend, shadspotsize;
- //float bias, soft, compressthresh;
- //short bufsize, samp, buffers, filtertype;
- //char bufflag, buftype;
-
- //short ray_samp, ray_sampy, ray_sampz;
- //short ray_samp_type;
- //short area_shape;
- //float area_size, area_sizey, area_sizez;
- //float adapt_thresh;
- //short ray_samp_method;
-
- //short texact, shadhalostep;
-
- //short sun_effect_type;
- //short skyblendtype;
- //float horizon_brightness;
- //float spread;
- float sun_brightness;
- //float sun_size;
- //float backscattered_light;
- //float sun_intensity;
- //float atm_turbidity;
- //float atm_inscattering_factor;
- //float atm_extinction_factor;
- //float atm_distance_factor;
- //float skyblendfac;
- //float sky_exposure;
- //short sky_colorspace;
-
- // int YF_numphotons, YF_numsearch;
- // short YF_phdepth, YF_useqmc, YF_bufsize, YF_pad;
- // float YF_causticblur, YF_ltradius;
-
- // float YF_glowint, YF_glowofs;
- // short YF_glowtype, YF_pad2;
-
- //struct Ipo *ipo;
- //struct MTex *mtex[18];
- // short pr_texture;
-
- //struct PreviewImage *preview;
-};
-
-// -------------------------------------------------------------------------------
-struct ModifierData : ElemBase {
- enum ModifierType {
- eModifierType_None = 0,
- eModifierType_Subsurf,
- eModifierType_Lattice,
- eModifierType_Curve,
- eModifierType_Build,
- eModifierType_Mirror,
- eModifierType_Decimate,
- eModifierType_Wave,
- eModifierType_Armature,
- eModifierType_Hook,
- eModifierType_Softbody,
- eModifierType_Boolean,
- eModifierType_Array,
- eModifierType_EdgeSplit,
- eModifierType_Displace,
- eModifierType_UVProject,
- eModifierType_Smooth,
- eModifierType_Cast,
- eModifierType_MeshDeform,
- eModifierType_ParticleSystem,
- eModifierType_ParticleInstance,
- eModifierType_Explode,
- eModifierType_Cloth,
- eModifierType_Collision,
- eModifierType_Bevel,
- eModifierType_Shrinkwrap,
- eModifierType_Fluidsim,
- eModifierType_Mask,
- eModifierType_SimpleDeform,
- eModifierType_Multires,
- eModifierType_Surface,
- eModifierType_Smoke,
- eModifierType_ShapeKey
- };
-
- boost::shared_ptr<ElemBase> next WARN;
- boost::shared_ptr<ElemBase> prev WARN;
-
- int type, mode;
- char name[32];
-};
-
-// -------------------------------------------------------------------------------
-struct SubsurfModifierData : ElemBase {
-
- enum Type {
-
- TYPE_CatmullClarke = 0x0,
- TYPE_Simple = 0x1
- };
-
- enum Flags {
- // some ommitted
- FLAGS_SubsurfUV =1<<3
- };
-
- ModifierData modifier FAIL;
- short subdivType WARN;
- short levels FAIL;
- short renderLevels ;
- short flags;
-};
-
-// -------------------------------------------------------------------------------
-struct MirrorModifierData : ElemBase {
-
- enum Flags {
- Flags_CLIPPING =1<<0,
- Flags_MIRROR_U =1<<1,
- Flags_MIRROR_V =1<<2,
- Flags_AXIS_X =1<<3,
- Flags_AXIS_Y =1<<4,
- Flags_AXIS_Z =1<<5,
- Flags_VGROUP =1<<6
- };
-
- ModifierData modifier FAIL;
-
- short axis, flag;
- float tolerance;
- boost::shared_ptr<Object> mirror_ob;
-};
-
-// -------------------------------------------------------------------------------
-struct Object : ElemBase {
- ID id FAIL;
-
- enum Type {
- Type_EMPTY = 0
- ,Type_MESH = 1
- ,Type_CURVE = 2
- ,Type_SURF = 3
- ,Type_FONT = 4
- ,Type_MBALL = 5
-
- ,Type_LAMP = 10
- ,Type_CAMERA = 11
-
- ,Type_WAVE = 21
- ,Type_LATTICE = 22
- };
-
- Type type FAIL;
- float obmat[4][4] WARN;
- float parentinv[4][4] WARN;
- char parsubstr[32] WARN;
-
- boost::shared_ptr<Object> parent WARN;
- boost::shared_ptr<Object> track WARN;
-
- boost::shared_ptr<Object> proxy,proxy_from,proxy_group WARN;
- boost::shared_ptr<Group> dup_group WARN;
- boost::shared_ptr<ElemBase> data FAIL;
-
- ListBase modifiers;
-};
-
-
-// -------------------------------------------------------------------------------
-struct Base : ElemBase {
- boost::shared_ptr<Base> prev WARN;
- boost::shared_ptr<Base> next WARN;
- boost::shared_ptr<Object> object WARN;
-};
-
-// -------------------------------------------------------------------------------
-struct Scene : ElemBase {
- ID id FAIL;
-
- boost::shared_ptr<Object> camera WARN;
- boost::shared_ptr<World> world WARN;
- boost::shared_ptr<Base> basact WARN;
-
- ListBase base;
-};
-
-
-// -------------------------------------------------------------------------------
-struct Image : ElemBase {
- ID id FAIL;
-
- char name[240] WARN;
-
- //struct anim *anim;
-
- short ok, flag;
- short source, type, pad, pad1;
- int lastframe;
-
- short tpageflag, totbind;
- short xrep, yrep;
- short twsta, twend;
- //unsigned int bindcode;
- //unsigned int *repbind;
-
- boost::shared_ptr<PackedFile> packedfile;
- //struct PreviewImage * preview;
-
- float lastupdate;
- int lastused;
- short animspeed;
-
- short gen_x, gen_y, gen_type;
-};
-
-// -------------------------------------------------------------------------------
-struct Tex : ElemBase {
-
- // actually, the only texture type we support is Type_IMAGE
- enum Type {
- Type_CLOUDS = 1
- ,Type_WOOD = 2
- ,Type_MARBLE = 3
- ,Type_MAGIC = 4
- ,Type_BLEND = 5
- ,Type_STUCCI = 6
- ,Type_NOISE = 7
- ,Type_IMAGE = 8
- ,Type_PLUGIN = 9
- ,Type_ENVMAP = 10
- ,Type_MUSGRAVE = 11
- ,Type_VORONOI = 12
- ,Type_DISTNOISE = 13
- ,Type_POINTDENSITY = 14
- ,Type_VOXELDATA = 15
- };
-
- ID id FAIL;
- // AnimData *adt;
-
- //float noisesize, turbul;
- //float bright, contrast, rfac, gfac, bfac;
- //float filtersize;
-
- //float mg_H, mg_lacunarity, mg_octaves, mg_offset, mg_gain;
- //float dist_amount, ns_outscale;
-
- //float vn_w1;
- //float vn_w2;
- //float vn_w3;
- //float vn_w4;
- //float vn_mexp;
- //short vn_distm, vn_coltype;
-
- //short noisedepth, noisetype;
- //short noisebasis, noisebasis2;
-
- //short imaflag, flag;
- Type type FAIL;
- //short stype;
-
- //float cropxmin, cropymin, cropxmax, cropymax;
- //int texfilter;
- //int afmax;
- //short xrepeat, yrepeat;
- //short extend;
-
- //short fie_ima;
- //int len;
- //int frames, offset, sfra;
-
- //float checkerdist, nabla;
- //float norfac;
-
- //ImageUser iuser;
-
- //bNodeTree *nodetree;
- //Ipo *ipo;
- boost::shared_ptr<Image> ima WARN;
- //PluginTex *plugin;
- //ColorBand *coba;
- //EnvMap *env;
- //PreviewImage * preview;
- //PointDensity *pd;
- //VoxelData *vd;
-
- //char use_nodes;
-};
-
-// -------------------------------------------------------------------------------
-struct MTex : ElemBase {
-
- enum Projection {
- Proj_N = 0
- ,Proj_X = 1
- ,Proj_Y = 2
- ,Proj_Z = 3
- };
-
- enum Flag {
- Flag_RGBTOINT = 0x1
- ,Flag_STENCIL = 0x2
- ,Flag_NEGATIVE = 0x4
- ,Flag_ALPHAMIX = 0x8
- ,Flag_VIEWSPACE = 0x10
- };
-
- enum BlendType {
- BlendType_BLEND = 0
- ,BlendType_MUL = 1
- ,BlendType_ADD = 2
- ,BlendType_SUB = 3
- ,BlendType_DIV = 4
- ,BlendType_DARK = 5
- ,BlendType_DIFF = 6
- ,BlendType_LIGHT = 7
- ,BlendType_SCREEN = 8
- ,BlendType_OVERLAY = 9
- ,BlendType_BLEND_HUE = 10
- ,BlendType_BLEND_SAT = 11
- ,BlendType_BLEND_VAL = 12
- ,BlendType_BLEND_COLOR = 13
- };
-
- // short texco, mapto, maptoneg;
-
- BlendType blendtype;
- boost::shared_ptr<Object> object;
- boost::shared_ptr<Tex> tex;
- char uvname[32];
-
- Projection projx,projy,projz;
- char mapping;
- float ofs[3], size[3], rot;
-
- int texflag;
- short colormodel, pmapto, pmaptoneg;
- //short normapspace, which_output;
- //char brush_map_mode;
- float r,g,b,k WARN;
- //float def_var, rt;
-
- //float colfac, varfac;
-
- //float norfac, dispfac, warpfac;
- float colspecfac, mirrfac, alphafac;
- float difffac, specfac, emitfac, hardfac;
- //float raymirrfac, translfac, ambfac;
- //float colemitfac, colreflfac, coltransfac;
- //float densfac, scatterfac, reflfac;
-
- //float timefac, lengthfac, clumpfac;
- //float kinkfac, roughfac, padensfac;
- //float lifefac, sizefac, ivelfac, pvelfac;
- //float shadowfac;
- //float zenupfac, zendownfac, blendfac;
-};
-
-
- }
-}
-#endif
diff --git a/3rdparty/assimp/code/BlenderSceneGen.h b/3rdparty/assimp/code/BlenderSceneGen.h
deleted file mode 100644
index 3ef5d341..00000000
--- a/3rdparty/assimp/code/BlenderSceneGen.h
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file BlenderSceneGen.h
- * @brief MACHINE GENERATED BY ./scripts/BlenderImporter/genblenddna.py
- */
-#ifndef INCLUDED_AI_BLEND_SCENEGEN_H
-#define INCLUDED_AI_BLEND_SCENEGEN_H
-
-namespace Assimp {
- namespace Blender {
-
-
-template <> void Structure :: Convert<Object> (
- Object& dest,
- const FileDatabase& db
- ) const
-;
-
-template <> void Structure :: Convert<Group> (
- Group& dest,
- const FileDatabase& db
- ) const
-;
-
-template <> void Structure :: Convert<MTex> (
- MTex& dest,
- const FileDatabase& db
- ) const
-;
-
-template <> void Structure :: Convert<TFace> (
- TFace& dest,
- const FileDatabase& db
- ) const
-;
-
-template <> void Structure :: Convert<SubsurfModifierData> (
- SubsurfModifierData& dest,
- const FileDatabase& db
- ) const
-;
-
-template <> void Structure :: Convert<MFace> (
- MFace& dest,
- const FileDatabase& db
- ) const
-;
-
-template <> void Structure :: Convert<Lamp> (
- Lamp& dest,
- const FileDatabase& db
- ) const
-;
-
-template <> void Structure :: Convert<MDeformWeight> (
- MDeformWeight& dest,
- const FileDatabase& db
- ) const
-;
-
-template <> void Structure :: Convert<PackedFile> (
- PackedFile& dest,
- const FileDatabase& db
- ) const
-;
-
-template <> void Structure :: Convert<Base> (
- Base& dest,
- const FileDatabase& db
- ) const
-;
-
-template <> void Structure :: Convert<MTFace> (
- MTFace& dest,
- const FileDatabase& db
- ) const
-;
-
-template <> void Structure :: Convert<Material> (
- Material& dest,
- const FileDatabase& db
- ) const
-;
-
-template <> void Structure :: Convert<Mesh> (
- Mesh& dest,
- const FileDatabase& db
- ) const
-;
-
-template <> void Structure :: Convert<MDeformVert> (
- MDeformVert& dest,
- const FileDatabase& db
- ) const
-;
-
-template <> void Structure :: Convert<World> (
- World& dest,
- const FileDatabase& db
- ) const
-;
-
-template <> void Structure :: Convert<MVert> (
- MVert& dest,
- const FileDatabase& db
- ) const
-;
-
-template <> void Structure :: Convert<MEdge> (
- MEdge& dest,
- const FileDatabase& db
- ) const
-;
-
-template <> void Structure :: Convert<GroupObject> (
- GroupObject& dest,
- const FileDatabase& db
- ) const
-;
-
-template <> void Structure :: Convert<ListBase> (
- ListBase& dest,
- const FileDatabase& db
- ) const
-;
-
-template <> void Structure :: Convert<ModifierData> (
- ModifierData& dest,
- const FileDatabase& db
- ) const
-;
-
-template <> void Structure :: Convert<ID> (
- ID& dest,
- const FileDatabase& db
- ) const
-;
-
-template <> void Structure :: Convert<MCol> (
- MCol& dest,
- const FileDatabase& db
- ) const
-;
-
-template <> void Structure :: Convert<Image> (
- Image& dest,
- const FileDatabase& db
- ) const
-;
-
-template <> void Structure :: Convert<Scene> (
- Scene& dest,
- const FileDatabase& db
- ) const
-;
-
-template <> void Structure :: Convert<Library> (
- Library& dest,
- const FileDatabase& db
- ) const
-;
-
-template <> void Structure :: Convert<Tex> (
- Tex& dest,
- const FileDatabase& db
- ) const
-;
-
-template <> void Structure :: Convert<Camera> (
- Camera& dest,
- const FileDatabase& db
- ) const
-;
-
-template <> void Structure :: Convert<MirrorModifierData> (
- MirrorModifierData& dest,
- const FileDatabase& db
- ) const
-;
-
-
- }
-}
-
-#endif
diff --git a/3rdparty/assimp/code/BoostWorkaround/boost/LICENSE_1_0.txt b/3rdparty/assimp/code/BoostWorkaround/boost/LICENSE_1_0.txt
deleted file mode 100644
index 36b7cd93..00000000
--- a/3rdparty/assimp/code/BoostWorkaround/boost/LICENSE_1_0.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-Boost Software License - Version 1.0 - August 17th, 2003
-
-Permission is hereby granted, free of charge, to any person or organization
-obtaining a copy of the software and accompanying documentation covered by
-this license (the "Software") to use, reproduce, display, distribute,
-execute, and transmit the Software, and to prepare derivative works of the
-Software, and to permit third-parties to whom the Software is furnished to
-do so, all subject to the following:
-
-The copyright notices in the Software and this entire statement, including
-the above license grant, this restriction and the following disclaimer,
-must be included in all copies of the Software, in whole or in part, and
-all derivative works of the Software, unless such copies or derivative
-works are solely in the form of machine-executable object code generated by
-a source language processor.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
-SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
-FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-DEALINGS IN THE SOFTWARE.
diff --git a/3rdparty/assimp/code/BoostWorkaround/boost/foreach.hpp b/3rdparty/assimp/code/BoostWorkaround/boost/foreach.hpp
deleted file mode 100644
index e244cd57..00000000
--- a/3rdparty/assimp/code/BoostWorkaround/boost/foreach.hpp
+++ /dev/null
@@ -1,93 +0,0 @@
-
-#ifndef BOOST_FOREACH
-
-///////////////////////////////////////////////////////////////////////////////
-// A stripped down version of FOREACH for
-// illustration purposes. NOT FOR GENERAL USE.
-// For a complete implementation, see BOOST_FOREACH at
-// http://boost-sandbox.sourceforge.net/vault/index.php?directory=eric_niebler
-//
-// Copyright 2004 Eric Niebler.
-// Distributed under the Boost Software License, Version 1.0. (See
-// accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-//
-// Adapted to Assimp November 29th, 2008 (Alexander Gessler).
-// Added code to handle both const and non-const iterators, simplified some
-// parts.
-///////////////////////////////////////////////////////////////////////////////
-
-namespace boost {
-namespace foreach_detail {
-
-///////////////////////////////////////////////////////////////////////////////
-// auto_any
-
-struct auto_any_base
-{
- operator bool() const { return false; }
-};
-
-template<typename T>
-struct auto_any : auto_any_base
-{
- auto_any(T const& t) : item(t) {}
- mutable T item;
-};
-
-template<typename T>
-T& auto_any_cast(auto_any_base const& any)
-{
- return static_cast<auto_any<T> const&>(any).item;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// FOREACH helper function
-
-template<typename T>
-auto_any<typename T::const_iterator> begin(T const& t)
-{
- return t.begin();
-}
-
-template<typename T>
-auto_any<typename T::const_iterator> end(T const& t)
-{
- return t.end();
-}
-
-// iterator
-template<typename T>
-bool done(auto_any_base const& cur, auto_any_base const& end, T&)
-{
- typedef typename T::iterator iter_type;
- return auto_any_cast<iter_type>(cur) == auto_any_cast<iter_type>(end);
-}
-
-template<typename T>
-void next(auto_any_base const& cur, T&)
-{
- ++auto_any_cast<typename T::iterator>(cur);
-}
-
-template<typename T>
-typename T::reference deref(auto_any_base const& cur, T&)
-{
- return *auto_any_cast<typename T::iterator>(cur);
-}
-
-} // end foreach_detail
-
-///////////////////////////////////////////////////////////////////////////////
-// FOREACH
-
-#define BOOST_FOREACH(item, container) \
- if (boost::foreach_detail::auto_any_base const& b = boost::foreach_detail::begin(container)) {} else \
- if (boost::foreach_detail::auto_any_base const& e = boost::foreach_detail::end(container)) {} else \
- for (;!boost::foreach_detail::done(b,e,container); boost::foreach_detail::next(b,container)) \
- if (bool ugly_and_unique_break = false) {} else \
- for (item = boost::foreach_detail::deref(b,container); !ugly_and_unique_break; ugly_and_unique_break = true)
-
-} // end boost
-
-#endif
diff --git a/3rdparty/assimp/code/BoostWorkaround/boost/format.hpp b/3rdparty/assimp/code/BoostWorkaround/boost/format.hpp
deleted file mode 100644
index 0afae4dd..00000000
--- a/3rdparty/assimp/code/BoostWorkaround/boost/format.hpp
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
-
-/* DEPRECATED! - use code/TinyFormatter.h instead.
- *
- *
- * */
-
-#ifndef AI_BOOST_FORMAT_DUMMY_INCLUDED
-#define AI_BOOST_FORMAT_DUMMY_INCLUDED
-
-#if (!defined BOOST_FORMAT_HPP) || (defined ASSIMP_FORCE_NOBOOST)
-
-#include <string>
-#include <vector>
-
-namespace boost
-{
-
-
- class format
- {
- public:
- format (const std::string& _d)
- : d(_d)
- {
- }
-
- template <typename T>
- format& operator % (T in)
- {
- // XXX add replacement for boost::lexical_cast?
-
- std::stringstream ss;
- ss << in; // note: ss cannot be an rvalue, or the global operator << (const char*) is not called for T == const char*.
- chunks.push_back( ss.str());
- return *this;
- }
-
-
- operator std::string () const {
- std::string res; // pray for NRVO to kick in
-
- size_t start = 0, last = 0;
-
- std::vector<std::string>::const_iterator chunkin = chunks.begin();
-
- for ( start = d.find('%');start != std::string::npos; start = d.find('%',last)) {
- res += d.substr(last,start-last);
- last = start+2;
- if (d[start+1] == '%') {
- res += "%";
- continue;
- }
-
- if (chunkin == chunks.end()) {
- break;
- }
-
- res += *chunkin++;
- }
- res += d.substr(last);
- return res;
- }
-
- private:
- std::string d;
- std::vector<std::string> chunks;
- };
-
- inline std::string str(const std::string& s) {
- return s;
- }
-}
-
-
-#else
-# error "format.h was already included"
-#endif //
-#endif // !! AI_BOOST_FORMAT_DUMMY_INCLUDED
-
diff --git a/3rdparty/assimp/code/BoostWorkaround/boost/lexical_cast.hpp b/3rdparty/assimp/code/BoostWorkaround/boost/lexical_cast.hpp
deleted file mode 100644
index 6c3f7819..00000000
--- a/3rdparty/assimp/code/BoostWorkaround/boost/lexical_cast.hpp
+++ /dev/null
@@ -1,23 +0,0 @@
-/// A quick replacement for boost::lexical_cast for all the Boost haters out there
-
-#ifndef __AI_BOOST_WORKAROUND_LEXICAL_CAST
-#define __AI_BOOST_WORKAROUND_LEXICAL_CAST
-
-namespace boost
-{
-
- /// A quick replacement for boost::lexical_cast - should work for all types a stringstream can handle
- template <typename TargetType, typename SourceType>
- TargetType lexical_cast( const SourceType& source)
- {
- std::stringstream stream;
- TargetType result;
-
- stream << source;
- stream >> result;
- return result;
- }
-
-} // namespace boost
-
-#endif // __AI_BOOST_WORKAROUND_LEXICAL_CAST
diff --git a/3rdparty/assimp/code/BoostWorkaround/boost/math/common_factor_rt.hpp b/3rdparty/assimp/code/BoostWorkaround/boost/math/common_factor_rt.hpp
deleted file mode 100644
index 76dd9b10..00000000
--- a/3rdparty/assimp/code/BoostWorkaround/boost/math/common_factor_rt.hpp
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-#ifndef BOOST_MATH_COMMON_FACTOR_RT_HPP
-#define BOOST_MATH_COMMON_FACTOR_RT_HPP
-
-
-namespace boost {
-namespace math {
-
-// TODO: use binary GCD for unsigned integers ....
-template < typename IntegerType >
-IntegerType gcd( IntegerType a, IntegerType b )
-{
- const IntegerType zero = (IntegerType)0;
- while ( true )
- {
- if ( a == zero )
- return b;
- b %= a;
-
- if ( b == zero )
- return a;
- a %= b;
- }
-}
-
-template < typename IntegerType >
-IntegerType lcm( IntegerType a, IntegerType b )
-{
- const IntegerType t = gcd (a,b);
- if (!t)return t;
- return a / t * b;
-}
-
-}}
-
-#endif
diff --git a/3rdparty/assimp/code/BoostWorkaround/boost/pointer_cast.hpp b/3rdparty/assimp/code/BoostWorkaround/boost/pointer_cast.hpp
deleted file mode 100644
index ce188c13..00000000
--- a/3rdparty/assimp/code/BoostWorkaround/boost/pointer_cast.hpp
+++ /dev/null
@@ -1,45 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-//
-// (C) Copyright Ion Gaztanaga 2005.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-//
-//////////////////////////////////////////////////////////////////////////////
-
-#ifndef BOOST_POINTER_CAST_HPP
-#define BOOST_POINTER_CAST_HPP
-
-namespace boost {
-
-//static_pointer_cast overload for raw pointers
-template<class T, class U>
-inline T* static_pointer_cast(U *ptr)
-{
- return static_cast<T*>(ptr);
-}
-
-//dynamic_pointer_cast overload for raw pointers
-template<class T, class U>
-inline T* dynamic_pointer_cast(U *ptr)
-{
- return dynamic_cast<T*>(ptr);
-}
-
-//const_pointer_cast overload for raw pointers
-template<class T, class U>
-inline T* const_pointer_cast(U *ptr)
-{
- return const_cast<T*>(ptr);
-}
-
-//reinterpret_pointer_cast overload for raw pointers
-template<class T, class U>
-inline T* reinterpret_pointer_cast(U *ptr)
-{
- return reinterpret_cast<T*>(ptr);
-}
-
-} // namespace boost
-
-#endif //BOOST_POINTER_CAST_HPP
diff --git a/3rdparty/assimp/code/BoostWorkaround/boost/scoped_array.hpp b/3rdparty/assimp/code/BoostWorkaround/boost/scoped_array.hpp
deleted file mode 100644
index ebb97171..00000000
--- a/3rdparty/assimp/code/BoostWorkaround/boost/scoped_array.hpp
+++ /dev/null
@@ -1,79 +0,0 @@
-
-#ifndef __AI_BOOST_SCOPED_ARRAY_INCLUDED
-#define __AI_BOOST_SCOPED_ARRAY_INCLUDED
-
-#ifndef BOOST_SCOPED_ARRAY_HPP_INCLUDED
-
-namespace boost {
-
-// small replacement for boost::scoped_array
-template <class T>
-class scoped_array
-{
-public:
-
- // provide a default construtctor
- scoped_array()
- : ptr(0)
- {
- }
-
- // construction from an existing heap object of type T
- scoped_array(T* _ptr)
- : ptr(_ptr)
- {
- }
-
- // automatic destruction of the wrapped object at the
- // end of our lifetime
- ~scoped_array()
- {
- delete[] ptr;
- }
-
- inline T* get()
- {
- return ptr;
- }
-
- inline T* operator-> ()
- {
- return ptr;
- }
-
- inline void reset (T* t = 0)
- {
- delete[] ptr;
- ptr = t;
- }
-
- T & operator[](std::ptrdiff_t i) const
- {
- return ptr[i];
- }
-
- void swap(scoped_array & b)
- {
- std::swap(ptr, b.ptr);
- }
-
-private:
-
- // encapsulated object pointer
- T* ptr;
-
-};
-
-template<class T>
-inline void swap(scoped_array<T> & a, scoped_array<T> & b)
-{
- a.swap(b);
-}
-
-} // end of namespace boost
-
-#else
-# error "scoped_array.h was already included"
-#endif
-#endif // __AI_BOOST_SCOPED_ARRAY_INCLUDED
-
diff --git a/3rdparty/assimp/code/BoostWorkaround/boost/scoped_ptr.hpp b/3rdparty/assimp/code/BoostWorkaround/boost/scoped_ptr.hpp
deleted file mode 100644
index 1ddee564..00000000
--- a/3rdparty/assimp/code/BoostWorkaround/boost/scoped_ptr.hpp
+++ /dev/null
@@ -1,79 +0,0 @@
-
-#ifndef __AI_BOOST_SCOPED_PTR_INCLUDED
-#define __AI_BOOST_SCOPED_PTR_INCLUDED
-
-#ifndef BOOST_SCOPED_PTR_HPP_INCLUDED
-
-namespace boost {
-
-// small replacement for boost::scoped_ptr
-template <class T>
-class scoped_ptr
-{
-public:
-
- // provide a default construtctor
- scoped_ptr()
- : ptr(0)
- {
- }
-
- // construction from an existing heap object of type T
- scoped_ptr(T* _ptr)
- : ptr(_ptr)
- {
- }
-
- // automatic destruction of the wrapped object at the
- // end of our lifetime
- ~scoped_ptr()
- {
- delete ptr;
- }
-
- inline T* get() const
- {
- return ptr;
- }
-
- inline operator T*()
- {
- return ptr;
- }
-
- inline T* operator-> ()
- {
- return ptr;
- }
-
- inline void reset (T* t = 0)
- {
- delete ptr;
- ptr = t;
- }
-
- void swap(scoped_ptr & b)
- {
- std::swap(ptr, b.ptr);
- }
-
-private:
-
- // encapsulated object pointer
- T* ptr;
-
-};
-
-template<class T>
-inline void swap(scoped_ptr<T> & a, scoped_ptr<T> & b)
-{
- a.swap(b);
-}
-
-} // end of namespace boost
-
-#else
-# error "scoped_ptr.h was already included"
-#endif
-#endif // __AI_BOOST_SCOPED_PTR_INCLUDED
-
diff --git a/3rdparty/assimp/code/BoostWorkaround/boost/shared_array.hpp b/3rdparty/assimp/code/BoostWorkaround/boost/shared_array.hpp
deleted file mode 100644
index ad58bd0d..00000000
--- a/3rdparty/assimp/code/BoostWorkaround/boost/shared_array.hpp
+++ /dev/null
@@ -1,228 +0,0 @@
-
-#ifndef INCLUDED_AI_BOOST_SHARED_ARRAY
-#define INCLUDED_AI_BOOST_SHARED_ARRAY
-
-#ifndef BOOST_SCOPED_ARRAY_HPP_INCLUDED
-
-// ------------------------------
-// Internal stub
-namespace boost {
- namespace array_detail {
- class controller {
- public:
-
- controller()
- : cnt(1)
- {}
-
- public:
-
- template <typename T>
- controller* decref(T* pt) {
- if (--cnt <= 0) {
- delete this;
- delete[] pt;
- }
- return NULL;
- }
-
- controller* incref() {
- ++cnt;
- return this;
- }
-
- long get() const {
- return cnt;
- }
-
- private:
- long cnt;
- };
-
- struct empty {};
-
- template <typename DEST, typename SRC>
- struct is_convertible_stub {
-
- struct yes {char s[1];};
- struct no {char s[2];};
-
- static yes foo(DEST*);
- static no foo(...);
-
- enum {result = (sizeof(foo((SRC*)0)) == sizeof(yes) ? 1 : 0)};
- };
-
- template <bool> struct enable_if {};
- template <> struct enable_if<true> {
- typedef empty result;
- };
-
- template <typename DEST, typename SRC>
- struct is_convertible : public enable_if<is_convertible_stub<DEST,SRC>::result > {
- };
- }
-
-// ------------------------------
-// Small replacement for boost::shared_array, not threadsafe because no
-// atomic reference counter is in use.
-// ------------------------------
-template <class T>
-class shared_array
-{
- template <typename TT> friend class shared_array;
-
- template<class TT> friend bool operator== (const shared_array<TT>& a, const shared_array<TT>& b);
- template<class TT> friend bool operator!= (const shared_array<TT>& a, const shared_array<TT>& b);
- template<class TT> friend bool operator< (const shared_array<TT>& a, const shared_array<TT>& b);
-
-public:
-
- typedef T element_type;
-
-public:
-
- // provide a default constructor
- shared_array()
- : ptr()
- , ctr(NULL)
- {
- }
-
- // construction from an existing object of type T
- explicit shared_array(T* ptr)
- : ptr(ptr)
- , ctr(ptr ? new array_detail::controller() : NULL)
- {
- }
-
- shared_array(const shared_array& r)
- : ptr(r.ptr)
- , ctr(r.ctr ? r.ctr->incref() : NULL)
- {
- }
-
- template <typename Y>
- shared_array(const shared_array<Y>& r,typename detail::is_convertible<T,Y>::result = detail::empty())
- : ptr(r.ptr)
- , ctr(r.ctr ? r.ctr->incref() : NULL)
- {
- }
-
- // automatic destruction of the wrapped object when all
- // references are freed.
- ~shared_array() {
- if (ctr) {
- ctr = ctr->decref(ptr);
- }
- }
-
- shared_array& operator=(const shared_array& r) {
- if (this == &r) {
- return *this;
- }
- if (ctr) {
- ctr->decref(ptr);
- }
- ptr = r.ptr;
- ctr = ptr?r.ctr->incref():NULL;
- return *this;
- }
-
- template <typename Y>
- shared_array& operator=(const shared_array<Y>& r) {
- if (this == &r) {
- return *this;
- }
- if (ctr) {
- ctr->decref(ptr);
- }
- ptr = r.ptr;
- ctr = ptr?r.ctr->incref():NULL;
- return *this;
- }
-
- // pointer access
- inline operator T*() {
- return ptr;
- }
-
- inline T* operator-> () const {
- return ptr;
- }
-
- // standard semantics
- inline T* get() {
- return ptr;
- }
-
- T& operator[] (std::ptrdiff_t index) const {
- return ptr[index];
- }
-
- inline const T* get() const {
- return ptr;
- }
-
- inline operator bool () const {
- return ptr != NULL;
- }
-
- inline bool unique() const {
- return use_count() == 1;
- }
-
- inline long use_count() const {
- return ctr->get();
- }
-
- inline void reset (T* t = 0) {
- if (ctr) {
- ctr->decref(ptr);
- }
- ptr = t;
- ctr = ptr?new array_detail::controller():NULL;
- }
-
- void swap(shared_array & b) {
- std::swap(ptr, b.ptr);
- std::swap(ctr, b.ctr);
- }
-
-
-private:
-
- // encapsulated object pointer
- T* ptr;
-
- // control block
- array_detail::controller* ctr;
-};
-
-template<class T>
-inline void swap(shared_array<T> & a, shared_array<T> & b)
-{
- a.swap(b);
-}
-
-template<class T>
-bool operator== (const shared_array<T>& a, const shared_array<T>& b) {
- return a.ptr == b.ptr;
-}
-template<class T>
-bool operator!= (const shared_array<T>& a, const shared_array<T>& b) {
- return a.ptr != b.ptr;
-}
-
-template<class T>
-bool operator< (const shared_array<T>& a, const shared_array<T>& b) {
- return a.ptr < b.ptr;
-}
-
-
-} // end of namespace boost
-
-#else
-# error "shared_array.h was already included"
-#endif
-#endif // INCLUDED_AI_BOOST_SHARED_ARRAY
diff --git a/3rdparty/assimp/code/BoostWorkaround/boost/shared_ptr.hpp b/3rdparty/assimp/code/BoostWorkaround/boost/shared_ptr.hpp
deleted file mode 100644
index e5f430c2..00000000
--- a/3rdparty/assimp/code/BoostWorkaround/boost/shared_ptr.hpp
+++ /dev/null
@@ -1,257 +0,0 @@
-
-#ifndef INCLUDED_AI_BOOST_SHARED_PTR
-#define INCLUDED_AI_BOOST_SHARED_PTR
-
-#ifndef BOOST_SCOPED_PTR_HPP_INCLUDED
-
-// ------------------------------
-// Internal stub
-namespace boost {
- namespace detail {
- class controller {
- public:
-
- controller()
- : cnt(1)
- {}
-
- public:
-
- template <typename T>
- controller* decref(T* pt) {
- if (--cnt <= 0) {
- delete this;
- delete pt;
- }
- return NULL;
- }
-
- controller* incref() {
- ++cnt;
- return this;
- }
-
- long get() const {
- return cnt;
- }
-
- private:
- long cnt;
- };
-
- struct empty {};
-
- template <typename DEST, typename SRC>
- struct is_convertible_stub {
-
- struct yes {char s[1];};
- struct no {char s[2];};
-
- static yes foo(DEST*);
- static no foo(...);
-
- enum {result = (sizeof(foo((SRC*)0)) == sizeof(yes) ? 1 : 0)};
- };
-
- template <bool> struct enable_if {};
- template <> struct enable_if<true> {
- typedef empty result;
- };
-
- template <typename DEST, typename SRC>
- struct is_convertible : public enable_if<is_convertible_stub<DEST,SRC>::result > {
- };
- }
-
-// ------------------------------
-// Small replacement for boost::shared_ptr, not threadsafe because no
-// atomic reference counter is in use.
-// ------------------------------
-template <class T>
-class shared_ptr
-{
- template <typename TT> friend class shared_ptr;
-
- template<class TT, class U> friend shared_ptr<TT> static_pointer_cast (shared_ptr<U> ptr);
- template<class TT, class U> friend shared_ptr<TT> dynamic_pointer_cast (shared_ptr<U> ptr);
- template<class TT, class U> friend shared_ptr<TT> const_pointer_cast (shared_ptr<U> ptr);
-
- template<class TT> friend bool operator== (const shared_ptr<TT>& a, const shared_ptr<TT>& b);
- template<class TT> friend bool operator!= (const shared_ptr<TT>& a, const shared_ptr<TT>& b);
- template<class TT> friend bool operator< (const shared_ptr<TT>& a, const shared_ptr<TT>& b);
-
-public:
-
- typedef T element_type;
-
-public:
-
- // provide a default constructor
- shared_ptr()
- : ptr()
- , ctr(NULL)
- {
- }
-
- // construction from an existing object of type T
- explicit shared_ptr(T* ptr)
- : ptr(ptr)
- , ctr(ptr ? new detail::controller() : NULL)
- {
- }
-
- shared_ptr(const shared_ptr& r)
- : ptr(r.ptr)
- , ctr(r.ctr ? r.ctr->incref() : NULL)
- {
- }
-
- template <typename Y>
- shared_ptr(const shared_ptr<Y>& r,typename detail::is_convertible<T,Y>::result = detail::empty())
- : ptr(r.ptr)
- , ctr(r.ctr ? r.ctr->incref() : NULL)
- {
- }
-
- // automatic destruction of the wrapped object when all
- // references are freed.
- ~shared_ptr() {
- if (ctr) {
- ctr = ctr->decref(ptr);
- }
- }
-
- shared_ptr& operator=(const shared_ptr& r) {
- if (this == &r) {
- return *this;
- }
- if (ctr) {
- ctr->decref(ptr);
- }
- ptr = r.ptr;
- ctr = ptr?r.ctr->incref():NULL;
- return *this;
- }
-
- template <typename Y>
- shared_ptr& operator=(const shared_ptr<Y>& r) {
- if (this == &r) {
- return *this;
- }
- if (ctr) {
- ctr->decref(ptr);
- }
- ptr = r.ptr;
- ctr = ptr?r.ctr->incref():NULL;
- return *this;
- }
-
- // pointer access
- inline operator T*() {
- return ptr;
- }
-
- inline T* operator-> () const {
- return ptr;
- }
-
- // standard semantics
- inline T* get() {
- return ptr;
- }
-
- inline const T* get() const {
- return ptr;
- }
-
- inline operator bool () const {
- return ptr != NULL;
- }
-
- inline bool unique() const {
- return use_count() == 1;
- }
-
- inline long use_count() const {
- return ctr->get();
- }
-
- inline void reset (T* t = 0) {
- if (ctr) {
- ctr->decref(ptr);
- }
- ptr = t;
- ctr = ptr?new detail::controller():NULL;
- }
-
- void swap(shared_ptr & b) {
- std::swap(ptr, b.ptr);
- std::swap(ctr, b.ctr);
- }
-
-private:
-
-
- // for use by the various xxx_pointer_cast helper templates
- explicit shared_ptr(T* ptr, detail::controller* ctr)
- : ptr(ptr)
- , ctr(ctr->incref())
- {
- }
-
-private:
-
- // encapsulated object pointer
- T* ptr;
-
- // control block
- detail::controller* ctr;
-};
-
-template<class T>
-inline void swap(shared_ptr<T> & a, shared_ptr<T> & b)
-{
- a.swap(b);
-}
-
-template<class T>
-bool operator== (const shared_ptr<T>& a, const shared_ptr<T>& b) {
- return a.ptr == b.ptr;
-}
-template<class T>
-bool operator!= (const shared_ptr<T>& a, const shared_ptr<T>& b) {
- return a.ptr != b.ptr;
-}
-
-template<class T>
-bool operator< (const shared_ptr<T>& a, const shared_ptr<T>& b) {
- return a.ptr < b.ptr;
-}
-
-
-template<class T, class U>
-inline shared_ptr<T> static_pointer_cast( shared_ptr<U> ptr)
-{
- return shared_ptr<T>(static_cast<T*>(ptr.ptr),ptr.ctr);
-}
-
-template<class T, class U>
-inline shared_ptr<T> dynamic_pointer_cast( shared_ptr<U> ptr)
-{
- return shared_ptr<T>(dynamic_cast<T*>(ptr.ptr),ptr.ctr);
-}
-
-template<class T, class U>
-inline shared_ptr<T> const_pointer_cast( shared_ptr<U> ptr)
-{
- return shared_ptr<T>(const_cast<T*>(ptr.ptr),ptr.ctr);
-}
-
-
-
-} // end of namespace boost
-
-#else
-# error "shared_ptr.h was already included"
-#endif
-#endif // INCLUDED_AI_BOOST_SCOPED_PTR
diff --git a/3rdparty/assimp/code/BoostWorkaround/boost/static_assert.hpp b/3rdparty/assimp/code/BoostWorkaround/boost/static_assert.hpp
deleted file mode 100644
index 4b6489a7..00000000
--- a/3rdparty/assimp/code/BoostWorkaround/boost/static_assert.hpp
+++ /dev/null
@@ -1,20 +0,0 @@
-
-#ifndef AI_BOOST_STATIC_ASSERT_INCLUDED
-#define AI_BOOST_STATIC_ASSERT_INCLUDED
-
-#ifndef BOOST_STATIC_ASSERT
-
-namespace boost {
- namespace detail {
-
- template <bool b> class static_assertion_failure;
- template <> class static_assertion_failure<true> {};
- }
-}
-
-
-#define BOOST_STATIC_ASSERT(eval) \
-{boost::detail::static_assertion_failure<(eval)> assert_dummy;assert_dummy;}
-
-#endif
-#endif // !! AI_BOOST_STATIC_ASSERT_INCLUDED
diff --git a/3rdparty/assimp/code/BoostWorkaround/boost/timer.hpp b/3rdparty/assimp/code/BoostWorkaround/boost/timer.hpp
deleted file mode 100644
index df93b25f..00000000
--- a/3rdparty/assimp/code/BoostWorkaround/boost/timer.hpp
+++ /dev/null
@@ -1,72 +0,0 @@
-// boost timer.hpp header file ---------------------------------------------//
-
-// Copyright Beman Dawes 1994-99. Distributed under the Boost
-// Software License, Version 1.0. (See accompanying file
-// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-// See http://www.boost.org/libs/timer for documentation.
-
-// Revision History
-// 01 Apr 01 Modified to use new <boost/limits.hpp> header. (JMaddock)
-// 12 Jan 01 Change to inline implementation to allow use without library
-// builds. See docs for more rationale. (Beman Dawes)
-// 25 Sep 99 elapsed_max() and elapsed_min() added (John Maddock)
-// 16 Jul 99 Second beta
-// 6 Jul 99 Initial boost version
-
-#ifndef BOOST_TIMER_HPP
-#define BOOST_TIMER_HPP
-
-//#include <boost/config.hpp>
-#include <ctime>
-//#include <boost/limits.hpp>
-
-# ifdef BOOST_NO_STDC_NAMESPACE
- namespace std { using ::clock_t; using ::clock; }
-# endif
-
-
-namespace boost {
-
-// timer -------------------------------------------------------------------//
-
-// A timer object measures elapsed time.
-
-// It is recommended that implementations measure wall clock rather than CPU
-// time since the intended use is performance measurement on systems where
-// total elapsed time is more important than just process or CPU time.
-
-// Warnings: The maximum measurable elapsed time may well be only 596.5+ hours
-// due to implementation limitations. The accuracy of timings depends on the
-// accuracy of timing information provided by the underlying platform, and
-// this varies a great deal from platform to platform.
-
-class timer
-{
- public:
- timer() { _start_time = std::clock(); } // postcondition: elapsed()==0
-// timer( const timer& src ); // post: elapsed()==src.elapsed()
-// ~timer(){}
-// timer& operator=( const timer& src ); // post: elapsed()==src.elapsed()
- void restart() { _start_time = std::clock(); } // post: elapsed()==0
- double elapsed() const // return elapsed time in seconds
- { return double(std::clock() - _start_time) / CLOCKS_PER_SEC; }
-
- double elapsed_max() const // return estimated maximum value for elapsed()
- // Portability warning: elapsed_max() may return too high a value on systems
- // where std::clock_t overflows or resets at surprising values.
- {
- return (double((std::numeric_limits<std::clock_t>::max)())
- - double(_start_time)) / double(CLOCKS_PER_SEC);
- }
-
- double elapsed_min() const // return minimum value for elapsed()
- { return double(1)/double(CLOCKS_PER_SEC); }
-
- private:
- std::clock_t _start_time;
-}; // timer
-
-} // namespace boost
-
-#endif // BOOST_TIMER_HPP
diff --git a/3rdparty/assimp/code/BoostWorkaround/boost/tuple/tuple.hpp b/3rdparty/assimp/code/BoostWorkaround/boost/tuple/tuple.hpp
deleted file mode 100644
index d23f28a9..00000000
--- a/3rdparty/assimp/code/BoostWorkaround/boost/tuple/tuple.hpp
+++ /dev/null
@@ -1,285 +0,0 @@
-// A very small replacement for boost::tuple
-// (c) Alexander Gessler, 2008 [alexander.gessler@gmx.net]
-
-#ifndef BOOST_TUPLE_INCLUDED
-#define BOOST_TUPLE_INCLUDED
-
-namespace boost {
- namespace detail {
-
- // Represents an empty tuple slot (up to 5 supported)
- struct nulltype {};
-
- // For readable error messages
- struct tuple_component_idx_out_of_bounds;
-
- // To share some code for the const/nonconst versions of the getters
- template <bool b, typename T>
- struct ConstIf {
- typedef T t;
- };
-
- template <typename T>
- struct ConstIf<true,T> {
- typedef const T t;
- };
-
- // Predeclare some stuff
- template <typename, unsigned, typename, bool, unsigned> struct value_getter;
-
- // Helper to obtain the type of a tuple element
- template <typename T, unsigned NIDX, typename TNEXT, unsigned N /*= 0*/>
- struct type_getter {
- typedef type_getter<typename TNEXT::type,NIDX+1,typename TNEXT::next_type,N> next_elem_getter;
- typedef typename next_elem_getter::type type;
- };
-
- template <typename T, unsigned NIDX, typename TNEXT >
- struct type_getter <T,NIDX,TNEXT,NIDX> {
- typedef T type;
- };
-
- // Base class for all explicit specializations of list_elem
- template <typename T, unsigned NIDX, typename TNEXT >
- struct list_elem_base {
-
- // Store template parameters
- typedef TNEXT next_type;
- typedef T type;
-
- static const unsigned nidx = NIDX;
- };
-
- // Represents an element in the tuple component list
- template <typename T, unsigned NIDX, typename TNEXT >
- struct list_elem : list_elem_base<T,NIDX,TNEXT>{
-
- // Real members
- T me;
- TNEXT next;
-
- // Get the value of a specific tuple element
- template <unsigned N>
- typename type_getter<T,NIDX,TNEXT,N>::type& get () {
- value_getter <T,NIDX,TNEXT,false,N> s;
- return s(*this);
- }
-
- // Get the value of a specific tuple element
- template <unsigned N>
- const typename type_getter<T,NIDX,TNEXT,N>::type& get () const {
- value_getter <T,NIDX,TNEXT,true,N> s;
- return s(*this);
- }
-
- // Explicit cast
- template <typename T2, typename TNEXT2 >
- operator list_elem<T2,NIDX,TNEXT2> () const {
- list_elem<T2,NIDX,TNEXT2> ret;
- ret.me = (T2)me;
- ret.next = next;
- return ret;
- }
-
- // Recursively compare two elements (last element returns always true)
- bool operator == (const list_elem& s) const {
- return (me == s.me && next == s.next);
- }
- };
-
- // Represents a non-used tuple element - the very last element processed
- template <typename TNEXT, unsigned NIDX >
- struct list_elem<nulltype,NIDX,TNEXT> : list_elem_base<nulltype,NIDX,TNEXT> {
- template <unsigned N, bool IS_CONST = true> struct value_getter {
- /* just dummy members to produce readable error messages */
- tuple_component_idx_out_of_bounds operator () (typename ConstIf<IS_CONST,list_elem>::t& me);
- };
- template <unsigned N> struct type_getter {
- /* just dummy members to produce readable error messages */
- typedef tuple_component_idx_out_of_bounds type;
- };
-
- // dummy
- list_elem& operator = (const list_elem& other) {
- return *this;
- }
-
- // dummy
- bool operator == (const list_elem& other) {
- return true;
- }
- };
-
- // Represents the absolute end of the list
- typedef list_elem<nulltype,0,int> list_end;
-
- // Helper obtain to query the value of a tuple element
- // NOTE: This can't be a nested class as the compiler won't accept a full or
- // partial specialization of a nested class of a non-specialized template
- template <typename T, unsigned NIDX, typename TNEXT, bool IS_CONST, unsigned N>
- struct value_getter {
-
- // calling list_elem
- typedef list_elem<T,NIDX,TNEXT> outer_elem;
-
- // typedef for the getter for next element
- typedef value_getter<typename TNEXT::type,NIDX+1,typename TNEXT::next_type,
- IS_CONST, N> next_value_getter;
-
- typename ConstIf<IS_CONST,typename type_getter<T,NIDX,TNEXT,N>::type>::t&
- operator () (typename ConstIf<IS_CONST,outer_elem >::t& me) {
-
- next_value_getter s;
- return s(me.next);
- }
- };
-
- template <typename T, unsigned NIDX, typename TNEXT, bool IS_CONST>
- struct value_getter <T,NIDX,TNEXT,IS_CONST,NIDX> {
- typedef list_elem<T,NIDX,TNEXT> outer_elem;
-
- typename ConstIf<IS_CONST,T>::t& operator () (typename ConstIf<IS_CONST,outer_elem >::t& me) {
- return me.me;
- }
- };
- };
-
- // A very minimal implementation for up to 5 elements
- template <typename T0 = detail::nulltype,
- typename T1 = detail::nulltype,
- typename T2 = detail::nulltype,
- typename T3 = detail::nulltype,
- typename T4 = detail::nulltype>
- class tuple {
-
- template <typename T0b,
- typename T1b,
- typename T2b,
- typename T3b,
- typename T4b >
- friend class tuple;
-
- private:
-
- typedef detail::list_elem<T0,0,
- detail::list_elem<T1,1,
- detail::list_elem<T2,2,
- detail::list_elem<T3,3,
- detail::list_elem<T4,4,
- detail::list_end > > > > > very_long;
-
- very_long m;
-
- public:
-
- // Get a specific tuple element
- template <unsigned N>
- typename detail::type_getter<T0,0,typename very_long::next_type, N>::type& get () {
- return m.get<N>();
- }
-
- // ... and the const version
- template <unsigned N>
- typename const detail::type_getter<T0,0,typename very_long::next_type, N>::type& get () const {
- return m.get<N>();
- }
-
-
- // comparison operators
- bool operator== (const tuple& other) const {
- return m == other.m;
- }
-
- // ... and the other way round
- bool operator!= (const tuple& other) const {
- return !(m == other.m);
- }
-
- // cast to another tuple - all single elements must be convertible
- template < typename T0, typename T1,typename T2,
- typename T3, typename T4>
-
- operator tuple <T0,T1,T2,T3,T4> () const {
- tuple <T0,T1,T2,T3,T4> s;
- s.m = (tuple <T0,T1,T2,T3,T4>::very_long)m;
- return s;
- }
- };
-
- // Another way to access an element ...
- template <unsigned N,typename T0,typename T1,typename T2,typename T3,typename T4>
- inline typename tuple<T0,T1,T2,T3,T4>::very_long::type_getter<N>::type& get (
- tuple<T0,T1,T2,T3,T4>& m) {
- return m.get<N>();
- }
-
- // ... and the const version
- template <unsigned N,typename T0,typename T1,typename T2,typename T3,typename T4>
- inline const typename tuple<T0,T1,T2,T3,T4>::very_long::type_getter<N>::type& get (
- const tuple<T0,T1,T2,T3,T4>& m) {
- return m.get<N>();
- }
-
- // Constructs a tuple with 5 elements
- template <typename T0,typename T1,typename T2,typename T3,typename T4>
- inline tuple <T0,T1,T2,T3,T4> make_tuple (const T0& t0,
- const T1& t1,const T2& t2,const T3& t3,const T4& t4) {
-
- tuple <T0,T1,T2,T3,T4> t;
- t.get<0>() = t0;
- t.get<1>() = t1;
- t.get<2>() = t2;
- t.get<3>() = t3;
- t.get<4>() = t4;
- return t;
- }
-
- // Constructs a tuple with 4 elements
- template <typename T0,typename T1,typename T2,typename T3>
- inline tuple <T0,T1,T2,T3> make_tuple (const T0& t0,
- const T1& t1,const T2& t2,const T3& t3) {
- tuple <T0,T1,T2,T3> t;
- t.get<0>() = t0;
- t.get<1>() = t1;
- t.get<2>() = t2;
- t.get<3>() = t3;
- return t;
- }
-
- // Constructs a tuple with 3 elements
- template <typename T0,typename T1,typename T2>
- inline tuple <T0,T1,T2> make_tuple (const T0& t0,
- const T1& t1,const T2& t2) {
- tuple <T0,T1,T2> t;
- t.get<0>() = t0;
- t.get<1>() = t1;
- t.get<2>() = t2;
- return t;
- }
-
- // Constructs a tuple with 2 elements (fucking idiot, use std::pair instead!)
- template <typename T0,typename T1>
- inline tuple <T0,T1> make_tuple (const T0& t0,
- const T1& t1) {
- tuple <T0,T1> t;
- t.get<0>() = t0;
- t.get<1>() = t1;
- return t;
- }
-
- // Constructs a tuple with 1 elements (no comment ...)
- template <typename T0>
- inline tuple <T0> make_tuple (const T0& t0) {
- tuple <T0> t;
- t.get<0>() = t0;
- return t;
- }
-
- // Constructs a tuple with 0 elements (ehm? Try http://www.promillerechner.net)
- inline tuple <> make_tuple () {
- tuple <> t;
- return t;
- }
-};
-
-#endif // !! BOOST_TUPLE_INCLUDED
diff --git a/3rdparty/assimp/code/ByteSwap.h b/3rdparty/assimp/code/ByteSwap.h
deleted file mode 100644
index c61b96df..00000000
--- a/3rdparty/assimp/code/ByteSwap.h
+++ /dev/null
@@ -1,245 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file Helper class tp perform various byte oder swappings
- (e.g. little to big endian) */
-#ifndef AI_BYTESWAP_H_INC
-#define AI_BYTESWAP_H_INC
-
-#include "../include/aiAssert.h"
-#include "../include/aiTypes.h"
-
-#if _MSC_VER >= 1400
-#include <stdlib.h>
-#endif
-
-namespace Assimp {
-// --------------------------------------------------------------------------------------
-/** Defines some useful byte order swap routines.
- *
- * This is required to read big-endian model formats on little-endian machines,
- * and vice versa. Direct use of this class is DEPRECATED. Use #StreamReader instead. */
-// --------------------------------------------------------------------------------------
-class ByteSwap
-{
- ByteSwap() {}
-
-public:
-
- // ----------------------------------------------------------------------
- /** Swap two bytes of data
- * @param[inout] _szOut A void* to save the reintcasts for the caller. */
- static inline void Swap2(void* _szOut)
- {
- ai_assert(_szOut);
-
-#if _MSC_VER >= 1400
- uint16_t* const szOut = reinterpret_cast<uint16_t*>(_szOut);
- *szOut = _byteswap_ushort(*szOut);
-#else
- uint8_t* const szOut = reinterpret_cast<uint8_t*>(_szOut);
- std::swap(szOut[0],szOut[1]);
-#endif
- }
-
- // ----------------------------------------------------------------------
- /** Swap four bytes of data
- * @param[inout] _szOut A void* to save the reintcasts for the caller. */
- static inline void Swap4(void* _szOut)
- {
- ai_assert(_szOut);
-
-#if _MSC_VER >= 1400
- uint32_t* const szOut = reinterpret_cast<uint32_t*>(_szOut);
- *szOut = _byteswap_ulong(*szOut);
-#else
- uint8_t* const szOut = reinterpret_cast<uint8_t*>(_szOut);
- std::swap(szOut[0],szOut[3]);
- std::swap(szOut[1],szOut[2]);
-#endif
- }
-
- // ----------------------------------------------------------------------
- /** Swap eight bytes of data
- * @param[inout] _szOut A void* to save the reintcasts for the caller. */
- static inline void Swap8(void* _szOut)
- {
- ai_assert(_szOut);
-
-#if _MSC_VER >= 1400
- uint64_t* const szOut = reinterpret_cast<uint64_t*>(_szOut);
- *szOut = _byteswap_uint64(*szOut);
-#else
- uint8_t* const szOut = reinterpret_cast<uint8_t*>(_szOut);
- std::swap(szOut[0],szOut[7]);
- std::swap(szOut[1],szOut[6]);
- std::swap(szOut[2],szOut[5]);
- std::swap(szOut[3],szOut[4]);
-#endif
- }
-
- // ----------------------------------------------------------------------
- /** ByteSwap a float. Not a joke.
- * @param[inout] fOut ehm. .. */
- static inline void Swap(float* fOut) {
- Swap4(fOut);
- }
-
- // ----------------------------------------------------------------------
- /** ByteSwap a double. Not a joke.
- * @param[inout] fOut ehm. .. */
- static inline void Swap(double* fOut) {
- Swap8(fOut);
- }
-
-
- // ----------------------------------------------------------------------
- /** ByteSwap an int16t. Not a joke.
- * @param[inout] fOut ehm. .. */
- static inline void Swap(int16_t* fOut) {
- Swap2(fOut);
- }
-
- static inline void Swap(uint16_t* fOut) {
- Swap2(fOut);
- }
-
- // ----------------------------------------------------------------------
- /** ByteSwap an int32t. Not a joke.
- * @param[inout] fOut ehm. .. */
- static inline void Swap(int32_t* fOut){
- Swap4(fOut);
- }
-
- static inline void Swap(uint32_t* fOut){
- Swap4(fOut);
- }
-
- // ----------------------------------------------------------------------
- /** ByteSwap an int64t. Not a joke.
- * @param[inout] fOut ehm. .. */
- static inline void Swap(int64_t* fOut) {
- Swap8(fOut);
- }
-
- static inline void Swap(uint64_t* fOut) {
- Swap8(fOut);
- }
-
- // ----------------------------------------------------------------------
- //! Templatized ByteSwap
- //! \returns param tOut as swapped
- template<typename Type>
- static inline Type Swapped(Type tOut)
- {
- return _swapper<Type,sizeof(Type)>()(tOut);
- }
-
-private:
-
- template <typename T, size_t size> struct _swapper;
-};
-
-template <typename T> struct ByteSwap::_swapper<T,2> {
- T operator() (T tOut) {
- Swap2(&tOut);
- return tOut;
- }
-};
-
-template <typename T> struct ByteSwap::_swapper<T,4> {
- T operator() (T tOut) {
- Swap4(&tOut);
- return tOut;
- }
-};
-
-template <typename T> struct ByteSwap::_swapper<T,8> {
- T operator() (T tOut) {
- Swap8(&tOut);
- return tOut;
- }
-};
-
-} // Namespace Assimp
-
-
-// --------------------------------------------------------------------------------------
-// ByteSwap macros for BigEndian/LittleEndian support
-// --------------------------------------------------------------------------------------
-#if (defined AI_BUILD_BIG_ENDIAN)
-# define AI_LE(t) (t)
-# define AI_BE(t) ByteSwap::Swapped(t)
-# define AI_LSWAP2(p)
-# define AI_LSWAP4(p)
-# define AI_LSWAP8(p)
-# define AI_LSWAP2P(p)
-# define AI_LSWAP4P(p)
-# define AI_LSWAP8P(p)
-# define LE_NCONST const
-# define AI_SWAP2(p) ByteSwap::Swap2(&(p))
-# define AI_SWAP4(p) ByteSwap::Swap4(&(p))
-# define AI_SWAP8(p) ByteSwap::Swap8(&(p))
-# define AI_SWAP2P(p) ByteSwap::Swap2((p))
-# define AI_SWAP4P(p) ByteSwap::Swap4((p))
-# define AI_SWAP8P(p) ByteSwap::Swap8((p))
-# define BE_NCONST
-#else
-# define AI_BE(t) (t)
-# define AI_LE(t) ByteSwap::Swapped(t)
-# define AI_SWAP2(p)
-# define AI_SWAP4(p)
-# define AI_SWAP8(p)
-# define AI_SWAP2P(p)
-# define AI_SWAP4P(p)
-# define AI_SWAP8P(p)
-# define BE_NCONST const
-# define AI_LSWAP2(p) ByteSwap::Swap2(&(p))
-# define AI_LSWAP4(p) ByteSwap::Swap4(&(p))
-# define AI_LSWAP8(p) ByteSwap::Swap8(&(p))
-# define AI_LSWAP2P(p) ByteSwap::Swap2((p))
-# define AI_LSWAP4P(p) ByteSwap::Swap4((p))
-# define AI_LSWAP8P(p) ByteSwap::Swap8((p))
-# define LE_NCONST
-#endif
-
-
-
-#endif //!! AI_BYTESWAP_H_INC
diff --git a/3rdparty/assimp/code/COBLoader.cpp b/3rdparty/assimp/code/COBLoader.cpp
deleted file mode 100644
index 7079b359..00000000
--- a/3rdparty/assimp/code/COBLoader.cpp
+++ /dev/null
@@ -1,1278 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file COBLoader.cpp
- * @brief Implementation of the TrueSpace COB/SCN importer class.
- */
-#include "AssimpPCH.h"
-
-#ifndef ASSIMP_BUILD_NO_COB_IMPORTER
-#include "COBLoader.h"
-#include "COBScene.h"
-
-#include "StreamReader.h"
-#include "ParsingUtils.h"
-#include "fast_atof.h"
-
-#include "LineSplitter.h"
-#include "TinyFormatter.h"
-
-using namespace Assimp;
-using namespace Assimp::COB;
-using namespace Assimp::Formatter;
-
-#define for_each BOOST_FOREACH
-
-
-static const float units[] = {
- 1000.f,
- 100.f,
- 1.f,
- 0.001f,
- 1.f/0.0254f,
- 1.f/0.3048f,
- 1.f/0.9144f,
- 1.f/1609.344f
-};
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-COBImporter::COBImporter()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-COBImporter::~COBImporter()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the class can handle the format of the given file.
-bool COBImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const
-{
- const std::string& extension = GetExtension(pFile);
- if (extension == "cob" || extension == "scn") {
- return true;
- }
-
- else if ((!extension.length() || checkSig) && pIOHandler) {
- const char* tokens[] = {"Caligary"};
- return SearchFileHeaderForToken(pIOHandler,pFile,tokens,1);
- }
- return false;
-}
-
-// ------------------------------------------------------------------------------------------------
-// List all extensions handled by this loader
-void COBImporter::GetExtensionList(std::set<std::string>& app)
-{
- app.insert("cob");
- app.insert("scn");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Setup configuration properties for the loader
-void COBImporter::SetupProperties(const Importer* pImp)
-{
- // nothing to be done for the moment
-}
-
-// ------------------------------------------------------------------------------------------------
-/*static*/ void COBImporter::ThrowException(const std::string& msg)
-{
- throw DeadlyImportError("COB: "+msg);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Imports the given file into the given scene structure.
-void COBImporter::InternReadFile( const std::string& pFile,
- aiScene* pScene, IOSystem* pIOHandler)
-{
- COB::Scene scene;
- boost::scoped_ptr<StreamReaderLE> stream(new StreamReaderLE( pIOHandler->Open(pFile,"rb")) );
-
- // check header
- char head[32];
- stream->CopyAndAdvance(head,32);
- if (strncmp(head,"Caligari ",9)) {
- ThrowException("Could not found magic id: `Caligari`");
- }
-
- DefaultLogger::get()->info("File format tag: "+std::string(head+9,6));
- void (COBImporter::* load)(Scene&,StreamReaderLE*)= head[15]=='A'?&COBImporter::ReadAsciiFile:&COBImporter::ReadBinaryFile;
- if (head[16]!='L') {
- ThrowException("File is big-endian, which is not supported");
- }
-
- // load data into intermediate structures
- (this->*load)(scene,stream.get());
- if (scene.nodes.empty()) {
- ThrowException("No nodes loaded");
- }
-
- // sort faces by material indices
- for_each(boost::shared_ptr< Node >& n,scene.nodes) {
- if (n->type == Node::TYPE_MESH) {
- Mesh& mesh = (Mesh&)(*n.get());
- for_each(Face& f,mesh.faces) {
- mesh.temp_map[f.material].push_back(&f);
- }
- }
- }
-
- // count meshes
- for_each(boost::shared_ptr< Node >& n,scene.nodes) {
- if (n->type == Node::TYPE_MESH) {
- Mesh& mesh = (Mesh&)(*n.get());
- if (mesh.vertex_positions.size() && mesh.texture_coords.size()) {
- pScene->mNumMeshes += mesh.temp_map.size();
- }
- }
- }
- pScene->mMeshes = new aiMesh*[pScene->mNumMeshes]();
- pScene->mMaterials = new aiMaterial*[pScene->mNumMeshes]();
- pScene->mNumMeshes = 0;
-
- // count lights and cameras
- for_each(boost::shared_ptr< Node >& n,scene.nodes) {
- if (n->type == Node::TYPE_LIGHT) {
- ++pScene->mNumLights;
- }
- else if (n->type == Node::TYPE_CAMERA) {
- ++pScene->mNumCameras;
- }
- }
-
- if (pScene->mNumLights) {
- pScene->mLights = new aiLight*[pScene->mNumLights]();
- }
- if (pScene->mNumCameras) {
- pScene->mCameras = new aiCamera*[pScene->mNumCameras]();
- }
- pScene->mNumLights = pScene->mNumCameras = 0;
-
- // resolve parents by their IDs and build the output graph
- boost::scoped_ptr<Node> root(new Group());
- for (size_t n = 0; n < scene.nodes.size(); ++n) {
- const Node& nn = *scene.nodes[n].get();
- if (nn.parent_id==0) {
- root->temp_children.push_back(&nn);
- }
-
- for (size_t m = n; m < scene.nodes.size(); ++m) {
- const Node& mm = *scene.nodes[m].get();
- if (mm.parent_id == nn.id) {
- nn.temp_children.push_back(&mm);
- }
- }
- }
-
- pScene->mRootNode = BuildNodes(*root.get(),scene,pScene);
-}
-
-// ------------------------------------------------------------------------------------------------
-void ConvertTexture(boost::shared_ptr< Texture > tex, MaterialHelper* out, aiTextureType type)
-{
- const aiString path( tex->path );
- out->AddProperty(&path,AI_MATKEY_TEXTURE(type,0));
- out->AddProperty(&tex->transform,1,AI_MATKEY_UVTRANSFORM(type,0));
-}
-
-// ------------------------------------------------------------------------------------------------
-aiNode* COBImporter::BuildNodes(const Node& root,const Scene& scin,aiScene* fill)
-{
- aiNode* nd = new aiNode();
- nd->mName.Set(root.name);
- nd->mTransformation = root.transform;
-
- // Note to everybody believing Voodoo is appropriate here:
- // I know polymorphism, run as fast as you can ;-)
- if (Node::TYPE_MESH == root.type) {
- const Mesh& ndmesh = (const Mesh&)(root);
- if (ndmesh.vertex_positions.size() && ndmesh.texture_coords.size()) {
-
- typedef std::pair<unsigned int,Mesh::FaceRefList> Entry;
- for_each(const Entry& reflist,ndmesh.temp_map) {
- { // create mesh
- size_t n = 0;
- for_each(Face* f, reflist.second) {
- n += f->indices.size();
- }
- if (!n) {
- continue;
- }
- aiMesh* outmesh = fill->mMeshes[fill->mNumMeshes++] = new aiMesh();
- ++nd->mNumMeshes;
-
- outmesh->mVertices = new aiVector3D[n];
- outmesh->mTextureCoords[0] = new aiVector3D[n];
-
- outmesh->mFaces = new aiFace[reflist.second.size()]();
- for_each(Face* f, reflist.second) {
- if (f->indices.empty()) {
- continue;
- }
-
- aiFace& fout = outmesh->mFaces[outmesh->mNumFaces++];
- fout.mIndices = new unsigned int[f->indices.size()];
-
- for_each(VertexIndex& v, f->indices) {
- if (v.pos_idx >= ndmesh.vertex_positions.size()) {
- ThrowException("Position index out of range");
- }
- if (v.uv_idx >= ndmesh.texture_coords.size()) {
- ThrowException("UV index out of range");
- }
- outmesh->mVertices[outmesh->mNumVertices] = ndmesh.vertex_positions[ v.pos_idx ];
- outmesh->mTextureCoords[0][outmesh->mNumVertices] = aiVector3D(
- ndmesh.texture_coords[ v.uv_idx ].x,
- ndmesh.texture_coords[ v.uv_idx ].y,
- 0.f
- );
-
- fout.mIndices[fout.mNumIndices++] = outmesh->mNumVertices++;
- }
- }
- outmesh->mMaterialIndex = fill->mNumMaterials;
- }{ // create material
- const Material* min = NULL;
- for_each(const Material& m, scin.materials) {
- if (m.parent_id == ndmesh.id && m.matnum == reflist.first) {
- min = &m;
- break;
- }
- }
- boost::scoped_ptr<const Material> defmat;
- if (!min) {
- DefaultLogger::get()->debug(format()<<"Could not resolve material index "
- <<reflist.first<<" - creating default material for this slot");
-
- defmat.reset(min=new Material());
- }
-
- MaterialHelper* mat = new MaterialHelper();
- fill->mMaterials[fill->mNumMaterials++] = mat;
-
- const aiString s(format("#mat_")<<fill->mNumMeshes<<"_"<<min->matnum);
- mat->AddProperty(&s,AI_MATKEY_NAME);
-
- if (int tmp = ndmesh.draw_flags & Mesh::WIRED ? 1 : 0) {
- mat->AddProperty(&tmp,1,AI_MATKEY_ENABLE_WIREFRAME);
- }
-
- { int shader;
- switch(min->shader)
- {
- case Material::FLAT:
- shader = aiShadingMode_Gouraud;
- break;
-
- case Material::PHONG:
- shader = aiShadingMode_Phong;
- break;
-
- case Material::METAL:
- shader = aiShadingMode_CookTorrance;
- break;
-
- default:
- ai_assert(false); // shouldn't be here
- }
- mat->AddProperty(&shader,1,AI_MATKEY_SHADING_MODEL);
- if (shader != aiShadingMode_Gouraud) {
- mat->AddProperty(&min->exp,1,AI_MATKEY_SHININESS);
- }
- }
-
- mat->AddProperty(&min->ior,1,AI_MATKEY_REFRACTI);
- mat->AddProperty(&min->rgb,1,AI_MATKEY_COLOR_DIFFUSE);
-
- aiColor3D c = aiColor3D(min->rgb)*min->ks;
- mat->AddProperty(&c,1,AI_MATKEY_COLOR_SPECULAR);
-
- c = aiColor3D(min->rgb)*min->ka;
- mat->AddProperty(&c,1,AI_MATKEY_COLOR_AMBIENT);
-
- // convert textures if some exist.
- if (min->tex_color) {
- ConvertTexture(min->tex_color,mat,aiTextureType_DIFFUSE);
- }
- if (min->tex_env) {
- ConvertTexture(min->tex_env ,mat,aiTextureType_UNKNOWN);
- }
- if (min->tex_bump) {
- ConvertTexture(min->tex_bump ,mat,aiTextureType_HEIGHT);
- }
- }
- }
- }
- }
- else if (Node::TYPE_LIGHT == root.type) {
- const Light& ndlight = (const Light&)(root);
- aiLight* outlight = fill->mLights[fill->mNumLights++] = new aiLight();
-
- outlight->mName.Set(ndlight.name);
- outlight->mColorDiffuse = outlight->mColorAmbient = outlight->mColorSpecular = ndlight.color;
-
- outlight->mAngleOuterCone = AI_DEG_TO_RAD(ndlight.angle);
- outlight->mAngleInnerCone = AI_DEG_TO_RAD(ndlight.inner_angle);
-
- // XXX
- outlight->mType = ndlight.ltype==Light::SPOT ? aiLightSource_SPOT : aiLightSource_DIRECTIONAL;
- }
- else if (Node::TYPE_CAMERA == root.type) {
- const Camera& ndcam = (const Camera&)(root);
- aiCamera* outcam = fill->mCameras[fill->mNumCameras++] = new aiCamera();
-
- outcam->mName.Set(ndcam.name);
- }
-
- // add meshes
- if (nd->mNumMeshes) { // mMeshes must be NULL if count is 0
- nd->mMeshes = new unsigned int[nd->mNumMeshes];
- for (unsigned int i = 0; i < nd->mNumMeshes;++i) {
- nd->mMeshes[i] = fill->mNumMeshes-i-1;
- }
- }
-
- // add children recursively
- nd->mChildren = new aiNode*[root.temp_children.size()]();
- for_each(const Node* n, root.temp_children) {
- (nd->mChildren[nd->mNumChildren++] = BuildNodes(*n,scin,fill))->mParent = nd;
- }
-
- return nd;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Read an ASCII file into the given scene data structure
-void COBImporter::ReadAsciiFile(Scene& out, StreamReaderLE* stream)
-{
- ChunkInfo ci;
- for (LineSplitter splitter(*stream);splitter;++splitter) {
-
- // add all chunks to be recognized here. /else ../ ommitted intentionally.
- if (splitter.match_start("PolH ")) {
- ReadChunkInfo_Ascii(ci,splitter);
- ReadPolH_Ascii(out,splitter,ci);
- }
- if (splitter.match_start("BitM ")) {
- ReadChunkInfo_Ascii(ci,splitter);
- ReadBitM_Ascii(out,splitter,ci);
- }
- if (splitter.match_start("Mat1 ")) {
- ReadChunkInfo_Ascii(ci,splitter);
- ReadMat1_Ascii(out,splitter,ci);
- }
- if (splitter.match_start("Grou ")) {
- ReadChunkInfo_Ascii(ci,splitter);
- ReadGrou_Ascii(out,splitter,ci);
- }
- if (splitter.match_start("Lght ")) {
- ReadChunkInfo_Ascii(ci,splitter);
- ReadLght_Ascii(out,splitter,ci);
- }
- if (splitter.match_start("Came ")) {
- ReadChunkInfo_Ascii(ci,splitter);
- ReadCame_Ascii(out,splitter,ci);
- }
- if (splitter.match_start("Bone ")) {
- ReadChunkInfo_Ascii(ci,splitter);
- ReadBone_Ascii(out,splitter,ci);
- }
- if (splitter.match_start("Chan ")) {
- ReadChunkInfo_Ascii(ci,splitter);
- ReadChan_Ascii(out,splitter,ci);
- }
- if (splitter.match_start("Unit ")) {
- ReadChunkInfo_Ascii(ci,splitter);
- ReadUnit_Ascii(out,splitter,ci);
- }
- if (splitter.match_start("END ")) {
- // we don't need this, but I guess there is a reason this
- // chunk has been implemented into COB for.
- return;
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void COBImporter::ReadChunkInfo_Ascii(ChunkInfo& out, const LineSplitter& splitter)
-{
- const char* all_tokens[8];
- splitter.get_tokens(all_tokens);
-
- out.version = (all_tokens[1][1]-'0')*100+(all_tokens[1][3]-'0')*10+(all_tokens[1][4]-'0');
- out.id = strtol10(all_tokens[3]);
- out.parent_id = strtol10(all_tokens[5]);
- out.size = strtol10s(all_tokens[7]);
-}
-
-// ------------------------------------------------------------------------------------------------
-void COBImporter::UnsupportedChunk_Ascii(LineSplitter& splitter, const ChunkInfo& nfo, const char* name)
-{
- const std::string error = format("Encountered unsupported chunk: ") << name <<
- " [version: "<<nfo.version<<", size: "<<nfo.size<<"]";
-
- // we can recover if the chunk size was specified.
- if (nfo.size != static_cast<unsigned int>(-1)) {
- DefaultLogger::get()->error(error);
-
- // (HACK) - our current position in the stream is the beginning of the
- // head line of the next chunk. That's fine, but the caller is going
- // to call ++ on `splitter`, which we need to swallow to avoid
- // missing the next line.
- splitter.get_stream().IncPtr(nfo.size);
- splitter.swallow_next_increment();
- }
- else ThrowException(error);
-}
-
-// ------------------------------------------------------------------------------------------------
-void COBImporter::LogWarn_Ascii(const LineSplitter& splitter, const format& message) {
- LogWarn_Ascii(message << " [at line "<< splitter.get_index()<<"]");
-}
-
-// ------------------------------------------------------------------------------------------------
-void COBImporter::LogError_Ascii(const LineSplitter& splitter, const format& message) {
- LogError_Ascii(message << " [at line "<< splitter.get_index()<<"]");
-}
-
-// ------------------------------------------------------------------------------------------------
-void COBImporter::LogInfo_Ascii(const LineSplitter& splitter, const format& message) {
- LogInfo_Ascii(message << " [at line "<< splitter.get_index()<<"]");
-}
-
-// ------------------------------------------------------------------------------------------------
-void COBImporter::LogDebug_Ascii(const LineSplitter& splitter, const format& message) {
- LogDebug_Ascii(message << " [at line "<< splitter.get_index()<<"]");
-}
-
-// ------------------------------------------------------------------------------------------------
-void COBImporter::LogWarn_Ascii(const Formatter::format& message) {
- DefaultLogger::get()->warn(std::string("COB: ")+=message);
-}
-
-// ------------------------------------------------------------------------------------------------
-void COBImporter::LogError_Ascii(const Formatter::format& message) {
- DefaultLogger::get()->error(std::string("COB: ")+=message);
-}
-
-// ------------------------------------------------------------------------------------------------
-void COBImporter::LogInfo_Ascii(const Formatter::format& message) {
- DefaultLogger::get()->info(std::string("COB: ")+=message);
-}
-
-// ------------------------------------------------------------------------------------------------
-void COBImporter::LogDebug_Ascii(const Formatter::format& message) {
- DefaultLogger::get()->debug(std::string("COB: ")+=message);
-}
-
-// ------------------------------------------------------------------------------------------------
-void COBImporter::ReadBasicNodeInfo_Ascii(Node& msh, LineSplitter& splitter, const ChunkInfo& nfo)
-{
- for (;splitter;++splitter) {
- if (splitter.match_start("Name")) {
- msh.name = std::string(splitter[1]);
-
- // make nice names by merging the dupe count
- std::replace(msh.name.begin(),msh.name.end(),
- ',','_');
- }
- else if (splitter.match_start("Transform")) {
- for (unsigned int y = 0; y < 4 && ++splitter; ++y) {
- const char* s = splitter->c_str();
- for (unsigned int x = 0; x < 4; ++x) {
- SkipSpaces(&s);
- msh.transform[y][x] = fast_atof(&s);
- }
- }
- // we need the transform chunk, so we won't return until we have it.
- return;
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-template <typename T>
-void COBImporter::ReadFloat3Tuple_Ascii(T& fill, const char** in)
-{
- const char* rgb = *in;
- for (unsigned int i = 0; i < 3; ++i) {
- SkipSpaces(&rgb);
- if (*rgb == ',')++rgb;
- SkipSpaces(&rgb);
-
- fill[i] = fast_atof(&rgb);
- }
- *in = rgb;
-}
-
-// ------------------------------------------------------------------------------------------------
-void COBImporter::ReadMat1_Ascii(Scene& out, LineSplitter& splitter, const ChunkInfo& nfo)
-{
- if (nfo.version > 8) {
- return UnsupportedChunk_Ascii(splitter,nfo,"Mat1");
- }
-
- ++splitter;
- if (!splitter.match_start("mat# ")) {
- LogWarn_Ascii(splitter,format()<<
- "Expected `mat#` line in `Mat1` chunk "<<nfo.id);
- return;
- }
-
- out.materials.push_back(Material());
- Material& mat = out.materials.back();
- mat = nfo;
-
- mat.matnum = strtol10(splitter[1]);
- ++splitter;
-
- if (!splitter.match_start("shader: ")) {
- LogWarn_Ascii(splitter,format()<<
- "Expected `mat#` line in `Mat1` chunk "<<nfo.id);
- return;
- }
- std::string shader = std::string(splitter[1]);
- shader = shader.substr(0,shader.find_first_of(" \t"));
-
- if (shader == "metal") {
- mat.shader = Material::METAL;
- }
- else if (shader == "phong") {
- mat.shader = Material::PHONG;
- }
- else if (shader != "flat") {
- LogWarn_Ascii(splitter,format()<<
- "Unknown value for `shader` in `Mat1` chunk "<<nfo.id);
- }
-
- ++splitter;
- if (!splitter.match_start("rgb ")) {
- LogWarn_Ascii(splitter,format()<<
- "Expected `rgb` line in `Mat1` chunk "<<nfo.id);
- }
-
- const char* rgb = splitter[1];
- ReadFloat3Tuple_Ascii(mat.rgb,&rgb);
-
- ++splitter;
- if (!splitter.match_start("alpha ")) {
- LogWarn_Ascii(splitter,format()<<
- "Expected `alpha` line in `Mat1` chunk "<<nfo.id);
- }
-
- const char* tokens[10];
- splitter.get_tokens(tokens);
-
- mat.alpha = fast_atof( tokens[1] );
- mat.ka = fast_atof( tokens[3] );
- mat.ks = fast_atof( tokens[5] );
- mat.exp = fast_atof( tokens[7] );
- mat.ior = fast_atof( tokens[9] );
-}
-
-// ------------------------------------------------------------------------------------------------
-void COBImporter::ReadUnit_Ascii(Scene& out, LineSplitter& splitter, const ChunkInfo& nfo)
-{
- if (nfo.version > 1) {
- return UnsupportedChunk_Ascii(splitter,nfo,"Unit");
- }
- ++splitter;
- if (!splitter.match_start("Units ")) {
- LogWarn_Ascii(splitter,format()<<
- "Expected `Units` line in `Unit` chunk "<<nfo.id);
- return;
- }
-
- // parent chunks preceede their childs, so we should have the
- // corresponding chunk already.
- for_each(boost::shared_ptr< Node >& nd, out.nodes) {
- if (nd->id == nfo.parent_id) {
- const unsigned int t=strtol10(splitter[1]);
-
- nd->unit_scale = t>=sizeof(units)/sizeof(units[0])?(
- LogWarn_Ascii(splitter,format()<<t<<" is not a valid value for `Units` attribute in `Unit chunk` "<<nfo.id)
- ,1.f):units[t];
- return;
- }
- }
- LogWarn_Ascii(splitter,format()<<"`Unit` chunk "<<nfo.id<<" is a child of "
- <<nfo.parent_id<<" which does not exist");
-}
-
-// ------------------------------------------------------------------------------------------------
-void COBImporter::ReadChan_Ascii(Scene& out, LineSplitter& splitter, const ChunkInfo& nfo)
-{
- if (nfo.version > 8) {
- return UnsupportedChunk_Ascii(splitter,nfo,"Chan");
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void COBImporter::ReadLght_Ascii(Scene& out, LineSplitter& splitter, const ChunkInfo& nfo)
-{
- if (nfo.version > 8) {
- return UnsupportedChunk_Ascii(splitter,nfo,"Lght");
- }
-
- out.nodes.push_back(boost::shared_ptr<Light>(new Light()));
- Light& msh = (Light&)(*out.nodes.back().get());
- msh = nfo;
-
- ReadBasicNodeInfo_Ascii(msh,++splitter,nfo);
-
- if (splitter.match_start("Infinite ")) {
- msh.ltype = Light::INFINITE;
- }
- else if (splitter.match_start("Local ")) {
- msh.ltype = Light::LOCAL;
- }
- else if (splitter.match_start("Spot ")) {
- msh.ltype = Light::SPOT;
- }
- else {
- LogWarn_Ascii(splitter,format()<<
- "Unknown kind of light source in `Lght` chunk "<<nfo.id<<" : "<<*splitter);
- msh.ltype = Light::SPOT;
- }
-
- ++splitter;
- if (!splitter.match_start("color ")) {
- LogWarn_Ascii(splitter,format()<<
- "Expected `color` line in `Lght` chunk "<<nfo.id);
- }
-
- const char* rgb = splitter[1];
- ReadFloat3Tuple_Ascii(msh.color ,&rgb);
-
- SkipSpaces(&rgb);
- if (strncmp(rgb,"cone angle",10)) {
- LogWarn_Ascii(splitter,format()<<
- "Expected `cone angle` entity in `color` line in `Lght` chunk "<<nfo.id);
- }
- SkipSpaces(rgb+10,&rgb);
- msh.angle = fast_atof(&rgb);
-
- SkipSpaces(&rgb);
- if (strncmp(rgb,"inner angle",11)) {
- LogWarn_Ascii(splitter,format()<<
- "Expected `inner angle` entity in `color` line in `Lght` chunk "<<nfo.id);
- }
- SkipSpaces(rgb+11,&rgb);
- msh.inner_angle = fast_atof(&rgb);
-
- // skip the rest for we can't handle this kind of physically-based lighting information.
-}
-
-// ------------------------------------------------------------------------------------------------
-void COBImporter::ReadCame_Ascii(Scene& out, LineSplitter& splitter, const ChunkInfo& nfo)
-{
- if (nfo.version > 2) {
- return UnsupportedChunk_Ascii(splitter,nfo,"Came");
- }
-
- out.nodes.push_back(boost::shared_ptr<Camera>(new Camera()));
- Camera& msh = (Camera&)(*out.nodes.back().get());
- msh = nfo;
-
- ReadBasicNodeInfo_Ascii(msh,++splitter,nfo);
-
- // skip the next line, we don't know this differenciation between a
- // standard camera and a panoramic camera.
- ++splitter;
-}
-
-// ------------------------------------------------------------------------------------------------
-void COBImporter::ReadBone_Ascii(Scene& out, LineSplitter& splitter, const ChunkInfo& nfo)
-{
- if (nfo.version > 5) {
- return UnsupportedChunk_Ascii(splitter,nfo,"Bone");
- }
-
- out.nodes.push_back(boost::shared_ptr<Bone>(new Bone()));
- Bone& msh = (Bone&)(*out.nodes.back().get());
- msh = nfo;
-
- ReadBasicNodeInfo_Ascii(msh,++splitter,nfo);
-
- // TODO
-}
-
-// ------------------------------------------------------------------------------------------------
-void COBImporter::ReadGrou_Ascii(Scene& out, LineSplitter& splitter, const ChunkInfo& nfo)
-{
- if (nfo.version > 1) {
- return UnsupportedChunk_Ascii(splitter,nfo,"Grou");
- }
-
- out.nodes.push_back(boost::shared_ptr<Group>(new Group()));
- Group& msh = (Group&)(*out.nodes.back().get());
- msh = nfo;
-
- ReadBasicNodeInfo_Ascii(msh,++splitter,nfo);
-}
-
-// ------------------------------------------------------------------------------------------------
-void COBImporter::ReadPolH_Ascii(Scene& out, LineSplitter& splitter, const ChunkInfo& nfo)
-{
- if (nfo.version > 8) {
- return UnsupportedChunk_Ascii(splitter,nfo,"PolH");
- }
-
- out.nodes.push_back(boost::shared_ptr<Mesh>(new Mesh()));
- Mesh& msh = (Mesh&)(*out.nodes.back().get());
- msh = nfo;
-
- ReadBasicNodeInfo_Ascii(msh,++splitter,nfo);
-
- // the chunk has a fixed order of components, but some are not interesting of us so
- // we're just looking for keywords in arbitrary order. The end of the chunk is
- // either the last `Face` or the `DrawFlags` attribute, depending on the format ver.
- for (;splitter;++splitter) {
- if (splitter.match_start("World Vertices")) {
- const unsigned int cnt = strtol10(splitter[2]);
- msh.vertex_positions.resize(cnt);
-
- for (unsigned int cur = 0;cur < cnt && ++splitter;++cur) {
- const char* s = splitter->c_str();
-
- aiVector3D& v = msh.vertex_positions[cur];
-
- SkipSpaces(&s);
- v.x = fast_atof(&s);
- SkipSpaces(&s);
- v.y = fast_atof(&s);
- SkipSpaces(&s);
- v.z = fast_atof(&s);
- }
- }
- else if (splitter.match_start("Texture Vertices")) {
- const unsigned int cnt = strtol10(splitter[2]);
- msh.texture_coords.resize(cnt);
-
- for (unsigned int cur = 0;cur < cnt && ++splitter;++cur) {
- const char* s = splitter->c_str();
-
- aiVector2D& v = msh.texture_coords[cur];
-
- SkipSpaces(&s);
- v.x = fast_atof(&s);
- SkipSpaces(&s);
- v.y = fast_atof(&s);
- }
- }
- else if (splitter.match_start("Faces")) {
- const unsigned int cnt = strtol10(splitter[1]);
- msh.faces.reserve(cnt);
-
- for (unsigned int cur = 0; cur < cnt && ++splitter ;++cur) {
- if (splitter.match_start("Hole")) {
- LogWarn_Ascii(splitter,"Skipping unsupported `Hole` line");
- continue;
- }
-
- if (!splitter.match_start("Face")) {
- ThrowException("Expected Face line");
- }
-
- msh.faces.push_back(Face());
- Face& face = msh.faces.back();
-
- face.indices.resize(strtol10(splitter[2]));
- face.flags = strtol10(splitter[4]);
- face.material = strtol10(splitter[6]);
-
- const char* s = (++splitter)->c_str();
- for (size_t i = 0; i < face.indices.size(); ++i) {
- if (!SkipSpaces(&s)) {
- ThrowException("Expected EOL token in Face entry");
- }
- if ('<' != *s++) {
- ThrowException("Expected < token in Face entry");
- }
- face.indices[i].pos_idx = strtol10(s,&s);
- if (',' != *s++) {
- ThrowException("Expected , token in Face entry");
- }
- face.indices[i].uv_idx = strtol10(s,&s);
- if ('>' != *s++) {
- ThrowException("Expected < token in Face entry");
- }
- }
- }
- if (nfo.version <= 4) {
- break;
- }
- }
- else if (splitter.match_start("DrawFlags")) {
- msh.draw_flags = strtol10(splitter[1]);
- break;
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void COBImporter::ReadBitM_Ascii(Scene& out, LineSplitter& splitter, const ChunkInfo& nfo)
-{
- if (nfo.version > 1) {
- return UnsupportedChunk_Ascii(splitter,nfo,"BitM");
- }
-/*
- "\nThumbNailHdrSize %ld"
- "\nThumbHeader: %02hx 02hx %02hx "
- "\nColorBufSize %ld"
- "\nColorBufZipSize %ld"
- "\nZippedThumbnail: %02hx 02hx %02hx "
-*/
-
- const unsigned int head = strtol10((++splitter)[1]);
- if (head != sizeof(Bitmap::BitmapHeader)) {
- LogWarn_Ascii(splitter,"Unexpected ThumbNailHdrSize, skipping this chunk");
- return;
- }
-
- /*union {
- Bitmap::BitmapHeader data;
- char opaq[sizeof Bitmap::BitmapHeader()];
- };*/
-// ReadHexOctets(opaq,head,(++splitter)[1]);
-}
-
-// ------------------------------------------------------------------------------------------------
-void COBImporter::ReadString_Binary(std::string& out, StreamReaderLE& reader)
-{
- out.resize( reader.GetI2());
- for_each(char& c,out) {
- c = reader.GetI1();
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void COBImporter::ReadBasicNodeInfo_Binary(Node& msh, StreamReaderLE& reader, const ChunkInfo& nfo)
-{
- const unsigned int dupes = reader.GetI2();
- ReadString_Binary(msh.name,reader);
-
- msh.name = format(msh.name)<<'_'<<dupes;
-
- // skip local axes for the moment
- reader.IncPtr(48);
-
- msh.transform = aiMatrix4x4();
- for (unsigned int y = 0; y < 3; ++y) {
- for (unsigned int x =0; x < 4; ++x) {
- msh.transform[y][x] = reader.GetF4();
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void COBImporter::UnsupportedChunk_Binary( StreamReaderLE& reader, const ChunkInfo& nfo, const char* name)
-{
- const std::string error = format("Encountered unsupported chunk: ") << name <<
- " [version: "<<nfo.version<<", size: "<<nfo.size<<"]";
-
- // we can recover if the chunk size was specified.
- if (nfo.size != static_cast<unsigned int>(-1)) {
- DefaultLogger::get()->error(error);
- reader.IncPtr(nfo.size);
- }
- else ThrowException(error);
-}
-
-// ------------------------------------------------------------------------------------------------
-// tiny utility guard to aid me at staying within chunk boundaries.
-class chunk_guard {
-
-public:
-
- chunk_guard(const COB::ChunkInfo& nfo, StreamReaderLE& reader)
- : nfo(nfo)
- , reader(reader)
- , cur(reader.GetCurrentPos())
- {
- }
-
- ~chunk_guard() {
- // don't do anything if the size is not given
- if (nfo.size != static_cast<unsigned int>(-1)) {
- reader.IncPtr(static_cast<int>(nfo.size)-reader.GetCurrentPos()+cur);
- }
- }
-
-private:
-
- const COB::ChunkInfo& nfo;
- StreamReaderLE& reader;
- long cur;
-};
-
-// ------------------------------------------------------------------------------------------------
-void COBImporter::ReadBinaryFile(Scene& out, StreamReaderLE* reader)
-{
- while (1) {
- std::string type;
- type += reader -> GetI1()
- ,type += reader -> GetI1()
- ,type += reader -> GetI1()
- ,type += reader -> GetI1()
- ;
-
- ChunkInfo nfo;
- nfo.version = reader -> GetI2()*10;
- nfo.version += reader -> GetI2();
-
- nfo.id = reader->GetI4();
- nfo.parent_id = reader->GetI4();
- nfo.size = reader->GetI4();
-
- if (type == "PolH") {
- ReadPolH_Binary(out,*reader,nfo);
- }
- else if (type == "BitM") {
- ReadBitM_Binary(out,*reader,nfo);
- }
- else if (type == "Grou") {
- ReadGrou_Binary(out,*reader,nfo);
- }
- else if (type == "Lght") {
- ReadLght_Binary(out,*reader,nfo);
- }
- else if (type == "Came") {
- ReadCame_Binary(out,*reader,nfo);
- }
- else if (type == "Mat1") {
- ReadMat1_Binary(out,*reader,nfo);
- }
- /* else if (type == "Bone") {
- ReadBone_Binary(out,*reader,nfo);
- }
- else if (type == "Chan") {
- ReadChan_Binary(out,*reader,nfo);
- }*/
- else if (type == "Unit") {
- ReadUnit_Binary(out,*reader,nfo);
- }
- else if (type == "OLay") {
- // ignore layer index silently.
- if (nfo.size != static_cast<unsigned int>(-1) ) {
- reader->IncPtr(nfo.size);
- }
- else return UnsupportedChunk_Binary(*reader,nfo,type.c_str());
- }
- else if (type == "END ") {
- return;
- }
- else UnsupportedChunk_Binary(*reader,nfo,type.c_str());
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void COBImporter::ReadPolH_Binary(COB::Scene& out, StreamReaderLE& reader, const ChunkInfo& nfo)
-{
- if (nfo.version > 8) {
- return UnsupportedChunk_Binary(reader,nfo,"PolH");
- }
- const chunk_guard cn(nfo,reader);
-
- out.nodes.push_back(boost::shared_ptr<Mesh>(new Mesh()));
- Mesh& msh = (Mesh&)(*out.nodes.back().get());
- msh = nfo;
-
- ReadBasicNodeInfo_Binary(msh,reader,nfo);
-
- msh.vertex_positions.resize(reader.GetI4());
- for_each(aiVector3D& v,msh.vertex_positions) {
- v.x = reader.GetF4();
- v.y = reader.GetF4();
- v.z = reader.GetF4();
- }
-
- msh.texture_coords.resize(reader.GetI4());
- for_each(aiVector2D& v,msh.texture_coords) {
- v.x = reader.GetF4();
- v.y = reader.GetF4();
- }
-
- const size_t numfuck = reader.GetI4();
- msh.faces.reserve(numfuck);
- for (size_t i = 0; i < numfuck; ++i) {
- // XXX backface culling flag is 0x10 in flags
-
- // hole?
- bool hole;
- if ((hole = (reader.GetI1() & 0x08) != 0)) {
- // XXX Basically this should just work fine - then triangulator
- // should output properly triangulated data even for polygons
- // with holes. Test data specific to COB is needed to confirm it.
- if (msh.faces.empty()) {
- ThrowException(format("A hole is the first entity in the `PolH` chunk with id ") << nfo.id);
- }
- }
- else msh.faces.push_back(Face());
- Face& f = msh.faces.back();
-
- const size_t num = reader.GetI2();
- f.indices.reserve(f.indices.size() + num);
-
- if (!hole) {
- f.material = reader.GetI2();
- f.flags = 0;
- }
-
- for (size_t x = 0; x < num; ++x) {
- f.indices.push_back(VertexIndex());
-
- VertexIndex& v = f.indices.back();
- v.pos_idx = reader.GetI4();
- v.uv_idx = reader.GetI4();
- }
-
- if (hole) {
- std::reverse(f.indices.rbegin(),f.indices.rbegin()+num);
- }
- }
- if (nfo.version>4) {
- msh.draw_flags = reader.GetI4();
- }
- nfo.version>5 && nfo.version<8 ? reader.GetI4() : 0;
-}
-
-// ------------------------------------------------------------------------------------------------
-void COBImporter::ReadBitM_Binary(COB::Scene& out, StreamReaderLE& reader, const ChunkInfo& nfo)
-{
- if (nfo.version > 1) {
- return UnsupportedChunk_Binary(reader,nfo,"BitM");
- }
-
- const chunk_guard cn(nfo,reader);
-
- const uint32_t len = reader.GetI4();
- reader.IncPtr(len);
-
- reader.GetI4();
- reader.IncPtr(reader.GetI4());
-}
-
-// ------------------------------------------------------------------------------------------------
-void COBImporter::ReadMat1_Binary(COB::Scene& out, StreamReaderLE& reader, const ChunkInfo& nfo)
-{
- if (nfo.version > 8) {
- return UnsupportedChunk_Binary(reader,nfo,"Mat1");
- }
-
- const chunk_guard cn(nfo,reader);
-
- out.materials.push_back(Material());
- Material& mat = out.materials.back();
- mat = nfo;
-
- mat.matnum = reader.GetI2();
- switch(reader.GetI1()) {
- case 'f':
- mat.type = Material::FLAT;
- break;
- case 'p':
- mat.type = Material::PHONG;
- break;
- case 'm':
- mat.type = Material::METAL;
- break;
- default:
- LogError_Ascii(format("Unrecognized shader type in `Mat1` chunk with id ")<<nfo.id);
- mat.type = Material::FLAT;
- }
-
- switch(reader.GetI1()) {
- case 'f':
- mat.autofacet = Material::FACETED;
- break;
- case 'a':
- mat.autofacet = Material::AUTOFACETED;
- break;
- case 's':
- mat.autofacet = Material::SMOOTH;
- break;
- default:
- LogError_Ascii(format("Unrecognized faceting mode in `Mat1` chunk with id ")<<nfo.id);
- mat.autofacet = Material::FACETED;
- }
- mat.autofacet_angle = static_cast<float>(reader.GetI1());
-
- mat.rgb.r = reader.GetF4();
- mat.rgb.g = reader.GetF4();
- mat.rgb.b = reader.GetF4();
-
- mat.alpha = reader.GetF4();
- mat.ka = reader.GetF4();
- mat.ks = reader.GetF4();
- mat.exp = reader.GetF4();
- mat.ior = reader.GetF4();
-
- char id[2];
- id[0] = reader.GetI1(),id[1] = reader.GetI1();
-
- if (id[0] == 'e' && id[1] == ':') {
- mat.tex_env.reset(new Texture());
-
- reader.GetI1();
- ReadString_Binary(mat.tex_env->path,reader);
-
- // advance to next texture-id
- id[0] = reader.GetI1(),id[1] = reader.GetI1();
- }
-
- if (id[0] == 't' && id[1] == ':') {
- mat.tex_color.reset(new Texture());
-
- reader.GetI1();
- ReadString_Binary(mat.tex_color->path,reader);
-
- mat.tex_color->transform.mTranslation.x = reader.GetF4();
- mat.tex_color->transform.mTranslation.y = reader.GetF4();
-
- mat.tex_color->transform.mScaling.x = reader.GetF4();
- mat.tex_color->transform.mScaling.y = reader.GetF4();
-
- // advance to next texture-id
- id[0] = reader.GetI1(),id[1] = reader.GetI1();
- }
-
- if (id[0] == 'b' && id[1] == ':') {
- mat.tex_bump.reset(new Texture());
-
- reader.GetI1();
- ReadString_Binary(mat.tex_bump->path,reader);
-
- mat.tex_bump->transform.mTranslation.x = reader.GetF4();
- mat.tex_bump->transform.mTranslation.y = reader.GetF4();
-
- mat.tex_bump->transform.mScaling.x = reader.GetF4();
- mat.tex_bump->transform.mScaling.y = reader.GetF4();
-
- // skip amplitude for I don't know its purpose.
- reader.GetF4();
- }
- reader.IncPtr(-2);
-}
-
-// ------------------------------------------------------------------------------------------------
-void COBImporter::ReadCame_Binary(COB::Scene& out, StreamReaderLE& reader, const ChunkInfo& nfo)
-{
- if (nfo.version > 2) {
- return UnsupportedChunk_Binary(reader,nfo,"Came");
- }
-
- const chunk_guard cn(nfo,reader);
-
- out.nodes.push_back(boost::shared_ptr<Camera>(new Camera()));
- Camera& msh = (Camera&)(*out.nodes.back().get());
- msh = nfo;
-
- ReadBasicNodeInfo_Binary(msh,reader,nfo);
-
- // the rest is not interesting for us, so we skip over it.
- if (nfo.version > 1) {
- if (reader.GetI2()==512) {
- reader.IncPtr(42);
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void COBImporter::ReadLght_Binary(COB::Scene& out, StreamReaderLE& reader, const ChunkInfo& nfo)
-{
- if (nfo.version > 2) {
- return UnsupportedChunk_Binary(reader,nfo,"Lght");
- }
-
- const chunk_guard cn(nfo,reader);
-
- out.nodes.push_back(boost::shared_ptr<Light>(new Light()));
- Light& msh = (Light&)(*out.nodes.back().get());
- msh = nfo;
-
- ReadBasicNodeInfo_Binary(msh,reader,nfo);
-}
-
-// ------------------------------------------------------------------------------------------------
-void COBImporter::ReadGrou_Binary(COB::Scene& out, StreamReaderLE& reader, const ChunkInfo& nfo)
-{
- if (nfo.version > 2) {
- return UnsupportedChunk_Binary(reader,nfo,"Grou");
- }
-
- const chunk_guard cn(nfo,reader);
-
- out.nodes.push_back(boost::shared_ptr<Group>(new Group()));
- Group& msh = (Group&)(*out.nodes.back().get());
- msh = nfo;
-
- ReadBasicNodeInfo_Binary(msh,reader,nfo);
-}
-
-// ------------------------------------------------------------------------------------------------
-void COBImporter::ReadUnit_Binary(COB::Scene& out, StreamReaderLE& reader, const ChunkInfo& nfo)
-{
- if (nfo.version > 1) {
- return UnsupportedChunk_Binary(reader,nfo,"Unit");
- }
-
- const chunk_guard cn(nfo,reader);
-
- // parent chunks preceede their childs, so we should have the
- // corresponding chunk already.
- for_each(boost::shared_ptr< Node >& nd, out.nodes) {
- if (nd->id == nfo.parent_id) {
- const unsigned int t=reader.GetI2();
- nd->unit_scale = t>=sizeof(units)/sizeof(units[0])?(
- LogWarn_Ascii(format()<<t<<" is not a valid value for `Units` attribute in `Unit chunk` "<<nfo.id)
- ,1.f):units[t];
-
- return;
- }
- }
- LogWarn_Ascii(format()<<"`Unit` chunk "<<nfo.id<<" is a child of "
- <<nfo.parent_id<<" which does not exist");
-}
-
-
-#endif
diff --git a/3rdparty/assimp/code/COBLoader.h b/3rdparty/assimp/code/COBLoader.h
deleted file mode 100644
index 55e484b3..00000000
--- a/3rdparty/assimp/code/COBLoader.h
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file COBLoader.h
- * @brief Declaration of the TrueSpace (*.cob,*.scn) importer class.
- */
-#ifndef INCLUDED_AI_COB_LOADER_H
-#define INCLUDED_AI_COB_LOADER_H
-
-#include "BaseImporter.h"
-namespace Assimp {
- class LineSplitter;
-
- // TinyFormatter.h
- namespace Formatter {
- template <typename T,typename TR, typename A> class basic_formatter;
- typedef class basic_formatter< char, std::char_traits<char>, std::allocator<char> > format;
- }
-
- // COBScene.h
- namespace COB {
- struct ChunkInfo;
- struct Node;
- struct Scene;
- }
-
-// -------------------------------------------------------------------------------------------
-/** Importer class to load TrueSpace files (cob,scn) up to v6.
- *
- * Currently relatively limited, loads only ASCII files and needs more test coverage. */
-// -------------------------------------------------------------------------------------------
-class COBImporter : public BaseImporter
-{
- friend class Importer;
-
-protected:
-
- /** Constructor to be privately used by Importer */
- COBImporter();
-
- /** Destructor, private as well */
- ~COBImporter();
-
-public:
-
- // --------------------
- bool CanRead( const std::string& pFile, IOSystem* pIOHandler,
- bool checkSig) const;
-
-protected:
-
- // --------------------
- void GetExtensionList(std::set<std::string>& app);
-
- // --------------------
- void SetupProperties(const Importer* pImp);
-
- // --------------------
- void InternReadFile( const std::string& pFile, aiScene* pScene,
- IOSystem* pIOHandler);
-
-private:
-
- // -------------------------------------------------------------------
- /** Prepend 'COB: ' and throw msg.*/
- static void ThrowException(const std::string& msg);
-
- // -------------------------------------------------------------------
- /** @brief Read from an ascii scene/object file
- * @param out Receives output data.
- * @param stream Stream to read from. */
- void ReadAsciiFile(COB::Scene& out, StreamReaderLE* stream);
-
- // -------------------------------------------------------------------
- /** @brief Read from a binary scene/object file
- * @param out Receives output data.
- * @param stream Stream to read from. */
- void ReadBinaryFile(COB::Scene& out, StreamReaderLE* stream);
-
-
-private:
-
- // Conversion to Assimp output format
-
- aiNode* BuildNodes(const COB::Node& root,const COB::Scene& scin,aiScene* fill);
-
-private:
-
- // ASCII file support
-
- void UnsupportedChunk_Ascii(LineSplitter& splitter, const COB::ChunkInfo& nfo, const char* name);
- void ReadChunkInfo_Ascii(COB::ChunkInfo& out, const LineSplitter& splitter);
- void ReadBasicNodeInfo_Ascii(COB::Node& msh, LineSplitter& splitter, const COB::ChunkInfo& nfo);
- template <typename T> void ReadFloat3Tuple_Ascii(T& fill, const char** in);
-
- void ReadPolH_Ascii(COB::Scene& out, LineSplitter& splitter, const COB::ChunkInfo& nfo);
- void ReadBitM_Ascii(COB::Scene& out, LineSplitter& splitter, const COB::ChunkInfo& nfo);
- void ReadMat1_Ascii(COB::Scene& out, LineSplitter& splitter, const COB::ChunkInfo& nfo);
- void ReadGrou_Ascii(COB::Scene& out, LineSplitter& splitter, const COB::ChunkInfo& nfo);
- void ReadBone_Ascii(COB::Scene& out, LineSplitter& splitter, const COB::ChunkInfo& nfo);
- void ReadCame_Ascii(COB::Scene& out, LineSplitter& splitter, const COB::ChunkInfo& nfo);
- void ReadLght_Ascii(COB::Scene& out, LineSplitter& splitter, const COB::ChunkInfo& nfo);
- void ReadUnit_Ascii(COB::Scene& out, LineSplitter& splitter, const COB::ChunkInfo& nfo);
- void ReadChan_Ascii(COB::Scene& out, LineSplitter& splitter, const COB::ChunkInfo& nfo);
-
-
- // ASCII file logging stuff to add proper line numbers to messages
-
- static void LogWarn_Ascii (const LineSplitter& splitter, const Formatter::format& message);
- static void LogError_Ascii(const LineSplitter& splitter, const Formatter::format& message);
- static void LogInfo_Ascii (const LineSplitter& splitter, const Formatter::format& message);
- static void LogDebug_Ascii(const LineSplitter& splitter, const Formatter::format& message);
-
- static void LogWarn_Ascii (const Formatter::format& message);
- static void LogError_Ascii (const Formatter::format& message);
- static void LogInfo_Ascii (const Formatter::format& message);
- static void LogDebug_Ascii (const Formatter::format& message);
-
-
- // Binary file support
-
- void UnsupportedChunk_Binary(StreamReaderLE& reader, const COB::ChunkInfo& nfo, const char* name);
- void ReadString_Binary(std::string& out, StreamReaderLE& reader);
- void ReadBasicNodeInfo_Binary(COB::Node& msh, StreamReaderLE& reader, const COB::ChunkInfo& nfo);
-
- void ReadPolH_Binary(COB::Scene& out, StreamReaderLE& reader, const COB::ChunkInfo& nfo);
- void ReadBitM_Binary(COB::Scene& out, StreamReaderLE& reader, const COB::ChunkInfo& nfo);
- void ReadMat1_Binary(COB::Scene& out, StreamReaderLE& reader, const COB::ChunkInfo& nfo);
- void ReadCame_Binary(COB::Scene& out, StreamReaderLE& reader, const COB::ChunkInfo& nfo);
- void ReadLght_Binary(COB::Scene& out, StreamReaderLE& reader, const COB::ChunkInfo& nfo);
- void ReadGrou_Binary(COB::Scene& out, StreamReaderLE& reader, const COB::ChunkInfo& nfo);
- void ReadUnit_Binary(COB::Scene& out, StreamReaderLE& reader, const COB::ChunkInfo& nfo);
-
-
-}; // !class COBImporter
-
-} // end of namespace Assimp
-#endif // AI_UNREALIMPORTER_H_INC
diff --git a/3rdparty/assimp/code/COBScene.h b/3rdparty/assimp/code/COBScene.h
deleted file mode 100644
index 794ee137..00000000
--- a/3rdparty/assimp/code/COBScene.h
+++ /dev/null
@@ -1,272 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
-copyright notice, this list of conditions and the
-following disclaimer.
-
-* Redistributions in binary form must reproduce the above
-copyright notice, this list of conditions and the
-following disclaimer in the documentation and/or other
-materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
-contributors may be used to endorse or promote products
-derived from this software without specific prior
-written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file COBScene.h
-* @brief Utilities for the COB importer.
-*/
-#ifndef INCLUDED_AI_COB_SCENE_H
-#define INCLUDED_AI_COB_SCENE_H
-
-#include <boost/shared_ptr.hpp>
-#include "BaseImporter.h"
-
-namespace Assimp {
- namespace COB {
-
-// ------------------
-/** Represents a single vertex index in a face */
-struct VertexIndex
-{
- // intentionally uninitialized
- unsigned int pos_idx,uv_idx;
-};
-
-// ------------------
-/** COB Face data structure */
-struct Face
-{
- // intentionally uninitialized
- unsigned int material, flags;
- std::vector<VertexIndex> indices;
-};
-
-// ------------------
-/** COB chunk header information */
-struct ChunkInfo
-{
- enum {NO_SIZE=0xffffffff};
-
- ChunkInfo ()
- : id (0)
- , parent_id (0)
- , version (0)
- , size (NO_SIZE)
- {}
-
- // Id of this chunk, unique within file
- unsigned int id;
-
- // and the corresponding parent
- unsigned int parent_id;
-
- // version. v1.23 becomes 123
- unsigned int version;
-
- // chunk size in bytes, only relevant for binary files
- // NO_SIZE is also valid.
- unsigned int size;
-};
-
-// ------------------
-/** A node in the scenegraph */
-struct Node : public ChunkInfo
-{
- using ChunkInfo::operator=;
- enum Type {
- TYPE_MESH,TYPE_GROUP,TYPE_LIGHT,TYPE_CAMERA,TYPE_BONE
- };
-
- virtual ~Node() {}
- Node(Type type) : type(type), unit_scale(1.f){}
-
- Type type;
-
- // used during resolving
- typedef std::deque<const Node*> ChildList;
- mutable ChildList temp_children;
-
- // unique name
- std::string name;
-
- // local mesh transformation
- aiMatrix4x4 transform;
-
- // scaling for this node to get to the metric system
- float unit_scale;
-};
-
-// ------------------
-/** COB Mesh data structure */
-struct Mesh : public Node
-{
- using ChunkInfo::operator=;
- enum DrawFlags {
- SOLID = 0x1,
- TRANS = 0x2,
- WIRED = 0x4,
- BBOX = 0x8,
- HIDE = 0x10
- };
-
- Mesh()
- : Node(TYPE_MESH)
- , draw_flags(SOLID)
- {}
-
- // vertex elements
- std::vector<aiVector2D> texture_coords;
- std::vector<aiVector3D> vertex_positions;
-
- // face data
- std::vector<Face> faces;
-
- // misc. drawing flags
- unsigned int draw_flags;
-
- // used during resolving
- typedef std::deque<Face*> FaceRefList;
- typedef std::map< unsigned int,FaceRefList > TempMap;
- TempMap temp_map;
-};
-
-// ------------------
-/** COB Group data structure */
-struct Group : public Node
-{
- using ChunkInfo::operator=;
- Group() : Node(TYPE_GROUP) {}
-};
-
-// ------------------
-/** COB Bone data structure */
-struct Bone : public Node
-{
- using ChunkInfo::operator=;
- Bone() : Node(TYPE_BONE) {}
-};
-
-// ------------------
-/** COB Light data structure */
-struct Light : public Node
-{
- enum LightType {
- SPOT,LOCAL,INFINITE
- };
-
- using ChunkInfo::operator=;
- Light() : Node(TYPE_LIGHT),angle(),inner_angle(),ltype(SPOT) {}
-
- aiColor3D color;
- float angle,inner_angle;
-
- LightType ltype;
-};
-
-// ------------------
-/** COB Camera data structure */
-struct Camera : public Node
-{
- using ChunkInfo::operator=;
- Camera() : Node(TYPE_CAMERA) {}
-};
-
-// ------------------
-/** COB Texture data structure */
-struct Texture
-{
- std::string path;
- aiUVTransform transform;
-};
-
-// ------------------
-/** COB Material data structure */
-struct Material : ChunkInfo
-{
- using ChunkInfo::operator=;
- enum Shader {
- FLAT,PHONG,METAL
- };
-
- enum AutoFacet {
- FACETED,AUTOFACETED,SMOOTH
- };
-
- Material() : alpha(),exp(),ior(),ka(),ks(1.f),
- matnum(0xffffffff),
- shader(FLAT),autofacet(FACETED),
- autofacet_angle()
- {}
-
- std::string type;
-
- aiColor3D rgb;
- float alpha, exp, ior,ka,ks;
-
- unsigned int matnum;
- Shader shader;
-
- AutoFacet autofacet;
- float autofacet_angle;
-
- boost::shared_ptr<Texture> tex_env,tex_bump,tex_color;
-};
-
-// ------------------
-/** Embedded bitmap, for instance for the thumbnail image */
-struct Bitmap : ChunkInfo
-{
- Bitmap() : orig_size() {}
- struct BitmapHeader
- {
- };
-
- BitmapHeader head;
- size_t orig_size;
- std::vector<char> buff_zipped;
-};
-
-typedef std::deque< boost::shared_ptr<Node> > NodeList;
-typedef std::vector< Material > MaterialList;
-
-// ------------------
-/** Represents a master COB scene, even if we loaded just a single COB file */
-struct Scene
-{
- NodeList nodes;
- MaterialList materials;
-
- // becomes *0 later
- Bitmap thumbnail;
-};
-
- } // end COB
-} // end Assimp
-
-#endif
diff --git a/3rdparty/assimp/code/CSMLoader.cpp b/3rdparty/assimp/code/CSMLoader.cpp
deleted file mode 100644
index 2348c738..00000000
--- a/3rdparty/assimp/code/CSMLoader.cpp
+++ /dev/null
@@ -1,281 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2009, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file CSMLoader.cpp
- * Implementation of the CSM importer class.
- */
-
-#include "AssimpPCH.h"
-
-#ifndef ASSIMP_BUILD_NO_CSM_IMPORTER
-
-#include "CSMLoader.h"
-#include "SkeletonMeshBuilder.h"
-#include "ParsingUtils.h"
-#include "fast_atof.h"
-
-using namespace Assimp;
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-CSMImporter::CSMImporter()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-CSMImporter::~CSMImporter()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the class can handle the format of the given file.
-bool CSMImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const
-{
- // check file extension
- const std::string extension = GetExtension(pFile);
-
- if ( extension == "csm")
- return true;
-
- if ((checkSig || !extension.length()) && pIOHandler) {
- const char* tokens[] = {"$Filename"};
- return SearchFileHeaderForToken(pIOHandler,pFile,tokens,1);
- }
- return false;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Build a string of all file extensions supported
-void CSMImporter::GetExtensionList(std::set<std::string>& extensions)
-{
- extensions.insert("csm");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Setup configuration properties for the loader
-void CSMImporter::SetupProperties(const Importer* pImp)
-{
- // nothing to be done for the moment
-}
-
-// ------------------------------------------------------------------------------------------------
-// Imports the given file into the given scene structure.
-void CSMImporter::InternReadFile( const std::string& pFile,
- aiScene* pScene, IOSystem* pIOHandler)
-{
- boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
-
- // Check whether we can read from the file
- if ( file.get() == NULL) {
- throw DeadlyImportError( "Failed to open CSM file " + pFile + ".");
- }
-
- // allocate storage and copy the contents of the file to a memory buffer
- std::vector<char> mBuffer2;
- TextFileToBuffer(file.get(),mBuffer2);
- const char* buffer = &mBuffer2[0];
-
- aiAnimation* anim = new aiAnimation();
- int first = 0, last = 0x00ffffff;
-
- // now process the file and look out for '$' sections
- while (1) {
- SkipSpaces(&buffer);
- if ('\0' == *buffer)
- break;
-
- if ('$' == *buffer) {
- ++buffer;
- if (TokenMatchI(buffer,"firstframe",10)) {
- SkipSpaces(&buffer);
- first = strtol10s(buffer,&buffer);
- }
- else if (TokenMatchI(buffer,"lastframe",9)) {
- SkipSpaces(&buffer);
- last = strtol10s(buffer,&buffer);
- }
- else if (TokenMatchI(buffer,"rate",4)) {
- SkipSpaces(&buffer);
- float d;
- buffer = fast_atof_move(buffer,d);
- anim->mTicksPerSecond = d;
- }
- else if (TokenMatchI(buffer,"order",5)) {
- std::vector< aiNodeAnim* > anims_temp;
- anims_temp.reserve(30);
- while (1) {
- SkipSpaces(&buffer);
- if (IsLineEnd(*buffer) && SkipSpacesAndLineEnd(&buffer) && *buffer == '$')
- break; // next section
-
- // Construct a new node animation channel and setup its name
- anims_temp.push_back(new aiNodeAnim());
- aiNodeAnim* nda = anims_temp.back();
-
- char* ot = nda->mNodeName.data;
- while (!IsSpaceOrNewLine(*buffer))
- *ot++ = *buffer++;
-
- *ot = '\0';
- nda->mNodeName.length = (size_t)(ot-nda->mNodeName.data);
- }
-
- anim->mNumChannels = anims_temp.size();
- if (!anim->mNumChannels)
- throw DeadlyImportError("CSM: Empty $order section");
-
- // copy over to the output animation
- anim->mChannels = new aiNodeAnim*[anim->mNumChannels];
- ::memcpy(anim->mChannels,&anims_temp[0],sizeof(aiNodeAnim*)*anim->mNumChannels);
- }
- else if (TokenMatchI(buffer,"points",6)) {
- if (!anim->mNumChannels)
- throw DeadlyImportError("CSM: \'$order\' section is required to appear prior to \'$points\'");
-
- // If we know how many frames we'll read, we can preallocate some storage
- unsigned int alloc = 100;
- if (last != 0x00ffffff)
- {
- alloc = last-first;
- alloc += alloc>>2u; // + 25%
- for (unsigned int i = 0; i < anim->mNumChannels;++i)
- anim->mChannels[i]->mPositionKeys = new aiVectorKey[alloc];
- }
-
- unsigned int filled = 0;
-
- // Now read all point data.
- while (1) {
- SkipSpaces(&buffer);
- if (IsLineEnd(*buffer) && (!SkipSpacesAndLineEnd(&buffer) || *buffer == '$')) {
- break; // next section
- }
-
- // read frame
- const int frame = ::strtol10(buffer,&buffer);
- last = std::max(frame,last);
- first = std::min(frame,last);
- for (unsigned int i = 0; i < anim->mNumChannels;++i) {
-
- aiNodeAnim* s = anim->mChannels[i];
- if (s->mNumPositionKeys == alloc) { /* need to reallocate? */
-
- aiVectorKey* old = s->mPositionKeys;
- s->mPositionKeys = new aiVectorKey[s->mNumPositionKeys = alloc*2];
- ::memcpy(s->mPositionKeys,old,sizeof(aiVectorKey)*alloc);
- delete[] old;
- }
-
- // read x,y,z
- if (!SkipSpacesAndLineEnd(&buffer))
- throw DeadlyImportError("CSM: Unexpected EOF occured reading sample x coord");
-
- if (TokenMatchI(buffer, "DROPOUT", 7)) {
- // seems this is invalid marker data; at least the doc says it's possible
- DefaultLogger::get()->warn("CSM: Encountered invalid marker data (DROPOUT)");
- }
- else {
- aiVectorKey* sub = s->mPositionKeys + s->mNumPositionKeys;
- sub->mTime = (double)frame;
- buffer = fast_atof_move(buffer, (float&)sub->mValue.x);
-
- if (!SkipSpacesAndLineEnd(&buffer))
- throw DeadlyImportError("CSM: Unexpected EOF occured reading sample y coord");
- buffer = fast_atof_move(buffer, (float&)sub->mValue.y);
-
- if (!SkipSpacesAndLineEnd(&buffer))
- throw DeadlyImportError("CSM: Unexpected EOF occured reading sample z coord");
- buffer = fast_atof_move(buffer, (float&)sub->mValue.z);
-
- ++s->mNumPositionKeys;
- }
- }
-
- // update allocation granularity
- if (filled == alloc)
- alloc *= 2;
-
- ++filled;
- }
- // all channels must be complete in order to continue safely.
- for (unsigned int i = 0; i < anim->mNumChannels;++i) {
-
- if (!anim->mChannels[i]->mNumPositionKeys)
- throw DeadlyImportError("CSM: Invalid marker track");
- }
- }
- }
- else {
- // advance to the next line
- SkipLine(&buffer);
- }
- }
-
- // Setup a proper animation duration
- anim->mDuration = last - std::min( first, 0 );
-
- // build a dummy root node with the tiny markers as children
- pScene->mRootNode = new aiNode();
- pScene->mRootNode->mName.Set("$CSM_DummyRoot");
-
- pScene->mRootNode->mNumChildren = anim->mNumChannels;
- pScene->mRootNode->mChildren = new aiNode* [anim->mNumChannels];
-
- for (unsigned int i = 0; i < anim->mNumChannels;++i) {
- aiNodeAnim* na = anim->mChannels[i];
-
- aiNode* nd = pScene->mRootNode->mChildren[i] = new aiNode();
- nd->mName = anim->mChannels[i]->mNodeName;
- nd->mParent = pScene->mRootNode;
-
- aiMatrix4x4::Translation(na->mPositionKeys[0].mValue, nd->mTransformation);
- }
-
- // Store the one and only animation in the scene
- pScene->mAnimations = new aiAnimation*[pScene->mNumAnimations=1];
- pScene->mAnimations[0] = anim;
- anim->mName.Set("$CSM_MasterAnim");
-
- // mark the scene as incomplete and run SkeletonMeshBuilder on it
- pScene->mFlags |= AI_SCENE_FLAGS_INCOMPLETE;
- SkeletonMeshBuilder maker(pScene,pScene->mRootNode,true);
-}
-
-#endif // !! ASSIMP_BUILD_NO_CSM_IMPORTER
diff --git a/3rdparty/assimp/code/CSMLoader.h b/3rdparty/assimp/code/CSMLoader.h
deleted file mode 100644
index 2b5e8e63..00000000
--- a/3rdparty/assimp/code/CSMLoader.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file CSMLoader.h
- * Declaration of the CharacterStudio Motion importer class.
- */
-#ifndef INCLUDED_AI_CSM_LOADER_H
-#define INCLUDED_AI_CSM_LOADER_H
-namespace Assimp {
-
-// ---------------------------------------------------------------------------
-/** Importer class to load MOCAPs in CharacterStudio Motion format.
- *
- * A very rudimentary loader for the moment. No support for the hierarchy,
- * every marker is returned as child of root.
- *
- * Link to file format specification:
- * <max_8_dvd>\samples\Motion\Docs\CSM.rtf
-*/
-class CSMImporter : public BaseImporter
-{
- friend class Importer;
-protected:
- /** Constructor to be privately used by Importer */
- CSMImporter();
-
- /** Destructor, private as well */
- ~CSMImporter();
-
-public:
- // -------------------------------------------------------------------
- bool CanRead( const std::string& pFile, IOSystem* pIOHandler,
- bool checkSig) const;
-
-protected:
-
- // -------------------------------------------------------------------
- void GetExtensionList(std::set<std::string>& extensions);
-
- // -------------------------------------------------------------------
- void SetupProperties(const Importer* pImp);
-
- // -------------------------------------------------------------------
- void InternReadFile( const std::string& pFile, aiScene* pScene,
- IOSystem* pIOHandler);
-
-private:
-}; // end of class CSMImporter
-} // end of namespace Assimp
-#endif // AI_AC3DIMPORTER_H_INC
-
diff --git a/3rdparty/assimp/code/CalcTangentsProcess.cpp b/3rdparty/assimp/code/CalcTangentsProcess.cpp
deleted file mode 100644
index 83ec00a5..00000000
--- a/3rdparty/assimp/code/CalcTangentsProcess.cpp
+++ /dev/null
@@ -1,283 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file Implementation of the post processing step to calculate
- * tangents and bitangents for all imported meshes
- */
-
-#include "AssimpPCH.h"
-
-// internal headers
-#include "CalcTangentsProcess.h"
-#include "ProcessHelper.h"
-
-using namespace Assimp;
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-CalcTangentsProcess::CalcTangentsProcess()
-{
- this->configMaxAngle = AI_DEG_TO_RAD(45.f);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-CalcTangentsProcess::~CalcTangentsProcess()
-{
- // nothing to do here
-}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the processing step is present in the given flag field.
-bool CalcTangentsProcess::IsActive( unsigned int pFlags) const
-{
- return (pFlags & aiProcess_CalcTangentSpace) != 0;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Executes the post processing step on the given imported data.
-void CalcTangentsProcess::SetupProperties(const Importer* pImp)
-{
- // get the current value of the property
- this->configMaxAngle = pImp->GetPropertyFloat(AI_CONFIG_PP_CT_MAX_SMOOTHING_ANGLE,45.f);
- this->configMaxAngle = std::max(std::min(this->configMaxAngle,45.0f),0.0f);
- this->configMaxAngle = AI_DEG_TO_RAD(this->configMaxAngle);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Executes the post processing step on the given imported data.
-void CalcTangentsProcess::Execute( aiScene* pScene)
-{
- DefaultLogger::get()->debug("CalcTangentsProcess begin");
-
- bool bHas = false;
- for ( unsigned int a = 0; a < pScene->mNumMeshes; a++)
- if (ProcessMesh( pScene->mMeshes[a],a))bHas = true;
-
- if (bHas)DefaultLogger::get()->debug("CalcTangentsProcess finished. Tangents have been calculated");
- else DefaultLogger::get()->debug("CalcTangentsProcess finished");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Calculates tangents and bitangents for the given mesh
-bool CalcTangentsProcess::ProcessMesh( aiMesh* pMesh, unsigned int meshIndex)
-{
- // we assume that the mesh is still in the verbose vertex format where each face has its own set
- // of vertices and no vertices are shared between faces. Sadly I don't know any quick test to
- // assert() it here.
- //assert( must be verbose, dammit);
-
- if (pMesh->mTangents) // thisimplies that mBitangents is also there
- return false;
-
- // If the mesh consists of lines and/or points but not of
- // triangles or higher-order polygons the normal vectors
- // are undefined.
- if (!(pMesh->mPrimitiveTypes & (aiPrimitiveType_TRIANGLE | aiPrimitiveType_POLYGON)))
- {
- DefaultLogger::get()->info("Tangents are undefined for line and point meshes");
- return false;
- }
-
- // what we can check, though, is if the mesh has normals and texture coord. That's a requirement
- if ( pMesh->mNormals == NULL || pMesh->mTextureCoords[0] == NULL)
- {
- DefaultLogger::get()->error("Unable to compute tangents: UV0 and normals must be there ");
- return false;
- }
- const float angleEpsilon = 0.9999f;
-
- std::vector<bool> vertexDone( pMesh->mNumVertices, false);
- const float qnan = get_qnan();
-
- // create space for the tangents and bitangents
- pMesh->mTangents = new aiVector3D[pMesh->mNumVertices];
- pMesh->mBitangents = new aiVector3D[pMesh->mNumVertices];
-
- const aiVector3D* meshPos = pMesh->mVertices;
- const aiVector3D* meshNorm = pMesh->mNormals;
- const aiVector3D* meshTex = pMesh->mTextureCoords[0];
- aiVector3D* meshTang = pMesh->mTangents;
- aiVector3D* meshBitang = pMesh->mBitangents;
-
- // calculate the tangent and bitangent for every face
- for ( unsigned int a = 0; a < pMesh->mNumFaces; a++)
- {
- const aiFace& face = pMesh->mFaces[a];
- if (face.mNumIndices < 3)
- {
- // There are less than three indices, thus the tangent vector
- // is not defined. We are finished with these vertices now,
- // their tangent vectors are set to qnan.
- for (unsigned int i = 0; i < face.mNumIndices;++i)
- {
- register unsigned int idx = face.mIndices[i];
- vertexDone [idx] = true;
- meshTang [idx] = qnan;
- meshBitang [idx] = qnan;
- }
-
- continue;
- }
-
- // triangle or polygon... we always use only the first three indices. A polygon
- // is supposed to be planar anyways....
- // FIXME: (thom) create correct calculation for multi-vertex polygons maybe?
- const unsigned int p0 = face.mIndices[0], p1 = face.mIndices[1], p2 = face.mIndices[2];
-
- // position differences p1->p2 and p1->p3
- aiVector3D v = meshPos[p1] - meshPos[p0], w = meshPos[p2] - meshPos[p0];
-
- // texture offset p1->p2 and p1->p3
- float sx = meshTex[p1].x - meshTex[p0].x, sy = meshTex[p1].y - meshTex[p0].y;
- float tx = meshTex[p2].x - meshTex[p0].x, ty = meshTex[p2].y - meshTex[p0].y;
- float dirCorrection = (tx * sy - ty * sx) < 0.0f ? -1.0f : 1.0f;
-
- // tangent points in the direction where to positive X axis of the texture coords would point in model space
- // bitangents points along the positive Y axis of the texture coords, respectively
- aiVector3D tangent, bitangent;
- tangent.x = (w.x * sy - v.x * ty) * dirCorrection;
- tangent.y = (w.y * sy - v.y * ty) * dirCorrection;
- tangent.z = (w.z * sy - v.z * ty) * dirCorrection;
- bitangent.x = (w.x * sx - v.x * tx) * dirCorrection;
- bitangent.y = (w.y * sx - v.y * tx) * dirCorrection;
- bitangent.z = (w.z * sx - v.z * tx) * dirCorrection;
-
- // store for every vertex of that face
- for ( unsigned int b = 0; b < face.mNumIndices; b++)
- {
- unsigned int p = face.mIndices[b];
-
- // project tangent and bitangent into the plane formed by the vertex' normal
- aiVector3D localTangent = tangent - meshNorm[p] * (tangent * meshNorm[p]);
- aiVector3D localBitangent = bitangent - meshNorm[p] * (bitangent * meshNorm[p]);
- localTangent.Normalize(); localBitangent.Normalize();
-
- // and write it into the mesh.
- meshTang[p] = localTangent;
- meshBitang[p] = localBitangent;
- }
- }
-
-
- // create a helper to quickly find locally close vertices among the vertex array
- // FIX: check whether we can reuse the SpatialSort of a previous step
- SpatialSort* vertexFinder = NULL;
- SpatialSort _vertexFinder;
- float posEpsilon;
- if (shared)
- {
- std::vector<std::pair<SpatialSort,float> >* avf;
- shared->GetProperty(AI_SPP_SPATIAL_SORT,avf);
- if (avf)
- {
- std::pair<SpatialSort,float>& blubb = avf->operator [] (meshIndex);
- vertexFinder = &blubb.first;
- posEpsilon = blubb.second;;
- }
- }
- if (!vertexFinder)
- {
- _vertexFinder.Fill(pMesh->mVertices, pMesh->mNumVertices, sizeof( aiVector3D));
- vertexFinder = &_vertexFinder;
- posEpsilon = ComputePositionEpsilon(pMesh);
- }
- std::vector<unsigned int> verticesFound;
-
- const float fLimit = cosf(this->configMaxAngle);
- std::vector<unsigned int> closeVertices;
-
- // in the second pass we now smooth out all tangents and bitangents at the same local position
- // if they are not too far off.
- for ( unsigned int a = 0; a < pMesh->mNumVertices; a++)
- {
- if ( vertexDone[a])
- continue;
-
- const aiVector3D& origPos = pMesh->mVertices[a];
- const aiVector3D& origNorm = pMesh->mNormals[a];
- const aiVector3D& origTang = pMesh->mTangents[a];
- const aiVector3D& origBitang = pMesh->mBitangents[a];
- closeVertices.clear();
-
- // find all vertices close to that position
- vertexFinder->FindPositions( origPos, posEpsilon, verticesFound);
-
- closeVertices.reserve (verticesFound.size()+5);
- closeVertices.push_back( a);
-
- // look among them for other vertices sharing the same normal and a close-enough tangent/bitangent
- for ( unsigned int b = 0; b < verticesFound.size(); b++)
- {
- unsigned int idx = verticesFound[b];
- if ( vertexDone[idx])
- continue;
- if ( meshNorm[idx] * origNorm < angleEpsilon)
- continue;
- if ( meshTang[idx] * origTang < fLimit)
- continue;
- if ( meshBitang[idx] * origBitang < fLimit)
- continue;
-
- // it's similar enough -> add it to the smoothing group
- closeVertices.push_back( idx);
- vertexDone[idx] = true;
- }
-
- // smooth the tangents and bitangents of all vertices that were found to be close enough
- aiVector3D smoothTangent( 0, 0, 0), smoothBitangent( 0, 0, 0);
- for ( unsigned int b = 0; b < closeVertices.size(); ++b)
- {
- smoothTangent += meshTang[ closeVertices[b] ];
- smoothBitangent += meshBitang[ closeVertices[b] ];
- }
- smoothTangent.Normalize();
- smoothBitangent.Normalize();
-
- // and write it back into all affected tangents
- for ( unsigned int b = 0; b < closeVertices.size(); ++b)
- {
- meshTang[ closeVertices[b] ] = smoothTangent;
- meshBitang[ closeVertices[b] ] = smoothBitangent;
- }
- }
- return true;
-}
diff --git a/3rdparty/assimp/code/CalcTangentsProcess.h b/3rdparty/assimp/code/CalcTangentsProcess.h
deleted file mode 100644
index 189710ff..00000000
--- a/3rdparty/assimp/code/CalcTangentsProcess.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-
-/** @file Defines a post processing step to calculate tangents and
- bitangents on all imported meshes.*/
-#ifndef AI_CALCTANGENTSPROCESS_H_INC
-#define AI_CALCTANGENTSPROCESS_H_INC
-
-#include "BaseProcess.h"
-
-struct aiMesh;
-
-namespace Assimp
-{
-
-// ---------------------------------------------------------------------------
-/** The CalcTangentsProcess calculates the tangent and bitangent for any vertex
- * of all meshes. It is expected to be run before the JoinVerticesProcess runs
- * because the joining of vertices also considers tangents and bitangents for
- * uniqueness.
- */
-class ASSIMP_API CalcTangentsProcess : public BaseProcess
-{
- friend class Importer;
-
-protected:
- /** Constructor to be privately used by Importer */
- CalcTangentsProcess();
-
- /** Destructor, private as well */
- ~CalcTangentsProcess();
-
-public:
- // -------------------------------------------------------------------
- /** Returns whether the processing step is present in the given flag.
- * @param pFlags The processing flags the importer was called with.
- * A bitwise combination of #aiPostProcessSteps.
- * @return true if the process is present in this flag fields,
- * false if not.
- */
- bool IsActive( unsigned int pFlags) const;
-
- // -------------------------------------------------------------------
- /** Called prior to ExecuteOnScene().
- * The function is a request to the process to update its configuration
- * basing on the Importer's configuration property list.
- */
- void SetupProperties(const Importer* pImp);
-
-
- // setter for configMaxAngle
- inline void SetMaxSmoothAngle(float f)
- {
- configMaxAngle =f;
- }
-
-protected:
-
- // -------------------------------------------------------------------
- /** Calculates tangents and bitangents for a specific mesh.
- * @param pMesh The mesh to process.
- * @param meshIndex Index of the mesh
- */
- bool ProcessMesh( aiMesh* pMesh, unsigned int meshIndex);
-
- // -------------------------------------------------------------------
- /** Executes the post processing step on the given imported data.
- * @param pScene The imported data to work at.
- */
- void Execute( aiScene* pScene);
-
-private:
-
- /** Configuration option: maximum smoothing angle, in radians*/
- float configMaxAngle;
-};
-
-} // end of namespace Assimp
-
-#endif // AI_CALCTANGENTSPROCESS_H_INC
diff --git a/3rdparty/assimp/code/ColladaHelper.h b/3rdparty/assimp/code/ColladaHelper.h
deleted file mode 100644
index 355571f0..00000000
--- a/3rdparty/assimp/code/ColladaHelper.h
+++ /dev/null
@@ -1,601 +0,0 @@
-/** Helper structures for the Collada loader */
-
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
-copyright notice, this list of conditions and the
-following disclaimer.
-
-* Redistributions in binary form must reproduce the above
-copyright notice, this list of conditions and the
-following disclaimer in the documentation and/or other
-materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
-contributors may be used to endorse or promote products
-derived from this software without specific prior
-written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-#ifndef AI_COLLADAHELPER_H_INC
-#define AI_COLLADAHELPER_H_INC
-
-namespace Assimp {
-namespace Collada {
-
-/** Collada file versions which evolved during the years ... */
-enum FormatVersion
-{
- FV_1_5_n,
- FV_1_4_n,
- FV_1_3_n
-};
-
-
-/** Transformation types that can be applied to a node */
-enum TransformType
-{
- TF_LOOKAT,
- TF_ROTATE,
- TF_TRANSLATE,
- TF_SCALE,
- TF_SKEW,
- TF_MATRIX
-};
-
-/** Different types of input data to a vertex or face */
-enum InputType
-{
- IT_Invalid,
- IT_Vertex, // special type for per-index data referring to the <vertices> element carrying the per-vertex data.
- IT_Position,
- IT_Normal,
- IT_Texcoord,
- IT_Color,
- IT_Tangent,
- IT_Bitangent
-};
-
-/** Contains all data for one of the different transformation types */
-struct Transform
-{
- std::string mID; ///< SID of the transform step, by which anim channels address their target node
- TransformType mType;
- float f[16]; ///< Interpretation of data depends on the type of the transformation
-};
-
-/** A collada camera. */
-struct Camera
-{
- Camera()
- : mOrtho (false)
- , mHorFov (10e10f)
- , mVerFov (10e10f)
- , mAspect (10e10f)
- , mZNear (0.1f)
- , mZFar (1000.f)
- {}
-
- // Name of camera
- std::string mName;
-
- // True if it is an orthografic camera
- bool mOrtho;
-
- //! Horizontal field of view in degrees
- float mHorFov;
-
- //! Vertical field of view in degrees
- float mVerFov;
-
- //! Screen aspect
- float mAspect;
-
- //! Near& far z
- float mZNear, mZFar;
-};
-
-#define aiLightSource_AMBIENT 0xdeaddead
-
-/** A collada light source. */
-struct Light
-{
- Light()
- : mAttConstant (1.f)
- , mAttLinear (0.f)
- , mAttQuadratic (0.f)
- , mFalloffAngle (180.f)
- , mFalloffExponent (0.f)
- , mPenumbraAngle (10e10f)
- , mOuterAngle (10e10f)
- , mIntensity (1.f)
- {}
-
- //! Type of the light source aiLightSourceType + ambient
- unsigned int mType;
-
- //! Color of the light
- aiColor3D mColor;
-
- //! Light attenuation
- float mAttConstant,mAttLinear,mAttQuadratic;
-
- //! Spot light falloff
- float mFalloffAngle;
- float mFalloffExponent;
-
- // -----------------------------------------------------
- // FCOLLADA extension from here
-
- //! ... related stuff from maja and max extensions
- float mPenumbraAngle;
- float mOuterAngle;
-
- //! Common light intensity
- float mIntensity;
-};
-
-/** Short vertex index description */
-struct InputSemanticMapEntry
-{
- InputSemanticMapEntry()
- : mSet (0)
- {}
-
- //! Index of set, optional
- unsigned int mSet;
-
- //! Name of referenced vertex input
- InputType mType;
-};
-
-/** Table to map from effect to vertex input semantics */
-struct SemanticMappingTable
-{
- //! Name of material
- std::string mMatName;
-
- //! List of semantic map commands, grouped by effect semantic name
- std::map<std::string, InputSemanticMapEntry> mMap;
-
- //! For std::find
- bool operator == (const std::string& s) const {
- return s == mMatName;
- }
-};
-
-/** A reference to a mesh inside a node, including materials assigned to the various subgroups.
- * The ID refers to either a mesh or a controller which specifies the mesh
- */
-struct MeshInstance
-{
- ///< ID of the mesh or controller to be instanced
- std::string mMeshOrController;
-
- ///< Map of materials by the subgroup ID they're applied to
- std::map<std::string, SemanticMappingTable> mMaterials;
-};
-
-/** A reference to a camera inside a node*/
-struct CameraInstance
-{
- ///< ID of the camera
- std::string mCamera;
-};
-
-/** A reference to a light inside a node*/
-struct LightInstance
-{
- ///< ID of the camera
- std::string mLight;
-};
-
-/** A reference to a node inside a node*/
-struct NodeInstance
-{
- ///< ID of the node
- std::string mNode;
-};
-
-/** A node in a scene hierarchy */
-struct Node
-{
- std::string mName;
- std::string mID;
- std::string mSID;
- Node* mParent;
- std::vector<Node*> mChildren;
-
- /** Operations in order to calculate the resulting transformation to parent. */
- std::vector<Transform> mTransforms;
-
- /** Meshes at this node */
- std::vector<MeshInstance> mMeshes;
-
- /** Lights at this node */
- std::vector<LightInstance> mLights;
-
- /** Cameras at this node */
- std::vector<CameraInstance> mCameras;
-
- /** Node instances at this node */
- std::vector<NodeInstance> mNodeInstances;
-
- /** Rootnodes: Name of primary camera, if any */
- std::string mPrimaryCamera;
-
- //! Constructor. Begin with a zero parent
- Node() {
- mParent = NULL;
- }
-
- //! Destructor: delete all children subsequently
- ~Node() {
- for ( std::vector<Node*>::iterator it = mChildren.begin(); it != mChildren.end(); ++it)
- delete *it;
- }
-};
-
-/** Data source array: either floats or strings */
-struct Data
-{
- bool mIsStringArray;
- std::vector<float> mValues;
- std::vector<std::string> mStrings;
-};
-
-/** Accessor to a data array */
-struct Accessor
-{
- size_t mCount; // in number of objects
- size_t mSize; // size of an object, in elements (floats or strings, mostly 1)
- size_t mOffset; // in number of values
- size_t mStride; // Stride in number of values
- std::vector<std::string> mParams; // names of the data streams in the accessors. Empty string tells to ignore.
- size_t mSubOffset[4]; // Suboffset inside the object for the common 4 elements. For a vector, thats XYZ, for a color RGBA and so on.
- // For example, SubOffset[0] denotes which of the values inside the object is the vector X component.
- std::string mSource; // URL of the source array
- mutable const Data* mData; // Pointer to the source array, if resolved. NULL else
-
- Accessor()
- {
- mCount = 0; mSize = 0; mOffset = 0; mStride = 0; mData = NULL;
- mSubOffset[0] = mSubOffset[1] = mSubOffset[2] = mSubOffset[3] = 0;
- }
-};
-
-/** A single face in a mesh */
-struct Face
-{
- std::vector<size_t> mIndices;
-};
-
-/** An input channel for mesh data, referring to a single accessor */
-struct InputChannel
-{
- InputType mType; // Type of the data
- size_t mIndex; // Optional index, if multiple sets of the same data type are given
- size_t mOffset; // Index offset in the indices array of per-face indices. Don't ask, can't explain that any better.
- std::string mAccessor; // ID of the accessor where to read the actual values from.
- mutable const Accessor* mResolved; // Pointer to the accessor, if resolved. NULL else
-
- InputChannel() { mType = IT_Invalid; mIndex = 0; mOffset = 0; mResolved = NULL; }
-};
-
-/** Subset of a mesh with a certain material */
-struct SubMesh
-{
- std::string mMaterial; ///< subgroup identifier
- size_t mNumFaces; ///< number of faces in this submesh
-};
-
-/** Contains data for a single mesh */
-struct Mesh
-{
- Mesh()
- {
- for (unsigned int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS;++i)
- mNumUVComponents[i] = 2;
- }
-
- // just to check if there's some sophisticated addressing involved...
- // which we don't support, and therefore should warn about.
- std::string mVertexID;
-
- // Vertex data addressed by vertex indices
- std::vector<InputChannel> mPerVertexData;
-
- // actual mesh data, assembled on encounter of a <p> element. Verbose format, not indexed
- std::vector<aiVector3D> mPositions;
- std::vector<aiVector3D> mNormals;
- std::vector<aiVector3D> mTangents;
- std::vector<aiVector3D> mBitangents;
- std::vector<aiVector3D> mTexCoords[AI_MAX_NUMBER_OF_TEXTURECOORDS];
- std::vector<aiColor4D> mColors[AI_MAX_NUMBER_OF_COLOR_SETS];
-
- unsigned int mNumUVComponents[AI_MAX_NUMBER_OF_TEXTURECOORDS];
-
- // Faces. Stored are only the number of vertices for each face.
- // 1 == point, 2 == line, 3 == triangle, 4+ == poly
- std::vector<size_t> mFaceSize;
-
- // Position indices for all faces in the sequence given in mFaceSize -
- // necessary for bone weight assignment
- std::vector<size_t> mFacePosIndices;
-
- // Submeshes in this mesh, each with a given material
- std::vector<SubMesh> mSubMeshes;
-};
-
-/** Which type of primitives the ReadPrimitives() function is going to read */
-enum PrimitiveType
-{
- Prim_Invalid,
- Prim_Lines,
- Prim_LineStrip,
- Prim_Triangles,
- Prim_TriStrips,
- Prim_TriFans,
- Prim_Polylist,
- Prim_Polygon
-};
-
-/** A skeleton controller to deform a mesh with the use of joints */
-struct Controller
-{
- // the URL of the mesh deformed by the controller.
- std::string mMeshId;
-
- // accessor URL of the joint names
- std::string mJointNameSource;
-
- ///< The bind shape matrix, as array of floats. I'm not sure what this matrix actually describes, but it can't be ignored in all cases
- float mBindShapeMatrix[16];
-
- // accessor URL of the joint inverse bind matrices
- std::string mJointOffsetMatrixSource;
-
- // input channel: joint names.
- InputChannel mWeightInputJoints;
- // input channel: joint weights
- InputChannel mWeightInputWeights;
-
- // Number of weights per vertex.
- std::vector<size_t> mWeightCounts;
-
- // JointIndex-WeightIndex pairs for all vertices
- std::vector< std::pair<size_t, size_t> > mWeights;
-};
-
-/** A collada material. Pretty much the only member is a reference to an effect. */
-struct Material
-{
- std::string mEffect;
-};
-
-/** Type of the effect param */
-enum ParamType
-{
- Param_Sampler,
- Param_Surface
-};
-
-/** A param for an effect. Might be of several types, but they all just refer to each other, so I summarize them */
-struct EffectParam
-{
- ParamType mType;
- std::string mReference; // to which other thing the param is referring to.
-};
-
-/** Shading type supported by the standard effect spec of Collada */
-enum ShadeType
-{
- Shade_Invalid,
- Shade_Constant,
- Shade_Lambert,
- Shade_Phong,
- Shade_Blinn
-};
-
-/** Represents a texture sampler in collada */
-struct Sampler
-{
- Sampler()
- : mWrapU (true)
- , mWrapV (true)
- , mMirrorU ()
- , mMirrorV ()
- , mOp (aiTextureOp_Multiply)
- , mUVId (0xffffffff)
- , mWeighting (1.f)
- , mMixWithPrevious (1.f)
- {}
-
- /** Name of image reference
- */
- std::string mName;
-
- /** Wrap U?
- */
- bool mWrapU;
-
- /** Wrap V?
- */
- bool mWrapV;
-
- /** Mirror U?
- */
- bool mMirrorU;
-
- /** Mirror V?
- */
- bool mMirrorV;
-
- /** Blend mode
- */
- aiTextureOp mOp;
-
- /** UV transformation
- */
- aiUVTransform mTransform;
-
- /** Name of source UV channel
- */
- std::string mUVChannel;
-
- /** Resolved UV channel index or 0xffffffff if not known
- */
- unsigned int mUVId;
-
- // OKINO/MAX3D extensions from here
- // -------------------------------------------------------
-
- /** Weighting factor
- */
- float mWeighting;
-
- /** Mixing factor from OKINO
- */
- float mMixWithPrevious;
-};
-
-/** A collada effect. Can contain about anything according to the Collada spec,
- but we limit our version to a reasonable subset. */
-struct Effect
-{
- // Shading mode
- ShadeType mShadeType;
-
- // Colors
- aiColor4D mEmissive, mAmbient, mDiffuse, mSpecular,
- mTransparent, mReflective;
-
- // Textures
- Sampler mTexEmissive, mTexAmbient, mTexDiffuse, mTexSpecular,
- mTexTransparent, mTexBump, mTexReflective;
-
- // Scalar factory
- float mShininess, mRefractIndex, mReflectivity;
- float mTransparency;
-
- // local params referring to each other by their SID
- typedef std::map<std::string, Collada::EffectParam> ParamLibrary;
- ParamLibrary mParams;
-
- // MAX3D extensions
- // ---------------------------------------------------------
- // Double-sided?
- bool mDoubleSided, mWireframe, mFaceted;
-
- Effect()
- : mShadeType (Shade_Phong)
- , mEmissive ( 0, 0, 0, 1)
- , mAmbient ( 0.1f, 0.1f, 0.1f, 1)
- , mDiffuse ( 0.6f, 0.6f, 0.6f, 1)
- , mSpecular ( 0.4f, 0.4f, 0.4f, 1)
- , mTransparent ( 0, 0, 0, 1)
- , mShininess (10.0f)
- , mRefractIndex (1.f)
- , mReflectivity (1.f)
- , mTransparency (0.f)
- , mDoubleSided (false)
- , mWireframe (false)
- , mFaceted (false)
- {
- }
-};
-
-/** An image, meaning texture */
-struct Image
-{
- std::string mFileName;
-
- /** If image file name is zero, embedded image data
- */
- std::vector<uint8_t> mImageData;
-
- /** If image file name is zero, file format of
- * embedded image data.
- */
- std::string mEmbeddedFormat;
-
-};
-
-/** An animation channel. */
-struct AnimationChannel
-{
- /** URL of the data to animate. Could be about anything, but we support only the
- * "NodeID/TransformID.SubElement" notation
- */
- std::string mTarget;
-
- /** Source URL of the time values. Collada calls them "input". Meh. */
- std::string mSourceTimes;
- /** Source URL of the value values. Collada calls them "output". */
- std::string mSourceValues;
-};
-
-/** An animation. Container for 0-x animation channels or 0-x animations */
-struct Animation
-{
- /** Anim name */
- std::string mName;
-
- /** the animation channels, if any */
- std::vector<AnimationChannel> mChannels;
-
- /** the sub-animations, if any */
- std::vector<Animation*> mSubAnims;
-
- /** Destructor */
- ~Animation()
- {
- for ( std::vector<Animation*>::iterator it = mSubAnims.begin(); it != mSubAnims.end(); ++it)
- delete *it;
- }
-};
-
-/** Description of a collada animation channel which has been determined to affect the current node */
-struct ChannelEntry
-{
- const Collada::AnimationChannel* mChannel; ///> the source channel
- std::string mTransformId; // the ID of the transformation step of the node which is influenced
- size_t mTransformIndex; // Index into the node's transform chain to apply the channel to
- size_t mSubElement; // starting index inside the transform data
-
- // resolved data references
- const Collada::Accessor* mTimeAccessor; ///> Collada accessor to the time values
- const Collada::Data* mTimeData; ///> Source data array for the time values
- const Collada::Accessor* mValueAccessor; ///> Collada accessor to the key value values
- const Collada::Data* mValueData; ///> Source datat array for the key value values
-
- ChannelEntry() { mChannel = NULL; mSubElement = 0; }
-};
-
-} // end of namespace Collada
-} // end of namespace Assimp
-
-#endif // AI_COLLADAHELPER_H_INC
diff --git a/3rdparty/assimp/code/ColladaLoader.cpp b/3rdparty/assimp/code/ColladaLoader.cpp
deleted file mode 100644
index 7f7ce804..00000000
--- a/3rdparty/assimp/code/ColladaLoader.cpp
+++ /dev/null
@@ -1,1492 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
-copyright notice, this list of conditions and the
-following disclaimer.
-
-* Redistributions in binary form must reproduce the above
-copyright notice, this list of conditions and the
-following disclaimer in the documentation and/or other
-materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
-contributors may be used to endorse or promote products
-derived from this software without specific prior
-written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file Implementation of the Collada loader */
-
-#include "AssimpPCH.h"
-#ifndef ASSIMP_BUILD_NO_DAE_IMPORTER
-
-#include "../include/aiAnim.h"
-#include "ColladaLoader.h"
-#include "ColladaParser.h"
-
-#include "fast_atof.h"
-#include "ParsingUtils.h"
-#include "SkeletonMeshBuilder.h"
-
-#include "time.h"
-
-using namespace Assimp;
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-ColladaLoader::ColladaLoader()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-ColladaLoader::~ColladaLoader()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the class can handle the format of the given file.
-bool ColladaLoader::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const
-{
- // check file extension
- std::string extension = GetExtension(pFile);
-
- if ( extension == "dae")
- return true;
-
- // XML - too generic, we need to open the file and search for typical keywords
- if ( extension == "xml" || !extension.length() || checkSig) {
- /* If CanRead() is called in order to check whether we
- * support a specific file extension in general pIOHandler
- * might be NULL and it's our duty to return true here.
- */
- if (!pIOHandler)return true;
- const char* tokens[] = {"collada"};
- return SearchFileHeaderForToken(pIOHandler,pFile,tokens,1);
- }
- return false;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Get file extension list
-void ColladaLoader::GetExtensionList( std::set<std::string>& extensions )
-{
- extensions.insert("dae");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Imports the given file into the given scene structure.
-void ColladaLoader::InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler)
-{
- mFileName = pFile;
-
- // clean all member arrays - just for safety, it should work even if we did not
- mMeshIndexByID.clear();
- mMaterialIndexByName.clear();
- mMeshes.clear();
- newMats.clear();
- mLights.clear();
- mCameras.clear();
- mTextures.clear();
-
- // parse the input file
- ColladaParser parser( pIOHandler, pFile);
-
- if ( !parser.mRootNode)
- throw DeadlyImportError( "Collada: File came out empty. Something is wrong here.");
-
- // reserve some storage to avoid unnecessary reallocs
- newMats.reserve(parser.mMaterialLibrary.size()*2);
- mMeshes.reserve(parser.mMeshLibrary.size()*2);
-
- mCameras.reserve(parser.mCameraLibrary.size());
- mLights.reserve(parser.mLightLibrary.size());
-
- // create the materials first, for the meshes to find
- BuildMaterials( parser, pScene);
-
- // build the node hierarchy from it
- pScene->mRootNode = BuildHierarchy( parser, parser.mRootNode);
-
- // ... then fill the materials with the now adjusted settings
- FillMaterials(parser, pScene);
-
- // Convert to Y_UP, if different orientation
- if ( parser.mUpDirection == ColladaParser::UP_X)
- pScene->mRootNode->mTransformation *= aiMatrix4x4(
- 0, -1, 0, 0,
- 1, 0, 0, 0,
- 0, 0, 1, 0,
- 0, 0, 0, 1);
- else if ( parser.mUpDirection == ColladaParser::UP_Z)
- pScene->mRootNode->mTransformation *= aiMatrix4x4(
- 1, 0, 0, 0,
- 0, 0, 1, 0,
- 0, -1, 0, 0,
- 0, 0, 0, 1);
-
- // store all meshes
- StoreSceneMeshes( pScene);
-
- // store all materials
- StoreSceneMaterials( pScene);
-
- // store all lights
- StoreSceneLights( pScene);
-
- // store all cameras
- StoreSceneCameras( pScene);
-
- // store all animations
- StoreAnimations( pScene, parser);
-
-
- // If no meshes have been loaded, it's probably just an animated skeleton.
- if (!pScene->mNumMeshes) {
-
- SkeletonMeshBuilder hero(pScene);
- pScene->mFlags |= AI_SCENE_FLAGS_INCOMPLETE;
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Recursively constructs a scene node for the given parser node and returns it.
-aiNode* ColladaLoader::BuildHierarchy( const ColladaParser& pParser, const Collada::Node* pNode)
-{
- // create a node for it
- aiNode* node = new aiNode();
-
- // find a name for the new node. It's more complicated than you might think
- node->mName.Set( FindNameForNode( pNode));
-
- // calculate the transformation matrix for it
- node->mTransformation = pParser.CalculateResultTransform( pNode->mTransforms);
-
- // now resolve node instances
- std::vector<const Collada::Node*> instances;
- ResolveNodeInstances(pParser,pNode,instances);
-
- // add children. first the *real* ones
- node->mNumChildren = pNode->mChildren.size()+instances.size();
- node->mChildren = new aiNode*[node->mNumChildren];
-
- for ( size_t a = 0; a < pNode->mChildren.size(); a++)
- {
- node->mChildren[a] = BuildHierarchy( pParser, pNode->mChildren[a]);
- node->mChildren[a]->mParent = node;
- }
-
- // ... and finally the resolved node instances
- for ( size_t a = 0; a < instances.size(); a++)
- {
- node->mChildren[pNode->mChildren.size() + a] = BuildHierarchy( pParser, instances[a]);
- node->mChildren[pNode->mChildren.size() + a]->mParent = node;
- }
-
- // construct meshes
- BuildMeshesForNode( pParser, pNode, node);
-
- // construct cameras
- BuildCamerasForNode(pParser, pNode, node);
-
- // construct lights
- BuildLightsForNode(pParser, pNode, node);
- return node;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Resolve node instances
-void ColladaLoader::ResolveNodeInstances( const ColladaParser& pParser, const Collada::Node* pNode,
- std::vector<const Collada::Node*>& resolved)
-{
- // reserve enough storage
- resolved.reserve(pNode->mNodeInstances.size());
-
- // ... and iterate through all nodes to be instanced as children of pNode
- for (std::vector<Collada::NodeInstance>::const_iterator it = pNode->mNodeInstances.begin(),
- end = pNode->mNodeInstances.end(); it != end; ++it)
- {
- // find the corresponding node in the library
- const ColladaParser::NodeLibrary::const_iterator itt = pParser.mNodeLibrary.find((*it).mNode);
- Collada::Node* nd = itt == pParser.mNodeLibrary.end() ? NULL : (*itt).second;
-
- // FIX for http://sourceforge.net/tracker/?func=detail&aid=3054873&group_id=226462&atid=1067632
- // need to check for both name and ID to catch all. To avoid breaking valid files,
- // the workaround is only enabled when the first attempt to resolve the node has failed.
- if (!nd) {
- nd = const_cast<Collada::Node*>(FindNode(pParser.mRootNode,(*it).mNode));
- }
- if (!nd)
- DefaultLogger::get()->error("Collada: Unable to resolve reference to instanced node " + (*it).mNode);
-
- else {
- // attach this node to the list of children
- resolved.push_back(nd);
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Resolve UV channels
-void ColladaLoader::ApplyVertexToEffectSemanticMapping(Collada::Sampler& sampler,
- const Collada::SemanticMappingTable& table)
-{
- std::map<std::string, Collada::InputSemanticMapEntry>::const_iterator it = table.mMap.find(sampler.mUVChannel);
- if (it != table.mMap.end()) {
- if (it->second.mType != Collada::IT_Texcoord)
- DefaultLogger::get()->error("Collada: Unexpected effect input mapping");
-
- sampler.mUVId = it->second.mSet;
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Builds lights for the given node and references them
-void ColladaLoader::BuildLightsForNode( const ColladaParser& pParser, const Collada::Node* pNode, aiNode* pTarget)
-{
- BOOST_FOREACH( const Collada::LightInstance& lid, pNode->mLights)
- {
- // find the referred light
- ColladaParser::LightLibrary::const_iterator srcLightIt = pParser.mLightLibrary.find( lid.mLight);
- if ( srcLightIt == pParser.mLightLibrary.end())
- {
- DefaultLogger::get()->warn("Collada: Unable to find light for ID \"" + lid.mLight + "\". Skipping.");
- continue;
- }
- const Collada::Light* srcLight = &srcLightIt->second;
- if (srcLight->mType == aiLightSource_AMBIENT) {
- DefaultLogger::get()->error("Collada: Skipping ambient light for the moment");
- continue;
- }
-
- // now fill our ai data structure
- aiLight* out = new aiLight();
- out->mName = pTarget->mName;
- out->mType = (aiLightSourceType)srcLight->mType;
-
- // collada lights point in -Z by default, rest is specified in node transform
- out->mDirection = aiVector3D(0.f,0.f,-1.f);
-
- out->mAttenuationConstant = srcLight->mAttConstant;
- out->mAttenuationLinear = srcLight->mAttLinear;
- out->mAttenuationQuadratic = srcLight->mAttQuadratic;
-
- // collada doesn't differenciate between these color types
- out->mColorDiffuse = out->mColorSpecular = out->mColorAmbient = srcLight->mColor*srcLight->mIntensity;
-
- // convert falloff angle and falloff exponent in our representation, if given
- if (out->mType == aiLightSource_SPOT) {
-
- out->mAngleInnerCone = AI_DEG_TO_RAD( srcLight->mFalloffAngle );
-
- // ... some extension magic. FUCKING COLLADA.
- if (srcLight->mOuterAngle == 10e10f)
- {
- // ... some deprecation magic. FUCKING FCOLLADA.
- if (srcLight->mPenumbraAngle == 10e10f)
- {
- // Need to rely on falloff_exponent. I don't know how to interpret it, so I need to guess ....
- // epsilon chosen to be 0.1
- out->mAngleOuterCone = AI_DEG_TO_RAD (acos(pow(0.1f,1.f/srcLight->mFalloffExponent))+
- srcLight->mFalloffAngle);
- }
- else {
- out->mAngleOuterCone = out->mAngleInnerCone + AI_DEG_TO_RAD( srcLight->mPenumbraAngle );
- if (out->mAngleOuterCone < out->mAngleInnerCone)
- std::swap(out->mAngleInnerCone,out->mAngleOuterCone);
- }
- }
- else out->mAngleOuterCone = AI_DEG_TO_RAD( srcLight->mOuterAngle );
- }
-
- // add to light list
- mLights.push_back(out);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Builds cameras for the given node and references them
-void ColladaLoader::BuildCamerasForNode( const ColladaParser& pParser, const Collada::Node* pNode, aiNode* pTarget)
-{
- BOOST_FOREACH( const Collada::CameraInstance& cid, pNode->mCameras)
- {
- // find the referred light
- ColladaParser::CameraLibrary::const_iterator srcCameraIt = pParser.mCameraLibrary.find( cid.mCamera);
- if ( srcCameraIt == pParser.mCameraLibrary.end())
- {
- DefaultLogger::get()->warn("Collada: Unable to find camera for ID \"" + cid.mCamera + "\". Skipping.");
- continue;
- }
- const Collada::Camera* srcCamera = &srcCameraIt->second;
-
- // orthographic cameras not yet supported in Assimp
- if (srcCamera->mOrtho) {
- DefaultLogger::get()->warn("Collada: Orthographic cameras are not supported.");
- }
-
- // now fill our ai data structure
- aiCamera* out = new aiCamera();
- out->mName = pTarget->mName;
-
- // collada cameras point in -Z by default, rest is specified in node transform
- out->mLookAt = aiVector3D(0.f,0.f,-1.f);
-
- // near/far z is already ok
- out->mClipPlaneFar = srcCamera->mZFar;
- out->mClipPlaneNear = srcCamera->mZNear;
-
- // ... but for the rest some values are optional
- // and we need to compute the others in any combination. FUCKING COLLADA.
- if (srcCamera->mAspect != 10e10f)
- out->mAspect = srcCamera->mAspect;
-
- if (srcCamera->mHorFov != 10e10f) {
- out->mHorizontalFOV = srcCamera->mHorFov;
-
- if (srcCamera->mVerFov != 10e10f && srcCamera->mAspect == 10e10f) {
- out->mAspect = tan(AI_DEG_TO_RAD(srcCamera->mHorFov)) /
- tan(AI_DEG_TO_RAD(srcCamera->mVerFov));
- }
- }
- else if (srcCamera->mAspect != 10e10f && srcCamera->mVerFov != 10e10f) {
- out->mHorizontalFOV = 2.0f * AI_RAD_TO_DEG(atan(srcCamera->mAspect *
- tan(AI_DEG_TO_RAD(srcCamera->mVerFov) * 0.5f)));
- }
-
- // Collada uses degrees, we use radians
- out->mHorizontalFOV = AI_DEG_TO_RAD(out->mHorizontalFOV);
-
- // add to camera list
- mCameras.push_back(out);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Builds meshes for the given node and references them
-void ColladaLoader::BuildMeshesForNode( const ColladaParser& pParser, const Collada::Node* pNode, aiNode* pTarget)
-{
- // accumulated mesh references by this node
- std::vector<size_t> newMeshRefs;
- newMeshRefs.reserve(pNode->mMeshes.size());
-
- // add a mesh for each subgroup in each collada mesh
- BOOST_FOREACH( const Collada::MeshInstance& mid, pNode->mMeshes)
- {
- const Collada::Mesh* srcMesh = NULL;
- const Collada::Controller* srcController = NULL;
-
- // find the referred mesh
- ColladaParser::MeshLibrary::const_iterator srcMeshIt = pParser.mMeshLibrary.find( mid.mMeshOrController);
- if ( srcMeshIt == pParser.mMeshLibrary.end())
- {
- // if not found in the mesh-library, it might also be a controller referring to a mesh
- ColladaParser::ControllerLibrary::const_iterator srcContrIt = pParser.mControllerLibrary.find( mid.mMeshOrController);
- if ( srcContrIt != pParser.mControllerLibrary.end())
- {
- srcController = &srcContrIt->second;
- srcMeshIt = pParser.mMeshLibrary.find( srcController->mMeshId);
- if ( srcMeshIt != pParser.mMeshLibrary.end())
- srcMesh = srcMeshIt->second;
- }
-
- if ( !srcMesh)
- {
- DefaultLogger::get()->warn( boost::str( boost::format( "Collada: Unable to find geometry for ID \"%s\". Skipping.") % mid.mMeshOrController));
- continue;
- }
- } else
- {
- // ID found in the mesh library -> direct reference to an unskinned mesh
- srcMesh = srcMeshIt->second;
- }
-
- // build a mesh for each of its subgroups
- size_t vertexStart = 0, faceStart = 0;
- for ( size_t sm = 0; sm < srcMesh->mSubMeshes.size(); ++sm)
- {
- const Collada::SubMesh& submesh = srcMesh->mSubMeshes[sm];
- if ( submesh.mNumFaces == 0)
- continue;
-
- // find material assigned to this submesh
- std::string meshMaterial;
- std::map<std::string, Collada::SemanticMappingTable >::const_iterator meshMatIt = mid.mMaterials.find( submesh.mMaterial);
-
- const Collada::SemanticMappingTable* table = NULL;
- if ( meshMatIt != mid.mMaterials.end())
- {
- table = &meshMatIt->second;
- meshMaterial = table->mMatName;
- }
- else
- {
- DefaultLogger::get()->warn( boost::str( boost::format( "Collada: No material specified for subgroup \"%s\" in geometry \"%s\".") % submesh.mMaterial % mid.mMeshOrController));
- if ( !mid.mMaterials.empty() )
- meshMaterial = mid.mMaterials.begin()->second.mMatName;
- }
-
- // OK ... here the *real* fun starts ... we have the vertex-input-to-effect-semantic-table
- // given. The only mapping stuff which we do actually support is the UV channel.
- std::map<std::string, size_t>::const_iterator matIt = mMaterialIndexByName.find( meshMaterial);
- unsigned int matIdx;
- if ( matIt != mMaterialIndexByName.end())
- matIdx = matIt->second;
- else
- matIdx = 0;
-
- if (table && !table->mMap.empty() ) {
- std::pair<Collada::Effect*, aiMaterial*>& mat = newMats[matIdx];
-
- // Iterate through all texture channels assigned to the effect and
- // check whether we have mapping information for it.
- ApplyVertexToEffectSemanticMapping(mat.first->mTexDiffuse, *table);
- ApplyVertexToEffectSemanticMapping(mat.first->mTexAmbient, *table);
- ApplyVertexToEffectSemanticMapping(mat.first->mTexSpecular, *table);
- ApplyVertexToEffectSemanticMapping(mat.first->mTexEmissive, *table);
- ApplyVertexToEffectSemanticMapping(mat.first->mTexTransparent,*table);
- ApplyVertexToEffectSemanticMapping(mat.first->mTexBump, *table);
- }
-
- // built lookup index of the Mesh-Submesh-Material combination
- ColladaMeshIndex index( mid.mMeshOrController, sm, meshMaterial);
-
- // if we already have the mesh at the library, just add its index to the node's array
- std::map<ColladaMeshIndex, size_t>::const_iterator dstMeshIt = mMeshIndexByID.find( index);
- if ( dstMeshIt != mMeshIndexByID.end()) {
- newMeshRefs.push_back( dstMeshIt->second);
- }
- else
- {
- // else we have to add the mesh to the collection and store its newly assigned index at the node
- aiMesh* dstMesh = CreateMesh( pParser, srcMesh, submesh, srcController, vertexStart, faceStart);
-
- // store the mesh, and store its new index in the node
- newMeshRefs.push_back( mMeshes.size());
- mMeshIndexByID[index] = mMeshes.size();
- mMeshes.push_back( dstMesh);
- vertexStart += dstMesh->mNumVertices; faceStart += submesh.mNumFaces;
-
- // assign the material index
- dstMesh->mMaterialIndex = matIdx;
- }
- }
- }
-
- // now place all mesh references we gathered in the target node
- pTarget->mNumMeshes = newMeshRefs.size();
- if ( newMeshRefs.size())
- {
- pTarget->mMeshes = new unsigned int[pTarget->mNumMeshes];
- std::copy( newMeshRefs.begin(), newMeshRefs.end(), pTarget->mMeshes);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Creates a mesh for the given ColladaMesh face subset and returns the newly created mesh
-aiMesh* ColladaLoader::CreateMesh( const ColladaParser& pParser, const Collada::Mesh* pSrcMesh, const Collada::SubMesh& pSubMesh,
- const Collada::Controller* pSrcController, size_t pStartVertex, size_t pStartFace)
-{
- aiMesh* dstMesh = new aiMesh;
-
- // count the vertices addressed by its faces
- const size_t numVertices = std::accumulate( pSrcMesh->mFaceSize.begin() + pStartFace,
- pSrcMesh->mFaceSize.begin() + pStartFace + pSubMesh.mNumFaces, 0);
-
- // copy positions
- dstMesh->mNumVertices = numVertices;
- dstMesh->mVertices = new aiVector3D[numVertices];
- std::copy( pSrcMesh->mPositions.begin() + pStartVertex, pSrcMesh->mPositions.begin() +
- pStartVertex + numVertices, dstMesh->mVertices);
-
- // normals, if given. HACK: (thom) Due to the fucking Collada spec we never
- // know if we have the same number of normals as there are positions. So we
- // also ignore any vertex attribute if it has a different count
- if ( pSrcMesh->mNormals.size() >= pStartVertex + numVertices)
- {
- dstMesh->mNormals = new aiVector3D[numVertices];
- std::copy( pSrcMesh->mNormals.begin() + pStartVertex, pSrcMesh->mNormals.begin() +
- pStartVertex + numVertices, dstMesh->mNormals);
- }
-
- // tangents, if given.
- if ( pSrcMesh->mTangents.size() >= pStartVertex + numVertices)
- {
- dstMesh->mTangents = new aiVector3D[numVertices];
- std::copy( pSrcMesh->mTangents.begin() + pStartVertex, pSrcMesh->mTangents.begin() +
- pStartVertex + numVertices, dstMesh->mTangents);
- }
-
- // bitangents, if given.
- if ( pSrcMesh->mBitangents.size() >= pStartVertex + numVertices)
- {
- dstMesh->mBitangents = new aiVector3D[numVertices];
- std::copy( pSrcMesh->mBitangents.begin() + pStartVertex, pSrcMesh->mBitangents.begin() +
- pStartVertex + numVertices, dstMesh->mBitangents);
- }
-
- // same for texturecoords, as many as we have
- // empty slots are not allowed, need to pack and adjust UV indexes accordingly
- for ( size_t a = 0, real = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; a++)
- {
- if ( pSrcMesh->mTexCoords[a].size() >= pStartVertex + numVertices)
- {
- dstMesh->mTextureCoords[real] = new aiVector3D[numVertices];
- for ( size_t b = 0; b < numVertices; ++b)
- dstMesh->mTextureCoords[real][b] = pSrcMesh->mTexCoords[a][pStartVertex+b];
-
- dstMesh->mNumUVComponents[real] = pSrcMesh->mNumUVComponents[a];
- ++real;
- }
- }
-
- // same for vertex colors, as many as we have. again the same packing to avoid empty slots
- for ( size_t a = 0, real = 0; a < AI_MAX_NUMBER_OF_COLOR_SETS; a++)
- {
- if ( pSrcMesh->mColors[a].size() >= pStartVertex + numVertices)
- {
- dstMesh->mColors[real] = new aiColor4D[numVertices];
- std::copy( pSrcMesh->mColors[a].begin() + pStartVertex, pSrcMesh->mColors[a].begin() + pStartVertex + numVertices,dstMesh->mColors[real]);
- ++real;
- }
- }
-
- // create faces. Due to the fact that each face uses unique vertices, we can simply count up on each vertex
- size_t vertex = 0;
- dstMesh->mNumFaces = pSubMesh.mNumFaces;
- dstMesh->mFaces = new aiFace[dstMesh->mNumFaces];
- for ( size_t a = 0; a < dstMesh->mNumFaces; ++a)
- {
- size_t s = pSrcMesh->mFaceSize[ pStartFace + a];
- aiFace& face = dstMesh->mFaces[a];
- face.mNumIndices = s;
- face.mIndices = new unsigned int[s];
- for ( size_t b = 0; b < s; ++b)
- face.mIndices[b] = vertex++;
- }
-
- // create bones if given
- if ( pSrcController)
- {
- // refuse if the vertex count does not match
-// if ( pSrcController->mWeightCounts.size() != dstMesh->mNumVertices)
-// throw DeadlyImportError( "Joint Controller vertex count does not match mesh vertex count");
-
- // resolve references - joint names
- const Collada::Accessor& jointNamesAcc = pParser.ResolveLibraryReference( pParser.mAccessorLibrary, pSrcController->mJointNameSource);
- const Collada::Data& jointNames = pParser.ResolveLibraryReference( pParser.mDataLibrary, jointNamesAcc.mSource);
- // joint offset matrices
- const Collada::Accessor& jointMatrixAcc = pParser.ResolveLibraryReference( pParser.mAccessorLibrary, pSrcController->mJointOffsetMatrixSource);
- const Collada::Data& jointMatrices = pParser.ResolveLibraryReference( pParser.mDataLibrary, jointMatrixAcc.mSource);
- // joint vertex_weight name list - should refer to the same list as the joint names above. If not, report and reconsider
- const Collada::Accessor& weightNamesAcc = pParser.ResolveLibraryReference( pParser.mAccessorLibrary, pSrcController->mWeightInputJoints.mAccessor);
- if ( &weightNamesAcc != &jointNamesAcc)
- throw DeadlyImportError( "Temporary implementational lazyness. If you read this, please report to the author.");
- // vertex weights
- const Collada::Accessor& weightsAcc = pParser.ResolveLibraryReference( pParser.mAccessorLibrary, pSrcController->mWeightInputWeights.mAccessor);
- const Collada::Data& weights = pParser.ResolveLibraryReference( pParser.mDataLibrary, weightsAcc.mSource);
-
- if ( !jointNames.mIsStringArray || jointMatrices.mIsStringArray || weights.mIsStringArray)
- throw DeadlyImportError( "Data type mismatch while resolving mesh joints");
- // sanity check: we rely on the vertex weights always coming as pairs of BoneIndex-WeightIndex
- if ( pSrcController->mWeightInputJoints.mOffset != 0 || pSrcController->mWeightInputWeights.mOffset != 1)
- throw DeadlyImportError( "Unsupported vertex_weight adresssing scheme. Fucking collada spec.");
-
- // create containers to collect the weights for each bone
- size_t numBones = jointNames.mStrings.size();
- std::vector<std::vector<aiVertexWeight> > dstBones( numBones);
-
- // build a temporary array of pointers to the start of each vertex's weights
- typedef std::vector< std::pair<size_t, size_t> > IndexPairVector;
- std::vector<IndexPairVector::const_iterator> weightStartPerVertex( pSrcController->mWeightCounts.size());
- IndexPairVector::const_iterator pit = pSrcController->mWeights.begin();
- for ( size_t a = 0; a < pSrcController->mWeightCounts.size(); ++a)
- {
- weightStartPerVertex[a] = pit;
- pit += pSrcController->mWeightCounts[a];
- }
-
- // now for each vertex put the corresponding vertex weights into each bone's weight collection
- for ( size_t a = pStartVertex; a < pStartVertex + numVertices; ++a)
- {
- // which position index was responsible for this vertex? that's also the index by which
- // the controller assigns the vertex weights
- size_t orgIndex = pSrcMesh->mFacePosIndices[a];
- // find the vertex weights for this vertex
- IndexPairVector::const_iterator iit = weightStartPerVertex[orgIndex];
- size_t pairCount = pSrcController->mWeightCounts[orgIndex];
-
- for ( size_t b = 0; b < pairCount; ++b, ++iit)
- {
- size_t jointIndex = iit->first;
- size_t vertexIndex = iit->second;
-
- float weight = ReadFloat( weightsAcc, weights, vertexIndex, 0);
-
- // one day I gonna kill that XSI Collada exporter
- if ( weight > 0.0f)
- {
- aiVertexWeight w;
- w.mVertexId = a - pStartVertex;
- w.mWeight = weight;
- dstBones[jointIndex].push_back( w);
- }
- }
- }
-
- // count the number of bones which influence vertices of the current submesh
- size_t numRemainingBones = 0;
- for ( std::vector<std::vector<aiVertexWeight> >::const_iterator it = dstBones.begin(); it != dstBones.end(); ++it)
- if ( it->size() > 0)
- numRemainingBones++;
-
- // create bone array and copy bone weights one by one
- dstMesh->mNumBones = numRemainingBones;
- dstMesh->mBones = new aiBone*[numRemainingBones];
- size_t boneCount = 0;
- for ( size_t a = 0; a < numBones; ++a)
- {
- // omit bones without weights
- if ( dstBones[a].size() == 0)
- continue;
-
- // create bone with its weights
- aiBone* bone = new aiBone;
- bone->mName = ReadString( jointNamesAcc, jointNames, a);
- bone->mOffsetMatrix.a1 = ReadFloat( jointMatrixAcc, jointMatrices, a, 0);
- bone->mOffsetMatrix.a2 = ReadFloat( jointMatrixAcc, jointMatrices, a, 1);
- bone->mOffsetMatrix.a3 = ReadFloat( jointMatrixAcc, jointMatrices, a, 2);
- bone->mOffsetMatrix.a4 = ReadFloat( jointMatrixAcc, jointMatrices, a, 3);
- bone->mOffsetMatrix.b1 = ReadFloat( jointMatrixAcc, jointMatrices, a, 4);
- bone->mOffsetMatrix.b2 = ReadFloat( jointMatrixAcc, jointMatrices, a, 5);
- bone->mOffsetMatrix.b3 = ReadFloat( jointMatrixAcc, jointMatrices, a, 6);
- bone->mOffsetMatrix.b4 = ReadFloat( jointMatrixAcc, jointMatrices, a, 7);
- bone->mOffsetMatrix.c1 = ReadFloat( jointMatrixAcc, jointMatrices, a, 8);
- bone->mOffsetMatrix.c2 = ReadFloat( jointMatrixAcc, jointMatrices, a, 9);
- bone->mOffsetMatrix.c3 = ReadFloat( jointMatrixAcc, jointMatrices, a, 10);
- bone->mOffsetMatrix.c4 = ReadFloat( jointMatrixAcc, jointMatrices, a, 11);
- bone->mNumWeights = dstBones[a].size();
- bone->mWeights = new aiVertexWeight[bone->mNumWeights];
- std::copy( dstBones[a].begin(), dstBones[a].end(), bone->mWeights);
-
- // apply bind shape matrix to offset matrix
- aiMatrix4x4 bindShapeMatrix;
- bindShapeMatrix.a1 = pSrcController->mBindShapeMatrix[0];
- bindShapeMatrix.a2 = pSrcController->mBindShapeMatrix[1];
- bindShapeMatrix.a3 = pSrcController->mBindShapeMatrix[2];
- bindShapeMatrix.a4 = pSrcController->mBindShapeMatrix[3];
- bindShapeMatrix.b1 = pSrcController->mBindShapeMatrix[4];
- bindShapeMatrix.b2 = pSrcController->mBindShapeMatrix[5];
- bindShapeMatrix.b3 = pSrcController->mBindShapeMatrix[6];
- bindShapeMatrix.b4 = pSrcController->mBindShapeMatrix[7];
- bindShapeMatrix.c1 = pSrcController->mBindShapeMatrix[8];
- bindShapeMatrix.c2 = pSrcController->mBindShapeMatrix[9];
- bindShapeMatrix.c3 = pSrcController->mBindShapeMatrix[10];
- bindShapeMatrix.c4 = pSrcController->mBindShapeMatrix[11];
- bindShapeMatrix.d1 = pSrcController->mBindShapeMatrix[12];
- bindShapeMatrix.d2 = pSrcController->mBindShapeMatrix[13];
- bindShapeMatrix.d3 = pSrcController->mBindShapeMatrix[14];
- bindShapeMatrix.d4 = pSrcController->mBindShapeMatrix[15];
- bone->mOffsetMatrix *= bindShapeMatrix;
-
- // HACK: (thom) Some exporters address the bone nodes by SID, others address them by ID or even name.
- // Therefore I added a little name replacement here: I search for the bone's node by either name, ID or SID,
- // and replace the bone's name by the node's name so that the user can use the standard
- // find-by-name method to associate nodes with bones.
- const Collada::Node* bnode = FindNode( pParser.mRootNode, bone->mName.data);
- if ( !bnode)
- bnode = FindNodeBySID( pParser.mRootNode, bone->mName.data);
-
- // assign the name that we would have assigned for the source node
- if ( bnode)
- bone->mName.Set( FindNameForNode( bnode));
- else
- DefaultLogger::get()->warn( boost::str( boost::format( "ColladaLoader::CreateMesh(): could not find corresponding node for joint \"%s\".") % bone->mName.data));
-
- // and insert bone
- dstMesh->mBones[boneCount++] = bone;
- }
- }
-
- return dstMesh;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Stores all meshes in the given scene
-void ColladaLoader::StoreSceneMeshes( aiScene* pScene)
-{
- pScene->mNumMeshes = mMeshes.size();
- if ( mMeshes.size() > 0)
- {
- pScene->mMeshes = new aiMesh*[mMeshes.size()];
- std::copy( mMeshes.begin(), mMeshes.end(), pScene->mMeshes);
- mMeshes.clear();
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Stores all cameras in the given scene
-void ColladaLoader::StoreSceneCameras( aiScene* pScene)
-{
- pScene->mNumCameras = mCameras.size();
- if ( mCameras.size() > 0)
- {
- pScene->mCameras = new aiCamera*[mCameras.size()];
- std::copy( mCameras.begin(), mCameras.end(), pScene->mCameras);
- mCameras.clear();
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Stores all lights in the given scene
-void ColladaLoader::StoreSceneLights( aiScene* pScene)
-{
- pScene->mNumLights = mLights.size();
- if ( mLights.size() > 0)
- {
- pScene->mLights = new aiLight*[mLights.size()];
- std::copy( mLights.begin(), mLights.end(), pScene->mLights);
- mLights.clear();
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Stores all textures in the given scene
-void ColladaLoader::StoreSceneTextures( aiScene* pScene)
-{
- pScene->mNumTextures = mTextures.size();
- if ( mTextures.size() > 0)
- {
- pScene->mTextures = new aiTexture*[mTextures.size()];
- std::copy( mTextures.begin(), mTextures.end(), pScene->mTextures);
- mTextures.clear();
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Stores all materials in the given scene
-void ColladaLoader::StoreSceneMaterials( aiScene* pScene)
-{
- pScene->mNumMaterials = newMats.size();
-
- if (newMats.size() > 0) {
- pScene->mMaterials = new aiMaterial*[newMats.size()];
- for (unsigned int i = 0; i < newMats.size();++i)
- pScene->mMaterials[i] = newMats[i].second;
-
- newMats.clear();
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Stores all animations
-void ColladaLoader::StoreAnimations( aiScene* pScene, const ColladaParser& pParser)
-{
- // recursivly collect all animations from the collada scene
- StoreAnimations( pScene, pParser, &pParser.mAnims, "");
-
- // catch special case: many animations with the same length, each affecting only a single node.
- // we need to unite all those single-node-anims to a proper combined animation
- for ( size_t a = 0; a < mAnims.size(); ++a)
- {
- aiAnimation* templateAnim = mAnims[a];
- if ( templateAnim->mNumChannels == 1)
- {
- // search for other single-channel-anims with the same duration
- std::vector<size_t> collectedAnimIndices;
- for ( size_t b = a+1; b < mAnims.size(); ++b)
- {
- aiAnimation* other = mAnims[b];
- if ( other->mNumChannels == 1 && other->mDuration == templateAnim->mDuration && other->mTicksPerSecond == templateAnim->mTicksPerSecond )
- collectedAnimIndices.push_back( b);
- }
-
- // if there are other animations which fit the template anim, combine all channels into a single anim
- if ( !collectedAnimIndices.empty() )
- {
- aiAnimation* combinedAnim = new aiAnimation();
- combinedAnim->mName = aiString( std::string( "combinedAnim_") + char( '0' + a));
- combinedAnim->mDuration = templateAnim->mDuration;
- combinedAnim->mTicksPerSecond = templateAnim->mTicksPerSecond;
- combinedAnim->mNumChannels = collectedAnimIndices.size() + 1;
- combinedAnim->mChannels = new aiNodeAnim*[combinedAnim->mNumChannels];
- // add the template anim as first channel by moving its aiNodeAnim to the combined animation
- combinedAnim->mChannels[0] = templateAnim->mChannels[0];
- templateAnim->mChannels[0] = NULL;
- delete templateAnim;
- // combined animation replaces template animation in the anim array
- mAnims[a] = combinedAnim;
-
- // move the memory of all other anims to the combined anim and erase them from the source anims
- for ( size_t b = 0; b < collectedAnimIndices.size(); ++b)
- {
- aiAnimation* srcAnimation = mAnims[collectedAnimIndices[b]];
- combinedAnim->mChannels[1 + b] = srcAnimation->mChannels[0];
- srcAnimation->mChannels[0] = NULL;
- delete srcAnimation;
- }
-
- // in a second go, delete all the single-channel-anims that we've stripped from their channels
- // back to front to preserve indices - you know, removing an element from a vector moves all elements behind the removed one
- while ( !collectedAnimIndices.empty() )
- {
- mAnims.erase( mAnims.begin() + collectedAnimIndices.back());
- collectedAnimIndices.pop_back();
- }
- }
- }
- }
-
- // now store all anims in the scene
- if ( !mAnims.empty())
- {
- pScene->mNumAnimations = mAnims.size();
- pScene->mAnimations = new aiAnimation*[mAnims.size()];
- std::copy( mAnims.begin(), mAnims.end(), pScene->mAnimations);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Constructs the animations for the given source anim
-void ColladaLoader::StoreAnimations( aiScene* pScene, const ColladaParser& pParser, const Collada::Animation* pSrcAnim, const std::string pPrefix)
-{
- std::string animName = pPrefix.empty() ? pSrcAnim->mName : pPrefix + "_" + pSrcAnim->mName;
-
- // create nested animations, if given
- for ( std::vector<Collada::Animation*>::const_iterator it = pSrcAnim->mSubAnims.begin(); it != pSrcAnim->mSubAnims.end(); ++it)
- StoreAnimations( pScene, pParser, *it, animName);
-
- // create animation channels, if any
- if ( !pSrcAnim->mChannels.empty())
- CreateAnimation( pScene, pParser, pSrcAnim, animName);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Constructs the animation for the given source anim
-void ColladaLoader::CreateAnimation( aiScene* pScene, const ColladaParser& pParser, const Collada::Animation* pSrcAnim, const std::string& pName)
-{
- // collect a list of animatable nodes
- std::vector<const aiNode*> nodes;
- CollectNodes( pScene->mRootNode, nodes);
-
- std::vector<aiNodeAnim*> anims;
- for ( std::vector<const aiNode*>::const_iterator nit = nodes.begin(); nit != nodes.end(); ++nit)
- {
- // find all the collada anim channels which refer to the current node
- std::vector<Collada::ChannelEntry> entries;
- std::string nodeName = (*nit)->mName.data;
-
- // find the collada node corresponding to the aiNode
- const Collada::Node* srcNode = FindNode( pParser.mRootNode, nodeName);
-// ai_assert( srcNode != NULL);
- if ( !srcNode)
- continue;
-
- // now check all channels if they affect the current node
- for ( std::vector<Collada::AnimationChannel>::const_iterator cit = pSrcAnim->mChannels.begin();
- cit != pSrcAnim->mChannels.end(); ++cit)
- {
- const Collada::AnimationChannel& srcChannel = *cit;
- Collada::ChannelEntry entry;
-
- // we except the animation target to be of type "nodeName/transformID.subElement". Ignore all others
- // find the slash that separates the node name - there should be only one
- std::string::size_type slashPos = srcChannel.mTarget.find( '/');
- if ( slashPos == std::string::npos)
- continue;
- if ( srcChannel.mTarget.find( '/', slashPos+1) != std::string::npos)
- continue;
- std::string targetID = srcChannel.mTarget.substr( 0, slashPos);
- if ( targetID != srcNode->mID)
- continue;
-
- // find the dot that separates the transformID - there should be only one or zero
- std::string::size_type dotPos = srcChannel.mTarget.find( '.');
- if ( dotPos != std::string::npos)
- {
- if ( srcChannel.mTarget.find( '.', dotPos+1) != std::string::npos)
- continue;
-
- entry.mTransformId = srcChannel.mTarget.substr( slashPos+1, dotPos - slashPos - 1);
-
- std::string subElement = srcChannel.mTarget.substr( dotPos+1);
- if ( subElement == "ANGLE")
- entry.mSubElement = 3; // last number in an Axis-Angle-Transform is the angle
- else if ( subElement == "X")
- entry.mSubElement = 0;
- else if ( subElement == "Y")
- entry.mSubElement = 1;
- else if ( subElement == "Z")
- entry.mSubElement = 2;
- else
- DefaultLogger::get()->warn( boost::str( boost::format( "Unknown anim subelement \"%s\". Ignoring") % subElement));
- } else
- {
- // no subelement following, transformId is remaining string
- entry.mTransformId = srcChannel.mTarget.substr( slashPos+1);
- }
-
- // determine which transform step is affected by this channel
- entry.mTransformIndex = 0xffffffff;
- for ( size_t a = 0; a < srcNode->mTransforms.size(); ++a)
- if ( srcNode->mTransforms[a].mID == entry.mTransformId)
- entry.mTransformIndex = a;
-
- if ( entry.mTransformIndex == 0xffffffff)
- continue;
-
- entry.mChannel = &(*cit);
- entries.push_back( entry);
- }
-
- // if there's no channel affecting the current node, we skip it
- if ( entries.empty())
- continue;
-
- // resolve the data pointers for all anim channels. Find the minimum time while we're at it
- float startTime = 1e20f, endTime = -1e20f;
- for ( std::vector<Collada::ChannelEntry>::iterator it = entries.begin(); it != entries.end(); ++it)
- {
- Collada::ChannelEntry& e = *it;
- e.mTimeAccessor = &pParser.ResolveLibraryReference( pParser.mAccessorLibrary, e.mChannel->mSourceTimes);
- e.mTimeData = &pParser.ResolveLibraryReference( pParser.mDataLibrary, e.mTimeAccessor->mSource);
- e.mValueAccessor = &pParser.ResolveLibraryReference( pParser.mAccessorLibrary, e.mChannel->mSourceValues);
- e.mValueData = &pParser.ResolveLibraryReference( pParser.mDataLibrary, e.mValueAccessor->mSource);
-
- // time count and value count must match
- if ( e.mTimeAccessor->mCount != e.mValueAccessor->mCount)
- throw DeadlyImportError( boost::str( boost::format( "Time count / value count mismatch in animation channel \"%s\".") % e.mChannel->mTarget));
-
- // find bounding times
- startTime = std::min( startTime, ReadFloat( *e.mTimeAccessor, *e.mTimeData, 0, 0));
- endTime = std::max( endTime, ReadFloat( *e.mTimeAccessor, *e.mTimeData, e.mTimeAccessor->mCount-1, 0));
- }
-
- // create a local transformation chain of the node's transforms
- std::vector<Collada::Transform> transforms = srcNode->mTransforms;
-
- // now for every unique point in time, find or interpolate the key values for that time
- // and apply them to the transform chain. Then the node's present transformation can be calculated.
- float time = startTime;
- std::vector<aiMatrix4x4> resultTrafos;
- while ( 1)
- {
- for ( std::vector<Collada::ChannelEntry>::iterator it = entries.begin(); it != entries.end(); ++it)
- {
- Collada::ChannelEntry& e = *it;
-
- // find the keyframe behind the current point in time
- size_t pos = 0;
- float postTime = 0.f;
- while ( 1)
- {
- if ( pos >= e.mTimeAccessor->mCount)
- break;
- postTime = ReadFloat( *e.mTimeAccessor, *e.mTimeData, pos, 0);
- if ( postTime >= time)
- break;
- ++pos;
- }
-
- pos = std::min( pos, e.mTimeAccessor->mCount-1);
-
- // read values from there
- float temp[16];
- for ( size_t c = 0; c < e.mValueAccessor->mSize; ++c)
- temp[c] = ReadFloat( *e.mValueAccessor, *e.mValueData, pos, c);
-
- // if not exactly at the key time, interpolate with previous value set
- if ( postTime > time && pos > 0)
- {
- float preTime = ReadFloat( *e.mTimeAccessor, *e.mTimeData, pos-1, 0);
- float factor = (time - postTime) / (preTime - postTime);
-
- for ( size_t c = 0; c < e.mValueAccessor->mSize; ++c)
- {
- float v = ReadFloat( *e.mValueAccessor, *e.mValueData, pos-1, c);
- temp[c] += (v - temp[c]) * factor;
- }
- }
-
- // Apply values to current transformation
- std::copy( temp, temp + e.mValueAccessor->mSize, transforms[e.mTransformIndex].f + e.mSubElement);
- }
-
- // Calculate resulting transformation
- aiMatrix4x4 mat = pParser.CalculateResultTransform( transforms);
-
- // out of lazyness: we store the time in matrix.d4
- mat.d4 = time;
- resultTrafos.push_back( mat);
-
- // find next point in time to evaluate. That's the closest frame larger than the current in any channel
- float nextTime = 1e20f;
- for ( std::vector<Collada::ChannelEntry>::iterator it = entries.begin(); it != entries.end(); ++it)
- {
- Collada::ChannelEntry& e = *it;
-
- // find the next time value larger than the current
- size_t pos = 0;
- while ( pos < e.mTimeAccessor->mCount)
- {
- float t = ReadFloat( *e.mTimeAccessor, *e.mTimeData, pos, 0);
- if ( t > time)
- {
- nextTime = std::min( nextTime, t);
- break;
- }
- ++pos;
- }
- }
-
- // no more keys on any channel after the current time -> we're done
- if ( nextTime > 1e19)
- break;
-
- // else construct next keyframe at this following time point
- time = nextTime;
- }
-
- // there should be some keyframes
- ai_assert( resultTrafos.size() > 0);
-
- // build an animation channel for the given node out of these trafo keys
- aiNodeAnim* dstAnim = new aiNodeAnim;
- dstAnim->mNodeName = nodeName;
- dstAnim->mNumPositionKeys = resultTrafos.size();
- dstAnim->mNumRotationKeys= resultTrafos.size();
- dstAnim->mNumScalingKeys = resultTrafos.size();
- dstAnim->mPositionKeys = new aiVectorKey[resultTrafos.size()];
- dstAnim->mRotationKeys = new aiQuatKey[resultTrafos.size()];
- dstAnim->mScalingKeys = new aiVectorKey[resultTrafos.size()];
-
- for ( size_t a = 0; a < resultTrafos.size(); ++a)
- {
- const aiMatrix4x4& mat = resultTrafos[a];
- double time = double( mat.d4); // remember? time is stored in mat.d4
-
- dstAnim->mPositionKeys[a].mTime = time;
- dstAnim->mRotationKeys[a].mTime = time;
- dstAnim->mScalingKeys[a].mTime = time;
- mat.Decompose( dstAnim->mScalingKeys[a].mValue, dstAnim->mRotationKeys[a].mValue, dstAnim->mPositionKeys[a].mValue);
- }
-
- anims.push_back( dstAnim);
- }
-
- if ( !anims.empty())
- {
- aiAnimation* anim = new aiAnimation;
- anim->mName.Set( pName);
- anim->mNumChannels = anims.size();
- anim->mChannels = new aiNodeAnim*[anims.size()];
- std::copy( anims.begin(), anims.end(), anim->mChannels);
- anim->mDuration = 0.0f;
- for ( size_t a = 0; a < anims.size(); ++a)
- {
- anim->mDuration = std::max( anim->mDuration, anims[a]->mPositionKeys[anims[a]->mNumPositionKeys-1].mTime);
- anim->mDuration = std::max( anim->mDuration, anims[a]->mRotationKeys[anims[a]->mNumRotationKeys-1].mTime);
- anim->mDuration = std::max( anim->mDuration, anims[a]->mScalingKeys[anims[a]->mNumScalingKeys-1].mTime);
- }
- anim->mTicksPerSecond = 1;
- mAnims.push_back( anim);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Add a texture to a material structure
-void ColladaLoader::AddTexture ( Assimp::MaterialHelper& mat, const ColladaParser& pParser,
- const Collada::Effect& effect,
- const Collada::Sampler& sampler,
- aiTextureType type, unsigned int idx)
-{
- // first of all, basic file name
- const aiString name = FindFilenameForEffectTexture( pParser, effect, sampler.mName );
- mat.AddProperty( &name, _AI_MATKEY_TEXTURE_BASE, type, idx );
-
- // mapping mode
- int map = aiTextureMapMode_Clamp;
- if (sampler.mWrapU)
- map = aiTextureMapMode_Wrap;
- if (sampler.mWrapU && sampler.mMirrorU)
- map = aiTextureMapMode_Mirror;
-
- mat.AddProperty( &map, 1, _AI_MATKEY_MAPPINGMODE_U_BASE, type, idx);
-
- map = aiTextureMapMode_Clamp;
- if (sampler.mWrapV)
- map = aiTextureMapMode_Wrap;
- if (sampler.mWrapV && sampler.mMirrorV)
- map = aiTextureMapMode_Mirror;
-
- mat.AddProperty( &map, 1, _AI_MATKEY_MAPPINGMODE_V_BASE, type, idx);
-
- // UV transformation
- mat.AddProperty(&sampler.mTransform, 1,
- _AI_MATKEY_UVTRANSFORM_BASE, type, idx);
-
- // Blend mode
- mat.AddProperty((int*)&sampler.mOp , 1,
- _AI_MATKEY_TEXBLEND_BASE, type, idx);
-
- // Blend factor
- mat.AddProperty((float*)&sampler.mWeighting , 1,
- _AI_MATKEY_TEXBLEND_BASE, type, idx);
-
- // UV source index ... if we didn't resolve the mapping it is actually just
- // a guess but it works in most cases. We search for the frst occurence of a
- // number in the channel name. We assume it is the zero-based index into the
- // UV channel array of all corresponding meshes. It could also be one-based
- // for some exporters, but we won't care of it unless someone complains about.
- if (sampler.mUVId != 0xffffffff)
- map = sampler.mUVId;
- else {
- map = -1;
- for (std::string::const_iterator it = sampler.mUVChannel.begin();it != sampler.mUVChannel.end(); ++it){
- if (IsNumeric(*it)) {
- map = strtol10(&(*it));
- break;
- }
- }
- if (-1 == map) {
- DefaultLogger::get()->warn("Collada: unable to determine UV channel for texture");
- map = 0;
- }
- }
- mat.AddProperty(&map,1,_AI_MATKEY_UVWSRC_BASE,type,idx);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Fills materials from the collada material definitions
-void ColladaLoader::FillMaterials( const ColladaParser& pParser, aiScene* pScene)
-{
- for (std::vector<std::pair<Collada::Effect*, aiMaterial*> >::iterator it = newMats.begin(),
- end = newMats.end(); it != end; ++it)
- {
- MaterialHelper& mat = (MaterialHelper&)*it->second;
- Collada::Effect& effect = *it->first;
-
- // resolve shading mode
- int shadeMode;
- if (effect.mFaceted) /* fixme */
- shadeMode = aiShadingMode_Flat;
- else {
- switch( effect.mShadeType)
- {
- case Collada::Shade_Constant:
- shadeMode = aiShadingMode_NoShading;
- break;
- case Collada::Shade_Lambert:
- shadeMode = aiShadingMode_Gouraud;
- break;
- case Collada::Shade_Blinn:
- shadeMode = aiShadingMode_Blinn;
- break;
- case Collada::Shade_Phong:
- shadeMode = aiShadingMode_Phong;
- break;
-
- default:
- DefaultLogger::get()->warn("Collada: Unrecognized shading mode, using gouraud shading");
- shadeMode = aiShadingMode_Gouraud;
- break;
- }
- }
- mat.AddProperty<int>( &shadeMode, 1, AI_MATKEY_SHADING_MODEL);
-
- // double-sided?
- shadeMode = effect.mDoubleSided;
- mat.AddProperty<int>( &shadeMode, 1, AI_MATKEY_TWOSIDED);
-
- // wireframe?
- shadeMode = effect.mWireframe;
- mat.AddProperty<int>( &shadeMode, 1, AI_MATKEY_ENABLE_WIREFRAME);
-
- // add material colors
- mat.AddProperty( &effect.mAmbient, 1,AI_MATKEY_COLOR_AMBIENT);
- mat.AddProperty( &effect.mDiffuse, 1, AI_MATKEY_COLOR_DIFFUSE);
- mat.AddProperty( &effect.mSpecular, 1,AI_MATKEY_COLOR_SPECULAR);
- mat.AddProperty( &effect.mEmissive, 1, AI_MATKEY_COLOR_EMISSIVE);
- mat.AddProperty( &effect.mTransparent, 1, AI_MATKEY_COLOR_TRANSPARENT);
- mat.AddProperty( &effect.mReflective, 1, AI_MATKEY_COLOR_REFLECTIVE);
-
- // scalar properties
- mat.AddProperty( &effect.mShininess, 1, AI_MATKEY_SHININESS);
- mat.AddProperty( &effect.mReflectivity, 1, AI_MATKEY_REFLECTIVITY);
- mat.AddProperty( &effect.mRefractIndex, 1, AI_MATKEY_REFRACTI);
-
- // transparency, a very hard one. seemingly not all files are following the
- // specification here .. but we can trick.
- if (effect.mTransparency > 0.f && effect.mTransparency < 1.f) {
- effect.mTransparency = 1.f- effect.mTransparency;
- mat.AddProperty( &effect.mTransparency, 1, AI_MATKEY_OPACITY );
- mat.AddProperty( &effect.mTransparent, 1, AI_MATKEY_COLOR_TRANSPARENT );
- }
-
- // add textures, if given
- if ( !effect.mTexAmbient.mName.empty())
- /* It is merely a lightmap */
- AddTexture( mat, pParser, effect, effect.mTexAmbient, aiTextureType_LIGHTMAP);
-
- if ( !effect.mTexEmissive.mName.empty())
- AddTexture( mat, pParser, effect, effect.mTexEmissive, aiTextureType_EMISSIVE);
-
- if ( !effect.mTexSpecular.mName.empty())
- AddTexture( mat, pParser, effect, effect.mTexSpecular, aiTextureType_SPECULAR);
-
- if ( !effect.mTexDiffuse.mName.empty())
- AddTexture( mat, pParser, effect, effect.mTexDiffuse, aiTextureType_DIFFUSE);
-
- if ( !effect.mTexBump.mName.empty())
- AddTexture( mat, pParser, effect, effect.mTexBump, aiTextureType_HEIGHT);
-
- if ( !effect.mTexTransparent.mName.empty())
- AddTexture( mat, pParser, effect, effect.mTexTransparent, aiTextureType_OPACITY);
-
- if ( !effect.mTexReflective.mName.empty())
- AddTexture( mat, pParser, effect, effect.mTexReflective, aiTextureType_REFLECTION);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Constructs materials from the collada material definitions
-void ColladaLoader::BuildMaterials( const ColladaParser& pParser, aiScene* pScene)
-{
- newMats.reserve(pParser.mMaterialLibrary.size());
-
- for ( ColladaParser::MaterialLibrary::const_iterator matIt = pParser.mMaterialLibrary.begin(); matIt != pParser.mMaterialLibrary.end(); ++matIt)
- {
- const Collada::Material& material = matIt->second;
- // a material is only a reference to an effect
- ColladaParser::EffectLibrary::const_iterator effIt = pParser.mEffectLibrary.find( material.mEffect);
- if ( effIt == pParser.mEffectLibrary.end())
- continue;
- const Collada::Effect& effect = effIt->second;
-
- // create material
- Assimp::MaterialHelper* mat = new Assimp::MaterialHelper;
- aiString name( matIt->first);
- mat->AddProperty(&name,AI_MATKEY_NAME);
-
- // MEGA SUPER MONSTER HACK by Alex ... It's all my fault, yes.
- // We store the reference to the effect in the material and
- // return ... we'll add the actual material properties later
- // after we processed all meshes. During mesh processing,
- // we evaluate vertex input mappings. Afterwards we should be
- // able to correctly setup source UV channels for textures.
-
- // ... moved to ColladaLoader::FillMaterials()
- // *duck*
-
- // store the material
- mMaterialIndexByName[matIt->first] = newMats.size();
- newMats.push_back( std::pair<Collada::Effect*, aiMaterial*>(const_cast<Collada::Effect*>(&effect),mat) );
- }
- // ScenePreprocessor generates a default material automatically if none is there.
- // All further code here in this loader works well without a valid material so
- // we can safely let it to ScenePreprocessor.
-#if 0
- if ( newMats.size() == 0)
- {
- Assimp::MaterialHelper* mat = new Assimp::MaterialHelper;
- aiString name( AI_DEFAULT_MATERIAL_NAME );
- mat->AddProperty( &name, AI_MATKEY_NAME);
-
- const int shadeMode = aiShadingMode_Phong;
- mat->AddProperty<int>( &shadeMode, 1, AI_MATKEY_SHADING_MODEL);
- aiColor4D colAmbient( 0.2f, 0.2f, 0.2f, 1.0f), colDiffuse( 0.8f, 0.8f, 0.8f, 1.0f), colSpecular( 0.5f, 0.5f, 0.5f, 0.5f);
- mat->AddProperty( &colAmbient, 1, AI_MATKEY_COLOR_AMBIENT);
- mat->AddProperty( &colDiffuse, 1, AI_MATKEY_COLOR_DIFFUSE);
- mat->AddProperty( &colSpecular, 1, AI_MATKEY_COLOR_SPECULAR);
- const float specExp = 5.0f;
- mat->AddProperty( &specExp, 1, AI_MATKEY_SHININESS);
- }
-#endif
-}
-
-// ------------------------------------------------------------------------------------------------
-// Resolves the texture name for the given effect texture entry
-aiString ColladaLoader::FindFilenameForEffectTexture( const ColladaParser& pParser,
- const Collada::Effect& pEffect, const std::string& pName)
-{
- // recurse through the param references until we end up at an image
- std::string name = pName;
- while ( 1)
- {
- // the given string is a param entry. Find it
- Collada::Effect::ParamLibrary::const_iterator it = pEffect.mParams.find( name);
- // if not found, we're at the end of the recursion. The resulting string should be the image ID
- if ( it == pEffect.mParams.end())
- break;
-
- // else recurse on
- name = it->second.mReference;
- }
-
- // find the image referred by this name in the image library of the scene
- ColladaParser::ImageLibrary::const_iterator imIt = pParser.mImageLibrary.find( name);
- if ( imIt == pParser.mImageLibrary.end())
- {
- throw DeadlyImportError( boost::str( boost::format(
- "Collada: Unable to resolve effect texture entry \"%s\", ended up at ID \"%s\".") % pName % name));
- }
-
- aiString result;
-
- // if this is an embedded texture image setup an aiTexture for it
- if (imIt->second.mFileName.empty())
- {
- if (imIt->second.mImageData.empty()) {
- throw DeadlyImportError("Collada: Invalid texture, no data or file reference given");
- }
-
- aiTexture* tex = new aiTexture();
-
- // setup format hint
- if (imIt->second.mEmbeddedFormat.length() > 3) {
- DefaultLogger::get()->warn("Collada: texture format hint is too long, truncating to 3 characters");
- }
- strncpy(tex->achFormatHint,imIt->second.mEmbeddedFormat.c_str(),3);
-
- // and copy texture data
- tex->mHeight = 0;
- tex->mWidth = imIt->second.mImageData.size();
- tex->pcData = (aiTexel*)new char[tex->mWidth];
- memcpy(tex->pcData,&imIt->second.mImageData[0],tex->mWidth);
-
- // setup texture reference string
- result.data[0] = '*';
- result.length = 1 + ASSIMP_itoa10(result.data+1,MAXLEN-1,mTextures.size());
-
- // and add this texture to the list
- mTextures.push_back(tex);
- }
- else
- {
- result.Set( imIt->second.mFileName );
- ConvertPath(result);
- }
- return result;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Convert a path read from a collada file to the usual representation
-void ColladaLoader::ConvertPath (aiString& ss)
-{
- // TODO: collada spec, p 22. Handle URI correctly.
- // For the moment we're just stripping the file:// away to make it work.
- // Windoes doesn't seem to be able to find stuff like
- // 'file://..\LWO\LWO2\MappingModes\earthSpherical.jpg'
- if (0 == strncmp(ss.data,"file://",7))
- {
- ss.length -= 7;
- memmove(ss.data,ss.data+7,ss.length);
- ss.data[ss.length] = '\0';
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads a float value from an accessor and its data array.
-float ColladaLoader::ReadFloat( const Collada::Accessor& pAccessor, const Collada::Data& pData, size_t pIndex, size_t pOffset) const
-{
- // FIXME: (thom) Test for data type here in every access? For the moment, I leave this to the caller
- size_t pos = pAccessor.mStride * pIndex + pAccessor.mOffset + pOffset;
- ai_assert( pos < pData.mValues.size());
- return pData.mValues[pos];
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads a string value from an accessor and its data array.
-const std::string& ColladaLoader::ReadString( const Collada::Accessor& pAccessor, const Collada::Data& pData, size_t pIndex) const
-{
- size_t pos = pAccessor.mStride * pIndex + pAccessor.mOffset;
- ai_assert( pos < pData.mStrings.size());
- return pData.mStrings[pos];
-}
-
-// ------------------------------------------------------------------------------------------------
-// Collects all nodes into the given array
-void ColladaLoader::CollectNodes( const aiNode* pNode, std::vector<const aiNode*>& poNodes) const
-{
- poNodes.push_back( pNode);
-
- for ( size_t a = 0; a < pNode->mNumChildren; ++a)
- CollectNodes( pNode->mChildren[a], poNodes);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Finds a node in the collada scene by the given name
-const Collada::Node* ColladaLoader::FindNode( const Collada::Node* pNode, const std::string& pName) const
-{
- if ( pNode->mName == pName || pNode->mID == pName)
- return pNode;
-
- for ( size_t a = 0; a < pNode->mChildren.size(); ++a)
- {
- const Collada::Node* node = FindNode( pNode->mChildren[a], pName);
- if ( node)
- return node;
- }
-
- return NULL;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Finds a node in the collada scene by the given SID
-const Collada::Node* ColladaLoader::FindNodeBySID( const Collada::Node* pNode, const std::string& pSID) const
-{
- if ( pNode->mSID == pSID)
- return pNode;
-
- for ( size_t a = 0; a < pNode->mChildren.size(); ++a)
- {
- const Collada::Node* node = FindNodeBySID( pNode->mChildren[a], pSID);
- if ( node)
- return node;
- }
-
- return NULL;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Finds a proper name for a node derived from the collada-node's properties
-std::string ColladaLoader::FindNameForNode( const Collada::Node* pNode) const
-{
- // now setup the name of the node. We take the name if not empty, otherwise the collada ID
- // FIX: Workaround for XSI calling the instanced visual scene 'untitled' by default.
- if (!pNode->mName.empty() && pNode->mName != "untitled")
- return pNode->mName;
- else if (!pNode->mID.empty())
- return pNode->mID;
- else if (!pNode->mSID.empty())
- return pNode->mSID;
- else
- {
- // No need to worry. Unnamed nodes are no problem at all, except
- // if cameras or lights need to be assigned to them.
- return boost::str( boost::format( "$ColladaAutoName$_%d") % clock());
- }
-}
-
-#endif // !! ASSIMP_BUILD_NO_DAE_IMPORTER
diff --git a/3rdparty/assimp/code/ColladaLoader.h b/3rdparty/assimp/code/ColladaLoader.h
deleted file mode 100644
index 72439eb9..00000000
--- a/3rdparty/assimp/code/ColladaLoader.h
+++ /dev/null
@@ -1,241 +0,0 @@
-/** Defines the collada loader class */
-
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
-copyright notice, this list of conditions and the
-following disclaimer.
-
-* Redistributions in binary form must reproduce the above
-copyright notice, this list of conditions and the
-following disclaimer in the documentation and/or other
-materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
-contributors may be used to endorse or promote products
-derived from this software without specific prior
-written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-#ifndef AI_COLLADALOADER_H_INC
-#define AI_COLLADALOADER_H_INC
-
-#include "BaseImporter.h"
-#include "ColladaParser.h"
-
-namespace Assimp
-{
-
-struct ColladaMeshIndex
-{
- std::string mMeshID;
- size_t mSubMesh;
- std::string mMaterial;
- ColladaMeshIndex( const std::string& pMeshID, size_t pSubMesh, const std::string& pMaterial)
- : mMeshID( pMeshID), mSubMesh( pSubMesh), mMaterial( pMaterial)
- { }
-
- bool operator < (const ColladaMeshIndex& p) const
- {
- if ( mMeshID == p.mMeshID)
- {
- if ( mSubMesh == p.mSubMesh)
- return mMaterial < p.mMaterial;
- else
- return mSubMesh < p.mSubMesh;
- } else
- {
- return mMeshID < p.mMeshID;
- }
- }
-};
-
-/** Loader class to read Collada scenes. Collada is over-engineered to death, with every new iteration bringing
- * more useless stuff, so I limited the data to what I think is useful for games.
-*/
-class ColladaLoader : public BaseImporter
-{
- friend class Importer;
-
-protected:
- /** Constructor to be privately used by Importer */
- ColladaLoader();
-
- /** Destructor, private as well */
- ~ColladaLoader();
-
-public:
- /** Returns whether the class can handle the format of the given file.
- * See BaseImporter::CanRead() for details. */
- bool CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const;
-
-protected:
- /** Called by Importer::GetExtensionList() for each loaded importer.
- * See BaseImporter::GetExtensionList() for details
- */
- void GetExtensionList( std::set<std::string>& extensions);
-
- /** Imports the given file into the given scene structure.
- * See BaseImporter::InternReadFile() for details
- */
- void InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler);
-
- /** Recursively constructs a scene node for the given parser node and returns it. */
- aiNode* BuildHierarchy( const ColladaParser& pParser, const Collada::Node* pNode);
-
- /** Resolve node instances */
- void ResolveNodeInstances( const ColladaParser& pParser, const Collada::Node* pNode,
- std::vector<const Collada::Node*>& resolved);
-
- /** Builds meshes for the given node and references them */
- void BuildMeshesForNode( const ColladaParser& pParser, const Collada::Node* pNode,
- aiNode* pTarget);
-
- /** Creates a mesh for the given ColladaMesh face subset and returns the newly created mesh */
- aiMesh* CreateMesh( const ColladaParser& pParser, const Collada::Mesh* pSrcMesh, const Collada::SubMesh& pSubMesh,
- const Collada::Controller* pSrcController, size_t pStartVertex, size_t pStartFace);
-
- /** Builds cameras for the given node and references them */
- void BuildCamerasForNode( const ColladaParser& pParser, const Collada::Node* pNode,
- aiNode* pTarget);
-
- /** Builds lights for the given node and references them */
- void BuildLightsForNode( const ColladaParser& pParser, const Collada::Node* pNode,
- aiNode* pTarget);
-
- /** Stores all meshes in the given scene */
- void StoreSceneMeshes( aiScene* pScene);
-
- /** Stores all materials in the given scene */
- void StoreSceneMaterials( aiScene* pScene);
-
- /** Stores all lights in the given scene */
- void StoreSceneLights( aiScene* pScene);
-
- /** Stores all cameras in the given scene */
- void StoreSceneCameras( aiScene* pScene);
-
- /** Stores all textures in the given scene */
- void StoreSceneTextures( aiScene* pScene);
-
- /** Stores all animations
- * @param pScene target scene to store the anims
- */
- void StoreAnimations( aiScene* pScene, const ColladaParser& pParser);
-
- /** Stores all animations for the given source anim and its nested child animations
- * @param pScene target scene to store the anims
- * @param pSrcAnim the source animation to process
- * @param pPrefix Prefix to the name in case of nested animations
- */
- void StoreAnimations( aiScene* pScene, const ColladaParser& pParser, const Collada::Animation* pSrcAnim, const std::string pPrefix);
-
- /** Constructs the animation for the given source anim */
- void CreateAnimation( aiScene* pScene, const ColladaParser& pParser, const Collada::Animation* pSrcAnim, const std::string& pName);
-
- /** Constructs materials from the collada material definitions */
- void BuildMaterials( const ColladaParser& pParser, aiScene* pScene);
-
- /** Fill materials from the collada material definitions */
- void FillMaterials( const ColladaParser& pParser, aiScene* pScene);
-
- /** Resolve UV channel mappings*/
- void ApplyVertexToEffectSemanticMapping(Collada::Sampler& sampler,
- const Collada::SemanticMappingTable& table);
-
- /** Add a texture and all of its sampling properties to a material*/
- void AddTexture ( Assimp::MaterialHelper& mat, const ColladaParser& pParser,
- const Collada::Effect& effect,
- const Collada::Sampler& sampler,
- aiTextureType type, unsigned int idx = 0);
-
- /** Resolves the texture name for the given effect texture entry */
- aiString FindFilenameForEffectTexture( const ColladaParser& pParser,
- const Collada::Effect& pEffect, const std::string& pName);
-
- /** Converts a path read from a collada file to the usual representation */
- void ConvertPath( aiString& ss);
-
- /** Reads a float value from an accessor and its data array.
- * @param pAccessor The accessor to use for reading
- * @param pData The data array to read from
- * @param pIndex The index of the element to retrieve
- * @param pOffset Offset into the element, for multipart elements such as vectors or matrices
- * @return the specified value
- */
- float ReadFloat( const Collada::Accessor& pAccessor, const Collada::Data& pData, size_t pIndex, size_t pOffset) const;
-
- /** Reads a string value from an accessor and its data array.
- * @param pAccessor The accessor to use for reading
- * @param pData The data array to read from
- * @param pIndex The index of the element to retrieve
- * @return the specified value
- */
- const std::string& ReadString( const Collada::Accessor& pAccessor, const Collada::Data& pData, size_t pIndex) const;
-
- /** Recursively collects all nodes into the given array */
- void CollectNodes( const aiNode* pNode, std::vector<const aiNode*>& poNodes) const;
-
- /** Finds a node in the collada scene by the given name */
- const Collada::Node* FindNode( const Collada::Node* pNode, const std::string& pName) const;
- /** Finds a node in the collada scene by the given SID */
- const Collada::Node* FindNodeBySID( const Collada::Node* pNode, const std::string& pSID) const;
-
- /** Finds a proper name for a node derived from the collada-node's properties */
- std::string FindNameForNode( const Collada::Node* pNode) const;
-
-protected:
- /** Filename, for a verbose error message */
- std::string mFileName;
-
- /** Which mesh-material compound was stored under which mesh ID */
- std::map<ColladaMeshIndex, size_t> mMeshIndexByID;
-
- /** Which material was stored under which index in the scene */
- std::map<std::string, size_t> mMaterialIndexByName;
-
- /** Accumulated meshes for the target scene */
- std::vector<aiMesh*> mMeshes;
-
- /** Temporary material list */
- std::vector<std::pair<Collada::Effect*, aiMaterial*> > newMats;
-
- /** Temporary camera list */
- std::vector<aiCamera*> mCameras;
-
- /** Temporary light list */
- std::vector<aiLight*> mLights;
-
- /** Temporary texture list */
- std::vector<aiTexture*> mTextures;
-
- /** Accumulated animations for the target scene */
- std::vector<aiAnimation*> mAnims;
-};
-
-} // end of namespace Assimp
-
-#endif // AI_COLLADALOADER_H_INC
diff --git a/3rdparty/assimp/code/ColladaParser.cpp b/3rdparty/assimp/code/ColladaParser.cpp
deleted file mode 100644
index 2513b929..00000000
--- a/3rdparty/assimp/code/ColladaParser.cpp
+++ /dev/null
@@ -1,2801 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
-copyright notice, this list of conditions and the
-following disclaimer.
-
-* Redistributions in binary form must reproduce the above
-copyright notice, this list of conditions and the
-following disclaimer in the documentation and/or other
-materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
-contributors may be used to endorse or promote products
-derived from this software without specific prior
-written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file ColladaParser.cpp
- * @brief Implementation of the Collada parser helper
- */
-
-#include "AssimpPCH.h"
-#ifndef ASSIMP_BUILD_NO_DAE_IMPORTER
-
-#include "ColladaParser.h"
-#include "fast_atof.h"
-#include "ParsingUtils.h"
-
-using namespace Assimp;
-using namespace Assimp::Collada;
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-ColladaParser::ColladaParser( IOSystem* pIOHandler, const std::string& pFile)
- : mFileName( pFile)
-{
- mRootNode = NULL;
- mUnitSize = 1.0f;
- mUpDirection = UP_Z;
-
- // We assume the newest file format by default
- mFormat = FV_1_5_n;
-
- // open the file
- boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile));
- if ( file.get() == NULL)
- throw DeadlyImportError( "Failed to open file " + pFile + ".");
-
- // generate a XML reader for it
- boost::scoped_ptr<CIrrXML_IOStreamReader> mIOWrapper( new CIrrXML_IOStreamReader( file.get()));
- mReader = irr::io::createIrrXMLReader( mIOWrapper.get());
- if ( !mReader)
- ThrowException( "Collada: Unable to open file.");
-
- // start reading
- ReadContents();
-}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-ColladaParser::~ColladaParser()
-{
- delete mReader;
- for ( NodeLibrary::iterator it = mNodeLibrary.begin(); it != mNodeLibrary.end(); ++it)
- delete it->second;
- for ( MeshLibrary::iterator it = mMeshLibrary.begin(); it != mMeshLibrary.end(); ++it)
- delete it->second;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Read bool from text contents of current element
-bool ColladaParser::ReadBoolFromTextContent()
-{
- const char* cur = GetTextContent();
- return (!ASSIMP_strincmp(cur,"true",4) || '0' != *cur);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Read float from text contents of current element
-float ColladaParser::ReadFloatFromTextContent()
-{
- const char* cur = GetTextContent();
- return fast_atof(cur);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads the contents of the file
-void ColladaParser::ReadContents()
-{
- while ( mReader->read())
- {
- // handle the root element "COLLADA"
- if ( mReader->getNodeType() == irr::io::EXN_ELEMENT)
- {
- if ( IsElement( "COLLADA"))
- {
- // check for 'version' attribute
- const int attrib = TestAttribute("version");
- if (attrib != -1) {
- const char* version = mReader->getAttributeValue(attrib);
-
- if (!::strncmp(version,"1.5",3)) {
- mFormat = FV_1_5_n;
- DefaultLogger::get()->debug("Collada schema version is 1.5.n");
- }
- else if (!::strncmp(version,"1.4",3)) {
- mFormat = FV_1_4_n;
- DefaultLogger::get()->debug("Collada schema version is 1.4.n");
- }
- else if (!::strncmp(version,"1.3",3)) {
- mFormat = FV_1_3_n;
- DefaultLogger::get()->debug("Collada schema version is 1.3.n");
- }
- }
-
- ReadStructure();
- } else
- {
- DefaultLogger::get()->debug( boost::str( boost::format( "Ignoring global element \"%s\".") % mReader->getNodeName()));
- SkipElement();
- }
- } else
- {
- // skip everything else silently
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads the structure of the file
-void ColladaParser::ReadStructure()
-{
- while ( mReader->read())
- {
- // beginning of elements
- if ( mReader->getNodeType() == irr::io::EXN_ELEMENT)
- {
- if ( IsElement( "asset"))
- ReadAssetInfo();
- else if ( IsElement( "library_animations"))
- ReadAnimationLibrary();
- else if ( IsElement( "library_controllers"))
- ReadControllerLibrary();
- else if ( IsElement( "library_images"))
- ReadImageLibrary();
- else if ( IsElement( "library_materials"))
- ReadMaterialLibrary();
- else if ( IsElement( "library_effects"))
- ReadEffectLibrary();
- else if ( IsElement( "library_geometries"))
- ReadGeometryLibrary();
- else if ( IsElement( "library_visual_scenes"))
- ReadSceneLibrary();
- else if ( IsElement( "library_lights"))
- ReadLightLibrary();
- else if ( IsElement( "library_cameras"))
- ReadCameraLibrary();
- else if ( IsElement( "library_nodes"))
- ReadSceneNode(NULL); /* some hacking to reuse this piece of code */
- else if ( IsElement( "scene"))
- ReadScene();
- else
- SkipElement();
- }
- else if ( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
- {
- break;
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads asset informations such as coordinate system informations and legal blah
-void ColladaParser::ReadAssetInfo()
-{
- if ( mReader->isEmptyElement())
- return;
-
- while ( mReader->read())
- {
- if ( mReader->getNodeType() == irr::io::EXN_ELEMENT)
- {
- if ( IsElement( "unit"))
- {
- // read unit data from the element's attributes
- const int attrIndex = TestAttribute( "meter");
- if (attrIndex == -1) {
- mUnitSize = 1.f;
- }
- else {
- mUnitSize = mReader->getAttributeValueAsFloat( attrIndex);
- }
-
- // consume the trailing stuff
- if ( !mReader->isEmptyElement())
- SkipElement();
- }
- else if ( IsElement( "up_axis"))
- {
- // read content, strip whitespace, compare
- const char* content = GetTextContent();
- if ( strncmp( content, "X_UP", 4) == 0)
- mUpDirection = UP_X;
- else if ( strncmp( content, "Y_UP", 4) == 0)
- mUpDirection = UP_Y;
- else
- mUpDirection = UP_Z;
-
- // check element end
- TestClosing( "up_axis");
- } else
- {
- SkipElement();
- }
- }
- else if ( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
- {
- if ( strcmp( mReader->getNodeName(), "asset") != 0)
- ThrowException( "Expected end of \"asset\" element.");
-
- break;
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads the animation library
-void ColladaParser::ReadAnimationLibrary()
-{
- if (mReader->isEmptyElement())
- return;
-
- while ( mReader->read())
- {
- if ( mReader->getNodeType() == irr::io::EXN_ELEMENT)
- {
- if ( IsElement( "animation"))
- {
- // delegate the reading. Depending on the inner elements it will be a container or a anim channel
- ReadAnimation( &mAnims);
- } else
- {
- // ignore the rest
- SkipElement();
- }
- }
- else if ( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
- {
- if ( strcmp( mReader->getNodeName(), "library_animations") != 0)
- ThrowException( "Expected end of \"library_animations\" element.");
-
- break;
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads an animation into the given parent structure
-void ColladaParser::ReadAnimation( Collada::Animation* pParent)
-{
- if ( mReader->isEmptyElement())
- return;
-
- // an <animation> element may be a container for grouping sub-elements or an animation channel
- // this is the channel collection by ID, in case it has channels
- typedef std::map<std::string, AnimationChannel> ChannelMap;
- ChannelMap channels;
- // this is the anim container in case we're a container
- Animation* anim = NULL;
-
- // optional name given as an attribute
- std::string animName;
- int indexName = TestAttribute( "name");
- int indexID = TestAttribute( "id");
- if ( indexName >= 0)
- animName = mReader->getAttributeValue( indexName);
- else if ( indexID >= 0)
- animName = mReader->getAttributeValue( indexID);
- else
- animName = "animation";
-
- while ( mReader->read())
- {
- if ( mReader->getNodeType() == irr::io::EXN_ELEMENT)
- {
- // we have subanimations
- if ( IsElement( "animation"))
- {
- // create container from our element
- if ( !anim)
- {
- anim = new Animation;
- anim->mName = animName;
- pParent->mSubAnims.push_back( anim);
- }
-
- // recurse into the subelement
- ReadAnimation( anim);
- }
- else if ( IsElement( "source"))
- {
- // possible animation data - we'll never know. Better store it
- ReadSource();
- }
- else if ( IsElement( "sampler"))
- {
- // read the ID to assign the corresponding collada channel afterwards.
- int indexID = GetAttribute( "id");
- std::string id = mReader->getAttributeValue( indexID);
- ChannelMap::iterator newChannel = channels.insert( std::make_pair( id, AnimationChannel())).first;
-
- // have it read into a channel
- ReadAnimationSampler( newChannel->second);
- }
- else if ( IsElement( "channel"))
- {
- // the binding element whose whole purpose is to provide the target to animate
- // Thanks, Collada! A directly posted information would have been too simple, I guess.
- // Better add another indirection to that! Can't have enough of those.
- int indexTarget = GetAttribute( "target");
- int indexSource = GetAttribute( "source");
- const char* sourceId = mReader->getAttributeValue( indexSource);
- if ( sourceId[0] == '#')
- sourceId++;
- ChannelMap::iterator cit = channels.find( sourceId);
- if ( cit != channels.end())
- cit->second.mTarget = mReader->getAttributeValue( indexTarget);
-
- if ( !mReader->isEmptyElement())
- SkipElement();
- }
- else
- {
- // ignore the rest
- SkipElement();
- }
- }
- else if ( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
- {
- if ( strcmp( mReader->getNodeName(), "animation") != 0)
- ThrowException( "Expected end of \"animation\" element.");
-
- break;
- }
- }
-
- // it turned out to have channels - add them
- if ( !channels.empty())
- {
- // special filtering for stupid exporters packing each channel into a separate animation
- if ( channels.size() == 1)
- {
- pParent->mChannels.push_back( channels.begin()->second);
- } else
- {
- // else create the animation, if not done yet, and store the channels
- if ( !anim)
- {
- anim = new Animation;
- anim->mName = animName;
- pParent->mSubAnims.push_back( anim);
- }
- for ( ChannelMap::const_iterator it = channels.begin(); it != channels.end(); ++it)
- anim->mChannels.push_back( it->second);
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads an animation sampler into the given anim channel
-void ColladaParser::ReadAnimationSampler( Collada::AnimationChannel& pChannel)
-{
- while ( mReader->read())
- {
- if ( mReader->getNodeType() == irr::io::EXN_ELEMENT)
- {
- if ( IsElement( "input"))
- {
- int indexSemantic = GetAttribute( "semantic");
- const char* semantic = mReader->getAttributeValue( indexSemantic);
- int indexSource = GetAttribute( "source");
- const char* source = mReader->getAttributeValue( indexSource);
- if ( source[0] != '#')
- ThrowException( "Unsupported URL format");
- source++;
-
- if ( strcmp( semantic, "INPUT") == 0)
- pChannel.mSourceTimes = source;
- else if ( strcmp( semantic, "OUTPUT") == 0)
- pChannel.mSourceValues = source;
-
- if ( !mReader->isEmptyElement())
- SkipElement();
- }
- else
- {
- // ignore the rest
- SkipElement();
- }
- }
- else if ( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
- {
- if ( strcmp( mReader->getNodeName(), "sampler") != 0)
- ThrowException( "Expected end of \"sampler\" element.");
-
- break;
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads the skeleton controller library
-void ColladaParser::ReadControllerLibrary()
-{
- if (mReader->isEmptyElement())
- return;
-
- while ( mReader->read())
- {
- if ( mReader->getNodeType() == irr::io::EXN_ELEMENT)
- {
- if ( IsElement( "controller"))
- {
- // read ID. Ask the spec if it's neccessary or optional... you might be surprised.
- int attrID = GetAttribute( "id");
- std::string id = mReader->getAttributeValue( attrID);
-
- // create an entry and store it in the library under its ID
- mControllerLibrary[id] = Controller();
-
- // read on from there
- ReadController( mControllerLibrary[id]);
- } else
- {
- // ignore the rest
- SkipElement();
- }
- }
- else if ( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
- {
- if ( strcmp( mReader->getNodeName(), "library_controllers") != 0)
- ThrowException( "Expected end of \"library_controllers\" element.");
-
- break;
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads a controller into the given mesh structure
-void ColladaParser::ReadController( Collada::Controller& pController)
-{
- while ( mReader->read())
- {
- if ( mReader->getNodeType() == irr::io::EXN_ELEMENT)
- {
- // two types of controllers: "skin" and "morph". Only the first one is relevant, we skip the other
- if ( IsElement( "morph"))
- {
- // should skip everything inside, so there's no danger of catching elements inbetween
- SkipElement();
- }
- else if ( IsElement( "skin"))
- {
- // read the mesh it refers to. According to the spec this could also be another
- // controller, but I refuse to implement every bullshit idea they've come up with
- int sourceIndex = GetAttribute( "source");
- pController.mMeshId = mReader->getAttributeValue( sourceIndex) + 1;
- }
- else if ( IsElement( "bind_shape_matrix"))
- {
- // content is 16 floats to define a matrix... it seems to be important for some models
- const char* content = GetTextContent();
-
- // read the 16 floats
- for ( unsigned int a = 0; a < 16; a++)
- {
- // read a number
- content = fast_atof_move( content, pController.mBindShapeMatrix[a]);
- // skip whitespace after it
- SkipSpacesAndLineEnd( &content);
- }
-
- TestClosing( "bind_shape_matrix");
- }
- else if ( IsElement( "source"))
- {
- // data array - we have specialists to handle this
- ReadSource();
- }
- else if ( IsElement( "joints"))
- {
- ReadControllerJoints( pController);
- }
- else if ( IsElement( "vertex_weights"))
- {
- ReadControllerWeights( pController);
- }
- else
- {
- // ignore the rest
- SkipElement();
- }
- }
- else if ( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
- {
- if ( strcmp( mReader->getNodeName(), "controller") == 0)
- break;
- else if ( strcmp( mReader->getNodeName(), "skin") != 0)
- ThrowException( "Expected end of \"controller\" element.");
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads the joint definitions for the given controller
-void ColladaParser::ReadControllerJoints( Collada::Controller& pController)
-{
- while ( mReader->read())
- {
- if ( mReader->getNodeType() == irr::io::EXN_ELEMENT)
- {
- // Input channels for joint data. Two possible semantics: "JOINT" and "INV_BIND_MATRIX"
- if ( IsElement( "input"))
- {
- int indexSemantic = GetAttribute( "semantic");
- const char* attrSemantic = mReader->getAttributeValue( indexSemantic);
- int indexSource = GetAttribute( "source");
- const char* attrSource = mReader->getAttributeValue( indexSource);
-
- // local URLS always start with a '#'. We don't support global URLs
- if ( attrSource[0] != '#')
- ThrowException( boost::str( boost::format( "Unsupported URL format in \"%s\"") % attrSource));
- attrSource++;
-
- // parse source URL to corresponding source
- if ( strcmp( attrSemantic, "JOINT") == 0)
- pController.mJointNameSource = attrSource;
- else if ( strcmp( attrSemantic, "INV_BIND_MATRIX") == 0)
- pController.mJointOffsetMatrixSource = attrSource;
- else
- ThrowException( boost::str( boost::format( "Unknown semantic \"%s\" in joint data") % attrSemantic));
-
- // skip inner data, if present
- if ( !mReader->isEmptyElement())
- SkipElement();
- }
- else
- {
- // ignore the rest
- SkipElement();
- }
- }
- else if ( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
- {
- if ( strcmp( mReader->getNodeName(), "joints") != 0)
- ThrowException( "Expected end of \"joints\" element.");
-
- break;
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads the joint weights for the given controller
-void ColladaParser::ReadControllerWeights( Collada::Controller& pController)
-{
- // read vertex count from attributes and resize the array accordingly
- int indexCount = GetAttribute( "count");
- size_t vertexCount = (size_t) mReader->getAttributeValueAsInt( indexCount);
- pController.mWeightCounts.resize( vertexCount);
-
- while ( mReader->read())
- {
- if ( mReader->getNodeType() == irr::io::EXN_ELEMENT)
- {
- // Input channels for weight data. Two possible semantics: "JOINT" and "WEIGHT"
- if ( IsElement( "input"))
- {
- InputChannel channel;
-
- int indexSemantic = GetAttribute( "semantic");
- const char* attrSemantic = mReader->getAttributeValue( indexSemantic);
- int indexSource = GetAttribute( "source");
- const char* attrSource = mReader->getAttributeValue( indexSource);
- int indexOffset = TestAttribute( "offset");
- if ( indexOffset >= 0)
- channel.mOffset = mReader->getAttributeValueAsInt( indexOffset);
-
- // local URLS always start with a '#'. We don't support global URLs
- if ( attrSource[0] != '#')
- ThrowException( boost::str( boost::format( "Unsupported URL format in \"%s\"") % attrSource));
- channel.mAccessor = attrSource + 1;
-
- // parse source URL to corresponding source
- if ( strcmp( attrSemantic, "JOINT") == 0)
- pController.mWeightInputJoints = channel;
- else if ( strcmp( attrSemantic, "WEIGHT") == 0)
- pController.mWeightInputWeights = channel;
- else
- ThrowException( boost::str( boost::format( "Unknown semantic \"%s\" in vertex_weight data") % attrSemantic));
-
- // skip inner data, if present
- if ( !mReader->isEmptyElement())
- SkipElement();
- }
- else if ( IsElement( "vcount"))
- {
- // read weight count per vertex
- const char* text = GetTextContent();
- size_t numWeights = 0;
- for ( std::vector<size_t>::iterator it = pController.mWeightCounts.begin(); it != pController.mWeightCounts.end(); ++it)
- {
- if ( *text == 0)
- ThrowException( "Out of data while reading vcount");
-
- *it = strtol10( text, &text);
- numWeights += *it;
- SkipSpacesAndLineEnd( &text);
- }
-
- TestClosing( "vcount");
-
- // reserve weight count
- pController.mWeights.resize( numWeights);
- }
- else if ( IsElement( "v"))
- {
- // read JointIndex - WeightIndex pairs
- const char* text = GetTextContent();
-
- for ( std::vector< std::pair<size_t, size_t> >::iterator it = pController.mWeights.begin(); it != pController.mWeights.end(); ++it)
- {
- if ( *text == 0)
- ThrowException( "Out of data while reading vertex_weights");
- it->first = strtol10( text, &text);
- SkipSpacesAndLineEnd( &text);
- if ( *text == 0)
- ThrowException( "Out of data while reading vertex_weights");
- it->second = strtol10( text, &text);
- SkipSpacesAndLineEnd( &text);
- }
-
- TestClosing( "v");
- }
- else
- {
- // ignore the rest
- SkipElement();
- }
- }
- else if ( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
- {
- if ( strcmp( mReader->getNodeName(), "vertex_weights") != 0)
- ThrowException( "Expected end of \"vertex_weights\" element.");
-
- break;
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads the image library contents
-void ColladaParser::ReadImageLibrary()
-{
- if ( mReader->isEmptyElement())
- return;
-
- while ( mReader->read())
- {
- if ( mReader->getNodeType() == irr::io::EXN_ELEMENT) {
- if ( IsElement( "image"))
- {
- // read ID. Another entry which is "optional" by design but obligatory in reality
- int attrID = GetAttribute( "id");
- std::string id = mReader->getAttributeValue( attrID);
-
- // create an entry and store it in the library under its ID
- mImageLibrary[id] = Image();
-
- // read on from there
- ReadImage( mImageLibrary[id]);
- } else
- {
- // ignore the rest
- SkipElement();
- }
- }
- else if ( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) {
- if ( strcmp( mReader->getNodeName(), "library_images") != 0)
- ThrowException( "Expected end of \"library_images\" element.");
-
- break;
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads an image entry into the given image
-void ColladaParser::ReadImage( Collada::Image& pImage)
-{
- while ( mReader->read())
- {
- if ( mReader->getNodeType() == irr::io::EXN_ELEMENT){
- // Need to run different code paths here, depending on the Collada XSD version
- if (IsElement("image")) {
- SkipElement();
- }
- else if ( IsElement( "init_from"))
- {
- if (mFormat == FV_1_4_n)
- {
- // FIX: C4D exporter writes empty <init_from/> tags
- if (!mReader->isEmptyElement()) {
- // element content is filename - hopefully
- const char* sz = TestTextContent();
- if (sz)pImage.mFileName = sz;
- TestClosing( "init_from");
- }
- if (!pImage.mFileName.length()) {
- pImage.mFileName = "unknown_texture";
- }
- }
- else if (mFormat == FV_1_5_n)
- {
- // make sure we skip over mip and array initializations, which
- // we don't support, but which could confuse the loader if
- // they're not skipped.
- int attrib = TestAttribute("array_index");
- if (attrib != -1 && mReader->getAttributeValueAsInt(attrib) > 0) {
- DefaultLogger::get()->warn("Collada: Ignoring texture array index");
- continue;
- }
-
- attrib = TestAttribute("mip_index");
- if (attrib != -1 && mReader->getAttributeValueAsInt(attrib) > 0) {
- DefaultLogger::get()->warn("Collada: Ignoring MIP map layer");
- continue;
- }
-
- // TODO: correctly jump over cube and volume maps?
- }
- }
- else if (mFormat == FV_1_5_n)
- {
- if ( IsElement( "ref"))
- {
- // element content is filename - hopefully
- const char* sz = TestTextContent();
- if (sz)pImage.mFileName = sz;
- TestClosing( "ref");
- }
- else if ( IsElement( "hex") && !pImage.mFileName.length())
- {
- // embedded image. get format
- const int attrib = TestAttribute("format");
- if (-1 == attrib)
- DefaultLogger::get()->warn("Collada: Unknown image file format");
- else pImage.mEmbeddedFormat = mReader->getAttributeValue(attrib);
-
- const char* data = GetTextContent();
-
- // hexadecimal-encoded binary octets. First of all, find the
- // required buffer size to reserve enough storage.
- const char* cur = data;
- while (!IsSpaceOrNewLine(*cur)) cur++;
-
- const unsigned int size = (unsigned int)(cur-data) * 2;
- pImage.mImageData.resize(size);
- for (unsigned int i = 0; i < size;++i)
- pImage.mImageData[i] = HexOctetToDecimal(data+(i<<1));
-
- TestClosing( "hex");
- }
- }
- else
- {
- // ignore the rest
- SkipElement();
- }
- }
- else if ( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) {
- if ( strcmp( mReader->getNodeName(), "image") == 0)
- break;
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads the material library
-void ColladaParser::ReadMaterialLibrary()
-{
- if ( mReader->isEmptyElement())
- return;
-
- while ( mReader->read())
- {
- if ( mReader->getNodeType() == irr::io::EXN_ELEMENT)
- {
- if ( IsElement( "material"))
- {
- // read ID. By now you propably know my opinion about this "specification"
- int attrID = GetAttribute( "id");
- std::string id = mReader->getAttributeValue( attrID);
-
- // create an entry and store it in the library under its ID
- ReadMaterial(mMaterialLibrary[id] = Material());
- } else
- {
- // ignore the rest
- SkipElement();
- }
- }
- else if ( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
- {
- if ( strcmp( mReader->getNodeName(), "library_materials") != 0)
- ThrowException( "Expected end of \"library_materials\" element.");
-
- break;
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads the light library
-void ColladaParser::ReadLightLibrary()
-{
- if ( mReader->isEmptyElement())
- return;
-
- while ( mReader->read())
- {
- if ( mReader->getNodeType() == irr::io::EXN_ELEMENT) {
- if ( IsElement( "light"))
- {
- // read ID. By now you propably know my opinion about this "specification"
- int attrID = GetAttribute( "id");
- std::string id = mReader->getAttributeValue( attrID);
-
- // create an entry and store it in the library under its ID
- ReadLight(mLightLibrary[id] = Light());
-
- } else
- {
- // ignore the rest
- SkipElement();
- }
- }
- else if ( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) {
- if ( strcmp( mReader->getNodeName(), "library_lights") != 0)
- ThrowException( "Expected end of \"library_lights\" element.");
-
- break;
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads the camera library
-void ColladaParser::ReadCameraLibrary()
-{
- if ( mReader->isEmptyElement())
- return;
-
- while ( mReader->read())
- {
- if ( mReader->getNodeType() == irr::io::EXN_ELEMENT) {
- if ( IsElement( "camera"))
- {
- // read ID. By now you propably know my opinion about this "specification"
- int attrID = GetAttribute( "id");
- std::string id = mReader->getAttributeValue( attrID);
-
- // create an entry and store it in the library under its ID
- Camera& cam = mCameraLibrary[id];
- attrID = TestAttribute( "name");
- if (attrID != -1)
- cam.mName = mReader->getAttributeValue( attrID);
-
- ReadCamera(cam);
-
- } else
- {
- // ignore the rest
- SkipElement();
- }
- }
- else if ( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) {
- if ( strcmp( mReader->getNodeName(), "library_cameras") != 0)
- ThrowException( "Expected end of \"library_cameras\" element.");
-
- break;
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads a material entry into the given material
-void ColladaParser::ReadMaterial( Collada::Material& pMaterial)
-{
- while ( mReader->read())
- {
- if ( mReader->getNodeType() == irr::io::EXN_ELEMENT) {
- if (IsElement("material")) {
- SkipElement();
- }
- else if ( IsElement( "instance_effect"))
- {
- // referred effect by URL
- int attrUrl = GetAttribute( "url");
- const char* url = mReader->getAttributeValue( attrUrl);
- if ( url[0] != '#')
- ThrowException( "Unknown reference format");
-
- pMaterial.mEffect = url+1;
-
- SkipElement();
- } else
- {
- // ignore the rest
- SkipElement();
- }
- }
- else if ( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) {
- if ( strcmp( mReader->getNodeName(), "material") != 0)
- ThrowException( "Expected end of \"material\" element.");
-
- break;
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads a light entry into the given light
-void ColladaParser::ReadLight( Collada::Light& pLight)
-{
- while ( mReader->read())
- {
- if ( mReader->getNodeType() == irr::io::EXN_ELEMENT) {
- if (IsElement("light")) {
- SkipElement();
- }
- else if (IsElement("spot")) {
- pLight.mType = aiLightSource_SPOT;
- }
- else if (IsElement("ambient")) {
- pLight.mType = aiLightSource_AMBIENT;
- }
- else if (IsElement("directional")) {
- pLight.mType = aiLightSource_DIRECTIONAL;
- }
- else if (IsElement("point")) {
- pLight.mType = aiLightSource_POINT;
- }
- else if (IsElement("color")) {
- // text content contains 3 floats
- const char* content = GetTextContent();
-
- content = fast_atof_move( content, (float&)pLight.mColor.r);
- SkipSpacesAndLineEnd( &content);
-
- content = fast_atof_move( content, (float&)pLight.mColor.g);
- SkipSpacesAndLineEnd( &content);
-
- content = fast_atof_move( content, (float&)pLight.mColor.b);
- SkipSpacesAndLineEnd( &content);
-
- TestClosing( "color");
- }
- else if (IsElement("constant_attenuation")) {
- pLight.mAttConstant = ReadFloatFromTextContent();
- TestClosing("constant_attenuation");
- }
- else if (IsElement("linear_attenuation")) {
- pLight.mAttLinear = ReadFloatFromTextContent();
- TestClosing("linear_attenuation");
- }
- else if (IsElement("quadratic_attenuation")) {
- pLight.mAttQuadratic = ReadFloatFromTextContent();
- TestClosing("quadratic_attenuation");
- }
- else if (IsElement("falloff_angle")) {
- pLight.mFalloffAngle = ReadFloatFromTextContent();
- TestClosing("falloff_angle");
- }
- else if (IsElement("falloff_exponent")) {
- pLight.mFalloffExponent = ReadFloatFromTextContent();
- TestClosing("falloff_exponent");
- }
- // FCOLLADA extensions
- // -------------------------------------------------------
- else if (IsElement("outer_cone")) {
- pLight.mOuterAngle = ReadFloatFromTextContent();
- TestClosing("outer_cone");
- }
- // ... and this one is even deprecated
- else if (IsElement("penumbra_angle")) {
- pLight.mPenumbraAngle = ReadFloatFromTextContent();
- TestClosing("penumbra_angle");
- }
- else if (IsElement("intensity")) {
- pLight.mIntensity = ReadFloatFromTextContent();
- TestClosing("intensity");
- }
- }
- else if ( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) {
- if ( strcmp( mReader->getNodeName(), "light") == 0)
- break;
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads a camera entry into the given light
-void ColladaParser::ReadCamera( Collada::Camera& pCamera)
-{
- while ( mReader->read())
- {
- if ( mReader->getNodeType() == irr::io::EXN_ELEMENT) {
- if (IsElement("camera")) {
- SkipElement();
- }
- else if (IsElement("orthographic")) {
- pCamera.mOrtho = true;
- }
- else if (IsElement("xfov") || IsElement("xmag")) {
- pCamera.mHorFov = ReadFloatFromTextContent();
- TestClosing((pCamera.mOrtho ? "xmag" : "xfov"));
- }
- else if (IsElement("yfov") || IsElement("ymag")) {
- pCamera.mVerFov = ReadFloatFromTextContent();
- TestClosing((pCamera.mOrtho ? "ymag" : "yfov"));
- }
- else if (IsElement("aspect_ratio")) {
- pCamera.mAspect = ReadFloatFromTextContent();
- TestClosing("aspect_ratio");
- }
- else if (IsElement("znear")) {
- pCamera.mZNear = ReadFloatFromTextContent();
- TestClosing("znear");
- }
- else if (IsElement("zfar")) {
- pCamera.mZFar = ReadFloatFromTextContent();
- TestClosing("zfar");
- }
- }
- else if ( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) {
- if ( strcmp( mReader->getNodeName(), "camera") == 0)
- break;
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads the effect library
-void ColladaParser::ReadEffectLibrary()
-{
- if (mReader->isEmptyElement()) {
- return;
- }
-
- while ( mReader->read())
- {
- if ( mReader->getNodeType() == irr::io::EXN_ELEMENT) {
- if ( IsElement( "effect"))
- {
- // read ID. Do I have to repeat my ranting about "optional" attributes?
- // Alex: .... no, not necessary. Please shut up and leave more space for
- // me to complain about the fucking Collada spec with its fucking
- // 'optional' attributes ...
- int attrID = GetAttribute( "id");
- std::string id = mReader->getAttributeValue( attrID);
-
- // create an entry and store it in the library under its ID
- mEffectLibrary[id] = Effect();
- // read on from there
- ReadEffect( mEffectLibrary[id]);
- } else
- {
- // ignore the rest
- SkipElement();
- }
- }
- else if ( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) {
- if ( strcmp( mReader->getNodeName(), "library_effects") != 0)
- ThrowException( "Expected end of \"library_effects\" element.");
-
- break;
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads an effect entry into the given effect
-void ColladaParser::ReadEffect( Collada::Effect& pEffect)
-{
- // for the moment we don't support any other type of effect.
- while ( mReader->read())
- {
- if ( mReader->getNodeType() == irr::io::EXN_ELEMENT)
- {
- if ( IsElement( "profile_COMMON"))
- ReadEffectProfileCommon( pEffect);
- else
- SkipElement();
- }
- else if ( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
- {
- if ( strcmp( mReader->getNodeName(), "effect") != 0)
- ThrowException( "Expected end of \"effect\" element.");
-
- break;
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads an COMMON effect profile
-void ColladaParser::ReadEffectProfileCommon( Collada::Effect& pEffect)
-{
- while ( mReader->read())
- {
- if ( mReader->getNodeType() == irr::io::EXN_ELEMENT)
- {
- if ( IsElement( "newparam")) {
- // save ID
- int attrSID = GetAttribute( "sid");
- std::string sid = mReader->getAttributeValue( attrSID);
- pEffect.mParams[sid] = EffectParam();
- ReadEffectParam( pEffect.mParams[sid]);
- }
- else if ( IsElement( "technique") || IsElement( "extra"))
- {
- // just syntactic sugar
- }
-
- /* Shading modes */
- else if ( IsElement( "phong"))
- pEffect.mShadeType = Shade_Phong;
- else if ( IsElement( "constant"))
- pEffect.mShadeType = Shade_Constant;
- else if ( IsElement( "lambert"))
- pEffect.mShadeType = Shade_Lambert;
- else if ( IsElement( "blinn"))
- pEffect.mShadeType = Shade_Blinn;
-
- /* Color + texture properties */
- else if ( IsElement( "emission"))
- ReadEffectColor( pEffect.mEmissive, pEffect.mTexEmissive);
- else if ( IsElement( "ambient"))
- ReadEffectColor( pEffect.mAmbient, pEffect.mTexAmbient);
- else if ( IsElement( "diffuse"))
- ReadEffectColor( pEffect.mDiffuse, pEffect.mTexDiffuse);
- else if ( IsElement( "specular"))
- ReadEffectColor( pEffect.mSpecular, pEffect.mTexSpecular);
- else if ( IsElement( "reflective")) {
- ReadEffectColor( pEffect.mReflective, pEffect.mTexReflective);
- }
- else if ( IsElement( "transparent")) {
- ReadEffectColor( pEffect.mTransparent,pEffect.mTexTransparent);
- }
- else if ( IsElement( "shininess"))
- ReadEffectFloat( pEffect.mShininess);
- else if ( IsElement( "reflectivity"))
- ReadEffectFloat( pEffect.mReflectivity);
-
- /* Single scalar properties */
- else if ( IsElement( "transparency"))
- ReadEffectFloat( pEffect.mTransparency);
- else if ( IsElement( "index_of_refraction"))
- ReadEffectFloat( pEffect.mRefractIndex);
-
- // GOOGLEEARTH/OKINO extensions
- // -------------------------------------------------------
- else if ( IsElement( "double_sided"))
- pEffect.mDoubleSided = ReadBoolFromTextContent();
-
- // FCOLLADA extensions
- // -------------------------------------------------------
- else if ( IsElement( "bump")) {
- aiColor4D dummy;
- ReadEffectColor( dummy,pEffect.mTexBump);
- }
-
- // MAX3D extensions
- // -------------------------------------------------------
- else if ( IsElement( "wireframe")) {
- pEffect.mWireframe = ReadBoolFromTextContent();
- TestClosing( "wireframe");
- }
- else if ( IsElement( "faceted")) {
- pEffect.mFaceted = ReadBoolFromTextContent();
- TestClosing( "faceted");
- }
- else
- {
- // ignore the rest
- SkipElement();
- }
- }
- else if ( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) {
- if ( strcmp( mReader->getNodeName(), "profile_COMMON") == 0)
- {
- break;
- }
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Read texture wrapping + UV transform settings from a profile==Maya chunk
-void ColladaParser::ReadSamplerProperties( Sampler& out )
-{
- if (mReader->isEmptyElement()) {
- return;
- }
-
- while ( mReader->read())
- {
- if ( mReader->getNodeType() == irr::io::EXN_ELEMENT) {
-
- // MAYA extensions
- // -------------------------------------------------------
- if ( IsElement( "wrapU")) {
- out.mWrapU = ReadBoolFromTextContent();
- TestClosing( "wrapU");
- }
- else if ( IsElement( "wrapV")) {
- out.mWrapU = ReadBoolFromTextContent();
- TestClosing( "wrapV");
- }
- else if ( IsElement( "mirrorU")) {
- out.mMirrorU = ReadBoolFromTextContent();
- TestClosing( "mirrorU");
- }
- else if ( IsElement( "mirrorV")) {
- out.mMirrorU = ReadBoolFromTextContent();
- TestClosing( "mirrorV");
- }
- else if ( IsElement( "repeatU")) {
- out.mTransform.mScaling.x = ReadFloatFromTextContent();
- TestClosing( "repeatU");
- }
- else if ( IsElement( "repeatV")) {
- out.mTransform.mScaling.y = ReadFloatFromTextContent();
- TestClosing( "repeatV");
- }
- else if ( IsElement( "offsetU")) {
- out.mTransform.mTranslation.x = ReadFloatFromTextContent();
- TestClosing( "offsetU");
- }
- else if ( IsElement( "offsetV")) {
- out.mTransform.mTranslation.x = ReadFloatFromTextContent();
- TestClosing( "offsetV");
- }
- else if ( IsElement( "rotateUV")) {
- out.mTransform.mRotation = ReadFloatFromTextContent();
- TestClosing( "rotateUV");
- }
- else if ( IsElement( "blend_mode")) {
-
- const char* sz = GetTextContent();
- // http://www.feelingsoftware.com/content/view/55/72/lang,en/
- // NONE, OVER, IN, OUT, ADD, SUBTRACT, MULTIPLY, DIFFERENCE, LIGHTEN, DARKEN, SATURATE, DESATURATE and ILLUMINATE
- if (0 == ASSIMP_strincmp(sz,"ADD",3))
- out.mOp = aiTextureOp_Add;
-
- else if (0 == ASSIMP_strincmp(sz,"SUBTRACT",8))
- out.mOp = aiTextureOp_Subtract;
-
- else if (0 == ASSIMP_strincmp(sz,"MULTIPLY",8))
- out.mOp = aiTextureOp_Multiply;
-
- else {
- DefaultLogger::get()->warn("Collada: Unsupported MAYA texture blend mode");
- }
- TestClosing( "blend_mode");
- }
- // OKINO extensions
- // -------------------------------------------------------
- else if ( IsElement( "weighting")) {
- out.mWeighting = ReadFloatFromTextContent();
- TestClosing( "weighting");
- }
- else if ( IsElement( "mix_with_previous_layer")) {
- out.mMixWithPrevious = ReadFloatFromTextContent();
- TestClosing( "mix_with_previous_layer");
- }
- // MAX3D extensions
- // -------------------------------------------------------
- else if ( IsElement( "amount")) {
- out.mWeighting = ReadFloatFromTextContent();
- TestClosing( "amount");
- }
- }
- else if ( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) {
- if ( strcmp( mReader->getNodeName(), "technique") == 0)
- break;
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads an effect entry containing a color or a texture defining that color
-void ColladaParser::ReadEffectColor( aiColor4D& pColor, Sampler& pSampler)
-{
- if (mReader->isEmptyElement())
- return;
-
- // Save current element name
- const std::string curElem = mReader->getNodeName();
-
- while ( mReader->read())
- {
- if ( mReader->getNodeType() == irr::io::EXN_ELEMENT) {
- if ( IsElement( "color"))
- {
- // text content contains 4 floats
- const char* content = GetTextContent();
-
- content = fast_atof_move( content, (float&)pColor.r);
- SkipSpacesAndLineEnd( &content);
-
- content = fast_atof_move( content, (float&)pColor.g);
- SkipSpacesAndLineEnd( &content);
-
- content = fast_atof_move( content, (float&)pColor.b);
- SkipSpacesAndLineEnd( &content);
-
- content = fast_atof_move( content, (float&)pColor.a);
- SkipSpacesAndLineEnd( &content);
- TestClosing( "color");
- }
- else if ( IsElement( "texture"))
- {
- // get name of source textur/sampler
- int attrTex = GetAttribute( "texture");
- pSampler.mName = mReader->getAttributeValue( attrTex);
-
- // get name of UV source channel
- attrTex = GetAttribute( "texcoord");
- pSampler.mUVChannel = mReader->getAttributeValue( attrTex);
- //SkipElement();
- }
- else if ( IsElement( "technique"))
- {
- const int _profile = GetAttribute( "profile");
- const char* profile = mReader->getAttributeValue( _profile );
-
- // Some extensions are quite useful ... ReadSamplerProperties processes
- // several extensions in MAYA, OKINO and MAX3D profiles.
- if (!::strcmp(profile,"MAYA") || !::strcmp(profile,"MAX3D") || !::strcmp(profile,"OKINO"))
- {
- // get more information on this sampler
- ReadSamplerProperties(pSampler);
- }
- else SkipElement();
- }
- else if ( !IsElement( "extra"))
- {
- // ignore the rest
- SkipElement();
- }
- }
- else if ( mReader->getNodeType() == irr::io::EXN_ELEMENT_END){
- if (mReader->getNodeName() == curElem)
- break;
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads an effect entry containing a float
-void ColladaParser::ReadEffectFloat( float& pFloat)
-{
- while ( mReader->read())
- {
- if ( mReader->getNodeType() == irr::io::EXN_ELEMENT){
- if ( IsElement( "float"))
- {
- // text content contains a single floats
- const char* content = GetTextContent();
- content = fast_atof_move( content, pFloat);
- SkipSpacesAndLineEnd( &content);
-
- TestClosing( "float");
- } else
- {
- // ignore the rest
- SkipElement();
- }
- }
- else if ( mReader->getNodeType() == irr::io::EXN_ELEMENT_END){
- break;
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads an effect parameter specification of any kind
-void ColladaParser::ReadEffectParam( Collada::EffectParam& pParam)
-{
- while ( mReader->read())
- {
- if ( mReader->getNodeType() == irr::io::EXN_ELEMENT) {
- if ( IsElement( "surface"))
- {
- // image ID given inside <init_from> tags
- TestOpening( "init_from");
- const char* content = GetTextContent();
- pParam.mType = Param_Surface;
- pParam.mReference = content;
- TestClosing( "init_from");
-
- // don't care for remaining stuff
- SkipElement( "surface");
- }
- else if ( IsElement( "sampler2D"))
- {
- // surface ID is given inside <source> tags
- TestOpening( "source");
- const char* content = GetTextContent();
- pParam.mType = Param_Sampler;
- pParam.mReference = content;
- TestClosing( "source");
-
- // don't care for remaining stuff
- SkipElement( "sampler2D");
- } else
- {
- // ignore unknown element
- SkipElement();
- }
- }
- else if ( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) {
- break;
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads the geometry library contents
-void ColladaParser::ReadGeometryLibrary()
-{
- if ( mReader->isEmptyElement())
- return;
-
- while ( mReader->read())
- {
- if ( mReader->getNodeType() == irr::io::EXN_ELEMENT)
- {
- if ( IsElement( "geometry"))
- {
- // read ID. Another entry which is "optional" by design but obligatory in reality
- int indexID = GetAttribute( "id");
- std::string id = mReader->getAttributeValue( indexID);
-
- // TODO: (thom) support SIDs
- // ai_assert( TestAttribute( "sid") == -1);
-
- // create a mesh and store it in the library under its ID
- Mesh* mesh = new Mesh;
- mMeshLibrary[id] = mesh;
-
- // read on from there
- ReadGeometry( mesh);
- } else
- {
- // ignore the rest
- SkipElement();
- }
- }
- else if ( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
- {
- if ( strcmp( mReader->getNodeName(), "library_geometries") != 0)
- ThrowException( "Expected end of \"library_geometries\" element.");
-
- break;
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads a geometry from the geometry library.
-void ColladaParser::ReadGeometry( Collada::Mesh* pMesh)
-{
- if ( mReader->isEmptyElement())
- return;
-
- while ( mReader->read())
- {
- if ( mReader->getNodeType() == irr::io::EXN_ELEMENT)
- {
- if ( IsElement( "mesh"))
- {
- // read on from there
- ReadMesh( pMesh);
- } else
- {
- // ignore the rest
- SkipElement();
- }
- }
- else if ( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
- {
- if ( strcmp( mReader->getNodeName(), "geometry") != 0)
- ThrowException( "Expected end of \"geometry\" element.");
-
- break;
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads a mesh from the geometry library
-void ColladaParser::ReadMesh( Mesh* pMesh)
-{
- if ( mReader->isEmptyElement())
- return;
-
- while ( mReader->read())
- {
- if ( mReader->getNodeType() == irr::io::EXN_ELEMENT)
- {
- if ( IsElement( "source"))
- {
- // we have professionals dealing with this
- ReadSource();
- }
- else if ( IsElement( "vertices"))
- {
- // read per-vertex mesh data
- ReadVertexData( pMesh);
- }
- else if ( IsElement( "triangles") || IsElement( "lines") || IsElement( "linestrips")
- || IsElement( "polygons") || IsElement( "polylist") || IsElement( "trifans") || IsElement( "tristrips"))
- {
- // read per-index mesh data and faces setup
- ReadIndexData( pMesh);
- } else
- {
- // ignore the rest
- SkipElement();
- }
- }
- else if ( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
- {
- if ( strcmp( mReader->getNodeName(), "technique_common") == 0)
- {
- // end of another meaningless element - read over it
- }
- else if ( strcmp( mReader->getNodeName(), "mesh") == 0)
- {
- // end of <mesh> element - we're done here
- break;
- } else
- {
- // everything else should be punished
- ThrowException( "Expected end of \"mesh\" element.");
- }
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads a source element
-void ColladaParser::ReadSource()
-{
- int indexID = GetAttribute( "id");
- std::string sourceID = mReader->getAttributeValue( indexID);
-
- while ( mReader->read())
- {
- if ( mReader->getNodeType() == irr::io::EXN_ELEMENT)
- {
- if ( IsElement( "float_array") || IsElement( "IDREF_array") || IsElement( "Name_array"))
- {
- ReadDataArray();
- }
- else if ( IsElement( "technique_common"))
- {
- // I don't fucking care for your profiles bullshit
- }
- else if ( IsElement( "accessor"))
- {
- ReadAccessor( sourceID);
- } else
- {
- // ignore the rest
- SkipElement();
- }
- }
- else if ( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
- {
- if ( strcmp( mReader->getNodeName(), "source") == 0)
- {
- // end of <source> - we're done
- break;
- }
- else if ( strcmp( mReader->getNodeName(), "technique_common") == 0)
- {
- // end of another meaningless element - read over it
- } else
- {
- // everything else should be punished
- ThrowException( "Expected end of \"source\" element.");
- }
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads a data array holding a number of floats, and stores it in the global library
-void ColladaParser::ReadDataArray()
-{
- std::string elmName = mReader->getNodeName();
- bool isStringArray = (elmName == "IDREF_array" || elmName == "Name_array");
-
- // read attributes
- int indexID = GetAttribute( "id");
- std::string id = mReader->getAttributeValue( indexID);
- int indexCount = GetAttribute( "count");
- unsigned int count = (unsigned int) mReader->getAttributeValueAsInt( indexCount);
- const char* content = TestTextContent();
- if (content) { // some exporters write empty data arrays, silently skip over them
-
- // read values and store inside an array in the data library
- mDataLibrary[id] = Data();
- Data& data = mDataLibrary[id];
- data.mIsStringArray = isStringArray;
-
- if ( isStringArray)
- {
- data.mStrings.reserve( count);
- std::string s;
-
- for ( unsigned int a = 0; a < count; a++)
- {
- if ( *content == 0)
- ThrowException( "Expected more values while reading IDREF_array contents.");
-
- s.clear();
- while ( !IsSpaceOrNewLine( *content))
- s += *content++;
- data.mStrings.push_back( s);
-
- SkipSpacesAndLineEnd( &content);
- }
- } else
- {
- data.mValues.reserve( count);
-
- for ( unsigned int a = 0; a < count; a++)
- {
- if ( *content == 0)
- ThrowException( "Expected more values while reading float_array contents.");
-
- float value;
- // read a number
- content = fast_atof_move( content, value);
- data.mValues.push_back( value);
- // skip whitespace after it
- SkipSpacesAndLineEnd( &content);
- }
- }
- }
-
- // test for closing tag
- TestClosing( elmName.c_str());
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads an accessor and stores it in the global library
-void ColladaParser::ReadAccessor( const std::string& pID)
-{
- // read accessor attributes
- int attrSource = GetAttribute( "source");
- const char* source = mReader->getAttributeValue( attrSource);
- if ( source[0] != '#')
- ThrowException( boost::str( boost::format( "Unknown reference format in url \"%s\".") % source));
- int attrCount = GetAttribute( "count");
- unsigned int count = (unsigned int) mReader->getAttributeValueAsInt( attrCount);
- int attrOffset = TestAttribute( "offset");
- unsigned int offset = 0;
- if ( attrOffset > -1)
- offset = (unsigned int) mReader->getAttributeValueAsInt( attrOffset);
- int attrStride = TestAttribute( "stride");
- unsigned int stride = 1;
- if ( attrStride > -1)
- stride = (unsigned int) mReader->getAttributeValueAsInt( attrStride);
-
- // store in the library under the given ID
- mAccessorLibrary[pID] = Accessor();
- Accessor& acc = mAccessorLibrary[pID];
- acc.mCount = count;
- acc.mOffset = offset;
- acc.mStride = stride;
- acc.mSource = source+1; // ignore the leading '#'
- acc.mSize = 0; // gets incremented with every param
-
- // and read the components
- while ( mReader->read())
- {
- if ( mReader->getNodeType() == irr::io::EXN_ELEMENT)
- {
- if ( IsElement( "param"))
- {
- // read data param
- int attrName = TestAttribute( "name");
- std::string name;
- if ( attrName > -1)
- {
- name = mReader->getAttributeValue( attrName);
-
- // analyse for common type components and store it's sub-offset in the corresponding field
-
- /* Cartesian coordinates */
- if ( name == "X") acc.mSubOffset[0] = acc.mParams.size();
- else if ( name == "Y") acc.mSubOffset[1] = acc.mParams.size();
- else if ( name == "Z") acc.mSubOffset[2] = acc.mParams.size();
-
- /* RGBA colors */
- else if ( name == "R") acc.mSubOffset[0] = acc.mParams.size();
- else if ( name == "G") acc.mSubOffset[1] = acc.mParams.size();
- else if ( name == "B") acc.mSubOffset[2] = acc.mParams.size();
- else if ( name == "A") acc.mSubOffset[3] = acc.mParams.size();
-
- /* UVWQ (STPQ) texture coordinates */
- else if ( name == "S") acc.mSubOffset[0] = acc.mParams.size();
- else if ( name == "T") acc.mSubOffset[1] = acc.mParams.size();
- else if ( name == "P") acc.mSubOffset[2] = acc.mParams.size();
- // else if ( name == "Q") acc.mSubOffset[3] = acc.mParams.size();
- /* 4D uv coordinates are not supported in Assimp */
-
- /* Generic extra data, interpreted as UV data, too*/
- else if ( name == "U") acc.mSubOffset[0] = acc.mParams.size();
- else if ( name == "V") acc.mSubOffset[1] = acc.mParams.size();
- //else
- // DefaultLogger::get()->warn( boost::str( boost::format( "Unknown accessor parameter \"%s\". Ignoring data channel.") % name));
- }
-
- // read data type
- int attrType = TestAttribute( "type");
- if ( attrType > -1)
- {
- // for the moment we only distinguish between a 4x4 matrix and anything else.
- // TODO: (thom) I don't have a spec here at work. Check if there are other multi-value types
- // which should be tested for here.
- std::string type = mReader->getAttributeValue( attrType);
- if ( type == "float4x4")
- acc.mSize += 16;
- else
- acc.mSize += 1;
- }
-
- acc.mParams.push_back( name);
-
- // skip remaining stuff of this element, if any
- SkipElement();
- } else
- {
- ThrowException( "Unexpected sub element in tag \"accessor\".");
- }
- }
- else if ( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
- {
- if ( strcmp( mReader->getNodeName(), "accessor") != 0)
- ThrowException( "Expected end of \"accessor\" element.");
-
- break;
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads input declarations of per-vertex mesh data into the given mesh
-void ColladaParser::ReadVertexData( Mesh* pMesh)
-{
- // extract the ID of the <vertices> element. Not that we care, but to catch strange referencing schemes we should warn about
- int attrID= GetAttribute( "id");
- pMesh->mVertexID = mReader->getAttributeValue( attrID);
-
- // a number of <input> elements
- while ( mReader->read())
- {
- if ( mReader->getNodeType() == irr::io::EXN_ELEMENT)
- {
- if ( IsElement( "input"))
- {
- ReadInputChannel( pMesh->mPerVertexData);
- } else
- {
- ThrowException( "Unexpected sub element in tag \"vertices\".");
- }
- }
- else if ( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
- {
- if ( strcmp( mReader->getNodeName(), "vertices") != 0)
- ThrowException( "Expected end of \"vertices\" element.");
-
- break;
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads input declarations of per-index mesh data into the given mesh
-void ColladaParser::ReadIndexData( Mesh* pMesh)
-{
- std::vector<size_t> vcount;
- std::vector<InputChannel> perIndexData;
-
- // read primitive count from the attribute
- int attrCount = GetAttribute( "count");
- size_t numPrimitives = (size_t) mReader->getAttributeValueAsInt( attrCount);
-
- // material subgroup
- int attrMaterial = TestAttribute( "material");
- SubMesh subgroup;
- if ( attrMaterial > -1)
- subgroup.mMaterial = mReader->getAttributeValue( attrMaterial);
- subgroup.mNumFaces = numPrimitives;
- pMesh->mSubMeshes.push_back( subgroup);
-
- // distinguish between polys and triangles
- std::string elementName = mReader->getNodeName();
- PrimitiveType primType = Prim_Invalid;
- if ( IsElement( "lines"))
- primType = Prim_Lines;
- else if ( IsElement( "linestrips"))
- primType = Prim_LineStrip;
- else if ( IsElement( "polygons"))
- primType = Prim_Polygon;
- else if ( IsElement( "polylist"))
- primType = Prim_Polylist;
- else if ( IsElement( "triangles"))
- primType = Prim_Triangles;
- else if ( IsElement( "trifans"))
- primType = Prim_TriFans;
- else if ( IsElement( "tristrips"))
- primType = Prim_TriStrips;
-
- ai_assert( primType != Prim_Invalid);
-
- // also a number of <input> elements, but in addition a <p> primitive collection and propably index counts for all primitives
- while ( mReader->read())
- {
- if ( mReader->getNodeType() == irr::io::EXN_ELEMENT)
- {
- if ( IsElement( "input"))
- {
- ReadInputChannel( perIndexData);
- }
- else if ( IsElement( "vcount"))
- {
- if ( !mReader->isEmptyElement())
- {
- // case <polylist> - specifies the number of indices for each polygon
- const char* content = GetTextContent();
- vcount.reserve( numPrimitives);
- for ( unsigned int a = 0; a < numPrimitives; a++)
- {
- if ( *content == 0)
- ThrowException( "Expected more values while reading vcount contents.");
- // read a number
- vcount.push_back( (size_t) strtol10( content, &content));
- // skip whitespace after it
- SkipSpacesAndLineEnd( &content);
- }
-
- TestClosing( "vcount");
- }
- }
- else if ( IsElement( "p"))
- {
- if ( !mReader->isEmptyElement())
- {
- // now here the actual fun starts - these are the indices to construct the mesh data from
- ReadPrimitives( pMesh, perIndexData, numPrimitives, vcount, primType);
- }
- } else
- {
- ThrowException( "Unexpected sub element in tag \"vertices\".");
- }
- }
- else if ( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
- {
- if ( mReader->getNodeName() != elementName)
- ThrowException( boost::str( boost::format( "Expected end of \"%s\" element.") % elementName));
-
- break;
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads a single input channel element and stores it in the given array, if valid
-void ColladaParser::ReadInputChannel( std::vector<InputChannel>& poChannels)
-{
- InputChannel channel;
-
- // read semantic
- int attrSemantic = GetAttribute( "semantic");
- std::string semantic = mReader->getAttributeValue( attrSemantic);
- channel.mType = GetTypeForSemantic( semantic);
-
- // read source
- int attrSource = GetAttribute( "source");
- const char* source = mReader->getAttributeValue( attrSource);
- if ( source[0] != '#')
- ThrowException( boost::str( boost::format( "Unknown reference format in url \"%s\".") % source));
- channel.mAccessor = source+1; // skipping the leading #, hopefully the remaining text is the accessor ID only
-
- // read index offset, if per-index <input>
- int attrOffset = TestAttribute( "offset");
- if ( attrOffset > -1)
- channel.mOffset = mReader->getAttributeValueAsInt( attrOffset);
-
- // read set if texture coordinates
- if (channel.mType == IT_Texcoord || channel.mType == IT_Color){
- int attrSet = TestAttribute("set");
- if (attrSet > -1){
- attrSet = mReader->getAttributeValueAsInt( attrSet);
- if (attrSet < 0)
- ThrowException( boost::str( boost::format( "Invalid index \"%i\" for set attribute") % (attrSet)));
-
- channel.mIndex = attrSet;
- }
- }
-
- // store, if valid type
- if ( channel.mType != IT_Invalid)
- poChannels.push_back( channel);
-
- // skip remaining stuff of this element, if any
- SkipElement();
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads a <p> primitive index list and assembles the mesh data into the given mesh
-void ColladaParser::ReadPrimitives( Mesh* pMesh, std::vector<InputChannel>& pPerIndexChannels,
- size_t pNumPrimitives, const std::vector<size_t>& pVCount, PrimitiveType pPrimType)
-{
- // determine number of indices coming per vertex
- // find the offset index for all per-vertex channels
- size_t numOffsets = 1;
- size_t perVertexOffset = 0xffffffff; // invalid value
- BOOST_FOREACH( const InputChannel& channel, pPerIndexChannels)
- {
- numOffsets = std::max( numOffsets, channel.mOffset+1);
- if ( channel.mType == IT_Vertex)
- perVertexOffset = channel.mOffset;
- }
-
- // determine the expected number of indices
- size_t expectedPointCount = 0;
- switch( pPrimType)
- {
- case Prim_Polylist:
- {
- BOOST_FOREACH( size_t i, pVCount)
- expectedPointCount += i;
- break;
- }
- case Prim_Lines:
- expectedPointCount = 2 * pNumPrimitives;
- break;
- case Prim_Triangles:
- expectedPointCount = 3 * pNumPrimitives;
- break;
- default:
- // other primitive types don't state the index count upfront... we need to guess
- break;
- }
-
- // and read all indices into a temporary array
- std::vector<size_t> indices;
- if ( expectedPointCount > 0)
- indices.reserve( expectedPointCount * numOffsets);
-
- const char* content = GetTextContent();
- while ( *content != 0)
- {
- // read a value.
- // Hack: (thom) Some exporters put negative indices sometimes. We just try to carry on anyways.
- int value = std::max( 0, strtol10s( content, &content));
- indices.push_back( size_t( value));
- // skip whitespace after it
- SkipSpacesAndLineEnd( &content);
- }
-
- // complain if the index count doesn't fit
- if ( expectedPointCount > 0 && indices.size() != expectedPointCount * numOffsets)
- ThrowException( "Expected different index count in <p> element.");
- else if ( expectedPointCount == 0 && (indices.size() % numOffsets) != 0)
- ThrowException( "Expected different index count in <p> element.");
-
- // find the data for all sources
- for ( std::vector<InputChannel>::iterator it = pMesh->mPerVertexData.begin(); it != pMesh->mPerVertexData.end(); ++it)
- {
- InputChannel& input = *it;
- if ( input.mResolved)
- continue;
-
- // find accessor
- input.mResolved = &ResolveLibraryReference( mAccessorLibrary, input.mAccessor);
- // resolve accessor's data pointer as well, if neccessary
- const Accessor* acc = input.mResolved;
- if ( !acc->mData)
- acc->mData = &ResolveLibraryReference( mDataLibrary, acc->mSource);
- }
- // and the same for the per-index channels
- for ( std::vector<InputChannel>::iterator it = pPerIndexChannels.begin(); it != pPerIndexChannels.end(); ++it)
- {
- InputChannel& input = *it;
- if ( input.mResolved)
- continue;
-
- // ignore vertex pointer, it doesn't refer to an accessor
- if ( input.mType == IT_Vertex)
- {
- // warn if the vertex channel does not refer to the <vertices> element in the same mesh
- if ( input.mAccessor != pMesh->mVertexID)
- ThrowException( "Unsupported vertex referencing scheme. I fucking hate Collada.");
- continue;
- }
-
- // find accessor
- input.mResolved = &ResolveLibraryReference( mAccessorLibrary, input.mAccessor);
- // resolve accessor's data pointer as well, if neccessary
- const Accessor* acc = input.mResolved;
- if ( !acc->mData)
- acc->mData = &ResolveLibraryReference( mDataLibrary, acc->mSource);
- }
-
-
- // now assemble vertex data according to those indices
- std::vector<size_t>::const_iterator idx = indices.begin();
-
- // For continued primitives, the given count does not come all in one <p>, but only one primitive per <p>
- size_t numPrimitives = pNumPrimitives;
- if ( pPrimType == Prim_TriFans || pPrimType == Prim_Polygon)
- numPrimitives = 1;
-
- pMesh->mFaceSize.reserve( numPrimitives);
- pMesh->mFacePosIndices.reserve( indices.size() / numOffsets);
-
- for ( size_t a = 0; a < numPrimitives; a++)
- {
- // determine number of points for this primitive
- size_t numPoints = 0;
- switch( pPrimType)
- {
- case Prim_Lines:
- numPoints = 2;
- break;
- case Prim_Triangles:
- numPoints = 3;
- break;
- case Prim_Polylist:
- numPoints = pVCount[a];
- break;
- case Prim_TriFans:
- case Prim_Polygon:
- numPoints = indices.size() / numOffsets;
- break;
- default:
- // LineStrip and TriStrip not supported due to expected index unmangling
- ThrowException( "Unsupported primitive type.");
- break;
- }
-
- // store the face size to later reconstruct the face from
- pMesh->mFaceSize.push_back( numPoints);
-
- // gather that number of vertices
- for ( size_t b = 0; b < numPoints; b++)
- {
- // read all indices for this vertex. Yes, in a hacky local array
- assert( numOffsets < 20 && perVertexOffset < 20);
- size_t vindex[20];
- for ( size_t offsets = 0; offsets < numOffsets; ++offsets)
- vindex[offsets] = *idx++;
-
- // extract per-vertex channels using the global per-vertex offset
- for ( std::vector<InputChannel>::iterator it = pMesh->mPerVertexData.begin(); it != pMesh->mPerVertexData.end(); ++it)
- ExtractDataObjectFromChannel( *it, vindex[perVertexOffset], pMesh);
- // and extract per-index channels using there specified offset
- for ( std::vector<InputChannel>::iterator it = pPerIndexChannels.begin(); it != pPerIndexChannels.end(); ++it)
- ExtractDataObjectFromChannel( *it, vindex[it->mOffset], pMesh);
-
- // store the vertex-data index for later assignment of bone vertex weights
- pMesh->mFacePosIndices.push_back( vindex[perVertexOffset]);
- }
- }
-
-
- // if I ever get my hands on that guy who invented this steaming pile of indirection...
- TestClosing( "p");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Extracts a single object from an input channel and stores it in the appropriate mesh data array
-void ColladaParser::ExtractDataObjectFromChannel( const InputChannel& pInput, size_t pLocalIndex, Mesh* pMesh)
-{
- // ignore vertex referrer - we handle them that separate
- if ( pInput.mType == IT_Vertex)
- return;
-
- const Accessor& acc = *pInput.mResolved;
- if ( pLocalIndex >= acc.mCount)
- ThrowException( boost::str( boost::format( "Invalid data index (%d/%d) in primitive specification") % pLocalIndex % acc.mCount));
-
- // get a pointer to the start of the data object referred to by the accessor and the local index
- const float* dataObject = &(acc.mData->mValues[0]) + acc.mOffset + pLocalIndex* acc.mStride;
-
- // assemble according to the accessors component sub-offset list. We don't care, yet,
- // what kind of object exactly we're extracting here
- float obj[4];
- for ( size_t c = 0; c < 4; ++c)
- obj[c] = dataObject[acc.mSubOffset[c]];
-
- // now we reinterpret it according to the type we're reading here
- switch( pInput.mType)
- {
- case IT_Position: // ignore all position streams except 0 - there can be only one position
- if ( pInput.mIndex == 0)
- pMesh->mPositions.push_back( aiVector3D( obj[0], obj[1], obj[2]));
- else
- DefaultLogger::get()->error("Collada: just one vertex position stream supported");
- break;
- case IT_Normal:
- // pad to current vertex count if necessary
- if ( pMesh->mNormals.size() < pMesh->mPositions.size()-1)
- pMesh->mNormals.insert( pMesh->mNormals.end(), pMesh->mPositions.size() - pMesh->mNormals.size() - 1, aiVector3D( 0, 1, 0));
-
- // ignore all normal streams except 0 - there can be only one normal
- if ( pInput.mIndex == 0)
- pMesh->mNormals.push_back( aiVector3D( obj[0], obj[1], obj[2]));
- else
- DefaultLogger::get()->error("Collada: just one vertex normal stream supported");
- break;
- case IT_Tangent:
- // pad to current vertex count if necessary
- if ( pMesh->mTangents.size() < pMesh->mPositions.size()-1)
- pMesh->mTangents.insert( pMesh->mTangents.end(), pMesh->mPositions.size() - pMesh->mTangents.size() - 1, aiVector3D( 1, 0, 0));
-
- // ignore all tangent streams except 0 - there can be only one tangent
- if ( pInput.mIndex == 0)
- pMesh->mTangents.push_back( aiVector3D( obj[0], obj[1], obj[2]));
- else
- DefaultLogger::get()->error("Collada: just one vertex tangent stream supported");
- break;
- case IT_Bitangent:
- // pad to current vertex count if necessary
- if ( pMesh->mBitangents.size() < pMesh->mPositions.size()-1)
- pMesh->mBitangents.insert( pMesh->mBitangents.end(), pMesh->mPositions.size() - pMesh->mBitangents.size() - 1, aiVector3D( 0, 0, 1));
-
- // ignore all bitangent streams except 0 - there can be only one bitangent
- if ( pInput.mIndex == 0)
- pMesh->mBitangents.push_back( aiVector3D( obj[0], obj[1], obj[2]));
- else
- DefaultLogger::get()->error("Collada: just one vertex bitangent stream supported");
- break;
- case IT_Texcoord:
- // up to 4 texture coord sets are fine, ignore the others
- if ( pInput.mIndex < AI_MAX_NUMBER_OF_TEXTURECOORDS)
- {
- // pad to current vertex count if necessary
- if ( pMesh->mTexCoords[pInput.mIndex].size() < pMesh->mPositions.size()-1)
- pMesh->mTexCoords[pInput.mIndex].insert( pMesh->mTexCoords[pInput.mIndex].end(),
- pMesh->mPositions.size() - pMesh->mTexCoords[pInput.mIndex].size() - 1, aiVector3D( 0, 0, 0));
-
- pMesh->mTexCoords[pInput.mIndex].push_back( aiVector3D( obj[0], obj[1], obj[2]));
- if (0 != acc.mSubOffset[2] || 0 != acc.mSubOffset[3]) /* hack ... consider cleaner solution */
- pMesh->mNumUVComponents[pInput.mIndex]=3;
- } else
- {
- DefaultLogger::get()->error("Collada: too many texture coordinate sets. Skipping.");
- }
- break;
- case IT_Color:
- // up to 4 color sets are fine, ignore the others
- if ( pInput.mIndex < AI_MAX_NUMBER_OF_COLOR_SETS)
- {
- // pad to current vertex count if necessary
- if ( pMesh->mColors[pInput.mIndex].size() < pMesh->mPositions.size()-1)
- pMesh->mColors[pInput.mIndex].insert( pMesh->mColors[pInput.mIndex].end(),
- pMesh->mPositions.size() - pMesh->mColors[pInput.mIndex].size() - 1, aiColor4D( 0, 0, 0, 1));
-
- pMesh->mColors[pInput.mIndex].push_back( aiColor4D( obj[0], obj[1], obj[2], obj[3]));
- } else
- {
- DefaultLogger::get()->error("Collada: too many vertex color sets. Skipping.");
- }
-
- break;
- default:
- // IT_Invalid and IT_Vertex
- ai_assert(false && "shouldn't ever get here");
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads the library of node hierarchies and scene parts
-void ColladaParser::ReadSceneLibrary()
-{
- if ( mReader->isEmptyElement())
- return;
-
- while ( mReader->read())
- {
- if ( mReader->getNodeType() == irr::io::EXN_ELEMENT)
- {
- // a visual scene - generate root node under its ID and let ReadNode() do the recursive work
- if ( IsElement( "visual_scene"))
- {
- // read ID. Is optional according to the spec, but how on earth should a scene_instance refer to it then?
- int indexID = GetAttribute( "id");
- const char* attrID = mReader->getAttributeValue( indexID);
-
- // read name if given.
- int indexName = TestAttribute( "name");
- const char* attrName = "unnamed";
- if ( indexName > -1)
- attrName = mReader->getAttributeValue( indexName);
-
- // create a node and store it in the library under its ID
- Node* node = new Node;
- node->mID = attrID;
- node->mName = attrName;
- mNodeLibrary[node->mID] = node;
-
- ReadSceneNode( node);
- } else
- {
- // ignore the rest
- SkipElement();
- }
- }
- else if ( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
- {
- if ( strcmp( mReader->getNodeName(), "library_visual_scenes") == 0)
- //ThrowException( "Expected end of \"library_visual_scenes\" element.");
-
- break;
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads a scene node's contents including children and stores it in the given node
-void ColladaParser::ReadSceneNode( Node* pNode)
-{
- // quit immediately on <bla/> elements
- if ( mReader->isEmptyElement())
- return;
-
- while ( mReader->read())
- {
- if ( mReader->getNodeType() == irr::io::EXN_ELEMENT)
- {
- if ( IsElement( "node"))
- {
- Node* child = new Node;
- int attrID = TestAttribute( "id");
- if ( attrID > -1)
- child->mID = mReader->getAttributeValue( attrID);
- int attrSID = TestAttribute( "sid");
- if ( attrSID > -1)
- child->mSID = mReader->getAttributeValue( attrSID);
-
- int attrName = TestAttribute( "name");
- if ( attrName > -1)
- child->mName = mReader->getAttributeValue( attrName);
-
- // TODO: (thom) support SIDs
- // assert( TestAttribute( "sid") == -1);
-
- if (pNode)
- {
- pNode->mChildren.push_back( child);
- child->mParent = pNode;
- }
- else
- {
- // no parent node given, probably called from <library_nodes> element.
- // create new node in node library
- mNodeLibrary[child->mID] = child;
- }
-
- // read on recursively from there
- ReadSceneNode( child);
- continue;
- }
- // For any further stuff we need a valid node to work on
- else if (!pNode)
- continue;
-
- if ( IsElement( "lookat"))
- ReadNodeTransformation( pNode, TF_LOOKAT);
- else if ( IsElement( "matrix"))
- ReadNodeTransformation( pNode, TF_MATRIX);
- else if ( IsElement( "rotate"))
- ReadNodeTransformation( pNode, TF_ROTATE);
- else if ( IsElement( "scale"))
- ReadNodeTransformation( pNode, TF_SCALE);
- else if ( IsElement( "skew"))
- ReadNodeTransformation( pNode, TF_SKEW);
- else if ( IsElement( "translate"))
- ReadNodeTransformation( pNode, TF_TRANSLATE);
- else if ( IsElement( "render") && pNode->mParent == NULL && 0 == pNode->mPrimaryCamera.length())
- {
- // ... scene evaluation or, in other words, postprocessing pipeline,
- // or, again in other words, a turing-complete description how to
- // render a Collada scene. The only thing that is interesting for
- // us is the primary camera.
- int attrId = TestAttribute("camera_node");
- if (-1 != attrId)
- {
- const char* s = mReader->getAttributeValue(attrId);
- if (s[0] != '#')
- DefaultLogger::get()->error("Collada: Unresolved reference format of camera");
- else
- pNode->mPrimaryCamera = s+1;
- }
- }
- else if ( IsElement( "instance_node"))
- {
- // find the node in the library
- int attrID = TestAttribute( "url");
- if ( attrID != -1)
- {
- const char* s = mReader->getAttributeValue(attrID);
- if (s[0] != '#')
- DefaultLogger::get()->error("Collada: Unresolved reference format of node");
- else
- {
- pNode->mNodeInstances.push_back(NodeInstance());
- pNode->mNodeInstances.back().mNode = s+1;
- }
- }
- }
- else if ( IsElement( "instance_geometry") || IsElement( "instance_controller"))
- {
- // Reference to a mesh or controller, with possible material associations
- ReadNodeGeometry( pNode);
- }
- else if ( IsElement( "instance_light"))
- {
- // Reference to a light, name given in 'url' attribute
- int attrID = TestAttribute("url");
- if (-1 == attrID)
- DefaultLogger::get()->warn("Collada: Expected url attribute in <instance_light> element");
- else
- {
- const char* url = mReader->getAttributeValue( attrID);
- if ( url[0] != '#')
- ThrowException( "Unknown reference format in <instance_light> element");
-
- pNode->mLights.push_back(LightInstance());
- pNode->mLights.back().mLight = url+1;
- }
- }
- else if ( IsElement( "instance_camera"))
- {
- // Reference to a camera, name given in 'url' attribute
- int attrID = TestAttribute("url");
- if (-1 == attrID)
- DefaultLogger::get()->warn("Collada: Expected url attribute in <instance_camera> element");
- else
- {
- const char* url = mReader->getAttributeValue( attrID);
- if ( url[0] != '#')
- ThrowException( "Unknown reference format in <instance_camera> element");
-
- pNode->mCameras.push_back(CameraInstance());
- pNode->mCameras.back().mCamera = url+1;
- }
- }
- else
- {
- // skip everything else for the moment
- SkipElement();
- }
- }
- else if ( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) {
- break;
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads a node transformation entry of the given type and adds it to the given node's transformation list.
-void ColladaParser::ReadNodeTransformation( Node* pNode, TransformType pType)
-{
- if ( mReader->isEmptyElement())
- return;
-
- std::string tagName = mReader->getNodeName();
-
- Transform tf;
- tf.mType = pType;
-
- // read SID
- int indexSID = TestAttribute( "sid");
- if ( indexSID >= 0)
- tf.mID = mReader->getAttributeValue( indexSID);
-
- // how many parameters to read per transformation type
- static const unsigned int sNumParameters[] = { 9, 4, 3, 3, 7, 16 };
- const char* content = GetTextContent();
-
- // read as many parameters and store in the transformation
- for ( unsigned int a = 0; a < sNumParameters[pType]; a++)
- {
- // read a number
- content = fast_atof_move( content, tf.f[a]);
- // skip whitespace after it
- SkipSpacesAndLineEnd( &content);
- }
-
- // place the transformation at the queue of the node
- pNode->mTransforms.push_back( tf);
-
- // and consume the closing tag
- TestClosing( tagName.c_str());
-}
-
-// ------------------------------------------------------------------------------------------------
-// Processes bind_vertex_input and bind elements
-void ColladaParser::ReadMaterialVertexInputBinding( Collada::SemanticMappingTable& tbl)
-{
- while ( mReader->read())
- {
- if ( mReader->getNodeType() == irr::io::EXN_ELEMENT) {
- if ( IsElement( "bind_vertex_input"))
- {
- Collada::InputSemanticMapEntry vn;
-
- // effect semantic
- int n = GetAttribute("semantic");
- std::string s = mReader->getAttributeValue(n);
-
- // input semantic
- n = GetAttribute("input_semantic");
- vn.mType = GetTypeForSemantic( mReader->getAttributeValue(n) );
-
- // index of input set
- n = TestAttribute("input_set");
- if (-1 != n)
- vn.mSet = mReader->getAttributeValueAsInt(n);
-
- tbl.mMap[s] = vn;
- }
- else if ( IsElement( "bind")) {
- DefaultLogger::get()->warn("Collada: Found unsupported <bind> element");
- }
- }
- else if ( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) {
- if ( strcmp( mReader->getNodeName(), "instance_material") == 0)
- break;
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads a mesh reference in a node and adds it to the node's mesh list
-void ColladaParser::ReadNodeGeometry( Node* pNode)
-{
- // referred mesh is given as an attribute of the <instance_geometry> element
- int attrUrl = GetAttribute( "url");
- const char* url = mReader->getAttributeValue( attrUrl);
- if ( url[0] != '#')
- ThrowException( "Unknown reference format");
-
- Collada::MeshInstance instance;
- instance.mMeshOrController = url+1; // skipping the leading #
-
- if ( !mReader->isEmptyElement())
- {
- // read material associations. Ignore additional elements inbetween
- while ( mReader->read())
- {
- if ( mReader->getNodeType() == irr::io::EXN_ELEMENT)
- {
- if ( IsElement( "instance_material"))
- {
- // read ID of the geometry subgroup and the target material
- int attrGroup = GetAttribute( "symbol");
- std::string group = mReader->getAttributeValue( attrGroup);
- int attrMaterial = GetAttribute( "target");
- const char* urlMat = mReader->getAttributeValue( attrMaterial);
- Collada::SemanticMappingTable s;
- if ( urlMat[0] == '#')
- urlMat++;
-
- s.mMatName = urlMat;
-
- // resolve further material details + THIS UGLY AND NASTY semantic mapping stuff
- if ( !mReader->isEmptyElement())
- ReadMaterialVertexInputBinding(s);
-
- // store the association
- instance.mMaterials[group] = s;
- }
- }
- else if ( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
- {
- if ( strcmp( mReader->getNodeName(), "instance_geometry") == 0
- || strcmp( mReader->getNodeName(), "instance_controller") == 0)
- break;
- }
- }
- }
-
- // store it
- pNode->mMeshes.push_back( instance);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads the collada scene
-void ColladaParser::ReadScene()
-{
- if ( mReader->isEmptyElement())
- return;
-
- while ( mReader->read())
- {
- if ( mReader->getNodeType() == irr::io::EXN_ELEMENT) {
- if ( IsElement( "instance_visual_scene"))
- {
- // should be the first and only occurence
- if ( mRootNode)
- ThrowException( "Invalid scene containing multiple root nodes");
-
- // read the url of the scene to instance. Should be of format "#some_name"
- int urlIndex = GetAttribute( "url");
- const char* url = mReader->getAttributeValue( urlIndex);
- if ( url[0] != '#')
- ThrowException( "Unknown reference format");
-
- // find the referred scene, skip the leading #
- NodeLibrary::const_iterator sit = mNodeLibrary.find( url+1);
- if ( sit == mNodeLibrary.end())
- ThrowException( "Unable to resolve visual_scene reference \"" + std::string(url) + "\".");
- mRootNode = sit->second;
- } else {
- SkipElement();
- }
- }
- else if ( mReader->getNodeType() == irr::io::EXN_ELEMENT_END){
- break;
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Aborts the file reading with an exception
-void ColladaParser::ThrowException( const std::string& pError) const
-{
- throw DeadlyImportError( boost::str( boost::format( "Collada: %s - %s") % mFileName % pError));
-}
-
-// ------------------------------------------------------------------------------------------------
-// Skips all data until the end node of the current element
-void ColladaParser::SkipElement()
-{
- // nothing to skip if it's an <element />
- if ( mReader->isEmptyElement())
- return;
-
- // reroute
- SkipElement( mReader->getNodeName());
-}
-
-// ------------------------------------------------------------------------------------------------
-// Skips all data until the end node of the given element
-void ColladaParser::SkipElement( const char* pElement)
-{
- // copy the current node's name because it'a pointer to the reader's internal buffer,
- // which is going to change with the upcoming parsing
- std::string element = pElement;
- while ( mReader->read())
- {
- if ( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
- if ( mReader->getNodeName() == element)
- break;
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Tests for an opening element of the given name, throws an exception if not found
-void ColladaParser::TestOpening( const char* pName)
-{
- // read element start
- if ( !mReader->read())
- ThrowException( boost::str( boost::format( "Unexpected end of file while beginning of \"%s\" element.") % pName));
- // whitespace in front is ok, just read again if found
- if ( mReader->getNodeType() == irr::io::EXN_TEXT)
- if ( !mReader->read())
- ThrowException( boost::str( boost::format( "Unexpected end of file while reading beginning of \"%s\" element.") % pName));
-
- if ( mReader->getNodeType() != irr::io::EXN_ELEMENT || strcmp( mReader->getNodeName(), pName) != 0)
- ThrowException( boost::str( boost::format( "Expected start of \"%s\" element.") % pName));
-}
-
-// ------------------------------------------------------------------------------------------------
-// Tests for the closing tag of the given element, throws an exception if not found
-void ColladaParser::TestClosing( const char* pName)
-{
- // check if we're already on the closing tag and return right away
- if ( mReader->getNodeType() == irr::io::EXN_ELEMENT_END && strcmp( mReader->getNodeName(), pName) == 0)
- return;
-
- // if not, read some more
- if ( !mReader->read())
- ThrowException( boost::str( boost::format( "Unexpected end of file while reading end of \"%s\" element.") % pName));
- // whitespace in front is ok, just read again if found
- if ( mReader->getNodeType() == irr::io::EXN_TEXT)
- if ( !mReader->read())
- ThrowException( boost::str( boost::format( "Unexpected end of file while reading end of \"%s\" element.") % pName));
-
- // but this has the be the closing tag, or we're lost
- if ( mReader->getNodeType() != irr::io::EXN_ELEMENT_END || strcmp( mReader->getNodeName(), pName) != 0)
- ThrowException( boost::str( boost::format( "Expected end of \"%s\" element.") % pName));
-}
-
-// ------------------------------------------------------------------------------------------------
-// Returns the index of the named attribute or -1 if not found. Does not throw, therefore useful for optional attributes
-int ColladaParser::GetAttribute( const char* pAttr) const
-{
- int index = TestAttribute( pAttr);
- if ( index != -1)
- return index;
-
- // attribute not found -> throw an exception
- ThrowException( boost::str( boost::format( "Expected attribute \"%s\" at element \"%s\".") % pAttr % mReader->getNodeName()));
- return -1;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Tests the present element for the presence of one attribute, returns its index or throws an exception if not found
-int ColladaParser::TestAttribute( const char* pAttr) const
-{
- for ( int a = 0; a < mReader->getAttributeCount(); a++)
- if ( strcmp( mReader->getAttributeName( a), pAttr) == 0)
- return a;
-
- return -1;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads the text contents of an element, throws an exception if not given. Skips leading whitespace.
-const char* ColladaParser::GetTextContent()
-{
- const char* sz = TestTextContent();
- if (!sz) {
- ThrowException( "Invalid contents in element \"n\".");
- }
- return sz;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads the text contents of an element, returns NULL if not given. Skips leading whitespace.
-const char* ColladaParser::TestTextContent()
-{
- // present node should be the beginning of an element
- if ( mReader->getNodeType() != irr::io::EXN_ELEMENT || mReader->isEmptyElement())
- ThrowException( "Expected opening element");
-
- // read contents of the element
- if ( !mReader->read())
- ThrowException( "Unexpected end of file while reading n element.");
- if ( mReader->getNodeType() != irr::io::EXN_TEXT)
- return NULL;
-
- // skip leading whitespace
- const char* text = mReader->getNodeData();
- SkipSpacesAndLineEnd( &text);
-
- return text;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Calculates the resulting transformation fromm all the given transform steps
-aiMatrix4x4 ColladaParser::CalculateResultTransform( const std::vector<Transform>& pTransforms) const
-{
- aiMatrix4x4 res;
-
- for ( std::vector<Transform>::const_iterator it = pTransforms.begin(); it != pTransforms.end(); ++it)
- {
- const Transform& tf = *it;
- switch( tf.mType)
- {
- case TF_LOOKAT:
- {
- aiVector3D pos( tf.f[0], tf.f[1], tf.f[2]);
- aiVector3D dstPos( tf.f[3], tf.f[4], tf.f[5]);
- aiVector3D up = aiVector3D( tf.f[6], tf.f[7], tf.f[8]).Normalize();
- aiVector3D dir = aiVector3D( dstPos - pos).Normalize();
- aiVector3D right = (dir ^ up).Normalize();
-
- res *= aiMatrix4x4(
- right.x, up.x, -dir.x, pos.x,
- right.y, up.y, -dir.y, pos.y,
- right.z, up.z, -dir.z, pos.z,
- 0, 0, 0, 1);
- break;
- }
- case TF_ROTATE:
- {
- aiMatrix4x4 rot;
- float angle = tf.f[3] * float( AI_MATH_PI) / 180.0f;
- aiVector3D axis( tf.f[0], tf.f[1], tf.f[2]);
- aiMatrix4x4::Rotation( angle, axis, rot);
- res *= rot;
- break;
- }
- case TF_TRANSLATE:
- {
- aiMatrix4x4 trans;
- aiMatrix4x4::Translation( aiVector3D( tf.f[0], tf.f[1], tf.f[2]), trans);
- res *= trans;
- break;
- }
- case TF_SCALE:
- {
- aiMatrix4x4 scale( tf.f[0], 0.0f, 0.0f, 0.0f, 0.0f, tf.f[1], 0.0f, 0.0f, 0.0f, 0.0f, tf.f[2], 0.0f,
- 0.0f, 0.0f, 0.0f, 1.0f);
- res *= scale;
- break;
- }
- case TF_SKEW:
- // TODO: (thom)
- ai_assert( false);
- break;
- case TF_MATRIX:
- {
- aiMatrix4x4 mat( tf.f[0], tf.f[1], tf.f[2], tf.f[3], tf.f[4], tf.f[5], tf.f[6], tf.f[7],
- tf.f[8], tf.f[9], tf.f[10], tf.f[11], tf.f[12], tf.f[13], tf.f[14], tf.f[15]);
- res *= mat;
- break;
- }
- default:
- assert( false);
- break;
- }
- }
-
- return res;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Determines the input data type for the given semantic string
-Collada::InputType ColladaParser::GetTypeForSemantic( const std::string& pSemantic)
-{
- if ( pSemantic == "POSITION")
- return IT_Position;
- else if ( pSemantic == "TEXCOORD")
- return IT_Texcoord;
- else if ( pSemantic == "NORMAL")
- return IT_Normal;
- else if ( pSemantic == "COLOR")
- return IT_Color;
- else if ( pSemantic == "VERTEX")
- return IT_Vertex;
- else if ( pSemantic == "BINORMAL" || pSemantic == "TEXBINORMAL")
- return IT_Bitangent;
- else if ( pSemantic == "TANGENT" || pSemantic == "TEXTANGENT")
- return IT_Tangent;
-
- DefaultLogger::get()->warn( boost::str( boost::format( "Unknown vertex input type \"%s\". Ignoring.") % pSemantic));
- return IT_Invalid;
-}
-
-#endif // !! ASSIMP_BUILD_NO_DAE_IMPORTER
diff --git a/3rdparty/assimp/code/ColladaParser.h b/3rdparty/assimp/code/ColladaParser.h
deleted file mode 100644
index cba18474..00000000
--- a/3rdparty/assimp/code/ColladaParser.h
+++ /dev/null
@@ -1,341 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
-copyright notice, this list of conditions and the
-following disclaimer.
-
-* Redistributions in binary form must reproduce the above
-copyright notice, this list of conditions and the
-following disclaimer in the documentation and/or other
-materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
-contributors may be used to endorse or promote products
-derived from this software without specific prior
-written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file ColladaParser.h
- * @brief Defines the parser helper class for the collada loader
- */
-
-#ifndef AI_COLLADAPARSER_H_INC
-#define AI_COLLADAPARSER_H_INC
-
-#include "irrXMLWrapper.h"
-#include "ColladaHelper.h"
-
-namespace Assimp
-{
-
-// ------------------------------------------------------------------------------------------
-/** Parser helper class for the Collada loader.
- *
- * Does all the XML reading and builds internal data structures from it,
- * but leaves the resolving of all the references to the loader.
-*/
-class ColladaParser
-{
- friend class ColladaLoader;
-
-protected:
- /** Constructor from XML file */
- ColladaParser( IOSystem* pIOHandler, const std::string& pFile);
-
- /** Destructor */
- ~ColladaParser();
-
- /** Reads the contents of the file */
- void ReadContents();
-
- /** Reads the structure of the file */
- void ReadStructure();
-
- /** Reads asset informations such as coordinate system informations and legal blah */
- void ReadAssetInfo();
-
- /** Reads the animation library */
- void ReadAnimationLibrary();
-
- /** Reads an animation into the given parent structure */
- void ReadAnimation( Collada::Animation* pParent);
-
- /** Reads an animation sampler into the given anim channel */
- void ReadAnimationSampler( Collada::AnimationChannel& pChannel);
-
- /** Reads the skeleton controller library */
- void ReadControllerLibrary();
-
- /** Reads a controller into the given mesh structure */
- void ReadController( Collada::Controller& pController);
-
- /** Reads the joint definitions for the given controller */
- void ReadControllerJoints( Collada::Controller& pController);
-
- /** Reads the joint weights for the given controller */
- void ReadControllerWeights( Collada::Controller& pController);
-
- /** Reads the image library contents */
- void ReadImageLibrary();
-
- /** Reads an image entry into the given image */
- void ReadImage( Collada::Image& pImage);
-
- /** Reads the material library */
- void ReadMaterialLibrary();
-
- /** Reads a material entry into the given material */
- void ReadMaterial( Collada::Material& pMaterial);
-
- /** Reads the camera library */
- void ReadCameraLibrary();
-
- /** Reads a camera entry into the given camera */
- void ReadCamera( Collada::Camera& pCamera);
-
- /** Reads the light library */
- void ReadLightLibrary();
-
- /** Reads a light entry into the given light */
- void ReadLight( Collada::Light& pLight);
-
- /** Reads the effect library */
- void ReadEffectLibrary();
-
- /** Reads an effect entry into the given effect*/
- void ReadEffect( Collada::Effect& pEffect);
-
- /** Reads an COMMON effect profile */
- void ReadEffectProfileCommon( Collada::Effect& pEffect);
-
- /** Read sampler properties */
- void ReadSamplerProperties( Collada::Sampler& pSampler);
-
- /** Reads an effect entry containing a color or a texture defining that color */
- void ReadEffectColor( aiColor4D& pColor, Collada::Sampler& pSampler);
-
- /** Reads an effect entry containing a float */
- void ReadEffectFloat( float& pFloat);
-
- /** Reads an effect parameter specification of any kind */
- void ReadEffectParam( Collada::EffectParam& pParam);
-
- /** Reads the geometry library contents */
- void ReadGeometryLibrary();
-
- /** Reads a geometry from the geometry library. */
- void ReadGeometry( Collada::Mesh* pMesh);
-
- /** Reads a mesh from the geometry library */
- void ReadMesh( Collada::Mesh* pMesh);
-
- /** Reads a source element - a combination of raw data and an accessor defining
- * things that should not be redefinable. Yes, that's another rant.
- */
- void ReadSource();
-
- /** Reads a data array holding a number of elements, and stores it in the global library.
- * Currently supported are array of floats and arrays of strings.
- */
- void ReadDataArray();
-
- /** Reads an accessor and stores it in the global library under the given ID -
- * accessors use the ID of the parent <source> element
- */
- void ReadAccessor( const std::string& pID);
-
- /** Reads input declarations of per-vertex mesh data into the given mesh */
- void ReadVertexData( Collada::Mesh* pMesh);
-
- /** Reads input declarations of per-index mesh data into the given mesh */
- void ReadIndexData( Collada::Mesh* pMesh);
-
- /** Reads a single input channel element and stores it in the given array, if valid */
- void ReadInputChannel( std::vector<Collada::InputChannel>& poChannels);
-
- /** Reads a <p> primitive index list and assembles the mesh data into the given mesh */
- void ReadPrimitives( Collada::Mesh* pMesh, std::vector<Collada::InputChannel>& pPerIndexChannels,
- size_t pNumPrimitives, const std::vector<size_t>& pVCount, Collada::PrimitiveType pPrimType);
-
- /** Extracts a single object from an input channel and stores it in the appropriate mesh data array */
- void ExtractDataObjectFromChannel( const Collada::InputChannel& pInput, size_t pLocalIndex, Collada::Mesh* pMesh);
-
- /** Reads the library of node hierarchies and scene parts */
- void ReadSceneLibrary();
-
- /** Reads a scene node's contents including children and stores it in the given node */
- void ReadSceneNode( Collada::Node* pNode);
-
- /** Reads a node transformation entry of the given type and adds it to the given node's transformation list. */
- void ReadNodeTransformation( Collada::Node* pNode, Collada::TransformType pType);
-
- /** Reads a mesh reference in a node and adds it to the node's mesh list */
- void ReadNodeGeometry( Collada::Node* pNode);
-
- /** Reads the collada scene */
- void ReadScene();
-
- // Processes bind_vertex_input and bind elements
- void ReadMaterialVertexInputBinding( Collada::SemanticMappingTable& tbl);
-
-protected:
- /** Aborts the file reading with an exception */
- void ThrowException( const std::string& pError) const;
-
- /** Skips all data until the end node of the current element */
- void SkipElement();
-
- /** Skips all data until the end node of the given element */
- void SkipElement( const char* pElement);
-
- /** Compares the current xml element name to the given string and returns true if equal */
- bool IsElement( const char* pName) const;
-
- /** Tests for the opening tag of the given element, throws an exception if not found */
- void TestOpening( const char* pName);
-
- /** Tests for the closing tag of the given element, throws an exception if not found */
- void TestClosing( const char* pName);
-
- /** Checks the present element for the presence of the attribute, returns its index
- or throws an exception if not found */
- int GetAttribute( const char* pAttr) const;
-
- /** Returns the index of the named attribute or -1 if not found. Does not throw,
- therefore useful for optional attributes */
- int TestAttribute( const char* pAttr) const;
-
- /** Reads the text contents of an element, throws an exception if not given.
- Skips leading whitespace. */
- const char* GetTextContent();
-
- /** Reads the text contents of an element, returns NULL if not given.
- Skips leading whitespace. */
- const char* TestTextContent();
-
- /** Reads a single bool from current text content */
- bool ReadBoolFromTextContent();
-
- /** Reads a single float from current text content */
- float ReadFloatFromTextContent();
-
- /** Calculates the resulting transformation from all the given transform steps */
- aiMatrix4x4 CalculateResultTransform( const std::vector<Collada::Transform>& pTransforms) const;
-
- /** Determines the input data type for the given semantic string */
- Collada::InputType GetTypeForSemantic( const std::string& pSemantic);
-
- /** Finds the item in the given library by its reference, throws if not found */
- template <typename Type> const Type& ResolveLibraryReference(
- const std::map<std::string, Type>& pLibrary, const std::string& pURL) const;
-
-protected:
- /** Filename, for a verbose error message */
- std::string mFileName;
-
- /** XML reader, member for everyday use */
- irr::io::IrrXMLReader* mReader;
-
- /** All data arrays found in the file by ID. Might be referred to by actually
- everyone. Collada, you are a steaming pile of indirection. */
- typedef std::map<std::string, Collada::Data> DataLibrary;
- DataLibrary mDataLibrary;
-
- /** Same for accessors which define how the data in a data array is accessed. */
- typedef std::map<std::string, Collada::Accessor> AccessorLibrary;
- AccessorLibrary mAccessorLibrary;
-
- /** Mesh library: mesh by ID */
- typedef std::map<std::string, Collada::Mesh*> MeshLibrary;
- MeshLibrary mMeshLibrary;
-
- /** node library: root node of the hierarchy part by ID */
- typedef std::map<std::string, Collada::Node*> NodeLibrary;
- NodeLibrary mNodeLibrary;
-
- /** Image library: stores texture properties by ID */
- typedef std::map<std::string, Collada::Image> ImageLibrary;
- ImageLibrary mImageLibrary;
-
- /** Effect library: surface attributes by ID */
- typedef std::map<std::string, Collada::Effect> EffectLibrary;
- EffectLibrary mEffectLibrary;
-
- /** Material library: surface material by ID */
- typedef std::map<std::string, Collada::Material> MaterialLibrary;
- MaterialLibrary mMaterialLibrary;
-
- /** Light library: surface light by ID */
- typedef std::map<std::string, Collada::Light> LightLibrary;
- LightLibrary mLightLibrary;
-
- /** Camera library: surface material by ID */
- typedef std::map<std::string, Collada::Camera> CameraLibrary;
- CameraLibrary mCameraLibrary;
-
- /** Controller library: joint controllers by ID */
- typedef std::map<std::string, Collada::Controller> ControllerLibrary;
- ControllerLibrary mControllerLibrary;
-
- /** Pointer to the root node. Don't delete, it just points to one of
- the nodes in the node library. */
- Collada::Node* mRootNode;
-
- /** Root animation container */
- Collada::Animation mAnims;
-
- /** Size unit: how large compared to a meter */
- float mUnitSize;
-
- /** Which is the up vector */
- enum { UP_X, UP_Y, UP_Z } mUpDirection;
-
- /** Collada file format version */
- Collada::FormatVersion mFormat;
-};
-
-// ------------------------------------------------------------------------------------------------
-// Check for element match
-inline bool ColladaParser::IsElement( const char* pName) const
-{
- ai_assert( mReader->getNodeType() == irr::io::EXN_ELEMENT);
- return ::strcmp( mReader->getNodeName(), pName) == 0;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Finds the item in the given library by its reference, throws if not found
-template <typename Type>
-const Type& ColladaParser::ResolveLibraryReference( const std::map<std::string, Type>& pLibrary, const std::string& pURL) const
-{
- typename std::map<std::string, Type>::const_iterator it = pLibrary.find( pURL);
- if ( it == pLibrary.end())
- ThrowException( boost::str( boost::format( "Unable to resolve library reference \"%s\".") % pURL));
- return it->second;
-}
-
-} // end of namespace Assimp
-
-#endif // AI_COLLADAPARSER_H_INC
diff --git a/3rdparty/assimp/code/ComputeUVMappingProcess.cpp b/3rdparty/assimp/code/ComputeUVMappingProcess.cpp
deleted file mode 100644
index 68b75bae..00000000
--- a/3rdparty/assimp/code/ComputeUVMappingProcess.cpp
+++ /dev/null
@@ -1,504 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file GenUVCoords step */
-
-
-#include "AssimpPCH.h"
-#include "ComputeUVMappingProcess.h"
-#include "ProcessHelper.h"
-
-using namespace Assimp;
-
-namespace {
-
- const static aiVector3D base_axis_y(0.f,1.f,0.f);
- const static aiVector3D base_axis_x(1.f,0.f,0.f);
- const static aiVector3D base_axis_z(0.f,0.f,1.f);
- const static float angle_epsilon = 0.95f;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-ComputeUVMappingProcess::ComputeUVMappingProcess()
-{
- // nothing to do here
-}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-ComputeUVMappingProcess::~ComputeUVMappingProcess()
-{
- // nothing to do here
-}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the processing step is present in the given flag field.
-bool ComputeUVMappingProcess::IsActive( unsigned int pFlags) const
-{
- return (pFlags & aiProcess_GenUVCoords) != 0;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Check whether a ray intersects a plane and find the intersection point
-inline bool PlaneIntersect(const aiRay& ray, const aiVector3D& planePos,
- const aiVector3D& planeNormal, aiVector3D& pos)
-{
- const float b = planeNormal * (planePos - ray.pos);
- float h = ray.dir * planeNormal;
- if ((h < 10e-5f && h > -10e-5f) || (h = b/h) < 0)
- return false;
-
- pos = ray.pos + (ray.dir * h);
- return true;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Find the first empty UV channel in a mesh
-inline unsigned int FindEmptyUVChannel (aiMesh* mesh)
-{
- for (unsigned int m = 0; m < AI_MAX_NUMBER_OF_TEXTURECOORDS;++m)
- if (!mesh->mTextureCoords[m])return m;
-
- DefaultLogger::get()->error("Unable to compute UV coordinates, no free UV slot found");
- return 0xffffffff;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Try to remove UV seams
-void RemoveUVSeams (aiMesh* mesh, aiVector3D* out)
-{
- // TODO: just a very rough algorithm. I think it could be done
- // much easier, but I don't know how and am currently too tired to
- // to think about a better solution.
-
- const static float LOWER_LIMIT = 0.1f;
- const static float UPPER_LIMIT = 0.9f;
-
- const static float LOWER_EPSILON = 10e-3f;
- const static float UPPER_EPSILON = 1.f-10e-3f;
-
- for (unsigned int fidx = 0; fidx < mesh->mNumFaces;++fidx)
- {
- const aiFace& face = mesh->mFaces[fidx];
- if (face.mNumIndices < 3) continue; // triangles and polygons only, please
-
- unsigned int small = face.mNumIndices, large = small;
- bool zero = false, one = false, round_to_zero = false;
-
- // Check whether this face lies on a UV seam. We can just guess,
- // but the assumption that a face with at least one very small
- // on the one side and one very large U coord on the other side
- // lies on a UV seam should work for most cases.
- for (unsigned int n = 0; n < face.mNumIndices;++n)
- {
- if (out[face.mIndices[n]].x < LOWER_LIMIT)
- {
- small = n;
-
- // If we have a U value very close to 0 we can't
- // round the others to 0, too.
- if (out[face.mIndices[n]].x <= LOWER_EPSILON)
- zero = true;
- else round_to_zero = true;
- }
- if (out[face.mIndices[n]].x > UPPER_LIMIT)
- {
- large = n;
-
- // If we have a U value very close to 1 we can't
- // round the others to 1, too.
- if (out[face.mIndices[n]].x >= UPPER_EPSILON)
- one = true;
- }
- }
- if (small != face.mNumIndices && large != face.mNumIndices)
- {
- for (unsigned int n = 0; n < face.mNumIndices;++n)
- {
- // If the u value is over the upper limit and no other u
- // value of that face is 0, round it to 0
- if (out[face.mIndices[n]].x > UPPER_LIMIT && !zero)
- out[face.mIndices[n]].x = 0.f;
-
- // If the u value is below the lower limit and no other u
- // value of that face is 1, round it to 1
- else if (out[face.mIndices[n]].x < LOWER_LIMIT && !one)
- out[face.mIndices[n]].x = 1.f;
-
- // The face contains both 0 and 1 as UV coords. This can occur
- // for faces which have an edge that lies directly on the seam.
- // Due to numerical inaccuracies one U coord becomes 0, the
- // other 1. But we do still have a third UV coord to determine
- // to which side we must round to.
- else if (one && zero)
- {
- if (round_to_zero && out[face.mIndices[n]].x >= UPPER_EPSILON)
- out[face.mIndices[n]].x = 0.f;
- else if (!round_to_zero && out[face.mIndices[n]].x <= LOWER_EPSILON)
- out[face.mIndices[n]].x = 1.f;
- }
- }
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void ComputeUVMappingProcess::ComputeSphereMapping(aiMesh* mesh,const aiVector3D& axis, aiVector3D* out)
-{
- aiVector3D center, min, max;
- FindMeshCenter(mesh, center, min, max);
-
- // If the axis is one of x,y,z run a faster code path. It's worth the extra effort ...
- // currently the mapping axis will always be one of x,y,z, except if the
- // PretransformVertices step is used (it transforms the meshes into worldspace,
- // thus changing the mapping axis)
- if (axis * base_axis_x >= angle_epsilon) {
-
- // For each point get a normalized projection vector in the sphere,
- // get its longitude and latitude and map them to their respective
- // UV axes. Problems occur around the poles ... unsolvable.
- //
- // The spherical coordinate system looks like this:
- // x = cos(lon)*cos(lat)
- // y = sin(lon)*cos(lat)
- // z = sin(lat)
- //
- // Thus we can derive:
- // lat = arcsin (z)
- // lon = arctan (y/x)
- for (unsigned int pnt = 0; pnt < mesh->mNumVertices;++pnt) {
- const aiVector3D diff = (mesh->mVertices[pnt]-center).Normalize();
- out[pnt] = aiVector3D((atan2 (diff.z, diff.y) + AI_MATH_PI_F ) / AI_MATH_TWO_PI_F,
- (asin (diff.x) + AI_MATH_HALF_PI_F) / AI_MATH_PI_F, 0.f);
- }
- }
- else if (axis * base_axis_y >= angle_epsilon) {
- // ... just the same again
- for (unsigned int pnt = 0; pnt < mesh->mNumVertices;++pnt) {
- const aiVector3D diff = (mesh->mVertices[pnt]-center).Normalize();
- out[pnt] = aiVector3D((atan2 (diff.x, diff.z) + AI_MATH_PI_F ) / AI_MATH_TWO_PI_F,
- (asin (diff.y) + AI_MATH_HALF_PI_F) / AI_MATH_PI_F, 0.f);
- }
- }
- else if (axis * base_axis_z >= angle_epsilon) {
- // ... just the same again
- for (unsigned int pnt = 0; pnt < mesh->mNumVertices;++pnt) {
- const aiVector3D diff = (mesh->mVertices[pnt]-center).Normalize();
- out[pnt] = aiVector3D((atan2 (diff.y, diff.x) + AI_MATH_PI_F ) / AI_MATH_TWO_PI_F,
- (asin (diff.z) + AI_MATH_HALF_PI_F) / AI_MATH_PI_F, 0.f);
- }
- }
- // slower code path in case the mapping axis is not one of the coordinate system axes
- else {
- aiMatrix4x4 mTrafo;
- aiMatrix4x4::FromToMatrix(axis,base_axis_y,mTrafo);
-
- // again the same, except we're applying a transformation now
- for (unsigned int pnt = 0; pnt < mesh->mNumVertices;++pnt) {
- const aiVector3D diff = ((mTrafo*mesh->mVertices[pnt])-center).Normalize();
- out[pnt] = aiVector3D((atan2 (diff.y, diff.x) + AI_MATH_PI_F ) / AI_MATH_TWO_PI_F,
- (asin (diff.z) + AI_MATH_HALF_PI_F) / AI_MATH_PI_F, 0.f);
- }
- }
-
-
- // Now find and remove UV seams. A seam occurs if a face has a tcoord
- // close to zero on the one side, and a tcoord close to one on the
- // other side.
- RemoveUVSeams(mesh,out);
-}
-
-// ------------------------------------------------------------------------------------------------
-void ComputeUVMappingProcess::ComputeCylinderMapping(aiMesh* mesh,const aiVector3D& axis, aiVector3D* out)
-{
- aiVector3D center, min, max;
-
- // If the axis is one of x,y,z run a faster code path. It's worth the extra effort ...
- // currently the mapping axis will always be one of x,y,z, except if the
- // PretransformVertices step is used (it transforms the meshes into worldspace,
- // thus changing the mapping axis)
- if (axis * base_axis_x >= angle_epsilon) {
- FindMeshCenter(mesh, center, min, max);
- const float diff = max.x - min.x;
-
- // If the main axis is 'z', the z coordinate of a point 'p' is mapped
- // directly to the texture V axis. The other axis is derived from
- // the angle between ( p.x - c.x, p.y - c.y ) and (1,0), where
- // 'c' is the center point of the mesh.
- for (unsigned int pnt = 0; pnt < mesh->mNumVertices;++pnt) {
- const aiVector3D& pos = mesh->mVertices[pnt];
- aiVector3D& uv = out[pnt];
-
- uv.y = (pos.x - min.x) / diff;
- uv.x = (atan2 ( pos.z - center.z, pos.y - center.y) +(float)AI_MATH_PI ) / (float)AI_MATH_TWO_PI;
- }
- }
- else if (axis * base_axis_y >= angle_epsilon) {
- FindMeshCenter(mesh, center, min, max);
- const float diff = max.y - min.y;
-
- // just the same ...
- for (unsigned int pnt = 0; pnt < mesh->mNumVertices;++pnt) {
- const aiVector3D& pos = mesh->mVertices[pnt];
- aiVector3D& uv = out[pnt];
-
- uv.y = (pos.y - min.y) / diff;
- uv.x = (atan2 ( pos.x - center.x, pos.z - center.z) +(float)AI_MATH_PI ) / (float)AI_MATH_TWO_PI;
- }
- }
- else if (axis * base_axis_z >= angle_epsilon) {
- FindMeshCenter(mesh, center, min, max);
- const float diff = max.z - min.z;
-
- // just the same ...
- for (unsigned int pnt = 0; pnt < mesh->mNumVertices;++pnt) {
- const aiVector3D& pos = mesh->mVertices[pnt];
- aiVector3D& uv = out[pnt];
-
- uv.y = (pos.z - min.z) / diff;
- uv.x = (atan2 ( pos.y - center.y, pos.x - center.x) +(float)AI_MATH_PI ) / (float)AI_MATH_TWO_PI;
- }
- }
- // slower code path in case the mapping axis is not one of the coordinate system axes
- else {
- aiMatrix4x4 mTrafo;
- aiMatrix4x4::FromToMatrix(axis,base_axis_y,mTrafo);
- FindMeshCenterTransformed(mesh, center, min, max,mTrafo);
- const float diff = max.y - min.y;
-
- // again the same, except we're applying a transformation now
- for (unsigned int pnt = 0; pnt < mesh->mNumVertices;++pnt){
- const aiVector3D pos = mTrafo* mesh->mVertices[pnt];
- aiVector3D& uv = out[pnt];
-
- uv.y = (pos.y - min.y) / diff;
- uv.x = (atan2 ( pos.x - center.x, pos.z - center.z) +(float)AI_MATH_PI ) / (float)AI_MATH_TWO_PI;
- }
- }
-
- // Now find and remove UV seams. A seam occurs if a face has a tcoord
- // close to zero on the one side, and a tcoord close to one on the
- // other side.
- RemoveUVSeams(mesh,out);
-}
-
-// ------------------------------------------------------------------------------------------------
-void ComputeUVMappingProcess::ComputePlaneMapping(aiMesh* mesh,const aiVector3D& axis, aiVector3D* out)
-{
- float diffu,diffv;
- aiVector3D center, min, max;
-
- // If the axis is one of x,y,z run a faster code path. It's worth the extra effort ...
- // currently the mapping axis will always be one of x,y,z, except if the
- // PretransformVertices step is used (it transforms the meshes into worldspace,
- // thus changing the mapping axis)
- if (axis * base_axis_x >= angle_epsilon) {
- FindMeshCenter(mesh, center, min, max);
- diffu = max.z - min.z;
- diffv = max.y - min.y;
-
- for (unsigned int pnt = 0; pnt < mesh->mNumVertices;++pnt) {
- const aiVector3D& pos = mesh->mVertices[pnt];
- out[pnt].Set((pos.z - min.z) / diffu,(pos.y - min.y) / diffv);
- }
- }
- else if (axis * base_axis_y >= angle_epsilon) {
- FindMeshCenter(mesh, center, min, max);
- diffu = max.x - min.x;
- diffv = max.z - min.z;
-
- for (unsigned int pnt = 0; pnt < mesh->mNumVertices;++pnt) {
- const aiVector3D& pos = mesh->mVertices[pnt];
- out[pnt].Set((pos.x - min.x) / diffu,(pos.z - min.z) / diffv);
- }
- }
- else if (axis * base_axis_z >= angle_epsilon) {
- FindMeshCenter(mesh, center, min, max);
- diffu = max.y - min.y;
- diffv = max.z - min.z;
-
- for (unsigned int pnt = 0; pnt < mesh->mNumVertices;++pnt) {
- const aiVector3D& pos = mesh->mVertices[pnt];
- out[pnt].Set((pos.y - min.y) / diffu,(pos.x - min.x) / diffv);
- }
- }
- // slower code path in case the mapping axis is not one of the coordinate system axes
- else
- {
- aiMatrix4x4 mTrafo;
- aiMatrix4x4::FromToMatrix(axis,base_axis_y,mTrafo);
- FindMeshCenterTransformed(mesh, center, min, max,mTrafo);
- diffu = max.x - min.x;
- diffv = max.z - min.z;
-
- // again the same, except we're applying a transformation now
- for (unsigned int pnt = 0; pnt < mesh->mNumVertices;++pnt) {
- const aiVector3D pos = mTrafo * mesh->mVertices[pnt];
- out[pnt].Set((pos.x - min.x) / diffu,(pos.z - min.z) / diffv);
- }
- }
-
- // shouldn't be necessary to remove UV seams ...
-}
-
-// ------------------------------------------------------------------------------------------------
-void ComputeUVMappingProcess::ComputeBoxMapping(aiMesh* mesh, aiVector3D* out)
-{
- DefaultLogger::get()->error("Mapping type currently not implemented");
-}
-
-// ------------------------------------------------------------------------------------------------
-void ComputeUVMappingProcess::Execute( aiScene* pScene)
-{
- DefaultLogger::get()->debug("GenUVCoordsProcess begin");
- char buffer[1024];
-
- if (pScene->mFlags & AI_SCENE_FLAGS_NON_VERBOSE_FORMAT)
- throw DeadlyImportError("Post-processing order mismatch: expecting pseudo-indexed (\"verbose\") vertices here");
-
- std::list<MappingInfo> mappingStack;
-
- /* Iterate through all materials and search for non-UV mapped textures
- */
- for (unsigned int i = 0; i < pScene->mNumMaterials;++i)
- {
- mappingStack.clear();
- aiMaterial* mat = pScene->mMaterials[i];
- for (unsigned int a = 0; a < mat->mNumProperties;++a)
- {
- aiMaterialProperty* prop = mat->mProperties[a];
- if (!::strcmp( prop->mKey.data, "$tex.mapping"))
- {
- aiTextureMapping& mapping = *((aiTextureMapping*)prop->mData);
- if (aiTextureMapping_UV != mapping)
- {
- if (!DefaultLogger::isNullLogger())
- {
- sprintf(buffer, "Found non-UV mapped texture (%s,%i). Mapping type: %s",
- TextureTypeToString((aiTextureType)prop->mSemantic),prop->mIndex,
- MappingTypeToString(mapping));
-
- DefaultLogger::get()->info(buffer);
- }
-
- if (aiTextureMapping_OTHER == mapping)
- continue;
-
- MappingInfo info (mapping);
-
- // Get further properties - currently only the major axis
- for (unsigned int a2 = 0; a2 < mat->mNumProperties;++a2)
- {
- aiMaterialProperty* prop2 = mat->mProperties[a2];
- if (prop2->mSemantic != prop->mSemantic || prop2->mIndex != prop->mIndex)
- continue;
-
- if ( !::strcmp( prop2->mKey.data, "$tex.mapaxis")) {
- info.axis = *((aiVector3D*)prop2->mData);
- break;
- }
- }
-
- unsigned int idx;
-
- // Check whether we have this mapping mode already
- std::list<MappingInfo>::iterator it = std::find (mappingStack.begin(),mappingStack.end(), info);
- if (mappingStack.end() != it)
- {
- idx = (*it).uv;
- }
- else
- {
- /* We have found a non-UV mapped texture. Now
- * we need to find all meshes using this material
- * that we can compute UV channels for them.
- */
- for (unsigned int m = 0; m < pScene->mNumMeshes;++m)
- {
- aiMesh* mesh = pScene->mMeshes[m];
- unsigned int outIdx;
- if ( mesh->mMaterialIndex != i || ( outIdx = FindEmptyUVChannel(mesh) ) == 0xffffffff ||
- !mesh->mNumVertices)
- {
- continue;
- }
-
- // Allocate output storage
- aiVector3D* p = mesh->mTextureCoords[outIdx] = new aiVector3D[mesh->mNumVertices];
-
- switch (mapping)
- {
- case aiTextureMapping_SPHERE:
- ComputeSphereMapping(mesh,info.axis,p);
- break;
- case aiTextureMapping_CYLINDER:
- ComputeCylinderMapping(mesh,info.axis,p);
- break;
- case aiTextureMapping_PLANE:
- ComputePlaneMapping(mesh,info.axis,p);
- break;
- case aiTextureMapping_BOX:
- ComputeBoxMapping(mesh,p);
- break;
- default:
- ai_assert(false);
- }
- if (m && idx != outIdx)
- {
- DefaultLogger::get()->warn("UV index mismatch. Not all meshes assigned to "
- "this material have equal numbers of UV channels. The UV index stored in "
- "the material structure does therefore not apply for all meshes. ");
- }
- idx = outIdx;
- }
- info.uv = idx;
- mappingStack.push_back(info);
- }
-
- // Update the material property list
- mapping = aiTextureMapping_UV;
- ((MaterialHelper*)mat)->AddProperty(&idx,1,AI_MATKEY_UVWSRC(prop->mSemantic,prop->mIndex));
- }
- }
- }
- }
- DefaultLogger::get()->debug("GenUVCoordsProcess finished");
-}
diff --git a/3rdparty/assimp/code/ComputeUVMappingProcess.h b/3rdparty/assimp/code/ComputeUVMappingProcess.h
deleted file mode 100644
index 412c641a..00000000
--- a/3rdparty/assimp/code/ComputeUVMappingProcess.h
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file Defines a post processing step to compute UV coordinates
- from abstract mappings, such as box or spherical*/
-#ifndef AI_COMPUTEUVMAPPING_H_INC
-#define AI_COMPUTEUVMAPPING_H_INC
-
-#include "BaseProcess.h"
-#include "../include/aiMesh.h"
-
-class ComputeUVMappingTest;
-namespace Assimp
- {
-
-// ---------------------------------------------------------------------------
-/** ComputeUVMappingProcess - converts special mappings, such as spherical,
- * cylindrical or boxed to proper UV coordinates for rendering.
-*/
-class ASSIMP_API ComputeUVMappingProcess : public BaseProcess
-{
- friend class Importer;
- friend class ::ComputeUVMappingTest; // grant the unit test full access to us
-
-protected:
- /** Constructor to be privately used by Importer */
- ComputeUVMappingProcess();
-
- /** Destructor, private as well */
- ~ComputeUVMappingProcess();
-
-public:
- // -------------------------------------------------------------------
- /** Returns whether the processing step is present in the given flag field.
- * @param pFlags The processing flags the importer was called with. A bitwise
- * combination of #aiPostProcessSteps.
- * @return true if the process is present in this flag fields, false if not.
- */
- bool IsActive( unsigned int pFlags) const;
-
- // -------------------------------------------------------------------
- /** Executes the post processing step on the given imported data.
- * At the moment a process is not supposed to fail.
- * @param pScene The imported data to work at.
- */
- void Execute( aiScene* pScene);
-
-protected:
-
- // -------------------------------------------------------------------
- /** Computes spherical UV coordinates for a mesh
- *
- * @param mesh Mesh to be processed
- * @param axis Main axis
- * @param out Receives output UV coordinates
- */
- void ComputeSphereMapping(aiMesh* mesh,const aiVector3D& axis,
- aiVector3D* out);
-
- // -------------------------------------------------------------------
- /** Computes cylindrical UV coordinates for a mesh
- *
- * @param mesh Mesh to be processed
- * @param axis Main axis
- * @param out Receives output UV coordinates
- */
- void ComputeCylinderMapping(aiMesh* mesh,const aiVector3D& axis,
- aiVector3D* out);
-
- // -------------------------------------------------------------------
- /** Computes planar UV coordinates for a mesh
- *
- * @param mesh Mesh to be processed
- * @param axis Main axis
- * @param out Receives output UV coordinates
- */
- void ComputePlaneMapping(aiMesh* mesh,const aiVector3D& axis,
- aiVector3D* out);
-
- // -------------------------------------------------------------------
- /** Computes cubic UV coordinates for a mesh
- *
- * @param mesh Mesh to be processed
- * @param out Receives output UV coordinates
- */
- void ComputeBoxMapping(aiMesh* mesh, aiVector3D* out);
-
-private:
-
- // temporary structure to describe a mapping
- struct MappingInfo
- {
- MappingInfo(aiTextureMapping _type)
- : type (_type)
- , axis (0.f,1.f,0.f)
- , uv (0u)
- {}
-
- aiTextureMapping type;
- aiVector3D axis;
- unsigned int uv;
-
- bool operator== (const MappingInfo& other)
- {
- return type == other.type && axis == other.axis;
- }
- };
-};
-
-} // end of namespace Assimp
-
-#endif // AI_COMPUTEUVMAPPING_H_INC
diff --git a/3rdparty/assimp/code/ConvertToLHProcess.cpp b/3rdparty/assimp/code/ConvertToLHProcess.cpp
deleted file mode 100644
index f4c72245..00000000
--- a/3rdparty/assimp/code/ConvertToLHProcess.cpp
+++ /dev/null
@@ -1,318 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file MakeLeftHandedProcess.cpp
- * @brief Implementation of the post processing step to convert all
- * imported data to a left-handed coordinate system.
- *
- * Face order & UV flip are also implemented here, for the sake of a
- * better location.
- */
-
-#include "AssimpPCH.h"
-#include "ConvertToLHProcess.h"
-
-using namespace Assimp;
-
-#ifndef ASSIMP_BUILD_NO_MAKELEFTHANDED_PROCESS
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-MakeLeftHandedProcess::MakeLeftHandedProcess()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-MakeLeftHandedProcess::~MakeLeftHandedProcess()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the processing step is present in the given flag field.
-bool MakeLeftHandedProcess::IsActive( unsigned int pFlags) const
-{
- return 0 != (pFlags & aiProcess_MakeLeftHanded);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Executes the post processing step on the given imported data.
-void MakeLeftHandedProcess::Execute( aiScene* pScene)
-{
- // Check for an existent root node to proceed
- ai_assert(pScene->mRootNode != NULL);
- DefaultLogger::get()->debug("MakeLeftHandedProcess begin");
-
- // recursively convert all the nodes
- ProcessNode( pScene->mRootNode, aiMatrix4x4());
-
- // process the meshes accordingly
- for ( unsigned int a = 0; a < pScene->mNumMeshes; ++a)
- ProcessMesh( pScene->mMeshes[a]);
-
- // process the materials accordingly
- for ( unsigned int a = 0; a < pScene->mNumMaterials; ++a)
- ProcessMaterial( pScene->mMaterials[a]);
-
- // transform all animation channels as well
- for ( unsigned int a = 0; a < pScene->mNumAnimations; a++)
- {
- aiAnimation* anim = pScene->mAnimations[a];
- for ( unsigned int b = 0; b < anim->mNumChannels; b++)
- {
- aiNodeAnim* nodeAnim = anim->mChannels[b];
- ProcessAnimation( nodeAnim);
- }
- }
- DefaultLogger::get()->debug("MakeLeftHandedProcess finished");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Recursively converts a node, all of its children and all of its meshes
-void MakeLeftHandedProcess::ProcessNode( aiNode* pNode, const aiMatrix4x4& pParentGlobalRotation)
-{
- // mirror all base vectors at the local Z axis
- pNode->mTransformation.c1 = -pNode->mTransformation.c1;
- pNode->mTransformation.c2 = -pNode->mTransformation.c2;
- pNode->mTransformation.c3 = -pNode->mTransformation.c3;
- pNode->mTransformation.c4 = -pNode->mTransformation.c4;
-
- // now invert the Z axis again to keep the matrix determinant positive.
- // The local meshes will be inverted accordingly so that the result should look just fine again.
- pNode->mTransformation.a3 = -pNode->mTransformation.a3;
- pNode->mTransformation.b3 = -pNode->mTransformation.b3;
- pNode->mTransformation.c3 = -pNode->mTransformation.c3;
- pNode->mTransformation.d3 = -pNode->mTransformation.d3; // useless, but anyways...
-
- // continue for all children
- for ( size_t a = 0; a < pNode->mNumChildren; ++a)
- ProcessNode( pNode->mChildren[a], pParentGlobalRotation * pNode->mTransformation);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Converts a single mesh to left handed coordinates.
-void MakeLeftHandedProcess::ProcessMesh( aiMesh* pMesh)
-{
- // mirror positions, normals and stuff along the Z axis
- for ( size_t a = 0; a < pMesh->mNumVertices; ++a)
- {
- pMesh->mVertices[a].z *= -1.0f;
- if ( pMesh->HasNormals())
- pMesh->mNormals[a].z *= -1.0f;
- if ( pMesh->HasTangentsAndBitangents())
- {
- pMesh->mTangents[a].z *= -1.0f;
- pMesh->mBitangents[a].z *= -1.0f;
- }
- }
-
- // mirror offset matrices of all bones
- for ( size_t a = 0; a < pMesh->mNumBones; ++a)
- {
- aiBone* bone = pMesh->mBones[a];
- bone->mOffsetMatrix.a3 = -bone->mOffsetMatrix.a3;
- bone->mOffsetMatrix.b3 = -bone->mOffsetMatrix.b3;
- bone->mOffsetMatrix.d3 = -bone->mOffsetMatrix.d3;
- bone->mOffsetMatrix.c1 = -bone->mOffsetMatrix.c1;
- bone->mOffsetMatrix.c2 = -bone->mOffsetMatrix.c2;
- bone->mOffsetMatrix.c4 = -bone->mOffsetMatrix.c4;
- }
-
- // mirror bitangents as well as they're derived from the texture coords
- if ( pMesh->HasTangentsAndBitangents())
- {
- for ( unsigned int a = 0; a < pMesh->mNumVertices; a++)
- pMesh->mBitangents[a] *= -1.0f;
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Converts a single material to left handed coordinates.
-void MakeLeftHandedProcess::ProcessMaterial( aiMaterial* _mat)
-{
- MaterialHelper* mat = (MaterialHelper*)_mat;
- for (unsigned int a = 0; a < mat->mNumProperties;++a) {
- aiMaterialProperty* prop = mat->mProperties[a];
-
- // Mapping axis for UV mappings?
- if (!::strcmp( prop->mKey.data, "$tex.mapaxis")) {
- ai_assert( prop->mDataLength >= sizeof(aiVector3D)); /* something is wrong with the validation if we end up here */
- aiVector3D* pff = (aiVector3D*)prop->mData;
-
- pff->z *= -1.f;
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Converts the given animation to LH coordinates.
-void MakeLeftHandedProcess::ProcessAnimation( aiNodeAnim* pAnim)
-{
- // position keys
- for ( unsigned int a = 0; a < pAnim->mNumPositionKeys; a++)
- pAnim->mPositionKeys[a].mValue.z *= -1.0f;
-
- // rotation keys
- for ( unsigned int a = 0; a < pAnim->mNumRotationKeys; a++)
- {
- /* That's the safe version, but the float errors add up. So we try the short version instead
- aiMatrix3x3 rotmat = pAnim->mRotationKeys[a].mValue.GetMatrix();
- rotmat.a3 = -rotmat.a3; rotmat.b3 = -rotmat.b3;
- rotmat.c1 = -rotmat.c1; rotmat.c2 = -rotmat.c2;
- aiQuaternion rotquat( rotmat);
- pAnim->mRotationKeys[a].mValue = rotquat;
- */
- pAnim->mRotationKeys[a].mValue.x *= -1.0f;
- pAnim->mRotationKeys[a].mValue.y *= -1.0f;
- }
-}
-
-#endif // !! ASSIMP_BUILD_NO_MAKELEFTHANDED_PROCESS
-#ifndef ASSIMP_BUILD_NO_FLIPUVS_PROCESS
-// # FlipUVsProcess
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-FlipUVsProcess::FlipUVsProcess()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-FlipUVsProcess::~FlipUVsProcess()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the processing step is present in the given flag field.
-bool FlipUVsProcess::IsActive( unsigned int pFlags) const
-{
- return 0 != (pFlags & aiProcess_FlipUVs);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Executes the post processing step on the given imported data.
-void FlipUVsProcess::Execute( aiScene* pScene)
-{
- DefaultLogger::get()->debug("FlipUVsProcess begin");
- for (unsigned int i = 0; i < pScene->mNumMeshes;++i)
- ProcessMesh(pScene->mMeshes[i]);
-
- for (unsigned int i = 0; i < pScene->mNumMaterials;++i)
- ProcessMaterial(pScene->mMaterials[i]);
- DefaultLogger::get()->debug("FlipUVsProcess finished");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Converts a single material
-void FlipUVsProcess::ProcessMaterial (aiMaterial* _mat)
-{
- MaterialHelper* mat = (MaterialHelper*)_mat;
- for (unsigned int a = 0; a < mat->mNumProperties;++a) {
- aiMaterialProperty* prop = mat->mProperties[a];
-
- // UV transformation key?
- if (!::strcmp( prop->mKey.data, "$tex.uvtrafo")) {
- ai_assert( prop->mDataLength >= sizeof(aiUVTransform)); /* something is wrong with the validation if we end up here */
- aiUVTransform* uv = (aiUVTransform*)prop->mData;
-
- // just flip it, that's everything
- uv->mTranslation.y *= -1.f;
- uv->mRotation *= -1.f;
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Converts a single mesh
-void FlipUVsProcess::ProcessMesh( aiMesh* pMesh)
-{
- // mirror texture y coordinate
- for ( unsigned int a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; a++) {
- if ( !pMesh->HasTextureCoords( a))
- break;
-
- for ( unsigned int b = 0; b < pMesh->mNumVertices; b++)
- pMesh->mTextureCoords[a][b].y = 1.0f - pMesh->mTextureCoords[a][b].y;
- }
-}
-
-#endif // !ASSIMP_BUILD_NO_FLIPUVS_PROCESS
-#ifndef ASSIMP_BUILD_NO_FLIPWINDING_PROCESS
-// # FlipWindingOrderProcess
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-FlipWindingOrderProcess::FlipWindingOrderProcess()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-FlipWindingOrderProcess::~FlipWindingOrderProcess()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the processing step is present in the given flag field.
-bool FlipWindingOrderProcess::IsActive( unsigned int pFlags) const
-{
- return 0 != (pFlags & aiProcess_FlipWindingOrder);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Executes the post processing step on the given imported data.
-void FlipWindingOrderProcess::Execute( aiScene* pScene)
-{
- DefaultLogger::get()->debug("FlipWindingOrderProcess begin");
- for (unsigned int i = 0; i < pScene->mNumMeshes;++i)
- ProcessMesh(pScene->mMeshes[i]);
- DefaultLogger::get()->debug("FlipWindingOrderProcess finished");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Converts a single mesh
-void FlipWindingOrderProcess::ProcessMesh( aiMesh* pMesh)
-{
- // invert the order of all faces in this mesh
- for ( unsigned int a = 0; a < pMesh->mNumFaces; a++)
- {
- aiFace& face = pMesh->mFaces[a];
- for ( unsigned int b = 0; b < face.mNumIndices / 2; b++)
- std::swap( face.mIndices[b], face.mIndices[ face.mNumIndices - 1 - b]);
- }
-}
-
-#endif // !! ASSIMP_BUILD_NO_FLIPWINDING_PROCESS
diff --git a/3rdparty/assimp/code/ConvertToLHProcess.h b/3rdparty/assimp/code/ConvertToLHProcess.h
deleted file mode 100644
index 25bf178b..00000000
--- a/3rdparty/assimp/code/ConvertToLHProcess.h
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file MakeLeftHandedProcess.h
- * @brief Defines a bunch of post-processing steps to handle
- * coordinate system conversions.
- *
- * - LH to RH
- * - UV origin upper-left to lower-left
- * - face order cw to ccw
- */
-#ifndef AI_CONVERTTOLHPROCESS_H_INC
-#define AI_CONVERTTOLHPROCESS_H_INC
-
-#include "../include/aiTypes.h"
-#include "BaseProcess.h"
-
-struct aiMesh;
-struct aiNodeAnim;
-
-namespace Assimp {
-
-// -----------------------------------------------------------------------------------
-/** @brief The MakeLeftHandedProcess converts all imported data to a left-handed
- * coordinate system.
- *
- * This implies a mirroring of the Z axis of the coordinate system. But to keep
- * transformation matrices free from reflections we shift the reflection to other
- * places. We mirror the meshes and adapt the rotations.
- *
- * @note RH-LH and LH-RH is the same, so this class can be used for both
- */
-class ASSIMP_API MakeLeftHandedProcess : public BaseProcess
-{
- friend class Importer;
-
-public:
- /** Constructor to be privately used by Importer */
- MakeLeftHandedProcess();
-
- /** Destructor, private as well */
- ~MakeLeftHandedProcess();
-
- // -------------------------------------------------------------------
- bool IsActive( unsigned int pFlags) const;
-
- // -------------------------------------------------------------------
- void Execute( aiScene* pScene);
-
-protected:
-
- // -------------------------------------------------------------------
- /** Recursively converts a node and all of its children
- */
- void ProcessNode( aiNode* pNode, const aiMatrix4x4& pParentGlobalRotation);
-
- // -------------------------------------------------------------------
- /** Converts a single mesh to left handed coordinates.
- * This means that positions, normals and tangents are mirrored at
- * the local Z axis and the order of all faces are inverted.
- * @param pMesh The mesh to convert.
- */
- void ProcessMesh( aiMesh* pMesh);
-
- // -------------------------------------------------------------------
- /** Converts a single material to left-handed coordinates
- * @param pMat Material to convert
- */
- void ProcessMaterial( aiMaterial* pMat);
-
- // -------------------------------------------------------------------
- /** Converts the given animation to LH coordinates.
- * The rotation and translation keys are transformed, the scale keys
- * work in local space and can therefore be left untouched.
- * @param pAnim The bone animation to transform
- */
- void ProcessAnimation( aiNodeAnim* pAnim);
-};
-
-
-// ---------------------------------------------------------------------------
-/** Postprocessing step to flip the face order of the imported data
- */
-class ASSIMP_API FlipWindingOrderProcess : public BaseProcess
-{
- friend class Importer;
-
-public:
- /** Constructor to be privately used by Importer */
- FlipWindingOrderProcess();
-
- /** Destructor, private as well */
- ~FlipWindingOrderProcess();
-
- // -------------------------------------------------------------------
- bool IsActive( unsigned int pFlags) const;
-
- // -------------------------------------------------------------------
- void Execute( aiScene* pScene);
-
-protected:
- void ProcessMesh( aiMesh* pMesh);
-};
-
-// ---------------------------------------------------------------------------
-/** Postprocessing step to flip the UV coordinate system of the import data
- */
-class ASSIMP_API FlipUVsProcess : public BaseProcess
-{
- friend class Importer;
-
-public:
- /** Constructor to be privately used by Importer */
- FlipUVsProcess();
-
- /** Destructor, private as well */
- ~FlipUVsProcess();
-
- // -------------------------------------------------------------------
- bool IsActive( unsigned int pFlags) const;
-
- // -------------------------------------------------------------------
- void Execute( aiScene* pScene);
-
-protected:
- void ProcessMesh( aiMesh* pMesh);
- void ProcessMaterial( aiMaterial* mat);
-};
-
-} // end of namespace Assimp
-
-#endif // AI_CONVERTTOLHPROCESS_H_INC
diff --git a/3rdparty/assimp/code/DXFLoader.cpp b/3rdparty/assimp/code/DXFLoader.cpp
deleted file mode 100644
index fc68ee88..00000000
--- a/3rdparty/assimp/code/DXFLoader.cpp
+++ /dev/null
@@ -1,609 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file DXFLoader.cpp
- * @brief Implementation of the DXF importer class
- */
-
-#include "AssimpPCH.h"
-#ifndef ASSIMP_BUILD_NO_DXF_IMPORTER
-
-#include "DXFLoader.h"
-#include "ParsingUtils.h"
-#include "ConvertToLHProcess.h"
-#include "fast_atof.h"
-
-using namespace Assimp;
-
-// AutoCAD Binary DXF<CR><LF><SUB><NULL>
-#define AI_DXF_BINARY_IDENT ("AutoCAD Binary DXF\r\n\x1a\0")
-#define AI_DXF_BINARY_IDENT_LEN (24)
-
-// color indices for DXF - 16 are supported
-static aiColor4D g_aclrDxfIndexColors[] =
-{
- aiColor4D (0.6f, 0.6f, 0.6f, 1.0f),
- aiColor4D (1.0f, 0.0f, 0.0f, 1.0f), // red
- aiColor4D (0.0f, 1.0f, 0.0f, 1.0f), // green
- aiColor4D (0.0f, 0.0f, 1.0f, 1.0f), // blue
- aiColor4D (0.3f, 1.0f, 0.3f, 1.0f), // light green
- aiColor4D (0.3f, 0.3f, 1.0f, 1.0f), // light blue
- aiColor4D (1.0f, 0.3f, 0.3f, 1.0f), // light red
- aiColor4D (1.0f, 0.0f, 1.0f, 1.0f), // pink
- aiColor4D (1.0f, 0.6f, 0.0f, 1.0f), // orange
- aiColor4D (0.6f, 0.3f, 0.0f, 1.0f), // dark orange
- aiColor4D (1.0f, 1.0f, 0.0f, 1.0f), // yellow
- aiColor4D (0.3f, 0.3f, 0.3f, 1.0f), // dark gray
- aiColor4D (0.8f, 0.8f, 0.8f, 1.0f), // light gray
- aiColor4D (0.0f, 00.f, 0.0f, 1.0f), // black
- aiColor4D (1.0f, 1.0f, 1.0f, 1.0f), // white
- aiColor4D (0.6f, 0.0f, 1.0f, 1.0f) // violet
-};
-#define AI_DXF_NUM_INDEX_COLORS (sizeof(g_aclrDxfIndexColors)/sizeof(g_aclrDxfIndexColors[0]))
-
-// invalid/unassigned color value
-aiColor4D g_clrInvalid = aiColor4D(get_qnan(),0.f,0.f,1.f);
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-DXFImporter::DXFImporter()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-DXFImporter::~DXFImporter()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the class can handle the format of the given file.
-bool DXFImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const
-{
- return SimpleExtensionCheck(pFile,"dxf");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Get a list of all supported file extensions
-void DXFImporter::GetExtensionList(std::set<std::string>& extensions)
-{
- extensions.insert("dxf");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Get a copy of the next data line, skip strange data
-bool DXFImporter::GetNextLine()
-{
- if (!SkipLine(&buffer))
- return false;
- if (!SkipSpaces(&buffer))
- return GetNextLine();
- else if (*buffer == '{') {
- // some strange meta data ...
- while (true)
- {
- if (!SkipLine(&buffer))
- return false;
-
- if (SkipSpaces(&buffer) && *buffer == '}')
- break;
- }
- return GetNextLine();
- }
- return true;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Get the next token in the file
-bool DXFImporter::GetNextToken()
-{
- if (bRepeat) {
- bRepeat = false;
- return true;
- }
-
- SkipSpaces(&buffer);
- groupCode = strtol10s(buffer,&buffer);
- if (!GetNextLine())
- return false;
-
- // copy the data line to a separate buffer
- char* m = cursor, *end = &cursor[4096];
- while (!IsSpaceOrNewLine( *buffer ) && m < end)
- *m++ = *buffer++;
-
- *m = '\0';
- GetNextLine();
- return true;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Imports the given file into the given scene structure.
-void DXFImporter::InternReadFile( const std::string& pFile,
- aiScene* pScene, IOSystem* pIOHandler)
-{
- boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile));
-
- // Check whether we can read from the file
- if ( file.get() == NULL) {
- throw DeadlyImportError( "Failed to open DXF file " + pFile + "");
- }
-
- // read the contents of the file in a buffer
- std::vector<char> buffer2;
- TextFileToBuffer(file.get(),buffer2);
- buffer = &buffer2[0];
-
- bRepeat = false;
- mDefaultLayer = NULL;
-
- // check whether this is a binaray DXF file - we can't read binary DXF files :-(
- if (!strncmp(AI_DXF_BINARY_IDENT,buffer,AI_DXF_BINARY_IDENT_LEN))
- throw DeadlyImportError("DXF: Binary files are not supported at the moment");
-
- // now get all lines of the file
- while (GetNextToken()) {
-
- if (2 == groupCode) {
-
- // ENTITIES and BLOCKS sections - skip the whole rest, no need to waste our time with them
- if (!::strcmp(cursor,"ENTITIES") || !::strcmp(cursor,"BLOCKS")) {
- if (!ParseEntities())
- break;
- else bRepeat = true;
- }
-
- // other sections - skip them to make sure there will be no name conflicts
- else {
- while ( GetNextToken()) {
- if (!::strcmp(cursor,"ENDSEC"))
- break;
- }
- }
- }
- // print comment strings
- else if (999 == groupCode) {
- DefaultLogger::get()->info(std::string( cursor ));
- }
- else if (!groupCode && !::strcmp(cursor,"EOF"))
- break;
- }
-
- // find out how many valud layers we have
- for (std::vector<LayerInfo>::const_iterator it = mLayers.begin(),end = mLayers.end(); it != end;++it) {
- if (!(*it).vPositions.empty())
- ++pScene->mNumMeshes;
- }
-
- if (!pScene->mNumMeshes)
- throw DeadlyImportError("DXF: this file contains no 3d data");
-
- pScene->mMeshes = new aiMesh*[ pScene->mNumMeshes ];
- unsigned int m = 0;
- for (std::vector<LayerInfo>::const_iterator it = mLayers.begin(),end = mLayers.end();it != end;++it) {
- if ((*it).vPositions.empty()) {
- continue;
- }
- // generate the output mesh
- aiMesh* pMesh = pScene->mMeshes[m++] = new aiMesh();
- const std::vector<aiVector3D>& vPositions = (*it).vPositions;
- const std::vector<aiColor4D>& vColors = (*it).vColors;
-
- // check whether we need vertex colors here
- aiColor4D* clrOut = NULL;
- const aiColor4D* clr = NULL;
- for (std::vector<aiColor4D>::const_iterator it2 = (*it).vColors.begin(), end2 = (*it).vColors.end();it2 != end2; ++it2) {
-
- if ((*it2).r == (*it2).r) /* qnan? */ {
- clrOut = pMesh->mColors[0] = new aiColor4D[vPositions.size()];
- for (unsigned int i = 0; i < vPositions.size();++i)
- clrOut[i] = aiColor4D(0.6f,0.6f,0.6f,1.0f);
-
- clr = &vColors[0];
- break;
- }
- }
-
- pMesh->mNumFaces = (unsigned int)vPositions.size() / 4u;
- pMesh->mFaces = new aiFace[pMesh->mNumFaces];
-
- aiVector3D* vpOut = pMesh->mVertices = new aiVector3D[vPositions.size()];
- const aiVector3D* vp = &vPositions[0];
-
- for (unsigned int i = 0; i < pMesh->mNumFaces;++i) {
- aiFace& face = pMesh->mFaces[i];
-
- // check whether we need four, three or two indices here
- if (vp[1] == vp[2]) {
- face.mNumIndices = 2;
- }
- else if (vp[3] == vp[2]) {
- face.mNumIndices = 3;
- }
- else face.mNumIndices = 4;
- face.mIndices = new unsigned int[face.mNumIndices];
-
- for (unsigned int a = 0; a < face.mNumIndices;++a) {
- *vpOut++ = vp[a];
- if (clr) {
- if (is_not_qnan( clr[a].r )) {
- *clrOut = clr[a];
- }
- ++clrOut;
- }
- face.mIndices[a] = pMesh->mNumVertices++;
- }
- vp += 4;
- }
- }
-
- // generate the output scene graph
- pScene->mRootNode = new aiNode();
- pScene->mRootNode->mName.Set("<DXF_ROOT>");
-
- if (1 == pScene->mNumMeshes) {
- pScene->mRootNode->mMeshes = new unsigned int[ pScene->mRootNode->mNumMeshes = 1 ];
- pScene->mRootNode->mMeshes[0] = 0;
- }
- else
- {
- pScene->mRootNode->mChildren = new aiNode*[ pScene->mRootNode->mNumChildren = pScene->mNumMeshes ];
- for (m = 0; m < pScene->mRootNode->mNumChildren;++m) {
- aiNode* p = pScene->mRootNode->mChildren[m] = new aiNode();
- p->mName.length = ::strlen( mLayers[m].name );
- strcpy(p->mName.data, mLayers[m].name);
-
- p->mMeshes = new unsigned int[p->mNumMeshes = 1];
- p->mMeshes[0] = m;
- p->mParent = pScene->mRootNode;
- }
- }
-
- // generate a default material
- MaterialHelper* pcMat = new MaterialHelper();
- aiString s;
- s.Set(AI_DEFAULT_MATERIAL_NAME);
- pcMat->AddProperty(&s, AI_MATKEY_NAME);
-
- aiColor4D clrDiffuse(0.6f,0.6f,0.6f,1.0f);
- pcMat->AddProperty(&clrDiffuse,1,AI_MATKEY_COLOR_DIFFUSE);
-
- clrDiffuse = aiColor4D(1.0f,1.0f,1.0f,1.0f);
- pcMat->AddProperty(&clrDiffuse,1,AI_MATKEY_COLOR_SPECULAR);
-
- clrDiffuse = aiColor4D(0.05f,0.05f,0.05f,1.0f);
- pcMat->AddProperty(&clrDiffuse,1,AI_MATKEY_COLOR_AMBIENT);
-
- pScene->mNumMaterials = 1;
- pScene->mMaterials = new aiMaterial*[1];
- pScene->mMaterials[0] = pcMat;
-
- // flip winding order to be ccw
- FlipWindingOrderProcess flipper;
- flipper.Execute(pScene);
-
- // --- everything destructs automatically ---
-}
-
-// ------------------------------------------------------------------------------------------------
-bool DXFImporter::ParseEntities()
-{
- while (GetNextToken()) {
- if (!groupCode) {
- if (!::strcmp(cursor,"3DFACE") || !::strcmp(cursor,"LINE") || !::strcmp(cursor,"3DLINE")){
- //http://sourceforge.net/tracker/index.php?func=detail&aid=2970566&group_id=226462&atid=1067632
- Parse3DFace();
- bRepeat = true;
- }
- if (!::strcmp(cursor,"POLYLINE") || !::strcmp(cursor,"LWPOLYLINE")){
- ParsePolyLine();
- bRepeat = true;
- }
- if (!::strcmp(cursor,"ENDSEC")) {
- return true;
- }
- }
- }
- return false;
-}
-
-// ------------------------------------------------------------------------------------------------
-void DXFImporter::SetLayer(LayerInfo*& out)
-{
- for (std::vector<LayerInfo>::iterator it = mLayers.begin(),end = mLayers.end();it != end;++it) {
- if (!::strcmp( (*it).name, cursor )) {
- out = &(*it);
- break;
- }
- }
- if (!out) {
- // we don't have this layer yet
- mLayers.push_back(LayerInfo());
- out = &mLayers.back();
- ::strcpy(out->name,cursor);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void DXFImporter::SetDefaultLayer(LayerInfo*& out)
-{
- if (!mDefaultLayer) {
- mLayers.push_back(LayerInfo());
- mDefaultLayer = &mLayers.back();
- }
- out = mDefaultLayer;
-}
-
-// ------------------------------------------------------------------------------------------------
-bool DXFImporter::ParsePolyLine()
-{
- bool ret = false;
- LayerInfo* out = NULL;
-
- std::vector<aiVector3D> positions;
- std::vector<aiColor4D> colors;
- std::vector<unsigned int> indices;
- unsigned int flags = 0;
-
- while (GetNextToken()) {
- switch (groupCode)
- {
- case 0:
- {
- if (!::strcmp(cursor,"VERTEX")) {
- aiVector3D v;aiColor4D clr(g_clrInvalid);
- unsigned int idx[4] = {0xffffffff,0xffffffff,0xffffffff,0xffffffff};
- ParsePolyLineVertex(v, clr, idx);
- if (0xffffffff == idx[0]) {
- positions.push_back(v);
- colors.push_back(clr);
- }
- else {
- // check whether we have a fourth coordinate
- if (0xffffffff == idx[3]) {
- idx[3] = idx[2];
- }
-
- indices.reserve(indices.size()+4);
- for (unsigned int m = 0; m < 4;++m)
- indices.push_back(idx[m]);
- }
- bRepeat = true;
- }
- else if (!::strcmp(cursor,"ENDSEQ")) {
- ret = true;
- }
- break;
- }
-
- // flags --- important that we know whether it is a polyface mesh
- case 70:
- {
- if (!flags) {
- flags = strtol10(cursor);
- }
- break;
- };
-
- // optional number of vertices
- case 71:
- {
- positions.reserve(strtol10(cursor));
- break;
- }
-
- // optional number of faces
- case 72:
- {
- indices.reserve(strtol10(cursor));
- break;
- }
-
- // 8 specifies the layer
- case 8:
- {
- SetLayer(out);
- break;
- }
- }
- }
- if (!(flags & 64)) {
- DefaultLogger::get()->warn("DXF: Only polyface meshes are currently supported");
- return ret;
- }
-
- if (positions.size() < 3 || indices.size() < 3) {
- DefaultLogger::get()->warn("DXF: Unable to parse POLYLINE element - not enough vertices");
- return ret;
- }
-
- // use a default layer if necessary
- if (!out) {
- SetDefaultLayer(out);
- }
-
- flags = (unsigned int)(out->vPositions.size()+indices.size());
- out->vPositions.reserve(flags);
- out->vColors.reserve(flags);
-
- // generate unique vertices
- for (std::vector<unsigned int>::const_iterator it = indices.begin(), end = indices.end();it != end; ++it) {
- unsigned int idx = *it;
- if (idx > positions.size() || !idx) {
- DefaultLogger::get()->error("DXF: Polyface mesh index os out of range");
- idx = (unsigned int) positions.size();
- }
- out->vPositions.push_back(positions[idx-1]); // indices are one-based.
- out->vColors.push_back(colors[idx-1]); // indices are one-based.
- }
-
- return ret;
-}
-
-// ------------------------------------------------------------------------------------------------
-bool DXFImporter::ParsePolyLineVertex(aiVector3D& out,aiColor4D& clr, unsigned int* outIdx)
-{
- bool ret = false;
- while (GetNextToken()) {
- switch (groupCode)
- {
- case 0: ret = true;
- break;
-
- // todo - handle the correct layer for the vertex. At the moment it is assumed that all vertices of
- // a polyline are placed on the same global layer.
-
- // x position of the first corner
- case 10: out.x = fast_atof(cursor);break;
-
- // y position of the first corner
- case 20: out.y = -fast_atof(cursor);break;
-
- // z position of the first corner
- case 30: out.z = fast_atof(cursor);break;
-
- // POLYFACE vertex indices
- case 71: outIdx[0] = strtol10(cursor);break;
- case 72: outIdx[1] = strtol10(cursor);break;
- case 73: outIdx[2] = strtol10(cursor);break;
- // case 74: outIdx[3] = strtol10(cursor);break;
-
- // color
- case 62: clr = g_aclrDxfIndexColors[strtol10(cursor) % AI_DXF_NUM_INDEX_COLORS]; break;
- };
- if (ret) {
- break;
- }
- }
- return ret;
-}
-
-// ------------------------------------------------------------------------------------------------
-bool DXFImporter::Parse3DFace()
-{
- bool ret = false;
- LayerInfo* out = NULL;
-
- aiVector3D vip[4]; // -- vectors are initialized to zero
- aiColor4D clr(g_clrInvalid);
-
- // this is also used for for parsing line entities
- bool bThird = false;
-
- while (GetNextToken()) {
- switch (groupCode) {
- case 0:
- ret = true;
- break;
-
- // 8 specifies the layer
- case 8: {
- SetLayer(out);
- break;
- }
-
- // x position of the first corner
- case 10: vip[0].x = fast_atof(cursor);break;
-
- // y position of the first corner
- case 20: vip[0].y = -fast_atof(cursor);break;
-
- // z position of the first corner
- case 30: vip[0].z = fast_atof(cursor);break;
-
- // x position of the second corner
- case 11: vip[1].x = fast_atof(cursor);break;
-
- // y position of the second corner
- case 21: vip[1].y = -fast_atof(cursor);break;
-
- // z position of the second corner
- case 31: vip[1].z = fast_atof(cursor);break;
-
- // x position of the third corner
- case 12: vip[2].x = fast_atof(cursor);
- bThird = true;break;
-
- // y position of the third corner
- case 22: vip[2].y = -fast_atof(cursor);
- bThird = true;break;
-
- // z position of the third corner
- case 32: vip[2].z = fast_atof(cursor);
- bThird = true;break;
-
- // x position of the fourth corner
- case 13: vip[3].x = fast_atof(cursor);
- bThird = true;break;
-
- // y position of the fourth corner
- case 23: vip[3].y = -fast_atof(cursor);
- bThird = true;break;
-
- // z position of the fourth corner
- case 33: vip[3].z = fast_atof(cursor);
- bThird = true;break;
-
- // color
- case 62: clr = g_aclrDxfIndexColors[strtol10(cursor) % AI_DXF_NUM_INDEX_COLORS]; break;
- };
- if (ret)
- break;
- }
-
- if (!bThird)
- vip[2] = vip[1];
-
- // use a default layer if necessary
- if (!out) {
- SetDefaultLayer(out);
- }
- // add the faces to the face list for this layer
- out->vPositions.push_back(vip[0]);
- out->vPositions.push_back(vip[1]);
- out->vPositions.push_back(vip[2]);
- out->vPositions.push_back(vip[3]); // might be equal to the third
-
- for (unsigned int i = 0; i < 4;++i)
- out->vColors.push_back(clr);
- return ret;
-}
-
-#endif // !! ASSIMP_BUILD_NO_DXF_IMPORTER
-
diff --git a/3rdparty/assimp/code/DXFLoader.h b/3rdparty/assimp/code/DXFLoader.h
deleted file mode 100644
index 9ae16ed5..00000000
--- a/3rdparty/assimp/code/DXFLoader.h
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file DXFLoader.h
- * @brief Declaration of the .dxf importer class.
- */
-#ifndef AI_DXFLOADER_H_INCLUDED
-#define AI_DXFLOADER_H_INCLUDED
-
-#include "BaseImporter.h"
-
-namespace Assimp {
-
-// ---------------------------------------------------------------------------
-/** DXF importer class
-*/
-class DXFImporter : public BaseImporter
-{
- friend class Importer;
-
-protected:
- /** Constructor to be privately used by Importer */
- DXFImporter();
-
- /** Destructor, private as well */
- ~DXFImporter();
-
-
- // describes a single layer in the DXF file
- struct LayerInfo
- {
- LayerInfo()
- {
- name[0] = '\0';
- }
-
- char name[4096];
-
- // face buffer - order is x,y,z v1,v2,v3,v4
- // if v2 = v3: line
- // elsif v3 = v2: triangle
- // else: polygon
- std::vector<aiVector3D> vPositions;
- std::vector<aiColor4D> vColors;
- };
-
-
-public:
-
- // -------------------------------------------------------------------
- /** Returns whether the class can handle the format of the given file.
- * See BaseImporter::CanRead() for details. */
- bool CanRead( const std::string& pFile, IOSystem* pIOHandler,
- bool checkSig) const;
-
-protected:
-
- // -------------------------------------------------------------------
- /** Called by Importer::GetExtensionList() for each loaded importer.
- * See BaseImporter::GetExtensionList() for details
- */
- void GetExtensionList(std::set<std::string>& extensions);
-
- // -------------------------------------------------------------------
- /** Imports the given file into the given scene structure.
- * See BaseImporter::InternReadFile() for details
- */
- void InternReadFile( const std::string& pFile, aiScene* pScene,
- IOSystem* pIOHandler);
-
- // -------------------------------------------------------------------
- /** Get the next line from the file.
- * @return false if the end of the file was reached
- */
- bool GetNextLine();
-
- // -------------------------------------------------------------------
- /** Get the next token (group code + data line) from the file.
- * @return false if the end of the file was reached
- */
- bool GetNextToken();
-
- // -------------------------------------------------------------------
- /** Parses the ENTITIES section in the file
- * @return false if the end of the file was reached
- */
- bool ParseEntities();
-
- // -------------------------------------------------------------------
- /** Parses a 3DFACE section in the file
- * @return false if the end of the file was reached
- */
- bool Parse3DFace();
-
- // -------------------------------------------------------------------
- /** Parses a POLYLINE section in the file
- * @return false if the end of the file was reached
- */
- bool ParsePolyLine();
-
- // -------------------------------------------------------------------
- /** Sets the current layer - cursor must point to the name of it.
- * @param out Receives a handle to the layer
- */
- void SetLayer(LayerInfo*& out);
-
- // -------------------------------------------------------------------
- /** Creates a default layer.
- * @param out Receives a handle to the default layer
- */
- void SetDefaultLayer(LayerInfo*& out);
-
- // -------------------------------------------------------------------
- /** Parses a VERTEX element in a POLYLINE/POLYFACE
- * @param out Receives the output vertex.
- * @param clr Receives the output vertex color - won't be modified
- * if it is not existing.
- * @param outIdx Receives the output vertex indices, if present.
- * Wont't be modified otherwise. Size must be at least 4.
- * @return false if the end of the file was reached
- */
- bool ParsePolyLineVertex(aiVector3D& out, aiColor4D& clr,
- unsigned int* outIdx);
-
-private:
-
- // points to the next section
- const char* buffer;
-
- // specifies the current group code
- int groupCode;
-
- // contains the current data line
- char cursor[4096];
-
- // specifies whether the next call to GetNextToken()
- // should return the current token a second time
- bool bRepeat;
-
- // list of all loaded layers
- std::vector<LayerInfo> mLayers;
- LayerInfo* mDefaultLayer;
-};
-
-} // end of namespace Assimp
-
-#endif // AI_3DSIMPORTER_H_INC
diff --git a/3rdparty/assimp/code/DefaultIOStream.cpp b/3rdparty/assimp/code/DefaultIOStream.cpp
deleted file mode 100644
index f68ad384..00000000
--- a/3rdparty/assimp/code/DefaultIOStream.cpp
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-/** @file DefaultIOStream.cpp
- * @brief Default File I/O implementation for #Importer
- */
-
-#include "AssimpPCH.h"
-
-#include "DefaultIOStream.h"
-#include <sys/types.h>
-#include <sys/stat.h>
-
-using namespace Assimp;
-
-// ----------------------------------------------------------------------------------
-DefaultIOStream::~DefaultIOStream()
-{
- if (mFile) {
- ::fclose(mFile);
- }
-}
-
-// ----------------------------------------------------------------------------------
-size_t DefaultIOStream::Read(void* pvBuffer,
- size_t pSize,
- size_t pCount)
-{
- ai_assert(NULL != pvBuffer && 0 != pSize && 0 != pCount);
- return (mFile ? ::fread(pvBuffer, pSize, pCount, mFile) : 0);
-}
-
-// ----------------------------------------------------------------------------------
-size_t DefaultIOStream::Write(const void* pvBuffer,
- size_t pSize,
- size_t pCount)
-{
- ai_assert(NULL != pvBuffer && 0 != pSize && 0 != pCount);
- return (mFile ? ::fwrite(pvBuffer, pSize, pCount, mFile) : 0);
-}
-
-// ----------------------------------------------------------------------------------
-aiReturn DefaultIOStream::Seek(size_t pOffset,
- aiOrigin pOrigin)
-{
- if (!mFile) {
- return AI_FAILURE;
- }
-
- // Just to check whether our enum maps one to one with the CRT constants
- BOOST_STATIC_ASSERT(aiOrigin_CUR == SEEK_CUR &&
- aiOrigin_END == SEEK_END && aiOrigin_SET == SEEK_SET);
-
- // do the seek
- return (0 == ::fseek(mFile, (long)pOffset,(int)pOrigin) ? AI_SUCCESS : AI_FAILURE);
-}
-
-// ----------------------------------------------------------------------------------
-size_t DefaultIOStream::Tell() const
-{
- if (!mFile) {
- return 0;
- }
- return ::ftell(mFile);
-}
-
-// ----------------------------------------------------------------------------------
-size_t DefaultIOStream::FileSize() const
-{
- if (! mFile || mFilename.empty()) {
- return 0;
- }
-
- if (0xffffffff == cachedSize) {
-
- // TODO: Is that really faster if we're already owning a handle to the file?
-#if defined _WIN32 && !defined __GNUC__
- struct __stat64 fileStat;
- int err = _stat64( mFilename.c_str(), &fileStat );
- if (0 != err)
- return 0;
- cachedSize = (size_t) (fileStat.st_size);
-#else
- struct stat fileStat;
- int err = stat(mFilename.c_str(), &fileStat );
- if (0 != err)
- return 0;
- cachedSize = (size_t) (fileStat.st_size);
-#endif
- }
- return cachedSize;
-}
-
-// ----------------------------------------------------------------------------------
-void DefaultIOStream::Flush()
-{
- if (mFile) {
- ::fflush(mFile);
- }
-}
-
-// ----------------------------------------------------------------------------------
diff --git a/3rdparty/assimp/code/DefaultIOStream.h b/3rdparty/assimp/code/DefaultIOStream.h
deleted file mode 100644
index 1fdaa33b..00000000
--- a/3rdparty/assimp/code/DefaultIOStream.h
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file Default file I/O using fXXX()-family of functions */
-#ifndef AI_DEFAULTIOSTREAM_H_INC
-#define AI_DEFAULTIOSTREAM_H_INC
-
-#include <stdio.h>
-#include "../include/IOStream.h"
-
-namespace Assimp {
-
-// ----------------------------------------------------------------------------------
-//! @class DefaultIOStream
-//! @brief Default IO implementation, use standard IO operations
-//! @note An instance of this class can exist without a valid file handle
-//! attached to it. All calls fail, but the instance can nevertheless be
-//! used with no restrictions.
-class DefaultIOStream : public IOStream
-{
- friend class DefaultIOSystem;
-
-protected:
- DefaultIOStream ();
- DefaultIOStream (FILE* pFile, const std::string &strFilename);
-
-public:
- /** Destructor public to allow simple deletion to close the file. */
- ~DefaultIOStream ();
-
- // -------------------------------------------------------------------
- // Read from stream
- size_t Read(void* pvBuffer,
- size_t pSize,
- size_t pCount);
-
-
- // -------------------------------------------------------------------
- // Write to stream
- size_t Write(const void* pvBuffer,
- size_t pSize,
- size_t pCount);
-
- // -------------------------------------------------------------------
- // Seek specific position
- aiReturn Seek(size_t pOffset,
- aiOrigin pOrigin);
-
- // -------------------------------------------------------------------
- // Get current seek position
- size_t Tell() const;
-
- // -------------------------------------------------------------------
- // Get size of file
- size_t FileSize() const;
-
- // -------------------------------------------------------------------
- // Flush file contents
- void Flush();
-
-private:
- //! File datastructure, using clib
- FILE* mFile;
- //! Filename
- std::string mFilename;
-
- //! Cached file size
- mutable size_t cachedSize;
-};
-
-
-// ----------------------------------------------------------------------------------
-inline DefaultIOStream::DefaultIOStream () :
- mFile (NULL),
- mFilename (""),
- cachedSize (0xffffffff)
-{
- // empty
-}
-
-
-// ----------------------------------------------------------------------------------
-inline DefaultIOStream::DefaultIOStream (FILE* pFile,
- const std::string &strFilename) :
- mFile(pFile),
- mFilename(strFilename),
- cachedSize (0xffffffff)
-{
- // empty
-}
-// ----------------------------------------------------------------------------------
-
-} // ns assimp
-
-#endif //!!AI_DEFAULTIOSTREAM_H_INC
-
diff --git a/3rdparty/assimp/code/DefaultIOSystem.cpp b/3rdparty/assimp/code/DefaultIOSystem.cpp
deleted file mode 100644
index f09f710b..00000000
--- a/3rdparty/assimp/code/DefaultIOSystem.cpp
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-/** @file Default implementation of IOSystem using the standard C file functions */
-
-#include "AssimpPCH.h"
-
-#include <stdlib.h>
-#include "DefaultIOSystem.h"
-#include "DefaultIOStream.h"
-
-#ifdef __unix__
-#include <sys/param.h>
-#include <stdlib.h>
-#endif
-
-using namespace Assimp;
-
-// ------------------------------------------------------------------------------------------------
-// Constructor.
-DefaultIOSystem::DefaultIOSystem()
-{
- // nothing to do here
-}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor.
-DefaultIOSystem::~DefaultIOSystem()
-{
- // nothing to do here
-}
-
-// ------------------------------------------------------------------------------------------------
-// Tests for the existence of a file at the given path.
-bool DefaultIOSystem::Exists( const char* pFile) const
-{
- FILE* file = ::fopen( pFile, "rb");
- if ( !file)
- return false;
-
- ::fclose( file);
- return true;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Open a new file with a given path.
-IOStream* DefaultIOSystem::Open( const char* strFile, const char* strMode)
-{
- ai_assert(NULL != strFile);
- ai_assert(NULL != strMode);
-
- FILE* file = ::fopen( strFile, strMode);
- if ( NULL == file)
- return NULL;
-
- return new DefaultIOStream(file, (std::string) strFile);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Closes the given file and releases all resources associated with it.
-void DefaultIOSystem::Close( IOStream* pFile)
-{
- delete pFile;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Returns the operation specific directory separator
-char DefaultIOSystem::getOsSeparator() const
-{
-#ifndef _WIN32
- return '/';
-#else
- return '\\';
-#endif
-}
-
-// ------------------------------------------------------------------------------------------------
-// IOSystem default implementation (ComparePaths isn't a pure virtual function)
-bool IOSystem::ComparePaths (const char* one, const char* second) const
-{
- return !ASSIMP_stricmp(one,second);
-}
-
-// maximum path length
-// XXX http://insanecoding.blogspot.com/2007/11/pathmax-simply-isnt.html
-#ifdef PATH_MAX
-# define PATHLIMIT PATH_MAX
-#else
-# define PATHLIMIT 4096
-#endif
-
-// ------------------------------------------------------------------------------------------------
-// Convert a relative path into an absolute path
-inline void MakeAbsolutePath (const char* in, char* _out)
-{
- ai_assert(in && _out);
- char* ret;
-#ifdef _WIN32
- ret = ::_fullpath(_out, in,PATHLIMIT);
-#else
- // use realpath
- ret = realpath(in, _out);
-#endif
- if (!ret) {
- // preserve the input path, maybe someone else is able to fix
- // the path before it is accessed (e.g. our file system filter)
- DefaultLogger::get()->warn("Invalid path: "+std::string(in));
- strcpy(_out,in);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// DefaultIOSystem's more specialized implementation
-bool DefaultIOSystem::ComparePaths (const char* one, const char* second) const
-{
- // chances are quite good both paths are formatted identically,
- // so we can hopefully return here already
- if ( !ASSIMP_stricmp(one,second) )
- return true;
-
- char temp1[PATHLIMIT];
- char temp2[PATHLIMIT];
-
- MakeAbsolutePath (one, temp1);
- MakeAbsolutePath (second, temp2);
-
- return !ASSIMP_stricmp(temp1,temp2);
-}
-
-#undef PATHLIMIT
diff --git a/3rdparty/assimp/code/DefaultIOSystem.h b/3rdparty/assimp/code/DefaultIOSystem.h
deleted file mode 100644
index 3c360175..00000000
--- a/3rdparty/assimp/code/DefaultIOSystem.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file Default implementation of IOSystem using the standard C file functions */
-#ifndef AI_DEFAULTIOSYSTEM_H_INC
-#define AI_DEFAULTIOSYSTEM_H_INC
-
-#include "../include/IOSystem.h"
-
-namespace Assimp {
-
-// ---------------------------------------------------------------------------
-/** Default implementation of IOSystem using the standard C file functions */
-class DefaultIOSystem : public IOSystem
-{
-public:
- /** Constructor. */
- DefaultIOSystem();
-
- /** Destructor. */
- ~DefaultIOSystem();
-
- // -------------------------------------------------------------------
- /** Tests for the existence of a file at the given path. */
- bool Exists( const char* pFile) const;
-
- // -------------------------------------------------------------------
- /** Returns the directory separator. */
- char getOsSeparator() const;
-
- // -------------------------------------------------------------------
- /** Open a new file with a given path. */
- IOStream* Open( const char* pFile, const char* pMode = "rb");
-
- // -------------------------------------------------------------------
- /** Closes the given file and releases all resources associated with it. */
- void Close( IOStream* pFile);
-
- // -------------------------------------------------------------------
- /** Compare two paths */
- bool ComparePaths (const char* one, const char* second) const;
-};
-
-} //!ns Assimp
-
-#endif //AI_DEFAULTIOSYSTEM_H_INC
diff --git a/3rdparty/assimp/code/DefaultLogger.cpp b/3rdparty/assimp/code/DefaultLogger.cpp
deleted file mode 100644
index 7951468e..00000000
--- a/3rdparty/assimp/code/DefaultLogger.cpp
+++ /dev/null
@@ -1,419 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file DefaultLogger.cpp
- * @brief Implementation of DefaultLogger (and Logger)
- */
-
-#include "AssimpPCH.h"
-#include "DefaultIOSystem.h"
-
-// Default log streams
-#include "Win32DebugLogStream.h"
-#include "StdOStreamLogStream.h"
-#include "FileLogStream.h"
-
-#ifndef ASSIMP_BUILD_SINGLETHREADED
-# include <boost/thread/thread.hpp>
-# include <boost/thread/mutex.hpp>
-
-boost::mutex loggerMutex;
-#endif
-
-namespace Assimp {
-
-// ----------------------------------------------------------------------------------
-NullLogger DefaultLogger::s_pNullLogger;
-Logger *DefaultLogger::m_pLogger = &DefaultLogger::s_pNullLogger;
-
-// ----------------------------------------------------------------------------------
-// Represents a logstream + its error severity
-struct LogStreamInfo
-{
- unsigned int m_uiErrorSeverity;
- LogStream *m_pStream;
-
- // Constructor
- LogStreamInfo( unsigned int uiErrorSev, LogStream *pStream ) :
- m_uiErrorSeverity( uiErrorSev ),
- m_pStream( pStream )
- {
- // empty
- }
-
- // Destructor
- ~LogStreamInfo()
- {
- delete m_pStream;
- }
-};
-
-// ----------------------------------------------------------------------------------
-// Construct a default log stream
-LogStream* LogStream::createDefaultStream(aiDefaultLogStream streams,
- const char* name /*= "AssimpLog.txt"*/,
- IOSystem* io /*= NULL*/)
-{
- switch (streams)
- {
- // This is a platform-specific feature
- case aiDefaultLogStream_DEBUGGER:
-#ifdef WIN32
- return new Win32DebugLogStream();
-#else
- return NULL;
-#endif
-
- // Platform-independent default streams
- case aiDefaultLogStream_STDERR:
- return new StdOStreamLogStream(std::cerr);
- case aiDefaultLogStream_STDOUT:
- return new StdOStreamLogStream(std::cout);
- case aiDefaultLogStream_FILE:
- return (name && *name ? new FileLogStream(name,io) : NULL);
- default:
- // We don't know this default log stream, so raise an assertion
- ai_assert(false);
-
- };
-
- // For compilers without dead code path detection
- return NULL;
-}
-
-// ----------------------------------------------------------------------------------
-// Creates the only singleton instance
-Logger *DefaultLogger::create(const char* name /*= "AssimpLog.txt"*/,
- LogSeverity severity /*= NORMAL*/,
- unsigned int defStreams /*= aiDefaultLogStream_DEBUGGER | aiDefaultLogStream_FILE*/,
- IOSystem* io /*= NULL*/)
-{
- // enter the mutex here to avoid concurrency problems
-#ifndef ASSIMP_BUILD_SINGLETHREADED
- boost::mutex::scoped_lock lock(loggerMutex);
-#endif
-
- if (m_pLogger && !isNullLogger() )
- delete m_pLogger;
-
- m_pLogger = new DefaultLogger( severity );
-
- // Attach default log streams
- // Stream the log to the MSVC debugger?
- if (defStreams & aiDefaultLogStream_DEBUGGER)
- m_pLogger->attachStream( LogStream::createDefaultStream(aiDefaultLogStream_DEBUGGER));
-
- // Stream the log to COUT?
- if (defStreams & aiDefaultLogStream_STDOUT)
- m_pLogger->attachStream( LogStream::createDefaultStream(aiDefaultLogStream_STDOUT));
-
- // Stream the log to CERR?
- if (defStreams & aiDefaultLogStream_STDERR)
- m_pLogger->attachStream( LogStream::createDefaultStream(aiDefaultLogStream_STDERR));
-
- // Stream the log to a file
- if (defStreams & aiDefaultLogStream_FILE && name && *name)
- m_pLogger->attachStream( LogStream::createDefaultStream(aiDefaultLogStream_FILE,name,io));
-
- return m_pLogger;
-}
-
-// ----------------------------------------------------------------------------------
-void Logger::debug(const std::string &message) {
-
- // SECURITY FIX: otherwise it's easy to produce overruns ...
- if (message.length()>MAX_LOG_MESSAGE_LENGTH) {
- ai_assert(false);
- return;
- }
- return OnDebug(message.c_str());
-}
-
-// ----------------------------------------------------------------------------------
-void Logger::info(const std::string &message) {
-
- // SECURITY FIX: otherwise it's easy to produce overruns ...
- if (message.length()>MAX_LOG_MESSAGE_LENGTH) {
- ai_assert(false);
- return;
- }
- return OnInfo(message.c_str());
-}
-
-// ----------------------------------------------------------------------------------
-void Logger::warn(const std::string &message) {
-
- // SECURITY FIX: otherwise it's easy to produce overruns ...
- if (message.length()>MAX_LOG_MESSAGE_LENGTH) {
- ai_assert(false);
- return;
- }
- return OnWarn(message.c_str());
-}
-
-// ----------------------------------------------------------------------------------
-void Logger::error(const std::string &message) {
-
- // SECURITY FIX: otherwise it's easy to produce overruns ...
- if (message.length()>MAX_LOG_MESSAGE_LENGTH) {
- ai_assert(false);
- return;
- }
- return OnError(message.c_str());
-}
-
-// ----------------------------------------------------------------------------------
-void DefaultLogger::set( Logger *logger )
-{
- // enter the mutex here to avoid concurrency problems
-#ifndef ASSIMP_BUILD_SINGLETHREADED
- boost::mutex::scoped_lock lock(loggerMutex);
-#endif
-
- if (!logger)logger = &s_pNullLogger;
- if (m_pLogger && !isNullLogger() )
- delete m_pLogger;
-
- DefaultLogger::m_pLogger = logger;
-}
-
-// ----------------------------------------------------------------------------------
-bool DefaultLogger::isNullLogger()
-{
- return m_pLogger == &s_pNullLogger;
-}
-
-// ----------------------------------------------------------------------------------
-// Singleton getter
-Logger *DefaultLogger::get()
-{
- return m_pLogger;
-}
-
-// ----------------------------------------------------------------------------------
-// Kills the only instance
-void DefaultLogger::kill()
-{
- // enter the mutex here to avoid concurrency problems
-#ifndef ASSIMP_BUILD_SINGLETHREADED
- boost::mutex::scoped_lock lock(loggerMutex);
-#endif
-
- if (m_pLogger == &s_pNullLogger)return;
- delete m_pLogger;
- m_pLogger = &s_pNullLogger;
-}
-
-// ----------------------------------------------------------------------------------
-// Debug message
-void DefaultLogger::OnDebug( const char* message )
-{
- if ( m_Severity == Logger::NORMAL )
- return;
-
- char msg[MAX_LOG_MESSAGE_LENGTH*2];
- ::sprintf(msg,"Debug, T%i: %s", GetThreadID(), message );
-
- WriteToStreams( msg, Logger::DEBUGGING );
-}
-
-// ----------------------------------------------------------------------------------
-// Logs an info
-void DefaultLogger::OnInfo( const char* message )
-{
- char msg[MAX_LOG_MESSAGE_LENGTH*2];
- ::sprintf(msg,"Info, T%i: %s", GetThreadID(), message );
-
- WriteToStreams( msg , Logger::INFO );
-}
-
-// ----------------------------------------------------------------------------------
-// Logs a warning
-void DefaultLogger::OnWarn( const char* message )
-{
- char msg[MAX_LOG_MESSAGE_LENGTH*2];
- ::sprintf(msg,"Warn, T%i: %s", GetThreadID(), message );
-
- WriteToStreams( msg, Logger::WARN );
-}
-
-// ----------------------------------------------------------------------------------
-// Logs an error
-void DefaultLogger::OnError( const char* message )
-{
- char msg[MAX_LOG_MESSAGE_LENGTH*2];
- ::sprintf(msg,"Error, T%i: %s", GetThreadID(), message );
-
- WriteToStreams( msg, Logger::ERR );
-}
-
-// ----------------------------------------------------------------------------------
-// Attachs a new stream
-bool DefaultLogger::attachStream( LogStream *pStream, unsigned int severity )
-{
- if (!pStream)
- return false;
-
- if (0 == severity) {
- severity = Logger::INFO | Logger::ERR | Logger::WARN | Logger::DEBUGGING;
- }
-
- for ( StreamIt it = m_StreamArray.begin();
- it != m_StreamArray.end();
- ++it )
- {
- if ( (*it)->m_pStream == pStream )
- {
- (*it)->m_uiErrorSeverity |= severity;
- return true;
- }
- }
-
- LogStreamInfo *pInfo = new LogStreamInfo( severity, pStream );
- m_StreamArray.push_back( pInfo );
- return true;
-}
-
-// ----------------------------------------------------------------------------------
-// Detatch a stream
-bool DefaultLogger::detatchStream( LogStream *pStream, unsigned int severity )
-{
- if (!pStream)
- return false;
-
- if (0 == severity) {
- severity = Logger::INFO | Logger::ERR | Logger::WARN | Logger::DEBUGGING;
- }
-
- for ( StreamIt it = m_StreamArray.begin();
- it != m_StreamArray.end();
- ++it )
- {
- if ( (*it)->m_pStream == pStream )
- {
- (*it)->m_uiErrorSeverity &= ~severity;
- if ( (*it)->m_uiErrorSeverity == 0 )
- {
- // don't delete the underlying stream 'cause the caller gains ownership again
- (**it).m_pStream = NULL;
- delete *it;
- m_StreamArray.erase( it );
- break;
- }
- return true;
- }
- }
- return false;
-}
-
-// ----------------------------------------------------------------------------------
-// Constructor
-DefaultLogger::DefaultLogger(LogSeverity severity)
-
- : Logger ( severity )
- , noRepeatMsg (false)
- , lastLen( 0 )
-{
- lastMsg[0] = '\0';
-}
-
-// ----------------------------------------------------------------------------------
-// Destructor
-DefaultLogger::~DefaultLogger()
-{
- for ( StreamIt it = m_StreamArray.begin(); it != m_StreamArray.end(); ++it ) {
- // also frees the underlying stream, we are its owner.
- delete *it;
- }
-}
-
-// ----------------------------------------------------------------------------------
-// Writes message to stream
-void DefaultLogger::WriteToStreams(const char *message,
- ErrorSeverity ErrorSev )
-{
- ai_assert(NULL != message);
-
- // Check whether this is a repeated message
- if (! ::strncmp( message,lastMsg, lastLen-1))
- {
- if (!noRepeatMsg)
- {
- noRepeatMsg = true;
- message = "Skipping one or more lines with the same contents\n";
- }
- else return;
- }
- else
- {
- // append a new-line character to the message to be printed
- lastLen = ::strlen(message);
- ::memcpy(lastMsg,message,lastLen+1);
- ::strcat(lastMsg+lastLen,"\n");
-
- message = lastMsg;
- noRepeatMsg = false;
- ++lastLen;
- }
- for ( ConstStreamIt it = m_StreamArray.begin();
- it != m_StreamArray.end();
- ++it)
- {
- if ( ErrorSev & (*it)->m_uiErrorSeverity )
- (*it)->m_pStream->write( message);
- }
-}
-
-// ----------------------------------------------------------------------------------
-// Returns thread id, if not supported only a zero will be returned.
-unsigned int DefaultLogger::GetThreadID()
-{
- // fixme: we can get this value via boost::threads
-#ifdef WIN32
- return (unsigned int)::GetCurrentThreadId();
-#else
- return 0; // not supported
-#endif
-}
-
-// ----------------------------------------------------------------------------------
-
-} // !namespace Assimp
diff --git a/3rdparty/assimp/code/DefaultProgressHandler.h b/3rdparty/assimp/code/DefaultProgressHandler.h
deleted file mode 100644
index 9b379dfa..00000000
--- a/3rdparty/assimp/code/DefaultProgressHandler.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file ProgressHandler.h
- * @brief Abstract base class 'ProgressHandler'.
- */
-#ifndef INCLUDED_AI_DEFAULTPROGRESSHANDLER_H
-#define INCLUDED_AI_DEFAULTPROGRESSHANDLER_H
-
-#include "../include/ProgressHandler.h"
-namespace Assimp {
-
-// ------------------------------------------------------------------------------------
-/** @brief Internal default implementation of the #ProgressHandler interface. */
-class ASSIMP_API DefaultProgressHandler
- : public ProgressHandler {
-
-
- virtual bool Update(float percentage) {
- return false;
- }
-
-
-}; // !class DefaultProgressHandler
-} // Namespace Assimp
-
-#endif
diff --git a/3rdparty/assimp/code/Exceptional.h b/3rdparty/assimp/code/Exceptional.h
deleted file mode 100644
index ab9c2875..00000000
--- a/3rdparty/assimp/code/Exceptional.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2008, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-#ifndef INCLUDED_EXCEPTIONAL_H
-#define INCLUDED_EXCEPTIONAL_H
-
-#include <stdexcept>
-using std::runtime_error;
-
-#ifdef _MSC_VER
-# pragma warning(disable : 4275)
-#endif
-
-// ---------------------------------------------------------------------------
-/** FOR IMPORTER PLUGINS ONLY: Simple exception class to be thrown if an
- * unrecoverable error occurs while importing. Loading APIs return
- * NULL instead of a valid aiScene then. */
-class ASSIMP_API DeadlyImportError
- : public runtime_error
-{
-public:
- /** Constructor with arguments */
- explicit DeadlyImportError( const std::string& pErrorText)
- : runtime_error(pErrorText)
- {
- }
-
-private:
-};
-
-#ifdef _MSC_VER
-# pragma warning(default : 4275)
-#endif
-
-// ---------------------------------------------------------------------------
-template <typename T>
-struct ExceptionSwallower {
- T operator ()() const {
- return T();
- }
-};
-
-// ---------------------------------------------------------------------------
-template <typename T>
-struct ExceptionSwallower<T*> {
- T* operator ()() const {
- return NULL;
- }
-};
-
-// ---------------------------------------------------------------------------
-template <>
-struct ExceptionSwallower<aiReturn> {
- aiReturn operator ()() const {
- try {
- throw;
- }
- catch (std::bad_alloc&) {
- return aiReturn_OUTOFMEMORY;
- }
- catch (...) {
- return aiReturn_FAILURE;
- }
- }
-};
-
-// ---------------------------------------------------------------------------
-template <>
-struct ExceptionSwallower<void> {
- void operator ()() const {
- return;
- }
-};
-
-#define ASSIMP_BEGIN_EXCEPTION_REGION()\
-{\
- try {
-
-#define ASSIMP_END_EXCEPTION_REGION(type)\
- } catch(...) {\
- return ExceptionSwallower<type>()();\
- }\
-}
-
-#endif // INCLUDED_EXCEPTIONAL_H
diff --git a/3rdparty/assimp/code/FileLogStream.h b/3rdparty/assimp/code/FileLogStream.h
deleted file mode 100644
index 15b8da7b..00000000
--- a/3rdparty/assimp/code/FileLogStream.h
+++ /dev/null
@@ -1,64 +0,0 @@
-#ifndef ASSIMP_FILELOGSTREAM_H_INC
-#define ASSIMP_FILELOGSTREAM_H_INC
-
-#include "../include/LogStream.h"
-#include "../include/IOStream.h"
-
-namespace Assimp {
-
-// ----------------------------------------------------------------------------------
-/** @class FileLogStream
- * @brief Logstream to write into a file.
- */
-class FileLogStream :
- public LogStream
-{
-public:
- FileLogStream( const char* file, IOSystem* io = NULL );
- ~FileLogStream();
- void write( const char* message );
-
-private:
- IOStream *m_pStream;
-};
-
-// ----------------------------------------------------------------------------------
-// Constructor
-inline FileLogStream::FileLogStream( const char* file, IOSystem* io ) :
- m_pStream(NULL)
-{
- if ( !file || 0 == *file )
- return;
-
- // If no IOSystem is specified: take a default one
- if (!io)
- {
- DefaultIOSystem FileSystem;
- m_pStream = FileSystem.Open( file, "wt");
- }
- else m_pStream = io->Open( file, "wt" );
-}
-
-// ----------------------------------------------------------------------------------
-// Destructor
-inline FileLogStream::~FileLogStream()
-{
- // The virtual d'tor should destroy the underlying file
- delete m_pStream;
-}
-
-// ----------------------------------------------------------------------------------
-// Write method
-inline void FileLogStream::write( const char* message )
-{
- if (m_pStream != NULL)
- {
- m_pStream->Write(message, sizeof(char), ::strlen(message));
- m_pStream->Flush();
- }
-}
-
-// ----------------------------------------------------------------------------------
-} // !Namespace Assimp
-
-#endif // !! ASSIMP_FILELOGSTREAM_H_INC
diff --git a/3rdparty/assimp/code/FileSystemFilter.h b/3rdparty/assimp/code/FileSystemFilter.h
deleted file mode 100644
index cc3b4a68..00000000
--- a/3rdparty/assimp/code/FileSystemFilter.h
+++ /dev/null
@@ -1,244 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2008, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file FileSystemFilter.h
- * Implements a filter system to filter calls to Exists() and Open()
- * in order to improve the sucess rate of file opening ...
- */
-#ifndef AI_FILESYSTEMFILTER_H_INC
-#define AI_FILESYSTEMFILTER_H_INC
-
-#include "../include/IOSystem.h"
-#include "fast_atof.h"
-#include "ParsingUtils.h"
-namespace Assimp {
-
-// ---------------------------------------------------------------------------
-/** File system filter
- */
-class FileSystemFilter : public IOSystem
-{
-public:
- /** Constructor. */
- FileSystemFilter(const std::string& file, IOSystem* old)
- : wrapped (old)
- , src_file (file)
- {
- ai_assert(NULL != wrapped);
-
- // Determine base directory
- base = src_file;
- std::string::size_type ss2;
- if (std::string::npos != (ss2 = base.find_last_of("\\/"))) {
- base.erase(ss2,base.length()-ss2);
- }
- else {
- base = "";
- // return;
- }
-
- // make sure the directory is terminated properly
- char s;
-
- if (base.length() == 0) {
- base = ".";
- base += getOsSeparator();
- }
- else if ((s = *(base.end()-1)) != '\\' && s != '/')
- base += getOsSeparator();
-
- DefaultLogger::get()->info("Import root directory is \'" + base + "\'");
- }
-
- /** Destructor. */
- ~FileSystemFilter()
- {
- // haha
- }
-
- // -------------------------------------------------------------------
- /** Tests for the existence of a file at the given path. */
- bool Exists( const char* pFile) const
- {
- std::string tmp = pFile;
-
- // Currently this IOSystem is also used to open THE ONE FILE.
- if (tmp != src_file) {
- BuildPath(tmp);
- Cleanup(tmp);
- }
-
- return wrapped->Exists(tmp);
- }
-
- // -------------------------------------------------------------------
- /** Returns the directory separator. */
- char getOsSeparator() const
- {
- return wrapped->getOsSeparator();
- }
-
- // -------------------------------------------------------------------
- /** Open a new file with a given path. */
- IOStream* Open( const char* pFile, const char* pMode = "rb")
- {
- ai_assert(pFile);
- ai_assert(pMode);
-
- // First try the unchanged path
- IOStream* s = wrapped->Open(pFile,pMode);
-
- if (!s) {
- std::string tmp = pFile;
-
- // Try to convert between absolute and relative paths
- BuildPath(tmp);
- s = wrapped->Open(tmp,pMode);
-
- if (!s) {
- // Finally, look for typical issues with paths
- // and try to correct them. This is our last
- // resort.
- Cleanup(tmp);
- s = wrapped->Open(tmp,pMode);
- }
- }
-
- return s;
- }
-
- // -------------------------------------------------------------------
- /** Closes the given file and releases all resources associated with it. */
- void Close( IOStream* pFile)
- {
- return wrapped->Close(pFile);
- }
-
- // -------------------------------------------------------------------
- /** Compare two paths */
- bool ComparePaths (const char* one, const char* second) const
- {
- return wrapped->ComparePaths (one,second);
- }
-
-private:
- IOSystem* wrapped;
- std::string src_file, base;
-
- // -------------------------------------------------------------------
- /** Build a valid path from a given relative or absolute path.
- */
- void BuildPath (std::string& in) const
- {
- // if we can already access the file, great.
- if (in.length() < 3 || wrapped->Exists(in.c_str())) {
- return;
- }
-
- // Determine whether this is a relative path (Windows-specific - most assets are packaged on Windows).
- if (in[1] != ':') {
-
- // append base path and try
- in = base + in;
- if (wrapped->Exists(in.c_str())) {
- return;
- }
- }
-
- // hopefully the underyling file system has another few tricks to access this file ...
- }
-
- // -------------------------------------------------------------------
- /** Cleanup the given path
- */
- void Cleanup (std::string& in) const
- {
- char last = 0;
-
- // Remove a very common issue when we're parsing file names: spaces at the
- // beginning of the path.
- std::string::iterator it = in.begin();
- while (IsSpaceOrNewLine( *it ))++it;
- if (it != in.begin())
- in.erase(in.begin(),it+1);
-
- const char sep = getOsSeparator();
- for (it = in.begin(); it != in.end(); ++it) {
- // Exclude :// and \\, which remain untouched.
- // https://sourceforge.net/tracker/?func=detail&aid=3031725&group_id=226462&atid=1067632
- if ( !strncmp(&*it, "://", 3 )) {
- it += 3;
- continue;
- }
- if (it == in.begin() && !strncmp(&*it, "\\\\", 2)) {
- it += 2;
- continue;
- }
-
- // Cleanup path delimiters
- if (*it == '/' || (*it) == '\\') {
- *it = sep;
-
- // And we're removing double delimiters, frequent issue with
- // incorrectly composited paths ...
- if (last == *it) {
- it = in.erase(it);
- --it;
- }
- }
- else if (*it == '%' && in.end() - it > 2) {
-
- // Hex sequence in URIs
- uint32_t tmp;
- if ( 0xffffffff != (tmp = HexOctetToDecimal(&*it))) {
- *it = (char)tmp;
- it = in.erase(it+1,it+2);
- --it;
- }
- }
-
- last = *it;
- }
- }
-};
-
-} //!ns Assimp
-
-#endif //AI_DEFAULTIOSYSTEM_H_INC
diff --git a/3rdparty/assimp/code/FindDegenerates.cpp b/3rdparty/assimp/code/FindDegenerates.cpp
deleted file mode 100644
index 3cdd325d..00000000
--- a/3rdparty/assimp/code/FindDegenerates.cpp
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file FindDegenerates.cpp
- * @brief Implementation of the FindDegenerates post-process step.
-*/
-
-#include "AssimpPCH.h"
-
-// internal headers
-#include "ProcessHelper.h"
-#include "FindDegenerates.h"
-
-using namespace Assimp;
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-FindDegeneratesProcess::FindDegeneratesProcess()
-: configRemoveDegenerates (false)
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-FindDegeneratesProcess::~FindDegeneratesProcess()
-{
- // nothing to do here
-}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the processing step is present in the given flag field.
-bool FindDegeneratesProcess::IsActive( unsigned int pFlags) const
-{
- return 0 != (pFlags & aiProcess_FindDegenerates);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Setup import configuration
-void FindDegeneratesProcess::SetupProperties(const Importer* pImp)
-{
- // Get the current value of AI_CONFIG_PP_FD_REMOVE
- configRemoveDegenerates = (0 != pImp->GetPropertyInteger(AI_CONFIG_PP_FD_REMOVE,0));
-}
-
-// ------------------------------------------------------------------------------------------------
-// Executes the post processing step on the given imported data.
-void FindDegeneratesProcess::Execute( aiScene* pScene)
-{
- DefaultLogger::get()->debug("FindDegeneratesProcess begin");
- for (unsigned int i = 0; i < pScene->mNumMeshes;++i){
- ExecuteOnMesh( pScene->mMeshes[i]);
- }
- DefaultLogger::get()->debug("FindDegeneratesProcess finished");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Executes the post processing step on the given imported mesh
-void FindDegeneratesProcess::ExecuteOnMesh( aiMesh* mesh)
-{
- mesh->mPrimitiveTypes = 0;
-
- std::vector<bool> remove_me;
- if (configRemoveDegenerates)
- remove_me.resize(mesh->mNumFaces,false);
-
- unsigned int deg = 0, limit;
- for (unsigned int a = 0; a < mesh->mNumFaces; ++a)
- {
- aiFace& face = mesh->mFaces[a];
- bool first = true;
-
- // check whether the face contains degenerated entries
- for (register unsigned int i = 0; i < face.mNumIndices; ++i)
- {
- // Polygons with more than 4 points are allowed to have double points, that is
- // simulating polygons with holes just with concave polygons. However,
- // double points may not come directly after another.
- limit = face.mNumIndices;
- if (face.mNumIndices > 4)
- limit = std::min(limit,i+2);
-
- for (register unsigned int t = i+1; t < limit; ++t)
- {
- if (mesh->mVertices[face.mIndices[i]] == mesh->mVertices[face.mIndices[t]])
- {
- // we have found a matching vertex position
- // remove the corresponding index from the array
- --face.mNumIndices;--limit;
- for (unsigned int m = t; m < face.mNumIndices; ++m)
- {
- face.mIndices[m] = face.mIndices[m+1];
- }
- --t;
-
- // NOTE: we set the removed vertex index to an unique value
- // to make sure the developer gets notified when his
- // application attemps to access this data.
- face.mIndices[face.mNumIndices] = 0xdeadbeef;
-
- if (first)
- {
- ++deg;
- first = false;
- }
-
- if (configRemoveDegenerates) {
- remove_me[a] = true;
- goto evil_jump_outside; // hrhrhrh ... yeah, this rocks baby!
- }
- }
- }
- }
-
- // We need to update the primitive flags array of the mesh.
- switch (face.mNumIndices)
- {
- case 1u:
- mesh->mPrimitiveTypes |= aiPrimitiveType_POINT;
- break;
- case 2u:
- mesh->mPrimitiveTypes |= aiPrimitiveType_LINE;
- break;
- case 3u:
- mesh->mPrimitiveTypes |= aiPrimitiveType_TRIANGLE;
- break;
- default:
- mesh->mPrimitiveTypes |= aiPrimitiveType_POLYGON;
- break;
- };
-evil_jump_outside:
- continue;
- }
-
- // If AI_CONFIG_PP_FD_REMOVE is true, remove degenerated faces from the import
- if (configRemoveDegenerates && deg) {
- unsigned int n = 0;
- for (unsigned int a = 0; a < mesh->mNumFaces; ++a)
- {
- aiFace& face_src = mesh->mFaces[a];
- if (!remove_me[a]) {
- aiFace& face_dest = mesh->mFaces[n++];
-
- // Do a manual copy, keep the index array
- face_dest.mNumIndices = face_src.mNumIndices;
- face_dest.mIndices = face_src.mIndices;
-
- if (&face_src != &face_dest) {
- // clear source
- face_src.mNumIndices = 0;
- face_src.mIndices = NULL;
- }
- }
- else {
- // Otherwise delete it if we don't need this face
- delete[] face_src.mIndices;
- face_src.mIndices = NULL;
- face_src.mNumIndices = 0;
- }
- }
- // Just leave the rest of the array unreferenced, we don't care for now
- mesh->mNumFaces = n;
- if (!mesh->mNumFaces) {
- // WTF!?
- // OK ... for completeness and because I'm not yet tired,
- // let's write code that willl hopefully never be called
- // (famous last words)
-
- // OK ... bad idea.
- throw DeadlyImportError("Mesh is empty after removal of degenerated primitives ... WTF!?");
- }
- }
-
- if (deg && !DefaultLogger::isNullLogger())
- {
- char s[64];
- ASSIMP_itoa10(s,deg);
- DefaultLogger::get()->warn(std::string("Found ") + s + " degenerated primitives");
- }
-}
diff --git a/3rdparty/assimp/code/FindDegenerates.h b/3rdparty/assimp/code/FindDegenerates.h
deleted file mode 100644
index daa5cf93..00000000
--- a/3rdparty/assimp/code/FindDegenerates.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file Defines a post processing step to search all meshes for
- degenerated faces */
-#ifndef AI_FINDDEGENERATESPROCESS_H_INC
-#define AI_FINDDEGENERATESPROCESS_H_INC
-
-#include "BaseProcess.h"
-#include "../include/aiMesh.h"
-
-class FindDegeneratesProcessTest;
-namespace Assimp {
-
-
-// ---------------------------------------------------------------------------
-/** FindDegeneratesProcess: Searches a mesh for degenerated triangles.
-*/
-class ASSIMP_API FindDegeneratesProcess : public BaseProcess
-{
- friend class Importer;
- friend class ::FindDegeneratesProcessTest; // grant the unit test full access to us
-
-protected:
- /** Constructor to be privately used by Importer */
- FindDegeneratesProcess();
-
- /** Destructor, private as well */
- ~FindDegeneratesProcess();
-
-public:
-
- // -------------------------------------------------------------------
- // Check whether step is active
- bool IsActive( unsigned int pFlags) const;
-
- // -------------------------------------------------------------------
- // Execute step on a given scene
- void Execute( aiScene* pScene);
-
- // -------------------------------------------------------------------
- // Setup import settings
- void SetupProperties(const Importer* pImp);
-
- // -------------------------------------------------------------------
- // Execute step on a given mesh
- void ExecuteOnMesh( aiMesh* mesh);
-
-
- // -------------------------------------------------------------------
- /** @brief Enable the instant removal of degenerated primitives
- * @param d hm ... difficult to guess what this means, hu!?
- */
- void EnableInstantRemoval(bool d) {
- configRemoveDegenerates = d;
- }
-
- // -------------------------------------------------------------------
- /** @brief Check whether instant removal is currently enabled
- * @return ...
- */
- bool IsInstantRemoval() const {
- return configRemoveDegenerates;
- }
-
-private:
-
- //! Configuration option: remove degenerates faces immediately
- bool configRemoveDegenerates;
-};
-}
-
-#endif // !! AI_FINDDEGENERATESPROCESS_H_INC
diff --git a/3rdparty/assimp/code/FindInstancesProcess.cpp b/3rdparty/assimp/code/FindInstancesProcess.cpp
deleted file mode 100644
index f5956891..00000000
--- a/3rdparty/assimp/code/FindInstancesProcess.cpp
+++ /dev/null
@@ -1,288 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file FindInstancesProcess.cpp
- * @brief Implementation of the aiProcess_FindInstances postprocessing step
-*/
-
-#include "AssimpPCH.h"
-#include "FindInstancesProcess.h"
-
-using namespace Assimp;
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-FindInstancesProcess::FindInstancesProcess()
-: configSpeedFlag (false)
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-FindInstancesProcess::~FindInstancesProcess()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the processing step is present in the given flag field.
-bool FindInstancesProcess::IsActive( unsigned int pFlags) const
-{
- // FindInstances makes absolutely no sense together with PreTransformVertices
- // fixme: spawn error message somewhere else?
- return 0 != (pFlags & aiProcess_FindInstances) && 0 == (pFlags & aiProcess_PreTransformVertices);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Setup properties for the step
-void FindInstancesProcess::SetupProperties(const Importer* pImp)
-{
- // AI_CONFIG_FAVOUR_SPEED
- configSpeedFlag = (0 != pImp->GetPropertyInteger(AI_CONFIG_FAVOUR_SPEED,0));
-}
-
-// ------------------------------------------------------------------------------------------------
-// Compare the bones of two meshes
-bool CompareBones(const aiMesh* orig, const aiMesh* inst)
-{
- for (unsigned int i = 0; i < orig->mNumBones;++i) {
- aiBone* aha = orig->mBones[i];
- aiBone* oha = inst->mBones[i];
-
- if (aha->mNumWeights != oha->mNumWeights ||
- aha->mOffsetMatrix != oha->mOffsetMatrix ||
- aha->mNumWeights != oha->mNumWeights) {
- return false;
- }
-
- // compare weight per weight ---
- for (unsigned int n = 0; n < aha->mNumWeights;++n) {
- if (aha->mWeights[n].mVertexId != oha->mWeights[n].mVertexId ||
- (aha->mWeights[n].mWeight - oha->mWeights[n].mWeight) < 10e-3f) {
- return false;
- }
- }
- }
- return true;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Update mesh indices in the node graph
-void UpdateMeshIndices(aiNode* node, unsigned int* lookup)
-{
- for (unsigned int n = 0; n < node->mNumMeshes;++n)
- node->mMeshes[n] = lookup[node->mMeshes[n]];
-
- for (unsigned int n = 0; n < node->mNumChildren;++n)
- UpdateMeshIndices(node->mChildren[n],lookup);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Executes the post processing step on the given imported data.
-void FindInstancesProcess::Execute( aiScene* pScene)
-{
- DefaultLogger::get()->debug("FindInstancesProcess begin");
- if (pScene->mNumMeshes) {
-
- // use a pseudo hash for all meshes in the scene to quickly find
- // the ones which are possibly equal. This step is executed early
- // in the pipeline, so we could, depending on the file format,
- // have several thousand small meshes. That's too much for a brute
- // everyone-against-everyone check involving up to 10 comparisons
- // each.
- boost::scoped_array<uint64_t> hashes (new uint64_t[pScene->mNumMeshes]);
- boost::scoped_array<unsigned int> remapping (new unsigned int[pScene->mNumMeshes]);
-
- unsigned int numMeshesOut = 0;
- for (unsigned int i = 0; i < pScene->mNumMeshes; ++i) {
-
- aiMesh* inst = pScene->mMeshes[i];
- hashes[i] = GetMeshHash(inst);
-
- for (int a = i-1; a >= 0; --a) {
- if (hashes[i] == hashes[a])
- {
- aiMesh* orig = pScene->mMeshes[a];
- if (!orig)
- continue;
-
- // check for hash collision .. we needn't check
- // the vertex format, it *must* match due to the
- // (brilliant) construction of the hash
- if (orig->mNumBones != inst->mNumBones ||
- orig->mNumFaces != inst->mNumFaces ||
- orig->mNumVertices != inst->mNumVertices ||
- orig->mMaterialIndex != inst->mMaterialIndex ||
- orig->mPrimitiveTypes != inst->mPrimitiveTypes)
- continue;
-
- // up to now the meshes are equal. find an appropriate
- // epsilon to compare position differences against
- float epsilon = ComputePositionEpsilon(inst);
- epsilon *= epsilon;
-
- // now compare vertex positions, normals,
- // tangents and bitangents using this epsilon.
- if (orig->HasPositions()) {
- if (!CompareArrays(orig->mVertices,inst->mVertices,orig->mNumVertices,epsilon))
- continue;
- }
- if (orig->HasNormals()) {
- if (!CompareArrays(orig->mNormals,inst->mNormals,orig->mNumVertices,epsilon))
- continue;
- }
- if (orig->HasTangentsAndBitangents()) {
- if (!CompareArrays(orig->mTangents,inst->mTangents,orig->mNumVertices,epsilon) ||
- !CompareArrays(orig->mBitangents,inst->mBitangents,orig->mNumVertices,epsilon))
- continue;
- }
-
- // use a constant epsilon for colors and UV coordinates
- static const float uvEpsilon = 10e-4f;
-
- BOOST_STATIC_ASSERT(4 == AI_MAX_NUMBER_OF_COLOR_SETS);
-
- // as in JIV: manually unrolled as continue wouldn't work as desired in inner loops
- if (orig->mTextureCoords[0]) {
- if (!CompareArrays(orig->mTextureCoords[0],inst->mTextureCoords[0],orig->mNumVertices,uvEpsilon))
- continue;
- if (orig->mTextureCoords[1]) {
- if (!CompareArrays(orig->mTextureCoords[1],inst->mTextureCoords[1],orig->mNumVertices,uvEpsilon))
- continue;
- if (orig->mTextureCoords[2]) {
- if (!CompareArrays(orig->mTextureCoords[2],inst->mTextureCoords[2],orig->mNumVertices,uvEpsilon))
- continue;
- if (orig->mTextureCoords[3]) {
- if (!CompareArrays(orig->mTextureCoords[3],inst->mTextureCoords[3],orig->mNumVertices,uvEpsilon))
- continue;
- }
- }
- }
- }
-
- BOOST_STATIC_ASSERT(4 == AI_MAX_NUMBER_OF_COLOR_SETS);
-
- // and the same nasty stuff for vertex colors ...
- if (orig->mColors[0]) {
- if (!CompareArrays(orig->mColors[0],inst->mColors[0],orig->mNumVertices,uvEpsilon))
- continue;
- if (orig->mTextureCoords[1]) {
- if (!CompareArrays(orig->mColors[1],inst->mColors[1],orig->mNumVertices,uvEpsilon))
- continue;
- if (orig->mTextureCoords[2]) {
- if (!CompareArrays(orig->mColors[2],inst->mColors[2],orig->mNumVertices,uvEpsilon))
- continue;
- if (orig->mTextureCoords[3]) {
- if (!CompareArrays(orig->mColors[3],inst->mColors[3],orig->mNumVertices,uvEpsilon))
- continue;
- }
- }
- }
- }
-
- // These two checks are actually quite expensive and almost *never* required.
- // Almost. That's why they're still here. But there's no reason to do them
- // in speed-targeted imports.
- if (!configSpeedFlag) {
-
- // It seems to be strange, but we really need to check whether the
- // bones are identical too. Although it's extremely unprobable
- // that they're not if control reaches here, we need to deal
- // with unprobable cases, too. It could still be that there are
- // equal shapes which are deformed differently.
- if (!CompareBones(orig,inst))
- continue;
-
- // For completeness ... compare even the index buffers for equality
- // face order & winding order doesn't care. Input data is in verbose format.
- boost::scoped_array<unsigned int> ftbl_orig(new unsigned int[orig->mNumVertices]);
- boost::scoped_array<unsigned int> ftbl_inst(new unsigned int[orig->mNumVertices]);
-
- for (unsigned int tt = 0; tt < orig->mNumFaces;++tt) {
- aiFace& f = orig->mFaces[tt];
- for (unsigned int nn = 0; nn < f.mNumIndices;++nn)
- ftbl_orig[f.mIndices[nn]] = tt;
-
- aiFace& f2 = inst->mFaces[tt];
- for (unsigned int nn = 0; nn < f2.mNumIndices;++nn)
- ftbl_inst[f2.mIndices[nn]] = tt;
- }
- if (0 != ::memcmp(ftbl_inst.get(),ftbl_orig.get(),orig->mNumVertices*sizeof(unsigned int)))
- continue;
- }
-
- // We're still here. Or in other words: 'inst' is an instance of 'orig'.
- // Place a marker in our list that we can easily update mesh indices.
- remapping[i] = remapping[a];
-
- // Delete the instanced mesh, we don't need it anymore
- delete inst;
- pScene->mMeshes[i] = NULL;
- break;
- }
- }
-
- // If we didn't find a match for the current mesh: keep it
- if (pScene->mMeshes[i]) {
- remapping[i] = numMeshesOut++;
- }
- }
- ai_assert(0 != numMeshesOut);
- if (numMeshesOut != pScene->mNumMeshes) {
-
- // Collapse the meshes array by removing all NULL entries
- for (unsigned int real = 0, i = 0; real < numMeshesOut; ++i) {
- if (pScene->mMeshes[i])
- pScene->mMeshes[real++] = pScene->mMeshes[i];
- }
-
- // And update the nodegraph with our nice lookup table
- UpdateMeshIndices(pScene->mRootNode,remapping.get());
-
- // write to log
- if (!DefaultLogger::isNullLogger()) {
-
- char buffer[512];
- ::sprintf(buffer,"FindInstancesProcess finished. Found %i instances",pScene->mNumMeshes-numMeshesOut);
- DefaultLogger::get()->info(buffer);
- }
- pScene->mNumMeshes = numMeshesOut;
- }
- else DefaultLogger::get()->debug("FindInstancesProcess finished. No instanced meshes found");
- }
-}
diff --git a/3rdparty/assimp/code/FindInstancesProcess.h b/3rdparty/assimp/code/FindInstancesProcess.h
deleted file mode 100644
index 3b329a15..00000000
--- a/3rdparty/assimp/code/FindInstancesProcess.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file FindInstancesProcess.h
- * @brief Declares the aiProcess_FindInstances post-process step
- */
-#ifndef AI_FINDINSTANCES_H_INC
-#define AI_FINDINSTANCES_H_INC
-
-#include "BaseProcess.h"
-#include "ProcessHelper.h"
-
-class FindInstancesProcessTest;
-namespace Assimp {
-
-// -------------------------------------------------------------------------------
-/** @brief Get a pseudo(!)-hash representing a mesh.
- *
- * The hash is built from number of vertices, faces, primitive types,
- * .... but *not* from the real mesh data. It isn't absolutely unique.
- * @param in Input mesh
- * @return Hash.
- */
-inline uint64_t GetMeshHash(aiMesh* in)
-{
- ai_assert(NULL != in);
-
- // ... get an unique value representing the vertex format of the mesh
- const unsigned int fhash = GetMeshVFormatUnique(in);
-
- // and bake it with number of vertices/faces/bones/matidx/ptypes
- return ((uint64_t)fhash << 32u) | ((
- (in->mNumBones << 16u) ^ (in->mNumVertices) ^
- (in->mNumFaces<<4u) ^ (in->mMaterialIndex<<15) ^
- (in->mPrimitiveTypes<<28)) & 0xffffffff );
-}
-
-// -------------------------------------------------------------------------------
-/** @brief Perform a component-wise comparison of two arrays
- *
- * @param first First array
- * @param second Second aray
- * @param size Size of both arrays
- * @param e Epsilon
- * @return true if the arrays are identical
- */
-inline bool CompareArrays(const aiVector3D* first, const aiVector3D* second,
- unsigned int size, float e)
-{
- for (const aiVector3D* end = first+size; first != end; ++first,++second) {
- if ( (*first - *second).SquareLength() >= e)
- return false;
- }
- return true;
-}
-
-// and the same for colors ...
-inline bool CompareArrays(const aiColor4D* first, const aiColor4D* second,
- unsigned int size, float e)
-{
- for (const aiColor4D* end = first+size; first != end; ++first,++second) {
- if ( GetColorDifference(*first,*second) >= e)
- return false;
- }
- return true;
-}
-
-// ---------------------------------------------------------------------------
-/** @brief A post-processing steps to search for instanced meshes
-*/
-class ASSIMP_API FindInstancesProcess : public BaseProcess
-{
- friend class Importer;
- friend class ::FindInstancesProcessTest;
-
-protected:
- /** Constructor to be privately used by Importer */
- FindInstancesProcess();
-
- /** Destructor, private as well */
- ~FindInstancesProcess();
-
-public:
- // -------------------------------------------------------------------
- // Check whether step is active in given flags combination
- bool IsActive( unsigned int pFlags) const;
-
- // -------------------------------------------------------------------
- // Execute step on a given scene
- void Execute( aiScene* pScene);
-
- // -------------------------------------------------------------------
- // Setup properties prior to executing the process
- void SetupProperties(const Importer* pImp);
-
-private:
-
- bool configSpeedFlag;
-
-}; // ! end class FindInstancesProcess
-} // ! end namespace Assimp
-
-#endif // !! AI_FINDINSTANCES_H_INC
diff --git a/3rdparty/assimp/code/FindInvalidDataProcess.cpp b/3rdparty/assimp/code/FindInvalidDataProcess.cpp
deleted file mode 100644
index ad4ab75e..00000000
--- a/3rdparty/assimp/code/FindInvalidDataProcess.cpp
+++ /dev/null
@@ -1,419 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file Defines a post processing step to search an importer's output
- for data that is obviously invalid */
-
-#include "AssimpPCH.h"
-
-#ifndef ASSIMP_BUILD_NO_FINDINVALIDDATA_PROCESS
-
-// internal headers
-#include "FindInvalidDataProcess.h"
-#include "ProcessHelper.h"
-
-using namespace Assimp;
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-FindInvalidDataProcess::FindInvalidDataProcess()
-{
- // nothing to do here
-}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-FindInvalidDataProcess::~FindInvalidDataProcess()
-{
- // nothing to do here
-}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the processing step is present in the given flag field.
-bool FindInvalidDataProcess::IsActive( unsigned int pFlags) const
-{
- return 0 != (pFlags & aiProcess_FindInvalidData);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Setup import configuration
-void FindInvalidDataProcess::SetupProperties(const Importer* pImp)
-{
- // Get the current value of AI_CONFIG_PP_FID_ANIM_ACCURACY
- configEpsilon = (0 != pImp->GetPropertyFloat(AI_CONFIG_PP_FID_ANIM_ACCURACY,0.f));
-}
-
-// ------------------------------------------------------------------------------------------------
-// Update mesh references in the node graph
-void UpdateMeshReferences(aiNode* node, const std::vector<unsigned int>& meshMapping)
-{
- if (node->mNumMeshes) {
- unsigned int out = 0;
- for (unsigned int a = 0; a < node->mNumMeshes;++a) {
-
- register unsigned int ref = node->mMeshes[a];
- if (0xffffffff != (ref = meshMapping[ref])) {
- node->mMeshes[out++] = ref;
- }
- }
- // just let the members that are unused, that's much cheaper
- // than a full array realloc'n'copy party ...
- if (!(node->mNumMeshes = out)) {
-
- delete[] node->mMeshes;
- node->mMeshes = NULL;
- }
- }
- // recursively update all children
- for (unsigned int i = 0; i < node->mNumChildren;++i) {
- UpdateMeshReferences(node->mChildren[i],meshMapping);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Executes the post processing step on the given imported data.
-void FindInvalidDataProcess::Execute( aiScene* pScene)
-{
- DefaultLogger::get()->debug("FindInvalidDataProcess begin");
-
- bool out = false;
- std::vector<unsigned int> meshMapping(pScene->mNumMeshes);
- unsigned int real = 0;
-
- // Process meshes
- for ( unsigned int a = 0; a < pScene->mNumMeshes; a++) {
-
- int result;
- if ((result = ProcessMesh( pScene->mMeshes[a]))) {
- out = true;
-
- if (2 == result) {
- // remove this mesh
- delete pScene->mMeshes[a];
- AI_DEBUG_INVALIDATE_PTR(pScene->mMeshes[a]);
-
- meshMapping[a] = 0xffffffff;
- continue;
- }
- }
- pScene->mMeshes[real] = pScene->mMeshes[a];
- meshMapping[a] = real++;
- }
-
- // Process animations
- for (unsigned int a = 0; a < pScene->mNumAnimations;++a) {
- ProcessAnimation( pScene->mAnimations[a]);
- }
-
-
- if (out) {
- if ( real != pScene->mNumMeshes) {
- if (!real) {
- throw DeadlyImportError("No meshes remaining");
- }
-
- // we need to remove some meshes.
- // therefore we'll also need to remove all references
- // to them from the scenegraph
- UpdateMeshReferences(pScene->mRootNode,meshMapping);
- pScene->mNumMeshes = real;
- }
-
- DefaultLogger::get()->info("FindInvalidDataProcess finished. Found issues ...");
- }
- else DefaultLogger::get()->debug("FindInvalidDataProcess finished. Everything seems to be OK.");
-}
-
-// ------------------------------------------------------------------------------------------------
-template <typename T>
-inline const char* ValidateArrayContents(const T* arr, unsigned int size,
- const std::vector<bool>& dirtyMask, bool mayBeIdentical = false, bool mayBeZero = true)
-{
- return NULL;
-}
-
-// ------------------------------------------------------------------------------------------------
-template <>
-inline const char* ValidateArrayContents<aiVector3D>(const aiVector3D* arr, unsigned int size,
- const std::vector<bool>& dirtyMask, bool mayBeIdentical , bool mayBeZero )
-{
- bool b = false;
- unsigned int cnt = 0;
- for (unsigned int i = 0; i < size;++i) {
-
- if (dirtyMask.size() && dirtyMask[i]) {
- continue;
- }
- ++cnt;
-
- const aiVector3D& v = arr[i];
- if (is_special_float(v.x) || is_special_float(v.y) || is_special_float(v.z)) {
- return "INF/NAN was found in a vector component";
- }
- if (!mayBeZero && !v.x && !v.y && !v.z ) {
- return "Found zero-length vector";
- }
- if (i && v != arr[i-1])b = true;
- }
- if (cnt > 1 && !b && !mayBeIdentical) {
- return "All vectors are identical";
- }
- return NULL;
-}
-
-// ------------------------------------------------------------------------------------------------
-template <typename T>
-inline bool ProcessArray(T*& in, unsigned int num,const char* name,
- const std::vector<bool>& dirtyMask, bool mayBeIdentical = false, bool mayBeZero = true)
-{
- const char* err = ValidateArrayContents(in,num,dirtyMask,mayBeIdentical,mayBeZero);
- if (err) {
- DefaultLogger::get()->error(std::string("FindInvalidDataProcess fails on mesh ") + name + ": " + err);
-
- delete[] in;
- in = NULL;
- return true;
- }
- return false;
-}
-
-// ------------------------------------------------------------------------------------------------
-template <typename T>
-AI_FORCE_INLINE bool EpsilonCompare(const T& n, const T& s, float epsilon);
-
-// ------------------------------------------------------------------------------------------------
-AI_FORCE_INLINE bool EpsilonCompare(float n, float s, float epsilon) {
- return fabs(n-s)>epsilon;
-}
-
-// ------------------------------------------------------------------------------------------------
-template <>
-bool EpsilonCompare<aiVectorKey>(const aiVectorKey& n, const aiVectorKey& s, float epsilon) {
- return
- EpsilonCompare(n.mValue.x,s.mValue.x,epsilon) &&
- EpsilonCompare(n.mValue.y,s.mValue.y,epsilon) &&
- EpsilonCompare(n.mValue.z,s.mValue.z,epsilon);
-}
-
-// ------------------------------------------------------------------------------------------------
-template <>
-bool EpsilonCompare<aiQuatKey>(const aiQuatKey& n, const aiQuatKey& s, float epsilon) {
- return
- EpsilonCompare(n.mValue.x,s.mValue.x,epsilon) &&
- EpsilonCompare(n.mValue.y,s.mValue.y,epsilon) &&
- EpsilonCompare(n.mValue.z,s.mValue.z,epsilon) &&
- EpsilonCompare(n.mValue.w,s.mValue.w,epsilon);
-}
-
-// ------------------------------------------------------------------------------------------------
-template <typename T>
-inline bool AllIdentical(T* in, unsigned int num, float epsilon)
-{
- if (num <= 1) {
- return true;
- }
-
- if (epsilon > 0.f) {
- for (unsigned int i = 0; i < num-1;++i) {
-
- if (!EpsilonCompare(in[i],in[i+1],epsilon)) {
- return false;
- }
- }
- }
- else {
- for (unsigned int i = 0; i < num-1;++i) {
-
- if (in[i] != in[i+1]) {
- return false;
- }
- }
- }
- return true;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Search an animation for invalid content
-void FindInvalidDataProcess::ProcessAnimation (aiAnimation* anim)
-{
- // Process all animation channels
- for (unsigned int a = 0; a < anim->mNumChannels;++a) {
- ProcessAnimationChannel( anim->mChannels[a]);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void FindInvalidDataProcess::ProcessAnimationChannel (aiNodeAnim* anim)
-{
- int i = 0;
-
- // ScenePreprocessor's work ...
- ai_assert((0 != anim->mPositionKeys && 0 != anim->mRotationKeys && 0 != anim->mScalingKeys));
-
- // Check whether all values in a tracks are identical - in this case
- // we can remove al keys except one.
- // POSITIONS
- if (anim->mNumPositionKeys > 1 && AllIdentical(anim->mPositionKeys,anim->mNumPositionKeys,configEpsilon))
- {
- aiVectorKey v = anim->mPositionKeys[0];
-
- // Reallocate ... we need just ONE element, it makes no sense to reuse the array
- delete[] anim->mPositionKeys;
- anim->mPositionKeys = new aiVectorKey[anim->mNumPositionKeys = 1];
- anim->mPositionKeys[0] = v;
- i = 1;
- }
-
- // ROTATIONS
- if (anim->mNumRotationKeys > 1 && AllIdentical(anim->mRotationKeys,anim->mNumRotationKeys,configEpsilon))
- {
- aiQuatKey v = anim->mRotationKeys[0];
-
- // Reallocate ... we need just ONE element, it makes no sense to reuse the array
- delete[] anim->mRotationKeys;
- anim->mRotationKeys = new aiQuatKey[anim->mNumRotationKeys = 1];
- anim->mRotationKeys[0] = v;
- i = 1;
- }
-
- // SCALINGS
- if (anim->mNumScalingKeys > 1 && AllIdentical(anim->mScalingKeys,anim->mNumScalingKeys,configEpsilon))
- {
- aiVectorKey v = anim->mScalingKeys[0];
-
- // Reallocate ... we need just ONE element, it makes no sense to reuse the array
- delete[] anim->mScalingKeys;
- anim->mScalingKeys = new aiVectorKey[anim->mNumScalingKeys = 1];
- anim->mScalingKeys[0] = v;
- i = 1;
- }
- if (1 == i)
- DefaultLogger::get()->warn("Simplified dummy tracks with just one key");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Search a mesh for invalid contents
-int FindInvalidDataProcess::ProcessMesh (aiMesh* pMesh)
-{
- bool ret = false;
- std::vector<bool> dirtyMask(pMesh->mNumVertices,(pMesh->mNumFaces ? true : false));
-
- // Ignore elements that are not referenced by vertices.
- // (they are, for example, caused by the FindDegenerates step)
- for (unsigned int m = 0; m < pMesh->mNumFaces;++m) {
- const aiFace& f = pMesh->mFaces[m];
-
- for (unsigned int i = 0; i < f.mNumIndices;++i) {
- dirtyMask[f.mIndices[i]] = false;
- }
- }
-
- // Process vertex positions
- if (pMesh->mVertices && ProcessArray(pMesh->mVertices,pMesh->mNumVertices,"positions",dirtyMask)) {
- DefaultLogger::get()->error("Deleting mesh: Unable to continue without vertex positions");
- return 2;
- }
-
- // process texture coordinates
- for (unsigned int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS && pMesh->mTextureCoords[i];++i) {
- if (ProcessArray(pMesh->mTextureCoords[i],pMesh->mNumVertices,"uvcoords",dirtyMask)) {
-
- // delete all subsequent texture coordinate sets.
- for (unsigned int a = i+1; a < AI_MAX_NUMBER_OF_TEXTURECOORDS;++a) {
- delete[] pMesh->mTextureCoords[a]; pMesh->mTextureCoords[a] = NULL;
- }
- ret = true;
- }
- }
-
- // -- we don't validate vertex colors, it's difficult to say whether
- // they are invalid or not.
-
- // Normals and tangents are undefined for point and line faces.
- if (pMesh->mNormals || pMesh->mTangents) {
-
- if (aiPrimitiveType_POINT & pMesh->mPrimitiveTypes ||
- aiPrimitiveType_LINE & pMesh->mPrimitiveTypes)
- {
- if (aiPrimitiveType_TRIANGLE & pMesh->mPrimitiveTypes ||
- aiPrimitiveType_POLYGON & pMesh->mPrimitiveTypes)
- {
- // We need to update the lookup-table
- for (unsigned int m = 0; m < pMesh->mNumFaces;++m)
- {
- const aiFace& f = pMesh->mFaces[m];
-
- if (f.mNumIndices < 3) {
- dirtyMask[f.mIndices[0]] = true;
-
- if (f.mNumIndices == 2) {
- dirtyMask[f.mIndices[1]] = true;
- }
- }
- }
- }
- // Normals, tangents and bitangents are undefined for
- // the whole mesh (and should not even be there)
- else return ret;
- }
-
- // Process mesh normals
- if (pMesh->mNormals && ProcessArray(pMesh->mNormals,pMesh->mNumVertices,
- "normals",dirtyMask,true,false))
- ret = true;
-
- // Process mesh tangents
- if (pMesh->mTangents && ProcessArray(pMesh->mTangents,pMesh->mNumVertices,"tangents",dirtyMask)) {
- delete[] pMesh->mBitangents; pMesh->mBitangents = NULL;
- ret = true;
- }
-
- // Process mesh bitangents
- if (pMesh->mBitangents && ProcessArray(pMesh->mBitangents,pMesh->mNumVertices,"bitangents",dirtyMask)) {
- delete[] pMesh->mTangents; pMesh->mTangents = NULL;
- ret = true;
- }
- }
- return ret ? 1 : 0;
-}
-
-
-#endif // !! ASSIMP_BUILD_NO_FINDINVALIDDATA_PROCESS
diff --git a/3rdparty/assimp/code/FindInvalidDataProcess.h b/3rdparty/assimp/code/FindInvalidDataProcess.h
deleted file mode 100644
index 0cdf1587..00000000
--- a/3rdparty/assimp/code/FindInvalidDataProcess.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file Defines a post processing step to search an importer's output
- for data that is obviously invalid */
-#ifndef AI_FINDINVALIDDATA_H_INC
-#define AI_FINDINVALIDDATA_H_INC
-
-#include "BaseProcess.h"
-#include "../include/aiTypes.h"
-
-struct aiMesh;
-class FindInvalidDataProcessTest;
-namespace Assimp {
-
-// ---------------------------------------------------------------------------
-/** The FindInvalidData postprocessing step. It searches the mesh data
- * for parts that are obviously invalid and removes them.
- *
- * Originally this was a workaround for some models written by Blender
- * which have zero normal vectors. */
-class ASSIMP_API FindInvalidDataProcess
- : public BaseProcess
-{
- friend class Importer;
- friend class ::FindInvalidDataProcessTest;
-
-protected:
-
- /** Constructor to be privately used by Importer */
- FindInvalidDataProcess();
-
- /** Destructor, private as well */
- ~FindInvalidDataProcess();
-
-public:
-
- // -------------------------------------------------------------------
- //
- bool IsActive( unsigned int pFlags) const;
-
- // -------------------------------------------------------------------
- // Setup import settings
- void SetupProperties(const Importer* pImp);
-
- // -------------------------------------------------------------------
- // Run the step
- void Execute( aiScene* pScene);
-
-protected:
-
- // -------------------------------------------------------------------
- /** Executes the postprocessing step on the given mesh
- * @param pMesh The mesh to process.
- * @return 0 - nothing, 1 - removed sth, 2 - please delete me */
- int ProcessMesh( aiMesh* pMesh);
-
- // -------------------------------------------------------------------
- /** Executes the postprocessing step on the given animation
- * @param anim The animation to process. */
- void ProcessAnimation (aiAnimation* anim);
-
- // -------------------------------------------------------------------
- /** Executes the postprocessing step on the given anim channel
- * @param anim The animation channel to process.*/
- void ProcessAnimationChannel (aiNodeAnim* anim);
-
-private:
- float configEpsilon;
-};
-
-} // end of namespace Assimp
-
-#endif // AI_AI_FINDINVALIDDATA_H_INC
diff --git a/3rdparty/assimp/code/FixNormalsStep.cpp b/3rdparty/assimp/code/FixNormalsStep.cpp
deleted file mode 100644
index fd10f4d1..00000000
--- a/3rdparty/assimp/code/FixNormalsStep.cpp
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file Implementation of the post processing step to invert
- * all normals in meshes with infacing normals.
- */
-
-#include "AssimpPCH.h"
-
-// internal headers
-#include "FixNormalsStep.h"
-
-using namespace Assimp;
-
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-FixInfacingNormalsProcess::FixInfacingNormalsProcess()
-{
- // nothing to do here
-}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-FixInfacingNormalsProcess::~FixInfacingNormalsProcess()
-{
- // nothing to do here
-}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the processing step is present in the given flag field.
-bool FixInfacingNormalsProcess::IsActive( unsigned int pFlags) const
-{
- return (pFlags & aiProcess_FixInfacingNormals) != 0;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Executes the post processing step on the given imported data.
-void FixInfacingNormalsProcess::Execute( aiScene* pScene)
-{
- DefaultLogger::get()->debug("FixInfacingNormalsProcess begin");
-
- bool bHas = false;
- for ( unsigned int a = 0; a < pScene->mNumMeshes; a++)
- if (ProcessMesh( pScene->mMeshes[a],a))bHas = true;
-
- if (bHas)
- DefaultLogger::get()->debug("FixInfacingNormalsProcess finished. Found issues.");
- else DefaultLogger::get()->debug("FixInfacingNormalsProcess finished. No changes to the scene.");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Apply the step to the mesh
-bool FixInfacingNormalsProcess::ProcessMesh( aiMesh* pcMesh, unsigned int index)
-{
- ai_assert(NULL != pcMesh);
-
- // Nothing to do if there are no model normals
- if (!pcMesh->HasNormals())return false;
-
- // Compute the bounding box of both the model vertices + normals and
- // the umodified model vertices. Then check whether the first BB
- // is smaller than the second. In this case we can assume that the
- // normals need to be flipped, although there are a few special cases ..
- // convex, concave, planar models ...
-
- aiVector3D vMin0 (1e10f,1e10f,1e10f);
- aiVector3D vMin1 (1e10f,1e10f,1e10f);
- aiVector3D vMax0 (-1e10f,-1e10f,-1e10f);
- aiVector3D vMax1 (-1e10f,-1e10f,-1e10f);
-
- for (unsigned int i = 0; i < pcMesh->mNumVertices;++i)
- {
- vMin1.x = std::min(vMin1.x,pcMesh->mVertices[i].x);
- vMin1.y = std::min(vMin1.y,pcMesh->mVertices[i].y);
- vMin1.z = std::min(vMin1.z,pcMesh->mVertices[i].z);
-
- vMax1.x = std::max(vMax1.x,pcMesh->mVertices[i].x);
- vMax1.y = std::max(vMax1.y,pcMesh->mVertices[i].y);
- vMax1.z = std::max(vMax1.z,pcMesh->mVertices[i].z);
-
- const aiVector3D vWithNormal = pcMesh->mVertices[i] + pcMesh->mNormals[i];
-
- vMin0.x = std::min(vMin0.x,vWithNormal.x);
- vMin0.y = std::min(vMin0.y,vWithNormal.y);
- vMin0.z = std::min(vMin0.z,vWithNormal.z);
-
- vMax0.x = std::max(vMax0.x,vWithNormal.x);
- vMax0.y = std::max(vMax0.y,vWithNormal.y);
- vMax0.z = std::max(vMax0.z,vWithNormal.z);
- }
-
- const float fDelta0_x = (vMax0.x - vMin0.x);
- const float fDelta0_y = (vMax0.y - vMin0.y);
- const float fDelta0_z = (vMax0.z - vMin0.z);
-
- const float fDelta1_x = (vMax1.x - vMin1.x);
- const float fDelta1_y = (vMax1.y - vMin1.y);
- const float fDelta1_z = (vMax1.z - vMin1.z);
-
- // Check whether the boxes are overlapping
- if ((fDelta0_x > 0.0f) != (fDelta1_x > 0.0f))return false;
- if ((fDelta0_y > 0.0f) != (fDelta1_y > 0.0f))return false;
- if ((fDelta0_z > 0.0f) != (fDelta1_z > 0.0f))return false;
-
- // Check whether this is a planar surface
- const float fDelta1_yz = fDelta1_y * fDelta1_z;
-
- if (fDelta1_x < 0.05f * sqrtf( fDelta1_yz ))return false;
- if (fDelta1_y < 0.05f * sqrtf( fDelta1_z * fDelta1_x ))return false;
- if (fDelta1_z < 0.05f * sqrtf( fDelta1_y * fDelta1_x ))return false;
-
- // now compare the volumes of the bounding boxes
- if (::fabsf(fDelta0_x * fDelta1_yz) <
- ::fabsf(fDelta1_x * fDelta1_y * fDelta1_z))
- {
- if (!DefaultLogger::isNullLogger())
- {
- char buffer[128]; // should be sufficiently large
- ::sprintf(buffer,"Mesh %i: Normals are facing inwards (or the mesh is planar)",index);
- DefaultLogger::get()->info(buffer);
- }
-
- // Invert normals
- for (unsigned int i = 0; i < pcMesh->mNumVertices;++i)
- pcMesh->mNormals[i] *= -1.0f;
-
- // ... and flip faces
- for (unsigned int i = 0; i < pcMesh->mNumFaces;++i)
- {
- aiFace& face = pcMesh->mFaces[i];
- for ( unsigned int b = 0; b < face.mNumIndices / 2; b++)
- std::swap( face.mIndices[b], face.mIndices[ face.mNumIndices - 1 - b]);
- }
- return true;
- }
- return false;
-}
diff --git a/3rdparty/assimp/code/FixNormalsStep.h b/3rdparty/assimp/code/FixNormalsStep.h
deleted file mode 100644
index 972001e8..00000000
--- a/3rdparty/assimp/code/FixNormalsStep.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-
-/** @file Defines a post processing step to fix infacing normals */
-#ifndef AI_FIXNORMALSPROCESS_H_INC
-#define AI_FIXNORMALSPROCESS_H_INC
-
-#include "BaseProcess.h"
-
-struct aiMesh;
-
-namespace Assimp
-{
-
-// ---------------------------------------------------------------------------
-/** The FixInfacingNormalsProcess tries to deteermine whether the normal
- * vectors of an object are facing inwards. In this case they will be
- * flipped.
- */
- class ASSIMP_API FixInfacingNormalsProcess : public BaseProcess
-{
- friend class Importer;
-
-protected:
- /** Constructor to be privately used by Importer */
- FixInfacingNormalsProcess();
-
- /** Destructor, private as well */
- ~FixInfacingNormalsProcess();
-
-public:
- // -------------------------------------------------------------------
- /** Returns whether the processing step is present in the given flag field.
- * @param pFlags The processing flags the importer was called with. A bitwise
- * combination of #aiPostProcessSteps.
- * @return true if the process is present in this flag fields, false if not.
- */
- bool IsActive( unsigned int pFlags) const;
-
- // -------------------------------------------------------------------
- /** Executes the post processing step on the given imported data.
- * At the moment a process is not supposed to fail.
- * @param pScene The imported data to work at.
- */
- void Execute( aiScene* pScene);
-
-protected:
-
- // -------------------------------------------------------------------
- /** Executes the step on the given mesh
- * @param pMesh The mesh to process.
- */
- bool ProcessMesh( aiMesh* pMesh, unsigned int index);
-};
-
-} // end of namespace Assimp
-
-#endif // AI_FIXNORMALSPROCESS_H_INC
diff --git a/3rdparty/assimp/code/GenFaceNormalsProcess.cpp b/3rdparty/assimp/code/GenFaceNormalsProcess.cpp
deleted file mode 100644
index f4baca6a..00000000
--- a/3rdparty/assimp/code/GenFaceNormalsProcess.cpp
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file Implementation of the post processing step to generate face
-* normals for all imported faces.
-*/
-
-#include "AssimpPCH.h"
-#include "GenFaceNormalsProcess.h"
-
-
-using namespace Assimp;
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-GenFaceNormalsProcess::GenFaceNormalsProcess()
-{
- // nothing to do here
-}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-GenFaceNormalsProcess::~GenFaceNormalsProcess()
-{
- // nothing to do here
-}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the processing step is present in the given flag field.
-bool GenFaceNormalsProcess::IsActive( unsigned int pFlags) const
-{
- return (pFlags & aiProcess_GenNormals) != 0;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Executes the post processing step on the given imported data.
-void GenFaceNormalsProcess::Execute( aiScene* pScene)
-{
- DefaultLogger::get()->debug("GenFaceNormalsProcess begin");
-
- if (pScene->mFlags & AI_SCENE_FLAGS_NON_VERBOSE_FORMAT) {
- throw DeadlyImportError("Post-processing order mismatch: expecting pseudo-indexed (\"verbose\") vertices here");
- }
-
- bool bHas = false;
- for ( unsigned int a = 0; a < pScene->mNumMeshes; a++) {
- if (this->GenMeshFaceNormals( pScene->mMeshes[a])) {
- bHas = true;
- }
- }
- if (bHas) {
- DefaultLogger::get()->info("GenFaceNormalsProcess finished. "
- "Face normals have been calculated");
- }
- else DefaultLogger::get()->debug("GenFaceNormalsProcess finished. "
- "Normals are already there");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Executes the post processing step on the given imported data.
-bool GenFaceNormalsProcess::GenMeshFaceNormals (aiMesh* pMesh)
-{
- if (NULL != pMesh->mNormals) {
- return false;
- }
-
- // If the mesh consists of lines and/or points but not of
- // triangles or higher-order polygons the normal vectors
- // are undefined.
- if (!(pMesh->mPrimitiveTypes & (aiPrimitiveType_TRIANGLE | aiPrimitiveType_POLYGON))) {
- DefaultLogger::get()->info("Normal vectors are undefined for line and point meshes");
- return false;
- }
-
- // allocate an array to hold the output normals
- pMesh->mNormals = new aiVector3D[pMesh->mNumVertices];
- const float qnan = get_qnan();
-
- // iterate through all faces and compute per-face normals but store them per-vertex.
- for ( unsigned int a = 0; a < pMesh->mNumFaces; a++) {
- const aiFace& face = pMesh->mFaces[a];
- if (face.mNumIndices < 3) {
- // either a point or a line -> no well-defined normal vector
- for (unsigned int i = 0;i < face.mNumIndices;++i) {
- pMesh->mNormals[face.mIndices[i]] = qnan;
- }
- continue;
- }
-
- const aiVector3D* pV1 = &pMesh->mVertices[face.mIndices[0]];
- const aiVector3D* pV2 = &pMesh->mVertices[face.mIndices[1]];
- const aiVector3D* pV3 = &pMesh->mVertices[face.mIndices[face.mNumIndices-1]];
- aiVector3D vNor = ((*pV2 - *pV1) ^ (*pV3 - *pV1)).Normalize();
-
- for (unsigned int i = 0;i < face.mNumIndices;++i) {
- pMesh->mNormals[face.mIndices[i]] = vNor;
- }
- }
- return true;
-}
diff --git a/3rdparty/assimp/code/GenFaceNormalsProcess.h b/3rdparty/assimp/code/GenFaceNormalsProcess.h
deleted file mode 100644
index 87ca6f22..00000000
--- a/3rdparty/assimp/code/GenFaceNormalsProcess.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file Defines a post processing step to compute face normals for all loaded faces*/
-#ifndef AI_GENFACENORMALPROCESS_H_INC
-#define AI_GENFACENORMALPROCESS_H_INC
-
-#include "BaseProcess.h"
-#include "../include/aiMesh.h"
-
-namespace Assimp
-{
-
-// ---------------------------------------------------------------------------
-/** The GenFaceNormalsProcess computes face normals for all faces of all meshes
-*/
-class ASSIMP_API GenFaceNormalsProcess : public BaseProcess
-{
- friend class Importer;
-
-protected:
- /** Constructor to be privately used by Importer */
- GenFaceNormalsProcess();
-
- /** Destructor, private as well */
- ~GenFaceNormalsProcess();
-
-public:
- // -------------------------------------------------------------------
- /** Returns whether the processing step is present in the given flag field.
- * @param pFlags The processing flags the importer was called with. A bitwise
- * combination of #aiPostProcessSteps.
- * @return true if the process is present in this flag fields, false if not.
- */
- bool IsActive( unsigned int pFlags) const;
-
- // -------------------------------------------------------------------
- /** Executes the post processing step on the given imported data.
- * At the moment a process is not supposed to fail.
- * @param pScene The imported data to work at.
- */
- void Execute( aiScene* pScene);
-
-
-private:
- bool GenMeshFaceNormals (aiMesh* pcMesh);
-};
-
-} // end of namespace Assimp
-
-#endif // !!AI_GENFACENORMALPROCESS_H_INC
diff --git a/3rdparty/assimp/code/GenVertexNormalsProcess.cpp b/3rdparty/assimp/code/GenVertexNormalsProcess.cpp
deleted file mode 100644
index e8be8709..00000000
--- a/3rdparty/assimp/code/GenVertexNormalsProcess.cpp
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file Implementation of the post processing step to generate face
-* normals for all imported faces.
-*/
-
-#include "AssimpPCH.h"
-
-// internal headers
-#include "GenVertexNormalsProcess.h"
-#include "ProcessHelper.h"
-
-using namespace Assimp;
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-GenVertexNormalsProcess::GenVertexNormalsProcess()
-{
- this->configMaxAngle = AI_DEG_TO_RAD(175.f);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-GenVertexNormalsProcess::~GenVertexNormalsProcess()
-{
- // nothing to do here
-}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the processing step is present in the given flag field.
-bool GenVertexNormalsProcess::IsActive( unsigned int pFlags) const
-{
- return (pFlags & aiProcess_GenSmoothNormals) != 0;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Executes the post processing step on the given imported data.
-void GenVertexNormalsProcess::SetupProperties(const Importer* pImp)
-{
- // Get the current value of the AI_CONFIG_PP_GSN_MAX_SMOOTHING_ANGLE property
- configMaxAngle = pImp->GetPropertyFloat(AI_CONFIG_PP_GSN_MAX_SMOOTHING_ANGLE,175.f);
- configMaxAngle = AI_DEG_TO_RAD(std::max(std::min(configMaxAngle,175.0f),0.0f));
-}
-
-// ------------------------------------------------------------------------------------------------
-// Executes the post processing step on the given imported data.
-void GenVertexNormalsProcess::Execute( aiScene* pScene)
-{
- DefaultLogger::get()->debug("GenVertexNormalsProcess begin");
-
- if (pScene->mFlags & AI_SCENE_FLAGS_NON_VERBOSE_FORMAT)
- throw DeadlyImportError("Post-processing order mismatch: expecting pseudo-indexed (\"verbose\") vertices here");
-
- bool bHas = false;
- for ( unsigned int a = 0; a < pScene->mNumMeshes; a++)
- {
- if (GenMeshVertexNormals( pScene->mMeshes[a],a))
- bHas = true;
- }
-
- if (bHas) {
- DefaultLogger::get()->info("GenVertexNormalsProcess finished. "
- "Vertex normals have been calculated");
- }
- else DefaultLogger::get()->debug("GenVertexNormalsProcess finished. "
- "Normals are already there");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Executes the post processing step on the given imported data.
-bool GenVertexNormalsProcess::GenMeshVertexNormals (aiMesh* pMesh, unsigned int meshIndex)
-{
- if (NULL != pMesh->mNormals)
- return false;
-
- // If the mesh consists of lines and/or points but not of
- // triangles or higher-order polygons the normal vectors
- // are undefined.
- if (!(pMesh->mPrimitiveTypes & (aiPrimitiveType_TRIANGLE | aiPrimitiveType_POLYGON)))
- {
- DefaultLogger::get()->info("Normal vectors are undefined for line and point meshes");
- return false;
- }
-
- // Allocate the array to hold the output normals
- const float qnan = std::numeric_limits<float>::quiet_NaN();
- pMesh->mNormals = new aiVector3D[pMesh->mNumVertices];
-
- // Compute per-face normals but store them per-vertex
- for ( unsigned int a = 0; a < pMesh->mNumFaces; a++)
- {
- const aiFace& face = pMesh->mFaces[a];
- if (face.mNumIndices < 3)
- {
- // either a point or a line -> no normal vector
- for (unsigned int i = 0;i < face.mNumIndices;++i)
- pMesh->mNormals[face.mIndices[i]] = qnan;
- continue;
- }
-
- aiVector3D* pV1 = &pMesh->mVertices[face.mIndices[0]];
- aiVector3D* pV2 = &pMesh->mVertices[face.mIndices[1]];
- aiVector3D* pV3 = &pMesh->mVertices[face.mIndices[face.mNumIndices-1]];
- aiVector3D vNor = ((*pV2 - *pV1) ^ (*pV3 - *pV1)).Normalize();
-
- for (unsigned int i = 0;i < face.mNumIndices;++i)
- pMesh->mNormals[face.mIndices[i]] = vNor;
- }
-
- // Set up a SpatialSort to quickly find all vertices close to a given position
- // check whether we can reuse the SpatialSort of a previous step.
- SpatialSort* vertexFinder = NULL;
- SpatialSort _vertexFinder;
- float posEpsilon = 1e-5f;
- if (shared) {
- std::vector<std::pair<SpatialSort,float> >* avf;
- shared->GetProperty(AI_SPP_SPATIAL_SORT,avf);
- if (avf)
- {
- std::pair<SpatialSort,float>& blubb = avf->operator [] (meshIndex);
- vertexFinder = &blubb.first;
- posEpsilon = blubb.second;
- }
- }
- if (!vertexFinder) {
- _vertexFinder.Fill(pMesh->mVertices, pMesh->mNumVertices, sizeof( aiVector3D));
- vertexFinder = &_vertexFinder;
- posEpsilon = ComputePositionEpsilon(pMesh);
- }
- std::vector<unsigned int> verticesFound;
- aiVector3D* pcNew = new aiVector3D[pMesh->mNumVertices];
-
- if (configMaxAngle >= AI_DEG_TO_RAD( 175.f )) {
- // There is no angle limit. Thus all vertices with positions close
- // to each other will receive the same vertex normal. This allows us
- // to optimize the whole algorithm a little bit ...
- std::vector<bool> abHad(pMesh->mNumVertices,false);
- for (unsigned int i = 0; i < pMesh->mNumVertices;++i) {
- if (abHad[i])continue;
-
- // Get all vertices that share this one ...
- vertexFinder->FindPositions( pMesh->mVertices[i], posEpsilon, verticesFound);
-
- aiVector3D pcNor;
- for (unsigned int a = 0; a < verticesFound.size(); ++a) {
- const aiVector3D& v = pMesh->mNormals[verticesFound[a]];
- if (is_not_qnan(v.x))pcNor += v;
- }
- pcNor.Normalize();
-
- // Write the smoothed normal back to all affected normals
- for (unsigned int a = 0; a < verticesFound.size(); ++a)
- {
- register unsigned int vidx = verticesFound[a];
- pcNew[vidx] = pcNor;
- abHad[vidx] = true;
- }
- }
- }
- // Slower code path if a smooth angle is set. There are many ways to achieve
- // the effect, this one is the most straightforward one.
- else {
- const float fLimit = ::cos(configMaxAngle);
- for (unsigned int i = 0; i < pMesh->mNumVertices;++i) {
- // Get all vertices that share this one ...
- vertexFinder->FindPositions( pMesh->mVertices[i] , posEpsilon, verticesFound);
-
- aiVector3D pcNor;
- for (unsigned int a = 0; a < verticesFound.size(); ++a) {
- const aiVector3D& v = pMesh->mNormals[verticesFound[a]];
-
- // check whether the angle between the two normals is not too large
- // HACK: if v.x is qnan the dot product will become qnan, too
- // therefore the comparison against fLimit should be false
- // in every case.
- if (v * pMesh->mNormals[i] < fLimit)
- continue;
-
- pcNor += v;
- }
- pcNew[i] = pcNor.Normalize();
- }
- }
-
- delete[] pMesh->mNormals;
- pMesh->mNormals = pcNew;
-
- return true;
-}
diff --git a/3rdparty/assimp/code/GenVertexNormalsProcess.h b/3rdparty/assimp/code/GenVertexNormalsProcess.h
deleted file mode 100644
index 294cb7ef..00000000
--- a/3rdparty/assimp/code/GenVertexNormalsProcess.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file Defines a post processing step to compute vertex normals
- for all loaded vertizes */
-#ifndef AI_GENVERTEXNORMALPROCESS_H_INC
-#define AI_GENVERTEXNORMALPROCESS_H_INC
-
-#include "BaseProcess.h"
-#include "../include/aiMesh.h"
-
-class GenNormalsTest;
-
-namespace Assimp {
-
-// ---------------------------------------------------------------------------
-/** The GenFaceNormalsProcess computes vertex normals for all vertizes
-*/
-class ASSIMP_API GenVertexNormalsProcess : public BaseProcess
-{
- friend class Importer;
- friend class ::GenNormalsTest;
-
-protected:
- /** Constructor to be privately used by Importer */
- GenVertexNormalsProcess();
-
- /** Destructor, private as well */
- ~GenVertexNormalsProcess();
-
-public:
- // -------------------------------------------------------------------
- /** Returns whether the processing step is present in the given flag.
- * @param pFlags The processing flags the importer was called with.
- * A bitwise combination of #aiPostProcessSteps.
- * @return true if the process is present in this flag fields,
- * false if not.
- */
- bool IsActive( unsigned int pFlags) const;
-
- // -------------------------------------------------------------------
- /** Called prior to ExecuteOnScene().
- * The function is a request to the process to update its configuration
- * basing on the Importer's configuration property list.
- */
- void SetupProperties(const Importer* pImp);
-
- // -------------------------------------------------------------------
- /** Executes the post processing step on the given imported data.
- * At the moment a process is not supposed to fail.
- * @param pScene The imported data to work at.
- */
- void Execute( aiScene* pScene);
-
-
- // setter for configMaxAngle
- inline void SetMaxSmoothAngle(float f)
- {
- configMaxAngle =f;
- }
-
-protected:
-
- // -------------------------------------------------------------------
- /** Computes normals for a specific mesh
- * @param pcMesh Mesh
- * @param meshIndex Index of the mesh
- * @return true if vertex normals have been computed
- */
- bool GenMeshVertexNormals (aiMesh* pcMesh, unsigned int meshIndex);
-
-private:
-
- /** Configuration option: maximum smoothing angle, in radians*/
- float configMaxAngle;
-};
-
-} // end of namespace Assimp
-
-#endif // !!AI_GENVERTEXNORMALPROCESS_H_INC
-
diff --git a/3rdparty/assimp/code/GenericProperty.h b/3rdparty/assimp/code/GenericProperty.h
deleted file mode 100644
index ccc504a6..00000000
--- a/3rdparty/assimp/code/GenericProperty.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-#ifndef AI_GENERIC_PROPERTY_H_INCLUDED
-#define AI_GENERIC_PROPERTY_H_INCLUDED
-
-#include "./../include/assimp.hpp"
-#include "Hash.h"
-
-// ------------------------------------------------------------------------------------------------
-template <class T>
-inline void SetGenericProperty(std::map< unsigned int, T >& list,
- const char* szName, const T& value, bool* bWasExisting = NULL)
-{
- ai_assert(NULL != szName);
- const uint32_t hash = SuperFastHash(szName);
-
- typename std::map<unsigned int, T>::iterator it = list.find(hash);
- if (it == list.end()) {
- if (bWasExisting)
- *bWasExisting = false;
- list.insert(std::pair<unsigned int, T>( hash, value ));
- return;
- }
- (*it).second = value;
- if (bWasExisting)
- *bWasExisting = true;
-}
-
-// ------------------------------------------------------------------------------------------------
-template <class T>
-inline const T& GetGenericProperty(const std::map< unsigned int, T >& list,
- const char* szName, const T& errorReturn)
-{
- ai_assert(NULL != szName);
- const uint32_t hash = SuperFastHash(szName);
-
- typename std::map<unsigned int, T>::const_iterator it = list.find(hash);
- if (it == list.end())
- return errorReturn;
-
- return (*it).second;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Special version for pointer types - they will be deleted when replaced with another value
-// passing NULL removes the whole property
-template <class T>
-inline void SetGenericPropertyPtr(std::map< unsigned int, T* >& list,
- const char* szName, T* value, bool* bWasExisting = NULL)
-{
- ai_assert(NULL != szName);
- const uint32_t hash = SuperFastHash(szName);
-
- typename std::map<unsigned int, T*>::iterator it = list.find(hash);
- if (it == list.end()) {
- if (bWasExisting)
- *bWasExisting = false;
-
- list.insert(std::pair<unsigned int,T*>( hash, value ));
- return;
- }
- if ((*it).second != value) {
- delete (*it).second;
- (*it).second = value;
- }
- if (!value) {
- list.erase(it);
- }
- if (bWasExisting)
- *bWasExisting = true;
-}
-
-
-#endif // !! AI_GENERIC_PROPERTY_H_INCLUDED
diff --git a/3rdparty/assimp/code/HMPFileData.h b/3rdparty/assimp/code/HMPFileData.h
deleted file mode 100644
index 2d372a06..00000000
--- a/3rdparty/assimp/code/HMPFileData.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-//!
-//! @file Data structures for the 3D Game Studio Heightmap format (HMP)
-//!
-
-namespace Assimp {
-namespace HMP {
-
-#include "./../include/Compiler/pushpack1.h"
-
-// to make it easier for us, we test the magic word against both "endianesses"
-#define AI_HMP_MAGIC_NUMBER_BE_4 AI_MAKE_MAGIC("HMP4")
-#define AI_HMP_MAGIC_NUMBER_LE_4 AI_MAKE_MAGIC("4PMH")
-
-#define AI_HMP_MAGIC_NUMBER_BE_5 AI_MAKE_MAGIC("HMP5")
-#define AI_HMP_MAGIC_NUMBER_LE_5 AI_MAKE_MAGIC("5PMH")
-
-#define AI_HMP_MAGIC_NUMBER_BE_7 AI_MAKE_MAGIC("HMP7")
-#define AI_HMP_MAGIC_NUMBER_LE_7 AI_MAKE_MAGIC("7PMH")
-
-// ---------------------------------------------------------------------------
-/** Data structure for the header of a HMP5 file.
- * This is also used by HMP4 and HMP7, but with modifications
-*/
-struct Header_HMP5
-{
- int8_t ident[4]; // "HMP5"
- int32_t version;
-
- // ignored
- float scale[3];
- float scale_origin[3];
- float boundingradius;
-
- //! Size of one triangle in x direction
- float ftrisize_x;
- //! Size of one triangle in y direction
- float ftrisize_y;
- //! Number of vertices in x direction
- float fnumverts_x;
-
- //! Number of skins in the file
- int32_t numskins;
-
- // can ignore this?
- int32_t skinwidth;
- int32_t skinheight;
-
- //!Number of vertices in the file
- int32_t numverts;
-
- // ignored and zero
- int32_t numtris;
-
- //! only one supported ...
- int32_t numframes;
-
- //! Always 0 ...
- int32_t num_stverts;
- int32_t flags;
- float size;
-} PACK_STRUCT;
-
-// ---------------------------------------------------------------------------
-/** Data structure for a terrain vertex in a HMP4 file
-*/
-struct Vertex_HMP4
-{
- uint16_t p_pos[3];
- uint8_t normals162index;
- uint8_t pad;
-} PACK_STRUCT;
-
-// ---------------------------------------------------------------------------
-/** Data structure for a terrain vertex in a HMP5 file
-*/
-struct Vertex_HMP5
-{
- uint16_t z;
- uint8_t normals162index;
- uint8_t pad;
-} PACK_STRUCT;
-
-// ---------------------------------------------------------------------------
-/** Data structure for a terrain vertex in a HMP7 file
-*/
-struct Vertex_HMP7
-{
- uint16_t z;
- int8_t normal_x,normal_y;
-} PACK_STRUCT;
-
-#include "./../include/Compiler/poppack1.h"
-
-} //! namespace HMP
-} //! namespace Assimp
diff --git a/3rdparty/assimp/code/HMPLoader.cpp b/3rdparty/assimp/code/HMPLoader.cpp
deleted file mode 100644
index dc4dea15..00000000
--- a/3rdparty/assimp/code/HMPLoader.cpp
+++ /dev/null
@@ -1,497 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file Implementation of the MDL importer class */
-
-#include "AssimpPCH.h"
-#ifndef ASSIMP_BUILD_NO_HMP_IMPORTER
-
-// internal headers
-#include "MaterialSystem.h"
-#include "HMPLoader.h"
-#include "MD2FileData.h"
-
-using namespace Assimp;
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-HMPImporter::HMPImporter()
-{
- // nothing to do here
-}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-HMPImporter::~HMPImporter()
-{
- // nothing to do here
-}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the class can handle the format of the given file.
-bool HMPImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool cs) const
-{
- const std::string extension = GetExtension(pFile);
- if (extension == "hmp" )
- return true;
-
- // if check for extension is not enough, check for the magic tokens
- if (!extension.length() || cs) {
- uint32_t tokens[3];
- tokens[0] = AI_HMP_MAGIC_NUMBER_LE_4;
- tokens[1] = AI_HMP_MAGIC_NUMBER_LE_5;
- tokens[2] = AI_HMP_MAGIC_NUMBER_LE_7;
- return CheckMagicToken(pIOHandler,pFile,tokens,3,0);
- }
- return false;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Get list of all file extensions that are handled by this loader
-void HMPImporter::GetExtensionList(std::set<std::string>& extensions)
-{
- extensions.insert("hmp");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Imports the given file into the given scene structure.
-void HMPImporter::InternReadFile( const std::string& pFile,
- aiScene* _pScene, IOSystem* _pIOHandler)
-{
- pScene = _pScene;
- pIOHandler = _pIOHandler;
- boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile));
-
- // Check whether we can read from the file
- if ( file.get() == NULL)
- throw DeadlyImportError( "Failed to open HMP file " + pFile + ".");
-
- // Check whether the HMP file is large enough to contain
- // at least the file header
- const size_t fileSize = file->FileSize();
- if ( fileSize < 50)
- throw DeadlyImportError( "HMP File is too small.");
-
- // Allocate storage and copy the contents of the file to a memory buffer
- std::vector<uint8_t> buffer(fileSize);
- mBuffer = &buffer[0];
- file->Read( (void*)mBuffer, 1, fileSize);
- iFileSize = (unsigned int)fileSize;
-
- // Determine the file subtype and call the appropriate member function
- const uint32_t iMagic = *((uint32_t*)this->mBuffer);
-
- // HMP4 format
- if (AI_HMP_MAGIC_NUMBER_LE_4 == iMagic ||
- AI_HMP_MAGIC_NUMBER_BE_4 == iMagic)
- {
- DefaultLogger::get()->debug("HMP subtype: 3D GameStudio A4, magic word is HMP4");
- InternReadFile_HMP4();
- }
- // HMP5 format
- else if (AI_HMP_MAGIC_NUMBER_LE_5 == iMagic ||
- AI_HMP_MAGIC_NUMBER_BE_5 == iMagic)
- {
- DefaultLogger::get()->debug("HMP subtype: 3D GameStudio A5, magic word is HMP5");
- InternReadFile_HMP5();
- }
- // HMP7 format
- else if (AI_HMP_MAGIC_NUMBER_LE_7 == iMagic ||
- AI_HMP_MAGIC_NUMBER_BE_7 == iMagic)
- {
- DefaultLogger::get()->debug("HMP subtype: 3D GameStudio A7, magic word is HMP7");
- InternReadFile_HMP7();
- }
- else
- {
- // Print the magic word to the logger
- char szBuffer[5];
- szBuffer[0] = ((char*)&iMagic)[0];
- szBuffer[1] = ((char*)&iMagic)[1];
- szBuffer[2] = ((char*)&iMagic)[2];
- szBuffer[3] = ((char*)&iMagic)[3];
- szBuffer[4] = '\0';
-
- // We're definitely unable to load this file
- throw DeadlyImportError( "Unknown HMP subformat " + pFile +
- ". Magic word (" + szBuffer + ") is not known");
- }
-
- // Set the AI_SCENE_FLAGS_TERRAIN bit
- pScene->mFlags |= AI_SCENE_FLAGS_TERRAIN;
-
- // File buffer destructs automatically now
-}
-
-// ------------------------------------------------------------------------------------------------
-void HMPImporter::ValidateHeader_HMP457( )
-{
- const HMP::Header_HMP5* const pcHeader = (const HMP::Header_HMP5*)mBuffer;
-
- if (120 > iFileSize)
- {
- throw DeadlyImportError("HMP file is too small (header size is "
- "120 bytes, this file is smaller)");
- }
-
- if (!pcHeader->ftrisize_x || !pcHeader->ftrisize_y)
- throw DeadlyImportError("Size of triangles in either x or y direction is zero");
-
- if (pcHeader->fnumverts_x < 1.0f || (pcHeader->numverts/pcHeader->fnumverts_x) < 1.0f)
- throw DeadlyImportError("Number of triangles in either x or y direction is zero");
-
- if (!pcHeader->numframes)
- throw DeadlyImportError("There are no frames. At least one should be there");
-
-}
-
-// ------------------------------------------------------------------------------------------------
-void HMPImporter::InternReadFile_HMP4( )
-{
- throw DeadlyImportError("HMP4 is currently not supported");
-}
-
-// ------------------------------------------------------------------------------------------------
-void HMPImporter::InternReadFile_HMP5( )
-{
- // read the file header and skip everything to byte 84
- const HMP::Header_HMP5* pcHeader = (const HMP::Header_HMP5*)mBuffer;
- const unsigned char* szCurrent = (const unsigned char*)(mBuffer+84);
- ValidateHeader_HMP457();
-
- // generate an output mesh
- pScene->mNumMeshes = 1;
- pScene->mMeshes = new aiMesh*[1];
- aiMesh* pcMesh = pScene->mMeshes[0] = new aiMesh();
-
- pcMesh->mMaterialIndex = 0;
- pcMesh->mVertices = new aiVector3D[pcHeader->numverts];
- pcMesh->mNormals = new aiVector3D[pcHeader->numverts];
-
- const unsigned int height = (unsigned int)(pcHeader->numverts / pcHeader->fnumverts_x);
- const unsigned int width = (unsigned int)pcHeader->fnumverts_x;
-
- // generate/load a material for the terrain
- CreateMaterial(szCurrent,&szCurrent);
-
- // goto offset 120, I don't know why ...
- // (fixme) is this the frame header? I assume yes since it starts with 2.
- szCurrent += 36;
- SizeCheck(szCurrent + sizeof(const HMP::Vertex_HMP7)*height*width);
-
- // now load all vertices from the file
- aiVector3D* pcVertOut = pcMesh->mVertices;
- aiVector3D* pcNorOut = pcMesh->mNormals;
- const HMP::Vertex_HMP5* src = (const HMP::Vertex_HMP5*) szCurrent;
- for (unsigned int y = 0; y < height;++y)
- {
- for (unsigned int x = 0; x < width;++x)
- {
- pcVertOut->x = x * pcHeader->ftrisize_x;
- pcVertOut->y = y * pcHeader->ftrisize_y;
- pcVertOut->z = (((float)src->z / 0xffff)-0.5f) * pcHeader->ftrisize_x * 8.0f;
- MD2::LookupNormalIndex(src->normals162index, *pcNorOut );
- ++pcVertOut;++pcNorOut;++src;
- }
- }
-
- // generate texture coordinates if necessary
- if (pcHeader->numskins)
- GenerateTextureCoords(width,height);
-
- // now build a list of faces
- CreateOutputFaceList(width,height);
-
- // there is no nodegraph in HMP files. Simply assign the one mesh
- // (no, not the one ring) to the root node
- pScene->mRootNode = new aiNode();
- pScene->mRootNode->mName.Set("terrain_root");
- pScene->mRootNode->mNumMeshes = 1;
- pScene->mRootNode->mMeshes = new unsigned int[1];
- pScene->mRootNode->mMeshes[0] = 0;
-}
-
-// ------------------------------------------------------------------------------------------------
-void HMPImporter::InternReadFile_HMP7( )
-{
- // read the file header and skip everything to byte 84
- const HMP::Header_HMP5* const pcHeader = (const HMP::Header_HMP5*)mBuffer;
- const unsigned char* szCurrent = (const unsigned char*)(mBuffer+84);
- ValidateHeader_HMP457();
-
- // generate an output mesh
- pScene->mNumMeshes = 1;
- pScene->mMeshes = new aiMesh*[1];
- aiMesh* pcMesh = pScene->mMeshes[0] = new aiMesh();
-
- pcMesh->mMaterialIndex = 0;
- pcMesh->mVertices = new aiVector3D[pcHeader->numverts];
- pcMesh->mNormals = new aiVector3D[pcHeader->numverts];
-
- const unsigned int height = (unsigned int)(pcHeader->numverts / pcHeader->fnumverts_x);
- const unsigned int width = (unsigned int)pcHeader->fnumverts_x;
-
- // generate/load a material for the terrain
- CreateMaterial(szCurrent,&szCurrent);
-
- // goto offset 120, I don't know why ...
- // (fixme) is this the frame header? I assume yes since it starts with 2.
- szCurrent += 36;
-
- SizeCheck(szCurrent + sizeof(const HMP::Vertex_HMP7)*height*width);
-
- // now load all vertices from the file
- aiVector3D* pcVertOut = pcMesh->mVertices;
- aiVector3D* pcNorOut = pcMesh->mNormals;
- const HMP::Vertex_HMP7* src = (const HMP::Vertex_HMP7*) szCurrent;
- for (unsigned int y = 0; y < height;++y)
- {
- for (unsigned int x = 0; x < width;++x)
- {
- pcVertOut->x = x * pcHeader->ftrisize_x;
- pcVertOut->y = y * pcHeader->ftrisize_y;
-
- // FIXME: What exctly is the correct scaling factor to use?
- // possibly pcHeader->scale_origin[2] in combination with a
- // signed interpretation of src->z?
- pcVertOut->z = (((float)src->z / 0xffff)-0.5f) * pcHeader->ftrisize_x * 8.0f;
-
- pcNorOut->x = ((float)src->normal_x / 0x80 ); // * pcHeader->scale_origin[0];
- pcNorOut->y = ((float)src->normal_y / 0x80 ); // * pcHeader->scale_origin[1];
- pcNorOut->z = 1.0f;
- pcNorOut->Normalize();
-
- ++pcVertOut;++pcNorOut;++src;
- }
- }
-
- // generate texture coordinates if necessary
- if (pcHeader->numskins)GenerateTextureCoords(width,height);
-
- // now build a list of faces
- CreateOutputFaceList(width,height);
-
- // there is no nodegraph in HMP files. Simply assign the one mesh
- // (no, not the One Ring) to the root node
- pScene->mRootNode = new aiNode();
- pScene->mRootNode->mName.Set("terrain_root");
- pScene->mRootNode->mNumMeshes = 1;
- pScene->mRootNode->mMeshes = new unsigned int[1];
- pScene->mRootNode->mMeshes[0] = 0;
-}
-
-// ------------------------------------------------------------------------------------------------
-void HMPImporter::CreateMaterial(const unsigned char* szCurrent,
- const unsigned char** szCurrentOut)
-{
- aiMesh* const pcMesh = pScene->mMeshes[0];
- const HMP::Header_HMP5* const pcHeader = (const HMP::Header_HMP5*)mBuffer;
-
- // we don't need to generate texture coordinates if
- // we have no textures in the file ...
- if (pcHeader->numskins)
- {
- pcMesh->mTextureCoords[0] = new aiVector3D[pcHeader->numverts];
- pcMesh->mNumUVComponents[0] = 2;
-
- // now read the first skin and skip all others
- ReadFirstSkin(pcHeader->numskins,szCurrent,&szCurrent);
- }
- else
- {
- // generate a default material
- const int iMode = (int)aiShadingMode_Gouraud;
- MaterialHelper* pcHelper = new MaterialHelper();
- pcHelper->AddProperty<int>(&iMode, 1, AI_MATKEY_SHADING_MODEL);
-
- aiColor3D clr;
- clr.b = clr.g = clr.r = 0.6f;
- pcHelper->AddProperty<aiColor3D>(&clr, 1,AI_MATKEY_COLOR_DIFFUSE);
- pcHelper->AddProperty<aiColor3D>(&clr, 1,AI_MATKEY_COLOR_SPECULAR);
-
- clr.b = clr.g = clr.r = 0.05f;
- pcHelper->AddProperty<aiColor3D>(&clr, 1,AI_MATKEY_COLOR_AMBIENT);
-
- aiString szName;
- szName.Set(AI_DEFAULT_MATERIAL_NAME);
- pcHelper->AddProperty(&szName,AI_MATKEY_NAME);
-
- // add the material to the scene
- pScene->mNumMaterials = 1;
- pScene->mMaterials = new aiMaterial*[1];
- pScene->mMaterials[0] = pcHelper;
- }
- *szCurrentOut = szCurrent;
-}
-
-// ------------------------------------------------------------------------------------------------
-void HMPImporter::CreateOutputFaceList(unsigned int width,unsigned int height)
-{
- aiMesh* const pcMesh = this->pScene->mMeshes[0];
-
- // Allocate enough storage
- pcMesh->mNumFaces = (width-1) * (height-1);
- pcMesh->mFaces = new aiFace[pcMesh->mNumFaces];
-
- pcMesh->mNumVertices = pcMesh->mNumFaces*4;
- aiVector3D* pcVertices = new aiVector3D[pcMesh->mNumVertices];
- aiVector3D* pcNormals = new aiVector3D[pcMesh->mNumVertices];
-
- aiFace* pcFaceOut(pcMesh->mFaces);
- aiVector3D* pcVertOut = pcVertices;
- aiVector3D* pcNorOut = pcNormals;
-
- aiVector3D* pcUVs = pcMesh->mTextureCoords[0] ? new aiVector3D[pcMesh->mNumVertices] : NULL;
- aiVector3D* pcUVOut(pcUVs);
-
- // Build the terrain square
- unsigned int iCurrent = 0;
- for (unsigned int y = 0; y < height-1;++y) {
- for (unsigned int x = 0; x < width-1;++x,++pcFaceOut) {
- pcFaceOut->mNumIndices = 4;
- pcFaceOut->mIndices = new unsigned int[4];
-
- *pcVertOut++ = pcMesh->mVertices[y*width+x];
- *pcVertOut++ = pcMesh->mVertices[(y+1)*width+x];
- *pcVertOut++ = pcMesh->mVertices[(y+1)*width+x+1];
- *pcVertOut++ = pcMesh->mVertices[y*width+x+1];
-
-
- *pcNorOut++ = pcMesh->mNormals[y*width+x];
- *pcNorOut++ = pcMesh->mNormals[(y+1)*width+x];
- *pcNorOut++ = pcMesh->mNormals[(y+1)*width+x+1];
- *pcNorOut++ = pcMesh->mNormals[y*width+x+1];
-
- if (pcMesh->mTextureCoords[0])
- {
- *pcUVOut++ = pcMesh->mTextureCoords[0][y*width+x];
- *pcUVOut++ = pcMesh->mTextureCoords[0][(y+1)*width+x];
- *pcUVOut++ = pcMesh->mTextureCoords[0][(y+1)*width+x+1];
- *pcUVOut++ = pcMesh->mTextureCoords[0][y*width+x+1];
- }
-
- for (unsigned int i = 0; i < 4;++i)
- pcFaceOut->mIndices[i] = iCurrent++;
- }
- }
- delete[] pcMesh->mVertices;
- pcMesh->mVertices = pcVertices;
-
- delete[] pcMesh->mNormals;
- pcMesh->mNormals = pcNormals;
-
- if (pcMesh->mTextureCoords[0])
- {
- delete[] pcMesh->mTextureCoords[0];
- pcMesh->mTextureCoords[0] = pcUVs;
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void HMPImporter::ReadFirstSkin(unsigned int iNumSkins, const unsigned char* szCursor,
- const unsigned char** szCursorOut)
-{
- ai_assert(0 != iNumSkins && NULL != szCursor);
-
- // read the type of the skin ...
- // sometimes we need to skip 12 bytes here, I don't know why ...
- uint32_t iType = *((uint32_t*)szCursor);szCursor += sizeof(uint32_t);
- if (0 == iType)
- {
- szCursor += sizeof(uint32_t) * 2;
- iType = *((uint32_t*)szCursor);szCursor += sizeof(uint32_t);
- if (!iType)
- throw DeadlyImportError("Unable to read HMP7 skin chunk");
-
- }
- // read width and height
- uint32_t iWidth = *((uint32_t*)szCursor); szCursor += sizeof(uint32_t);
- uint32_t iHeight = *((uint32_t*)szCursor); szCursor += sizeof(uint32_t);
-
- // allocate an output material
- MaterialHelper* pcMat = new MaterialHelper();
-
- // read the skin, this works exactly as for MDL7
- ParseSkinLump_3DGS_MDL7(szCursor,&szCursor,
- pcMat,iType,iWidth,iHeight);
-
- // now we need to skip any other skins ...
- for (unsigned int i = 1; i< iNumSkins;++i)
- {
- iType = *((uint32_t*)szCursor); szCursor += sizeof(uint32_t);
- iWidth = *((uint32_t*)szCursor); szCursor += sizeof(uint32_t);
- iHeight = *((uint32_t*)szCursor); szCursor += sizeof(uint32_t);
-
- SkipSkinLump_3DGS_MDL7(szCursor,&szCursor,iType,iWidth,iHeight);
- SizeCheck(szCursor);
- }
-
- // setup the material ...
- pScene->mNumMaterials = 1;
- pScene->mMaterials = new aiMaterial*[1];
- pScene->mMaterials[0] = pcMat;
-
- *szCursorOut = szCursor;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Generate proepr texture coords
-void HMPImporter::GenerateTextureCoords(
- const unsigned int width, const unsigned int height)
-{
- ai_assert(NULL != pScene->mMeshes && NULL != pScene->mMeshes[0] &&
- NULL != pScene->mMeshes[0]->mTextureCoords[0]);
-
- aiVector3D* uv = pScene->mMeshes[0]->mTextureCoords[0];
-
- const float fY = (1.0f / height) + (1.0f / height) / (height-1);
- const float fX = (1.0f / width) + (1.0f / width) / (width-1);
-
- for (unsigned int y = 0; y < height;++y) {
- for (unsigned int x = 0; x < width;++x,++uv) {
- uv->y = fY*y;
- uv->x = fX*x;
- uv->z = 0.0f;
- }
- }
-}
-
-#endif // !! ASSIMP_BUILD_NO_HMP_IMPORTER
diff --git a/3rdparty/assimp/code/HMPLoader.h b/3rdparty/assimp/code/HMPLoader.h
deleted file mode 100644
index fdf84baa..00000000
--- a/3rdparty/assimp/code/HMPLoader.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-/** @file HMPLoader.h
- * @brief Declaration of the HMP importer class
- */
-
-#ifndef AI_HMPLOADER_H_INCLUDED
-#define AI_HMPLOADER_H_INCLUDED
-
-// public ASSIMP headers
-#include "../include/aiTypes.h"
-#include "../include/aiTexture.h"
-#include "../include/aiMaterial.h"
-
-// internal headers
-#include "BaseImporter.h"
-#include "MDLLoader.h"
-#include "HMPFileData.h"
-
-namespace Assimp {
-using namespace HMP;
-
-// ---------------------------------------------------------------------------
-/** Used to load 3D GameStudio HMP files (terrains)
-*/
-class HMPImporter : public MDLImporter
-{
- friend class Importer;
-
-protected:
- /** Constructor to be privately used by Importer */
- HMPImporter();
-
- /** Destructor, private as well */
- ~HMPImporter();
-
-public:
-
- // -------------------------------------------------------------------
- /** Returns whether the class can handle the format of the given file.
- * See BaseImporter::CanRead() for details.
- */
- bool CanRead( const std::string& pFile, IOSystem* pIOHandler,
- bool checkSig) const;
-
-protected:
-
-
- // -------------------------------------------------------------------
- /** Called by Importer::GetExtensionList() for each loaded importer.
- * See BaseImporter::GetExtensionList() for details
- */
- void GetExtensionList(std::set<std::string>& extensions);
-
- // -------------------------------------------------------------------
- /** Imports the given file into the given scene structure.
- * See BaseImporter::InternReadFile() for details
- */
- void InternReadFile( const std::string& pFile, aiScene* pScene,
- IOSystem* pIOHandler);
-
-protected:
-
- // -------------------------------------------------------------------
- /** Import a HMP4 file
- */
- void InternReadFile_HMP4( );
-
- // -------------------------------------------------------------------
- /** Import a HMP5 file
- */
- void InternReadFile_HMP5( );
-
- // -------------------------------------------------------------------
- /** Import a HMP7 file
- */
- void InternReadFile_HMP7( );
-
- // -------------------------------------------------------------------
- /** Validate a HMP 5,4,7 file header
- */
- void ValidateHeader_HMP457( );
-
- // -------------------------------------------------------------------
- /** Try to load one material from the file, if this fails create
- * a default material
- */
- void CreateMaterial(const unsigned char* szCurrent,
- const unsigned char** szCurrentOut);
-
- // -------------------------------------------------------------------
- /** Build a list of output faces and vertices. The function
- * triangulates the height map read from the file
- * \param width Width of the height field
- * \param width Height of the height field
- */
- void CreateOutputFaceList(unsigned int width,unsigned int height);
-
- // -------------------------------------------------------------------
- /** Generate planar texture coordinates for a terrain
- * \param width Width of the terrain, in vertices
- * \param height Height of the terrain, in vertices
- */
- void GenerateTextureCoords(const unsigned int width,
- const unsigned int height);
-
- // -------------------------------------------------------------------
- /** Read the first skin from the file and skip all others ...
- * \param iNumSkins Number of skins in the file
- * \param szCursor Position of the first skin (offset 84)
- */
- void ReadFirstSkin(unsigned int iNumSkins, const unsigned char* szCursor,
- const unsigned char** szCursorOut);
-
-private:
-
-};
-
-} // end of namespace Assimp
-
-#endif // AI_HMPIMPORTER_H_INC
-
diff --git a/3rdparty/assimp/code/HalfLifeFileData.h b/3rdparty/assimp/code/HalfLifeFileData.h
deleted file mode 100644
index b12adf6a..00000000
--- a/3rdparty/assimp/code/HalfLifeFileData.h
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-
-//
-//! @file Definition of in-memory structures for the HL2 MDL file format
-// and for the HalfLife text format (SMD)
-//
-// The specification has been taken from various sources on the internet.
-
-
-#ifndef AI_MDLFILEHELPER2_H_INC
-#define AI_MDLFILEHELPER2_H_INC
-
-#include "./../include/Compiler/pushpack1.h"
-
-#include "MDLFileData.h"
-
-namespace Assimp {
-namespace MDL {
-
-// magic bytes used in Half Life 2 MDL models
-#define AI_MDL_MAGIC_NUMBER_BE_HL2a AI_MAKE_MAGIC("IDST")
-#define AI_MDL_MAGIC_NUMBER_LE_HL2a AI_MAKE_MAGIC("TSDI")
-#define AI_MDL_MAGIC_NUMBER_BE_HL2b AI_MAKE_MAGIC("IDSQ")
-#define AI_MDL_MAGIC_NUMBER_LE_HL2b AI_MAKE_MAGIC("QSDI")
-
-// ---------------------------------------------------------------------------
-/** \struct Header_HL2
- * \brief Data structure for the HL2 main header
- */
-// ---------------------------------------------------------------------------
-struct Header_HL2
-{
- //! magic number: "IDST"/"IDSQ"
- char ident[4];
-
- //! Version number
- int32_t version;
-
- //! Original file name in pak ?
- char name[64];
-
- //! Length of file name/length of file?
- int32_t length;
-
- //! For viewer, ignored
- aiVector3D eyeposition;
- aiVector3D min;
- aiVector3D max;
-
- //! AABB of the model
- aiVector3D bbmin;
- aiVector3D bbmax;
-
- // File flags
- int32_t flags;
-
- //! NUmber of bones contained in the file
- int32_t numbones;
- int32_t boneindex;
-
- //! Number of bone controllers for bone animation
- int32_t numbonecontrollers;
- int32_t bonecontrollerindex;
-
- //! More bounding boxes ...
- int32_t numhitboxes;
- int32_t hitboxindex;
-
- //! Animation sequences in the file
- int32_t numseq;
- int32_t seqindex;
-
- //! Loaded sequences. Ignored
- int32_t numseqgroups;
- int32_t seqgroupindex;
-
- //! Raw texture data
- int32_t numtextures;
- int32_t textureindex;
- int32_t texturedataindex;
-
- //! Number of skins (=textures?)
- int32_t numskinref;
- int32_t numskinfamilies;
- int32_t skinindex;
-
- //! Number of parts
- int32_t numbodyparts;
- int32_t bodypartindex;
-
- //! attachable points for gameplay and physics
- int32_t numattachments;
- int32_t attachmentindex;
-
- //! Table of sound effects associated with the model
- int32_t soundtable;
- int32_t soundindex;
- int32_t soundgroups;
- int32_t soundgroupindex;
-
- //! Number of animation transitions
- int32_t numtransitions;
- int32_t transitionindex;
-} PACK_STRUCT;
-
-#include "./../include/Compiler/poppack1.h"
-
-}
-} // end namespaces
-
-#endif // ! AI_MDLFILEHELPER2_H_INC
diff --git a/3rdparty/assimp/code/Hash.h b/3rdparty/assimp/code/Hash.h
deleted file mode 100644
index 9ba79c51..00000000
--- a/3rdparty/assimp/code/Hash.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-#ifndef AI_HASH_H_INCLUDED
-#define AI_HASH_H_INCLUDED
-
-// ------------------------------------------------------------------------------------------------
-// hashing function taken from
-// http://www.azillionmonkeys.com/qed/hash.html
-// (incremental version of the hashing function)
-// (stdint.h should have been been included here)
-// ------------------------------------------------------------------------------------------------
-#undef get16bits
-#if (defined(__GNUC__) && defined(__i386__)) || defined(__WATCOMC__) \
- || defined(_MSC_VER) || defined (__BORLANDC__) || defined (__TURBOC__)
-#define get16bits(d) (*((const uint16_t *) (d)))
-#endif
-
-#if !defined (get16bits)
-#define get16bits(d) ((((uint32_t)(((const uint8_t *)(d))[1])) << 8)\
- +(uint32_t)(((const uint8_t *)(d))[0]) )
-#endif
-
-// ------------------------------------------------------------------------------------------------
-inline unsigned int SuperFastHash (const char * data, unsigned int len = 0, unsigned int hash = 0) {
-unsigned int tmp;
-int rem;
-
- if (!data) return 0;
- if (!len)len = (unsigned int)::strlen(data);
-
- rem = len & 3;
- len >>= 2;
-
- /* Main loop */
- for (;len > 0; len--) {
- hash += get16bits (data);
- tmp = (get16bits (data+2) << 11) ^ hash;
- hash = (hash << 16) ^ tmp;
- data += 2*sizeof (uint16_t);
- hash += hash >> 11;
- }
-
- /* Handle end cases */
- switch (rem) {
- case 3: hash += get16bits (data);
- hash ^= hash << 16;
- hash ^= data[sizeof (uint16_t)] << 18;
- hash += hash >> 11;
- break;
- case 2: hash += get16bits (data);
- hash ^= hash << 11;
- hash += hash >> 17;
- break;
- case 1: hash += *data;
- hash ^= hash << 10;
- hash += hash >> 1;
- }
-
- /* Force "avalanching" of final 127 bits */
- hash ^= hash << 3;
- hash += hash >> 5;
- hash ^= hash << 4;
- hash += hash >> 17;
- hash ^= hash << 25;
- hash += hash >> 6;
-
- return hash;
-}
-
-#endif // !! AI_HASH_H_INCLUDED
diff --git a/3rdparty/assimp/code/IFF.h b/3rdparty/assimp/code/IFF.h
deleted file mode 100644
index 91d56b34..00000000
--- a/3rdparty/assimp/code/IFF.h
+++ /dev/null
@@ -1,102 +0,0 @@
-
-
-// Definitions for the Interchange File Format (IFF)
-// Alexander Gessler, 2006
-// Adapted to Assimp August 2008
-
-#ifndef AI_IFF_H_INCLUDED
-#define AI_IFF_H_INCLUDED
-
-#include "ByteSwap.h"
-
-namespace Assimp {
-namespace IFF {
-
-#include "./../include/Compiler/pushpack1.h"
-
-/////////////////////////////////////////////////////////////////////////////////
-//! Describes an IFF chunk header
-/////////////////////////////////////////////////////////////////////////////////
-struct ChunkHeader
-{
- //! Type of the chunk header - FourCC
- uint32_t type;
-
- //! Length of the chunk data, in bytes
- uint32_t length;
-} PACK_STRUCT;
-
-
-/////////////////////////////////////////////////////////////////////////////////
-//! Describes an IFF sub chunk header
-/////////////////////////////////////////////////////////////////////////////////
-struct SubChunkHeader
-{
- //! Type of the chunk header - FourCC
- uint32_t type;
-
- //! Length of the chunk data, in bytes
- uint16_t length;
-} PACK_STRUCT;
-
-#include "./../include/Compiler/poppack1.h"
-
-
-#define AI_IFF_FOURCC(a,b,c,d) ((uint32_t) (((uint8_t)a << 24u) | \
- ((uint8_t)b << 16u) | ((uint8_t)c << 8u) | ((uint8_t)d)))
-
-
-#define AI_IFF_FOURCC_FORM AI_IFF_FOURCC('F','O','R','M')
-
-
-/////////////////////////////////////////////////////////////////////////////////
-//! Load a chunk header
-//! @param outFile Pointer to the file data - points to the chunk data afterwards
-//! @return Pointer to the chunk header
-/////////////////////////////////////////////////////////////////////////////////
-inline ChunkHeader* LoadChunk(uint8_t*& outFile)
-{
- ChunkHeader* head = (ChunkHeader*) outFile;
- AI_LSWAP4(head->length);
- AI_LSWAP4(head->type);
- outFile += sizeof(ChunkHeader);
- return head;
-}
-
-/////////////////////////////////////////////////////////////////////////////////
-//! Load a sub chunk header
-//! @param outFile Pointer to the file data - points to the chunk data afterwards
-//! @return Pointer to the sub chunk header
-/////////////////////////////////////////////////////////////////////////////////
-inline SubChunkHeader* LoadSubChunk(uint8_t*& outFile)
-{
- SubChunkHeader* head = (SubChunkHeader*) outFile;
- AI_LSWAP2(head->length);
- AI_LSWAP4(head->type);
- outFile += sizeof(SubChunkHeader);
- return head;
-}
-
-/////////////////////////////////////////////////////////////////////////////////
-//! Read the file header and return the type of the file and its size
-//! @param outFile Pointer to the file data. The buffer must at
-//! least be 12 bytes large.
-//! @param fileType Receives the type of the file
-//! @return 0 if everything was OK, otherwise an error message
-/////////////////////////////////////////////////////////////////////////////////
-inline const char* ReadHeader(uint8_t* outFile,uint32_t& fileType)
-{
- ChunkHeader* head = LoadChunk(outFile);
- if (AI_IFF_FOURCC_FORM != head->type)
- {
- return "The file is not an IFF file: FORM chunk is missing";
- }
- fileType = *((uint32_t*)(head+1));
- AI_LSWAP4(fileType);
- return 0;
-}
-
-
-}}
-
-#endif // !! AI_IFF_H_INCLUDED
diff --git a/3rdparty/assimp/code/IRRLoader.cpp b/3rdparty/assimp/code/IRRLoader.cpp
deleted file mode 100644
index 1498c9ee..00000000
--- a/3rdparty/assimp/code/IRRLoader.cpp
+++ /dev/null
@@ -1,1462 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file IRRLoader.cpp
- * @brief Implementation of the Irr importer class
- */
-
-#include "AssimpPCH.h"
-
-#include "IRRLoader.h"
-#include "ParsingUtils.h"
-#include "fast_atof.h"
-#include "GenericProperty.h"
-
-#include "SceneCombiner.h"
-#include "StandardShapes.h"
-
-
-// We need boost::common_factor to compute the lcm/gcd of a number
-#include <boost/math/common_factor_rt.hpp>
-
-using namespace Assimp;
-using namespace irr;
-using namespace irr::io;
-
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-IRRImporter::IRRImporter()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-IRRImporter::~IRRImporter()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the class can handle the format of the given file.
-bool IRRImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const
-{
- /* NOTE: A simple check for the file extension is not enough
- * here. Irrmesh and irr are easy, but xml is too generic
- * and could be collada, too. So we need to open the file and
- * search for typical tokens.
- */
- const std::string extension = GetExtension(pFile);
-
- if (extension == "irr")return true;
- else if (extension == "xml" || checkSig)
- {
- /* If CanRead() is called in order to check whether we
- * support a specific file extension in general pIOHandler
- * might be NULL and it's our duty to return true here.
- */
- if (!pIOHandler)return true;
- const char* tokens[] = {"irr_scene"};
- return SearchFileHeaderForToken(pIOHandler,pFile,tokens,1);
- }
- return false;
-}
-
-// ------------------------------------------------------------------------------------------------
-void IRRImporter::GetExtensionList(std::set<std::string>& extensions)
-{
- extensions.insert("irr");
- extensions.insert("xml");
-}
-
-// ------------------------------------------------------------------------------------------------
-void IRRImporter::SetupProperties(const Importer* pImp)
-{
- // read the output frame rate of all node animation channels
- fps = pImp->GetPropertyInteger(AI_CONFIG_IMPORT_IRR_ANIM_FPS,100);
- if (fps < 10.) {
- DefaultLogger::get()->error("IRR: Invalid FPS configuration");
- fps = 100;
- }
-
- // AI_CONFIG_FAVOUR_SPEED
- configSpeedFlag = (0 != pImp->GetPropertyInteger(AI_CONFIG_FAVOUR_SPEED,0));
-}
-
-// ------------------------------------------------------------------------------------------------
-// Build a mesh tha consists of a single squad (a side of a skybox)
-aiMesh* IRRImporter::BuildSingleQuadMesh(const SkyboxVertex& v1,
- const SkyboxVertex& v2,
- const SkyboxVertex& v3,
- const SkyboxVertex& v4)
-{
- // allocate and prepare the mesh
- aiMesh* out = new aiMesh();
-
- out->mPrimitiveTypes = aiPrimitiveType_POLYGON;
- out->mNumFaces = 1;
-
- // build the face
- out->mFaces = new aiFace[1];
- aiFace& face = out->mFaces[0];
-
- face.mNumIndices = 4;
- face.mIndices = new unsigned int[4];
- for (unsigned int i = 0; i < 4;++i)
- face.mIndices[i] = i;
-
- out->mNumVertices = 4;
-
- // copy vertex positions
- aiVector3D* vec = out->mVertices = new aiVector3D[4];
- *vec++ = v1.position;
- *vec++ = v2.position;
- *vec++ = v3.position;
- *vec = v4.position;
-
- // copy vertex normals
- vec = out->mNormals = new aiVector3D[4];
- *vec++ = v1.normal;
- *vec++ = v2.normal;
- *vec++ = v3.normal;
- *vec = v4.normal;
-
- // copy texture coordinates
- vec = out->mTextureCoords[0] = new aiVector3D[4];
- *vec++ = v1.uv;
- *vec++ = v2.uv;
- *vec++ = v3.uv;
- *vec = v4.uv;
- return out;
-}
-
-// ------------------------------------------------------------------------------------------------
-void IRRImporter::BuildSkybox(std::vector<aiMesh*>& meshes, std::vector<aiMaterial*> materials)
-{
- // Update the material of the skybox - replace the name and disable shading for skyboxes.
- for (unsigned int i = 0; i < 6;++i) {
- MaterialHelper* out = ( MaterialHelper* ) (*(materials.end()-(6-i)));
-
- aiString s;
- s.length = ::sprintf( s.data, "SkyboxSide_%i",i );
- out->AddProperty(&s,AI_MATKEY_NAME);
-
- int shading = aiShadingMode_NoShading;
- out->AddProperty(&shading,1,AI_MATKEY_SHADING_MODEL);
- }
-
- // Skyboxes are much more difficult. They are represented
- // by six single planes with different textures, so we'll
- // need to build six meshes.
-
- const float l = 10.f; // the size used by Irrlicht
-
- // FRONT SIDE
- meshes.push_back( BuildSingleQuadMesh(
- SkyboxVertex(-l,-l,-l, 0, 0, 1, 1.f,1.f),
- SkyboxVertex( l,-l,-l, 0, 0, 1, 0.f,1.f),
- SkyboxVertex( l, l,-l, 0, 0, 1, 0.f,0.f),
- SkyboxVertex(-l, l,-l, 0, 0, 1, 1.f,0.f)) );
- meshes.back()->mMaterialIndex = materials.size()-6u;
-
- // LEFT SIDE
- meshes.push_back( BuildSingleQuadMesh(
- SkyboxVertex( l,-l,-l, -1, 0, 0, 1.f,1.f),
- SkyboxVertex( l,-l, l, -1, 0, 0, 0.f,1.f),
- SkyboxVertex( l, l, l, -1, 0, 0, 0.f,0.f),
- SkyboxVertex( l, l,-l, -1, 0, 0, 1.f,0.f)) );
- meshes.back()->mMaterialIndex = materials.size()-5u;
-
- // BACK SIDE
- meshes.push_back( BuildSingleQuadMesh(
- SkyboxVertex( l,-l, l, 0, 0, -1, 1.f,1.f),
- SkyboxVertex(-l,-l, l, 0, 0, -1, 0.f,1.f),
- SkyboxVertex(-l, l, l, 0, 0, -1, 0.f,0.f),
- SkyboxVertex( l, l, l, 0, 0, -1, 1.f,0.f)) );
- meshes.back()->mMaterialIndex = materials.size()-4u;
-
- // RIGHT SIDE
- meshes.push_back( BuildSingleQuadMesh(
- SkyboxVertex(-l,-l, l, 1, 0, 0, 1.f,1.f),
- SkyboxVertex(-l,-l,-l, 1, 0, 0, 0.f,1.f),
- SkyboxVertex(-l, l,-l, 1, 0, 0, 0.f,0.f),
- SkyboxVertex(-l, l, l, 1, 0, 0, 1.f,0.f)) );
- meshes.back()->mMaterialIndex = materials.size()-3u;
-
- // TOP SIDE
- meshes.push_back( BuildSingleQuadMesh(
- SkyboxVertex( l, l,-l, 0, -1, 0, 1.f,1.f),
- SkyboxVertex( l, l, l, 0, -1, 0, 0.f,1.f),
- SkyboxVertex(-l, l, l, 0, -1, 0, 0.f,0.f),
- SkyboxVertex(-l, l,-l, 0, -1, 0, 1.f,0.f)) );
- meshes.back()->mMaterialIndex = materials.size()-2u;
-
- // BOTTOM SIDE
- meshes.push_back( BuildSingleQuadMesh(
- SkyboxVertex( l,-l, l, 0, 1, 0, 0.f,0.f),
- SkyboxVertex( l,-l,-l, 0, 1, 0, 1.f,0.f),
- SkyboxVertex(-l,-l,-l, 0, 1, 0, 1.f,1.f),
- SkyboxVertex(-l,-l, l, 0, 1, 0, 0.f,1.f)) );
- meshes.back()->mMaterialIndex = materials.size()-1u;
-}
-
-// ------------------------------------------------------------------------------------------------
-void IRRImporter::CopyMaterial(std::vector<aiMaterial*>& materials,
- std::vector< std::pair<aiMaterial*, unsigned int> >& inmaterials,
- unsigned int& defMatIdx,
- aiMesh* mesh)
-{
- if (inmaterials.empty()) {
- // Do we have a default material? If not we need to create one
- if (0xffffffff == defMatIdx)
- {
- defMatIdx = (unsigned int)materials.size();
- MaterialHelper* mat = new MaterialHelper();
-
- aiString s;
- s.Set(AI_DEFAULT_MATERIAL_NAME);
- mat->AddProperty(&s,AI_MATKEY_NAME);
-
- aiColor3D c(0.6f,0.6f,0.6f);
- mat->AddProperty(&c,1,AI_MATKEY_COLOR_DIFFUSE);
- }
- mesh->mMaterialIndex = defMatIdx;
- return;
- }
- else if (inmaterials.size() > 1) {
- DefaultLogger::get()->info("IRR: Skipping additional materials");
- }
-
- mesh->mMaterialIndex = (unsigned int)materials.size();
- materials.push_back(inmaterials[0].first);
-}
-
-
-// ------------------------------------------------------------------------------------------------
-inline int ClampSpline(int idx, int size)
-{
- return ( idx<0 ? size+idx : ( idx>=size ? idx-size : idx ) );
-}
-
-// ------------------------------------------------------------------------------------------------
-inline void FindSuitableMultiple(int& angle)
-{
- if (angle < 3)angle = 3;
- else if (angle < 10) angle = 10;
- else if (angle < 20) angle = 20;
- else if (angle < 30) angle = 30;
- else
- {
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void IRRImporter::ComputeAnimations(Node* root, aiNode* real, std::vector<aiNodeAnim*>& anims)
-{
- ai_assert(NULL != root && NULL != real);
-
- // XXX totally WIP - doesn't produce proper results, need to evaluate
- // whether there's any use for Irrlicht's proprietary scene format
- // outside Irrlicht ...
-
- if (root->animators.empty()) {
- return;
- }
- unsigned int total = 0;
- for (std::list<Animator>::iterator it = root->animators.begin();it != root->animators.end(); ++it) {
- if ((*it).type == Animator::UNKNOWN || (*it).type == Animator::OTHER) {
- DefaultLogger::get()->warn("IRR: Skipping unknown or unsupported animator");
- continue;
- }
- ++total;
- }
- if (!total)return;
- else if (1 == total) {
- DefaultLogger::get()->warn("IRR: Adding dummy nodes to simulate multiple animators");
- }
-
- // NOTE: 1 tick == i millisecond
-
- unsigned int cur = 0;
- for (std::list<Animator>::iterator it = root->animators.begin();
- it != root->animators.end(); ++it)
- {
- if ((*it).type == Animator::UNKNOWN || (*it).type == Animator::OTHER)continue;
-
- Animator& in = *it ;
- aiNodeAnim* anim = new aiNodeAnim();
-
- if (cur != total-1) {
- // Build a new name - a prefix instead of a suffix because it is
- // easier to check against
- anim->mNodeName.length = ::sprintf(anim->mNodeName.data,
- "$INST_DUMMY_%i_%s",total-1,
- (root->name.length() ? root->name.c_str() : ""));
-
- // we'll also need to insert a dummy in the node hierarchy.
- aiNode* dummy = new aiNode();
-
- for (unsigned int i = 0; i < real->mParent->mNumChildren;++i)
- if (real->mParent->mChildren[i] == real)
- real->mParent->mChildren[i] = dummy;
-
- dummy->mParent = real->mParent;
- dummy->mName = anim->mNodeName;
-
- dummy->mNumChildren = 1;
- dummy->mChildren = new aiNode*[dummy->mNumChildren];
- dummy->mChildren[0] = real;
-
- // the transformation matrix of the dummy node is the identity
-
- real->mParent = dummy;
- }
- else anim->mNodeName.Set(root->name);
- ++cur;
-
- switch (in.type) {
- case Animator::ROTATION:
- {
- // -----------------------------------------------------
- // find out how long a full rotation will take
- // This is the least common multiple of 360.f and all
- // three euler angles. Although we'll surely find a
- // possible multiple (haha) it could be somewhat large
- // for our purposes. So we need to modify the angles
- // here in order to get good results.
- // -----------------------------------------------------
- int angles[3];
- angles[0] = (int)(in.direction.x*100);
- angles[1] = (int)(in.direction.y*100);
- angles[2] = (int)(in.direction.z*100);
-
- angles[0] %= 360;
- angles[1] %= 360;
- angles[2] %= 360;
-
- if ((angles[0]*angles[1]) && (angles[1]*angles[2]))
- {
- FindSuitableMultiple(angles[0]);
- FindSuitableMultiple(angles[1]);
- FindSuitableMultiple(angles[2]);
- }
-
- int lcm = 360;
-
- if (angles[0])
- lcm = boost::math::lcm(lcm,angles[0]);
-
- if (angles[1])
- lcm = boost::math::lcm(lcm,angles[1]);
-
- if (angles[2])
- lcm = boost::math::lcm(lcm,angles[2]);
-
- if (360 == lcm)
- break;
-
-#if 0
- // This can be a division through zero, but we don't care
- float f1 = (float)lcm / angles[0];
- float f2 = (float)lcm / angles[1];
- float f3 = (float)lcm / angles[2];
-#endif
-
- // find out how many time units we'll need for the finest
- // track (in seconds) - this defines the number of output
- // keys (fps * seconds)
- float max = 0.f;
- if (angles[0])
- max = (float)lcm / angles[0];
- if (angles[1])
- max = std::max(max, (float)lcm / angles[1]);
- if (angles[2])
- max = std::max(max, (float)lcm / angles[2]);
-
- anim->mNumRotationKeys = (unsigned int)(max*fps);
- anim->mRotationKeys = new aiQuatKey[anim->mNumRotationKeys];
-
- // begin with a zero angle
- aiVector3D angle;
- for (unsigned int i = 0; i < anim->mNumRotationKeys;++i)
- {
- // build the quaternion for the given euler angles
- aiQuatKey& q = anim->mRotationKeys[i];
-
- q.mValue = aiQuaternion(angle.x, angle.y, angle.z);
- q.mTime = (double)i;
-
- // increase the angle
- angle += in.direction;
- }
-
- // This animation is repeated and repeated ...
- anim->mPostState = anim->mPreState = aiAnimBehaviour_REPEAT;
- }
- break;
-
- case Animator::FLY_CIRCLE:
- {
- // -----------------------------------------------------
- // Find out how much time we'll need to perform a
- // full circle.
- // -----------------------------------------------------
- const double seconds = (1. / in.speed) / 1000.;
- const double tdelta = 1000. / fps;
-
- anim->mNumPositionKeys = (unsigned int) (fps * seconds);
- anim->mPositionKeys = new aiVectorKey[anim->mNumPositionKeys];
-
- // from Irrlicht, what else should we do than copying it?
- aiVector3D vecU,vecV;
- if (in.direction.y) {
- vecV = aiVector3D(50,0,0) ^ in.direction;
- }
- else vecV = aiVector3D(0,50,00) ^ in.direction;
- vecV.Normalize();
- vecU = (vecV ^ in.direction).Normalize();
-
- // build the output keys
- for (unsigned int i = 0; i < anim->mNumPositionKeys;++i) {
- aiVectorKey& key = anim->mPositionKeys[i];
- key.mTime = i * tdelta;
-
- const float t = (float) ( in.speed * key.mTime );
- key.mValue = in.circleCenter + in.circleRadius * ((vecU*::cos(t)) + (vecV*::sin(t)));
- }
-
- // This animation is repeated and repeated ...
- anim->mPostState = anim->mPreState = aiAnimBehaviour_REPEAT;
- }
- break;
-
- case Animator::FLY_STRAIGHT:
- {
- anim->mPostState = anim->mPreState = (in.loop ? aiAnimBehaviour_REPEAT : aiAnimBehaviour_CONSTANT);
- const double seconds = in.timeForWay / 1000.;
- const double tdelta = 1000. / fps;
-
- anim->mNumPositionKeys = (unsigned int) (fps * seconds);
- anim->mPositionKeys = new aiVectorKey[anim->mNumPositionKeys];
-
- aiVector3D diff = in.direction - in.circleCenter;
- const float lengthOfWay = diff.Length();
- diff.Normalize();
-
- const double timeFactor = lengthOfWay / in.timeForWay;
-
- // build the output keys
- for (unsigned int i = 0; i < anim->mNumPositionKeys;++i) {
- aiVectorKey& key = anim->mPositionKeys[i];
- key.mTime = i * tdelta;
- key.mValue = in.circleCenter + diff * float(timeFactor * key.mTime);
- }
- }
- break;
-
- case Animator::FOLLOW_SPLINE:
- {
- // repeat outside the defined time range
- anim->mPostState = anim->mPreState = aiAnimBehaviour_REPEAT;
- const int size = (int)in.splineKeys.size();
- if (!size) {
- // We have no point in the spline. That's bad. Really bad.
- DefaultLogger::get()->warn("IRR: Spline animators with no points defined");
-
- delete anim;anim = NULL;
- break;
- }
- else if (size == 1) {
- // We have just one point in the spline so we don't need the full calculation
- anim->mNumPositionKeys = 1;
- anim->mPositionKeys = new aiVectorKey[anim->mNumPositionKeys];
-
- anim->mPositionKeys[0].mValue = in.splineKeys[0].mValue;
- anim->mPositionKeys[0].mTime = 0.f;
- break;
- }
-
- unsigned int ticksPerFull = 15;
- anim->mNumPositionKeys = (unsigned int) ( ticksPerFull * fps );
- anim->mPositionKeys = new aiVectorKey[anim->mNumPositionKeys];
-
- for (unsigned int i = 0; i < anim->mNumPositionKeys;++i)
- {
- aiVectorKey& key = anim->mPositionKeys[i];
-
- const float dt = (i * in.speed * 0.001f );
- const float u = dt - floor(dt);
- const int idx = (int)floor(dt) % size;
-
- // get the 4 current points to evaluate the spline
- const aiVector3D& p0 = in.splineKeys[ ClampSpline( idx - 1, size ) ].mValue;
- const aiVector3D& p1 = in.splineKeys[ ClampSpline( idx + 0, size ) ].mValue;
- const aiVector3D& p2 = in.splineKeys[ ClampSpline( idx + 1, size ) ].mValue;
- const aiVector3D& p3 = in.splineKeys[ ClampSpline( idx + 2, size ) ].mValue;
-
- // compute polynomials
- const float u2 = u*u;
- const float u3 = u2*2;
-
- const float h1 = 2.0f * u3 - 3.0f * u2 + 1.0f;
- const float h2 = -2.0f * u3 + 3.0f * u3;
- const float h3 = u3 - 2.0f * u3;
- const float h4 = u3 - u2;
-
- // compute the spline tangents
- const aiVector3D t1 = ( p2 - p0 ) * in.tightness;
- aiVector3D t2 = ( p3 - p1 ) * in.tightness;
-
- // and use them to get the interpolated point
- t2 = (h1 * p1 + p2 * h2 + t1 * h3 + h4 * t2);
-
- // build a simple translation matrix from it
- key.mValue = t2.x;
- key.mTime = (double) i;
- }
- }
- break;
- default:
- // UNKNOWN , OTHER
- break;
- };
- if (anim) {
- anims.push_back(anim);
- ++total;
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// This function is maybe more generic than we'd need it here
-void SetupMapping (MaterialHelper* mat, aiTextureMapping mode, const aiVector3D& axis = aiVector3D(0.f,0.f,-1.f))
-{
- // Check whether there are texture properties defined - setup
- // the desired texture mapping mode for all of them and ignore
- // all UV settings we might encounter. WE HAVE NO UVS!
-
- std::vector<aiMaterialProperty*> p;
- p.reserve(mat->mNumProperties+1);
-
- for (unsigned int i = 0; i < mat->mNumProperties;++i)
- {
- aiMaterialProperty* prop = mat->mProperties[i];
- if (!::strcmp( prop->mKey.data, "$tex.file")) {
- // Setup the mapping key
- aiMaterialProperty* m = new aiMaterialProperty();
- m->mKey.Set("$tex.mapping");
- m->mIndex = prop->mIndex;
- m->mSemantic = prop->mSemantic;
- m->mType = aiPTI_Integer;
-
- m->mDataLength = 4;
- m->mData = new char[4];
- *((int*)m->mData) = mode;
-
- p.push_back(prop);
- p.push_back(m);
-
- // Setup the mapping axis
- if (mode == aiTextureMapping_CYLINDER || mode == aiTextureMapping_PLANE || mode == aiTextureMapping_SPHERE) {
- m = new aiMaterialProperty();
- m->mKey.Set("$tex.mapaxis");
- m->mIndex = prop->mIndex;
- m->mSemantic = prop->mSemantic;
- m->mType = aiPTI_Float;
-
- m->mDataLength = 12;
- m->mData = new char[12];
- *((aiVector3D*)m->mData) = axis;
- p.push_back(m);
- }
- }
- else if (! ::strcmp( prop->mKey.data, "$tex.uvwsrc")) {
- delete mat->mProperties[i];
- }
- else p.push_back(prop);
- }
-
- if (p.empty())return;
-
- // rebuild the output array
- if (p.size() > mat->mNumAllocated) {
- delete[] mat->mProperties;
- mat->mProperties = new aiMaterialProperty*[p.size()*2];
-
- mat->mNumAllocated = p.size()*2;
- }
- mat->mNumProperties = (unsigned int)p.size();
- ::memcpy(mat->mProperties,&p[0],sizeof(void*)*mat->mNumProperties);
-}
-
-// ------------------------------------------------------------------------------------------------
-void IRRImporter::GenerateGraph(Node* root,aiNode* rootOut ,aiScene* scene,
- BatchLoader& batch,
- std::vector<aiMesh*>& meshes,
- std::vector<aiNodeAnim*>& anims,
- std::vector<AttachmentInfo>& attach,
- std::vector<aiMaterial*>& materials,
- unsigned int& defMatIdx)
-{
- unsigned int oldMeshSize = (unsigned int)meshes.size();
- //unsigned int meshTrafoAssign = 0;
-
- // Now determine the type of the node
- switch (root->type)
- {
- case Node::ANIMMESH:
- case Node::MESH:
- {
- if (!root->meshPath.length())
- break;
-
- // Get the loaded mesh from the scene and add it to
- // the list of all scenes to be attached to the
- // graph we're currently building
- aiScene* scene = batch.GetImport(root->id);
- if (!scene) {
- DefaultLogger::get()->error("IRR: Unable to load external file: " + root->meshPath);
- break;
- }
- attach.push_back(AttachmentInfo(scene,rootOut));
-
- // Now combine the material we've loaded for this mesh
- // with the real materials we got from the file. As we
- // don't execute any pp-steps on the file, the numbers
- // should be equal. If they are not, we can impossibly
- // do this ...
- if (root->materials.size() != (unsigned int)scene->mNumMaterials) {
- DefaultLogger::get()->warn("IRR: Failed to match imported materials "
- "with the materials found in the IRR scene file");
-
- break;
- }
- for (unsigned int i = 0; i < scene->mNumMaterials;++i) {
- // Delete the old material, we don't need it anymore
- delete scene->mMaterials[i];
-
- std::pair<aiMaterial*, unsigned int>& src = root->materials[i];
- scene->mMaterials[i] = src.first;
- }
-
- // NOTE: Each mesh should have exactly one material assigned,
- // but we do it in a separate loop if this behaviour changes
- // in future.
- for (unsigned int i = 0; i < scene->mNumMeshes;++i) {
- // Process material flags
- aiMesh* mesh = scene->mMeshes[i];
-
-
- // If "trans_vertex_alpha" mode is enabled, search all vertex colors
- // and check whether they have a common alpha value. This is quite
- // often the case so we can simply extract it to a shared oacity
- // value.
- std::pair<aiMaterial*, unsigned int>& src = root->materials[mesh->mMaterialIndex];
- MaterialHelper* mat = (MaterialHelper*)src.first;
-
- if (mesh->HasVertexColors(0) && src.second & AI_IRRMESH_MAT_trans_vertex_alpha)
- {
- bool bdo = true;
- for (unsigned int a = 1; a < mesh->mNumVertices;++a) {
-
- if (mesh->mColors[0][a].a != mesh->mColors[0][a-1].a) {
- bdo = false;
- break;
- }
- }
- if (bdo) {
- DefaultLogger::get()->info("IRR: Replacing mesh vertex alpha with common opacity");
-
- for (unsigned int a = 0; a < mesh->mNumVertices;++a)
- mesh->mColors[0][a].a = 1.f;
-
- mat->AddProperty(& mesh->mColors[0][0].a, 1, AI_MATKEY_OPACITY);
- }
- }
-
- // If we have a second texture coordinate set and a second texture
- // (either lightmap, normalmap, 2layered material) we need to
- // setup the correct UV index for it. The texture can either
- // be diffuse (lightmap & 2layer) or a normal map (normal & parallax)
- if (mesh->HasTextureCoords(1)) {
-
- int idx = 1;
- if (src.second & (AI_IRRMESH_MAT_solid_2layer | AI_IRRMESH_MAT_lightmap)) {
- mat->AddProperty(&idx,1,AI_MATKEY_UVWSRC_DIFFUSE(0));
- }
- else if (src.second & AI_IRRMESH_MAT_normalmap_solid) {
- mat->AddProperty(&idx,1,AI_MATKEY_UVWSRC_NORMALS(0));
- }
- }
- }
- }
- break;
-
- case Node::LIGHT:
- case Node::CAMERA:
-
- // We're already finished with lights and cameras
- break;
-
-
- case Node::SPHERE:
- {
- // Generate the sphere model. Our input parameter to
- // the sphere generation algorithm is the number of
- // subdivisions of each triangle - but here we have
- // the number of poylgons on a specific axis. Just
- // use some hardcoded limits to approximate this ...
- unsigned int mul = root->spherePolyCountX*root->spherePolyCountY;
- if (mul < 100)mul = 2;
- else if (mul < 300)mul = 3;
- else mul = 4;
-
- meshes.push_back(StandardShapes::MakeMesh(mul,
- &StandardShapes::MakeSphere));
-
- // Adjust scaling
- root->scaling *= root->sphereRadius/2;
-
- // Copy one output material
- CopyMaterial(materials, root->materials, defMatIdx, meshes.back());
-
- // Now adjust this output material - if there is a first texture
- // set, setup spherical UV mapping around the Y axis.
- SetupMapping ( (MaterialHelper*) materials.back(), aiTextureMapping_SPHERE);
- }
- break;
-
- case Node::CUBE:
- {
- // Generate an unit cube first
- meshes.push_back(StandardShapes::MakeMesh(
- &StandardShapes::MakeHexahedron));
-
- // Adjust scaling
- root->scaling *= root->sphereRadius;
-
- // Copy one output material
- CopyMaterial(materials, root->materials, defMatIdx, meshes.back());
-
- // Now adjust this output material - if there is a first texture
- // set, setup cubic UV mapping
- SetupMapping ( (MaterialHelper*) materials.back(), aiTextureMapping_BOX );
- }
- break;
-
-
- case Node::SKYBOX:
- {
- // A skybox is defined by six materials
- if (root->materials.size() < 6) {
- DefaultLogger::get()->error("IRR: There should be six materials for a skybox");
- break;
- }
-
- // copy those materials and generate 6 meshes for our new skybox
- materials.reserve(materials.size() + 6);
- for (unsigned int i = 0; i < 6;++i)
- materials.insert(materials.end(),root->materials[i].first);
-
- BuildSkybox(meshes,materials);
-
- // *************************************************************
- // Skyboxes will require a different code path for rendering,
- // so there must be a way for the user to add special support
- // for IRR skyboxes. We add a 'IRR.SkyBox_' prefix to the node.
- // *************************************************************
- root->name = "IRR.SkyBox_" + root->name;
- DefaultLogger::get()->info("IRR: Loading skybox, this will "
- "require special handling to be displayed correctly");
- }
- break;
-
- case Node::TERRAIN:
- {
- // to support terrains, we'd need to have a texture decoder
- DefaultLogger::get()->error("IRR: Unsupported node - TERRAIN");
- }
- break;
- default:
- // DUMMY
- break;
- };
-
- // Check whether we added a mesh (or more than one ...). In this case
- // we'll also need to attach it to the node
- if (oldMeshSize != (unsigned int) meshes.size()) {
-
- rootOut->mNumMeshes = (unsigned int)meshes.size() - oldMeshSize;
- rootOut->mMeshes = new unsigned int[rootOut->mNumMeshes];
-
- for (unsigned int a = 0; a < rootOut->mNumMeshes;++a) {
- rootOut->mMeshes[a] = oldMeshSize+a;
- }
- }
-
- // Setup the name of this node
- rootOut->mName.Set(root->name);
-
- // Now compute the final local transformation matrix of the
- // node from the given translation, rotation and scaling values.
- // (the rotation is given in Euler angles, XYZ order)
- //std::swap((float&)root->rotation.z,(float&)root->rotation.y);
- rootOut->mTransformation.FromEulerAnglesXYZ(AI_DEG_TO_RAD(root->rotation) );
-
- // apply scaling
- aiMatrix4x4& mat = rootOut->mTransformation;
- mat.a1 *= root->scaling.x;
- mat.b1 *= root->scaling.x;
- mat.c1 *= root->scaling.x;
- mat.a2 *= root->scaling.y;
- mat.b2 *= root->scaling.y;
- mat.c2 *= root->scaling.y;
- mat.a3 *= root->scaling.z;
- mat.b3 *= root->scaling.z;
- mat.c3 *= root->scaling.z;
-
- // apply translation
- mat.a4 += root->position.x;
- mat.b4 += root->position.y;
- mat.c4 += root->position.z;
-
- // now compute animations for the node
- ComputeAnimations(root,rootOut, anims);
-
- // Add all children recursively. First allocate enough storage
- // for them, then call us again
- rootOut->mNumChildren = (unsigned int)root->children.size();
- if (rootOut->mNumChildren) {
-
- rootOut->mChildren = new aiNode*[rootOut->mNumChildren];
- for (unsigned int i = 0; i < rootOut->mNumChildren;++i) {
-
- aiNode* node = rootOut->mChildren[i] = new aiNode();
- node->mParent = rootOut;
- GenerateGraph(root->children[i],node,scene,batch,meshes,
- anims,attach,materials,defMatIdx);
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Imports the given file into the given scene structure.
-void IRRImporter::InternReadFile( const std::string& pFile,
- aiScene* pScene, IOSystem* pIOHandler)
-{
- boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile));
-
- // Check whether we can read from the file
- if ( file.get() == NULL)
- throw DeadlyImportError( "Failed to open IRR file " + pFile + "");
-
- // Construct the irrXML parser
- CIrrXML_IOStreamReader st(file.get());
- reader = createIrrXMLReader((IFileReadCallBack*) &st);
-
- // The root node of the scene
- Node* root = new Node(Node::DUMMY);
- root->parent = NULL;
- root->name = "<IRRSceneRoot>";
-
- // Current node parent
- Node* curParent = root;
-
- // Scenegraph node we're currently working on
- Node* curNode = NULL;
-
- // List of output cameras
- std::vector<aiCamera*> cameras;
-
- // List of output lights
- std::vector<aiLight*> lights;
-
- // Batch loader used to load external models
- BatchLoader batch(pIOHandler);
-// batch.SetBasePath(pFile);
-
- cameras.reserve(5);
- lights.reserve(5);
-
- bool inMaterials = false, inAnimator = false;
- unsigned int guessedAnimCnt = 0, guessedMeshCnt = 0, guessedMatCnt = 0;
-
- // Parse the XML file
- while (reader->read()) {
- switch (reader->getNodeType()) {
- case EXN_ELEMENT:
-
- if (!ASSIMP_stricmp(reader->getNodeName(),"node")) {
- // ***********************************************************************
- /* What we're going to do with the node depends
- * on its type:
- *
- * "mesh" - Load a mesh from an external file
- * "cube" - Generate a cube
- * "skybox" - Generate a skybox
- * "light" - A light source
- * "sphere" - Generate a sphere mesh
- * "animatedMesh" - Load an animated mesh from an external file
- * and join its animation channels with ours.
- * "empty" - A dummy node
- * "camera" - A camera
- * "terrain" - a terrain node (data comes from a heightmap)
- * "billboard", ""
- *
- * Each of these nodes can be animated and all can have multiple
- * materials assigned (except lights, cameras and dummies, of course).
- */
- // ***********************************************************************
- const char* sz = reader->getAttributeValueSafe("type");
- Node* nd;
- if (!ASSIMP_stricmp(sz,"mesh") || !ASSIMP_stricmp(sz,"octTree")) {
- // OctTree's and meshes are treated equally
- nd = new Node(Node::MESH);
- }
- else if (!ASSIMP_stricmp(sz,"cube")) {
- nd = new Node(Node::CUBE);
- ++guessedMeshCnt;
- // meshes.push_back(StandardShapes::MakeMesh(&StandardShapes::MakeHexahedron));
- }
- else if (!ASSIMP_stricmp(sz,"skybox")) {
- nd = new Node(Node::SKYBOX);
- guessedMeshCnt += 6;
- }
- else if (!ASSIMP_stricmp(sz,"camera")) {
- nd = new Node(Node::CAMERA);
-
- // Setup a temporary name for the camera
- aiCamera* cam = new aiCamera();
- cam->mName.Set( nd->name );
- cameras.push_back(cam);
- }
- else if (!ASSIMP_stricmp(sz,"light")) {
- nd = new Node(Node::LIGHT);
-
- // Setup a temporary name for the light
- aiLight* cam = new aiLight();
- cam->mName.Set( nd->name );
- lights.push_back(cam);
- }
- else if (!ASSIMP_stricmp(sz,"sphere")) {
- nd = new Node(Node::SPHERE);
- ++guessedMeshCnt;
- }
- else if (!ASSIMP_stricmp(sz,"animatedMesh")) {
- nd = new Node(Node::ANIMMESH);
- }
- else if (!ASSIMP_stricmp(sz,"empty")) {
- nd = new Node(Node::DUMMY);
- }
- else if (!ASSIMP_stricmp(sz,"terrain")) {
- nd = new Node(Node::TERRAIN);
- }
- else if (!ASSIMP_stricmp(sz,"billBoard")) {
- // We don't support billboards, so ignore them
- DefaultLogger::get()->error("IRR: Billboards are not supported by Assimp");
- nd = new Node(Node::DUMMY);
- }
- else {
- DefaultLogger::get()->warn("IRR: Found unknown node: " + std::string(sz));
-
- /* We skip the contents of nodes we don't know.
- * We parse the transformation and all animators
- * and skip the rest.
- */
- nd = new Node(Node::DUMMY);
- }
-
- /* Attach the newly created node to the scenegraph
- */
- curNode = nd;
- nd->parent = curParent;
- curParent->children.push_back(nd);
- }
- else if (!ASSIMP_stricmp(reader->getNodeName(),"materials")) {
- inMaterials = true;
- }
- else if (!ASSIMP_stricmp(reader->getNodeName(),"animators")) {
- inAnimator = true;
- }
- else if (!ASSIMP_stricmp(reader->getNodeName(),"attributes")) {
- /* We should have a valid node here
- * FIX: no ... the scene root node is also contained in an attributes block
- */
- if (!curNode) {
-#if 0
- DefaultLogger::get()->error("IRR: Encountered <attributes> element, but "
- "there is no node active");
-#endif
- continue;
- }
-
- Animator* curAnim = NULL;
-
- // Materials can occur for nearly any type of node
- if (inMaterials && curNode->type != Node::DUMMY) {
- /* This is a material description - parse it!
- */
- curNode->materials.push_back(std::pair< aiMaterial*, unsigned int > () );
- std::pair< aiMaterial*, unsigned int >& p = curNode->materials.back();
-
- p.first = ParseMaterial(p.second);
-
- ++guessedMatCnt;
- continue;
- }
- else if (inAnimator) {
- /* This is an animation path - add a new animator
- * to the list.
- */
- curNode->animators.push_back(Animator());
- curAnim = & curNode->animators.back();
-
- ++guessedAnimCnt;
- }
-
- /* Parse all elements in the attributes block
- * and process them.
- */
- while (reader->read()) {
- if (reader->getNodeType() == EXN_ELEMENT) {
- if (!ASSIMP_stricmp(reader->getNodeName(),"vector3d")) {
- VectorProperty prop;
- ReadVectorProperty(prop);
-
- if (inAnimator) {
- if (curAnim->type == Animator::ROTATION && prop.name == "Rotation") {
- // We store the rotation euler angles in 'direction'
- curAnim->direction = prop.value;
- }
- else if (curAnim->type == Animator::FOLLOW_SPLINE) {
- // Check whether the vector follows the PointN naming scheme,
- // here N is the ONE-based index of the point
- if (prop.name.length() >= 6 && prop.name.substr(0,5) == "Point") {
- // Add a new key to the list
- curAnim->splineKeys.push_back(aiVectorKey());
- aiVectorKey& key = curAnim->splineKeys.back();
-
- // and parse its properties
- key.mValue = prop.value;
- key.mTime = strtol10(&prop.name[5]);
- }
- }
- else if (curAnim->type == Animator::FLY_CIRCLE) {
- if (prop.name == "Center") {
- curAnim->circleCenter = prop.value;
- }
- else if (prop.name == "Direction") {
- curAnim->direction = prop.value;
-
- // From Irrlicht's source - a workaround for backward compatibility with Irrlicht 1.1
- if (curAnim->direction == aiVector3D()) {
- curAnim->direction = aiVector3D(0.f,1.f,0.f);
- }
- else curAnim->direction.Normalize();
- }
- }
- else if (curAnim->type == Animator::FLY_STRAIGHT) {
- if (prop.name == "Start") {
- // We reuse the field here
- curAnim->circleCenter = prop.value;
- }
- else if (prop.name == "End") {
- // We reuse the field here
- curAnim->direction = prop.value;
- }
- }
- }
- else {
- if (prop.name == "Position") {
- curNode->position = prop.value;
- }
- else if (prop.name == "Rotation") {
- curNode->rotation = prop.value;
- }
- else if (prop.name == "Scale") {
- curNode->scaling = prop.value;
- }
- else if (Node::CAMERA == curNode->type)
- {
- aiCamera* cam = cameras.back();
- if (prop.name == "Target") {
- cam->mLookAt = prop.value;
- }
- else if (prop.name == "UpVector") {
- cam->mUp = prop.value;
- }
- }
- }
- }
- else if (!ASSIMP_stricmp(reader->getNodeName(),"bool")) {
- BoolProperty prop;
- ReadBoolProperty(prop);
-
- if (inAnimator && curAnim->type == Animator::FLY_CIRCLE && prop.name == "Loop") {
- curAnim->loop = prop.value;
- }
- }
- else if (!ASSIMP_stricmp(reader->getNodeName(),"float")) {
- FloatProperty prop;
- ReadFloatProperty(prop);
-
- if (inAnimator) {
- // The speed property exists for several animators
- if (prop.name == "Speed") {
- curAnim->speed = prop.value;
- }
- else if (curAnim->type == Animator::FLY_CIRCLE && prop.name == "Radius") {
- curAnim->circleRadius = prop.value;
- }
- else if (curAnim->type == Animator::FOLLOW_SPLINE && prop.name == "Tightness") {
- curAnim->tightness = prop.value;
- }
- }
- else {
- if (prop.name == "FramesPerSecond" && Node::ANIMMESH == curNode->type) {
- curNode->framesPerSecond = prop.value;
- }
- else if (Node::CAMERA == curNode->type) {
- /* This is the vertical, not the horizontal FOV.
- * We need to compute the right FOV from the
- * screen aspect which we don't know yet.
- */
- if (prop.name == "Fovy") {
- cameras.back()->mHorizontalFOV = prop.value;
- }
- else if (prop.name == "Aspect") {
- cameras.back()->mAspect = prop.value;
- }
- else if (prop.name == "ZNear") {
- cameras.back()->mClipPlaneNear = prop.value;
- }
- else if (prop.name == "ZFar") {
- cameras.back()->mClipPlaneFar = prop.value;
- }
- }
- else if (Node::LIGHT == curNode->type) {
- /* Additional light information
- */
- if (prop.name == "Attenuation") {
- lights.back()->mAttenuationLinear = prop.value;
- }
- else if (prop.name == "OuterCone") {
- lights.back()->mAngleOuterCone = AI_DEG_TO_RAD( prop.value );
- }
- else if (prop.name == "InnerCone") {
- lights.back()->mAngleInnerCone = AI_DEG_TO_RAD( prop.value );
- }
- }
- // radius of the sphere to be generated -
- // or alternatively, size of the cube
- else if ((Node::SPHERE == curNode->type && prop.name == "Radius")
- || (Node::CUBE == curNode->type && prop.name == "Size" )) {
-
- curNode->sphereRadius = prop.value;
- }
- }
- }
- else if (!ASSIMP_stricmp(reader->getNodeName(),"int")) {
- IntProperty prop;
- ReadIntProperty(prop);
-
- if (inAnimator) {
- if (curAnim->type == Animator::FLY_STRAIGHT && prop.name == "TimeForWay") {
- curAnim->timeForWay = prop.value;
- }
- }
- else {
- // sphere polgon numbers in each direction
- if (Node::SPHERE == curNode->type) {
-
- if (prop.name == "PolyCountX") {
- curNode->spherePolyCountX = prop.value;
- }
- else if (prop.name == "PolyCountY") {
- curNode->spherePolyCountY = prop.value;
- }
- }
- }
- }
- else if (!ASSIMP_stricmp(reader->getNodeName(),"string") ||!ASSIMP_stricmp(reader->getNodeName(),"enum")) {
- StringProperty prop;
- ReadStringProperty(prop);
- if (prop.value.length()) {
- if (prop.name == "Name") {
- curNode->name = prop.value;
-
- /* If we're either a camera or a light source
- * we need to update the name in the aiLight/
- * aiCamera structure, too.
- */
- if (Node::CAMERA == curNode->type) {
- cameras.back()->mName.Set(prop.value);
- }
- else if (Node::LIGHT == curNode->type) {
- lights.back()->mName.Set(prop.value);
- }
- }
- else if (Node::LIGHT == curNode->type && "LightType" == prop.name)
- {
- if (prop.value == "Spot")
- lights.back()->mType = aiLightSource_SPOT;
- else if (prop.value == "Point")
- lights.back()->mType = aiLightSource_POINT;
- else if (prop.value == "Directional")
- lights.back()->mType = aiLightSource_DIRECTIONAL;
- else
- {
- // We won't pass the validation with aiLightSourceType_UNDEFINED,
- // so we remove the light and replace it with a silly dummy node
- delete lights.back();
- lights.pop_back();
- curNode->type = Node::DUMMY;
-
- DefaultLogger::get()->error("Ignoring light of unknown type: " + prop.value);
- }
- }
- else if ((prop.name == "Mesh" && Node::MESH == curNode->type) ||
- Node::ANIMMESH == curNode->type)
- {
- /* This is the file name of the mesh - either
- * animated or not. We need to make sure we setup
- * the correct postprocessing settings here.
- */
- unsigned int pp = 0;
- BatchLoader::PropertyMap map;
-
- /* If the mesh is a static one remove all animations from the impor data
- */
- if (Node::ANIMMESH != curNode->type) {
- pp |= aiProcess_RemoveComponent;
- SetGenericProperty<int>(map.ints,AI_CONFIG_PP_RVC_FLAGS,
- aiComponent_ANIMATIONS | aiComponent_BONEWEIGHTS);
- }
-
- /* TODO: maybe implement the protection against recursive
- * loading calls directly in BatchLoader? The current
- * implementation is not absolutely safe. A LWS and an IRR
- * file referencing each other *could* cause the system to
- * recurse forever.
- */
-
- const std::string extension = GetExtension(prop.value);
- if ("irr" == extension) {
- DefaultLogger::get()->error("IRR: Can't load another IRR file recursively");
- }
- else
- {
- curNode->id = batch.AddLoadRequest(prop.value,pp,&map);
- curNode->meshPath = prop.value;
- }
- }
- else if (inAnimator && prop.name == "Type")
- {
- // type of the animator
- if (prop.value == "rotation") {
- curAnim->type = Animator::ROTATION;
- }
- else if (prop.value == "flyCircle") {
- curAnim->type = Animator::FLY_CIRCLE;
- }
- else if (prop.value == "flyStraight") {
- curAnim->type = Animator::FLY_CIRCLE;
- }
- else if (prop.value == "followSpline") {
- curAnim->type = Animator::FOLLOW_SPLINE;
- }
- else {
- DefaultLogger::get()->warn("IRR: Ignoring unknown animator: "
- + prop.value);
-
- curAnim->type = Animator::UNKNOWN;
- }
- }
- }
- }
- }
- else if (reader->getNodeType() == EXN_ELEMENT_END && !ASSIMP_stricmp(reader->getNodeName(),"attributes")) {
- break;
- }
- }
- }
- break;
-
- case EXN_ELEMENT_END:
-
- // If we reached the end of a node, we need to continue processing its parent
- if (!ASSIMP_stricmp(reader->getNodeName(),"node")) {
- if (!curNode) {
- // currently is no node set. We need to go
- // back in the node hierarchy
- if (!curParent) {
- curParent = root;
- DefaultLogger::get()->error("IRR: Too many closing <node> elements");
- }
- else curParent = curParent->parent;
- }
- else curNode = NULL;
- }
- // clear all flags
- else if (!ASSIMP_stricmp(reader->getNodeName(),"materials")) {
- inMaterials = false;
- }
- else if (!ASSIMP_stricmp(reader->getNodeName(),"animators")) {
- inAnimator = false;
- }
- break;
-
- default:
- // GCC complains that not all enumeration values are handled
- break;
- }
- }
-
- /* Now iterate through all cameras and compute their final (horizontal) FOV
- */
- for (std::vector<aiCamera*>::iterator it = cameras.begin(), end = cameras.end();it != end; ++it) {
- aiCamera* cam = *it;
-
- // screen aspect could be missing
- if (cam->mAspect) {
- cam->mHorizontalFOV *= cam->mAspect;
- }
- else DefaultLogger::get()->warn("IRR: Camera aspect is not given, can't compute horizontal FOV");
- }
-
- batch.LoadAll();
-
- /* Allocate a tempoary scene data structure
- */
- aiScene* tempScene = new aiScene();
- tempScene->mRootNode = new aiNode();
- tempScene->mRootNode->mName.Set("<IRRRoot>");
-
- /* Copy the cameras to the output array
- */
- if (!cameras.empty()) {
- tempScene->mNumCameras = (unsigned int)cameras.size();
- tempScene->mCameras = new aiCamera*[tempScene->mNumCameras];
- ::memcpy(tempScene->mCameras,&cameras[0],sizeof(void*)*tempScene->mNumCameras);
- }
-
- /* Copy the light sources to the output array
- */
- if (!lights.empty()) {
- tempScene->mNumLights = (unsigned int)lights.size();
- tempScene->mLights = new aiLight*[tempScene->mNumLights];
- ::memcpy(tempScene->mLights,&lights[0],sizeof(void*)*tempScene->mNumLights);
- }
-
- // temporary data
- std::vector< aiNodeAnim*> anims;
- std::vector< aiMaterial*> materials;
- std::vector< AttachmentInfo > attach;
- std::vector<aiMesh*> meshes;
-
- // try to guess how much storage we'll need
- anims.reserve (guessedAnimCnt + (guessedAnimCnt >> 2));
- meshes.reserve (guessedMeshCnt + (guessedMeshCnt >> 2));
- materials.reserve (guessedMatCnt + (guessedMatCnt >> 2));
-
- /* Now process our scenegraph recursively: generate final
- * meshes and generate animation channels for all nodes.
- */
- unsigned int defMatIdx = 0xffffffff;
- GenerateGraph(root,tempScene->mRootNode, tempScene,
- batch, meshes, anims, attach, materials, defMatIdx);
-
- if (!anims.empty())
- {
- tempScene->mNumAnimations = 1;
- tempScene->mAnimations = new aiAnimation*[tempScene->mNumAnimations];
- aiAnimation* an = tempScene->mAnimations[0] = new aiAnimation();
-
- // ***********************************************************
- // This is only the global animation channel of the scene.
- // If there are animated models, they will have separate
- // animation channels in the scene. To display IRR scenes
- // correctly, users will need to combine the global anim
- // channel with all the local animations they want to play
- // ***********************************************************
- an->mName.Set("Irr_GlobalAnimChannel");
-
- // copy all node animation channels to the global channel
- an->mNumChannels = (unsigned int)anims.size();
- an->mChannels = new aiNodeAnim*[an->mNumChannels];
- ::memcpy(an->mChannels, & anims [0], sizeof(void*)*an->mNumChannels);
- }
- if (!meshes.empty()) {
- // copy all meshes to the temporary scene
- tempScene->mNumMeshes = (unsigned int)meshes.size();
- tempScene->mMeshes = new aiMesh*[tempScene->mNumMeshes];
- ::memcpy(tempScene->mMeshes,&meshes[0],tempScene->mNumMeshes*
- sizeof(void*));
- }
-
- /* Copy all materials to the output array
- */
- if (!materials.empty()) {
- tempScene->mNumMaterials = (unsigned int)materials.size();
- tempScene->mMaterials = new aiMaterial*[tempScene->mNumMaterials];
- ::memcpy(tempScene->mMaterials,&materials[0],sizeof(void*)*
- tempScene->mNumMaterials);
- }
-
- /* Now merge all sub scenes and attach them to the correct
- * attachment points in the scenegraph.
- */
- SceneCombiner::MergeScenes(&pScene,tempScene,attach,
- AI_INT_MERGE_SCENE_GEN_UNIQUE_NAMES | (!configSpeedFlag ? (
- AI_INT_MERGE_SCENE_GEN_UNIQUE_NAMES_IF_NECESSARY | AI_INT_MERGE_SCENE_GEN_UNIQUE_MATNAMES) : 0));
-
-
- /* If we have no meshes | no materials now set the INCOMPLETE
- * scene flag. This is necessary if we failed to load all
- * models from external files
- */
- if (!pScene->mNumMeshes || !pScene->mNumMaterials) {
- DefaultLogger::get()->warn("IRR: No meshes loaded, setting AI_SCENE_FLAGS_INCOMPLETE");
- pScene->mFlags |= AI_SCENE_FLAGS_INCOMPLETE;
- }
-
- /* Finished ... everything destructs automatically and all
- * temporary scenes have already been deleted by MergeScenes()
- */
- return;
-}
diff --git a/3rdparty/assimp/code/IRRLoader.h b/3rdparty/assimp/code/IRRLoader.h
deleted file mode 100644
index bfe40ec7..00000000
--- a/3rdparty/assimp/code/IRRLoader.h
+++ /dev/null
@@ -1,312 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-
-/** @file IRRLoader.h
- * @brief Declaration of the .irrMesh (Irrlight Engine Mesh Format)
- * importer class.
- */
-#ifndef AI_IRRLOADER_H_INCLUDED
-#define AI_IRRLOADER_H_INCLUDED
-
-#include "IRRShared.h"
-#include "SceneCombiner.h"
-
-namespace Assimp {
-
-
-// ---------------------------------------------------------------------------
-/** Irr importer class.
- *
- * Irr is the native scene file format of the Irrlight engine and its editor
- * irrEdit. As IrrEdit itself is capable of importing quite many file formats,
- * it might be a good file format for data exchange.
- */
-class IRRImporter : public BaseImporter, public IrrlichtBase
-{
- friend class Importer;
-
-protected:
- /** Constructor to be privately used by Importer */
- IRRImporter();
-
- /** Destructor, private as well */
- ~IRRImporter();
-
-public:
-
- // -------------------------------------------------------------------
- /** Returns whether the class can handle the format of the given file.
- * See BaseImporter::CanRead() for details.
- */
- bool CanRead( const std::string& pFile, IOSystem* pIOHandler,
- bool checkSig) const;
-
-protected:
-
- // -------------------------------------------------------------------
- /**
- */
- void GetExtensionList(std::set<std::string>& extensions);
-
- // -------------------------------------------------------------------
- /**
- */
- void InternReadFile( const std::string& pFile, aiScene* pScene,
- IOSystem* pIOHandler);
-
- // -------------------------------------------------------------------
- /**
- */
- void SetupProperties(const Importer* pImp);
-
-private:
-
- /** Data structure for a scenegraph node animator
- */
- struct Animator
- {
- // Type of the animator
- enum AT
- {
- UNKNOWN = 0x0,
- ROTATION = 0x1,
- FLY_CIRCLE = 0x2,
- FLY_STRAIGHT = 0x3,
- FOLLOW_SPLINE = 0x4,
- OTHER = 0x5
-
- } type;
-
- Animator(AT t = UNKNOWN)
- : type (t)
- , speed (0.001f)
- , direction (0.f,1.f,0.f)
- , circleRadius (1.f)
- , tightness (0.5f)
- , loop (true)
- , timeForWay (100)
- {
- }
-
-
- // common parameters
- float speed;
- aiVector3D direction;
-
- // FLY_CIRCLE
- aiVector3D circleCenter;
- float circleRadius;
-
- // FOLLOW_SPLINE
- float tightness;
- std::vector<aiVectorKey> splineKeys;
-
- // ROTATION (angles given in direction)
-
- // FLY STRAIGHT
- // circleCenter = start, direction = end
- bool loop;
- int timeForWay;
- };
-
- /** Data structure for a scenegraph node in an IRR file
- */
- struct Node
- {
- // Type of the node
- enum ET
- {
- LIGHT,
- CUBE,
- MESH,
- SKYBOX,
- DUMMY,
- CAMERA,
- TERRAIN,
- SPHERE,
- ANIMMESH
- } type;
-
- Node(ET t)
- : type (t)
- , scaling (1.f,1.f,1.f) // assume uniform scaling by default
- , framesPerSecond (0.f)
- , sphereRadius (1.f)
- , spherePolyCountX (100)
- , spherePolyCountY (100)
- {
-
- // Generate a default name for the node
- char buffer[128];
- static int cnt;
- ::sprintf(buffer,"IrrNode_%i",cnt++);
- name = std::string(buffer);
-
- // reserve space for up to 5 materials
- materials.reserve(5);
-
- // reserve space for up to 5 children
- children.reserve(5);
- }
-
- // Transformation of the node
- aiVector3D position, rotation, scaling;
-
- // Name of the node
- std::string name;
-
- // List of all child nodes
- std::vector<Node*> children;
-
- // Parent node
- Node* parent;
-
- // Animated meshes: frames per second
- // 0.f if not specified
- float framesPerSecond;
-
- // Meshes: path to the mesh to be loaded
- std::string meshPath;
- unsigned int id;
-
- // Meshes: List of materials to be assigned
- // along with their corresponding material flags
- std::vector< std::pair<aiMaterial*, unsigned int> > materials;
-
- // Spheres: radius of the sphere to be generates
- float sphereRadius;
-
- // Spheres: Number of polygons in the x,y direction
- unsigned int spherePolyCountX,spherePolyCountY;
-
- // List of all animators assigned to the node
- std::list<Animator> animators;
- };
-
- /** Data structure for a vertex in an IRR skybox
- */
- struct SkyboxVertex
- {
- SkyboxVertex()
- {}
-
- //! Construction from single vertex components
- SkyboxVertex(float px, float py, float pz,
- float nx, float ny, float nz,
- float uvx, float uvy)
-
- : position (px,py,pz)
- , normal (nx,ny,nz)
- , uv (uvx,uvy,0.f)
- {}
-
- aiVector3D position, normal, uv;
- };
-
-
- // -------------------------------------------------------------------
- /** Fill the scenegraph recursively
- */
- void GenerateGraph(Node* root,aiNode* rootOut ,aiScene* scene,
- BatchLoader& batch,
- std::vector<aiMesh*>& meshes,
- std::vector<aiNodeAnim*>& anims,
- std::vector<AttachmentInfo>& attach,
- std::vector<aiMaterial*>& materials,
- unsigned int& defaultMatIdx);
-
-
- // -------------------------------------------------------------------
- /** Generate a mesh that consists of just a single quad
- */
- aiMesh* BuildSingleQuadMesh(const SkyboxVertex& v1,
- const SkyboxVertex& v2,
- const SkyboxVertex& v3,
- const SkyboxVertex& v4);
-
-
- // -------------------------------------------------------------------
- /** Build a skybox
- *
- * @param meshes Receives 6 output meshes
- * @param materials The last 6 materials are assigned to the newly
- * created meshes. The names of the materials are adjusted.
- */
- void BuildSkybox(std::vector<aiMesh*>& meshes,
- std::vector<aiMaterial*> materials);
-
-
- // -------------------------------------------------------------------
- /** Copy a material for a mesh to the output material list
- *
- * @param materials Receives an output material
- * @param inmaterials List of input materials
- * @param defMatIdx Default material index - 0xffffffff if not there
- * @param mesh Mesh to work on
- */
- void CopyMaterial(std::vector<aiMaterial*>& materials,
- std::vector< std::pair<aiMaterial*, unsigned int> >& inmaterials,
- unsigned int& defMatIdx,
- aiMesh* mesh);
-
-
- // -------------------------------------------------------------------
- /** Compute animations for a specific node
- *
- * @param root Node to be processed
- * @param anims The list of output animations
- */
- void ComputeAnimations(Node* root, aiNode* real,
- std::vector<aiNodeAnim*>& anims);
-
-
-private:
-
- /** Configuration option: desired output FPS */
- double fps;
-
- /** Configuration option: speed flag was set? */
- bool configSpeedFlag;
-};
-
-} // end of namespace Assimp
-
-#endif // AI_IRRIMPORTER_H_INC
diff --git a/3rdparty/assimp/code/IRRMeshLoader.cpp b/3rdparty/assimp/code/IRRMeshLoader.cpp
deleted file mode 100644
index 6d67e225..00000000
--- a/3rdparty/assimp/code/IRRMeshLoader.cpp
+++ /dev/null
@@ -1,499 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file Implementation of the IrrMesh importer class */
-
-#include "AssimpPCH.h"
-
-#include "IRRMeshLoader.h"
-#include "ParsingUtils.h"
-#include "fast_atof.h"
-
-using namespace Assimp;
-using namespace irr;
-using namespace irr::io;
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-IRRMeshImporter::IRRMeshImporter()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-IRRMeshImporter::~IRRMeshImporter()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the class can handle the format of the given file.
-bool IRRMeshImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const
-{
- /* NOTE: A simple check for the file extension is not enough
- * here. Irrmesh and irr are easy, but xml is too generic
- * and could be collada, too. So we need to open the file and
- * search for typical tokens.
- */
- const std::string extension = GetExtension(pFile);
-
- if (extension == "irrmesh")return true;
- else if (extension == "xml" || checkSig)
- {
- /* If CanRead() is called to check whether the loader
- * supports a specific file extension in general we
- * must return true here.
- */
- if (!pIOHandler)return true;
- const char* tokens[] = {"irrmesh"};
- return SearchFileHeaderForToken(pIOHandler,pFile,tokens,1);
- }
- return false;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Get a list of all file extensions which are handled by this class
-void IRRMeshImporter::GetExtensionList(std::set<std::string>& extensions)
-{
- extensions.insert("xml");
- extensions.insert("irrmesh");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Imports the given file into the given scene structure.
-void IRRMeshImporter::InternReadFile( const std::string& pFile,
- aiScene* pScene, IOSystem* pIOHandler)
-{
- boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile));
-
- // Check whether we can read from the file
- if ( file.get() == NULL)
- throw DeadlyImportError( "Failed to open IRRMESH file " + pFile + "");
-
- // Construct the irrXML parser
- CIrrXML_IOStreamReader st(file.get());
- reader = createIrrXMLReader((IFileReadCallBack*) &st);
-
- // final data
- std::vector<aiMaterial*> materials;
- std::vector<aiMesh*> meshes;
- materials.reserve (5);
- meshes.reserve (5);
-
- // temporary data - current mesh buffer
- aiMaterial* curMat = NULL;
- aiMesh* curMesh = NULL;
- unsigned int curMatFlags;
-
- std::vector<aiVector3D> curVertices,curNormals,curTangents,curBitangents;
- std::vector<aiColor4D> curColors;
- std::vector<aiVector3D> curUVs,curUV2s;
-
- // some temporary variables
- int textMeaning = 0;
- int vertexFormat = 0; // 0 = normal; 1 = 2 tcoords, 2 = tangents
- bool useColors = false;
-
- // Parse the XML file
- while (reader->read()) {
- switch (reader->getNodeType()) {
- case EXN_ELEMENT:
-
- if (!ASSIMP_stricmp(reader->getNodeName(),"buffer") && (curMat || curMesh)) {
- // end of previous buffer. A material and a mesh should be there
- if ( !curMat || !curMesh) {
- DefaultLogger::get()->error("IRRMESH: A buffer must contain a mesh and a material");
- delete curMat;
- delete curMesh;
- }
- else {
- materials.push_back(curMat);
- meshes.push_back(curMesh);
- }
- curMat = NULL;
- curMesh = NULL;
-
- curVertices.clear();
- curColors.clear();
- curNormals.clear();
- curUV2s.clear();
- curUVs.clear();
- curTangents.clear();
- curBitangents.clear();
- }
-
-
- if (!ASSIMP_stricmp(reader->getNodeName(),"material")) {
- if (curMat) {
- DefaultLogger::get()->warn("IRRMESH: Only one material description per buffer, please");
- delete curMat;curMat = NULL;
- }
- curMat = ParseMaterial(curMatFlags);
- }
- /* no else here! */ if (!ASSIMP_stricmp(reader->getNodeName(),"vertices"))
- {
- int num = reader->getAttributeValueAsInt("vertexCount");
-
- if (!num) {
- // This is possible ... remove the mesh from the list and skip further reading
- DefaultLogger::get()->warn("IRRMESH: Found mesh with zero vertices");
-
- delete curMat;curMat = NULL;
-
- curMesh = NULL;
- textMeaning = 0;
- continue;
- }
-
- curVertices.reserve (num);
- curNormals.reserve (num);
- curColors.reserve (num);
- curUVs.reserve (num);
-
- // Determine the file format
- const char* t = reader->getAttributeValueSafe("type");
- if (!ASSIMP_stricmp("2tcoords", t)) {
- curUV2s.reserve (num);
- vertexFormat = 1;
-
- if (curMatFlags & AI_IRRMESH_EXTRA_2ND_TEXTURE) {
- // *********************************************************
- // We have a second texture! So use this UV channel
- // for it. The 2nd texture can be either a normal
- // texture (solid_2layer or lightmap_xxx) or a normal
- // map (normal_..., parallax_...)
- // *********************************************************
- int idx = 1;
- MaterialHelper* mat = ( MaterialHelper* ) curMat;
-
- if (curMatFlags & AI_IRRMESH_MAT_lightmap){
- mat->AddProperty(&idx,1,AI_MATKEY_UVWSRC_LIGHTMAP(0));
- }
- else if (curMatFlags & AI_IRRMESH_MAT_normalmap_solid){
- mat->AddProperty(&idx,1,AI_MATKEY_UVWSRC_NORMALS(0));
- }
- else if (curMatFlags & AI_IRRMESH_MAT_solid_2layer) {
- mat->AddProperty(&idx,1,AI_MATKEY_UVWSRC_DIFFUSE(1));
- }
- }
- }
- else if (!ASSIMP_stricmp("tangents", t)) {
- curTangents.reserve (num);
- curBitangents.reserve (num);
- vertexFormat = 2;
- }
- else if (ASSIMP_stricmp("standard", t)) {
- delete curMat;
- DefaultLogger::get()->warn("IRRMESH: Unknown vertex format");
- }
- else vertexFormat = 0;
- textMeaning = 1;
- }
- else if (!ASSIMP_stricmp(reader->getNodeName(),"indices")) {
- if (curVertices.empty() && curMat) {
- delete curMat;
- throw DeadlyImportError("IRRMESH: indices must come after vertices");
- }
-
- textMeaning = 2;
-
- // start a new mesh
- curMesh = new aiMesh();
-
- // allocate storage for all faces
- curMesh->mNumVertices = reader->getAttributeValueAsInt("indexCount");
- if (!curMesh->mNumVertices) {
- // This is possible ... remove the mesh from the list and skip further reading
- DefaultLogger::get()->warn("IRRMESH: Found mesh with zero indices");
-
- // mesh - away
- delete curMesh; curMesh = NULL;
-
- // material - away
- delete curMat;curMat = NULL;
-
- textMeaning = 0;
- continue;
- }
-
- if (curMesh->mNumVertices % 3) {
- DefaultLogger::get()->warn("IRRMESH: Number if indices isn't divisible by 3");
- }
-
- curMesh->mNumFaces = curMesh->mNumVertices / 3;
- curMesh->mFaces = new aiFace[curMesh->mNumFaces];
-
- // setup some members
- curMesh->mMaterialIndex = (unsigned int)materials.size();
- curMesh->mPrimitiveTypes = aiPrimitiveType_TRIANGLE;
-
- // allocate storage for all vertices
- curMesh->mVertices = new aiVector3D[curMesh->mNumVertices];
-
- if (curNormals.size() == curVertices.size()) {
- curMesh->mNormals = new aiVector3D[curMesh->mNumVertices];
- }
- if (curTangents.size() == curVertices.size()) {
- curMesh->mTangents = new aiVector3D[curMesh->mNumVertices];
- }
- if (curBitangents.size() == curVertices.size()) {
- curMesh->mBitangents = new aiVector3D[curMesh->mNumVertices];
- }
- if (curColors.size() == curVertices.size() && useColors) {
- curMesh->mColors[0] = new aiColor4D[curMesh->mNumVertices];
- }
- if (curUVs.size() == curVertices.size()) {
- curMesh->mTextureCoords[0] = new aiVector3D[curMesh->mNumVertices];
- }
- if (curUV2s.size() == curVertices.size()) {
- curMesh->mTextureCoords[1] = new aiVector3D[curMesh->mNumVertices];
- }
- }
- break;
-
- case EXN_TEXT:
- {
- const char* sz = reader->getNodeData();
- if (textMeaning == 1) {
- textMeaning = 0;
-
- // read vertices
- do {
- SkipSpacesAndLineEnd(&sz);
- aiVector3D temp;aiColor4D c;
-
- // Read the vertex position
- sz = fast_atof_move(sz,(float&)temp.x);
- SkipSpaces(&sz);
-
- sz = fast_atof_move(sz,(float&)temp.y);
- SkipSpaces(&sz);
-
- sz = fast_atof_move(sz,(float&)temp.z);
- SkipSpaces(&sz);
- curVertices.push_back(temp);
-
- // Read the vertex normals
- sz = fast_atof_move(sz,(float&)temp.x);
- SkipSpaces(&sz);
-
- sz = fast_atof_move(sz,(float&)temp.y);
- SkipSpaces(&sz);
-
- sz = fast_atof_move(sz,(float&)temp.z);
- SkipSpaces(&sz);
- curNormals.push_back(temp);
-
- // read the vertex colors
- uint32_t clr = strtol16(sz,&sz);
- ColorFromARGBPacked(clr,c);
-
- if (!curColors.empty() && c != *(curColors.end()-1))
- useColors = true;
-
- curColors.push_back(c);
- SkipSpaces(&sz);
-
-
- // read the first UV coordinate set
- sz = fast_atof_move(sz,(float&)temp.x);
- SkipSpaces(&sz);
-
- sz = fast_atof_move(sz,(float&)temp.y);
- SkipSpaces(&sz);
- temp.z = 0.f;
- temp.y = 1.f - temp.y; // DX to OGL
- curUVs.push_back(temp);
-
- // read the (optional) second UV coordinate set
- if (vertexFormat == 1) {
- sz = fast_atof_move(sz,(float&)temp.x);
- SkipSpaces(&sz);
-
- sz = fast_atof_move(sz,(float&)temp.y);
- temp.y = 1.f - temp.y; // DX to OGL
- curUV2s.push_back(temp);
- }
- // read optional tangent and bitangent vectors
- else if (vertexFormat == 2) {
- // tangents
- sz = fast_atof_move(sz,(float&)temp.x);
- SkipSpaces(&sz);
-
- sz = fast_atof_move(sz,(float&)temp.z);
- SkipSpaces(&sz);
-
- sz = fast_atof_move(sz,(float&)temp.y);
- SkipSpaces(&sz);
- temp.y *= -1.0f;
- curTangents.push_back(temp);
-
- // bitangents
- sz = fast_atof_move(sz,(float&)temp.x);
- SkipSpaces(&sz);
-
- sz = fast_atof_move(sz,(float&)temp.z);
- SkipSpaces(&sz);
-
- sz = fast_atof_move(sz,(float&)temp.y);
- SkipSpaces(&sz);
- temp.y *= -1.0f;
- curBitangents.push_back(temp);
- }
- }
-
- /* IMPORTANT: We assume that each vertex is specified in one
- line. So we can skip the rest of the line - unknown vertex
- elements are ignored.
- */
-
- while (SkipLine(&sz));
- }
- else if (textMeaning == 2) {
- textMeaning = 0;
-
- // read indices
- aiFace* curFace = curMesh->mFaces;
- aiFace* const faceEnd = curMesh->mFaces + curMesh->mNumFaces;
-
- aiVector3D* pcV = curMesh->mVertices;
- aiVector3D* pcN = curMesh->mNormals;
- aiVector3D* pcT = curMesh->mTangents;
- aiVector3D* pcB = curMesh->mBitangents;
- aiColor4D* pcC0 = curMesh->mColors[0];
- aiVector3D* pcT0 = curMesh->mTextureCoords[0];
- aiVector3D* pcT1 = curMesh->mTextureCoords[1];
-
- unsigned int curIdx = 0;
- unsigned int total = 0;
- while (SkipSpacesAndLineEnd(&sz)) {
- if (curFace >= faceEnd) {
- DefaultLogger::get()->error("IRRMESH: Too many indices");
- break;
- }
- if (!curIdx) {
- curFace->mNumIndices = 3;
- curFace->mIndices = new unsigned int[3];
- }
-
- unsigned int idx = strtol10(sz,&sz);
- if (idx >= curVertices.size()) {
- DefaultLogger::get()->error("IRRMESH: Index out of range");
- idx = 0;
- }
-
- curFace->mIndices[curIdx] = total++;
-
- *pcV++ = curVertices[idx];
- if (pcN)*pcN++ = curNormals[idx];
- if (pcT)*pcT++ = curTangents[idx];
- if (pcB)*pcB++ = curBitangents[idx];
- if (pcC0)*pcC0++ = curColors[idx];
- if (pcT0)*pcT0++ = curUVs[idx];
- if (pcT1)*pcT1++ = curUV2s[idx];
-
- if (++curIdx == 3) {
- ++curFace;
- curIdx = 0;
- }
- }
-
- if (curFace != faceEnd)
- DefaultLogger::get()->error("IRRMESH: Not enough indices");
-
- // Finish processing the mesh - do some small material workarounds
- if (curMatFlags & AI_IRRMESH_MAT_trans_vertex_alpha && !useColors) {
- // Take the opacity value of the current material
- // from the common vertex color alpha
- MaterialHelper* mat = (MaterialHelper*)curMat;
- mat->AddProperty(&curColors[0].a,1,AI_MATKEY_OPACITY);
- }
- }}
- break;
-
- default:
-
- // GCC complains here ...
- break;
-
- };
- }
-
- // End of the last buffer. A material and a mesh should be there
- if (curMat || curMesh) {
- if ( !curMat || !curMesh) {
- DefaultLogger::get()->error("IRRMESH: A buffer must contain a mesh and a material");
- delete curMat;
- delete curMesh;
- }
- else {
- materials.push_back(curMat);
- meshes.push_back(curMesh);
- }
- }
-
- if (materials.empty())
- throw DeadlyImportError("IRRMESH: Unable to read a mesh from this file");
-
-
- // now generate the output scene
- pScene->mNumMeshes = (unsigned int)meshes.size();
- pScene->mMeshes = new aiMesh*[pScene->mNumMeshes];
- for (unsigned int i = 0; i < pScene->mNumMeshes;++i) {
- pScene->mMeshes[i] = meshes[i];
-
- // clean this value ...
- pScene->mMeshes[i]->mNumUVComponents[3] = 0;
- }
-
- pScene->mNumMaterials = (unsigned int)materials.size();
- pScene->mMaterials = new aiMaterial*[pScene->mNumMaterials];
- ::memcpy(pScene->mMaterials,&materials[0],sizeof(void*)*pScene->mNumMaterials);
-
- pScene->mRootNode = new aiNode();
- pScene->mRootNode->mName.Set("<IRRMesh>");
- pScene->mRootNode->mNumMeshes = pScene->mNumMeshes;
- pScene->mRootNode->mMeshes = new unsigned int[pScene->mNumMeshes];
-
- for (unsigned int i = 0; i < pScene->mNumMeshes;++i)
- pScene->mRootNode->mMeshes[i] = i;
-
- // clean up and return
- delete reader;
- AI_DEBUG_INVALIDATE_PTR(reader);
-}
diff --git a/3rdparty/assimp/code/IRRMeshLoader.h b/3rdparty/assimp/code/IRRMeshLoader.h
deleted file mode 100644
index e5a94dff..00000000
--- a/3rdparty/assimp/code/IRRMeshLoader.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file IRRMeshLoader.h
- * @brief Declaration of the .irrMesh (Irrlight Engine Mesh Format)
- * importer class.
- */
-#ifndef AI_IRRMESHLOADER_H_INCLUDED
-#define AI_IRRMESHLOADER_H_INCLUDED
-
-#include "BaseImporter.h"
-#include "IRRShared.h"
-
-namespace Assimp {
-
-// ---------------------------------------------------------------------------
-/** IrrMesh importer class.
- *
- * IrrMesh is the native file format of the Irrlight engine and its editor
- * irrEdit. As IrrEdit itself is capable of importing quite many file formats,
- * it might be a good file format for data exchange.
- */
-class IRRMeshImporter : public BaseImporter, public IrrlichtBase
-{
- friend class Importer;
-
-protected:
- /** Constructor to be privately used by Importer */
- IRRMeshImporter();
-
- /** Destructor, private as well */
- ~IRRMeshImporter();
-
-public:
-
- // -------------------------------------------------------------------
- /** Returns whether the class can handle the format of the given file.
- * See BaseImporter::CanRead() for details.
- */
- bool CanRead( const std::string& pFile, IOSystem* pIOHandler,
- bool checkSig) const;
-
-protected:
-
- // -------------------------------------------------------------------
- /** Called by Importer::GetExtensionList() for each loaded importer.
- * See BaseImporter::GetExtensionList() for details
- */
- void GetExtensionList(std::set<std::string>& extensions);
-
- // -------------------------------------------------------------------
- /** Imports the given file into the given scene structure.
- * See BaseImporter::InternReadFile() for details
- */
- void InternReadFile( const std::string& pFile, aiScene* pScene,
- IOSystem* pIOHandler);
-
-};
-
-} // end of namespace Assimp
-
-#endif // AI_IRRMESHIMPORTER_H_INC
diff --git a/3rdparty/assimp/code/IRRShared.cpp b/3rdparty/assimp/code/IRRShared.cpp
deleted file mode 100644
index d3010705..00000000
--- a/3rdparty/assimp/code/IRRShared.cpp
+++ /dev/null
@@ -1,496 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file IRRShared.cpp
- * @brief Shared utilities for the IRR and IRRMESH loaders
- */
-
-#include "AssimpPCH.h"
-
-#include "IRRShared.h"
-#include "ParsingUtils.h"
-#include "fast_atof.h"
-
-using namespace Assimp;
-using namespace irr;
-using namespace irr::io;
-
-// Transformation matrix to convert from Assimp to IRR space
-const aiMatrix4x4 Assimp::AI_TO_IRR_MATRIX = aiMatrix4x4 (
- 1.0f, 0.0f, 0.0f, 0.0f,
- 0.0f, 0.0f, 1.0f, 0.0f,
- 0.0f, 1.0f, 0.0f, 0.0f,
- 0.0f, 0.0f, 0.0f, 1.0f);
-
-// ------------------------------------------------------------------------------------------------
-// read a property in hexadecimal format (i.e. ffffffff)
-void IrrlichtBase::ReadHexProperty (HexProperty& out)
-{
- for (int i = 0; i < reader->getAttributeCount();++i)
- {
- if (!ASSIMP_stricmp(reader->getAttributeName(i),"name"))
- {
- out.name = std::string( reader->getAttributeValue(i) );
- }
- else if (!ASSIMP_stricmp(reader->getAttributeName(i),"value"))
- {
- // parse the hexadecimal value
- out.value = strtol16(reader->getAttributeValue(i));
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// read a decimal property
-void IrrlichtBase::ReadIntProperty (IntProperty& out)
-{
- for (int i = 0; i < reader->getAttributeCount();++i)
- {
- if (!ASSIMP_stricmp(reader->getAttributeName(i),"name"))
- {
- out.name = std::string( reader->getAttributeValue(i) );
- }
- else if (!ASSIMP_stricmp(reader->getAttributeName(i),"value"))
- {
- // parse the ecimal value
- out.value = strtol10s(reader->getAttributeValue(i));
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// read a string property
-void IrrlichtBase::ReadStringProperty (StringProperty& out)
-{
- for (int i = 0; i < reader->getAttributeCount();++i)
- {
- if (!ASSIMP_stricmp(reader->getAttributeName(i),"name"))
- {
- out.name = std::string( reader->getAttributeValue(i) );
- }
- else if (!ASSIMP_stricmp(reader->getAttributeName(i),"value"))
- {
- // simple copy the string
- out.value = std::string (reader->getAttributeValue(i));
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// read a boolean property
-void IrrlichtBase::ReadBoolProperty (BoolProperty& out)
-{
- for (int i = 0; i < reader->getAttributeCount();++i)
- {
- if (!ASSIMP_stricmp(reader->getAttributeName(i),"name"))
- {
- out.name = std::string( reader->getAttributeValue(i) );
- }
- else if (!ASSIMP_stricmp(reader->getAttributeName(i),"value"))
- {
- // true or false, case insensitive
- out.value = (ASSIMP_stricmp( reader->getAttributeValue(i),
- "true") ? false : true);
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// read a float property
-void IrrlichtBase::ReadFloatProperty (FloatProperty& out)
-{
- for (int i = 0; i < reader->getAttributeCount();++i)
- {
- if (!ASSIMP_stricmp(reader->getAttributeName(i),"name"))
- {
- out.name = std::string( reader->getAttributeValue(i) );
- }
- else if (!ASSIMP_stricmp(reader->getAttributeName(i),"value"))
- {
- // just parse the float
- out.value = fast_atof( reader->getAttributeValue(i) );
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// read a vector property
-void IrrlichtBase::ReadVectorProperty (VectorProperty& out)
-{
- for (int i = 0; i < reader->getAttributeCount();++i)
- {
- if (!ASSIMP_stricmp(reader->getAttributeName(i),"name"))
- {
- out.name = std::string( reader->getAttributeValue(i) );
- }
- else if (!ASSIMP_stricmp(reader->getAttributeName(i),"value"))
- {
- // three floats, separated with commas
- const char* ptr = reader->getAttributeValue(i);
-
- SkipSpaces(&ptr);
- ptr = fast_atof_move( ptr,(float&)out.value.x );
- SkipSpaces(&ptr);
- if (',' != *ptr)
- {
- DefaultLogger::get()->error("IRR(MESH): Expected comma in vector definition");
- }
- else SkipSpaces(ptr+1,&ptr);
- ptr = fast_atof_move( ptr,(float&)out.value.y );
- SkipSpaces(&ptr);
- if (',' != *ptr)
- {
- DefaultLogger::get()->error("IRR(MESH): Expected comma in vector definition");
- }
- else SkipSpaces(ptr+1,&ptr);
- ptr = fast_atof_move( ptr,(float&)out.value.z );
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Convert a string to a proper aiMappingMode
-int ConvertMappingMode(const std::string& mode)
-{
- if (mode == "texture_clamp_repeat")
- {
- return aiTextureMapMode_Wrap;
- }
- else if (mode == "texture_clamp_mirror")
- return aiTextureMapMode_Mirror;
-
- return aiTextureMapMode_Clamp;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Parse a material from the XML file
-aiMaterial* IrrlichtBase::ParseMaterial(unsigned int& matFlags)
-{
- MaterialHelper* mat = new MaterialHelper();
- aiColor4D clr;
- aiString s;
-
- matFlags = 0; // zero output flags
- int cnt = 0; // number of used texture channels
- unsigned int nd = 0;
-
- // Continue reading from the file
- while (reader->read())
- {
- switch (reader->getNodeType())
- {
- case EXN_ELEMENT:
-
- // Hex properties
- if (!ASSIMP_stricmp(reader->getNodeName(),"color"))
- {
- HexProperty prop;
- ReadHexProperty(prop);
- if (prop.name == "Diffuse")
- {
- ColorFromARGBPacked(prop.value,clr);
- mat->AddProperty(&clr,1,AI_MATKEY_COLOR_DIFFUSE);
- }
- else if (prop.name == "Ambient")
- {
- ColorFromARGBPacked(prop.value,clr);
- mat->AddProperty(&clr,1,AI_MATKEY_COLOR_AMBIENT);
- }
- else if (prop.name == "Specular")
- {
- ColorFromARGBPacked(prop.value,clr);
- mat->AddProperty(&clr,1,AI_MATKEY_COLOR_SPECULAR);
- }
-
- // NOTE: The 'emissive' property causes problems. It is
- // often != 0, even if there is obviously no light
- // emitted by the described surface. In fact I think
- // IRRLICHT ignores this property, too.
-#if 0
- else if (prop.name == "Emissive")
- {
- ColorFromARGBPacked(prop.value,clr);
- mat->AddProperty(&clr,1,AI_MATKEY_COLOR_EMISSIVE);
- }
-#endif
- }
- // Float properties
- else if (!ASSIMP_stricmp(reader->getNodeName(),"float"))
- {
- FloatProperty prop;
- ReadFloatProperty(prop);
- if (prop.name == "Shininess")
- {
- mat->AddProperty(&prop.value,1,AI_MATKEY_SHININESS);
- }
- }
- // Bool properties
- else if (!ASSIMP_stricmp(reader->getNodeName(),"bool"))
- {
- BoolProperty prop;
- ReadBoolProperty(prop);
- if (prop.name == "Wireframe")
- {
- int val = (prop.value ? true : false);
- mat->AddProperty(&val,1,AI_MATKEY_ENABLE_WIREFRAME);
- }
- else if (prop.name == "GouraudShading")
- {
- int val = (prop.value ? aiShadingMode_Gouraud
- : aiShadingMode_NoShading);
- mat->AddProperty(&val,1,AI_MATKEY_SHADING_MODEL);
- }
- else if (prop.name == "BackfaceCulling")
- {
- int val = (!prop.value);
- mat->AddProperty(&val,1,AI_MATKEY_TWOSIDED);
- }
- }
- // String properties - textures and texture related properties
- else if (!ASSIMP_stricmp(reader->getNodeName(),"texture") ||
- !ASSIMP_stricmp(reader->getNodeName(),"enum"))
- {
- StringProperty prop;
- ReadStringProperty(prop);
- if (prop.value.length())
- {
- // material type (shader)
- if (prop.name == "Type")
- {
- if (prop.value == "solid")
- {
- // default material ...
- }
- else if (prop.value == "trans_vertex_alpha")
- {
- matFlags = AI_IRRMESH_MAT_trans_vertex_alpha;
- }
- else if (prop.value == "lightmap")
- {
- matFlags = AI_IRRMESH_MAT_lightmap;
- }
- else if (prop.value == "solid_2layer")
- {
- matFlags = AI_IRRMESH_MAT_solid_2layer;
- }
- else if (prop.value == "lightmap_m2")
- {
- matFlags = AI_IRRMESH_MAT_lightmap_m2;
- }
- else if (prop.value == "lightmap_m4")
- {
- matFlags = AI_IRRMESH_MAT_lightmap_m4;
- }
- else if (prop.value == "lightmap_light")
- {
- matFlags = AI_IRRMESH_MAT_lightmap_light;
- }
- else if (prop.value == "lightmap_light_m2")
- {
- matFlags = AI_IRRMESH_MAT_lightmap_light_m2;
- }
- else if (prop.value == "lightmap_light_m4")
- {
- matFlags = AI_IRRMESH_MAT_lightmap_light_m4;
- }
- else if (prop.value == "lightmap_add")
- {
- matFlags = AI_IRRMESH_MAT_lightmap_add;
- }
- // Normal and parallax maps are treated equally
- else if (prop.value == "normalmap_solid" ||
- prop.value == "parallaxmap_solid")
- {
- matFlags = AI_IRRMESH_MAT_normalmap_solid;
- }
- else if (prop.value == "normalmap_trans_vertex_alpha" ||
- prop.value == "parallaxmap_trans_vertex_alpha")
- {
- matFlags = AI_IRRMESH_MAT_normalmap_tva;
- }
- else if (prop.value == "normalmap_trans_add" ||
- prop.value == "parallaxmap_trans_add")
- {
- matFlags = AI_IRRMESH_MAT_normalmap_ta;
- }
- else {
- DefaultLogger::get()->warn("IRRMat: Unrecognized material type: " + prop.value);
- }
- }
-
- // Up to 4 texture channels are supported
- if (prop.name == "Texture1")
- {
- // Always accept the primary texture channel
- ++cnt;
- s.Set(prop.value);
- mat->AddProperty(&s,AI_MATKEY_TEXTURE_DIFFUSE(0));
- }
- else if (prop.name == "Texture2" && cnt == 1)
- {
- // 2-layer material lightmapped?
- if (matFlags & AI_IRRMESH_MAT_lightmap) {
- ++cnt;
- s.Set(prop.value);
- mat->AddProperty(&s,AI_MATKEY_TEXTURE_LIGHTMAP(0));
-
- // set the corresponding material flag
- matFlags |= AI_IRRMESH_EXTRA_2ND_TEXTURE;
- }
- // alternatively: normal or parallax mapping
- else if (matFlags & AI_IRRMESH_MAT_normalmap_solid) {
- ++cnt;
- s.Set(prop.value);
- mat->AddProperty(&s,AI_MATKEY_TEXTURE_NORMALS(0));
-
- // set the corresponding material flag
- matFlags |= AI_IRRMESH_EXTRA_2ND_TEXTURE;
- }
- // or just as second diffuse texture
- else if (matFlags & AI_IRRMESH_MAT_solid_2layer) {
- ++cnt;
- s.Set(prop.value);
- mat->AddProperty(&s,AI_MATKEY_TEXTURE_DIFFUSE(1));
- ++nd;
-
- // set the corresponding material flag
- matFlags |= AI_IRRMESH_EXTRA_2ND_TEXTURE;
- }
- else DefaultLogger::get()->warn("IRRmat: Skipping second texture");
- }
-
- else if (prop.name == "Texture3" && cnt == 2)
- {
- // Irrlicht does not seem to use these channels.
- ++cnt;
- s.Set(prop.value);
- mat->AddProperty(&s,AI_MATKEY_TEXTURE_DIFFUSE(nd+1));
- }
- else if (prop.name == "Texture4" && cnt == 3)
- {
- // Irrlicht does not seem to use these channels.
- ++cnt;
- s.Set(prop.value);
- mat->AddProperty(&s,AI_MATKEY_TEXTURE_DIFFUSE(nd+2));
- }
-
- // Texture mapping options
- if (prop.name == "TextureWrap1" && cnt >= 1)
- {
- int map = ConvertMappingMode(prop.value);
- mat->AddProperty(&map,1,AI_MATKEY_MAPPINGMODE_U_DIFFUSE(0));
- mat->AddProperty(&map,1,AI_MATKEY_MAPPINGMODE_V_DIFFUSE(0));
- }
- else if (prop.name == "TextureWrap2" && cnt >= 2)
- {
- int map = ConvertMappingMode(prop.value);
- if (matFlags & AI_IRRMESH_MAT_lightmap) {
- mat->AddProperty(&map,1,AI_MATKEY_MAPPINGMODE_U_LIGHTMAP(0));
- mat->AddProperty(&map,1,AI_MATKEY_MAPPINGMODE_V_LIGHTMAP(0));
- }
- else if (matFlags & (AI_IRRMESH_MAT_normalmap_solid)) {
- mat->AddProperty(&map,1,AI_MATKEY_MAPPINGMODE_U_NORMALS(0));
- mat->AddProperty(&map,1,AI_MATKEY_MAPPINGMODE_V_NORMALS(0));
- }
- else if (matFlags & AI_IRRMESH_MAT_solid_2layer) {
- mat->AddProperty(&map,1,AI_MATKEY_MAPPINGMODE_U_DIFFUSE(1));
- mat->AddProperty(&map,1,AI_MATKEY_MAPPINGMODE_V_DIFFUSE(1));
- }
- }
- else if (prop.name == "TextureWrap3" && cnt >= 3)
- {
- int map = ConvertMappingMode(prop.value);
- mat->AddProperty(&map,1,AI_MATKEY_MAPPINGMODE_U_DIFFUSE(nd+1));
- mat->AddProperty(&map,1,AI_MATKEY_MAPPINGMODE_V_DIFFUSE(nd+1));
- }
- else if (prop.name == "TextureWrap4" && cnt >= 4)
- {
- int map = ConvertMappingMode(prop.value);
- mat->AddProperty(&map,1,AI_MATKEY_MAPPINGMODE_U_DIFFUSE(nd+2));
- mat->AddProperty(&map,1,AI_MATKEY_MAPPINGMODE_V_DIFFUSE(nd+2));
- }
- }
- }
- break;
- case EXN_ELEMENT_END:
-
- /* Assume there are no further nested nodes in <material> elements
- */
- if (/* IRRMESH */ !ASSIMP_stricmp(reader->getNodeName(),"material") ||
- /* IRR */ !ASSIMP_stricmp(reader->getNodeName(),"attributes"))
- {
- // Now process lightmapping flags
- // We should have at least one textur to do that ..
- if (cnt && matFlags & AI_IRRMESH_MAT_lightmap)
- {
- float f = 1.f;
- unsigned int unmasked = matFlags&~AI_IRRMESH_MAT_lightmap;
-
- // Additive lightmap?
- int op = (unmasked & AI_IRRMESH_MAT_lightmap_add
- ? aiTextureOp_Add : aiTextureOp_Multiply);
-
- // Handle Irrlicht's lightmapping scaling factor
- if (unmasked & AI_IRRMESH_MAT_lightmap_m2 ||
- unmasked & AI_IRRMESH_MAT_lightmap_light_m2)
- {
- f = 2.f;
- }
- else if (unmasked & AI_IRRMESH_MAT_lightmap_m4 ||
- unmasked & AI_IRRMESH_MAT_lightmap_light_m4)
- {
- f = 4.f;
- }
- mat->AddProperty( &f, 1, AI_MATKEY_TEXBLEND_LIGHTMAP(0));
- mat->AddProperty( &op,1, AI_MATKEY_TEXOP_LIGHTMAP(0));
- }
-
- return mat;
- }
- default:
-
- // GCC complains here ...
- break;
- }
- }
- DefaultLogger::get()->error("IRRMESH: Unexpected end of file. Material is not complete");
- return mat;
-}
diff --git a/3rdparty/assimp/code/IRRShared.h b/3rdparty/assimp/code/IRRShared.h
deleted file mode 100644
index e4081336..00000000
--- a/3rdparty/assimp/code/IRRShared.h
+++ /dev/null
@@ -1,115 +0,0 @@
-
-
-/** @file IRRShared.h
- * @brief Shared utilities for the IRR and IRRMESH loaders
- */
-
-#ifndef INCLUDED_AI_IRRSHARED_H
-#define INCLUDED_AI_IRRSHARED_H
-
-#include "irrXMLWrapper.h"
-#include "BaseImporter.h"
-
-namespace Assimp {
-
-
-/** @brief Matrix to convert from Assimp to IRR and backwards
- */
-extern const aiMatrix4x4 AI_TO_IRR_MATRIX;
-
-
-// Default: 0 = solid, one texture
-#define AI_IRRMESH_MAT_solid_2layer 0x10000
-
-// Transparency flags
-#define AI_IRRMESH_MAT_trans_vertex_alpha 0x1
-#define AI_IRRMESH_MAT_trans_add 0x2
-
-// Lightmapping flags
-#define AI_IRRMESH_MAT_lightmap 0x2
-#define AI_IRRMESH_MAT_lightmap_m2 (AI_IRRMESH_MAT_lightmap|0x4)
-#define AI_IRRMESH_MAT_lightmap_m4 (AI_IRRMESH_MAT_lightmap|0x8)
-#define AI_IRRMESH_MAT_lightmap_light (AI_IRRMESH_MAT_lightmap|0x10)
-#define AI_IRRMESH_MAT_lightmap_light_m2 (AI_IRRMESH_MAT_lightmap|0x20)
-#define AI_IRRMESH_MAT_lightmap_light_m4 (AI_IRRMESH_MAT_lightmap|0x40)
-#define AI_IRRMESH_MAT_lightmap_add (AI_IRRMESH_MAT_lightmap|0x80)
-
-// Standard NormalMap (or Parallax map, they're treated equally)
-#define AI_IRRMESH_MAT_normalmap_solid (0x100)
-
-// Normal map combined with vertex alpha
-#define AI_IRRMESH_MAT_normalmap_tva \
- (AI_IRRMESH_MAT_normalmap_solid | AI_IRRMESH_MAT_trans_vertex_alpha)
-
-// Normal map combined with additive transparency
-#define AI_IRRMESH_MAT_normalmap_ta \
- (AI_IRRMESH_MAT_normalmap_solid | AI_IRRMESH_MAT_trans_add)
-
-// Special flag. It indicates a second texture has been found
-// Its type depends ... either a normal textue or a normal map
-#define AI_IRRMESH_EXTRA_2ND_TEXTURE 0x100000
-
-// ---------------------------------------------------------------------------
-/** Base class for the Irr and IrrMesh importers.
- *
- * Declares some irrlight-related xml parsing utilities and provides tools
- * to load materials from IRR and IRRMESH files.
- */
-class IrrlichtBase
-{
-protected:
-
- /** @brief Data structure for a simple name-value property
- */
- template <class T>
- struct Property
- {
- std::string name;
- T value;
- };
-
- typedef Property<uint32_t> HexProperty;
- typedef Property<std::string> StringProperty;
- typedef Property<bool> BoolProperty;
- typedef Property<float> FloatProperty;
- typedef Property<aiVector3D> VectorProperty;
- typedef Property<int> IntProperty;
-
- /** XML reader instance
- */
- irr::io::IrrXMLReader* reader;
-
- // -------------------------------------------------------------------
- /** Parse a material description from the XML
- * @return The created material
- * @param matFlags Receives AI_IRRMESH_MAT_XX flags
- */
- aiMaterial* ParseMaterial(unsigned int& matFlags);
-
- // -------------------------------------------------------------------
- /** Read a property of the specified type from the current XML element.
- * @param out Recives output data
- */
- void ReadHexProperty (HexProperty& out);
- void ReadStringProperty (StringProperty& out);
- void ReadBoolProperty (BoolProperty& out);
- void ReadFloatProperty (FloatProperty& out);
- void ReadVectorProperty (VectorProperty& out);
- void ReadIntProperty (IntProperty& out);
-};
-
-
-// ------------------------------------------------------------------------------------------------
-// Unpack a hex color, e.g. 0xdcdedfff
-inline void ColorFromARGBPacked(uint32_t in, aiColor4D& clr)
-{
- clr.a = ((in >> 24) & 0xff) / 255.f;
- clr.r = ((in >> 16) & 0xff) / 255.f;
- clr.g = ((in >> 8) & 0xff) / 255.f;
- clr.b = ((in ) & 0xff) / 255.f;
-}
-
-
-} // end namespace Assimp
-
-#endif // !! INCLUDED_AI_IRRSHARED_H
diff --git a/3rdparty/assimp/code/Importer.cpp b/3rdparty/assimp/code/Importer.cpp
deleted file mode 100644
index 3f158360..00000000
--- a/3rdparty/assimp/code/Importer.cpp
+++ /dev/null
@@ -1,1415 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file Importer.cpp
- * @brief Implementation of the CPP-API class #Importer
- */
-
-#include "AssimpPCH.h"
-#include "../include/aiVersion.h"
-
-// ------------------------------------------------------------------------------------------------
-/* Uncomment this line to prevent Assimp from catching unknown exceptions.
- *
- * Note that any Exception except DeadlyImportError may lead to
- * undefined behaviour -> loaders could remain in an unusable state and
- * further imports with the same Importer instance could fail/crash/burn ...
- */
-// ------------------------------------------------------------------------------------------------
-#define ASSIMP_CATCH_GLOBAL_EXCEPTIONS
-
-
-// ------------------------------------------------------------------------------------------------
-// Internal headers
-// ------------------------------------------------------------------------------------------------
-#include "BaseImporter.h"
-#include "BaseProcess.h"
-#include "DefaultIOStream.h"
-#include "DefaultIOSystem.h"
-#include "DefaultProgressHandler.h"
-#include "GenericProperty.h"
-#include "ProcessHelper.h"
-#include "ScenePreprocessor.h"
-#include "MemoryIOWrapper.h"
-#include "Profiler.h"
-#include "TinyFormatter.h"
-
-using namespace Assimp::Profiling;
-using namespace Assimp::Formatter;
-
-// ------------------------------------------------------------------------------------------------
-// Importers
-// (include_new_importers_here)
-// ------------------------------------------------------------------------------------------------
-#ifndef ASSIMP_BUILD_NO_X_IMPORTER
-# include "XFileImporter.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_3DS_IMPORTER
-# include "3DSLoader.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_MD3_IMPORTER
-# include "MD3Loader.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_MDL_IMPORTER
-# include "MDLLoader.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_MD2_IMPORTER
-# include "MD2Loader.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_PLY_IMPORTER
-# include "PlyLoader.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_ASE_IMPORTER
-# include "ASELoader.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_OBJ_IMPORTER
-# include "ObjFileImporter.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_HMP_IMPORTER
-# include "HMPLoader.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_SMD_IMPORTER
-# include "SMDLoader.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_MDC_IMPORTER
-# include "MDCLoader.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_MD5_IMPORTER
-# include "MD5Loader.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_STL_IMPORTER
-# include "STLLoader.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_LWO_IMPORTER
-# include "LWOLoader.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_DXF_IMPORTER
-# include "DXFLoader.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_NFF_IMPORTER
-# include "NFFLoader.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_RAW_IMPORTER
-# include "RawLoader.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_OFF_IMPORTER
-# include "OFFLoader.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_AC_IMPORTER
-# include "ACLoader.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_BVH_IMPORTER
-# include "BVHLoader.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_IRRMESH_IMPORTER
-# include "IRRMeshLoader.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_IRR_IMPORTER
-# include "IRRLoader.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_Q3D_IMPORTER
-# include "Q3DLoader.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_B3D_IMPORTER
-# include "B3DImporter.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_COLLADA_IMPORTER
-# include "ColladaLoader.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_TERRAGEN_IMPORTER
-# include "TerragenLoader.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_CSM_IMPORTER
-# include "CSMLoader.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_3D_IMPORTER
-# include "UnrealLoader.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_LWS_IMPORTER
-# include "LWSLoader.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_OGRE_IMPORTER
-# include "OgreImporter.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_MS3D_IMPORTER
-# include "MS3DLoader.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_COB_IMPORTER
-# include "COBLoader.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_BLEND_IMPORTER
-# include "BlenderLoader.h"
-#endif
-//#ifndef ASSIMP_BUILD_NO_SWORDOFMOONLIGHT_IMPORTER
-//# include "SomLoader.h"
-//#endif
-#ifndef ASSIMP_BUILD_NO_Q3BSP_IMPORTER
-# include "Q3BSPFileImporter.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_NDO_IMPORTER
-# include "NDOLoader.h"
-#endif
-
-// ------------------------------------------------------------------------------------------------
-// Post processing-Steps
-// ------------------------------------------------------------------------------------------------
-#ifndef ASSIMP_BUILD_NO_CALCTANGENTS_PROCESS
-# include "CalcTangentsProcess.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_JOINVERTICES_PROCESS
-# include "JoinVerticesProcess.h"
-#endif
-#if !(defined ASSIMP_BUILD_NO_MAKELEFTHANDED_PROCESS && defined ASSIMP_BUILD_NO_FLIPUVS_PROCESS && defined ASSIMP_BUILD_NO_FLIPWINDINGORDER_PROCESS)
-# include "ConvertToLHProcess.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_TRIANGULATE_PROCESS
-# include "TriangulateProcess.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_GENFACENORMALS_PROCESS
-# include "GenFaceNormalsProcess.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_GENVERTEXNORMALS_PROCESS
-# include "GenVertexNormalsProcess.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_REMOVEVC_PROCESS
-# include "RemoveVCProcess.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_SPLITLARGEMESHES_PROCESS
-# include "SplitLargeMeshes.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_PRETRANSFORMVERTICES_PROCESS
-# include "PretransformVertices.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_LIMITBONEWEIGHTS_PROCESS
-# include "LimitBoneWeightsProcess.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_VALIDATEDS_PROCESS
-# include "ValidateDataStructure.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_IMPROVECACHELOCALITY_PROCESS
-# include "ImproveCacheLocality.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_FIXINFACINGNORMALS_PROCESS
-# include "FixNormalsStep.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_REMOVE_REDUNDANTMATERIALS_PROCESS
-# include "RemoveRedundantMaterials.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_FINDINVALIDDATA_PROCESS
-# include "FindInvalidDataProcess.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_FINDDEGENERATES_PROCESS
-# include "FindDegenerates.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_SORTBYPTYPE_PROCESS
-# include "SortByPTypeProcess.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_GENUVCOORDS_PROCESS
-# include "ComputeUVMappingProcess.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_TRANSFORMTEXCOORDS_PROCESS
-# include "TextureTransform.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_FINDINSTANCES_PROCESS
-# include "FindInstancesProcess.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_OPTIMIZEMESHES_PROCESS
-# include "OptimizeMeshes.h"
-#endif
-#ifndef ASSIMP_BUILD_NO_OPTIMIZEGRAPH_PROCESS
-# include "OptimizeGraph.h"
-#endif
-
-using namespace Assimp;
-using namespace Assimp::Intern;
-
-// ------------------------------------------------------------------------------------------------
-// Intern::AllocateFromAssimpHeap serves as abstract base class. It overrides
-// new and delete (and their array counterparts) of public API classes (e.g. Logger) to
-// utilize our DLL heap.
-// See http://www.gotw.ca/publications/mill15.htm
-// ------------------------------------------------------------------------------------------------
-void* AllocateFromAssimpHeap::operator new ( size_t num_bytes) {
- return ::operator new(num_bytes);
-}
-
-void* AllocateFromAssimpHeap::operator new ( size_t num_bytes, const std::nothrow_t& ) throw() {
- try {
- return AllocateFromAssimpHeap::operator new( num_bytes );
- }
- catch( ... ) {
- return NULL;
- }
-}
-
-void AllocateFromAssimpHeap::operator delete ( void* data) {
- return ::operator delete(data);
-}
-
-void* AllocateFromAssimpHeap::operator new[] ( size_t num_bytes) {
- return ::operator new[](num_bytes);
-}
-
-void* AllocateFromAssimpHeap::operator new[] ( size_t num_bytes, const std::nothrow_t& ) throw() {
- try {
- return AllocateFromAssimpHeap::operator new[]( num_bytes );
- }
- catch( ... ) {
- return NULL;
- }
-}
-
-void AllocateFromAssimpHeap::operator delete[] ( void* data) {
- return ::operator delete[](data);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Importer constructor.
-Importer::Importer()
-{
- // allocate the pimpl first
- pimpl = new ImporterPimpl();
-
- pimpl->mScene = NULL;
- pimpl->mErrorString = "";
-
- // Allocate a default IO handler
- pimpl->mIOHandler = new DefaultIOSystem;
- pimpl->mIsDefaultHandler = true;
- pimpl->bExtraVerbose = false; // disable extra verbose mode by default
-
- pimpl->mProgressHandler = new DefaultProgressHandler();
- pimpl->mIsDefaultProgressHandler = true;
-
- // ----------------------------------------------------------------------------
- // Add an instance of each worker class here
- // (register_new_importers_here)
- // ----------------------------------------------------------------------------
- pimpl->mImporter.reserve(64);
-#if (!defined ASSIMP_BUILD_NO_X_IMPORTER)
- pimpl->mImporter.push_back( new XFileImporter());
-#endif
-#if (!defined ASSIMP_BUILD_NO_OBJ_IMPORTER)
- pimpl->mImporter.push_back( new ObjFileImporter());
-#endif
-#if (!defined ASSIMP_BUILD_NO_3DS_IMPORTER)
- pimpl->mImporter.push_back( new Discreet3DSImporter());
-#endif
-#if (!defined ASSIMP_BUILD_NO_MD3_IMPORTER)
- pimpl->mImporter.push_back( new MD3Importer());
-#endif
-#if (!defined ASSIMP_BUILD_NO_MD2_IMPORTER)
- pimpl->mImporter.push_back( new MD2Importer());
-#endif
-#if (!defined ASSIMP_BUILD_NO_PLY_IMPORTER)
- pimpl->mImporter.push_back( new PLYImporter());
-#endif
-#if (!defined ASSIMP_BUILD_NO_MDL_IMPORTER)
- pimpl->mImporter.push_back( new MDLImporter());
-#endif
-#if (!defined ASSIMP_BUILD_NO_ASE_IMPORTER)
- pimpl->mImporter.push_back( new ASEImporter());
-#endif
-#if (!defined ASSIMP_BUILD_NO_HMP_IMPORTER)
- pimpl->mImporter.push_back( new HMPImporter());
-#endif
-#if (!defined ASSIMP_BUILD_NO_SMD_IMPORTER)
- pimpl->mImporter.push_back( new SMDImporter());
-#endif
-#if (!defined ASSIMP_BUILD_NO_MDC_IMPORTER)
- pimpl->mImporter.push_back( new MDCImporter());
-#endif
-#if (!defined ASSIMP_BUILD_NO_MD5_IMPORTER)
- pimpl->mImporter.push_back( new MD5Importer());
-#endif
-#if (!defined ASSIMP_BUILD_NO_STL_IMPORTER)
- pimpl->mImporter.push_back( new STLImporter());
-#endif
-#if (!defined ASSIMP_BUILD_NO_LWO_IMPORTER)
- pimpl->mImporter.push_back( new LWOImporter());
-#endif
-#if (!defined ASSIMP_BUILD_NO_DXF_IMPORTER)
- pimpl->mImporter.push_back( new DXFImporter());
-#endif
-#if (!defined ASSIMP_BUILD_NO_NFF_IMPORTER)
- pimpl->mImporter.push_back( new NFFImporter());
-#endif
-#if (!defined ASSIMP_BUILD_NO_RAW_IMPORTER)
- pimpl->mImporter.push_back( new RAWImporter());
-#endif
-#if (!defined ASSIMP_BUILD_NO_OFF_IMPORTER)
- pimpl->mImporter.push_back( new OFFImporter());
-#endif
-#if (!defined ASSIMP_BUILD_NO_AC_IMPORTER)
- pimpl->mImporter.push_back( new AC3DImporter());
-#endif
-#if (!defined ASSIMP_BUILD_NO_BVH_IMPORTER)
- pimpl->mImporter.push_back( new BVHLoader());
-#endif
-#if (!defined ASSIMP_BUILD_NO_IRRMESH_IMPORTER)
- pimpl->mImporter.push_back( new IRRMeshImporter());
-#endif
-#if (!defined ASSIMP_BUILD_NO_IRR_IMPORTER)
- pimpl->mImporter.push_back( new IRRImporter());
-#endif
-#if (!defined ASSIMP_BUILD_NO_Q3D_IMPORTER)
- pimpl->mImporter.push_back( new Q3DImporter());
-#endif
-#if (!defined ASSIMP_BUILD_NO_B3D_IMPORTER)
- pimpl->mImporter.push_back( new B3DImporter());
-#endif
-#if (!defined ASSIMP_BUILD_NO_COLLADA_IMPORTER)
- pimpl->mImporter.push_back( new ColladaLoader());
-#endif
-#if (!defined ASSIMP_BUILD_NO_TERRAGEN_IMPORTER)
- pimpl->mImporter.push_back( new TerragenImporter());
-#endif
-#if (!defined ASSIMP_BUILD_NO_CSM_IMPORTER)
- pimpl->mImporter.push_back( new CSMImporter());
-#endif
-#if (!defined ASSIMP_BUILD_NO_3D_IMPORTER)
- pimpl->mImporter.push_back( new UnrealImporter());
-#endif
-#if (!defined ASSIMP_BUILD_NO_LWS_IMPORTER)
- pimpl->mImporter.push_back( new LWSImporter());
-#endif
-#if (!defined ASSIMP_BUILD_NO_OGRE_IMPORTER)
- pimpl->mImporter.push_back( new Ogre::OgreImporter());
-#endif
-#if (!defined ASSIMP_BUILD_NO_MS3D_IMPORTER)
- pimpl->mImporter.push_back( new MS3DImporter());
-#endif
-#if (!defined ASSIMP_BUILD_NO_COB_IMPORTER)
- pimpl->mImporter.push_back( new COBImporter());
-#endif
-#if (!defined ASSIMP_BUILD_NO_BLEND_IMPORTER)
- pimpl->mImporter.push_back( new BlenderImporter());
-#endif
-//#if (!defined ASSIMP_BUILD_NO_SWORDOFMOONLIGHT_IMPORTER)
-// pimpl->mImporter.push_back( new SomImporter());
-//#endif
-#if (!defined ASSIMP_BUILD_NO_Q3BSP_IMPORTER)
- pimpl->mImporter.push_back( new Q3BSPFileImporter() );
-#endif
-#if (!defined ASSIMP_BUILD_NO_NDO_IMPORTER)
- pimpl->mImporter.push_back( new NDOImporter() );
-#endif
-
- // ----------------------------------------------------------------------------
- // Add an instance of each post processing step here in the order
- // of sequence it is executed. Steps that are added here are not
- // validated - as RegisterPPStep() does - all dependencies must be given.
- // ----------------------------------------------------------------------------
- pimpl->mPostProcessingSteps.reserve(25);
-#if (!defined ASSIMP_BUILD_NO_REMOVEVC_PROCESS)
- pimpl->mPostProcessingSteps.push_back( new RemoveVCProcess());
-#endif
-#if (!defined ASSIMP_BUILD_NO_REMOVE_REDUNDANTMATERIALS_PROCESS)
- pimpl->mPostProcessingSteps.push_back( new RemoveRedundantMatsProcess());
-#endif
-#if (!defined ASSIMP_BUILD_NO_FINDINSTANCES_PROCESS)
- pimpl->mPostProcessingSteps.push_back( new FindInstancesProcess());
-#endif
-#if (!defined ASSIMP_BUILD_NO_OPTIMIZEGRAPH_PROCESS)
- pimpl->mPostProcessingSteps.push_back( new OptimizeGraphProcess());
-#endif
-#if (!defined ASSIMP_BUILD_NO_OPTIMIZEMESHES_PROCESS)
- pimpl->mPostProcessingSteps.push_back( new OptimizeMeshesProcess());
-#endif
-#if (!defined ASSIMP_BUILD_NO_FINDDEGENERATES_PROCESS)
- pimpl->mPostProcessingSteps.push_back( new FindDegeneratesProcess());
-#endif
-#ifndef ASSIMP_BUILD_NO_GENUVCOORDS_PROCESS
- pimpl->mPostProcessingSteps.push_back( new ComputeUVMappingProcess());
-#endif
-#ifndef ASSIMP_BUILD_NO_TRANSFORMTEXCOORDS_PROCESS
- pimpl->mPostProcessingSteps.push_back( new TextureTransformStep());
-#endif
-#if (!defined ASSIMP_BUILD_NO_PRETRANSFORMVERTICES_PROCESS)
- pimpl->mPostProcessingSteps.push_back( new PretransformVertices());
-#endif
-#if (!defined ASSIMP_BUILD_NO_TRIANGULATE_PROCESS)
- pimpl->mPostProcessingSteps.push_back( new TriangulateProcess());
-#endif
-#if (!defined ASSIMP_BUILD_NO_SORTBYPTYPE_PROCESS)
- pimpl->mPostProcessingSteps.push_back( new SortByPTypeProcess());
-#endif
-#if (!defined ASSIMP_BUILD_NO_FINDINVALIDDATA_PROCESS)
- pimpl->mPostProcessingSteps.push_back( new FindInvalidDataProcess());
-#endif
-#if (!defined ASSIMP_BUILD_NO_FIXINFACINGNORMALS_PROCESS)
- pimpl->mPostProcessingSteps.push_back( new FixInfacingNormalsProcess());
-#endif
-#if (!defined ASSIMP_BUILD_NO_SPLITLARGEMESHES_PROCESS)
- pimpl->mPostProcessingSteps.push_back( new SplitLargeMeshesProcess_Triangle());
-#endif
-#if (!defined ASSIMP_BUILD_NO_GENFACENORMALS_PROCESS)
- pimpl->mPostProcessingSteps.push_back( new GenFaceNormalsProcess());
-#endif
-
- // .........................................................................
- // DON'T change the order of these five!
- pimpl->mPostProcessingSteps.push_back( new ComputeSpatialSortProcess());
- // .........................................................................
-
-#if (!defined ASSIMP_BUILD_NO_GENVERTEXNORMALS_PROCESS)
- pimpl->mPostProcessingSteps.push_back( new GenVertexNormalsProcess());
-#endif
-#if (!defined ASSIMP_BUILD_NO_CALCTANGENTS_PROCESS)
- pimpl->mPostProcessingSteps.push_back( new CalcTangentsProcess());
-#endif
-#if (!defined ASSIMP_BUILD_NO_JOINVERTICES_PROCESS)
- pimpl->mPostProcessingSteps.push_back( new JoinVerticesProcess());
-#endif
-
- // .........................................................................
- pimpl->mPostProcessingSteps.push_back( new DestroySpatialSortProcess());
- // .........................................................................
-
-#if (!defined ASSIMP_BUILD_NO_SPLITLARGEMESHES_PROCESS)
- pimpl->mPostProcessingSteps.push_back( new SplitLargeMeshesProcess_Vertex());
-#endif
-#if (!defined ASSIMP_BUILD_NO_MAKELEFTHANDED_PROCESS)
- pimpl->mPostProcessingSteps.push_back( new MakeLeftHandedProcess());
-#endif
-#if (!defined ASSIMP_BUILD_NO_FLIPUVS_PROCESS)
- pimpl->mPostProcessingSteps.push_back( new FlipUVsProcess());
-#endif
-#if (!defined ASSIMP_BUILD_NO_FLIPWINDINGORDER_PROCESS)
- pimpl->mPostProcessingSteps.push_back( new FlipWindingOrderProcess());
-#endif
-#if (!defined ASSIMP_BUILD_NO_LIMITBONEWEIGHTS_PROCESS)
- pimpl->mPostProcessingSteps.push_back( new LimitBoneWeightsProcess());
-#endif
-#if (!defined ASSIMP_BUILD_NO_IMPROVECACHELOCALITY_PROCESS)
- pimpl->mPostProcessingSteps.push_back( new ImproveCacheLocalityProcess());
-#endif
-
- // Allocate a SharedPostProcessInfo object and store pointers to it in all post-process steps in the list.
- pimpl->mPPShared = new SharedPostProcessInfo();
- for (std::vector<BaseProcess*>::iterator it = pimpl->mPostProcessingSteps.begin();
- it != pimpl->mPostProcessingSteps.end();
- ++it) {
-
- (*it)->SetSharedData(pimpl->mPPShared);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor of Importer
-Importer::~Importer()
-{
- // Delete all import plugins
- for ( unsigned int a = 0; a < pimpl->mImporter.size(); a++)
- delete pimpl->mImporter[a];
-
- // Delete all post-processing plug-ins
- for ( unsigned int a = 0; a < pimpl->mPostProcessingSteps.size(); a++)
- delete pimpl->mPostProcessingSteps[a];
-
- // Delete the assigned IO handler
- delete pimpl->mIOHandler;
-
- // Kill imported scene. Destructors should do that recursivly
- delete pimpl->mScene;
-
- // Delete shared post-processing data
- delete pimpl->mPPShared;
-
- // and finally the pimpl itself
- delete pimpl;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Copy constructor - copies the config of another Importer, not the scene
-Importer::Importer(const Importer &other)
-{
- new(this) Importer();
-
- pimpl->mIntProperties = other.pimpl->mIntProperties;
- pimpl->mFloatProperties = other.pimpl->mFloatProperties;
- pimpl->mStringProperties = other.pimpl->mStringProperties;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Register a custom post-processing step
-aiReturn Importer::RegisterPPStep(BaseProcess* pImp)
-{
- ai_assert(NULL != pImp);
- ASSIMP_BEGIN_EXCEPTION_REGION();
-
- pimpl->mPostProcessingSteps.push_back(pImp);
- DefaultLogger::get()->info("Registering custom post-processing step");
-
- ASSIMP_END_EXCEPTION_REGION(aiReturn);
- return AI_SUCCESS;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Register a custom loader plugin
-aiReturn Importer::RegisterLoader(BaseImporter* pImp)
-{
- ai_assert(NULL != pImp);
- ASSIMP_BEGIN_EXCEPTION_REGION();
-
- // --------------------------------------------------------------------
- // Check whether we would have two loaders for the same file extension
- // This is absolutely OK, but we should warn the developer of the new
- // loader that his code will probably never be called if the first
- // loader is a bit too lazy in his file checking.
- // --------------------------------------------------------------------
- std::set<std::string> st;
- std::string baked;
- pImp->GetExtensionList(st);
-
- for (std::set<std::string>::const_iterator it = st.begin(); it != st.end(); ++it) {
-
-#ifdef _DEBUG
- if (IsExtensionSupported(*it)) {
- DefaultLogger::get()->warn("The file extension " + *it + " is already in use");
- }
-#endif
- baked += *it;
- }
-
- // add the loader
- pimpl->mImporter.push_back(pImp);
- DefaultLogger::get()->info("Registering custom importer for these file extensions: " + baked);
- ASSIMP_END_EXCEPTION_REGION(aiReturn);
- return AI_SUCCESS;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Unregister a custom loader plugin
-aiReturn Importer::UnregisterLoader(BaseImporter* pImp)
-{
- if (!pImp) {
- // unregistering a NULL importer is no problem for us ... really!
- return AI_SUCCESS;
- }
-
- ASSIMP_BEGIN_EXCEPTION_REGION();
- std::vector<BaseImporter*>::iterator it = std::find(pimpl->mImporter.begin(),
- pimpl->mImporter.end(),pImp);
-
- if (it != pimpl->mImporter.end()) {
- pimpl->mImporter.erase(it);
-
- std::set<std::string> st;
- pImp->GetExtensionList(st);
-
- DefaultLogger::get()->info("Unregistering custom importer: ");
- return AI_SUCCESS;
- }
- DefaultLogger::get()->warn("Unable to remove custom importer: I can't find you ...");
- ASSIMP_END_EXCEPTION_REGION(aiReturn);
- return AI_FAILURE;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Unregister a custom loader plugin
-aiReturn Importer::UnregisterPPStep(BaseProcess* pImp)
-{
- if (!pImp) {
- // unregistering a NULL ppstep is no problem for us ... really!
- return AI_SUCCESS;
- }
-
- ASSIMP_BEGIN_EXCEPTION_REGION();
- std::vector<BaseProcess*>::iterator it = std::find(pimpl->mPostProcessingSteps.begin(),
- pimpl->mPostProcessingSteps.end(),pImp);
-
- if (it != pimpl->mPostProcessingSteps.end()) {
- pimpl->mPostProcessingSteps.erase(it);
- DefaultLogger::get()->info("Unregistering custom post-processing step");
- return AI_SUCCESS;
- }
- DefaultLogger::get()->warn("Unable to remove custom post-processing step: I can't find you ..");
- ASSIMP_END_EXCEPTION_REGION(aiReturn);
- return AI_FAILURE;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Supplies a custom IO handler to the importer to open and access files.
-void Importer::SetIOHandler( IOSystem* pIOHandler)
-{
- ASSIMP_BEGIN_EXCEPTION_REGION();
- // If the new handler is zero, allocate a default IO implementation.
- if (!pIOHandler)
- {
- // Release pointer in the possession of the caller
- pimpl->mIOHandler = new DefaultIOSystem();
- pimpl->mIsDefaultHandler = true;
- }
- // Otherwise register the custom handler
- else if (pimpl->mIOHandler != pIOHandler)
- {
- delete pimpl->mIOHandler;
- pimpl->mIOHandler = pIOHandler;
- pimpl->mIsDefaultHandler = false;
- }
- ASSIMP_END_EXCEPTION_REGION(void);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Get the currently set IO handler
-IOSystem* Importer::GetIOHandler() const
-{
- return pimpl->mIOHandler;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Check whether a custom IO handler is currently set
-bool Importer::IsDefaultIOHandler() const
-{
- return pimpl->mIsDefaultHandler;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Supplies a custom progress handler to get regular callbacks during importing
-void Importer::SetProgressHandler ( ProgressHandler* pHandler )
-{
- ASSIMP_BEGIN_EXCEPTION_REGION();
- // If the new handler is zero, allocate a default implementation.
- if (!pHandler)
- {
- // Release pointer in the possession of the caller
- pimpl->mProgressHandler = new DefaultProgressHandler();
- pimpl->mIsDefaultProgressHandler = true;
- }
- // Otherwise register the custom handler
- else if (pimpl->mProgressHandler != pHandler)
- {
- delete pimpl->mProgressHandler;
- pimpl->mProgressHandler = pHandler;
- pimpl->mIsDefaultProgressHandler = false;
- }
- ASSIMP_END_EXCEPTION_REGION(void);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Get the currently set progress handler
-ProgressHandler* Importer::GetProgressHandler() const
-{
- return pimpl->mProgressHandler;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Check whether a custom progress handler is currently set
-bool Importer::IsDefaultProgressHandler() const
-{
- return pimpl->mIsDefaultProgressHandler;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Validate post process step flags
-bool _ValidateFlags(unsigned int pFlags)
-{
- if (pFlags & aiProcess_GenSmoothNormals && pFlags & aiProcess_GenNormals) {
- DefaultLogger::get()->error("#aiProcess_GenSmoothNormals and #aiProcess_GenNormals are incompatible");
- return false;
- }
- if (pFlags & aiProcess_OptimizeGraph && pFlags & aiProcess_PreTransformVertices) {
- DefaultLogger::get()->error("#aiProcess_OptimizeGraph and #aiProcess_PreTransformVertices are incompatible");
- return false;
- }
- return true;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Free the current scene
-void Importer::FreeScene( )
-{
- ASSIMP_BEGIN_EXCEPTION_REGION();
- delete pimpl->mScene;
- pimpl->mScene = NULL;
-
- pimpl->mErrorString = "";
- ASSIMP_END_EXCEPTION_REGION(void);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Get the current error string, if any
-const char* Importer::GetErrorString() const
-{
- /* Must remain valid as long as ReadFile() or FreeFile() are not called */
- return pimpl->mErrorString.c_str();
-}
-
-// ------------------------------------------------------------------------------------------------
-// Enable extra-verbose mode
-void Importer::SetExtraVerbose(bool bDo)
-{
- pimpl->bExtraVerbose = bDo;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Get the current scene
-const aiScene* Importer::GetScene() const
-{
- return pimpl->mScene;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Orphan the current scene and return it.
-aiScene* Importer::GetOrphanedScene()
-{
- aiScene* s = pimpl->mScene;
-
- ASSIMP_BEGIN_EXCEPTION_REGION();
- pimpl->mScene = NULL;
-
- pimpl->mErrorString = ""; /* reset error string */
- ASSIMP_END_EXCEPTION_REGION(aiScene*);
- return s;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Validate post-processing flags
-bool Importer::ValidateFlags(unsigned int pFlags) const
-{
- ASSIMP_BEGIN_EXCEPTION_REGION();
- // run basic checks for mutually exclusive flags
- if (!_ValidateFlags(pFlags)) {
- return false;
- }
-
- // ValidateDS does not anymore occur in the pp list, it plays an awesome extra role ...
-#ifdef ASSIMP_BUILD_NO_VALIDATEDS_PROCESS
- if (pFlags & aiProcess_ValidateDataStructure) {
- return false;
- }
-#endif
- pFlags &= ~aiProcess_ValidateDataStructure;
-
- // Now iterate through all bits which are set in the flags and check whether we find at least
- // one pp plugin which handles it.
- for (unsigned int mask = 1; mask < (1u << (sizeof(unsigned int)*8-1));mask <<= 1) {
-
- if (pFlags & mask) {
-
- bool have = false;
- for ( unsigned int a = 0; a < pimpl->mPostProcessingSteps.size(); a++) {
- if (pimpl->mPostProcessingSteps[a]-> IsActive(mask) ) {
-
- have = true;
- break;
- }
- }
- if (!have) {
- return false;
- }
- }
- }
- ASSIMP_END_EXCEPTION_REGION(bool);
- return true;
-}
-
-// ------------------------------------------------------------------------------------------------
-const aiScene* Importer::ReadFileFromMemory( const void* pBuffer,
- size_t pLength,
- unsigned int pFlags,
- const char* pHint /*= ""*/)
-{
- ASSIMP_BEGIN_EXCEPTION_REGION();
- if (!pHint) {
- pHint = "";
- }
-
- if (!pBuffer || !pLength || strlen(pHint) > 100) {
- pimpl->mErrorString = "Invalid parameters passed to ReadFileFromMemory()";
- return NULL;
- }
-
- // prevent deletion of the previous IOHandler
- IOSystem* io = pimpl->mIOHandler;
- pimpl->mIOHandler = NULL;
-
- SetIOHandler(new MemoryIOSystem((const uint8_t*)pBuffer,pLength));
-
- // read the file and recover the previous IOSystem
- char fbuff[128];
- sprintf(fbuff,"%s.%s",AI_MEMORYIO_MAGIC_FILENAME,pHint);
-
- ReadFile(fbuff,pFlags);
- SetIOHandler(io);
-
- ASSIMP_END_EXCEPTION_REGION(const aiScene*);
- return pimpl->mScene;
-}
-
-// ------------------------------------------------------------------------------------------------
-void WriteLogOpening(const std::string& file)
-{
- Logger* l = DefaultLogger::get();
- if (!l) {
- return;
- }
- l->info("Load " + file);
-
- // print a full version dump. This is nice because we don't
- // need to ask the authors of incoming bug reports for
- // the library version they're using - a log dump is
- // sufficient.
- const unsigned int flags = aiGetCompileFlags();
- l->debug(format()
- << "Assimp "
- << aiGetVersionMajor()
- << "."
- << aiGetVersionMinor()
- << "."
- << aiGetVersionRevision()
-
-#if defined(ASSIMP_BUILD_X86_32BIT_ARCHITECTURE)
- << " x86"
-#elif defined(ASSIMP_BUILD_X86_64BIT_ARCHITECTURE)
- << " amd64"
-#elif defined(ASSIMP_BUILD_IA_64BIT_ARCHITECTURE)
- << " itanium"
-#elif defined(ASSIMP_BUILD_PPC_32BIT_ARCHITECTURE)
- << " ppc32"
-#elif defined(ASSIMP_BUILD_ARM_32BIT_ARCHITECTURE)
- << " arm32"
-#else
-# error unknown architecture
-#endif
-
-#if defined(_MSC_VER)
- << " msvc"
-#elif defined(__GNUC__)
- << " gcc"
-#else
-# warning unknown compiler
-#endif
-
-#ifndef NDEBUG
- << " debug"
-#endif
-
- << (flags & ASSIMP_CFLAGS_NOBOOST ? " noboost" : "")
- << (flags & ASSIMP_CFLAGS_SHARED ? " shared" : "")
- << (flags & ASSIMP_CFLAGS_SINGLETHREADED ? " singlethreaded" : "")
- );
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reads the given file and returns its contents if successful.
-const aiScene* Importer::ReadFile( const char* _pFile, unsigned int pFlags)
-{
- ASSIMP_BEGIN_EXCEPTION_REGION();
- const std::string pFile(_pFile);
-
- // ----------------------------------------------------------------------
- // Put a large try block around everything to catch all std::exception's
- // that might be thrown by STL containers or by new().
- // ImportErrorException's are throw by ourselves and caught elsewhere.
- //-----------------------------------------------------------------------
-
- WriteLogOpening(pFile);
-
-#ifdef ASSIMP_CATCH_GLOBAL_EXCEPTIONS
- try
-#endif // ! ASSIMP_CATCH_GLOBAL_EXCEPTIONS
- {
- // Check whether this Importer instance has already loaded
- // a scene. In this case we need to delete the old one
- if (pimpl->mScene) {
-
- DefaultLogger::get()->debug("(Deleting previous scene)");
- FreeScene();
- }
-
- // First check if the file is accessable at all
- if ( !pimpl->mIOHandler->Exists( pFile)) {
-
- pimpl->mErrorString = "Unable to open file \"" + pFile + "\".";
- DefaultLogger::get()->error(pimpl->mErrorString);
- return NULL;
- }
-
- boost::scoped_ptr<Profiler> profiler(GetPropertyInteger(AI_CONFIG_GLOB_MEASURE_TIME,0)?new Profiler():NULL);
- if (profiler) {
- profiler->BeginRegion("total");
- }
-
- // Find an worker class which can handle the file
- BaseImporter* imp = NULL;
- for ( unsigned int a = 0; a < pimpl->mImporter.size(); a++) {
-
- if ( pimpl->mImporter[a]->CanRead( pFile, pimpl->mIOHandler, false)) {
- imp = pimpl->mImporter[a];
- break;
- }
- }
-
- if (!imp) {
- // not so bad yet ... try format auto detection.
- const std::string::size_type s = pFile.find_last_of('.');
- if (s != std::string::npos) {
- DefaultLogger::get()->info("File extension now known, trying signature-based detection");
- for ( unsigned int a = 0; a < pimpl->mImporter.size(); a++) {
-
- if ( pimpl->mImporter[a]->CanRead( pFile, pimpl->mIOHandler, true)) {
- imp = pimpl->mImporter[a];
- break;
- }
- }
- }
- // Put a proper error message if no suitable importer was found
- if ( !imp) {
- pimpl->mErrorString = "No suitable reader found for the file format of file \"" + pFile + "\".";
- DefaultLogger::get()->error(pimpl->mErrorString);
- return NULL;
- }
- }
-
- // Dispatch the reading to the worker class for this format
- DefaultLogger::get()->info("Found a matching importer for this file format");
- pimpl->mProgressHandler->Update();
-
- if (profiler) {
- profiler->BeginRegion("import");
- }
-
- pimpl->mScene = imp->ReadFile( this, pFile, pimpl->mIOHandler);
- pimpl->mProgressHandler->Update();
-
- if (profiler) {
- profiler->EndRegion("import");
- }
-
- // If successful, apply all active post processing steps to the imported data
- if ( pimpl->mScene) {
-
-#ifndef ASSIMP_BUILD_NO_VALIDATEDS_PROCESS
- // The ValidateDS process is an exception. It is executed first, even before ScenePreprocessor is called.
- if (pFlags & aiProcess_ValidateDataStructure)
- {
- ValidateDSProcess ds;
- ds.ExecuteOnScene (this);
- if (!pimpl->mScene) {
- return NULL;
- }
- }
-#endif // no validation
-
- // Preprocess the scene and prepare it for post-processing
- if (profiler) {
- profiler->BeginRegion("preprocess");
- }
-
- ScenePreprocessor pre(pimpl->mScene);
- pre.ProcessScene();
-
- pimpl->mProgressHandler->Update();
- if (profiler) {
- profiler->EndRegion("preprocess");
- }
-
- // Ensure that the validation process won't be called twice
- ApplyPostProcessing(pFlags & (~aiProcess_ValidateDataStructure));
- }
- // if failed, extract the error string
- else if ( !pimpl->mScene) {
- pimpl->mErrorString = imp->GetErrorText();
- }
-
- // clear any data allocated by post-process steps
- pimpl->mPPShared->Clean();
-
- if (profiler) {
- profiler->EndRegion("total");
- }
- }
-#ifdef ASSIMP_CATCH_GLOBAL_EXCEPTIONS
- catch (std::exception &e)
- {
-#if (defined _MSC_VER) && (defined _CPPRTTI)
- // if we have RTTI get the full name of the exception that occured
- pimpl->mErrorString = std::string(typeid( e ).name()) + ": " + e.what();
-#else
- pimpl->mErrorString = std::string("std::exception: ") + e.what();
-#endif
-
- DefaultLogger::get()->error(pimpl->mErrorString);
- delete pimpl->mScene; pimpl->mScene = NULL;
- }
-#endif // ! ASSIMP_CATCH_GLOBAL_EXCEPTIONS
-
- // either successful or failure - the pointer expresses it anyways
- ASSIMP_END_EXCEPTION_REGION(const aiScene*);
- return pimpl->mScene;
-}
-
-
-// ------------------------------------------------------------------------------------------------
-// Apply post-processing to the currently bound scene
-const aiScene* Importer::ApplyPostProcessing(unsigned int pFlags)
-{
- ASSIMP_BEGIN_EXCEPTION_REGION();
- // Return immediately if no scene is active
- if (!pimpl->mScene) {
- return NULL;
- }
-
- // If no flags are given, return the current scene with no further action
- if (!pFlags) {
- return pimpl->mScene;
- }
-
- // In debug builds: run basic flag validation
- ai_assert(_ValidateFlags(pFlags));
- DefaultLogger::get()->info("Entering post processing pipeline");
-
-#ifndef ASSIMP_BUILD_NO_VALIDATEDS_PROCESS
- // The ValidateDS process plays an exceptional role. It isn't contained in the global
- // list of post-processing steps, so we need to call it manually.
- if (pFlags & aiProcess_ValidateDataStructure)
- {
- ValidateDSProcess ds;
- ds.ExecuteOnScene (this);
- if (!pimpl->mScene) {
- return NULL;
- }
- }
-#endif // no validation
-#ifdef _DEBUG
- if (pimpl->bExtraVerbose)
- {
-#ifndef ASSIMP_BUILD_NO_VALIDATEDS_PROCESS
- DefaultLogger::get()->error("Verbose Import is not available due to build settings");
-#endif // no validation
- pFlags |= aiProcess_ValidateDataStructure;
- }
-#else
- if (pimpl->bExtraVerbose) {
- DefaultLogger::get()->warn("Not a debug build, ignoring extra verbose setting");
- }
-#endif // ! DEBUG
-
- boost::scoped_ptr<Profiler> profiler(GetPropertyInteger(AI_CONFIG_GLOB_MEASURE_TIME,0)?new Profiler():NULL);
- for ( unsigned int a = 0; a < pimpl->mPostProcessingSteps.size(); a++) {
-
- BaseProcess* process = pimpl->mPostProcessingSteps[a];
- if ( process->IsActive( pFlags)) {
-
- if (profiler) {
- profiler->BeginRegion("postprocess");
- }
-
- process->ExecuteOnScene ( this );
- pimpl->mProgressHandler->Update();
-
- if (profiler) {
- profiler->EndRegion("postprocess");
- }
- }
- if ( !pimpl->mScene) {
- break;
- }
-#ifdef _DEBUG
-
-#ifndef ASSIMP_BUILD_NO_VALIDATEDS_PROCESS
- continue;
-#endif // no validation
-
- // If the extra verbose mode is active, execute the ValidateDataStructureStep again - after each step
- if (pimpl->bExtraVerbose) {
- DefaultLogger::get()->debug("Verbose Import: revalidating data structures");
-
- ValidateDSProcess ds;
- ds.ExecuteOnScene (this);
- if ( !pimpl->mScene) {
- DefaultLogger::get()->error("Verbose Import: failed to revalidate data structures");
- break;
- }
- }
-#endif // ! DEBUG
- }
-
- // clear any data allocated by post-process steps
- pimpl->mPPShared->Clean();
- DefaultLogger::get()->info("Leaving post processing pipeline");
-
- ASSIMP_END_EXCEPTION_REGION(const aiScene*);
- return pimpl->mScene;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Helper function to check whether an extension is supported by ASSIMP
-bool Importer::IsExtensionSupported(const char* szExtension) const
-{
- return NULL != FindLoader(szExtension);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Find a loader plugin for a given file extension
-BaseImporter* Importer::FindLoader (const char* szExtension) const
-{
- ai_assert(szExtension);
- ASSIMP_BEGIN_EXCEPTION_REGION();
-
- // skip over wildcard and dot characters at string head --
- for (;*szExtension == '*' || *szExtension == '.'; ++szExtension);
-
- std::string ext(szExtension);
- if (ext.empty()) {
- return NULL;
- }
- std::transform(ext.begin(),ext.end(), ext.begin(), tolower);
-
- std::set<std::string> str;
- for (std::vector<BaseImporter*>::const_iterator i = pimpl->mImporter.begin();i != pimpl->mImporter.end();++i) {
- str.clear();
-
- (*i)->GetExtensionList(str);
- for (std::set<std::string>::const_iterator it = str.begin(); it != str.end(); ++it) {
- if (ext == *it) {
- return (*i);
- }
- }
- }
- ASSIMP_END_EXCEPTION_REGION(BaseImporter*);
- return NULL;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Helper function to build a list of all file extensions supported by ASSIMP
-void Importer::GetExtensionList(aiString& szOut) const
-{
- ASSIMP_BEGIN_EXCEPTION_REGION();
- std::set<std::string> str;
- for (std::vector<BaseImporter*>::const_iterator i = pimpl->mImporter.begin();i != pimpl->mImporter.end();++i) {
- (*i)->GetExtensionList(str);
- }
-
- for (std::set<std::string>::const_iterator it = str.begin();; ) {
- szOut.Append("*.");
- szOut.Append((*it).c_str());
-
- if (++it == str.end()) {
- break;
- }
- szOut.Append(";");
- }
- ASSIMP_END_EXCEPTION_REGION(void);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Set a configuration property
-void Importer::SetPropertyInteger(const char* szName, int iValue,
- bool* bWasExisting /*= NULL*/)
-{
- ASSIMP_BEGIN_EXCEPTION_REGION();
- SetGenericProperty<int>(pimpl->mIntProperties, szName,iValue,bWasExisting);
- ASSIMP_END_EXCEPTION_REGION(void);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Set a configuration property
-void Importer::SetPropertyFloat(const char* szName, float iValue,
- bool* bWasExisting /*= NULL*/)
-{
- ASSIMP_BEGIN_EXCEPTION_REGION();
- SetGenericProperty<float>(pimpl->mFloatProperties, szName,iValue,bWasExisting);
- ASSIMP_END_EXCEPTION_REGION(void);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Set a configuration property
-void Importer::SetPropertyString(const char* szName, const std::string& value,
- bool* bWasExisting /*= NULL*/)
-{
- try {
- std::cout << "";
- }
- catch (...) {
- try {
- throw;
- }
- catch(std::exception&) {
- return;
- }
- }
-
- ASSIMP_BEGIN_EXCEPTION_REGION();
- SetGenericProperty<std::string>(pimpl->mStringProperties, szName,value,bWasExisting);
- ASSIMP_END_EXCEPTION_REGION(void);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Get a configuration property
-int Importer::GetPropertyInteger(const char* szName,
- int iErrorReturn /*= 0xffffffff*/) const
-{
- return GetGenericProperty<int>(pimpl->mIntProperties,szName,iErrorReturn);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Get a configuration property
-float Importer::GetPropertyFloat(const char* szName,
- float iErrorReturn /*= 10e10*/) const
-{
- return GetGenericProperty<float>(pimpl->mFloatProperties,szName,iErrorReturn);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Get a configuration property
-const std::string& Importer::GetPropertyString(const char* szName,
- const std::string& iErrorReturn /*= ""*/) const
-{
- return GetGenericProperty<std::string>(pimpl->mStringProperties,szName,iErrorReturn);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Get the memory requirements of a single node
-inline void AddNodeWeight(unsigned int& iScene,const aiNode* pcNode)
-{
- iScene += sizeof(aiNode);
- iScene += sizeof(unsigned int) * pcNode->mNumMeshes;
- iScene += sizeof(void*) * pcNode->mNumChildren;
-
- for (unsigned int i = 0; i < pcNode->mNumChildren;++i) {
- AddNodeWeight(iScene,pcNode->mChildren[i]);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Get the memory requirements of the scene
-void Importer::GetMemoryRequirements(aiMemoryInfo& in) const
-{
- in = aiMemoryInfo();
- aiScene* mScene = pimpl->mScene;
-
- // return if we have no scene loaded
- if (!pimpl->mScene)
- return;
-
-
- in.total = sizeof(aiScene);
-
- // add all meshes
- for (unsigned int i = 0; i < mScene->mNumMeshes;++i)
- {
- in.meshes += sizeof(aiMesh);
- if (mScene->mMeshes[i]->HasPositions()) {
- in.meshes += sizeof(aiVector3D) * mScene->mMeshes[i]->mNumVertices;
- }
-
- if (mScene->mMeshes[i]->HasNormals()) {
- in.meshes += sizeof(aiVector3D) * mScene->mMeshes[i]->mNumVertices;
- }
-
- if (mScene->mMeshes[i]->HasTangentsAndBitangents()) {
- in.meshes += sizeof(aiVector3D) * mScene->mMeshes[i]->mNumVertices * 2;
- }
-
- for (unsigned int a = 0; a < AI_MAX_NUMBER_OF_COLOR_SETS;++a) {
- if (mScene->mMeshes[i]->HasVertexColors(a)) {
- in.meshes += sizeof(aiColor4D) * mScene->mMeshes[i]->mNumVertices;
- }
- else break;
- }
- for (unsigned int a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS;++a) {
- if (mScene->mMeshes[i]->HasTextureCoords(a)) {
- in.meshes += sizeof(aiVector3D) * mScene->mMeshes[i]->mNumVertices;
- }
- else break;
- }
- if (mScene->mMeshes[i]->HasBones()) {
- in.meshes += sizeof(void*) * mScene->mMeshes[i]->mNumBones;
- for (unsigned int p = 0; p < mScene->mMeshes[i]->mNumBones;++p) {
- in.meshes += sizeof(aiBone);
- in.meshes += mScene->mMeshes[i]->mBones[p]->mNumWeights * sizeof(aiVertexWeight);
- }
- }
- in.meshes += (sizeof(aiFace) + 3 * sizeof(unsigned int))*mScene->mMeshes[i]->mNumFaces;
- }
- in.total += in.meshes;
-
- // add all embedded textures
- for (unsigned int i = 0; i < mScene->mNumTextures;++i) {
- const aiTexture* pc = mScene->mTextures[i];
- in.textures += sizeof(aiTexture);
- if (pc->mHeight) {
- in.textures += 4 * pc->mHeight * pc->mWidth;
- }
- else in.textures += pc->mWidth;
- }
- in.total += in.textures;
-
- // add all animations
- for (unsigned int i = 0; i < mScene->mNumAnimations;++i) {
- const aiAnimation* pc = mScene->mAnimations[i];
- in.animations += sizeof(aiAnimation);
-
- // add all bone anims
- for (unsigned int a = 0; a < pc->mNumChannels; ++a) {
- const aiNodeAnim* pc2 = pc->mChannels[i];
- in.animations += sizeof(aiNodeAnim);
- in.animations += pc2->mNumPositionKeys * sizeof(aiVectorKey);
- in.animations += pc2->mNumScalingKeys * sizeof(aiVectorKey);
- in.animations += pc2->mNumRotationKeys * sizeof(aiQuatKey);
- }
- }
- in.total += in.animations;
-
- // add all cameras and all lights
- in.total += in.cameras = sizeof(aiCamera) * mScene->mNumCameras;
- in.total += in.lights = sizeof(aiLight) * mScene->mNumLights;
-
- // add all nodes
- AddNodeWeight(in.nodes,mScene->mRootNode);
- in.total += in.nodes;
-
- // add all materials
- for (unsigned int i = 0; i < mScene->mNumMaterials;++i) {
- const aiMaterial* pc = mScene->mMaterials[i];
- in.materials += sizeof(aiMaterial);
- in.materials += pc->mNumAllocated * sizeof(void*);
-
- for (unsigned int a = 0; a < pc->mNumProperties;++a) {
- in.materials += pc->mProperties[a]->mDataLength;
- }
- }
- in.total += in.materials;
-}
-
diff --git a/3rdparty/assimp/code/ImproveCacheLocality.cpp b/3rdparty/assimp/code/ImproveCacheLocality.cpp
deleted file mode 100644
index 26891407..00000000
--- a/3rdparty/assimp/code/ImproveCacheLocality.cpp
+++ /dev/null
@@ -1,378 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file Implementation of the post processing step to improve the cache locality of a mesh.
- * <br>
- * The algorithm is roughly basing on this paper:
- * http://www.cs.princeton.edu/gfx/pubs/Sander_2007_%3ETR/tipsy.pdf
- * .. although overdraw rduction isn't implemented yet ...
- */
-
-#include "AssimpPCH.h"
-
-// internal headers
-#include "ImproveCacheLocality.h"
-#include "VertexTriangleAdjacency.h"
-
-using namespace Assimp;
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-ImproveCacheLocalityProcess::ImproveCacheLocalityProcess() {
- configCacheDepth = PP_ICL_PTCACHE_SIZE;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-ImproveCacheLocalityProcess::~ImproveCacheLocalityProcess()
-{
- // nothing to do here
-}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the processing step is present in the given flag field.
-bool ImproveCacheLocalityProcess::IsActive( unsigned int pFlags) const
-{
- return (pFlags & aiProcess_ImproveCacheLocality) != 0;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Setup configuration
-void ImproveCacheLocalityProcess::SetupProperties(const Importer* pImp)
-{
- // AI_CONFIG_PP_ICL_PTCACHE_SIZE controls the target cache size for the optimizer
- configCacheDepth = pImp->GetPropertyInteger(AI_CONFIG_PP_ICL_PTCACHE_SIZE,PP_ICL_PTCACHE_SIZE);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Executes the post processing step on the given imported data.
-void ImproveCacheLocalityProcess::Execute( aiScene* pScene)
-{
- if (!pScene->mNumMeshes) {
- DefaultLogger::get()->debug("ImproveCacheLocalityProcess skipped; there are no meshes");
- return;
- }
-
- DefaultLogger::get()->debug("ImproveCacheLocalityProcess begin");
-
- float out = 0.f;
- unsigned int numf = 0, numm = 0;
- for ( unsigned int a = 0; a < pScene->mNumMeshes; a++){
- const float res = ProcessMesh( pScene->mMeshes[a],a);
- if (res) {
- numf += pScene->mMeshes[a]->mNumFaces;
- out += res;
- ++numm;
- }
- }
- if (!DefaultLogger::isNullLogger()) {
- char szBuff[128]; // should be sufficiently large in every case
- ::sprintf(szBuff,"Cache relevant are %i meshes (%i faces). Average output ACMR is %f",
- numm,numf,out/numf);
-
- DefaultLogger::get()->info(szBuff);
- DefaultLogger::get()->debug("ImproveCacheLocalityProcess finished. ");
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Improves the cache coherency of a specific mesh
-float ImproveCacheLocalityProcess::ProcessMesh( aiMesh* pMesh, unsigned int meshNum)
-{
- // TODO: rewrite this to use std::vector or boost::shared_array
- ai_assert(NULL != pMesh);
-
- // Check whether the input data is valid
- // - there must be vertices and faces
- // - all faces must be triangulated or we can't operate on them
- if (!pMesh->HasFaces() || !pMesh->HasPositions())
- return 0.f;
-
- if (pMesh->mPrimitiveTypes != aiPrimitiveType_TRIANGLE) {
- DefaultLogger::get()->error("This algorithm works on triangle meshes only");
- return 0.f;
- }
-
- float fACMR = 3.f;
- const aiFace* const pcEnd = pMesh->mFaces+pMesh->mNumFaces;
-
- // Input ACMR is for logging purposes only
- if (!DefaultLogger::isNullLogger()) {
-
- unsigned int* piFIFOStack = new unsigned int[configCacheDepth];
- memset(piFIFOStack,0xff,configCacheDepth*sizeof(unsigned int));
- unsigned int* piCur = piFIFOStack;
- const unsigned int* const piCurEnd = piFIFOStack + configCacheDepth;
-
- // count the number of cache misses
- unsigned int iCacheMisses = 0;
- for (const aiFace* pcFace = pMesh->mFaces;pcFace != pcEnd;++pcFace) {
-
- for (unsigned int qq = 0; qq < 3;++qq) {
- bool bInCache = false;
-
- for (unsigned int* pp = piFIFOStack;pp < piCurEnd;++pp) {
- if (*pp == pcFace->mIndices[qq]) {
- // the vertex is in cache
- bInCache = true;
- break;
- }
- }
- if (!bInCache) {
- ++iCacheMisses;
- if (piCurEnd == piCur) {
- piCur = piFIFOStack;
- }
- *piCur++ = pcFace->mIndices[qq];
- }
- }
- }
- delete[] piFIFOStack;
- fACMR = (float)iCacheMisses / pMesh->mNumFaces;
- if (3.0 == fACMR) {
- char szBuff[128]; // should be sufficiently large in every case
-
- // the JoinIdenticalVertices process has not been executed on this
- // mesh, otherwise this value would normally be at least minimally
- // smaller than 3.0 ...
- sprintf(szBuff,"Mesh %i: Not suitable for vcache optimization",meshNum);
- DefaultLogger::get()->warn(szBuff);
- return 0.f;
- }
- }
-
- // first we need to build a vertex-triangle adjacency list
- VertexTriangleAdjacency adj(pMesh->mFaces,pMesh->mNumFaces, pMesh->mNumVertices,true);
-
- // build a list to store per-vertex caching time stamps
- unsigned int* const piCachingStamps = new unsigned int[pMesh->mNumVertices];
- memset(piCachingStamps,0x0,pMesh->mNumVertices*sizeof(unsigned int));
-
- // allocate an empty output index buffer. We store the output indices in one large array.
- // Since the number of triangles won't change the input faces can be reused. This is how
- // we save thousands of redundant mini allocations for aiFace::mIndices
- const unsigned int iIdxCnt = pMesh->mNumFaces*3;
- unsigned int* const piIBOutput = new unsigned int[iIdxCnt];
- unsigned int* piCSIter = piIBOutput;
-
- // allocate the flag array to hold the information
- // whether a face has already been emitted or not
- std::vector<bool> abEmitted(pMesh->mNumFaces,false);
-
- // dead-end vertex index stack
- std::stack<unsigned int> sDeadEndVStack;
-
- // create a copy of the piNumTriPtr buffer
- unsigned int* const piNumTriPtr = adj.mLiveTriangles;
- const unsigned int* const piNumTriPtrNoModify = new unsigned int[pMesh->mNumVertices];
- memcpy(const_cast<unsigned int* const> (piNumTriPtrNoModify),piNumTriPtr,
- pMesh->mNumVertices * sizeof(unsigned int));
-
- // get the largest number of referenced triangles and allocate the "candidate buffer"
- unsigned int iMaxRefTris = 0; {
- const unsigned int* piCur = adj.mLiveTriangles;
- const unsigned int* const piCurEnd = adj.mLiveTriangles+pMesh->mNumVertices;
- for (;piCur != piCurEnd;++piCur) {
- iMaxRefTris = std::max(iMaxRefTris,*piCur);
- }
- }
- unsigned int* piCandidates = new unsigned int[iMaxRefTris*3];
- unsigned int iCacheMisses = 0;
-
- // ...................................................................................
- /** PSEUDOCODE for the algorithm
-
- A = Build-Adjacency(I) Vertex-triangle adjacency
- L = Get-Triangle-Counts(A) Per-vertex live triangle counts
- C = Zero(Vertex-Count(I)) Per-vertex caching time stamps
- D = Empty-Stack() Dead-end vertex stack
- E = False(Triangle-Count(I)) Per triangle emitted flag
- O = Empty-Index-Buffer() Empty output buffer
- f = 0 Arbitrary starting vertex
- s = k+1, i = 1 Time stamp and cursor
- while f >= 0 For all valid fanning vertices
- N = Empty-Set() 1-ring of next candidates
- for each Triangle t in Neighbors(A, f)
- if !Emitted(E,t)
- for each Vertex v in t
- Append(O,v) Output vertex
- Push(D,v) Add to dead-end stack
- Insert(N,v) Register as candidate
- L[v] = L[v]-1 Decrease live triangle count
- if s-C[v] > k If not in cache
- C[v] = s Set time stamp
- s = s+1 Increment time stamp
- E[t] = true Flag triangle as emitted
- Select next fanning vertex
- f = Get-Next-Vertex(I,i,k,N,C,s,L,D)
- return O
- */
- // ...................................................................................
-
- int ivdx = 0;
- int ics = 1;
- int iStampCnt = configCacheDepth+1;
- while (ivdx >= 0) {
-
- unsigned int icnt = piNumTriPtrNoModify[ivdx];
- unsigned int* piList = adj.GetAdjacentTriangles(ivdx);
- unsigned int* piCurCandidate = piCandidates;
-
- // get all triangles in the neighborhood
- for (unsigned int tri = 0; tri < icnt;++tri) {
-
- // if they have not yet been emitted, add them to the output IB
- const unsigned int fidx = *piList++;
- if (!abEmitted[fidx]) {
-
- // so iterate through all vertices of the current triangle
- const aiFace* pcFace = &pMesh->mFaces[ fidx ];
- for (unsigned int* p = pcFace->mIndices, *p2 = pcFace->mIndices+3;p != p2;++p) {
- const unsigned int dp = *p;
-
- // the current vertex won't have any free triangles after this step
- if (ivdx != (int)dp) {
- // append the vertex to the dead-end stack
- sDeadEndVStack.push(dp);
-
- // register as candidate for the next step
- *piCurCandidate++ = dp;
-
- // decrease the per-vertex triangle counts
- piNumTriPtr[dp]--;
- }
-
- // append the vertex to the output index buffer
- *piCSIter++ = dp;
-
- // if the vertex is not yet in cache, set its cache count
- if (iStampCnt-piCachingStamps[dp] > configCacheDepth) {
- piCachingStamps[dp] = iStampCnt++;
- ++iCacheMisses;
- }
- }
- // flag triangle as emitted
- abEmitted[fidx] = true;
- }
- }
-
- // the vertex has now no living adjacent triangles anymore
- piNumTriPtr[ivdx] = 0;
-
- // get next fanning vertex
- ivdx = -1;
- int max_priority = -1;
- for (unsigned int* piCur = piCandidates;piCur != piCurCandidate;++piCur) {
- register const unsigned int dp = *piCur;
-
- // must have live triangles
- if (piNumTriPtr[dp] > 0) {
- int priority = 0;
-
- // will the vertex be in cache, even after fanning occurs?
- unsigned int tmp;
- if ((tmp = iStampCnt-piCachingStamps[dp]) + 2*piNumTriPtr[dp] <= configCacheDepth) {
- priority = tmp;
- }
-
- // keep best candidate
- if (priority > max_priority) {
- max_priority = priority;
- ivdx = dp;
- }
- }
- }
- // did we reach a dead end?
- if (-1 == ivdx) {
- // need to get a non-local vertex for which we have a good chance that it is still
- // in the cache ...
- while (!sDeadEndVStack.empty()) {
- unsigned int iCachedIdx = sDeadEndVStack.top();
- sDeadEndVStack.pop();
- if (piNumTriPtr[ iCachedIdx ] > 0) {
- ivdx = iCachedIdx;
- break;
- }
- }
-
- if (-1 == ivdx) {
- // well, there isn't such a vertex. Simply get the next vertex in input order and
- // hope it is not too bad ...
- while (ics < (int)pMesh->mNumVertices) {
- ++ics;
- if (piNumTriPtr[ics] > 0) {
- ivdx = ics;
- break;
- }
- }
- }
- }
- }
- float fACMR2 = 0.0f;
- if (!DefaultLogger::isNullLogger()) {
- fACMR2 = (float)iCacheMisses / pMesh->mNumFaces;
-
- // very intense verbose logging ... prepare for much text if there are many meshes
- if ( DefaultLogger::get()->getLogSeverity() == Logger::VERBOSE) {
- char szBuff[128]; // should be sufficiently large in every case
-
- ::sprintf(szBuff,"Mesh %i | ACMR in: %f out: %f | ~%.1f%%",meshNum,fACMR,fACMR2,
- ((fACMR - fACMR2) / fACMR) * 100.f);
- DefaultLogger::get()->debug(szBuff);
- }
-
- fACMR2 *= pMesh->mNumFaces;
- }
- // sort the output index buffer back to the input array
- piCSIter = piIBOutput;
- for (aiFace* pcFace = pMesh->mFaces; pcFace != pcEnd;++pcFace) {
- pcFace->mIndices[0] = *piCSIter++;
- pcFace->mIndices[1] = *piCSIter++;
- pcFace->mIndices[2] = *piCSIter++;
- }
-
- // delete temporary storage
- delete[] piCachingStamps;
- delete[] piIBOutput;
- delete[] piCandidates;
- delete[] piNumTriPtrNoModify;
- return fACMR2;
-}
diff --git a/3rdparty/assimp/code/ImproveCacheLocality.h b/3rdparty/assimp/code/ImproveCacheLocality.h
deleted file mode 100644
index 58613e04..00000000
--- a/3rdparty/assimp/code/ImproveCacheLocality.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file Defines a post processing step to reorder faces for
- better cache locality*/
-#ifndef AI_IMPROVECACHELOCALITY_H_INC
-#define AI_IMPROVECACHELOCALITY_H_INC
-
-#include "BaseProcess.h"
-#include "../include/aiTypes.h"
-
-struct aiMesh;
-
-namespace Assimp
-{
-
-// ---------------------------------------------------------------------------
-/** The ImproveCacheLocalityProcess reorders all faces for improved vertex
- * cache locality. It tries to arrange all faces to fans and to render
- * faces which share vertices directly one after the other.
- *
- * @note This step expects triagulated input data.
- */
-class ASSIMP_API ImproveCacheLocalityProcess : public BaseProcess
-{
- friend class Importer;
-
-protected:
- /** Constructor to be privately used by Importer */
- ImproveCacheLocalityProcess();
-
- /** Destructor, private as well */
- ~ImproveCacheLocalityProcess();
-
-public:
-
- // -------------------------------------------------------------------
- // Check whether the pp step is active
- bool IsActive( unsigned int pFlags) const;
-
- // -------------------------------------------------------------------
- // Executes the pp step on a given scene
- void Execute( aiScene* pScene);
-
- // -------------------------------------------------------------------
- // Configures the pp step
- void SetupProperties(const Importer* pImp);
-
-protected:
- // -------------------------------------------------------------------
- /** Executes the postprocessing step on the given mesh
- * @param pMesh The mesh to process.
- * @param meshNum Index of the mesh to process
- */
- float ProcessMesh( aiMesh* pMesh, unsigned int meshNum);
-
-private:
- //! Configuration parameter: specifies the size of the cache to
- //! optimize the vertex data for.
- unsigned int configCacheDepth;
-};
-
-} // end of namespace Assimp
-
-#endif // AI_IMPROVECACHELOCALITY_H_INC
diff --git a/3rdparty/assimp/code/JoinVerticesProcess.cpp b/3rdparty/assimp/code/JoinVerticesProcess.cpp
deleted file mode 100644
index acc98cb8..00000000
--- a/3rdparty/assimp/code/JoinVerticesProcess.cpp
+++ /dev/null
@@ -1,395 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file Implementation of the post processing step to join identical vertices
- * for all imported meshes
- */
-
-#include "AssimpPCH.h"
-#ifndef ASSIMP_BUILD_NO_JOINVERTICES_PROCESS
-
-#include "JoinVerticesProcess.h"
-#include "ProcessHelper.h"
-#include "Vertex.h"
-#include "TinyFormatter.h"
-
-using namespace Assimp;
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-JoinVerticesProcess::JoinVerticesProcess()
-{
- // nothing to do here
-}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-JoinVerticesProcess::~JoinVerticesProcess()
-{
- // nothing to do here
-}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the processing step is present in the given flag field.
-bool JoinVerticesProcess::IsActive( unsigned int pFlags) const
-{
- return (pFlags & aiProcess_JoinIdenticalVertices) != 0;
-}
-// ------------------------------------------------------------------------------------------------
-// Executes the post processing step on the given imported data.
-void JoinVerticesProcess::Execute( aiScene* pScene)
-{
- DefaultLogger::get()->debug("JoinVerticesProcess begin");
-
- // get the total number of vertices BEFORE the step is executed
- int iNumOldVertices = 0;
- if (!DefaultLogger::isNullLogger()) {
- for ( unsigned int a = 0; a < pScene->mNumMeshes; a++) {
- iNumOldVertices += pScene->mMeshes[a]->mNumVertices;
- }
- }
-
- // execute the step
- int iNumVertices = 0;
- for ( unsigned int a = 0; a < pScene->mNumMeshes; a++)
- iNumVertices += ProcessMesh( pScene->mMeshes[a],a);
-
- // if logging is active, print detailed statistics
- if (!DefaultLogger::isNullLogger())
- {
- if (iNumOldVertices == iNumVertices)
- {
- DefaultLogger::get()->debug("JoinVerticesProcess finished ");
- } else
- {
- char szBuff[128]; // should be sufficiently large in every case
- sprintf(szBuff,"JoinVerticesProcess finished | Verts in: %i out: %i | ~%.1f%%",
- iNumOldVertices,
- iNumVertices,
- ((iNumOldVertices - iNumVertices) / (float)iNumOldVertices) * 100.f);
- DefaultLogger::get()->info(szBuff);
- }
- }
-
- pScene->mFlags |= AI_SCENE_FLAGS_NON_VERBOSE_FORMAT;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Unites identical vertices in the given mesh
-int JoinVerticesProcess::ProcessMesh( aiMesh* pMesh, unsigned int meshIndex)
-{
- BOOST_STATIC_ASSERT( AI_MAX_NUMBER_OF_COLOR_SETS == 4);
- BOOST_STATIC_ASSERT( AI_MAX_NUMBER_OF_TEXTURECOORDS == 4);
-
- // Return early if we don't have any positions
- if (!pMesh->HasPositions() || !pMesh->HasFaces()) {
- return 0;
- }
-
- // We'll never have more vertices afterwards.
- std::vector<Vertex> uniqueVertices;
- uniqueVertices.reserve( pMesh->mNumVertices);
-
- // For each vertex the index of the vertex it was replaced by.
- // Since the maximal number of vertices is 2^31-1, the most significand bit can be used to mark
- // whether a new vertex was created for the index (true) or if it was replaced by an existing
- // unique vertex (false). This saves an additional std::vector<bool> and greatly enhances
- // branching performance.
- BOOST_STATIC_ASSERT(AI_MAX_VERTICES == 0x7fffffff);
- std::vector<unsigned int> replaceIndex( pMesh->mNumVertices, 0xffffffff);
-
- // A little helper to find locally close vertices faster.
- // Try to reuse the lookup table from the last step.
- const static float epsilon = 1e-5f;
- float posEpsilonSqr;
- SpatialSort* vertexFinder = NULL;
- SpatialSort _vertexFinder;
-
- typedef std::pair<SpatialSort,float> SpatPair;
- if (shared) {
- std::vector<SpatPair >* avf;
- shared->GetProperty(AI_SPP_SPATIAL_SORT,avf);
- if (avf) {
- SpatPair& blubb = (*avf)[meshIndex];
- vertexFinder = &blubb.first;
- posEpsilonSqr = blubb.second;
- }
- }
- if (!vertexFinder) {
- // bad, need to compute it.
- _vertexFinder.Fill(pMesh->mVertices, pMesh->mNumVertices, sizeof( aiVector3D));
- vertexFinder = &_vertexFinder;
- posEpsilonSqr = ComputePositionEpsilon(pMesh);
- }
-
- // Squared because we check against squared length of the vector difference
- static const float squareEpsilon = epsilon * epsilon;
-
- // Again, better waste some bytes than a realloc ...
- std::vector<unsigned int> verticesFound;
- verticesFound.reserve(10);
-
- // Run an optimized code path if we don't have multiple UVs or vertex colors.
- // This should yield false in more than 99% of all imports ...
- const bool complex = (
- pMesh->mTextureCoords[1] ||
- pMesh->mTextureCoords[2] ||
- pMesh->mTextureCoords[3] ||
- pMesh->mColors[0] ||
- pMesh->mColors[1] ||
- pMesh->mColors[2] ||
- pMesh->mColors[3] );
-
- // Now check each vertex if it brings something new to the table
- for ( unsigned int a = 0; a < pMesh->mNumVertices; a++) {
- // collect the vertex data
- Vertex v(pMesh,a);
-
- // collect all vertices that are close enough to the given position
- vertexFinder->FindIdenticalPositions( v.position, verticesFound);
- unsigned int matchIndex = 0xffffffff;
-
- // check all unique vertices close to the position if this vertex is already present among them
- for ( unsigned int b = 0; b < verticesFound.size(); b++) {
-
- const unsigned int vidx = verticesFound[b];
- const unsigned int uidx = replaceIndex[ vidx];
- if ( uidx & 0x80000000)
- continue;
-
- const Vertex& uv = uniqueVertices[ uidx];
- // Position mismatch is impossible - the vertex finder already discarded all non-matching positions
-
- // We just test the other attributes even if they're not present in the mesh.
- // In this case they're initialized to 0 so the comparision succeeds.
- // By this method the non-present attributes are effectively ignored in the comparision.
- if ( (uv.normal - v.normal).SquareLength() > squareEpsilon)
- continue;
- if ( (uv.texcoords[0] - v.texcoords[0]).SquareLength() > squareEpsilon)
- continue;
- if ( (uv.tangent - v.tangent).SquareLength() > squareEpsilon)
- continue;
- if ( (uv.bitangent - v.bitangent).SquareLength() > squareEpsilon)
- continue;
-
- // Usually we won't have vertex colors or multiple UVs, so we can skip from here
- // Actually this increases runtime performance slightly, at least if branch
- // prediction is on our side.
- if (complex){
- // manually unrolled because continue wouldn't work as desired in an inner loop
- if ( GetColorDifference( uv.colors[0], v.colors[0]) > squareEpsilon)
- continue;
- if ( GetColorDifference( uv.colors[1], v.colors[1]) > squareEpsilon)
- continue;
- if ( GetColorDifference( uv.colors[2], v.colors[2]) > squareEpsilon)
- continue;
- if ( GetColorDifference( uv.colors[3], v.colors[3]) > squareEpsilon)
- continue;
-
- // texture coord matching manually unrolled as well
- if ( (uv.texcoords[1] - v.texcoords[1]).SquareLength() > squareEpsilon)
- continue;
- if ( (uv.texcoords[2] - v.texcoords[2]).SquareLength() > squareEpsilon)
- continue;
- if ( (uv.texcoords[3] - v.texcoords[3]).SquareLength() > squareEpsilon)
- continue;
- }
-
- // we're still here -> this vertex perfectly matches our given vertex
- matchIndex = uidx;
- break;
- }
-
- // found a replacement vertex among the uniques?
- if ( matchIndex != 0xffffffff)
- {
- // store where to found the matching unique vertex
- replaceIndex[a] = matchIndex | 0x80000000;
- }
- else
- {
- // no unique vertex matches it upto now -> so add it
- replaceIndex[a] = (unsigned int)uniqueVertices.size();
- uniqueVertices.push_back( v);
- }
- }
-
- if (!DefaultLogger::isNullLogger() && DefaultLogger::get()->getLogSeverity() == Logger::VERBOSE) {
- DefaultLogger::get()->debug((Formatter::format(),
- "Mesh ",meshIndex,
- " (",
- (pMesh->mName.length ? pMesh->mName.data : "unnamed"),
- ") | Verts in: ",pMesh->mNumVertices,
- " out: ",
- uniqueVertices.size(),
- " | ~",
- ((pMesh->mNumVertices - uniqueVertices.size()) / (float)pMesh->mNumVertices) * 100.f,
- "%"
- ));
- }
-
- // replace vertex data with the unique data sets
- pMesh->mNumVertices = (unsigned int)uniqueVertices.size();
-
- // ----------------------------------------------------------------------------
- // NOTE - we're *not* calling Vertex::SortBack() because it would check for
- // presence of every single vertex component once PER VERTEX. And our CPU
- // dislikes branches, even if they're easily predictable.
- // ----------------------------------------------------------------------------
-
- // Position
- delete [] pMesh->mVertices;
- pMesh->mVertices = new aiVector3D[pMesh->mNumVertices];
- for ( unsigned int a = 0; a < pMesh->mNumVertices; a++)
- pMesh->mVertices[a] = uniqueVertices[a].position;
-
- // Normals, if present
- if ( pMesh->mNormals)
- {
- delete [] pMesh->mNormals;
- pMesh->mNormals = new aiVector3D[pMesh->mNumVertices];
- for ( unsigned int a = 0; a < pMesh->mNumVertices; a++) {
- pMesh->mNormals[a] = uniqueVertices[a].normal;
- }
- }
- // Tangents, if present
- if ( pMesh->mTangents)
- {
- delete [] pMesh->mTangents;
- pMesh->mTangents = new aiVector3D[pMesh->mNumVertices];
- for ( unsigned int a = 0; a < pMesh->mNumVertices; a++) {
- pMesh->mTangents[a] = uniqueVertices[a].tangent;
- }
- }
- // Bitangents as well
- if ( pMesh->mBitangents)
- {
- delete [] pMesh->mBitangents;
- pMesh->mBitangents = new aiVector3D[pMesh->mNumVertices];
- for ( unsigned int a = 0; a < pMesh->mNumVertices; a++) {
- pMesh->mBitangents[a] = uniqueVertices[a].bitangent;
- }
- }
- // Vertex colors
- for ( unsigned int a = 0; pMesh->HasVertexColors(a); a++)
- {
- delete [] pMesh->mColors[a];
- pMesh->mColors[a] = new aiColor4D[pMesh->mNumVertices];
- for ( unsigned int b = 0; b < pMesh->mNumVertices; b++) {
- pMesh->mColors[a][b] = uniqueVertices[b].colors[a];
- }
- }
- // Texture coords
- for ( unsigned int a = 0; pMesh->HasTextureCoords(a); a++)
- {
- delete [] pMesh->mTextureCoords[a];
- pMesh->mTextureCoords[a] = new aiVector3D[pMesh->mNumVertices];
- for ( unsigned int b = 0; b < pMesh->mNumVertices; b++) {
- pMesh->mTextureCoords[a][b] = uniqueVertices[b].texcoords[a];
- }
- }
-
- // adjust the indices in all faces
- for ( unsigned int a = 0; a < pMesh->mNumFaces; a++)
- {
- aiFace& face = pMesh->mFaces[a];
- for ( unsigned int b = 0; b < face.mNumIndices; b++) {
- face.mIndices[b] = replaceIndex[face.mIndices[b]] & ~0x80000000;
- }
- }
-
- // adjust bone vertex weights.
- for ( int a = 0; a < (int)pMesh->mNumBones; a++)
- {
- aiBone* bone = pMesh->mBones[a];
- std::vector<aiVertexWeight> newWeights;
- newWeights.reserve( bone->mNumWeights);
-
- for ( unsigned int b = 0; b < bone->mNumWeights; b++)
- {
- const aiVertexWeight& ow = bone->mWeights[b];
- // if the vertex is a unique one, translate it
- if ( !(replaceIndex[ow.mVertexId] & 0x80000000))
- {
- aiVertexWeight nw;
- nw.mVertexId = replaceIndex[ow.mVertexId];
- nw.mWeight = ow.mWeight;
- newWeights.push_back( nw);
- }
- }
-
- if (newWeights.size() > 0) {
- // kill the old and replace them with the translated weights
- delete [] bone->mWeights;
- bone->mNumWeights = (unsigned int)newWeights.size();
-
- bone->mWeights = new aiVertexWeight[bone->mNumWeights];
- memcpy( bone->mWeights, &newWeights[0], bone->mNumWeights * sizeof( aiVertexWeight));
- }
- else {
-
- /* NOTE:
- *
- * In the algorithm above we're assuming that there are no vertices
- * with a different bone weight setup at the same position. That wouldn't
- * make sense, but it is not absolutely impossible. SkeletonMeshBuilder
- * for example generates such input data if two skeleton points
- * share the same position. Again this doesn't make sense but is
- * reality for some model formats (MD5 for example uses these special
- * nodes as attachment tags for its weapons).
- *
- * Then it is possible that a bone has no weights anymore .... as a quick
- * workaround, we're just removing these bones. If they're animated,
- * model geometry might be modified but at least there's no risk of a crash.
- */
- delete bone;
- --pMesh->mNumBones;
- for (unsigned int n = a; n < pMesh->mNumBones; ++n) {
- pMesh->mBones[n] = pMesh->mBones[n+1];
- }
-
- --a;
- DefaultLogger::get()->warn("Removing bone -> no weights remaining");
- }
- }
- return pMesh->mNumVertices;
-}
-
-#endif // !! ASSIMP_BUILD_NO_JOINVERTICES_PROCESS
diff --git a/3rdparty/assimp/code/JoinVerticesProcess.h b/3rdparty/assimp/code/JoinVerticesProcess.h
deleted file mode 100644
index 0ce00ab5..00000000
--- a/3rdparty/assimp/code/JoinVerticesProcess.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file Defines a post processing step to join identical vertices
- on all imported meshes.*/
-#ifndef AI_JOINVERTICESPROCESS_H_INC
-#define AI_JOINVERTICESPROCESS_H_INC
-
-#include "BaseProcess.h"
-#include "../include/aiTypes.h"
-
-struct aiMesh;
-
-namespace Assimp
-{
-
-class JoinVerticesTest;
-
-// ---------------------------------------------------------------------------
-/** The JoinVerticesProcess unites identical vertices in all imported meshes.
- * By default the importer returns meshes where each face addressed its own
- * set of vertices even if that means that identical vertices are stored multiple
- * times. The JoinVerticesProcess finds these identical vertices and
- * erases all but one of the copies. This usually reduces the number of vertices
- * in a mesh by a serious amount and is the standard form to render a mesh.
- */
-class ASSIMP_API JoinVerticesProcess : public BaseProcess
-{
- friend class Importer;
- friend class JoinVerticesTest;
-
-protected:
- /** Constructor to be privately used by Importer */
- JoinVerticesProcess();
-
- /** Destructor, private as well */
- ~JoinVerticesProcess();
-
-public:
- // -------------------------------------------------------------------
- /** Returns whether the processing step is present in the given flag field.
- * @param pFlags The processing flags the importer was called with. A bitwise
- * combination of #aiPostProcessSteps.
- * @return true if the process is present in this flag fields, false if not.
- */
- bool IsActive( unsigned int pFlags) const;
-
- // -------------------------------------------------------------------
- /** Executes the post processing step on the given imported data.
- * At the moment a process is not supposed to fail.
- * @param pScene The imported data to work at.
- */
- void Execute( aiScene* pScene);
-
-protected:
- // -------------------------------------------------------------------
- /** Unites identical vertices in the given mesh.
- * @param pMesh The mesh to process.
- * @param meshIndex Index of the mesh to process
- */
- int ProcessMesh( aiMesh* pMesh, unsigned int meshIndex);
-
-private:
-};
-
-} // end of namespace Assimp
-
-#endif // AI_CALCTANGENTSPROCESS_H_INC
diff --git a/3rdparty/assimp/code/LWOAnimation.cpp b/3rdparty/assimp/code/LWOAnimation.cpp
deleted file mode 100644
index 128fd6d6..00000000
--- a/3rdparty/assimp/code/LWOAnimation.cpp
+++ /dev/null
@@ -1,585 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file LWOAnimation.cpp
- * @brief LWOAnimationResolver utility class
- *
- * It's a very generic implementation of LightWave's system of
- * componentwise-animated stuff. The one and only fully free
- * implementation of LightWave envelopes of which I know.
-*/
-
-#include "AssimpPCH.h"
-#if (!defined ASSIMP_BUILD_NO_LWO_IMPORTER) && (!defined ASSIMP_BUILD_NO_LWS_IMPORTER)
-
-// internal headers
-#include "LWOFileData.h"
-
-using namespace Assimp;
-using namespace Assimp::LWO;
-
-// ------------------------------------------------------------------------------------------------
-// Construct an animation resolver from a given list of envelopes
-AnimResolver::AnimResolver(std::list<Envelope>& _envelopes,double tick)
- : envelopes (_envelopes)
- , sample_rate (0.)
-{
- trans_x = trans_y = trans_z = NULL;
- rotat_x = rotat_y = rotat_z = NULL;
- scale_x = scale_y = scale_z = NULL;
-
- first = last = 150392.;
-
- // find transformation envelopes
- for (std::list<LWO::Envelope>::iterator it = envelopes.begin(); it != envelopes.end(); ++it) {
-
- (*it).old_first = 0;
- (*it).old_last = (*it).keys.size()-1;
-
- if ((*it).keys.empty()) continue;
- switch ((*it).type) {
-
- // translation
- case LWO::EnvelopeType_Position_X:
- trans_x = &*it;break;
- case LWO::EnvelopeType_Position_Y:
- trans_y = &*it;break;
- case LWO::EnvelopeType_Position_Z:
- trans_z = &*it;break;
-
- // rotation
- case LWO::EnvelopeType_Rotation_Heading:
- rotat_x = &*it;break;
- case LWO::EnvelopeType_Rotation_Pitch:
- rotat_y = &*it;break;
- case LWO::EnvelopeType_Rotation_Bank:
- rotat_z = &*it;break;
-
- // scaling
- case LWO::EnvelopeType_Scaling_X:
- scale_x = &*it;break;
- case LWO::EnvelopeType_Scaling_Y:
- scale_y = &*it;break;
- case LWO::EnvelopeType_Scaling_Z:
- scale_z = &*it;break;
- default:
- continue;
- };
-
- // convert from seconds to ticks
- for (std::vector<LWO::Key>::iterator d = (*it).keys.begin(); d != (*it).keys.end(); ++d)
- (*d).time *= tick;
-
- // set default animation range (minimum and maximum time value for which we have a keyframe)
- first = std::min(first, (*it).keys.front().time );
- last = std::max(last, (*it).keys.back().time );
- }
-
- // deferred setup of animation range to increase performance.
- // typically the application will want to specify its own.
- need_to_setup = true;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reset all envelopes to their original contents
-void AnimResolver::ClearAnimRangeSetup()
-{
- for (std::list<LWO::Envelope>::iterator it = envelopes.begin(); it != envelopes.end(); ++it) {
-
- (*it).keys.erase((*it).keys.begin(),(*it).keys.begin()+(*it).old_first);
- (*it).keys.erase((*it).keys.begin()+(*it).old_last+1,(*it).keys.end());
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Insert additional keys to match LWO's pre& post behaviours.
-void AnimResolver::UpdateAnimRangeSetup()
-{
- // XXX doesn't work yet (hangs if more than one envelope channels needs to be interpolated)
-
- for (std::list<LWO::Envelope>::iterator it = envelopes.begin(); it != envelopes.end(); ++it) {
- if ((*it).keys.empty()) continue;
-
- const double my_first = (*it).keys.front().time;
- const double my_last = (*it).keys.back().time;
-
- const double delta = my_last-my_first;
- const size_t old_size = (*it).keys.size();
-
- const float value_delta = (*it).keys.back().value - (*it).keys.front().value;
-
- // NOTE: We won't handle reset, linear and constant here.
- // See DoInterpolation() for their implementation.
-
- // process pre behaviour
- switch ((*it).pre) {
- case LWO::PrePostBehaviour_OffsetRepeat:
- case LWO::PrePostBehaviour_Repeat:
- case LWO::PrePostBehaviour_Oscillate:
- {
- const double start_time = delta - fmod(my_first-first,delta);
- std::vector<LWO::Key>::iterator n = std::find_if((*it).keys.begin(),(*it).keys.end(),
- std::bind1st(std::greater<double>(),start_time)),m;
-
- size_t ofs = 0;
- if (n != (*it).keys.end()) {
- // copy from here - don't use iterators, insert() would invalidate them
- ofs = (*it).keys.end()-n;
- (*it).keys.insert((*it).keys.begin(),ofs,LWO::Key());
-
- std::copy((*it).keys.end()-ofs,(*it).keys.end(),(*it).keys.begin());
- }
-
- // do full copies. again, no iterators
- const unsigned int num = (unsigned int)((my_first-first) / delta);
- (*it).keys.resize((*it).keys.size() + num*old_size);
-
- n = (*it).keys.begin()+ofs;
- bool reverse = false;
- for (unsigned int i = 0; i < num; ++i) {
- m = n+old_size*(i+1);
- std::copy(n,n+old_size,m);
-
- if ((*it).pre == LWO::PrePostBehaviour_Oscillate && (reverse = !reverse))
- std::reverse(m,m+old_size-1);
- }
-
- // update time values
- n = (*it).keys.end() - (old_size+1);
- double cur_minus = delta;
- unsigned int tt = 1;
- for (const double tmp = delta*(num+1);cur_minus <= tmp;cur_minus += delta,++tt) {
- m = (delta == tmp ? (*it).keys.begin() : n - (old_size+1));
- for (;m != n; --n) {
- (*n).time -= cur_minus;
-
- // offset repeat? add delta offset to key value
- if ((*it).pre == LWO::PrePostBehaviour_OffsetRepeat) {
- (*n).value += tt * value_delta;
- }
- }
- }
- break;
- }
- default:
- // silence compiler warning
- break;
- }
-
- // process post behaviour
- switch ((*it).post) {
-
- case LWO::PrePostBehaviour_OffsetRepeat:
- case LWO::PrePostBehaviour_Repeat:
- case LWO::PrePostBehaviour_Oscillate:
-
- break;
-
- default:
- // silence compiler warning
- break;
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Extract bind pose matrix
-void AnimResolver::ExtractBindPose(aiMatrix4x4& out)
-{
- // If we have no envelopes, return identity
- if (envelopes.empty()) {
- out = aiMatrix4x4();
- return;
- }
- aiVector3D angles, scaling(1.f,1.f,1.f), translation;
-
- if (trans_x) translation.x = trans_x->keys[0].value;
- if (trans_y) translation.y = trans_y->keys[0].value;
- if (trans_z) translation.z = trans_z->keys[0].value;
-
- if (rotat_x) angles.x = rotat_x->keys[0].value;
- if (rotat_y) angles.y = rotat_y->keys[0].value;
- if (rotat_z) angles.z = rotat_z->keys[0].value;
-
- if (scale_x) scaling.x = scale_x->keys[0].value;
- if (scale_y) scaling.y = scale_y->keys[0].value;
- if (scale_z) scaling.z = scale_z->keys[0].value;
-
- // build the final matrix
- aiMatrix4x4 s,r,t;
-
- r.FromEulerAnglesXYZ(angles);
- //aiMatrix4x4::RotationY(angles.y,r);
- // fixme: make FromEulerAngles static, too
- aiMatrix4x4::Translation(translation,t);
- aiMatrix4x4::Scaling(scaling,s);
- out = s*r*t;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Do a single interpolation on a channel
-void AnimResolver::DoInterpolation(std::vector<LWO::Key>::const_iterator cur,
- LWO::Envelope* envl,double time, float& fill)
-{
- if (envl->keys.size() == 1) {
- fill = envl->keys[0].value;
- return;
- }
-
- // check whether we're at the beginning of the animation track
- if (cur == envl->keys.begin()) {
-
- // ok ... this depends on pre behaviour now
- // we don't need to handle repeat&offset repeat&oszillate here, see UpdateAnimRangeSetup()
- switch (envl->pre)
- {
- case LWO::PrePostBehaviour_Linear:
- DoInterpolation2(cur,cur+1,time,fill);
- return;
-
- case LWO::PrePostBehaviour_Reset:
- fill = 0.f;
- return;
-
- default : //case LWO::PrePostBehaviour_Constant:
- fill = (*cur).value;
- return;
- }
- }
- // check whether we're at the end of the animation track
- else if (cur == envl->keys.end()-1 && time > envl->keys.rbegin()->time) {
- // ok ... this depends on post behaviour now
- switch (envl->post)
- {
- case LWO::PrePostBehaviour_Linear:
- DoInterpolation2(cur,cur-1,time,fill);
- return;
-
- case LWO::PrePostBehaviour_Reset:
- fill = 0.f;
- return;
-
- default : //case LWO::PrePostBehaviour_Constant:
- fill = (*cur).value;
- return;
- }
- }
-
- // Otherwise do a simple interpolation
- DoInterpolation2(cur-1,cur,time,fill);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Almost the same, except we won't handle pre/post conditions here
-void AnimResolver::DoInterpolation2(std::vector<LWO::Key>::const_iterator beg,
- std::vector<LWO::Key>::const_iterator end,double time, float& fill)
-{
- switch ((*end).inter) {
-
- case LWO::IT_STEP:
- // no interpolation at all - take the value of the last key
- fill = (*beg).value;
- return;
- default:
-
- // silence compiler warning
- break;
- }
- // linear interpolation - default
- fill = (*beg).value + ((*end).value - (*beg).value)*(float)(((time - (*beg).time) / ((*end).time - (*beg).time)));
-}
-
-// ------------------------------------------------------------------------------------------------
-// Subsample animation track by given key values
-void AnimResolver::SubsampleAnimTrack(std::vector<aiVectorKey>& /*out*/,
- double /*time*/ ,double /*sample_delta*/ )
-{
- //ai_assert(out.empty() && sample_delta);
-
- //const double time_start = out.back().mTime;
-// for ()
-}
-
-// ------------------------------------------------------------------------------------------------
-// Track interpolation
-void AnimResolver::InterpolateTrack(std::vector<aiVectorKey>& out,aiVectorKey& fill,double time)
-{
- // subsample animation track?
- if (flags & AI_LWO_ANIM_FLAG_SAMPLE_ANIMS) {
- SubsampleAnimTrack(out,time, sample_delta);
- }
-
- fill.mTime = time;
-
- // get x
- if ((*cur_x).time == time) {
- fill.mValue.x = (*cur_x).value;
-
- if (cur_x != envl_x->keys.end()-1) /* increment x */
- ++cur_x;
- else end_x = true;
- }
- else DoInterpolation(cur_x,envl_x,time,(float&)fill.mValue.x);
-
- // get y
- if ((*cur_y).time == time) {
- fill.mValue.y = (*cur_y).value;
-
- if (cur_y != envl_y->keys.end()-1) /* increment y */
- ++cur_y;
- else end_y = true;
- }
- else DoInterpolation(cur_y,envl_y,time,(float&)fill.mValue.y);
-
- // get z
- if ((*cur_z).time == time) {
- fill.mValue.z = (*cur_z).value;
-
- if (cur_z != envl_z->keys.end()-1) /* increment z */
- ++cur_z;
- else end_x = true;
- }
- else DoInterpolation(cur_z,envl_z,time,(float&)fill.mValue.z);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Build linearly subsampled keys from three single envelopes, one for each component (x,y,z)
-void AnimResolver::GetKeys(std::vector<aiVectorKey>& out,
- LWO::Envelope* _envl_x,
- LWO::Envelope* _envl_y,
- LWO::Envelope* _envl_z,
- unsigned int _flags)
-{
- envl_x = _envl_x;
- envl_y = _envl_y;
- envl_z = _envl_z;
- flags = _flags;
-
- // generate default channels if none are given
- LWO::Envelope def_x, def_y, def_z;
- LWO::Key key_dummy;
- key_dummy.time = 0.f;
- if ((envl_x && envl_x->type == LWO::EnvelopeType_Scaling_X) ||
- (envl_y && envl_y->type == LWO::EnvelopeType_Scaling_Y) ||
- (envl_z && envl_z->type == LWO::EnvelopeType_Scaling_Z)) {
- key_dummy.value = 1.f;
- }
- else key_dummy.value = 0.f;
-
- if (!envl_x) {
- envl_x = &def_x;
- envl_x->keys.push_back(key_dummy);
- }
- if (!envl_y) {
- envl_y = &def_y;
- envl_y->keys.push_back(key_dummy);
- }
- if (!envl_z) {
- envl_z = &def_z;
- envl_z->keys.push_back(key_dummy);
- }
-
- // guess how many keys we'll get
- size_t reserve;
- double sr = 1.;
- if (flags & AI_LWO_ANIM_FLAG_SAMPLE_ANIMS) {
- if (!sample_rate)
- sr = 100.f;
- else sr = sample_rate;
- sample_delta = 1.f / sr;
-
- reserve = (size_t)(
- std::max( envl_x->keys.end()->time,
- std::max( envl_y->keys.end()->time, envl_z->keys.end()->time )) * sr);
- }
- else reserve = std::max(envl_x->keys.size(),std::max(envl_x->keys.size(),envl_z->keys.size()));
- out.reserve(reserve+(reserve>>1));
-
- // Iterate through all three arrays at once - it's tricky, but
- // rather interesting to implement.
- double lasttime = std::min(envl_x->keys[0].time,std::min(envl_y->keys[0].time,envl_z->keys[0].time));
-
- cur_x = envl_x->keys.begin();
- cur_y = envl_y->keys.begin();
- cur_z = envl_z->keys.begin();
-
- end_x = end_y = end_z = false;
- while (1) {
-
- aiVectorKey fill;
-
- if ((*cur_x).time == (*cur_y).time && (*cur_x).time == (*cur_z).time ) {
-
- // we have a keyframe for all of them defined .. great,
- // we don't need to fucking interpolate here ...
- fill.mTime = (*cur_x).time;
-
- fill.mValue.x = (*cur_x).value;
- fill.mValue.y = (*cur_y).value;
- fill.mValue.z = (*cur_z).value;
-
- // subsample animation track
- if (flags & AI_LWO_ANIM_FLAG_SAMPLE_ANIMS) {
- //SubsampleAnimTrack(out,cur_x, cur_y, cur_z, d, sample_delta);
- }
-
- if (cur_x != envl_x->keys.end()-1)
- ++cur_x;
- else end_x = true;
- if (cur_y != envl_y->keys.end()-1)
- ++cur_y;
- else end_y = true;
- if (cur_z != envl_z->keys.end()-1)
- ++cur_z;
- else end_z = true;
- }
-
- // Find key with lowest time value
- else if ((*cur_x).time <= (*cur_y).time && !end_x) {
-
- if ((*cur_z).time <= (*cur_x).time && !end_z) {
- InterpolateTrack(out,fill,(*cur_z).time);
- }
- else {
- InterpolateTrack(out,fill,(*cur_x).time);
- }
- }
- else if ((*cur_z).time <= (*cur_y).time && !end_z) {
- InterpolateTrack(out,fill,(*cur_z).time);
- }
- else if (!end_y) {
- // welcome on the server, y
- InterpolateTrack(out,fill,(*cur_y).time);
- }
- else {
- // we have reached the end of at least 2 channels,
- // only one is remaining. Extrapolate the 2.
- if (end_y) {
- InterpolateTrack(out,fill,(end_x ? (*cur_z) : (*cur_x)).time);
- }
- else if (end_x) {
- InterpolateTrack(out,fill,(end_z ? (*cur_y) : (*cur_z)).time);
- }
- else { // if (end_z)
- InterpolateTrack(out,fill,(end_y ? (*cur_x) : (*cur_y)).time);
- }
- }
- lasttime = fill.mTime;
- out.push_back(fill);
-
- if ( end_x && end_y && end_z ) /* finished? */
- break;
- }
-
- if (flags & AI_LWO_ANIM_FLAG_START_AT_ZERO) {
- for (std::vector<aiVectorKey>::iterator it = out.begin(); it != out.end(); ++it)
- (*it).mTime -= first;
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Extract animation channel
-void AnimResolver::ExtractAnimChannel(aiNodeAnim** out, unsigned int flags /*= 0*/)
-{
- *out = NULL;
-
-
- //FIXME: crashes if more than one component is animated at different timings, to be resolved.
- return;
-
-#if 0
- // If we have no envelopes, return NULL
- if (envelopes.empty()) {
- return;
- }
-
- // We won't spawn an animation channel if we don't have at least one envelope with more than one keyframe defined.
- const bool trans = (trans_x && trans_x->keys.size() > 1 || trans_y && trans_y->keys.size() > 1 || trans_z && trans_z->keys.size() > 1);
- const bool rotat = (rotat_x && rotat_x->keys.size() > 1 || rotat_y && rotat_y->keys.size() > 1 || rotat_z && rotat_z->keys.size() > 1);
- const bool scale = (scale_x && scale_x->keys.size() > 1 || scale_y && scale_y->keys.size() > 1 || scale_z && scale_z->keys.size() > 1);
- if (!trans && !rotat && !scale)
- return;
-
- // Allocate the output animation
- aiNodeAnim* anim = *out = new aiNodeAnim();
-
- // Setup default animation setup if necessary
- if (need_to_setup) {
- UpdateAnimRangeSetup();
- need_to_setup = false;
- }
-
- // copy translation keys
- if (trans) {
- std::vector<aiVectorKey> keys;
- GetKeys(keys,trans_x,trans_y,trans_z,flags);
-
- anim->mPositionKeys = new aiVectorKey[ anim->mNumPositionKeys = keys.size() ];
- std::copy(keys.begin(),keys.end(),anim->mPositionKeys);
- }
-
- // copy rotation keys
- if (rotat) {
- std::vector<aiVectorKey> keys;
- GetKeys(keys,rotat_x,rotat_y,rotat_z,flags);
-
- anim->mRotationKeys = new aiQuatKey[ anim->mNumRotationKeys = keys.size() ];
-
- // convert heading, pitch, bank to quaternion
- for (unsigned int i = 0; i < anim->mNumRotationKeys; ++i) {
- aiQuatKey& qk = anim->mRotationKeys[i];
- qk.mTime = keys[i].mTime;
- qk.mValue = aiQuaternion( keys[i].mValue.x ,keys[i].mValue.z ,keys[i].mValue.y );
- }
- }
-
- // copy scaling keys
- if (scale) {
- std::vector<aiVectorKey> keys;
- GetKeys(keys,scale_x,scale_y,scale_z,flags);
-
- anim->mScalingKeys = new aiVectorKey[ anim->mNumScalingKeys = keys.size() ];
- std::copy(keys.begin(),keys.end(),anim->mScalingKeys);
- }
-#endif
-}
-
-
-#endif // no lwo or no lws
diff --git a/3rdparty/assimp/code/LWOAnimation.h b/3rdparty/assimp/code/LWOAnimation.h
deleted file mode 100644
index cb376f23..00000000
--- a/3rdparty/assimp/code/LWOAnimation.h
+++ /dev/null
@@ -1,336 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file LWOAnimation.h
- * @brief LWOAnimationResolver utility class
- *
- * This is for all lightwave-related file format, not only LWO.
- * LWS isthe main purpose.
-*/
-#ifndef AI_LWO_ANIMATION_INCLUDED
-#define AI_LWO_ANIMATION_INCLUDED
-
-namespace Assimp {
-namespace LWO {
-
-// ---------------------------------------------------------------------------
-/** \brief List of recognized LWO envelopes
- */
-enum EnvelopeType
-{
- EnvelopeType_Position_X = 0x1,
- EnvelopeType_Position_Y = 0x2,
- EnvelopeType_Position_Z = 0x3,
-
- EnvelopeType_Rotation_Heading = 0x4,
- EnvelopeType_Rotation_Pitch = 0x5,
- EnvelopeType_Rotation_Bank = 0x6,
-
- EnvelopeType_Scaling_X = 0x7,
- EnvelopeType_Scaling_Y = 0x8,
- EnvelopeType_Scaling_Z = 0x9,
-
- // -- currently not yet handled
- EnvelopeType_Color_R = 0xa,
- EnvelopeType_Color_G = 0xb,
- EnvelopeType_Color_B = 0xc,
-
- EnvelopeType_Falloff_X = 0xd,
- EnvelopeType_Falloff_Y = 0xe,
- EnvelopeType_Falloff_Z = 0xf,
-
- EnvelopeType_Unknown
-};
-
-// ---------------------------------------------------------------------------
-/** \brief List of recognized LWO interpolation modes
- */
-enum InterpolationType
-{
- IT_STEP, IT_LINE, IT_TCB, IT_HERM, IT_BEZI, IT_BEZ2
-};
-
-
-// ---------------------------------------------------------------------------
-/** \brief List of recognized LWO pre or post range behaviours
- */
-enum PrePostBehaviour
-{
- PrePostBehaviour_Reset = 0x0,
- PrePostBehaviour_Constant = 0x1,
- PrePostBehaviour_Repeat = 0x2,
- PrePostBehaviour_Oscillate = 0x3,
- PrePostBehaviour_OffsetRepeat = 0x4,
- PrePostBehaviour_Linear = 0x5
-};
-
-// ---------------------------------------------------------------------------
-/** \brief Data structure for a LWO animation keyframe
- */
-struct Key
-{
- Key()
- : inter (IT_LINE)
- {}
-
- //! Current time
- double time;
-
- //! Current value
- float value;
-
- //! How to interpolate this key with previous key?
- InterpolationType inter;
-
- //! Interpolation parameters
- float params[5];
-
-
- // for std::find()
- operator double () {
- return time;
- }
-};
-
-// ---------------------------------------------------------------------------
-/** \brief Data structure for a LWO animation envelope
- */
-struct Envelope
-{
- Envelope()
- : type (EnvelopeType_Unknown)
- , pre (PrePostBehaviour_Constant)
- , post (PrePostBehaviour_Constant)
-
- , old_first (0)
- , old_last (0)
- {}
-
- //! Index of this envelope
- unsigned int index;
-
- //! Type of envelope
- EnvelopeType type;
-
- //! Pre and post-behaviour
- PrePostBehaviour pre,post;
-
- //! Keyframes for this envelope
- std::vector<Key> keys;
-
-
- // temporary data for AnimResolver
- size_t old_first,old_last;
-};
-
-// ---------------------------------------------------------------------------
-//! @def AI_LWO_ANIM_FLAG_SAMPLE_ANIMS
-//! Flag for AnimResolver, subsamples the input data with the rate specified
-//! by AnimResolver::SetSampleRate().
-#define AI_LWO_ANIM_FLAG_SAMPLE_ANIMS 0x1
-
-
-// ---------------------------------------------------------------------------
-//! @def AI_LWO_ANIM_FLAG_START_AT_ZERO
-//! Flag for AnimResolver, ensures that the animations starts at zero.
-#define AI_LWO_ANIM_FLAG_START_AT_ZERO 0x2
-
-// ---------------------------------------------------------------------------
-/** @brief Utility class to build Assimp animations from LWO envelopes.
- *
- * Used for both LWO and LWS (MOT also).
- */
-class AnimResolver
-{
-public:
-
- // ------------------------------------------------------------------
- /** @brief Construct an AnimResolver from a given list of envelopes
- * @param envelopes Input envelopes. May be empty.
- * @param Output tick rate, per second
- * @note The input envelopes are possibly modified.
- */
- AnimResolver(std::list<Envelope>& envelopes,
- double tick);
-
-public:
-
- // ------------------------------------------------------------------
- /** @brief Extract the bind-pose transformation matrix.
- * @param out Receives bind-pose transformation matrix
- */
- void ExtractBindPose(aiMatrix4x4& out);
-
- // ------------------------------------------------------------------
- /** @brief Extract a node animation channel
- * @param out Receives a pointer to a newly allocated node anim.
- * If there's just one keyframe defined, *out is set to NULL and
- * no animation channel is computed.
- * @param flags Any combination of the AI_LWO_ANIM_FLAG_XXX flags.
- */
- void ExtractAnimChannel(aiNodeAnim** out, unsigned int flags = 0);
-
-
- // ------------------------------------------------------------------
- /** @brief Set the sampling rate for ExtractAnimChannel().
- *
- * Non-linear interpolations are subsampled with this rate (keys
- * per second). Closer sampling positions, if existent, are kept.
- * The sampling rate defaults to 0, if this value is not changed and
- * AI_LWO_ANIM_FLAG_SAMPLE_ANIMS is specified for ExtractAnimChannel(),
- * the class finds a suitable sample rate by itself.
- */
- void SetSampleRate(double sr) {
- sample_rate = sr;
- }
-
- // ------------------------------------------------------------------
- /** @brief Getter for SetSampleRate()
- */
- double GetSampleRate() const {
- return sample_rate;
- }
-
- // ------------------------------------------------------------------
- /** @brief Set the animation time range
- *
- * @param first Time where the animation starts, in ticks
- * @param last Time where the animation ends, in ticks
- */
- void SetAnimationRange(double _first, double _last) {
- first = _first;
- last = _last;
-
- ClearAnimRangeSetup();
- UpdateAnimRangeSetup();
- }
-
-protected:
-
- // ------------------------------------------------------------------
- /** @brief Build linearly subsampled keys from 3 single envelopes
- * @param out Receives output keys
- * @param envl_x X-component envelope
- * @param envl_y Y-component envelope
- * @param envl_z Z-component envelope
- * @param flags Any combination of the AI_LWO_ANIM_FLAG_XXX flags.
- * @note Up to two input envelopes may be NULL
- */
- void GetKeys(std::vector<aiVectorKey>& out,
- LWO::Envelope* envl_x,
- LWO::Envelope* envl_y,
- LWO::Envelope* envl_z,
- unsigned int flags);
-
- // ------------------------------------------------------------------
- /** @brief Resolve a single animation key by applying the right
- * interpolation to it.
- * @param cur Current key
- * @param envl Envelope working on
- * @param time time to be interpolated
- * @param fill Receives the interpolated output value.
- */
- void DoInterpolation(std::vector<LWO::Key>::const_iterator cur,
- LWO::Envelope* envl,double time, float& fill);
-
- // ------------------------------------------------------------------
- /** @brief Almost the same, except we won't handle pre/post
- * conditions here.
- * @see DoInterpolation
- */
- void DoInterpolation2(std::vector<LWO::Key>::const_iterator beg,
- std::vector<LWO::Key>::const_iterator end,double time, float& fill);
-
- // ------------------------------------------------------------------
- /** @brief Interpolate 2 tracks if one is given
- *
- * @param out Receives extra output keys
- * @param key_out Primary output key
- * @param time Time to interpolate for
- */
- void InterpolateTrack(std::vector<aiVectorKey>& out,
- aiVectorKey& key_out,double time);
-
- // ------------------------------------------------------------------
- /** @brief Subsample an animation track by a given sampling rate
- *
- * @param out Receives output keys. Last key at input defines the
- * time where subsampling starts.
- * @param time Time to end subsampling at
- * @param sample_delta Time delta between two samples
- */
- void SubsampleAnimTrack(std::vector<aiVectorKey>& out,
- double time,double sample_delta);
-
- // ------------------------------------------------------------------
- /** @brief Delete all keys which we inserted to match anim setup
- */
- void ClearAnimRangeSetup();
-
- // ------------------------------------------------------------------
- /** @brief Insert extra keys to match LWO's pre and post behaviours
- * in a given time range [first...last]
- */
- void UpdateAnimRangeSetup();
-
-private:
- std::list<Envelope>& envelopes;
- double sample_rate;
-
- LWO::Envelope* trans_x, *trans_y, *trans_z;
- LWO::Envelope* rotat_x, *rotat_y, *rotat_z;
- LWO::Envelope* scale_x, *scale_y, *scale_z;
-
- double first, last;
- bool need_to_setup;
-
- // temporary storage
- LWO::Envelope* envl_x, * envl_y, * envl_z;
- std::vector<LWO::Key>::const_iterator cur_x,cur_y,cur_z;
- bool end_x, end_y, end_z;
-
- unsigned int flags;
- double sample_delta;
-};
-
-} // end namespace LWO
-} // end namespace Assimp
-
-#endif // !! AI_LWO_ANIMATION_INCLUDED
diff --git a/3rdparty/assimp/code/LWOBLoader.cpp b/3rdparty/assimp/code/LWOBLoader.cpp
deleted file mode 100644
index c4704ca7..00000000
--- a/3rdparty/assimp/code/LWOBLoader.cpp
+++ /dev/null
@@ -1,396 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file Implementation of the LWO importer class for the older LWOB
- file formats, including materials */
-
-#include "AssimpPCH.h"
-#ifndef ASSIMP_BUILD_NO_LWO_IMPORTER
-
-// Internal headers
-#include "LWOLoader.h"
-using namespace Assimp;
-
-
-// ------------------------------------------------------------------------------------------------
-void LWOImporter::LoadLWOBFile()
-{
- LE_NCONST uint8_t* const end = mFileBuffer + fileSize;
- bool running = true;
- while (running)
- {
- if (mFileBuffer + sizeof(IFF::ChunkHeader) > end)break;
- LE_NCONST IFF::ChunkHeader* const head = IFF::LoadChunk(mFileBuffer);
-
- if (mFileBuffer + head->length > end)
- {
- throw DeadlyImportError("LWOB: Invalid chunk length");
- break;
- }
- uint8_t* const next = mFileBuffer+head->length;
- switch (head->type)
- {
- // vertex list
- case AI_LWO_PNTS:
- {
- if (!mCurLayer->mTempPoints.empty())
- DefaultLogger::get()->warn("LWO: PNTS chunk encountered twice");
- else LoadLWOPoints(head->length);
- break;
- }
- // face list
- case AI_LWO_POLS:
- {
- if (!mCurLayer->mFaces.empty())
- DefaultLogger::get()->warn("LWO: POLS chunk encountered twice");
- else LoadLWOBPolygons(head->length);
- break;
- }
- // list of tags
- case AI_LWO_SRFS:
- {
- if (!mTags->empty())
- DefaultLogger::get()->warn("LWO: SRFS chunk encountered twice");
- else LoadLWOTags(head->length);
- break;
- }
-
- // surface chunk
- case AI_LWO_SURF:
- {
- LoadLWOBSurface(head->length);
- break;
- }
- }
- mFileBuffer = next;
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void LWOImporter::LoadLWOBPolygons(unsigned int length)
-{
- // first find out how many faces and vertices we'll finally need
- LE_NCONST uint16_t* const end = (LE_NCONST uint16_t*)(mFileBuffer+length);
- LE_NCONST uint16_t* cursor = (LE_NCONST uint16_t*)mFileBuffer;
-
- // perform endianess conversions
-#ifndef AI_BUILD_BIG_ENDIAN
- while (cursor < end)ByteSwap::Swap2(cursor++);
- cursor = (LE_NCONST uint16_t*)mFileBuffer;
-#endif
-
- unsigned int iNumFaces = 0,iNumVertices = 0;
- CountVertsAndFacesLWOB(iNumVertices,iNumFaces,cursor,end);
-
- // allocate the output array and copy face indices
- if (iNumFaces)
- {
- cursor = (LE_NCONST uint16_t*)mFileBuffer;
-
- mCurLayer->mFaces.resize(iNumFaces);
- FaceList::iterator it = mCurLayer->mFaces.begin();
- CopyFaceIndicesLWOB(it,cursor,end);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void LWOImporter::CountVertsAndFacesLWOB(unsigned int& verts, unsigned int& faces,
- LE_NCONST uint16_t*& cursor, const uint16_t* const end, unsigned int max)
-{
- while (cursor < end && max--)
- {
- uint16_t numIndices = *cursor++;
- verts += numIndices;faces++;
- cursor += numIndices;
- int16_t surface = *cursor++;
- if (surface < 0)
- {
- // there are detail polygons
- numIndices = *cursor++;
- CountVertsAndFacesLWOB(verts,faces,cursor,end,numIndices);
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void LWOImporter::CopyFaceIndicesLWOB(FaceList::iterator& it,
- LE_NCONST uint16_t*& cursor,
- const uint16_t* const end,
- unsigned int max)
-{
- while (cursor < end && max--)
- {
- LWO::Face& face = *it;++it;
- if ((face.mNumIndices = *cursor++))
- {
- if (cursor + face.mNumIndices >= end)break;
- face.mIndices = new unsigned int[face.mNumIndices];
- for (unsigned int i = 0; i < face.mNumIndices;++i)
- {
- unsigned int & mi = face.mIndices[i] = *cursor++;
- if (mi > mCurLayer->mTempPoints.size())
- {
- DefaultLogger::get()->warn("LWOB: face index is out of range");
- mi = (unsigned int)mCurLayer->mTempPoints.size()-1;
- }
- }
- }
- else DefaultLogger::get()->warn("LWOB: Face has 0 indices");
- int16_t surface = *cursor++;
- if (surface < 0)
- {
- surface = -surface;
-
- // there are detail polygons.
- const uint16_t numPolygons = *cursor++;
- if (cursor < end)CopyFaceIndicesLWOB(it,cursor,end,numPolygons);
- }
- face.surfaceIndex = surface-1;
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-LWO::Texture* LWOImporter::SetupNewTextureLWOB(LWO::TextureList& list,unsigned int size)
-{
- list.push_back(LWO::Texture());
- LWO::Texture* tex = &list.back();
-
- std::string type;
- GetS0(type,size);
- const char* s = type.c_str();
-
- if (strstr(s, "Image Map"))
- {
- // Determine mapping type
- if (strstr(s, "Planar"))
- tex->mapMode = LWO::Texture::Planar;
- else if (strstr(s, "Cylindrical"))
- tex->mapMode = LWO::Texture::Cylindrical;
- else if (strstr(s, "Spherical"))
- tex->mapMode = LWO::Texture::Spherical;
- else if (strstr(s, "Cubic"))
- tex->mapMode = LWO::Texture::Cubic;
- else if (strstr(s, "Front"))
- tex->mapMode = LWO::Texture::FrontProjection;
- }
- else
- {
- // procedural or gradient, not supported
- DefaultLogger::get()->error("LWOB: Unsupported legacy texture: " + type);
- }
-
- return tex;
-}
-
-// ------------------------------------------------------------------------------------------------
-void LWOImporter::LoadLWOBSurface(unsigned int size)
-{
- LE_NCONST uint8_t* const end = mFileBuffer + size;
-
- mSurfaces->push_back( LWO::Surface () );
- LWO::Surface& surf = mSurfaces->back();
- LWO::Texture* pTex = NULL;
-
- GetS0(surf.mName,size);
- bool runnning = true;
- while (runnning) {
- if (mFileBuffer + 6 >= end)
- break;
-
- IFF::SubChunkHeader* const head = IFF::LoadSubChunk(mFileBuffer);
-
- /* A single test file (sonycam.lwo) seems to have invalid surface chunks.
- * I'm assuming it's the fault of a single, unknown exporter so there are
- * probably THOUSANDS of them. Here's a dirty workaround:
- *
- * We don't break if the chunk limit is exceeded. Instead, we're computing
- * how much storage is actually left and work with this value from now on.
- */
- if (mFileBuffer + head->length > end) {
- DefaultLogger::get()->error("LWOB: Invalid surface chunk length. Trying to continue.");
- head->length = (uint16_t) (end - mFileBuffer);
- }
-
- uint8_t* const next = mFileBuffer+head->length;
- switch (head->type)
- {
- // diffuse color
- case AI_LWO_COLR:
- {
- AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,COLR,3);
- surf.mColor.r = GetU1() / 255.0f;
- surf.mColor.g = GetU1() / 255.0f;
- surf.mColor.b = GetU1() / 255.0f;
- break;
- }
- // diffuse strength ...
- case AI_LWO_DIFF:
- {
- AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,DIFF,2);
- surf.mDiffuseValue = GetU2() / 255.0f;
- break;
- }
- // specular strength ...
- case AI_LWO_SPEC:
- {
- AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,SPEC,2);
- surf.mSpecularValue = GetU2() / 255.0f;
- break;
- }
- // luminosity ...
- case AI_LWO_LUMI:
- {
- AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,LUMI,2);
- surf.mLuminosity = GetU2() / 255.0f;
- break;
- }
- // transparency
- case AI_LWO_TRAN:
- {
- AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,TRAN,2);
- surf.mTransparency = GetU2() / 255.0f;
- break;
- }
- // surface flags
- case AI_LWO_FLAG:
- {
- AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,FLAG,2);
- uint16_t flag = GetU2();
- if (flag & 0x4 ) surf.mMaximumSmoothAngle = 1.56207f;
- if (flag & 0x8 ) surf.mColorHighlights = 1.f;
- if (flag & 0x100) surf.bDoubleSided = true;
- break;
- }
- // maximum smoothing angle
- case AI_LWO_SMAN:
- {
- AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,SMAN,4);
- surf.mMaximumSmoothAngle = fabs( GetF4() );
- break;
- }
- // glossiness
- case AI_LWO_GLOS:
- {
- AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,GLOS,2);
- surf.mGlossiness = (float)GetU2();
- break;
- }
- // color texture
- case AI_LWO_CTEX:
- {
- pTex = SetupNewTextureLWOB(surf.mColorTextures,
- head->length);
- break;
- }
- // diffuse texture
- case AI_LWO_DTEX:
- {
- pTex = SetupNewTextureLWOB(surf.mDiffuseTextures,
- head->length);
- break;
- }
- // specular texture
- case AI_LWO_STEX:
- {
- pTex = SetupNewTextureLWOB(surf.mSpecularTextures,
- head->length);
- break;
- }
- // bump texture
- case AI_LWO_BTEX:
- {
- pTex = SetupNewTextureLWOB(surf.mBumpTextures,
- head->length);
- break;
- }
- // transparency texture
- case AI_LWO_TTEX:
- {
- pTex = SetupNewTextureLWOB(surf.mOpacityTextures,
- head->length);
- break;
- }
- // texture path
- case AI_LWO_TIMG:
- {
- if (pTex) {
- GetS0(pTex->mFileName,head->length);
- }
- else DefaultLogger::get()->warn("LWOB: Unexpected TIMG chunk");
- break;
- }
- // texture strength
- case AI_LWO_TVAL:
- {
- AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,TVAL,1);
- if (pTex) {
- pTex->mStrength = (float)GetU1()/ 255.f;
- }
- else DefaultLogger::get()->warn("LWOB: Unexpected TVAL chunk");
- break;
- }
- // texture flags
- case AI_LWO_TFLG:
- {
- AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,TFLG,2);
-
- if (pTex)
- {
- const uint16_t s = GetU2();
- if (s & 1)
- pTex->majorAxis = LWO::Texture::AXIS_X;
- else if (s & 2)
- pTex->majorAxis = LWO::Texture::AXIS_Y;
- else if (s & 4)
- pTex->majorAxis = LWO::Texture::AXIS_Z;
-
- if (s & 16)
- DefaultLogger::get()->warn("LWOB: Ignoring \'negate\' flag on texture");
- }
- else DefaultLogger::get()->warn("LWOB: Unexpected TFLG chunk");
- break;
- }
- }
- mFileBuffer = next;
- }
-}
-
-#endif // !! ASSIMP_BUILD_NO_LWO_IMPORTER
diff --git a/3rdparty/assimp/code/LWOFileData.h b/3rdparty/assimp/code/LWOFileData.h
deleted file mode 100644
index fd58c850..00000000
--- a/3rdparty/assimp/code/LWOFileData.h
+++ /dev/null
@@ -1,699 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file LWOFileData.h
- * @brief Defines chunk constants used by the LWO file format
-
-The chunks are taken from the official LightWave SDK headers.
-
-*/
-#ifndef AI_LWO_FILEDATA_INCLUDED
-#define AI_LWO_FILEDATA_INCLUDED
-
-// STL headers
-#include <vector>
-#include <list>
-
-// public ASSIMP headers
-#include "../include/aiMesh.h"
-
-// internal headers
-#include "IFF.h"
-#include "LWOAnimation.h"
-
-namespace Assimp {
-namespace LWO {
-
-#define AI_LWO_FOURCC_LWOB AI_IFF_FOURCC('L','W','O','B')
-#define AI_LWO_FOURCC_LWO2 AI_IFF_FOURCC('L','W','O','2')
-#define AI_LWO_FOURCC_LXOB AI_IFF_FOURCC('L','X','O','B')
-
-// chunks specific to the LWOB format
-#define AI_LWO_SRFS AI_IFF_FOURCC('S','R','F','S')
-#define AI_LWO_FLAG AI_IFF_FOURCC('F','L','A','G')
-#define AI_LWO_VLUM AI_IFF_FOURCC('V','L','U','M')
-#define AI_LWO_VDIF AI_IFF_FOURCC('V','D','I','F')
-#define AI_LWO_VSPC AI_IFF_FOURCC('V','S','P','C')
-#define AI_LWO_RFLT AI_IFF_FOURCC('R','F','L','T')
-#define AI_LWO_BTEX AI_IFF_FOURCC('B','T','E','X')
-#define AI_LWO_CTEX AI_IFF_FOURCC('C','T','E','X')
-#define AI_LWO_DTEX AI_IFF_FOURCC('D','T','E','X')
-#define AI_LWO_LTEX AI_IFF_FOURCC('L','T','E','X')
-#define AI_LWO_RTEX AI_IFF_FOURCC('R','T','E','X')
-#define AI_LWO_STEX AI_IFF_FOURCC('S','T','E','X')
-#define AI_LWO_TTEX AI_IFF_FOURCC('T','T','E','X')
-#define AI_LWO_TFLG AI_IFF_FOURCC('T','F','L','G')
-#define AI_LWO_TSIZ AI_IFF_FOURCC('T','S','I','Z')
-#define AI_LWO_TCTR AI_IFF_FOURCC('T','C','T','R')
-#define AI_LWO_TFAL AI_IFF_FOURCC('T','F','A','L')
-#define AI_LWO_TVEL AI_IFF_FOURCC('T','V','E','L')
-#define AI_LWO_TCLR AI_IFF_FOURCC('T','C','L','R')
-#define AI_LWO_TVAL AI_IFF_FOURCC('T','V','A','L')
-#define AI_LWO_TAMP AI_IFF_FOURCC('T','A','M','P')
-#define AI_LWO_TIMG AI_IFF_FOURCC('T','I','M','G')
-#define AI_LWO_TAAS AI_IFF_FOURCC('T','A','A','S')
-#define AI_LWO_TREF AI_IFF_FOURCC('T','R','E','F')
-#define AI_LWO_TOPC AI_IFF_FOURCC('T','O','P','C')
-#define AI_LWO_SDAT AI_IFF_FOURCC('S','D','A','T')
-#define AI_LWO_TFP0 AI_IFF_FOURCC('T','F','P','0')
-#define AI_LWO_TFP1 AI_IFF_FOURCC('T','F','P','1')
-
-
-/* top-level chunks */
-#define AI_LWO_LAYR AI_IFF_FOURCC('L','A','Y','R')
-#define AI_LWO_TAGS AI_IFF_FOURCC('T','A','G','S')
-#define AI_LWO_PNTS AI_IFF_FOURCC('P','N','T','S')
-#define AI_LWO_BBOX AI_IFF_FOURCC('B','B','O','X')
-#define AI_LWO_VMAP AI_IFF_FOURCC('V','M','A','P')
-#define AI_LWO_VMAD AI_IFF_FOURCC('V','M','A','D')
-#define AI_LWO_POLS AI_IFF_FOURCC('P','O','L','S')
-#define AI_LWO_PTAG AI_IFF_FOURCC('P','T','A','G')
-#define AI_LWO_ENVL AI_IFF_FOURCC('E','N','V','L')
-#define AI_LWO_CLIP AI_IFF_FOURCC('C','L','I','P')
-#define AI_LWO_SURF AI_IFF_FOURCC('S','U','R','F')
-#define AI_LWO_DESC AI_IFF_FOURCC('D','E','S','C')
-#define AI_LWO_TEXT AI_IFF_FOURCC('T','E','X','T')
-#define AI_LWO_ICON AI_IFF_FOURCC('I','C','O','N')
-
-/* polygon types */
-#define AI_LWO_FACE AI_IFF_FOURCC('F','A','C','E')
-#define AI_LWO_CURV AI_IFF_FOURCC('C','U','R','V')
-#define AI_LWO_PTCH AI_IFF_FOURCC('P','T','C','H')
-#define AI_LWO_MBAL AI_IFF_FOURCC('M','B','A','L')
-#define AI_LWO_BONE AI_IFF_FOURCC('B','O','N','E')
-#define AI_LWO_SUBD AI_IFF_FOURCC('S','U','B','D')
-
-/* polygon tags */
-#define AI_LWO_SURF AI_IFF_FOURCC('S','U','R','F')
-#define AI_LWO_PART AI_IFF_FOURCC('P','A','R','T')
-#define AI_LWO_SMGP AI_IFF_FOURCC('S','M','G','P')
-
-/* envelopes */
-#define AI_LWO_PRE AI_IFF_FOURCC('P','R','E',' ')
-#define AI_LWO_POST AI_IFF_FOURCC('P','O','S','T')
-#define AI_LWO_KEY AI_IFF_FOURCC('K','E','Y',' ')
-#define AI_LWO_SPAN AI_IFF_FOURCC('S','P','A','N')
-#define AI_LWO_TCB AI_IFF_FOURCC('T','C','B',' ')
-#define AI_LWO_HERM AI_IFF_FOURCC('H','E','R','M')
-#define AI_LWO_BEZI AI_IFF_FOURCC('B','E','Z','I')
-#define AI_LWO_BEZ2 AI_IFF_FOURCC('B','E','Z','2')
-#define AI_LWO_LINE AI_IFF_FOURCC('L','I','N','E')
-#define AI_LWO_STEP AI_IFF_FOURCC('S','T','E','P')
-
-/* clips */
-#define AI_LWO_STIL AI_IFF_FOURCC('S','T','I','L')
-#define AI_LWO_ISEQ AI_IFF_FOURCC('I','S','E','Q')
-#define AI_LWO_ANIM AI_IFF_FOURCC('A','N','I','M')
-#define AI_LWO_XREF AI_IFF_FOURCC('X','R','E','F')
-#define AI_LWO_STCC AI_IFF_FOURCC('S','T','C','C')
-#define AI_LWO_TIME AI_IFF_FOURCC('T','I','M','E')
-#define AI_LWO_CONT AI_IFF_FOURCC('C','O','N','T')
-#define AI_LWO_BRIT AI_IFF_FOURCC('B','R','I','T')
-#define AI_LWO_SATR AI_IFF_FOURCC('S','A','T','R')
-#define AI_LWO_HUE AI_IFF_FOURCC('H','U','E',' ')
-#define AI_LWO_GAMM AI_IFF_FOURCC('G','A','M','M')
-#define AI_LWO_NEGA AI_IFF_FOURCC('N','E','G','A')
-#define AI_LWO_IFLT AI_IFF_FOURCC('I','F','L','T')
-#define AI_LWO_PFLT AI_IFF_FOURCC('P','F','L','T')
-
-/* surfaces */
-#define AI_LWO_COLR AI_IFF_FOURCC('C','O','L','R')
-#define AI_LWO_LUMI AI_IFF_FOURCC('L','U','M','I')
-#define AI_LWO_DIFF AI_IFF_FOURCC('D','I','F','F')
-#define AI_LWO_SPEC AI_IFF_FOURCC('S','P','E','C')
-#define AI_LWO_GLOS AI_IFF_FOURCC('G','L','O','S')
-#define AI_LWO_REFL AI_IFF_FOURCC('R','E','F','L')
-#define AI_LWO_RFOP AI_IFF_FOURCC('R','F','O','P')
-#define AI_LWO_RIMG AI_IFF_FOURCC('R','I','M','G')
-#define AI_LWO_RSAN AI_IFF_FOURCC('R','S','A','N')
-#define AI_LWO_TRAN AI_IFF_FOURCC('T','R','A','N')
-#define AI_LWO_TROP AI_IFF_FOURCC('T','R','O','P')
-#define AI_LWO_TIMG AI_IFF_FOURCC('T','I','M','G')
-#define AI_LWO_RIND AI_IFF_FOURCC('R','I','N','D')
-#define AI_LWO_TRNL AI_IFF_FOURCC('T','R','N','L')
-#define AI_LWO_BUMP AI_IFF_FOURCC('B','U','M','P')
-#define AI_LWO_SMAN AI_IFF_FOURCC('S','M','A','N')
-#define AI_LWO_SIDE AI_IFF_FOURCC('S','I','D','E')
-#define AI_LWO_CLRH AI_IFF_FOURCC('C','L','R','H')
-#define AI_LWO_CLRF AI_IFF_FOURCC('C','L','R','F')
-#define AI_LWO_ADTR AI_IFF_FOURCC('A','D','T','R')
-#define AI_LWO_SHRP AI_IFF_FOURCC('S','H','R','P')
-#define AI_LWO_LINE AI_IFF_FOURCC('L','I','N','E')
-#define AI_LWO_LSIZ AI_IFF_FOURCC('L','S','I','Z')
-#define AI_LWO_ALPH AI_IFF_FOURCC('A','L','P','H')
-#define AI_LWO_AVAL AI_IFF_FOURCC('A','V','A','L')
-#define AI_LWO_GVAL AI_IFF_FOURCC('G','V','A','L')
-#define AI_LWO_BLOK AI_IFF_FOURCC('B','L','O','K')
-#define AI_LWO_VCOL AI_IFF_FOURCC('V','C','O','L')
-
-/* texture layer */
-#define AI_LWO_TYPE AI_IFF_FOURCC('T','Y','P','E')
-#define AI_LWO_CHAN AI_IFF_FOURCC('C','H','A','N')
-#define AI_LWO_NAME AI_IFF_FOURCC('N','A','M','E')
-#define AI_LWO_ENAB AI_IFF_FOURCC('E','N','A','B')
-#define AI_LWO_OPAC AI_IFF_FOURCC('O','P','A','C')
-#define AI_LWO_FLAG AI_IFF_FOURCC('F','L','A','G')
-#define AI_LWO_PROJ AI_IFF_FOURCC('P','R','O','J')
-#define AI_LWO_STCK AI_IFF_FOURCC('S','T','C','K')
-#define AI_LWO_TAMP AI_IFF_FOURCC('T','A','M','P')
-
-/* texture coordinates */
-#define AI_LWO_TMAP AI_IFF_FOURCC('T','M','A','P')
-#define AI_LWO_AXIS AI_IFF_FOURCC('A','X','I','S')
-#define AI_LWO_CNTR AI_IFF_FOURCC('C','N','T','R')
-#define AI_LWO_SIZE AI_IFF_FOURCC('S','I','Z','E')
-#define AI_LWO_ROTA AI_IFF_FOURCC('R','O','T','A')
-#define AI_LWO_OREF AI_IFF_FOURCC('O','R','E','F')
-#define AI_LWO_FALL AI_IFF_FOURCC('F','A','L','L')
-#define AI_LWO_CSYS AI_IFF_FOURCC('C','S','Y','S')
-
-/* image map */
-#define AI_LWO_IMAP AI_IFF_FOURCC('I','M','A','P')
-#define AI_LWO_IMAG AI_IFF_FOURCC('I','M','A','G')
-#define AI_LWO_WRAP AI_IFF_FOURCC('W','R','A','P')
-#define AI_LWO_WRPW AI_IFF_FOURCC('W','R','P','W')
-#define AI_LWO_WRPH AI_IFF_FOURCC('W','R','P','H')
-#define AI_LWO_VMAP AI_IFF_FOURCC('V','M','A','P')
-#define AI_LWO_AAST AI_IFF_FOURCC('A','A','S','T')
-#define AI_LWO_PIXB AI_IFF_FOURCC('P','I','X','B')
-
-/* procedural */
-#define AI_LWO_PROC AI_IFF_FOURCC('P','R','O','C')
-#define AI_LWO_COLR AI_IFF_FOURCC('C','O','L','R')
-#define AI_LWO_VALU AI_IFF_FOURCC('V','A','L','U')
-#define AI_LWO_FUNC AI_IFF_FOURCC('F','U','N','C')
-#define AI_LWO_FTPS AI_IFF_FOURCC('F','T','P','S')
-#define AI_LWO_ITPS AI_IFF_FOURCC('I','T','P','S')
-#define AI_LWO_ETPS AI_IFF_FOURCC('E','T','P','S')
-
-/* gradient */
-#define AI_LWO_GRAD AI_IFF_FOURCC('G','R','A','D')
-#define AI_LWO_GRST AI_IFF_FOURCC('G','R','S','T')
-#define AI_LWO_GREN AI_IFF_FOURCC('G','R','E','N')
-#define AI_LWO_PNAM AI_IFF_FOURCC('P','N','A','M')
-#define AI_LWO_INAM AI_IFF_FOURCC('I','N','A','M')
-#define AI_LWO_GRPT AI_IFF_FOURCC('G','R','P','T')
-#define AI_LWO_FKEY AI_IFF_FOURCC('F','K','E','Y')
-#define AI_LWO_IKEY AI_IFF_FOURCC('I','K','E','Y')
-
-/* shader */
-#define AI_LWO_SHDR AI_IFF_FOURCC('S','H','D','R')
-#define AI_LWO_DATA AI_IFF_FOURCC('D','A','T','A')
-
-
-/* VMAP types */
-#define AI_LWO_TXUV AI_IFF_FOURCC('T','X','U','V')
-#define AI_LWO_RGB AI_IFF_FOURCC('R','G','B',' ')
-#define AI_LWO_RGBA AI_IFF_FOURCC('R','G','B','A')
-#define AI_LWO_WGHT AI_IFF_FOURCC('W','G','H','T')
-
-#define AI_LWO_MNVW AI_IFF_FOURCC('M','N','V','W')
-#define AI_LWO_MORF AI_IFF_FOURCC('M','O','R','F')
-#define AI_LWO_SPOT AI_IFF_FOURCC('S','P','O','T')
-#define AI_LWO_PICK AI_IFF_FOURCC('P','I','C','K')
-
-// MODO extension - per-vertex normal vectors
-#define AI_LWO_MODO_NORM AI_IFF_FOURCC('N', 'O', 'R', 'M')
-
-
-// ---------------------------------------------------------------------------
-/** \brief Data structure for a face in a LWO file
- *
- * \note We can't use the code in SmoothingGroups.inl here - the mesh
- * structures of 3DS/ASE and LWO are too different.
- */
-struct Face : public aiFace
-{
- //! Default construction
- Face()
- : surfaceIndex (0)
- , smoothGroup (0)
- , type (AI_LWO_FACE)
- {}
-
- //! Construction from given type
- Face(uint32_t _type)
- : surfaceIndex (0)
- , smoothGroup (0)
- , type (_type)
- {}
-
- //! Copy construction
- Face(const Face& f) {
- *this = f;
- }
-
- //! Zero-based index into tags chunk
- unsigned int surfaceIndex;
-
- //! Smooth group this face is assigned to
- unsigned int smoothGroup;
-
- //! Type of face
- uint32_t type;
-
-
- //! Assignment operator
- Face& operator=(const LWO::Face& f) {
- aiFace::operator =(f);
- surfaceIndex = f.surfaceIndex;
- smoothGroup = f.smoothGroup;
- type = f.type;
- return *this;
- }
-};
-
-// ---------------------------------------------------------------------------
-/** \brief Base structure for all vertex map representations
- */
-struct VMapEntry
-{
- VMapEntry(unsigned int _dims)
- : dims(_dims)
- {}
-
- virtual ~VMapEntry() {}
-
- //! allocates memory for the vertex map
- virtual void Allocate(unsigned int num)
- {
- if (!rawData.empty())
- return; // return if already allocated
-
- const unsigned int m = num*dims;
- rawData.reserve(m + (m>>2u)); // 25% as extra storage for VMADs
- rawData.resize(m,0.f);
- abAssigned.resize(num,false);
- }
-
- std::string name;
- unsigned int dims;
-
- std::vector<float> rawData;
- std::vector<bool> abAssigned;
-};
-
-// ---------------------------------------------------------------------------
-/** \brief Represents an extra vertex color channel
- */
-struct VColorChannel : public VMapEntry
-{
- VColorChannel()
- : VMapEntry(4)
- {}
-
- //! need to overwrite this function - the alpha channel must
- //! be initialized to 1.0 by default
- virtual void Allocate(unsigned int num)
- {
- if (!rawData.empty())
- return; // return if already allocated
-
- register unsigned int m = num*dims;
- rawData.reserve(m + (m>>2u)); // 25% as extra storage for VMADs
- rawData.resize(m);
-
- for (aiColor4D* p = (aiColor4D*)&rawData[0]; p < (aiColor4D*)&rawData[m-1]; ++p)
- p->a = 1.f;
-
- abAssigned.resize(num,false);
- }
-};
-
-// ---------------------------------------------------------------------------
-/** \brief Represents an extra vertex UV channel
- */
-struct UVChannel : public VMapEntry
-{
- UVChannel()
- : VMapEntry(2)
- {}
-};
-
-// ---------------------------------------------------------------------------
-/** \brief Represents a weight map
- */
-struct WeightChannel : public VMapEntry
-{
- WeightChannel()
- : VMapEntry(1)
- {}
-};
-
-// ---------------------------------------------------------------------------
-/** \brief Represents a vertex-normals channel (MODO extension)
- */
-struct NormalChannel : public VMapEntry
-{
- NormalChannel()
- : VMapEntry(3)
- {}
-};
-
-// ---------------------------------------------------------------------------
-/** \brief Data structure for a LWO file texture
- */
-struct Texture
-{
- // we write the enum values out here to make debugging easier ...
- enum BlendType
- {
- Normal = 0,
- Subtractive = 1,
- Difference = 2,
- Multiply = 3,
- Divide = 4,
- Alpha = 5,
- TextureDispl = 6,
- Additive = 7
- };
-
- enum MappingMode
- {
- Planar = 0,
- Cylindrical = 1,
- Spherical = 2,
- Cubic = 3,
- FrontProjection = 4,
- UV = 5
- };
-
- enum Axes
- {
- AXIS_X = 0,
- AXIS_Y = 1,
- AXIS_Z = 2
- };
-
- enum Wrap
- {
- RESET = 0,
- REPEAT = 1,
- MIRROR = 2,
- EDGE = 3
- };
-
- Texture()
- : mClipIdx(0xffffffff)
- , mStrength (1.0f)
- , mUVChannelIndex ("unknown")
- , mRealUVIndex (0xffffffff)
- , enabled (true)
- , blendType (Additive)
- , bCanUse (true)
- , mapMode (UV)
- , majorAxis (AXIS_X)
- , wrapAmountH (1.0f)
- , wrapAmountW (1.0f)
- , wrapModeWidth (REPEAT)
- , wrapModeHeight (REPEAT)
- , ordinal ("\x00")
- {}
-
- //! File name of the texture
- std::string mFileName;
-
- //! Clip index
- unsigned int mClipIdx;
-
- //! Strength of the texture - blend factor
- float mStrength;
-
- uint32_t type; // type of the texture
-
- //! Name of the corresponding UV channel
- std::string mUVChannelIndex;
- unsigned int mRealUVIndex;
-
- //! is the texture enabled?
- bool enabled;
-
- //! blend type
- BlendType blendType;
-
- //! are we able to use the texture?
- bool bCanUse;
-
- //! mapping mode
- MappingMode mapMode;
-
- //! major axis for planar, cylindrical, spherical projections
- Axes majorAxis;
-
- //! wrap amount for cylindrical and spherical projections
- float wrapAmountH,wrapAmountW;
-
- //! wrapping mode for the texture
- Wrap wrapModeWidth,wrapModeHeight;
-
- //! ordinal string of the texture
- std::string ordinal;
-};
-
-// ---------------------------------------------------------------------------
-/** \brief Data structure for a LWO file clip
- */
-struct Clip
-{
- enum Type
- {
- STILL, SEQ, REF, UNSUPPORTED
- } type;
-
- Clip()
- : type (UNSUPPORTED)
- , idx (0)
- , negate (false)
- {}
-
- //! path to the base texture -
- std::string path;
-
- //! reference to another CLIP
- unsigned int clipRef;
-
- //! index of the clip
- unsigned int idx;
-
- //! Negate the clip?
- bool negate;
-};
-
-
-// ---------------------------------------------------------------------------
-/** \brief Data structure for a LWO file shader
- *
- * Later
- */
-struct Shader
-{
- Shader()
- : ordinal ("\x00")
- , functionName ("unknown")
- , enabled (true)
- {}
-
- std::string ordinal;
- std::string functionName;
- bool enabled;
-};
-
-typedef std::list < Texture > TextureList;
-typedef std::list < Shader > ShaderList;
-
-// ---------------------------------------------------------------------------
-/** \brief Data structure for a LWO file surface (= material)
- */
-struct Surface
-{
- Surface()
- : mColor (0.78431f,0.78431f,0.78431f)
- , bDoubleSided (false)
- , mDiffuseValue (1.f)
- , mSpecularValue (0.f)
- , mTransparency (0.f)
- , mGlossiness (0.4f)
- , mLuminosity (0.f)
- , mColorHighlights (0.f)
- , mMaximumSmoothAngle (0.f) // 0 == not specified, no smoothing
- , mVCMap ("")
- , mVCMapType (AI_LWO_RGBA)
- , mIOR (1.f) // vakuum
- , mBumpIntensity (1.f)
- , mWireframe (false)
- , mAdditiveTransparency (0.f)
- {}
-
- //! Name of the surface
- std::string mName;
-
- //! Color of the surface
- aiColor3D mColor;
-
- //! true for two-sided materials
- bool bDoubleSided;
-
- //! Various material parameters
- float mDiffuseValue,mSpecularValue,mTransparency,mGlossiness,mLuminosity,mColorHighlights;
-
- //! Maximum angle between two adjacent triangles
- //! that they can be smoothed - in degrees
- float mMaximumSmoothAngle;
-
- //! Vertex color map to be used to color the surface
- std::string mVCMap;
- uint32_t mVCMapType;
-
- //! Names of the special shaders to be applied to the surface
- ShaderList mShaders;
-
- //! Textures - the first entry in the list is evaluated first
- TextureList mColorTextures, // color textures are added to both diffuse and specular texture stacks
- mDiffuseTextures,
- mSpecularTextures,
- mOpacityTextures,
- mBumpTextures,
- mGlossinessTextures,
- mReflectionTextures;
-
- //! Index of refraction
- float mIOR;
-
- //! Bump intensity scaling
- float mBumpIntensity;
-
- //! Wireframe flag
- bool mWireframe;
-
- //! Intensity of additive blending
- float mAdditiveTransparency;
-};
-
-// ---------------------------------------------------------------------------
-#define AI_LWO_VALIDATE_CHUNK_LENGTH(length,name,size) \
- if (length < size) \
- { \
- throw DeadlyImportError("LWO: "#name" chunk is too small"); \
- } \
-
-
-// some typedefs ... to make life with loader monsters like this easier
-typedef std::vector < aiVector3D > PointList;
-typedef std::vector < LWO::Face > FaceList;
-typedef std::vector < LWO::Surface > SurfaceList;
-typedef std::vector < std::string > TagList;
-typedef std::vector < unsigned int > TagMappingTable;
-typedef std::vector < unsigned int > ReferrerList;
-typedef std::vector < WeightChannel > WeightChannelList;
-typedef std::vector < VColorChannel > VColorChannelList;
-typedef std::vector < UVChannel > UVChannelList;
-typedef std::vector < Clip > ClipList;
-typedef std::vector < Envelope > EnvelopeList;
-typedef std::vector < unsigned int > SortedRep;
-
-// ---------------------------------------------------------------------------
-/** \brief Represents a layer in the file
- */
-struct Layer
-{
- Layer()
- : mFaceIDXOfs (0)
- , mPointIDXOfs (0)
- , mParent (0x0)
- , mIndex (0xffff)
- , skip (false)
- {}
-
- /** Temporary point list from the file */
- PointList mTempPoints;
-
- /** Lists for every point the index of another point
- that has been copied from *this* point or 0xffffffff if
- no copy of the point has been made */
- ReferrerList mPointReferrers;
-
- /** Weight channel list from the file */
- WeightChannelList mWeightChannels;
-
- /** Subdivision weight channel list from the file */
- WeightChannelList mSWeightChannels;
-
- /** Vertex color list from the file */
- VColorChannelList mVColorChannels;
-
- /** UV channel list from the file */
- UVChannelList mUVChannels;
-
- /** Normal vector channel from the file */
- NormalChannel mNormals;
-
- /** Temporary face list from the file*/
- FaceList mFaces;
-
- /** Current face indexing offset from the beginning of the buffers*/
- unsigned int mFaceIDXOfs;
-
- /** Current point indexing offset from the beginning of the buffers*/
- unsigned int mPointIDXOfs;
-
- /** Parent index */
- uint16_t mParent;
-
- /** Index of the layer */
- uint16_t mIndex;
-
- /** Name of the layer */
- std::string mName;
-
- /** Pivot point of the layer */
- aiVector3D mPivot;
-
- /** Skip this layer? */
- bool skip;
-};
-
-typedef std::list<LWO::Layer> LayerList;
-
-
-}}
-
-
-#endif // !! AI_LWO_FILEDATA_INCLUDED
-
diff --git a/3rdparty/assimp/code/LWOLoader.cpp b/3rdparty/assimp/code/LWOLoader.cpp
deleted file mode 100644
index 33c84960..00000000
--- a/3rdparty/assimp/code/LWOLoader.cpp
+++ /dev/null
@@ -1,1403 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file LWOLoader.cpp
- * @brief Implementation of the LWO importer class
- */
-
-#include "AssimpPCH.h"
-#ifndef ASSIMP_BUILD_NO_LWO_IMPORTER
-
-// internal headers
-#include "LWOLoader.h"
-#include "MaterialSystem.h"
-#include "StringComparison.h"
-#include "SGSpatialSort.h"
-#include "ByteSwap.h"
-#include "ProcessHelper.h"
-#include "ConvertToLHProcess.h"
-
-using namespace Assimp;
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-LWOImporter::LWOImporter()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-LWOImporter::~LWOImporter()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the class can handle the format of the given file.
-bool LWOImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const
-{
- const std::string extension = GetExtension(pFile);
- if (extension == "lwo" || extension == "lxo")
- return true;
-
- // if check for extension is not enough, check for the magic tokens
- if (!extension.length() || checkSig) {
- uint32_t tokens[3];
- tokens[0] = AI_LWO_FOURCC_LWOB;
- tokens[1] = AI_LWO_FOURCC_LWO2;
- tokens[2] = AI_LWO_FOURCC_LXOB;
- return CheckMagicToken(pIOHandler,pFile,tokens,3,8);
- }
- return false;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Setup configuration properties
-void LWOImporter::SetupProperties(const Importer* pImp)
-{
- configSpeedFlag = ( 0 != pImp->GetPropertyInteger(AI_CONFIG_FAVOUR_SPEED,0) ? true : false);
- configLayerIndex = pImp->GetPropertyInteger (AI_CONFIG_IMPORT_LWO_ONE_LAYER_ONLY,0xffffffff);
- configLayerName = pImp->GetPropertyString (AI_CONFIG_IMPORT_LWO_ONE_LAYER_ONLY,"");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Imports the given file into the given scene structure.
-void LWOImporter::InternReadFile( const std::string& pFile,
- aiScene* pScene,
- IOSystem* pIOHandler)
-{
- boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
-
- // Check whether we can read from the file
- if ( file.get() == NULL)
- throw DeadlyImportError( "Failed to open LWO file " + pFile + ".");
-
- if ((this->fileSize = (unsigned int)file->FileSize()) < 12)
- throw DeadlyImportError("LWO: The file is too small to contain the IFF header");
-
- // Allocate storage and copy the contents of the file to a memory buffer
- std::vector< uint8_t > mBuffer(fileSize);
- file->Read( &mBuffer[0], 1, fileSize);
- this->pScene = pScene;
-
- // Determine the type of the file
- uint32_t fileType;
- const char* sz = IFF::ReadHeader(&mBuffer[0],fileType);
- if (sz)throw DeadlyImportError(sz);
-
- mFileBuffer = &mBuffer[0] + 12;
- fileSize -= 12;
-
- // Initialize some members with their default values
- hasNamedLayer = false;
-
- // Create temporary storage on the stack but store pointers to it in the class
- // instance. Therefore everything will be destructed properly if an exception
- // is thrown and we needn't take care of that.
- LayerList _mLayers;
- SurfaceList _mSurfaces;
- TagList _mTags;
- TagMappingTable _mMapping;
-
- mLayers = &_mLayers;
- mTags = &_mTags;
- mMapping = &_mMapping;
- mSurfaces = &_mSurfaces;
-
- // Allocate a default layer (layer indices are 1-based from now)
- mLayers->push_back(Layer());
- mCurLayer = &mLayers->back();
- mCurLayer->mName = "<LWODefault>";
-
- // old lightwave file format (prior to v6)
- if (AI_LWO_FOURCC_LWOB == fileType) {
- DefaultLogger::get()->info("LWO file format: LWOB (<= LightWave 5.5)");
-
- mIsLWO2 = false;
- mIsLXOB = false;
- LoadLWOBFile();
- }
- // New lightwave format
- else if (AI_LWO_FOURCC_LWO2 == fileType) {
- mIsLXOB = false;
- DefaultLogger::get()->info("LWO file format: LWO2 (>= LightWave 6)");
- }
- // MODO file format
- else if (AI_LWO_FOURCC_LXOB == fileType) {
- mIsLXOB = true;
- DefaultLogger::get()->info("LWO file format: LXOB (Modo)");
- }
- // we don't know this format
- else
- {
- char szBuff[5];
- szBuff[0] = (char)(fileType >> 24u);
- szBuff[1] = (char)(fileType >> 16u);
- szBuff[2] = (char)(fileType >> 8u);
- szBuff[3] = (char)(fileType);
- szBuff[4] = '\0';
- throw DeadlyImportError(std::string("Unknown LWO sub format: ") + szBuff);
- }
-
- if (AI_LWO_FOURCC_LWOB != fileType) {
- mIsLWO2 = true;
- LoadLWO2File();
-
- // The newer lightwave format allows the user to configure the
- // loader that just one layer is used. If this is the case
- // we need to check now whether the requested layer has been found.
- if (0xffffffff != configLayerIndex && configLayerIndex > mLayers->size())
- throw DeadlyImportError("LWO2: The requested layer was not found");
-
- if (configLayerName.length() && !hasNamedLayer) {
- throw DeadlyImportError("LWO2: Unable to find the requested layer: "
- + configLayerName);
- }
- }
-
- // now, as we have loaded all data, we can resolve cross-referenced tags and clips
- ResolveTags();
- ResolveClips();
-
- // now process all layers and build meshes and nodes
- std::vector<aiMesh*> apcMeshes;
- std::vector<aiNode*> apcNodes;
- apcNodes. reserve(mLayers->size());
- apcMeshes.reserve(mLayers->size()*std::min(((unsigned int)mSurfaces->size()/2u), 1u));
-
- unsigned int iDefaultSurface = 0xffffffff; // index of the default surface
- for (LayerList::iterator lit = mLayers->begin(), lend = mLayers->end();lit != lend;++lit) {
- LWO::Layer& layer = *lit;
- if (layer.skip)
- continue;
-
- // I don't know whether there could be dummy layers, but it would be possible
- const unsigned int meshStart = (unsigned int)apcMeshes.size();
- if (!layer.mFaces.empty() && !layer.mTempPoints.empty()) {
-
- // now sort all faces by the surfaces assigned to them
- std::vector<SortedRep> pSorted(mSurfaces->size()+1);
-
- unsigned int i = 0;
- for (FaceList::iterator it = layer.mFaces.begin(), end = layer.mFaces.end();it != end;++it,++i) {
- // Check whether we support this face's type
- if ((*it).type != AI_LWO_FACE && (*it).type != AI_LWO_PTCH &&
- (*it).type != AI_LWO_BONE && (*it).type != AI_LWO_SUBD) {
- continue;
- }
-
- unsigned int idx = (*it).surfaceIndex;
- if (idx >= mTags->size())
- {
- DefaultLogger::get()->warn("LWO: Invalid face surface index");
- idx = 0xffffffff;
- }
- if (0xffffffff == idx || 0xffffffff == (idx = _mMapping[idx])) {
- if (0xffffffff == iDefaultSurface) {
- iDefaultSurface = (unsigned int)mSurfaces->size();
- mSurfaces->push_back(LWO::Surface());
- LWO::Surface& surf = mSurfaces->back();
- surf.mColor.r = surf.mColor.g = surf.mColor.b = 0.6f;
- surf.mName = "LWODefaultSurface";
- }
- idx = iDefaultSurface;
- }
- pSorted[idx].push_back(i);
- }
- if (0xffffffff == iDefaultSurface) {
- pSorted.erase(pSorted.end()-1);
- }
- for (unsigned int p = 0,i = 0;i < mSurfaces->size();++i) {
- SortedRep& sorted = pSorted[i];
- if (sorted.empty())
- continue;
-
- // generate the mesh
- aiMesh* mesh = new aiMesh();
- apcMeshes.push_back(mesh);
- mesh->mNumFaces = (unsigned int)sorted.size();
-
- // count the number of vertices
- SortedRep::const_iterator it = sorted.begin(), end = sorted.end();
- for (;it != end;++it) {
- mesh->mNumVertices += layer.mFaces[*it].mNumIndices;
- }
-
- aiVector3D *nrm = NULL, * pv = mesh->mVertices = new aiVector3D[mesh->mNumVertices];
- aiFace* pf = mesh->mFaces = new aiFace[mesh->mNumFaces];
- mesh->mMaterialIndex = i;
-
- // find out which vertex color channels and which texture coordinate
- // channels are really required by the material attached to this mesh
- unsigned int vUVChannelIndices[AI_MAX_NUMBER_OF_TEXTURECOORDS];
- unsigned int vVColorIndices[AI_MAX_NUMBER_OF_COLOR_SETS];
-
-#if _DEBUG
- for (unsigned int mui = 0; mui < AI_MAX_NUMBER_OF_TEXTURECOORDS;++mui )
- vUVChannelIndices[mui] = 0xffffffff;
- for (unsigned int mui = 0; mui < AI_MAX_NUMBER_OF_COLOR_SETS;++mui )
- vVColorIndices[mui] = 0xffffffff;
-#endif
-
- FindUVChannels(_mSurfaces[i],sorted,layer,vUVChannelIndices);
- FindVCChannels(_mSurfaces[i],sorted,layer,vVColorIndices);
-
- // allocate storage for UV and CV channels
- aiVector3D* pvUV[AI_MAX_NUMBER_OF_TEXTURECOORDS];
- for (unsigned int mui = 0; mui < AI_MAX_NUMBER_OF_TEXTURECOORDS;++mui ) {
- if (0xffffffff == vUVChannelIndices[mui])
- break;
-
- pvUV[mui] = mesh->mTextureCoords[mui] = new aiVector3D[mesh->mNumVertices];
-
- // LightWave doesn't support more than 2 UV components (?)
- mesh->mNumUVComponents[0] = 2;
- }
-
- if (layer.mNormals.name.length())
- nrm = mesh->mNormals = new aiVector3D[mesh->mNumVertices];
-
- aiColor4D* pvVC[AI_MAX_NUMBER_OF_COLOR_SETS];
- for (unsigned int mui = 0; mui < AI_MAX_NUMBER_OF_COLOR_SETS;++mui) {
- if (0xffffffff == vVColorIndices[mui])break;
- pvVC[mui] = mesh->mColors[mui] = new aiColor4D[mesh->mNumVertices];
- }
-
- // we would not need this extra array, but the code is much cleaner if we use it
- std::vector<unsigned int>& smoothingGroups = layer.mPointReferrers;
- smoothingGroups.erase (smoothingGroups.begin(),smoothingGroups.end());
- smoothingGroups.resize(mesh->mNumFaces,0);
-
- // now convert all faces
- unsigned int vert = 0;
- std::vector<unsigned int>::iterator outIt = smoothingGroups.begin();
- for (it = sorted.begin(); it != end;++it,++outIt) {
- const LWO::Face& face = layer.mFaces[*it];
- *outIt = face.smoothGroup;
-
- // copy all vertices
- for (unsigned int q = 0; q < face.mNumIndices;++q,++vert) {
- register unsigned int idx = face.mIndices[q];
- *pv++ = layer.mTempPoints[idx] /*- layer.mPivot*/;
-
- // process UV coordinates
- for (unsigned int w = 0; w < AI_MAX_NUMBER_OF_TEXTURECOORDS;++w) {
- if (0xffffffff == vUVChannelIndices[w])
- break;
- aiVector3D*& pp = pvUV[w];
- const aiVector2D& src = ((aiVector2D*)&layer.mUVChannels[vUVChannelIndices[w]].rawData[0])[idx];
- pp->x = src.x;
- pp->y = src.y;
- pp++;
- }
-
- // process normals (MODO extension)
- if (nrm) {
- *nrm = ((aiVector3D*)&layer.mNormals.rawData[0])[idx];
- nrm->z *= -1.f;
- ++nrm;
- }
-
- // process vertex colors
- for (unsigned int w = 0; w < AI_MAX_NUMBER_OF_COLOR_SETS;++w) {
- if (0xffffffff == vVColorIndices[w])
- break;
- *pvVC[w] = ((aiColor4D*)&layer.mVColorChannels[vVColorIndices[w]].rawData[0])[idx];
-
- // If a RGB color map is explicitly requested delete the
- // alpha channel - it could theoretically be != 1.
- if (_mSurfaces[i].mVCMapType == AI_LWO_RGB)
- pvVC[w]->a = 1.f;
-
- pvVC[w]++;
- }
-
-#if 0
- // process vertex weights. We can't properly reconstruct the whole skeleton for now,
- // but we can create dummy bones for all weight channels which we have.
- for (unsigned int w = 0; w < layer.mWeightChannels.size();++w)
- {
- }
-#endif
-
- face.mIndices[q] = vert;
- }
- pf->mIndices = face.mIndices;
- pf->mNumIndices = face.mNumIndices;
- unsigned int** p = (unsigned int**)&face.mIndices;*p = NULL; // HACK: make sure it won't be deleted
- pf++;
- }
-
- if (!mesh->mNormals) {
- // Compute normal vectors for the mesh - we can't use our GenSmoothNormal-
- // Step here since it wouldn't handle smoothing groups correctly for LWO.
- // So we use a separate implementation.
- ComputeNormals(mesh,smoothingGroups,_mSurfaces[i]);
- }
- else DefaultLogger::get()->debug("LWO2: No need to compute normals, they're already there");
- ++p;
- }
- }
-
- // Generate nodes to render the mesh. Store the source layer in the mParent member of the nodes
- unsigned int num = apcMeshes.size() - meshStart;
- if (layer.mName != "<LWODefault>" || num > 0) {
- aiNode* pcNode = new aiNode();
- apcNodes.push_back(pcNode);
- pcNode->mName.Set(layer.mName);
- pcNode->mParent = (aiNode*)&layer;
- pcNode->mNumMeshes = num;
-
- if (pcNode->mNumMeshes) {
- pcNode->mMeshes = new unsigned int[pcNode->mNumMeshes];
- for (unsigned int p = 0; p < pcNode->mNumMeshes;++p)
- pcNode->mMeshes[p] = p + meshStart;
- }
- }
- }
-
- if (apcNodes.empty() || apcMeshes.empty())
- throw DeadlyImportError("LWO: No meshes loaded");
-
- // The RemoveRedundantMaterials step will clean this up later
- pScene->mMaterials = new aiMaterial*[pScene->mNumMaterials = (unsigned int)mSurfaces->size()];
- for (unsigned int mat = 0; mat < pScene->mNumMaterials;++mat) {
- MaterialHelper* pcMat = new MaterialHelper();
- pScene->mMaterials[mat] = pcMat;
- ConvertMaterial((*mSurfaces)[mat],pcMat);
- }
-
- // copy the meshes to the output structure
- pScene->mMeshes = new aiMesh*[ pScene->mNumMeshes = (unsigned int)apcMeshes.size() ];
- ::memcpy(pScene->mMeshes,&apcMeshes[0],pScene->mNumMeshes*sizeof(void*));
-
- // generate the final node graph
- GenerateNodeGraph(apcNodes);
-}
-
-// ------------------------------------------------------------------------------------------------
-void LWOImporter::ComputeNormals(aiMesh* mesh, const std::vector<unsigned int>& smoothingGroups,
- const LWO::Surface& surface)
-{
- // Allocate output storage
- mesh->mNormals = new aiVector3D[mesh->mNumVertices];
-
- // First generate per-face normals
- aiVector3D* out;
- std::vector<aiVector3D> faceNormals;
-
- // ... in some cases that's already enough
- if (!surface.mMaximumSmoothAngle)
- out = mesh->mNormals;
- else {
- faceNormals.resize(mesh->mNumVertices);
- out = &faceNormals[0];
- }
-
- aiFace* begin = mesh->mFaces, *const end = mesh->mFaces+mesh->mNumFaces;
- for (; begin != end; ++begin) {
- aiFace& face = *begin;
-
- // LWO doc: "the normal is defined as the cross product of the first and last edges"
- aiVector3D* pV1 = mesh->mVertices + face.mIndices[0];
- aiVector3D* pV2 = mesh->mVertices + face.mIndices[1];
- aiVector3D* pV3 = mesh->mVertices + face.mIndices[face.mNumIndices-1];
-
- aiVector3D vNor = ((*pV2 - *pV1) ^(*pV3 - *pV1)).Normalize();
- for (unsigned int i = 0; i < face.mNumIndices;++i)
- out[face.mIndices[i]] = vNor;
- }
- if (!surface.mMaximumSmoothAngle)return;
- const float posEpsilon = ComputePositionEpsilon(mesh);
-
- // Now generate the spatial sort tree
- SGSpatialSort sSort;
- std::vector<unsigned int>::const_iterator it = smoothingGroups.begin();
- for ( begin = mesh->mFaces; begin != end; ++begin, ++it)
- {
- aiFace& face = *begin;
- for (unsigned int i = 0; i < face.mNumIndices;++i)
- {
- register unsigned int tt = face.mIndices[i];
- sSort.Add(mesh->mVertices[tt],tt,*it);
- }
- }
- // Sort everything - this takes O(nlogn) time
- sSort.Prepare();
- std::vector<unsigned int> poResult;
- poResult.reserve(20);
-
- // Generate vertex normals. We have O(logn) for the binary lookup, which we need
- // for n elements, thus the EXPECTED complexity is O(nlogn)
- if (surface.mMaximumSmoothAngle < 3.f && !configSpeedFlag) {
- const float fLimit = cos(surface.mMaximumSmoothAngle);
-
- for ( begin = mesh->mFaces, it = smoothingGroups.begin(); begin != end; ++begin, ++it) {
- const aiFace& face = *begin;
- unsigned int* beginIdx = face.mIndices, *const endIdx = face.mIndices+face.mNumIndices;
- for (; beginIdx != endIdx; ++beginIdx)
- {
- register unsigned int idx = *beginIdx;
- sSort.FindPositions(mesh->mVertices[idx],*it,posEpsilon,poResult,true);
- std::vector<unsigned int>::const_iterator a, end = poResult.end();
-
- aiVector3D vNormals;
- for (a = poResult.begin();a != end;++a) {
- const aiVector3D& v = faceNormals[*a];
- if (v * faceNormals[idx] < fLimit)
- continue;
- vNormals += v;
- }
- mesh->mNormals[idx] = vNormals.Normalize();
- }
- }
- }
- // faster code path in case there is no smooth angle
- else {
- std::vector<bool> vertexDone(mesh->mNumVertices,false);
- for ( begin = mesh->mFaces, it = smoothingGroups.begin(); begin != end; ++begin, ++it) {
- const aiFace& face = *begin;
- unsigned int* beginIdx = face.mIndices, *const endIdx = face.mIndices+face.mNumIndices;
- for (; beginIdx != endIdx; ++beginIdx)
- {
- register unsigned int idx = *beginIdx;
- if (vertexDone[idx])
- continue;
- sSort.FindPositions(mesh->mVertices[idx],*it,posEpsilon,poResult,true);
- std::vector<unsigned int>::const_iterator a, end = poResult.end();
-
- aiVector3D vNormals;
- for (a = poResult.begin();a != end;++a) {
- const aiVector3D& v = faceNormals[*a];
- vNormals += v;
- }
- vNormals.Normalize();
- for (a = poResult.begin();a != end;++a) {
- mesh->mNormals[*a] = vNormals;
- vertexDone[*a] = true;
- }
- }
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void LWOImporter::AddChildren(aiNode* node, uint16_t parent, std::vector<aiNode*>& apcNodes)
-{
- for (std::vector<aiNode*>::iterator it = apcNodes.begin(); it != apcNodes.end(); ++it) {
- if (*it) {
- LWO::Layer* layer = (LWO::Layer*)(*it)->mParent;
- if (layer->mParent == parent && layer->mIndex != parent)
- ++node->mNumChildren;
- }
- }
-
- if (node->mNumChildren) {
- unsigned int p = 0;
-
- node->mChildren = new aiNode* [ node->mNumChildren ];
- for (std::vector<aiNode*>::iterator it = apcNodes.begin(); it != apcNodes.end(); ++it) {
- if (*it) {
- LWO::Layer* layer = (LWO::Layer*)(*it)->mParent;
- if (layer->mParent == parent && layer->mIndex != parent) {
- aiNode* nd = node->mChildren[p++] = *it;
- nd->mParent = node;
-
- // fixme: ignore pivot points for the moment
- //nd->mTransformation.a4 = layer->mPivot.x;
- //nd->mTransformation.b4 = layer->mPivot.y;
- //nd->mTransformation.c4 = layer->mPivot.z;
-
- // recursively add more children
- (*it) = NULL;
- AddChildren(nd,layer->mIndex,apcNodes);
- }
- }
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void LWOImporter::GenerateNodeGraph(std::vector<aiNode*>& apcNodes)
-{
- // now generate the final nodegraph - generate a root node and attach children
- aiNode* root = pScene->mRootNode = new aiNode();
- root->mName.Set("<LWORoot>");
- AddChildren(root,0,apcNodes);
-
- // check whether we added all layers with meshes assigned to the output graph.
- // if not, add them to the root node
- unsigned int extra = 0;
- for (std::vector<aiNode*>::iterator it = apcNodes.begin(); it != apcNodes.end(); ++it) {
- if ((*it) && (*it)->mNumMeshes)
- ++extra;
- }
-
- if (extra) {
- const unsigned int newSize = extra + pScene->mRootNode->mNumChildren;
- aiNode** const apcNewNodes = new aiNode*[newSize];
- if ((extra = root->mNumChildren))
- ::memcpy(apcNewNodes,root->mChildren,extra*sizeof(void*));
-
- aiNode** cc = apcNewNodes+extra;
- for (std::vector<aiNode*>::iterator it = apcNodes.begin(); it != apcNodes.end(); ++it) {
- if ((*it) && (*it)->mNumMeshes) {
- aiNode* nd = *cc++ = *it;
- nd->mParent = pScene->mRootNode;
-
- // recursively add more children
- (*it) = NULL;
- AddChildren(nd,((LWO::Layer*)nd->mParent)->mIndex,apcNodes);
- }
- }
- delete[] root->mChildren;
- root->mChildren = apcNewNodes;
- root->mNumChildren = newSize;
- }
- if (!pScene->mRootNode->mNumChildren)
- throw DeadlyImportError("LWO: Unable to build a valid node graph");
-
- // Remove a single root node with no meshes assigned to it ...
- if (1 == pScene->mRootNode->mNumChildren) {
- aiNode* pc = pScene->mRootNode->mChildren[0];
- pc->mParent = pScene->mRootNode->mChildren[0] = NULL;
- delete pScene->mRootNode;
- pScene->mRootNode = pc;
- }
-
- // convert the whole stuff to RH with CCW winding
- MakeLeftHandedProcess maker;
- maker.Execute(pScene);
-
- FlipWindingOrderProcess flipper;
- flipper.Execute(pScene);
-}
-
-// ------------------------------------------------------------------------------------------------
-void LWOImporter::ResolveTags()
-{
- // --- this function is used for both LWO2 and LWOB
- mMapping->resize(mTags->size(),0xffffffff);
- for (unsigned int a = 0; a < mTags->size();++a) {
-
- const std::string& c = (*mTags)[a];
- for (unsigned int i = 0; i < mSurfaces->size();++i) {
-
- const std::string& d = (*mSurfaces)[i].mName;
- if (!ASSIMP_stricmp(c,d)) {
-
- (*mMapping)[a] = i;
- break;
- }
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void LWOImporter::ResolveClips()
-{
- for ( unsigned int i = 0; i < mClips.size();++i) {
-
- Clip& clip = mClips[i];
- if (Clip::REF == clip.type) {
-
- if (clip.clipRef >= mClips.size()) {
- DefaultLogger::get()->error("LWO2: Clip referrer index is out of range");
- clip.clipRef = 0;
- }
-
- Clip& dest = mClips[clip.clipRef];
- if (Clip::REF == dest.type) {
- DefaultLogger::get()->error("LWO2: Clip references another clip reference");
- clip.type = Clip::UNSUPPORTED;
- }
-
- else {
- clip.path = dest.path;
- clip.type = dest.type;
- }
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void LWOImporter::AdjustTexturePath(std::string& out)
-{
- // --- this function is used for both LWO2 and LWOB
- if (!mIsLWO2 && ::strstr(out.c_str(), "(sequence)")) {
-
- // remove the (sequence) and append 000
- DefaultLogger::get()->info("LWOB: Sequence of animated texture found. It will be ignored");
- out = out.substr(0,out.length()-10) + "000";
- }
-
- // format: drive:path/file - we just need to insert a slash after the drive
- std::string::size_type n = out.find_first_of(':');
- if (std::string::npos != n) {
- out.insert(n+1,"/");
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void LWOImporter::LoadLWOTags(unsigned int size)
-{
- // --- this function is used for both LWO2 and LWOB
-
- const char* szCur = (const char*)mFileBuffer, *szLast = szCur;
- const char* const szEnd = szLast+size;
- while (szCur < szEnd)
- {
- if (!(*szCur))
- {
- const size_t len = (size_t)(szCur-szLast);
- // FIX: skip empty-sized tags
- if (len)
- mTags->push_back(std::string(szLast,len));
- szCur += (len&0x1 ? 1 : 2);
- szLast = szCur;
- }
- szCur++;
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void LWOImporter::LoadLWOPoints(unsigned int length)
-{
- // --- this function is used for both LWO2 and LWOB but for
- // LWO2 we need to allocate 25% more storage - it could be we'll
- // need to duplicate some points later.
- register unsigned int regularSize = (unsigned int)mCurLayer->mTempPoints.size() + length / 12;
- if (mIsLWO2)
- {
- mCurLayer->mTempPoints.reserve ( regularSize + (regularSize>>2u) );
- mCurLayer->mTempPoints.resize ( regularSize );
-
- // initialize all point referrers with the default values
- mCurLayer->mPointReferrers.reserve ( regularSize + (regularSize>>2u) );
- mCurLayer->mPointReferrers.resize ( regularSize, 0xffffffff );
- }
- else mCurLayer->mTempPoints.resize( regularSize );
-
- // perform endianess conversions
-#ifndef AI_BUILD_BIG_ENDIAN
- for (unsigned int i = 0; i < length>>2;++i)
- ByteSwap::Swap4( mFileBuffer + (i << 2));
-#endif
- ::memcpy(&mCurLayer->mTempPoints[0],mFileBuffer,length);
-}
-
-// ------------------------------------------------------------------------------------------------
-void LWOImporter::LoadLWO2Polygons(unsigned int length)
-{
- LE_NCONST uint16_t* const end = (LE_NCONST uint16_t*)(mFileBuffer+length);
- const uint32_t type = GetU4();
-
- // Determine the type of the polygons
- switch (type)
- {
- // read unsupported stuff too (although we wont process it)
- case AI_LWO_MBAL:
- DefaultLogger::get()->warn("LWO2: Encountered unsupported primitive chunk (METABALL)");
- break;
- case AI_LWO_CURV:
- DefaultLogger::get()->warn("LWO2: Encountered unsupported primitive chunk (SPLINE)");;
- break;
-
- // These are ok with no restrictions
- case AI_LWO_PTCH:
- case AI_LWO_FACE:
- case AI_LWO_BONE:
- case AI_LWO_SUBD:
- break;
- default:
-
- // hm!? wtf is this? ok ...
- DefaultLogger::get()->error("LWO2: Ignoring unknown polygon type.");
- break;
- }
-
- // first find out how many faces and vertices we'll finally need
- uint16_t* cursor= (uint16_t*)mFileBuffer;
-
- unsigned int iNumFaces = 0,iNumVertices = 0;
- CountVertsAndFacesLWO2(iNumVertices,iNumFaces,cursor,end);
-
- // allocate the output array and copy face indices
- if (iNumFaces) {
- cursor = (uint16_t*)mFileBuffer;
-
- mCurLayer->mFaces.resize(iNumFaces,LWO::Face(type));
- FaceList::iterator it = mCurLayer->mFaces.begin();
- CopyFaceIndicesLWO2(it,cursor,end);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void LWOImporter::CountVertsAndFacesLWO2(unsigned int& verts, unsigned int& faces,
- uint16_t*& cursor, const uint16_t* const end, unsigned int max)
-{
- while (cursor < end && max--)
- {
- AI_LSWAP2P(cursor);
- uint16_t numIndices = *cursor++;
- numIndices &= 0x03FF;
- verts += numIndices;++faces;
-
- for (uint16_t i = 0; i < numIndices; i++)
- ReadVSizedIntLWO2((uint8_t*&)cursor);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void LWOImporter::CopyFaceIndicesLWO2(FaceList::iterator& it,
- uint16_t*& cursor,
- const uint16_t* const end)
-{
- while (cursor < end) {
-
- LWO::Face& face = *it++;;
- if ((face.mNumIndices = (*cursor++) & 0x03FF)) /* byte swapping has already been done */ {
- face.mIndices = new unsigned int[face.mNumIndices];
- for (unsigned int i = 0; i < face.mNumIndices; i++)
- {
- face.mIndices[i] = ReadVSizedIntLWO2((uint8_t*&)cursor) + mCurLayer->mPointIDXOfs;
- if (face.mIndices[i] > mCurLayer->mTempPoints.size())
- {
- DefaultLogger::get()->warn("LWO2: Failure evaluating face record, index is out of range");
- face.mIndices[i] = (unsigned int)mCurLayer->mTempPoints.size()-1;
- }
- }
- }
- else throw DeadlyImportError("LWO2: Encountered invalid face record with zero indices");
- }
-}
-
-
-// ------------------------------------------------------------------------------------------------
-void LWOImporter::LoadLWO2PolygonTags(unsigned int length)
-{
- LE_NCONST uint8_t* const end = mFileBuffer+length;
-
- AI_LWO_VALIDATE_CHUNK_LENGTH(length,PTAG,4);
- uint32_t type = GetU4();
-
- if (type != AI_LWO_SURF && type != AI_LWO_SMGP)
- return;
-
- while (mFileBuffer < end) {
-
- unsigned int i = ReadVSizedIntLWO2(mFileBuffer) + mCurLayer->mFaceIDXOfs;
- unsigned int j = GetU2();
-
- if (i >= mCurLayer->mFaces.size()) {
- DefaultLogger::get()->warn("LWO2: face index in PTAG is out of range");
- continue;
- }
-
- switch (type) {
-
- case AI_LWO_SURF:
- mCurLayer->mFaces[i].surfaceIndex = j;
- break;
- case AI_LWO_SMGP: /* is that really used? */
- mCurLayer->mFaces[i].smoothGroup = j;
- break;
- };
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-template <class T>
-VMapEntry* FindEntry(std::vector< T >& list,const std::string& name, bool perPoly)
-{
- for (typename std::vector< T >::iterator it = list.begin(), end = list.end();it != end; ++it) {
- if ((*it).name == name) {
- if (!perPoly) {
- DefaultLogger::get()->warn("LWO2: Found two VMAP sections with equal names");
- }
- return &(*it);
- }
- }
- list.push_back( T() );
- VMapEntry* p = &list.back();
- p->name = name;
- return p;
-}
-
-// ------------------------------------------------------------------------------------------------
-template <class T>
-inline void CreateNewEntry(T& chan, unsigned int srcIdx)
-{
- if (!chan.name.length())
- return;
-
- chan.abAssigned[srcIdx] = true;
- chan.abAssigned.resize(chan.abAssigned.size()+1,false);
-
- for (unsigned int a = 0; a < chan.dims;++a)
- chan.rawData.push_back(chan.rawData[srcIdx*chan.dims+a]);
-}
-
-// ------------------------------------------------------------------------------------------------
-template <class T>
-inline void CreateNewEntry(std::vector< T >& list, unsigned int srcIdx)
-{
- for (typename std::vector< T >::iterator it = list.begin(), end = list.end();it != end;++it) {
- CreateNewEntry( *it, srcIdx );
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-inline void LWOImporter::DoRecursiveVMAPAssignment(VMapEntry* base, unsigned int numRead,
- unsigned int idx, float* data)
-{
- ai_assert(NULL != data);
- LWO::ReferrerList& refList = mCurLayer->mPointReferrers;
- unsigned int i;
-
- base->abAssigned[idx] = true;
- for (i = 0; i < numRead;++i) {
- base->rawData[idx*base->dims+i]= data[i];
- }
-
- if (0xffffffff != (i = refList[idx])) {
- DoRecursiveVMAPAssignment(base,numRead,i,data);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-inline void AddToSingleLinkedList(ReferrerList& refList, unsigned int srcIdx, unsigned int destIdx)
-{
- if (0xffffffff == refList[srcIdx]) {
- refList[srcIdx] = destIdx;
- return;
- }
- AddToSingleLinkedList(refList,refList[srcIdx],destIdx);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Load LWO2 vertex map
-void LWOImporter::LoadLWO2VertexMap(unsigned int length, bool perPoly)
-{
- LE_NCONST uint8_t* const end = mFileBuffer+length;
-
- AI_LWO_VALIDATE_CHUNK_LENGTH(length,VMAP,6);
- unsigned int type = GetU4();
- unsigned int dims = GetU2();
-
- VMapEntry* base;
-
- // read the name of the vertex map
- std::string name;
- GetS0(name,length);
-
- switch (type)
- {
- case AI_LWO_TXUV:
- if (dims != 2) {
- DefaultLogger::get()->warn("LWO2: Skipping UV channel \'"
- + name + "\' with !2 components");
- return;
- }
- base = FindEntry(mCurLayer->mUVChannels,name,perPoly);
- break;
- case AI_LWO_WGHT:
- case AI_LWO_MNVW:
- if (dims != 1) {
- DefaultLogger::get()->warn("LWO2: Skipping Weight Channel \'"
- + name + "\' with !1 components");
- return;
- }
- base = FindEntry((type == AI_LWO_WGHT ? mCurLayer->mWeightChannels
- : mCurLayer->mSWeightChannels),name,perPoly);
- break;
- case AI_LWO_RGB:
- case AI_LWO_RGBA:
- if (dims != 3 && dims != 4) {
- DefaultLogger::get()->warn("LWO2: Skipping Color Map \'"
- + name + "\' with a dimension > 4 or < 3");
- return;
- }
- base = FindEntry(mCurLayer->mVColorChannels,name,perPoly);
- break;
-
- case AI_LWO_MODO_NORM:
- /* This is a non-standard extension chunk used by Luxology's MODO.
- * It stores per-vertex normals. This VMAP exists just once, has
- * 3 dimensions and is btw extremely beautiful.
- */
- if (name != "vert_normals" || dims != 3 || mCurLayer->mNormals.name.length())
- return;
-
- DefaultLogger::get()->info("Processing non-standard extension: MODO VMAP.NORM.vert_normals");
-
- mCurLayer->mNormals.name = name;
- base = & mCurLayer->mNormals;
- break;
-
- case AI_LWO_PICK: /* these VMAPs are just silently dropped */
- case AI_LWO_MORF:
- case AI_LWO_SPOT:
- return;
-
- default:
- if (name == "APS.Level") {
- // XXX handle this (seems to be subdivision-related).
- }
- DefaultLogger::get()->warn("LWO2: Skipping unknown VMAP/VMAD channel \'" + name + "\'");
- return;
- };
- base->Allocate((unsigned int)mCurLayer->mTempPoints.size());
-
- // now read all entries in the map
- type = std::min(dims,base->dims);
- const unsigned int diff = (dims - type)<<2u;
-
- LWO::FaceList& list = mCurLayer->mFaces;
- LWO::PointList& pointList = mCurLayer->mTempPoints;
- LWO::ReferrerList& refList = mCurLayer->mPointReferrers;
-
- float temp[4];
-
- const unsigned int numPoints = (unsigned int)pointList.size();
- const unsigned int numFaces = (unsigned int)list.size();
-
- while (mFileBuffer < end) {
-
- unsigned int idx = ReadVSizedIntLWO2(mFileBuffer) + mCurLayer->mPointIDXOfs;
- if (idx >= numPoints) {
- DefaultLogger::get()->warn("LWO2: Failure evaluating VMAP/VMAD entry \'" + name + "\', vertex index is out of range");
- mFileBuffer += base->dims<<2u;
- continue;
- }
- if (perPoly) {
- unsigned int polyIdx = ReadVSizedIntLWO2(mFileBuffer) + mCurLayer->mFaceIDXOfs;
- if (base->abAssigned[idx]) {
- // we have already a VMAP entry for this vertex - thus
- // we need to duplicate the corresponding polygon.
- if (polyIdx >= numFaces) {
- DefaultLogger::get()->warn("LWO2: Failure evaluating VMAD entry \'" + name + "\', polygon index is out of range");
- mFileBuffer += base->dims<<2u;
- continue;
- }
-
- LWO::Face& src = list[polyIdx];
-
- // generate a new unique vertex for the corresponding index - but only
- // if we can find the index in the face
- bool had = false;
- for (unsigned int i = 0; i < src.mNumIndices;++i) {
-
- unsigned int srcIdx = src.mIndices[i], tmp = idx;
- do {
- if (tmp == srcIdx)
- break;
- }
- while ((tmp = refList[tmp]) != 0xffffffff);
- if (tmp == 0xffffffff)
- continue;
-
- had = true;
- refList.resize(refList.size()+1, 0xffffffff);
-
- idx = (unsigned int)pointList.size();
- src.mIndices[i] = (unsigned int)pointList.size();
-
- // store the index of the new vertex in the old vertex
- // so we get a single linked list we can traverse in
- // only one direction
- AddToSingleLinkedList(refList,srcIdx,src.mIndices[i]);
- pointList.push_back(pointList[srcIdx]);
-
- CreateNewEntry(mCurLayer->mVColorChannels, srcIdx );
- CreateNewEntry(mCurLayer->mUVChannels, srcIdx );
- CreateNewEntry(mCurLayer->mWeightChannels, srcIdx );
- CreateNewEntry(mCurLayer->mSWeightChannels, srcIdx );
- CreateNewEntry(mCurLayer->mNormals, srcIdx );
- }
- if (!had) {
- DefaultLogger::get()->warn("LWO2: Failure evaluating VMAD entry \'" + name + "\', vertex index wasn't found in that polygon");
- ai_assert(had);
- }
- }
- }
- for (unsigned int l = 0; l < type;++l)
- temp[l] = GetF4();
-
- DoRecursiveVMAPAssignment(base,type,idx, temp);
- mFileBuffer += diff;
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Load LWO2 clip
-void LWOImporter::LoadLWO2Clip(unsigned int length)
-{
- AI_LWO_VALIDATE_CHUNK_LENGTH(length,CLIP,10);
-
- mClips.push_back(LWO::Clip());
- LWO::Clip& clip = mClips.back();
-
- // first - get the index of the clip
- clip.idx = GetU4();
-
- IFF::SubChunkHeader* const head = IFF::LoadSubChunk(mFileBuffer);
- switch (head->type)
- {
- case AI_LWO_STIL:
- AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,STIL,1);
-
- // "Normal" texture
- GetS0(clip.path,head->length);
- clip.type = Clip::STILL;
- break;
-
- case AI_LWO_ISEQ:
- AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,ISEQ,16);
- // Image sequence. We'll later take the first.
- {
- uint8_t digits = GetU1(); mFileBuffer++;
- int16_t offset = GetU2(); mFileBuffer+=4;
- int16_t start = GetU2(); mFileBuffer+=4;
-
- std::string s;std::stringstream ss;
- GetS0(s,head->length);
-
- head->length -= (unsigned int)s.length()+1;
- ss << s;
- ss << std::setw(digits) << offset + start;
- GetS0(s,head->length);
- ss << s;
- clip.path = ss.str();
- clip.type = Clip::SEQ;
- }
- break;
-
- case AI_LWO_STCC:
- DefaultLogger::get()->warn("LWO2: Color shifted images are not supported");
- break;
-
- case AI_LWO_ANIM:
- DefaultLogger::get()->warn("LWO2: Animated textures are not supported");
- break;
-
- case AI_LWO_XREF:
- AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,XREF,4);
-
- // Just a cross-reference to another CLIp
- clip.type = Clip::REF;
- clip.clipRef = GetU4();
- break;
-
- case AI_LWO_NEGA:
- AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,NEGA,2);
- clip.negate = (0 != GetU2());
- break;
-
- default:
- DefaultLogger::get()->warn("LWO2: Encountered unknown CLIP subchunk");
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Load envelope description
-void LWOImporter::LoadLWO2Envelope(unsigned int length)
-{
- LE_NCONST uint8_t* const end = mFileBuffer + length;
- AI_LWO_VALIDATE_CHUNK_LENGTH(length,ENVL,4);
-
- mEnvelopes.push_back(LWO::Envelope());
- LWO::Envelope& envelope = mEnvelopes.back();
-
- // Get the index of the envelope
- envelope.index = ReadVSizedIntLWO2(mFileBuffer);
-
- // It looks like there might be an extra U4 right after the index,
- // at least in modo (LXOB) files: we'll ignore it if it's zero,
- // otherwise it represents the start of a subchunk, so we backtrack.
- if (mIsLXOB)
- {
- uint32_t extra = GetU4();
- if (extra)
- {
- mFileBuffer -= 4;
- }
- }
-
- // ... and read all subchunks
- while (true)
- {
- if (mFileBuffer + 6 >= end)break;
- LE_NCONST IFF::SubChunkHeader* const head = IFF::LoadSubChunk(mFileBuffer);
-
- if (mFileBuffer + head->length > end)
- throw DeadlyImportError("LWO2: Invalid envelope chunk length");
-
- uint8_t* const next = mFileBuffer+head->length;
- switch (head->type)
- {
- // Type & representation of the envelope
- case AI_LWO_TYPE:
- AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,TYPE,2);
- mFileBuffer++; // skip user format
-
- // Determine type of envelope
- envelope.type = (LWO::EnvelopeType)*mFileBuffer;
- ++mFileBuffer;
- break;
-
- // precondition
- case AI_LWO_PRE:
- AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,PRE,2);
- envelope.pre = (LWO::PrePostBehaviour)GetU2();
- break;
-
- // postcondition
- case AI_LWO_POST:
- AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,POST,2);
- envelope.post = (LWO::PrePostBehaviour)GetU2();
- break;
-
- // keyframe
- case AI_LWO_KEY:
- {
- AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,KEY,8);
-
- envelope.keys.push_back(LWO::Key());
- LWO::Key& key = envelope.keys.back();
-
- key.time = GetF4();
- key.value = GetF4();
- break;
- }
-
- // interval interpolation
- case AI_LWO_SPAN:
- {
- AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,SPAN,4);
- if (envelope.keys.size()<2)
- DefaultLogger::get()->warn("LWO2: Unexpected SPAN chunk");
- else {
- LWO::Key& key = envelope.keys.back();
- switch (GetU4())
- {
- case AI_LWO_STEP:
- key.inter = LWO::IT_STEP;break;
- case AI_LWO_LINE:
- key.inter = LWO::IT_LINE;break;
- case AI_LWO_TCB:
- key.inter = LWO::IT_TCB;break;
- case AI_LWO_HERM:
- key.inter = LWO::IT_HERM;break;
- case AI_LWO_BEZI:
- key.inter = LWO::IT_BEZI;break;
- case AI_LWO_BEZ2:
- key.inter = LWO::IT_BEZ2;break;
- default:
- DefaultLogger::get()->warn("LWO2: Unknown interval interpolation mode");
- };
-
- // todo ... read params
- }
- break;
- }
-
- default:
- DefaultLogger::get()->warn("LWO2: Encountered unknown ENVL subchunk");
- }
- // regardless how much we did actually read, go to the next chunk
- mFileBuffer = next;
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Load file - master function
-void LWOImporter::LoadLWO2File()
-{
- bool skip = false;
-
- LE_NCONST uint8_t* const end = mFileBuffer + fileSize;
- while (true)
- {
- if (mFileBuffer + sizeof(IFF::ChunkHeader) > end)break;
- IFF::ChunkHeader* const head = IFF::LoadChunk(mFileBuffer);
-
- if (mFileBuffer + head->length > end)
- {
- throw DeadlyImportError("LWO2: Chunk length points behind the file");
- break;
- }
- uint8_t* const next = mFileBuffer+head->length;
- unsigned int iUnnamed = 0;
-
- switch (head->type)
- {
- // new layer
- case AI_LWO_LAYR:
- {
- // add a new layer to the list ....
- mLayers->push_back ( LWO::Layer() );
- LWO::Layer& layer = mLayers->back();
- mCurLayer = &layer;
-
- AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,LAYR,16);
-
- // Continue loading this layer or ignore it? Check the layer index property
- // NOTE: The first layer is the default layer, so the layer index is one-based now
- if (0xffffffff != configLayerIndex && configLayerIndex != mLayers->size()-1) {
- skip = true;
- }
- else skip = false;
-
- // layer index. that's just for internal parenting, from the scope of a LWS file
- // all layers are numbered in the oder in which they appear in the file
- layer.mIndex = GetU2();
-
- // pivot point
- mFileBuffer += 2; /* unknown */
- mCurLayer->mPivot.x = GetF4();
- mCurLayer->mPivot.y = GetF4();
- mCurLayer->mPivot.z = GetF4();
- GetS0(layer.mName,head->length-16);
-
- // if the name is empty, generate a default name
- if (layer.mName.empty()) {
- char buffer[128]; // should be sufficiently large
- ::sprintf(buffer,"Layer_%i", iUnnamed++);
- layer.mName = buffer;
- }
-
- // load this layer or ignore it? Check the layer name property
- if (configLayerName.length() && configLayerName != layer.mName) {
- skip = true;
- }
- else hasNamedLayer = true;
-
- // optional: parent of this layer
- if (mFileBuffer + 2 <= next)
- layer.mParent = GetU2();
-
- break;
- }
-
- // vertex list
- case AI_LWO_PNTS:
- {
- if (skip)
- break;
-
- unsigned int old = (unsigned int)mCurLayer->mTempPoints.size();
- LoadLWOPoints(head->length);
- mCurLayer->mPointIDXOfs = old;
- break;
- }
- // vertex tags
- case AI_LWO_VMAD:
- if (mCurLayer->mFaces.empty())
- {
- DefaultLogger::get()->warn("LWO2: Unexpected VMAD chunk");
- break;
- }
- // --- intentionally no break here
- case AI_LWO_VMAP:
- {
- if (skip)
- break;
-
- if (mCurLayer->mTempPoints.empty())
- DefaultLogger::get()->warn("LWO2: Unexpected VMAP chunk");
- else LoadLWO2VertexMap(head->length,head->type == AI_LWO_VMAD);
- break;
- }
- // face list
- case AI_LWO_POLS:
- {
- if (skip)
- break;
-
- unsigned int old = (unsigned int)mCurLayer->mFaces.size();
- LoadLWO2Polygons(head->length);
- mCurLayer->mFaceIDXOfs = old;
- break;
- }
- // polygon tags
- case AI_LWO_PTAG:
- {
- if (skip)
- break;
-
- if (mCurLayer->mFaces.empty())
- DefaultLogger::get()->warn("LWO2: Unexpected PTAG");
- else LoadLWO2PolygonTags(head->length);
- break;
- }
- // list of tags
- case AI_LWO_TAGS:
- {
- if (!mTags->empty())
- DefaultLogger::get()->warn("LWO2: SRFS chunk encountered twice");
- else LoadLWOTags(head->length);
- break;
- }
-
- // surface chunk
- case AI_LWO_SURF:
- {
- LoadLWO2Surface(head->length);
- break;
- }
-
- // clip chunk
- case AI_LWO_CLIP:
- {
- LoadLWO2Clip(head->length);
- break;
- }
-
- // envelope chunk
- case AI_LWO_ENVL:
- {
- LoadLWO2Envelope(head->length);
- break;
- }
- }
- mFileBuffer = next;
- }
-}
-
-#endif // !! ASSIMP_BUILD_NO_LWO_IMPORTER
diff --git a/3rdparty/assimp/code/LWOLoader.h b/3rdparty/assimp/code/LWOLoader.h
deleted file mode 100644
index 629ec072..00000000
--- a/3rdparty/assimp/code/LWOLoader.h
+++ /dev/null
@@ -1,490 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file Declaration of the LWO importer class. */
-#ifndef AI_LWOLOADER_H_INCLUDED
-#define AI_LWOLOADER_H_INCLUDED
-
-#include "../include/aiTypes.h"
-#include "../include/DefaultLogger.h"
-
-#include "LWOFileData.h"
-#include "BaseImporter.h"
-#include "MaterialSystem.h"
-
-struct aiTexture;
-struct aiNode;
-
-namespace Assimp {
-using namespace LWO;
-
-// ---------------------------------------------------------------------------
-/** Class to load LWO files.
- *
- * @note Methods named "xxxLWO2[xxx]" are used with the newer LWO2 format.
- * Methods named "xxxLWOB[xxx]" are used with the older LWOB format.
- * Methods named "xxxLWO[xxx]" are used with both formats.
- * Methods named "xxx" are used to preprocess the loaded data -
- * they aren't specific to one format version
-*/
-// ---------------------------------------------------------------------------
-class LWOImporter : public BaseImporter
-{
- friend class Importer;
-
-
-protected:
- /** Constructor to be privately used by Importer */
- LWOImporter();
-
- /** Destructor, private as well */
- ~LWOImporter();
-
-public:
-
- // -------------------------------------------------------------------
- /** Returns whether the class can handle the format of the given file.
- * See BaseImporter::CanRead() for details.
- */
- bool CanRead( const std::string& pFile, IOSystem* pIOHandler,
- bool checkSig) const;
-
-
- // -------------------------------------------------------------------
- /** Called prior to ReadFile().
- * The function is a request to the importer to update its configuration
- * basing on the Importer's configuration property list.
- */
- void SetupProperties(const Importer* pImp);
-
-protected:
-
- // -------------------------------------------------------------------
- /** Called by Importer::GetExtensionList() for each loaded importer.
- * See BaseImporter::GetExtensionList() for details
- */
- void GetExtensionList(std::set<std::string>& extensions)
- {
- extensions.insert("lxo");
- extensions.insert("lwo");
- }
-
- // -------------------------------------------------------------------
- /** Imports the given file into the given scene structure.
- * See BaseImporter::InternReadFile() for details
- */
- void InternReadFile( const std::string& pFile, aiScene* pScene,
- IOSystem* pIOHandler);
-
-private:
-
- // -------------------------------------------------------------------
- /** Loads a LWO file in the older LWOB format (LW < 6)
- */
- void LoadLWOBFile();
-
- // -------------------------------------------------------------------
- /** Loads a LWO file in the newer LWO2 format (LW >= 6)
- */
- void LoadLWO2File();
-
-
- // -------------------------------------------------------------------
- /** Parsing functions used for all file format versions
- */
- inline void GetS0(std::string& out,unsigned int max);
- inline float GetF4();
- inline uint32_t GetU4();
- inline uint16_t GetU2();
- inline uint8_t GetU1();
-
-
- // -------------------------------------------------------------------
- /** Loads a surface chunk from an LWOB file
- * @param size Maximum size to be read, in bytes.
- */
- void LoadLWOBSurface(unsigned int size);
-
- // -------------------------------------------------------------------
- /** Loads a surface chunk from an LWO2 file
- * @param size Maximum size to be read, in bytes.
- */
- void LoadLWO2Surface(unsigned int size);
-
- // -------------------------------------------------------------------
- /** Loads a texture block from a LWO2 file.
- * @param size Maximum size to be read, in bytes.
- * @param head Header of the SUF.BLOK header
- */
- void LoadLWO2TextureBlock(LE_NCONST IFF::SubChunkHeader* head,
- unsigned int size );
-
- // -------------------------------------------------------------------
- /** Loads a shader block from a LWO2 file.
- * @param size Maximum size to be read, in bytes.
- * @param head Header of the SUF.BLOK header
- */
- void LoadLWO2ShaderBlock(LE_NCONST IFF::SubChunkHeader* head,
- unsigned int size );
-
- // -------------------------------------------------------------------
- /** Loads an image map from a LWO2 file
- * @param size Maximum size to be read, in bytes.
- * @param tex Texture object to be filled
- */
- void LoadLWO2ImageMap(unsigned int size, LWO::Texture& tex );
- void LoadLWO2Gradient(unsigned int size, LWO::Texture& tex );
- void LoadLWO2Procedural(unsigned int size, LWO::Texture& tex );
-
- // loads the header - used by thethree functions above
- void LoadLWO2TextureHeader(unsigned int size, LWO::Texture& tex );
-
- // -------------------------------------------------------------------
- /** Loads the LWO tag list from the file
- * @param size Maximum size to be read, in bytes.
- */
- void LoadLWOTags(unsigned int size);
-
- // -------------------------------------------------------------------
- /** Load polygons from a POLS chunk
- * @param length Size of the chunk
- */
- void LoadLWO2Polygons(unsigned int length);
- void LoadLWOBPolygons(unsigned int length);
-
- // -------------------------------------------------------------------
- /** Load polygon tags from a PTAG chunk
- * @param length Size of the chunk
- */
- void LoadLWO2PolygonTags(unsigned int length);
-
- // -------------------------------------------------------------------
- /** Load a vertex map from a VMAP/VMAD chunk
- * @param length Size of the chunk
- * @param perPoly Operate on per-polygon base?
- */
- void LoadLWO2VertexMap(unsigned int length, bool perPoly);
-
- // -------------------------------------------------------------------
- /** Load polygons from a PNTS chunk
- * @param length Size of the chunk
- */
- void LoadLWOPoints(unsigned int length);
-
- // -------------------------------------------------------------------
- /** Load a clip from a CLIP chunk
- * @param length Size of the chunk
- */
- void LoadLWO2Clip(unsigned int length);
-
- // -------------------------------------------------------------------
- /** Load an envelope from an EVL chunk
- * @param length Size of the chunk
- */
- void LoadLWO2Envelope(unsigned int length);
-
- // -------------------------------------------------------------------
- /** Count vertices and faces in a LWOB/LWO2 file
- */
- void CountVertsAndFacesLWO2(unsigned int& verts,
- unsigned int& faces,
- uint16_t*& cursor,
- const uint16_t* const end,
- unsigned int max = 0xffffffff);
-
- void CountVertsAndFacesLWOB(unsigned int& verts,
- unsigned int& faces,
- LE_NCONST uint16_t*& cursor,
- const uint16_t* const end,
- unsigned int max = 0xffffffff);
-
- // -------------------------------------------------------------------
- /** Read vertices and faces in a LWOB/LWO2 file
- */
- void CopyFaceIndicesLWO2(LWO::FaceList::iterator& it,
- uint16_t*& cursor,
- const uint16_t* const end);
-
- // -------------------------------------------------------------------
- void CopyFaceIndicesLWOB(LWO::FaceList::iterator& it,
- LE_NCONST uint16_t*& cursor,
- const uint16_t* const end,
- unsigned int max = 0xffffffff);
-
- // -------------------------------------------------------------------
- /** Resolve the tag and surface lists that have been loaded.
- * Generates the mMapping table.
- */
- void ResolveTags();
-
- // -------------------------------------------------------------------
- /** Resolve the clip list that has been loaded.
- * Replaces clip references with real clips.
- */
- void ResolveClips();
-
- // -------------------------------------------------------------------
- /** Add a texture list to an output material description.
- *
- * @param pcMat Output material
- * @param in Input texture list
- * @param type Type identifier of the texture list
- */
- bool HandleTextures(MaterialHelper* pcMat, const TextureList& in,
- aiTextureType type);
-
- // -------------------------------------------------------------------
- /** Adjust a texture path
- */
- void AdjustTexturePath(std::string& out);
-
- // -------------------------------------------------------------------
- /** Convert a LWO surface description to an ASSIMP material
- */
- void ConvertMaterial(const LWO::Surface& surf,MaterialHelper* pcMat);
-
-
- // -------------------------------------------------------------------
- /** Get a list of all UV/VC channels required by a specific surface.
- *
- * @param surf Working surface
- * @param layer Working layer
- * @param out Output list. The members are indices into the
- * UV/VC channel lists of the layer
- */
- void FindUVChannels(/*const*/ LWO::Surface& surf,
- LWO::SortedRep& sorted,
- /*const*/ LWO::Layer& layer,
- unsigned int out[AI_MAX_NUMBER_OF_TEXTURECOORDS]);
-
- // -------------------------------------------------------------------
- char FindUVChannels(LWO::TextureList& list,
- LWO::Layer& layer,LWO::UVChannel& uv, unsigned int next);
-
- // -------------------------------------------------------------------
- void FindVCChannels(const LWO::Surface& surf,
- LWO::SortedRep& sorted,
- const LWO::Layer& layer,
- unsigned int out[AI_MAX_NUMBER_OF_COLOR_SETS]);
-
- // -------------------------------------------------------------------
- /** Generate the final node graph
- * Unused nodes are deleted.
- * @param apcNodes Flat list of nodes
- */
- void GenerateNodeGraph(std::vector<aiNode*>& apcNodes);
-
- // -------------------------------------------------------------------
- /** Add children to a node
- * @param node Node to become a father
- * @param parent Index of the node
- * @param apcNodes Flat list of nodes - used nodes are set to NULL.
- */
- void AddChildren(aiNode* node, uint16_t parent,
- std::vector<aiNode*>& apcNodes);
-
- // -------------------------------------------------------------------
- /** Read a variable sized integer
- * @param inout Input and output buffer
- */
- int ReadVSizedIntLWO2(uint8_t*& inout);
-
- // -------------------------------------------------------------------
- /** Assign a value from a VMAP to a vertex and all vertices
- * attached to it.
- * @param base VMAP destination data
- * @param numRead Number of float's to be read
- * @param idx Absolute index of the first vertex
- * @param data Value of the VMAP to be assigned - read numRead
- * floats from this array.
- */
- void DoRecursiveVMAPAssignment(VMapEntry* base, unsigned int numRead,
- unsigned int idx, float* data);
-
- // -------------------------------------------------------------------
- /** Compute normal vectors for a mesh
- * @param mesh Input mesh
- * @param smoothingGroups Smoothing-groups-per-face array
- * @param surface Surface for the mesh
- */
- void ComputeNormals(aiMesh* mesh, const std::vector<unsigned int>& smoothingGroups,
- const LWO::Surface& surface);
-
-
- // -------------------------------------------------------------------
- /** Setup a new texture after the corresponding chunk was
- * encountered in the file.
- * @param list Texture list
- * @param size Maximum number of bytes to be read
- * @return Pointer to new texture
- */
- LWO::Texture* SetupNewTextureLWOB(LWO::TextureList& list,
- unsigned int size);
-
-protected:
-
- /** true if the file is a LWO2 file*/
- bool mIsLWO2;
-
- /** true if the file is a LXOB file*/
- bool mIsLXOB;
-
- /** Temporary list of layers from the file */
- LayerList* mLayers;
-
- /** Pointer to the current layer */
- LWO::Layer* mCurLayer;
-
- /** Temporary tag list from the file */
- TagList* mTags;
-
- /** Mapping table to convert from tag to surface indices.
- 0xffffffff indicates that a no corresponding surface is available */
- TagMappingTable* mMapping;
-
- /** Temporary surface list from the file */
- SurfaceList* mSurfaces;
-
- /** Temporary clip list from the file */
- ClipList mClips;
-
- /** Temporary envelope list from the file */
- EnvelopeList mEnvelopes;
-
- /** file buffer */
- uint8_t* mFileBuffer;
-
- /** Size of the file, in bytes */
- unsigned int fileSize;
-
- /** Output scene */
- aiScene* pScene;
-
- /** Configuration option: speed flag set? */
- bool configSpeedFlag;
-
- /** Configuration option: index of layer to be loaded */
- unsigned int configLayerIndex;
-
- /** Configuration option: name of layer to be loaded */
- std::string configLayerName;
-
- /** True if we have a named layer */
- bool hasNamedLayer;
-};
-
-
-// ------------------------------------------------------------------------------------------------
-inline float LWOImporter::GetF4()
-{
- float f = *((float*)mFileBuffer);mFileBuffer += 4;
- AI_LSWAP4(f);
- return f;
-}
-
-// ------------------------------------------------------------------------------------------------
-inline uint32_t LWOImporter::GetU4()
-{
- uint32_t f = *((uint32_t*)mFileBuffer);mFileBuffer += 4;
- AI_LSWAP4(f);
- return f;
-}
-
-// ------------------------------------------------------------------------------------------------
-inline uint16_t LWOImporter::GetU2()
-{
- uint16_t f = *((uint16_t*)mFileBuffer);mFileBuffer += 2;
- AI_LSWAP2(f);
- return f;
-}
-
-// ------------------------------------------------------------------------------------------------
-inline uint8_t LWOImporter::GetU1()
-{
- return *mFileBuffer++;
-}
-
-// ------------------------------------------------------------------------------------------------
-inline int LWOImporter::ReadVSizedIntLWO2(uint8_t*& inout)
-{
- int i;
- int c = *inout;inout++;
- if (c != 0xFF)
- {
- i = c << 8;
- c = *inout;inout++;
- i |= c;
- }
- else
- {
- c = *inout;inout++;
- i = c << 16;
- c = *inout;inout++;
- i |= c << 8;
- c = *inout;inout++;
- i |= c;
- }
- return i;
-}
-
-// ------------------------------------------------------------------------------------------------
-inline void LWOImporter::GetS0(std::string& out,unsigned int max)
-{
- unsigned int iCursor = 0;
- const char*sz = (const char*)mFileBuffer;
- while (*mFileBuffer)
- {
- if (++iCursor > max)
- {
- DefaultLogger::get()->warn("LWO: Invalid file, string is is too long");
- break;
- }
- ++mFileBuffer;
- }
- size_t len = (size_t) ((const char*)mFileBuffer-sz);
- out = std::string(sz,len);
- mFileBuffer += (len&0x1 ? 1 : 2);
-}
-
-
-
-} // end of namespace Assimp
-
-#endif // AI_LWOIMPORTER_H_INCLUDED
diff --git a/3rdparty/assimp/code/LWOMaterial.cpp b/3rdparty/assimp/code/LWOMaterial.cpp
deleted file mode 100644
index f23a5ecc..00000000
--- a/3rdparty/assimp/code/LWOMaterial.cpp
+++ /dev/null
@@ -1,898 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file Implementation of the material oart of the LWO importer class */
-
-
-#include "AssimpPCH.h"
-#ifndef ASSIMP_BUILD_NO_LWO_IMPORTER
-
-// internal headers
-#include "LWOLoader.h"
-#include "MaterialSystem.h"
-#include "ByteSwap.h"
-
-using namespace Assimp;
-
-// ------------------------------------------------------------------------------------------------
-template <class T>
-T lerp(const T& one, const T& two, float val)
-{
- return one + (two-one)*val;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Convert a lightwave mapping mode to our's
-inline aiTextureMapMode GetMapMode(LWO::Texture::Wrap in)
-{
- switch (in)
- {
- case LWO::Texture::REPEAT:
- return aiTextureMapMode_Wrap;
-
- case LWO::Texture::MIRROR:
- return aiTextureMapMode_Mirror;
-
- case LWO::Texture::RESET:
- DefaultLogger::get()->warn("LWO2: Unsupported texture map mode: RESET");
-
- // fall though here
- case LWO::Texture::EDGE:
- return aiTextureMapMode_Clamp;
- }
- return (aiTextureMapMode)0;
-}
-
-// ------------------------------------------------------------------------------------------------
-bool LWOImporter::HandleTextures(MaterialHelper* pcMat, const TextureList& in, aiTextureType type)
-{
- ai_assert(NULL != pcMat);
-
- unsigned int cur = 0, temp = 0;
- aiString s;
- bool ret = false;
-
- for (TextureList::const_iterator it = in.begin(), end = in.end();it != end;++it) {
- if (!(*it).enabled || !(*it).bCanUse)
- continue;
- ret = true;
-
- // Convert lightwave's mapping modes to ours. We let them
- // as they are, the GenUVcoords step will compute UV
- // channels if they're not there.
-
- aiTextureMapping mapping;
- switch ((*it).mapMode)
- {
- case LWO::Texture::Planar:
- mapping = aiTextureMapping_PLANE;
- break;
- case LWO::Texture::Cylindrical:
- mapping = aiTextureMapping_CYLINDER;
- break;
- case LWO::Texture::Spherical:
- mapping = aiTextureMapping_SPHERE;
- break;
- case LWO::Texture::Cubic:
- mapping = aiTextureMapping_BOX;
- break;
- case LWO::Texture::FrontProjection:
- DefaultLogger::get()->error("LWO2: Unsupported texture mapping: FrontProjection");
- mapping = aiTextureMapping_OTHER;
- break;
- case LWO::Texture::UV:
- {
- if( 0xffffffff == (*it).mRealUVIndex ) {
- // We have no UV index for this texture, so we can't display it
- continue;
- }
-
- // add the UV source index
- temp = (*it).mRealUVIndex;
- pcMat->AddProperty<int>((int*)&temp,1,AI_MATKEY_UVWSRC(type,cur));
-
- mapping = aiTextureMapping_UV;
- }
- break;
- default:
- ai_assert(false);
- };
-
- if (mapping != aiTextureMapping_UV) {
- // Setup the main axis
- aiVector3D v;
- switch ((*it).majorAxis) {
- case Texture::AXIS_X:
- v = aiVector3D(1.f,0.f,0.f);
- break;
- case Texture::AXIS_Y:
- v = aiVector3D(0.f,1.f,0.f);
- break;
- default: // case Texture::AXIS_Z:
- v = aiVector3D(0.f,0.f,1.f);
- break;
- }
-
- pcMat->AddProperty(&v,1,AI_MATKEY_TEXMAP_AXIS(type,cur));
-
- // Setup UV scalings for cylindric and spherical projections
- if (mapping == aiTextureMapping_CYLINDER || mapping == aiTextureMapping_SPHERE) {
- aiUVTransform trafo;
- trafo.mScaling.x = (*it).wrapAmountW;
- trafo.mScaling.y = (*it).wrapAmountH;
-
- BOOST_STATIC_ASSERT(sizeof(aiUVTransform)/sizeof(float) == 5);
- pcMat->AddProperty(&trafo,1,AI_MATKEY_UVTRANSFORM(type,cur));
- }
- DefaultLogger::get()->debug("LWO2: Setting up non-UV mapping");
- }
-
- // The older LWOB format does not use indirect references to clips.
- // The file name of a texture is directly specified in the tex chunk.
- if (mIsLWO2) {
- // find the corresponding clip
- ClipList::iterator clip = mClips.begin();
- temp = (*it).mClipIdx;
- for (ClipList::iterator end = mClips.end(); clip != end; ++clip) {
- if ((*clip).idx == temp)
- break;
-
- }
- if (mClips.end() == clip) {
- DefaultLogger::get()->error("LWO2: Clip index is out of bounds");
- temp = 0;
-
- // fixme: appearently some LWO files shipping with Doom3 don't
- // have clips at all ... check whether that's true or whether
- // it's a bug in the loader.
-
- s.Set("$texture.png");
-
- //continue;
- }
- else {
- if (Clip::UNSUPPORTED == (*clip).type) {
- DefaultLogger::get()->error("LWO2: Clip type is not supported");
- continue;
- }
- AdjustTexturePath((*clip).path);
- s.Set((*clip).path);
-
- // Additional image settings
- int flags = 0;
- if ((*clip).negate) {
- flags |= aiTextureFlags_Invert;
- }
- pcMat->AddProperty(&flags,1,AI_MATKEY_TEXFLAGS(type,cur));
- }
- }
- else
- {
- std::string ss = (*it).mFileName;
- if (!ss.length()) {
- DefaultLogger::get()->error("LWOB: Empty file name");
- continue;
- }
- AdjustTexturePath(ss);
- s.Set(ss);
- }
- pcMat->AddProperty(&s,AI_MATKEY_TEXTURE(type,cur));
-
- // add the blend factor
- pcMat->AddProperty<float>(&(*it).mStrength,1,AI_MATKEY_TEXBLEND(type,cur));
-
- // add the blend operation
- switch ((*it).blendType)
- {
- case LWO::Texture::Normal:
- case LWO::Texture::Multiply:
- temp = (unsigned int)aiTextureOp_Multiply;
- break;
-
- case LWO::Texture::Subtractive:
- case LWO::Texture::Difference:
- temp = (unsigned int)aiTextureOp_Subtract;
- break;
-
- case LWO::Texture::Divide:
- temp = (unsigned int)aiTextureOp_Divide;
- break;
-
- case LWO::Texture::Additive:
- temp = (unsigned int)aiTextureOp_Add;
- break;
-
- default:
- temp = (unsigned int)aiTextureOp_Multiply;
- DefaultLogger::get()->warn("LWO2: Unsupported texture blend mode: alpha or displacement");
-
- }
- // Setup texture operation
- pcMat->AddProperty<int>((int*)&temp,1,AI_MATKEY_TEXOP(type,cur));
-
- // setup the mapping mode
- pcMat->AddProperty<int>((int*)&mapping,1,AI_MATKEY_MAPPING(type,cur));
-
- // add the u-wrapping
- temp = (unsigned int)GetMapMode((*it).wrapModeWidth);
- pcMat->AddProperty<int>((int*)&temp,1,AI_MATKEY_MAPPINGMODE_U(type,cur));
-
- // add the v-wrapping
- temp = (unsigned int)GetMapMode((*it).wrapModeHeight);
- pcMat->AddProperty<int>((int*)&temp,1,AI_MATKEY_MAPPINGMODE_V(type,cur));
-
- ++cur;
- }
- return ret;
-}
-
-// ------------------------------------------------------------------------------------------------
-void LWOImporter::ConvertMaterial(const LWO::Surface& surf,MaterialHelper* pcMat)
-{
- // copy the name of the surface
- aiString st;
- st.Set(surf.mName);
- pcMat->AddProperty(&st,AI_MATKEY_NAME);
-
- const int i = surf.bDoubleSided ? 1 : 0;
- pcMat->AddProperty(&i,1,AI_MATKEY_TWOSIDED);
-
- // add the refraction index and the bump intensity
- pcMat->AddProperty(&surf.mIOR,1,AI_MATKEY_REFRACTI);
- pcMat->AddProperty(&surf.mBumpIntensity,1,AI_MATKEY_BUMPSCALING);
-
- aiShadingMode m;
- if (surf.mSpecularValue && surf.mGlossiness)
- {
- float fGloss;
- if (mIsLWO2) {
- fGloss = pow( surf.mGlossiness*10.0f+2.0f, 2.0f);
- }
- else
- {
- if (16.0f >= surf.mGlossiness)
- fGloss = 6.0f;
- else if (64.0f >= surf.mGlossiness)
- fGloss = 20.0f;
- else if (256.0f >= surf.mGlossiness)
- fGloss = 50.0f;
- else fGloss = 80.0f;
- }
-
- pcMat->AddProperty(&surf.mSpecularValue,1,AI_MATKEY_SHININESS_STRENGTH);
- pcMat->AddProperty(&fGloss,1,AI_MATKEY_SHININESS);
- m = aiShadingMode_Phong;
- }
- else m = aiShadingMode_Gouraud;
-
- // specular color
- aiColor3D clr = lerp( aiColor3D(1.f,1.f,1.f), surf.mColor, surf.mColorHighlights );
- pcMat->AddProperty(&clr,1,AI_MATKEY_COLOR_SPECULAR);
- pcMat->AddProperty(&surf.mSpecularValue,1,AI_MATKEY_SHININESS_STRENGTH);
-
- // emissive color
- // luminosity is not really the same but it affects the surface in a similar way. Some scaling looks good.
- clr.g = clr.b = clr.r = surf.mLuminosity*0.8f;
- pcMat->AddProperty<aiColor3D>(&clr,1,AI_MATKEY_COLOR_EMISSIVE);
-
- // opacity ... either additive or default-blended, please
- if (0.f != surf.mAdditiveTransparency) {
-
- const int add = aiBlendMode_Additive;
- pcMat->AddProperty(&surf.mAdditiveTransparency,1,AI_MATKEY_OPACITY);
- pcMat->AddProperty(&add,1,AI_MATKEY_BLEND_FUNC);
- }
-
- else if (10e10f != surf.mTransparency) {
- const int def = aiBlendMode_Default;
- const float f = 1.0f-surf.mTransparency;
- pcMat->AddProperty(&f,1,AI_MATKEY_OPACITY);
- pcMat->AddProperty(&def,1,AI_MATKEY_BLEND_FUNC);
- }
-
-
- // ADD TEXTURES to the material
- // TODO: find out how we can handle COLOR textures correctly...
- bool b = HandleTextures(pcMat,surf.mColorTextures,aiTextureType_DIFFUSE);
- b = (b || HandleTextures(pcMat,surf.mDiffuseTextures,aiTextureType_DIFFUSE));
- HandleTextures(pcMat,surf.mSpecularTextures,aiTextureType_SPECULAR);
- HandleTextures(pcMat,surf.mGlossinessTextures,aiTextureType_SHININESS);
- HandleTextures(pcMat,surf.mBumpTextures,aiTextureType_HEIGHT);
- HandleTextures(pcMat,surf.mOpacityTextures,aiTextureType_OPACITY);
- HandleTextures(pcMat,surf.mReflectionTextures,aiTextureType_REFLECTION);
-
- // Now we need to know which shader to use .. iterate through the shader list of
- // the surface and search for a name which we know ...
- for (ShaderList::const_iterator it = surf.mShaders.begin(), end = surf.mShaders.end();it != end;++it) {
- //if (!(*it).enabled)continue;
-
- if ((*it).functionName == "LW_SuperCelShader" || (*it).functionName == "AH_CelShader") {
- DefaultLogger::get()->info("LWO2: Mapping LW_SuperCelShader/AH_CelShader to aiShadingMode_Toon");
-
- m = aiShadingMode_Toon;
- break;
- }
- else if ((*it).functionName == "LW_RealFresnel" || (*it).functionName == "LW_FastFresnel") {
- DefaultLogger::get()->info("LWO2: Mapping LW_RealFresnel/LW_FastFresnel to aiShadingMode_Fresnel");
-
- m = aiShadingMode_Fresnel;
- break;
- }
- else
- {
- DefaultLogger::get()->warn("LWO2: Unknown surface shader: " + (*it).functionName);
- }
- }
- if (surf.mMaximumSmoothAngle <= 0.0f)
- m = aiShadingMode_Flat;
- pcMat->AddProperty((int*)&m,1,AI_MATKEY_SHADING_MODEL);
-
- // (the diffuse value is just a scaling factor)
- // If a diffuse texture is set, we set this value to 1.0
- clr = (b && false ? aiColor3D(1.f,1.f,1.f) : surf.mColor);
- clr.r *= surf.mDiffuseValue;
- clr.g *= surf.mDiffuseValue;
- clr.b *= surf.mDiffuseValue;
- pcMat->AddProperty<aiColor3D>(&clr,1,AI_MATKEY_COLOR_DIFFUSE);
-}
-
-// ------------------------------------------------------------------------------------------------
-char LWOImporter::FindUVChannels(LWO::TextureList& list,
- LWO::Layer& layer,LWO::UVChannel& uv, unsigned int next)
-{
- char ret = 0;
- for (TextureList::iterator it = list.begin(), end = list.end();it != end;++it) {
-
- // Ignore textures with non-UV mappings for the moment.
- if (!(*it).enabled || !(*it).bCanUse || (*it).mapMode != LWO::Texture::UV) {
- continue;
- }
-
- if ((*it).mUVChannelIndex == uv.name) {
- ret = 1;
-
- // got it.
- if ((*it).mRealUVIndex == 0xffffffff || (*it).mRealUVIndex == next)
- {
- (*it).mRealUVIndex = next;
- }
- else {
- // channel mismatch. need to duplicate the material.
- DefaultLogger::get()->warn("LWO: Channel mismatch, would need to duplicate surface [design bug]");
-
- // TODO
- }
- }
- }
- return ret;
-}
-
-// ------------------------------------------------------------------------------------------------
-void LWOImporter::FindUVChannels(LWO::Surface& surf,
- LWO::SortedRep& sorted,LWO::Layer& layer,
- unsigned int out[AI_MAX_NUMBER_OF_TEXTURECOORDS])
-{
- unsigned int next = 0, extra = 0, num_extra = 0;
-
- // Check whether we have an UV entry != 0 for one of the faces in 'sorted'
- for (unsigned int i = 0; i < layer.mUVChannels.size();++i) {
- LWO::UVChannel& uv = layer.mUVChannels[i];
-
- for (LWO::SortedRep::const_iterator it = sorted.begin(); it != sorted.end(); ++it) {
-
- LWO::Face& face = layer.mFaces[*it];
-
- for (unsigned int n = 0; n < face.mNumIndices; ++n) {
- unsigned int idx = face.mIndices[n];
-
- if (uv.abAssigned[idx] && ((aiVector2D*)&uv.rawData[0])[idx] != aiVector2D()) {
-
- if (next >= AI_MAX_NUMBER_OF_TEXTURECOORDS) {
-
- DefaultLogger::get()->error("LWO: Maximum number of UV channels for "
- "this mesh reached. Skipping channel \'" + uv.name + "\'");
-
- }
- else {
- // Search through all textures assigned to 'surf' and look for this UV channel
- char had = 0;
- had |= FindUVChannels(surf.mColorTextures,layer,uv,next);
- had |= FindUVChannels(surf.mDiffuseTextures,layer,uv,next);
- had |= FindUVChannels(surf.mSpecularTextures,layer,uv,next);
- had |= FindUVChannels(surf.mGlossinessTextures,layer,uv,next);
- had |= FindUVChannels(surf.mOpacityTextures,layer,uv,next);
- had |= FindUVChannels(surf.mBumpTextures,layer,uv,next);
- had |= FindUVChannels(surf.mReflectionTextures,layer,uv,next);
-
- if (had != 0) {
-
- // We have a texture referencing this UV channel so we have to take special care of it
- if (num_extra) {
-
- for (unsigned int a = next; a < std::min( extra, AI_MAX_NUMBER_OF_TEXTURECOORDS-1u ); ++a) {
- out[a+1] = out[a];
- }
- }
- ++extra;
- out[next++] = i;
- }
- else {
-
- // Bäh ... seems not to be used at all. Push to end if enough space is available.
- out[extra++] = i;
- ++num_extra;
- }
- }
- it = sorted.end()-1;
- break;
- }
- }
- }
- }
- if (next != AI_MAX_NUMBER_OF_TEXTURECOORDS) {
- out[extra] = 0xffffffff;
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void LWOImporter::FindVCChannels(const LWO::Surface& surf, LWO::SortedRep& sorted, const LWO::Layer& layer,
- unsigned int out[AI_MAX_NUMBER_OF_COLOR_SETS])
-{
- unsigned int next = 0;
-
- // Check whether we have an vc entry != 0 for one of the faces in 'sorted'
- for (unsigned int i = 0; i < layer.mVColorChannels.size();++i) {
- const LWO::VColorChannel& vc = layer.mVColorChannels[i];
-
- if (surf.mVCMap == vc.name) {
- // The vertex color map is explicitely requested by the surface so we need to take special care of it
- for (unsigned int a = 0; a < std::min(next,AI_MAX_NUMBER_OF_COLOR_SETS-1u); ++a) {
- out[a+1] = out[a];
- }
- out[0] = i;
- ++next;
- }
- else {
-
- for (LWO::SortedRep::iterator it = sorted.begin(); it != sorted.end(); ++it) {
- const LWO::Face& face = layer.mFaces[*it];
-
- for (unsigned int n = 0; n < face.mNumIndices; ++n) {
- unsigned int idx = face.mIndices[n];
-
- if (vc.abAssigned[idx] && ((aiColor4D*)&vc.rawData[0])[idx] != aiColor4D(0.f,0.f,0.f,1.f)) {
- if (next >= AI_MAX_NUMBER_OF_COLOR_SETS) {
-
- DefaultLogger::get()->error("LWO: Maximum number of vertex color channels for "
- "this mesh reached. Skipping channel \'" + vc.name + "\'");
-
- }
- else {
- out[next++] = i;
- }
- it = sorted.end()-1;
- break;
- }
- }
- }
- }
- }
- if (next != AI_MAX_NUMBER_OF_COLOR_SETS) {
- out[next] = 0xffffffff;
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void LWOImporter::LoadLWO2ImageMap(unsigned int size, LWO::Texture& tex )
-{
- LE_NCONST uint8_t* const end = mFileBuffer + size;
- while (true)
- {
- if (mFileBuffer + 6 >= end)break;
- LE_NCONST IFF::SubChunkHeader* const head = IFF::LoadSubChunk(mFileBuffer);
-
- if (mFileBuffer + head->length > end)
- throw DeadlyImportError("LWO2: Invalid SURF.BLOCK chunk length");
-
- uint8_t* const next = mFileBuffer+head->length;
- switch (head->type)
- {
- case AI_LWO_PROJ:
- tex.mapMode = (Texture::MappingMode)GetU2();
- break;
- case AI_LWO_WRAP:
- tex.wrapModeWidth = (Texture::Wrap)GetU2();
- tex.wrapModeHeight = (Texture::Wrap)GetU2();
- break;
- case AI_LWO_AXIS:
- tex.majorAxis = (Texture::Axes)GetU2();
- break;
- case AI_LWO_IMAG:
- tex.mClipIdx = GetU2();
- break;
- case AI_LWO_VMAP:
- GetS0(tex.mUVChannelIndex,head->length);
- break;
- case AI_LWO_WRPH:
- tex.wrapAmountH = GetF4();
- break;
- case AI_LWO_WRPW:
- tex.wrapAmountW = GetF4();
- break;
- }
- mFileBuffer = next;
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void LWOImporter::LoadLWO2Procedural(unsigned int size, LWO::Texture& tex )
-{
- // --- not supported at the moment
- DefaultLogger::get()->error("LWO2: Found procedural texture, this is not supported");
- tex.bCanUse = false;
-}
-
-// ------------------------------------------------------------------------------------------------
-void LWOImporter::LoadLWO2Gradient(unsigned int size, LWO::Texture& tex )
-{
- // --- not supported at the moment
- DefaultLogger::get()->error("LWO2: Found gradient texture, this is not supported");
- tex.bCanUse = false;
-}
-
-// ------------------------------------------------------------------------------------------------
-void LWOImporter::LoadLWO2TextureHeader(unsigned int size, LWO::Texture& tex )
-{
- LE_NCONST uint8_t* const end = mFileBuffer + size;
-
- // get the ordinal string
- GetS0( tex.ordinal, size);
-
- // we could crash later if this is an empty string ...
- if (!tex.ordinal.length())
- {
- DefaultLogger::get()->error("LWO2: Ill-formed SURF.BLOK ordinal string");
- tex.ordinal = "\x00";
- }
- while (true)
- {
- if (mFileBuffer + 6 >= end)break;
- LE_NCONST IFF::SubChunkHeader* const head = IFF::LoadSubChunk(mFileBuffer);
-
- if (mFileBuffer + head->length > end)
- throw DeadlyImportError("LWO2: Invalid texture header chunk length");
-
- uint8_t* const next = mFileBuffer+head->length;
- switch (head->type)
- {
- case AI_LWO_CHAN:
- tex.type = GetU4();
- break;
- case AI_LWO_ENAB:
- tex.enabled = GetU2() ? true : false;
- break;
- case AI_LWO_OPAC:
- tex.blendType = (Texture::BlendType)GetU2();
- tex.mStrength = GetF4();
- break;
- }
- mFileBuffer = next;
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void LWOImporter::LoadLWO2TextureBlock(LE_NCONST IFF::SubChunkHeader* head, unsigned int size )
-{
- ai_assert(!mSurfaces->empty());
- LWO::Surface& surf = mSurfaces->back();
- LWO::Texture tex;
-
- // load the texture header
- LoadLWO2TextureHeader(head->length,tex);
- size -= head->length + 6;
-
- // now get the exact type of the texture
- switch (head->type)
- {
- case AI_LWO_PROC:
- LoadLWO2Procedural(size,tex);
- break;
- case AI_LWO_GRAD:
- LoadLWO2Gradient(size,tex);
- break;
- case AI_LWO_IMAP:
- LoadLWO2ImageMap(size,tex);
- }
-
- // get the destination channel
- TextureList* listRef = NULL;
- switch (tex.type)
- {
- case AI_LWO_COLR:
- listRef = &surf.mColorTextures;break;
- case AI_LWO_DIFF:
- listRef = &surf.mDiffuseTextures;break;
- case AI_LWO_SPEC:
- listRef = &surf.mSpecularTextures;break;
- case AI_LWO_GLOS:
- listRef = &surf.mGlossinessTextures;break;
- case AI_LWO_BUMP:
- listRef = &surf.mBumpTextures;break;
- case AI_LWO_TRAN:
- listRef = &surf.mOpacityTextures;break;
- case AI_LWO_REFL:
- listRef = &surf.mReflectionTextures;break;
- default:
- DefaultLogger::get()->warn("LWO2: Encountered unknown texture type");
- return;
- }
-
- // now attach the texture to the parent surface - sort by ordinal string
- for (TextureList::iterator it = listRef->begin();it != listRef->end(); ++it) {
- if (::strcmp(tex.ordinal.c_str(),(*it).ordinal.c_str()) < 0) {
- listRef->insert(it,tex);
- return;
- }
- }
- listRef->push_back(tex);
-}
-
-// ------------------------------------------------------------------------------------------------
-void LWOImporter::LoadLWO2ShaderBlock(LE_NCONST IFF::SubChunkHeader* head, unsigned int size )
-{
- LE_NCONST uint8_t* const end = mFileBuffer + size;
-
- ai_assert(!mSurfaces->empty());
- LWO::Surface& surf = mSurfaces->back();
- LWO::Shader shader;
-
- // get the ordinal string
- GetS0( shader.ordinal, size);
-
- // we could crash later if this is an empty string ...
- if (!shader.ordinal.length())
- {
- DefaultLogger::get()->error("LWO2: Ill-formed SURF.BLOK ordinal string");
- shader.ordinal = "\x00";
- }
-
- // read the header
- while (true)
- {
- if (mFileBuffer + 6 >= end)break;
- LE_NCONST IFF::SubChunkHeader* const head = IFF::LoadSubChunk(mFileBuffer);
-
- if (mFileBuffer + head->length > end)
- throw DeadlyImportError("LWO2: Invalid shader header chunk length");
-
- uint8_t* const next = mFileBuffer+head->length;
- switch (head->type)
- {
- case AI_LWO_ENAB:
- shader.enabled = GetU2() ? true : false;
- break;
-
- case AI_LWO_FUNC:
- GetS0( shader.functionName, head->length );
- }
- mFileBuffer = next;
- }
-
- // now attach the shader to the parent surface - sort by ordinal string
- for (ShaderList::iterator it = surf.mShaders.begin();it != surf.mShaders.end(); ++it) {
- if (::strcmp(shader.ordinal.c_str(),(*it).ordinal.c_str()) < 0) {
- surf.mShaders.insert(it,shader);
- return;
- }
- }
- surf.mShaders.push_back(shader);
-}
-
-// ------------------------------------------------------------------------------------------------
-void LWOImporter::LoadLWO2Surface(unsigned int size)
-{
- LE_NCONST uint8_t* const end = mFileBuffer + size;
-
- mSurfaces->push_back( LWO::Surface () );
- LWO::Surface& surf = mSurfaces->back();
-
- GetS0(surf.mName,size);
-
- // check whether this surface was derived from any other surface
- std::string derived;
- GetS0(derived,(unsigned int)(end - mFileBuffer));
- if (derived.length()) {
- // yes, find this surface
- for (SurfaceList::iterator it = mSurfaces->begin(), end = mSurfaces->end()-1; it != end; ++it) {
- if ((*it).mName == derived) {
- // we have it ...
- surf = *it;
- derived.clear();break;
- }
- }
- if (derived.size())
- DefaultLogger::get()->warn("LWO2: Unable to find source surface: " + derived);
- }
-
- while (true)
- {
- if (mFileBuffer + 6 >= end)
- break;
- LE_NCONST IFF::SubChunkHeader* const head = IFF::LoadSubChunk(mFileBuffer);
-
- if (mFileBuffer + head->length > end)
- throw DeadlyImportError("LWO2: Invalid surface chunk length");
-
- uint8_t* const next = mFileBuffer+head->length;
- switch (head->type)
- {
- // diffuse color
- case AI_LWO_COLR:
- {
- AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,COLR,12);
- surf.mColor.r = GetF4();
- surf.mColor.g = GetF4();
- surf.mColor.b = GetF4();
- break;
- }
- // diffuse strength ... hopefully
- case AI_LWO_DIFF:
- {
- AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,DIFF,4);
- surf.mDiffuseValue = GetF4();
- break;
- }
- // specular strength ... hopefully
- case AI_LWO_SPEC:
- {
- AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,SPEC,4);
- surf.mSpecularValue = GetF4();
- break;
- }
- // transparency
- case AI_LWO_TRAN:
- {
- // transparency explicitly disabled?
- if (surf.mTransparency == 10e10f)
- break;
-
- AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,TRAN,4);
- surf.mTransparency = GetF4();
- break;
- }
- // additive transparency
- case AI_LWO_ADTR:
- {
- AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,ADTR,4);
- surf.mAdditiveTransparency = GetF4();
- break;
- }
- // wireframe mode
- case AI_LWO_LINE:
- {
- AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,LINE,2);
- if (GetU2() & 0x1)
- surf.mWireframe = true;
- break;
- }
- // glossiness
- case AI_LWO_GLOS:
- {
- AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,GLOS,4);
- surf.mGlossiness = GetF4();
- break;
- }
- // bump intensity
- case AI_LWO_BUMP:
- {
- AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,BUMP,4);
- surf.mBumpIntensity = GetF4();
- break;
- }
- // color highlights
- case AI_LWO_CLRH:
- {
- AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,CLRH,4);
- surf.mColorHighlights = GetF4();
- break;
- }
- // index of refraction
- case AI_LWO_RIND:
- {
- AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,RIND,4);
- surf.mIOR = GetF4();
- break;
- }
- // polygon sidedness
- case AI_LWO_SIDE:
- {
- AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,SIDE,2);
- surf.bDoubleSided = (3 == GetU2());
- break;
- }
- // maximum smoothing angle
- case AI_LWO_SMAN:
- {
- AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,SMAN,4);
- surf.mMaximumSmoothAngle = fabs( GetF4() );
- break;
- }
- // vertex color channel to be applied to the surface
- case AI_LWO_VCOL:
- {
- AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,VCOL,12);
- surf.mDiffuseValue *= GetF4(); // strength
- ReadVSizedIntLWO2(mFileBuffer); // skip envelope
- surf.mVCMapType = GetU4(); // type of the channel
-
- // name of the channel
- GetS0(surf.mVCMap, (unsigned int) (next - mFileBuffer ));
- break;
- }
- // surface bock entry
- case AI_LWO_BLOK:
- {
- AI_LWO_VALIDATE_CHUNK_LENGTH(head->length,BLOK,4);
- LE_NCONST IFF::SubChunkHeader* head2 = IFF::LoadSubChunk(mFileBuffer);
-
- switch (head2->type)
- {
- case AI_LWO_PROC:
- case AI_LWO_GRAD:
- case AI_LWO_IMAP:
- LoadLWO2TextureBlock(head2, head->length);
- break;
- case AI_LWO_SHDR:
- LoadLWO2ShaderBlock(head2, head->length);
- break;
-
- default:
- DefaultLogger::get()->warn("LWO2: Found an unsupported surface BLOK");
- };
-
- break;
- }
- }
- mFileBuffer = next;
- }
-}
-
-#endif // !! ASSIMP_BUILD_NO_X_IMPORTER
diff --git a/3rdparty/assimp/code/LWSLoader.cpp b/3rdparty/assimp/code/LWSLoader.cpp
deleted file mode 100644
index 6a22b111..00000000
--- a/3rdparty/assimp/code/LWSLoader.cpp
+++ /dev/null
@@ -1,885 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file LWSLoader.cpp
- * @brief Implementation of the LWS importer class
- */
-
-#include "AssimpPCH.h"
-
-#include "LWSLoader.h"
-#include "ParsingUtils.h"
-#include "fast_atof.h"
-
-#include "SceneCombiner.h"
-#include "GenericProperty.h"
-#include "SkeletonMeshBuilder.h"
-#include "ConvertToLHProcess.h"
-
-using namespace Assimp;
-
-// ------------------------------------------------------------------------------------------------
-// Recursive parsing of LWS files
-void LWS::Element::Parse (const char*& buffer)
-{
- for (;SkipSpacesAndLineEnd(&buffer);SkipLine(&buffer)) {
-
- // begin of a new element with children
- bool sub = false;
- if (*buffer == '{') {
- ++buffer;
- SkipSpaces(&buffer);
- sub = true;
- }
- else if (*buffer == '}')
- return;
-
- children.push_back(Element());
-
- // copy data line - read token per token
-
- const char* cur = buffer;
- while (!IsSpaceOrNewLine(*buffer)) ++buffer;
- children.back().tokens[0] = std::string(cur,(size_t) (buffer-cur));
- SkipSpaces(&buffer);
-
- if (children.back().tokens[0] == "Plugin")
- {
- DefaultLogger::get()->debug("LWS: Skipping over plugin-specific data");
-
- // strange stuff inside Plugin/Endplugin blocks. Needn't
- // follow LWS syntax, so we skip over it
- for (;SkipSpacesAndLineEnd(&buffer);SkipLine(&buffer)) {
- if (!::strncmp(buffer,"EndPlugin",9)) {
- //SkipLine(&buffer);
- break;
- }
- }
- continue;
- }
-
- cur = buffer;
- while (!IsLineEnd(*buffer)) ++buffer;
- children.back().tokens[1] = std::string(cur,(size_t) (buffer-cur));
-
- // parse more elements recursively
- if (sub)
- children.back().Parse(buffer);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-LWSImporter::LWSImporter()
-{
- // nothing to do here
-}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-LWSImporter::~LWSImporter()
-{
- // nothing to do here
-}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the class can handle the format of the given file.
-bool LWSImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler,bool checkSig) const
-{
- const std::string extension = GetExtension(pFile);
- if (extension == "lws" || extension == "mot")
- return true;
-
- // if check for extension is not enough, check for the magic tokens LWSC and LWMO
- if (!extension.length() || checkSig) {
- uint32_t tokens[2];
- tokens[0] = AI_MAKE_MAGIC("LWSC");
- tokens[1] = AI_MAKE_MAGIC("LWMO");
- return CheckMagicToken(pIOHandler,pFile,tokens,2);
- }
- return false;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Get list of file extensions
-void LWSImporter::GetExtensionList(std::set<std::string>& extensions)
-{
- extensions.insert("lws");
- extensions.insert("mot");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Setup configuration properties
-void LWSImporter::SetupProperties(const Importer* pImp)
-{
- // AI_CONFIG_FAVOUR_SPEED
- configSpeedFlag = (0 != pImp->GetPropertyInteger(AI_CONFIG_FAVOUR_SPEED,0));
-
- // AI_CONFIG_IMPORT_LWS_ANIM_START
- first = pImp->GetPropertyInteger(AI_CONFIG_IMPORT_LWS_ANIM_START,
- 150392 /* magic hack */);
-
- // AI_CONFIG_IMPORT_LWS_ANIM_END
- last = pImp->GetPropertyInteger(AI_CONFIG_IMPORT_LWS_ANIM_END,
- 150392 /* magic hack */);
-
- if (last < first) {
- std::swap(last,first);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Read an envelope description
-void LWSImporter::ReadEnvelope(const LWS::Element& dad, LWO::Envelope& fill )
-{
- if (dad.children.empty()) {
- DefaultLogger::get()->error("LWS: Envelope descriptions must not be empty");
- return;
- }
-
- // reserve enough storage
- std::list< LWS::Element >::const_iterator it = dad.children.begin();;
- fill.keys.reserve(strtol10(it->tokens[1].c_str()));
-
- for (++it; it != dad.children.end(); ++it) {
- const char* c = (*it).tokens[1].c_str();
-
- if ((*it).tokens[0] == "Key") {
- fill.keys.push_back(LWO::Key());
- LWO::Key& key = fill.keys.back();
-
- float f;
- SkipSpaces(&c);
- c = fast_atof_move(c,key.value);
- SkipSpaces(&c);
- c = fast_atof_move(c,f);
-
- key.time = f;
-
- unsigned int span = strtol10(c,&c), num = 0;
- switch (span) {
-
- case 0:
- key.inter = LWO::IT_TCB;
- num = 5;
- break;
- case 1:
- case 2:
- key.inter = LWO::IT_HERM;
- num = 5;
- break;
- case 3:
- key.inter = LWO::IT_LINE;
- num = 0;
- break;
- case 4:
- key.inter = LWO::IT_STEP;
- num = 0;
- break;
- case 5:
- key.inter = LWO::IT_BEZ2;
- num = 4;
- break;
- default:
- DefaultLogger::get()->error("LWS: Unknown span type");
- }
- for (unsigned int i = 0; i < num;++i) {
- SkipSpaces(&c);
- c = fast_atof_move(c,key.params[i]);
- }
- }
- else if ((*it).tokens[0] == "Behaviors") {
- SkipSpaces(&c);
- fill.pre = (LWO::PrePostBehaviour) strtol10(c,&c);
- SkipSpaces(&c);
- fill.post = (LWO::PrePostBehaviour) strtol10(c,&c);
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Read animation channels in the old LightWave animation format
-void LWSImporter::ReadEnvelope_Old(
- std::list< LWS::Element >::const_iterator& it,
- const std::list< LWS::Element >::const_iterator& end,
- LWS::NodeDesc& nodes,
- unsigned int version)
-{
- unsigned int num,sub_num;
- if (++it == end)goto unexpected_end;
-
- num = strtol10((*it).tokens[0].c_str());
- for (unsigned int i = 0; i < num; ++i) {
-
- nodes.channels.push_back(LWO::Envelope());
- LWO::Envelope& envl = nodes.channels.back();
-
- envl.index = i;
- envl.type = (LWO::EnvelopeType)(i+1);
-
- if (++it == end)goto unexpected_end;
- sub_num = strtol10((*it).tokens[0].c_str());
-
- for (unsigned int n = 0; n < sub_num;++n) {
-
- if (++it == end)goto unexpected_end;
-
- // parse value and time, skip the rest for the moment.
- LWO::Key key;
- const char* c = fast_atof_move((*it).tokens[0].c_str(),key.value);
- SkipSpaces(&c);
- float f;
- fast_atof_move((*it).tokens[0].c_str(),f);
- key.time = f;
-
- envl.keys.push_back(key);
- }
- }
- return;
-
-unexpected_end:
- DefaultLogger::get()->error("LWS: Encountered unexpected end of file while parsing object motion");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Setup a nice name for a node
-void LWSImporter::SetupNodeName(aiNode* nd, LWS::NodeDesc& src)
-{
- const unsigned int combined = src.number | ((unsigned int)src.type) << 28u;
-
- // the name depends on the type. We break LWS's strange naming convention
- // and return human-readable, but still machine-parsable and unique, strings.
- if (src.type == LWS::NodeDesc::OBJECT) {
-
- if (src.path.length()) {
- std::string::size_type s = src.path.find_last_of("\\/");
- if (s == std::string::npos)
- s = 0;
- else ++s;
-
- nd->mName.length = ::sprintf(nd->mName.data,"%s_(%08X)",src.path.substr(s).c_str(),combined);
- return;
- }
- }
- nd->mName.length = ::sprintf(nd->mName.data,"%s_(%08X)",src.name,combined);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Recursively build the scenegraph
-void LWSImporter::BuildGraph(aiNode* nd, LWS::NodeDesc& src, std::vector<AttachmentInfo>& attach,
- BatchLoader& batch,
- aiCamera**& camOut,
- aiLight**& lightOut,
- std::vector<aiNodeAnim*>& animOut)
-{
- // Setup a very cryptic name for the node, we want the user to be happy
- SetupNodeName(nd,src);
-
- // If this is an object from an external file - get the scene and setup proper attachment tags
- aiScene* obj = NULL;
- if (src.type == LWS::NodeDesc::OBJECT && src.path.length() ) {
- obj = batch.GetImport(src.id);
- if (!obj) {
- DefaultLogger::get()->error("LWS: Failed to read external file " + src.path);
- }
- else {
- attach.push_back(AttachmentInfo(obj,nd));
- }
- }
-
- // If object is a light source - setup a corresponding ai structure
- else if (src.type == LWS::NodeDesc::LIGHT) {
- aiLight* lit = *lightOut++ = new aiLight();
-
- // compute final light color
- lit->mColorDiffuse = lit->mColorSpecular = src.lightColor*src.lightIntensity;
-
- // name to attach light to node -> unique due to LWs indexing system
- lit->mName = nd->mName;
-
- // detemine light type and setup additional members
- if (src.lightType == 2) { /* spot light */
-
- lit->mType = aiLightSource_SPOT;
- lit->mAngleInnerCone = (float)AI_DEG_TO_RAD( src.lightConeAngle );
- lit->mAngleOuterCone = lit->mAngleInnerCone+(float)AI_DEG_TO_RAD( src.lightEdgeAngle );
-
- }
- else if (src.lightType == 1) { /* directional light source */
- lit->mType = aiLightSource_DIRECTIONAL;
- }
- else lit->mType = aiLightSource_POINT;
-
- // fixme: no proper handling of light falloffs yet
- if (src.lightFalloffType == 1)
- lit->mAttenuationConstant = 1.f;
- else if (src.lightFalloffType == 1)
- lit->mAttenuationLinear = 1.f;
- else
- lit->mAttenuationQuadratic = 1.f;
- }
-
- // If object is a camera - setup a corresponding ai structure
- else if (src.type == LWS::NodeDesc::CAMERA) {
- aiCamera* cam = *camOut++ = new aiCamera();
-
- // name to attach cam to node -> unique due to LWs indexing system
- cam->mName = nd->mName;
- }
-
- // Get the node transformation from the LWO key
- LWO::AnimResolver resolver(src.channels,fps);
- resolver.ExtractBindPose(nd->mTransformation);
-
- // .. and construct animation channels
- aiNodeAnim* anim = NULL;
-
- if (first != last) {
- resolver.SetAnimationRange(first,last);
- resolver.ExtractAnimChannel(&anim,AI_LWO_ANIM_FLAG_SAMPLE_ANIMS|AI_LWO_ANIM_FLAG_START_AT_ZERO);
- if (anim) {
- anim->mNodeName = nd->mName;
- animOut.push_back(anim);
- }
- }
-
- // process pivot point, if any
- if (src.pivotPos != aiVector3D()) {
- aiMatrix4x4 tmp;
- aiMatrix4x4::Translation(-src.pivotPos,tmp);
-
- if (anim) {
-
- // We have an animation channel for this node. Problem: to combine the pivot
- // point with the node anims, we'd need to interpolate *all* keys, get
- // transformation matrices from them, apply the translation and decompose
- // the resulting matrices again in order to reconstruct the keys. This
- // solution here is *much* easier ... we're just inserting an extra node
- // in the hierarchy.
- // Maybe the final optimization here will be done during postprocessing.
-
- aiNode* pivot = new aiNode();
- pivot->mName.length = sprintf( pivot->mName.data, "$Pivot_%s",nd->mName.data);
- pivot->mTransformation = tmp;
-
- pivot->mChildren = new aiNode*[pivot->mNumChildren = 1];
- pivot->mChildren[0] = nd;
-
- pivot->mParent = nd->mParent;
- nd->mParent = pivot;
-
- // swap children and hope the parents wont see a huge difference
- pivot->mParent->mChildren[pivot->mParent->mNumChildren-1] = pivot;
- }
- else {
- nd->mTransformation = tmp*nd->mTransformation;
- }
- }
-
- // Add children
- if (src.children.size()) {
- nd->mChildren = new aiNode*[src.children.size()];
- for (std::list<LWS::NodeDesc*>::iterator it = src.children.begin(); it != src.children.end(); ++it) {
- aiNode* ndd = nd->mChildren[nd->mNumChildren++] = new aiNode();
- ndd->mParent = nd;
-
- BuildGraph(ndd,**it,attach,batch,camOut,lightOut,animOut);
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Determine the exact location of a LWO file
-std::string LWSImporter::FindLWOFile(const std::string& in)
-{
- // insert missing directory seperator if necessary
- std::string tmp;
- if (in.length() > 3 && in[1] == ':'&& in[2] != '\\' && in[2] != '/')
- {
- tmp = in[0] + ":\\" + in.substr(2);
- }
- else tmp = in;
-
- if (io->Exists(tmp))
- return in;
-
- // file is not accessible for us ... maybe it's packed by
- // LightWave's 'Package Scene' command?
-
- // Relevant for us are the following two directories:
- // <folder>\Objects\<hh>\<*>.lwo
- // <folder>\Scenes\<hh>\<*>.lws
- // where <hh> is optional.
-
- std::string test = ".." + io->getOsSeparator() + tmp;
- if (io->Exists(test))
- return test;
-
- test = ".." + io->getOsSeparator() + test;
- if (io->Exists(test))
- return test;
-
- // return original path, maybe the IOsystem knows better
- return tmp;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Read file into given scene data structure
-void LWSImporter::InternReadFile( const std::string& pFile, aiScene* pScene,
- IOSystem* pIOHandler)
-{
- io = pIOHandler;
- boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
-
- // Check whether we can read from the file
- if ( file.get() == NULL) {
- throw DeadlyImportError( "Failed to open LWS file " + pFile + ".");
- }
-
- // Allocate storage and copy the contents of the file to a memory buffer
- std::vector< char > mBuffer;
- TextFileToBuffer(file.get(),mBuffer);
-
- // Parse the file structure
- LWS::Element root; const char* dummy = &mBuffer[0];
- root.Parse(dummy);
-
- // Construct a Batchimporter to read more files recursively
- BatchLoader batch(pIOHandler);
-// batch.SetBasePath(pFile);
-
- // Construct an array to receive the flat output graph
- std::list<LWS::NodeDesc> nodes;
-
- unsigned int cur_light = 0, cur_camera = 0, cur_object = 0;
- unsigned int num_light = 0, num_camera = 0, num_object = 0;
-
- // check magic identifier, 'LWSC'
- bool motion_file = false;
- std::list< LWS::Element >::const_iterator it = root.children.begin();
-
- if ((*it).tokens[0] == "LWMO")
- motion_file = true;
-
- if ((*it).tokens[0] != "LWSC" && !motion_file)
- throw DeadlyImportError("LWS: Not a LightWave scene, magic tag LWSC not found");
-
- // get file format version and print to log
- ++it;
- unsigned int version = strtol10((*it).tokens[0].c_str());
- DefaultLogger::get()->info("LWS file format version is " + (*it).tokens[0]);
- first = 0.;
- last = 60.;
- fps = 25.; /* seems to be a good default frame rate */
-
- // Now read all elements in a very straghtforward manner
- for (; it != root.children.end(); ++it) {
- const char* c = (*it).tokens[1].c_str();
-
- // 'FirstFrame': begin of animation slice
- if ((*it).tokens[0] == "FirstFrame") {
- if (150392. != first /* see SetupProperties() */)
- first = strtol10(c,&c)-1.; /* we're zero-based */
- }
-
- // 'LastFrame': end of animation slice
- else if ((*it).tokens[0] == "LastFrame") {
- if (150392. != last /* see SetupProperties() */)
- last = strtol10(c,&c)-1.; /* we're zero-based */
- }
-
- // 'FramesPerSecond': frames per second
- else if ((*it).tokens[0] == "FramesPerSecond") {
- fps = strtol10(c,&c);
- }
-
- // 'LoadObjectLayer': load a layer of a specific LWO file
- else if ((*it).tokens[0] == "LoadObjectLayer") {
-
- // get layer index
- const int layer = strtol10(c,&c);
-
- // setup the layer to be loaded
- BatchLoader::PropertyMap props;
- SetGenericProperty(props.ints,AI_CONFIG_IMPORT_LWO_ONE_LAYER_ONLY,layer);
-
- // add node to list
- LWS::NodeDesc d;
- d.type = LWS::NodeDesc::OBJECT;
- if (version >= 4) { // handle LWSC 4 explicit ID
- SkipSpaces(&c);
- d.number = strtol16(c,&c) & AI_LWS_MASK;
- }
- else d.number = cur_object++;
-
- // and add the file to the import list
- SkipSpaces(&c);
- std::string path = FindLWOFile( c );
- d.path = path;
- d.id = batch.AddLoadRequest(path,0,&props);
-
- nodes.push_back(d);
- num_object++;
- }
- // 'LoadObject': load a LWO file into the scenegraph
- else if ((*it).tokens[0] == "LoadObject") {
-
- // add node to list
- LWS::NodeDesc d;
- d.type = LWS::NodeDesc::OBJECT;
-
- if (version >= 4) { // handle LWSC 4 explicit ID
- d.number = strtol16(c,&c) & AI_LWS_MASK;
- SkipSpaces(&c);
- }
- else d.number = cur_object++;
- std::string path = FindLWOFile( c );
- d.id = batch.AddLoadRequest(path,0,NULL);
-
- d.path = path;
- nodes.push_back(d);
- num_object++;
- }
- // 'AddNullObject': add a dummy node to the hierarchy
- else if ((*it).tokens[0] == "AddNullObject") {
-
- // add node to list
- LWS::NodeDesc d;
- d.type = LWS::NodeDesc::OBJECT;
- d.name = c;
- if (version >= 4) { // handle LWSC 4 explicit ID
- d.number = strtol16(c,&c) & AI_LWS_MASK;
- }
- else d.number = cur_object++;
- nodes.push_back(d);
-
- num_object++;
- }
- // 'NumChannels': Number of envelope channels assigned to last layer
- else if ((*it).tokens[0] == "NumChannels") {
- // ignore for now
- }
- // 'Channel': preceedes any envelope description
- else if ((*it).tokens[0] == "Channel") {
- if (nodes.empty()) {
- if (motion_file) {
-
- // LightWave motion file. Add dummy node
- LWS::NodeDesc d;
- d.type = LWS::NodeDesc::OBJECT;
- d.name = c;
- d.number = cur_object++;
- nodes.push_back(d);
- }
- else DefaultLogger::get()->error("LWS: Unexpected keyword: \'Channel\'");
- }
-
- // important: index of channel
- nodes.back().channels.push_back(LWO::Envelope());
- LWO::Envelope& env = nodes.back().channels.back();
-
- env.index = strtol10(c);
-
- // currently we can just interpret the standard channels 0...9
- // (hack) assume that index-i yields the binary channel type from LWO
- env.type = (LWO::EnvelopeType)(env.index+1);
-
- }
- // 'Envelope': a single animation channel
- else if ((*it).tokens[0] == "Envelope") {
- if (nodes.empty() || nodes.back().channels.empty())
- DefaultLogger::get()->error("LWS: Unexpected keyword: \'Envelope\'");
- else {
- ReadEnvelope((*it),nodes.back().channels.back());
- }
- }
- // 'ObjectMotion': animation information for older lightwave formats
- else if (version < 3 && ((*it).tokens[0] == "ObjectMotion" ||
- (*it).tokens[0] == "CameraMotion" ||
- (*it).tokens[0] == "LightMotion")) {
-
- if (nodes.empty())
- DefaultLogger::get()->error("LWS: Unexpected keyword: \'<Light|Object|Camera>Motion\'");
- else {
- ReadEnvelope_Old(it,root.children.end(),nodes.back(),version);
- }
- }
- // 'Pre/PostBehavior': pre/post animation behaviour for LWSC 2
- else if (version == 2 && (*it).tokens[0] == "Pre/PostBehavior") {
- if (nodes.empty())
- DefaultLogger::get()->error("LWS: Unexpected keyword: \'Pre/PostBehavior'");
- else {
- for (std::list<LWO::Envelope>::iterator it = nodes.back().channels.begin(); it != nodes.back().channels.end(); ++it) {
- // two ints per envelope
- LWO::Envelope& env = *it;
- env.pre = (LWO::PrePostBehaviour) strtol10(c,&c); SkipSpaces(&c);
- env.post = (LWO::PrePostBehaviour) strtol10(c,&c); SkipSpaces(&c);
- }
- }
- }
- // 'ParentItem': specifies the parent of the current element
- else if ((*it).tokens[0] == "ParentItem") {
- if (nodes.empty())
- DefaultLogger::get()->error("LWS: Unexpected keyword: \'ParentItem\'");
-
- else nodes.back().parent = strtol16(c,&c);
- }
- // 'ParentObject': deprecated one for older formats
- else if (version < 3 && (*it).tokens[0] == "ParentObject") {
- if (nodes.empty())
- DefaultLogger::get()->error("LWS: Unexpected keyword: \'ParentObject\'");
-
- else {
- nodes.back().parent = strtol10(c,&c) | (1u << 28u);
- }
- }
- // 'AddCamera': add a camera to the scenegraph
- else if ((*it).tokens[0] == "AddCamera") {
-
- // add node to list
- LWS::NodeDesc d;
- d.type = LWS::NodeDesc::CAMERA;
-
- if (version >= 4) { // handle LWSC 4 explicit ID
- d.number = strtol16(c,&c) & AI_LWS_MASK;
- }
- else d.number = cur_camera++;
- nodes.push_back(d);
-
- num_camera++;
- }
- // 'CameraName': set name of currently active camera
- else if ((*it).tokens[0] == "CameraName") {
- if (nodes.empty() || nodes.back().type != LWS::NodeDesc::CAMERA)
- DefaultLogger::get()->error("LWS: Unexpected keyword: \'CameraName\'");
-
- else nodes.back().name = c;
- }
- // 'AddLight': add a light to the scenegraph
- else if ((*it).tokens[0] == "AddLight") {
-
- // add node to list
- LWS::NodeDesc d;
- d.type = LWS::NodeDesc::LIGHT;
-
- if (version >= 4) { // handle LWSC 4 explicit ID
- d.number = strtol16(c,&c) & AI_LWS_MASK;
- }
- else d.number = cur_light++;
- nodes.push_back(d);
-
- num_light++;
- }
- // 'LightName': set name of currently active light
- else if ((*it).tokens[0] == "LightName") {
- if (nodes.empty() || nodes.back().type != LWS::NodeDesc::LIGHT)
- DefaultLogger::get()->error("LWS: Unexpected keyword: \'LightName\'");
-
- else nodes.back().name = c;
- }
- // 'LightIntensity': set intensity of currently active light
- else if ((*it).tokens[0] == "LightIntensity" || (*it).tokens[0] == "LgtIntensity" ) {
- if (nodes.empty() || nodes.back().type != LWS::NodeDesc::LIGHT)
- DefaultLogger::get()->error("LWS: Unexpected keyword: \'LightIntensity\'");
-
- else fast_atof_move(c, nodes.back().lightIntensity );
-
- }
- // 'LightType': set type of currently active light
- else if ((*it).tokens[0] == "LightType") {
- if (nodes.empty() || nodes.back().type != LWS::NodeDesc::LIGHT)
- DefaultLogger::get()->error("LWS: Unexpected keyword: \'LightType\'");
-
- else nodes.back().lightType = strtol10(c);
-
- }
- // 'LightFalloffType': set falloff type of currently active light
- else if ((*it).tokens[0] == "LightFalloffType") {
- if (nodes.empty() || nodes.back().type != LWS::NodeDesc::LIGHT)
- DefaultLogger::get()->error("LWS: Unexpected keyword: \'LightFalloffType\'");
-
- else nodes.back().lightFalloffType = strtol10(c);
-
- }
- // 'LightConeAngle': set cone angle of currently active light
- else if ((*it).tokens[0] == "LightConeAngle") {
- if (nodes.empty() || nodes.back().type != LWS::NodeDesc::LIGHT)
- DefaultLogger::get()->error("LWS: Unexpected keyword: \'LightConeAngle\'");
-
- else nodes.back().lightConeAngle = fast_atof(c);
-
- }
- // 'LightEdgeAngle': set area where we're smoothing from min to max intensity
- else if ((*it).tokens[0] == "LightEdgeAngle") {
- if (nodes.empty() || nodes.back().type != LWS::NodeDesc::LIGHT)
- DefaultLogger::get()->error("LWS: Unexpected keyword: \'LightEdgeAngle\'");
-
- else nodes.back().lightEdgeAngle = fast_atof(c);
-
- }
- // 'LightColor': set color of currently active light
- else if ((*it).tokens[0] == "LightColor") {
- if (nodes.empty() || nodes.back().type != LWS::NodeDesc::LIGHT)
- DefaultLogger::get()->error("LWS: Unexpected keyword: \'LightColor\'");
-
- else {
- c = fast_atof_move(c, (float&) nodes.back().lightColor.r );
- SkipSpaces(&c);
- c = fast_atof_move(c, (float&) nodes.back().lightColor.g );
- SkipSpaces(&c);
- c = fast_atof_move(c, (float&) nodes.back().lightColor.b );
- }
- }
-
- // 'PivotPosition': position of local transformation origin
- else if ((*it).tokens[0] == "PivotPosition" || (*it).tokens[0] == "PivotPoint") {
- if (nodes.empty())
- DefaultLogger::get()->error("LWS: Unexpected keyword: \'PivotPosition\'");
- else {
- c = fast_atof_move(c, (float&) nodes.back().pivotPos.x );
- SkipSpaces(&c);
- c = fast_atof_move(c, (float&) nodes.back().pivotPos.y );
- SkipSpaces(&c);
- c = fast_atof_move(c, (float&) nodes.back().pivotPos.z );
- }
- }
- }
-
- // resolve parenting
- for (std::list<LWS::NodeDesc>::iterator it = nodes.begin(); it != nodes.end(); ++it) {
-
- // check whether there is another node which calls us a parent
- for (std::list<LWS::NodeDesc>::iterator dit = nodes.begin(); dit != nodes.end(); ++dit) {
- if (dit != it && *it == (*dit).parent) {
- if ((*dit).parent_resolved) {
- // fixme: it's still possible to produce an overflow due to cross references ..
- DefaultLogger::get()->error("LWS: Found cross reference in scenegraph");
- continue;
- }
-
- (*it).children.push_back(&*dit);
- (*dit).parent_resolved = &*it;
- }
- }
- }
-
- // find out how many nodes have no parent yet
- unsigned int no_parent = 0;
- for (std::list<LWS::NodeDesc>::iterator it = nodes.begin(); it != nodes.end(); ++it) {
- if (!(*it).parent_resolved)
- ++ no_parent;
- }
- if (!no_parent)
- throw DeadlyImportError("LWS: Unable to find scene root node");
-
-
- // Load all subsequent files
- batch.LoadAll();
-
- // and build the final output graph by attaching the loaded external
- // files to ourselves. first build a master graph
- aiScene* master = new aiScene();
- aiNode* nd = master->mRootNode = new aiNode();
-
- // allocate storage for cameras&lights
- if (num_camera) {
- master->mCameras = new aiCamera*[master->mNumCameras = num_camera];
- }
- aiCamera** cams = master->mCameras;
- if (num_light) {
- master->mLights = new aiLight*[master->mNumLights = num_light];
- }
- aiLight** lights = master->mLights;
-
- std::vector<AttachmentInfo> attach;
- std::vector<aiNodeAnim*> anims;
-
- nd->mName.Set("<LWSRoot>");
- nd->mChildren = new aiNode*[no_parent];
- for (std::list<LWS::NodeDesc>::iterator it = nodes.begin(); it != nodes.end(); ++it) {
- if (!(*it).parent_resolved) {
- aiNode* ro = nd->mChildren[ nd->mNumChildren++ ] = new aiNode();
- ro->mParent = nd;
-
- // ... and build the scene graph. If we encounter object nodes,
- // add then to our attachment table.
- BuildGraph(ro,*it, attach, batch, cams, lights, anims);
- }
- }
-
- // create a master animation channel for us
- if (anims.size()) {
- master->mAnimations = new aiAnimation*[master->mNumAnimations = 1];
- aiAnimation* anim = master->mAnimations[0] = new aiAnimation();
- anim->mName.Set("LWSMasterAnim");
-
- // LWS uses seconds as time units, but we convert to frames
- anim->mTicksPerSecond = fps;
- anim->mDuration = last-(first-1); /* fixme ... zero or one-based?*/
-
- anim->mChannels = new aiNodeAnim*[anim->mNumChannels = anims.size()];
- std::copy(anims.begin(),anims.end(),anim->mChannels);
- }
-
- // convert the master scene to RH
- MakeLeftHandedProcess monster_cheat;
- monster_cheat.Execute(master);
-
- // .. ccw
- FlipWindingOrderProcess flipper;
- flipper.Execute(pScene);
-
- // OK ... finally build the output graph
- SceneCombiner::MergeScenes(&pScene,master,attach,
- AI_INT_MERGE_SCENE_GEN_UNIQUE_NAMES | (!configSpeedFlag ? (
- AI_INT_MERGE_SCENE_GEN_UNIQUE_NAMES_IF_NECESSARY | AI_INT_MERGE_SCENE_GEN_UNIQUE_MATNAMES) : 0));
-
- // Check flags
- if (!pScene->mNumMeshes || !pScene->mNumMaterials) {
- pScene->mFlags |= AI_SCENE_FLAGS_INCOMPLETE;
-
- if (pScene->mNumAnimations) {
- // construct skeleton mesh
- SkeletonMeshBuilder builder(pScene);
- }
- }
-
-}
diff --git a/3rdparty/assimp/code/LWSLoader.h b/3rdparty/assimp/code/LWSLoader.h
deleted file mode 100644
index e9266dd4..00000000
--- a/3rdparty/assimp/code/LWSLoader.h
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file LWSLoader.h
- * @brief Declaration of the LightWave scene importer class.
- */
-#ifndef AI_LWSLOADER_H_INCLUDED
-#define AI_LWSLOADER_H_INCLUDED
-
-#include "LWOFileData.h"
-#include "SceneCombiner.h"
-
-namespace Assimp {
- namespace LWS {
-
-// ---------------------------------------------------------------------------
-/** Represents an element in a LWS file.
- *
- * This can either be a single data line - <name> <value> or a data
- * group - { name <data_line0> ... n }
- */
-class Element
-{
-public:
- Element()
- {}
-
- // first: name, second: rest
- std::string tokens[2];
- std::list<Element> children;
-
- //! Recursive parsing function
- void Parse (const char*& buffer);
-};
-
-#define AI_LWS_MASK (0xffffffff >> 4u)
-
-// ---------------------------------------------------------------------------
-/** Represents a LWS scenegraph element
- */
-struct NodeDesc
-{
- NodeDesc()
- : number (0)
- , parent (0)
- , name ("")
- , lightColor (1.f,1.f,1.f)
- , lightIntensity (1.f)
- , lightType (0)
- , lightFalloffType (0)
- , lightConeAngle (45.f)
- , parent_resolved (NULL)
- {}
-
- enum {
-
- OBJECT = 1,
- LIGHT = 2,
- CAMERA = 3,
- BONE = 4
- } type; // type of node
-
- // if object: path
- std::string path;
- unsigned int id;
-
- // number of object
- unsigned int number;
-
- // index of parent index
- unsigned int parent;
-
- // lights & cameras & dummies: name
- const char* name;
-
- // animation channels
- std::list< LWO::Envelope > channels;
-
- // position of pivot point
- aiVector3D pivotPos;
-
-
-
- // color of light source
- aiColor3D lightColor;
-
- // intensity of light source
- float lightIntensity;
-
- // type of light source
- unsigned int lightType;
-
- // falloff type of light source
- unsigned int lightFalloffType;
-
- // cone angle of (spot) light source
- float lightConeAngle;
-
- // soft cone angle of (spot) light source
- float lightEdgeAngle;
-
-
-
- // list of resolved children
- std::list< NodeDesc* > children;
-
- // resolved parent node
- NodeDesc* parent_resolved;
-
-
- // for std::find()
- bool operator == (unsigned int num) const {
- if (!num)
- return false;
- unsigned int _type = num >> 28u;
-
- return _type == static_cast<unsigned int>(type) && (num & AI_LWS_MASK) == number;
- }
-};
-
-} // end namespace LWS
-
-// ---------------------------------------------------------------------------
-/** LWS (LightWave Scene Format) importer class.
- *
- * This class does heavily depend on the LWO importer class. LWS files
- * contain mainly descriptions how LWO objects are composed together
- * in a scene.
-*/
-class LWSImporter : public BaseImporter
-{
- friend class Importer;
-
-protected:
- /** Constructor to be privately used by Importer */
- LWSImporter();
-
- /** Destructor, private as well */
- ~LWSImporter();
-
-public:
-
- // -------------------------------------------------------------------
- // Check whether we can read a specific file
- bool CanRead( const std::string& pFile, IOSystem* pIOHandler,
- bool checkSig) const;
-
-protected:
-
- // -------------------------------------------------------------------
- // Get list of supported extensions
- void GetExtensionList(std::set<std::string>& extensions);
-
- // -------------------------------------------------------------------
- // Import file into given scene data structure
- void InternReadFile( const std::string& pFile, aiScene* pScene,
- IOSystem* pIOHandler);
-
- // -------------------------------------------------------------------
- // Setup import properties
- void SetupProperties(const Importer* pImp);
-
-private:
-
-
- // -------------------------------------------------------------------
- // Read an envelope description
- void ReadEnvelope(const LWS::Element& dad, LWO::Envelope& out );
-
- // -------------------------------------------------------------------
- // Read an envelope description for the older LW file format
- void ReadEnvelope_Old(std::list< LWS::Element >::const_iterator& it,
- const std::list< LWS::Element >::const_iterator& end,
- LWS::NodeDesc& nodes,
- unsigned int version);
-
- // -------------------------------------------------------------------
- // Setup a nice name for a node
- void SetupNodeName(aiNode* nd, LWS::NodeDesc& src);
-
- // -------------------------------------------------------------------
- // Recursively build the scenegraph
- void BuildGraph(aiNode* nd,
- LWS::NodeDesc& src,
- std::vector<AttachmentInfo>& attach,
- BatchLoader& batch,
- aiCamera**& camOut,
- aiLight**& lightOut,
- std::vector<aiNodeAnim*>& animOut);
-
- // -------------------------------------------------------------------
- // Try several dirs until we find the right location of a LWS file.
- std::string FindLWOFile(const std::string& in);
-
-private:
-
- bool configSpeedFlag;
- IOSystem* io;
-
- double first,last,fps;
-};
-
-} // end of namespace Assimp
-
-#endif // AI_LWSIMPORTER_H_INC
diff --git a/3rdparty/assimp/code/LimitBoneWeightsProcess.cpp b/3rdparty/assimp/code/LimitBoneWeightsProcess.cpp
deleted file mode 100644
index ebb18a30..00000000
--- a/3rdparty/assimp/code/LimitBoneWeightsProcess.cpp
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** Implementation of the LimitBoneWeightsProcess post processing step */
-
-#include "AssimpPCH.h"
-#include "LimitBoneWeightsProcess.h"
-
-
-using namespace Assimp;
-
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-LimitBoneWeightsProcess::LimitBoneWeightsProcess()
-{
- mMaxWeights = AI_LMW_MAX_WEIGHTS;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-LimitBoneWeightsProcess::~LimitBoneWeightsProcess()
-{
- // nothing to do here
-}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the processing step is present in the given flag field.
-bool LimitBoneWeightsProcess::IsActive( unsigned int pFlags) const
-{
- return (pFlags & aiProcess_LimitBoneWeights) != 0;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Executes the post processing step on the given imported data.
-void LimitBoneWeightsProcess::Execute( aiScene* pScene)
-{
- DefaultLogger::get()->debug("LimitBoneWeightsProcess begin");
- for ( unsigned int a = 0; a < pScene->mNumMeshes; a++)
- ProcessMesh( pScene->mMeshes[a]);
-
- DefaultLogger::get()->debug("LimitBoneWeightsProcess end");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Executes the post processing step on the given imported data.
-void LimitBoneWeightsProcess::SetupProperties(const Importer* pImp)
-{
- // get the current value of the property
- this->mMaxWeights = pImp->GetPropertyInteger(AI_CONFIG_PP_LBW_MAX_WEIGHTS,AI_LMW_MAX_WEIGHTS);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Unites identical vertices in the given mesh
-void LimitBoneWeightsProcess::ProcessMesh( aiMesh* pMesh)
-{
- if ( !pMesh->HasBones())
- return;
-
- // collect all bone weights per vertex
- typedef std::vector< std::vector< Weight > > WeightsPerVertex;
- WeightsPerVertex vertexWeights( pMesh->mNumVertices);
-
- // collect all weights per vertex
- for ( unsigned int a = 0; a < pMesh->mNumBones; a++)
- {
- const aiBone* bone = pMesh->mBones[a];
- for ( unsigned int b = 0; b < bone->mNumWeights; b++)
- {
- const aiVertexWeight& w = bone->mWeights[b];
- vertexWeights[w.mVertexId].push_back( Weight( a, w.mWeight));
- }
- }
-
- unsigned int removed = 0, old_bones = pMesh->mNumBones;
-
- // now cut the weight count if it exceeds the maximum
- bool bChanged = false;
- for ( WeightsPerVertex::iterator vit = vertexWeights.begin(); vit != vertexWeights.end(); ++vit)
- {
- if ( vit->size() <= mMaxWeights)
- continue;
-
- bChanged = true;
-
- // more than the defined maximum -> first sort by weight in descending order. That's
- // why we defined the < operator in such a weird way.
- std::sort( vit->begin(), vit->end());
-
- // now kill everything beyond the maximum count
- unsigned int m = vit->size();
- vit->erase( vit->begin() + mMaxWeights, vit->end());
- removed += m-vit->size();
-
- // and renormalize the weights
- float sum = 0.0f;
- for ( std::vector<Weight>::const_iterator it = vit->begin(); it != vit->end(); ++it)
- sum += it->mWeight;
- for ( std::vector<Weight>::iterator it = vit->begin(); it != vit->end(); ++it)
- it->mWeight /= sum;
- }
-
- if (bChanged) {
- // rebuild the vertex weight array for all bones
- typedef std::vector< std::vector< aiVertexWeight > > WeightsPerBone;
- WeightsPerBone boneWeights( pMesh->mNumBones);
- for ( unsigned int a = 0; a < vertexWeights.size(); a++)
- {
- const std::vector<Weight>& vw = vertexWeights[a];
- for ( std::vector<Weight>::const_iterator it = vw.begin(); it != vw.end(); ++it)
- boneWeights[it->mBone].push_back( aiVertexWeight( a, it->mWeight));
- }
-
- // and finally copy the vertex weight list over to the mesh's bones
- std::vector<bool> abNoNeed(pMesh->mNumBones,false);
- bChanged = false;
-
- for ( unsigned int a = 0; a < pMesh->mNumBones; a++)
- {
- const std::vector<aiVertexWeight>& bw = boneWeights[a];
- aiBone* bone = pMesh->mBones[a];
-
- // ignore the bone if no vertex weights were removed there
-
- // FIX (Aramis, 07|22|08)
- // NO! we can't ignore it in this case ... it is possible that
- // the number of weights did not change, but the weight values did.
-
- // if ( bw.size() == bone->mNumWeights)
- // continue;
-
- // FIX (Aramis, 07|21|08)
- // It is possible that all weights of a bone have been removed.
- // This would naturally cause an exception in &bw[0].
- if ( bw.empty() )
- {
- abNoNeed[a] = bChanged = true;
- continue;
- }
-
- // copy the weight list. should always be less weights than before, so we don't need a new allocation
- ai_assert( bw.size() <= bone->mNumWeights);
- bone->mNumWeights = (unsigned int) bw.size();
- ::memcpy( bone->mWeights, &bw[0], bw.size() * sizeof( aiVertexWeight));
- }
-
- if (bChanged) {
- // the number of new bones is smaller than before, so we can reuse the old array
- aiBone** ppcCur = pMesh->mBones;aiBone** ppcSrc = ppcCur;
-
- for (std::vector<bool>::const_iterator iter = abNoNeed.begin();iter != abNoNeed.end() ;++iter) {
- if (*iter) {
- delete *ppcSrc;
- --pMesh->mNumBones;
- }
- else *ppcCur++ = *ppcSrc;
- ++ppcSrc;
- }
- }
-
- if (!DefaultLogger::isNullLogger()) {
- char buffer[1024];
- ::sprintf(buffer,"Removed %i weights. Input bones: %i. Output bones: %i",removed,old_bones,pMesh->mNumBones);
- DefaultLogger::get()->info(buffer);
- }
- }
-}
diff --git a/3rdparty/assimp/code/LimitBoneWeightsProcess.h b/3rdparty/assimp/code/LimitBoneWeightsProcess.h
deleted file mode 100644
index 99b72ef9..00000000
--- a/3rdparty/assimp/code/LimitBoneWeightsProcess.h
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** Defines a post processing step to limit the number of bones affecting a single vertex. */
-#ifndef AI_LIMITBONEWEIGHTSPROCESS_H_INC
-#define AI_LIMITBONEWEIGHTSPROCESS_H_INC
-
-#include "BaseProcess.h"
-
-struct aiMesh;
-class LimitBoneWeightsTest;
-
-namespace Assimp
-{
-
-// NOTE: If you change these limits, don't forget to change the
-// corresponding values in all Assimp ports
-
-// **********************************************************
-// Java: ConfigProperty.java,
-// ConfigProperty.DEFAULT_BONE_WEIGHT_LIMIT
-// **********************************************************
-
-#if (!defined AI_LMW_MAX_WEIGHTS)
-# define AI_LMW_MAX_WEIGHTS 0x4
-#endif // !! AI_LMW_MAX_WEIGHTS
-
-// ---------------------------------------------------------------------------
-/** This post processing step limits the number of bones affecting a vertex
-* to a certain maximum value. If a vertex is affected by more than that number
-* of bones, the bone weight with the least influence on this vertex are removed.
-* The other weights on this bone are then renormalized to assure the sum weight
-* to be 1.
-*/
-class ASSIMP_API LimitBoneWeightsProcess : public BaseProcess
-{
- friend class Importer;
- friend class ::LimitBoneWeightsTest;
-
-protected:
- /** Constructor to be privately used by Importer */
- LimitBoneWeightsProcess();
-
- /** Destructor, private as well */
- ~LimitBoneWeightsProcess();
-
-public:
- // -------------------------------------------------------------------
- /** Returns whether the processing step is present in the given flag.
- * @param pFlags The processing flags the importer was called with.
- * A bitwise combination of #aiPostProcessSteps.
- * @return true if the process is present in this flag fields,
- * false if not.
- */
- bool IsActive( unsigned int pFlags) const;
-
- // -------------------------------------------------------------------
- /** Called prior to ExecuteOnScene().
- * The function is a request to the process to update its configuration
- * basing on the Importer's configuration property list.
- */
- void SetupProperties(const Importer* pImp);
-
-protected:
-
- // -------------------------------------------------------------------
- /** Limits the bone weight count for all vertices in the given mesh.
- * @param pMesh The mesh to process.
- */
- void ProcessMesh( aiMesh* pMesh);
-
- // -------------------------------------------------------------------
- /** Executes the post processing step on the given imported data.
- * At the moment a process is not supposed to fail.
- * @param pScene The imported data to work at.
- */
- void Execute( aiScene* pScene);
-
-
-protected:
-
- // -------------------------------------------------------------------
- /** Describes a bone weight on a vertex */
- struct Weight
- {
- unsigned int mBone; ///< Index of the bone
- float mWeight; ///< Weight of that bone on this vertex
- Weight() { }
- Weight( unsigned int pBone, float pWeight)
- {
- mBone = pBone;
- mWeight = pWeight;
- }
-
- /** Comparision operator to sort bone weights by descending weight */
- bool operator < (const Weight& pWeight) const
- {
- return mWeight > pWeight.mWeight;
- }
- };
-
-public:
- /** Maximum number of bones influencing any single vertex. */
- unsigned int mMaxWeights;
-};
-
-} // end of namespace Assimp
-
-#endif // AI_LIMITBONEWEIGHTSPROCESS_H_INC
diff --git a/3rdparty/assimp/code/LineSplitter.h b/3rdparty/assimp/code/LineSplitter.h
deleted file mode 100644
index 61f5b34b..00000000
--- a/3rdparty/assimp/code/LineSplitter.h
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file LineSplitter.h
- * @brief LineSplitter, a helper class to iterate through all lines
- * of a file easily. Works with StreamReader.
- */
-#ifndef INCLUDED_LINE_SPLITTER_H
-#define INCLUDED_LINE_SPLITTER_H
-
-#include <stdexcept>
-
-#include "StreamReader.h"
-#include "ParsingUtils.h"
-
-namespace Assimp {
-
-// ------------------------------------------------------------------------------------------------
-/** Usage:
-@code
-for (LineSplitter splitter(stream);splitter;++splitter) {
-
- if (*splitter == "hi!") {
- ...
- }
- else if (splitter->substr(0,5) == "hello") {
- ...
- // access the third token in the line (tokens are space-separated)
- if (strtol(splitter[2]) > 5) { .. }
- }
-
- std::cout << "Current line is: " << splitter.get_index() << std::endl;
-}
-@endcode */
-// ------------------------------------------------------------------------------------------------
-class LineSplitter
-{
-public:
-
- typedef size_t line_idx;
-
-public:
-
- // -----------------------------------------
- /** construct from existing stream reader */
- LineSplitter(StreamReaderLE& stream)
- : stream(stream)
- , swallow()
- {
- cur.reserve(1024);
- operator++();
-
- idx = 0;
- }
-
-public:
-
- // -----------------------------------------
- /** pseudo-iterator increment */
- LineSplitter& operator++() {
- if (swallow) {
- swallow = false;
- return *this;
- }
-
- if (!*this) {
- throw std::logic_error("End of file, no more lines to be retrieved.");
- }
-
- char s;
-
- cur.clear(); // I will kill you if you deallocate.
- while (stream.GetRemainingSize() && (s = stream.GetI1(),1)) {
- if (s == '\n' || s == '\r') {
- while (stream.GetRemainingSize() && ((s = stream.GetI1()) == ' ' || s == '\r' || s == '\n'));
- if (stream.GetRemainingSize()) {
- stream.IncPtr(-1);
- }
- break;
- }
- cur += s;
- }
-
- ++idx;
- return *this;
- }
-
- // -----------------------------------------
- /** get a pointer to the beginning of a particular token */
- const char* operator[] (size_t idx) const {
- const char* s = operator->()->c_str();
-
- SkipSpaces(&s);
- for (size_t i = 0; i < idx; ++i) {
-
- for (;!IsSpace(*s); ++s) {
- if (IsLineEnd(*s)) {
- throw std::range_error("Token index out of range, EOL reached");
- }
- }
- SkipSpaces(&s);
- }
- return s;
- }
-
- // -----------------------------------------
- /** extract the start positions of N tokens from the current line*/
- template <size_t N>
- void get_tokens(const char* (&tokens)[N]) const {
- const char* s = operator->()->c_str();
-
- SkipSpaces(&s);
- for (size_t i = 0; i < N; ++i) {
- if (IsLineEnd(*s)) {
- throw std::range_error("Token count out of range, EOL reached");
- }
- tokens[i] = s;
-
- for (;*s && !IsSpace(*s); ++s);
- SkipSpaces(&s);
- }
- }
-
- // -----------------------------------------
- /** member access */
- const std::string* operator -> () const {
- return &cur;
- }
-
- const std::string& operator* () const {
- return cur;
- }
-
- // -----------------------------------------
- /** boolean context */
- operator bool() const {
- return stream.GetRemainingSize()>0;
- }
-
- // -----------------------------------------
- /** line indices are zero-based, empty lines are included */
- operator line_idx() const {
- return idx;
- }
-
- line_idx get_index() const {
- return idx;
- }
-
- // -----------------------------------------
- /** access the underlying stream object */
- StreamReaderLE& get_stream() {
- return stream;
- }
-
- // -----------------------------------------
- /** !strcmp((*this)->substr(0,strlen(check)),check) */
- bool match_start(const char* check) {
- const size_t len = strlen(check);
-
- return len <= cur.length() && std::equal(check,check+len,cur.begin());
- }
-
-
- // -----------------------------------------
- /** swallow the next call to ++, return the previous value. */
- void swallow_next_increment() {
- swallow = true;
- }
-
-private:
-
- line_idx idx;
- std::string cur;
- StreamReaderLE& stream;
- bool swallow;
-};
-
-}
-#endif // INCLUDED_LINE_SPLITTER_H
diff --git a/3rdparty/assimp/code/MD2FileData.h b/3rdparty/assimp/code/MD2FileData.h
deleted file mode 100644
index 86437470..00000000
--- a/3rdparty/assimp/code/MD2FileData.h
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file MD2FileData.h
- * @brief Defines helper data structures for importing MD2 files
- * http://linux.ucla.edu/~phaethon/q3/formats/md2-schoenblum.html
- */
-#ifndef AI_MD2FILEHELPER_H_INC
-#define AI_MD2FILEHELPER_H_INC
-
-#include "../include/aiTypes.h"
-#include "../include/aiMesh.h"
-#include "../include/aiAnim.h"
-
-#include "./../include/Compiler/pushpack1.h"
-
-namespace Assimp {
-namespace MD2 {
-
-// to make it easier for us, we test the magic word against both "endianesses"
-#define AI_MD2_MAGIC_NUMBER_BE AI_MAKE_MAGIC("IDP2")
-#define AI_MD2_MAGIC_NUMBER_LE AI_MAKE_MAGIC("2PDI")
-
-// common limitations
-#define AI_MD2_VERSION 15
-#define AI_MD2_MAXQPATH 64
-#define AI_MD2_MAX_FRAMES 512
-#define AI_MD2_MAX_SKINS 32
-#define AI_MD2_MAX_VERTS 2048
-#define AI_MD2_MAX_TRIANGLES 4096
-
-// ---------------------------------------------------------------------------
-/** \brief Data structure for the MD2 main header
- */
-struct Header
-{
- uint32_t magic;
- uint32_t version;
- uint32_t skinWidth;
- uint32_t skinHeight;
- uint32_t frameSize;
- uint32_t numSkins;
- uint32_t numVertices;
- uint32_t numTexCoords;
- uint32_t numTriangles;
- uint32_t numGlCommands;
- uint32_t numFrames;
- uint32_t offsetSkins;
- uint32_t offsetTexCoords;
- uint32_t offsetTriangles;
- uint32_t offsetFrames;
- uint32_t offsetGlCommands;
- uint32_t offsetEnd;
-
-} PACK_STRUCT;
-
-// ---------------------------------------------------------------------------
-/** \brief Data structure for a MD2 OpenGl draw command
- */
-struct GLCommand
-{
- float s, t;
- uint32_t vertexIndex;
-} PACK_STRUCT;
-
-// ---------------------------------------------------------------------------
-/** \brief Data structure for a MD2 triangle
- */
-struct Triangle
-{
- uint16_t vertexIndices[3];
- uint16_t textureIndices[3];
-} PACK_STRUCT;
-
-// ---------------------------------------------------------------------------
-/** \brief Data structure for a MD2 vertex
- */
-struct Vertex
-{
- uint8_t vertex[3];
- uint8_t lightNormalIndex;
-} PACK_STRUCT;
-
-// ---------------------------------------------------------------------------
-/** \brief Data structure for a MD2 frame
- */
-struct Frame
-{
- float scale[3];
- float translate[3];
- char name[16];
- Vertex vertices[1];
-} PACK_STRUCT;
-
-// ---------------------------------------------------------------------------
-/** \brief Data structure for a MD2 texture coordinate
- */
-struct TexCoord
-{
- uint16_t s;
- uint16_t t;
-} PACK_STRUCT;
-
-// ---------------------------------------------------------------------------
-/** \brief Data structure for a MD2 skin
- */
-struct Skin
-{
- char name[AI_MD2_MAXQPATH]; /* texture file name */
-} PACK_STRUCT;
-
-#include "./../include/Compiler/poppack1.h"
-
-
-// ---------------------------------------------------------------------------
-//! Lookup a normal vector from Quake's normal lookup table
-//! \param index Input index (0-161)
-//! \param vOut Receives the output normal
-void LookupNormalIndex(uint8_t index,aiVector3D& vOut);
-
-
-}
-}
-
-#endif // !! include guard
-
diff --git a/3rdparty/assimp/code/MD2Loader.cpp b/3rdparty/assimp/code/MD2Loader.cpp
deleted file mode 100644
index ad7960f9..00000000
--- a/3rdparty/assimp/code/MD2Loader.cpp
+++ /dev/null
@@ -1,414 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-#include "AssimpPCH.h"
-#ifndef ASSIMP_BUILD_NO_MD2_IMPORTER
-
-/** @file Implementation of the MD2 importer class */
-#include "MD2Loader.h"
-#include "MaterialSystem.h"
-#include "ByteSwap.h"
-#include "MD2NormalTable.h" // shouldn't be included by other units
-
-using namespace Assimp;
-using namespace Assimp::MD2;
-
-
-// helper macro to determine the size of an array
-#if (!defined ARRAYSIZE)
-# define ARRAYSIZE(_array) (int(sizeof(_array) / sizeof(_array[0])))
-#endif
-
-// ------------------------------------------------------------------------------------------------
-// Helper function to lookup a normal in Quake 2's precalculated table
-void MD2::LookupNormalIndex(uint8_t iNormalIndex,aiVector3D& vOut)
-{
- // make sure the normal index has a valid value
- if (iNormalIndex >= ARRAYSIZE(g_avNormals)) {
- DefaultLogger::get()->warn("Index overflow in Quake II normal vector list");
- iNormalIndex = ARRAYSIZE(g_avNormals) - 1;
- }
- vOut = *((const aiVector3D*)(&g_avNormals[iNormalIndex]));
-}
-
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-MD2Importer::MD2Importer()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-MD2Importer::~MD2Importer()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the class can handle the format of the given file.
-bool MD2Importer::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const
-{
- const std::string extension = GetExtension(pFile);
- if (extension == "md2")
- return true;
-
- // if check for extension is not enough, check for the magic tokens
- if (!extension.length() || checkSig) {
- uint32_t tokens[1];
- tokens[0] = AI_MD2_MAGIC_NUMBER_LE;
- return CheckMagicToken(pIOHandler,pFile,tokens,1);
- }
- return false;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Get a list of all extensions supported by this loader
-void MD2Importer::GetExtensionList(std::set<std::string>& extensions)
-{
- extensions.insert("md2");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Setup configuration properties
-void MD2Importer::SetupProperties(const Importer* pImp)
-{
- // The
- // AI_CONFIG_IMPORT_MD2_KEYFRAME option overrides the
- // AI_CONFIG_IMPORT_GLOBAL_KEYFRAME option.
- configFrameID = pImp->GetPropertyInteger(AI_CONFIG_IMPORT_MD2_KEYFRAME,0xffffffff);
- if (0xffffffff == configFrameID){
- configFrameID = pImp->GetPropertyInteger(AI_CONFIG_IMPORT_GLOBAL_KEYFRAME,0);
- }
-}
-// ------------------------------------------------------------------------------------------------
-// Validate the file header
-void MD2Importer::ValidateHeader( )
-{
- // check magic number
- if (m_pcHeader->magic != AI_MD2_MAGIC_NUMBER_BE &&
- m_pcHeader->magic != AI_MD2_MAGIC_NUMBER_LE)
- {
- char szBuffer[5];
- szBuffer[0] = ((char*)&m_pcHeader->magic)[0];
- szBuffer[1] = ((char*)&m_pcHeader->magic)[1];
- szBuffer[2] = ((char*)&m_pcHeader->magic)[2];
- szBuffer[3] = ((char*)&m_pcHeader->magic)[3];
- szBuffer[4] = '\0';
-
- throw DeadlyImportError("Invalid MD2 magic word: should be IDP2, the "
- "magic word found is " + std::string(szBuffer));
- }
-
- // check file format version
- if (m_pcHeader->version != 8)
- DefaultLogger::get()->warn( "Unsupported md2 file version. Continuing happily ...");
-
- // check some values whether they are valid
- if (0 == m_pcHeader->numFrames)
- throw DeadlyImportError( "Invalid md2 file: NUM_FRAMES is 0");
-
- if (m_pcHeader->offsetEnd > (uint32_t)fileSize)
- throw DeadlyImportError( "Invalid md2 file: File is too small");
-
- if (m_pcHeader->offsetSkins + m_pcHeader->numSkins * sizeof (MD2::Skin) >= fileSize ||
- m_pcHeader->offsetTexCoords + m_pcHeader->numTexCoords * sizeof (MD2::TexCoord) >= fileSize ||
- m_pcHeader->offsetTriangles + m_pcHeader->numTriangles * sizeof (MD2::Triangle) >= fileSize ||
- m_pcHeader->offsetFrames + m_pcHeader->numFrames * sizeof (MD2::Frame) >= fileSize ||
- m_pcHeader->offsetEnd > fileSize)
- {
- throw DeadlyImportError("Invalid MD2 header: some offsets are outside the file");
- }
-
- if (m_pcHeader->numSkins > AI_MD2_MAX_SKINS)
- DefaultLogger::get()->warn("The model contains more skins than Quake 2 supports");
- if ( m_pcHeader->numFrames > AI_MD2_MAX_FRAMES)
- DefaultLogger::get()->warn("The model contains more frames than Quake 2 supports");
- if (m_pcHeader->numVertices > AI_MD2_MAX_VERTS)
- DefaultLogger::get()->warn("The model contains more vertices than Quake 2 supports");
-
- if (m_pcHeader->numFrames <= configFrameID )
- throw DeadlyImportError("The requested frame is not existing the file");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Imports the given file into the given scene structure.
-void MD2Importer::InternReadFile( const std::string& pFile,
- aiScene* pScene, IOSystem* pIOHandler)
-{
- boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile));
-
- // Check whether we can read from the file
- if ( file.get() == NULL)
- throw DeadlyImportError( "Failed to open MD2 file " + pFile + "");
-
- // check whether the md3 file is large enough to contain
- // at least the file header
- fileSize = (unsigned int)file->FileSize();
- if ( fileSize < sizeof(MD2::Header))
- throw DeadlyImportError( "MD2 File is too small");
-
- std::vector<uint8_t> mBuffer2(fileSize);
- file->Read(&mBuffer2[0], 1, fileSize);
- mBuffer = &mBuffer2[0];
-
-
- m_pcHeader = (BE_NCONST MD2::Header*)mBuffer;
-
-#ifdef AI_BUILD_BIG_ENDIAN
-
- ByteSwap::Swap4(&m_pcHeader->frameSize);
- ByteSwap::Swap4(&m_pcHeader->magic);
- ByteSwap::Swap4(&m_pcHeader->numFrames);
- ByteSwap::Swap4(&m_pcHeader->numGlCommands);
- ByteSwap::Swap4(&m_pcHeader->numSkins);
- ByteSwap::Swap4(&m_pcHeader->numTexCoords);
- ByteSwap::Swap4(&m_pcHeader->numTriangles);
- ByteSwap::Swap4(&m_pcHeader->numVertices);
- ByteSwap::Swap4(&m_pcHeader->offsetEnd);
- ByteSwap::Swap4(&m_pcHeader->offsetFrames);
- ByteSwap::Swap4(&m_pcHeader->offsetGlCommands);
- ByteSwap::Swap4(&m_pcHeader->offsetSkins);
- ByteSwap::Swap4(&m_pcHeader->offsetTexCoords);
- ByteSwap::Swap4(&m_pcHeader->offsetTriangles);
- ByteSwap::Swap4(&m_pcHeader->skinHeight);
- ByteSwap::Swap4(&m_pcHeader->skinWidth);
- ByteSwap::Swap4(&m_pcHeader->version);
-
-#endif
-
- ValidateHeader();
-
- // there won't be more than one mesh inside the file
- pScene->mNumMaterials = 1;
- pScene->mRootNode = new aiNode();
- pScene->mRootNode->mNumMeshes = 1;
- pScene->mRootNode->mMeshes = new unsigned int[1];
- pScene->mRootNode->mMeshes[0] = 0;
- pScene->mMaterials = new aiMaterial*[1];
- pScene->mMaterials[0] = new MaterialHelper();
- pScene->mNumMeshes = 1;
- pScene->mMeshes = new aiMesh*[1];
-
- aiMesh* pcMesh = pScene->mMeshes[0] = new aiMesh();
- pcMesh->mPrimitiveTypes = aiPrimitiveType_TRIANGLE;
-
- // navigate to the begin of the frame data
- BE_NCONST MD2::Frame* pcFrame = (BE_NCONST MD2::Frame*) ((uint8_t*)
- m_pcHeader + m_pcHeader->offsetFrames);
-
- pcFrame += configFrameID;
-
- // navigate to the begin of the triangle data
- MD2::Triangle* pcTriangles = (MD2::Triangle*) ((uint8_t*)
- m_pcHeader + m_pcHeader->offsetTriangles);
-
- // navigate to the begin of the tex coords data
- BE_NCONST MD2::TexCoord* pcTexCoords = (BE_NCONST MD2::TexCoord*) ((uint8_t*)
- m_pcHeader + m_pcHeader->offsetTexCoords);
-
- // navigate to the begin of the vertex data
- BE_NCONST MD2::Vertex* pcVerts = (BE_NCONST MD2::Vertex*) (pcFrame->vertices);
-
-#ifdef AI_BUILD_BIG_ENDIAN
- for (uint32_t i = 0; i< m_pcHeader->numTriangles; ++i)
- {
- for (unsigned int p = 0; p < 3;++p)
- {
- ByteSwap::Swap2(& pcTriangles[i].textureIndices[p]);
- ByteSwap::Swap2(& pcTriangles[i].vertexIndices[p]);
- }
- }
- for (uint32_t i = 0; i < m_pcHeader->offsetTexCoords;++i)
- {
- ByteSwap::Swap2(& pcTexCoords[i].s);
- ByteSwap::Swap2(& pcTexCoords[i].t);
- }
- ByteSwap::Swap4( & pcFrame->scale[0] );
- ByteSwap::Swap4( & pcFrame->scale[1] );
- ByteSwap::Swap4( & pcFrame->scale[2] );
- ByteSwap::Swap4( & pcFrame->translate[0] );
- ByteSwap::Swap4( & pcFrame->translate[1] );
- ByteSwap::Swap4( & pcFrame->translate[2] );
-#endif
-
- pcMesh->mNumFaces = m_pcHeader->numTriangles;
- pcMesh->mFaces = new aiFace[m_pcHeader->numTriangles];
-
- // allocate output storage
- pcMesh->mNumVertices = (unsigned int)pcMesh->mNumFaces*3;
- pcMesh->mVertices = new aiVector3D[pcMesh->mNumVertices];
- pcMesh->mNormals = new aiVector3D[pcMesh->mNumVertices];
-
- // Not sure whether there are MD2 files without texture coordinates
- // NOTE: texture coordinates can be there without a texture,
- // but a texture can't be there without a valid UV channel
- MaterialHelper* pcHelper = (MaterialHelper*)pScene->mMaterials[0];
- const int iMode = (int)aiShadingMode_Gouraud;
- pcHelper->AddProperty<int>(&iMode, 1, AI_MATKEY_SHADING_MODEL);
-
- if (m_pcHeader->numTexCoords && m_pcHeader->numSkins)
- {
- // navigate to the first texture associated with the mesh
- const MD2::Skin* pcSkins = (const MD2::Skin*) ((unsigned char*)m_pcHeader +
- m_pcHeader->offsetSkins);
-
- aiColor3D clr;
- clr.b = clr.g = clr.r = 1.0f;
- pcHelper->AddProperty<aiColor3D>(&clr, 1,AI_MATKEY_COLOR_DIFFUSE);
- pcHelper->AddProperty<aiColor3D>(&clr, 1,AI_MATKEY_COLOR_SPECULAR);
-
- clr.b = clr.g = clr.r = 0.05f;
- pcHelper->AddProperty<aiColor3D>(&clr, 1,AI_MATKEY_COLOR_AMBIENT);
-
- if (pcSkins->name[0])
- {
- aiString szString;
- const size_t iLen = ::strlen(pcSkins->name);
- ::memcpy(szString.data,pcSkins->name,iLen);
- szString.data[iLen] = '\0';
- szString.length = iLen;
-
- pcHelper->AddProperty(&szString,AI_MATKEY_TEXTURE_DIFFUSE(0));
- }
- else{
- DefaultLogger::get()->warn("Texture file name has zero length. It will be skipped.");
- }
- }
- else {
- // apply a default material
- aiColor3D clr;
- clr.b = clr.g = clr.r = 0.6f;
- pcHelper->AddProperty<aiColor3D>(&clr, 1,AI_MATKEY_COLOR_DIFFUSE);
- pcHelper->AddProperty<aiColor3D>(&clr, 1,AI_MATKEY_COLOR_SPECULAR);
-
- clr.b = clr.g = clr.r = 0.05f;
- pcHelper->AddProperty<aiColor3D>(&clr, 1,AI_MATKEY_COLOR_AMBIENT);
-
- aiString szName;
- szName.Set(AI_DEFAULT_TEXTURED_MATERIAL_NAME);
- pcHelper->AddProperty(&szName,AI_MATKEY_NAME);
-
- aiString sz;
-
- // TODO: Try to guess the name of the texture file from the model file name
-
- sz.Set("$texture_dummy.bmp");
- pcHelper->AddProperty(&sz,AI_MATKEY_TEXTURE_DIFFUSE(0));
- }
-
-
- // now read all triangles of the first frame, apply scaling and translation
- unsigned int iCurrent = 0;
-
- float fDivisorU = 1.0f,fDivisorV = 1.0f;
- if (m_pcHeader->numTexCoords) {
- // allocate storage for texture coordinates, too
- pcMesh->mTextureCoords[0] = new aiVector3D[pcMesh->mNumVertices];
- pcMesh->mNumUVComponents[0] = 2;
-
- // check whether the skin width or height are zero (this would
- // cause a division through zero)
- if (!m_pcHeader->skinWidth) {
- DefaultLogger::get()->error("MD2: No valid skin width given");
- }
- else fDivisorU = (float)m_pcHeader->skinWidth;
- if (!m_pcHeader->skinHeight){
- DefaultLogger::get()->error("MD2: No valid skin height given");
- }
- else fDivisorV = (float)m_pcHeader->skinHeight;
- }
-
- for (unsigned int i = 0; i < (unsigned int)m_pcHeader->numTriangles;++i) {
- // Allocate the face
- pScene->mMeshes[0]->mFaces[i].mIndices = new unsigned int[3];
- pScene->mMeshes[0]->mFaces[i].mNumIndices = 3;
-
- // copy texture coordinates
- // check whether they are different from the previous value at this index.
- // In this case, create a full separate set of vertices/normals/texcoords
- for (unsigned int c = 0; c < 3;++c,++iCurrent) {
-
- // validate vertex indices
- register unsigned int iIndex = (unsigned int)pcTriangles[i].vertexIndices[c];
- if (iIndex >= m_pcHeader->numVertices) {
- DefaultLogger::get()->error("MD2: Vertex index is outside the allowed range");
- iIndex = m_pcHeader->numVertices-1;
- }
-
- // read x,y, and z component of the vertex
- aiVector3D& vec = pcMesh->mVertices[iCurrent];
-
- vec.x = (float)pcVerts[iIndex].vertex[0] * pcFrame->scale[0];
- vec.x += pcFrame->translate[0];
-
- vec.y = (float)pcVerts[iIndex].vertex[1] * pcFrame->scale[1];
- vec.y += pcFrame->translate[1];
-
- vec.z = (float)pcVerts[iIndex].vertex[2] * pcFrame->scale[2];
- vec.z += pcFrame->translate[2];
-
- // read the normal vector from the precalculated normal table
- aiVector3D& vNormal = pcMesh->mNormals[iCurrent];
- LookupNormalIndex(pcVerts[iIndex].lightNormalIndex,vNormal);
-
- // flip z and y to become right-handed
- std::swap((float&)vNormal.z,(float&)vNormal.y);
- std::swap((float&)vec.z,(float&)vec.y);
-
- if (m_pcHeader->numTexCoords) {
- // validate texture coordinates
- iIndex = pcTriangles[i].textureIndices[c];
- if (iIndex >= m_pcHeader->numTexCoords) {
- DefaultLogger::get()->error("MD2: UV index is outside the allowed range");
- iIndex = m_pcHeader->numTexCoords-1;
- }
-
- aiVector3D& pcOut = pcMesh->mTextureCoords[0][iCurrent];
-
- // the texture coordinates are absolute values but we
- // need relative values between 0 and 1
- pcOut.x = pcTexCoords[iIndex].s / fDivisorU;
- pcOut.y = 1.f-pcTexCoords[iIndex].t / fDivisorV;
- }
- pScene->mMeshes[0]->mFaces[i].mIndices[c] = iCurrent;
- }
- }
-}
-
-#endif // !! ASSIMP_BUILD_NO_MD2_IMPORTER
diff --git a/3rdparty/assimp/code/MD2Loader.h b/3rdparty/assimp/code/MD2Loader.h
deleted file mode 100644
index 5a646b8d..00000000
--- a/3rdparty/assimp/code/MD2Loader.h
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file MD2Loader.h
- * @brief Declaration of the .MD2 importer class.
- */
-#ifndef AI_MD2LOADER_H_INCLUDED
-#define AI_MD2LOADER_H_INCLUDED
-
-#include "BaseImporter.h"
-#include "../include/aiTypes.h"
-
-struct aiNode;
-#include "MD2FileData.h"
-
-namespace Assimp {
-class MaterialHelper;
-
-using namespace MD2;
-
-// ---------------------------------------------------------------------------
-/** Importer class for MD2
-*/
-class MD2Importer : public BaseImporter
-{
- friend class Importer;
-
-protected:
- /** Constructor to be privately used by Importer */
- MD2Importer();
-
- /** Destructor, private as well */
- ~MD2Importer();
-
-public:
-
- // -------------------------------------------------------------------
- /** Returns whether the class can handle the format of the given file.
- * See BaseImporter::CanRead() for details. */
- bool CanRead( const std::string& pFile, IOSystem* pIOHandler,
- bool checkSig) const;
-
-
- // -------------------------------------------------------------------
- /** Called prior to ReadFile().
- * The function is a request to the importer to update its configuration
- * basing on the Importer's configuration property list.
- */
- void SetupProperties(const Importer* pImp);
-
-protected:
-
- // -------------------------------------------------------------------
- /** Called by Importer::GetExtensionList() for each loaded importer.
- * See BaseImporter::GetExtensionList() for details
- */
- void GetExtensionList(std::set<std::string>& extensions);
-
- // -------------------------------------------------------------------
- /** Imports the given file into the given scene structure.
- * See BaseImporter::InternReadFile() for details
- */
- void InternReadFile( const std::string& pFile, aiScene* pScene,
- IOSystem* pIOHandler);
-
-
- // -------------------------------------------------------------------
- /** Validate the header of the file
- */
- void ValidateHeader();
-
-protected:
-
- /** Configuration option: frame to be loaded */
- unsigned int configFrameID;
-
- /** Header of the MD2 file */
- BE_NCONST MD2::Header* m_pcHeader;
-
- /** Buffer to hold the loaded file */
- BE_NCONST uint8_t* mBuffer;
-
- /** Size of the file, in bytes */
- unsigned int fileSize;
-};
-
-} // end of namespace Assimp
-
-#endif // AI_3DSIMPORTER_H_INC
diff --git a/3rdparty/assimp/code/MD2NormalTable.h b/3rdparty/assimp/code/MD2NormalTable.h
deleted file mode 100644
index 288fb4a1..00000000
--- a/3rdparty/assimp/code/MD2NormalTable.h
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/*
- * @file Slightly modified version of the anorms.h header file
- * released by ID software with the Quake 2 source code.
- *
- * Table of normals used by MD2 models
- */
-
-#ifndef AI_MDL_NORMALTABLE_H_INC
-#define AI_MDL_NORMALTABLE_H_INC
-
-
-float g_avNormals[162][3] = {
-{ -0.525731f, 0.000000f, 0.850651f },
-{ -0.442863f, 0.238856f, 0.864188f },
-{ -0.295242f, 0.000000f, 0.955423f },
-{ -0.309017f, 0.500000f, 0.809017f },
-{ -0.162460f, 0.262866f, 0.951056f },
-{ 0.000000f, 0.000000f, 1.000000f },
-{ 0.000000f, 0.850651f, 0.525731f },
-{ -0.147621f, 0.716567f, 0.681718f },
-{ 0.147621f, 0.716567f, 0.681718f },
-{ 0.000000f, 0.525731f, 0.850651f },
-{ 0.309017f, 0.500000f, 0.809017f },
-{ 0.525731f, 0.000000f, 0.850651f },
-{ 0.295242f, 0.000000f, 0.955423f },
-{ 0.442863f, 0.238856f, 0.864188f },
-{ 0.162460f, 0.262866f, 0.951056f },
-{ -0.681718f, 0.147621f, 0.716567f },
-{ -0.809017f, 0.309017f, 0.500000f },
-{ -0.587785f, 0.425325f, 0.688191f },
-{ -0.850651f, 0.525731f, 0.000000f },
-{ -0.864188f, 0.442863f, 0.238856f },
-{ -0.716567f, 0.681718f, 0.147621f },
-{ -0.688191f, 0.587785f, 0.425325f },
-{ -0.500000f, 0.809017f, 0.309017f },
-{ -0.238856f, 0.864188f, 0.442863f },
-{ -0.425325f, 0.688191f, 0.587785f },
-{ -0.716567f, 0.681718f, -0.147621f },
-{ -0.500000f, 0.809017f, -0.309017f },
-{ -0.525731f, 0.850651f, 0.000000f },
-{ 0.000000f, 0.850651f, -0.525731f },
-{ -0.238856f, 0.864188f, -0.442863f },
-{ 0.000000f, 0.955423f, -0.295242f },
-{ -0.262866f, 0.951056f, -0.162460f },
-{ 0.000000f, 1.000000f, 0.000000f },
-{ 0.000000f, 0.955423f, 0.295242f },
-{ -0.262866f, 0.951056f, 0.162460f },
-{ 0.238856f, 0.864188f, 0.442863f },
-{ 0.262866f, 0.951056f, 0.162460f },
-{ 0.500000f, 0.809017f, 0.309017f },
-{ 0.238856f, 0.864188f, -0.442863f },
-{ 0.262866f, 0.951056f, -0.162460f },
-{ 0.500000f, 0.809017f, -0.309017f },
-{ 0.850651f, 0.525731f, 0.000000f },
-{ 0.716567f, 0.681718f, 0.147621f },
-{ 0.716567f, 0.681718f, -0.147621f },
-{ 0.525731f, 0.850651f, 0.000000f },
-{ 0.425325f, 0.688191f, 0.587785f },
-{ 0.864188f, 0.442863f, 0.238856f },
-{ 0.688191f, 0.587785f, 0.425325f },
-{ 0.809017f, 0.309017f, 0.500000f },
-{ 0.681718f, 0.147621f, 0.716567f },
-{ 0.587785f, 0.425325f, 0.688191f },
-{ 0.955423f, 0.295242f, 0.000000f },
-{ 1.000000f, 0.000000f, 0.000000f },
-{ 0.951056f, 0.162460f, 0.262866f },
-{ 0.850651f, -0.525731f, 0.000000f },
-{ 0.955423f, -0.295242f, 0.000000f },
-{ 0.864188f, -0.442863f, 0.238856f },
-{ 0.951056f, -0.162460f, 0.262866f },
-{ 0.809017f, -0.309017f, 0.500000f },
-{ 0.681718f, -0.147621f, 0.716567f },
-{ 0.850651f, 0.000000f, 0.525731f },
-{ 0.864188f, 0.442863f, -0.238856f },
-{ 0.809017f, 0.309017f, -0.500000f },
-{ 0.951056f, 0.162460f, -0.262866f },
-{ 0.525731f, 0.000000f, -0.850651f },
-{ 0.681718f, 0.147621f, -0.716567f },
-{ 0.681718f, -0.147621f, -0.716567f },
-{ 0.850651f, 0.000000f, -0.525731f },
-{ 0.809017f, -0.309017f, -0.500000f },
-{ 0.864188f, -0.442863f, -0.238856f },
-{ 0.951056f, -0.162460f, -0.262866f },
-{ 0.147621f, 0.716567f, -0.681718f },
-{ 0.309017f, 0.500000f, -0.809017f },
-{ 0.425325f, 0.688191f, -0.587785f },
-{ 0.442863f, 0.238856f, -0.864188f },
-{ 0.587785f, 0.425325f, -0.688191f },
-{ 0.688191f, 0.587785f, -0.425325f },
-{ -0.147621f, 0.716567f, -0.681718f },
-{ -0.309017f, 0.500000f, -0.809017f },
-{ 0.000000f, 0.525731f, -0.850651f },
-{ -0.525731f, 0.000000f, -0.850651f },
-{ -0.442863f, 0.238856f, -0.864188f },
-{ -0.295242f, 0.000000f, -0.955423f },
-{ -0.162460f, 0.262866f, -0.951056f },
-{ 0.000000f, 0.000000f, -1.000000f },
-{ 0.295242f, 0.000000f, -0.955423f },
-{ 0.162460f, 0.262866f, -0.951056f },
-{ -0.442863f, -0.238856f, -0.864188f },
-{ -0.309017f, -0.500000f, -0.809017f },
-{ -0.162460f, -0.262866f, -0.951056f },
-{ 0.000000f, -0.850651f, -0.525731f },
-{ -0.147621f, -0.716567f, -0.681718f },
-{ 0.147621f, -0.716567f, -0.681718f },
-{ 0.000000f, -0.525731f, -0.850651f },
-{ 0.309017f, -0.500000f, -0.809017f },
-{ 0.442863f, -0.238856f, -0.864188f },
-{ 0.162460f, -0.262866f, -0.951056f },
-{ 0.238856f, -0.864188f, -0.442863f },
-{ 0.500000f, -0.809017f, -0.309017f },
-{ 0.425325f, -0.688191f, -0.587785f },
-{ 0.716567f, -0.681718f, -0.147621f },
-{ 0.688191f, -0.587785f, -0.425325f },
-{ 0.587785f, -0.425325f, -0.688191f },
-{ 0.000000f, -0.955423f, -0.295242f },
-{ 0.000000f, -1.000000f, 0.000000f },
-{ 0.262866f, -0.951056f, -0.162460f },
-{ 0.000000f, -0.850651f, 0.525731f },
-{ 0.000000f, -0.955423f, 0.295242f },
-{ 0.238856f, -0.864188f, 0.442863f },
-{ 0.262866f, -0.951056f, 0.162460f },
-{ 0.500000f, -0.809017f, 0.309017f },
-{ 0.716567f, -0.681718f, 0.147621f },
-{ 0.525731f, -0.850651f, 0.000000f },
-{ -0.238856f, -0.864188f, -0.442863f },
-{ -0.500000f, -0.809017f, -0.309017f },
-{ -0.262866f, -0.951056f, -0.162460f },
-{ -0.850651f, -0.525731f, 0.000000f },
-{ -0.716567f, -0.681718f, -0.147621f },
-{ -0.716567f, -0.681718f, 0.147621f },
-{ -0.525731f, -0.850651f, 0.000000f },
-{ -0.500000f, -0.809017f, 0.309017f },
-{ -0.238856f, -0.864188f, 0.442863f },
-{ -0.262866f, -0.951056f, 0.162460f },
-{ -0.864188f, -0.442863f, 0.238856f },
-{ -0.809017f, -0.309017f, 0.500000f },
-{ -0.688191f, -0.587785f, 0.425325f },
-{ -0.681718f, -0.147621f, 0.716567f },
-{ -0.442863f, -0.238856f, 0.864188f },
-{ -0.587785f, -0.425325f, 0.688191f },
-{ -0.309017f, -0.500000f, 0.809017f },
-{ -0.147621f, -0.716567f, 0.681718f },
-{ -0.425325f, -0.688191f, 0.587785f },
-{ -0.162460f, -0.262866f, 0.951056f },
-{ 0.442863f, -0.238856f, 0.864188f },
-{ 0.162460f, -0.262866f, 0.951056f },
-{ 0.309017f, -0.500000f, 0.809017f },
-{ 0.147621f, -0.716567f, 0.681718f },
-{ 0.000000f, -0.525731f, 0.850651f },
-{ 0.425325f, -0.688191f, 0.587785f },
-{ 0.587785f, -0.425325f, 0.688191f },
-{ 0.688191f, -0.587785f, 0.425325f },
-{ -0.955423f, 0.295242f, 0.000000f },
-{ -0.951056f, 0.162460f, 0.262866f },
-{ -1.000000f, 0.000000f, 0.000000f },
-{ -0.850651f, 0.000000f, 0.525731f },
-{ -0.955423f, -0.295242f, 0.000000f },
-{ -0.951056f, -0.162460f, 0.262866f },
-{ -0.864188f, 0.442863f, -0.238856f },
-{ -0.951056f, 0.162460f, -0.262866f },
-{ -0.809017f, 0.309017f, -0.500000f },
-{ -0.864188f, -0.442863f, -0.238856f },
-{ -0.951056f, -0.162460f, -0.262866f },
-{ -0.809017f, -0.309017f, -0.500000f },
-{ -0.681718f, 0.147621f, -0.716567f },
-{ -0.681718f, -0.147621f, -0.716567f },
-{ -0.850651f, 0.000000f, -0.525731f },
-{ -0.688191f, 0.587785f, -0.425325f },
-{ -0.587785f, 0.425325f, -0.688191f },
-{ -0.425325f, 0.688191f, -0.587785f },
-{ -0.425325f, -0.688191f, -0.587785f },
-{ -0.587785f, -0.425325f, -0.688191f },
-{ -0.688191f, -0.587785f, -0.425325f }
-};
-
-#endif // !! include guard
diff --git a/3rdparty/assimp/code/MD3FileData.h b/3rdparty/assimp/code/MD3FileData.h
deleted file mode 100644
index edc34d2f..00000000
--- a/3rdparty/assimp/code/MD3FileData.h
+++ /dev/null
@@ -1,315 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file Md3FileData.h
- *
- * @brief Defines helper data structures for importing MD3 files.
- * http://linux.ucla.edu/~phaethon/q3/formats/md3format.html
- */
-#ifndef AI_MD3FILEHELPER_H_INC
-#define AI_MD3FILEHELPER_H_INC
-
-#include <string>
-#include <vector>
-#include <sstream>
-
-#include "../include/aiTypes.h"
-#include "../include/aiMesh.h"
-#include "../include/aiAnim.h"
-
-#include "./../include/Compiler/pushpack1.h"
-
-namespace Assimp {
-namespace MD3 {
-
-// to make it easier for us, we test the magic word against both "endianesses"
-#define AI_MD3_MAGIC_NUMBER_BE AI_MAKE_MAGIC("IDP3")
-#define AI_MD3_MAGIC_NUMBER_LE AI_MAKE_MAGIC("3PDI")
-
-// common limitations
-#define AI_MD3_VERSION 15
-#define AI_MD3_MAXQPATH 64
-#define AI_MD3_MAXFRAME 16
-#define AI_MD3_MAX_FRAMES 1024
-#define AI_MD3_MAX_TAGS 16
-#define AI_MD3_MAX_SURFACES 32
-#define AI_MD3_MAX_SHADERS 256
-#define AI_MD3_MAX_VERTS 4096
-#define AI_MD3_MAX_TRIANGLES 8192
-
-// master scale factor for all vertices in a MD3 model
-#define AI_MD3_XYZ_SCALE (1.0f/64.0f)
-
-// -------------------------------------------------------------------------------
-/** @brief Data structure for the MD3 main header
- */
-struct Header
-{
- //! magic number
- uint32_t IDENT;
-
- //! file format version
- uint32_t VERSION;
-
- //! original name in .pak archive
- char NAME[ AI_MD3_MAXQPATH ];
-
- //! unknown
- int32_t FLAGS;
-
- //! number of frames in the file
- uint32_t NUM_FRAMES;
-
- //! number of tags in the file
- uint32_t NUM_TAGS;
-
- //! number of surfaces in the file
- uint32_t NUM_SURFACES;
-
- //! number of skins in the file
- uint32_t NUM_SKINS;
-
- //! offset of the first frame
- uint32_t OFS_FRAMES;
-
- //! offset of the first tag
- uint32_t OFS_TAGS;
-
- //! offset of the first surface
- uint32_t OFS_SURFACES;
-
- //! end of file
- uint32_t OFS_EOF;
-} PACK_STRUCT;
-
-
-// -------------------------------------------------------------------------------
-/** @brief Data structure for the frame header
- */
-struct Frame
-{
- //! minimum bounds
- aiVector3D min;
-
- //! maximum bounds
- aiVector3D max;
-
- //! local origin for this frame
- aiVector3D origin;
-
- //! radius of bounding sphere
- float radius;
-
- //! name of frame
- char name[ AI_MD3_MAXFRAME ];
-
-} PACK_STRUCT;
-
-
-// -------------------------------------------------------------------------------
-/** @brief Data structure for the tag header
- */
-struct Tag
-{
- //! name of the tag
- char NAME[ AI_MD3_MAXQPATH ];
-
- //! Local tag origin and orientation
- aiVector3D origin;
- float orientation[3][3];
-
-} PACK_STRUCT;
-
-
-// -------------------------------------------------------------------------------
-/** @brief Data structure for the surface header
- */
-struct Surface
-{
- //! magic number
- int32_t IDENT;
-
- //! original name of the surface
- char NAME[ AI_MD3_MAXQPATH ];
-
- //! unknown
- int32_t FLAGS;
-
- //! number of frames in the surface
- uint32_t NUM_FRAMES;
-
- //! number of shaders in the surface
- uint32_t NUM_SHADER;
-
- //! number of vertices in the surface
- uint32_t NUM_VERTICES;
-
- //! number of triangles in the surface
- uint32_t NUM_TRIANGLES;
-
-
- //! offset to the triangle data
- uint32_t OFS_TRIANGLES;
-
- //! offset to the shader data
- uint32_t OFS_SHADERS;
-
- //! offset to the texture coordinate data
- uint32_t OFS_ST;
-
- //! offset to the vertex/normal data
- uint32_t OFS_XYZNORMAL;
-
- //! offset to the end of the Surface object
- int32_t OFS_END;
-} PACK_STRUCT;
-
-// -------------------------------------------------------------------------------
-/** @brief Data structure for a shader defined in there
- */
-struct Shader
-{
- //! filename of the shader
- char NAME[ AI_MD3_MAXQPATH ];
-
- //! index of the shader
- uint32_t SHADER_INDEX;
-} PACK_STRUCT;
-
-
-// -------------------------------------------------------------------------------
-/** @brief Data structure for a triangle
- */
-struct Triangle
-{
- //! triangle indices
- uint32_t INDEXES[3];
-} PACK_STRUCT;
-
-
-// -------------------------------------------------------------------------------
-/** @brief Data structure for an UV coord
- */
-struct TexCoord
-{
- //! UV coordinates
- float U,V;
-} PACK_STRUCT;
-
-
-// -------------------------------------------------------------------------------
-/** @brief Data structure for a vertex
- */
-struct Vertex
-{
- //! X/Y/Z coordinates
- int16_t X,Y,Z;
-
- //! encoded normal vector
- uint16_t NORMAL;
-} PACK_STRUCT;
-
-#include "./../include/Compiler/poppack1.h"
-
-// -------------------------------------------------------------------------------
-/** @brief Unpack a Q3 16 bit vector to its full float3 representation
- *
- * @param p_iNormal Input normal vector in latitude/longitude form
- * @param p_afOut Pointer to an array of three floats to receive the result
- *
- * @note This has been taken from q3 source (misc_model.c)
- */
-inline void LatLngNormalToVec3(uint16_t p_iNormal, float* p_afOut)
-{
- float lat = (float)(( p_iNormal >> 8u ) & 0xff);
- float lng = (float)(( p_iNormal & 0xff ));
- lat *= 3.141926f/128.0f;
- lng *= 3.141926f/128.0f;
-
- p_afOut[0] = cosf(lat) * sinf(lng);
- p_afOut[1] = sinf(lat) * sinf(lng);
- p_afOut[2] = cosf(lng);
- return;
-}
-
-
-// -------------------------------------------------------------------------------
-/** @brief Pack a Q3 normal into 16bit latitute/longitude representation
- * @param p_vIn Input vector
- * @param p_iOut Output normal
- *
- * @note This has been taken from q3 source (mathlib.c)
- */
-inline void Vec3NormalToLatLng( const aiVector3D& p_vIn, uint16_t& p_iOut )
-{
- // check for singularities
- if ( 0.0f == p_vIn[0] && 0.0f == p_vIn[1] )
- {
- if ( p_vIn[2] > 0.0f )
- {
- ((unsigned char*)&p_iOut)[0] = 0;
- ((unsigned char*)&p_iOut)[1] = 0; // lat = 0, long = 0
- }
- else
- {
- ((unsigned char*)&p_iOut)[0] = 128;
- ((unsigned char*)&p_iOut)[1] = 0; // lat = 0, long = 128
- }
- }
- else
- {
- int a, b;
-
- a = int(57.2957795f * ( atan2f( p_vIn[1], p_vIn[0] ) ) * (255.0f / 360.0f ));
- a &= 0xff;
-
- b = int(57.2957795f * ( acosf( p_vIn[2] ) ) * ( 255.0f / 360.0f ));
- b &= 0xff;
-
- ((unsigned char*)&p_iOut)[0] = b; // longitude
- ((unsigned char*)&p_iOut)[1] = a; // lattitude
- }
-}
-
-}
-}
-
-#endif // !! AI_MD3FILEHELPER_H_INC
-
diff --git a/3rdparty/assimp/code/MD3Loader.cpp b/3rdparty/assimp/code/MD3Loader.cpp
deleted file mode 100644
index fe1e68a1..00000000
--- a/3rdparty/assimp/code/MD3Loader.cpp
+++ /dev/null
@@ -1,1043 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file MD3Loader.cpp
- * @brief Implementation of the MD3 importer class
- *
- * Sources:
- * http://www.gamers.org/dEngine/quake3/UQ3S
- * http://linux.ucla.edu/~phaethon/q3/formats/md3format.html
- * http://www.heppler.com/shader/shader/
- */
-
-#include "AssimpPCH.h"
-#ifndef ASSIMP_BUILD_NO_MD3_IMPORTER
-
-#include "MD3Loader.h"
-#include "ByteSwap.h"
-#include "SceneCombiner.h"
-#include "GenericProperty.h"
-#include "RemoveComments.h"
-#include "ParsingUtils.h"
-
-using namespace Assimp;
-
-// ------------------------------------------------------------------------------------------------
-// Convert a Q3 shader blend function to the appropriate enum value
-Q3Shader::BlendFunc StringToBlendFunc(const std::string& m)
-{
- if (m == "GL_ONE") {
- return Q3Shader::BLEND_GL_ONE;
- }
- if (m == "GL_ZERO") {
- return Q3Shader::BLEND_GL_ZERO;
- }
- if (m == "GL_SRC_ALPHA") {
- return Q3Shader::BLEND_GL_SRC_ALPHA;
- }
- if (m == "GL_ONE_MINUS_SRC_ALPHA") {
- return Q3Shader::BLEND_GL_ONE_MINUS_SRC_ALPHA;
- }
- if (m == "GL_ONE_MINUS_DST_COLOR") {
- return Q3Shader::BLEND_GL_ONE_MINUS_DST_COLOR;
- }
- DefaultLogger::get()->error("Q3Shader: Unknown blend function: " + m);
- return Q3Shader::BLEND_NONE;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Load a Quake 3 shader
-bool Q3Shader::LoadShader(ShaderData& fill, const std::string& pFile,IOSystem* io)
-{
- boost::scoped_ptr<IOStream> file( io->Open( pFile, "rt"));
- if (!file.get())
- return false; // if we can't access the file, don't worry and return
-
- DefaultLogger::get()->info("Loading Quake3 shader file " + pFile);
-
- // read file in memory
- const size_t s = file->FileSize();
- std::vector<char> _buff(s+1);
- file->Read(&_buff[0],s,1);
- _buff[s] = 0;
-
- // remove comments from it (C++ style)
- CommentRemover::RemoveLineComments("//",&_buff[0]);
- const char* buff = &_buff[0];
-
- Q3Shader::ShaderDataBlock* curData = NULL;
- Q3Shader::ShaderMapBlock* curMap = NULL;
-
- // read line per line
- for (;SkipSpacesAndLineEnd(&buff);SkipLine(&buff)) {
-
- if (*buff == '{') {
- ++buff;
-
- // append to last section, if any
- if (!curData) {
- DefaultLogger::get()->error("Q3Shader: Unexpected shader section token \'{\'");
- return true; // still no failure, the file is there
- }
-
- // read this data section
- for (;SkipSpacesAndLineEnd(&buff);SkipLine(&buff)) {
- if (*buff == '{') {
- ++buff;
- // add new map section
- curData->maps.push_back(Q3Shader::ShaderMapBlock());
- curMap = &curData->maps.back();
-
- for (;SkipSpacesAndLineEnd(&buff);SkipLine(&buff)) {
- // 'map' - Specifies texture file name
- if (TokenMatchI(buff,"map",3) || TokenMatchI(buff,"clampmap",8)) {
- curMap->name = GetNextToken(buff);
- }
- // 'blendfunc' - Alpha blending mode
- else if (TokenMatchI(buff,"blendfunc",9)) {
- const std::string blend_src = GetNextToken(buff);
- if (blend_src == "add") {
- curMap->blend_src = Q3Shader::BLEND_GL_ONE;
- curMap->blend_dest = Q3Shader::BLEND_GL_ONE;
- }
- else if (blend_src == "filter") {
- curMap->blend_src = Q3Shader::BLEND_GL_DST_COLOR;
- curMap->blend_dest = Q3Shader::BLEND_GL_ZERO;
- }
- else if (blend_src == "blend") {
- curMap->blend_src = Q3Shader::BLEND_GL_SRC_ALPHA;
- curMap->blend_dest = Q3Shader::BLEND_GL_ONE_MINUS_SRC_ALPHA;
- }
- else {
- curMap->blend_src = StringToBlendFunc(blend_src);
- curMap->blend_dest = StringToBlendFunc(GetNextToken(buff));
- }
- }
- // 'alphafunc' - Alpha testing mode
- else if (TokenMatchI(buff,"alphafunc",9)) {
- const std::string at = GetNextToken(buff);
- if (at == "GT0") {
- curMap->alpha_test = Q3Shader::AT_GT0;
- }
- else if (at == "LT128") {
- curMap->alpha_test = Q3Shader::AT_LT128;
- }
- else if (at == "GE128") {
- curMap->alpha_test = Q3Shader::AT_GE128;
- }
- }
- else if (*buff == '}') {
- ++buff;
- // close this map section
- curMap = NULL;
- break;
- }
- }
-
- }
- else if (*buff == '}') {
- ++buff;
- curData = NULL;
- break;
- }
-
- // 'cull' specifies culling behaviour for the model
- else if (TokenMatchI(buff,"cull",4)) {
- SkipSpaces(&buff);
- if (!ASSIMP_strincmp(buff,"back",4)) {
- curData->cull = Q3Shader::CULL_CCW;
- }
- else if (!ASSIMP_strincmp(buff,"front",5)) {
- curData->cull = Q3Shader::CULL_CW;
- }
- else if (!ASSIMP_strincmp(buff,"none",4) || !ASSIMP_strincmp(buff,"disable",7)) {
- curData->cull = Q3Shader::CULL_NONE;
- }
- else DefaultLogger::get()->error("Q3Shader: Unrecognized cull mode");
- }
- }
- }
-
- else {
- // add new section
- fill.blocks.push_back(Q3Shader::ShaderDataBlock());
- curData = &fill.blocks.back();
-
- // get the name of this section
- curData->name = GetNextToken(buff);
- }
- }
- return true;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Load a Quake 3 skin
-bool Q3Shader::LoadSkin(SkinData& fill, const std::string& pFile,IOSystem* io)
-{
- boost::scoped_ptr<IOStream> file( io->Open( pFile, "rt"));
- if (!file.get())
- return false; // if we can't access the file, don't worry and return
-
- DefaultLogger::get()->info("Loading Quake3 skin file " + pFile);
-
- // read file in memory
- const size_t s = file->FileSize();
- std::vector<char> _buff(s+1);const char* buff = &_buff[0];
- file->Read(&_buff[0],s,1);
- _buff[s] = 0;
-
- // remove commas
- std::replace(_buff.begin(),_buff.end(),',',' ');
-
- // read token by token and fill output table
- for (;*buff;) {
- SkipSpacesAndLineEnd(&buff);
-
- // get first identifier
- std::string ss = GetNextToken(buff);
-
- // ignore tokens starting with tag_
- if (!::strncmp(&ss[0],"tag_",std::min((size_t)4, ss.length())))
- continue;
-
- fill.textures.push_back(SkinData::TextureEntry());
- SkinData::TextureEntry& s = fill.textures.back();
-
- s.first = ss;
- s.second = GetNextToken(buff);
- }
- return true;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Convert Q3Shader to material
-void Q3Shader::ConvertShaderToMaterial(MaterialHelper* out, const ShaderDataBlock& shader)
-{
- ai_assert(NULL != out);
-
- /* IMPORTANT: This is not a real conversion. Actually we're just guessing and
- * hacking around to build an aiMaterial that looks nearly equal to the
- * original Quake 3 shader. We're missing some important features like
- * animatable material properties in our material system, but at least
- * multiple textures should be handled correctly.
- */
-
- // Two-sided material?
- if (shader.cull == Q3Shader::CULL_NONE) {
- const int twosided = 1;
- out->AddProperty(&twosided,1,AI_MATKEY_TWOSIDED);
- }
-
- unsigned int cur_emissive = 0, cur_diffuse = 0, cur_lm =0;
-
- // Iterate through all textures
- for (std::list< Q3Shader::ShaderMapBlock >::const_iterator it = shader.maps.begin(); it != shader.maps.end();++it) {
-
- // CONVERSION BEHAVIOUR:
- //
- //
- // If the texture is additive
- // - if it is the first texture, assume additive blending for the whole material
- // - otherwise register it as emissive texture.
- //
- // If the texture is using standard blend (or if the blend mode is unknown)
- // - if first texture: assume default blending for material
- // - in any case: set it as diffuse texture
- //
- // If the texture is using 'filter' blending
- // - take as lightmap
- //
- // Textures with alpha funcs
- // - aiTextureFlags_UseAlpha is set (otherwise aiTextureFlags_NoAlpha is explicitly set)
- aiString s((*it).name);
- aiTextureType type; unsigned int index;
-
- if ((*it).blend_src == Q3Shader::BLEND_GL_ONE && (*it).blend_dest == Q3Shader::BLEND_GL_ONE) {
- if (it == shader.maps.begin()) {
- const int additive = aiBlendMode_Additive;
- out->AddProperty(&additive,1,AI_MATKEY_BLEND_FUNC);
-
- index = cur_diffuse++;
- type = aiTextureType_DIFFUSE;
- }
- else {
- index = cur_emissive++;
- type = aiTextureType_EMISSIVE;
- }
- }
- else if ((*it).blend_src == Q3Shader::BLEND_GL_DST_COLOR && (*it).blend_dest == Q3Shader::BLEND_GL_ZERO) {
- index = cur_lm++;
- type = aiTextureType_LIGHTMAP;
- }
- else {
- const int blend = aiBlendMode_Default;
- out->AddProperty(&blend,1,AI_MATKEY_BLEND_FUNC);
-
- index = cur_diffuse++;
- type = aiTextureType_DIFFUSE;
- }
-
- // setup texture
- out->AddProperty(&s,AI_MATKEY_TEXTURE(type,index));
-
- // setup texture flags
- const int use_alpha = ((*it).alpha_test != Q3Shader::AT_NONE ? aiTextureFlags_UseAlpha : aiTextureFlags_IgnoreAlpha);
- out->AddProperty(&use_alpha,1,AI_MATKEY_TEXFLAGS(type,index));
- }
- // If at least one emissive texture was set, set the emissive base color to 1 to ensure
- // the texture is actually displayed.
- if (0 != cur_emissive) {
- aiColor3D one(1.f,1.f,1.f);
- out->AddProperty(&one,1,AI_MATKEY_COLOR_EMISSIVE);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-MD3Importer::MD3Importer()
-: configFrameID (0)
-, configHandleMP (true)
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-MD3Importer::~MD3Importer()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the class can handle the format of the given file.
-bool MD3Importer::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const
-{
- const std::string extension = GetExtension(pFile);
- if (extension == "md3")
- return true;
-
- // if check for extension is not enough, check for the magic tokens
- if (!extension.length() || checkSig) {
- uint32_t tokens[1];
- tokens[0] = AI_MD3_MAGIC_NUMBER_LE;
- return CheckMagicToken(pIOHandler,pFile,tokens,1);
- }
- return false;
-}
-
-// ------------------------------------------------------------------------------------------------
-void MD3Importer::ValidateHeaderOffsets()
-{
- // Check magic number
- if (pcHeader->IDENT != AI_MD3_MAGIC_NUMBER_BE &&
- pcHeader->IDENT != AI_MD3_MAGIC_NUMBER_LE)
- throw DeadlyImportError( "Invalid MD3 file: Magic bytes not found");
-
- // Check file format version
- if (pcHeader->VERSION > 15)
- DefaultLogger::get()->warn( "Unsupported MD3 file version. Continuing happily ...");
-
- // Check some offset values whether they are valid
- if (!pcHeader->NUM_SURFACES)
- throw DeadlyImportError( "Invalid md3 file: NUM_SURFACES is 0");
-
- if (pcHeader->OFS_FRAMES >= fileSize || pcHeader->OFS_SURFACES >= fileSize ||
- pcHeader->OFS_EOF > fileSize) {
- throw DeadlyImportError("Invalid MD3 header: some offsets are outside the file");
- }
-
- if (pcHeader->NUM_FRAMES <= configFrameID )
- throw DeadlyImportError("The requested frame is not existing the file");
-}
-
-// ------------------------------------------------------------------------------------------------
-void MD3Importer::ValidateSurfaceHeaderOffsets(const MD3::Surface* pcSurf)
-{
- // Calculate the relative offset of the surface
- const int32_t ofs = int32_t((const unsigned char*)pcSurf-this->mBuffer);
-
- // Check whether all data chunks are inside the valid range
- if (pcSurf->OFS_TRIANGLES + ofs + pcSurf->NUM_TRIANGLES * sizeof(MD3::Triangle) > fileSize ||
- pcSurf->OFS_SHADERS + ofs + pcSurf->NUM_SHADER * sizeof(MD3::Shader) > fileSize ||
- pcSurf->OFS_ST + ofs + pcSurf->NUM_VERTICES * sizeof(MD3::TexCoord) > fileSize ||
- pcSurf->OFS_XYZNORMAL + ofs + pcSurf->NUM_VERTICES * sizeof(MD3::Vertex) > fileSize) {
-
- throw DeadlyImportError("Invalid MD3 surface header: some offsets are outside the file");
- }
-
- // Check whether all requirements for Q3 files are met. We don't
- // care, but probably someone does.
- if (pcSurf->NUM_TRIANGLES > AI_MD3_MAX_TRIANGLES) {
- DefaultLogger::get()->warn("MD3: Quake III triangle limit exceeded");
- }
-
- if (pcSurf->NUM_SHADER > AI_MD3_MAX_SHADERS) {
- DefaultLogger::get()->warn("MD3: Quake III shader limit exceeded");
- }
-
- if (pcSurf->NUM_VERTICES > AI_MD3_MAX_VERTS) {
- DefaultLogger::get()->warn("MD3: Quake III vertex limit exceeded");
- }
-
- if (pcSurf->NUM_FRAMES > AI_MD3_MAX_FRAMES) {
- DefaultLogger::get()->warn("MD3: Quake III frame limit exceeded");
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void MD3Importer::GetExtensionList(std::set<std::string>& extensions)
-{
- extensions.insert("md3");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Setup configuration properties
-void MD3Importer::SetupProperties(const Importer* pImp)
-{
- // The
- // AI_CONFIG_IMPORT_MD3_KEYFRAME option overrides the
- // AI_CONFIG_IMPORT_GLOBAL_KEYFRAME option.
- configFrameID = pImp->GetPropertyInteger(AI_CONFIG_IMPORT_MD3_KEYFRAME,0xffffffff);
- if (0xffffffff == configFrameID) {
- configFrameID = pImp->GetPropertyInteger(AI_CONFIG_IMPORT_GLOBAL_KEYFRAME,0);
- }
-
- // AI_CONFIG_IMPORT_MD3_HANDLE_MULTIPART
- configHandleMP = (0 != pImp->GetPropertyInteger(AI_CONFIG_IMPORT_MD3_HANDLE_MULTIPART,1));
-
- // AI_CONFIG_IMPORT_MD3_SKIN_NAME
- configSkinFile = (pImp->GetPropertyString(AI_CONFIG_IMPORT_MD3_SKIN_NAME,"default"));
-
- // AI_CONFIG_IMPORT_MD3_SHADER_SRC
- configShaderFile = (pImp->GetPropertyString(AI_CONFIG_IMPORT_MD3_SHADER_SRC,""));
-
- // AI_CONFIG_FAVOUR_SPEED
- configSpeedFlag = (0 != pImp->GetPropertyInteger(AI_CONFIG_FAVOUR_SPEED,0));
-}
-
-// ------------------------------------------------------------------------------------------------
-// Try to read the skin for a MD3 file
-void MD3Importer::ReadSkin(Q3Shader::SkinData& fill) const
-{
- // skip any postfixes (e.g. lower_1.md3)
- std::string::size_type s = filename.find_last_of('_');
- if (s == std::string::npos) {
- s = filename.find_last_of('.');
- }
- ai_assert(s != std::string::npos);
-
- const std::string skin_file = path + filename.substr(0,s) + "_" + configSkinFile + ".skin";
- Q3Shader::LoadSkin(fill,skin_file,mIOHandler);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Try to read the shader for a MD3 file
-void MD3Importer::ReadShader(Q3Shader::ShaderData& fill) const
-{
- // Determine Q3 model name from given path
- std::string::size_type s = path.find_last_of("\\/",path.length()-2);
- const std::string model_file = path.substr(s+1,path.length()-(s+2));
-
- // If no specific dir or file is given, use our default search behaviour
- if (!configShaderFile.length()) {
- if (!Q3Shader::LoadShader(fill,path + "..\\..\\..\\scripts\\" + model_file + ".shader",mIOHandler)) {
- Q3Shader::LoadShader(fill,path + "..\\..\\..\\scripts\\" + filename + ".shader",mIOHandler);
- }
- }
- else {
- // If the given string specifies a file, load this file.
- // Otherwise it's a directory.
- std::string::size_type st = configShaderFile.find_last_of('.');
- if (st == std::string::npos) {
-
- if (!Q3Shader::LoadShader(fill,configShaderFile + model_file + ".shader",mIOHandler)) {
- Q3Shader::LoadShader(fill,configShaderFile + filename + ".shader",mIOHandler);
- }
- }
- else {
- Q3Shader::LoadShader(fill,configShaderFile,mIOHandler);
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Tiny helper to remove a single node from its parent' list
-void RemoveSingleNodeFromList(aiNode* nd)
-{
- if (!nd || nd->mNumChildren || !nd->mParent)return;
- aiNode* par = nd->mParent;
- for (unsigned int i = 0; i < par->mNumChildren;++i) {
- if (par->mChildren[i] == nd) {
- --par->mNumChildren;
- for (;i < par->mNumChildren;++i) {
- par->mChildren[i] = par->mChildren[i+1];
- }
- delete nd;
- break;
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Read a multi-part Q3 player model
-bool MD3Importer::ReadMultipartFile()
-{
- // check whether the file name contains a common postfix, e.g lower_2.md3
- std::string::size_type s = filename.find_last_of('_'), t = filename.find_last_of('.');
- ai_assert(t != std::string::npos);
- if (s == std::string::npos)
- s = t;
-
- const std::string mod_filename = filename.substr(0,s);
- const std::string suffix = filename.substr(s,t-s);
-
- if (mod_filename == "lower" || mod_filename == "upper" || mod_filename == "head"){
- const std::string lower = path + "lower" + suffix + ".md3";
- const std::string upper = path + "upper" + suffix + ".md3";
- const std::string head = path + "head" + suffix + ".md3";
-
- aiScene* scene_upper = NULL;
- aiScene* scene_lower = NULL;
- aiScene* scene_head = NULL;
- std::string failure;
-
- aiNode* tag_torso, *tag_head;
- std::vector<AttachmentInfo> attach;
-
- DefaultLogger::get()->info("Multi part MD3 player model: lower, upper and head parts are joined");
-
- // ensure we won't try to load ourselves recursively
- BatchLoader::PropertyMap props;
- SetGenericProperty( props.ints, AI_CONFIG_IMPORT_MD3_HANDLE_MULTIPART, 0, NULL);
-
- // now read these three files
- BatchLoader batch(mIOHandler);
- const unsigned int _lower = batch.AddLoadRequest(lower,0,&props);
- const unsigned int _upper = batch.AddLoadRequest(upper,0,&props);
- const unsigned int _head = batch.AddLoadRequest(head,0,&props);
- batch.LoadAll();
-
- // now construct a dummy scene to place these three parts in
- aiScene* master = new aiScene();
- aiNode* nd = master->mRootNode = new aiNode();
- nd->mName.Set("<MD3_Player>");
-
- // ... and get them. We need all of them.
- scene_lower = batch.GetImport(_lower);
- if (!scene_lower) {
- DefaultLogger::get()->error("M3D: Failed to read multi part model, lower.md3 fails to load");
- failure = "lower";
- goto error_cleanup;
- }
-
- scene_upper = batch.GetImport(_upper);
- if (!scene_upper) {
- DefaultLogger::get()->error("M3D: Failed to read multi part model, upper.md3 fails to load");
- failure = "upper";
- goto error_cleanup;
- }
-
- scene_head = batch.GetImport(_head);
- if (!scene_head) {
- DefaultLogger::get()->error("M3D: Failed to read multi part model, head.md3 fails to load");
- failure = "head";
- goto error_cleanup;
- }
-
- // build attachment infos. search for typical Q3 tags
-
- // original root
- scene_lower->mRootNode->mName.Set("lower");
- attach.push_back(AttachmentInfo(scene_lower, nd));
-
- // tag_torso
- tag_torso = scene_lower->mRootNode->FindNode("tag_torso");
- if (!tag_torso) {
- DefaultLogger::get()->error("M3D: Failed to find attachment tag for multi part model: tag_torso expected");
- goto error_cleanup;
- }
- scene_upper->mRootNode->mName.Set("upper");
- attach.push_back(AttachmentInfo(scene_upper,tag_torso));
-
- // tag_head
- tag_head = scene_upper->mRootNode->FindNode("tag_head");
- if (!tag_head) {
- DefaultLogger::get()->error("M3D: Failed to find attachment tag for multi part model: tag_head expected");
- goto error_cleanup;
- }
- scene_head->mRootNode->mName.Set("head");
- attach.push_back(AttachmentInfo(scene_head,tag_head));
-
- // Remove tag_head and tag_torso from all other model parts ...
- // this ensures (together with AI_INT_MERGE_SCENE_GEN_UNIQUE_NAMES_IF_NECESSARY)
- // that tag_torso/tag_head is also the name of the (unique) output node
- RemoveSingleNodeFromList (scene_upper->mRootNode->FindNode("tag_torso"));
- RemoveSingleNodeFromList (scene_head-> mRootNode->FindNode("tag_head" ));
-
- // Undo the rotations which we applied to the coordinate systems. We're
- // working in global Quake space here
- scene_head->mRootNode->mTransformation = aiMatrix4x4();
- scene_lower->mRootNode->mTransformation = aiMatrix4x4();
- scene_upper->mRootNode->mTransformation = aiMatrix4x4();
-
- // and merge the scenes
- SceneCombiner::MergeScenes(&mScene,master, attach,
- AI_INT_MERGE_SCENE_GEN_UNIQUE_NAMES |
- AI_INT_MERGE_SCENE_GEN_UNIQUE_MATNAMES |
- AI_INT_MERGE_SCENE_RESOLVE_CROSS_ATTACHMENTS |
- (!configSpeedFlag ? AI_INT_MERGE_SCENE_GEN_UNIQUE_NAMES_IF_NECESSARY : 0));
-
- // Now rotate the whole scene 90 degrees around the x axis to convert to internal coordinate system
- mScene->mRootNode->mTransformation = aiMatrix4x4(1.f,0.f,0.f,0.f,
- 0.f,0.f,1.f,0.f,0.f,-1.f,0.f,0.f,0.f,0.f,0.f,1.f);
-
- return true;
-
-error_cleanup:
- delete scene_upper;
- delete scene_lower;
- delete scene_head;
- delete master;
-
- if (failure == mod_filename) {
- throw DeadlyImportError("MD3: failure to read multipart host file");
- }
- }
- return false;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Convert a MD3 path to a proper value
-void MD3Importer::ConvertPath(const char* texture_name, const char* header_name, std::string& out) const
-{
- // If the MD3's internal path itself and the given path are using
- // the same directory, remove it completely to get right output paths.
- const char* end1 = ::strrchr(header_name,'\\');
- if (!end1)end1 = ::strrchr(header_name,'/');
-
- const char* end2 = ::strrchr(texture_name,'\\');
- if (!end2)end2 = ::strrchr(texture_name,'/');
-
- // HACK: If the paths starts with "models", ignore the
- // next two hierarchy levels, it specifies just the model name.
- // Ignored by Q3, it might be not equal to the real model location.
- if (end2) {
-
- size_t len2;
- const size_t len1 = (size_t)(end1 - header_name);
- if (!ASSIMP_strincmp(texture_name,"models",6) && (texture_name[6] == '/' || texture_name[6] == '\\')) {
- len2 = 6; // ignore the seventh - could be slash or backslash
-
- if (!header_name[0]) {
- // Use the file name only
- out = end2+1;
- return;
- }
- }
- else len2 = std::min (len1, (size_t)(end2 - texture_name ));
- if (!ASSIMP_strincmp(texture_name,header_name,len2)) {
- // Use the file name only
- out = end2+1;
- return;
- }
- }
- // Use the full path
- out = texture_name;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Imports the given file into the given scene structure.
-void MD3Importer::InternReadFile( const std::string& pFile,
- aiScene* pScene, IOSystem* pIOHandler)
-{
- mFile = pFile;
- mScene = pScene;
- mIOHandler = pIOHandler;
-
- // get base path and file name
- // todo ... move to PathConverter
- std::string::size_type s = mFile.find_last_of("/\\");
- if (s == std::string::npos) {
- s = 0;
- }
- else ++s;
- filename = mFile.substr(s), path = mFile.substr(0,s);
- for ( std::string::iterator it = filename .begin(); it != filename.end(); ++it)
- *it = tolower( *it);
-
- // Load multi-part model file, if necessary
- if (configHandleMP) {
- if (ReadMultipartFile())
- return;
- }
-
- boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile));
-
- // Check whether we can read from the file
- if ( file.get() == NULL)
- throw DeadlyImportError( "Failed to open MD3 file " + pFile + ".");
-
- // Check whether the md3 file is large enough to contain the header
- fileSize = (unsigned int)file->FileSize();
- if ( fileSize < sizeof(MD3::Header))
- throw DeadlyImportError( "MD3 File is too small.");
-
- // Allocate storage and copy the contents of the file to a memory buffer
- std::vector<unsigned char> mBuffer2 (fileSize);
- file->Read( &mBuffer2[0], 1, fileSize);
- mBuffer = &mBuffer2[0];
-
- pcHeader = (BE_NCONST MD3::Header*)mBuffer;
-
- // Ensure correct endianess
-#ifdef AI_BUILD_BIG_ENDIAN
-
- AI_SWAP4(pcHeader->VERSION);
- AI_SWAP4(pcHeader->FLAGS);
- AI_SWAP4(pcHeader->IDENT);
- AI_SWAP4(pcHeader->NUM_FRAMES);
- AI_SWAP4(pcHeader->NUM_SKINS);
- AI_SWAP4(pcHeader->NUM_SURFACES);
- AI_SWAP4(pcHeader->NUM_TAGS);
- AI_SWAP4(pcHeader->OFS_EOF);
- AI_SWAP4(pcHeader->OFS_FRAMES);
- AI_SWAP4(pcHeader->OFS_SURFACES);
- AI_SWAP4(pcHeader->OFS_TAGS);
-
-#endif
-
- // Validate the file header
- ValidateHeaderOffsets();
-
- // Navigate to the list of surfaces
- BE_NCONST MD3::Surface* pcSurfaces = (BE_NCONST MD3::Surface*)(mBuffer + pcHeader->OFS_SURFACES);
-
- // Navigate to the list of tags
- BE_NCONST MD3::Tag* pcTags = (BE_NCONST MD3::Tag*)(mBuffer + pcHeader->OFS_TAGS);
-
- // Allocate output storage
- pScene->mNumMeshes = pcHeader->NUM_SURFACES;
- pScene->mMeshes = new aiMesh*[pScene->mNumMeshes];
-
- pScene->mNumMaterials = pcHeader->NUM_SURFACES;
- pScene->mMaterials = new aiMaterial*[pScene->mNumMeshes];
-
- // Set arrays to zero to ensue proper destruction if an exception is raised
- ::memset(pScene->mMeshes,0,pScene->mNumMeshes*sizeof(aiMesh*));
- ::memset(pScene->mMaterials,0,pScene->mNumMaterials*sizeof(aiMaterial*));
-
- // Now read possible skins from .skin file
- Q3Shader::SkinData skins;
- ReadSkin(skins);
-
- // And check whether we can locate a shader file for this model
- Q3Shader::ShaderData shaders;
- ReadShader(shaders);
-
- // Adjust all texture paths in the shader
- const char* header_name = pcHeader->NAME;
- if (shaders.blocks.size()) {
- for (std::list< Q3Shader::ShaderDataBlock >::iterator dit = shaders.blocks.begin(); dit != shaders.blocks.end(); ++dit) {
- ConvertPath((*dit).name.c_str(),header_name,(*dit).name);
-
- for (std::list< Q3Shader::ShaderMapBlock >::iterator mit = (*dit).maps.begin(); mit != (*dit).maps.end(); ++mit) {
- ConvertPath((*mit).name.c_str(),header_name,(*mit).name);
- }
- }
- }
-
- // Read all surfaces from the file
- unsigned int iNum = pcHeader->NUM_SURFACES;
- unsigned int iNumMaterials = 0;
- while (iNum-- > 0) {
-
- // Ensure correct endianess
-#ifdef AI_BUILD_BIG_ENDIAN
-
- AI_SWAP4(pcSurfaces->FLAGS);
- AI_SWAP4(pcSurfaces->IDENT);
- AI_SWAP4(pcSurfaces->NUM_FRAMES);
- AI_SWAP4(pcSurfaces->NUM_SHADER);
- AI_SWAP4(pcSurfaces->NUM_TRIANGLES);
- AI_SWAP4(pcSurfaces->NUM_VERTICES);
- AI_SWAP4(pcSurfaces->OFS_END);
- AI_SWAP4(pcSurfaces->OFS_SHADERS);
- AI_SWAP4(pcSurfaces->OFS_ST);
- AI_SWAP4(pcSurfaces->OFS_TRIANGLES);
- AI_SWAP4(pcSurfaces->OFS_XYZNORMAL);
-
-#endif
-
- // Validate the surface header
- ValidateSurfaceHeaderOffsets(pcSurfaces);
-
- // Navigate to the vertex list of the surface
- BE_NCONST MD3::Vertex* pcVertices = (BE_NCONST MD3::Vertex*)
- (((uint8_t*)pcSurfaces) + pcSurfaces->OFS_XYZNORMAL);
-
- // Navigate to the triangle list of the surface
- BE_NCONST MD3::Triangle* pcTriangles = (BE_NCONST MD3::Triangle*)
- (((uint8_t*)pcSurfaces) + pcSurfaces->OFS_TRIANGLES);
-
- // Navigate to the texture coordinate list of the surface
- BE_NCONST MD3::TexCoord* pcUVs = (BE_NCONST MD3::TexCoord*)
- (((uint8_t*)pcSurfaces) + pcSurfaces->OFS_ST);
-
- // Navigate to the shader list of the surface
- BE_NCONST MD3::Shader* pcShaders = (BE_NCONST MD3::Shader*)
- (((uint8_t*)pcSurfaces) + pcSurfaces->OFS_SHADERS);
-
- // If the submesh is empty ignore it
- if (0 == pcSurfaces->NUM_VERTICES || 0 == pcSurfaces->NUM_TRIANGLES)
- {
- pcSurfaces = (BE_NCONST MD3::Surface*)(((uint8_t*)pcSurfaces) + pcSurfaces->OFS_END);
- pScene->mNumMeshes--;
- continue;
- }
-
- // Allocate output mesh
- pScene->mMeshes[iNum] = new aiMesh();
- aiMesh* pcMesh = pScene->mMeshes[iNum];
-
- std::string _texture_name;
- const char* texture_name = NULL;
-
- // Check whether we have a texture record for this surface in the .skin file
- std::list< Q3Shader::SkinData::TextureEntry >::iterator it = std::find(
- skins.textures.begin(), skins.textures.end(), pcSurfaces->NAME );
-
- if (it != skins.textures.end()) {
- texture_name = &*( _texture_name = (*it).second).begin();
- DefaultLogger::get()->debug("MD3: Assigning skin texture " + (*it).second + " to surface " + pcSurfaces->NAME);
- (*it).resolved = true; // mark entry as resolved
- }
-
- // Get the first shader (= texture?) assigned to the surface
- if (!texture_name && pcSurfaces->NUM_SHADER) {
- texture_name = pcShaders->NAME;
- }
-
- std::string convertedPath;
- if (texture_name) {
- ConvertPath(texture_name,header_name,convertedPath);
- }
-
- const Q3Shader::ShaderDataBlock* shader = NULL;
-
- // Now search the current shader for a record with this name (
- // excluding texture file extension)
- if (shaders.blocks.size()) {
-
- std::string::size_type s = convertedPath.find_last_of('.');
- if (s == std::string::npos)
- s = convertedPath.length();
-
- const std::string without_ext = convertedPath.substr(0,s);
- std::list< Q3Shader::ShaderDataBlock >::const_iterator dit = std::find(shaders.blocks.begin(),shaders.blocks.end(),without_ext);
- if (dit != shaders.blocks.end()) {
- // Hurra, wir haben einen. Tolle Sache.
- shader = &*dit;
- DefaultLogger::get()->info("Found shader record for " +without_ext );
- }
- else DefaultLogger::get()->warn("Unable to find shader record for " +without_ext );
- }
-
- MaterialHelper* pcHelper = new MaterialHelper();
-
- const int iMode = (int)aiShadingMode_Gouraud;
- pcHelper->AddProperty<int>(&iMode, 1, AI_MATKEY_SHADING_MODEL);
-
- // Add a small ambient color value - Quake 3 seems to have one
- aiColor3D clr;
- clr.b = clr.g = clr.r = 0.05f;
- pcHelper->AddProperty<aiColor3D>(&clr, 1,AI_MATKEY_COLOR_AMBIENT);
-
- clr.b = clr.g = clr.r = 1.0f;
- pcHelper->AddProperty<aiColor3D>(&clr, 1,AI_MATKEY_COLOR_DIFFUSE);
- pcHelper->AddProperty<aiColor3D>(&clr, 1,AI_MATKEY_COLOR_SPECULAR);
-
- // use surface name + skin_name as material name
- aiString name;
- name.Set("MD3_[" + configSkinFile + "][" + pcSurfaces->NAME + "]");
- pcHelper->AddProperty(&name,AI_MATKEY_NAME);
-
- if (!shader) {
- // Setup dummy texture file name to ensure UV coordinates are kept during postprocessing
- aiString szString;
- if (convertedPath.length()) {
- szString.Set(convertedPath);
- }
- else {
- DefaultLogger::get()->warn("Texture file name has zero length. Using default name");
- szString.Set("dummy_texture.bmp");
- }
- pcHelper->AddProperty(&szString,AI_MATKEY_TEXTURE_DIFFUSE(0));
-
- // prevent transparency by default
- int no_alpha = aiTextureFlags_IgnoreAlpha;
- pcHelper->AddProperty(&no_alpha,1,AI_MATKEY_TEXFLAGS_DIFFUSE(0));
- }
- else {
- Q3Shader::ConvertShaderToMaterial(pcHelper,*shader);
- }
-
- pScene->mMaterials[iNumMaterials] = (aiMaterial*)pcHelper;
- pcMesh->mMaterialIndex = iNumMaterials++;
-
- // Ensure correct endianess
-#ifdef AI_BUILD_BIG_ENDIAN
-
- for (uint32_t i = 0; i < pcSurfaces->NUM_VERTICES;++i) {
- AI_SWAP2( pcVertices[i].NORMAL );
- AI_SWAP2( pcVertices[i].X );
- AI_SWAP2( pcVertices[i].Y );
- AI_SWAP2( pcVertices[i].Z );
-
- AI_SWAP4( pcUVs[i].U );
- AI_SWAP4( pcUVs[i].U );
- }
- for (uint32_t i = 0; i < pcSurfaces->NUM_TRIANGLES;++i) {
- AI_SWAP4(pcTriangles[i].INDEXES[0]);
- AI_SWAP4(pcTriangles[i].INDEXES[1]);
- AI_SWAP4(pcTriangles[i].INDEXES[2]);
- }
-
-#endif
-
- // Fill mesh information
- pcMesh->mPrimitiveTypes = aiPrimitiveType_TRIANGLE;
-
- pcMesh->mNumVertices = pcSurfaces->NUM_TRIANGLES*3;
- pcMesh->mNumFaces = pcSurfaces->NUM_TRIANGLES;
- pcMesh->mFaces = new aiFace[pcSurfaces->NUM_TRIANGLES];
- pcMesh->mNormals = new aiVector3D[pcMesh->mNumVertices];
- pcMesh->mVertices = new aiVector3D[pcMesh->mNumVertices];
- pcMesh->mTextureCoords[0] = new aiVector3D[pcMesh->mNumVertices];
- pcMesh->mNumUVComponents[0] = 2;
-
- // Fill in all triangles
- unsigned int iCurrent = 0;
- for (unsigned int i = 0; i < (unsigned int)pcSurfaces->NUM_TRIANGLES;++i) {
- pcMesh->mFaces[i].mIndices = new unsigned int[3];
- pcMesh->mFaces[i].mNumIndices = 3;
-
- //unsigned int iTemp = iCurrent;
- for (unsigned int c = 0; c < 3;++c,++iCurrent) {
- pcMesh->mFaces[i].mIndices[c] = iCurrent;
-
- // Read vertices
- aiVector3D& vec = pcMesh->mVertices[iCurrent];
- vec.x = pcVertices[ pcTriangles->INDEXES[c]].X*AI_MD3_XYZ_SCALE;
- vec.y = pcVertices[ pcTriangles->INDEXES[c]].Y*AI_MD3_XYZ_SCALE;
- vec.z = pcVertices[ pcTriangles->INDEXES[c]].Z*AI_MD3_XYZ_SCALE;
-
- // Convert the normal vector to uncompressed float3 format
- aiVector3D& nor = pcMesh->mNormals[iCurrent];
- LatLngNormalToVec3(pcVertices[pcTriangles->INDEXES[c]].NORMAL,(float*)&nor);
-
- // Read texture coordinates
- pcMesh->mTextureCoords[0][iCurrent].x = pcUVs[ pcTriangles->INDEXES[c]].U;
- pcMesh->mTextureCoords[0][iCurrent].y = 1.0f-pcUVs[ pcTriangles->INDEXES[c]].V;
- }
- // Flip face order if necessary
- if (!shader || shader->cull == Q3Shader::CULL_CW) {
- std::swap(pcMesh->mFaces[i].mIndices[2],pcMesh->mFaces[i].mIndices[1]);
- }
- pcTriangles++;
- }
-
- // Go to the next surface
- pcSurfaces = (BE_NCONST MD3::Surface*)(((unsigned char*)pcSurfaces) + pcSurfaces->OFS_END);
- }
-
- // For debugging purposes: check whether we found matches for all entries in the skins file
- if (!DefaultLogger::isNullLogger()) {
- for (std::list< Q3Shader::SkinData::TextureEntry>::const_iterator it = skins.textures.begin();it != skins.textures.end(); ++it) {
- if (!(*it).resolved) {
- DefaultLogger::get()->error("MD3: Failed to match skin " + (*it).first + " to surface " + (*it).second);
- }
- }
- }
-
- if (!pScene->mNumMeshes)
- throw DeadlyImportError( "MD3: File contains no valid mesh");
- pScene->mNumMaterials = iNumMaterials;
-
- // Now we need to generate an empty node graph
- pScene->mRootNode = new aiNode("<MD3Root>");
- pScene->mRootNode->mNumMeshes = pScene->mNumMeshes;
- pScene->mRootNode->mMeshes = new unsigned int[pScene->mNumMeshes];
-
- // Attach tiny children for all tags
- if (pcHeader->NUM_TAGS) {
- pScene->mRootNode->mNumChildren = pcHeader->NUM_TAGS;
- pScene->mRootNode->mChildren = new aiNode*[pcHeader->NUM_TAGS];
-
- for (unsigned int i = 0; i < pcHeader->NUM_TAGS; ++i, ++pcTags) {
-
- aiNode* nd = pScene->mRootNode->mChildren[i] = new aiNode();
- nd->mName.Set((const char*)pcTags->NAME);
- nd->mParent = pScene->mRootNode;
-
- AI_SWAP4(pcTags->origin.x);
- AI_SWAP4(pcTags->origin.y);
- AI_SWAP4(pcTags->origin.z);
-
- // Copy local origin, again flip z,y
- nd->mTransformation.a4 = pcTags->origin.x;
- nd->mTransformation.b4 = pcTags->origin.y;
- nd->mTransformation.c4 = pcTags->origin.z;
-
- // Copy rest of transformation (need to transpose to match row-order matrix)
- for (unsigned int a = 0; a < 3;++a) {
- for (unsigned int m = 0; m < 3;++m) {
- nd->mTransformation[m][a] = pcTags->orientation[a][m];
- AI_SWAP4(nd->mTransformation[m][a]);
- }
- }
- }
- }
-
- for (unsigned int i = 0; i < pScene->mNumMeshes;++i)
- pScene->mRootNode->mMeshes[i] = i;
-
- // Now rotate the whole scene 90 degrees around the x axis to convert to internal coordinate system
- pScene->mRootNode->mTransformation = aiMatrix4x4(1.f,0.f,0.f,0.f,
- 0.f,0.f,1.f,0.f,0.f,-1.f,0.f,0.f,0.f,0.f,0.f,1.f);
-}
-
-#endif // !! ASSIMP_BUILD_NO_MD3_IMPORTER
diff --git a/3rdparty/assimp/code/MD3Loader.h b/3rdparty/assimp/code/MD3Loader.h
deleted file mode 100644
index f2d07834..00000000
--- a/3rdparty/assimp/code/MD3Loader.h
+++ /dev/null
@@ -1,331 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file Md3Loader.h
- * @brief Declaration of the .MD3 importer class.
- */
-#ifndef AI_MD3LOADER_H_INCLUDED
-#define AI_MD3LOADER_H_INCLUDED
-
-#include "BaseImporter.h"
-#include "ByteSwap.h"
-
-#include "../include/aiTypes.h"
-
-#include "MD3FileData.h"
-namespace Assimp {
-class MaterialHelper;
-
-using namespace MD3;
-namespace Q3Shader {
-
-// ---------------------------------------------------------------------------
-/** @brief Tiny utility data structure to hold the data of a .skin file
- */
-struct SkinData
-{
- //! A single entryin texture list
- struct TextureEntry : public std::pair<std::string,std::string>
- {
- // did we resolve this texture entry?
- bool resolved;
-
- // for std::find()
- bool operator == (const std::string& f) const {
- return f == first;
- }
- };
-
- //! List of textures
- std::list<TextureEntry> textures;
-
- // rest is ignored for the moment
-};
-
-// ---------------------------------------------------------------------------
-/** @brief Specifies cull modi for Quake shader files.
- */
-enum ShaderCullMode
-{
- CULL_NONE,
- CULL_CW,
- CULL_CCW
-};
-
-// ---------------------------------------------------------------------------
-/** @brief Specifies alpha blend modi (src + dest) for Quake shader files
- */
-enum BlendFunc
-{
- BLEND_NONE,
- BLEND_GL_ONE,
- BLEND_GL_ZERO,
- BLEND_GL_DST_COLOR,
- BLEND_GL_ONE_MINUS_DST_COLOR,
- BLEND_GL_SRC_ALPHA,
- BLEND_GL_ONE_MINUS_SRC_ALPHA
-};
-
-// ---------------------------------------------------------------------------
-/** @brief Specifies alpha test modi for Quake texture maps
- */
-enum AlphaTestFunc
-{
- AT_NONE,
- AT_GT0,
- AT_LT128,
- AT_GE128
-};
-
-// ---------------------------------------------------------------------------
-/** @brief Tiny utility data structure to hold a .shader map data block
- */
-struct ShaderMapBlock
-{
- ShaderMapBlock()
- : blend_src (BLEND_NONE)
- , blend_dest (BLEND_NONE)
- , alpha_test (AT_NONE)
- {}
-
- //! Name of referenced map
- std::string name;
-
- //! Blend and alpha test settings for texture
- BlendFunc blend_src,blend_dest;
- AlphaTestFunc alpha_test;
-
-
- //! For std::find()
- bool operator== (const std::string& o) const {
- return !ASSIMP_stricmp(o,name);
- }
-};
-
-// ---------------------------------------------------------------------------
-/** @brief Tiny utility data structure to hold a .shader data block
- */
-struct ShaderDataBlock
-{
- ShaderDataBlock()
- : cull (CULL_CW)
- {}
-
- //! Name of referenced data element
- std::string name;
-
- //! Cull mode for the element
- ShaderCullMode cull;
-
- //! Maps defined in the shader
- std::list<ShaderMapBlock> maps;
-
-
- //! For std::find()
- bool operator== (const std::string& o) const {
- return !ASSIMP_stricmp(o,name);
- }
-};
-
-// ---------------------------------------------------------------------------
-/** @brief Tiny utility data structure to hold the data of a .shader file
- */
-struct ShaderData
-{
- //! Shader data blocks
- std::list<ShaderDataBlock> blocks;
-};
-
-// ---------------------------------------------------------------------------
-/** @brief Load a shader file
- *
- * Generally, parsing is error tolerant. There's no failure.
- * @param fill Receives output data
- * @param file File to be read.
- * @param io IOSystem to be used for reading
- * @return false if file is not accessible
- */
-bool LoadShader(ShaderData& fill, const std::string& file,IOSystem* io);
-
-
-// ---------------------------------------------------------------------------
-/** @brief Convert a Q3Shader to an aiMaterial
- *
- * @param[out] out Material structure to be filled.
- * @param[in] shader Input shader
- */
-void ConvertShaderToMaterial(MaterialHelper* out, const ShaderDataBlock& shader);
-
-// ---------------------------------------------------------------------------
-/** @brief Load a skin file
- *
- * Generally, parsing is error tolerant. There's no failure.
- * @param fill Receives output data
- * @param file File to be read.
- * @param io IOSystem to be used for reading
- * @return false if file is not accessible
- */
-bool LoadSkin(SkinData& fill, const std::string& file,IOSystem* io);
-
-} // ! namespace Q3SHader
-
-// ---------------------------------------------------------------------------
-/** @brief Importer class to load MD3 files
-*/
-class MD3Importer : public BaseImporter
-{
- friend class Importer;
-
-protected:
- /** Constructor to be privately used by Importer */
- MD3Importer();
-
- /** Destructor, private as well */
- ~MD3Importer();
-
-public:
-
- // -------------------------------------------------------------------
- /** Returns whether the class can handle the format of the given file.
- * See BaseImporter::CanRead() for details. */
- bool CanRead( const std::string& pFile, IOSystem* pIOHandler,
- bool checkSig) const;
-
-
- // -------------------------------------------------------------------
- /** Called prior to ReadFile().
- * The function is a request to the importer to update its configuration
- * basing on the Importer's configuration property list.
- */
- void SetupProperties(const Importer* pImp);
-
-protected:
-
- // -------------------------------------------------------------------
- /** Called by Importer::GetExtensionList() for each loaded importer.
- * See BaseImporter::GetExtensionList() for details
- */
- void GetExtensionList(std::set<std::string>& extensions);
-
- // -------------------------------------------------------------------
- /** Imports the given file into the given scene structure.
- * See BaseImporter::InternReadFile() for details
- */
- void InternReadFile( const std::string& pFile, aiScene* pScene,
- IOSystem* pIOHandler);
-
- // -------------------------------------------------------------------
- /** Validate offsets in the header
- */
- void ValidateHeaderOffsets();
- void ValidateSurfaceHeaderOffsets(const MD3::Surface* pcSurfHeader);
-
- // -------------------------------------------------------------------
- /** Read a Q3 multipart file
- * @return true if multi part has been processed
- */
- bool ReadMultipartFile();
-
- // -------------------------------------------------------------------
- /** Try to read the skin for a MD3 file
- * @param fill Receives output information
- */
- void ReadSkin(Q3Shader::SkinData& fill) const;
-
- // -------------------------------------------------------------------
- /** Try to read the shader for a MD3 file
- * @param fill Receives output information
- */
- void ReadShader(Q3Shader::ShaderData& fill) const;
-
- // -------------------------------------------------------------------
- /** Convert a texture path in a MD3 file to a proper value
- * @param[in] texture_name Path to be converted
- * @param[in] header_path Base path specified in MD3 header
- * @param[out] out Receives the converted output string
- */
- void ConvertPath(const char* texture_name, const char* header_path,
- std::string& out) const;
-
-protected:
-
- /** Configuration option: frame to be loaded */
- unsigned int configFrameID;
-
- /** Configuration option: process multi-part files */
- bool configHandleMP;
-
- /** Configuration option: name of skin file to be read */
- std::string configSkinFile;
-
- /** Configuration option: name or path of shader */
- std::string configShaderFile;
-
- /** Configuration option: speed flag was set? */
- bool configSpeedFlag;
-
- /** Header of the MD3 file */
- BE_NCONST MD3::Header* pcHeader;
-
- /** File buffer */
- BE_NCONST unsigned char* mBuffer;
-
- /** Size of the file, in bytes */
- unsigned int fileSize;
-
- /** Current file name */
- std::string mFile;
-
- /** Current base directory */
- std::string path;
-
- /** Pure file we're currently reading */
- std::string filename;
-
- /** Output scene to be filled */
- aiScene* mScene;
-
- /** IO system to be used to access the data*/
- IOSystem* mIOHandler;
- };
-
-} // end of namespace Assimp
-
-#endif // AI_3DSIMPORTER_H_INC
diff --git a/3rdparty/assimp/code/MD4FileData.h b/3rdparty/assimp/code/MD4FileData.h
deleted file mode 100644
index c61665c2..00000000
--- a/3rdparty/assimp/code/MD4FileData.h
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file Defines the helper data structures for importing MD4 files */
-#ifndef AI_MD4FILEHELPER_H_INC
-#define AI_MD4FILEHELPER_H_INC
-
-#include <string>
-#include <vector>
-#include <sstream>
-
-#include "../include/aiTypes.h"
-#include "../include/aiMesh.h"
-#include "../include/aiAnim.h"
-
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
-# pragma pack(push,1)
-# define PACK_STRUCT
-#elif defined( __GNUC__ )
-# define PACK_STRUCT __attribute__((packed))
-#else
-# error Compiler not supported
-#endif
-
-
-namespace Assimp
-{
-// http://gongo.quakedev.com/md4.html
-namespace MD4
-{
-
-#define AI_MD4_MAGIC_NUMBER_BE 'IDP4'
-#define AI_MD4_MAGIC_NUMBER_LE '4PDI'
-
-// common limitations
-#define AI_MD4_VERSION 4
-#define AI_MD4_MAXQPATH 64
-#define AI_MD4_MAX_FRAMES 2028
-#define AI_MD4_MAX_SURFACES 32
-#define AI_MD4_MAX_BONES 256
-#define AI_MD4_MAX_VERTS 4096
-#define AI_MD4_MAX_TRIANGLES 8192
-
-// ---------------------------------------------------------------------------
-/** \brief Data structure for the MD4 main header
- */
-// ---------------------------------------------------------------------------
-struct Header
-{
- //! magic number
- int32_t magic;
-
- //! file format version
- int32_t version;
-
- //! original name in .pak archive
- unsigned char name[ AI_MD4_MAXQPATH ];
-
- //! number of frames in the file
- int32_t NUM_FRAMES;
-
- //! number of bones in the file
- int32_t NUM_BONES;
-
- //! number of surfaces in the file
- int32_t NUM_SURFACES;
-
- //! offset of the first frame
- int32_t OFS_FRAMES;
-
- //! offset of the first bone
- int32_t OFS_BONES;
-
- //! offset of the first surface
- int32_t OFS_SURFACES;
-
- //! end of file
- int32_t OFS_EOF;
-} PACK_STRUCT;
-
-// ---------------------------------------------------------------------------
-/** \brief Stores the local transformation matrix of a bone
- */
-// ---------------------------------------------------------------------------
-struct BoneFrame
-{
- float matrix[3][4];
-} PACK_STRUCT;
-
-// ---------------------------------------------------------------------------
-/** \brief Stores the name / parent index / flag of a node
- */
-// ---------------------------------------------------------------------------
-struct BoneName
-{
- char name[32] ;
- int parent ;
- int flags ;
-} PACK_STRUCT;
-
-// ---------------------------------------------------------------------------
-/** \brief Data structure for a surface in a MD4 file
- */
-// ---------------------------------------------------------------------------
-struct Surface
-{
- int32_t ident;
- char name[64];
- char shader[64];
- int32_t shaderIndex;
- int32_t lodBias;
- int32_t minLod;
- int32_t ofsHeader;
- int32_t numVerts;
- int32_t ofsVerts;
- int32_t numTris;
- int32_t ofsTris;
- int32_t numBoneRefs;
- int32_t ofsBoneRefs;
- int32_t ofsCollapseMap;
- int32_t ofsEnd;
-} PACK_STRUCT;
-
-
-// ---------------------------------------------------------------------------
-/** \brief Data structure for a MD4 vertex' weight
- */
-// ---------------------------------------------------------------------------
-struct Weight
-{
- int32_t boneIndex;
- float boneWeight;
- float offset[3];
-} PACK_STRUCT;
-
-// ---------------------------------------------------------------------------
-/** \brief Data structure for a vertex in a MD4 file
- */
-// ---------------------------------------------------------------------------
-struct Vertex
-{
- float vertex[3];
- float normal[3];
- float texCoords[2];
- int32_t numWeights;
- Weight weights[1];
-} PACK_STRUCT;
-
-// ---------------------------------------------------------------------------
-/** \brief Data structure for a triangle in a MD4 file
- */
-// ---------------------------------------------------------------------------
-struct Triangle
-{
- int32_t indexes[3];
-} PACK_STRUCT;
-
-// ---------------------------------------------------------------------------
-/** \brief Data structure for a MD4 frame
- */
-// ---------------------------------------------------------------------------
-struct Frame
-{
- float bounds[3][2];
- float localOrigin[3];
- float radius;
- BoneFrame bones[1];
-} PACK_STRUCT;
-
-
-// reset packing to the original value
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
-# pragma pack( pop )
-#endif
-#undef PACK_STRUCT
-
-
-};
-};
-
-#endif // !! AI_MD4FILEHELPER_H_INC
diff --git a/3rdparty/assimp/code/MD5Loader.cpp b/3rdparty/assimp/code/MD5Loader.cpp
deleted file mode 100644
index 897bb2ab..00000000
--- a/3rdparty/assimp/code/MD5Loader.cpp
+++ /dev/null
@@ -1,727 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file MD5Loader.cpp
- * @brief Implementation of the MD5 importer class
- */
-
-#include "AssimpPCH.h"
-#ifndef ASSIMP_BUILD_NO_MD5_IMPORTER
-
-// internal headers
-#include "MaterialSystem.h"
-#include "RemoveComments.h"
-#include "MD5Loader.h"
-#include "StringComparison.h"
-#include "fast_atof.h"
-#include "SkeletonMeshBuilder.h"
-
-using namespace Assimp;
-
-// Minimum weight value. Weights inside [-n ... n] are ignored
-#define AI_MD5_WEIGHT_EPSILON 1e-5f
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-MD5Importer::MD5Importer()
-: configNoAutoLoad (false)
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-MD5Importer::~MD5Importer()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the class can handle the format of the given file.
-bool MD5Importer::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const
-{
- const std::string extension = GetExtension(pFile);
-
- if (extension == "md5anim" || extension == "md5mesh" || extension == "md5camera")
- return true;
- else if (!extension.length() || checkSig) {
- if (!pIOHandler)
- return true;
- const char* tokens[] = {"MD5Version"};
- return SearchFileHeaderForToken(pIOHandler,pFile,tokens,1);
- }
- return false;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Get list of all supported extensions
-void MD5Importer::GetExtensionList(std::set<std::string>& extensions)
-{
- extensions.insert("md5anim");
- extensions.insert("md5mesh");
- extensions.insert("md5camera");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Setup import properties
-void MD5Importer::SetupProperties(const Importer* pImp)
-{
- // AI_CONFIG_IMPORT_MD5_NO_ANIM_AUTOLOAD
- configNoAutoLoad = (0 != pImp->GetPropertyInteger(AI_CONFIG_IMPORT_MD5_NO_ANIM_AUTOLOAD,0));
-}
-
-// ------------------------------------------------------------------------------------------------
-// Imports the given file into the given scene structure.
-void MD5Importer::InternReadFile( const std::string& pFile,
- aiScene* _pScene, IOSystem* _pIOHandler)
-{
- pIOHandler = _pIOHandler;
- pScene = _pScene;
- bHadMD5Mesh = bHadMD5Anim = bHadMD5Camera = false;
-
- // remove the file extension
- std::string::size_type pos = pFile.find_last_of('.');
- mFile = (std::string::npos == pos ? pFile : pFile.substr(0,pos+1));
-
- const std::string extension = GetExtension(pFile);
- try {
- if (extension == "md5camera") {
- LoadMD5CameraFile();
- }
- else if (configNoAutoLoad || extension == "md5anim") {
- // determine file extension and process just *one* file
- if (extension.length() == 0) {
- /* fixme */
- }
- if (extension == "md5anim") {
- LoadMD5AnimFile();
- }
- else if (extension == "md5mesh") {
- LoadMD5MeshFile();
- }
- }
- else {
- LoadMD5MeshFile();
- LoadMD5AnimFile();
- }
- }
- catch ( std::exception&) {
- // XXX use more idiomatic RAII solution
- UnloadFileFromMemory();
- throw;
- }
-
- // make sure we have at least one file
- if (!bHadMD5Mesh && !bHadMD5Anim && !bHadMD5Camera)
- throw DeadlyImportError("Failed to read valid contents from this MD5* file");
-
- // Now rotate the whole scene 90 degrees around the x axis to convert to internal coordinate system
- pScene->mRootNode->mTransformation = aiMatrix4x4(1.f,0.f,0.f,0.f,
- 0.f,0.f,1.f,0.f,0.f,-1.f,0.f,0.f,0.f,0.f,0.f,1.f);
-
- // the output scene wouldn't pass the validation without this flag
- if (!bHadMD5Mesh)
- pScene->mFlags |= AI_SCENE_FLAGS_INCOMPLETE;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Load a file into a memory buffer
-void MD5Importer::LoadFileIntoMemory (IOStream* file)
-{
- ai_assert(NULL != file);
- fileSize = (unsigned int)file->FileSize();
-
- // allocate storage and copy the contents of the file to a memory buffer
- pScene = pScene;
- mBuffer = new char[fileSize+1];
- file->Read( (void*)mBuffer, 1, fileSize);
- iLineNumber = 1;
-
- // append a terminal 0
- mBuffer[fileSize] = '\0';
-
- // now remove all line comments from the file
- CommentRemover::RemoveLineComments("//",mBuffer,' ');
-}
-
-// ------------------------------------------------------------------------------------------------
-// Unload the current memory buffer
-void MD5Importer::UnloadFileFromMemory ()
-{
- // delete the file buffer
- delete[] mBuffer;
- mBuffer = NULL;
- fileSize = 0;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Build unique vertices
-void MD5Importer::MakeDataUnique (MD5::MeshDesc& meshSrc)
-{
- std::vector<bool> abHad(meshSrc.mVertices.size(),false);
-
- // allocate enough storage to keep the output structures
- const unsigned int iNewNum = meshSrc.mFaces.size()*3;
- unsigned int iNewIndex = meshSrc.mVertices.size();
- meshSrc.mVertices.resize(iNewNum);
-
- // try to guess how much storage we'll need for new weights
- const float fWeightsPerVert = meshSrc.mWeights.size() / (float)iNewIndex;
- const unsigned int guess = (unsigned int)(fWeightsPerVert*iNewNum);
- meshSrc.mWeights.reserve(guess + (guess >> 3)); // + 12.5% as buffer
-
- for (FaceList::const_iterator iter = meshSrc.mFaces.begin(),iterEnd = meshSrc.mFaces.end();iter != iterEnd;++iter){
- const aiFace& face = *iter;
- for (unsigned int i = 0; i < 3;++i) {
- if (face.mIndices[0] >= meshSrc.mVertices.size())
- throw DeadlyImportError("MD5MESH: Invalid vertex index");
-
- if (abHad[face.mIndices[i]]) {
- // generate a new vertex
- meshSrc.mVertices[iNewIndex] = meshSrc.mVertices[face.mIndices[i]];
- face.mIndices[i] = iNewIndex++;
- }
- else abHad[face.mIndices[i]] = true;
- }
- // swap face order
- std::swap(face.mIndices[0],face.mIndices[2]);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Recursive node graph construction from a MD5MESH
-void MD5Importer::AttachChilds_Mesh(int iParentID,aiNode* piParent, BoneList& bones)
-{
- ai_assert(NULL != piParent && !piParent->mNumChildren);
-
- // First find out how many children we'll have
- for (int i = 0; i < (int)bones.size();++i) {
- if (iParentID != i && bones[i].mParentIndex == iParentID) {
- ++piParent->mNumChildren;
- }
- }
- if (piParent->mNumChildren) {
- piParent->mChildren = new aiNode*[piParent->mNumChildren];
- for (int i = 0; i < (int)bones.size();++i) {
- // (avoid infinite recursion)
- if (iParentID != i && bones[i].mParentIndex == iParentID) {
- aiNode* pc;
- // setup a new node
- *piParent->mChildren++ = pc = new aiNode();
- pc->mName = aiString(bones[i].mName);
- pc->mParent = piParent;
-
- // get the transformation matrix from rotation and translational components
- aiQuaternion quat;
- MD5::ConvertQuaternion ( bones[i].mRotationQuat, quat );
-
- // FIX to get to Assimp's quaternion conventions
- quat.w *= -1.f;
-
- bones[i].mTransform = aiMatrix4x4 ( quat.GetMatrix());
- bones[i].mTransform.a4 = bones[i].mPositionXYZ.x;
- bones[i].mTransform.b4 = bones[i].mPositionXYZ.y;
- bones[i].mTransform.c4 = bones[i].mPositionXYZ.z;
-
- // store it for later use
- pc->mTransformation = bones[i].mInvTransform = bones[i].mTransform;
- bones[i].mInvTransform.Inverse();
-
- // the transformations for each bone are absolute, so we need to multiply them
- // with the inverse of the absolute matrix of the parent joint
- if (-1 != iParentID) {
- pc->mTransformation = bones[iParentID].mInvTransform * pc->mTransformation;
- }
-
- // add children to this node, too
- AttachChilds_Mesh( i, pc, bones);
- }
- }
- // undo offset computations
- piParent->mChildren -= piParent->mNumChildren;
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Recursive node graph construction from a MD5ANIM
-void MD5Importer::AttachChilds_Anim(int iParentID,aiNode* piParent, AnimBoneList& bones,const aiNodeAnim** node_anims)
-{
- ai_assert(NULL != piParent && !piParent->mNumChildren);
-
- // First find out how many children we'll have
- for (int i = 0; i < (int)bones.size();++i) {
- if (iParentID != i && bones[i].mParentIndex == iParentID) {
- ++piParent->mNumChildren;
- }
- }
- if (piParent->mNumChildren) {
- piParent->mChildren = new aiNode*[piParent->mNumChildren];
- for (int i = 0; i < (int)bones.size();++i) {
- // (avoid infinite recursion)
- if (iParentID != i && bones[i].mParentIndex == iParentID)
- {
- aiNode* pc;
- // setup a new node
- *piParent->mChildren++ = pc = new aiNode();
- pc->mName = aiString(bones[i].mName);
- pc->mParent = piParent;
-
- // get the corresponding animation channel and its first frame
- const aiNodeAnim** cur = node_anims;
- while ((**cur).mNodeName != pc->mName)++cur;
-
- aiMatrix4x4::Translation((**cur).mPositionKeys[0].mValue,pc->mTransformation);
- pc->mTransformation = pc->mTransformation * aiMatrix4x4((**cur).mRotationKeys[0].mValue.GetMatrix()) ;
-
- // add children to this node, too
- AttachChilds_Anim( i, pc, bones,node_anims);
- }
- }
- // undo offset computations
- piParent->mChildren -= piParent->mNumChildren;
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Load a MD5MESH file
-void MD5Importer::LoadMD5MeshFile ()
-{
- std::string pFile = mFile + "md5mesh";
- boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
-
- // Check whether we can read from the file
- if ( file.get() == NULL) {
- DefaultLogger::get()->warn("Failed to read MD5MESH file: " + pFile);
- return;
- }
- bHadMD5Mesh = true;
- LoadFileIntoMemory(file.get());
-
- // now construct a parser and parse the file
- MD5::MD5Parser parser(mBuffer,fileSize);
-
- // load the mesh information from it
- MD5::MD5MeshParser meshParser(parser.mSections);
-
- // create the bone hierarchy - first the root node and dummy nodes for all meshes
- pScene->mRootNode = new aiNode("<MD5_Root>");
- pScene->mRootNode->mNumChildren = 2;
- pScene->mRootNode->mChildren = new aiNode*[2];
-
- // build the hierarchy from the MD5MESH file
- aiNode* pcNode = pScene->mRootNode->mChildren[1] = new aiNode();
- pcNode->mName.Set("<MD5_Hierarchy>");
- pcNode->mParent = pScene->mRootNode;
- AttachChilds_Mesh(-1,pcNode,meshParser.mJoints);
-
- pcNode = pScene->mRootNode->mChildren[0] = new aiNode();
- pcNode->mName.Set("<MD5_Mesh>");
- pcNode->mParent = pScene->mRootNode;
-
-#if 0
- if (pScene->mRootNode->mChildren[1]->mNumChildren) /* start at the right hierarchy level */
- SkeletonMeshBuilder skeleton_maker(pScene,pScene->mRootNode->mChildren[1]->mChildren[0]);
-#else
- std::vector<MD5::MeshDesc>::const_iterator end = meshParser.mMeshes.end();
-
- // FIX: MD5 files exported from Blender can have empty meshes
- for (std::vector<MD5::MeshDesc>::const_iterator it = meshParser.mMeshes.begin(),end = meshParser.mMeshes.end(); it != end;++it) {
- if (!(*it).mFaces.empty() && !(*it).mVertices.empty())
- ++pScene->mNumMaterials;
- }
-
- // generate all meshes
- pScene->mNumMeshes = pScene->mNumMaterials;
- pScene->mMeshes = new aiMesh*[pScene->mNumMeshes];
- pScene->mMaterials = new aiMaterial*[pScene->mNumMeshes];
-
- // storage for node mesh indices
- pcNode->mNumMeshes = pScene->mNumMeshes;
- pcNode->mMeshes = new unsigned int[pcNode->mNumMeshes];
- for (unsigned int m = 0; m < pcNode->mNumMeshes;++m)
- pcNode->mMeshes[m] = m;
-
- unsigned int n = 0;
- for (std::vector<MD5::MeshDesc>::iterator it = meshParser.mMeshes.begin(),end = meshParser.mMeshes.end(); it != end;++it) {
- MD5::MeshDesc& meshSrc = *it;
- if (meshSrc.mFaces.empty() || meshSrc.mVertices.empty())
- continue;
-
- aiMesh* mesh = pScene->mMeshes[n] = new aiMesh();
- mesh->mPrimitiveTypes = aiPrimitiveType_TRIANGLE;
-
- // generate unique vertices in our internal verbose format
- MakeDataUnique(meshSrc);
-
- mesh->mNumVertices = (unsigned int) meshSrc.mVertices.size();
- mesh->mVertices = new aiVector3D[mesh->mNumVertices];
- mesh->mTextureCoords[0] = new aiVector3D[mesh->mNumVertices];
- mesh->mNumUVComponents[0] = 2;
-
- // copy texture coordinates
- aiVector3D* pv = mesh->mTextureCoords[0];
- for (MD5::VertexList::const_iterator iter = meshSrc.mVertices.begin();iter != meshSrc.mVertices.end();++iter,++pv) {
- pv->x = (*iter).mUV.x;
- pv->y = 1.0f-(*iter).mUV.y; // D3D to OpenGL
- pv->z = 0.0f;
- }
-
- // sort all bone weights - per bone
- unsigned int* piCount = new unsigned int[meshParser.mJoints.size()];
- ::memset(piCount,0,sizeof(unsigned int)*meshParser.mJoints.size());
-
- for (MD5::VertexList::const_iterator iter = meshSrc.mVertices.begin();iter != meshSrc.mVertices.end();++iter,++pv) {
- for (unsigned int jub = (*iter).mFirstWeight, w = jub; w < jub + (*iter).mNumWeights;++w)
- {
- MD5::WeightDesc& desc = meshSrc.mWeights[w];
- /* FIX for some invalid exporters */
- if (!(desc.mWeight < AI_MD5_WEIGHT_EPSILON && desc.mWeight >= -AI_MD5_WEIGHT_EPSILON ))
- ++piCount[desc.mBone];
- }
- }
-
- // check how many we will need
- for (unsigned int p = 0; p < meshParser.mJoints.size();++p)
- if (piCount[p])mesh->mNumBones++;
-
- if (mesh->mNumBones) // just for safety
- {
- mesh->mBones = new aiBone*[mesh->mNumBones];
- for (unsigned int q = 0,h = 0; q < meshParser.mJoints.size();++q)
- {
- if (!piCount[q])continue;
- aiBone* p = mesh->mBones[h] = new aiBone();
- p->mNumWeights = piCount[q];
- p->mWeights = new aiVertexWeight[p->mNumWeights];
- p->mName = aiString(meshParser.mJoints[q].mName);
- p->mOffsetMatrix = meshParser.mJoints[q].mInvTransform;
-
- // store the index for later use
- MD5::BoneDesc& boneSrc = meshParser.mJoints[q];
- boneSrc.mMap = h++;
-
- // compute w-component of quaternion
- MD5::ConvertQuaternion( boneSrc.mRotationQuat, boneSrc.mRotationQuatConverted );
- }
-
- //unsigned int g = 0;
- pv = mesh->mVertices;
- for (MD5::VertexList::const_iterator iter = meshSrc.mVertices.begin();iter != meshSrc.mVertices.end();++iter,++pv) {
- // compute the final vertex position from all single weights
- *pv = aiVector3D();
-
- // there are models which have weights which don't sum to 1 ...
- float fSum = 0.0f;
- for (unsigned int jub = (*iter).mFirstWeight, w = jub; w < jub + (*iter).mNumWeights;++w)
- fSum += meshSrc.mWeights[w].mWeight;
- if (!fSum) {
- DefaultLogger::get()->error("MD5MESH: The sum of all vertex bone weights is 0");
- continue;
- }
-
- // process bone weights
- for (unsigned int jub = (*iter).mFirstWeight, w = jub; w < jub + (*iter).mNumWeights;++w) {
- if (w >= meshSrc.mWeights.size())
- throw DeadlyImportError("MD5MESH: Invalid weight index");
-
- MD5::WeightDesc& desc = meshSrc.mWeights[w];
- if ( desc.mWeight < AI_MD5_WEIGHT_EPSILON && desc.mWeight >= -AI_MD5_WEIGHT_EPSILON)
- continue;
-
- const float fNewWeight = desc.mWeight / fSum;
-
- // transform the local position into worldspace
- MD5::BoneDesc& boneSrc = meshParser.mJoints[desc.mBone];
- const aiVector3D v = boneSrc.mRotationQuatConverted.Rotate (desc.vOffsetPosition);
-
- // use the original weight to compute the vertex position
- // (some MD5s seem to depend on the invalid weight values ...)
- *pv += ((boneSrc.mPositionXYZ+v)* desc.mWeight);
-
- aiBone* bone = mesh->mBones[boneSrc.mMap];
- *bone->mWeights++ = aiVertexWeight((unsigned int)(pv-mesh->mVertices),fNewWeight);
- }
- }
-
- // undo our nice offset tricks ...
- for (unsigned int p = 0; p < mesh->mNumBones;++p)
- mesh->mBones[p]->mWeights -= mesh->mBones[p]->mNumWeights;
- }
-
- delete[] piCount;
-
- // now setup all faces - we can directly copy the list
- // (however, take care that the aiFace destructor doesn't delete the mIndices array)
- mesh->mNumFaces = (unsigned int)meshSrc.mFaces.size();
- mesh->mFaces = new aiFace[mesh->mNumFaces];
- for (unsigned int c = 0; c < mesh->mNumFaces;++c) {
- mesh->mFaces[c].mNumIndices = 3;
- mesh->mFaces[c].mIndices = meshSrc.mFaces[c].mIndices;
- meshSrc.mFaces[c].mIndices = NULL;
- }
-
- // generate a material for the mesh
- MaterialHelper* mat = new MaterialHelper();
- pScene->mMaterials[n] = mat;
-
- // insert the typical doom3 textures:
- // nnn_local.tga - normal map
- // nnn_h.tga - height map
- // nnn_s.tga - specular map
- // nnn_d.tga - diffuse map
- if (meshSrc.mShader.length && !strchr(meshSrc.mShader.data,'.')) {
-
- aiString temp(meshSrc.mShader);
- temp.Append("_local.tga");
- mat->AddProperty(&temp,AI_MATKEY_TEXTURE_NORMALS(0));
-
- temp = aiString(meshSrc.mShader);
- temp.Append("_s.tga");
- mat->AddProperty(&temp,AI_MATKEY_TEXTURE_SPECULAR(0));
-
- temp = aiString(meshSrc.mShader);
- temp.Append("_d.tga");
- mat->AddProperty(&temp,AI_MATKEY_TEXTURE_DIFFUSE(0));
-
- temp = aiString(meshSrc.mShader);
- temp.Append("_h.tga");
- mat->AddProperty(&temp,AI_MATKEY_TEXTURE_HEIGHT(0));
-
- // set this also as material name
- mat->AddProperty(&meshSrc.mShader,AI_MATKEY_NAME);
- }
- else mat->AddProperty(&meshSrc.mShader,AI_MATKEY_TEXTURE_DIFFUSE(0));
- mesh->mMaterialIndex = n++;
- }
-#endif
- // delete the file again
- UnloadFileFromMemory();
-}
-
-// ------------------------------------------------------------------------------------------------
-// Load an MD5ANIM file
-void MD5Importer::LoadMD5AnimFile ()
-{
- std::string pFile = mFile + "md5anim";
- boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
-
- // Check whether we can read from the file
- if ( file.get() == NULL) {
- DefaultLogger::get()->warn("Failed to read MD5ANIM file: " + pFile);
- return;
- }
- LoadFileIntoMemory(file.get());
-
- // parse the basic file structure
- MD5::MD5Parser parser(mBuffer,fileSize);
-
- // load the animation information from the parse tree
- MD5::MD5AnimParser animParser(parser.mSections);
-
- // generate and fill the output animation
- if (animParser.mAnimatedBones.empty() || animParser.mFrames.empty() ||
- animParser.mBaseFrames.size() != animParser.mAnimatedBones.size()) {
-
- DefaultLogger::get()->error("MD5ANIM: No frames or animated bones loaded");
- }
- else {
- bHadMD5Anim = true;
-
- pScene->mAnimations = new aiAnimation*[pScene->mNumAnimations = 1];
- aiAnimation* anim = pScene->mAnimations[0] = new aiAnimation();
- anim->mNumChannels = (unsigned int)animParser.mAnimatedBones.size();
- anim->mChannels = new aiNodeAnim*[anim->mNumChannels];
- for (unsigned int i = 0; i < anim->mNumChannels;++i) {
- aiNodeAnim* node = anim->mChannels[i] = new aiNodeAnim();
- node->mNodeName = aiString( animParser.mAnimatedBones[i].mName );
-
- // allocate storage for the keyframes
- node->mPositionKeys = new aiVectorKey[animParser.mFrames.size()];
- node->mRotationKeys = new aiQuatKey[animParser.mFrames.size()];
- }
-
- // 1 tick == 1 frame
- anim->mTicksPerSecond = animParser.fFrameRate;
-
- for (FrameList::const_iterator iter = animParser.mFrames.begin(), iterEnd = animParser.mFrames.end();iter != iterEnd;++iter){
- double dTime = (double)(*iter).iIndex;
- aiNodeAnim** pcAnimNode = anim->mChannels;
- if (!(*iter).mValues.empty() || iter == animParser.mFrames.begin()) /* be sure we have at least one frame */
- {
- // now process all values in there ... read all joints
- MD5::BaseFrameDesc* pcBaseFrame = &animParser.mBaseFrames[0];
- for (AnimBoneList::const_iterator iter2 = animParser.mAnimatedBones.begin(); iter2 != animParser.mAnimatedBones.end();++iter2,
- ++pcAnimNode,++pcBaseFrame)
- {
- if ((*iter2).iFirstKeyIndex >= (*iter).mValues.size()) {
-
- // Allow for empty frames
- if ((*iter2).iFlags != 0) {
- throw DeadlyImportError("MD5: Keyframe index is out of range");
-
- }
- continue;
- }
- const float* fpCur = &(*iter).mValues[(*iter2).iFirstKeyIndex];
- aiNodeAnim* pcCurAnimBone = *pcAnimNode;
-
- aiVectorKey* vKey = &pcCurAnimBone->mPositionKeys[pcCurAnimBone->mNumPositionKeys++];
- aiQuatKey* qKey = &pcCurAnimBone->mRotationKeys [pcCurAnimBone->mNumRotationKeys++];
- aiVector3D vTemp;
-
- // translational component
- for (unsigned int i = 0; i < 3; ++i) {
- if ((*iter2).iFlags & (1u << i))
- vKey->mValue[i] = *fpCur++;
- else vKey->mValue[i] = pcBaseFrame->vPositionXYZ[i];
- }
-
- // orientation component
- for (unsigned int i = 0; i < 3; ++i) {
- if ((*iter2).iFlags & (8u << i))
- vTemp[i] = *fpCur++;
- else vTemp[i] = pcBaseFrame->vRotationQuat[i];
- }
-
- MD5::ConvertQuaternion(vTemp, qKey->mValue);
- qKey->mTime = vKey->mTime = dTime;
-
- // we need this to get to Assimp quaternion conventions
- qKey->mValue.w *= -1.f;
- }
- }
-
- // compute the duration of the animation
- anim->mDuration = std::max(dTime,anim->mDuration);
- }
-
- // If we didn't build the hierarchy yet (== we didn't load a MD5MESH),
- // construct it now from the data given in the MD5ANIM.
- if (!pScene->mRootNode) {
- pScene->mRootNode = new aiNode();
- pScene->mRootNode->mName.Set("<MD5_Hierarchy>");
-
- AttachChilds_Anim(-1,pScene->mRootNode,animParser.mAnimatedBones,(const aiNodeAnim**)anim->mChannels);
-
- // Call SkeletonMeshBuilder to construct a mesh to represent the shape
- if (pScene->mRootNode->mNumChildren) {
- SkeletonMeshBuilder skeleton_maker(pScene,pScene->mRootNode->mChildren[0]);
- }
- }
- }
- // delete the file again
- UnloadFileFromMemory();
-}
-
-// ------------------------------------------------------------------------------------------------
-// Load an MD5CAMERA file
-void MD5Importer::LoadMD5CameraFile ()
-{
- std::string pFile = mFile + "md5camera";
- boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
-
- // Check whether we can read from the file
- if ( file.get() == NULL) {
- throw DeadlyImportError("Failed to read MD5CAMERA file: " + pFile);
- }
- bHadMD5Camera = true;
- LoadFileIntoMemory(file.get());
-
- // parse the basic file structure
- MD5::MD5Parser parser(mBuffer,fileSize);
-
- // load the camera animation data from the parse tree
- MD5::MD5CameraParser cameraParser(parser.mSections);
-
- if (cameraParser.frames.empty())
- throw DeadlyImportError("MD5CAMERA: No frames parsed");
-
- std::vector<unsigned int>& cuts = cameraParser.cuts;
- std::vector<MD5::CameraAnimFrameDesc>& frames = cameraParser.frames;
-
- // Construct output graph - a simple root with a dummy child.
- // The root node performs the coordinate system conversion
- aiNode* root = pScene->mRootNode = new aiNode("<MD5CameraRoot>");
- root->mChildren = new aiNode*[root->mNumChildren = 1];
- root->mChildren[0] = new aiNode("<MD5Camera>");
- root->mChildren[0]->mParent = root;
-
- // ... but with one camera assigned to it
- pScene->mCameras = new aiCamera*[pScene->mNumCameras = 1];
- aiCamera* cam = pScene->mCameras[0] = new aiCamera();
- cam->mName = "<MD5Camera>";
-
- // FIXME: Fov is currently set to the first frame's value
- cam->mHorizontalFOV = AI_DEG_TO_RAD( frames.front().fFOV );
-
- // every cut is written to a separate aiAnimation
- if (!cuts.size()) {
- cuts.push_back(0);
- cuts.push_back(frames.size()-1);
- }
- else {
- cuts.insert(cuts.begin(),0);
-
- if (cuts.back() < frames.size()-1)
- cuts.push_back(frames.size()-1);
- }
-
- pScene->mNumAnimations = cuts.size()-1;
- aiAnimation** tmp = pScene->mAnimations = new aiAnimation*[pScene->mNumAnimations];
- for (std::vector<unsigned int>::const_iterator it = cuts.begin(); it != cuts.end()-1; ++it) {
-
- aiAnimation* anim = *tmp++ = new aiAnimation();
- anim->mName.length = ::sprintf(anim->mName.data,"anim%u_from_%u_to_%u",(unsigned int)(it-cuts.begin()),(*it),*(it+1));
-
- anim->mTicksPerSecond = cameraParser.fFrameRate;
- anim->mChannels = new aiNodeAnim*[anim->mNumChannels = 1];
- aiNodeAnim* nd = anim->mChannels[0] = new aiNodeAnim();
- nd->mNodeName.Set("<MD5Camera>");
-
- nd->mNumPositionKeys = nd->mNumRotationKeys = *(it+1) - (*it);
- nd->mPositionKeys = new aiVectorKey[nd->mNumPositionKeys];
- nd->mRotationKeys = new aiQuatKey [nd->mNumRotationKeys];
- for (unsigned int i = 0; i < nd->mNumPositionKeys; ++i) {
-
- nd->mPositionKeys[i].mValue = frames[*it+i].vPositionXYZ;
- MD5::ConvertQuaternion(frames[*it+i].vRotationQuat,nd->mRotationKeys[i].mValue);
- nd->mRotationKeys[i].mTime = nd->mPositionKeys[i].mTime = *it+i;
- }
- }
-}
-
-#endif // !! ASSIMP_BUILD_NO_MD5_IMPORTER
diff --git a/3rdparty/assimp/code/MD5Loader.h b/3rdparty/assimp/code/MD5Loader.h
deleted file mode 100644
index d56cefb1..00000000
--- a/3rdparty/assimp/code/MD5Loader.h
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-
-/** @file MD5Loader.h
- * @brief Definition of the .MD5 importer class.
- * http://www.modwiki.net/wiki/MD5_(file_format)
-*/
-#ifndef AI_MD5LOADER_H_INCLUDED
-#define AI_MD5LOADER_H_INCLUDED
-
-#include "BaseImporter.h"
-#include "MD5Parser.h"
-
-#include "../include/aiTypes.h"
-
-namespace Assimp {
-
-class IOStream;
-using namespace Assimp::MD5;
-
-// ---------------------------------------------------------------------------
-/** Importer class for the MD5 file format
-*/
-class MD5Importer : public BaseImporter
-{
- friend class Importer;
-
-protected:
- /** Constructor to be privately used by Importer */
- MD5Importer();
-
- /** Destructor, private as well */
- ~MD5Importer();
-
-public:
-
- // -------------------------------------------------------------------
- /** Returns whether the class can handle the format of the given file.
- * See BaseImporter::CanRead() for details.
- */
- bool CanRead( const std::string& pFile, IOSystem* pIOHandler,
- bool checkSig) const;
-
-protected:
-
- // -------------------------------------------------------------------
- /** Called by Importer::GetExtensionList() for each loaded importer.
- * See BaseImporter::GetExtensionList() for details
- */
- void GetExtensionList(std::set<std::string>& extensions);
-
- // -------------------------------------------------------------------
- /** Called prior to ReadFile().
- * The function is a request to the importer to update its configuration
- * basing on the Importer's configuration property list.
- */
- void SetupProperties(const Importer* pImp);
-
- // -------------------------------------------------------------------
- /** Imports the given file into the given scene structure.
- * See BaseImporter::InternReadFile() for details
- */
- void InternReadFile( const std::string& pFile, aiScene* pScene,
- IOSystem* pIOHandler);
-
-protected:
-
-
- // -------------------------------------------------------------------
- /** Load a *.MD5MESH file.
- */
- void LoadMD5MeshFile ();
-
- // -------------------------------------------------------------------
- /** Load a *.MD5ANIM file.
- */
- void LoadMD5AnimFile ();
-
- // -------------------------------------------------------------------
- /** Load a *.MD5CAMERA file.
- */
- void LoadMD5CameraFile ();
-
- // -------------------------------------------------------------------
- /** Construct node hierarchy from a given MD5ANIM
- * @param iParentID Current parent ID
- * @param piParent Parent node to attach to
- * @param bones Input bones
- * @param node_anims Generated node animations
- */
- void AttachChilds_Anim(int iParentID,aiNode* piParent,
- AnimBoneList& bones,const aiNodeAnim** node_anims);
-
- // -------------------------------------------------------------------
- /** Construct node hierarchy from a given MD5MESH
- * @param iParentID Current parent ID
- * @param piParent Parent node to attach to
- * @param bones Input bones
- */
- void AttachChilds_Mesh(int iParentID,aiNode* piParent,BoneList& bones);
-
- // -------------------------------------------------------------------
- /** Build unique vertex buffers from a given MD5ANIM
- * @param meshSrc Input data
- */
- void MakeDataUnique (MD5::MeshDesc& meshSrc);
-
- // -------------------------------------------------------------------
- /** Load the contents of a specific file into memory and
- * alocates a buffer to keep it.
- *
- * mBuffer is modified to point to this buffer.
- * @param pFile File stream to be read
- */
- void LoadFileIntoMemory (IOStream* pFile);
- void UnloadFileFromMemory ();
-
-
- /** IOSystem to be used to access files */
- IOSystem* mIOHandler;
-
- /** Path to the file, excluding the file extension but
- with the dot */
- std::string mFile;
-
- /** Buffer to hold the loaded file */
- char* mBuffer;
-
- /** Size of the file */
- unsigned int fileSize;
-
- /** Current line number. For debugging purposes */
- unsigned int iLineNumber;
-
- /** Scene to be filled */
- aiScene* pScene;
-
- /** (Custom) I/O handler implementation */
- IOSystem* pIOHandler;
-
- /** true if a MD5MESH file has already been parsed */
- bool bHadMD5Mesh;
-
- /** true if a MD5ANIM file has already been parsed */
- bool bHadMD5Anim;
-
- /** true if a MD5CAMERA file has already been parsed */
- bool bHadMD5Camera;
-
- /** configuration option: prevent anim autoload */
- bool configNoAutoLoad;
-};
-
-} // end of namespace Assimp
-
-#endif // AI_3DSIMPORTER_H_INC
diff --git a/3rdparty/assimp/code/MD5Parser.cpp b/3rdparty/assimp/code/MD5Parser.cpp
deleted file mode 100644
index d5b89399..00000000
--- a/3rdparty/assimp/code/MD5Parser.cpp
+++ /dev/null
@@ -1,471 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file MD5Parser.cpp
- * @brief Implementation of the MD5 parser class
- */
-#include "AssimpPCH.h"
-
-// internal headers
-#include "MD5Loader.h"
-#include "MaterialSystem.h"
-#include "fast_atof.h"
-#include "ParsingUtils.h"
-#include "StringComparison.h"
-
-using namespace Assimp;
-using namespace Assimp::MD5;
-
-// ------------------------------------------------------------------------------------------------
-// Parse the segment structure fo a MD5 file
-MD5Parser::MD5Parser(char* _buffer, unsigned int _fileSize )
-{
- ai_assert(NULL != _buffer && 0 != _fileSize);
-
- buffer = _buffer;
- fileSize = _fileSize;
- lineNumber = 0;
-
- DefaultLogger::get()->debug("MD5Parser begin");
-
- // parse the file header
- ParseHeader();
-
- // and read all sections until we're finished
- bool running = true;
- while (running) {
- mSections.push_back(Section());
- Section& sec = mSections.back();
- if (!ParseSection(sec)) {
- break;
- }
- }
-
- if ( !DefaultLogger::isNullLogger()) {
- char szBuffer[128]; // should be sufficiently large
- ::sprintf(szBuffer,"MD5Parser end. Parsed %i sections",(int)mSections.size());
- DefaultLogger::get()->debug(szBuffer);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Report error to the log stream
-/*static*/ void MD5Parser::ReportError (const char* error, unsigned int line)
-{
- char szBuffer[1024];
- ::sprintf(szBuffer,"[MD5] Line %i: %s",line,error);
- throw DeadlyImportError(szBuffer);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Report warning to the log stream
-/*static*/ void MD5Parser::ReportWarning (const char* warn, unsigned int line)
-{
- char szBuffer[1024];
- ::sprintf(szBuffer,"[MD5] Line %i: %s",line,warn);
- DefaultLogger::get()->warn(szBuffer);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Parse and validate the MD5 header
-void MD5Parser::ParseHeader()
-{
- // parse and validate the file version
- SkipSpaces();
- if (!TokenMatch(buffer,"MD5Version",10)) {
- ReportError("Invalid MD5 file: MD5Version tag has not been found");
- }
- SkipSpaces();
- unsigned int iVer = ::strtol10(buffer,(const char**)&buffer);
- if (10 != iVer) {
- ReportError("MD5 version tag is unknown (10 is expected)");
- }
- SkipLine();
-
- // print the command line options to the console
- // FIX: can break the log length limit, so we need to be careful
- char* sz = buffer;
- while (!IsLineEnd( *buffer++));
- DefaultLogger::get()->info(std::string(sz,std::min((uintptr_t)MAX_LOG_MESSAGE_LENGTH, (uintptr_t)(buffer-sz))));
- SkipSpacesAndLineEnd();
-}
-
-// ------------------------------------------------------------------------------------------------
-// Recursive MD5 parsing function
-bool MD5Parser::ParseSection(Section& out)
-{
- // store the current line number for use in error messages
- out.iLineNumber = lineNumber;
-
- // first parse the name of the section
- char* sz = buffer;
- while (!IsSpaceOrNewLine( *buffer))buffer++;
- out.mName = std::string(sz,(uintptr_t)(buffer-sz));
- SkipSpaces();
-
- bool running = true;
- while (running) {
- if ('{' == *buffer) {
- // it is a normal section so read all lines
- buffer++;
- bool run = true;
- while (run)
- {
- if (!SkipSpacesAndLineEnd()) {
- return false; // seems this was the last section
- }
- if ('}' == *buffer) {
- buffer++;
- break;
- }
-
- out.mElements.push_back(Element());
- Element& elem = out.mElements.back();
-
- elem.iLineNumber = lineNumber;
- elem.szStart = buffer;
-
- // terminate the line with zero
- while (!IsLineEnd( *buffer))buffer++;
- if (*buffer) {
- ++lineNumber;
- *buffer++ = '\0';
- }
- }
- break;
- }
- else if (!IsSpaceOrNewLine(*buffer)) {
- // it is an element at global scope. Parse its value and go on
- sz = buffer;
- while (!IsSpaceOrNewLine( *buffer++));
- out.mGlobalValue = std::string(sz,(uintptr_t)(buffer-sz));
- continue;
- }
- break;
- }
- return SkipSpacesAndLineEnd();
-}
-
-// ------------------------------------------------------------------------------------------------
-// Some dirty macros just because they're so funny and easy to debug
-
-// skip all spaces ... handle EOL correctly
-#define AI_MD5_SKIP_SPACES() if (!SkipSpaces(&sz)) \
- MD5Parser::ReportWarning("Unexpected end of line",(*eit).iLineNumber);
-
- // read a triple float in brackets: (1.0 1.0 1.0)
-#define AI_MD5_READ_TRIPLE(vec) \
- AI_MD5_SKIP_SPACES(); \
- if ('(' != *sz++) \
- MD5Parser::ReportWarning("Unexpected token: ( was expected",(*eit).iLineNumber); \
- AI_MD5_SKIP_SPACES(); \
- sz = fast_atof_move(sz,(float&)vec.x); \
- AI_MD5_SKIP_SPACES(); \
- sz = fast_atof_move(sz,(float&)vec.y); \
- AI_MD5_SKIP_SPACES(); \
- sz = fast_atof_move(sz,(float&)vec.z); \
- AI_MD5_SKIP_SPACES(); \
- if (')' != *sz++) \
- MD5Parser::ReportWarning("Unexpected token: ) was expected",(*eit).iLineNumber);
-
- // parse a string, enclosed in quotation marks or not
-#define AI_MD5_PARSE_STRING(out) \
- bool bQuota = (*sz == '\"'); \
- const char* szStart = sz; \
- while (!IsSpaceOrNewLine(*sz))++sz; \
- const char* szEnd = sz; \
- if (bQuota) { \
- szStart++; \
- if ('\"' != *(szEnd-=1)) { \
- MD5Parser::ReportWarning("Expected closing quotation marks in string", \
- (*eit).iLineNumber); \
- continue; \
- } \
- } \
- out.length = (size_t)(szEnd - szStart); \
- ::memcpy(out.data,szStart,out.length); \
- out.data[out.length] = '\0';
-
-// ------------------------------------------------------------------------------------------------
-// .MD5MESH parsing function
-MD5MeshParser::MD5MeshParser(SectionList& mSections)
-{
- DefaultLogger::get()->debug("MD5MeshParser begin");
-
- // now parse all sections
- for (SectionList::const_iterator iter = mSections.begin(), iterEnd = mSections.end();iter != iterEnd;++iter){
- if ( (*iter).mName == "numMeshes") {
- mMeshes.reserve(::strtol10((*iter).mGlobalValue.c_str()));
- }
- else if ( (*iter).mName == "numJoints") {
- mJoints.reserve(::strtol10((*iter).mGlobalValue.c_str()));
- }
- else if ((*iter).mName == "joints") {
- // "origin" -1 ( -0.000000 0.016430 -0.006044 ) ( 0.707107 0.000000 0.707107 )
- for (ElementList::const_iterator eit = (*iter).mElements.begin(), eitEnd = (*iter).mElements.end();eit != eitEnd; ++eit){
- mJoints.push_back(BoneDesc());
- BoneDesc& desc = mJoints.back();
-
- const char* sz = (*eit).szStart;
- AI_MD5_PARSE_STRING(desc.mName);
- AI_MD5_SKIP_SPACES();
-
- // negative values, at least -1, is allowed here
- desc.mParentIndex = (int)strtol10s(sz,&sz);
-
- AI_MD5_READ_TRIPLE(desc.mPositionXYZ);
- AI_MD5_READ_TRIPLE(desc.mRotationQuat); // normalized quaternion, so w is not there
- }
- }
- else if ((*iter).mName == "mesh") {
- mMeshes.push_back(MeshDesc());
- MeshDesc& desc = mMeshes.back();
-
- for (ElementList::const_iterator eit = (*iter).mElements.begin(), eitEnd = (*iter).mElements.end();eit != eitEnd; ++eit){
- const char* sz = (*eit).szStart;
-
- // shader attribute
- if (TokenMatch(sz,"shader",6)) {
- AI_MD5_SKIP_SPACES();
- AI_MD5_PARSE_STRING(desc.mShader);
- }
- // numverts attribute
- else if (TokenMatch(sz,"numverts",8)) {
- AI_MD5_SKIP_SPACES();
- desc.mVertices.resize(strtol10(sz));
- }
- // numtris attribute
- else if (TokenMatch(sz,"numtris",7)) {
- AI_MD5_SKIP_SPACES();
- desc.mFaces.resize(strtol10(sz));
- }
- // numweights attribute
- else if (TokenMatch(sz,"numweights",10)) {
- AI_MD5_SKIP_SPACES();
- desc.mWeights.resize(strtol10(sz));
- }
- // vert attribute
- // "vert 0 ( 0.394531 0.513672 ) 0 1"
- else if (TokenMatch(sz,"vert",4)) {
- AI_MD5_SKIP_SPACES();
- const unsigned int idx = ::strtol10(sz,&sz);
- AI_MD5_SKIP_SPACES();
- if (idx >= desc.mVertices.size())
- desc.mVertices.resize(idx+1);
-
- VertexDesc& vert = desc.mVertices[idx];
- if ('(' != *sz++)
- MD5Parser::ReportWarning("Unexpected token: ( was expected",(*eit).iLineNumber);
- AI_MD5_SKIP_SPACES();
- sz = fast_atof_move(sz,(float&)vert.mUV.x);
- AI_MD5_SKIP_SPACES();
- sz = fast_atof_move(sz,(float&)vert.mUV.y);
- AI_MD5_SKIP_SPACES();
- if (')' != *sz++)
- MD5Parser::ReportWarning("Unexpected token: ) was expected",(*eit).iLineNumber);
- AI_MD5_SKIP_SPACES();
- vert.mFirstWeight = ::strtol10(sz,&sz);
- AI_MD5_SKIP_SPACES();
- vert.mNumWeights = ::strtol10(sz,&sz);
- }
- // tri attribute
- // "tri 0 15 13 12"
- else if (TokenMatch(sz,"tri",3)) {
- AI_MD5_SKIP_SPACES();
- const unsigned int idx = strtol10(sz,&sz);
- if (idx >= desc.mFaces.size())
- desc.mFaces.resize(idx+1);
-
- aiFace& face = desc.mFaces[idx];
- face.mIndices = new unsigned int[face.mNumIndices = 3];
- for (unsigned int i = 0; i < 3;++i) {
- AI_MD5_SKIP_SPACES();
- face.mIndices[i] = strtol10(sz,&sz);
- }
- }
- // weight attribute
- // "weight 362 5 0.500000 ( -3.553583 11.893474 9.719339 )"
- else if (TokenMatch(sz,"weight",6)) {
- AI_MD5_SKIP_SPACES();
- const unsigned int idx = strtol10(sz,&sz);
- AI_MD5_SKIP_SPACES();
- if (idx >= desc.mWeights.size())
- desc.mWeights.resize(idx+1);
-
- WeightDesc& weight = desc.mWeights[idx];
- weight.mBone = strtol10(sz,&sz);
- AI_MD5_SKIP_SPACES();
- sz = fast_atof_move(sz,weight.mWeight);
- AI_MD5_READ_TRIPLE(weight.vOffsetPosition);
- }
- }
- }
- }
- DefaultLogger::get()->debug("MD5MeshParser end");
-}
-
-// ------------------------------------------------------------------------------------------------
-// .MD5ANIM parsing function
-MD5AnimParser::MD5AnimParser(SectionList& mSections)
-{
- DefaultLogger::get()->debug("MD5AnimParser begin");
-
- fFrameRate = 24.0f;
- mNumAnimatedComponents = 0xffffffff;
- for (SectionList::const_iterator iter = mSections.begin(), iterEnd = mSections.end();iter != iterEnd;++iter) {
- if ((*iter).mName == "hierarchy") {
- // "sheath" 0 63 6
- for (ElementList::const_iterator eit = (*iter).mElements.begin(), eitEnd = (*iter).mElements.end();eit != eitEnd; ++eit) {
- mAnimatedBones.push_back ( AnimBoneDesc () );
- AnimBoneDesc& desc = mAnimatedBones.back();
-
- const char* sz = (*eit).szStart;
- AI_MD5_PARSE_STRING(desc.mName);
- AI_MD5_SKIP_SPACES();
-
- // parent index - negative values are allowed (at least -1)
- desc.mParentIndex = ::strtol10s(sz,&sz);
-
- // flags (highest is 2^6-1)
- AI_MD5_SKIP_SPACES();
- if (63 < (desc.iFlags = ::strtol10(sz,&sz))){
- MD5Parser::ReportWarning("Invalid flag combination in hierarchy section",(*eit).iLineNumber);
- }
- AI_MD5_SKIP_SPACES();
-
- // index of the first animation keyframe component for this joint
- desc.iFirstKeyIndex = ::strtol10(sz,&sz);
- }
- }
- else if ((*iter).mName == "baseframe") {
- // ( -0.000000 0.016430 -0.006044 ) ( 0.707107 0.000242 0.707107 )
- for (ElementList::const_iterator eit = (*iter).mElements.begin(), eitEnd = (*iter).mElements.end(); eit != eitEnd; ++eit) {
- const char* sz = (*eit).szStart;
-
- mBaseFrames.push_back ( BaseFrameDesc () );
- BaseFrameDesc& desc = mBaseFrames.back();
-
- AI_MD5_READ_TRIPLE(desc.vPositionXYZ);
- AI_MD5_READ_TRIPLE(desc.vRotationQuat);
- }
- }
- else if ((*iter).mName == "frame") {
- if (!(*iter).mGlobalValue.length()) {
- MD5Parser::ReportWarning("A frame section must have a frame index",(*iter).iLineNumber);
- continue;
- }
-
- mFrames.push_back ( FrameDesc () );
- FrameDesc& desc = mFrames.back();
- desc.iIndex = strtol10((*iter).mGlobalValue.c_str());
-
- // we do already know how much storage we will presumably need
- if (0xffffffff != mNumAnimatedComponents)
- desc.mValues.reserve(mNumAnimatedComponents);
-
- // now read all elements (continous list of floats)
- for (ElementList::const_iterator eit = (*iter).mElements.begin(), eitEnd = (*iter).mElements.end(); eit != eitEnd; ++eit){
- const char* sz = (*eit).szStart;
- while (SkipSpacesAndLineEnd(&sz)) {
- float f;sz = fast_atof_move(sz,f);
- desc.mValues.push_back(f);
- }
- }
- }
- else if ((*iter).mName == "numFrames") {
- mFrames.reserve(strtol10((*iter).mGlobalValue.c_str()));
- }
- else if ((*iter).mName == "numJoints") {
- const unsigned int num = strtol10((*iter).mGlobalValue.c_str());
- mAnimatedBones.reserve(num);
-
- // try to guess the number of animated components if that element is not given
- if (0xffffffff == mNumAnimatedComponents)
- mNumAnimatedComponents = num * 6;
- }
- else if ((*iter).mName == "numAnimatedComponents") {
- mAnimatedBones.reserve( strtol10((*iter).mGlobalValue.c_str()));
- }
- else if ((*iter).mName == "frameRate") {
- fast_atof_move((*iter).mGlobalValue.c_str(),fFrameRate);
- }
- }
- DefaultLogger::get()->debug("MD5AnimParser end");
-}
-
-// ------------------------------------------------------------------------------------------------
-// .MD5CAMERA parsing function
-MD5CameraParser::MD5CameraParser(SectionList& mSections)
-{
- DefaultLogger::get()->debug("MD5CameraParser begin");
- fFrameRate = 24.0f;
-
- for (SectionList::const_iterator iter = mSections.begin(), iterEnd = mSections.end();iter != iterEnd;++iter) {
- if ((*iter).mName == "numFrames") {
- frames.reserve(strtol10((*iter).mGlobalValue.c_str()));
- }
- else if ((*iter).mName == "frameRate") {
- fFrameRate = fast_atof ((*iter).mGlobalValue.c_str());
- }
- else if ((*iter).mName == "numCuts") {
- cuts.reserve(strtol10((*iter).mGlobalValue.c_str()));
- }
- else if ((*iter).mName == "cuts") {
- for (ElementList::const_iterator eit = (*iter).mElements.begin(), eitEnd = (*iter).mElements.end(); eit != eitEnd; ++eit){
- cuts.push_back(strtol10((*eit).szStart)+1);
- }
- }
- else if ((*iter).mName == "camera") {
- for (ElementList::const_iterator eit = (*iter).mElements.begin(), eitEnd = (*iter).mElements.end(); eit != eitEnd; ++eit){
- const char* sz = (*eit).szStart;
-
- frames.push_back(CameraAnimFrameDesc());
- CameraAnimFrameDesc& cur = frames.back();
- AI_MD5_READ_TRIPLE(cur.vPositionXYZ);
- AI_MD5_READ_TRIPLE(cur.vRotationQuat);
- AI_MD5_SKIP_SPACES();
- cur.fFOV = fast_atof(sz);
- }
- }
- }
- DefaultLogger::get()->debug("MD5CameraParser end");
-}
-
diff --git a/3rdparty/assimp/code/MD5Parser.h b/3rdparty/assimp/code/MD5Parser.h
deleted file mode 100644
index afb5db8e..00000000
--- a/3rdparty/assimp/code/MD5Parser.h
+++ /dev/null
@@ -1,460 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-
-/** @file MD5Parser.h
- * @brief Definition of the .MD5 parser class.
- * http://www.modwiki.net/wiki/MD5_(file_format)
- */
-#ifndef AI_MD5PARSER_H_INCLUDED
-#define AI_MD5PARSER_H_INCLUDED
-
-#include "../include/aiTypes.h"
-#include "ParsingUtils.h"
-
-struct aiFace;
-
-namespace Assimp {
-namespace MD5 {
-
-// ---------------------------------------------------------------------------
-/** Represents a single element in a MD5 file
- *
- * Elements are always contained in sections.
-*/
-struct Element
-{
- //! Points to the starting point of the element
- //! Whitespace at the beginning and at the end have been removed,
- //! Elements are terminated with \0
- char* szStart;
-
- //! Original line number (can be used in error messages
- //! if a parsing error occurs)
- unsigned int iLineNumber;
-};
-
-typedef std::vector< Element > ElementList;
-
-// ---------------------------------------------------------------------------
-/** Represents a section of a MD5 file (such as the mesh or the joints section)
- *
- * A section is always enclosed in { and } brackets.
-*/
-struct Section
-{
- //! Original line number (can be used in error messages
- //! if a parsing error occurs)
- unsigned int iLineNumber;
-
- //! List of all elements which have been parsed in this section.
- ElementList mElements;
-
- //! Name of the section
- std::string mName;
-
- //! For global elements: the value of the element as string
- //! Iif !length() the section is not a global element
- std::string mGlobalValue;
-};
-
-typedef std::vector< Section> SectionList;
-
-// ---------------------------------------------------------------------------
-/** Basic information about a joint
-*/
-struct BaseJointDescription
-{
- //! Name of the bone
- aiString mName;
-
- //! Parent index of the bone
- int mParentIndex;
-};
-
-// ---------------------------------------------------------------------------
-/** Represents a bone (joint) descriptor in a MD5Mesh file
-*/
-struct BoneDesc : BaseJointDescription
-{
- //! Absolute position of the bone
- aiVector3D mPositionXYZ;
-
- //! Absolute rotation of the bone
- aiVector3D mRotationQuat;
- aiQuaternion mRotationQuatConverted;
-
- //! Absolute transformation of the bone
- //! (temporary)
- aiMatrix4x4 mTransform;
-
- //! Inverse transformation of the bone
- //! (temporary)
- aiMatrix4x4 mInvTransform;
-
- //! Internal
- unsigned int mMap;
-};
-
-typedef std::vector< BoneDesc > BoneList;
-
-// ---------------------------------------------------------------------------
-/** Represents a bone (joint) descriptor in a MD5Anim file
-*/
-struct AnimBoneDesc : BaseJointDescription
-{
- //! Flags (AI_MD5_ANIMATION_FLAG_xxx)
- unsigned int iFlags;
-
- //! Index of the first key that corresponds to this anim bone
- unsigned int iFirstKeyIndex;
-};
-
-typedef std::vector< AnimBoneDesc > AnimBoneList;
-
-
-// ---------------------------------------------------------------------------
-/** Represents a base frame descriptor in a MD5Anim file
-*/
-struct BaseFrameDesc
-{
- aiVector3D vPositionXYZ;
- aiVector3D vRotationQuat;
-};
-
-typedef std::vector< BaseFrameDesc > BaseFrameList;
-
-// ---------------------------------------------------------------------------
-/** Represents a camera animation frame in a MDCamera file
-*/
-struct CameraAnimFrameDesc : BaseFrameDesc
-{
- float fFOV;
-};
-
-typedef std::vector< CameraAnimFrameDesc > CameraFrameList;
-
-// ---------------------------------------------------------------------------
-/** Represents a frame descriptor in a MD5Anim file
-*/
-struct FrameDesc
-{
- //! Index of the frame
- unsigned int iIndex;
-
- //! Animation keyframes - a large blob of data at first
- std::vector< float > mValues;
-};
-
-typedef std::vector< FrameDesc > FrameList;
-
-// ---------------------------------------------------------------------------
-/** Represents a vertex descriptor in a MD5 file
-*/
-struct VertexDesc
-{
- VertexDesc()
- : mFirstWeight (0)
- , mNumWeights (0)
- {}
-
- //! UV cordinate of the vertex
- aiVector2D mUV;
-
- //! Index of the first weight of the vertex in
- //! the vertex weight list
- unsigned int mFirstWeight;
-
- //! Number of weights assigned to this vertex
- unsigned int mNumWeights;
-};
-
-typedef std::vector< VertexDesc > VertexList;
-
-// ---------------------------------------------------------------------------
-/** Represents a vertex weight descriptor in a MD5 file
-*/
-struct WeightDesc
-{
- //! Index of the bone to which this weight refers
- unsigned int mBone;
-
- //! The weight value
- float mWeight;
-
- //! The offset position of this weight
- // ! (in the coordinate system defined by the parent bone)
- aiVector3D vOffsetPosition;
-};
-
-typedef std::vector< WeightDesc > WeightList;
-typedef std::vector< aiFace > FaceList;
-
-// ---------------------------------------------------------------------------
-/** Represents a mesh in a MD5 file
-*/
-struct MeshDesc
-{
- //! Weights of the mesh
- WeightList mWeights;
-
- //! Vertices of the mesh
- VertexList mVertices;
-
- //! Faces of the mesh
- FaceList mFaces;
-
- //! Name of the shader (=texture) to be assigned to the mesh
- aiString mShader;
-};
-
-typedef std::vector< MeshDesc > MeshList;
-
-// ---------------------------------------------------------------------------
-// Convert a quaternion to its usual representation
-inline void ConvertQuaternion (const aiVector3D& in, aiQuaternion& out) {
-
- out.x = in.x;
- out.y = in.y;
- out.z = in.z;
-
- const float t = 1.0f - (in.x*in.x) - (in.y*in.y) - (in.z*in.z);
-
- if (t < 0.0f)
- out.w = 0.0f;
- else out.w = sqrt (t);
-}
-
-// ---------------------------------------------------------------------------
-/** Parses the data sections of a MD5 mesh file
-*/
-class MD5MeshParser
-{
-public:
-
- // -------------------------------------------------------------------
- /** Constructs a new MD5MeshParser instance from an existing
- * preparsed list of file sections.
- *
- * @param mSections List of file sections (output of MD5Parser)
- */
- MD5MeshParser(SectionList& mSections);
-
- //! List of all meshes
- MeshList mMeshes;
-
- //! List of all joints
- BoneList mJoints;
-};
-
-// remove this flag if you need to the bounding box data
-#define AI_MD5_PARSE_NO_BOUNDS
-
-// ---------------------------------------------------------------------------
-/** Parses the data sections of a MD5 animation file
-*/
-class MD5AnimParser
-{
-public:
-
- // -------------------------------------------------------------------
- /** Constructs a new MD5AnimParser instance from an existing
- * preparsed list of file sections.
- *
- * @param mSections List of file sections (output of MD5Parser)
- */
- MD5AnimParser(SectionList& mSections);
-
-
- //! Output frame rate
- float fFrameRate;
-
- //! List of animation bones
- AnimBoneList mAnimatedBones;
-
- //! List of base frames
- BaseFrameList mBaseFrames;
-
- //! List of animation frames
- FrameList mFrames;
-
- //! Number of animated components
- unsigned int mNumAnimatedComponents;
-};
-
-// ---------------------------------------------------------------------------
-/** Parses the data sections of a MD5 camera animation file
-*/
-class MD5CameraParser
-{
-public:
-
- // -------------------------------------------------------------------
- /** Constructs a new MD5CameraParser instance from an existing
- * preparsed list of file sections.
- *
- * @param mSections List of file sections (output of MD5Parser)
- */
- MD5CameraParser(SectionList& mSections);
-
-
- //! Output frame rate
- float fFrameRate;
-
- //! List of cuts
- std::vector<unsigned int> cuts;
-
- //! Frames
- CameraFrameList frames;
-};
-
-// ---------------------------------------------------------------------------
-/** Parses the block structure of MD5MESH and MD5ANIM files (but does no
- * further processing)
-*/
-class MD5Parser
-{
-public:
-
- // -------------------------------------------------------------------
- /** Constructs a new MD5Parser instance from an existing buffer.
- *
- * @param buffer File buffer
- * @param fileSize Length of the file in bytes (excluding a terminal 0)
- */
- MD5Parser(char* buffer, unsigned int fileSize);
-
-
- // -------------------------------------------------------------------
- /** Report a specific error message and throw an exception
- * @param error Error message to be reported
- * @param line Index of the line where the error occured
- */
- static void ReportError (const char* error, unsigned int line);
-
- // -------------------------------------------------------------------
- /** Report a specific warning
- * @param warn Warn message to be reported
- * @param line Index of the line where the error occured
- */
- static void ReportWarning (const char* warn, unsigned int line);
-
-
- void ReportError (const char* error) {
- return ReportError(error, lineNumber);
- }
-
- void ReportWarning (const char* warn) {
- return ReportWarning(warn, lineNumber);
- }
-
-public:
-
- //! List of all sections which have been read
- SectionList mSections;
-
-private:
-
- // -------------------------------------------------------------------
- /** Parses a file section. The current file pointer must be outside
- * of a section.
- * @param out Receives the section data
- * @return true if the end of the file has been reached
- * @throws ImportErrorException if an error occurs
- */
- bool ParseSection(Section& out);
-
- // -------------------------------------------------------------------
- /** Parses the file header
- * @throws ImportErrorException if an error occurs
- */
- void ParseHeader();
-
-
- // override these functions to make sure the line counter gets incremented
- // -------------------------------------------------------------------
- bool SkipLine( const char* in, const char** out)
- {
- ++lineNumber;
- return Assimp::SkipLine(in,out);
- }
- // -------------------------------------------------------------------
- bool SkipLine( )
- {
- return SkipLine(buffer,(const char**)&buffer);
- }
- // -------------------------------------------------------------------
- bool SkipSpacesAndLineEnd( const char* in, const char** out)
- {
- bool bHad = false;
- bool running = true;
- while (running) {
- if ( *in == '\r' || *in == '\n') {
- // we open files in binary mode, so there could be \r\n sequences ...
- if (!bHad) {
- bHad = true;
- ++lineNumber;
- }
- }
- else if (*in == '\t' || *in == ' ')bHad = false;
- else break;
- in++;
- }
- *out = in;
- return *in != '\0';
- }
- // -------------------------------------------------------------------
- bool SkipSpacesAndLineEnd( )
- {
- return SkipSpacesAndLineEnd(buffer,(const char**)&buffer);
- }
- // -------------------------------------------------------------------
- bool SkipSpaces( )
- {
- return Assimp::SkipSpaces((const char**)&buffer);
- }
-
- char* buffer;
- unsigned int fileSize;
- unsigned int lineNumber;
-};
-}}
-
-#endif // AI_MD5PARSER_H_INCLUDED
diff --git a/3rdparty/assimp/code/MDCFileData.h b/3rdparty/assimp/code/MDCFileData.h
deleted file mode 100644
index 6c33880c..00000000
--- a/3rdparty/assimp/code/MDCFileData.h
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file Defines the helper data structures for importing MDC files
-
-**********************************************************************
-File format specification:
-http://themdcfile.planetwolfenstein.gamespy.com/MDC_File_Format.pdf
-**********************************************************************
-
-*/
-#ifndef AI_MDCFILEHELPER_H_INC
-#define AI_MDCFILEHELPER_H_INC
-
-#include "../include/aiTypes.h"
-#include "../include/aiMesh.h"
-#include "../include/aiAnim.h"
-
-#include "./../include/Compiler/pushpack1.h"
-
-
-namespace Assimp {
-namespace MDC {
-
-
-// to make it easier for us, we test the magic word against both "endianesses"
-#define AI_MDC_MAGIC_NUMBER_BE AI_MAKE_MAGIC("CPDI")
-#define AI_MDC_MAGIC_NUMBER_LE AI_MAKE_MAGIC("IDPC")
-
-// common limitations
-#define AI_MDC_VERSION 2
-#define AI_MDC_MAXQPATH 64
-#define AI_MDC_MAX_BONES 128
-
-#define AI_MDC_CVERT_BIAS 127.0f
-#define AI_MDC_DELTA_SCALING 4.0f
-#define AI_MDC_BASE_SCALING (1.0f / 64.0f)
-
-
-// ---------------------------------------------------------------------------
-/** \brief Data structure for a MDC file's main header
- */
-struct Header
-{
- uint32_t ulIdent ;
- uint32_t ulVersion ;
- char ucName [ AI_MDC_MAXQPATH ] ;
- uint32_t ulFlags ;
- uint32_t ulNumFrames ;
- uint32_t ulNumTags ;
- uint32_t ulNumSurfaces ;
- uint32_t ulNumSkins ;
- uint32_t ulOffsetBorderFrames ;
- uint32_t ulOffsetTagNames ;
- uint32_t ulOffsetTagFrames ;
- uint32_t ulOffsetSurfaces ;
- uint32_t ulOffsetEnd ;
-} PACK_STRUCT ;
-
-
-// ---------------------------------------------------------------------------
-/** \brief Data structure for a MDC file's surface header
- */
-struct Surface
-{
- uint32_t ulIdent ;
- char ucName [ AI_MDC_MAXQPATH ] ;
- uint32_t ulFlags ;
- uint32_t ulNumCompFrames ;
- uint32_t ulNumBaseFrames ;
- uint32_t ulNumShaders ;
- uint32_t ulNumVertices ;
- uint32_t ulNumTriangles ;
- uint32_t ulOffsetTriangles ;
- uint32_t ulOffsetShaders ;
- uint32_t ulOffsetTexCoords ;
- uint32_t ulOffsetBaseVerts ;
- uint32_t ulOffsetCompVerts ;
- uint32_t ulOffsetFrameBaseFrames ;
- uint32_t ulOffsetFrameCompFrames ;
- uint32_t ulOffsetEnd ;
-} PACK_STRUCT;
-
-// ---------------------------------------------------------------------------
-/** \brief Data structure for a MDC frame
- */
-struct Frame
-{
- //! bounding box minimum coords
- aiVector3D bboxMin ;
-
- //! bounding box maximum coords
- aiVector3D bboxMax ;
-
- //! local origin of the frame
- aiVector3D localOrigin ;
-
- //! radius of the BB
- float radius ;
-
- //! Name of the frame
- char name [ 16 ] ;
-} PACK_STRUCT;
-
-// ---------------------------------------------------------------------------
-/** \brief Data structure for a MDC triangle
- */
-struct Triangle
-{
- uint32_t aiIndices[3];
-} PACK_STRUCT;
-
-// ---------------------------------------------------------------------------
-/** \brief Data structure for a MDC texture coordinate
- */
-struct TexturCoord
-{
- float u,v;
-} PACK_STRUCT;
-
-// ---------------------------------------------------------------------------
-/** \brief Data structure for a MDC base vertex
- */
-struct BaseVertex
-{
- int16_t x,y,z;
- uint16_t normal;
-} PACK_STRUCT;
-
-// ---------------------------------------------------------------------------
-/** \brief Data structure for a MDC compressed vertex
- */
-struct CompressedVertex
-{
- uint8_t xd,yd,zd,nd;
-} PACK_STRUCT;
-
-
-// ---------------------------------------------------------------------------
-/** \brief Data structure for a MDC shader
- */
-struct Shader
-{
- char ucName [ AI_MDC_MAXQPATH ] ;
- uint32_t ulPath;
-
-} PACK_STRUCT;
-
-#include "./../include/Compiler/poppack1.h"
-
-
-// ---------------------------------------------------------------------------
-/** Build a floating point vertex from the compressed data in MDC files
- */
-void BuildVertex(const Frame& frame,
- const BaseVertex& bvert,
- const CompressedVertex& cvert,
- aiVector3D& vXYZOut,
- aiVector3D& vNorOut);
-}}
-
-#endif // !! AI_MDCFILEHELPER_H_INC
diff --git a/3rdparty/assimp/code/MDCLoader.cpp b/3rdparty/assimp/code/MDCLoader.cpp
deleted file mode 100644
index 9e022cf1..00000000
--- a/3rdparty/assimp/code/MDCLoader.cpp
+++ /dev/null
@@ -1,472 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file Implementation of the MDC importer class */
-
-#include "AssimpPCH.h"
-#ifndef ASSIMP_BUILD_NO_MDC_IMPORTER
-
-// internal headers
-#include "MDCLoader.h"
-#include "MD3FileData.h"
-#include "MDCNormalTable.h" // shouldn't be included by other units
-
-using namespace Assimp;
-using namespace Assimp::MDC;
-
-
-// ------------------------------------------------------------------------------------------------
-void MDC::BuildVertex(const Frame& frame,
- const BaseVertex& bvert,
- const CompressedVertex& cvert,
- aiVector3D& vXYZOut,
- aiVector3D& vNorOut)
-{
- // compute the position
- const float xd = (cvert.xd - AI_MDC_CVERT_BIAS) * AI_MDC_DELTA_SCALING;
- const float yd = (cvert.yd - AI_MDC_CVERT_BIAS) * AI_MDC_DELTA_SCALING;
- const float zd = (cvert.zd - AI_MDC_CVERT_BIAS) * AI_MDC_DELTA_SCALING;
- vXYZOut.x = frame.localOrigin.x + AI_MDC_BASE_SCALING * (bvert.x + xd);
- vXYZOut.y = frame.localOrigin.y + AI_MDC_BASE_SCALING * (bvert.y + yd);
- vXYZOut.z = frame.localOrigin.z + AI_MDC_BASE_SCALING * (bvert.z + zd);
-
- // compute the normal vector .. ehm ... lookup it in the table :-)
- vNorOut.x = mdcNormals[cvert.nd][0];
- vNorOut.y = mdcNormals[cvert.nd][1];
- vNorOut.z = mdcNormals[cvert.nd][2];
-}
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-MDCImporter::MDCImporter()
-{
-}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-MDCImporter::~MDCImporter()
-{
-}
-// ------------------------------------------------------------------------------------------------
-// Returns whether the class can handle the format of the given file.
-bool MDCImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const
-{
- const std::string extension = GetExtension(pFile);
- if (extension == "mdc")
- return true;
-
- // if check for extension is not enough, check for the magic tokens
- if (!extension.length() || checkSig) {
- uint32_t tokens[1];
- tokens[0] = AI_MDC_MAGIC_NUMBER_LE;
- return CheckMagicToken(pIOHandler,pFile,tokens,1);
- }
- return false;
-}
-
-// ------------------------------------------------------------------------------------------------
-void MDCImporter::GetExtensionList(std::set<std::string>& extensions)
-{
- extensions.insert("mdc");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Validate the header of the given MDC file
-void MDCImporter::ValidateHeader()
-{
- AI_SWAP4( this->pcHeader->ulVersion );
- AI_SWAP4( this->pcHeader->ulFlags );
- AI_SWAP4( this->pcHeader->ulNumFrames );
- AI_SWAP4( this->pcHeader->ulNumTags );
- AI_SWAP4( this->pcHeader->ulNumSurfaces );
- AI_SWAP4( this->pcHeader->ulNumSkins );
- AI_SWAP4( this->pcHeader->ulOffsetBorderFrames );
-
- if (pcHeader->ulIdent != AI_MDC_MAGIC_NUMBER_BE &&
- pcHeader->ulIdent != AI_MDC_MAGIC_NUMBER_LE)
- {
- char szBuffer[5];
- szBuffer[0] = ((char*)&pcHeader->ulIdent)[0];
- szBuffer[1] = ((char*)&pcHeader->ulIdent)[1];
- szBuffer[2] = ((char*)&pcHeader->ulIdent)[2];
- szBuffer[3] = ((char*)&pcHeader->ulIdent)[3];
- szBuffer[4] = '\0';
-
- throw DeadlyImportError("Invalid MDC magic word: should be IDPC, the "
- "magic word found is " + std::string( szBuffer ));
- }
-
- if (pcHeader->ulVersion != AI_MDC_VERSION)
- DefaultLogger::get()->warn("Unsupported MDC file version (2 (AI_MDC_VERSION) was expected)");
-
- if (pcHeader->ulOffsetBorderFrames + pcHeader->ulNumFrames * sizeof(MDC::Frame) > this->fileSize ||
- pcHeader->ulOffsetSurfaces + pcHeader->ulNumSurfaces * sizeof(MDC::Surface) > this->fileSize)
- {
- throw DeadlyImportError("Some of the offset values in the MDC header are invalid "
- "and point to something behind the file.");
- }
-
- if (this->configFrameID >= this->pcHeader->ulNumFrames)
- throw DeadlyImportError("The requested frame is not available");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Validate the header of a given MDC file surface
-void MDCImporter::ValidateSurfaceHeader(BE_NCONST MDC::Surface* pcSurf)
-{
- AI_SWAP4(pcSurf->ulFlags);
- AI_SWAP4(pcSurf->ulNumCompFrames);
- AI_SWAP4(pcSurf->ulNumBaseFrames);
- AI_SWAP4(pcSurf->ulNumShaders);
- AI_SWAP4(pcSurf->ulNumVertices);
- AI_SWAP4(pcSurf->ulNumTriangles);
- AI_SWAP4(pcSurf->ulOffsetTriangles);
- AI_SWAP4(pcSurf->ulOffsetTexCoords);
- AI_SWAP4(pcSurf->ulOffsetBaseVerts);
- AI_SWAP4(pcSurf->ulOffsetCompVerts);
- AI_SWAP4(pcSurf->ulOffsetFrameBaseFrames);
- AI_SWAP4(pcSurf->ulOffsetFrameCompFrames);
- AI_SWAP4(pcSurf->ulOffsetEnd);
-
- const unsigned int iMax = this->fileSize - (unsigned int)((int8_t*)pcSurf-(int8_t*)pcHeader);
-
- if (pcSurf->ulOffsetBaseVerts + pcSurf->ulNumVertices * sizeof(MDC::BaseVertex) > iMax ||
- (pcSurf->ulNumCompFrames && pcSurf->ulOffsetCompVerts + pcSurf->ulNumVertices * sizeof(MDC::CompressedVertex) > iMax) ||
- pcSurf->ulOffsetTriangles + pcSurf->ulNumTriangles * sizeof(MDC::Triangle) > iMax ||
- pcSurf->ulOffsetTexCoords + pcSurf->ulNumVertices * sizeof(MDC::TexturCoord) > iMax ||
- pcSurf->ulOffsetShaders + pcSurf->ulNumShaders * sizeof(MDC::Shader) > iMax ||
- pcSurf->ulOffsetFrameBaseFrames + pcSurf->ulNumBaseFrames * 2 > iMax ||
- (pcSurf->ulNumCompFrames && pcSurf->ulOffsetFrameCompFrames + pcSurf->ulNumCompFrames * 2 > iMax))
- {
- throw DeadlyImportError("Some of the offset values in the MDC surface header "
- "are invalid and point somewhere behind the file.");
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Setup configuration properties
-void MDCImporter::SetupProperties(const Importer* pImp)
-{
- // The AI_CONFIG_IMPORT_MDC_KEYFRAME option overrides the
- // AI_CONFIG_IMPORT_GLOBAL_KEYFRAME option.
- if (0xffffffff == (this->configFrameID = pImp->GetPropertyInteger(
- AI_CONFIG_IMPORT_MDC_KEYFRAME,0xffffffff)))
- {
- this->configFrameID = pImp->GetPropertyInteger(AI_CONFIG_IMPORT_GLOBAL_KEYFRAME,0);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Imports the given file into the given scene structure.
-void MDCImporter::InternReadFile(
- const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler)
-{
- boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile));
-
- // Check whether we can read from the file
- if ( file.get() == NULL)
- throw DeadlyImportError( "Failed to open MDC file " + pFile + ".");
-
- // check whether the mdc file is large enough to contain the file header
- fileSize = (unsigned int)file->FileSize();
- if ( fileSize < sizeof(MDC::Header))
- throw DeadlyImportError( "MDC File is too small.");
-
- std::vector<unsigned char> mBuffer2(fileSize);
- file->Read( &mBuffer2[0], 1, fileSize);
- mBuffer = &mBuffer2[0];
-
- // validate the file header
- this->pcHeader = (BE_NCONST MDC::Header*)this->mBuffer;
- this->ValidateHeader();
-
- std::vector<std::string> aszShaders;
-
- // get a pointer to the frame we want to read
- BE_NCONST MDC::Frame* pcFrame = (BE_NCONST MDC::Frame*)(this->mBuffer+
- this->pcHeader->ulOffsetBorderFrames);
-
- // no need to swap the other members, we won't need them
- pcFrame += configFrameID;
- AI_SWAP4( pcFrame->localOrigin[0] );
- AI_SWAP4( pcFrame->localOrigin[1] );
- AI_SWAP4( pcFrame->localOrigin[2] );
-
- // get the number of valid surfaces
- BE_NCONST MDC::Surface* pcSurface, *pcSurface2;
- pcSurface = pcSurface2 = (BE_NCONST MDC::Surface*)(mBuffer + pcHeader->ulOffsetSurfaces);
- unsigned int iNumShaders = 0;
- for (unsigned int i = 0; i < pcHeader->ulNumSurfaces;++i)
- {
- // validate the surface header
- this->ValidateSurfaceHeader(pcSurface2);
-
- if (pcSurface2->ulNumVertices && pcSurface2->ulNumTriangles)++pScene->mNumMeshes;
- iNumShaders += pcSurface2->ulNumShaders;
- pcSurface2 = (BE_NCONST MDC::Surface*)((int8_t*)pcSurface2 + pcSurface2->ulOffsetEnd);
- }
- aszShaders.reserve(iNumShaders);
- pScene->mMeshes = new aiMesh*[pScene->mNumMeshes];
-
- // necessary that we don't crash if an exception occurs
- for (unsigned int i = 0; i < pScene->mNumMeshes;++i)
- pScene->mMeshes[i] = NULL;
-
- // now read all surfaces
- unsigned int iDefaultMatIndex = 0xffffffff;
- for (unsigned int i = 0, iNum = 0; i < pcHeader->ulNumSurfaces;++i)
- {
- if (!pcSurface->ulNumVertices || !pcSurface->ulNumTriangles)continue;
- aiMesh* pcMesh = pScene->mMeshes[iNum++] = new aiMesh();
-
- pcMesh->mNumFaces = pcSurface->ulNumTriangles;
- pcMesh->mNumVertices = pcMesh->mNumFaces * 3;
-
- // store the name of the surface for use as node name.
- // FIX: make sure there is a 0 termination
- const_cast<char&>(pcSurface->ucName[AI_MDC_MAXQPATH-1]) = '\0';
- pcMesh->mTextureCoords[3] = (aiVector3D*)pcSurface->ucName;
-
- // go to the first shader in the file. ignore the others.
- if (pcSurface->ulNumShaders)
- {
- const MDC::Shader* pcShader = (const MDC::Shader*)((int8_t*)pcSurface + pcSurface->ulOffsetShaders);
- pcMesh->mMaterialIndex = (unsigned int)aszShaders.size();
-
- // create a new shader
- aszShaders.push_back(std::string( pcShader->ucName, std::min(
- ::strlen(pcShader->ucName),sizeof(pcShader->ucName)) ));
- }
- // need to create a default material
- else if (0xffffffff == iDefaultMatIndex)
- {
- pcMesh->mMaterialIndex = iDefaultMatIndex = (unsigned int)aszShaders.size();
- aszShaders.push_back(std::string());
- }
- // otherwise assign a reference to the default material
- else pcMesh->mMaterialIndex = iDefaultMatIndex;
-
- // allocate output storage for the mesh
- aiVector3D* pcVertCur = pcMesh->mVertices = new aiVector3D[pcMesh->mNumVertices];
- aiVector3D* pcNorCur = pcMesh->mNormals = new aiVector3D[pcMesh->mNumVertices];
- aiVector3D* pcUVCur = pcMesh->mTextureCoords[0] = new aiVector3D[pcMesh->mNumVertices];
- aiFace* pcFaceCur = pcMesh->mFaces = new aiFace[pcMesh->mNumFaces];
-
- // create all vertices/faces
- BE_NCONST MDC::Triangle* pcTriangle = (BE_NCONST MDC::Triangle*)
- ((int8_t*)pcSurface+pcSurface->ulOffsetTriangles);
-
- BE_NCONST MDC::TexturCoord* const pcUVs = (BE_NCONST MDC::TexturCoord*)
- ((int8_t*)pcSurface+pcSurface->ulOffsetTexCoords);
-
- // get a pointer to the uncompressed vertices
- int16_t iOfs = *((int16_t*) ((int8_t*) pcSurface +
- pcSurface->ulOffsetFrameBaseFrames) + this->configFrameID);
-
- AI_SWAP2(iOfs);
-
- BE_NCONST MDC::BaseVertex* const pcVerts = (BE_NCONST MDC::BaseVertex*)
- ((int8_t*)pcSurface+pcSurface->ulOffsetBaseVerts) +
- ((int)iOfs * pcSurface->ulNumVertices * 4);
-
- // do the main swapping stuff ...
-#if (defined AI_BUILD_BIG_ENDIAN)
-
- // swap all triangles
- for (unsigned int i = 0; i < pcSurface->ulNumTriangles;++i)
- {
- AI_SWAP4( pcTriangle[i].aiIndices[0] );
- AI_SWAP4( pcTriangle[i].aiIndices[1] );
- AI_SWAP4( pcTriangle[i].aiIndices[2] );
- }
-
- // swap all vertices
- for (unsigned int i = 0; i < pcSurface->ulNumVertices*pcSurface->ulNumBaseFrames;++i)
- {
- AI_SWAP2( pcVerts->normal );
- AI_SWAP2( pcVerts->x );
- AI_SWAP2( pcVerts->y );
- AI_SWAP2( pcVerts->z );
- }
-
- // swap all texture coordinates
- for (unsigned int i = 0; i < pcSurface->ulNumVertices;++i)
- {
- AI_SWAP4( pcUVs->v );
- AI_SWAP4( pcUVs->v );
- }
-
-#endif
-
- const MDC::CompressedVertex* pcCVerts = NULL;
- int16_t* mdcCompVert = NULL;
-
- // access compressed frames for large frame numbers, but never for the first
- if ( this->configFrameID && pcSurface->ulNumCompFrames > 0 )
- {
- mdcCompVert = (int16_t*) ((int8_t*)pcSurface+pcSurface->ulOffsetFrameCompFrames) + this->configFrameID;
- AI_SWAP2P(mdcCompVert);
- if ( *mdcCompVert >= 0 )
- {
- pcCVerts = (const MDC::CompressedVertex*)((int8_t*)pcSurface +
- pcSurface->ulOffsetCompVerts) + *mdcCompVert * pcSurface->ulNumVertices;
- }
- else mdcCompVert = NULL;
- }
-
- // copy all faces
- for (unsigned int iFace = 0; iFace < pcSurface->ulNumTriangles;++iFace,
- ++pcTriangle,++pcFaceCur)
- {
- const unsigned int iOutIndex = iFace*3;
- pcFaceCur->mNumIndices = 3;
- pcFaceCur->mIndices = new unsigned int[3];
-
- for (unsigned int iIndex = 0; iIndex < 3;++iIndex,
- ++pcVertCur,++pcUVCur,++pcNorCur)
- {
- uint32_t quak = pcTriangle->aiIndices[iIndex];
- if (quak >= pcSurface->ulNumVertices)
- {
- DefaultLogger::get()->error("MDC vertex index is out of range");
- quak = pcSurface->ulNumVertices-1;
- }
-
- // compressed vertices?
- if (mdcCompVert)
- {
- MDC::BuildVertex(*pcFrame,pcVerts[quak],pcCVerts[quak],
- *pcVertCur,*pcNorCur);
- }
- else
- {
- // copy position
- pcVertCur->x = pcVerts[quak].x * AI_MDC_BASE_SCALING;
- pcVertCur->y = pcVerts[quak].y * AI_MDC_BASE_SCALING;
- pcVertCur->z = pcVerts[quak].z * AI_MDC_BASE_SCALING;
-
- // copy normals
- MD3::LatLngNormalToVec3( pcVerts[quak].normal, &pcNorCur->x );
-
- // copy texture coordinates
- pcUVCur->x = pcUVs[quak].u;
- pcUVCur->y = 1.0f-pcUVs[quak].v; // DX to OGL
- }
- pcVertCur->x += pcFrame->localOrigin[0] ;
- pcVertCur->y += pcFrame->localOrigin[1] ;
- pcVertCur->z += pcFrame->localOrigin[2] ;
- }
-
- // swap the face order - DX to OGL
- pcFaceCur->mIndices[0] = iOutIndex + 2;
- pcFaceCur->mIndices[1] = iOutIndex + 1;
- pcFaceCur->mIndices[2] = iOutIndex + 0;
- }
-
- pcSurface = (BE_NCONST MDC::Surface*)((int8_t*)pcSurface + pcSurface->ulOffsetEnd);
- }
-
- // create a flat node graph with a root node and one child for each surface
- if (!pScene->mNumMeshes)
- throw DeadlyImportError( "Invalid MDC file: File contains no valid mesh");
- else if (1 == pScene->mNumMeshes)
- {
- pScene->mRootNode = new aiNode();
- pScene->mRootNode->mName.Set(std::string((const char*)pScene->mMeshes[0]->mTextureCoords[3]));
- pScene->mRootNode->mNumMeshes = 1;
- pScene->mRootNode->mMeshes = new unsigned int[1];
- pScene->mRootNode->mMeshes[0] = 0;
- }
- else
- {
- pScene->mRootNode = new aiNode();
- pScene->mRootNode->mNumChildren = pScene->mNumMeshes;
- pScene->mRootNode->mChildren = new aiNode*[pScene->mNumMeshes];
- pScene->mRootNode->mName.Set("<root>");
- for (unsigned int i = 0; i < pScene->mNumMeshes;++i)
- {
- aiNode* pcNode = pScene->mRootNode->mChildren[i] = new aiNode();
- pcNode->mParent = pScene->mRootNode;
- pcNode->mName.Set(std::string((const char*)pScene->mMeshes[i]->mTextureCoords[3]));
- pcNode->mNumMeshes = 1;
- pcNode->mMeshes = new unsigned int[1];
- pcNode->mMeshes[0] = i;
- }
- }
-
- // make sure we invalidate the pointer to the mesh name
- for (unsigned int i = 0; i < pScene->mNumMeshes;++i)
- pScene->mMeshes[i]->mTextureCoords[3] = NULL;
-
- // create materials
- pScene->mNumMaterials = (unsigned int)aszShaders.size();
- pScene->mMaterials = new aiMaterial*[pScene->mNumMaterials];
- for (unsigned int i = 0; i < pScene->mNumMaterials;++i)
- {
- MaterialHelper* pcMat = new MaterialHelper();
- pScene->mMaterials[i] = pcMat;
-
- const std::string& name = aszShaders[i];
-
- int iMode = (int)aiShadingMode_Gouraud;
- pcMat->AddProperty<int>(&iMode, 1, AI_MATKEY_SHADING_MODEL);
-
- // add a small ambient color value - RtCW seems to have one
- aiColor3D clr;
- clr.b = clr.g = clr.r = 0.05f;
- pcMat->AddProperty<aiColor3D>(&clr, 1,AI_MATKEY_COLOR_AMBIENT);
-
- if (name.length())clr.b = clr.g = clr.r = 1.0f;
- else clr.b = clr.g = clr.r = 0.6f;
-
- pcMat->AddProperty<aiColor3D>(&clr, 1,AI_MATKEY_COLOR_DIFFUSE);
- pcMat->AddProperty<aiColor3D>(&clr, 1,AI_MATKEY_COLOR_SPECULAR);
-
- if (name.length())
- {
- aiString path;
- path.Set(name);
- pcMat->AddProperty(&path,AI_MATKEY_TEXTURE_DIFFUSE(0));
- }
- }
-}
-
-#endif // !! ASSIMP_BUILD_NO_MDC_IMPORTER
diff --git a/3rdparty/assimp/code/MDCLoader.h b/3rdparty/assimp/code/MDCLoader.h
deleted file mode 100644
index f97efc73..00000000
--- a/3rdparty/assimp/code/MDCLoader.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file MDCLoader.h
- * @brief Definition of the MDC importer class.
- */
-#ifndef AI_MDCLOADER_H_INCLUDED
-#define AI_MDCLOADER_H_INCLUDED
-
-#include "../include/aiTypes.h"
-
-#include "BaseImporter.h"
-#include "MDCFileData.h"
-#include "ByteSwap.h"
-
-namespace Assimp {
-using namespace MDC;
-
-// ---------------------------------------------------------------------------
-/** Importer class to load the RtCW MDC file format
-*/
-class MDCImporter : public BaseImporter
-{
- friend class Importer;
-
-protected:
- /** Constructor to be privately used by Importer */
- MDCImporter();
-
- /** Destructor, private as well */
- ~MDCImporter();
-
-public:
-
- // -------------------------------------------------------------------
- /** Returns whether the class can handle the format of the given file.
- * See BaseImporter::CanRead() for details. */
- bool CanRead( const std::string& pFile, IOSystem* pIOHandler,
- bool checkSig) const;
-
- // -------------------------------------------------------------------
- /** Called prior to ReadFile().
- * The function is a request to the importer to update its configuration
- * basing on the Importer's configuration property list.
- */
- void SetupProperties(const Importer* pImp);
-
-protected:
-
- // -------------------------------------------------------------------
- /** Called by Importer::GetExtensionList() for each loaded importer.
- * See BaseImporter::GetExtensionList() for details
- */
- void GetExtensionList(std::set<std::string>& extensions);
-
- // -------------------------------------------------------------------
- /** Imports the given file into the given scene structure.
- * See BaseImporter::InternReadFile() for details
- */
- void InternReadFile( const std::string& pFile, aiScene* pScene,
- IOSystem* pIOHandler);
-
-protected:
-
-
- // -------------------------------------------------------------------
- /** Validate the header of the file
- */
- void ValidateHeader();
-
- // -------------------------------------------------------------------
- /** Validate the header of a MDC surface
- */
- void ValidateSurfaceHeader(BE_NCONST MDC::Surface* pcSurf);
-
-protected:
-
-
- /** Configuration option: frame to be loaded */
- unsigned int configFrameID;
-
- /** Header of the MDC file */
- BE_NCONST MDC::Header* pcHeader;
-
- /** Buffer to hold the loaded file */
- unsigned char* mBuffer;
-
- /** size of the file, in bytes */
- unsigned int fileSize;
-};
-
-} // end of namespace Assimp
-
-#endif // AI_3DSIMPORTER_H_INC
-
diff --git a/3rdparty/assimp/code/MDCNormalTable.h b/3rdparty/assimp/code/MDCNormalTable.h
deleted file mode 100644
index f47e97f3..00000000
--- a/3rdparty/assimp/code/MDCNormalTable.h
+++ /dev/null
@@ -1,299 +0,0 @@
-/* -----------------------------------------------------------------------------
-
-PicoModel Library
-
-Copyright (c) 2002, Randy Reddig & seaw0lf
-All rights reserved.
-
-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 names of the copyright holders 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.
-
------------------------------------------------------------------------------ */
-
-#if (!defined MDC_NORMAL_TABLE_INCLUDED)
-#define MDC_NORMAL_TABLE_INCLUDED
-
-/* mdc decoding normal table */
-float mdcNormals[ 256 ][ 3 ] =
-{
- { 1.000000f, 0.000000f, 0.000000f },
- { 0.980785f, 0.195090f, 0.000000f },
- { 0.923880f, 0.382683f, 0.000000f },
- { 0.831470f, 0.555570f, 0.000000f },
- { 0.707107f, 0.707107f, 0.000000f },
- { 0.555570f, 0.831470f, 0.000000f },
- { 0.382683f, 0.923880f, 0.000000f },
- { 0.195090f, 0.980785f, 0.000000f },
- { -0.000000f, 1.000000f, 0.000000f },
- { -0.195090f, 0.980785f, 0.000000f },
- { -0.382683f, 0.923880f, 0.000000f },
- { -0.555570f, 0.831470f, 0.000000f },
- { -0.707107f, 0.707107f, 0.000000f },
- { -0.831470f, 0.555570f, 0.000000f },
- { -0.923880f, 0.382683f, 0.000000f },
- { -0.980785f, 0.195090f, 0.000000f },
- { -1.000000f, -0.000000f, 0.000000f },
- { -0.980785f, -0.195090f, 0.000000f },
- { -0.923880f, -0.382683f, 0.000000f },
- { -0.831470f, -0.555570f, 0.000000f },
- { -0.707107f, -0.707107f, 0.000000f },
- { -0.555570f, -0.831469f, 0.000000f },
- { -0.382684f, -0.923880f, 0.000000f },
- { -0.195090f, -0.980785f, 0.000000f },
- { 0.000000f, -1.000000f, 0.000000f },
- { 0.195090f, -0.980785f, 0.000000f },
- { 0.382684f, -0.923879f, 0.000000f },
- { 0.555570f, -0.831470f, 0.000000f },
- { 0.707107f, -0.707107f, 0.000000f },
- { 0.831470f, -0.555570f, 0.000000f },
- { 0.923880f, -0.382683f, 0.000000f },
- { 0.980785f, -0.195090f, 0.000000f },
- { 0.980785f, 0.000000f, -0.195090f },
- { 0.956195f, 0.218245f, -0.195090f },
- { 0.883657f, 0.425547f, -0.195090f },
- { 0.766809f, 0.611510f, -0.195090f },
- { 0.611510f, 0.766809f, -0.195090f },
- { 0.425547f, 0.883657f, -0.195090f },
- { 0.218245f, 0.956195f, -0.195090f },
- { -0.000000f, 0.980785f, -0.195090f },
- { -0.218245f, 0.956195f, -0.195090f },
- { -0.425547f, 0.883657f, -0.195090f },
- { -0.611510f, 0.766809f, -0.195090f },
- { -0.766809f, 0.611510f, -0.195090f },
- { -0.883657f, 0.425547f, -0.195090f },
- { -0.956195f, 0.218245f, -0.195090f },
- { -0.980785f, -0.000000f, -0.195090f },
- { -0.956195f, -0.218245f, -0.195090f },
- { -0.883657f, -0.425547f, -0.195090f },
- { -0.766809f, -0.611510f, -0.195090f },
- { -0.611510f, -0.766809f, -0.195090f },
- { -0.425547f, -0.883657f, -0.195090f },
- { -0.218245f, -0.956195f, -0.195090f },
- { 0.000000f, -0.980785f, -0.195090f },
- { 0.218245f, -0.956195f, -0.195090f },
- { 0.425547f, -0.883657f, -0.195090f },
- { 0.611510f, -0.766809f, -0.195090f },
- { 0.766809f, -0.611510f, -0.195090f },
- { 0.883657f, -0.425547f, -0.195090f },
- { 0.956195f, -0.218245f, -0.195090f },
- { 0.923880f, 0.000000f, -0.382683f },
- { 0.892399f, 0.239118f, -0.382683f },
- { 0.800103f, 0.461940f, -0.382683f },
- { 0.653281f, 0.653281f, -0.382683f },
- { 0.461940f, 0.800103f, -0.382683f },
- { 0.239118f, 0.892399f, -0.382683f },
- { -0.000000f, 0.923880f, -0.382683f },
- { -0.239118f, 0.892399f, -0.382683f },
- { -0.461940f, 0.800103f, -0.382683f },
- { -0.653281f, 0.653281f, -0.382683f },
- { -0.800103f, 0.461940f, -0.382683f },
- { -0.892399f, 0.239118f, -0.382683f },
- { -0.923880f, -0.000000f, -0.382683f },
- { -0.892399f, -0.239118f, -0.382683f },
- { -0.800103f, -0.461940f, -0.382683f },
- { -0.653282f, -0.653281f, -0.382683f },
- { -0.461940f, -0.800103f, -0.382683f },
- { -0.239118f, -0.892399f, -0.382683f },
- { 0.000000f, -0.923880f, -0.382683f },
- { 0.239118f, -0.892399f, -0.382683f },
- { 0.461940f, -0.800103f, -0.382683f },
- { 0.653281f, -0.653282f, -0.382683f },
- { 0.800103f, -0.461940f, -0.382683f },
- { 0.892399f, -0.239117f, -0.382683f },
- { 0.831470f, 0.000000f, -0.555570f },
- { 0.790775f, 0.256938f, -0.555570f },
- { 0.672673f, 0.488726f, -0.555570f },
- { 0.488726f, 0.672673f, -0.555570f },
- { 0.256938f, 0.790775f, -0.555570f },
- { -0.000000f, 0.831470f, -0.555570f },
- { -0.256938f, 0.790775f, -0.555570f },
- { -0.488726f, 0.672673f, -0.555570f },
- { -0.672673f, 0.488726f, -0.555570f },
- { -0.790775f, 0.256938f, -0.555570f },
- { -0.831470f, -0.000000f, -0.555570f },
- { -0.790775f, -0.256938f, -0.555570f },
- { -0.672673f, -0.488726f, -0.555570f },
- { -0.488725f, -0.672673f, -0.555570f },
- { -0.256938f, -0.790775f, -0.555570f },
- { 0.000000f, -0.831470f, -0.555570f },
- { 0.256938f, -0.790775f, -0.555570f },
- { 0.488725f, -0.672673f, -0.555570f },
- { 0.672673f, -0.488726f, -0.555570f },
- { 0.790775f, -0.256938f, -0.555570f },
- { 0.707107f, 0.000000f, -0.707107f },
- { 0.653281f, 0.270598f, -0.707107f },
- { 0.500000f, 0.500000f, -0.707107f },
- { 0.270598f, 0.653281f, -0.707107f },
- { -0.000000f, 0.707107f, -0.707107f },
- { -0.270598f, 0.653282f, -0.707107f },
- { -0.500000f, 0.500000f, -0.707107f },
- { -0.653281f, 0.270598f, -0.707107f },
- { -0.707107f, -0.000000f, -0.707107f },
- { -0.653281f, -0.270598f, -0.707107f },
- { -0.500000f, -0.500000f, -0.707107f },
- { -0.270598f, -0.653281f, -0.707107f },
- { 0.000000f, -0.707107f, -0.707107f },
- { 0.270598f, -0.653281f, -0.707107f },
- { 0.500000f, -0.500000f, -0.707107f },
- { 0.653282f, -0.270598f, -0.707107f },
- { 0.555570f, 0.000000f, -0.831470f },
- { 0.481138f, 0.277785f, -0.831470f },
- { 0.277785f, 0.481138f, -0.831470f },
- { -0.000000f, 0.555570f, -0.831470f },
- { -0.277785f, 0.481138f, -0.831470f },
- { -0.481138f, 0.277785f, -0.831470f },
- { -0.555570f, -0.000000f, -0.831470f },
- { -0.481138f, -0.277785f, -0.831470f },
- { -0.277785f, -0.481138f, -0.831470f },
- { 0.000000f, -0.555570f, -0.831470f },
- { 0.277785f, -0.481138f, -0.831470f },
- { 0.481138f, -0.277785f, -0.831470f },
- { 0.382683f, 0.000000f, -0.923880f },
- { 0.270598f, 0.270598f, -0.923880f },
- { -0.000000f, 0.382683f, -0.923880f },
- { -0.270598f, 0.270598f, -0.923880f },
- { -0.382683f, -0.000000f, -0.923880f },
- { -0.270598f, -0.270598f, -0.923880f },
- { 0.000000f, -0.382683f, -0.923880f },
- { 0.270598f, -0.270598f, -0.923880f },
- { 0.195090f, 0.000000f, -0.980785f },
- { -0.000000f, 0.195090f, -0.980785f },
- { -0.195090f, -0.000000f, -0.980785f },
- { 0.000000f, -0.195090f, -0.980785f },
- { 0.980785f, 0.000000f, 0.195090f },
- { 0.956195f, 0.218245f, 0.195090f },
- { 0.883657f, 0.425547f, 0.195090f },
- { 0.766809f, 0.611510f, 0.195090f },
- { 0.611510f, 0.766809f, 0.195090f },
- { 0.425547f, 0.883657f, 0.195090f },
- { 0.218245f, 0.956195f, 0.195090f },
- { -0.000000f, 0.980785f, 0.195090f },
- { -0.218245f, 0.956195f, 0.195090f },
- { -0.425547f, 0.883657f, 0.195090f },
- { -0.611510f, 0.766809f, 0.195090f },
- { -0.766809f, 0.611510f, 0.195090f },
- { -0.883657f, 0.425547f, 0.195090f },
- { -0.956195f, 0.218245f, 0.195090f },
- { -0.980785f, -0.000000f, 0.195090f },
- { -0.956195f, -0.218245f, 0.195090f },
- { -0.883657f, -0.425547f, 0.195090f },
- { -0.766809f, -0.611510f, 0.195090f },
- { -0.611510f, -0.766809f, 0.195090f },
- { -0.425547f, -0.883657f, 0.195090f },
- { -0.218245f, -0.956195f, 0.195090f },
- { 0.000000f, -0.980785f, 0.195090f },
- { 0.218245f, -0.956195f, 0.195090f },
- { 0.425547f, -0.883657f, 0.195090f },
- { 0.611510f, -0.766809f, 0.195090f },
- { 0.766809f, -0.611510f, 0.195090f },
- { 0.883657f, -0.425547f, 0.195090f },
- { 0.956195f, -0.218245f, 0.195090f },
- { 0.923880f, 0.000000f, 0.382683f },
- { 0.892399f, 0.239118f, 0.382683f },
- { 0.800103f, 0.461940f, 0.382683f },
- { 0.653281f, 0.653281f, 0.382683f },
- { 0.461940f, 0.800103f, 0.382683f },
- { 0.239118f, 0.892399f, 0.382683f },
- { -0.000000f, 0.923880f, 0.382683f },
- { -0.239118f, 0.892399f, 0.382683f },
- { -0.461940f, 0.800103f, 0.382683f },
- { -0.653281f, 0.653281f, 0.382683f },
- { -0.800103f, 0.461940f, 0.382683f },
- { -0.892399f, 0.239118f, 0.382683f },
- { -0.923880f, -0.000000f, 0.382683f },
- { -0.892399f, -0.239118f, 0.382683f },
- { -0.800103f, -0.461940f, 0.382683f },
- { -0.653282f, -0.653281f, 0.382683f },
- { -0.461940f, -0.800103f, 0.382683f },
- { -0.239118f, -0.892399f, 0.382683f },
- { 0.000000f, -0.923880f, 0.382683f },
- { 0.239118f, -0.892399f, 0.382683f },
- { 0.461940f, -0.800103f, 0.382683f },
- { 0.653281f, -0.653282f, 0.382683f },
- { 0.800103f, -0.461940f, 0.382683f },
- { 0.892399f, -0.239117f, 0.382683f },
- { 0.831470f, 0.000000f, 0.555570f },
- { 0.790775f, 0.256938f, 0.555570f },
- { 0.672673f, 0.488726f, 0.555570f },
- { 0.488726f, 0.672673f, 0.555570f },
- { 0.256938f, 0.790775f, 0.555570f },
- { -0.000000f, 0.831470f, 0.555570f },
- { -0.256938f, 0.790775f, 0.555570f },
- { -0.488726f, 0.672673f, 0.555570f },
- { -0.672673f, 0.488726f, 0.555570f },
- { -0.790775f, 0.256938f, 0.555570f },
- { -0.831470f, -0.000000f, 0.555570f },
- { -0.790775f, -0.256938f, 0.555570f },
- { -0.672673f, -0.488726f, 0.555570f },
- { -0.488725f, -0.672673f, 0.555570f },
- { -0.256938f, -0.790775f, 0.555570f },
- { 0.000000f, -0.831470f, 0.555570f },
- { 0.256938f, -0.790775f, 0.555570f },
- { 0.488725f, -0.672673f, 0.555570f },
- { 0.672673f, -0.488726f, 0.555570f },
- { 0.790775f, -0.256938f, 0.555570f },
- { 0.707107f, 0.000000f, 0.707107f },
- { 0.653281f, 0.270598f, 0.707107f },
- { 0.500000f, 0.500000f, 0.707107f },
- { 0.270598f, 0.653281f, 0.707107f },
- { -0.000000f, 0.707107f, 0.707107f },
- { -0.270598f, 0.653282f, 0.707107f },
- { -0.500000f, 0.500000f, 0.707107f },
- { -0.653281f, 0.270598f, 0.707107f },
- { -0.707107f, -0.000000f, 0.707107f },
- { -0.653281f, -0.270598f, 0.707107f },
- { -0.500000f, -0.500000f, 0.707107f },
- { -0.270598f, -0.653281f, 0.707107f },
- { 0.000000f, -0.707107f, 0.707107f },
- { 0.270598f, -0.653281f, 0.707107f },
- { 0.500000f, -0.500000f, 0.707107f },
- { 0.653282f, -0.270598f, 0.707107f },
- { 0.555570f, 0.000000f, 0.831470f },
- { 0.481138f, 0.277785f, 0.831470f },
- { 0.277785f, 0.481138f, 0.831470f },
- { -0.000000f, 0.555570f, 0.831470f },
- { -0.277785f, 0.481138f, 0.831470f },
- { -0.481138f, 0.277785f, 0.831470f },
- { -0.555570f, -0.000000f, 0.831470f },
- { -0.481138f, -0.277785f, 0.831470f },
- { -0.277785f, -0.481138f, 0.831470f },
- { 0.000000f, -0.555570f, 0.831470f },
- { 0.277785f, -0.481138f, 0.831470f },
- { 0.481138f, -0.277785f, 0.831470f },
- { 0.382683f, 0.000000f, 0.923880f },
- { 0.270598f, 0.270598f, 0.923880f },
- { -0.000000f, 0.382683f, 0.923880f },
- { -0.270598f, 0.270598f, 0.923880f },
- { -0.382683f, -0.000000f, 0.923880f },
- { -0.270598f, -0.270598f, 0.923880f },
- { 0.000000f, -0.382683f, 0.923880f },
- { 0.270598f, -0.270598f, 0.923880f },
- { 0.195090f, 0.000000f, 0.980785f },
- { -0.000000f, 0.195090f, 0.980785f },
- { -0.195090f, -0.000000f, 0.980785f },
- { 0.000000f, -0.195090f, 0.980785f }
-};
-
-#endif // !! MDC_NORMAL_TABLE_INCLUDED
diff --git a/3rdparty/assimp/code/MDLDefaultColorMap.h b/3rdparty/assimp/code/MDLDefaultColorMap.h
deleted file mode 100644
index a40da826..00000000
--- a/3rdparty/assimp/code/MDLDefaultColorMap.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-
-/** @file Defines the default color map used for Quake 1 model textures
- *
- * The lib tries to load colormap.lmp from the model's directory.
- * This table is only used when required.
- */
-
-#ifndef AI_MDL_DEFAULTLMP_H_INC
-#define AI_MDL_DEFAULTLMP_H_INC
-
-const unsigned char g_aclrDefaultColorMap[256][3] = {
-{ 0, 0, 0}, { 15, 15, 15}, { 31, 31, 31}, { 47, 47, 47},
-{ 63, 63, 63}, { 75, 75, 75}, { 91, 91, 91}, {107, 107, 107},
-{123, 123, 123}, {139, 139, 139}, {155, 155, 155}, {171, 171, 171},
-{187, 187, 187}, {203, 203, 203}, {219, 219, 219}, {235, 235, 235},
-{ 15, 11, 7}, { 23, 15, 11}, { 31, 23, 11}, { 39, 27, 15},
-{ 47, 35, 19}, { 55, 43, 23}, { 63, 47, 23}, { 75, 55, 27},
-{ 83, 59, 27}, { 91, 67, 31}, { 99, 75, 31}, {107, 83, 31},
-{115, 87, 31}, {123, 95, 35}, {131, 103, 35}, {143, 111, 35},
-{ 11, 11, 15}, { 19, 19, 27}, { 27, 27, 39}, { 39, 39, 51},
-{ 47, 47, 63}, { 55, 55, 75}, { 63, 63, 87}, { 71, 71, 103},
-{ 79, 79, 115}, { 91, 91, 127}, { 99, 99, 139}, {107, 107, 151},
-{115, 115, 163}, {123, 123, 175}, {131, 131, 187}, {139, 139, 203},
-{ 0, 0, 0}, { 7, 7, 0}, { 11, 11, 0}, { 19, 19, 0},
-{ 27, 27, 0}, { 35, 35, 0}, { 43, 43, 7}, { 47, 47, 7},
-{ 55, 55, 7}, { 63, 63, 7}, { 71, 71, 7}, { 75, 75, 11},
-{ 83, 83, 11}, { 91, 91, 11}, { 99, 99, 11}, {107, 107, 15},
-{ 7, 0, 0}, { 15, 0, 0}, { 23, 0, 0}, { 31, 0, 0},
-{ 39, 0, 0}, { 47, 0, 0}, { 55, 0, 0}, { 63, 0, 0},
-{ 71, 0, 0}, { 79, 0, 0}, { 87, 0, 0}, { 95, 0, 0},
-{103, 0, 0}, {111, 0, 0}, {119, 0, 0}, {127, 0, 0},
-{ 19, 19, 0}, { 27, 27, 0}, { 35, 35, 0}, { 47, 43, 0},
-{ 55, 47, 0}, { 67, 55, 0}, { 75, 59, 7}, { 87, 67, 7},
-{ 95, 71, 7}, {107, 75, 11}, {119, 83, 15}, {131, 87, 19},
-{139, 91, 19}, {151, 95, 27}, {163, 99, 31}, {175, 103, 35},
-{ 35, 19, 7}, { 47, 23, 11}, { 59, 31, 15}, { 75, 35, 19},
-{ 87, 43, 23}, { 99, 47, 31}, {115, 55, 35}, {127, 59, 43},
-{143, 67, 51}, {159, 79, 51}, {175, 99, 47}, {191, 119, 47},
-{207, 143, 43}, {223, 171, 39}, {239, 203, 31}, {255, 243, 27},
-{ 11, 7, 0}, { 27, 19, 0}, { 43, 35, 15}, { 55, 43, 19},
-{ 71, 51, 27}, { 83, 55, 35}, { 99, 63, 43}, {111, 71, 51},
-{127, 83, 63}, {139, 95, 71}, {155, 107, 83}, {167, 123, 95},
-{183, 135, 107}, {195, 147, 123}, {211, 163, 139}, {227, 179, 151},
-{171, 139, 163}, {159, 127, 151}, {147, 115, 135}, {139, 103, 123},
-{127, 91, 111}, {119, 83, 99}, {107, 75, 87}, { 95, 63, 75},
-{ 87, 55, 67}, { 75, 47, 55}, { 67, 39, 47}, { 55, 31, 35},
-{ 43, 23, 27}, { 35, 19, 19}, { 23, 11, 11}, { 15, 7, 7},
-{187, 115, 159}, {175, 107, 143}, {163, 95, 131}, {151, 87, 119},
-{139, 79, 107}, {127, 75, 95}, {115, 67, 83}, {107, 59, 75},
-{ 95, 51, 63}, { 83, 43, 55}, { 71, 35, 43}, { 59, 31, 35},
-{ 47, 23, 27}, { 35, 19, 19}, { 23, 11, 11}, { 15, 7, 7},
-{219, 195, 187}, {203, 179, 167}, {191, 163, 155}, {175, 151, 139},
-{163, 135, 123}, {151, 123, 111}, {135, 111, 95}, {123, 99, 83},
-{107, 87, 71}, { 95, 75, 59}, { 83, 63, 51}, { 67, 51, 39},
-{ 55, 43, 31}, { 39, 31, 23}, { 27, 19, 15}, { 15, 11, 7},
-{111, 131, 123}, {103, 123, 111}, { 95, 115, 103}, { 87, 107, 95},
-{ 79, 99, 87}, { 71, 91, 79}, { 63, 83, 71}, { 55, 75, 63},
-{ 47, 67, 55}, { 43, 59, 47}, { 35, 51, 39}, { 31, 43, 31},
-{ 23, 35, 23}, { 15, 27, 19}, { 11, 19, 11}, { 7, 11, 7},
-{255, 243, 27}, {239, 223, 23}, {219, 203, 19}, {203, 183, 15},
-{187, 167, 15}, {171, 151, 11}, {155, 131, 7}, {139, 115, 7},
-{123, 99, 7}, {107, 83, 0}, { 91, 71, 0}, { 75, 55, 0},
-{ 59, 43, 0}, { 43, 31, 0}, { 27, 15, 0}, { 11, 7, 0},
-{ 0, 0, 255}, { 11, 11, 239}, { 19, 19, 223}, { 27, 27, 207},
-{ 35, 35, 191}, { 43, 43, 175}, { 47, 47, 159}, { 47, 47, 143},
-{ 47, 47, 127}, { 47, 47, 111}, { 47, 47, 95}, { 43, 43, 79},
-{ 35, 35, 63}, { 27, 27, 47}, { 19, 19, 31}, { 11, 11, 15},
-{ 43, 0, 0}, { 59, 0, 0}, { 75, 7, 0}, { 95, 7, 0},
-{111, 15, 0}, {127, 23, 7}, {147, 31, 7}, {163, 39, 11},
-{183, 51, 15}, {195, 75, 27}, {207, 99, 43}, {219, 127, 59},
-{227, 151, 79}, {231, 171, 95}, {239, 191, 119}, {247, 211, 139},
-{167, 123, 59}, {183, 155, 55}, {199, 195, 55}, {231, 227, 87},
-{127, 191, 255}, {171, 231, 255}, {215, 255, 255}, {103, 0, 0},
-{139, 0, 0}, {179, 0, 0}, {215, 0, 0}, {255, 0, 0},
-{255, 243, 147}, {255, 247, 199}, {255, 255, 255}, {159, 91, 83} };
-
-
-#endif // !! AI_MDL_DEFAULTLMP_H_INC
diff --git a/3rdparty/assimp/code/MDLFileData.h b/3rdparty/assimp/code/MDLFileData.h
deleted file mode 100644
index b1791d4b..00000000
--- a/3rdparty/assimp/code/MDLFileData.h
+++ /dev/null
@@ -1,959 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-
-/**
- * @file MDLFileData.h
- * @brief Definition of in-memory structures for the MDL file format.
- *
- * The specification has been taken from various sources on the internet.
- * - http://tfc.duke.free.fr/coding/mdl-specs-en.html
- * - Conitec's MED SDK
- * - Many quite long HEX-editor sessions
- */
-
-#ifndef AI_MDLFILEHELPER_H_INC
-#define AI_MDLFILEHELPER_H_INC
-
-#include "./../include/Compiler/pushpack1.h"
-
-namespace Assimp {
-namespace MDL {
-
-// -------------------------------------------------------------------------------------
-// to make it easier for us, we test the magic word against both "endianesses"
-
-// magic bytes used in Quake 1 MDL meshes
-#define AI_MDL_MAGIC_NUMBER_BE AI_MAKE_MAGIC("IDPO")
-#define AI_MDL_MAGIC_NUMBER_LE AI_MAKE_MAGIC("OPDI")
-
-// magic bytes used in GameStudio A<very low> MDL meshes
-#define AI_MDL_MAGIC_NUMBER_BE_GS3 AI_MAKE_MAGIC("MDL2")
-#define AI_MDL_MAGIC_NUMBER_LE_GS3 AI_MAKE_MAGIC("2LDM")
-
-// magic bytes used in GameStudio A4 MDL meshes
-#define AI_MDL_MAGIC_NUMBER_BE_GS4 AI_MAKE_MAGIC("MDL3")
-#define AI_MDL_MAGIC_NUMBER_LE_GS4 AI_MAKE_MAGIC("3LDM")
-
-// magic bytes used in GameStudio A5+ MDL meshes
-#define AI_MDL_MAGIC_NUMBER_BE_GS5a AI_MAKE_MAGIC("MDL4")
-#define AI_MDL_MAGIC_NUMBER_LE_GS5a AI_MAKE_MAGIC("4LDM")
-#define AI_MDL_MAGIC_NUMBER_BE_GS5b AI_MAKE_MAGIC("MDL5")
-#define AI_MDL_MAGIC_NUMBER_LE_GS5b AI_MAKE_MAGIC("5LDM")
-
-// magic bytes used in GameStudio A7+ MDL meshes
-#define AI_MDL_MAGIC_NUMBER_BE_GS7 AI_MAKE_MAGIC("MDL7")
-#define AI_MDL_MAGIC_NUMBER_LE_GS7 AI_MAKE_MAGIC("7LDM")
-
-
-// common limitations for Quake1 meshes. The loader does not check them,
-// (however it warns) but models should not exceed these limits.
-#if (!defined AI_MDL_VERSION)
-# define AI_MDL_VERSION 6
-#endif
-#if (!defined AI_MDL_MAX_FRAMES)
-# define AI_MDL_MAX_FRAMES 256
-#endif
-#if (!defined AI_MDL_MAX_UVS)
-# define AI_MDL_MAX_UVS 1024
-#endif
-#if (!defined AI_MDL_MAX_VERTS)
-# define AI_MDL_MAX_VERTS 1024
-#endif
-#if (!defined AI_MDL_MAX_TRIANGLES)
-# define AI_MDL_MAX_TRIANGLES 2048
-#endif
-
-// material key that is set for dummy materials that are
-// just referencing another material
-#if (!defined AI_MDL7_REFERRER_MATERIAL)
-# define AI_MDL7_REFERRER_MATERIAL "&&&referrer&&&",0,0
-#endif
-
-// -------------------------------------------------------------------------------------
-/** \struct Header
- * \brief Data structure for the MDL main header
- */
-struct Header
-{
- //! magic number: "IDPO"
- uint32_t ident;
-
- //! version number: 6
- int32_t version;
-
- //! scale factors for each axis
- aiVector3D scale;
-
- //! translation factors for each axis
- aiVector3D translate;
-
- //! bounding radius of the mesh
- float boundingradius;
-
- //! Position of the viewer's exe. Ignored
- aiVector3D vEyePos;
-
- //! Number of textures
- int32_t num_skins;
-
- //! Texture width in pixels
- int32_t skinwidth;
-
- //! Texture height in pixels
- int32_t skinheight;
-
- //! Number of vertices contained in the file
- int32_t num_verts;
-
- //! Number of triangles contained in the file
- int32_t num_tris;
-
- //! Number of frames contained in the file
- int32_t num_frames;
-
- //! 0 = synchron, 1 = random . Ignored
- //! (MDLn formats: number of texture coordinates)
- int32_t synctype;
-
- //! State flag
- int32_t flags;
-
- //! Could be the total size of the file (and not a float)
- float size;
-} PACK_STRUCT;
-
-
-// -------------------------------------------------------------------------------------
-/** \struct Header_MDL7
- * \brief Data structure for the MDL 7 main header
- */
-struct Header_MDL7
-{
- //! magic number: "MDL7"
- char ident[4];
-
- //! Version number. Ignored
- int32_t version;
-
- //! Number of bones in file
- uint32_t bones_num;
-
- //! Number of groups in file
- uint32_t groups_num;
-
- //! Size of data in the file
- uint32_t data_size;
-
- //! Ignored. Used to store entity specific information
- int32_t entlump_size;
-
- //! Ignored. Used to store MED related data
- int32_t medlump_size;
-
- //! Size of the Bone_MDL7 data structure used in the file
- uint16_t bone_stc_size;
-
- //! Size of the Skin_MDL 7 data structure used in the file
- uint16_t skin_stc_size;
-
- //! Size of a single color (e.g. in a material)
- uint16_t colorvalue_stc_size;
-
- //! Size of the Material_MDL7 data structure used in the file
- uint16_t material_stc_size;
-
- //! Size of a texture coordinate set in the file
- uint16_t skinpoint_stc_size;
-
- //! Size of a triangle in the file
- uint16_t triangle_stc_size;
-
- //! Size of a normal vertex in the file
- uint16_t mainvertex_stc_size;
-
- //! Size of a per-frame animated vertex in the file
- //! (this is not supported)
- uint16_t framevertex_stc_size;
-
- //! Size of a bone animation matrix
- uint16_t bonetrans_stc_size;
-
- //! Size of the Frame_MDL7 data structure used in the file
- uint16_t frame_stc_size;
-} PACK_STRUCT;
-
-
-// -------------------------------------------------------------------------------------
-/** \struct Bone_MDL7
- * \brief Data structure for a bone in a MDL7 file
- */
-struct Bone_MDL7
-{
- //! Index of the parent bone of *this* bone. 0xffff means:
- //! "hey, I have no parent, I'm an orphan"
- uint16_t parent_index;
- uint8_t _unused_[2];
-
- //! Relative position of the bone (relative to the
- //! parent bone)
- float x,y,z;
-
- //! Optional name of the bone
- char name[1 /* DUMMY SIZE */];
-} PACK_STRUCT;
-
-#if (!defined AI_MDL7_BONE_STRUCT_SIZE__NAME_IS_20_CHARS)
-# define AI_MDL7_BONE_STRUCT_SIZE__NAME_IS_20_CHARS (16 + 20)
-#endif
-
-#if (!defined AI_MDL7_BONE_STRUCT_SIZE__NAME_IS_32_CHARS)
-# define AI_MDL7_BONE_STRUCT_SIZE__NAME_IS_32_CHARS (16 + 32)
-#endif
-
-#if (!defined AI_MDL7_BONE_STRUCT_SIZE__NAME_IS_NOT_THERE)
-# define AI_MDL7_BONE_STRUCT_SIZE__NAME_IS_NOT_THERE (16)
-#endif
-
-#if (!defined AI_MDL7_MAX_GROUPNAMESIZE)
-# define AI_MDL7_MAX_GROUPNAMESIZE 16
-#endif // ! AI_MDL7_MAX_GROUPNAMESIZE
-
-// -------------------------------------------------------------------------------------
-/** \struct Group_MDL7
- * \brief Group in a MDL7 file
- */
-struct Group_MDL7
-{
- //! = '1' -> triangle based Mesh
- unsigned char typ;
-
- int8_t deformers;
- int8_t max_weights;
- int8_t _unused_;
-
- //! size of data for this group in bytes ( MD7_GROUP stc. included).
- int32_t groupdata_size;
- char name[AI_MDL7_MAX_GROUPNAMESIZE];
-
- //! Number of skins
- int32_t numskins;
-
- //! Number of texture coordinates
- int32_t num_stpts;
-
- //! Number of triangles
- int32_t numtris;
-
- //! Number of vertices
- int32_t numverts;
-
- //! Number of frames
- int32_t numframes;
-} PACK_STRUCT;
-
-#define AI_MDL7_SKINTYPE_MIPFLAG 0x08
-#define AI_MDL7_SKINTYPE_MATERIAL 0x10
-#define AI_MDL7_SKINTYPE_MATERIAL_ASCDEF 0x20
-#define AI_MDL7_SKINTYPE_RGBFLAG 0x80
-
-#if (!defined AI_MDL7_MAX_BONENAMESIZE)
-# define AI_MDL7_MAX_BONENAMESIZE 20
-#endif // !! AI_MDL7_MAX_BONENAMESIZE
-
-// -------------------------------------------------------------------------------------
-/** \struct Deformer_MDL7
- * \brief Deformer in a MDL7 file
- */
-struct Deformer_MDL7
-{
- int8_t deformer_version; // 0
- int8_t deformer_typ; // 0 - bones
- int8_t _unused_[2];
- int32_t group_index;
- int32_t elements;
- int32_t deformerdata_size;
-} PACK_STRUCT;
-
-
-// -------------------------------------------------------------------------------------
-/** \struct DeformerElement_MDL7
- * \brief Deformer element in a MDL7 file
- */
-struct DeformerElement_MDL7
-{
- //! bei deformer_typ==0 (==bones) element_index == bone index
- int32_t element_index;
- char element_name[AI_MDL7_MAX_BONENAMESIZE];
- int32_t weights;
-} PACK_STRUCT;
-
-
-// -------------------------------------------------------------------------------------
-/** \struct DeformerWeight_MDL7
- * \brief Deformer weight in a MDL7 file
- */
-struct DeformerWeight_MDL7
-{
- //! for deformer_typ==0 (==bones) index == vertex index
- int32_t index;
- float weight;
-} PACK_STRUCT;
-
-
-// don't know why this was in the original headers ...
-typedef int32_t MD7_MATERIAL_ASCDEFSIZE;
-
-// -------------------------------------------------------------------------------------
-/** \struct ColorValue_MDL7
- * \brief Data structure for a color value in a MDL7 file
- */
-struct ColorValue_MDL7
-{
- float r,g,b,a;
-} PACK_STRUCT;
-
-// -------------------------------------------------------------------------------------
-/** \struct Material_MDL7
- * \brief Data structure for a Material in a MDL7 file
- */
-struct Material_MDL7
-{
- //! Diffuse base color of the material
- ColorValue_MDL7 Diffuse;
-
- //! Ambient base color of the material
- ColorValue_MDL7 Ambient;
-
- //! Specular base color of the material
- ColorValue_MDL7 Specular;
-
- //! Emissive base color of the material
- ColorValue_MDL7 Emissive;
-
- //! Phong power
- float Power;
-} PACK_STRUCT;
-
-
-// -------------------------------------------------------------------------------------
-/** \struct Skin
- * \brief Skin data structure #1 - used by Quake1, MDL2, MDL3 and MDL4
- */
-struct Skin
-{
- //! 0 = single (Skin), 1 = group (GroupSkin)
- //! For MDL3-5: Defines the type of the skin and there
- //! fore the size of the data to skip:
- //-------------------------------------------------------
- //! 2 for 565 RGB,
- //! 3 for 4444 ARGB,
- //! 10 for 565 mipmapped,
- //! 11 for 4444 mipmapped (bpp = 2),
- //! 12 for 888 RGB mipmapped (bpp = 3),
- //! 13 for 8888 ARGB mipmapped (bpp = 4)
- //-------------------------------------------------------
- int32_t group;
-
- //! Texture data
- uint8_t *data;
-} PACK_STRUCT;
-
-
-// -------------------------------------------------------------------------------------
-/** \struct Skin
- * \brief Skin data structure #2 - used by MDL5, MDL6 and MDL7
- * \see Skin
- */
-struct Skin_MDL5
-{
- int32_t size, width, height;
- uint8_t *data;
-} PACK_STRUCT;
-
-// maximum length of texture file name
-#if (!defined AI_MDL7_MAX_TEXNAMESIZE)
-# define AI_MDL7_MAX_TEXNAMESIZE 0x10
-#endif
-
-// ---------------------------------------------------------------------------
-/** \struct Skin_MDL7
- * \brief Skin data structure #3 - used by MDL7 and HMP7
- */
-struct Skin_MDL7
-{
- uint8_t typ;
- int8_t _unused_[3];
- int32_t width;
- int32_t height;
- char texture_name[AI_MDL7_MAX_TEXNAMESIZE];
-} PACK_STRUCT;
-
-// -------------------------------------------------------------------------------------
-/** \struct RGB565
- * \brief Data structure for a RGB565 pixel in a texture
- */
-struct RGB565
-{
- uint16_t r : 5;
- uint16_t g : 6;
- uint16_t b : 5;
-} PACK_STRUCT;
-
-// -------------------------------------------------------------------------------------
-/** \struct ARGB4
- * \brief Data structure for a ARGB4444 pixel in a texture
- */
-struct ARGB4
-{
- uint16_t a : 4;
- uint16_t r : 4;
- uint16_t g : 4;
- uint16_t b : 4;
-} PACK_STRUCT;
-
-// -------------------------------------------------------------------------------------
-/** \struct GroupSkin
- * \brief Skin data structure #2 (group of pictures)
- */
-struct GroupSkin
-{
- //! 0 = single (Skin), 1 = group (GroupSkin)
- int32_t group;
-
- //! Number of images
- int32_t nb;
-
- //! Time for each image
- float *time;
-
- //! Data of each image
- uint8_t **data;
-} PACK_STRUCT;
-
-// -------------------------------------------------------------------------------------
-/** \struct TexCoord
- * \brief Texture coordinate data structure used by the Quake1 MDL format
- */
-struct TexCoord
-{
- //! Is the vertex on the noundary between front and back piece?
- int32_t onseam;
-
- //! Texture coordinate in the tx direction
- int32_t s;
-
- //! Texture coordinate in the ty direction
- int32_t t;
-} PACK_STRUCT;
-
-// -------------------------------------------------------------------------------------
-/** \struct TexCoord_MDL3
- * \brief Data structure for an UV coordinate in the 3DGS MDL3 format
- */
-struct TexCoord_MDL3
-{
- //! position, horizontally in range 0..skinwidth-1
- int16_t u;
-
- //! position, vertically in range 0..skinheight-1
- int16_t v;
-} PACK_STRUCT;
-
-// -------------------------------------------------------------------------------------
-/** \struct TexCoord_MDL7
- * \brief Data structure for an UV coordinate in the 3DGS MDL7 format
- */
-struct TexCoord_MDL7
-{
- //! position, horizontally in range 0..1
- float u;
-
- //! position, vertically in range 0..1
- float v;
-} PACK_STRUCT;
-
-// -------------------------------------------------------------------------------------
-/** \struct SkinSet_MDL7
- * \brief Skin set data structure for the 3DGS MDL7 format
- * MDL7 references UV coordinates per face via an index list.
- * This allows the use of multiple skins per face with just one
- * UV coordinate set.
- */
-struct SkinSet_MDL7
-{
- //! Index into the UV coordinate list
- uint16_t st_index[3]; // size 6
-
- //! Material index
- int32_t material; // size 4
-} PACK_STRUCT;
-
-// -------------------------------------------------------------------------------------
-/** \struct Triangle
- * \brief Triangle data structure for the Quake1 MDL format
- */
-struct Triangle
-{
- //! 0 = backface, 1 = frontface
- int32_t facesfront;
-
- //! Vertex indices
- int32_t vertex[3];
-} PACK_STRUCT;
-
-// -------------------------------------------------------------------------------------
-/** \struct Triangle_MDL3
- * \brief Triangle data structure for the 3DGS MDL3 format
- */
-struct Triangle_MDL3
-{
- //! Index of 3 3D vertices in range 0..numverts
- uint16_t index_xyz[3];
-
- //! Index of 3 skin vertices in range 0..numskinverts
- uint16_t index_uv[3];
-} PACK_STRUCT;
-
-// -------------------------------------------------------------------------------------
-/** \struct Triangle_MDL7
- * \brief Triangle data structure for the 3DGS MDL7 format
- */
-struct Triangle_MDL7
-{
- //! Vertex indices
- uint16_t v_index[3]; // size 6
-
- //! Two skinsets. The second will be used for multi-texturing
- SkinSet_MDL7 skinsets[2];
-} PACK_STRUCT;
-
-#if (!defined AI_MDL7_TRIANGLE_STD_SIZE_ONE_UV)
-# define AI_MDL7_TRIANGLE_STD_SIZE_ONE_UV (6+sizeof(SkinSet_MDL7)-sizeof(uint32_t))
-#endif
-#if (!defined AI_MDL7_TRIANGLE_STD_SIZE_ONE_UV_WITH_MATINDEX)
-# define AI_MDL7_TRIANGLE_STD_SIZE_ONE_UV_WITH_MATINDEX (6+sizeof(SkinSet_MDL7))
-#endif
-#if (!defined AI_MDL7_TRIANGLE_STD_SIZE_TWO_UV)
-# define AI_MDL7_TRIANGLE_STD_SIZE_TWO_UV (6+2*sizeof(SkinSet_MDL7))
-#endif
-
-// Helper constants for Triangle::facesfront
-#if (!defined AI_MDL_BACKFACE)
-# define AI_MDL_BACKFACE 0x0
-#endif
-#if (!defined AI_MDL_FRONTFACE)
-# define AI_MDL_FRONTFACE 0x1
-#endif
-
-// -------------------------------------------------------------------------------------
-/** \struct Vertex
- * \brief Vertex data structure
- */
-struct Vertex
-{
- uint8_t v[3];
- uint8_t normalIndex;
-} PACK_STRUCT;
-
-
-// -------------------------------------------------------------------------------------
-struct Vertex_MDL4
-{
- uint16_t v[3];
- uint8_t normalIndex;
- uint8_t unused;
-} PACK_STRUCT;
-
-#define AI_MDL7_FRAMEVERTEX120503_STCSIZE 16
-#define AI_MDL7_FRAMEVERTEX030305_STCSIZE 26
-
-// -------------------------------------------------------------------------------------
-/** \struct Vertex_MDL7
- * \brief Vertex data structure used in MDL7 files
- */
-struct Vertex_MDL7
-{
- float x,y,z;
- uint16_t vertindex; // = bone index
- union {
- uint8_t norm162index;
- float norm[3];
- };
-} PACK_STRUCT;
-
-
-// -------------------------------------------------------------------------------------
-/** \struct BoneTransform_MDL7
- * \brief bone transformation matrix structure used in MDL7 files
- */
-struct BoneTransform_MDL7
-{
- //! 4*3
- float m [4*4];
-
- //! the index of this vertex, 0.. header::bones_num - 1
- uint16_t bone_index;
-
- //! I HATE 3DGS AND THE SILLY DEVELOPER WHO DESIGNED
- //! THIS STUPID FILE FORMAT!
- int8_t _unused_[2];
-} PACK_STRUCT;
-
-
-#define AI_MDL7_MAX_FRAMENAMESIZE 16
-
-
-// -------------------------------------------------------------------------------------
-/** \struct Frame_MDL7
- * \brief Frame data structure used by MDL7 files
- */
-struct Frame_MDL7
-{
- char frame_name[AI_MDL7_MAX_FRAMENAMESIZE];
- uint32_t vertices_count;
- uint32_t transmatrix_count;
-};
-
-
-// -------------------------------------------------------------------------------------
-/** \struct SimpleFrame
- * \brief Data structure for a simple frame
- */
-struct SimpleFrame
-{
- //! Minimum vertex of the bounding box
- Vertex bboxmin;
-
- //! Maximum vertex of the bounding box
- Vertex bboxmax;
-
- //! Name of the frame
- char name[16];
-
- //! Vertex list of the frame
- Vertex *verts;
-} PACK_STRUCT;
-
-// -------------------------------------------------------------------------------------
-/** \struct Frame
- * \brief Model frame data structure
- */
-struct Frame
-{
- //! 0 = simple frame, !0 = group frame
- int32_t type;
-
- //! Frame data
- SimpleFrame frame;
-} PACK_STRUCT;
-
-
-// -------------------------------------------------------------------------------------
-struct SimpleFrame_MDLn_SP
-{
- //! Minimum vertex of the bounding box
- Vertex_MDL4 bboxmin;
-
- //! Maximum vertex of the bounding box
- Vertex_MDL4 bboxmax;
-
- //! Name of the frame
- char name[16];
-
- //! Vertex list of the frame
- Vertex_MDL4 *verts;
-} PACK_STRUCT;
-
-// -------------------------------------------------------------------------------------
-/** \struct GroupFrame
- * \brief Data structure for a group of frames
- */
-struct GroupFrame
-{
- //! 0 = simple frame, !0 = group frame
- int32_t type;
-
- //! Minimum vertex for all single frames
- Vertex min;
-
- //! Maximum vertex for all single frames
- Vertex max;
-
- //! Time for all single frames
- float *time;
-
- //! List of single frames
- SimpleFrame *frames;
-} PACK_STRUCT;
-
-#include "./../include/Compiler/poppack1.h"
-
-// -------------------------------------------------------------------------------------
-/** \struct IntFace_MDL7
- * \brief Internal data structure to temporarily represent a face
- */
-struct IntFace_MDL7
-{
- // provide a constructor for our own convenience
- IntFace_MDL7()
- {
- // set everything to zero
- mIndices[0] = mIndices[1] = mIndices[2] = 0;
- iMatIndex[0] = iMatIndex[1] = 0;
- }
-
- //! Vertex indices
- uint32_t mIndices[3];
-
- //! Material index (maximally two channels, which are joined later)
- unsigned int iMatIndex[2];
-};
-
-// -------------------------------------------------------------------------------------
-/** \struct IntMaterial_MDL7
- * \brief Internal data structure to temporarily represent a material
- * which has been created from two single materials along with the
- * original material indices.
- */
-struct IntMaterial_MDL7
-{
- // provide a constructor for our own convenience
- IntMaterial_MDL7()
- {
- pcMat = NULL;
- iOldMatIndices[0] = iOldMatIndices[1] = 0;
- }
-
- //! Material instance
- MaterialHelper* pcMat;
-
- //! Old material indices
- unsigned int iOldMatIndices[2];
-};
-
-// -------------------------------------------------------------------------------------
-/** \struct IntBone_MDL7
- * \brief Internal data structure to represent a bone in a MDL7 file with
- * all of its animation channels assigned to it.
- */
-struct IntBone_MDL7 : aiBone
-{
- //! Default constructor
- IntBone_MDL7() : iParent (0xffff)
- {
- pkeyPositions.reserve(30);
- pkeyScalings.reserve(30);
- pkeyRotations.reserve(30);
- }
-
- //! Parent bone of the bone
- uint64_t iParent;
-
- //! Relative position of the bone
- aiVector3D vPosition;
-
- //! Array of position keys
- std::vector<aiVectorKey> pkeyPositions;
-
- //! Array of scaling keys
- std::vector<aiVectorKey> pkeyScalings;
-
- //! Array of rotation keys
- std::vector<aiQuatKey> pkeyRotations;
-};
-
-// -------------------------------------------------------------------------------------
-//! Describes a MDL7 frame
-struct IntFrameInfo_MDL7
-{
- //! Construction from an existing frame header
- IntFrameInfo_MDL7(BE_NCONST MDL::Frame_MDL7* _pcFrame,unsigned int _iIndex)
- : iIndex(_iIndex)
- , pcFrame(_pcFrame)
- {}
-
- //! Index of the frame
- unsigned int iIndex;
-
- //! Points to the header of the frame
- BE_NCONST MDL::Frame_MDL7* pcFrame;
-};
-
-// -------------------------------------------------------------------------------------
-//! Describes a MDL7 mesh group
-struct IntGroupInfo_MDL7
-{
- //! Default constructor
- IntGroupInfo_MDL7()
- : iIndex(0)
- , pcGroup(NULL)
- , pcGroupUVs(NULL)
- , pcGroupTris(NULL)
- , pcGroupVerts(NULL)
- {}
-
- //! Construction from an existing group header
- IntGroupInfo_MDL7(BE_NCONST MDL::Group_MDL7* _pcGroup, unsigned int _iIndex)
- : iIndex(_iIndex)
- , pcGroup(_pcGroup)
- {}
-
- //! Index of the group
- unsigned int iIndex;
-
- //! Points to the header of the group
- BE_NCONST MDL::Group_MDL7* pcGroup;
-
- //! Points to the beginning of the uv coordinate section
- BE_NCONST MDL::TexCoord_MDL7* pcGroupUVs;
-
- //! Points to the beginning of the triangle section
- BE_NCONST MDL::Triangle_MDL7* pcGroupTris;
-
- //! Points to the beginning of the vertex section
- BE_NCONST MDL::Vertex_MDL7* pcGroupVerts;
-};
-
-// -------------------------------------------------------------------------------------
-//! Holds the data that belongs to a MDL7 mesh group
-struct IntGroupData_MDL7
-{
- IntGroupData_MDL7()
- : pcFaces(NULL), bNeed2UV(false)
- {}
-
- //! Array of faces that belong to the group
- MDL::IntFace_MDL7* pcFaces;
-
- //! Array of vertex positions
- std::vector<aiVector3D> vPositions;
-
- //! Array of vertex normals
- std::vector<aiVector3D> vNormals;
-
- //! Array of bones indices
- std::vector<unsigned int> aiBones;
-
- //! First UV coordinate set
- std::vector<aiVector3D> vTextureCoords1;
-
- //! Optional second UV coordinate set
- std::vector<aiVector3D> vTextureCoords2;
-
- //! Specifies whether there are two texture
- //! coordinate sets required
- bool bNeed2UV;
-};
-
-// -------------------------------------------------------------------------------------
-//! Holds data from an MDL7 file that is shared by all mesh groups
-struct IntSharedData_MDL7
-{
- //! Default constructor
- IntSharedData_MDL7()
- {
- abNeedMaterials.reserve(10);
- }
-
- //! Destruction: properly delete all allocated resources
- ~IntSharedData_MDL7()
- {
- // kill all bones
- if (this->apcOutBones)
- {
- for (unsigned int m = 0; m < iNum;++m)
- delete this->apcOutBones[m];
- delete[] this->apcOutBones;
- }
- }
-
- //! Specifies which materials are used
- std::vector<bool> abNeedMaterials;
-
- //! List of all materials
- std::vector<MaterialHelper*> pcMats;
-
- //! List of all bones
- IntBone_MDL7** apcOutBones;
-
- //! number of bones
- unsigned int iNum;
-};
-
-// -------------------------------------------------------------------------------------
-//! Contains input data for GenerateOutputMeshes_3DGS_MDL7
-struct IntSplittedGroupData_MDL7
-{
- //! Construction from a given shared data set
- IntSplittedGroupData_MDL7(IntSharedData_MDL7& _shared,
- std::vector<aiMesh*>& _avOutList)
-
- : shared(_shared), avOutList(_avOutList)
- {
- }
-
- //! Destruction: properly delete all allocated resources
- ~IntSplittedGroupData_MDL7()
- {
- // kill all face lists
- if (this->aiSplit)
- {
- for (unsigned int m = 0; m < shared.pcMats.size();++m)
- delete this->aiSplit[m];
- delete[] this->aiSplit;
- }
- }
-
- //! Contains a list of all faces per material
- std::vector<unsigned int>** aiSplit;
-
- //! Shared data for all groups of the model
- IntSharedData_MDL7& shared;
-
- //! List of meshes
- std::vector<aiMesh*>& avOutList;
-};
-
-
-}
-} // end namespaces
-
-#endif // !! AI_MDLFILEHELPER_H_INC
diff --git a/3rdparty/assimp/code/MDLLoader.cpp b/3rdparty/assimp/code/MDLLoader.cpp
deleted file mode 100644
index 775e04c3..00000000
--- a/3rdparty/assimp/code/MDLLoader.cpp
+++ /dev/null
@@ -1,1929 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file MDLLoader.cpp
- * @brief Implementation of the main parts of the MDL importer class
- * *TODO* Cleanup and further testing of some parts necessary
- */
-
-// internal headers
-#include "AssimpPCH.h"
-#ifndef ASSIMP_BUILD_NO_MDL_IMPORTER
-
-#include "MDLLoader.h"
-#include "MDLDefaultColorMap.h"
-#include "MD2FileData.h"
-
-using namespace Assimp;
-
-// ------------------------------------------------------------------------------------------------
-// Ugly stuff ... nevermind
-#define _AI_MDL7_ACCESS(_data, _index, _limit, _type) \
- (*((const _type*)(((const char*)_data) + _index * _limit)))
-
-#define _AI_MDL7_ACCESS_PTR(_data, _index, _limit, _type) \
- ((BE_NCONST _type*)(((const char*)_data) + _index * _limit))
-
-#define _AI_MDL7_ACCESS_VERT(_data, _index, _limit) \
- _AI_MDL7_ACCESS(_data,_index,_limit,MDL::Vertex_MDL7)
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-MDLImporter::MDLImporter()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-MDLImporter::~MDLImporter()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the class can handle the format of the given file.
-bool MDLImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const
-{
- const std::string extension = GetExtension(pFile);
-
- // if check for extension is not enough, check for the magic tokens
- if (extension == "mdl" || !extension.length() || checkSig) {
- uint32_t tokens[8];
- tokens[0] = AI_MDL_MAGIC_NUMBER_LE_HL2a;
- tokens[1] = AI_MDL_MAGIC_NUMBER_LE_HL2b;
- tokens[2] = AI_MDL_MAGIC_NUMBER_LE_GS7;
- tokens[3] = AI_MDL_MAGIC_NUMBER_LE_GS5b;
- tokens[4] = AI_MDL_MAGIC_NUMBER_LE_GS5a;
- tokens[5] = AI_MDL_MAGIC_NUMBER_LE_GS4;
- tokens[6] = AI_MDL_MAGIC_NUMBER_LE_GS3;
- tokens[7] = AI_MDL_MAGIC_NUMBER_LE;
- return CheckMagicToken(pIOHandler,pFile,tokens,8,0);
- }
- return false;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Setup configuration properties
-void MDLImporter::SetupProperties(const Importer* pImp)
-{
- configFrameID = pImp->GetPropertyInteger(AI_CONFIG_IMPORT_MDL_KEYFRAME,0xffffffff);
-
- // The
- // AI_CONFIG_IMPORT_MDL_KEYFRAME option overrides the
- // AI_CONFIG_IMPORT_GLOBAL_KEYFRAME option.
- if(0xffffffff == configFrameID) {
- configFrameID = pImp->GetPropertyInteger(AI_CONFIG_IMPORT_GLOBAL_KEYFRAME,0);
- }
-
- // AI_CONFIG_IMPORT_MDL_COLORMAP - pallette file
- configPalette = pImp->GetPropertyString(AI_CONFIG_IMPORT_MDL_COLORMAP,"colormap.lmp");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Get a list of all supported extensions
-void MDLImporter::GetExtensionList(std::set<std::string>& extensions)
-{
- extensions.insert( "mdl" );
-}
-
-// ------------------------------------------------------------------------------------------------
-// Imports the given file into the given scene structure.
-void MDLImporter::InternReadFile( const std::string& pFile,
- aiScene* _pScene, IOSystem* _pIOHandler)
-{
- pScene = _pScene;
- pIOHandler = _pIOHandler;
- boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile));
-
- // Check whether we can read from the file
- if( file.get() == NULL) {
- throw DeadlyImportError( "Failed to open MDL file " + pFile + ".");
- }
-
- // This should work for all other types of MDL files, too ...
- // the quake header is one of the smallest, afaik
- iFileSize = (unsigned int)file->FileSize();
- if( iFileSize < sizeof(MDL::Header)) {
- throw DeadlyImportError( "MDL File is too small.");
- }
-
- // Allocate storage and copy the contents of the file to a memory buffer
- std::vector<unsigned char> buffer(iFileSize+1);
- mBuffer = &buffer[0];
- file->Read( (void*)mBuffer, 1, iFileSize);
-
- // Append a binary zero to the end of the buffer.
- // this is just for safety that string parsing routines
- // find the end of the buffer ...
- mBuffer[iFileSize] = '\0';
- const uint32_t iMagicWord = *((uint32_t*)mBuffer);
-
- // Determine the file subtype and call the appropriate member function
-
- // Original Quake1 format
- if (AI_MDL_MAGIC_NUMBER_BE == iMagicWord || AI_MDL_MAGIC_NUMBER_LE == iMagicWord) {
- DefaultLogger::get()->debug("MDL subtype: Quake 1, magic word is IDPO");
- iGSFileVersion = 0;
- InternReadFile_Quake1();
- }
- // GameStudio A<old> MDL2 format - used by some test models that come with 3DGS
- else if (AI_MDL_MAGIC_NUMBER_BE_GS3 == iMagicWord || AI_MDL_MAGIC_NUMBER_LE_GS3 == iMagicWord) {
- DefaultLogger::get()->debug("MDL subtype: 3D GameStudio A2, magic word is MDL2");
- iGSFileVersion = 2;
- InternReadFile_Quake1();
- }
- // GameStudio A4 MDL3 format
- else if (AI_MDL_MAGIC_NUMBER_BE_GS4 == iMagicWord || AI_MDL_MAGIC_NUMBER_LE_GS4 == iMagicWord) {
- DefaultLogger::get()->debug("MDL subtype: 3D GameStudio A4, magic word is MDL3");
- iGSFileVersion = 3;
- InternReadFile_3DGS_MDL345();
- }
- // GameStudio A5+ MDL4 format
- else if (AI_MDL_MAGIC_NUMBER_BE_GS5a == iMagicWord || AI_MDL_MAGIC_NUMBER_LE_GS5a == iMagicWord) {
- DefaultLogger::get()->debug("MDL subtype: 3D GameStudio A4, magic word is MDL4");
- iGSFileVersion = 4;
- InternReadFile_3DGS_MDL345();
- }
- // GameStudio A5+ MDL5 format
- else if (AI_MDL_MAGIC_NUMBER_BE_GS5b == iMagicWord || AI_MDL_MAGIC_NUMBER_LE_GS5b == iMagicWord) {
- DefaultLogger::get()->debug("MDL subtype: 3D GameStudio A5, magic word is MDL5");
- iGSFileVersion = 5;
- InternReadFile_3DGS_MDL345();
- }
- // GameStudio A7 MDL7 format
- else if (AI_MDL_MAGIC_NUMBER_BE_GS7 == iMagicWord || AI_MDL_MAGIC_NUMBER_LE_GS7 == iMagicWord) {
- DefaultLogger::get()->debug("MDL subtype: 3D GameStudio A7, magic word is MDL7");
- iGSFileVersion = 7;
- InternReadFile_3DGS_MDL7();
- }
- // IDST/IDSQ Format (CS:S/HL², etc ...)
- else if (AI_MDL_MAGIC_NUMBER_BE_HL2a == iMagicWord || AI_MDL_MAGIC_NUMBER_LE_HL2a == iMagicWord ||
- AI_MDL_MAGIC_NUMBER_BE_HL2b == iMagicWord || AI_MDL_MAGIC_NUMBER_LE_HL2b == iMagicWord)
- {
- DefaultLogger::get()->debug("MDL subtype: Source(tm) Engine, magic word is IDST/IDSQ");
- iGSFileVersion = 0;
- InternReadFile_HL2();
- }
- else {
- // print the magic word to the log file
- throw DeadlyImportError( "Unknown MDL subformat " + pFile +
- ". Magic word (" + std::string((char*)&iMagicWord,4) + ") is not known");
- }
-
- // Now rotate the whole scene 90 degrees around the x axis to convert to internal coordinate system
- pScene->mRootNode->mTransformation = aiMatrix4x4(1.f,0.f,0.f,0.f,
- 0.f,0.f,1.f,0.f,0.f,-1.f,0.f,0.f,0.f,0.f,0.f,1.f);
-
- // delete the file buffer and cleanup
- AI_DEBUG_INVALIDATE_PTR(mBuffer);
- AI_DEBUG_INVALIDATE_PTR(pIOHandler);
- AI_DEBUG_INVALIDATE_PTR(pScene);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Check whether we're still inside the valid file range
-void MDLImporter::SizeCheck(const void* szPos)
-{
- if (!szPos || (const unsigned char*)szPos > this->mBuffer + this->iFileSize)
- {
- throw DeadlyImportError("Invalid MDL file. The file is too small "
- "or contains invalid data.");
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Just for debgging purposes
-void MDLImporter::SizeCheck(const void* szPos, const char* szFile, unsigned int iLine)
-{
- ai_assert(NULL != szFile);
- if (!szPos || (const unsigned char*)szPos > mBuffer + iFileSize)
- {
- // remove a directory if there is one
- const char* szFilePtr = ::strrchr(szFile,'\\');
- if (!szFilePtr) {
- if(!(szFilePtr = ::strrchr(szFile,'/')))
- szFilePtr = szFile;
- }
- if (szFilePtr)++szFilePtr;
-
- char szBuffer[1024];
- ::sprintf(szBuffer,"Invalid MDL file. The file is too small "
- "or contains invalid data (File: %s Line: %i)",szFilePtr,iLine);
-
- throw DeadlyImportError(szBuffer);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Validate a quake file header
-void MDLImporter::ValidateHeader_Quake1(const MDL::Header* pcHeader)
-{
- // some values may not be NULL
- if (!pcHeader->num_frames)
- throw DeadlyImportError( "[Quake 1 MDL] There are no frames in the file");
-
- if (!pcHeader->num_verts)
- throw DeadlyImportError( "[Quake 1 MDL] There are no vertices in the file");
-
- if (!pcHeader->num_tris)
- throw DeadlyImportError( "[Quake 1 MDL] There are no triangles in the file");
-
- // check whether the maxima are exceeded ...however, this applies for Quake 1 MDLs only
- if (!this->iGSFileVersion)
- {
- if (pcHeader->num_verts > AI_MDL_MAX_VERTS)
- DefaultLogger::get()->warn("Quake 1 MDL model has more than AI_MDL_MAX_VERTS vertices");
-
- if (pcHeader->num_tris > AI_MDL_MAX_TRIANGLES)
- DefaultLogger::get()->warn("Quake 1 MDL model has more than AI_MDL_MAX_TRIANGLES triangles");
-
- if (pcHeader->num_frames > AI_MDL_MAX_FRAMES)
- DefaultLogger::get()->warn("Quake 1 MDL model has more than AI_MDL_MAX_FRAMES frames");
-
- // (this does not apply for 3DGS MDLs)
- if (!this->iGSFileVersion && pcHeader->version != AI_MDL_VERSION)
- DefaultLogger::get()->warn("Quake 1 MDL model has an unknown version: AI_MDL_VERSION (=6) is "
- "the expected file format version");
- if(pcHeader->num_skins && (!pcHeader->skinwidth || !pcHeader->skinheight))
- DefaultLogger::get()->warn("Skin width or height are 0");
- }
-}
-
-#ifdef AI_BUILD_BIG_ENDIAN
-// ------------------------------------------------------------------------------------------------
-void FlipQuakeHeader(BE_NCONST MDL::Header* pcHeader)
-{
- AI_SWAP4( pcHeader->ident);
- AI_SWAP4( pcHeader->version);
- AI_SWAP4( pcHeader->boundingradius);
- AI_SWAP4( pcHeader->flags);
- AI_SWAP4( pcHeader->num_frames);
- AI_SWAP4( pcHeader->num_skins);
- AI_SWAP4( pcHeader->num_tris);
- AI_SWAP4( pcHeader->num_verts);
- for (unsigned int i = 0; i < 3;++i)
- {
- AI_SWAP4( pcHeader->scale[i]);
- AI_SWAP4( pcHeader->translate[i]);
- }
- AI_SWAP4( pcHeader->size);
- AI_SWAP4( pcHeader->skinheight);
- AI_SWAP4( pcHeader->skinwidth);
- AI_SWAP4( pcHeader->synctype);
-}
-#endif
-
-// ------------------------------------------------------------------------------------------------
-// Read a Quake 1 file
-void MDLImporter::InternReadFile_Quake1( )
-{
- ai_assert(NULL != pScene);
- BE_NCONST MDL::Header *pcHeader = (BE_NCONST MDL::Header*)this->mBuffer;
-
-#ifdef AI_BUILD_BIG_ENDIAN
- FlipQuakeHeader(pcHeader);
-#endif
-
- ValidateHeader_Quake1(pcHeader);
-
- // current cursor position in the file
- const unsigned char* szCurrent = (const unsigned char*)(pcHeader+1);
-
- // need to read all textures
- for (unsigned int i = 0; i < (unsigned int)pcHeader->num_skins;++i)
- {
- union{BE_NCONST MDL::Skin* pcSkin;BE_NCONST MDL::GroupSkin* pcGroupSkin;};
- pcSkin = (BE_NCONST MDL::Skin*)szCurrent;
-
- AI_SWAP4( pcSkin->group );
-
- // Quake 1 groupskins
- if (1 == pcSkin->group)
- {
- AI_SWAP4( pcGroupSkin->nb );
-
- // need to skip multiple images
- const unsigned int iNumImages = (unsigned int)pcGroupSkin->nb;
- szCurrent += sizeof(uint32_t) * 2;
-
- if (0 != iNumImages)
- {
- if (!i) {
- // however, create only one output image (the first)
- this->CreateTextureARGB8_3DGS_MDL3(szCurrent + iNumImages * sizeof(float));
- }
- // go to the end of the skin section / the beginning of the next skin
- szCurrent += pcHeader->skinheight * pcHeader->skinwidth +
- sizeof(float) * iNumImages;
- }
- }
- // 3DGS has a few files that are using other 3DGS like texture formats here
- else
- {
- szCurrent += sizeof(uint32_t);
- unsigned int iSkip = i ? 0xffffffff : 0;
- this->CreateTexture_3DGS_MDL4(szCurrent,pcSkin->group,&iSkip);
- szCurrent += iSkip;
- }
- }
- // get a pointer to the texture coordinates
- BE_NCONST MDL::TexCoord* pcTexCoords = (BE_NCONST MDL::TexCoord*)szCurrent;
- szCurrent += sizeof(MDL::TexCoord) * pcHeader->num_verts;
-
- // get a pointer to the triangles
- BE_NCONST MDL::Triangle* pcTriangles = (BE_NCONST MDL::Triangle*)szCurrent;
- szCurrent += sizeof(MDL::Triangle) * pcHeader->num_tris;
- VALIDATE_FILE_SIZE(szCurrent);
-
- // now get a pointer to the first frame in the file
- BE_NCONST MDL::Frame* pcFrames = (BE_NCONST MDL::Frame*)szCurrent;
- BE_NCONST MDL::SimpleFrame* pcFirstFrame;
-
- if (0 == pcFrames->type)
- {
- // get address of single frame
- pcFirstFrame = &pcFrames->frame;
- }
- else
- {
- // get the first frame in the group
- BE_NCONST MDL::GroupFrame* pcFrames2 = (BE_NCONST MDL::GroupFrame*)pcFrames;
- pcFirstFrame = (BE_NCONST MDL::SimpleFrame*)(&pcFrames2->time + pcFrames->type);
- }
- BE_NCONST MDL::Vertex* pcVertices = (BE_NCONST MDL::Vertex*) ((pcFirstFrame->name) + sizeof(pcFirstFrame->name));
- VALIDATE_FILE_SIZE((const unsigned char*)(pcVertices + pcHeader->num_verts));
-
-#ifdef AI_BUILD_BIG_ENDIAN
- for (int i = 0; i<pcHeader->num_verts;++i)
- {
- AI_SWAP4( pcTexCoords[i].onseam );
- AI_SWAP4( pcTexCoords[i].s );
- AI_SWAP4( pcTexCoords[i].t );
- }
-
- for (int i = 0; i<pcHeader->num_tris;++i)
- {
- AI_SWAP4( pcTriangles[i].facesfront);
- AI_SWAP4( pcTriangles[i].vertex[0]);
- AI_SWAP4( pcTriangles[i].vertex[1]);
- AI_SWAP4( pcTriangles[i].vertex[2]);
- }
-#endif
-
- // setup materials
- SetupMaterialProperties_3DGS_MDL5_Quake1();
-
- // allocate enough storage to hold all vertices and triangles
- aiMesh* pcMesh = new aiMesh();
-
- pcMesh->mPrimitiveTypes = aiPrimitiveType_TRIANGLE;
- pcMesh->mNumVertices = pcHeader->num_tris * 3;
- pcMesh->mNumFaces = pcHeader->num_tris;
- pcMesh->mVertices = new aiVector3D[pcMesh->mNumVertices];
- pcMesh->mTextureCoords[0] = new aiVector3D[pcMesh->mNumVertices];
- pcMesh->mFaces = new aiFace[pcMesh->mNumFaces];
- pcMesh->mNormals = new aiVector3D[pcMesh->mNumVertices];
- pcMesh->mNumUVComponents[0] = 2;
-
- // there won't be more than one mesh inside the file
- pScene->mRootNode = new aiNode();
- pScene->mRootNode->mNumMeshes = 1;
- pScene->mRootNode->mMeshes = new unsigned int[1];
- pScene->mRootNode->mMeshes[0] = 0;
- pScene->mNumMeshes = 1;
- pScene->mMeshes = new aiMesh*[1];
- pScene->mMeshes[0] = pcMesh;
-
- // now iterate through all triangles
- unsigned int iCurrent = 0;
- for (unsigned int i = 0; i < (unsigned int) pcHeader->num_tris;++i)
- {
- pcMesh->mFaces[i].mIndices = new unsigned int[3];
- pcMesh->mFaces[i].mNumIndices = 3;
-
- unsigned int iTemp = iCurrent;
- for (unsigned int c = 0; c < 3;++c,++iCurrent)
- {
- pcMesh->mFaces[i].mIndices[c] = iCurrent;
-
- // read vertices
- unsigned int iIndex = pcTriangles->vertex[c];
- if (iIndex >= (unsigned int)pcHeader->num_verts)
- {
- iIndex = pcHeader->num_verts-1;
- DefaultLogger::get()->warn("Index overflow in Q1-MDL vertex list.");
- }
-
- aiVector3D& vec = pcMesh->mVertices[iCurrent];
- vec.x = (float)pcVertices[iIndex].v[0] * pcHeader->scale[0];
- vec.x += pcHeader->translate[0];
-
- vec.y = (float)pcVertices[iIndex].v[1] * pcHeader->scale[1];
- vec.y += pcHeader->translate[1];
- //vec.y *= -1.0f;
-
- vec.z = (float)pcVertices[iIndex].v[2] * pcHeader->scale[2];
- vec.z += pcHeader->translate[2];
-
- // read the normal vector from the precalculated normal table
- MD2::LookupNormalIndex(pcVertices[iIndex].normalIndex,pcMesh->mNormals[iCurrent]);
- //pcMesh->mNormals[iCurrent].y *= -1.0f;
-
- // read texture coordinates
- float s = (float)pcTexCoords[iIndex].s;
- float t = (float)pcTexCoords[iIndex].t;
-
- // translate texture coordinates
- if (0 == pcTriangles->facesfront && 0 != pcTexCoords[iIndex].onseam) {
- s += pcHeader->skinwidth * 0.5f;
- }
-
- // Scale s and t to range from 0.0 to 1.0
- pcMesh->mTextureCoords[0][iCurrent].x = (s + 0.5f) / pcHeader->skinwidth;
- pcMesh->mTextureCoords[0][iCurrent].y = 1.0f-(t + 0.5f) / pcHeader->skinheight;
-
- }
- pcMesh->mFaces[i].mIndices[0] = iTemp+2;
- pcMesh->mFaces[i].mIndices[1] = iTemp+1;
- pcMesh->mFaces[i].mIndices[2] = iTemp+0;
- pcTriangles++;
- }
- return;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Setup material properties for Quake and older GameStudio files
-void MDLImporter::SetupMaterialProperties_3DGS_MDL5_Quake1( )
-{
- const MDL::Header* const pcHeader = (const MDL::Header*)this->mBuffer;
-
- // allocate ONE material
- pScene->mMaterials = new aiMaterial*[1];
- pScene->mMaterials[0] = new MaterialHelper();
- pScene->mNumMaterials = 1;
-
- // setup the material's properties
- const int iMode = (int)aiShadingMode_Gouraud;
- MaterialHelper* const pcHelper = (MaterialHelper*)pScene->mMaterials[0];
- pcHelper->AddProperty<int>(&iMode, 1, AI_MATKEY_SHADING_MODEL);
-
- aiColor4D clr;
- if (0 != pcHeader->num_skins && pScene->mNumTextures) {
- // can we replace the texture with a single color?
- clr = this->ReplaceTextureWithColor(pScene->mTextures[0]);
- if (is_not_qnan(clr.r)) {
- delete pScene->mTextures[0];
- delete[] pScene->mTextures;
-
- pScene->mTextures = NULL;
- pScene->mNumTextures = 0;
- }
- else {
- clr.b = clr.a = clr.g = clr.r = 1.0f;
- aiString szString;
- ::memcpy(szString.data,AI_MAKE_EMBEDDED_TEXNAME(0),3);
- szString.length = 2;
- pcHelper->AddProperty(&szString,AI_MATKEY_TEXTURE_DIFFUSE(0));
- }
- }
-
- pcHelper->AddProperty<aiColor4D>(&clr, 1,AI_MATKEY_COLOR_DIFFUSE);
- pcHelper->AddProperty<aiColor4D>(&clr, 1,AI_MATKEY_COLOR_SPECULAR);
-
- clr.r *= 0.05f;clr.g *= 0.05f;
- clr.b *= 0.05f;clr.a = 1.0f;
- pcHelper->AddProperty<aiColor4D>(&clr, 1,AI_MATKEY_COLOR_AMBIENT);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Read a MDL 3,4,5 file
-void MDLImporter::InternReadFile_3DGS_MDL345( )
-{
- ai_assert(NULL != pScene);
-
- // the header of MDL 3/4/5 is nearly identical to the original Quake1 header
- BE_NCONST MDL::Header *pcHeader = (BE_NCONST MDL::Header*)this->mBuffer;
-#ifdef AI_BUILD_BIG_ENDIAN
- FlipQuakeHeader(pcHeader);
-#endif
- ValidateHeader_Quake1(pcHeader);
-
- // current cursor position in the file
- const unsigned char* szCurrent = (const unsigned char*)(pcHeader+1);
-
- // need to read all textures
- for (unsigned int i = 0; i < (unsigned int)pcHeader->num_skins;++i) {
- BE_NCONST MDL::Skin* pcSkin;
- pcSkin = (BE_NCONST MDL::Skin*)szCurrent;
- AI_SWAP4( pcSkin->group);
- // create one output image
- unsigned int iSkip = i ? 0xffffffff : 0;
- if (5 <= iGSFileVersion)
- {
- // MDL5 format could contain MIPmaps
- CreateTexture_3DGS_MDL5((unsigned char*)pcSkin + sizeof(uint32_t),
- pcSkin->group,&iSkip);
- }
- else {
- CreateTexture_3DGS_MDL4((unsigned char*)pcSkin + sizeof(uint32_t),
- pcSkin->group,&iSkip);
- }
- // need to skip one image
- szCurrent += iSkip + sizeof(uint32_t);
-
- }
- // get a pointer to the texture coordinates
- BE_NCONST MDL::TexCoord_MDL3* pcTexCoords = (BE_NCONST MDL::TexCoord_MDL3*)szCurrent;
- szCurrent += sizeof(MDL::TexCoord_MDL3) * pcHeader->synctype;
-
- // NOTE: for MDLn formats "synctype" corresponds to the number of UV coords
-
- // get a pointer to the triangles
- BE_NCONST MDL::Triangle_MDL3* pcTriangles = (BE_NCONST MDL::Triangle_MDL3*)szCurrent;
- szCurrent += sizeof(MDL::Triangle_MDL3) * pcHeader->num_tris;
-
-#ifdef AI_BUILD_BIG_ENDIAN
-
- for (int i = 0; i<pcHeader->synctype;++i) {
- AI_SWAP2( pcTexCoords[i].u );
- AI_SWAP2( pcTexCoords[i].v );
- }
-
- for (int i = 0; i<pcHeader->num_tris;++i) {
- AI_SWAP2( pcTriangles[i].index_xyz[0]);
- AI_SWAP2( pcTriangles[i].index_xyz[1]);
- AI_SWAP2( pcTriangles[i].index_xyz[2]);
- AI_SWAP2( pcTriangles[i].index_uv[0]);
- AI_SWAP2( pcTriangles[i].index_uv[1]);
- AI_SWAP2( pcTriangles[i].index_uv[2]);
- }
-
-#endif
-
- VALIDATE_FILE_SIZE(szCurrent);
-
- // setup materials
- SetupMaterialProperties_3DGS_MDL5_Quake1();
-
- // allocate enough storage to hold all vertices and triangles
- aiMesh* pcMesh = new aiMesh();
- pcMesh->mPrimitiveTypes = aiPrimitiveType_TRIANGLE;
-
- pcMesh->mNumVertices = pcHeader->num_tris * 3;
- pcMesh->mNumFaces = pcHeader->num_tris;
- pcMesh->mFaces = new aiFace[pcMesh->mNumFaces];
-
- // there won't be more than one mesh inside the file
- pScene->mRootNode = new aiNode();
- pScene->mRootNode->mNumMeshes = 1;
- pScene->mRootNode->mMeshes = new unsigned int[1];
- pScene->mRootNode->mMeshes[0] = 0;
- pScene->mNumMeshes = 1;
- pScene->mMeshes = new aiMesh*[1];
- pScene->mMeshes[0] = pcMesh;
-
- // allocate output storage
- pcMesh->mNumVertices = (unsigned int)pcHeader->num_tris*3;
- pcMesh->mVertices = new aiVector3D[pcMesh->mNumVertices];
- pcMesh->mNormals = new aiVector3D[pcMesh->mNumVertices];
-
- if (pcHeader->synctype) {
- pcMesh->mTextureCoords[0] = new aiVector3D[pcMesh->mNumVertices];
- pcMesh->mNumUVComponents[0] = 2;
- }
-
- // now get a pointer to the first frame in the file
- BE_NCONST MDL::Frame* pcFrames = (BE_NCONST MDL::Frame*)szCurrent;
- AI_SWAP4(pcFrames->type);
-
- // byte packed vertices
- // FIXME: these two snippets below are almost identical ... join them?
- /////////////////////////////////////////////////////////////////////////////////////
- if (0 == pcFrames->type || 3 >= this->iGSFileVersion) {
-
- const MDL::SimpleFrame* pcFirstFrame = (const MDL::SimpleFrame*)(szCurrent + sizeof(uint32_t));
- const MDL::Vertex* pcVertices = (const MDL::Vertex*) ((pcFirstFrame->name) + sizeof(pcFirstFrame->name));
-
- VALIDATE_FILE_SIZE(pcVertices + pcHeader->num_verts);
-
- // now iterate through all triangles
- unsigned int iCurrent = 0;
- for (unsigned int i = 0; i < (unsigned int) pcHeader->num_tris;++i) {
- pcMesh->mFaces[i].mIndices = new unsigned int[3];
- pcMesh->mFaces[i].mNumIndices = 3;
-
- unsigned int iTemp = iCurrent;
- for (unsigned int c = 0; c < 3;++c,++iCurrent) {
- // read vertices
- unsigned int iIndex = pcTriangles->index_xyz[c];
- if (iIndex >= (unsigned int)pcHeader->num_verts) {
- iIndex = pcHeader->num_verts-1;
- DefaultLogger::get()->warn("Index overflow in MDLn vertex list");
- }
-
- aiVector3D& vec = pcMesh->mVertices[iCurrent];
- vec.x = (float)pcVertices[iIndex].v[0] * pcHeader->scale[0];
- vec.x += pcHeader->translate[0];
-
- vec.y = (float)pcVertices[iIndex].v[1] * pcHeader->scale[1];
- vec.y += pcHeader->translate[1];
- // vec.y *= -1.0f;
-
- vec.z = (float)pcVertices[iIndex].v[2] * pcHeader->scale[2];
- vec.z += pcHeader->translate[2];
-
- // read the normal vector from the precalculated normal table
- MD2::LookupNormalIndex(pcVertices[iIndex].normalIndex,pcMesh->mNormals[iCurrent]);
- // pcMesh->mNormals[iCurrent].y *= -1.0f;
-
- // read texture coordinates
- if (pcHeader->synctype) {
- ImportUVCoordinate_3DGS_MDL345(pcMesh->mTextureCoords[0][iCurrent],
- pcTexCoords,pcTriangles->index_uv[c]);
- }
- }
- pcMesh->mFaces[i].mIndices[0] = iTemp+2;
- pcMesh->mFaces[i].mIndices[1] = iTemp+1;
- pcMesh->mFaces[i].mIndices[2] = iTemp+0;
- pcTriangles++;
- }
-
- }
- // short packed vertices
- /////////////////////////////////////////////////////////////////////////////////////
- else {
- // now get a pointer to the first frame in the file
- const MDL::SimpleFrame_MDLn_SP* pcFirstFrame = (const MDL::SimpleFrame_MDLn_SP*) (szCurrent + sizeof(uint32_t));
-
- // get a pointer to the vertices
- const MDL::Vertex_MDL4* pcVertices = (const MDL::Vertex_MDL4*) ((pcFirstFrame->name) +
- sizeof(pcFirstFrame->name));
-
- VALIDATE_FILE_SIZE(pcVertices + pcHeader->num_verts);
-
- // now iterate through all triangles
- unsigned int iCurrent = 0;
- for (unsigned int i = 0; i < (unsigned int) pcHeader->num_tris;++i) {
- pcMesh->mFaces[i].mIndices = new unsigned int[3];
- pcMesh->mFaces[i].mNumIndices = 3;
-
- unsigned int iTemp = iCurrent;
- for (unsigned int c = 0; c < 3;++c,++iCurrent) {
- // read vertices
- unsigned int iIndex = pcTriangles->index_xyz[c];
- if (iIndex >= (unsigned int)pcHeader->num_verts) {
- iIndex = pcHeader->num_verts-1;
- DefaultLogger::get()->warn("Index overflow in MDLn vertex list");
- }
-
- aiVector3D& vec = pcMesh->mVertices[iCurrent];
- vec.x = (float)pcVertices[iIndex].v[0] * pcHeader->scale[0];
- vec.x += pcHeader->translate[0];
-
- vec.y = (float)pcVertices[iIndex].v[1] * pcHeader->scale[1];
- vec.y += pcHeader->translate[1];
- // vec.y *= -1.0f;
-
- vec.z = (float)pcVertices[iIndex].v[2] * pcHeader->scale[2];
- vec.z += pcHeader->translate[2];
-
- // read the normal vector from the precalculated normal table
- MD2::LookupNormalIndex(pcVertices[iIndex].normalIndex,pcMesh->mNormals[iCurrent]);
- // pcMesh->mNormals[iCurrent].y *= -1.0f;
-
- // read texture coordinates
- if (pcHeader->synctype) {
- ImportUVCoordinate_3DGS_MDL345(pcMesh->mTextureCoords[0][iCurrent],
- pcTexCoords,pcTriangles->index_uv[c]);
- }
- }
- pcMesh->mFaces[i].mIndices[0] = iTemp+2;
- pcMesh->mFaces[i].mIndices[1] = iTemp+1;
- pcMesh->mFaces[i].mIndices[2] = iTemp+0;
- pcTriangles++;
- }
- }
-
- // For MDL5 we will need to build valid texture coordinates
- // basing upon the file loaded (only support one file as skin)
- if (0x5 == iGSFileVersion)
- CalculateUVCoordinates_MDL5();
- return;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Get a single UV coordinate for Quake and older GameStudio files
-void MDLImporter::ImportUVCoordinate_3DGS_MDL345(
- aiVector3D& vOut,
- const MDL::TexCoord_MDL3* pcSrc,
- unsigned int iIndex)
-{
- ai_assert(NULL != pcSrc);
- const MDL::Header* const pcHeader = (const MDL::Header*)this->mBuffer;
-
- // validate UV indices
- if (iIndex >= (unsigned int) pcHeader->synctype) {
- iIndex = pcHeader->synctype-1;
- DefaultLogger::get()->warn("Index overflow in MDLn UV coord list");
- }
-
- float s = (float)pcSrc[iIndex].u;
- float t = (float)pcSrc[iIndex].v;
-
- // Scale s and t to range from 0.0 to 1.0
- if (0x5 != iGSFileVersion) {
- s = (s + 0.5f) / pcHeader->skinwidth;
- t = 1.0f-(t + 0.5f) / pcHeader->skinheight;
- }
-
- vOut.x = s;
- vOut.y = t;
- vOut.z = 0.0f;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Compute UV coordinates for a MDL5 file
-void MDLImporter::CalculateUVCoordinates_MDL5()
-{
- const MDL::Header* const pcHeader = (const MDL::Header*)this->mBuffer;
- if (pcHeader->num_skins && this->pScene->mNumTextures) {
- const aiTexture* pcTex = this->pScene->mTextures[0];
-
- // if the file is loaded in DDS format: get the size of the
- // texture from the header of the DDS file
- // skip three DWORDs and read first height, then the width
- unsigned int iWidth, iHeight;
- if (!pcTex->mHeight) {
- const uint32_t* piPtr = (uint32_t*)pcTex->pcData;
-
- piPtr += 3;
- iHeight = (unsigned int)*piPtr++;
- iWidth = (unsigned int)*piPtr;
- if (!iHeight || !iWidth)
- {
- DefaultLogger::get()->warn("Either the width or the height of the "
- "embedded DDS texture is zero. Unable to compute final texture "
- "coordinates. The texture coordinates remain in their original "
- "0-x/0-y (x,y = texture size) range.");
- iWidth = 1;
- iHeight = 1;
- }
- }
- else {
- iWidth = pcTex->mWidth;
- iHeight = pcTex->mHeight;
- }
-
- if (1 != iWidth || 1 != iHeight) {
- const float fWidth = (float)iWidth;
- const float fHeight = (float)iHeight;
- aiMesh* pcMesh = this->pScene->mMeshes[0];
- for (unsigned int i = 0; i < pcMesh->mNumVertices;++i)
- {
- pcMesh->mTextureCoords[0][i].x /= fWidth;
- pcMesh->mTextureCoords[0][i].y /= fHeight;
- pcMesh->mTextureCoords[0][i].y = 1.0f - pcMesh->mTextureCoords[0][i].y; // DX to OGL
- }
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Validate the header of a MDL7 file
-void MDLImporter::ValidateHeader_3DGS_MDL7(const MDL::Header_MDL7* pcHeader)
-{
- ai_assert(NULL != pcHeader);
-
- // There are some fixed sizes ...
- if (sizeof(MDL::ColorValue_MDL7) != pcHeader->colorvalue_stc_size) {
- throw DeadlyImportError(
- "[3DGS MDL7] sizeof(MDL::ColorValue_MDL7) != pcHeader->colorvalue_stc_size");
- }
- if (sizeof(MDL::TexCoord_MDL7) != pcHeader->skinpoint_stc_size) {
- throw DeadlyImportError(
- "[3DGS MDL7] sizeof(MDL::TexCoord_MDL7) != pcHeader->skinpoint_stc_size");
- }
- if (sizeof(MDL::Skin_MDL7) != pcHeader->skin_stc_size) {
- throw DeadlyImportError(
- "sizeof(MDL::Skin_MDL7) != pcHeader->skin_stc_size");
- }
-
- // if there are no groups ... how should we load such a file?
- if(!pcHeader->groups_num) {
- throw DeadlyImportError( "[3DGS MDL7] No frames found");
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// resolve bone animation matrices
-void MDLImporter::CalcAbsBoneMatrices_3DGS_MDL7(MDL::IntBone_MDL7** apcOutBones)
-{
- const MDL::Header_MDL7 *pcHeader = (const MDL::Header_MDL7*)this->mBuffer;
- const MDL::Bone_MDL7* pcBones = (const MDL::Bone_MDL7*)(pcHeader+1);
- ai_assert(NULL != apcOutBones);
-
- // first find the bone that has NO parent, calculate the
- // animation matrix for it, then go on and search for the next parent
- // index (0) and so on until we can't find a new node.
- uint16_t iParent = 0xffff;
- uint32_t iIterations = 0;
- while (iIterations++ < pcHeader->bones_num) {
- for (uint32_t iBone = 0; iBone < pcHeader->bones_num;++iBone) {
- BE_NCONST MDL::Bone_MDL7* pcBone = _AI_MDL7_ACCESS_PTR(pcBones,iBone,
- pcHeader->bone_stc_size,MDL::Bone_MDL7);
-
- AI_SWAP2(pcBone->parent_index);
- AI_SWAP4(pcBone->x);
- AI_SWAP4(pcBone->y);
- AI_SWAP4(pcBone->z);
-
- if (iParent == pcBone->parent_index) {
- // MDL7 readme
- ////////////////////////////////////////////////////////////////
- /*
- The animation matrix is then calculated the following way:
-
- vector3 bPos = <absolute bone position>
- matrix44 laM; // local animation matrix
- sphrvector key_rotate = <bone rotation>
-
- matrix44 m1,m2;
- create_trans_matrix(m1, -bPos.x, -bPos.y, -bPos.z);
- create_trans_matrix(m2, -bPos.x, -bPos.y, -bPos.z);
-
- create_rotation_matrix(laM,key_rotate);
-
- laM = sm1 * laM;
- laM = laM * sm2;
- */
- /////////////////////////////////////////////////////////////////
-
- MDL::IntBone_MDL7* const pcOutBone = apcOutBones[iBone];
-
- // store the parent index of the bone
- pcOutBone->iParent = pcBone->parent_index;
- if (0xffff != iParent) {
- const MDL::IntBone_MDL7* pcParentBone = apcOutBones[iParent];
- pcOutBone->mOffsetMatrix.a4 = -pcParentBone->vPosition.x;
- pcOutBone->mOffsetMatrix.b4 = -pcParentBone->vPosition.y;
- pcOutBone->mOffsetMatrix.c4 = -pcParentBone->vPosition.z;
- }
- pcOutBone->vPosition.x = pcBone->x;
- pcOutBone->vPosition.y = pcBone->y;
- pcOutBone->vPosition.z = pcBone->z;
- pcOutBone->mOffsetMatrix.a4 -= pcBone->x;
- pcOutBone->mOffsetMatrix.b4 -= pcBone->y;
- pcOutBone->mOffsetMatrix.c4 -= pcBone->z;
-
- if (AI_MDL7_BONE_STRUCT_SIZE__NAME_IS_NOT_THERE == pcHeader->bone_stc_size) {
- // no real name for our poor bone is specified :-(
- pcOutBone->mName.length = ::sprintf(pcOutBone->mName.data,
- "UnnamedBone_%i",iBone);
- }
- else {
- // Make sure we won't run over the buffer's end if there is no
- // terminal 0 character (however the documentation says there
- // should be one)
- uint32_t iMaxLen = pcHeader->bone_stc_size-16;
- for (uint32_t qq = 0; qq < iMaxLen;++qq) {
- if (!pcBone->name[qq]) {
- iMaxLen = qq;
- break;
- }
- }
-
- // store the name of the bone
- pcOutBone->mName.length = (size_t)iMaxLen;
- ::memcpy(pcOutBone->mName.data,pcBone->name,pcOutBone->mName.length);
- pcOutBone->mName.data[pcOutBone->mName.length] = '\0';
- }
- }
- }
- ++iParent;
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// read bones from a MDL7 file
-MDL::IntBone_MDL7** MDLImporter::LoadBones_3DGS_MDL7()
-{
- const MDL::Header_MDL7 *pcHeader = (const MDL::Header_MDL7*)this->mBuffer;
- if (pcHeader->bones_num) {
- // validate the size of the bone data structure in the file
- if (AI_MDL7_BONE_STRUCT_SIZE__NAME_IS_20_CHARS != pcHeader->bone_stc_size &&
- AI_MDL7_BONE_STRUCT_SIZE__NAME_IS_32_CHARS != pcHeader->bone_stc_size &&
- AI_MDL7_BONE_STRUCT_SIZE__NAME_IS_NOT_THERE != pcHeader->bone_stc_size)
- {
- DefaultLogger::get()->warn("Unknown size of bone data structure");
- return NULL;
- }
-
- MDL::IntBone_MDL7** apcBonesOut = new MDL::IntBone_MDL7*[pcHeader->bones_num];
- for (uint32_t crank = 0; crank < pcHeader->bones_num;++crank)
- apcBonesOut[crank] = new MDL::IntBone_MDL7();
-
- // and calculate absolute bone offset matrices ...
- CalcAbsBoneMatrices_3DGS_MDL7(apcBonesOut);
- return apcBonesOut;
- }
- return NULL;
-}
-
-// ------------------------------------------------------------------------------------------------
-// read faces from a MDL7 file
-void MDLImporter::ReadFaces_3DGS_MDL7(const MDL::IntGroupInfo_MDL7& groupInfo,
- MDL::IntGroupData_MDL7& groupData)
-{
- const MDL::Header_MDL7 *pcHeader = (const MDL::Header_MDL7*)this->mBuffer;
- BE_NCONST MDL::Triangle_MDL7* pcGroupTris = groupInfo.pcGroupTris;
-
- // iterate through all triangles and build valid display lists
- unsigned int iOutIndex = 0;
- for (unsigned int iTriangle = 0; iTriangle < (unsigned int)groupInfo.pcGroup->numtris; ++iTriangle) {
- AI_SWAP2(pcGroupTris->v_index[0]);
- AI_SWAP2(pcGroupTris->v_index[1]);
- AI_SWAP2(pcGroupTris->v_index[2]);
-
- // iterate through all indices of the current triangle
- for (unsigned int c = 0; c < 3;++c,++iOutIndex) {
-
- // validate the vertex index
- unsigned int iIndex = pcGroupTris->v_index[c];
- if(iIndex > (unsigned int)groupInfo.pcGroup->numverts) {
- // (we might need to read this section a second time - to process frame vertices correctly)
- const_cast<MDL::Triangle_MDL7*>(pcGroupTris)->v_index[c] = iIndex = groupInfo.pcGroup->numverts-1;
- DefaultLogger::get()->warn("Index overflow in MDL7 vertex list");
- }
-
- // write the output face index
- groupData.pcFaces[iTriangle].mIndices[2-c] = iOutIndex;
-
- aiVector3D& vPosition = groupData.vPositions[ iOutIndex ];
- vPosition.x = _AI_MDL7_ACCESS_VERT(groupInfo.pcGroupVerts,iIndex, pcHeader->mainvertex_stc_size) .x;
- vPosition.y = _AI_MDL7_ACCESS_VERT(groupInfo.pcGroupVerts,iIndex,pcHeader->mainvertex_stc_size) .y;
- vPosition.z = _AI_MDL7_ACCESS_VERT(groupInfo.pcGroupVerts,iIndex,pcHeader->mainvertex_stc_size) .z;
-
- // if we have bones, save the index
- if (!groupData.aiBones.empty()) {
- groupData.aiBones[iOutIndex] = _AI_MDL7_ACCESS_VERT(groupInfo.pcGroupVerts,
- iIndex,pcHeader->mainvertex_stc_size).vertindex;
- }
-
- // now read the normal vector
- if (AI_MDL7_FRAMEVERTEX030305_STCSIZE <= pcHeader->mainvertex_stc_size) {
- // read the full normal vector
- aiVector3D& vNormal = groupData.vNormals[ iOutIndex ];
- vNormal.x = _AI_MDL7_ACCESS_VERT(groupInfo.pcGroupVerts,iIndex,pcHeader->mainvertex_stc_size) .norm[0];
- AI_SWAP4(vNormal.x);
- vNormal.y = _AI_MDL7_ACCESS_VERT(groupInfo.pcGroupVerts,iIndex,pcHeader->mainvertex_stc_size) .norm[1];
- AI_SWAP4(vNormal.y);
- vNormal.z = _AI_MDL7_ACCESS_VERT(groupInfo.pcGroupVerts,iIndex,pcHeader->mainvertex_stc_size) .norm[2];
- AI_SWAP4(vNormal.z);
- }
- else if (AI_MDL7_FRAMEVERTEX120503_STCSIZE <= pcHeader->mainvertex_stc_size) {
- // read the normal vector from Quake2's smart table
- aiVector3D& vNormal = groupData.vNormals[ iOutIndex ];
- MD2::LookupNormalIndex(_AI_MDL7_ACCESS_VERT(groupInfo.pcGroupVerts,iIndex,
- pcHeader->mainvertex_stc_size) .norm162index,vNormal);
- }
- // validate and process the first uv coordinate set
- if (pcHeader->triangle_stc_size >= AI_MDL7_TRIANGLE_STD_SIZE_ONE_UV) {
-
- if (groupInfo.pcGroup->num_stpts) {
- AI_SWAP2(pcGroupTris->skinsets[0].st_index[0]);
- AI_SWAP2(pcGroupTris->skinsets[0].st_index[1]);
- AI_SWAP2(pcGroupTris->skinsets[0].st_index[2]);
-
- iIndex = pcGroupTris->skinsets[0].st_index[c];
- if(iIndex > (unsigned int)groupInfo.pcGroup->num_stpts) {
- iIndex = groupInfo.pcGroup->num_stpts-1;
- DefaultLogger::get()->warn("Index overflow in MDL7 UV coordinate list (#1)");
- }
-
- float u = groupInfo.pcGroupUVs[iIndex].u;
- float v = 1.0f-groupInfo.pcGroupUVs[iIndex].v; // DX to OGL
-
- groupData.vTextureCoords1[iOutIndex].x = u;
- groupData.vTextureCoords1[iOutIndex].y = v;
- }
- // assign the material index, but only if it is existing
- if (pcHeader->triangle_stc_size >= AI_MDL7_TRIANGLE_STD_SIZE_ONE_UV_WITH_MATINDEX){
- AI_SWAP4(pcGroupTris->skinsets[0].material);
- groupData.pcFaces[iTriangle].iMatIndex[0] = pcGroupTris->skinsets[0].material;
- }
- }
- // validate and process the second uv coordinate set
- if (pcHeader->triangle_stc_size >= AI_MDL7_TRIANGLE_STD_SIZE_TWO_UV) {
-
- if (groupInfo.pcGroup->num_stpts) {
- AI_SWAP2(pcGroupTris->skinsets[1].st_index[0]);
- AI_SWAP2(pcGroupTris->skinsets[1].st_index[1]);
- AI_SWAP2(pcGroupTris->skinsets[1].st_index[2]);
- AI_SWAP4(pcGroupTris->skinsets[1].material);
-
- iIndex = pcGroupTris->skinsets[1].st_index[c];
- if(iIndex > (unsigned int)groupInfo.pcGroup->num_stpts) {
- iIndex = groupInfo.pcGroup->num_stpts-1;
- DefaultLogger::get()->warn("Index overflow in MDL7 UV coordinate list (#2)");
- }
-
- float u = groupInfo.pcGroupUVs[ iIndex ].u;
- float v = 1.0f-groupInfo.pcGroupUVs[ iIndex ].v;
-
- groupData.vTextureCoords2[ iOutIndex ].x = u;
- groupData.vTextureCoords2[ iOutIndex ].y = v; // DX to OGL
-
- // check whether we do really need the second texture
- // coordinate set ... wastes memory and loading time
- if (0 != iIndex && (u != groupData.vTextureCoords1[ iOutIndex ].x ||
- v != groupData.vTextureCoords1[ iOutIndex ].y ) )
- groupData.bNeed2UV = true;
-
- // if the material differs, we need a second skin, too
- if (pcGroupTris->skinsets[ 1 ].material != pcGroupTris->skinsets[ 0 ].material)
- groupData.bNeed2UV = true;
- }
- // assign the material index
- groupData.pcFaces[ iTriangle ].iMatIndex[ 1 ] = pcGroupTris->skinsets[ 1 ].material;
- }
- }
- // get the next triangle in the list
- pcGroupTris = (BE_NCONST MDL::Triangle_MDL7*)((const char*)pcGroupTris + pcHeader->triangle_stc_size);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// handle frames in a MDL7 file
-bool MDLImporter::ProcessFrames_3DGS_MDL7(const MDL::IntGroupInfo_MDL7& groupInfo,
- MDL::IntGroupData_MDL7& groupData,
- MDL::IntSharedData_MDL7& shared,
- const unsigned char* szCurrent,
- const unsigned char** szCurrentOut)
-{
- ai_assert(NULL != szCurrent && NULL != szCurrentOut);
- const MDL::Header_MDL7 *pcHeader = (const MDL::Header_MDL7*)mBuffer;
-
- // if we have no bones we can simply skip all frames,
- // otherwise we'll need to process them.
- // FIX: If we need another frame than the first we must apply frame vertex replacements ...
- for(unsigned int iFrame = 0; iFrame < (unsigned int)groupInfo.pcGroup->numframes;++iFrame) {
- MDL::IntFrameInfo_MDL7 frame ((BE_NCONST MDL::Frame_MDL7*)szCurrent,iFrame);
-
- AI_SWAP4(frame.pcFrame->vertices_count);
- AI_SWAP4(frame.pcFrame->transmatrix_count);
-
- const unsigned int iAdd = pcHeader->frame_stc_size +
- frame.pcFrame->vertices_count * pcHeader->framevertex_stc_size +
- frame.pcFrame->transmatrix_count * pcHeader->bonetrans_stc_size;
-
- if (((const char*)szCurrent - (const char*)pcHeader) + iAdd > (unsigned int)pcHeader->data_size) {
- DefaultLogger::get()->warn("Index overflow in frame area. "
- "Ignoring all frames and all further mesh groups, too.");
-
- // don't parse more groups if we can't even read one
- // FIXME: sometimes this seems to occur even for valid files ...
- *szCurrentOut = szCurrent;
- return false;
- }
- // our output frame?
- if (configFrameID == iFrame) {
- BE_NCONST MDL::Vertex_MDL7* pcFrameVertices = (BE_NCONST MDL::Vertex_MDL7*)(szCurrent+pcHeader->frame_stc_size);
-
- for (unsigned int qq = 0; qq < frame.pcFrame->vertices_count;++qq) {
- // I assume this are simple replacements for normal vertices, the bone index serving
- // as the index of the vertex to be replaced.
- uint16_t iIndex = _AI_MDL7_ACCESS(pcFrameVertices,qq,pcHeader->framevertex_stc_size,MDL::Vertex_MDL7).vertindex;
- AI_SWAP2(iIndex);
- if (iIndex >= groupInfo.pcGroup->numverts) {
- DefaultLogger::get()->warn("Invalid vertex index in frame vertex section");
- continue;
- }
-
- aiVector3D vPosition,vNormal;
-
- vPosition.x = _AI_MDL7_ACCESS_VERT(pcFrameVertices,qq,pcHeader->framevertex_stc_size) .x;
- AI_SWAP4(vPosition.x);
- vPosition.y = _AI_MDL7_ACCESS_VERT(pcFrameVertices,qq,pcHeader->framevertex_stc_size) .y;
- AI_SWAP4(vPosition.y);
- vPosition.z = _AI_MDL7_ACCESS_VERT(pcFrameVertices,qq,pcHeader->framevertex_stc_size) .z;
- AI_SWAP4(vPosition.z);
-
- // now read the normal vector
- if (AI_MDL7_FRAMEVERTEX030305_STCSIZE <= pcHeader->mainvertex_stc_size) {
- // read the full normal vector
- vNormal.x = _AI_MDL7_ACCESS_VERT(pcFrameVertices,qq,pcHeader->framevertex_stc_size) .norm[0];
- AI_SWAP4(vNormal.x);
- vNormal.y = _AI_MDL7_ACCESS_VERT(pcFrameVertices,qq,pcHeader->framevertex_stc_size) .norm[1];
- AI_SWAP4(vNormal.y);
- vNormal.z = _AI_MDL7_ACCESS_VERT(pcFrameVertices,qq,pcHeader->framevertex_stc_size) .norm[2];
- AI_SWAP4(vNormal.z);
- }
- else if (AI_MDL7_FRAMEVERTEX120503_STCSIZE <= pcHeader->mainvertex_stc_size) {
- // read the normal vector from Quake2's smart table
- MD2::LookupNormalIndex(_AI_MDL7_ACCESS_VERT(pcFrameVertices,qq,
- pcHeader->framevertex_stc_size) .norm162index,vNormal);
- }
-
- // FIXME: O(n^2) at the moment ...
- BE_NCONST MDL::Triangle_MDL7* pcGroupTris = groupInfo.pcGroupTris;
- unsigned int iOutIndex = 0;
- for (unsigned int iTriangle = 0; iTriangle < (unsigned int)groupInfo.pcGroup->numtris; ++iTriangle) {
- // iterate through all indices of the current triangle
- for (unsigned int c = 0; c < 3;++c,++iOutIndex) {
- // replace the vertex with the new data
- const unsigned int iCurIndex = pcGroupTris->v_index[c];
- if (iCurIndex == iIndex) {
- groupData.vPositions[iOutIndex] = vPosition;
- groupData.vNormals[iOutIndex] = vNormal;
- }
- }
- // get the next triangle in the list
- pcGroupTris = (BE_NCONST MDL::Triangle_MDL7*)((const char*)
- pcGroupTris + pcHeader->triangle_stc_size);
- }
- }
- }
- // parse bone trafo matrix keys (only if there are bones ...)
- if (shared.apcOutBones) {
- ParseBoneTrafoKeys_3DGS_MDL7(groupInfo,frame,shared);
- }
- szCurrent += iAdd;
- }
- *szCurrentOut = szCurrent;
- return true;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Sort faces by material, handle multiple UVs correctly
-void MDLImporter::SortByMaterials_3DGS_MDL7(
- const MDL::IntGroupInfo_MDL7& groupInfo,
- MDL::IntGroupData_MDL7& groupData,
- MDL::IntSplittedGroupData_MDL7& splittedGroupData)
-{
- const unsigned int iNumMaterials = (unsigned int)splittedGroupData.shared.pcMats.size();
- if (!groupData.bNeed2UV) {
- // if we don't need a second set of texture coordinates there is no reason to keep it in memory ...
- groupData.vTextureCoords2.clear();
-
- // allocate the array
- splittedGroupData.aiSplit = new std::vector<unsigned int>*[iNumMaterials];
-
- for (unsigned int m = 0; m < iNumMaterials;++m)
- splittedGroupData.aiSplit[m] = new std::vector<unsigned int>();
-
- // iterate through all faces and sort by material
- for (unsigned int iFace = 0; iFace < (unsigned int)groupInfo.pcGroup->numtris;++iFace) {
- // check range
- if (groupData.pcFaces[iFace].iMatIndex[0] >= iNumMaterials) {
- // use the last material instead
- splittedGroupData.aiSplit[iNumMaterials-1]->push_back(iFace);
-
- // sometimes MED writes -1, but normally only if there is only
- // one skin assigned. No warning in this case
- if(0xFFFFFFFF != groupData.pcFaces[iFace].iMatIndex[0])
- DefaultLogger::get()->warn("Index overflow in MDL7 material list [#0]");
- }
- else splittedGroupData.aiSplit[groupData.pcFaces[iFace].
- iMatIndex[0]]->push_back(iFace);
- }
- }
- else
- {
- // we need to build combined materials for each combination of
- std::vector<MDL::IntMaterial_MDL7> avMats;
- avMats.reserve(iNumMaterials*2);
-
- // fixme: why on the heap?
- std::vector<std::vector<unsigned int>* > aiTempSplit(iNumMaterials*2);
- for (unsigned int m = 0; m < iNumMaterials;++m)
- aiTempSplit[m] = new std::vector<unsigned int>();
-
- // iterate through all faces and sort by material
- for (unsigned int iFace = 0; iFace < (unsigned int)groupInfo.pcGroup->numtris;++iFace) {
- // check range
- unsigned int iMatIndex = groupData.pcFaces[iFace].iMatIndex[0];
- if (iMatIndex >= iNumMaterials) {
- // sometimes MED writes -1, but normally only if there is only
- // one skin assigned. No warning in this case
- if(0xffffffff != iMatIndex)
- DefaultLogger::get()->warn("Index overflow in MDL7 material list [#1]");
- iMatIndex = iNumMaterials-1;
- }
- unsigned int iMatIndex2 = groupData.pcFaces[iFace].iMatIndex[1];
-
- unsigned int iNum = iMatIndex;
- if (0xffffffff != iMatIndex2 && iMatIndex != iMatIndex2) {
- if (iMatIndex2 >= iNumMaterials) {
- // sometimes MED writes -1, but normally only if there is only
- // one skin assigned. No warning in this case
- DefaultLogger::get()->warn("Index overflow in MDL7 material list [#2]");
- iMatIndex2 = iNumMaterials-1;
- }
-
- // do a slow seach in the list ...
- iNum = 0;
- bool bFound = false;
- for (std::vector<MDL::IntMaterial_MDL7>::iterator i = avMats.begin();i != avMats.end();++i,++iNum){
- if ((*i).iOldMatIndices[0] == iMatIndex && (*i).iOldMatIndices[1] == iMatIndex2) {
- // reuse this material
- bFound = true;
- break;
- }
- }
- if (!bFound) {
- // build a new material ...
- MDL::IntMaterial_MDL7 sHelper;
- sHelper.pcMat = new MaterialHelper();
- sHelper.iOldMatIndices[0] = iMatIndex;
- sHelper.iOldMatIndices[1] = iMatIndex2;
- JoinSkins_3DGS_MDL7(splittedGroupData.shared.pcMats[iMatIndex],
- splittedGroupData.shared.pcMats[iMatIndex2],sHelper.pcMat);
-
- // and add it to the list
- avMats.push_back(sHelper);
- iNum = (unsigned int)avMats.size()-1;
- }
- // adjust the size of the file array
- if (iNum == aiTempSplit.size()) {
- aiTempSplit.push_back(new std::vector<unsigned int>());
- }
- }
- aiTempSplit[iNum]->push_back(iFace);
- }
-
- // now add the newly created materials to the old list
- if (0 == groupInfo.iIndex) {
- splittedGroupData.shared.pcMats.resize(avMats.size());
- for (unsigned int o = 0; o < avMats.size();++o)
- splittedGroupData.shared.pcMats[o] = avMats[o].pcMat;
- }
- else {
- // This might result in redundant materials ...
- splittedGroupData.shared.pcMats.resize(iNumMaterials + avMats.size());
- for (unsigned int o = iNumMaterials; o < avMats.size();++o)
- splittedGroupData.shared.pcMats[o] = avMats[o].pcMat;
- }
-
- // and build the final face-to-material array
- splittedGroupData.aiSplit = new std::vector<unsigned int>*[aiTempSplit.size()];
- for (unsigned int m = 0; m < iNumMaterials;++m)
- splittedGroupData.aiSplit[m] = aiTempSplit[m];
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Read a MDL7 file
-void MDLImporter::InternReadFile_3DGS_MDL7( )
-{
- ai_assert(NULL != pScene);
-
- MDL::IntSharedData_MDL7 sharedData;
-
- // current cursor position in the file
- BE_NCONST MDL::Header_MDL7 *pcHeader = (BE_NCONST MDL::Header_MDL7*)this->mBuffer;
- const unsigned char* szCurrent = (const unsigned char*)(pcHeader+1);
-
- AI_SWAP4(pcHeader->version);
- AI_SWAP4(pcHeader->bones_num);
- AI_SWAP4(pcHeader->groups_num);
- AI_SWAP4(pcHeader->data_size);
- AI_SWAP4(pcHeader->entlump_size);
- AI_SWAP4(pcHeader->medlump_size);
- AI_SWAP2(pcHeader->bone_stc_size);
- AI_SWAP2(pcHeader->skin_stc_size);
- AI_SWAP2(pcHeader->colorvalue_stc_size);
- AI_SWAP2(pcHeader->material_stc_size);
- AI_SWAP2(pcHeader->skinpoint_stc_size);
- AI_SWAP2(pcHeader->triangle_stc_size);
- AI_SWAP2(pcHeader->mainvertex_stc_size);
- AI_SWAP2(pcHeader->framevertex_stc_size);
- AI_SWAP2(pcHeader->bonetrans_stc_size);
- AI_SWAP2(pcHeader->frame_stc_size);
-
- // validate the header of the file. There are some structure
- // sizes that are expected by the loader to be constant
- this->ValidateHeader_3DGS_MDL7(pcHeader);
-
- // load all bones (they are shared by all groups, so
- // we'll need to add them to all groups/meshes later)
- // apcBonesOut is a list of all bones or NULL if they could not been loaded
- szCurrent += pcHeader->bones_num * pcHeader->bone_stc_size;
- sharedData.apcOutBones = this->LoadBones_3DGS_MDL7();
-
- // vector to held all created meshes
- std::vector<aiMesh*>* avOutList;
-
- // 3 meshes per group - that should be OK for most models
- avOutList = new std::vector<aiMesh*>[pcHeader->groups_num];
- for (uint32_t i = 0; i < pcHeader->groups_num;++i)
- avOutList[i].reserve(3);
-
- // buffer to held the names of all groups in the file
- char* aszGroupNameBuffer = new char[AI_MDL7_MAX_GROUPNAMESIZE*pcHeader->groups_num];
-
- // read all groups
- for (unsigned int iGroup = 0; iGroup < (unsigned int)pcHeader->groups_num;++iGroup) {
- MDL::IntGroupInfo_MDL7 groupInfo((BE_NCONST MDL::Group_MDL7*)szCurrent,iGroup);
- szCurrent = (const unsigned char*)(groupInfo.pcGroup+1);
-
- VALIDATE_FILE_SIZE(szCurrent);
-
- AI_SWAP4(groupInfo.pcGroup->groupdata_size);
- AI_SWAP4(groupInfo.pcGroup->numskins);
- AI_SWAP4(groupInfo.pcGroup->num_stpts);
- AI_SWAP4(groupInfo.pcGroup->numtris);
- AI_SWAP4(groupInfo.pcGroup->numverts);
- AI_SWAP4(groupInfo.pcGroup->numframes);
-
- if (1 != groupInfo.pcGroup->typ) {
- // Not a triangle-based mesh
- DefaultLogger::get()->warn("[3DGS MDL7] Not a triangle mesh group. Continuing happily");
- }
-
- // store the name of the group
- const unsigned int ofs = iGroup*AI_MDL7_MAX_GROUPNAMESIZE;
- ::memcpy(&aszGroupNameBuffer[ofs],
- groupInfo.pcGroup->name,AI_MDL7_MAX_GROUPNAMESIZE);
-
- // make sure '\0' is at the end
- aszGroupNameBuffer[ofs+AI_MDL7_MAX_GROUPNAMESIZE-1] = '\0';
-
- // read all skins
- sharedData.pcMats.reserve(sharedData.pcMats.size() + groupInfo.pcGroup->numskins);
- sharedData.abNeedMaterials.resize(sharedData.abNeedMaterials.size() +
- groupInfo.pcGroup->numskins,false);
-
- for (unsigned int iSkin = 0; iSkin < (unsigned int)groupInfo.pcGroup->numskins;++iSkin) {
- ParseSkinLump_3DGS_MDL7(szCurrent,&szCurrent,sharedData.pcMats);
- }
- // if we have absolutely no skin loaded we need to generate a default material
- if (sharedData.pcMats.empty()) {
- const int iMode = (int)aiShadingMode_Gouraud;
- sharedData.pcMats.push_back(new MaterialHelper());
- MaterialHelper* pcHelper = (MaterialHelper*)sharedData.pcMats[0];
- pcHelper->AddProperty<int>(&iMode, 1, AI_MATKEY_SHADING_MODEL);
-
- aiColor3D clr;
- clr.b = clr.g = clr.r = 0.6f;
- pcHelper->AddProperty<aiColor3D>(&clr, 1,AI_MATKEY_COLOR_DIFFUSE);
- pcHelper->AddProperty<aiColor3D>(&clr, 1,AI_MATKEY_COLOR_SPECULAR);
-
- clr.b = clr.g = clr.r = 0.05f;
- pcHelper->AddProperty<aiColor3D>(&clr, 1,AI_MATKEY_COLOR_AMBIENT);
-
- aiString szName;
- szName.Set(AI_DEFAULT_MATERIAL_NAME);
- pcHelper->AddProperty(&szName,AI_MATKEY_NAME);
-
- sharedData.abNeedMaterials.resize(1,false);
- }
-
- // now get a pointer to all texture coords in the group
- groupInfo.pcGroupUVs = (BE_NCONST MDL::TexCoord_MDL7*)szCurrent;
- for(int i = 0; i < groupInfo.pcGroup->num_stpts; ++i){
- AI_SWAP4(groupInfo.pcGroupUVs[i].u);
- AI_SWAP4(groupInfo.pcGroupUVs[i].v);
- }
- szCurrent += pcHeader->skinpoint_stc_size * groupInfo.pcGroup->num_stpts;
-
- // now get a pointer to all triangle in the group
- groupInfo.pcGroupTris = (BE_NCONST MDL::Triangle_MDL7*)szCurrent;
- szCurrent += pcHeader->triangle_stc_size * groupInfo.pcGroup->numtris;
-
- // now get a pointer to all vertices in the group
- groupInfo.pcGroupVerts = (BE_NCONST MDL::Vertex_MDL7*)szCurrent;
- for(int i = 0; i < groupInfo.pcGroup->numverts; ++i){
- AI_SWAP4(groupInfo.pcGroupVerts[i].x);
- AI_SWAP4(groupInfo.pcGroupVerts[i].y);
- AI_SWAP4(groupInfo.pcGroupVerts[i].z);
-
- AI_SWAP2(groupInfo.pcGroupVerts[i].vertindex);
- //We can not swap the normal information now as we don't know which of the two kinds it is
- }
- szCurrent += pcHeader->mainvertex_stc_size * groupInfo.pcGroup->numverts;
- VALIDATE_FILE_SIZE(szCurrent);
-
- MDL::IntSplittedGroupData_MDL7 splittedGroupData(sharedData,avOutList[iGroup]);
- MDL::IntGroupData_MDL7 groupData;
- if (groupInfo.pcGroup->numtris && groupInfo.pcGroup->numverts)
- {
- // build output vectors
- const unsigned int iNumVertices = groupInfo.pcGroup->numtris*3;
- groupData.vPositions.resize(iNumVertices);
- groupData.vNormals.resize(iNumVertices);
-
- if (sharedData.apcOutBones)groupData.aiBones.resize(iNumVertices,0xffffffff);
-
- // it is also possible that there are 0 UV coordinate sets
- if (groupInfo.pcGroup->num_stpts){
- groupData.vTextureCoords1.resize(iNumVertices,aiVector3D());
-
- // check whether the triangle data structure is large enough
- // to contain a second UV coodinate set
- if (pcHeader->triangle_stc_size >= AI_MDL7_TRIANGLE_STD_SIZE_TWO_UV) {
- groupData.vTextureCoords2.resize(iNumVertices,aiVector3D());
- groupData.bNeed2UV = true;
- }
- }
- groupData.pcFaces = new MDL::IntFace_MDL7[groupInfo.pcGroup->numtris];
-
- // read all faces into the preallocated arrays
- ReadFaces_3DGS_MDL7(groupInfo, groupData);
-
- // sort by materials
- SortByMaterials_3DGS_MDL7(groupInfo, groupData,
- splittedGroupData);
-
- for (unsigned int qq = 0; qq < sharedData.pcMats.size();++qq) {
- if (!splittedGroupData.aiSplit[qq]->empty())
- sharedData.abNeedMaterials[qq] = true;
- }
- }
- else DefaultLogger::get()->warn("[3DGS MDL7] Mesh group consists of 0 "
- "vertices or faces. It will be skipped.");
-
- // process all frames and generate output meshes
- ProcessFrames_3DGS_MDL7(groupInfo,groupData, sharedData,szCurrent,&szCurrent);
- GenerateOutputMeshes_3DGS_MDL7(groupData,splittedGroupData);
- }
-
- // generate a nodegraph and subnodes for each group
- pScene->mRootNode = new aiNode();
-
- // now we need to build a final mesh list
- for (uint32_t i = 0; i < pcHeader->groups_num;++i)
- pScene->mNumMeshes += (unsigned int)avOutList[i].size();
-
- pScene->mMeshes = new aiMesh*[pScene->mNumMeshes]; {
- unsigned int p = 0,q = 0;
- for (uint32_t i = 0; i < pcHeader->groups_num;++i) {
- for (unsigned int a = 0; a < avOutList[i].size();++a) {
- pScene->mMeshes[p++] = avOutList[i][a];
- }
- if (!avOutList[i].empty())++pScene->mRootNode->mNumChildren;
- }
- // we will later need an extra node to serve as parent for all bones
- if (sharedData.apcOutBones)++pScene->mRootNode->mNumChildren;
- this->pScene->mRootNode->mChildren = new aiNode*[pScene->mRootNode->mNumChildren];
- p = 0;
- for (uint32_t i = 0; i < pcHeader->groups_num;++i) {
- if (avOutList[i].empty())continue;
-
- aiNode* const pcNode = pScene->mRootNode->mChildren[p] = new aiNode();
- pcNode->mNumMeshes = (unsigned int)avOutList[i].size();
- pcNode->mMeshes = new unsigned int[pcNode->mNumMeshes];
- pcNode->mParent = this->pScene->mRootNode;
- for (unsigned int a = 0; a < pcNode->mNumMeshes;++a)
- pcNode->mMeshes[a] = q + a;
- q += (unsigned int)avOutList[i].size();
-
- // setup the name of the node
- char* const szBuffer = &aszGroupNameBuffer[i*AI_MDL7_MAX_GROUPNAMESIZE];
- if ('\0' == *szBuffer)
- pcNode->mName.length = ::sprintf(szBuffer,"Group_%i",p);
- else pcNode->mName.length = ::strlen(szBuffer);
- ::strcpy(pcNode->mName.data,szBuffer);
- ++p;
- }
- }
-
- // if there is only one root node with a single child we can optimize it a bit ...
- if (1 == pScene->mRootNode->mNumChildren && !sharedData.apcOutBones) {
- aiNode* pcOldRoot = this->pScene->mRootNode;
- pScene->mRootNode = pcOldRoot->mChildren[0];
- pcOldRoot->mChildren[0] = NULL;
- delete pcOldRoot;
- pScene->mRootNode->mParent = NULL;
- }
- else pScene->mRootNode->mName.Set("<mesh_root>");
-
- delete[] avOutList;
- delete[] aszGroupNameBuffer;
- AI_DEBUG_INVALIDATE_PTR(avOutList);
- AI_DEBUG_INVALIDATE_PTR(aszGroupNameBuffer);
-
- // build a final material list.
- CopyMaterials_3DGS_MDL7(sharedData);
- HandleMaterialReferences_3DGS_MDL7();
-
- // generate output bone animations and add all bones to the scenegraph
- if (sharedData.apcOutBones) {
- // this step adds empty dummy bones to the nodegraph
- // insert another dummy node to avoid name conflicts
- aiNode* const pc = pScene->mRootNode->mChildren[pScene->mRootNode->mNumChildren-1] = new aiNode();
-
- pc->mName.Set("<skeleton_root>");
-
- // add bones to the nodegraph
- AddBonesToNodeGraph_3DGS_MDL7((const Assimp::MDL::IntBone_MDL7 **)
- sharedData.apcOutBones,pc,0xffff);
-
- // this steps build a valid output animation
- BuildOutputAnims_3DGS_MDL7((const Assimp::MDL::IntBone_MDL7 **)
- sharedData.apcOutBones);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Copy materials
-void MDLImporter::CopyMaterials_3DGS_MDL7(MDL::IntSharedData_MDL7 &shared)
-{
- pScene->mNumMaterials = (unsigned int)shared.pcMats.size();
- pScene->mMaterials = new aiMaterial*[pScene->mNumMaterials];
- for (unsigned int i = 0; i < pScene->mNumMaterials;++i)
- pScene->mMaterials[i] = shared.pcMats[i];
-}
-
-
-// ------------------------------------------------------------------------------------------------
-// Process material references
-void MDLImporter::HandleMaterialReferences_3DGS_MDL7()
-{
- // search for referrer materials
- for (unsigned int i = 0; i < pScene->mNumMaterials;++i) {
- int iIndex = 0;
- if (AI_SUCCESS == aiGetMaterialInteger(pScene->mMaterials[i],AI_MDL7_REFERRER_MATERIAL, &iIndex) ) {
- for (unsigned int a = 0; a < pScene->mNumMeshes;++a) {
- aiMesh* const pcMesh = pScene->mMeshes[a];
- if (i == pcMesh->mMaterialIndex) {
- pcMesh->mMaterialIndex = iIndex;
- }
- }
- // collapse the rest of the array
- delete pScene->mMaterials[i];
- for (unsigned int pp = i; pp < pScene->mNumMaterials-1;++pp) {
-
- pScene->mMaterials[pp] = pScene->mMaterials[pp+1];
- for (unsigned int a = 0; a < pScene->mNumMeshes;++a) {
- aiMesh* const pcMesh = pScene->mMeshes[a];
- if (pcMesh->mMaterialIndex > i)--pcMesh->mMaterialIndex;
- }
- }
- --pScene->mNumMaterials;
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Read bone transformation keys
-void MDLImporter::ParseBoneTrafoKeys_3DGS_MDL7(
- const MDL::IntGroupInfo_MDL7& groupInfo,
- IntFrameInfo_MDL7& frame,
- MDL::IntSharedData_MDL7& shared)
-{
- const MDL::Header_MDL7* const pcHeader = (const MDL::Header_MDL7*)this->mBuffer;
-
- // only the first group contains bone animation keys
- if (frame.pcFrame->transmatrix_count) {
- if (!groupInfo.iIndex) {
- // skip all frames vertices. We can't support them
- const MDL::BoneTransform_MDL7* pcBoneTransforms = (const MDL::BoneTransform_MDL7*)
- (((const char*)frame.pcFrame) + pcHeader->frame_stc_size +
- frame.pcFrame->vertices_count * pcHeader->framevertex_stc_size);
-
- // read all transformation matrices
- for (unsigned int iTrafo = 0; iTrafo < frame.pcFrame->transmatrix_count;++iTrafo) {
- if(pcBoneTransforms->bone_index >= pcHeader->bones_num) {
- DefaultLogger::get()->warn("Index overflow in frame area. "
- "Unable to parse this bone transformation");
- }
- else {
- AddAnimationBoneTrafoKey_3DGS_MDL7(frame.iIndex,
- pcBoneTransforms,shared.apcOutBones);
- }
- pcBoneTransforms = (const MDL::BoneTransform_MDL7*)(
- (const char*)pcBoneTransforms + pcHeader->bonetrans_stc_size);
- }
- }
- else {
- DefaultLogger::get()->warn("Ignoring animation keyframes in groups != 0");
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Attach bones to the output nodegraph
-void MDLImporter::AddBonesToNodeGraph_3DGS_MDL7(const MDL::IntBone_MDL7** apcBones,
- aiNode* pcParent,uint16_t iParentIndex)
-{
- ai_assert(NULL != apcBones && NULL != pcParent);
-
- // get a pointer to the header ...
- const MDL::Header_MDL7* const pcHeader = (const MDL::Header_MDL7*)this->mBuffer;
-
- const MDL::IntBone_MDL7** apcBones2 = apcBones;
- for (uint32_t i = 0; i < pcHeader->bones_num;++i) {
-
- const MDL::IntBone_MDL7* const pcBone = *apcBones2++;
- if (pcBone->iParent == iParentIndex) {
- ++pcParent->mNumChildren;
- }
- }
- pcParent->mChildren = new aiNode*[pcParent->mNumChildren];
- unsigned int qq = 0;
- for (uint32_t i = 0; i < pcHeader->bones_num;++i) {
-
- const MDL::IntBone_MDL7* const pcBone = *apcBones++;
- if (pcBone->iParent != iParentIndex)continue;
-
- aiNode* pcNode = pcParent->mChildren[qq++] = new aiNode();
- pcNode->mName = aiString( pcBone->mName );
-
- AddBonesToNodeGraph_3DGS_MDL7(apcBones,pcNode,(uint16_t)i);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Build output animations
-void MDLImporter::BuildOutputAnims_3DGS_MDL7(
- const MDL::IntBone_MDL7** apcBonesOut)
-{
- ai_assert(NULL != apcBonesOut);
- const MDL::Header_MDL7* const pcHeader = (const MDL::Header_MDL7*)mBuffer;
-
- // one animation ...
- aiAnimation* pcAnim = new aiAnimation();
- for (uint32_t i = 0; i < pcHeader->bones_num;++i) {
- if (!apcBonesOut[i]->pkeyPositions.empty()) {
-
- // get the last frame ... (needn't be equal to pcHeader->frames_num)
- for (size_t qq = 0; qq < apcBonesOut[i]->pkeyPositions.size();++qq) {
- pcAnim->mDuration = std::max(pcAnim->mDuration, (double)
- apcBonesOut[i]->pkeyPositions[qq].mTime);
- }
- ++pcAnim->mNumChannels;
- }
- }
- if (pcAnim->mDuration) {
- pcAnim->mChannels = new aiNodeAnim*[pcAnim->mNumChannels];
-
- unsigned int iCnt = 0;
- for (uint32_t i = 0; i < pcHeader->bones_num;++i) {
- if (!apcBonesOut[i]->pkeyPositions.empty()) {
- const MDL::IntBone_MDL7* const intBone = apcBonesOut[i];
-
- aiNodeAnim* const pcNodeAnim = pcAnim->mChannels[iCnt++] = new aiNodeAnim();
- pcNodeAnim->mNodeName = aiString( intBone->mName );
-
- // allocate enough storage for all keys
- pcNodeAnim->mNumPositionKeys = (unsigned int)intBone->pkeyPositions.size();
- pcNodeAnim->mNumScalingKeys = (unsigned int)intBone->pkeyPositions.size();
- pcNodeAnim->mNumRotationKeys = (unsigned int)intBone->pkeyPositions.size();
-
- pcNodeAnim->mPositionKeys = new aiVectorKey[pcNodeAnim->mNumPositionKeys];
- pcNodeAnim->mScalingKeys = new aiVectorKey[pcNodeAnim->mNumPositionKeys];
- pcNodeAnim->mRotationKeys = new aiQuatKey[pcNodeAnim->mNumPositionKeys];
-
- // copy all keys
- for (unsigned int qq = 0; qq < pcNodeAnim->mNumPositionKeys;++qq) {
- pcNodeAnim->mPositionKeys[qq] = intBone->pkeyPositions[qq];
- pcNodeAnim->mScalingKeys[qq] = intBone->pkeyScalings[qq];
- pcNodeAnim->mRotationKeys[qq] = intBone->pkeyRotations[qq];
- }
- }
- }
-
- // store the output animation
- pScene->mNumAnimations = 1;
- pScene->mAnimations = new aiAnimation*[1];
- pScene->mAnimations[0] = pcAnim;
- }
- else delete pcAnim;
-}
-
-// ------------------------------------------------------------------------------------------------
-void MDLImporter::AddAnimationBoneTrafoKey_3DGS_MDL7(unsigned int iTrafo,
- const MDL::BoneTransform_MDL7* pcBoneTransforms,
- MDL::IntBone_MDL7** apcBonesOut)
-{
- ai_assert(NULL != pcBoneTransforms);
- ai_assert(NULL != apcBonesOut);
-
- // first .. get the transformation matrix
- aiMatrix4x4 mTransform;
- mTransform.a1 = pcBoneTransforms->m[0];
- mTransform.b1 = pcBoneTransforms->m[1];
- mTransform.c1 = pcBoneTransforms->m[2];
- mTransform.d1 = pcBoneTransforms->m[3];
-
- mTransform.a2 = pcBoneTransforms->m[4];
- mTransform.b2 = pcBoneTransforms->m[5];
- mTransform.c2 = pcBoneTransforms->m[6];
- mTransform.d2 = pcBoneTransforms->m[7];
-
- mTransform.a3 = pcBoneTransforms->m[8];
- mTransform.b3 = pcBoneTransforms->m[9];
- mTransform.c3 = pcBoneTransforms->m[10];
- mTransform.d3 = pcBoneTransforms->m[11];
-
- // now decompose the transformation matrix into separate
- // scaling, rotation and translation
- aiVectorKey vScaling,vPosition;
- aiQuatKey qRotation;
-
- // FIXME: Decompose will assert in debug builds if the matrix is invalid ...
- mTransform.Decompose(vScaling.mValue,qRotation.mValue,vPosition.mValue);
-
- // now generate keys
- vScaling.mTime = qRotation.mTime = vPosition.mTime = (double)iTrafo;
-
- // add the keys to the bone
- MDL::IntBone_MDL7* const pcBoneOut = apcBonesOut[pcBoneTransforms->bone_index];
- pcBoneOut->pkeyPositions.push_back ( vPosition );
- pcBoneOut->pkeyScalings.push_back ( vScaling );
- pcBoneOut->pkeyRotations.push_back ( qRotation );
-}
-
-// ------------------------------------------------------------------------------------------------
-// Construct output meshes
-void MDLImporter::GenerateOutputMeshes_3DGS_MDL7(
- MDL::IntGroupData_MDL7& groupData,
- MDL::IntSplittedGroupData_MDL7& splittedGroupData)
-{
- const MDL::IntSharedData_MDL7& shared = splittedGroupData.shared;
-
- // get a pointer to the header ...
- const MDL::Header_MDL7* const pcHeader = (const MDL::Header_MDL7*)this->mBuffer;
- const unsigned int iNumOutBones = pcHeader->bones_num;
-
- for (std::vector<MaterialHelper*>::size_type i = 0; i < shared.pcMats.size();++i) {
- if (!splittedGroupData.aiSplit[i]->empty()) {
-
- // allocate the output mesh
- aiMesh* pcMesh = new aiMesh();
-
- pcMesh->mPrimitiveTypes = aiPrimitiveType_TRIANGLE;
- pcMesh->mMaterialIndex = (unsigned int)i;
-
- // allocate output storage
- pcMesh->mNumFaces = (unsigned int)splittedGroupData.aiSplit[i]->size();
- pcMesh->mFaces = new aiFace[pcMesh->mNumFaces];
-
- pcMesh->mNumVertices = pcMesh->mNumFaces*3;
- pcMesh->mVertices = new aiVector3D[pcMesh->mNumVertices];
- pcMesh->mNormals = new aiVector3D[pcMesh->mNumVertices];
-
- if (!groupData.vTextureCoords1.empty()) {
- pcMesh->mNumUVComponents[0] = 2;
- pcMesh->mTextureCoords[0] = new aiVector3D[pcMesh->mNumVertices];
- if (!groupData.vTextureCoords2.empty()) {
- pcMesh->mNumUVComponents[1] = 2;
- pcMesh->mTextureCoords[1] = new aiVector3D[pcMesh->mNumVertices];
- }
- }
-
- // iterate through all faces and build an unique set of vertices
- unsigned int iCurrent = 0;
- for (unsigned int iFace = 0; iFace < pcMesh->mNumFaces;++iFace) {
- pcMesh->mFaces[iFace].mNumIndices = 3;
- pcMesh->mFaces[iFace].mIndices = new unsigned int[3];
-
- unsigned int iSrcFace = splittedGroupData.aiSplit[i]->operator[](iFace);
- const MDL::IntFace_MDL7& oldFace = groupData.pcFaces[iSrcFace];
-
- // iterate through all face indices
- for (unsigned int c = 0; c < 3;++c) {
- const uint32_t iIndex = oldFace.mIndices[c];
- pcMesh->mVertices[iCurrent] = groupData.vPositions[iIndex];
- pcMesh->mNormals[iCurrent] = groupData.vNormals[iIndex];
-
- if (!groupData.vTextureCoords1.empty()) {
-
- pcMesh->mTextureCoords[0][iCurrent] = groupData.vTextureCoords1[iIndex];
- if (!groupData.vTextureCoords2.empty()) {
- pcMesh->mTextureCoords[1][iCurrent] = groupData.vTextureCoords2[iIndex];
- }
- }
- pcMesh->mFaces[iFace].mIndices[c] = iCurrent++;
- }
- }
-
- // if we have bones in the mesh we'll need to generate
- // proper vertex weights for them
- if (!groupData.aiBones.empty()) {
- std::vector<std::vector<unsigned int> > aaiVWeightList;
- aaiVWeightList.resize(iNumOutBones);
-
- int iCurrent = 0;
- for (unsigned int iFace = 0; iFace < pcMesh->mNumFaces;++iFace) {
- unsigned int iSrcFace = splittedGroupData.aiSplit[i]->operator[](iFace);
- const MDL::IntFace_MDL7& oldFace = groupData.pcFaces[iSrcFace];
-
- // iterate through all face indices
- for (unsigned int c = 0; c < 3;++c) {
- unsigned int iBone = groupData.aiBones[ oldFace.mIndices[c] ];
- if (0xffffffff != iBone) {
- if (iBone >= iNumOutBones) {
- DefaultLogger::get()->error("Bone index overflow. "
- "The bone index of a vertex exceeds the allowed range. ");
- iBone = iNumOutBones-1;
- }
- aaiVWeightList[ iBone ].push_back ( iCurrent );
- }
- ++iCurrent;
- }
- }
- // now check which bones are required ...
- for (std::vector<std::vector<unsigned int> >::const_iterator k = aaiVWeightList.begin();k != aaiVWeightList.end();++k) {
- if (!(*k).empty()) {
- ++pcMesh->mNumBones;
- }
- }
- pcMesh->mBones = new aiBone*[pcMesh->mNumBones];
- iCurrent = 0;
- for (std::vector<std::vector<unsigned int> >::const_iterator k = aaiVWeightList.begin();k!= aaiVWeightList.end();++k,++iCurrent)
- {
- if ((*k).empty())
- continue;
-
- // seems we'll need this node
- aiBone* pcBone = pcMesh->mBones[ iCurrent ] = new aiBone();
- pcBone->mName = aiString(shared.apcOutBones[ iCurrent ]->mName);
- pcBone->mOffsetMatrix = shared.apcOutBones[ iCurrent ]->mOffsetMatrix;
-
- // setup vertex weights
- pcBone->mNumWeights = (unsigned int)(*k).size();
- pcBone->mWeights = new aiVertexWeight[pcBone->mNumWeights];
-
- for (unsigned int weight = 0; weight < pcBone->mNumWeights;++weight) {
- pcBone->mWeights[weight].mVertexId = (*k)[weight];
- pcBone->mWeights[weight].mWeight = 1.0f;
- }
- }
- }
- // add the mesh to the list of output meshes
- splittedGroupData.avOutList.push_back(pcMesh);
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Join to materials
-void MDLImporter::JoinSkins_3DGS_MDL7(
- MaterialHelper* pcMat1,
- MaterialHelper* pcMat2,
- MaterialHelper* pcMatOut)
-{
- ai_assert(NULL != pcMat1 && NULL != pcMat2 && NULL != pcMatOut);
-
- // first create a full copy of the first skin property set
- // and assign it to the output material
- MaterialHelper::CopyPropertyList(pcMatOut,pcMat1);
-
- int iVal = 0;
- pcMatOut->AddProperty<int>(&iVal,1,AI_MATKEY_UVWSRC_DIFFUSE(0));
-
- // then extract the diffuse texture from the second skin,
- // setup 1 as UV source and we have it
- aiString sString;
- if(AI_SUCCESS == aiGetMaterialString ( pcMat2, AI_MATKEY_TEXTURE_DIFFUSE(0),&sString )) {
- iVal = 1;
- pcMatOut->AddProperty<int>(&iVal,1,AI_MATKEY_UVWSRC_DIFFUSE(1));
- pcMatOut->AddProperty(&sString,AI_MATKEY_TEXTURE_DIFFUSE(1));
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Read a half-life 2 MDL
-void MDLImporter::InternReadFile_HL2( )
-{
- //const MDL::Header_HL2* pcHeader = (const MDL::Header_HL2*)this->mBuffer;
- throw DeadlyImportError("HL2 MDLs are not implemented");
-}
-
-#endif // !! ASSIMP_BUILD_NO_MDL_IMPORTER
diff --git a/3rdparty/assimp/code/MDLLoader.h b/3rdparty/assimp/code/MDLLoader.h
deleted file mode 100644
index 34c101fc..00000000
--- a/3rdparty/assimp/code/MDLLoader.h
+++ /dev/null
@@ -1,460 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-
-/** @file MDLLoader.h
- * @brief Declaration of the loader for MDL files
- */
-
-#ifndef AI_MDLLOADER_H_INCLUDED
-#define AI_MDLLOADER_H_INCLUDED
-
-#include "BaseImporter.h"
-
-struct aiNode;
-#include "MDLFileData.h"
-#include "HalfLifeFileData.h"
-
-namespace Assimp {
-class MaterialHelper;
-
-using namespace MDL;
-
-// --------------------------------------------------------------------------------------
-// Include file/line information in debug builds
-#ifdef ASSIMP_BUILD_DEBUG
-# define VALIDATE_FILE_SIZE(msg) SizeCheck(msg,__FILE__,__LINE__)
-#else
-# define VALIDATE_FILE_SIZE(msg) SizeCheck(msg)
-#endif
-
-// --------------------------------------------------------------------------------------
-/** @brief Class to load MDL files.
- *
- * Several subformats exist:
- * <ul>
- * <li>Quake I</li>
- * <li>3D Game Studio MDL3, MDL4</li>
- * <li>3D Game Studio MDL5</li>
- * <li>3D Game Studio MDL7</li>
- * <li>Halflife 2</li>
- * </ul>
- * These formats are partially identical and it would be possible to load
- * them all with a single 1000-line function-beast. However, it has been
- * splitted to several code paths to make the code easier to read and maintain.
-*/
-class MDLImporter : public BaseImporter
-{
- friend class Importer;
-
-protected:
- /** Constructor to be privately used by Importer */
- MDLImporter();
-
- /** Destructor, private as well */
- ~MDLImporter();
-
-public:
-
- // -------------------------------------------------------------------
- /** Returns whether the class can handle the format of the given file.
- * See BaseImporter::CanRead() for details. */
- bool CanRead( const std::string& pFile, IOSystem* pIOHandler,
- bool checkSig) const;
-
-
- // -------------------------------------------------------------------
- /** Called prior to ReadFile().
- * The function is a request to the importer to update its configuration
- * basing on the Importer's configuration property list.
- */
- void SetupProperties(const Importer* pImp);
-
-protected:
-
-
- // -------------------------------------------------------------------
- /** Called by Importer::GetExtensionList() for each loaded importer.
- * See BaseImporter::GetExtensionList() for details
- */
- void GetExtensionList(std::set<std::string>& extensions);
-
- // -------------------------------------------------------------------
- /** Imports the given file into the given scene structure.
- * See BaseImporter::InternReadFile() for details
- */
- void InternReadFile( const std::string& pFile, aiScene* pScene,
- IOSystem* pIOHandler);
-
-protected:
-
- // -------------------------------------------------------------------
- /** Import a quake 1 MDL file (IDPO)
- */
- void InternReadFile_Quake1( );
-
- // -------------------------------------------------------------------
- /** Import a GameStudio A4/A5 file (MDL 3,4,5)
- */
- void InternReadFile_3DGS_MDL345( );
-
- // -------------------------------------------------------------------
- /** Import a GameStudio A7 file (MDL 7)
- */
- void InternReadFile_3DGS_MDL7( );
-
- // -------------------------------------------------------------------
- /** Import a CS:S/HL2 MDL file (not fully implemented)
- */
- void InternReadFile_HL2( );
-
- // -------------------------------------------------------------------
- /** Check whether a given position is inside the valid range
- * Throw a DeadlyImportError if it is not
- * \param szPos Cursor position
- * \param szFile Name of the source file from which the function was called
- * \param iLine Source code line from which the function was called
- */
- void SizeCheck(const void* szPos);
- void SizeCheck(const void* szPos, const char* szFile, unsigned int iLine);
-
-
- // -------------------------------------------------------------------
- /** Validate the header data structure of a game studio MDL7 file
- * \param pcHeader Input header to be validated
- */
- void ValidateHeader_3DGS_MDL7(const MDL::Header_MDL7* pcHeader);
-
- // -------------------------------------------------------------------
- /** Validate the header data structure of a Quake 1 model
- * \param pcHeader Input header to be validated
- */
- void ValidateHeader_Quake1(const MDL::Header* pcHeader);
-
-
- // -------------------------------------------------------------------
- /** Try to load a palette from the current directory (colormap.lmp)
- * If it is not found the default palette of Quake1 is returned
- */
- void SearchPalette(const unsigned char** pszColorMap);
-
- // -------------------------------------------------------------------
- /** Free a palette created with a previous call to SearchPalette()
- */
- void FreePalette(const unsigned char* pszColorMap);
-
-
- // -------------------------------------------------------------------
- /** Load a paletized texture from the file and convert it to 32bpp
- */
- void CreateTextureARGB8_3DGS_MDL3(const unsigned char* szData);
-
- // -------------------------------------------------------------------
- /** Used to load textures from MDL3/4
- * \param szData Input data
- * \param iType Color data type
- * \param piSkip Receive: Size to skip, in bytes
- */
- void CreateTexture_3DGS_MDL4(const unsigned char* szData,
- unsigned int iType,
- unsigned int* piSkip);
-
-
- // -------------------------------------------------------------------
- /** Used to load textures from MDL5
- * \param szData Input data
- * \param iType Color data type
- * \param piSkip Receive: Size to skip, in bytes
- */
- void CreateTexture_3DGS_MDL5(const unsigned char* szData,
- unsigned int iType,
- unsigned int* piSkip);
-
-
- // -------------------------------------------------------------------
- /** Checks whether a texture can be replaced with a single color
- * This is useful for all file formats before MDL7 (all those
- * that are not containing material colors separate from textures).
- * MED seems to write dummy 8x8 monochrome images instead.
- * \param pcTexture Input texture
- * \return aiColor.r is set to qnan if the function fails and no
- * color can be found.
- */
- aiColor4D ReplaceTextureWithColor(const aiTexture* pcTexture);
-
-
- // -------------------------------------------------------------------
- /** Converts the absolute texture coordinates in MDL5 files to
- * relative in a range between 0 and 1
- */
- void CalculateUVCoordinates_MDL5();
-
-
- // -------------------------------------------------------------------
- /** Read an UV coordinate from the file. If the file format is not
- * MDL5, the function calculates relative texture coordinates
- * \param vOut Receives the output UV coord
- * \param pcSrc UV coordinate buffer
- * \param UV coordinate index
- */
- void ImportUVCoordinate_3DGS_MDL345( aiVector3D& vOut,
- const MDL::TexCoord_MDL3* pcSrc,
- unsigned int iIndex);
-
- // -------------------------------------------------------------------
- /** Setup the material properties for Quake and MDL<7 models.
- * These formats don't support more than one material per mesh,
- * therefore the method processes only ONE skin and removes
- * all others.
- */
- void SetupMaterialProperties_3DGS_MDL5_Quake1( );
-
-
- // -------------------------------------------------------------------
- /** Parse a skin lump in a MDL7/HMP7 file with all of its features
- * variant 1: Current cursor position is the beginning of the skin header
- * \param szCurrent Current data pointer
- * \param szCurrentOut Output data pointer
- * \param pcMats Material list for this group. To be filled ...
- */
- void ParseSkinLump_3DGS_MDL7(
- const unsigned char* szCurrent,
- const unsigned char** szCurrentOut,
- std::vector<MaterialHelper*>& pcMats);
-
- // -------------------------------------------------------------------
- /** Parse a skin lump in a MDL7/HMP7 file with all of its features
- * variant 2: Current cursor position is the beginning of the skin data
- * \param szCurrent Current data pointer
- * \param szCurrentOut Output data pointer
- * \param pcMatOut Output material
- * \param iType header.typ
- * \param iWidth header.width
- * \param iHeight header.height
- */
- void ParseSkinLump_3DGS_MDL7(
- const unsigned char* szCurrent,
- const unsigned char** szCurrentOut,
- MaterialHelper* pcMatOut,
- unsigned int iType,
- unsigned int iWidth,
- unsigned int iHeight);
-
- // -------------------------------------------------------------------
- /** Skip a skin lump in a MDL7/HMP7 file
- * \param szCurrent Current data pointer
- * \param szCurrentOut Output data pointer. Points to the byte just
- * behind the last byte of the skin.
- * \param iType header.typ
- * \param iWidth header.width
- * \param iHeight header.height
- */
- void SkipSkinLump_3DGS_MDL7(const unsigned char* szCurrent,
- const unsigned char** szCurrentOut,
- unsigned int iType,
- unsigned int iWidth,
- unsigned int iHeight);
-
- // -------------------------------------------------------------------
- /** Parse texture color data for MDL5, MDL6 and MDL7 formats
- * \param szData Current data pointer
- * \param iType type of the texture data. No DDS or external
- * \param piSkip Receive the number of bytes to skip
- * \param pcNew Must point to fully initialized data. Width and
- * height must be set. If pcNew->pcData is set to 0xffffffff,
- * piSkip will receive the size of the texture, in bytes, but no
- * color data will be read.
- */
- void ParseTextureColorData(const unsigned char* szData,
- unsigned int iType,
- unsigned int* piSkip,
- aiTexture* pcNew);
-
- // -------------------------------------------------------------------
- /** Join two materials / skins. Setup UV source ... etc
- * \param pcMat1 First input material
- * \param pcMat2 Second input material
- * \param pcMatOut Output material instance to be filled. Must be empty
- */
- void JoinSkins_3DGS_MDL7(MaterialHelper* pcMat1,
- MaterialHelper* pcMat2,
- MaterialHelper* pcMatOut);
-
- // -------------------------------------------------------------------
- /** Add a bone transformation key to an animation
- * \param iTrafo Index of the transformation (always==frame index?)
- * No need to validate this index, it is always valid.
- * \param pcBoneTransforms Bone transformation for this index
- * \param apcOutBones Output bones array
- */
- void AddAnimationBoneTrafoKey_3DGS_MDL7(unsigned int iTrafo,
- const MDL::BoneTransform_MDL7* pcBoneTransforms,
- MDL::IntBone_MDL7** apcBonesOut);
-
- // -------------------------------------------------------------------
- /** Load the bone list of a MDL7 file
- * \return If the bones could be loaded successfully, a valid
- * array containing pointers to a temporary bone
- * representation. NULL if the bones could not be loaded.
- */
- MDL::IntBone_MDL7** LoadBones_3DGS_MDL7();
-
- // -------------------------------------------------------------------
- /** Load bone transformation keyframes from a file chunk
- * \param groupInfo -> doc of data structure
- * \param frame -> doc of data structure
- * \param shared -> doc of data structure
- */
- void ParseBoneTrafoKeys_3DGS_MDL7(
- const MDL::IntGroupInfo_MDL7& groupInfo,
- IntFrameInfo_MDL7& frame,
- MDL::IntSharedData_MDL7& shared);
-
- // -------------------------------------------------------------------
- /** Calculate absolute bone animation matrices for each bone
- * \param apcOutBones Output bones array
- */
- void CalcAbsBoneMatrices_3DGS_MDL7(MDL::IntBone_MDL7** apcOutBones);
-
- // -------------------------------------------------------------------
- /** Add all bones to the nodegraph (as children of the root node)
- * \param apcBonesOut List of bones
- * \param pcParent Parent node. New nodes will be added to this node
- * \param iParentIndex Index of the parent bone
- */
- void AddBonesToNodeGraph_3DGS_MDL7(const MDL::IntBone_MDL7** apcBonesOut,
- aiNode* pcParent,uint16_t iParentIndex);
-
- // -------------------------------------------------------------------
- /** Build output animations
- * \param apcBonesOut List of bones
- */
- void BuildOutputAnims_3DGS_MDL7(const MDL::IntBone_MDL7** apcBonesOut);
-
- // -------------------------------------------------------------------
- /** Handles materials that are just referencing another material
- * There is no test file for this feature, but Conitec's doc
- * say it is used.
- */
- void HandleMaterialReferences_3DGS_MDL7();
-
- // -------------------------------------------------------------------
- /** Copies only the material that are referenced by at least one
- * mesh to the final output material list. All other materials
- * will be discarded.
- * \param shared -> doc of data structure
- */
- void CopyMaterials_3DGS_MDL7(MDL::IntSharedData_MDL7 &shared);
-
- // -------------------------------------------------------------------
- /** Process the frame section at the end of a group
- * \param groupInfo -> doc of data structure
- * \param shared -> doc of data structure
- * \param szCurrent Pointer to the start of the frame section
- * \param szCurrentOut Receives a pointer to the first byte of the
- * next data section.
- * \return false to read no further groups (a small workaround for
- * some tiny and unsolved problems ... )
- */
- bool ProcessFrames_3DGS_MDL7(const MDL::IntGroupInfo_MDL7& groupInfo,
- MDL::IntGroupData_MDL7& groupData,
- MDL::IntSharedData_MDL7& shared,
- const unsigned char* szCurrent,
- const unsigned char** szCurrentOut);
-
- // -------------------------------------------------------------------
- /** Sort all faces by their materials. If the mesh is using
- * multiple materials per face (that are blended together) the function
- * might create new materials.
- * \param groupInfo -> doc of data structure
- * \param groupData -> doc of data structure
- * \param splittedGroupData -> doc of data structure
- */
- void SortByMaterials_3DGS_MDL7(
- const MDL::IntGroupInfo_MDL7& groupInfo,
- MDL::IntGroupData_MDL7& groupData,
- MDL::IntSplittedGroupData_MDL7& splittedGroupData);
-
- // -------------------------------------------------------------------
- /** Read all faces and vertices from a MDL7 group. The function fills
- * preallocated memory buffers.
- * \param groupInfo -> doc of data structure
- * \param groupData -> doc of data structure
- */
- void ReadFaces_3DGS_MDL7(const MDL::IntGroupInfo_MDL7& groupInfo,
- MDL::IntGroupData_MDL7& groupData);
-
- // -------------------------------------------------------------------
- /** Generate the final output meshes for a7 models
- * \param groupData -> doc of data structure
- * \param splittedGroupData -> doc of data structure
- */
- void GenerateOutputMeshes_3DGS_MDL7(
- MDL::IntGroupData_MDL7& groupData,
- MDL::IntSplittedGroupData_MDL7& splittedGroupData);
-
-protected:
-
- /** Configuration option: frame to be loaded */
- unsigned int configFrameID;
-
- /** Configuration option: palette to be used to decode palletized images*/
- std::string configPalette;
-
- /** Buffer to hold the loaded file */
- unsigned char* mBuffer;
-
- /** For GameStudio MDL files: The number in the magic word, either 3,4 or 5
- * (MDL7 doesn't need this, the format has a separate loader) */
- unsigned int iGSFileVersion;
-
- /** Output I/O handler. used to load external lmp files */
- IOSystem* pIOHandler;
-
- /** Output scene to be filled */
- aiScene* pScene;
-
- /** Size of the input file in bytes */
- unsigned int iFileSize;
-};
-
-} // end of namespace Assimp
-
-#endif // AI_3DSIMPORTER_H_INC
diff --git a/3rdparty/assimp/code/MDLMaterialLoader.cpp b/3rdparty/assimp/code/MDLMaterialLoader.cpp
deleted file mode 100644
index 5ed30c30..00000000
--- a/3rdparty/assimp/code/MDLMaterialLoader.cpp
+++ /dev/null
@@ -1,823 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file Implementation of the material part of the MDL importer class */
-
-#include "AssimpPCH.h"
-#ifndef ASSIMP_BUILD_NO_MDL_IMPORTER
-
-// internal headers
-#include "MDLLoader.h"
-#include "MDLDefaultColorMap.h"
-
-using namespace Assimp;
-
-// ------------------------------------------------------------------------------------------------
-// Find a suitable pallette file or take teh default one
-void MDLImporter::SearchPalette(const unsigned char** pszColorMap)
-{
- // now try to find the color map in the current directory
- IOStream* pcStream = pIOHandler->Open(configPalette,"rb");
-
- const unsigned char* szColorMap = (const unsigned char*)::g_aclrDefaultColorMap;
- if (pcStream)
- {
- if (pcStream->FileSize() >= 768)
- {
- szColorMap = new unsigned char[256*3];
- pcStream->Read(const_cast<unsigned char*>(szColorMap),256*3,1);
-
- DefaultLogger::get()->info("Found valid colormap.lmp in directory. "
- "It will be used to decode embedded textures in palletized formats.");
- }
- delete pcStream;
- pcStream = NULL;
- }
- *pszColorMap = szColorMap;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Free the palette again
-void MDLImporter::FreePalette(const unsigned char* szColorMap)
-{
- if (szColorMap != (const unsigned char*)::g_aclrDefaultColorMap)
- delete[] szColorMap;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Check whether we can replace a texture with a single color
-aiColor4D MDLImporter::ReplaceTextureWithColor(const aiTexture* pcTexture)
-{
- ai_assert(NULL != pcTexture);
-
- aiColor4D clrOut;
- clrOut.r = get_qnan();
- if (!pcTexture->mHeight || !pcTexture->mWidth)
- return clrOut;
-
- const unsigned int iNumPixels = pcTexture->mHeight*pcTexture->mWidth;
- const aiTexel* pcTexel = pcTexture->pcData+1;
- const aiTexel* const pcTexelEnd = &pcTexture->pcData[iNumPixels];
-
- while (pcTexel != pcTexelEnd)
- {
- if (*pcTexel != *(pcTexel-1))
- {
- pcTexel = NULL;
- break;
- }
- ++pcTexel;
- }
- if (pcTexel)
- {
- clrOut.r = pcTexture->pcData->r / 255.0f;
- clrOut.g = pcTexture->pcData->g / 255.0f;
- clrOut.b = pcTexture->pcData->b / 255.0f;
- clrOut.a = pcTexture->pcData->a / 255.0f;
- }
- return clrOut;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Read a texture from a MDL3 file
-void MDLImporter::CreateTextureARGB8_3DGS_MDL3(const unsigned char* szData)
-{
- const MDL::Header *pcHeader = (const MDL::Header*)mBuffer; //the endianess is allready corrected in the InternReadFile_3DGS_MDL345 function
-
- VALIDATE_FILE_SIZE(szData + pcHeader->skinwidth *
- pcHeader->skinheight);
-
- // allocate a new texture object
- aiTexture* pcNew = new aiTexture();
- pcNew->mWidth = pcHeader->skinwidth;
- pcNew->mHeight = pcHeader->skinheight;
-
- pcNew->pcData = new aiTexel[pcNew->mWidth * pcNew->mHeight];
-
- const unsigned char* szColorMap;
- this->SearchPalette(&szColorMap);
-
- // copy texture data
- for (unsigned int i = 0; i < pcNew->mWidth*pcNew->mHeight;++i)
- {
- const unsigned char val = szData[i];
- const unsigned char* sz = &szColorMap[val*3];
-
- pcNew->pcData[i].a = 0xFF;
- pcNew->pcData[i].r = *sz++;
- pcNew->pcData[i].g = *sz++;
- pcNew->pcData[i].b = *sz;
- }
-
- FreePalette(szColorMap);
-
- // store the texture
- aiTexture** pc = this->pScene->mTextures;
- this->pScene->mTextures = new aiTexture*[pScene->mNumTextures+1];
- for (unsigned int i = 0; i <pScene->mNumTextures;++i)
- pScene->mTextures[i] = pc[i];
-
- pScene->mTextures[this->pScene->mNumTextures] = pcNew;
- pScene->mNumTextures++;
- delete[] pc;
- return;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Read a texture from a MDL4 file
-void MDLImporter::CreateTexture_3DGS_MDL4(const unsigned char* szData,
- unsigned int iType,
- unsigned int* piSkip)
-{
- ai_assert(NULL != piSkip);
-
- const MDL::Header *pcHeader = (const MDL::Header*)mBuffer; //the endianess is allready corrected in the InternReadFile_3DGS_MDL345 function
-
- if (iType == 1 || iType > 3)
- {
- DefaultLogger::get()->error("Unsupported texture file format");
- return;
- }
-
- bool bNoRead = *piSkip == 0xffffffff;
-
- // allocate a new texture object
- aiTexture* pcNew = new aiTexture();
- pcNew->mWidth = pcHeader->skinwidth;
- pcNew->mHeight = pcHeader->skinheight;
-
- if (bNoRead)pcNew->pcData = (aiTexel*)0xffffffff;
- ParseTextureColorData(szData,iType,piSkip,pcNew);
-
- // store the texture
- if (!bNoRead)
- {
- if (!this->pScene->mNumTextures)
- {
- pScene->mNumTextures = 1;
- pScene->mTextures = new aiTexture*[1];
- pScene->mTextures[0] = pcNew;
- }
- else
- {
- aiTexture** pc = pScene->mTextures;
- pScene->mTextures = new aiTexture*[pScene->mNumTextures+1];
- for (unsigned int i = 0; i < this->pScene->mNumTextures;++i)
- pScene->mTextures[i] = pc[i];
- pScene->mTextures[pScene->mNumTextures] = pcNew;
- pScene->mNumTextures++;
- delete[] pc;
- }
- }
- else {
- pcNew->pcData = NULL;
- delete pcNew;
- }
- return;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Load color data of a texture and convert it to our output format
-void MDLImporter::ParseTextureColorData(const unsigned char* szData,
- unsigned int iType,
- unsigned int* piSkip,
- aiTexture* pcNew)
-{
- // allocate storage for the texture image
- if ((aiTexel*)0xffffffff != pcNew->pcData)
- pcNew->pcData = new aiTexel[pcNew->mWidth * pcNew->mHeight];
-
- // R5G6B5 format (with or without MIPs)
- // ****************************************************************
- if (2 == iType || 10 == iType)
- {
- VALIDATE_FILE_SIZE(szData + pcNew->mWidth*pcNew->mHeight*2);
-
- // copy texture data
- unsigned int i;
- if ((aiTexel*)0xffffffff != pcNew->pcData)
- {
- for (i = 0; i < pcNew->mWidth*pcNew->mHeight;++i)
- {
- MDL::RGB565 val = ((MDL::RGB565*)szData)[i];
- AI_SWAP2(val);
-
- pcNew->pcData[i].a = 0xFF;
- pcNew->pcData[i].r = (unsigned char)val.b << 3;
- pcNew->pcData[i].g = (unsigned char)val.g << 2;
- pcNew->pcData[i].b = (unsigned char)val.r << 3;
- }
- }
- else i = pcNew->mWidth*pcNew->mHeight;
- *piSkip = i * 2;
-
- // apply MIP maps
- if (10 == iType)
- {
- *piSkip += ((i >> 2) + (i >> 4) + (i >> 6)) << 1;
- VALIDATE_FILE_SIZE(szData + *piSkip);
- }
- }
- // ARGB4 format (with or without MIPs)
- // ****************************************************************
- else if (3 == iType || 11 == iType)
- {
- VALIDATE_FILE_SIZE(szData + pcNew->mWidth*pcNew->mHeight*4);
-
- // copy texture data
- unsigned int i;
- if ((aiTexel*)0xffffffff != pcNew->pcData)
- {
- for (i = 0; i < pcNew->mWidth*pcNew->mHeight;++i)
- {
- MDL::ARGB4 val = ((MDL::ARGB4*)szData)[i];
- AI_SWAP2(val);
-
- pcNew->pcData[i].a = (unsigned char)val.a << 4;
- pcNew->pcData[i].r = (unsigned char)val.r << 4;
- pcNew->pcData[i].g = (unsigned char)val.g << 4;
- pcNew->pcData[i].b = (unsigned char)val.b << 4;
- }
- }
- else i = pcNew->mWidth*pcNew->mHeight;
- *piSkip = i * 2;
-
- // apply MIP maps
- if (11 == iType)
- {
- *piSkip += ((i >> 2) + (i >> 4) + (i >> 6)) << 1;
- VALIDATE_FILE_SIZE(szData + *piSkip);
- }
- }
- // RGB8 format (with or without MIPs)
- // ****************************************************************
- else if (4 == iType || 12 == iType)
- {
- VALIDATE_FILE_SIZE(szData + pcNew->mWidth*pcNew->mHeight*3);
-
- // copy texture data
- unsigned int i;
- if ((aiTexel*)0xffffffff != pcNew->pcData)
- {
- for (i = 0; i < pcNew->mWidth*pcNew->mHeight;++i)
- {
- const unsigned char* _szData = &szData[i*3];
-
- pcNew->pcData[i].a = 0xFF;
- pcNew->pcData[i].b = *_szData++;
- pcNew->pcData[i].g = *_szData++;
- pcNew->pcData[i].r = *_szData;
- }
- }
- else i = pcNew->mWidth*pcNew->mHeight;
-
-
- // apply MIP maps
- *piSkip = i * 3;
- if (12 == iType)
- {
- *piSkip += ((i >> 2) + (i >> 4) + (i >> 6)) *3;
- VALIDATE_FILE_SIZE(szData + *piSkip);
- }
- }
- // ARGB8 format (with ir without MIPs)
- // ****************************************************************
- else if (5 == iType || 13 == iType)
- {
- VALIDATE_FILE_SIZE(szData + pcNew->mWidth*pcNew->mHeight*4);
-
- // copy texture data
- unsigned int i;
- if ((aiTexel*)0xffffffff != pcNew->pcData)
- {
- for (i = 0; i < pcNew->mWidth*pcNew->mHeight;++i)
- {
- const unsigned char* _szData = &szData[i*4];
-
- pcNew->pcData[i].b = *_szData++;
- pcNew->pcData[i].g = *_szData++;
- pcNew->pcData[i].r = *_szData++;
- pcNew->pcData[i].a = *_szData;
- }
- }
- else i = pcNew->mWidth*pcNew->mHeight;
-
- // apply MIP maps
- *piSkip = i << 2;
- if (13 == iType)
- {
- *piSkip += ((i >> 2) + (i >> 4) + (i >> 6)) << 2;
- }
- }
- // palletized 8 bit texture. As for Quake 1
- // ****************************************************************
- else if (0 == iType)
- {
- VALIDATE_FILE_SIZE(szData + pcNew->mWidth*pcNew->mHeight);
-
- // copy texture data
- unsigned int i;
- if ((aiTexel*)0xffffffff != pcNew->pcData)
- {
-
- const unsigned char* szColorMap;
- this->SearchPalette(&szColorMap);
-
- for (i = 0; i < pcNew->mWidth*pcNew->mHeight;++i)
- {
- const unsigned char val = szData[i];
- const unsigned char* sz = &szColorMap[val*3];
-
- pcNew->pcData[i].a = 0xFF;
- pcNew->pcData[i].r = *sz++;
- pcNew->pcData[i].g = *sz++;
- pcNew->pcData[i].b = *sz;
- }
- this->FreePalette(szColorMap);
-
- }
- else i = pcNew->mWidth*pcNew->mHeight;
- *piSkip = i;
-
- // FIXME: Also support for MIP maps?
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Get a texture from a MDL5 file
-void MDLImporter::CreateTexture_3DGS_MDL5(const unsigned char* szData,
- unsigned int iType,
- unsigned int* piSkip)
-{
- ai_assert(NULL != piSkip);
- bool bNoRead = *piSkip == 0xffffffff;
-
- // allocate a new texture object
- aiTexture* pcNew = new aiTexture();
-
- VALIDATE_FILE_SIZE(szData+8);
-
- // first read the size of the texture
- pcNew->mWidth = *((uint32_t*)szData);
- AI_SWAP4(pcNew->mWidth);
- szData += sizeof(uint32_t);
-
- pcNew->mHeight = *((uint32_t*)szData);
- AI_SWAP4(pcNew->mHeight);
- szData += sizeof(uint32_t);
-
- if (bNoRead)pcNew->pcData = (aiTexel*)0xffffffff;
-
- // this should not occur - at least the docs say it shouldn't
- // however, you can easily try out what MED does if you have
- // a model with a DDS texture and export it to MDL5 ...
- // yes, you're right. It embedds the DDS texture ... :cry:
- if (6 == iType)
- {
- // this is a compressed texture in DDS format
- *piSkip = pcNew->mWidth;
- VALIDATE_FILE_SIZE(szData + *piSkip);
-
- if (!bNoRead)
- {
- // place a hint and let the application know that it's
- // a DDS file
- pcNew->mHeight = 0;
- pcNew->achFormatHint[0] = 'd';
- pcNew->achFormatHint[1] = 'd';
- pcNew->achFormatHint[2] = 's';
- pcNew->achFormatHint[3] = '\0';
-
- pcNew->pcData = (aiTexel*) new unsigned char[pcNew->mWidth];
- ::memcpy(pcNew->pcData,szData,pcNew->mWidth);
- }
- }
- else
- {
- // parse the color data of the texture
- ParseTextureColorData(szData,iType,
- piSkip,pcNew);
- }
- *piSkip += sizeof(uint32_t) * 2;
-
- if (!bNoRead)
- {
- // store the texture
- if (!this->pScene->mNumTextures)
- {
- pScene->mNumTextures = 1;
- pScene->mTextures = new aiTexture*[1];
- pScene->mTextures[0] = pcNew;
- }
- else
- {
- aiTexture** pc = pScene->mTextures;
- pScene->mTextures = new aiTexture*[pScene->mNumTextures+1];
- for (unsigned int i = 0; i < pScene->mNumTextures;++i)
- this->pScene->mTextures[i] = pc[i];
-
- pScene->mTextures[pScene->mNumTextures] = pcNew;
- pScene->mNumTextures++;
- delete[] pc;
- }
- }
- else {
- pcNew->pcData = NULL;
- delete pcNew;
- }
- return;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Get a skin from a MDL7 file - more complex than all other subformats
-void MDLImporter::ParseSkinLump_3DGS_MDL7(
- const unsigned char* szCurrent,
- const unsigned char** szCurrentOut,
- MaterialHelper* pcMatOut,
- unsigned int iType,
- unsigned int iWidth,
- unsigned int iHeight)
-{
- aiTexture* pcNew = NULL;
-
- // get the type of the skin
- unsigned int iMasked = (unsigned int)(iType & 0xF);
-
- if (0x1 == iMasked)
- {
- // ***** REFERENCE TO ANOTHER SKIN INDEX *****
- int referrer = (int)iWidth;
- pcMatOut->AddProperty<int>(&referrer,1,AI_MDL7_REFERRER_MATERIAL);
- }
- else if (0x6 == iMasked)
- {
- // ***** EMBEDDED DDS FILE *****
- if (1 != iHeight)
- {
- DefaultLogger::get()->warn("Found a reference to an embedded DDS texture, "
- "but texture height is not equal to 1, which is not supported by MED");
- }
-
- pcNew = new aiTexture();
- pcNew->mHeight = 0;
- pcNew->mWidth = iWidth;
-
- // place a proper format hint
- pcNew->achFormatHint[0] = 'd';
- pcNew->achFormatHint[1] = 'd';
- pcNew->achFormatHint[2] = 's';
- pcNew->achFormatHint[3] = '\0';
-
- pcNew->pcData = (aiTexel*) new unsigned char[pcNew->mWidth];
- memcpy(pcNew->pcData,szCurrent,pcNew->mWidth);
- szCurrent += iWidth;
- }
- if (0x7 == iMasked)
- {
- // ***** REFERENCE TO EXTERNAL FILE *****
- if (1 != iHeight)
- {
- DefaultLogger::get()->warn("Found a reference to an external texture, "
- "but texture height is not equal to 1, which is not supported by MED");
- }
-
- aiString szFile;
- const size_t iLen = strlen((const char*)szCurrent);
- size_t iLen2 = iLen+1;
- iLen2 = iLen2 > MAXLEN ? MAXLEN : iLen2;
- memcpy(szFile.data,(const char*)szCurrent,iLen2);
- szFile.length = iLen;
-
- szCurrent += iLen2;
-
- // place this as diffuse texture
- pcMatOut->AddProperty(&szFile,AI_MATKEY_TEXTURE_DIFFUSE(0));
- }
- else if (iMasked || !iType || (iType && iWidth && iHeight))
- {
- // ***** STANDARD COLOR TEXTURE *****
- pcNew = new aiTexture();
- if (!iHeight || !iWidth)
- {
- DefaultLogger::get()->warn("Found embedded texture, but its width "
- "an height are both 0. Is this a joke?");
-
- // generate an empty chess pattern
- pcNew->mWidth = pcNew->mHeight = 8;
- pcNew->pcData = new aiTexel[64];
- for (unsigned int x = 0; x < 8;++x)
- {
- for (unsigned int y = 0; y < 8;++y)
- {
- const bool bSet = ((0 == x % 2 && 0 != y % 2) ||
- (0 != x % 2 && 0 == y % 2));
-
- aiTexel* pc = &pcNew->pcData[y * 8 + x];
- pc->r = pc->b = pc->g = (bSet?0xFF:0);
- pc->a = 0xFF;
- }
- }
- }
- else
- {
- // it is a standard color texture. Fill in width and height
- // and call the same function we used for loading MDL5 files
-
- pcNew->mWidth = iWidth;
- pcNew->mHeight = iHeight;
-
- unsigned int iSkip = 0;
- this->ParseTextureColorData(szCurrent,iMasked,&iSkip,pcNew);
-
- // skip length of texture data
- szCurrent += iSkip;
- }
- }
-
- // sometimes there are MDL7 files which have a monochrome
- // texture instead of material colors ... posssible they have
- // been converted to MDL7 from other formats, such as MDL5
- aiColor4D clrTexture;
- if (pcNew)clrTexture = this->ReplaceTextureWithColor(pcNew);
- else clrTexture.r = get_qnan();
-
- // check whether a material definition is contained in the skin
- if (iType & AI_MDL7_SKINTYPE_MATERIAL)
- {
- BE_NCONST MDL::Material_MDL7* pcMatIn = (BE_NCONST MDL::Material_MDL7*)szCurrent;
- szCurrent = (unsigned char*)(pcMatIn+1);
- VALIDATE_FILE_SIZE(szCurrent);
-
- aiColor3D clrTemp;
-
-#define COLOR_MULTIPLY_RGB() \
- if (is_not_qnan(clrTexture.r)) \
- { \
- clrTemp.r *= clrTexture.r; \
- clrTemp.g *= clrTexture.g; \
- clrTemp.b *= clrTexture.b; \
- }
-
- // read diffuse color
- clrTemp.r = pcMatIn->Diffuse.r;
- AI_SWAP4(clrTemp.r);
- clrTemp.g = pcMatIn->Diffuse.g;
- AI_SWAP4(clrTemp.g);
- clrTemp.b = pcMatIn->Diffuse.b;
- AI_SWAP4(clrTemp.b);
- COLOR_MULTIPLY_RGB();
- pcMatOut->AddProperty<aiColor3D>(&clrTemp,1,AI_MATKEY_COLOR_DIFFUSE);
-
- // read specular color
- clrTemp.r = pcMatIn->Specular.r;
- AI_SWAP4(clrTemp.r);
- clrTemp.g = pcMatIn->Specular.g;
- AI_SWAP4(clrTemp.g);
- clrTemp.b = pcMatIn->Specular.b;
- AI_SWAP4(clrTemp.b);
- COLOR_MULTIPLY_RGB();
- pcMatOut->AddProperty<aiColor3D>(&clrTemp,1,AI_MATKEY_COLOR_SPECULAR);
-
- // read ambient color
- clrTemp.r = pcMatIn->Ambient.r;
- AI_SWAP4(clrTemp.r);
- clrTemp.g = pcMatIn->Ambient.g;
- AI_SWAP4(clrTemp.g);
- clrTemp.b = pcMatIn->Ambient.b;
- AI_SWAP4(clrTemp.b);
- COLOR_MULTIPLY_RGB();
- pcMatOut->AddProperty<aiColor3D>(&clrTemp,1,AI_MATKEY_COLOR_AMBIENT);
-
- // read emissive color
- clrTemp.r = pcMatIn->Emissive.r;
- AI_SWAP4(clrTemp.r);
- clrTemp.g = pcMatIn->Emissive.g;
- AI_SWAP4(clrTemp.g);
- clrTemp.b = pcMatIn->Emissive.b;
- AI_SWAP4(clrTemp.b);
- pcMatOut->AddProperty<aiColor3D>(&clrTemp,1,AI_MATKEY_COLOR_EMISSIVE);
-
-#undef COLOR_MULITPLY_RGB
-
- // FIX: Take the opacity from the ambient color
- // the doc says something else, but it is fact that MED exports the
- // opacity like this .... ARRRGGHH!
- clrTemp.r = pcMatIn->Ambient.a;
- AI_SWAP4(clrTemp.r);
- if (is_not_qnan(clrTexture.r)) {
- clrTemp.r *= clrTexture.a;
- }
- pcMatOut->AddProperty<float>(&clrTemp.r,1,AI_MATKEY_OPACITY);
-
- // read phong power
- int iShadingMode = (int)aiShadingMode_Gouraud;
- AI_SWAP4(pcMatIn->Power);
- if (0.0f != pcMatIn->Power)
- {
- iShadingMode = (int)aiShadingMode_Phong;
- pcMatOut->AddProperty<float>(&pcMatIn->Power,1,AI_MATKEY_SHININESS);
- }
- pcMatOut->AddProperty<int>(&iShadingMode,1,AI_MATKEY_SHADING_MODEL);
- }
- else if (is_not_qnan(clrTexture.r))
- {
- pcMatOut->AddProperty<aiColor4D>(&clrTexture,1,AI_MATKEY_COLOR_DIFFUSE);
- pcMatOut->AddProperty<aiColor4D>(&clrTexture,1,AI_MATKEY_COLOR_SPECULAR);
- }
- // if the texture could be replaced by a single material color
- // we don't need the texture anymore
- if (is_not_qnan(clrTexture.r))
- {
- delete pcNew;
- pcNew = NULL;
- }
-
- // if an ASCII effect description (HLSL?) is contained in the file,
- // we can simply ignore it ...
- if (iType & AI_MDL7_SKINTYPE_MATERIAL_ASCDEF)
- {
- VALIDATE_FILE_SIZE(szCurrent);
- int32_t iMe = *((int32_t*)szCurrent);
- AI_SWAP4(iMe);
- szCurrent += sizeof(char) * iMe + sizeof(int32_t);
- VALIDATE_FILE_SIZE(szCurrent);
- }
-
- // If an embedded texture has been loaded setup the corresponding
- // data structures in the aiScene instance
- if (pcNew && this->pScene->mNumTextures <= 999)
- {
-
- // place this as diffuse texture
- char szCurrent[5];
- ::sprintf(szCurrent,"*%i",this->pScene->mNumTextures);
-
- aiString szFile;
- const size_t iLen = strlen((const char*)szCurrent);
- ::memcpy(szFile.data,(const char*)szCurrent,iLen+1);
- szFile.length = iLen;
-
- pcMatOut->AddProperty(&szFile,AI_MATKEY_TEXTURE_DIFFUSE(0));
-
- // store the texture
- if (!this->pScene->mNumTextures)
- {
- this->pScene->mNumTextures = 1;
- this->pScene->mTextures = new aiTexture*[1];
- this->pScene->mTextures[0] = pcNew;
- }
- else
- {
- aiTexture** pc = this->pScene->mTextures;
- this->pScene->mTextures = new aiTexture*[this->pScene->mNumTextures+1];
- for (unsigned int i = 0; i < this->pScene->mNumTextures;++i)
- this->pScene->mTextures[i] = pc[i];
-
- this->pScene->mTextures[this->pScene->mNumTextures] = pcNew;
- this->pScene->mNumTextures++;
- delete[] pc;
- }
- }
- VALIDATE_FILE_SIZE(szCurrent);
- *szCurrentOut = szCurrent;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Skip a skin lump
-void MDLImporter::SkipSkinLump_3DGS_MDL7(
- const unsigned char* szCurrent,
- const unsigned char** szCurrentOut,
- unsigned int iType,
- unsigned int iWidth,
- unsigned int iHeight)
-{
- // get the type of the skin
- unsigned int iMasked = (unsigned int)(iType & 0xF);
-
- if (0x6 == iMasked)
- {
- szCurrent += iWidth;
- }
- if (0x7 == iMasked)
- {
- const size_t iLen = ::strlen((const char*)szCurrent);
- szCurrent += iLen+1;
- }
- else if (iMasked || !iType)
- {
- if (iMasked || !iType || (iType && iWidth && iHeight))
- {
- // ParseTextureColorData(..., aiTexture::pcData == 0xffffffff) will simply
- // return the size of the color data in bytes in iSkip
- unsigned int iSkip = 0;
-
- aiTexture tex;
- tex.pcData = reinterpret_cast<aiTexel*>(0xffffffff);
- tex.mHeight = iHeight;
- tex.mWidth = iWidth;
- this->ParseTextureColorData(szCurrent,iMasked,&iSkip,&tex);
-
- // FIX: Important, otherwise the destructor will crash
- tex.pcData = NULL;
-
- // skip length of texture data
- szCurrent += iSkip;
- }
- }
-
- // check whether a material definition is contained in the skin
- if (iType & AI_MDL7_SKINTYPE_MATERIAL)
- {
- BE_NCONST MDL::Material_MDL7* pcMatIn = (BE_NCONST MDL::Material_MDL7*)szCurrent;
- szCurrent = (unsigned char*)(pcMatIn+1);
- }
-
- // if an ASCII effect description (HLSL?) is contained in the file,
- // we can simply ignore it ...
- if (iType & AI_MDL7_SKINTYPE_MATERIAL_ASCDEF)
- {
- int32_t iMe = *((int32_t*)szCurrent);
- AI_SWAP4(iMe);
- szCurrent += sizeof(char) * iMe + sizeof(int32_t);
- }
- *szCurrentOut = szCurrent;
-}
-
-// ------------------------------------------------------------------------------------------------
-// What the fuck does this function do? Can't remember
-void MDLImporter::ParseSkinLump_3DGS_MDL7(
- const unsigned char* szCurrent,
- const unsigned char** szCurrentOut,
- std::vector<MaterialHelper*>& pcMats)
-{
- ai_assert(NULL != szCurrent);
- ai_assert(NULL != szCurrentOut);
-
- *szCurrentOut = szCurrent;
- BE_NCONST MDL::Skin_MDL7* pcSkin = (BE_NCONST MDL::Skin_MDL7*)szCurrent;
- AI_SWAP4(pcSkin->width);
- AI_SWAP4(pcSkin->height);
- szCurrent += 12;
-
- // allocate an output material
- MaterialHelper* pcMatOut = new MaterialHelper();
- pcMats.push_back(pcMatOut);
-
- // skip length of file name
- szCurrent += AI_MDL7_MAX_TEXNAMESIZE;
-
- ParseSkinLump_3DGS_MDL7(szCurrent,szCurrentOut,pcMatOut,
- pcSkin->typ,pcSkin->width,pcSkin->height);
-
- // place the name of the skin in the material
- if (pcSkin->texture_name[0])
- {
- // the 0 termination could be there or not - we can't know
- aiString szFile;
- ::memcpy(szFile.data,pcSkin->texture_name,sizeof(pcSkin->texture_name));
- szFile.data[sizeof(pcSkin->texture_name)] = '\0';
- szFile.length = ::strlen(szFile.data);
-
- pcMatOut->AddProperty(&szFile,AI_MATKEY_NAME);
- }
-}
-
-#endif // !! ASSIMP_BUILD_NO_MDL_IMPORTER
diff --git a/3rdparty/assimp/code/MS3DLoader.cpp b/3rdparty/assimp/code/MS3DLoader.cpp
deleted file mode 100644
index be34db68..00000000
--- a/3rdparty/assimp/code/MS3DLoader.cpp
+++ /dev/null
@@ -1,645 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file MS3DLoader.cpp
- * @brief Implementation of the Ms3D importer class.
- * Written against http://chumbalum.swissquake.ch/ms3d/ms3dspec.txt
- */
-
-#include "AssimpPCH.h"
-#ifndef ASSIMP_BUILD_NO_MS3D_IMPORTER
-
-// internal headers
-#include "MS3DLoader.h"
-#include "StreamReader.h"
-using namespace Assimp;
-
-// ASSIMP_BUILD_MS3D_ONE_NODE_PER_MESH
-// (enable old code path, which generates extra nodes per mesh while
-// the newer code uses aiMesh::mName to express the name of the
-// meshes (a.k.a. groups in MS3D))
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-MS3DImporter::MS3DImporter()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-MS3DImporter::~MS3DImporter()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the class can handle the format of the given file.
-bool MS3DImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const
-{
- // first call - simple extension check
- const std::string extension = GetExtension(pFile);
- if (extension == "ms3d") {
- return true;
- }
-
- // second call - check for magic identifiers
- else if (!extension.length() || checkSig) {
- if (!pIOHandler) {
- return true;
- }
- const char* tokens[] = {"MS3D000000"};
- return SearchFileHeaderForToken(pIOHandler,pFile,tokens,1);
- }
- return false;
-}
-
-// ------------------------------------------------------------------------------------------------
-void MS3DImporter::GetExtensionList(std::set<std::string>& extensions)
-{
- extensions.insert("ms3d");
-}
-
-// ------------------------------------------------------------------------------------------------
-void ReadColor(StreamReaderLE& stream, aiColor4D& ambient)
-{
- // aiColor4D is packed on gcc, implicit binding to float& fails therefore.
- stream >> (float&)ambient.r >> (float&)ambient.g >> (float&)ambient.b >> (float&)ambient.a;
-}
-
-// ------------------------------------------------------------------------------------------------
-void ReadVector(StreamReaderLE& stream, aiVector3D& pos)
-{
- // See note in ReadColor()
- stream >> (float&)pos.x >> (float&)pos.y >> (float&)pos.z;
-}
-
-// ------------------------------------------------------------------------------------------------
-template<typename T>
-void MS3DImporter :: ReadComments(StreamReaderLE& stream, std::vector<T>& outp)
-{
- uint16_t cnt;
- stream >> cnt;
-
- for (unsigned int i = 0; i < cnt; ++i) {
- uint32_t index, clength;
- stream >> index >> clength;
-
- if (index >= outp.size()) {
- DefaultLogger::get()->warn("MS3D: Invalid index in comment section");
- }
- else if (clength > stream.GetRemainingSize()) {
- throw DeadlyImportError("MS3D: Failure reading comment, length field is out of range");
- }
- else {
- outp[index].comment = std::string(reinterpret_cast<char*>(stream.GetPtr()),clength);
- }
- stream.IncPtr(clength);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-template <typename T, typename T2, typename T3> bool inrange(const T& in, const T2& lower, const T3& higher)
-{
- return in > lower && in <= higher;
-}
-
-// ------------------------------------------------------------------------------------------------
-void MS3DImporter :: CollectChildJoints(const std::vector<TempJoint>& joints,
- std::vector<bool>& hadit,
- aiNode* nd,
- const aiMatrix4x4& absTrafo)
-{
- unsigned int cnt = 0;
- for (size_t i = 0; i < joints.size(); ++i) {
- if (!hadit[i] && !strcmp(joints[i].parentName,nd->mName.data)) {
- ++cnt;
- }
- }
-
- nd->mChildren = new aiNode*[nd->mNumChildren = cnt];
- cnt = 0;
- for (size_t i = 0; i < joints.size(); ++i) {
- if (!hadit[i] && !strcmp(joints[i].parentName,nd->mName.data)) {
- aiNode* ch = nd->mChildren[cnt++] = new aiNode(joints[i].name);
- ch->mParent = nd;
-
- ch->mTransformation = aiMatrix4x4::Translation(joints[i].position,aiMatrix4x4()=aiMatrix4x4())*
- // XXX actually, I don't *know* why we need the inverse here. Probably column vs. row order?
- aiMatrix4x4().FromEulerAnglesXYZ(joints[i].rotation).Transpose();
-
- const aiMatrix4x4 abs = absTrafo*ch->mTransformation;
- for (unsigned int a = 0; a < mScene->mNumMeshes; ++a) {
- aiMesh* const msh = mScene->mMeshes[a];
- for (unsigned int n = 0; n < msh->mNumBones; ++n) {
- aiBone* const bone = msh->mBones[n];
-
- if (bone->mName == ch->mName) {
- bone->mOffsetMatrix = aiMatrix4x4(abs).Inverse();
- }
- }
- }
-
- hadit[i] = true;
- CollectChildJoints(joints,hadit,ch,abs);
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void MS3DImporter :: CollectChildJoints(const std::vector<TempJoint>& joints, aiNode* nd)
-{
- std::vector<bool> hadit(joints.size(),false);
- aiMatrix4x4 trafo;
-
- CollectChildJoints(joints,hadit,nd,trafo);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Imports the given file into the given scene structure.
-void MS3DImporter::InternReadFile( const std::string& pFile,
- aiScene* pScene, IOSystem* pIOHandler)
-{
- StreamReaderLE stream(pIOHandler->Open(pFile,"rb"));
-
- // CanRead() should have done this already
- char head[10];
- int32_t version;
-
- mScene = pScene;
-
-
- // 1 ------------ read into temporary data structures mirroring the original file
-
- stream.CopyAndAdvance(head,10);
- stream >> version;
- if (strncmp(head,"MS3D000000",10)) {
- throw DeadlyImportError("Not a MS3D file, magic string MS3D000000 not found: "+pFile);
- }
-
- if (version != 4) {
- throw DeadlyImportError("MS3D: Unsupported file format version, 4 was expected");
- }
-
- uint16_t verts;
- stream >> verts;
-
- std::vector<TempVertex> vertices(verts);
- for (unsigned int i = 0; i < verts; ++i) {
- TempVertex& v = vertices[i];
-
- stream.IncPtr(1);
- ReadVector(stream,v.pos);
- v.bone_id[0] = stream.GetI1();
- v.ref_cnt = stream.GetI1();
-
- v.bone_id[1] = v.bone_id[2] = v.bone_id[3] = 0xffffffff;
- v.weights[1] = v.weights[2] = v.weights[3] = 0.f;
- v.weights[0] = 1.f;
- }
-
- uint16_t tris;
- stream >> tris;
-
- std::vector<TempTriangle> triangles(tris);
- for (unsigned int i = 0;i < tris; ++i) {
- TempTriangle& t = triangles[i];
-
- stream.IncPtr(2);
- for (unsigned int i = 0; i < 3; ++i) {
- t.indices[i] = stream.GetI2();
- }
-
- for (unsigned int i = 0; i < 3; ++i) {
- ReadVector(stream,t.normals[i]);
- }
-
- for (unsigned int i = 0; i < 3; ++i) {
- stream >> (float&)(t.uv[i].x); // see note in ReadColor()
- }
- for (unsigned int i = 0; i < 3; ++i) {
- stream >> (float&)(t.uv[i].y);
- }
-
- t.sg = stream.GetI1();
- t.group = stream.GetI1();
- }
-
- uint16_t grp;
- stream >> grp;
-
- bool need_default = false;
- std::vector<TempGroup> groups(grp);
- for (unsigned int i = 0;i < grp; ++i) {
- TempGroup& t = groups[i];
-
- stream.IncPtr(1);
- stream.CopyAndAdvance(t.name,32);
-
- t.name[32] = '\0';
- uint16_t num;
- stream >> num;
-
- t.triangles.resize(num);
- for (unsigned int i = 0; i < num; ++i) {
- t.triangles[i] = stream.GetI2();
- }
- t.mat = stream.GetI1();
- if (t.mat == 0xffffffff) {
- need_default = true;
- }
- }
-
- uint16_t mat;
- stream >> mat;
-
- std::vector<TempMaterial> materials(mat);
- for (unsigned int i = 0;i < mat; ++i) {
- TempMaterial& t = materials[i];
-
- stream.CopyAndAdvance(t.name,32);
- t.name[32] = '\0';
-
- ReadColor(stream,t.ambient);
- ReadColor(stream,t.diffuse);
- ReadColor(stream,t.specular);
- ReadColor(stream,t.emissive);
- stream >> t.shininess >> t.transparency;
-
- stream.IncPtr(1);
-
- stream.CopyAndAdvance(t.texture,128);
- t.texture[128] = '\0';
-
- stream.CopyAndAdvance(t.alphamap,128);
- t.alphamap[128] = '\0';
- }
-
- float animfps, currenttime;
- uint32_t totalframes;
- stream >> animfps >> currenttime >> totalframes;
-
- uint16_t joint;
- stream >> joint;
-
- std::vector<TempJoint> joints(joint);
- for (unsigned int i = 0; i < joint; ++i) {
- TempJoint& j = joints[i];
-
- stream.IncPtr(1);
- stream.CopyAndAdvance(j.name,32);
- j.name[32] = '\0';
-
- stream.CopyAndAdvance(j.parentName,32);
- j.parentName[32] = '\0';
-
- // DefaultLogger::get()->debug(j.name);
- // DefaultLogger::get()->debug(j.parentName);
-
- ReadVector(stream,j.rotation);
- ReadVector(stream,j.position);
-
- j.rotFrames.resize(stream.GetI2());
- j.posFrames.resize(stream.GetI2());
-
- for (unsigned int a = 0; a < j.rotFrames.size(); ++a) {
- TempKeyFrame& kf = j.rotFrames[a];
- stream >> kf.time;
- ReadVector(stream,kf.value);
- }
- for (unsigned int a = 0; a < j.posFrames.size(); ++a) {
- TempKeyFrame& kf = j.posFrames[a];
- stream >> kf.time;
- ReadVector(stream,kf.value);
- }
- }
-
- if (stream.GetRemainingSize() > 4) {
- uint32_t subversion;
- stream >> subversion;
- if (subversion == 1) {
- ReadComments<TempGroup>(stream,groups);
- ReadComments<TempMaterial>(stream,materials);
- ReadComments<TempJoint>(stream,joints);
-
- // model comment - print it for we have such a nice log.
- if (stream.GetI4()) {
- const size_t len = static_cast<size_t>(stream.GetI4());
- if (len > stream.GetRemainingSize()) {
- throw DeadlyImportError("MS3D: Model comment is too long");
- }
-
- const std::string& s = std::string(reinterpret_cast<char*>(stream.GetPtr()),len);
- }
-
- if (stream.GetRemainingSize() > 4 && inrange((stream >> subversion,subversion),1u,3u)) {
- for (unsigned int i = 0; i < verts; ++i) {
- TempVertex& v = vertices[i];
- v.weights[3]=1.f;
- for (unsigned int n = 0; n < 3; v.weights[3]-=v.weights[n++]) {
- v.bone_id[n+1] = stream.GetI1();
- v.weights[n] = static_cast<float>(static_cast<unsigned int>(stream.GetI1()))/255.f;
- }
- stream.IncPtr((subversion-1)<<2u);
- }
-
- // even further extra data is not of interest for us, at least now now.
- }
- }
- }
-
- // 2 ------------ convert to proper aiXX data structures -----------------------------------
-
- if (need_default && materials.size()) {
- DefaultLogger::get()->warn("MS3D: Found group with no material assigned, spawning default material");
- // if one of the groups has no material assigned, but there are other
- // groups with materials, a default material needs to be added (
- // scenepreprocessor adds a default material only if nummat==0).
- materials.push_back(TempMaterial());
- TempMaterial& m = materials.back();
-
- strcpy(m.name,"<MS3D_DefaultMat>");
- m.diffuse = aiColor4D(0.6f,0.6f,0.6f,1.0);
- m.transparency = 1.f;
- m.shininess = 0.f;
-
- // this is because these TempXXX struct's have no c'tors.
- m.texture[0] = m.alphamap[0] = '\0';
-
- for (unsigned int i = 0; i < groups.size(); ++i) {
- TempGroup& g = groups[i];
- if (g.mat == 0xffffffff) {
- g.mat = materials.size()-1;
- }
- }
- }
-
- // convert materials to our generic key-value dict-alike
- if (materials.size()) {
- pScene->mMaterials = new aiMaterial*[materials.size()];
- for (size_t i = 0; i < materials.size(); ++i) {
-
- MaterialHelper* mo = new MaterialHelper();
- pScene->mMaterials[pScene->mNumMaterials++] = mo;
-
- const TempMaterial& mi = materials[i];
-
- aiString tmp;
- if (0[mi.alphamap]) {
- tmp = aiString(mi.alphamap);
- mo->AddProperty(&tmp,AI_MATKEY_TEXTURE_OPACITY(0));
- }
- if (0[mi.texture]) {
- tmp = aiString(mi.texture);
- mo->AddProperty(&tmp,AI_MATKEY_TEXTURE_DIFFUSE(0));
- }
- if (0[mi.name]) {
- tmp = aiString(mi.name);
- mo->AddProperty(&tmp,AI_MATKEY_NAME);
- }
-
- mo->AddProperty(&mi.ambient,1,AI_MATKEY_COLOR_AMBIENT);
- mo->AddProperty(&mi.diffuse,1,AI_MATKEY_COLOR_DIFFUSE);
- mo->AddProperty(&mi.specular,1,AI_MATKEY_COLOR_SPECULAR);
- mo->AddProperty(&mi.emissive,1,AI_MATKEY_COLOR_EMISSIVE);
-
- mo->AddProperty(&mi.shininess,1,AI_MATKEY_SHININESS);
- mo->AddProperty(&mi.transparency,1,AI_MATKEY_OPACITY);
-
- const int sm = mi.shininess>0.f?aiShadingMode_Phong:aiShadingMode_Gouraud;
- mo->AddProperty(&sm,1,AI_MATKEY_SHADING_MODEL);
- }
- }
-
- // convert groups to meshes
- if (groups.empty()) {
- throw DeadlyImportError("MS3D: Didn't get any group records, file is malformed");
- }
-
- pScene->mMeshes = new aiMesh*[pScene->mNumMeshes=static_cast<unsigned int>(groups.size())]();
- for (unsigned int i = 0; i < pScene->mNumMeshes; ++i) {
-
- aiMesh* m = pScene->mMeshes[i] = new aiMesh();
- const TempGroup& g = groups[i];
-
- if (pScene->mNumMaterials && g.mat > pScene->mNumMaterials) {
- throw DeadlyImportError("MS3D: Encountered invalid material index, file is malformed");
- } // no error if no materials at all - scenepreprocessor adds one then
-
- m->mMaterialIndex = g.mat;
- m->mPrimitiveTypes = aiPrimitiveType_TRIANGLE;
-
- m->mFaces = new aiFace[m->mNumFaces = g.triangles.size()];
- m->mNumVertices = m->mNumFaces*3;
-
- // storage for vertices - verbose format, as requested by the postprocessing pipeline
- m->mVertices = new aiVector3D[m->mNumVertices];
- m->mNormals = new aiVector3D[m->mNumVertices];
- m->mTextureCoords[0] = new aiVector3D[m->mNumVertices];
- m->mNumUVComponents[0] = 2;
-
- typedef std::map<unsigned int,unsigned int> BoneSet;
- BoneSet mybones;
-
- for (unsigned int i = 0,n = 0; i < m->mNumFaces; ++i) {
- aiFace& f = m->mFaces[i];
- if (g.triangles[i]>triangles.size()) {
- throw DeadlyImportError("MS3D: Encountered invalid triangle index, file is malformed");
- }
-
- TempTriangle& t = triangles[g.triangles[i]];
- f.mIndices = new unsigned int[f.mNumIndices=3];
-
- for (unsigned int i = 0; i < 3; ++i,++n) {
- if (t.indices[i]>vertices.size()) {
- throw DeadlyImportError("MS3D: Encountered invalid vertex index, file is malformed");
- }
-
- const TempVertex& v = vertices[t.indices[i]];
- for (unsigned int a = 0; a < 4; ++a) {
- if (v.bone_id[a] != 0xffffffff) {
- if (v.bone_id[a] >= joints.size()) {
- throw DeadlyImportError("MS3D: Encountered invalid bone index, file is malformed");
- }
- if (mybones.find(v.bone_id[a]) == mybones.end()) {
- mybones[v.bone_id[a]] = 1;
- }
- else ++mybones[v.bone_id[a]];
- }
- }
-
- // collect vertex components
- m->mVertices[n] = v.pos;
-
- m->mNormals[n] = t.normals[i];
- m->mTextureCoords[0][n] = aiVector3D(t.uv[i].x,1.f-t.uv[i].y,0.0);
- f.mIndices[i] = n;
- }
- }
-
- // allocate storage for bones
- if (mybones.size()) {
- std::vector<unsigned int> bmap(joints.size());
- m->mBones = new aiBone*[mybones.size()]();
- for (BoneSet::const_iterator it = mybones.begin(); it != mybones.end(); ++it) {
- aiBone* const bn = m->mBones[m->mNumBones] = new aiBone();
- const TempJoint& jnt = joints[(*it).first];
-
- bn->mName.Set(jnt.name);
- bn->mWeights = new aiVertexWeight[(*it).second];
-
- bmap[(*it).first] = m->mNumBones++;
- }
-
- // .. and collect bone weights
- for (unsigned int i = 0,n = 0; i < m->mNumFaces; ++i) {
- TempTriangle& t = triangles[g.triangles[i]];
-
- for (unsigned int i = 0; i < 3; ++i,++n) {
- const TempVertex& v = vertices[t.indices[i]];
- for (unsigned int a = 0; a < 4; ++a) {
- const unsigned int bone = v.bone_id[a];
- if (bone==0xffffffff){
- continue;
- }
-
- aiBone* const outbone = m->mBones[bmap[bone]];
- aiVertexWeight& outwght = outbone->mWeights[outbone->mNumWeights++];
-
- outwght.mVertexId = n;
- outwght.mWeight = v.weights[a];
- }
- }
- }
- }
- }
-
- // ... add dummy nodes under a single root, each holding a reference to one
- // mesh. If we didn't do this, we'd loose the group name.
- aiNode* rt = pScene->mRootNode = new aiNode("<MS3DRoot>");
-
-#ifdef ASSIMP_BUILD_MS3D_ONE_NODE_PER_MESH
- rt->mChildren = new aiNode*[rt->mNumChildren=pScene->mNumMeshes+(joints.size()?1:0)]();
-
- for (unsigned int i = 0; i < pScene->mNumMeshes; ++i) {
- aiNode* nd = rt->mChildren[i] = new aiNode();
-
- const TempGroup& g = groups[i];
-
- // we need to generate an unique name for all mesh nodes.
- // since we want to keep the group name, a prefix is
- // prepended.
- nd->mName = aiString("<MS3DMesh>_");
- nd->mName.Append(g.name);
- nd->mParent = rt;
-
- nd->mMeshes = new unsigned int[nd->mNumMeshes = 1];
- nd->mMeshes[0] = i;
- }
-#else
- rt->mMeshes = new unsigned int[pScene->mNumMeshes];
- for (unsigned int i = 0; i < pScene->mNumMeshes; ++i) {
- rt->mMeshes[rt->mNumMeshes++] = i;
- }
-#endif
-
- // convert animations as well
- if (joints.size()) {
-#ifndef ASSIMP_BUILD_MS3D_ONE_NODE_PER_MESH
- rt->mChildren = new aiNode*[1]();
-#endif
- aiNode* jt = rt->mChildren[pScene->mNumMeshes] = new aiNode();
- jt->mParent = rt;
- CollectChildJoints(joints,jt);
- jt->mName.Set("<MS3DJointRoot>");
-
- pScene->mAnimations = new aiAnimation*[ pScene->mNumAnimations = 1 ];
- aiAnimation* const anim = pScene->mAnimations[0] = new aiAnimation();
-
- anim->mName.Set("<MS3DMasterAnim>");
-
- // carry the fps info to the user by scaling all times with it
- anim->mTicksPerSecond = animfps;
-
- // leave duration at its default, so ScenePreprocessor will fill an appropriate
- // value (the values taken from some MS3D files seem to be too unreliable
- // to pass the validation)
- // anim->mDuration = totalframes/animfps;
-
- anim->mChannels = new aiNodeAnim*[joints.size()]();
- for (std::vector<TempJoint>::const_iterator it = joints.begin(); it != joints.end(); ++it) {
- if ((*it).rotFrames.empty() && (*it).posFrames.empty()) {
- continue;
- }
-
- aiNodeAnim* nd = anim->mChannels[anim->mNumChannels++] = new aiNodeAnim();
- nd->mNodeName.Set((*it).name);
-
- if ((*it).rotFrames.size()) {
- nd->mRotationKeys = new aiQuatKey[(*it).rotFrames.size()];
- for (std::vector<TempKeyFrame>::const_iterator rot = (*it).rotFrames.begin(); rot != (*it).rotFrames.end(); ++rot) {
- aiQuatKey& q = nd->mRotationKeys[nd->mNumRotationKeys++];
-
- q.mTime = (*rot).time*animfps;
-
- // XXX it seems our matrix&quaternion code has faults in its conversion routines --
- // aiQuaternion(x,y,z) seems to besomething different as quat(matrix.fromeuler(x,y,z)).
- q.mValue = aiQuaternion(aiMatrix3x3(aiMatrix4x4().FromEulerAnglesXYZ((*rot).value)*
- aiMatrix4x4().FromEulerAnglesXYZ((*it).rotation)).Transpose());
- }
- }
-
- if ((*it).posFrames.size()) {
- nd->mPositionKeys = new aiVectorKey[(*it).posFrames.size()];
-
- aiQuatKey* qu = nd->mRotationKeys;
- for (std::vector<TempKeyFrame>::const_iterator pos = (*it).posFrames.begin(); pos != (*it).posFrames.end(); ++pos,++qu) {
- aiVectorKey& v = nd->mPositionKeys[nd->mNumPositionKeys++];
-
- v.mTime = (*pos).time*animfps;
- v.mValue = (*it).position + (*pos).value;
- }
- }
- }
- // fixup to pass the validation if not a single animation channel is non-trivial
- if (!anim->mNumChannels) {
- anim->mChannels = NULL;
- }
- }
-}
-
-#endif
diff --git a/3rdparty/assimp/code/MS3DLoader.h b/3rdparty/assimp/code/MS3DLoader.h
deleted file mode 100644
index 6725dda3..00000000
--- a/3rdparty/assimp/code/MS3DLoader.h
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file MS3DLoader.h
- * @brief Declaration of the MS3D importer class.
- */
-#ifndef AI_MS3DLOADER_H_INCLUDED
-#define AI_MS3DLOADER_H_INCLUDED
-
-#include "BaseImporter.h"
-namespace Assimp {
-
-// ----------------------------------------------------------------------------------------------
-/** Milkshape 3D importer implementation */
-// ----------------------------------------------------------------------------------------------
-class MS3DImporter
- : public BaseImporter
-{
- friend class Importer;
-
-protected:
-
- MS3DImporter();
- ~MS3DImporter();
-
-public:
-
- // -------------------------------------------------------------------
- /** Returns whether the class can handle the format of the given file.
- * See BaseImporter::CanRead() for details. */
- bool CanRead( const std::string& pFile, IOSystem* pIOHandler,
- bool checkSig) const;
-
-protected:
-
- // -------------------------------------------------------------------
- /** Called by Importer::GetExtensionList() for each loaded importer.
- * See BaseImporter::GetExtensionList() for details */
- void GetExtensionList(std::set<std::string>& extensions);
-
-
- // -------------------------------------------------------------------
- /** Imports the given file into the given scene structure.
- * See BaseImporter::InternReadFile() for details */
- void InternReadFile( const std::string& pFile, aiScene* pScene,
- IOSystem* pIOHandler);
-
-
-private:
-
- struct TempJoint;
- void CollectChildJoints(const std::vector<TempJoint>& joints, std::vector<bool>& hadit, aiNode* nd,const aiMatrix4x4& absTrafo);
- void CollectChildJoints(const std::vector<TempJoint>& joints, aiNode* nd);
-
- template<typename T> void ReadComments(StreamReaderLE& stream, std::vector<T>& outp);
-private:
-
- aiScene* mScene;
-
-private:
-
- struct TempVertex
- {
- aiVector3D pos;
- unsigned int bone_id[4], ref_cnt;
- float weights[4];
- };
-
- struct TempTriangle
- {
- unsigned int indices[3];
- aiVector3D normals[3];
- aiVector2D uv[3];
-
- unsigned int sg, group;
- };
-
- struct TempGroup
- {
- char name[33]; // +0
- std::vector<unsigned int> triangles;
- unsigned int mat; // 0xff is no material
- std::string comment;
- };
-
- struct TempMaterial
- {
- // again, add an extra 0 character to all strings -
- char name[33];
- char texture[129];
- char alphamap[129];
-
- aiColor4D diffuse,specular,ambient,emissive;
- float shininess,transparency;
- std::string comment;
- };
-
- struct TempKeyFrame
- {
- float time;
- aiVector3D value;
- };
-
- struct TempJoint
- {
- char name[33];
- char parentName[33];
- aiVector3D rotation, position;
-
- std::vector<TempKeyFrame> rotFrames;
- std::vector<TempKeyFrame> posFrames;
- std::string comment;
- };
-
- //struct TempModel {
- // std::string comment;
- //};
-};
-
-}
-#endif
diff --git a/3rdparty/assimp/code/MakeVerboseFormat.cpp b/3rdparty/assimp/code/MakeVerboseFormat.cpp
deleted file mode 100644
index b232146d..00000000
--- a/3rdparty/assimp/code/MakeVerboseFormat.cpp
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-/** @file Implementation of the post processing step "MakeVerboseFormat"
-*/
-
-#include "AssimpPCH.h"
-#include "MakeVerboseFormat.h"
-
-using namespace Assimp;
-
-// ------------------------------------------------------------------------------------------------
-MakeVerboseFormatProcess::MakeVerboseFormatProcess()
-{
- // nothing to do here
-}
-// ------------------------------------------------------------------------------------------------
-MakeVerboseFormatProcess::~MakeVerboseFormatProcess()
-{
- // nothing to do here
-}
-// ------------------------------------------------------------------------------------------------
-// Executes the post processing step on the given imported data.
-void MakeVerboseFormatProcess::Execute( aiScene* pScene)
-{
- ai_assert(NULL != pScene);
- DefaultLogger::get()->debug("MakeVerboseFormatProcess begin");
-
- bool bHas = false;
- for ( unsigned int a = 0; a < pScene->mNumMeshes; a++)
- {
- if ( MakeVerboseFormat( pScene->mMeshes[a]))
- bHas = true;
- }
- if (bHas) DefaultLogger::get()->info("MakeVerboseFormatProcess finished. There was much work to do ...");
- else DefaultLogger::get()->debug("MakeVerboseFormatProcess. There was nothing to do.");
-
- pScene->mFlags &= ~AI_SCENE_FLAGS_NON_VERBOSE_FORMAT;
-
-}
-// ------------------------------------------------------------------------------------------------
-// Executes the post processing step on the given imported data.
-bool MakeVerboseFormatProcess::MakeVerboseFormat(aiMesh* pcMesh)
-{
- ai_assert(NULL != pcMesh);
-
- unsigned int iOldNumVertices = pcMesh->mNumVertices;
- const unsigned int iNumVerts = pcMesh->mNumFaces*3;
-
- aiVector3D* pvPositions = new aiVector3D[ iNumVerts ];
-
- aiVector3D* pvNormals = NULL;
- if (pcMesh->HasNormals())
- {
- pvNormals = new aiVector3D[iNumVerts];
- }
- aiVector3D* pvTangents = NULL, *pvBitangents = NULL;
- if (pcMesh->HasTangentsAndBitangents())
- {
- pvTangents = new aiVector3D[iNumVerts];
- pvBitangents = new aiVector3D[iNumVerts];
- }
-
- ai_assert(AI_MAX_NUMBER_OF_TEXTURECOORDS == 4);
- ai_assert(AI_MAX_NUMBER_OF_COLOR_SETS == 4);
-
- aiVector3D* apvTextureCoords[AI_MAX_NUMBER_OF_TEXTURECOORDS] = {NULL,NULL,NULL,NULL};
- aiColor4D* apvColorSets[AI_MAX_NUMBER_OF_COLOR_SETS] = {NULL,NULL,NULL,NULL};
-
- unsigned int p = 0;
- while (pcMesh->HasTextureCoords(p))
- apvTextureCoords[p++] = new aiVector3D[iNumVerts];
-
- p = 0;
- while (pcMesh->HasVertexColors(p))
- apvColorSets[p++] = new aiColor4D[iNumVerts];
-
- // allocate enough memory to hold output bones and vertex weights ...
- std::vector<aiVertexWeight>* newWeights = new std::vector<aiVertexWeight>[pcMesh->mNumBones];
- for (unsigned int i = 0;i < pcMesh->mNumBones;++i) {
- newWeights[i].reserve(pcMesh->mBones[i]->mNumWeights*3);
- }
-
- // iterate through all faces and build a clean list
- unsigned int iIndex = 0;
- for (unsigned int a = 0; a< pcMesh->mNumFaces;++a)
- {
- aiFace* pcFace = &pcMesh->mFaces[a];
- for (unsigned int q = 0; q < pcFace->mNumIndices;++q,++iIndex)
- {
- // need to build a clean list of bones, too
- for (unsigned int i = 0;i < pcMesh->mNumBones;++i)
- {
- for (unsigned int a = 0; a < pcMesh->mBones[i]->mNumWeights;a++)
- {
- const aiVertexWeight& w = pcMesh->mBones[i]->mWeights[a];
- if (pcFace->mIndices[q] == w.mVertexId)
- {
- aiVertexWeight wNew;
- wNew.mVertexId = iIndex;
- wNew.mWeight = w.mWeight;
- newWeights[i].push_back(wNew);
- }
- }
- }
-
- pvPositions[iIndex] = pcMesh->mVertices[pcFace->mIndices[q]];
-
- if (pcMesh->HasNormals())
- {
- pvNormals[iIndex] = pcMesh->mNormals[pcFace->mIndices[q]];
- }
- if (pcMesh->HasTangentsAndBitangents())
- {
- pvTangents[iIndex] = pcMesh->mTangents[pcFace->mIndices[q]];
- pvBitangents[iIndex] = pcMesh->mBitangents[pcFace->mIndices[q]];
- }
-
- unsigned int p = 0;
- while (pcMesh->HasTextureCoords(p))
- {
- apvTextureCoords[p][iIndex] = pcMesh->mTextureCoords[p][pcFace->mIndices[q]];
- ++p;
- }
- p = 0;
- while (pcMesh->HasVertexColors(p))
- {
- apvColorSets[p][iIndex] = pcMesh->mColors[p][pcFace->mIndices[q]];
- ++p;
- }
- pcFace->mIndices[q] = iIndex;
- }
- }
-
- // build output vertex weights
- for (unsigned int i = 0;i < pcMesh->mNumBones;++i)
- {
- delete pcMesh->mBones[i]->mWeights;
- if (!newWeights[i].empty())
- {
- pcMesh->mBones[i]->mWeights = new aiVertexWeight[newWeights[i].size()];
- memcpy(pcMesh->mBones[i]->mWeights,&newWeights[i][0],
- sizeof(aiVertexWeight) * newWeights[i].size());
- }
- else pcMesh->mBones[i]->mWeights = NULL;
- }
-
- // delete the old members
- delete[] pcMesh->mVertices;
- pcMesh->mVertices = pvPositions;
-
- p = 0;
- while (pcMesh->HasTextureCoords(p))
- {
- delete pcMesh->mTextureCoords[p];
- pcMesh->mTextureCoords[p] = apvTextureCoords[p];
- ++p;
- }
- p = 0;
- while (pcMesh->HasVertexColors(p))
- {
- delete pcMesh->mColors[p];
- pcMesh->mColors[p] = apvColorSets[p];
- ++p;
- }
- pcMesh->mNumVertices = iNumVerts;
-
- if (pcMesh->HasNormals())
- {
- delete[] pcMesh->mNormals;
- pcMesh->mNormals = pvNormals;
- }
- if (pcMesh->HasTangentsAndBitangents())
- {
- delete[] pcMesh->mTangents;
- pcMesh->mTangents = pvTangents;
- delete[] pcMesh->mBitangents;
- pcMesh->mBitangents = pvBitangents;
- }
- return (pcMesh->mNumVertices != iOldNumVertices);
-}
diff --git a/3rdparty/assimp/code/MakeVerboseFormat.h b/3rdparty/assimp/code/MakeVerboseFormat.h
deleted file mode 100644
index 6ecb2ed5..00000000
--- a/3rdparty/assimp/code/MakeVerboseFormat.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file Defines a post processing step to bring a given scene
- into the verbose format that is expected by most postprocess steps.
- This is the inverse of the "JoinIdenticalVertices" step. */
-#ifndef AI_MAKEVERBOSEFORMAT_H_INC
-#define AI_MAKEVERBOSEFORMAT_H_INC
-
-#include "BaseProcess.h"
-namespace Assimp {
-
-// ---------------------------------------------------------------------------
-/** MakeVerboseFormatProcess: Class to convert an asset to the verbose
- * format which is expected by most postprocess steps.
- *
- * This is the inverse of what the "JoinIdenticalVertices" step is doing.
- * This step has no official flag (since it wouldn't make sense to run it
- * during import). It is intended for applications intending to modify the
- * returned aiScene. After this step has been executed, they can execute
- * other postprocess steps on the data. The code might also be useful to
- * quickly adapt code that doesn't result in a verbose representation of
- * the scene data.
- * The step has been added because it was required by the viewer, however
- * it has been moved to the main library since others might find it
- * useful, too. */
-class ASSIMP_API MakeVerboseFormatProcess : public BaseProcess
-{
- friend class Importer;
-
-protected:
-
- /** Constructor to be privately used by Importer, or by applications
- which know what they are doing if they modify the aiScene object */
- MakeVerboseFormatProcess();
-
- /** Destructor, private as well */
- ~MakeVerboseFormatProcess();
-
-public:
-
- // -------------------------------------------------------------------
- /** Returns whether the processing step is present in the given flag field.
- * @param pFlags The processing flags the importer was called with. A bitwise
- * combination of #aiPostProcessSteps.
- * @return true if the process is present in this flag fields, false if not */
- bool IsActive( unsigned int /*pFlags*/ ) const
- {
- // NOTE: There is no direct flag that corresponds to
- // this postprocess step.
- return false;
- }
-
- // -------------------------------------------------------------------
- /** Executes the post processing step on the given imported data.
- * At the moment a process is not supposed to fail.
- * @param pScene The imported data to work at. */
- void Execute( aiScene* pScene);
-
-
-private:
-
- //! Apply the postprocess step to a given submesh
- bool MakeVerboseFormat (aiMesh* pcMesh);
-};
-
-} // end of namespace Assimp
-
-#endif // !!AI_KILLNORMALPROCESS_H_INC
diff --git a/3rdparty/assimp/code/MaterialSystem.cpp b/3rdparty/assimp/code/MaterialSystem.cpp
deleted file mode 100644
index 0df12ba0..00000000
--- a/3rdparty/assimp/code/MaterialSystem.cpp
+++ /dev/null
@@ -1,612 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file MaterialSystem.cpp
- * @brief Implementation of the material system of the library
- */
-
-#include "AssimpPCH.h"
-
-#include "Hash.h"
-#include "fast_atof.h"
-#include "ParsingUtils.h"
-
-using namespace Assimp;
-
-// ------------------------------------------------------------------------------------------------
-// Get a specific property from a material
-aiReturn aiGetMaterialProperty(const aiMaterial* pMat,
- const char* pKey,
- unsigned int type,
- unsigned int index,
- const aiMaterialProperty** pPropOut)
-{
- ai_assert (pMat != NULL);
- ai_assert (pKey != NULL);
- ai_assert (pPropOut != NULL);
-
- /* Just search for a property with exactly this name ..
- * could be improved by hashing, but it's possibly
- * no worth the effort (we're bound to C structures,
- * thus std::map or derivates are not applicable. */
- for (unsigned int i = 0; i < pMat->mNumProperties;++i) {
- aiMaterialProperty* prop = pMat->mProperties[i];
-
- if (prop /* just for safety ... */
- && 0 == strcmp( prop->mKey.data, pKey )
- && (0xffffffff == type || prop->mSemantic == type) /* 0xffffffff is a wildcard, but this is undocumented :-) */
- && (0xffffffff == index || prop->mIndex == index))
- {
- *pPropOut = pMat->mProperties[i];
- return AI_SUCCESS;
- }
- }
- *pPropOut = NULL;
- return AI_FAILURE;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Get an array of floating-point values from the material.
-aiReturn aiGetMaterialFloatArray(const aiMaterial* pMat,
- const char* pKey,
- unsigned int type,
- unsigned int index,
- float* pOut,
- unsigned int* pMax)
-{
- ai_assert (pOut != NULL);
- ai_assert (pMat != NULL);
-
- const aiMaterialProperty* prop;
- aiGetMaterialProperty(pMat,pKey,type,index, (const aiMaterialProperty**) &prop);
- if (!prop) {
- return AI_FAILURE;
- }
-
- // data is given in floats, simply copy it
- unsigned int iWrite;
- if ( aiPTI_Float == prop->mType || aiPTI_Buffer == prop->mType) {
- iWrite = prop->mDataLength / sizeof(float);
- if (pMax) {
- iWrite = std::min(*pMax,iWrite); ;
- }
- for (unsigned int a = 0; a < iWrite;++a) {
- pOut[a] = static_cast<float> ( reinterpret_cast<float*>(prop->mData)[a] );
- }
- if (pMax) {
- *pMax = iWrite;
- }
- }
- // data is given in ints, convert to float
- else if ( aiPTI_Integer == prop->mType) {
- iWrite = prop->mDataLength / sizeof(int32_t);
- if (pMax) {
- iWrite = std::min(*pMax,iWrite); ;
- }
- for (unsigned int a = 0; a < iWrite;++a) {
- pOut[a] = static_cast<float> ( reinterpret_cast<int32_t*>(prop->mData)[a] );
- }
- if (pMax) {
- *pMax = iWrite;
- }
- }
- // a string ... read floats separated by spaces
- else {
- if (pMax) {
- iWrite = *pMax;
- }
- // strings are zero-terminated with a 32 bit length prefix, so this is safe
- const char* cur = prop->mData+4;
- ai_assert(prop->mDataLength>=5 && !prop->mData[prop->mDataLength-1]);
- for (unsigned int a = 0; ;++a) {
- cur = fast_atof_move(cur,pOut[a]);
- if (a==iWrite-1) {
- break;
- }
- if (!IsSpace(*cur)) {
- DefaultLogger::get()->error("Material property" + std::string(pKey) +
- " is a string; failed to parse a float array out of it.");
- return AI_FAILURE;
- }
- }
-
- if (pMax) {
- *pMax = iWrite;
- }
- }
- return AI_SUCCESS;
-
-}
-
-// ------------------------------------------------------------------------------------------------
-// Get an array if integers from the material
-aiReturn aiGetMaterialIntegerArray(const aiMaterial* pMat,
- const char* pKey,
- unsigned int type,
- unsigned int index,
- int* pOut,
- unsigned int* pMax)
-{
- ai_assert (pOut != NULL);
- ai_assert (pMat != NULL);
-
- const aiMaterialProperty* prop;
- aiGetMaterialProperty(pMat,pKey,type,index,(const aiMaterialProperty**) &prop);
- if (!prop) {
- return AI_FAILURE;
- }
-
- // data is given in ints, simply copy it
- unsigned int iWrite;
- if ( aiPTI_Integer == prop->mType || aiPTI_Buffer == prop->mType) {
- iWrite = prop->mDataLength / sizeof(int32_t);
- if (pMax) {
- iWrite = std::min(*pMax,iWrite); ;
- }
- for (unsigned int a = 0; a < iWrite;++a) {
- pOut[a] = static_cast<int>(reinterpret_cast<int32_t*>(prop->mData)[a]);
- }
- if (pMax) {
- *pMax = iWrite;
- }
- }
- // data is given in floats convert to int
- else if ( aiPTI_Float == prop->mType) {
- iWrite = prop->mDataLength / sizeof(float);
- if (pMax) {
- iWrite = std::min(*pMax,iWrite); ;
- }
- for (unsigned int a = 0; a < iWrite;++a) {
- pOut[a] = static_cast<int>(reinterpret_cast<float*>(prop->mData)[a]);
- }
- if (pMax) {
- *pMax = iWrite;
- }
- }
- // it is a string ... no way to read something out of this
- else {
- if (pMax) {
- iWrite = *pMax;
- }
- // strings are zero-terminated with a 32 bit length prefix, so this is safe
- const char* cur = prop->mData+4;
- ai_assert(prop->mDataLength>=5 && !prop->mData[prop->mDataLength-1]);
- for (unsigned int a = 0; ;++a) {
- pOut[a] = strtol10s(cur,&cur);
- if (a==iWrite-1) {
- break;
- }
- if (!IsSpace(*cur)) {
- DefaultLogger::get()->error("Material property" + std::string(pKey) +
- " is a string; failed to parse an integer array out of it.");
- return AI_FAILURE;
- }
- }
-
- if (pMax) {
- *pMax = iWrite;
- }
- }
- return AI_SUCCESS;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Get a color (3 or 4 floats) from the material
-aiReturn aiGetMaterialColor(const aiMaterial* pMat,
- const char* pKey,
- unsigned int type,
- unsigned int index,
- aiColor4D* pOut)
-{
- unsigned int iMax = 4;
- const aiReturn eRet = aiGetMaterialFloatArray(pMat,pKey,type,index,(float*)pOut,&iMax);
-
- // if no alpha channel is defined: set it to 1.0
- if (3 == iMax) {
- pOut->a = 1.0f;
- }
-
- return eRet;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Get a string from the material
-aiReturn aiGetMaterialString(const aiMaterial* pMat,
- const char* pKey,
- unsigned int type,
- unsigned int index,
- aiString* pOut)
-{
- ai_assert (pOut != NULL);
-
- const aiMaterialProperty* prop;
- aiGetMaterialProperty(pMat,pKey,type,index,(const aiMaterialProperty**)&prop);
- if (!prop) {
- return AI_FAILURE;
- }
-
- if ( aiPTI_String == prop->mType) {
- ai_assert(prop->mDataLength>=5);
-
- // The string is stored as 32 but length prefix followed by zero-terminated UTF8 data
- pOut->length = static_cast<unsigned int>(*reinterpret_cast<uint32_t*>(prop->mData));
-
- ai_assert(pOut->length+1+4==prop->mDataLength && !prop->mData[prop->mDataLength-1]);
- memcpy(pOut->data,prop->mData+4,pOut->length+1);
- }
- else {
- // TODO - implement lexical cast as well
- DefaultLogger::get()->error("Material property" + std::string(pKey) +
- " was found, but is no string" );
- return AI_FAILURE;
- }
- return AI_SUCCESS;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Get the number of textures on a particular texture stack
-ASSIMP_API unsigned int aiGetMaterialTextureCount(const C_STRUCT aiMaterial* pMat,
- C_ENUM aiTextureType type)
-{
- ai_assert (pMat != NULL);
-
- /* Textures are always stored with ascending indices (ValidateDS provides a check, so we don't need to do it again) */
- unsigned int max = 0;
- for (unsigned int i = 0; i < pMat->mNumProperties;++i) {
- aiMaterialProperty* prop = pMat->mProperties[i];
-
- if (prop /* just a sanity check ... */
- && 0 == strcmp( prop->mKey.data, _AI_MATKEY_TEXTURE_BASE )
- && prop->mSemantic == type) {
-
- max = std::max(max,prop->mIndex+1);
- }
- }
- return max;
-}
-
-// ------------------------------------------------------------------------------------------------
-aiReturn aiGetMaterialTexture(const C_STRUCT aiMaterial* mat,
- aiTextureType type,
- unsigned int index,
- C_STRUCT aiString* path,
- aiTextureMapping* _mapping /*= NULL*/,
- unsigned int* uvindex /*= NULL*/,
- float* blend /*= NULL*/,
- aiTextureOp* op /*= NULL*/,
- aiTextureMapMode* mapmode /*= NULL*/,
- unsigned int* flags /*= NULL*/
- )
-{
- ai_assert(NULL != mat && NULL != path);
-
- // Get the path to the texture
- if (AI_SUCCESS != aiGetMaterialString(mat,AI_MATKEY_TEXTURE(type,index),path)) {
- return AI_FAILURE;
- }
- // Determine mapping type
- aiTextureMapping mapping = aiTextureMapping_UV;
- aiGetMaterialInteger(mat,AI_MATKEY_MAPPING(type,index),(int*)&mapping);
- if (_mapping)
- *_mapping = mapping;
-
- // Get UV index
- if (aiTextureMapping_UV == mapping && uvindex) {
- aiGetMaterialInteger(mat,AI_MATKEY_UVWSRC(type,index),(int*)uvindex);
- }
- // Get blend factor
- if (blend) {
- aiGetMaterialFloat(mat,AI_MATKEY_TEXBLEND(type,index),blend);
- }
- // Get texture operation
- if (op){
- aiGetMaterialInteger(mat,AI_MATKEY_TEXOP(type,index),(int*)op);
- }
- // Get texture mapping modes
- if (mapmode) {
- aiGetMaterialInteger(mat,AI_MATKEY_MAPPINGMODE_U(type,index),(int*)&mapmode[0]);
- aiGetMaterialInteger(mat,AI_MATKEY_MAPPINGMODE_V(type,index),(int*)&mapmode[1]);
- }
- // Get texture flags
- if (flags){
- aiGetMaterialInteger(mat,AI_MATKEY_TEXFLAGS(type,index),(int*)flags);
- }
- return AI_SUCCESS;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Construction. Actually the one and only way to get an aiMaterial instance
-MaterialHelper::MaterialHelper()
-{
- // Allocate 5 entries by default
- mNumProperties = 0;
- mNumAllocated = 5;
- mProperties = new aiMaterialProperty*[5];
-}
-
-// ------------------------------------------------------------------------------------------------
-MaterialHelper::~MaterialHelper()
-{
- _InternDestruct();
-}
-
-// ------------------------------------------------------------------------------------------------
-aiMaterial::~aiMaterial()
-{
- // HACK (Aramis): This is safe: aiMaterial has a private constructor,
- // so instances must be created indirectly via MaterialHelper. We can't
- // use a virtual d'tor because we need to preserve binary compatibility
- // with good old C ...
- ((MaterialHelper*)this)->_InternDestruct();
-}
-
-// ------------------------------------------------------------------------------------------------
-// Manual destructor
-void MaterialHelper::_InternDestruct()
-{
- // First clean up all properties
- Clear();
-
- // Then delete the array that stored them
- delete[] mProperties;
- AI_DEBUG_INVALIDATE_PTR(mProperties);
-
- // Update members
- mNumAllocated = 0;
-}
-
-// ------------------------------------------------------------------------------------------------
-void MaterialHelper::Clear()
-{
- for (unsigned int i = 0; i < mNumProperties;++i) {
- // delete this entry
- delete mProperties[i];
- AI_DEBUG_INVALIDATE_PTR(mProperties[i]);
- }
- mNumProperties = 0;
-
- // The array remains allocated, we just invalidated its contents
-}
-
-// ------------------------------------------------------------------------------------------------
-uint32_t MaterialHelper::ComputeHash(bool includeMatName /*= false*/)
-{
- uint32_t hash = 1503; // magic start value, choosen to be my birthday :-)
- for (unsigned int i = 0; i < mNumProperties;++i) {
- aiMaterialProperty* prop;
-
- // Exclude all properties whose first character is '?' from the hash
- // See doc for aiMaterialProperty.
- if ((prop = mProperties[i]) && (includeMatName || prop->mKey.data[0] != '?')) {
-
- hash = SuperFastHash(prop->mKey.data,(unsigned int)prop->mKey.length,hash);
- hash = SuperFastHash(prop->mData,prop->mDataLength,hash);
-
- // Combine the semantic and the index with the hash
- hash = SuperFastHash((const char*)&prop->mSemantic,sizeof(unsigned int),hash);
- hash = SuperFastHash((const char*)&prop->mIndex,sizeof(unsigned int),hash);
- }
- }
- return hash;
-}
-
-// ------------------------------------------------------------------------------------------------
-aiReturn MaterialHelper::RemoveProperty (const char* pKey,unsigned int type,
- unsigned int index
- )
-{
- ai_assert(NULL != pKey);
-
- for (unsigned int i = 0; i < mNumProperties;++i) {
- aiMaterialProperty* prop = mProperties[i];
-
- if (prop && !strcmp( prop->mKey.data, pKey ) &&
- prop->mSemantic == type && prop->mIndex == index)
- {
- // Delete this entry
- delete mProperties[i];
-
- // collapse the array behind --.
- --mNumProperties;
- for (unsigned int a = i; a < mNumProperties;++a) {
- mProperties[a] = mProperties[a+1];
- }
- return AI_SUCCESS;
- }
- }
-
- return AI_FAILURE;
-}
-
-// ------------------------------------------------------------------------------------------------
-aiReturn MaterialHelper::AddBinaryProperty (const void* pInput,
- unsigned int pSizeInBytes,
- const char* pKey,
- unsigned int type,
- unsigned int index,
- aiPropertyTypeInfo pType
- )
-{
- ai_assert (pInput != NULL);
- ai_assert (pKey != NULL);
- ai_assert (0 != pSizeInBytes);
-
- // first search the list whether there is already an entry with this key
- unsigned int iOutIndex = 0xffffffff;
- for (unsigned int i = 0; i < mNumProperties;++i) {
- aiMaterialProperty* prop = mProperties[i];
-
- if (prop /* just for safety */ && !strcmp( prop->mKey.data, pKey ) &&
- prop->mSemantic == type && prop->mIndex == index){
-
- delete mProperties[i];
- iOutIndex = i;
- }
- }
-
- // Allocate a new material property
- aiMaterialProperty* pcNew = new aiMaterialProperty();
-
- // .. and fill it
- pcNew->mType = pType;
- pcNew->mSemantic = type;
- pcNew->mIndex = index;
-
- pcNew->mDataLength = pSizeInBytes;
- pcNew->mData = new char[pSizeInBytes];
- memcpy (pcNew->mData,pInput,pSizeInBytes);
-
- pcNew->mKey.length = ::strlen(pKey);
- ai_assert ( MAXLEN > pcNew->mKey.length);
- strcpy( pcNew->mKey.data, pKey );
-
- if (0xffffffff != iOutIndex) {
- mProperties[iOutIndex] = pcNew;
- return AI_SUCCESS;
- }
-
- // resize the array ... double the storage allocated
- if (mNumProperties == mNumAllocated) {
- const unsigned int iOld = mNumAllocated;
- mNumAllocated *= 2;
-
- aiMaterialProperty** ppTemp;
- try {
- ppTemp = new aiMaterialProperty*[mNumAllocated];
- } catch (std::bad_alloc&) {
- return AI_OUTOFMEMORY;
- }
-
- // just copy all items over; then replace the old array
- memcpy (ppTemp,mProperties,iOld * sizeof(void*));
-
- delete[] mProperties;
- mProperties = ppTemp;
- }
- // push back ...
- mProperties[mNumProperties++] = pcNew;
- return AI_SUCCESS;
-}
-
-// ------------------------------------------------------------------------------------------------
-aiReturn MaterialHelper::AddProperty (const aiString* pInput,
- const char* pKey,
- unsigned int type,
- unsigned int index)
-{
- // We don't want to add the whole buffer .. write a 32 bit length
- // prefix followed by the zero-terminated UTF8 string.
- // (HACK) I don't want to break the ABI now, but we definitely
- // ought to change aiString::mLength to uint32_t one day.
- if (sizeof(size_t) == 8) {
- aiString copy = *pInput;
- uint32_t* s = reinterpret_cast<uint32_t*>(&copy.length);
- s[1] = static_cast<uint32_t>(pInput->length);
-
- return AddBinaryProperty(s+1,
- pInput->length+1+4,
- pKey,
- type,
- index,
- aiPTI_String);
- }
- ai_assert(sizeof(size_t)==4);
- return AddBinaryProperty(pInput,
- pInput->length+1+4,
- pKey,
- type,
- index,
- aiPTI_String);
-}
-
-// ------------------------------------------------------------------------------------------------
-void MaterialHelper::CopyPropertyList(MaterialHelper* pcDest,
- const MaterialHelper* pcSrc
- )
-{
- ai_assert(NULL != pcDest);
- ai_assert(NULL != pcSrc);
-
- unsigned int iOldNum = pcDest->mNumProperties;
- pcDest->mNumAllocated += pcSrc->mNumAllocated;
- pcDest->mNumProperties += pcSrc->mNumProperties;
-
- aiMaterialProperty** pcOld = pcDest->mProperties;
- pcDest->mProperties = new aiMaterialProperty*[pcDest->mNumAllocated];
-
- if (iOldNum && pcOld) {
- for (unsigned int i = 0; i < iOldNum;++i) {
- pcDest->mProperties[i] = pcOld[i];
- }
-
- delete[] pcOld;
- }
- for (unsigned int i = iOldNum; i< pcDest->mNumProperties;++i) {
- aiMaterialProperty* propSrc = pcSrc->mProperties[i];
-
- // search whether we have already a property with this name -> if yes, overwrite it
- aiMaterialProperty* prop;
- for (unsigned int q = 0; q < iOldNum;++q) {
- prop = pcDest->mProperties[q];
- if (prop /* just for safety */ && prop->mKey == propSrc->mKey && prop->mSemantic == propSrc->mSemantic
- && prop->mIndex == propSrc->mIndex) {
- delete prop;
-
- // collapse the whole array ...
- memmove(&pcDest->mProperties[q],&pcDest->mProperties[q+1],i-q);
- i--;
- pcDest->mNumProperties--;
- }
- }
-
- // Allocate the output property and copy the source property
- prop = pcDest->mProperties[i] = new aiMaterialProperty();
- prop->mKey = propSrc->mKey;
- prop->mDataLength = propSrc->mDataLength;
- prop->mType = propSrc->mType;
- prop->mSemantic = propSrc->mSemantic;
- prop->mIndex = propSrc->mIndex;
-
- prop->mData = new char[propSrc->mDataLength];
- memcpy(prop->mData,propSrc->mData,prop->mDataLength);
- }
- return;
-}
-
diff --git a/3rdparty/assimp/code/MaterialSystem.h b/3rdparty/assimp/code/MaterialSystem.h
deleted file mode 100644
index 1504b688..00000000
--- a/3rdparty/assimp/code/MaterialSystem.h
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file MaterialSystem.h
- * Definition of the #MaterialHelper utility class.
- */
-#ifndef AI_MATERIALSYSTEM_H_INC
-#define AI_MATERIALSYSTEM_H_INC
-
-#include "../include/aiMaterial.h"
-namespace Assimp {
-
-// ----------------------------------------------------------------------------------------
-/** Internal material helper class deriving from aiMaterial.
- *
- * Intended to be used to fill an aiMaterial structure more easily.
- */
-class ASSIMP_API MaterialHelper : public ::aiMaterial
-{
-public:
-
- // Construction and destruction
- MaterialHelper();
- ~MaterialHelper();
-
- // ------------------------------------------------------------------------------
- /** @brief Add a property with a given key and type info to the material
- * structure
- *
- * @param pInput Pointer to input data
- * @param pSizeInBytes Size of input data
- * @param pKey Key/Usage of the property (AI_MATKEY_XXX)
- * @param type Set by the AI_MATKEY_XXX macro
- * @param index Set by the AI_MATKEY_XXX macro
- * @param pType Type information hint
- */
- aiReturn AddBinaryProperty (const void* pInput,
- unsigned int pSizeInBytes,
- const char* pKey,
- unsigned int type ,
- unsigned int index ,
- aiPropertyTypeInfo pType);
-
- // ------------------------------------------------------------------------------
- /** @brief Add a string property with a given key and type info to the
- * material structure
- *
- * @param pInput Input string
- * @param pKey Key/Usage of the property (AI_MATKEY_XXX)
- * @param type Set by the AI_MATKEY_XXX macro
- * @param index Set by the AI_MATKEY_XXX macro
- */
- aiReturn AddProperty (const aiString* pInput,
- const char* pKey,
- unsigned int type = 0,
- unsigned int index = 0);
-
- // ------------------------------------------------------------------------------
- /** @brief Add a property with a given key to the material structure
- * @param pInput Pointer to the input data
- * @param pNumValues Number of values in the array
- * @param pKey Key/Usage of the property (AI_MATKEY_XXX)
- * @param type Set by the AI_MATKEY_XXX macro
- * @param index Set by the AI_MATKEY_XXX macro
- */
- template<class TYPE>
- aiReturn AddProperty (const TYPE* pInput,
- unsigned int pNumValues,
- const char* pKey,
- unsigned int type = 0,
- unsigned int index = 0);
-
- // ------------------------------------------------------------------------------
- /** @brief Remove a given key from the list.
- *
- * The function fails if the key isn't found
- * @param pKey Key to be deleted
- */
- aiReturn RemoveProperty (const char* pKey,
- unsigned int type = 0,
- unsigned int index = 0);
-
- // ------------------------------------------------------------------------------
- /** @brief Removes all properties from the material.
- *
- * The data array remains allocated so adding new properties is quite fast.
- */
- void Clear();
-
- // ------------------------------------------------------------------------------
- /** Computes a hash (hopefully unique) from all material properties
- * The hash value reflects the current property state, so if you add any
- * proprty and call this method again, the resulting hash value will be
- * different.
- *
- * @param includeMatName Set to 'true' to take all properties with
- * '?' as initial character in their name into account.
- * Currently #AI_MATKEY_NAME is the only example.
- * @return Unique hash
- */
- uint32_t ComputeHash(bool includeMatName = false);
-
- // ------------------------------------------------------------------------------
- /** Copy the property list of a material
- * @param pcDest Destination material
- * @param pcSrc Source material
- */
- static void CopyPropertyList(MaterialHelper* pcDest,
- const MaterialHelper* pcSrc);
-
-public:
- // For internal use. That's why it's public.
- void _InternDestruct();
-};
-
-
-// ----------------------------------------------------------------------------------------
-template<class TYPE>
-aiReturn MaterialHelper::AddProperty (const TYPE* pInput,
- const unsigned int pNumValues,
- const char* pKey,
- unsigned int type,
- unsigned int index)
-{
- return AddBinaryProperty((const void*)pInput,
- pNumValues * sizeof(TYPE),
- pKey,type,index,aiPTI_Buffer);
-}
-
-// ----------------------------------------------------------------------------------------
-template<>
-inline aiReturn MaterialHelper::AddProperty<float> (const float* pInput,
- const unsigned int pNumValues,
- const char* pKey,
- unsigned int type,
- unsigned int index)
-{
- return AddBinaryProperty((const void*)pInput,
- pNumValues * sizeof(float),
- pKey,type,index,aiPTI_Float);
-}
-
-// ----------------------------------------------------------------------------------------
-template<>
-inline aiReturn MaterialHelper::AddProperty<aiUVTransform> (const aiUVTransform* pInput,
- const unsigned int pNumValues,
- const char* pKey,
- unsigned int type,
- unsigned int index)
-{
- return AddBinaryProperty((const void*)pInput,
- pNumValues * sizeof(aiUVTransform),
- pKey,type,index,aiPTI_Float);
-}
-
-// ----------------------------------------------------------------------------------------
-template<>
-inline aiReturn MaterialHelper::AddProperty<aiColor4D> (const aiColor4D* pInput,
- const unsigned int pNumValues,
- const char* pKey,
- unsigned int type,
- unsigned int index)
-{
- return AddBinaryProperty((const void*)pInput,
- pNumValues * sizeof(aiColor4D),
- pKey,type,index,aiPTI_Float);
-}
-
-// ----------------------------------------------------------------------------------------
-template<>
-inline aiReturn MaterialHelper::AddProperty<aiColor3D> (const aiColor3D* pInput,
- const unsigned int pNumValues,
- const char* pKey,
- unsigned int type,
- unsigned int index)
-{
- return AddBinaryProperty((const void*)pInput,
- pNumValues * sizeof(aiColor3D),
- pKey,type,index,aiPTI_Float);
-}
-
-// ----------------------------------------------------------------------------------------
-template<>
-inline aiReturn MaterialHelper::AddProperty<aiVector3D> (const aiVector3D* pInput,
- const unsigned int pNumValues,
- const char* pKey,
- unsigned int type,
- unsigned int index)
-{
- return AddBinaryProperty((const void*)pInput,
- pNumValues * sizeof(aiVector3D),
- pKey,type,index,aiPTI_Float);
-}
-
-// ----------------------------------------------------------------------------------------
-template<>
-inline aiReturn MaterialHelper::AddProperty<int> (const int* pInput,
- const unsigned int pNumValues,
- const char* pKey,
- unsigned int type,
- unsigned int index)
-{
- return AddBinaryProperty((const void*)pInput,
- pNumValues * sizeof(int),
- pKey,type,index,aiPTI_Integer);
-}
-} // ! namespace Assimp
-
-#endif //!! AI_MATERIALSYSTEM_H_INC
diff --git a/3rdparty/assimp/code/MemoryIOWrapper.h b/3rdparty/assimp/code/MemoryIOWrapper.h
deleted file mode 100644
index d40102ee..00000000
--- a/3rdparty/assimp/code/MemoryIOWrapper.h
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file MemoryIOWrapper.h
- * Handy IOStream/IOSystem implemetation to read directly from a memory buffer */
-#ifndef AI_MEMORYIOSTREAM_H_INC
-#define AI_MEMORYIOSTREAM_H_INC
-namespace Assimp {
-#define AI_MEMORYIO_MAGIC_FILENAME "$$$___magic___$$$"
-#define AI_MEMORYIO_MAGIC_FILENAME_LENGTH 17
-
-// ----------------------------------------------------------------------------------
-/** Implementation of IOStream to read directly from a memory buffer */
-// ----------------------------------------------------------------------------------
-class MemoryIOStream : public IOStream
-{
- //friend class MemoryIOSystem;
-public:
- MemoryIOStream (const uint8_t* buff, size_t len)
- : buffer (buff), length(len), pos((size_t)0) {
- }
-
-public:
- ~MemoryIOStream () {
- }
-
- // -------------------------------------------------------------------
- // Read from stream
- size_t Read(void* pvBuffer, size_t pSize, size_t pCount) {
- const size_t cnt = std::min(pCount,(length-pos)/pSize),ofs = pSize*cnt;
-
- memcpy(pvBuffer,buffer+pos,ofs);
- pos += ofs;
-
- return cnt;
- }
-
- // -------------------------------------------------------------------
- // Write to stream
- size_t Write(const void* pvBuffer, size_t pSize,size_t pCount) {
- ai_assert(false); // won't be needed
- return 0;
- }
-
- // -------------------------------------------------------------------
- // Seek specific position
- aiReturn Seek(size_t pOffset, aiOrigin pOrigin) {
- if (aiOrigin_SET == pOrigin) {
- if (pOffset >= length) {
- return AI_FAILURE;
- }
- pos = pOffset;
- }
- else if (aiOrigin_END == pOrigin) {
- if (pOffset >= length) {
- return AI_FAILURE;
- }
- pos = length-pOffset;
- }
- else {
- if (pOffset+pos >= length) {
- return AI_FAILURE;
- }
- pos += pOffset;
- }
- return AI_SUCCESS;
- }
-
- // -------------------------------------------------------------------
- // Get current seek position
- size_t Tell() const {
- return pos;
- }
-
- // -------------------------------------------------------------------
- // Get size of file
- size_t FileSize() const {
- return length;
- }
-
- // -------------------------------------------------------------------
- // Flush file contents
- void Flush() {
- ai_assert(false); // won't be needed
- }
-
-private:
- const uint8_t* buffer;
- size_t length,pos;
-};
-
-// ---------------------------------------------------------------------------
-/** Dummy IO system to read from a memory buffer */
-class MemoryIOSystem : public IOSystem
-{
-public:
- /** Constructor. */
- MemoryIOSystem (const uint8_t* buff, size_t len)
- : buffer (buff), length(len) {
- }
-
- /** Destructor. */
- ~MemoryIOSystem() {
- }
-
- // -------------------------------------------------------------------
- /** Tests for the existence of a file at the given path. */
- bool Exists( const char* pFile) const {
- return !strncmp(pFile,AI_MEMORYIO_MAGIC_FILENAME,AI_MEMORYIO_MAGIC_FILENAME_LENGTH);
- }
-
- // -------------------------------------------------------------------
- /** Returns the directory separator. */
- char getOsSeparator() const {
- return '/'; // why not? it doesn't care
- }
-
- // -------------------------------------------------------------------
- /** Open a new file with a given path. */
- IOStream* Open( const char* pFile, const char* pMode = "rb") {
- if (strncmp(pFile,AI_MEMORYIO_MAGIC_FILENAME,AI_MEMORYIO_MAGIC_FILENAME_LENGTH)) {
- return NULL;
- }
- return new MemoryIOStream(buffer,length);
- }
-
- // -------------------------------------------------------------------
- /** Closes the given file and releases all resources associated with it. */
- void Close( IOStream* pFile) {
- }
-
- // -------------------------------------------------------------------
- /** Compare two paths */
- bool ComparePaths (const char* one, const char* second) const {
- return false;
- }
-
-private:
- const uint8_t* buffer;
- size_t length;
-};
-} // end namespace Assimp
-
-#endif
diff --git a/3rdparty/assimp/code/NDOLoader.cpp b/3rdparty/assimp/code/NDOLoader.cpp
deleted file mode 100644
index 1bd06c92..00000000
--- a/3rdparty/assimp/code/NDOLoader.cpp
+++ /dev/null
@@ -1,289 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2009, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file NDOLoader.cpp
- * Implementation of the NDO importer class.
- */
-
-#include "AssimpPCH.h"
-#ifndef AI_BUILD_NO_NDO_IMPORTER
-#include "NDOLoader.h"
-
-using namespace Assimp;
-#define for_each BOOST_FOREACH
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-NDOImporter::NDOImporter()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-NDOImporter::~NDOImporter()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the class can handle the format of the given file.
-bool NDOImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const
-{
- // check file extension
- const std::string extension = GetExtension(pFile);
-
- if ( extension == "ndo")
- return true;
-
- if ((checkSig || !extension.length()) && pIOHandler) {
- const char* tokens[] = {"nendo"};
- return SearchFileHeaderForToken(pIOHandler,pFile,tokens,1,5);
- }
- return false;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Build a string of all file extensions supported
-void NDOImporter::GetExtensionList(std::set<std::string>& extensions)
-{
- extensions.insert("ndo");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Setup configuration properties for the loader
-void NDOImporter::SetupProperties(const Importer* pImp)
-{
- // nothing to be done for the moment
-}
-
-// ------------------------------------------------------------------------------------------------
-// Imports the given file into the given scene structure.
-void NDOImporter::InternReadFile( const std::string& pFile,
- aiScene* pScene, IOSystem* pIOHandler)
-{
- StreamReaderBE reader(pIOHandler->Open( pFile, "rb"));
-
- // first 9 bytes are nendo file format ("nendo 1.n")
- const char* head = (const char*)reader.GetPtr();
- reader.IncPtr(9);
-
- if (strncmp("nendo ",head,6)) {
- throw DeadlyImportError("Not a Nendo file; magic signature missing");
- }
- // check if this is a supported version. if not, continue, too -- users,
- // please don't complain if it doesn't work then ...
- unsigned int file_format = 12;
- if (!strncmp("1.0",head+6,3)) {
- file_format = 10;
- DefaultLogger::get()->info("NDO file format is 1.0");
- }
- else if (!strncmp("1.1",head+6,3)) {
- file_format = 11;
- DefaultLogger::get()->info("NDO file format is 1.1");
- }
- else if (!strncmp("1.2",head+6,3)) {
- file_format = 12;
- DefaultLogger::get()->info("NDO file format is 1.2");
- }
- else {
- DefaultLogger::get()->warn(std::string("Unrecognized nendo file format version, continuing happily ... :") + (head+6));
- }
-
- reader.IncPtr(2); /* skip flags */
- if (file_format >= 12) {
- reader.IncPtr(2);
- }
- unsigned int temp = reader.GetU1();
-
- std::vector<Object> objects(temp); /* buffer to store all the loaded objects in */
-
- // read all objects
- for (unsigned int o = 0; o < objects.size(); ++o) {
-
-// if (file_format < 12) {
- if (!reader.GetI1()) {
- continue; /* skip over empty object */
- }
- // reader.GetI2();
-// }
- Object& obj = objects[o];
-
- temp = file_format >= 12 ? reader.GetU4() : reader.GetU2();
- head = (const char*)reader.GetPtr();
- reader.IncPtr(temp + 76); /* skip unknown stuff */
-
- obj.name = std::string(head, temp);
-
- // read edge table
- temp = file_format >= 12 ? reader.GetU4() : reader.GetU2();
- obj.edges.reserve(temp);
- for (unsigned int e = 0; e < temp; ++e) {
-
- obj.edges.push_back(Edge());
- Edge& edge = obj.edges.back();
-
- for (unsigned int i = 0; i< 8; ++i) {
- edge.edge[i] = file_format >= 12 ? reader.GetU4() : reader.GetU2();
- }
- edge.hard = file_format >= 11 ? reader.GetU1() : 0;
- for (unsigned int i = 0; i< 8; ++i) {
- edge.color[i] = reader.GetU1();
- }
- }
-
- // read face table
- temp = file_format >= 12 ? reader.GetU4() : reader.GetU2();
- obj.faces.reserve(temp);
- for (unsigned int e = 0; e < temp; ++e) {
-
- obj.faces.push_back(Face());
- Face& face = obj.faces.back();
-
- face.elem = file_format >= 12 ? reader.GetU4() : reader.GetU2();
- }
-
- // read vertex table
- temp = file_format >= 12 ? reader.GetU4() : reader.GetU2();
- obj.vertices.reserve(temp);
- for (unsigned int e = 0; e < temp; ++e) {
-
- obj.vertices.push_back(Vertex());
- Vertex& v = obj.vertices.back();
-
- v.num = file_format >= 12 ? reader.GetU4() : reader.GetU2();
- v.val.x = reader.GetF4();
- v.val.y = reader.GetF4();
- v.val.z = reader.GetF4();
- }
-
- // read UVs
- temp = file_format >= 12 ? reader.GetU4() : reader.GetU2();
- for (unsigned int e = 0; e < temp; ++e) {
- file_format >= 12 ? reader.GetU4() : reader.GetU2();
- }
-
- temp = file_format >= 12 ? reader.GetU4() : reader.GetU2();
- for (unsigned int e = 0; e < temp; ++e) {
- file_format >= 12 ? reader.GetU4() : reader.GetU2();
- }
-
- if (reader.GetU1()) {
- const unsigned int x = reader.GetU2(), y = reader.GetU2();
- temp = 0;
- while (temp < x*y) {
- unsigned int repeat = reader.GetU1();
- reader.GetU1();
- reader.GetU1();
- reader.GetU1();
- temp += repeat;
- }
- }
- }
-
- // construct a dummy node graph and add all named objects as child nodes
- aiNode* root = pScene->mRootNode = new aiNode("$NDODummyRoot");
- aiNode** cc = root->mChildren = new aiNode* [ root->mNumChildren = static_cast<unsigned int>( objects.size()) ] ();
- pScene->mMeshes = new aiMesh* [ root->mNumChildren] ();
-
- std::vector<aiVector3D> vertices;
- std::vector<unsigned int> indices;
-
- for_each(const Object& obj,objects) {
- aiNode* nd = *cc++ = new aiNode(obj.name);
- nd->mParent = root;
-
- // translated from a python dict() - a vector might be sufficient as well
- typedef std::map<unsigned int, unsigned int> FaceTable;
- FaceTable face_table;
-
- unsigned int n = 0;
- for_each(const Edge& edge, obj.edges) {
-
- face_table[edge.edge[2]] = n;
- face_table[edge.edge[3]] = n;
-
- ++n;
- }
-
- aiMesh* mesh = new aiMesh();
- aiFace* faces = mesh->mFaces = new aiFace[mesh->mNumFaces=face_table.size()];
-
- vertices.clear();
- vertices.reserve(4 * face_table.size()); // arbitrarily choosen
- for_each(FaceTable::value_type& v, face_table) {
- indices.clear();
-
- aiFace& f = *faces++;
-
- const unsigned int key = v.first;
- unsigned int cur_edge = v.second;
- while (1) {
- unsigned int next_edge, next_vert;
- if (key == obj.edges[cur_edge].edge[3]) {
- next_edge = obj.edges[cur_edge].edge[5];
- next_vert = obj.edges[cur_edge].edge[1];
- }
- else {
- next_edge = obj.edges[cur_edge].edge[4];
- next_vert = obj.edges[cur_edge].edge[0];
- }
- indices.push_back( vertices.size() );
- vertices.push_back(obj.vertices[ next_vert ].val);
-
- cur_edge = next_edge;
- if (cur_edge == v.second) {
- break;
- }
- }
-
- f.mIndices = new unsigned int[f.mNumIndices = indices.size()];
- std::copy(indices.begin(),indices.end(),f.mIndices);
- }
-
- mesh->mVertices = new aiVector3D[mesh->mNumVertices = vertices.size()];
- std::copy(vertices.begin(),vertices.end(),mesh->mVertices);
-
- if (mesh->mNumVertices) {
- pScene->mMeshes[pScene->mNumMeshes] = mesh;
-
- (nd->mMeshes = new unsigned int[nd->mNumMeshes=1])[0]=pScene->mNumMeshes++;
- }
- }
-}
-
-#endif
diff --git a/3rdparty/assimp/code/NDOLoader.h b/3rdparty/assimp/code/NDOLoader.h
deleted file mode 100644
index 1bae9c65..00000000
--- a/3rdparty/assimp/code/NDOLoader.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2008, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file NDOLoader.h
- * Declaration of the Nendo importer class.
- */
-#ifndef INCLUDED_AI_NDO_LOADER_H
-#define INCLUDED_AI_NDO_LOADER_H
-namespace Assimp {
-
-// ---------------------------------------------------------------------------
-/** @brief Importer class to load meshes from Nendo.
- *
- * Basing on
- * <blender>/blender/release/scripts/nendo_import.py by Anthony D'Agostino.
-*/
-class NDOImporter : public BaseImporter
-{
- friend class Importer;
-protected:
- /** Constructor to be privately used by Importer */
- NDOImporter();
-
- /** Destructor, private as well */
- ~NDOImporter();
-
-public:
-
- //! Represents a single edge
- struct Edge
- {
- unsigned int edge[8];
- unsigned int hard;
- uint8_t color[8];
- };
-
- //! Represents a single face
- struct Face
- {
- unsigned int elem;
- };
-
- struct Vertex
- {
- unsigned int num;
- aiVector3D val;
- };
-
- //! Represents a single object
- struct Object
- {
- std::string name;
-
- std::vector<Edge> edges;
- std::vector<Face> faces;
- std::vector<Vertex> vertices;
- };
-
- // -------------------------------------------------------------------
- bool CanRead( const std::string& pFile, IOSystem* pIOHandler,
- bool checkSig) const;
-
-protected:
-
- // -------------------------------------------------------------------
- void GetExtensionList(std::set<std::string>& extensions);
-
- // -------------------------------------------------------------------
- void SetupProperties(const Importer* pImp);
-
- // -------------------------------------------------------------------
- void InternReadFile( const std::string& pFile, aiScene* pScene,
- IOSystem* pIOHandler);
-
-private:
-
-}; // end of class NDOImporter
-} // end of namespace Assimp
-#endif // INCLUDED_AI_NDO_LOADER_H
diff --git a/3rdparty/assimp/code/NFFLoader.cpp b/3rdparty/assimp/code/NFFLoader.cpp
deleted file mode 100644
index 158fcb8d..00000000
--- a/3rdparty/assimp/code/NFFLoader.cpp
+++ /dev/null
@@ -1,1256 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file Implementation of the STL importer class */
-
-#include "AssimpPCH.h"
-#ifndef ASSIMP_BUILD_NO_NFF_IMPORTER
-
-// internal headers
-#include "NFFLoader.h"
-#include "ParsingUtils.h"
-#include "StandardShapes.h"
-#include "fast_atof.h"
-#include "RemoveComments.h"
-
-using namespace Assimp;
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-NFFImporter::NFFImporter()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-NFFImporter::~NFFImporter()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the class can handle the format of the given file.
-bool NFFImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const
-{
- return SimpleExtensionCheck(pFile,"nff","enff");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Get the list of all supported file extensions
-void NFFImporter::GetExtensionList(std::set<std::string>& extensions)
-{
- extensions.insert("enff");
- extensions.insert("nff");
-}
-
-// ------------------------------------------------------------------------------------------------
-#define AI_NFF_PARSE_FLOAT(f) \
- SkipSpaces(&sz); \
- if (!::IsLineEnd(*sz))sz = fast_atof_move(sz, (float&)f);
-
-// ------------------------------------------------------------------------------------------------
-#define AI_NFF_PARSE_TRIPLE(v) \
- AI_NFF_PARSE_FLOAT(v[0]) \
- AI_NFF_PARSE_FLOAT(v[1]) \
- AI_NFF_PARSE_FLOAT(v[2])
-
-// ------------------------------------------------------------------------------------------------
-#define AI_NFF_PARSE_SHAPE_INFORMATION() \
- aiVector3D center, radius(1.0f,get_qnan(),get_qnan()); \
- AI_NFF_PARSE_TRIPLE(center); \
- AI_NFF_PARSE_TRIPLE(radius); \
- if (is_qnan(radius.z))radius.z = radius.x; \
- if (is_qnan(radius.y))radius.y = radius.x; \
- currentMesh.radius = radius; \
- currentMesh.center = center;
-
-// ------------------------------------------------------------------------------------------------
-#define AI_NFF2_GET_NEXT_TOKEN() \
- do \
- { \
- if (!GetNextLine(buffer,line)) \
- {DefaultLogger::get()->warn("NFF2: Unexpected EOF, can't read next token");break;} \
- SkipSpaces(line,&sz); \
- } \
- while (IsLineEnd(*sz))
-
-
-// ------------------------------------------------------------------------------------------------
-// Loads the materail table for the NFF2 file format from an external file
-void NFFImporter::LoadNFF2MaterialTable(std::vector<ShadingInfo>& output,
- const std::string& path, IOSystem* pIOHandler)
-{
- boost::scoped_ptr<IOStream> file( pIOHandler->Open( path, "rb"));
-
- // Check whether we can read from the file
- if ( !file.get()) {
- DefaultLogger::get()->error("NFF2: Unable to open material library " + path + ".");
- return;
- }
-
- // get the size of the file
- const unsigned int m = (unsigned int)file->FileSize();
-
- // allocate storage and copy the contents of the file to a memory buffer
- // (terminate it with zero)
- std::vector<char> mBuffer2(m+1);
- TextFileToBuffer(file.get(),mBuffer2);
- const char* buffer = &mBuffer2[0];
-
- // First of all: remove all comments from the file
- CommentRemover::RemoveLineComments("//",&mBuffer2[0]);
-
- // The file should start with the magic sequence "mat"
- if (!TokenMatch(buffer,"mat",3)) {
- DefaultLogger::get()->error("NFF2: Not a valid material library " + path + ".");
- return;
- }
-
- ShadingInfo* curShader = NULL;
-
- // No read the file line per line
- char line[4096];
- const char* sz;
- while (GetNextLine(buffer,line))
- {
- SkipSpaces(line,&sz);
-
- // 'version' defines the version of the file format
- if (TokenMatch(sz,"version",7))
- {
- DefaultLogger::get()->info("NFF (Sense8) material library file format: " + std::string(sz));
- }
- // 'matdef' starts a new material in the file
- else if (TokenMatch(sz,"matdef",6))
- {
- // add a new material to the list
- output.push_back( ShadingInfo() );
- curShader = & output.back();
-
- // parse the name of the material
- }
- else if (!TokenMatch(sz,"valid",5))
- {
- // check whether we have an active material at the moment
- if (!IsLineEnd(*sz))
- {
- if (!curShader)
- {
- DefaultLogger::get()->error(std::string("NFF2 material library: Found element ") +
- sz + "but there is no active material");
- continue;
- }
- }
- else continue;
-
- // now read the material property and determine its type
- aiColor3D c;
- if (TokenMatch(sz,"ambient",7))
- {
- AI_NFF_PARSE_TRIPLE(c);
- curShader->ambient = c;
- }
- else if (TokenMatch(sz,"diffuse",7) || TokenMatch(sz,"ambientdiffuse",14) /* correct? */)
- {
- AI_NFF_PARSE_TRIPLE(c);
- curShader->diffuse = curShader->ambient = c;
- }
- else if (TokenMatch(sz,"specular",8))
- {
- AI_NFF_PARSE_TRIPLE(c);
- curShader->specular = c;
- }
- else if (TokenMatch(sz,"emission",8))
- {
- AI_NFF_PARSE_TRIPLE(c);
- curShader->emissive = c;
- }
- else if (TokenMatch(sz,"shininess",9))
- {
- AI_NFF_PARSE_FLOAT(curShader->shininess);
- }
- else if (TokenMatch(sz,"opacity",7))
- {
- AI_NFF_PARSE_FLOAT(curShader->opacity);
- }
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Imports the given file into the given scene structure.
-void NFFImporter::InternReadFile( const std::string& pFile,
- aiScene* pScene, IOSystem* pIOHandler)
-{
- boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
-
- // Check whether we can read from the file
- if ( !file.get())
- throw DeadlyImportError( "Failed to open NFF file " + pFile + ".");
-
- unsigned int m = (unsigned int)file->FileSize();
-
- // allocate storage and copy the contents of the file to a memory buffer
- // (terminate it with zero)
- std::vector<char> mBuffer2;
- TextFileToBuffer(file.get(),mBuffer2);
- const char* buffer = &mBuffer2[0];
-
- // mesh arrays - separate here to make the handling of the pointers below easier.
- std::vector<MeshInfo> meshes;
- std::vector<MeshInfo> meshesWithNormals;
- std::vector<MeshInfo> meshesWithUVCoords;
- std::vector<MeshInfo> meshesLocked;
-
- char line[4096];
- const char* sz;
-
- // camera parameters
- aiVector3D camPos, camUp(0.f,1.f,0.f), camLookAt(0.f,0.f,1.f);
- float angle = 45.f;
- aiVector2D resolution;
-
- bool hasCam = false;
-
- MeshInfo* currentMeshWithNormals = NULL;
- MeshInfo* currentMesh = NULL;
- MeshInfo* currentMeshWithUVCoords = NULL;
-
- ShadingInfo s; // current material info
-
- // degree of tesselation
- unsigned int iTesselation = 4;
-
- // some temporary variables we need to parse the file
- unsigned int sphere = 0,
- cylinder = 0,
- cone = 0,
- numNamed = 0,
- dodecahedron = 0,
- octahedron = 0,
- tetrahedron = 0,
- hexahedron = 0;
-
- // lights imported from the file
- std::vector<Light> lights;
-
- // check whether this is the NFF2 file format
- if (TokenMatch(buffer,"nff",3))
- {
- const float qnan = get_qnan();
- const aiColor4D cQNAN = aiColor4D (qnan,0.f,0.f,1.f);
- const aiVector3D vQNAN = aiVector3D(qnan,0.f,0.f);
-
- // another NFF file format ... just a raw parser has been implemented
- // no support for further details, I don't think it is worth the effort
- // http://ozviz.wasp.uwa.edu.au/~pbourke/dataformats/nff/nff2.html
- // http://www.netghost.narod.ru/gff/graphics/summary/sense8.htm
-
- // First of all: remove all comments from the file
- CommentRemover::RemoveLineComments("//",&mBuffer2[0]);
-
- while (GetNextLine(buffer,line))
- {
- SkipSpaces(line,&sz);
- if (TokenMatch(sz,"version",7))
- {
- DefaultLogger::get()->info("NFF (Sense8) file format: " + std::string(sz));
- }
- else if (TokenMatch(sz,"viewpos",7))
- {
- AI_NFF_PARSE_TRIPLE(camPos);
- hasCam = true;
- }
- else if (TokenMatch(sz,"viewdir",7))
- {
- AI_NFF_PARSE_TRIPLE(camLookAt);
- hasCam = true;
- }
- // This starts a new object section
- else if (!IsSpaceOrNewLine(*sz))
- {
- unsigned int subMeshIdx = 0;
-
- // read the name of the object, skip all spaces
- // at the end of it.
- const char* sz3 = sz;
- while (!IsSpaceOrNewLine(*sz))++sz;
- std::string objectName = std::string(sz3,(unsigned int)(sz-sz3));
-
- const unsigned int objStart = (unsigned int)meshes.size();
-
- // There could be a material table in a separate file
- std::vector<ShadingInfo> materialTable;
- while (true)
- {
- AI_NFF2_GET_NEXT_TOKEN();
-
- // material table - an external file
- if (TokenMatch(sz,"mtable",6))
- {
- SkipSpaces(&sz);
- sz3 = sz;
- while (!IsSpaceOrNewLine(*sz))++sz;
- const unsigned int diff = (unsigned int)(sz-sz3);
- if (!diff)DefaultLogger::get()->warn("NFF2: Found empty mtable token");
- else
- {
- // The material table has the file extension .mat.
- // If it is not there, we need to append it
- std::string path = std::string(sz3,diff);
- if (std::string::npos == path.find_last_of(".mat"))
- {
- path.append(".mat");
- }
-
- // Now extract the working directory from the path to
- // this file and append the material library filename
- // to it.
- std::string::size_type s;
- if ((std::string::npos == (s = path.find_last_of('\\')) || !s) &&
- (std::string::npos == (s = path.find_last_of('/')) || !s) )
- {
- s = pFile.find_last_of('\\');
- if (std::string::npos == s)s = pFile.find_last_of('/');
- if (std::string::npos != s)
- {
- path = pFile.substr(0,s+1) + path;
- }
- }
- LoadNFF2MaterialTable(materialTable,path,pIOHandler);
- }
- }
- else break;
- }
-
- // read the numbr of vertices
- unsigned int num = ::strtol10(sz,&sz);
-
- // temporary storage
- std::vector<aiColor4D> tempColors;
- std::vector<aiVector3D> tempPositions,tempTextureCoords,tempNormals;
-
- bool hasNormals = false,hasUVs = false,hasColor = false;
-
- tempPositions.reserve (num);
- tempColors.reserve (num);
- tempNormals.reserve (num);
- tempTextureCoords.reserve (num);
- for (unsigned int i = 0; i < num; ++i)
- {
- AI_NFF2_GET_NEXT_TOKEN();
- aiVector3D v;
- AI_NFF_PARSE_TRIPLE(v);
- tempPositions.push_back(v);
-
- // parse all other attributes in the line
- while (true)
- {
- SkipSpaces(&sz);
- if (IsLineEnd(*sz))break;
-
- // color definition
- if (TokenMatch(sz,"0x",2))
- {
- hasColor = true;
- register unsigned int numIdx = ::strtol16(sz,&sz);
- aiColor4D clr;
- clr.a = 1.f;
-
- // 0xRRGGBB
- clr.r = ((numIdx >> 16u) & 0xff) / 255.f;
- clr.g = ((numIdx >> 8u) & 0xff) / 255.f;
- clr.b = ((numIdx) & 0xff) / 255.f;
- tempColors.push_back(clr);
- }
- // normal vector
- else if (TokenMatch(sz,"norm",4))
- {
- hasNormals = true;
- AI_NFF_PARSE_TRIPLE(v);
- tempNormals.push_back(v);
- }
- // UV coordinate
- else if (TokenMatch(sz,"uv",2))
- {
- hasUVs = true;
- AI_NFF_PARSE_FLOAT(v.x);
- AI_NFF_PARSE_FLOAT(v.y);
- v.z = 0.f;
- tempTextureCoords.push_back(v);
- }
- }
-
- // fill in dummies for all attributes that have not been set
- if (tempNormals.size() != tempPositions.size())
- tempNormals.push_back(vQNAN);
-
- if (tempTextureCoords.size() != tempPositions.size())
- tempTextureCoords.push_back(vQNAN);
-
- if (tempColors.size() != tempPositions.size())
- tempColors.push_back(cQNAN);
- }
-
- AI_NFF2_GET_NEXT_TOKEN();
- if (!num)throw DeadlyImportError("NFF2: There are zero vertices");
- num = ::strtol10(sz,&sz);
-
- std::vector<unsigned int> tempIdx;
- tempIdx.reserve(10);
- for (unsigned int i = 0; i < num; ++i)
- {
- AI_NFF2_GET_NEXT_TOKEN();
- SkipSpaces(line,&sz);
- unsigned int numIdx = ::strtol10(sz,&sz);
-
- // read all faces indices
- if (numIdx)
- {
- // mesh.faces.push_back(numIdx);
- // tempIdx.erase(tempIdx.begin(),tempIdx.end());
- tempIdx.resize(numIdx);
-
- for (unsigned int a = 0; a < numIdx;++a)
- {
- SkipSpaces(sz,&sz);
- m = ::strtol10(sz,&sz);
- if (m >= (unsigned int)tempPositions.size())
- {
- DefaultLogger::get()->error("NFF2: Vertex index overflow");
- m= 0;
- }
- // mesh.vertices.push_back (tempPositions[idx]);
- tempIdx[a] = m;
- }
- }
-
- // build a temporary shader object for the face.
- ShadingInfo shader;
- unsigned int matIdx = 0;
-
- // white material color - we have vertex colors
- shader.color = aiColor3D(1.f,1.f,1.f);
- aiColor4D c = aiColor4D(1.f,1.f,1.f,1.f);
- while (true)
- {
- SkipSpaces(sz,&sz);
- if (IsLineEnd(*sz))break;
-
- // per-polygon colors
- if (TokenMatch(sz,"0x",2))
- {
- hasColor = true;
- const char* sz2 = sz;
- numIdx = ::strtol16(sz,&sz);
- const unsigned int diff = (unsigned int)(sz-sz2);
-
- // 0xRRGGBB
- if (diff > 3)
- {
- c.r = ((numIdx >> 16u) & 0xff) / 255.f;
- c.g = ((numIdx >> 8u) & 0xff) / 255.f;
- c.b = ((numIdx) & 0xff) / 255.f;
- }
- // 0xRGB
- else
- {
- c.r = ((numIdx >> 8u) & 0xf) / 16.f;
- c.g = ((numIdx >> 4u) & 0xf) / 16.f;
- c.b = ((numIdx) & 0xf) / 16.f;
- }
- }
- // TODO - implement texture mapping here
-#if 0
- // mirror vertex texture coordinate?
- else if (TokenMatch(sz,"mirror",6))
- {
- }
- // texture coordinate scaling
- else if (TokenMatch(sz,"scale",5))
- {
- }
- // texture coordinate translation
- else if (TokenMatch(sz,"trans",5))
- {
- }
- // texture coordinate rotation angle
- else if (TokenMatch(sz,"rot",3))
- {
- }
-#endif
-
- // texture file name for this polygon + mapping information
- else if ('_' == sz[0])
- {
- // get mapping information
- switch (sz[1])
- {
- case 'v':
- case 'V':
-
- shader.shaded = false;
- break;
-
- case 't':
- case 'T':
- case 'u':
- case 'U':
-
- DefaultLogger::get()->warn("Unsupported NFF2 texture attribute: trans");
- };
- if (!sz[1] || '_' != sz[2])
- {
- DefaultLogger::get()->warn("NFF2: Expected underscore after texture attributes");
- continue;
- }
- const char* sz2 = sz+3;
- while (!IsSpaceOrNewLine( *sz ))++sz;
- const unsigned int diff = (unsigned int)(sz-sz2);
- if (diff)shader.texFile = std::string(sz2,diff);
- }
-
- // Two-sided material?
- else if (TokenMatch(sz,"both",4))
- {
- shader.twoSided = true;
- }
-
- // Material ID?
- else if (!materialTable.empty() && TokenMatch(sz,"matid",5))
- {
- SkipSpaces(&sz);
- matIdx = ::strtol10(sz,&sz);
- if (matIdx >= materialTable.size())
- {
- DefaultLogger::get()->error("NFF2: Material index overflow.");
- matIdx = 0;
- }
-
- // now combine our current shader with the shader we
- // read from the material table.
- ShadingInfo& mat = materialTable[matIdx];
- shader.ambient = mat.ambient;
- shader.diffuse = mat.diffuse;
- shader.emissive = mat.emissive;
- shader.opacity = mat.opacity;
- shader.specular = mat.specular;
- shader.shininess = mat.shininess;
- }
- else SkipToken(sz);
- }
-
- // search the list of all shaders we have for this object whether
- // there is an identical one. In this case, we append our mesh
- // data to it.
- MeshInfo* mesh = NULL;
- for (std::vector<MeshInfo>::iterator it = meshes.begin() + objStart, end = meshes.end();
- it != end; ++it)
- {
- if ((*it).shader == shader && (*it).matIndex == matIdx)
- {
- // we have one, we can append our data to it
- mesh = &(*it);
- }
- }
- if (!mesh)
- {
- meshes.push_back(MeshInfo(PatchType_Simple,false));
- mesh = &meshes.back();
- mesh->matIndex = matIdx;
-
- // We need to add a new mesh to the list. We assign
- // an unique name to it to make sure the scene will
- // pass the validation step for the moment.
- // TODO: fix naming of objects in the scenegraph later
- if (objectName.length())
- {
- ::strcpy(mesh->name,objectName.c_str());
- ASSIMP_itoa10(&mesh->name[objectName.length()],30,subMeshIdx++);
- }
-
- // copy the shader to the mesh.
- mesh->shader = shader;
- }
-
- // fill the mesh with data
- if (!tempIdx.empty())
- {
- mesh->faces.push_back((unsigned int)tempIdx.size());
- for (std::vector<unsigned int>::const_iterator it = tempIdx.begin(), end = tempIdx.end();
- it != end;++it)
- {
- m = *it;
-
- // copy colors -vertex color specifications override polygon color specifications
- if (hasColor)
- {
- const aiColor4D& clr = tempColors[m];
- mesh->colors.push_back((is_qnan( clr.r ) ? c : clr));
- }
-
- // positions should always be there
- mesh->vertices.push_back (tempPositions[m]);
-
- // copy normal vectors
- if (hasNormals)
- mesh->normals.push_back (tempNormals[m]);
-
- // copy texture coordinates
- if (hasUVs)
- mesh->uvs.push_back (tempTextureCoords[m]);
- }
- }
- }
- if (!num)throw DeadlyImportError("NFF2: There are zero faces");
- }
- }
- camLookAt = camLookAt + camPos;
- }
- else // "Normal" Neutral file format that is quite more common
- {
- while (GetNextLine(buffer,line))
- {
- sz = line;
- if ('p' == line[0] || TokenMatch(sz,"tpp",3))
- {
- MeshInfo* out = NULL;
-
- // 'tpp' - texture polygon patch primitive
- if ('t' == line[0])
- {
- currentMeshWithUVCoords = NULL;
- for (std::vector<MeshInfo>::iterator it = meshesWithUVCoords.begin(), end = meshesWithUVCoords.end();
- it != end;++it)
- {
- if ((*it).shader == s)
- {
- currentMeshWithUVCoords = &(*it);
- break;
- }
- }
-
- if (!currentMeshWithUVCoords)
- {
- meshesWithUVCoords.push_back(MeshInfo(PatchType_UVAndNormals));
- currentMeshWithUVCoords = &meshesWithUVCoords.back();
- currentMeshWithUVCoords->shader = s;
- }
- out = currentMeshWithUVCoords;
- }
- // 'pp' - polygon patch primitive
- else if ('p' == line[1])
- {
- currentMeshWithNormals = NULL;
- for (std::vector<MeshInfo>::iterator it = meshesWithNormals.begin(), end = meshesWithNormals.end();
- it != end;++it)
- {
- if ((*it).shader == s)
- {
- currentMeshWithNormals = &(*it);
- break;
- }
- }
-
- if (!currentMeshWithNormals)
- {
- meshesWithNormals.push_back(MeshInfo(PatchType_Normals));
- currentMeshWithNormals = &meshesWithNormals.back();
- currentMeshWithNormals->shader = s;
- }
- sz = &line[2];out = currentMeshWithNormals;
- }
- // 'p' - polygon primitive
- else
- {
- currentMesh = NULL;
- for (std::vector<MeshInfo>::iterator it = meshes.begin(), end = meshes.end();
- it != end;++it)
- {
- if ((*it).shader == s)
- {
- currentMesh = &(*it);
- break;
- }
- }
-
- if (!currentMesh)
- {
- meshes.push_back(MeshInfo(PatchType_Simple));
- currentMesh = &meshes.back();
- currentMesh->shader = s;
- }
- sz = &line[1];out = currentMesh;
- }
- SkipSpaces(sz,&sz);
- m = strtol10(sz);
-
- // ---- flip the face order
- out->vertices.resize(out->vertices.size()+m);
- if (out != currentMesh)
- {
- out->normals.resize(out->vertices.size());
- }
- if (out == currentMeshWithUVCoords)
- {
- out->uvs.resize(out->vertices.size());
- }
- for (unsigned int n = 0; n < m;++n)
- {
- if (!GetNextLine(buffer,line))
- {
- DefaultLogger::get()->error("NFF: Unexpected EOF was encountered. Patch definition incomplete");
- continue;
- }
-
- aiVector3D v; sz = &line[0];
- AI_NFF_PARSE_TRIPLE(v);
- out->vertices[out->vertices.size()-n-1] = v;
-
- if (out != currentMesh)
- {
- AI_NFF_PARSE_TRIPLE(v);
- out->normals[out->vertices.size()-n-1] = v;
- }
- if (out == currentMeshWithUVCoords)
- {
- // FIX: in one test file this wraps over multiple lines
- SkipSpaces(&sz);
- if (IsLineEnd(*sz))
- {
- GetNextLine(buffer,line);
- sz = line;
- }
- AI_NFF_PARSE_FLOAT(v.x);
- SkipSpaces(&sz);
- if (IsLineEnd(*sz))
- {
- GetNextLine(buffer,line);
- sz = line;
- }
- AI_NFF_PARSE_FLOAT(v.y);
- v.y = 1.f - v.y;
- out->uvs[out->vertices.size()-n-1] = v;
- }
- }
- out->faces.push_back(m);
- }
- // 'f' - shading information block
- else if (TokenMatch(sz,"f",1))
- {
- float d;
-
- // read the RGB colors
- AI_NFF_PARSE_TRIPLE(s.color);
-
- // read the other properties
- AI_NFF_PARSE_FLOAT(s.diffuse.r);
- AI_NFF_PARSE_FLOAT(s.specular.r);
- AI_NFF_PARSE_FLOAT(d); // skip shininess and transmittance
- AI_NFF_PARSE_FLOAT(d);
- AI_NFF_PARSE_FLOAT(s.refracti);
-
- // NFF2 uses full colors here so we need to use them too
- // although NFF uses simple scaling factors
- s.diffuse.g = s.diffuse.b = s.diffuse.r;
- s.specular.g = s.specular.b = s.specular.r;
-
- // if the next one is NOT a number we assume it is a texture file name
- // this feature is used by some NFF files on the internet and it has
- // been implemented as it can be really useful
- SkipSpaces(&sz);
- if (!IsNumeric(*sz))
- {
- // TODO: Support full file names with spaces and quotation marks ...
- const char* p = sz;
- while (!IsSpaceOrNewLine( *sz ))++sz;
-
- unsigned int diff = (unsigned int)(sz-p);
- if (diff)
- {
- s.texFile = std::string(p,diff);
- }
- }
- else
- {
- AI_NFF_PARSE_FLOAT(s.ambient); // optional
- }
- }
- // 'shader' - other way to specify a texture
- else if (TokenMatch(sz,"shader",6))
- {
- SkipSpaces(&sz);
- const char* old = sz;
- while (!IsSpaceOrNewLine(*sz))++sz;
- s.texFile = std::string(old, (uintptr_t)sz - (uintptr_t)old);
- }
- // 'l' - light source
- else if (TokenMatch(sz,"l",1))
- {
- lights.push_back(Light());
- Light& light = lights.back();
-
- AI_NFF_PARSE_TRIPLE(light.position);
- AI_NFF_PARSE_FLOAT (light.intensity);
- AI_NFF_PARSE_TRIPLE(light.color);
- }
- // 's' - sphere
- else if (TokenMatch(sz,"s",1))
- {
- meshesLocked.push_back(MeshInfo(PatchType_Simple,true));
- MeshInfo& currentMesh = meshesLocked.back();
- currentMesh.shader = s;
- currentMesh.shader.mapping = aiTextureMapping_SPHERE;
-
- AI_NFF_PARSE_SHAPE_INFORMATION();
-
- // we don't need scaling or translation here - we do it in the node's transform
- StandardShapes::MakeSphere(iTesselation, currentMesh.vertices);
- currentMesh.faces.resize(currentMesh.vertices.size()/3,3);
-
- // generate a name for the mesh
- ::sprintf(currentMesh.name,"sphere_%i",sphere++);
- }
- // 'dod' - dodecahedron
- else if (TokenMatch(sz,"dod",3))
- {
- meshesLocked.push_back(MeshInfo(PatchType_Simple,true));
- MeshInfo& currentMesh = meshesLocked.back();
- currentMesh.shader = s;
- currentMesh.shader.mapping = aiTextureMapping_SPHERE;
-
- AI_NFF_PARSE_SHAPE_INFORMATION();
-
- // we don't need scaling or translation here - we do it in the node's transform
- StandardShapes::MakeDodecahedron(currentMesh.vertices);
- currentMesh.faces.resize(currentMesh.vertices.size()/3,3);
-
- // generate a name for the mesh
- ::sprintf(currentMesh.name,"dodecahedron_%i",dodecahedron++);
- }
-
- // 'oct' - octahedron
- else if (TokenMatch(sz,"oct",3))
- {
- meshesLocked.push_back(MeshInfo(PatchType_Simple,true));
- MeshInfo& currentMesh = meshesLocked.back();
- currentMesh.shader = s;
- currentMesh.shader.mapping = aiTextureMapping_SPHERE;
-
- AI_NFF_PARSE_SHAPE_INFORMATION();
-
- // we don't need scaling or translation here - we do it in the node's transform
- StandardShapes::MakeOctahedron(currentMesh.vertices);
- currentMesh.faces.resize(currentMesh.vertices.size()/3,3);
-
- // generate a name for the mesh
- ::sprintf(currentMesh.name,"octahedron_%i",octahedron++);
- }
-
- // 'tet' - tetrahedron
- else if (TokenMatch(sz,"tet",3))
- {
- meshesLocked.push_back(MeshInfo(PatchType_Simple,true));
- MeshInfo& currentMesh = meshesLocked.back();
- currentMesh.shader = s;
- currentMesh.shader.mapping = aiTextureMapping_SPHERE;
-
- AI_NFF_PARSE_SHAPE_INFORMATION();
-
- // we don't need scaling or translation here - we do it in the node's transform
- StandardShapes::MakeTetrahedron(currentMesh.vertices);
- currentMesh.faces.resize(currentMesh.vertices.size()/3,3);
-
- // generate a name for the mesh
- ::sprintf(currentMesh.name,"tetrahedron_%i",tetrahedron++);
- }
-
- // 'hex' - hexahedron
- else if (TokenMatch(sz,"hex",3))
- {
- meshesLocked.push_back(MeshInfo(PatchType_Simple,true));
- MeshInfo& currentMesh = meshesLocked.back();
- currentMesh.shader = s;
- currentMesh.shader.mapping = aiTextureMapping_BOX;
-
- AI_NFF_PARSE_SHAPE_INFORMATION();
-
- // we don't need scaling or translation here - we do it in the node's transform
- StandardShapes::MakeHexahedron(currentMesh.vertices);
- currentMesh.faces.resize(currentMesh.vertices.size()/3,3);
-
- // generate a name for the mesh
- ::sprintf(currentMesh.name,"hexahedron_%i",hexahedron++);
- }
- // 'c' - cone
- else if (TokenMatch(sz,"c",1))
- {
- meshesLocked.push_back(MeshInfo(PatchType_Simple,true));
- MeshInfo& currentMesh = meshesLocked.back();
- currentMesh.shader = s;
- currentMesh.shader.mapping = aiTextureMapping_CYLINDER;
-
- if (!GetNextLine(buffer,line))
- {
- DefaultLogger::get()->error("NFF: Unexpected end of file (cone definition not complete)");
- break;
- }
- sz = line;
-
- // read the two center points and the respective radii
- aiVector3D center1, center2; float radius1, radius2;
- AI_NFF_PARSE_TRIPLE(center1);
- AI_NFF_PARSE_FLOAT(radius1);
-
- if (!GetNextLine(buffer,line))
- {
- DefaultLogger::get()->error("NFF: Unexpected end of file (cone definition not complete)");
- break;
- }
- sz = line;
-
- AI_NFF_PARSE_TRIPLE(center2);
- AI_NFF_PARSE_FLOAT(radius2);
-
- // compute the center point of the cone/cylinder -
- // it is its local transformation origin
- currentMesh.dir = center2-center1;
- currentMesh.center = center1+currentMesh.dir/2.f;
-
- float f;
- if (( f = currentMesh.dir.Length()) < 10e-3f )
- {
- DefaultLogger::get()->error("NFF: Cone height is close to zero");
- continue;
- }
- currentMesh.dir /= f; // normalize
-
- // generate the cone - it consists of simple triangles
- StandardShapes::MakeCone(f, radius1, radius2,
- integer_pow(4, iTesselation), currentMesh.vertices);
-
- // MakeCone() returns tris
- currentMesh.faces.resize(currentMesh.vertices.size()/3,3);
-
- // generate a name for the mesh. 'cone' if it a cone,
- // 'cylinder' if it is a cylinder. Funny, isn't it?
- if (radius1 != radius2)
- ::sprintf(currentMesh.name,"cone_%i",cone++);
- else ::sprintf(currentMesh.name,"cylinder_%i",cylinder++);
- }
- // 'tess' - tesselation
- else if (TokenMatch(sz,"tess",4))
- {
- SkipSpaces(&sz);
- iTesselation = strtol10(sz);
- }
- // 'from' - camera position
- else if (TokenMatch(sz,"from",4))
- {
- AI_NFF_PARSE_TRIPLE(camPos);
- hasCam = true;
- }
- // 'at' - camera look-at vector
- else if (TokenMatch(sz,"at",2))
- {
- AI_NFF_PARSE_TRIPLE(camLookAt);
- hasCam = true;
- }
- // 'up' - camera up vector
- else if (TokenMatch(sz,"up",2))
- {
- AI_NFF_PARSE_TRIPLE(camUp);
- hasCam = true;
- }
- // 'angle' - (half?) camera field of view
- else if (TokenMatch(sz,"angle",5))
- {
- AI_NFF_PARSE_FLOAT(angle);
- hasCam = true;
- }
- // 'resolution' - used to compute the screen aspect
- else if (TokenMatch(sz,"resolution",10))
- {
- AI_NFF_PARSE_FLOAT(resolution.x);
- AI_NFF_PARSE_FLOAT(resolution.y);
- hasCam = true;
- }
- // 'pb' - bezier patch. Not supported yet
- else if (TokenMatch(sz,"pb",2))
- {
- DefaultLogger::get()->error("NFF: Encountered unsupported ID: bezier patch");
- }
- // 'pn' - NURBS. Not supported yet
- else if (TokenMatch(sz,"pn",2) || TokenMatch(sz,"pnn",3))
- {
- DefaultLogger::get()->error("NFF: Encountered unsupported ID: NURBS");
- }
- // '' - comment
- else if ('#' == line[0])
- {
- const char* sz;SkipSpaces(&line[1],&sz);
- if (!IsLineEnd(*sz))DefaultLogger::get()->info(sz);
- }
- }
- }
-
- // copy all arrays into one large
- meshes.reserve (meshes.size()+meshesLocked.size()+meshesWithNormals.size()+meshesWithUVCoords.size());
- meshes.insert (meshes.end(),meshesLocked.begin(),meshesLocked.end());
- meshes.insert (meshes.end(),meshesWithNormals.begin(),meshesWithNormals.end());
- meshes.insert (meshes.end(),meshesWithUVCoords.begin(),meshesWithUVCoords.end());
-
- // now generate output meshes. first find out how many meshes we'll need
- std::vector<MeshInfo>::const_iterator it = meshes.begin(), end = meshes.end();
- for (;it != end;++it)
- {
- if (!(*it).faces.empty())
- {
- ++pScene->mNumMeshes;
- if ((*it).name[0])++numNamed;
- }
- }
-
- // generate a dummy root node - assign all unnamed elements such
- // as polygons and polygon patches to the root node and generate
- // sub nodes for named objects such as spheres and cones.
- aiNode* const root = new aiNode();
- root->mName.Set("<NFF_Root>");
- root->mNumChildren = numNamed + (hasCam ? 1 : 0) + (unsigned int) lights.size();
- root->mNumMeshes = pScene->mNumMeshes-numNamed;
-
- aiNode** ppcChildren = NULL;
- unsigned int* pMeshes = NULL;
- if (root->mNumMeshes)
- pMeshes = root->mMeshes = new unsigned int[root->mNumMeshes];
- if (root->mNumChildren)
- ppcChildren = root->mChildren = new aiNode*[root->mNumChildren];
-
- // generate the camera
- if (hasCam)
- {
- aiNode* nd = *ppcChildren = new aiNode();
- nd->mName.Set("<NFF_Camera>");
- nd->mParent = root;
-
- // allocate the camera in the scene
- pScene->mNumCameras = 1;
- pScene->mCameras = new aiCamera*[1];
- aiCamera* c = pScene->mCameras[0] = new aiCamera;
-
- c->mName = nd->mName; // make sure the names are identical
- c->mHorizontalFOV = AI_DEG_TO_RAD( angle );
- c->mLookAt = camLookAt - camPos;
- c->mPosition = camPos;
- c->mUp = camUp;
-
- // If the resolution is not specified in the file, we
- // need to set 1.0 as aspect.
- c->mAspect = (!resolution.y ? 0.f : resolution.x / resolution.y);
- ++ppcChildren;
- }
-
- // generate light sources
- if (!lights.empty())
- {
- pScene->mNumLights = (unsigned int)lights.size();
- pScene->mLights = new aiLight*[pScene->mNumLights];
- for (unsigned int i = 0; i < pScene->mNumLights;++i,++ppcChildren)
- {
- const Light& l = lights[i];
-
- aiNode* nd = *ppcChildren = new aiNode();
- nd->mParent = root;
-
- nd->mName.length = ::sprintf(nd->mName.data,"<NFF_Light%i>",i);
-
- // allocate the light in the scene data structure
- aiLight* out = pScene->mLights[i] = new aiLight();
- out->mName = nd->mName; // make sure the names are identical
- out->mType = aiLightSource_POINT;
- out->mColorDiffuse = out->mColorSpecular = l.color * l.intensity;
- out->mPosition = l.position;
- }
- }
-
- if (!pScene->mNumMeshes)throw DeadlyImportError("NFF: No meshes loaded");
- pScene->mMeshes = new aiMesh*[pScene->mNumMeshes];
- pScene->mMaterials = new aiMaterial*[pScene->mNumMaterials = pScene->mNumMeshes];
- for (it = meshes.begin(), m = 0; it != end;++it)
- {
- if ((*it).faces.empty())continue;
-
- const MeshInfo& src = *it;
- aiMesh* const mesh = pScene->mMeshes[m] = new aiMesh();
- mesh->mNumVertices = (unsigned int)src.vertices.size();
- mesh->mNumFaces = (unsigned int)src.faces.size();
-
- // Generate sub nodes for named meshes
- if (src.name[0])
- {
- aiNode* const node = *ppcChildren = new aiNode();
- node->mParent = root;
- node->mNumMeshes = 1;
- node->mMeshes = new unsigned int[1];
- node->mMeshes[0] = m;
- node->mName.Set(src.name);
-
- // setup the transformation matrix of the node
- aiMatrix4x4::FromToMatrix(aiVector3D(0.f,1.f,0.f),
- src.dir,node->mTransformation);
-
- aiMatrix4x4& mat = node->mTransformation;
- mat.a1 *= src.radius.x; mat.b1 *= src.radius.x; mat.c1 *= src.radius.x;
- mat.a2 *= src.radius.y; mat.b2 *= src.radius.y; mat.c2 *= src.radius.y;
- mat.a3 *= src.radius.z; mat.b3 *= src.radius.z; mat.c3 *= src.radius.z;
- mat.a4 = src.center.x;
- mat.b4 = src.center.y;
- mat.c4 = src.center.z;
-
- ++ppcChildren;
- }
- else *pMeshes++ = m;
-
- // copy vertex positions
- mesh->mVertices = new aiVector3D[mesh->mNumVertices];
- ::memcpy(mesh->mVertices,&src.vertices[0],
- sizeof(aiVector3D)*mesh->mNumVertices);
-
- // NFF2: there could be vertex colors
- if (!src.colors.empty())
- {
- ai_assert(src.colors.size() == src.vertices.size());
-
- // copy vertex colors
- mesh->mColors[0] = new aiColor4D[mesh->mNumVertices];
- ::memcpy(mesh->mColors[0],&src.colors[0],
- sizeof(aiColor4D)*mesh->mNumVertices);
- }
-
- if (!src.normals.empty())
- {
- ai_assert(src.normals.size() == src.vertices.size());
-
- // copy normal vectors
- mesh->mNormals = new aiVector3D[mesh->mNumVertices];
- ::memcpy(mesh->mNormals,&src.normals[0],
- sizeof(aiVector3D)*mesh->mNumVertices);
- }
-
- if (!src.uvs.empty())
- {
- ai_assert(src.uvs.size() == src.vertices.size());
-
- // copy texture coordinates
- mesh->mTextureCoords[0] = new aiVector3D[mesh->mNumVertices];
- ::memcpy(mesh->mTextureCoords[0],&src.uvs[0],
- sizeof(aiVector3D)*mesh->mNumVertices);
- }
-
- // generate faces
- unsigned int p = 0;
- aiFace* pFace = mesh->mFaces = new aiFace[mesh->mNumFaces];
- for (std::vector<unsigned int>::const_iterator it2 = src.faces.begin(),
- end2 = src.faces.end();
- it2 != end2;++it2,++pFace)
- {
- pFace->mIndices = new unsigned int [ pFace->mNumIndices = *it2 ];
- for (unsigned int o = 0; o < pFace->mNumIndices;++o)
- pFace->mIndices[o] = p++;
- }
-
- // generate a material for the mesh
- MaterialHelper* pcMat = (MaterialHelper*)(pScene->mMaterials[m] = new MaterialHelper());
-
- mesh->mMaterialIndex = m++;
-
- aiString s;
- s.Set(AI_DEFAULT_MATERIAL_NAME);
- pcMat->AddProperty(&s, AI_MATKEY_NAME);
-
- // FIX: Ignore diffuse == 0
- aiColor3D c = src.shader.color * (src.shader.diffuse.r ? src.shader.diffuse : aiColor3D(1.f,1.f,1.f));
- pcMat->AddProperty(&c,1,AI_MATKEY_COLOR_DIFFUSE);
- c = src.shader.color * src.shader.specular;
- pcMat->AddProperty(&c,1,AI_MATKEY_COLOR_SPECULAR);
-
- // NFF2 - default values for NFF
- pcMat->AddProperty(&src.shader.ambient, 1,AI_MATKEY_COLOR_AMBIENT);
- pcMat->AddProperty(&src.shader.emissive,1,AI_MATKEY_COLOR_EMISSIVE);
- pcMat->AddProperty(&src.shader.opacity, 1,AI_MATKEY_OPACITY);
-
- // setup the first texture layer, if existing
- if (src.shader.texFile.length())
- {
- s.Set(src.shader.texFile);
- pcMat->AddProperty(&s,AI_MATKEY_TEXTURE_DIFFUSE(0));
-
- if (aiTextureMapping_UV != src.shader.mapping) {
-
- aiVector3D v(0.f,-1.f,0.f);
- pcMat->AddProperty(&v, 1,AI_MATKEY_TEXMAP_AXIS_DIFFUSE(0));
- pcMat->AddProperty((int*)&src.shader.mapping, 1,AI_MATKEY_MAPPING_DIFFUSE(0));
- }
- }
-
- // setup the name of the material
- if (src.shader.name.length())
- {
- s.Set(src.shader.texFile);
- pcMat->AddProperty(&s,AI_MATKEY_NAME);
- }
-
- // setup some more material properties that are specific to NFF2
- int i;
- if (src.shader.twoSided)
- {
- i = 1;
- pcMat->AddProperty(&i,1,AI_MATKEY_TWOSIDED);
- }
- i = (src.shader.shaded ? aiShadingMode_Gouraud : aiShadingMode_NoShading);
- if (src.shader.shininess)
- {
- i = aiShadingMode_Phong;
- pcMat->AddProperty(&src.shader.shininess,1,AI_MATKEY_SHININESS);
- }
- pcMat->AddProperty(&i,1,AI_MATKEY_SHADING_MODEL);
- }
- pScene->mRootNode = root;
-}
-
-#endif // !! ASSIMP_BUILD_NO_NFF_IMPORTER
diff --git a/3rdparty/assimp/code/NFFLoader.h b/3rdparty/assimp/code/NFFLoader.h
deleted file mode 100644
index 2e21bdc8..00000000
--- a/3rdparty/assimp/code/NFFLoader.h
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file NFFLoader.h
- * @brief Declaration of the NFF importer class.
- */
-#ifndef AI_NFFLOADER_H_INCLUDED
-#define AI_NFFLOADER_H_INCLUDED
-
-#include "BaseImporter.h"
-#include <vector>
-
-#include "../include/aiTypes.h"
-
-namespace Assimp {
-
-// ----------------------------------------------------------------------------------
-/** NFF (Neutral File Format) Importer class.
- *
- * The class implements both Eric Haynes NFF format and Sense8's NFF (NFF2) format.
- * Both are quite different and the loading code is somewhat dirty at
- * the moment. Sense8 should be moved to a separate loader.
-*/
-class NFFImporter : public BaseImporter
-{
- friend class Importer;
-
-protected:
- /** Constructor to be privately used by Importer */
- NFFImporter();
-
- /** Destructor, private as well */
- ~NFFImporter();
-
-public:
-
- // -------------------------------------------------------------------
- /** Returns whether the class can handle the format of the given file.
- * See BaseImporter::CanRead() for details.
- */
- bool CanRead( const std::string& pFile, IOSystem* pIOHandler,
- bool checkSig) const;
-
-protected:
-
- // -------------------------------------------------------------------
- /** Called by Importer::GetExtensionList() for each loaded importer.
- * See BaseImporter::GetExtensionList() for details
- */
- void GetExtensionList(std::set<std::string>& extensions);
-
- // -------------------------------------------------------------------
- /** Imports the given file into the given scene structure.
- * See BaseImporter::InternReadFile() for details
- */
- void InternReadFile( const std::string& pFile, aiScene* pScene,
- IOSystem* pIOHandler);
-
-private:
-
-
- // describes face material properties
- struct ShadingInfo
- {
- ShadingInfo()
- : color (0.6f,0.6f,0.6f)
- , diffuse (1.f,1.f,1.f)
- , specular (1.f,1.f,1.f)
- , ambient (0.f,0.f,0.f)
- , emissive (0.f,0.f,0.f)
- , refracti (1.f)
- , twoSided (false) // for NFF2
- , shaded (true) // for NFF2
- , opacity (1.f)
- , shininess (0.f)
- , mapping (aiTextureMapping_UV)
- {}
-
- aiColor3D color,diffuse,specular,ambient,emissive;
- float refracti;
-
- std::string texFile;
-
- // For NFF2
- bool twoSided;
- bool shaded;
- float opacity, shininess;
-
- std::string name;
-
- // texture mapping to be generated for the mesh - uv is the default
- // it means: use UV if there, nothing otherwise. This property is
- // used for locked meshes.
- aiTextureMapping mapping;
-
- // shininess is ignored for the moment
- bool operator == (const ShadingInfo& other) const
- {
- return color == other.color &&
- diffuse == other.diffuse &&
- specular == other.specular &&
- ambient == other.ambient &&
- refracti == other.refracti &&
- texFile == other.texFile &&
- twoSided == other.twoSided &&
- shaded == other.shaded;
-
- // Some properties from NFF2 aren't compared by this operator.
- // Comparing MeshInfo::matIndex should do that.
- }
- };
-
- // describes a NFF light source
- struct Light
- {
- Light()
- : intensity (1.f)
- , color (1.f,1.f,1.f)
- {}
-
- aiVector3D position;
- float intensity;
- aiColor3D color;
- };
-
- enum PatchType
- {
- PatchType_Simple = 0x0,
- PatchType_Normals = 0x1,
- PatchType_UVAndNormals = 0x2
- };
-
- // describes a NFF mesh
- struct MeshInfo
- {
- MeshInfo(PatchType _pType, bool bL = false)
- : pType (_pType)
- , bLocked (bL)
- , radius (1.f,1.f,1.f)
- , dir (0.f,1.f,0.f)
- , matIndex (0)
- {
- name[0] = '\0'; // by default meshes are unnamed
- }
-
- ShadingInfo shader;
- PatchType pType;
- bool bLocked;
-
- // for spheres, cones and cylinders: center point of the object
- aiVector3D center, radius, dir;
-
- char name[128];
-
- std::vector<aiVector3D> vertices, normals, uvs;
- std::vector<unsigned int> faces;
-
- // for NFF2
- std::vector<aiColor4D> colors;
- unsigned int matIndex;
- };
-
-
- // -------------------------------------------------------------------
- /** Loads the material table for the NFF2 file format from an
- * external file.
- *
- * @param output Receives the list of output meshes
- * @param path Path to the file (abs. or rel.)
- * @param pIOHandler IOSystem to be used to open the file
- */
- void LoadNFF2MaterialTable(std::vector<ShadingInfo>& output,
- const std::string& path, IOSystem* pIOHandler);
-
-};
-
-} // end of namespace Assimp
-
-#endif // AI_NFFIMPORTER_H_IN
diff --git a/3rdparty/assimp/code/OFFLoader.cpp b/3rdparty/assimp/code/OFFLoader.cpp
deleted file mode 100644
index 38e21b49..00000000
--- a/3rdparty/assimp/code/OFFLoader.cpp
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file OFFLoader.cpp
- * @brief Implementation of the OFF importer class
- */
-
-#include "AssimpPCH.h"
-#ifndef ASSIMP_BUILD_NO_OFF_IMPORTER
-
-// internal headers
-#include "OFFLoader.h"
-#include "ParsingUtils.h"
-#include "fast_atof.h"
-
-
-using namespace Assimp;
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-OFFImporter::OFFImporter()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-OFFImporter::~OFFImporter()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the class can handle the format of the given file.
-bool OFFImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const
-{
- const std::string extension = GetExtension(pFile);
-
- if (extension == "off")
- return true;
- else if (!extension.length() || checkSig)
- {
- if (!pIOHandler)return true;
- const char* tokens[] = {"off"};
- return SearchFileHeaderForToken(pIOHandler,pFile,tokens,1);
- }
- return false;
-}
-
-// ------------------------------------------------------------------------------------------------
-void OFFImporter::GetExtensionList(std::set<std::string>& extensions)
-{
- extensions.insert("off");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Imports the given file into the given scene structure.
-void OFFImporter::InternReadFile( const std::string& pFile,
- aiScene* pScene, IOSystem* pIOHandler)
-{
- boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
-
- // Check whether we can read from the file
- if ( file.get() == NULL) {
- throw DeadlyImportError( "Failed to open OFF file " + pFile + ".");
- }
-
- // allocate storage and copy the contents of the file to a memory buffer
- std::vector<char> mBuffer2;
- TextFileToBuffer(file.get(),mBuffer2);
- const char* buffer = &mBuffer2[0];
-
- char line[4096];
- GetNextLine(buffer,line);
- if ('O' == line[0]) {
- GetNextLine(buffer,line); // skip the 'OFF' line
- }
-
- const char* sz = line; SkipSpaces(&sz);
- const unsigned int numVertices = strtol10(sz,&sz);SkipSpaces(&sz);
- const unsigned int numFaces = strtol10(sz,&sz);
-
- pScene->mMeshes = new aiMesh*[ pScene->mNumMeshes = 1 ];
- aiMesh* mesh = pScene->mMeshes[0] = new aiMesh();
- aiFace* faces = mesh->mFaces = new aiFace [mesh->mNumFaces = numFaces];
-
- std::vector<aiVector3D> tempPositions(numVertices);
-
- // now read all vertex lines
- for (unsigned int i = 0; i< numVertices;++i)
- {
- if (!GetNextLine(buffer,line))
- {
- DefaultLogger::get()->error("OFF: The number of verts in the header is incorrect");
- break;
- }
- aiVector3D& v = tempPositions[i];
-
- sz = line; SkipSpaces(&sz);
- sz = fast_atof_move(sz,(float&)v.x); SkipSpaces(&sz);
- sz = fast_atof_move(sz,(float&)v.y); SkipSpaces(&sz);
- fast_atof_move(sz,(float&)v.z);
- }
-
-
- // First find out how many vertices we'll need
- const char* old = buffer;
- for (unsigned int i = 0; i< mesh->mNumFaces;++i)
- {
- if (!GetNextLine(buffer,line))
- {
- DefaultLogger::get()->error("OFF: The number of faces in the header is incorrect");
- break;
- }
- sz = line;SkipSpaces(&sz);
- if (!(faces->mNumIndices = strtol10(sz,&sz)) || faces->mNumIndices > 9)
- {
- DefaultLogger::get()->error("OFF: Faces with zero indices aren't allowed");
- --mesh->mNumFaces;
- continue;
- }
- mesh->mNumVertices += faces->mNumIndices;
- ++faces;
- }
-
- if (!mesh->mNumVertices)
- throw DeadlyImportError("OFF: There are no valid faces");
-
- // allocate storage for the output vertices
- aiVector3D* verts = mesh->mVertices = new aiVector3D[mesh->mNumVertices];
-
- // second: now parse all face indices
- buffer = old;faces = mesh->mFaces;
- for (unsigned int i = 0, p = 0; i< mesh->mNumFaces;)
- {
- if (!GetNextLine(buffer,line))break;
-
- unsigned int idx;
- sz = line;SkipSpaces(&sz);
- if (!(idx = strtol10(sz,&sz)) || idx > 9)
- continue;
-
- faces->mIndices = new unsigned int [faces->mNumIndices];
- for (unsigned int m = 0; m < faces->mNumIndices;++m)
- {
- SkipSpaces(&sz);
- if ((idx = strtol10(sz,&sz)) >= numVertices)
- {
- DefaultLogger::get()->error("OFF: Vertex index is out of range");
- idx = numVertices-1;
- }
- faces->mIndices[m] = p++;
- *verts++ = tempPositions[idx];
- }
- ++i;
- ++faces;
- }
-
- // generate the output node graph
- pScene->mRootNode = new aiNode();
- pScene->mRootNode->mName.Set("<OFFRoot>");
- pScene->mRootNode->mMeshes = new unsigned int [pScene->mRootNode->mNumMeshes = 1];
- pScene->mRootNode->mMeshes[0] = 0;
-
- // generate a default material
- pScene->mMaterials = new aiMaterial*[pScene->mNumMaterials = 1];
- MaterialHelper* pcMat = new MaterialHelper();
-
- aiColor4D clr(0.6f,0.6f,0.6f,1.0f);
- pcMat->AddProperty(&clr,1,AI_MATKEY_COLOR_DIFFUSE);
- pScene->mMaterials[0] = pcMat;
-
- const int twosided =1;
- pcMat->AddProperty(&twosided,1,AI_MATKEY_TWOSIDED);
-}
-
-#endif // !! ASSIMP_BUILD_NO_OFF_IMPORTER
diff --git a/3rdparty/assimp/code/OFFLoader.h b/3rdparty/assimp/code/OFFLoader.h
deleted file mode 100644
index e4247b6a..00000000
--- a/3rdparty/assimp/code/OFFLoader.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file OFFLoader.h
- * @brief Declaration of the OFF importer class.
- */
-#ifndef AI_OFFLOADER_H_INCLUDED
-#define AI_OFFLOADER_H_INCLUDED
-
-#include "BaseImporter.h"
-#include "../include/aiTypes.h"
-#include <vector>
-
-namespace Assimp {
-
-// ---------------------------------------------------------------------------
-/** Importer class for the Object File Format (.off)
-*/
-class OFFImporter : public BaseImporter
-{
- friend class Importer;
-
-protected:
- /** Constructor to be privately used by Importer */
- OFFImporter();
-
- /** Destructor, private as well */
- ~OFFImporter();
-
-public:
-
- // -------------------------------------------------------------------
- /** Returns whether the class can handle the format of the given file.
- * See BaseImporter::CanRead() for details. */
- bool CanRead( const std::string& pFile, IOSystem* pIOHandler,
- bool checkSig) const;
-
-protected:
-
- // -------------------------------------------------------------------
- /** Called by Importer::GetExtensionList() for each loaded importer.
- * See BaseImporter::GetExtensionList() for details
- */
- void GetExtensionList(std::set<std::string>& extensions);
-
- // -------------------------------------------------------------------
- /** Imports the given file into the given scene structure.
- * See BaseImporter::InternReadFile() for details
- */
- void InternReadFile( const std::string& pFile, aiScene* pScene,
- IOSystem* pIOHandler);
-
-private:
-
-};
-
-} // end of namespace Assimp
-
-#endif // AI_3DSIMPORTER_H_IN
diff --git a/3rdparty/assimp/code/ObjFileData.h b/3rdparty/assimp/code/ObjFileData.h
deleted file mode 100644
index 7edfee51..00000000
--- a/3rdparty/assimp/code/ObjFileData.h
+++ /dev/null
@@ -1,324 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-#ifndef OBJ_FILEDATA_H_INC
-#define OBJ_FILEDATA_H_INC
-
-#include <vector>
-#include <map>
-#include "../include/aiTypes.h"
-#include "../include/aiMesh.h"
-
-namespace Assimp
-{
-
-namespace ObjFile
-{
-// ------------------------------------------------------------------------------------------------
-struct Object;
-struct Face;
-struct Material;
-
-// ------------------------------------------------------------------------------------------------
-//! \struct Face
-//! \brief Datastructure for a simple obj-face, descripes discredisation and materials
-struct Face
-{
- typedef std::vector<unsigned int> IndexArray;
-
- //! Primitive type
- int m_PrimitiveType;
- //! Vertex indices
- IndexArray *m_pVertices;
- //! Normal indices
- IndexArray *m_pNormals;
- //! Texture coordinates indices
- IndexArray *m_pTexturCoords;
- //! Pointer to assigned material
- Material *m_pMaterial;
-
- //! \brief Default constructor
- //! \param pVertices Pointer to assigned vertex indexbuffer
- //! \param pNormals Pointer to assigned normals indexbuffer
- //! \param pTexCoords Pointer to assigned texture indexbuffer
- Face( std::vector<unsigned int> *pVertices,
- std::vector<unsigned int> *pNormals,
- std::vector<unsigned int> *pTexCoords) :
- m_PrimitiveType( 2 ),
- m_pVertices( pVertices ),
- m_pNormals( pNormals ),
- m_pTexturCoords( pTexCoords ),
- m_pMaterial( 0L )
- {
- // empty
- }
-
- //! \brief Destructor
- ~Face()
- {
- delete m_pVertices;
- m_pVertices = NULL;
- delete m_pNormals;
- m_pNormals = NULL;
- delete m_pTexturCoords;
- m_pTexturCoords = NULL;
- }
-};
-
-// ------------------------------------------------------------------------------------------------
-//! \struct Object
-//! \brief Stores all objects of an objfile object definition
-struct Object
-{
- enum ObjectType
- {
- ObjType,
- GroupType
- };
-
- //! Object name
- std::string m_strObjName;
- //! Transformation matrix, stored in OpenGL format
- aiMatrix4x4 m_Transformation;
- //! All sub-objects referenced by this object
- std::vector<Object*> m_SubObjects;
- /// Assigned meshes
- std::vector<unsigned int> m_Meshes;
-
- //! \brief Default constructor
- Object() :
- m_strObjName("")
- {
- // empty
- }
-
- //! \brief Destructor
- ~Object()
- {
- for (std::vector<Object*>::iterator it = m_SubObjects.begin();
- it != m_SubObjects.end(); ++it)
- {
- delete *it;
- }
- m_SubObjects.clear();
- }
-};
-
-// ------------------------------------------------------------------------------------------------
-//! \struct Material
-//! \brief Data structure to store all material specific data
-struct Material
-{
- //! Name of material description
- aiString MaterialName;
-
- //! Texture names
- aiString texture;
- aiString textureSpecular;
- aiString textureAmbient;
- aiString textureBump;
- aiString textureSpecularity;
- aiString textureOpacity;
-
- //! Ambient color
- aiColor3D ambient;
- //! Diffuse color
- aiColor3D diffuse;
- //! Speculao color
- aiColor3D specular;
- //! Alpha value
- float alpha;
- //! Shineness factor
- float shineness;
- //! Illumination model
- int illumination_model;
- //! Index of refraction
- float ior;
-
- //! Constructor
- Material()
- : diffuse (0.6f,0.6f,0.6f)
- , alpha (1.f)
- , shineness (0.0f)
- , illumination_model (1)
- , ior (1.f)
- {
- // empty
- }
-
- // Destructor
- ~Material()
- {
- // empty
- }
-};
-
-// ------------------------------------------------------------------------------------------------
-//! \struct Mesh
-//! \brief Data structure to store a mesh
-struct Mesh
-{
- static const unsigned int NoMaterial = 999999999;
-
- /// Array with pointer to all stored faces
- std::vector<Face*> m_Faces;
- /// Assigned material
- Material *m_pMaterial;
- /// Number of stored indices.
- unsigned int m_uiNumIndices;
- /// Number of UV
- unsigned int m_uiUVCoordinates[ AI_MAX_NUMBER_OF_TEXTURECOORDS ];
- /// Material index.
- unsigned int m_uiMaterialIndex;
- /// True, if normals are stored.
- bool m_hasNormals;
- /// Constructor
- Mesh() :
- m_pMaterial(NULL),
- m_uiNumIndices(0),
- m_uiMaterialIndex( NoMaterial ),
- m_hasNormals(false)
- {
- memset(m_uiUVCoordinates, 0, sizeof( unsigned int ) * AI_MAX_NUMBER_OF_TEXTURECOORDS);
- }
-
- /// Destructor
- ~Mesh()
- {
- for (std::vector<Face*>::iterator it = m_Faces.begin();
- it != m_Faces.end(); ++it)
- {
- delete *it;
- }
-
- }
-};
-
-// ------------------------------------------------------------------------------------------------
-//! \struct Model
-//! \brief Data structure to store all obj-specific model datas
-struct Model
-{
- typedef std::map<std::string*, std::vector<unsigned int>* > GroupMap;
- typedef std::map<std::string*, std::vector<unsigned int>* >::iterator GroupMapIt;
- typedef std::map<std::string*, std::vector<unsigned int>* >::const_iterator ConstGroupMapIt;
-
- //! Model name
- std::string m_ModelName;
- //! List ob assigned objects
- std::vector<Object*> m_Objects;
- //! Pointer to current object
- ObjFile::Object *m_pCurrent;
- //! Pointer to current material
- ObjFile::Material *m_pCurrentMaterial;
- //! Pointer to default material
- ObjFile::Material *m_pDefaultMaterial;
- //! Vector with all generated materials
- std::vector<std::string> m_MaterialLib;
- //! Vector with all generated group
- std::vector<std::string> m_GroupLib;
- //! Vector with all generated vertices
- std::vector<aiVector3D> m_Vertices;
- //! vector with all generated normals
- std::vector<aiVector3D> m_Normals;
- //! Groupmap
- GroupMap m_Groups;
- //! Group to face id assignment
- std::vector<unsigned int> *m_pGroupFaceIDs;
- //! Active group
- std::string m_strActiveGroup;
- //! Vector with generated texture coordinates
- std::vector<aiVector2D> m_TextureCoord;
- //! Current mesh instance
- Mesh *m_pCurrentMesh;
- //! Vector with stored meshes
- std::vector<Mesh*> m_Meshes;
- //! Material map
- std::map<std::string, Material*> m_MaterialMap;
-
-
- //! \brief Default constructor
- Model() :
- m_ModelName(""),
- m_pCurrent(NULL),
- m_pCurrentMaterial(NULL),
- m_pDefaultMaterial(NULL),
- m_strActiveGroup(""),
- m_pCurrentMesh(NULL)
- {
- // empty
- }
-
- //! \brief Destructor
- ~Model()
- {
- // Clear all stored object instances
- for (std::vector<Object*>::iterator it = m_Objects.begin();
- it != m_Objects.end(); ++it)
- {
- delete *it;
- }
- m_Objects.clear();
-
- // Clear all stored mesh instances
- for (std::vector<Mesh*>::iterator it = m_Meshes.begin();
- it != m_Meshes.end(); ++it)
- {
- delete *it;
- }
-
- m_Meshes.clear();
-
- for (GroupMapIt it = m_Groups.begin();
- it != m_Groups.end(); ++it)
- {
- delete it->second;
- }
-
- m_Groups.clear();
- }
-};
-
-// ------------------------------------------------------------------------------------------------
-
-} // Namespace ObjFile
-} // Namespace Assimp
-
-#endif
diff --git a/3rdparty/assimp/code/ObjFileImporter.cpp b/3rdparty/assimp/code/ObjFileImporter.cpp
deleted file mode 100644
index 2cd68ee1..00000000
--- a/3rdparty/assimp/code/ObjFileImporter.cpp
+++ /dev/null
@@ -1,521 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-#include "AssimpPCH.h"
-#ifndef ASSIMP_BUILD_NO_OBJ_IMPORTER
-
-#include "DefaultIOSystem.h"
-#include "ObjFileImporter.h"
-#include "ObjFileParser.h"
-#include "ObjFileData.h"
-
-namespace Assimp {
-
-using namespace std;
-
-// ------------------------------------------------------------------------------------------------
-// Default constructor
-ObjFileImporter::ObjFileImporter() :
- m_Buffer(),
- m_pRootObject( NULL ),
- m_strAbsPath( "" )
-{
- DefaultIOSystem io;
- m_strAbsPath = io.getOsSeparator();
-}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor.
-ObjFileImporter::~ObjFileImporter()
-{
- // Release root object instance
- if (NULL != m_pRootObject)
- {
- delete m_pRootObject;
- m_pRootObject = NULL;
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Returns true, if file is an obj file.
-bool ObjFileImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler , bool checkSig ) const
-{
- if (!checkSig) //Check File Extension
- {
- return SimpleExtensionCheck(pFile,"obj");
- }
- else //Check file Header
- {
- const char* tokens[] = {"mtllib","usemtl","vt ","vn ","o "};
- return BaseImporter::SearchFileHeaderForToken(pIOHandler, pFile, tokens, 5);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Obj-file import implementation
-void ObjFileImporter::InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler)
-{
- DefaultIOSystem io;
-
- // Read file into memory
- const std::string mode = "rb";
- boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile, mode));
- if (NULL == file.get())
- throw DeadlyImportError( "Failed to open file " + pFile + ".");
-
- // Get the filesize and vaslidate it, throwing an exception when failes
- size_t fileSize = file->FileSize();
- if ( fileSize < 16)
- throw DeadlyImportError( "OBJ-file is too small.");
-
- // Allocate buffer and read file into it
- TextFileToBuffer(file.get(),m_Buffer);
-
- // Get the model name
- std::string strModelName;
- std::string::size_type pos = pFile.find_last_of( "\\/" );
- if ( pos != std::string::npos )
- {
- strModelName = pFile.substr(pos+1, pFile.size() - pos - 1);
- }
- else
- {
- strModelName = pFile;
- }
-
- // parse the file into a temporary representation
- ObjFileParser parser(m_Buffer, strModelName, pIOHandler);
-
- // And create the proper return structures out of it
- CreateDataFromImport(parser.GetModel(), pScene);
-
- // Clean up allocated storage for the next import
- m_Buffer.clear();
-}
-
-// ------------------------------------------------------------------------------------------------
-// Create the data from parsed obj-file
-void ObjFileImporter::CreateDataFromImport(const ObjFile::Model* pModel, aiScene* pScene)
-{
- if (0L == pModel)
- return;
-
- // Create the root node of the scene
- pScene->mRootNode = new aiNode;
- if ( !pModel->m_ModelName.empty() )
- {
- // Set the name of the scene
- pScene->mRootNode->mName.Set(pModel->m_ModelName);
- }
- else
- {
- // This is an error, so break down the application
- ai_assert(false);
- }
-
- // Create nodes for the whole scene
- std::vector<aiMesh*> MeshArray;
- for (size_t index = 0; index < pModel->m_Objects.size(); index++)
- {
- createNodes(pModel, pModel->m_Objects[ index ], index, pScene->mRootNode, pScene, MeshArray);
- }
-
- // Create mesh pointer buffer for this scene
- if (pScene->mNumMeshes > 0)
- {
- pScene->mMeshes = new aiMesh*[ MeshArray.size() ];
- for (size_t index =0; index < MeshArray.size(); index++)
- {
- pScene->mMeshes [ index ] = MeshArray[ index ];
- }
- }
-
- // Create all materials
- createMaterials( pModel, pScene );
-}
-
-// ------------------------------------------------------------------------------------------------
-// Creates all nodes of the model
-aiNode *ObjFileImporter::createNodes(const ObjFile::Model* pModel, const ObjFile::Object* pObject,
- unsigned int uiMeshIndex,
- aiNode *pParent, aiScene* pScene,
- std::vector<aiMesh*> &MeshArray )
-{
- ai_assert( NULL != pModel );
- if ( NULL == pObject )
- return NULL;
-
- // Store older mesh size to be able to computate mesh offsets for new mesh instances
- const size_t oldMeshSize = MeshArray.size();
- aiNode *pNode = new aiNode;
- pNode->mName = aiString(pObject->m_strObjName);
-
- if (pParent != NULL)
- appendChildToParentNode(pParent, pNode);
-
-
- for ( unsigned int i=0; i< pObject->m_Meshes.size(); i++ )
- {
- unsigned int meshId = pObject->m_Meshes[ i ];
- aiMesh *pMesh = new aiMesh;
- createTopology( pModel, pObject, meshId, pMesh );
- if ( pMesh->mNumVertices > 0 )
- {
- MeshArray.push_back( pMesh );
- }
- else
- {
- delete pMesh;
- }
- }
-
- // Create all nodes from the sub-objects stored in the current object
- if ( !pObject->m_SubObjects.empty() )
- {
- size_t numChilds = pObject->m_SubObjects.size();
- pNode->mNumChildren = static_cast<unsigned int>( numChilds );
- pNode->mChildren = new aiNode*[ numChilds ];
- pNode->mNumMeshes = 1;
- pNode->mMeshes = new unsigned int[ 1 ];
- }
-
- // Set mesh instances into scene- and node-instances
- const size_t meshSizeDiff = MeshArray.size()- oldMeshSize;
- if ( meshSizeDiff > 0 )
- {
- pNode->mMeshes = new unsigned int[ meshSizeDiff ];
- pNode->mNumMeshes = static_cast<unsigned int>( meshSizeDiff );
- size_t index = 0;
- for (size_t i = oldMeshSize; i < MeshArray.size(); i++)
- {
- pNode->mMeshes[ index ] = pScene->mNumMeshes;
- pScene->mNumMeshes++;
- index++;
- }
- }
-
- return pNode;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Create topology data
-void ObjFileImporter::createTopology(const ObjFile::Model* pModel,
- const ObjFile::Object* pData,
- unsigned int uiMeshIndex,
- aiMesh* pMesh )
-{
- // Checking preconditions
- ai_assert( NULL != pModel );
- if (NULL == pData)
- return;
-
- // Create faces
- ObjFile::Mesh *pObjMesh = pModel->m_Meshes[ uiMeshIndex ];
- ai_assert( NULL != pObjMesh );
- pMesh->mNumFaces = static_cast<unsigned int>( pObjMesh->m_Faces.size() );
- if ( pMesh->mNumFaces > 0 )
- {
- pMesh->mFaces = new aiFace[ pMesh->mNumFaces ];
- if ( pObjMesh->m_uiMaterialIndex != ObjFile::Mesh::NoMaterial )
- {
- pMesh->mMaterialIndex = pObjMesh->m_uiMaterialIndex;
- }
-
- // Copy all data from all stored meshes
- for (size_t index = 0; index < pObjMesh->m_Faces.size(); index++)
- {
- aiFace *pFace = &pMesh->mFaces[ index ];
- const unsigned int uiNumIndices = (unsigned int) pObjMesh->m_Faces[ index ]->m_pVertices->size();
- pFace->mNumIndices = (unsigned int) uiNumIndices;
- if (pFace->mNumIndices > 0)
- {
- pFace->mIndices = new unsigned int[ uiNumIndices ];
- ObjFile::Face::IndexArray *pIndexArray = pObjMesh->m_Faces[ index ]->m_pVertices;
- ai_assert ( NULL != pIndexArray );
- for ( size_t a=0; a<pFace->mNumIndices; a++ )
- {
- pFace->mIndices[ a ] = pIndexArray->at( a );
- }
- }
- else
- {
- pFace->mIndices = NULL;
- }
- }
- }
-
- // Create mesh vertices
- createVertexArray(pModel, pData, uiMeshIndex, pMesh);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Creates a vertex array
-void ObjFileImporter::createVertexArray(const ObjFile::Model* pModel,
- const ObjFile::Object* pCurrentObject,
- unsigned int uiMeshIndex,
- aiMesh* pMesh)
-{
- // Checking preconditions
- ai_assert( NULL != pCurrentObject );
-
- // Break, if no faces are stored in object
- if ( pCurrentObject->m_Meshes.empty() )
- return;
-
- // Get current mesh
- ObjFile::Mesh *pObjMesh = pModel->m_Meshes[ uiMeshIndex ];
- if ( NULL == pObjMesh || pObjMesh->m_uiNumIndices < 1)
- return;
-
- // Copy vertices of this mesh instance
- pMesh->mNumVertices = (unsigned int) pObjMesh->m_uiNumIndices;
- pMesh->mVertices = new aiVector3D[ pMesh->mNumVertices ];
-
- // Allocate buffer for normal vectors
- if ( !pModel->m_Normals.empty() && pObjMesh->m_hasNormals )
- pMesh->mNormals = new aiVector3D[ pMesh->mNumVertices ];
-
- // Allocate buffer for texture coordinates
- if ( !pModel->m_TextureCoord.empty() && pObjMesh->m_uiUVCoordinates[0] )
- {
- pMesh->mNumUVComponents[ 0 ] = 2;
- pMesh->mTextureCoords[ 0 ] = new aiVector3D[ pMesh->mNumVertices ];
- }
-
- // Copy vertices, normals and textures into aiMesh instance
- unsigned int newIndex = 0;
- for ( size_t index=0; index < pObjMesh->m_Faces.size(); index++ )
- {
- // Get destination face
- aiFace *pDestFace = &pMesh->mFaces[ index ];
-
- // Get source face
- ObjFile::Face *pSourceFace = pObjMesh->m_Faces[ index ];
-
- // Copy all index arrays
- for ( size_t vertexIndex = 0; vertexIndex < pSourceFace->m_pVertices->size(); vertexIndex++ )
- {
- const unsigned int vertex = pSourceFace->m_pVertices->at( vertexIndex );
- ai_assert( vertex < pModel->m_Vertices.size() );
- pMesh->mVertices[ newIndex ] = pModel->m_Vertices[ vertex ];
-
- // Copy all normals
- if ( !pSourceFace->m_pNormals->empty() )
- {
- const unsigned int normal = pSourceFace->m_pNormals->at( vertexIndex );
- ai_assert( normal < pModel->m_Normals.size() );
- pMesh->mNormals[ newIndex ] = pModel->m_Normals[ normal ];
- }
-
- // Copy all texture coordinates
- if ( !pModel->m_TextureCoord.empty() )
- {
- if ( !pSourceFace->m_pTexturCoords->empty() )
- {
- const unsigned int tex = pSourceFace->m_pTexturCoords->at( vertexIndex );
- ai_assert( tex < pModel->m_TextureCoord.size() );
- for ( size_t i=0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS; i++ )
- {
- if ( pMesh->mNumUVComponents[ i ] > 0 )
- {
- aiVector2D coord2d = pModel->m_TextureCoord[ tex ];
- pMesh->mTextureCoords[ i ][ newIndex ] = aiVector3D( coord2d.x, coord2d.y, 0.0 );
- }
- }
- }
- }
-
- ai_assert( pMesh->mNumVertices > newIndex );
- pDestFace->mIndices[ vertexIndex ] = newIndex;
- ++newIndex;
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Counts all stored meshes
-void ObjFileImporter::countObjects(const std::vector<ObjFile::Object*> &rObjects, int &iNumMeshes)
-{
- iNumMeshes = 0;
- if ( rObjects.empty() )
- return;
-
- iNumMeshes += static_cast<unsigned int>( rObjects.size() );
- for (std::vector<ObjFile::Object*>::const_iterator it = rObjects.begin();
- it != rObjects.end();
- ++it)
- {
- if (!(*it)->m_SubObjects.empty())
- {
- countObjects((*it)->m_SubObjects, iNumMeshes);
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Creates the material
-void ObjFileImporter::createMaterials(const ObjFile::Model* pModel, aiScene* pScene )
-{
- ai_assert( NULL != pScene );
- if ( NULL == pScene )
- return;
-
- const unsigned int numMaterials = (unsigned int) pModel->m_MaterialLib.size();
- pScene->mNumMaterials = 0;
- if ( pModel->m_MaterialLib.empty() )
- return;
-
- pScene->mMaterials = new aiMaterial*[ numMaterials ];
- for ( unsigned int matIndex = 0; matIndex < numMaterials; matIndex++ )
- {
- Assimp::MaterialHelper* mat = new Assimp::MaterialHelper;
-
- // Store material name
- std::map<std::string, ObjFile::Material*>::const_iterator it;
- it = pModel->m_MaterialMap.find( pModel->m_MaterialLib[ matIndex ] );
-
- // No material found, use the default material
- if ( pModel->m_MaterialMap.end() == it )
- continue;
-
- ObjFile::Material *pCurrentMaterial = (*it).second;
- mat->AddProperty( &pCurrentMaterial->MaterialName, AI_MATKEY_NAME );
-
- // convert illumination model
- int sm = 0;
- switch (pCurrentMaterial->illumination_model)
- {
- case 0:
- sm = aiShadingMode_NoShading;
- break;
- case 1:
- sm = aiShadingMode_Gouraud;
- break;
- case 2:
- sm = aiShadingMode_Phong;
- break;
- default:
- sm = aiShadingMode_Gouraud;
- DefaultLogger::get()->error("OBJ/MTL: Unexpected illumination model (0-2 recognized)");
- }
- mat->AddProperty<int>( &sm, 1, AI_MATKEY_SHADING_MODEL);
-
- // multiplying the specular exponent with 2 seems to yield better results
- pCurrentMaterial->shineness *= 4.f;
-
- // Adding material colors
- mat->AddProperty( &pCurrentMaterial->ambient, 1, AI_MATKEY_COLOR_AMBIENT );
- mat->AddProperty( &pCurrentMaterial->diffuse, 1, AI_MATKEY_COLOR_DIFFUSE );
- mat->AddProperty( &pCurrentMaterial->specular, 1, AI_MATKEY_COLOR_SPECULAR );
- mat->AddProperty( &pCurrentMaterial->shineness, 1, AI_MATKEY_SHININESS );
- mat->AddProperty( &pCurrentMaterial->alpha, 1, AI_MATKEY_OPACITY );
-
- // Adding refraction index
- mat->AddProperty( &pCurrentMaterial->ior, 1, AI_MATKEY_REFRACTI );
-
- // Adding textures
- if ( 0 != pCurrentMaterial->texture.length )
- mat->AddProperty( &pCurrentMaterial->texture, AI_MATKEY_TEXTURE_DIFFUSE(0));
-
- if ( 0 != pCurrentMaterial->textureAmbient.length )
- mat->AddProperty( &pCurrentMaterial->textureAmbient, AI_MATKEY_TEXTURE_AMBIENT(0));
-
- if ( 0 != pCurrentMaterial->textureSpecular.length )
- mat->AddProperty( &pCurrentMaterial->textureSpecular, AI_MATKEY_TEXTURE_SPECULAR(0));
-
- if ( 0 != pCurrentMaterial->textureBump.length )
- mat->AddProperty( &pCurrentMaterial->textureBump, AI_MATKEY_TEXTURE_HEIGHT(0));
-
- if ( 0 != pCurrentMaterial->textureOpacity.length )
- mat->AddProperty( &pCurrentMaterial->textureOpacity, AI_MATKEY_TEXTURE_OPACITY(0));
-
- if ( 0 != pCurrentMaterial->textureSpecularity.length )
- mat->AddProperty( &pCurrentMaterial->textureSpecularity, AI_MATKEY_TEXTURE_SHININESS(0));
-
- // Store material property info in material array in scene
- pScene->mMaterials[ pScene->mNumMaterials ] = mat;
- pScene->mNumMaterials++;
- }
-
- // Test number of created materials.
- ai_assert( pScene->mNumMaterials == numMaterials );
-}
-
-// ------------------------------------------------------------------------------------------------
-// Appends this node to the parent node
-void ObjFileImporter::appendChildToParentNode(aiNode *pParent, aiNode *pChild)
-{
- // Checking preconditions
- ai_assert( NULL != pParent );
- ai_assert( NULL != pChild );
-
- // Assign parent to child
- pChild->mParent = pParent;
- size_t sNumChildren = 0;
-
- // If already children was assigned to the parent node, store them in a
- std::vector<aiNode*> temp;
- if (pParent->mChildren != NULL)
- {
- sNumChildren = pParent->mNumChildren;
- ai_assert( 0 != sNumChildren );
- for (size_t index = 0; index < pParent->mNumChildren; index++)
- {
- temp.push_back(pParent->mChildren [ index ] );
- }
- delete [] pParent->mChildren;
- }
-
- // Copy node instances into parent node
- pParent->mNumChildren++;
- pParent->mChildren = new aiNode*[ pParent->mNumChildren ];
- for (size_t index = 0; index < pParent->mNumChildren-1; index++)
- {
- pParent->mChildren[ index ] = temp [ index ];
- }
- pParent->mChildren[ pParent->mNumChildren-1 ] = pChild;
-}
-
-// ------------------------------------------------------------------------------------------------
-
-} // Namespace Assimp
-
-#endif // !! ASSIMP_BUILD_NO_OBJ_IMPORTER
diff --git a/3rdparty/assimp/code/ObjFileImporter.h b/3rdparty/assimp/code/ObjFileImporter.h
deleted file mode 100644
index 7edecac8..00000000
--- a/3rdparty/assimp/code/ObjFileImporter.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-
-#ifndef OBJ_FILE_IMPORTER_H_INC
-#define OBJ_FILE_IMPORTER_H_INC
-
-#include "BaseImporter.h"
-#include <vector>
-
-struct aiMesh;
-struct aiNode;
-
-namespace Assimp
-{
-
-namespace ObjFile
-{
-struct Object;
-struct Model;
-}
-
-// ------------------------------------------------------------------------------------------------
-/// \class ObjFileImporter
-/// \brief Imports a waveform obj file
-// ------------------------------------------------------------------------------------------------
-class ObjFileImporter :
- BaseImporter
-{
- friend class Importer;
-
-protected:
- /// \brief Default constructor
- ObjFileImporter();
-
- /// \brief Destructor
- ~ObjFileImporter();
-
-public:
- /// \brief Returns whether the class can handle the format of the given file.
- /// \remark See BaseImporter::CanRead() for details.
- bool CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const;
-
-private:
-
- //! \brief Appends the supported extention.
- void GetExtensionList(std::set<std::string>& extensions);
-
- //! \brief File import implementation.
- void InternReadFile(const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler);
-
- //! \brief Create the data from imported content.
- void CreateDataFromImport(const ObjFile::Model* pModel, aiScene* pScene);
-
- //! \brief Creates all nodes stored in imported content.
- aiNode *createNodes(const ObjFile::Model* pModel, const ObjFile::Object* pData, unsigned int uiMeshIndex,
- aiNode *pParent, aiScene* pScene, std::vector<aiMesh*> &MeshArray);
-
- //! \brief Creates topology data like faces and meshes for the geometry.
- void createTopology(const ObjFile::Model* pModel, const ObjFile::Object* pData,
- unsigned int uiMeshIndex, aiMesh* pMesh);
-
- //! \brief Creates vertices from model.
- void createVertexArray(const ObjFile::Model* pModel, const ObjFile::Object* pCurrentObject,
- unsigned int uiMeshIndex, aiMesh* pMesh);
-
- //! \brief Object counter helper method.
- void countObjects(const std::vector<ObjFile::Object*> &rObjects, int &iNumMeshes);
-
- //! \brief Material creation.
- void createMaterials(const ObjFile::Model* pModel, aiScene* pScene);
-
- //! \brief Appends a child node to a parentnode and updates the datastructures.
- void appendChildToParentNode(aiNode *pParent, aiNode *pChild);
-
- //! \brief TODO!
- void createAnimations();
-
-private:
- //! Data buffer
- std::vector<char> m_Buffer;
- //! Pointer to root object instance
- ObjFile::Object *m_pRootObject;
- //! Absolute pathname of model in filesystem
- std::string m_strAbsPath;
-};
-
-// ------------------------------------------------------------------------------------------------
-//
-inline void ObjFileImporter::GetExtensionList(std::set<std::string>& extensions)
-{
- extensions.insert("obj");
-}
-
-// ------------------------------------------------------------------------------------------------
-
-} // Namespace Assimp
-
-#endif
diff --git a/3rdparty/assimp/code/ObjFileMtlImporter.cpp b/3rdparty/assimp/code/ObjFileMtlImporter.cpp
deleted file mode 100644
index 99de1a67..00000000
--- a/3rdparty/assimp/code/ObjFileMtlImporter.cpp
+++ /dev/null
@@ -1,294 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-#include "AssimpPCH.h"
-#ifndef ASSIMP_BUILD_NO_OBJ_IMPORTER
-
-#include "ObjFileMtlImporter.h"
-#include "ObjTools.h"
-#include "ObjFileData.h"
-#include "fast_atof.h"
-
-namespace Assimp {
-
-// -------------------------------------------------------------------
-// Constructor
-ObjFileMtlImporter::ObjFileMtlImporter( std::vector<char> &buffer,
- const std::string & /*strAbsPath*/,
- ObjFile::Model *pModel ) :
- m_DataIt( buffer.begin() ),
- m_DataItEnd( buffer.end() ),
- m_pModel( pModel ),
- m_uiLine( 0 )
-{
- ai_assert( NULL != m_pModel );
- if ( NULL == m_pModel->m_pDefaultMaterial )
- {
- m_pModel->m_pDefaultMaterial = new ObjFile::Material;
- m_pModel->m_pDefaultMaterial->MaterialName.Set( "default" );
- }
- load();
-}
-
-// -------------------------------------------------------------------
-// Destructor
-ObjFileMtlImporter::~ObjFileMtlImporter()
-{
- // empty
-}
-
-// -------------------------------------------------------------------
-// Private copy constructor
-ObjFileMtlImporter::ObjFileMtlImporter(const ObjFileMtlImporter & /* rOther */ )
-{
- // empty
-}
-
-// -------------------------------------------------------------------
-// Private copy constructor
-ObjFileMtlImporter &ObjFileMtlImporter::operator = ( const ObjFileMtlImporter & /*rOther */ )
-{
- return *this;
-}
-
-// -------------------------------------------------------------------
-// Loads the material description
-void ObjFileMtlImporter::load()
-{
- if ( m_DataIt == m_DataItEnd )
- return;
-
- while ( m_DataIt != m_DataItEnd )
- {
- switch (*m_DataIt)
- {
- case 'K':
- {
- ++m_DataIt;
- if (*m_DataIt == 'a') // Ambient color
- {
- ++m_DataIt;
- getColorRGBA( &m_pModel->m_pCurrentMaterial->ambient );
- }
- else if (*m_DataIt == 'd') // Diffuse color
- {
- ++m_DataIt;
- getColorRGBA( &m_pModel->m_pCurrentMaterial->diffuse );
- }
- else if (*m_DataIt == 's')
- {
- ++m_DataIt;
- getColorRGBA( &m_pModel->m_pCurrentMaterial->specular );
- }
- m_DataIt = skipLine<DataArrayIt>( m_DataIt, m_DataItEnd, m_uiLine );
- }
- break;
-
- case 'd': // Alpha value
- {
- ++m_DataIt;
- getFloatValue( m_pModel->m_pCurrentMaterial->alpha );
- m_DataIt = skipLine<DataArrayIt>( m_DataIt, m_DataItEnd, m_uiLine );
- }
- break;
-
- case 'N': // Shineness
- {
- ++m_DataIt;
- switch(*m_DataIt)
- {
- case 's':
- ++m_DataIt;
- getFloatValue(m_pModel->m_pCurrentMaterial->shineness);
- break;
- case 'i': //Index Of refraction
- ++m_DataIt;
- getFloatValue(m_pModel->m_pCurrentMaterial->ior);
- break;
- }
- m_DataIt = skipLine<DataArrayIt>( m_DataIt, m_DataItEnd, m_uiLine );
- break;
- }
- break;
-
-
- case 'm': // Texture
- case 'b': // quick'n'dirty - for 'bump' sections
- {
- getTexture();
- m_DataIt = skipLine<DataArrayIt>( m_DataIt, m_DataItEnd, m_uiLine );
- }
- break;
-
- case 'n': // New material name
- {
- createMaterial();
- m_DataIt = skipLine<DataArrayIt>( m_DataIt, m_DataItEnd, m_uiLine );
- }
- break;
-
- case 'i': // Illumination model
- {
- m_DataIt = getNextToken<DataArrayIt>(m_DataIt, m_DataItEnd);
- getIlluminationModel( m_pModel->m_pCurrentMaterial->illumination_model );
- m_DataIt = skipLine<DataArrayIt>( m_DataIt, m_DataItEnd, m_uiLine );
- }
- break;
-
- default:
- {
- m_DataIt = skipLine<DataArrayIt>( m_DataIt, m_DataItEnd, m_uiLine );
- }
- break;
- }
- }
-}
-
-// -------------------------------------------------------------------
-// Loads a color definition
-void ObjFileMtlImporter::getColorRGBA( aiColor3D *pColor )
-{
- ai_assert( NULL != pColor );
-
- float r, g, b;
- m_DataIt = getFloat<DataArrayIt>( m_DataIt, m_DataItEnd, r );
- pColor->r = r;
-
- m_DataIt = getFloat<DataArrayIt>( m_DataIt, m_DataItEnd, g );
- pColor->g = g;
-
- m_DataIt = getFloat<DataArrayIt>( m_DataIt, m_DataItEnd, b );
- pColor->b = b;
-}
-
-// -------------------------------------------------------------------
-// Loads the kind of illumination model.
-void ObjFileMtlImporter::getIlluminationModel( int &illum_model )
-{
- m_DataIt = CopyNextWord<DataArrayIt>( m_DataIt, m_DataItEnd, m_buffer, BUFFERSIZE );
- illum_model = atoi(m_buffer);
-}
-
-// -------------------------------------------------------------------
-// Loads a single float value.
-void ObjFileMtlImporter::getFloatValue( float &value )
-{
- m_DataIt = CopyNextWord<DataArrayIt>( m_DataIt, m_DataItEnd, m_buffer, BUFFERSIZE );
- value = (float) fast_atof(m_buffer);
-}
-
-// -------------------------------------------------------------------
-// Creates a material from loaded data.
-void ObjFileMtlImporter::createMaterial()
-{
- std::string strName( "" );
- m_DataIt = getName<DataArrayIt>( m_DataIt, m_DataItEnd, strName );
- if ( m_DataItEnd == m_DataIt )
- return;
-
- std::map<std::string, ObjFile::Material*>::iterator it = m_pModel->m_MaterialMap.find( strName );
- if ( m_pModel->m_MaterialMap.end() == it)
- {
- // New Material created
- m_pModel->m_pCurrentMaterial = new ObjFile::Material();
- m_pModel->m_pCurrentMaterial->MaterialName.Set( strName );
- m_pModel->m_MaterialLib.push_back( strName );
- m_pModel->m_MaterialMap[ strName ] = m_pModel->m_pCurrentMaterial;
- }
- else
- {
- // Use older material
- m_pModel->m_pCurrentMaterial = (*it).second;
- }
-}
-
-// -------------------------------------------------------------------
-// Gets a texture name from data.
-void ObjFileMtlImporter::getTexture()
-{
- aiString *out = NULL;
-
- // FIXME: just a quick'n'dirty hack, consider cleanup later
-
- // Diffuse texture
- if (!ASSIMP_strincmp(&(*m_DataIt),"map_kd",6))
- out = & m_pModel->m_pCurrentMaterial->texture;
-
- // Ambient texture
- else if (!ASSIMP_strincmp(&(*m_DataIt),"map_ka",6))
- out = & m_pModel->m_pCurrentMaterial->textureAmbient;
-
- // Specular texture
- else if (!ASSIMP_strincmp(&(*m_DataIt),"map_ks",6))
- out = & m_pModel->m_pCurrentMaterial->textureSpecular;
-
- // Opacity texture
- else if (!ASSIMP_strincmp(&(*m_DataIt),"map_d",5))
- out = & m_pModel->m_pCurrentMaterial->textureOpacity;
-
- // Ambient texture
- else if (!ASSIMP_strincmp(&(*m_DataIt),"map_ka",6))
- out = & m_pModel->m_pCurrentMaterial->textureAmbient;
-
- // Bump texture
- else if (!ASSIMP_strincmp(&(*m_DataIt),"map_bump",8) || !ASSIMP_strincmp(&(*m_DataIt),"bump",4))
- out = & m_pModel->m_pCurrentMaterial->textureBump;
-
- // Specularity scaling (glossiness)
- else if (!ASSIMP_strincmp(&(*m_DataIt),"map_ns",6))
- out = & m_pModel->m_pCurrentMaterial->textureSpecularity;
-
- else
- {
- DefaultLogger::get()->error("OBJ/MTL: Encountered unknown texture type");
- return;
- }
-
- std::string strTexture;
- m_DataIt = getName<DataArrayIt>( m_DataIt, m_DataItEnd, strTexture );
- out->Set( strTexture );
-}
-
-// -------------------------------------------------------------------
-
-} // Namespace Assimp
-
-#endif // !! ASSIMP_BUILD_NO_OBJ_IMPORTER
diff --git a/3rdparty/assimp/code/ObjFileMtlImporter.h b/3rdparty/assimp/code/ObjFileMtlImporter.h
deleted file mode 100644
index f98cbbca..00000000
--- a/3rdparty/assimp/code/ObjFileMtlImporter.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------*/
-#ifndef OBJFILEMTLIMPORTER_H_INC
-#define OBJFILEMTLIMPORTER_H_INC
-
-#include <vector>
-#include <string>
-
-struct aiColor3D;
-
-namespace Assimp
-{
-
-namespace ObjFile
-{
-struct Model;
-struct Material;
-
-}
-
-
-/**
- * @class ObjFileMtlImporter
- * @brief Loads the material description from a mtl file.
- */
-class ObjFileMtlImporter
-{
-public:
- static const size_t BUFFERSIZE = 2048;
- typedef std::vector<char> DataArray;
- typedef std::vector<char>::iterator DataArrayIt;
- typedef std::vector<char>::const_iterator ConstDataArrayIt;
-
-public:
- //! \brief Default constructor
- ObjFileMtlImporter( std::vector<char> &buffer, const std::string &strAbsPath,
- ObjFile::Model *pModel );
-
- //! \brief DEstructor
- ~ObjFileMtlImporter();
-
-private:
- /// Copy constructor, empty.
- ObjFileMtlImporter(const ObjFileMtlImporter &rOther);
- /// \brief Assignment operator, returns only a reference of this instance.
- ObjFileMtlImporter &operator = (const ObjFileMtlImporter &rOther);
- /// Load the whole material description
- void load();
- /// Get color data.
- void getColorRGBA( aiColor3D *pColor);
- /// Get illumination model from loaded data
- void getIlluminationModel( int &illum_model );
- /// Gets a float value from data.
- void getFloatValue( float &value );
- /// Creates a new material from loaded data.
- void createMaterial();
- /// Get texture name from loaded data.
- void getTexture();
-
-private:
- //! Absolute pathname
- std::string m_strAbsPath;
- //! Data iterator showing to the current position in data buffer
- DataArrayIt m_DataIt;
- //! Data iterator to end of buffer
- DataArrayIt m_DataItEnd;
- //! USed model instance
- ObjFile::Model *m_pModel;
- //! Current line in file
- unsigned int m_uiLine;
- //! Helper buffer
- char m_buffer[BUFFERSIZE];
-};
-
-// ------------------------------------------------------------------------------------------------
-
-} // Namespace Assimp
-
-#endif
diff --git a/3rdparty/assimp/code/ObjFileParser.cpp b/3rdparty/assimp/code/ObjFileParser.cpp
deleted file mode 100644
index 3d214bd1..00000000
--- a/3rdparty/assimp/code/ObjFileParser.cpp
+++ /dev/null
@@ -1,665 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-#include "AssimpPCH.h"
-#ifndef ASSIMP_BUILD_NO_OBJ_IMPORTER
-
-#include "ObjFileParser.h"
-#include "ObjFileMtlImporter.h"
-#include "ObjTools.h"
-#include "ObjFileData.h"
-#include "fast_atof.h"
-#include "../include/aiTypes.h"
-#include "DefaultIOSystem.h"
-
-namespace Assimp
-{
-
-// -------------------------------------------------------------------
-const std::string ObjFileParser::DEFAULT_MATERIAL = AI_DEFAULT_MATERIAL_NAME;
-// fix: changed that to our standard default name
-
-// -------------------------------------------------------------------
-// Constructor with loaded data and directories.
-ObjFileParser::ObjFileParser(std::vector<char> &Data,const std::string &strModelName, IOSystem *io ) :
- m_DataIt(Data.begin()),
- m_DataItEnd(Data.end()),
- m_pModel(NULL),
- m_uiLine(0),
- m_pIO( io )
-{
- // Create the model instance to store all the data
- m_pModel = new ObjFile::Model();
- m_pModel->m_ModelName = strModelName;
-
- m_pModel->m_pDefaultMaterial = new ObjFile::Material();
- m_pModel->m_pDefaultMaterial->MaterialName.Set( DEFAULT_MATERIAL );
- m_pModel->m_MaterialLib.push_back( DEFAULT_MATERIAL );
- m_pModel->m_MaterialMap[ DEFAULT_MATERIAL ] = m_pModel->m_pDefaultMaterial;
-
- // Start parsing the file
- parseFile();
-}
-
-// -------------------------------------------------------------------
-// Destrcutor.
-ObjFileParser::~ObjFileParser()
-{
- delete m_pModel->m_pDefaultMaterial;
- m_pModel->m_pDefaultMaterial = NULL;
-
- delete m_pModel;
- m_pModel = NULL;
-}
-
-// -------------------------------------------------------------------
-// Returns a pointer to the model instance.
-ObjFile::Model *ObjFileParser::GetModel() const
-{
- return m_pModel;
-}
-
-// -------------------------------------------------------------------
-// File parsing method.
-void ObjFileParser::parseFile()
-{
- if (m_DataIt == m_DataItEnd)
- return;
-
- while (m_DataIt != m_DataItEnd)
- {
- switch (*m_DataIt)
- {
- case 'v': // Parse a vertex texture coordinate
- {
- ++m_DataIt;
- if (*m_DataIt == ' ')
- {
- // Read in vertex definition
- getVector3(m_pModel->m_Vertices);
- }
- else if (*m_DataIt == 't')
- {
- // Read in texture coordinate (2D)
- ++m_DataIt;
- getVector2(m_pModel->m_TextureCoord);
- }
- else if (*m_DataIt == 'n')
- {
- // Read in normal vector definition
- ++m_DataIt;
- getVector3( m_pModel->m_Normals );
- }
- }
- break;
-
- case 'f': // Parse a face
- {
- getFace();
- }
- break;
-
- case '#': // Parse a comment
- {
- getComment();
- }
- break;
-
- case 'u': // Parse a material desc. setter
- {
- getMaterialDesc();
- }
- break;
-
- case 'm': // Parse a material library
- {
- getMaterialLib();
- }
- break;
-
- case 'g': // Parse group name
- {
- getGroupName();
- }
- break;
-
- case 's': // Parse group number
- {
- getGroupNumber();
- }
- break;
-
- case 'o': // Parse object name
- {
- getObjectName();
- }
- break;
-
- default:
- {
- m_DataIt = skipLine<DataArrayIt>( m_DataIt, m_DataItEnd, m_uiLine );
- }
- break;
- }
- }
-}
-
-// -------------------------------------------------------------------
-// Copy the next word in a temporary buffer
-void ObjFileParser::copyNextWord(char *pBuffer, size_t length)
-{
- size_t index = 0;
- m_DataIt = getNextWord<DataArrayIt>(m_DataIt, m_DataItEnd);
- while ( !isSeparator(*m_DataIt) && m_DataIt != m_DataItEnd )
- {
- pBuffer[index] = *m_DataIt;
- index++;
- if (index == length-1)
- break;
- ++m_DataIt;
- }
- pBuffer[index] = '\0';
-}
-
-// -------------------------------------------------------------------
-// Copy the next line into a temporary buffer
-void ObjFileParser::copyNextLine(char *pBuffer, size_t length)
-{
- size_t index = 0;
- while (m_DataIt != m_DataItEnd)
- {
- if (*m_DataIt == '\n' || *m_DataIt == '\r' || index == length-1)
- break;
-
- pBuffer[ index ] = *m_DataIt;
- ++index;
- ++m_DataIt;
- }
- pBuffer[ index ] = '\0';
-}
-
-// -------------------------------------------------------------------
-// Get values for a new 3D vector instance
-void ObjFileParser::getVector3(std::vector<aiVector3D> &point3d_array)
-{
- float x, y, z;
- copyNextWord(m_buffer, BUFFERSIZE);
- x = (float) fast_atof(m_buffer);
-
- copyNextWord(m_buffer, BUFFERSIZE);
- y = (float) fast_atof(m_buffer);
-
- copyNextWord(m_buffer, BUFFERSIZE);
- z = (float) fast_atof(m_buffer);
-
- point3d_array.push_back( aiVector3D( x, y, z ) );
- //skipLine();
- m_DataIt = skipLine<DataArrayIt>( m_DataIt, m_DataItEnd, m_uiLine );
-}
-
-// -------------------------------------------------------------------
-// Get values for a new 2D vector instance
-void ObjFileParser::getVector2( std::vector<aiVector2D> &point2d_array )
-{
- float x, y;
- copyNextWord(m_buffer, BUFFERSIZE);
- x = (float) fast_atof(m_buffer);
-
- copyNextWord(m_buffer, BUFFERSIZE);
- y = (float) fast_atof(m_buffer);
-
- point2d_array.push_back(aiVector2D(x, y));
-
- m_DataIt = skipLine<DataArrayIt>( m_DataIt, m_DataItEnd, m_uiLine );
-}
-
-// -------------------------------------------------------------------
-// Get values for a new face instance
-void ObjFileParser::getFace()
-{
- copyNextLine(m_buffer, BUFFERSIZE);
- if (m_DataIt == m_DataItEnd)
- return;
-
- char *pPtr = m_buffer;
- char *pEnd = &pPtr[BUFFERSIZE];
- pPtr = getNextToken<char*>(pPtr, pEnd);
- if (pPtr == '\0')
- return;
-
- std::vector<unsigned int> *pIndices = new std::vector<unsigned int>;
- std::vector<unsigned int> *pTexID = new std::vector<unsigned int>;
- std::vector<unsigned int> *pNormalID = new std::vector<unsigned int>;
- bool hasNormal = false;
-
- bool vt = (!m_pModel->m_TextureCoord.empty());
- bool vn = (!m_pModel->m_Normals.empty());
- int iStep = 0, iPos = 0;
- while (pPtr != pEnd)
- {
- iStep = 1;
- if (*pPtr == '\0')
- break;
-
- if (*pPtr=='\r')
- break;
-
- if (*pPtr=='/' )
- {
- if (iPos == 0)
- {
- //if there are no texturecoordinates in the obj file but normals
- if (!vt && vn) {
- iPos = 1;
- iStep++;
- }
- }
- iPos++;
- }
- else if ( isSeparator(*pPtr) )
- {
- iPos = 0;
- }
- else
- {
- //OBJ USES 1 Base ARRAYS!!!!
- const int iVal = atoi( pPtr );
- int tmp = iVal;
- while ( ( tmp = tmp / 10 )!=0 )
- ++iStep;
-
- if ( iVal > 0 )
- {
- // Store parsed index
- if ( 0 == iPos )
- {
- pIndices->push_back( iVal-1 );
- }
- else if ( 1 == iPos )
- {
- pTexID->push_back( iVal-1 );
- }
- else if ( 2 == iPos )
- {
- pNormalID->push_back( iVal-1 );
- hasNormal = true;
- }
- else
- {
- reportErrorTokenInFace();
- }
- }
- }
- for ( int i=0; i<iStep; i++ )
- ++pPtr;
- }
-
- ObjFile::Face *face = new ObjFile::Face( pIndices, pNormalID, pTexID );
-
- // Set active material, if one set
- if (NULL != m_pModel->m_pCurrentMaterial)
- face->m_pMaterial = m_pModel->m_pCurrentMaterial;
- else
- face->m_pMaterial = m_pModel->m_pDefaultMaterial;
-
- // Create a default object, if nothing there
- if ( NULL == m_pModel->m_pCurrent )
- createObject( "defaultobject" );
-
- // Assign face to mesh
- if ( NULL == m_pModel->m_pCurrentMesh )
- {
- createMesh();
- }
-
- // Store the face
- m_pModel->m_pCurrentMesh->m_Faces.push_back( face );
- m_pModel->m_pCurrentMesh->m_uiNumIndices += (unsigned int)face->m_pVertices->size();
- m_pModel->m_pCurrentMesh->m_uiUVCoordinates[ 0 ] += (unsigned int)face->m_pTexturCoords[0].size();
- if ( !m_pModel->m_pCurrentMesh->m_hasNormals && hasNormal )
- {
- m_pModel->m_pCurrentMesh->m_hasNormals = true;
- }
- // Skip the rest of the line
- m_DataIt = skipLine<DataArrayIt>( m_DataIt, m_DataItEnd, m_uiLine );
-}
-
-// -------------------------------------------------------------------
-// Get values for a new material description
-void ObjFileParser::getMaterialDesc()
-{
- // Get next data for material data
- m_DataIt = getNextToken<DataArrayIt>(m_DataIt, m_DataItEnd);
- if (m_DataIt == m_DataItEnd)
- return;
-
- char *pStart = &(*m_DataIt);
- while ( !isSeparator(*m_DataIt) && m_DataIt != m_DataItEnd )
- ++m_DataIt;
-
- // Get name
- std::string strName(pStart, &(*m_DataIt));
- if ( strName.empty())
- return;
-
- // Search for material
- std::map<std::string, ObjFile::Material*>::iterator it = m_pModel->m_MaterialMap.find( strName );
- if ( it == m_pModel->m_MaterialMap.end() )
- {
- // Not found, use default material
- m_pModel->m_pCurrentMaterial = m_pModel->m_pDefaultMaterial;
- }
- else
- {
- // Found, using detected material
- m_pModel->m_pCurrentMaterial = (*it).second;
- if ( needsNewMesh( strName ))
- {
- createMesh();
- }
- m_pModel->m_pCurrentMesh->m_uiMaterialIndex = getMaterialIndex( strName );
- }
-
- // Skip rest of line
- m_DataIt = skipLine<DataArrayIt>( m_DataIt, m_DataItEnd, m_uiLine );
-}
-
-// -------------------------------------------------------------------
-// Get a comment, values will be skipped
-void ObjFileParser::getComment()
-{
- bool running = true;
- while (running)
- {
- if ( '\n' == (*m_DataIt) || m_DataIt == m_DataItEnd )
- {
- ++m_DataIt;
- break;
- }
- else
- {
- ++m_DataIt;
- }
- }
-}
-
-// -------------------------------------------------------------------
-// Get material library from file.
-void ObjFileParser::getMaterialLib()
-{
- // Translate tuple
- m_DataIt = getNextToken<DataArrayIt>(m_DataIt, m_DataItEnd);
- if (m_DataIt == m_DataItEnd)
- return;
-
- char *pStart = &(*m_DataIt);
- while (!isNewLine(*m_DataIt))
- m_DataIt++;
-
- // Check for existence
- const std::string strMatName(pStart, &(*m_DataIt));
- IOStream *pFile = m_pIO->Open(strMatName);
-
- if (!pFile )
- {
- DefaultLogger::get()->error("OBJ: Unable to locate material file " + strMatName);
- m_DataIt = skipLine<DataArrayIt>( m_DataIt, m_DataItEnd, m_uiLine );
- return;
- }
-
- // Import material library data from file
- std::vector<char> buffer;
- BaseImporter::TextFileToBuffer(pFile,buffer);
- m_pIO->Close( pFile );
-
- // Importing the material library
- ObjFileMtlImporter mtlImporter( buffer, strMatName, m_pModel );
-}
-
-// -------------------------------------------------------------------
-// Set a new material definition as the current material.
-void ObjFileParser::getNewMaterial()
-{
- m_DataIt = getNextToken<DataArrayIt>(m_DataIt, m_DataItEnd);
- m_DataIt = getNextWord<DataArrayIt>(m_DataIt, m_DataItEnd);
- if ( m_DataIt == m_DataItEnd )
- return;
-
- char *pStart = &(*m_DataIt);
- std::string strMat( pStart, *m_DataIt );
- while ( isSeparator( *m_DataIt ) )
- m_DataIt++;
- std::map<std::string, ObjFile::Material*>::iterator it = m_pModel->m_MaterialMap.find( strMat );
- if ( it == m_pModel->m_MaterialMap.end() )
- {
- // Show a warning, if material was not found
- DefaultLogger::get()->warn("OBJ: Unsupported material requested: " + strMat);
- m_pModel->m_pCurrentMaterial = m_pModel->m_pDefaultMaterial;
- }
- else
- {
- // Set new material
- if ( needsNewMesh( strMat ) )
- {
- createMesh();
- }
- m_pModel->m_pCurrentMesh->m_uiMaterialIndex = getMaterialIndex( strMat );
- }
-
- m_DataIt = skipLine<DataArrayIt>( m_DataIt, m_DataItEnd, m_uiLine );
-}
-
-// -------------------------------------------------------------------
-int ObjFileParser::getMaterialIndex( const std::string &strMaterialName )
-{
- int mat_index = -1;
- if ( strMaterialName.empty() )
- return mat_index;
- for (size_t index = 0; index < m_pModel->m_MaterialLib.size(); ++index)
- {
- if ( strMaterialName == m_pModel->m_MaterialLib[ index ])
- {
- mat_index = (int)index;
- break;
- }
- }
- return mat_index;
-}
-
-// -------------------------------------------------------------------
-// Getter for a group name.
-void ObjFileParser::getGroupName()
-{
- // Get next word from data buffer
- m_DataIt = getNextToken<DataArrayIt>(m_DataIt, m_DataItEnd);
- m_DataIt = getNextWord<DataArrayIt>(m_DataIt, m_DataItEnd);
- if ( isEndOfBuffer( m_DataIt, m_DataItEnd ) )
- return;
-
- // Store groupname in group library
- char *pStart = &(*m_DataIt);
- while ( !isSeparator(*m_DataIt) )
- m_DataIt++;
- std::string strGroupName(pStart, &(*m_DataIt));
-
- // Change active group, if necessary
- if ( m_pModel->m_strActiveGroup != strGroupName )
- {
- // Search for already existing entry
- ObjFile::Model::ConstGroupMapIt it = m_pModel->m_Groups.find(&strGroupName);
-
- // We are mapping groups into the object structure
- createObject( strGroupName );
-
- // New group name, creating a new entry
- if (it == m_pModel->m_Groups.end())
- {
- std::vector<unsigned int> *pFaceIDArray = new std::vector<unsigned int>;
- m_pModel->m_Groups[ &strGroupName ] = pFaceIDArray;
- m_pModel->m_pGroupFaceIDs = (pFaceIDArray);
- }
- else
- {
- m_pModel->m_pGroupFaceIDs = (*it).second;
- }
- m_pModel->m_strActiveGroup = strGroupName;
- }
- m_DataIt = skipLine<DataArrayIt>( m_DataIt, m_DataItEnd, m_uiLine );
-}
-
-// -------------------------------------------------------------------
-// Not supported
-void ObjFileParser::getGroupNumber()
-{
- // Not used
-
- m_DataIt = skipLine<DataArrayIt>( m_DataIt, m_DataItEnd, m_uiLine );
-}
-
-// -------------------------------------------------------------------
-// Stores values for a new object instance, name will be used to
-// identify it.
-void ObjFileParser::getObjectName()
-{
- m_DataIt = getNextToken<DataArrayIt>(m_DataIt, m_DataItEnd);
- if (m_DataIt == m_DataItEnd)
- return;
- char *pStart = &(*m_DataIt);
- while ( !isSeparator( *m_DataIt ) )
- ++m_DataIt;
-
- std::string strObjectName(pStart, &(*m_DataIt));
- if (!strObjectName.empty())
- {
- // Reset current object
- m_pModel->m_pCurrent = NULL;
-
- // Search for actual object
- for (std::vector<ObjFile::Object*>::const_iterator it = m_pModel->m_Objects.begin();
- it != m_pModel->m_Objects.end();
- ++it)
- {
- if ((*it)->m_strObjName == strObjectName)
- {
- m_pModel->m_pCurrent = *it;
- break;
- }
- }
-
- // Allocate a new object, if current one was not found before
- if ( NULL == m_pModel->m_pCurrent )
- createObject(strObjectName);
- }
- m_DataIt = skipLine<DataArrayIt>( m_DataIt, m_DataItEnd, m_uiLine );
-}
-// -------------------------------------------------------------------
-// Creates a new object instance
-void ObjFileParser::createObject(const std::string &strObjectName)
-{
- ai_assert( NULL != m_pModel );
- //ai_assert( !strObjectName.empty() );
-
- m_pModel->m_pCurrent = new ObjFile::Object;
- m_pModel->m_pCurrent->m_strObjName = strObjectName;
- m_pModel->m_Objects.push_back( m_pModel->m_pCurrent );
-
-
- createMesh();
-
- if ( m_pModel->m_pCurrentMaterial )
- {
- m_pModel->m_pCurrentMesh->m_uiMaterialIndex =
- getMaterialIndex( m_pModel->m_pCurrentMaterial->MaterialName.data );
- m_pModel->m_pCurrentMesh->m_pMaterial = m_pModel->m_pCurrentMaterial;
- }
-}
-// -------------------------------------------------------------------
-// Creates a new mesh
-void ObjFileParser::createMesh()
-{
- ai_assert( NULL != m_pModel );
- m_pModel->m_pCurrentMesh = new ObjFile::Mesh;
- m_pModel->m_Meshes.push_back( m_pModel->m_pCurrentMesh );
- unsigned int meshId = m_pModel->m_Meshes.size()-1;
- if ( NULL != m_pModel->m_pCurrent )
- {
- m_pModel->m_pCurrent->m_Meshes.push_back( meshId );
- }
- else
- {
- DefaultLogger::get()->error("OBJ: No object detected to attach a new mesh instance.");
- }
-}
-
-// -------------------------------------------------------------------
-// Returns true, if a new mesh must be created.
-bool ObjFileParser::needsNewMesh( const std::string &rMaterialName )
-{
- if (m_pModel->m_pCurrentMesh == 0)
- {
- // No mesh data yet
- return true;
- }
- bool newMat = false;
- int matIdx = getMaterialIndex( rMaterialName );
- unsigned int curMatIdx = m_pModel->m_pCurrentMesh->m_uiMaterialIndex;
- if ( curMatIdx != ObjFile::Mesh::NoMaterial || curMatIdx != (unsigned int)matIdx )
- {
- // New material -> only one material per mesh, so we need to create a new
- // material
- newMat = true;
- }
- return newMat;
-}
-
-// -------------------------------------------------------------------
-// Shows an error in parsing process.
-void ObjFileParser::reportErrorTokenInFace()
-{
- m_DataIt = skipLine<DataArrayIt>( m_DataIt, m_DataItEnd, m_uiLine );
- DefaultLogger::get()->error("OBJ: Not supported token in face description detected");
-}
-
-// -------------------------------------------------------------------
-
-} // Namespace Assimp
-
-#endif // !! ASSIMP_BUILD_NO_OBJ_IMPORTER
diff --git a/3rdparty/assimp/code/ObjFileParser.h b/3rdparty/assimp/code/ObjFileParser.h
deleted file mode 100644
index e972a9ad..00000000
--- a/3rdparty/assimp/code/ObjFileParser.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-
-#ifndef OBJ_FILEPARSER_H_INC
-#define OBJ_FILEPARSER_H_INC
-
-#include <vector>
-#include <string>
-#include <map>
-
-namespace Assimp
-{
-
-namespace ObjFile
-{
-struct Model;
-struct Object;
-struct Material;
-struct Point3;
-struct Point2;
-}
-class ObjFileImporter;
-class IOSystem;
-
-/// \class ObjFileParser
-/// \brief Parser for a obj waveform file
-class ObjFileParser
-{
-public:
- static const size_t BUFFERSIZE = 4096;
- typedef std::vector<char> DataArray;
- typedef std::vector<char>::iterator DataArrayIt;
- typedef std::vector<char>::const_iterator ConstDataArrayIt;
-
-public:
- /// \brief Constructor with data array.
- ObjFileParser(std::vector<char> &Data,const std::string &strModelName, IOSystem* io);
- /// \brief Destructor
- ~ObjFileParser();
- /// \brief Model getter.
- ObjFile::Model *GetModel() const;
-
-private:
- /// Parse the loadedfile
- void parseFile();
- /// Method to copy the new delimited word in the current line.
- void copyNextWord(char *pBuffer, size_t length);
- /// Method to copy the new line.
- void copyNextLine(char *pBuffer, size_t length);
- /// Stores the following 3d vector.
- void getVector3( std::vector<aiVector3D> &point3d_array );
- /// Stores the following 3d vector.
- void getVector2(std::vector<aiVector2D> &point2d_array);
- /// Stores the following face.
- void getFace();
- void getMaterialDesc();
- /// Gets a comment.
- void getComment();
- /// Gets a a material library.
- void getMaterialLib();
- /// Creates a new material.
- void getNewMaterial();
- /// Gets the groupname from file.
- void getGroupName();
- /// Gets the group number from file.
- void getGroupNumber();
- /// Returns the index of the material. Is -1 if not material was found.
- int getMaterialIndex( const std::string &strMaterialName );
- /// Parse object name
- void getObjectName();
- /// Creates a new object.
- void createObject(const std::string &strObjectName);
- /// Creates a new mesh.
- void createMesh();
- /// Returns true, if a new mesh instance must be created.
- bool needsNewMesh( const std::string &rMaterialName );
- /// Error report in token
- void reportErrorTokenInFace();
-
-private:
- /// Default material name
- static const std::string DEFAULT_MATERIAL;
- //! Iterator to current position in buffer
- DataArrayIt m_DataIt;
- //! Iterator to end position of buffer
- DataArrayIt m_DataItEnd;
- //! Pointer to model instance
- ObjFile::Model *m_pModel;
- //! Current line (for debugging)
- unsigned int m_uiLine;
- //! Helper buffer
- char m_buffer[BUFFERSIZE];
- /// Pointer to IO system instance.
- IOSystem *m_pIO;
-};
-
-} // Namespace Assimp
-
-#endif
diff --git a/3rdparty/assimp/code/ObjTools.h b/3rdparty/assimp/code/ObjTools.h
deleted file mode 100644
index 96c339e5..00000000
--- a/3rdparty/assimp/code/ObjTools.h
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file ObjTools.h
- * @brief Some helpful templates for text parsing
- */
-#ifndef OBJ_TOOLS_H_INC
-#define OBJ_TOOLS_H_INC
-
-#include "fast_atof.h"
-
-namespace Assimp
-{
-
-/** @brief Returns true, if the last entry of the buffer is reached.
- * @param it Iterator of current position.
- * @param end Iterator with end of buffer.
- * @return true, if the end of the buffer is reached.
- */
-template<class char_t>
-inline bool isEndOfBuffer( char_t it, char_t end )
-{
- if ( it == end )
- {
- return true;
- }
- else
- {
- end--;
- }
- return ( it == end );
-}
-
-/** @brief Returns true, if token is a space on any supported platform
-* @param token Token to search in
-* @return true, if token is a space
-*/
-inline bool isSeparator( char token )
-{
- return ( token == ' ' ||
- token == '\n' ||
- token == '\f' ||
- token == '\r' ||
- token == '\t' );
-}
-
-/** @brief Returns true, fi token id a new line marking token.
- * @param token Token to search in
- * @return true, if token is a newline token.
- */
-inline bool isNewLine( char token )
-{
- return ( token == '\n' || token == '\f' || token == '\r' );
-}
-
-/** @brief Returns next word separated by a space
- * @param pBuffer Pointer to data buffer
- * @param pEnd Pointer to end of buffer
- * @return Pointer to next space
- */
-template<class Char_T>
-inline Char_T getNextWord( Char_T pBuffer, Char_T pEnd )
-{
- while ( !isEndOfBuffer( pBuffer, pEnd ) )
- {
- if ( !isSeparator( *pBuffer ) || isNewLine( *pBuffer ) )
- break;
- pBuffer++;
- }
- return pBuffer;
-}
-
-/** @brief Returns ponter a next token
- * @param pBuffer Pointer to data buffer
- * @param pEnd Pointer to end of buffer
- * @return Pointer to next token
- */
-template<class Char_T>
-inline Char_T getNextToken( Char_T pBuffer, Char_T pEnd )
-{
- while ( !isEndOfBuffer( pBuffer, pEnd ) )
- {
- if ( isSeparator( *pBuffer ) )
- break;
- pBuffer++;
- }
- return getNextWord( pBuffer, pEnd );
-}
-
-/** @brief Skips a line
- * @param it Iterator set to current position
- * @param end Iterator set to end of scratch buffer for readout
- * @param uiLine Current linenumber in format
- * @return Current-iterator with new position
- */
-template<class char_t>
-inline char_t skipLine( char_t it, char_t end, unsigned int &uiLine )
-{
- while ( !isEndOfBuffer( it, end ) && !isNewLine( *it ) )
- ++it;
- if ( it != end )
- {
- ++it;
- ++uiLine;
- }
- // fix .. from time to time there are spaces at the beginning of a material line
- while ( it != end && (*it == '\t' || *it == ' ') )
- ++it;
- return it;
-}
-
-/** @brief Get a name, must be separated with a blank.
- * @param it set to current position
- * @param end set to end of scratch buffer for readout
- * @param name Separated name
- * @return Current-iterator with new position
- */
-template<class char_t>
-inline char_t getName( char_t it, char_t end, std::string &name )
-{
- name = "";
- it = getNextToken<char_t>( it, end );
- if ( isEndOfBuffer( it, end ) )
- return end;
-
- char *pStart = &( *it );
- while ( !isEndOfBuffer( it, end ) && !isSeparator( *it ) )
- ++it;
-
- // Get name
- std::string strName( pStart, &(*it) );
- if ( strName.empty() )
- return it;
- else
- name = strName;
-
- return it;
-}
-
-/** @brief Get next word from given line
- * @param it set to current position
- * @param end set to end of scratch buffer for readout
- * @param pBuffer Buffer for next word
- * @param length Buffer length
- * @return Current-iterator with new position
- */
-template<class char_t>
-inline char_t CopyNextWord( char_t it, char_t end, char *pBuffer, size_t length )
-{
- size_t index = 0;
- it = getNextWord<char_t>( it, end );
- while ( !isSeparator( *it ) && !isEndOfBuffer( it, end ) )
- {
- pBuffer[index] = *it ;
- index++;
- if (index == length-1)
- break;
- ++it;
- }
- pBuffer[ index ] = '\0';
- return it;
-}
-
-/** @brief Get next float from given line
- * @param it set to current position
- * @param end set to end of scratch buffer for readout
- * @param value Separated float value.
- * @return Current-iterator with new position
- */
-template<class char_t>
-inline char_t getFloat( char_t it, char_t end, float &value )
-{
- static const size_t BUFFERSIZE = 1024;
- char buffer[ BUFFERSIZE ];
- it = CopyNextWord<char_t>( it, end, buffer, BUFFERSIZE );
- value = (float) fast_atof( buffer );
-
- return it;
-}
-
-} // Namespace Assimp
-
-#endif
diff --git a/3rdparty/assimp/code/OgreImporter.cpp b/3rdparty/assimp/code/OgreImporter.cpp
deleted file mode 100644
index 9981b563..00000000
--- a/3rdparty/assimp/code/OgreImporter.cpp
+++ /dev/null
@@ -1,876 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file OgreImporter.cpp
- * @brief Implementation of the Ogre XML (.mesh.xml) loader.
- */
-#include "AssimpPCH.h"
-#ifndef ASSIMP_BUILD_NO_OGRE_IMPORTER
-
-#include <vector>
-#include <sstream>
-using namespace std;
-
-//#include "boost/format.hpp"
-//#include "boost/foreach.hpp"
-//using namespace boost;
-
-#include "TinyFormatter.h"
-
-#include "OgreImporter.h"
-#include "irrXMLWrapper.h"
-
-
-namespace Assimp
-{
-namespace Ogre
-{
-
-
-bool OgreImporter::CanRead(const std::string &pFile, Assimp::IOSystem *pIOHandler, bool checkSig) const
-{
- if (!checkSig)//Check File Extension
- {
- std::string extension("mesh.xml");
- int l=extension.length();
- return pFile.substr(pFile.length()-l, l)==extension;
- }
- else//Check file Header
- {
- const char* tokens[] = {"<mesh>"};
- return BaseImporter::SearchFileHeaderForToken(pIOHandler, pFile, tokens, 1);
- }
-}
-
-
-
-void OgreImporter::InternReadFile(const std::string &pFile, aiScene *pScene, Assimp::IOSystem *pIOHandler)
-{
- m_CurrentFilename=pFile;
- m_CurrentIOHandler=pIOHandler;
- m_CurrentScene=pScene;
-
- //Open the File:
- boost::scoped_ptr<IOStream> file(pIOHandler->Open(pFile));
- if ( file.get() == NULL)
- throw DeadlyImportError("Failed to open file "+pFile+".");
-
- //Read the Mesh File:
- boost::scoped_ptr<CIrrXML_IOStreamReader> mIOWrapper( new CIrrXML_IOStreamReader( file.get()));
- XmlReader* MeshFile = irr::io::createIrrXMLReader(mIOWrapper.get());
- if (!MeshFile)//parse the xml file
- throw DeadlyImportError("Failed to create XML Reader for "+pFile);
-
-
- DefaultLogger::get()->debug("Mesh File opened");
-
- //Read root Node:
- if (!(XmlRead(MeshFile) && string(MeshFile->getNodeName())=="mesh"))
- {
- throw DeadlyImportError("Root Node is not <mesh>! "+pFile+" "+MeshFile->getNodeName());
- }
-
- //Go to the submeshs:
- if (!(XmlRead(MeshFile) && string(MeshFile->getNodeName())=="submeshes"))
- {
- throw DeadlyImportError("No <submeshes> node in <mesh> node! "+pFile);
- }
-
-
- //-------------------Read the submeshs and materials:-----------------------
- std::list<boost::shared_ptr<SubMesh> > SubMeshes;
- vector<aiMaterial*> Materials;
- XmlRead(MeshFile);
- while (MeshFile->getNodeName()==string("submesh"))
- {
- SubMesh* theSubMesh=new SubMesh();
- theSubMesh->MaterialName=GetAttribute<string>(MeshFile, "material");
- DefaultLogger::get()->debug("Loading Submehs with Material: "+theSubMesh->MaterialName);
- ReadSubMesh(*theSubMesh, MeshFile);
-
- //just a index in a array, we add a mesh in each loop cycle, so we get indicies like 0, 1, 2 ... n;
- //so it is important to do this before pushing the mesh in the vector!
- theSubMesh->MaterialIndex=SubMeshes.size();
-
- SubMeshes.push_back(boost::shared_ptr<SubMesh>(theSubMesh));
-
- //Load the Material:
- aiMaterial* MeshMat=LoadMaterial(theSubMesh->MaterialName);
-
- //Set the Material:
- Materials.push_back(MeshMat);
- }
-
- if (SubMeshes.empty())
- throw DeadlyImportError("no submesh loaded!");
- if (SubMeshes.size()!=Materials.size())
- throw DeadlyImportError("materialcount doesn't match mesh count!");
-
- //____________________________________________________________
-
-
- //----------------Load the skeleton: -------------------------------
- vector<Bone> Bones;
- vector<Animation> Animations;
- if (MeshFile->getNodeName()==string("skeletonlink"))
- {
- string SkeletonFile=GetAttribute<string>(MeshFile, "name");
- LoadSkeleton(SkeletonFile, Bones, Animations);
- }
- else
- {
- DefaultLogger::get()->warn("No skeleton file will be loaded");
- DefaultLogger::get()->warn(MeshFile->getNodeName());
- }
- //__________________________________________________________________
-
-
- //----------------- Now fill the Assimp scene ---------------------------
-
- //put the aiMaterials in the scene:
- m_CurrentScene->mMaterials=new aiMaterial*[Materials.size()];
- m_CurrentScene->mNumMaterials=Materials.size();
- for (unsigned int i=0; i<Materials.size(); ++i)
- m_CurrentScene->mMaterials[i]=Materials[i];
-
- //create the aiMehs...
- vector<aiMesh*> aiMeshes;
- BOOST_FOREACH(boost::shared_ptr<SubMesh> theSubMesh, SubMeshes)
- {
- aiMeshes.push_back(CreateAssimpSubMesh(*theSubMesh, Bones));
- }
- //... and put them in the scene:
- m_CurrentScene->mNumMeshes=aiMeshes.size();
- m_CurrentScene->mMeshes=new aiMesh*[aiMeshes.size()];
- memcpy(m_CurrentScene->mMeshes, &(aiMeshes[0]), sizeof(aiMeshes[0])*aiMeshes.size());
-
- //Create the root node
- m_CurrentScene->mRootNode=new aiNode("root");
-
- //link the meshs with the root node:
- m_CurrentScene->mRootNode->mMeshes=new unsigned int[SubMeshes.size()];
- m_CurrentScene->mRootNode->mNumMeshes=SubMeshes.size();
- for (unsigned int i=0; i<SubMeshes.size(); ++i)
- m_CurrentScene->mRootNode->mMeshes[i]=i;
-
-
-
- CreateAssimpSkeleton(Bones, Animations);
- PutAnimationsInScene(Bones, Animations);
- //___________________________________________________________
-}
-
-
-
-void OgreImporter::GetExtensionList(std::set<std::string>& extensions)
-{
- extensions.insert("mesh.xml");
-}
-
-
-void OgreImporter::SetupProperties(const Importer* pImp)
-{
- m_MaterialLibFilename=pImp->GetPropertyString(AI_CONFIG_IMPORT_OGRE_MATERIAL_FILE, "Scene.material");
-}
-
-void OgreImporter::ReadSubMesh(SubMesh &theSubMesh, XmlReader *Reader)
-{
- XmlRead(Reader);
- //TODO: maybe we have alsways just 1 faces and 1 geometry and always in this order. this loop will only work correct, when the order
- //of faces and geometry changed, and not if we have more than one of one
- while (Reader->getNodeName()==string("faces") || string(Reader->getNodeName())=="geometry" || Reader->getNodeName()==string("boneassignments"))
- {
- if (string(Reader->getNodeName())=="faces")//Read the face list
- {
- //some info logging:
- unsigned int NumFaces=GetAttribute<int>(Reader, "count");
- stringstream ss; ss <<"Submesh has " << NumFaces << " Faces.";
- DefaultLogger::get()->debug(ss.str());
-
- while (XmlRead(Reader) && Reader->getNodeName()==string("face"))
- {
- Face NewFace;
- NewFace.VertexIndices[0]=GetAttribute<int>(Reader, "v1");
- NewFace.VertexIndices[1]=GetAttribute<int>(Reader, "v2");
- NewFace.VertexIndices[2]=GetAttribute<int>(Reader, "v3");
- if (Reader->getAttributeValue("v4"))//this should be supported in the future
- {
- throw DeadlyImportError("Submesh has quads, only traingles are supported!");
- }
- theSubMesh.FaceList.push_back(NewFace);
- }
-
- }//end of faces
- else if (string(Reader->getNodeName())=="geometry")//Read the vertexdata
- {
- //some info logging:
- unsigned int NumVertices=GetAttribute<int>(Reader, "vertexcount");
- stringstream ss; ss<<"VertexCount: "<<NumVertices;
- DefaultLogger::get()->debug(ss.str());
-
- //General Informations about vertices
- XmlRead(Reader);
- if (!(Reader->getNodeName()==string("vertexbuffer")))
- {
- throw DeadlyImportError("vertexbuffer node is not first in geometry node!");
- }
- theSubMesh.HasPositions=GetAttribute<bool>(Reader, "positions");
- theSubMesh.HasNormals=GetAttribute<bool>(Reader, "normals");
- if (!Reader->getAttributeValue("texture_coords"))//we can have 1 or 0 uv channels, and if the mesh has no uvs, it also doesn't have the attribute
- theSubMesh.NumUvs=0;
- else
- theSubMesh.NumUvs=GetAttribute<int>(Reader, "texture_coords");
- if (theSubMesh.NumUvs>1)
- throw DeadlyImportError("too many texcoords (just 1 supported!)");
-
- //read all the vertices:
- XmlRead(Reader);
- while (Reader->getNodeName()==string("vertex"))
- {
- //read all vertex attributes:
-
- //Position
- if (theSubMesh.HasPositions)
- {
- XmlRead(Reader);
- aiVector3D NewPos;
- NewPos.x=GetAttribute<float>(Reader, "x");
- NewPos.y=GetAttribute<float>(Reader, "y");
- NewPos.z=GetAttribute<float>(Reader, "z");
- theSubMesh.Positions.push_back(NewPos);
- }
-
- //Normal
- if (theSubMesh.HasNormals)
- {
- XmlRead(Reader);
- aiVector3D NewNormal;
- NewNormal.x=GetAttribute<float>(Reader, "x");
- NewNormal.y=GetAttribute<float>(Reader, "y");
- NewNormal.z=GetAttribute<float>(Reader, "z");
- theSubMesh.Normals.push_back(NewNormal);
- }
-
- //Uv:
- if (1==theSubMesh.NumUvs)
- {
- XmlRead(Reader);
- aiVector3D NewUv;
- NewUv.x=GetAttribute<float>(Reader, "u");
- NewUv.y=GetAttribute<float>(Reader, "v")*(-1)+1;//flip the uv vertikal, blender exports them so!
- theSubMesh.Uvs.push_back(NewUv);
- }
- XmlRead(Reader);
- }
-
- }//end of "geometry
-
-
- else if (string(Reader->getNodeName())=="boneassignments")
- {
- theSubMesh.Weights.resize(theSubMesh.Positions.size());
- while (XmlRead(Reader) && Reader->getNodeName()==string("vertexboneassignment"))
- {
- Weight NewWeight;
- unsigned int VertexId=GetAttribute<int>(Reader, "vertexindex");
- NewWeight.BoneId=GetAttribute<int>(Reader, "boneindex");
- NewWeight.Value=GetAttribute<float>(Reader, "weight");
- theSubMesh.BonesUsed=max(theSubMesh.BonesUsed, NewWeight.BoneId+1);//calculate the number of bones used (this is the highest id +1 becuase bone ids start at 0)
-
- theSubMesh.Weights[VertexId].push_back(NewWeight);
-
- //XmlRead(Reader);//Once i had this line, and than i got only every second boneassignment, but my first test models had even boneassignment counts, so i thougt, everything would work. And yes, i HATE irrXML!!!
- }
-
- }//end of boneassignments
- }
- DefaultLogger::get()->debug((Formatter::format(),
- "Positionen: ",theSubMesh.Positions.size(),
- " Normale: ",theSubMesh.Normals.size(),
- " TexCoords: ",theSubMesh.Uvs.size()
- ));
- DefaultLogger::get()->warn(Reader->getNodeName());
-
-
-
- //---------------Make all Vertexes unique: (this is required by assimp)-----------------------
- vector<Face> UniqueFaceList(theSubMesh.FaceList.size());
- unsigned int UniqueVertexCount=theSubMesh.FaceList.size()*3;//*3 because each face consists of 3 vertexes, because we only support triangles^^
- vector<aiVector3D> UniquePositions(UniqueVertexCount);
- vector<aiVector3D> UniqueNormals(UniqueVertexCount);
- vector<aiVector3D> UniqueUvs(UniqueVertexCount);
- vector< vector<Weight> > UniqueWeights((theSubMesh.Weights.size() ? UniqueVertexCount : 0));
-
- for (unsigned int i=0; i<theSubMesh.FaceList.size(); ++i)
- {
- //We precalculate the index vlaues her, because we need them in all vertex attributes
- unsigned int Vertex1=theSubMesh.FaceList[i].VertexIndices[0];
- unsigned int Vertex2=theSubMesh.FaceList[i].VertexIndices[1];
- unsigned int Vertex3=theSubMesh.FaceList[i].VertexIndices[2];
-
- UniquePositions[3*i+0]=theSubMesh.Positions[Vertex1];
- UniquePositions[3*i+1]=theSubMesh.Positions[Vertex2];
- UniquePositions[3*i+2]=theSubMesh.Positions[Vertex3];
-
- UniqueNormals[3*i+0]=theSubMesh.Normals[Vertex1];
- UniqueNormals[3*i+1]=theSubMesh.Normals[Vertex2];
- UniqueNormals[3*i+2]=theSubMesh.Normals[Vertex3];
-
- if (1==theSubMesh.NumUvs)
- {
- UniqueUvs[3*i+0]=theSubMesh.Uvs[Vertex1];
- UniqueUvs[3*i+1]=theSubMesh.Uvs[Vertex2];
- UniqueUvs[3*i+2]=theSubMesh.Uvs[Vertex3];
- }
-
- if (theSubMesh.Weights.size()) {
- UniqueWeights[3*i+0]=theSubMesh.Weights[Vertex1];
- UniqueWeights[3*i+1]=theSubMesh.Weights[Vertex2];
- UniqueWeights[3*i+2]=theSubMesh.Weights[Vertex3];
- }
-
- //The indexvalues a just continuous numbers (0, 1, 2, 3, 4, 5, 6...)
- UniqueFaceList[i].VertexIndices[0]=3*i+0;
- UniqueFaceList[i].VertexIndices[1]=3*i+1;
- UniqueFaceList[i].VertexIndices[2]=3*i+2;
- }
- //_________________________________________________________________________________________
-
- //now we have the unique datas, but want them in the SubMesh, so we swap all the containers:
- theSubMesh.FaceList.swap(UniqueFaceList);
- theSubMesh.Positions.swap(UniquePositions);
- theSubMesh.Normals.swap(UniqueNormals);
- theSubMesh.Uvs.swap(UniqueUvs);
- theSubMesh.Weights.swap(UniqueWeights);
-
- //------------- normalize weights -----------------------------
- //The Blender exporter doesn't care about whether the sum of all boneweights for a single vertex equals 1 or not,
- //so we have to make this sure:
- for (unsigned int VertexId=0; VertexId<theSubMesh.Weights.size(); ++VertexId)//iterate over all vertices
- {
- float WeightSum=0.0f;
- for (unsigned int BoneId=0; BoneId<theSubMesh.Weights[VertexId].size(); ++BoneId)//iterate over all bones
- {
- WeightSum+=theSubMesh.Weights[VertexId][BoneId].Value;
- }
-
- //check if the sum is too far away from 1
- if (WeightSum<1.0f-0.05f || WeightSum>1.0f+0.05f)
- {
- //normalize all weights:
- for (unsigned int BoneId=0; BoneId<theSubMesh.Weights[VertexId].size(); ++BoneId)//iterate over all bones
- {
- theSubMesh.Weights[VertexId][BoneId].Value/=WeightSum;
- }
- }
- }
- //_________________________________________________________
-}
-
-
-aiMesh* OgreImporter::CreateAssimpSubMesh(const SubMesh& theSubMesh, const vector<Bone>& Bones) const
-{
- const aiScene* const m_CurrentScene=this->m_CurrentScene;//make sure, that we can access but not change the scene
-
- aiMesh* NewAiMesh=new aiMesh();
-
- //Positions
- NewAiMesh->mVertices=new aiVector3D[theSubMesh.Positions.size()];
- memcpy(NewAiMesh->mVertices, &theSubMesh.Positions[0], theSubMesh.Positions.size()*sizeof(aiVector3D));
- NewAiMesh->mNumVertices=theSubMesh.Positions.size();
-
- //Normals
- NewAiMesh->mNormals=new aiVector3D[theSubMesh.Normals.size()];
- memcpy(NewAiMesh->mNormals, &theSubMesh.Normals[0], theSubMesh.Normals.size()*sizeof(aiVector3D));
-
- //Uvs
- if (0!=theSubMesh.NumUvs)
- {
- NewAiMesh->mNumUVComponents[0]=2;
- NewAiMesh->mTextureCoords[0]= new aiVector3D[theSubMesh.Uvs.size()];
- memcpy(NewAiMesh->mTextureCoords[0], &theSubMesh.Uvs[0], theSubMesh.Uvs.size()*sizeof(aiVector3D));
- }
-
-
- //---------------------------------------- Bones --------------------------------------------
-
- //Copy the weights in in Bone-Vertices Struktur
- //(we have them in a Vertex-Bones Structur, this is much easier for making them unique, which is required by assimp
- vector< vector<aiVertexWeight> > aiWeights(theSubMesh.BonesUsed);//now the outer list are the bones, and the inner vector the vertices
- for (unsigned int VertexId=0; VertexId<theSubMesh.Weights.size(); ++VertexId)//iterate over all vertices
- {
- for (unsigned int BoneId=0; BoneId<theSubMesh.Weights[VertexId].size(); ++BoneId)//iterate over all bones
- {
- aiVertexWeight NewWeight;
- NewWeight.mVertexId=VertexId;//the current Vertex, we can't use the Id form the submehs weights, because they are bone id's
- NewWeight.mWeight=theSubMesh.Weights[VertexId][BoneId].Value;
- aiWeights[theSubMesh.Weights[VertexId][BoneId].BoneId].push_back(NewWeight);
- }
- }
-
-
-
- vector<aiBone*> aiBones;
- aiBones.reserve(theSubMesh.BonesUsed);//the vector might be smaller, because there might be empty bones (bones that are not attached to any vertex)
-
- //create all the bones and fill them with informations
- for (unsigned int i=0; i<theSubMesh.BonesUsed; ++i)
- {
- if (aiWeights[i].size()>0)
- {
- aiBone* NewBone=new aiBone();
- NewBone->mNumWeights=aiWeights[i].size();
- NewBone->mWeights=new aiVertexWeight[aiWeights[i].size()];
- memcpy(NewBone->mWeights, &(aiWeights[i][0]), sizeof(aiVertexWeight)*aiWeights[i].size());
- NewBone->mName=Bones[i].Name;//The bone list should be sorted after its id's, this was done in LoadSkeleton
- NewBone->mOffsetMatrix=Bones[i].BoneToWorldSpace;
-
- aiBones.push_back(NewBone);
- }
- }
- NewAiMesh->mNumBones=aiBones.size();
-
- // mBones must be NULL if mNumBones is non 0 or the validation fails.
- if (aiBones.size()) {
- NewAiMesh->mBones=new aiBone* [aiBones.size()];
- memcpy(NewAiMesh->mBones, &(aiBones[0]), aiBones.size()*sizeof(aiBone*));
- }
-
- //______________________________________________________________________________________________________
-
-
-
- //Faces
- NewAiMesh->mFaces=new aiFace[theSubMesh.FaceList.size()];
- for (unsigned int i=0; i<theSubMesh.FaceList.size(); ++i)
- {
- NewAiMesh->mFaces[i].mNumIndices=3;
- NewAiMesh->mFaces[i].mIndices=new unsigned int[3];
-
- NewAiMesh->mFaces[i].mIndices[0]=theSubMesh.FaceList[i].VertexIndices[0];
- NewAiMesh->mFaces[i].mIndices[1]=theSubMesh.FaceList[i].VertexIndices[1];
- NewAiMesh->mFaces[i].mIndices[2]=theSubMesh.FaceList[i].VertexIndices[2];
- }
- NewAiMesh->mNumFaces=theSubMesh.FaceList.size();
-
- //Link the material:
- NewAiMesh->mMaterialIndex=theSubMesh.MaterialIndex;//the index is set by the function who called ReadSubMesh
-
- return NewAiMesh;
-}
-
-
-void OgreImporter::LoadSkeleton(std::string FileName, vector<Bone> &Bones, vector<Animation> &Animations) const
-{
- const aiScene* const m_CurrentScene=this->m_CurrentScene;//make sure, that we can access but not change the scene
-
-
- //most likely the skeleton file will only end with .skeleton
- //But this is a xml reader, so we need: .skeleton.xml
- FileName+=".xml";
-
- DefaultLogger::get()->debug(string("Loading Skeleton: ")+FileName);
-
- //Open the File:
- boost::scoped_ptr<IOStream> File(m_CurrentIOHandler->Open(FileName));
- if (NULL==File.get())
- throw DeadlyImportError("Failed to open skeleton file "+FileName+".");
-
- //Read the Mesh File:
- boost::scoped_ptr<CIrrXML_IOStreamReader> mIOWrapper(new CIrrXML_IOStreamReader(File.get()));
- XmlReader* SkeletonFile = irr::io::createIrrXMLReader(mIOWrapper.get());
- if (!SkeletonFile)
- throw DeadlyImportError(string("Failed to create XML Reader for ")+FileName);
-
- //Quick note: Whoever read this should know this one thing: irrXml fucking sucks!!!
-
- XmlRead(SkeletonFile);
- if (string("skeleton")!=SkeletonFile->getNodeName())
- throw DeadlyImportError("No <skeleton> node in SkeletonFile: "+FileName);
-
-
-
- //------------------------------------load bones-----------------------------------------
- XmlRead(SkeletonFile);
- if (string("bones")!=SkeletonFile->getNodeName())
- throw DeadlyImportError("No bones node in skeleton "+FileName);
-
- XmlRead(SkeletonFile);
-
- while (string("bone")==SkeletonFile->getNodeName())
- {
- //TODO: Maybe we can have bone ids for the errrors, but normaly, they should never appear, so what....
-
- //read a new bone:
- Bone NewBone;
- NewBone.Id=GetAttribute<int>(SkeletonFile, "id");
- NewBone.Name=GetAttribute<string>(SkeletonFile, "name");
-
- //load the position:
- XmlRead(SkeletonFile);
- if (string("position")!=SkeletonFile->getNodeName())
- throw DeadlyImportError("Position is not first node in Bone!");
- NewBone.Position.x=GetAttribute<float>(SkeletonFile, "x");
- NewBone.Position.y=GetAttribute<float>(SkeletonFile, "y");
- NewBone.Position.z=GetAttribute<float>(SkeletonFile, "z");
-
- //Rotation:
- XmlRead(SkeletonFile);
- if (string("rotation")!=SkeletonFile->getNodeName())
- throw DeadlyImportError("Rotation is not the second node in Bone!");
- NewBone.RotationAngle=GetAttribute<float>(SkeletonFile, "angle");
- XmlRead(SkeletonFile);
- if (string("axis")!=SkeletonFile->getNodeName())
- throw DeadlyImportError("No axis specified for bone rotation!");
- NewBone.RotationAxis.x=GetAttribute<float>(SkeletonFile, "x");
- NewBone.RotationAxis.y=GetAttribute<float>(SkeletonFile, "y");
- NewBone.RotationAxis.z=GetAttribute<float>(SkeletonFile, "z");
-
- //append the newly loaded bone to the bone list
- Bones.push_back(NewBone);
-
- //Proceed to the next bone:
- XmlRead(SkeletonFile);
- }
- //The bones in the file a not neccesarly ordered by there id's so we do it now:
- std::sort(Bones.begin(), Bones.end());
-
- //now the id of each bone should be equal to its position in the vector:
- //so we do a simple check:
- {
- bool IdsOk=true;
- for (int i=0; i<static_cast<signed int>(Bones.size()); ++i)//i is signed, because all Id's are also signed!
- {
- if (Bones[i].Id!=i)
- IdsOk=false;
- }
- if (!IdsOk)
- throw DeadlyImportError("Bone Ids are not valid!"+FileName);
- }
- DefaultLogger::get()->debug((Formatter::format(),"Number of bones: ",Bones.size()));
- //________________________________________________________________________________
-
-
-
-
-
-
- //----------------------------load bonehierarchy--------------------------------
- if (string("bonehierarchy")!=SkeletonFile->getNodeName())
- throw DeadlyImportError("no bonehierarchy node in "+FileName);
-
- DefaultLogger::get()->debug("loading bonehierarchy...");
- XmlRead(SkeletonFile);
- while (string("boneparent")==SkeletonFile->getNodeName())
- {
- string Child, Parent;
- Child=GetAttribute<string>(SkeletonFile, "bone");
- Parent=GetAttribute<string>(SkeletonFile, "parent");
-
- unsigned int ChildId, ParentId;
- ChildId=find(Bones.begin(), Bones.end(), Child)->Id;
- ParentId=find(Bones.begin(), Bones.end(), Parent)->Id;
-
- Bones[ChildId].ParentId=ParentId;
- Bones[ParentId].Children.push_back(ChildId);
-
- XmlRead(SkeletonFile);//i once forget this line, which led to an endless loop, did i mentioned, that irrxml sucks??
- }
- //_____________________________________________________________________________
-
-
- //--------- Calculate the WorldToBoneSpace Matrix recursivly for all bones: ------------------
- BOOST_FOREACH(Bone theBone, Bones)
- {
- if (-1==theBone.ParentId) //the bone is a root bone
- {
- theBone.CalculateBoneToWorldSpaceMatrix(Bones);
- }
- }
- //_______________________________________________________________________
-
-
- //---------------------------load animations-----------------------------
- if (string("animations")==SkeletonFile->getNodeName())//animations are optional values
- {
- DefaultLogger::get()->debug("Loading Animations");
- XmlRead(SkeletonFile);
- while (string("animation")==SkeletonFile->getNodeName())
- {
- Animation NewAnimation;
- NewAnimation.Name=GetAttribute<string>(SkeletonFile, "name");
- NewAnimation.Length=GetAttribute<float>(SkeletonFile, "length");
-
- //Load all Tracks
- XmlRead(SkeletonFile);
- if (string("tracks")!=SkeletonFile->getNodeName())
- throw DeadlyImportError("no tracks node in animation");
- XmlRead(SkeletonFile);
- while (string("track")==SkeletonFile->getNodeName())
- {
- Track NewTrack;
- NewTrack.BoneName=GetAttribute<string>(SkeletonFile, "bone");
-
- //Load all keyframes;
- XmlRead(SkeletonFile);
- if (string("keyframes")!=SkeletonFile->getNodeName())
- throw DeadlyImportError("no keyframes node!");
- XmlRead(SkeletonFile);
- while (string("keyframe")==SkeletonFile->getNodeName())
- {
- Keyframe NewKeyframe;
- NewKeyframe.Time=GetAttribute<float>(SkeletonFile, "time");
-
- //Position:
- XmlRead(SkeletonFile);
- if (string("translate")!=SkeletonFile->getNodeName())
- throw DeadlyImportError("translate node not first in keyframe");
- NewKeyframe.Position.x=GetAttribute<float>(SkeletonFile, "x");
- NewKeyframe.Position.y=GetAttribute<float>(SkeletonFile, "y");
- NewKeyframe.Position.z=GetAttribute<float>(SkeletonFile, "z");
-
- //Rotation:
- XmlRead(SkeletonFile);
- if (string("rotate")!=SkeletonFile->getNodeName())
- throw DeadlyImportError("rotate is not second node in keyframe");
- float RotationAngle=GetAttribute<float>(SkeletonFile, "angle");
- aiVector3D RotationAxis;
- XmlRead(SkeletonFile);
- if (string("axis")!=SkeletonFile->getNodeName())
- throw DeadlyImportError("No axis for keyframe rotation!");
- RotationAxis.x=GetAttribute<float>(SkeletonFile, "x");
- RotationAxis.y=GetAttribute<float>(SkeletonFile, "y");
- RotationAxis.z=GetAttribute<float>(SkeletonFile, "z");
- NewKeyframe.Rotation=aiQuaternion(RotationAxis, RotationAngle);
-
- //Scaling:
- XmlRead(SkeletonFile);
- if (string("scale")!=SkeletonFile->getNodeName())
- throw DeadlyImportError("no scalling key in keyframe!");
- NewKeyframe.Scaling.x=GetAttribute<float>(SkeletonFile, "x");
- NewKeyframe.Scaling.y=GetAttribute<float>(SkeletonFile, "y");
- NewKeyframe.Scaling.z=GetAttribute<float>(SkeletonFile, "z");
-
-
- NewTrack.Keyframes.push_back(NewKeyframe);
- XmlRead(SkeletonFile);
- }
-
-
- NewAnimation.Tracks.push_back(NewTrack);
- }
-
- Animations.push_back(NewAnimation);
- }
- }
- //_____________________________________________________________________________
-
-}
-
-
-void OgreImporter::CreateAssimpSkeleton(const std::vector<Bone> &Bones, const std::vector<Animation> &Animations)
-{
- if (!m_CurrentScene->mRootNode)
- throw DeadlyImportError("No root node exists!!");
- if (0!=m_CurrentScene->mRootNode->mNumChildren)
- throw DeadlyImportError("Root Node already has childnodes!");
-
-
- //Createt the assimp bone hierarchy
- DefaultLogger::get()->debug("Root Bones");
- vector<aiNode*> RootBoneNodes;
- BOOST_FOREACH(Bone theBone, Bones)
- {
- if (-1==theBone.ParentId) //the bone is a root bone
- {
- DefaultLogger::get()->debug(theBone.Name);
- RootBoneNodes.push_back(CreateAiNodeFromBone(theBone.Id, Bones, m_CurrentScene->mRootNode));//which will recursily add all other nodes
- }
- }
-
- if (RootBoneNodes.size()) {
- m_CurrentScene->mRootNode->mNumChildren=RootBoneNodes.size();
- m_CurrentScene->mRootNode->mChildren=new aiNode*[RootBoneNodes.size()];
- memcpy(m_CurrentScene->mRootNode->mChildren, &RootBoneNodes[0], sizeof(aiNode*)*RootBoneNodes.size());
- }
-}
-
-
-void OgreImporter::PutAnimationsInScene(const std::vector<Bone> &Bones, const std::vector<Animation> &Animations)
-{
- //-----------------Create the Assimp Animations --------------------
- if (Animations.size()>0)//Maybe the model had only a skeleton and no animations. (If it also has no skeleton, this function would'nt have been called
- {
- m_CurrentScene->mNumAnimations=Animations.size();
- m_CurrentScene->mAnimations=new aiAnimation*[Animations.size()];
- for (unsigned int i=0; i<Animations.size(); ++i)//create all animations
- {
- aiAnimation* NewAnimation=new aiAnimation();
- NewAnimation->mName=Animations[i].Name;
- NewAnimation->mDuration=Animations[i].Length;
- NewAnimation->mTicksPerSecond=1.0f;
-
- //Create all tracks in this animation
- NewAnimation->mNumChannels=Animations[i].Tracks.size();
- NewAnimation->mChannels=new aiNodeAnim*[Animations[i].Tracks.size()];
- for (unsigned int j=0; j<Animations[i].Tracks.size(); ++j)
- {
- aiNodeAnim* NewNodeAnim=new aiNodeAnim();
- NewNodeAnim->mNodeName=Animations[i].Tracks[j].BoneName;
-
- //we need this, to acces the bones default pose, which we need to make keys absolute
- vector<Bone>::const_iterator CurBone=find(Bones.begin(), Bones.end(), NewNodeAnim->mNodeName);
- aiMatrix4x4 t0, t1;
- aiMatrix4x4 DefBonePose=//The default bone pose doesnt have a scaling value
- aiMatrix4x4::Rotation(CurBone->RotationAngle, CurBone->RotationAxis, t0)
- * aiMatrix4x4::Translation(CurBone->Position, t1);
-
- //Create the keyframe arrays...
- unsigned int KeyframeCount=Animations[i].Tracks[j].Keyframes.size();
- NewNodeAnim->mNumPositionKeys=KeyframeCount;
- NewNodeAnim->mPositionKeys=new aiVectorKey[KeyframeCount];
- NewNodeAnim->mNumRotationKeys=KeyframeCount;
- NewNodeAnim->mRotationKeys=new aiQuatKey[KeyframeCount];
- NewNodeAnim->mNumScalingKeys=KeyframeCount;
- NewNodeAnim->mScalingKeys=new aiVectorKey[KeyframeCount];
-
- //...and fill them
- for (unsigned int k=0; k<KeyframeCount; ++k)
- {
- aiMatrix4x4 t2, t3;
-
- //Create a matrix to transfrom a vector from the bones default pose to the bone bones in this animation key
- aiMatrix4x4 PoseToKey=aiMatrix4x4::Scaling(Animations[i].Tracks[j].Keyframes[k].Scaling, t2) //scale
- * aiMatrix4x4(Animations[i].Tracks[j].Keyframes[k].Rotation.GetMatrix()) //rot
- * aiMatrix4x4::Translation(Animations[i].Tracks[j].Keyframes[k].Position, t3); //pos
-
-
- //calculate the complete transformation from world space to bone space
- aiMatrix4x4 CompleteTransform=DefBonePose * PoseToKey;
-
- aiVector3D Pos;
- aiQuaternion Rot;
- aiVector3D Scale;
-
- CompleteTransform.Decompose(Scale, Rot, Pos);
-
-
- NewNodeAnim->mPositionKeys[k].mTime=Animations[i].Tracks[j].Keyframes[k].Time;
- NewNodeAnim->mPositionKeys[k].mValue=Pos;
-
- NewNodeAnim->mRotationKeys[k].mTime=Animations[i].Tracks[j].Keyframes[k].Time;
- NewNodeAnim->mRotationKeys[k].mValue=Rot;
-
- NewNodeAnim->mScalingKeys[k].mTime=Animations[i].Tracks[j].Keyframes[k].Time;
- NewNodeAnim->mScalingKeys[k].mValue=Scale;
- }
-
- NewAnimation->mChannels[j]=NewNodeAnim;
- }
-
- m_CurrentScene->mAnimations[i]=NewAnimation;
- }
- }
-//TODO: Auf nicht vorhandene Animationskeys achten!
-//#pragma warning (s.o.)
- //__________________________________________________________________
-}
-
-
-
-aiNode* OgreImporter::CreateAiNodeFromBone(int BoneId, const std::vector<Bone> &Bones, aiNode* ParentNode) const
-{
- const aiScene* const m_CurrentScene=this->m_CurrentScene;//make sure, that we can access but not change the scene
-
- //----Create the node for this bone and set its values-----
- aiNode* NewNode=new aiNode(Bones[BoneId].Name);
- NewNode->mParent=ParentNode;
-
- aiMatrix4x4 t0,t1;
- //create a matrix from the transformation values of the ogre bone
- NewNode->mTransformation=aiMatrix4x4::Rotation(Bones[BoneId].RotationAngle, Bones[BoneId].RotationAxis, t1)
- * aiMatrix4x4::Translation(Bones[BoneId].Position, t0)
-
- ;
- //__________________________________________________________
-
-
- //---------- recursivly create all children Nodes: ----------
- NewNode->mNumChildren=Bones[BoneId].Children.size();
- NewNode->mChildren=new aiNode*[Bones[BoneId].Children.size()];
- for (unsigned int i=0; i<Bones[BoneId].Children.size(); ++i)
- {
- NewNode->mChildren[i]=CreateAiNodeFromBone(Bones[BoneId].Children[i], Bones, NewNode);
- }
- //____________________________________________________
-
-
- return NewNode;
-}
-
-
-void Bone::CalculateBoneToWorldSpaceMatrix(vector<Bone> &Bones)
-{
- //Calculate the matrix for this bone:
-
- aiMatrix4x4 t0,t1;
- aiMatrix4x4 Transf=aiMatrix4x4::Translation(-Position, t0)
- * aiMatrix4x4::Rotation(-RotationAngle, RotationAxis, t1)
- ;
- if (-1==ParentId)
- {
- BoneToWorldSpace=Transf;
- }
- else
- {
- BoneToWorldSpace=Transf*Bones[ParentId].BoneToWorldSpace;
- }
-
- //and recursivly for all children:
- BOOST_FOREACH(int theChildren, Children)
- {
- Bones[theChildren].CalculateBoneToWorldSpaceMatrix(Bones);
- }
-}
-
-}//namespace Ogre
-}//namespace Assimp
-
-#endif // !! ASSIMP_BUILD_NO_OGRE_IMPORTER
diff --git a/3rdparty/assimp/code/OgreImporter.h b/3rdparty/assimp/code/OgreImporter.h
deleted file mode 100644
index ee574726..00000000
--- a/3rdparty/assimp/code/OgreImporter.h
+++ /dev/null
@@ -1,142 +0,0 @@
-#include "BaseImporter.h"
-
-#include <vector>
-
-#include "OgreXmlHelper.h"
-#include "irrXMLWrapper.h"
-
-namespace Assimp
-{
-namespace Ogre
-{
-
-
-//Forward declarations:
-struct SubMesh;
-
-///For the moment just triangles, no other polygon types!
-struct Face
-{
- unsigned int VertexIndices[3];
-};
-
-///for a vertex->bone structur
-struct Weight
-{
- unsigned int BoneId;
- float Value;
-};
-
-/// Helper Class to describe an ogre-bone for the skeleton:
-/** All Id's are signed ints, because than we have -1 as a simple INVALID_ID Value (we start from 0 so 0 is a valid bone ID!*/
-struct Bone
-{
- int Id;
- int ParentId;
- std::string Name;
- aiVector3D Position;
- float RotationAngle;
- aiVector3D RotationAxis;
- std::vector<int> Children;
- aiMatrix4x4 BoneToWorldSpace;
-
- ///ctor
- Bone(): Id(-1), ParentId(-1), RotationAngle(0.0f) {}
- ///this operator is needed to sort the bones after Id's
- bool operator<(const Bone& rval) const
- {return Id<rval.Id; }
- ///this operator is needed to find a bone by its name in a vector<Bone>
- bool operator==(const std::string& rval) const
- {return Name==rval; }
- bool operator==(const aiString& rval) const
- {return Name==std::string(rval.data); }
-
- void CalculateBoneToWorldSpaceMatrix(std::vector<Bone>& Bones);
-
-};
-
-/// keyframe (bone transformation) from a track from a animation
-struct Keyframe
-{
- float Time;
- aiVector3D Position;
- aiQuaternion Rotation;
- aiVector3D Scaling;
-};
-
-///a track (keyframes for one bone) from an animation
-struct Track
-{
- std::string BoneName;
- std::vector<Keyframe> Keyframes;
-};
-
-///Describes an Ogre Animation
-struct Animation
-{
- std::string Name;
- float Length;
- std::vector<Track> Tracks;
-};
-
-///The Main Ogre Importer Class
-class OgreImporter : public BaseImporter
-{
-public:
- virtual bool CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const;
- virtual void InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler);
- virtual void GetExtensionList(std::set<std::string>& extensions);
- virtual void SetupProperties(const Importer* pImp);
-private:
-
- /// Helper Functions to read parts of the XML File
- void ReadSubMesh(SubMesh& theSubMesh, XmlReader* Reader);//the submesh reference is the result value
-
- /// writes the results in Bones and Animations, Filename is not const, because its call-by-value and the function will change it!
- void LoadSkeleton(std::string FileName, std::vector<Bone> &Bones, std::vector<Animation> &Animations) const;
-
- /// converts the animations in aiAnimations and puts them into the scene
- void PutAnimationsInScene(const std::vector<Bone> &Bones, const std::vector<Animation> &Animations);
-
- /// uses the bone data to convert a SubMesh into a aiMesh which will be created and returned
- aiMesh* CreateAssimpSubMesh(const SubMesh &theSubMesh, const std::vector<Bone>& Bones) const;
-
- //creates the aiskeleton in current scene
- void CreateAssimpSkeleton(const std::vector<Bone> &Bones, const std::vector<Animation> &Animations);
-
- aiMaterial* LoadMaterial(const std::string MaterialName) const;
-
- ///Recursivly creates a filled aiNode from a given root bone
- aiNode* CreateAiNodeFromBone(int BoneId, const std::vector<Bone> &Bones, aiNode* ParentNode) const;
-
- //Now we don't have to give theses parameters to all functions
- std::string m_CurrentFilename;
- std::string m_MaterialLibFilename;
- IOSystem* m_CurrentIOHandler;
- aiScene *m_CurrentScene;
-};
-
-///A submesh from Ogre
-struct SubMesh
-{
- std::string Name;
- std::string MaterialName;
- std::vector<Face> FaceList;
- std::vector<aiVector3D> Positions; bool HasPositions;
- std::vector<aiVector3D> Normals; bool HasNormals;
- std::vector<aiVector3D> Uvs; unsigned int NumUvs;//nearly always 2d, but assimp has always 3d texcoords
- std::vector< std::vector<Weight> > Weights;//a list of bones for each vertex
- int MaterialIndex;///< The Index in the Assimp Materialarray from the material witch is attached to this submesh
- unsigned int BonesUsed;//the highest index of a bone from a bone weight, this is needed to create the assimp bone structur (converting from Vertex-Bones to Bone-Vertices)
-
- SubMesh(): HasPositions(false), HasNormals(false), NumUvs(0), MaterialIndex(-1), BonesUsed(0) {}//initialize everything
-};
-
-struct BoneAssignment
-{
- unsigned int BoneId;//this is, what we get from ogre
- std::string BoneName;//this is, what we need for assimp
-};
-
-}//namespace Ogre
-}//namespace Assimp
diff --git a/3rdparty/assimp/code/OgreImporterMaterial.cpp b/3rdparty/assimp/code/OgreImporterMaterial.cpp
deleted file mode 100644
index 02f18a7a..00000000
--- a/3rdparty/assimp/code/OgreImporterMaterial.cpp
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/**
-This file contains material related code. This is
-spilitted up from the main file OgreImporter.cpp
-to make it shorter easier to maintain.
-*/
-#include "AssimpPCH.h"
-
-#ifndef ASSIMP_BUILD_NO_OGRE_IMPORTER
-
-#include <vector>
-#include <sstream>
-using namespace std;
-
-//#include "boost/format.hpp"
-//#include "boost/foreach.hpp"
-//using namespace boost;
-
-#include "OgreImporter.h"
-#include "irrXMLWrapper.h"
-#include "TinyFormatter.h"
-
-namespace Assimp
-{
-namespace Ogre
-{
-
-
-
-aiMaterial* OgreImporter::LoadMaterial(const std::string MaterialName) const
-{
- const aiScene* const m_CurrentScene=this->m_CurrentScene;//make sure, that we can access but not change the scene
-
- MaterialHelper *NewMaterial=new MaterialHelper();
-
- aiString ts(MaterialName.c_str());
- NewMaterial->AddProperty(&ts, AI_MATKEY_NAME);
- /*For bettetr understanding of the material parser, here is a material example file:
-
- material Sarg
- {
- receive_shadows on
- technique
- {
- pass
- {
- ambient 0.500000 0.500000 0.500000 1.000000
- diffuse 0.640000 0.640000 0.640000 1.000000
- specular 0.500000 0.500000 0.500000 1.000000 12.500000
- emissive 0.000000 0.000000 0.000000 1.000000
- texture_unit
- {
- texture SargTextur.tga
- tex_address_mode wrap
- filtering linear linear none
- }
- }
- }
- }
-
- */
-
-
- const string MaterialFileName=m_CurrentFilename.substr(0, m_CurrentFilename.find('.'))+".material";
- DefaultLogger::get()->info("Trying to load " +MaterialFileName);
-
- //Read the file into memory and put it in a stringstream
- stringstream ss;
- {// after this block, the temporarly loaded data will be released
- IOStream* MatFilePtr=m_CurrentIOHandler->Open(MaterialFileName);
- if (NULL==MatFilePtr)
- {
- MatFilePtr=m_CurrentIOHandler->Open(m_MaterialLibFilename);
- if (NULL==MatFilePtr)
- {
- DefaultLogger::get()->error(m_MaterialLibFilename+" and "+MaterialFileName + " could not be opened, Material will not be loaded!");
- return NewMaterial;
- }
- }
- boost::scoped_ptr<IOStream> MaterialFile(MatFilePtr);
- vector<char> FileData(MaterialFile->FileSize());
- MaterialFile->Read(&FileData[0], MaterialFile->FileSize(), 1);
- BaseImporter::ConvertToUTF8(FileData);
-
- ss << &FileData[0];
- }
-
- string Line;
- ss >> Line;
-// unsigned int Level=0;//Hierarchielevels in the material file, like { } blocks into another
- while (!ss.eof())
- {
- if (Line=="material")
- {
- ss >> Line;
- if (Line==MaterialName)//Load the next material
- {
- ss >> Line;
- if (Line!="{")
- throw DeadlyImportError("empty material!");
-
- while (Line!="}")//read until the end of the material
- {
- //Proceed to the first technique
- ss >> Line;
- if (Line=="technique")
- {
- ss >> Line;
- if (Line!="{")
- throw DeadlyImportError("empty technique!");
- while (Line!="}")//read until the end of the technique
- {
- ss >> Line;
- if (Line=="pass")
- {
- ss >> Line;
- if (Line!="{")
- throw DeadlyImportError("empty pass!");
- while (Line!="}")//read until the end of the pass
- {
- ss >> Line;
- if (Line=="ambient")
- {
- float r,g,b;
- ss >> r >> g >> b;
- const aiColor3D Color(r,g,b);
- NewMaterial->AddProperty(&Color, 1, AI_MATKEY_COLOR_AMBIENT);
- }
- else if (Line=="diffuse")
- {
- float r,g,b;
- ss >> r >> g >> b;
- const aiColor3D Color(r,g,b);
- NewMaterial->AddProperty(&Color, 1, AI_MATKEY_COLOR_DIFFUSE);
- }
- else if (Line=="specular")
- {
- float r,g,b;
- ss >> r >> g >> b;
- const aiColor3D Color(r,g,b);
- NewMaterial->AddProperty(&Color, 1, AI_MATKEY_COLOR_SPECULAR);
- }
- else if (Line=="emmisive")
- {
- float r,g,b;
- ss >> r >> g >> b;
- const aiColor3D Color(r,g,b);
- NewMaterial->AddProperty(&Color, 1, AI_MATKEY_COLOR_EMISSIVE);
- }
- else if (Line=="texture_unit")
- {
- ss >> Line;
- if (Line!="{")
- throw DeadlyImportError("empty texture unit!");
- while (Line!="}")//read until the end of the texture_unit
- {
- ss >> Line;
- if (Line=="texture")
- {
- ss >> Line;
- aiString ts(Line.c_str());
- NewMaterial->AddProperty(&ts, AI_MATKEY_TEXTURE(aiTextureType_DIFFUSE, 0));
- }
- }//end of texture unit
- }
- }
- }
- }//end of technique
-
-
- }
-
-
- DefaultLogger::get()->info(Line);
- //read informations from a custom material:
- if (Line=="set")
- {
- ss >> Line;
- if (Line=="$specular")//todo load this values:
- {
- }
- if (Line=="$diffuse")
- {
- }
- if (Line=="$ambient")
- {
- }
- if (Line=="$colormap")
- {
- ss >> Line;
- aiString ts(Line.c_str());
- NewMaterial->AddProperty(&ts, AI_MATKEY_TEXTURE(aiTextureType_DIFFUSE, 0));
- }
- if (Line=="$normalmap")
- {
- ss >> Line;
- aiString ts(Line.c_str());
- NewMaterial->AddProperty(&ts, AI_MATKEY_TEXTURE(aiTextureType_NORMALS, 0));
- }
- }
- }//end of material
- }
- else {} //this is the wrong material, proceed the file until we reach the next material
- }
- ss >> Line;
- }
-
- return NewMaterial;
-}
-
-
-
-}//namespace Ogre
-}//namespace Assimp
-
-#endif // !! ASSIMP_BUILD_NO_OGRE_IMPORTER
diff --git a/3rdparty/assimp/code/OgreXmlHelper.h b/3rdparty/assimp/code/OgreXmlHelper.h
deleted file mode 100644
index be72deee..00000000
--- a/3rdparty/assimp/code/OgreXmlHelper.h
+++ /dev/null
@@ -1,79 +0,0 @@
-
-#include "irrXMLWrapper.h"
-#include "fast_atof.h"
-
-namespace Assimp
-{
-namespace Ogre
-{
-
-typedef irr::io::IrrXMLReader XmlReader;
-
-
-//------------Helper Funktion to Get a Attribute Save---------------
-template<typename t> inline t GetAttribute(XmlReader* Reader, std::string Name);
-
-/*
-{
- BOOST_STATIC_ASSERT(false);
- return t();
-}
-*/
-
-template<> inline int GetAttribute<int>(XmlReader* Reader, std::string Name)
-{
- const char* Value=Reader->getAttributeValue(Name.c_str());
- if (Value)
- return atoi(Value);
- else
- throw DeadlyImportError(std::string("Attribute "+Name+" does not exist in "+Reader->getNodeName()).c_str());
-}
-
-template<> inline float GetAttribute<float>(XmlReader* Reader, std::string Name)
-{
- const char* Value=Reader->getAttributeValue(Name.c_str());
- if (Value)
- return fast_atof(Value);
- else
- throw DeadlyImportError(std::string("Attribute "+Name+" does not exist in "+Reader->getNodeName()).c_str());
-}
-
-template<> inline std::string GetAttribute<std::string>(XmlReader* Reader, std::string Name)
-{
- const char* Value=Reader->getAttributeValue(Name.c_str());
- if (Value)
- return std::string(Value);
- else
- throw DeadlyImportError(std::string("Attribute "+Name+" does not exist in "+Reader->getNodeName()).c_str());
-}
-
-template<> inline bool GetAttribute<bool>(XmlReader* Reader, std::string Name)
-{
- const char* Value=Reader->getAttributeValue(Name.c_str());
- if (Value)
- {
- if (Value==std::string("true"))
- return true;
- else if (Value==std::string("false"))
- return false;
- else
- throw DeadlyImportError(std::string("Bool value has invalid value: "+Name+" / "+Value+" / "+Reader->getNodeName()));
- }
- else
- throw DeadlyImportError(std::string("Attribute "+Name+" does not exist in "+Reader->getNodeName()).c_str());
-}
-//__________________________________________________________________
-
-inline bool XmlRead(XmlReader* Reader)
-{
- do
- {
- if (!Reader->read())
- return false;
- }
- while (Reader->getNodeType()!=irr::io::EXN_ELEMENT);
- return true;
-}
-
-}//namespace Ogre
-}//namespace Assimp
diff --git a/3rdparty/assimp/code/OptimizeGraph.cpp b/3rdparty/assimp/code/OptimizeGraph.cpp
deleted file mode 100644
index 0529fedd..00000000
--- a/3rdparty/assimp/code/OptimizeGraph.cpp
+++ /dev/null
@@ -1,347 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file OptimizeGraph.cpp
- * @brief Implementation of the aiProcess_OptimizGraph step
- */
-
-#include "AssimpPCH.h"
-#ifndef ASSIMP_BUILD_NO_OPTIMIZEGRAPH_PROCESS
-
-using namespace Assimp;
-#include "OptimizeGraph.h"
-#include "ProcessHelper.h"
-#include "SceneCombiner.h"
-
-#define AI_RESERVED_NODE_NAME "$Reserved_And_Evil"
-
-/* AI_OG_USE_HASHING enables the use of hashing to speed-up std::set lookups.
- * The unhashed variant should be faster, except for *very* large data sets
- */
-#ifdef AI_OG_USE_HASHING
- // Use our standard hashing function to compute the hash
-# define AI_OG_GETKEY(str) SuperFastHash(str.data,str.length)
-#else
- // Otherwise hope that std::string will utilize a static buffer
- // for shorter node names. This would avoid endless heap copying.
-# define AI_OG_GETKEY(str) std::string(str.data)
-#endif
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-OptimizeGraphProcess::OptimizeGraphProcess()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-OptimizeGraphProcess::~OptimizeGraphProcess()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the processing step is present in the given flag field.
-bool OptimizeGraphProcess::IsActive( unsigned int pFlags) const
-{
- return (0 != (pFlags & aiProcess_OptimizeGraph));
-}
-
-// ------------------------------------------------------------------------------------------------
-// Setup properties for the postprocessing step
-void OptimizeGraphProcess::SetupProperties(const Importer* pImp)
-{
- // Get value of AI_CONFIG_PP_OG_EXCLUDE_LIST
- std::string tmp = pImp->GetPropertyString(AI_CONFIG_PP_OG_EXCLUDE_LIST,"");
- AddLockedNodeList(tmp);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Collect new children
-void OptimizeGraphProcess::CollectNewChildren(aiNode* nd, std::list<aiNode*>& nodes)
-{
- nodes_in += nd->mNumChildren;
-
- // Process children
- std::list<aiNode*> child_nodes;
- for (unsigned int i = 0; i < nd->mNumChildren; ++i) {
-
- CollectNewChildren(nd->mChildren[i],child_nodes);
- nd->mChildren[i] = NULL;
- }
-
- // Check whether we need this node; if not we can replace it by our own children (warn, danger of incest).
- if (locked.find(AI_OG_GETKEY(nd->mName)) == locked.end() ) {
- for (std::list<aiNode*>::iterator it = child_nodes.begin(); it != child_nodes.end();) {
-
- if (locked.find(AI_OG_GETKEY((*it)->mName)) == locked.end()) {
- (*it)->mTransformation = nd->mTransformation * (*it)->mTransformation;
- nodes.push_back(*it);
-
- it = child_nodes.erase(it);
- continue;
- }
- ++it;
- }
-
- if (nd->mNumMeshes || child_nodes.size()) {
- nodes.push_back(nd);
- }
- else {
- delete nd; /* bye, node */
- return;
- }
- }
- else {
-
- // Retain our current position in the hierarchy
- nodes.push_back(nd);
-
- // Now check for possible optimizations in our list of child nodes. join as many as possible
- aiNode* join_master = NULL;
- aiMatrix4x4 inv;
-
- const LockedSetType::const_iterator end = locked.end();
-
- std::list<aiNode*> join;
- for (std::list<aiNode*>::iterator it = child_nodes.begin(); it != child_nodes.end();) {
- aiNode* child = *it;
- if (child->mNumChildren == 0 && locked.find(AI_OG_GETKEY(child->mName)) == end) {
-
- // There may be no instanced meshes
- unsigned int n = 0;
- for (; n < child->mNumMeshes;++n) {
- if (meshes[child->mMeshes[n]] > 1) {
- break;
- }
- }
- if (n == child->mNumMeshes) {
-
- if (!join_master) {
- join_master = child;
- inv = join_master->mTransformation;
- inv.Inverse();
- }
- else {
-
- child->mTransformation = inv * child->mTransformation ;
-
- join.push_back(child);
- it = child_nodes.erase(it);
- continue;
- }
- }
- }
- ++it;
- }
- if (join_master && join.size()) {
- join_master->mName.length = sprintf(join_master->mName.data,"$MergedNode_%i",count_merged++);
-
- unsigned int out_meshes = 0;
- for (std::list<aiNode*>::iterator it = join.begin(); it != join.end(); ++it) {
- out_meshes += (*it)->mNumMeshes;
- }
-
- // copy all mesh references in one array
- if (out_meshes) {
- unsigned int* meshes = new unsigned int[out_meshes+join_master->mNumMeshes], *tmp = meshes;
- for (unsigned int n = 0; n < join_master->mNumMeshes;++n) {
- *tmp++ = join_master->mMeshes[n];
- }
-
- for (std::list<aiNode*>::iterator it = join.begin(); it != join.end(); ++it) {
- for (unsigned int n = 0; n < (*it)->mNumMeshes; ++n) {
-
- *tmp = (*it)->mMeshes[n];
- aiMesh* mesh = mScene->mMeshes[*tmp++];
-
- // manually move the mesh into the right coordinate system
- const aiMatrix3x3 IT = aiMatrix3x3( (*it)->mTransformation ).Inverse().Transpose();
- for (unsigned int a = 0; a < mesh->mNumVertices; ++a) {
-
- mesh->mVertices[a] *= (*it)->mTransformation;
-
- if (mesh->HasNormals())
- mesh->mNormals[a] *= IT;
-
- if (mesh->HasTangentsAndBitangents()) {
- mesh->mTangents[a] *= IT;
- mesh->mBitangents[a] *= IT;
- }
- }
- }
- delete *it; // bye, node
- }
- delete[] join_master->mMeshes;
- join_master->mMeshes = meshes;
- join_master->mNumMeshes += out_meshes;
- }
- }
- }
- // reassign children if something changed
- if (child_nodes.empty() || child_nodes.size() > nd->mNumChildren) {
-
- delete[] nd->mChildren;
-
- if (child_nodes.size())
- nd->mChildren = new aiNode*[child_nodes.size()];
- else nd->mChildren = NULL;
- }
-
- nd->mNumChildren = child_nodes.size();
-
- aiNode** tmp = nd->mChildren;
- for (std::list<aiNode*>::iterator it = child_nodes.begin(); it != child_nodes.end(); ++it) {
- aiNode* node = *tmp++ = *it;
- node->mParent = nd;
- }
-
- nodes_out += child_nodes.size();
-}
-
-// ------------------------------------------------------------------------------------------------
-// Execute the postprocessing step on the given scene
-void OptimizeGraphProcess::Execute( aiScene* pScene)
-{
- DefaultLogger::get()->debug("OptimizeGraphProcess begin");
- nodes_in = nodes_out = count_merged = 0;
- mScene = pScene;
-
- meshes.resize(pScene->mNumMeshes,0);
- FindInstancedMeshes(pScene->mRootNode);
-
- // build a blacklist of identifiers. If the name of a node matches one of these, we won't touch it
- locked.clear();
- for (std::list<std::string>::const_iterator it = locked_nodes.begin(); it != locked_nodes.end(); ++it) {
-#ifdef AI_OG_USE_HASHING
- locked.insert(SuperFastHash((*it).c_str()));
-#else
- locked.insert(*it);
-#endif
- }
-
- for (unsigned int i = 0; i < pScene->mNumAnimations; ++i) {
- for (unsigned int a = 0; a < pScene->mAnimations[i]->mNumChannels; ++a) {
-
- aiNodeAnim* anim = pScene->mAnimations[i]->mChannels[a];
- locked.insert(AI_OG_GETKEY(anim->mNodeName));
- }
- }
-
- for (unsigned int i = 0; i < pScene->mNumMeshes; ++i) {
- for (unsigned int a = 0; a < pScene->mMeshes[i]->mNumBones; ++a) {
-
- aiBone* bone = pScene->mMeshes[i]->mBones[a];
- locked.insert(AI_OG_GETKEY(bone->mName));
-
- // HACK: Meshes referencing bones may not be transformed; we need to look them.
- // The easiest way to do this is to increase their reference counters ...
- meshes[i] += 2;
- }
- }
-
- for (unsigned int i = 0; i < pScene->mNumCameras; ++i) {
- aiCamera* cam = pScene->mCameras[i];
- locked.insert(AI_OG_GETKEY(cam->mName));
- }
-
- for (unsigned int i = 0; i < pScene->mNumLights; ++i) {
- aiLight* lgh = pScene->mLights[i];
- locked.insert(AI_OG_GETKEY(lgh->mName));
- }
-
- // Insert a dummy master node and make it read-only
- aiNode* dummy_root = new aiNode(AI_RESERVED_NODE_NAME);
- locked.insert(AI_OG_GETKEY(dummy_root->mName));
-
- const aiString prev = pScene->mRootNode->mName;
- pScene->mRootNode->mParent = dummy_root;
-
- dummy_root->mChildren = new aiNode*[dummy_root->mNumChildren = 1];
- dummy_root->mChildren[0] = pScene->mRootNode;
-
- // Do our recursive processing of scenegraph nodes. For each node collect
- // a fully new list of children and allow their children to place themselves
- // on the same hierarchy layer as their parents.
- std::list<aiNode*> nodes;
- CollectNewChildren (dummy_root,nodes);
-
- ai_assert(nodes.size() == 1);
-
- if (dummy_root->mNumChildren > 1) {
- pScene->mRootNode = dummy_root;
-
- // Keep the dummy node but assign the name of the old root node to it
- pScene->mRootNode->mName = prev;
- }
- else {
-
- // Remove the dummy root node again.
- pScene->mRootNode = dummy_root->mChildren[0];
-
- dummy_root->mChildren[0] = NULL;
- delete dummy_root;
- }
-
- pScene->mRootNode->mParent = NULL;
- if (!DefaultLogger::isNullLogger()) {
- if ( nodes_in != nodes_out) {
-
- char buf[512];
- sprintf(buf,"OptimizeGraphProcess finished; Input nodes: %i, Output nodes: %i",nodes_in,nodes_out);
- DefaultLogger::get()->info(buf);
- }
- else DefaultLogger::get()->debug("OptimizeGraphProcess finished");
- }
- meshes.clear();
- locked.clear();
-}
-
-// ------------------------------------------------------------------------------------------------
-// Buidl a LUT of all instanced meshes
-void OptimizeGraphProcess::FindInstancedMeshes (aiNode* pNode)
-{
- for (unsigned int i = 0; i < pNode->mNumMeshes;++i) {
- ++meshes[pNode->mMeshes[i]];
- }
-
- for (unsigned int i = 0; i < pNode->mNumChildren; ++i)
- FindInstancedMeshes(pNode->mChildren[i]);
-}
-
-#endif // !! ASSIMP_BUILD_NO_OPTIMIZEGRAPH_PROCESS
diff --git a/3rdparty/assimp/code/OptimizeGraph.h b/3rdparty/assimp/code/OptimizeGraph.h
deleted file mode 100644
index c6d51dfe..00000000
--- a/3rdparty/assimp/code/OptimizeGraph.h
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file OptimizeGraph.h
- * @brief Declares a post processing step to optimize the scenegraph
- */
-#ifndef AI_OPTIMIZEGRAPHPROCESS_H_INC
-#define AI_OPTIMIZEGRAPHPROCESS_H_INC
-
-#include "BaseProcess.h"
-#include "ProcessHelper.h"
-#include "../include/aiTypes.h"
-
-struct aiMesh;
-class OptimizeGraphProcessTest;
-namespace Assimp {
-
-// -----------------------------------------------------------------------------
-/** @brief Postprocessing step to optimize the scenegraph
- *
- * The implementation tries to merge nodes, even if they use different
- * transformations. Animations are preserved.
- *
- * @see aiProcess_OptimizeGraph for a detailed description of the
- * algorithm being applied.
- */
-class ASSIMP_API OptimizeGraphProcess : public BaseProcess
-{
- friend class Importer;
- friend class ::OptimizeGraphProcessTest;
-
-protected:
- /** Constructor to be privately used by Importer */
- OptimizeGraphProcess();
-
- /** Destructor, private as well */
- ~OptimizeGraphProcess();
-
-public:
- // -------------------------------------------------------------------
- bool IsActive( unsigned int pFlags) const;
-
- // -------------------------------------------------------------------
- void Execute( aiScene* pScene);
-
- // -------------------------------------------------------------------
- void SetupProperties(const Importer* pImp);
-
-
- // -------------------------------------------------------------------
- /** @brief Add a list of node names to be locked and not modified.
- * @param in List of nodes. See #AI_CONFIG_PP_OG_EXCLUDE_LIST for
- * format explanations.
- */
- inline void AddLockedNodeList(std::string& in)
- {
- ConvertListToStrings (in,locked_nodes);
- }
-
- // -------------------------------------------------------------------
- /** @brief Add another node to be locked and not modified.
- * @param name Name to be locked
- */
- inline void AddLockedNode(std::string& name)
- {
- locked_nodes.push_back(name);
- }
-
- // -------------------------------------------------------------------
- /** @brief Rmeove a node from the list of locked nodes.
- * @param name Name to be unlocked
- */
- inline void RemoveLockedNode(std::string& name)
- {
- locked_nodes.remove(name);
- }
-
-protected:
-
- void CollectNewChildren(aiNode* nd, std::list<aiNode*>& nodes);
- void FindInstancedMeshes (aiNode* pNode);
-
-private:
-
-#ifdef AI_OG_USE_HASHING
- typedef std::set<unsigned int> LockedSetType;
-#else
- typedef std::set<std::string> LockedSetType;
-#endif
-
-
- //! Scene we're working with
- aiScene* mScene;
-
- //! List of locked names. Stored is the hash of the name
- LockedSetType locked;
-
- //! List of nodes to be locked in addition to those with animations, lights or cameras assigned.
- std::list<std::string> locked_nodes;
-
- //! Node counters for logging purposes
- unsigned int nodes_in,nodes_out, count_merged;
-
- //! Reference counters for meshes
- std::vector<unsigned int> meshes;
-};
-
-} // end of namespace Assimp
-
-#endif // AI_OPTIMIZEGRAPHPROCESS_H_INC
diff --git a/3rdparty/assimp/code/OptimizeMeshes.cpp b/3rdparty/assimp/code/OptimizeMeshes.cpp
deleted file mode 100644
index ca612739..00000000
--- a/3rdparty/assimp/code/OptimizeMeshes.cpp
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file OptimizeMeshes.cpp
- * @brief Implementation of the aiProcess_OptimizeMeshes step
- */
-
-#include "AssimpPCH.h"
-#ifndef ASSIMP_BUILD_NO_OPTIMIZEMESHES_PROCESS
-
-using namespace Assimp;
-#include "OptimizeMeshes.h"
-#include "ProcessHelper.h"
-#include "SceneCombiner.h"
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-OptimizeMeshesProcess::OptimizeMeshesProcess()
-: pts (false)
-, max_verts (0xffffffff)
-, max_faces (0xffffffff)
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-OptimizeMeshesProcess::~OptimizeMeshesProcess()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the processing step is present in the given flag field.
-bool OptimizeMeshesProcess::IsActive( unsigned int pFlags) const
-{
- // Our behaviour needs to be different if the SortByPType or SplitLargeMeshes
- // steps are active. Thus we need to query their flags here and store the
- // information, although we're breaking const-correctness.
- // That's a serious design flaw, consider redesign.
- if ( 0 != (pFlags & aiProcess_OptimizeMeshes) ) {
- pts = (0 != (pFlags & aiProcess_SortByPType));
- max_verts = (0 != (pFlags & aiProcess_SplitLargeMeshes)) ? 0xdeadbeef : 0;
- return true;
- }
- return false;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Setup properties for the postprocessing step
-void OptimizeMeshesProcess::SetupProperties(const Importer* pImp)
-{
- if (max_verts == 0xdeadbeef /* magic hack */) {
- max_faces = pImp->GetPropertyInteger(AI_CONFIG_PP_SLM_TRIANGLE_LIMIT,AI_SLM_DEFAULT_MAX_TRIANGLES);
- max_verts = pImp->GetPropertyInteger(AI_CONFIG_PP_SLM_VERTEX_LIMIT,AI_SLM_DEFAULT_MAX_VERTICES);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Execute step
-void OptimizeMeshesProcess::Execute( aiScene* pScene)
-{
- const unsigned int num_old = pScene->mNumMeshes;
- if (num_old <= 1) {
- DefaultLogger::get()->debug("Skipping OptimizeMeshesProcess");
- return;
- }
-
- DefaultLogger::get()->debug("OptimizeMeshesProcess begin");
- mScene = pScene;
-
- // need to clear persistent members from previous runs
- merge_list.clear();
- output.clear();
-
- merge_list.reserve(pScene->mNumMeshes);
- output.reserve(pScene->mNumMeshes);
-
- // Prepare lookup tables
- meshes.resize(pScene->mNumMeshes);
- FindInstancedMeshes(pScene->mRootNode);
- if (max_verts == 0xdeadbeef) /* undo the magic hack */
- max_verts = 0xffffffff;
-
- // ... instanced meshes are immediately processed and added to the output list
- for (unsigned int i = 0, n = 0; i < pScene->mNumMeshes;++i) {
- meshes[i].vertex_format = GetMeshVFormatUnique(pScene->mMeshes[i]);
-
- if (meshes[i].instance_cnt > 1 && meshes[i].output_id == 0xffffffff) {
- meshes[i].output_id = n++;
- output.push_back(mScene->mMeshes[i]);
- }
- }
-
- // and process all nodes in the scenegraoh recursively
- ProcessNode(pScene->mRootNode);
- if (!output.size()) {
- throw DeadlyImportError("OptimizeMeshes: No meshes remaining; there's definitely something wrong");
- }
-
- meshes.clear();
- ai_assert(output.size() <= num_old);
-
- mScene->mNumMeshes = output.size();
- std::copy(output.begin(),output.end(),mScene->mMeshes);
-
- if (output.size() != num_old) {
- char tmp[512];
- ::sprintf(tmp,"OptimizeMeshesProcess finished. Input meshes: %i, Output meshes: %i",num_old,pScene->mNumMeshes);
- DefaultLogger::get()->info(tmp);
- }
- else DefaultLogger::get()->debug("OptimizeMeshesProcess finished");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Process meshes for a single node
-void OptimizeMeshesProcess::ProcessNode( aiNode* pNode)
-{
- for (unsigned int i = 0; i < pNode->mNumMeshes;++i) {
- unsigned int& im = pNode->mMeshes[i];
-
- if (meshes[im].instance_cnt > 1) {
- im = meshes[im].output_id;
- }
- else {
- merge_list.clear();
- unsigned int verts = 0, faces = 0;
-
- // Find meshes to merge with us
- for (unsigned int a = i+1; a < pNode->mNumMeshes;++a) {
- register unsigned int am = pNode->mMeshes[a];
- if (meshes[am].instance_cnt == 1 && CanJoin(im,am,verts,faces)) {
-
- merge_list.push_back(mScene->mMeshes[am]);
- verts += mScene->mMeshes[am]->mNumVertices;
- faces += mScene->mMeshes[am]->mNumFaces;
-
- --pNode->mNumMeshes;
- for (unsigned int n = a; n < pNode->mNumMeshes; ++n)
- pNode->mMeshes[n] = pNode->mMeshes[n+1];
-
- --a;
- }
- }
-
- // and merge all meshes which we found, replace the old ones
- if (!merge_list.empty()) {
- merge_list.push_back(mScene->mMeshes[im]);
-
- aiMesh* out;
- SceneCombiner::MergeMeshes(&out,0,merge_list.begin(),merge_list.end());
- output.push_back(out);
- }
- else {
- output.push_back(mScene->mMeshes[im]);
- }
- im = output.size()-1;
- }
- }
-
-
- for (unsigned int i = 0; i < pNode->mNumChildren; ++i)
- ProcessNode(pNode->mChildren[i]);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Check whether two meshes can be joined
-bool OptimizeMeshesProcess::CanJoin ( unsigned int a, unsigned int b, unsigned int verts, unsigned int faces )
-{
- if (meshes[a].vertex_format != meshes[b].vertex_format)
- return false;
-
- aiMesh* ma = mScene->mMeshes[a], *mb = mScene->mMeshes[b];
-
- if ((0xffffffff != max_verts && verts+mb->mNumVertices > max_verts) ||
- (0xffffffff != max_faces && faces+mb->mNumFaces > max_faces)) {
- return false;
- }
-
- // Never merge unskinned meshes with skinned meshes
- if (ma->mMaterialIndex != mb->mMaterialIndex || ma->HasBones() != mb->HasBones())
- return false;
-
- // Never merge meshes with different kinds of primitives if SortByPType did already
- // do its work. We would destroy everything again ...
- if (pts && ma->mPrimitiveTypes != mb->mPrimitiveTypes)
- return false;
-
- // If both meshes are skinned, check whether we have many bones defined in both meshes.
- // If yes, we can savely join them.
- if (ma->HasBones()) {
- // TODO
- return false;
- }
- return true;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Buidl a LUT of all instanced meshes
-void OptimizeMeshesProcess::FindInstancedMeshes (aiNode* pNode)
-{
- for (unsigned int i = 0; i < pNode->mNumMeshes;++i)
- ++meshes[pNode->mMeshes[i]].instance_cnt;
-
- for (unsigned int i = 0; i < pNode->mNumChildren; ++i)
- FindInstancedMeshes(pNode->mChildren[i]);
-}
-
-#endif // !! ASSIMP_BUILD_NO_OPTIMIZEMESHES_PROCESS
diff --git a/3rdparty/assimp/code/OptimizeMeshes.h b/3rdparty/assimp/code/OptimizeMeshes.h
deleted file mode 100644
index 406e9542..00000000
--- a/3rdparty/assimp/code/OptimizeMeshes.h
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file OptimizeMeshes.h
- * @brief Declares a post processing step to join meshes, if possible
- */
-#ifndef AI_OPTIMIZEMESHESPROCESS_H_INC
-#define AI_OPTIMIZEMESHESPROCESS_H_INC
-
-#include "BaseProcess.h"
-#include "../include/aiTypes.h"
-
-struct aiMesh;
-class OptimizeMeshesProcessTest;
-namespace Assimp {
-
-// ---------------------------------------------------------------------------
-/** @brief Postprocessing step to optimize mesh usage
- *
- * The implementation looks for meshes that could be joined and joins them.
- * Usually this will reduce the number of drawcalls.
- *
- * @note Instanced meshes are currently not processed.
- */
-class ASSIMP_API OptimizeMeshesProcess : public BaseProcess
-{
- friend class Importer;
- friend class ::OptimizeMeshesProcessTest;
-
-protected:
- /** Constructor to be privately used by Importer */
- OptimizeMeshesProcess();
-
- /** Destructor, private as well */
- ~OptimizeMeshesProcess();
-
-
- /** @brief Internal utility to store additional mesh info
- */
- struct MeshInfo
- {
- MeshInfo()
- : instance_cnt (0)
- , vertex_format (0)
- , output_id (0xffffffff)
- {}
-
- //! Number of times this mesh is referenced
- unsigned int instance_cnt;
-
- //! Vertex format id
- unsigned int vertex_format;
-
- //! Output ID
- unsigned int output_id;
- };
-
-public:
- // -------------------------------------------------------------------
- bool IsActive( unsigned int pFlags) const;
-
- // -------------------------------------------------------------------
- void Execute( aiScene* pScene);
-
- // -------------------------------------------------------------------
- void SetupProperties(const Importer* pImp);
-
-
- // -------------------------------------------------------------------
- /** @brief Specify whether you want meshes with different
- * primitive types to be merged as well.
- *
- * IsActive() sets this property automatically to true if the
- * aiProcess_SortByPType flag is found.
- */
- void EnablePrimitiveTypeSorting(bool enable) {
- pts = enable;
- }
-
- // Getter
- bool IsPrimitiveTypeSortingEnabled () const {
- return pts;
- }
-
-
- // -------------------------------------------------------------------
- /** @brief Specify a maximum size of a single output mesh.
- *
- * If a single input mesh already exceeds this limit, it won't
- * be splitted.
- * @param verts Maximum number of vertices per mesh
- * @param faces Maximum number of faces per mesh
- */
- void SetPreferredMeshSizeLimit (unsigned int verts, unsigned int faces)
- {
- max_verts = verts;
- max_faces = faces;
- }
-
-
-protected:
-
- // -------------------------------------------------------------------
- /** @brief Do the actual optimization on all meshes of this node
- * @param pNode Node we're working with
- */
- void ProcessNode( aiNode* pNode);
-
- // -------------------------------------------------------------------
- /** @brief Returns true if b can be joined with a
- *
- * @param verts Number of output verts up to now
- * @param faces Number of output faces up to now
- */
- bool CanJoin ( unsigned int a, unsigned int b,
- unsigned int verts, unsigned int faces );
-
- // -------------------------------------------------------------------
- /** @brief Find instanced meshes, for the moment we're excluding
- * them from all optimizations
- */
- void FindInstancedMeshes (aiNode* pNode);
-
-private:
-
- //! Scene we're working with
- aiScene* mScene;
-
- //! Per mesh info
- std::vector<MeshInfo> meshes;
-
- //! Next output mesh
- aiMesh* mesh;
-
- //! Output meshes
- std::vector<aiMesh*> output;
-
- //! @see EnablePrimitiveTypeSorting
- mutable bool pts;
-
- //! @see SetPreferredMeshSizeLimit
- mutable unsigned int max_verts,max_faces;
-
- //! Temporary storage
- std::vector<aiMesh*> merge_list;
-};
-
-} // end of namespace Assimp
-
-#endif // AI_CALCTANGENTSPROCESS_H_INC
diff --git a/3rdparty/assimp/code/ParsingUtils.h b/3rdparty/assimp/code/ParsingUtils.h
deleted file mode 100644
index 4cae6519..00000000
--- a/3rdparty/assimp/code/ParsingUtils.h
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-
-/** @file ParsingUtils.h
- * @brief Defines helper functions for text parsing
- */
-#ifndef AI_PARSING_UTILS_H_INC
-#define AI_PARSING_UTILS_H_INC
-
-#include "StringComparison.h"
-namespace Assimp {
-
-// ---------------------------------------------------------------------------------
-template <class char_t>
-AI_FORCE_INLINE bool IsSpace( const char_t in)
-{
- return (in == (char_t)' ' || in == (char_t)'\t');
-}
-// ---------------------------------------------------------------------------------
-template <class char_t>
-AI_FORCE_INLINE bool IsLineEnd( const char_t in)
-{
- return (in == (char_t)'\r' || in == (char_t)'\n' || in == (char_t)'\0');
-}
-// ---------------------------------------------------------------------------------
-template <class char_t>
-AI_FORCE_INLINE bool IsSpaceOrNewLine( const char_t in)
-{
- return IsSpace<char_t>(in) || IsLineEnd<char_t>(in);
-}
-// ---------------------------------------------------------------------------------
-template <class char_t>
-AI_FORCE_INLINE bool SkipSpaces( const char_t* in, const char_t** out)
-{
- while (*in == (char_t)' ' || *in == (char_t)'\t')in++;
- *out = in;
- return !IsLineEnd<char_t>(*in);
-}
-// ---------------------------------------------------------------------------------
-template <class char_t>
-AI_FORCE_INLINE bool SkipSpaces( const char_t** inout)
-{
- return SkipSpaces<char_t>(*inout,inout);
-}
-// ---------------------------------------------------------------------------------
-template <class char_t>
-inline bool SkipLine( const char_t* in, const char_t** out)
-{
- while (*in != (char_t)'\r' && *in != (char_t)'\n' && *in != (char_t)'\0')in++;
-
- // files are opened in binary mode. Ergo there are both NL and CR
- while (*in == (char_t)'\r' || *in == (char_t)'\n')in++;
- *out = in;
- return *in != (char_t)'\0';
-}
-// ---------------------------------------------------------------------------------
-template <class char_t>
-inline bool SkipLine( const char_t** inout)
-{
- return SkipLine<char_t>(*inout,inout);
-}
-// ---------------------------------------------------------------------------------
-template <class char_t>
-inline bool SkipSpacesAndLineEnd( const char_t* in, const char_t** out)
-{
- while (*in == (char_t)' ' || *in == (char_t)'\t' ||
- *in == (char_t)'\r' || *in == (char_t)'\n')in++;
- *out = in;
- return *in != '\0';
-}
-// ---------------------------------------------------------------------------------
-template <class char_t>
-inline bool SkipSpacesAndLineEnd( const char_t** inout)
-{
- return SkipSpacesAndLineEnd<char_t>(*inout,inout);
-}
-// ---------------------------------------------------------------------------------
-template <class char_t>
-inline bool GetNextLine(const char_t*& buffer, char_t out[4096])
-{
- if ((char_t)'\0' == *buffer)return false;
-
- char* _out = out;
- char* const end = _out+4096;
- while (!IsLineEnd( *buffer ) && _out < end)
- *_out++ = *buffer++;
- *_out = (char_t)'\0';
-
- while (IsLineEnd( *buffer ) && '\0' != *buffer)++buffer;
- return true;
-}
-// ---------------------------------------------------------------------------------
-template <class char_t>
-AI_FORCE_INLINE bool IsNumeric( char_t in)
-{
- return ( in >= '0' && in <= '9' ) || '-' == in || '+' == in;
-}
-// ---------------------------------------------------------------------------------
-AI_FORCE_INLINE bool TokenMatch(char*& in, const char* token, unsigned int len)
-{
- if (!::strncmp(token,in,len) && IsSpaceOrNewLine(in[len]))
- {
- in += len+1;
- return true;
- }
- return false;
-}
-// ---------------------------------------------------------------------------------
-/** @brief Case-ignoring version of TokenMatch
- * @param in Input
- * @param token Token to check for
- * @param len Number of characters to check
- */
-AI_FORCE_INLINE bool TokenMatchI(const char*& in, const char* token, unsigned int len)
-{
- if (!ASSIMP_strincmp(token,in,len) && IsSpaceOrNewLine(in[len]))
- {
- in += len+1;
- return true;
- }
- return false;
-}
-// ---------------------------------------------------------------------------------
-AI_FORCE_INLINE bool TokenMatch(const char*& in, const char* token, unsigned int len)
-{
- return TokenMatch(const_cast<char*&>(in), token, len);
-}
-// ---------------------------------------------------------------------------------
-AI_FORCE_INLINE void SkipToken(const char*& in)
-{
- SkipSpaces(&in);
- while (!IsSpaceOrNewLine(*in))++in;
-}
-// ---------------------------------------------------------------------------------
-AI_FORCE_INLINE std::string GetNextToken(const char*& in)
-{
- SkipSpacesAndLineEnd(&in);
- const char* cur = in;
- while (!IsSpaceOrNewLine(*in))++in;
- return std::string(cur,(size_t)(in-cur));
-}
-} // ! namespace Assimp
-#endif // ! AI_PARSING_UTILS_H_INC
diff --git a/3rdparty/assimp/code/PlyLoader.cpp b/3rdparty/assimp/code/PlyLoader.cpp
deleted file mode 100644
index 2c5dc4c9..00000000
--- a/3rdparty/assimp/code/PlyLoader.cpp
+++ /dev/null
@@ -1,1050 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file PlyLoader.cpp
- * @brief Implementation of the PLY importer class
- */
-
-#include "AssimpPCH.h"
-#ifndef ASSIMP_BUILD_NO_PLY_IMPORTER
-
-// internal headers
-#include "PlyLoader.h"
-#include "MaterialSystem.h"
-
-using namespace Assimp;
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-PLYImporter::PLYImporter()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-PLYImporter::~PLYImporter()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the class can handle the format of the given file.
-bool PLYImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const
-{
- const std::string extension = GetExtension(pFile);
-
- if (extension == "ply")
- return true;
- else if (!extension.length() || checkSig)
- {
- if (!pIOHandler)return true;
- const char* tokens[] = {"ply"};
- return SearchFileHeaderForToken(pIOHandler,pFile,tokens,1);
- }
- return false;
-}
-
-// ------------------------------------------------------------------------------------------------
-void PLYImporter::GetExtensionList(std::set<std::string>& extensions)
-{
- extensions.insert("ply");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Imports the given file into the given scene structure.
-void PLYImporter::InternReadFile( const std::string& pFile,
- aiScene* pScene, IOSystem* pIOHandler)
-{
- boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile));
-
- // Check whether we can read from the file
- if ( file.get() == NULL) {
- throw DeadlyImportError( "Failed to open PLY file " + pFile + ".");
- }
-
- // allocate storage and copy the contents of the file to a memory buffer
- std::vector<char> mBuffer2;
- TextFileToBuffer(file.get(),mBuffer2);
- mBuffer = (unsigned char*)&mBuffer2[0];
-
- // the beginning of the file must be PLY - magic, magic
- if ((mBuffer[0] != 'P' && mBuffer[0] != 'p') ||
- (mBuffer[1] != 'L' && mBuffer[1] != 'l') ||
- (mBuffer[2] != 'Y' && mBuffer[2] != 'y')) {
- throw DeadlyImportError( "Invalid .ply file: Magic number \'ply\' is no there");
- }
-
- char* szMe = (char*)&this->mBuffer[3];
- SkipSpacesAndLineEnd(szMe,(const char**)&szMe);
-
- // determine the format of the file data
- PLY::DOM sPlyDom;
- if (TokenMatch(szMe,"format",6))
- {
- if (TokenMatch(szMe,"ascii",5))
- {
- SkipLine(szMe,(const char**)&szMe);
- if (!PLY::DOM::ParseInstance(szMe,&sPlyDom))
- throw DeadlyImportError( "Invalid .ply file: Unable to build DOM (#1)");
- }
- else if (!::strncmp(szMe,"binary_",7))
- {
- bool bIsBE = false;
- szMe+=7;
-
- // binary_little_endian
- // binary_big_endian
-#if (defined AI_BUILD_BIG_ENDIAN)
- if ('l' == *szMe || 'L' == *szMe)bIsBE = true;
-#else
- if ('b' == *szMe || 'B' == *szMe)bIsBE = true;
-#endif // ! AI_BUILD_BIG_ENDIAN
-
- // skip the line, parse the rest of the header and build the DOM
- SkipLine(szMe,(const char**)&szMe);
- if (!PLY::DOM::ParseInstanceBinary(szMe,&sPlyDom,bIsBE))
- throw DeadlyImportError( "Invalid .ply file: Unable to build DOM (#2)");
- }
- else throw DeadlyImportError( "Invalid .ply file: Unknown file format");
- }
- else
- {
- delete[] this->mBuffer;
- AI_DEBUG_INVALIDATE_PTR(this->mBuffer);
- throw DeadlyImportError( "Invalid .ply file: Missing format specification");
- }
- this->pcDOM = &sPlyDom;
-
- // now load a list of vertices. This must be sucessfull in order to procede
- std::vector<aiVector3D> avPositions;
- this->LoadVertices(&avPositions,false);
-
- if (avPositions.empty())
- throw DeadlyImportError( "Invalid .ply file: No vertices found. "
- "Unable to parse the data format of the PLY file.");
-
- // now load a list of normals.
- std::vector<aiVector3D> avNormals;
- LoadVertices(&avNormals,true);
-
- // load the face list
- std::vector<PLY::Face> avFaces;
- LoadFaces(&avFaces);
-
- // if no face list is existing we assume that the vertex
- // list is containing a list of triangles
- if (avFaces.empty())
- {
- if (avPositions.size() < 3)
- {
- throw DeadlyImportError( "Invalid .ply file: Not enough "
- "vertices to build a proper face list. ");
- }
-
- const unsigned int iNum = (unsigned int)avPositions.size() / 3;
- for (unsigned int i = 0; i< iNum;++i)
- {
- PLY::Face sFace;
- sFace.mIndices.push_back((iNum*3));
- sFace.mIndices.push_back((iNum*3)+1);
- sFace.mIndices.push_back((iNum*3)+2);
- avFaces.push_back(sFace);
- }
- }
-
- // now load a list of all materials
- std::vector<MaterialHelper*> avMaterials;
- LoadMaterial(&avMaterials);
-
- // now load a list of all vertex color channels
- std::vector<aiColor4D> avColors;
- avColors.reserve(avPositions.size());
- LoadVertexColor(&avColors);
-
- // now try to load texture coordinates
- std::vector<aiVector2D> avTexCoords;
- avTexCoords.reserve(avPositions.size());
- LoadTextureCoordinates(&avTexCoords);
-
- // now replace the default material in all faces and validate all material indices
- ReplaceDefaultMaterial(&avFaces,&avMaterials);
-
- // now convert this to a list of aiMesh instances
- std::vector<aiMesh*> avMeshes;
- avMeshes.reserve(avMaterials.size()+1);
- ConvertMeshes(&avFaces,&avPositions,&avNormals,
- &avColors,&avTexCoords,&avMaterials,&avMeshes);
-
- if (avMeshes.empty())
- throw DeadlyImportError( "Invalid .ply file: Unable to extract mesh data ");
-
- // now generate the output scene object. Fill the material list
- pScene->mNumMaterials = (unsigned int)avMaterials.size();
- pScene->mMaterials = new aiMaterial*[pScene->mNumMaterials];
- for (unsigned int i = 0; i < pScene->mNumMaterials;++i)
- pScene->mMaterials[i] = avMaterials[i];
-
- // fill the mesh list
- pScene->mNumMeshes = (unsigned int)avMeshes.size();
- pScene->mMeshes = new aiMesh*[pScene->mNumMeshes];
- for (unsigned int i = 0; i < pScene->mNumMeshes;++i)
- pScene->mMeshes[i] = avMeshes[i];
-
- // generate a simple node structure
- pScene->mRootNode = new aiNode();
- pScene->mRootNode->mNumMeshes = pScene->mNumMeshes;
- pScene->mRootNode->mMeshes = new unsigned int[pScene->mNumMeshes];
-
- for (unsigned int i = 0; i < pScene->mRootNode->mNumMeshes;++i)
- pScene->mRootNode->mMeshes[i] = i;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Split meshes by material IDs
-void PLYImporter::ConvertMeshes(std::vector<PLY::Face>* avFaces,
- const std::vector<aiVector3D>* avPositions,
- const std::vector<aiVector3D>* avNormals,
- const std::vector<aiColor4D>* avColors,
- const std::vector<aiVector2D>* avTexCoords,
- const std::vector<MaterialHelper*>* avMaterials,
- std::vector<aiMesh*>* avOut)
-{
- ai_assert(NULL != avFaces);
- ai_assert(NULL != avPositions);
- ai_assert(NULL != avMaterials);
-
- // split by materials
- std::vector<unsigned int>* aiSplit = new std::vector<unsigned int>[avMaterials->size()];
-
- unsigned int iNum = 0;
- for (std::vector<PLY::Face>::const_iterator i = avFaces->begin();i != avFaces->end();++i,++iNum)
- aiSplit[(*i).iMaterialIndex].push_back(iNum);
-
- // now generate submeshes
- for (unsigned int p = 0; p < avMaterials->size();++p)
- {
- if (aiSplit[p].size() != 0)
- {
- // allocate the mesh object
- aiMesh* p_pcOut = new aiMesh();
- p_pcOut->mMaterialIndex = p;
-
- p_pcOut->mNumFaces = (unsigned int)aiSplit[p].size();
- p_pcOut->mFaces = new aiFace[aiSplit[p].size()];
-
- // at first we need to determine the size of the output vector array
- unsigned int iNum = 0;
- for (unsigned int i = 0; i < aiSplit[p].size();++i)
- {
- iNum += (unsigned int)(*avFaces)[aiSplit[p][i]].mIndices.size();
- }
- p_pcOut->mNumVertices = iNum;
- p_pcOut->mVertices = new aiVector3D[iNum];
-
- if (!avColors->empty())
- p_pcOut->mColors[0] = new aiColor4D[iNum];
- if (!avTexCoords->empty())
- {
- p_pcOut->mNumUVComponents[0] = 2;
- p_pcOut->mTextureCoords[0] = new aiVector3D[iNum];
- }
- if (!avNormals->empty())
- p_pcOut->mNormals = new aiVector3D[iNum];
-
- // add all faces
- iNum = 0;
- unsigned int iVertex = 0;
- for (std::vector<unsigned int>::const_iterator i = aiSplit[p].begin();
- i != aiSplit[p].end();++i,++iNum)
- {
- p_pcOut->mFaces[iNum].mNumIndices = (unsigned int)(*avFaces)[*i].mIndices.size();
- p_pcOut->mFaces[iNum].mIndices = new unsigned int[p_pcOut->mFaces[iNum].mNumIndices];
-
- // build an unique set of vertices/colors for this face
- for (unsigned int q = 0; q < p_pcOut->mFaces[iNum].mNumIndices;++q)
- {
- p_pcOut->mFaces[iNum].mIndices[q] = iVertex;
- p_pcOut->mVertices[iVertex] = (*avPositions)[(*avFaces)[*i].mIndices[q]];
-
- if (!avColors->empty())
- p_pcOut->mColors[0][iVertex] = (*avColors)[(*avFaces)[*i].mIndices[q]];
-
- if (!avTexCoords->empty())
- {
- const aiVector2D& vec = (*avTexCoords)[(*avFaces)[*i].mIndices[q]];
- p_pcOut->mTextureCoords[0][iVertex].x = vec.x;
- p_pcOut->mTextureCoords[0][iVertex].y = vec.y;
- }
-
- if (!avNormals->empty())
- p_pcOut->mNormals[iVertex] = (*avNormals)[(*avFaces)[*i].mIndices[q]];
- iVertex++;
- }
-
- }
- // add the mesh to the output list
- avOut->push_back(p_pcOut);
- }
- }
- delete[] aiSplit; // cleanup
-}
-
-// ------------------------------------------------------------------------------------------------
-// Generate a default material if none was specified and apply it to all vanilla faces
-void PLYImporter::ReplaceDefaultMaterial(std::vector<PLY::Face>* avFaces,
- std::vector<MaterialHelper*>* avMaterials)
-{
- bool bNeedDefaultMat = false;
-
- for (std::vector<PLY::Face>::iterator i = avFaces->begin();i != avFaces->end();++i) {
- if (0xFFFFFFFF == (*i).iMaterialIndex) {
- bNeedDefaultMat = true;
- (*i).iMaterialIndex = (unsigned int)avMaterials->size();
- }
- else if ((*i).iMaterialIndex >= avMaterials->size() ) {
- // clamp the index
- (*i).iMaterialIndex = (unsigned int)avMaterials->size()-1;
- }
- }
-
- if (bNeedDefaultMat) {
- // generate a default material
- MaterialHelper* pcHelper = new MaterialHelper();
-
- // fill in a default material
- int iMode = (int)aiShadingMode_Gouraud;
- pcHelper->AddProperty<int>(&iMode, 1, AI_MATKEY_SHADING_MODEL);
-
- aiColor3D clr;
- clr.b = clr.g = clr.r = 0.6f;
- pcHelper->AddProperty<aiColor3D>(&clr, 1,AI_MATKEY_COLOR_DIFFUSE);
- pcHelper->AddProperty<aiColor3D>(&clr, 1,AI_MATKEY_COLOR_SPECULAR);
-
- clr.b = clr.g = clr.r = 0.05f;
- pcHelper->AddProperty<aiColor3D>(&clr, 1,AI_MATKEY_COLOR_AMBIENT);
-
- // The face order is absolutely undefined for PLY, so we have to
- // use two-sided rendering to be sure it's ok.
- const int two_sided = 1;
- pcHelper->AddProperty(&two_sided,1,AI_MATKEY_TWOSIDED);
-
- avMaterials->push_back(pcHelper);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void PLYImporter::LoadTextureCoordinates(std::vector<aiVector2D>* pvOut)
-{
- ai_assert(NULL != pvOut);
-
- unsigned int aiPositions[2] = {0xFFFFFFFF,0xFFFFFFFF};
- PLY::EDataType aiTypes[2] = {EDT_Char,EDT_Char};
- PLY::ElementInstanceList* pcList = NULL;
- unsigned int cnt = 0;
-
- // serach in the DOM for a vertex entry
- unsigned int _i = 0;
- for (std::vector<PLY::Element>::const_iterator i = pcDOM->alElements.begin();
- i != pcDOM->alElements.end();++i,++_i)
- {
- if (PLY::EEST_Vertex == (*i).eSemantic)
- {
- pcList = &this->pcDOM->alElementData[_i];
-
- // now check whether which normal components are available
- unsigned int _a = 0;
- for (std::vector<PLY::Property>::const_iterator a = (*i).alProperties.begin();
- a != (*i).alProperties.end();++a,++_a)
- {
- if ((*a).bIsList)continue;
- if (PLY::EST_UTextureCoord == (*a).Semantic)
- {
- cnt++;
- aiPositions[0] = _a;
- aiTypes[0] = (*a).eType;
- }
- else if (PLY::EST_VTextureCoord == (*a).Semantic)
- {
- cnt++;
- aiPositions[1] = _a;
- aiTypes[1] = (*a).eType;
- }
- }
- }
- }
- // check whether we have a valid source for the texture coordinates data
- if (NULL != pcList && 0 != cnt)
- {
- pvOut->reserve(pcList->alInstances.size());
- for (std::vector<ElementInstance>::const_iterator i = pcList->alInstances.begin();
- i != pcList->alInstances.end();++i)
- {
- // convert the vertices to sp floats
- aiVector2D vOut;
-
- if (0xFFFFFFFF != aiPositions[0])
- {
- vOut.x = PLY::PropertyInstance::ConvertTo<float>(
- (*i).alProperties[aiPositions[0]].avList.front(),aiTypes[0]);
- }
-
- if (0xFFFFFFFF != aiPositions[1])
- {
- vOut.y = PLY::PropertyInstance::ConvertTo<float>(
- (*i).alProperties[aiPositions[1]].avList.front(),aiTypes[1]);
- }
- // and add them to our nice list
- pvOut->push_back(vOut);
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Try to extract vertices from the PLY DOM
-void PLYImporter::LoadVertices(std::vector<aiVector3D>* pvOut, bool p_bNormals)
-{
- ai_assert(NULL != pvOut);
-
- unsigned int aiPositions[3] = {0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF};
- PLY::EDataType aiTypes[3] = {EDT_Char,EDT_Char,EDT_Char};
- PLY::ElementInstanceList* pcList = NULL;
- unsigned int cnt = 0;
-
- // serach in the DOM for a vertex entry
- unsigned int _i = 0;
- for (std::vector<PLY::Element>::const_iterator i = pcDOM->alElements.begin();
- i != pcDOM->alElements.end();++i,++_i)
- {
- if (PLY::EEST_Vertex == (*i).eSemantic)
- {
- pcList = &pcDOM->alElementData[_i];
-
- // load normal vectors?
- if (p_bNormals)
- {
- // now check whether which normal components are available
- unsigned int _a = 0;
- for (std::vector<PLY::Property>::const_iterator a = (*i).alProperties.begin();
- a != (*i).alProperties.end();++a,++_a)
- {
- if ((*a).bIsList)continue;
- if (PLY::EST_XNormal == (*a).Semantic)
- {
- cnt++;
- aiPositions[0] = _a;
- aiTypes[0] = (*a).eType;
- }
- else if (PLY::EST_YNormal == (*a).Semantic)
- {
- cnt++;
- aiPositions[1] = _a;
- aiTypes[1] = (*a).eType;
- }
- else if (PLY::EST_ZNormal == (*a).Semantic)
- {
- cnt++;
- aiPositions[2] = _a;
- aiTypes[2] = (*a).eType;
- }
- }
- }
- // load vertex coordinates
- else
- {
- // now check whether which coordinate sets are available
- unsigned int _a = 0;
- for (std::vector<PLY::Property>::const_iterator a = (*i).alProperties.begin();
- a != (*i).alProperties.end();++a,++_a)
- {
- if ((*a).bIsList)continue;
- if (PLY::EST_XCoord == (*a).Semantic)
- {
- cnt++;
- aiPositions[0] = _a;
- aiTypes[0] = (*a).eType;
- }
- else if (PLY::EST_YCoord == (*a).Semantic)
- {
- cnt++;
- aiPositions[1] = _a;
- aiTypes[1] = (*a).eType;
- }
- else if (PLY::EST_ZCoord == (*a).Semantic)
- {
- cnt++;
- aiPositions[2] = _a;
- aiTypes[2] = (*a).eType;
- }
- if (3 == cnt)break;
- }
- }
- break;
- }
- }
- // check whether we have a valid source for the vertex data
- if (NULL != pcList && 0 != cnt)
- {
- pvOut->reserve(pcList->alInstances.size());
- for (std::vector<ElementInstance>::const_iterator
- i = pcList->alInstances.begin();
- i != pcList->alInstances.end();++i)
- {
- // convert the vertices to sp floats
- aiVector3D vOut;
-
- if (0xFFFFFFFF != aiPositions[0])
- {
- vOut.x = PLY::PropertyInstance::ConvertTo<float>(
- (*i).alProperties[aiPositions[0]].avList.front(),aiTypes[0]);
- }
-
- if (0xFFFFFFFF != aiPositions[1])
- {
- vOut.y = PLY::PropertyInstance::ConvertTo<float>(
- (*i).alProperties[aiPositions[1]].avList.front(),aiTypes[1]);
- }
-
- if (0xFFFFFFFF != aiPositions[2])
- {
- vOut.z = PLY::PropertyInstance::ConvertTo<float>(
- (*i).alProperties[aiPositions[2]].avList.front(),aiTypes[2]);
- }
-
- // and add them to our nice list
- pvOut->push_back(vOut);
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Convert a color component to [0...1]
-float PLYImporter::NormalizeColorValue (PLY::PropertyInstance::ValueUnion val,
- PLY::EDataType eType)
-{
- switch (eType)
- {
- case EDT_Float:
- return val.fFloat;
- case EDT_Double:
- return (float)val.fDouble;
-
- case EDT_UChar:
- return (float)val.iUInt / (float)0xFF;
- case EDT_Char:
- return (float)(val.iInt+(0xFF/2)) / (float)0xFF;
- case EDT_UShort:
- return (float)val.iUInt / (float)0xFFFF;
- case EDT_Short:
- return (float)(val.iInt+(0xFFFF/2)) / (float)0xFFFF;
- case EDT_UInt:
- return (float)val.iUInt / (float)0xFFFF;
- case EDT_Int:
- return ((float)val.iInt / (float)0xFF) + 0.5f;
- default: ;
- };
- return 0.0f;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Try to extract proper vertex colors from the PLY DOM
-void PLYImporter::LoadVertexColor(std::vector<aiColor4D>* pvOut)
-{
- ai_assert(NULL != pvOut);
-
- unsigned int aiPositions[4] = {0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF};
- PLY::EDataType aiTypes[4] = {EDT_Char, EDT_Char, EDT_Char, EDT_Char}; // silencing gcc
- unsigned int cnt = 0;
- PLY::ElementInstanceList* pcList = NULL;
-
- // serach in the DOM for a vertex entry
- unsigned int _i = 0;
- for (std::vector<PLY::Element>::const_iterator i = pcDOM->alElements.begin();
- i != pcDOM->alElements.end();++i,++_i)
- {
- if (PLY::EEST_Vertex == (*i).eSemantic)
- {
- pcList = &this->pcDOM->alElementData[_i];
-
- // now check whether which coordinate sets are available
- unsigned int _a = 0;
- for (std::vector<PLY::Property>::const_iterator
- a = (*i).alProperties.begin();
- a != (*i).alProperties.end();++a,++_a)
- {
- if ((*a).bIsList)continue;
- if (PLY::EST_Red == (*a).Semantic)
- {
- cnt++;
- aiPositions[0] = _a;
- aiTypes[0] = (*a).eType;
- }
- else if (PLY::EST_Green == (*a).Semantic)
- {
- cnt++;
- aiPositions[1] = _a;
- aiTypes[1] = (*a).eType;
- }
- else if (PLY::EST_Blue == (*a).Semantic)
- {
- cnt++;
- aiPositions[2] = _a;
- aiTypes[2] = (*a).eType;
- }
- else if (PLY::EST_Alpha == (*a).Semantic)
- {
- cnt++;
- aiPositions[3] = _a;
- aiTypes[3] = (*a).eType;
- }
- if (4 == cnt)break;
- }
- break;
- }
- }
- // check whether we have a valid source for the vertex data
- if (NULL != pcList && 0 != cnt)
- {
- pvOut->reserve(pcList->alInstances.size());
- for (std::vector<ElementInstance>::const_iterator i = pcList->alInstances.begin();
- i != pcList->alInstances.end();++i)
- {
- // convert the vertices to sp floats
- aiColor4D vOut;
-
- if (0xFFFFFFFF != aiPositions[0])
- {
- vOut.r = NormalizeColorValue((*i).alProperties[
- aiPositions[0]].avList.front(),aiTypes[0]);
- }
-
- if (0xFFFFFFFF != aiPositions[1])
- {
- vOut.g = NormalizeColorValue((*i).alProperties[
- aiPositions[1]].avList.front(),aiTypes[1]);
- }
-
- if (0xFFFFFFFF != aiPositions[2])
- {
- vOut.b = NormalizeColorValue((*i).alProperties[
- aiPositions[2]].avList.front(),aiTypes[2]);
- }
-
- // assume 1.0 for the alpha channel ifit is not set
- if (0xFFFFFFFF == aiPositions[3])vOut.a = 1.0f;
- else
- {
- vOut.a = NormalizeColorValue((*i).alProperties[
- aiPositions[3]].avList.front(),aiTypes[3]);
- }
-
- // and add them to our nice list
- pvOut->push_back(vOut);
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Try to extract proper faces from the PLY DOM
-void PLYImporter::LoadFaces(std::vector<PLY::Face>* pvOut)
-{
- ai_assert(NULL != pvOut);
-
- PLY::ElementInstanceList* pcList = NULL;
- bool bOne = false;
-
- // index of the vertex index list
- unsigned int iProperty = 0xFFFFFFFF;
- PLY::EDataType eType = EDT_Char;
- bool bIsTristrip = false;
-
- // index of the material index property
- unsigned int iMaterialIndex = 0xFFFFFFFF;
- PLY::EDataType eType2 = EDT_Char;
-
- // serach in the DOM for a face entry
- unsigned int _i = 0;
- for (std::vector<PLY::Element>::const_iterator i = pcDOM->alElements.begin();
- i != pcDOM->alElements.end();++i,++_i)
- {
- // face = unique number of vertex indices
- if (PLY::EEST_Face == (*i).eSemantic)
- {
- pcList = &pcDOM->alElementData[_i];
- unsigned int _a = 0;
- for (std::vector<PLY::Property>::const_iterator a = (*i).alProperties.begin();
- a != (*i).alProperties.end();++a,++_a)
- {
- if (PLY::EST_VertexIndex == (*a).Semantic)
- {
- // must be a dynamic list!
- if (!(*a).bIsList)continue;
- iProperty = _a;
- bOne = true;
- eType = (*a).eType;
- }
- else if (PLY::EST_MaterialIndex == (*a).Semantic)
- {
- if ((*a).bIsList)continue;
- iMaterialIndex = _a;
- bOne = true;
- eType2 = (*a).eType;
- }
- }
- break;
- }
- // triangle strip
- // TODO: triangle strip and material index support???
- else if (PLY::EEST_TriStrip == (*i).eSemantic)
- {
- // find a list property in this ...
- pcList = &this->pcDOM->alElementData[_i];
- unsigned int _a = 0;
- for (std::vector<PLY::Property>::const_iterator a = (*i).alProperties.begin();
- a != (*i).alProperties.end();++a,++_a)
- {
- // must be a dynamic list!
- if (!(*a).bIsList)continue;
- iProperty = _a;
- bOne = true;
- bIsTristrip = true;
- eType = (*a).eType;
- break;
- }
- break;
- }
- }
- // check whether we have at least one per-face information set
- if (pcList && bOne)
- {
- if (!bIsTristrip)
- {
- pvOut->reserve(pcList->alInstances.size());
- for (std::vector<ElementInstance>::const_iterator i = pcList->alInstances.begin();
- i != pcList->alInstances.end();++i)
- {
- PLY::Face sFace;
-
- // parse the list of vertex indices
- if (0xFFFFFFFF != iProperty)
- {
- const unsigned int iNum = (unsigned int)(*i).alProperties[iProperty].avList.size();
- sFace.mIndices.resize(iNum);
-
- std::vector<PLY::PropertyInstance::ValueUnion>::const_iterator p =
- (*i).alProperties[iProperty].avList.begin();
-
- for (unsigned int a = 0; a < iNum;++a,++p)
- {
- sFace.mIndices[a] = PLY::PropertyInstance::ConvertTo<unsigned int>(*p,eType);
- }
- }
-
- // parse the material index
- if (0xFFFFFFFF != iMaterialIndex)
- {
- sFace.iMaterialIndex = PLY::PropertyInstance::ConvertTo<unsigned int>(
- (*i).alProperties[iMaterialIndex].avList.front(),eType2);
- }
- pvOut->push_back(sFace);
- }
- }
- else // triangle strips
- {
- // normally we have only one triangle strip instance where
- // a value of -1 indicates a restart of the strip
- bool flip = false;
- for (std::vector<ElementInstance>::const_iterator i = pcList->alInstances.begin();i != pcList->alInstances.end();++i) {
- const std::vector<PLY::PropertyInstance::ValueUnion>& quak = (*i).alProperties[iProperty].avList;
- pvOut->reserve(pvOut->size() + quak.size() + (quak.size()>>2u));
-
- int aiTable[2] = {-1,-1};
- for (std::vector<PLY::PropertyInstance::ValueUnion>::const_iterator a = quak.begin();a != quak.end();++a) {
- const int p = PLY::PropertyInstance::ConvertTo<int>(*a,eType);
-
- if (-1 == p) {
- // restart the strip ...
- aiTable[0] = aiTable[1] = -1;
- flip = false;
- continue;
- }
- if (-1 == aiTable[0]) {
- aiTable[0] = p;
- continue;
- }
- if (-1 == aiTable[1]) {
- aiTable[1] = p;
- continue;
- }
-
- pvOut->push_back(PLY::Face());
- PLY::Face& sFace = pvOut->back();
- sFace.mIndices[0] = aiTable[0];
- sFace.mIndices[1] = aiTable[1];
- sFace.mIndices[2] = p;
- if ((flip = !flip)) {
- std::swap(sFace.mIndices[0],sFace.mIndices[1]);
- }
-
- aiTable[0] = aiTable[1];
- aiTable[1] = p;
- }
- }
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Get a RGBA color in [0...1] range
-void PLYImporter::GetMaterialColor(const std::vector<PLY::PropertyInstance>& avList,
- unsigned int aiPositions[4],
- PLY::EDataType aiTypes[4],
- aiColor4D* clrOut)
-{
- ai_assert(NULL != clrOut);
-
- if (0xFFFFFFFF == aiPositions[0])clrOut->r = 0.0f;
- else
- {
- clrOut->r = NormalizeColorValue(avList[
- aiPositions[0]].avList.front(),aiTypes[0]);
- }
-
- if (0xFFFFFFFF == aiPositions[1])clrOut->g = 0.0f;
- else
- {
- clrOut->g = NormalizeColorValue(avList[
- aiPositions[1]].avList.front(),aiTypes[1]);
- }
-
- if (0xFFFFFFFF == aiPositions[2])clrOut->b = 0.0f;
- else
- {
- clrOut->b = NormalizeColorValue(avList[
- aiPositions[2]].avList.front(),aiTypes[2]);
- }
-
- // assume 1.0 for the alpha channel ifit is not set
- if (0xFFFFFFFF == aiPositions[3])clrOut->a = 1.0f;
- else
- {
- clrOut->a = NormalizeColorValue(avList[
- aiPositions[3]].avList.front(),aiTypes[3]);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Extract a material from the PLY DOM
-void PLYImporter::LoadMaterial(std::vector<MaterialHelper*>* pvOut)
-{
- ai_assert(NULL != pvOut);
-
- // diffuse[4], specular[4], ambient[4]
- // rgba order
- unsigned int aaiPositions[3][4] = {
-
- {0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF},
- {0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF},
- {0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF},
- };
-
- PLY::EDataType aaiTypes[3][4] = {
- {EDT_Char,EDT_Char,EDT_Char,EDT_Char},
- {EDT_Char,EDT_Char,EDT_Char,EDT_Char},
- {EDT_Char,EDT_Char,EDT_Char,EDT_Char}
- };
- PLY::ElementInstanceList* pcList = NULL;
-
- unsigned int iPhong = 0xFFFFFFFF;
- PLY::EDataType ePhong = EDT_Char;
-
- unsigned int iOpacity = 0xFFFFFFFF;
- PLY::EDataType eOpacity = EDT_Char;
-
- // serach in the DOM for a vertex entry
- unsigned int _i = 0;
- for (std::vector<PLY::Element>::const_iterator i = this->pcDOM->alElements.begin();
- i != this->pcDOM->alElements.end();++i,++_i)
- {
- if (PLY::EEST_Material == (*i).eSemantic)
- {
- pcList = &this->pcDOM->alElementData[_i];
-
- // now check whether which coordinate sets are available
- unsigned int _a = 0;
- for (std::vector<PLY::Property>::const_iterator
- a = (*i).alProperties.begin();
- a != (*i).alProperties.end();++a,++_a)
- {
- if ((*a).bIsList)continue;
-
- // pohng specularity -----------------------------------
- if (PLY::EST_PhongPower == (*a).Semantic)
- {
- iPhong = _a;
- ePhong = (*a).eType;
- }
-
- // general opacity -----------------------------------
- if (PLY::EST_Opacity == (*a).Semantic)
- {
- iOpacity = _a;
- eOpacity = (*a).eType;
- }
-
- // diffuse color channels -----------------------------------
- if (PLY::EST_DiffuseRed == (*a).Semantic)
- {
- aaiPositions[0][0] = _a;
- aaiTypes[0][0] = (*a).eType;
- }
- else if (PLY::EST_DiffuseGreen == (*a).Semantic)
- {
- aaiPositions[0][1] = _a;
- aaiTypes[0][1] = (*a).eType;
- }
- else if (PLY::EST_DiffuseBlue == (*a).Semantic)
- {
- aaiPositions[0][2] = _a;
- aaiTypes[0][2] = (*a).eType;
- }
- else if (PLY::EST_DiffuseAlpha == (*a).Semantic)
- {
- aaiPositions[0][3] = _a;
- aaiTypes[0][3] = (*a).eType;
- }
- // specular color channels -----------------------------------
- else if (PLY::EST_SpecularRed == (*a).Semantic)
- {
- aaiPositions[1][0] = _a;
- aaiTypes[1][0] = (*a).eType;
- }
- else if (PLY::EST_SpecularGreen == (*a).Semantic)
- {
- aaiPositions[1][1] = _a;
- aaiTypes[1][1] = (*a).eType;
- }
- else if (PLY::EST_SpecularBlue == (*a).Semantic)
- {
- aaiPositions[1][2] = _a;
- aaiTypes[1][2] = (*a).eType;
- }
- else if (PLY::EST_SpecularAlpha == (*a).Semantic)
- {
- aaiPositions[1][3] = _a;
- aaiTypes[1][3] = (*a).eType;
- }
- // ambient color channels -----------------------------------
- else if (PLY::EST_AmbientRed == (*a).Semantic)
- {
- aaiPositions[2][0] = _a;
- aaiTypes[2][0] = (*a).eType;
- }
- else if (PLY::EST_AmbientGreen == (*a).Semantic)
- {
- aaiPositions[2][1] = _a;
- aaiTypes[2][1] = (*a).eType;
- }
- else if (PLY::EST_AmbientBlue == (*a).Semantic)
- {
- aaiPositions[2][2] = _a;
- aaiTypes[2][2] = (*a).eType;
- }
- else if (PLY::EST_AmbientAlpha == (*a).Semantic)
- {
- aaiPositions[2][3] = _a;
- aaiTypes[2][3] = (*a).eType;
- }
- }
- break;
- }
- }
- // check whether we have a valid source for the material data
- if (NULL != pcList) {
- for (std::vector<ElementInstance>::const_iterator i = pcList->alInstances.begin();i != pcList->alInstances.end();++i) {
- aiColor4D clrOut;
- MaterialHelper* pcHelper = new MaterialHelper();
-
- // build the diffuse material color
- GetMaterialColor((*i).alProperties,aaiPositions[0],aaiTypes[0],&clrOut);
- pcHelper->AddProperty<aiColor4D>(&clrOut,1,AI_MATKEY_COLOR_DIFFUSE);
-
- // build the specular material color
- GetMaterialColor((*i).alProperties,aaiPositions[1],aaiTypes[1],&clrOut);
- pcHelper->AddProperty<aiColor4D>(&clrOut,1,AI_MATKEY_COLOR_SPECULAR);
-
- // build the ambient material color
- GetMaterialColor((*i).alProperties,aaiPositions[2],aaiTypes[2],&clrOut);
- pcHelper->AddProperty<aiColor4D>(&clrOut,1,AI_MATKEY_COLOR_AMBIENT);
-
- // handle phong power and shading mode
- int iMode;
- if (0xFFFFFFFF != iPhong) {
- float fSpec = PLY::PropertyInstance::ConvertTo<float>((*i).alProperties[iPhong].avList.front(),ePhong);
-
- // if shininess is 0 (and the pow() calculation would therefore always
- // become 1, not depending on the angle), use gouraud lighting
- if (fSpec) {
- // scale this with 15 ... hopefully this is correct
- fSpec *= 15;
- pcHelper->AddProperty<float>(&fSpec, 1, AI_MATKEY_SHININESS);
-
- iMode = (int)aiShadingMode_Phong;
- }
- else iMode = (int)aiShadingMode_Gouraud;
- }
- else iMode = (int)aiShadingMode_Gouraud;
- pcHelper->AddProperty<int>(&iMode, 1, AI_MATKEY_SHADING_MODEL);
-
- // handle opacity
- if (0xFFFFFFFF != iOpacity) {
- float fOpacity = PLY::PropertyInstance::ConvertTo<float>((*i).alProperties[iPhong].avList.front(),eOpacity);
- pcHelper->AddProperty<float>(&fOpacity, 1, AI_MATKEY_OPACITY);
- }
-
- // The face order is absolutely undefined for PLY, so we have to
- // use two-sided rendering to be sure it's ok.
- const int two_sided = 1;
- pcHelper->AddProperty(&two_sided,1,AI_MATKEY_TWOSIDED);
-
- // add the newly created material instance to the list
- pvOut->push_back(pcHelper);
- }
- }
-}
-
-#endif // !! ASSIMP_BUILD_NO_PLY_IMPORTER
diff --git a/3rdparty/assimp/code/PlyLoader.h b/3rdparty/assimp/code/PlyLoader.h
deleted file mode 100644
index 3cdfb5e1..00000000
--- a/3rdparty/assimp/code/PlyLoader.h
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file PLYLoader.h
- * @brief Declaration of the .ply importer class.
- */
-#ifndef AI_PLYLOADER_H_INCLUDED
-#define AI_PLYLOADER_H_INCLUDED
-
-#include "BaseImporter.h"
-#include "../include/aiTypes.h"
-
-struct aiNode;
-
-#include "PlyParser.h"
-
-namespace Assimp {
-class MaterialHelper;
-
-using namespace PLY;
-
-// ---------------------------------------------------------------------------
-/** Importer class to load the stanford PLY file format
-*/
-class PLYImporter : public BaseImporter
-{
- friend class Importer;
-
-protected:
- /** Constructor to be privately used by Importer */
- PLYImporter();
-
- /** Destructor, private as well */
- ~PLYImporter();
-
-public:
-
- // -------------------------------------------------------------------
- /** Returns whether the class can handle the format of the given file.
- * See BaseImporter::CanRead() for details.
- */
- bool CanRead( const std::string& pFile, IOSystem* pIOHandler,
- bool checkSig) const;
-
-protected:
-
- // -------------------------------------------------------------------
- /** Called by Importer::GetExtensionList() for each loaded importer.
- * See BaseImporter::GetExtensionList() for details
- */
- void GetExtensionList(std::set<std::string>& extensions);
-
- // -------------------------------------------------------------------
- /** Imports the given file into the given scene structure.
- * See BaseImporter::InternReadFile() for details
- */
- void InternReadFile( const std::string& pFile, aiScene* pScene,
- IOSystem* pIOHandler);
-
-protected:
-
-
- // -------------------------------------------------------------------
- /** Extract vertices from the DOM
- */
- void LoadVertices(std::vector<aiVector3D>* pvOut,
- bool p_bNormals = false);
-
- // -------------------------------------------------------------------
- /** Extract vertex color channels from the DOM
- */
- void LoadVertexColor(std::vector<aiColor4D>* pvOut);
-
- // -------------------------------------------------------------------
- /** Extract texture coordinate channels from the DOM
- */
- void LoadTextureCoordinates(std::vector<aiVector2D>* pvOut);
-
- // -------------------------------------------------------------------
- /** Extract a face list from the DOM
- */
- void LoadFaces(std::vector<PLY::Face>* pvOut);
-
- // -------------------------------------------------------------------
- /** Extract a material list from the DOM
- */
- void LoadMaterial(std::vector<MaterialHelper*>* pvOut);
-
-
- // -------------------------------------------------------------------
- /** Validate material indices, replace default material identifiers
- */
- void ReplaceDefaultMaterial(std::vector<PLY::Face>* avFaces,
- std::vector<MaterialHelper*>* avMaterials);
-
-
- // -------------------------------------------------------------------
- /** Convert all meshes into our ourer representation
- */
- void ConvertMeshes(std::vector<PLY::Face>* avFaces,
- const std::vector<aiVector3D>* avPositions,
- const std::vector<aiVector3D>* avNormals,
- const std::vector<aiColor4D>* avColors,
- const std::vector<aiVector2D>* avTexCoords,
- const std::vector<MaterialHelper*>* avMaterials,
- std::vector<aiMesh*>* avOut);
-
-
- // -------------------------------------------------------------------
- /** Static helper to parse a color from four single channels in
- */
- static void GetMaterialColor(
- const std::vector<PLY::PropertyInstance>& avList,
- unsigned int aiPositions[4],
- PLY::EDataType aiTypes[4],
- aiColor4D* clrOut);
-
-
- // -------------------------------------------------------------------
- /** Static helper to parse a color channel value. The input value
- * is normalized to 0-1.
- */
- static float NormalizeColorValue (
- PLY::PropertyInstance::ValueUnion val,
- PLY::EDataType eType);
-
-
- /** Buffer to hold the loaded file */
- unsigned char* mBuffer;
-
- /** Document object model representation extracted from the file */
- PLY::DOM* pcDOM;
-};
-
-} // end of namespace Assimp
-
-#endif // AI_3DSIMPORTER_H_INC
diff --git a/3rdparty/assimp/code/PlyParser.cpp b/3rdparty/assimp/code/PlyParser.cpp
deleted file mode 100644
index d0e3fa0f..00000000
--- a/3rdparty/assimp/code/PlyParser.cpp
+++ /dev/null
@@ -1,919 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file Implementation of the PLY parser class */
-
-#include "AssimpPCH.h"
-#ifndef ASSIMP_BUILD_NO_PLY_IMPORTER
-
-#include "PlyLoader.h"
-#include "fast_atof.h"
-
-using namespace Assimp;
-
-// ------------------------------------------------------------------------------------------------
-PLY::EDataType PLY::Property::ParseDataType(const char* pCur,const char** pCurOut)
-{
- ai_assert(NULL != pCur && NULL != pCurOut);
- PLY::EDataType eOut = PLY::EDT_INVALID;
-
- if (TokenMatch(pCur,"char",4) ||
- TokenMatch(pCur,"int8",4))
- {
- eOut = PLY::EDT_Char;
- }
- else if (TokenMatch(pCur,"uchar",5) ||
- TokenMatch(pCur,"uint8",5))
- {
- eOut = PLY::EDT_UChar;
- }
- else if (TokenMatch(pCur,"short",5) ||
- TokenMatch(pCur,"int16",5))
- {
- eOut = PLY::EDT_Short;
- }
- else if (TokenMatch(pCur,"ushort",6) ||
- TokenMatch(pCur,"uint16",6))
- {
- eOut = PLY::EDT_UShort;
- }
- else if (TokenMatch(pCur,"int32",5) || TokenMatch(pCur,"int",3))
- {
- eOut = PLY::EDT_Int;
- }
- else if (TokenMatch(pCur,"uint32",6) || TokenMatch(pCur,"uint",4))
- {
- eOut = PLY::EDT_UInt;
- }
- else if (TokenMatch(pCur,"float",5) || TokenMatch(pCur,"float32",7))
- {
- eOut = PLY::EDT_Float;
- }
- else if (TokenMatch(pCur,"double64",8) || TokenMatch(pCur,"double",6) ||
- TokenMatch(pCur,"float64",7))
- {
- eOut = PLY::EDT_Double;
- }
- if (PLY::EDT_INVALID == eOut)
- {
- DefaultLogger::get()->info("Found unknown data type in PLY file. This is OK");
- }
- *pCurOut = pCur;
- return eOut;
-}
-
-// ------------------------------------------------------------------------------------------------
-PLY::ESemantic PLY::Property::ParseSemantic(const char* pCur,const char** pCurOut)
-{
- ai_assert(NULL != pCur && NULL != pCurOut);
-
- PLY::ESemantic eOut = PLY::EST_INVALID;
- if (TokenMatch(pCur,"red",3))
- {
- eOut = PLY::EST_Red;
- }
- else if (TokenMatch(pCur,"green",5))
- {
- eOut = PLY::EST_Green;
- }
- else if (TokenMatch(pCur,"blue",4))
- {
- eOut = PLY::EST_Blue;
- }
- else if (TokenMatch(pCur,"alpha",5))
- {
- eOut = PLY::EST_Alpha;
- }
- else if (TokenMatch(pCur,"vertex_index",12) || TokenMatch(pCur,"vertex_indices",14))
- {
- eOut = PLY::EST_VertexIndex;
- }
- else if (TokenMatch(pCur,"material_index",14))
- {
- eOut = PLY::EST_MaterialIndex;
- }
- else if (TokenMatch(pCur,"ambient_red",11))
- {
- eOut = PLY::EST_AmbientRed;
- }
- else if (TokenMatch(pCur,"ambient_green",13))
- {
- eOut = PLY::EST_AmbientGreen;
- }
- else if (TokenMatch(pCur,"ambient_blue",12))
- {
- eOut = PLY::EST_AmbientBlue;
- }
- else if (TokenMatch(pCur,"ambient_alpha",13))
- {
- eOut = PLY::EST_AmbientAlpha;
- }
- else if (TokenMatch(pCur,"diffuse_red",11))
- {
- eOut = PLY::EST_DiffuseRed;
- }
- else if (TokenMatch(pCur,"diffuse_green",13))
- {
- eOut = PLY::EST_DiffuseGreen;
- }
- else if (TokenMatch(pCur,"diffuse_blue",12))
- {
- eOut = PLY::EST_DiffuseBlue;
- }
- else if (TokenMatch(pCur,"diffuse_alpha",13))
- {
- eOut = PLY::EST_DiffuseAlpha;
- }
- else if (TokenMatch(pCur,"specular_red",12))
- {
- eOut = PLY::EST_SpecularRed;
- }
- else if (TokenMatch(pCur,"specular_green",14))
- {
- eOut = PLY::EST_SpecularGreen;
- }
- else if (TokenMatch(pCur,"specular_blue",13))
- {
- eOut = PLY::EST_SpecularBlue;
- }
- else if (TokenMatch(pCur,"specular_alpha",14))
- {
- eOut = PLY::EST_SpecularAlpha;
- }
- else if (TokenMatch(pCur,"opacity",7))
- {
- eOut = PLY::EST_Opacity;
- }
- else if (TokenMatch(pCur,"specular_power",6))
- {
- eOut = PLY::EST_PhongPower;
- }
- else if (TokenMatch(pCur,"r",1))
- {
- eOut = PLY::EST_Red;
- }
- else if (TokenMatch(pCur,"g",1))
- {
- eOut = PLY::EST_Green;
- }
- else if (TokenMatch(pCur,"b",1))
- {
- eOut = PLY::EST_Blue;
- }
- // NOTE: Blender3D exports texture coordinates as s,t tuples
- else if (TokenMatch(pCur,"u",1) || TokenMatch(pCur,"s",1) || TokenMatch(pCur,"tx",2))
- {
- eOut = PLY::EST_UTextureCoord;
- }
- else if (TokenMatch(pCur,"v",1) || TokenMatch(pCur,"t",1) || TokenMatch(pCur,"ty",2))
- {
- eOut = PLY::EST_VTextureCoord;
- }
- else if (TokenMatch(pCur,"x",1))
- {
- eOut = PLY::EST_XCoord;
- }
- else if (TokenMatch(pCur,"y",1))
- {
- eOut = PLY::EST_YCoord;
- }
- else if (TokenMatch(pCur,"z",1))
- {
- eOut = PLY::EST_ZCoord;
- }
- else if (TokenMatch(pCur,"nx",2))
- {
- eOut = PLY::EST_XNormal;
- }
- else if (TokenMatch(pCur,"ny",2))
- {
- eOut = PLY::EST_YNormal;
- }
- else if (TokenMatch(pCur,"nz",2))
- {
- eOut = PLY::EST_ZNormal;
- }
- else
- {
- DefaultLogger::get()->info("Found unknown property semantic in file. This is ok");
- SkipLine(&pCur);
- }
- *pCurOut = pCur;
- return eOut;
-}
-
-// ------------------------------------------------------------------------------------------------
-bool PLY::Property::ParseProperty (const char* pCur,
- const char** pCurOut,
- PLY::Property* pOut)
-{
- ai_assert(NULL != pCur && NULL != pCurOut);
-
- // Forms supported:
- // "property float x"
- // "property list uchar int vertex_index"
- *pCurOut = pCur;
-
- // skip leading spaces
- if (!SkipSpaces(pCur,&pCur))return false;
-
- // skip the "property" string at the beginning
- if (!TokenMatch(pCur,"property",8))
- {
- // seems not to be a valid property entry
- return false;
- }
- // get next word
- if (!SkipSpaces(pCur,&pCur))return false;
- if (TokenMatch(pCur,"list",4))
- {
- pOut->bIsList = true;
-
- // seems to be a list.
- if (EDT_INVALID == (pOut->eFirstType = PLY::Property::ParseDataType(pCur, &pCur)))
- {
- // unable to parse list size data type
- SkipLine(pCur,&pCur);
- *pCurOut = pCur;
- return false;
- }
- if (!SkipSpaces(pCur,&pCur))return false;
- if (EDT_INVALID == (pOut->eType = PLY::Property::ParseDataType(pCur, &pCur)))
- {
- // unable to parse list data type
- SkipLine(pCur,&pCur);
- *pCurOut = pCur;
- return false;
- }
- }
- else
- {
- if (EDT_INVALID == (pOut->eType = PLY::Property::ParseDataType(pCur, &pCur)))
- {
- // unable to parse data type. Skip the property
- SkipLine(pCur,&pCur);
- *pCurOut = pCur;
- return false;
- }
- }
-
- if (!SkipSpaces(pCur,&pCur))return false;
- const char* szCur = pCur;
- pOut->Semantic = PLY::Property::ParseSemantic(pCur, &pCur);
-
- if (PLY::EST_INVALID == pOut->Semantic)
- {
- // store the name of the semantic
- uintptr_t iDiff = (uintptr_t)pCur - (uintptr_t)szCur;
-
- DefaultLogger::get()->info("Found unknown semantic in PLY file. This is OK");
- pOut->szName = std::string(szCur,iDiff);
- }
-
- SkipSpacesAndLineEnd(pCur,&pCur);
- *pCurOut = pCur;
- return true;
-}
-
-// ------------------------------------------------------------------------------------------------
-PLY::EElementSemantic PLY::Element::ParseSemantic(const char* pCur,
- const char** pCurOut)
-{
- ai_assert(NULL != pCur && NULL != pCurOut);
- PLY::EElementSemantic eOut = PLY::EEST_INVALID;
- if (TokenMatch(pCur,"vertex",6))
- {
- eOut = PLY::EEST_Vertex;
- }
- else if (TokenMatch(pCur,"face",4))
- {
- eOut = PLY::EEST_Face;
- }
-#if 0
- // TODO: maybe implement this?
- else if (TokenMatch(pCur,"range_grid",10))
- {
- eOut = PLY::EEST_Face;
- }
-#endif
- else if (TokenMatch(pCur,"tristrips",9))
- {
- eOut = PLY::EEST_TriStrip;
- }
- else if (TokenMatch(pCur,"edge",4))
- {
- eOut = PLY::EEST_Edge;
- }
- else if (TokenMatch(pCur,"material",8))
- {
- eOut = PLY::EEST_Material;
- }
- *pCurOut = pCur;
- return eOut;
-}
-
-// ------------------------------------------------------------------------------------------------
-bool PLY::Element::ParseElement (const char* pCur,
- const char** pCurOut,
- PLY::Element* pOut)
-{
- ai_assert(NULL != pCur && NULL != pCurOut && NULL != pOut);
-
- // Example format: "element vertex 8"
- *pCurOut = pCur;
-
- // skip leading spaces
- if (!SkipSpaces(&pCur))return false;
-
- // skip the "element" string at the beginning
- if (!TokenMatch(pCur,"element",7))
- {
- // seems not to be a valid property entry
- return false;
- }
- // get next word
- if (!SkipSpaces(&pCur))return false;
-
- // parse the semantic of the element
- const char* szCur = pCur;
- pOut->eSemantic = PLY::Element::ParseSemantic(pCur,&pCur);
- if (PLY::EEST_INVALID == pOut->eSemantic)
- {
- // if the exact semantic can't be determined, just store
- // the original string identifier
- uintptr_t iDiff = (uintptr_t)pCur - (uintptr_t)szCur;
- pOut->szName = std::string(szCur,iDiff);
- }
-
- if (!SkipSpaces(&pCur))return false;
-
- //parse the number of occurences of this element
- pOut->NumOccur = strtol10(pCur,&pCur);
-
- // go to the next line
- SkipSpacesAndLineEnd(pCur,&pCur);
-
- // now parse all properties of the element
- while (true)
- {
- // skip all comments
- PLY::DOM::SkipComments(pCur,&pCur);
-
- PLY::Property prop;
- if (!PLY::Property::ParseProperty(pCur,&pCur,&prop))break;
- pOut->alProperties.push_back(prop);
- }
- *pCurOut = pCur;
- return true;
-}
-
-// ------------------------------------------------------------------------------------------------
-bool PLY::DOM::SkipComments (const char* pCur,
- const char** pCurOut)
-{
- ai_assert(NULL != pCur && NULL != pCurOut);
- *pCurOut = pCur;
-
- // skip spaces
- if (!SkipSpaces(pCur,&pCur))return false;
-
- if (TokenMatch(pCur,"comment",7))
- {
- SkipLine(pCur,&pCur);
- SkipComments(pCur,&pCur);
- *pCurOut = pCur;
- return true;
- }
- *pCurOut = pCur;
- return false;
-}
-
-// ------------------------------------------------------------------------------------------------
-bool PLY::DOM::ParseHeader (const char* pCur,const char** pCurOut)
-{
- ai_assert(NULL != pCur && NULL != pCurOut);
- DefaultLogger::get()->debug("PLY::DOM::ParseHeader() begin");
-
- // after ply and format line
- *pCurOut = pCur;
-
- // parse all elements
- while (true)
- {
- // skip all comments
- PLY::DOM::SkipComments(pCur,&pCur);
-
- PLY::Element out;
- if (PLY::Element::ParseElement(pCur,&pCur,&out))
- {
- // add the element to the list of elements
- alElements.push_back(out);
- }
- else if (TokenMatch(pCur,"end_header",10))
- {
- // we have reached the end of the header
- break;
- }
- else
- {
- // ignore unknown header elements
- SkipLine(&pCur);
- }
- }
- SkipSpacesAndLineEnd(pCur,&pCur);
- *pCurOut = pCur;
-
- DefaultLogger::get()->debug("PLY::DOM::ParseHeader() succeeded");
- return true;
-}
-
-// ------------------------------------------------------------------------------------------------
-bool PLY::DOM::ParseElementInstanceLists (
- const char* pCur,
- const char** pCurOut)
-{
- ai_assert(NULL != pCur && NULL != pCurOut);
-
- DefaultLogger::get()->debug("PLY::DOM::ParseElementInstanceLists() begin");
- *pCurOut = pCur;
-
- alElementData.resize(alElements.size());
-
- std::vector<PLY::Element>::const_iterator i = alElements.begin();
- std::vector<PLY::ElementInstanceList>::iterator a = alElementData.begin();
-
- // parse all element instances
- for (;i != alElements.end();++i,++a)
- {
- (*a).alInstances.resize((*i).NumOccur);
- PLY::ElementInstanceList::ParseInstanceList(pCur,&pCur,&(*i),&(*a));
- }
-
- DefaultLogger::get()->debug("PLY::DOM::ParseElementInstanceLists() succeeded");
- *pCurOut = pCur;
- return true;
-}
-
-// ------------------------------------------------------------------------------------------------
-bool PLY::DOM::ParseElementInstanceListsBinary (
- const char* pCur,
- const char** pCurOut,
- bool p_bBE)
-{
- ai_assert(NULL != pCur && NULL != pCurOut);
-
- DefaultLogger::get()->debug("PLY::DOM::ParseElementInstanceListsBinary() begin");
- *pCurOut = pCur;
-
- alElementData.resize(alElements.size());
-
- std::vector<PLY::Element>::const_iterator i = alElements.begin();
- std::vector<PLY::ElementInstanceList>::iterator a = alElementData.begin();
-
- // parse all element instances
- for (;i != alElements.end();++i,++a)
- {
- (*a).alInstances.resize((*i).NumOccur);
- PLY::ElementInstanceList::ParseInstanceListBinary(pCur,&pCur,&(*i),&(*a),p_bBE);
- }
-
- DefaultLogger::get()->debug("PLY::DOM::ParseElementInstanceListsBinary() succeeded");
- *pCurOut = pCur;
- return true;
-}
-
-// ------------------------------------------------------------------------------------------------
-bool PLY::DOM::ParseInstanceBinary (const char* pCur,DOM* p_pcOut,bool p_bBE)
-{
- ai_assert(NULL != pCur && NULL != p_pcOut);
-
- DefaultLogger::get()->debug("PLY::DOM::ParseInstanceBinary() begin");
-
- if (!p_pcOut->ParseHeader(pCur,&pCur))
- {
- DefaultLogger::get()->debug("PLY::DOM::ParseInstanceBinary() failure");
- return false;
- }
- if (!p_pcOut->ParseElementInstanceListsBinary(pCur,&pCur,p_bBE))
- {
- DefaultLogger::get()->debug("PLY::DOM::ParseInstanceBinary() failure");
- return false;
- }
- DefaultLogger::get()->debug("PLY::DOM::ParseInstanceBinary() succeeded");
- return true;
-}
-
-// ------------------------------------------------------------------------------------------------
-bool PLY::DOM::ParseInstance (const char* pCur,DOM* p_pcOut)
-{
- ai_assert(NULL != pCur);
- ai_assert(NULL != p_pcOut);
-
- DefaultLogger::get()->debug("PLY::DOM::ParseInstance() begin");
-
-
- if (!p_pcOut->ParseHeader(pCur,&pCur))
- {
- DefaultLogger::get()->debug("PLY::DOM::ParseInstance() failure");
- return false;
- }
- if (!p_pcOut->ParseElementInstanceLists(pCur,&pCur))
- {
- DefaultLogger::get()->debug("PLY::DOM::ParseInstance() failure");
- return false;
- }
- DefaultLogger::get()->debug("PLY::DOM::ParseInstance() succeeded");
- return true;
-}
-
-// ------------------------------------------------------------------------------------------------
-bool PLY::ElementInstanceList::ParseInstanceList (
- const char* pCur,
- const char** pCurOut,
- const PLY::Element* pcElement,
- PLY::ElementInstanceList* p_pcOut)
-{
- ai_assert(NULL != pCur && NULL != pCurOut && NULL != pcElement && NULL != p_pcOut);
-
- if (EEST_INVALID == pcElement->eSemantic || pcElement->alProperties.empty())
- {
- // if the element has an unknown semantic we can skip all lines
- // However, there could be comments
- for (unsigned int i = 0; i < pcElement->NumOccur;++i)
- {
- PLY::DOM::SkipComments(pCur,&pCur);
- SkipLine(pCur,&pCur);
- }
- }
- else
- {
- // be sure to have enough storage
- for (unsigned int i = 0; i < pcElement->NumOccur;++i)
- {
- PLY::DOM::SkipComments(pCur,&pCur);
- PLY::ElementInstance::ParseInstance(pCur, &pCur,pcElement,
- &p_pcOut->alInstances[i]);
- }
- }
- *pCurOut = pCur;
- return true;
-}
-
-// ------------------------------------------------------------------------------------------------
-bool PLY::ElementInstanceList::ParseInstanceListBinary (
- const char* pCur,
- const char** pCurOut,
- const PLY::Element* pcElement,
- PLY::ElementInstanceList* p_pcOut,
- bool p_bBE /* = false */)
-{
- ai_assert(NULL != pCur && NULL != pCurOut && NULL != pcElement && NULL != p_pcOut);
-
- // we can add special handling code for unknown element semantics since
- // we can't skip it as a whole block (we don't know its exact size
- // due to the fact that lists could be contained in the property list
- // of the unknown element)
- for (unsigned int i = 0; i < pcElement->NumOccur;++i)
- {
- PLY::ElementInstance::ParseInstanceBinary(pCur, &pCur,pcElement,
- &p_pcOut->alInstances[i], p_bBE);
- }
- *pCurOut = pCur;
- return true;
-}
-
-// ------------------------------------------------------------------------------------------------
-bool PLY::ElementInstance::ParseInstance (
- const char* pCur,
- const char** pCurOut,
- const PLY::Element* pcElement,
- PLY::ElementInstance* p_pcOut)
-{
- ai_assert(NULL != pCur && NULL != pCurOut && NULL != pcElement && NULL != p_pcOut);
-
- if (!SkipSpaces(pCur, &pCur))return false;
-
- // allocate enough storage
- p_pcOut->alProperties.resize(pcElement->alProperties.size());
-
- std::vector<PLY::PropertyInstance>::iterator i = p_pcOut->alProperties.begin();
- std::vector<PLY::Property>::const_iterator a = pcElement->alProperties.begin();
- for (;i != p_pcOut->alProperties.end();++i,++a)
- {
- if (!(PLY::PropertyInstance::ParseInstance(pCur, &pCur,&(*a),&(*i))))
- {
- DefaultLogger::get()->warn("Unable to parse property instance. "
- "Skipping this element instance");
-
- // skip the rest of the instance
- SkipLine(pCur, &pCur);
-
- PLY::PropertyInstance::ValueUnion v = PLY::PropertyInstance::DefaultValue((*a).eType);
- (*i).avList.push_back(v);
- }
- }
- *pCurOut = pCur;
- return true;
-}
-
-// ------------------------------------------------------------------------------------------------
-bool PLY::ElementInstance::ParseInstanceBinary (
- const char* pCur,
- const char** pCurOut,
- const PLY::Element* pcElement,
- PLY::ElementInstance* p_pcOut,
- bool p_bBE /* = false */)
-{
- ai_assert(NULL != pCur && NULL != pCurOut && NULL != pcElement && NULL != p_pcOut);
-
- // allocate enough storage
- p_pcOut->alProperties.resize(pcElement->alProperties.size());
-
- std::vector<PLY::PropertyInstance>::iterator i = p_pcOut->alProperties.begin();
- std::vector<PLY::Property>::const_iterator a = pcElement->alProperties.begin();
- for (;i != p_pcOut->alProperties.end();++i,++a)
- {
- if (!(PLY::PropertyInstance::ParseInstanceBinary(pCur, &pCur,&(*a),&(*i),p_bBE)))
- {
- DefaultLogger::get()->warn("Unable to parse binary property instance. "
- "Skipping this element instance");
-
- (*i).avList.push_back(PLY::PropertyInstance::DefaultValue((*a).eType));
- }
- }
- *pCurOut = pCur;
- return true;
-}
-
-// ------------------------------------------------------------------------------------------------
-bool PLY::PropertyInstance::ParseInstance (const char* pCur,const char** pCurOut,
- const PLY::Property* prop, PLY::PropertyInstance* p_pcOut)
-{
- ai_assert(NULL != pCur && NULL != pCurOut && NULL != prop && NULL != p_pcOut);
-
- *pCurOut = pCur;
-
- // skip spaces at the beginning
- if (!SkipSpaces(pCur, &pCur))return false;
-
- if (prop->bIsList)
- {
- // parse the number of elements in the list
- PLY::PropertyInstance::ValueUnion v;
- PLY::PropertyInstance::ParseValue(pCur, &pCur,prop->eFirstType,&v);
-
- // convert to unsigned int
- unsigned int iNum = PLY::PropertyInstance::ConvertTo<unsigned int>(v,prop->eFirstType);
-
- // parse all list elements
- p_pcOut->avList.resize(iNum);
- for (unsigned int i = 0; i < iNum;++i)
- {
- if (!SkipSpaces(pCur, &pCur))return false;
- PLY::PropertyInstance::ParseValue(pCur, &pCur,prop->eType,&p_pcOut->avList[i]);
- }
- }
- else
- {
- // parse the property
- PLY::PropertyInstance::ValueUnion v;
-
- PLY::PropertyInstance::ParseValue(pCur, &pCur,prop->eType,&v);
- p_pcOut->avList.push_back(v);
- }
- SkipSpacesAndLineEnd(pCur, &pCur);
- *pCurOut = pCur;
- return true;
-}
-
-// ------------------------------------------------------------------------------------------------
-bool PLY::PropertyInstance::ParseInstanceBinary (
- const char* pCur,
- const char** pCurOut,
- const PLY::Property* prop,
- PLY::PropertyInstance* p_pcOut,
- bool p_bBE)
-{
- ai_assert(NULL != pCur && NULL != pCurOut && NULL != prop && NULL != p_pcOut);
-
- if (prop->bIsList)
- {
- // parse the number of elements in the list
- PLY::PropertyInstance::ValueUnion v;
- PLY::PropertyInstance::ParseValueBinary(pCur, &pCur,prop->eFirstType,&v,p_bBE);
-
- // convert to unsigned int
- unsigned int iNum = PLY::PropertyInstance::ConvertTo<unsigned int>(v,prop->eFirstType);
-
- // parse all list elements
- p_pcOut->avList.resize(iNum);
- for (unsigned int i = 0; i < iNum;++i){
- PLY::PropertyInstance::ParseValueBinary(pCur, &pCur,prop->eType,&p_pcOut->avList[i],p_bBE);
- }
- }
- else
- {
- // parse the property
- PLY::PropertyInstance::ValueUnion v;
- PLY::PropertyInstance::ParseValueBinary(pCur, &pCur,prop->eType,&v,p_bBE);
- p_pcOut->avList.push_back(v);
- }
- *pCurOut = pCur;
- return true;
-}
-
-// ------------------------------------------------------------------------------------------------
-PLY::PropertyInstance::ValueUnion PLY::PropertyInstance::DefaultValue(
- PLY::EDataType eType)
-{
- PLY::PropertyInstance::ValueUnion out;
-
- switch (eType)
- {
- case EDT_Float:
- out.fFloat = 0.f;
- return out;
-
- case EDT_Double:
- out.fDouble = 0.;
- return out;
-
- default: ;
- };
- out.iUInt = 0;
- return out;
-}
-
-// ------------------------------------------------------------------------------------------------
-bool PLY::PropertyInstance::ParseValue(
- const char* pCur,
- const char** pCurOut,
- PLY::EDataType eType,
- PLY::PropertyInstance::ValueUnion* out)
-{
- ai_assert(NULL != pCur && NULL != pCurOut && NULL != out);
-
- register bool ret = true;
- *pCurOut = pCur;
- switch (eType)
- {
- case EDT_UInt:
- case EDT_UShort:
- case EDT_UChar:
-
- out->iUInt = (uint32_t)strtol10(pCur, &pCur);
- break;
-
- case EDT_Int:
- case EDT_Short:
- case EDT_Char:
-
- out->iInt = (int32_t)strtol10s(pCur, &pCur);
- break;
-
- case EDT_Float:
-
- pCur = fast_atof_move(pCur,out->fFloat);
- break;
-
- case EDT_Double:
-
- float f;
- pCur = fast_atof_move(pCur,f);
- out->fDouble = (double)f;
- break;
-
- default:
- ret = false;
- }
- *pCurOut = pCur;
- return ret;
-}
-
-// ------------------------------------------------------------------------------------------------
-bool PLY::PropertyInstance::ParseValueBinary(
- const char* pCur,
- const char** pCurOut,
- PLY::EDataType eType,
- PLY::PropertyInstance::ValueUnion* out,
- bool p_bBE)
-{
- ai_assert(NULL != pCur && NULL != pCurOut && NULL != out);
-
- register bool ret = true;
- switch (eType)
- {
- case EDT_UInt:
- out->iUInt = (uint32_t)*((uint32_t*)pCur);
- pCur += 4;
-
- // Swap endianess
- if (p_bBE)ByteSwap::Swap((int32_t*)&out->iUInt);
- break;
-
- case EDT_UShort:
- {
- int16_t i = *((uint16_t*)pCur);
-
- // Swap endianess
- if (p_bBE)ByteSwap::Swap(&i);
- out->iUInt = (uint32_t)i;
- pCur += 2;
- break;
- }
-
- case EDT_UChar:
- {
- out->iUInt = (uint32_t)(*((uint8_t*)pCur));
- pCur ++;
- break;
- }
-
- case EDT_Int:
- out->iInt = *((int32_t*)pCur);
- pCur += 4;
-
- // Swap endianess
- if (p_bBE)ByteSwap::Swap(&out->iInt);
- break;
-
- case EDT_Short:
- {
- int16_t i = *((int16_t*)pCur);
-
- // Swap endianess
- if (p_bBE)ByteSwap::Swap(&i);
- out->iInt = (int32_t)i;
- pCur += 2;
- break;
- }
-
- case EDT_Char:
- out->iInt = (int32_t)*((int8_t*)pCur);
- pCur ++;
- break;
-
- case EDT_Float:
- {
- out->fFloat = *((float*)pCur);
-
- // Swap endianess
- if (p_bBE)ByteSwap::Swap((int32_t*)&out->fFloat);
- pCur += 4;
- break;
- }
- case EDT_Double:
- {
- out->fDouble = *((double*)pCur);
-
- // Swap endianess
- if (p_bBE)ByteSwap::Swap((int64_t*)&out->fDouble);
- pCur += 8;
- break;
- }
- default:
- ret = false;
- }
- *pCurOut = pCur;
- return ret;
-}
-
-#endif // !! ASSIMP_BUILD_NO_PLY_IMPORTER
diff --git a/3rdparty/assimp/code/PlyParser.h b/3rdparty/assimp/code/PlyParser.h
deleted file mode 100644
index 5b95442a..00000000
--- a/3rdparty/assimp/code/PlyParser.h
+++ /dev/null
@@ -1,501 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-
-/** @file Defines the helper data structures for importing PLY files */
-#ifndef AI_PLYFILEHELPER_H_INC
-#define AI_PLYFILEHELPER_H_INC
-
-
-#include "ParsingUtils.h"
-
-
-namespace Assimp
-{
-
-// http://local.wasp.uwa.edu.au/~pbourke/dataformats/ply/
-// http://w3.impa.br/~lvelho/outgoing/sossai/old/ViHAP_D4.4.2_PLY_format_v1.1.pdf
-// http://www.okino.com/conv/exp_ply.htm
-namespace PLY
-{
-
-
-// ---------------------------------------------------------------------------------
-/*
-name type number of bytes
----------------------------------------
-char character 1
-uchar unsigned character 1
-short short integer 2
-ushort unsigned short integer 2
-int integer 4
-uint unsigned integer 4
-float single-precision float 4
-double double-precision float 8
-
-int8
-int16
-uint8 ... forms are also used
-*/
-enum EDataType
-{
- EDT_Char = 0x0u,
- EDT_UChar,
- EDT_Short,
- EDT_UShort,
- EDT_Int,
- EDT_UInt,
- EDT_Float,
- EDT_Double,
-
- // Marks invalid entries
- EDT_INVALID
-};
-
-// ---------------------------------------------------------------------------------
-/** \brief Specifies semantics for PLY element properties
- *
- * Semantics define the usage of a property, e.g. x coordinate
-*/
-enum ESemantic
-{
- //! vertex position x coordinate
- EST_XCoord = 0x0u,
- //! vertex position x coordinate
- EST_YCoord,
- //! vertex position x coordinate
- EST_ZCoord,
-
- //! vertex normal x coordinate
- EST_XNormal,
- //! vertex normal y coordinate
- EST_YNormal,
- //! vertex normal z coordinate
- EST_ZNormal,
-
- //! u texture coordinate
- EST_UTextureCoord,
- //! v texture coordinate
- EST_VTextureCoord,
-
- //! vertex colors, red channel
- EST_Red,
- //! vertex colors, green channel
- EST_Green,
- //! vertex colors, blue channel
- EST_Blue,
- //! vertex colors, alpha channel
- EST_Alpha,
-
- //! vertex index list
- EST_VertexIndex,
-
- //! texture index
- EST_TextureIndex,
-
- //! texture coordinates (stored as element of a face)
- EST_TextureCoordinates,
-
- //! material index
- EST_MaterialIndex,
-
- //! ambient color, red channel
- EST_AmbientRed,
- //! ambient color, green channel
- EST_AmbientGreen,
- //! ambient color, blue channel
- EST_AmbientBlue,
- //! ambient color, alpha channel
- EST_AmbientAlpha,
-
- //! diffuse color, red channel
- EST_DiffuseRed,
- //! diffuse color, green channel
- EST_DiffuseGreen,
- //! diffuse color, blue channel
- EST_DiffuseBlue,
- //! diffuse color, alpha channel
- EST_DiffuseAlpha,
-
- //! specular color, red channel
- EST_SpecularRed,
- //! specular color, green channel
- EST_SpecularGreen,
- //! specular color, blue channel
- EST_SpecularBlue,
- //! specular color, alpha channel
- EST_SpecularAlpha,
-
- //! specular power for phong shading
- EST_PhongPower,
-
- //! opacity between 0 and 1
- EST_Opacity,
-
- //! Marks invalid entries
- EST_INVALID
-};
-
-// ---------------------------------------------------------------------------------
-/** \brief Specifies semantics for PLY elements
- *
- * Semantics define the usage of an element, e.g. vertex or material
-*/
-enum EElementSemantic
-{
- //! The element is a vertex
- EEST_Vertex = 0x0u,
-
- //! The element is a face description (index table)
- EEST_Face,
-
- //! The element is a tristrip description (index table)
- EEST_TriStrip,
-
- //! The element is an edge description (ignored)
- EEST_Edge,
-
- //! The element is a material description
- EEST_Material,
-
- //! Marks invalid entries
- EEST_INVALID
-};
-
-// ---------------------------------------------------------------------------------
-/** \brief Helper class for a property in a PLY file.
- *
- * This can e.g. be a part of the vertex declaration
- */
-class Property
-{
-public:
-
- //! Default constructor
- Property()
- : eType (EDT_Int), bIsList(false), eFirstType(EDT_UChar)
- {}
-
- //! Data type of the property
- EDataType eType;
-
- //! Semantical meaning of the property
- ESemantic Semantic;
-
- //! Of the semantic of the property could not be parsed:
- //! Contains the semantic specified in the file
- std::string szName;
-
- //! Specifies whether the data type is a list where
- //! the first element specifies the size of the list
- bool bIsList;
- EDataType eFirstType;
-
- // -------------------------------------------------------------------
- //! Parse a property from a string. The end of the
- //! string is either '\n', '\r' or '\0'. Return valie is false
- //! if the input string is NOT a valid property (E.g. does
- //! not start with the "property" keyword)
- static bool ParseProperty (const char* pCur, const char** pCurOut,
- Property* pOut);
-
- // -------------------------------------------------------------------
- //! Parse a data type from a string
- static EDataType ParseDataType(const char* pCur,const char** pCurOut);
-
- // -------------------------------------------------------------------
- //! Parse a semantic from a string
- static ESemantic ParseSemantic(const char* pCur,const char** pCurOut);
-};
-
-// ---------------------------------------------------------------------------------
-/** \brief Helper class for an element in a PLY file.
- *
- * This can e.g. be the vertex declaration. Elements contain a
- * well-defined number of properties.
- */
-class Element
-{
-public:
-
- //! Default constructor
- Element()
- : eSemantic (EEST_INVALID)
- , NumOccur(0)
- {}
-
- //! List of properties assigned to the element
- //! std::vector to support operator[]
- std::vector<Property> alProperties;
-
- //! Semantic of the element
- EElementSemantic eSemantic;
-
- //! Of the semantic of the element could not be parsed:
- //! Contains the semantic specified in the file
- std::string szName;
-
- //! How many times will the element occur?
- unsigned int NumOccur;
-
-
- // -------------------------------------------------------------------
- //! Parse an element from a string.
- //! The function will parse all properties contained in the
- //! element, too.
- static bool ParseElement (const char* pCur, const char** pCurOut,
- Element* pOut);
-
- // -------------------------------------------------------------------
- //! Parse a semantic from a string
- static EElementSemantic ParseSemantic(const char* pCur,
- const char** pCurOut);
-};
-
-// ---------------------------------------------------------------------------------
-/** \brief Instance of a property in a PLY file
- */
-class PropertyInstance
-{
-public:
-
- //! Default constructor
- PropertyInstance ()
- {}
-
- union ValueUnion
- {
-
- //! uInt32 representation of the property. All
- // uint types are automatically converted to uint32
- uint32_t iUInt;
-
- //! Int32 representation of the property. All
- // int types are automatically converted to int32
- int32_t iInt;
-
- //! Float32 representation of the property
- float fFloat;
-
- //! Float64 representation of the property
- double fDouble;
-
- };
-
- // -------------------------------------------------------------------
- //! List of all values parsed. Contains only one value
- // for non-list properties
- std::vector<ValueUnion> avList;
-
- // -------------------------------------------------------------------
- //! Parse a property instance
- static bool ParseInstance (const char* pCur,const char** pCurOut,
- const Property* prop, PropertyInstance* p_pcOut);
-
- // -------------------------------------------------------------------
- //! Parse a property instance in binary format
- static bool ParseInstanceBinary (const char* pCur,const char** pCurOut,
- const Property* prop, PropertyInstance* p_pcOut,bool p_bBE);
-
- // -------------------------------------------------------------------
- //! Get the default value for a given data type
- static ValueUnion DefaultValue(EDataType eType);
-
- // -------------------------------------------------------------------
- //! Parse a value
- static bool ParseValue(const char* pCur,const char** pCurOut,
- EDataType eType,ValueUnion* out);
-
- // -------------------------------------------------------------------
- //! Parse a binary value
- static bool ParseValueBinary(const char* pCur,const char** pCurOut,
- EDataType eType,ValueUnion* out,bool p_bBE);
-
- // -------------------------------------------------------------------
- //! Convert a property value to a given type TYPE
- template <typename TYPE>
- static TYPE ConvertTo(ValueUnion v, EDataType eType);
-};
-
-// ---------------------------------------------------------------------------------
-/** \brief Class for an element instance in a PLY file
- */
-class ElementInstance
-{
-public:
-
- //! Default constructor
- ElementInstance ()
- {}
-
- //! List of all parsed properties
- std::vector< PropertyInstance > alProperties;
-
- // -------------------------------------------------------------------
- //! Parse an element instance
- static bool ParseInstance (const char* pCur,const char** pCurOut,
- const Element* pcElement, ElementInstance* p_pcOut);
-
- // -------------------------------------------------------------------
- //! Parse a binary element instance
- static bool ParseInstanceBinary (const char* pCur,const char** pCurOut,
- const Element* pcElement, ElementInstance* p_pcOut,bool p_bBE);
-};
-
-// ---------------------------------------------------------------------------------
-/** \brief Class for an element instance list in a PLY file
- */
-class ElementInstanceList
-{
-public:
-
- //! Default constructor
- ElementInstanceList ()
- {}
-
- //! List of all element instances
- std::vector< ElementInstance > alInstances;
-
- // -------------------------------------------------------------------
- //! Parse an element instance list
- static bool ParseInstanceList (const char* pCur,const char** pCurOut,
- const Element* pcElement, ElementInstanceList* p_pcOut);
-
- // -------------------------------------------------------------------
- //! Parse a binary element instance list
- static bool ParseInstanceListBinary (const char* pCur,const char** pCurOut,
- const Element* pcElement, ElementInstanceList* p_pcOut,bool p_bBE);
-};
-// ---------------------------------------------------------------------------------
-/** \brief Class to represent the document object model of an ASCII or binary
- * (both little and big-endian) PLY file
- */
-class DOM
-{
-public:
-
- //! Default constructor
- DOM()
- {}
-
-
- //! Contains all elements of the file format
- std::vector<Element> alElements;
- //! Contains the real data of each element's instance list
- std::vector<ElementInstanceList> alElementData;
-
- //! Parse the DOM for a PLY file. The input string is assumed
- //! to be terminated with zero
- static bool ParseInstance (const char* pCur,DOM* p_pcOut);
- static bool ParseInstanceBinary (const char* pCur,
- DOM* p_pcOut,bool p_bBE);
-
- //! Skip all comment lines after this
- static bool SkipComments (const char* pCur,const char** pCurOut);
-
-private:
-
- // -------------------------------------------------------------------
- //! Handle the file header and read all element descriptions
- bool ParseHeader (const char* pCur,const char** pCurOut);
-
- // -------------------------------------------------------------------
- //! Read in all element instance lists
- bool ParseElementInstanceLists (const char* pCur,const char** pCurOut);
-
- // -------------------------------------------------------------------
- //! Read in all element instance lists for a binary file format
- bool ParseElementInstanceListsBinary (const char* pCur,
- const char** pCurOut,bool p_bBE);
-};
-
-// ---------------------------------------------------------------------------------
-/** \brief Helper class to represent a loaded PLY face
- */
-class Face
-{
-public:
-
- Face()
- : iMaterialIndex(0xFFFFFFFF)
- {
- // set all indices to zero by default
- mIndices.resize(3,0);
- }
-
-public:
-
- //! List of vertex indices
- std::vector<unsigned int> mIndices;
-
- //! Material index
- unsigned int iMaterialIndex;
-};
-
-// ---------------------------------------------------------------------------------
-template <typename TYPE>
-inline TYPE PLY::PropertyInstance::ConvertTo(
- PLY::PropertyInstance::ValueUnion v, PLY::EDataType eType)
-{
- switch (eType)
- {
- case EDT_Float:
- return (TYPE)v.fFloat;
- case EDT_Double:
- return (TYPE)v.fDouble;
-
- case EDT_UInt:
- case EDT_UShort:
- case EDT_UChar:
- return (TYPE)v.iUInt;
-
- case EDT_Int:
- case EDT_Short:
- case EDT_Char:
- return (TYPE)v.iInt;
- default: ;
- };
- return (TYPE)0;
-}
-
-} // Namespace PLY
-} // Namespace AssImp
-
-#endif // !! include guard
diff --git a/3rdparty/assimp/code/PretransformVertices.cpp b/3rdparty/assimp/code/PretransformVertices.cpp
deleted file mode 100644
index cd97b4a6..00000000
--- a/3rdparty/assimp/code/PretransformVertices.cpp
+++ /dev/null
@@ -1,711 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file PretransformVertices.cpp
- * @brief Implementation of the "PretransformVertices" post processing step
-*/
-
-#include "AssimpPCH.h"
-#include "PretransformVertices.h"
-#include "ProcessHelper.h"
-#include "SceneCombiner.h"
-
-using namespace Assimp;
-
-// some array offsets
-#define AI_PTVS_VERTEX 0x0
-#define AI_PTVS_FACE 0x1
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-PretransformVertices::PretransformVertices()
-: configKeepHierarchy (false)
-{
-}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-PretransformVertices::~PretransformVertices()
-{
- // nothing to do here
-}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the processing step is present in the given flag field.
-bool PretransformVertices::IsActive( unsigned int pFlags) const
-{
- return (pFlags & aiProcess_PreTransformVertices) != 0;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Setup import configuration
-void PretransformVertices::SetupProperties(const Importer* pImp)
-{
- // Get the current value of AI_CONFIG_PP_PTV_KEEP_HIERARCHY and AI_CONFIG_PP_PTV_NORMALIZE
- configKeepHierarchy = (0 != pImp->GetPropertyInteger(AI_CONFIG_PP_PTV_KEEP_HIERARCHY,0));
- configNormalize = (0 != pImp->GetPropertyInteger(AI_CONFIG_PP_PTV_NORMALIZE,0));
-}
-
-// ------------------------------------------------------------------------------------------------
-// Count the number of nodes
-unsigned int PretransformVertices::CountNodes( aiNode* pcNode )
-{
- unsigned int iRet = 1;
- for (unsigned int i = 0;i < pcNode->mNumChildren;++i)
- {
- iRet += CountNodes(pcNode->mChildren[i]);
- }
- return iRet;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Get a bitwise combination identifying the vertex format of a mesh
-unsigned int PretransformVertices::GetMeshVFormat(aiMesh* pcMesh)
-{
- // the vertex format is stored in aiMesh::mBones for later retrieval.
- // there isn't a good reason to compute it a few hundred times
- // from scratch. The pointer is unused as animations are lost
- // during PretransformVertices.
- if (pcMesh->mBones)
- return (unsigned int)(uint64_t)pcMesh->mBones;
-
-
- const unsigned int iRet = GetMeshVFormatUnique(pcMesh);
-
- // store the value for later use
- pcMesh->mBones = (aiBone**)(uint64_t)iRet;
- return iRet;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Count the number of vertices in the whole scene and a given
-// material index
-void PretransformVertices::CountVerticesAndFaces( aiScene* pcScene, aiNode* pcNode, unsigned int iMat,
- unsigned int iVFormat, unsigned int* piFaces, unsigned int* piVertices)
-{
- for (unsigned int i = 0; i < pcNode->mNumMeshes;++i)
- {
- aiMesh* pcMesh = pcScene->mMeshes[ pcNode->mMeshes[i] ];
- if (iMat == pcMesh->mMaterialIndex && iVFormat == GetMeshVFormat(pcMesh))
- {
- *piVertices += pcMesh->mNumVertices;
- *piFaces += pcMesh->mNumFaces;
- }
- }
- for (unsigned int i = 0;i < pcNode->mNumChildren;++i)
- {
- CountVerticesAndFaces(pcScene,pcNode->mChildren[i],iMat,
- iVFormat,piFaces,piVertices);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Collect vertex/face data
-void PretransformVertices::CollectData( aiScene* pcScene, aiNode* pcNode, unsigned int iMat,
- unsigned int iVFormat, aiMesh* pcMeshOut,
- unsigned int aiCurrent[2], unsigned int* num_refs)
-{
- // No need to multiply if there's no transformation
- const bool identity = pcNode->mTransformation.IsIdentity();
- for (unsigned int i = 0; i < pcNode->mNumMeshes;++i)
- {
- aiMesh* pcMesh = pcScene->mMeshes[ pcNode->mMeshes[i] ];
- if (iMat == pcMesh->mMaterialIndex && iVFormat == GetMeshVFormat(pcMesh))
- {
- // Decrement mesh reference counter
- unsigned int& num_ref = num_refs[pcNode->mMeshes[i]];
- ai_assert(0 != num_ref);
- --num_ref;
-
- if (identity) {
- // copy positions without modifying them
- ::memcpy(pcMeshOut->mVertices + aiCurrent[AI_PTVS_VERTEX],
- pcMesh->mVertices,
- pcMesh->mNumVertices * sizeof(aiVector3D));
-
- if (iVFormat & 0x2) {
- // copy normals without modifying them
- ::memcpy(pcMeshOut->mNormals + aiCurrent[AI_PTVS_VERTEX],
- pcMesh->mNormals,
- pcMesh->mNumVertices * sizeof(aiVector3D));
- }
- if (iVFormat & 0x4)
- {
- // copy tangents without modifying them
- ::memcpy(pcMeshOut->mTangents + aiCurrent[AI_PTVS_VERTEX],
- pcMesh->mTangents,
- pcMesh->mNumVertices * sizeof(aiVector3D));
- // copy bitangents without modifying them
- ::memcpy(pcMeshOut->mBitangents + aiCurrent[AI_PTVS_VERTEX],
- pcMesh->mBitangents,
- pcMesh->mNumVertices * sizeof(aiVector3D));
- }
- }
- else
- {
- // copy positions, transform them to worldspace
- for (unsigned int n = 0; n < pcMesh->mNumVertices;++n) {
- pcMeshOut->mVertices[aiCurrent[AI_PTVS_VERTEX]+n] = pcNode->mTransformation * pcMesh->mVertices[n];
- }
- aiMatrix4x4 mWorldIT = pcNode->mTransformation;
- mWorldIT.Inverse().Transpose();
-
- // TODO: implement Inverse() for aiMatrix3x3
- aiMatrix3x3 m = aiMatrix3x3(mWorldIT);
-
- if (iVFormat & 0x2)
- {
- // copy normals, transform them to worldspace
- for (unsigned int n = 0; n < pcMesh->mNumVertices;++n) {
- pcMeshOut->mNormals[aiCurrent[AI_PTVS_VERTEX]+n] =
- m * pcMesh->mNormals[n];
- }
- }
- if (iVFormat & 0x4)
- {
- // copy tangents and bitangents, transform them to worldspace
- for (unsigned int n = 0; n < pcMesh->mNumVertices;++n) {
- pcMeshOut->mTangents [aiCurrent[AI_PTVS_VERTEX]+n] = m * pcMesh->mTangents[n];
- pcMeshOut->mBitangents[aiCurrent[AI_PTVS_VERTEX]+n] = m * pcMesh->mBitangents[n];
- }
- }
- }
- unsigned int p = 0;
- while (iVFormat & (0x100 << p))
- {
- // copy texture coordinates
- memcpy(pcMeshOut->mTextureCoords[p] + aiCurrent[AI_PTVS_VERTEX],
- pcMesh->mTextureCoords[p],
- pcMesh->mNumVertices * sizeof(aiVector3D));
- ++p;
- }
- p = 0;
- while (iVFormat & (0x1000000 << p))
- {
- // copy vertex colors
- memcpy(pcMeshOut->mColors[p] + aiCurrent[AI_PTVS_VERTEX],
- pcMesh->mColors[p],
- pcMesh->mNumVertices * sizeof(aiColor4D));
- ++p;
- }
- // now we need to copy all faces. since we will delete the source mesh afterwards,
- // we don't need to reallocate the array of indices except if this mesh is
- // referenced multiple times.
- for (unsigned int planck = 0;planck < pcMesh->mNumFaces;++planck)
- {
- aiFace& f_src = pcMesh->mFaces[planck];
- aiFace& f_dst = pcMeshOut->mFaces[aiCurrent[AI_PTVS_FACE]+planck];
-
- const unsigned int num_idx = f_src.mNumIndices;
-
- f_dst.mNumIndices = num_idx;
-
- unsigned int* pi;
- if (!num_ref) { /* if last time the mesh is referenced -> no reallocation */
- pi = f_dst.mIndices = f_src.mIndices;
-
- // offset all vertex indices
- for (unsigned int hahn = 0; hahn < num_idx;++hahn){
- pi[hahn] += aiCurrent[AI_PTVS_VERTEX];
- }
- }
- else {
- pi = f_dst.mIndices = new unsigned int[num_idx];
-
- // copy and offset all vertex indices
- for (unsigned int hahn = 0; hahn < num_idx;++hahn){
- pi[hahn] = f_src.mIndices[hahn] + aiCurrent[AI_PTVS_VERTEX];
- }
- }
-
- // Update the mPrimitiveTypes member of the mesh
- switch (pcMesh->mFaces[planck].mNumIndices)
- {
- case 0x1:
- pcMeshOut->mPrimitiveTypes |= aiPrimitiveType_POINT;
- break;
- case 0x2:
- pcMeshOut->mPrimitiveTypes |= aiPrimitiveType_LINE;
- break;
- case 0x3:
- pcMeshOut->mPrimitiveTypes |= aiPrimitiveType_TRIANGLE;
- break;
- default:
- pcMeshOut->mPrimitiveTypes |= aiPrimitiveType_POLYGON;
- break;
- };
- }
- aiCurrent[AI_PTVS_VERTEX] += pcMesh->mNumVertices;
- aiCurrent[AI_PTVS_FACE] += pcMesh->mNumFaces;
- }
- }
-
- // append all children of us
- for (unsigned int i = 0;i < pcNode->mNumChildren;++i) {
- CollectData(pcScene,pcNode->mChildren[i],iMat,
- iVFormat,pcMeshOut,aiCurrent,num_refs);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Get a list of all vertex formats that occur for a given material index
-// The output list contains duplicate elements
-void PretransformVertices::GetVFormatList( aiScene* pcScene, unsigned int iMat,
- std::list<unsigned int>& aiOut)
-{
- for (unsigned int i = 0; i < pcScene->mNumMeshes;++i)
- {
- aiMesh* pcMesh = pcScene->mMeshes[ i ];
- if (iMat == pcMesh->mMaterialIndex) {
- aiOut.push_back(GetMeshVFormat(pcMesh));
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Compute the absolute transformation matrices of each node
-void PretransformVertices::ComputeAbsoluteTransform( aiNode* pcNode )
-{
- if (pcNode->mParent) {
- pcNode->mTransformation = pcNode->mParent->mTransformation*pcNode->mTransformation;
- }
-
- for (unsigned int i = 0;i < pcNode->mNumChildren;++i) {
- ComputeAbsoluteTransform(pcNode->mChildren[i]);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Apply the node transformation to a mesh
-void PretransformVertices::ApplyTransform(aiMesh* mesh, const aiMatrix4x4& mat)
-{
- // Check whether we need to transform the coordinates at all
- if (!mat.IsIdentity()) {
-
- if (mesh->HasPositions()) {
- for (unsigned int i = 0; i < mesh->mNumVertices; ++i) {
- mesh->mVertices[i] = mat * mesh->mVertices[i];
- }
- }
- if (mesh->HasNormals() || mesh->HasTangentsAndBitangents()) {
- aiMatrix4x4 mWorldIT = mat;
- mWorldIT.Inverse().Transpose();
-
- // TODO: implement Inverse() for aiMatrix3x3
- aiMatrix3x3 m = aiMatrix3x3(mWorldIT);
-
- if (mesh->HasNormals()) {
- for (unsigned int i = 0; i < mesh->mNumVertices; ++i) {
- mesh->mNormals[i] = m * mesh->mNormals[i];
- }
- }
- if (mesh->HasTangentsAndBitangents()) {
- for (unsigned int i = 0; i < mesh->mNumVertices; ++i) {
- mesh->mTangents[i] = m * mesh->mTangents[i];
- mesh->mBitangents[i] = m * mesh->mBitangents[i];
- }
- }
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Simple routine to build meshes in worldspace, no further optimization
-void PretransformVertices::BuildWCSMeshes(std::vector<aiMesh*>& out, aiMesh** in,
- unsigned int numIn, aiNode* node)
-{
- // NOTE:
- // aiMesh::mNumBones store original source mesh, or 0xffffffff if not a copy
- // aiMesh::mBones store reference to abs. transform we multiplied with
-
- // process meshes
- for (unsigned int i = 0; i < node->mNumMeshes;++i) {
- aiMesh* mesh = in[node->mMeshes[i]];
-
- // check whether we can operate on this mesh
- if (!mesh->mBones || *reinterpret_cast<aiMatrix4x4*>(mesh->mBones) == node->mTransformation) {
- // yes, we can.
- mesh->mBones = reinterpret_cast<aiBone**> (&node->mTransformation);
- mesh->mNumBones = 0xffffffff;
- }
- else {
-
- // try to find us in the list of newly created meshes
- for (unsigned int n = 0; n < out.size(); ++n) {
- aiMesh* ctz = out[n];
- if (ctz->mNumBones == node->mMeshes[i] && *reinterpret_cast<aiMatrix4x4*>(ctz->mBones) == node->mTransformation) {
-
- // ok, use this one. Update node mesh index
- node->mMeshes[i] = numIn + n;
- }
- }
- if (node->mMeshes[i] < numIn) {
- // Worst case. Need to operate on a full copy of the mesh
- DefaultLogger::get()->info("PretransformVertices: Copying mesh due to mismatching transforms");
- aiMesh* ntz;
-
- const unsigned int tmp = mesh->mNumBones; //
- mesh->mNumBones = 0;
- SceneCombiner::Copy(&ntz,mesh);
- mesh->mNumBones = tmp;
-
- ntz->mNumBones = node->mMeshes[i];
- ntz->mBones = reinterpret_cast<aiBone**> (&node->mTransformation);
-
- out.push_back(ntz);
- }
- }
- }
-
- // call children
- for (unsigned int i = 0; i < node->mNumChildren;++i)
- BuildWCSMeshes(out,in,numIn,node->mChildren[i]);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Reset transformation matrices to identity
-void PretransformVertices::MakeIdentityTransform(aiNode* nd)
-{
- nd->mTransformation = aiMatrix4x4();
-
- // call children
- for (unsigned int i = 0; i < nd->mNumChildren;++i)
- MakeIdentityTransform(nd->mChildren[i]);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Build reference counters for all meshes
-void PretransformVertices::BuildMeshRefCountArray(aiNode* nd, unsigned int * refs)
-{
- for (unsigned int i = 0; i< nd->mNumMeshes;++i)
- refs[nd->mMeshes[i]]++;
-
- // call children
- for (unsigned int i = 0; i < nd->mNumChildren;++i)
- BuildMeshRefCountArray(nd->mChildren[i],refs);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Executes the post processing step on the given imported data.
-void PretransformVertices::Execute( aiScene* pScene)
-{
- DefaultLogger::get()->debug("PretransformVerticesProcess begin");
-
- // Return immediately if we have no meshes
- if (!pScene->mNumMeshes)
- return;
-
- const unsigned int iOldMeshes = pScene->mNumMeshes;
- const unsigned int iOldAnimationChannels = pScene->mNumAnimations;
- const unsigned int iOldNodes = CountNodes(pScene->mRootNode);
-
- // first compute absolute transformation matrices for all nodes
- ComputeAbsoluteTransform(pScene->mRootNode);
-
- // Delete aiMesh::mBones for all meshes. The bones are
- // removed during this step and we need the pointer as
- // temporary storage
- for (unsigned int i = 0; i < pScene->mNumMeshes;++i) {
- aiMesh* mesh = pScene->mMeshes[i];
-
- for (unsigned int a = 0; a < mesh->mNumBones;++a)
- delete mesh->mBones[a];
-
- delete[] mesh->mBones;
- mesh->mBones = NULL;
- }
-
- // now build a list of output meshes
- std::vector<aiMesh*> apcOutMeshes;
-
- // Keep scene hierarchy? It's an easy job in this case ...
- // we go on and transform all meshes, if one is referenced by nodes
- // with different absolute transformations a depth copy of the mesh
- // is required.
- if ( configKeepHierarchy ) {
-
- // Hack: store the matrix we're transforming a mesh with in aiMesh::mBones
- BuildWCSMeshes(apcOutMeshes,pScene->mMeshes,pScene->mNumMeshes, pScene->mRootNode);
-
- // ... if new meshes have been generated, append them to the end of the scene
- if (apcOutMeshes.size() > 0) {
- aiMesh** npp = new aiMesh*[pScene->mNumMeshes + apcOutMeshes.size()];
-
- memcpy(npp,pScene->mMeshes,sizeof(aiMesh*)*pScene->mNumMeshes);
- memcpy(npp+pScene->mNumMeshes,&apcOutMeshes[0],sizeof(aiMesh*)*apcOutMeshes.size());
-
- pScene->mNumMeshes += apcOutMeshes.size();
- delete[] pScene->mMeshes; pScene->mMeshes = npp;
- }
-
- // now iterate through all meshes and transform them to worldspace
- for (unsigned int i = 0; i < pScene->mNumMeshes; ++i) {
- ApplyTransform(pScene->mMeshes[i],*reinterpret_cast<aiMatrix4x4*>( pScene->mMeshes[i]->mBones ));
-
- // prevent improper destruction
- pScene->mMeshes[i]->mBones = NULL;
- pScene->mMeshes[i]->mNumBones = 0;
- }
- }
- else {
-
- apcOutMeshes.reserve(pScene->mNumMaterials<<1u);
- std::list<unsigned int> aiVFormats;
-
- std::vector<unsigned int> s(pScene->mNumMeshes,0);
- BuildMeshRefCountArray(pScene->mRootNode,&s[0]);
-
- for (unsigned int i = 0; i < pScene->mNumMaterials;++i) {
- // get the list of all vertex formats for this material
- aiVFormats.clear();
- GetVFormatList(pScene,i,aiVFormats);
- aiVFormats.sort();
- aiVFormats.unique();
- for (std::list<unsigned int>::const_iterator j = aiVFormats.begin();j != aiVFormats.end();++j) {
- unsigned int iVertices = 0;
- unsigned int iFaces = 0;
- CountVerticesAndFaces(pScene,pScene->mRootNode,i,*j,&iFaces,&iVertices);
- if (0 != iFaces && 0 != iVertices)
- {
- apcOutMeshes.push_back(new aiMesh());
- aiMesh* pcMesh = apcOutMeshes.back();
- pcMesh->mNumFaces = iFaces;
- pcMesh->mNumVertices = iVertices;
- pcMesh->mFaces = new aiFace[iFaces];
- pcMesh->mVertices = new aiVector3D[iVertices];
- pcMesh->mMaterialIndex = i;
- if ((*j) & 0x2)pcMesh->mNormals = new aiVector3D[iVertices];
- if ((*j) & 0x4)
- {
- pcMesh->mTangents = new aiVector3D[iVertices];
- pcMesh->mBitangents = new aiVector3D[iVertices];
- }
- iFaces = 0;
- while ((*j) & (0x100 << iFaces))
- {
- pcMesh->mTextureCoords[iFaces] = new aiVector3D[iVertices];
- if ((*j) & (0x10000 << iFaces))pcMesh->mNumUVComponents[iFaces] = 3;
- else pcMesh->mNumUVComponents[iFaces] = 2;
- iFaces++;
- }
- iFaces = 0;
- while ((*j) & (0x1000000 << iFaces))
- pcMesh->mColors[iFaces++] = new aiColor4D[iVertices];
-
- // fill the mesh ...
- unsigned int aiTemp[2] = {0,0};
- CollectData(pScene,pScene->mRootNode,i,*j,pcMesh,aiTemp,&s[0]);
- }
- }
- }
-
- // now delete all meshes in the scene and build a new mesh list
- for (unsigned int i = 0; i < pScene->mNumMeshes;++i)
- {
- aiMesh* mesh = pScene->mMeshes[i];
- mesh->mNumBones = 0;
- mesh->mBones = NULL;
-
- // we're reusing the face index arrays. avoid destruction
- for (unsigned int a = 0; a < mesh->mNumFaces; ++a) {
- mesh->mFaces[a].mNumIndices = 0;
- mesh->mFaces[a].mIndices = NULL;
- }
-
- delete mesh;
-
- // Invalidate the contents of the old mesh array. We will most
- // likely have less output meshes now, so the last entries of
- // the mesh array are not overridden. We set them to NULL to
- // make sure the developer gets notified when his application
- // attempts to access these fields ...
- mesh = NULL;
- }
-
- // If no meshes are referenced in the node graph it is possible that we get no output meshes.
- if (apcOutMeshes.empty()) {
- throw DeadlyImportError("No output meshes: all meshes are orphaned and are not referenced by nodes");
- }
- else
- {
- // It is impossible that we have more output meshes than
- // input meshes, so we can easily reuse the old mesh array
- pScene->mNumMeshes = (unsigned int)apcOutMeshes.size();
- for (unsigned int i = 0; i < pScene->mNumMeshes;++i)
- pScene->mMeshes[i] = apcOutMeshes[i];
- }
- }
-
- // remove all animations from the scene
- for (unsigned int i = 0; i < pScene->mNumAnimations;++i)
- delete pScene->mAnimations[i];
- delete[] pScene->mAnimations;
-
- pScene->mAnimations = NULL;
- pScene->mNumAnimations = 0;
-
- // --- we need to keep all cameras and lights
- for (unsigned int i = 0; i < pScene->mNumCameras;++i)
- {
- aiCamera* cam = pScene->mCameras[i];
- const aiNode* nd = pScene->mRootNode->FindNode(cam->mName);
- ai_assert(NULL != nd);
-
- // multiply all properties of the camera with the absolute
- // transformation of the corresponding node
- cam->mPosition = nd->mTransformation * cam->mPosition;
- cam->mLookAt = aiMatrix3x3( nd->mTransformation ) * cam->mLookAt;
- cam->mUp = aiMatrix3x3( nd->mTransformation ) * cam->mUp;
- }
-
- for (unsigned int i = 0; i < pScene->mNumLights;++i)
- {
- aiLight* l = pScene->mLights[i];
- const aiNode* nd = pScene->mRootNode->FindNode(l->mName);
- ai_assert(NULL != nd);
-
- // multiply all properties of the camera with the absolute
- // transformation of the corresponding node
- l->mPosition = nd->mTransformation * l->mPosition;
- l->mDirection = aiMatrix3x3( nd->mTransformation ) * l->mDirection;
- }
-
- if ( !configKeepHierarchy ) {
-
- // now delete all nodes in the scene and build a new
- // flat node graph with a root node and some level 1 children
- delete pScene->mRootNode;
- pScene->mRootNode = new aiNode();
- pScene->mRootNode->mName.Set("<dummy_root>");
-
- if (1 == pScene->mNumMeshes && !pScene->mNumLights && !pScene->mNumCameras)
- {
- pScene->mRootNode->mNumMeshes = 1;
- pScene->mRootNode->mMeshes = new unsigned int[1];
- pScene->mRootNode->mMeshes[0] = 0;
- }
- else
- {
- pScene->mRootNode->mNumChildren = pScene->mNumMeshes+pScene->mNumLights+pScene->mNumCameras;
- aiNode** nodes = pScene->mRootNode->mChildren = new aiNode*[pScene->mRootNode->mNumChildren];
-
- // generate mesh nodes
- for (unsigned int i = 0; i < pScene->mNumMeshes;++i,++nodes)
- {
- aiNode* pcNode = *nodes = new aiNode();
- pcNode->mParent = pScene->mRootNode;
- pcNode->mName.length = ::sprintf(pcNode->mName.data,"mesh_%i",i);
-
- // setup mesh indices
- pcNode->mNumMeshes = 1;
- pcNode->mMeshes = new unsigned int[1];
- pcNode->mMeshes[0] = i;
- }
- // generate light nodes
- for (unsigned int i = 0; i < pScene->mNumLights;++i,++nodes)
- {
- aiNode* pcNode = *nodes = new aiNode();
- pcNode->mParent = pScene->mRootNode;
- pcNode->mName.length = ::sprintf(pcNode->mName.data,"light_%i",i);
- pScene->mLights[i]->mName = pcNode->mName;
- }
- // generate camera nodes
- for (unsigned int i = 0; i < pScene->mNumCameras;++i,++nodes)
- {
- aiNode* pcNode = *nodes = new aiNode();
- pcNode->mParent = pScene->mRootNode;
- pcNode->mName.length = ::sprintf(pcNode->mName.data,"cam_%i",i);
- pScene->mCameras[i]->mName = pcNode->mName;
- }
- }
- }
- else {
- // ... and finally set the transformation matrix of all nodes to identity
- MakeIdentityTransform(pScene->mRootNode);
- }
-
- if (configNormalize) {
- // compute the boundary of all meshes
- aiVector3D min,max;
- MinMaxChooser<aiVector3D> ()(min,max);
-
- for (unsigned int a = 0; a < pScene->mNumMeshes; ++a) {
- aiMesh* m = pScene->mMeshes[a];
- for (unsigned int i = 0; i < m->mNumVertices;++i) {
- min = std::min(m->mVertices[i],min);
- max = std::max(m->mVertices[i],max);
- }
- }
-
- // find the dominant axis
- aiVector3D d = max-min;
- const float div = std::max(d.x,std::max(d.y,d.z))*0.5f;
-
- d = min+d*0.5f;
- for (unsigned int a = 0; a < pScene->mNumMeshes; ++a) {
- aiMesh* m = pScene->mMeshes[a];
- for (unsigned int i = 0; i < m->mNumVertices;++i) {
- m->mVertices[i] = (m->mVertices[i]-d)/div;
- }
- }
- }
-
- // print statistics
- if (!DefaultLogger::isNullLogger())
- {
- char buffer[4096];
-
- DefaultLogger::get()->debug("PretransformVerticesProcess finished");
-
- sprintf(buffer,"Removed %i nodes and %i animation channels (%i output nodes)",
- iOldNodes,iOldAnimationChannels,CountNodes(pScene->mRootNode));
- DefaultLogger::get()->info(buffer);
-
- sprintf(buffer,"Kept %i lights and %i cameras",
- pScene->mNumLights,pScene->mNumCameras);
- DefaultLogger::get()->info(buffer);
-
- sprintf(buffer,"Moved %i meshes to WCS (number of output meshes: %i)",
- iOldMeshes,pScene->mNumMeshes);
- DefaultLogger::get()->info(buffer);
- }
-}
-
diff --git a/3rdparty/assimp/code/PretransformVertices.h b/3rdparty/assimp/code/PretransformVertices.h
deleted file mode 100644
index df2d8450..00000000
--- a/3rdparty/assimp/code/PretransformVertices.h
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file PretransformVertices.h
- * @brief Defines a post processing step to pretransform all
- * vertices in the scenegraph
- */
-#ifndef AI_PRETRANSFORMVERTICES_H_INC
-#define AI_PRETRANSFORMVERTICES_H_INC
-
-#include "BaseProcess.h"
-#include "../include/aiMesh.h"
-
-class PretransformVerticesTest;
-namespace Assimp {
-
-// ---------------------------------------------------------------------------
-/** The PretransformVertices pretransforms all vertices in the nodegraph
- * and removes the whole graph. The output is a list of meshes, one for
- * each material.
-*/
-class ASSIMP_API PretransformVertices : public BaseProcess
-{
- friend class Importer;
- friend class ::PretransformVerticesTest;
-
-protected:
- /** Constructor to be privately used by Importer */
- PretransformVertices ();
-
- /** Destructor, private as well */
- ~PretransformVertices ();
-
-public:
-
- // -------------------------------------------------------------------
- // Check whether step is active
- bool IsActive( unsigned int pFlags) const;
-
- // -------------------------------------------------------------------
- // Execute step on a given scene
- void Execute( aiScene* pScene);
-
- // -------------------------------------------------------------------
- // Setup import settings
- void SetupProperties(const Importer* pImp);
-
-
- // -------------------------------------------------------------------
- /** @brief Toggle the 'keep hierarchy' option
- * @param d hm ... difficult to guess what this means, hu!?
- */
- void KeepHierarchy(bool d) {
- configKeepHierarchy = d;
- }
-
- // -------------------------------------------------------------------
- /** @brief Check whether 'keep hierarchy' is currently enabled.
- * @return ...
- */
- bool IsHierarchyKept() const {
- return configKeepHierarchy;
- }
-
-private:
-
- // -------------------------------------------------------------------
- // Count the number of nodes
- unsigned int CountNodes( aiNode* pcNode );
-
- // -------------------------------------------------------------------
- // Get a bitwise combination identifying the vertex format of a mesh
- unsigned int GetMeshVFormat(aiMesh* pcMesh);
-
- // -------------------------------------------------------------------
- // Count the number of vertices in the whole scene and a given
- // material index
- void CountVerticesAndFaces( aiScene* pcScene, aiNode* pcNode,
- unsigned int iMat,
- unsigned int iVFormat,
- unsigned int* piFaces,
- unsigned int* piVertices);
-
- // -------------------------------------------------------------------
- // Collect vertex/face data
- void CollectData( aiScene* pcScene, aiNode* pcNode,
- unsigned int iMat,
- unsigned int iVFormat,
- aiMesh* pcMeshOut,
- unsigned int aiCurrent[2],
- unsigned int* num_refs);
-
- // -------------------------------------------------------------------
- // Get a list of all vertex formats that occur for a given material
- // The output list contains duplicate elements
- void GetVFormatList( aiScene* pcScene, unsigned int iMat,
- std::list<unsigned int>& aiOut);
-
- // -------------------------------------------------------------------
- // Compute the absolute transformation matrices of each node
- void ComputeAbsoluteTransform( aiNode* pcNode );
-
- // -------------------------------------------------------------------
- // Simple routine to build meshes in worldspace, no further optimization
- void BuildWCSMeshes(std::vector<aiMesh*>& out, aiMesh** in,
- unsigned int numIn, aiNode* node);
-
- // -------------------------------------------------------------------
- // Apply the node transformation to a mesh
- void ApplyTransform(aiMesh* mesh, const aiMatrix4x4& mat);
-
- // -------------------------------------------------------------------
- // Reset transformation matrices to identity
- void MakeIdentityTransform(aiNode* nd);
-
- // -------------------------------------------------------------------
- // Build reference counters for all meshes
- void BuildMeshRefCountArray(aiNode* nd, unsigned int * refs);
-
-
-
- //! Configuration option: keep scene hierarchy as long as possible
- bool configKeepHierarchy, configNormalize;
-
-};
-
-} // end of namespace Assimp
-
-#endif // !!AI_GENFACENORMALPROCESS_H_INC
diff --git a/3rdparty/assimp/code/ProcessHelper.h b/3rdparty/assimp/code/ProcessHelper.h
deleted file mode 100644
index 4e8b1dec..00000000
--- a/3rdparty/assimp/code/ProcessHelper.h
+++ /dev/null
@@ -1,564 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-#ifndef AI_PROCESS_HELPER_H_INCLUDED
-#define AI_PROCESS_HELPER_H_INCLUDED
-
-#include "../include/aiPostProcess.h"
-
-#include "SpatialSort.h"
-#include "BaseProcess.h"
-#include "ParsingUtils.h"
-
-// -------------------------------------------------------------------------------
-// Some extensions to std namespace. Mainly std::min and std::max for all
-// flat data types in the aiScene. They're used to quickly determine the
-// min/max bounds of data arrays.
-#ifdef __cplusplus
-namespace std {
-
- // std::min for aiVector3D
- inline ::aiVector3D min (const ::aiVector3D& a, const ::aiVector3D& b) {
- return ::aiVector3D (min(a.x,b.x),min(a.y,b.y),min(a.z,b.z));
- }
-
- // std::max for aiVector3D
- inline ::aiVector3D max (const ::aiVector3D& a, const ::aiVector3D& b) {
- return ::aiVector3D (max(a.x,b.x),max(a.y,b.y),max(a.z,b.z));
- }
-
- // std::min for aiColor4D
- inline ::aiColor4D min (const ::aiColor4D& a, const ::aiColor4D& b) {
- return ::aiColor4D (min(a.r,b.r),min(a.g,b.g),min(a.b,b.b),min(a.a,b.a));
- }
-
- // std::max for aiColor4D
- inline ::aiColor4D max (const ::aiColor4D& a, const ::aiColor4D& b) {
- return ::aiColor4D (max(a.r,b.r),max(a.g,b.g),max(a.b,b.b),max(a.a,b.a));
- }
-
- // std::min for aiQuaternion
- inline ::aiQuaternion min (const ::aiQuaternion& a, const ::aiQuaternion& b) {
- return ::aiQuaternion (min(a.w,b.w),min(a.x,b.x),min(a.y,b.y),min(a.z,b.z));
- }
-
- // std::max for aiQuaternion
- inline ::aiQuaternion max (const ::aiQuaternion& a, const ::aiQuaternion& b) {
- return ::aiQuaternion (max(a.w,b.w),max(a.x,b.x),max(a.y,b.y),max(a.z,b.z));
- }
-
- // std::min for aiVectorKey
- inline ::aiVectorKey min (const ::aiVectorKey& a, const ::aiVectorKey& b) {
- return ::aiVectorKey (min(a.mTime,b.mTime),min(a.mValue,b.mValue));
- }
-
- // std::max for aiVectorKey
- inline ::aiVectorKey max (const ::aiVectorKey& a, const ::aiVectorKey& b) {
- return ::aiVectorKey (max(a.mTime,b.mTime),max(a.mValue,b.mValue));
- }
-
- // std::min for aiQuatKey
- inline ::aiQuatKey min (const ::aiQuatKey& a, const ::aiQuatKey& b) {
- return ::aiQuatKey (min(a.mTime,b.mTime),min(a.mValue,b.mValue));
- }
-
- // std::max for aiQuatKey
- inline ::aiQuatKey max (const ::aiQuatKey& a, const ::aiQuatKey& b) {
- return ::aiQuatKey (max(a.mTime,b.mTime),max(a.mValue,b.mValue));
- }
-
- // std::min for aiVertexWeight
- inline ::aiVertexWeight min (const ::aiVertexWeight& a, const ::aiVertexWeight& b) {
- return ::aiVertexWeight (min(a.mVertexId,b.mVertexId),min(a.mWeight,b.mWeight));
- }
-
- // std::max for aiVertexWeight
- inline ::aiVertexWeight max (const ::aiVertexWeight& a, const ::aiVertexWeight& b) {
- return ::aiVertexWeight (max(a.mVertexId,b.mVertexId),max(a.mWeight,b.mWeight));
- }
-
-} // end namespace std
-#endif // !! C++
-
-namespace Assimp {
-
-// -------------------------------------------------------------------------------
-// Start points for ArrayBounds<T> for all supported Ts
-template <typename T>
-struct MinMaxChooser;
-
-template <> struct MinMaxChooser<float> {
- void operator ()(float& min,float& max) {
- max = -10e10f;
- min = 10e10f;
-}};
-template <> struct MinMaxChooser<double> {
- void operator ()(double& min,double& max) {
- max = -10e10;
- min = 10e10;
-}};
-template <> struct MinMaxChooser<unsigned int> {
- void operator ()(unsigned int& min,unsigned int& max) {
- max = 0;
- min = (1u<<(sizeof(unsigned int)*8-1));
-}};
-
-template <> struct MinMaxChooser<aiVector3D> {
- void operator ()(aiVector3D& min,aiVector3D& max) {
- max = aiVector3D(-10e10f,-10e10f,-10e10f);
- min = aiVector3D( 10e10f, 10e10f, 10e10f);
-}};
-template <> struct MinMaxChooser<aiColor4D> {
- void operator ()(aiColor4D& min,aiColor4D& max) {
- max = aiColor4D(-10e10f,-10e10f,-10e10f,-10e10f);
- min = aiColor4D( 10e10f, 10e10f, 10e10f, 10e10f);
-}};
-
-template <> struct MinMaxChooser<aiQuaternion> {
- void operator ()(aiQuaternion& min,aiQuaternion& max) {
- max = aiQuaternion(-10e10f,-10e10f,-10e10f,-10e10f);
- min = aiQuaternion( 10e10f, 10e10f, 10e10f, 10e10f);
-}};
-
-template <> struct MinMaxChooser<aiVectorKey> {
- void operator ()(aiVectorKey& min,aiVectorKey& max) {
- MinMaxChooser<double>()(min.mTime,max.mTime);
- MinMaxChooser<aiVector3D>()(min.mValue,max.mValue);
-}};
-template <> struct MinMaxChooser<aiQuatKey> {
- void operator ()(aiQuatKey& min,aiQuatKey& max) {
- MinMaxChooser<double>()(min.mTime,max.mTime);
- MinMaxChooser<aiQuaternion>()(min.mValue,max.mValue);
-}};
-
-template <> struct MinMaxChooser<aiVertexWeight> {
- void operator ()(aiVertexWeight& min,aiVertexWeight& max) {
- MinMaxChooser<unsigned int>()(min.mVertexId,max.mVertexId);
- MinMaxChooser<float>()(min.mWeight,max.mWeight);
-}};
-
-// -------------------------------------------------------------------------------
-/** @brief Find the min/max values of an array of Ts
- * @param in Input array
- * @param size Numebr of elements to process
- * @param[out] min minimum value
- * @param[out] max maximum value
- */
-template <typename T>
-inline void ArrayBounds(const T* in, unsigned int size, T& min, T& max)
-{
- MinMaxChooser<T> ()(min,max);
- for (unsigned int i = 0; i < size;++i) {
- min = std::min(in[i],min);
- max = std::max(in[i],max);
- }
-}
-
-// -------------------------------------------------------------------------------
-/** @brief Extract single strings from a list of identifiers
- * @param in Input string list.
- * @param out Receives a list of clean output strings
- * @sdee #AI_CONFIG_PP_OG_EXCLUDE_LIST
- */
-inline void ConvertListToStrings(const std::string& in, std::list<std::string>& out)
-{
- const char* s = in.c_str();
- while (*s) {
- SkipSpacesAndLineEnd(&s);
- if (*s == '\'') {
- const char* base = ++s;
- while (*s != '\'') {
- ++s;
- if (*s == '\0') {
- DefaultLogger::get()->error("ConvertListToString: String list is ill-formatted");
- return;
- }
- }
- out.push_back(std::string(base,(size_t)(s-base)));
- ++s;
- }
- else {
- out.push_back(GetNextToken(s));
- }
- }
-}
-
-// -------------------------------------------------------------------------------
-/** @brief Compute the newell normal of a polygon regardless of its shape
- *
- * @param out Receives the output normal
- * @param num Number of input vertices
- * @param x X data source. x[ofs_x*n] is the n'th element.
- * @param y Y data source. y[ofs_y*n] is the y'th element
- * @param z Z data source. z[ofs_z*n] is the z'th element
- *
- * @note The data arrays must have storage for at least num+2 elements. Using
- * this method is much faster than the 'other' NewellNormal()
- */
-template <int ofs_x, int ofs_y, int ofs_z>
-inline void NewellNormal (aiVector3D& out, int num, float* x, float* y, float* z)
-{
- // Duplicate the first two vertices at the end
- x[(num+0)*ofs_x] = x[0];
- x[(num+1)*ofs_x] = x[ofs_x];
-
- y[(num+0)*ofs_y] = y[0];
- y[(num+1)*ofs_y] = y[ofs_y];
-
- z[(num+0)*ofs_z] = z[0];
- z[(num+1)*ofs_z] = z[ofs_z];
-
- float sum_xy = 0.0, sum_yz = 0.0, sum_zx = 0.0;
-
- float *xptr = x +ofs_x, *xlow = x, *xhigh = x + ofs_x*2;
- float *yptr = y +ofs_y, *ylow = y, *yhigh = y + ofs_y*2;
- float *zptr = z +ofs_z, *zlow = z, *zhigh = z + ofs_z*2;
-
- for (int tmp=0; tmp < num; tmp++) {
- sum_xy += (*xptr) * ( (*yhigh) - (*ylow) );
- sum_yz += (*yptr) * ( (*zhigh) - (*zlow) );
- sum_zx += (*zptr) * ( (*xhigh) - (*xlow) );
-
- xptr += ofs_x;
- xlow += ofs_x;
- xhigh += ofs_x;
-
- yptr += ofs_y;
- ylow += ofs_y;
- yhigh += ofs_y;
-
- zptr += ofs_z;
- zlow += ofs_z;
- zhigh += ofs_z;
- }
- out = aiVector3D(sum_yz,sum_zx,sum_xy);
-}
-
-#if 0
-// -------------------------------------------------------------------------------
-/** @brief Compute newell normal of a polgon regardless of its shape
- *
- * @param out Receives the output normal
- * @param data Input vertices
- * @param idx Index buffer
- * @param num Number of indices
- */
-inline void NewellNormal (aiVector3D& out, const aiVector3D* data, unsigned int* idx, unsigned int num )
-{
- // TODO: intended to be used in GenNormals.
-}
-#endif
-
-// -------------------------------------------------------------------------------
-/** Little helper function to calculate the quadratic difference
- * of two colours.
- * @param pColor1 First color
- * @param pColor2 second color
- * @return Quadratic color difference
- */
-inline float GetColorDifference( const aiColor4D& pColor1, const aiColor4D& pColor2)
-{
- const aiColor4D c (pColor1.r - pColor2.r, pColor1.g - pColor2.g,
- pColor1.b - pColor2.b, pColor1.a - pColor2.a);
-
- return c.r*c.r + c.g*c.g + c.b*c.b + c.a*c.a;
-}
-
-// -------------------------------------------------------------------------------
-/** @brief Compute the AABB of a mesh after applying a given transform
- * @param mesh Input mesh
- * @param[out] min Receives minimum transformed vertex
- * @param[out] max Receives maximum transformed vertex
- * @param m Transformation matrix to be applied
- */
-inline void FindAABBTransformed (const aiMesh* mesh, aiVector3D& min, aiVector3D& max,
- const aiMatrix4x4& m)
-{
- min = aiVector3D (10e10f, 10e10f, 10e10f);
- max = aiVector3D (-10e10f,-10e10f,-10e10f);
- for (unsigned int i = 0;i < mesh->mNumVertices;++i)
- {
- const aiVector3D v = m * mesh->mVertices[i];
- min = std::min(v,min);
- max = std::max(v,max);
- }
-}
-
-// -------------------------------------------------------------------------------
-/** @brief Helper function to determine the 'real' center of a mesh
- *
- * That is the center of its axis-aligned bounding box.
- * @param mesh Input mesh
- * @param[out] min Minimum vertex of the mesh
- * @param[out] max maximum vertex of the mesh
- * @param[out] out Center point
- */
-inline void FindMeshCenter (aiMesh* mesh, aiVector3D& out, aiVector3D& min, aiVector3D& max)
-{
- ArrayBounds(mesh->mVertices,mesh->mNumVertices, min,max);
- out = min + (max-min)*0.5f;
-}
-
-// -------------------------------------------------------------------------------
-// Helper function to determine the 'real' center of a mesh after applying a given transform
-inline void FindMeshCenterTransformed (aiMesh* mesh, aiVector3D& out, aiVector3D& min,
- aiVector3D& max, const aiMatrix4x4& m)
-{
- FindAABBTransformed(mesh,min,max,m);
- out = min + (max-min)*0.5f;
-}
-
-// -------------------------------------------------------------------------------
-// Helper function to determine the 'real' center of a mesh
-inline void FindMeshCenter (aiMesh* mesh, aiVector3D& out)
-{
- aiVector3D min,max;
- FindMeshCenter(mesh,out,min,max);
-}
-
-// -------------------------------------------------------------------------------
-// Helper function to determine the 'real' center of a mesh after applying a given transform
-inline void FindMeshCenterTransformed (aiMesh* mesh, aiVector3D& out,
- const aiMatrix4x4& m)
-{
- aiVector3D min,max;
- FindMeshCenterTransformed(mesh,out,min,max,m);
-}
-
-// -------------------------------------------------------------------------------
-// Compute a good epsilon value for position comparisons on a mesh
-inline float ComputePositionEpsilon(const aiMesh* pMesh)
-{
- const float epsilon = 1e-4f;
-
- // calculate the position bounds so we have a reliable epsilon to check position differences against
- aiVector3D minVec, maxVec;
- ArrayBounds(pMesh->mVertices,pMesh->mNumVertices,minVec,maxVec);
- return (maxVec - minVec).Length() * epsilon;
-}
-
-// -------------------------------------------------------------------------------
-// Compute a good epsilon value for position comparisons on a array of meshes
-inline float ComputePositionEpsilon(const aiMesh* const* pMeshes, size_t num)
-{
- const float epsilon = 1e-4f;
-
- // calculate the position bounds so we have a reliable epsilon to check position differences against
- aiVector3D minVec, maxVec, mi, ma;
- MinMaxChooser<aiVector3D>()(minVec,maxVec);
-
- for (size_t a = 0; a < num; ++a) {
- const aiMesh* pMesh = pMeshes[a];
- ArrayBounds(pMesh->mVertices,pMesh->mNumVertices,mi,ma);
-
- minVec = std::min(minVec,mi);
- maxVec = std::max(maxVec,ma);
- }
- return (maxVec - minVec).Length() * epsilon;
-}
-
-// -------------------------------------------------------------------------------
-// Compute an unique value for the vertex format of a mesh
-inline unsigned int GetMeshVFormatUnique(aiMesh* pcMesh)
-{
- ai_assert(NULL != pcMesh);
-
- // FIX: the hash may never be 0. Otherwise a comparison against
- // nullptr could be successful
- unsigned int iRet = 1;
-
- // normals
- if (pcMesh->HasNormals())iRet |= 0x2;
- // tangents and bitangents
- if (pcMesh->HasTangentsAndBitangents())iRet |= 0x4;
-
-#ifdef BOOST_STATIC_ASSERT
- BOOST_STATIC_ASSERT(8 >= AI_MAX_NUMBER_OF_COLOR_SETS);
- BOOST_STATIC_ASSERT(8 >= AI_MAX_NUMBER_OF_TEXTURECOORDS);
-#endif
-
- // texture coordinates
- unsigned int p = 0;
- while (pcMesh->HasTextureCoords(p))
- {
- iRet |= (0x100 << p);
- if (3 == pcMesh->mNumUVComponents[p])
- iRet |= (0x10000 << p);
-
- ++p;
- }
- // vertex colors
- p = 0;
- while (pcMesh->HasVertexColors(p))iRet |= (0x1000000 << p++);
- return iRet;
-}
-
-typedef std::pair <unsigned int,float> PerVertexWeight;
-typedef std::vector <PerVertexWeight> VertexWeightTable;
-
-// -------------------------------------------------------------------------------
-// Compute a per-vertex bone weight table
-// please .... delete result with operator delete[] ...
-inline VertexWeightTable* ComputeVertexBoneWeightTable(aiMesh* pMesh)
-{
- if (!pMesh || !pMesh->mNumVertices || !pMesh->mNumBones)
- return NULL;
-
- VertexWeightTable* avPerVertexWeights = new VertexWeightTable[pMesh->mNumVertices];
- for (unsigned int i = 0; i < pMesh->mNumBones;++i)
- {
- aiBone* bone = pMesh->mBones[i];
- for (unsigned int a = 0; a < bone->mNumWeights;++a) {
- const aiVertexWeight& weight = bone->mWeights[a];
- avPerVertexWeights[weight.mVertexId].push_back(
- std::pair<unsigned int,float>(i,weight.mWeight));
- }
- }
- return avPerVertexWeights;
-}
-
-// -------------------------------------------------------------------------------
-// Get a string for a given aiTextureType
-inline const char* TextureTypeToString(aiTextureType in)
-{
- switch (in)
- {
- case aiTextureType_NONE:
- return "n/a";
- case aiTextureType_DIFFUSE:
- return "Diffuse";
- case aiTextureType_SPECULAR:
- return "Specular";
- case aiTextureType_AMBIENT:
- return "Ambient";
- case aiTextureType_EMISSIVE:
- return "Emissive";
- case aiTextureType_OPACITY:
- return "Opacity";
- case aiTextureType_NORMALS:
- return "Normals";
- case aiTextureType_HEIGHT:
- return "Height";
- case aiTextureType_SHININESS:
- return "Shininess";
- case aiTextureType_DISPLACEMENT:
- return "Displacement";
- case aiTextureType_LIGHTMAP:
- return "Lightmap";
- case aiTextureType_REFLECTION:
- return "Reflection";
- case aiTextureType_UNKNOWN:
- return "Unknown";
- default:
- return "HUGE ERROR. Expect BSOD (linux guys: kernel panic ...).";
- }
-}
-
-// -------------------------------------------------------------------------------
-// Get a string for a given aiTextureMapping
-inline const char* MappingTypeToString(aiTextureMapping in)
-{
- switch (in)
- {
- case aiTextureMapping_UV:
- return "UV";
- case aiTextureMapping_BOX:
- return "Box";
- case aiTextureMapping_SPHERE:
- return "Sphere";
- case aiTextureMapping_CYLINDER:
- return "Cylinder";
- case aiTextureMapping_PLANE:
- return "Plane";
- case aiTextureMapping_OTHER:
- return "Other";
- default:
- return "HUGE ERROR. Expect BSOD (linux guys: kernel panic ...).";
- }
-}
-
-// -------------------------------------------------------------------------------
-// Utility postprocess step to share the spatial sort tree between
-// all steps which use it to speedup its computations.
-class ComputeSpatialSortProcess : public BaseProcess
-{
- bool IsActive( unsigned int pFlags) const
- {
- return NULL != shared && 0 != (pFlags & (aiProcess_CalcTangentSpace |
- aiProcess_GenNormals | aiProcess_JoinIdenticalVertices));
- }
-
- void Execute( aiScene* pScene)
- {
- typedef std::pair<SpatialSort, float> _Type;
- DefaultLogger::get()->debug("Generate spatially-sorted vertex cache");
-
- std::vector<_Type>* p = new std::vector<_Type>(pScene->mNumMeshes);
- std::vector<_Type>::iterator it = p->begin();
-
- for (unsigned int i = 0; i < pScene->mNumMeshes; ++i, ++it) {
- aiMesh* mesh = pScene->mMeshes[i];
- _Type& blubb = *it;
- blubb.first.Fill(mesh->mVertices,mesh->mNumVertices,sizeof(aiVector3D));
- blubb.second = ComputePositionEpsilon(mesh);
- }
-
- shared->AddProperty(AI_SPP_SPATIAL_SORT,p);
- }
-};
-
-// -------------------------------------------------------------------------------
-// ... and the same again to cleanup the whole stuff
-class DestroySpatialSortProcess : public BaseProcess
-{
- bool IsActive( unsigned int pFlags) const
- {
- return NULL != shared && 0 != (pFlags & (aiProcess_CalcTangentSpace |
- aiProcess_GenNormals | aiProcess_JoinIdenticalVertices));
- }
-
- void Execute( aiScene* pScene)
- {
- shared->RemoveProperty(AI_SPP_SPATIAL_SORT);
- }
-};
-
-} // ! namespace Assimp
-#endif // !! AI_PROCESS_HELPER_H_INCLUDED
diff --git a/3rdparty/assimp/code/Profiler.h b/3rdparty/assimp/code/Profiler.h
deleted file mode 100644
index 74fed429..00000000
--- a/3rdparty/assimp/code/Profiler.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file Profiler.h
- * @brief Utility to measure the respective runtime of each import step
- */
-#ifndef INCLUDED_PROFILER_H
-#define INCLUDED_PROFILER_H
-
-#include "boost/timer.hpp"
-
-#include "../include/DefaultLogger.h"
-#include "TinyFormatter.h"
-
-namespace Assimp {
- namespace Profiling {
-
- using namespace Formatter;
-
-
-// ------------------------------------------------------------------------------------------------
-/** Simple wrapper around boost::timer to simplify reporting. Timings are automatically
- * dumped to the log file.
- */
-class Profiler
-{
-
-public:
-
- Profiler() {}
-
-public:
-
- /** Start a named timer */
- void BeginRegion(const std::string& region) {
- regions[region] = boost::timer();
- DefaultLogger::get()->debug((format("START `"),region,"`"));
- }
-
-
- /** End a specific named timer and write its end time to the log */
- void EndRegion(const std::string& region) {
- RegionMap::const_iterator it = regions.find(region);
- if (it == regions.end()) {
- return;
- }
-
- DefaultLogger::get()->debug((format("END `"),region,"`, dt= ",(*it).second.elapsed()," s"));
- }
-
-private:
-
- typedef std::map<std::string,boost::timer> RegionMap;
- RegionMap regions;
-};
-
- }
-}
-
-#endif
diff --git a/3rdparty/assimp/code/Q3BSPFileData.h b/3rdparty/assimp/code/Q3BSPFileData.h
deleted file mode 100644
index eb3ae828..00000000
--- a/3rdparty/assimp/code/Q3BSPFileData.h
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2008, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-#ifndef ASSIMP_Q3BSPFILEDATA_H_INC
-#define ASSIMP_Q3BSPFILEDATA_H_INC
-
-#include <vector>
-
-namespace Assimp
-{
-namespace Q3BSP
-{
-
-static const unsigned int CE_BSP_LIGHTMAPWIDTH = 128;
-static const unsigned int CE_BSP_LIGHTMAPHEIGHT = 128;
-
-static const unsigned int CE_BSP_LIGHTMAPSIZE = 128*128*3; ///< = 128( width ) * 128 ( height ) * 3 ( channels / RGB ).
-static const int VERION_Q3LEVEL = 46; ///< Supported version.
-
-/// Geometric type enumeration
-enum Q3BSPGeoType
-{
- Polygon = 1,
- Patch,
- TriangleMesh,
- Billboard
-};
-
-/// Integer vector.
-struct ceVec3i
-{
- int x, y, z;
- ceVec3i(): x( 0 ), y( 0 ), z( 0 ) { /* empty */ }
- ceVec3i( int iX, int iY=0, int iZ=0) : x( iX ), y( iY ), z( iZ ) { /* empty */ }
-};
-
-/// Fileheader
-struct sQ3BSPHeader
-{
- char strID[ 4 ]; //!< Should be "IBSP"
- int iVersion; //!< 46 for standard levels
-};
-
-/// Descripes an entry.
-struct sQ3BSPLump
-{
- int iOffset; ///< Offset from startpointer of file
- int iSize; ///< Size fo part
-};
-
-struct vec2f
-{
- float x,y;
-};
-
-struct vec3f
-{
- float x, y, z;
-};
-
-/// Vertex of a Q3 level
-struct sQ3BSPVertex
-{
- vec3f vPosition; ///< Position of vertex
- vec2f vTexCoord; ///< (u,v) Texturecoordinate of detailtexture
- vec2f vLightmap; ///< (u,v) Texturecoordinate of lightmap
- vec3f vNormal; ///< vertex normale
- unsigned char bColor[ 4 ]; ///< Color in RGBA
-};
-
-/// A face in bsp format info
-struct sQ3BSPFace
-{
- int iTextureID; ///< Index in texture array
- int iEffect; ///< Index in effectarray (-1 = no effect)
- int iType; ///< 1=Polygon, 2=Patch, 3=Mesh, 4=Billboard
- int iVertexIndex; ///< Start index of polygon
- int iNumOfVerts; ///< Number of vertices
- int iFaceVertexIndex; ///< Index of first mesh vertex
- int iNumOfFaceVerts; ///< Anzahl der Meshvertices
- int iLightmapID; ///< Index to the lightmap array
- int iLMapCorner[ 2 ]; ///< Die Ecke der Lightmap in der Textur
- int iLMapSize[ 2 ]; ///< Size of the lightmap stored on the texture
- vec3f vLMapPos; ///< 3D-Ursprung der Lightmap
- vec3f vLMapVecs[ 2 ]; ///< 3D-s-t-Vektoren
- vec3f vNormal; ///< Polygonnormale
- int patchWidth, patchHeight; ///< bezier patch
-};
-
-/// A quake3 texture name.
-struct sQ3BSPTexture
-{
- char strName[ 64 ]; ///< Name of the texture without extention
- int iFlags; ///< Not used
- int iContents; ///< Not used
-};
-
-/// A lightmap of the level, size 128 x 128, RGB components.
-struct sQ3BSPLightmap
-{
- unsigned char bLMapData[ CE_BSP_LIGHTMAPSIZE ];
- sQ3BSPLightmap()
- {
- memset(bLMapData, 0, CE_BSP_LIGHTMAPSIZE );
- }
-};
-
-struct SubPatch
-{
- std::vector<size_t> indices;
- int lightmapID;
-};
-
-enum eLumps
-{
- kEntities = 0,
- kTextures,
- kPlanes,
- kNodes,
- kLeafs,
- kLeafFaces,
- kLeafBrushes,
- kModels,
- kBrushes,
- kBrushSides,
- kVertices,
- kMeshVerts,
- kShaders,
- kFaces,
- kLightmaps,
- kLightVolumes,
- kVisData,
- kMaxLumps
-};
-
-struct Q3BSPModel
-{
- std::vector<unsigned char> m_Data;
- std::vector<sQ3BSPLump*> m_Lumps;
- std::vector<sQ3BSPVertex*> m_Vertices;
- std::vector<sQ3BSPFace*> m_Faces;
- std::vector<int> m_Indices;
- std::vector<sQ3BSPTexture*> m_Textures;
- std::vector<sQ3BSPLightmap*> m_Lightmaps;
- std::vector<char> m_EntityData;
- std::string m_ModelName;
-
- Q3BSPModel() :
- m_Data(),
- m_Lumps(),
- m_Vertices(),
- m_Faces(),
- m_Indices(),
- m_Textures(),
- m_Lightmaps(),
- m_EntityData(),
- m_ModelName( "" )
- {
- // empty
- }
-
- ~Q3BSPModel()
- {
- for ( unsigned int i=0; i<m_Lumps.size(); i++ )
- if ( NULL != m_Lumps[i] )
- delete m_Lumps[i];
-
- for ( unsigned int i=0; i<m_Vertices.size(); i++ )
- if ( NULL != m_Vertices[ i ] )
- delete m_Vertices[ i ];
- for ( unsigned int i=0; i<m_Faces.size(); i++ )
- if ( NULL != m_Faces[ i ] )
- delete m_Faces[ i ];
- for ( unsigned int i=0; i<m_Textures.size(); i++ )
- if ( NULL != m_Textures[ i ] )
- delete m_Textures[ i ];
- for ( unsigned int i=0; i<m_Lightmaps.size(); i++ )
- if ( NULL != m_Lightmaps[ i ] )
- delete m_Lightmaps[ i ];
-
- m_Lumps.clear();
- m_Vertices.clear();
- m_Faces.clear();
- m_Textures.clear();
- m_Lightmaps.clear();
- }
-};
-
-} // Namespace Q3BSP
-} // Namespace Assimp
-
-#endif // ASSIMP_Q3BSPFILEDATA_H_INC
diff --git a/3rdparty/assimp/code/Q3BSPFileImporter.cpp b/3rdparty/assimp/code/Q3BSPFileImporter.cpp
deleted file mode 100644
index dab913fb..00000000
--- a/3rdparty/assimp/code/Q3BSPFileImporter.cpp
+++ /dev/null
@@ -1,731 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------------------------------
-
-Copyright (c) 2006-2008, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
----------------------------------------------------------------------------------------------------
-*/
-#include "AssimpPCH.h"
-#ifndef ASSIMP_BUILD_NO_Q3BSP_IMPORTER
-
-//#include <windows.h>
-#include "DefaultIOSystem.h"
-#include "Q3BSPFileImporter.h"
-#include "Q3BSPZipArchive.h"
-#include "Q3BSPFileParser.h"
-#include "Q3BSPFileData.h"
-
-#ifdef ASSIMP_BUILD_NO_OWN_ZLIB
-# include <zlib.h>
-#else
-# include "../contrib/zlib/zlib.h"
-#endif
-
-#include "../include/aiTypes.h"
-#include "../include/aiMesh.h"
-#include <vector>
-
-namespace Assimp
-{
-
-using namespace Q3BSP;
-
-static const std::string Q3BSPExtention = "pk3";
-
-// ------------------------------------------------------------------------------------------------
-// Local fnction to create a material keyname.
-static void createKey( int id1, int id2, std::string &rKey )
-{
- std::stringstream str;
- str << id1 << "." << id2;
- rKey = str.str();
-}
-
-// ------------------------------------------------------------------------------------------------
-// Local function to extract the texture ids from a material keyname.
-static void extractIds( const std::string &rKey, int &rId1, int &rId2 )
-{
- rId1 = -1;
- rId2 = -1;
- if ( rKey.empty() )
- return;
-
- std::string::size_type pos = rKey.find( "." );
- if ( std::string::npos == pos )
- return;
-
- std::string tmp1 = rKey.substr( 0, pos );
- std::string tmp2 = rKey.substr( pos + 1, rKey.size() - pos - 1 );
- rId1 = atoi( tmp1.c_str() );
- rId2 = atoi( tmp2.c_str() );
-}
-
-// ------------------------------------------------------------------------------------------------
-// Local helper fuction to normalize filenames.
-static void normalizePathName( const std::string &rPath, std::string &rNormalizedPath )
-{
- rNormalizedPath = "";
- if ( rPath.empty() )
- return;
-
-#ifdef _WIN32
- std::string sep = "\\";
-#else
- std::string sep = "/";
-#endif
-
- static const unsigned int numDelimiters = 2;
- const char delimiters[ numDelimiters ] = { '/', '\\' };
- rNormalizedPath = rPath;
- for ( unsigned int i=0; i<numDelimiters; i++ )
- {
- for ( size_t j=0; j<rNormalizedPath.size(); j++ )
- {
- if ( rNormalizedPath[j] == delimiters[ i ] )
- {
- rNormalizedPath[ j ] = sep[ 0 ];
- }
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Constructor.
-Q3BSPFileImporter::Q3BSPFileImporter() :
- m_pCurrentMesh( NULL ),
- m_pCurrentFace( NULL ),
- m_MaterialLookupMap(),
- mTextures()
-{
- // empty
-}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor.
-Q3BSPFileImporter::~Q3BSPFileImporter()
-{
- // For lint
- m_pCurrentMesh = NULL;
- m_pCurrentFace = NULL;
-
- // Clear face-to-material map
- for ( FaceMap::iterator it = m_MaterialLookupMap.begin(); it != m_MaterialLookupMap.end();
- ++it )
- {
- const std::string matName = (*it).first;
- if ( matName.empty() )
- {
- continue;
- }
-
- std::vector<Q3BSP::sQ3BSPFace*> *pCurFaceArray = (*it).second;
- if ( NULL != pCurFaceArray )
- {
- delete pCurFaceArray;
- }
- }
- m_MaterialLookupMap.clear();
-}
-
-// ------------------------------------------------------------------------------------------------
-// Returns true, if the loader can read this.
-bool Q3BSPFileImporter::CanRead( const std::string& rFile, IOSystem* pIOHandler, bool checkSig ) const
-{
- bool isBSPData = false;
- if ( checkSig )
- isBSPData = SimpleExtensionCheck( rFile, Q3BSPExtention.c_str() );
-
- return isBSPData;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Adds extensions.
-void Q3BSPFileImporter::GetExtensionList( std::set<std::string>& extensions )
-{
- extensions.insert( Q3BSPExtention );
-}
-
-// ------------------------------------------------------------------------------------------------
-// Import method.
-void Q3BSPFileImporter::InternReadFile(const std::string &rFile, aiScene* pScene, IOSystem* pIOHandler)
-{
- Q3BSPZipArchive Archive( rFile );
- if ( !Archive.isOpen() )
- {
- throw new DeadlyImportError( "Failed to open file " + rFile + "." );
- }
-
- std::string archiveName( "" ), mapName( "" );
- separateMapName( rFile, archiveName, mapName );
-
- if ( mapName.empty() )
- {
- if ( !findFirstMapInArchive( Archive, mapName ) )
- {
- return;
- }
- }
-
- Q3BSPFileParser fileParser( mapName, &Archive );
- Q3BSPModel *pBSPModel = fileParser.getModel();
- if ( NULL != pBSPModel )
- {
- CreateDataFromImport( pBSPModel, pScene, &Archive );
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Separates the map name from the import name.
-void Q3BSPFileImporter::separateMapName( const std::string &rImportName, std::string &rArchiveName,
- std::string &rMapName )
-{
- rArchiveName = "";
- rMapName = "";
- if ( rImportName.empty() )
- return;
-
- std::string::size_type pos = rImportName.rfind( "," );
- if ( std::string::npos == pos )
- {
- rArchiveName = rImportName;
- return;
- }
-
- rArchiveName = rImportName.substr( 0, pos );
- rMapName = rImportName.substr( pos, rImportName.size() - pos - 1 );
-}
-
-// ------------------------------------------------------------------------------------------------
-// Returns the first map in the map archive.
-bool Q3BSPFileImporter::findFirstMapInArchive( Q3BSPZipArchive &rArchive, std::string &rMapName )
-{
- rMapName = "";
- std::vector<std::string> fileList;
- rArchive.getFileList( fileList );
- if ( fileList.empty() )
- return false;
-
- for ( std::vector<std::string>::iterator it = fileList.begin(); it != fileList.end();
- ++it )
- {
- std::string::size_type pos = (*it).find( "maps/" );
- if ( std::string::npos != pos )
- {
- std::string::size_type extPos = (*it).find( ".bsp" );
- if ( std::string::npos != extPos )
- {
- rMapName = *it;
- return true;
- }
- }
- }
-
- return false;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Creates the assimp specific data.
-void Q3BSPFileImporter::CreateDataFromImport( const Q3BSP::Q3BSPModel *pModel, aiScene* pScene,
- Q3BSPZipArchive *pArchive )
-{
- if ( NULL == pModel || NULL == pScene )
- return;
-
- pScene->mRootNode = new aiNode;
- if ( !pModel->m_ModelName.empty() )
- {
- pScene->mRootNode->mName.Set( pModel->m_ModelName );
- }
-
- // Create the face to material relation map
- createMaterialMap( pModel );
-
- // Create all nodes
- CreateNodes( pModel, pScene, pScene->mRootNode );
-
- // Create the assigned materials
- createMaterials( pModel, pScene, pArchive );
-}
-
-// ------------------------------------------------------------------------------------------------
-// Creates all assimp nodes.
-void Q3BSPFileImporter::CreateNodes( const Q3BSP::Q3BSPModel *pModel, aiScene* pScene,
- aiNode *pParent )
-{
- ai_assert( NULL != pModel );
- if ( NULL == pModel )
- {
- return;
- }
-
- unsigned int matIdx = 0;
- std::vector<aiMesh*> MeshArray;
- std::vector<aiNode*> NodeArray;
- for ( FaceMapIt it = m_MaterialLookupMap.begin(); it != m_MaterialLookupMap.end(); ++it )
- {
- std::vector<Q3BSP::sQ3BSPFace*> *pArray = (*it).second;
- size_t numVerts = countData( *pArray );
- if ( 0 != numVerts )
- {
- aiMesh* pMesh = new aiMesh;
- aiNode *pNode = CreateTopology( pModel, matIdx, *pArray, pMesh );
- if ( NULL != pNode )
- {
- NodeArray.push_back( pNode );
- MeshArray.push_back( pMesh );
- }
- else
- {
- delete pMesh;
- }
- }
- matIdx++;
- }
-
- pScene->mNumMeshes = MeshArray.size();
- if ( pScene->mNumMeshes > 0 )
- {
- pScene->mMeshes = new aiMesh*[ pScene->mNumMeshes ];
- for ( size_t i = 0; i < MeshArray.size(); i++ )
- {
- aiMesh *pMesh = MeshArray[ i ];
- if ( NULL != pMesh )
- {
- pScene->mMeshes[ i ] = pMesh;
- }
- }
- }
-
- pParent->mNumChildren = MeshArray.size();
- pParent->mChildren = new aiNode*[ pScene->mRootNode->mNumChildren ];
- for ( size_t i=0; i<NodeArray.size(); i++ )
- {
- aiNode *pNode = NodeArray[ i ];
- pNode->mParent = pParent;
- pParent->mChildren[ i ] = pNode;
- pParent->mChildren[ i ]->mMeshes[ 0 ] = i;
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Creates the topology.
-aiNode *Q3BSPFileImporter::CreateTopology( const Q3BSP::Q3BSPModel *pModel,
- unsigned int materialIdx,
- std::vector<sQ3BSPFace*> &rArray,
- aiMesh* pMesh )
-{
- size_t numVerts = countData( rArray );
- if ( 0 == numVerts )
- {
- return NULL;
- }
-
- size_t numFaces = countFaces( rArray );
- if ( 0 == numFaces )
- {
- return NULL;
- }
-
- size_t numTriangles = countTriangles( rArray );
- pMesh->mPrimitiveTypes = aiPrimitiveType_TRIANGLE;
-
- pMesh->mFaces = new aiFace[ numTriangles ];
- pMesh->mNumFaces = numTriangles;
-
- pMesh->mNumVertices = numVerts;
- pMesh->mVertices = new aiVector3D[ numVerts ];
- pMesh->mNormals = new aiVector3D[ numVerts ];
- pMesh->mTextureCoords[ 0 ] = new aiVector3D[ numVerts ];
- pMesh->mTextureCoords[ 1 ] = new aiVector3D[ numVerts ];
- pMesh->mMaterialIndex = materialIdx;
-
- unsigned int faceIdx = 0;
- unsigned int vertIdx = 0;
- pMesh->mNumUVComponents[ 0 ] = 2;
- pMesh->mNumUVComponents[ 1 ] = 2;
- for ( std::vector<sQ3BSPFace*>::const_iterator it = rArray.begin(); it != rArray.end(); ++it )
- {
- Q3BSP::sQ3BSPFace *pQ3BSPFace = *it;
- ai_assert( NULL != pQ3BSPFace );
- if ( NULL == pQ3BSPFace )
- {
- continue;
- }
-
- if ( pQ3BSPFace->iNumOfFaceVerts > 0 )
- {
- if ( pQ3BSPFace->iType == Polygon || pQ3BSPFace->iType == TriangleMesh )
- {
- createTriangleTopology( pModel, pQ3BSPFace, pMesh, faceIdx, vertIdx );
- }
- }
- }
-
- aiNode *pNode = new aiNode;
- pNode->mNumMeshes = 1;
- pNode->mMeshes = new unsigned int[ 1 ];
-
- return pNode;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Creates the triangle topology from a face array.
-void Q3BSPFileImporter::createTriangleTopology( const Q3BSP::Q3BSPModel *pModel,
- Q3BSP::sQ3BSPFace *pQ3BSPFace,
- aiMesh* pMesh,
- unsigned int &rFaceIdx,
- unsigned int &rVertIdx )
-{
- ai_assert( rFaceIdx < pMesh->mNumFaces );
-
- m_pCurrentFace = getNextFace( pMesh, rFaceIdx );
- ai_assert( NULL != m_pCurrentFace );
- if ( NULL == m_pCurrentFace )
- {
- return;
- }
-
- m_pCurrentFace->mNumIndices = 3;
- m_pCurrentFace->mIndices = new unsigned int[ m_pCurrentFace->mNumIndices ];
-
- size_t idx = 0;
- for ( size_t i = 0; i < (size_t) pQ3BSPFace->iNumOfFaceVerts; i++ )
- {
- const size_t index = pQ3BSPFace->iVertexIndex + pModel->m_Indices[ pQ3BSPFace->iFaceVertexIndex + i ];
- ai_assert( index < pModel->m_Vertices.size() );
- if ( index >= pModel->m_Vertices.size() )
- {
- continue;
- }
-
- sQ3BSPVertex *pVertex = pModel->m_Vertices[ index ];
- ai_assert( NULL != pVertex );
- if ( NULL == pVertex )
- {
- continue;
- }
-
- pMesh->mVertices[ rVertIdx ].Set( pVertex->vPosition.x, pVertex->vPosition.y, pVertex->vPosition.z );
- pMesh->mNormals[ rVertIdx ].Set( pVertex->vNormal.x, pVertex->vNormal.y, pVertex->vNormal.z );
-
- pMesh->mTextureCoords[ 0 ][ rVertIdx ].Set( pVertex->vTexCoord.x, pVertex->vTexCoord.y, 0.0f );
- pMesh->mTextureCoords[ 1 ][ rVertIdx ].Set( pVertex->vLightmap.x, pVertex->vLightmap.y, 0.0f );
-
- m_pCurrentFace->mIndices[ idx ] = rVertIdx;
- rVertIdx++;
-
- idx++;
- if ( idx > 2 )
- {
- idx = 0;
- m_pCurrentFace = getNextFace( pMesh, rFaceIdx );
- if ( NULL != m_pCurrentFace )
- {
- m_pCurrentFace->mNumIndices = 3;
- m_pCurrentFace->mIndices = new unsigned int[ 3 ];
- }
- }
- }
- rFaceIdx--;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Creates all referenced materials.
-void Q3BSPFileImporter::createMaterials( const Q3BSP::Q3BSPModel *pModel, aiScene* pScene,
- Q3BSPZipArchive *pArchive )
-{
- if ( m_MaterialLookupMap.empty() )
- {
- return;
- }
-
- pScene->mMaterials = new aiMaterial*[ m_MaterialLookupMap.size() ];
- size_t texIdx( 0 );
- aiString aiMatName;
- int textureId( -1 ), lightmapId( -1 );
- for ( FaceMapIt it = m_MaterialLookupMap.begin(); it != m_MaterialLookupMap.end();
- ++it )
- {
- const std::string matName = (*it).first;
- if ( matName.empty() )
- {
- continue;
- }
-
- aiMatName.Set( matName );
- Assimp::MaterialHelper *pMatHelper = new Assimp::MaterialHelper;
- pMatHelper->AddProperty( &aiMatName, AI_MATKEY_NAME );
-
- extractIds( matName, textureId, lightmapId );
-
- // Adding the texture
- if ( -1 != textureId )
- {
- sQ3BSPTexture *pTexture = pModel->m_Textures[ textureId ];
- if ( NULL != pTexture )
- {
- std::string tmp( "*" ), texName( "" );
- tmp += pTexture->strName;
- tmp += ".jpg";
- normalizePathName( tmp, texName );
-
- if ( !importTextureFromArchive( pModel, pArchive, pScene, pMatHelper, textureId ) )
- {
- }
- }
-
- }
- if ( -1 != lightmapId )
- {
- importLightmap( pModel, pScene, pMatHelper, lightmapId );
- }
- pScene->mMaterials[ pScene->mNumMaterials ] = pMatHelper;
- pScene->mNumMaterials++;
- }
- pScene->mNumTextures = mTextures.size();
- pScene->mTextures = new aiTexture*[ pScene->mNumTextures ];
- std::copy( mTextures.begin(), mTextures.end(), pScene->mTextures );
-}
-
-// ------------------------------------------------------------------------------------------------
-// Counts the number of referenced vertices.
-size_t Q3BSPFileImporter::countData( const std::vector<sQ3BSPFace*> &rArray ) const
-{
- size_t numVerts = 0;
- for ( std::vector<sQ3BSPFace*>::const_iterator it = rArray.begin(); it != rArray.end();
- ++it )
- {
- sQ3BSPFace *pQ3BSPFace = *it;
- if ( pQ3BSPFace->iType == Polygon || pQ3BSPFace->iType == TriangleMesh )
- {
- Q3BSP::sQ3BSPFace *pQ3BSPFace = *it;
- ai_assert( NULL != pQ3BSPFace );
- numVerts += pQ3BSPFace->iNumOfFaceVerts;
- }
- }
-
- return numVerts;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Counts the faces with vertices.
-size_t Q3BSPFileImporter::countFaces( const std::vector<Q3BSP::sQ3BSPFace*> &rArray ) const
-{
- size_t numFaces = 0;
- for ( std::vector<sQ3BSPFace*>::const_iterator it = rArray.begin(); it != rArray.end();
- ++it )
- {
- Q3BSP::sQ3BSPFace *pQ3BSPFace = *it;
- if ( pQ3BSPFace->iNumOfFaceVerts > 0 )
- {
- numFaces++;
- }
- }
-
- return numFaces;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Counts the number of triangles in a Q3-facearray.
-size_t Q3BSPFileImporter::countTriangles( const std::vector<Q3BSP::sQ3BSPFace*> &rArray ) const
-{
- size_t numTriangles = 0;
- for ( std::vector<Q3BSP::sQ3BSPFace*>::const_iterator it = rArray.begin(); it != rArray.end();
- ++it )
- {
- const Q3BSP::sQ3BSPFace *pQ3BSPFace = *it;
- if ( NULL != pQ3BSPFace )
- {
- numTriangles += pQ3BSPFace->iNumOfFaceVerts / 3;
- }
- }
-
- return numTriangles;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Creates the faces-to-material map.
-void Q3BSPFileImporter::createMaterialMap( const Q3BSP::Q3BSPModel *pModel )
-{
- std::string key( "" );
- std::vector<sQ3BSPFace*> *pCurFaceArray = NULL;
- for ( size_t idx = 0; idx < pModel->m_Faces.size(); idx++ )
- {
- Q3BSP::sQ3BSPFace *pQ3BSPFace = pModel->m_Faces[ idx ];
- const int texId = pQ3BSPFace->iTextureID;
- const int lightMapId = pQ3BSPFace->iLightmapID;
- createKey( texId, lightMapId, key );
- FaceMapIt it = m_MaterialLookupMap.find( key );
- if ( m_MaterialLookupMap.end() == it )
- {
- pCurFaceArray = new std::vector<Q3BSP::sQ3BSPFace*>;
- m_MaterialLookupMap[ key ] = pCurFaceArray;
- }
- else
- {
- pCurFaceArray = (*it).second;
- }
- ai_assert( NULL != pCurFaceArray );
- if ( NULL != pCurFaceArray )
- {
- pCurFaceArray->push_back( pQ3BSPFace );
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Returns the next face.
-aiFace *Q3BSPFileImporter::getNextFace( aiMesh *pMesh, unsigned int &rFaceIdx )
-{
- aiFace *pFace = NULL;
- if ( rFaceIdx < pMesh->mNumFaces )
- {
- pFace = &pMesh->mFaces[ rFaceIdx ];
- rFaceIdx++;
- }
- else
- {
- pFace = NULL;
- }
-
- return pFace;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Imports a texture file.
-bool Q3BSPFileImporter::importTextureFromArchive( const Q3BSP::Q3BSPModel *pModel,
- Q3BSP::Q3BSPZipArchive *pArchive, aiScene* pScene,
- Assimp::MaterialHelper *pMatHelper, int textureId )
-{
- if ( NULL == pArchive || NULL == pArchive || NULL == pMatHelper )
- {
- return false;
- }
-
- if ( textureId < 0 || textureId >= static_cast<int>( pModel->m_Textures.size() ) )
- {
- return false;
- }
-
- bool res = true;
- sQ3BSPTexture *pTexture = pModel->m_Textures[ textureId ];
- if ( NULL == pTexture )
- return false;
-
- std::string textureName = pTexture->strName;
- textureName += ".jpg";
- if ( pArchive->Exists( textureName.c_str() ) )
- {
- IOStream *pTextureStream = pArchive->Open( textureName.c_str() );
- if ( NULL != pTextureStream )
- {
- size_t texSize = pTextureStream->FileSize();
- aiTexture *pTexture = new aiTexture;
- pTexture->mHeight = 0;
- pTexture->mWidth = texSize;
- unsigned char *pData = new unsigned char[ pTexture->mWidth ];
- size_t readSize = pTextureStream->Read( pData, sizeof( unsigned char ), pTexture->mWidth );
- ai_assert( readSize == pTexture->mWidth );
- pTexture->pcData = reinterpret_cast<aiTexel*>( pData );
- pTexture->achFormatHint[ 0 ] = 'j';
- pTexture->achFormatHint[ 1 ] = 'p';
- pTexture->achFormatHint[ 2 ] = 'g';
- pTexture->achFormatHint[ 2 ] = '\0';
- res = true;
-
- aiString name;
- name.data[ 0 ] = '*';
- name.length = 1 + ASSIMP_itoa10( name.data + 1, MAXLEN-1, mTextures.size() );
-
- pArchive->Close( pTextureStream );
-
- pMatHelper->AddProperty( &name, AI_MATKEY_TEXTURE_DIFFUSE( 0 ) );
- mTextures.push_back( pTexture );
- }
- }
-
- return res;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Imports a lightmap file.
-bool Q3BSPFileImporter::importLightmap( const Q3BSP::Q3BSPModel *pModel, aiScene* pScene,
- Assimp::MaterialHelper *pMatHelper, int lightmapId )
-{
- if ( NULL == pModel || NULL == pScene || NULL == pMatHelper )
- {
- return false;
- }
-
- if ( lightmapId < 0 || lightmapId >= static_cast<int>( pModel->m_Lightmaps.size() ) )
- {
- return false;
- }
-
- sQ3BSPLightmap *pLightMap = pModel->m_Lightmaps[ lightmapId ];
- if ( NULL == pLightMap )
- {
- return false;
- }
-
- aiTexture *pTexture = new aiTexture;
- pTexture->mHeight = 0;
- pTexture->mWidth = CE_BSP_LIGHTMAPWIDTH * CE_BSP_LIGHTMAPHEIGHT;
-
- unsigned char *pData = new unsigned char[ pTexture->mWidth ];
- pTexture->pcData = reinterpret_cast<aiTexel*>( pData );
-
- pTexture->achFormatHint[ 0 ] = 'b';
- pTexture->achFormatHint[ 1 ] = 'm';
- pTexture->achFormatHint[ 2 ] = 'p';
- pTexture->achFormatHint[ 3 ] = '\0';
-
- memcpy( pTexture->pcData, pLightMap->bLMapData, pTexture->mWidth );
-
- aiString name;
- name.data[ 0 ] = '*';
- name.length = 1 + ASSIMP_itoa10( name.data + 1, MAXLEN-1, mTextures.size() );
-
- pMatHelper->AddProperty( &name,AI_MATKEY_TEXTURE_LIGHTMAP( 1 ) );
- mTextures.push_back( pTexture );
-
- return true;
-}
-
-// ------------------------------------------------------------------------------------------------
-
-} // Namespace Assimp
-
-#endif // ASSIMP_BUILD_NO_Q3BSP_IMPORTER
diff --git a/3rdparty/assimp/code/Q3BSPFileImporter.h b/3rdparty/assimp/code/Q3BSPFileImporter.h
deleted file mode 100644
index fa2e215a..00000000
--- a/3rdparty/assimp/code/Q3BSPFileImporter.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2008, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-#ifndef ASSIMP_Q3BSPFILEIMPORTER_H_INC
-#define ASSIMP_Q3BSPFILEIMPORTER_H_INC
-
-#include "BaseImporter.h"
-
-struct aiMesh;
-
-namespace Assimp
-{
-namespace Q3BSP
-{
-
-class Q3BSPZipArchive;
-struct Q3BSPModel;
-struct sQ3BSPFace;
-
-}
-
-/** Loader to import BSP-levels from a PK3 archive or from a unpacked BSP-level.
- */
-class Q3BSPFileImporter : BaseImporter
-{
- friend class Importer;
-
-protected:
- /// @brief Default constructor.
- Q3BSPFileImporter();
-
- /// @brief Destructor.
- ~Q3BSPFileImporter();
-
-public:
- /// @brief Returns whether the class can handle the format of the given file.
- /// @remark See BaseImporter::CanRead() for details.
- bool CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig ) const;
-
-private:
- typedef std::map<std::string, std::vector<Q3BSP::sQ3BSPFace*>*> FaceMap;
- typedef std::map<std::string, std::vector<Q3BSP::sQ3BSPFace*>* >::iterator FaceMapIt;
- typedef std::map<std::string, std::vector<Q3BSP::sQ3BSPFace*>*>::const_iterator FaceMapConstIt;
-
- void GetExtensionList(std::set<std::string>& extensions);
- void InternReadFile(const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler);
- void separateMapName( const std::string &rImportName, std::string &rArchiveName, std::string &rMapName );
- bool findFirstMapInArchive( Q3BSP::Q3BSPZipArchive &rArchive, std::string &rMapName );
- void CreateDataFromImport( const Q3BSP::Q3BSPModel *pModel, aiScene* pScene, Q3BSP::Q3BSPZipArchive *pArchive );
- void CreateNodes( const Q3BSP::Q3BSPModel *pModel, aiScene* pScene, aiNode *pParent );
- aiNode *CreateTopology( const Q3BSP::Q3BSPModel *pModel, unsigned int materialIdx,
- std::vector<Q3BSP::sQ3BSPFace*> &rArray, aiMesh* pMesh );
- void createTriangleTopology( const Q3BSP::Q3BSPModel *pModel, Q3BSP::sQ3BSPFace *pQ3BSPFace, aiMesh* pMesh, unsigned int &rFaceIdx,
- unsigned int &rVertIdx );
- void createMaterials( const Q3BSP::Q3BSPModel *pModel, aiScene* pScene, Q3BSP::Q3BSPZipArchive *pArchive );
- size_t countData( const std::vector<Q3BSP::sQ3BSPFace*> &rArray ) const;
- size_t countFaces( const std::vector<Q3BSP::sQ3BSPFace*> &rArray ) const;
- size_t countTriangles( const std::vector<Q3BSP::sQ3BSPFace*> &rArray ) const;
- void createMaterialMap( const Q3BSP::Q3BSPModel *pModel);
- aiFace *getNextFace( aiMesh *pMesh, unsigned int &rFaceIdx );
- bool importTextureFromArchive( const Q3BSP::Q3BSPModel *pModel, Q3BSP::Q3BSPZipArchive *pArchive, aiScene* pScene,
- Assimp::MaterialHelper *pMatHelper, int textureId );
- bool importLightmap( const Q3BSP::Q3BSPModel *pModel, aiScene* pScene, Assimp::MaterialHelper *pMatHelper, int lightmapId );
-
-private:
- aiMesh *m_pCurrentMesh;
- aiFace *m_pCurrentFace;
- FaceMap m_MaterialLookupMap;
- std::vector<aiTexture*> mTextures;
-};
-
-} // Namespace Assimp
-
-#endif // ASSIMP_Q3BSPFILEIMPORTER_H_INC
diff --git a/3rdparty/assimp/code/Q3BSPFileParser.cpp b/3rdparty/assimp/code/Q3BSPFileParser.cpp
deleted file mode 100644
index 09411ca5..00000000
--- a/3rdparty/assimp/code/Q3BSPFileParser.cpp
+++ /dev/null
@@ -1,272 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2008, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-#include "AssimpPCH.h"
-#include "Q3BSPFileParser.h"
-#include "DefaultIOSystem.h"
-#include "Q3BSPFileData.h"
-#include "Q3BSPZipArchive.h"
-#include <vector>
-
-namespace Assimp
-{
-
-using namespace Q3BSP;
-
-// ------------------------------------------------------------------------------------------------
-Q3BSPFileParser::Q3BSPFileParser( const std::string &rMapName, Q3BSPZipArchive *pZipArchive ) :
- m_sOffset( 0 ),
- m_Data(),
- m_pModel( NULL ),
- m_pZipArchive( pZipArchive )
-{
- ai_assert( NULL != m_pZipArchive );
- ai_assert( !rMapName.empty() );
-
- if ( !readData( rMapName ) )
- return;
-
- m_pModel = new Q3BSPModel;
- m_pModel->m_ModelName = rMapName;
- if ( !parseFile() )
- {
- delete m_pModel;
- m_pModel = NULL;
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-Q3BSPFileParser::~Q3BSPFileParser()
-{
- delete m_pModel;
- m_pModel = NULL;
-}
-
-// ------------------------------------------------------------------------------------------------
-Q3BSP::Q3BSPModel *Q3BSPFileParser::getModel() const
-{
- return m_pModel;
-}
-
-// ------------------------------------------------------------------------------------------------
-bool Q3BSPFileParser::readData( const std::string &rMapName )
-{
- if ( !m_pZipArchive->Exists( rMapName.c_str() ) )
- return false;
-
- IOStream *pMapFile = m_pZipArchive->Open( rMapName.c_str() );
- if ( NULL == pMapFile )
- return false;
-
- const size_t size = pMapFile->FileSize();
- m_Data.resize( size );
-
- const size_t readSize = pMapFile->Read( &m_Data[0], sizeof( char ), size );
- if ( readSize != size )
- {
- m_Data.clear();
- return false;
- }
- m_pZipArchive->Close( pMapFile );
-
- return true;
-}
-
-// ------------------------------------------------------------------------------------------------
-bool Q3BSPFileParser::parseFile()
-{
- if ( m_Data.empty() )
- {
- return false;
- }
-
- if ( !validateFormat() )
- {
- return false;
- }
-
- // Imports the dictionary of the level
- getLumps();
-
- // Conunt data and prepare model data
- countLumps();
-
- // Read in Vertices
- getVertices();
-
- // Read in Indices
- getIndices();
-
- // Read Faces
- getFaces();
-
- // Read Textures
- getTextures();
-
- // Read Lightmaps
- getLightMaps();
-
- // Load the entities
- getEntities();
-
- return true;
-}
-
-// ------------------------------------------------------------------------------------------------
-bool Q3BSPFileParser::validateFormat()
-{
- sQ3BSPHeader *pHeader = (sQ3BSPHeader*) &m_Data[ 0 ];
- m_sOffset += sizeof( sQ3BSPHeader );
-
- // Version and identify string validation
- if (pHeader->strID[ 0 ] != 'I' || pHeader->strID[ 1 ] != 'B' || pHeader->strID[ 2 ] != 'S'
- || pHeader->strID[ 3 ] != 'P')
- {
- return false;
- }
-
- return true;
-}
-
-// ------------------------------------------------------------------------------------------------
-void Q3BSPFileParser::getLumps()
-{
- size_t Offset = m_sOffset;
- m_pModel->m_Lumps.resize( kMaxLumps );
- for ( size_t idx=0; idx < kMaxLumps; idx++ )
- {
- sQ3BSPLump *pLump = new sQ3BSPLump;
- memcpy( pLump, &m_Data[ Offset ], sizeof( sQ3BSPLump ) );
- Offset += sizeof( sQ3BSPLump );
- m_pModel->m_Lumps[ idx ] = pLump;
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void Q3BSPFileParser::countLumps()
-{
- m_pModel->m_Vertices.resize( m_pModel->m_Lumps[ kVertices ]->iSize / sizeof( sQ3BSPVertex ) );
- m_pModel->m_Indices.resize( m_pModel->m_Lumps[ kMeshVerts ]->iSize / sizeof( int ) );
- m_pModel->m_Faces.resize( m_pModel->m_Lumps[ kFaces ]->iSize / sizeof( sQ3BSPFace ) );
- m_pModel->m_Textures.resize( m_pModel->m_Lumps[ kTextures ]->iSize / sizeof( sQ3BSPTexture ) );
- m_pModel->m_Lightmaps.resize( m_pModel->m_Lumps[ kLightmaps ]->iSize / sizeof( sQ3BSPLightmap ) );
-}
-
-// ------------------------------------------------------------------------------------------------
-void Q3BSPFileParser::getVertices()
-{
- size_t Offset = m_pModel->m_Lumps[ kVertices ]->iOffset;
- for ( size_t idx = 0; idx < m_pModel->m_Vertices.size(); idx++ )
- {
- sQ3BSPVertex *pVertex = new sQ3BSPVertex;
- memcpy( pVertex, &m_Data[ Offset ], sizeof( sQ3BSPVertex ) );
- Offset += sizeof( sQ3BSPVertex );
- m_pModel->m_Vertices[ idx ] = pVertex;
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void Q3BSPFileParser::getIndices()
-{
- ai_assert( NULL != m_pModel );
-
- sQ3BSPLump *lump = m_pModel->m_Lumps[ kMeshVerts ];
- size_t Offset = (size_t) lump->iOffset;
- const size_t nIndices = lump->iSize / sizeof( int );
- m_pModel->m_Indices.resize( nIndices );
- memcpy( &m_pModel->m_Indices[ 0 ], &m_Data[ Offset ], lump->iSize );
-}
-
-// ------------------------------------------------------------------------------------------------
-void Q3BSPFileParser::getFaces()
-{
- ai_assert( NULL != m_pModel );
-
- size_t Offset = m_pModel->m_Lumps[ kFaces ]->iOffset;
- for ( size_t idx = 0; idx < m_pModel->m_Faces.size(); idx++ )
- {
- sQ3BSPFace *pFace = new sQ3BSPFace;
- memcpy( pFace, &m_Data[ Offset ], sizeof( sQ3BSPFace ) );
- m_pModel->m_Faces[ idx ] = pFace;
- Offset += sizeof( sQ3BSPFace );
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void Q3BSPFileParser::getTextures()
-{
- ai_assert( NULL != m_pModel );
-
- size_t Offset = m_pModel->m_Lumps[ kTextures ]->iOffset;
- for ( size_t idx=0; idx < m_pModel->m_Textures.size(); idx++ )
- {
- sQ3BSPTexture *pTexture = new sQ3BSPTexture;
- memcpy( pTexture, &m_Data[ Offset ], sizeof(sQ3BSPTexture) );
- m_pModel->m_Textures[ idx ] = pTexture;
- Offset += sizeof(sQ3BSPTexture);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void Q3BSPFileParser::getLightMaps()
-{
- ai_assert( NULL != m_pModel );
-
- size_t Offset = m_pModel->m_Lumps[kLightmaps]->iOffset;
- for ( size_t idx=0; idx < m_pModel->m_Lightmaps.size(); idx++ )
- {
- sQ3BSPLightmap *pLightmap = new sQ3BSPLightmap;
- memcpy( pLightmap, &m_Data[ Offset ], sizeof( sQ3BSPLightmap ) );
- Offset += sizeof( sQ3BSPLightmap );
- m_pModel->m_Lightmaps[ idx ] = pLightmap;
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void Q3BSPFileParser::getEntities()
-{
- int size = m_pModel->m_Lumps[ kEntities ]->iSize;
- m_pModel->m_EntityData.resize( size );
- size_t Offset = m_pModel->m_Lumps[ kEntities ]->iOffset;
- memcpy( &m_pModel->m_EntityData[ 0 ], &m_Data[ Offset ], sizeof( char ) * size );
-}
-
-// ------------------------------------------------------------------------------------------------
-
-} // Namespace Assimp
diff --git a/3rdparty/assimp/code/Q3BSPFileParser.h b/3rdparty/assimp/code/Q3BSPFileParser.h
deleted file mode 100644
index a049dc29..00000000
--- a/3rdparty/assimp/code/Q3BSPFileParser.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2008, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-#ifndef ASSIMP_Q3BSPFILEPARSER_H_INC
-#define ASSIMP_Q3BSPFILEPARSER_H_INC
-
-#include "BaseImporter.h"
-#include <string>
-
-namespace Assimp
-{
-namespace Q3BSP
-{
-
-class Q3BSPZipArchive;
-struct Q3BSPModel;
-class ZipFile;
-
-}
-
-// -------------------------------------------------------------------
-// -------------------------------------------------------------------
-class Q3BSPFileParser
-{
-public:
- Q3BSPFileParser( const std::string &rMapName, Q3BSP::Q3BSPZipArchive *pZipArchive );
- ~Q3BSPFileParser();
- Q3BSP::Q3BSPModel *getModel() const;
-
-protected:
- bool readData(const std::string &rMapName);
- bool parseFile();
- bool validateFormat();
- void getLumps();
- void countLumps();
- void getVertices();
- void getIndices();
- void getFaces();
- void getTextures();
- void getLightMaps();
- void getEntities();
-
-private:
- size_t m_sOffset;
- std::vector<char> m_Data;
- Q3BSP::Q3BSPModel *m_pModel;
- Q3BSP::Q3BSPZipArchive *m_pZipArchive;
-};
-
-} // Namespace Assimp
-
-#endif // ASSIMP_Q3BSPFILEPARSER_H_INC
diff --git a/3rdparty/assimp/code/Q3BSPZipArchive.cpp b/3rdparty/assimp/code/Q3BSPZipArchive.cpp
deleted file mode 100644
index 76a4156f..00000000
--- a/3rdparty/assimp/code/Q3BSPZipArchive.cpp
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2008, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-#include "AssimpPCH.h"
-#include "Q3BSPZipArchive.h"
-#include <algorithm>
-#include <cassert>
-
-namespace Assimp
-{
-namespace Q3BSP
-{
-
-// ------------------------------------------------------------------------------------------------
-// Constructor.
-Q3BSPZipArchive::Q3BSPZipArchive( const std::string& rFile ) :
- m_ZipFileHandle( NULL ),
- m_FileList(),
- m_bDirty( true )
-{
- if ( !rFile.empty() )
- {
- m_ZipFileHandle = unzOpen( rFile.c_str() );
- if ( NULL != m_ZipFileHandle )
- {
- mapArchive();
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor.
-Q3BSPZipArchive::~Q3BSPZipArchive()
-{
- if ( NULL != m_ZipFileHandle )
- {
- unzClose( m_ZipFileHandle );
- }
- m_ZipFileHandle = NULL;
- m_FileList.clear();
-}
-
-// ------------------------------------------------------------------------------------------------
-// Returns true, if the archive is already open.
-bool Q3BSPZipArchive::isOpen() const
-{
- return ( NULL != m_ZipFileHandle );
-}
-
-// ------------------------------------------------------------------------------------------------
-// Returns true, if the filename is part of the archive.
-bool Q3BSPZipArchive::Exists( const char* pFile ) const
-{
- ai_assert( NULL != pFile );
- if ( NULL == pFile )
- {
- return false;
- }
-
- std::string rFile( pFile );
- std::vector<std::string>::const_iterator it = std::find( m_FileList.begin(), m_FileList.end(), rFile );
- if ( m_FileList.end() == it )
- {
- return false;
- }
-
- return true;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Returns the separator delimiter.
-char Q3BSPZipArchive::getOsSeparator() const
-{
- return '/';
-}
-
-// ------------------------------------------------------------------------------------------------
-// Opens a file, which is part of the archive.
-IOStream *Q3BSPZipArchive::Open( const char* pFile, const char* pMode )
-{
- ai_assert( NULL != pFile );
-
- std::string rItem( pFile );
- std::vector<std::string>::iterator it = std::find( m_FileList.begin(), m_FileList.end(), rItem );
- if ( m_FileList.end() == it )
- return NULL;
-
- ZipFile *pZipFile = new ZipFile( *it, m_ZipFileHandle );
- m_ArchiveMap[ rItem ] = pZipFile;
-
- return pZipFile;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Close a filestream.
-void Q3BSPZipArchive::Close( IOStream *pFile )
-{
- ai_assert( NULL != pFile );
-
- std::map<std::string, IOStream*>::iterator it;
- for ( it = m_ArchiveMap.begin(); it != m_ArchiveMap.end(); ++it )
- {
- if ( (*it).second == pFile )
- {
- ZipFile *pZipFile = reinterpret_cast<ZipFile*>( (*it).second );
- delete pZipFile;
- m_ArchiveMap.erase( it );
- break;
- }
- }
-}
-// ------------------------------------------------------------------------------------------------
-// Returns the file-list of the archive.
-void Q3BSPZipArchive::getFileList( std::vector<std::string> &rFileList )
-{
- rFileList = m_FileList;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Maps the archive content.
-bool Q3BSPZipArchive::mapArchive()
-{
- if ( NULL == m_ZipFileHandle )
- return false;
-
- if ( !m_bDirty )
- return true;
-
- if ( !m_FileList.empty() )
- m_FileList.resize( 0 );
-
- // At first ensure file is already open
- if ( UNZ_OK == unzGoToFirstFile( m_ZipFileHandle ) )
- {
- char filename[ FileNameSize ];
- unzGetCurrentFileInfo( m_ZipFileHandle, NULL, filename, FileNameSize, NULL, 0, NULL, 0 );
- m_FileList.push_back( filename );
- unzCloseCurrentFile( m_ZipFileHandle );
-
- // Loop over all files
- while ( unzGoToNextFile( m_ZipFileHandle ) != UNZ_END_OF_LIST_OF_FILE )
- {
- char filename[ FileNameSize ];
- unzGetCurrentFileInfo( m_ZipFileHandle, NULL, filename, FileNameSize, NULL, 0, NULL, 0 );
- m_FileList.push_back( filename );
- unzCloseCurrentFile( m_ZipFileHandle );
- }
- }
-
- std::sort( m_FileList.begin(), m_FileList.end() );
- m_bDirty = false;
-
- return true;
-}
-
-// ------------------------------------------------------------------------------------------------
-
-} // Namespace Q3BSP
-} // Namespace Assimp
diff --git a/3rdparty/assimp/code/Q3BSPZipArchive.h b/3rdparty/assimp/code/Q3BSPZipArchive.h
deleted file mode 100644
index d924e88a..00000000
--- a/3rdparty/assimp/code/Q3BSPZipArchive.h
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2008, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-#ifndef AI_Q3BSP_ZIPARCHIVE_H_INC
-#define AI_Q3BSP_ZIPARCHIVE_H_INC
-
-#include "../contrib/unzip/unzip.h"
-#include "../include/IOStream.h"
-#include "../include/IOSystem.h"
-#include <string>
-#include <vector>
-#include <map>
-#include <cassert>
-
-namespace Assimp
-{
-namespace Q3BSP
-{
-
-// ------------------------------------------------------------------------------------------------
-/// \class ZipFile
-/// \ingroup Assimp::Q3BSP
-///
-/// \brief
-// ------------------------------------------------------------------------------------------------
-class ZipFile : public IOStream
-{
-public:
- ZipFile( const std::string &rFileName, unzFile zipFile ) :
- m_Name( rFileName ),
- m_zipFile( zipFile )
- {
- ai_assert( NULL != m_zipFile );
- }
-
- ~ZipFile()
- {
- m_zipFile = NULL;
- }
-
- size_t Read(void* pvBuffer, size_t pSize, size_t pCount )
- {
- size_t bytes_read = 0;
- if ( NULL == m_zipFile )
- return bytes_read;
-
- // search file and place file pointer there
- if ( unzLocateFile( m_zipFile, m_Name.c_str(), 0 ) == UNZ_OK )
- {
- // get file size, etc.
- unz_file_info fileInfo;
- unzGetCurrentFileInfo( m_zipFile, &fileInfo, 0, 0, 0, 0, 0, 0 );
- const size_t size = pSize * pCount;
- assert( size <= fileInfo.uncompressed_size );
-
- // The file has EXACTLY the size of uncompressed_size. In C
- // you need to mark the last character with '\0', so add
- // another character
- unzOpenCurrentFile( m_zipFile );
- bytes_read = unzReadCurrentFile( m_zipFile, pvBuffer, fileInfo.uncompressed_size);
- if ( bytes_read < 0 || bytes_read != static_cast<size_t>( fileInfo.uncompressed_size ) )
- {
- return 0;
- }
- size_t filesize = fileInfo.uncompressed_size;
- unzCloseCurrentFile( m_zipFile );
- }
- return bytes_read;
- }
-
- size_t Write(const void* pvBuffer, size_t pSize, size_t pCount)
- {
- return 0;
- }
-
- size_t FileSize() const
- {
- if ( NULL == m_zipFile )
- return 0;
- if ( unzLocateFile( m_zipFile, m_Name.c_str(), 0 ) == UNZ_OK )
- {
- unz_file_info fileInfo;
- unzGetCurrentFileInfo( m_zipFile, &fileInfo, 0, 0, 0, 0, 0, 0 );
- return fileInfo.uncompressed_size;
- }
- return 0;
- }
-
- aiReturn Seek(size_t pOffset, aiOrigin pOrigin)
- {
- return aiReturn_FAILURE;
- }
-
- size_t Tell() const
- {
- return 0;
- }
-
- void Flush()
- {
- // empty
- }
-
-private:
- std::string m_Name;
- unzFile m_zipFile;
-};
-
-// ------------------------------------------------------------------------------------------------
-/// \class Q3BSPZipArchive
-/// \ingroup Assimp::Q3BSP
-///
-/// \brief IMplements a zip archive like the WinZip archives. Will be also used to import data
-/// from a P3K archive ( Quake level format ).
-// ------------------------------------------------------------------------------------------------
-class Q3BSPZipArchive : public Assimp::IOSystem
-{
-public:
- static const unsigned int FileNameSize = 256;
-
-public:
- Q3BSPZipArchive( const std::string & rFile );
- ~Q3BSPZipArchive();
- bool Exists( const char* pFile) const;
- char getOsSeparator() const;
- IOStream* Open(const char* pFile, const char* pMode = "rb");
- void Close( IOStream* pFile);
- bool isOpen() const;
- void getFileList( std::vector<std::string> &rFileList );
-
-private:
- bool mapArchive();
-
-private:
- unzFile m_ZipFileHandle;
- std::map<std::string, IOStream*> m_ArchiveMap;
- std::vector<std::string> m_FileList;
- bool m_bDirty;
-};
-
-// ------------------------------------------------------------------------------------------------
-
-} // Namespace Q3BSP
-} // Namespace Assimp
-
-#endif // AI_Q3BSP_ZIPARCHIVE_H_INC
diff --git a/3rdparty/assimp/code/Q3DLoader.cpp b/3rdparty/assimp/code/Q3DLoader.cpp
deleted file mode 100644
index 05c4a2ac..00000000
--- a/3rdparty/assimp/code/Q3DLoader.cpp
+++ /dev/null
@@ -1,600 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file Q3DLoader.cpp
- * @brief Implementation of the Q3D importer class
- */
-
-#include "AssimpPCH.h"
-#ifndef ASSIMP_BUILD_NO_Q3D_IMPORTER
-
-// internal headers
-#include "Q3DLoader.h"
-#include "StreamReader.h"
-#include "fast_atof.h"
-
-using namespace Assimp;
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-Q3DImporter::Q3DImporter()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-Q3DImporter::~Q3DImporter()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the class can handle the format of the given file.
-bool Q3DImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const
-{
- const std::string extension = GetExtension(pFile);
-
- if (extension == "q3s" || extension == "q3o")
- return true;
- else if (!extension.length() || checkSig) {
- if (!pIOHandler)
- return true;
- const char* tokens[] = {"quick3Do","quick3Ds"};
- return SearchFileHeaderForToken(pIOHandler,pFile,tokens,2);
- }
- return false;
-}
-
-// ------------------------------------------------------------------------------------------------
-void Q3DImporter::GetExtensionList(std::set<std::string>& extensions)
-{
- extensions.insert("q3o");
- extensions.insert("q3s");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Imports the given file into the given scene structure.
-void Q3DImporter::InternReadFile( const std::string& pFile,
- aiScene* pScene, IOSystem* pIOHandler)
-{
- StreamReaderLE stream(pIOHandler->Open(pFile,"rb"));
-
- // The header is 22 bytes large
- if (stream.GetRemainingSize() < 22)
- throw DeadlyImportError("File is either empty or corrupt: " + pFile);
-
- // Check the file's signature
- if (ASSIMP_strincmp( (const char*)stream.GetPtr(), "quick3Do", 8 ) &&
- ASSIMP_strincmp( (const char*)stream.GetPtr(), "quick3Ds", 8 ))
- {
- throw DeadlyImportError("Not a Quick3D file. Signature string is: " +
- std::string((const char*)stream.GetPtr(),8));
- }
-
- // Print the file format version
- DefaultLogger::get()->info("Quick3D File format version: " +
- std::string(&((const char*)stream.GetPtr())[8],2));
-
- // ... an store it
- char major = ((const char*)stream.GetPtr())[8];
- char minor = ((const char*)stream.GetPtr())[9];
-
- stream.IncPtr(10);
- unsigned int numMeshes = (unsigned int)stream.GetI4();
- unsigned int numMats = (unsigned int)stream.GetI4();
- unsigned int numTextures = (unsigned int)stream.GetI4();
-
- std::vector<Material> materials;
- materials.reserve(numMats);
-
- std::vector<Mesh> meshes;
- meshes.reserve(numMeshes);
-
- // Allocate the scene root node
- pScene->mRootNode = new aiNode();
-
- aiColor3D fgColor (0.6f,0.6f,0.6f);
-
- // Now read all file chunks
- while (true)
- {
- if (stream.GetRemainingSize() < 1)break;
- char c = stream.GetI1();
- switch (c)
- {
- // Meshes chunk
- case 'm':
- {
- for (unsigned int quak = 0; quak < numMeshes; ++quak)
- {
- meshes.push_back(Mesh());
- Mesh& mesh = meshes.back();
-
- // read all vertices
- unsigned int numVerts = (unsigned int)stream.GetI4();
- if (!numVerts)
- throw DeadlyImportError("Quick3D: Found mesh with zero vertices");
-
- std::vector<aiVector3D>& verts = mesh.verts;
- verts.resize(numVerts);
-
- for (unsigned int i = 0; i < numVerts;++i)
- {
- verts[i].x = stream.GetF4();
- verts[i].y = stream.GetF4();
- verts[i].z = stream.GetF4();
- }
-
- // read all faces
- numVerts = (unsigned int)stream.GetI4();
- if (!numVerts)
- throw DeadlyImportError("Quick3D: Found mesh with zero faces");
-
- std::vector<Face >& faces = mesh.faces;
- faces.reserve(numVerts);
-
- // number of indices
- for (unsigned int i = 0; i < numVerts;++i)
- {
- faces.push_back(Face(stream.GetI2()) );
- if (faces.back().indices.empty())
- throw DeadlyImportError("Quick3D: Found face with zero indices");
- }
-
- // indices
- for (unsigned int i = 0; i < numVerts;++i)
- {
- Face& vec = faces[i];
- for (unsigned int a = 0; a < (unsigned int)vec.indices.size();++a)
- vec.indices[a] = stream.GetI4();
- }
-
- // material indices
- for (unsigned int i = 0; i < numVerts;++i)
- {
- faces[i].mat = (unsigned int)stream.GetI4();
- }
-
- // read all normals
- numVerts = (unsigned int)stream.GetI4();
- std::vector<aiVector3D>& normals = mesh.normals;
- normals.resize(numVerts);
-
- for (unsigned int i = 0; i < numVerts;++i)
- {
- normals[i].x = stream.GetF4();
- normals[i].y = stream.GetF4();
- normals[i].z = stream.GetF4();
- }
-
- numVerts = (unsigned int)stream.GetI4();
- if (numTextures && numVerts)
- {
- // read all texture coordinates
- std::vector<aiVector3D>& uv = mesh.uv;
- uv.resize(numVerts);
-
- for (unsigned int i = 0; i < numVerts;++i)
- {
- uv[i].x = stream.GetF4();
- uv[i].y = stream.GetF4();
- }
-
- // UV indices
- for (unsigned int i = 0; i < (unsigned int)faces.size();++i)
- {
- Face& vec = faces[i];
- for (unsigned int a = 0; a < (unsigned int)vec.indices.size();++a)
- {
- vec.uvindices[a] = stream.GetI4();
- if (!i && !a)
- mesh.prevUVIdx = vec.uvindices[a];
- else if (vec.uvindices[a] != mesh.prevUVIdx)
- mesh.prevUVIdx = 0xffffffff;
- }
- }
- }
-
- // we don't need the rest, but we need to get to the next chunk
- stream.IncPtr(36);
- if (minor > '0' && major == '3')
- stream.IncPtr(mesh.faces.size());
- }
- // stream.IncPtr(4); // unknown value here
- }
- break;
-
- // materials chunk
- case 'c':
-
- for (unsigned int i = 0; i < numMats; ++i)
- {
- materials.push_back(Material());
- Material& mat = materials.back();
-
- // read the material name
- while (( c = stream.GetI1()))
- mat.name.data[mat.name.length++] = c;
-
- // add the terminal character
- mat.name.data[mat.name.length] = '\0';
-
- // read the ambient color
- mat.ambient.r = stream.GetF4();
- mat.ambient.g = stream.GetF4();
- mat.ambient.b = stream.GetF4();
-
- // read the diffuse color
- mat.diffuse.r = stream.GetF4();
- mat.diffuse.g = stream.GetF4();
- mat.diffuse.b = stream.GetF4();
-
- // read the ambient color
- mat.specular.r = stream.GetF4();
- mat.specular.g = stream.GetF4();
- mat.specular.b = stream.GetF4();
-
- // read the transparency
- mat.transparency = stream.GetF4();
-
- // unknown value here
- // stream.IncPtr(4);
- // FIX: it could be the texture index ...
- mat.texIdx = (unsigned int)stream.GetI4();
- }
-
- break;
-
- // texture chunk
- case 't':
-
- pScene->mNumTextures = numTextures;
- if (!numTextures)break;
- pScene->mTextures = new aiTexture*[pScene->mNumTextures];
- // to make sure we won't crash if we leave through an exception
- ::memset(pScene->mTextures,0,sizeof(void*)*pScene->mNumTextures);
- for (unsigned int i = 0; i < pScene->mNumTextures; ++i)
- {
- aiTexture* tex = pScene->mTextures[i] = new aiTexture();
-
- // skip the texture name
- while (stream.GetI1());
-
- // read texture width and height
- tex->mWidth = (unsigned int)stream.GetI4();
- tex->mHeight = (unsigned int)stream.GetI4();
-
- if (!tex->mWidth || !tex->mHeight)
- throw DeadlyImportError("Quick3D: Invalid texture. Width or height is zero");
-
- register unsigned int mul = tex->mWidth * tex->mHeight;
- aiTexel* begin = tex->pcData = new aiTexel[mul];
- aiTexel* const end = & begin [mul];
-
- for (;begin != end; ++begin)
- {
- begin->r = stream.GetI1();
- begin->g = stream.GetI1();
- begin->b = stream.GetI1();
- begin->a = 0xff;
- }
- }
-
- break;
-
- // scene chunk
- case 's':
- {
- // skip position and rotation
- stream.IncPtr(12);
-
- for (unsigned int i = 0; i < 4;++i)
- for (unsigned int a = 0; a < 4;++a)
- pScene->mRootNode->mTransformation[i][a] = stream.GetF4();
-
- stream.IncPtr(16);
-
- // now setup a single camera
- pScene->mNumCameras = 1;
- pScene->mCameras = new aiCamera*[1];
- aiCamera* cam = pScene->mCameras[0] = new aiCamera();
- cam->mPosition.x = stream.GetF4();
- cam->mPosition.y = stream.GetF4();
- cam->mPosition.z = stream.GetF4();
- cam->mName.Set("Q3DCamera");
-
- // skip eye rotation for the moment
- stream.IncPtr(12);
-
- // read the default material color
- fgColor .r = stream.GetF4();
- fgColor .g = stream.GetF4();
- fgColor .b = stream.GetF4();
-
- // skip some unimportant properties
- stream.IncPtr(29);
-
- // setup a single point light with no attenuation
- pScene->mNumLights = 1;
- pScene->mLights = new aiLight*[1];
- aiLight* light = pScene->mLights[0] = new aiLight();
- light->mName.Set("Q3DLight");
- light->mType = aiLightSource_POINT;
-
- light->mAttenuationConstant = 1;
- light->mAttenuationLinear = 0;
- light->mAttenuationQuadratic = 0;
-
- light->mColorDiffuse.r = stream.GetF4();
- light->mColorDiffuse.g = stream.GetF4();
- light->mColorDiffuse.b = stream.GetF4();
-
- light->mColorSpecular = light->mColorDiffuse;
-
-
- // We don't need the rest, but we need to know where
- // this fucking chunk ends.
- unsigned int temp = (unsigned int)(stream.GetI4() * stream.GetI4());
-
- // skip the background file name
- while (stream.GetI1());
-
- // skip background texture data + the remaining fields
- stream.IncPtr(temp*3 + 20); // 4 bytes of unknown data here
-
- // TODO
- goto outer;
- }
- break;
-
- default:
- throw DeadlyImportError("Quick3D: Unknown chunk");
- break;
- };
- }
-outer:
-
- // If we have no mesh loaded - break here
- if (meshes.empty())
- throw DeadlyImportError("Quick3D: No meshes loaded");
-
- // If we have no materials loaded - generate a default mat
- if (materials.empty())
- {
- DefaultLogger::get()->info("Quick3D: No material found, generating one");
- materials.push_back(Material());
- materials.back().diffuse = fgColor ;
- }
-
- // find out which materials we'll need
- typedef std::pair<unsigned int, unsigned int> FaceIdx;
- typedef std::vector< FaceIdx > FaceIdxArray;
- FaceIdxArray* fidx = new FaceIdxArray[materials.size()];
-
- unsigned int p = 0;
- for (std::vector<Mesh>::iterator it = meshes.begin(), end = meshes.end();
- it != end; ++it,++p)
- {
- unsigned int q = 0;
- for (std::vector<Face>::iterator fit = (*it).faces.begin(), fend = (*it).faces.end();
- fit != fend; ++fit,++q)
- {
- if ((*fit).mat >= materials.size())
- {
- DefaultLogger::get()->warn("Quick3D: Material index overflow");
- (*fit).mat = 0;
- }
- if (fidx[(*fit).mat].empty())++pScene->mNumMeshes;
- fidx[(*fit).mat].push_back( FaceIdx(p,q) );
- }
- }
- pScene->mNumMaterials = pScene->mNumMeshes;
- pScene->mMaterials = new aiMaterial*[pScene->mNumMaterials];
- pScene->mMeshes = new aiMesh*[pScene->mNumMaterials];
-
- for (unsigned int i = 0, real = 0; i < (unsigned int)materials.size(); ++i)
- {
- if (fidx[i].empty())continue;
-
- // Allocate a mesh and a material
- aiMesh* mesh = pScene->mMeshes[real] = new aiMesh();
- MaterialHelper* mat = new MaterialHelper();
- pScene->mMaterials[real] = mat;
-
- mesh->mMaterialIndex = real;
-
- // Build the output material
- Material& srcMat = materials[i];
- mat->AddProperty(&srcMat.diffuse, 1,AI_MATKEY_COLOR_DIFFUSE);
- mat->AddProperty(&srcMat.specular, 1,AI_MATKEY_COLOR_SPECULAR);
- mat->AddProperty(&srcMat.ambient, 1,AI_MATKEY_COLOR_AMBIENT);
-
- // NOTE: Ignore transparency for the moment - it seems
- // unclear how to interpret the data
-#if 0
- if (!(minor > '0' && major == '3'))
- srcMat.transparency = 1.0f - srcMat.transparency;
- mat->AddProperty(&srcMat.transparency, 1, AI_MATKEY_OPACITY);
-#endif
-
- // add shininess - Quick3D seems to use it ins its viewer
- srcMat.transparency = 16.f;
- mat->AddProperty(&srcMat.transparency, 1, AI_MATKEY_SHININESS);
-
- int m = (int)aiShadingMode_Phong;
- mat->AddProperty(&m, 1, AI_MATKEY_SHADING_MODEL);
-
- if (srcMat.name.length)
- mat->AddProperty(&srcMat.name,AI_MATKEY_NAME);
-
- // Add a texture
- if (srcMat.texIdx < pScene->mNumTextures || real < pScene->mNumTextures)
- {
- srcMat.name.data[0] = '*';
- srcMat.name.length = ASSIMP_itoa10(&srcMat.name.data[1],1000,
- (srcMat.texIdx < pScene->mNumTextures ? srcMat.texIdx : real));
- mat->AddProperty(&srcMat.name,AI_MATKEY_TEXTURE_DIFFUSE(0));
- }
-
- mesh->mNumFaces = (unsigned int)fidx[i].size();
- aiFace* faces = mesh->mFaces = new aiFace[mesh->mNumFaces];
-
- // Now build the output mesh. First find out how many
- // vertices we'll need
- for (FaceIdxArray::const_iterator it = fidx[i].begin(),end = fidx[i].end();
- it != end; ++it)
- {
- mesh->mNumVertices += (unsigned int)meshes[(*it).first].faces[
- (*it).second].indices.size();
- }
-
- aiVector3D* verts = mesh->mVertices = new aiVector3D[mesh->mNumVertices];
- aiVector3D* norms = mesh->mNormals = new aiVector3D[mesh->mNumVertices];
- aiVector3D* uv;
- if (real < pScene->mNumTextures)
- {
- uv = mesh->mTextureCoords[0] = new aiVector3D[mesh->mNumVertices];
- mesh->mNumUVComponents[0] = 2;
- }
- else uv = NULL;
-
- // Build the final array
- unsigned int cnt = 0;
- for (FaceIdxArray::const_iterator it = fidx[i].begin(),end = fidx[i].end();
- it != end; ++it, ++faces)
- {
- Mesh& m = meshes[(*it).first];
- Face& face = m.faces[(*it).second];
- faces->mNumIndices = (unsigned int)face.indices.size();
- faces->mIndices = new unsigned int [faces->mNumIndices];
-
-
- aiVector3D faceNormal;
- bool fnOK = false;
-
- for (unsigned int n = 0; n < faces->mNumIndices;++n, ++cnt, ++norms, ++verts)
- {
- if (face.indices[n] >= m.verts.size())
- {
- DefaultLogger::get()->warn("Quick3D: Vertex index overflow");
- face.indices[n] = 0;
- }
-
- // copy vertices
- *verts = m.verts[ face.indices[n] ];
-
- if (face.indices[n] >= m.normals.size() && faces->mNumIndices >= 3)
- {
- // we have no normal here - assign the face normal
- if (!fnOK)
- {
- const aiVector3D& pV1 = m.verts[ face.indices[0] ];
- const aiVector3D& pV2 = m.verts[ face.indices[1] ];
- const aiVector3D& pV3 = m.verts[ face.indices.size() - 1 ];
- faceNormal = (pV2 - pV1) ^ (pV3 - pV1).Normalize();
- fnOK = true;
- }
- *norms = faceNormal;
- }
- else *norms = m.normals[ face.indices[n] ];
-
- // copy texture coordinates
- if (uv && m.uv.size())
- {
- if (m.prevUVIdx != 0xffffffff && m.uv.size() >= m.verts.size()) // workaround
- {
- *uv = m.uv[face.indices[n]];
- }
- else
- {
- if (face.uvindices[n] >= m.uv.size())
- {
- DefaultLogger::get()->warn("Quick3D: Texture coordinate index overflow");
- face.uvindices[n] = 0;
- }
- *uv = m.uv[face.uvindices[n]];
- }
- uv->y = 1.f - uv->y;
- ++uv;
- }
-
- // setup the new vertex index
- faces->mIndices[n] = cnt;
- }
-
- }
- ++real;
- }
-
- // Delete our nice helper array
- delete[] fidx;
-
- // Now we need to attach the meshes to the root node of the scene
- pScene->mRootNode->mNumMeshes = pScene->mNumMeshes;
- pScene->mRootNode->mMeshes = new unsigned int [pScene->mNumMeshes];
- for (unsigned int i = 0; i < pScene->mNumMeshes;++i)
- pScene->mRootNode->mMeshes[i] = i;
-
- /*pScene->mRootNode->mTransformation *= aiMatrix4x4(
- 1.f, 0.f, 0.f, 0.f,
- 0.f, -1.f,0.f, 0.f,
- 0.f, 0.f, 1.f, 0.f,
- 0.f, 0.f, 0.f, 1.f);*/
-
- // Add cameras and light sources to the scene root node
- pScene->mRootNode->mNumChildren = pScene->mNumLights+pScene->mNumCameras;
- if (pScene->mRootNode->mNumChildren)
- {
- pScene->mRootNode->mChildren = new aiNode* [ pScene->mRootNode->mNumChildren ];
-
- // the light source
- aiNode* nd = pScene->mRootNode->mChildren[0] = new aiNode();
- nd->mParent = pScene->mRootNode;
- nd->mName.Set("Q3DLight");
- nd->mTransformation = pScene->mRootNode->mTransformation;
- nd->mTransformation.Inverse();
-
- // camera
- nd = pScene->mRootNode->mChildren[1] = new aiNode();
- nd->mParent = pScene->mRootNode;
- nd->mName.Set("Q3DCamera");
- nd->mTransformation = pScene->mRootNode->mChildren[0]->mTransformation;
- }
-}
-
-#endif // !! ASSIMP_BUILD_NO_Q3D_IMPORTER
diff --git a/3rdparty/assimp/code/Q3DLoader.h b/3rdparty/assimp/code/Q3DLoader.h
deleted file mode 100644
index fef4eac3..00000000
--- a/3rdparty/assimp/code/Q3DLoader.h
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file Q3DLoader.h
- * @brief Declaration of the Q3D importer class.
- */
-#ifndef AI_Q3DLOADER_H_INCLUDED
-#define AI_Q3DLOADER_H_INCLUDED
-
-#include "BaseImporter.h"
-#include "../include/aiTypes.h"
-#include <vector>
-
-namespace Assimp {
-
-// ---------------------------------------------------------------------------
-/** Importer class for the Quick3D Object and Scene formats.
-*/
-class Q3DImporter : public BaseImporter
-{
- friend class Importer;
-
-protected:
- /** Constructor to be privately used by Importer */
- Q3DImporter();
-
- /** Destructor, private as well */
- ~Q3DImporter();
-
-public:
-
- // -------------------------------------------------------------------
- /** Returns whether the class can handle the format of the given file.
- * See BaseImporter::CanRead() for details. */
- bool CanRead( const std::string& pFile, IOSystem* pIOHandler,
- bool checkSig) const;
-
-protected:
-
- // -------------------------------------------------------------------
- /** Called by Importer::GetExtensionList() for each loaded importer.
- * See BaseImporter::GetExtensionList() for details
- */
- void GetExtensionList(std::set<std::string>& extensions);
-
- // -------------------------------------------------------------------
- /** Imports the given file into the given scene structure.
- * See BaseImporter::InternReadFile() for details
- */
- void InternReadFile( const std::string& pFile, aiScene* pScene,
- IOSystem* pIOHandler);
-
-private:
-
- struct Material
- {
- Material()
- : diffuse (0.6f,0.6f,0.6f)
- , transparency (0.f)
- , texIdx (0xffffffff)
- {}
-
- aiString name;
- aiColor3D ambient, diffuse, specular;
- float transparency;
-
- unsigned int texIdx;
- };
-
- struct Face
- {
- Face(unsigned int s)
- : indices (s)
- , uvindices (s)
- , mat (0)
- {
- }
-
- std::vector<unsigned int> indices;
- std::vector<unsigned int> uvindices;
- unsigned int mat;
- };
-
- struct Mesh
- {
-
- std::vector<aiVector3D> verts;
- std::vector<aiVector3D> normals;
- std::vector<aiVector3D> uv;
- std::vector<Face> faces;
-
- uint32_t prevUVIdx;
- };
-};
-
-} // end of namespace Assimp
-
-#endif // AI_Q3DIMPORTER_H_IN
diff --git a/3rdparty/assimp/code/RawLoader.cpp b/3rdparty/assimp/code/RawLoader.cpp
deleted file mode 100644
index df5daba8..00000000
--- a/3rdparty/assimp/code/RawLoader.cpp
+++ /dev/null
@@ -1,312 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file RawLoader.cpp
- * @brief Implementation of the RAW importer class
- */
-
-#include "AssimpPCH.h"
-#ifndef ASSIMP_BUILD_NO_RAW_IMPORTER
-
-// internal headers
-#include "RawLoader.h"
-#include "ParsingUtils.h"
-#include "fast_atof.h"
-
-using namespace Assimp;
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-RAWImporter::RAWImporter()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-RAWImporter::~RAWImporter()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the class can handle the format of the given file.
-bool RAWImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const
-{
- return SimpleExtensionCheck(pFile,"raw");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Get the list of all supported file extensions
-void RAWImporter::GetExtensionList(std::set<std::string>& extensions)
-{
- extensions.insert("raw");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Imports the given file into the given scene structure.
-void RAWImporter::InternReadFile( const std::string& pFile,
- aiScene* pScene, IOSystem* pIOHandler)
-{
- boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
-
- // Check whether we can read from the file
- if ( file.get() == NULL) {
- throw DeadlyImportError( "Failed to open RAW file " + pFile + ".");
- }
-
- // allocate storage and copy the contents of the file to a memory buffer
- // (terminate it with zero)
- std::vector<char> mBuffer2;
- TextFileToBuffer(file.get(),mBuffer2);
- const char* buffer = &mBuffer2[0];
-
- // list of groups loaded from the file
- std::vector< GroupInformation > outGroups(1,GroupInformation("<default>"));
- std::vector< GroupInformation >::iterator curGroup = outGroups.begin();
-
- // now read all lines
- char line[4096];
- while (GetNextLine(buffer,line))
- {
- // if the line starts with a non-numeric identifier, it marks
- // the beginning of a new group
- const char* sz = line;SkipSpaces(&sz);
- if (IsLineEnd(*sz))continue;
- if (!IsNumeric(*sz))
- {
- const char* sz2 = sz;
- while (!IsSpaceOrNewLine(*sz2))++sz2;
- const unsigned int length = (unsigned int)(sz2-sz);
-
- // find an existing group with this name
- for (std::vector< GroupInformation >::iterator it = outGroups.begin(), end = outGroups.end();
- it != end;++it)
- {
- if (length == (*it).name.length() && !::strcmp(sz,(*it).name.c_str()))
- {
- curGroup = it;sz2 = NULL;
- break;
- }
- }
- if (sz2)
- {
- outGroups.push_back(GroupInformation(std::string(sz,length)));
- curGroup = outGroups.end()-1;
- }
- }
- else
- {
- // there can be maximally 12 floats plus an extra texture file name
- float data[12];
- unsigned int num;
- for (num = 0; num < 12;++num)
- {
- if (!SkipSpaces(&sz) || !IsNumeric(*sz))break;
- sz = fast_atof_move(sz,data[num]);
- }
- if (num != 12 && num != 9)
- {
- DefaultLogger::get()->error("A line may have either 9 or 12 floats and an optional texture");
- continue;
- }
-
- MeshInformation* output = NULL;
-
- const char* sz2 = sz;
- unsigned int length;
- if (!IsLineEnd(*sz))
- {
- while (!IsSpaceOrNewLine(*sz2))++sz2;
- length = (unsigned int)(sz2-sz);
- }
- else if (9 == num)
- {
- sz = "%default%";
- length = 9;
- }
- else
- {
- sz = "";
- length = 0;
- }
-
- // search in the list of meshes whether we have one with this texture
- for (std::vector< MeshInformation >::iterator it = (*curGroup).meshes.begin(),
- end = (*curGroup).meshes.end(); it != end; ++it)
- {
- if (length == (*it).name.length() && (length ? !::strcmp(sz,(*it).name.c_str()) : true))
- {
- output = &(*it);
- break;
- }
- }
- // if we don't have the mesh, create it
- if (!output)
- {
- (*curGroup).meshes.push_back(MeshInformation(std::string(sz,length)));
- output = &((*curGroup).meshes.back());
- }
- if (12 == num)
- {
- aiColor4D v(data[0],data[1],data[2],1.0f);
- output->colors.push_back(v);
- output->colors.push_back(v);
- output->colors.push_back(v);
-
- output->vertices.push_back(aiVector3D(data[3],data[4],data[5]));
- output->vertices.push_back(aiVector3D(data[6],data[7],data[8]));
- output->vertices.push_back(aiVector3D(data[9],data[10],data[11]));
- }
- else
- {
- output->vertices.push_back(aiVector3D(data[0],data[1],data[2]));
- output->vertices.push_back(aiVector3D(data[3],data[4],data[5]));
- output->vertices.push_back(aiVector3D(data[6],data[7],data[8]));
- }
- }
- }
-
- pScene->mRootNode = new aiNode();
- pScene->mRootNode->mName.Set("<RawRoot>");
-
- // count the number of valid groups
- // (meshes can't be empty)
- for (std::vector< GroupInformation >::iterator it = outGroups.begin(), end = outGroups.end();
- it != end;++it)
- {
- if (!(*it).meshes.empty())
- {
- ++pScene->mRootNode->mNumChildren;
- pScene->mNumMeshes += (unsigned int)(*it).meshes.size();
- }
- }
-
- if (!pScene->mNumMeshes)
- {
- throw DeadlyImportError("RAW: No meshes loaded. The file seems to be corrupt or empty.");
- }
-
- pScene->mMeshes = new aiMesh*[pScene->mNumMeshes];
- aiNode** cc;
- if (1 == pScene->mRootNode->mNumChildren)
- {
- cc = &pScene->mRootNode;
- pScene->mRootNode->mNumChildren = 0;
- }
- else cc = pScene->mRootNode->mChildren = new aiNode*[pScene->mRootNode->mNumChildren];
-
- pScene->mNumMaterials = pScene->mNumMeshes;
- aiMaterial** mats = pScene->mMaterials = new aiMaterial*[pScene->mNumMaterials];
-
- unsigned int meshIdx = 0;
- for (std::vector< GroupInformation >::iterator it = outGroups.begin(), end = outGroups.end();
- it != end;++it)
- {
- if ((*it).meshes.empty())continue;
-
- aiNode* node;
- if (pScene->mRootNode->mNumChildren)
- {
- node = *cc = new aiNode();
- node->mParent = pScene->mRootNode;
- }
- else node = *cc;++cc;
- node->mName.Set((*it).name);
-
- // add all meshes
- node->mNumMeshes = (unsigned int)(*it).meshes.size();
- unsigned int* pi = node->mMeshes = new unsigned int[ node->mNumMeshes ];
- for (std::vector< MeshInformation >::iterator it2 = (*it).meshes.begin(),
- end2 = (*it).meshes.end(); it2 != end2; ++it2)
- {
- ai_assert(!(*it2).vertices.empty());
-
- // allocate the mesh
- *pi++ = meshIdx;
- aiMesh* mesh = pScene->mMeshes[meshIdx] = new aiMesh();
- mesh->mMaterialIndex = meshIdx++;
-
- mesh->mPrimitiveTypes = aiPrimitiveType_TRIANGLE;
-
- // allocate storage for the vertex components and copy them
- mesh->mNumVertices = (unsigned int)(*it2).vertices.size();
- mesh->mVertices = new aiVector3D[ mesh->mNumVertices ];
- ::memcpy(mesh->mVertices,&(*it2).vertices[0],sizeof(aiVector3D)*mesh->mNumVertices);
-
- if ((*it2).colors.size())
- {
- ai_assert((*it2).colors.size() == mesh->mNumVertices);
-
- mesh->mColors[0] = new aiColor4D[ mesh->mNumVertices ];
- ::memcpy(mesh->mColors[0],&(*it2).colors[0],sizeof(aiColor4D)*mesh->mNumVertices);
- }
-
- // generate triangles
- ai_assert(0 == mesh->mNumVertices % 3);
- aiFace* fc = mesh->mFaces = new aiFace[ mesh->mNumFaces = mesh->mNumVertices/3 ];
- aiFace* const fcEnd = fc + mesh->mNumFaces;
- unsigned int n = 0;
- while (fc != fcEnd)
- {
- aiFace& f = *fc++;
- f.mIndices = new unsigned int[f.mNumIndices = 3];
- for (unsigned int m = 0; m < 3;++m)
- f.mIndices[m] = n++;
- }
-
- // generate a material for the mesh
- MaterialHelper* mat = new MaterialHelper();
-
- aiColor4D clr(1.0f,1.0f,1.0f,1.0f);
- if ("%default%" == (*it2).name) // a gray default material
- {
- clr.r = clr.g = clr.b = 0.6f;
- }
- else if ((*it2).name.length() > 0) // a texture
- {
- aiString s;
- s.Set((*it2).name);
- mat->AddProperty(&s,AI_MATKEY_TEXTURE_DIFFUSE(0));
- }
- mat->AddProperty<aiColor4D>(&clr,1,AI_MATKEY_COLOR_DIFFUSE);
- *mats++ = mat;
- }
- }
-}
-
-#endif // !! ASSIMP_BUILD_NO_RAW_IMPORTER
diff --git a/3rdparty/assimp/code/RawLoader.h b/3rdparty/assimp/code/RawLoader.h
deleted file mode 100644
index 47a4a5aa..00000000
--- a/3rdparty/assimp/code/RawLoader.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file RAWLoader.h
- * @brief Declaration of the RAW importer class.
- */
-#ifndef AI_RAWLOADER_H_INCLUDED
-#define AI_RAWLOADER_H_INCLUDED
-
-#include "BaseImporter.h"
-#include "../include/aiTypes.h"
-#include <vector>
-
-namespace Assimp {
-
-// ---------------------------------------------------------------------------
-/** Importer class for the PovRay RAW triangle format
-*/
-class RAWImporter : public BaseImporter
-{
- friend class Importer;
-
-protected:
- /** Constructor to be privately used by Importer */
- RAWImporter();
-
- /** Destructor, private as well */
- ~RAWImporter();
-
-public:
-
- // -------------------------------------------------------------------
- /** Returns whether the class can handle the format of the given file.
- * See BaseImporter::CanRead() for details.
- */
- bool CanRead( const std::string& pFile, IOSystem* pIOHandler,
- bool checkSig) const;
-
-protected:
-
- // -------------------------------------------------------------------
- /** Called by Importer::GetExtensionList() for each loaded importer.
- * See BaseImporter::GetExtensionList() for details
- */
- void GetExtensionList(std::set<std::string>& extensions);
-
- // -------------------------------------------------------------------
- /** Imports the given file into the given scene structure.
- * See BaseImporter::InternReadFile() for details
- */
- void InternReadFile( const std::string& pFile, aiScene* pScene,
- IOSystem* pIOHandler);
-
-private:
-
- struct MeshInformation
- {
- MeshInformation(const std::string& _name)
- : name(_name)
- {
- vertices.reserve(100);
- colors.reserve(100);
- }
-
- std::string name;
-
- std::vector<aiVector3D> vertices;
- std::vector<aiColor4D> colors;
- };
-
- struct GroupInformation
- {
- GroupInformation(const std::string& _name)
- : name(_name)
- {
- meshes.reserve(10);
- }
-
- std::string name;
- std::vector<MeshInformation> meshes;
- };
-};
-
-} // end of namespace Assimp
-
-#endif // AI_3DSIMPORTER_H_IN
diff --git a/3rdparty/assimp/code/RemoveComments.cpp b/3rdparty/assimp/code/RemoveComments.cpp
deleted file mode 100644
index b69c04c0..00000000
--- a/3rdparty/assimp/code/RemoveComments.cpp
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file RemoveComments.cpp
- * @brief Defines the CommentRemover utility class
- */
-
-#include "AssimpPCH.h"
-#include "RemoveComments.h"
-#include "ParsingUtils.h"
-
-namespace Assimp {
-
-// ------------------------------------------------------------------------------------------------
-// Remove line comments from a file
-void CommentRemover::RemoveLineComments(const char* szComment,
- char* szBuffer, char chReplacement /* = ' ' */)
-{
- // validate parameters
- ai_assert(NULL != szComment && NULL != szBuffer && *szComment);
-
- const size_t len = strlen(szComment);
- while (*szBuffer) {
-
- // skip over quotes
- if (*szBuffer == '\"' || *szBuffer == '\'')
- while (*szBuffer++ && *szBuffer != '\"' && *szBuffer != '\'');
-
- if (!strncmp(szBuffer,szComment,len)) {
- while (!IsLineEnd(*szBuffer))
- *szBuffer++ = chReplacement;
- }
- ++szBuffer;
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Remove multi-line comments from a file
-void CommentRemover::RemoveMultiLineComments(const char* szCommentStart,
- const char* szCommentEnd,char* szBuffer,
- char chReplacement)
-{
- // validate parameters
- ai_assert(NULL != szCommentStart && NULL != szCommentEnd &&
- NULL != szBuffer && *szCommentStart && *szCommentEnd);
-
- const size_t len = strlen(szCommentEnd);
- const size_t len2 = strlen(szCommentStart);
-
- while (*szBuffer) {
- // skip over quotes
- if (*szBuffer == '\"' || *szBuffer == '\'')
- while (*szBuffer++ && *szBuffer != '\"' && *szBuffer != '\'');
-
- if (!strncmp(szBuffer,szCommentStart,len2)) {
- while (*szBuffer) {
- if (!::strncmp(szBuffer,szCommentEnd,len)) {
- for (unsigned int i = 0; i < len;++i)
- *szBuffer++ = chReplacement;
-
- break;
- }
- *szBuffer++ = chReplacement;
- }
- continue;
- }
- ++szBuffer;
- }
-}
-
-} // !! Assimp
diff --git a/3rdparty/assimp/code/RemoveComments.h b/3rdparty/assimp/code/RemoveComments.h
deleted file mode 100644
index 54899527..00000000
--- a/3rdparty/assimp/code/RemoveComments.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file Declares a helper class, "CommentRemover", which can be
- * used to remove comments (single and multi line) from a text file.
- */
-#ifndef AI_REMOVE_COMMENTS_H_INC
-#define AI_REMOVE_COMMENTS_H_INC
-
-#include "../include/aiAssert.h"
-
-namespace Assimp {
-
-// ---------------------------------------------------------------------------
-/** \brief Helper class to remove single and multi line comments from a file
- *
- * Some mesh formats like MD5 have comments that are quite similar
- * to those in C or C++ so this code has been moved to a separate
- * module.
- */
-class ASSIMP_API CommentRemover
-{
- // class cannot be instanced
- CommentRemover() {}
-
-public:
-
- //! Remove single-line comments. The end of a line is
- //! expected to be either NL or CR or NLCR.
- //! \param szComment The start sequence of the comment, e.g. "//"
- //! \param szBuffer Buffer to work with
- //! \param chReplacement Character to be used as replacement
- //! for commented lines. By default this is ' '
- static void RemoveLineComments(const char* szComment,
- char* szBuffer, char chReplacement = ' ');
-
- //! Remove multi-line comments. The end of a line is
- //! expected to be either NL or CR or NLCR. Multi-line comments
- //! may not be nested (as in C).
- //! \param szCommentStart The start sequence of the comment, e.g. "/*"
- //! \param szCommentEnd The end sequence of the comment, e.g. "*/"
- //! \param szBuffer Buffer to work with
- //! \param chReplacement Character to be used as replacement
- //! for commented lines. By default this is ' '
- static void RemoveMultiLineComments(const char* szCommentStart,
- const char* szCommentEnd,char* szBuffer,
- char chReplacement = ' ');
-};
-} // ! Assimp
-
-#endif // !! AI_REMOVE_COMMENTS_H_INC
diff --git a/3rdparty/assimp/code/RemoveRedundantMaterials.cpp b/3rdparty/assimp/code/RemoveRedundantMaterials.cpp
deleted file mode 100644
index 73931ea9..00000000
--- a/3rdparty/assimp/code/RemoveRedundantMaterials.cpp
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-/** @file RemoveRedundantMaterials.cpp
- * @brief Implementation of the "RemoveRedundantMaterials" post processing step
-*/
-
-// internal headers
-#include "AssimpPCH.h"
-#include "RemoveRedundantMaterials.h"
-#include "ParsingUtils.h"
-#include "ProcessHelper.h"
-
-using namespace Assimp;
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-RemoveRedundantMatsProcess::RemoveRedundantMatsProcess()
-{
- // nothing to do here
-}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-RemoveRedundantMatsProcess::~RemoveRedundantMatsProcess()
-{
- // nothing to do here
-}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the processing step is present in the given flag field.
-bool RemoveRedundantMatsProcess::IsActive( unsigned int pFlags) const
-{
- return (pFlags & aiProcess_RemoveRedundantMaterials) != 0;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Setup import properties
-void RemoveRedundantMatsProcess::SetupProperties(const Importer* pImp)
-{
- // Get value of AI_CONFIG_PP_RRM_EXCLUDE_LIST
- configFixedMaterials = pImp->GetPropertyString(AI_CONFIG_PP_RRM_EXCLUDE_LIST,"");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Executes the post processing step on the given imported data.
-void RemoveRedundantMatsProcess::Execute( aiScene* pScene)
-{
- DefaultLogger::get()->debug("RemoveRedundantMatsProcess begin");
-
- unsigned int iCnt = 0, unreferenced = 0;
- if (pScene->mNumMaterials)
- {
- // Find out which materials are referenced by meshes
- std::vector<bool> abReferenced(pScene->mNumMaterials,false);
- for (unsigned int i = 0;i < pScene->mNumMeshes;++i)
- abReferenced[pScene->mMeshes[i]->mMaterialIndex] = true;
-
- // If a list of materials to be excluded was given, match the list with
- // our imported materials and 'salt' all positive matches to ensure that
- // we get unique hashes later.
- if (configFixedMaterials.length()) {
-
- std::list<std::string> strings;
- ConvertListToStrings(configFixedMaterials,strings);
-
- for (unsigned int i = 0; i < pScene->mNumMaterials;++i) {
- aiMaterial* mat = pScene->mMaterials[i];
-
- aiString name;
- mat->Get(AI_MATKEY_NAME,name);
-
- if (name.length) {
- std::list<std::string>::const_iterator it = std::find(strings.begin(), strings.end(), name.data);
- if (it != strings.end()) {
-
- // Our brilliant 'salt': A single material property with ~ as first
- // character to mark it as internal and temporary.
- const int dummy = 1;
- ((MaterialHelper*)mat)->AddProperty(&dummy,1,"~RRM.UniqueMaterial",0,0);
-
- // Keep this material even if no mesh references it
- abReferenced[i] = true;
- DefaultLogger::get()->debug(std::string("Found positive match in exclusion list: \'") + name.data + "\'");
- }
- }
- }
- }
-
-
- // TODO: reimplement this algorithm to work in-place
-
- unsigned int* aiMappingTable = new unsigned int[pScene->mNumMaterials];
- unsigned int iNewNum = 0;
-
- // Iterate through all materials and calculate a hash for them
- // store all hashes in a list and so a quick search whether
- // we do already have a specific hash. This allows us to
- // determine which materials are identical.
- uint32_t* aiHashes;
- aiHashes = new uint32_t[pScene->mNumMaterials];
- for (unsigned int i = 0; i < pScene->mNumMaterials;++i)
- {
- // if the material is not referenced ... remove it
- if (!abReferenced[i]) {
- ++unreferenced;
- continue;
- }
-
- uint32_t me = aiHashes[i] = ((MaterialHelper*)pScene->mMaterials[i])->ComputeHash();
- for (unsigned int a = 0; a < i;++a)
- {
- if (me == aiHashes[a]) {
- ++iCnt;
- me = 0;
- aiMappingTable[i] = aiMappingTable[a];
- delete pScene->mMaterials[i];
- break;
- }
- }
- if (me) {
- aiMappingTable[i] = iNewNum++;
- }
- }
- if (iCnt) {
- // build an output material list
- aiMaterial** ppcMaterials = new aiMaterial*[iNewNum];
- ::memset(ppcMaterials,0,sizeof(void*)*iNewNum);
- for (unsigned int p = 0; p < pScene->mNumMaterials;++p)
- {
- // if the material is not referenced ... remove it
- if (!abReferenced[p])
- continue;
-
- // generate new names for all modified materials
- const unsigned int idx = aiMappingTable[p];
- if (ppcMaterials[idx])
- {
- aiString sz;
- sz.length = ::sprintf(sz.data,"JoinedMaterial_#%i",p);
- ((MaterialHelper*)ppcMaterials[idx])->AddProperty(&sz,AI_MATKEY_NAME);
- }
- else ppcMaterials[idx] = pScene->mMaterials[p];
- }
- // update all material indices
- for (unsigned int p = 0; p < pScene->mNumMeshes;++p) {
- aiMesh* mesh = pScene->mMeshes[p];
- mesh->mMaterialIndex = aiMappingTable[mesh->mMaterialIndex];
- }
- // delete the old material list
- delete[] pScene->mMaterials;
- pScene->mMaterials = ppcMaterials;
- pScene->mNumMaterials = iNewNum;
- }
- // delete temporary storage
- delete[] aiHashes;
- delete[] aiMappingTable;
- }
- if (!iCnt)DefaultLogger::get()->debug("RemoveRedundantMatsProcess finished ");
- else
- {
- char szBuffer[128]; // should be sufficiently large
- ::sprintf(szBuffer,"RemoveRedundantMatsProcess finished. %i redundant and %i unused materials",
- iCnt,unreferenced);
- DefaultLogger::get()->info(szBuffer);
- }
-}
diff --git a/3rdparty/assimp/code/RemoveRedundantMaterials.h b/3rdparty/assimp/code/RemoveRedundantMaterials.h
deleted file mode 100644
index 65bbf2cf..00000000
--- a/3rdparty/assimp/code/RemoveRedundantMaterials.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file RemoveRedundantMaterials.h
- * @brief Defines a post processing step to remove redundant materials
- */
-#ifndef AI_REMOVEREDUNDANTMATERIALS_H_INC
-#define AI_REMOVEREDUNDANTMATERIALS_H_INC
-
-#include "BaseProcess.h"
-#include "../include/aiMesh.h"
-
-class RemoveRedundantMatsTest;
-namespace Assimp {
-
-// ---------------------------------------------------------------------------
-/** RemoveRedundantMatsProcess: Postprocessing steo to remove redundant
- * materials from the imported scene.
- */
-class ASSIMP_API RemoveRedundantMatsProcess : public BaseProcess
-{
- friend class Importer;
- friend class ::RemoveRedundantMatsTest; // grant the unit test full access to us
-
-protected:
- /** Constructor to be privately used by Importer */
- RemoveRedundantMatsProcess();
-
- /** Destructor, private as well */
- ~RemoveRedundantMatsProcess();
-
-public:
- // -------------------------------------------------------------------
- // Check whether step is active
- bool IsActive( unsigned int pFlags) const;
-
- // -------------------------------------------------------------------
- // Execute step on a given scene
- void Execute( aiScene* pScene);
-
- // -------------------------------------------------------------------
- // Setup import settings
- void SetupProperties(const Importer* pImp);
-
-
- // -------------------------------------------------------------------
- /** @brief Set list of fixed (unmutable) materials
- * @param fixed See #AI_CONFIG_PP_RRM_EXCLUDE_LIST
- */
- void SetFixedMaterialsString(const std::string& fixed = "") {
- configFixedMaterials = fixed;
- }
-
- // -------------------------------------------------------------------
- /** @brief Get list of fixed (unmutable) materials
- * @return See #AI_CONFIG_PP_RRM_EXCLUDE_LIST
- */
- const std::string& GetFixedMaterialsString() const {
- return configFixedMaterials;
- }
-
-private:
-
- //! Configuration option: list of all fixed materials
- std::string configFixedMaterials;
-};
-
-} // end of namespace Assimp
-
-#endif // !!AI_REMOVEREDUNDANTMATERIALS_H_INC
diff --git a/3rdparty/assimp/code/RemoveVCProcess.cpp b/3rdparty/assimp/code/RemoveVCProcess.cpp
deleted file mode 100644
index 2d5b60e3..00000000
--- a/3rdparty/assimp/code/RemoveVCProcess.cpp
+++ /dev/null
@@ -1,328 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-/** @file Implementation of the post processing step to remove
- * any parts of the mesh structure from the imported data.
-*/
-
-#include "AssimpPCH.h"
-#include "RemoveVCProcess.h"
-
-using namespace Assimp;
-
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-RemoveVCProcess::RemoveVCProcess()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-RemoveVCProcess::~RemoveVCProcess()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the processing step is present in the given flag field.
-bool RemoveVCProcess::IsActive( unsigned int pFlags) const
-{
- return (pFlags & aiProcess_RemoveComponent) != 0;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Small helper function to delete all elements in a T** aray using delete
-template <typename T>
-inline void ArrayDelete(T**& in, unsigned int& num)
-{
- for (unsigned int i = 0; i < num; ++i)
- delete in[i];
-
- delete[] in;
- in = NULL;
- num = 0;
-}
-
-#if 0
-// ------------------------------------------------------------------------------------------------
-// Updates the node graph - removes all nodes which have the "remove" flag set and the
-// "don't remove" flag not set. Nodes with meshes are never deleted.
-bool UpdateNodeGraph(aiNode* node,std::list<aiNode*>& childsOfParent,bool root)
-{
- register bool b = false;
-
- std::list<aiNode*> mine;
- for (unsigned int i = 0; i < node->mNumChildren;++i)
- {
- if (UpdateNodeGraph(node->mChildren[i],mine,false))
- b = true;
- }
-
- // somewhat tricky ... mNumMeshes must be originally 0 and MSB2 may not be set,
- // so we can do a simple comparison against MSB here
- if (!root && AI_RC_UINT_MSB == node->mNumMeshes )
- {
- // this node needs to be removed
- if (node->mNumChildren)
- {
- childsOfParent.insert(childsOfParent.end(),mine.begin(),mine.end());
-
- // set all children to NULL to make sure they are not deleted when we delete ourself
- for (unsigned int i = 0; i < node->mNumChildren;++i)
- node->mChildren[i] = NULL;
- }
- b = true;
- delete node;
- }
- else
- {
- AI_RC_UNMASK(node->mNumMeshes);
- childsOfParent.push_back(node);
-
- if (b)
- {
- // reallocate the array of our children here
- node->mNumChildren = (unsigned int)mine.size();
- aiNode** const children = new aiNode*[mine.size()];
- aiNode** ptr = children;
-
- for (std::list<aiNode*>::iterator it = mine.begin(), end = mine.end();
- it != end; ++it)
- {
- *ptr++ = *it;
- }
- delete[] node->mChildren;
- node->mChildren = children;
- return false;
- }
- }
- return b;
-}
-#endif
-
-// ------------------------------------------------------------------------------------------------
-// Executes the post processing step on the given imported data.
-void RemoveVCProcess::Execute( aiScene* pScene)
-{
- DefaultLogger::get()->debug("RemoveVCProcess begin");
- bool bHas = false; //,bMasked = false;
-
- mScene = pScene;
-
- // handle animations
- if ( configDeleteFlags & aiComponent_ANIMATIONS)
- {
-
- bHas = true;
- ArrayDelete(pScene->mAnimations,pScene->mNumAnimations);
- }
-
- // handle textures
- if ( configDeleteFlags & aiComponent_TEXTURES)
- {
- bHas = true;
- ArrayDelete(pScene->mTextures,pScene->mNumTextures);
- }
-
- // handle materials
- if ( configDeleteFlags & aiComponent_MATERIALS && pScene->mNumMaterials)
- {
- bHas = true;
- for (unsigned int i = 1;i < pScene->mNumMaterials;++i)
- delete pScene->mMaterials[i];
-
- pScene->mNumMaterials = 1;
- MaterialHelper* helper = (MaterialHelper*) pScene->mMaterials[0];
- ai_assert(NULL != helper);
- helper->Clear();
-
- // gray
- aiColor3D clr(0.6f,0.6f,0.6f);
- helper->AddProperty(&clr,1,AI_MATKEY_COLOR_DIFFUSE);
-
- // add a small ambient color value
- clr = aiColor3D(0.05f,0.05f,0.05f);
- helper->AddProperty(&clr,1,AI_MATKEY_COLOR_AMBIENT);
-
- aiString s;
- s.Set("Dummy_MaterialsRemoved");
- helper->AddProperty(&s,AI_MATKEY_NAME);
- }
-
- // handle light sources
- if ( configDeleteFlags & aiComponent_LIGHTS)
- {
- bHas = true;
- ArrayDelete(pScene->mLights,pScene->mNumLights);
- }
-
- // handle camneras
- if ( configDeleteFlags & aiComponent_CAMERAS)
- {
- bHas = true;
- ArrayDelete(pScene->mCameras,pScene->mNumCameras);
- }
-
- // handle meshes
- if (configDeleteFlags & aiComponent_MESHES)
- {
- bHas = true;
- ArrayDelete(pScene->mMeshes,pScene->mNumMeshes);
- }
- else
- {
- for ( unsigned int a = 0; a < pScene->mNumMeshes; a++)
- {
- if ( ProcessMesh( pScene->mMeshes[a]))
- bHas = true;
- }
- }
-
-
- // now check whether the result is still a full scene
- if (!pScene->mNumMeshes || !pScene->mNumMaterials)
- {
- pScene->mFlags |= AI_SCENE_FLAGS_INCOMPLETE;
- DefaultLogger::get()->debug("Setting AI_SCENE_FLAGS_INCOMPLETE flag");
-
- // If we have no meshes anymore we should also clear another flag ...
- if (!pScene->mNumMeshes)
- pScene->mFlags &= ~AI_SCENE_FLAGS_NON_VERBOSE_FORMAT;
- }
-
- if (bHas)DefaultLogger::get()->info("RemoveVCProcess finished. Data structure cleanup has been done.");
- else DefaultLogger::get()->debug("RemoveVCProcess finished. Nothing to be done ...");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Setup configuration properties for the step
-void RemoveVCProcess::SetupProperties(const Importer* pImp)
-{
- configDeleteFlags = pImp->GetPropertyInteger(AI_CONFIG_PP_RVC_FLAGS,0x0);
- if (!configDeleteFlags)
- {
- DefaultLogger::get()->warn("RemoveVCProcess: AI_CONFIG_PP_RVC_FLAGS is zero.");
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Executes the post processing step on the given imported data.
-bool RemoveVCProcess::ProcessMesh(aiMesh* pMesh)
-{
- bool ret = false;
-
- // if all materials have been deleted let the material
- // index of the mesh point to the created default material
- if ( configDeleteFlags & aiComponent_MATERIALS)
- pMesh->mMaterialIndex = 0;
-
- // handle normals
- if (configDeleteFlags & aiComponent_NORMALS && pMesh->mNormals)
- {
- delete[] pMesh->mNormals;
- pMesh->mNormals = NULL;
- ret = true;
- }
-
- // handle tangents and bitangents
- if (configDeleteFlags & aiComponent_TANGENTS_AND_BITANGENTS && pMesh->mTangents)
- {
- delete[] pMesh->mTangents;
- pMesh->mTangents = NULL;
-
- delete[] pMesh->mBitangents;
- pMesh->mBitangents = NULL;
- ret = true;
- }
-
- // handle texture coordinates
- register bool b = (0 != (configDeleteFlags & aiComponent_TEXCOORDS));
- for (unsigned int i = 0, real = 0; real < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++real)
- {
- if (!pMesh->mTextureCoords[i])break;
- if (configDeleteFlags & aiComponent_TEXCOORDSn(real) || b)
- {
- delete pMesh->mTextureCoords[i];
- pMesh->mTextureCoords[i] = NULL;
- ret = true;
-
- if (!b)
- {
- // collapse the rest of the array
- for (unsigned int a = i+1; a < AI_MAX_NUMBER_OF_TEXTURECOORDS;++a)
- pMesh->mTextureCoords[a-1] = pMesh->mTextureCoords[a];
-
- pMesh->mTextureCoords[AI_MAX_NUMBER_OF_TEXTURECOORDS-1] = NULL;
- continue;
- }
- }
- ++i;
- }
-
- // handle vertex colors
- b = (0 != (configDeleteFlags & aiComponent_COLORS));
- for (unsigned int i = 0, real = 0; real < AI_MAX_NUMBER_OF_COLOR_SETS; ++real)
- {
- if (!pMesh->mColors[i])break;
- if (configDeleteFlags & aiComponent_COLORSn(i) || b)
- {
- delete pMesh->mColors[i];
- pMesh->mColors[i] = NULL;
- ret = true;
-
- if (!b)
- {
- // collapse the rest of the array
- for (unsigned int a = i+1; a < AI_MAX_NUMBER_OF_COLOR_SETS;++a)
- pMesh->mColors[a-1] = pMesh->mColors[a];
-
- pMesh->mColors[AI_MAX_NUMBER_OF_COLOR_SETS-1] = NULL;
- continue;
- }
- }
- ++i;
- }
-
- // handle bones
- if (configDeleteFlags & aiComponent_BONEWEIGHTS && pMesh->mBones)
- {
- ArrayDelete(pMesh->mBones,pMesh->mNumBones);
- ret = true;
- }
- return ret;
-}
diff --git a/3rdparty/assimp/code/RemoveVCProcess.h b/3rdparty/assimp/code/RemoveVCProcess.h
deleted file mode 100644
index 43693f63..00000000
--- a/3rdparty/assimp/code/RemoveVCProcess.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file Defines a post processing step to remove specific parts of the scene */
-#ifndef AI_REMOVEVCPROCESS_H_INCLUDED
-#define AI_REMOVEVCPROCESS_H_INCLUDED
-
-#include "BaseProcess.h"
-#include "../include/aiMesh.h"
-
-class RemoveVCProcessTest;
-namespace Assimp {
-
-// ---------------------------------------------------------------------------
-/** RemoveVCProcess: Class to exclude specific parts of the data structure
- * from further processing by removing them,
-*/
-class ASSIMP_API RemoveVCProcess : public BaseProcess
-{
- friend class Importer;
- friend class ::RemoveVCProcessTest;
-
-protected:
- /** Constructor to be privately used by Importer */
- RemoveVCProcess();
-
- /** Destructor, private as well */
- ~RemoveVCProcess();
-
-public:
- // -------------------------------------------------------------------
- /** Returns whether the processing step is present in the given flag field.
- * @param pFlags The processing flags the importer was called with. A bitwise
- * combination of #aiPostProcessSteps.
- * @return true if the process is present in this flag fields, false if not.
- */
- bool IsActive( unsigned int pFlags) const;
-
- // -------------------------------------------------------------------
- /** Executes the post processing step on the given imported data.
- * At the moment a process is not supposed to fail.
- * @param pScene The imported data to work at.
- */
- void Execute( aiScene* pScene);
-
- // -------------------------------------------------------------------
- /** Called prior to ExecuteOnScene().
- * The function is a request to the process to update its configuration
- * basing on the Importer's configuration property list.
- */
- virtual void SetupProperties(const Importer* pImp);
-
- // -------------------------------------------------------------------
- /** Manually setup the configuration flags for the step
- *
- * @param Bitwise combintion of the #aiComponent enumerated values.
- */
- void SetDeleteFlags(unsigned int f)
- {
- configDeleteFlags = f;
- }
-
- // -------------------------------------------------------------------
- /** Query the current configuration.
- */
- unsigned int GetDeleteFlags() const
- {
- return configDeleteFlags;
- }
-
-private:
-
- bool ProcessMesh (aiMesh* pcMesh);
-
- /** Configuration flag
- */
- unsigned int configDeleteFlags;
-
- /** The scene we're working with
- */
- aiScene* mScene;
-};
-
-} // end of namespace Assimp
-
-#endif // !!AI_REMOVEVCPROCESS_H_INCLUDED
diff --git a/3rdparty/assimp/code/SGSpatialSort.cpp b/3rdparty/assimp/code/SGSpatialSort.cpp
deleted file mode 100644
index 705dafc9..00000000
--- a/3rdparty/assimp/code/SGSpatialSort.cpp
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
-copyright notice, this list of conditions and the
-following disclaimer.
-
-* Redistributions in binary form must reproduce the above
-copyright notice, this list of conditions and the
-following disclaimer in the documentation and/or other
-materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
-contributors may be used to endorse or promote products
-derived from this software without specific prior
-written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file Implementation of the helper class to quickly find
-vertices close to a given position. Special implementation for
-the 3ds loader handling smooth groups correctly */
-
-#include "AssimpPCH.h"
-#include "SGSpatialSort.h"
-
-using namespace Assimp;
-
-
-// ------------------------------------------------------------------------------------------------
-SGSpatialSort::SGSpatialSort()
-{
- // define the reference plane. We choose some arbitrary vector away from all basic axises
- // in the hope that no model spreads all its vertices along this plane.
- mPlaneNormal.Set( 0.8523f, 0.34321f, 0.5736f);
- mPlaneNormal.Normalize();
-}
-// ------------------------------------------------------------------------------------------------
-// Destructor
-SGSpatialSort::~SGSpatialSort()
-{
- // nothing to do here, everything destructs automatically
-}
-// ------------------------------------------------------------------------------------------------
-void SGSpatialSort::Add(const aiVector3D& vPosition, unsigned int index,
- unsigned int smoothingGroup)
-{
- // store position by index and distance
- float distance = vPosition * mPlaneNormal;
- mPositions.push_back( Entry( index, vPosition,
- distance, smoothingGroup));
-}
-// ------------------------------------------------------------------------------------------------
-void SGSpatialSort::Prepare()
-{
- // now sort the array ascending by distance.
- std::sort( this->mPositions.begin(), this->mPositions.end());
-}
-// ------------------------------------------------------------------------------------------------
-// Returns an iterator for all positions close to the given position.
-void SGSpatialSort::FindPositions( const aiVector3D& pPosition,
- uint32_t pSG,
- float pRadius,
- std::vector<unsigned int>& poResults,
- bool exactMatch /*= false*/) const
-{
- float dist = pPosition * mPlaneNormal;
- float minDist = dist - pRadius, maxDist = dist + pRadius;
-
- // clear the array in this strange fashion because a simple clear() would also deallocate
- // the array which we want to avoid
- poResults.erase( poResults.begin(), poResults.end());
-
- // quick check for positions outside the range
- if ( mPositions.size() == 0)
- return;
- if ( maxDist < mPositions.front().mDistance)
- return;
- if ( minDist > mPositions.back().mDistance)
- return;
-
- // do a binary search for the minimal distance to start the iteration there
- unsigned int index = (unsigned int)mPositions.size() / 2;
- unsigned int binaryStepSize = (unsigned int)mPositions.size() / 4;
- while ( binaryStepSize > 1)
- {
- if ( mPositions[index].mDistance < minDist)
- index += binaryStepSize;
- else
- index -= binaryStepSize;
-
- binaryStepSize /= 2;
- }
-
- // depending on the direction of the last step we need to single step a bit back or forth
- // to find the actual beginning element of the range
- while ( index > 0 && mPositions[index].mDistance > minDist)
- index--;
- while ( index < (mPositions.size() - 1) && mPositions[index].mDistance < minDist)
- index++;
-
- // Mow start iterating from there until the first position lays outside of the distance range.
- // Add all positions inside the distance range within the given radius to the result aray
-
- float squareEpsilon = pRadius * pRadius;
- std::vector<Entry>::const_iterator it = mPositions.begin() + index;
- std::vector<Entry>::const_iterator end = mPositions.end();
-
- if (exactMatch)
- {
- while ( it->mDistance < maxDist)
- {
- if ((it->mPosition - pPosition).SquareLength() < squareEpsilon && it->mSmoothGroups == pSG)
- {
- poResults.push_back( it->mIndex);
- }
- ++it;
- if ( end == it )break;
- }
- }
- else
- {
- // if the given smoothing group is 0, we'll return all surrounding vertices
- if (!pSG)
- {
- while ( it->mDistance < maxDist)
- {
- if ((it->mPosition - pPosition).SquareLength() < squareEpsilon)
- poResults.push_back( it->mIndex);
- ++it;
- if ( end == it)break;
- }
- }
- else while ( it->mDistance < maxDist)
- {
- if ((it->mPosition - pPosition).SquareLength() < squareEpsilon &&
- (it->mSmoothGroups & pSG || !it->mSmoothGroups))
- {
- poResults.push_back( it->mIndex);
- }
- ++it;
- if ( end == it)break;
- }
- }
-}
-
-
diff --git a/3rdparty/assimp/code/SGSpatialSort.h b/3rdparty/assimp/code/SGSpatialSort.h
deleted file mode 100644
index e657ae3a..00000000
--- a/3rdparty/assimp/code/SGSpatialSort.h
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** Small helper classes to optimise finding vertizes close to a given location
- */
-#ifndef AI_D3DSSPATIALSORT_H_INC
-#define AI_D3DSSPATIALSORT_H_INC
-
-#include <vector>
-#include "../include/aiTypes.h"
-
-namespace Assimp {
-
-// ----------------------------------------------------------------------------------
-/** Specialized version of SpatialSort to support smoothing groups
- * This is used in by the 3DS, ASE and LWO loaders. 3DS and ASE share their
- * normal computation code in SmoothingGroups.inl, the LWO loader has its own
- * implementation to handle all details of its file format correctly.
- */
-// ----------------------------------------------------------------------------------
-class SGSpatialSort
-{
-public:
-
- SGSpatialSort();
-
- // -------------------------------------------------------------------
- /** Construction from a given face array, handling smoothing groups
- * properly
- */
- SGSpatialSort(const std::vector<aiVector3D>& vPositions);
-
- // -------------------------------------------------------------------
- /** Add a vertex to the spatial sort
- * @param vPosition Vertex position to be added
- * @param index Index of the vrtex
- * @param smoothingGroup SmoothingGroup for this vertex
- */
- void Add(const aiVector3D& vPosition, unsigned int index,
- unsigned int smoothingGroup);
-
- // -------------------------------------------------------------------
- /** Prepare the spatial sorter for use. This step runs in O(logn)
- */
- void Prepare();
-
- /** Destructor */
- ~SGSpatialSort();
-
- // -------------------------------------------------------------------
- /** Returns an iterator for all positions close to the given position.
- * @param pPosition The position to look for vertices.
- * @param pSG Only included vertices with at least one shared smooth group
- * @param pRadius Maximal distance from the position a vertex may have
- * to be counted in.
- * @param poResults The container to store the indices of the found
- * positions. Will be emptied by the call so it may contain anything.
- * @param exactMatch Specifies whether smoothing groups are bit masks
- * (false) or integral values (true). In the latter case, a vertex
- * cannot belong to more than one smoothing group.
- * @return An iterator to iterate over all vertices in the given area.
- */
- // -------------------------------------------------------------------
- void FindPositions( const aiVector3D& pPosition, uint32_t pSG,
- float pRadius, std::vector<unsigned int>& poResults,
- bool exactMatch = false) const;
-
-protected:
- /** Normal of the sorting plane, normalized. The center is always at (0, 0, 0) */
- aiVector3D mPlaneNormal;
-
- // -------------------------------------------------------------------
- /** An entry in a spatially sorted position array. Consists of a
- * vertex index, its position and its precalculated distance from
- * the reference plane */
- // -------------------------------------------------------------------
- struct Entry
- {
- unsigned int mIndex; ///< The vertex referred by this entry
- aiVector3D mPosition; ///< Position
- uint32_t mSmoothGroups;
- float mDistance; ///< Distance of this vertex to the sorting plane
-
- Entry() { /** intentionally not initialized.*/ }
- Entry( unsigned int pIndex, const aiVector3D& pPosition, float pDistance,uint32_t pSG)
- :
- mIndex( pIndex),
- mPosition( pPosition),
- mSmoothGroups (pSG),
- mDistance( pDistance)
- { }
-
- bool operator < (const Entry& e) const { return mDistance < e.mDistance; }
- };
-
- // all positions, sorted by distance to the sorting plane
- std::vector<Entry> mPositions;
-};
-
-} // end of namespace Assimp
-
-#endif // AI_SPATIALSORT_H_INC
diff --git a/3rdparty/assimp/code/SMDLoader.cpp b/3rdparty/assimp/code/SMDLoader.cpp
deleted file mode 100644
index 234582c9..00000000
--- a/3rdparty/assimp/code/SMDLoader.cpp
+++ /dev/null
@@ -1,1129 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file SMDLoader.cpp
- * @brief Implementation of the SMD importer class
- */
-
-#include "AssimpPCH.h"
-#ifndef ASSIMP_BUILD_NO_SMD_IMPORTER
-
-// internal headers
-#include "SMDLoader.h"
-#include "fast_atof.h"
-#include "SkeletonMeshBuilder.h"
-
-using namespace Assimp;
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-SMDImporter::SMDImporter()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-SMDImporter::~SMDImporter()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the class can handle the format of the given file.
-bool SMDImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool) const
-{
- // fixme: auto format detection
- return SimpleExtensionCheck(pFile,"smd","vta");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Get a list of all supported file extensions
-void SMDImporter::GetExtensionList(std::set<std::string>& extensions)
-{
- extensions.insert("smd");
- extensions.insert("vta");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Setup configuration properties
-void SMDImporter::SetupProperties(const Importer* pImp)
-{
- // The
- // AI_CONFIG_IMPORT_SMD_KEYFRAME option overrides the
- // AI_CONFIG_IMPORT_GLOBAL_KEYFRAME option.
- configFrameID = pImp->GetPropertyInteger(AI_CONFIG_IMPORT_SMD_KEYFRAME,0xffffffff);
- if(0xffffffff == configFrameID) {
- configFrameID = pImp->GetPropertyInteger(AI_CONFIG_IMPORT_GLOBAL_KEYFRAME,0);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Imports the given file into the given scene structure.
-void SMDImporter::InternReadFile(
- const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler)
-{
- boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
-
- // Check whether we can read from the file
- if( file.get() == NULL) {
- throw DeadlyImportError( "Failed to open SMD/VTA file " + pFile + ".");
- }
-
- iFileSize = (unsigned int)file->FileSize();
-
- // Allocate storage and copy the contents of the file to a memory buffer
- this->pScene = pScene;
-
- std::vector<char> buff(iFileSize+1);
- TextFileToBuffer(file.get(),buff);
- mBuffer = &buff[0];
-
- iSmallestFrame = (1 << 31);
- bHasUVs = true;
- iLineNumber = 1;
-
- // Reserve enough space for ... hm ... 10 textures
- aszTextures.reserve(10);
-
- // Reserve enough space for ... hm ... 1000 triangles
- asTriangles.reserve(1000);
-
- // Reserve enough space for ... hm ... 20 bones
- asBones.reserve(20);
-
-
- // parse the file ...
- ParseFile();
-
- // If there are no triangles it seems to be an animation SMD,
- // containing only the animation skeleton.
- if (asTriangles.empty())
- {
- if (asBones.empty())
- {
- throw DeadlyImportError("SMD: No triangles and no bones have "
- "been found in the file. This file seems to be invalid.");
- }
-
- // Set the flag in the scene structure which indicates
- // that there is nothing than an animation skeleton
- pScene->mFlags |= AI_SCENE_FLAGS_INCOMPLETE;
- }
-
- if (!asBones.empty())
- {
- // Check whether all bones have been initialized
- for (std::vector<SMD::Bone>::const_iterator
- i = asBones.begin();
- i != asBones.end();++i)
- {
- if (!(*i).mName.length())
- {
- DefaultLogger::get()->warn("SMD: Not all bones have been initialized");
- break;
- }
- }
-
- // now fix invalid time values and make sure the animation starts at frame 0
- FixTimeValues();
-
- // compute absolute bone transformation matrices
- // ComputeAbsoluteBoneTransformations();
- }
-
- if (!(pScene->mFlags & AI_SCENE_FLAGS_INCOMPLETE))
- {
- // create output meshes
- CreateOutputMeshes();
-
- // build an output material list
- CreateOutputMaterials();
- }
-
- // build the output animation
- CreateOutputAnimations();
-
- // build output nodes (bones are added as empty dummy nodes)
- CreateOutputNodes();
-
- if (pScene->mFlags & AI_SCENE_FLAGS_INCOMPLETE)
- {
- SkeletonMeshBuilder skeleton(pScene);
- }
-}
-// ------------------------------------------------------------------------------------------------
-// Write an error message with line number to the log file
-void SMDImporter::LogErrorNoThrow(const char* msg)
-{
- char szTemp[1024];
- sprintf(szTemp,"Line %i: %s",iLineNumber,msg);
- DefaultLogger::get()->error(szTemp);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Write a warning with line number to the log file
-void SMDImporter::LogWarning(const char* msg)
-{
- char szTemp[1024];
- ai_assert(strlen(msg) < 1000);
- DefaultLogger::get()->warn(szTemp);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Fix invalid time values in the file
-void SMDImporter::FixTimeValues()
-{
- double dDelta = (double)iSmallestFrame;
- double dMax = 0.0f;
- for (std::vector<SMD::Bone>::iterator
- iBone = asBones.begin();
- iBone != asBones.end();++iBone)
- {
- for (std::vector<SMD::Bone::Animation::MatrixKey>::iterator
- iKey = (*iBone).sAnim.asKeys.begin();
- iKey != (*iBone).sAnim.asKeys.end();++iKey)
- {
- (*iKey).dTime -= dDelta;
- dMax = std::max(dMax, (*iKey).dTime);
- }
- }
- dLengthOfAnim = dMax;
-}
-
-// ------------------------------------------------------------------------------------------------
-// create output meshes
-void SMDImporter::CreateOutputMeshes()
-{
- if (aszTextures.empty())
- aszTextures.push_back(std::string());
-
- // we need to sort all faces by their material index
- // in opposition to other loaders we can be sure that each
- // material is at least used once.
- pScene->mNumMeshes = (unsigned int) aszTextures.size();
- pScene->mMeshes = new aiMesh*[pScene->mNumMeshes];
-
- typedef std::vector<unsigned int> FaceList;
- FaceList* aaiFaces = new FaceList[pScene->mNumMeshes];
-
- // approximate the space that will be required
- unsigned int iNum = (unsigned int)asTriangles.size() / pScene->mNumMeshes;
- iNum += iNum >> 1;
- for (unsigned int i = 0; i < pScene->mNumMeshes;++i)
- aaiFaces[i].reserve(iNum);
-
-
- // collect all faces
- iNum = 0;
- for (std::vector<SMD::Face>::const_iterator
- iFace = asTriangles.begin();
- iFace != asTriangles.end();++iFace,++iNum)
- {
- if (0xffffffff == (*iFace).iTexture)aaiFaces[(*iFace).iTexture].push_back( 0 );
- else if ((*iFace).iTexture >= aszTextures.size())
- {
- DefaultLogger::get()->error("[SMD/VTA] Material index overflow in face");
- aaiFaces[(*iFace).iTexture].push_back((unsigned int)aszTextures.size()-1);
- }
- else aaiFaces[(*iFace).iTexture].push_back(iNum);
- }
-
- // now create the output meshes
- for (unsigned int i = 0; i < pScene->mNumMeshes;++i)
- {
- aiMesh*& pcMesh = pScene->mMeshes[i] = new aiMesh();
- ai_assert(!aaiFaces[i].empty()); // should not be empty ...
-
- pcMesh->mPrimitiveTypes = aiPrimitiveType_TRIANGLE;
- pcMesh->mNumVertices = (unsigned int)aaiFaces[i].size()*3;
- pcMesh->mNumFaces = (unsigned int)aaiFaces[i].size();
- pcMesh->mMaterialIndex = i;
-
- // storage for bones
- typedef std::pair<unsigned int,float> TempWeightListEntry;
- typedef std::vector< TempWeightListEntry > TempBoneWeightList;
-
- TempBoneWeightList* aaiBones = new TempBoneWeightList[asBones.size()]();
-
- // try to reserve enough memory without wasting too much
- for (unsigned int iBone = 0; iBone < asBones.size();++iBone)
- {
- aaiBones[iBone].reserve(pcMesh->mNumVertices/asBones.size());
- }
-
- // allocate storage
- pcMesh->mFaces = new aiFace[pcMesh->mNumFaces];
- aiVector3D* pcNormals = pcMesh->mNormals = new aiVector3D[pcMesh->mNumVertices];
- aiVector3D* pcVerts = pcMesh->mVertices = new aiVector3D[pcMesh->mNumVertices];
-
- aiVector3D* pcUVs = NULL;
- if (bHasUVs)
- {
- pcUVs = pcMesh->mTextureCoords[0] = new aiVector3D[pcMesh->mNumVertices];
- pcMesh->mNumUVComponents[0] = 2;
- }
-
- iNum = 0;
- for (unsigned int iFace = 0; iFace < pcMesh->mNumFaces;++iFace)
- {
- pcMesh->mFaces[iFace].mIndices = new unsigned int[3];
- pcMesh->mFaces[iFace].mNumIndices = 3;
-
- // fill the vertices
- unsigned int iSrcFace = aaiFaces[i][iFace];
- SMD::Face& face = asTriangles[iSrcFace];
-
- *pcVerts++ = face.avVertices[0].pos;
- *pcVerts++ = face.avVertices[1].pos;
- *pcVerts++ = face.avVertices[2].pos;
-
- // fill the normals
- *pcNormals++ = face.avVertices[0].nor;
- *pcNormals++ = face.avVertices[1].nor;
- *pcNormals++ = face.avVertices[2].nor;
-
- // fill the texture coordinates
- if (pcUVs)
- {
- *pcUVs++ = face.avVertices[0].uv;
- *pcUVs++ = face.avVertices[1].uv;
- *pcUVs++ = face.avVertices[2].uv;
- }
-
- for (unsigned int iVert = 0; iVert < 3;++iVert)
- {
- float fSum = 0.0f;
- for (unsigned int iBone = 0;iBone < face.avVertices[iVert].aiBoneLinks.size();++iBone)
- {
- TempWeightListEntry& pairval = face.avVertices[iVert].aiBoneLinks[iBone];
-
- // FIX: The second check is here just to make sure we won't
- // assign more than one weight to a single vertex index
- if (pairval.first >= asBones.size() ||
- pairval.first == face.avVertices[iVert].iParentNode)
- {
- DefaultLogger::get()->error("[SMD/VTA] Bone index overflow. "
- "The bone index will be ignored, the weight will be assigned "
- "to the vertex' parent node");
- continue;
- }
- aaiBones[pairval.first].push_back(TempWeightListEntry(iNum,pairval.second));
- fSum += pairval.second;
- }
- // ******************************************************************
- // If the sum of all vertex weights is not 1.0 we must assign
- // the rest to the vertex' parent node. Well, at least the doc says
- // we should ...
- // FIX: We use 0.975 as limit, floating-point inaccuracies seem to
- // be very strong in some SMD exporters. Furthermore it is possible
- // that the parent of a vertex is 0xffffffff (if the corresponding
- // entry in the file was unreadable)
- // ******************************************************************
- if (fSum < 0.975f && face.avVertices[iVert].iParentNode != 0xffffffff)
- {
- if (face.avVertices[iVert].iParentNode >= asBones.size())
- {
- DefaultLogger::get()->error("[SMD/VTA] Bone index overflow. "
- "The index of the vertex parent bone is invalid. "
- "The remaining weights will be normalized to 1.0");
-
- if (fSum)
- {
- fSum = 1 / fSum;
- for (unsigned int iBone = 0;iBone < face.avVertices[iVert].aiBoneLinks.size();++iBone)
- {
- TempWeightListEntry& pairval = face.avVertices[iVert].aiBoneLinks[iBone];
- if (pairval.first >= asBones.size())continue;
- aaiBones[pairval.first].back().second *= fSum;
- }
- }
- }
- else
- {
- aaiBones[face.avVertices[iVert].iParentNode].push_back(
- TempWeightListEntry(iNum,1.0f-fSum));
- }
- }
- pcMesh->mFaces[iFace].mIndices[iVert] = iNum++;
- }
- }
-
- // now build all bones of the mesh
- iNum = 0;
- for (unsigned int iBone = 0; iBone < asBones.size();++iBone)
- if (!aaiBones[iBone].empty())++iNum;
-
- if (false && iNum)
- {
- pcMesh->mNumBones = iNum;
- pcMesh->mBones = new aiBone*[pcMesh->mNumBones];
- iNum = 0;
- for (unsigned int iBone = 0; iBone < asBones.size();++iBone)
- {
- if (aaiBones[iBone].empty())continue;
- aiBone*& bone = pcMesh->mBones[iNum] = new aiBone();
-
- bone->mNumWeights = (unsigned int)aaiBones[iBone].size();
- bone->mWeights = new aiVertexWeight[bone->mNumWeights];
- bone->mOffsetMatrix = asBones[iBone].mOffsetMatrix;
- bone->mName.Set( asBones[iBone].mName );
-
- asBones[iBone].bIsUsed = true;
-
- for (unsigned int iWeight = 0; iWeight < bone->mNumWeights;++iWeight)
- {
- bone->mWeights[iWeight].mVertexId = aaiBones[iBone][iWeight].first;
- bone->mWeights[iWeight].mWeight = aaiBones[iBone][iWeight].second;
- }
- ++iNum;
- }
- }
- delete[] aaiBones;
- }
- delete[] aaiFaces;
-}
-
-// ------------------------------------------------------------------------------------------------
-// add bone child nodes
-void SMDImporter::AddBoneChildren(aiNode* pcNode, uint32_t iParent)
-{
- ai_assert(NULL != pcNode && 0 == pcNode->mNumChildren && NULL == pcNode->mChildren);
-
- // first count ...
- for (unsigned int i = 0; i < asBones.size();++i)
- {
- SMD::Bone& bone = asBones[i];
- if (bone.iParent == iParent)++pcNode->mNumChildren;
- }
-
- // now allocate the output array
- pcNode->mChildren = new aiNode*[pcNode->mNumChildren];
-
- // and fill all subnodes
- unsigned int qq = 0;
- for (unsigned int i = 0; i < asBones.size();++i)
- {
- SMD::Bone& bone = asBones[i];
- if (bone.iParent != iParent)continue;
-
- aiNode* pc = pcNode->mChildren[qq++] = new aiNode();
- pc->mName.Set(bone.mName);
-
- // store the local transformation matrix of the bind pose
- pc->mTransformation = bone.sAnim.asKeys[bone.sAnim.iFirstTimeKey].matrix;
- pc->mParent = pcNode;
-
- // add children to this node, too
- AddBoneChildren(pc,i);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// create output nodes
-void SMDImporter::CreateOutputNodes()
-{
- pScene->mRootNode = new aiNode();
- if (!(pScene->mFlags & AI_SCENE_FLAGS_INCOMPLETE))
- {
- // create one root node that renders all meshes
- pScene->mRootNode->mNumMeshes = pScene->mNumMeshes;
- pScene->mRootNode->mMeshes = new unsigned int[pScene->mNumMeshes];
- for (unsigned int i = 0; i < pScene->mNumMeshes;++i)
- pScene->mRootNode->mMeshes[i] = i;
- }
-
- // now add all bones as dummy sub nodes to the graph
- // AddBoneChildren(pScene->mRootNode,(uint32_t)-1);
-
- // if we have only one bone we can even remove the root node
- if (pScene->mFlags & AI_SCENE_FLAGS_INCOMPLETE &&
- 1 == pScene->mRootNode->mNumChildren)
- {
- aiNode* pcOldRoot = pScene->mRootNode;
- pScene->mRootNode = pcOldRoot->mChildren[0];
- pcOldRoot->mChildren[0] = NULL;
- delete pcOldRoot;
-
- pScene->mRootNode->mParent = NULL;
- }
- else
- {
- ::strcpy(pScene->mRootNode->mName.data, "<SMD_root>");
- pScene->mRootNode->mName.length = 10;
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// create output animations
-void SMDImporter::CreateOutputAnimations()
-{
- unsigned int iNumBones = 0;
- for (std::vector<SMD::Bone>::const_iterator
- i = asBones.begin();
- i != asBones.end();++i)
- {
- if ((*i).bIsUsed)++iNumBones;
- }
- if (!iNumBones)
- {
- // just make sure this case doesn't occur ... (it could occur
- // if the file was invalid)
- return;
- }
-
- pScene->mNumAnimations = 1;
- pScene->mAnimations = new aiAnimation*[1];
- aiAnimation*& anim = pScene->mAnimations[0] = new aiAnimation();
-
- anim->mDuration = dLengthOfAnim;
- anim->mNumChannels = iNumBones;
- anim->mTicksPerSecond = 25.0; // FIXME: is this correct?
-
- aiNodeAnim** pp = anim->mChannels = new aiNodeAnim*[anim->mNumChannels];
-
- // now build valid keys
- unsigned int a = 0;
- for (std::vector<SMD::Bone>::const_iterator
- i = asBones.begin();
- i != asBones.end();++i)
- {
- if (!(*i).bIsUsed)continue;
-
- aiNodeAnim* p = pp[a] = new aiNodeAnim();
-
- // copy the name of the bone
- p->mNodeName.Set( i->mName);
-
- p->mNumRotationKeys = (unsigned int) (*i).sAnim.asKeys.size();
- if (p->mNumRotationKeys)
- {
- p->mNumPositionKeys = p->mNumRotationKeys;
- aiVectorKey* pVecKeys = p->mPositionKeys = new aiVectorKey[p->mNumRotationKeys];
- aiQuatKey* pRotKeys = p->mRotationKeys = new aiQuatKey[p->mNumRotationKeys];
-
- for (std::vector<SMD::Bone::Animation::MatrixKey>::const_iterator
- qq = (*i).sAnim.asKeys.begin();
- qq != (*i).sAnim.asKeys.end(); ++qq)
- {
- pRotKeys->mTime = pVecKeys->mTime = (*qq).dTime;
-
- // compute the rotation quaternion from the euler angles
- pRotKeys->mValue = aiQuaternion( (*qq).vRot.x, (*qq).vRot.y, (*qq).vRot.z );
- pVecKeys->mValue = (*qq).vPos;
-
- ++pVecKeys; ++pRotKeys;
- }
- }
- ++a;
-
- // there are no scaling keys ...
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void SMDImporter::ComputeAbsoluteBoneTransformations()
-{
- // For each bone: determine the key with the lowest time value
- // theoretically the SMD format should have all keyframes
- // in order. However, I've seen a file where this wasn't true.
- for (unsigned int i = 0; i < asBones.size();++i)
- {
- SMD::Bone& bone = asBones[i];
-
- uint32_t iIndex = 0;
- double dMin = 10e10;
- for (unsigned int i = 0; i < bone.sAnim.asKeys.size();++i)
- {
- double d = std::min(bone.sAnim.asKeys[i].dTime,dMin);
- if (d < dMin)
- {
- dMin = d;
- iIndex = i;
- }
- }
- bone.sAnim.iFirstTimeKey = iIndex;
- }
-
- unsigned int iParent = 0;
- while (iParent < asBones.size())
- {
- for (unsigned int iBone = 0; iBone < asBones.size();++iBone)
- {
- SMD::Bone& bone = asBones[iBone];
-
- if (iParent == bone.iParent)
- {
- SMD::Bone& parentBone = asBones[iParent];
-
-
- uint32_t iIndex = bone.sAnim.iFirstTimeKey;
- const aiMatrix4x4& mat = bone.sAnim.asKeys[iIndex].matrix;
- aiMatrix4x4& matOut = bone.sAnim.asKeys[iIndex].matrixAbsolute;
-
- // The same for the parent bone ...
- iIndex = parentBone.sAnim.iFirstTimeKey;
- const aiMatrix4x4& mat2 = parentBone.sAnim.asKeys[iIndex].matrixAbsolute;
-
- // Compute the absolute transformation matrix
- matOut = mat * mat2;
- }
- }
- ++iParent;
- }
-
- // Store the inverse of the absolute transformation matrix
- // of the first key as bone offset matrix
- for (iParent = 0; iParent < asBones.size();++iParent)
- {
- SMD::Bone& bone = asBones[iParent];
- bone.mOffsetMatrix = bone.sAnim.asKeys[bone.sAnim.iFirstTimeKey].matrixAbsolute;
- bone.mOffsetMatrix.Inverse();
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// create output materials
-void SMDImporter::CreateOutputMaterials()
-{
- pScene->mNumMaterials = (unsigned int)aszTextures.size();
- pScene->mMaterials = new aiMaterial*[std::max(1u, pScene->mNumMaterials)];
-
- for (unsigned int iMat = 0; iMat < pScene->mNumMaterials;++iMat)
- {
- MaterialHelper* pcMat = new MaterialHelper();
- pScene->mMaterials[iMat] = pcMat;
-
- aiString szName;
- szName.length = (size_t)::sprintf(szName.data,"Texture_%i",iMat);
- pcMat->AddProperty(&szName,AI_MATKEY_NAME);
-
- if (aszTextures[iMat].length())
- {
- ::strcpy(szName.data, aszTextures[iMat].c_str() );
- szName.length = aszTextures[iMat].length();
- pcMat->AddProperty(&szName,AI_MATKEY_TEXTURE_DIFFUSE(0));
- }
- }
-
- // create a default material if necessary
- if (0 == pScene->mNumMaterials)
- {
- pScene->mNumMaterials = 1;
-
- MaterialHelper* pcHelper = new MaterialHelper();
- pScene->mMaterials[0] = pcHelper;
-
- int iMode = (int)aiShadingMode_Gouraud;
- pcHelper->AddProperty<int>(&iMode, 1, AI_MATKEY_SHADING_MODEL);
-
- aiColor3D clr;
- clr.b = clr.g = clr.r = 0.7f;
- pcHelper->AddProperty<aiColor3D>(&clr, 1,AI_MATKEY_COLOR_DIFFUSE);
- pcHelper->AddProperty<aiColor3D>(&clr, 1,AI_MATKEY_COLOR_SPECULAR);
-
- clr.b = clr.g = clr.r = 0.05f;
- pcHelper->AddProperty<aiColor3D>(&clr, 1,AI_MATKEY_COLOR_AMBIENT);
-
- aiString szName;
- szName.Set(AI_DEFAULT_MATERIAL_NAME);
- pcHelper->AddProperty(&szName,AI_MATKEY_NAME);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Parse the file
-void SMDImporter::ParseFile()
-{
- const char* szCurrent = mBuffer;
-
- // read line per line ...
- while (true)
- {
- if(!SkipSpacesAndLineEnd(szCurrent,&szCurrent)) break;
-
- // "version <n> \n", <n> should be 1 for hl and hl² SMD files
- if (TokenMatch(szCurrent,"version",7))
- {
- if(!SkipSpaces(szCurrent,&szCurrent)) break;
- if (1 != strtol10(szCurrent,&szCurrent))
- {
- DefaultLogger::get()->warn("SMD.version is not 1. This "
- "file format is not known. Continuing happily ...");
- }
- continue;
- }
- // "nodes\n" - Starts the node section
- if (TokenMatch(szCurrent,"nodes",5))
- {
- ParseNodesSection(szCurrent,&szCurrent);
- continue;
- }
- // "triangles\n" - Starts the triangle section
- if (TokenMatch(szCurrent,"triangles",9))
- {
- ParseTrianglesSection(szCurrent,&szCurrent);
- continue;
- }
- // "vertexanimation\n" - Starts the vertex animation section
- if (TokenMatch(szCurrent,"vertexanimation",15))
- {
- bHasUVs = false;
- ParseVASection(szCurrent,&szCurrent);
- continue;
- }
- // "skeleton\n" - Starts the skeleton section
- if (TokenMatch(szCurrent,"skeleton",8))
- {
- ParseSkeletonSection(szCurrent,&szCurrent);
- continue;
- }
- SkipLine(szCurrent,&szCurrent);
- }
- return;
-}
-
-// ------------------------------------------------------------------------------------------------
-unsigned int SMDImporter::GetTextureIndex(const std::string& filename)
-{
- unsigned int iIndex = 0;
- for (std::vector<std::string>::const_iterator
- i = aszTextures.begin();
- i != aszTextures.end();++i,++iIndex)
- {
- // case-insensitive ... it's a path
- if (0 == ASSIMP_stricmp ( filename.c_str(),(*i).c_str()))return iIndex;
- }
- iIndex = (unsigned int)aszTextures.size();
- aszTextures.push_back(filename);
- return iIndex;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Parse the nodes section of the file
-void SMDImporter::ParseNodesSection(const char* szCurrent,
- const char** szCurrentOut)
-{
- while (true)
- {
- // "end\n" - Ends the nodes section
- if (0 == ASSIMP_strincmp(szCurrent,"end",3) &&
- IsSpaceOrNewLine(*(szCurrent+3)))
- {
- szCurrent += 4;
- break;
- }
- ParseNodeInfo(szCurrent,&szCurrent);
- }
- SkipSpacesAndLineEnd(szCurrent,&szCurrent);
- *szCurrentOut = szCurrent;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Parse the triangles section of the file
-void SMDImporter::ParseTrianglesSection(const char* szCurrent,
- const char** szCurrentOut)
-{
- // Parse a triangle, parse another triangle, parse the next triangle ...
- // and so on until we reach a token that looks quite similar to "end"
- while (true)
- {
- if(!SkipSpacesAndLineEnd(szCurrent,&szCurrent)) break;
-
- // "end\n" - Ends the triangles section
- if (TokenMatch(szCurrent,"end",3))
- break;
- ParseTriangle(szCurrent,&szCurrent);
- }
- SkipSpacesAndLineEnd(szCurrent,&szCurrent);
- *szCurrentOut = szCurrent;
-}
-// ------------------------------------------------------------------------------------------------
-// Parse the vertex animation section of the file
-void SMDImporter::ParseVASection(const char* szCurrent,
- const char** szCurrentOut)
-{
- unsigned int iCurIndex = 0;
- while (true)
- {
- if(!SkipSpacesAndLineEnd(szCurrent,&szCurrent)) break;
-
- // "end\n" - Ends the "vertexanimation" section
- if (TokenMatch(szCurrent,"end",3))
- break;
-
- // "time <n>\n"
- if (TokenMatch(szCurrent,"time",4))
- {
- // NOTE: The doc says that time values COULD be negative ...
- // NOTE2: this is the shape key -> valve docs
- int iTime = 0;
- if(!ParseSignedInt(szCurrent,&szCurrent,iTime) || configFrameID != (unsigned int)iTime)break;
- SkipLine(szCurrent,&szCurrent);
- }
- else
- {
- if(0 == iCurIndex)
- {
- asTriangles.push_back(SMD::Face());
- }
- if (++iCurIndex == 3)iCurIndex = 0;
- ParseVertex(szCurrent,&szCurrent,asTriangles.back().avVertices[iCurIndex],true);
- }
- }
-
- if (iCurIndex != 2 && !asTriangles.empty())
- {
- // we want to no degenerates, so throw this triangle away
- asTriangles.pop_back();
- }
-
- SkipSpacesAndLineEnd(szCurrent,&szCurrent);
- *szCurrentOut = szCurrent;
-}
-// ------------------------------------------------------------------------------------------------
-// Parse the skeleton section of the file
-void SMDImporter::ParseSkeletonSection(const char* szCurrent,
- const char** szCurrentOut)
-{
- int iTime = 0;
- while (true)
- {
- if(!SkipSpacesAndLineEnd(szCurrent,&szCurrent)) break;
-
- // "end\n" - Ends the skeleton section
- if (TokenMatch(szCurrent,"end",3))
- break;
-
- // "time <n>\n" - Specifies the current animation frame
- else if (TokenMatch(szCurrent,"time",4))
- {
- // NOTE: The doc says that time values COULD be negative ...
- if(!ParseSignedInt(szCurrent,&szCurrent,iTime))break;
-
- iSmallestFrame = std::min(iSmallestFrame,iTime);
- SkipLine(szCurrent,&szCurrent);
- }
- else ParseSkeletonElement(szCurrent,&szCurrent,iTime);
- }
- *szCurrentOut = szCurrent;
-}
-
-// ------------------------------------------------------------------------------------------------
-#define SMDI_PARSE_RETURN { \
- SkipLine(szCurrent,&szCurrent); \
- *szCurrentOut = szCurrent; \
- return; \
-}
-// ------------------------------------------------------------------------------------------------
-// Parse a node line
-void SMDImporter::ParseNodeInfo(const char* szCurrent,
- const char** szCurrentOut)
-{
- unsigned int iBone = 0;
- SkipSpacesAndLineEnd(szCurrent,&szCurrent);
- if(!ParseUnsignedInt(szCurrent,&szCurrent,iBone) || !SkipSpaces(szCurrent,&szCurrent))
- {
- LogErrorNoThrow("Unexpected EOF/EOL while parsing bone index");
- SMDI_PARSE_RETURN;
- }
- // add our bone to the list
- if (iBone >= asBones.size())asBones.resize(iBone+1);
- SMD::Bone& bone = asBones[iBone];
-
- bool bQuota = true;
- if ('\"' != *szCurrent)
- {
- LogWarning("Bone name is expcted to be enclosed in "
- "double quotation marks. ");
- bQuota = false;
- }
- else ++szCurrent;
-
- const char* szEnd = szCurrent;
- while (true)
- {
- if (bQuota && '\"' == *szEnd)
- {
- iBone = (unsigned int)(szEnd - szCurrent);
- ++szEnd;
- break;
- }
- else if (IsSpaceOrNewLine(*szEnd))
- {
- iBone = (unsigned int)(szEnd - szCurrent);
- break;
- }
- else if (!(*szEnd))
- {
- LogErrorNoThrow("Unexpected EOF/EOL while parsing bone name");
- SMDI_PARSE_RETURN;
- }
- ++szEnd;
- }
- bone.mName = std::string(szCurrent,iBone);
- szCurrent = szEnd;
-
- // the only negative bone parent index that could occur is -1 AFAIK
- if(!ParseSignedInt(szCurrent,&szCurrent,(int&)bone.iParent))
- {
- LogErrorNoThrow("Unexpected EOF/EOL while parsing bone parent index. Assuming -1");
- SMDI_PARSE_RETURN;
- }
-
- // go to the beginning of the next line
- SMDI_PARSE_RETURN;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Parse a skeleton element
-void SMDImporter::ParseSkeletonElement(const char* szCurrent,
- const char** szCurrentOut,int iTime)
-{
- aiVector3D vPos;
- aiVector3D vRot;
-
- unsigned int iBone = 0;
- if(!ParseUnsignedInt(szCurrent,&szCurrent,iBone))
- {
- DefaultLogger::get()->error("Unexpected EOF/EOL while parsing bone index");
- SMDI_PARSE_RETURN;
- }
- if (iBone >= asBones.size())
- {
- LogErrorNoThrow("Bone index in skeleton section is out of range");
- SMDI_PARSE_RETURN;
- }
- SMD::Bone& bone = asBones[iBone];
-
- bone.sAnim.asKeys.push_back(SMD::Bone::Animation::MatrixKey());
- SMD::Bone::Animation::MatrixKey& key = bone.sAnim.asKeys.back();
-
- key.dTime = (double)iTime;
- if(!ParseFloat(szCurrent,&szCurrent,(float&)vPos.x))
- {
- LogErrorNoThrow("Unexpected EOF/EOL while parsing bone.pos.x");
- SMDI_PARSE_RETURN;
- }
- if(!ParseFloat(szCurrent,&szCurrent,(float&)vPos.y))
- {
- LogErrorNoThrow("Unexpected EOF/EOL while parsing bone.pos.y");
- SMDI_PARSE_RETURN;
- }
- if(!ParseFloat(szCurrent,&szCurrent,(float&)vPos.z))
- {
- LogErrorNoThrow("Unexpected EOF/EOL while parsing bone.pos.z");
- SMDI_PARSE_RETURN;
- }
- if(!ParseFloat(szCurrent,&szCurrent,(float&)vRot.x))
- {
- LogErrorNoThrow("Unexpected EOF/EOL while parsing bone.rot.x");
- SMDI_PARSE_RETURN;
- }
- if(!ParseFloat(szCurrent,&szCurrent,(float&)vRot.y))
- {
- LogErrorNoThrow("Unexpected EOF/EOL while parsing bone.rot.y");
- SMDI_PARSE_RETURN;
- }
- if(!ParseFloat(szCurrent,&szCurrent,(float&)vRot.z))
- {
- LogErrorNoThrow("Unexpected EOF/EOL while parsing bone.rot.z");
- SMDI_PARSE_RETURN;
- }
- // build the transformation matrix of the key
- key.matrix.FromEulerAnglesXYZ(vRot.x,vRot.y,vRot.z);
- {
- aiMatrix4x4 mTemp;
- mTemp.a4 = vPos.x;
- mTemp.b4 = vPos.y;
- mTemp.c4 = vPos.z;
- key.matrix = key.matrix * mTemp;
- }
-
- // go to the beginning of the next line
- SMDI_PARSE_RETURN;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Parse a triangle
-void SMDImporter::ParseTriangle(const char* szCurrent,
- const char** szCurrentOut)
-{
- asTriangles.push_back(SMD::Face());
- SMD::Face& face = asTriangles.back();
-
- if(!SkipSpaces(szCurrent,&szCurrent))
- {
- LogErrorNoThrow("Unexpected EOF/EOL while parsing a triangle");
- return;
- }
-
- // read the texture file name
- const char* szLast = szCurrent;
- while (!IsSpaceOrNewLine(*szCurrent++));
-
- // ... and get the index that belongs to this file name
- face.iTexture = GetTextureIndex(std::string(szLast,(uintptr_t)szCurrent-(uintptr_t)szLast));
-
- SkipSpacesAndLineEnd(szCurrent,&szCurrent);
-
- // load three vertices
- for (unsigned int iVert = 0; iVert < 3;++iVert)
- {
- ParseVertex(szCurrent,&szCurrent,
- face.avVertices[iVert]);
- }
- *szCurrentOut = szCurrent;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Parse a float
-bool SMDImporter::ParseFloat(const char* szCurrent,
- const char** szCurrentOut, float& out)
-{
- if(!SkipSpaces(&szCurrent))
- return false;
-
- *szCurrentOut = fast_atof_move(szCurrent,out);
- return true;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Parse an unsigned int
-bool SMDImporter::ParseUnsignedInt(const char* szCurrent,
- const char** szCurrentOut, unsigned int& out)
-{
- if(!SkipSpaces(&szCurrent))
- return false;
-
- out = strtol10(szCurrent,szCurrentOut);
- return true;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Parse a signed int
-bool SMDImporter::ParseSignedInt(const char* szCurrent,
- const char** szCurrentOut, int& out)
-{
- if(!SkipSpaces(&szCurrent))
- return false;
-
- out = strtol10s(szCurrent,szCurrentOut);
- return true;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Parse a vertex
-void SMDImporter::ParseVertex(const char* szCurrent,
- const char** szCurrentOut, SMD::Vertex& vertex,
- bool bVASection /*= false*/)
-{
- if (SkipSpaces(&szCurrent) && IsLineEnd(*szCurrent))
- {
- SkipSpacesAndLineEnd(szCurrent,&szCurrent);
- return ParseVertex(szCurrent,szCurrentOut,vertex,bVASection);
- }
- if(!ParseSignedInt(szCurrent,&szCurrent,(int&)vertex.iParentNode))
- {
- LogErrorNoThrow("Unexpected EOF/EOL while parsing vertex.parent");
- SMDI_PARSE_RETURN;
- }
- if(!ParseFloat(szCurrent,&szCurrent,(float&)vertex.pos.x))
- {
- LogErrorNoThrow("Unexpected EOF/EOL while parsing vertex.pos.x");
- SMDI_PARSE_RETURN;
- }
- if(!ParseFloat(szCurrent,&szCurrent,(float&)vertex.pos.y))
- {
- LogErrorNoThrow("Unexpected EOF/EOL while parsing vertex.pos.y");
- SMDI_PARSE_RETURN;
- }
- if(!ParseFloat(szCurrent,&szCurrent,(float&)vertex.pos.z))
- {
- LogErrorNoThrow("Unexpected EOF/EOL while parsing vertex.pos.z");
- SMDI_PARSE_RETURN;
- }
- if(!ParseFloat(szCurrent,&szCurrent,(float&)vertex.nor.x))
- {
- LogErrorNoThrow("Unexpected EOF/EOL while parsing vertex.nor.x");
- SMDI_PARSE_RETURN;
- }
- if(!ParseFloat(szCurrent,&szCurrent,(float&)vertex.nor.y))
- {
- LogErrorNoThrow("Unexpected EOF/EOL while parsing vertex.nor.y");
- SMDI_PARSE_RETURN;
- }
- if(!ParseFloat(szCurrent,&szCurrent,(float&)vertex.nor.z))
- {
- LogErrorNoThrow("Unexpected EOF/EOL while parsing vertex.nor.z");
- SMDI_PARSE_RETURN;
- }
-
- if (bVASection)SMDI_PARSE_RETURN;
-
- if(!ParseFloat(szCurrent,&szCurrent,(float&)vertex.uv.x))
- {
- LogErrorNoThrow("Unexpected EOF/EOL while parsing vertex.uv.x");
- SMDI_PARSE_RETURN;
- }
- if(!ParseFloat(szCurrent,&szCurrent,(float&)vertex.uv.y))
- {
- LogErrorNoThrow("Unexpected EOF/EOL while parsing vertex.uv.y");
- SMDI_PARSE_RETURN;
- }
-
- // now read the number of bones affecting this vertex
- // all elements from now are fully optional, we don't need them
- unsigned int iSize = 0;
- if(!ParseUnsignedInt(szCurrent,&szCurrent,iSize))SMDI_PARSE_RETURN;
- vertex.aiBoneLinks.resize(iSize,std::pair<unsigned int, float>(0,0.0f));
-
- for (std::vector<std::pair<unsigned int, float> >::iterator
- i = vertex.aiBoneLinks.begin();
- i != vertex.aiBoneLinks.end();++i)
- {
- if(!ParseUnsignedInt(szCurrent,&szCurrent,(*i).first))
- SMDI_PARSE_RETURN;
- if(!ParseFloat(szCurrent,&szCurrent,(*i).second))
- SMDI_PARSE_RETURN;
- }
-
- // go to the beginning of the next line
- SMDI_PARSE_RETURN;
-}
-
-#endif // !! ASSIMP_BUILD_NO_SMD_IMPORTER
diff --git a/3rdparty/assimp/code/SMDLoader.h b/3rdparty/assimp/code/SMDLoader.h
deleted file mode 100644
index 9b4ac8da..00000000
--- a/3rdparty/assimp/code/SMDLoader.h
+++ /dev/null
@@ -1,420 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file SMDLoader.h
- * @brief Defintion of the Valve SMD file format
- */
-
-#ifndef AI_SMDLOADER_H_INCLUDED
-#define AI_SMDLOADER_H_INCLUDED
-
-// internal headers
-#include "BaseImporter.h"
-#include "ParsingUtils.h"
-
-// public Assimp headers
-#include "../include/aiTypes.h"
-#include "../include/aiTexture.h"
-#include "../include/aiAnim.h"
-#include "../include/aiMaterial.h"
-struct aiNode;
-
-// STL headers
-#include <vector>
-
-namespace Assimp {
-class MaterialHelper;
-
-namespace SMD {
-
-// ---------------------------------------------------------------------------
-/** Data structure for a vertex in a SMD file
-*/
-struct Vertex
-{
- Vertex() : iParentNode(0xffffffff)
- {}
-
- //! Vertex position, normal and texture coordinate
- aiVector3D pos,nor,uv;
-
- //! Vertex parent node
- unsigned int iParentNode;
-
- //! Links to bones: pair.first is the bone index,
- //! pair.second is the vertex weight.
- //! WARN: The remaining weight (to reach 1.0f) is assigned
- //! to the parent node/bone
- std::vector<std::pair<unsigned int, float> > aiBoneLinks;
-};
-
-// ---------------------------------------------------------------------------
-/** Data structure for a face in a SMD file
-*/
-struct Face
-{
- Face() : iTexture(0x0)
- {}
-
- //! Texture index for the face
- unsigned int iTexture;
-
- //! The three vertices of the face
- Vertex avVertices[3];
-};
-
-// ---------------------------------------------------------------------------
-/** Data structure for a bone in a SMD file
-*/
-struct Bone
-{
- //! Default constructor
- Bone() : iParent(0xffffffff), bIsUsed(false)
- {
- }
-
- //! Destructor
- ~Bone()
- {
- }
-
- //! Name of the bone
- std::string mName;
-
- //! Parent of the bone
- uint32_t iParent;
-
- //! Animation of the bone
- struct Animation
- {
- //! Public default constructor
- Animation()
- {
- asKeys.reserve(20);
- }
-
- //! Data structure for a matrix key
- struct MatrixKey
- {
- //! Matrix at this time
- aiMatrix4x4 matrix;
-
- //! Absolute transformation matrix
- aiMatrix4x4 matrixAbsolute;
-
- //! Position
- aiVector3D vPos;
-
- //! Rotation (euler angles)
- aiVector3D vRot;
-
- //! Current time. may be negative, this
- //! will be fixed later
- double dTime;
- };
-
- //! Index of the key with the smallest time value
- uint32_t iFirstTimeKey;
-
- //! Array of matrix keys
- std::vector<MatrixKey> asKeys;
-
- } sAnim;
-
- //! Offset matrix of the bone
- aiMatrix4x4 mOffsetMatrix;
-
- //! true if the bone is referenced by at least one mesh
- bool bIsUsed;
-};
-
-} //! namespace SMD
-
-// ---------------------------------------------------------------------------
-/** Used to load Half-life 1 and 2 SMD models
-*/
-class SMDImporter : public BaseImporter
-{
- friend class Importer;
-
-protected:
- /** Constructor to be privately used by Importer */
- SMDImporter();
-
- /** Destructor, private as well */
- ~SMDImporter();
-
-public:
-
- // -------------------------------------------------------------------
- /** Returns whether the class can handle the format of the given file.
- * See BaseImporter::CanRead() for details.
- */
- bool CanRead( const std::string& pFile, IOSystem* pIOHandler,
- bool checkSig) const;
-
- // -------------------------------------------------------------------
- /** Called prior to ReadFile().
- * The function is a request to the importer to update its configuration
- * basing on the Importer's configuration property list.
- */
- void SetupProperties(const Importer* pImp);
-
-protected:
-
-
- // -------------------------------------------------------------------
- /** Called by Importer::GetExtensionList() for each loaded importer.
- * See BaseImporter::GetExtensionList() for details
- */
- void GetExtensionList(std::set<std::string>& extensions);
-
- // -------------------------------------------------------------------
- /** Imports the given file into the given scene structure.
- * See BaseImporter::InternReadFile() for details
- */
- void InternReadFile( const std::string& pFile, aiScene* pScene,
- IOSystem* pIOHandler);
-
-protected:
-
- // -------------------------------------------------------------------
- /** Parse the SMD file and create the output scene
- */
- void ParseFile();
-
- // -------------------------------------------------------------------
- /** Parse the triangles section of the SMD file
- * \param szCurrent Current position in the file. Points to the first
- * data line of the section.
- * \param szCurrentOut Receives a pointer to the heading line of
- * the next section (or to EOF)
- */
- void ParseTrianglesSection(const char* szCurrent,
- const char** szCurrentOut);
-
- // -------------------------------------------------------------------
- /** Parse the vertex animation section in VTA files
- * \param szCurrent Current position in the file. Points to the first
- * data line of the section.
- * \param szCurrentOut Receives a pointer to the heading line of
- * the next section (or to EOF)
- */
- void ParseVASection(const char* szCurrent,
- const char** szCurrentOut);
-
- // -------------------------------------------------------------------
- /** Parse the nodes section of the SMD file
- * \param szCurrent Current position in the file. Points to the first
- * data line of the section.
- * \param szCurrentOut Receives a pointer to the heading line of
- * the next section (or to EOF)
- */
- void ParseNodesSection(const char* szCurrent,
- const char** szCurrentOut);
-
- // -------------------------------------------------------------------
- /** Parse the skeleton section of the SMD file
- * \param szCurrent Current position in the file. Points to the first
- * data line of the section.
- * \param szCurrentOut Receives a pointer to the heading line of
- * the next section (or to EOF)
- */
- void ParseSkeletonSection(const char* szCurrent,
- const char** szCurrentOut);
-
- // -------------------------------------------------------------------
- /** Parse a single triangle in the SMD file
- * \param szCurrent Current position in the file. Points to the first
- * data line of the section.
- * \param szCurrentOut Receives the output cursor position
- */
- void ParseTriangle(const char* szCurrent,
- const char** szCurrentOut);
-
-
- // -------------------------------------------------------------------
- /** Parse a single vertex in the SMD file
- * \param szCurrent Current position in the file. Points to the first
- * data line of the section.
- * \param szCurrentOut Receives the output cursor position
- * \param vertex Vertex to be filled
- */
- void ParseVertex(const char* szCurrent,
- const char** szCurrentOut, SMD::Vertex& vertex,
- bool bVASection = false);
-
- // -------------------------------------------------------------------
- /** Get the index of a texture. If the texture was not yet known
- * it will be added to the internal texture list.
- * \param filename Name of the texture
- * \return Value texture index
- */
- unsigned int GetTextureIndex(const std::string& filename);
-
- // -------------------------------------------------------------------
- /** Computes absolute bone transformations
- * All output transformations are in worldspace.
- */
- void ComputeAbsoluteBoneTransformations();
-
-
- // -------------------------------------------------------------------
- /** Parse a line in the skeleton section
- */
- void ParseSkeletonElement(const char* szCurrent,
- const char** szCurrentOut,int iTime);
-
- // -------------------------------------------------------------------
- /** Parse a line in the nodes section
- */
- void ParseNodeInfo(const char* szCurrent,
- const char** szCurrentOut);
-
-
- // -------------------------------------------------------------------
- /** Parse a floating-point value
- */
- bool ParseFloat(const char* szCurrent,
- const char** szCurrentOut, float& out);
-
- // -------------------------------------------------------------------
- /** Parse an unsigned integer. There may be no sign!
- */
- bool ParseUnsignedInt(const char* szCurrent,
- const char** szCurrentOut, unsigned int& out);
-
- // -------------------------------------------------------------------
- /** Parse a signed integer. Signs (+,-) are handled.
- */
- bool ParseSignedInt(const char* szCurrent,
- const char** szCurrentOut, int& out);
-
- // -------------------------------------------------------------------
- /** Fix invalid time values in the file
- */
- void FixTimeValues();
-
- // -------------------------------------------------------------------
- /** Add all children of a bone as subnodes to a node
- * \param pcNode Parent node
- * \param iParent Parent bone index
- */
- void AddBoneChildren(aiNode* pcNode, uint32_t iParent);
-
- // -------------------------------------------------------------------
- /** Build output meshes/materials/nodes/animations
- */
- void CreateOutputMeshes();
- void CreateOutputNodes();
- void CreateOutputAnimations();
- void CreateOutputMaterials();
-
-
- // -------------------------------------------------------------------
- /** Print a log message together with the current line number
- */
- void LogErrorNoThrow(const char* msg);
- void LogWarning(const char* msg);
-
-
- // -------------------------------------------------------------------
- inline bool SkipLine( const char* in, const char** out)
- {
- Assimp::SkipLine(in,out);
- ++iLineNumber;
- return true;
- }
- // -------------------------------------------------------------------
- inline bool SkipSpacesAndLineEnd( const char* in, const char** out)
- {
- ++iLineNumber;
- return Assimp::SkipSpacesAndLineEnd(in,out);
- }
-
-private:
-
- /** Configuration option: frame to be loaded */
- unsigned int configFrameID;
-
- /** Buffer to hold the loaded file */
- const char* mBuffer;
-
- /** Output scene to be filled
- */
- aiScene* pScene;
-
- /** Size of the input file in bytes
- */
- unsigned int iFileSize;
-
- /** Array of textures found in the file
- */
- std::vector<std::string> aszTextures;
-
- /** Array of triangles found in the file
- */
- std::vector<SMD::Face> asTriangles;
-
- /** Array of bones found in the file
- */
- std::vector<SMD::Bone> asBones;
-
- /** Smallest frame index found in the skeleton
- */
- int iSmallestFrame;
-
- /** Length of the whole animation, in frames
- */
- double dLengthOfAnim;
-
- /** Do we have texture coordinates?
- */
- bool bHasUVs;
-
- /** Current line numer
- */
- unsigned int iLineNumber;
-
-};
-
-} // end of namespace Assimp
-
-#endif // AI_SMDIMPORTER_H_INC
diff --git a/3rdparty/assimp/code/STLLoader.cpp b/3rdparty/assimp/code/STLLoader.cpp
deleted file mode 100644
index 894124f2..00000000
--- a/3rdparty/assimp/code/STLLoader.cpp
+++ /dev/null
@@ -1,398 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file Implementation of the STL importer class */
-
-#include "AssimpPCH.h"
-#ifndef ASSIMP_BUILD_NO_STL_IMPORTER
-
-// internal headers
-#include "STLLoader.h"
-#include "ParsingUtils.h"
-#include "fast_atof.h"
-
-using namespace Assimp;
-
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-STLImporter::STLImporter()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-STLImporter::~STLImporter()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the class can handle the format of the given file.
-bool STLImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const
-{
- const std::string extension = GetExtension(pFile);
-
- if (extension == "stl")
- return true;
- else if (!extension.length() || checkSig) {
- if (!pIOHandler)
- return true;
- const char* tokens[] = {"STL","solid"};
- return SearchFileHeaderForToken(pIOHandler,pFile,tokens,2);
- }
- return false;
-}
-
-// ------------------------------------------------------------------------------------------------
-void STLImporter::GetExtensionList(std::set<std::string>& extensions)
-{
- extensions.insert("stl");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Imports the given file into the given scene structure.
-void STLImporter::InternReadFile( const std::string& pFile,
- aiScene* pScene, IOSystem* pIOHandler)
-{
- boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile, "rb"));
-
- // Check whether we can read from the file
- if ( file.get() == NULL) {
- throw DeadlyImportError( "Failed to open STL file " + pFile + ".");
- }
-
- fileSize = (unsigned int)file->FileSize();
-
- // allocate storage and copy the contents of the file to a memory buffer
- // (terminate it with zero)
- std::vector<char> mBuffer2;
- TextFileToBuffer(file.get(),mBuffer2);
-
- this->pScene = pScene;
- this->mBuffer = &mBuffer2[0];
-
- // the default vertex color is white
- clrColorDefault.r = clrColorDefault.g = clrColorDefault.b = clrColorDefault.a = 1.0f;
-
- // allocate one mesh
- pScene->mNumMeshes = 1;
- pScene->mMeshes = new aiMesh*[1];
- aiMesh* pMesh = pScene->mMeshes[0] = new aiMesh();
- pMesh->mMaterialIndex = 0;
-
- // allocate a single node
- pScene->mRootNode = new aiNode();
- pScene->mRootNode->mNumMeshes = 1;
- pScene->mRootNode->mMeshes = new unsigned int[1];
- pScene->mRootNode->mMeshes[0] = 0;
-
- bool bMatClr = false;
-
- // check whether the file starts with 'solid' -
- // in this case we can simply assume it IS a text file. finished.
- if (!::strncmp(mBuffer,"solid",5)) {
- LoadASCIIFile();
- }
- else bMatClr = LoadBinaryFile();
-
- // now copy faces
- pMesh->mFaces = new aiFace[pMesh->mNumFaces];
- for (unsigned int i = 0, p = 0; i < pMesh->mNumFaces;++i) {
-
- aiFace& face = pMesh->mFaces[i];
- face.mIndices = new unsigned int[face.mNumIndices = 3];
- for (unsigned int o = 0; o < 3;++o,++p) {
- face.mIndices[o] = p;
- }
- }
-
- // create a single default material - everything white, as we have vertex colors
- MaterialHelper* pcMat = new MaterialHelper();
- aiString s;
- s.Set(AI_DEFAULT_MATERIAL_NAME);
- pcMat->AddProperty(&s, AI_MATKEY_NAME);
-
- aiColor4D clrDiffuse(1.0f,1.0f,1.0f,1.0f);
- if (bMatClr) {
- clrDiffuse = clrColorDefault;
- }
- pcMat->AddProperty(&clrDiffuse,1,AI_MATKEY_COLOR_DIFFUSE);
- pcMat->AddProperty(&clrDiffuse,1,AI_MATKEY_COLOR_SPECULAR);
- clrDiffuse = aiColor4D(0.05f,0.05f,0.05f,1.0f);
- pcMat->AddProperty(&clrDiffuse,1,AI_MATKEY_COLOR_AMBIENT);
-
- pScene->mNumMaterials = 1;
- pScene->mMaterials = new aiMaterial*[1];
- pScene->mMaterials[0] = pcMat;
-}
-// ------------------------------------------------------------------------------------------------
-// Read an ASCII STL file
-void STLImporter::LoadASCIIFile()
-{
- aiMesh* pMesh = pScene->mMeshes[0];
-
- const char* sz = mBuffer + 5; // skip the "solid"
- SkipSpaces(&sz);
- const char* szMe = sz;
- while (!::IsSpaceOrNewLine(*sz)) {
- sz++;
- }
-
- size_t temp;
- // setup the name of the node
- if ((temp = (size_t)(sz-szMe))) {
-
- pScene->mRootNode->mName.length = temp;
- memcpy(pScene->mRootNode->mName.data,szMe,temp);
- pScene->mRootNode->mName.data[temp] = '\0';
- }
- else pScene->mRootNode->mName.Set("<STL_ASCII>");
-
- // try to guess how many vertices we could have
- // assume we'll need 160 bytes for each face
- pMesh->mNumVertices = ( pMesh->mNumFaces = fileSize / 160 ) * 3;
- pMesh->mVertices = new aiVector3D[pMesh->mNumVertices];
- pMesh->mNormals = new aiVector3D[pMesh->mNumVertices];
-
- unsigned int curFace = 0, curVertex = 3;
- while (true)
- {
- // go to the next token
- if (!SkipSpacesAndLineEnd(&sz))
- {
- // seems we're finished although there was no end marker
- DefaultLogger::get()->warn("STL: unexpected EOF. \'endsolid\' keyword was expected");
- break;
- }
- // facet normal -0.13 -0.13 -0.98
- if (!strncmp(sz,"facet",5) && IsSpaceOrNewLine(*(sz+5))) {
-
- if (3 != curVertex) {
- DefaultLogger::get()->warn("STL: A new facet begins but the old is not yet complete");
- }
- if (pMesh->mNumFaces == curFace) {
- // need to resize the arrays, our size estimate was wrong
- unsigned int iNeededSize = (unsigned int)(sz-mBuffer) / pMesh->mNumFaces;
- if (iNeededSize <= 160)iNeededSize >>= 1; // prevent endless looping
- unsigned int add = (unsigned int)((mBuffer+fileSize)-sz) / iNeededSize;
- add += add >> 3; // add 12.5% as buffer
- iNeededSize = (pMesh->mNumFaces + add)*3;
- aiVector3D* pv = new aiVector3D[iNeededSize];
- memcpy(pv,pMesh->mVertices,pMesh->mNumVertices*sizeof(aiVector3D));
- delete[] pMesh->mVertices;
- pMesh->mVertices = pv;
- pv = new aiVector3D[iNeededSize];
- memcpy(pv,pMesh->mNormals,pMesh->mNumVertices*sizeof(aiVector3D));
- delete[] pMesh->mNormals;
- pMesh->mNormals = pv;
-
- pMesh->mNumVertices = iNeededSize;
- pMesh->mNumFaces += add;
- }
- aiVector3D* vn = &pMesh->mNormals[curFace++*3];
-
- sz += 6;
- curVertex = 0;
- SkipSpaces(&sz);
- if (strncmp(sz,"normal",6)) {
- DefaultLogger::get()->warn("STL: a facet normal vector was expected but not found");
- }
- else
- {
- sz += 7;
- SkipSpaces(&sz);
- sz = fast_atof_move(sz, (float&)vn->x );
- SkipSpaces(&sz);
- sz = fast_atof_move(sz, (float&)vn->y );
- SkipSpaces(&sz);
- sz = fast_atof_move(sz, (float&)vn->z );
- *(vn+1) = *vn;
- *(vn+2) = *vn;
- }
- }
- // vertex 1.50000 1.50000 0.00000
- else if (!strncmp(sz,"vertex",6) && ::IsSpaceOrNewLine(*(sz+6)))
- {
- if (3 == curVertex) {
- DefaultLogger::get()->error("STL: a facet with more than 3 vertices has been found");
- }
- else
- {
- sz += 7;
- SkipSpaces(&sz);
- aiVector3D* vn = &pMesh->mVertices[(curFace-1)*3 + curVertex++];
- sz = fast_atof_move(sz, (float&)vn->x );
- SkipSpaces(&sz);
- sz = fast_atof_move(sz, (float&)vn->y );
- SkipSpaces(&sz);
- sz = fast_atof_move(sz, (float&)vn->z );
- }
- }
- else if (!::strncmp(sz,"endsolid",8)) {
- // finished!
- break;
- }
- // else skip the whole identifier
- else while (!::IsSpaceOrNewLine(*sz)) {
- ++sz;
- }
- }
-
- if (!curFace) {
- pMesh->mNumFaces = 0;
- throw DeadlyImportError("STL: ASCII file is empty or invalid; no data loaded");
- }
- pMesh->mNumFaces = curFace;
- pMesh->mNumVertices = curFace*3;
- // we are finished!
-}
-
-// ------------------------------------------------------------------------------------------------
-// Read a binary STL file
-bool STLImporter::LoadBinaryFile()
-{
- // skip the first 80 bytes
- if (fileSize < 84) {
- throw DeadlyImportError("STL: file is too small for the header");
- }
- bool bIsMaterialise = false;
-
- // search for an occurence of "COLOR=" in the header
- const char* sz2 = (const char*)mBuffer;
- const char* const szEnd = sz2+80;
- while (sz2 < szEnd) {
-
- if ('C' == *sz2++ && 'O' == *sz2++ && 'L' == *sz2++ &&
- 'O' == *sz2++ && 'R' == *sz2++ && '=' == *sz2++) {
-
- // read the default vertex color for facets
- bIsMaterialise = true;
- DefaultLogger::get()->info("STL: Taking code path for Materialise files");
- clrColorDefault.r = (*sz2++) / 255.0f;
- clrColorDefault.g = (*sz2++) / 255.0f;
- clrColorDefault.b = (*sz2++) / 255.0f;
- clrColorDefault.a = (*sz2++) / 255.0f;
- break;
- }
- }
- const unsigned char* sz = (const unsigned char*)mBuffer + 80;
-
- // now read the number of facets
- aiMesh* pMesh = pScene->mMeshes[0];
- pScene->mRootNode->mName.Set("<STL_BINARY>");
-
- pMesh->mNumFaces = *((uint32_t*)sz);
- sz += 4;
-
- if (fileSize < 84 + pMesh->mNumFaces*50) {
- throw DeadlyImportError("STL: file is too small to hold all facets");
- }
-
- if (!pMesh->mNumFaces) {
- throw DeadlyImportError("STL: file is empty. There are no facets defined");
- }
-
- pMesh->mNumVertices = pMesh->mNumFaces*3;
-
- aiVector3D* vp,*vn;
- vp = pMesh->mVertices = new aiVector3D[pMesh->mNumVertices];
- vn = pMesh->mNormals = new aiVector3D[pMesh->mNumVertices];
-
- for (unsigned int i = 0; i < pMesh->mNumFaces;++i) {
-
- // NOTE: Blender sometimes writes empty normals ... this is not
- // our fault ... the RemoveInvalidData helper step should fix that
- *vn = *((aiVector3D*)sz);
- sz += sizeof(aiVector3D);
- *(vn+1) = *vn;
- *(vn+2) = *vn;
- vn += 3;
-
- *vp++ = *((aiVector3D*)sz);
- sz += sizeof(aiVector3D);
-
- *vp++ = *((aiVector3D*)sz);
- sz += sizeof(aiVector3D);
-
- *vp++ = *((aiVector3D*)sz);
- sz += sizeof(aiVector3D);
-
- uint16_t color = *((uint16_t*)sz);
- sz += 2;
-
- if (color & (1 << 15))
- {
- // seems we need to take the color
- if (!pMesh->mColors[0])
- {
- pMesh->mColors[0] = new aiColor4D[pMesh->mNumVertices];
- for (unsigned int i = 0; i <pMesh->mNumVertices;++i)
- *pMesh->mColors[0]++ = this->clrColorDefault;
- pMesh->mColors[0] -= pMesh->mNumVertices;
-
- DefaultLogger::get()->info("STL: Mesh has vertex colors");
- }
- aiColor4D* clr = &pMesh->mColors[0][pMesh->mNumFaces*3];
- clr->a = 1.0f;
- if (bIsMaterialise) // fuck, this is reversed
- {
- clr->r = (color & 0x31u) / 31.0f;
- clr->g = ((color & (0x31u<<5))>>5u) / 31.0f;
- clr->b = ((color & (0x31u<<10))>>10u) / 31.0f;
- }
- else
- {
- clr->b = (color & 0x31u) / 31.0f;
- clr->g = ((color & (0x31u<<5))>>5u) / 31.0f;
- clr->r = ((color & (0x31u<<10))>>10u) / 31.0f;
- }
- // assign the color to all vertices of the face
- *(clr+1) = *clr;
- *(clr+2) = *clr;
- }
- }
- if (bIsMaterialise && !pMesh->mColors[0])
- {
- // use the color as diffuse material color
- return true;
- }
- return false;
-}
-
-#endif // !! ASSIMP_BUILD_NO_STL_IMPORTER
diff --git a/3rdparty/assimp/code/STLLoader.h b/3rdparty/assimp/code/STLLoader.h
deleted file mode 100644
index edd0b2a9..00000000
--- a/3rdparty/assimp/code/STLLoader.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file STLLoader.h
- * Declaration of the STL importer class.
- */
-#ifndef AI_STLLOADER_H_INCLUDED
-#define AI_STLLOADER_H_INCLUDED
-
-#include "BaseImporter.h"
-#include "../include/aiTypes.h"
-
-namespace Assimp {
-
-// ---------------------------------------------------------------------------
-/** Importer class for the sterolithography STL file format
-*/
-class STLImporter : public BaseImporter
-{
- friend class Importer;
-
-protected:
- /** Constructor to be privately used by Importer */
- STLImporter();
-
- /** Destructor, private as well */
- ~STLImporter();
-
-public:
-
- // -------------------------------------------------------------------
- /** Returns whether the class can handle the format of the given file.
- * See BaseImporter::CanRead() for details.
- */
- bool CanRead( const std::string& pFile, IOSystem* pIOHandler,
- bool checkSig) const;
-
-protected:
-
- // -------------------------------------------------------------------
- /** Called by Importer::GetExtensionList() for each loaded importer.
- * See BaseImporter::GetExtensionList() for details
- */
- void GetExtensionList(std::set<std::string>& extensions);
-
- // -------------------------------------------------------------------
- /** Imports the given file into the given scene structure.
- * See BaseImporter::InternReadFile() for details
- */
- void InternReadFile( const std::string& pFile, aiScene* pScene,
- IOSystem* pIOHandler);
-
-
- // -------------------------------------------------------------------
- /** Loads a binary .stl file
- * @return true if the default vertex color must be used as material color
- */
- bool LoadBinaryFile();
-
- // -------------------------------------------------------------------
- /** Loads a ASCII text .stl file
- */
- void LoadASCIIFile();
-
-protected:
-
- /** Buffer to hold the loaded file */
- const char* mBuffer;
-
- /** Size of the file, in bytes */
- unsigned int fileSize;
-
- /** Output scene */
- aiScene* pScene;
-
- /** Default vertex color */
- aiColor4D clrColorDefault;
-};
-
-} // end of namespace Assimp
-
-#endif // AI_3DSIMPORTER_H_IN
diff --git a/3rdparty/assimp/code/SceneCombiner.cpp b/3rdparty/assimp/code/SceneCombiner.cpp
deleted file mode 100644
index 72ffc111..00000000
--- a/3rdparty/assimp/code/SceneCombiner.cpp
+++ /dev/null
@@ -1,1133 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-
-// ----------------------------------------------------------------------------
-/** @file Implements Assimp::SceneCombiner. This is a smart utility
- * class that combines multiple scenes, meshes, ... into one. Currently
- * these utilities are used by the IRR and LWS loaders and the
- * OptimizeGraph step.
- */
-// ----------------------------------------------------------------------------
-#include "AssimpPCH.h"
-#include "SceneCombiner.h"
-#include "fast_atof.h"
-#include "Hash.h"
-#include "time.h"
-
-namespace Assimp {
-
-// ------------------------------------------------------------------------------------------------
-// Add a prefix to a string
-inline void PrefixString(aiString& string,const char* prefix, unsigned int len)
-{
- // If the string is already prefixed, we won't prefix it a second time
- if (string.length >= 1 && string.data[0] == '$')
- return;
-
- if (len+string.length>=MAXLEN-1) {
- DefaultLogger::get()->debug("Can't add an unique prefix because the string is too long");
- ai_assert(false);
- return;
- }
-
- // Add the prefix
- ::memmove(string.data+len,string.data,string.length+1);
- ::memcpy (string.data, prefix, len);
-
- // And update the string's length
- string.length += len;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Add node identifiers to a hashing set
-void SceneCombiner::AddNodeHashes(aiNode* node, std::set<unsigned int>& hashes)
-{
- // Add node name to hashing set if it is non-empty - empty nodes are allowed
- // and they can't have any anims assigned so its absolutely safe to duplicate them.
- if (node->mName.length) {
- hashes.insert( SuperFastHash(node->mName.data,node->mName.length) );
- }
-
- // Process all children recursively
- for (unsigned int i = 0; i < node->mNumChildren;++i)
- AddNodeHashes(node->mChildren[i],hashes);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Add a name prefix to all nodes in a hierarchy
-void SceneCombiner::AddNodePrefixes(aiNode* node, const char* prefix, unsigned int len)
-{
- ai_assert(NULL != prefix);
- PrefixString(node->mName,prefix,len);
-
- // Process all children recursively
- for (unsigned int i = 0; i < node->mNumChildren;++i)
- AddNodePrefixes(node->mChildren[i],prefix,len);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Search for matching names
-bool SceneCombiner::FindNameMatch(const aiString& name, std::vector<SceneHelper>& input, unsigned int cur)
-{
- const unsigned int hash = SuperFastHash(name.data, name.length);
-
- // Check whether we find a positive match in one of the given sets
- for (unsigned int i = 0; i < input.size(); ++i) {
-
- if (cur != i && input[i].hashes.find(hash) != input[i].hashes.end()) {
- return true;
- }
- }
- return false;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Add a name prefix to all nodes in a hierarchy if a hash match is found
-void SceneCombiner::AddNodePrefixesChecked(aiNode* node, const char* prefix, unsigned int len,
- std::vector<SceneHelper>& input, unsigned int cur)
-{
- ai_assert(NULL != prefix);
- const unsigned int hash = SuperFastHash(node->mName.data,node->mName.length);
-
- // Check whether we find a positive match in one of the given sets
- for (unsigned int i = 0; i < input.size(); ++i) {
-
- if (cur != i && input[i].hashes.find(hash) != input[i].hashes.end()) {
- PrefixString(node->mName,prefix,len);
- break;
- }
- }
-
- // Process all children recursively
- for (unsigned int i = 0; i < node->mNumChildren;++i)
- AddNodePrefixesChecked(node->mChildren[i],prefix,len,input,cur);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Add an offset to all mesh indices in a node graph
-void SceneCombiner::OffsetNodeMeshIndices (aiNode* node, unsigned int offset)
-{
- for (unsigned int i = 0; i < node->mNumMeshes;++i)
- node->mMeshes[i] += offset;
-
- for (unsigned int i = 0; i < node->mNumChildren;++i)
- OffsetNodeMeshIndices(node->mChildren[i],offset);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Merges two scenes. Currently only used by the LWS loader.
-void SceneCombiner::MergeScenes(aiScene** _dest,std::vector<aiScene*>& src,
- unsigned int flags)
-{
- ai_assert(NULL != _dest);
-
- // if _dest points to NULL allocate a new scene. Otherwise clear the old and reuse it
- if (src.empty())
- {
- if (*_dest)
- {
- (*_dest)->~aiScene();
- SceneCombiner::CopySceneFlat(_dest,src[0]);
- }
- else *_dest = src[0];
- return;
- }
- if (*_dest)(*_dest)->~aiScene();
- else *_dest = new aiScene();
-
- // Create a dummy scene to serve as master for the others
- aiScene* master = new aiScene();
- master->mRootNode = new aiNode();
- master->mRootNode->mName.Set("<MergeRoot>");
-
- std::vector<AttachmentInfo> srcList (src.size());
- for (unsigned int i = 0; i < srcList.size();++i) {
- srcList[i] = AttachmentInfo(src[i],master->mRootNode);
- }
-
- // 'master' will be deleted afterwards
- MergeScenes (_dest, master, srcList, flags);
-}
-
-// ------------------------------------------------------------------------------------------------
-void SceneCombiner::AttachToGraph (aiNode* attach, std::vector<NodeAttachmentInfo>& srcList)
-{
- unsigned int cnt;
- for (cnt = 0; cnt < attach->mNumChildren;++cnt)
- AttachToGraph(attach->mChildren[cnt],srcList);
-
- cnt = 0;
- for (std::vector<NodeAttachmentInfo>::iterator it = srcList.begin();
- it != srcList.end(); ++it)
- {
- if ((*it).attachToNode == attach && !(*it).resolved)
- ++cnt;
- }
-
- if (cnt) {
- aiNode** n = new aiNode*[cnt+attach->mNumChildren];
- if (attach->mNumChildren) {
- ::memcpy(n,attach->mChildren,sizeof(void*)*attach->mNumChildren);
- delete[] attach->mChildren;
- }
- attach->mChildren = n;
-
- n += attach->mNumChildren;
- attach->mNumChildren += cnt;
-
- for (unsigned int i = 0; i < srcList.size();++i) {
- NodeAttachmentInfo& att = srcList[i];
- if (att.attachToNode == attach && !att.resolved) {
- *n = att.node;
- (**n).mParent = attach;
- ++n;
-
- // mark this attachment as resolved
- att.resolved = true;
- }
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void SceneCombiner::AttachToGraph ( aiScene* master,
- std::vector<NodeAttachmentInfo>& src)
-{
- ai_assert(NULL != master);
- AttachToGraph(master->mRootNode,src);
-}
-
-// ------------------------------------------------------------------------------------------------
-void SceneCombiner::MergeScenes(aiScene** _dest, aiScene* master,
- std::vector<AttachmentInfo>& srcList,
- unsigned int flags)
-{
- ai_assert(NULL != _dest);
-
- // if _dest points to NULL allocate a new scene. Otherwise clear the old and reuse it
- if (srcList.empty())
- {
- if (*_dest)
- {
- (*_dest)->~aiScene();
- SceneCombiner::CopySceneFlat(_dest,master);
- }
- else *_dest = master;
- return;
- }
- if (*_dest)(*_dest)->~aiScene();
- else *_dest = new aiScene();
-
- aiScene* dest = *_dest;
-
- std::vector<SceneHelper> src (srcList.size()+1);
- src[0].scene = master;
- for (unsigned int i = 0; i < srcList.size();++i) {
- src[i+1] = SceneHelper( srcList[i].scene );
- }
-
- // this helper array specifies which scenes are duplicates of others
- std::vector<unsigned int> duplicates(src.size(),0xffffffff);
-
- // this helper array is used as lookup table several times
- std::vector<unsigned int> offset(src.size());
-
- // Find duplicate scenes
- for (unsigned int i = 0; i < src.size();++i)
- {
- if (duplicates[i] != i && duplicates[i] != 0xffffffff)continue;
- duplicates[i] = i;
- for ( unsigned int a = i+1; a < src.size(); ++a)
- {
- if (src[i].scene == src[a].scene)
- duplicates[a] = i;
- }
- }
-
- // Generate unique names for all named stuff?
- if (flags & AI_INT_MERGE_SCENE_GEN_UNIQUE_NAMES)
- {
-#if 0
- // Construct a proper random number generator
- boost::mt19937 rng( );
- boost::uniform_int<> dist(1u,1 << 24u);
- boost::variate_generator<boost::mt19937&, boost::uniform_int<> > rndGen(rng, dist);
-#endif
- for (unsigned int i = 1; i < src.size();++i)
- {
- //if (i != duplicates[i])
- //{
- // // duplicate scenes share the same UID
- // ::strcpy( src[i].id, src[duplicates[i]].id );
- // src[i].idlen = src[duplicates[i]].idlen;
-
- // continue;
- //}
-
- src[i].idlen = ::sprintf(src[i].id,"$%.6X$_",i);
-
- if (flags & AI_INT_MERGE_SCENE_GEN_UNIQUE_NAMES_IF_NECESSARY) {
-
- // Compute hashes for all identifiers in this scene and store them
- // in a sorted table (for convenience I'm using std::set). We hash
- // just the node and animation channel names, all identifiers except
- // the material names should be caught by doing this.
- AddNodeHashes(src[i]->mRootNode,src[i].hashes);
-
- for (unsigned int a = 0; a < src[i]->mNumAnimations;++a) {
- aiAnimation* anim = src[i]->mAnimations[a];
- src[i].hashes.insert(SuperFastHash(anim->mName.data,anim->mName.length));
- }
- }
- }
- }
-
- unsigned int cnt;
-
- // First find out how large the respective output arrays must be
- for ( unsigned int n = 0; n < src.size();++n )
- {
- SceneHelper* cur = &src[n];
-
- if (n == duplicates[n] || flags & AI_INT_MERGE_SCENE_DUPLICATES_DEEP_CPY) {
- dest->mNumTextures += (*cur)->mNumTextures;
- dest->mNumMaterials += (*cur)->mNumMaterials;
- dest->mNumMeshes += (*cur)->mNumMeshes;
- }
-
- dest->mNumLights += (*cur)->mNumLights;
- dest->mNumCameras += (*cur)->mNumCameras;
- dest->mNumAnimations += (*cur)->mNumAnimations;
-
- // Combine the flags of all scenes
- // We need to process them flag-by-flag here to get correct results
- // dest->mFlags ; //|= (*cur)->mFlags;
- if ((*cur)->mFlags & AI_SCENE_FLAGS_NON_VERBOSE_FORMAT) {
- dest->mFlags |= AI_SCENE_FLAGS_NON_VERBOSE_FORMAT;
- }
- }
-
- // generate the output texture list + an offset table for all texture indices
- if (dest->mNumTextures)
- {
- aiTexture** pip = dest->mTextures = new aiTexture*[dest->mNumMaterials];
- cnt = 0;
- for ( unsigned int n = 0; n < src.size();++n )
- {
- SceneHelper* cur = &src[n];
- for (unsigned int i = 0; i < (*cur)->mNumTextures;++i)
- {
- if (n != duplicates[n])
- {
- if ( flags & AI_INT_MERGE_SCENE_DUPLICATES_DEEP_CPY)
- Copy(pip,(*cur)->mTextures[i]);
-
- else continue;
- }
- else *pip = (*cur)->mTextures[i];
- ++pip;
- }
-
- offset[n] = cnt;
- cnt = (unsigned int)(pip - dest->mTextures);
- }
- }
-
- // generate the output material list + an offset table for all material indices
- if (dest->mNumMaterials)
- {
- aiMaterial** pip = dest->mMaterials = new aiMaterial*[dest->mNumMaterials];
- cnt = 0;
- for ( unsigned int n = 0; n < src.size();++n ) {
- SceneHelper* cur = &src[n];
- for (unsigned int i = 0; i < (*cur)->mNumMaterials;++i)
- {
- if (n != duplicates[n])
- {
- if ( flags & AI_INT_MERGE_SCENE_DUPLICATES_DEEP_CPY)
- Copy(pip,(*cur)->mMaterials[i]);
-
- else continue;
- }
- else *pip = (*cur)->mMaterials[i];
-
- if ((*cur)->mNumTextures != dest->mNumTextures) {
- // We need to update all texture indices of the mesh. So we need to search for
- // a material property called '$tex.file'
-
- for (unsigned int a = 0; a < (*pip)->mNumProperties;++a)
- {
- aiMaterialProperty* prop = (*pip)->mProperties[a];
- if (!strncmp(prop->mKey.data,"$tex.file",9))
- {
- // Check whether this texture is an embedded texture.
- // In this case the property looks like this: *<n>,
- // where n is the index of the texture.
- aiString& s = *((aiString*)prop->mData);
- if ('*' == s.data[0]) {
- // Offset the index and write it back ..
- const unsigned int idx = strtol10(&s.data[1]) + offset[n];
- ASSIMP_itoa10(&s.data[1],sizeof(s.data)-1,idx);
- }
- }
-
- // Need to generate new, unique material names?
- else if (!::strcmp( prop->mKey.data,"$mat.name" ) && flags & AI_INT_MERGE_SCENE_GEN_UNIQUE_MATNAMES)
- {
- aiString* pcSrc = (aiString*) prop->mData;
- PrefixString(*pcSrc, (*cur).id, (*cur).idlen);
- }
- }
- }
- ++pip;
- }
-
- offset[n] = cnt;
- cnt = (unsigned int)(pip - dest->mMaterials);
- }
- }
-
- // generate the output mesh list + again an offset table for all mesh indices
- if (dest->mNumMeshes)
- {
- aiMesh** pip = dest->mMeshes = new aiMesh*[dest->mNumMeshes];
- cnt = 0;
- for ( unsigned int n = 0; n < src.size();++n )
- {
- SceneHelper* cur = &src[n];
- for (unsigned int i = 0; i < (*cur)->mNumMeshes;++i)
- {
- if (n != duplicates[n]) {
- if ( flags & AI_INT_MERGE_SCENE_DUPLICATES_DEEP_CPY)
- Copy(pip, (*cur)->mMeshes[i]);
-
- else continue;
- }
- else *pip = (*cur)->mMeshes[i];
-
- // update the material index of the mesh
- (*pip)->mMaterialIndex += offset[n];
- ++pip;
- }
-
- // reuse the offset array - store now the mesh offset in it
- offset[n] = cnt;
- cnt = (unsigned int)(pip - dest->mMeshes);
- }
- }
-
- std::vector <NodeAttachmentInfo> nodes;
- nodes.reserve(srcList.size());
-
- // ----------------------------------------------------------------------------
- // Now generate the output node graph. We need to make those
- // names in the graph that are referenced by anims or lights
- // or cameras unique. So we add a prefix to them ... $<rand>_
- // We could also use a counter, but using a random value allows us to
- // use just one prefix if we are joining multiple scene hierarchies recursively.
- // Chances are quite good we don't collide, so we try that ...
- // ----------------------------------------------------------------------------
-
- // Allocate space for light sources, cameras and animations
- aiLight** ppLights = dest->mLights = (dest->mNumLights
- ? new aiLight*[dest->mNumLights] : NULL);
-
- aiCamera** ppCameras = dest->mCameras = (dest->mNumCameras
- ? new aiCamera*[dest->mNumCameras] : NULL);
-
- aiAnimation** ppAnims = dest->mAnimations = (dest->mNumAnimations
- ? new aiAnimation*[dest->mNumAnimations] : NULL);
-
- for ( int n = src.size()-1; n >= 0 ;--n ) /* !!! important !!! */
- {
- SceneHelper* cur = &src[n];
- aiNode* node;
-
- // To offset or not to offset, this is the question
- if (n != (int)duplicates[n])
- {
- // Get full scenegraph copy
- Copy( &node, (*cur)->mRootNode );
- OffsetNodeMeshIndices(node,offset[duplicates[n]]);
-
- if (flags & AI_INT_MERGE_SCENE_DUPLICATES_DEEP_CPY) {
- // (note:) they are already 'offseted' by offset[duplicates[n]]
- OffsetNodeMeshIndices(node,offset[n] - offset[duplicates[n]]);
- }
- }
- else // if (n == duplicates[n])
- {
- node = (*cur)->mRootNode;
- OffsetNodeMeshIndices(node,offset[n]);
- }
- if (n) // src[0] is the master node
- nodes.push_back(NodeAttachmentInfo( node,srcList[n-1].attachToNode,n ));
-
- // add name prefixes?
- if (flags & AI_INT_MERGE_SCENE_GEN_UNIQUE_NAMES) {
-
- // or the whole scenegraph
- if (flags & AI_INT_MERGE_SCENE_GEN_UNIQUE_NAMES_IF_NECESSARY) {
- AddNodePrefixesChecked(node,(*cur).id,(*cur).idlen,src,n);
- }
- else AddNodePrefixes(node,(*cur).id,(*cur).idlen);
-
- // meshes
- for (unsigned int i = 0; i < (*cur)->mNumMeshes;++i) {
- aiMesh* mesh = (*cur)->mMeshes[i];
-
- // rename all bones
- for (unsigned int a = 0; a < mesh->mNumBones;++a) {
- if (flags & AI_INT_MERGE_SCENE_GEN_UNIQUE_NAMES_IF_NECESSARY) {
- if (!FindNameMatch(mesh->mBones[a]->mName,src,n))
- continue;
- }
- PrefixString(mesh->mBones[a]->mName,(*cur).id,(*cur).idlen);
- }
- }
- }
-
- // --------------------------------------------------------------------
- // Copy light sources
- for (unsigned int i = 0; i < (*cur)->mNumLights;++i,++ppLights)
- {
- if (n != (int)duplicates[n]) // duplicate scene?
- {
- Copy(ppLights, (*cur)->mLights[i]);
- }
- else *ppLights = (*cur)->mLights[i];
-
-
- // Add name prefixes?
- if (flags & AI_INT_MERGE_SCENE_GEN_UNIQUE_NAMES) {
- if (flags & AI_INT_MERGE_SCENE_GEN_UNIQUE_NAMES_IF_NECESSARY) {
- if (!FindNameMatch((*ppLights)->mName,src,n))
- continue;
- }
-
- PrefixString((*ppLights)->mName,(*cur).id,(*cur).idlen);
- }
- }
-
- // --------------------------------------------------------------------
- // Copy cameras
- for (unsigned int i = 0; i < (*cur)->mNumCameras;++i,++ppCameras) {
- if (n != (int)duplicates[n]) // duplicate scene?
- {
- Copy(ppCameras, (*cur)->mCameras[i]);
- }
- else *ppCameras = (*cur)->mCameras[i];
-
- // Add name prefixes?
- if (flags & AI_INT_MERGE_SCENE_GEN_UNIQUE_NAMES) {
- if (flags & AI_INT_MERGE_SCENE_GEN_UNIQUE_NAMES_IF_NECESSARY) {
- if (!FindNameMatch((*ppCameras)->mName,src,n))
- continue;
- }
-
- PrefixString((*ppCameras)->mName,(*cur).id,(*cur).idlen);
- }
- }
-
- // --------------------------------------------------------------------
- // Copy animations
- for (unsigned int i = 0; i < (*cur)->mNumAnimations;++i,++ppAnims) {
- if (n != (int)duplicates[n]) // duplicate scene?
- {
- Copy(ppAnims, (*cur)->mAnimations[i]);
- }
- else *ppAnims = (*cur)->mAnimations[i];
-
- // Add name prefixes?
- if (flags & AI_INT_MERGE_SCENE_GEN_UNIQUE_NAMES) {
- if (flags & AI_INT_MERGE_SCENE_GEN_UNIQUE_NAMES_IF_NECESSARY) {
- if (!FindNameMatch((*ppAnims)->mName,src,n))
- continue;
- }
-
- PrefixString((*ppAnims)->mName,(*cur).id,(*cur).idlen);
-
- // don't forget to update all node animation channels
- for (unsigned int a = 0; a < (*ppAnims)->mNumChannels;++a) {
- if (flags & AI_INT_MERGE_SCENE_GEN_UNIQUE_NAMES_IF_NECESSARY) {
- if (!FindNameMatch((*ppAnims)->mChannels[a]->mNodeName,src,n))
- continue;
- }
-
- PrefixString((*ppAnims)->mChannels[a]->mNodeName,(*cur).id,(*cur).idlen);
- }
- }
- }
- }
-
- // Now build the output graph
- AttachToGraph ( master, nodes);
- dest->mRootNode = master->mRootNode;
-
- // Check whether we succeeded at building the output graph
- for (std::vector <NodeAttachmentInfo> ::iterator it = nodes.begin();
- it != nodes.end(); ++it)
- {
- if (!(*it).resolved) {
- if (flags & AI_INT_MERGE_SCENE_RESOLVE_CROSS_ATTACHMENTS) {
- // search for this attachment point in all other imported scenes, too.
- for ( unsigned int n = 0; n < src.size();++n ) {
- if (n != (*it).src_idx) {
- AttachToGraph(src[n].scene,nodes);
- if ((*it).resolved)
- break;
- }
- }
- }
- if (!(*it).resolved) {
- DefaultLogger::get()->error(std::string("SceneCombiner: Failed to resolve attachment ")
- + (*it).node->mName.data + " " + (*it).attachToNode->mName.data);
- }
- }
- }
-
- // now delete all input scenes. Make sure duplicate scenes aren't
- // deleted more than one time
- for ( unsigned int n = 0; n < src.size();++n ) {
- if (n != duplicates[n]) // duplicate scene?
- continue;
-
- aiScene* deleteMe = src[n].scene;
-
- // We need to delete the arrays before the destructor is called -
- // we are reusing the array members
- delete[] deleteMe->mMeshes; deleteMe->mMeshes = NULL;
- delete[] deleteMe->mCameras; deleteMe->mCameras = NULL;
- delete[] deleteMe->mLights; deleteMe->mLights = NULL;
- delete[] deleteMe->mMaterials; deleteMe->mMaterials = NULL;
- delete[] deleteMe->mAnimations; deleteMe->mAnimations = NULL;
-
- deleteMe->mRootNode = NULL;
-
- // Now we can safely delete the scene
- delete deleteMe;
- }
-
- // Check flags
- if (!dest->mNumMeshes || !dest->mNumMaterials) {
- dest->mFlags |= AI_SCENE_FLAGS_INCOMPLETE;
- }
-
- // We're finished
-}
-
-// ------------------------------------------------------------------------------------------------
-// Build a list of unique bones
-void SceneCombiner::BuildUniqueBoneList(std::list<BoneWithHash>& asBones,
- std::vector<aiMesh*>::const_iterator it,
- std::vector<aiMesh*>::const_iterator end)
-{
- unsigned int iOffset = 0;
- for (; it != end;++it) {
- for (unsigned int l = 0; l < (*it)->mNumBones;++l) {
- aiBone* p = (*it)->mBones[l];
- uint32_t itml = SuperFastHash(p->mName.data,(unsigned int)p->mName.length);
-
- std::list<BoneWithHash>::iterator it2 = asBones.begin();
- std::list<BoneWithHash>::iterator end2 = asBones.end();
-
- for (;it2 != end2;++it2) {
- if ((*it2).first == itml) {
- (*it2).pSrcBones.push_back(BoneSrcIndex(p,iOffset));
- break;
- }
- }
- if (end2 == it2) {
- // need to begin a new bone entry
- asBones.push_back(BoneWithHash());
- BoneWithHash& btz = asBones.back();
-
- // setup members
- btz.first = itml;
- btz.second = &p->mName;
- btz.pSrcBones.push_back(BoneSrcIndex(p,iOffset));
- }
- }
- iOffset += (*it)->mNumVertices;
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Merge a list of bones
-void SceneCombiner::MergeBones(aiMesh* out,std::vector<aiMesh*>::const_iterator it,
- std::vector<aiMesh*>::const_iterator end)
-{
- ai_assert(NULL != out && !out->mNumBones);
-
- // find we need to build an unique list of all bones.
- // we work with hashes to make the comparisons MUCH faster,
- // at least if we have many bones.
- std::list<BoneWithHash> asBones;
- BuildUniqueBoneList(asBones, it,end);
-
- // now create the output bones
- out->mNumBones = 0;
- out->mBones = new aiBone*[asBones.size()];
-
- for (std::list<BoneWithHash>::const_iterator it = asBones.begin(),end = asBones.end(); it != end;++it) {
- // Allocate a bone and setup it's name
- aiBone* pc = out->mBones[out->mNumBones++] = new aiBone();
- pc->mName = aiString( *((*it).second ));
-
- std::vector< BoneSrcIndex >::const_iterator wend = (*it).pSrcBones.end();
-
- // Loop through all bones to be joined for this bone
- for (std::vector< BoneSrcIndex >::const_iterator wmit = (*it).pSrcBones.begin(); wmit != wend; ++wmit) {
- pc->mNumWeights += (*wmit).first->mNumWeights;
-
- // NOTE: different offset matrices for bones with equal names
- // are - at the moment - not handled correctly.
- if (wmit != (*it).pSrcBones.begin() && pc->mOffsetMatrix != (*wmit).first->mOffsetMatrix) {
- DefaultLogger::get()->warn("Bones with equal names but different offset matrices can't be joined at the moment");
- continue;
- }
- pc->mOffsetMatrix = (*wmit).first->mOffsetMatrix;
- }
-
- // Allocate the vertex weight array
- aiVertexWeight* avw = pc->mWeights = new aiVertexWeight[pc->mNumWeights];
-
- // And copy the final weights - adjust the vertex IDs by the
- // face index offset of the coresponding mesh.
- for (std::vector< BoneSrcIndex >::const_iterator wmit = (*it).pSrcBones.begin(); wmit != wend; ++wmit) {
- aiBone* pip = (*wmit).first;
- for (unsigned int mp = 0; mp < pip->mNumWeights;++mp,++avw) {
- const aiVertexWeight& vfi = pip->mWeights[mp];
- avw->mWeight = vfi.mWeight;
- avw->mVertexId = vfi.mVertexId + (*wmit).second;
- }
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Merge a list of meshes
-void SceneCombiner::MergeMeshes(aiMesh** _out,unsigned int flags,
- std::vector<aiMesh*>::const_iterator begin,
- std::vector<aiMesh*>::const_iterator end)
-{
- ai_assert(NULL != _out);
-
- if (begin == end) {
- *_out = NULL; // no meshes ...
- return;
- }
-
- // Allocate the output mesh
- aiMesh* out = *_out = new aiMesh();
- out->mMaterialIndex = (*begin)->mMaterialIndex;
-
- // Find out how much output storage we'll need
- for (std::vector<aiMesh*>::const_iterator it = begin; it != end;++it) {
- out->mNumVertices += (*it)->mNumVertices;
- out->mNumFaces += (*it)->mNumFaces;
- out->mNumBones += (*it)->mNumBones;
-
- // combine primitive type flags
- out->mPrimitiveTypes |= (*it)->mPrimitiveTypes;
- }
-
- if (out->mNumVertices) {
- aiVector3D* pv2;
-
- // copy vertex positions
- if ((**begin).HasPositions()) {
-
- pv2 = out->mVertices = new aiVector3D[out->mNumVertices];
- for (std::vector<aiMesh*>::const_iterator it = begin; it != end;++it) {
- if ((*it)->mVertices) {
- ::memcpy(pv2,(*it)->mVertices,(*it)->mNumVertices*sizeof(aiVector3D));
- }
- else DefaultLogger::get()->warn("JoinMeshes: Positions expected but input mesh contains no positions");
- pv2 += (*it)->mNumVertices;
- }
- }
- // copy normals
- if ((**begin).HasNormals()) {
-
- pv2 = out->mNormals = new aiVector3D[out->mNumVertices];
- for (std::vector<aiMesh*>::const_iterator it = begin; it != end;++it) {
- if ((*it)->mNormals) {
- ::memcpy(pv2,(*it)->mNormals,(*it)->mNumVertices*sizeof(aiVector3D));
- }
- else DefaultLogger::get()->warn("JoinMeshes: Normals expected but input mesh contains no normals");
- pv2 += (*it)->mNumVertices;
- }
- }
- // copy tangents and bitangents
- if ((**begin).HasTangentsAndBitangents()) {
-
- pv2 = out->mTangents = new aiVector3D[out->mNumVertices];
- aiVector3D* pv2b = out->mBitangents = new aiVector3D[out->mNumVertices];
-
- for (std::vector<aiMesh*>::const_iterator it = begin; it != end;++it) {
- if ((*it)->mTangents) {
- ::memcpy(pv2, (*it)->mTangents, (*it)->mNumVertices*sizeof(aiVector3D));
- ::memcpy(pv2b,(*it)->mBitangents,(*it)->mNumVertices*sizeof(aiVector3D));
- }
- else DefaultLogger::get()->warn("JoinMeshes: Tangents expected but input mesh contains no tangents");
- pv2 += (*it)->mNumVertices;
- pv2b += (*it)->mNumVertices;
- }
- }
- // copy texture coordinates
- unsigned int n = 0;
- while ((**begin).HasTextureCoords(n)) {
- out->mNumUVComponents[n] = (*begin)->mNumUVComponents[n];
-
- pv2 = out->mTextureCoords[n] = new aiVector3D[out->mNumVertices];
- for (std::vector<aiMesh*>::const_iterator it = begin; it != end;++it) {
-
- if ((*it)->mTextureCoords[n]) {
- ::memcpy(pv2,(*it)->mTextureCoords[n],(*it)->mNumVertices*sizeof(aiVector3D));
- }
- else DefaultLogger::get()->warn("JoinMeshes: UVs expected but input mesh contains no UVs");
- pv2 += (*it)->mNumVertices;
- }
- ++n;
- }
- // copy vertex colors
- n = 0;
- while ((**begin).HasVertexColors(n)) {
- aiColor4D* pv2 = out->mColors[n] = new aiColor4D[out->mNumVertices];
- for (std::vector<aiMesh*>::const_iterator it = begin; it != end;++it) {
-
- if ((*it)->mColors[n]) {
- ::memcpy(pv2,(*it)->mColors[n],(*it)->mNumVertices*sizeof(aiColor4D));
- }
- else DefaultLogger::get()->warn("JoinMeshes: VCs expected but input mesh contains no VCs");
- pv2 += (*it)->mNumVertices;
- }
- ++n;
- }
- }
-
- if (out->mNumFaces) // just for safety
- {
- // copy faces
- out->mFaces = new aiFace[out->mNumFaces];
- aiFace* pf2 = out->mFaces;
-
- unsigned int ofs = 0;
- for (std::vector<aiMesh*>::const_iterator it = begin; it != end;++it) {
- for (unsigned int m = 0; m < (*it)->mNumFaces;++m,++pf2) {
- aiFace& face = (*it)->mFaces[m];
- pf2->mNumIndices = face.mNumIndices;
- pf2->mIndices = face.mIndices;
-
- if (ofs) {
- // add the offset to the vertex
- for (unsigned int q = 0; q < face.mNumIndices; ++q)
- face.mIndices[q] += ofs;
- }
- face.mIndices = NULL;
- }
- ofs += (*it)->mNumVertices;
- }
- }
-
- // bones - as this is quite lengthy, I moved the code to a separate function
- if (out->mNumBones)
- MergeBones(out,begin,end);
-
- // delete all source meshes
- for (std::vector<aiMesh*>::const_iterator it = begin; it != end;++it)
- delete *it;
-}
-
-// ------------------------------------------------------------------------------------------------
-template <typename Type>
-inline void CopyPtrArray (Type**& dest, Type** src, unsigned int num)
-{
- if (!num)
- {
- dest = NULL;
- return;
- }
- dest = new Type*[num];
- for (unsigned int i = 0; i < num;++i)
- SceneCombiner::Copy(&dest[i],src[i]);
-}
-
-// ------------------------------------------------------------------------------------------------
-template <typename Type>
-inline void GetArrayCopy (Type*& dest, unsigned int num )
-{
- if (!dest)return;
- Type* old = dest;
-
- dest = new Type[num];
- ::memcpy(dest, old, sizeof(Type) * num);
-}
-
-// ------------------------------------------------------------------------------------------------
-void SceneCombiner::CopySceneFlat(aiScene** _dest,aiScene* src)
-{
- // reuse the old scene or allocate a new?
- if (*_dest)(*_dest)->~aiScene();
- else *_dest = new aiScene();
-
- ::memcpy(*_dest,src,sizeof(aiScene));
-}
-
-// ------------------------------------------------------------------------------------------------
-void SceneCombiner::CopyScene(aiScene** _dest,aiScene* src)
-{
- ai_assert(NULL != _dest && NULL != src);
-
- aiScene* dest = *_dest = new aiScene();
-
- // copy animations
- dest->mNumAnimations = src->mNumAnimations;
- CopyPtrArray(dest->mAnimations,src->mAnimations,
- dest->mNumAnimations);
-
- // copy textures
- dest->mNumTextures = src->mNumTextures;
- CopyPtrArray(dest->mTextures,src->mTextures,
- dest->mNumTextures);
-
- // copy materials
- dest->mNumMaterials = src->mNumMaterials;
- CopyPtrArray(dest->mMaterials,src->mMaterials,
- dest->mNumMaterials);
-
- // copy lights
- dest->mNumLights = src->mNumLights;
- CopyPtrArray(dest->mLights,src->mLights,
- dest->mNumLights);
-
- // copy cameras
- dest->mNumCameras = src->mNumCameras;
- CopyPtrArray(dest->mCameras,src->mCameras,
- dest->mNumCameras);
-
- // copy meshes
- dest->mNumMeshes = src->mNumMeshes;
- CopyPtrArray(dest->mMeshes,src->mMeshes,
- dest->mNumMeshes);
-
- // now - copy the root node of the scene (deep copy, too)
- Copy( &dest->mRootNode, src->mRootNode);
-
- // and keep the flags ...
- dest->mFlags = src->mFlags;
-}
-
-// ------------------------------------------------------------------------------------------------
-void SceneCombiner::Copy (aiMesh** _dest, const aiMesh* src)
-{
- ai_assert(NULL != _dest && NULL != src);
-
- aiMesh* dest = *_dest = new aiMesh();
-
- // get a flat copy
- ::memcpy(dest,src,sizeof(aiMesh));
-
- // and reallocate all arrays
- GetArrayCopy( dest->mVertices, dest->mNumVertices );
- GetArrayCopy( dest->mNormals , dest->mNumVertices );
- GetArrayCopy( dest->mTangents, dest->mNumVertices );
- GetArrayCopy( dest->mBitangents, dest->mNumVertices );
-
- unsigned int n = 0;
- while (dest->HasTextureCoords(n))
- GetArrayCopy( dest->mTextureCoords[n++], dest->mNumVertices );
-
- n = 0;
- while (dest->HasVertexColors(n))
- GetArrayCopy( dest->mColors[n++], dest->mNumVertices );
-
- // make a deep copy of all bones
- CopyPtrArray(dest->mBones,dest->mBones,dest->mNumBones);
-
- // make a deep copy of all faces
- GetArrayCopy(dest->mFaces,dest->mNumFaces);
- for (unsigned int i = 0; i < dest->mNumFaces;++i)
- {
- aiFace& f = dest->mFaces[i];
- GetArrayCopy(f.mIndices,f.mNumIndices);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void SceneCombiner::Copy (aiMaterial** _dest, const aiMaterial* src)
-{
- ai_assert(NULL != _dest && NULL != src);
-
- MaterialHelper* dest = (MaterialHelper*) ( *_dest = new MaterialHelper() );
- dest->mNumAllocated = src->mNumAllocated;
- dest->mNumProperties = src->mNumProperties;
- dest->mProperties = new aiMaterialProperty* [dest->mNumAllocated];
-
- for (unsigned int i = 0; i < dest->mNumProperties;++i)
- {
- aiMaterialProperty* prop = dest->mProperties[i] = new aiMaterialProperty();
- aiMaterialProperty* sprop = src->mProperties[i];
-
- prop->mDataLength = sprop->mDataLength;
- prop->mData = new char[prop->mDataLength];
- ::memcpy(prop->mData,sprop->mData,prop->mDataLength);
-
- prop->mIndex = sprop->mIndex;
- prop->mSemantic = sprop->mSemantic;
- prop->mKey = sprop->mKey;
- prop->mType = sprop->mType;
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void SceneCombiner::Copy (aiTexture** _dest, const aiTexture* src)
-{
- ai_assert(NULL != _dest && NULL != src);
-
- aiTexture* dest = *_dest = new aiTexture();
-
- // get a flat copy
- ::memcpy(dest,src,sizeof(aiTexture));
-
- // and reallocate all arrays. We must do it manually here
- const char* old = (const char*)dest->pcData;
- if (old)
- {
- unsigned int cpy;
- if (!dest->mHeight)cpy = dest->mWidth;
- else cpy = dest->mHeight * dest->mWidth * sizeof(aiTexel);
-
- if (!cpy)
- {
- dest->pcData = NULL;
- return;
- }
- // the cast is legal, the aiTexel c'tor does nothing important
- dest->pcData = (aiTexel*) new char[cpy];
- ::memcpy(dest->pcData, old, cpy);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void SceneCombiner::Copy (aiAnimation** _dest, const aiAnimation* src)
-{
- ai_assert(NULL != _dest && NULL != src);
-
- aiAnimation* dest = *_dest = new aiAnimation();
-
- // get a flat copy
- ::memcpy(dest,src,sizeof(aiAnimation));
-
- // and reallocate all arrays
- CopyPtrArray( dest->mChannels, src->mChannels, dest->mNumChannels );
-}
-
-// ------------------------------------------------------------------------------------------------
-void SceneCombiner::Copy (aiNodeAnim** _dest, const aiNodeAnim* src)
-{
- ai_assert(NULL != _dest && NULL != src);
-
- aiNodeAnim* dest = *_dest = new aiNodeAnim();
-
- // get a flat copy
- ::memcpy(dest,src,sizeof(aiNodeAnim));
-
- // and reallocate all arrays
- GetArrayCopy( dest->mPositionKeys, dest->mNumPositionKeys );
- GetArrayCopy( dest->mScalingKeys, dest->mNumScalingKeys );
- GetArrayCopy( dest->mRotationKeys, dest->mNumRotationKeys );
-}
-
-// ------------------------------------------------------------------------------------------------
-void SceneCombiner::Copy (aiCamera** _dest,const aiCamera* src)
-{
- ai_assert(NULL != _dest && NULL != src);
-
- aiCamera* dest = *_dest = new aiCamera();
-
- // get a flat copy, that's already OK
- ::memcpy(dest,src,sizeof(aiCamera));
-}
-
-// ------------------------------------------------------------------------------------------------
-void SceneCombiner::Copy (aiLight** _dest, const aiLight* src)
-{
- ai_assert(NULL != _dest && NULL != src);
-
- aiLight* dest = *_dest = new aiLight();
-
- // get a flat copy, that's already OK
- ::memcpy(dest,src,sizeof(aiLight));
-}
-
-// ------------------------------------------------------------------------------------------------
-void SceneCombiner::Copy (aiBone** _dest, const aiBone* src)
-{
- ai_assert(NULL != _dest && NULL != src);
-
- aiBone* dest = *_dest = new aiBone();
-
- // get a flat copy
- ::memcpy(dest,src,sizeof(aiBone));
-
- // and reallocate all arrays
- GetArrayCopy( dest->mWeights, dest->mNumWeights );
-}
-
-// ------------------------------------------------------------------------------------------------
-void SceneCombiner::Copy (aiNode** _dest, const aiNode* src)
-{
- ai_assert(NULL != _dest && NULL != src);
-
- aiNode* dest = *_dest = new aiNode();
-
- // get a flat copy
- ::memcpy(dest,src,sizeof(aiNode));
-
- // and reallocate all arrays
- GetArrayCopy( dest->mMeshes, dest->mNumMeshes );
- CopyPtrArray( dest->mChildren, src->mChildren,dest->mNumChildren);
-}
-
-
-}
diff --git a/3rdparty/assimp/code/SceneCombiner.h b/3rdparty/assimp/code/SceneCombiner.h
deleted file mode 100644
index a8fd43cb..00000000
--- a/3rdparty/assimp/code/SceneCombiner.h
+++ /dev/null
@@ -1,365 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file Declares a helper class, "SceneCombiner" providing various
- * utilities to merge scenes.
- */
-#ifndef AI_SCENE_COMBINER_H_INC
-#define AI_SCENE_COMBINER_H_INC
-
-#include "../include/aiAssert.h"
-
-namespace Assimp {
-
-// ---------------------------------------------------------------------------
-/** \brief Helper data structure for SceneCombiner.
- *
- * Describes to which node a scene must be attached to.
- */
-struct AttachmentInfo
-{
- AttachmentInfo()
- : scene (NULL)
- , attachToNode (NULL)
- {}
-
- AttachmentInfo(aiScene* _scene, aiNode* _attachToNode)
- : scene (_scene)
- , attachToNode (_attachToNode)
- {}
-
- aiScene* scene;
- aiNode* attachToNode;
-};
-
-// ---------------------------------------------------------------------------
-struct NodeAttachmentInfo
-{
- NodeAttachmentInfo()
- : node (NULL)
- , attachToNode (NULL)
- , resolved (false)
- , src_idx (0xffffffff)
- {}
-
- NodeAttachmentInfo(aiNode* _scene, aiNode* _attachToNode,size_t idx)
- : node (_scene)
- , attachToNode (_attachToNode)
- , resolved (false)
- , src_idx (idx)
- {}
-
- aiNode* node;
- aiNode* attachToNode;
- bool resolved;
- size_t src_idx;
-};
-
-// ---------------------------------------------------------------------------
-/** @def AI_INT_MERGE_SCENE_GEN_UNIQUE_NAMES
- * Generate unique names for all named scene items
- */
-#define AI_INT_MERGE_SCENE_GEN_UNIQUE_NAMES 0x1
-
-/** @def AI_INT_MERGE_SCENE_GEN_UNIQUE_MATNAMES
- * Generate unique names for materials, too.
- * This is not absolutely required to pass the validation.
- */
-#define AI_INT_MERGE_SCENE_GEN_UNIQUE_MATNAMES 0x2
-
-/** @def AI_INT_MERGE_SCENE_DUPLICATES_DEEP_CPY
- * Use deep copies of duplicate scenes
- */
-#define AI_INT_MERGE_SCENE_DUPLICATES_DEEP_CPY 0x4
-
-/** @def AI_INT_MERGE_SCENE_RESOLVE_CROSS_ATTACHMENTS
- * If attachment nodes are not found in the given master scene,
- * search the other imported scenes for them in an any order.
- */
-#define AI_INT_MERGE_SCENE_RESOLVE_CROSS_ATTACHMENTS 0x8
-
-/** @def AI_INT_MERGE_SCENE_GEN_UNIQUE_NAMES_IF_NECESSARY
- * Can be combined with AI_INT_MERGE_SCENE_GEN_UNIQUE_NAMES.
- * Unique names are generated, but only if this is absolutely
- * required to avoid name conflicts.
- */
-#define AI_INT_MERGE_SCENE_GEN_UNIQUE_NAMES_IF_NECESSARY 0x10
-
-
-typedef std::pair<aiBone*,unsigned int> BoneSrcIndex;
-
-// ---------------------------------------------------------------------------
-/** @brief Helper data structure for SceneCombiner::MergeBones.
- */
-struct BoneWithHash : public std::pair<uint32_t,aiString*> {
- std::vector<BoneSrcIndex> pSrcBones;
-};
-
-
-// ---------------------------------------------------------------------------
-/** @brief Utility for SceneCombiner
- */
-struct SceneHelper
-{
- SceneHelper ()
- : scene (NULL)
- , idlen (0)
- {
- id[0] = 0;
- }
-
- SceneHelper (aiScene* _scene)
- : scene (_scene)
- , idlen (0)
- {
- id[0] = 0;
- }
-
- AI_FORCE_INLINE aiScene* operator-> () const
- {
- return scene;
- }
-
- // scene we're working on
- aiScene* scene;
-
- // prefix to be added to all identifiers in the scene ...
- char id [32];
-
- // and its strlen()
- unsigned int idlen;
-
- // hash table to quickly check whether a name is contained in the scene
- std::set<unsigned int> hashes;
-};
-
-// ---------------------------------------------------------------------------
-/** \brief Static helper class providing various utilities to merge two
- * scenes. It is intended as internal utility and NOT for use by
- * applications.
- *
- * The class is currently being used by various postprocessing steps
- * and loaders (ie. LWS).
- */
-class ASSIMP_API SceneCombiner
-{
- // class cannot be instanced
- SceneCombiner() {}
-
-public:
-
- // -------------------------------------------------------------------
- /** Merges two or more scenes.
- *
- * @param dest Receives a pointer to the destination scene. If the
- * pointer doesn't point to NULL when the function is called, the
- * existing scene is cleared and refilled.
- * @param src Non-empty list of scenes to be merged. The function
- * deletes the input scenes afterwards. There may be duplicate scenes.
- * @param flags Combination of the AI_INT_MERGE_SCENE flags defined above
- */
- static void MergeScenes(aiScene** dest,std::vector<aiScene*>& src,
- unsigned int flags = 0);
-
-
- // -------------------------------------------------------------------
- /** Merges two or more scenes and attaches all sceenes to a specific
- * position in the node graph of the masteer scene.
- *
- * @param dest Receives a pointer to the destination scene. If the
- * pointer doesn't point to NULL when the function is called, the
- * existing scene is cleared and refilled.
- * @param master Master scene. It will be deleted afterwards. All
- * other scenes will be inserted in its node graph.
- * @param src Non-empty list of scenes to be merged along with their
- * corresponding attachment points in the master scene. The function
- * deletes the input scenes afterwards. There may be duplicate scenes.
- * @param flags Combination of the AI_INT_MERGE_SCENE flags defined above
- */
- static void MergeScenes(aiScene** dest, aiScene* master,
- std::vector<AttachmentInfo>& src,
- unsigned int flags = 0);
-
-
- // -------------------------------------------------------------------
- /** Merges two or more meshes
- *
- * The meshes should have equal vertex formats. Only components
- * that are provided by ALL meshes will be present in the output mesh.
- * An exception is made for VColors - they are set to black. The
- * meshes should have the same material indices, too. The output
- * material index is always the material index of the first mesh.
- *
- * @param dest Destination mesh. Must be empty.
- * @param flags Currently no parameters
- * @param begin First mesh to be processed
- * @param end Points to the mesh after the last mesh to be processed
- */
- static void MergeMeshes(aiMesh** dest,unsigned int flags,
- std::vector<aiMesh*>::const_iterator begin,
- std::vector<aiMesh*>::const_iterator end);
-
-
- // -------------------------------------------------------------------
- /** Merges two or more bones
- *
- * @param out Mesh to receive the output bone list
- * @param flags Currently no parameters
- * @param begin First mesh to be processed
- * @param end Points to the mesh after the last mesh to be processed
- */
- static void MergeBones(aiMesh* out,std::vector<aiMesh*>::const_iterator it,
- std::vector<aiMesh*>::const_iterator end);
-
-
- // -------------------------------------------------------------------
- /** Builds a list of uniquely named bones in a mesh list
- *
- * @param asBones Receives the output list
- * @param it First mesh to be processed
- * @param end Last mesh to be processed
- */
- static void BuildUniqueBoneList(std::list<BoneWithHash>& asBones,
- std::vector<aiMesh*>::const_iterator it,
- std::vector<aiMesh*>::const_iterator end);
-
- // -------------------------------------------------------------------
- /** Add a name prefix to all nodes in a scene.
- *
- * @param Current node. This function is called recursively.
- * @param prefix Prefix to be added to all nodes
- * @param len STring length
- */
- static void AddNodePrefixes(aiNode* node, const char* prefix,
- unsigned int len);
-
- // -------------------------------------------------------------------
- /** Add an offset to all mesh indices in a node graph
- *
- * @param Current node. This function is called recursively.
- * @param offset Offset to be added to all mesh indices
- */
- static void OffsetNodeMeshIndices (aiNode* node, unsigned int offset);
-
- // -------------------------------------------------------------------
- /** Attach a list of node graphs to well-defined nodes in a master
- * graph. This is a helper for MergeScenes()
- *
- * @param master Master scene
- * @param srcList List of source scenes along with their attachment
- * points. If an attachment point is NULL (or does not exist in
- * the master graph), a scene is attached to the root of the master
- * graph (as an additional child node)
- * @duplicates List of duplicates. If elem[n] == n the scene is not
- * a duplicate. Otherwise elem[n] links scene n to its first occurence.
- */
- static void AttachToGraph ( aiScene* master,
- std::vector<NodeAttachmentInfo>& srcList);
-
- static void AttachToGraph (aiNode* attach,
- std::vector<NodeAttachmentInfo>& srcList);
-
-
- // -------------------------------------------------------------------
- /** Get a deep copy of a scene
- *
- * @param dest Receives a pointer to the destination scene
- * @param src Source scene - remains unmodified.
- */
- static void CopyScene(aiScene** dest,aiScene* source);
-
-
- // -------------------------------------------------------------------
- /** Get a flat copy of a scene
- *
- * Only the first hierarchy layer is copied. All pointer members of
- * aiScene are shared by source and destination scene. If the
- * pointer doesn't point to NULL when the function is called, the
- * existing scene is cleared and refilled.
- * @param dest Receives a pointer to the destination scene
- * @param src Source scene - remains unmodified.
- */
- static void CopySceneFlat(aiScene** dest,aiScene* source);
-
-
- // -------------------------------------------------------------------
- /** Get a deep copy of a mesh
- *
- * @param dest Receives a pointer to the destination mesh
- * @param src Source mesh - remains unmodified.
- */
- static void Copy (aiMesh** dest, const aiMesh* src);
-
- // similar to Copy():
- static void Copy (aiMaterial** dest, const aiMaterial* src);
- static void Copy (aiTexture** dest, const aiTexture* src);
- static void Copy (aiAnimation** dest, const aiAnimation* src);
- static void Copy (aiCamera** dest, const aiCamera* src);
- static void Copy (aiBone** dest, const aiBone* src);
- static void Copy (aiLight** dest, const aiLight* src);
- static void Copy (aiNodeAnim** dest, const aiNodeAnim* src);
-
- // recursive, of course
- static void Copy (aiNode** dest, const aiNode* src);
-
-
-private:
-
- // -------------------------------------------------------------------
- // Same as AddNodePrefixes, but with an additional check
- static void AddNodePrefixesChecked(aiNode* node, const char* prefix,
- unsigned int len,
- std::vector<SceneHelper>& input,
- unsigned int cur);
-
- // -------------------------------------------------------------------
- // Add node identifiers to a hashing set
- static void AddNodeHashes(aiNode* node, std::set<unsigned int>& hashes);
-
-
- // -------------------------------------------------------------------
- // Search for duplicate names
- static bool FindNameMatch(const aiString& name,
- std::vector<SceneHelper>& input, unsigned int cur);
-};
-
-}
-
-#endif // !! AI_SCENE_COMBINER_H_INC
diff --git a/3rdparty/assimp/code/ScenePreprocessor.cpp b/3rdparty/assimp/code/ScenePreprocessor.cpp
deleted file mode 100644
index e7a83c51..00000000
--- a/3rdparty/assimp/code/ScenePreprocessor.cpp
+++ /dev/null
@@ -1,281 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-#include "AssimpPCH.h"
-#include "ScenePreprocessor.h"
-
-using namespace Assimp;
-
-// ---------------------------------------------------------------------------------------------
-void ScenePreprocessor::ProcessScene ()
-{
- ai_assert(scene != NULL);
-
- // Process all meshes
- for (unsigned int i = 0; i < scene->mNumMeshes;++i)
- ProcessMesh(scene->mMeshes[i]);
-
- // - nothing to do for nodes for the moment
- // - nothing to do for textures for the moment
- // - nothing to do for lights for the moment
- // - nothing to do for cameras for the moment
-
- // Process all animations
- for (unsigned int i = 0; i < scene->mNumAnimations;++i)
- ProcessAnimation(scene->mAnimations[i]);
-
- // Generate a default material if none was specified
- if (!scene->mNumMaterials && scene->mNumMeshes) {
- scene->mMaterials = new aiMaterial*[2];
- MaterialHelper* helper;
-
- aiString name;
-
- // Check whether there are meshes with at least one set of uv coordinates ... add a dummy texture for them
- // meshes without texture coordinates receive a boring gray default material.
- unsigned int mat0 = 0xffffffff, mat1 = 0xffffffff;
- for (unsigned int i = 0; i < scene->mNumMeshes;++i) {
- if (scene->mMeshes[i]->mTextureCoords[0]) {
-
- if (mat0 == 0xffffffff) {
-
- scene->mMaterials[scene->mNumMaterials] = helper = new MaterialHelper();
- name.Set("$texture.png");
- helper->AddProperty(&name,AI_MATKEY_TEXTURE_DIFFUSE(0));
-
- name.Set(AI_DEFAULT_TEXTURED_MATERIAL_NAME);
- helper->AddProperty(&name,AI_MATKEY_NAME);
-
- mat0 = scene->mNumMaterials++;
- DefaultLogger::get()->debug("ScenePreprocessor: Adding textured material \'" AI_DEFAULT_TEXTURED_MATERIAL_NAME "\'");
- }
- scene->mMeshes[i]->mMaterialIndex = mat0;
- }
- else
- {
- if (mat1 == 0xffffffff) {
-
- scene->mMaterials[scene->mNumMaterials] = helper = new MaterialHelper();
- aiColor3D clr(0.6f,0.6f,0.6f);
- helper->AddProperty(&clr,1,AI_MATKEY_COLOR_DIFFUSE);
-
- // setup the default name
- name.Set(AI_DEFAULT_MATERIAL_NAME);
- helper->AddProperty(&name,AI_MATKEY_NAME);
-
- mat1 = scene->mNumMaterials++;
- DefaultLogger::get()->debug("ScenePreprocessor: Adding grey material \'" AI_DEFAULT_MATERIAL_NAME "\'");
- }
- scene->mMeshes[i]->mMaterialIndex = mat1;
- }
- }
- }
-}
-
-// ---------------------------------------------------------------------------------------------
-void ScenePreprocessor::ProcessMesh (aiMesh* mesh)
-{
- // If aiMesh::mNumUVComponents is *not* set assign the default value of 2
- for (unsigned int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++i) {
- if (!mesh->mTextureCoords[i])
- mesh->mNumUVComponents[i] = 0;
-
- else {
- if ( !mesh->mNumUVComponents[i])
- mesh->mNumUVComponents[i] = 2;
-
- aiVector3D* p = mesh->mTextureCoords[i], *end = p+mesh->mNumVertices;
-
- // Ensure unsued components are zeroed. This will make 1D texture channels work
- // as if they were 2D channels .. just in case an application doesn't handle
- // this case
- if (2 == mesh->mNumUVComponents[i]) {
- for (; p != end; ++p)
- p->z = 0.f;
- }
- else if (1 == mesh->mNumUVComponents[i]) {
- for (; p != end; ++p)
- p->z = p->y = 0.f;
- }
- else if (3 == mesh->mNumUVComponents[i]) {
-
- // Really 3D coordinates? Check whether the third coordinate is != 0 for at least one element
- for (; p != end; ++p) {
- if (p->z != 0)
- break;
- }
- if (p == end) {
- DefaultLogger::get()->warn("ScenePreprocessor: UVs are declared to be 3D but they're obviously not. Reverting to 2D.");
- mesh->mNumUVComponents[i] = 2;
- }
- }
- }
- }
-
- // If the information which primitive types are there in the
- // mesh is currently not available, compute it.
- if (!mesh->mPrimitiveTypes) {
- for (unsigned int a = 0; a < mesh->mNumFaces; ++a) {
- aiFace& face = mesh->mFaces[a];
- switch (face.mNumIndices)
- {
- case 3u:
- mesh->mPrimitiveTypes |= aiPrimitiveType_TRIANGLE;
- break;
-
- case 2u:
- mesh->mPrimitiveTypes |= aiPrimitiveType_LINE;
- break;
-
- case 1u:
- mesh->mPrimitiveTypes |= aiPrimitiveType_POINT;
- break;
-
- default:
- mesh->mPrimitiveTypes |= aiPrimitiveType_POLYGON;
- break;
- }
- }
- }
-
- // If tangents and normals are given but no bitangents compute them
- if (mesh->mTangents && mesh->mNormals && !mesh->mBitangents) {
-
- mesh->mBitangents = new aiVector3D[mesh->mNumVertices];
- for (unsigned int i = 0; i < mesh->mNumVertices;++i) {
- mesh->mBitangents[i] = mesh->mNormals[i] ^ mesh->mTangents[i];
- }
- }
-}
-
-// ---------------------------------------------------------------------------------------------
-void ScenePreprocessor::ProcessAnimation (aiAnimation* anim)
-{
- double first = 10e10, last = -10e10;
- for (unsigned int i = 0; i < anim->mNumChannels;++i) {
- aiNodeAnim* channel = anim->mChannels[i];
-
- /* If the exact duration of the animation is not given
- * compute it now.
- */
- if (anim->mDuration == -1.) {
-
- // Position keys
- for (unsigned int i = 0; i < channel->mNumPositionKeys;++i) {
- aiVectorKey& key = channel->mPositionKeys[i];
- first = std::min (first, key.mTime);
- last = std::max (last, key.mTime);
- }
-
- // Scaling keys
- for (unsigned int i = 0; i < channel->mNumScalingKeys;++i) {
- aiVectorKey& key = channel->mScalingKeys[i];
- first = std::min (first, key.mTime);
- last = std::max (last, key.mTime);
- }
-
- // Rotation keys
- for (unsigned int i = 0; i < channel->mNumRotationKeys;++i) {
- aiQuatKey& key = channel->mRotationKeys[i];
- first = std::min (first, key.mTime);
- last = std::max (last, key.mTime);
- }
- }
-
- /* Check whether the animation channel has no rotation
- * or position tracks. In this case we generate a dummy
- * track from the information we have in the transformation
- * matrix of the corresponding node.
- */
- if (!channel->mNumRotationKeys || !channel->mNumPositionKeys || !channel->mNumScalingKeys) {
- // Find the node that belongs to this animation
- aiNode* node = scene->mRootNode->FindNode(channel->mNodeName);
- if (node) // ValidateDS will complain later if 'node' is NULL
- {
- // Decompose the transformation matrix of the node
- aiVector3D scaling, position;
- aiQuaternion rotation;
-
- node->mTransformation.Decompose(scaling, rotation,position);
-
- // No rotation keys? Generate a dummy track
- if (!channel->mNumRotationKeys) {
- channel->mNumRotationKeys = 1;
- channel->mRotationKeys = new aiQuatKey[1];
- aiQuatKey& q = channel->mRotationKeys[0];
-
- q.mTime = 0.;
- q.mValue = rotation;
-
- DefaultLogger::get()->debug("ScenePreprocessor: Dummy rotation track has been generated");
- }
-
- // No scaling keys? Generate a dummy track
- if (!channel->mNumScalingKeys) {
- channel->mNumScalingKeys = 1;
- channel->mScalingKeys = new aiVectorKey[1];
- aiVectorKey& q = channel->mScalingKeys[0];
-
- q.mTime = 0.;
- q.mValue = scaling;
-
- DefaultLogger::get()->debug("ScenePreprocessor: Dummy scaling track has been generated");
- }
-
- // No position keys? Generate a dummy track
- if (!channel->mNumPositionKeys) {
- channel->mNumPositionKeys = 1;
- channel->mPositionKeys = new aiVectorKey[1];
- aiVectorKey& q = channel->mPositionKeys[0];
-
- q.mTime = 0.;
- q.mValue = position;
-
- DefaultLogger::get()->debug("ScenePreprocessor: Dummy position track has been generated");
- }
- }
- }
- }
-
- if (anim->mDuration == -1.) {
- DefaultLogger::get()->debug("ScenePreprocessor: Setting animation duration");
- anim->mDuration = last - std::min( first, 0. );
- }
-}
diff --git a/3rdparty/assimp/code/ScenePreprocessor.h b/3rdparty/assimp/code/ScenePreprocessor.h
deleted file mode 100644
index 86254469..00000000
--- a/3rdparty/assimp/code/ScenePreprocessor.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file Defines a post processing step to search all meshes for
- degenerated faces */
-#ifndef AI_SCENE_PREPROCESSOR_H_INC
-#define AI_SCENE_PREPROCESSOR_H_INC
-
-class ScenePreprocessorTest;
-namespace Assimp {
-
-// ----------------------------------------------------------------------------------
-/** ScenePreprocessor: Preprocess a scene before any post-processing
- * steps are executed.
- *
- * The step computes data that needn't necessarily be provided by the
- * importer, such as aiMesh::mPrimitiveTypes.
-*/
-// ----------------------------------------------------------------------------------
-class ASSIMP_API ScenePreprocessor
-{
- // Make ourselves a friend of the corresponding test unit.
- friend class ::ScenePreprocessorTest;
-public:
-
- // ----------------------------------------------------------------
- /** Default c'tpr. Use SetScene() to assign a scene to the object.
- */
- ScenePreprocessor()
- : scene (NULL)
- {}
-
- /** Constructs the object and assigns a specific scene to it
- */
- ScenePreprocessor(aiScene* _scene)
- : scene (_scene)
- {}
-
- // ----------------------------------------------------------------
- /** Assign a (new) scene to the object.
- *
- * One 'SceneProcessor' can be used for multiple scenes.
- * Call ProcessScene to have the scene preprocessed.
- * @param sc Scene to be processed.
- */
- void SetScene (aiScene* sc) {
- scene = sc;
- }
-
- // ----------------------------------------------------------------
- /** Preprocess the current scene
- */
- void ProcessScene ();
-
-protected:
-
- // ----------------------------------------------------------------
- /** Preprocess an animation in the scene
- * @param anim Anim to be preprocessed.
- */
- void ProcessAnimation (aiAnimation* anim);
-
-
- // ----------------------------------------------------------------
- /** Preprocess a mesh in the scene
- * @param mesh Mesh to be preprocessed.
- */
- void ProcessMesh (aiMesh* mesh);
-
-protected:
-
- //! Scene we're currently working on
- aiScene* scene;
-};
-
-
-} // ! end namespace Assimp
-
-#endif // include guard
diff --git a/3rdparty/assimp/code/SkeletonMeshBuilder.cpp b/3rdparty/assimp/code/SkeletonMeshBuilder.cpp
deleted file mode 100644
index 9e42270b..00000000
--- a/3rdparty/assimp/code/SkeletonMeshBuilder.cpp
+++ /dev/null
@@ -1,267 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
-copyright notice, this list of conditions and the
-following disclaimer.
-
-* Redistributions in binary form must reproduce the above
-copyright notice, this list of conditions and the
-following disclaimer in the documentation and/or other
-materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
-contributors may be used to endorse or promote products
-derived from this software without specific prior
-written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file SkeletonMeshBuilder.cpp
- * @brief Implementation of a little class to construct a dummy mesh for a skeleton
- */
-
-#include "AssimpPCH.h"
-#include "../include/aiScene.h"
-#include "SkeletonMeshBuilder.h"
-
-using namespace Assimp;
-
-// ------------------------------------------------------------------------------------------------
-// The constructor processes the given scene and adds a mesh there.
-SkeletonMeshBuilder::SkeletonMeshBuilder( aiScene* pScene, aiNode* root, bool bKnobsOnly)
-{
- // nothing to do if there's mesh data already present at the scene
- if ( pScene->mNumMeshes > 0 || pScene->mRootNode == NULL)
- return;
-
- if (!root)
- root = pScene->mRootNode;
-
- mKnobsOnly = bKnobsOnly;
-
- // build some faces around each node
- CreateGeometry( root );
-
- // create a mesh to hold all the generated faces
- pScene->mNumMeshes = 1;
- pScene->mMeshes = new aiMesh*[1];
- pScene->mMeshes[0] = CreateMesh();
- // and install it at the root node
- root->mNumMeshes = 1;
- root->mMeshes = new unsigned int[1];
- root->mMeshes[0] = 0;
-
- // create a dummy material for the mesh
- pScene->mNumMaterials = 1;
- pScene->mMaterials = new aiMaterial*[1];
- pScene->mMaterials[0] = CreateMaterial();
-}
-
-// ------------------------------------------------------------------------------------------------
-// Recursively builds a simple mesh representation for the given node
-void SkeletonMeshBuilder::CreateGeometry( const aiNode* pNode)
-{
- // add a joint entry for the node.
- const unsigned int vertexStartIndex = mVertices.size();
-
- // now build the geometry.
- if ( pNode->mNumChildren > 0 && !mKnobsOnly)
- {
- // If the node has children, we build little pointers to each of them
- for ( unsigned int a = 0; a < pNode->mNumChildren; a++)
- {
- // find a suitable coordinate system
- const aiMatrix4x4& childTransform = pNode->mChildren[a]->mTransformation;
- aiVector3D childpos( childTransform.a4, childTransform.b4, childTransform.c4);
- float distanceToChild = childpos.Length();
- if ( distanceToChild < 0.0001f)
- continue;
- aiVector3D up = aiVector3D( childpos).Normalize();
-
- aiVector3D orth( 1.0f, 0.0f, 0.0f);
- if ( fabs( orth * up) > 0.99f)
- orth.Set( 0.0f, 1.0f, 0.0f);
-
- aiVector3D front = (up ^ orth).Normalize();
- aiVector3D side = (front ^ up).Normalize();
-
- unsigned int localVertexStart = mVertices.size();
- mVertices.push_back( -front * distanceToChild * 0.1f);
- mVertices.push_back( childpos);
- mVertices.push_back( -side * distanceToChild * 0.1f);
- mVertices.push_back( -side * distanceToChild * 0.1f);
- mVertices.push_back( childpos);
- mVertices.push_back( front * distanceToChild * 0.1f);
- mVertices.push_back( front * distanceToChild * 0.1f);
- mVertices.push_back( childpos);
- mVertices.push_back( side * distanceToChild * 0.1f);
- mVertices.push_back( side * distanceToChild * 0.1f);
- mVertices.push_back( childpos);
- mVertices.push_back( -front * distanceToChild * 0.1f);
-
- mFaces.push_back( Face( localVertexStart + 0, localVertexStart + 1, localVertexStart + 2));
- mFaces.push_back( Face( localVertexStart + 3, localVertexStart + 4, localVertexStart + 5));
- mFaces.push_back( Face( localVertexStart + 6, localVertexStart + 7, localVertexStart + 8));
- mFaces.push_back( Face( localVertexStart + 9, localVertexStart + 10, localVertexStart + 11));
- }
- }
- else
- {
- // if the node has no children, it's an end node. Put a little knob there instead
- aiVector3D ownpos( pNode->mTransformation.a4, pNode->mTransformation.b4, pNode->mTransformation.c4);
- float sizeEstimate = ownpos.Length() * 0.18f;
-
- mVertices.push_back( aiVector3D( -sizeEstimate, 0.0f, 0.0f));
- mVertices.push_back( aiVector3D( 0.0f, sizeEstimate, 0.0f));
- mVertices.push_back( aiVector3D( 0.0f, 0.0f, -sizeEstimate));
- mVertices.push_back( aiVector3D( 0.0f, sizeEstimate, 0.0f));
- mVertices.push_back( aiVector3D( sizeEstimate, 0.0f, 0.0f));
- mVertices.push_back( aiVector3D( 0.0f, 0.0f, -sizeEstimate));
- mVertices.push_back( aiVector3D( sizeEstimate, 0.0f, 0.0f));
- mVertices.push_back( aiVector3D( 0.0f, -sizeEstimate, 0.0f));
- mVertices.push_back( aiVector3D( 0.0f, 0.0f, -sizeEstimate));
- mVertices.push_back( aiVector3D( 0.0f, -sizeEstimate, 0.0f));
- mVertices.push_back( aiVector3D( -sizeEstimate, 0.0f, 0.0f));
- mVertices.push_back( aiVector3D( 0.0f, 0.0f, -sizeEstimate));
-
- mVertices.push_back( aiVector3D( -sizeEstimate, 0.0f, 0.0f));
- mVertices.push_back( aiVector3D( 0.0f, 0.0f, sizeEstimate));
- mVertices.push_back( aiVector3D( 0.0f, sizeEstimate, 0.0f));
- mVertices.push_back( aiVector3D( 0.0f, sizeEstimate, 0.0f));
- mVertices.push_back( aiVector3D( 0.0f, 0.0f, sizeEstimate));
- mVertices.push_back( aiVector3D( sizeEstimate, 0.0f, 0.0f));
- mVertices.push_back( aiVector3D( sizeEstimate, 0.0f, 0.0f));
- mVertices.push_back( aiVector3D( 0.0f, 0.0f, sizeEstimate));
- mVertices.push_back( aiVector3D( 0.0f, -sizeEstimate, 0.0f));
- mVertices.push_back( aiVector3D( 0.0f, -sizeEstimate, 0.0f));
- mVertices.push_back( aiVector3D( 0.0f, 0.0f, sizeEstimate));
- mVertices.push_back( aiVector3D( -sizeEstimate, 0.0f, 0.0f));
-
- mFaces.push_back( Face( vertexStartIndex + 0, vertexStartIndex + 1, vertexStartIndex + 2));
- mFaces.push_back( Face( vertexStartIndex + 3, vertexStartIndex + 4, vertexStartIndex + 5));
- mFaces.push_back( Face( vertexStartIndex + 6, vertexStartIndex + 7, vertexStartIndex + 8));
- mFaces.push_back( Face( vertexStartIndex + 9, vertexStartIndex + 10, vertexStartIndex + 11));
- mFaces.push_back( Face( vertexStartIndex + 12, vertexStartIndex + 13, vertexStartIndex + 14));
- mFaces.push_back( Face( vertexStartIndex + 15, vertexStartIndex + 16, vertexStartIndex + 17));
- mFaces.push_back( Face( vertexStartIndex + 18, vertexStartIndex + 19, vertexStartIndex + 20));
- mFaces.push_back( Face( vertexStartIndex + 21, vertexStartIndex + 22, vertexStartIndex + 23));
- }
-
- unsigned int numVertices = mVertices.size() - vertexStartIndex;
- if ( numVertices > 0)
- {
- // create a bone affecting all the newly created vertices
- aiBone* bone = new aiBone;
- mBones.push_back( bone);
- bone->mName = pNode->mName;
-
- // calculate the bone offset matrix by concatenating the inverse transformations of all parents
- bone->mOffsetMatrix = aiMatrix4x4( pNode->mTransformation).Inverse();
- for ( aiNode* parent = pNode->mParent; parent != NULL; parent = parent->mParent)
- bone->mOffsetMatrix = aiMatrix4x4( parent->mTransformation).Inverse() * bone->mOffsetMatrix;
-
- // add all the vertices to the bone's influences
- bone->mNumWeights = numVertices;
- bone->mWeights = new aiVertexWeight[numVertices];
- for ( unsigned int a = 0; a < numVertices; a++)
- bone->mWeights[a] = aiVertexWeight( vertexStartIndex + a, 1.0f);
-
- // HACK: (thom) transform all vertices to the bone's local space. Should be done before adding
- // them to the array, but I'm tired now and I'm annoyed.
- aiMatrix4x4 boneToMeshTransform = aiMatrix4x4( bone->mOffsetMatrix).Inverse();
- for ( unsigned int a = vertexStartIndex; a < mVertices.size(); a++)
- mVertices[a] = boneToMeshTransform * mVertices[a];
- }
-
- // and finally recurse into the children list
- for ( unsigned int a = 0; a < pNode->mNumChildren; a++)
- CreateGeometry( pNode->mChildren[a]);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Creates the mesh from the internally accumulated stuff and returns it.
-aiMesh* SkeletonMeshBuilder::CreateMesh()
-{
- aiMesh* mesh = new aiMesh();
-
- // add points
- mesh->mNumVertices = mVertices.size();
- mesh->mVertices = new aiVector3D[mesh->mNumVertices];
- std::copy( mVertices.begin(), mVertices.end(), mesh->mVertices);
-
- mesh->mNormals = new aiVector3D[mesh->mNumVertices];
-
- // add faces
- mesh->mNumFaces = mFaces.size();
- mesh->mFaces = new aiFace[mesh->mNumFaces];
- for ( unsigned int a = 0; a < mesh->mNumFaces; a++)
- {
- const Face& inface = mFaces[a];
- aiFace& outface = mesh->mFaces[a];
- outface.mNumIndices = 3;
- outface.mIndices = new unsigned int[3];
- outface.mIndices[0] = inface.mIndices[0];
- outface.mIndices[1] = inface.mIndices[1];
- outface.mIndices[2] = inface.mIndices[2];
-
- // Compute per-face normals ... we don't want the bones to be smoothed ... they're built to visualize
- // the skeleton, so it's good if there's a visual difference to the rest of the geometry
- aiVector3D nor = ((mVertices[inface.mIndices[2]] - mVertices[inface.mIndices[0]]) ^
- (mVertices[inface.mIndices[1]] - mVertices[inface.mIndices[0]]));
-
- if (nor.Length() < 1e-5f) /* ensure that FindInvalidData won't remove us ...*/
- nor = aiVector3D(1.f,0.f,0.f);
-
- for (unsigned int n = 0; n < 3; ++n)
- mesh->mNormals[inface.mIndices[n]] = nor;
- }
-
- // add the bones
- mesh->mNumBones = mBones.size();
- mesh->mBones = new aiBone*[mesh->mNumBones];
- std::copy( mBones.begin(), mBones.end(), mesh->mBones);
-
- // default
- mesh->mMaterialIndex = 0;
-
- return mesh;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Creates a dummy material and returns it.
-aiMaterial* SkeletonMeshBuilder::CreateMaterial()
-{
- Assimp::MaterialHelper* matHelper = new Assimp::MaterialHelper;
-
- // Name
- aiString matName( std::string( "SkeletonMaterial"));
- matHelper->AddProperty( &matName, AI_MATKEY_NAME);
-
- // Prevent backface culling
- const int no_cull = 1;
- matHelper->AddProperty(&no_cull,1,AI_MATKEY_TWOSIDED);
-
- return matHelper;
-}
diff --git a/3rdparty/assimp/code/SkeletonMeshBuilder.h b/3rdparty/assimp/code/SkeletonMeshBuilder.h
deleted file mode 100644
index 2575d072..00000000
--- a/3rdparty/assimp/code/SkeletonMeshBuilder.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/** Helper class to construct a dummy mesh for file formats containing only motion data */
-
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
-copyright notice, this list of conditions and the
-following disclaimer.
-
-* Redistributions in binary form must reproduce the above
-copyright notice, this list of conditions and the
-following disclaimer in the documentation and/or other
-materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
-contributors may be used to endorse or promote products
-derived from this software without specific prior
-written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file SkeletonMeshBuilder.h
- * Declares SkeletonMeshBuilder, a tiny utility to build dummy meshes
- * for animation skeletons.
- */
-
-#ifndef AI_SKELETONMESHBUILDER_H_INC
-#define AI_SKELETONMESHBUILDER_H_INC
-
-#include <vector>
-#include "../include/aiMesh.h"
-
-struct aiScene;
-struct aiNode;
-
-namespace Assimp {
-
-// ---------------------------------------------------------------------------
-/**
- * This little helper class constructs a dummy mesh for a given scene
- * the resembles the node hierarchy. This is useful for file formats
- * that don't carry any mesh data but only animation data.
- */
-class ASSIMP_API SkeletonMeshBuilder
-{
-public:
-
- // -------------------------------------------------------------------
- /** The constructor processes the given scene and adds a mesh there.
- *
- * Does nothing if the scene already has mesh data.
- * @param pScene The scene for which a skeleton mesh should be constructed.
- * @param root The node to start with. NULL is the scene root
- * @param bKnobsOnly Set this to true if you don't want the connectors
- * between the knobs representing the nodes.
- */
- SkeletonMeshBuilder( aiScene* pScene, aiNode* root = NULL,
- bool bKnobsOnly = false);
-
-protected:
-
- // -------------------------------------------------------------------
- /** Recursively builds a simple mesh representation for the given node
- * and also creates a joint for the node that affects this part of
- * the mesh.
- * @param pNode The node to build geometry for.
- */
- void CreateGeometry( const aiNode* pNode);
-
- // -------------------------------------------------------------------
- /** Creates the mesh from the internally accumulated stuff and returns it.
- */
- aiMesh* CreateMesh();
-
- // -------------------------------------------------------------------
- /** Creates a dummy material and returns it. */
- aiMaterial* CreateMaterial();
-
-protected:
- /** space to assemble the mesh data: points */
- std::vector<aiVector3D> mVertices;
-
- /** faces */
- struct Face
- {
- unsigned int mIndices[3];
- Face();
- Face( unsigned int p0, unsigned int p1, unsigned int p2)
- { mIndices[0] = p0; mIndices[1] = p1; mIndices[2] = p2; }
- };
- std::vector<Face> mFaces;
-
- /** bones */
- std::vector<aiBone*> mBones;
-
- bool mKnobsOnly;
-};
-
-} // end of namespace Assimp
-
-#endif // AI_SKELETONMESHBUILDER_H_INC
diff --git a/3rdparty/assimp/code/SmoothingGroups.h b/3rdparty/assimp/code/SmoothingGroups.h
deleted file mode 100644
index 50535820..00000000
--- a/3rdparty/assimp/code/SmoothingGroups.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file Defines the helper data structures for importing 3DS files.
-http://www.jalix.org/ressources/graphics/3DS/_unofficials/3ds-unofficial.txt */
-
-#ifndef AI_SMOOTHINGGROUPS_H_INC
-#define AI_SMOOTHINGGROUPS_H_INC
-
-// ---------------------------------------------------------------------------
-/** Helper structure representing a face with smoothing groups assigned */
-struct FaceWithSmoothingGroup
-{
- FaceWithSmoothingGroup() : iSmoothGroup(0)
- {
- // let the rest uninitialized for performance - in release builds.
- // in debug builds set all indices to a common magic value
-#ifdef _DEBUG
- this->mIndices[0] = 0xffffffff;
- this->mIndices[1] = 0xffffffff;
- this->mIndices[2] = 0xffffffff;
-#endif
- }
-
-
- //! Indices. .3ds is using uint16. However, after
- //! an unique vrtex set has been generated it might
- //! be an index becomes > 2^16
- uint32_t mIndices[3];
-
- //! specifies to which smoothing group the face belongs to
- uint32_t iSmoothGroup;
-};
-
-// ---------------------------------------------------------------------------
-/** Helper structure representing a mesh whose faces have smoothing
- groups assigned. This allows us to reuse the code for normal computations
- from smoothings groups for several loaders (3DS, ASE). All of them
- use face structures which inherit from #FaceWithSmoothingGroup,
- but as they add extra members and need to be copied by value we
- need to use a template here.
- */
-template <class T>
-struct MeshWithSmoothingGroups
-{
- //! Vertex positions
- std::vector<aiVector3D> mPositions;
-
- //! Face lists
- std::vector<T> mFaces;
-
- //! List of normal vectors
- std::vector<aiVector3D> mNormals;
-};
-
-// ---------------------------------------------------------------------------
-/** Computes normal vectors for the mesh
- */
-template <class T>
-void ComputeNormalsWithSmoothingsGroups(MeshWithSmoothingGroups<T>& sMesh);
-
-
-// include implementations
-#include "SmoothingGroups.inl"
-
-#endif // !! AI_SMOOTHINGGROUPS_H_INC
diff --git a/3rdparty/assimp/code/SmoothingGroups.inl b/3rdparty/assimp/code/SmoothingGroups.inl
deleted file mode 100644
index 10eb7d25..00000000
--- a/3rdparty/assimp/code/SmoothingGroups.inl
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file Generation of normal vectors basing on smoothing groups */
-
-#ifndef AI_SMOOTHINGGROUPS_INL_INCLUDED
-#define AI_SMOOTHINGGROUPS_INL_INCLUDED
-
-// internal headers
-#include "SGSpatialSort.h"
-
-// CRT header
-#include <algorithm>
-
-using namespace Assimp;
-
-// ------------------------------------------------------------------------------------------------
-template <class T>
-void ComputeNormalsWithSmoothingsGroups(MeshWithSmoothingGroups<T>& sMesh)
-{
- // First generate face normals
- sMesh.mNormals.resize(sMesh.mPositions.size(),aiVector3D());
- for ( unsigned int a = 0; a < sMesh.mFaces.size(); a++)
- {
- T& face = sMesh.mFaces[a];
-
- aiVector3D* pV1 = &sMesh.mPositions[face.mIndices[0]];
- aiVector3D* pV2 = &sMesh.mPositions[face.mIndices[1]];
- aiVector3D* pV3 = &sMesh.mPositions[face.mIndices[2]];
-
- aiVector3D pDelta1 = *pV2 - *pV1;
- aiVector3D pDelta2 = *pV3 - *pV1;
- aiVector3D vNor = pDelta1 ^ pDelta2;
-
- for (unsigned int c = 0; c < 3;++c)
- sMesh.mNormals[face.mIndices[c]] = vNor;
- }
-
- // calculate the position bounds so we have a reliable epsilon to check position differences against
- aiVector3D minVec( 1e10f, 1e10f, 1e10f), maxVec( -1e10f, -1e10f, -1e10f);
- for ( unsigned int a = 0; a < sMesh.mPositions.size(); a++)
- {
- minVec.x = std::min( minVec.x, sMesh.mPositions[a].x);
- minVec.y = std::min( minVec.y, sMesh.mPositions[a].y);
- minVec.z = std::min( minVec.z, sMesh.mPositions[a].z);
- maxVec.x = std::max( maxVec.x, sMesh.mPositions[a].x);
- maxVec.y = std::max( maxVec.y, sMesh.mPositions[a].y);
- maxVec.z = std::max( maxVec.z, sMesh.mPositions[a].z);
- }
- const float posEpsilon = (maxVec - minVec).Length() * 1e-5f;
- std::vector<aiVector3D> avNormals;
- avNormals.resize(sMesh.mNormals.size());
-
- // now generate the spatial sort tree
- SGSpatialSort sSort;
- for ( typename std::vector<T>::iterator i = sMesh.mFaces.begin();
- i != sMesh.mFaces.end();++i)
- {
- for (unsigned int c = 0; c < 3;++c)
- sSort.Add(sMesh.mPositions[(*i).mIndices[c]],(*i).mIndices[c],(*i).iSmoothGroup);
- }
- sSort.Prepare();
-
- std::vector<bool> vertexDone(sMesh.mPositions.size(),false);
- for ( typename std::vector<T>::iterator i = sMesh.mFaces.begin();
- i != sMesh.mFaces.end();++i)
- {
- std::vector<unsigned int> poResult;
- for (unsigned int c = 0; c < 3;++c)
- {
- register unsigned int idx = (*i).mIndices[c];
- if (vertexDone[idx])continue;
-
- sSort.FindPositions(sMesh.mPositions[idx],(*i).iSmoothGroup,
- posEpsilon,poResult);
-
- aiVector3D vNormals;
- for (std::vector<unsigned int>::const_iterator
- a = poResult.begin();
- a != poResult.end();++a)
- {
- vNormals += sMesh.mNormals[(*a)];
- }
- vNormals.Normalize();
-
- // write back into all affected normals
- for (std::vector<unsigned int>::const_iterator
- a = poResult.begin();
- a != poResult.end();++a)
- {
- idx = *a;
- avNormals [idx] = vNormals;
- vertexDone[idx] = true;
- }
- }
- }
- sMesh.mNormals = avNormals;
-}
-
-#endif // !! AI_SMOOTHINGGROUPS_INL_INCLUDED
diff --git a/3rdparty/assimp/code/SortByPTypeProcess.cpp b/3rdparty/assimp/code/SortByPTypeProcess.cpp
deleted file mode 100644
index 613245ff..00000000
--- a/3rdparty/assimp/code/SortByPTypeProcess.cpp
+++ /dev/null
@@ -1,405 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file Implementation of the DeterminePTypeHelperProcess and
- * SortByPTypeProcess post-process steps.
-*/
-
-#include "AssimpPCH.h"
-
-// internal headers
-#include "ProcessHelper.h"
-#include "SortByPTypeProcess.h"
-
-using namespace Assimp;
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-SortByPTypeProcess::SortByPTypeProcess()
-{
- configRemoveMeshes = 0;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-SortByPTypeProcess::~SortByPTypeProcess()
-{
- // nothing to do here
-}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the processing step is present in the given flag field.
-bool SortByPTypeProcess::IsActive( unsigned int pFlags) const
-{
- return (pFlags & aiProcess_SortByPType) != 0;
-}
-
-// ------------------------------------------------------------------------------------------------
-void SortByPTypeProcess::SetupProperties(const Importer* pImp)
-{
- configRemoveMeshes = pImp->GetPropertyInteger(AI_CONFIG_PP_SBP_REMOVE,0);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Update changed meshes in all nodes
-void UpdateNodes(const std::vector<unsigned int>& replaceMeshIndex, aiNode* node)
-{
-// std::vector<unsigned int>::const_iterator it;
-
- if (node->mNumMeshes)
- {
- unsigned int newSize = 0;
- for (unsigned int m = 0; m< node->mNumMeshes; ++m)
- {
- unsigned int add = node->mMeshes[m]<<2;
- for (unsigned int i = 0; i < 4;++i)
- {
- if (0xffffffff != replaceMeshIndex[add+i])++newSize;
- }
- }
- if (!newSize)
- {
- delete[] node->mMeshes;
- node->mNumMeshes = 0;
- node->mMeshes = NULL;
- }
- else
- {
- // Try to reuse the old array if possible
- unsigned int* newMeshes = (newSize > node->mNumMeshes
- ? new unsigned int[newSize] : node->mMeshes);
-
- for (unsigned int m = 0; m< node->mNumMeshes; ++m)
- {
- unsigned int add = node->mMeshes[m]<<2;
- for (unsigned int i = 0; i < 4;++i)
- {
- if (0xffffffff != replaceMeshIndex[add+i])
- *newMeshes++ = replaceMeshIndex[add+i];
- }
- }
- if (newSize > node->mNumMeshes)
- delete[] node->mMeshes;
-
- node->mMeshes = newMeshes-(node->mNumMeshes = newSize);
- }
- }
-
- // call all subnodes recursively
- for (unsigned int m = 0; m < node->mNumChildren; ++m)
- UpdateNodes(replaceMeshIndex,node->mChildren[m]);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Executes the post processing step on the given imported data.
-void SortByPTypeProcess::Execute( aiScene* pScene)
-{
- if (!pScene->mNumMeshes)
- {
- DefaultLogger::get()->debug("SortByPTypeProcess skipped, there are no meshes");
- return;
- }
-
- DefaultLogger::get()->debug("SortByPTypeProcess begin");
-
- unsigned int aiNumMeshesPerPType[4] = {0,0,0,0};
-
- std::vector<aiMesh*> outMeshes;
- outMeshes.reserve(pScene->mNumMeshes<<1u);
-
- bool bAnyChanges = false;
-
- std::vector<unsigned int> replaceMeshIndex(pScene->mNumMeshes*4,0xffffffff);
- std::vector<unsigned int>::iterator meshIdx = replaceMeshIndex.begin();
- for (unsigned int i = 0; i < pScene->mNumMeshes;++i)
- {
- aiMesh* mesh = pScene->mMeshes[i];
- ai_assert(0 != mesh->mPrimitiveTypes);
-
- // if there's just one primitive type in the mesh there's nothing to do for us
- unsigned int num = 0;
- if (mesh->mPrimitiveTypes & aiPrimitiveType_POINT)
- {
- ++aiNumMeshesPerPType[0];
- ++num;
- }
- if (mesh->mPrimitiveTypes & aiPrimitiveType_LINE)
- {
- ++aiNumMeshesPerPType[1];
- ++num;
- }
- if (mesh->mPrimitiveTypes & aiPrimitiveType_TRIANGLE)
- {
- ++aiNumMeshesPerPType[2];
- ++num;
- }
- if (mesh->mPrimitiveTypes & aiPrimitiveType_POLYGON)
- {
- ++aiNumMeshesPerPType[3];
- ++num;
- }
-
- if (1 == num)
- {
- if (!(configRemoveMeshes & mesh->mPrimitiveTypes))
- {
- *meshIdx = (unsigned int) outMeshes.size();
- outMeshes.push_back(mesh);
- }
- else bAnyChanges = true;
-
- meshIdx += 4;
- continue;
- }
- bAnyChanges = true;
-
- // reuse our current mesh arrays for the submesh
- // with the largest numer of primitives
- unsigned int aiNumPerPType[4] = {0,0,0,0};
- aiFace* pFirstFace = mesh->mFaces;
- aiFace* const pLastFace = pFirstFace + mesh->mNumFaces;
-
- unsigned int numPolyVerts = 0;
- for (;pFirstFace != pLastFace; ++pFirstFace)
- {
- if (pFirstFace->mNumIndices <= 3)
- ++aiNumPerPType[pFirstFace->mNumIndices-1];
- else
- {
- ++aiNumPerPType[3];
- numPolyVerts += pFirstFace-> mNumIndices;
- }
- }
-
- VertexWeightTable* avw = ComputeVertexBoneWeightTable(mesh);
- for (unsigned int real = 0; real < 4; ++real,++meshIdx)
- {
- if ( !aiNumPerPType[real] || configRemoveMeshes & (1u << real))
- {
- continue;
- }
-
- *meshIdx = (unsigned int) outMeshes.size();
- outMeshes.push_back(new aiMesh());
- aiMesh* out = outMeshes.back();
-
- // the name carries the adjacency information between the meshes
- out->mName = mesh->mName;
-
- // copy data members
- out->mPrimitiveTypes = 1u << real;
- out->mMaterialIndex = mesh->mMaterialIndex;
-
- // allocate output storage
- out->mNumFaces = aiNumPerPType[real];
- aiFace* outFaces = out->mFaces = new aiFace[out->mNumFaces];
-
- out->mNumVertices = (3 == real ? numPolyVerts : out->mNumFaces * (real+1));
-
- aiVector3D *vert(NULL), *nor(NULL), *tan(NULL), *bit(NULL);
- aiVector3D *uv [AI_MAX_NUMBER_OF_TEXTURECOORDS];
- aiColor4D *cols [AI_MAX_NUMBER_OF_COLOR_SETS];
-
- if (mesh->mVertices)
- vert = out->mVertices = new aiVector3D[out->mNumVertices];
-
- if (mesh->mNormals)
- nor = out->mNormals = new aiVector3D[out->mNumVertices];
-
- if (mesh->mTangents)
- {
- tan = out->mTangents = new aiVector3D[out->mNumVertices];
- bit = out->mBitangents = new aiVector3D[out->mNumVertices];
- }
-
- for (unsigned int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS;++i)
- {
- if (mesh->mTextureCoords[i])
- uv[i] = out->mTextureCoords[i] = new aiVector3D[out->mNumVertices];
- else uv[i] = NULL;
-
- out->mNumUVComponents[i] = mesh->mNumUVComponents[i];
- }
-
- for (unsigned int i = 0; i < AI_MAX_NUMBER_OF_COLOR_SETS;++i)
- {
- if (mesh->mColors[i])
- cols[i] = out->mColors[i] = new aiColor4D[out->mNumVertices];
- else cols[i] = NULL;
- }
-
- typedef std::vector< aiVertexWeight > TempBoneInfo;
- std::vector< TempBoneInfo > tempBones(mesh->mNumBones);
-
- // try to guess how much storage we'll need
- for (unsigned int q = 0; q < mesh->mNumBones;++q)
- {
- tempBones[q].reserve(mesh->mBones[q]->mNumWeights / (num-1));
- }
-
- unsigned int outIdx = 0;
- for (unsigned int m = 0; m < mesh->mNumFaces; ++m)
- {
- aiFace& in = mesh->mFaces[m];
- if ((real == 3 && in.mNumIndices <= 3) || (real != 3 && in.mNumIndices != real+1))
- {
- continue;
- }
-
- outFaces->mNumIndices = in.mNumIndices;
- outFaces->mIndices = in.mIndices;
-
- for (unsigned int q = 0; q < in.mNumIndices; ++q)
- {
- register unsigned int idx = in.mIndices[q];
-
- // process all bones of this index
- if (avw)
- {
- VertexWeightTable& tbl = avw[idx];
- for (VertexWeightTable::const_iterator it = tbl.begin(), end = tbl.end();
- it != end; ++it)
- {
- tempBones[ (*it).first ].push_back( aiVertexWeight(outIdx, (*it).second) );
- }
- }
-
- if (vert)
- {
- *vert++ = mesh->mVertices[idx];
- //mesh->mVertices[idx].x = get_qnan();
- }
- if (nor )*nor++ = mesh->mNormals[idx];
- if (tan )
- {
- *tan++ = mesh->mTangents[idx];
- *bit++ = mesh->mBitangents[idx];
- }
-
- for (unsigned int pp = 0; pp < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++pp)
- {
- if (!uv[pp])break;
- *uv[pp]++ = mesh->mTextureCoords[pp][idx];
- }
-
- for (unsigned int pp = 0; pp < AI_MAX_NUMBER_OF_COLOR_SETS; ++pp)
- {
- if (!cols[pp])break;
- *cols[pp]++ = mesh->mColors[pp][idx];
- }
-
- in.mIndices[q] = outIdx++;
- }
-
- in.mIndices = NULL;
- ++outFaces;
- }
- ai_assert(outFaces == out->mFaces + out->mNumFaces);
-
- // now generate output bones
- for (unsigned int q = 0; q < mesh->mNumBones;++q)
- if (!tempBones[q].empty())++out->mNumBones;
-
- if (out->mNumBones)
- {
- out->mBones = new aiBone*[out->mNumBones];
- for (unsigned int q = 0, real = 0; q < mesh->mNumBones;++q)
- {
- TempBoneInfo& in = tempBones[q];
- if (in.empty())continue;
-
- aiBone* srcBone = mesh->mBones[q];
- aiBone* bone = out->mBones[real] = new aiBone();
-
- bone->mName = srcBone->mName;
- bone->mOffsetMatrix = srcBone->mOffsetMatrix;
-
- bone->mNumWeights = (unsigned int)in.size();
- bone->mWeights = new aiVertexWeight[bone->mNumWeights];
-
- ::memcpy(bone->mWeights,&in[0],bone->mNumWeights*sizeof(aiVertexWeight));
-
- ++real;
- }
- }
- }
-
- // delete the per-vertex bone weights table
- delete[] avw;
-
- // delete the input mesh
- delete mesh;
- }
-
- if (outMeshes.empty())
- {
- // This should not occur
- throw DeadlyImportError("No meshes remaining");
- }
-
- // If we added at least one mesh process all nodes in the node
- // graph and update their respective mesh indices.
- if (bAnyChanges)
- {
- UpdateNodes(replaceMeshIndex,pScene->mRootNode);
- }
-
- if (outMeshes.size() != pScene->mNumMeshes)
- {
- delete[] pScene->mMeshes;
- pScene->mNumMeshes = (unsigned int)outMeshes.size();
- pScene->mMeshes = new aiMesh*[pScene->mNumMeshes];
- }
- ::memcpy(pScene->mMeshes,&outMeshes[0],pScene->mNumMeshes*sizeof(void*));
-
- if (!DefaultLogger::isNullLogger())
- {
- char buffer[1024];
- ::sprintf(buffer,"Points: %i%s, Lines: %i%s, Triangles: %i%s, Polygons: %i%s (Meshes, X = removed)",
- aiNumMeshesPerPType[0], (configRemoveMeshes & aiPrimitiveType_POINT ? "X" : ""),
- aiNumMeshesPerPType[1], (configRemoveMeshes & aiPrimitiveType_LINE ? "X" : ""),
- aiNumMeshesPerPType[2], (configRemoveMeshes & aiPrimitiveType_TRIANGLE ? "X" : ""),
- aiNumMeshesPerPType[3], (configRemoveMeshes & aiPrimitiveType_POLYGON ? "X" : ""));
- DefaultLogger::get()->info(buffer);
- DefaultLogger::get()->debug("SortByPTypeProcess finished");
- }
-}
-
diff --git a/3rdparty/assimp/code/SortByPTypeProcess.h b/3rdparty/assimp/code/SortByPTypeProcess.h
deleted file mode 100644
index 539df299..00000000
--- a/3rdparty/assimp/code/SortByPTypeProcess.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file Defines a post processing step to sort meshes by the types
- of primitives they contain */
-#ifndef AI_SORTBYPTYPEPROCESS_H_INC
-#define AI_SORTBYPTYPEPROCESS_H_INC
-
-#include "BaseProcess.h"
-#include "../include/aiMesh.h"
-
-class SortByPTypeProcessTest;
-namespace Assimp {
-
-
-// ---------------------------------------------------------------------------
-/** SortByPTypeProcess: Sorts meshes by the types of primitives they contain.
- * A mesh with 5 lines, 3 points and 145 triangles would be split in 3
- * submeshes.
-*/
-class ASSIMP_API SortByPTypeProcess : public BaseProcess
-{
- friend class Importer;
- friend class ::SortByPTypeProcessTest; // grant the unit test full access to us
-
-protected:
- /** Constructor to be privately used by Importer */
- SortByPTypeProcess();
-
- /** Destructor, private as well */
- ~SortByPTypeProcess();
-
-public:
- // -------------------------------------------------------------------
- bool IsActive( unsigned int pFlags) const;
-
- // -------------------------------------------------------------------
- void Execute( aiScene* pScene);
-
- // -------------------------------------------------------------------
- void SetupProperties(const Importer* pImp);
-
-private:
-
- int configRemoveMeshes;
-};
-
-
-} // end of namespace Assimp
-
-#endif // !!AI_SORTBYPTYPEPROCESS_H_INC
diff --git a/3rdparty/assimp/code/SpatialSort.cpp b/3rdparty/assimp/code/SpatialSort.cpp
deleted file mode 100644
index 343f9091..00000000
--- a/3rdparty/assimp/code/SpatialSort.cpp
+++ /dev/null
@@ -1,347 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file Implementation of the helper class to quickly find vertices close to a given position */
-
-#include "AssimpPCH.h"
-#include "SpatialSort.h"
-
-using namespace Assimp;
-
-// CHAR_BIT seems to be defined under MVSC, but not under GCC. Pray that the correct value is 8.
-#ifndef CHAR_BIT
-# define CHAR_BIT 8
-#endif
-
-// ------------------------------------------------------------------------------------------------
-// Constructs a spatially sorted representation from the given position array.
-SpatialSort::SpatialSort( const aiVector3D* pPositions, unsigned int pNumPositions,
- unsigned int pElementOffset)
-
- // define the reference plane. We choose some arbitrary vector away from all basic axises
- // in the hope that no model spreads all its vertices along this plane.
- : mPlaneNormal(0.8523f, 0.34321f, 0.5736f)
-{
- mPlaneNormal.Normalize();
- Fill(pPositions,pNumPositions,pElementOffset);
-}
-
-// ------------------------------------------------------------------------------------------------
-SpatialSort :: SpatialSort()
-: mPlaneNormal(0.8523f, 0.34321f, 0.5736f)
-{
- mPlaneNormal.Normalize();
-}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor
-SpatialSort::~SpatialSort()
-{
- // nothing to do here, everything destructs automatically
-}
-
-// ------------------------------------------------------------------------------------------------
-void SpatialSort::Fill( const aiVector3D* pPositions, unsigned int pNumPositions,
- unsigned int pElementOffset,
- bool pFinalize /*= true */)
-{
- mPositions.clear();
- Append(pPositions,pNumPositions,pElementOffset,pFinalize);
-}
-
-// ------------------------------------------------------------------------------------------------
-void SpatialSort :: Finalize()
-{
- std::sort( mPositions.begin(), mPositions.end());
-}
-
-// ------------------------------------------------------------------------------------------------
-void SpatialSort::Append( const aiVector3D* pPositions, unsigned int pNumPositions,
- unsigned int pElementOffset,
- bool pFinalize /*= true */)
-{
- // store references to all given positions along with their distance to the reference plane
- const size_t initial = mPositions.size();
- mPositions.reserve(initial + (pFinalize?pNumPositions:pNumPositions*2));
- for( unsigned int a = 0; a < pNumPositions; a++)
- {
- const char* tempPointer = reinterpret_cast<const char*> (pPositions);
- const aiVector3D* vec = reinterpret_cast<const aiVector3D*> (tempPointer + a * pElementOffset);
-
- // store position by index and distance
- float distance = *vec * mPlaneNormal;
-
- // UGLY HACK !!!
- // TODO: fix it
- volatile int KillOptimisation = *((int*)&distance);
-
- mPositions.push_back( Entry( a+initial, *vec, distance));
- }
-
- if (pFinalize) {
- // now sort the array ascending by distance.
- Finalize();
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Returns an iterator for all positions close to the given position.
-void SpatialSort::FindPositions( const aiVector3D& pPosition,
- float pRadius, std::vector<unsigned int>& poResults) const
-{
- const float dist = pPosition * mPlaneNormal;
- const float minDist = dist - pRadius, maxDist = dist + pRadius;
-
- // clear the array in this strange fashion because a simple clear() would also deallocate
- // the array which we want to avoid
- poResults.erase( poResults.begin(), poResults.end());
-
- // quick check for positions outside the range
- if( mPositions.size() == 0)
- return;
- if( maxDist < mPositions.front().mDistance)
- return;
- if( minDist > mPositions.back().mDistance)
- return;
-
- // do a binary search for the minimal distance to start the iteration there
- unsigned int index = (unsigned int)mPositions.size() / 2;
- unsigned int binaryStepSize = (unsigned int)mPositions.size() / 4;
- while( binaryStepSize > 1)
- {
- if( mPositions[index].mDistance < minDist)
- index += binaryStepSize;
- else
- index -= binaryStepSize;
-
- binaryStepSize /= 2;
- }
-
- // depending on the direction of the last step we need to single step a bit back or forth
- // to find the actual beginning element of the range
- while( index > 0 && mPositions[index].mDistance > minDist)
- index--;
- while( index < (mPositions.size() - 1) && mPositions[index].mDistance < minDist)
- index++;
-
- // Mow start iterating from there until the first position lays outside of the distance range.
- // Add all positions inside the distance range within the given radius to the result aray
- std::vector<Entry>::const_iterator it = mPositions.begin() + index;
- const float pSquared = pRadius*pRadius;
- while( it->mDistance < maxDist)
- {
- if( (it->mPosition - pPosition).SquareLength() < pSquared)
- poResults.push_back( it->mIndex);
- ++it;
- if( it == mPositions.end())
- break;
- }
-
- // that's it
-}
-
-namespace {
-
- // Binary, signed-integer representation of a single-precision floating-point value.
- // IEEE 754 says: "If two floating-point numbers in the same format are ordered then they are
- // ordered the same way when their bits are reinterpreted as sign-magnitude integers."
- // This allows us to convert all floating-point numbers to signed integers of arbitrary size
- // and then use them to work with ULPs (Units in the Last Place, for high-precision
- // computations) or to compare them (integer comparisons are faster than floating-point
- // comparisons on many platforms).
- typedef signed int BinFloat;
-
- // --------------------------------------------------------------------------------------------
- // Converts the bit pattern of a floating-point number to its signed integer representation.
- BinFloat ToBinary( const float & pValue) {
-
- // If this assertion fails, signed int is not big enough to store a float on your platform.
- // Please correct the declaration of BinFloat a few lines above - but do it in a portable,
- // #ifdef'd manner!
- BOOST_STATIC_ASSERT( sizeof(BinFloat) >= sizeof(float));
-
- #if defined( _MSC_VER)
- // If this assertion fails, Visual C++ has finally moved to ILP64. This means that this
- // code has just become legacy code! Find out the current value of _MSC_VER and modify
- // the #if above so it evaluates false on the current and all upcoming VC versions (or
- // on the current platform, if LP64 or LLP64 are still used on other platforms).
- BOOST_STATIC_ASSERT( sizeof(BinFloat) == sizeof(float));
-
- // This works best on Visual C++, but other compilers have their problems with it.
- const BinFloat binValue = reinterpret_cast<BinFloat const &>(pValue);
- #else
- // On many compilers, reinterpreting a float address as an integer causes aliasing
- // problems. This is an ugly but more or less safe way of doing it.
- union {
- float asFloat;
- BinFloat asBin;
- } conversion;
- conversion.asBin = 0; // zero empty space in case sizeof(BinFloat) > sizeof(float)
- conversion.asFloat = pValue;
- const BinFloat binValue = conversion.asBin;
- #endif
-
- // floating-point numbers are of sign-magnitude format, so find out what signed number
- // representation we must convert negative values to.
- // See http://en.wikipedia.org/wiki/Signed_number_representations.
-
- // Two's complement?
- if( (-42 == (~42 + 1)) && (binValue & 0x80000000))
- return BinFloat(1 << (CHAR_BIT * sizeof(BinFloat) - 1)) - binValue;
- // One's complement?
- else if( (-42 == ~42) && (binValue & 0x80000000))
- return BinFloat(-0) - binValue;
- // Sign-magnitude?
- else if( (-42 == (42 | (-0))) && (binValue & 0x80000000)) // -0 = 1000... binary
- return binValue;
- else
- return binValue;
- }
-
-} // namespace
-
-// ------------------------------------------------------------------------------------------------
-// Fills an array with indices of all positions indentical to the given position. In opposite to
-// FindPositions(), not an epsilon is used but a (very low) tolerance of four floating-point units.
-void SpatialSort::FindIdenticalPositions( const aiVector3D& pPosition,
- std::vector<unsigned int>& poResults) const
-{
- // Epsilons have a huge disadvantage: they are of constant precision, while floating-point
- // values are of log2 precision. If you apply e=0.01 to 100, the epsilon is rather small, but
- // if you apply it to 0.001, it is enormous.
-
- // The best way to overcome this is the unit in the last place (ULP). A precision of 2 ULPs
- // tells us that a float does not differ more than 2 bits from the "real" value. ULPs are of
- // logarithmic precision - around 1, they are 1÷(2^24) and around 10000, they are 0.00125.
-
- // For standard C math, we can assume a precision of 0.5 ULPs according to IEEE 754. The
- // incoming vertex positions might have already been transformed, probably using rather
- // inaccurate SSE instructions, so we assume a tolerance of 4 ULPs to safely identify
- // identical vertex positions.
- static const int toleranceInULPs = 4;
- // An interesting point is that the inaccuracy grows linear with the number of operations:
- // multiplying to numbers, each inaccurate to four ULPs, results in an inaccuracy of four ULPs
- // plus 0.5 ULPs for the multiplication.
- // To compute the distance to the plane, a dot product is needed - that is a multiplication and
- // an addition on each number.
- static const int distanceToleranceInULPs = toleranceInULPs + 1;
- // The squared distance between two 3D vectors is computed the same way, but with an additional
- // subtraction.
- static const int distance3DToleranceInULPs = distanceToleranceInULPs + 1;
-
- // Convert the plane distance to its signed integer representation so the ULPs tolerance can be
- // applied. For some reason, VC won't optimize two calls of the bit pattern conversion.
- const BinFloat minDistBinary = ToBinary( pPosition * mPlaneNormal) - distanceToleranceInULPs;
- const BinFloat maxDistBinary = minDistBinary + 2 * distanceToleranceInULPs;
-
- // clear the array in this strange fashion because a simple clear() would also deallocate
- // the array which we want to avoid
- poResults.erase( poResults.begin(), poResults.end());
-
- // do a binary search for the minimal distance to start the iteration there
- unsigned int index = (unsigned int)mPositions.size() / 2;
- unsigned int binaryStepSize = (unsigned int)mPositions.size() / 4;
- while( binaryStepSize > 1)
- {
- // Ugly, but conditional jumps are faster with integers than with floats
- if( minDistBinary > ToBinary(mPositions[index].mDistance))
- index += binaryStepSize;
- else
- index -= binaryStepSize;
-
- binaryStepSize /= 2;
- }
-
- // depending on the direction of the last step we need to single step a bit back or forth
- // to find the actual beginning element of the range
- while( index > 0 && minDistBinary < ToBinary(mPositions[index].mDistance) )
- index--;
- while( index < (mPositions.size() - 1) && minDistBinary > ToBinary(mPositions[index].mDistance))
- index++;
-
- // Now start iterating from there until the first position lays outside of the distance range.
- // Add all positions inside the distance range within the tolerance to the result aray
- std::vector<Entry>::const_iterator it = mPositions.begin() + index;
- while( ToBinary(it->mDistance) < maxDistBinary)
- {
- if( distance3DToleranceInULPs >= ToBinary((it->mPosition - pPosition).SquareLength()))
- poResults.push_back(it->mIndex);
- ++it;
- if( it == mPositions.end())
- break;
- }
-
- // that's it
-}
-
-// ------------------------------------------------------------------------------------------------
-unsigned int SpatialSort::GenerateMappingTable(std::vector<unsigned int>& fill,float pRadius) const
-{
- fill.resize(mPositions.size(),0xffffffff);
- float dist, maxDist;
-
- unsigned int t=0;
- const float pSquared = pRadius*pRadius;
- for (size_t i = 0; i < mPositions.size();) {
- dist = mPositions[i].mPosition * mPlaneNormal;
- maxDist = dist + pRadius;
-
- fill[mPositions[i].mIndex] = t;
- const aiVector3D& oldpos = mPositions[i].mPosition;
- for (++i; i < fill.size() && mPositions[i].mDistance < maxDist
- && (mPositions[i].mPosition - oldpos).SquareLength() < pSquared; ++i)
- {
- fill[mPositions[i].mIndex] = t;
- }
- ++t;
- }
-
-#ifdef _DEBUG
-
- // debug invariant: mPositions[i].mIndex values must range from 0 to mPositions.size()-1
- for (size_t i = 0; i < fill.size(); ++i) {
- ai_assert(fill[i]<mPositions.size());
- }
-
-#endif
- return t;
-}
-
diff --git a/3rdparty/assimp/code/SpatialSort.h b/3rdparty/assimp/code/SpatialSort.h
deleted file mode 100644
index 3205c05f..00000000
--- a/3rdparty/assimp/code/SpatialSort.h
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** Small helper classes to optimise finding vertizes close to a given location */
-#ifndef AI_SPATIALSORT_H_INC
-#define AI_SPATIALSORT_H_INC
-
-#include <vector>
-#include "../include/aiTypes.h"
-
-namespace Assimp
-{
-
-// ------------------------------------------------------------------------------------------------
-/** A little helper class to quickly find all vertices in the epsilon environment of a given
- * position. Construct an instance with an array of positions. The class stores the given positions
- * by their indices and sorts them by their distance to an arbitrary chosen plane.
- * You can then query the instance for all vertices close to a given position in an average O(log n)
- * time, with O(n) worst case complexity when all vertices lay on the plane. The plane is chosen
- * so that it avoids common planes in usual data sets. */
-// ------------------------------------------------------------------------------------------------
-class ASSIMP_API SpatialSort
-{
-public:
-
- SpatialSort();
-
- // ------------------------------------------------------------------------------------
- /** Constructs a spatially sorted representation from the given position array.
- * Supply the positions in its layout in memory, the class will only refer to them
- * by index.
- * @param pPositions Pointer to the first position vector of the array.
- * @param pNumPositions Number of vectors to expect in that array.
- * @param pElementOffset Offset in bytes from the beginning of one vector in memory
- * to the beginning of the next vector. */
- SpatialSort( const aiVector3D* pPositions, unsigned int pNumPositions,
- unsigned int pElementOffset);
-
- /** Destructor */
- ~SpatialSort();
-
-public:
-
- // ------------------------------------------------------------------------------------
- /** Sets the input data for the SpatialSort. This replaces existing data, if any.
- * The new data receives new indices in ascending order.
- *
- * @param pPositions Pointer to the first position vector of the array.
- * @param pNumPositions Number of vectors to expect in that array.
- * @param pElementOffset Offset in bytes from the beginning of one vector in memory
- * to the beginning of the next vector.
- * @param pFinalize Specifies whether the SpatialSort's internal representation
- * is finalized after the new data has been added. Finalization is
- * required in order to use #FindPosition() or #GenerateMappingTable().
- * If you don't finalize yet, you can use #Append() to add data from
- * other sources.*/
- void Fill( const aiVector3D* pPositions, unsigned int pNumPositions,
- unsigned int pElementOffset,
- bool pFinalize = true);
-
-
- // ------------------------------------------------------------------------------------
- /** Same as #Fill(), except the method appends to existing data in the #SpatialSort. */
- void Append( const aiVector3D* pPositions, unsigned int pNumPositions,
- unsigned int pElementOffset,
- bool pFinalize = true);
-
-
- // ------------------------------------------------------------------------------------
- /** Finalize the spatial hash data structure. This can be useful after
- * multiple calls to #Append() with the pFinalize parameter set to false.
- * This is finally required before one of #FindPositions() and #GenerateMappingTable()
- * can be called to query the spatial sort.*/
- void Finalize();
-
- // ------------------------------------------------------------------------------------
- /** Returns an iterator for all positions close to the given position.
- * @param pPosition The position to look for vertices.
- * @param pRadius Maximal distance from the position a vertex may have to be counted in.
- * @param poResults The container to store the indices of the found positions.
- * Will be emptied by the call so it may contain anything.
- * @return An iterator to iterate over all vertices in the given area.*/
- void FindPositions( const aiVector3D& pPosition, float pRadius,
- std::vector<unsigned int>& poResults) const;
-
- // ------------------------------------------------------------------------------------
- /** Fills an array with indices of all positions indentical to the given position. In
- * opposite to FindPositions(), not an epsilon is used but a (very low) tolerance of
- * four floating-point units.
- * @param pPosition The position to look for vertices.
- * @param poResults The container to store the indices of the found positions.
- * Will be emptied by the call so it may contain anything.*/
- void FindIdenticalPositions( const aiVector3D& pPosition,
- std::vector<unsigned int>& poResults) const;
-
- // ------------------------------------------------------------------------------------
- /** Compute a table that maps each vertex ID referring to a spatially close
- * enough position to the same output ID. Output IDs are assigned in ascending order
- * from 0...n.
- * @param fill Will be filled with numPositions entries.
- * @param pRadius Maximal distance from the position a vertex may have to
- * be counted in.
- * @return Number of unique vertices (n). */
- unsigned int GenerateMappingTable(std::vector<unsigned int>& fill,
- float pRadius) const;
-
-protected:
- /** Normal of the sorting plane, normalized. The center is always at (0, 0, 0) */
- aiVector3D mPlaneNormal;
-
- /** An entry in a spatially sorted position array. Consists of a vertex index,
- * its position and its precalculated distance from the reference plane */
- struct Entry
- {
- unsigned int mIndex; ///< The vertex referred by this entry
- aiVector3D mPosition; ///< Position
- float mDistance; ///< Distance of this vertex to the sorting plane
-
- Entry() { /** intentionally not initialized.*/ }
- Entry( unsigned int pIndex, const aiVector3D& pPosition, float pDistance)
- : mIndex( pIndex), mPosition( pPosition), mDistance( pDistance)
- { }
-
- bool operator < (const Entry& e) const { return mDistance < e.mDistance; }
- };
-
- // all positions, sorted by distance to the sorting plane
- std::vector<Entry> mPositions;
-};
-
-} // end of namespace Assimp
-
-#endif // AI_SPATIALSORT_H_INC
diff --git a/3rdparty/assimp/code/SplitLargeMeshes.cpp b/3rdparty/assimp/code/SplitLargeMeshes.cpp
deleted file mode 100644
index f4950461..00000000
--- a/3rdparty/assimp/code/SplitLargeMeshes.cpp
+++ /dev/null
@@ -1,677 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-
-/** @file Implementation of the SplitLargeMeshes postprocessing step
-*/
-
-#include "AssimpPCH.h"
-
-// internal headers of the post-processing framework
-#include "SplitLargeMeshes.h"
-#include "ProcessHelper.h"
-
-using namespace Assimp;
-
-
-// ------------------------------------------------------------------------------------------------
-SplitLargeMeshesProcess_Triangle::SplitLargeMeshesProcess_Triangle()
-{
- LIMIT = AI_SLM_DEFAULT_MAX_TRIANGLES;
-}
-
-// ------------------------------------------------------------------------------------------------
-SplitLargeMeshesProcess_Triangle::~SplitLargeMeshesProcess_Triangle()
-{
- // nothing to do here
-}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the processing step is present in the given flag field.
-bool SplitLargeMeshesProcess_Triangle::IsActive( unsigned int pFlags) const
-{
- return (pFlags & aiProcess_SplitLargeMeshes) != 0;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Executes the post processing step on the given imported data.
-void SplitLargeMeshesProcess_Triangle::Execute( aiScene* pScene)
-{
- if (0xffffffff == this->LIMIT)return;
-
- DefaultLogger::get()->debug("SplitLargeMeshesProcess_Triangle begin");
- std::vector<std::pair<aiMesh*, unsigned int> > avList;
-
- for ( unsigned int a = 0; a < pScene->mNumMeshes; a++)
- this->SplitMesh(a, pScene->mMeshes[a],avList);
-
- if (avList.size() != pScene->mNumMeshes)
- {
- // it seems something has been splitted. rebuild the mesh list
- delete[] pScene->mMeshes;
- pScene->mNumMeshes = (unsigned int)avList.size();
- pScene->mMeshes = new aiMesh*[avList.size()];
-
- for (unsigned int i = 0; i < avList.size();++i)
- pScene->mMeshes[i] = avList[i].first;
-
- // now we need to update all nodes
- this->UpdateNode(pScene->mRootNode,avList);
- DefaultLogger::get()->info("SplitLargeMeshesProcess_Triangle finished. Meshes have been splitted");
- }
- else DefaultLogger::get()->debug("SplitLargeMeshesProcess_Triangle finished. There was nothing to do");
- return;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Setup properties
-void SplitLargeMeshesProcess_Triangle::SetupProperties( const Importer* pImp)
-{
- // get the current value of the split property
- this->LIMIT = pImp->GetPropertyInteger(AI_CONFIG_PP_SLM_TRIANGLE_LIMIT,AI_SLM_DEFAULT_MAX_TRIANGLES);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Update a node after some meshes have been split
-void SplitLargeMeshesProcess_Triangle::UpdateNode(aiNode* pcNode,
- const std::vector<std::pair<aiMesh*, unsigned int> >& avList)
-{
- // for every index in out list build a new entry
- std::vector<unsigned int> aiEntries;
- aiEntries.reserve(pcNode->mNumMeshes + 1);
- for (unsigned int i = 0; i < pcNode->mNumMeshes;++i)
- {
- for (unsigned int a = 0; a < avList.size();++a)
- {
- if (avList[a].second == pcNode->mMeshes[i])
- {
- aiEntries.push_back(a);
- }
- }
- }
-
- // now build the new list
- delete pcNode->mMeshes;
- pcNode->mNumMeshes = (unsigned int)aiEntries.size();
- pcNode->mMeshes = new unsigned int[pcNode->mNumMeshes];
-
- for (unsigned int b = 0; b < pcNode->mNumMeshes;++b)
- pcNode->mMeshes[b] = aiEntries[b];
-
- // recusively update all other nodes
- for (unsigned int i = 0; i < pcNode->mNumChildren;++i)
- {
- UpdateNode ( pcNode->mChildren[i], avList );
- }
- return;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Executes the post processing step on the given imported data.
-void SplitLargeMeshesProcess_Triangle::SplitMesh(
- unsigned int a,
- aiMesh* pMesh,
- std::vector<std::pair<aiMesh*, unsigned int> >& avList)
-{
- if (pMesh->mNumFaces > SplitLargeMeshesProcess_Triangle::LIMIT)
- {
- DefaultLogger::get()->info("Mesh exceeds the triangle limit. It will be split ...");
-
- // we need to split this mesh into sub meshes
- // determine the size of a submesh
- const unsigned int iSubMeshes = (pMesh->mNumFaces / LIMIT) + 1;
-
- const unsigned int iOutFaceNum = pMesh->mNumFaces / iSubMeshes;
- const unsigned int iOutVertexNum = iOutFaceNum * 3;
-
- // now generate all submeshes
- for (unsigned int i = 0; i < iSubMeshes;++i)
- {
- aiMesh* pcMesh = new aiMesh;
- pcMesh->mNumFaces = iOutFaceNum;
- pcMesh->mMaterialIndex = pMesh->mMaterialIndex;
-
- // the name carries the adjacency information between the meshes
- pcMesh->mName = pMesh->mName;
-
- if (i == iSubMeshes-1)
- {
- pcMesh->mNumFaces = iOutFaceNum + (
- pMesh->mNumFaces - iOutFaceNum * iSubMeshes);
- }
- // copy the list of faces
- pcMesh->mFaces = new aiFace[pcMesh->mNumFaces];
-
- const unsigned int iBase = iOutFaceNum * i;
-
- // get the total number of indices
- unsigned int iCnt = 0;
- for (unsigned int p = iBase; p < pcMesh->mNumFaces + iBase;++p)
- {
- iCnt += pMesh->mFaces[p].mNumIndices;
- }
- pcMesh->mNumVertices = iCnt;
-
- // allocate storage
- if (pMesh->mVertices != NULL)
- pcMesh->mVertices = new aiVector3D[iCnt];
-
- if (pMesh->HasNormals())
- pcMesh->mNormals = new aiVector3D[iCnt];
-
- if (pMesh->HasTangentsAndBitangents())
- {
- pcMesh->mTangents = new aiVector3D[iCnt];
- pcMesh->mBitangents = new aiVector3D[iCnt];
- }
-
- // texture coordinates
- for (unsigned int c = 0; c < AI_MAX_NUMBER_OF_TEXTURECOORDS;++c)
- {
- pcMesh->mNumUVComponents[c] = pMesh->mNumUVComponents[c];
- if (pMesh->HasTextureCoords( c))
- {
- pcMesh->mTextureCoords[c] = new aiVector3D[iCnt];
- }
- }
-
- // vertex colors
- for (unsigned int c = 0; c < AI_MAX_NUMBER_OF_COLOR_SETS;++c)
- {
- if (pMesh->HasVertexColors( c))
- {
- pcMesh->mColors[c] = new aiColor4D[iCnt];
- }
- }
-
- if (pMesh->HasBones())
- {
- // assume the number of bones won't change in most cases
- pcMesh->mBones = new aiBone*[pMesh->mNumBones];
-
- // iterate through all bones of the mesh and find those which
- // need to be copied to the splitted mesh
- std::vector<aiVertexWeight> avTempWeights;
- for (unsigned int p = 0; p < pcMesh->mNumBones;++p)
- {
- aiBone* const bone = pcMesh->mBones[p];
- avTempWeights.clear();
- avTempWeights.reserve(bone->mNumWeights / iSubMeshes);
-
- for (unsigned int q = 0; q < bone->mNumWeights;++q)
- {
- aiVertexWeight& weight = bone->mWeights[q];
- if (weight.mVertexId >= iBase && weight.mVertexId < iBase + iOutVertexNum)
- {
- avTempWeights.push_back(weight);
- weight = avTempWeights.back();
- weight.mVertexId -= iBase;
- }
- }
-
- if (!avTempWeights.empty())
- {
- // we'll need this bone. Copy it ...
- aiBone* pc = new aiBone();
- pcMesh->mBones[pcMesh->mNumBones++] = pc;
- pc->mName = aiString(bone->mName);
- pc->mNumWeights = (unsigned int)avTempWeights.size();
- pc->mOffsetMatrix = bone->mOffsetMatrix;
-
- // no need to reallocate the array for the last submesh.
- // Here we can reuse the (large) source array, although
- // we'll waste some memory
- if (iSubMeshes-1 == i)
- {
- pc->mWeights = bone->mWeights;
- bone->mWeights = NULL;
- }
- else pc->mWeights = new aiVertexWeight[pc->mNumWeights];
-
- // copy the weights
- ::memcpy(pc->mWeights,&avTempWeights[0],sizeof(aiVertexWeight)*pc->mNumWeights);
- }
- }
- }
-
- // (we will also need to copy the array of indices)
- unsigned int iCurrent = 0;
- for (unsigned int p = 0; p < pcMesh->mNumFaces;++p)
- {
- pcMesh->mFaces[p].mNumIndices = 3;
- // allocate a new array
- const unsigned int iTemp = p + iBase;
- const unsigned int iNumIndices = pMesh->mFaces[iTemp].mNumIndices;
-
- // setup face type and number of indices
- pcMesh->mFaces[p].mNumIndices = iNumIndices;
- unsigned int* pi = pMesh->mFaces[iTemp].mIndices;
- unsigned int* piOut = pcMesh->mFaces[p].mIndices = new unsigned int[iNumIndices];
-
- // need to update the output primitive types
- switch (iNumIndices)
- {
- case 1:
- pcMesh->mPrimitiveTypes |= aiPrimitiveType_POINT;
- break;
- case 2:
- pcMesh->mPrimitiveTypes |= aiPrimitiveType_LINE;
- break;
- case 3:
- pcMesh->mPrimitiveTypes |= aiPrimitiveType_TRIANGLE;
- break;
- default:
- pcMesh->mPrimitiveTypes |= aiPrimitiveType_POLYGON;
- }
-
- // and copy the contents of the old array, offset by current base
- for (unsigned int v = 0; v < iNumIndices;++v)
- {
- unsigned int iIndex = pi[v];
- unsigned int iIndexOut = iCurrent++;
- piOut[v] = iIndexOut;
-
- // copy positions
- if (pMesh->mVertices != NULL)
- pcMesh->mVertices[iIndexOut] = pMesh->mVertices[iIndex];
-
- // copy normals
- if (pMesh->HasNormals())
- pcMesh->mNormals[iIndexOut] = pMesh->mNormals[iIndex];
-
- // copy tangents/bitangents
- if (pMesh->HasTangentsAndBitangents())
- {
- pcMesh->mTangents[iIndexOut] = pMesh->mTangents[iIndex];
- pcMesh->mBitangents[iIndexOut] = pMesh->mBitangents[iIndex];
- }
-
- // texture coordinates
- for (unsigned int c = 0; c < AI_MAX_NUMBER_OF_TEXTURECOORDS;++c)
- {
- if (pMesh->HasTextureCoords( c))
- pcMesh->mTextureCoords[c][iIndexOut] = pMesh->mTextureCoords[c][iIndex];
- }
- // vertex colors
- for (unsigned int c = 0; c < AI_MAX_NUMBER_OF_COLOR_SETS;++c)
- {
- if (pMesh->HasVertexColors( c))
- pcMesh->mColors[c][iIndexOut] = pMesh->mColors[c][iIndex];
- }
- }
- }
-
- // add the newly created mesh to the list
- avList.push_back(std::pair<aiMesh*, unsigned int>(pcMesh,a));
- }
-
- // now delete the old mesh data
- delete pMesh;
- }
- else avList.push_back(std::pair<aiMesh*, unsigned int>(pMesh,a));
- return;
-}
-
-// ------------------------------------------------------------------------------------------------
-SplitLargeMeshesProcess_Vertex::SplitLargeMeshesProcess_Vertex()
-{
- LIMIT = AI_SLM_DEFAULT_MAX_VERTICES;
-}
-
-// ------------------------------------------------------------------------------------------------
-SplitLargeMeshesProcess_Vertex::~SplitLargeMeshesProcess_Vertex()
-{
- // nothing to do here
-}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the processing step is present in the given flag field.
-bool SplitLargeMeshesProcess_Vertex::IsActive( unsigned int pFlags) const
-{
- return (pFlags & aiProcess_SplitLargeMeshes) != 0;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Executes the post processing step on the given imported data.
-void SplitLargeMeshesProcess_Vertex::Execute( aiScene* pScene)
-{
- std::vector<std::pair<aiMesh*, unsigned int> > avList;
-
- if (0xffffffff == this->LIMIT)return;
-
- DefaultLogger::get()->debug("SplitLargeMeshesProcess_Vertex begin");
- for ( unsigned int a = 0; a < pScene->mNumMeshes; a++)
- this->SplitMesh(a, pScene->mMeshes[a],avList);
-
- if (avList.size() != pScene->mNumMeshes)
- {
- // it seems something has been splitted. rebuild the mesh list
- delete[] pScene->mMeshes;
- pScene->mNumMeshes = (unsigned int)avList.size();
- pScene->mMeshes = new aiMesh*[avList.size()];
-
- for (unsigned int i = 0; i < avList.size();++i)
- pScene->mMeshes[i] = avList[i].first;
-
- // now we need to update all nodes
- SplitLargeMeshesProcess_Triangle::UpdateNode(pScene->mRootNode,avList);
- DefaultLogger::get()->info("SplitLargeMeshesProcess_Vertex finished. Meshes have been splitted");
- }
- else DefaultLogger::get()->debug("SplitLargeMeshesProcess_Vertex finished. There was nothing to do");
- return;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Setup properties
-void SplitLargeMeshesProcess_Vertex::SetupProperties( const Importer* pImp)
-{
- this->LIMIT = pImp->GetPropertyInteger(AI_CONFIG_PP_SLM_VERTEX_LIMIT,AI_SLM_DEFAULT_MAX_VERTICES);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Executes the post processing step on the given imported data.
-void SplitLargeMeshesProcess_Vertex::SplitMesh(
- unsigned int a,
- aiMesh* pMesh,
- std::vector<std::pair<aiMesh*, unsigned int> >& avList)
-{
- if (pMesh->mNumVertices > SplitLargeMeshesProcess_Vertex::LIMIT)
- {
- typedef std::vector< std::pair<unsigned int,float> > VertexWeightTable;
-
- // build a per-vertex weight list if necessary
- VertexWeightTable* avPerVertexWeights = ComputeVertexBoneWeightTable(pMesh);
-
- // we need to split this mesh into sub meshes
- // determine the estimated size of a submesh
- // (this could be too large. Max waste is a single digit percentage)
- const unsigned int iSubMeshes = (pMesh->mNumVertices / SplitLargeMeshesProcess_Vertex::LIMIT) + 1;
- //const unsigned int iOutVertexNum2 = pMesh->mNumVertices /iSubMeshes;
-
- // create a std::vector<unsigned int> to indicate which vertices
- // have already been copied
- std::vector<unsigned int> avWasCopied;
- avWasCopied.resize(pMesh->mNumVertices,0xFFFFFFFF);
-
- // try to find a good estimate for the number of output faces
- // per mesh. Add 12.5% as buffer
- unsigned int iEstimatedSize = pMesh->mNumFaces / iSubMeshes;
- iEstimatedSize += iEstimatedSize >> 3;
-
- // now generate all submeshes
- unsigned int iBase = 0;
- while (true)
- {
- const unsigned int iOutVertexNum = SplitLargeMeshesProcess_Vertex::LIMIT;
-
- aiMesh* pcMesh = new aiMesh;
- pcMesh->mNumVertices = 0;
- pcMesh->mMaterialIndex = pMesh->mMaterialIndex;
-
- // the name carries the adjacency information between the meshes
- pcMesh->mName = pMesh->mName;
-
- typedef std::vector<aiVertexWeight> BoneWeightList;
- if (pMesh->HasBones())
- {
- pcMesh->mBones = new aiBone*[pMesh->mNumBones];
- ::memset(pcMesh->mBones,0,sizeof(void*)*pMesh->mNumBones);
- }
-
- // clear the temporary helper array
- if (iBase)
- {
- // we can't use memset here we unsigned int needn' be 32 bits
- for (std::vector<unsigned int>::iterator
- iter = avWasCopied.begin(),end = avWasCopied.end();
- iter != end;++iter)
- {
- (*iter) = 0xffffffff;
- }
- }
-
- // output vectors
- std::vector<aiFace> vFaces;
-
- // reserve enough storage for most cases
- if (pMesh->HasPositions())
- {
- pcMesh->mVertices = new aiVector3D[iOutVertexNum];
- }
- if (pMesh->HasNormals())
- {
- pcMesh->mNormals = new aiVector3D[iOutVertexNum];
- }
- if (pMesh->HasTangentsAndBitangents())
- {
- pcMesh->mTangents = new aiVector3D[iOutVertexNum];
- pcMesh->mBitangents = new aiVector3D[iOutVertexNum];
- }
- for (unsigned int c = 0; pMesh->HasVertexColors(c);++c)
- {
- pcMesh->mColors[c] = new aiColor4D[iOutVertexNum];
- }
- for (unsigned int c = 0; pMesh->HasTextureCoords(c);++c)
- {
- pcMesh->mNumUVComponents[c] = pMesh->mNumUVComponents[c];
- pcMesh->mTextureCoords[c] = new aiVector3D[iOutVertexNum];
- }
- vFaces.reserve(iEstimatedSize);
-
- // (we will also need to copy the array of indices)
- while (iBase < pMesh->mNumFaces)
- {
- // allocate a new array
- const unsigned int iNumIndices = pMesh->mFaces[iBase].mNumIndices;
-
- // doesn't catch degenerates but is quite fast
- unsigned int iNeed = 0;
- for (unsigned int v = 0; v < iNumIndices;++v)
- {
- unsigned int iIndex = pMesh->mFaces[iBase].mIndices[v];
-
- // check whether we do already have this vertex
- if (0xFFFFFFFF == avWasCopied[iIndex])
- {
- iNeed++;
- }
- }
- if (pcMesh->mNumVertices + iNeed > iOutVertexNum)
- {
- // don't use this face
- break;
- }
-
- vFaces.push_back(aiFace());
- aiFace& rFace = vFaces.back();
-
- // setup face type and number of indices
- rFace.mNumIndices = iNumIndices;
- rFace.mIndices = new unsigned int[iNumIndices];
-
- // need to update the output primitive types
- switch (rFace.mNumIndices)
- {
- case 1:
- pcMesh->mPrimitiveTypes |= aiPrimitiveType_POINT;
- break;
- case 2:
- pcMesh->mPrimitiveTypes |= aiPrimitiveType_LINE;
- break;
- case 3:
- pcMesh->mPrimitiveTypes |= aiPrimitiveType_TRIANGLE;
- break;
- default:
- pcMesh->mPrimitiveTypes |= aiPrimitiveType_POLYGON;
- }
-
- // and copy the contents of the old array, offset by current base
- for (unsigned int v = 0; v < iNumIndices;++v)
- {
- unsigned int iIndex = pMesh->mFaces[iBase].mIndices[v];
-
- // check whether we do already have this vertex
- if (0xFFFFFFFF != avWasCopied[iIndex])
- {
- rFace.mIndices[v] = avWasCopied[iIndex];
- continue;
- }
-
- // copy positions
- pcMesh->mVertices[pcMesh->mNumVertices] = (pMesh->mVertices[iIndex]);
-
- // copy normals
- if (pMesh->HasNormals())
- {
- pcMesh->mNormals[pcMesh->mNumVertices] = (pMesh->mNormals[iIndex]);
- }
-
- // copy tangents/bitangents
- if (pMesh->HasTangentsAndBitangents())
- {
- pcMesh->mTangents[pcMesh->mNumVertices] = (pMesh->mTangents[iIndex]);
- pcMesh->mBitangents[pcMesh->mNumVertices] = (pMesh->mBitangents[iIndex]);
- }
-
- // texture coordinates
- for (unsigned int c = 0; c < AI_MAX_NUMBER_OF_TEXTURECOORDS;++c)
- {
- if (pMesh->HasTextureCoords( c))
- {
- pcMesh->mTextureCoords[c][pcMesh->mNumVertices] = pMesh->mTextureCoords[c][iIndex];
- }
- }
- // vertex colors
- for (unsigned int c = 0; c < AI_MAX_NUMBER_OF_COLOR_SETS;++c)
- {
- if (pMesh->HasVertexColors( c))
- {
- pcMesh->mColors[c][pcMesh->mNumVertices] = pMesh->mColors[c][iIndex];
- }
- }
- // check whether we have bone weights assigned to this vertex
- rFace.mIndices[v] = pcMesh->mNumVertices;
- if (avPerVertexWeights)
- {
- VertexWeightTable& table = avPerVertexWeights[ pcMesh->mNumVertices ];
- if ( !table.empty() )
- {
- for (VertexWeightTable::const_iterator
- iter = table.begin();
- iter != table.end();++iter)
- {
- // allocate the bone weight array if necessary
- BoneWeightList* pcWeightList = (BoneWeightList*)pcMesh->mBones[(*iter).first];
- if (!pcWeightList)
- {
- pcMesh->mBones[(*iter).first] = (aiBone*)(pcWeightList = new BoneWeightList());
- }
- pcWeightList->push_back(aiVertexWeight(pcMesh->mNumVertices,(*iter).second));
- }
- }
- }
-
- avWasCopied[iIndex] = pcMesh->mNumVertices;
- pcMesh->mNumVertices++;
- }
- iBase++;
- if (pcMesh->mNumVertices == iOutVertexNum)
- {
- // break here. The face is only added if it was complete
- break;
- }
- }
-
- // check which bones we'll need to create for this submesh
- if (pMesh->HasBones())
- {
- aiBone** ppCurrent = pcMesh->mBones;
- for (unsigned int k = 0; k < pMesh->mNumBones;++k)
- {
- // check whether the bone is existing
- BoneWeightList* pcWeightList;
- if ((pcWeightList = (BoneWeightList*)pcMesh->mBones[k]))
- {
- aiBone* pcOldBone = pMesh->mBones[k];
- aiBone* pcOut;
- *ppCurrent++ = pcOut = new aiBone();
- pcOut->mName = aiString(pcOldBone->mName);
- pcOut->mOffsetMatrix = pcOldBone->mOffsetMatrix;
- pcOut->mNumWeights = (unsigned int)pcWeightList->size();
- pcOut->mWeights = new aiVertexWeight[pcOut->mNumWeights];
-
- // copy the vertex weights
- ::memcpy(pcOut->mWeights,&pcWeightList->operator[](0),
- pcOut->mNumWeights * sizeof(aiVertexWeight));
-
- // delete the temporary bone weight list
- delete pcWeightList;
- pcMesh->mNumBones++;
- }
- }
- }
-
- // copy the face list to the mesh
- pcMesh->mFaces = new aiFace[vFaces.size()];
- pcMesh->mNumFaces = (unsigned int)vFaces.size();
-
- for (unsigned int p = 0; p < pcMesh->mNumFaces;++p)
- pcMesh->mFaces[p] = vFaces[p];
-
- // add the newly created mesh to the list
- avList.push_back(std::pair<aiMesh*, unsigned int>(pcMesh,a));
-
- if (iBase == pMesh->mNumFaces)
- {
- // have all faces ... finish the outer loop, too
- break;
- }
- }
-
- // delete the per-vertex weight list again
- delete[] avPerVertexWeights;
-
- // now delete the old mesh data
- delete pMesh;
- return;
- }
- avList.push_back(std::pair<aiMesh*, unsigned int>(pMesh,a));
- return;
-}
diff --git a/3rdparty/assimp/code/SplitLargeMeshes.h b/3rdparty/assimp/code/SplitLargeMeshes.h
deleted file mode 100644
index e3c08ddb..00000000
--- a/3rdparty/assimp/code/SplitLargeMeshes.h
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file Defines a post processing step to split large meshes into submeshes
- */
-#ifndef AI_SPLITLARGEMESHES_H_INC
-#define AI_SPLITLARGEMESHES_H_INC
-
-#include <vector>
-#include "BaseProcess.h"
-
-#include "../include/aiMesh.h"
-#include "../include/aiScene.h"
-
-class SplitLargeMeshesTest;
-namespace Assimp
-{
-
-class SplitLargeMeshesProcess_Triangle;
-class SplitLargeMeshesProcess_Vertex;
-
-// NOTE: If you change these limits, don't forget to change the
-// corresponding values in all Assimp ports
-
-// **********************************************************
-// Java: ConfigProperty.java,
-// ConfigProperty.DEFAULT_VERTEX_SPLIT_LIMIT
-// ConfigProperty.DEFAULT_TRIANGLE_SPLIT_LIMIT
-// **********************************************************
-
-// default limit for vertices
-#if (!defined AI_SLM_DEFAULT_MAX_VERTICES)
-# define AI_SLM_DEFAULT_MAX_VERTICES 1000000
-#endif
-
-// default limit for triangles
-#if (!defined AI_SLM_DEFAULT_MAX_TRIANGLES)
-# define AI_SLM_DEFAULT_MAX_TRIANGLES 1000000
-#endif
-
-// ---------------------------------------------------------------------------
-/** Postprocessing filter to split large meshes into submeshes
- *
- * Applied BEFORE the JoinVertices-Step occurs.
- * Returns NON-UNIQUE vertices, splits by triangle number.
-*/
-class ASSIMP_API SplitLargeMeshesProcess_Triangle : public BaseProcess
-{
- friend class Importer;
- friend class SplitLargeMeshesProcess_Vertex;
- friend class ::SplitLargeMeshesTest;
-
-protected:
- /** Constructor to be privately used by Importer */
- SplitLargeMeshesProcess_Triangle();
-
- /** Destructor, private as well */
- ~SplitLargeMeshesProcess_Triangle();
-
-public:
- // -------------------------------------------------------------------
- /** Returns whether the processing step is present in the given flag.
- * @param pFlags The processing flags the importer was called with. A
- * bitwise combination of #aiPostProcessSteps.
- * @return true if the process is present in this flag fields,
- * false if not.
- */
- bool IsActive( unsigned int pFlags) const;
-
-
- // -------------------------------------------------------------------
- /** Called prior to ExecuteOnScene().
- * The function is a request to the process to update its configuration
- * basing on the Importer's configuration property list.
- */
- virtual void SetupProperties(const Importer* pImp);
-
-
- //! Set the split limit - needed for unit testing
- inline void SetLimit(unsigned int l)
- {LIMIT = l;}
-
- //! Get the split limit
- inline unsigned int GetLimit() const
- {return LIMIT;}
-
-protected:
-
- // -------------------------------------------------------------------
- /** Executes the post processing step on the given imported data.
- * At the moment a process is not supposed to fail.
- * @param pScene The imported data to work at.
- */
- void Execute( aiScene* pScene);
-
- // -------------------------------------------------------------------
- //! Apply the algorithm to a given mesh
- void SplitMesh (unsigned int a, aiMesh* pcMesh,
- std::vector<std::pair<aiMesh*, unsigned int> >& avList);
-
- // -------------------------------------------------------------------
- //! Update a node in the asset after a few of its meshes
- //! have been split
- static void UpdateNode(aiNode* pcNode,
- const std::vector<std::pair<aiMesh*, unsigned int> >& avList);
-
-public:
- //! Triangle limit
- unsigned int LIMIT;
-};
-
-
-// ---------------------------------------------------------------------------
-/** Postprocessing filter to split large meshes into submeshes
- *
- * Applied AFTER the JoinVertices-Step occurs.
- * Returns UNIQUE vertices, splits by vertex number.
-*/
-class ASSIMP_API SplitLargeMeshesProcess_Vertex : public BaseProcess
-{
- friend class Importer;
- friend class ::SplitLargeMeshesTest;
-
-protected:
- /** Constructor to be privately used by Importer */
- SplitLargeMeshesProcess_Vertex();
-
- /** Destructor, private as well */
- ~SplitLargeMeshesProcess_Vertex();
-
-public:
- // -------------------------------------------------------------------
- /** Returns whether the processing step is present in the given flag field.
- * @param pFlags The processing flags the importer was called with. A bitwise
- * combination of #aiPostProcessSteps.
- * @return true if the process is present in this flag fields, false if not.
- */
- bool IsActive( unsigned int pFlags) const;
-
- // -------------------------------------------------------------------
- /** Called prior to ExecuteOnScene().
- * The function is a request to the process to update its configuration
- * basing on the Importer's configuration property list.
- */
- virtual void SetupProperties(const Importer* pImp);
-
-
- //! Set the split limit - needed for unit testing
- inline void SetLimit(unsigned int l)
- {LIMIT = l;}
-
- //! Get the split limit
- inline unsigned int GetLimit() const
- {return LIMIT;}
-
-protected:
-
- // -------------------------------------------------------------------
- /** Executes the post processing step on the given imported data.
- * At the moment a process is not supposed to fail.
- * @param pScene The imported data to work at.
- */
- void Execute( aiScene* pScene);
-
- // -------------------------------------------------------------------
- //! Apply the algorithm to a given mesh
- void SplitMesh (unsigned int a, aiMesh* pcMesh,
- std::vector<std::pair<aiMesh*, unsigned int> >& avList);
-
- // NOTE: Reuse SplitLargeMeshesProcess_Triangle::UpdateNode()
-
-public:
- //! Triangle limit
- unsigned int LIMIT;
-};
-
-} // end of namespace Assimp
-
-#endif // !!AI_SPLITLARGEMESHES_H_INC
diff --git a/3rdparty/assimp/code/StandardShapes.cpp b/3rdparty/assimp/code/StandardShapes.cpp
deleted file mode 100644
index e752918b..00000000
--- a/3rdparty/assimp/code/StandardShapes.cpp
+++ /dev/null
@@ -1,502 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file StandardShapes.cpp
- * @brief Implementation of the StandardShapes class
- *
- * The primitive geometry data comes from
- * http://geometrictools.com/Documentation/PlatonicSolids.pdf.
- */
-
-#include "AssimpPCH.h"
-#include "StandardShapes.h"
-
-namespace Assimp {
-
-
-# define ADD_TRIANGLE(n0,n1,n2) \
- positions.push_back(n0); \
- positions.push_back(n1); \
- positions.push_back(n2);
-
-# define ADD_PENTAGON(n0,n1,n2,n3,n4) \
- if (polygons) \
- { \
- positions.push_back(n0); \
- positions.push_back(n1); \
- positions.push_back(n2); \
- positions.push_back(n3); \
- positions.push_back(n4); \
- } \
- else \
- { \
- ADD_TRIANGLE(n0, n1, n2) \
- ADD_TRIANGLE(n0, n2, n3) \
- ADD_TRIANGLE(n0, n3, n4) \
- }
-
-# define ADD_QUAD(n0,n1,n2,n3) \
- if (polygons) \
- { \
- positions.push_back(n0); \
- positions.push_back(n1); \
- positions.push_back(n2); \
- positions.push_back(n3); \
- } \
- else \
- { \
- ADD_TRIANGLE(n0, n1, n2) \
- ADD_TRIANGLE(n0, n2, n3) \
- }
-
-
-// ------------------------------------------------------------------------------------------------
-// Fast subdivision for a mesh whose verts have a magnitude of 1
-void Subdivide(std::vector<aiVector3D>& positions)
-{
- // assume this to be constant - (fixme: must be 1.0? I think so)
- const float fl1 = positions[0].Length();
-
- unsigned int origSize = (unsigned int)positions.size();
- for (unsigned int i = 0 ; i < origSize ; i+=3)
- {
- aiVector3D& tv0 = positions[i];
- aiVector3D& tv1 = positions[i+1];
- aiVector3D& tv2 = positions[i+2];
-
- aiVector3D a = tv0, b = tv1, c = tv2;
- aiVector3D v1 = aiVector3D(a.x+b.x, a.y+b.y, a.z+b.z).Normalize()*fl1;
- aiVector3D v2 = aiVector3D(a.x+c.x, a.y+c.y, a.z+c.z).Normalize()*fl1;
- aiVector3D v3 = aiVector3D(b.x+c.x, b.y+c.y, b.z+c.z).Normalize()*fl1;
-
- tv0 = v1; tv1 = v3; tv2 = v2; // overwrite the original
- ADD_TRIANGLE(v1, v2, a);
- ADD_TRIANGLE(v2, v3, c);
- ADD_TRIANGLE(v3, v1, b);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Construct a mesh from given vertex positions
-aiMesh* StandardShapes::MakeMesh(const std::vector<aiVector3D>& positions,
- unsigned int numIndices)
-{
- if (positions.size() & numIndices || positions.empty() || !numIndices)
- return NULL;
-
- // Determine which kinds of primitives the mesh consists of
- aiMesh* out = new aiMesh();
- switch (numIndices)
- {
- case 1:
- out->mPrimitiveTypes = aiPrimitiveType_POINT;
- break;
- case 2:
- out->mPrimitiveTypes = aiPrimitiveType_LINE;
- break;
- case 3:
- out->mPrimitiveTypes = aiPrimitiveType_TRIANGLE;
- break;
- default:
- out->mPrimitiveTypes = aiPrimitiveType_POLYGON;
- break;
- };
-
- out->mNumFaces = (unsigned int)positions.size() / numIndices;
- out->mFaces = new aiFace[out->mNumFaces];
- for (unsigned int i = 0, a = 0; i < out->mNumFaces;++i)
- {
- aiFace& f = out->mFaces[i];
- f.mNumIndices = numIndices;
- f.mIndices = new unsigned int[numIndices];
- for (unsigned int i = 0; i < numIndices;++i,++a)
- f.mIndices[i] = a;
- }
- out->mNumVertices = (unsigned int)positions.size();
- out->mVertices = new aiVector3D[out->mNumVertices];
- ::memcpy(out->mVertices,&positions[0],out->mNumVertices*sizeof(aiVector3D));
- return out;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Construct a mesh with a specific shape (callback)
-aiMesh* StandardShapes::MakeMesh ( unsigned int (*GenerateFunc)(
- std::vector<aiVector3D>&))
-{
- std::vector<aiVector3D> temp;
- unsigned num = (*GenerateFunc)(temp);
- return MakeMesh(temp,num);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Construct a mesh with a specific shape (callback)
-aiMesh* StandardShapes::MakeMesh ( unsigned int (*GenerateFunc)(
- std::vector<aiVector3D>&, bool))
-{
- std::vector<aiVector3D> temp;
- unsigned num = (*GenerateFunc)(temp,true);
- return MakeMesh(temp,num);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Construct a mesh with a specific shape (callback)
-aiMesh* StandardShapes::MakeMesh (unsigned int num, void (*GenerateFunc)(
- unsigned int,std::vector<aiVector3D>&))
-{
- std::vector<aiVector3D> temp;
- (*GenerateFunc)(num,temp);
- return MakeMesh(temp,3);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Build an incosahedron with points.magnitude == 1
-unsigned int StandardShapes::MakeIcosahedron(std::vector<aiVector3D>& positions)
-{
- positions.reserve(positions.size()+60);
-
- const float t = (1.f + 2.236067977f)/2.f;
- const float s = sqrt(1.f + t*t);
-
- const aiVector3D v0 = aiVector3D(t,1.f, 0.f)/s;
- const aiVector3D v1 = aiVector3D(-t,1.f, 0.f)/s;
- const aiVector3D v2 = aiVector3D(t,-1.f, 0.f)/s;
- const aiVector3D v3 = aiVector3D(-t,-1.f, 0.f)/s;
- const aiVector3D v4 = aiVector3D(1.f, 0.f, t)/s;
- const aiVector3D v5 = aiVector3D(1.f, 0.f,-t)/s;
- const aiVector3D v6 = aiVector3D(-1.f, 0.f,t)/s;
- const aiVector3D v7 = aiVector3D(-1.f, 0.f,-t)/s;
- const aiVector3D v8 = aiVector3D(0.f, t, 1.f)/s;
- const aiVector3D v9 = aiVector3D(0.f,-t, 1.f)/s;
- const aiVector3D v10 = aiVector3D(0.f, t,-1.f)/s;
- const aiVector3D v11 = aiVector3D(0.f,-t,-1.f)/s;
-
- ADD_TRIANGLE(v0,v8,v4);
- ADD_TRIANGLE(v0,v5,v10);
- ADD_TRIANGLE(v2,v4,v9);
- ADD_TRIANGLE(v2,v11,v5);
-
- ADD_TRIANGLE(v1,v6,v8);
- ADD_TRIANGLE(v1,v10,v7);
- ADD_TRIANGLE(v3,v9,v6);
- ADD_TRIANGLE(v3,v7,v11);
-
- ADD_TRIANGLE(v0,v10,v8);
- ADD_TRIANGLE(v1,v8,v10);
- ADD_TRIANGLE(v2,v9,v11);
- ADD_TRIANGLE(v3,v11,v9);
-
- ADD_TRIANGLE(v4,v2,v0);
- ADD_TRIANGLE(v5,v0,v2);
- ADD_TRIANGLE(v6,v1,v3);
- ADD_TRIANGLE(v7,v3,v1);
-
- ADD_TRIANGLE(v8,v6,v4);
- ADD_TRIANGLE(v9,v4,v6);
- ADD_TRIANGLE(v10,v5,v7);
- ADD_TRIANGLE(v11,v7,v5);
- return 3;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Build a dodecahedron with points.magnitude == 1
-unsigned int StandardShapes::MakeDodecahedron(std::vector<aiVector3D>& positions,
- bool polygons /*= false*/)
-{
- positions.reserve(positions.size()+108);
-
- const float a = 1.f / 1.7320508f;
- const float b = sqrt((3.f-2.23606797f)/6.f);
- const float c = sqrt((3.f+2.23606797f)/6.f);
-
- const aiVector3D v0 = aiVector3D(a,a,a);
- const aiVector3D v1 = aiVector3D(a,a,-a);
- const aiVector3D v2 = aiVector3D(a,-a,a);
- const aiVector3D v3 = aiVector3D(a,-a,-a);
- const aiVector3D v4 = aiVector3D(-a,a,a);
- const aiVector3D v5 = aiVector3D(-a,a,-a);
- const aiVector3D v6 = aiVector3D(-a,-a,a);
- const aiVector3D v7 = aiVector3D(-a,-a,-a);
- const aiVector3D v8 = aiVector3D(b,c,0.f);
- const aiVector3D v9 = aiVector3D(-b,c,0.f);
- const aiVector3D v10 = aiVector3D(b,-c,0.f);
- const aiVector3D v11 = aiVector3D(-b,-c,0.f);
- const aiVector3D v12 = aiVector3D(c, 0.f, b);
- const aiVector3D v13 = aiVector3D(c, 0.f, -b);
- const aiVector3D v14 = aiVector3D(-c, 0.f, b);
- const aiVector3D v15 = aiVector3D(-c, 0.f, -b);
- const aiVector3D v16 = aiVector3D(0.f, b, c);
- const aiVector3D v17 = aiVector3D(0.f, -b, c);
- const aiVector3D v18 = aiVector3D(0.f, b, -c);
- const aiVector3D v19 = aiVector3D(0.f, -b, -c);
-
- ADD_PENTAGON(v0, v8, v9, v4, v16);
- ADD_PENTAGON(v0, v12, v13, v1, v8);
- ADD_PENTAGON(v0, v16, v17, v2, v12);
- ADD_PENTAGON(v8, v1, v18, v5, v9);
- ADD_PENTAGON(v12, v2, v10, v3, v13);
- ADD_PENTAGON(v16, v4, v14, v6, v17);
- ADD_PENTAGON(v9, v5, v15, v14, v4);
-
- ADD_PENTAGON(v6, v11, v10, v2, v17);
- ADD_PENTAGON(v3, v19, v18, v1, v13);
- ADD_PENTAGON(v7, v15, v5, v18, v19);
- ADD_PENTAGON(v7, v11, v6, v14, v15);
- ADD_PENTAGON(v7, v19, v3, v10, v11);
- return (polygons ? 5 : 3);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Build an octahedron with points.magnitude == 1
-unsigned int StandardShapes::MakeOctahedron(std::vector<aiVector3D>& positions)
-{
- positions.reserve(positions.size()+24);
-
- const aiVector3D v0 = aiVector3D(1.0f, 0.f, 0.f) ;
- const aiVector3D v1 = aiVector3D(-1.0f, 0.f, 0.f);
- const aiVector3D v2 = aiVector3D(0.f, 1.0f, 0.f);
- const aiVector3D v3 = aiVector3D(0.f, -1.0f, 0.f);
- const aiVector3D v4 = aiVector3D(0.f, 0.f, 1.0f);
- const aiVector3D v5 = aiVector3D(0.f, 0.f, -1.0f);
-
- ADD_TRIANGLE(v4,v0,v2);
- ADD_TRIANGLE(v4,v2,v1);
- ADD_TRIANGLE(v4,v1,v3);
- ADD_TRIANGLE(v4,v3,v0);
-
- ADD_TRIANGLE(v5,v2,v0);
- ADD_TRIANGLE(v5,v1,v2);
- ADD_TRIANGLE(v5,v3,v1);
- ADD_TRIANGLE(v5,v0,v3);
- return 3;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Build a tetrahedron with points.magnitude == 1
-unsigned int StandardShapes::MakeTetrahedron(std::vector<aiVector3D>& positions)
-{
- positions.reserve(positions.size()+9);
-
- const float a = 1.41421f/3.f;
- const float b = 2.4494f/3.f;
-
- const aiVector3D v0 = aiVector3D(0.f,0.f,1.f);
- const aiVector3D v1 = aiVector3D(2*a,0,-1.f/3.f);
- const aiVector3D v2 = aiVector3D(-a,b,-1.f/3.f);
- const aiVector3D v3 = aiVector3D(-a,-b,-1.f/3.f);
-
- ADD_TRIANGLE(v0,v1,v2);
- ADD_TRIANGLE(v0,v2,v3);
- ADD_TRIANGLE(v0,v3,v1);
- ADD_TRIANGLE(v1,v3,v2);
- return 3;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Build a hexahedron with points.magnitude == 1
-unsigned int StandardShapes::MakeHexahedron(std::vector<aiVector3D>& positions,
- bool polygons /*= false*/)
-{
- positions.reserve(positions.size()+36);
- const float length = 1.f/1.73205080f;
-
- const aiVector3D v0 = aiVector3D(-1.f,-1.f,-1.f)*length;
- const aiVector3D v1 = aiVector3D(1.f,-1.f,-1.f)*length;
- const aiVector3D v2 = aiVector3D(1.f,1.f,-1.f)*length;
- const aiVector3D v3 = aiVector3D(-1.f,1.f,-1.f)*length;
- const aiVector3D v4 = aiVector3D(-1.f,-1.f,1.f)*length;
- const aiVector3D v5 = aiVector3D(1.f,-1.f,1.f)*length;
- const aiVector3D v6 = aiVector3D(1.f,1.f,1.f)*length;
- const aiVector3D v7 = aiVector3D(-1.f,1.f,1.f)*length;
-
- ADD_QUAD(v0,v3,v2,v1);
- ADD_QUAD(v0,v1,v5,v4);
- ADD_QUAD(v0,v4,v7,v3);
- ADD_QUAD(v6,v5,v1,v2);
- ADD_QUAD(v6,v2,v3,v7);
- ADD_QUAD(v6,v7,v4,v5);
- return (polygons ? 4 : 3);
-}
-
-// Cleanup ...
-#undef ADD_TRIANGLE
-#undef ADD_QUAD
-#undef ADD_PENTAGON
-
-// ------------------------------------------------------------------------------------------------
-// Create a subdivision sphere
-void StandardShapes::MakeSphere(unsigned int tess,
- std::vector<aiVector3D>& positions)
-{
- // Reserve enough storage. Every subdivision
- // splits each triangle in 4, the icosahedron consists of 60 verts
- positions.reserve(positions.size()+60 * integer_pow(4, tess));
-
- // Construct an icosahedron to start with
- MakeIcosahedron(positions);
-
- // ... and subdivide it until the requested output
- // tesselation is reached
- for (unsigned int i = 0; i<tess;++i)
- Subdivide(positions);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Build a cone
-void StandardShapes::MakeCone(float height,float radius1,
- float radius2,unsigned int tess,
- std::vector<aiVector3D>& positions,bool bOpen /*= false */)
-{
- // Sorry, a cone with less than 3 segments makes ABSOLUTELY NO SENSE
- if (tess < 3 || !height)
- return;
-
- size_t old = positions.size();
-
- // No negative radii
- radius1 = ::fabs(radius1);
- radius2 = ::fabs(radius2);
-
- float halfHeight = height / 2;
-
- // radius1 is always the smaller one
- if (radius2 > radius1)
- {
- std::swap(radius2,radius1);
- halfHeight = -halfHeight;
- }
- else old = 0xffffffff;
-
- // Use a large epsilon to check whether the cone is pointy
- if (radius1 < (radius2-radius1)*10e-3f)radius1 = 0.f;
-
- // We will need 3*2 verts per segment + 3*2 verts per segment
- // if the cone is closed
- const unsigned int mem = tess*6 + (!bOpen ? tess*3 * (radius1 ? 2 : 1) : 0);
- positions.reserve(positions.size () + mem);
-
- // Now construct all segments
- const float angle_delta = (float)AI_MATH_TWO_PI / tess;
- const float angle_max = (float)AI_MATH_TWO_PI;
-
- float s = 1.f; // cos(angle == 0);
- float t = 0.f; // sin(angle == 0);
-
- for (float angle = 0.f; angle < angle_max; )
- {
- const aiVector3D v1 = aiVector3D (s * radius1, -halfHeight, t * radius1 );
- const aiVector3D v2 = aiVector3D (s * radius2, halfHeight, t * radius2 );
-
- const float next = angle + angle_delta;
- float s2 = ::cos(next);
- float t2 = ::sin(next);
-
- const aiVector3D v3 = aiVector3D (s2 * radius2, halfHeight, t2 * radius2 );
- const aiVector3D v4 = aiVector3D (s2 * radius1, -halfHeight, t2 * radius1 );
-
- positions.push_back(v1);
- positions.push_back(v2);
- positions.push_back(v3);
- positions.push_back(v4);
- positions.push_back(v1);
- positions.push_back(v3);
-
- if (!bOpen)
- {
- // generate the end 'cap'
- positions.push_back(aiVector3D(s * radius2, halfHeight, t * radius2 ));
- positions.push_back(aiVector3D(s2 * radius2, halfHeight, t2 * radius2 ));
- positions.push_back(aiVector3D(0.f, halfHeight, 0.f));
-
-
- if (radius1)
- {
- // generate the other end 'cap'
- positions.push_back(aiVector3D(s * radius1, -halfHeight, t * radius1 ));
- positions.push_back(aiVector3D(s2 * radius1, -halfHeight, t2 * radius1 ));
- positions.push_back(aiVector3D(0.f, -halfHeight, 0.f));
-
- }
- }
- s = s2;
- t = t2;
- angle = next;
- }
-
- // Need to flip face order?
- if (0xffffffff != old )
- {
- for (size_t s = old; s < positions.size();s += 3)
- std::swap(positions[s],positions[s+1]);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Build a circle
-void StandardShapes::MakeCircle(float radius, unsigned int tess,
- std::vector<aiVector3D>& positions)
-{
- // Sorry, a circle with less than 3 segments makes ABSOLUTELY NO SENSE
- if (tess < 3 || !radius)
- return;
-
- radius = ::fabs(radius);
-
- // We will need 3 vertices per segment
- positions.reserve(positions.size()+tess*3);
-
- const float angle_delta = (float)AI_MATH_TWO_PI / tess;
- const float angle_max = (float)AI_MATH_TWO_PI;
-
- float s = 1.f; // cos(angle == 0);
- float t = 0.f; // sin(angle == 0);
-
- for (float angle = 0.f; angle < angle_max; )
- {
- positions.push_back(aiVector3D(s * radius,0.f,t * radius));
- angle += angle_delta;
- s = ::cos(angle);
- t = ::sin(angle);
- positions.push_back(aiVector3D(s * radius,0.f,t * radius));
-
- positions.push_back(aiVector3D(0.f,0.f,0.f));
- }
-}
-
-} // ! Assimp
diff --git a/3rdparty/assimp/code/StandardShapes.h b/3rdparty/assimp/code/StandardShapes.h
deleted file mode 100644
index ae59eb9d..00000000
--- a/3rdparty/assimp/code/StandardShapes.h
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file Declares a helper class, "StandardShapes" which generates
- * vertices for standard shapes, such as cylnders, cones, spheres ..
- */
-#ifndef AI_STANDARD_SHAPES_H_INC
-#define AI_STANDARD_SHAPES_H_INC
-
-#include <vector>
-
-
-namespace Assimp {
-
-// ---------------------------------------------------------------------------
-/** \brief Helper class to generate vertex buffers for standard geometric
- * shapes, such as cylinders, cones, boxes, spheres, elipsoids ... .
- */
-class ASSIMP_API StandardShapes
-{
- // class cannot be instanced
- StandardShapes() {}
-
-public:
-
-
- // ----------------------------------------------------------------
- /** Generates a mesh from an array of vertex positions.
- *
- * @param positions List of vertex positions
- * @param numIndices Number of indices per primitive
- * @return Output mesh
- */
- static aiMesh* MakeMesh(const std::vector<aiVector3D>& positions,
- unsigned int numIndices);
-
-
- static aiMesh* MakeMesh ( unsigned int (*GenerateFunc)
- (std::vector<aiVector3D>&));
-
- static aiMesh* MakeMesh ( unsigned int (*GenerateFunc)
- (std::vector<aiVector3D>&, bool));
-
- static aiMesh* MakeMesh ( unsigned int n, void (*GenerateFunc)
- (unsigned int,std::vector<aiVector3D>&));
-
- // ----------------------------------------------------------------
- /** @brief Generates a hexahedron (cube)
- *
- * Hexahedrons can be scaled on all axes.
- * @param positions Receives output triangles.
- * @param polygons If you pass true here quads will be returned
- * @return Number of vertices per face
- */
- static unsigned int MakeHexahedron(
- std::vector<aiVector3D>& positions,
- bool polygons = false);
-
- // ----------------------------------------------------------------
- /** @brief Generates an icosahedron
- *
- * @param positions Receives output triangles.
- * @return Number of vertices per face
- */
- static unsigned int MakeIcosahedron(
- std::vector<aiVector3D>& positions);
-
-
- // ----------------------------------------------------------------
- /** @brief Generates a dodecahedron
- *
- * @param positions Receives output triangles
- * @param polygons If you pass true here pentagons will be returned
- * @return Number of vertices per face
- */
- static unsigned int MakeDodecahedron(
- std::vector<aiVector3D>& positions,
- bool polygons = false);
-
-
- // ----------------------------------------------------------------
- /** @brief Generates an octahedron
- *
- * @param positions Receives output triangles.
- * @return Number of vertices per face
- */
- static unsigned int MakeOctahedron(
- std::vector<aiVector3D>& positions);
-
-
- // ----------------------------------------------------------------
- /** @brief Generates a tetrahedron
- *
- * @param positions Receives output triangles.
- * @return Number of vertices per face
- */
- static unsigned int MakeTetrahedron(
- std::vector<aiVector3D>& positions);
-
-
-
- // ----------------------------------------------------------------
- /** @brief Generates a sphere
- *
- * @param tess Number of subdivions - 0 generates a octahedron
- * @param positions Receives output triangles.
- */
- static void MakeSphere(unsigned int tess,
- std::vector<aiVector3D>& positions);
-
-
- // ----------------------------------------------------------------
- /** @brief Generates a cone or a cylinder, either open or closed.
- *
- * @code
- *
- * |-----| <- radius 1
- *
- * __x__ <- ] ^
- * / \ | height |
- * / \ | Y
- * / \ |
- * / \ |
- * /______x______\ <- ] <- end cap
- *
- * |-------------| <- radius 2
- *
- * @endcode
- *
- * @param height Height of the cone
- * @param radius1 First radius
- * @param radius2 Second radius
- * @param tess Number of triangles.
- * @param bOpened true for an open cone/cylinder. An open shape has
- * no 'end caps'
- * @param positions Receives output triangles
- */
- static void MakeCone(float height,float radius1,
- float radius2,unsigned int tess,
- std::vector<aiVector3D>& positions,bool bOpen= false);
-
-
- // ----------------------------------------------------------------
- /** @brief Generates a flat circle
- *
- * The circle is constructed in the planed formed by the x,z
- * axes of the cartesian coordinate system.
- *
- * @param radius Radius of the circle
- * @param tess Number of segments.
- * @param positions Receives output triangles.
- */
- static void MakeCircle(float radius, unsigned int tess,
- std::vector<aiVector3D>& positions);
-
-};
-} // ! Assimp
-
-#endif // !! AI_STANDARD_SHAPES_H_INC
diff --git a/3rdparty/assimp/code/StdOStreamLogStream.h b/3rdparty/assimp/code/StdOStreamLogStream.h
deleted file mode 100644
index 653dbf42..00000000
--- a/3rdparty/assimp/code/StdOStreamLogStream.h
+++ /dev/null
@@ -1,52 +0,0 @@
-#ifndef AI_STROSTREAMLOGSTREAM_H_INC
-#define AI_STROSTREAMLOGSTREAM_H_INC
-
-#include "../include/LogStream.h"
-#include <ostream>
-
-namespace Assimp {
-
-// ---------------------------------------------------------------------------
-/** @class StdOStreamLogStream
- * @brief Logs into a std::ostream
- */
-class StdOStreamLogStream : public LogStream
-{
-public:
- /** @brief Construction from an existing std::ostream
- * @param _ostream Output stream to be used
- */
- StdOStreamLogStream(std::ostream& _ostream);
-
- /** @brief Destructor */
- ~StdOStreamLogStream();
-
- /** @brief Writer */
- void write(const char* message);
-private:
- std::ostream& ostream;
-};
-
-// ---------------------------------------------------------------------------
-// Default constructor
-inline StdOStreamLogStream::StdOStreamLogStream(std::ostream& _ostream)
- : ostream (_ostream)
-{}
-
-// ---------------------------------------------------------------------------
-// Default constructor
-inline StdOStreamLogStream::~StdOStreamLogStream()
-{}
-
-// ---------------------------------------------------------------------------
-// Write method
-inline void StdOStreamLogStream::write(const char* message)
-{
- ostream << message;
- ostream.flush();
-}
-
-// ---------------------------------------------------------------------------
-} // Namespace Assimp
-
-#endif // guard
diff --git a/3rdparty/assimp/code/StreamReader.h b/3rdparty/assimp/code/StreamReader.h
deleted file mode 100644
index 2f42d5e9..00000000
--- a/3rdparty/assimp/code/StreamReader.h
+++ /dev/null
@@ -1,384 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file Defines the StreamReader class which reads data from
- * a binary stream with a well-defined endianess. */
-
-#ifndef AI_STREAMREADER_H_INCLUDED
-#define AI_STREAMREADER_H_INCLUDED
-
-#include "ByteSwap.h"
-namespace Assimp {
- namespace Intern {
-
-// --------------------------------------------------------------------------------------------
-template <typename T, bool doit>
-struct ByteSwapper {
- void operator() (T* inout) {
- ByteSwap::Swap(inout);
- }
-};
-
-template <typename T>
-struct ByteSwapper<T,false> {
- void operator() (T*) {
- }
-};
-
-// --------------------------------------------------------------------------------------------
-template <bool SwapEndianess, typename T, bool RuntimeSwitch>
-struct Getter {
- void operator() (T* inout, bool le) {
-#ifdef AI_BUILD_BIG_ENDIAN
- le = le;
-#else
- le = !le;
-#endif
- if (le) {
- ByteSwapper<T,(sizeof(T)>1?true:false)> () (inout);
- }
- else ByteSwapper<T,false> () (inout);
- }
-};
-
-template <bool SwapEndianess, typename T>
-struct Getter<SwapEndianess,T,false> {
- void operator() (T* inout, bool le) {
-
- // static branch
- ByteSwapper<T,(SwapEndianess && sizeof(T)>1)> () (inout);
- }
-};
-} // end Intern
-
-// --------------------------------------------------------------------------------------------
-/** Wrapper class around IOStream to allow for consistent reading of binary data in both
- * little and big endian format. Don't attempt to instance the template directly. Use
- * StreamReaderLE to read from a little-endian stream and StreamReaderBE to read from a
- * BE stream. The class expects that the endianess of any input data is known at
- * compile-time, which should usually be true (#BaseImporter::ConvertToUTF8 implements
- * runtime endianess conversions for text files).
- *
- * XXX switch from unsigned int for size types to size_t? or ptrdiff_t?*/
-// --------------------------------------------------------------------------------------------
-template <bool SwapEndianess = false, bool RuntimeSwitch = false>
-class StreamReader
-{
-
-public:
-
- // FIXME: use these data types throughout the whole library,
- // then change them to 64 bit values :-)
-
- typedef int diff;
- typedef unsigned int pos;
-
-public:
-
-
- // ---------------------------------------------------------------------
- /** Construction from a given stream with a well-defined endianess.
- *
- * The StreamReader holds a permanent strong reference to the
- * stream, which is released upon destruction.
- * @param stream Input stream. The stream is not restarted if
- * its file pointer is not at 0. Instead, the stream reader
- * reads from the current position to the end of the stream.
- * @param le If @c RuntimeSwitch is true: specifies whether the
- * stream is in little endian byte order. Otherwise the
- * endianess information is contained in the @c SwapEndianess
- * template parameter and this parameter is meaningless. */
- StreamReader(boost::shared_ptr<IOStream> stream, bool le = false)
- : stream(stream)
- , le(le)
- {
- _Begin();
- }
-
- // ---------------------------------------------------------------------
- StreamReader(IOStream* stream, bool le = false)
- : stream(boost::shared_ptr<IOStream>(stream))
- , le(le)
- {
- _Begin();
- }
-
- // ---------------------------------------------------------------------
- ~StreamReader() {
- delete[] buffer;
- }
-
-public:
-
- // deprecated, use overloaded operator>> instead
-
- // ---------------------------------------------------------------------
- /** Read a float from the stream */
- float GetF4()
- {
- return Get<float>();
- }
-
- // ---------------------------------------------------------------------
- /** Read a double from the stream */
- double GetF8() {
- return Get<double>();
- }
-
- // ---------------------------------------------------------------------
- /** Read a signed 16 bit integer from the stream */
- int16_t GetI2() {
- return Get<int16_t>();
- }
-
- // ---------------------------------------------------------------------
- /** Read a signed 8 bit integer from the stream */
- int8_t GetI1() {
- return Get<int8_t>();
- }
-
- // ---------------------------------------------------------------------
- /** Read an signed 32 bit integer from the stream */
- int32_t GetI4() {
- return Get<int32_t>();
- }
-
- // ---------------------------------------------------------------------
- /** Read a signed 64 bit integer from the stream */
- int64_t GetI8() {
- return Get<int64_t>();
- }
-
- // ---------------------------------------------------------------------
- /** Read a unsigned 16 bit integer from the stream */
- uint16_t GetU2() {
- return Get<uint16_t>();
- }
-
- // ---------------------------------------------------------------------
- /** Read a unsigned 8 bit integer from the stream */
- uint8_t GetU1() {
- return Get<uint8_t>();
- }
-
- // ---------------------------------------------------------------------
- /** Read an unsigned 32 bit integer from the stream */
- uint32_t GetU4() {
- return Get<uint32_t>();
- }
-
- // ---------------------------------------------------------------------
- /** Read a unsigned 64 bit integer from the stream */
- uint64_t GetU8() {
- return Get<uint64_t>();
- }
-
-public:
-
- // ---------------------------------------------------------------------
- /** Get the remaining stream size (to the end of the srream) */
- unsigned int GetRemainingSize() const {
- return (unsigned int)(end - current);
- }
-
-
- // ---------------------------------------------------------------------
- /** Get the remaining stream size (to the current read limit). The
- * return value is the remaining size of the stream if no custom
- * read limit has been set. */
- unsigned int GetRemainingSizeToLimit() const {
- return (unsigned int)(limit - current);
- }
-
-
- // ---------------------------------------------------------------------
- /** Increase the file pointer (relative seeking) */
- void IncPtr(int plus) {
- current += plus;
- if (current > limit) {
- throw DeadlyImportError("End of file or read limit was reached");
- }
- }
-
- // ---------------------------------------------------------------------
- /** Get the current file pointer */
- int8_t* GetPtr() const {
- return current;
- }
-
-
- // ---------------------------------------------------------------------
- /** Set current file pointer (Get it from #GetPtr). This is if you
- * prefer to do pointer arithmetics on your own or want to copy
- * large chunks of data at once.
- * @param p The new pointer, which is validated against the size
- * limit and buffer boundaries. */
- void SetPtr(int8_t* p) {
-
- current = p;
- if (current > limit || current < buffer) {
- throw DeadlyImportError("End of file or read limit was reached");
- }
- }
-
- // ---------------------------------------------------------------------
- /** Copy n bytes to an external buffer
- * @param out Destination for copying
- * @param bytes Number of bytes to copy */
- void CopyAndAdvance(void* out, size_t bytes) {
-
- int8_t* ur = GetPtr();
- SetPtr(ur+bytes); // fire exception if eof
-
- memcpy(out,ur,bytes);
- }
-
-
- // ---------------------------------------------------------------------
- /** Get the current offset from the beginning of the file */
- int GetCurrentPos() const {
- return (unsigned int)(current - buffer);
- }
-
- void SetCurrentPos(size_t pos) {
- SetPtr(buffer + pos);
- }
-
- // ---------------------------------------------------------------------
- /** Setup a temporary read limit
- *
- * @param limit Maximum number of bytes to be read from
- * the beginning of the file. Passing 0xffffffff
- * resets the limit to the original end of the stream. */
- void SetReadLimit(unsigned int _limit) {
-
- if (0xffffffff == _limit) {
- limit = end;
- return;
- }
-
- limit = buffer + _limit;
- if (limit > end) {
- throw DeadlyImportError("StreamReader: Invalid read limit");
- }
- }
-
- // ---------------------------------------------------------------------
- /** Get the current read limit in bytes. Reading over this limit
- * accidentially raises an exception. */
- int GetReadLimit() const {
- return (unsigned int)(limit - buffer);
- }
-
- // ---------------------------------------------------------------------
- /** Skip to the read limit in bytes. Reading over this limit
- * accidentially raises an exception. */
- void SkipToReadLimit() {
- current = limit;
- }
-
- // ---------------------------------------------------------------------
- /** overload operator>> and allow chaining of >> ops. */
- template <typename T>
- StreamReader& operator >> (T& f) {
- f = Get<T>();
- return *this;
- }
-
-private:
-
- // ---------------------------------------------------------------------
- /** Generic read method. ByteSwap::Swap(T*) *must* be defined */
- template <typename T>
- T Get() {
- if (current + sizeof(T) > limit) {
- throw DeadlyImportError("End of file or stream limit was reached");
- }
-
- T f = *((const T*)current);
- Intern :: Getter<SwapEndianess,T,RuntimeSwitch>() (&f,le);
-
- current += sizeof(T);
- return f;
- }
-
- // ---------------------------------------------------------------------
- void _Begin() {
- if (!stream) {
- throw DeadlyImportError("StreamReader: Unable to open file");
- }
-
- const size_t s = stream->FileSize() - stream->Tell();
- if (!s) {
- throw DeadlyImportError("StreamReader: File is empty or EOF is already reached");
- }
-
- current = buffer = new int8_t[s];
- stream->Read(current,s,1);
- end = limit = &buffer[s];
- }
-
-private:
-
-
- boost::shared_ptr<IOStream> stream;
- int8_t *buffer, *current, *end, *limit;
- bool le;
-};
-
-
-// --------------------------------------------------------------------------------------------
-// `static` StreamReaders. Their byte order is fixed and they might be a little bit faster.
-#ifdef AI_BUILD_BIG_ENDIAN
- typedef StreamReader<true> StreamReaderLE;
- typedef StreamReader<false> StreamReaderBE;
-#else
- typedef StreamReader<true> StreamReaderBE;
- typedef StreamReader<false> StreamReaderLE;
-#endif
-
-// `dynamic` StreamReader. The byte order of the input data is specified in the
-// c'tor. This involves runtime branching and might be a little bit slower.
-typedef StreamReader<true,true> StreamReaderAny;
-
-} // end namespace Assimp
-
-#endif // !! AI_STREAMREADER_H_INCLUDED
diff --git a/3rdparty/assimp/code/StringComparison.h b/3rdparty/assimp/code/StringComparison.h
deleted file mode 100644
index ed79874c..00000000
--- a/3rdparty/assimp/code/StringComparison.h
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file Definition of platform independent string workers:
-
- ASSIMP_itoa10
- ASSIMP_stricmp
- ASSIMP_strincmp
-
- These functions are not consistently available on all platforms,
- or the provided implementations behave too differently.
-*/
-#ifndef INCLUDED_AI_STRING_WORKERS_H
-#define INCLUDED_AI_STRING_WORKERS_H
-
-namespace Assimp {
-
-// -------------------------------------------------------------------------------
-/** @brief itoa with a fixed base 10
- * 'itoa' is not consistently available on all platforms so it is quite useful
- * to have a small replacement function here. No need to use a full sprintf()
- * if we just want to print a number ...
- * @param out Output buffer
- * @param max Maximum number of characters to be written, including '\0'.
- * This parameter may not be 0.
- * @param number Number to be written
- * @return Length of the output string, excluding the '\0'
- */
-inline unsigned int ASSIMP_itoa10( char* out, unsigned int max, int32_t number)
-{
- ai_assert(NULL != out);
-
- // write the unary minus to indicate we have a negative number
- unsigned int written = 1u;
- if (number < 0 && written < max) {
- *out++ = '-';
- ++written;
- number = -number;
- }
-
- // We begin with the largest number that is not zero.
- int32_t cur = 1000000000; // 2147483648
- bool mustPrint = false;
- while (written < max) {
-
- const unsigned int digit = number / cur;
- if (mustPrint || digit > 0 || 1 == cur) {
- // print all future zeroes from now
- mustPrint = true;
-
- *out++ = '0'+digit;
-
- ++written;
- number -= digit*cur;
- if (1 == cur) {
- break;
- }
- }
- cur /= 10;
- }
-
- // append a terminal zero
- *out++ = '\0';
- return written-1;
-}
-
-// -------------------------------------------------------------------------------
-/** @brief itoa with a fixed base 10 (Secure template overload)
- * The compiler should choose this function if he or she is able to determine the
- * size of the array automatically.
- */
-template <size_t length>
-inline unsigned int ASSIMP_itoa10( char(& out)[length], int32_t number)
-{
- return ASSIMP_itoa10(out,length,number);
-}
-
-// -------------------------------------------------------------------------------
-/** @brief Helper function to do platform independent string comparison.
- *
- * This is required since stricmp() is not consistently available on
- * all platforms. Some platforms use the '_' prefix, others don't even
- * have such a function.
- *
- * @param s1 First input string
- * @param s2 Second input string
- * @return 0 if the given strings are identical
- */
-inline int ASSIMP_stricmp(const char *s1, const char *s2)
-{
- ai_assert(NULL != s1 && NULL != s2);
-
-#if (defined _MSC_VER)
-
- return ::_stricmp(s1,s2);
-#elif defined( __GNUC__ )
-
- return ::strcasecmp(s1,s2);
-#else
-
- register char c1, c2;
- do {
- c1 = tolower(*s1++);
- c2 = tolower(*s2++);
- }
- while ( c1 && (c1 == c2) );
- return c1 - c2;
-#endif
-}
-
-// -------------------------------------------------------------------------------
-/** @brief Case independent comparison of two std::strings
- *
- * @param a First string
- * @param b Second string
- * @return 0 if a == b
- */
-inline int ASSIMP_stricmp(const std::string& a, const std::string& b)
-{
- register int i = (int)b.length()-(int)a.length();
- return (i ? i : ASSIMP_stricmp(a.c_str(),b.c_str()));
-}
-
-// -------------------------------------------------------------------------------
-/** @brief Helper function to do platform independent string comparison.
- *
- * This is required since strincmp() is not consistently available on
- * all platforms. Some platforms use the '_' prefix, others don't even
- * have such a function.
- *
- * @param s1 First input string
- * @param s2 Second input string
- * @param n Macimum number of characters to compare
- * @return 0 if the given strings are identical
- */
-inline int ASSIMP_strincmp(const char *s1, const char *s2, unsigned int n)
-{
- ai_assert(NULL != s1 && NULL != s2);
- if (!n)return 0;
-
-#if (defined _MSC_VER)
-
- return ::_strnicmp(s1,s2,n);
-
-#elif defined( __GNUC__ )
-
- return ::strncasecmp(s1,s2, n);
-
-#else
- register char c1, c2;
- unsigned int p = 0;
- do
- {
- if (p++ >= n)return 0;
- c1 = tolower(*s1++);
- c2 = tolower(*s2++);
- }
- while ( c1 && (c1 == c2) );
-
- return c1 - c2;
-#endif
-}
-
-
-// -------------------------------------------------------------------------------
-/** @brief Evaluates an integer power
- *
- * todo: move somewhere where it fits better in than here
- */
-inline unsigned int integer_pow (unsigned int base, unsigned int power)
-{
- unsigned int res = 1;
- for (unsigned int i = 0; i < power;++i)
- res *= base;
-
- return res;
-}
-} // end of namespace
-
-#endif // ! AI_STRINGCOMPARISON_H_INC
diff --git a/3rdparty/assimp/code/Subdivision.cpp b/3rdparty/assimp/code/Subdivision.cpp
deleted file mode 100644
index 2ed204c6..00000000
--- a/3rdparty/assimp/code/Subdivision.cpp
+++ /dev/null
@@ -1,587 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-#include "AssimpPCH.h"
-
-#include "Subdivision.h"
-#include "SceneCombiner.h"
-#include "SpatialSort.h"
-#include "ProcessHelper.h"
-#include "Vertex.h"
-
-using namespace Assimp;
-void mydummy() {}
-
-// ------------------------------------------------------------------------------------------------
-/** Subdivider stub class to implement the Catmull-Clarke subdivision algorithm. The
- * implementation is basing on recursive refinement. Directly evaluating the result is also
- * possibel and much quicker, but it depends on lengthy matrix lookup tables. */
-// ------------------------------------------------------------------------------------------------
-class CatmullClarkSubdivider : public Subdivider
-{
-
-public:
-
- void Subdivide (const aiMesh* mesh, aiMesh*& out, unsigned int num, bool discard_input);
- void Subdivide (const aiMesh* const * smesh, size_t nmesh,
- aiMesh** out, unsigned int num, bool discard_input);
-
- // ---------------------------------------------------------------------------
- /** Intermediate description of an edge between two corners of a polygon*/
- // ---------------------------------------------------------------------------
- struct Edge
- {
- Edge()
- : ref(0)
- {}
- Vertex edge_point, midpoint;
- unsigned int ref;
- };
-
-
-
- typedef std::vector<unsigned int> UIntVector;
- typedef std::map<uint64_t,Edge> EdgeMap;
-
- // ---------------------------------------------------------------------------
- // Hashing function to derive an index into an #EdgeMap from two given
- // 'unsigned int' vertex coordinates (!!distinct coordinates - same
- // vertex position == same index!!).
- // NOTE - this leads to rare hash collisions if a) sizeof(unsigned int)>4
- // and (id[0]>2^32-1 or id[0]>2^32-1).
- // MAKE_EDGE_HASH() uses temporaries, so INIT_EDGE_HASH() needs to be put
- // at the head of every function which is about to use MAKE_EDGE_HASH().
- // Reason is that the hash is that hash construction needs to hold the
- // invariant id0<id1 to identify an edge - else two hashes would refer
- // to the same edge.
- // ---------------------------------------------------------------------------
-#define MAKE_EDGE_HASH(id0,id1) (eh_tmp0__=id0,eh_tmp1__=id1,\
- (eh_tmp0__<eh_tmp1__?std::swap(eh_tmp0__,eh_tmp1__):mydummy()),(uint64_t)eh_tmp0__^((uint64_t)eh_tmp1__<<32u))
-
-
-#define INIT_EDGE_HASH_TEMPORARIES()\
- unsigned int eh_tmp0__, eh_tmp1__;
-
-private:
-
- void InternSubdivide (const aiMesh* const * smesh,
- size_t nmesh,aiMesh** out, unsigned int num);
-};
-
-
-// ------------------------------------------------------------------------------------------------
-// Construct a subdivider of a specific type
-Subdivider* Subdivider::Create (Algorithm algo)
-{
- switch (algo)
- {
- case CATMULL_CLARKE:
- return new CatmullClarkSubdivider();
- };
-
- ai_assert(false);
- return NULL; // shouldn't happen
-}
-
-// ------------------------------------------------------------------------------------------------
-// Call the Catmull Clark subdivision algorithm for one mesh
-void CatmullClarkSubdivider::Subdivide (
- const aiMesh* mesh,
- aiMesh*& out,
- unsigned int num,
- bool discard_input
- )
-{
- assert(mesh != out);
- Subdivide(&mesh,1,&out,num,discard_input);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Call the Catmull Clark subdivision algorithm for multiple meshes
-void CatmullClarkSubdivider::Subdivide (
- const aiMesh* const * smesh,
- size_t nmesh,
- aiMesh** out,
- unsigned int num,
- bool discard_input
- )
-{
- ai_assert(NULL != smesh && NULL != out);
-
- // course, both regions may not overlap
- assert(smesh<out || smesh+nmesh>out+nmesh);
- if (!num) {
-
- // No subdivision at all. Need to copy all the meshes .. argh.
- if (discard_input) {
- for (size_t s = 0; s < nmesh; ++s) {
- out[s] = const_cast<aiMesh*>( smesh[s] );
- const_cast<aiMesh*&>( smesh[s] ) = NULL;
- }
- }
- else {
- for (size_t s = 0; s < nmesh; ++s) {
- SceneCombiner::Copy(out+s,smesh[s]);
- }
- }
- return;
- }
-
- std::vector<const aiMesh*> inmeshes;
- std::vector<aiMesh*> outmeshes;
- std::vector<unsigned int> maptbl;
-
- inmeshes.reserve(nmesh);
- outmeshes.reserve(nmesh);
- maptbl.reserve(nmesh);
-
- // Remove pure line and point meshes from the working set to reduce the
- // number of edge cases the subdivider is forced to deal with. Line and
- // point meshes are simply passed through.
- for (size_t s = 0; s < nmesh; ++s) {
- const aiMesh* i = smesh[s];
- // FIX - mPrimitiveTypes might not yet be initialized
- if (i->mPrimitiveTypes && (i->mPrimitiveTypes & (aiPrimitiveType_LINE|aiPrimitiveType_POINT))==i->mPrimitiveTypes) {
- DefaultLogger::get()->debug("Catmull-Clark Subdivider: Skipping pure line/point mesh");
-
- if (discard_input) {
- out[s] = const_cast<aiMesh*>( i );
- const_cast<aiMesh*&>( smesh[s] ) = NULL;
- }
- else {
- SceneCombiner::Copy(out+s,i);
- }
- continue;
- }
-
- outmeshes.push_back(NULL);inmeshes.push_back(i);
- maptbl.push_back(s);
- }
-
- // Do the actual subdivision on the preallocated storage. InternSubdivide
- // *always* assumes that enough storage is available, it does not bother
- // checking any ranges.
- ai_assert(inmeshes.size()==outmeshes.size()&&inmeshes.size()==maptbl.size());
- if (inmeshes.empty()) {
- DefaultLogger::get()->warn("Catmull-Clark Subdivider: Pure point/line scene, I can't do anything");
- return;
- }
- InternSubdivide(&inmeshes.front(),inmeshes.size(),&outmeshes.front(),num);
- for (unsigned int i = 0; i < maptbl.size(); ++i) {
- ai_assert(outmeshes[i]);
- out[maptbl[i]] = outmeshes[i];
- }
-
- if (discard_input) {
- for (size_t s = 0; s < nmesh; ++s) {
- delete smesh[s];
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Note - this is an implementation of the standard (recursive) Cm-Cl algorithm without further
-// optimizations (except we're using some nice LUTs). A description of the algorithm can be found
-// here: http://en.wikipedia.org/wiki/Catmull-Clark_subdivision_surface
-//
-// The code is mostly O(n), however parts are O(nlogn) which is therefore the algorithm's
-// expected total runtime complexity. The implementation is able to work in-place on the same
-// mesh arrays. Calling #InternSubdivide() directly is not encouraged. The code can operate
-// in-place unless 'smesh' and 'out' are equal (no strange overlaps or reorderings).
-// Previous data is replaced/deleted then.
-// ------------------------------------------------------------------------------------------------
-void CatmullClarkSubdivider::InternSubdivide (
- const aiMesh* const * smesh,
- size_t nmesh,
- aiMesh** out,
- unsigned int num
- )
-{
- ai_assert(NULL != smesh && NULL != out);
- INIT_EDGE_HASH_TEMPORARIES();
-
- // no subdivision requested or end of recursive refinement
- if (!num) {
- return;
- }
-
- UIntVector maptbl;
- SpatialSort spatial;
-
- // ---------------------------------------------------------------------
- // 0. Offset table to index all meshes continously , generate a spatially
- // sorted representation of all vertices in all meshes.
- // ---------------------------------------------------------------------
- typedef std::pair<unsigned int,unsigned int> IntPair;
- std::vector<IntPair> moffsets(nmesh);
- unsigned int totfaces = 0, totvert = 0;
- for (size_t t = 0; t < nmesh; ++t) {
- const aiMesh* mesh = smesh[t];
-
- spatial.Append(mesh->mVertices,mesh->mNumVertices,sizeof(aiVector3D),false);
- moffsets[t] = IntPair(totfaces,totvert);
-
- totfaces += mesh->mNumFaces;
- totvert += mesh->mNumVertices;
- }
-
- spatial.Finalize();
- const unsigned int num_unique = spatial.GenerateMappingTable(maptbl,ComputePositionEpsilon(smesh,nmesh));
-
-
-#define FLATTEN_VERTEX_IDX(mesh_idx, vert_idx) (moffsets[mesh_idx].second+vert_idx)
-#define FLATTEN_FACE_IDX(mesh_idx, face_idx) (moffsets[mesh_idx].first+face_idx)
-
- // ---------------------------------------------------------------------
- // 1. Compute the centroid point for all faces
- // ---------------------------------------------------------------------
- std::vector<Vertex> centroids(totfaces);
- unsigned int nfacesout = 0;
- for (size_t t = 0, n = 0; t < nmesh; ++t) {
- const aiMesh* mesh = smesh[t];
- for (unsigned int i = 0; i < mesh->mNumFaces;++i,++n)
- {
- const aiFace& face = mesh->mFaces[i];
- Vertex& c = centroids[n];
-
- for (unsigned int a = 0; a < face.mNumIndices;++a) {
- c += Vertex(mesh,face.mIndices[a]);
- }
-
- c /= static_cast<float>(face.mNumIndices);
- nfacesout += face.mNumIndices;
- }
- }
-
- EdgeMap edges;
-
- // ---------------------------------------------------------------------
- // 2. Set each edge point to be the average of all neighbouring
- // face points and original points. Every edge exists twice
- // if there is a neighboring face.
- // ---------------------------------------------------------------------
- for (size_t t = 0; t < nmesh; ++t) {
- const aiMesh* mesh = smesh[t];
-
- for (unsigned int i = 0; i < mesh->mNumFaces;++i) {
- const aiFace& face = mesh->mFaces[i];
-
- for (unsigned int p =0; p< face.mNumIndices; ++p) {
- const unsigned int id[] = {
- face.mIndices[p],
- face.mIndices[p==face.mNumIndices-1?0:p+1]
- };
- const unsigned int mp[] = {
- maptbl[FLATTEN_VERTEX_IDX(t,id[0])],
- maptbl[FLATTEN_VERTEX_IDX(t,id[1])]
- };
-
- Edge& e = edges[MAKE_EDGE_HASH(mp[0],mp[1])];
- e.ref++;
- if (e.ref<=2) {
- if (e.ref==1) { // original points (end points) - add only once
- e.edge_point = e.midpoint = Vertex(mesh,id[0])+Vertex(mesh,id[1]);
- e.midpoint *= 0.5f;
- }
- e.edge_point += centroids[FLATTEN_FACE_IDX(t,i)];
- }
- }
- }
- }
-
- // ---------------------------------------------------------------------
- // 3. Normalize edge points
- // ---------------------------------------------------------------------
- {unsigned int bad_cnt = 0;
- for (EdgeMap::iterator it = edges.begin(); it != edges.end(); ++it) {
- if ((*it).second.ref < 2) {
- ai_assert((*it).second.ref);
- ++bad_cnt;
- }
- (*it).second.edge_point *= 1.f/((*it).second.ref+2.f);
- }
-
- if (bad_cnt) {
- // Report the number of bad edges. bad edges are referenced by less than two
- // faces in the mesh. They occur at outer model boundaries in non-closed
- // shapes.
- char tmp[512];
- sprintf(tmp,"Catmull-Clark Subdivider: got %u bad edges touching only one face (totally %u edges). ",
- bad_cnt,static_cast<unsigned int>(edges.size()));
-
- DefaultLogger::get()->debug(tmp);
- }}
-
- // ---------------------------------------------------------------------
- // 4. Compute a vertex-face adjacency table. We can't reuse the code
- // from VertexTriangleAdjacency because we need the table for multiple
- // meshes and out vertex indices need to be mapped to distinct values
- // first.
- // ---------------------------------------------------------------------
- UIntVector faceadjac(nfacesout), cntadjfac(maptbl.size(),0), ofsadjvec(maptbl.size()+1,0); {
- for (size_t t = 0; t < nmesh; ++t) {
- const aiMesh* const minp = smesh[t];
- for (unsigned int i = 0; i < minp->mNumFaces; ++i) {
-
- const aiFace& f = minp->mFaces[i];
- for (unsigned int n = 0; n < f.mNumIndices; ++n) {
- ++cntadjfac[maptbl[FLATTEN_VERTEX_IDX(t,f.mIndices[n])]];
- }
- }
- }
- unsigned int cur = 0;
- for (size_t i = 0; i < cntadjfac.size(); ++i) {
- ofsadjvec[i+1] = cur;
- cur += cntadjfac[i];
- }
- for (size_t t = 0; t < nmesh; ++t) {
- const aiMesh* const minp = smesh[t];
- for (unsigned int i = 0; i < minp->mNumFaces; ++i) {
-
- const aiFace& f = minp->mFaces[i];
- for (unsigned int n = 0; n < f.mNumIndices; ++n) {
- faceadjac[ofsadjvec[1+maptbl[FLATTEN_VERTEX_IDX(t,f.mIndices[n])]]++] = FLATTEN_FACE_IDX(t,i);
- }
- }
- }
-
- // check the other way round for consistency
-#ifdef _DEBUG
-
- for (size_t t = 0; t < ofsadjvec.size()-1; ++t) {
- for (unsigned int m = 0; m < cntadjfac[t]; ++m) {
- const unsigned int fidx = faceadjac[ofsadjvec[t]+m];
- ai_assert(fidx < totfaces);
- for (size_t n = 1; n < nmesh; ++n) {
-
- if (moffsets[n].first > fidx) {
- const aiMesh* msh = smesh[--n];
- const aiFace& f = msh->mFaces[fidx-moffsets[n].first];
-
- bool haveit = false;
- for (unsigned int i = 0; i < f.mNumIndices; ++i) {
- if (maptbl[FLATTEN_VERTEX_IDX(n,f.mIndices[i])]==(unsigned int)t) {
- haveit = true; break;
- }
- }
- ai_assert(haveit);
- break;
- }
- }
- }
- }
-
-#endif
- }
-
-#define GET_ADJACENT_FACES_AND_CNT(vidx,fstartout,numout) \
- fstartout = &faceadjac[ofsadjvec[vidx]], numout = cntadjfac[vidx]
-
- typedef std::pair<bool,Vertex> TouchedOVertex;
- std::vector<TouchedOVertex > new_points(num_unique,TouchedOVertex(false,Vertex()));
- // ---------------------------------------------------------------------
- // 5. Spawn a quad from each face point to the corresponding edge points
- // the original points being the fourth quad points.
- // ---------------------------------------------------------------------
- for (size_t t = 0; t < nmesh; ++t) {
- const aiMesh* const minp = smesh[t];
- aiMesh* const mout = out[t] = new aiMesh();
-
- for (unsigned int a = 0; a < minp->mNumFaces; ++a) {
- mout->mNumFaces += minp->mFaces[a].mNumIndices;
- }
-
- // We need random access to the old face buffer, so reuse is not possible.
- mout->mFaces = new aiFace[mout->mNumFaces];
-
- mout->mNumVertices = mout->mNumFaces*4;
- mout->mVertices = new aiVector3D[mout->mNumVertices];
-
- // quads only, keep material index
- mout->mPrimitiveTypes = aiPrimitiveType_POLYGON;
- mout->mMaterialIndex = minp->mMaterialIndex;
-
- if (minp->HasNormals()) {
- mout->mNormals = new aiVector3D[mout->mNumVertices];
- }
-
- if (minp->HasTangentsAndBitangents()) {
- mout->mTangents = new aiVector3D[mout->mNumVertices];
- mout->mBitangents = new aiVector3D[mout->mNumVertices];
- }
-
- for (unsigned int i = 0; minp->HasTextureCoords(i); ++i) {
- mout->mTextureCoords[i] = new aiVector3D[mout->mNumVertices];
- mout->mNumUVComponents[i] = minp->mNumUVComponents[i];
- }
-
- for (unsigned int i = 0; minp->HasVertexColors(i); ++i) {
- mout->mColors[i] = new aiColor4D[mout->mNumVertices];
- }
-
- mout->mNumVertices = mout->mNumFaces<<2u;
- for (unsigned int i = 0, v = 0, n = 0; i < minp->mNumFaces;++i) {
-
- const aiFace& face = minp->mFaces[i];
- for (unsigned int a = 0; a < face.mNumIndices;++a) {
-
- // Get a clean new face.
- aiFace& faceOut = mout->mFaces[n++];
- faceOut.mIndices = new unsigned int [faceOut.mNumIndices = 4];
-
- // Spawn a new quadrilateral (ccw winding) for this original point between:
- // a) face centroid
- centroids[FLATTEN_FACE_IDX(t,i)].SortBack(mout,faceOut.mIndices[0]=v++);
-
- // b) adjacent edge on the left, seen from the centroid
- const Edge& e0 = edges[MAKE_EDGE_HASH(maptbl[FLATTEN_VERTEX_IDX(t,face.mIndices[a])],
- maptbl[FLATTEN_VERTEX_IDX(t,face.mIndices[a==face.mNumIndices-1?0:a+1])
- ])]; // fixme: replace with mod face.mNumIndices?
-
- // c) adjacent edge on the right, seen from the centroid
- const Edge& e1 = edges[MAKE_EDGE_HASH(maptbl[FLATTEN_VERTEX_IDX(t,face.mIndices[a])],
- maptbl[FLATTEN_VERTEX_IDX(t,face.mIndices[!a?face.mNumIndices-1:a-1])
- ])]; // fixme: replace with mod face.mNumIndices?
-
- e0.edge_point.SortBack(mout,faceOut.mIndices[3]=v++);
- e1.edge_point.SortBack(mout,faceOut.mIndices[1]=v++);
-
- // d= original point P with distinct index i
- // F := 0
- // R := 0
- // n := 0
- // for each face f containing i
- // F := F+ centroid of f
- // R := R+ midpoint of edge of f from i to i+1
- // n := n+1
- //
- // (F+2R+(n-3)P)/n
- const unsigned int org = maptbl[FLATTEN_VERTEX_IDX(t,face.mIndices[a])];
- TouchedOVertex& ov = new_points[org];
-
- if (!ov.first) {
- ov.first = true;
-
- const unsigned int* adj; unsigned int cnt;
- GET_ADJACENT_FACES_AND_CNT(org,adj,cnt);
-
- if (cnt < 3) {
- ov.second = Vertex(minp,face.mIndices[a]);
- }
- else {
-
- Vertex F,R;
- for (unsigned int o = 0; o < cnt; ++o) {
- ai_assert(adj[o] < totfaces);
- F += centroids[adj[o]];
-
- // adj[0] is a global face index - search the face in the mesh list
- const aiMesh* mp = NULL;
- size_t nidx;
-
- if (adj[o] < moffsets[0].first) {
- mp = smesh[nidx=0];
- }
- else {
- for (nidx = 1; nidx<= nmesh; ++nidx) {
- if (nidx == nmesh ||moffsets[nidx].first > adj[o]) {
- mp = smesh[--nidx];
- break;
- }
- }
- }
-
- ai_assert(adj[o]-moffsets[nidx].first < mp->mNumFaces);
- const aiFace& f = mp->mFaces[adj[o]-moffsets[nidx].first];
-# ifdef _DEBUG
- bool haveit = false;
-# endif
-
- // find our original point in the face
- for (unsigned int m = 0; m < f.mNumIndices; ++m) {
- if (maptbl[FLATTEN_VERTEX_IDX(nidx,f.mIndices[m])] == org) {
-
- // add *both* edges. this way, we can be sure that we add
- // *all* adjacent edges to R. In a closed shape, every
- // edge is added twice - so we simply leave out the
- // factor 2.f in the amove formula and get the right
- // result.
-
- const Edge& c0 = edges[MAKE_EDGE_HASH(org,maptbl[FLATTEN_VERTEX_IDX(
- nidx,f.mIndices[!m?f.mNumIndices-1:m-1])])];
- // fixme: replace with mod face.mNumIndices?
-
- const Edge& c1 = edges[MAKE_EDGE_HASH(org,maptbl[FLATTEN_VERTEX_IDX(
- nidx,f.mIndices[m==f.mNumIndices-1?0:m+1])])];
- // fixme: replace with mod face.mNumIndices?
- R += c0.midpoint+c1.midpoint;
-
-# ifdef _DEBUG
- haveit = true;
-# endif
- break;
- }
- }
-
- // this invariant *must* hold if the vertex-to-face adjacency table is valid
- ai_assert(haveit);
- }
-
- const float div = static_cast<float>(cnt), divsq = 1.f/(div*div);
- ov.second = Vertex(minp,face.mIndices[a])*((div-3.f) / div) + R*divsq + F*divsq;
- }
- }
- ov.second.SortBack(mout,faceOut.mIndices[2]=v++);
- }
- }
- }
-
- // ---------------------------------------------------------------------
- // 7. Apply the next subdivision step.
- // ---------------------------------------------------------------------
- if (num != 1) {
- std::vector<aiMesh*> tmp(nmesh);
- InternSubdivide (out,nmesh,&tmp.front(),num-1);
- for (size_t i = 0; i < nmesh; ++i) {
- delete out[i];
- out[i] = tmp[i];
- }
- }
-}
diff --git a/3rdparty/assimp/code/Subdivision.h b/3rdparty/assimp/code/Subdivision.h
deleted file mode 100644
index 31a7a258..00000000
--- a/3rdparty/assimp/code/Subdivision.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file Defines a helper class to evaluate subdivision surfaces.*/
-#ifndef AI_SUBDISIVION_H_INC
-#define AI_SUBDISIVION_H_INC
-namespace Assimp {
-
-// ------------------------------------------------------------------------------
-/** Helper class to evaluate subdivision surfaces. Different algorithms
- * are provided for choice. */
-// ------------------------------------------------------------------------------
-class ASSIMP_API Subdivider
-{
-public:
-
- /** Enumerates all supported subvidision algorithms */
- enum Algorithm {
- CATMULL_CLARKE = 0x1
- };
-
-public:
-
- virtual ~Subdivider() {
- }
-
-public:
-
- // ---------------------------------------------------------------
- /** Create a subdivider of a specific type
- *
- * @param algo Algorithm to be used for subdivision
- * @return Subdivider instance. */
- static Subdivider* Create (Algorithm algo);
-
- // ---------------------------------------------------------------
- /** Subdivide a mesh using the selected algorithm
- *
- * @param mesh First mesh to be subdivided. Must be in verbose
- * format.
- * @param out Receives the output mesh, allocated by me.
- * @param num Number of subdivisions to perform.
- * @param discard_input If true is passed, the input mesh is
- * deleted after the subdivision is complete. This can
- * improve performance because it allows the optimization
- * to reuse the existing mesh for intermediate results.
- * @pre out!=mesh*/
- virtual void Subdivide (const aiMesh* mesh,
- aiMesh*& out, unsigned int num,
- bool discard_input = false) = 0;
-
- // ---------------------------------------------------------------
- /** Subdivide multiple meshes using the selected algorithm. This
- * avoids erroneous smoothing on objects consisting of multiple
- * per-material meshes. Usually, most 3d modellers smooth on a
- * per-object base, regardless the materials assigned to the
- * meshes.
- *
- * @param smesh Array of meshes to be subdivided. Must be in
- * verbose format.
- * @param nmesh Number of meshes in smesh.
- * @param out Receives the output meshes. The array must be
- * sufficiently large (at least @c nmesh elements) and may not
- * overlap the input array. Output meshes map one-to-one to
- * their corresponding input meshes. The meshes are allocated
- * by the function.
- * @param discard_input If true is passed, input meshes are
- * deleted after the subdivision is complete. This can
- * improve performance because it allows the optimization
- * of reusing existing meshes for intermediate results.
- * @param num Number of subdivisions to perform.
- * @pre nmesh != 0, smesh and out may not overlap*/
- virtual void Subdivide (
- const aiMesh* const * smesh,
- size_t nmesh,
- aiMesh** out,
- unsigned int num,
- bool discard_input = false) = 0;
-
-private:
-};
-
-} // end namespace Assimp
-
-
-#endif // !! AI_SUBDISIVION_H_INC
-
diff --git a/3rdparty/assimp/code/TargetAnimation.cpp b/3rdparty/assimp/code/TargetAnimation.cpp
deleted file mode 100644
index 76fe5e3d..00000000
--- a/3rdparty/assimp/code/TargetAnimation.cpp
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-#include "AssimpPCH.h"
-#include "TargetAnimation.h"
-#include <algorithm>
-
-using namespace Assimp;
-
-
-// ------------------------------------------------------------------------------------------------
-KeyIterator::KeyIterator(const std::vector<aiVectorKey>* _objPos,
- const std::vector<aiVectorKey>* _targetObjPos,
- const aiVector3D* defaultObjectPos /*= NULL*/,
- const aiVector3D* defaultTargetPos /*= NULL*/)
-
- : reachedEnd (false)
- , curTime (-1.)
- , objPos (_objPos)
- , targetObjPos (_targetObjPos)
- , nextObjPos (0)
- , nextTargetObjPos(0)
-{
- // Generate default transformation tracks if necessary
- if (!objPos || objPos->empty())
- {
- defaultObjPos.resize(1);
- defaultObjPos.front().mTime = 10e10;
-
- if (defaultObjectPos)
- defaultObjPos.front().mValue = *defaultObjectPos;
-
- objPos = & defaultObjPos;
- }
- if (!targetObjPos || targetObjPos->empty())
- {
- defaultTargetObjPos.resize(1);
- defaultTargetObjPos.front().mTime = 10e10;
-
- if (defaultTargetPos)
- defaultTargetObjPos.front().mValue = *defaultTargetPos;
-
- targetObjPos = & defaultTargetObjPos;
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-template <class T>
-inline T Interpolate(const T& one, const T& two, float val)
-{
- return one + (two-one)*val;
-}
-
-// ------------------------------------------------------------------------------------------------
-void KeyIterator::operator ++()
-{
- // If we are already at the end of all keyframes, return
- if (reachedEnd) {
- return;
- }
-
- // Now search in all arrays for the time value closest
- // to our current position on the time line
- double d0,d1;
-
- d0 = objPos->at ( std::min<unsigned int> ( nextObjPos, objPos->size()-1) ).mTime;
- d1 = targetObjPos->at( std::min<unsigned int> ( nextTargetObjPos, targetObjPos->size()-1) ).mTime;
-
- // Easiest case - all are identical. In this
- // case we don't need to interpolate so we can
- // return earlier
- if ( d0 == d1 )
- {
- curTime = d0;
- curPosition = objPos->at(nextObjPos).mValue;
- curTargetPosition = targetObjPos->at(nextTargetObjPos).mValue;
-
- // increment counters
- if (objPos->size() != nextObjPos-1)
- ++nextObjPos;
-
- if (targetObjPos->size() != nextTargetObjPos-1)
- ++nextTargetObjPos;
- }
-
- // An object position key is closest to us
- else if (d0 < d1)
- {
- curTime = d0;
-
- // interpolate the other
- if (1 == targetObjPos->size() || !nextTargetObjPos) {
- curTargetPosition = targetObjPos->at(0).mValue;
- }
- else
- {
- const aiVectorKey& last = targetObjPos->at(nextTargetObjPos);
- const aiVectorKey& first = targetObjPos->at(nextTargetObjPos-1);
-
- curTargetPosition = Interpolate(first.mValue, last.mValue, (float) (
- (curTime-first.mTime) / (last.mTime-first.mTime) ));
- }
-
- if (objPos->size() != nextObjPos-1)
- ++nextObjPos;
- }
- // A target position key is closest to us
- else
- {
- curTime = d1;
-
- // interpolate the other
- if (1 == objPos->size() || !nextObjPos) {
- curPosition = objPos->at(0).mValue;
- }
- else
- {
- const aiVectorKey& last = objPos->at(nextObjPos);
- const aiVectorKey& first = objPos->at(nextObjPos-1);
-
- curPosition = Interpolate(first.mValue, last.mValue, (float) (
- (curTime-first.mTime) / (last.mTime-first.mTime)));
- }
-
- if (targetObjPos->size() != nextTargetObjPos-1)
- ++nextTargetObjPos;
- }
-
- if (nextObjPos >= objPos->size()-1 &&
- nextTargetObjPos >= targetObjPos->size()-1)
- {
- // We reached the very last keyframe
- reachedEnd = true;
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void TargetAnimationHelper::SetTargetAnimationChannel (
- const std::vector<aiVectorKey>* _targetPositions)
-{
- ai_assert(NULL != _targetPositions);
- targetPositions = _targetPositions;
-}
-
-// ------------------------------------------------------------------------------------------------
-void TargetAnimationHelper::SetMainAnimationChannel (
- const std::vector<aiVectorKey>* _objectPositions)
-{
- ai_assert(NULL != _objectPositions);
- objectPositions = _objectPositions;
-}
-
-// ------------------------------------------------------------------------------------------------
-void TargetAnimationHelper::SetFixedMainAnimationChannel(
- const aiVector3D& fixed)
-{
- objectPositions = NULL; // just to avoid confusion
- fixedMain = fixed;
-}
-
-// ------------------------------------------------------------------------------------------------
-void TargetAnimationHelper::Process(std::vector<aiVectorKey>* distanceTrack)
-{
- ai_assert(NULL != targetPositions && NULL != distanceTrack);
-
- // TODO: in most cases we won't need the extra array
- std::vector<aiVectorKey> real;
-
- std::vector<aiVectorKey>* fill = (distanceTrack == objectPositions ? &real : distanceTrack);
- fill->reserve(std::max( objectPositions->size(), targetPositions->size() ));
-
- // Iterate through all object keys and interpolate their values if necessary.
- // Then get the corresponding target position, compute the difference
- // vector between object and target position. Then compute a rotation matrix
- // that rotates the base vector of the object coordinate system at that time
- // to match the diff vector.
-
- KeyIterator iter(objectPositions,targetPositions,&fixedMain);
- for (;!iter.Finished();++iter)
- {
- const aiVector3D& position = iter.GetCurPosition();
- const aiVector3D& tposition = iter.GetCurTargetPosition();
-
- // diff vector
- aiVector3D diff = tposition - position;
- float f = diff.Length();
-
- // output distance vector
- if (f)
- {
- fill->push_back(aiVectorKey());
- aiVectorKey& v = fill->back();
- v.mTime = iter.GetCurTime();
- v.mValue = diff;
-
- diff /= f;
- }
- else
- {
- // FIXME: handle this
- }
-
- // diff is now the vector in which our camera is pointing
- }
-
- if (real.size()) {
- *distanceTrack = real;
- }
-}
diff --git a/3rdparty/assimp/code/TargetAnimation.h b/3rdparty/assimp/code/TargetAnimation.h
deleted file mode 100644
index 9c675302..00000000
--- a/3rdparty/assimp/code/TargetAnimation.h
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file Defines a helper class for the ASE and 3DS loaders to
- help them compute camera and spot light animation channels */
-#ifndef AI_TARGET_ANIMATION_H_INC
-#define AI_TARGET_ANIMATION_H_INC
-
-
-namespace Assimp {
-
-
-
-// ---------------------------------------------------------------------------
-/** Helper class to iterate through all keys in an animation channel.
- *
- * Missing tracks are interpolated. This is a helper class for
- * TargetAnimationHelper, but it can be freely used for other purposes.
-*/
-class ASSIMP_API KeyIterator
-{
-public:
-
-
- // ------------------------------------------------------------------
- /** Constructs a new key iterator
- *
- * @param _objPos Object position track. May be NULL.
- * @param _targetObjPos Target object position track. May be NULL.
- * @param defaultObjectPos Default object position to be used if
- * no animated track is available. May be NULL.
- * @param defaultTargetPos Default target position to be used if
- * no animated track is available. May be NULL.
- */
- KeyIterator(const std::vector<aiVectorKey>* _objPos,
- const std::vector<aiVectorKey>* _targetObjPos,
- const aiVector3D* defaultObjectPos = NULL,
- const aiVector3D* defaultTargetPos = NULL);
-
- // ------------------------------------------------------------------
- /** Returns true if all keys have been processed
- */
- bool Finished() const
- {return reachedEnd;}
-
- // ------------------------------------------------------------------
- /** Increment the iterator
- */
- void operator++();
- inline void operator++(int)
- {return ++(*this);}
-
-
-
- // ------------------------------------------------------------------
- /** Getters to retrieve the current state of the iterator
- */
- inline const aiVector3D& GetCurPosition() const
- {return curPosition;}
-
- inline const aiVector3D& GetCurTargetPosition() const
- {return curTargetPosition;}
-
- inline double GetCurTime() const
- {return curTime;}
-
-private:
-
- //! Did we reach the end?
- bool reachedEnd;
-
- //! Represents the current position of the iterator
- aiVector3D curPosition, curTargetPosition;
-
- double curTime;
-
- //! Input tracks and the next key to process
- const std::vector<aiVectorKey>* objPos,*targetObjPos;
-
- unsigned int nextObjPos, nextTargetObjPos;
- std::vector<aiVectorKey> defaultObjPos,defaultTargetObjPos;
-};
-
-// ---------------------------------------------------------------------------
-/** Helper class for the 3DS and ASE loaders to compute camera and spot light
- * animations.
- *
- * 3DS and ASE store the differently to Assimp - there is an animation
- * channel for the camera/spot light itself and a separate position
- * animation channels specifying the position of the camera/spot light
- * look-at target */
-class ASSIMP_API TargetAnimationHelper
-{
-public:
-
- TargetAnimationHelper()
- : targetPositions (NULL)
- , objectPositions (NULL)
- {}
-
-
- // ------------------------------------------------------------------
- /** Sets the target animation channel
- *
- * This channel specifies the position of the camera/spot light
- * target at a specific position.
- *
- * @param targetPositions Translation channel*/
- void SetTargetAnimationChannel (const
- std::vector<aiVectorKey>* targetPositions);
-
-
- // ------------------------------------------------------------------
- /** Sets the main animation channel
- *
- * @param objectPositions Translation channel */
- void SetMainAnimationChannel ( const
- std::vector<aiVectorKey>* objectPositions);
-
- // ------------------------------------------------------------------
- /** Sets the main animation channel to a fixed value
- *
- * @param fixed Fixed value for the main animation channel*/
- void SetFixedMainAnimationChannel(const aiVector3D& fixed);
-
-
- // ------------------------------------------------------------------
- /** Computes final animation channels
- * @param distanceTrack Receive camera translation keys ... != NULL. */
- void Process( std::vector<aiVectorKey>* distanceTrack );
-
-
-private:
-
- const std::vector<aiVectorKey>* targetPositions,*objectPositions;
- aiVector3D fixedMain;
-};
-
-
-} // ! end namespace Assimp
-
-#endif // include guard
diff --git a/3rdparty/assimp/code/TerragenLoader.cpp b/3rdparty/assimp/code/TerragenLoader.cpp
deleted file mode 100644
index 3a19d17e..00000000
--- a/3rdparty/assimp/code/TerragenLoader.cpp
+++ /dev/null
@@ -1,254 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file Implementation of the Terragen importer class */
-
-#include "AssimpPCH.h"
-
-#ifndef ASSIMP_BUILD_NO_TERRAGEN_IMPORTER
-#include "TerragenLoader.h"
-
-using namespace Assimp;
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-TerragenImporter::TerragenImporter()
-: configComputeUVs (false)
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-TerragenImporter::~TerragenImporter()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the class can handle the format of the given file.
-bool TerragenImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const
-{
- // check file extension
- std::string extension = GetExtension(pFile);
-
- if ( extension == "ter")
- return true;
-
- if ( !extension.length() || checkSig) {
- /* If CanRead() is called in order to check whether we
- * support a specific file extension in general pIOHandler
- * might be NULL and it's our duty to return true here.
- */
- if (!pIOHandler)return true;
- const char* tokens[] = {"terragen"};
- return SearchFileHeaderForToken(pIOHandler,pFile,tokens,1);
- }
- return false;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Build a string of all file extensions supported
-void TerragenImporter::GetExtensionList(std::set<std::string>& extensions)
-{
- extensions.insert("ter");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Setup import properties
-void TerragenImporter::SetupProperties(const Importer* pImp)
-{
- // AI_CONFIG_IMPORT_TER_MAKE_UVS
- configComputeUVs = ( 0 != pImp->GetPropertyInteger(AI_CONFIG_IMPORT_TER_MAKE_UVS,0) );
-}
-
-// ------------------------------------------------------------------------------------------------
-// Imports the given file into the given scene structure.
-void TerragenImporter::InternReadFile( const std::string& pFile,
- aiScene* pScene, IOSystem* pIOHandler)
-{
- IOStream* file = pIOHandler->Open( pFile, "rb");
-
- // Check whether we can read from the file
- if ( file == NULL)
- throw DeadlyImportError( "Failed to open TERRAGEN TERRAIN file " + pFile + ".");
-
- // Construct a stream reader to read all data in the correct endianess
- StreamReaderLE reader(file);
- if (reader.GetRemainingSize() < 16)
- throw DeadlyImportError( "TER: file is too small" );
-
- // Check for the existence of the two magic strings 'TERRAGEN' and 'TERRAIN '
- if (::strncmp((const char*)reader.GetPtr(),AI_TERR_BASE_STRING,8))
- throw DeadlyImportError( "TER: Magic string \'TERRAGEN\' not found" );
-
- if (::strncmp((const char*)reader.GetPtr()+8,AI_TERR_TERRAIN_STRING,8))
- throw DeadlyImportError( "TER: Magic string \'TERRAIN\' not found" );
-
- unsigned int x = 0,y = 0,mode = 0;
- float rad = 6370.f;
-
-
- aiNode* root = pScene->mRootNode = new aiNode();
- root->mName.Set("<TERRAGEN.TERRAIN>");
-
- // Default scaling is 30
- root->mTransformation.a1 = root->mTransformation.b2 = root->mTransformation.c3 = 30.f;
-
- // Now read all chunks until we're finished or an EOF marker is encountered
- reader.IncPtr(16);
- while (reader.GetRemainingSize() >= 4)
- {
- const char* head = (const char*)reader.GetPtr();
- reader.IncPtr(4);
-
- // EOF, break in every case
- if (!::strncmp(head,AI_TERR_EOF_STRING,4))
- break;
-
- // Number of x-data points
- if (!::strncmp(head,AI_TERR_CHUNK_XPTS,4))
- {
- x = (uint16_t)reader.GetI2();
- }
- // Number of y-data points
- else if (!::strncmp(head,AI_TERR_CHUNK_YPTS,4))
- {
- y = (uint16_t)reader.GetI2();
- }
- // Squared terrains width-1.
- else if (!::strncmp(head,AI_TERR_CHUNK_SIZE,4))
- {
- x = y = (uint16_t)reader.GetI2()+1;
- }
- // terrain scaling
- else if (!::strncmp(head,AI_TERR_CHUNK_SCAL,4))
- {
- root->mTransformation.a1 = reader.GetF4();
- root->mTransformation.b2 = reader.GetF4();
- root->mTransformation.c3 = reader.GetF4();
- }
- // mapping == 1: earth radius
- else if (!::strncmp(head,AI_TERR_CHUNK_CRAD,4))
- {
- rad = reader.GetF4();
- }
- // mapping mode
- else if (!::strncmp(head,AI_TERR_CHUNK_CRVM,4))
- {
- mode = reader.GetI1();
- if (0 != mode)
- DefaultLogger::get()->error("TER: Unsupported mapping mode, a flat terrain is returned");
- }
- // actual terrain data
- else if (!::strncmp(head,AI_TERR_CHUNK_ALTW,4))
- {
- float hscale = (float)reader.GetI2() / 65536;
- float bheight = (float)reader.GetI2();
-
- if (!hscale)hscale = 1;
-
- // Ensure we have enough data
- if (reader.GetRemainingSize() < x*y*2)
- throw DeadlyImportError("TER: ALTW chunk is too small");
-
- if (x <= 1 || y <= 1)
- throw DeadlyImportError("TER: Invalid terrain size");
-
- // Allocate the output mesh
- pScene->mMeshes = new aiMesh*[pScene->mNumMeshes = 1];
- aiMesh* m = pScene->mMeshes[0] = new aiMesh();
-
- // We return quads
- aiFace* f = m->mFaces = new aiFace[m->mNumFaces = (x-1)*(y-1)];
- aiVector3D* pv = m->mVertices = new aiVector3D[m->mNumVertices = m->mNumFaces*4];
-
- aiVector3D *uv( NULL );
- float step_y( 0.0f ), step_x( 0.0f );
- if (configComputeUVs) {
- uv = m->mTextureCoords[0] = new aiVector3D[m->mNumVertices];
- step_y = 1.f/y;
- step_x = 1.f/x;
- }
- const int16_t* data = (const int16_t*)reader.GetPtr();
-
- for (unsigned int yy = 0, t = 0; yy < y-1;++yy) {
- for (unsigned int xx = 0; xx < x-1;++xx,++f) {
-
- // make verts
- const float fy = (float)yy, fx = (float)xx;
- register unsigned tmp,tmp2;
- *pv++ = aiVector3D(fx,fy, (float)data[(tmp2=x*yy) + xx] * hscale + bheight);
- *pv++ = aiVector3D(fx,fy+1, (float)data[(tmp=x*(yy+1)) + xx] * hscale + bheight);
- *pv++ = aiVector3D(fx+1,fy+1,(float)data[tmp + xx+1] * hscale + bheight);
- *pv++ = aiVector3D(fx+1,fy, (float)data[tmp2 + xx+1] * hscale + bheight);
-
- // also make texture coordinates, if necessary
- if (configComputeUVs) {
- *uv++ = aiVector3D( step_x*xx, step_y*yy, 0.f );
- *uv++ = aiVector3D( step_x*xx, step_y*(yy+1), 0.f );
- *uv++ = aiVector3D( step_x*(xx+1), step_y*(yy+1), 0.f );
- *uv++ = aiVector3D( step_x*(xx+1), step_y*yy, 0.f );
- }
-
- // make indices
- f->mIndices = new unsigned int[f->mNumIndices = 4];
- for (unsigned int i = 0; i < 4;++i)
- f->mIndices[i] = t++;
- }
- }
-
- // Add the mesh to the root node
- root->mMeshes = new unsigned int[root->mNumMeshes = 1];
- root->mMeshes[0] = 0;
- }
-
- // Get to the next chunk (4 byte aligned)
- unsigned dtt;
- if ((dtt = reader.GetCurrentPos() & 0x3))
- reader.IncPtr(4-dtt);
- }
-
- // Check whether we have a mesh now
- if (pScene->mNumMeshes != 1)
- throw DeadlyImportError("TER: Unable to load terrain");
-
- // Set the AI_SCENE_FLAGS_TERRAIN bit
- pScene->mFlags |= AI_SCENE_FLAGS_TERRAIN;
-}
-
-#endif // !! ASSIMP_BUILD_NO_TERRAGEN_IMPORTER
diff --git a/3rdparty/assimp/code/TerragenLoader.h b/3rdparty/assimp/code/TerragenLoader.h
deleted file mode 100644
index 48e97d1a..00000000
--- a/3rdparty/assimp/code/TerragenLoader.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file TerragenLoader.h
- * @brief Declaration of the .ter importer class.
- */
-#ifndef INCLUDED_AI_TERRAGEN_TERRAIN_LOADER_H
-#define INCLUDED_AI_TERRAGEN_TERRAIN_LOADER_H
-
-#include "BaseImporter.h"
-namespace Assimp {
-
-// Magic strings
-#define AI_TERR_BASE_STRING "TERRAGEN"
-#define AI_TERR_TERRAIN_STRING "TERRAIN "
-#define AI_TERR_EOF_STRING "EOF "
-
-// Chunka
-#define AI_TERR_CHUNK_XPTS "XPTS"
-#define AI_TERR_CHUNK_YPTS "YPTS"
-#define AI_TERR_CHUNK_SIZE "SIZE"
-#define AI_TERR_CHUNK_SCAL "SCAL"
-#define AI_TERR_CHUNK_CRAD "CRAD"
-#define AI_TERR_CHUNK_CRVM "CRVM"
-#define AI_TERR_CHUNK_ALTW "ALTW"
-
-// ---------------------------------------------------------------------------
-/** @brief Importer class to load Terragen (0.9) terrain files.
- *
- * The loader is basing on the information found here:
- * http://www.planetside.co.uk/terragen/dev/tgterrain.html#chunks
-*/
-class TerragenImporter : public BaseImporter
-{
- friend class Importer;
-
-protected:
- /** Constructor to be privately used by Importer */
- TerragenImporter();
-
- /** Destructor, private as well */
- ~TerragenImporter();
-
-public:
-
- // -------------------------------------------------------------------
- bool CanRead( const std::string& pFile, IOSystem* pIOHandler,
- bool checkSig) const;
-
-protected:
-
- // -------------------------------------------------------------------
- void GetExtensionList(std::set<std::string>& extensions);
-
- // -------------------------------------------------------------------
- void InternReadFile( const std::string& pFile, aiScene* pScene,
- IOSystem* pIOHandler);
-
- // -------------------------------------------------------------------
- void SetupProperties(const Importer* pImp);
-
-private:
-
- bool configComputeUVs;
-
-}; //! class TerragenImporter
-
-} // end of namespace Assimp
-
-#endif // AI_AC3DIMPORTER_H_INC
diff --git a/3rdparty/assimp/code/TextureTransform.cpp b/3rdparty/assimp/code/TextureTransform.cpp
deleted file mode 100644
index dd6b1bf9..00000000
--- a/3rdparty/assimp/code/TextureTransform.cpp
+++ /dev/null
@@ -1,563 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file A helper class that processes texture transformations */
-
-
-#include "AssimpPCH.h"
-#include "TextureTransform.h"
-
-using namespace Assimp;
-
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-TextureTransformStep::TextureTransformStep()
-{
- // nothing to do here
-}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-TextureTransformStep::~TextureTransformStep()
-{
- // nothing to do here
-}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the processing step is present in the given flag field.
-bool TextureTransformStep::IsActive( unsigned int pFlags) const
-{
- return (pFlags & aiProcess_TransformUVCoords) != 0;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Setup properties
-void TextureTransformStep::SetupProperties(const Importer* pImp)
-{
- configFlags = pImp->GetPropertyInteger(AI_CONFIG_PP_TUV_EVALUATE,AI_UVTRAFO_ALL);
-}
-
-// ------------------------------------------------------------------------------------------------
-void TextureTransformStep::PreProcessUVTransform(STransformVecInfo& info)
-{
- /* This function tries to simplify the input UV transformation.
- * That's very important as it allows us to reduce the number
- * of output UV channels. The oder in which the transformations
- * are applied is - as always - scaling, rotation, translation.
- */
-
- char szTemp[512];
- int rounded = 0;
-
-
- /* Optimize the rotation angle. That's slightly difficult as
- * we have an inprecise floating-point number (when comparing
- * UV transformations we'll take that into account by using
- * an epsilon of 5 degrees). If there is a rotation value, we can't
- * perform any further optimizations.
- */
- if (info.mRotation)
- {
- float out = info.mRotation;
- if ((rounded = (int)(info.mRotation / (float)AI_MATH_TWO_PI)))
- {
- out -= rounded*(float)AI_MATH_PI;
-
- sprintf(szTemp,"Texture coordinate rotation %f can be simplified to %f",info.mRotation,out);
- DefaultLogger::get()->info(szTemp);
- }
-
- // Next step - convert negative rotation angles to positives
- if (out < 0.f)
- out = (float)AI_MATH_TWO_PI * 2 + out;
-
- info.mRotation = out;
- return;
- }
-
-
- /* Optimize UV translation in the U direction. To determine whether
- * or not we can optimize we need to look at the requested mapping
- * type (e.g. if mirroring is active there IS a difference between
- * offset 2 and 3)
- */
- if ((rounded = (int)info.mTranslation.x)) {
- float out;
- szTemp[0] = 0;
- if (aiTextureMapMode_Wrap == info.mapU) {
- // Wrap - simple take the fraction of the field
- out = info.mTranslation.x-(float)rounded;
- sprintf(szTemp,"[w] UV U offset %f can be simplified to %f",info.mTranslation.x,out);
- }
- else if (aiTextureMapMode_Mirror == info.mapU && 1 != rounded) {
- // Mirror
- if (rounded % 2)
- rounded--;
- out = info.mTranslation.x-(float)rounded;
-
- sprintf(szTemp,"[m/d] UV U offset %f can be simplified to %f",info.mTranslation.x,out);
- }
- else if (aiTextureMapMode_Clamp == info.mapU || aiTextureMapMode_Decal == info.mapU) {
- // Clamp - translations beyond 1,1 are senseless
- sprintf(szTemp,"[c] UV U offset %f can be clamped to 1.0f",info.mTranslation.x);
-
- out = 1.f;
- }
- if (szTemp[0]) {
- DefaultLogger::get()->info(szTemp);
- info.mTranslation.x = out;
- }
- }
-
- /* Optimize UV translation in the V direction. To determine whether
- * or not we can optimize we need to look at the requested mapping
- * type (e.g. if mirroring is active there IS a difference between
- * offset 2 and 3)
- */
- if ((rounded = (int)info.mTranslation.y)) {
- float out;
- szTemp[0] = 0;
- if (aiTextureMapMode_Wrap == info.mapV) {
- // Wrap - simple take the fraction of the field
- out = info.mTranslation.y-(float)rounded;
- sprintf(szTemp,"[w] UV V offset %f can be simplified to %f",info.mTranslation.y,out);
- }
- else if (aiTextureMapMode_Mirror == info.mapV && 1 != rounded) {
- // Mirror
- if (rounded % 2)
- rounded--;
- out = info.mTranslation.x-(float)rounded;
-
- sprintf(szTemp,"[m/d] UV V offset %f can be simplified to %f",info.mTranslation.y,out);
- }
- else if (aiTextureMapMode_Clamp == info.mapV || aiTextureMapMode_Decal == info.mapV) {
- // Clamp - translations beyond 1,1 are senseless
- sprintf(szTemp,"[c] UV V offset %f canbe clamped to 1.0f",info.mTranslation.y);
-
- out = 1.f;
- }
- if (szTemp[0]) {
- DefaultLogger::get()->info(szTemp);
- info.mTranslation.y = out;
- }
- }
- return;
-}
-
-// ------------------------------------------------------------------------------------------------
-void UpdateUVIndex(const std::list<TTUpdateInfo>& l, unsigned int n)
-{
- // Don't set if == 0 && wasn't set before
- for (std::list<TTUpdateInfo>::const_iterator it = l.begin();it != l.end(); ++it) {
- const TTUpdateInfo& info = *it;
-
- if (info.directShortcut)
- *info.directShortcut = n;
- else if (!n)
- {
- info.mat->AddProperty<int>((int*)&n,1,AI_MATKEY_UVWSRC(info.semantic,info.index));
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-inline const char* MappingModeToChar(aiTextureMapMode map)
-{
- if (aiTextureMapMode_Wrap == map)
- return "-w";
-
- if (aiTextureMapMode_Mirror == map)
- return "-m";
-
- return "-c";
-}
-
-// ------------------------------------------------------------------------------------------------
-void TextureTransformStep::Execute( aiScene* pScene)
-{
- DefaultLogger::get()->debug("TransformUVCoordsProcess begin");
-
-
- /* We build a per-mesh list of texture transformations we'll need
- * to apply. To achieve this, we iterate through all materials,
- * find all textures and get their transformations and UV indices.
- * Then we search for all meshes using this material.
- */
- typedef std::list<STransformVecInfo> MeshTrafoList;
- std::vector<MeshTrafoList> meshLists(pScene->mNumMeshes);
-
- for (unsigned int i = 0; i < pScene->mNumMaterials;++i) {
-
- aiMaterial* mat = pScene->mMaterials[i];
- for (unsigned int a = 0; a < mat->mNumProperties;++a) {
-
- aiMaterialProperty* prop = mat->mProperties[a];
- if (!::strcmp( prop->mKey.data, "$tex.file")) {
- STransformVecInfo info;
-
- // Setup a shortcut structure to allow for a fast updating
- // of the UV index later
- TTUpdateInfo update;
- update.mat = (MaterialHelper*) mat;
- update.semantic = prop->mSemantic;
- update.index = prop->mIndex;
-
- // Get textured properties and transform
- for (unsigned int a2 = 0; a2 < mat->mNumProperties;++a2)
- {
- aiMaterialProperty* prop2 = mat->mProperties[a2];
- if (prop2->mSemantic != prop->mSemantic || prop2->mIndex != prop->mIndex)
- continue;
-
- if ( !::strcmp( prop2->mKey.data, "$tex.uvwsrc"))
- {
- info.uvIndex = *((int*)prop2->mData);
-
- // Store a direct pointer for later use
- update.directShortcut = (unsigned int*) prop2->mData;
- }
-
- else if ( !::strcmp( prop2->mKey.data, "$tex.mapmodeu"))
- info.mapU = *((aiTextureMapMode*)prop2->mData);
-
- else if ( !::strcmp( prop2->mKey.data, "$tex.mapmodev"))
- info.mapV = *((aiTextureMapMode*)prop2->mData);
-
- else if ( !::strcmp( prop2->mKey.data, "$tex.uvtrafo"))
- {
- // ValidateDS should check this
- ai_assert(prop2->mDataLength >= 20);
- ::memcpy(&info.mTranslation.x,prop2->mData,sizeof(float)*5);
- delete[] prop2->mData;
-
- // Directly remove this property from the list
- mat->mNumProperties--;
- for (unsigned int a3 = a2; a3 < mat->mNumProperties;++a3)
- mat->mProperties[a3] = mat->mProperties[a3+1];
-
- // Warn: could be an underflow, but nevertheless it should work
- --a2;
- }
- }
-
- // Find out which transformations are to be evaluated
- if (!(configFlags & AI_UVTRAFO_ROTATION))
- info.mRotation = 0.f;
-
- if (!(configFlags & AI_UVTRAFO_SCALING))
- info.mScaling = aiVector2D(1.f,1.f);
-
- if (!(configFlags & AI_UVTRAFO_TRANSLATION))
- info.mTranslation = aiVector2D(0.f,0.f);
-
- // Do some preprocessing
- PreProcessUVTransform(info);
- info.uvIndex = std::min(info.uvIndex,AI_MAX_NUMBER_OF_TEXTURECOORDS -1u);
-
- // Find out whether this material is used by more than
- // one mesh. This will make our task much, much more difficult!
- unsigned int cnt = 0;
- for (unsigned int n = 0; n < pScene->mNumMeshes;++n) {
- if (pScene->mMeshes[n]->mMaterialIndex == i)
- ++cnt;
- }
-
- if (!cnt)
- continue;
- else if (1 != cnt) {
- // This material is referenced by more than one mesh!
- // So we need to make sure the UV index for the texture
- // is identical for each of it ...
- info.lockedPos = AI_TT_UV_IDX_LOCK_TBD;
- }
-
- // Get all coresponding meshes
- for (unsigned int n = 0; n < pScene->mNumMeshes;++n) {
- aiMesh* mesh = pScene->mMeshes[n];
- if (mesh->mMaterialIndex != i || !mesh->mTextureCoords[0])
- continue;
-
- unsigned int uv = info.uvIndex;
- if (!mesh->mTextureCoords[uv]) {
- // If the requested UV index is not available, take the first one instead.
- uv = 0;
- }
-
- if (mesh->mNumUVComponents[info.uvIndex] >= 3){
- DefaultLogger::get()->warn("UV transformations on 3D mapping channels are not supported");
- continue;
- }
-
- MeshTrafoList::iterator it;
-
- // Check whether we have this transform setup already
- for (it = meshLists[n].begin();it != meshLists[n].end(); ++it) {
-
- if ((*it) == info && (*it).uvIndex == uv) {
- (*it).updateList.push_back(update);
- break;
- }
- }
-
- if (it == meshLists[n].end()) {
- meshLists[n].push_back(info);
- meshLists[n].back().uvIndex = uv;
- meshLists[n].back().updateList.push_back(update);
- }
- }
- }
- }
- }
-
- char buffer[1024]; // should be sufficiently large
- unsigned int outChannels = 0, inChannels = 0, transformedChannels = 0;
-
- // Now process all meshes. Important: we don't remove unreferenced UV channels.
- // This is a job for the RemoveUnreferencedData-Step.
- for (unsigned int q = 0; q < pScene->mNumMeshes;++q) {
-
- aiMesh* mesh = pScene->mMeshes[q];
- MeshTrafoList& trafo = meshLists[q];
-
- inChannels += mesh->GetNumUVChannels();
-
- if (!mesh->mTextureCoords[0] || trafo.empty() || (trafo.size() == 1 && trafo.begin()->IsUntransformed())) {
- outChannels += mesh->GetNumUVChannels();
- continue;
- }
-
- // Move untransformed UV channels to the first position in the list ....
- // except if we need a new locked index which should be as small as possible
- bool veto = false, need = false;
- unsigned int cnt = 0;
- unsigned int untransformed = 0;
-
- MeshTrafoList::iterator it,it2;
- for (it = trafo.begin();it != trafo.end(); ++it,++cnt) {
-
- if (!(*it).IsUntransformed()) {
- need = true;
- }
-
- if ((*it).lockedPos == AI_TT_UV_IDX_LOCK_TBD) {
- // Lock this index and make sure it won't be changed
- (*it).lockedPos = cnt;
- veto = true;
- continue;
- }
-
- if (!veto && it != trafo.begin() && (*it).IsUntransformed()) {
- for (it2 = trafo.begin();it2 != it; ++it2) {
- if (!(*it2).IsUntransformed())
- break;
- }
- trafo.insert(it2,*it);
- trafo.erase(it);
- break;
- }
- }
- if (!need)
- continue;
-
- // Find all that are not at their 'locked' position and move them to it.
- // Conflicts are possible but quite unlikely.
- cnt = 0;
- for (it = trafo.begin();it != trafo.end(); ++it,++cnt) {
- if ((*it).lockedPos != AI_TT_UV_IDX_LOCK_NONE && (*it).lockedPos != cnt) {
- it2 = trafo.begin();unsigned int t = 0;
- while (t != (*it).lockedPos)
- ++it2;
-
- if ((*it2).lockedPos != AI_TT_UV_IDX_LOCK_NONE) {
- DefaultLogger::get()->error("Channel mismatch, can't compute all transformations properly [design bug]");
- continue;
- }
-
- std::swap(*it2,*it);
- if ((*it).lockedPos == untransformed)
- untransformed = cnt;
- }
- }
-
- // ... and add dummies for all unreferenced channels
- // at the end of the list
- bool ref[AI_MAX_NUMBER_OF_TEXTURECOORDS];
- for (unsigned int n = 0; n < AI_MAX_NUMBER_OF_TEXTURECOORDS;++n)
- ref[n] = (!mesh->mTextureCoords[n] ? true : false);
-
- for (it = trafo.begin();it != trafo.end(); ++it)
- ref[(*it).uvIndex] = true;
-
- for (unsigned int n = 0; n < AI_MAX_NUMBER_OF_TEXTURECOORDS;++n) {
- if (ref[n])
- continue;
- trafo.push_back(STransformVecInfo());
- trafo.back().uvIndex = n;
- }
-
- // Then check whether this list breaks the channel limit.
- // The unimportant ones are at the end of the list, so
- // it shouldn't be too worse if we remove them.
- unsigned int size = (unsigned int)trafo.size();
- if (size > AI_MAX_NUMBER_OF_TEXTURECOORDS) {
-
- if (!DefaultLogger::isNullLogger()) {
- ::sprintf(buffer,"%u UV channels required but just %u available",
- static_cast<unsigned int>(trafo.size()),AI_MAX_NUMBER_OF_TEXTURECOORDS);
-
- DefaultLogger::get()->error(buffer);
- }
- size = AI_MAX_NUMBER_OF_TEXTURECOORDS;
- }
-
-
- aiVector3D* old[AI_MAX_NUMBER_OF_TEXTURECOORDS];
- for (unsigned int n = 0; n < AI_MAX_NUMBER_OF_TEXTURECOORDS;++n)
- old[n] = mesh->mTextureCoords[n];
-
- // Now continue and generate the output channels. Channels
- // that we're not going to need later can be overridden.
- it = trafo.begin();
- for (unsigned int n = 0; n < trafo.size();++n,++it) {
-
- if (n >= size) {
- // Try to use an untransformed channel for all channels we threw over board
- UpdateUVIndex((*it).updateList,untransformed);
- continue;
- }
-
- outChannels++;
-
- // Write to the log
- if (!DefaultLogger::isNullLogger()) {
- sprintf(buffer,"Mesh %u, channel %u: t(%.3f,%.3f), s(%.3f,%.3f), r(%.3f), %s%s",
- q,n,
- (*it).mTranslation.x,
- (*it).mTranslation.y,
- (*it).mScaling.x,
- (*it).mScaling.y,
- AI_RAD_TO_DEG( (*it).mRotation),
- MappingModeToChar ((*it).mapU),
- MappingModeToChar ((*it).mapV));
-
- DefaultLogger::get()->info(buffer);
- }
-
- // Check whether we need a new buffer here
- if (mesh->mTextureCoords[n]) {
-
- it2 = it;++it2;
- for (unsigned int m = n+1; m < size;++m, ++it2) {
-
- if ((*it2).uvIndex == n){
- it2 = trafo.begin();
- break;
- }
- }
- if (it2 == trafo.begin()){
- mesh->mTextureCoords[n] = new aiVector3D[mesh->mNumVertices];
- }
- }
- else mesh->mTextureCoords[n] = new aiVector3D[mesh->mNumVertices];
-
- aiVector3D* src = old[(*it).uvIndex];
- aiVector3D* dest, *end;
- dest = mesh->mTextureCoords[n];
-
- ai_assert(NULL != src);
-
- // Copy the data to the destination array
- if (dest != src)
- ::memcpy(dest,src,sizeof(aiVector3D)*mesh->mNumVertices);
-
- end = dest + mesh->mNumVertices;
-
- // Build a transformation matrix and transform all UV coords with it
- if (!(*it).IsUntransformed()) {
- const aiVector2D& trl = (*it).mTranslation;
- const aiVector2D& scl = (*it).mScaling;
-
- // fixme: simplify ..
- ++transformedChannels;
- aiMatrix3x3 matrix;
-
- aiMatrix3x3 m2,m3,m4,m5;
-
- m4.a1 = scl.x;
- m4.b2 = scl.y;
-
- m2.a3 = m2.b3 = 0.5f;
- m3.a3 = m3.b3 = -0.5f;
-
- if ((*it).mRotation > AI_TT_ROTATION_EPSILON )
- aiMatrix3x3::RotationZ((*it).mRotation,matrix);
-
- m5.a3 += trl.x; m5.b3 += trl.y;
- matrix = m2 * m4 * matrix * m3 * m5;
-
- for (src = dest; src != end; ++src) { /* manual homogenious divide */
- src->z = 1.f;
- *src = matrix * *src;
- src->x /= src->z;
- src->y /= src->z;
- src->z = 0.f;
- }
- }
-
- // Update all UV indices
- UpdateUVIndex((*it).updateList,n);
- }
- }
-
- // Print some detailled statistics into the log
- if (!DefaultLogger::isNullLogger()) {
-
- if (transformedChannels) {
- ::sprintf(buffer,"TransformUVCoordsProcess end: %u output channels (in: %u, modified: %u)",
- outChannels,inChannels,transformedChannels);
-
- DefaultLogger::get()->info(buffer);
- }
- else DefaultLogger::get()->debug("TransformUVCoordsProcess finished");
- }
-}
-
-
diff --git a/3rdparty/assimp/code/TextureTransform.h b/3rdparty/assimp/code/TextureTransform.h
deleted file mode 100644
index dd57e2a5..00000000
--- a/3rdparty/assimp/code/TextureTransform.h
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file Definition of a helper step that processes texture transformations */
-#ifndef AI_TEXTURE_TRANSFORM_H_INCLUDED
-#define AI_TEXTURE_TRANSFORM_H_INCLUDED
-
-#include "BaseImporter.h"
-#include "BaseProcess.h"
-
-struct aiNode;
-
-namespace Assimp {
-
-#define AI_TT_UV_IDX_LOCK_TBD 0xffffffff
-#define AI_TT_UV_IDX_LOCK_NONE 0xeeeeeeee
-
-
-#define AI_TT_ROTATION_EPSILON ((float)AI_DEG_TO_RAD(0.5))
-
-// ---------------------------------------------------------------------------
-/** Small helper structure representing a shortcut into the material list
- * to be able to update some values quickly.
-*/
-struct TTUpdateInfo
-{
- TTUpdateInfo() :
- directShortcut (NULL)
- , mat (NULL)
- , semantic (0)
- , index (0)
- {}
-
- //! Direct shortcut, if available
- unsigned int* directShortcut;
-
- //! Material
- MaterialHelper *mat;
-
- //! Texture type and index
- unsigned int semantic, index;
-};
-
-
-// ---------------------------------------------------------------------------
-/** Helper class representing texture coordinate transformations
-*/
-struct STransformVecInfo : public aiUVTransform
-{
-
- STransformVecInfo()
- : uvIndex (0)
- , mapU (aiTextureMapMode_Wrap)
- , mapV (aiTextureMapMode_Wrap)
- , lockedPos (AI_TT_UV_IDX_LOCK_NONE)
- {}
-
- //! Source texture coordinate index
- unsigned int uvIndex;
-
- //! Texture mapping mode in the u, v direction
- aiTextureMapMode mapU,mapV;
-
- //! Locked destination UV index
- //! AI_TT_UV_IDX_LOCK_TBD - to be determined
- //! AI_TT_UV_IDX_LOCK_NONE - none (default)
- unsigned int lockedPos;
-
- //! Update info - shortcuts into all materials
- //! that are referencing this transform setup
- std::list<TTUpdateInfo> updateList;
-
-
- // -------------------------------------------------------------------
- /** Compare two transform setups
- */
- inline bool operator== (const STransformVecInfo& other) const
- {
- // We use a small epsilon here
- const static float epsilon = 0.05f;
-
- if (fabs( mTranslation.x - other.mTranslation.x ) > epsilon ||
- fabs( mTranslation.y - other.mTranslation.y ) > epsilon)
- {
- return false;
- }
-
- if (fabs( mScaling.x - other.mScaling.x ) > epsilon ||
- fabs( mScaling.y - other.mScaling.y ) > epsilon)
- {
- return false;
- }
-
- if (fabs( mRotation - other.mRotation) > epsilon)
- {
- return false;
- }
- return true;
- }
-
- inline bool operator!= (const STransformVecInfo& other) const
- {
- return !(*this == other);
- }
-
-
- // -------------------------------------------------------------------
- /** Returns whether this is an untransformed texture coordinate set
- */
- inline bool IsUntransformed() const
- {
- return (1.0f == mScaling.x && 1.f == mScaling.y &&
- !mTranslation.x && !mTranslation.y &&
- mRotation < AI_TT_ROTATION_EPSILON);
- }
-
- // -------------------------------------------------------------------
- /** Build a 3x3 matrix from the transformations
- */
- inline void GetMatrix(aiMatrix3x3& mOut)
- {
- mOut = aiMatrix3x3();
-
- if (1.0f != mScaling.x || 1.0f != mScaling.y)
- {
- aiMatrix3x3 mScale;
- mScale.a1 = mScaling.x;
- mScale.b2 = mScaling.y;
- mOut = mScale;
- }
- if (mRotation)
- {
- aiMatrix3x3 mRot;
- mRot.a1 = mRot.b2 = cos(mRotation);
- mRot.a2 = mRot.b1 = sin(mRotation);
- mRot.a2 = -mRot.a2;
- mOut *= mRot;
- }
- if (mTranslation.x || mTranslation.y)
- {
- aiMatrix3x3 mTrans;
- mTrans.a3 = mTranslation.x;
- mTrans.b3 = mTranslation.y;
- mOut *= mTrans;
- }
- }
-};
-
-
-// ---------------------------------------------------------------------------
-/** Helper step to compute final UV coordinate sets if there are scalings
- * or rotations in the original data read from the file.
-*/
-class ASSIMP_API TextureTransformStep : public BaseProcess
-{
-public:
-
- TextureTransformStep();
- ~TextureTransformStep();
-
- // -------------------------------------------------------------------
- bool IsActive( unsigned int pFlags) const;
-
- // -------------------------------------------------------------------
- void Execute( aiScene* pScene);
-
- // -------------------------------------------------------------------
- void SetupProperties(const Importer* pImp);
-
-
-protected:
-
-
- // -------------------------------------------------------------------
- /** Preprocess a specific UV transformation setup
- *
- * @param info Transformation setup to be preprocessed.
- */
- void PreProcessUVTransform(STransformVecInfo& info);
-
-private:
-
- unsigned int configFlags;
-};
-
-}
-
-#endif //! AI_TEXTURE_TRANSFORM_H_INCLUDED
diff --git a/3rdparty/assimp/code/TinyFormatter.h b/3rdparty/assimp/code/TinyFormatter.h
deleted file mode 100644
index c8478e12..00000000
--- a/3rdparty/assimp/code/TinyFormatter.h
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file TinyFormatter.h
- * @brief Utility to format log messages more easily. Introduced
- * to get rid of the boost::format dependency. Much slinker,
- * basically just extends stringstream.
- */
-#ifndef INCLUDED_TINY_FORMATTER_H
-#define INCLUDED_TINY_FORMATTER_H
-
-#include <sstream>
-
-namespace Assimp {
- namespace Formatter {
-
-// ------------------------------------------------------------------------------------------------
-/** stringstream utility. Usage:
- * @code
- * void writelog(const std::string&s);
- * void writelog(const std::wstring&s);
- * ...
- * writelog(format()<< "hi! this is a number: " << 4);
- * writelog(wformat()<< L"hi! this is a number: " << 4);
- *
- * @endcode */
-template < typename T,
- typename CharTraits = std::char_traits<T>,
- typename Allocator = std::allocator<T>
->
-class basic_formatter
-{
-
-public:
-
- typedef class std::basic_string<
- T,CharTraits,Allocator
- > string;
-
- typedef class std::basic_ostringstream<
- T,CharTraits,Allocator
- > stringstream;
-
-public:
-
- basic_formatter() {}
-
- /* Allow basic_formatter<T>'s to be used almost interchangeably
- * with std::(w)string or const (w)char* arguments because the
- * conversion c'tor is called implicitly. */
- template <typename TT>
- basic_formatter(const TT& sin) {
- underlying << sin;
- }
-
-public:
-
- operator string () const {
- return underlying.str();
- }
-
-
- /* note - this is declared const because binding temporaries does only
- * work for const references, so many function prototypes will
- * include const basic_formatter<T>& s but might still want to
- * modify the formatted string without the need for a full copy.*/
- template <typename TToken>
- const basic_formatter& operator << (const TToken& s) const {
- underlying << s;
- return *this;
- }
-
- template <typename TToken>
- basic_formatter& operator << (const TToken& s) {
- underlying << s;
- return *this;
- }
-
-
- // comma operator overloaded as well, choose your preferred way.
- template <typename TToken>
- const basic_formatter& operator, (const TToken& s) const {
- underlying << s;
- return *this;
- }
-
- template <typename TToken>
- basic_formatter& operator, (const TToken& s) {
- underlying << s;
- return *this;
- }
-
-private:
- mutable stringstream underlying;
-};
-
-
-typedef basic_formatter< char > format;
-typedef basic_formatter< wchar_t > wformat;
-
-} // ! namespace Formatter
-
-} // ! namespace Assimp
-#endif
diff --git a/3rdparty/assimp/code/TriangulateProcess.cpp b/3rdparty/assimp/code/TriangulateProcess.cpp
deleted file mode 100644
index c63e43c4..00000000
--- a/3rdparty/assimp/code/TriangulateProcess.cpp
+++ /dev/null
@@ -1,401 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2009, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file TriangulateProcess.cpp
- * @brief Implementation of the post processing step to split up
- * all faces with more than three indices into triangles.
- *
- *
- * The triangulation algorithm will handle concave or convex polygons.
- * Self-intersecting or non-planar polygons are not rejected, but
- * they're probably not triangulated correctly.
- *
- * AI_BUILD_TRIANGULATE_COLOR_FACE_WINDING
- * - generates vertex colors to represent the face winding order.
- * the first vertex of a polygon becomes red, the last blue.
- */
-
-#include "AssimpPCH.h"
-
-#ifndef ASSIMP_BUILD_NO_TRIANGULATE_PROCESS
-#include "TriangulateProcess.h"
-#include "ProcessHelper.h"
-
-//#define AI_BUILD_TRIANGULATE_COLOR_FACE_WINDING
-using namespace Assimp;
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-TriangulateProcess::TriangulateProcess()
-{
- // nothing to do here
-}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-TriangulateProcess::~TriangulateProcess()
-{
- // nothing to do here
-}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the processing step is present in the given flag field.
-bool TriangulateProcess::IsActive( unsigned int pFlags) const
-{
- return (pFlags & aiProcess_Triangulate) != 0;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Executes the post processing step on the given imported data.
-void TriangulateProcess::Execute( aiScene* pScene)
-{
- DefaultLogger::get()->debug("TriangulateProcess begin");
-
- bool bHas = false;
- for ( unsigned int a = 0; a < pScene->mNumMeshes; a++)
- {
- if ( TriangulateMesh( pScene->mMeshes[a]))
- bHas = true;
- }
- if (bHas)DefaultLogger::get()->info ("TriangulateProcess finished. All polygons have been triangulated.");
- else DefaultLogger::get()->debug("TriangulateProcess finished. There was nothing to be done.");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Test whether a point p2 is on the left side of the line formed by p0-p1
-inline bool OnLeftSideOfLine(const aiVector2D& p0, const aiVector2D& p1,const aiVector2D& p2)
-{
- return ( (p1.x - p0.x) * (p2.y - p0.y) - (p2.x - p0.x) * (p1.y - p0.y) ) > 0;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Test whether a point is inside a given triangle in R2
-inline bool PointInTriangle2D(const aiVector2D& p0, const aiVector2D& p1,const aiVector2D& p2, const aiVector2D& pp)
-{
- // Point in triangle test using baryzentric coordinates
- const aiVector2D v0 = p1 - p0;
- const aiVector2D v1 = p2 - p0;
- const aiVector2D v2 = pp - p0;
-
- float dot00 = v0 * v0;
- float dot01 = v0 * v1;
- float dot02 = v0 * v2;
- float dot11 = v1 * v1;
- float dot12 = v1 * v2;
-
- const float invDenom = 1 / (dot00 * dot11 - dot01 * dot01);
- dot11 = (dot11 * dot02 - dot01 * dot12) * invDenom;
- dot00 = (dot00 * dot12 - dot01 * dot02) * invDenom;
-
- return (dot11 > 0) && (dot00 > 0) && (dot11 + dot00 < 1);
-}
-
-// ------------------------------------------------------------------------------------------------
-// Triangulates the given mesh.
-bool TriangulateProcess::TriangulateMesh( aiMesh* pMesh)
-{
- // Now we have aiMesh::mPrimitiveTypes, so this is only here for test cases
- if (!pMesh->mPrimitiveTypes) {
- bool bNeed = false;
-
- for ( unsigned int a = 0; a < pMesh->mNumFaces; a++) {
- const aiFace& face = pMesh->mFaces[a];
-
- if ( face.mNumIndices != 3) {
- bNeed = true;
- }
- }
- if (!bNeed)
- return false;
- }
- else if (!(pMesh->mPrimitiveTypes & aiPrimitiveType_POLYGON)) {
- return false;
- }
-
- // the output mesh will contain triangles, but no polys anymore
- pMesh->mPrimitiveTypes |= aiPrimitiveType_TRIANGLE;
- pMesh->mPrimitiveTypes &= ~aiPrimitiveType_POLYGON;
-
- // Find out how many output faces we'll get
- unsigned int numOut = 0, max_out = 0;
- for ( unsigned int a = 0; a < pMesh->mNumFaces; a++) {
- aiFace& face = pMesh->mFaces[a];
- if ( face.mNumIndices <= 3)
- numOut++;
-
- else {
- numOut += face.mNumIndices-2;
- max_out = std::max(max_out,face.mNumIndices);
- }
- }
-
- // Just another check whether aiMesh::mPrimitiveTypes is correct
- assert(numOut != pMesh->mNumFaces);
-
- aiVector3D* nor_out = NULL;
- if (!pMesh->mNormals && pMesh->mPrimitiveTypes == aiPrimitiveType_POLYGON) {
- nor_out = pMesh->mNormals = new aiVector3D[pMesh->mNumVertices];
- }
-
- aiFace* out = new aiFace[numOut], *curOut = out;
- std::vector<aiVector3D> temp_verts(max_out+2); /* temporary storage for vertices */
-
- // Apply vertex colors to represent the face winding?
-#ifdef AI_BUILD_TRIANGULATE_COLOR_FACE_WINDING
- if (!pMesh->mColors[0])
- pMesh->mColors[0] = new aiColor4D[pMesh->mNumVertices];
- else
- new(pMesh->mColors[0]) aiColor4D[pMesh->mNumVertices];
-
- aiColor4D* clr = pMesh->mColors[0];
-#endif
-
- // use boost::scoped_array to avoid slow std::vector<bool> specialiations
- boost::scoped_array<bool> done(new bool[max_out]);
- for ( unsigned int a = 0; a < pMesh->mNumFaces; a++) {
- aiFace& face = pMesh->mFaces[a];
-
- unsigned int* idx = face.mIndices;
- int num = (int)face.mNumIndices, ear = 0, tmp, prev = num-1, next = 0, max = num;
-
- // Apply vertex colors to represent the face winding?
-#ifdef AI_BUILD_TRIANGULATE_COLOR_FACE_WINDING
- for (unsigned int i = 0; i < face.mNumIndices; ++i) {
- aiColor4D& c = clr[idx[i]];
- c.r = (i+1) / (float)max;
- c.b = 1.f - c.r;
- }
-#endif
-
- // if it's a simple point,line or triangle: just copy it
- if ( face.mNumIndices <= 3)
- {
- aiFace& nface = *curOut++;
- nface.mNumIndices = face.mNumIndices;
- nface.mIndices = face.mIndices;
- }
- // quadrilaterals can't have ears. trifanning will always work
- else if ( face.mNumIndices == 4) {
- aiFace& nface = *curOut++;
- nface.mNumIndices = 3;
- nface.mIndices = face.mIndices;
-
- aiFace& sface = *curOut++;
- sface.mNumIndices = 3;
- sface.mIndices = new unsigned int[3];
-
- sface.mIndices[0] = face.mIndices[0];
- sface.mIndices[1] = face.mIndices[2];
- sface.mIndices[2] = face.mIndices[3];
- }
- else
- {
- // A polygon with more than 3 vertices can be either concave or convex.
- // Usually everything we're getting is convex and we could easily
- // triangulate by trifanning. However, LightWave is probably the only
- // modeller to make extensive use of highly concave monster polygons ...
- // so we need to apply the full 'ear cutting' algorithm.
-
- // RERQUIREMENT: polygon is expected to be simple and *nearly* planar.
- // We project it onto a plane to get 2d data. Working in R3 would
- // also be possible but it's more difficult to implement.
-
- // Collect all vertices of of the polygon.
- aiVector3D* verts = pMesh->mVertices;
- for (tmp = 0; tmp < max; ++tmp) {
- temp_verts[tmp] = verts[idx[tmp]];
- }
-
- // Get newell normal of the polygon. Store it for future use if it's a polygon-only mesh
- aiVector3D n;
- NewellNormal<3,3,3>(n,max,&temp_verts.front().x,&temp_verts.front().y,&temp_verts.front().z);
- if (nor_out) {
- for (tmp = 0; tmp < max; ++tmp)
- nor_out[idx[tmp]] = n;
- }
-
- // Select largest normal coordinate to ignore for projection
- const float ax = (n.x>0 ? n.x : -n.x);
- const float ay = (n.y>0 ? n.y : -n.y);
- const float az = (n.z>0 ? n.z : -n.z);
-
- unsigned int ac = 0, bc = 1; /* no z coord. projection to xy */
- float inv = n.z;
- if (ax > ay) {
- if (ax > az) { /* no x coord. projection to yz */
- ac = 1; bc = 2;
- inv = n.x;
- }
- }
- else if (ay > az) { /* no y coord. projection to zy */
- ac = 2; bc = 0;
- inv = n.y;
- }
-
- // Swap projection axes to take the negated projection vector into account
- if (inv < 0.f) {
- std::swap(ac,bc);
- }
-
- for (tmp =0; tmp < max; ++tmp) {
- temp_verts[tmp].x = verts[idx[tmp]][ac];
- temp_verts[tmp].y = verts[idx[tmp]][bc];
- done[tmp] = false;
- }
-
- //
- // FIXME: currently this is the slow O(kn) variant with a worst case
- // complexity of O(n^2) (I think). Can be done in O(n).
- while (num > 3) {
-
- // Find the next ear of the polygon
- int num_found = 0;
- for (ear = next;;prev = ear,ear = next) {
-
- // break after we looped two times without a positive match
- for (next=ear+1;done[(next>max-1?next=0:next)];++next);
- if (next < ear) {
- if (++num_found == 2) {
- break;
- }
- }
- const aiVector2D* pnt1 = (const aiVector2D*)&temp_verts[ear],
- *pnt0 = (const aiVector2D*)&temp_verts[prev],
- *pnt2 = (const aiVector2D*)&temp_verts[next];
-
- // Must be a convex point. Assuming ccw winding, it must be on the right of the line between p-1 and p+1.
- if (OnLeftSideOfLine (*pnt0,*pnt2,*pnt1)) {
- continue;
- }
-
- // and no other point may be contained in this triangle
- for ( tmp = 0; tmp < max; ++tmp) {
-
- // We need to compare the actual values because it's possible that multiple indexes in
- // the polygon are refering to the same position. concave_polygon.obj is a sample
- //
- // FIXME: Use 'epsiloned' comparisons instead? Due to numeric inaccuracies in
- // PointInTriangle() I'm guessing that it's actually possible to construct
- // input data that would cause us to end up with no ears. The problem is,
- // which epsilon? If we chose a too large value, we'd get wrong results
- const aiVector2D& vtmp = * ((aiVector2D*) &temp_verts[tmp] );
- if ( vtmp != *pnt1 && vtmp != *pnt2 && vtmp != *pnt0 && PointInTriangle2D(*pnt0,*pnt1,*pnt2,vtmp))
- break;
-
- }
- if (tmp != max) {
- continue;
- }
-
- // this vertex is an ear
- break;
- }
- if (num_found == 2) {
-
- // Due to the 'two ear theorem', every simple polygon with more than three points must
- // have 2 'ears'. Here's definitely someting wrong ... but we don't give up yet.
- //
-
- // Instead we're continuting with the standard trifanning algorithm which we'd
- // use if we had only convex polygons. That's life.
- DefaultLogger::get()->error("Failed to triangulate polygon (no ear found). Probably not a simple polygon?");
-
- curOut -= (max-num); /* undo all previous work */
- for (tmp = 0; tmp < max-2; ++tmp) {
- aiFace& nface = *curOut++;
-
- nface.mNumIndices = 3;
- if (!nface.mIndices)
- nface.mIndices = new unsigned int[3];
-
- nface.mIndices[0] = idx[0];
- nface.mIndices[1] = idx[tmp+1];
- nface.mIndices[2] = idx[tmp+2];
- }
- num = 0;
- break;
- }
-
- aiFace& nface = *curOut++;
- nface.mNumIndices = 3;
-
- if (!nface.mIndices) {
- nface.mIndices = new unsigned int[3];
- }
-
- // setup indices for the new triangle ...
- nface.mIndices[0] = idx[prev];
- nface.mIndices[1] = idx[ear];
- nface.mIndices[2] = idx[next];
-
- // exclude the ear from most further processing
- done[ear] = true;
- --num;
- }
- if (num > 0) {
- // We have three indices forming the last 'ear' remaining. Collect them.
- aiFace& nface = *curOut++;
- nface.mNumIndices = 3;
- nface.mIndices = face.mIndices;
-
- for (tmp = 0; done[tmp]; ++tmp);
- idx[0] = idx[tmp];
-
- for (++tmp; done[tmp]; ++tmp);
- idx[1] = idx[tmp];
-
- for (++tmp; done[tmp]; ++tmp);
- idx[2] = idx[tmp];
- }
- }
- face.mIndices = NULL; /* prevent unintended deletion of our awesome results. would be a pity */
- }
-
- // kill the old faces
- delete [] pMesh->mFaces;
-
- // ... and store the new ones
- pMesh->mFaces = out;
- pMesh->mNumFaces = (unsigned int)(curOut-out); /* not necessarily equal to numOut */
- return true;
-}
-
-#endif // !! ASSIMP_BUILD_NO_TRIANGULATE_PROCESS
diff --git a/3rdparty/assimp/code/TriangulateProcess.h b/3rdparty/assimp/code/TriangulateProcess.h
deleted file mode 100644
index 7a680e5a..00000000
--- a/3rdparty/assimp/code/TriangulateProcess.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file Defines a post processing step to triangulate all faces
- with more than three vertices.
- */
-#ifndef AI_TRIANGULATEPROCESS_H_INC
-#define AI_TRIANGULATEPROCESS_H_INC
-
-#include "BaseProcess.h"
-
-struct aiMesh;
-
-class TriangulateProcessTest;
-namespace Assimp
-{
-
-// ---------------------------------------------------------------------------
-/** The TriangulateProcess splits up all faces with more than three indices
- * into triangles. You usually want this to happen because the graphics cards
- * need their data as triangles.
- */
-class ASSIMP_API TriangulateProcess : public BaseProcess
-{
- friend class Importer;
- friend class ::TriangulateProcessTest; // grant the unit test full access to us
-
-protected:
- /** Constructor to be privately used by Importer */
- TriangulateProcess();
-
- /** Destructor, private as well */
- ~TriangulateProcess();
-
-public:
- // -------------------------------------------------------------------
- /** Returns whether the processing step is present in the given flag field.
- * @param pFlags The processing flags the importer was called with. A bitwise
- * combination of #aiPostProcessSteps.
- * @return true if the process is present in this flag fields, false if not.
- */
- bool IsActive( unsigned int pFlags) const;
-
- // -------------------------------------------------------------------
- /** Executes the post processing step on the given imported data.
- * At the moment a process is not supposed to fail.
- * @param pScene The imported data to work at.
- */
- void Execute( aiScene* pScene);
-
-protected:
- // -------------------------------------------------------------------
- /** Triangulates the given mesh.
- * @param pMesh The mesh to triangulate.
- */
- bool TriangulateMesh( aiMesh* pMesh);
-};
-
-} // end of namespace Assimp
-
-#endif // AI_TRIANGULATEPROCESS_H_INC
diff --git a/3rdparty/assimp/code/UnrealLoader.cpp b/3rdparty/assimp/code/UnrealLoader.cpp
deleted file mode 100644
index cae51224..00000000
--- a/3rdparty/assimp/code/UnrealLoader.cpp
+++ /dev/null
@@ -1,426 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file UnrealLoader.cpp
- * @brief Implementation of the UNREAL (*.3D) importer class
- *
- * Sources:
- * http://local.wasp.uwa.edu.au/~pbourke/dataformats/unreal/
- */
-
-#include "AssimpPCH.h"
-
-#ifndef ASSIMP_BUILD_NO_3D_IMPORTER
-
-#include "UnrealLoader.h"
-#include "StreamReader.h"
-#include "ParsingUtils.h"
-#include "fast_atof.h"
-#include "ConvertToLHProcess.h"
-
-using namespace Assimp;
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-UnrealImporter::UnrealImporter()
-: configFrameID (0)
-, configHandleFlags (true)
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-UnrealImporter::~UnrealImporter()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the class can handle the format of the given file.
-bool UnrealImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const
-{
- return SimpleExtensionCheck(pFile,"3d","uc");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Build a string of all file extensions supported
-void UnrealImporter::GetExtensionList(std::set<std::string>& extensions)
-{
- extensions.insert("3d");
- extensions.insert("uc");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Setup configuration properties for the loader
-void UnrealImporter::SetupProperties(const Importer* pImp)
-{
- // The
- // AI_CONFIG_IMPORT_UNREAL_KEYFRAME option overrides the
- // AI_CONFIG_IMPORT_GLOBAL_KEYFRAME option.
- configFrameID = pImp->GetPropertyInteger(AI_CONFIG_IMPORT_UNREAL_KEYFRAME,0xffffffff);
- if (0xffffffff == configFrameID) {
- configFrameID = pImp->GetPropertyInteger(AI_CONFIG_IMPORT_GLOBAL_KEYFRAME,0);
- }
-
- // AI_CONFIG_IMPORT_UNREAL_HANDLE_FLAGS, default is true
- configHandleFlags = (0 != pImp->GetPropertyInteger(AI_CONFIG_IMPORT_UNREAL_HANDLE_FLAGS,1));
-}
-
-// ------------------------------------------------------------------------------------------------
-// Imports the given file into the given scene structure.
-void UnrealImporter::InternReadFile( const std::string& pFile,
- aiScene* pScene, IOSystem* pIOHandler)
-{
- // For any of the 3 files being passed get the three correct paths
- // First of all, determine file extension
- std::string::size_type pos = pFile.find_last_of('.');
- std::string extension = GetExtension(pFile);
-
- std::string d_path,a_path,uc_path;
- if (extension == "3d") {
- // jjjj_d.3d
- // jjjj_a.3d
- pos = pFile.find_last_of('_');
- if (std::string::npos == pos) {
- throw DeadlyImportError("UNREAL: Unexpected naming scheme");
- }
- extension = pFile.substr(0,pos);
- }
- else {
- extension = pFile.substr(0,pos);
- }
-
- // build proper paths
- d_path = extension+"_d.3d";
- a_path = extension+"_a.3d";
- uc_path = extension+".uc";
-
- DefaultLogger::get()->debug("UNREAL: data file is " + d_path);
- DefaultLogger::get()->debug("UNREAL: aniv file is " + a_path);
- DefaultLogger::get()->debug("UNREAL: uc file is " + uc_path);
-
- // and open the files ... we can't live without them
- IOStream* p = pIOHandler->Open(d_path);
- if (!p)
- throw DeadlyImportError("UNREAL: Unable to open _d file");
- StreamReaderLE d_reader(pIOHandler->Open(d_path));
-
- const uint16_t numTris = d_reader.GetI2();
- const uint16_t numVert = d_reader.GetI2();
- d_reader.IncPtr(44);
- if (!numTris || numVert < 3)
- throw DeadlyImportError("UNREAL: Invalid number of vertices/triangles");
-
- // maximum texture index
- unsigned int maxTexIdx = 0;
-
- // collect triangles
- std::vector<Unreal::Triangle> triangles(numTris);
- for (std::vector<Unreal::Triangle>::iterator it = triangles.begin(), end = triangles.end();it != end; ++it) {
- Unreal::Triangle& tri = *it;
-
- for (unsigned int i = 0; i < 3;++i) {
-
- tri.mVertex[i] = d_reader.GetI2();
- if (tri.mVertex[i] >= numTris) {
- DefaultLogger::get()->warn("UNREAL: vertex index out of range");
- tri.mVertex[i] = 0;
- }
- }
- tri.mType = d_reader.GetI1();
-
- // handle mesh flagss?
- if (configHandleFlags)
- tri.mType = Unreal::MF_NORMAL_OS;
- else {
- // ignore MOD and MASKED for the moment, treat them as two-sided
- if (tri.mType == Unreal::MF_NORMAL_MOD_TS || tri.mType == Unreal::MF_NORMAL_MASKED_TS)
- tri.mType = Unreal::MF_NORMAL_TS;
- }
- d_reader.IncPtr(1);
-
- for (unsigned int i = 0; i < 3;++i)
- for (unsigned int i2 = 0; i2 < 2;++i2)
- tri.mTex[i][i2] = d_reader.GetI1();
-
- tri.mTextureNum = d_reader.GetI1();
- maxTexIdx = std::max(maxTexIdx,(unsigned int)tri.mTextureNum);
- d_reader.IncPtr(1);
- }
-
- p = pIOHandler->Open(a_path);
- if (!p)
- throw DeadlyImportError("UNREAL: Unable to open _a file");
- StreamReaderLE a_reader(pIOHandler->Open(a_path));
-
- // read number of frames
- const uint32_t numFrames = a_reader.GetI2();
- if (configFrameID >= numFrames)
- throw DeadlyImportError("UNREAL: The requested frame does not exist");
-
- uint32_t st = a_reader.GetI2();
- if (st != numVert*4)
- throw DeadlyImportError("UNREAL: Unexpected aniv file length");
-
- // skip to our frame
- a_reader.IncPtr(configFrameID *numVert*4);
-
- // collect vertices
- std::vector<aiVector3D> vertices(numVert);
- for (std::vector<aiVector3D>::iterator it = vertices.begin(), end = vertices.end(); it != end; ++it) {
- int32_t val = a_reader.GetI4();
- Unreal::DecompressVertex(*it,val);
- }
-
- // list of textures.
- std::vector< std::pair<unsigned int, std::string> > textures;
-
- // allocate the output scene
- aiNode* nd = pScene->mRootNode = new aiNode();
- nd->mName.Set("<UnrealRoot>");
-
- // we can live without the uc file if necessary
- boost::scoped_ptr<IOStream> pb (pIOHandler->Open(uc_path));
- if (pb.get()) {
-
- std::vector<char> _data;
- TextFileToBuffer(pb.get(),_data);
- const char* data = &_data[0];
-
- std::vector< std::pair< std::string,std::string > > tempTextures;
-
- // do a quick search in the UC file for some known, usually texture-related, tags
- for (;*data;++data) {
- if (TokenMatchI(data,"#exec",5)) {
- SkipSpacesAndLineEnd(&data);
-
- // #exec TEXTURE IMPORT [...] NAME=jjjjj [...] FILE=jjjj.pcx [...]
- if (TokenMatchI(data,"TEXTURE",7)) {
- SkipSpacesAndLineEnd(&data);
-
- if (TokenMatchI(data,"IMPORT",6)) {
- tempTextures.push_back(std::pair< std::string,std::string >());
- std::pair< std::string,std::string >& me = tempTextures.back();
- for (;!IsLineEnd(*data);++data) {
- if (!::ASSIMP_strincmp(data,"NAME=",5)) {
- const char *d = data+=5;
- for (;!IsSpaceOrNewLine(*data);++data);
- me.first = std::string(d,(size_t)(data-d));
- }
- else if (!::ASSIMP_strincmp(data,"FILE=",5)) {
- const char *d = data+=5;
- for (;!IsSpaceOrNewLine(*data);++data);
- me.second = std::string(d,(size_t)(data-d));
- }
- }
- if (!me.first.length() || !me.second.length())
- tempTextures.pop_back();
- }
- }
- // #exec MESHMAP SETTEXTURE MESHMAP=box NUM=1 TEXTURE=Jtex1
- // #exec MESHMAP SCALE MESHMAP=box X=0.1 Y=0.1 Z=0.2
- else if (TokenMatchI(data,"MESHMAP",7)) {
- SkipSpacesAndLineEnd(&data);
-
- if (TokenMatchI(data,"SETTEXTURE",10)) {
-
- textures.push_back(std::pair<unsigned int, std::string>());
- std::pair<unsigned int, std::string>& me = textures.back();
-
- for (;!IsLineEnd(*data);++data) {
- if (!::ASSIMP_strincmp(data,"NUM=",4)) {
- data += 4;
- me.first = strtol10(data,&data);
- }
- else if (!::ASSIMP_strincmp(data,"TEXTURE=",8)) {
- data += 8;
- const char *d = data;
- for (;!IsSpaceOrNewLine(*data);++data);
- me.second = std::string(d,(size_t)(data-d));
-
- // try to find matching path names, doesn't care if we don't find them
- for (std::vector< std::pair< std::string,std::string > >::const_iterator it = tempTextures.begin();
- it != tempTextures.end(); ++it) {
- if ((*it).first == me.second) {
- me.second = (*it).second;
- break;
- }
- }
- }
- }
- }
- else if (TokenMatchI(data,"SCALE",5)) {
-
- for (;!IsLineEnd(*data);++data) {
- if (data[0] == 'X' && data[1] == '=') {
- data = fast_atof_move(data+2,(float&)nd->mTransformation.a1);
- }
- else if (data[0] == 'Y' && data[1] == '=') {
- data = fast_atof_move(data+2,(float&)nd->mTransformation.b2);
- }
- else if (data[0] == 'Z' && data[1] == '=') {
- data = fast_atof_move(data+2,(float&)nd->mTransformation.c3);
- }
- }
- }
- }
- }
- }
- }
- else {
- DefaultLogger::get()->error("Unable to open .uc file");
- }
-
- std::vector<Unreal::TempMat> materials;
- materials.reserve(textures.size()*2+5);
-
- // find out how many output meshes and materials we'll have and build material indices
- for (std::vector<Unreal::Triangle>::iterator it = triangles.begin(), end = triangles.end();it != end; ++it) {
- Unreal::Triangle& tri = *it;
- Unreal::TempMat mat(tri);
- std::vector<Unreal::TempMat>::iterator nt = std::find(materials.begin(),materials.end(),mat);
- if (nt == materials.end()) {
- // add material
- tri.matIndex = materials.size();
- mat.numFaces = 1;
- materials.push_back(mat);
-
- ++pScene->mNumMeshes;
- }
- else {
- tri.matIndex = static_cast<unsigned int>(nt-materials.begin());
- ++nt->numFaces;
- }
- }
-
- if (!pScene->mNumMeshes) {
- throw DeadlyImportError("UNREAL: Unable to find valid mesh data");
- }
-
- // allocate meshes and bind them to the node graph
- pScene->mMeshes = new aiMesh*[pScene->mNumMeshes];
- pScene->mMaterials = new aiMaterial*[pScene->mNumMaterials = pScene->mNumMeshes];
-
- nd->mNumMeshes = pScene->mNumMeshes;
- nd->mMeshes = new unsigned int[nd->mNumMeshes];
- for (unsigned int i = 0; i < pScene->mNumMeshes;++i) {
- aiMesh* m = pScene->mMeshes[i] = new aiMesh();
- m->mPrimitiveTypes = aiPrimitiveType_TRIANGLE;
-
- const unsigned int num = materials[i].numFaces;
- m->mFaces = new aiFace [num];
- m->mVertices = new aiVector3D [num*3];
- m->mTextureCoords[0] = new aiVector3D [num*3];
-
- nd->mMeshes[i] = i;
-
- // create materials, too
- MaterialHelper* mat = new MaterialHelper();
- pScene->mMaterials[i] = mat;
-
- // all white by default - texture rulez
- aiColor3D color(1.f,1.f,1.f);
-
- aiString s;
- ::sprintf(s.data,"mat%i_tx%i_",i,materials[i].tex);
-
- // set the two-sided flag
- if (materials[i].type == Unreal::MF_NORMAL_TS) {
- const int twosided = 1;
- mat->AddProperty(&twosided,1,AI_MATKEY_TWOSIDED);
- ::strcat(s.data,"ts_");
- }
- else ::strcat(s.data,"os_");
-
- // make TRANS faces 90% opaque that RemRedundantMaterials won't catch us
- if (materials[i].type == Unreal::MF_NORMAL_TRANS_TS) {
- const float opac = 0.9f;
- mat->AddProperty(&opac,1,AI_MATKEY_OPACITY);
- ::strcat(s.data,"tran_");
- }
- else ::strcat(s.data,"opaq_");
-
- // a special name for the weapon attachment point
- if (materials[i].type == Unreal::MF_WEAPON_PLACEHOLDER) {
- s.length = ::sprintf(s.data,"$WeaponTag$");
- color = aiColor3D(0.f,0.f,0.f);
- }
-
- // set color and name
- mat->AddProperty(&color,1,AI_MATKEY_COLOR_DIFFUSE);
- s.length = ::strlen(s.data);
- mat->AddProperty(&s,AI_MATKEY_NAME);
-
- // set texture, if any
- const unsigned int tex = materials[i].tex;
- for (std::vector< std::pair< unsigned int, std::string > >::const_iterator it = textures.begin();it != textures.end();++it) {
- if ((*it).first == tex) {
- s.Set((*it).second);
- mat->AddProperty(&s,AI_MATKEY_TEXTURE_DIFFUSE(0));
- break;
- }
- }
- }
-
- // fill them.
- for (std::vector<Unreal::Triangle>::iterator it = triangles.begin(), end = triangles.end();it != end; ++it) {
- Unreal::Triangle& tri = *it;
- Unreal::TempMat mat(tri);
- std::vector<Unreal::TempMat>::iterator nt = std::find(materials.begin(),materials.end(),mat);
-
- aiMesh* mesh = pScene->mMeshes[nt-materials.begin()];
- aiFace& f = mesh->mFaces[mesh->mNumFaces++];
- f.mIndices = new unsigned int[f.mNumIndices = 3];
-
- for (unsigned int i = 0; i < 3;++i,mesh->mNumVertices++) {
- f.mIndices[i] = mesh->mNumVertices;
-
- mesh->mVertices[mesh->mNumVertices] = vertices[ tri.mVertex[i] ];
- mesh->mTextureCoords[0][mesh->mNumVertices] = aiVector3D( tri.mTex[i][0] / 255.f, 1.f - tri.mTex[i][1] / 255.f, 0.f);
- }
- }
-
- // convert to RH
- MakeLeftHandedProcess hero;
- hero.Execute(pScene);
-
- FlipWindingOrderProcess flipper;
- flipper.Execute(pScene);
-}
-
-#endif // !! ASSIMP_BUILD_NO_3D_IMPORTER
diff --git a/3rdparty/assimp/code/UnrealLoader.h b/3rdparty/assimp/code/UnrealLoader.h
deleted file mode 100644
index 64724602..00000000
--- a/3rdparty/assimp/code/UnrealLoader.h
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file UnrealLoader.h
- * @brief Declaration of the .3d (UNREAL) importer class.
- */
-#ifndef INCLUDED_AI_3D_LOADER_H
-#define INCLUDED_AI_3D_LOADER_H
-
-#include "BaseImporter.h"
-namespace Assimp {
-namespace Unreal {
-
- /*
- 0 = Normal one-sided
- 1 = Normal two-sided
- 2 = Translucent two-sided
- 3 = Masked two-sided
- 4 = Modulation blended two-sided
- 8 = Placeholder triangle for weapon positioning (invisible)
- */
-enum MeshFlags {
- MF_NORMAL_OS = 0,
- MF_NORMAL_TS = 1,
- MF_NORMAL_TRANS_TS = 2,
- MF_NORMAL_MASKED_TS = 3,
- MF_NORMAL_MOD_TS = 4,
- MF_WEAPON_PLACEHOLDER = 8
-};
-
- // a single triangle
-struct Triangle {
- uint16_t mVertex[3]; // Vertex indices
- char mType; // James' Mesh Type
- char mColor; // Color for flat and Gourand Shaded
- unsigned char mTex[3][2]; // Texture UV coordinates
- unsigned char mTextureNum; // Source texture offset
- char mFlags; // Unreal Mesh Flags (unused)
-
- unsigned int matIndex;
-};
-
-// temporary representation for a material
-struct TempMat {
- TempMat()
- : numFaces (0)
- {}
-
- TempMat(const Triangle& in)
- : type ((Unreal::MeshFlags)in.mType)
- , tex (in.mTextureNum)
- , numFaces (0)
- {}
-
- // type of mesh
- Unreal::MeshFlags type;
-
- // index of texture
- unsigned int tex;
-
- // number of faces using us
- unsigned int numFaces;
-
- // for std::find
- bool operator == (const TempMat& o ) {
- return (tex == o.tex && type == o.type);
- }
-};
-
-struct Vertex
-{
- int32_t X : 11;
- int32_t Y : 11;
- int32_t Z : 10;
-};
-
- // UNREAL vertex compression
-inline void CompressVertex(const aiVector3D& v, uint32_t& out)
-{
- union {
- Vertex n;
- int32_t t;
- };
- n.X = (int32_t)v.x;
- n.Y = (int32_t)v.y;
- n.Z = (int32_t)v.z;
- out = t;
-}
-
- // UNREAL vertex decompression
-inline void DecompressVertex(aiVector3D& v, int32_t in)
-{
- union {
- Vertex n;
- int32_t i;
- };
- i = in;
-
- v.x = (float)n.X;
- v.y = (float)n.Y;
- v.z = (float)n.Z;
-}
-
-} // end namespace Unreal
-
-// ---------------------------------------------------------------------------
-/** @brief Importer class to load UNREAL files (*.3d)
-*/
-class UnrealImporter : public BaseImporter
-{
- friend class Importer;
-
-protected:
- /** Constructor to be privately used by Importer */
- UnrealImporter();
-
- /** Destructor, private as well */
- ~UnrealImporter();
-
-public:
-
- // -------------------------------------------------------------------
- /** @brief Returns whether we can handle the format of the given file
- *
- * See BaseImporter::CanRead() for details.
- **/
- bool CanRead( const std::string& pFile, IOSystem* pIOHandler,
- bool checkSig) const;
-
-protected:
-
- // -------------------------------------------------------------------
- /** @brief Called by Importer::GetExtensionList()
- *
- * See BaseImporter::GetExtensionList() for details
- */
- void GetExtensionList(std::set<std::string>& extensions);
-
-
- // -------------------------------------------------------------------
- /** @brief Setup properties for the importer
- *
- * See BaseImporter::SetupProperties() for details
- */
- void SetupProperties(const Importer* pImp);
-
-
- // -------------------------------------------------------------------
- /** @brief Imports the given file into the given scene structure.
- *
- * See BaseImporter::InternReadFile() for details
- */
- void InternReadFile( const std::string& pFile, aiScene* pScene,
- IOSystem* pIOHandler);
-
-private:
-
- //! frame to be loaded
- uint32_t configFrameID;
-
- //! process surface flags
- bool configHandleFlags;
-
-}; // !class UnrealImporter
-
-} // end of namespace Assimp
-#endif // AI_UNREALIMPORTER_H_INC
diff --git a/3rdparty/assimp/code/ValidateDataStructure.cpp b/3rdparty/assimp/code/ValidateDataStructure.cpp
deleted file mode 100644
index 6c506ac2..00000000
--- a/3rdparty/assimp/code/ValidateDataStructure.cpp
+++ /dev/null
@@ -1,968 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file ValidateDataStructure.cpp
- * @brief Implementation of the post processing step to validate
- * the data structure returned by Assimp.
- */
-
-#include "AssimpPCH.h"
-
-// internal headers
-#include "ValidateDataStructure.h"
-#include "BaseImporter.h"
-#include "fast_atof.h"
-#include "ProcessHelper.h"
-
-// CRT headers
-#include <stdarg.h>
-
-using namespace Assimp;
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-ValidateDSProcess::ValidateDSProcess()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-ValidateDSProcess::~ValidateDSProcess()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the processing step is present in the given flag field.
-bool ValidateDSProcess::IsActive( unsigned int pFlags) const
-{
- return (pFlags & aiProcess_ValidateDataStructure) != 0;
-}
-// ------------------------------------------------------------------------------------------------
-AI_WONT_RETURN void ValidateDSProcess::ReportError(const char* msg,...)
-{
- ai_assert(NULL != msg);
-
- va_list args;
- va_start(args,msg);
-
- char szBuffer[3000];
- const int iLen = vsprintf(szBuffer,msg,args);
- ai_assert(iLen > 0);
-
- va_end(args);
-#ifdef _DEBUG
- aiAssert( szBuffer,__LINE__,__FILE__ );
-#endif
- throw DeadlyImportError("Validation failed: " + std::string(szBuffer,iLen));
-}
-// ------------------------------------------------------------------------------------------------
-void ValidateDSProcess::ReportWarning(const char* msg,...)
-{
- ai_assert(NULL != msg);
-
- va_list args;
- va_start(args,msg);
-
- char szBuffer[3000];
- const int iLen = vsprintf(szBuffer,msg,args);
- ai_assert(iLen > 0);
-
- va_end(args);
- DefaultLogger::get()->warn("Validation warning: " + std::string(szBuffer,iLen));
-}
-
-// ------------------------------------------------------------------------------------------------
-inline int HasNameMatch(const aiString& in, aiNode* node)
-{
- int result = (node->mName == in ? 1 : 0 );
- for (unsigned int i = 0; i < node->mNumChildren;++i) {
- result += HasNameMatch(in,node->mChildren[i]);
- }
- return result;
-}
-
-// ------------------------------------------------------------------------------------------------
-template <typename T>
-inline void ValidateDSProcess::DoValidation(T** parray, unsigned int size,
- const char* firstName, const char* secondName)
-{
- // validate all entries
- if (size)
- {
- if (!parray)
- {
- ReportError("aiScene::%s is NULL (aiScene::%s is %i)",
- firstName, secondName, size);
- }
- for (unsigned int i = 0; i < size;++i)
- {
- if (!parray[i])
- {
- ReportError("aiScene::%s[%i] is NULL (aiScene::%s is %i)",
- firstName,i,secondName,size);
- }
- Validate(parray[i]);
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-template <typename T>
-inline void ValidateDSProcess::DoValidationEx(T** parray, unsigned int size,
- const char* firstName, const char* secondName)
-{
- // validate all entries
- if (size)
- {
- if (!parray) {
- ReportError("aiScene::%s is NULL (aiScene::%s is %i)",
- firstName, secondName, size);
- }
- for (unsigned int i = 0; i < size;++i)
- {
- if (!parray[i])
- {
- ReportError("aiScene::%s[%i] is NULL (aiScene::%s is %i)",
- firstName,i,secondName,size);
- }
- Validate(parray[i]);
-
- // check whether there are duplicate names
- for (unsigned int a = i+1; a < size;++a)
- {
- if (parray[i]->mName == parray[a]->mName)
- {
- this->ReportError("aiScene::%s[%i] has the same name as "
- "aiScene::%s[%i]",firstName, i,secondName, a);
- }
- }
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-template <typename T>
-inline void ValidateDSProcess::DoValidationWithNameCheck(T** array,
- unsigned int size, const char* firstName,
- const char* secondName)
-{
- // validate all entries
- DoValidationEx(array,size,firstName,secondName);
-
- for (unsigned int i = 0; i < size;++i)
- {
- int res = HasNameMatch(array[i]->mName,mScene->mRootNode);
- if (!res) {
- ReportError("aiScene::%s[%i] has no corresponding node in the scene graph (%s)",
- firstName,i,array[i]->mName.data);
- }
- else if (1 != res) {
- ReportError("aiScene::%s[%i]: there are more than one nodes with %s as name",
- firstName,i,array[i]->mName.data);
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Executes the post processing step on the given imported data.
-void ValidateDSProcess::Execute( aiScene* pScene)
-{
- this->mScene = pScene;
- DefaultLogger::get()->debug("ValidateDataStructureProcess begin");
-
- // validate the node graph of the scene
- Validate(pScene->mRootNode);
-
- // validate all meshes
- if (pScene->mNumMeshes) {
- DoValidation(pScene->mMeshes,pScene->mNumMeshes,"mMeshes","mNumMeshes");
- }
- else if (!(mScene->mFlags & AI_SCENE_FLAGS_INCOMPLETE)) {
- ReportError("aiScene::mNumMeshes is 0. At least one mesh must be there");
- }
- else if (pScene->mMeshes) {
- ReportError("aiScene::mMeshes is non-null although there are no meshes");
- }
-
- // validate all animations
- if (pScene->mNumAnimations) {
- DoValidation(pScene->mAnimations,pScene->mNumAnimations,
- "mAnimations","mNumAnimations");
- }
- else if (pScene->mAnimations) {
- ReportError("aiScene::mAnimations is non-null although there are no animations");
- }
-
- // validate all cameras
- if (pScene->mNumCameras) {
- DoValidationWithNameCheck(pScene->mCameras,pScene->mNumCameras,
- "mCameras","mNumCameras");
- }
- else if (pScene->mCameras) {
- ReportError("aiScene::mCameras is non-null although there are no cameras");
- }
-
- // validate all lights
- if (pScene->mNumLights) {
- DoValidationWithNameCheck(pScene->mLights,pScene->mNumLights,
- "mLights","mNumLights");
- }
- else if (pScene->mLights) {
- ReportError("aiScene::mLights is non-null although there are no lights");
- }
-
- // validate all textures
- if (pScene->mNumTextures) {
- DoValidation(pScene->mTextures,pScene->mNumTextures,
- "mTextures","mNumTextures");
- }
- else if (pScene->mTextures) {
- ReportError("aiScene::mTextures is non-null although there are no textures");
- }
-
- // validate all materials
- if (pScene->mNumMaterials) {
- DoValidation(pScene->mMaterials,pScene->mNumMaterials,"mMaterials","mNumMaterials");
- }
-#if 0
- // NOTE: ScenePreprocessor generates a default material if none is there
- else if (!(mScene->mFlags & AI_SCENE_FLAGS_INCOMPLETE)) {
- ReportError("aiScene::mNumMaterials is 0. At least one material must be there");
- }
-#endif
- else if (pScene->mMaterials) {
- ReportError("aiScene::mMaterials is non-null although there are no materials");
- }
-
-// if (!has)ReportError("The aiScene data structure is empty");
- DefaultLogger::get()->debug("ValidateDataStructureProcess end");
-}
-
-// ------------------------------------------------------------------------------------------------
-void ValidateDSProcess::Validate( const aiLight* pLight)
-{
- if (pLight->mType == aiLightSource_UNDEFINED)
- ReportWarning("aiLight::mType is aiLightSource_UNDEFINED");
-
- if (!pLight->mAttenuationConstant &&
- !pLight->mAttenuationLinear &&
- !pLight->mAttenuationQuadratic) {
- ReportWarning("aiLight::mAttenuationXXX - all are zero");
- }
-
- if (pLight->mAngleInnerCone > pLight->mAngleOuterCone)
- ReportError("aiLight::mAngleInnerCone is larger than aiLight::mAngleOuterCone");
-
- if (pLight->mColorDiffuse.IsBlack() && pLight->mColorAmbient.IsBlack()
- && pLight->mColorSpecular.IsBlack())
- {
- ReportWarning("aiLight::mColorXXX - all are black and won't have any influence");
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void ValidateDSProcess::Validate( const aiCamera* pCamera)
-{
- if (pCamera->mClipPlaneFar <= pCamera->mClipPlaneNear)
- ReportError("aiCamera::mClipPlaneFar must be >= aiCamera::mClipPlaneNear");
-
- // FIX: there are many 3ds files with invalid FOVs. No reason to
- // reject them at all ... a warning is appropriate.
- if (!pCamera->mHorizontalFOV || pCamera->mHorizontalFOV >= (float)AI_MATH_PI)
- ReportWarning("%f is not a valid value for aiCamera::mHorizontalFOV",pCamera->mHorizontalFOV);
-}
-
-// ------------------------------------------------------------------------------------------------
-void ValidateDSProcess::Validate( const aiMesh* pMesh)
-{
- // validate the material index of the mesh
- if (mScene->mNumMaterials && pMesh->mMaterialIndex >= mScene->mNumMaterials)
- {
- ReportError("aiMesh::mMaterialIndex is invalid (value: %i maximum: %i)",
- pMesh->mMaterialIndex,mScene->mNumMaterials-1);
- }
-
- Validate(&pMesh->mName);
-
- for (unsigned int i = 0; i < pMesh->mNumFaces; ++i)
- {
- aiFace& face = pMesh->mFaces[i];
-
- if (pMesh->mPrimitiveTypes)
- {
- switch (face.mNumIndices)
- {
- case 0:
- ReportError("aiMesh::mFaces[%i].mNumIndices is 0",i);
- case 1:
- if (0 == (pMesh->mPrimitiveTypes & aiPrimitiveType_POINT))
- {
- ReportError("aiMesh::mFaces[%i] is a POINT but aiMesh::mPrimtiveTypes "
- "does not report the POINT flag",i);
- }
- break;
- case 2:
- if (0 == (pMesh->mPrimitiveTypes & aiPrimitiveType_LINE))
- {
- ReportError("aiMesh::mFaces[%i] is a LINE but aiMesh::mPrimtiveTypes "
- "does not report the LINE flag",i);
- }
- break;
- case 3:
- if (0 == (pMesh->mPrimitiveTypes & aiPrimitiveType_TRIANGLE))
- {
- ReportError("aiMesh::mFaces[%i] is a TRIANGLE but aiMesh::mPrimtiveTypes "
- "does not report the TRIANGLE flag",i);
- }
- break;
- default:
- if (0 == (pMesh->mPrimitiveTypes & aiPrimitiveType_POLYGON))
- {
- this->ReportError("aiMesh::mFaces[%i] is a POLYGON but aiMesh::mPrimtiveTypes "
- "does not report the POLYGON flag",i);
- }
- break;
- };
- }
-
- if (!face.mIndices)
- ReportError("aiMesh::mFaces[%i].mIndices is NULL",i);
- }
-
- // positions must always be there ...
- if (!pMesh->mNumVertices || (!pMesh->mVertices && !mScene->mFlags)) {
- ReportError("The mesh contains no vertices");
- }
-
- if (pMesh->mNumVertices > AI_MAX_VERTICES) {
- ReportError("Mesh has too many vertices: %u, but the limit is %u",pMesh->mNumVertices,AI_MAX_VERTICES);
- }
- if (pMesh->mNumFaces > AI_MAX_FACES) {
- ReportError("Mesh has too many faces: %u, but the limit is %u",pMesh->mNumFaces,AI_MAX_FACES);
- }
-
- // if tangents are there there must also be bitangent vectors ...
- if ((pMesh->mTangents != NULL) != (pMesh->mBitangents != NULL)) {
- ReportError("If there are tangents, bitangent vectors must be present as well");
- }
-
- // faces, too
- if (!pMesh->mNumFaces || (!pMesh->mFaces && !mScene->mFlags)) {
- ReportError("Mesh contains no faces");
- }
-
- // now check whether the face indexing layout is correct:
- // unique vertices, pseudo-indexed.
- std::vector<bool> abRefList;
- abRefList.resize(pMesh->mNumVertices,false);
- for (unsigned int i = 0; i < pMesh->mNumFaces;++i)
- {
- aiFace& face = pMesh->mFaces[i];
- if (face.mNumIndices > AI_MAX_FACE_INDICES) {
- ReportError("Face %u has too many faces: %u, but the limit is %u",i,face.mNumIndices,AI_MAX_FACE_INDICES);
- }
-
- for (unsigned int a = 0; a < face.mNumIndices;++a)
- {
- if (face.mIndices[a] >= pMesh->mNumVertices) {
- ReportError("aiMesh::mFaces[%i]::mIndices[%i] is out of range",i,a);
- }
- // the MSB flag is temporarily used by the extra verbose
- // mode to tell us that the JoinVerticesProcess might have
- // been executed already.
- if ( !(this->mScene->mFlags & AI_SCENE_FLAGS_NON_VERBOSE_FORMAT ) && abRefList[face.mIndices[a]])
- {
- ReportError("aiMesh::mVertices[%i] is referenced twice - second "
- "time by aiMesh::mFaces[%i]::mIndices[%i]",face.mIndices[a],i,a);
- }
- abRefList[face.mIndices[a]] = true;
- }
- }
-
- // check whether there are vertices that aren't referenced by a face
- bool b = false;
- for (unsigned int i = 0; i < pMesh->mNumVertices;++i) {
- if (!abRefList[i])b = true;
- }
- abRefList.clear();
- if (b)ReportWarning("There are unreferenced vertices");
-
- // texture channel 2 may not be set if channel 1 is zero ...
- {
- unsigned int i = 0;
- for (;i < AI_MAX_NUMBER_OF_TEXTURECOORDS;++i)
- {
- if (!pMesh->HasTextureCoords(i))break;
- }
- for (;i < AI_MAX_NUMBER_OF_TEXTURECOORDS;++i)
- if (pMesh->HasTextureCoords(i))
- {
- ReportError("Texture coordinate channel %i exists "
- "although the previous channel was NULL.",i);
- }
- }
- // the same for the vertex colors
- {
- unsigned int i = 0;
- for (;i < AI_MAX_NUMBER_OF_COLOR_SETS;++i)
- {
- if (!pMesh->HasVertexColors(i))break;
- }
- for (;i < AI_MAX_NUMBER_OF_COLOR_SETS;++i)
- if (pMesh->HasVertexColors(i))
- {
- ReportError("Vertex color channel %i is exists "
- "although the previous channel was NULL.",i);
- }
- }
-
-
- // now validate all bones
- if (pMesh->mNumBones)
- {
- if (!pMesh->mBones)
- {
- ReportError("aiMesh::mBones is NULL (aiMesh::mNumBones is %i)",
- pMesh->mNumBones);
- }
- boost::scoped_array<float> afSum(NULL);
- if (pMesh->mNumVertices)
- {
- afSum.reset(new float[pMesh->mNumVertices]);
- for (unsigned int i = 0; i < pMesh->mNumVertices;++i)
- afSum[i] = 0.0f;
- }
-
- // check whether there are duplicate bone names
- for (unsigned int i = 0; i < pMesh->mNumBones;++i)
- {
- const aiBone* bone = pMesh->mBones[i];
- if (bone->mNumWeights > AI_MAX_BONE_WEIGHTS) {
- ReportError("Bone %u has too many weights: %u, but the limit is %u",i,bone->mNumWeights,AI_MAX_BONE_WEIGHTS);
- }
-
- if (!pMesh->mBones[i])
- {
- ReportError("aiMesh::mBones[%i] is NULL (aiMesh::mNumBones is %i)",
- i,pMesh->mNumBones);
- }
- Validate(pMesh,pMesh->mBones[i],afSum.get());
-
- for (unsigned int a = i+1; a < pMesh->mNumBones;++a)
- {
- if (pMesh->mBones[i]->mName == pMesh->mBones[a]->mName)
- {
- ReportError("aiMesh::mBones[%i] has the same name as "
- "aiMesh::mBones[%i]",i,a);
- }
- }
- }
- // check whether all bone weights for a vertex sum to 1.0 ...
- for (unsigned int i = 0; i < pMesh->mNumVertices;++i)
- {
- if (afSum[i] && (afSum[i] <= 0.94 || afSum[i] >= 1.05)) {
- ReportWarning("aiMesh::mVertices[%i]: bone weight sum != 1.0 (sum is %f)",i,afSum[i]);
- }
- }
- }
- else if (pMesh->mBones)
- {
- ReportError("aiMesh::mBones is non-null although there are no bones");
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void ValidateDSProcess::Validate( const aiMesh* pMesh,
- const aiBone* pBone,float* afSum)
-{
- this->Validate(&pBone->mName);
-
- if (!pBone->mNumWeights) {
- ReportError("aiBone::mNumWeights is zero");
- }
-
- // check whether all vertices affected by this bone are valid
- for (unsigned int i = 0; i < pBone->mNumWeights;++i)
- {
- if (pBone->mWeights[i].mVertexId >= pMesh->mNumVertices) {
- ReportError("aiBone::mWeights[%i].mVertexId is out of range",i);
- }
- else if (!pBone->mWeights[i].mWeight || pBone->mWeights[i].mWeight > 1.0f) {
- ReportWarning("aiBone::mWeights[%i].mWeight has an invalid value",i);
- }
- afSum[pBone->mWeights[i].mVertexId] += pBone->mWeights[i].mWeight;
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void ValidateDSProcess::Validate( const aiAnimation* pAnimation)
-{
- Validate(&pAnimation->mName);
-
- // validate all materials
- if (pAnimation->mNumChannels)
- {
- if (!pAnimation->mChannels) {
- ReportError("aiAnimation::mChannels is NULL (aiAnimation::mNumChannels is %i)",
- pAnimation->mNumChannels);
- }
- for (unsigned int i = 0; i < pAnimation->mNumChannels;++i)
- {
- if (!pAnimation->mChannels[i])
- {
- ReportError("aiAnimation::mChannels[%i] is NULL (aiAnimation::mNumChannels is %i)",
- i, pAnimation->mNumChannels);
- }
- Validate(pAnimation, pAnimation->mChannels[i]);
- }
- }
- else ReportError("aiAnimation::mNumChannels is 0. At least one node animation channel must be there.");
-
- // Animation duration is allowed to be zero in cases where the anim contains only a single key frame.
- // if (!pAnimation->mDuration)this->ReportError("aiAnimation::mDuration is zero");
-}
-
-// ------------------------------------------------------------------------------------------------
-void ValidateDSProcess::SearchForInvalidTextures(const aiMaterial* pMaterial,
- aiTextureType type)
-{
- const char* szType = TextureTypeToString(type);
-
- // ****************************************************************************
- // Search all keys of the material ...
- // textures must be specified with ascending indices
- // (e.g. diffuse #2 may not be specified if diffuse #1 is not there ...)
- // ****************************************************************************
-
- int iNumIndices = 0;
- int iIndex = -1;
- for (unsigned int i = 0; i < pMaterial->mNumProperties;++i)
- {
- aiMaterialProperty* prop = pMaterial->mProperties[i];
- if (!::strcmp(prop->mKey.data,"$tex.file") && prop->mSemantic == type) {
- iIndex = std::max(iIndex, (int) prop->mIndex);
- ++iNumIndices;
-
- if (aiPTI_String != prop->mType)
- ReportError("Material property %s is expected to be a string",prop->mKey.data);
- }
- }
- if (iIndex +1 != iNumIndices) {
- ReportError("%s #%i is set, but there are only %i %s textures",
- szType,iIndex,iNumIndices,szType);
- }
- if (!iNumIndices)return;
- std::vector<aiTextureMapping> mappings(iNumIndices);
-
- // Now check whether all UV indices are valid ...
- bool bNoSpecified = true;
- for (unsigned int i = 0; i < pMaterial->mNumProperties;++i)
- {
- aiMaterialProperty* prop = pMaterial->mProperties[i];
- if (prop->mSemantic != type)continue;
-
- if ((int)prop->mIndex >= iNumIndices)
- {
- ReportError("Found texture property with index %i, although there "
- "are only %i textures of type %s",
- prop->mIndex, iNumIndices, szType);
- }
-
- if (!::strcmp(prop->mKey.data,"$tex.mapping")) {
- if (aiPTI_Integer != prop->mType || prop->mDataLength < sizeof(aiTextureMapping))
- {
- ReportError("Material property %s%i is expected to be an integer (size is %i)",
- prop->mKey.data,prop->mIndex,prop->mDataLength);
- }
- mappings[prop->mIndex] = *((aiTextureMapping*)prop->mData);
- }
- else if (!::strcmp(prop->mKey.data,"$tex.uvtrafo")) {
- if (aiPTI_Float != prop->mType || prop->mDataLength < sizeof(aiUVTransform))
- {
- ReportError("Material property %s%i is expected to be 5 floats large (size is %i)",
- prop->mKey.data,prop->mIndex, prop->mDataLength);
- }
- mappings[prop->mIndex] = *((aiTextureMapping*)prop->mData);
- }
- else if (!::strcmp(prop->mKey.data,"$tex.uvwsrc")) {
- if (aiPTI_Integer != prop->mType || sizeof(int) > prop->mDataLength)
- {
- ReportError("Material property %s%i is expected to be an integer (size is %i)",
- prop->mKey.data,prop->mIndex,prop->mDataLength);
- }
- bNoSpecified = false;
-
- // Ignore UV indices for texture channels that are not there ...
-
- // Get the value
- iIndex = *((unsigned int*)prop->mData);
-
- // Check whether there is a mesh using this material
- // which has not enough UV channels ...
- for (unsigned int a = 0; a < mScene->mNumMeshes;++a)
- {
- aiMesh* mesh = this->mScene->mMeshes[a];
- if (mesh->mMaterialIndex == (unsigned int)i)
- {
- int iChannels = 0;
- while (mesh->HasTextureCoords(iChannels))++iChannels;
- if (iIndex >= iChannels)
- {
- ReportWarning("Invalid UV index: %i (key %s). Mesh %i has only %i UV channels",
- iIndex,prop->mKey.data,a,iChannels);
- }
- }
- }
- }
- }
- if (bNoSpecified)
- {
- // Assume that all textures are using the first UV channel
- for (unsigned int a = 0; a < mScene->mNumMeshes;++a)
- {
- aiMesh* mesh = mScene->mMeshes[a];
- if (mesh->mMaterialIndex == (unsigned int)iIndex && mappings[0] == aiTextureMapping_UV)
- {
- if (!mesh->mTextureCoords[0])
- {
- // This is a special case ... it could be that the
- // original mesh format intended the use of a special
- // mapping here.
- ReportWarning("UV-mapped texture, but there are no UV coords");
- }
- }
- }
- }
-}
-// ------------------------------------------------------------------------------------------------
-void ValidateDSProcess::Validate( const aiMaterial* pMaterial)
-{
- // check whether there are material keys that are obviously not legal
- for (unsigned int i = 0; i < pMaterial->mNumProperties;++i)
- {
- const aiMaterialProperty* prop = pMaterial->mProperties[i];
- if (!prop) {
- ReportError("aiMaterial::mProperties[%i] is NULL (aiMaterial::mNumProperties is %i)",
- i,pMaterial->mNumProperties);
- }
- if (!prop->mDataLength || !prop->mData) {
- ReportError("aiMaterial::mProperties[%i].mDataLength or "
- "aiMaterial::mProperties[%i].mData is 0",i,i);
- }
- // check all predefined types
- if (aiPTI_String == prop->mType) {
- // FIX: strings are now stored in a less expensive way, but we can't use the
- // validation routine for 'normal' aiStrings
- uint32_t len;
- if (prop->mDataLength < 5 || prop->mDataLength < 4 + (len=*reinterpret_cast<uint32_t*>(prop->mData)) + 1) {
- ReportError("aiMaterial::mProperties[%i].mDataLength is "
- "too small to contain a string (%i, needed: %i)",
- i,prop->mDataLength,sizeof(aiString));
- }
- if (prop->mData[prop->mDataLength-1]) {
- ReportError("Missing null-terminator in string material property");
- }
- // Validate((const aiString*)prop->mData);
- }
- else if (aiPTI_Float == prop->mType) {
- if (prop->mDataLength < sizeof(float)) {
- ReportError("aiMaterial::mProperties[%i].mDataLength is "
- "too small to contain a float (%i, needed: %i)",
- i,prop->mDataLength,sizeof(float));
- }
- }
- else if (aiPTI_Integer == prop->mType) {
- if (prop->mDataLength < sizeof(int)) {
- ReportError("aiMaterial::mProperties[%i].mDataLength is "
- "too small to contain an integer (%i, needed: %i)",
- i,prop->mDataLength,sizeof(int));
- }
- }
- // TODO: check whether there is a key with an unknown name ...
- }
-
- // make some more specific tests
- float fTemp;
- int iShading;
- if (AI_SUCCESS == aiGetMaterialInteger( pMaterial,AI_MATKEY_SHADING_MODEL,&iShading)) {
- switch ((aiShadingMode)iShading)
- {
- case aiShadingMode_Blinn:
- case aiShadingMode_CookTorrance:
- case aiShadingMode_Phong:
-
- if (AI_SUCCESS != aiGetMaterialFloat(pMaterial,AI_MATKEY_SHININESS,&fTemp)) {
- ReportWarning("A specular shading model is specified but there is no "
- "AI_MATKEY_SHININESS key");
- }
- if (AI_SUCCESS == aiGetMaterialFloat(pMaterial,AI_MATKEY_SHININESS_STRENGTH,&fTemp) && !fTemp) {
- ReportWarning("A specular shading model is specified but the value of the "
- "AI_MATKEY_SHININESS_STRENGTH key is 0.0");
- }
- break;
- default: ;
- };
- }
-
- if (AI_SUCCESS == aiGetMaterialFloat( pMaterial,AI_MATKEY_OPACITY,&fTemp) && (!fTemp || fTemp > 1.01f)) {
- ReportWarning("Invalid opacity value (must be 0 < opacity < 1.0)");
- }
-
- // Check whether there are invalid texture keys
- // TODO: that's a relict of the past, where texture type and index were baked
- // into the material string ... we could do that in one single pass.
- SearchForInvalidTextures(pMaterial,aiTextureType_DIFFUSE);
- SearchForInvalidTextures(pMaterial,aiTextureType_SPECULAR);
- SearchForInvalidTextures(pMaterial,aiTextureType_AMBIENT);
- SearchForInvalidTextures(pMaterial,aiTextureType_EMISSIVE);
- SearchForInvalidTextures(pMaterial,aiTextureType_OPACITY);
- SearchForInvalidTextures(pMaterial,aiTextureType_SHININESS);
- SearchForInvalidTextures(pMaterial,aiTextureType_HEIGHT);
- SearchForInvalidTextures(pMaterial,aiTextureType_NORMALS);
- SearchForInvalidTextures(pMaterial,aiTextureType_DISPLACEMENT);
- SearchForInvalidTextures(pMaterial,aiTextureType_LIGHTMAP);
- SearchForInvalidTextures(pMaterial,aiTextureType_REFLECTION);
-}
-
-// ------------------------------------------------------------------------------------------------
-void ValidateDSProcess::Validate( const aiTexture* pTexture)
-{
- // the data section may NEVER be NULL
- if (!pTexture->pcData) {
- ReportError("aiTexture::pcData is NULL");
- }
- if (pTexture->mHeight)
- {
- if (!pTexture->mWidth)ReportError("aiTexture::mWidth is zero "
- "(aiTexture::mHeight is %i, uncompressed texture)",pTexture->mHeight);
- }
- else
- {
- if (!pTexture->mWidth) {
- ReportError("aiTexture::mWidth is zero (compressed texture)");
- }
- if ('\0' != pTexture->achFormatHint[3]) {
- ReportWarning("aiTexture::achFormatHint must be zero-terminated");
- }
- else if ('.' == pTexture->achFormatHint[0]) {
- ReportWarning("aiTexture::achFormatHint should contain a file extension "
- "without a leading dot (format hint: %s).",pTexture->achFormatHint);
- }
- }
-
- const char* sz = pTexture->achFormatHint;
- if ((sz[0] >= 'A' && sz[0] <= 'Z') ||
- (sz[1] >= 'A' && sz[1] <= 'Z') ||
- (sz[2] >= 'A' && sz[2] <= 'Z') ||
- (sz[3] >= 'A' && sz[3] <= 'Z')) {
- ReportError("aiTexture::achFormatHint contains non-lowercase letters");
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void ValidateDSProcess::Validate( const aiAnimation* pAnimation,
- const aiNodeAnim* pNodeAnim)
-{
- Validate(&pNodeAnim->mNodeName);
-
- if (!pNodeAnim->mNumPositionKeys && !pNodeAnim->mScalingKeys && !pNodeAnim->mNumRotationKeys)
- ReportError("Empty node animation channel");
-
- // otherwise check whether one of the keys exceeds the total duration of the animation
- if (pNodeAnim->mNumPositionKeys)
- {
- if (!pNodeAnim->mPositionKeys)
- {
- this->ReportError("aiNodeAnim::mPositionKeys is NULL (aiNodeAnim::mNumPositionKeys is %i)",
- pNodeAnim->mNumPositionKeys);
- }
- double dLast = -10e10;
- for (unsigned int i = 0; i < pNodeAnim->mNumPositionKeys;++i)
- {
- // ScenePreprocessor will compute the duration if still the default value
- // (Aramis) Add small epsilon, comparison tended to fail if max_time == duration,
- // seems to be due the compilers register usage/width.
- if (pAnimation->mDuration > 0. && pNodeAnim->mPositionKeys[i].mTime > pAnimation->mDuration+0.001)
- {
- ReportError("aiNodeAnim::mPositionKeys[%i].mTime (%.5f) is larger "
- "than aiAnimation::mDuration (which is %.5f)",i,
- (float)pNodeAnim->mPositionKeys[i].mTime,
- (float)pAnimation->mDuration);
- }
- if (i && pNodeAnim->mPositionKeys[i].mTime <= dLast)
- {
- ReportWarning("aiNodeAnim::mPositionKeys[%i].mTime (%.5f) is smaller "
- "than aiAnimation::mPositionKeys[%i] (which is %.5f)",i,
- (float)pNodeAnim->mPositionKeys[i].mTime,
- i-1, (float)dLast);
- }
- dLast = pNodeAnim->mPositionKeys[i].mTime;
- }
- }
- // rotation keys
- if (pNodeAnim->mNumRotationKeys)
- {
- if (!pNodeAnim->mRotationKeys)
- {
- this->ReportError("aiNodeAnim::mRotationKeys is NULL (aiNodeAnim::mNumRotationKeys is %i)",
- pNodeAnim->mNumRotationKeys);
- }
- double dLast = -10e10;
- for (unsigned int i = 0; i < pNodeAnim->mNumRotationKeys;++i)
- {
- if (pAnimation->mDuration > 0. && pNodeAnim->mRotationKeys[i].mTime > pAnimation->mDuration+0.001)
- {
- ReportError("aiNodeAnim::mRotationKeys[%i].mTime (%.5f) is larger "
- "than aiAnimation::mDuration (which is %.5f)",i,
- (float)pNodeAnim->mRotationKeys[i].mTime,
- (float)pAnimation->mDuration);
- }
- if (i && pNodeAnim->mRotationKeys[i].mTime <= dLast)
- {
- ReportWarning("aiNodeAnim::mRotationKeys[%i].mTime (%.5f) is smaller "
- "than aiAnimation::mRotationKeys[%i] (which is %.5f)",i,
- (float)pNodeAnim->mRotationKeys[i].mTime,
- i-1, (float)dLast);
- }
- dLast = pNodeAnim->mRotationKeys[i].mTime;
- }
- }
- // scaling keys
- if (pNodeAnim->mNumScalingKeys)
- {
- if (!pNodeAnim->mScalingKeys) {
- ReportError("aiNodeAnim::mScalingKeys is NULL (aiNodeAnim::mNumScalingKeys is %i)",
- pNodeAnim->mNumScalingKeys);
- }
- double dLast = -10e10;
- for (unsigned int i = 0; i < pNodeAnim->mNumScalingKeys;++i)
- {
- if (pAnimation->mDuration > 0. && pNodeAnim->mScalingKeys[i].mTime > pAnimation->mDuration+0.001)
- {
- ReportError("aiNodeAnim::mScalingKeys[%i].mTime (%.5f) is larger "
- "than aiAnimation::mDuration (which is %.5f)",i,
- (float)pNodeAnim->mScalingKeys[i].mTime,
- (float)pAnimation->mDuration);
- }
- if (i && pNodeAnim->mScalingKeys[i].mTime <= dLast)
- {
- ReportWarning("aiNodeAnim::mScalingKeys[%i].mTime (%.5f) is smaller "
- "than aiAnimation::mScalingKeys[%i] (which is %.5f)",i,
- (float)pNodeAnim->mScalingKeys[i].mTime,
- i-1, (float)dLast);
- }
- dLast = pNodeAnim->mScalingKeys[i].mTime;
- }
- }
-
- if (!pNodeAnim->mNumScalingKeys && !pNodeAnim->mNumRotationKeys &&
- !pNodeAnim->mNumPositionKeys)
- {
- ReportError("A node animation channel must have at least one subtrack");
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void ValidateDSProcess::Validate( const aiNode* pNode)
-{
- if (!pNode)ReportError("A node of the scenegraph is NULL");
- if (pNode != mScene->mRootNode && !pNode->mParent)
- this->ReportError("A node has no valid parent (aiNode::mParent is NULL)");
-
- this->Validate(&pNode->mName);
-
- // validate all meshes
- if (pNode->mNumMeshes)
- {
- if (!pNode->mMeshes)
- {
- ReportError("aiNode::mMeshes is NULL (aiNode::mNumMeshes is %i)",
- pNode->mNumMeshes);
- }
- std::vector<bool> abHadMesh;
- abHadMesh.resize(mScene->mNumMeshes,false);
- for (unsigned int i = 0; i < pNode->mNumMeshes;++i)
- {
- if (pNode->mMeshes[i] >= mScene->mNumMeshes)
- {
- ReportError("aiNode::mMeshes[%i] is out of range (maximum is %i)",
- pNode->mMeshes[i],mScene->mNumMeshes-1);
- }
- if (abHadMesh[pNode->mMeshes[i]])
- {
- ReportError("aiNode::mMeshes[%i] is already referenced by this node (value: %i)",
- i,pNode->mMeshes[i]);
- }
- abHadMesh[pNode->mMeshes[i]] = true;
- }
- }
- if (pNode->mNumChildren)
- {
- if (!pNode->mChildren) {
- ReportError("aiNode::mChildren is NULL (aiNode::mNumChildren is %i)",
- pNode->mNumChildren);
- }
- for (unsigned int i = 0; i < pNode->mNumChildren;++i) {
- Validate(pNode->mChildren[i]);
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void ValidateDSProcess::Validate( const aiString* pString)
-{
- if (pString->length > MAXLEN)
- {
- this->ReportError("aiString::length is too large (%i, maximum is %i)",
- pString->length,MAXLEN);
- }
- const char* sz = pString->data;
- while (true)
- {
- if ('\0' == *sz)
- {
- if (pString->length != (unsigned int)(sz-pString->data))
- ReportError("aiString::data is invalid: the terminal zero is at a wrong offset");
- break;
- }
- else if (sz >= &pString->data[MAXLEN])
- ReportError("aiString::data is invalid. There is no terminal character");
- ++sz;
- }
-}
diff --git a/3rdparty/assimp/code/ValidateDataStructure.h b/3rdparty/assimp/code/ValidateDataStructure.h
deleted file mode 100644
index e9aa12fb..00000000
--- a/3rdparty/assimp/code/ValidateDataStructure.h
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file Defines a (dummy) post processing step to validate the loader's
- * output data structure (for debugging)
- */
-#ifndef AI_VALIDATEPROCESS_H_INC
-#define AI_VALIDATEPROCESS_H_INC
-
-#include "../include/aiTypes.h"
-#include "BaseProcess.h"
-
-struct aiBone;
-struct aiMesh;
-struct aiAnimation;
-struct aiNodeAnim;
-struct aiTexture;
-struct aiMaterial;
-struct aiNode;
-struct aiString;
-
-namespace Assimp {
-
-// --------------------------------------------------------------------------------------
-/** Validates the whole ASSIMP scene data structure for correctness.
- * ImportErrorException is thrown of the scene is corrupt.*/
-// --------------------------------------------------------------------------------------
-class ASSIMP_API ValidateDSProcess : public BaseProcess
-{
- friend class Importer;
-
-protected:
- /** Constructor to be privately used by Importer */
- ValidateDSProcess();
-
- /** Destructor, private as well */
- ~ValidateDSProcess();
-
-public:
- // -------------------------------------------------------------------
- bool IsActive( unsigned int pFlags) const;
-
- // -------------------------------------------------------------------
- void Execute( aiScene* pScene);
-
-protected:
-
- // -------------------------------------------------------------------
- /** Report a validation error. This will throw an exception,
- * control won't return.
- * @param msg Format string for sprintf().*/
- AI_WONT_RETURN void ReportError(const char* msg,...);
-
-
- // -------------------------------------------------------------------
- /** Report a validation warning. This won't throw an exception,
- * control will return to the callera.
- * @param msg Format string for sprintf().*/
- void ReportWarning(const char* msg,...);
-
-
- // -------------------------------------------------------------------
- /** Validates a mesh
- * @param pMesh Input mesh*/
- void Validate( const aiMesh* pMesh);
-
- // -------------------------------------------------------------------
- /** Validates a bone
- * @param pMesh Input mesh
- * @param pBone Input bone*/
- void Validate( const aiMesh* pMesh,const aiBone* pBone,float* afSum);
-
- // -------------------------------------------------------------------
- /** Validates an animation
- * @param pAnimation Input animation*/
- void Validate( const aiAnimation* pAnimation);
-
- // -------------------------------------------------------------------
- /** Validates a material
- * @param pMaterial Input material*/
- void Validate( const aiMaterial* pMaterial);
-
- // -------------------------------------------------------------------
- /** Search the material data structure for invalid or corrupt
- * texture keys.
- * @param pMaterial Input material
- * @param type Type of the texture*/
- void SearchForInvalidTextures(const aiMaterial* pMaterial,
- aiTextureType type);
-
- // -------------------------------------------------------------------
- /** Validates a texture
- * @param pTexture Input texture*/
- void Validate( const aiTexture* pTexture);
-
- // -------------------------------------------------------------------
- /** Validates a light source
- * @param pLight Input light
- */
- void Validate( const aiLight* pLight);
-
- // -------------------------------------------------------------------
- /** Validates a camera
- * @param pCamera Input camera*/
- void Validate( const aiCamera* pCamera);
-
- // -------------------------------------------------------------------
- /** Validates a bone animation channel
- * @param pAnimation Animation channel.
- * @param pBoneAnim Input bone animation */
- void Validate( const aiAnimation* pAnimation,
- const aiNodeAnim* pBoneAnim);
-
- // -------------------------------------------------------------------
- /** Validates a node and all of its subnodes
- * @param Node Input node*/
- void Validate( const aiNode* pNode);
-
- // -------------------------------------------------------------------
- /** Validates a string
- * @param pString Input string*/
- void Validate( const aiString* pString);
-
-private:
-
- // template to validate one of the aiScene::mXXX arrays
- template <typename T>
- inline void DoValidation(T** array, unsigned int size,
- const char* firstName, const char* secondName);
-
- // extended version: checks whethr T::mName occurs twice
- template <typename T>
- inline void DoValidationEx(T** array, unsigned int size,
- const char* firstName, const char* secondName);
-
- // extension to the first template which does also search
- // the nodegraph for an item with the same name
- template <typename T>
- inline void DoValidationWithNameCheck(T** array, unsigned int size,
- const char* firstName, const char* secondName);
-
- aiScene* mScene;
-};
-
-
-
-
-} // end of namespace Assimp
-
-#endif // AI_VALIDATEPROCESS_H_INC
diff --git a/3rdparty/assimp/code/Vertex.h b/3rdparty/assimp/code/Vertex.h
deleted file mode 100644
index 51e5c84d..00000000
--- a/3rdparty/assimp/code/Vertex.h
+++ /dev/null
@@ -1,301 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-/** @file Defines a helper class to represent an interleaved vertex */
-#ifndef AI_VERTEX_H_INC
-#define AI_VERTEX_H_INC
-namespace Assimp {
-
- ///////////////////////////////////////////////////////////////////////////
- // std::plus-family operates on operands with identical types - we need to
- // support all the (vectype op float) combinations in vector maths.
- // Providing T(float) would open the way to endless implicit conversions.
- ///////////////////////////////////////////////////////////////////////////
- namespace Intern {
- template <typename T0, typename T1, typename TRES = T0> struct plus {
- TRES operator() (const T0& t0, const T1& t1) const {
- return t0+t1;
- }
- };
- template <typename T0, typename T1, typename TRES = T0> struct minus {
- TRES operator() (const T0& t0, const T1& t1) const {
- return t0-t1;
- }
- };
- template <typename T0, typename T1, typename TRES = T0> struct multiplies {
- TRES operator() (const T0& t0, const T1& t1) const {
- return t0*t1;
- }
- };
- template <typename T0, typename T1, typename TRES = T0> struct divides {
- TRES operator() (const T0& t0, const T1& t1) const {
- return t0/t1;
- }
- };
- }
-
-// ------------------------------------------------------------------------------------------------
-/** Intermediate description a vertex with all possible components. Defines a full set of
- * operators, so you may use such a 'Vertex' in basic arithmetics. All operators are applied
- * to *all* vertex components equally. This is useful for stuff like interpolation
- * or subdivision, but won't work if special handling is required for some vertex components. */
-// ------------------------------------------------------------------------------------------------
-class Vertex
-{
- friend Vertex operator + (const Vertex&,const Vertex&);
- friend Vertex operator - (const Vertex&,const Vertex&);
-
- friend Vertex operator + (const Vertex&,float);
- friend Vertex operator - (const Vertex&,float);
- friend Vertex operator * (const Vertex&,float);
- friend Vertex operator / (const Vertex&,float);
-
- friend Vertex operator + (float, const Vertex&);
- friend Vertex operator - (float, const Vertex&);
- friend Vertex operator * (float, const Vertex&);
- friend Vertex operator / (float, const Vertex&);
-
-public:
-
- Vertex() {}
-
- // ----------------------------------------------------------------------------
- /** Extract a particular vertex from a mesh and interleave all components */
- explicit Vertex(const aiMesh* msh, unsigned int idx) {
- ai_assert(idx < msh->mNumVertices);
- position = msh->mVertices[idx];
-
- if (msh->HasNormals()) {
- normal = msh->mNormals[idx];
- }
-
- if (msh->HasTangentsAndBitangents()) {
- tangent = msh->mTangents[idx];
- bitangent = msh->mBitangents[idx];
- }
-
- for (unsigned int i = 0; msh->HasTextureCoords(i); ++i) {
- texcoords[i] = msh->mTextureCoords[i][idx];
- }
-
- for (unsigned int i = 0; msh->HasVertexColors(i); ++i) {
- colors[i] = msh->mColors[i][idx];
- }
- }
-
-public:
-
- Vertex& operator += (const Vertex& v) {
- *this = *this+v;
- return *this;
- }
-
- Vertex& operator -= (const Vertex& v) {
- *this = *this-v;
- return *this;
- }
-
-
-
- Vertex& operator += (float v) {
- *this = *this+v;
- return *this;
- }
-
- Vertex& operator -= (float v) {
- *this = *this-v;
- return *this;
- }
-
- Vertex& operator *= (float v) {
- *this = *this*v;
- return *this;
- }
-
- Vertex& operator /= (float v) {
- *this = *this/v;
- return *this;
- }
-
-public:
-
- // ----------------------------------------------------------------------------
- /** Convert back to non-interleaved storage */
- void SortBack(aiMesh* out, unsigned int idx) const {
-
- ai_assert(idx<out->mNumVertices);
- out->mVertices[idx] = position;
-
- if (out->HasNormals()) {
- out->mNormals[idx] = normal;
- }
-
- if (out->HasTangentsAndBitangents()) {
- out->mTangents[idx] = tangent;
- out->mBitangents[idx] = bitangent;
- }
-
- for (unsigned int i = 0; out->HasTextureCoords(i); ++i) {
- out->mTextureCoords[i][idx] = texcoords[i];
- }
-
- for (unsigned int i = 0; out->HasVertexColors(i); ++i) {
- out->mColors[i][idx] = colors[i];
- }
- }
-
-private:
-
- // ----------------------------------------------------------------------------
- /** Construct from two operands and a binary operation to combine them */
- template <template <typename t> class op> static Vertex BinaryOp(const Vertex& v0, const Vertex& v1) {
- // this is a heavy task for the compiler to optimize ... *pray*
-
- Vertex res;
- res.position = op<aiVector3D>()(v0.position,v1.position);
- res.normal = op<aiVector3D>()(v0.normal,v1.normal);
- res.tangent = op<aiVector3D>()(v0.tangent,v1.tangent);
- res.bitangent = op<aiVector3D>()(v0.bitangent,v1.bitangent);
-
- for (unsigned int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++i) {
- res.texcoords[i] = op<aiVector3D>()(v0.texcoords[i],v1.texcoords[i]);
- }
- for (unsigned int i = 0; i < AI_MAX_NUMBER_OF_COLOR_SETS; ++i) {
- res.colors[i] = op<aiColor4D>()(v0.colors[i],v1.colors[i]);
- }
- return res;
- }
-
- // ----------------------------------------------------------------------------
- /** This time binary arithmetics of v0 with a floating-point number */
- template <template <typename, typename, typename> class op> static Vertex BinaryOp(const Vertex& v0, float f) {
- // this is a heavy task for the compiler to optimize ... *pray*
-
- Vertex res;
- res.position = op<aiVector3D,float,aiVector3D>()(v0.position,f);
- res.normal = op<aiVector3D,float,aiVector3D>()(v0.normal,f);
- res.tangent = op<aiVector3D,float,aiVector3D>()(v0.tangent,f);
- res.bitangent = op<aiVector3D,float,aiVector3D>()(v0.bitangent,f);
-
- for (unsigned int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++i) {
- res.texcoords[i] = op<aiVector3D,float,aiVector3D>()(v0.texcoords[i],f);
- }
- for (unsigned int i = 0; i < AI_MAX_NUMBER_OF_COLOR_SETS; ++i) {
- res.colors[i] = op<aiColor4D,float,aiColor4D>()(v0.colors[i],f);
- }
- return res;
- }
-
- // ----------------------------------------------------------------------------
- /** This time binary arithmetics of v0 with a floating-point number */
- template <template <typename, typename, typename> class op> static Vertex BinaryOp(float f, const Vertex& v0) {
- // this is a heavy task for the compiler to optimize ... *pray*
-
- Vertex res;
- res.position = op<float,aiVector3D,aiVector3D>()(f,v0.position);
- res.normal = op<float,aiVector3D,aiVector3D>()(f,v0.normal);
- res.tangent = op<float,aiVector3D,aiVector3D>()(f,v0.tangent);
- res.bitangent = op<float,aiVector3D,aiVector3D>()(f,v0.bitangent);
-
- for (unsigned int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++i) {
- res.texcoords[i] = op<float,aiVector3D,aiVector3D>()(f,v0.texcoords[i]);
- }
- for (unsigned int i = 0; i < AI_MAX_NUMBER_OF_COLOR_SETS; ++i) {
- res.colors[i] = op<float,aiColor4D,aiColor4D>()(f,v0.colors[i]);
- }
- return res;
- }
-
-public:
-
- aiVector3D position;
- aiVector3D normal;
- aiVector3D tangent, bitangent;
-
- aiVector3D texcoords[AI_MAX_NUMBER_OF_TEXTURECOORDS];
- aiColor4D colors[AI_MAX_NUMBER_OF_COLOR_SETS];
-};
-
-
-
-// ------------------------------------------------------------------------------------------------
-AI_FORCE_INLINE Vertex operator + (const Vertex& v0,const Vertex& v1) {
- return Vertex::BinaryOp<std::plus>(v0,v1);
-}
-
-AI_FORCE_INLINE Vertex operator - (const Vertex& v0,const Vertex& v1) {
- return Vertex::BinaryOp<std::minus>(v0,v1);
-}
-
-// ------------------------------------------------------------------------------------------------
-AI_FORCE_INLINE Vertex operator + (const Vertex& v0,float f) {
- return Vertex::BinaryOp<Intern::plus>(v0,f);
-}
-
-AI_FORCE_INLINE Vertex operator - (const Vertex& v0,float f) {
- return Vertex::BinaryOp<Intern::minus>(v0,f);
-}
-
-AI_FORCE_INLINE Vertex operator * (const Vertex& v0,float f) {
- return Vertex::BinaryOp<Intern::multiplies>(v0,f);
-}
-
-AI_FORCE_INLINE Vertex operator / (const Vertex& v0,float f) {
- return Vertex::BinaryOp<Intern::divides>(v0,f);
-}
-
-// ------------------------------------------------------------------------------------------------
-AI_FORCE_INLINE Vertex operator + (float f,const Vertex& v0) {
- return Vertex::BinaryOp<Intern::plus>(f,v0);
-}
-
-AI_FORCE_INLINE Vertex operator - (float f,const Vertex& v0) {
- return Vertex::BinaryOp<Intern::minus>(f,v0);
-}
-
-AI_FORCE_INLINE Vertex operator * (float f,const Vertex& v0) {
- return Vertex::BinaryOp<Intern::multiplies>(f,v0);
-}
-
-AI_FORCE_INLINE Vertex operator / (float f,const Vertex& v0) {
- return Vertex::BinaryOp<Intern::divides>(f,v0);
-}
-
-}
-#endif
diff --git a/3rdparty/assimp/code/VertexTriangleAdjacency.cpp b/3rdparty/assimp/code/VertexTriangleAdjacency.cpp
deleted file mode 100644
index 07ab5090..00000000
--- a/3rdparty/assimp/code/VertexTriangleAdjacency.cpp
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file Implementation of the VertexTriangleAdjacency helper class
- */
-
-#include "AssimpPCH.h"
-
-// internal headers
-#include "VertexTriangleAdjacency.h"
-
-using namespace Assimp;
-
-// ------------------------------------------------------------------------------------------------
-VertexTriangleAdjacency::VertexTriangleAdjacency(aiFace *pcFaces,
- unsigned int iNumFaces,
- unsigned int iNumVertices /*= 0*/,
- bool bComputeNumTriangles /*= false*/)
-{
- // compute the number of referenced vertices if it wasn't specified by the caller
- const aiFace* const pcFaceEnd = pcFaces + iNumFaces;
- if (!iNumVertices) {
-
- for (aiFace* pcFace = pcFaces; pcFace != pcFaceEnd; ++pcFace) {
- ai_assert(3 == pcFace->mNumIndices);
- iNumVertices = std::max(iNumVertices,pcFace->mIndices[0]);
- iNumVertices = std::max(iNumVertices,pcFace->mIndices[1]);
- iNumVertices = std::max(iNumVertices,pcFace->mIndices[2]);
- }
- }
- unsigned int* pi;
-
- // allocate storage
- if (bComputeNumTriangles) {
- pi = mLiveTriangles = new unsigned int[iNumVertices+1];
- memset(mLiveTriangles,0,sizeof(unsigned int)*(iNumVertices+1));
- mOffsetTable = new unsigned int[iNumVertices+2]+1;
- }
- else {
- pi = mOffsetTable = new unsigned int[iNumVertices+2]+1;
- memset(mOffsetTable,0,sizeof(unsigned int)*(iNumVertices+1));
- mLiveTriangles = NULL; // important, otherwise the d'tor would crash
- }
-
- // get a pointer to the end of the buffer
- unsigned int* piEnd = pi+iNumVertices;
- *piEnd++ = 0u;
-
- // first pass: compute the number of faces referencing each vertex
- for (aiFace* pcFace = pcFaces; pcFace != pcFaceEnd; ++pcFace)
- {
- pi[pcFace->mIndices[0]]++;
- pi[pcFace->mIndices[1]]++;
- pi[pcFace->mIndices[2]]++;
- }
-
- // second pass: compute the final offset table
- unsigned int iSum = 0;
- unsigned int* piCurOut = this->mOffsetTable;
- for (unsigned int* piCur = pi; piCur != piEnd;++piCur,++piCurOut) {
-
- unsigned int iLastSum = iSum;
- iSum += *piCur;
- *piCurOut = iLastSum;
- }
- pi = this->mOffsetTable;
-
- // third pass: compute the final table
- this->mAdjacencyTable = new unsigned int[iSum];
- iSum = 0;
- for (aiFace* pcFace = pcFaces; pcFace != pcFaceEnd; ++pcFace,++iSum) {
-
- unsigned int idx = pcFace->mIndices[0];
- mAdjacencyTable[pi[idx]++] = iSum;
-
- idx = pcFace->mIndices[1];
- mAdjacencyTable[pi[idx]++] = iSum;
-
- idx = pcFace->mIndices[2];
- mAdjacencyTable[pi[idx]++] = iSum;
- }
- // fourth pass: undo the offset computations made during the third pass
- // We could do this in a separate buffer, but this would be TIMES slower.
- --mOffsetTable;
- *mOffsetTable = 0u;
-}
-// ------------------------------------------------------------------------------------------------
-VertexTriangleAdjacency::~VertexTriangleAdjacency()
-{
- // delete allocated storage
- delete[] mOffsetTable;
- delete[] mAdjacencyTable;
- delete[] mLiveTriangles;
-}
diff --git a/3rdparty/assimp/code/VertexTriangleAdjacency.h b/3rdparty/assimp/code/VertexTriangleAdjacency.h
deleted file mode 100644
index f5d2f7b2..00000000
--- a/3rdparty/assimp/code/VertexTriangleAdjacency.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file Defines a helper class to compute a vertex-triangle adjacency map */
-#ifndef AI_VTADJACENCY_H_INC
-#define AI_VTADJACENCY_H_INC
-
-#include "BaseProcess.h"
-#include "../include/aiTypes.h"
-#include "../include/aiAssert.h"
-
-struct aiMesh;
-namespace Assimp {
-
-// --------------------------------------------------------------------------------------------
-/** @brief The VertexTriangleAdjacency class computes a vertex-triangle
- * adjacency map from a given index buffer.
- *
- * @note Although it is called #VertexTriangleAdjacency, the current version does also
- * support arbitrary polygons. */
-// --------------------------------------------------------------------------------------------
-class ASSIMP_API VertexTriangleAdjacency
-{
-public:
-
- // ----------------------------------------------------------------------------
- /** @brief Construction from an existing index buffer
- * @param pcFaces Index buffer
- * @param iNumFaces Number of faces in the buffer
- * @param iNumVertices Number of referenced vertices. This value
- * is computed automatically if 0 is specified.
- * @param bComputeNumTriangles If you want the class to compute
- * a list containing the number of referenced triangles per vertex
- * per vertex - pass true. */
- VertexTriangleAdjacency(aiFace* pcFaces,unsigned int iNumFaces,
- unsigned int iNumVertices = 0,
- bool bComputeNumTriangles = true);
-
-
- // ----------------------------------------------------------------------------
- /** @brief Destructor */
- ~VertexTriangleAdjacency();
-
-
-public:
-
- // ----------------------------------------------------------------------------
- /** @brief Get all triangles adjacent to a vertex
- * @param iVertIndex Index of the vertex
- * @return A pointer to the adjacency list. */
- unsigned int* GetAdjacentTriangles(unsigned int iVertIndex) const
- {
- ai_assert(iVertIndex < iNumVertices);
- return &mAdjacencyTable[ mOffsetTable[iVertIndex]];
- }
-
-
- // ----------------------------------------------------------------------------
- /** @brief Get the number of triangles that are referenced by
- * a vertex. This function returns a reference that can be modified
- * @param iVertIndex Index of the vertex
- * @return Number of referenced triangles */
- unsigned int& GetNumTrianglesPtr(unsigned int iVertIndex)
- {
- ai_assert(iVertIndex < iNumVertices && NULL != mLiveTriangles);
- return mLiveTriangles[iVertIndex];
- }
-
-
-public:
-
- //! Offset table
- unsigned int* mOffsetTable;
-
- //! Adjacency table
- unsigned int* mAdjacencyTable;
-
- //! Table containing the number of referenced triangles per vertex
- unsigned int* mLiveTriangles;
-
- //! Debug: Number of referenced vertices
- unsigned int iNumVertices;
-
-};
-}
-
-#endif // !! AI_VTADJACENCY_H_INC
diff --git a/3rdparty/assimp/code/Win32DebugLogStream.h b/3rdparty/assimp/code/Win32DebugLogStream.h
deleted file mode 100644
index a17b5f05..00000000
--- a/3rdparty/assimp/code/Win32DebugLogStream.h
+++ /dev/null
@@ -1,50 +0,0 @@
-#ifndef AI_WIN32DEBUGLOGSTREAM_H_INC
-#define AI_WIN32DEBUGLOGSTREAM_H_INC
-
-#ifdef WIN32
-
-#include "../include/LogStream.h"
-#include "Windows.h"
-
-namespace Assimp {
-
-// ---------------------------------------------------------------------------
-/** @class Win32DebugLogStream
- * @brief Logs into the debug stream from win32.
- */
-class Win32DebugLogStream :
- public LogStream
-{
-public:
- /** @brief Default constructor */
- Win32DebugLogStream();
-
- /** @brief Destructor */
- ~Win32DebugLogStream();
-
- /** @brief Writer */
- void write(const char* messgae);
-};
-
-// ---------------------------------------------------------------------------
-// Default constructor
-inline Win32DebugLogStream::Win32DebugLogStream()
-{}
-
-// ---------------------------------------------------------------------------
-// Default constructor
-inline Win32DebugLogStream::~Win32DebugLogStream()
-{}
-
-// ---------------------------------------------------------------------------
-// Write method
-inline void Win32DebugLogStream::write(const char* message)
-{
- OutputDebugStringA( message);
-}
-
-// ---------------------------------------------------------------------------
-} // Namespace Assimp
-
-#endif // ! WIN32
-#endif // guard
diff --git a/3rdparty/assimp/code/XFileHelper.h b/3rdparty/assimp/code/XFileHelper.h
deleted file mode 100644
index 23b8f77c..00000000
--- a/3rdparty/assimp/code/XFileHelper.h
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-
-/** @file Defines the helper data structures for importing XFiles */
-#ifndef AI_XFILEHELPER_H_INC
-#define AI_XFILEHELPER_H_INC
-
-#include <string>
-#include <vector>
-
-#include "../include/aiTypes.h"
-#include "../include/aiQuaternion.h"
-#include "../include/aiMesh.h"
-#include "../include/aiAnim.h"
-
-namespace Assimp
-{
-namespace XFile
-{
-
-/** Helper structure representing a XFile mesh face */
-struct Face
-{
- std::vector<unsigned int> mIndices;
-};
-
-/** Helper structure representing a texture filename inside a material and its potential source */
-struct TexEntry
-{
- std::string mName;
- bool mIsNormalMap; // true if the texname was specified in a NormalmapFilename tag
-
- TexEntry() { mIsNormalMap = false; }
- TexEntry( const std::string& pName, bool pIsNormalMap = false)
- : mName( pName), mIsNormalMap( pIsNormalMap)
- { /* done */ }
-};
-
-/** Helper structure representing a XFile material */
-struct Material
-{
- std::string mName;
- bool mIsReference; // if true, mName holds a name by which the actual material can be found in the material list
- aiColor4D mDiffuse;
- float mSpecularExponent;
- aiColor3D mSpecular;
- aiColor3D mEmissive;
- std::vector<TexEntry> mTextures;
-
- Material() { mIsReference = false; }
-};
-
-/** Helper structure to represent a bone weight */
-struct BoneWeight
-{
- unsigned int mVertex;
- float mWeight;
-};
-
-/** Helper structure to represent a bone in a mesh */
-struct Bone
-{
- std::string mName;
- std::vector<BoneWeight> mWeights;
- aiMatrix4x4 mOffsetMatrix;
-};
-
-/** Helper structure to represent an XFile mesh */
-struct Mesh
-{
- std::vector<aiVector3D> mPositions;
- std::vector<Face> mPosFaces;
- std::vector<aiVector3D> mNormals;
- std::vector<Face> mNormFaces;
- unsigned int mNumTextures;
- std::vector<aiVector2D> mTexCoords[AI_MAX_NUMBER_OF_TEXTURECOORDS];
- unsigned int mNumColorSets;
- std::vector<aiColor4D> mColors[AI_MAX_NUMBER_OF_COLOR_SETS];
-
- std::vector<unsigned int> mFaceMaterials;
- std::vector<Material> mMaterials;
-
- std::vector<Bone> mBones;
-
- Mesh() { mNumTextures = 0; mNumColorSets = 0; }
-};
-
-/** Helper structure to represent a XFile frame */
-struct Node
-{
- std::string mName;
- aiMatrix4x4 mTrafoMatrix;
- Node* mParent;
- std::vector<Node*> mChildren;
- std::vector<Mesh*> mMeshes;
-
- Node() { mParent = NULL; }
- Node( Node* pParent) { mParent = pParent; }
- ~Node()
- {
- for ( unsigned int a = 0; a < mChildren.size(); a++)
- delete mChildren[a];
- for ( unsigned int a = 0; a < mMeshes.size(); a++)
- delete mMeshes[a];
- }
-};
-
-struct MatrixKey
-{
- double mTime;
- aiMatrix4x4 mMatrix;
-};
-
-/** Helper structure representing a single animated bone in a XFile */
-struct AnimBone
-{
- std::string mBoneName;
- std::vector<aiVectorKey> mPosKeys; // either three separate key sequences for position, rotation, scaling
- std::vector<aiQuatKey> mRotKeys;
- std::vector<aiVectorKey> mScaleKeys;
- std::vector<MatrixKey> mTrafoKeys; // or a combined key sequence of transformation matrices.
-};
-
-/** Helper structure to represent an animation set in a XFile */
-struct Animation
-{
- std::string mName;
- std::vector<AnimBone*> mAnims;
-
- ~Animation()
- {
- for ( unsigned int a = 0; a < mAnims.size(); a++)
- delete mAnims[a];
- }
-};
-
-/** Helper structure analogue to aiScene */
-struct Scene
-{
- Node* mRootNode;
-
- std::vector<Mesh*> mGlobalMeshes; // global meshes found outside of any frames
- std::vector<Material> mGlobalMaterials; // global materials found outside of any meshes.
-
- std::vector<Animation*> mAnims;
- unsigned int mAnimTicksPerSecond;
-
- Scene() { mRootNode = NULL; mAnimTicksPerSecond = 0; }
- ~Scene()
- {
- delete mRootNode;
- for ( unsigned int a = 0; a < mGlobalMeshes.size(); a++)
- delete mGlobalMeshes[a];
- for ( unsigned int a = 0; a < mAnims.size(); a++)
- delete mAnims[a];
- }
-};
-
-} // end of namespace XFile
-} // end of namespace Assimp
-
-#endif // AI_XFILEHELPER_H_INC
diff --git a/3rdparty/assimp/code/XFileImporter.cpp b/3rdparty/assimp/code/XFileImporter.cpp
deleted file mode 100644
index 1abfb1f2..00000000
--- a/3rdparty/assimp/code/XFileImporter.cpp
+++ /dev/null
@@ -1,672 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
-copyright notice, this list of conditions and the
-following disclaimer.
-
-* Redistributions in binary form must reproduce the above
-copyright notice, this list of conditions and the
-following disclaimer in the documentation and/or other
-materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
-contributors may be used to endorse or promote products
-derived from this software without specific prior
-written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-/** @file XFileImporter.cpp
- * @brief Implementation of the XFile importer class
- */
-
-#include "AssimpPCH.h"
-#ifndef ASSIMP_BUILD_NO_X_IMPORTER
-
-#include "XFileImporter.h"
-#include "XFileParser.h"
-#include "ConvertToLHProcess.h"
-
-using namespace Assimp;
-
-// ------------------------------------------------------------------------------------------------
-// Constructor to be privately used by Importer
-XFileImporter::XFileImporter()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor, private as well
-XFileImporter::~XFileImporter()
-{}
-
-// ------------------------------------------------------------------------------------------------
-// Returns whether the class can handle the format of the given file.
-bool XFileImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const
-{
- std::string extension = GetExtension(pFile);
- if (extension == "x") {
- return true;
- }
- if (!extension.length() || checkSig) {
- uint32_t token[1];
- token[0] = AI_MAKE_MAGIC("xof ");
- return CheckMagicToken(pIOHandler,pFile,token,1,0);
- }
- return false;
-}
-
-// ------------------------------------------------------------------------------------------------
-void XFileImporter::GetExtensionList(std::set<std::string>& extensions)
-{
- extensions.insert("x");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Imports the given file into the given scene structure.
-void XFileImporter::InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler)
-{
- // read file into memory
- boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile));
- if ( file.get() == NULL)
- throw DeadlyImportError( "Failed to open file " + pFile + ".");
-
- size_t fileSize = file->FileSize();
- if ( fileSize < 16)
- throw DeadlyImportError( "XFile is too small.");
-
- // need to clear members - this method might be called multiple
- // times on a single XFileImporter instance.
- mImportedMats.clear();
-
- // in the hope that binary files will never start with a BOM ...
- mBuffer.resize( fileSize);
- file->Read( &mBuffer.front(), 1, fileSize);
- ConvertToUTF8(mBuffer);
-
- // parse the file into a temporary representation
- XFileParser parser( mBuffer);
-
- // and create the proper return structures out of it
- CreateDataRepresentationFromImport( pScene, parser.GetImportedData());
-
- // if nothing came from it, report it as error
- if ( !pScene->mRootNode)
- throw DeadlyImportError( "XFile is ill-formatted - no content imported.");
-}
-
-// ------------------------------------------------------------------------------------------------
-// Constructs the return data structure out of the imported data.
-void XFileImporter::CreateDataRepresentationFromImport( aiScene* pScene, const XFile::Scene* pData)
-{
- // Read the global materials first so that meshes referring to them can find them later
- ConvertMaterials( pScene, pData->mGlobalMaterials);
-
- // copy nodes, extracting meshes and materials on the way
- pScene->mRootNode = CreateNodes( pScene, NULL, pData->mRootNode);
-
- // extract animations
- CreateAnimations( pScene, pData);
-
- // read the global meshes that were stored outside of any node
- if ( pData->mGlobalMeshes.size() > 0)
- {
- // create a root node to hold them if there isn't any, yet
- if ( pScene->mRootNode == NULL)
- {
- pScene->mRootNode = new aiNode;
- pScene->mRootNode->mName.Set( "$dummy_node");
- }
-
- // convert all global meshes and store them in the root node.
- // If there was one before, the global meshes now suddenly have its transformation matrix...
- // Don't know what to do there, I don't want to insert another node under the present root node
- // just to avoid this.
- CreateMeshes( pScene, pScene->mRootNode, pData->mGlobalMeshes);
- }
-
- // Convert everything to OpenGL space... it's the same operation as the conversion back, so we can reuse the step directly
- MakeLeftHandedProcess convertProcess;
- convertProcess.Execute( pScene);
-
- FlipWindingOrderProcess flipper;
- flipper.Execute(pScene);
-
- // finally: create a dummy material if not material was imported
- if ( pScene->mNumMaterials == 0)
- {
- pScene->mNumMaterials = 1;
- // create the Material
- Assimp::MaterialHelper* mat = new Assimp::MaterialHelper;
- int shadeMode = (int) aiShadingMode_Gouraud;
- mat->AddProperty<int>( &shadeMode, 1, AI_MATKEY_SHADING_MODEL);
- // material colours
- int specExp = 1;
-
- aiColor3D clr = aiColor3D( 0, 0, 0);
- mat->AddProperty( &clr, 1, AI_MATKEY_COLOR_EMISSIVE);
- mat->AddProperty( &clr, 1, AI_MATKEY_COLOR_SPECULAR);
-
- clr = aiColor3D( 0.5f, 0.5f, 0.5f);
- mat->AddProperty( &clr, 1, AI_MATKEY_COLOR_DIFFUSE);
- mat->AddProperty( &specExp, 1, AI_MATKEY_SHININESS);
-
- pScene->mMaterials = new aiMaterial*[1];
- pScene->mMaterials[0] = mat;
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Recursively creates scene nodes from the imported hierarchy.
-aiNode* XFileImporter::CreateNodes( aiScene* pScene, aiNode* pParent, const XFile::Node* pNode)
-{
- if ( !pNode)
- return NULL;
-
- // create node
- aiNode* node = new aiNode;
- node->mName.length = pNode->mName.length();
- node->mParent = pParent;
- memcpy( node->mName.data, pNode->mName.c_str(), pNode->mName.length());
- node->mName.data[node->mName.length] = 0;
- node->mTransformation = pNode->mTrafoMatrix;
-
- // convert meshes from the source node
- CreateMeshes( pScene, node, pNode->mMeshes);
-
- // handle childs
- if ( pNode->mChildren.size() > 0)
- {
- node->mNumChildren = (unsigned int)pNode->mChildren.size();
- node->mChildren = new aiNode* [node->mNumChildren];
-
- for ( unsigned int a = 0; a < pNode->mChildren.size(); a++)
- node->mChildren[a] = CreateNodes( pScene, node, pNode->mChildren[a]);
- }
-
- return node;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Creates the meshes for the given node.
-void XFileImporter::CreateMeshes( aiScene* pScene, aiNode* pNode, const std::vector<XFile::Mesh*>& pMeshes)
-{
- if ( pMeshes.size() == 0)
- return;
-
- // create a mesh for each mesh-material combination in the source node
- std::vector<aiMesh*> meshes;
- for ( unsigned int a = 0; a < pMeshes.size(); a++)
- {
- const XFile::Mesh* sourceMesh = pMeshes[a];
- // first convert its materials so that we can find them when searching by name afterwards
- ConvertMaterials( pScene, sourceMesh->mMaterials);
-
- unsigned int numMaterials = std::max( (unsigned int)sourceMesh->mMaterials.size(), 1u);
- for ( unsigned int b = 0; b < numMaterials; b++)
- {
- // collect the faces belonging to this material
- std::vector<unsigned int> faces;
- unsigned int numVertices = 0;
- if ( sourceMesh->mFaceMaterials.size() > 0)
- {
- // if there is a per-face material defined, select the faces with the corresponding material
- for ( unsigned int c = 0; c < sourceMesh->mFaceMaterials.size(); c++)
- {
- if ( sourceMesh->mFaceMaterials[c] == b)
- {
- faces.push_back( c);
- numVertices += (unsigned int)sourceMesh->mPosFaces[c].mIndices.size();
- }
- }
- } else
- {
- // if there is no per-face material, place everything into one mesh
- for ( unsigned int c = 0; c < sourceMesh->mPosFaces.size(); c++)
- {
- faces.push_back( c);
- numVertices += (unsigned int)sourceMesh->mPosFaces[c].mIndices.size();
- }
- }
-
- // no faces/vertices using this material? strange...
- if ( numVertices == 0)
- continue;
-
- // create a submesh using this material
- aiMesh* mesh = new aiMesh;
- meshes.push_back( mesh);
-
- // find the material by name in the scene's material list. Either own material
- // or referenced material, it should already be found there
- if ( sourceMesh->mFaceMaterials.size() > 0)
- {
- std::map<std::string, unsigned int>::const_iterator matIt = mImportedMats.find( sourceMesh->mMaterials[b].mName);
- if ( matIt == mImportedMats.end())
- mesh->mMaterialIndex = 0;
- else
- mesh->mMaterialIndex = matIt->second;
- } else
- {
- mesh->mMaterialIndex = 0;
- }
-
- // Create properly sized data arrays in the mesh. We store unique vertices per face,
- // as specified
- mesh->mNumVertices = numVertices;
- mesh->mVertices = new aiVector3D[numVertices];
- mesh->mNumFaces = (unsigned int)faces.size();
- mesh->mFaces = new aiFace[mesh->mNumFaces];
-
- // normals?
- if ( sourceMesh->mNormals.size() > 0)
- mesh->mNormals = new aiVector3D[numVertices];
- // texture coords
- for ( unsigned int c = 0; c < AI_MAX_NUMBER_OF_TEXTURECOORDS; c++)
- {
- if ( sourceMesh->mTexCoords[c].size() > 0)
- mesh->mTextureCoords[c] = new aiVector3D[numVertices];
- }
- // vertex colors
- for ( unsigned int c = 0; c < AI_MAX_NUMBER_OF_COLOR_SETS; c++)
- {
- if ( sourceMesh->mColors[c].size() > 0)
- mesh->mColors[c] = new aiColor4D[numVertices];
- }
-
- // now collect the vertex data of all data streams present in the imported mesh
- unsigned int newIndex = 0;
- std::vector<unsigned int> orgPoints; // from which original point each new vertex stems
- orgPoints.resize( numVertices, 0);
-
- for ( unsigned int c = 0; c < faces.size(); c++)
- {
- unsigned int f = faces[c]; // index of the source face
- const XFile::Face& pf = sourceMesh->mPosFaces[f]; // position source face
-
- // create face. either triangle or triangle fan depending on the index count
- aiFace& df = mesh->mFaces[c]; // destination face
- df.mNumIndices = (unsigned int)pf.mIndices.size();
- df.mIndices = new unsigned int[ df.mNumIndices];
-
- // collect vertex data for indices of this face
- for ( unsigned int d = 0; d < df.mNumIndices; d++)
- {
- df.mIndices[d] = newIndex;
- orgPoints[newIndex] = pf.mIndices[d];
-
- // Position
- mesh->mVertices[newIndex] = sourceMesh->mPositions[pf.mIndices[d]];
- // Normal, if present
- if ( mesh->HasNormals())
- mesh->mNormals[newIndex] = sourceMesh->mNormals[sourceMesh->mNormFaces[f].mIndices[d]];
-
- // texture coord sets
- for ( unsigned int e = 0; e < AI_MAX_NUMBER_OF_TEXTURECOORDS; e++)
- {
- if ( mesh->HasTextureCoords( e))
- {
- aiVector2D tex = sourceMesh->mTexCoords[e][pf.mIndices[d]];
- mesh->mTextureCoords[e][newIndex] = aiVector3D( tex.x, 1.0f - tex.y, 0.0f);
- }
- }
- // vertex color sets
- for ( unsigned int e = 0; e < AI_MAX_NUMBER_OF_COLOR_SETS; e++)
- if ( mesh->HasVertexColors( e))
- mesh->mColors[e][newIndex] = sourceMesh->mColors[e][pf.mIndices[d]];
-
- newIndex++;
- }
- }
-
- // there should be as much new vertices as we calculated before
- assert( newIndex == numVertices);
-
- // convert all bones of the source mesh which influence vertices in this newly created mesh
- const std::vector<XFile::Bone>& bones = sourceMesh->mBones;
- std::vector<aiBone*> newBones;
- for ( unsigned int c = 0; c < bones.size(); c++)
- {
- const XFile::Bone& obone = bones[c];
- // set up a vertex-linear array of the weights for quick searching if a bone influences a vertex
- std::vector<float> oldWeights( sourceMesh->mPositions.size(), 0.0f);
- for ( unsigned int d = 0; d < obone.mWeights.size(); d++)
- oldWeights[obone.mWeights[d].mVertex] = obone.mWeights[d].mWeight;
-
- // collect all vertex weights that influence a vertex in the new mesh
- std::vector<aiVertexWeight> newWeights;
- newWeights.reserve( numVertices);
- for ( unsigned int d = 0; d < orgPoints.size(); d++)
- {
- // does the new vertex stem from an old vertex which was influenced by this bone?
- float w = oldWeights[orgPoints[d]];
- if ( w > 0.0f)
- newWeights.push_back( aiVertexWeight( d, w));
- }
-
- // if the bone has no weights in the newly created mesh, ignore it
- if ( newWeights.size() == 0)
- continue;
-
- // create
- aiBone* nbone = new aiBone;
- newBones.push_back( nbone);
- // copy name and matrix
- nbone->mName.Set( obone.mName);
- nbone->mOffsetMatrix = obone.mOffsetMatrix;
- nbone->mNumWeights = (unsigned int)newWeights.size();
- nbone->mWeights = new aiVertexWeight[nbone->mNumWeights];
- for ( unsigned int d = 0; d < newWeights.size(); d++)
- nbone->mWeights[d] = newWeights[d];
- }
-
- // store the bones in the mesh
- mesh->mNumBones = (unsigned int)newBones.size();
- if ( newBones.size() > 0)
- {
- mesh->mBones = new aiBone*[mesh->mNumBones];
- std::copy( newBones.begin(), newBones.end(), mesh->mBones);
- }
- }
- }
-
- // reallocate scene mesh array to be large enough
- aiMesh** prevArray = pScene->mMeshes;
- pScene->mMeshes = new aiMesh*[pScene->mNumMeshes + meshes.size()];
- if ( prevArray)
- {
- memcpy( pScene->mMeshes, prevArray, pScene->mNumMeshes * sizeof( aiMesh*));
- delete [] prevArray;
- }
-
- // allocate mesh index array in the node
- pNode->mNumMeshes = (unsigned int)meshes.size();
- pNode->mMeshes = new unsigned int[pNode->mNumMeshes];
-
- // store all meshes in the mesh library of the scene and store their indices in the node
- for ( unsigned int a = 0; a < meshes.size(); a++)
- {
- pScene->mMeshes[pScene->mNumMeshes] = meshes[a];
- pNode->mMeshes[a] = pScene->mNumMeshes;
- pScene->mNumMeshes++;
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Converts the animations from the given imported data and creates them in the scene.
-void XFileImporter::CreateAnimations( aiScene* pScene, const XFile::Scene* pData)
-{
- std::vector<aiAnimation*> newAnims;
-
- for ( unsigned int a = 0; a < pData->mAnims.size(); a++)
- {
- const XFile::Animation* anim = pData->mAnims[a];
- // some exporters mock me with empty animation tags.
- if ( anim->mAnims.size() == 0)
- continue;
-
- // create a new animation to hold the data
- aiAnimation* nanim = new aiAnimation;
- newAnims.push_back( nanim);
- nanim->mName.Set( anim->mName);
- // duration will be determined by the maximum length
- nanim->mDuration = 0;
- nanim->mTicksPerSecond = pData->mAnimTicksPerSecond;
- nanim->mNumChannels = (unsigned int)anim->mAnims.size();
- nanim->mChannels = new aiNodeAnim*[nanim->mNumChannels];
-
- for ( unsigned int b = 0; b < anim->mAnims.size(); b++)
- {
- const XFile::AnimBone* bone = anim->mAnims[b];
- aiNodeAnim* nbone = new aiNodeAnim;
- nbone->mNodeName.Set( bone->mBoneName);
- nanim->mChannels[b] = nbone;
-
- // keyframes are given as combined transformation matrix keys
- if ( bone->mTrafoKeys.size() > 0)
- {
- nbone->mNumPositionKeys = (unsigned int)bone->mTrafoKeys.size();
- nbone->mPositionKeys = new aiVectorKey[nbone->mNumPositionKeys];
- nbone->mNumRotationKeys = (unsigned int)bone->mTrafoKeys.size();
- nbone->mRotationKeys = new aiQuatKey[nbone->mNumRotationKeys];
- nbone->mNumScalingKeys = (unsigned int)bone->mTrafoKeys.size();
- nbone->mScalingKeys = new aiVectorKey[nbone->mNumScalingKeys];
-
- for ( unsigned int c = 0; c < bone->mTrafoKeys.size(); c++)
- {
- // deconstruct each matrix into separate position, rotation and scaling
- double time = bone->mTrafoKeys[c].mTime;
- aiMatrix4x4 trafo = bone->mTrafoKeys[c].mMatrix;
-
- // extract position
- aiVector3D pos( trafo.a4, trafo.b4, trafo.c4);
-
- nbone->mPositionKeys[c].mTime = time;
- nbone->mPositionKeys[c].mValue = pos;
-
- // extract scaling
- aiVector3D scale;
- scale.x = aiVector3D( trafo.a1, trafo.b1, trafo.c1).Length();
- scale.y = aiVector3D( trafo.a2, trafo.b2, trafo.c2).Length();
- scale.z = aiVector3D( trafo.a3, trafo.b3, trafo.c3).Length();
- nbone->mScalingKeys[c].mTime = time;
- nbone->mScalingKeys[c].mValue = scale;
-
- // reconstruct rotation matrix without scaling
- aiMatrix3x3 rotmat(
- trafo.a1 / scale.x, trafo.a2 / scale.y, trafo.a3 / scale.z,
- trafo.b1 / scale.x, trafo.b2 / scale.y, trafo.b3 / scale.z,
- trafo.c1 / scale.x, trafo.c2 / scale.y, trafo.c3 / scale.z);
-
- // and convert it into a quaternion
- nbone->mRotationKeys[c].mTime = time;
- nbone->mRotationKeys[c].mValue = aiQuaternion( rotmat);
- }
-
- // longest lasting key sequence determines duration
- nanim->mDuration = std::max( nanim->mDuration, bone->mTrafoKeys.back().mTime);
- } else
- {
- // separate key sequences for position, rotation, scaling
- nbone->mNumPositionKeys = (unsigned int)bone->mPosKeys.size();
- nbone->mPositionKeys = new aiVectorKey[nbone->mNumPositionKeys];
- for ( unsigned int c = 0; c < nbone->mNumPositionKeys; c++)
- {
- aiVector3D pos = bone->mPosKeys[c].mValue;
-
- nbone->mPositionKeys[c].mTime = bone->mPosKeys[c].mTime;
- nbone->mPositionKeys[c].mValue = pos;
- }
-
- // rotation
- nbone->mNumRotationKeys = (unsigned int)bone->mRotKeys.size();
- nbone->mRotationKeys = new aiQuatKey[nbone->mNumRotationKeys];
- for ( unsigned int c = 0; c < nbone->mNumRotationKeys; c++)
- {
- aiMatrix3x3 rotmat = bone->mRotKeys[c].mValue.GetMatrix();
-
- nbone->mRotationKeys[c].mTime = bone->mRotKeys[c].mTime;
- nbone->mRotationKeys[c].mValue = aiQuaternion( rotmat);
- nbone->mRotationKeys[c].mValue.w *= -1.0f; // needs quat inversion
- }
-
- // scaling
- nbone->mNumScalingKeys = (unsigned int)bone->mScaleKeys.size();
- nbone->mScalingKeys = new aiVectorKey[nbone->mNumScalingKeys];
- for ( unsigned int c = 0; c < nbone->mNumScalingKeys; c++)
- nbone->mScalingKeys[c] = bone->mScaleKeys[c];
-
- // longest lasting key sequence determines duration
- if ( bone->mPosKeys.size() > 0)
- nanim->mDuration = std::max( nanim->mDuration, bone->mPosKeys.back().mTime);
- if ( bone->mRotKeys.size() > 0)
- nanim->mDuration = std::max( nanim->mDuration, bone->mRotKeys.back().mTime);
- if ( bone->mScaleKeys.size() > 0)
- nanim->mDuration = std::max( nanim->mDuration, bone->mScaleKeys.back().mTime);
- }
- }
- }
-
- // store all converted animations in the scene
- if ( newAnims.size() > 0)
- {
- pScene->mNumAnimations = (unsigned int)newAnims.size();
- pScene->mAnimations = new aiAnimation* [pScene->mNumAnimations];
- for ( unsigned int a = 0; a < newAnims.size(); a++)
- pScene->mAnimations[a] = newAnims[a];
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Converts all materials in the given array and stores them in the scene's material list.
-void XFileImporter::ConvertMaterials( aiScene* pScene, const std::vector<XFile::Material>& pMaterials)
-{
- // count the non-referrer materials in the array
- unsigned int numMaterials = 0;
- for ( unsigned int a = 0; a < pMaterials.size(); a++)
- if ( !pMaterials[a].mIsReference)
- numMaterials++;
-
- if ( numMaterials == 0)
- return;
-
- // resize the scene's material list to offer enough space for the new materials
- aiMaterial** prevMats = pScene->mMaterials;
- pScene->mMaterials = new aiMaterial*[pScene->mNumMaterials + numMaterials];
- if ( prevMats)
- {
- memcpy( pScene->mMaterials, prevMats, pScene->mNumMaterials * sizeof( aiMaterial*));
- delete [] prevMats;
- }
-
- // convert all the materials given in the array
- for ( unsigned int a = 0; a < pMaterials.size(); a++)
- {
- const XFile::Material& oldMat = pMaterials[a];
- if ( oldMat.mIsReference)
- continue;
-
- Assimp::MaterialHelper* mat = new Assimp::MaterialHelper;
- aiString name;
- name.Set( oldMat.mName);
- mat->AddProperty( &name, AI_MATKEY_NAME);
-
- // Shading model: hardcoded to PHONG, there is no such information in an XFile
- // FIX (aramis): If the specular exponent is 0, use gouraud shading. This is a bugfix
- // for some models in the SDK (e.g. good old tiny.x)
- int shadeMode = (int)oldMat.mSpecularExponent == 0.0f
- ? aiShadingMode_Gouraud : aiShadingMode_Phong;
-
- mat->AddProperty<int>( &shadeMode, 1, AI_MATKEY_SHADING_MODEL);
- // material colours
- // FIX: Setup this as ambient not as emissive color
- mat->AddProperty( &oldMat.mEmissive, 1, AI_MATKEY_COLOR_AMBIENT);
- mat->AddProperty( &oldMat.mDiffuse, 1, AI_MATKEY_COLOR_DIFFUSE);
- mat->AddProperty( &oldMat.mSpecular, 1, AI_MATKEY_COLOR_SPECULAR);
- mat->AddProperty( &oldMat.mSpecularExponent, 1, AI_MATKEY_SHININESS);
-
-
- // texture, if there is one
- if (1 == oldMat.mTextures.size())
- {
- const XFile::TexEntry& otex = oldMat.mTextures.back();
- if (otex.mName.length())
- {
- // if there is only one texture assume it contains the diffuse color
- aiString tex( otex.mName);
- if ( otex.mIsNormalMap)
- mat->AddProperty( &tex, AI_MATKEY_TEXTURE_NORMALS(0));
- else
- mat->AddProperty( &tex, AI_MATKEY_TEXTURE_DIFFUSE(0));
- }
- }
- else
- {
- // Otherwise ... try to search for typical strings in the
- // texture's file name like 'bump' or 'diffuse'
- unsigned int iHM = 0,iNM = 0,iDM = 0,iSM = 0,iAM = 0,iEM = 0;
- for ( unsigned int b = 0; b < oldMat.mTextures.size(); b++)
- {
- const XFile::TexEntry& otex = oldMat.mTextures[b];
- std::string sz = otex.mName;
- if (!sz.length())continue;
-
-
- // find the file name
- //const size_t iLen = sz.length();
- std::string::size_type s = sz.find_last_of("\\/");
- if (std::string::npos == s)
- s = 0;
-
- // cut off the file extension
- std::string::size_type sExt = sz.find_last_of('.');
- if (std::string::npos != sExt){
- sz[sExt] = '\0';
- }
-
- // convert to lower case for easier comparision
- for ( unsigned int c = 0; c < sz.length(); c++)
- if ( isalpha( sz[c]))
- sz[c] = tolower( sz[c]);
-
-
- // Place texture filename property under the corresponding name
- aiString tex( oldMat.mTextures[b].mName);
-
- // bump map
- if (std::string::npos != sz.find("bump", s) || std::string::npos != sz.find("height", s))
- {
- mat->AddProperty( &tex, AI_MATKEY_TEXTURE_HEIGHT(iHM++));
- } else
- if (otex.mIsNormalMap || std::string::npos != sz.find( "normal", s) || std::string::npos != sz.find("nm", s))
- {
- mat->AddProperty( &tex, AI_MATKEY_TEXTURE_NORMALS(iNM++));
- } else
- if (std::string::npos != sz.find( "spec", s) || std::string::npos != sz.find( "glanz", s))
- {
- mat->AddProperty( &tex, AI_MATKEY_TEXTURE_SPECULAR(iSM++));
- } else
- if (std::string::npos != sz.find( "ambi", s) || std::string::npos != sz.find( "env", s))
- {
- mat->AddProperty( &tex, AI_MATKEY_TEXTURE_AMBIENT(iAM++));
- } else
- if (std::string::npos != sz.find( "emissive", s) || std::string::npos != sz.find( "self", s))
- {
- mat->AddProperty( &tex, AI_MATKEY_TEXTURE_EMISSIVE(iEM++));
- } else
- {
- // Assume it is a diffuse texture
- mat->AddProperty( &tex, AI_MATKEY_TEXTURE_DIFFUSE(iDM++));
- }
- }
- }
-
- pScene->mMaterials[pScene->mNumMaterials] = mat;
- mImportedMats[oldMat.mName] = pScene->mNumMaterials;
- pScene->mNumMaterials++;
- }
-}
-
-#endif // !! ASSIMP_BUILD_NO_X_IMPORTER
-
diff --git a/3rdparty/assimp/code/XFileImporter.h b/3rdparty/assimp/code/XFileImporter.h
deleted file mode 100644
index 4dbce4b0..00000000
--- a/3rdparty/assimp/code/XFileImporter.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file XFileImporter.h
- * @brief Definition of the XFile importer class.
- */
-#ifndef AI_XFILEIMPORTER_H_INC
-#define AI_XFILEIMPORTER_H_INC
-
-#include <map>
-
-#include "XFileHelper.h"
-#include "BaseImporter.h"
-
-#include "../include/aiTypes.h"
-
-struct aiNode;
-
-namespace Assimp {
-
-namespace XFile {
-struct Scene;
-struct Node;
-}
-
-// ---------------------------------------------------------------------------
-/** The XFileImporter is a worker class capable of importing a scene from a
- * DirectX file .x
- */
-class XFileImporter : public BaseImporter
-{
- friend class Importer;
-
-protected:
- /** Constructor to be privately used by Importer */
- XFileImporter();
-
- /** Destructor, private as well */
- ~XFileImporter();
-
-public:
- // -------------------------------------------------------------------
- /** Returns whether the class can handle the format of the given file.
- * See BaseImporter::CanRead() for details. */
- bool CanRead( const std::string& pFile, IOSystem* pIOHandler,
- bool CheckSig) const;
-
-protected:
-
- // -------------------------------------------------------------------
- /** Called by Importer::GetExtensionList() for each loaded importer.
- * See BaseImporter::GetExtensionList() for details
- */
- void GetExtensionList(std::set<std::string>& extensions);
-
- // -------------------------------------------------------------------
- /** Imports the given file into the given scene structure.
- * See BaseImporter::InternReadFile() for details
- */
- void InternReadFile( const std::string& pFile, aiScene* pScene,
- IOSystem* pIOHandler);
-
- // -------------------------------------------------------------------
- /** Constructs the return data structure out of the imported data.
- * @param pScene The scene to construct the return data in.
- * @param pData The imported data in the internal temporary
- * representation.
- */
- void CreateDataRepresentationFromImport( aiScene* pScene,
- const XFile::Scene* pData);
-
- // -------------------------------------------------------------------
- /** Recursively creates scene nodes from the imported hierarchy.
- * The meshes and materials of the nodes will be extracted on the way.
- * @param pScene The scene to construct the return data in.
- * @param pParent The parent node where to create new child nodes
- * @param pNode The temporary node to copy.
- * @return The created node
- */
- aiNode* CreateNodes( aiScene* pScene, aiNode* pParent,
- const XFile::Node* pNode);
-
- // -------------------------------------------------------------------
- /** Converts all meshes in the given mesh array. Each mesh is splitted
- * up per material, the indices of the generated meshes are stored in
- * the node structure.
- * @param pScene The scene to construct the return data in.
- * @param pNode The target node structure that references the
- * constructed meshes.
- * @param pMeshes The array of meshes to convert
- */
- void CreateMeshes( aiScene* pScene, aiNode* pNode,
- const std::vector<XFile::Mesh*>& pMeshes);
-
- // -------------------------------------------------------------------
- /** Converts the animations from the given imported data and creates
- * them in the scene.
- * @param pScene The scene to hold to converted animations
- * @param pData The data to read the animations from
- */
- void CreateAnimations( aiScene* pScene, const XFile::Scene* pData);
-
- // -------------------------------------------------------------------
- /** Converts all materials in the given array and stores them in the
- * scene's material list.
- * @param pScene The scene to hold the converted materials.
- * @param pMaterials The material array to convert.
- */
- void ConvertMaterials( aiScene* pScene,
- const std::vector<XFile::Material>& pMaterials);
-
-protected:
- /** Buffer to hold the loaded file */
- std::vector<char> mBuffer;
-
- /** Imported materials: index in the scene's material list by name */
- std::map<std::string, unsigned int> mImportedMats;
-};
-
-} // end of namespace Assimp
-
-#endif // AI_BASEIMPORTER_H_INC
diff --git a/3rdparty/assimp/code/XFileParser.cpp b/3rdparty/assimp/code/XFileParser.cpp
deleted file mode 100644
index 229366ff..00000000
--- a/3rdparty/assimp/code/XFileParser.cpp
+++ /dev/null
@@ -1,1434 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file Implementation of the XFile parser helper class */
-
-#include "AssimpPCH.h"
-#ifndef ASSIMP_BUILD_NO_X_IMPORTER
-
-#include "XFileParser.h"
-#include "XFileHelper.h"
-#include "fast_atof.h"
-
-using namespace Assimp;
-using namespace Assimp::XFile;
-
-#ifndef ASSIMP_BUILD_NO_COMPRESSED_X
-
-# ifdef ASSIMP_BUILD_NO_OWN_ZLIB
-# include <zlib.h>
-# else
-# include "../contrib/zlib/zlib.h"
-# endif
-
-// Magic identifier for MSZIP compressed data
-#define MSZIP_MAGIC 0x4B43
-#define MSZIP_BLOCK 32786
-
-// ------------------------------------------------------------------------------------------------
-// Dummy memory wrappers for use with zlib
-static void* dummy_alloc (void* /*opaque*/, unsigned int items, unsigned int size) {
- return ::operator new(items*size);
-}
-
-static void dummy_free (void* /*opaque*/, void* address) {
- return ::operator delete(address);
-}
-
-#endif // !! ASSIMP_BUILD_NO_COMPRESSED_X
-
-// ------------------------------------------------------------------------------------------------
-// Constructor. Creates a data structure out of the XFile given in the memory block.
-XFileParser::XFileParser( const std::vector<char>& pBuffer)
-{
- mMajorVersion = mMinorVersion = 0;
- mIsBinaryFormat = false;
- mBinaryNumCount = 0;
- P = End = NULL;
- mLineNumber = 0;
- mScene = NULL;
-
- // vector to store uncompressed file for INFLATE'd X files
- std::vector<char> uncompressed;
-
- // set up memory pointers
- P = &pBuffer.front();
- End = P + pBuffer.size();
-
- // check header
- if ( strncmp( P, "xof ", 4) != 0)
- throw DeadlyImportError( "Header mismatch, file is not an XFile.");
-
- // read version. It comes in a four byte format such as "0302"
- mMajorVersion = (unsigned int)(P[4] - 48) * 10 + (unsigned int)(P[5] - 48);
- mMinorVersion = (unsigned int)(P[6] - 48) * 10 + (unsigned int)(P[7] - 48);
-
- bool compressed = false;
-
- // txt - pure ASCII text format
- if ( strncmp( P + 8, "txt ", 4) == 0)
- mIsBinaryFormat = false;
-
- // bin - Binary format
- else if ( strncmp( P + 8, "bin ", 4) == 0)
- mIsBinaryFormat = true;
-
- // tzip - Inflate compressed text format
- else if ( strncmp( P + 8, "tzip", 4) == 0)
- {
- mIsBinaryFormat = false;
- compressed = true;
- }
- // bzip - Inflate compressed binary format
- else if ( strncmp( P + 8, "bzip", 4) == 0)
- {
- mIsBinaryFormat = true;
- compressed = true;
- }
- else ThrowException( boost::str(boost::format("Unsupported xfile format '%c%c%c%c'")
- % P[8] % P[9] % P[10] % P[11]));
-
- // float size
- mBinaryFloatSize = (unsigned int)(P[12] - 48) * 1000
- + (unsigned int)(P[13] - 48) * 100
- + (unsigned int)(P[14] - 48) * 10
- + (unsigned int)(P[15] - 48);
-
- if ( mBinaryFloatSize != 32 && mBinaryFloatSize != 64)
- ThrowException( boost::str( boost::format( "Unknown float size %1% specified in xfile header.")
- % mBinaryFloatSize));
-
- P += 16;
-
- // If this is a compressed X file, apply the inflate algorithm to it
- if (compressed)
- {
-#ifdef ASSIMP_BUILD_NO_COMPRESSED_X
- throw DeadlyImportError("Assimp was built without compressed X support");
-#else
- /* ///////////////////////////////////////////////////////////////////////
- * COMPRESSED X FILE FORMAT
- * ///////////////////////////////////////////////////////////////////////
- * [xhead]
- * 2 major
- * 2 minor
- * 4 type // bzip,tzip
- * [mszip_master_head]
- * 4 unkn // checksum?
- * 2 unkn // flags? (seems to be constant)
- * [mszip_head]
- * 2 ofs // offset to next section
- * 2 magic // 'CK'
- * ... ofs bytes of data
- * ... next mszip_head
- *
- * http://www.kdedevelopers.org/node/3181 has been very helpful.
- * ///////////////////////////////////////////////////////////////////////
- */
-
- // build a zlib stream
- z_stream stream;
- stream.opaque = NULL;
- stream.zalloc = &dummy_alloc;
- stream.zfree = &dummy_free;
- stream.data_type = (mIsBinaryFormat ? Z_BINARY : Z_ASCII);
-
- // initialize the inflation algorithm
- ::inflateInit2(&stream, -MAX_WBITS);
-
- // skip unknown data (checksum, flags?)
- P += 6;
-
- // First find out how much storage we'll need. Count sections.
- const char* P1 = P;
- unsigned int est_out = 0;
- while (P1 < End)
- {
- // read next offset
- uint16_t ofs = *((uint16_t*)P1);
- AI_SWAP2(ofs); P1 += 2;
-
- if (ofs >= MSZIP_BLOCK)
- throw DeadlyImportError("X: Invalid offset to next MSZIP compressed block");
-
- // check magic word
- uint16_t magic = *((uint16_t*)P1);
- AI_SWAP2(magic); P1 += 2;
-
- if (magic != MSZIP_MAGIC)
- throw DeadlyImportError("X: Unsupported compressed format, expected MSZIP header");
-
- // and advance to the next offset
- P1 += ofs;
- est_out += MSZIP_BLOCK; // one decompressed block is 32786 in size
- }
-
- // Allocate storage and do the actual uncompressing
- uncompressed.resize(est_out);
- char* out = &uncompressed.front();
- while (P < End)
- {
- uint16_t ofs = *((uint16_t*)P);
- AI_SWAP2(ofs);
- P += 4;
-
- // push data to the stream
- stream.next_in = (Bytef*)P;
- stream.avail_in = ofs;
- stream.next_out = (Bytef*)out;
- stream.avail_out = MSZIP_BLOCK;
-
- // and decompress the data ....
- int ret = ::inflate( &stream, Z_SYNC_FLUSH );
- if (ret != Z_OK && ret != Z_STREAM_END)
- throw DeadlyImportError("X: Failed to decompress MSZIP-compressed data");
-
- ::inflateReset( &stream );
- ::inflateSetDictionary( &stream, (const Bytef*)out , MSZIP_BLOCK - stream.avail_out );
-
- // and advance to the next offset
- out += MSZIP_BLOCK - stream.avail_out;
- P += ofs;
- }
-
- // terminate zlib
- ::inflateEnd(&stream);
-
- // ok, update pointers to point to the uncompressed file data
- P = &uncompressed[0];
- End = out;
-
- // FIXME: we don't need the compressed data anymore, could release
- // it already for better memory usage. Consider breaking const-co.
- DefaultLogger::get()->info("Successfully decompressed MSZIP-compressed file");
-#endif // !! ASSIMP_BUILD_NO_COMPRESSED_X
- }
- else
- {
- // start reading here
- ReadUntilEndOfLine();
- }
-
- mScene = new Scene;
- ParseFile();
-
- // filter the imported hierarchy for some degenerated cases
- if ( mScene->mRootNode) {
- FilterHierarchy( mScene->mRootNode);
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-// Destructor. Destroys all imported data along with it
-XFileParser::~XFileParser()
-{
- // kill everything we created
- delete mScene;
-}
-
-// ------------------------------------------------------------------------------------------------
-void XFileParser::ParseFile()
-{
- bool running = true;
- while ( running )
- {
- // read name of next object
- std::string objectName = GetNextToken();
- if (objectName.length() == 0)
- break;
-
- // parse specific object
- if ( objectName == "template")
- ParseDataObjectTemplate();
- else
- if ( objectName == "Frame")
- ParseDataObjectFrame( NULL);
- else
- if ( objectName == "Mesh")
- {
- // some meshes have no frames at all
- Mesh* mesh = new Mesh;
- ParseDataObjectMesh( mesh);
- mScene->mGlobalMeshes.push_back( mesh);
- } else
- if ( objectName == "AnimTicksPerSecond")
- ParseDataObjectAnimTicksPerSecond();
- else
- if ( objectName == "AnimationSet")
- ParseDataObjectAnimationSet();
- else
- if ( objectName == "Material")
- {
- // Material outside of a mesh or node
- Material material;
- ParseDataObjectMaterial( &material);
- mScene->mGlobalMaterials.push_back( material);
- } else
- if ( objectName == "}")
- {
- // whatever?
- DefaultLogger::get()->warn("} found in dataObject");
- } else
- {
- // unknown format
- DefaultLogger::get()->warn("Unknown data object in animation of .x file");
- ParseUnknownDataObject();
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void XFileParser::ParseDataObjectTemplate()
-{
- // parse a template data object. Currently not stored.
- std::string name;
- readHeadOfDataObject( &name);
-
- // read GUID
- std::string guid = GetNextToken();
-
- // read and ignore data members
- bool running = true;
- while ( running )
- {
- std::string s = GetNextToken();
-
- if ( s == "}")
- break;
-
- if ( s.length() == 0)
- ThrowException( "Unexpected end of file reached while parsing template definition");
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void XFileParser::ParseDataObjectFrame( Node* pParent)
-{
- // A coordinate frame, or "frame of reference." The Frame template
- // is open and can contain any object. The Direct3D extensions (D3DX)
- // mesh-loading functions recognize Mesh, FrameTransformMatrix, and
- // Frame template instances as child objects when loading a Frame
- // instance.
- std::string name;
- readHeadOfDataObject(&name);
-
- // create a named node and place it at its parent, if given
- Node* node = new Node( pParent);
- node->mName = name;
- if ( pParent)
- {
- pParent->mChildren.push_back( node);
- } else
- {
- // there might be multiple root nodes
- if ( mScene->mRootNode != NULL)
- {
- // place a dummy root if not there
- if ( mScene->mRootNode->mName != "$dummy_root")
- {
- Node* exroot = mScene->mRootNode;
- mScene->mRootNode = new Node( NULL);
- mScene->mRootNode->mName = "$dummy_root";
- mScene->mRootNode->mChildren.push_back( exroot);
- exroot->mParent = mScene->mRootNode;
- }
- // put the new node as its child instead
- mScene->mRootNode->mChildren.push_back( node);
- node->mParent = mScene->mRootNode;
- } else
- {
- // it's the first node imported. place it as root
- mScene->mRootNode = node;
- }
- }
-
- // Now inside a frame.
- // read tokens until closing brace is reached.
- bool running = true;
- while ( running )
- {
- std::string objectName = GetNextToken();
- if (objectName.size() == 0)
- ThrowException( "Unexpected end of file reached while parsing frame");
-
- if ( objectName == "}")
- break; // frame finished
- else
- if ( objectName == "Frame")
- ParseDataObjectFrame( node); // child frame
- else
- if ( objectName == "FrameTransformMatrix")
- ParseDataObjectTransformationMatrix( node->mTrafoMatrix);
- else
- if ( objectName == "Mesh")
- {
- Mesh* mesh = new Mesh;
- node->mMeshes.push_back( mesh);
- ParseDataObjectMesh( mesh);
- } else
- {
- DefaultLogger::get()->warn("Unknown data object in frame in x file");
- ParseUnknownDataObject();
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void XFileParser::ParseDataObjectTransformationMatrix( aiMatrix4x4& pMatrix)
-{
- // read header, we're not interested if it has a name
- readHeadOfDataObject();
-
- // read its components
- pMatrix.a1 = ReadFloat(); pMatrix.b1 = ReadFloat();
- pMatrix.c1 = ReadFloat(); pMatrix.d1 = ReadFloat();
- pMatrix.a2 = ReadFloat(); pMatrix.b2 = ReadFloat();
- pMatrix.c2 = ReadFloat(); pMatrix.d2 = ReadFloat();
- pMatrix.a3 = ReadFloat(); pMatrix.b3 = ReadFloat();
- pMatrix.c3 = ReadFloat(); pMatrix.d3 = ReadFloat();
- pMatrix.a4 = ReadFloat(); pMatrix.b4 = ReadFloat();
- pMatrix.c4 = ReadFloat(); pMatrix.d4 = ReadFloat();
-
- // trailing symbols
- CheckForSemicolon();
- CheckForClosingBrace();
-}
-
-// ------------------------------------------------------------------------------------------------
-void XFileParser::ParseDataObjectMesh( Mesh* pMesh)
-{
- std::string name;
- readHeadOfDataObject( &name);
-
- // read vertex count
- unsigned int numVertices = ReadInt();
- pMesh->mPositions.resize( numVertices);
-
- // read vertices
- for ( unsigned int a = 0; a < numVertices; a++)
- pMesh->mPositions[a] = ReadVector3();
-
- // read position faces
- unsigned int numPosFaces = ReadInt();
- pMesh->mPosFaces.resize( numPosFaces);
- for ( unsigned int a = 0; a < numPosFaces; a++)
- {
- unsigned int numIndices = ReadInt();
- if ( numIndices < 3)
- ThrowException( boost::str( boost::format( "Invalid index count %1% for face %2%.") % numIndices % a));
-
- // read indices
- Face& face = pMesh->mPosFaces[a];
- for ( unsigned int b = 0; b < numIndices; b++)
- face.mIndices.push_back( ReadInt());
- CheckForSeparator();
- }
-
- // here, other data objects may follow
- bool running = true;
- while ( running )
- {
- std::string objectName = GetNextToken();
-
- if ( objectName.size() == 0)
- ThrowException( "Unexpected end of file while parsing mesh structure");
- else
- if ( objectName == "}")
- break; // mesh finished
- else
- if ( objectName == "MeshNormals")
- ParseDataObjectMeshNormals( pMesh);
- else
- if ( objectName == "MeshTextureCoords")
- ParseDataObjectMeshTextureCoords( pMesh);
- else
- if ( objectName == "MeshVertexColors")
- ParseDataObjectMeshVertexColors( pMesh);
- else
- if ( objectName == "MeshMaterialList")
- ParseDataObjectMeshMaterialList( pMesh);
- else
- if ( objectName == "VertexDuplicationIndices")
- ParseUnknownDataObject(); // we'll ignore vertex duplication indices
- else
- if ( objectName == "XSkinMeshHeader")
- ParseDataObjectSkinMeshHeader( pMesh);
- else
- if ( objectName == "SkinWeights")
- ParseDataObjectSkinWeights( pMesh);
- else
- {
- DefaultLogger::get()->warn("Unknown data object in mesh in x file");
- ParseUnknownDataObject();
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void XFileParser::ParseDataObjectSkinWeights( Mesh *pMesh)
-{
- readHeadOfDataObject();
-
- std::string transformNodeName;
- GetNextTokenAsString( transformNodeName);
-
- pMesh->mBones.push_back( Bone());
- Bone& bone = pMesh->mBones.back();
- bone.mName = transformNodeName;
-
- // read vertex weights
- unsigned int numWeights = ReadInt();
- bone.mWeights.reserve( numWeights);
-
- for ( unsigned int a = 0; a < numWeights; a++)
- {
- BoneWeight weight;
- weight.mVertex = ReadInt();
- bone.mWeights.push_back( weight);
- }
-
- // read vertex weights
- for ( unsigned int a = 0; a < numWeights; a++)
- bone.mWeights[a].mWeight = ReadFloat();
-
- // read matrix offset
- bone.mOffsetMatrix.a1 = ReadFloat(); bone.mOffsetMatrix.b1 = ReadFloat();
- bone.mOffsetMatrix.c1 = ReadFloat(); bone.mOffsetMatrix.d1 = ReadFloat();
- bone.mOffsetMatrix.a2 = ReadFloat(); bone.mOffsetMatrix.b2 = ReadFloat();
- bone.mOffsetMatrix.c2 = ReadFloat(); bone.mOffsetMatrix.d2 = ReadFloat();
- bone.mOffsetMatrix.a3 = ReadFloat(); bone.mOffsetMatrix.b3 = ReadFloat();
- bone.mOffsetMatrix.c3 = ReadFloat(); bone.mOffsetMatrix.d3 = ReadFloat();
- bone.mOffsetMatrix.a4 = ReadFloat(); bone.mOffsetMatrix.b4 = ReadFloat();
- bone.mOffsetMatrix.c4 = ReadFloat(); bone.mOffsetMatrix.d4 = ReadFloat();
-
- CheckForSemicolon();
- CheckForClosingBrace();
-}
-
-// ------------------------------------------------------------------------------------------------
-void XFileParser::ParseDataObjectSkinMeshHeader( Mesh* /*pMesh*/ )
-{
- readHeadOfDataObject();
-
- /*unsigned int maxSkinWeightsPerVertex =*/ ReadInt();
- /*unsigned int maxSkinWeightsPerFace =*/ ReadInt();
- /*unsigned int numBonesInMesh = */ReadInt();
-
- CheckForClosingBrace();
-}
-
-// ------------------------------------------------------------------------------------------------
-void XFileParser::ParseDataObjectMeshNormals( Mesh* pMesh)
-{
- readHeadOfDataObject();
-
- // read count
- unsigned int numNormals = ReadInt();
- pMesh->mNormals.resize( numNormals);
-
- // read normal vectors
- for ( unsigned int a = 0; a < numNormals; a++)
- pMesh->mNormals[a] = ReadVector3();
-
- // read normal indices
- unsigned int numFaces = ReadInt();
- if ( numFaces != pMesh->mPosFaces.size())
- ThrowException( "Normal face count does not match vertex face count.");
-
- for ( unsigned int a = 0; a < numFaces; a++)
- {
- unsigned int numIndices = ReadInt();
- pMesh->mNormFaces.push_back( Face());
- Face& face = pMesh->mNormFaces.back();
-
- for ( unsigned int b = 0; b < numIndices; b++)
- face.mIndices.push_back( ReadInt());
-
- CheckForSeparator();
- }
-
- CheckForClosingBrace();
-}
-
-// ------------------------------------------------------------------------------------------------
-void XFileParser::ParseDataObjectMeshTextureCoords( Mesh* pMesh)
-{
- readHeadOfDataObject();
- std::vector<aiVector2D>& coords = pMesh->mTexCoords[pMesh->mNumTextures++];
-
- unsigned int numCoords = ReadInt();
- if ( numCoords != pMesh->mPositions.size())
- ThrowException( "Texture coord count does not match vertex count");
-
- coords.resize( numCoords);
- for ( unsigned int a = 0; a < numCoords; a++)
- coords[a] = ReadVector2();
-
- CheckForClosingBrace();
-}
-
-// ------------------------------------------------------------------------------------------------
-void XFileParser::ParseDataObjectMeshVertexColors( Mesh* pMesh)
-{
- readHeadOfDataObject();
- std::vector<aiColor4D>& colors = pMesh->mColors[pMesh->mNumColorSets++];
-
- unsigned int numColors = ReadInt();
- if ( numColors != pMesh->mPositions.size())
- ThrowException( "Vertex color count does not match vertex count");
-
- colors.resize( numColors, aiColor4D( 0, 0, 0, 1));
- for ( unsigned int a = 0; a < numColors; a++)
- {
- unsigned int index = ReadInt();
- if ( index >= pMesh->mPositions.size())
- ThrowException( "Vertex color index out of bounds");
-
- colors[index] = ReadRGBA();
- // HACK: (thom) Maxon Cinema XPort plugin puts a third separator here, kwxPort puts a comma.
- // Ignore gracefully.
- if ( !mIsBinaryFormat)
- {
- FindNextNoneWhiteSpace();
- if ( *P == ';' || *P == ',')
- P++;
- }
- }
-
- CheckForClosingBrace();
-}
-
-// ------------------------------------------------------------------------------------------------
-void XFileParser::ParseDataObjectMeshMaterialList( Mesh* pMesh)
-{
- readHeadOfDataObject();
-
- // read material count
- /*unsigned int numMaterials =*/ ReadInt();
- // read non triangulated face material index count
- unsigned int numMatIndices = ReadInt();
-
- // some models have a material index count of 1... to be able to read them we
- // replicate this single material index on every face
- if ( numMatIndices != pMesh->mPosFaces.size() && numMatIndices != 1)
- ThrowException( "Per-Face material index count does not match face count.");
-
- // read per-face material indices
- for ( unsigned int a = 0; a < numMatIndices; a++)
- pMesh->mFaceMaterials.push_back( ReadInt());
-
- // in version 03.02, the face indices end with two semicolons.
- // commented out version check, as version 03.03 exported from blender also has 2 semicolons
- if ( !mIsBinaryFormat) // && MajorVersion == 3 && MinorVersion <= 2)
- {
- if ( *P == ';')
- ++P;
- }
-
- // if there was only a single material index, replicate it on all faces
- while ( pMesh->mFaceMaterials.size() < pMesh->mPosFaces.size())
- pMesh->mFaceMaterials.push_back( pMesh->mFaceMaterials.front());
-
- // read following data objects
- bool running = true;
- while ( running )
- {
- std::string objectName = GetNextToken();
- if ( objectName.size() == 0)
- ThrowException( "Unexpected end of file while parsing mesh material list.");
- else
- if ( objectName == "}")
- break; // material list finished
- else
- if ( objectName == "{")
- {
- // template materials
- std::string matName = GetNextToken();
- Material material;
- material.mIsReference = true;
- material.mName = matName;
- pMesh->mMaterials.push_back( material);
-
- CheckForClosingBrace(); // skip }
- } else
- if ( objectName == "Material")
- {
- pMesh->mMaterials.push_back( Material());
- ParseDataObjectMaterial( &pMesh->mMaterials.back());
- } else
- if ( objectName == ";")
- {
- // ignore
- } else
- {
- DefaultLogger::get()->warn("Unknown data object in material list in x file");
- ParseUnknownDataObject();
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void XFileParser::ParseDataObjectMaterial( Material* pMaterial)
-{
- std::string matName;
- readHeadOfDataObject( &matName);
- if ( matName.empty())
- matName = std::string( "material") + boost::lexical_cast<std::string>( mLineNumber);
- pMaterial->mName = matName;
- pMaterial->mIsReference = false;
-
- // read material values
- pMaterial->mDiffuse = ReadRGBA();
- pMaterial->mSpecularExponent = ReadFloat();
- pMaterial->mSpecular = ReadRGB();
- pMaterial->mEmissive = ReadRGB();
-
- // read other data objects
- bool running = true;
- while ( running )
- {
- std::string objectName = GetNextToken();
- if ( objectName.size() == 0)
- ThrowException( "Unexpected end of file while parsing mesh material");
- else
- if ( objectName == "}")
- break; // material finished
- else
- if ( objectName == "TextureFilename" || objectName == "TextureFileName")
- {
- // some exporters write "TextureFileName" instead.
- std::string texname;
- ParseDataObjectTextureFilename( texname);
- pMaterial->mTextures.push_back( TexEntry( texname));
- } else
- if ( objectName == "NormalmapFilename" || objectName == "NormalmapFileName")
- {
- // one exporter writes out the normal map in a separate filename tag
- std::string texname;
- ParseDataObjectTextureFilename( texname);
- pMaterial->mTextures.push_back( TexEntry( texname, true));
- } else
- {
- DefaultLogger::get()->warn("Unknown data object in material in x file");
- ParseUnknownDataObject();
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void XFileParser::ParseDataObjectAnimTicksPerSecond()
-{
- readHeadOfDataObject();
- mScene->mAnimTicksPerSecond = ReadInt();
- CheckForClosingBrace();
-}
-
-// ------------------------------------------------------------------------------------------------
-void XFileParser::ParseDataObjectAnimationSet()
-{
- std::string animName;
- readHeadOfDataObject( &animName);
-
- Animation* anim = new Animation;
- mScene->mAnims.push_back( anim);
- anim->mName = animName;
-
- bool running = true;
- while ( running )
- {
- std::string objectName = GetNextToken();
- if ( objectName.length() == 0)
- ThrowException( "Unexpected end of file while parsing animation set.");
- else
- if ( objectName == "}")
- break; // animation set finished
- else
- if ( objectName == "Animation")
- ParseDataObjectAnimation( anim);
- else
- {
- DefaultLogger::get()->warn("Unknown data object in animation set in x file");
- ParseUnknownDataObject();
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void XFileParser::ParseDataObjectAnimation( Animation* pAnim)
-{
- readHeadOfDataObject();
- AnimBone* banim = new AnimBone;
- pAnim->mAnims.push_back( banim);
-
- bool running = true;
- while ( running )
- {
- std::string objectName = GetNextToken();
-
- if ( objectName.length() == 0)
- ThrowException( "Unexpected end of file while parsing animation.");
- else
- if ( objectName == "}")
- break; // animation finished
- else
- if ( objectName == "AnimationKey")
- ParseDataObjectAnimationKey( banim);
- else
- if ( objectName == "AnimationOptions")
- ParseUnknownDataObject(); // not interested
- else
- if ( objectName == "{")
- {
- // read frame name
- banim->mBoneName = GetNextToken();
- CheckForClosingBrace();
- } else
- {
- DefaultLogger::get()->warn("Unknown data object in animation in x file");
- ParseUnknownDataObject();
- }
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void XFileParser::ParseDataObjectAnimationKey( AnimBone* pAnimBone)
-{
- readHeadOfDataObject();
-
- // read key type
- unsigned int keyType = ReadInt();
-
- // read number of keys
- unsigned int numKeys = ReadInt();
-
- for ( unsigned int a = 0; a < numKeys; a++)
- {
- // read time
- unsigned int time = ReadInt();
-
- // read keys
- switch( keyType)
- {
- case 0: // rotation quaternion
- {
- // read count
- if ( ReadInt() != 4)
- ThrowException( "Invalid number of arguments for quaternion key in animation");
-
- aiQuatKey key;
- key.mTime = double( time);
- key.mValue.w = ReadFloat();
- key.mValue.x = ReadFloat();
- key.mValue.y = ReadFloat();
- key.mValue.z = ReadFloat();
- pAnimBone->mRotKeys.push_back( key);
-
- CheckForSemicolon();
- break;
- }
-
- case 1: // scale vector
- case 2: // position vector
- {
- // read count
- if ( ReadInt() != 3)
- ThrowException( "Invalid number of arguments for vector key in animation");
-
- aiVectorKey key;
- key.mTime = double( time);
- key.mValue = ReadVector3();
-
- if ( keyType == 2)
- pAnimBone->mPosKeys.push_back( key);
- else
- pAnimBone->mScaleKeys.push_back( key);
-
- break;
- }
-
- case 3: // combined transformation matrix
- case 4: // denoted both as 3 or as 4
- {
- // read count
- if ( ReadInt() != 16)
- ThrowException( "Invalid number of arguments for matrix key in animation");
-
- // read matrix
- MatrixKey key;
- key.mTime = double( time);
- key.mMatrix.a1 = ReadFloat(); key.mMatrix.b1 = ReadFloat();
- key.mMatrix.c1 = ReadFloat(); key.mMatrix.d1 = ReadFloat();
- key.mMatrix.a2 = ReadFloat(); key.mMatrix.b2 = ReadFloat();
- key.mMatrix.c2 = ReadFloat(); key.mMatrix.d2 = ReadFloat();
- key.mMatrix.a3 = ReadFloat(); key.mMatrix.b3 = ReadFloat();
- key.mMatrix.c3 = ReadFloat(); key.mMatrix.d3 = ReadFloat();
- key.mMatrix.a4 = ReadFloat(); key.mMatrix.b4 = ReadFloat();
- key.mMatrix.c4 = ReadFloat(); key.mMatrix.d4 = ReadFloat();
- pAnimBone->mTrafoKeys.push_back( key);
-
- CheckForSemicolon();
- break;
- }
-
- default:
- ThrowException( boost::str( boost::format( "Unknown key type %1% in animation.") % keyType));
- break;
- } // end switch
-
- // key separator
- CheckForSeparator();
- }
-
- CheckForClosingBrace();
-}
-
-// ------------------------------------------------------------------------------------------------
-void XFileParser::ParseDataObjectTextureFilename( std::string& pName)
-{
- readHeadOfDataObject();
- GetNextTokenAsString( pName);
- CheckForClosingBrace();
-
- // FIX: some files (e.g. AnimationTest.x) have "" as texture file name
- if (!pName.length())
- {
- DefaultLogger::get()->warn("Length of texture file name is zero. Skipping this texture.");
- }
-
- // some exporters write double backslash paths out. We simply replace them if we find them
- while ( pName.find( "\\\\") != std::string::npos)
- pName.replace( pName.find( "\\\\"), 2, "\\");
-}
-
-// ------------------------------------------------------------------------------------------------
-void XFileParser::ParseUnknownDataObject()
-{
- // find opening delimiter
- bool running = true;
- while ( running )
- {
- std::string t = GetNextToken();
- if ( t.length() == 0)
- ThrowException( "Unexpected end of file while parsing unknown segment.");
-
- if ( t == "{")
- break;
- }
-
- unsigned int counter = 1;
-
- // parse until closing delimiter
- while ( counter > 0)
- {
- std::string t = GetNextToken();
-
- if ( t.length() == 0)
- ThrowException( "Unexpected end of file while parsing unknown segment.");
-
- if ( t == "{")
- ++counter;
- else
- if ( t == "}")
- --counter;
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-//! checks for closing curly brace
-void XFileParser::CheckForClosingBrace()
-{
- if ( GetNextToken() != "}")
- ThrowException( "Closing brace expected.");
-}
-
-// ------------------------------------------------------------------------------------------------
-//! checks for one following semicolon
-void XFileParser::CheckForSemicolon()
-{
- if ( mIsBinaryFormat)
- return;
-
- if ( GetNextToken() != ";")
- ThrowException( "Semicolon expected.");
-}
-
-// ------------------------------------------------------------------------------------------------
-//! checks for a separator char, either a ',' or a ';'
-void XFileParser::CheckForSeparator()
-{
- if ( mIsBinaryFormat)
- return;
-
- std::string token = GetNextToken();
- if ( token != "," && token != ";")
- ThrowException( "Separator character (';' or ',') expected.");
-}
-
-// ------------------------------------------------------------------------------------------------
-// tests and possibly consumes a separator char, but does nothing if there was no separator
-void XFileParser::TestForSeparator()
-{
- if ( mIsBinaryFormat)
- return;
-
- FindNextNoneWhiteSpace();
- if ( P >= End)
- return;
-
- // test and skip
- if ( *P == ';' || *P == ',')
- P++;
-}
-
-// ------------------------------------------------------------------------------------------------
-void XFileParser::readHeadOfDataObject( std::string* poName)
-{
- std::string nameOrBrace = GetNextToken();
- if ( nameOrBrace != "{")
- {
- if ( poName)
- *poName = nameOrBrace;
-
- if ( GetNextToken() != "{")
- ThrowException( "Opening brace expected.");
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-std::string XFileParser::GetNextToken()
-{
- std::string s;
-
- // process binary-formatted file
- if ( mIsBinaryFormat)
- {
- // in binary mode it will only return NAME and STRING token
- // and (correctly) skip over other tokens.
-
- unsigned int tok = ReadBinWord();
- unsigned int len;
-
- // standalone tokens
- switch( tok)
- {
- case 1:
- // name token
- len = ReadBinDWord();
- s = std::string(P, len);
- P += len;
- return s;
- case 2:
- // string token
- len = ReadBinDWord();
- s = std::string(P, len);
- P += (len + 2);
- return s;
- case 3:
- // integer token
- P += 4;
- return "<integer>";
- case 5:
- // GUID token
- P += 16;
- return "<guid>";
- case 6:
- len = ReadBinDWord();
- P += (len * 4);
- return "<int_list>";
- case 7:
- len = ReadBinDWord();
- P += (len * mBinaryFloatSize);
- return "<flt_list>";
- case 0x0a:
- return "{";
- case 0x0b:
- return "}";
- case 0x0c:
- return "(";
- case 0x0d:
- return ")";
- case 0x0e:
- return "[";
- case 0x0f:
- return "]";
- case 0x10:
- return "<";
- case 0x11:
- return ">";
- case 0x12:
- return ".";
- case 0x13:
- return ",";
- case 0x14:
- return ";";
- case 0x1f:
- return "template";
- case 0x28:
- return "WORD";
- case 0x29:
- return "DWORD";
- case 0x2a:
- return "FLOAT";
- case 0x2b:
- return "DOUBLE";
- case 0x2c:
- return "CHAR";
- case 0x2d:
- return "UCHAR";
- case 0x2e:
- return "SWORD";
- case 0x2f:
- return "SDWORD";
- case 0x30:
- return "void";
- case 0x31:
- return "string";
- case 0x32:
- return "unicode";
- case 0x33:
- return "cstring";
- case 0x34:
- return "array";
- }
- }
- // process text-formatted file
- else
- {
- FindNextNoneWhiteSpace();
- if ( P >= End)
- return s;
-
- while ( (P < End) && !isspace( (unsigned char) *P))
- {
- // either keep token delimiters when already holding a token, or return if first valid char
- if ( *P == ';' || *P == '}' || *P == '{' || *P == ',')
- {
- if ( !s.size())
- s.append( P++, 1);
- break; // stop for delimiter
- }
- s.append( P++, 1);
- }
- }
- return s;
-}
-
-// ------------------------------------------------------------------------------------------------
-void XFileParser::FindNextNoneWhiteSpace()
-{
- if ( mIsBinaryFormat)
- return;
-
- bool running = true;
- while ( running )
- {
- while ( P < End && isspace( (unsigned char) *P))
- {
- if ( *P == '\n')
- mLineNumber++;
- ++P;
- }
-
- if ( P >= End)
- return;
-
- // check if this is a comment
- if ( (P[0] == '/' && P[1] == '/') || P[0] == '#')
- ReadUntilEndOfLine();
- else
- break;
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-void XFileParser::GetNextTokenAsString( std::string& poString)
-{
- if ( mIsBinaryFormat)
- {
- poString = GetNextToken();
- return;
- }
-
- FindNextNoneWhiteSpace();
- if ( P >= End)
- ThrowException( "Unexpected end of file while parsing string");
-
- if ( *P != '"')
- ThrowException( "Expected quotation mark.");
- ++P;
-
- while ( P < End && *P != '"')
- poString.append( P++, 1);
-
- if ( P >= End-1)
- ThrowException( "Unexpected end of file while parsing string");
-
- if ( P[1] != ';' || P[0] != '"')
- ThrowException( "Expected quotation mark and semicolon at the end of a string.");
- P+=2;
-}
-
-// ------------------------------------------------------------------------------------------------
-void XFileParser::ReadUntilEndOfLine()
-{
- if ( mIsBinaryFormat)
- return;
-
- while ( P < End)
- {
- if ( *P == '\n' || *P == '\r')
- {
- ++P; mLineNumber++;
- return;
- }
-
- ++P;
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-unsigned short XFileParser::ReadBinWord()
-{
- const unsigned char* q = (const unsigned char*) P;
- unsigned short tmp = q[0] | (q[1] << 8);
- P += 2;
- return tmp;
-}
-
-// ------------------------------------------------------------------------------------------------
-unsigned int XFileParser::ReadBinDWord()
-{
- const unsigned char* q = (const unsigned char*) P;
- unsigned int tmp = q[0] | (q[1] << 8) | (q[2] << 16) | (q[3] << 24);
- P += 4;
- return tmp;
-}
-
-// ------------------------------------------------------------------------------------------------
-unsigned int XFileParser::ReadInt()
-{
- if ( mIsBinaryFormat)
- {
- if ( mBinaryNumCount == 0)
- {
- unsigned short tmp = ReadBinWord(); // 0x06 or 0x03
- if ( tmp == 0x06) // array of ints follows
- mBinaryNumCount = ReadBinDWord();
- else // single int follows
- mBinaryNumCount = 1;
- }
-
- --mBinaryNumCount;
- return ReadBinDWord();
- } else
- {
- FindNextNoneWhiteSpace();
-
- // TODO: consider using strtol10s instead???
-
- // check preceeding minus sign
- bool isNegative = false;
- if ( *P == '-')
- {
- isNegative = true;
- P++;
- }
-
- // at least one digit expected
- if ( !isdigit( *P))
- ThrowException( "Number expected.");
-
- // read digits
- unsigned int number = 0;
- while ( P < End)
- {
- if ( !isdigit( *P))
- break;
- number = number * 10 + (*P - 48);
- P++;
- }
-
- CheckForSeparator();
- return isNegative ? ((unsigned int) -int( number)) : number;
- }
-}
-
-// ------------------------------------------------------------------------------------------------
-float XFileParser::ReadFloat()
-{
- if ( mIsBinaryFormat)
- {
- if ( mBinaryNumCount == 0)
- {
- unsigned short tmp = ReadBinWord(); // 0x07 or 0x42
- if ( tmp == 0x07) // array of floats following
- mBinaryNumCount = ReadBinDWord();
- else // single float following
- mBinaryNumCount = 1;
- }
-
- --mBinaryNumCount;
- if ( mBinaryFloatSize == 8)
- {
- float result = (float) (*(double*) P);
- P += 8;
- return result;
- } else
- {
- float result = *(float*) P;
- P += 4;
- return result;
- }
- }
-
- // text version
- FindNextNoneWhiteSpace();
- // check for various special strings to allow reading files from faulty exporters
- // I mean you, Blender!
- if ( strncmp( P, "-1.#IND00", 9) == 0 || strncmp( P, "1.#IND00", 8) == 0)
- {
- P += 9;
- CheckForSeparator();
- return 0.0f;
- } else
- if ( strncmp( P, "1.#QNAN0", 8) == 0)
- {
- P += 8;
- CheckForSeparator();
- return 0.0f;
- }
-
- float result = 0.0f;
- P = fast_atof_move( P, result);
-
- CheckForSeparator();
-
- return result;
-}
-
-// ------------------------------------------------------------------------------------------------
-aiVector2D XFileParser::ReadVector2()
-{
- aiVector2D vector;
- vector.x = ReadFloat();
- vector.y = ReadFloat();
- TestForSeparator();
-
- return vector;
-}
-
-// ------------------------------------------------------------------------------------------------
-aiVector3D XFileParser::ReadVector3()
-{
- aiVector3D vector;
- vector.x = ReadFloat();
- vector.y = ReadFloat();
- vector.z = ReadFloat();
- TestForSeparator();
-
- return vector;
-}
-
-// ------------------------------------------------------------------------------------------------
-aiColor4D XFileParser::ReadRGBA()
-{
- aiColor4D color;
- color.r = ReadFloat();
- color.g = ReadFloat();
- color.b = ReadFloat();
- color.a = ReadFloat();
- TestForSeparator();
-
- return color;
-}
-
-// ------------------------------------------------------------------------------------------------
-aiColor3D XFileParser::ReadRGB()
-{
- aiColor3D color;
- color.r = ReadFloat();
- color.g = ReadFloat();
- color.b = ReadFloat();
- TestForSeparator();
-
- return color;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Throws an exception with a line number and the given text.
-void XFileParser::ThrowException( const std::string& pText)
-{
- if ( mIsBinaryFormat)
- throw DeadlyImportError( pText);
- else
- throw DeadlyImportError( boost::str( boost::format( "Line %d: %s") % mLineNumber % pText));
-}
-
-
-// ------------------------------------------------------------------------------------------------
-// Filters the imported hierarchy for some degenerated cases that some exporters produce.
-void XFileParser::FilterHierarchy( XFile::Node* pNode)
-{
- // if the node has just a single unnamed child containing a mesh, remove
- // the anonymous node inbetween. The 3DSMax kwXport plugin seems to produce this
- // mess in some cases
- if ( pNode->mChildren.size() == 1)
- {
- XFile::Node* child = pNode->mChildren.front();
- if ( child->mName.length() == 0 && child->mMeshes.size() > 0)
- {
- // transfer its meshes to us
- for ( unsigned int a = 0; a < child->mMeshes.size(); a++)
- pNode->mMeshes.push_back( child->mMeshes[a]);
- child->mMeshes.clear();
-
- // then kill it
- delete child;
- pNode->mChildren.clear();
- }
- }
-
- // recurse
- for ( unsigned int a = 0; a < pNode->mChildren.size(); a++)
- FilterHierarchy( pNode->mChildren[a]);
-}
-
-#endif // !! ASSIMP_BUILD_NO_X_IMPORTER
diff --git a/3rdparty/assimp/code/XFileParser.h b/3rdparty/assimp/code/XFileParser.h
deleted file mode 100644
index 8000c133..00000000
--- a/3rdparty/assimp/code/XFileParser.h
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file Helper class to parse a XFile into a temporary structure */
-#ifndef AI_XFILEPARSER_H_INC
-#define AI_XFILEPARSER_H_INC
-
-#include <string>
-#include <vector>
-
-#include "../include/aiTypes.h"
-
-namespace Assimp
-{
- namespace XFile
- {
- struct Node;
- struct Mesh;
- struct Scene;
- struct Material;
- struct Animation;
- struct AnimBone;
- }
-
-/** The XFileParser reads a XFile either in text or binary form and builds a temporary
- * data structure out of it.
- */
-class XFileParser
-{
-public:
- /** Constructor. Creates a data structure out of the XFile given in the memory block.
- * @param pBuffer Memory buffer containing the XFile
- */
- XFileParser( const std::vector<char>& pBuffer);
-
- /** Destructor. Destroys all imported data along with it */
- ~XFileParser();
-
- /** Returns the temporary representation of the imported data */
- const XFile::Scene* GetImportedData() const { return mScene; }
-
-protected:
- void ParseFile();
- void ParseDataObjectTemplate();
- void ParseDataObjectFrame( XFile::Node *pParent);
- void ParseDataObjectTransformationMatrix( aiMatrix4x4& pMatrix);
- void ParseDataObjectMesh( XFile::Mesh* pMesh);
- void ParseDataObjectSkinWeights( XFile::Mesh* pMesh);
- void ParseDataObjectSkinMeshHeader( XFile::Mesh* pMesh);
- void ParseDataObjectMeshNormals( XFile::Mesh* pMesh);
- void ParseDataObjectMeshTextureCoords( XFile::Mesh* pMesh);
- void ParseDataObjectMeshVertexColors( XFile::Mesh* pMesh);
- void ParseDataObjectMeshMaterialList( XFile::Mesh* pMesh);
- void ParseDataObjectMaterial( XFile::Material* pMaterial);
- void ParseDataObjectAnimTicksPerSecond();
- void ParseDataObjectAnimationSet();
- void ParseDataObjectAnimation( XFile::Animation* pAnim);
- void ParseDataObjectAnimationKey( XFile::AnimBone *pAnimBone);
- void ParseDataObjectTextureFilename( std::string& pName);
- void ParseUnknownDataObject();
-
- //! places pointer to next begin of a token, and ignores comments
- void FindNextNoneWhiteSpace();
-
- //! returns next parseable token. Returns empty string if no token there
- std::string GetNextToken();
-
- //! reads header of dataobject including the opening brace.
- //! returns false if error happened, and writes name of object
- //! if there is one
- void readHeadOfDataObject( std::string* poName = NULL);
-
- //! checks for closing curly brace, throws exception if not there
- void CheckForClosingBrace();
-
- //! checks for one following semicolon, throws exception if not there
- void CheckForSemicolon();
-
- //! checks for a separator char, either a ',' or a ';'
- void CheckForSeparator();
-
- /// tests and possibly consumes a separator char, but does nothing if there was no separator
- void TestForSeparator();
-
- //! reads a x file style string
- void GetNextTokenAsString( std::string& poString);
-
- void ReadUntilEndOfLine();
-
- unsigned short ReadBinWord();
- unsigned int ReadBinDWord();
- unsigned int ReadInt();
- float ReadFloat();
- aiVector2D ReadVector2();
- aiVector3D ReadVector3();
- aiColor3D ReadRGB();
- aiColor4D ReadRGBA();
-
- /** Throws an exception with a line number and the given text. */
- void ThrowException( const std::string& pText);
-
- /** Filters the imported hierarchy for some degenerated cases that some exporters produce.
- * @param pData The sub-hierarchy to filter
- */
- void FilterHierarchy( XFile::Node* pNode);
-
-protected:
- unsigned int mMajorVersion, mMinorVersion; ///< version numbers
- bool mIsBinaryFormat; ///< true if the file is in binary, false if it's in text form
- unsigned int mBinaryFloatSize; ///< float size, either 32 or 64 bits
- // counter for number arrays in binary format
- unsigned int mBinaryNumCount;
-
- const char* P;
- const char* End;
-
- /// Line number when reading in text format
- unsigned int mLineNumber;
-
- /// Imported data
- XFile::Scene* mScene;
-};
-
-}
-#endif // AI_XFILEPARSER_H_INC
diff --git a/3rdparty/assimp/code/aiAssert.cpp b/3rdparty/assimp/code/aiAssert.cpp
deleted file mode 100644
index 552014f7..00000000
--- a/3rdparty/assimp/code/aiAssert.cpp
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2008, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-#include "AssimpPCH.h"
-#include "../include/aiAssert.h"
-#ifdef _WIN32
-#ifndef __GNUC__
-# include "crtdbg.h"
-#endif // ndef gcc
-#endif // _WIN32
-
-// Set a breakpoint using win32, else line, file and message will be returned and progam ends with
-// errrocode = 1
-AI_WONT_RETURN void Assimp::aiAssert (const std::string &message, unsigned int uiLine, const std::string &file)
-{
- // moved expression testing out of the function and into the macro to avoid constructing
- // two std::string on every single ai_assert test
-// if (!expression)
- {
- // FIX (Aramis): changed std::cerr to std::cout that the message appears in VS' output window ...
- std::cout << "File :" << file << ", line " << uiLine << " : " << message << std::endl;
-
-#ifdef _WIN32
-#ifndef __GNUC__
- // Set breakpoint
- __debugbreak();
-#endif //ndef gcc
-#else
- exit (1);
-#endif
- }
-}
diff --git a/3rdparty/assimp/code/assbin_chunks.h b/3rdparty/assimp/code/assbin_chunks.h
deleted file mode 100644
index 342b7879..00000000
--- a/3rdparty/assimp/code/assbin_chunks.h
+++ /dev/null
@@ -1,196 +0,0 @@
-
-#ifndef INCLUDED_ASSBIN_CHUNKS_H
-#define INCLUDED_ASSBIN_CHUNKS_H
-
-#define ASSBIN_VERSION_MAJOR 1
-#define ASSBIN_VERSION_MINOR 0
-
-/**
-@page assfile .ASS File formats
-
-@section over Overview
-Assimp provides its own interchange format, which is intended to applications which need
-to serialize 3D-models and to reload them quickly. Assimp's file formats are designed to
-be read by Assimp itself. They encode additional information needed by Assimp to optimize
-its postprocessing pipeline. If you once apply specific steps to a scene, then save it
-and reread it from an ASS format using the same post processing settings, they won't
-be executed again.
-
-The format comes in two flavours: XML and binary - both of them hold a complete dump of
-the 'aiScene' data structure returned by the APIs. The focus for the binary format
-(<tt>.assbin</tt>) is fast loading. Optional deflate compression helps reduce file size. The XML
-flavour, <tt>.assxml</tt> or simply .xml, is just a plain-to-xml conversion of aiScene.
-
-ASSBIN is Assimp's binary interchange format. assimp_cmd (<tt>&lt;root&gt;/tools/assimp_cmd</tt>) is able to
-write it and the core library provides a loader for it.
-
-@section assxml XML File format
-
-The format is pretty much self-explanatory due to its similarity to the in-memory aiScene structure.
-With few exceptions, C structures are wrapped in XML elements.
-
-The DTD for ASSXML can be found in <tt>&lt;root&gt;/doc/AssXML_Scheme.xml</tt>. Or have look
-at the output files generated by assimp_cmd.
-
-@section assbin Binary file format
-
-The ASSBIN file format is composed of chunks to represent the hierarchical aiScene data structure.
-This makes the format extensible and allows backward-compatibility with future data structure
-versions. The <tt>&lt;root&gt;/code/assbin_chunks.h</tt> header contains some magic constants
-for use by stand-alone ASSBIN loaders. Also, Assimp's own file writer can be found
-in <tt>&lt;root&gt;/tools/assimp_cmd/WriteDumb.cpp</tt> (yes, the 'b' is no typo ...).
-
-@verbatim
-
--------------------------------------------------------------------------------
-1. File structure:
--------------------------------------------------------------------------------
-
-----------------------
-| Header (500 bytes) |
-----------------------
-| Variable chunks |
-----------------------
-
--------------------------------------------------------------------------------
-2. Definitions:
--------------------------------------------------------------------------------
-
-integer is four bytes wide, stored in little-endian byte order.
-short is two bytes wide, stored in little-endian byte order.
-byte is a single byte.
-string is an integer n followed by n UTF-8 characters, not terminated by zero
-float is an IEEE 754 single-precision floating-point value
-double is an IEEE 754 double-precision floating-point value
-t[n] is an array of n elements of type t
-
--------------------------------------------------------------------------------
-2. Header:
--------------------------------------------------------------------------------
-
-byte[44] Magic identification string for ASSBIN files.
- 'ASSIMP.binary'
-
-integer Major version of the Assimp library which wrote the file
-integer Minor version of the Assimp library which wrote the file
- match these against ASSBIN_VERSION_MAJOR and ASSBIN_VERSION_MINOR
-
-integer SVN revision of the Assimp library (intended for our internal
- debugging - if you write Ass files from your own APPs, set this value to 0.
-integer Assimp compile flags
-
-short 0 for normal files, 1 for shortened dumps for regression tests
- these should have the file extension assbin.regress
-
-short 1 if the data after the header is compressed with the DEFLATE algorithm,
- 0 for uncompressed files.
- For compressed files, the first integer after the header is
- always the uncompressed data size
-
-byte[256] Zero-terminated source file name, UTF-8
-byte[128] Zero-terminated command line parameters passed to assimp_cmd, UTF-8
-
-byte[64] Reserved for future use
----> Total length: 512 bytes
-
--------------------------------------------------------------------------------
-3. Chunks:
--------------------------------------------------------------------------------
-
-integer Magic chunk ID (ASSBIN_CHUNK_XXX)
-integer Chunk data length, in bytes
- (unknown chunks are possible, a good reader skips over them)
-
-byte[n] length-of-chunk bytes of data, depending on the chunk type
-
-Chunks can contain nested chunks. Nested chunks are ALWAYS at the end of the chunk,
-their size is included in length-of-chunk.
-
-The chunk layout for all ASSIMP data structures is derived from their C declarations.
-The general 'rule' to get from Assimp headers to the serialized layout is:
-
- 1. POD members (i.e. aiMesh::mPrimitiveTypes, aiMesh::mNumVertices),
- in order of declaration.
-
- 2. Array-members (aiMesh::mFaces, aiMesh::mVertices, aiBone::mWeights),
- in order of declaration.
-
- 2. Object array members (i.e aiMesh::mBones, aiScene::mMeshes) are stored in
- subchunks directly following the data written in 1.) and 2.)
-
-
- Of course, there are some exceptions to this general order:
-
-[[aiScene]]
-
- - The root node holding the scene structure is naturally stored in
- a ASSBIN_CHUNK_AINODE subchunk following 1.) and 2.) (which is
- empty for aiScene).
-
-[[aiMesh]]
-
- - mTextureCoords and mNumUVComponents are serialized as follows:
-
- [number of used uv channels times]
- integer mNumUVComponents[n]
- float mTextureCoords[n][mNumUVComponents[n]]
-
- -> more than AI_MAX_TEXCOORD_CHANNELS can be stored. This allows Assimp
- builds with different settings for AI_MAX_TEXCOORD_CHANNELS to exchange
- data. Unlike the in-memory format, only the used components of the
- UV coordinates are written to disk. If mNumUVComponents[0] is 1, the
- corresponding mTextureCoords array consists of mNumTextureCoords*1
- single floats.
-
- - The array member block of aiMesh is prefixed with an integer that specifies
- the kinds of vertex components actually present in the mesh. This is a
- bitwise combination of the ASSBIN_MESH_HAS_xxx constants.
-
-[[aiFace]]
-
- - mNumIndices is stored as short
- - mIndices are written as short, if aiMesh::mNumVertices<65536
-
-[[aiNode]]
-
- - mParent is ommitted
-
-[[aiLight]]
-
- - mAttenuationXXX not written if aiLight::mType == aiLightSource_DIRECTIONAL
- - mAngleXXX not written if aiLight::mType != aiLightSource_SPOT
-
-[[aiMaterial]]
-
- - mNumAllocated is ommitted, for obvious reasons :-)
-
-
- @endverbatim*/
-
-
-#define ASSBIN_HEADER_LENGTH 512
-
-// these are the magic chunk identifiers for the binary ASS file format
-#define ASSBIN_CHUNK_AICAMERA 0x1234
-#define ASSBIN_CHUNK_AILIGHT 0x1235
-#define ASSBIN_CHUNK_AITEXTURE 0x1236
-#define ASSBIN_CHUNK_AIMESH 0x1237
-#define ASSBIN_CHUNK_AINODEANIM 0x1238
-#define ASSBIN_CHUNK_AISCENE 0x1239
-#define ASSBIN_CHUNK_AIBONE 0x123a
-#define ASSBIN_CHUNK_AIANIMATION 0x123b
-#define ASSBIN_CHUNK_AINODE 0x123c
-#define ASSBIN_CHUNK_AIMATERIAL 0x123d
-#define ASSBIN_CHUNK_AIMATERIALPROPERTY 0x123e
-
-#define ASSBIN_MESH_HAS_POSITIONS 0x1
-#define ASSBIN_MESH_HAS_NORMALS 0x2
-#define ASSBIN_MESH_HAS_TANGENTS_AND_BITANGENTS 0x4
-#define ASSBIN_MESH_HAS_TEXCOORD_BASE 0x100
-#define ASSBIN_MESH_HAS_COLOR_BASE 0x10000
-
-#define ASSBIN_MESH_HAS_TEXCOORD(n) (ASSBIN_MESH_HAS_TEXCOORD_BASE << n)
-#define ASSBIN_MESH_HAS_COLOR(n) (ASSBIN_MESH_HAS_COLOR_BASE << n)
-
-
-#endif // INCLUDED_ASSBIN_CHUNKS_H
diff --git a/3rdparty/assimp/code/fast_atof.h b/3rdparty/assimp/code/fast_atof.h
deleted file mode 100644
index a584efb7..00000000
--- a/3rdparty/assimp/code/fast_atof.h
+++ /dev/null
@@ -1,306 +0,0 @@
-// Copyright (C) 2002-2007 Nikolaus Gebhardt
-// This file is part of the "Irrlicht Engine" and the "irrXML" project.
-// For conditions of distribution and use, see copyright notice in irrlicht.h and irrXML.h
-
-// ------------------------------------------------------------------------------------
-// Original description: (Schrompf)
-// Adapted to the ASSIMP library because the builtin atof indeed takes AGES to parse a
-// float inside a large string. Before parsing, it does a strlen on the given point.
-// Changes:
-// 22nd October 08 (Aramis_acg): Added temporary cast to double, added strtol10_64
-// to ensure long numbers are handled correctly
-// ------------------------------------------------------------------------------------
-
-
-#ifndef __FAST_A_TO_F_H_INCLUDED__
-#define __FAST_A_TO_F_H_INCLUDED__
-
-#include <math.h>
-
-namespace Assimp
-{
-
-const float fast_atof_table[16] = { // we write [16] here instead of [] to work around a swig bug
- 0.f,
- 0.1f,
- 0.01f,
- 0.001f,
- 0.0001f,
- 0.00001f,
- 0.000001f,
- 0.0000001f,
- 0.00000001f,
- 0.000000001f,
- 0.0000000001f,
- 0.00000000001f,
- 0.000000000001f,
- 0.0000000000001f,
- 0.00000000000001f,
- 0.000000000000001f
-};
-
-
-// ------------------------------------------------------------------------------------
-// Convert a string in decimal format to a number
-// ------------------------------------------------------------------------------------
-inline unsigned int strtol10( const char* in, const char** out=0)
-{
- unsigned int value = 0;
-
- bool running = true;
- while ( running )
- {
- if ( *in < '0' || *in > '9' )
- break;
-
- value = ( value * 10 ) + ( *in - '0' );
- ++in;
- }
- if (out)*out = in;
- return value;
-}
-
-// ------------------------------------------------------------------------------------
-// Convert a string in octal format to a number
-// ------------------------------------------------------------------------------------
-inline unsigned int strtol8( const char* in, const char** out=0)
-{
- unsigned int value = 0;
-
- bool running = true;
- while ( running )
- {
- if ( *in < '0' || *in > '7' )
- break;
-
- value = ( value << 3 ) + ( *in - '0' );
- ++in;
- }
- if (out)*out = in;
- return value;
-}
-
-// ------------------------------------------------------------------------------------
-// Convert a string in hex format to a number
-// ------------------------------------------------------------------------------------
-inline unsigned int strtol16( const char* in, const char** out=0)
-{
- unsigned int value = 0;
-
- bool running = true;
- while ( running )
- {
- if ( *in >= '0' && *in <= '9' )
- {
- value = ( value << 4u ) + ( *in - '0' );
- }
- else if (*in >= 'A' && *in <= 'F')
- {
- value = ( value << 4u ) + ( *in - 'A' ) + 10;
- }
- else if (*in >= 'a' && *in <= 'f')
- {
- value = ( value << 4u ) + ( *in - 'a' ) + 10;
- }
- else break;
- ++in;
- }
- if (out)*out = in;
- return value;
-}
-
-// ------------------------------------------------------------------------------------
-// Convert just one hex digit
-// Return value is 0xffffffff if the input is not hex
-// ------------------------------------------------------------------------------------
-inline unsigned int HexDigitToDecimal(char in)
-{
- unsigned int out = 0xffffffff;
- if (in >= '0' && in <= '9')
- out = in - '0';
-
- else if (in >= 'a' && in <= 'f')
- out = 10u + in - 'a';
-
- else if (in >= 'A' && in <= 'F')
- out = 10u + in - 'A';
-
- // return value is 0xffffffff if the input is not a hex digit
- return out;
-}
-
-// ------------------------------------------------------------------------------------
-// Convert a hex-encoded octet (2 characters processed)
-// Return value is 0xffffffff if the input is not hex
-// ------------------------------------------------------------------------------------
-inline uint8_t HexOctetToDecimal(const char* in)
-{
- return ((uint8_t)HexDigitToDecimal(in[0])<<4)+(uint8_t)HexDigitToDecimal(in[1]);
-}
-
-
-// ------------------------------------------------------------------------------------
-// signed variant of strtol10
-// ------------------------------------------------------------------------------------
-inline int strtol10s( const char* in, const char** out=0)
-{
- bool inv = (*in=='-');
- if (inv || *in=='+')
- ++in;
-
- int value = strtol10(in,out);
- if (inv) {
- value = -value;
- }
- return value;
-}
-
-// ------------------------------------------------------------------------------------
-// Parse a C++-like integer literal - hex and oct prefixes.
-// 0xNNNN - hex
-// 0NNN - oct
-// NNN - dec
-// ------------------------------------------------------------------------------------
-inline unsigned int strtol_cppstyle( const char* in, const char** out=0)
-{
- if ('0' == in[0])
- {
- return 'x' == in[1] ? strtol16(in+2,out) : strtol8(in+1,out);
- }
- return strtol10(in, out);
-}
-
-// ------------------------------------------------------------------------------------
-// Special version of the function, providing higher accuracy and safety
-// It is mainly used by fast_atof to prevent ugly and unwanted integer overflows.
-// ------------------------------------------------------------------------------------
-inline uint64_t strtol10_64( const char* in, const char** out=0, unsigned int* max_inout=0)
-{
- unsigned int cur = 0;
- uint64_t value = 0;
-
- bool running = true;
- while ( running )
- {
- if ( *in < '0' || *in > '9' )
- break;
-
- const uint64_t new_value = ( value * 10 ) + ( *in - '0' );
-
- if (new_value < value) /* numeric overflow, we rely on you */
- return value;
-
- value = new_value;
-
- ++in;
- ++cur;
-
- if (max_inout && *max_inout == cur) {
-
- if (out) { /* skip to end */
- while (*in >= '0' && *in <= '9')
- ++in;
- *out = in;
- }
-
- return value;
- }
- }
- if (out)
- *out = in;
-
- if (max_inout)
- *max_inout = cur;
-
- return value;
-}
-
-// Number of relevant decimals for floating-point parsing.
-#define AI_FAST_ATOF_RELAVANT_DECIMALS 6
-
-// ------------------------------------------------------------------------------------
-//! Provides a fast function for converting a string into a float,
-//! about 6 times faster than atof in win32.
-// If you find any bugs, please send them to me, niko (at) irrlicht3d.org.
-// ------------------------------------------------------------------------------------
-inline const char* fast_atof_move( const char* c, float& out)
-{
- float f;
-
- bool inv = (*c=='-');
- if (inv || *c=='+')
- ++c;
-
- f = (float) strtol10_64 ( c, &c);
- if (*c == '.' || (c[0] == ',' && (c[1] >= '0' || c[1] <= '9'))) // allow for commas, too
- {
- ++c;
-
- // NOTE: The original implementation is highly unaccurate here. The precision of a single
- // IEEE 754 float is not high enough, everything behind the 6th digit tends to be more
- // inaccurate than it would need to be. Casting to double seems to solve the problem.
- // strtol_64 is used to prevent integer overflow.
-
- // Another fix: this tends to become 0 for long numbers if we don't limit the maximum
- // number of digits to be read. AI_FAST_ATOF_RELAVANT_DECIMALS can be a value between
- // 1 and 15.
- unsigned int diff = AI_FAST_ATOF_RELAVANT_DECIMALS;
- double pl = (double) strtol10_64 ( c, &c, &diff );
-
- pl *= fast_atof_table[diff];
- f += (float)pl;
- }
-
- // A major 'E' must be allowed. Necessary for proper reading of some DXF files.
- // Thanks to Zhao Lei to point out that this if () must be outside the if (*c == '.' ..)
- if (*c == 'e' || *c == 'E')
- {
- ++c;
- bool einv = (*c=='-');
- if (einv || *c=='+')
- ++c;
-
- float exp = (float)strtol10_64(c, &c);
- if (einv)
- exp *= -1.0f;
-
- f *= pow(10.0f, exp);
- }
-
- if (inv)
- f *= -1.0f;
-
- out = f;
- return c;
-}
-
-// ------------------------------------------------------------------------------------
-// The same but more human.
-inline float fast_atof(const char* c)
-{
- float ret;
- fast_atof_move(c, ret);
- return ret;
-}
-
-
-inline float fast_atof( const char* c, const char** cout)
-{
- float ret;
- *cout = fast_atof_move(c, ret);
-
- return ret;
-}
-
-inline float fast_atof( const char** inout)
-{
- float ret;
- *inout = fast_atof_move(*inout, ret);
-
- return ret;
-}
-
-} // end of namespace Assimp
-
-#endif
-
diff --git a/3rdparty/assimp/code/irrXMLWrapper.h b/3rdparty/assimp/code/irrXMLWrapper.h
deleted file mode 100644
index af751668..00000000
--- a/3rdparty/assimp/code/irrXMLWrapper.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
-copyright notice, this list of conditions and the
-following disclaimer.
-
-* Redistributions in binary form must reproduce the above
-copyright notice, this list of conditions and the
-following disclaimer in the documentation and/or other
-materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
-contributors may be used to endorse or promote products
-derived from this software without specific prior
-written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-#ifndef INCLUDED_AI_IRRXML_WRAPPER
-#define INCLUDED_AI_IRRXML_WRAPPER
-
-// some long includes ....
-#include "./../contrib/irrXML/irrXML.h"
-#include "./../include/IOStream.h"
-namespace Assimp {
-
-// ---------------------------------------------------------------------------------
-/** @brief Utility class to make IrrXML work together with our custom IO system
- * See the IrrXML docs for more details.
- *
- * Construct IrrXML-Reader in BaseImporter::InternReadFile():
- * @code
- * // open the file
- * boost::scoped_ptr<IOStream> file( pIOHandler->Open( pFile));
- * if ( file.get() == NULL) {
- * throw DeadlyImportError( "Failed to open file " + pFile + ".");
- * }
- *
- * // generate a XML reader for it
- * boost::scoped_ptr<CIrrXML_IOStreamReader> mIOWrapper( new CIrrXML_IOStreamReader( file.get()));
- * mReader = irr::io::createIrrXMLReader( mIOWrapper.get());
- * if ( !mReader) {
- * ThrowException( "xxxx: Unable to open file.");
- * }
- * @endcode
- **/
-class CIrrXML_IOStreamReader
- : public irr::io::IFileReadCallBack
-{
-public:
-
- // ----------------------------------------------------------------------------------
- //! Construction from an existing IOStream
- CIrrXML_IOStreamReader(IOStream* _stream)
- : stream (_stream)
- , t (0)
- {
-
- // Map the buffer into memory and convert it to UTF8. IrrXML provides its
- // own conversion, which is merely a cast from uintNN_t to uint8_t. Thus,
- // it is not suitable for our purposes and we have to do it BEFORE IrrXML
- // gets the buffer. Sadly, this forces as to map the whole file into
- // memory.
-
- data.resize(stream->FileSize());
- stream->Read(&data[0],data.size(),1);
-
- BaseImporter::ConvertToUTF8(data);
- }
-
- // ----------------------------------------------------------------------------------
- //! Virtual destructor
- virtual ~CIrrXML_IOStreamReader() {};
-
- // ----------------------------------------------------------------------------------
- //! Reads an amount of bytes from the file.
- /** @param buffer: Pointer to output buffer.
- * @param sizeToRead: Amount of bytes to read
- * @return Returns how much bytes were read. */
- virtual int read(void* buffer, int sizeToRead) {
- if (sizeToRead<0) {
- return 0;
- }
- if (t+sizeToRead>data.size()) {
- sizeToRead = data.size()-t;
- }
-
- memcpy(buffer,&data.front()+t,sizeToRead);
-
- t += sizeToRead;
- return sizeToRead;
- }
-
- // ----------------------------------------------------------------------------------
- //! Returns size of file in bytes
- virtual int getSize() {
- return (int)data.size();
- }
-
-private:
- IOStream* stream;
- std::vector<char> data;
- size_t t;
-
-}; // ! class CIrrXML_IOStreamReader
-
-} // ! Assimp
-
-#endif // !! INCLUDED_AI_IRRXML_WRAPPER
diff --git a/3rdparty/assimp/code/pstdint.h b/3rdparty/assimp/code/pstdint.h
deleted file mode 100644
index 0c1cec84..00000000
--- a/3rdparty/assimp/code/pstdint.h
+++ /dev/null
@@ -1,729 +0,0 @@
-/* A portable stdint.h
- ****************************************************************************
- * BSD License:
- ****************************************************************************
- *
- * Copyright (c) 2005-2007 Paul Hsieh
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
- *
- ****************************************************************************
- *
- * Version 0.1.10
- *
- * The ANSI C standard committee, for the C99 standard, specified the
- * inclusion of a new standard include file called stdint.h. This is
- * a very useful and long desired include file which contains several
- * very precise definitions for integer scalar types that is
- * critically important for making portable several classes of
- * applications including cryptography, hashing, variable length
- * integer libraries and so on. But for most developers its likely
- * useful just for programming sanity.
- *
- * The problem is that most compiler vendors have decided not to
- * implement the C99 standard, and the next C++ language standard
- * (which has a lot more mindshare these days) will be a long time in
- * coming and its unknown whether or not it will include stdint.h or
- * how much adoption it will have. Either way, it will be a long time
- * before all compilers come with a stdint.h and it also does nothing
- * for the extremely large number of compilers available today which
- * do not include this file, or anything comparable to it.
- *
- * So that's what this file is all about. Its an attempt to build a
- * single universal include file that works on as many platforms as
- * possible to deliver what stdint.h is supposed to. A few things
- * that should be noted about this file:
- *
- * 1) It is not guaranteed to be portable and/or present an identical
- * interface on all platforms. The extreme variability of the
- * ANSI C standard makes this an impossibility right from the
- * very get go. Its really only meant to be useful for the vast
- * majority of platforms that possess the capability of
- * implementing usefully and precisely defined, standard sized
- * integer scalars. Systems which are not intrinsically 2s
- * complement may produce invalid constants.
- *
- * 2) There is an unavoidable use of non-reserved symbols.
- *
- * 3) Other standard include files are invoked.
- *
- * 4) This file may come in conflict with future platforms that do
- * include stdint.h. The hope is that one or the other can be
- * used with no real difference.
- *
- * 5) In the current verison, if your platform can't represent
- * int32_t, int16_t and int8_t, it just dumps out with a compiler
- * error.
- *
- * 6) 64 bit integers may or may not be defined. Test for their
- * presence with the test: #ifdef INT64_MAX or #ifdef UINT64_MAX.
- * Note that this is different from the C99 specification which
- * requires the existence of 64 bit support in the compiler. If
- * this is not defined for your platform, yet it is capable of
- * dealing with 64 bits then it is because this file has not yet
- * been extended to cover all of your system's capabilities.
- *
- * 7) (u)intptr_t may or may not be defined. Test for its presence
- * with the test: #ifdef PTRDIFF_MAX. If this is not defined
- * for your platform, then it is because this file has not yet
- * been extended to cover all of your system's capabilities, not
- * because its optional.
- *
- * 8) The following might not been defined even if your platform is
- * capable of defining it:
- *
- * WCHAR_MIN
- * WCHAR_MAX
- * (u)int64_t
- * PTRDIFF_MIN
- * PTRDIFF_MAX
- * (u)intptr_t
- *
- * 9) The following have not been defined:
- *
- * WINT_MIN
- * WINT_MAX
- *
- * 10) The criteria for defining (u)int_least(*)_t isn't clear,
- * except for systems which don't have a type that precisely
- * defined 8, 16, or 32 bit types (which this include file does
- * not support anyways). Default definitions have been given.
- *
- * 11) The criteria for defining (u)int_fast(*)_t isn't something I
- * would trust to any particular compiler vendor or the ANSI C
- * committee. It is well known that "compatible systems" are
- * commonly created that have very different performance
- * characteristics from the systems they are compatible with,
- * especially those whose vendors make both the compiler and the
- * system. Default definitions have been given, but its strongly
- * recommended that users never use these definitions for any
- * reason (they do *NOT* deliver any serious guarantee of
- * improved performance -- not in this file, nor any vendor's
- * stdint.h).
- *
- * 12) The following macros:
- *
- * PRINTF_INTMAX_MODIFIER
- * PRINTF_INT64_MODIFIER
- * PRINTF_INT32_MODIFIER
- * PRINTF_INT16_MODIFIER
- * PRINTF_LEAST64_MODIFIER
- * PRINTF_LEAST32_MODIFIER
- * PRINTF_LEAST16_MODIFIER
- * PRINTF_INTPTR_MODIFIER
- *
- * are strings which have been defined as the modifiers required
- * for the "d", "u" and "x" printf formats to correctly output
- * (u)intmax_t, (u)int64_t, (u)int32_t, (u)int16_t, (u)least64_t,
- * (u)least32_t, (u)least16_t and (u)intptr_t types respectively.
- * PRINTF_INTPTR_MODIFIER is not defined for some systems which
- * provide their own stdint.h. PRINTF_INT64_MODIFIER is not
- * defined if INT64_MAX is not defined. These are an extension
- * beyond what C99 specifies must be in stdint.h.
- *
- * In addition, the following macros are defined:
- *
- * PRINTF_INTMAX_HEX_WIDTH
- * PRINTF_INT64_HEX_WIDTH
- * PRINTF_INT32_HEX_WIDTH
- * PRINTF_INT16_HEX_WIDTH
- * PRINTF_INT8_HEX_WIDTH
- * PRINTF_INTMAX_DEC_WIDTH
- * PRINTF_INT64_DEC_WIDTH
- * PRINTF_INT32_DEC_WIDTH
- * PRINTF_INT16_DEC_WIDTH
- * PRINTF_INT8_DEC_WIDTH
- *
- * Which specifies the maximum number of characters required to
- * print the number of that type in either hexadecimal or decimal.
- * These are an extension beyond what C99 specifies must be in
- * stdint.h.
- *
- * Compilers tested (all with 0 warnings at their highest respective
- * settings): Borland Turbo C 2.0, WATCOM C/C++ 11.0 (16 bits and 32
- * bits), Microsoft Visual C++ 6.0 (32 bit), Microsoft Visual Studio
- * .net (VC7), Intel C++ 4.0, GNU gcc v3.3.3
- *
- * This file should be considered a work in progress. Suggestions for
- * improvements, especially those which increase coverage are strongly
- * encouraged.
- *
- * Acknowledgements
- *
- * The following people have made significant contributions to the
- * development and testing of this file:
- *
- * Chris Howie
- * John Steele Scott
- * Dave Thorup
- *
- */
-
-#include <stddef.h>
-#include <limits.h>
-#include <signal.h>
-
-/*
- * For gcc with _STDINT_H, fill in the PRINTF_INT*_MODIFIER macros, and
- * do nothing else. On the Mac OS X version of gcc this is _STDINT_H_.
- */
-
-#if ((defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L) || (defined (__WATCOMC__) && (defined (_STDINT_H_INCLUDED) || __WATCOMC__ >= 1250)) || (defined(__GNUC__) && (defined(_STDINT_H) || defined(_STDINT_H_)) )) && !defined (_PSTDINT_H_INCLUDED)
-#include <stdint.h>
-#define _PSTDINT_H_INCLUDED
-# ifndef PRINTF_INT64_MODIFIER
-# define PRINTF_INT64_MODIFIER "ll"
-# endif
-# ifndef PRINTF_INT32_MODIFIER
-# define PRINTF_INT32_MODIFIER "l"
-# endif
-# ifndef PRINTF_INT16_MODIFIER
-# define PRINTF_INT16_MODIFIER "h"
-# endif
-# ifndef PRINTF_INTMAX_MODIFIER
-# define PRINTF_INTMAX_MODIFIER PRINTF_INT64_MODIFIER
-# endif
-# ifndef PRINTF_INT64_HEX_WIDTH
-# define PRINTF_INT64_HEX_WIDTH "16"
-# endif
-# ifndef PRINTF_INT32_HEX_WIDTH
-# define PRINTF_INT32_HEX_WIDTH "8"
-# endif
-# ifndef PRINTF_INT16_HEX_WIDTH
-# define PRINTF_INT16_HEX_WIDTH "4"
-# endif
-# ifndef PRINTF_INT8_HEX_WIDTH
-# define PRINTF_INT8_HEX_WIDTH "2"
-# endif
-# ifndef PRINTF_INT64_DEC_WIDTH
-# define PRINTF_INT64_DEC_WIDTH "20"
-# endif
-# ifndef PRINTF_INT32_DEC_WIDTH
-# define PRINTF_INT32_DEC_WIDTH "10"
-# endif
-# ifndef PRINTF_INT16_DEC_WIDTH
-# define PRINTF_INT16_DEC_WIDTH "5"
-# endif
-# ifndef PRINTF_INT8_DEC_WIDTH
-# define PRINTF_INT8_DEC_WIDTH "3"
-# endif
-# ifndef PRINTF_INTMAX_HEX_WIDTH
-# define PRINTF_INTMAX_HEX_WIDTH PRINTF_INT64_HEX_WIDTH
-# endif
-# ifndef PRINTF_INTMAX_DEC_WIDTH
-# define PRINTF_INTMAX_DEC_WIDTH PRINTF_INT64_DEC_WIDTH
-# endif
-
-/*
- * Something really weird is going on with Open Watcom. Just pull some of
- * these duplicated definitions from Open Watcom's stdint.h file for now.
- */
-
-# if defined (__WATCOMC__) && __WATCOMC__ >= 1250
-# if !defined (INT64_C)
-# define INT64_C(x) (x + (INT64_MAX - INT64_MAX))
-# endif
-# if !defined (UINT64_C)
-# define UINT64_C(x) (x + (UINT64_MAX - UINT64_MAX))
-# endif
-# if !defined (INT32_C)
-# define INT32_C(x) (x + (INT32_MAX - INT32_MAX))
-# endif
-# if !defined (UINT32_C)
-# define UINT32_C(x) (x + (UINT32_MAX - UINT32_MAX))
-# endif
-# if !defined (INT16_C)
-# define INT16_C(x) (x)
-# endif
-# if !defined (UINT16_C)
-# define UINT16_C(x) (x)
-# endif
-# if !defined (INT8_C)
-# define INT8_C(x) (x)
-# endif
-# if !defined (UINT8_C)
-# define UINT8_C(x) (x)
-# endif
-# if !defined (UINT64_MAX)
-# define UINT64_MAX 18446744073709551615ULL
-# endif
-# if !defined (INT64_MAX)
-# define INT64_MAX 9223372036854775807LL
-# endif
-# if !defined (UINT32_MAX)
-# define UINT32_MAX 4294967295UL
-# endif
-# if !defined (INT32_MAX)
-# define INT32_MAX 2147483647L
-# endif
-# if !defined (INTMAX_MAX)
-# define INTMAX_MAX INT64_MAX
-# endif
-# if !defined (INTMAX_MIN)
-# define INTMAX_MIN INT64_MIN
-# endif
-# endif
-#endif
-
-#ifndef _PSTDINT_H_INCLUDED
-#define _PSTDINT_H_INCLUDED
-
-#ifndef SIZE_MAX
-# define SIZE_MAX (~(size_t)0)
-#endif
-
-/*
- * Deduce the type assignments from limits.h under the assumption that
- * integer sizes in bits are powers of 2, and follow the ANSI
- * definitions.
- */
-
-#ifndef UINT8_MAX
-# define UINT8_MAX 0xff
-#endif
-#ifndef uint8_t
-# if (UCHAR_MAX == UINT8_MAX) || defined (S_SPLINT_S)
- typedef unsigned char uint8_t;
-# define UINT8_C(v) ((uint8_t) v)
-# else
-# error "Platform not supported"
-# endif
-#endif
-
-#ifndef INT8_MAX
-# define INT8_MAX 0x7f
-#endif
-#ifndef INT8_MIN
-# define INT8_MIN INT8_C(0x80)
-#endif
-#ifndef int8_t
-# if (SCHAR_MAX == INT8_MAX) || defined (S_SPLINT_S)
- typedef signed char int8_t;
-# define INT8_C(v) ((int8_t) v)
-# else
-# error "Platform not supported"
-# endif
-#endif
-
-#ifndef UINT16_MAX
-# define UINT16_MAX 0xffff
-#endif
-#ifndef uint16_t
-#if (UINT_MAX == UINT16_MAX) || defined (S_SPLINT_S)
- typedef unsigned int uint16_t;
-# ifndef PRINTF_INT16_MODIFIER
-# define PRINTF_INT16_MODIFIER ""
-# endif
-# define UINT16_C(v) ((uint16_t) (v))
-#elif (USHRT_MAX == UINT16_MAX)
- typedef unsigned short uint16_t;
-# define UINT16_C(v) ((uint16_t) (v))
-# ifndef PRINTF_INT16_MODIFIER
-# define PRINTF_INT16_MODIFIER "h"
-# endif
-#else
-#error "Platform not supported"
-#endif
-#endif
-
-#ifndef INT16_MAX
-# define INT16_MAX 0x7fff
-#endif
-#ifndef INT16_MIN
-# define INT16_MIN INT16_C(0x8000)
-#endif
-#ifndef int16_t
-#if (INT_MAX == INT16_MAX) || defined (S_SPLINT_S)
- typedef signed int int16_t;
-# define INT16_C(v) ((int16_t) (v))
-# ifndef PRINTF_INT16_MODIFIER
-# define PRINTF_INT16_MODIFIER ""
-# endif
-#elif (SHRT_MAX == INT16_MAX)
- typedef signed short int16_t;
-# define INT16_C(v) ((int16_t) (v))
-# ifndef PRINTF_INT16_MODIFIER
-# define PRINTF_INT16_MODIFIER "h"
-# endif
-#else
-#error "Platform not supported"
-#endif
-#endif
-
-#ifndef UINT32_MAX
-# define UINT32_MAX (0xffffffffUL)
-#endif
-#ifndef uint32_t
-#if (ULONG_MAX == UINT32_MAX) || defined (S_SPLINT_S)
- typedef unsigned long uint32_t;
-# define UINT32_C(v) v ## UL
-# ifndef PRINTF_INT32_MODIFIER
-# define PRINTF_INT32_MODIFIER "l"
-# endif
-#elif (UINT_MAX == UINT32_MAX)
- typedef unsigned int uint32_t;
-# ifndef PRINTF_INT32_MODIFIER
-# define PRINTF_INT32_MODIFIER ""
-# endif
-# define UINT32_C(v) v ## U
-#elif (USHRT_MAX == UINT32_MAX)
- typedef unsigned short uint32_t;
-# define UINT32_C(v) ((unsigned short) (v))
-# ifndef PRINTF_INT32_MODIFIER
-# define PRINTF_INT32_MODIFIER ""
-# endif
-#else
-#error "Platform not supported"
-#endif
-#endif
-
-#ifndef INT32_MAX
-# define INT32_MAX (0x7fffffffL)
-#endif
-#ifndef INT32_MIN
-# define INT32_MIN INT32_C(0x80000000)
-#endif
-#ifndef int32_t
-#if (LONG_MAX == INT32_MAX) || defined (S_SPLINT_S)
- typedef signed long int32_t;
-# define INT32_C(v) v ## L
-# ifndef PRINTF_INT32_MODIFIER
-# define PRINTF_INT32_MODIFIER "l"
-# endif
-#elif (INT_MAX == INT32_MAX)
- typedef signed int int32_t;
-# define INT32_C(v) v
-# ifndef PRINTF_INT32_MODIFIER
-# define PRINTF_INT32_MODIFIER ""
-# endif
-#elif (SHRT_MAX == INT32_MAX)
- typedef signed short int32_t;
-# define INT32_C(v) ((short) (v))
-# ifndef PRINTF_INT32_MODIFIER
-# define PRINTF_INT32_MODIFIER ""
-# endif
-#else
-#error "Platform not supported"
-#endif
-#endif
-
-/*
- * The macro stdint_int64_defined is temporarily used to record
- * whether or not 64 integer support is available. It must be
- * defined for any 64 integer extensions for new platforms that are
- * added.
- */
-
-#undef stdint_int64_defined
-#if (defined(__STDC__) && defined(__STDC_VERSION__)) || defined (S_SPLINT_S)
-# if (__STDC__ && __STDC_VERSION >= 199901L) || defined (S_SPLINT_S)
-# define stdint_int64_defined
- typedef long long int64_t;
- typedef unsigned long long uint64_t;
-# define UINT64_C(v) v ## ULL
-# define INT64_C(v) v ## LL
-# ifndef PRINTF_INT64_MODIFIER
-# define PRINTF_INT64_MODIFIER "ll"
-# endif
-# endif
-#endif
-
-#if !defined (stdint_int64_defined)
-# if defined(__GNUC__)
-# define stdint_int64_defined
- __extension__ typedef long long int64_t;
- __extension__ typedef unsigned long long uint64_t;
-# define UINT64_C(v) v ## ULL
-# define INT64_C(v) v ## LL
-# ifndef PRINTF_INT64_MODIFIER
-# define PRINTF_INT64_MODIFIER "ll"
-# endif
-# elif defined(__MWERKS__) || defined (__SUNPRO_C) || defined (__SUNPRO_CC) || defined (__APPLE_CC__) || defined (_LONG_LONG) || defined (_CRAYC) || defined (S_SPLINT_S)
-# define stdint_int64_defined
- typedef long long int64_t;
- typedef unsigned long long uint64_t;
-# define UINT64_C(v) v ## ULL
-# define INT64_C(v) v ## LL
-# ifndef PRINTF_INT64_MODIFIER
-# define PRINTF_INT64_MODIFIER "ll"
-# endif
-# elif (defined(__WATCOMC__) && defined(__WATCOM_INT64__)) || (defined(_MSC_VER) && _INTEGRAL_MAX_BITS >= 64) || (defined (__BORLANDC__) && __BORLANDC__ > 0x460) || defined (__alpha) || defined (__DECC)
-# define stdint_int64_defined
- typedef __int64 int64_t;
- typedef unsigned __int64 uint64_t;
-# define UINT64_C(v) v ## UI64
-# define INT64_C(v) v ## I64
-# ifndef PRINTF_INT64_MODIFIER
-# define PRINTF_INT64_MODIFIER "I64"
-# endif
-# endif
-#endif
-
-#if !defined (LONG_LONG_MAX) && defined (INT64_C)
-# define LONG_LONG_MAX INT64_C (9223372036854775807)
-#endif
-#ifndef ULONG_LONG_MAX
-# define ULONG_LONG_MAX UINT64_C (18446744073709551615)
-#endif
-
-#if !defined (INT64_MAX) && defined (INT64_C)
-# define INT64_MAX INT64_C (9223372036854775807)
-#endif
-#if !defined (INT64_MIN) && defined (INT64_C)
-# define INT64_MIN INT64_C (-9223372036854775808)
-#endif
-#if !defined (UINT64_MAX) && defined (INT64_C)
-# define UINT64_MAX UINT64_C (18446744073709551615)
-#endif
-
-/*
- * Width of hexadecimal for number field.
- */
-
-#ifndef PRINTF_INT64_HEX_WIDTH
-# define PRINTF_INT64_HEX_WIDTH "16"
-#endif
-#ifndef PRINTF_INT32_HEX_WIDTH
-# define PRINTF_INT32_HEX_WIDTH "8"
-#endif
-#ifndef PRINTF_INT16_HEX_WIDTH
-# define PRINTF_INT16_HEX_WIDTH "4"
-#endif
-#ifndef PRINTF_INT8_HEX_WIDTH
-# define PRINTF_INT8_HEX_WIDTH "2"
-#endif
-
-#ifndef PRINTF_INT64_DEC_WIDTH
-# define PRINTF_INT64_DEC_WIDTH "20"
-#endif
-#ifndef PRINTF_INT32_DEC_WIDTH
-# define PRINTF_INT32_DEC_WIDTH "10"
-#endif
-#ifndef PRINTF_INT16_DEC_WIDTH
-# define PRINTF_INT16_DEC_WIDTH "5"
-#endif
-#ifndef PRINTF_INT8_DEC_WIDTH
-# define PRINTF_INT8_DEC_WIDTH "3"
-#endif
-
-/*
- * Ok, lets not worry about 128 bit integers for now. Moore's law says
- * we don't need to worry about that until about 2040 at which point
- * we'll have bigger things to worry about.
- */
-
-#ifdef stdint_int64_defined
- typedef int64_t intmax_t;
- typedef uint64_t uintmax_t;
-# define INTMAX_MAX INT64_MAX
-# define INTMAX_MIN INT64_MIN
-# define UINTMAX_MAX UINT64_MAX
-# define UINTMAX_C(v) UINT64_C(v)
-# define INTMAX_C(v) INT64_C(v)
-# ifndef PRINTF_INTMAX_MODIFIER
-# define PRINTF_INTMAX_MODIFIER PRINTF_INT64_MODIFIER
-# endif
-# ifndef PRINTF_INTMAX_HEX_WIDTH
-# define PRINTF_INTMAX_HEX_WIDTH PRINTF_INT64_HEX_WIDTH
-# endif
-# ifndef PRINTF_INTMAX_DEC_WIDTH
-# define PRINTF_INTMAX_DEC_WIDTH PRINTF_INT64_DEC_WIDTH
-# endif
-#else
- typedef int32_t intmax_t;
- typedef uint32_t uintmax_t;
-# define INTMAX_MAX INT32_MAX
-# define UINTMAX_MAX UINT32_MAX
-# define UINTMAX_C(v) UINT32_C(v)
-# define INTMAX_C(v) INT32_C(v)
-# ifndef PRINTF_INTMAX_MODIFIER
-# define PRINTF_INTMAX_MODIFIER PRINTF_INT32_MODIFIER
-# endif
-# ifndef PRINTF_INTMAX_HEX_WIDTH
-# define PRINTF_INTMAX_HEX_WIDTH PRINTF_INT32_HEX_WIDTH
-# endif
-# ifndef PRINTF_INTMAX_DEC_WIDTH
-# define PRINTF_INTMAX_DEC_WIDTH PRINTF_INT32_DEC_WIDTH
-# endif
-#endif
-
-/*
- * Because this file currently only supports platforms which have
- * precise powers of 2 as bit sizes for the default integers, the
- * least definitions are all trivial. Its possible that a future
- * version of this file could have different definitions.
- */
-
-#ifndef stdint_least_defined
- typedef int8_t int_least8_t;
- typedef uint8_t uint_least8_t;
- typedef int16_t int_least16_t;
- typedef uint16_t uint_least16_t;
- typedef int32_t int_least32_t;
- typedef uint32_t uint_least32_t;
-# define PRINTF_LEAST32_MODIFIER PRINTF_INT32_MODIFIER
-# define PRINTF_LEAST16_MODIFIER PRINTF_INT16_MODIFIER
-# define UINT_LEAST8_MAX UINT8_MAX
-# define INT_LEAST8_MAX INT8_MAX
-# define UINT_LEAST16_MAX UINT16_MAX
-# define INT_LEAST16_MAX INT16_MAX
-# define UINT_LEAST32_MAX UINT32_MAX
-# define INT_LEAST32_MAX INT32_MAX
-# define INT_LEAST8_MIN INT8_MIN
-# define INT_LEAST16_MIN INT16_MIN
-# define INT_LEAST32_MIN INT32_MIN
-# ifdef stdint_int64_defined
- typedef int64_t int_least64_t;
- typedef uint64_t uint_least64_t;
-# define PRINTF_LEAST64_MODIFIER PRINTF_INT64_MODIFIER
-# define UINT_LEAST64_MAX UINT64_MAX
-# define INT_LEAST64_MAX INT64_MAX
-# define INT_LEAST64_MIN INT64_MIN
-# endif
-#endif
-#undef stdint_least_defined
-
-/*
- * The ANSI C committee pretending to know or specify anything about
- * performance is the epitome of misguided arrogance. The mandate of
- * this file is to *ONLY* ever support that absolute minimum
- * definition of the fast integer types, for compatibility purposes.
- * No extensions, and no attempt to suggest what may or may not be a
- * faster integer type will ever be made in this file. Developers are
- * warned to stay away from these types when using this or any other
- * stdint.h.
- */
-
-typedef int_least8_t int_fast8_t;
-typedef uint_least8_t uint_fast8_t;
-typedef int_least16_t int_fast16_t;
-typedef uint_least16_t uint_fast16_t;
-typedef int_least32_t int_fast32_t;
-typedef uint_least32_t uint_fast32_t;
-#define UINT_FAST8_MAX UINT_LEAST8_MAX
-#define INT_FAST8_MAX INT_LEAST8_MAX
-#define UINT_FAST16_MAX UINT_LEAST16_MAX
-#define INT_FAST16_MAX INT_LEAST16_MAX
-#define UINT_FAST32_MAX UINT_LEAST32_MAX
-#define INT_FAST32_MAX INT_LEAST32_MAX
-#define INT_FAST8_MIN INT_LEAST8_MIN
-#define INT_FAST16_MIN INT_LEAST16_MIN
-#define INT_FAST32_MIN INT_LEAST32_MIN
-#ifdef stdint_int64_defined
- typedef int_least64_t int_fast64_t;
- typedef uint_least64_t uint_fast64_t;
-# define UINT_FAST64_MAX UINT_LEAST64_MAX
-# define INT_FAST64_MAX INT_LEAST64_MAX
-# define INT_FAST64_MIN INT_LEAST64_MIN
-#endif
-
-#undef stdint_int64_defined
-
-/*
- * Whatever piecemeal, per compiler thing we can do about the wchar_t
- * type limits.
- */
-
-#if defined(__WATCOMC__) || defined(_MSC_VER) || defined (__GNUC__)
-# include <wchar.h>
-# ifndef WCHAR_MIN
-# define WCHAR_MIN 0
-# endif
-# ifndef WCHAR_MAX
-# define WCHAR_MAX ((wchar_t)-1)
-# endif
-#endif
-
-/*
- * Whatever piecemeal, per compiler/platform thing we can do about the
- * (u)intptr_t types and limits.
- */
-
-#if defined (_MSC_VER) && defined (_UINTPTR_T_DEFINED)
-# define STDINT_H_UINTPTR_T_DEFINED
-#endif
-
-#ifndef STDINT_H_UINTPTR_T_DEFINED
-# if defined (__alpha__) || defined (__ia64__) || defined (__x86_64__) || defined (_WIN64)
-# define stdint_intptr_bits 64
-# elif defined (__WATCOMC__) || defined (__TURBOC__)
-# if defined(__TINY__) || defined(__SMALL__) || defined(__MEDIUM__)
-# define stdint_intptr_bits 16
-# else
-# define stdint_intptr_bits 32
-# endif
-# elif defined (__i386__) || defined (_WIN32) || defined (WIN32)
-# define stdint_intptr_bits 32
-# elif defined (__INTEL_COMPILER)
-/* TODO -- what will Intel do about x86-64? */
-# endif
-
-# ifdef stdint_intptr_bits
-# define stdint_intptr_glue3_i(a,b,c) a##b##c
-# define stdint_intptr_glue3(a,b,c) stdint_intptr_glue3_i(a,b,c)
-# ifndef PRINTF_INTPTR_MODIFIER
-# define PRINTF_INTPTR_MODIFIER stdint_intptr_glue3(PRINTF_INT,stdint_intptr_bits,_MODIFIER)
-# endif
-# ifndef PTRDIFF_MAX
-# define PTRDIFF_MAX stdint_intptr_glue3(INT,stdint_intptr_bits,_MAX)
-# endif
-# ifndef PTRDIFF_MIN
-# define PTRDIFF_MIN stdint_intptr_glue3(INT,stdint_intptr_bits,_MIN)
-# endif
-# ifndef UINTPTR_MAX
-# define UINTPTR_MAX stdint_intptr_glue3(UINT,stdint_intptr_bits,_MAX)
-# endif
-# ifndef INTPTR_MAX
-# define INTPTR_MAX stdint_intptr_glue3(INT,stdint_intptr_bits,_MAX)
-# endif
-# ifndef INTPTR_MIN
-# define INTPTR_MIN stdint_intptr_glue3(INT,stdint_intptr_bits,_MIN)
-# endif
-# ifndef INTPTR_C
-# define INTPTR_C(x) stdint_intptr_glue3(INT,stdint_intptr_bits,_C)(x)
-# endif
-# ifndef UINTPTR_C
-# define UINTPTR_C(x) stdint_intptr_glue3(UINT,stdint_intptr_bits,_C)(x)
-# endif
- typedef stdint_intptr_glue3(uint,stdint_intptr_bits,_t) uintptr_t;
- typedef stdint_intptr_glue3( int,stdint_intptr_bits,_t) intptr_t;
-# else
-/* TODO -- This following is likely wrong for some platforms, and does
- nothing for the definition of uintptr_t. */
- typedef ptrdiff_t intptr_t;
-# endif
-# define STDINT_H_UINTPTR_T_DEFINED
-#endif
-
-/*
- * Assumes sig_atomic_t is signed and we have a 2s complement machine.
- */
-
-#ifndef SIG_ATOMIC_MAX
-# define SIG_ATOMIC_MAX ((((sig_atomic_t) 1) << (sizeof (sig_atomic_t)*CHAR_BIT-1)) - 1)
-#endif
-
-#endif
-
diff --git a/3rdparty/assimp/code/qnan.h b/3rdparty/assimp/code/qnan.h
deleted file mode 100644
index c21dc86a..00000000
--- a/3rdparty/assimp/code/qnan.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file qnan.h
- * @brief Some utilities for our dealings with qnans.
- *
- * @note Some loaders use qnans to mark invalid values tempoarily, also
- * Assimp explicitly enforces undefined normals to be set to qnan.
- * qnan utilities are available in standard libraries (C99 for example)
- * but last time I checked compiler coverage was so bad that I decided
- * to reinvent the wheel.
- */
-
-#ifndef AI_QNAN_H_INCLUDED
-#define AI_QNAN_H_INCLUDED
-
-// ---------------------------------------------------------------------------
-/** Data structure to represent the bit pattern of a 32 Bit
- * IEEE 754 floating-point number. */
-union _IEEESingle
-{
- float Float;
- struct
- {
- uint32_t Frac : 23;
- uint32_t Exp : 8;
- uint32_t Sign : 1;
- } IEEE;
-} ;
-
-// ---------------------------------------------------------------------------
-/** Check whether a given float is qNaN.
- * @param in Input value */
-AI_FORCE_INLINE bool is_qnan(float in)
-{
- // the straightforward solution does not work:
- // return (in != in);
- // compiler generates code like this
- // load <in> to <register-with-different-width>
- // compare <register-with-different-width> against <in>
-
- // FIXME: Use <float> stuff instead? I think fpclassify needs C99
- return (reinterpret_cast<_IEEESingle*>(&in)->IEEE.Exp == (1u << 8)-1 &&
- reinterpret_cast<_IEEESingle*>(&in)->IEEE.Frac);
-}
-
-// ---------------------------------------------------------------------------
-/** Check whether a float is NOT qNaN.
- * @param in Input value */
-AI_FORCE_INLINE bool is_not_qnan(float in)
-{
- return !is_qnan(in);
-}
-
-// ---------------------------------------------------------------------------
-/** @brief check whether a float is either NaN or (+/-) INF.
- *
- * Denorms return false, they're treated like normal values.
- * @param in Input value */
-AI_FORCE_INLINE bool is_special_float(float in)
-{
- return (reinterpret_cast<_IEEESingle*>(&in)->IEEE.Exp == (1u << 8)-1);
-}
-
-// ---------------------------------------------------------------------------
-/** @brief Get a fresh qnan. */
-AI_FORCE_INLINE float get_qnan()
-{
- return std::numeric_limits<float>::quiet_NaN();
-}
-
-#endif // !! AI_QNAN_H_INCLUDED
diff --git a/3rdparty/assimp/code/res/resource.h b/3rdparty/assimp/code/res/resource.h
deleted file mode 100644
index a9733ce4..00000000
--- a/3rdparty/assimp/code/res/resource.h
+++ /dev/null
@@ -1,14 +0,0 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft Visual C++ generated include file.
-// Used by assimp.rc
-
-// Nächste Standardwerte für neue Objekte
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 101
-#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1001
-#define _APS_NEXT_SYMED_VALUE 101
-#endif
-#endif
diff --git a/3rdparty/assimp/contrib/ConvertUTF/ConvertUTF.c b/3rdparty/assimp/contrib/ConvertUTF/ConvertUTF.c
deleted file mode 100644
index aeb6735f..00000000
--- a/3rdparty/assimp/contrib/ConvertUTF/ConvertUTF.c
+++ /dev/null
@@ -1,539 +0,0 @@
-/*
- * Copyright 2001-2004 Unicode, Inc.
- *
- * Disclaimer
- *
- * This source code is provided as is by Unicode, Inc. No claims are
- * made as to fitness for any particular purpose. No warranties of any
- * kind are expressed or implied. The recipient agrees to determine
- * applicability of information provided. If this file has been
- * purchased on magnetic or optical media from Unicode, Inc., the
- * sole remedy for any claim will be exchange of defective media
- * within 90 days of receipt.
- *
- * Limitations on Rights to Redistribute This Code
- *
- * Unicode, Inc. hereby grants the right to freely use the information
- * supplied in this file in the creation of products supporting the
- * Unicode Standard, and to make copies of this file in any form
- * for internal or external distribution as long as this notice
- * remains attached.
- */
-
-/* ---------------------------------------------------------------------
-
- Conversions between UTF32, UTF-16, and UTF-8. Source code file.
- Author: Mark E. Davis, 1994.
- Rev History: Rick McGowan, fixes & updates May 2001.
- Sept 2001: fixed const & error conditions per
- mods suggested by S. Parent & A. Lillich.
- June 2002: Tim Dodd added detection and handling of incomplete
- source sequences, enhanced error detection, added casts
- to eliminate compiler warnings.
- July 2003: slight mods to back out aggressive FFFE detection.
- Jan 2004: updated switches in from-UTF8 conversions.
- Oct 2004: updated to use UNI_MAX_LEGAL_UTF32 in UTF-32 conversions.
-
- See the header file "ConvertUTF.h" for complete documentation.
-
------------------------------------------------------------------------- */
-
-
-#include "ConvertUTF.h"
-#ifdef CVTUTF_DEBUG
-#include <stdio.h>
-#endif
-
-static const int halfShift = 10; /* used for shifting by 10 bits */
-
-static const UTF32 halfBase = 0x0010000UL;
-static const UTF32 halfMask = 0x3FFUL;
-
-#define UNI_SUR_HIGH_START (UTF32)0xD800
-#define UNI_SUR_HIGH_END (UTF32)0xDBFF
-#define UNI_SUR_LOW_START (UTF32)0xDC00
-#define UNI_SUR_LOW_END (UTF32)0xDFFF
-#define false 0
-#define true 1
-
-/* --------------------------------------------------------------------- */
-
-ConversionResult ConvertUTF32toUTF16 (
- const UTF32** sourceStart, const UTF32* sourceEnd,
- UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags) {
- ConversionResult result = conversionOK;
- const UTF32* source = *sourceStart;
- UTF16* target = *targetStart;
- while (source < sourceEnd) {
- UTF32 ch;
- if (target >= targetEnd) {
- result = targetExhausted; break;
- }
- ch = *source++;
- if (ch <= UNI_MAX_BMP) { /* Target is a character <= 0xFFFF */
- /* UTF-16 surrogate values are illegal in UTF-32; 0xffff or 0xfffe are both reserved values */
- if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) {
- if (flags == strictConversion) {
- --source; /* return to the illegal value itself */
- result = sourceIllegal;
- break;
- } else {
- *target++ = UNI_REPLACEMENT_CHAR;
- }
- } else {
- *target++ = (UTF16)ch; /* normal case */
- }
- } else if (ch > UNI_MAX_LEGAL_UTF32) {
- if (flags == strictConversion) {
- result = sourceIllegal;
- } else {
- *target++ = UNI_REPLACEMENT_CHAR;
- }
- } else {
- /* target is a character in range 0xFFFF - 0x10FFFF. */
- if (target + 1 >= targetEnd) {
- --source; /* Back up source pointer! */
- result = targetExhausted; break;
- }
- ch -= halfBase;
- *target++ = (UTF16)((ch >> halfShift) + UNI_SUR_HIGH_START);
- *target++ = (UTF16)((ch & halfMask) + UNI_SUR_LOW_START);
- }
- }
- *sourceStart = source;
- *targetStart = target;
- return result;
-}
-
-/* --------------------------------------------------------------------- */
-
-ConversionResult ConvertUTF16toUTF32 (
- const UTF16** sourceStart, const UTF16* sourceEnd,
- UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags) {
- ConversionResult result = conversionOK;
- const UTF16* source = *sourceStart;
- UTF32* target = *targetStart;
- UTF32 ch, ch2;
- while (source < sourceEnd) {
- const UTF16* oldSource = source; /* In case we have to back up because of target overflow. */
- ch = *source++;
- /* If we have a surrogate pair, convert to UTF32 first. */
- if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) {
- /* If the 16 bits following the high surrogate are in the source buffer... */
- if (source < sourceEnd) {
- ch2 = *source;
- /* If it's a low surrogate, convert to UTF32. */
- if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) {
- ch = ((ch - UNI_SUR_HIGH_START) << halfShift)
- + (ch2 - UNI_SUR_LOW_START) + halfBase;
- ++source;
- } else if (flags == strictConversion) { /* it's an unpaired high surrogate */
- --source; /* return to the illegal value itself */
- result = sourceIllegal;
- break;
- }
- } else { /* We don't have the 16 bits following the high surrogate. */
- --source; /* return to the high surrogate */
- result = sourceExhausted;
- break;
- }
- } else if (flags == strictConversion) {
- /* UTF-16 surrogate values are illegal in UTF-32 */
- if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) {
- --source; /* return to the illegal value itself */
- result = sourceIllegal;
- break;
- }
- }
- if (target >= targetEnd) {
- source = oldSource; /* Back up source pointer! */
- result = targetExhausted; break;
- }
- *target++ = ch;
- }
- *sourceStart = source;
- *targetStart = target;
-#ifdef CVTUTF_DEBUG
-if (result == sourceIllegal) {
- fprintf(stderr, "ConvertUTF16toUTF32 illegal seq 0x%04x,%04x\n", ch, ch2);
- fflush(stderr);
-}
-#endif
- return result;
-}
-
-/* --------------------------------------------------------------------- */
-
-/*
- * Index into the table below with the first byte of a UTF-8 sequence to
- * get the number of trailing bytes that are supposed to follow it.
- * Note that *legal* UTF-8 values can't have 4 or 5-bytes. The table is
- * left as-is for anyone who may want to do such conversion, which was
- * allowed in earlier algorithms.
- */
-static const char trailingBytesForUTF8[256] = {
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5
-};
-
-/*
- * Magic values subtracted from a buffer value during UTF8 conversion.
- * This table contains as many values as there might be trailing bytes
- * in a UTF-8 sequence.
- */
-static const UTF32 offsetsFromUTF8[6] = { 0x00000000UL, 0x00003080UL, 0x000E2080UL,
- 0x03C82080UL, 0xFA082080UL, 0x82082080UL };
-
-/*
- * Once the bits are split out into bytes of UTF-8, this is a mask OR-ed
- * into the first byte, depending on how many bytes follow. There are
- * as many entries in this table as there are UTF-8 sequence types.
- * (I.e., one byte sequence, two byte... etc.). Remember that sequencs
- * for *legal* UTF-8 will be 4 or fewer bytes total.
- */
-static const UTF8 firstByteMark[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC };
-
-/* --------------------------------------------------------------------- */
-
-/* The interface converts a whole buffer to avoid function-call overhead.
- * Constants have been gathered. Loops & conditionals have been removed as
- * much as possible for efficiency, in favor of drop-through switches.
- * (See "Note A" at the bottom of the file for equivalent code.)
- * If your compiler supports it, the "isLegalUTF8" call can be turned
- * into an inline function.
- */
-
-/* --------------------------------------------------------------------- */
-
-ConversionResult ConvertUTF16toUTF8 (
- const UTF16** sourceStart, const UTF16* sourceEnd,
- UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags) {
- ConversionResult result = conversionOK;
- const UTF16* source = *sourceStart;
- UTF8* target = *targetStart;
- while (source < sourceEnd) {
- UTF32 ch;
- unsigned short bytesToWrite = 0;
- const UTF32 byteMask = 0xBF;
- const UTF32 byteMark = 0x80;
- const UTF16* oldSource = source; /* In case we have to back up because of target overflow. */
- ch = *source++;
- /* If we have a surrogate pair, convert to UTF32 first. */
- if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) {
- /* If the 16 bits following the high surrogate are in the source buffer... */
- if (source < sourceEnd) {
- UTF32 ch2 = *source;
- /* If it's a low surrogate, convert to UTF32. */
- if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) {
- ch = ((ch - UNI_SUR_HIGH_START) << halfShift)
- + (ch2 - UNI_SUR_LOW_START) + halfBase;
- ++source;
- } else if (flags == strictConversion) { /* it's an unpaired high surrogate */
- --source; /* return to the illegal value itself */
- result = sourceIllegal;
- break;
- }
- } else { /* We don't have the 16 bits following the high surrogate. */
- --source; /* return to the high surrogate */
- result = sourceExhausted;
- break;
- }
- } else if (flags == strictConversion) {
- /* UTF-16 surrogate values are illegal in UTF-32 */
- if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) {
- --source; /* return to the illegal value itself */
- result = sourceIllegal;
- break;
- }
- }
- /* Figure out how many bytes the result will require */
- if (ch < (UTF32)0x80) { bytesToWrite = 1;
- } else if (ch < (UTF32)0x800) { bytesToWrite = 2;
- } else if (ch < (UTF32)0x10000) { bytesToWrite = 3;
- } else if (ch < (UTF32)0x110000) { bytesToWrite = 4;
- } else { bytesToWrite = 3;
- ch = UNI_REPLACEMENT_CHAR;
- }
-
- target += bytesToWrite;
- if (target > targetEnd) {
- source = oldSource; /* Back up source pointer! */
- target -= bytesToWrite; result = targetExhausted; break;
- }
- switch (bytesToWrite) { /* note: everything falls through. */
- case 4: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
- case 3: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
- case 2: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
- case 1: *--target = (UTF8)(ch | firstByteMark[bytesToWrite]);
- }
- target += bytesToWrite;
- }
- *sourceStart = source;
- *targetStart = target;
- return result;
-}
-
-/* --------------------------------------------------------------------- */
-
-/*
- * Utility routine to tell whether a sequence of bytes is legal UTF-8.
- * This must be called with the length pre-determined by the first byte.
- * If not calling this from ConvertUTF8to*, then the length can be set by:
- * length = trailingBytesForUTF8[*source]+1;
- * and the sequence is illegal right away if there aren't that many bytes
- * available.
- * If presented with a length > 4, this returns false. The Unicode
- * definition of UTF-8 goes up to 4-byte sequences.
- */
-
-static Boolean isLegalUTF8(const UTF8 *source, int length) {
- UTF8 a;
- const UTF8 *srcptr = source+length;
- switch (length) {
- default: return false;
- /* Everything else falls through when "true"... */
- case 4: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false;
- case 3: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false;
- case 2: if ((a = (*--srcptr)) > 0xBF) return false;
-
- switch (*source) {
- /* no fall-through in this inner switch */
- case 0xE0: if (a < 0xA0) return false; break;
- case 0xED: if (a > 0x9F) return false; break;
- case 0xF0: if (a < 0x90) return false; break;
- case 0xF4: if (a > 0x8F) return false; break;
- default: if (a < 0x80) return false;
- }
-
- case 1: if (*source >= 0x80 && *source < 0xC2) return false;
- }
- if (*source > 0xF4) return false;
- return true;
-}
-
-/* --------------------------------------------------------------------- */
-
-/*
- * Exported function to return whether a UTF-8 sequence is legal or not.
- * This is not used here; it's just exported.
- */
-Boolean isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd) {
- int length = trailingBytesForUTF8[*source]+1;
- if (source+length > sourceEnd) {
- return false;
- }
- return isLegalUTF8(source, length);
-}
-
-/* --------------------------------------------------------------------- */
-
-ConversionResult ConvertUTF8toUTF16 (
- const UTF8** sourceStart, const UTF8* sourceEnd,
- UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags) {
- ConversionResult result = conversionOK;
- const UTF8* source = *sourceStart;
- UTF16* target = *targetStart;
- while (source < sourceEnd) {
- UTF32 ch = 0;
- unsigned short extraBytesToRead = trailingBytesForUTF8[*source];
- if (source + extraBytesToRead >= sourceEnd) {
- result = sourceExhausted; break;
- }
- /* Do this check whether lenient or strict */
- if (! isLegalUTF8(source, extraBytesToRead+1)) {
- result = sourceIllegal;
- break;
- }
- /*
- * The cases all fall through. See "Note A" below.
- */
- switch (extraBytesToRead) {
- case 5: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */
- case 4: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */
- case 3: ch += *source++; ch <<= 6;
- case 2: ch += *source++; ch <<= 6;
- case 1: ch += *source++; ch <<= 6;
- case 0: ch += *source++;
- }
- ch -= offsetsFromUTF8[extraBytesToRead];
-
- if (target >= targetEnd) {
- source -= (extraBytesToRead+1); /* Back up source pointer! */
- result = targetExhausted; break;
- }
- if (ch <= UNI_MAX_BMP) { /* Target is a character <= 0xFFFF */
- /* UTF-16 surrogate values are illegal in UTF-32 */
- if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) {
- if (flags == strictConversion) {
- source -= (extraBytesToRead+1); /* return to the illegal value itself */
- result = sourceIllegal;
- break;
- } else {
- *target++ = UNI_REPLACEMENT_CHAR;
- }
- } else {
- *target++ = (UTF16)ch; /* normal case */
- }
- } else if (ch > UNI_MAX_UTF16) {
- if (flags == strictConversion) {
- result = sourceIllegal;
- source -= (extraBytesToRead+1); /* return to the start */
- break; /* Bail out; shouldn't continue */
- } else {
- *target++ = UNI_REPLACEMENT_CHAR;
- }
- } else {
- /* target is a character in range 0xFFFF - 0x10FFFF. */
- if (target + 1 >= targetEnd) {
- source -= (extraBytesToRead+1); /* Back up source pointer! */
- result = targetExhausted; break;
- }
- ch -= halfBase;
- *target++ = (UTF16)((ch >> halfShift) + UNI_SUR_HIGH_START);
- *target++ = (UTF16)((ch & halfMask) + UNI_SUR_LOW_START);
- }
- }
- *sourceStart = source;
- *targetStart = target;
- return result;
-}
-
-/* --------------------------------------------------------------------- */
-
-ConversionResult ConvertUTF32toUTF8 (
- const UTF32** sourceStart, const UTF32* sourceEnd,
- UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags) {
- ConversionResult result = conversionOK;
- const UTF32* source = *sourceStart;
- UTF8* target = *targetStart;
- while (source < sourceEnd) {
- UTF32 ch;
- unsigned short bytesToWrite = 0;
- const UTF32 byteMask = 0xBF;
- const UTF32 byteMark = 0x80;
- ch = *source++;
- if (flags == strictConversion ) {
- /* UTF-16 surrogate values are illegal in UTF-32 */
- if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) {
- --source; /* return to the illegal value itself */
- result = sourceIllegal;
- break;
- }
- }
- /*
- * Figure out how many bytes the result will require. Turn any
- * illegally large UTF32 things (> Plane 17) into replacement chars.
- */
- if (ch < (UTF32)0x80) { bytesToWrite = 1;
- } else if (ch < (UTF32)0x800) { bytesToWrite = 2;
- } else if (ch < (UTF32)0x10000) { bytesToWrite = 3;
- } else if (ch <= UNI_MAX_LEGAL_UTF32) { bytesToWrite = 4;
- } else { bytesToWrite = 3;
- ch = UNI_REPLACEMENT_CHAR;
- result = sourceIllegal;
- }
-
- target += bytesToWrite;
- if (target > targetEnd) {
- --source; /* Back up source pointer! */
- target -= bytesToWrite; result = targetExhausted; break;
- }
- switch (bytesToWrite) { /* note: everything falls through. */
- case 4: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
- case 3: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
- case 2: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
- case 1: *--target = (UTF8) (ch | firstByteMark[bytesToWrite]);
- }
- target += bytesToWrite;
- }
- *sourceStart = source;
- *targetStart = target;
- return result;
-}
-
-/* --------------------------------------------------------------------- */
-
-ConversionResult ConvertUTF8toUTF32 (
- const UTF8** sourceStart, const UTF8* sourceEnd,
- UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags) {
- ConversionResult result = conversionOK;
- const UTF8* source = *sourceStart;
- UTF32* target = *targetStart;
- while (source < sourceEnd) {
- UTF32 ch = 0;
- unsigned short extraBytesToRead = trailingBytesForUTF8[*source];
- if (source + extraBytesToRead >= sourceEnd) {
- result = sourceExhausted; break;
- }
- /* Do this check whether lenient or strict */
- if (! isLegalUTF8(source, extraBytesToRead+1)) {
- result = sourceIllegal;
- break;
- }
- /*
- * The cases all fall through. See "Note A" below.
- */
- switch (extraBytesToRead) {
- case 5: ch += *source++; ch <<= 6;
- case 4: ch += *source++; ch <<= 6;
- case 3: ch += *source++; ch <<= 6;
- case 2: ch += *source++; ch <<= 6;
- case 1: ch += *source++; ch <<= 6;
- case 0: ch += *source++;
- }
- ch -= offsetsFromUTF8[extraBytesToRead];
-
- if (target >= targetEnd) {
- source -= (extraBytesToRead+1); /* Back up the source pointer! */
- result = targetExhausted; break;
- }
- if (ch <= UNI_MAX_LEGAL_UTF32) {
- /*
- * UTF-16 surrogate values are illegal in UTF-32, and anything
- * over Plane 17 (> 0x10FFFF) is illegal.
- */
- if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) {
- if (flags == strictConversion) {
- source -= (extraBytesToRead+1); /* return to the illegal value itself */
- result = sourceIllegal;
- break;
- } else {
- *target++ = UNI_REPLACEMENT_CHAR;
- }
- } else {
- *target++ = ch;
- }
- } else { /* i.e., ch > UNI_MAX_LEGAL_UTF32 */
- result = sourceIllegal;
- *target++ = UNI_REPLACEMENT_CHAR;
- }
- }
- *sourceStart = source;
- *targetStart = target;
- return result;
-}
-
-/* ---------------------------------------------------------------------
-
- Note A.
- The fall-through switches in UTF-8 reading code save a
- temp variable, some decrements & conditionals. The switches
- are equivalent to the following loop:
- {
- int tmpBytesToRead = extraBytesToRead+1;
- do {
- ch += *source++;
- --tmpBytesToRead;
- if (tmpBytesToRead) ch <<= 6;
- } while (tmpBytesToRead > 0);
- }
- In UTF-8 writing code, the switches on "bytesToWrite" are
- similarly unrolled loops.
-
- --------------------------------------------------------------------- */
diff --git a/3rdparty/assimp/contrib/ConvertUTF/ConvertUTF.h b/3rdparty/assimp/contrib/ConvertUTF/ConvertUTF.h
deleted file mode 100644
index 76e801ec..00000000
--- a/3rdparty/assimp/contrib/ConvertUTF/ConvertUTF.h
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Copyright 2001-2004 Unicode, Inc.
- *
- * Disclaimer
- *
- * This source code is provided as is by Unicode, Inc. No claims are
- * made as to fitness for any particular purpose. No warranties of any
- * kind are expressed or implied. The recipient agrees to determine
- * applicability of information provided. If this file has been
- * purchased on magnetic or optical media from Unicode, Inc., the
- * sole remedy for any claim will be exchange of defective media
- * within 90 days of receipt.
- *
- * Limitations on Rights to Redistribute This Code
- *
- * Unicode, Inc. hereby grants the right to freely use the information
- * supplied in this file in the creation of products supporting the
- * Unicode Standard, and to make copies of this file in any form
- * for internal or external distribution as long as this notice
- * remains attached.
- */
-#ifndef CONVERTUTF_H
-#define CONVERTUTF_H
-/* ---------------------------------------------------------------------
-
- Conversions between UTF32, UTF-16, and UTF-8. Header file.
-
- Several funtions are included here, forming a complete set of
- conversions between the three formats. UTF-7 is not included
- here, but is handled in a separate source file.
-
- Each of these routines takes pointers to input buffers and output
- buffers. The input buffers are const.
-
- Each routine converts the text between *sourceStart and sourceEnd,
- putting the result into the buffer between *targetStart and
- targetEnd. Note: the end pointers are *after* the last item: e.g.
- *(sourceEnd - 1) is the last item.
-
- The return result indicates whether the conversion was successful,
- and if not, whether the problem was in the source or target buffers.
- (Only the first encountered problem is indicated.)
-
- After the conversion, *sourceStart and *targetStart are both
- updated to point to the end of last text successfully converted in
- the respective buffers.
-
- Input parameters:
- sourceStart - pointer to a pointer to the source buffer.
- The contents of this are modified on return so that
- it points at the next thing to be converted.
- targetStart - similarly, pointer to pointer to the target buffer.
- sourceEnd, targetEnd - respectively pointers to the ends of the
- two buffers, for overflow checking only.
-
- These conversion functions take a ConversionFlags argument. When this
- flag is set to strict, both irregular sequences and isolated surrogates
- will cause an error. When the flag is set to lenient, both irregular
- sequences and isolated surrogates are converted.
-
- Whether the flag is strict or lenient, all illegal sequences will cause
- an error return. This includes sequences such as: <F4 90 80 80>, <C0 80>,
- or <A0> in UTF-8, and values above 0x10FFFF in UTF-32. Conformant code
- must check for illegal sequences.
-
- When the flag is set to lenient, characters over 0x10FFFF are converted
- to the replacement character; otherwise (when the flag is set to strict)
- they constitute an error.
-
- Output parameters:
- The value "sourceIllegal" is returned from some routines if the input
- sequence is malformed. When "sourceIllegal" is returned, the source
- value will point to the illegal value that caused the problem. E.g.,
- in UTF-8 when a sequence is malformed, it points to the start of the
- malformed sequence.
-
- Author: Mark E. Davis, 1994.
- Rev History: Rick McGowan, fixes & updates May 2001.
- Fixes & updates, Sept 2001.
-
------------------------------------------------------------------------- */
-
-/* ---------------------------------------------------------------------
- The following 4 definitions are compiler-specific.
- The C standard does not guarantee that wchar_t has at least
- 16 bits, so wchar_t is no less portable than unsigned short!
- All should be unsigned values to avoid sign extension during
- bit mask & shift operations.
------------------------------------------------------------------------- */
-
-typedef unsigned long UTF32; /* at least 32 bits */
-typedef unsigned short UTF16; /* at least 16 bits */
-typedef unsigned char UTF8; /* typically 8 bits */
-typedef unsigned char Boolean; /* 0 or 1 */
-
-/* Some fundamental constants */
-#define UNI_REPLACEMENT_CHAR (UTF32)0x0000FFFD
-#define UNI_MAX_BMP (UTF32)0x0000FFFF
-#define UNI_MAX_UTF16 (UTF32)0x0010FFFF
-#define UNI_MAX_UTF32 (UTF32)0x7FFFFFFF
-#define UNI_MAX_LEGAL_UTF32 (UTF32)0x0010FFFF
-
-typedef enum {
- conversionOK, /* conversion successful */
- sourceExhausted, /* partial character in source, but hit end */
- targetExhausted, /* insuff. room in target for conversion */
- sourceIllegal /* source sequence is illegal/malformed */
-} ConversionResult;
-
-typedef enum {
- strictConversion = 0,
- lenientConversion
-} ConversionFlags;
-
-/* This is for C++ and does no harm in C */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-ConversionResult ConvertUTF8toUTF16 (
- const UTF8** sourceStart, const UTF8* sourceEnd,
- UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags);
-
-ConversionResult ConvertUTF16toUTF8 (
- const UTF16** sourceStart, const UTF16* sourceEnd,
- UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags);
-
-ConversionResult ConvertUTF8toUTF32 (
- const UTF8** sourceStart, const UTF8* sourceEnd,
- UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags);
-
-ConversionResult ConvertUTF32toUTF8 (
- const UTF32** sourceStart, const UTF32* sourceEnd,
- UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags);
-
-ConversionResult ConvertUTF16toUTF32 (
- const UTF16** sourceStart, const UTF16* sourceEnd,
- UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags);
-
-ConversionResult ConvertUTF32toUTF16 (
- const UTF32** sourceStart, const UTF32* sourceEnd,
- UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags);
-
-Boolean isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd);
-
-#ifdef __cplusplus
-}
-#endif
-
-/* --------------------------------------------------------------------- */
-#endif // CONVERTUTF_H
diff --git a/3rdparty/assimp/contrib/ConvertUTF/readme.txt b/3rdparty/assimp/contrib/ConvertUTF/readme.txt
deleted file mode 100644
index 71f4de98..00000000
--- a/3rdparty/assimp/contrib/ConvertUTF/readme.txt
+++ /dev/null
@@ -1,43 +0,0 @@
-
-The accompanying C source code file "ConvertUTF.c" and the associated header
-file "ConvertUTF.h" provide for conversion between various transformation
-formats of Unicode characters. The following conversions are supported:
-
- UTF-32 to UTF-16
- UTF-32 to UTF-8
- UTF-16 to UTF-32
- UTF-16 to UTF-8
- UTF-8 to UTF-16
- UTF-8 to UTF-32
-
-In addition, there is a test harness which runs various tests.
-
-The files "CVTUTF7.C" and "CVTUTF7.H" are for archival and historical purposes
-only. They have not been updated to Unicode 3.0 or later and should be
-considered obsolescent. "CVTUTF7.C" contains two functions that can convert
-between UCS2 (i.e., the BMP characters only) and UTF-7. Surrogates are
-not supported, the code has not been tested, and should be considered
-unsuitable for general purpose use.
-
-Please submit any bug reports about these programs here:
-
- http://www.unicode.org/unicode/reporting.html
-
-Version 1.0: initial version.
-
-Version 1.1: corrected some minor problems; added stricter checks.
-
-Version 1.2: corrected switch statements associated with "extraBytesToRead"
- in 4 & 5 byte cases, in functions for conversion from UTF8.
- Note: formally, the 4 & 5 byte cases are illegal in the latest
- UTF8, but the table and this code has always catered for those,
- cases since at one time they were legal.
-
-Version 1.3: Updated UTF-8 legality check;
- updated to use UNI_MAX_LEGAL_UTF32 in UTF-32 conversions
- Updated UTF-8 legality tests in harness.c
-
-
-Last update: October 19, 2004
-
-
diff --git a/3rdparty/assimp/contrib/irrXML/CXMLReaderImpl.h b/3rdparty/assimp/contrib/irrXML/CXMLReaderImpl.h
deleted file mode 100644
index 13725f04..00000000
--- a/3rdparty/assimp/contrib/irrXML/CXMLReaderImpl.h
+++ /dev/null
@@ -1,809 +0,0 @@
-// Copyright (C) 2002-2005 Nikolaus Gebhardt
-// This file is part of the "Irrlicht Engine" and the "irrXML" project.
-// For conditions of distribution and use, see copyright notice in irrlicht.h and/or irrXML.h
-
-#ifndef __ICXML_READER_IMPL_H_INCLUDED__
-#define __ICXML_READER_IMPL_H_INCLUDED__
-
-#include "irrXML.h"
-#include "irrString.h"
-#include "irrArray.h"
-
-using namespace Assimp;
-
-#ifdef _DEBUG
-#define IRR_DEBUGPRINT(x) printf((x));
-#else // _DEBUG
-#define IRR_DEBUGPRINT(x)
-#endif // _DEBUG
-
-
-namespace irr
-{
-namespace io
-{
-
-
-//! implementation of the IrrXMLReader
-template<class char_type, class superclass>
-class CXMLReaderImpl : public IIrrXMLReader<char_type, superclass>
-{
-public:
-
- //! Constructor
- CXMLReaderImpl(IFileReadCallBack* callback, bool deleteCallBack = true)
- : TextData(0), P(0), TextBegin(0), TextSize(0), CurrentNodeType(EXN_NONE),
- SourceFormat(ETF_ASCII), TargetFormat(ETF_ASCII)
- {
- if (!callback)
- return;
-
- storeTargetFormat();
-
- // read whole xml file
-
- readFile(callback);
-
- // clean up
-
- if (deleteCallBack)
- delete callback;
-
- // create list with special characters
-
- createSpecialCharacterList();
-
- // set pointer to text begin
- P = TextBegin;
- }
-
-
- //! Destructor
- virtual ~CXMLReaderImpl()
- {
- delete [] TextData;
- }
-
-
- //! Reads forward to the next xml node.
- //! \return Returns false, if there was no further node.
- virtual bool read()
- {
- // if not end reached, parse the node
- if (P && (unsigned int)(P - TextBegin) < TextSize - 1 && *P != 0)
- {
- parseCurrentNode();
- return true;
- }
-
- _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
- return false;
- }
-
-
- //! Returns the type of the current XML node.
- virtual EXML_NODE getNodeType() const
- {
- return CurrentNodeType;
- }
-
-
- //! Returns attribute count of the current XML node.
- virtual int getAttributeCount() const
- {
- return Attributes.size();
- }
-
-
- //! Returns name of an attribute.
- virtual const char_type* getAttributeName(int idx) const
- {
- if (idx < 0 || idx >= (int)Attributes.size())
- return 0;
-
- return Attributes[idx].Name.c_str();
- }
-
-
- //! Returns the value of an attribute.
- virtual const char_type* getAttributeValue(int idx) const
- {
- if (idx < 0 || idx >= (int)Attributes.size())
- return 0;
-
- return Attributes[idx].Value.c_str();
- }
-
-
- //! Returns the value of an attribute.
- virtual const char_type* getAttributeValue(const char_type* name) const
- {
- const SAttribute* attr = getAttributeByName(name);
- if (!attr)
- return 0;
-
- return attr->Value.c_str();
- }
-
-
- //! Returns the value of an attribute
- virtual const char_type* getAttributeValueSafe(const char_type* name) const
- {
- const SAttribute* attr = getAttributeByName(name);
- if (!attr)
- return EmptyString.c_str();
-
- return attr->Value.c_str();
- }
-
-
-
- //! Returns the value of an attribute as integer.
- int getAttributeValueAsInt(const char_type* name) const
- {
- return (int)getAttributeValueAsFloat(name);
- }
-
-
- //! Returns the value of an attribute as integer.
- int getAttributeValueAsInt(int idx) const
- {
- return (int)getAttributeValueAsFloat(idx);
- }
-
-
- //! Returns the value of an attribute as float.
- float getAttributeValueAsFloat(const char_type* name) const
- {
- const SAttribute* attr = getAttributeByName(name);
- if (!attr)
- return 0;
-
- core::stringc c = attr->Value.c_str();
- return fast_atof(c.c_str());
- }
-
-
- //! Returns the value of an attribute as float.
- float getAttributeValueAsFloat(int idx) const
- {
- const char_type* attrvalue = getAttributeValue(idx);
- if (!attrvalue)
- return 0;
-
- core::stringc c = attrvalue;
- return fast_atof(c.c_str());
- }
-
-
- //! Returns the name of the current node.
- virtual const char_type* getNodeName() const
- {
- return NodeName.c_str();
- }
-
-
- //! Returns data of the current node.
- virtual const char_type* getNodeData() const
- {
- return NodeName.c_str();
- }
-
-
- //! Returns if an element is an empty element, like <foo />
- virtual bool isEmptyElement() const
- {
- return IsEmptyElement;
- }
-
- //! Returns format of the source xml file.
- virtual ETEXT_FORMAT getSourceFormat() const
- {
- return SourceFormat;
- }
-
- //! Returns format of the strings returned by the parser.
- virtual ETEXT_FORMAT getParserFormat() const
- {
- return TargetFormat;
- }
-
-private:
-
- // Reads the current xml node
- void parseCurrentNode()
- {
- char_type* start = P;
-
- // more forward until '<' found
- while (*P != L'<' && *P)
- ++P;
-
- if (!*P)
- return;
-
- if (P - start > 0)
- {
- // we found some text, store it
- if (setText(start, P))
- return;
- }
-
- ++P;
-
- // based on current token, parse and report next element
- switch(*P)
- {
- case L'/':
- parseClosingXMLElement();
- break;
- case L'?':
- ignoreDefinition();
- break;
- case L'!':
- if (!parseCDATA())
- parseComment();
- break;
- default:
- parseOpeningXMLElement();
- break;
- }
- }
-
-
- //! sets the state that text was found. Returns true if set should be set
- bool setText(char_type* start, char_type* end)
- {
- // check if text is more than 2 characters, and if not, check if there is
- // only white space, so that this text won't be reported
- if (end - start < 3)
- {
- char_type* p = start;
- for (; p != end; ++p)
- if (!isWhiteSpace(*p))
- break;
-
- if (p == end)
- return false;
- }
-
- // set current text to the parsed text, and replace xml special characters
- core::string<char_type> s(start, (int)(end - start));
- NodeName = replaceSpecialCharacters(s);
-
- // current XML node type is text
- CurrentNodeType = EXN_TEXT;
-
- return true;
- }
-
-
-
- //! ignores an xml definition like <?xml something />
- void ignoreDefinition()
- {
- CurrentNodeType = EXN_UNKNOWN;
-
- // move until end marked with '>' reached
- while (*P != L'>')
- ++P;
-
- ++P;
- }
-
-
- //! parses a comment
- void parseComment()
- {
- CurrentNodeType = EXN_COMMENT;
- P += 1;
-
- char_type *pCommentBegin = P;
-
- int count = 1;
-
- // move until end of comment reached
- while (count)
- {
- if (*P == L'>')
- --count;
- else
- if (*P == L'<')
- ++count;
-
- ++P;
- }
-
- P -= 3;
- NodeName = core::string<char_type>(pCommentBegin+2, (int)(P - pCommentBegin-2));
- P += 3;
- }
-
-
- //! parses an opening xml element and reads attributes
- void parseOpeningXMLElement()
- {
- CurrentNodeType = EXN_ELEMENT;
- IsEmptyElement = false;
- Attributes.clear();
-
- // find name
- const char_type* startName = P;
-
- // find end of element
- while (*P != L'>' && !isWhiteSpace(*P))
- ++P;
-
- const char_type* endName = P;
-
- // find Attributes
- while (*P != L'>')
- {
- if (isWhiteSpace(*P))
- ++P;
- else
- {
- if (*P != L'/')
- {
- // we've got an attribute
-
- // read the attribute names
- const char_type* attributeNameBegin = P;
-
- while (!isWhiteSpace(*P) && *P != L'=')
- ++P;
-
- const char_type* attributeNameEnd = P;
- ++P;
-
- // read the attribute value
- // check for quotes and single quotes, thx to murphy
- while ( (*P != L'\"') && (*P != L'\'') && *P)
- ++P;
-
- if (!*P) // malformatted xml file
- return;
-
- const char_type attributeQuoteChar = *P;
-
- ++P;
- const char_type* attributeValueBegin = P;
-
- while (*P != attributeQuoteChar && *P)
- ++P;
-
- if (!*P) // malformatted xml file
- return;
-
- const char_type* attributeValueEnd = P;
- ++P;
-
- SAttribute attr;
- attr.Name = core::string<char_type>(attributeNameBegin,
- (int)(attributeNameEnd - attributeNameBegin));
-
- core::string<char_type> s(attributeValueBegin,
- (int)(attributeValueEnd - attributeValueBegin));
-
- attr.Value = replaceSpecialCharacters(s);
- Attributes.push_back(attr);
- }
- else
- {
- // tag is closed directly
- ++P;
- IsEmptyElement = true;
- break;
- }
- }
- }
-
- // check if this tag is closing directly
- if (endName > startName && *(endName-1) == L'/')
- {
- // directly closing tag
- IsEmptyElement = true;
- endName--;
- }
-
- NodeName = core::string<char_type>(startName, (int)(endName - startName));
-
- ++P;
- }
-
-
- //! parses an closing xml tag
- void parseClosingXMLElement()
- {
- CurrentNodeType = EXN_ELEMENT_END;
- IsEmptyElement = false;
- Attributes.clear();
-
- ++P;
- const char_type* pBeginClose = P;
-
- while (*P != L'>')
- ++P;
-
- // remove trailing whitespace, if any
- while ( isspace( P[-1]))
- --P;
-
- NodeName = core::string<char_type>(pBeginClose, (int)(P - pBeginClose));
- ++P;
- }
-
- //! parses a possible CDATA section, returns false if begin was not a CDATA section
- bool parseCDATA()
- {
- if (*(P+1) != L'[')
- return false;
-
- CurrentNodeType = EXN_CDATA;
-
- // skip '<![CDATA['
- int count=0;
- while ( *P && count<8 )
- {
- ++P;
- ++count;
- }
-
- if (!*P)
- return true;
-
- char_type *cDataBegin = P;
- char_type *cDataEnd = 0;
-
- // find end of CDATA
- while (*P && !cDataEnd)
- {
- if (*P == L'>' &&
- (*(P-1) == L']') &&
- (*(P-2) == L']'))
- {
- cDataEnd = P - 2;
- }
-
- ++P;
- }
-
- if ( cDataEnd )
- NodeName = core::string<char_type>(cDataBegin, (int)(cDataEnd - cDataBegin));
- else
- NodeName = "";
-
- return true;
- }
-
-
- // structure for storing attribute-name pairs
- struct SAttribute
- {
- core::string<char_type> Name;
- core::string<char_type> Value;
- };
-
- // finds a current attribute by name, returns 0 if not found
- const SAttribute* getAttributeByName(const char_type* name) const
- {
- if (!name)
- return 0;
-
- core::string<char_type> n = name;
-
- for (int i=0; i<(int)Attributes.size(); ++i)
- if (Attributes[i].Name == n)
- return &Attributes[i];
-
- return 0;
- }
-
- // replaces xml special characters in a string and creates a new one
- core::string<char_type> replaceSpecialCharacters(
- core::string<char_type>& origstr)
- {
- int pos = origstr.findFirst(L'&');
- int oldPos = 0;
-
- if (pos == -1)
- return origstr;
-
- core::string<char_type> newstr;
-
- while (pos != -1 && pos < origstr.size()-2)
- {
- // check if it is one of the special characters
-
- int specialChar = -1;
- for (int i=0; i<(int)SpecialCharacters.size(); ++i)
- {
- const char_type* p = &origstr.c_str()[pos]+1;
-
- if (equalsn(&SpecialCharacters[i][1], p, SpecialCharacters[i].size()-1))
- {
- specialChar = i;
- break;
- }
- }
-
- if (specialChar != -1)
- {
- newstr.append(origstr.subString(oldPos, pos - oldPos));
- newstr.append(SpecialCharacters[specialChar][0]);
- pos += SpecialCharacters[specialChar].size();
- }
- else
- {
- newstr.append(origstr.subString(oldPos, pos - oldPos + 1));
- pos += 1;
- }
-
- // find next &
- oldPos = pos;
- pos = origstr.findNext(L'&', pos);
- }
-
- if (oldPos < origstr.size()-1)
- newstr.append(origstr.subString(oldPos, origstr.size()-oldPos));
-
- return newstr;
- }
-
-
-
- //! reads the xml file and converts it into the wanted character format.
- bool readFile(IFileReadCallBack* callback)
- {
- int size = callback->getSize();
- size += 4; // We need two terminating 0's at the end.
- // For ASCII we need 1 0's, for UTF-16 2, for UTF-32 4.
-
- char* data8 = new char[size];
-
- if (!callback->read(data8, size-4))
- {
- delete [] data8;
- return false;
- }
-
- // add zeros at end
-
- data8[size-1] = 0;
- data8[size-2] = 0;
- data8[size-3] = 0;
- data8[size-4] = 0;
-
- char16* data16 = reinterpret_cast<char16*>(data8);
- char32* data32 = reinterpret_cast<char32*>(data8);
-
- // now we need to convert the data to the desired target format
- // based on the byte order mark.
-
- const unsigned char UTF8[] = {0xEF, 0xBB, 0xBF}; // 0xEFBBBF;
- const int UTF16_BE = 0xFFFE;
- const int UTF16_LE = 0xFEFF;
- const int UTF32_BE = 0xFFFE0000;
- const int UTF32_LE = 0x0000FEFF;
-
- // check source for all utf versions and convert to target data format
-
- if (size >= 4 && data32[0] == (char32)UTF32_BE)
- {
- // UTF-32, big endian
- SourceFormat = ETF_UTF32_BE;
- convertTextData(data32+1, data8, (size/4)); // data32+1 because we need to skip the header
- }
- else
- if (size >= 4 && data32[0] == (char32)UTF32_LE)
- {
- // UTF-32, little endian
- SourceFormat = ETF_UTF32_LE;
- convertTextData(data32+1, data8, (size/4)); // data32+1 because we need to skip the header
- }
- else
- if (size >= 2 && data16[0] == UTF16_BE)
- {
- // UTF-16, big endian
- SourceFormat = ETF_UTF16_BE;
- convertTextData(data16+1, data8, (size/2)); // data16+1 because we need to skip the header
- }
- else
- if (size >= 2 && data16[0] == UTF16_LE)
- {
- // UTF-16, little endian
- SourceFormat = ETF_UTF16_LE;
- convertTextData(data16+1, data8, (size/2)); // data16+1 because we need to skip the header
- }
- else
- if (size >= 3 && data8[0] == UTF8[0] && data8[1] == UTF8[1] && data8[2] == UTF8[2])
- {
- // UTF-8
- SourceFormat = ETF_UTF8;
- convertTextData(data8+3, data8, size); // data8+3 because we need to skip the header
- }
- else
- {
- // ASCII
- SourceFormat = ETF_ASCII;
- convertTextData(data8, data8, size);
- }
-
- return true;
- }
-
-
- //! converts the text file into the desired format.
- //! \param source: begin of the text (without byte order mark)
- //! \param pointerToStore: pointer to text data block which can be
- //! stored or deleted based on the nesessary conversion.
- //! \param sizeWithoutHeader: Text size in characters without header
- template<class src_char_type>
- void convertTextData(src_char_type* source, char* pointerToStore, int sizeWithoutHeader)
- {
- // convert little to big endian if necessary
- if (sizeof(src_char_type) > 1 &&
- isLittleEndian(TargetFormat) != isLittleEndian(SourceFormat))
- convertToLittleEndian(source);
-
- // check if conversion is necessary:
- if (sizeof(src_char_type) == sizeof(char_type))
- {
- // no need to convert
- TextBegin = (char_type*)source;
- TextData = (char_type*)pointerToStore;
- TextSize = sizeWithoutHeader;
- }
- else
- {
- // convert source into target data format.
- // TODO: implement a real conversion. This one just
- // copies bytes. This is a problem when there are
- // unicode symbols using more than one character.
-
- TextData = new char_type[sizeWithoutHeader];
-
- // MSVC debugger complains here about loss of data ...
-
-
- // FIXME - gcc complains about 'shift width larger than width of type'
- // for T == unsigned long. Avoid it by messing around volatile ..
- volatile unsigned int c = 3;
- const src_char_type cc = (src_char_type)((((uint64_t)1u << (sizeof( char_type)<<c)) - 1));
- for (int i=0; i<sizeWithoutHeader; ++i)
- TextData[i] = char_type( source[i] & cc);
-
- TextBegin = TextData;
- TextSize = sizeWithoutHeader;
-
- // delete original data because no longer needed
- delete [] pointerToStore;
- }
- }
-
- //! converts whole text buffer to little endian
- template<class src_char_type>
- void convertToLittleEndian(src_char_type* t)
- {
- if (sizeof(src_char_type) == 4)
- {
- // 32 bit
-
- while (*t)
- {
- *t = ((*t & 0xff000000) >> 24) |
- ((*t & 0x00ff0000) >> 8) |
- ((*t & 0x0000ff00) << 8) |
- ((*t & 0x000000ff) << 24);
- ++t;
- }
- }
- else
- {
- // 16 bit
-
- while (*t)
- {
- *t = (*t >> 8) | (*t << 8);
- ++t;
- }
- }
- }
-
- //! returns if a format is little endian
- inline bool isLittleEndian(ETEXT_FORMAT f)
- {
- return f == ETF_ASCII ||
- f == ETF_UTF8 ||
- f == ETF_UTF16_LE ||
- f == ETF_UTF32_LE;
- }
-
-
- //! returns true if a character is whitespace
- inline bool isWhiteSpace(char_type c)
- {
- return (c==' ' || c=='\t' || c=='\n' || c=='\r');
- }
-
-
- //! generates a list with xml special characters
- void createSpecialCharacterList()
- {
- // list of strings containing special symbols,
- // the first character is the special character,
- // the following is the symbol string without trailing &.
-
- SpecialCharacters.push_back("&amp;");
- SpecialCharacters.push_back("<lt;");
- SpecialCharacters.push_back(">gt;");
- SpecialCharacters.push_back("\"quot;");
- SpecialCharacters.push_back("'apos;");
-
- }
-
-
- //! compares the first n characters of the strings
- bool equalsn(const char_type* str1, const char_type* str2, int len)
- {
- int i;
- for (i=0; str1[i] && str2[i] && i < len; ++i)
- if (str1[i] != str2[i])
- return false;
-
- // if one (or both) of the strings was smaller then they
- // are only equal if they have the same lenght
- return (i == len) || (str1[i] == 0 && str2[i] == 0);
- }
-
-
- //! stores the target text format
- void storeTargetFormat()
- {
- // get target format. We could have done this using template specialization,
- // but VisualStudio 6 don't like it and we want to support it.
-
- switch(sizeof(char_type))
- {
- case 1:
- TargetFormat = ETF_UTF8;
- break;
- case 2:
- TargetFormat = ETF_UTF16_LE;
- break;
- case 4:
- TargetFormat = ETF_UTF32_LE;
- break;
- default:
- TargetFormat = ETF_ASCII; // should never happen.
- }
- }
-
-
- // instance variables:
-
- char_type* TextData; // data block of the text file
- char_type* P; // current point in text to parse
- char_type* TextBegin; // start of text to parse
- unsigned int TextSize; // size of text to parse in characters, not bytes
-
- EXML_NODE CurrentNodeType; // type of the currently parsed node
- ETEXT_FORMAT SourceFormat; // source format of the xml file
- ETEXT_FORMAT TargetFormat; // output format of this parser
-
- core::string<char_type> NodeName; // name of the node currently in
- core::string<char_type> EmptyString; // empty string to be returned by getSafe() methods
-
- bool IsEmptyElement; // is the currently parsed node empty?
-
- core::array< core::string<char_type> > SpecialCharacters; // see createSpecialCharacterList()
-
- core::array<SAttribute> Attributes; // attributes of current element
-
-}; // end CXMLReaderImpl
-
-
-} // end namespace
-} // end namespace
-
-#endif
diff --git a/3rdparty/assimp/contrib/irrXML/heapsort.h b/3rdparty/assimp/contrib/irrXML/heapsort.h
deleted file mode 100644
index 0409f915..00000000
--- a/3rdparty/assimp/contrib/irrXML/heapsort.h
+++ /dev/null
@@ -1,73 +0,0 @@
-// Copyright (C) 2002-2005 Nikolaus Gebhardt
-// This file is part of the "Irrlicht Engine".
-// For conditions of distribution and use, see copyright notice in irrlicht.h
-
-#ifndef __IRR_HEAPSORT_H_INCLUDED__
-#define __IRR_HEAPSORT_H_INCLUDED__
-
-#include "irrTypes.h"
-
-namespace irr
-{
-namespace core
-{
-
-//! Sinks an element into the heap.
-template<class T>
-inline void heapsink(T*array, s32 element, s32 max)
-{
- while ((element<<1) < max) // there is a left child
- {
- s32 j = (element<<1);
-
- if (j+1 < max && array[j] < array[j+1])
- j = j+1; // take right child
-
- if (array[element] < array[j])
- {
- T t = array[j]; // swap elements
- array[j] = array[element];
- array[element] = t;
- element = j;
- }
- else
- return;
- }
-}
-
-
-//! Sorts an array with size 'size' using heapsort.
-template<class T>
-inline void heapsort(T* array_, s32 size)
-{
- // for heapsink we pretent this is not c++, where
- // arrays start with index 0. So we decrease the array pointer,
- // the maximum always +2 and the element always +1
-
- T* virtualArray = array_ - 1;
- s32 virtualSize = size + 2;
- s32 i;
-
- // build heap
-
- for (i=((size-1)/2); i>=0; --i)
- heapsink(virtualArray, i+1, virtualSize-1);
-
- // sort array
-
- for (i=size-1; i>=0; --i)
- {
- T t = array_[0];
- array_[0] = array_[i];
- array_[i] = t;
- heapsink(virtualArray, 1, i + 1);
- }
-}
-
-} // end namespace core
-} // end namespace irr
-
-
-
-#endif
-
diff --git a/3rdparty/assimp/contrib/irrXML/irrArray.h b/3rdparty/assimp/contrib/irrXML/irrArray.h
deleted file mode 100644
index 8c762f43..00000000
--- a/3rdparty/assimp/contrib/irrXML/irrArray.h
+++ /dev/null
@@ -1,444 +0,0 @@
-// Copyright (C) 2002-2005 Nikolaus Gebhardt
-// This file is part of the "Irrlicht Engine" and the "irrXML" project.
-// For conditions of distribution and use, see copyright notice in irrlicht.h and irrXML.h
-
-#ifndef __IRR_ARRAY_H_INCLUDED__
-#define __IRR_ARRAY_H_INCLUDED__
-
-#include "irrTypes.h"
-#include "heapsort.h"
-
-namespace irr
-{
-namespace core
-{
-
-//! Self reallocating template array (like stl vector) with additional features.
-/** Some features are: Heap sorting, binary search methods, easier debugging.
-*/
-template <class T>
-class array
-{
-
-public:
-
- array()
- : data(0), allocated(0), used(0),
- free_when_destroyed(true), is_sorted(true)
- {
- }
-
- //! Constructs a array and allocates an initial chunk of memory.
- //! \param start_count: Amount of elements to allocate.
- array(u32 start_count)
- : data(0), allocated(0), used(0),
- free_when_destroyed(true), is_sorted(true)
- {
- reallocate(start_count);
- }
-
-
- //! Copy constructor
- array(const array<T>& other)
- : data(0)
- {
- *this = other;
- }
-
-
-
- //! Destructor. Frees allocated memory, if set_free_when_destroyed
- //! was not set to false by the user before.
- ~array()
- {
- if (free_when_destroyed)
- delete [] data;
- }
-
-
-
- //! Reallocates the array, make it bigger or smaller.
- //! \param new_size: New size of array.
- void reallocate(u32 new_size)
- {
- T* old_data = data;
-
- data = new T[new_size];
- allocated = new_size;
-
- s32 end = used < new_size ? used : new_size;
- for (s32 i=0; i<end; ++i)
- data[i] = old_data[i];
-
- if (allocated < used)
- used = allocated;
-
- delete [] old_data;
- }
-
- //! Adds an element at back of array. If the array is to small to
- //! add this new element, the array is made bigger.
- //! \param element: Element to add at the back of the array.
- void push_back(const T& element)
- {
- if (used + 1 > allocated)
- {
- // reallocate(used * 2 +1);
- // this doesn't work if the element is in the same array. So
- // we'll copy the element first to be sure we'll get no data
- // corruption
-
- T e;
- e = element; // copy element
- reallocate(used * 2 +1); // increase data block
- data[used++] = e; // push_back
- is_sorted = false;
- return;
- }
-
- data[used++] = element;
- is_sorted = false;
- }
-
-
- //! Adds an element at the front of the array. If the array is to small to
- //! add this new element, the array is made bigger. Please note that this
- //! is slow, because the whole array needs to be copied for this.
- //! \param element: Element to add at the back of the array.
- void push_front(const T& element)
- {
- if (used + 1 > allocated)
- reallocate(used * 2 +1);
-
- for (int i=(int)used; i>0; --i)
- data[i] = data[i-1];
-
- data[0] = element;
- is_sorted = false;
- ++used;
- }
-
-
- //! Insert item into array at specified position. Please use this
- //! only if you know what you are doing (possible performance loss).
- //! The preferred method of adding elements should be push_back().
- //! \param element: Element to be inserted
- //! \param index: Where position to insert the new element.
- void insert(const T& element, u32 index=0)
- {
- _IRR_DEBUG_BREAK_IF(index>used) // access violation
-
- if (used + 1 > allocated)
- reallocate(used * 2 +1);
-
- for (u32 i=used++; i>index; i--)
- data[i] = data[i-1];
-
- data[index] = element;
- is_sorted = false;
- }
-
-
-
-
- //! Clears the array and deletes all allocated memory.
- void clear()
- {
- delete [] data;
- data = 0;
- used = 0;
- allocated = 0;
- is_sorted = true;
- }
-
-
-
- //! Sets pointer to new array, using this as new workspace.
- //! \param newPointer: Pointer to new array of elements.
- //! \param size: Size of the new array.
- void set_pointer(T* newPointer, u32 size)
- {
- delete [] data;
- data = newPointer;
- allocated = size;
- used = size;
- is_sorted = false;
- }
-
-
-
- //! Sets if the array should delete the memory it used.
- //! \param f: If true, the array frees the allocated memory in its
- //! destructor, otherwise not. The default is true.
- void set_free_when_destroyed(bool f)
- {
- free_when_destroyed = f;
- }
-
-
-
- //! Sets the size of the array.
- //! \param usedNow: Amount of elements now used.
- void set_used(u32 usedNow)
- {
- if (allocated < usedNow)
- reallocate(usedNow);
-
- used = usedNow;
- }
-
-
-
- //! Assignement operator
- void operator=(const array<T>& other)
- {
- if (data)
- delete [] data;
-
- //if (allocated < other.allocated)
- if (other.allocated == 0)
- data = 0;
- else
- data = new T[other.allocated];
-
- used = other.used;
- free_when_destroyed = other.free_when_destroyed;
- is_sorted = other.is_sorted;
- allocated = other.allocated;
-
- for (u32 i=0; i<other.used; ++i)
- data[i] = other.data[i];
- }
-
-
- //! Direct access operator
- T& operator [](u32 index)
- {
- _IRR_DEBUG_BREAK_IF(index>=used) // access violation
-
- return data[index];
- }
-
-
-
- //! Direct access operator
- const T& operator [](u32 index) const
- {
- _IRR_DEBUG_BREAK_IF(index>=used) // access violation
-
- return data[index];
- }
-
- //! Gets last frame
- const T& getLast() const
- {
- _IRR_DEBUG_BREAK_IF(!used) // access violation
-
- return data[used-1];
- }
-
- //! Gets last frame
- T& getLast()
- {
- _IRR_DEBUG_BREAK_IF(!used) // access violation
-
- return data[used-1];
- }
-
-
- //! Returns a pointer to the array.
- //! \return Pointer to the array.
- T* pointer()
- {
- return data;
- }
-
-
-
- //! Returns a const pointer to the array.
- //! \return Pointer to the array.
- const T* const_pointer() const
- {
- return data;
- }
-
-
-
- //! Returns size of used array.
- //! \return Size of elements in the array.
- u32 size() const
- {
- return used;
- }
-
-
-
- //! Returns amount memory allocated.
- //! \return Returns amount of memory allocated. The amount of bytes
- //! allocated would be allocated_size() * sizeof(ElementsUsed);
- u32 allocated_size() const
- {
- return allocated;
- }
-
-
-
- //! Returns true if array is empty
- //! \return True if the array is empty, false if not.
- bool empty() const
- {
- return used == 0;
- }
-
-
-
- //! Sorts the array using heapsort. There is no additional memory waste and
- //! the algorithm performs (O) n log n in worst case.
- void sort()
- {
- if (is_sorted || used<2)
- return;
-
- heapsort(data, used);
- is_sorted = true;
- }
-
-
-
- //! Performs a binary search for an element, returns -1 if not found.
- //! The array will be sorted before the binary search if it is not
- //! already sorted.
- //! \param element: Element to search for.
- //! \return Returns position of the searched element if it was found,
- //! otherwise -1 is returned.
- s32 binary_search(const T& element)
- {
- return binary_search(element, 0, used-1);
- }
-
-
-
- //! Performs a binary search for an element, returns -1 if not found.
- //! The array will be sorted before the binary search if it is not
- //! already sorted.
- //! \param element: Element to search for.
- //! \param left: First left index
- //! \param right: Last right index.
- //! \return Returns position of the searched element if it was found,
- //! otherwise -1 is returned.
- s32 binary_search(const T& element, s32 left, s32 right)
- {
- if (!used)
- return -1;
-
- sort();
-
- s32 m;
-
- do
- {
- m = (left+right)>>1;
-
- if (element < data[m])
- right = m - 1;
- else
- left = m + 1;
-
- } while ((element < data[m] || data[m] < element) && left<=right);
-
- // this last line equals to:
- // " while ((element != array[m]) && left<=right);"
- // but we only want to use the '<' operator.
- // the same in next line, it is "(element == array[m])"
-
- if (!(element < data[m]) && !(data[m] < element))
- return m;
-
- return -1;
- }
-
-
- //! Finds an element in linear time, which is very slow. Use
- //! binary_search for faster finding. Only works if =operator is implemented.
- //! \param element: Element to search for.
- //! \return Returns position of the searched element if it was found,
- //! otherwise -1 is returned.
- s32 linear_search(T& element)
- {
- for (u32 i=0; i<used; ++i)
- if (!(element < data[i]) && !(data[i] < element))
- return (s32)i;
-
- return -1;
- }
-
-
- //! Finds an element in linear time, which is very slow. Use
- //! binary_search for faster finding. Only works if =operator is implemented.
- //! \param element: Element to search for.
- //! \return Returns position of the searched element if it was found,
- //! otherwise -1 is returned.
- s32 linear_reverse_search(T& element)
- {
- for (s32 i=used-1; i>=0; --i)
- if (data[i] == element)
- return (s32)i;
-
- return -1;
- }
-
-
-
- //! Erases an element from the array. May be slow, because all elements
- //! following after the erased element have to be copied.
- //! \param index: Index of element to be erased.
- void erase(u32 index)
- {
- _IRR_DEBUG_BREAK_IF(index>=used || index<0) // access violation
-
- for (u32 i=index+1; i<used; ++i)
- data[i-1] = data[i];
-
- --used;
- }
-
-
- //! Erases some elements from the array. may be slow, because all elements
- //! following after the erased element have to be copied.
- //! \param index: Index of the first element to be erased.
- //! \param count: Amount of elements to be erased.
- void erase(u32 index, s32 count)
- {
- _IRR_DEBUG_BREAK_IF(index>=used || index<0 || count<1 || index+count>used) // access violation
-
- for (u32 i=index+count; i<used; ++i)
- data[i-count] = data[i];
-
- used-= count;
- }
-
-
- //! Sets if the array is sorted
- void set_sorted(bool _is_sorted)
- {
- is_sorted = _is_sorted;
- }
-
-
- private:
-
- T* data;
- u32 allocated;
- u32 used;
- bool free_when_destroyed;
- bool is_sorted;
-};
-
-
-} // end namespace core
-} // end namespace irr
-
-
-
-#endif
-
diff --git a/3rdparty/assimp/contrib/irrXML/irrString.h b/3rdparty/assimp/contrib/irrXML/irrString.h
deleted file mode 100644
index af07cbe4..00000000
--- a/3rdparty/assimp/contrib/irrXML/irrString.h
+++ /dev/null
@@ -1,664 +0,0 @@
-// Copyright (C) 2002-2005 Nikolaus Gebhardt
-// This file is part of the "Irrlicht Engine" and the "irrXML" project.
-// For conditions of distribution and use, see copyright notice in irrlicht.h and irrXML.h
-
-#ifndef __IRR_STRING_H_INCLUDED__
-#define __IRR_STRING_H_INCLUDED__
-
-#include "irrTypes.h"
-
-namespace irr
-{
-namespace core
-{
-
-//! Very simple string class with some useful features.
-/** string<c8> and string<wchar_t> work both with unicode AND ascii,
-so you can assign unicode to string<c8> and ascii to string<wchar_t>
-(and the other way round) if your ever would want to.
-Note that the conversation between both is not done using an encoding.
-
-Known bugs:
-Special characters like 'Ä', 'Ü' and 'Ö' are ignored in the
-methods make_upper, make_lower and equals_ignore_case.
-*/
-template <class T>
-class string
-{
-public:
-
- //! Default constructor
- string()
- : array(0), allocated(1), used(1)
- {
- array = new T[1];
- array[0] = 0x0;
- }
-
-
-
- //! Constructor
- string(const string<T>& other)
- : array(0), allocated(0), used(0)
- {
- *this = other;
- }
-
-
- //! Constructs a string from an int
- string(int number)
- : array(0), allocated(0), used(0)
- {
- // store if negative and make positive
-
- bool negative = false;
- if (number < 0)
- {
- number *= -1;
- negative = true;
- }
-
- // temporary buffer for 16 numbers
-
- c8 tmpbuf[16];
- tmpbuf[15] = 0;
- s32 idx = 15;
-
- // special case '0'
-
- if (!number)
- {
- tmpbuf[14] = '0';
- *this = &tmpbuf[14];
- return;
- }
-
- // add numbers
-
- while(number && idx)
- {
- idx--;
- tmpbuf[idx] = (c8)('0' + (number % 10));
- number = number / 10;
- }
-
- // add sign
-
- if (negative)
- {
- idx--;
- tmpbuf[idx] = '-';
- }
-
- *this = &tmpbuf[idx];
- }
-
-
-
- //! Constructor for copying a string from a pointer with a given lenght
- template <class B>
- string(const B* c, s32 lenght)
- : array(0), allocated(0), used(0)
- {
- if (!c)
- return;
-
- allocated = used = lenght+1;
- array = new T[used];
-
- for (s32 l = 0; l<lenght; ++l)
- array[l] = (T)c[l];
-
- array[lenght] = 0;
- }
-
-
-
- //! Constructor for unicode and ascii strings
- template <class B>
- string(const B* c)
- : array(0),allocated(0), used(0)
- {
- *this = c;
- }
-
-
-
- //! destructor
- ~string()
- {
- delete [] array;
- }
-
-
-
- //! Assignment operator
- string<T>& operator=(const string<T>& other)
- {
- if (this == &other)
- return *this;
-
- delete [] array;
- allocated = used = other.size()+1;
- array = new T[used];
-
- const T* p = other.c_str();
- for (s32 i=0; i<used; ++i, ++p)
- array[i] = *p;
-
- return *this;
- }
-
-
-
- //! Assignment operator for strings, ascii and unicode
- template <class B>
- string<T>& operator=(const B* c)
- {
- if (!c)
- {
- if (!array)
- {
- array = new T[1];
- allocated = 1;
- used = 1;
- }
- array[0] = 0x0;
- return *this;
- }
-
- if ((void*)c == (void*)array)
- return *this;
-
- s32 len = 0;
- const B* p = c;
- while(*p)
- {
- ++len;
- ++p;
- }
-
- // we'll take the old string for a while, because the new string could be
- // a part of the current string.
- T* oldArray = array;
-
- allocated = used = len+1;
- array = new T[used];
-
- for (s32 l = 0; l<len+1; ++l)
- array[l] = (T)c[l];
-
- delete [] oldArray;
- return *this;
- }
-
- //! Add operator for other strings
- string<T> operator+(const string<T>& other)
- {
- string<T> str(*this);
- str.append(other);
-
- return str;
- }
-
- //! Add operator for strings, ascii and unicode
- template <class B>
- string<T> operator+(const B* c)
- {
- string<T> str(*this);
- str.append(c);
-
- return str;
- }
-
-
-
- //! Direct access operator
- T& operator [](const s32 index) const
- {
- _IRR_DEBUG_BREAK_IF(index>=used) // bad index
-
- return array[index];
- }
-
-
- //! Comparison operator
- bool operator ==(const T* str) const
- {
- int i;
- for(i=0; array[i] && str[i]; ++i)
- if (array[i] != str[i])
- return false;
-
- return !array[i] && !str[i];
- }
-
-
-
- //! Comparison operator
- bool operator ==(const string<T>& other) const
- {
- for(s32 i=0; array[i] && other.array[i]; ++i)
- if (array[i] != other.array[i])
- return false;
-
- return used == other.used;
- }
-
-
-
- //! Is smaller operator
- bool operator <(const string<T>& other) const
- {
- for(s32 i=0; array[i] && other.array[i]; ++i)
- if (array[i] != other.array[i])
- return (array[i] < other.array[i]);
-
- return used < other.used;
- }
-
-
-
- //! Equals not operator
- bool operator !=(const string<T>& other) const
- {
- return !(*this == other);
- }
-
-
-
- //! Returns length of string
- /** \return Returns length of the string in characters. */
- s32 size() const
- {
- return used-1;
- }
-
-
-
- //! Returns character string
- /** \return Returns pointer to C-style zero terminated string. */
- const T* c_str() const
- {
- return array;
- }
-
-
-
- //! Makes the string lower case.
- void make_lower()
- {
- const T A = (T)'A';
- const T Z = (T)'Z';
- const T diff = (T)'a' - A;
-
- for (s32 i=0; i<used; ++i)
- {
- if (array[i]>=A && array[i]<=Z)
- array[i] += diff;
- }
- }
-
-
-
- //! Makes the string upper case.
- void make_upper()
- {
- const T a = (T)'a';
- const T z = (T)'z';
- const T diff = (T)'A' - a;
-
- for (s32 i=0; i<used; ++i)
- {
- if (array[i]>=a && array[i]<=z)
- array[i] += diff;
- }
- }
-
-
-
- //! Compares the string ignoring case.
- /** \param other: Other string to compare.
- \return Returns true if the string are equal ignoring case. */
- bool equals_ignore_case(const string<T>& other) const
- {
- for(s32 i=0; array[i] && other[i]; ++i)
- if (toLower(array[i]) != toLower(other[i]))
- return false;
-
- return used == other.used;
- }
-
-
- //! compares the first n characters of the strings
- bool equalsn(const string<T>& other, int len)
- {
- int i;
- for(i=0; array[i] && other[i] && i < len; ++i)
- if (array[i] != other[i])
- return false;
-
- // if one (or both) of the strings was smaller then they
- // are only equal if they have the same lenght
- return (i == len) || (used == other.used);
- }
-
-
- //! compares the first n characters of the strings
- bool equalsn(const T* str, int len)
- {
- int i;
- for(i=0; array[i] && str[i] && i < len; ++i)
- if (array[i] != str[i])
- return false;
-
- // if one (or both) of the strings was smaller then they
- // are only equal if they have the same lenght
- return (i == len) || (array[i] == 0 && str[i] == 0);
- }
-
-
- //! Appends a character to this string
- /** \param character: Character to append. */
- void append(T character)
- {
- if (used + 1 > allocated)
- reallocate((s32)used + 1);
-
- used += 1;
-
- array[used-2] = character;
- array[used-1] = 0;
- }
-
- //! Appends a string to this string
- /** \param other: String to append. */
- void append(const string<T>& other)
- {
- --used;
-
- s32 len = other.size();
-
- if (used + len + 1 > allocated)
- reallocate((s32)used + (s32)len + 1);
-
- for (s32 l=0; l<len+1; ++l)
- array[l+used] = other[l];
-
- used = used + len + 1;
- }
-
-
- //! Appends a string of the length l to this string.
- /** \param other: other String to append to this string.
- \param length: How much characters of the other string to add to this one. */
- void append(const string<T>& other, s32 length)
- {
- s32 len = other.size();
-
- if (len < length)
- {
- append(other);
- return;
- }
-
- len = length;
- --used;
-
- if (used + len > allocated)
- reallocate((s32)used + (s32)len);
-
- for (s32 l=0; l<len; ++l)
- array[l+used] = other[l];
-
- used = used + len;
- }
-
-
- //! Reserves some memory.
- /** \param count: Amount of characters to reserve. */
- void reserve(s32 count)
- {
- if (count < allocated)
- return;
-
- reallocate(count);
- }
-
-
- //! finds first occurrence of character in string
- /** \param c: Character to search for.
- \return Returns position where the character has been found,
- or -1 if not found. */
- s32 findFirst(T c) const
- {
- for (s32 i=0; i<used; ++i)
- if (array[i] == c)
- return i;
-
- return -1;
- }
-
- //! finds first occurrence of a character of a list in string
- /** \param c: List of strings to find. For example if the method
- should find the first occurance of 'a' or 'b', this parameter should be "ab".
- \param count: Amount of characters in the list. Ususally,
- this should be strlen(ofParameter1)
- \return Returns position where one of the character has been found,
- or -1 if not found. */
- s32 findFirstChar(T* c, int count) const
- {
- for (s32 i=0; i<used; ++i)
- for (int j=0; j<count; ++j)
- if (array[i] == c[j])
- return i;
-
- return -1;
- }
-
-
- //! Finds first position of a character not in a given list.
- /** \param c: List of characters not to find. For example if the method
- should find the first occurance of a character not 'a' or 'b', this parameter should be "ab".
- \param count: Amount of characters in the list. Ususally,
- this should be strlen(ofParameter1)
- \return Returns position where the character has been found,
- or -1 if not found. */
- template <class B>
- s32 findFirstCharNotInList(B* c, int count) const
- {
- for (int i=0; i<used; ++i)
- {
- int j;
- for (j=0; j<count; ++j)
- if (array[i] == c[j])
- break;
-
- if (j==count)
- return i;
- }
-
- return -1;
- }
-
- //! Finds last position of a character not in a given list.
- /** \param c: List of characters not to find. For example if the method
- should find the first occurance of a character not 'a' or 'b', this parameter should be "ab".
- \param count: Amount of characters in the list. Ususally,
- this should be strlen(ofParameter1)
- \return Returns position where the character has been found,
- or -1 if not found. */
- template <class B>
- s32 findLastCharNotInList(B* c, int count) const
- {
- for (int i=used-2; i>=0; --i)
- {
- int j;
- for (j=0; j<count; ++j)
- if (array[i] == c[j])
- break;
-
- if (j==count)
- return i;
- }
-
- return -1;
- }
-
- //! finds next occurrence of character in string
- /** \param c: Character to search for.
- \param startPos: Position in string to start searching.
- \return Returns position where the character has been found,
- or -1 if not found. */
- s32 findNext(T c, s32 startPos) const
- {
- for (s32 i=startPos; i<used; ++i)
- if (array[i] == c)
- return i;
-
- return -1;
- }
-
-
- //! finds last occurrence of character in string
- //! \param c: Character to search for.
- //! \return Returns position where the character has been found,
- //! or -1 if not found.
- s32 findLast(T c) const
- {
- for (s32 i=used-1; i>=0; --i)
- if (array[i] == c)
- return i;
-
- return -1;
- }
-
-
- //! Returns a substring
- //! \param begin: Start of substring.
- //! \param length: Length of substring.
- string<T> subString(s32 begin, s32 length)
- {
- if (length <= 0)
- return string<T>("");
-
- string<T> o;
- o.reserve(length+1);
-
- for (s32 i=0; i<length; ++i)
- o.array[i] = array[i+begin];
-
- o.array[length] = 0;
- o.used = o.allocated;
-
- return o;
- }
-
-
- void operator += (T c)
- {
- append(c);
- }
-
- void operator += (const string<T>& other)
- {
- append(other);
- }
-
- void operator += (int i)
- {
- append(string<T>(i));
- }
-
- //! replaces all characters of a special type with another one
- void replace(T toReplace, T replaceWith)
- {
- for (s32 i=0; i<used; ++i)
- if (array[i] == toReplace)
- array[i] = replaceWith;
- }
-
- //! trims the string.
- /** Removes whitespace from begin and end of the string. */
- void trim()
- {
- const char whitespace[] = " \t\n";
- const int whitespacecount = 3;
-
- // find start and end of real string without whitespace
- int begin = findFirstCharNotInList(whitespace, whitespacecount);
- if (begin == -1)
- return;
-
- int end = findLastCharNotInList(whitespace, whitespacecount);
- if (end == -1)
- return;
-
- *this = subString(begin, (end +1) - begin);
- }
-
-
- //! Erases a character from the string. May be slow, because all elements
- //! following after the erased element have to be copied.
- //! \param index: Index of element to be erased.
- void erase(int index)
- {
- _IRR_DEBUG_BREAK_IF(index>=used || index<0) // access violation
-
- for (int i=index+1; i<used; ++i)
- array[i-1] = array[i];
-
- --used;
- }
-
-
-
-private:
-
- //! Returns a character converted to lower case
- T toLower(const T& t) const
- {
- if (t>=(T)'A' && t<=(T)'Z')
- return t + ((T)'a' - (T)'A');
- else
- return t;
- }
-
- //! Reallocate the array, make it bigger or smaler
- void reallocate(s32 new_size)
- {
- T* old_array = array;
-
- array = new T[new_size];
- allocated = new_size;
-
- s32 amount = used < new_size ? used : new_size;
- for (s32 i=0; i<amount; ++i)
- array[i] = old_array[i];
-
- if (allocated < used)
- used = allocated;
-
- delete [] old_array;
- }
-
-
- //--- member variables
-
- T* array;
- s32 allocated;
- s32 used;
-};
-
-
-//! Typedef for character strings
-typedef string<irr::c8> stringc;
-
-//! Typedef for wide character strings
-typedef string<wchar_t> stringw;
-
-} // end namespace core
-} // end namespace irr
-
-#endif
-
diff --git a/3rdparty/assimp/contrib/irrXML/irrTypes.h b/3rdparty/assimp/contrib/irrXML/irrTypes.h
deleted file mode 100644
index 0911a2d7..00000000
--- a/3rdparty/assimp/contrib/irrXML/irrTypes.h
+++ /dev/null
@@ -1,108 +0,0 @@
-// Copyright (C) 2002-2005 Nikolaus Gebhardt
-// This file is part of the "Irrlicht Engine".
-// For conditions of distribution and use, see copyright notice in irrlicht.h
-
-#ifndef __IRR_TYPES_H_INCLUDED__
-#define __IRR_TYPES_H_INCLUDED__
-
-namespace irr
-{
-
-//! 8 bit unsigned variable.
-/** This is a typedef for unsigned char, it ensures portability of the engine. */
-typedef unsigned char u8;
-
-//! 8 bit signed variable.
-/** This is a typedef for signed char, it ensures portability of the engine. */
-typedef signed char s8;
-
-//! 8 bit character variable.
-/** This is a typedef for char, it ensures portability of the engine. */
-typedef char c8;
-
-
-
-//! 16 bit unsigned variable.
-/** This is a typedef for unsigned short, it ensures portability of the engine. */
-typedef unsigned short u16;
-
-//! 16 bit signed variable.
-/** This is a typedef for signed short, it ensures portability of the engine. */
-typedef signed short s16;
-
-
-
-//! 32 bit unsigned variable.
-/** This is a typedef for unsigned int, it ensures portability of the engine. */
-typedef unsigned int u32;
-
-//! 32 bit signed variable.
-/** This is a typedef for signed int, it ensures portability of the engine. */
-typedef signed int s32;
-
-
-
-// 64 bit signed variable.
-// This is a typedef for __int64, it ensures portability of the engine.
-// This type is currently not used by the engine and not supported by compilers
-// other than Microsoft Compilers, so it is outcommented.
-//typedef __int64 s64;
-
-
-
-//! 32 bit floating point variable.
-/** This is a typedef for float, it ensures portability of the engine. */
-typedef float f32;
-
-//! 64 bit floating point variable.
-/** This is a typedef for double, it ensures portability of the engine. */
-typedef double f64;
-
-
-} // end namespace
-
-
-// define the wchar_t type if not already built in.
-#ifdef _MSC_VER
-#ifndef _WCHAR_T_DEFINED
-//! A 16 bit wide character type.
-/**
- Defines the wchar_t-type.
- In VS6, its not possible to tell
- the standard compiler to treat wchar_t as a built-in type, and
- sometimes we just don't want to include the huge stdlib.h or wchar.h,
- so we'll use this.
-*/
-typedef unsigned short wchar_t;
-#define _WCHAR_T_DEFINED
-#endif // wchar is not defined
-#endif // microsoft compiler
-
-//! define a break macro for debugging only in Win32 mode.
-// WORKAROUND (ASSIMP): remove __asm
-#if defined(WIN32) && defined(_MSC_VER) && defined(_DEBUG)
-#if defined(_M_IX86)
-#define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) /*if (_CONDITION_) {_asm int 3}*/
-#else
-#define _IRR_DEBUG_BREAK_IF( _CONDITION_ )
-#endif
-#else
-#define _IRR_DEBUG_BREAK_IF( _CONDITION_ )
-#endif
-
-//! Defines a small statement to work around a microsoft compiler bug.
-/** The microsft compiler 7.0 - 7.1 has a bug:
-When you call unmanaged code that returns a bool type value of false from managed code,
-the return value may appear as true. See
-http://support.microsoft.com/default.aspx?kbid=823071 for details.
-Compiler version defines: VC6.0 : 1200, VC7.0 : 1300, VC7.1 : 1310, VC8.0 : 1400*/
-
-// WORKAROUND (ASSIMP): remove __asm
-#if defined(WIN32) && defined(_MSC_VER) && (_MSC_VER > 1299) && (_MSC_VER < 1400)
-#define _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX /*__asm mov eax,100*/
-#else
-#define _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX
-#endif // _IRR_MANAGED_MARSHALLING_BUGFIX
-
-#endif // __IRR_TYPES_H_INCLUDED__
-
diff --git a/3rdparty/assimp/contrib/irrXML/irrXML.cpp b/3rdparty/assimp/contrib/irrXML/irrXML.cpp
deleted file mode 100644
index 406408f0..00000000
--- a/3rdparty/assimp/contrib/irrXML/irrXML.cpp
+++ /dev/null
@@ -1,152 +0,0 @@
-// Copyright (C) 2002-2005 Nikolaus Gebhardt
-// This file is part of the "Irrlicht Engine" and the "irrXML" project.
-// For conditions of distribution and use, see copyright notice in irrlicht.h and/or irrXML.h
-
-// Need to include Assimp, too. We're using Assimp's version of fast_atof
-// so we need stdint.h. But no PCH.
-
-#include "./../../code/AssimpPCH.h"
-
-#include "irrXML.h"
-#include "irrString.h"
-#include "irrArray.h"
-#include "./../../code/fast_atof.h"
-#include "CXMLReaderImpl.h"
-
-namespace irr
-{
-namespace io
-{
-
-//! Implementation of the file read callback for ordinary files
-class CFileReadCallBack : public IFileReadCallBack
-{
-public:
-
- //! construct from filename
- CFileReadCallBack(const char* filename)
- : File(0), Size(0), Close(true)
- {
- // open file
- File = fopen(filename, "rb");
-
- if (File)
- getFileSize();
- }
-
- //! construct from FILE pointer
- CFileReadCallBack(FILE* file)
- : File(file), Size(0), Close(false)
- {
- if (File)
- getFileSize();
- }
-
- //! destructor
- virtual ~CFileReadCallBack()
- {
- if (Close && File)
- fclose(File);
- }
-
- //! Reads an amount of bytes from the file.
- virtual int read(void* buffer, int sizeToRead)
- {
- if (!File)
- return 0;
-
- return (int)fread(buffer, 1, sizeToRead, File);
- }
-
- //! Returns size of file in bytes
- virtual int getSize()
- {
- return Size;
- }
-
-private:
-
- //! retrieves the file size of the open file
- void getFileSize()
- {
- fseek(File, 0, SEEK_END);
- Size = ftell(File);
- fseek(File, 0, SEEK_SET);
- }
-
- FILE* File;
- int Size;
- bool Close;
-
-}; // end class CFileReadCallBack
-
-
-
-// FACTORY FUNCTIONS:
-
-
-//! Creates an instance of an UFT-8 or ASCII character xml parser.
-IrrXMLReader* createIrrXMLReader(const char* filename)
-{
- return new CXMLReaderImpl<char, IXMLBase>(new CFileReadCallBack(filename));
-}
-
-
-//! Creates an instance of an UFT-8 or ASCII character xml parser.
-IrrXMLReader* createIrrXMLReader(FILE* file)
-{
- return new CXMLReaderImpl<char, IXMLBase>(new CFileReadCallBack(file));
-}
-
-
-//! Creates an instance of an UFT-8 or ASCII character xml parser.
-IrrXMLReader* createIrrXMLReader(IFileReadCallBack* callback)
-{
- return new CXMLReaderImpl<char, IXMLBase>(callback, false);
-}
-
-
-//! Creates an instance of an UTF-16 xml parser.
-IrrXMLReaderUTF16* createIrrXMLReaderUTF16(const char* filename)
-{
- return new CXMLReaderImpl<char16, IXMLBase>(new CFileReadCallBack(filename));
-}
-
-
-//! Creates an instance of an UTF-16 xml parser.
-IrrXMLReaderUTF16* createIrrXMLReaderUTF16(FILE* file)
-{
- return new CXMLReaderImpl<char16, IXMLBase>(new CFileReadCallBack(file));
-}
-
-
-//! Creates an instance of an UTF-16 xml parser.
-IrrXMLReaderUTF16* createIrrXMLReaderUTF16(IFileReadCallBack* callback)
-{
- return new CXMLReaderImpl<char16, IXMLBase>(callback, false);
-}
-
-
-//! Creates an instance of an UTF-32 xml parser.
-IrrXMLReaderUTF32* createIrrXMLReaderUTF32(const char* filename)
-{
- return new CXMLReaderImpl<char32, IXMLBase>(new CFileReadCallBack(filename));
-}
-
-
-//! Creates an instance of an UTF-32 xml parser.
-IrrXMLReaderUTF32* createIrrXMLReaderUTF32(FILE* file)
-{
- return new CXMLReaderImpl<char32, IXMLBase>(new CFileReadCallBack(file));
-}
-
-
-//! Creates an instance of an UTF-32 xml parser.
-IrrXMLReaderUTF32* createIrrXMLReaderUTF32(IFileReadCallBack* callback)
-{
- return new CXMLReaderImpl<char32, IXMLBase>(callback, false);
-}
-
-
-} // end namespace io
-} // end namespace irr
diff --git a/3rdparty/assimp/contrib/irrXML/irrXML.h b/3rdparty/assimp/contrib/irrXML/irrXML.h
deleted file mode 100644
index e5fcbe08..00000000
--- a/3rdparty/assimp/contrib/irrXML/irrXML.h
+++ /dev/null
@@ -1,540 +0,0 @@
-// Copyright (C) 2002-2005 Nikolaus Gebhardt
-// This file is part of the "Irrlicht Engine" and the "irrXML" project.
-// For conditions of distribution and use, see copyright notice in irrlicht.h and/or irrXML.h
-
-#ifndef __IRR_XML_H_INCLUDED__
-#define __IRR_XML_H_INCLUDED__
-
-#include <stdio.h>
-
-/** \mainpage irrXML 1.2 API documentation
- <div align="center"><img src="logobig.png" ></div>
-
- \section intro Introduction
-
- Welcome to the irrXML API documentation.
- Here you'll find any information you'll need to develop applications with
- irrXML. If you look for a tutorial on how to start, take a look at the \ref irrxmlexample,
- at the homepage of irrXML at <A HREF="http://xml.irrlicht3d.org" >xml.irrlicht3d.org</A>
- or into the SDK in the directory \example.
-
- irrXML is intended to be a high speed and easy-to-use XML Parser for C++, and
- this documentation is an important part of it. If you have any questions or
- suggestions, just send a email to the author of the engine, Nikolaus Gebhardt
- (niko (at) irrlicht3d.org). For more informations about this parser, see \ref history.
-
- \section features Features
-
- irrXML provides forward-only, read-only
- access to a stream of non validated XML data. It was fully implemented by
- Nikolaus Gebhardt. Its current features are:
-
- - It it fast as lighting and has very low memory usage. It was
- developed with the intention of being used in 3D games, as it already has been.
- - irrXML is very small: It only consists of 60 KB of code and can be added easily
- to your existing project.
- - Of course, it is platform independent and works with lots of compilers.
- - It is able to parse ASCII, UTF-8, UTF-16 and UTF-32 text files, both in
- little and big endian format.
- - Independent of the input file format, the parser can return all strings in ASCII, UTF-8,
- UTF-16 and UTF-32 format.
- - With its optional file access abstraction it has the advantage that it can read not
- only from files but from any type of data (memory, network, ...). For example when
- used with the Irrlicht Engine, it directly reads from compressed .zip files.
- - Just like the Irrlicht Engine for which it was originally created, it is extremely easy
- to use.
- - It has no external dependencies, it does not even need the STL.
-
- Although irrXML has some strenghts, it currently also has the following limitations:
-
- - The input xml file is not validated and assumed to be correct.
-
- \section irrxmlexample Example
-
- The following code demonstrates the basic usage of irrXML. A simple xml
- file like this is parsed:
- \code
- <?xml version="1.0"?>
- <config>
- <!-- This is a config file for the mesh viewer -->
- <model file="dwarf.dea" />
- <messageText caption="Irrlicht Engine Mesh Viewer">
- Welcome to the Mesh Viewer of the &quot;Irrlicht Engine&quot;.
- </messageText>
- </config>
- \endcode
-
- The code for parsing this file would look like this:
- \code
- #include <irrXML.h>
- using namespace irr; // irrXML is located in the namespace irr::io
- using namespace io;
-
- #include <string> // we use STL strings to store data in this example
-
- void main()
- {
- // create the reader using one of the factory functions
-
- IrrXMLReader* xml = createIrrXMLReader("config.xml");
-
- // strings for storing the data we want to get out of the file
- std::string modelFile;
- std::string messageText;
- std::string caption;
-
- // parse the file until end reached
-
- while (xml && xml->read())
- {
- switch(xml->getNodeType())
- {
- case EXN_TEXT:
- // in this xml file, the only text which occurs is the messageText
- messageText = xml->getNodeData();
- break;
- case EXN_ELEMENT:
- {
- if (!strcmp("model", xml->getNodeName()))
- modelFile = xml->getAttributeValue("file");
- else
- if (!strcmp("messageText", xml->getNodeName()))
- caption = xml->getAttributeValue("caption");
- }
- break;
- }
- }
-
- // delete the xml parser after usage
- delete xml;
- }
- \endcode
-
- \section howto How to use
-
- Simply add the source files in the /src directory of irrXML to your project. Done.
-
- \section license License
-
- The irrXML license is based on the zlib license. Basicly, this means you can do with
- irrXML whatever you want:
-
- Copyright (C) 2002-2005 Nikolaus Gebhardt
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
-
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
-
- 3. This notice may not be removed or altered from any source distribution.
-
- \section history History
-
- As lots of references in this documentation and the source show, this xml
- parser has originally been a part of the
- <A HREF="http://irrlicht.sourceforge.net" >Irrlicht Engine</A>. But because
- the parser has become very useful with the latest release, people asked for a
- separate version of it, to be able to use it in non Irrlicht projects. With
- irrXML 1.0, this has now been done.
-*/
-
-namespace irr
-{
-namespace io
-{
- //! Enumeration of all supported source text file formats
- enum ETEXT_FORMAT
- {
- //! ASCII, file without byte order mark, or not a text file
- ETF_ASCII,
-
- //! UTF-8 format
- ETF_UTF8,
-
- //! UTF-16 format, big endian
- ETF_UTF16_BE,
-
- //! UTF-16 format, little endian
- ETF_UTF16_LE,
-
- //! UTF-32 format, big endian
- ETF_UTF32_BE,
-
- //! UTF-32 format, little endian
- ETF_UTF32_LE
- };
-
-
- //! Enumeration for all xml nodes which are parsed by IrrXMLReader
- enum EXML_NODE
- {
- //! No xml node. This is usually the node if you did not read anything yet.
- EXN_NONE,
-
- //! A xml element, like <foo>
- EXN_ELEMENT,
-
- //! End of an xml element, like </foo>
- EXN_ELEMENT_END,
-
- //! Text within a xml element: <foo> this is the text. </foo>
- EXN_TEXT,
-
- //! An xml comment like &lt;!-- I am a comment --&gt; or a DTD definition.
- EXN_COMMENT,
-
- //! An xml cdata section like &lt;![CDATA[ this is some CDATA ]]&gt;
- EXN_CDATA,
-
- //! Unknown element.
- EXN_UNKNOWN
- };
-
- //! Callback class for file read abstraction.
- /** With this, it is possible to make the xml parser read in other things
- than just files. The Irrlicht engine is using this for example to
- read xml from compressed .zip files. To make the parser read in
- any other data, derive a class from this interface, implement the
- two methods to read your data and give a pointer to an instance of
- your implementation when calling createIrrXMLReader(),
- createIrrXMLReaderUTF16() or createIrrXMLReaderUTF32() */
- class IFileReadCallBack
- {
- public:
-
- //! virtual destructor
- virtual ~IFileReadCallBack() {};
-
- //! Reads an amount of bytes from the file.
- /** \param buffer: Pointer to buffer where to read bytes will be written to.
- \param sizeToRead: Amount of bytes to read from the file.
- \return Returns how much bytes were read. */
- virtual int read(void* buffer, int sizeToRead) = 0;
-
- //! Returns size of file in bytes
- virtual int getSize() = 0;
- };
-
- //! Empty class to be used as parent class for IrrXMLReader.
- /** If you need another class as base class for the xml reader, you can do this by creating
- the reader using for example new CXMLReaderImpl<char, YourBaseClass>(yourcallback);
- The Irrlicht Engine for example needs IUnknown as base class for every object to
- let it automaticly reference countend, hence it replaces IXMLBase with IUnknown.
- See irrXML.cpp on how this can be done in detail. */
- class IXMLBase
- {
- };
-
- //! Interface providing easy read access to a XML file.
- /** You can create an instance of this reader using one of the factory functions
- createIrrXMLReader(), createIrrXMLReaderUTF16() and createIrrXMLReaderUTF32().
- If using the parser from the Irrlicht Engine, please use IFileSystem::createXMLReader()
- instead.
- For a detailed intro how to use the parser, see \ref irrxmlexample and \ref features.
-
- The typical usage of this parser looks like this:
- \code
- #include <irrXML.h>
- using namespace irr; // irrXML is located in the namespace irr::io
- using namespace io;
-
- void main()
- {
- // create the reader using one of the factory functions
- IrrXMLReader* xml = createIrrXMLReader("config.xml");
-
- if (xml == 0)
- return; // file could not be opened
-
- // parse the file until end reached
- while (xml->read())
- {
- // based on xml->getNodeType(), do something.
- }
-
- // delete the xml parser after usage
- delete xml;
- }
- \endcode
- See \ref irrxmlexample for a more detailed example.
- */
- template<class char_type, class super_class>
- class IIrrXMLReader : public super_class
- {
- public:
-
- //! Destructor
- virtual ~IIrrXMLReader() {};
-
- //! Reads forward to the next xml node.
- /** \return Returns false, if there was no further node. */
- virtual bool read() = 0;
-
- //! Returns the type of the current XML node.
- virtual EXML_NODE getNodeType() const = 0;
-
- //! Returns attribute count of the current XML node.
- /** This is usually
- non null if the current node is EXN_ELEMENT, and the element has attributes.
- \return Returns amount of attributes of this xml node. */
- virtual int getAttributeCount() const = 0;
-
- //! Returns name of an attribute.
- /** \param idx: Zero based index, should be something between 0 and getAttributeCount()-1.
- \return Name of the attribute, 0 if an attribute with this index does not exist. */
- virtual const char_type* getAttributeName(int idx) const = 0;
-
- //! Returns the value of an attribute.
- /** \param idx: Zero based index, should be something between 0 and getAttributeCount()-1.
- \return Value of the attribute, 0 if an attribute with this index does not exist. */
- virtual const char_type* getAttributeValue(int idx) const = 0;
-
- //! Returns the value of an attribute.
- /** \param name: Name of the attribute.
- \return Value of the attribute, 0 if an attribute with this name does not exist. */
- virtual const char_type* getAttributeValue(const char_type* name) const = 0;
-
- //! Returns the value of an attribute in a safe way.
- /** Like getAttributeValue(), but does not
- return 0 if the attribute does not exist. An empty string ("") is returned then.
- \param name: Name of the attribute.
- \return Value of the attribute, and "" if an attribute with this name does not exist */
- virtual const char_type* getAttributeValueSafe(const char_type* name) const = 0;
-
- //! Returns the value of an attribute as integer.
- /** \param name Name of the attribute.
- \return Value of the attribute as integer, and 0 if an attribute with this name does not exist or
- the value could not be interpreted as integer. */
- virtual int getAttributeValueAsInt(const char_type* name) const = 0;
-
- //! Returns the value of an attribute as integer.
- /** \param idx: Zero based index, should be something between 0 and getAttributeCount()-1.
- \return Value of the attribute as integer, and 0 if an attribute with this index does not exist or
- the value could not be interpreted as integer. */
- virtual int getAttributeValueAsInt(int idx) const = 0;
-
- //! Returns the value of an attribute as float.
- /** \param name: Name of the attribute.
- \return Value of the attribute as float, and 0 if an attribute with this name does not exist or
- the value could not be interpreted as float. */
- virtual float getAttributeValueAsFloat(const char_type* name) const = 0;
-
- //! Returns the value of an attribute as float.
- /** \param idx: Zero based index, should be something between 0 and getAttributeCount()-1.
- \return Value of the attribute as float, and 0 if an attribute with this index does not exist or
- the value could not be interpreted as float. */
- virtual float getAttributeValueAsFloat(int idx) const = 0;
-
- //! Returns the name of the current node.
- /** Only non null, if the node type is EXN_ELEMENT.
- \return Name of the current node or 0 if the node has no name. */
- virtual const char_type* getNodeName() const = 0;
-
- //! Returns data of the current node.
- /** Only non null if the node has some
- data and it is of type EXN_TEXT or EXN_UNKNOWN. */
- virtual const char_type* getNodeData() const = 0;
-
- //! Returns if an element is an empty element, like <foo />
- virtual bool isEmptyElement() const = 0;
-
- //! Returns format of the source xml file.
- /** It is not necessary to use
- this method because the parser will convert the input file format
- to the format wanted by the user when creating the parser. This
- method is useful to get/display additional informations. */
- virtual ETEXT_FORMAT getSourceFormat() const = 0;
-
- //! Returns format of the strings returned by the parser.
- /** This will be UTF8 for example when you created a parser with
- IrrXMLReaderUTF8() and UTF32 when it has been created using
- IrrXMLReaderUTF32. It should not be necessary to call this
- method and only exists for informational purposes. */
- virtual ETEXT_FORMAT getParserFormat() const = 0;
- };
-
-
- //! defines the utf-16 type.
- /** Not using wchar_t for this because
- wchar_t has 16 bit on windows and 32 bit on other operating systems. */
- typedef unsigned short char16;
-
- //! defines the utf-32 type.
- /** Not using wchar_t for this because
- wchar_t has 16 bit on windows and 32 bit on other operating systems. */
- typedef unsigned long char32;
-
- //! A UTF-8 or ASCII character xml parser.
- /** This means that all character data will be returned in 8 bit ASCII or UTF-8 by this parser.
- The file to read can be in any format, it will be converted to UTF-8 if it is not
- in this format.
- Create an instance of this with createIrrXMLReader();
- See IIrrXMLReader for description on how to use it. */
- typedef IIrrXMLReader<char, IXMLBase> IrrXMLReader;
-
- //! A UTF-16 xml parser.
- /** This means that all character data will be returned in UTF-16 by this parser.
- The file to read can be in any format, it will be converted to UTF-16 if it is not
- in this format.
- Create an instance of this with createIrrXMLReaderUTF16();
- See IIrrXMLReader for description on how to use it. */
- typedef IIrrXMLReader<char16, IXMLBase> IrrXMLReaderUTF16;
-
- //! A UTF-32 xml parser.
- /** This means that all character data will be returned in UTF-32 by this parser.
- The file to read can be in any format, it will be converted to UTF-32 if it is not
- in this format.
- Create an instance of this with createIrrXMLReaderUTF32();
- See IIrrXMLReader for description on how to use it. */
- typedef IIrrXMLReader<char32, IXMLBase> IrrXMLReaderUTF32;
-
-
- //! Creates an instance of an UFT-8 or ASCII character xml parser.
- /** This means that all character data will be returned in 8 bit ASCII or UTF-8.
- The file to read can be in any format, it will be converted to UTF-8 if it is not in this format.
- If you are using the Irrlicht Engine, it is better not to use this function but
- IFileSystem::createXMLReaderUTF8() instead.
- \param filename: Name of file to be opened.
- \return Returns a pointer to the created xml parser. This pointer should be
- deleted using 'delete' after no longer needed. Returns 0 if an error occured
- and the file could not be opened. */
- IrrXMLReader* createIrrXMLReader(const char* filename);
-
- //! Creates an instance of an UFT-8 or ASCII character xml parser.
- /** This means that all character data will be returned in 8 bit ASCII or UTF-8. The file to read can
- be in any format, it will be converted to UTF-8 if it is not in this format.
- If you are using the Irrlicht Engine, it is better not to use this function but
- IFileSystem::createXMLReaderUTF8() instead.
- \param file: Pointer to opened file, must have been opened in binary mode, e.g.
- using fopen("foo.bar", "wb"); The file will not be closed after it has been read.
- \return Returns a pointer to the created xml parser. This pointer should be
- deleted using 'delete' after no longer needed. Returns 0 if an error occured
- and the file could not be opened. */
- IrrXMLReader* createIrrXMLReader(FILE* file);
-
- //! Creates an instance of an UFT-8 or ASCII character xml parser.
- /** This means that all character data will be returned in 8 bit ASCII or UTF-8. The file to read can
- be in any format, it will be converted to UTF-8 if it is not in this format.
- If you are using the Irrlicht Engine, it is better not to use this function but
- IFileSystem::createXMLReaderUTF8() instead.
- \param callback: Callback for file read abstraction. Implement your own
- callback to make the xml parser read in other things than just files. See
- IFileReadCallBack for more information about this.
- \return Returns a pointer to the created xml parser. This pointer should be
- deleted using 'delete' after no longer needed. Returns 0 if an error occured
- and the file could not be opened. */
- IrrXMLReader* createIrrXMLReader(IFileReadCallBack* callback);
-
- //! Creates an instance of an UFT-16 xml parser.
- /** This means that
- all character data will be returned in UTF-16. The file to read can
- be in any format, it will be converted to UTF-16 if it is not in this format.
- If you are using the Irrlicht Engine, it is better not to use this function but
- IFileSystem::createXMLReader() instead.
- \param filename: Name of file to be opened.
- \return Returns a pointer to the created xml parser. This pointer should be
- deleted using 'delete' after no longer needed. Returns 0 if an error occured
- and the file could not be opened. */
- IrrXMLReaderUTF16* createIrrXMLReaderUTF16(const char* filename);
-
- //! Creates an instance of an UFT-16 xml parser.
- /** This means that all character data will be returned in UTF-16. The file to read can
- be in any format, it will be converted to UTF-16 if it is not in this format.
- If you are using the Irrlicht Engine, it is better not to use this function but
- IFileSystem::createXMLReader() instead.
- \param file: Pointer to opened file, must have been opened in binary mode, e.g.
- using fopen("foo.bar", "wb"); The file will not be closed after it has been read.
- \return Returns a pointer to the created xml parser. This pointer should be
- deleted using 'delete' after no longer needed. Returns 0 if an error occured
- and the file could not be opened. */
- IrrXMLReaderUTF16* createIrrXMLReaderUTF16(FILE* file);
-
- //! Creates an instance of an UFT-16 xml parser.
- /** This means that all character data will be returned in UTF-16. The file to read can
- be in any format, it will be converted to UTF-16 if it is not in this format.
- If you are using the Irrlicht Engine, it is better not to use this function but
- IFileSystem::createXMLReader() instead.
- \param callback: Callback for file read abstraction. Implement your own
- callback to make the xml parser read in other things than just files. See
- IFileReadCallBack for more information about this.
- \return Returns a pointer to the created xml parser. This pointer should be
- deleted using 'delete' after no longer needed. Returns 0 if an error occured
- and the file could not be opened. */
- IrrXMLReaderUTF16* createIrrXMLReaderUTF16(IFileReadCallBack* callback);
-
-
- //! Creates an instance of an UFT-32 xml parser.
- /** This means that all character data will be returned in UTF-32. The file to read can
- be in any format, it will be converted to UTF-32 if it is not in this format.
- If you are using the Irrlicht Engine, it is better not to use this function but
- IFileSystem::createXMLReader() instead.
- \param filename: Name of file to be opened.
- \return Returns a pointer to the created xml parser. This pointer should be
- deleted using 'delete' after no longer needed. Returns 0 if an error occured
- and the file could not be opened. */
- IrrXMLReaderUTF32* createIrrXMLReaderUTF32(const char* filename);
-
- //! Creates an instance of an UFT-32 xml parser.
- /** This means that all character data will be returned in UTF-32. The file to read can
- be in any format, it will be converted to UTF-32 if it is not in this format.
- if you are using the Irrlicht Engine, it is better not to use this function but
- IFileSystem::createXMLReader() instead.
- \param file: Pointer to opened file, must have been opened in binary mode, e.g.
- using fopen("foo.bar", "wb"); The file will not be closed after it has been read.
- \return Returns a pointer to the created xml parser. This pointer should be
- deleted using 'delete' after no longer needed. Returns 0 if an error occured
- and the file could not be opened. */
- IrrXMLReaderUTF32* createIrrXMLReaderUTF32(FILE* file);
-
- //! Creates an instance of an UFT-32 xml parser.
- /** This means that
- all character data will be returned in UTF-32. The file to read can
- be in any format, it will be converted to UTF-32 if it is not in this format.
- If you are using the Irrlicht Engine, it is better not to use this function but
- IFileSystem::createXMLReader() instead.
- \param callback: Callback for file read abstraction. Implement your own
- callback to make the xml parser read in other things than just files. See
- IFileReadCallBack for more information about this.
- \return Returns a pointer to the created xml parser. This pointer should be
- deleted using 'delete' after no longer needed. Returns 0 if an error occured
- and the file could not be opened. */
- IrrXMLReaderUTF32* createIrrXMLReaderUTF32(IFileReadCallBack* callback);
-
-
- /*! \file irrxml.h
- \brief Header file of the irrXML, the Irrlicht XML parser.
-
- This file includes everything needed for using irrXML,
- the XML parser of the Irrlicht Engine. To use irrXML,
- you only need to include this file in your project:
-
- \code
- #include <irrXML.h>
- \endcode
-
- It is also common to use the two namespaces in which irrXML is included,
- directly after #including irrXML.h:
-
- \code
- #include <irrXML.h>
- using namespace irr;
- using namespace io;
- \endcode
- */
-
-} // end namespace io
-} // end namespace irr
-
-#endif // __IRR_XML_H_INCLUDED__
-
diff --git a/3rdparty/assimp/contrib/unzip/crypt.h b/3rdparty/assimp/contrib/unzip/crypt.h
deleted file mode 100644
index 622f4bc2..00000000
--- a/3rdparty/assimp/contrib/unzip/crypt.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/* crypt.h -- base code for crypt/uncrypt ZIPfile
-
-
- Version 1.01e, February 12th, 2005
-
- Copyright (C) 1998-2005 Gilles Vollant
-
- This code is a modified version of crypting code in Infozip distribution
-
- The encryption/decryption parts of this source code (as opposed to the
- non-echoing password parts) were originally written in Europe. The
- whole source package can be freely distributed, including from the USA.
- (Prior to January 2000, re-export from the US was a violation of US law.)
-
- This encryption code is a direct transcription of the algorithm from
- Roger Schlafly, described by Phil Katz in the file appnote.txt. This
- file (appnote.txt) is distributed with the PKZIP program (even in the
- version without encryption capabilities).
-
- If you don't need crypting in your application, just define symbols
- NOCRYPT and NOUNCRYPT.
-
- This code support the "Traditional PKWARE Encryption".
-
- The new AES encryption added on Zip format by Winzip (see the page
- http://www.winzip.com/aes_info.htm ) and PKWare PKZip 5.x Strong
- Encryption is not supported.
-*/
-
-#define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8))
-
-/***********************************************************************
- * Return the next byte in the pseudo-random sequence
- */
-static int decrypt_byte(unsigned long* pkeys, const unsigned long* pcrc_32_tab)
-{
- unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an
- * unpredictable manner on 16-bit systems; not a problem
- * with any known compiler so far, though */
-
- temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2;
- return (int)(((temp * (temp ^ 1)) >> 8) & 0xff);
-}
-
-/***********************************************************************
- * Update the encryption keys with the next byte of plain text
- */
-static int update_keys(unsigned long* pkeys,const unsigned long* pcrc_32_tab,int c)
-{
- (*(pkeys+0)) = CRC32((*(pkeys+0)), c);
- (*(pkeys+1)) += (*(pkeys+0)) & 0xff;
- (*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1;
- {
- register int keyshift = (int)((*(pkeys+1)) >> 24);
- (*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift);
- }
- return c;
-}
-
-
-/***********************************************************************
- * Initialize the encryption keys and the random header according to
- * the given password.
- */
-static void init_keys(const char* passwd,unsigned long* pkeys,const unsigned long* pcrc_32_tab)
-{
- *(pkeys+0) = 305419896L;
- *(pkeys+1) = 591751049L;
- *(pkeys+2) = 878082192L;
- while (*passwd != '\0') {
- update_keys(pkeys,pcrc_32_tab,(int)*passwd);
- passwd++;
- }
-}
-
-#define zdecode(pkeys,pcrc_32_tab,c) \
- (update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab)))
-
-#define zencode(pkeys,pcrc_32_tab,c,t) \
- (t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), t^(c))
-
-#ifdef INCLUDECRYPTINGCODE_IFCRYPTALLOWED
-
-#define RAND_HEAD_LEN 12
- /* "last resort" source for second part of crypt seed pattern */
-# ifndef ZCR_SEED2
-# define ZCR_SEED2 3141592654UL /* use PI as default pattern */
-# endif
-
-static int crypthead(passwd, buf, bufSize, pkeys, pcrc_32_tab, crcForCrypting)
- const char *passwd; /* password string */
- unsigned char *buf; /* where to write header */
- int bufSize;
- unsigned long* pkeys;
- const unsigned long* pcrc_32_tab;
- unsigned long crcForCrypting;
-{
- int n; /* index in random header */
- int t; /* temporary */
- int c; /* random byte */
- unsigned char header[RAND_HEAD_LEN-2]; /* random header */
- static unsigned calls = 0; /* ensure different random header each time */
-
- if (bufSize<RAND_HEAD_LEN)
- return 0;
-
- /* First generate RAND_HEAD_LEN-2 random bytes. We encrypt the
- * output of rand() to get less predictability, since rand() is
- * often poorly implemented.
- */
- if (++calls == 1)
- {
- srand((unsigned)(time(NULL) ^ ZCR_SEED2));
- }
- init_keys(passwd, pkeys, pcrc_32_tab);
- for (n = 0; n < RAND_HEAD_LEN-2; n++)
- {
- c = (rand() >> 7) & 0xff;
- header[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, c, t);
- }
- /* Encrypt random header (last two bytes is high word of crc) */
- init_keys(passwd, pkeys, pcrc_32_tab);
- for (n = 0; n < RAND_HEAD_LEN-2; n++)
- {
- buf[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, header[n], t);
- }
- buf[n++] = zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 16) & 0xff, t);
- buf[n++] = zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 24) & 0xff, t);
- return n;
-}
-
-#endif
diff --git a/3rdparty/assimp/contrib/unzip/ioapi.c b/3rdparty/assimp/contrib/unzip/ioapi.c
deleted file mode 100644
index 8f21bd8f..00000000
--- a/3rdparty/assimp/contrib/unzip/ioapi.c
+++ /dev/null
@@ -1,181 +0,0 @@
-/* ioapi.c -- IO base function header for compress/uncompress .zip
- files using zlib + zip or unzip API
-
- Version 1.01e, February 12th, 2005
-
- Copyright (C) 1998-2005 Gilles Vollant
-*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-# ifdef ASSIMP_BUILD_NO_OWN_ZLIB
-# include <zlib.h>
-# else
-# include "../zlib/zlib.h"
-# endif
-#include "ioapi.h"
-
-
-
-/* I've found an old Unix (a SunOS 4.1.3_U1) without all SEEK_* defined.... */
-
-#ifndef SEEK_CUR
-#define SEEK_CUR 1
-#endif
-
-#ifndef SEEK_END
-#define SEEK_END 2
-#endif
-
-#ifndef SEEK_SET
-#define SEEK_SET 0
-#endif
-
-voidpf ZCALLBACK fopen_file_func (
- voidpf opaque,
- const char* filename,
- int mode);
-
-uLong ZCALLBACK fread_file_func (
- voidpf opaque,
- voidpf stream,
- void* buf,
- uLong size);
-
-uLong ZCALLBACK fwrite_file_func (
- voidpf opaque,
- voidpf stream,
- const void* buf,
- uLong size);
-
-long ZCALLBACK ftell_file_func (
- voidpf opaque,
- voidpf stream);
-
-long ZCALLBACK fseek_file_func (
- voidpf opaque,
- voidpf stream,
- uLong offset,
- int origin);
-
-int ZCALLBACK fclose_file_func (
- voidpf opaque,
- voidpf stream);
-
-int ZCALLBACK ferror_file_func (
- voidpf opaque,
- voidpf stream);
-
-
-voidpf ZCALLBACK fopen_file_func (opaque, filename, mode)
- voidpf opaque;
- const char* filename;
- int mode;
-{
- FILE* file = NULL;
- const char* mode_fopen = NULL;
- if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
- mode_fopen = "rb";
- else
- if (mode & ZLIB_FILEFUNC_MODE_EXISTING)
- mode_fopen = "r+b";
- else
- if (mode & ZLIB_FILEFUNC_MODE_CREATE)
- mode_fopen = "wb";
-
- if ((filename!=NULL) && (mode_fopen != NULL))
- file = fopen(filename, mode_fopen);
- return file;
-}
-
-
-uLong ZCALLBACK fread_file_func (opaque, stream, buf, size)
- voidpf opaque;
- voidpf stream;
- void* buf;
- uLong size;
-{
- uLong ret;
- ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream);
- return ret;
-}
-
-
-uLong ZCALLBACK fwrite_file_func (opaque, stream, buf, size)
- voidpf opaque;
- voidpf stream;
- const void* buf;
- uLong size;
-{
- uLong ret;
- ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream);
- return ret;
-}
-
-long ZCALLBACK ftell_file_func (opaque, stream)
- voidpf opaque;
- voidpf stream;
-{
- long ret;
- ret = ftell((FILE *)stream);
- return ret;
-}
-
-long ZCALLBACK fseek_file_func (opaque, stream, offset, origin)
- voidpf opaque;
- voidpf stream;
- uLong offset;
- int origin;
-{
- int fseek_origin=0;
- long ret;
- switch (origin)
- {
- case ZLIB_FILEFUNC_SEEK_CUR :
- fseek_origin = SEEK_CUR;
- break;
- case ZLIB_FILEFUNC_SEEK_END :
- fseek_origin = SEEK_END;
- break;
- case ZLIB_FILEFUNC_SEEK_SET :
- fseek_origin = SEEK_SET;
- break;
- default: return -1;
- }
- ret = 0;
- fseek((FILE *)stream, offset, fseek_origin);
- return ret;
-}
-
-int ZCALLBACK fclose_file_func (opaque, stream)
- voidpf opaque;
- voidpf stream;
-{
- int ret;
- ret = fclose((FILE *)stream);
- return ret;
-}
-
-int ZCALLBACK ferror_file_func (opaque, stream)
- voidpf opaque;
- voidpf stream;
-{
- int ret;
- ret = ferror((FILE *)stream);
- return ret;
-}
-
-void fill_fopen_filefunc (pzlib_filefunc_def)
- zlib_filefunc_def* pzlib_filefunc_def;
-{
- pzlib_filefunc_def->zopen_file = fopen_file_func;
- pzlib_filefunc_def->zread_file = fread_file_func;
- pzlib_filefunc_def->zwrite_file = fwrite_file_func;
- pzlib_filefunc_def->ztell_file = ftell_file_func;
- pzlib_filefunc_def->zseek_file = fseek_file_func;
- pzlib_filefunc_def->zclose_file = fclose_file_func;
- pzlib_filefunc_def->zerror_file = ferror_file_func;
- pzlib_filefunc_def->opaque = NULL;
-}
diff --git a/3rdparty/assimp/contrib/unzip/ioapi.h b/3rdparty/assimp/contrib/unzip/ioapi.h
deleted file mode 100644
index 06fdd15e..00000000
--- a/3rdparty/assimp/contrib/unzip/ioapi.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/* ioapi.h -- IO base function header for compress/uncompress .zip
- files using zlib + zip or unzip API
-
- Version 1.01e, February 12th, 2005
-
- Copyright (C) 1998-2005 Gilles Vollant
-*/
-
-#ifndef _ZLIBIOAPI_H
-#define _ZLIBIOAPI_H
-
-
-#define ZLIB_FILEFUNC_SEEK_CUR (1)
-#define ZLIB_FILEFUNC_SEEK_END (2)
-#define ZLIB_FILEFUNC_SEEK_SET (0)
-
-#define ZLIB_FILEFUNC_MODE_READ (1)
-#define ZLIB_FILEFUNC_MODE_WRITE (2)
-#define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3)
-
-#define ZLIB_FILEFUNC_MODE_EXISTING (4)
-#define ZLIB_FILEFUNC_MODE_CREATE (8)
-
-
-#ifndef ZCALLBACK
-
-#if (defined(WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK)
-#define ZCALLBACK CALLBACK
-#else
-#define ZCALLBACK
-#endif
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef voidpf (ZCALLBACK *open_file_func) (voidpf opaque, const char* filename, int mode);
-typedef uLong (ZCALLBACK *read_file_func) (voidpf opaque, voidpf stream, void* buf, uLong size);
-typedef uLong (ZCALLBACK *write_file_func)(voidpf opaque, voidpf stream, const void* buf, uLong size);
-typedef long (ZCALLBACK *tell_file_func) (voidpf opaque, voidpf stream);
-typedef long (ZCALLBACK *seek_file_func) (voidpf opaque, voidpf stream, uLong offset, int origin);
-typedef int (ZCALLBACK *close_file_func) (voidpf opaque, voidpf stream);
-typedef int (ZCALLBACK *testerror_file_func) (voidpf opaque, voidpf stream);
-
-typedef struct zlib_filefunc_def_s
-{
- open_file_func zopen_file;
- read_file_func zread_file;
- write_file_func zwrite_file;
- tell_file_func ztell_file;
- seek_file_func zseek_file;
- close_file_func zclose_file;
- testerror_file_func zerror_file;
- voidpf opaque;
-} zlib_filefunc_def;
-
-
-
-void fill_fopen_filefunc (zlib_filefunc_def* pzlib_filefunc_def);
-
-#define ZREAD(filefunc,filestream,buf,size) ((*((filefunc).zread_file))((filefunc).opaque,filestream,buf,size))
-#define ZWRITE(filefunc,filestream,buf,size) ((*((filefunc).zwrite_file))((filefunc).opaque,filestream,buf,size))
-#define ZTELL(filefunc,filestream) ((*((filefunc).ztell_file))((filefunc).opaque,filestream))
-#define ZSEEK(filefunc,filestream,pos,mode) ((*((filefunc).zseek_file))((filefunc).opaque,filestream,pos,mode))
-#define ZCLOSE(filefunc,filestream) ((*((filefunc).zclose_file))((filefunc).opaque,filestream))
-#define ZERROR(filefunc,filestream) ((*((filefunc).zerror_file))((filefunc).opaque,filestream))
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
diff --git a/3rdparty/assimp/contrib/unzip/unzip.c b/3rdparty/assimp/contrib/unzip/unzip.c
deleted file mode 100644
index b6c04836..00000000
--- a/3rdparty/assimp/contrib/unzip/unzip.c
+++ /dev/null
@@ -1,1604 +0,0 @@
-/* unzip.c -- IO for uncompress .zip files using zlib
- Version 1.01e, February 12th, 2005
-
- Copyright (C) 1998-2005 Gilles Vollant
-
- Read unzip.h for more info
-*/
-
-/* Decryption code comes from crypt.c by Info-ZIP but has been greatly reduced in terms of
-compatibility with older software. The following is from the original crypt.c. Code
-woven in by Terry Thorsen 1/2003.
-*/
-/*
- Copyright (c) 1990-2000 Info-ZIP. All rights reserved.
-
- See the accompanying file LICENSE, version 2000-Apr-09 or later
- (the contents of which are also included in zip.h) for terms of use.
- If, for some reason, all these files are missing, the Info-ZIP license
- also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html
-*/
-/*
- crypt.c (full version) by Info-ZIP. Last revised: [see crypt.h]
-
- The encryption/decryption parts of this source code (as opposed to the
- non-echoing password parts) were originally written in Europe. The
- whole source package can be freely distributed, including from the USA.
- (Prior to January 2000, re-export from the US was a violation of US law.)
- */
-
-/*
- This encryption code is a direct transcription of the algorithm from
- Roger Schlafly, described by Phil Katz in the file appnote.txt. This
- file (appnote.txt) is distributed with the PKZIP program (even in the
- version without encryption capabilities).
- */
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "./unzip.h"
-
-#ifdef STDC
-# include <stddef.h>
-# include <string.h>
-# include <stdlib.h>
-#endif
-#ifdef NO_ERRNO_H
- extern int errno;
-#else
-# include <errno.h>
-#endif
-
-
-#ifndef local
-# define local static
-#endif
-/* compile with -Dlocal if your debugger can't find static symbols */
-
-
-#ifndef CASESENSITIVITYDEFAULT_NO
-# if !defined(unix) && !defined(CASESENSITIVITYDEFAULT_YES)
-# define CASESENSITIVITYDEFAULT_NO
-# endif
-#endif
-
-
-#ifndef UNZ_BUFSIZE
-#define UNZ_BUFSIZE (16384)
-#endif
-
-#ifndef UNZ_MAXFILENAMEINZIP
-#define UNZ_MAXFILENAMEINZIP (256)
-#endif
-
-#ifndef ALLOC
-# define ALLOC(size) (malloc(size))
-#endif
-#ifndef TRYFREE
-# define TRYFREE(p) {if (p) free(p);}
-#endif
-
-#define SIZECENTRALDIRITEM (0x2e)
-#define SIZEZIPLOCALHEADER (0x1e)
-
-
-
-
-const char unz_copyright[] =
- " unzip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll";
-
-/* unz_file_info_interntal contain internal info about a file in zipfile*/
-typedef struct unz_file_info_internal_s
-{
- uLong offset_curfile;/* relative offset of local header 4 bytes */
-} unz_file_info_internal;
-
-
-/* file_in_zip_read_info_s contain internal information about a file in zipfile,
- when reading and decompress it */
-typedef struct
-{
- char *read_buffer; /* internal buffer for compressed data */
- z_stream stream; /* zLib stream structure for inflate */
-
- uLong pos_in_zipfile; /* position in byte on the zipfile, for fseek*/
- uLong stream_initialised; /* flag set if stream structure is initialised*/
-
- uLong offset_local_extrafield;/* offset of the local extra field */
- uInt size_local_extrafield;/* size of the local extra field */
- uLong pos_local_extrafield; /* position in the local extra field in read*/
-
- uLong crc32; /* crc32 of all data uncompressed */
- uLong crc32_wait; /* crc32 we must obtain after decompress all */
- uLong rest_read_compressed; /* number of byte to be decompressed */
- uLong rest_read_uncompressed;/*number of byte to be obtained after decomp*/
- zlib_filefunc_def z_filefunc;
- voidpf filestream; /* io structore of the zipfile */
- uLong compression_method; /* compression method (0==store) */
- uLong byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/
- int raw;
-} file_in_zip_read_info_s;
-
-
-/* unz_s contain internal information about the zipfile
-*/
-typedef struct
-{
- zlib_filefunc_def z_filefunc;
- voidpf filestream; /* io structore of the zipfile */
- unz_global_info gi; /* public global information */
- uLong byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/
- uLong num_file; /* number of the current file in the zipfile*/
- uLong pos_in_central_dir; /* pos of the current file in the central dir*/
- uLong current_file_ok; /* flag about the usability of the current file*/
- uLong central_pos; /* position of the beginning of the central dir*/
-
- uLong size_central_dir; /* size of the central directory */
- uLong offset_central_dir; /* offset of start of central directory with
- respect to the starting disk number */
-
- unz_file_info cur_file_info; /* public info about the current file in zip*/
- unz_file_info_internal cur_file_info_internal; /* private info about it*/
- file_in_zip_read_info_s* pfile_in_zip_read; /* structure about the current
- file if we are decompressing it */
- int encrypted;
-# ifndef NOUNCRYPT
- unsigned long keys[3]; /* keys defining the pseudo-random sequence */
- const unsigned long* pcrc_32_tab;
-# endif
-} unz_s;
-
-
-#ifndef NOUNCRYPT
-#include "crypt.h"
-#endif
-
-/* ===========================================================================
- Read a byte from a gz_stream; update next_in and avail_in. Return EOF
- for end of file.
- IN assertion: the stream s has been sucessfully opened for reading.
-*/
-
-
-local int unzlocal_getByte (
- const zlib_filefunc_def* pzlib_filefunc_def,
- voidpf filestream,
- int *pi);
-
-local int unzlocal_getByte(pzlib_filefunc_def,filestream,pi)
- const zlib_filefunc_def* pzlib_filefunc_def;
- voidpf filestream;
- int *pi;
-{
- unsigned char c;
- int err = (int)ZREAD(*pzlib_filefunc_def,filestream,&c,1);
- if (err==1)
- {
- *pi = (int)c;
- return UNZ_OK;
- }
- else
- {
- if (ZERROR(*pzlib_filefunc_def,filestream))
- return UNZ_ERRNO;
- else
- return UNZ_EOF;
- }
-}
-
-
-/* ===========================================================================
- Reads a long in LSB order from the given gz_stream. Sets
-*/
-local int unzlocal_getShort (
- const zlib_filefunc_def* pzlib_filefunc_def,
- voidpf filestream,
- uLong *pX);
-
-local int unzlocal_getShort (pzlib_filefunc_def,filestream,pX)
- const zlib_filefunc_def* pzlib_filefunc_def;
- voidpf filestream;
- uLong *pX;
-{
- uLong x ;
- int i;
- int err;
-
- err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i);
- x = (uLong)i;
-
- if (err==UNZ_OK)
- err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i);
- x += ((uLong)i)<<8;
-
- if (err==UNZ_OK)
- *pX = x;
- else
- *pX = 0;
- return err;
-}
-
-local int unzlocal_getLong (
- const zlib_filefunc_def* pzlib_filefunc_def,
- voidpf filestream,
- uLong *pX);
-
-local int unzlocal_getLong (pzlib_filefunc_def,filestream,pX)
- const zlib_filefunc_def* pzlib_filefunc_def;
- voidpf filestream;
- uLong *pX;
-{
- uLong x ;
- int i;
- int err;
-
- err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i);
- x = (uLong)i;
-
- if (err==UNZ_OK)
- err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i);
- x += ((uLong)i)<<8;
-
- if (err==UNZ_OK)
- err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i);
- x += ((uLong)i)<<16;
-
- if (err==UNZ_OK)
- err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i);
- x += ((uLong)i)<<24;
-
- if (err==UNZ_OK)
- *pX = x;
- else
- *pX = 0;
- return err;
-}
-
-
-/* My own strcmpi / strcasecmp */
-local int strcmpcasenosensitive_internal (fileName1,fileName2)
- const char* fileName1;
- const char* fileName2;
-{
- for (;;)
- {
- char c1=*(fileName1++);
- char c2=*(fileName2++);
- if ((c1>='a') && (c1<='z'))
- c1 -= 0x20;
- if ((c2>='a') && (c2<='z'))
- c2 -= 0x20;
- if (c1=='\0')
- return ((c2=='\0') ? 0 : -1);
- if (c2=='\0')
- return 1;
- if (c1<c2)
- return -1;
- if (c1>c2)
- return 1;
- }
-}
-
-
-#ifdef CASESENSITIVITYDEFAULT_NO
-#define CASESENSITIVITYDEFAULTVALUE 2
-#else
-#define CASESENSITIVITYDEFAULTVALUE 1
-#endif
-
-#ifndef STRCMPCASENOSENTIVEFUNCTION
-#define STRCMPCASENOSENTIVEFUNCTION strcmpcasenosensitive_internal
-#endif
-
-/*
- Compare two filename (fileName1,fileName2).
- If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp)
- If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi
- or strcasecmp)
- If iCaseSenisivity = 0, case sensitivity is defaut of your operating system
- (like 1 on Unix, 2 on Windows)
-
-*/
-extern int ZEXPORT unzStringFileNameCompare (fileName1,fileName2,iCaseSensitivity)
- const char* fileName1;
- const char* fileName2;
- int iCaseSensitivity;
-{
- if (iCaseSensitivity==0)
- iCaseSensitivity=CASESENSITIVITYDEFAULTVALUE;
-
- if (iCaseSensitivity==1)
- return strcmp(fileName1,fileName2);
-
- return STRCMPCASENOSENTIVEFUNCTION(fileName1,fileName2);
-}
-
-#ifndef BUFREADCOMMENT
-#define BUFREADCOMMENT (0x400)
-#endif
-
-/*
- Locate the Central directory of a zipfile (at the end, just before
- the global comment)
-*/
-local uLong unzlocal_SearchCentralDir (
- const zlib_filefunc_def* pzlib_filefunc_def,
- voidpf filestream);
-
-local uLong unzlocal_SearchCentralDir(pzlib_filefunc_def,filestream)
- const zlib_filefunc_def* pzlib_filefunc_def;
- voidpf filestream;
-{
- unsigned char* buf;
- uLong uSizeFile;
- uLong uBackRead;
- uLong uMaxBack=0xffff; /* maximum size of global comment */
- uLong uPosFound=0;
-
- if (ZSEEK(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0)
- return 0;
-
-
- uSizeFile = ZTELL(*pzlib_filefunc_def,filestream);
-
- if (uMaxBack>uSizeFile)
- uMaxBack = uSizeFile;
-
- buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4);
- if (buf==NULL)
- return 0;
-
- uBackRead = 4;
- while (uBackRead<uMaxBack)
- {
- uLong uReadSize,uReadPos ;
- int i;
- if (uBackRead+BUFREADCOMMENT>uMaxBack)
- uBackRead = uMaxBack;
- else
- uBackRead+=BUFREADCOMMENT;
- uReadPos = uSizeFile-uBackRead ;
-
- uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ?
- (BUFREADCOMMENT+4) : (uSizeFile-uReadPos);
- if (ZSEEK(*pzlib_filefunc_def,filestream,uReadPos,ZLIB_FILEFUNC_SEEK_SET)!=0)
- break;
-
- if (ZREAD(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize)
- break;
-
- for (i=(int)uReadSize-3; (i--)>0;)
- if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) &&
- ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06))
- {
- uPosFound = uReadPos+i;
- break;
- }
-
- if (uPosFound!=0)
- break;
- }
- TRYFREE(buf);
- return uPosFound;
-}
-
-/*
- Open a Zip file. path contain the full pathname (by example,
- on a Windows NT computer "c:\\test\\zlib114.zip" or on an Unix computer
- "zlib/zlib114.zip".
- If the zipfile cannot be opened (file doesn't exist or in not valid), the
- return value is NULL.
- Else, the return value is a unzFile Handle, usable with other function
- of this unzip package.
-*/
-extern unzFile ZEXPORT unzOpen2 (path, pzlib_filefunc_def)
- const char *path;
- zlib_filefunc_def* pzlib_filefunc_def;
-{
- unz_s us;
- unz_s *s;
- uLong central_pos,uL;
-
- uLong number_disk; /* number of the current dist, used for
- spaning ZIP, unsupported, always 0*/
- uLong number_disk_with_CD; /* number the the disk with central dir, used
- for spaning ZIP, unsupported, always 0*/
- uLong number_entry_CD; /* total number of entries in
- the central dir
- (same than number_entry on nospan) */
-
- int err=UNZ_OK;
-
- if (unz_copyright[0]!=' ')
- return NULL;
-
- if (pzlib_filefunc_def==NULL)
- fill_fopen_filefunc(&us.z_filefunc);
- else
- us.z_filefunc = *pzlib_filefunc_def;
-
- us.filestream= (*(us.z_filefunc.zopen_file))(us.z_filefunc.opaque,
- path,
- ZLIB_FILEFUNC_MODE_READ |
- ZLIB_FILEFUNC_MODE_EXISTING);
- if (us.filestream==NULL)
- return NULL;
-
- central_pos = unzlocal_SearchCentralDir(&us.z_filefunc,us.filestream);
- if (central_pos==0)
- err=UNZ_ERRNO;
-
- if (ZSEEK(us.z_filefunc, us.filestream,
- central_pos,ZLIB_FILEFUNC_SEEK_SET)!=0)
- err=UNZ_ERRNO;
-
- /* the signature, already checked */
- if (unzlocal_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK)
- err=UNZ_ERRNO;
-
- /* number of this disk */
- if (unzlocal_getShort(&us.z_filefunc, us.filestream,&number_disk)!=UNZ_OK)
- err=UNZ_ERRNO;
-
- /* number of the disk with the start of the central directory */
- if (unzlocal_getShort(&us.z_filefunc, us.filestream,&number_disk_with_CD)!=UNZ_OK)
- err=UNZ_ERRNO;
-
- /* total number of entries in the central dir on this disk */
- if (unzlocal_getShort(&us.z_filefunc, us.filestream,&us.gi.number_entry)!=UNZ_OK)
- err=UNZ_ERRNO;
-
- /* total number of entries in the central dir */
- if (unzlocal_getShort(&us.z_filefunc, us.filestream,&number_entry_CD)!=UNZ_OK)
- err=UNZ_ERRNO;
-
- if ((number_entry_CD!=us.gi.number_entry) ||
- (number_disk_with_CD!=0) ||
- (number_disk!=0))
- err=UNZ_BADZIPFILE;
-
- /* size of the central directory */
- if (unzlocal_getLong(&us.z_filefunc, us.filestream,&us.size_central_dir)!=UNZ_OK)
- err=UNZ_ERRNO;
-
- /* offset of start of central directory with respect to the
- starting disk number */
- if (unzlocal_getLong(&us.z_filefunc, us.filestream,&us.offset_central_dir)!=UNZ_OK)
- err=UNZ_ERRNO;
-
- /* zipfile comment length */
- if (unzlocal_getShort(&us.z_filefunc, us.filestream,&us.gi.size_comment)!=UNZ_OK)
- err=UNZ_ERRNO;
-
- if ((central_pos<us.offset_central_dir+us.size_central_dir) &&
- (err==UNZ_OK))
- err=UNZ_BADZIPFILE;
-
- if (err!=UNZ_OK)
- {
- ZCLOSE(us.z_filefunc, us.filestream);
- return NULL;
- }
-
- us.byte_before_the_zipfile = central_pos -
- (us.offset_central_dir+us.size_central_dir);
- us.central_pos = central_pos;
- us.pfile_in_zip_read = NULL;
- us.encrypted = 0;
-
-
- s=(unz_s*)ALLOC(sizeof(unz_s));
- *s=us;
- unzGoToFirstFile((unzFile)s);
- return (unzFile)s;
-}
-
-
-extern unzFile ZEXPORT unzOpen (path)
- const char *path;
-{
- return unzOpen2(path, NULL);
-}
-
-/*
- Close a ZipFile opened with unzipOpen.
- If there is files inside the .Zip opened with unzipOpenCurrentFile (see later),
- these files MUST be closed with unzipCloseCurrentFile before call unzipClose.
- return UNZ_OK if there is no problem. */
-extern int ZEXPORT unzClose (file)
- unzFile file;
-{
- unz_s* s;
- if (file==NULL)
- return UNZ_PARAMERROR;
- s=(unz_s*)file;
-
- if (s->pfile_in_zip_read!=NULL)
- unzCloseCurrentFile(file);
-
- ZCLOSE(s->z_filefunc, s->filestream);
- TRYFREE(s);
- return UNZ_OK;
-}
-
-
-/*
- Write info about the ZipFile in the *pglobal_info structure.
- No preparation of the structure is needed
- return UNZ_OK if there is no problem. */
-extern int ZEXPORT unzGetGlobalInfo (file,pglobal_info)
- unzFile file;
- unz_global_info *pglobal_info;
-{
- unz_s* s;
- if (file==NULL)
- return UNZ_PARAMERROR;
- s=(unz_s*)file;
- *pglobal_info=s->gi;
- return UNZ_OK;
-}
-
-
-/*
- Translate date/time from Dos format to tm_unz (readable more easilty)
-*/
-local void unzlocal_DosDateToTmuDate (ulDosDate, ptm)
- uLong ulDosDate;
- tm_unz* ptm;
-{
- uLong uDate;
- uDate = (uLong)(ulDosDate>>16);
- ptm->tm_mday = (uInt)(uDate&0x1f) ;
- ptm->tm_mon = (uInt)((((uDate)&0x1E0)/0x20)-1) ;
- ptm->tm_year = (uInt)(((uDate&0x0FE00)/0x0200)+1980) ;
-
- ptm->tm_hour = (uInt) ((ulDosDate &0xF800)/0x800);
- ptm->tm_min = (uInt) ((ulDosDate&0x7E0)/0x20) ;
- ptm->tm_sec = (uInt) (2*(ulDosDate&0x1f)) ;
-}
-
-/*
- Get Info about the current file in the zipfile, with internal only info
-*/
-local int unzlocal_GetCurrentFileInfoInternal (unzFile file,
- unz_file_info *pfile_info,
- unz_file_info_internal
- *pfile_info_internal,
- char *szFileName,
- uLong fileNameBufferSize,
- void *extraField,
- uLong extraFieldBufferSize,
- char *szComment,
- uLong commentBufferSize);
-
-local int unzlocal_GetCurrentFileInfoInternal (file,
- pfile_info,
- pfile_info_internal,
- szFileName, fileNameBufferSize,
- extraField, extraFieldBufferSize,
- szComment, commentBufferSize)
- unzFile file;
- unz_file_info *pfile_info;
- unz_file_info_internal *pfile_info_internal;
- char *szFileName;
- uLong fileNameBufferSize;
- void *extraField;
- uLong extraFieldBufferSize;
- char *szComment;
- uLong commentBufferSize;
-{
- unz_s* s;
- unz_file_info file_info;
- unz_file_info_internal file_info_internal;
- int err=UNZ_OK;
- uLong uMagic;
- long lSeek=0;
-
- if (file==NULL)
- return UNZ_PARAMERROR;
- s=(unz_s*)file;
- if (ZSEEK(s->z_filefunc, s->filestream,
- s->pos_in_central_dir+s->byte_before_the_zipfile,
- ZLIB_FILEFUNC_SEEK_SET)!=0)
- err=UNZ_ERRNO;
-
-
- /* we check the magic */
- if (err==UNZ_OK)
- {
- if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK)
- err=UNZ_ERRNO;
- else if (uMagic!=0x02014b50)
- err=UNZ_BADZIPFILE;
- }
-
- if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.version) != UNZ_OK)
- err=UNZ_ERRNO;
-
- if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.version_needed) != UNZ_OK)
- err=UNZ_ERRNO;
-
- if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.flag) != UNZ_OK)
- err=UNZ_ERRNO;
-
- if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.compression_method) != UNZ_OK)
- err=UNZ_ERRNO;
-
- if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.dosDate) != UNZ_OK)
- err=UNZ_ERRNO;
-
- unzlocal_DosDateToTmuDate(file_info.dosDate,&file_info.tmu_date);
-
- if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.crc) != UNZ_OK)
- err=UNZ_ERRNO;
-
- if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.compressed_size) != UNZ_OK)
- err=UNZ_ERRNO;
-
- if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.uncompressed_size) != UNZ_OK)
- err=UNZ_ERRNO;
-
- if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.size_filename) != UNZ_OK)
- err=UNZ_ERRNO;
-
- if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.size_file_extra) != UNZ_OK)
- err=UNZ_ERRNO;
-
- if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.size_file_comment) != UNZ_OK)
- err=UNZ_ERRNO;
-
- if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.disk_num_start) != UNZ_OK)
- err=UNZ_ERRNO;
-
- if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.internal_fa) != UNZ_OK)
- err=UNZ_ERRNO;
-
- if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.external_fa) != UNZ_OK)
- err=UNZ_ERRNO;
-
- if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info_internal.offset_curfile) != UNZ_OK)
- err=UNZ_ERRNO;
-
- lSeek+=file_info.size_filename;
- if ((err==UNZ_OK) && (szFileName!=NULL))
- {
- uLong uSizeRead ;
- if (file_info.size_filename<fileNameBufferSize)
- {
- *(szFileName+file_info.size_filename)='\0';
- uSizeRead = file_info.size_filename;
- }
- else
- uSizeRead = fileNameBufferSize;
-
- if ((file_info.size_filename>0) && (fileNameBufferSize>0))
- if (ZREAD(s->z_filefunc, s->filestream,szFileName,uSizeRead)!=uSizeRead)
- err=UNZ_ERRNO;
- lSeek -= uSizeRead;
- }
-
-
- if ((err==UNZ_OK) && (extraField!=NULL))
- {
- uLong uSizeRead ;
- if (file_info.size_file_extra<extraFieldBufferSize)
- uSizeRead = file_info.size_file_extra;
- else
- uSizeRead = extraFieldBufferSize;
-
- if (lSeek!=0)
- {
- if (ZSEEK(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0)
- lSeek=0;
- else
- err=UNZ_ERRNO;
- }
- if ((file_info.size_file_extra>0) && (extraFieldBufferSize>0))
- if (ZREAD(s->z_filefunc, s->filestream,extraField,uSizeRead)!=uSizeRead)
- err=UNZ_ERRNO;
- lSeek += file_info.size_file_extra - uSizeRead;
- }
- else
- lSeek+=file_info.size_file_extra;
-
-
- if ((err==UNZ_OK) && (szComment!=NULL))
- {
- uLong uSizeRead ;
- if (file_info.size_file_comment<commentBufferSize)
- {
- *(szComment+file_info.size_file_comment)='\0';
- uSizeRead = file_info.size_file_comment;
- }
- else
- uSizeRead = commentBufferSize;
-
- if (lSeek!=0)
- {
- if (ZSEEK(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0)
- lSeek=0;
- else
- err=UNZ_ERRNO;
- }
- if ((file_info.size_file_comment>0) && (commentBufferSize>0))
- if (ZREAD(s->z_filefunc, s->filestream,szComment,uSizeRead)!=uSizeRead)
- err=UNZ_ERRNO;
- lSeek+=file_info.size_file_comment - uSizeRead;
- }
- else
- lSeek+=file_info.size_file_comment;
-
- if ((err==UNZ_OK) && (pfile_info!=NULL))
- *pfile_info=file_info;
-
- if ((err==UNZ_OK) && (pfile_info_internal!=NULL))
- *pfile_info_internal=file_info_internal;
-
- return err;
-}
-
-
-
-/*
- Write info about the ZipFile in the *pglobal_info structure.
- No preparation of the structure is needed
- return UNZ_OK if there is no problem.
-*/
-extern int ZEXPORT unzGetCurrentFileInfo (file,
- pfile_info,
- szFileName, fileNameBufferSize,
- extraField, extraFieldBufferSize,
- szComment, commentBufferSize)
- unzFile file;
- unz_file_info *pfile_info;
- char *szFileName;
- uLong fileNameBufferSize;
- void *extraField;
- uLong extraFieldBufferSize;
- char *szComment;
- uLong commentBufferSize;
-{
- return unzlocal_GetCurrentFileInfoInternal(file,pfile_info,NULL,
- szFileName,fileNameBufferSize,
- extraField,extraFieldBufferSize,
- szComment,commentBufferSize);
-}
-
-/*
- Set the current file of the zipfile to the first file.
- return UNZ_OK if there is no problem
-*/
-extern int ZEXPORT unzGoToFirstFile (file)
- unzFile file;
-{
- int err=UNZ_OK;
- unz_s* s;
- if (file==NULL)
- return UNZ_PARAMERROR;
- s=(unz_s*)file;
- s->pos_in_central_dir=s->offset_central_dir;
- s->num_file=0;
- err=unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info,
- &s->cur_file_info_internal,
- NULL,0,NULL,0,NULL,0);
- s->current_file_ok = (err == UNZ_OK);
- return err;
-}
-
-/*
- Set the current file of the zipfile to the next file.
- return UNZ_OK if there is no problem
- return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest.
-*/
-extern int ZEXPORT unzGoToNextFile (file)
- unzFile file;
-{
- unz_s* s;
- int err;
-
- if (file==NULL)
- return UNZ_PARAMERROR;
- s=(unz_s*)file;
- if (!s->current_file_ok)
- return UNZ_END_OF_LIST_OF_FILE;
- if (s->gi.number_entry != 0xffff) /* 2^16 files overflow hack */
- if (s->num_file+1==s->gi.number_entry)
- return UNZ_END_OF_LIST_OF_FILE;
-
- s->pos_in_central_dir += SIZECENTRALDIRITEM + s->cur_file_info.size_filename +
- s->cur_file_info.size_file_extra + s->cur_file_info.size_file_comment ;
- s->num_file++;
- err = unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info,
- &s->cur_file_info_internal,
- NULL,0,NULL,0,NULL,0);
- s->current_file_ok = (err == UNZ_OK);
- return err;
-}
-
-
-/*
- Try locate the file szFileName in the zipfile.
- For the iCaseSensitivity signification, see unzipStringFileNameCompare
-
- return value :
- UNZ_OK if the file is found. It becomes the current file.
- UNZ_END_OF_LIST_OF_FILE if the file is not found
-*/
-extern int ZEXPORT unzLocateFile (file, szFileName, iCaseSensitivity)
- unzFile file;
- const char *szFileName;
- int iCaseSensitivity;
-{
- unz_s* s;
- int err;
-
- /* We remember the 'current' position in the file so that we can jump
- * back there if we fail.
- */
- unz_file_info cur_file_infoSaved;
- unz_file_info_internal cur_file_info_internalSaved;
- uLong num_fileSaved;
- uLong pos_in_central_dirSaved;
-
-
- if (file==NULL)
- return UNZ_PARAMERROR;
-
- if (strlen(szFileName)>=UNZ_MAXFILENAMEINZIP)
- return UNZ_PARAMERROR;
-
- s=(unz_s*)file;
- if (!s->current_file_ok)
- return UNZ_END_OF_LIST_OF_FILE;
-
- /* Save the current state */
- num_fileSaved = s->num_file;
- pos_in_central_dirSaved = s->pos_in_central_dir;
- cur_file_infoSaved = s->cur_file_info;
- cur_file_info_internalSaved = s->cur_file_info_internal;
-
- err = unzGoToFirstFile(file);
-
- while (err == UNZ_OK)
- {
- char szCurrentFileName[UNZ_MAXFILENAMEINZIP+1];
- err = unzGetCurrentFileInfo(file,NULL,
- szCurrentFileName,sizeof(szCurrentFileName)-1,
- NULL,0,NULL,0);
- if (err == UNZ_OK)
- {
- if (unzStringFileNameCompare(szCurrentFileName,
- szFileName,iCaseSensitivity)==0)
- return UNZ_OK;
- err = unzGoToNextFile(file);
- }
- }
-
- /* We failed, so restore the state of the 'current file' to where we
- * were.
- */
- s->num_file = num_fileSaved ;
- s->pos_in_central_dir = pos_in_central_dirSaved ;
- s->cur_file_info = cur_file_infoSaved;
- s->cur_file_info_internal = cur_file_info_internalSaved;
- return err;
-}
-
-
-/*
-///////////////////////////////////////////
-// Contributed by Ryan Haksi (mailto://cryogen@infoserve.net)
-// I need random access
-//
-// Further optimization could be realized by adding an ability
-// to cache the directory in memory. The goal being a single
-// comprehensive file read to put the file I need in a memory.
-*/
-
-/*
-typedef struct unz_file_pos_s
-{
- uLong pos_in_zip_directory; // offset in file
- uLong num_of_file; // # of file
-} unz_file_pos;
-*/
-
-extern int ZEXPORT unzGetFilePos(file, file_pos)
- unzFile file;
- unz_file_pos* file_pos;
-{
- unz_s* s;
-
- if (file==NULL || file_pos==NULL)
- return UNZ_PARAMERROR;
- s=(unz_s*)file;
- if (!s->current_file_ok)
- return UNZ_END_OF_LIST_OF_FILE;
-
- file_pos->pos_in_zip_directory = s->pos_in_central_dir;
- file_pos->num_of_file = s->num_file;
-
- return UNZ_OK;
-}
-
-extern int ZEXPORT unzGoToFilePos(file, file_pos)
- unzFile file;
- unz_file_pos* file_pos;
-{
- unz_s* s;
- int err;
-
- if (file==NULL || file_pos==NULL)
- return UNZ_PARAMERROR;
- s=(unz_s*)file;
-
- /* jump to the right spot */
- s->pos_in_central_dir = file_pos->pos_in_zip_directory;
- s->num_file = file_pos->num_of_file;
-
- /* set the current file */
- err = unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info,
- &s->cur_file_info_internal,
- NULL,0,NULL,0,NULL,0);
- /* return results */
- s->current_file_ok = (err == UNZ_OK);
- return err;
-}
-
-/*
-// Unzip Helper Functions - should be here?
-///////////////////////////////////////////
-*/
-
-/*
- Read the local header of the current zipfile
- Check the coherency of the local header and info in the end of central
- directory about this file
- store in *piSizeVar the size of extra info in local header
- (filename and size of extra field data)
-*/
-local int unzlocal_CheckCurrentFileCoherencyHeader (s,piSizeVar,
- poffset_local_extrafield,
- psize_local_extrafield)
- unz_s* s;
- uInt* piSizeVar;
- uLong *poffset_local_extrafield;
- uInt *psize_local_extrafield;
-{
- uLong uMagic,uData,uFlags;
- uLong size_filename;
- uLong size_extra_field;
- int err=UNZ_OK;
-
- *piSizeVar = 0;
- *poffset_local_extrafield = 0;
- *psize_local_extrafield = 0;
-
- if (ZSEEK(s->z_filefunc, s->filestream,s->cur_file_info_internal.offset_curfile +
- s->byte_before_the_zipfile,ZLIB_FILEFUNC_SEEK_SET)!=0)
- return UNZ_ERRNO;
-
-
- if (err==UNZ_OK)
- {
- if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK)
- err=UNZ_ERRNO;
- else if (uMagic!=0x04034b50)
- err=UNZ_BADZIPFILE;
- }
-
- if (unzlocal_getShort(&s->z_filefunc, s->filestream,&uData) != UNZ_OK)
- err=UNZ_ERRNO;
-/*
- else if ((err==UNZ_OK) && (uData!=s->cur_file_info.wVersion))
- err=UNZ_BADZIPFILE;
-*/
- if (unzlocal_getShort(&s->z_filefunc, s->filestream,&uFlags) != UNZ_OK)
- err=UNZ_ERRNO;
-
- if (unzlocal_getShort(&s->z_filefunc, s->filestream,&uData) != UNZ_OK)
- err=UNZ_ERRNO;
- else if ((err==UNZ_OK) && (uData!=s->cur_file_info.compression_method))
- err=UNZ_BADZIPFILE;
-
- if ((err==UNZ_OK) && (s->cur_file_info.compression_method!=0) &&
- (s->cur_file_info.compression_method!=Z_DEFLATED))
- err=UNZ_BADZIPFILE;
-
- if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* date/time */
- err=UNZ_ERRNO;
-
- if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* crc */
- err=UNZ_ERRNO;
- else if ((err==UNZ_OK) && (uData!=s->cur_file_info.crc) &&
- ((uFlags & 8)==0))
- err=UNZ_BADZIPFILE;
-
- if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* size compr */
- err=UNZ_ERRNO;
- else if ((err==UNZ_OK) && (uData!=s->cur_file_info.compressed_size) &&
- ((uFlags & 8)==0))
- err=UNZ_BADZIPFILE;
-
- if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* size uncompr */
- err=UNZ_ERRNO;
- else if ((err==UNZ_OK) && (uData!=s->cur_file_info.uncompressed_size) &&
- ((uFlags & 8)==0))
- err=UNZ_BADZIPFILE;
-
-
- if (unzlocal_getShort(&s->z_filefunc, s->filestream,&size_filename) != UNZ_OK)
- err=UNZ_ERRNO;
- else if ((err==UNZ_OK) && (size_filename!=s->cur_file_info.size_filename))
- err=UNZ_BADZIPFILE;
-
- *piSizeVar += (uInt)size_filename;
-
- if (unzlocal_getShort(&s->z_filefunc, s->filestream,&size_extra_field) != UNZ_OK)
- err=UNZ_ERRNO;
- *poffset_local_extrafield= s->cur_file_info_internal.offset_curfile +
- SIZEZIPLOCALHEADER + size_filename;
- *psize_local_extrafield = (uInt)size_extra_field;
-
- *piSizeVar += (uInt)size_extra_field;
-
- return err;
-}
-
-/*
- Open for reading data the current file in the zipfile.
- If there is no error and the file is opened, the return value is UNZ_OK.
-*/
-extern int ZEXPORT unzOpenCurrentFile3 (file, method, level, raw, password)
- unzFile file;
- int* method;
- int* level;
- int raw;
- const char* password;
-{
- int err=UNZ_OK;
- uInt iSizeVar;
- unz_s* s;
- file_in_zip_read_info_s* pfile_in_zip_read_info;
- uLong offset_local_extrafield; /* offset of the local extra field */
- uInt size_local_extrafield; /* size of the local extra field */
-# ifndef NOUNCRYPT
- char source[12];
-# else
- if (password != NULL)
- return UNZ_PARAMERROR;
-# endif
-
- if (file==NULL)
- return UNZ_PARAMERROR;
- s=(unz_s*)file;
- if (!s->current_file_ok)
- return UNZ_PARAMERROR;
-
- if (s->pfile_in_zip_read != NULL)
- unzCloseCurrentFile(file);
-
- if (unzlocal_CheckCurrentFileCoherencyHeader(s,&iSizeVar,
- &offset_local_extrafield,&size_local_extrafield)!=UNZ_OK)
- return UNZ_BADZIPFILE;
-
- pfile_in_zip_read_info = (file_in_zip_read_info_s*)
- ALLOC(sizeof(file_in_zip_read_info_s));
- if (pfile_in_zip_read_info==NULL)
- return UNZ_INTERNALERROR;
-
- pfile_in_zip_read_info->read_buffer=(char*)ALLOC(UNZ_BUFSIZE);
- pfile_in_zip_read_info->offset_local_extrafield = offset_local_extrafield;
- pfile_in_zip_read_info->size_local_extrafield = size_local_extrafield;
- pfile_in_zip_read_info->pos_local_extrafield=0;
- pfile_in_zip_read_info->raw=raw;
-
- if (pfile_in_zip_read_info->read_buffer==NULL)
- {
- TRYFREE(pfile_in_zip_read_info);
- return UNZ_INTERNALERROR;
- }
-
- pfile_in_zip_read_info->stream_initialised=0;
-
- if (method!=NULL)
- *method = (int)s->cur_file_info.compression_method;
-
- if (level!=NULL)
- {
- *level = 6;
- switch (s->cur_file_info.flag & 0x06)
- {
- case 6 : *level = 1; break;
- case 4 : *level = 2; break;
- case 2 : *level = 9; break;
- }
- }
-
- if ((s->cur_file_info.compression_method!=0) &&
- (s->cur_file_info.compression_method!=Z_DEFLATED))
- err=UNZ_BADZIPFILE;
-
- pfile_in_zip_read_info->crc32_wait=s->cur_file_info.crc;
- pfile_in_zip_read_info->crc32=0;
- pfile_in_zip_read_info->compression_method =
- s->cur_file_info.compression_method;
- pfile_in_zip_read_info->filestream=s->filestream;
- pfile_in_zip_read_info->z_filefunc=s->z_filefunc;
- pfile_in_zip_read_info->byte_before_the_zipfile=s->byte_before_the_zipfile;
-
- pfile_in_zip_read_info->stream.total_out = 0;
-
- if ((s->cur_file_info.compression_method==Z_DEFLATED) &&
- (!raw))
- {
- pfile_in_zip_read_info->stream.zalloc = (alloc_func)0;
- pfile_in_zip_read_info->stream.zfree = (free_func)0;
- pfile_in_zip_read_info->stream.opaque = (voidpf)0;
- pfile_in_zip_read_info->stream.next_in = (voidpf)0;
- pfile_in_zip_read_info->stream.avail_in = 0;
-
- err=inflateInit2(&pfile_in_zip_read_info->stream, -MAX_WBITS);
- if (err == Z_OK)
- pfile_in_zip_read_info->stream_initialised=1;
- else
- {
- TRYFREE(pfile_in_zip_read_info);
- return err;
- }
- /* windowBits is passed < 0 to tell that there is no zlib header.
- * Note that in this case inflate *requires* an extra "dummy" byte
- * after the compressed stream in order to complete decompression and
- * return Z_STREAM_END.
- * In unzip, i don't wait absolutely Z_STREAM_END because I known the
- * size of both compressed and uncompressed data
- */
- }
- pfile_in_zip_read_info->rest_read_compressed =
- s->cur_file_info.compressed_size ;
- pfile_in_zip_read_info->rest_read_uncompressed =
- s->cur_file_info.uncompressed_size ;
-
-
- pfile_in_zip_read_info->pos_in_zipfile =
- s->cur_file_info_internal.offset_curfile + SIZEZIPLOCALHEADER +
- iSizeVar;
-
- pfile_in_zip_read_info->stream.avail_in = (uInt)0;
-
- s->pfile_in_zip_read = pfile_in_zip_read_info;
-
-# ifndef NOUNCRYPT
- if (password != NULL)
- {
- int i;
- s->pcrc_32_tab = get_crc_table();
- init_keys(password,s->keys,s->pcrc_32_tab);
- if (ZSEEK(s->z_filefunc, s->filestream,
- s->pfile_in_zip_read->pos_in_zipfile +
- s->pfile_in_zip_read->byte_before_the_zipfile,
- SEEK_SET)!=0)
- return UNZ_INTERNALERROR;
- if (ZREAD(s->z_filefunc, s->filestream,source, 12)<12)
- return UNZ_INTERNALERROR;
-
- for (i = 0; i<12; i++)
- zdecode(s->keys,s->pcrc_32_tab,source[i]);
-
- s->pfile_in_zip_read->pos_in_zipfile+=12;
- s->encrypted=1;
- }
-# endif
-
-
- return UNZ_OK;
-}
-
-extern int ZEXPORT unzOpenCurrentFile (file)
- unzFile file;
-{
- return unzOpenCurrentFile3(file, NULL, NULL, 0, NULL);
-}
-
-extern int ZEXPORT unzOpenCurrentFilePassword (file, password)
- unzFile file;
- const char* password;
-{
- return unzOpenCurrentFile3(file, NULL, NULL, 0, password);
-}
-
-extern int ZEXPORT unzOpenCurrentFile2 (file,method,level,raw)
- unzFile file;
- int* method;
- int* level;
- int raw;
-{
- return unzOpenCurrentFile3(file, method, level, raw, NULL);
-}
-
-/*
- Read bytes from the current file.
- buf contain buffer where data must be copied
- len the size of buf.
-
- return the number of byte copied if somes bytes are copied
- return 0 if the end of file was reached
- return <0 with error code if there is an error
- (UNZ_ERRNO for IO error, or zLib error for uncompress error)
-*/
-extern int ZEXPORT unzReadCurrentFile (file, buf, len)
- unzFile file;
- voidp buf;
- unsigned len;
-{
- int err=UNZ_OK;
- uInt iRead = 0;
- unz_s* s;
- file_in_zip_read_info_s* pfile_in_zip_read_info;
- if (file==NULL)
- return UNZ_PARAMERROR;
- s=(unz_s*)file;
- pfile_in_zip_read_info=s->pfile_in_zip_read;
-
- if (pfile_in_zip_read_info==NULL)
- return UNZ_PARAMERROR;
-
-
- if ((pfile_in_zip_read_info->read_buffer == NULL))
- return UNZ_END_OF_LIST_OF_FILE;
- if (len==0)
- return 0;
-
- pfile_in_zip_read_info->stream.next_out = (Bytef*)buf;
-
- pfile_in_zip_read_info->stream.avail_out = (uInt)len;
-
- if ((len>pfile_in_zip_read_info->rest_read_uncompressed) &&
- (!(pfile_in_zip_read_info->raw)))
- pfile_in_zip_read_info->stream.avail_out =
- (uInt)pfile_in_zip_read_info->rest_read_uncompressed;
-
- if ((len>pfile_in_zip_read_info->rest_read_compressed+
- pfile_in_zip_read_info->stream.avail_in) &&
- (pfile_in_zip_read_info->raw))
- pfile_in_zip_read_info->stream.avail_out =
- (uInt)pfile_in_zip_read_info->rest_read_compressed+
- pfile_in_zip_read_info->stream.avail_in;
-
- while (pfile_in_zip_read_info->stream.avail_out>0)
- {
- if ((pfile_in_zip_read_info->stream.avail_in==0) &&
- (pfile_in_zip_read_info->rest_read_compressed>0))
- {
- uInt uReadThis = UNZ_BUFSIZE;
- if (pfile_in_zip_read_info->rest_read_compressed<uReadThis)
- uReadThis = (uInt)pfile_in_zip_read_info->rest_read_compressed;
- if (uReadThis == 0)
- return UNZ_EOF;
- if (ZSEEK(pfile_in_zip_read_info->z_filefunc,
- pfile_in_zip_read_info->filestream,
- pfile_in_zip_read_info->pos_in_zipfile +
- pfile_in_zip_read_info->byte_before_the_zipfile,
- ZLIB_FILEFUNC_SEEK_SET)!=0)
- return UNZ_ERRNO;
- if (ZREAD(pfile_in_zip_read_info->z_filefunc,
- pfile_in_zip_read_info->filestream,
- pfile_in_zip_read_info->read_buffer,
- uReadThis)!=uReadThis)
- return UNZ_ERRNO;
-
-
-# ifndef NOUNCRYPT
- if (s->encrypted)
- {
- uInt i;
- for (i=0;i<uReadThis;i++)
- pfile_in_zip_read_info->read_buffer[i] =
- zdecode(s->keys,s->pcrc_32_tab,
- pfile_in_zip_read_info->read_buffer[i]);
- }
-# endif
-
-
- pfile_in_zip_read_info->pos_in_zipfile += uReadThis;
-
- pfile_in_zip_read_info->rest_read_compressed-=uReadThis;
-
- pfile_in_zip_read_info->stream.next_in =
- (Bytef*)pfile_in_zip_read_info->read_buffer;
- pfile_in_zip_read_info->stream.avail_in = (uInt)uReadThis;
- }
-
- if ((pfile_in_zip_read_info->compression_method==0) || (pfile_in_zip_read_info->raw))
- {
- uInt uDoCopy,i ;
-
- if ((pfile_in_zip_read_info->stream.avail_in == 0) &&
- (pfile_in_zip_read_info->rest_read_compressed == 0))
- return (iRead==0) ? UNZ_EOF : iRead;
-
- if (pfile_in_zip_read_info->stream.avail_out <
- pfile_in_zip_read_info->stream.avail_in)
- uDoCopy = pfile_in_zip_read_info->stream.avail_out ;
- else
- uDoCopy = pfile_in_zip_read_info->stream.avail_in ;
-
- for (i=0;i<uDoCopy;i++)
- *(pfile_in_zip_read_info->stream.next_out+i) =
- *(pfile_in_zip_read_info->stream.next_in+i);
-
- pfile_in_zip_read_info->crc32 = crc32(pfile_in_zip_read_info->crc32,
- pfile_in_zip_read_info->stream.next_out,
- uDoCopy);
- pfile_in_zip_read_info->rest_read_uncompressed-=uDoCopy;
- pfile_in_zip_read_info->stream.avail_in -= uDoCopy;
- pfile_in_zip_read_info->stream.avail_out -= uDoCopy;
- pfile_in_zip_read_info->stream.next_out += uDoCopy;
- pfile_in_zip_read_info->stream.next_in += uDoCopy;
- pfile_in_zip_read_info->stream.total_out += uDoCopy;
- iRead += uDoCopy;
- }
- else
- {
- uLong uTotalOutBefore,uTotalOutAfter;
- const Bytef *bufBefore;
- uLong uOutThis;
- int flush=Z_SYNC_FLUSH;
-
- uTotalOutBefore = pfile_in_zip_read_info->stream.total_out;
- bufBefore = pfile_in_zip_read_info->stream.next_out;
-
- /*
- if ((pfile_in_zip_read_info->rest_read_uncompressed ==
- pfile_in_zip_read_info->stream.avail_out) &&
- (pfile_in_zip_read_info->rest_read_compressed == 0))
- flush = Z_FINISH;
- */
- err=inflate(&pfile_in_zip_read_info->stream,flush);
-
- if ((err>=0) && (pfile_in_zip_read_info->stream.msg!=NULL))
- err = Z_DATA_ERROR;
-
- uTotalOutAfter = pfile_in_zip_read_info->stream.total_out;
- uOutThis = uTotalOutAfter-uTotalOutBefore;
-
- pfile_in_zip_read_info->crc32 =
- crc32(pfile_in_zip_read_info->crc32,bufBefore,
- (uInt)(uOutThis));
-
- pfile_in_zip_read_info->rest_read_uncompressed -=
- uOutThis;
-
- iRead += (uInt)(uTotalOutAfter - uTotalOutBefore);
-
- if (err==Z_STREAM_END)
- return (iRead==0) ? UNZ_EOF : iRead;
- if (err!=Z_OK)
- break;
- }
- }
-
- if (err==Z_OK)
- return iRead;
- return err;
-}
-
-
-/*
- Give the current position in uncompressed data
-*/
-extern z_off_t ZEXPORT unztell (file)
- unzFile file;
-{
- unz_s* s;
- file_in_zip_read_info_s* pfile_in_zip_read_info;
- if (file==NULL)
- return UNZ_PARAMERROR;
- s=(unz_s*)file;
- pfile_in_zip_read_info=s->pfile_in_zip_read;
-
- if (pfile_in_zip_read_info==NULL)
- return UNZ_PARAMERROR;
-
- return (z_off_t)pfile_in_zip_read_info->stream.total_out;
-}
-
-
-/*
- return 1 if the end of file was reached, 0 elsewhere
-*/
-extern int ZEXPORT unzeof (file)
- unzFile file;
-{
- unz_s* s;
- file_in_zip_read_info_s* pfile_in_zip_read_info;
- if (file==NULL)
- return UNZ_PARAMERROR;
- s=(unz_s*)file;
- pfile_in_zip_read_info=s->pfile_in_zip_read;
-
- if (pfile_in_zip_read_info==NULL)
- return UNZ_PARAMERROR;
-
- if (pfile_in_zip_read_info->rest_read_uncompressed == 0)
- return 1;
- else
- return 0;
-}
-
-
-
-/*
- Read extra field from the current file (opened by unzOpenCurrentFile)
- This is the local-header version of the extra field (sometimes, there is
- more info in the local-header version than in the central-header)
-
- if buf==NULL, it return the size of the local extra field that can be read
-
- if buf!=NULL, len is the size of the buffer, the extra header is copied in
- buf.
- the return value is the number of bytes copied in buf, or (if <0)
- the error code
-*/
-extern int ZEXPORT unzGetLocalExtrafield (file,buf,len)
- unzFile file;
- voidp buf;
- unsigned len;
-{
- unz_s* s;
- file_in_zip_read_info_s* pfile_in_zip_read_info;
- uInt read_now;
- uLong size_to_read;
-
- if (file==NULL)
- return UNZ_PARAMERROR;
- s=(unz_s*)file;
- pfile_in_zip_read_info=s->pfile_in_zip_read;
-
- if (pfile_in_zip_read_info==NULL)
- return UNZ_PARAMERROR;
-
- size_to_read = (pfile_in_zip_read_info->size_local_extrafield -
- pfile_in_zip_read_info->pos_local_extrafield);
-
- if (buf==NULL)
- return (int)size_to_read;
-
- if (len>size_to_read)
- read_now = (uInt)size_to_read;
- else
- read_now = (uInt)len ;
-
- if (read_now==0)
- return 0;
-
- if (ZSEEK(pfile_in_zip_read_info->z_filefunc,
- pfile_in_zip_read_info->filestream,
- pfile_in_zip_read_info->offset_local_extrafield +
- pfile_in_zip_read_info->pos_local_extrafield,
- ZLIB_FILEFUNC_SEEK_SET)!=0)
- return UNZ_ERRNO;
-
- if (ZREAD(pfile_in_zip_read_info->z_filefunc,
- pfile_in_zip_read_info->filestream,
- buf,read_now)!=read_now)
- return UNZ_ERRNO;
-
- return (int)read_now;
-}
-
-/*
- Close the file in zip opened with unzipOpenCurrentFile
- Return UNZ_CRCERROR if all the file was read but the CRC is not good
-*/
-extern int ZEXPORT unzCloseCurrentFile (file)
- unzFile file;
-{
- int err=UNZ_OK;
-
- unz_s* s;
- file_in_zip_read_info_s* pfile_in_zip_read_info;
- if (file==NULL)
- return UNZ_PARAMERROR;
- s=(unz_s*)file;
- pfile_in_zip_read_info=s->pfile_in_zip_read;
-
- if (pfile_in_zip_read_info==NULL)
- return UNZ_PARAMERROR;
-
-
- if ((pfile_in_zip_read_info->rest_read_uncompressed == 0) &&
- (!pfile_in_zip_read_info->raw))
- {
- if (pfile_in_zip_read_info->crc32 != pfile_in_zip_read_info->crc32_wait)
- err=UNZ_CRCERROR;
- }
-
-
- TRYFREE(pfile_in_zip_read_info->read_buffer);
- pfile_in_zip_read_info->read_buffer = NULL;
- if (pfile_in_zip_read_info->stream_initialised)
- inflateEnd(&pfile_in_zip_read_info->stream);
-
- pfile_in_zip_read_info->stream_initialised = 0;
- TRYFREE(pfile_in_zip_read_info);
-
- s->pfile_in_zip_read=NULL;
-
- return err;
-}
-
-
-/*
- Get the global comment string of the ZipFile, in the szComment buffer.
- uSizeBuf is the size of the szComment buffer.
- return the number of byte copied or an error code <0
-*/
-extern int ZEXPORT unzGetGlobalComment (file, szComment, uSizeBuf)
- unzFile file;
- char *szComment;
- uLong uSizeBuf;
-{
- unz_s* s;
- uLong uReadThis ;
- if (file==NULL)
- return UNZ_PARAMERROR;
- s=(unz_s*)file;
-
- uReadThis = uSizeBuf;
- if (uReadThis>s->gi.size_comment)
- uReadThis = s->gi.size_comment;
-
- if (ZSEEK(s->z_filefunc,s->filestream,s->central_pos+22,ZLIB_FILEFUNC_SEEK_SET)!=0)
- return UNZ_ERRNO;
-
- if (uReadThis>0)
- {
- *szComment='\0';
- if (ZREAD(s->z_filefunc,s->filestream,szComment,uReadThis)!=uReadThis)
- return UNZ_ERRNO;
- }
-
- if ((szComment != NULL) && (uSizeBuf > s->gi.size_comment))
- *(szComment+s->gi.size_comment)='\0';
- return (int)uReadThis;
-}
-
-/* Additions by RX '2004 */
-extern uLong ZEXPORT unzGetOffset (file)
- unzFile file;
-{
- unz_s* s;
-
- if (file==NULL)
- return UNZ_PARAMERROR;
- s=(unz_s*)file;
- if (!s->current_file_ok)
- return 0;
- if (s->gi.number_entry != 0 && s->gi.number_entry != 0xffff)
- if (s->num_file==s->gi.number_entry)
- return 0;
- return s->pos_in_central_dir;
-}
-
-extern int ZEXPORT unzSetOffset (file, pos)
- unzFile file;
- uLong pos;
-{
- unz_s* s;
- int err;
-
- if (file==NULL)
- return UNZ_PARAMERROR;
- s=(unz_s*)file;
-
- s->pos_in_central_dir = pos;
- s->num_file = s->gi.number_entry; /* hack */
- err = unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info,
- &s->cur_file_info_internal,
- NULL,0,NULL,0,NULL,0);
- s->current_file_ok = (err == UNZ_OK);
- return err;
-}
diff --git a/3rdparty/assimp/contrib/unzip/unzip.h b/3rdparty/assimp/contrib/unzip/unzip.h
deleted file mode 100644
index 2f0d6ee5..00000000
--- a/3rdparty/assimp/contrib/unzip/unzip.h
+++ /dev/null
@@ -1,358 +0,0 @@
-/* unzip.h -- IO for uncompress .zip files using zlib
- Version 1.01e, February 12th, 2005
-
- Copyright (C) 1998-2005 Gilles Vollant
-
- This unzip package allow extract file from .ZIP file, compatible with PKZip 2.04g
- WinZip, InfoZip tools and compatible.
-
- Multi volume ZipFile (span) are not supported.
- Encryption compatible with pkzip 2.04g only supported
- Old compressions used by old PKZip 1.x are not supported
-
-
- I WAIT FEEDBACK at mail info@winimage.com
- Visit also http://www.winimage.com/zLibDll/unzip.htm for evolution
-
- Condition of use and distribution are the same than zlib :
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-
-
-*/
-
-/* for more info about .ZIP format, see
- http://www.info-zip.org/pub/infozip/doc/appnote-981119-iz.zip
- http://www.info-zip.org/pub/infozip/doc/
- PkWare has also a specification at :
- ftp://ftp.pkware.com/probdesc.zip
-*/
-
-#ifndef _unz_H
-#define _unz_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef _ZLIB_H
-# ifdef ASSIMP_BUILD_NO_OWN_ZLIB
-# include <zlib.h>
-# else
-# include "../zlib/zlib.h"
-# endif
-#endif
-
-#ifndef _ZLIBIOAPI_H
-#include "ioapi.h"
-#endif
-
-#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP)
-/* like the STRICT of WIN32, we define a pointer that cannot be converted
- from (void*) without cast */
-typedef struct TagunzFile__ { int unused; } unzFile__;
-typedef unzFile__ *unzFile;
-#else
-typedef voidp unzFile;
-#endif
-
-
-#define UNZ_OK (0)
-#define UNZ_END_OF_LIST_OF_FILE (-100)
-#define UNZ_ERRNO (Z_ERRNO)
-#define UNZ_EOF (0)
-#define UNZ_PARAMERROR (-102)
-#define UNZ_BADZIPFILE (-103)
-#define UNZ_INTERNALERROR (-104)
-#define UNZ_CRCERROR (-105)
-
-/* tm_unz contain date/time info */
-typedef struct tm_unz_s
-{
- uInt tm_sec; /* seconds after the minute - [0,59] */
- uInt tm_min; /* minutes after the hour - [0,59] */
- uInt tm_hour; /* hours since midnight - [0,23] */
- uInt tm_mday; /* day of the month - [1,31] */
- uInt tm_mon; /* months since January - [0,11] */
- uInt tm_year; /* years - [1980..2044] */
-} tm_unz;
-
-/* unz_global_info structure contain global data about the ZIPfile
- These data comes from the end of central dir */
-typedef struct unz_global_info_s
-{
- uLong number_entry; /* total number of entries in
- the central dir on this disk */
- uLong size_comment; /* size of the global comment of the zipfile */
-} unz_global_info;
-
-
-/* unz_file_info contain information about a file in the zipfile */
-typedef struct unz_file_info_s
-{
- uLong version; /* version made by 2 bytes */
- uLong version_needed; /* version needed to extract 2 bytes */
- uLong flag; /* general purpose bit flag 2 bytes */
- uLong compression_method; /* compression method 2 bytes */
- uLong dosDate; /* last mod file date in Dos fmt 4 bytes */
- uLong crc; /* crc-32 4 bytes */
- uLong compressed_size; /* compressed size 4 bytes */
- uLong uncompressed_size; /* uncompressed size 4 bytes */
- uLong size_filename; /* filename length 2 bytes */
- uLong size_file_extra; /* extra field length 2 bytes */
- uLong size_file_comment; /* file comment length 2 bytes */
-
- uLong disk_num_start; /* disk number start 2 bytes */
- uLong internal_fa; /* internal file attributes 2 bytes */
- uLong external_fa; /* external file attributes 4 bytes */
-
- tm_unz tmu_date;
-} unz_file_info;
-
-extern int ZEXPORT unzStringFileNameCompare (const char* fileName1,
- const char* fileName2,
- int iCaseSensitivity);
-/*
- Compare two filename (fileName1,fileName2).
- If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp)
- If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi
- or strcasecmp)
- If iCaseSenisivity = 0, case sensitivity is defaut of your operating system
- (like 1 on Unix, 2 on Windows)
-*/
-
-
-extern unzFile ZEXPORT unzOpen (const char *path);
-/*
- Open a Zip file. path contain the full pathname (by example,
- on a Windows XP computer "c:\\zlib\\zlib113.zip" or on an Unix computer
- "zlib/zlib113.zip".
- If the zipfile cannot be opened (file don't exist or in not valid), the
- return value is NULL.
- Else, the return value is a unzFile Handle, usable with other function
- of this unzip package.
-*/
-
-extern unzFile ZEXPORT unzOpen2 (const char *path,
- zlib_filefunc_def* pzlib_filefunc_def);
-/*
- Open a Zip file, like unzOpen, but provide a set of file low level API
- for read/write the zip file (see ioapi.h)
-*/
-
-extern int ZEXPORT unzClose (unzFile file);
-/*
- Close a ZipFile opened with unzipOpen.
- If there is files inside the .Zip opened with unzOpenCurrentFile (see later),
- these files MUST be closed with unzipCloseCurrentFile before call unzipClose.
- return UNZ_OK if there is no problem. */
-
-extern int ZEXPORT unzGetGlobalInfo (unzFile file,
- unz_global_info *pglobal_info);
-/*
- Write info about the ZipFile in the *pglobal_info structure.
- No preparation of the structure is needed
- return UNZ_OK if there is no problem. */
-
-
-extern int ZEXPORT unzGetGlobalComment (unzFile file,
- char *szComment,
- uLong uSizeBuf);
-/*
- Get the global comment string of the ZipFile, in the szComment buffer.
- uSizeBuf is the size of the szComment buffer.
- return the number of byte copied or an error code <0
-*/
-
-
-/***************************************************************************/
-/* Unzip package allow you browse the directory of the zipfile */
-
-extern int ZEXPORT unzGoToFirstFile (unzFile file);
-/*
- Set the current file of the zipfile to the first file.
- return UNZ_OK if there is no problem
-*/
-
-extern int ZEXPORT unzGoToNextFile (unzFile file);
-/*
- Set the current file of the zipfile to the next file.
- return UNZ_OK if there is no problem
- return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest.
-*/
-
-extern int ZEXPORT unzLocateFile (unzFile file,
- const char *szFileName,
- int iCaseSensitivity);
-/*
- Try locate the file szFileName in the zipfile.
- For the iCaseSensitivity signification, see unzStringFileNameCompare
-
- return value :
- UNZ_OK if the file is found. It becomes the current file.
- UNZ_END_OF_LIST_OF_FILE if the file is not found
-*/
-
-
-/* ****************************************** */
-/* Ryan supplied functions */
-/* unz_file_info contain information about a file in the zipfile */
-typedef struct unz_file_pos_s
-{
- uLong pos_in_zip_directory; /* offset in zip file directory */
- uLong num_of_file; /* # of file */
-} unz_file_pos;
-
-extern int ZEXPORT unzGetFilePos(
- unzFile file,
- unz_file_pos* file_pos);
-
-extern int ZEXPORT unzGoToFilePos(
- unzFile file,
- unz_file_pos* file_pos);
-
-/* ****************************************** */
-
-extern int ZEXPORT unzGetCurrentFileInfo (unzFile file,
- unz_file_info *pfile_info,
- char *szFileName,
- uLong fileNameBufferSize,
- void *extraField,
- uLong extraFieldBufferSize,
- char *szComment,
- uLong commentBufferSize);
-/*
- Get Info about the current file
- if pfile_info!=NULL, the *pfile_info structure will contain somes info about
- the current file
- if szFileName!=NULL, the filemane string will be copied in szFileName
- (fileNameBufferSize is the size of the buffer)
- if extraField!=NULL, the extra field information will be copied in extraField
- (extraFieldBufferSize is the size of the buffer).
- This is the Central-header version of the extra field
- if szComment!=NULL, the comment string of the file will be copied in szComment
- (commentBufferSize is the size of the buffer)
-*/
-
-/***************************************************************************/
-/* for reading the content of the current zipfile, you can open it, read data
- from it, and close it (you can close it before reading all the file)
- */
-
-extern int ZEXPORT unzOpenCurrentFile (unzFile file);
-/*
- Open for reading data the current file in the zipfile.
- If there is no error, the return value is UNZ_OK.
-*/
-
-extern int ZEXPORT unzOpenCurrentFilePassword (unzFile file,
- const char* password);
-/*
- Open for reading data the current file in the zipfile.
- password is a crypting password
- If there is no error, the return value is UNZ_OK.
-*/
-
-extern int ZEXPORT unzOpenCurrentFile2 (unzFile file,
- int* method,
- int* level,
- int raw);
-/*
- Same than unzOpenCurrentFile, but open for read raw the file (not uncompress)
- if raw==1
- *method will receive method of compression, *level will receive level of
- compression
- note : you can set level parameter as NULL (if you did not want known level,
- but you CANNOT set method parameter as NULL
-*/
-
-extern int ZEXPORT unzOpenCurrentFile3 (unzFile file,
- int* method,
- int* level,
- int raw,
- const char* password);
-/*
- Same than unzOpenCurrentFile, but open for read raw the file (not uncompress)
- if raw==1
- *method will receive method of compression, *level will receive level of
- compression
- note : you can set level parameter as NULL (if you did not want known level,
- but you CANNOT set method parameter as NULL
-*/
-
-
-extern int ZEXPORT unzCloseCurrentFile (unzFile file);
-/*
- Close the file in zip opened with unzOpenCurrentFile
- Return UNZ_CRCERROR if all the file was read but the CRC is not good
-*/
-
-extern int ZEXPORT unzReadCurrentFile (unzFile file,
- voidp buf,
- unsigned len);
-/*
- Read bytes from the current file (opened by unzOpenCurrentFile)
- buf contain buffer where data must be copied
- len the size of buf.
-
- return the number of byte copied if somes bytes are copied
- return 0 if the end of file was reached
- return <0 with error code if there is an error
- (UNZ_ERRNO for IO error, or zLib error for uncompress error)
-*/
-
-extern z_off_t ZEXPORT unztell (unzFile file);
-/*
- Give the current position in uncompressed data
-*/
-
-extern int ZEXPORT unzeof (unzFile file);
-/*
- return 1 if the end of file was reached, 0 elsewhere
-*/
-
-extern int ZEXPORT unzGetLocalExtrafield (unzFile file,
- voidp buf,
- unsigned len);
-/*
- Read extra field from the current file (opened by unzOpenCurrentFile)
- This is the local-header version of the extra field (sometimes, there is
- more info in the local-header version than in the central-header)
-
- if buf==NULL, it return the size of the local extra field
-
- if buf!=NULL, len is the size of the buffer, the extra header is copied in
- buf.
- the return value is the number of bytes copied in buf, or (if <0)
- the error code
-*/
-
-/***************************************************************************/
-
-/* Get the current file offset */
-extern uLong ZEXPORT unzGetOffset (unzFile file);
-
-/* Set the current file offset */
-extern int ZEXPORT unzSetOffset (unzFile file, uLong pos);
-
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _unz_H */
diff --git a/3rdparty/assimp/contrib/zlib/README b/3rdparty/assimp/contrib/zlib/README
deleted file mode 100644
index d4219bf8..00000000
--- a/3rdparty/assimp/contrib/zlib/README
+++ /dev/null
@@ -1,115 +0,0 @@
-ZLIB DATA COMPRESSION LIBRARY
-
-zlib 1.2.5 is a general purpose data compression library. All the code is
-thread safe. The data format used by the zlib library is described by RFCs
-(Request for Comments) 1950 to 1952 in the files
-http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format)
-and rfc1952.txt (gzip format).
-
-All functions of the compression library are documented in the file zlib.h
-(volunteer to write man pages welcome, contact zlib@gzip.org). A usage example
-of the library is given in the file example.c which also tests that the library
-is working correctly. Another example is given in the file minigzip.c. The
-compression library itself is composed of all source files except example.c and
-minigzip.c.
-
-To compile all files and run the test program, follow the instructions given at
-the top of Makefile.in. In short "./configure; make test", and if that goes
-well, "make install" should work for most flavors of Unix. For Windows, use one
-of the special makefiles in win32/ or contrib/vstudio/ . For VMS, use
-make_vms.com.
-
-Questions about zlib should be sent to <zlib@gzip.org>, or to Gilles Vollant
-<info@winimage.com> for the Windows DLL version. The zlib home page is
-http://zlib.net/ . Before reporting a problem, please check this site to
-verify that you have the latest version of zlib; otherwise get the latest
-version and check whether the problem still exists or not.
-
-PLEASE read the zlib FAQ http://zlib.net/zlib_faq.html before asking for help.
-
-Mark Nelson <markn@ieee.org> wrote an article about zlib for the Jan. 1997
-issue of Dr. Dobb's Journal; a copy of the article is available at
-http://marknelson.us/1997/01/01/zlib-engine/ .
-
-The changes made in version 1.2.5 are documented in the file ChangeLog.
-
-Unsupported third party contributions are provided in directory contrib/ .
-
-zlib is available in Java using the java.util.zip package, documented at
-http://java.sun.com/developer/technicalArticles/Programming/compression/ .
-
-A Perl interface to zlib written by Paul Marquess <pmqs@cpan.org> is available
-at CPAN (Comprehensive Perl Archive Network) sites, including
-http://search.cpan.org/~pmqs/IO-Compress-Zlib/ .
-
-A Python interface to zlib written by A.M. Kuchling <amk@amk.ca> is
-available in Python 1.5 and later versions, see
-http://www.python.org/doc/lib/module-zlib.html .
-
-zlib is built into tcl: http://wiki.tcl.tk/4610 .
-
-An experimental package to read and write files in .zip format, written on top
-of zlib by Gilles Vollant <info@winimage.com>, is available in the
-contrib/minizip directory of zlib.
-
-
-Notes for some targets:
-
-- For Windows DLL versions, please see win32/DLL_FAQ.txt
-
-- For 64-bit Irix, deflate.c must be compiled without any optimization. With
- -O, one libpng test fails. The test works in 32 bit mode (with the -n32
- compiler flag). The compiler bug has been reported to SGI.
-
-- zlib doesn't work with gcc 2.6.3 on a DEC 3000/300LX under OSF/1 2.1 it works
- when compiled with cc.
-
-- On Digital Unix 4.0D (formely OSF/1) on AlphaServer, the cc option -std1 is
- necessary to get gzprintf working correctly. This is done by configure.
-
-- zlib doesn't work on HP-UX 9.05 with some versions of /bin/cc. It works with
- other compilers. Use "make test" to check your compiler.
-
-- gzdopen is not supported on RISCOS or BEOS.
-
-- For PalmOs, see http://palmzlib.sourceforge.net/
-
-
-Acknowledgments:
-
- The deflate format used by zlib was defined by Phil Katz. The deflate and
- zlib specifications were written by L. Peter Deutsch. Thanks to all the
- people who reported problems and suggested various improvements in zlib; they
- are too numerous to cite here.
-
-Copyright notice:
-
- (C) 1995-2010 Jean-loup Gailly and Mark Adler
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-
- Jean-loup Gailly Mark Adler
- jloup@gzip.org madler@alumni.caltech.edu
-
-If you use the zlib library in a product, we would appreciate *not* receiving
-lengthy legal documents to sign. The sources are provided for free but without
-warranty of any kind. The library has been entirely written by Jean-loup
-Gailly and Mark Adler; it does not include third-party code.
-
-If you redistribute modified sources, we would appreciate that you include in
-the file ChangeLog history information documenting your changes. Please read
-the FAQ for more information on the distribution of modified source versions.
diff --git a/3rdparty/assimp/contrib/zlib/adler32.c b/3rdparty/assimp/contrib/zlib/adler32.c
deleted file mode 100644
index 65ad6a5a..00000000
--- a/3rdparty/assimp/contrib/zlib/adler32.c
+++ /dev/null
@@ -1,169 +0,0 @@
-/* adler32.c -- compute the Adler-32 checksum of a data stream
- * Copyright (C) 1995-2007 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* @(#) $Id$ */
-
-#include "zutil.h"
-
-#define local static
-
-local uLong adler32_combine_(uLong adler1, uLong adler2, z_off64_t len2);
-
-#define BASE 65521UL /* largest prime smaller than 65536 */
-#define NMAX 5552
-/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
-
-#define DO1(buf,i) {adler += (buf)[i]; sum2 += adler;}
-#define DO2(buf,i) DO1(buf,i); DO1(buf,i+1);
-#define DO4(buf,i) DO2(buf,i); DO2(buf,i+2);
-#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4);
-#define DO16(buf) DO8(buf,0); DO8(buf,8);
-
-/* use NO_DIVIDE if your processor does not do division in hardware */
-#ifdef NO_DIVIDE
-# define MOD(a) \
- do { \
- if (a >= (BASE << 16)) a -= (BASE << 16); \
- if (a >= (BASE << 15)) a -= (BASE << 15); \
- if (a >= (BASE << 14)) a -= (BASE << 14); \
- if (a >= (BASE << 13)) a -= (BASE << 13); \
- if (a >= (BASE << 12)) a -= (BASE << 12); \
- if (a >= (BASE << 11)) a -= (BASE << 11); \
- if (a >= (BASE << 10)) a -= (BASE << 10); \
- if (a >= (BASE << 9)) a -= (BASE << 9); \
- if (a >= (BASE << 8)) a -= (BASE << 8); \
- if (a >= (BASE << 7)) a -= (BASE << 7); \
- if (a >= (BASE << 6)) a -= (BASE << 6); \
- if (a >= (BASE << 5)) a -= (BASE << 5); \
- if (a >= (BASE << 4)) a -= (BASE << 4); \
- if (a >= (BASE << 3)) a -= (BASE << 3); \
- if (a >= (BASE << 2)) a -= (BASE << 2); \
- if (a >= (BASE << 1)) a -= (BASE << 1); \
- if (a >= BASE) a -= BASE; \
- } while (0)
-# define MOD4(a) \
- do { \
- if (a >= (BASE << 4)) a -= (BASE << 4); \
- if (a >= (BASE << 3)) a -= (BASE << 3); \
- if (a >= (BASE << 2)) a -= (BASE << 2); \
- if (a >= (BASE << 1)) a -= (BASE << 1); \
- if (a >= BASE) a -= BASE; \
- } while (0)
-#else
-# define MOD(a) a %= BASE
-# define MOD4(a) a %= BASE
-#endif
-
-/* ========================================================================= */
-uLong ZEXPORT adler32(adler, buf, len)
- uLong adler;
- const Bytef *buf;
- uInt len;
-{
- unsigned long sum2;
- unsigned n;
-
- /* split Adler-32 into component sums */
- sum2 = (adler >> 16) & 0xffff;
- adler &= 0xffff;
-
- /* in case user likes doing a byte at a time, keep it fast */
- if (len == 1) {
- adler += buf[0];
- if (adler >= BASE)
- adler -= BASE;
- sum2 += adler;
- if (sum2 >= BASE)
- sum2 -= BASE;
- return adler | (sum2 << 16);
- }
-
- /* initial Adler-32 value (deferred check for len == 1 speed) */
- if (buf == Z_NULL)
- return 1L;
-
- /* in case short lengths are provided, keep it somewhat fast */
- if (len < 16) {
- while (len--) {
- adler += *buf++;
- sum2 += adler;
- }
- if (adler >= BASE)
- adler -= BASE;
- MOD4(sum2); /* only added so many BASE's */
- return adler | (sum2 << 16);
- }
-
- /* do length NMAX blocks -- requires just one modulo operation */
- while (len >= NMAX) {
- len -= NMAX;
- n = NMAX / 16; /* NMAX is divisible by 16 */
- do {
- DO16(buf); /* 16 sums unrolled */
- buf += 16;
- } while (--n);
- MOD(adler);
- MOD(sum2);
- }
-
- /* do remaining bytes (less than NMAX, still just one modulo) */
- if (len) { /* avoid modulos if none remaining */
- while (len >= 16) {
- len -= 16;
- DO16(buf);
- buf += 16;
- }
- while (len--) {
- adler += *buf++;
- sum2 += adler;
- }
- MOD(adler);
- MOD(sum2);
- }
-
- /* return recombined sums */
- return adler | (sum2 << 16);
-}
-
-/* ========================================================================= */
-local uLong adler32_combine_(adler1, adler2, len2)
- uLong adler1;
- uLong adler2;
- z_off64_t len2;
-{
- unsigned long sum1;
- unsigned long sum2;
- unsigned rem;
-
- /* the derivation of this formula is left as an exercise for the reader */
- rem = (unsigned)(len2 % BASE);
- sum1 = adler1 & 0xffff;
- sum2 = rem * sum1;
- MOD(sum2);
- sum1 += (adler2 & 0xffff) + BASE - 1;
- sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + BASE - rem;
- if (sum1 >= BASE) sum1 -= BASE;
- if (sum1 >= BASE) sum1 -= BASE;
- if (sum2 >= (BASE << 1)) sum2 -= (BASE << 1);
- if (sum2 >= BASE) sum2 -= BASE;
- return sum1 | (sum2 << 16);
-}
-
-/* ========================================================================= */
-uLong ZEXPORT adler32_combine(adler1, adler2, len2)
- uLong adler1;
- uLong adler2;
- z_off_t len2;
-{
- return adler32_combine_(adler1, adler2, len2);
-}
-
-uLong ZEXPORT adler32_combine64(adler1, adler2, len2)
- uLong adler1;
- uLong adler2;
- z_off64_t len2;
-{
- return adler32_combine_(adler1, adler2, len2);
-}
diff --git a/3rdparty/assimp/contrib/zlib/compress.c b/3rdparty/assimp/contrib/zlib/compress.c
deleted file mode 100644
index ea4dfbe9..00000000
--- a/3rdparty/assimp/contrib/zlib/compress.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/* compress.c -- compress a memory buffer
- * Copyright (C) 1995-2005 Jean-loup Gailly.
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* @(#) $Id$ */
-
-#define ZLIB_INTERNAL
-#include "zlib.h"
-
-/* ===========================================================================
- Compresses the source buffer into the destination buffer. The level
- parameter has the same meaning as in deflateInit. sourceLen is the byte
- length of the source buffer. Upon entry, destLen is the total size of the
- destination buffer, which must be at least 0.1% larger than sourceLen plus
- 12 bytes. Upon exit, destLen is the actual size of the compressed buffer.
-
- compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
- memory, Z_BUF_ERROR if there was not enough room in the output buffer,
- Z_STREAM_ERROR if the level parameter is invalid.
-*/
-int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
- Bytef *dest;
- uLongf *destLen;
- const Bytef *source;
- uLong sourceLen;
- int level;
-{
- z_stream stream;
- int err;
-
- stream.next_in = (Bytef*)source;
- stream.avail_in = (uInt)sourceLen;
-#ifdef MAXSEG_64K
- /* Check for source > 64K on 16-bit machine: */
- if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;
-#endif
- stream.next_out = dest;
- stream.avail_out = (uInt)*destLen;
- if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR;
-
- stream.zalloc = (alloc_func)0;
- stream.zfree = (free_func)0;
- stream.opaque = (voidpf)0;
-
- err = deflateInit(&stream, level);
- if (err != Z_OK) return err;
-
- err = deflate(&stream, Z_FINISH);
- if (err != Z_STREAM_END) {
- deflateEnd(&stream);
- return err == Z_OK ? Z_BUF_ERROR : err;
- }
- *destLen = stream.total_out;
-
- err = deflateEnd(&stream);
- return err;
-}
-
-/* ===========================================================================
- */
-int ZEXPORT compress (dest, destLen, source, sourceLen)
- Bytef *dest;
- uLongf *destLen;
- const Bytef *source;
- uLong sourceLen;
-{
- return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION);
-}
-
-/* ===========================================================================
- If the default memLevel or windowBits for deflateInit() is changed, then
- this function needs to be updated.
- */
-uLong ZEXPORT compressBound (sourceLen)
- uLong sourceLen;
-{
- return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
- (sourceLen >> 25) + 13;
-}
diff --git a/3rdparty/assimp/contrib/zlib/crc32.c b/3rdparty/assimp/contrib/zlib/crc32.c
deleted file mode 100644
index 91be372d..00000000
--- a/3rdparty/assimp/contrib/zlib/crc32.c
+++ /dev/null
@@ -1,442 +0,0 @@
-/* crc32.c -- compute the CRC-32 of a data stream
- * Copyright (C) 1995-2006, 2010 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- *
- * Thanks to Rodney Brown <rbrown64@csc.com.au> for his contribution of faster
- * CRC methods: exclusive-oring 32 bits of data at a time, and pre-computing
- * tables for updating the shift register in one step with three exclusive-ors
- * instead of four steps with four exclusive-ors. This results in about a
- * factor of two increase in speed on a Power PC G4 (PPC7455) using gcc -O3.
- */
-
-/* @(#) $Id$ */
-
-/*
- Note on the use of DYNAMIC_CRC_TABLE: there is no mutex or semaphore
- protection on the static variables used to control the first-use generation
- of the crc tables. Therefore, if you #define DYNAMIC_CRC_TABLE, you should
- first call get_crc_table() to initialize the tables before allowing more than
- one thread to use crc32().
- */
-
-#ifdef MAKECRCH
-# include <stdio.h>
-# ifndef DYNAMIC_CRC_TABLE
-# define DYNAMIC_CRC_TABLE
-# endif /* !DYNAMIC_CRC_TABLE */
-#endif /* MAKECRCH */
-
-#include "zutil.h" /* for STDC and FAR definitions */
-
-#define local static
-
-/* Find a four-byte integer type for crc32_little() and crc32_big(). */
-#ifndef NOBYFOUR
-# ifdef STDC /* need ANSI C limits.h to determine sizes */
-# include <limits.h>
-# define BYFOUR
-# if (UINT_MAX == 0xffffffffUL)
- typedef unsigned int u4;
-# else
-# if (ULONG_MAX == 0xffffffffUL)
- typedef unsigned long u4;
-# else
-# if (USHRT_MAX == 0xffffffffUL)
- typedef unsigned short u4;
-# else
-# undef BYFOUR /* can't find a four-byte integer type! */
-# endif
-# endif
-# endif
-# endif /* STDC */
-#endif /* !NOBYFOUR */
-
-/* Definitions for doing the crc four data bytes at a time. */
-#ifdef BYFOUR
-# define REV(w) ((((w)>>24)&0xff)+(((w)>>8)&0xff00)+ \
- (((w)&0xff00)<<8)+(((w)&0xff)<<24))
- local unsigned long crc32_little OF((unsigned long,
- const unsigned char FAR *, unsigned));
- local unsigned long crc32_big OF((unsigned long,
- const unsigned char FAR *, unsigned));
-# define TBLS 8
-#else
-# define TBLS 1
-#endif /* BYFOUR */
-
-/* Local functions for crc concatenation */
-local unsigned long gf2_matrix_times OF((unsigned long *mat,
- unsigned long vec));
-local void gf2_matrix_square OF((unsigned long *square, unsigned long *mat));
-local uLong crc32_combine_(uLong crc1, uLong crc2, z_off64_t len2);
-
-
-#ifdef DYNAMIC_CRC_TABLE
-
-local volatile int crc_table_empty = 1;
-local unsigned long FAR crc_table[TBLS][256];
-local void make_crc_table OF((void));
-#ifdef MAKECRCH
- local void write_table OF((FILE *, const unsigned long FAR *));
-#endif /* MAKECRCH */
-/*
- Generate tables for a byte-wise 32-bit CRC calculation on the polynomial:
- x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1.
-
- Polynomials over GF(2) are represented in binary, one bit per coefficient,
- with the lowest powers in the most significant bit. Then adding polynomials
- is just exclusive-or, and multiplying a polynomial by x is a right shift by
- one. If we call the above polynomial p, and represent a byte as the
- polynomial q, also with the lowest power in the most significant bit (so the
- byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p,
- where a mod b means the remainder after dividing a by b.
-
- This calculation is done using the shift-register method of multiplying and
- taking the remainder. The register is initialized to zero, and for each
- incoming bit, x^32 is added mod p to the register if the bit is a one (where
- x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by
- x (which is shifting right by one and adding x^32 mod p if the bit shifted
- out is a one). We start with the highest power (least significant bit) of
- q and repeat for all eight bits of q.
-
- The first table is simply the CRC of all possible eight bit values. This is
- all the information needed to generate CRCs on data a byte at a time for all
- combinations of CRC register values and incoming bytes. The remaining tables
- allow for word-at-a-time CRC calculation for both big-endian and little-
- endian machines, where a word is four bytes.
-*/
-local void make_crc_table()
-{
- unsigned long c;
- int n, k;
- unsigned long poly; /* polynomial exclusive-or pattern */
- /* terms of polynomial defining this crc (except x^32): */
- static volatile int first = 1; /* flag to limit concurrent making */
- static const unsigned char p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26};
-
- /* See if another task is already doing this (not thread-safe, but better
- than nothing -- significantly reduces duration of vulnerability in
- case the advice about DYNAMIC_CRC_TABLE is ignored) */
- if (first) {
- first = 0;
-
- /* make exclusive-or pattern from polynomial (0xedb88320UL) */
- poly = 0UL;
- for (n = 0; n < sizeof(p)/sizeof(unsigned char); n++)
- poly |= 1UL << (31 - p[n]);
-
- /* generate a crc for every 8-bit value */
- for (n = 0; n < 256; n++) {
- c = (unsigned long)n;
- for (k = 0; k < 8; k++)
- c = c & 1 ? poly ^ (c >> 1) : c >> 1;
- crc_table[0][n] = c;
- }
-
-#ifdef BYFOUR
- /* generate crc for each value followed by one, two, and three zeros,
- and then the byte reversal of those as well as the first table */
- for (n = 0; n < 256; n++) {
- c = crc_table[0][n];
- crc_table[4][n] = REV(c);
- for (k = 1; k < 4; k++) {
- c = crc_table[0][c & 0xff] ^ (c >> 8);
- crc_table[k][n] = c;
- crc_table[k + 4][n] = REV(c);
- }
- }
-#endif /* BYFOUR */
-
- crc_table_empty = 0;
- }
- else { /* not first */
- /* wait for the other guy to finish (not efficient, but rare) */
- while (crc_table_empty)
- ;
- }
-
-#ifdef MAKECRCH
- /* write out CRC tables to crc32.h */
- {
- FILE *out;
-
- out = fopen("crc32.h", "w");
- if (out == NULL) return;
- fprintf(out, "/* crc32.h -- tables for rapid CRC calculation\n");
- fprintf(out, " * Generated automatically by crc32.c\n */\n\n");
- fprintf(out, "local const unsigned long FAR ");
- fprintf(out, "crc_table[TBLS][256] =\n{\n {\n");
- write_table(out, crc_table[0]);
-# ifdef BYFOUR
- fprintf(out, "#ifdef BYFOUR\n");
- for (k = 1; k < 8; k++) {
- fprintf(out, " },\n {\n");
- write_table(out, crc_table[k]);
- }
- fprintf(out, "#endif\n");
-# endif /* BYFOUR */
- fprintf(out, " }\n};\n");
- fclose(out);
- }
-#endif /* MAKECRCH */
-}
-
-#ifdef MAKECRCH
-local void write_table(out, table)
- FILE *out;
- const unsigned long FAR *table;
-{
- int n;
-
- for (n = 0; n < 256; n++)
- fprintf(out, "%s0x%08lxUL%s", n % 5 ? "" : " ", table[n],
- n == 255 ? "\n" : (n % 5 == 4 ? ",\n" : ", "));
-}
-#endif /* MAKECRCH */
-
-#else /* !DYNAMIC_CRC_TABLE */
-/* ========================================================================
- * Tables of CRC-32s of all single-byte values, made by make_crc_table().
- */
-#include "crc32.h"
-#endif /* DYNAMIC_CRC_TABLE */
-
-/* =========================================================================
- * This function can be used by asm versions of crc32()
- */
-const unsigned long FAR * ZEXPORT get_crc_table()
-{
-#ifdef DYNAMIC_CRC_TABLE
- if (crc_table_empty)
- make_crc_table();
-#endif /* DYNAMIC_CRC_TABLE */
- return (const unsigned long FAR *)crc_table;
-}
-
-/* ========================================================================= */
-#define DO1 crc = crc_table[0][((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8)
-#define DO8 DO1; DO1; DO1; DO1; DO1; DO1; DO1; DO1
-
-/* ========================================================================= */
-unsigned long ZEXPORT crc32(crc, buf, len)
- unsigned long crc;
- const unsigned char FAR *buf;
- uInt len;
-{
- if (buf == Z_NULL) return 0UL;
-
-#ifdef DYNAMIC_CRC_TABLE
- if (crc_table_empty)
- make_crc_table();
-#endif /* DYNAMIC_CRC_TABLE */
-
-#ifdef BYFOUR
- if (sizeof(void *) == sizeof(ptrdiff_t)) {
- u4 endian;
-
- endian = 1;
- if (*((unsigned char *)(&endian)))
- return crc32_little(crc, buf, len);
- else
- return crc32_big(crc, buf, len);
- }
-#endif /* BYFOUR */
- crc = crc ^ 0xffffffffUL;
- while (len >= 8) {
- DO8;
- len -= 8;
- }
- if (len) do {
- DO1;
- } while (--len);
- return crc ^ 0xffffffffUL;
-}
-
-#ifdef BYFOUR
-
-/* ========================================================================= */
-#define DOLIT4 c ^= *buf4++; \
- c = crc_table[3][c & 0xff] ^ crc_table[2][(c >> 8) & 0xff] ^ \
- crc_table[1][(c >> 16) & 0xff] ^ crc_table[0][c >> 24]
-#define DOLIT32 DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4
-
-/* ========================================================================= */
-local unsigned long crc32_little(crc, buf, len)
- unsigned long crc;
- const unsigned char FAR *buf;
- unsigned len;
-{
- register u4 c;
- register const u4 FAR *buf4;
-
- c = (u4)crc;
- c = ~c;
- while (len && ((ptrdiff_t)buf & 3)) {
- c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);
- len--;
- }
-
- buf4 = (const u4 FAR *)(const void FAR *)buf;
- while (len >= 32) {
- DOLIT32;
- len -= 32;
- }
- while (len >= 4) {
- DOLIT4;
- len -= 4;
- }
- buf = (const unsigned char FAR *)buf4;
-
- if (len) do {
- c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);
- } while (--len);
- c = ~c;
- return (unsigned long)c;
-}
-
-/* ========================================================================= */
-#define DOBIG4 c ^= *++buf4; \
- c = crc_table[4][c & 0xff] ^ crc_table[5][(c >> 8) & 0xff] ^ \
- crc_table[6][(c >> 16) & 0xff] ^ crc_table[7][c >> 24]
-#define DOBIG32 DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4
-
-/* ========================================================================= */
-local unsigned long crc32_big(crc, buf, len)
- unsigned long crc;
- const unsigned char FAR *buf;
- unsigned len;
-{
- register u4 c;
- register const u4 FAR *buf4;
-
- c = REV((u4)crc);
- c = ~c;
- while (len && ((ptrdiff_t)buf & 3)) {
- c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
- len--;
- }
-
- buf4 = (const u4 FAR *)(const void FAR *)buf;
- buf4--;
- while (len >= 32) {
- DOBIG32;
- len -= 32;
- }
- while (len >= 4) {
- DOBIG4;
- len -= 4;
- }
- buf4++;
- buf = (const unsigned char FAR *)buf4;
-
- if (len) do {
- c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
- } while (--len);
- c = ~c;
- return (unsigned long)(REV(c));
-}
-
-#endif /* BYFOUR */
-
-#define GF2_DIM 32 /* dimension of GF(2) vectors (length of CRC) */
-
-/* ========================================================================= */
-local unsigned long gf2_matrix_times(mat, vec)
- unsigned long *mat;
- unsigned long vec;
-{
- unsigned long sum;
-
- sum = 0;
- while (vec) {
- if (vec & 1)
- sum ^= *mat;
- vec >>= 1;
- mat++;
- }
- return sum;
-}
-
-/* ========================================================================= */
-local void gf2_matrix_square(square, mat)
- unsigned long *square;
- unsigned long *mat;
-{
- int n;
-
- for (n = 0; n < GF2_DIM; n++)
- square[n] = gf2_matrix_times(mat, mat[n]);
-}
-
-/* ========================================================================= */
-local uLong crc32_combine_(crc1, crc2, len2)
- uLong crc1;
- uLong crc2;
- z_off64_t len2;
-{
- int n;
- unsigned long row;
- unsigned long even[GF2_DIM]; /* even-power-of-two zeros operator */
- unsigned long odd[GF2_DIM]; /* odd-power-of-two zeros operator */
-
- /* degenerate case (also disallow negative lengths) */
- if (len2 <= 0)
- return crc1;
-
- /* put operator for one zero bit in odd */
- odd[0] = 0xedb88320UL; /* CRC-32 polynomial */
- row = 1;
- for (n = 1; n < GF2_DIM; n++) {
- odd[n] = row;
- row <<= 1;
- }
-
- /* put operator for two zero bits in even */
- gf2_matrix_square(even, odd);
-
- /* put operator for four zero bits in odd */
- gf2_matrix_square(odd, even);
-
- /* apply len2 zeros to crc1 (first square will put the operator for one
- zero byte, eight zero bits, in even) */
- do {
- /* apply zeros operator for this bit of len2 */
- gf2_matrix_square(even, odd);
- if (len2 & 1)
- crc1 = gf2_matrix_times(even, crc1);
- len2 >>= 1;
-
- /* if no more bits set, then done */
- if (len2 == 0)
- break;
-
- /* another iteration of the loop with odd and even swapped */
- gf2_matrix_square(odd, even);
- if (len2 & 1)
- crc1 = gf2_matrix_times(odd, crc1);
- len2 >>= 1;
-
- /* if no more bits set, then done */
- } while (len2 != 0);
-
- /* return combined crc */
- crc1 ^= crc2;
- return crc1;
-}
-
-/* ========================================================================= */
-uLong ZEXPORT crc32_combine(crc1, crc2, len2)
- uLong crc1;
- uLong crc2;
- z_off_t len2;
-{
- return crc32_combine_(crc1, crc2, len2);
-}
-
-uLong ZEXPORT crc32_combine64(crc1, crc2, len2)
- uLong crc1;
- uLong crc2;
- z_off64_t len2;
-{
- return crc32_combine_(crc1, crc2, len2);
-}
diff --git a/3rdparty/assimp/contrib/zlib/crc32.h b/3rdparty/assimp/contrib/zlib/crc32.h
deleted file mode 100644
index 8053b611..00000000
--- a/3rdparty/assimp/contrib/zlib/crc32.h
+++ /dev/null
@@ -1,441 +0,0 @@
-/* crc32.h -- tables for rapid CRC calculation
- * Generated automatically by crc32.c
- */
-
-local const unsigned long FAR crc_table[TBLS][256] =
-{
- {
- 0x00000000UL, 0x77073096UL, 0xee0e612cUL, 0x990951baUL, 0x076dc419UL,
- 0x706af48fUL, 0xe963a535UL, 0x9e6495a3UL, 0x0edb8832UL, 0x79dcb8a4UL,
- 0xe0d5e91eUL, 0x97d2d988UL, 0x09b64c2bUL, 0x7eb17cbdUL, 0xe7b82d07UL,
- 0x90bf1d91UL, 0x1db71064UL, 0x6ab020f2UL, 0xf3b97148UL, 0x84be41deUL,
- 0x1adad47dUL, 0x6ddde4ebUL, 0xf4d4b551UL, 0x83d385c7UL, 0x136c9856UL,
- 0x646ba8c0UL, 0xfd62f97aUL, 0x8a65c9ecUL, 0x14015c4fUL, 0x63066cd9UL,
- 0xfa0f3d63UL, 0x8d080df5UL, 0x3b6e20c8UL, 0x4c69105eUL, 0xd56041e4UL,
- 0xa2677172UL, 0x3c03e4d1UL, 0x4b04d447UL, 0xd20d85fdUL, 0xa50ab56bUL,
- 0x35b5a8faUL, 0x42b2986cUL, 0xdbbbc9d6UL, 0xacbcf940UL, 0x32d86ce3UL,
- 0x45df5c75UL, 0xdcd60dcfUL, 0xabd13d59UL, 0x26d930acUL, 0x51de003aUL,
- 0xc8d75180UL, 0xbfd06116UL, 0x21b4f4b5UL, 0x56b3c423UL, 0xcfba9599UL,
- 0xb8bda50fUL, 0x2802b89eUL, 0x5f058808UL, 0xc60cd9b2UL, 0xb10be924UL,
- 0x2f6f7c87UL, 0x58684c11UL, 0xc1611dabUL, 0xb6662d3dUL, 0x76dc4190UL,
- 0x01db7106UL, 0x98d220bcUL, 0xefd5102aUL, 0x71b18589UL, 0x06b6b51fUL,
- 0x9fbfe4a5UL, 0xe8b8d433UL, 0x7807c9a2UL, 0x0f00f934UL, 0x9609a88eUL,
- 0xe10e9818UL, 0x7f6a0dbbUL, 0x086d3d2dUL, 0x91646c97UL, 0xe6635c01UL,
- 0x6b6b51f4UL, 0x1c6c6162UL, 0x856530d8UL, 0xf262004eUL, 0x6c0695edUL,
- 0x1b01a57bUL, 0x8208f4c1UL, 0xf50fc457UL, 0x65b0d9c6UL, 0x12b7e950UL,
- 0x8bbeb8eaUL, 0xfcb9887cUL, 0x62dd1ddfUL, 0x15da2d49UL, 0x8cd37cf3UL,
- 0xfbd44c65UL, 0x4db26158UL, 0x3ab551ceUL, 0xa3bc0074UL, 0xd4bb30e2UL,
- 0x4adfa541UL, 0x3dd895d7UL, 0xa4d1c46dUL, 0xd3d6f4fbUL, 0x4369e96aUL,
- 0x346ed9fcUL, 0xad678846UL, 0xda60b8d0UL, 0x44042d73UL, 0x33031de5UL,
- 0xaa0a4c5fUL, 0xdd0d7cc9UL, 0x5005713cUL, 0x270241aaUL, 0xbe0b1010UL,
- 0xc90c2086UL, 0x5768b525UL, 0x206f85b3UL, 0xb966d409UL, 0xce61e49fUL,
- 0x5edef90eUL, 0x29d9c998UL, 0xb0d09822UL, 0xc7d7a8b4UL, 0x59b33d17UL,
- 0x2eb40d81UL, 0xb7bd5c3bUL, 0xc0ba6cadUL, 0xedb88320UL, 0x9abfb3b6UL,
- 0x03b6e20cUL, 0x74b1d29aUL, 0xead54739UL, 0x9dd277afUL, 0x04db2615UL,
- 0x73dc1683UL, 0xe3630b12UL, 0x94643b84UL, 0x0d6d6a3eUL, 0x7a6a5aa8UL,
- 0xe40ecf0bUL, 0x9309ff9dUL, 0x0a00ae27UL, 0x7d079eb1UL, 0xf00f9344UL,
- 0x8708a3d2UL, 0x1e01f268UL, 0x6906c2feUL, 0xf762575dUL, 0x806567cbUL,
- 0x196c3671UL, 0x6e6b06e7UL, 0xfed41b76UL, 0x89d32be0UL, 0x10da7a5aUL,
- 0x67dd4accUL, 0xf9b9df6fUL, 0x8ebeeff9UL, 0x17b7be43UL, 0x60b08ed5UL,
- 0xd6d6a3e8UL, 0xa1d1937eUL, 0x38d8c2c4UL, 0x4fdff252UL, 0xd1bb67f1UL,
- 0xa6bc5767UL, 0x3fb506ddUL, 0x48b2364bUL, 0xd80d2bdaUL, 0xaf0a1b4cUL,
- 0x36034af6UL, 0x41047a60UL, 0xdf60efc3UL, 0xa867df55UL, 0x316e8eefUL,
- 0x4669be79UL, 0xcb61b38cUL, 0xbc66831aUL, 0x256fd2a0UL, 0x5268e236UL,
- 0xcc0c7795UL, 0xbb0b4703UL, 0x220216b9UL, 0x5505262fUL, 0xc5ba3bbeUL,
- 0xb2bd0b28UL, 0x2bb45a92UL, 0x5cb36a04UL, 0xc2d7ffa7UL, 0xb5d0cf31UL,
- 0x2cd99e8bUL, 0x5bdeae1dUL, 0x9b64c2b0UL, 0xec63f226UL, 0x756aa39cUL,
- 0x026d930aUL, 0x9c0906a9UL, 0xeb0e363fUL, 0x72076785UL, 0x05005713UL,
- 0x95bf4a82UL, 0xe2b87a14UL, 0x7bb12baeUL, 0x0cb61b38UL, 0x92d28e9bUL,
- 0xe5d5be0dUL, 0x7cdcefb7UL, 0x0bdbdf21UL, 0x86d3d2d4UL, 0xf1d4e242UL,
- 0x68ddb3f8UL, 0x1fda836eUL, 0x81be16cdUL, 0xf6b9265bUL, 0x6fb077e1UL,
- 0x18b74777UL, 0x88085ae6UL, 0xff0f6a70UL, 0x66063bcaUL, 0x11010b5cUL,
- 0x8f659effUL, 0xf862ae69UL, 0x616bffd3UL, 0x166ccf45UL, 0xa00ae278UL,
- 0xd70dd2eeUL, 0x4e048354UL, 0x3903b3c2UL, 0xa7672661UL, 0xd06016f7UL,
- 0x4969474dUL, 0x3e6e77dbUL, 0xaed16a4aUL, 0xd9d65adcUL, 0x40df0b66UL,
- 0x37d83bf0UL, 0xa9bcae53UL, 0xdebb9ec5UL, 0x47b2cf7fUL, 0x30b5ffe9UL,
- 0xbdbdf21cUL, 0xcabac28aUL, 0x53b39330UL, 0x24b4a3a6UL, 0xbad03605UL,
- 0xcdd70693UL, 0x54de5729UL, 0x23d967bfUL, 0xb3667a2eUL, 0xc4614ab8UL,
- 0x5d681b02UL, 0x2a6f2b94UL, 0xb40bbe37UL, 0xc30c8ea1UL, 0x5a05df1bUL,
- 0x2d02ef8dUL
-#ifdef BYFOUR
- },
- {
- 0x00000000UL, 0x191b3141UL, 0x32366282UL, 0x2b2d53c3UL, 0x646cc504UL,
- 0x7d77f445UL, 0x565aa786UL, 0x4f4196c7UL, 0xc8d98a08UL, 0xd1c2bb49UL,
- 0xfaefe88aUL, 0xe3f4d9cbUL, 0xacb54f0cUL, 0xb5ae7e4dUL, 0x9e832d8eUL,
- 0x87981ccfUL, 0x4ac21251UL, 0x53d92310UL, 0x78f470d3UL, 0x61ef4192UL,
- 0x2eaed755UL, 0x37b5e614UL, 0x1c98b5d7UL, 0x05838496UL, 0x821b9859UL,
- 0x9b00a918UL, 0xb02dfadbUL, 0xa936cb9aUL, 0xe6775d5dUL, 0xff6c6c1cUL,
- 0xd4413fdfUL, 0xcd5a0e9eUL, 0x958424a2UL, 0x8c9f15e3UL, 0xa7b24620UL,
- 0xbea97761UL, 0xf1e8e1a6UL, 0xe8f3d0e7UL, 0xc3de8324UL, 0xdac5b265UL,
- 0x5d5daeaaUL, 0x44469febUL, 0x6f6bcc28UL, 0x7670fd69UL, 0x39316baeUL,
- 0x202a5aefUL, 0x0b07092cUL, 0x121c386dUL, 0xdf4636f3UL, 0xc65d07b2UL,
- 0xed705471UL, 0xf46b6530UL, 0xbb2af3f7UL, 0xa231c2b6UL, 0x891c9175UL,
- 0x9007a034UL, 0x179fbcfbUL, 0x0e848dbaUL, 0x25a9de79UL, 0x3cb2ef38UL,
- 0x73f379ffUL, 0x6ae848beUL, 0x41c51b7dUL, 0x58de2a3cUL, 0xf0794f05UL,
- 0xe9627e44UL, 0xc24f2d87UL, 0xdb541cc6UL, 0x94158a01UL, 0x8d0ebb40UL,
- 0xa623e883UL, 0xbf38d9c2UL, 0x38a0c50dUL, 0x21bbf44cUL, 0x0a96a78fUL,
- 0x138d96ceUL, 0x5ccc0009UL, 0x45d73148UL, 0x6efa628bUL, 0x77e153caUL,
- 0xbabb5d54UL, 0xa3a06c15UL, 0x888d3fd6UL, 0x91960e97UL, 0xded79850UL,
- 0xc7cca911UL, 0xece1fad2UL, 0xf5facb93UL, 0x7262d75cUL, 0x6b79e61dUL,
- 0x4054b5deUL, 0x594f849fUL, 0x160e1258UL, 0x0f152319UL, 0x243870daUL,
- 0x3d23419bUL, 0x65fd6ba7UL, 0x7ce65ae6UL, 0x57cb0925UL, 0x4ed03864UL,
- 0x0191aea3UL, 0x188a9fe2UL, 0x33a7cc21UL, 0x2abcfd60UL, 0xad24e1afUL,
- 0xb43fd0eeUL, 0x9f12832dUL, 0x8609b26cUL, 0xc94824abUL, 0xd05315eaUL,
- 0xfb7e4629UL, 0xe2657768UL, 0x2f3f79f6UL, 0x362448b7UL, 0x1d091b74UL,
- 0x04122a35UL, 0x4b53bcf2UL, 0x52488db3UL, 0x7965de70UL, 0x607eef31UL,
- 0xe7e6f3feUL, 0xfefdc2bfUL, 0xd5d0917cUL, 0xcccba03dUL, 0x838a36faUL,
- 0x9a9107bbUL, 0xb1bc5478UL, 0xa8a76539UL, 0x3b83984bUL, 0x2298a90aUL,
- 0x09b5fac9UL, 0x10aecb88UL, 0x5fef5d4fUL, 0x46f46c0eUL, 0x6dd93fcdUL,
- 0x74c20e8cUL, 0xf35a1243UL, 0xea412302UL, 0xc16c70c1UL, 0xd8774180UL,
- 0x9736d747UL, 0x8e2de606UL, 0xa500b5c5UL, 0xbc1b8484UL, 0x71418a1aUL,
- 0x685abb5bUL, 0x4377e898UL, 0x5a6cd9d9UL, 0x152d4f1eUL, 0x0c367e5fUL,
- 0x271b2d9cUL, 0x3e001cddUL, 0xb9980012UL, 0xa0833153UL, 0x8bae6290UL,
- 0x92b553d1UL, 0xddf4c516UL, 0xc4eff457UL, 0xefc2a794UL, 0xf6d996d5UL,
- 0xae07bce9UL, 0xb71c8da8UL, 0x9c31de6bUL, 0x852aef2aUL, 0xca6b79edUL,
- 0xd37048acUL, 0xf85d1b6fUL, 0xe1462a2eUL, 0x66de36e1UL, 0x7fc507a0UL,
- 0x54e85463UL, 0x4df36522UL, 0x02b2f3e5UL, 0x1ba9c2a4UL, 0x30849167UL,
- 0x299fa026UL, 0xe4c5aeb8UL, 0xfdde9ff9UL, 0xd6f3cc3aUL, 0xcfe8fd7bUL,
- 0x80a96bbcUL, 0x99b25afdUL, 0xb29f093eUL, 0xab84387fUL, 0x2c1c24b0UL,
- 0x350715f1UL, 0x1e2a4632UL, 0x07317773UL, 0x4870e1b4UL, 0x516bd0f5UL,
- 0x7a468336UL, 0x635db277UL, 0xcbfad74eUL, 0xd2e1e60fUL, 0xf9ccb5ccUL,
- 0xe0d7848dUL, 0xaf96124aUL, 0xb68d230bUL, 0x9da070c8UL, 0x84bb4189UL,
- 0x03235d46UL, 0x1a386c07UL, 0x31153fc4UL, 0x280e0e85UL, 0x674f9842UL,
- 0x7e54a903UL, 0x5579fac0UL, 0x4c62cb81UL, 0x8138c51fUL, 0x9823f45eUL,
- 0xb30ea79dUL, 0xaa1596dcUL, 0xe554001bUL, 0xfc4f315aUL, 0xd7626299UL,
- 0xce7953d8UL, 0x49e14f17UL, 0x50fa7e56UL, 0x7bd72d95UL, 0x62cc1cd4UL,
- 0x2d8d8a13UL, 0x3496bb52UL, 0x1fbbe891UL, 0x06a0d9d0UL, 0x5e7ef3ecUL,
- 0x4765c2adUL, 0x6c48916eUL, 0x7553a02fUL, 0x3a1236e8UL, 0x230907a9UL,
- 0x0824546aUL, 0x113f652bUL, 0x96a779e4UL, 0x8fbc48a5UL, 0xa4911b66UL,
- 0xbd8a2a27UL, 0xf2cbbce0UL, 0xebd08da1UL, 0xc0fdde62UL, 0xd9e6ef23UL,
- 0x14bce1bdUL, 0x0da7d0fcUL, 0x268a833fUL, 0x3f91b27eUL, 0x70d024b9UL,
- 0x69cb15f8UL, 0x42e6463bUL, 0x5bfd777aUL, 0xdc656bb5UL, 0xc57e5af4UL,
- 0xee530937UL, 0xf7483876UL, 0xb809aeb1UL, 0xa1129ff0UL, 0x8a3fcc33UL,
- 0x9324fd72UL
- },
- {
- 0x00000000UL, 0x01c26a37UL, 0x0384d46eUL, 0x0246be59UL, 0x0709a8dcUL,
- 0x06cbc2ebUL, 0x048d7cb2UL, 0x054f1685UL, 0x0e1351b8UL, 0x0fd13b8fUL,
- 0x0d9785d6UL, 0x0c55efe1UL, 0x091af964UL, 0x08d89353UL, 0x0a9e2d0aUL,
- 0x0b5c473dUL, 0x1c26a370UL, 0x1de4c947UL, 0x1fa2771eUL, 0x1e601d29UL,
- 0x1b2f0bacUL, 0x1aed619bUL, 0x18abdfc2UL, 0x1969b5f5UL, 0x1235f2c8UL,
- 0x13f798ffUL, 0x11b126a6UL, 0x10734c91UL, 0x153c5a14UL, 0x14fe3023UL,
- 0x16b88e7aUL, 0x177ae44dUL, 0x384d46e0UL, 0x398f2cd7UL, 0x3bc9928eUL,
- 0x3a0bf8b9UL, 0x3f44ee3cUL, 0x3e86840bUL, 0x3cc03a52UL, 0x3d025065UL,
- 0x365e1758UL, 0x379c7d6fUL, 0x35dac336UL, 0x3418a901UL, 0x3157bf84UL,
- 0x3095d5b3UL, 0x32d36beaUL, 0x331101ddUL, 0x246be590UL, 0x25a98fa7UL,
- 0x27ef31feUL, 0x262d5bc9UL, 0x23624d4cUL, 0x22a0277bUL, 0x20e69922UL,
- 0x2124f315UL, 0x2a78b428UL, 0x2bbade1fUL, 0x29fc6046UL, 0x283e0a71UL,
- 0x2d711cf4UL, 0x2cb376c3UL, 0x2ef5c89aUL, 0x2f37a2adUL, 0x709a8dc0UL,
- 0x7158e7f7UL, 0x731e59aeUL, 0x72dc3399UL, 0x7793251cUL, 0x76514f2bUL,
- 0x7417f172UL, 0x75d59b45UL, 0x7e89dc78UL, 0x7f4bb64fUL, 0x7d0d0816UL,
- 0x7ccf6221UL, 0x798074a4UL, 0x78421e93UL, 0x7a04a0caUL, 0x7bc6cafdUL,
- 0x6cbc2eb0UL, 0x6d7e4487UL, 0x6f38fadeUL, 0x6efa90e9UL, 0x6bb5866cUL,
- 0x6a77ec5bUL, 0x68315202UL, 0x69f33835UL, 0x62af7f08UL, 0x636d153fUL,
- 0x612bab66UL, 0x60e9c151UL, 0x65a6d7d4UL, 0x6464bde3UL, 0x662203baUL,
- 0x67e0698dUL, 0x48d7cb20UL, 0x4915a117UL, 0x4b531f4eUL, 0x4a917579UL,
- 0x4fde63fcUL, 0x4e1c09cbUL, 0x4c5ab792UL, 0x4d98dda5UL, 0x46c49a98UL,
- 0x4706f0afUL, 0x45404ef6UL, 0x448224c1UL, 0x41cd3244UL, 0x400f5873UL,
- 0x4249e62aUL, 0x438b8c1dUL, 0x54f16850UL, 0x55330267UL, 0x5775bc3eUL,
- 0x56b7d609UL, 0x53f8c08cUL, 0x523aaabbUL, 0x507c14e2UL, 0x51be7ed5UL,
- 0x5ae239e8UL, 0x5b2053dfUL, 0x5966ed86UL, 0x58a487b1UL, 0x5deb9134UL,
- 0x5c29fb03UL, 0x5e6f455aUL, 0x5fad2f6dUL, 0xe1351b80UL, 0xe0f771b7UL,
- 0xe2b1cfeeUL, 0xe373a5d9UL, 0xe63cb35cUL, 0xe7fed96bUL, 0xe5b86732UL,
- 0xe47a0d05UL, 0xef264a38UL, 0xeee4200fUL, 0xeca29e56UL, 0xed60f461UL,
- 0xe82fe2e4UL, 0xe9ed88d3UL, 0xebab368aUL, 0xea695cbdUL, 0xfd13b8f0UL,
- 0xfcd1d2c7UL, 0xfe976c9eUL, 0xff5506a9UL, 0xfa1a102cUL, 0xfbd87a1bUL,
- 0xf99ec442UL, 0xf85cae75UL, 0xf300e948UL, 0xf2c2837fUL, 0xf0843d26UL,
- 0xf1465711UL, 0xf4094194UL, 0xf5cb2ba3UL, 0xf78d95faUL, 0xf64fffcdUL,
- 0xd9785d60UL, 0xd8ba3757UL, 0xdafc890eUL, 0xdb3ee339UL, 0xde71f5bcUL,
- 0xdfb39f8bUL, 0xddf521d2UL, 0xdc374be5UL, 0xd76b0cd8UL, 0xd6a966efUL,
- 0xd4efd8b6UL, 0xd52db281UL, 0xd062a404UL, 0xd1a0ce33UL, 0xd3e6706aUL,
- 0xd2241a5dUL, 0xc55efe10UL, 0xc49c9427UL, 0xc6da2a7eUL, 0xc7184049UL,
- 0xc25756ccUL, 0xc3953cfbUL, 0xc1d382a2UL, 0xc011e895UL, 0xcb4dafa8UL,
- 0xca8fc59fUL, 0xc8c97bc6UL, 0xc90b11f1UL, 0xcc440774UL, 0xcd866d43UL,
- 0xcfc0d31aUL, 0xce02b92dUL, 0x91af9640UL, 0x906dfc77UL, 0x922b422eUL,
- 0x93e92819UL, 0x96a63e9cUL, 0x976454abUL, 0x9522eaf2UL, 0x94e080c5UL,
- 0x9fbcc7f8UL, 0x9e7eadcfUL, 0x9c381396UL, 0x9dfa79a1UL, 0x98b56f24UL,
- 0x99770513UL, 0x9b31bb4aUL, 0x9af3d17dUL, 0x8d893530UL, 0x8c4b5f07UL,
- 0x8e0de15eUL, 0x8fcf8b69UL, 0x8a809decUL, 0x8b42f7dbUL, 0x89044982UL,
- 0x88c623b5UL, 0x839a6488UL, 0x82580ebfUL, 0x801eb0e6UL, 0x81dcdad1UL,
- 0x8493cc54UL, 0x8551a663UL, 0x8717183aUL, 0x86d5720dUL, 0xa9e2d0a0UL,
- 0xa820ba97UL, 0xaa6604ceUL, 0xaba46ef9UL, 0xaeeb787cUL, 0xaf29124bUL,
- 0xad6fac12UL, 0xacadc625UL, 0xa7f18118UL, 0xa633eb2fUL, 0xa4755576UL,
- 0xa5b73f41UL, 0xa0f829c4UL, 0xa13a43f3UL, 0xa37cfdaaUL, 0xa2be979dUL,
- 0xb5c473d0UL, 0xb40619e7UL, 0xb640a7beUL, 0xb782cd89UL, 0xb2cddb0cUL,
- 0xb30fb13bUL, 0xb1490f62UL, 0xb08b6555UL, 0xbbd72268UL, 0xba15485fUL,
- 0xb853f606UL, 0xb9919c31UL, 0xbcde8ab4UL, 0xbd1ce083UL, 0xbf5a5edaUL,
- 0xbe9834edUL
- },
- {
- 0x00000000UL, 0xb8bc6765UL, 0xaa09c88bUL, 0x12b5afeeUL, 0x8f629757UL,
- 0x37def032UL, 0x256b5fdcUL, 0x9dd738b9UL, 0xc5b428efUL, 0x7d084f8aUL,
- 0x6fbde064UL, 0xd7018701UL, 0x4ad6bfb8UL, 0xf26ad8ddUL, 0xe0df7733UL,
- 0x58631056UL, 0x5019579fUL, 0xe8a530faUL, 0xfa109f14UL, 0x42acf871UL,
- 0xdf7bc0c8UL, 0x67c7a7adUL, 0x75720843UL, 0xcdce6f26UL, 0x95ad7f70UL,
- 0x2d111815UL, 0x3fa4b7fbUL, 0x8718d09eUL, 0x1acfe827UL, 0xa2738f42UL,
- 0xb0c620acUL, 0x087a47c9UL, 0xa032af3eUL, 0x188ec85bUL, 0x0a3b67b5UL,
- 0xb28700d0UL, 0x2f503869UL, 0x97ec5f0cUL, 0x8559f0e2UL, 0x3de59787UL,
- 0x658687d1UL, 0xdd3ae0b4UL, 0xcf8f4f5aUL, 0x7733283fUL, 0xeae41086UL,
- 0x525877e3UL, 0x40edd80dUL, 0xf851bf68UL, 0xf02bf8a1UL, 0x48979fc4UL,
- 0x5a22302aUL, 0xe29e574fUL, 0x7f496ff6UL, 0xc7f50893UL, 0xd540a77dUL,
- 0x6dfcc018UL, 0x359fd04eUL, 0x8d23b72bUL, 0x9f9618c5UL, 0x272a7fa0UL,
- 0xbafd4719UL, 0x0241207cUL, 0x10f48f92UL, 0xa848e8f7UL, 0x9b14583dUL,
- 0x23a83f58UL, 0x311d90b6UL, 0x89a1f7d3UL, 0x1476cf6aUL, 0xaccaa80fUL,
- 0xbe7f07e1UL, 0x06c36084UL, 0x5ea070d2UL, 0xe61c17b7UL, 0xf4a9b859UL,
- 0x4c15df3cUL, 0xd1c2e785UL, 0x697e80e0UL, 0x7bcb2f0eUL, 0xc377486bUL,
- 0xcb0d0fa2UL, 0x73b168c7UL, 0x6104c729UL, 0xd9b8a04cUL, 0x446f98f5UL,
- 0xfcd3ff90UL, 0xee66507eUL, 0x56da371bUL, 0x0eb9274dUL, 0xb6054028UL,
- 0xa4b0efc6UL, 0x1c0c88a3UL, 0x81dbb01aUL, 0x3967d77fUL, 0x2bd27891UL,
- 0x936e1ff4UL, 0x3b26f703UL, 0x839a9066UL, 0x912f3f88UL, 0x299358edUL,
- 0xb4446054UL, 0x0cf80731UL, 0x1e4da8dfUL, 0xa6f1cfbaUL, 0xfe92dfecUL,
- 0x462eb889UL, 0x549b1767UL, 0xec277002UL, 0x71f048bbUL, 0xc94c2fdeUL,
- 0xdbf98030UL, 0x6345e755UL, 0x6b3fa09cUL, 0xd383c7f9UL, 0xc1366817UL,
- 0x798a0f72UL, 0xe45d37cbUL, 0x5ce150aeUL, 0x4e54ff40UL, 0xf6e89825UL,
- 0xae8b8873UL, 0x1637ef16UL, 0x048240f8UL, 0xbc3e279dUL, 0x21e91f24UL,
- 0x99557841UL, 0x8be0d7afUL, 0x335cb0caUL, 0xed59b63bUL, 0x55e5d15eUL,
- 0x47507eb0UL, 0xffec19d5UL, 0x623b216cUL, 0xda874609UL, 0xc832e9e7UL,
- 0x708e8e82UL, 0x28ed9ed4UL, 0x9051f9b1UL, 0x82e4565fUL, 0x3a58313aUL,
- 0xa78f0983UL, 0x1f336ee6UL, 0x0d86c108UL, 0xb53aa66dUL, 0xbd40e1a4UL,
- 0x05fc86c1UL, 0x1749292fUL, 0xaff54e4aUL, 0x322276f3UL, 0x8a9e1196UL,
- 0x982bbe78UL, 0x2097d91dUL, 0x78f4c94bUL, 0xc048ae2eUL, 0xd2fd01c0UL,
- 0x6a4166a5UL, 0xf7965e1cUL, 0x4f2a3979UL, 0x5d9f9697UL, 0xe523f1f2UL,
- 0x4d6b1905UL, 0xf5d77e60UL, 0xe762d18eUL, 0x5fdeb6ebUL, 0xc2098e52UL,
- 0x7ab5e937UL, 0x680046d9UL, 0xd0bc21bcUL, 0x88df31eaUL, 0x3063568fUL,
- 0x22d6f961UL, 0x9a6a9e04UL, 0x07bda6bdUL, 0xbf01c1d8UL, 0xadb46e36UL,
- 0x15080953UL, 0x1d724e9aUL, 0xa5ce29ffUL, 0xb77b8611UL, 0x0fc7e174UL,
- 0x9210d9cdUL, 0x2aacbea8UL, 0x38191146UL, 0x80a57623UL, 0xd8c66675UL,
- 0x607a0110UL, 0x72cfaefeUL, 0xca73c99bUL, 0x57a4f122UL, 0xef189647UL,
- 0xfdad39a9UL, 0x45115eccUL, 0x764dee06UL, 0xcef18963UL, 0xdc44268dUL,
- 0x64f841e8UL, 0xf92f7951UL, 0x41931e34UL, 0x5326b1daUL, 0xeb9ad6bfUL,
- 0xb3f9c6e9UL, 0x0b45a18cUL, 0x19f00e62UL, 0xa14c6907UL, 0x3c9b51beUL,
- 0x842736dbUL, 0x96929935UL, 0x2e2efe50UL, 0x2654b999UL, 0x9ee8defcUL,
- 0x8c5d7112UL, 0x34e11677UL, 0xa9362eceUL, 0x118a49abUL, 0x033fe645UL,
- 0xbb838120UL, 0xe3e09176UL, 0x5b5cf613UL, 0x49e959fdUL, 0xf1553e98UL,
- 0x6c820621UL, 0xd43e6144UL, 0xc68bceaaUL, 0x7e37a9cfUL, 0xd67f4138UL,
- 0x6ec3265dUL, 0x7c7689b3UL, 0xc4caeed6UL, 0x591dd66fUL, 0xe1a1b10aUL,
- 0xf3141ee4UL, 0x4ba87981UL, 0x13cb69d7UL, 0xab770eb2UL, 0xb9c2a15cUL,
- 0x017ec639UL, 0x9ca9fe80UL, 0x241599e5UL, 0x36a0360bUL, 0x8e1c516eUL,
- 0x866616a7UL, 0x3eda71c2UL, 0x2c6fde2cUL, 0x94d3b949UL, 0x090481f0UL,
- 0xb1b8e695UL, 0xa30d497bUL, 0x1bb12e1eUL, 0x43d23e48UL, 0xfb6e592dUL,
- 0xe9dbf6c3UL, 0x516791a6UL, 0xccb0a91fUL, 0x740cce7aUL, 0x66b96194UL,
- 0xde0506f1UL
- },
- {
- 0x00000000UL, 0x96300777UL, 0x2c610eeeUL, 0xba510999UL, 0x19c46d07UL,
- 0x8ff46a70UL, 0x35a563e9UL, 0xa395649eUL, 0x3288db0eUL, 0xa4b8dc79UL,
- 0x1ee9d5e0UL, 0x88d9d297UL, 0x2b4cb609UL, 0xbd7cb17eUL, 0x072db8e7UL,
- 0x911dbf90UL, 0x6410b71dUL, 0xf220b06aUL, 0x4871b9f3UL, 0xde41be84UL,
- 0x7dd4da1aUL, 0xebe4dd6dUL, 0x51b5d4f4UL, 0xc785d383UL, 0x56986c13UL,
- 0xc0a86b64UL, 0x7af962fdUL, 0xecc9658aUL, 0x4f5c0114UL, 0xd96c0663UL,
- 0x633d0ffaUL, 0xf50d088dUL, 0xc8206e3bUL, 0x5e10694cUL, 0xe44160d5UL,
- 0x727167a2UL, 0xd1e4033cUL, 0x47d4044bUL, 0xfd850dd2UL, 0x6bb50aa5UL,
- 0xfaa8b535UL, 0x6c98b242UL, 0xd6c9bbdbUL, 0x40f9bcacUL, 0xe36cd832UL,
- 0x755cdf45UL, 0xcf0dd6dcUL, 0x593dd1abUL, 0xac30d926UL, 0x3a00de51UL,
- 0x8051d7c8UL, 0x1661d0bfUL, 0xb5f4b421UL, 0x23c4b356UL, 0x9995bacfUL,
- 0x0fa5bdb8UL, 0x9eb80228UL, 0x0888055fUL, 0xb2d90cc6UL, 0x24e90bb1UL,
- 0x877c6f2fUL, 0x114c6858UL, 0xab1d61c1UL, 0x3d2d66b6UL, 0x9041dc76UL,
- 0x0671db01UL, 0xbc20d298UL, 0x2a10d5efUL, 0x8985b171UL, 0x1fb5b606UL,
- 0xa5e4bf9fUL, 0x33d4b8e8UL, 0xa2c90778UL, 0x34f9000fUL, 0x8ea80996UL,
- 0x18980ee1UL, 0xbb0d6a7fUL, 0x2d3d6d08UL, 0x976c6491UL, 0x015c63e6UL,
- 0xf4516b6bUL, 0x62616c1cUL, 0xd8306585UL, 0x4e0062f2UL, 0xed95066cUL,
- 0x7ba5011bUL, 0xc1f40882UL, 0x57c40ff5UL, 0xc6d9b065UL, 0x50e9b712UL,
- 0xeab8be8bUL, 0x7c88b9fcUL, 0xdf1ddd62UL, 0x492dda15UL, 0xf37cd38cUL,
- 0x654cd4fbUL, 0x5861b24dUL, 0xce51b53aUL, 0x7400bca3UL, 0xe230bbd4UL,
- 0x41a5df4aUL, 0xd795d83dUL, 0x6dc4d1a4UL, 0xfbf4d6d3UL, 0x6ae96943UL,
- 0xfcd96e34UL, 0x468867adUL, 0xd0b860daUL, 0x732d0444UL, 0xe51d0333UL,
- 0x5f4c0aaaUL, 0xc97c0dddUL, 0x3c710550UL, 0xaa410227UL, 0x10100bbeUL,
- 0x86200cc9UL, 0x25b56857UL, 0xb3856f20UL, 0x09d466b9UL, 0x9fe461ceUL,
- 0x0ef9de5eUL, 0x98c9d929UL, 0x2298d0b0UL, 0xb4a8d7c7UL, 0x173db359UL,
- 0x810db42eUL, 0x3b5cbdb7UL, 0xad6cbac0UL, 0x2083b8edUL, 0xb6b3bf9aUL,
- 0x0ce2b603UL, 0x9ad2b174UL, 0x3947d5eaUL, 0xaf77d29dUL, 0x1526db04UL,
- 0x8316dc73UL, 0x120b63e3UL, 0x843b6494UL, 0x3e6a6d0dUL, 0xa85a6a7aUL,
- 0x0bcf0ee4UL, 0x9dff0993UL, 0x27ae000aUL, 0xb19e077dUL, 0x44930ff0UL,
- 0xd2a30887UL, 0x68f2011eUL, 0xfec20669UL, 0x5d5762f7UL, 0xcb676580UL,
- 0x71366c19UL, 0xe7066b6eUL, 0x761bd4feUL, 0xe02bd389UL, 0x5a7ada10UL,
- 0xcc4add67UL, 0x6fdfb9f9UL, 0xf9efbe8eUL, 0x43beb717UL, 0xd58eb060UL,
- 0xe8a3d6d6UL, 0x7e93d1a1UL, 0xc4c2d838UL, 0x52f2df4fUL, 0xf167bbd1UL,
- 0x6757bca6UL, 0xdd06b53fUL, 0x4b36b248UL, 0xda2b0dd8UL, 0x4c1b0aafUL,
- 0xf64a0336UL, 0x607a0441UL, 0xc3ef60dfUL, 0x55df67a8UL, 0xef8e6e31UL,
- 0x79be6946UL, 0x8cb361cbUL, 0x1a8366bcUL, 0xa0d26f25UL, 0x36e26852UL,
- 0x95770cccUL, 0x03470bbbUL, 0xb9160222UL, 0x2f260555UL, 0xbe3bbac5UL,
- 0x280bbdb2UL, 0x925ab42bUL, 0x046ab35cUL, 0xa7ffd7c2UL, 0x31cfd0b5UL,
- 0x8b9ed92cUL, 0x1daede5bUL, 0xb0c2649bUL, 0x26f263ecUL, 0x9ca36a75UL,
- 0x0a936d02UL, 0xa906099cUL, 0x3f360eebUL, 0x85670772UL, 0x13570005UL,
- 0x824abf95UL, 0x147ab8e2UL, 0xae2bb17bUL, 0x381bb60cUL, 0x9b8ed292UL,
- 0x0dbed5e5UL, 0xb7efdc7cUL, 0x21dfdb0bUL, 0xd4d2d386UL, 0x42e2d4f1UL,
- 0xf8b3dd68UL, 0x6e83da1fUL, 0xcd16be81UL, 0x5b26b9f6UL, 0xe177b06fUL,
- 0x7747b718UL, 0xe65a0888UL, 0x706a0fffUL, 0xca3b0666UL, 0x5c0b0111UL,
- 0xff9e658fUL, 0x69ae62f8UL, 0xd3ff6b61UL, 0x45cf6c16UL, 0x78e20aa0UL,
- 0xeed20dd7UL, 0x5483044eUL, 0xc2b30339UL, 0x612667a7UL, 0xf71660d0UL,
- 0x4d476949UL, 0xdb776e3eUL, 0x4a6ad1aeUL, 0xdc5ad6d9UL, 0x660bdf40UL,
- 0xf03bd837UL, 0x53aebca9UL, 0xc59ebbdeUL, 0x7fcfb247UL, 0xe9ffb530UL,
- 0x1cf2bdbdUL, 0x8ac2bacaUL, 0x3093b353UL, 0xa6a3b424UL, 0x0536d0baUL,
- 0x9306d7cdUL, 0x2957de54UL, 0xbf67d923UL, 0x2e7a66b3UL, 0xb84a61c4UL,
- 0x021b685dUL, 0x942b6f2aUL, 0x37be0bb4UL, 0xa18e0cc3UL, 0x1bdf055aUL,
- 0x8def022dUL
- },
- {
- 0x00000000UL, 0x41311b19UL, 0x82623632UL, 0xc3532d2bUL, 0x04c56c64UL,
- 0x45f4777dUL, 0x86a75a56UL, 0xc796414fUL, 0x088ad9c8UL, 0x49bbc2d1UL,
- 0x8ae8effaUL, 0xcbd9f4e3UL, 0x0c4fb5acUL, 0x4d7eaeb5UL, 0x8e2d839eUL,
- 0xcf1c9887UL, 0x5112c24aUL, 0x1023d953UL, 0xd370f478UL, 0x9241ef61UL,
- 0x55d7ae2eUL, 0x14e6b537UL, 0xd7b5981cUL, 0x96848305UL, 0x59981b82UL,
- 0x18a9009bUL, 0xdbfa2db0UL, 0x9acb36a9UL, 0x5d5d77e6UL, 0x1c6c6cffUL,
- 0xdf3f41d4UL, 0x9e0e5acdUL, 0xa2248495UL, 0xe3159f8cUL, 0x2046b2a7UL,
- 0x6177a9beUL, 0xa6e1e8f1UL, 0xe7d0f3e8UL, 0x2483dec3UL, 0x65b2c5daUL,
- 0xaaae5d5dUL, 0xeb9f4644UL, 0x28cc6b6fUL, 0x69fd7076UL, 0xae6b3139UL,
- 0xef5a2a20UL, 0x2c09070bUL, 0x6d381c12UL, 0xf33646dfUL, 0xb2075dc6UL,
- 0x715470edUL, 0x30656bf4UL, 0xf7f32abbUL, 0xb6c231a2UL, 0x75911c89UL,
- 0x34a00790UL, 0xfbbc9f17UL, 0xba8d840eUL, 0x79dea925UL, 0x38efb23cUL,
- 0xff79f373UL, 0xbe48e86aUL, 0x7d1bc541UL, 0x3c2ade58UL, 0x054f79f0UL,
- 0x447e62e9UL, 0x872d4fc2UL, 0xc61c54dbUL, 0x018a1594UL, 0x40bb0e8dUL,
- 0x83e823a6UL, 0xc2d938bfUL, 0x0dc5a038UL, 0x4cf4bb21UL, 0x8fa7960aUL,
- 0xce968d13UL, 0x0900cc5cUL, 0x4831d745UL, 0x8b62fa6eUL, 0xca53e177UL,
- 0x545dbbbaUL, 0x156ca0a3UL, 0xd63f8d88UL, 0x970e9691UL, 0x5098d7deUL,
- 0x11a9ccc7UL, 0xd2fae1ecUL, 0x93cbfaf5UL, 0x5cd76272UL, 0x1de6796bUL,
- 0xdeb55440UL, 0x9f844f59UL, 0x58120e16UL, 0x1923150fUL, 0xda703824UL,
- 0x9b41233dUL, 0xa76bfd65UL, 0xe65ae67cUL, 0x2509cb57UL, 0x6438d04eUL,
- 0xa3ae9101UL, 0xe29f8a18UL, 0x21cca733UL, 0x60fdbc2aUL, 0xafe124adUL,
- 0xeed03fb4UL, 0x2d83129fUL, 0x6cb20986UL, 0xab2448c9UL, 0xea1553d0UL,
- 0x29467efbUL, 0x687765e2UL, 0xf6793f2fUL, 0xb7482436UL, 0x741b091dUL,
- 0x352a1204UL, 0xf2bc534bUL, 0xb38d4852UL, 0x70de6579UL, 0x31ef7e60UL,
- 0xfef3e6e7UL, 0xbfc2fdfeUL, 0x7c91d0d5UL, 0x3da0cbccUL, 0xfa368a83UL,
- 0xbb07919aUL, 0x7854bcb1UL, 0x3965a7a8UL, 0x4b98833bUL, 0x0aa99822UL,
- 0xc9fab509UL, 0x88cbae10UL, 0x4f5def5fUL, 0x0e6cf446UL, 0xcd3fd96dUL,
- 0x8c0ec274UL, 0x43125af3UL, 0x022341eaUL, 0xc1706cc1UL, 0x804177d8UL,
- 0x47d73697UL, 0x06e62d8eUL, 0xc5b500a5UL, 0x84841bbcUL, 0x1a8a4171UL,
- 0x5bbb5a68UL, 0x98e87743UL, 0xd9d96c5aUL, 0x1e4f2d15UL, 0x5f7e360cUL,
- 0x9c2d1b27UL, 0xdd1c003eUL, 0x120098b9UL, 0x533183a0UL, 0x9062ae8bUL,
- 0xd153b592UL, 0x16c5f4ddUL, 0x57f4efc4UL, 0x94a7c2efUL, 0xd596d9f6UL,
- 0xe9bc07aeUL, 0xa88d1cb7UL, 0x6bde319cUL, 0x2aef2a85UL, 0xed796bcaUL,
- 0xac4870d3UL, 0x6f1b5df8UL, 0x2e2a46e1UL, 0xe136de66UL, 0xa007c57fUL,
- 0x6354e854UL, 0x2265f34dUL, 0xe5f3b202UL, 0xa4c2a91bUL, 0x67918430UL,
- 0x26a09f29UL, 0xb8aec5e4UL, 0xf99fdefdUL, 0x3accf3d6UL, 0x7bfde8cfUL,
- 0xbc6ba980UL, 0xfd5ab299UL, 0x3e099fb2UL, 0x7f3884abUL, 0xb0241c2cUL,
- 0xf1150735UL, 0x32462a1eUL, 0x73773107UL, 0xb4e17048UL, 0xf5d06b51UL,
- 0x3683467aUL, 0x77b25d63UL, 0x4ed7facbUL, 0x0fe6e1d2UL, 0xccb5ccf9UL,
- 0x8d84d7e0UL, 0x4a1296afUL, 0x0b238db6UL, 0xc870a09dUL, 0x8941bb84UL,
- 0x465d2303UL, 0x076c381aUL, 0xc43f1531UL, 0x850e0e28UL, 0x42984f67UL,
- 0x03a9547eUL, 0xc0fa7955UL, 0x81cb624cUL, 0x1fc53881UL, 0x5ef42398UL,
- 0x9da70eb3UL, 0xdc9615aaUL, 0x1b0054e5UL, 0x5a314ffcUL, 0x996262d7UL,
- 0xd85379ceUL, 0x174fe149UL, 0x567efa50UL, 0x952dd77bUL, 0xd41ccc62UL,
- 0x138a8d2dUL, 0x52bb9634UL, 0x91e8bb1fUL, 0xd0d9a006UL, 0xecf37e5eUL,
- 0xadc26547UL, 0x6e91486cUL, 0x2fa05375UL, 0xe836123aUL, 0xa9070923UL,
- 0x6a542408UL, 0x2b653f11UL, 0xe479a796UL, 0xa548bc8fUL, 0x661b91a4UL,
- 0x272a8abdUL, 0xe0bccbf2UL, 0xa18dd0ebUL, 0x62defdc0UL, 0x23efe6d9UL,
- 0xbde1bc14UL, 0xfcd0a70dUL, 0x3f838a26UL, 0x7eb2913fUL, 0xb924d070UL,
- 0xf815cb69UL, 0x3b46e642UL, 0x7a77fd5bUL, 0xb56b65dcUL, 0xf45a7ec5UL,
- 0x370953eeUL, 0x763848f7UL, 0xb1ae09b8UL, 0xf09f12a1UL, 0x33cc3f8aUL,
- 0x72fd2493UL
- },
- {
- 0x00000000UL, 0x376ac201UL, 0x6ed48403UL, 0x59be4602UL, 0xdca80907UL,
- 0xebc2cb06UL, 0xb27c8d04UL, 0x85164f05UL, 0xb851130eUL, 0x8f3bd10fUL,
- 0xd685970dUL, 0xe1ef550cUL, 0x64f91a09UL, 0x5393d808UL, 0x0a2d9e0aUL,
- 0x3d475c0bUL, 0x70a3261cUL, 0x47c9e41dUL, 0x1e77a21fUL, 0x291d601eUL,
- 0xac0b2f1bUL, 0x9b61ed1aUL, 0xc2dfab18UL, 0xf5b56919UL, 0xc8f23512UL,
- 0xff98f713UL, 0xa626b111UL, 0x914c7310UL, 0x145a3c15UL, 0x2330fe14UL,
- 0x7a8eb816UL, 0x4de47a17UL, 0xe0464d38UL, 0xd72c8f39UL, 0x8e92c93bUL,
- 0xb9f80b3aUL, 0x3cee443fUL, 0x0b84863eUL, 0x523ac03cUL, 0x6550023dUL,
- 0x58175e36UL, 0x6f7d9c37UL, 0x36c3da35UL, 0x01a91834UL, 0x84bf5731UL,
- 0xb3d59530UL, 0xea6bd332UL, 0xdd011133UL, 0x90e56b24UL, 0xa78fa925UL,
- 0xfe31ef27UL, 0xc95b2d26UL, 0x4c4d6223UL, 0x7b27a022UL, 0x2299e620UL,
- 0x15f32421UL, 0x28b4782aUL, 0x1fdeba2bUL, 0x4660fc29UL, 0x710a3e28UL,
- 0xf41c712dUL, 0xc376b32cUL, 0x9ac8f52eUL, 0xada2372fUL, 0xc08d9a70UL,
- 0xf7e75871UL, 0xae591e73UL, 0x9933dc72UL, 0x1c259377UL, 0x2b4f5176UL,
- 0x72f11774UL, 0x459bd575UL, 0x78dc897eUL, 0x4fb64b7fUL, 0x16080d7dUL,
- 0x2162cf7cUL, 0xa4748079UL, 0x931e4278UL, 0xcaa0047aUL, 0xfdcac67bUL,
- 0xb02ebc6cUL, 0x87447e6dUL, 0xdefa386fUL, 0xe990fa6eUL, 0x6c86b56bUL,
- 0x5bec776aUL, 0x02523168UL, 0x3538f369UL, 0x087faf62UL, 0x3f156d63UL,
- 0x66ab2b61UL, 0x51c1e960UL, 0xd4d7a665UL, 0xe3bd6464UL, 0xba032266UL,
- 0x8d69e067UL, 0x20cbd748UL, 0x17a11549UL, 0x4e1f534bUL, 0x7975914aUL,
- 0xfc63de4fUL, 0xcb091c4eUL, 0x92b75a4cUL, 0xa5dd984dUL, 0x989ac446UL,
- 0xaff00647UL, 0xf64e4045UL, 0xc1248244UL, 0x4432cd41UL, 0x73580f40UL,
- 0x2ae64942UL, 0x1d8c8b43UL, 0x5068f154UL, 0x67023355UL, 0x3ebc7557UL,
- 0x09d6b756UL, 0x8cc0f853UL, 0xbbaa3a52UL, 0xe2147c50UL, 0xd57ebe51UL,
- 0xe839e25aUL, 0xdf53205bUL, 0x86ed6659UL, 0xb187a458UL, 0x3491eb5dUL,
- 0x03fb295cUL, 0x5a456f5eUL, 0x6d2fad5fUL, 0x801b35e1UL, 0xb771f7e0UL,
- 0xeecfb1e2UL, 0xd9a573e3UL, 0x5cb33ce6UL, 0x6bd9fee7UL, 0x3267b8e5UL,
- 0x050d7ae4UL, 0x384a26efUL, 0x0f20e4eeUL, 0x569ea2ecUL, 0x61f460edUL,
- 0xe4e22fe8UL, 0xd388ede9UL, 0x8a36abebUL, 0xbd5c69eaUL, 0xf0b813fdUL,
- 0xc7d2d1fcUL, 0x9e6c97feUL, 0xa90655ffUL, 0x2c101afaUL, 0x1b7ad8fbUL,
- 0x42c49ef9UL, 0x75ae5cf8UL, 0x48e900f3UL, 0x7f83c2f2UL, 0x263d84f0UL,
- 0x115746f1UL, 0x944109f4UL, 0xa32bcbf5UL, 0xfa958df7UL, 0xcdff4ff6UL,
- 0x605d78d9UL, 0x5737bad8UL, 0x0e89fcdaUL, 0x39e33edbUL, 0xbcf571deUL,
- 0x8b9fb3dfUL, 0xd221f5ddUL, 0xe54b37dcUL, 0xd80c6bd7UL, 0xef66a9d6UL,
- 0xb6d8efd4UL, 0x81b22dd5UL, 0x04a462d0UL, 0x33cea0d1UL, 0x6a70e6d3UL,
- 0x5d1a24d2UL, 0x10fe5ec5UL, 0x27949cc4UL, 0x7e2adac6UL, 0x494018c7UL,
- 0xcc5657c2UL, 0xfb3c95c3UL, 0xa282d3c1UL, 0x95e811c0UL, 0xa8af4dcbUL,
- 0x9fc58fcaUL, 0xc67bc9c8UL, 0xf1110bc9UL, 0x740744ccUL, 0x436d86cdUL,
- 0x1ad3c0cfUL, 0x2db902ceUL, 0x4096af91UL, 0x77fc6d90UL, 0x2e422b92UL,
- 0x1928e993UL, 0x9c3ea696UL, 0xab546497UL, 0xf2ea2295UL, 0xc580e094UL,
- 0xf8c7bc9fUL, 0xcfad7e9eUL, 0x9613389cUL, 0xa179fa9dUL, 0x246fb598UL,
- 0x13057799UL, 0x4abb319bUL, 0x7dd1f39aUL, 0x3035898dUL, 0x075f4b8cUL,
- 0x5ee10d8eUL, 0x698bcf8fUL, 0xec9d808aUL, 0xdbf7428bUL, 0x82490489UL,
- 0xb523c688UL, 0x88649a83UL, 0xbf0e5882UL, 0xe6b01e80UL, 0xd1dadc81UL,
- 0x54cc9384UL, 0x63a65185UL, 0x3a181787UL, 0x0d72d586UL, 0xa0d0e2a9UL,
- 0x97ba20a8UL, 0xce0466aaUL, 0xf96ea4abUL, 0x7c78ebaeUL, 0x4b1229afUL,
- 0x12ac6fadUL, 0x25c6adacUL, 0x1881f1a7UL, 0x2feb33a6UL, 0x765575a4UL,
- 0x413fb7a5UL, 0xc429f8a0UL, 0xf3433aa1UL, 0xaafd7ca3UL, 0x9d97bea2UL,
- 0xd073c4b5UL, 0xe71906b4UL, 0xbea740b6UL, 0x89cd82b7UL, 0x0cdbcdb2UL,
- 0x3bb10fb3UL, 0x620f49b1UL, 0x55658bb0UL, 0x6822d7bbUL, 0x5f4815baUL,
- 0x06f653b8UL, 0x319c91b9UL, 0xb48adebcUL, 0x83e01cbdUL, 0xda5e5abfUL,
- 0xed3498beUL
- },
- {
- 0x00000000UL, 0x6567bcb8UL, 0x8bc809aaUL, 0xeeafb512UL, 0x5797628fUL,
- 0x32f0de37UL, 0xdc5f6b25UL, 0xb938d79dUL, 0xef28b4c5UL, 0x8a4f087dUL,
- 0x64e0bd6fUL, 0x018701d7UL, 0xb8bfd64aUL, 0xddd86af2UL, 0x3377dfe0UL,
- 0x56106358UL, 0x9f571950UL, 0xfa30a5e8UL, 0x149f10faUL, 0x71f8ac42UL,
- 0xc8c07bdfUL, 0xada7c767UL, 0x43087275UL, 0x266fcecdUL, 0x707fad95UL,
- 0x1518112dUL, 0xfbb7a43fUL, 0x9ed01887UL, 0x27e8cf1aUL, 0x428f73a2UL,
- 0xac20c6b0UL, 0xc9477a08UL, 0x3eaf32a0UL, 0x5bc88e18UL, 0xb5673b0aUL,
- 0xd00087b2UL, 0x6938502fUL, 0x0c5fec97UL, 0xe2f05985UL, 0x8797e53dUL,
- 0xd1878665UL, 0xb4e03addUL, 0x5a4f8fcfUL, 0x3f283377UL, 0x8610e4eaUL,
- 0xe3775852UL, 0x0dd8ed40UL, 0x68bf51f8UL, 0xa1f82bf0UL, 0xc49f9748UL,
- 0x2a30225aUL, 0x4f579ee2UL, 0xf66f497fUL, 0x9308f5c7UL, 0x7da740d5UL,
- 0x18c0fc6dUL, 0x4ed09f35UL, 0x2bb7238dUL, 0xc518969fUL, 0xa07f2a27UL,
- 0x1947fdbaUL, 0x7c204102UL, 0x928ff410UL, 0xf7e848a8UL, 0x3d58149bUL,
- 0x583fa823UL, 0xb6901d31UL, 0xd3f7a189UL, 0x6acf7614UL, 0x0fa8caacUL,
- 0xe1077fbeUL, 0x8460c306UL, 0xd270a05eUL, 0xb7171ce6UL, 0x59b8a9f4UL,
- 0x3cdf154cUL, 0x85e7c2d1UL, 0xe0807e69UL, 0x0e2fcb7bUL, 0x6b4877c3UL,
- 0xa20f0dcbUL, 0xc768b173UL, 0x29c70461UL, 0x4ca0b8d9UL, 0xf5986f44UL,
- 0x90ffd3fcUL, 0x7e5066eeUL, 0x1b37da56UL, 0x4d27b90eUL, 0x284005b6UL,
- 0xc6efb0a4UL, 0xa3880c1cUL, 0x1ab0db81UL, 0x7fd76739UL, 0x9178d22bUL,
- 0xf41f6e93UL, 0x03f7263bUL, 0x66909a83UL, 0x883f2f91UL, 0xed589329UL,
- 0x546044b4UL, 0x3107f80cUL, 0xdfa84d1eUL, 0xbacff1a6UL, 0xecdf92feUL,
- 0x89b82e46UL, 0x67179b54UL, 0x027027ecUL, 0xbb48f071UL, 0xde2f4cc9UL,
- 0x3080f9dbUL, 0x55e74563UL, 0x9ca03f6bUL, 0xf9c783d3UL, 0x176836c1UL,
- 0x720f8a79UL, 0xcb375de4UL, 0xae50e15cUL, 0x40ff544eUL, 0x2598e8f6UL,
- 0x73888baeUL, 0x16ef3716UL, 0xf8408204UL, 0x9d273ebcUL, 0x241fe921UL,
- 0x41785599UL, 0xafd7e08bUL, 0xcab05c33UL, 0x3bb659edUL, 0x5ed1e555UL,
- 0xb07e5047UL, 0xd519ecffUL, 0x6c213b62UL, 0x094687daUL, 0xe7e932c8UL,
- 0x828e8e70UL, 0xd49eed28UL, 0xb1f95190UL, 0x5f56e482UL, 0x3a31583aUL,
- 0x83098fa7UL, 0xe66e331fUL, 0x08c1860dUL, 0x6da63ab5UL, 0xa4e140bdUL,
- 0xc186fc05UL, 0x2f294917UL, 0x4a4ef5afUL, 0xf3762232UL, 0x96119e8aUL,
- 0x78be2b98UL, 0x1dd99720UL, 0x4bc9f478UL, 0x2eae48c0UL, 0xc001fdd2UL,
- 0xa566416aUL, 0x1c5e96f7UL, 0x79392a4fUL, 0x97969f5dUL, 0xf2f123e5UL,
- 0x05196b4dUL, 0x607ed7f5UL, 0x8ed162e7UL, 0xebb6de5fUL, 0x528e09c2UL,
- 0x37e9b57aUL, 0xd9460068UL, 0xbc21bcd0UL, 0xea31df88UL, 0x8f566330UL,
- 0x61f9d622UL, 0x049e6a9aUL, 0xbda6bd07UL, 0xd8c101bfUL, 0x366eb4adUL,
- 0x53090815UL, 0x9a4e721dUL, 0xff29cea5UL, 0x11867bb7UL, 0x74e1c70fUL,
- 0xcdd91092UL, 0xa8beac2aUL, 0x46111938UL, 0x2376a580UL, 0x7566c6d8UL,
- 0x10017a60UL, 0xfeaecf72UL, 0x9bc973caUL, 0x22f1a457UL, 0x479618efUL,
- 0xa939adfdUL, 0xcc5e1145UL, 0x06ee4d76UL, 0x6389f1ceUL, 0x8d2644dcUL,
- 0xe841f864UL, 0x51792ff9UL, 0x341e9341UL, 0xdab12653UL, 0xbfd69aebUL,
- 0xe9c6f9b3UL, 0x8ca1450bUL, 0x620ef019UL, 0x07694ca1UL, 0xbe519b3cUL,
- 0xdb362784UL, 0x35999296UL, 0x50fe2e2eUL, 0x99b95426UL, 0xfcdee89eUL,
- 0x12715d8cUL, 0x7716e134UL, 0xce2e36a9UL, 0xab498a11UL, 0x45e63f03UL,
- 0x208183bbUL, 0x7691e0e3UL, 0x13f65c5bUL, 0xfd59e949UL, 0x983e55f1UL,
- 0x2106826cUL, 0x44613ed4UL, 0xaace8bc6UL, 0xcfa9377eUL, 0x38417fd6UL,
- 0x5d26c36eUL, 0xb389767cUL, 0xd6eecac4UL, 0x6fd61d59UL, 0x0ab1a1e1UL,
- 0xe41e14f3UL, 0x8179a84bUL, 0xd769cb13UL, 0xb20e77abUL, 0x5ca1c2b9UL,
- 0x39c67e01UL, 0x80fea99cUL, 0xe5991524UL, 0x0b36a036UL, 0x6e511c8eUL,
- 0xa7166686UL, 0xc271da3eUL, 0x2cde6f2cUL, 0x49b9d394UL, 0xf0810409UL,
- 0x95e6b8b1UL, 0x7b490da3UL, 0x1e2eb11bUL, 0x483ed243UL, 0x2d596efbUL,
- 0xc3f6dbe9UL, 0xa6916751UL, 0x1fa9b0ccUL, 0x7ace0c74UL, 0x9461b966UL,
- 0xf10605deUL
-#endif
- }
-};
diff --git a/3rdparty/assimp/contrib/zlib/deflate.c b/3rdparty/assimp/contrib/zlib/deflate.c
deleted file mode 100644
index 5c4022f3..00000000
--- a/3rdparty/assimp/contrib/zlib/deflate.c
+++ /dev/null
@@ -1,1834 +0,0 @@
-/* deflate.c -- compress data using the deflation algorithm
- * Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/*
- * ALGORITHM
- *
- * The "deflation" process depends on being able to identify portions
- * of the input text which are identical to earlier input (within a
- * sliding window trailing behind the input currently being processed).
- *
- * The most straightforward technique turns out to be the fastest for
- * most input files: try all possible matches and select the longest.
- * The key feature of this algorithm is that insertions into the string
- * dictionary are very simple and thus fast, and deletions are avoided
- * completely. Insertions are performed at each input character, whereas
- * string matches are performed only when the previous match ends. So it
- * is preferable to spend more time in matches to allow very fast string
- * insertions and avoid deletions. The matching algorithm for small
- * strings is inspired from that of Rabin & Karp. A brute force approach
- * is used to find longer strings when a small match has been found.
- * A similar algorithm is used in comic (by Jan-Mark Wams) and freeze
- * (by Leonid Broukhis).
- * A previous version of this file used a more sophisticated algorithm
- * (by Fiala and Greene) which is guaranteed to run in linear amortized
- * time, but has a larger average cost, uses more memory and is patented.
- * However the F&G algorithm may be faster for some highly redundant
- * files if the parameter max_chain_length (described below) is too large.
- *
- * ACKNOWLEDGEMENTS
- *
- * The idea of lazy evaluation of matches is due to Jan-Mark Wams, and
- * I found it in 'freeze' written by Leonid Broukhis.
- * Thanks to many people for bug reports and testing.
- *
- * REFERENCES
- *
- * Deutsch, L.P.,"DEFLATE Compressed Data Format Specification".
- * Available in http://www.ietf.org/rfc/rfc1951.txt
- *
- * A description of the Rabin and Karp algorithm is given in the book
- * "Algorithms" by R. Sedgewick, Addison-Wesley, p252.
- *
- * Fiala,E.R., and Greene,D.H.
- * Data Compression with Finite Windows, Comm.ACM, 32,4 (1989) 490-595
- *
- */
-
-/* @(#) $Id$ */
-
-#include "deflate.h"
-
-const char deflate_copyright[] =
- " deflate 1.2.5 Copyright 1995-2010 Jean-loup Gailly and Mark Adler ";
-/*
- If you use the zlib library in a product, an acknowledgment is welcome
- in the documentation of your product. If for some reason you cannot
- include such an acknowledgment, I would appreciate that you keep this
- copyright string in the executable of your product.
- */
-
-/* ===========================================================================
- * Function prototypes.
- */
-typedef enum {
- need_more, /* block not completed, need more input or more output */
- block_done, /* block flush performed */
- finish_started, /* finish started, need only more output at next deflate */
- finish_done /* finish done, accept no more input or output */
-} block_state;
-
-typedef block_state (*compress_func) OF((deflate_state *s, int flush));
-/* Compression function. Returns the block state after the call. */
-
-local void fill_window OF((deflate_state *s));
-local block_state deflate_stored OF((deflate_state *s, int flush));
-local block_state deflate_fast OF((deflate_state *s, int flush));
-#ifndef FASTEST
-local block_state deflate_slow OF((deflate_state *s, int flush));
-#endif
-local block_state deflate_rle OF((deflate_state *s, int flush));
-local block_state deflate_huff OF((deflate_state *s, int flush));
-local void lm_init OF((deflate_state *s));
-local void putShortMSB OF((deflate_state *s, uInt b));
-local void flush_pending OF((z_streamp strm));
-local int read_buf OF((z_streamp strm, Bytef *buf, unsigned size));
-#ifdef ASMV
- void match_init OF((void)); /* asm code initialization */
- uInt longest_match OF((deflate_state *s, IPos cur_match));
-#else
-local uInt longest_match OF((deflate_state *s, IPos cur_match));
-#endif
-
-#ifdef DEBUG
-local void check_match OF((deflate_state *s, IPos start, IPos match,
- int length));
-#endif
-
-/* ===========================================================================
- * Local data
- */
-
-#define NIL 0
-/* Tail of hash chains */
-
-#ifndef TOO_FAR
-# define TOO_FAR 4096
-#endif
-/* Matches of length 3 are discarded if their distance exceeds TOO_FAR */
-
-/* Values for max_lazy_match, good_match and max_chain_length, depending on
- * the desired pack level (0..9). The values given below have been tuned to
- * exclude worst case performance for pathological files. Better values may be
- * found for specific files.
- */
-typedef struct config_s {
- ush good_length; /* reduce lazy search above this match length */
- ush max_lazy; /* do not perform lazy search above this match length */
- ush nice_length; /* quit search above this match length */
- ush max_chain;
- compress_func func;
-} config;
-
-#ifdef FASTEST
-local const config configuration_table[2] = {
-/* good lazy nice chain */
-/* 0 */ {0, 0, 0, 0, deflate_stored}, /* store only */
-/* 1 */ {4, 4, 8, 4, deflate_fast}}; /* max speed, no lazy matches */
-#else
-local const config configuration_table[10] = {
-/* good lazy nice chain */
-/* 0 */ {0, 0, 0, 0, deflate_stored}, /* store only */
-/* 1 */ {4, 4, 8, 4, deflate_fast}, /* max speed, no lazy matches */
-/* 2 */ {4, 5, 16, 8, deflate_fast},
-/* 3 */ {4, 6, 32, 32, deflate_fast},
-
-/* 4 */ {4, 4, 16, 16, deflate_slow}, /* lazy matches */
-/* 5 */ {8, 16, 32, 32, deflate_slow},
-/* 6 */ {8, 16, 128, 128, deflate_slow},
-/* 7 */ {8, 32, 128, 256, deflate_slow},
-/* 8 */ {32, 128, 258, 1024, deflate_slow},
-/* 9 */ {32, 258, 258, 4096, deflate_slow}}; /* max compression */
-#endif
-
-/* Note: the deflate() code requires max_lazy >= MIN_MATCH and max_chain >= 4
- * For deflate_fast() (levels <= 3) good is ignored and lazy has a different
- * meaning.
- */
-
-#define EQUAL 0
-/* result of memcmp for equal strings */
-
-#ifndef NO_DUMMY_DECL
-struct static_tree_desc_s {int dummy;}; /* for buggy compilers */
-#endif
-
-/* ===========================================================================
- * Update a hash value with the given input byte
- * IN assertion: all calls to to UPDATE_HASH are made with consecutive
- * input characters, so that a running hash key can be computed from the
- * previous key instead of complete recalculation each time.
- */
-#define UPDATE_HASH(s,h,c) (h = (((h)<<s->hash_shift) ^ (c)) & s->hash_mask)
-
-
-/* ===========================================================================
- * Insert string str in the dictionary and set match_head to the previous head
- * of the hash chain (the most recent string with same hash key). Return
- * the previous length of the hash chain.
- * If this file is compiled with -DFASTEST, the compression level is forced
- * to 1, and no hash chains are maintained.
- * IN assertion: all calls to to INSERT_STRING are made with consecutive
- * input characters and the first MIN_MATCH bytes of str are valid
- * (except for the last MIN_MATCH-1 bytes of the input file).
- */
-#ifdef FASTEST
-#define INSERT_STRING(s, str, match_head) \
- (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
- match_head = s->head[s->ins_h], \
- s->head[s->ins_h] = (Pos)(str))
-#else
-#define INSERT_STRING(s, str, match_head) \
- (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
- match_head = s->prev[(str) & s->w_mask] = s->head[s->ins_h], \
- s->head[s->ins_h] = (Pos)(str))
-#endif
-
-/* ===========================================================================
- * Initialize the hash table (avoiding 64K overflow for 16 bit systems).
- * prev[] will be initialized on the fly.
- */
-#define CLEAR_HASH(s) \
- s->head[s->hash_size-1] = NIL; \
- zmemzero((Bytef *)s->head, (unsigned)(s->hash_size-1)*sizeof(*s->head));
-
-/* ========================================================================= */
-int ZEXPORT deflateInit_(strm, level, version, stream_size)
- z_streamp strm;
- int level;
- const char *version;
- int stream_size;
-{
- return deflateInit2_(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL,
- Z_DEFAULT_STRATEGY, version, stream_size);
- /* To do: ignore strm->next_in if we use it as window */
-}
-
-/* ========================================================================= */
-int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
- version, stream_size)
- z_streamp strm;
- int level;
- int method;
- int windowBits;
- int memLevel;
- int strategy;
- const char *version;
- int stream_size;
-{
- deflate_state *s;
- int wrap = 1;
- static const char my_version[] = ZLIB_VERSION;
-
- ushf *overlay;
- /* We overlay pending_buf and d_buf+l_buf. This works since the average
- * output size for (length,distance) codes is <= 24 bits.
- */
-
- if (version == Z_NULL || version[0] != my_version[0] ||
- stream_size != sizeof(z_stream)) {
- return Z_VERSION_ERROR;
- }
- if (strm == Z_NULL) return Z_STREAM_ERROR;
-
- strm->msg = Z_NULL;
- if (strm->zalloc == (alloc_func)0) {
- strm->zalloc = zcalloc;
- strm->opaque = (voidpf)0;
- }
- if (strm->zfree == (free_func)0) strm->zfree = zcfree;
-
-#ifdef FASTEST
- if (level != 0) level = 1;
-#else
- if (level == Z_DEFAULT_COMPRESSION) level = 6;
-#endif
-
- if (windowBits < 0) { /* suppress zlib wrapper */
- wrap = 0;
- windowBits = -windowBits;
- }
-#ifdef GZIP
- else if (windowBits > 15) {
- wrap = 2; /* write gzip wrapper instead */
- windowBits -= 16;
- }
-#endif
- if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED ||
- windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||
- strategy < 0 || strategy > Z_FIXED) {
- return Z_STREAM_ERROR;
- }
- if (windowBits == 8) windowBits = 9; /* until 256-byte window bug fixed */
- s = (deflate_state *) ZALLOC(strm, 1, sizeof(deflate_state));
- if (s == Z_NULL) return Z_MEM_ERROR;
- strm->state = (struct internal_state FAR *)s;
- s->strm = strm;
-
- s->wrap = wrap;
- s->gzhead = Z_NULL;
- s->w_bits = windowBits;
- s->w_size = 1 << s->w_bits;
- s->w_mask = s->w_size - 1;
-
- s->hash_bits = memLevel + 7;
- s->hash_size = 1 << s->hash_bits;
- s->hash_mask = s->hash_size - 1;
- s->hash_shift = ((s->hash_bits+MIN_MATCH-1)/MIN_MATCH);
-
- s->window = (Bytef *) ZALLOC(strm, s->w_size, 2*sizeof(Byte));
- s->prev = (Posf *) ZALLOC(strm, s->w_size, sizeof(Pos));
- s->head = (Posf *) ZALLOC(strm, s->hash_size, sizeof(Pos));
-
- s->high_water = 0; /* nothing written to s->window yet */
-
- s->lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */
-
- overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);
- s->pending_buf = (uchf *) overlay;
- s->pending_buf_size = (ulg)s->lit_bufsize * (sizeof(ush)+2L);
-
- if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
- s->pending_buf == Z_NULL) {
- s->status = FINISH_STATE;
- strm->msg = (char*)ERR_MSG(Z_MEM_ERROR);
- deflateEnd (strm);
- return Z_MEM_ERROR;
- }
- s->d_buf = overlay + s->lit_bufsize/sizeof(ush);
- s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;
-
- s->level = level;
- s->strategy = strategy;
- s->method = (Byte)method;
-
- return deflateReset(strm);
-}
-
-/* ========================================================================= */
-int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength)
- z_streamp strm;
- const Bytef *dictionary;
- uInt dictLength;
-{
- deflate_state *s;
- uInt length = dictLength;
- uInt n;
- IPos hash_head = 0;
-
- if (strm == Z_NULL || strm->state == Z_NULL || dictionary == Z_NULL ||
- strm->state->wrap == 2 ||
- (strm->state->wrap == 1 && strm->state->status != INIT_STATE))
- return Z_STREAM_ERROR;
-
- s = strm->state;
- if (s->wrap)
- strm->adler = adler32(strm->adler, dictionary, dictLength);
-
- if (length < MIN_MATCH) return Z_OK;
- if (length > s->w_size) {
- length = s->w_size;
- dictionary += dictLength - length; /* use the tail of the dictionary */
- }
- zmemcpy(s->window, dictionary, length);
- s->strstart = length;
- s->block_start = (long)length;
-
- /* Insert all strings in the hash table (except for the last two bytes).
- * s->lookahead stays null, so s->ins_h will be recomputed at the next
- * call of fill_window.
- */
- s->ins_h = s->window[0];
- UPDATE_HASH(s, s->ins_h, s->window[1]);
- for (n = 0; n <= length - MIN_MATCH; n++) {
- INSERT_STRING(s, n, hash_head);
- }
- if (hash_head) hash_head = 0; /* to make compiler happy */
- return Z_OK;
-}
-
-/* ========================================================================= */
-int ZEXPORT deflateReset (strm)
- z_streamp strm;
-{
- deflate_state *s;
-
- if (strm == Z_NULL || strm->state == Z_NULL ||
- strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0) {
- return Z_STREAM_ERROR;
- }
-
- strm->total_in = strm->total_out = 0;
- strm->msg = Z_NULL; /* use zfree if we ever allocate msg dynamically */
- strm->data_type = Z_UNKNOWN;
-
- s = (deflate_state *)strm->state;
- s->pending = 0;
- s->pending_out = s->pending_buf;
-
- if (s->wrap < 0) {
- s->wrap = -s->wrap; /* was made negative by deflate(..., Z_FINISH); */
- }
- s->status = s->wrap ? INIT_STATE : BUSY_STATE;
- strm->adler =
-#ifdef GZIP
- s->wrap == 2 ? crc32(0L, Z_NULL, 0) :
-#endif
- adler32(0L, Z_NULL, 0);
- s->last_flush = Z_NO_FLUSH;
-
- _tr_init(s);
- lm_init(s);
-
- return Z_OK;
-}
-
-/* ========================================================================= */
-int ZEXPORT deflateSetHeader (strm, head)
- z_streamp strm;
- gz_headerp head;
-{
- if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
- if (strm->state->wrap != 2) return Z_STREAM_ERROR;
- strm->state->gzhead = head;
- return Z_OK;
-}
-
-/* ========================================================================= */
-int ZEXPORT deflatePrime (strm, bits, value)
- z_streamp strm;
- int bits;
- int value;
-{
- if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
- strm->state->bi_valid = bits;
- strm->state->bi_buf = (ush)(value & ((1 << bits) - 1));
- return Z_OK;
-}
-
-/* ========================================================================= */
-int ZEXPORT deflateParams(strm, level, strategy)
- z_streamp strm;
- int level;
- int strategy;
-{
- deflate_state *s;
- compress_func func;
- int err = Z_OK;
-
- if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
- s = strm->state;
-
-#ifdef FASTEST
- if (level != 0) level = 1;
-#else
- if (level == Z_DEFAULT_COMPRESSION) level = 6;
-#endif
- if (level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED) {
- return Z_STREAM_ERROR;
- }
- func = configuration_table[s->level].func;
-
- if ((strategy != s->strategy || func != configuration_table[level].func) &&
- strm->total_in != 0) {
- /* Flush the last buffer: */
- err = deflate(strm, Z_BLOCK);
- }
- if (s->level != level) {
- s->level = level;
- s->max_lazy_match = configuration_table[level].max_lazy;
- s->good_match = configuration_table[level].good_length;
- s->nice_match = configuration_table[level].nice_length;
- s->max_chain_length = configuration_table[level].max_chain;
- }
- s->strategy = strategy;
- return err;
-}
-
-/* ========================================================================= */
-int ZEXPORT deflateTune(strm, good_length, max_lazy, nice_length, max_chain)
- z_streamp strm;
- int good_length;
- int max_lazy;
- int nice_length;
- int max_chain;
-{
- deflate_state *s;
-
- if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
- s = strm->state;
- s->good_match = good_length;
- s->max_lazy_match = max_lazy;
- s->nice_match = nice_length;
- s->max_chain_length = max_chain;
- return Z_OK;
-}
-
-/* =========================================================================
- * For the default windowBits of 15 and memLevel of 8, this function returns
- * a close to exact, as well as small, upper bound on the compressed size.
- * They are coded as constants here for a reason--if the #define's are
- * changed, then this function needs to be changed as well. The return
- * value for 15 and 8 only works for those exact settings.
- *
- * For any setting other than those defaults for windowBits and memLevel,
- * the value returned is a conservative worst case for the maximum expansion
- * resulting from using fixed blocks instead of stored blocks, which deflate
- * can emit on compressed data for some combinations of the parameters.
- *
- * This function could be more sophisticated to provide closer upper bounds for
- * every combination of windowBits and memLevel. But even the conservative
- * upper bound of about 14% expansion does not seem onerous for output buffer
- * allocation.
- */
-uLong ZEXPORT deflateBound(strm, sourceLen)
- z_streamp strm;
- uLong sourceLen;
-{
- deflate_state *s;
- uLong complen, wraplen;
- Bytef *str;
-
- /* conservative upper bound for compressed data */
- complen = sourceLen +
- ((sourceLen + 7) >> 3) + ((sourceLen + 63) >> 6) + 5;
-
- /* if can't get parameters, return conservative bound plus zlib wrapper */
- if (strm == Z_NULL || strm->state == Z_NULL)
- return complen + 6;
-
- /* compute wrapper length */
- s = strm->state;
- switch (s->wrap) {
- case 0: /* raw deflate */
- wraplen = 0;
- break;
- case 1: /* zlib wrapper */
- wraplen = 6 + (s->strstart ? 4 : 0);
- break;
- case 2: /* gzip wrapper */
- wraplen = 18;
- if (s->gzhead != Z_NULL) { /* user-supplied gzip header */
- if (s->gzhead->extra != Z_NULL)
- wraplen += 2 + s->gzhead->extra_len;
- str = s->gzhead->name;
- if (str != Z_NULL)
- do {
- wraplen++;
- } while (*str++);
- str = s->gzhead->comment;
- if (str != Z_NULL)
- do {
- wraplen++;
- } while (*str++);
- if (s->gzhead->hcrc)
- wraplen += 2;
- }
- break;
- default: /* for compiler happiness */
- wraplen = 6;
- }
-
- /* if not default parameters, return conservative bound */
- if (s->w_bits != 15 || s->hash_bits != 8 + 7)
- return complen + wraplen;
-
- /* default settings: return tight bound for that case */
- return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
- (sourceLen >> 25) + 13 - 6 + wraplen;
-}
-
-/* =========================================================================
- * Put a short in the pending buffer. The 16-bit value is put in MSB order.
- * IN assertion: the stream state is correct and there is enough room in
- * pending_buf.
- */
-local void putShortMSB (s, b)
- deflate_state *s;
- uInt b;
-{
- put_byte(s, (Byte)(b >> 8));
- put_byte(s, (Byte)(b & 0xff));
-}
-
-/* =========================================================================
- * Flush as much pending output as possible. All deflate() output goes
- * through this function so some applications may wish to modify it
- * to avoid allocating a large strm->next_out buffer and copying into it.
- * (See also read_buf()).
- */
-local void flush_pending(strm)
- z_streamp strm;
-{
- unsigned len = strm->state->pending;
-
- if (len > strm->avail_out) len = strm->avail_out;
- if (len == 0) return;
-
- zmemcpy(strm->next_out, strm->state->pending_out, len);
- strm->next_out += len;
- strm->state->pending_out += len;
- strm->total_out += len;
- strm->avail_out -= len;
- strm->state->pending -= len;
- if (strm->state->pending == 0) {
- strm->state->pending_out = strm->state->pending_buf;
- }
-}
-
-/* ========================================================================= */
-int ZEXPORT deflate (strm, flush)
- z_streamp strm;
- int flush;
-{
- int old_flush; /* value of flush param for previous deflate call */
- deflate_state *s;
-
- if (strm == Z_NULL || strm->state == Z_NULL ||
- flush > Z_BLOCK || flush < 0) {
- return Z_STREAM_ERROR;
- }
- s = strm->state;
-
- if (strm->next_out == Z_NULL ||
- (strm->next_in == Z_NULL && strm->avail_in != 0) ||
- (s->status == FINISH_STATE && flush != Z_FINISH)) {
- ERR_RETURN(strm, Z_STREAM_ERROR);
- }
- if (strm->avail_out == 0) ERR_RETURN(strm, Z_BUF_ERROR);
-
- s->strm = strm; /* just in case */
- old_flush = s->last_flush;
- s->last_flush = flush;
-
- /* Write the header */
- if (s->status == INIT_STATE) {
-#ifdef GZIP
- if (s->wrap == 2) {
- strm->adler = crc32(0L, Z_NULL, 0);
- put_byte(s, 31);
- put_byte(s, 139);
- put_byte(s, 8);
- if (s->gzhead == Z_NULL) {
- put_byte(s, 0);
- put_byte(s, 0);
- put_byte(s, 0);
- put_byte(s, 0);
- put_byte(s, 0);
- put_byte(s, s->level == 9 ? 2 :
- (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ?
- 4 : 0));
- put_byte(s, OS_CODE);
- s->status = BUSY_STATE;
- }
- else {
- put_byte(s, (s->gzhead->text ? 1 : 0) +
- (s->gzhead->hcrc ? 2 : 0) +
- (s->gzhead->extra == Z_NULL ? 0 : 4) +
- (s->gzhead->name == Z_NULL ? 0 : 8) +
- (s->gzhead->comment == Z_NULL ? 0 : 16)
- );
- put_byte(s, (Byte)(s->gzhead->time & 0xff));
- put_byte(s, (Byte)((s->gzhead->time >> 8) & 0xff));
- put_byte(s, (Byte)((s->gzhead->time >> 16) & 0xff));
- put_byte(s, (Byte)((s->gzhead->time >> 24) & 0xff));
- put_byte(s, s->level == 9 ? 2 :
- (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ?
- 4 : 0));
- put_byte(s, s->gzhead->os & 0xff);
- if (s->gzhead->extra != Z_NULL) {
- put_byte(s, s->gzhead->extra_len & 0xff);
- put_byte(s, (s->gzhead->extra_len >> 8) & 0xff);
- }
- if (s->gzhead->hcrc)
- strm->adler = crc32(strm->adler, s->pending_buf,
- s->pending);
- s->gzindex = 0;
- s->status = EXTRA_STATE;
- }
- }
- else
-#endif
- {
- uInt header = (Z_DEFLATED + ((s->w_bits-8)<<4)) << 8;
- uInt level_flags;
-
- if (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2)
- level_flags = 0;
- else if (s->level < 6)
- level_flags = 1;
- else if (s->level == 6)
- level_flags = 2;
- else
- level_flags = 3;
- header |= (level_flags << 6);
- if (s->strstart != 0) header |= PRESET_DICT;
- header += 31 - (header % 31);
-
- s->status = BUSY_STATE;
- putShortMSB(s, header);
-
- /* Save the adler32 of the preset dictionary: */
- if (s->strstart != 0) {
- putShortMSB(s, (uInt)(strm->adler >> 16));
- putShortMSB(s, (uInt)(strm->adler & 0xffff));
- }
- strm->adler = adler32(0L, Z_NULL, 0);
- }
- }
-#ifdef GZIP
- if (s->status == EXTRA_STATE) {
- if (s->gzhead->extra != Z_NULL) {
- uInt beg = s->pending; /* start of bytes to update crc */
-
- while (s->gzindex < (s->gzhead->extra_len & 0xffff)) {
- if (s->pending == s->pending_buf_size) {
- if (s->gzhead->hcrc && s->pending > beg)
- strm->adler = crc32(strm->adler, s->pending_buf + beg,
- s->pending - beg);
- flush_pending(strm);
- beg = s->pending;
- if (s->pending == s->pending_buf_size)
- break;
- }
- put_byte(s, s->gzhead->extra[s->gzindex]);
- s->gzindex++;
- }
- if (s->gzhead->hcrc && s->pending > beg)
- strm->adler = crc32(strm->adler, s->pending_buf + beg,
- s->pending - beg);
- if (s->gzindex == s->gzhead->extra_len) {
- s->gzindex = 0;
- s->status = NAME_STATE;
- }
- }
- else
- s->status = NAME_STATE;
- }
- if (s->status == NAME_STATE) {
- if (s->gzhead->name != Z_NULL) {
- uInt beg = s->pending; /* start of bytes to update crc */
- int val;
-
- do {
- if (s->pending == s->pending_buf_size) {
- if (s->gzhead->hcrc && s->pending > beg)
- strm->adler = crc32(strm->adler, s->pending_buf + beg,
- s->pending - beg);
- flush_pending(strm);
- beg = s->pending;
- if (s->pending == s->pending_buf_size) {
- val = 1;
- break;
- }
- }
- val = s->gzhead->name[s->gzindex++];
- put_byte(s, val);
- } while (val != 0);
- if (s->gzhead->hcrc && s->pending > beg)
- strm->adler = crc32(strm->adler, s->pending_buf + beg,
- s->pending - beg);
- if (val == 0) {
- s->gzindex = 0;
- s->status = COMMENT_STATE;
- }
- }
- else
- s->status = COMMENT_STATE;
- }
- if (s->status == COMMENT_STATE) {
- if (s->gzhead->comment != Z_NULL) {
- uInt beg = s->pending; /* start of bytes to update crc */
- int val;
-
- do {
- if (s->pending == s->pending_buf_size) {
- if (s->gzhead->hcrc && s->pending > beg)
- strm->adler = crc32(strm->adler, s->pending_buf + beg,
- s->pending - beg);
- flush_pending(strm);
- beg = s->pending;
- if (s->pending == s->pending_buf_size) {
- val = 1;
- break;
- }
- }
- val = s->gzhead->comment[s->gzindex++];
- put_byte(s, val);
- } while (val != 0);
- if (s->gzhead->hcrc && s->pending > beg)
- strm->adler = crc32(strm->adler, s->pending_buf + beg,
- s->pending - beg);
- if (val == 0)
- s->status = HCRC_STATE;
- }
- else
- s->status = HCRC_STATE;
- }
- if (s->status == HCRC_STATE) {
- if (s->gzhead->hcrc) {
- if (s->pending + 2 > s->pending_buf_size)
- flush_pending(strm);
- if (s->pending + 2 <= s->pending_buf_size) {
- put_byte(s, (Byte)(strm->adler & 0xff));
- put_byte(s, (Byte)((strm->adler >> 8) & 0xff));
- strm->adler = crc32(0L, Z_NULL, 0);
- s->status = BUSY_STATE;
- }
- }
- else
- s->status = BUSY_STATE;
- }
-#endif
-
- /* Flush as much pending output as possible */
- if (s->pending != 0) {
- flush_pending(strm);
- if (strm->avail_out == 0) {
- /* Since avail_out is 0, deflate will be called again with
- * more output space, but possibly with both pending and
- * avail_in equal to zero. There won't be anything to do,
- * but this is not an error situation so make sure we
- * return OK instead of BUF_ERROR at next call of deflate:
- */
- s->last_flush = -1;
- return Z_OK;
- }
-
- /* Make sure there is something to do and avoid duplicate consecutive
- * flushes. For repeated and useless calls with Z_FINISH, we keep
- * returning Z_STREAM_END instead of Z_BUF_ERROR.
- */
- } else if (strm->avail_in == 0 && flush <= old_flush &&
- flush != Z_FINISH) {
- ERR_RETURN(strm, Z_BUF_ERROR);
- }
-
- /* User must not provide more input after the first FINISH: */
- if (s->status == FINISH_STATE && strm->avail_in != 0) {
- ERR_RETURN(strm, Z_BUF_ERROR);
- }
-
- /* Start a new block or continue the current one.
- */
- if (strm->avail_in != 0 || s->lookahead != 0 ||
- (flush != Z_NO_FLUSH && s->status != FINISH_STATE)) {
- block_state bstate;
-
- bstate = s->strategy == Z_HUFFMAN_ONLY ? deflate_huff(s, flush) :
- (s->strategy == Z_RLE ? deflate_rle(s, flush) :
- (*(configuration_table[s->level].func))(s, flush));
-
- if (bstate == finish_started || bstate == finish_done) {
- s->status = FINISH_STATE;
- }
- if (bstate == need_more || bstate == finish_started) {
- if (strm->avail_out == 0) {
- s->last_flush = -1; /* avoid BUF_ERROR next call, see above */
- }
- return Z_OK;
- /* If flush != Z_NO_FLUSH && avail_out == 0, the next call
- * of deflate should use the same flush parameter to make sure
- * that the flush is complete. So we don't have to output an
- * empty block here, this will be done at next call. This also
- * ensures that for a very small output buffer, we emit at most
- * one empty block.
- */
- }
- if (bstate == block_done) {
- if (flush == Z_PARTIAL_FLUSH) {
- _tr_align(s);
- } else if (flush != Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */
- _tr_stored_block(s, (char*)0, 0L, 0);
- /* For a full flush, this empty block will be recognized
- * as a special marker by inflate_sync().
- */
- if (flush == Z_FULL_FLUSH) {
- CLEAR_HASH(s); /* forget history */
- if (s->lookahead == 0) {
- s->strstart = 0;
- s->block_start = 0L;
- }
- }
- }
- flush_pending(strm);
- if (strm->avail_out == 0) {
- s->last_flush = -1; /* avoid BUF_ERROR at next call, see above */
- return Z_OK;
- }
- }
- }
- Assert(strm->avail_out > 0, "bug2");
-
- if (flush != Z_FINISH) return Z_OK;
- if (s->wrap <= 0) return Z_STREAM_END;
-
- /* Write the trailer */
-#ifdef GZIP
- if (s->wrap == 2) {
- put_byte(s, (Byte)(strm->adler & 0xff));
- put_byte(s, (Byte)((strm->adler >> 8) & 0xff));
- put_byte(s, (Byte)((strm->adler >> 16) & 0xff));
- put_byte(s, (Byte)((strm->adler >> 24) & 0xff));
- put_byte(s, (Byte)(strm->total_in & 0xff));
- put_byte(s, (Byte)((strm->total_in >> 8) & 0xff));
- put_byte(s, (Byte)((strm->total_in >> 16) & 0xff));
- put_byte(s, (Byte)((strm->total_in >> 24) & 0xff));
- }
- else
-#endif
- {
- putShortMSB(s, (uInt)(strm->adler >> 16));
- putShortMSB(s, (uInt)(strm->adler & 0xffff));
- }
- flush_pending(strm);
- /* If avail_out is zero, the application will call deflate again
- * to flush the rest.
- */
- if (s->wrap > 0) s->wrap = -s->wrap; /* write the trailer only once! */
- return s->pending != 0 ? Z_OK : Z_STREAM_END;
-}
-
-/* ========================================================================= */
-int ZEXPORT deflateEnd (strm)
- z_streamp strm;
-{
- int status;
-
- if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
-
- status = strm->state->status;
- if (status != INIT_STATE &&
- status != EXTRA_STATE &&
- status != NAME_STATE &&
- status != COMMENT_STATE &&
- status != HCRC_STATE &&
- status != BUSY_STATE &&
- status != FINISH_STATE) {
- return Z_STREAM_ERROR;
- }
-
- /* Deallocate in reverse order of allocations: */
- TRY_FREE(strm, strm->state->pending_buf);
- TRY_FREE(strm, strm->state->head);
- TRY_FREE(strm, strm->state->prev);
- TRY_FREE(strm, strm->state->window);
-
- ZFREE(strm, strm->state);
- strm->state = Z_NULL;
-
- return status == BUSY_STATE ? Z_DATA_ERROR : Z_OK;
-}
-
-/* =========================================================================
- * Copy the source state to the destination state.
- * To simplify the source, this is not supported for 16-bit MSDOS (which
- * doesn't have enough memory anyway to duplicate compression states).
- */
-int ZEXPORT deflateCopy (dest, source)
- z_streamp dest;
- z_streamp source;
-{
-#ifdef MAXSEG_64K
- return Z_STREAM_ERROR;
-#else
- deflate_state *ds;
- deflate_state *ss;
- ushf *overlay;
-
-
- if (source == Z_NULL || dest == Z_NULL || source->state == Z_NULL) {
- return Z_STREAM_ERROR;
- }
-
- ss = source->state;
-
- zmemcpy(dest, source, sizeof(z_stream));
-
- ds = (deflate_state *) ZALLOC(dest, 1, sizeof(deflate_state));
- if (ds == Z_NULL) return Z_MEM_ERROR;
- dest->state = (struct internal_state FAR *) ds;
- zmemcpy(ds, ss, sizeof(deflate_state));
- ds->strm = dest;
-
- ds->window = (Bytef *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte));
- ds->prev = (Posf *) ZALLOC(dest, ds->w_size, sizeof(Pos));
- ds->head = (Posf *) ZALLOC(dest, ds->hash_size, sizeof(Pos));
- overlay = (ushf *) ZALLOC(dest, ds->lit_bufsize, sizeof(ush)+2);
- ds->pending_buf = (uchf *) overlay;
-
- if (ds->window == Z_NULL || ds->prev == Z_NULL || ds->head == Z_NULL ||
- ds->pending_buf == Z_NULL) {
- deflateEnd (dest);
- return Z_MEM_ERROR;
- }
- /* following zmemcpy do not work for 16-bit MSDOS */
- zmemcpy(ds->window, ss->window, ds->w_size * 2 * sizeof(Byte));
- zmemcpy(ds->prev, ss->prev, ds->w_size * sizeof(Pos));
- zmemcpy(ds->head, ss->head, ds->hash_size * sizeof(Pos));
- zmemcpy(ds->pending_buf, ss->pending_buf, (uInt)ds->pending_buf_size);
-
- ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf);
- ds->d_buf = overlay + ds->lit_bufsize/sizeof(ush);
- ds->l_buf = ds->pending_buf + (1+sizeof(ush))*ds->lit_bufsize;
-
- ds->l_desc.dyn_tree = ds->dyn_ltree;
- ds->d_desc.dyn_tree = ds->dyn_dtree;
- ds->bl_desc.dyn_tree = ds->bl_tree;
-
- return Z_OK;
-#endif /* MAXSEG_64K */
-}
-
-/* ===========================================================================
- * Read a new buffer from the current input stream, update the adler32
- * and total number of bytes read. All deflate() input goes through
- * this function so some applications may wish to modify it to avoid
- * allocating a large strm->next_in buffer and copying from it.
- * (See also flush_pending()).
- */
-local int read_buf(strm, buf, size)
- z_streamp strm;
- Bytef *buf;
- unsigned size;
-{
- unsigned len = strm->avail_in;
-
- if (len > size) len = size;
- if (len == 0) return 0;
-
- strm->avail_in -= len;
-
- if (strm->state->wrap == 1) {
- strm->adler = adler32(strm->adler, strm->next_in, len);
- }
-#ifdef GZIP
- else if (strm->state->wrap == 2) {
- strm->adler = crc32(strm->adler, strm->next_in, len);
- }
-#endif
- zmemcpy(buf, strm->next_in, len);
- strm->next_in += len;
- strm->total_in += len;
-
- return (int)len;
-}
-
-/* ===========================================================================
- * Initialize the "longest match" routines for a new zlib stream
- */
-local void lm_init (s)
- deflate_state *s;
-{
- s->window_size = (ulg)2L*s->w_size;
-
- CLEAR_HASH(s);
-
- /* Set the default configuration parameters:
- */
- s->max_lazy_match = configuration_table[s->level].max_lazy;
- s->good_match = configuration_table[s->level].good_length;
- s->nice_match = configuration_table[s->level].nice_length;
- s->max_chain_length = configuration_table[s->level].max_chain;
-
- s->strstart = 0;
- s->block_start = 0L;
- s->lookahead = 0;
- s->match_length = s->prev_length = MIN_MATCH-1;
- s->match_available = 0;
- s->ins_h = 0;
-#ifndef FASTEST
-#ifdef ASMV
- match_init(); /* initialize the asm code */
-#endif
-#endif
-}
-
-#ifndef FASTEST
-/* ===========================================================================
- * Set match_start to the longest match starting at the given string and
- * return its length. Matches shorter or equal to prev_length are discarded,
- * in which case the result is equal to prev_length and match_start is
- * garbage.
- * IN assertions: cur_match is the head of the hash chain for the current
- * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1
- * OUT assertion: the match length is not greater than s->lookahead.
- */
-#ifndef ASMV
-/* For 80x86 and 680x0, an optimized version will be provided in match.asm or
- * match.S. The code will be functionally equivalent.
- */
-local uInt longest_match(s, cur_match)
- deflate_state *s;
- IPos cur_match; /* current match */
-{
- unsigned chain_length = s->max_chain_length;/* max hash chain length */
- register Bytef *scan = s->window + s->strstart; /* current string */
- register Bytef *match; /* matched string */
- register int len; /* length of current match */
- int best_len = s->prev_length; /* best match length so far */
- int nice_match = s->nice_match; /* stop if match long enough */
- IPos limit = s->strstart > (IPos)MAX_DIST(s) ?
- s->strstart - (IPos)MAX_DIST(s) : NIL;
- /* Stop when cur_match becomes <= limit. To simplify the code,
- * we prevent matches with the string of window index 0.
- */
- Posf *prev = s->prev;
- uInt wmask = s->w_mask;
-
-#ifdef UNALIGNED_OK
- /* Compare two bytes at a time. Note: this is not always beneficial.
- * Try with and without -DUNALIGNED_OK to check.
- */
- register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1;
- register ush scan_start = *(ushf*)scan;
- register ush scan_end = *(ushf*)(scan+best_len-1);
-#else
- register Bytef *strend = s->window + s->strstart + MAX_MATCH;
- register Byte scan_end1 = scan[best_len-1];
- register Byte scan_end = scan[best_len];
-#endif
-
- /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
- * It is easy to get rid of this optimization if necessary.
- */
- Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
-
- /* Do not waste too much time if we already have a good match: */
- if (s->prev_length >= s->good_match) {
- chain_length >>= 2;
- }
- /* Do not look for matches beyond the end of the input. This is necessary
- * to make deflate deterministic.
- */
- if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead;
-
- Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
-
- do {
- Assert(cur_match < s->strstart, "no future");
- match = s->window + cur_match;
-
- /* Skip to next match if the match length cannot increase
- * or if the match length is less than 2. Note that the checks below
- * for insufficient lookahead only occur occasionally for performance
- * reasons. Therefore uninitialized memory will be accessed, and
- * conditional jumps will be made that depend on those values.
- * However the length of the match is limited to the lookahead, so
- * the output of deflate is not affected by the uninitialized values.
- */
-#if (defined(UNALIGNED_OK) && MAX_MATCH == 258)
- /* This code assumes sizeof(unsigned short) == 2. Do not use
- * UNALIGNED_OK if your compiler uses a different size.
- */
- if (*(ushf*)(match+best_len-1) != scan_end ||
- *(ushf*)match != scan_start) continue;
-
- /* It is not necessary to compare scan[2] and match[2] since they are
- * always equal when the other bytes match, given that the hash keys
- * are equal and that HASH_BITS >= 8. Compare 2 bytes at a time at
- * strstart+3, +5, ... up to strstart+257. We check for insufficient
- * lookahead only every 4th comparison; the 128th check will be made
- * at strstart+257. If MAX_MATCH-2 is not a multiple of 8, it is
- * necessary to put more guard bytes at the end of the window, or
- * to check more often for insufficient lookahead.
- */
- Assert(scan[2] == match[2], "scan[2]?");
- scan++, match++;
- do {
- } while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
- *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
- *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
- *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
- scan < strend);
- /* The funny "do {}" generates better code on most compilers */
-
- /* Here, scan <= window+strstart+257 */
- Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
- if (*scan == *match) scan++;
-
- len = (MAX_MATCH - 1) - (int)(strend-scan);
- scan = strend - (MAX_MATCH-1);
-
-#else /* UNALIGNED_OK */
-
- if (match[best_len] != scan_end ||
- match[best_len-1] != scan_end1 ||
- *match != *scan ||
- *++match != scan[1]) continue;
-
- /* The check at best_len-1 can be removed because it will be made
- * again later. (This heuristic is not always a win.)
- * It is not necessary to compare scan[2] and match[2] since they
- * are always equal when the other bytes match, given that
- * the hash keys are equal and that HASH_BITS >= 8.
- */
- scan += 2, match++;
- Assert(*scan == *match, "match[2]?");
-
- /* We check for insufficient lookahead only every 8th comparison;
- * the 256th check will be made at strstart+258.
- */
- do {
- } while (*++scan == *++match && *++scan == *++match &&
- *++scan == *++match && *++scan == *++match &&
- *++scan == *++match && *++scan == *++match &&
- *++scan == *++match && *++scan == *++match &&
- scan < strend);
-
- Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
-
- len = MAX_MATCH - (int)(strend - scan);
- scan = strend - MAX_MATCH;
-
-#endif /* UNALIGNED_OK */
-
- if (len > best_len) {
- s->match_start = cur_match;
- best_len = len;
- if (len >= nice_match) break;
-#ifdef UNALIGNED_OK
- scan_end = *(ushf*)(scan+best_len-1);
-#else
- scan_end1 = scan[best_len-1];
- scan_end = scan[best_len];
-#endif
- }
- } while ((cur_match = prev[cur_match & wmask]) > limit
- && --chain_length != 0);
-
- if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
- return s->lookahead;
-}
-#endif /* ASMV */
-
-#else /* FASTEST */
-
-/* ---------------------------------------------------------------------------
- * Optimized version for FASTEST only
- */
-local uInt longest_match(s, cur_match)
- deflate_state *s;
- IPos cur_match; /* current match */
-{
- register Bytef *scan = s->window + s->strstart; /* current string */
- register Bytef *match; /* matched string */
- register int len; /* length of current match */
- register Bytef *strend = s->window + s->strstart + MAX_MATCH;
-
- /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
- * It is easy to get rid of this optimization if necessary.
- */
- Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
-
- Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
-
- Assert(cur_match < s->strstart, "no future");
-
- match = s->window + cur_match;
-
- /* Return failure if the match length is less than 2:
- */
- if (match[0] != scan[0] || match[1] != scan[1]) return MIN_MATCH-1;
-
- /* The check at best_len-1 can be removed because it will be made
- * again later. (This heuristic is not always a win.)
- * It is not necessary to compare scan[2] and match[2] since they
- * are always equal when the other bytes match, given that
- * the hash keys are equal and that HASH_BITS >= 8.
- */
- scan += 2, match += 2;
- Assert(*scan == *match, "match[2]?");
-
- /* We check for insufficient lookahead only every 8th comparison;
- * the 256th check will be made at strstart+258.
- */
- do {
- } while (*++scan == *++match && *++scan == *++match &&
- *++scan == *++match && *++scan == *++match &&
- *++scan == *++match && *++scan == *++match &&
- *++scan == *++match && *++scan == *++match &&
- scan < strend);
-
- Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
-
- len = MAX_MATCH - (int)(strend - scan);
-
- if (len < MIN_MATCH) return MIN_MATCH - 1;
-
- s->match_start = cur_match;
- return (uInt)len <= s->lookahead ? (uInt)len : s->lookahead;
-}
-
-#endif /* FASTEST */
-
-#ifdef DEBUG
-/* ===========================================================================
- * Check that the match at match_start is indeed a match.
- */
-local void check_match(s, start, match, length)
- deflate_state *s;
- IPos start, match;
- int length;
-{
- /* check that the match is indeed a match */
- if (zmemcmp(s->window + match,
- s->window + start, length) != EQUAL) {
- fprintf(stderr, " start %u, match %u, length %d\n",
- start, match, length);
- do {
- fprintf(stderr, "%c%c", s->window[match++], s->window[start++]);
- } while (--length != 0);
- z_error("invalid match");
- }
- if (z_verbose > 1) {
- fprintf(stderr,"\\[%d,%d]", start-match, length);
- do { putc(s->window[start++], stderr); } while (--length != 0);
- }
-}
-#else
-# define check_match(s, start, match, length)
-#endif /* DEBUG */
-
-/* ===========================================================================
- * Fill the window when the lookahead becomes insufficient.
- * Updates strstart and lookahead.
- *
- * IN assertion: lookahead < MIN_LOOKAHEAD
- * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD
- * At least one byte has been read, or avail_in == 0; reads are
- * performed for at least two bytes (required for the zip translate_eol
- * option -- not supported here).
- */
-local void fill_window(s)
- deflate_state *s;
-{
- register unsigned n, m;
- register Posf *p;
- unsigned more; /* Amount of free space at the end of the window. */
- uInt wsize = s->w_size;
-
- do {
- more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart);
-
- /* Deal with !@#$% 64K limit: */
- if (sizeof(int) <= 2) {
- if (more == 0 && s->strstart == 0 && s->lookahead == 0) {
- more = wsize;
-
- } else if (more == (unsigned)(-1)) {
- /* Very unlikely, but possible on 16 bit machine if
- * strstart == 0 && lookahead == 1 (input done a byte at time)
- */
- more--;
- }
- }
-
- /* If the window is almost full and there is insufficient lookahead,
- * move the upper half to the lower one to make room in the upper half.
- */
- if (s->strstart >= wsize+MAX_DIST(s)) {
-
- zmemcpy(s->window, s->window+wsize, (unsigned)wsize);
- s->match_start -= wsize;
- s->strstart -= wsize; /* we now have strstart >= MAX_DIST */
- s->block_start -= (long) wsize;
-
- /* Slide the hash table (could be avoided with 32 bit values
- at the expense of memory usage). We slide even when level == 0
- to keep the hash table consistent if we switch back to level > 0
- later. (Using level 0 permanently is not an optimal usage of
- zlib, so we don't care about this pathological case.)
- */
- n = s->hash_size;
- p = &s->head[n];
- do {
- m = *--p;
- *p = (Pos)(m >= wsize ? m-wsize : NIL);
- } while (--n);
-
- n = wsize;
-#ifndef FASTEST
- p = &s->prev[n];
- do {
- m = *--p;
- *p = (Pos)(m >= wsize ? m-wsize : NIL);
- /* If n is not on any hash chain, prev[n] is garbage but
- * its value will never be used.
- */
- } while (--n);
-#endif
- more += wsize;
- }
- if (s->strm->avail_in == 0) return;
-
- /* If there was no sliding:
- * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&
- * more == window_size - lookahead - strstart
- * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)
- * => more >= window_size - 2*WSIZE + 2
- * In the BIG_MEM or MMAP case (not yet supported),
- * window_size == input_size + MIN_LOOKAHEAD &&
- * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.
- * Otherwise, window_size == 2*WSIZE so more >= 2.
- * If there was sliding, more >= WSIZE. So in all cases, more >= 2.
- */
- Assert(more >= 2, "more < 2");
-
- n = read_buf(s->strm, s->window + s->strstart + s->lookahead, more);
- s->lookahead += n;
-
- /* Initialize the hash value now that we have some input: */
- if (s->lookahead >= MIN_MATCH) {
- s->ins_h = s->window[s->strstart];
- UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]);
-#if MIN_MATCH != 3
- Call UPDATE_HASH() MIN_MATCH-3 more times
-#endif
- }
- /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,
- * but this is not important since only literal bytes will be emitted.
- */
-
- } while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0);
-
- /* If the WIN_INIT bytes after the end of the current data have never been
- * written, then zero those bytes in order to avoid memory check reports of
- * the use of uninitialized (or uninitialised as Julian writes) bytes by
- * the longest match routines. Update the high water mark for the next
- * time through here. WIN_INIT is set to MAX_MATCH since the longest match
- * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.
- */
- if (s->high_water < s->window_size) {
- ulg curr = s->strstart + (ulg)(s->lookahead);
- ulg init;
-
- if (s->high_water < curr) {
- /* Previous high water mark below current data -- zero WIN_INIT
- * bytes or up to end of window, whichever is less.
- */
- init = s->window_size - curr;
- if (init > WIN_INIT)
- init = WIN_INIT;
- zmemzero(s->window + curr, (unsigned)init);
- s->high_water = curr + init;
- }
- else if (s->high_water < (ulg)curr + WIN_INIT) {
- /* High water mark at or above current data, but below current data
- * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up
- * to end of window, whichever is less.
- */
- init = (ulg)curr + WIN_INIT - s->high_water;
- if (init > s->window_size - s->high_water)
- init = s->window_size - s->high_water;
- zmemzero(s->window + s->high_water, (unsigned)init);
- s->high_water += init;
- }
- }
-}
-
-/* ===========================================================================
- * Flush the current block, with given end-of-file flag.
- * IN assertion: strstart is set to the end of the current match.
- */
-#define FLUSH_BLOCK_ONLY(s, last) { \
- _tr_flush_block(s, (s->block_start >= 0L ? \
- (charf *)&s->window[(unsigned)s->block_start] : \
- (charf *)Z_NULL), \
- (ulg)((long)s->strstart - s->block_start), \
- (last)); \
- s->block_start = s->strstart; \
- flush_pending(s->strm); \
- Tracev((stderr,"[FLUSH]")); \
-}
-
-/* Same but force premature exit if necessary. */
-#define FLUSH_BLOCK(s, last) { \
- FLUSH_BLOCK_ONLY(s, last); \
- if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \
-}
-
-/* ===========================================================================
- * Copy without compression as much as possible from the input stream, return
- * the current block state.
- * This function does not insert new strings in the dictionary since
- * uncompressible data is probably not useful. This function is used
- * only for the level=0 compression option.
- * NOTE: this function should be optimized to avoid extra copying from
- * window to pending_buf.
- */
-local block_state deflate_stored(s, flush)
- deflate_state *s;
- int flush;
-{
- /* Stored blocks are limited to 0xffff bytes, pending_buf is limited
- * to pending_buf_size, and each stored block has a 5 byte header:
- */
- ulg max_block_size = 0xffff;
- ulg max_start;
-
- if (max_block_size > s->pending_buf_size - 5) {
- max_block_size = s->pending_buf_size - 5;
- }
-
- /* Copy as much as possible from input to output: */
- for (;;) {
- /* Fill the window as much as possible: */
- if (s->lookahead <= 1) {
-
- Assert(s->strstart < s->w_size+MAX_DIST(s) ||
- s->block_start >= (long)s->w_size, "slide too late");
-
- fill_window(s);
- if (s->lookahead == 0 && flush == Z_NO_FLUSH) return need_more;
-
- if (s->lookahead == 0) break; /* flush the current block */
- }
- Assert(s->block_start >= 0L, "block gone");
-
- s->strstart += s->lookahead;
- s->lookahead = 0;
-
- /* Emit a stored block if pending_buf will be full: */
- max_start = s->block_start + max_block_size;
- if (s->strstart == 0 || (ulg)s->strstart >= max_start) {
- /* strstart == 0 is possible when wraparound on 16-bit machine */
- s->lookahead = (uInt)(s->strstart - max_start);
- s->strstart = (uInt)max_start;
- FLUSH_BLOCK(s, 0);
- }
- /* Flush if we may have to slide, otherwise block_start may become
- * negative and the data will be gone:
- */
- if (s->strstart - (uInt)s->block_start >= MAX_DIST(s)) {
- FLUSH_BLOCK(s, 0);
- }
- }
- FLUSH_BLOCK(s, flush == Z_FINISH);
- return flush == Z_FINISH ? finish_done : block_done;
-}
-
-/* ===========================================================================
- * Compress as much as possible from the input stream, return the current
- * block state.
- * This function does not perform lazy evaluation of matches and inserts
- * new strings in the dictionary only for unmatched strings or for short
- * matches. It is used only for the fast compression options.
- */
-local block_state deflate_fast(s, flush)
- deflate_state *s;
- int flush;
-{
- IPos hash_head; /* head of the hash chain */
- int bflush; /* set if current block must be flushed */
-
- for (;;) {
- /* Make sure that we always have enough lookahead, except
- * at the end of the input file. We need MAX_MATCH bytes
- * for the next match, plus MIN_MATCH bytes to insert the
- * string following the next match.
- */
- if (s->lookahead < MIN_LOOKAHEAD) {
- fill_window(s);
- if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
- return need_more;
- }
- if (s->lookahead == 0) break; /* flush the current block */
- }
-
- /* Insert the string window[strstart .. strstart+2] in the
- * dictionary, and set hash_head to the head of the hash chain:
- */
- hash_head = NIL;
- if (s->lookahead >= MIN_MATCH) {
- INSERT_STRING(s, s->strstart, hash_head);
- }
-
- /* Find the longest match, discarding those <= prev_length.
- * At this point we have always match_length < MIN_MATCH
- */
- if (hash_head != NIL && s->strstart - hash_head <= MAX_DIST(s)) {
- /* To simplify the code, we prevent matches with the string
- * of window index 0 (in particular we have to avoid a match
- * of the string with itself at the start of the input file).
- */
- s->match_length = longest_match (s, hash_head);
- /* longest_match() sets match_start */
- }
- if (s->match_length >= MIN_MATCH) {
- check_match(s, s->strstart, s->match_start, s->match_length);
-
- _tr_tally_dist(s, s->strstart - s->match_start,
- s->match_length - MIN_MATCH, bflush);
-
- s->lookahead -= s->match_length;
-
- /* Insert new strings in the hash table only if the match length
- * is not too large. This saves time but degrades compression.
- */
-#ifndef FASTEST
- if (s->match_length <= s->max_insert_length &&
- s->lookahead >= MIN_MATCH) {
- s->match_length--; /* string at strstart already in table */
- do {
- s->strstart++;
- INSERT_STRING(s, s->strstart, hash_head);
- /* strstart never exceeds WSIZE-MAX_MATCH, so there are
- * always MIN_MATCH bytes ahead.
- */
- } while (--s->match_length != 0);
- s->strstart++;
- } else
-#endif
- {
- s->strstart += s->match_length;
- s->match_length = 0;
- s->ins_h = s->window[s->strstart];
- UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]);
-#if MIN_MATCH != 3
- Call UPDATE_HASH() MIN_MATCH-3 more times
-#endif
- /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not
- * matter since it will be recomputed at next deflate call.
- */
- }
- } else {
- /* No match, output a literal byte */
- Tracevv((stderr,"%c", s->window[s->strstart]));
- _tr_tally_lit (s, s->window[s->strstart], bflush);
- s->lookahead--;
- s->strstart++;
- }
- if (bflush) FLUSH_BLOCK(s, 0);
- }
- FLUSH_BLOCK(s, flush == Z_FINISH);
- return flush == Z_FINISH ? finish_done : block_done;
-}
-
-#ifndef FASTEST
-/* ===========================================================================
- * Same as above, but achieves better compression. We use a lazy
- * evaluation for matches: a match is finally adopted only if there is
- * no better match at the next window position.
- */
-local block_state deflate_slow(s, flush)
- deflate_state *s;
- int flush;
-{
- IPos hash_head; /* head of hash chain */
- int bflush; /* set if current block must be flushed */
-
- /* Process the input block. */
- for (;;) {
- /* Make sure that we always have enough lookahead, except
- * at the end of the input file. We need MAX_MATCH bytes
- * for the next match, plus MIN_MATCH bytes to insert the
- * string following the next match.
- */
- if (s->lookahead < MIN_LOOKAHEAD) {
- fill_window(s);
- if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
- return need_more;
- }
- if (s->lookahead == 0) break; /* flush the current block */
- }
-
- /* Insert the string window[strstart .. strstart+2] in the
- * dictionary, and set hash_head to the head of the hash chain:
- */
- hash_head = NIL;
- if (s->lookahead >= MIN_MATCH) {
- INSERT_STRING(s, s->strstart, hash_head);
- }
-
- /* Find the longest match, discarding those <= prev_length.
- */
- s->prev_length = s->match_length, s->prev_match = s->match_start;
- s->match_length = MIN_MATCH-1;
-
- if (hash_head != NIL && s->prev_length < s->max_lazy_match &&
- s->strstart - hash_head <= MAX_DIST(s)) {
- /* To simplify the code, we prevent matches with the string
- * of window index 0 (in particular we have to avoid a match
- * of the string with itself at the start of the input file).
- */
- s->match_length = longest_match (s, hash_head);
- /* longest_match() sets match_start */
-
- if (s->match_length <= 5 && (s->strategy == Z_FILTERED
-#if TOO_FAR <= 32767
- || (s->match_length == MIN_MATCH &&
- s->strstart - s->match_start > TOO_FAR)
-#endif
- )) {
-
- /* If prev_match is also MIN_MATCH, match_start is garbage
- * but we will ignore the current match anyway.
- */
- s->match_length = MIN_MATCH-1;
- }
- }
- /* If there was a match at the previous step and the current
- * match is not better, output the previous match:
- */
- if (s->prev_length >= MIN_MATCH && s->match_length <= s->prev_length) {
- uInt max_insert = s->strstart + s->lookahead - MIN_MATCH;
- /* Do not insert strings in hash table beyond this. */
-
- check_match(s, s->strstart-1, s->prev_match, s->prev_length);
-
- _tr_tally_dist(s, s->strstart -1 - s->prev_match,
- s->prev_length - MIN_MATCH, bflush);
-
- /* Insert in hash table all strings up to the end of the match.
- * strstart-1 and strstart are already inserted. If there is not
- * enough lookahead, the last two strings are not inserted in
- * the hash table.
- */
- s->lookahead -= s->prev_length-1;
- s->prev_length -= 2;
- do {
- if (++s->strstart <= max_insert) {
- INSERT_STRING(s, s->strstart, hash_head);
- }
- } while (--s->prev_length != 0);
- s->match_available = 0;
- s->match_length = MIN_MATCH-1;
- s->strstart++;
-
- if (bflush) FLUSH_BLOCK(s, 0);
-
- } else if (s->match_available) {
- /* If there was no match at the previous position, output a
- * single literal. If there was a match but the current match
- * is longer, truncate the previous match to a single literal.
- */
- Tracevv((stderr,"%c", s->window[s->strstart-1]));
- _tr_tally_lit(s, s->window[s->strstart-1], bflush);
- if (bflush) {
- FLUSH_BLOCK_ONLY(s, 0);
- }
- s->strstart++;
- s->lookahead--;
- if (s->strm->avail_out == 0) return need_more;
- } else {
- /* There is no previous match to compare with, wait for
- * the next step to decide.
- */
- s->match_available = 1;
- s->strstart++;
- s->lookahead--;
- }
- }
- Assert (flush != Z_NO_FLUSH, "no flush?");
- if (s->match_available) {
- Tracevv((stderr,"%c", s->window[s->strstart-1]));
- _tr_tally_lit(s, s->window[s->strstart-1], bflush);
- s->match_available = 0;
- }
- FLUSH_BLOCK(s, flush == Z_FINISH);
- return flush == Z_FINISH ? finish_done : block_done;
-}
-#endif /* FASTEST */
-
-/* ===========================================================================
- * For Z_RLE, simply look for runs of bytes, generate matches only of distance
- * one. Do not maintain a hash table. (It will be regenerated if this run of
- * deflate switches away from Z_RLE.)
- */
-local block_state deflate_rle(s, flush)
- deflate_state *s;
- int flush;
-{
- int bflush; /* set if current block must be flushed */
- uInt prev; /* byte at distance one to match */
- Bytef *scan, *strend; /* scan goes up to strend for length of run */
-
- for (;;) {
- /* Make sure that we always have enough lookahead, except
- * at the end of the input file. We need MAX_MATCH bytes
- * for the longest encodable run.
- */
- if (s->lookahead < MAX_MATCH) {
- fill_window(s);
- if (s->lookahead < MAX_MATCH && flush == Z_NO_FLUSH) {
- return need_more;
- }
- if (s->lookahead == 0) break; /* flush the current block */
- }
-
- /* See how many times the previous byte repeats */
- s->match_length = 0;
- if (s->lookahead >= MIN_MATCH && s->strstart > 0) {
- scan = s->window + s->strstart - 1;
- prev = *scan;
- if (prev == *++scan && prev == *++scan && prev == *++scan) {
- strend = s->window + s->strstart + MAX_MATCH;
- do {
- } while (prev == *++scan && prev == *++scan &&
- prev == *++scan && prev == *++scan &&
- prev == *++scan && prev == *++scan &&
- prev == *++scan && prev == *++scan &&
- scan < strend);
- s->match_length = MAX_MATCH - (int)(strend - scan);
- if (s->match_length > s->lookahead)
- s->match_length = s->lookahead;
- }
- }
-
- /* Emit match if have run of MIN_MATCH or longer, else emit literal */
- if (s->match_length >= MIN_MATCH) {
- check_match(s, s->strstart, s->strstart - 1, s->match_length);
-
- _tr_tally_dist(s, 1, s->match_length - MIN_MATCH, bflush);
-
- s->lookahead -= s->match_length;
- s->strstart += s->match_length;
- s->match_length = 0;
- } else {
- /* No match, output a literal byte */
- Tracevv((stderr,"%c", s->window[s->strstart]));
- _tr_tally_lit (s, s->window[s->strstart], bflush);
- s->lookahead--;
- s->strstart++;
- }
- if (bflush) FLUSH_BLOCK(s, 0);
- }
- FLUSH_BLOCK(s, flush == Z_FINISH);
- return flush == Z_FINISH ? finish_done : block_done;
-}
-
-/* ===========================================================================
- * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table.
- * (It will be regenerated if this run of deflate switches away from Huffman.)
- */
-local block_state deflate_huff(s, flush)
- deflate_state *s;
- int flush;
-{
- int bflush; /* set if current block must be flushed */
-
- for (;;) {
- /* Make sure that we have a literal to write. */
- if (s->lookahead == 0) {
- fill_window(s);
- if (s->lookahead == 0) {
- if (flush == Z_NO_FLUSH)
- return need_more;
- break; /* flush the current block */
- }
- }
-
- /* Output a literal byte */
- s->match_length = 0;
- Tracevv((stderr,"%c", s->window[s->strstart]));
- _tr_tally_lit (s, s->window[s->strstart], bflush);
- s->lookahead--;
- s->strstart++;
- if (bflush) FLUSH_BLOCK(s, 0);
- }
- FLUSH_BLOCK(s, flush == Z_FINISH);
- return flush == Z_FINISH ? finish_done : block_done;
-}
diff --git a/3rdparty/assimp/contrib/zlib/deflate.h b/3rdparty/assimp/contrib/zlib/deflate.h
deleted file mode 100644
index cbf0d1ea..00000000
--- a/3rdparty/assimp/contrib/zlib/deflate.h
+++ /dev/null
@@ -1,342 +0,0 @@
-/* deflate.h -- internal compression state
- * Copyright (C) 1995-2010 Jean-loup Gailly
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* WARNING: this file should *not* be used by applications. It is
- part of the implementation of the compression library and is
- subject to change. Applications should only use zlib.h.
- */
-
-/* @(#) $Id$ */
-
-#ifndef DEFLATE_H
-#define DEFLATE_H
-
-#include "zutil.h"
-
-/* define NO_GZIP when compiling if you want to disable gzip header and
- trailer creation by deflate(). NO_GZIP would be used to avoid linking in
- the crc code when it is not needed. For shared libraries, gzip encoding
- should be left enabled. */
-#ifndef NO_GZIP
-# define GZIP
-#endif
-
-/* ===========================================================================
- * Internal compression state.
- */
-
-#define LENGTH_CODES 29
-/* number of length codes, not counting the special END_BLOCK code */
-
-#define LITERALS 256
-/* number of literal bytes 0..255 */
-
-#define L_CODES (LITERALS+1+LENGTH_CODES)
-/* number of Literal or Length codes, including the END_BLOCK code */
-
-#define D_CODES 30
-/* number of distance codes */
-
-#define BL_CODES 19
-/* number of codes used to transfer the bit lengths */
-
-#define HEAP_SIZE (2*L_CODES+1)
-/* maximum heap size */
-
-#define MAX_BITS 15
-/* All codes must not exceed MAX_BITS bits */
-
-#define INIT_STATE 42
-#define EXTRA_STATE 69
-#define NAME_STATE 73
-#define COMMENT_STATE 91
-#define HCRC_STATE 103
-#define BUSY_STATE 113
-#define FINISH_STATE 666
-/* Stream status */
-
-
-/* Data structure describing a single value and its code string. */
-typedef struct ct_data_s {
- union {
- ush freq; /* frequency count */
- ush code; /* bit string */
- } fc;
- union {
- ush dad; /* father node in Huffman tree */
- ush len; /* length of bit string */
- } dl;
-} FAR ct_data;
-
-#define Freq fc.freq
-#define Code fc.code
-#define Dad dl.dad
-#define Len dl.len
-
-typedef struct static_tree_desc_s static_tree_desc;
-
-typedef struct tree_desc_s {
- ct_data *dyn_tree; /* the dynamic tree */
- int max_code; /* largest code with non zero frequency */
- static_tree_desc *stat_desc; /* the corresponding static tree */
-} FAR tree_desc;
-
-typedef ush Pos;
-typedef Pos FAR Posf;
-typedef unsigned IPos;
-
-/* A Pos is an index in the character window. We use short instead of int to
- * save space in the various tables. IPos is used only for parameter passing.
- */
-
-typedef struct internal_state {
- z_streamp strm; /* pointer back to this zlib stream */
- int status; /* as the name implies */
- Bytef *pending_buf; /* output still pending */
- ulg pending_buf_size; /* size of pending_buf */
- Bytef *pending_out; /* next pending byte to output to the stream */
- uInt pending; /* nb of bytes in the pending buffer */
- int wrap; /* bit 0 true for zlib, bit 1 true for gzip */
- gz_headerp gzhead; /* gzip header information to write */
- uInt gzindex; /* where in extra, name, or comment */
- Byte method; /* STORED (for zip only) or DEFLATED */
- int last_flush; /* value of flush param for previous deflate call */
-
- /* used by deflate.c: */
-
- uInt w_size; /* LZ77 window size (32K by default) */
- uInt w_bits; /* log2(w_size) (8..16) */
- uInt w_mask; /* w_size - 1 */
-
- Bytef *window;
- /* Sliding window. Input bytes are read into the second half of the window,
- * and move to the first half later to keep a dictionary of at least wSize
- * bytes. With this organization, matches are limited to a distance of
- * wSize-MAX_MATCH bytes, but this ensures that IO is always
- * performed with a length multiple of the block size. Also, it limits
- * the window size to 64K, which is quite useful on MSDOS.
- * To do: use the user input buffer as sliding window.
- */
-
- ulg window_size;
- /* Actual size of window: 2*wSize, except when the user input buffer
- * is directly used as sliding window.
- */
-
- Posf *prev;
- /* Link to older string with same hash index. To limit the size of this
- * array to 64K, this link is maintained only for the last 32K strings.
- * An index in this array is thus a window index modulo 32K.
- */
-
- Posf *head; /* Heads of the hash chains or NIL. */
-
- uInt ins_h; /* hash index of string to be inserted */
- uInt hash_size; /* number of elements in hash table */
- uInt hash_bits; /* log2(hash_size) */
- uInt hash_mask; /* hash_size-1 */
-
- uInt hash_shift;
- /* Number of bits by which ins_h must be shifted at each input
- * step. It must be such that after MIN_MATCH steps, the oldest
- * byte no longer takes part in the hash key, that is:
- * hash_shift * MIN_MATCH >= hash_bits
- */
-
- long block_start;
- /* Window position at the beginning of the current output block. Gets
- * negative when the window is moved backwards.
- */
-
- uInt match_length; /* length of best match */
- IPos prev_match; /* previous match */
- int match_available; /* set if previous match exists */
- uInt strstart; /* start of string to insert */
- uInt match_start; /* start of matching string */
- uInt lookahead; /* number of valid bytes ahead in window */
-
- uInt prev_length;
- /* Length of the best match at previous step. Matches not greater than this
- * are discarded. This is used in the lazy match evaluation.
- */
-
- uInt max_chain_length;
- /* To speed up deflation, hash chains are never searched beyond this
- * length. A higher limit improves compression ratio but degrades the
- * speed.
- */
-
- uInt max_lazy_match;
- /* Attempt to find a better match only when the current match is strictly
- * smaller than this value. This mechanism is used only for compression
- * levels >= 4.
- */
-# define max_insert_length max_lazy_match
- /* Insert new strings in the hash table only if the match length is not
- * greater than this length. This saves time but degrades compression.
- * max_insert_length is used only for compression levels <= 3.
- */
-
- int level; /* compression level (1..9) */
- int strategy; /* favor or force Huffman coding*/
-
- uInt good_match;
- /* Use a faster search when the previous match is longer than this */
-
- int nice_match; /* Stop searching when current match exceeds this */
-
- /* used by trees.c: */
- /* Didn't use ct_data typedef below to supress compiler warning */
- struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */
- struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */
- struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */
-
- struct tree_desc_s l_desc; /* desc. for literal tree */
- struct tree_desc_s d_desc; /* desc. for distance tree */
- struct tree_desc_s bl_desc; /* desc. for bit length tree */
-
- ush bl_count[MAX_BITS+1];
- /* number of codes at each bit length for an optimal tree */
-
- int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */
- int heap_len; /* number of elements in the heap */
- int heap_max; /* element of largest frequency */
- /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.
- * The same heap array is used to build all trees.
- */
-
- uch depth[2*L_CODES+1];
- /* Depth of each subtree used as tie breaker for trees of equal frequency
- */
-
- uchf *l_buf; /* buffer for literals or lengths */
-
- uInt lit_bufsize;
- /* Size of match buffer for literals/lengths. There are 4 reasons for
- * limiting lit_bufsize to 64K:
- * - frequencies can be kept in 16 bit counters
- * - if compression is not successful for the first block, all input
- * data is still in the window so we can still emit a stored block even
- * when input comes from standard input. (This can also be done for
- * all blocks if lit_bufsize is not greater than 32K.)
- * - if compression is not successful for a file smaller than 64K, we can
- * even emit a stored file instead of a stored block (saving 5 bytes).
- * This is applicable only for zip (not gzip or zlib).
- * - creating new Huffman trees less frequently may not provide fast
- * adaptation to changes in the input data statistics. (Take for
- * example a binary file with poorly compressible code followed by
- * a highly compressible string table.) Smaller buffer sizes give
- * fast adaptation but have of course the overhead of transmitting
- * trees more frequently.
- * - I can't count above 4
- */
-
- uInt last_lit; /* running index in l_buf */
-
- ushf *d_buf;
- /* Buffer for distances. To simplify the code, d_buf and l_buf have
- * the same number of elements. To use different lengths, an extra flag
- * array would be necessary.
- */
-
- ulg opt_len; /* bit length of current block with optimal trees */
- ulg static_len; /* bit length of current block with static trees */
- uInt matches; /* number of string matches in current block */
- int last_eob_len; /* bit length of EOB code for last block */
-
-#ifdef DEBUG
- ulg compressed_len; /* total bit length of compressed file mod 2^32 */
- ulg bits_sent; /* bit length of compressed data sent mod 2^32 */
-#endif
-
- ush bi_buf;
- /* Output buffer. bits are inserted starting at the bottom (least
- * significant bits).
- */
- int bi_valid;
- /* Number of valid bits in bi_buf. All bits above the last valid bit
- * are always zero.
- */
-
- ulg high_water;
- /* High water mark offset in window for initialized bytes -- bytes above
- * this are set to zero in order to avoid memory check warnings when
- * longest match routines access bytes past the input. This is then
- * updated to the new high water mark.
- */
-
-} FAR deflate_state;
-
-/* Output a byte on the stream.
- * IN assertion: there is enough room in pending_buf.
- */
-#define put_byte(s, c) {s->pending_buf[s->pending++] = (c);}
-
-
-#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
-/* Minimum amount of lookahead, except at the end of the input file.
- * See deflate.c for comments about the MIN_MATCH+1.
- */
-
-#define MAX_DIST(s) ((s)->w_size-MIN_LOOKAHEAD)
-/* In order to simplify the code, particularly on 16 bit machines, match
- * distances are limited to MAX_DIST instead of WSIZE.
- */
-
-#define WIN_INIT MAX_MATCH
-/* Number of bytes after end of data in window to initialize in order to avoid
- memory checker errors from longest match routines */
-
- /* in trees.c */
-void ZLIB_INTERNAL _tr_init OF((deflate_state *s));
-int ZLIB_INTERNAL _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc));
-void ZLIB_INTERNAL _tr_flush_block OF((deflate_state *s, charf *buf,
- ulg stored_len, int last));
-void ZLIB_INTERNAL _tr_align OF((deflate_state *s));
-void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf,
- ulg stored_len, int last));
-
-#define d_code(dist) \
- ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])
-/* Mapping from a distance to a distance code. dist is the distance - 1 and
- * must not have side effects. _dist_code[256] and _dist_code[257] are never
- * used.
- */
-
-#ifndef DEBUG
-/* Inline versions of _tr_tally for speed: */
-
-#if defined(GEN_TREES_H) || !defined(STDC)
- extern uch ZLIB_INTERNAL _length_code[];
- extern uch ZLIB_INTERNAL _dist_code[];
-#else
- extern const uch ZLIB_INTERNAL _length_code[];
- extern const uch ZLIB_INTERNAL _dist_code[];
-#endif
-
-# define _tr_tally_lit(s, c, flush) \
- { uch cc = (c); \
- s->d_buf[s->last_lit] = 0; \
- s->l_buf[s->last_lit++] = cc; \
- s->dyn_ltree[cc].Freq++; \
- flush = (s->last_lit == s->lit_bufsize-1); \
- }
-# define _tr_tally_dist(s, distance, length, flush) \
- { uch len = (length); \
- ush dist = (distance); \
- s->d_buf[s->last_lit] = dist; \
- s->l_buf[s->last_lit++] = len; \
- dist--; \
- s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
- s->dyn_dtree[d_code(dist)].Freq++; \
- flush = (s->last_lit == s->lit_bufsize-1); \
- }
-#else
-# define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c)
-# define _tr_tally_dist(s, distance, length, flush) \
- flush = _tr_tally(s, distance, length)
-#endif
-
-#endif /* DEFLATE_H */
diff --git a/3rdparty/assimp/contrib/zlib/inffast.c b/3rdparty/assimp/contrib/zlib/inffast.c
deleted file mode 100644
index 2f1d60b4..00000000
--- a/3rdparty/assimp/contrib/zlib/inffast.c
+++ /dev/null
@@ -1,340 +0,0 @@
-/* inffast.c -- fast decoding
- * Copyright (C) 1995-2008, 2010 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-#include "zutil.h"
-#include "inftrees.h"
-#include "inflate.h"
-#include "inffast.h"
-
-#ifndef ASMINF
-
-/* Allow machine dependent optimization for post-increment or pre-increment.
- Based on testing to date,
- Pre-increment preferred for:
- - PowerPC G3 (Adler)
- - MIPS R5000 (Randers-Pehrson)
- Post-increment preferred for:
- - none
- No measurable difference:
- - Pentium III (Anderson)
- - M68060 (Nikl)
- */
-#ifdef POSTINC
-# define OFF 0
-# define PUP(a) *(a)++
-#else
-# define OFF 1
-# define PUP(a) *++(a)
-#endif
-
-/*
- Decode literal, length, and distance codes and write out the resulting
- literal and match bytes until either not enough input or output is
- available, an end-of-block is encountered, or a data error is encountered.
- When large enough input and output buffers are supplied to inflate(), for
- example, a 16K input buffer and a 64K output buffer, more than 95% of the
- inflate execution time is spent in this routine.
-
- Entry assumptions:
-
- state->mode == LEN
- strm->avail_in >= 6
- strm->avail_out >= 258
- start >= strm->avail_out
- state->bits < 8
-
- On return, state->mode is one of:
-
- LEN -- ran out of enough output space or enough available input
- TYPE -- reached end of block code, inflate() to interpret next block
- BAD -- error in block data
-
- Notes:
-
- - The maximum input bits used by a length/distance pair is 15 bits for the
- length code, 5 bits for the length extra, 15 bits for the distance code,
- and 13 bits for the distance extra. This totals 48 bits, or six bytes.
- Therefore if strm->avail_in >= 6, then there is enough input to avoid
- checking for available input while decoding.
-
- - The maximum bytes that a single length/distance pair can output is 258
- bytes, which is the maximum length that can be coded. inflate_fast()
- requires strm->avail_out >= 258 for each loop to avoid checking for
- output space.
- */
-void ZLIB_INTERNAL inflate_fast(strm, start)
-z_streamp strm;
-unsigned start; /* inflate()'s starting value for strm->avail_out */
-{
- struct inflate_state FAR *state;
- unsigned char FAR *in; /* local strm->next_in */
- unsigned char FAR *last; /* while in < last, enough input available */
- unsigned char FAR *out; /* local strm->next_out */
- unsigned char FAR *beg; /* inflate()'s initial strm->next_out */
- unsigned char FAR *end; /* while out < end, enough space available */
-#ifdef INFLATE_STRICT
- unsigned dmax; /* maximum distance from zlib header */
-#endif
- unsigned wsize; /* window size or zero if not using window */
- unsigned whave; /* valid bytes in the window */
- unsigned wnext; /* window write index */
- unsigned char FAR *window; /* allocated sliding window, if wsize != 0 */
- unsigned long hold; /* local strm->hold */
- unsigned bits; /* local strm->bits */
- code const FAR *lcode; /* local strm->lencode */
- code const FAR *dcode; /* local strm->distcode */
- unsigned lmask; /* mask for first level of length codes */
- unsigned dmask; /* mask for first level of distance codes */
- code here; /* retrieved table entry */
- unsigned op; /* code bits, operation, extra bits, or */
- /* window position, window bytes to copy */
- unsigned len; /* match length, unused bytes */
- unsigned dist; /* match distance */
- unsigned char FAR *from; /* where to copy match from */
-
- /* copy state to local variables */
- state = (struct inflate_state FAR *)strm->state;
- in = strm->next_in - OFF;
- last = in + (strm->avail_in - 5);
- out = strm->next_out - OFF;
- beg = out - (start - strm->avail_out);
- end = out + (strm->avail_out - 257);
-#ifdef INFLATE_STRICT
- dmax = state->dmax;
-#endif
- wsize = state->wsize;
- whave = state->whave;
- wnext = state->wnext;
- window = state->window;
- hold = state->hold;
- bits = state->bits;
- lcode = state->lencode;
- dcode = state->distcode;
- lmask = (1U << state->lenbits) - 1;
- dmask = (1U << state->distbits) - 1;
-
- /* decode literals and length/distances until end-of-block or not enough
- input data or output space */
- do {
- if (bits < 15) {
- hold += (unsigned long)(PUP(in)) << bits;
- bits += 8;
- hold += (unsigned long)(PUP(in)) << bits;
- bits += 8;
- }
- here = lcode[hold & lmask];
- dolen:
- op = (unsigned)(here.bits);
- hold >>= op;
- bits -= op;
- op = (unsigned)(here.op);
- if (op == 0) { /* literal */
- Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
- "inflate: literal '%c'\n" :
- "inflate: literal 0x%02x\n", here.val));
- PUP(out) = (unsigned char)(here.val);
- }
- else if (op & 16) { /* length base */
- len = (unsigned)(here.val);
- op &= 15; /* number of extra bits */
- if (op) {
- if (bits < op) {
- hold += (unsigned long)(PUP(in)) << bits;
- bits += 8;
- }
- len += (unsigned)hold & ((1U << op) - 1);
- hold >>= op;
- bits -= op;
- }
- Tracevv((stderr, "inflate: length %u\n", len));
- if (bits < 15) {
- hold += (unsigned long)(PUP(in)) << bits;
- bits += 8;
- hold += (unsigned long)(PUP(in)) << bits;
- bits += 8;
- }
- here = dcode[hold & dmask];
- dodist:
- op = (unsigned)(here.bits);
- hold >>= op;
- bits -= op;
- op = (unsigned)(here.op);
- if (op & 16) { /* distance base */
- dist = (unsigned)(here.val);
- op &= 15; /* number of extra bits */
- if (bits < op) {
- hold += (unsigned long)(PUP(in)) << bits;
- bits += 8;
- if (bits < op) {
- hold += (unsigned long)(PUP(in)) << bits;
- bits += 8;
- }
- }
- dist += (unsigned)hold & ((1U << op) - 1);
-#ifdef INFLATE_STRICT
- if (dist > dmax) {
- strm->msg = (char *)"invalid distance too far back";
- state->mode = BAD;
- break;
- }
-#endif
- hold >>= op;
- bits -= op;
- Tracevv((stderr, "inflate: distance %u\n", dist));
- op = (unsigned)(out - beg); /* max distance in output */
- if (dist > op) { /* see if copy from window */
- op = dist - op; /* distance back in window */
- if (op > whave) {
- if (state->sane) {
- strm->msg =
- (char *)"invalid distance too far back";
- state->mode = BAD;
- break;
- }
-#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
- if (len <= op - whave) {
- do {
- PUP(out) = 0;
- } while (--len);
- continue;
- }
- len -= op - whave;
- do {
- PUP(out) = 0;
- } while (--op > whave);
- if (op == 0) {
- from = out - dist;
- do {
- PUP(out) = PUP(from);
- } while (--len);
- continue;
- }
-#endif
- }
- from = window - OFF;
- if (wnext == 0) { /* very common case */
- from += wsize - op;
- if (op < len) { /* some from window */
- len -= op;
- do {
- PUP(out) = PUP(from);
- } while (--op);
- from = out - dist; /* rest from output */
- }
- }
- else if (wnext < op) { /* wrap around window */
- from += wsize + wnext - op;
- op -= wnext;
- if (op < len) { /* some from end of window */
- len -= op;
- do {
- PUP(out) = PUP(from);
- } while (--op);
- from = window - OFF;
- if (wnext < len) { /* some from start of window */
- op = wnext;
- len -= op;
- do {
- PUP(out) = PUP(from);
- } while (--op);
- from = out - dist; /* rest from output */
- }
- }
- }
- else { /* contiguous in window */
- from += wnext - op;
- if (op < len) { /* some from window */
- len -= op;
- do {
- PUP(out) = PUP(from);
- } while (--op);
- from = out - dist; /* rest from output */
- }
- }
- while (len > 2) {
- PUP(out) = PUP(from);
- PUP(out) = PUP(from);
- PUP(out) = PUP(from);
- len -= 3;
- }
- if (len) {
- PUP(out) = PUP(from);
- if (len > 1)
- PUP(out) = PUP(from);
- }
- }
- else {
- from = out - dist; /* copy direct from output */
- do { /* minimum length is three */
- PUP(out) = PUP(from);
- PUP(out) = PUP(from);
- PUP(out) = PUP(from);
- len -= 3;
- } while (len > 2);
- if (len) {
- PUP(out) = PUP(from);
- if (len > 1)
- PUP(out) = PUP(from);
- }
- }
- }
- else if ((op & 64) == 0) { /* 2nd level distance code */
- here = dcode[here.val + (hold & ((1U << op) - 1))];
- goto dodist;
- }
- else {
- strm->msg = (char *)"invalid distance code";
- state->mode = BAD;
- break;
- }
- }
- else if ((op & 64) == 0) { /* 2nd level length code */
- here = lcode[here.val + (hold & ((1U << op) - 1))];
- goto dolen;
- }
- else if (op & 32) { /* end-of-block */
- Tracevv((stderr, "inflate: end of block\n"));
- state->mode = TYPE;
- break;
- }
- else {
- strm->msg = (char *)"invalid literal/length code";
- state->mode = BAD;
- break;
- }
- } while (in < last && out < end);
-
- /* return unused bytes (on entry, bits < 8, so in won't go too far back) */
- len = bits >> 3;
- in -= len;
- bits -= len << 3;
- hold &= (1U << bits) - 1;
-
- /* update state and return */
- strm->next_in = in + OFF;
- strm->next_out = out + OFF;
- strm->avail_in = (unsigned)(in < last ? 5 + (last - in) : 5 - (in - last));
- strm->avail_out = (unsigned)(out < end ?
- 257 + (end - out) : 257 - (out - end));
- state->hold = hold;
- state->bits = bits;
- return;
-}
-
-/*
- inflate_fast() speedups that turned out slower (on a PowerPC G3 750CXe):
- - Using bit fields for code structure
- - Different op definition to avoid & for extra bits (do & for table bits)
- - Three separate decoding do-loops for direct, window, and wnext == 0
- - Special case for distance > 1 copies to do overlapped load and store copy
- - Explicit branch predictions (based on measured branch probabilities)
- - Deferring match copy and interspersed it with decoding subsequent codes
- - Swapping literal/length else
- - Swapping window/direct else
- - Larger unrolled copy loops (three is about right)
- - Moving len -= 3 statement into middle of loop
- */
-
-#endif /* !ASMINF */
diff --git a/3rdparty/assimp/contrib/zlib/inffast.h b/3rdparty/assimp/contrib/zlib/inffast.h
deleted file mode 100644
index e5c1aa4c..00000000
--- a/3rdparty/assimp/contrib/zlib/inffast.h
+++ /dev/null
@@ -1,11 +0,0 @@
-/* inffast.h -- header to use inffast.c
- * Copyright (C) 1995-2003, 2010 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* WARNING: this file should *not* be used by applications. It is
- part of the implementation of the compression library and is
- subject to change. Applications should only use zlib.h.
- */
-
-void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start));
diff --git a/3rdparty/assimp/contrib/zlib/inffixed.h b/3rdparty/assimp/contrib/zlib/inffixed.h
deleted file mode 100644
index 75ed4b59..00000000
--- a/3rdparty/assimp/contrib/zlib/inffixed.h
+++ /dev/null
@@ -1,94 +0,0 @@
- /* inffixed.h -- table for decoding fixed codes
- * Generated automatically by makefixed().
- */
-
- /* WARNING: this file should *not* be used by applications. It
- is part of the implementation of the compression library and
- is subject to change. Applications should only use zlib.h.
- */
-
- static const code lenfix[512] = {
- {96,7,0},{0,8,80},{0,8,16},{20,8,115},{18,7,31},{0,8,112},{0,8,48},
- {0,9,192},{16,7,10},{0,8,96},{0,8,32},{0,9,160},{0,8,0},{0,8,128},
- {0,8,64},{0,9,224},{16,7,6},{0,8,88},{0,8,24},{0,9,144},{19,7,59},
- {0,8,120},{0,8,56},{0,9,208},{17,7,17},{0,8,104},{0,8,40},{0,9,176},
- {0,8,8},{0,8,136},{0,8,72},{0,9,240},{16,7,4},{0,8,84},{0,8,20},
- {21,8,227},{19,7,43},{0,8,116},{0,8,52},{0,9,200},{17,7,13},{0,8,100},
- {0,8,36},{0,9,168},{0,8,4},{0,8,132},{0,8,68},{0,9,232},{16,7,8},
- {0,8,92},{0,8,28},{0,9,152},{20,7,83},{0,8,124},{0,8,60},{0,9,216},
- {18,7,23},{0,8,108},{0,8,44},{0,9,184},{0,8,12},{0,8,140},{0,8,76},
- {0,9,248},{16,7,3},{0,8,82},{0,8,18},{21,8,163},{19,7,35},{0,8,114},
- {0,8,50},{0,9,196},{17,7,11},{0,8,98},{0,8,34},{0,9,164},{0,8,2},
- {0,8,130},{0,8,66},{0,9,228},{16,7,7},{0,8,90},{0,8,26},{0,9,148},
- {20,7,67},{0,8,122},{0,8,58},{0,9,212},{18,7,19},{0,8,106},{0,8,42},
- {0,9,180},{0,8,10},{0,8,138},{0,8,74},{0,9,244},{16,7,5},{0,8,86},
- {0,8,22},{64,8,0},{19,7,51},{0,8,118},{0,8,54},{0,9,204},{17,7,15},
- {0,8,102},{0,8,38},{0,9,172},{0,8,6},{0,8,134},{0,8,70},{0,9,236},
- {16,7,9},{0,8,94},{0,8,30},{0,9,156},{20,7,99},{0,8,126},{0,8,62},
- {0,9,220},{18,7,27},{0,8,110},{0,8,46},{0,9,188},{0,8,14},{0,8,142},
- {0,8,78},{0,9,252},{96,7,0},{0,8,81},{0,8,17},{21,8,131},{18,7,31},
- {0,8,113},{0,8,49},{0,9,194},{16,7,10},{0,8,97},{0,8,33},{0,9,162},
- {0,8,1},{0,8,129},{0,8,65},{0,9,226},{16,7,6},{0,8,89},{0,8,25},
- {0,9,146},{19,7,59},{0,8,121},{0,8,57},{0,9,210},{17,7,17},{0,8,105},
- {0,8,41},{0,9,178},{0,8,9},{0,8,137},{0,8,73},{0,9,242},{16,7,4},
- {0,8,85},{0,8,21},{16,8,258},{19,7,43},{0,8,117},{0,8,53},{0,9,202},
- {17,7,13},{0,8,101},{0,8,37},{0,9,170},{0,8,5},{0,8,133},{0,8,69},
- {0,9,234},{16,7,8},{0,8,93},{0,8,29},{0,9,154},{20,7,83},{0,8,125},
- {0,8,61},{0,9,218},{18,7,23},{0,8,109},{0,8,45},{0,9,186},{0,8,13},
- {0,8,141},{0,8,77},{0,9,250},{16,7,3},{0,8,83},{0,8,19},{21,8,195},
- {19,7,35},{0,8,115},{0,8,51},{0,9,198},{17,7,11},{0,8,99},{0,8,35},
- {0,9,166},{0,8,3},{0,8,131},{0,8,67},{0,9,230},{16,7,7},{0,8,91},
- {0,8,27},{0,9,150},{20,7,67},{0,8,123},{0,8,59},{0,9,214},{18,7,19},
- {0,8,107},{0,8,43},{0,9,182},{0,8,11},{0,8,139},{0,8,75},{0,9,246},
- {16,7,5},{0,8,87},{0,8,23},{64,8,0},{19,7,51},{0,8,119},{0,8,55},
- {0,9,206},{17,7,15},{0,8,103},{0,8,39},{0,9,174},{0,8,7},{0,8,135},
- {0,8,71},{0,9,238},{16,7,9},{0,8,95},{0,8,31},{0,9,158},{20,7,99},
- {0,8,127},{0,8,63},{0,9,222},{18,7,27},{0,8,111},{0,8,47},{0,9,190},
- {0,8,15},{0,8,143},{0,8,79},{0,9,254},{96,7,0},{0,8,80},{0,8,16},
- {20,8,115},{18,7,31},{0,8,112},{0,8,48},{0,9,193},{16,7,10},{0,8,96},
- {0,8,32},{0,9,161},{0,8,0},{0,8,128},{0,8,64},{0,9,225},{16,7,6},
- {0,8,88},{0,8,24},{0,9,145},{19,7,59},{0,8,120},{0,8,56},{0,9,209},
- {17,7,17},{0,8,104},{0,8,40},{0,9,177},{0,8,8},{0,8,136},{0,8,72},
- {0,9,241},{16,7,4},{0,8,84},{0,8,20},{21,8,227},{19,7,43},{0,8,116},
- {0,8,52},{0,9,201},{17,7,13},{0,8,100},{0,8,36},{0,9,169},{0,8,4},
- {0,8,132},{0,8,68},{0,9,233},{16,7,8},{0,8,92},{0,8,28},{0,9,153},
- {20,7,83},{0,8,124},{0,8,60},{0,9,217},{18,7,23},{0,8,108},{0,8,44},
- {0,9,185},{0,8,12},{0,8,140},{0,8,76},{0,9,249},{16,7,3},{0,8,82},
- {0,8,18},{21,8,163},{19,7,35},{0,8,114},{0,8,50},{0,9,197},{17,7,11},
- {0,8,98},{0,8,34},{0,9,165},{0,8,2},{0,8,130},{0,8,66},{0,9,229},
- {16,7,7},{0,8,90},{0,8,26},{0,9,149},{20,7,67},{0,8,122},{0,8,58},
- {0,9,213},{18,7,19},{0,8,106},{0,8,42},{0,9,181},{0,8,10},{0,8,138},
- {0,8,74},{0,9,245},{16,7,5},{0,8,86},{0,8,22},{64,8,0},{19,7,51},
- {0,8,118},{0,8,54},{0,9,205},{17,7,15},{0,8,102},{0,8,38},{0,9,173},
- {0,8,6},{0,8,134},{0,8,70},{0,9,237},{16,7,9},{0,8,94},{0,8,30},
- {0,9,157},{20,7,99},{0,8,126},{0,8,62},{0,9,221},{18,7,27},{0,8,110},
- {0,8,46},{0,9,189},{0,8,14},{0,8,142},{0,8,78},{0,9,253},{96,7,0},
- {0,8,81},{0,8,17},{21,8,131},{18,7,31},{0,8,113},{0,8,49},{0,9,195},
- {16,7,10},{0,8,97},{0,8,33},{0,9,163},{0,8,1},{0,8,129},{0,8,65},
- {0,9,227},{16,7,6},{0,8,89},{0,8,25},{0,9,147},{19,7,59},{0,8,121},
- {0,8,57},{0,9,211},{17,7,17},{0,8,105},{0,8,41},{0,9,179},{0,8,9},
- {0,8,137},{0,8,73},{0,9,243},{16,7,4},{0,8,85},{0,8,21},{16,8,258},
- {19,7,43},{0,8,117},{0,8,53},{0,9,203},{17,7,13},{0,8,101},{0,8,37},
- {0,9,171},{0,8,5},{0,8,133},{0,8,69},{0,9,235},{16,7,8},{0,8,93},
- {0,8,29},{0,9,155},{20,7,83},{0,8,125},{0,8,61},{0,9,219},{18,7,23},
- {0,8,109},{0,8,45},{0,9,187},{0,8,13},{0,8,141},{0,8,77},{0,9,251},
- {16,7,3},{0,8,83},{0,8,19},{21,8,195},{19,7,35},{0,8,115},{0,8,51},
- {0,9,199},{17,7,11},{0,8,99},{0,8,35},{0,9,167},{0,8,3},{0,8,131},
- {0,8,67},{0,9,231},{16,7,7},{0,8,91},{0,8,27},{0,9,151},{20,7,67},
- {0,8,123},{0,8,59},{0,9,215},{18,7,19},{0,8,107},{0,8,43},{0,9,183},
- {0,8,11},{0,8,139},{0,8,75},{0,9,247},{16,7,5},{0,8,87},{0,8,23},
- {64,8,0},{19,7,51},{0,8,119},{0,8,55},{0,9,207},{17,7,15},{0,8,103},
- {0,8,39},{0,9,175},{0,8,7},{0,8,135},{0,8,71},{0,9,239},{16,7,9},
- {0,8,95},{0,8,31},{0,9,159},{20,7,99},{0,8,127},{0,8,63},{0,9,223},
- {18,7,27},{0,8,111},{0,8,47},{0,9,191},{0,8,15},{0,8,143},{0,8,79},
- {0,9,255}
- };
-
- static const code distfix[32] = {
- {16,5,1},{23,5,257},{19,5,17},{27,5,4097},{17,5,5},{25,5,1025},
- {21,5,65},{29,5,16385},{16,5,3},{24,5,513},{20,5,33},{28,5,8193},
- {18,5,9},{26,5,2049},{22,5,129},{64,5,0},{16,5,2},{23,5,385},
- {19,5,25},{27,5,6145},{17,5,7},{25,5,1537},{21,5,97},{29,5,24577},
- {16,5,4},{24,5,769},{20,5,49},{28,5,12289},{18,5,13},{26,5,3073},
- {22,5,193},{64,5,0}
- };
diff --git a/3rdparty/assimp/contrib/zlib/inflate.c b/3rdparty/assimp/contrib/zlib/inflate.c
deleted file mode 100644
index a8431abe..00000000
--- a/3rdparty/assimp/contrib/zlib/inflate.c
+++ /dev/null
@@ -1,1480 +0,0 @@
-/* inflate.c -- zlib decompression
- * Copyright (C) 1995-2010 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/*
- * Change history:
- *
- * 1.2.beta0 24 Nov 2002
- * - First version -- complete rewrite of inflate to simplify code, avoid
- * creation of window when not needed, minimize use of window when it is
- * needed, make inffast.c even faster, implement gzip decoding, and to
- * improve code readability and style over the previous zlib inflate code
- *
- * 1.2.beta1 25 Nov 2002
- * - Use pointers for available input and output checking in inffast.c
- * - Remove input and output counters in inffast.c
- * - Change inffast.c entry and loop from avail_in >= 7 to >= 6
- * - Remove unnecessary second byte pull from length extra in inffast.c
- * - Unroll direct copy to three copies per loop in inffast.c
- *
- * 1.2.beta2 4 Dec 2002
- * - Change external routine names to reduce potential conflicts
- * - Correct filename to inffixed.h for fixed tables in inflate.c
- * - Make hbuf[] unsigned char to match parameter type in inflate.c
- * - Change strm->next_out[-state->offset] to *(strm->next_out - state->offset)
- * to avoid negation problem on Alphas (64 bit) in inflate.c
- *
- * 1.2.beta3 22 Dec 2002
- * - Add comments on state->bits assertion in inffast.c
- * - Add comments on op field in inftrees.h
- * - Fix bug in reuse of allocated window after inflateReset()
- * - Remove bit fields--back to byte structure for speed
- * - Remove distance extra == 0 check in inflate_fast()--only helps for lengths
- * - Change post-increments to pre-increments in inflate_fast(), PPC biased?
- * - Add compile time option, POSTINC, to use post-increments instead (Intel?)
- * - Make MATCH copy in inflate() much faster for when inflate_fast() not used
- * - Use local copies of stream next and avail values, as well as local bit
- * buffer and bit count in inflate()--for speed when inflate_fast() not used
- *
- * 1.2.beta4 1 Jan 2003
- * - Split ptr - 257 statements in inflate_table() to avoid compiler warnings
- * - Move a comment on output buffer sizes from inffast.c to inflate.c
- * - Add comments in inffast.c to introduce the inflate_fast() routine
- * - Rearrange window copies in inflate_fast() for speed and simplification
- * - Unroll last copy for window match in inflate_fast()
- * - Use local copies of window variables in inflate_fast() for speed
- * - Pull out common wnext == 0 case for speed in inflate_fast()
- * - Make op and len in inflate_fast() unsigned for consistency
- * - Add FAR to lcode and dcode declarations in inflate_fast()
- * - Simplified bad distance check in inflate_fast()
- * - Added inflateBackInit(), inflateBack(), and inflateBackEnd() in new
- * source file infback.c to provide a call-back interface to inflate for
- * programs like gzip and unzip -- uses window as output buffer to avoid
- * window copying
- *
- * 1.2.beta5 1 Jan 2003
- * - Improved inflateBack() interface to allow the caller to provide initial
- * input in strm.
- * - Fixed stored blocks bug in inflateBack()
- *
- * 1.2.beta6 4 Jan 2003
- * - Added comments in inffast.c on effectiveness of POSTINC
- * - Typecasting all around to reduce compiler warnings
- * - Changed loops from while (1) or do {} while (1) to for (;;), again to
- * make compilers happy
- * - Changed type of window in inflateBackInit() to unsigned char *
- *
- * 1.2.beta7 27 Jan 2003
- * - Changed many types to unsigned or unsigned short to avoid warnings
- * - Added inflateCopy() function
- *
- * 1.2.0 9 Mar 2003
- * - Changed inflateBack() interface to provide separate opaque descriptors
- * for the in() and out() functions
- * - Changed inflateBack() argument and in_func typedef to swap the length
- * and buffer address return values for the input function
- * - Check next_in and next_out for Z_NULL on entry to inflate()
- *
- * The history for versions after 1.2.0 are in ChangeLog in zlib distribution.
- */
-
-#include "zutil.h"
-#include "inftrees.h"
-#include "inflate.h"
-#include "inffast.h"
-
-#ifdef MAKEFIXED
-# ifndef BUILDFIXED
-# define BUILDFIXED
-# endif
-#endif
-
-/* function prototypes */
-local void fixedtables OF((struct inflate_state FAR *state));
-local int updatewindow OF((z_streamp strm, unsigned out));
-#ifdef BUILDFIXED
- void makefixed OF((void));
-#endif
-local unsigned syncsearch OF((unsigned FAR *have, unsigned char FAR *buf,
- unsigned len));
-
-int ZEXPORT inflateReset(strm)
-z_streamp strm;
-{
- struct inflate_state FAR *state;
-
- if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
- state = (struct inflate_state FAR *)strm->state;
- strm->total_in = strm->total_out = state->total = 0;
- strm->msg = Z_NULL;
- strm->adler = 1; /* to support ill-conceived Java test suite */
- state->mode = HEAD;
- state->last = 0;
- state->havedict = 0;
- state->dmax = 32768U;
- state->head = Z_NULL;
- state->wsize = 0;
- state->whave = 0;
- state->wnext = 0;
- state->hold = 0;
- state->bits = 0;
- state->lencode = state->distcode = state->next = state->codes;
- state->sane = 1;
- state->back = -1;
- Tracev((stderr, "inflate: reset\n"));
- return Z_OK;
-}
-
-int ZEXPORT inflateReset2(strm, windowBits)
-z_streamp strm;
-int windowBits;
-{
- int wrap;
- struct inflate_state FAR *state;
-
- /* get the state */
- if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
- state = (struct inflate_state FAR *)strm->state;
-
- /* extract wrap request from windowBits parameter */
- if (windowBits < 0) {
- wrap = 0;
- windowBits = -windowBits;
- }
- else {
- wrap = (windowBits >> 4) + 1;
-#ifdef GUNZIP
- if (windowBits < 48)
- windowBits &= 15;
-#endif
- }
-
- /* set number of window bits, free window if different */
- if (windowBits && (windowBits < 8 || windowBits > 15))
- return Z_STREAM_ERROR;
- if (state->window != Z_NULL && state->wbits != (unsigned)windowBits) {
- ZFREE(strm, state->window);
- state->window = Z_NULL;
- }
-
- /* update state and reset the rest of it */
- state->wrap = wrap;
- state->wbits = (unsigned)windowBits;
- return inflateReset(strm);
-}
-
-int ZEXPORT inflateInit2_(strm, windowBits, version, stream_size)
-z_streamp strm;
-int windowBits;
-const char *version;
-int stream_size;
-{
- int ret;
- struct inflate_state FAR *state;
-
- if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
- stream_size != (int)(sizeof(z_stream)))
- return Z_VERSION_ERROR;
- if (strm == Z_NULL) return Z_STREAM_ERROR;
- strm->msg = Z_NULL; /* in case we return an error */
- if (strm->zalloc == (alloc_func)0) {
- strm->zalloc = zcalloc;
- strm->opaque = (voidpf)0;
- }
- if (strm->zfree == (free_func)0) strm->zfree = zcfree;
- state = (struct inflate_state FAR *)
- ZALLOC(strm, 1, sizeof(struct inflate_state));
- if (state == Z_NULL) return Z_MEM_ERROR;
- Tracev((stderr, "inflate: allocated\n"));
- strm->state = (struct internal_state FAR *)state;
- state->window = Z_NULL;
- ret = inflateReset2(strm, windowBits);
- if (ret != Z_OK) {
- ZFREE(strm, state);
- strm->state = Z_NULL;
- }
- return ret;
-}
-
-int ZEXPORT inflateInit_(strm, version, stream_size)
-z_streamp strm;
-const char *version;
-int stream_size;
-{
- return inflateInit2_(strm, DEF_WBITS, version, stream_size);
-}
-
-int ZEXPORT inflatePrime(strm, bits, value)
-z_streamp strm;
-int bits;
-int value;
-{
- struct inflate_state FAR *state;
-
- if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
- state = (struct inflate_state FAR *)strm->state;
- if (bits < 0) {
- state->hold = 0;
- state->bits = 0;
- return Z_OK;
- }
- if (bits > 16 || state->bits + bits > 32) return Z_STREAM_ERROR;
- value &= (1L << bits) - 1;
- state->hold += value << state->bits;
- state->bits += bits;
- return Z_OK;
-}
-
-/*
- Return state with length and distance decoding tables and index sizes set to
- fixed code decoding. Normally this returns fixed tables from inffixed.h.
- If BUILDFIXED is defined, then instead this routine builds the tables the
- first time it's called, and returns those tables the first time and
- thereafter. This reduces the size of the code by about 2K bytes, in
- exchange for a little execution time. However, BUILDFIXED should not be
- used for threaded applications, since the rewriting of the tables and virgin
- may not be thread-safe.
- */
-local void fixedtables(state)
-struct inflate_state FAR *state;
-{
-#ifdef BUILDFIXED
- static int virgin = 1;
- static code *lenfix, *distfix;
- static code fixed[544];
-
- /* build fixed huffman tables if first call (may not be thread safe) */
- if (virgin) {
- unsigned sym, bits;
- static code *next;
-
- /* literal/length table */
- sym = 0;
- while (sym < 144) state->lens[sym++] = 8;
- while (sym < 256) state->lens[sym++] = 9;
- while (sym < 280) state->lens[sym++] = 7;
- while (sym < 288) state->lens[sym++] = 8;
- next = fixed;
- lenfix = next;
- bits = 9;
- inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work);
-
- /* distance table */
- sym = 0;
- while (sym < 32) state->lens[sym++] = 5;
- distfix = next;
- bits = 5;
- inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work);
-
- /* do this just once */
- virgin = 0;
- }
-#else /* !BUILDFIXED */
-# include "inffixed.h"
-#endif /* BUILDFIXED */
- state->lencode = lenfix;
- state->lenbits = 9;
- state->distcode = distfix;
- state->distbits = 5;
-}
-
-#ifdef MAKEFIXED
-#include <stdio.h>
-
-/*
- Write out the inffixed.h that is #include'd above. Defining MAKEFIXED also
- defines BUILDFIXED, so the tables are built on the fly. makefixed() writes
- those tables to stdout, which would be piped to inffixed.h. A small program
- can simply call makefixed to do this:
-
- void makefixed(void);
-
- int main(void)
- {
- makefixed();
- return 0;
- }
-
- Then that can be linked with zlib built with MAKEFIXED defined and run:
-
- a.out > inffixed.h
- */
-void makefixed()
-{
- unsigned low, size;
- struct inflate_state state;
-
- fixedtables(&state);
- puts(" /* inffixed.h -- table for decoding fixed codes");
- puts(" * Generated automatically by makefixed().");
- puts(" */");
- puts("");
- puts(" /* WARNING: this file should *not* be used by applications.");
- puts(" It is part of the implementation of this library and is");
- puts(" subject to change. Applications should only use zlib.h.");
- puts(" */");
- puts("");
- size = 1U << 9;
- printf(" static const code lenfix[%u] = {", size);
- low = 0;
- for (;;) {
- if ((low % 7) == 0) printf("\n ");
- printf("{%u,%u,%d}", state.lencode[low].op, state.lencode[low].bits,
- state.lencode[low].val);
- if (++low == size) break;
- putchar(',');
- }
- puts("\n };");
- size = 1U << 5;
- printf("\n static const code distfix[%u] = {", size);
- low = 0;
- for (;;) {
- if ((low % 6) == 0) printf("\n ");
- printf("{%u,%u,%d}", state.distcode[low].op, state.distcode[low].bits,
- state.distcode[low].val);
- if (++low == size) break;
- putchar(',');
- }
- puts("\n };");
-}
-#endif /* MAKEFIXED */
-
-/*
- Update the window with the last wsize (normally 32K) bytes written before
- returning. If window does not exist yet, create it. This is only called
- when a window is already in use, or when output has been written during this
- inflate call, but the end of the deflate stream has not been reached yet.
- It is also called to create a window for dictionary data when a dictionary
- is loaded.
-
- Providing output buffers larger than 32K to inflate() should provide a speed
- advantage, since only the last 32K of output is copied to the sliding window
- upon return from inflate(), and since all distances after the first 32K of
- output will fall in the output data, making match copies simpler and faster.
- The advantage may be dependent on the size of the processor's data caches.
- */
-local int updatewindow(strm, out)
-z_streamp strm;
-unsigned out;
-{
- struct inflate_state FAR *state;
- unsigned copy, dist;
-
- state = (struct inflate_state FAR *)strm->state;
-
- /* if it hasn't been done already, allocate space for the window */
- if (state->window == Z_NULL) {
- state->window = (unsigned char FAR *)
- ZALLOC(strm, 1U << state->wbits,
- sizeof(unsigned char));
- if (state->window == Z_NULL) return 1;
- }
-
- /* if window not in use yet, initialize */
- if (state->wsize == 0) {
- state->wsize = 1U << state->wbits;
- state->wnext = 0;
- state->whave = 0;
- }
-
- /* copy state->wsize or less output bytes into the circular window */
- copy = out - strm->avail_out;
- if (copy >= state->wsize) {
- zmemcpy(state->window, strm->next_out - state->wsize, state->wsize);
- state->wnext = 0;
- state->whave = state->wsize;
- }
- else {
- dist = state->wsize - state->wnext;
- if (dist > copy) dist = copy;
- zmemcpy(state->window + state->wnext, strm->next_out - copy, dist);
- copy -= dist;
- if (copy) {
- zmemcpy(state->window, strm->next_out - copy, copy);
- state->wnext = copy;
- state->whave = state->wsize;
- }
- else {
- state->wnext += dist;
- if (state->wnext == state->wsize) state->wnext = 0;
- if (state->whave < state->wsize) state->whave += dist;
- }
- }
- return 0;
-}
-
-/* Macros for inflate(): */
-
-/* check function to use adler32() for zlib or crc32() for gzip */
-#ifdef GUNZIP
-# define UPDATE(check, buf, len) \
- (state->flags ? crc32(check, buf, len) : adler32(check, buf, len))
-#else
-# define UPDATE(check, buf, len) adler32(check, buf, len)
-#endif
-
-/* check macros for header crc */
-#ifdef GUNZIP
-# define CRC2(check, word) \
- do { \
- hbuf[0] = (unsigned char)(word); \
- hbuf[1] = (unsigned char)((word) >> 8); \
- check = crc32(check, hbuf, 2); \
- } while (0)
-
-# define CRC4(check, word) \
- do { \
- hbuf[0] = (unsigned char)(word); \
- hbuf[1] = (unsigned char)((word) >> 8); \
- hbuf[2] = (unsigned char)((word) >> 16); \
- hbuf[3] = (unsigned char)((word) >> 24); \
- check = crc32(check, hbuf, 4); \
- } while (0)
-#endif
-
-/* Load registers with state in inflate() for speed */
-#define LOAD() \
- do { \
- put = strm->next_out; \
- left = strm->avail_out; \
- next = strm->next_in; \
- have = strm->avail_in; \
- hold = state->hold; \
- bits = state->bits; \
- } while (0)
-
-/* Restore state from registers in inflate() */
-#define RESTORE() \
- do { \
- strm->next_out = put; \
- strm->avail_out = left; \
- strm->next_in = next; \
- strm->avail_in = have; \
- state->hold = hold; \
- state->bits = bits; \
- } while (0)
-
-/* Clear the input bit accumulator */
-#define INITBITS() \
- do { \
- hold = 0; \
- bits = 0; \
- } while (0)
-
-/* Get a byte of input into the bit accumulator, or return from inflate()
- if there is no input available. */
-#define PULLBYTE() \
- do { \
- if (have == 0) goto inf_leave; \
- have--; \
- hold += (unsigned long)(*next++) << bits; \
- bits += 8; \
- } while (0)
-
-/* Assure that there are at least n bits in the bit accumulator. If there is
- not enough available input to do that, then return from inflate(). */
-#define NEEDBITS(n) \
- do { \
- while (bits < (unsigned)(n)) \
- PULLBYTE(); \
- } while (0)
-
-/* Return the low n bits of the bit accumulator (n < 16) */
-#define BITS(n) \
- ((unsigned)hold & ((1U << (n)) - 1))
-
-/* Remove n bits from the bit accumulator */
-#define DROPBITS(n) \
- do { \
- hold >>= (n); \
- bits -= (unsigned)(n); \
- } while (0)
-
-/* Remove zero to seven bits as needed to go to a byte boundary */
-#define BYTEBITS() \
- do { \
- hold >>= bits & 7; \
- bits -= bits & 7; \
- } while (0)
-
-/* Reverse the bytes in a 32-bit value */
-#define REVERSE(q) \
- ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \
- (((q) & 0xff00) << 8) + (((q) & 0xff) << 24))
-
-/*
- inflate() uses a state machine to process as much input data and generate as
- much output data as possible before returning. The state machine is
- structured roughly as follows:
-
- for (;;) switch (state) {
- ...
- case STATEn:
- if (not enough input data or output space to make progress)
- return;
- ... make progress ...
- state = STATEm;
- break;
- ...
- }
-
- so when inflate() is called again, the same case is attempted again, and
- if the appropriate resources are provided, the machine proceeds to the
- next state. The NEEDBITS() macro is usually the way the state evaluates
- whether it can proceed or should return. NEEDBITS() does the return if
- the requested bits are not available. The typical use of the BITS macros
- is:
-
- NEEDBITS(n);
- ... do something with BITS(n) ...
- DROPBITS(n);
-
- where NEEDBITS(n) either returns from inflate() if there isn't enough
- input left to load n bits into the accumulator, or it continues. BITS(n)
- gives the low n bits in the accumulator. When done, DROPBITS(n) drops
- the low n bits off the accumulator. INITBITS() clears the accumulator
- and sets the number of available bits to zero. BYTEBITS() discards just
- enough bits to put the accumulator on a byte boundary. After BYTEBITS()
- and a NEEDBITS(8), then BITS(8) would return the next byte in the stream.
-
- NEEDBITS(n) uses PULLBYTE() to get an available byte of input, or to return
- if there is no input available. The decoding of variable length codes uses
- PULLBYTE() directly in order to pull just enough bytes to decode the next
- code, and no more.
-
- Some states loop until they get enough input, making sure that enough
- state information is maintained to continue the loop where it left off
- if NEEDBITS() returns in the loop. For example, want, need, and keep
- would all have to actually be part of the saved state in case NEEDBITS()
- returns:
-
- case STATEw:
- while (want < need) {
- NEEDBITS(n);
- keep[want++] = BITS(n);
- DROPBITS(n);
- }
- state = STATEx;
- case STATEx:
-
- As shown above, if the next state is also the next case, then the break
- is omitted.
-
- A state may also return if there is not enough output space available to
- complete that state. Those states are copying stored data, writing a
- literal byte, and copying a matching string.
-
- When returning, a "goto inf_leave" is used to update the total counters,
- update the check value, and determine whether any progress has been made
- during that inflate() call in order to return the proper return code.
- Progress is defined as a change in either strm->avail_in or strm->avail_out.
- When there is a window, goto inf_leave will update the window with the last
- output written. If a goto inf_leave occurs in the middle of decompression
- and there is no window currently, goto inf_leave will create one and copy
- output to the window for the next call of inflate().
-
- In this implementation, the flush parameter of inflate() only affects the
- return code (per zlib.h). inflate() always writes as much as possible to
- strm->next_out, given the space available and the provided input--the effect
- documented in zlib.h of Z_SYNC_FLUSH. Furthermore, inflate() always defers
- the allocation of and copying into a sliding window until necessary, which
- provides the effect documented in zlib.h for Z_FINISH when the entire input
- stream available. So the only thing the flush parameter actually does is:
- when flush is set to Z_FINISH, inflate() cannot return Z_OK. Instead it
- will return Z_BUF_ERROR if it has not reached the end of the stream.
- */
-
-int ZEXPORT inflate(strm, flush)
-z_streamp strm;
-int flush;
-{
- struct inflate_state FAR *state;
- unsigned char FAR *next; /* next input */
- unsigned char FAR *put; /* next output */
- unsigned have, left; /* available input and output */
- unsigned long hold; /* bit buffer */
- unsigned bits; /* bits in bit buffer */
- unsigned in, out; /* save starting available input and output */
- unsigned copy; /* number of stored or match bytes to copy */
- unsigned char FAR *from; /* where to copy match bytes from */
- code here; /* current decoding table entry */
- code last; /* parent table entry */
- unsigned len; /* length to copy for repeats, bits to drop */
- int ret; /* return code */
-#ifdef GUNZIP
- unsigned char hbuf[4]; /* buffer for gzip header crc calculation */
-#endif
- static const unsigned short order[19] = /* permutation of code lengths */
- {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
-
- if (strm == Z_NULL || strm->state == Z_NULL || strm->next_out == Z_NULL ||
- (strm->next_in == Z_NULL && strm->avail_in != 0))
- return Z_STREAM_ERROR;
-
- state = (struct inflate_state FAR *)strm->state;
- if (state->mode == TYPE) state->mode = TYPEDO; /* skip check */
- LOAD();
- in = have;
- out = left;
- ret = Z_OK;
- for (;;)
- switch (state->mode) {
- case HEAD:
- if (state->wrap == 0) {
- state->mode = TYPEDO;
- break;
- }
- NEEDBITS(16);
-#ifdef GUNZIP
- if ((state->wrap & 2) && hold == 0x8b1f) { /* gzip header */
- state->check = crc32(0L, Z_NULL, 0);
- CRC2(state->check, hold);
- INITBITS();
- state->mode = FLAGS;
- break;
- }
- state->flags = 0; /* expect zlib header */
- if (state->head != Z_NULL)
- state->head->done = -1;
- if (!(state->wrap & 1) || /* check if zlib header allowed */
-#else
- if (
-#endif
- ((BITS(8) << 8) + (hold >> 8)) % 31) {
- strm->msg = (char *)"incorrect header check";
- state->mode = BAD;
- break;
- }
- if (BITS(4) != Z_DEFLATED) {
- strm->msg = (char *)"unknown compression method";
- state->mode = BAD;
- break;
- }
- DROPBITS(4);
- len = BITS(4) + 8;
- if (state->wbits == 0)
- state->wbits = len;
- else if (len > state->wbits) {
- strm->msg = (char *)"invalid window size";
- state->mode = BAD;
- break;
- }
- state->dmax = 1U << len;
- Tracev((stderr, "inflate: zlib header ok\n"));
- strm->adler = state->check = adler32(0L, Z_NULL, 0);
- state->mode = hold & 0x200 ? DICTID : TYPE;
- INITBITS();
- break;
-#ifdef GUNZIP
- case FLAGS:
- NEEDBITS(16);
- state->flags = (int)(hold);
- if ((state->flags & 0xff) != Z_DEFLATED) {
- strm->msg = (char *)"unknown compression method";
- state->mode = BAD;
- break;
- }
- if (state->flags & 0xe000) {
- strm->msg = (char *)"unknown header flags set";
- state->mode = BAD;
- break;
- }
- if (state->head != Z_NULL)
- state->head->text = (int)((hold >> 8) & 1);
- if (state->flags & 0x0200) CRC2(state->check, hold);
- INITBITS();
- state->mode = TIME;
- case TIME:
- NEEDBITS(32);
- if (state->head != Z_NULL)
- state->head->time = hold;
- if (state->flags & 0x0200) CRC4(state->check, hold);
- INITBITS();
- state->mode = OS;
- case OS:
- NEEDBITS(16);
- if (state->head != Z_NULL) {
- state->head->xflags = (int)(hold & 0xff);
- state->head->os = (int)(hold >> 8);
- }
- if (state->flags & 0x0200) CRC2(state->check, hold);
- INITBITS();
- state->mode = EXLEN;
- case EXLEN:
- if (state->flags & 0x0400) {
- NEEDBITS(16);
- state->length = (unsigned)(hold);
- if (state->head != Z_NULL)
- state->head->extra_len = (unsigned)hold;
- if (state->flags & 0x0200) CRC2(state->check, hold);
- INITBITS();
- }
- else if (state->head != Z_NULL)
- state->head->extra = Z_NULL;
- state->mode = EXTRA;
- case EXTRA:
- if (state->flags & 0x0400) {
- copy = state->length;
- if (copy > have) copy = have;
- if (copy) {
- if (state->head != Z_NULL &&
- state->head->extra != Z_NULL) {
- len = state->head->extra_len - state->length;
- zmemcpy(state->head->extra + len, next,
- len + copy > state->head->extra_max ?
- state->head->extra_max - len : copy);
- }
- if (state->flags & 0x0200)
- state->check = crc32(state->check, next, copy);
- have -= copy;
- next += copy;
- state->length -= copy;
- }
- if (state->length) goto inf_leave;
- }
- state->length = 0;
- state->mode = NAME;
- case NAME:
- if (state->flags & 0x0800) {
- if (have == 0) goto inf_leave;
- copy = 0;
- do {
- len = (unsigned)(next[copy++]);
- if (state->head != Z_NULL &&
- state->head->name != Z_NULL &&
- state->length < state->head->name_max)
- state->head->name[state->length++] = len;
- } while (len && copy < have);
- if (state->flags & 0x0200)
- state->check = crc32(state->check, next, copy);
- have -= copy;
- next += copy;
- if (len) goto inf_leave;
- }
- else if (state->head != Z_NULL)
- state->head->name = Z_NULL;
- state->length = 0;
- state->mode = COMMENT;
- case COMMENT:
- if (state->flags & 0x1000) {
- if (have == 0) goto inf_leave;
- copy = 0;
- do {
- len = (unsigned)(next[copy++]);
- if (state->head != Z_NULL &&
- state->head->comment != Z_NULL &&
- state->length < state->head->comm_max)
- state->head->comment[state->length++] = len;
- } while (len && copy < have);
- if (state->flags & 0x0200)
- state->check = crc32(state->check, next, copy);
- have -= copy;
- next += copy;
- if (len) goto inf_leave;
- }
- else if (state->head != Z_NULL)
- state->head->comment = Z_NULL;
- state->mode = HCRC;
- case HCRC:
- if (state->flags & 0x0200) {
- NEEDBITS(16);
- if (hold != (state->check & 0xffff)) {
- strm->msg = (char *)"header crc mismatch";
- state->mode = BAD;
- break;
- }
- INITBITS();
- }
- if (state->head != Z_NULL) {
- state->head->hcrc = (int)((state->flags >> 9) & 1);
- state->head->done = 1;
- }
- strm->adler = state->check = crc32(0L, Z_NULL, 0);
- state->mode = TYPE;
- break;
-#endif
- case DICTID:
- NEEDBITS(32);
- strm->adler = state->check = REVERSE(hold);
- INITBITS();
- state->mode = DICT;
- case DICT:
- if (state->havedict == 0) {
- RESTORE();
- return Z_NEED_DICT;
- }
- strm->adler = state->check = adler32(0L, Z_NULL, 0);
- state->mode = TYPE;
- case TYPE:
- if (flush == Z_BLOCK || flush == Z_TREES) goto inf_leave;
- case TYPEDO:
- if (state->last) {
- BYTEBITS();
- state->mode = CHECK;
- break;
- }
- NEEDBITS(3);
- state->last = BITS(1);
- DROPBITS(1);
- switch (BITS(2)) {
- case 0: /* stored block */
- Tracev((stderr, "inflate: stored block%s\n",
- state->last ? " (last)" : ""));
- state->mode = STORED;
- break;
- case 1: /* fixed block */
- fixedtables(state);
- Tracev((stderr, "inflate: fixed codes block%s\n",
- state->last ? " (last)" : ""));
- state->mode = LEN_; /* decode codes */
- if (flush == Z_TREES) {
- DROPBITS(2);
- goto inf_leave;
- }
- break;
- case 2: /* dynamic block */
- Tracev((stderr, "inflate: dynamic codes block%s\n",
- state->last ? " (last)" : ""));
- state->mode = TABLE;
- break;
- case 3:
- strm->msg = (char *)"invalid block type";
- state->mode = BAD;
- }
- DROPBITS(2);
- break;
- case STORED:
- BYTEBITS(); /* go to byte boundary */
- NEEDBITS(32);
- if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
- strm->msg = (char *)"invalid stored block lengths";
- state->mode = BAD;
- break;
- }
- state->length = (unsigned)hold & 0xffff;
- Tracev((stderr, "inflate: stored length %u\n",
- state->length));
- INITBITS();
- state->mode = COPY_;
- if (flush == Z_TREES) goto inf_leave;
- case COPY_:
- state->mode = COPY;
- case COPY:
- copy = state->length;
- if (copy) {
- if (copy > have) copy = have;
- if (copy > left) copy = left;
- if (copy == 0) goto inf_leave;
- zmemcpy(put, next, copy);
- have -= copy;
- next += copy;
- left -= copy;
- put += copy;
- state->length -= copy;
- break;
- }
- Tracev((stderr, "inflate: stored end\n"));
- state->mode = TYPE;
- break;
- case TABLE:
- NEEDBITS(14);
- state->nlen = BITS(5) + 257;
- DROPBITS(5);
- state->ndist = BITS(5) + 1;
- DROPBITS(5);
- state->ncode = BITS(4) + 4;
- DROPBITS(4);
-#ifndef PKZIP_BUG_WORKAROUND
- if (state->nlen > 286 || state->ndist > 30) {
- strm->msg = (char *)"too many length or distance symbols";
- state->mode = BAD;
- break;
- }
-#endif
- Tracev((stderr, "inflate: table sizes ok\n"));
- state->have = 0;
- state->mode = LENLENS;
- case LENLENS:
- while (state->have < state->ncode) {
- NEEDBITS(3);
- state->lens[order[state->have++]] = (unsigned short)BITS(3);
- DROPBITS(3);
- }
- while (state->have < 19)
- state->lens[order[state->have++]] = 0;
- state->next = state->codes;
- state->lencode = (code const FAR *)(state->next);
- state->lenbits = 7;
- ret = inflate_table(CODES, state->lens, 19, &(state->next),
- &(state->lenbits), state->work);
- if (ret) {
- strm->msg = (char *)"invalid code lengths set";
- state->mode = BAD;
- break;
- }
- Tracev((stderr, "inflate: code lengths ok\n"));
- state->have = 0;
- state->mode = CODELENS;
- case CODELENS:
- while (state->have < state->nlen + state->ndist) {
- for (;;) {
- here = state->lencode[BITS(state->lenbits)];
- if ((unsigned)(here.bits) <= bits) break;
- PULLBYTE();
- }
- if (here.val < 16) {
- NEEDBITS(here.bits);
- DROPBITS(here.bits);
- state->lens[state->have++] = here.val;
- }
- else {
- if (here.val == 16) {
- NEEDBITS(here.bits + 2);
- DROPBITS(here.bits);
- if (state->have == 0) {
- strm->msg = (char *)"invalid bit length repeat";
- state->mode = BAD;
- break;
- }
- len = state->lens[state->have - 1];
- copy = 3 + BITS(2);
- DROPBITS(2);
- }
- else if (here.val == 17) {
- NEEDBITS(here.bits + 3);
- DROPBITS(here.bits);
- len = 0;
- copy = 3 + BITS(3);
- DROPBITS(3);
- }
- else {
- NEEDBITS(here.bits + 7);
- DROPBITS(here.bits);
- len = 0;
- copy = 11 + BITS(7);
- DROPBITS(7);
- }
- if (state->have + copy > state->nlen + state->ndist) {
- strm->msg = (char *)"invalid bit length repeat";
- state->mode = BAD;
- break;
- }
- while (copy--)
- state->lens[state->have++] = (unsigned short)len;
- }
- }
-
- /* handle error breaks in while */
- if (state->mode == BAD) break;
-
- /* check for end-of-block code (better have one) */
- if (state->lens[256] == 0) {
- strm->msg = (char *)"invalid code -- missing end-of-block";
- state->mode = BAD;
- break;
- }
-
- /* build code tables -- note: do not change the lenbits or distbits
- values here (9 and 6) without reading the comments in inftrees.h
- concerning the ENOUGH constants, which depend on those values */
- state->next = state->codes;
- state->lencode = (code const FAR *)(state->next);
- state->lenbits = 9;
- ret = inflate_table(LENS, state->lens, state->nlen, &(state->next),
- &(state->lenbits), state->work);
- if (ret) {
- strm->msg = (char *)"invalid literal/lengths set";
- state->mode = BAD;
- break;
- }
- state->distcode = (code const FAR *)(state->next);
- state->distbits = 6;
- ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist,
- &(state->next), &(state->distbits), state->work);
- if (ret) {
- strm->msg = (char *)"invalid distances set";
- state->mode = BAD;
- break;
- }
- Tracev((stderr, "inflate: codes ok\n"));
- state->mode = LEN_;
- if (flush == Z_TREES) goto inf_leave;
- case LEN_:
- state->mode = LEN;
- case LEN:
- if (have >= 6 && left >= 258) {
- RESTORE();
- inflate_fast(strm, out);
- LOAD();
- if (state->mode == TYPE)
- state->back = -1;
- break;
- }
- state->back = 0;
- for (;;) {
- here = state->lencode[BITS(state->lenbits)];
- if ((unsigned)(here.bits) <= bits) break;
- PULLBYTE();
- }
- if (here.op && (here.op & 0xf0) == 0) {
- last = here;
- for (;;) {
- here = state->lencode[last.val +
- (BITS(last.bits + last.op) >> last.bits)];
- if ((unsigned)(last.bits + here.bits) <= bits) break;
- PULLBYTE();
- }
- DROPBITS(last.bits);
- state->back += last.bits;
- }
- DROPBITS(here.bits);
- state->back += here.bits;
- state->length = (unsigned)here.val;
- if ((int)(here.op) == 0) {
- Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
- "inflate: literal '%c'\n" :
- "inflate: literal 0x%02x\n", here.val));
- state->mode = LIT;
- break;
- }
- if (here.op & 32) {
- Tracevv((stderr, "inflate: end of block\n"));
- state->back = -1;
- state->mode = TYPE;
- break;
- }
- if (here.op & 64) {
- strm->msg = (char *)"invalid literal/length code";
- state->mode = BAD;
- break;
- }
- state->extra = (unsigned)(here.op) & 15;
- state->mode = LENEXT;
- case LENEXT:
- if (state->extra) {
- NEEDBITS(state->extra);
- state->length += BITS(state->extra);
- DROPBITS(state->extra);
- state->back += state->extra;
- }
- Tracevv((stderr, "inflate: length %u\n", state->length));
- state->was = state->length;
- state->mode = DIST;
- case DIST:
- for (;;) {
- here = state->distcode[BITS(state->distbits)];
- if ((unsigned)(here.bits) <= bits) break;
- PULLBYTE();
- }
- if ((here.op & 0xf0) == 0) {
- last = here;
- for (;;) {
- here = state->distcode[last.val +
- (BITS(last.bits + last.op) >> last.bits)];
- if ((unsigned)(last.bits + here.bits) <= bits) break;
- PULLBYTE();
- }
- DROPBITS(last.bits);
- state->back += last.bits;
- }
- DROPBITS(here.bits);
- state->back += here.bits;
- if (here.op & 64) {
- strm->msg = (char *)"invalid distance code";
- state->mode = BAD;
- break;
- }
- state->offset = (unsigned)here.val;
- state->extra = (unsigned)(here.op) & 15;
- state->mode = DISTEXT;
- case DISTEXT:
- if (state->extra) {
- NEEDBITS(state->extra);
- state->offset += BITS(state->extra);
- DROPBITS(state->extra);
- state->back += state->extra;
- }
-#ifdef INFLATE_STRICT
- if (state->offset > state->dmax) {
- strm->msg = (char *)"invalid distance too far back";
- state->mode = BAD;
- break;
- }
-#endif
- Tracevv((stderr, "inflate: distance %u\n", state->offset));
- state->mode = MATCH;
- case MATCH:
- if (left == 0) goto inf_leave;
- copy = out - left;
- if (state->offset > copy) { /* copy from window */
- copy = state->offset - copy;
- if (copy > state->whave) {
- if (state->sane) {
- strm->msg = (char *)"invalid distance too far back";
- state->mode = BAD;
- break;
- }
-#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
- Trace((stderr, "inflate.c too far\n"));
- copy -= state->whave;
- if (copy > state->length) copy = state->length;
- if (copy > left) copy = left;
- left -= copy;
- state->length -= copy;
- do {
- *put++ = 0;
- } while (--copy);
- if (state->length == 0) state->mode = LEN;
- break;
-#endif
- }
- if (copy > state->wnext) {
- copy -= state->wnext;
- from = state->window + (state->wsize - copy);
- }
- else
- from = state->window + (state->wnext - copy);
- if (copy > state->length) copy = state->length;
- }
- else { /* copy from output */
- from = put - state->offset;
- copy = state->length;
- }
- if (copy > left) copy = left;
- left -= copy;
- state->length -= copy;
- do {
- *put++ = *from++;
- } while (--copy);
- if (state->length == 0) state->mode = LEN;
- break;
- case LIT:
- if (left == 0) goto inf_leave;
- *put++ = (unsigned char)(state->length);
- left--;
- state->mode = LEN;
- break;
- case CHECK:
- if (state->wrap) {
- NEEDBITS(32);
- out -= left;
- strm->total_out += out;
- state->total += out;
- if (out)
- strm->adler = state->check =
- UPDATE(state->check, put - out, out);
- out = left;
- if ((
-#ifdef GUNZIP
- state->flags ? hold :
-#endif
- REVERSE(hold)) != state->check) {
- strm->msg = (char *)"incorrect data check";
- state->mode = BAD;
- break;
- }
- INITBITS();
- Tracev((stderr, "inflate: check matches trailer\n"));
- }
-#ifdef GUNZIP
- state->mode = LENGTH;
- case LENGTH:
- if (state->wrap && state->flags) {
- NEEDBITS(32);
- if (hold != (state->total & 0xffffffffUL)) {
- strm->msg = (char *)"incorrect length check";
- state->mode = BAD;
- break;
- }
- INITBITS();
- Tracev((stderr, "inflate: length matches trailer\n"));
- }
-#endif
- state->mode = DONE;
- case DONE:
- ret = Z_STREAM_END;
- goto inf_leave;
- case BAD:
- ret = Z_DATA_ERROR;
- goto inf_leave;
- case MEM:
- return Z_MEM_ERROR;
- case SYNC:
- default:
- return Z_STREAM_ERROR;
- }
-
- /*
- Return from inflate(), updating the total counts and the check value.
- If there was no progress during the inflate() call, return a buffer
- error. Call updatewindow() to create and/or update the window state.
- Note: a memory error from inflate() is non-recoverable.
- */
- inf_leave:
- RESTORE();
- if (state->wsize || (state->mode < CHECK && out != strm->avail_out))
- if (updatewindow(strm, out)) {
- state->mode = MEM;
- return Z_MEM_ERROR;
- }
- in -= strm->avail_in;
- out -= strm->avail_out;
- strm->total_in += in;
- strm->total_out += out;
- state->total += out;
- if (state->wrap && out)
- strm->adler = state->check =
- UPDATE(state->check, strm->next_out - out, out);
- strm->data_type = state->bits + (state->last ? 64 : 0) +
- (state->mode == TYPE ? 128 : 0) +
- (state->mode == LEN_ || state->mode == COPY_ ? 256 : 0);
- if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK)
- ret = Z_BUF_ERROR;
- return ret;
-}
-
-int ZEXPORT inflateEnd(strm)
-z_streamp strm;
-{
- struct inflate_state FAR *state;
- if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0)
- return Z_STREAM_ERROR;
- state = (struct inflate_state FAR *)strm->state;
- if (state->window != Z_NULL) ZFREE(strm, state->window);
- ZFREE(strm, strm->state);
- strm->state = Z_NULL;
- Tracev((stderr, "inflate: end\n"));
- return Z_OK;
-}
-
-int ZEXPORT inflateSetDictionary(strm, dictionary, dictLength)
-z_streamp strm;
-const Bytef *dictionary;
-uInt dictLength;
-{
- struct inflate_state FAR *state;
- unsigned long id;
-
- /* check state */
- if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
- state = (struct inflate_state FAR *)strm->state;
- if (state->wrap != 0 && state->mode != DICT)
- return Z_STREAM_ERROR;
-
- /* check for correct dictionary id */
- if (state->mode == DICT) {
- id = adler32(0L, Z_NULL, 0);
- id = adler32(id, dictionary, dictLength);
- if (id != state->check)
- return Z_DATA_ERROR;
- }
-
- /* copy dictionary to window */
- if (updatewindow(strm, strm->avail_out)) {
- state->mode = MEM;
- return Z_MEM_ERROR;
- }
- if (dictLength > state->wsize) {
- zmemcpy(state->window, dictionary + dictLength - state->wsize,
- state->wsize);
- state->whave = state->wsize;
- }
- else {
- zmemcpy(state->window + state->wsize - dictLength, dictionary,
- dictLength);
- state->whave = dictLength;
- }
- state->havedict = 1;
- Tracev((stderr, "inflate: dictionary set\n"));
- return Z_OK;
-}
-
-int ZEXPORT inflateGetHeader(strm, head)
-z_streamp strm;
-gz_headerp head;
-{
- struct inflate_state FAR *state;
-
- /* check state */
- if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
- state = (struct inflate_state FAR *)strm->state;
- if ((state->wrap & 2) == 0) return Z_STREAM_ERROR;
-
- /* save header structure */
- state->head = head;
- head->done = 0;
- return Z_OK;
-}
-
-/*
- Search buf[0..len-1] for the pattern: 0, 0, 0xff, 0xff. Return when found
- or when out of input. When called, *have is the number of pattern bytes
- found in order so far, in 0..3. On return *have is updated to the new
- state. If on return *have equals four, then the pattern was found and the
- return value is how many bytes were read including the last byte of the
- pattern. If *have is less than four, then the pattern has not been found
- yet and the return value is len. In the latter case, syncsearch() can be
- called again with more data and the *have state. *have is initialized to
- zero for the first call.
- */
-local unsigned syncsearch(have, buf, len)
-unsigned FAR *have;
-unsigned char FAR *buf;
-unsigned len;
-{
- unsigned got;
- unsigned next;
-
- got = *have;
- next = 0;
- while (next < len && got < 4) {
- if ((int)(buf[next]) == (got < 2 ? 0 : 0xff))
- got++;
- else if (buf[next])
- got = 0;
- else
- got = 4 - got;
- next++;
- }
- *have = got;
- return next;
-}
-
-int ZEXPORT inflateSync(strm)
-z_streamp strm;
-{
- unsigned len; /* number of bytes to look at or looked at */
- unsigned long in, out; /* temporary to save total_in and total_out */
- unsigned char buf[4]; /* to restore bit buffer to byte string */
- struct inflate_state FAR *state;
-
- /* check parameters */
- if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
- state = (struct inflate_state FAR *)strm->state;
- if (strm->avail_in == 0 && state->bits < 8) return Z_BUF_ERROR;
-
- /* if first time, start search in bit buffer */
- if (state->mode != SYNC) {
- state->mode = SYNC;
- state->hold <<= state->bits & 7;
- state->bits -= state->bits & 7;
- len = 0;
- while (state->bits >= 8) {
- buf[len++] = (unsigned char)(state->hold);
- state->hold >>= 8;
- state->bits -= 8;
- }
- state->have = 0;
- syncsearch(&(state->have), buf, len);
- }
-
- /* search available input */
- len = syncsearch(&(state->have), strm->next_in, strm->avail_in);
- strm->avail_in -= len;
- strm->next_in += len;
- strm->total_in += len;
-
- /* return no joy or set up to restart inflate() on a new block */
- if (state->have != 4) return Z_DATA_ERROR;
- in = strm->total_in; out = strm->total_out;
- inflateReset(strm);
- strm->total_in = in; strm->total_out = out;
- state->mode = TYPE;
- return Z_OK;
-}
-
-/*
- Returns true if inflate is currently at the end of a block generated by
- Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP
- implementation to provide an additional safety check. PPP uses
- Z_SYNC_FLUSH but removes the length bytes of the resulting empty stored
- block. When decompressing, PPP checks that at the end of input packet,
- inflate is waiting for these length bytes.
- */
-int ZEXPORT inflateSyncPoint(strm)
-z_streamp strm;
-{
- struct inflate_state FAR *state;
-
- if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
- state = (struct inflate_state FAR *)strm->state;
- return state->mode == STORED && state->bits == 0;
-}
-
-int ZEXPORT inflateCopy(dest, source)
-z_streamp dest;
-z_streamp source;
-{
- struct inflate_state FAR *state;
- struct inflate_state FAR *copy;
- unsigned char FAR *window;
- unsigned wsize;
-
- /* check input */
- if (dest == Z_NULL || source == Z_NULL || source->state == Z_NULL ||
- source->zalloc == (alloc_func)0 || source->zfree == (free_func)0)
- return Z_STREAM_ERROR;
- state = (struct inflate_state FAR *)source->state;
-
- /* allocate space */
- copy = (struct inflate_state FAR *)
- ZALLOC(source, 1, sizeof(struct inflate_state));
- if (copy == Z_NULL) return Z_MEM_ERROR;
- window = Z_NULL;
- if (state->window != Z_NULL) {
- window = (unsigned char FAR *)
- ZALLOC(source, 1U << state->wbits, sizeof(unsigned char));
- if (window == Z_NULL) {
- ZFREE(source, copy);
- return Z_MEM_ERROR;
- }
- }
-
- /* copy state */
- zmemcpy(dest, source, sizeof(z_stream));
- zmemcpy(copy, state, sizeof(struct inflate_state));
- if (state->lencode >= state->codes &&
- state->lencode <= state->codes + ENOUGH - 1) {
- copy->lencode = copy->codes + (state->lencode - state->codes);
- copy->distcode = copy->codes + (state->distcode - state->codes);
- }
- copy->next = copy->codes + (state->next - state->codes);
- if (window != Z_NULL) {
- wsize = 1U << state->wbits;
- zmemcpy(window, state->window, wsize);
- }
- copy->window = window;
- dest->state = (struct internal_state FAR *)copy;
- return Z_OK;
-}
-
-int ZEXPORT inflateUndermine(strm, subvert)
-z_streamp strm;
-int subvert;
-{
- struct inflate_state FAR *state;
-
- if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
- state = (struct inflate_state FAR *)strm->state;
- state->sane = !subvert;
-#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
- return Z_OK;
-#else
- state->sane = 1;
- return Z_DATA_ERROR;
-#endif
-}
-
-long ZEXPORT inflateMark(strm)
-z_streamp strm;
-{
- struct inflate_state FAR *state;
-
- if (strm == Z_NULL || strm->state == Z_NULL) return -1L << 16;
- state = (struct inflate_state FAR *)strm->state;
- return ((long)(state->back) << 16) +
- (state->mode == COPY ? state->length :
- (state->mode == MATCH ? state->was - state->length : 0));
-}
diff --git a/3rdparty/assimp/contrib/zlib/inflate.h b/3rdparty/assimp/contrib/zlib/inflate.h
deleted file mode 100644
index 95f4986d..00000000
--- a/3rdparty/assimp/contrib/zlib/inflate.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/* inflate.h -- internal inflate state definition
- * Copyright (C) 1995-2009 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* WARNING: this file should *not* be used by applications. It is
- part of the implementation of the compression library and is
- subject to change. Applications should only use zlib.h.
- */
-
-/* define NO_GZIP when compiling if you want to disable gzip header and
- trailer decoding by inflate(). NO_GZIP would be used to avoid linking in
- the crc code when it is not needed. For shared libraries, gzip decoding
- should be left enabled. */
-#ifndef NO_GZIP
-# define GUNZIP
-#endif
-
-/* Possible inflate modes between inflate() calls */
-typedef enum {
- HEAD, /* i: waiting for magic header */
- FLAGS, /* i: waiting for method and flags (gzip) */
- TIME, /* i: waiting for modification time (gzip) */
- OS, /* i: waiting for extra flags and operating system (gzip) */
- EXLEN, /* i: waiting for extra length (gzip) */
- EXTRA, /* i: waiting for extra bytes (gzip) */
- NAME, /* i: waiting for end of file name (gzip) */
- COMMENT, /* i: waiting for end of comment (gzip) */
- HCRC, /* i: waiting for header crc (gzip) */
- DICTID, /* i: waiting for dictionary check value */
- DICT, /* waiting for inflateSetDictionary() call */
- TYPE, /* i: waiting for type bits, including last-flag bit */
- TYPEDO, /* i: same, but skip check to exit inflate on new block */
- STORED, /* i: waiting for stored size (length and complement) */
- COPY_, /* i/o: same as COPY below, but only first time in */
- COPY, /* i/o: waiting for input or output to copy stored block */
- TABLE, /* i: waiting for dynamic block table lengths */
- LENLENS, /* i: waiting for code length code lengths */
- CODELENS, /* i: waiting for length/lit and distance code lengths */
- LEN_, /* i: same as LEN below, but only first time in */
- LEN, /* i: waiting for length/lit/eob code */
- LENEXT, /* i: waiting for length extra bits */
- DIST, /* i: waiting for distance code */
- DISTEXT, /* i: waiting for distance extra bits */
- MATCH, /* o: waiting for output space to copy string */
- LIT, /* o: waiting for output space to write literal */
- CHECK, /* i: waiting for 32-bit check value */
- LENGTH, /* i: waiting for 32-bit length (gzip) */
- DONE, /* finished check, done -- remain here until reset */
- BAD, /* got a data error -- remain here until reset */
- MEM, /* got an inflate() memory error -- remain here until reset */
- SYNC /* looking for synchronization bytes to restart inflate() */
-} inflate_mode;
-
-/*
- State transitions between above modes -
-
- (most modes can go to BAD or MEM on error -- not shown for clarity)
-
- Process header:
- HEAD -> (gzip) or (zlib) or (raw)
- (gzip) -> FLAGS -> TIME -> OS -> EXLEN -> EXTRA -> NAME -> COMMENT ->
- HCRC -> TYPE
- (zlib) -> DICTID or TYPE
- DICTID -> DICT -> TYPE
- (raw) -> TYPEDO
- Read deflate blocks:
- TYPE -> TYPEDO -> STORED or TABLE or LEN_ or CHECK
- STORED -> COPY_ -> COPY -> TYPE
- TABLE -> LENLENS -> CODELENS -> LEN_
- LEN_ -> LEN
- Read deflate codes in fixed or dynamic block:
- LEN -> LENEXT or LIT or TYPE
- LENEXT -> DIST -> DISTEXT -> MATCH -> LEN
- LIT -> LEN
- Process trailer:
- CHECK -> LENGTH -> DONE
- */
-
-/* state maintained between inflate() calls. Approximately 10K bytes. */
-struct inflate_state {
- inflate_mode mode; /* current inflate mode */
- int last; /* true if processing last block */
- int wrap; /* bit 0 true for zlib, bit 1 true for gzip */
- int havedict; /* true if dictionary provided */
- int flags; /* gzip header method and flags (0 if zlib) */
- unsigned dmax; /* zlib header max distance (INFLATE_STRICT) */
- unsigned long check; /* protected copy of check value */
- unsigned long total; /* protected copy of output count */
- gz_headerp head; /* where to save gzip header information */
- /* sliding window */
- unsigned wbits; /* log base 2 of requested window size */
- unsigned wsize; /* window size or zero if not using window */
- unsigned whave; /* valid bytes in the window */
- unsigned wnext; /* window write index */
- unsigned char FAR *window; /* allocated sliding window, if needed */
- /* bit accumulator */
- unsigned long hold; /* input bit accumulator */
- unsigned bits; /* number of bits in "in" */
- /* for string and stored block copying */
- unsigned length; /* literal or length of data to copy */
- unsigned offset; /* distance back to copy string from */
- /* for table and code decoding */
- unsigned extra; /* extra bits needed */
- /* fixed and dynamic code tables */
- code const FAR *lencode; /* starting table for length/literal codes */
- code const FAR *distcode; /* starting table for distance codes */
- unsigned lenbits; /* index bits for lencode */
- unsigned distbits; /* index bits for distcode */
- /* dynamic table building */
- unsigned ncode; /* number of code length code lengths */
- unsigned nlen; /* number of length code lengths */
- unsigned ndist; /* number of distance code lengths */
- unsigned have; /* number of code lengths in lens[] */
- code FAR *next; /* next available space in codes[] */
- unsigned short lens[320]; /* temporary storage for code lengths */
- unsigned short work[288]; /* work area for code table building */
- code codes[ENOUGH]; /* space for code tables */
- int sane; /* if false, allow invalid distance too far */
- int back; /* bits back of last unprocessed length/lit */
- unsigned was; /* initial length of match */
-};
diff --git a/3rdparty/assimp/contrib/zlib/inftrees.c b/3rdparty/assimp/contrib/zlib/inftrees.c
deleted file mode 100644
index 11e9c52a..00000000
--- a/3rdparty/assimp/contrib/zlib/inftrees.c
+++ /dev/null
@@ -1,330 +0,0 @@
-/* inftrees.c -- generate Huffman trees for efficient decoding
- * Copyright (C) 1995-2010 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-#include "zutil.h"
-#include "inftrees.h"
-
-#define MAXBITS 15
-
-const char inflate_copyright[] =
- " inflate 1.2.5 Copyright 1995-2010 Mark Adler ";
-/*
- If you use the zlib library in a product, an acknowledgment is welcome
- in the documentation of your product. If for some reason you cannot
- include such an acknowledgment, I would appreciate that you keep this
- copyright string in the executable of your product.
- */
-
-/*
- Build a set of tables to decode the provided canonical Huffman code.
- The code lengths are lens[0..codes-1]. The result starts at *table,
- whose indices are 0..2^bits-1. work is a writable array of at least
- lens shorts, which is used as a work area. type is the type of code
- to be generated, CODES, LENS, or DISTS. On return, zero is success,
- -1 is an invalid code, and +1 means that ENOUGH isn't enough. table
- on return points to the next available entry's address. bits is the
- requested root table index bits, and on return it is the actual root
- table index bits. It will differ if the request is greater than the
- longest code or if it is less than the shortest code.
- */
-int ZLIB_INTERNAL inflate_table(type, lens, codes, table, bits, work)
-codetype type;
-unsigned short FAR *lens;
-unsigned codes;
-code FAR * FAR *table;
-unsigned FAR *bits;
-unsigned short FAR *work;
-{
- unsigned len; /* a code's length in bits */
- unsigned sym; /* index of code symbols */
- unsigned min, max; /* minimum and maximum code lengths */
- unsigned root; /* number of index bits for root table */
- unsigned curr; /* number of index bits for current table */
- unsigned drop; /* code bits to drop for sub-table */
- int left; /* number of prefix codes available */
- unsigned used; /* code entries in table used */
- unsigned huff; /* Huffman code */
- unsigned incr; /* for incrementing code, index */
- unsigned fill; /* index for replicating entries */
- unsigned low; /* low bits for current root entry */
- unsigned mask; /* mask for low root bits */
- code here; /* table entry for duplication */
- code FAR *next; /* next available space in table */
- const unsigned short FAR *base; /* base value table to use */
- const unsigned short FAR *extra; /* extra bits table to use */
- int end; /* use base and extra for symbol > end */
- unsigned short count[MAXBITS+1]; /* number of codes of each length */
- unsigned short offs[MAXBITS+1]; /* offsets in table for each length */
- static const unsigned short lbase[31] = { /* Length codes 257..285 base */
- 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
- 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
- static const unsigned short lext[31] = { /* Length codes 257..285 extra */
- 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
- 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 73, 195};
- static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
- 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
- 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
- 8193, 12289, 16385, 24577, 0, 0};
- static const unsigned short dext[32] = { /* Distance codes 0..29 extra */
- 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
- 23, 23, 24, 24, 25, 25, 26, 26, 27, 27,
- 28, 28, 29, 29, 64, 64};
-
- /*
- Process a set of code lengths to create a canonical Huffman code. The
- code lengths are lens[0..codes-1]. Each length corresponds to the
- symbols 0..codes-1. The Huffman code is generated by first sorting the
- symbols by length from short to long, and retaining the symbol order
- for codes with equal lengths. Then the code starts with all zero bits
- for the first code of the shortest length, and the codes are integer
- increments for the same length, and zeros are appended as the length
- increases. For the deflate format, these bits are stored backwards
- from their more natural integer increment ordering, and so when the
- decoding tables are built in the large loop below, the integer codes
- are incremented backwards.
-
- This routine assumes, but does not check, that all of the entries in
- lens[] are in the range 0..MAXBITS. The caller must assure this.
- 1..MAXBITS is interpreted as that code length. zero means that that
- symbol does not occur in this code.
-
- The codes are sorted by computing a count of codes for each length,
- creating from that a table of starting indices for each length in the
- sorted table, and then entering the symbols in order in the sorted
- table. The sorted table is work[], with that space being provided by
- the caller.
-
- The length counts are used for other purposes as well, i.e. finding
- the minimum and maximum length codes, determining if there are any
- codes at all, checking for a valid set of lengths, and looking ahead
- at length counts to determine sub-table sizes when building the
- decoding tables.
- */
-
- /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */
- for (len = 0; len <= MAXBITS; len++)
- count[len] = 0;
- for (sym = 0; sym < codes; sym++)
- count[lens[sym]]++;
-
- /* bound code lengths, force root to be within code lengths */
- root = *bits;
- for (max = MAXBITS; max >= 1; max--)
- if (count[max] != 0) break;
- if (root > max) root = max;
- if (max == 0) { /* no symbols to code at all */
- here.op = (unsigned char)64; /* invalid code marker */
- here.bits = (unsigned char)1;
- here.val = (unsigned short)0;
- *(*table)++ = here; /* make a table to force an error */
- *(*table)++ = here;
- *bits = 1;
- return 0; /* no symbols, but wait for decoding to report error */
- }
- for (min = 1; min < max; min++)
- if (count[min] != 0) break;
- if (root < min) root = min;
-
- /* check for an over-subscribed or incomplete set of lengths */
- left = 1;
- for (len = 1; len <= MAXBITS; len++) {
- left <<= 1;
- left -= count[len];
- if (left < 0) return -1; /* over-subscribed */
- }
- if (left > 0 && (type == CODES || max != 1))
- return -1; /* incomplete set */
-
- /* generate offsets into symbol table for each length for sorting */
- offs[1] = 0;
- for (len = 1; len < MAXBITS; len++)
- offs[len + 1] = offs[len] + count[len];
-
- /* sort symbols by length, by symbol order within each length */
- for (sym = 0; sym < codes; sym++)
- if (lens[sym] != 0) work[offs[lens[sym]]++] = (unsigned short)sym;
-
- /*
- Create and fill in decoding tables. In this loop, the table being
- filled is at next and has curr index bits. The code being used is huff
- with length len. That code is converted to an index by dropping drop
- bits off of the bottom. For codes where len is less than drop + curr,
- those top drop + curr - len bits are incremented through all values to
- fill the table with replicated entries.
-
- root is the number of index bits for the root table. When len exceeds
- root, sub-tables are created pointed to by the root entry with an index
- of the low root bits of huff. This is saved in low to check for when a
- new sub-table should be started. drop is zero when the root table is
- being filled, and drop is root when sub-tables are being filled.
-
- When a new sub-table is needed, it is necessary to look ahead in the
- code lengths to determine what size sub-table is needed. The length
- counts are used for this, and so count[] is decremented as codes are
- entered in the tables.
-
- used keeps track of how many table entries have been allocated from the
- provided *table space. It is checked for LENS and DIST tables against
- the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in
- the initial root table size constants. See the comments in inftrees.h
- for more information.
-
- sym increments through all symbols, and the loop terminates when
- all codes of length max, i.e. all codes, have been processed. This
- routine permits incomplete codes, so another loop after this one fills
- in the rest of the decoding tables with invalid code markers.
- */
-
- /* set up for code type */
- switch (type) {
- case CODES:
- base = extra = work; /* dummy value--not used */
- end = 19;
- break;
- case LENS:
- base = lbase;
- base -= 257;
- extra = lext;
- extra -= 257;
- end = 256;
- break;
- default: /* DISTS */
- base = dbase;
- extra = dext;
- end = -1;
- }
-
- /* initialize state for loop */
- huff = 0; /* starting code */
- sym = 0; /* starting code symbol */
- len = min; /* starting code length */
- next = *table; /* current table to fill in */
- curr = root; /* current table index bits */
- drop = 0; /* current bits to drop from code for index */
- low = (unsigned)(-1); /* trigger new sub-table when len > root */
- used = 1U << root; /* use root table entries */
- mask = used - 1; /* mask for comparing low */
-
- /* check available table space */
- if ((type == LENS && used >= ENOUGH_LENS) ||
- (type == DISTS && used >= ENOUGH_DISTS))
- return 1;
-
- /* process all codes and make table entries */
- for (;;) {
- /* create table entry */
- here.bits = (unsigned char)(len - drop);
- if ((int)(work[sym]) < end) {
- here.op = (unsigned char)0;
- here.val = work[sym];
- }
- else if ((int)(work[sym]) > end) {
- here.op = (unsigned char)(extra[work[sym]]);
- here.val = base[work[sym]];
- }
- else {
- here.op = (unsigned char)(32 + 64); /* end of block */
- here.val = 0;
- }
-
- /* replicate for those indices with low len bits equal to huff */
- incr = 1U << (len - drop);
- fill = 1U << curr;
- min = fill; /* save offset to next table */
- do {
- fill -= incr;
- next[(huff >> drop) + fill] = here;
- } while (fill != 0);
-
- /* backwards increment the len-bit code huff */
- incr = 1U << (len - 1);
- while (huff & incr)
- incr >>= 1;
- if (incr != 0) {
- huff &= incr - 1;
- huff += incr;
- }
- else
- huff = 0;
-
- /* go to next symbol, update count, len */
- sym++;
- if (--(count[len]) == 0) {
- if (len == max) break;
- len = lens[work[sym]];
- }
-
- /* create new sub-table if needed */
- if (len > root && (huff & mask) != low) {
- /* if first time, transition to sub-tables */
- if (drop == 0)
- drop = root;
-
- /* increment past last table */
- next += min; /* here min is 1 << curr */
-
- /* determine length of next table */
- curr = len - drop;
- left = (int)(1 << curr);
- while (curr + drop < max) {
- left -= count[curr + drop];
- if (left <= 0) break;
- curr++;
- left <<= 1;
- }
-
- /* check for enough space */
- used += 1U << curr;
- if ((type == LENS && used >= ENOUGH_LENS) ||
- (type == DISTS && used >= ENOUGH_DISTS))
- return 1;
-
- /* point entry in root table to sub-table */
- low = huff & mask;
- (*table)[low].op = (unsigned char)curr;
- (*table)[low].bits = (unsigned char)root;
- (*table)[low].val = (unsigned short)(next - *table);
- }
- }
-
- /*
- Fill in rest of table for incomplete codes. This loop is similar to the
- loop above in incrementing huff for table indices. It is assumed that
- len is equal to curr + drop, so there is no loop needed to increment
- through high index bits. When the current sub-table is filled, the loop
- drops back to the root table to fill in any remaining entries there.
- */
- here.op = (unsigned char)64; /* invalid code marker */
- here.bits = (unsigned char)(len - drop);
- here.val = (unsigned short)0;
- while (huff != 0) {
- /* when done with sub-table, drop back to root table */
- if (drop != 0 && (huff & mask) != low) {
- drop = 0;
- len = root;
- next = *table;
- here.bits = (unsigned char)len;
- }
-
- /* put invalid code marker in table */
- next[huff >> drop] = here;
-
- /* backwards increment the len-bit code huff */
- incr = 1U << (len - 1);
- while (huff & incr)
- incr >>= 1;
- if (incr != 0) {
- huff &= incr - 1;
- huff += incr;
- }
- else
- huff = 0;
- }
-
- /* set return parameters */
- *table += used;
- *bits = root;
- return 0;
-}
diff --git a/3rdparty/assimp/contrib/zlib/inftrees.h b/3rdparty/assimp/contrib/zlib/inftrees.h
deleted file mode 100644
index baa53a0b..00000000
--- a/3rdparty/assimp/contrib/zlib/inftrees.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* inftrees.h -- header to use inftrees.c
- * Copyright (C) 1995-2005, 2010 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* WARNING: this file should *not* be used by applications. It is
- part of the implementation of the compression library and is
- subject to change. Applications should only use zlib.h.
- */
-
-/* Structure for decoding tables. Each entry provides either the
- information needed to do the operation requested by the code that
- indexed that table entry, or it provides a pointer to another
- table that indexes more bits of the code. op indicates whether
- the entry is a pointer to another table, a literal, a length or
- distance, an end-of-block, or an invalid code. For a table
- pointer, the low four bits of op is the number of index bits of
- that table. For a length or distance, the low four bits of op
- is the number of extra bits to get after the code. bits is
- the number of bits in this code or part of the code to drop off
- of the bit buffer. val is the actual byte to output in the case
- of a literal, the base length or distance, or the offset from
- the current table to the next table. Each entry is four bytes. */
-typedef struct {
- unsigned char op; /* operation, extra bits, table bits */
- unsigned char bits; /* bits in this part of the code */
- unsigned short val; /* offset in table or code value */
-} code;
-
-/* op values as set by inflate_table():
- 00000000 - literal
- 0000tttt - table link, tttt != 0 is the number of table index bits
- 0001eeee - length or distance, eeee is the number of extra bits
- 01100000 - end of block
- 01000000 - invalid code
- */
-
-/* Maximum size of the dynamic table. The maximum number of code structures is
- 1444, which is the sum of 852 for literal/length codes and 592 for distance
- codes. These values were found by exhaustive searches using the program
- examples/enough.c found in the zlib distribtution. The arguments to that
- program are the number of symbols, the initial root table size, and the
- maximum bit length of a code. "enough 286 9 15" for literal/length codes
- returns returns 852, and "enough 30 6 15" for distance codes returns 592.
- The initial root table size (9 or 6) is found in the fifth argument of the
- inflate_table() calls in inflate.c and infback.c. If the root table size is
- changed, then these maximum sizes would be need to be recalculated and
- updated. */
-#define ENOUGH_LENS 852
-#define ENOUGH_DISTS 592
-#define ENOUGH (ENOUGH_LENS+ENOUGH_DISTS)
-
-/* Type of code to build for inflate_table() */
-typedef enum {
- CODES,
- LENS,
- DISTS
-} codetype;
-
-int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens,
- unsigned codes, code FAR * FAR *table,
- unsigned FAR *bits, unsigned short FAR *work));
diff --git a/3rdparty/assimp/contrib/zlib/trees.c b/3rdparty/assimp/contrib/zlib/trees.c
deleted file mode 100644
index 56e9bb1c..00000000
--- a/3rdparty/assimp/contrib/zlib/trees.c
+++ /dev/null
@@ -1,1244 +0,0 @@
-/* trees.c -- output deflated data using Huffman coding
- * Copyright (C) 1995-2010 Jean-loup Gailly
- * detect_data_type() function provided freely by Cosmin Truta, 2006
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/*
- * ALGORITHM
- *
- * The "deflation" process uses several Huffman trees. The more
- * common source values are represented by shorter bit sequences.
- *
- * Each code tree is stored in a compressed form which is itself
- * a Huffman encoding of the lengths of all the code strings (in
- * ascending order by source values). The actual code strings are
- * reconstructed from the lengths in the inflate process, as described
- * in the deflate specification.
- *
- * REFERENCES
- *
- * Deutsch, L.P.,"'Deflate' Compressed Data Format Specification".
- * Available in ftp.uu.net:/pub/archiving/zip/doc/deflate-1.1.doc
- *
- * Storer, James A.
- * Data Compression: Methods and Theory, pp. 49-50.
- * Computer Science Press, 1988. ISBN 0-7167-8156-5.
- *
- * Sedgewick, R.
- * Algorithms, p290.
- * Addison-Wesley, 1983. ISBN 0-201-06672-6.
- */
-
-/* @(#) $Id$ */
-
-/* #define GEN_TREES_H */
-
-#include "deflate.h"
-
-#ifdef DEBUG
-# include <ctype.h>
-#endif
-
-/* ===========================================================================
- * Constants
- */
-
-#define MAX_BL_BITS 7
-/* Bit length codes must not exceed MAX_BL_BITS bits */
-
-#define END_BLOCK 256
-/* end of block literal code */
-
-#define REP_3_6 16
-/* repeat previous bit length 3-6 times (2 bits of repeat count) */
-
-#define REPZ_3_10 17
-/* repeat a zero length 3-10 times (3 bits of repeat count) */
-
-#define REPZ_11_138 18
-/* repeat a zero length 11-138 times (7 bits of repeat count) */
-
-local const int extra_lbits[LENGTH_CODES] /* extra bits for each length code */
- = {0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0};
-
-local const int extra_dbits[D_CODES] /* extra bits for each distance code */
- = {0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13};
-
-local const int extra_blbits[BL_CODES]/* extra bits for each bit length code */
- = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7};
-
-local const uch bl_order[BL_CODES]
- = {16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15};
-/* The lengths of the bit length codes are sent in order of decreasing
- * probability, to avoid transmitting the lengths for unused bit length codes.
- */
-
-#define Buf_size (8 * 2*sizeof(char))
-/* Number of bits used within bi_buf. (bi_buf might be implemented on
- * more than 16 bits on some systems.)
- */
-
-/* ===========================================================================
- * Local data. These are initialized only once.
- */
-
-#define DIST_CODE_LEN 512 /* see definition of array dist_code below */
-
-#if defined(GEN_TREES_H) || !defined(STDC)
-/* non ANSI compilers may not accept trees.h */
-
-local ct_data static_ltree[L_CODES+2];
-/* The static literal tree. Since the bit lengths are imposed, there is no
- * need for the L_CODES extra codes used during heap construction. However
- * The codes 286 and 287 are needed to build a canonical tree (see _tr_init
- * below).
- */
-
-local ct_data static_dtree[D_CODES];
-/* The static distance tree. (Actually a trivial tree since all codes use
- * 5 bits.)
- */
-
-uch _dist_code[DIST_CODE_LEN];
-/* Distance codes. The first 256 values correspond to the distances
- * 3 .. 258, the last 256 values correspond to the top 8 bits of
- * the 15 bit distances.
- */
-
-uch _length_code[MAX_MATCH-MIN_MATCH+1];
-/* length code for each normalized match length (0 == MIN_MATCH) */
-
-local int base_length[LENGTH_CODES];
-/* First normalized length for each code (0 = MIN_MATCH) */
-
-local int base_dist[D_CODES];
-/* First normalized distance for each code (0 = distance of 1) */
-
-#else
-# include "trees.h"
-#endif /* GEN_TREES_H */
-
-struct static_tree_desc_s {
- const ct_data *static_tree; /* static tree or NULL */
- const intf *extra_bits; /* extra bits for each code or NULL */
- int extra_base; /* base index for extra_bits */
- int elems; /* max number of elements in the tree */
- int max_length; /* max bit length for the codes */
-};
-
-local static_tree_desc static_l_desc =
-{static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS};
-
-local static_tree_desc static_d_desc =
-{static_dtree, extra_dbits, 0, D_CODES, MAX_BITS};
-
-local static_tree_desc static_bl_desc =
-{(const ct_data *)0, extra_blbits, 0, BL_CODES, MAX_BL_BITS};
-
-/* ===========================================================================
- * Local (static) routines in this file.
- */
-
-local void tr_static_init OF((void));
-local void init_block OF((deflate_state *s));
-local void pqdownheap OF((deflate_state *s, ct_data *tree, int k));
-local void gen_bitlen OF((deflate_state *s, tree_desc *desc));
-local void gen_codes OF((ct_data *tree, int max_code, ushf *bl_count));
-local void build_tree OF((deflate_state *s, tree_desc *desc));
-local void scan_tree OF((deflate_state *s, ct_data *tree, int max_code));
-local void send_tree OF((deflate_state *s, ct_data *tree, int max_code));
-local int build_bl_tree OF((deflate_state *s));
-local void send_all_trees OF((deflate_state *s, int lcodes, int dcodes,
- int blcodes));
-local void compress_block OF((deflate_state *s, ct_data *ltree,
- ct_data *dtree));
-local int detect_data_type OF((deflate_state *s));
-local unsigned bi_reverse OF((unsigned value, int length));
-local void bi_windup OF((deflate_state *s));
-local void bi_flush OF((deflate_state *s));
-local void copy_block OF((deflate_state *s, charf *buf, unsigned len,
- int header));
-
-#ifdef GEN_TREES_H
-local void gen_trees_header OF((void));
-#endif
-
-#ifndef DEBUG
-# define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
- /* Send a code of the given tree. c and tree must not have side effects */
-
-#else /* DEBUG */
-# define send_code(s, c, tree) \
- { if (z_verbose>2) fprintf(stderr,"\ncd %3d ",(c)); \
- send_bits(s, tree[c].Code, tree[c].Len); }
-#endif
-
-/* ===========================================================================
- * Output a short LSB first on the stream.
- * IN assertion: there is enough room in pendingBuf.
- */
-#define put_short(s, w) { \
- put_byte(s, (uch)((w) & 0xff)); \
- put_byte(s, (uch)((ush)(w) >> 8)); \
-}
-
-/* ===========================================================================
- * Send a value on a given number of bits.
- * IN assertion: length <= 16 and value fits in length bits.
- */
-#ifdef DEBUG
-local void send_bits OF((deflate_state *s, int value, int length));
-
-local void send_bits(s, value, length)
- deflate_state *s;
- int value; /* value to send */
- int length; /* number of bits */
-{
- Tracevv((stderr," l %2d v %4x ", length, value));
- Assert(length > 0 && length <= 15, "invalid length");
- s->bits_sent += (ulg)length;
-
- /* If not enough room in bi_buf, use (valid) bits from bi_buf and
- * (16 - bi_valid) bits from value, leaving (width - (16-bi_valid))
- * unused bits in value.
- */
- if (s->bi_valid > (int)Buf_size - length) {
- s->bi_buf |= (ush)value << s->bi_valid;
- put_short(s, s->bi_buf);
- s->bi_buf = (ush)value >> (Buf_size - s->bi_valid);
- s->bi_valid += length - Buf_size;
- } else {
- s->bi_buf |= (ush)value << s->bi_valid;
- s->bi_valid += length;
- }
-}
-#else /* !DEBUG */
-
-#define send_bits(s, value, length) \
-{ int len = length;\
- if (s->bi_valid > (int)Buf_size - len) {\
- int val = value;\
- s->bi_buf |= (ush)val << s->bi_valid;\
- put_short(s, s->bi_buf);\
- s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
- s->bi_valid += len - Buf_size;\
- } else {\
- s->bi_buf |= (ush)(value) << s->bi_valid;\
- s->bi_valid += len;\
- }\
-}
-#endif /* DEBUG */
-
-
-/* the arguments must not have side effects */
-
-/* ===========================================================================
- * Initialize the various 'constant' tables.
- */
-local void tr_static_init()
-{
-#if defined(GEN_TREES_H) || !defined(STDC)
- static int static_init_done = 0;
- int n; /* iterates over tree elements */
- int bits; /* bit counter */
- int length; /* length value */
- int code; /* code value */
- int dist; /* distance index */
- ush bl_count[MAX_BITS+1];
- /* number of codes at each bit length for an optimal tree */
-
- if (static_init_done) return;
-
- /* For some embedded targets, global variables are not initialized: */
-#ifdef NO_INIT_GLOBAL_POINTERS
- static_l_desc.static_tree = static_ltree;
- static_l_desc.extra_bits = extra_lbits;
- static_d_desc.static_tree = static_dtree;
- static_d_desc.extra_bits = extra_dbits;
- static_bl_desc.extra_bits = extra_blbits;
-#endif
-
- /* Initialize the mapping length (0..255) -> length code (0..28) */
- length = 0;
- for (code = 0; code < LENGTH_CODES-1; code++) {
- base_length[code] = length;
- for (n = 0; n < (1<<extra_lbits[code]); n++) {
- _length_code[length++] = (uch)code;
- }
- }
- Assert (length == 256, "tr_static_init: length != 256");
- /* Note that the length 255 (match length 258) can be represented
- * in two different ways: code 284 + 5 bits or code 285, so we
- * overwrite length_code[255] to use the best encoding:
- */
- _length_code[length-1] = (uch)code;
-
- /* Initialize the mapping dist (0..32K) -> dist code (0..29) */
- dist = 0;
- for (code = 0 ; code < 16; code++) {
- base_dist[code] = dist;
- for (n = 0; n < (1<<extra_dbits[code]); n++) {
- _dist_code[dist++] = (uch)code;
- }
- }
- Assert (dist == 256, "tr_static_init: dist != 256");
- dist >>= 7; /* from now on, all distances are divided by 128 */
- for ( ; code < D_CODES; code++) {
- base_dist[code] = dist << 7;
- for (n = 0; n < (1<<(extra_dbits[code]-7)); n++) {
- _dist_code[256 + dist++] = (uch)code;
- }
- }
- Assert (dist == 256, "tr_static_init: 256+dist != 512");
-
- /* Construct the codes of the static literal tree */
- for (bits = 0; bits <= MAX_BITS; bits++) bl_count[bits] = 0;
- n = 0;
- while (n <= 143) static_ltree[n++].Len = 8, bl_count[8]++;
- while (n <= 255) static_ltree[n++].Len = 9, bl_count[9]++;
- while (n <= 279) static_ltree[n++].Len = 7, bl_count[7]++;
- while (n <= 287) static_ltree[n++].Len = 8, bl_count[8]++;
- /* Codes 286 and 287 do not exist, but we must include them in the
- * tree construction to get a canonical Huffman tree (longest code
- * all ones)
- */
- gen_codes((ct_data *)static_ltree, L_CODES+1, bl_count);
-
- /* The static distance tree is trivial: */
- for (n = 0; n < D_CODES; n++) {
- static_dtree[n].Len = 5;
- static_dtree[n].Code = bi_reverse((unsigned)n, 5);
- }
- static_init_done = 1;
-
-# ifdef GEN_TREES_H
- gen_trees_header();
-# endif
-#endif /* defined(GEN_TREES_H) || !defined(STDC) */
-}
-
-/* ===========================================================================
- * Genererate the file trees.h describing the static trees.
- */
-#ifdef GEN_TREES_H
-# ifndef DEBUG
-# include <stdio.h>
-# endif
-
-# define SEPARATOR(i, last, width) \
- ((i) == (last)? "\n};\n\n" : \
- ((i) % (width) == (width)-1 ? ",\n" : ", "))
-
-void gen_trees_header()
-{
- FILE *header = fopen("trees.h", "w");
- int i;
-
- Assert (header != NULL, "Can't open trees.h");
- fprintf(header,
- "/* header created automatically with -DGEN_TREES_H */\n\n");
-
- fprintf(header, "local const ct_data static_ltree[L_CODES+2] = {\n");
- for (i = 0; i < L_CODES+2; i++) {
- fprintf(header, "{{%3u},{%3u}}%s", static_ltree[i].Code,
- static_ltree[i].Len, SEPARATOR(i, L_CODES+1, 5));
- }
-
- fprintf(header, "local const ct_data static_dtree[D_CODES] = {\n");
- for (i = 0; i < D_CODES; i++) {
- fprintf(header, "{{%2u},{%2u}}%s", static_dtree[i].Code,
- static_dtree[i].Len, SEPARATOR(i, D_CODES-1, 5));
- }
-
- fprintf(header, "const uch ZLIB_INTERNAL _dist_code[DIST_CODE_LEN] = {\n");
- for (i = 0; i < DIST_CODE_LEN; i++) {
- fprintf(header, "%2u%s", _dist_code[i],
- SEPARATOR(i, DIST_CODE_LEN-1, 20));
- }
-
- fprintf(header,
- "const uch ZLIB_INTERNAL _length_code[MAX_MATCH-MIN_MATCH+1]= {\n");
- for (i = 0; i < MAX_MATCH-MIN_MATCH+1; i++) {
- fprintf(header, "%2u%s", _length_code[i],
- SEPARATOR(i, MAX_MATCH-MIN_MATCH, 20));
- }
-
- fprintf(header, "local const int base_length[LENGTH_CODES] = {\n");
- for (i = 0; i < LENGTH_CODES; i++) {
- fprintf(header, "%1u%s", base_length[i],
- SEPARATOR(i, LENGTH_CODES-1, 20));
- }
-
- fprintf(header, "local const int base_dist[D_CODES] = {\n");
- for (i = 0; i < D_CODES; i++) {
- fprintf(header, "%5u%s", base_dist[i],
- SEPARATOR(i, D_CODES-1, 10));
- }
-
- fclose(header);
-}
-#endif /* GEN_TREES_H */
-
-/* ===========================================================================
- * Initialize the tree data structures for a new zlib stream.
- */
-void ZLIB_INTERNAL _tr_init(s)
- deflate_state *s;
-{
- tr_static_init();
-
- s->l_desc.dyn_tree = s->dyn_ltree;
- s->l_desc.stat_desc = &static_l_desc;
-
- s->d_desc.dyn_tree = s->dyn_dtree;
- s->d_desc.stat_desc = &static_d_desc;
-
- s->bl_desc.dyn_tree = s->bl_tree;
- s->bl_desc.stat_desc = &static_bl_desc;
-
- s->bi_buf = 0;
- s->bi_valid = 0;
- s->last_eob_len = 8; /* enough lookahead for inflate */
-#ifdef DEBUG
- s->compressed_len = 0L;
- s->bits_sent = 0L;
-#endif
-
- /* Initialize the first block of the first file: */
- init_block(s);
-}
-
-/* ===========================================================================
- * Initialize a new block.
- */
-local void init_block(s)
- deflate_state *s;
-{
- int n; /* iterates over tree elements */
-
- /* Initialize the trees. */
- for (n = 0; n < L_CODES; n++) s->dyn_ltree[n].Freq = 0;
- for (n = 0; n < D_CODES; n++) s->dyn_dtree[n].Freq = 0;
- for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0;
-
- s->dyn_ltree[END_BLOCK].Freq = 1;
- s->opt_len = s->static_len = 0L;
- s->last_lit = s->matches = 0;
-}
-
-#define SMALLEST 1
-/* Index within the heap array of least frequent node in the Huffman tree */
-
-
-/* ===========================================================================
- * Remove the smallest element from the heap and recreate the heap with
- * one less element. Updates heap and heap_len.
- */
-#define pqremove(s, tree, top) \
-{\
- top = s->heap[SMALLEST]; \
- s->heap[SMALLEST] = s->heap[s->heap_len--]; \
- pqdownheap(s, tree, SMALLEST); \
-}
-
-/* ===========================================================================
- * Compares to subtrees, using the tree depth as tie breaker when
- * the subtrees have equal frequency. This minimizes the worst case length.
- */
-#define smaller(tree, n, m, depth) \
- (tree[n].Freq < tree[m].Freq || \
- (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m]))
-
-/* ===========================================================================
- * Restore the heap property by moving down the tree starting at node k,
- * exchanging a node with the smallest of its two sons if necessary, stopping
- * when the heap property is re-established (each father smaller than its
- * two sons).
- */
-local void pqdownheap(s, tree, k)
- deflate_state *s;
- ct_data *tree; /* the tree to restore */
- int k; /* node to move down */
-{
- int v = s->heap[k];
- int j = k << 1; /* left son of k */
- while (j <= s->heap_len) {
- /* Set j to the smallest of the two sons: */
- if (j < s->heap_len &&
- smaller(tree, s->heap[j+1], s->heap[j], s->depth)) {
- j++;
- }
- /* Exit if v is smaller than both sons */
- if (smaller(tree, v, s->heap[j], s->depth)) break;
-
- /* Exchange v with the smallest son */
- s->heap[k] = s->heap[j]; k = j;
-
- /* And continue down the tree, setting j to the left son of k */
- j <<= 1;
- }
- s->heap[k] = v;
-}
-
-/* ===========================================================================
- * Compute the optimal bit lengths for a tree and update the total bit length
- * for the current block.
- * IN assertion: the fields freq and dad are set, heap[heap_max] and
- * above are the tree nodes sorted by increasing frequency.
- * OUT assertions: the field len is set to the optimal bit length, the
- * array bl_count contains the frequencies for each bit length.
- * The length opt_len is updated; static_len is also updated if stree is
- * not null.
- */
-local void gen_bitlen(s, desc)
- deflate_state *s;
- tree_desc *desc; /* the tree descriptor */
-{
- ct_data *tree = desc->dyn_tree;
- int max_code = desc->max_code;
- const ct_data *stree = desc->stat_desc->static_tree;
- const intf *extra = desc->stat_desc->extra_bits;
- int base = desc->stat_desc->extra_base;
- int max_length = desc->stat_desc->max_length;
- int h; /* heap index */
- int n, m; /* iterate over the tree elements */
- int bits; /* bit length */
- int xbits; /* extra bits */
- ush f; /* frequency */
- int overflow = 0; /* number of elements with bit length too large */
-
- for (bits = 0; bits <= MAX_BITS; bits++) s->bl_count[bits] = 0;
-
- /* In a first pass, compute the optimal bit lengths (which may
- * overflow in the case of the bit length tree).
- */
- tree[s->heap[s->heap_max]].Len = 0; /* root of the heap */
-
- for (h = s->heap_max+1; h < HEAP_SIZE; h++) {
- n = s->heap[h];
- bits = tree[tree[n].Dad].Len + 1;
- if (bits > max_length) bits = max_length, overflow++;
- tree[n].Len = (ush)bits;
- /* We overwrite tree[n].Dad which is no longer needed */
-
- if (n > max_code) continue; /* not a leaf node */
-
- s->bl_count[bits]++;
- xbits = 0;
- if (n >= base) xbits = extra[n-base];
- f = tree[n].Freq;
- s->opt_len += (ulg)f * (bits + xbits);
- if (stree) s->static_len += (ulg)f * (stree[n].Len + xbits);
- }
- if (overflow == 0) return;
-
- Trace((stderr,"\nbit length overflow\n"));
- /* This happens for example on obj2 and pic of the Calgary corpus */
-
- /* Find the first bit length which could increase: */
- do {
- bits = max_length-1;
- while (s->bl_count[bits] == 0) bits--;
- s->bl_count[bits]--; /* move one leaf down the tree */
- s->bl_count[bits+1] += 2; /* move one overflow item as its brother */
- s->bl_count[max_length]--;
- /* The brother of the overflow item also moves one step up,
- * but this does not affect bl_count[max_length]
- */
- overflow -= 2;
- } while (overflow > 0);
-
- /* Now recompute all bit lengths, scanning in increasing frequency.
- * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all
- * lengths instead of fixing only the wrong ones. This idea is taken
- * from 'ar' written by Haruhiko Okumura.)
- */
- for (bits = max_length; bits != 0; bits--) {
- n = s->bl_count[bits];
- while (n != 0) {
- m = s->heap[--h];
- if (m > max_code) continue;
- if ((unsigned) tree[m].Len != (unsigned) bits) {
- Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits));
- s->opt_len += ((long)bits - (long)tree[m].Len)
- *(long)tree[m].Freq;
- tree[m].Len = (ush)bits;
- }
- n--;
- }
- }
-}
-
-/* ===========================================================================
- * Generate the codes for a given tree and bit counts (which need not be
- * optimal).
- * IN assertion: the array bl_count contains the bit length statistics for
- * the given tree and the field len is set for all tree elements.
- * OUT assertion: the field code is set for all tree elements of non
- * zero code length.
- */
-local void gen_codes (tree, max_code, bl_count)
- ct_data *tree; /* the tree to decorate */
- int max_code; /* largest code with non zero frequency */
- ushf *bl_count; /* number of codes at each bit length */
-{
- ush next_code[MAX_BITS+1]; /* next code value for each bit length */
- ush code = 0; /* running code value */
- int bits; /* bit index */
- int n; /* code index */
-
- /* The distribution counts are first used to generate the code values
- * without bit reversal.
- */
- for (bits = 1; bits <= MAX_BITS; bits++) {
- next_code[bits] = code = (code + bl_count[bits-1]) << 1;
- }
- /* Check that the bit counts in bl_count are consistent. The last code
- * must be all ones.
- */
- Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,
- "inconsistent bit counts");
- Tracev((stderr,"\ngen_codes: max_code %d ", max_code));
-
- for (n = 0; n <= max_code; n++) {
- int len = tree[n].Len;
- if (len == 0) continue;
- /* Now reverse the bits */
- tree[n].Code = bi_reverse(next_code[len]++, len);
-
- Tracecv(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ",
- n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));
- }
-}
-
-/* ===========================================================================
- * Construct one Huffman tree and assigns the code bit strings and lengths.
- * Update the total bit length for the current block.
- * IN assertion: the field freq is set for all tree elements.
- * OUT assertions: the fields len and code are set to the optimal bit length
- * and corresponding code. The length opt_len is updated; static_len is
- * also updated if stree is not null. The field max_code is set.
- */
-local void build_tree(s, desc)
- deflate_state *s;
- tree_desc *desc; /* the tree descriptor */
-{
- ct_data *tree = desc->dyn_tree;
- const ct_data *stree = desc->stat_desc->static_tree;
- int elems = desc->stat_desc->elems;
- int n, m; /* iterate over heap elements */
- int max_code = -1; /* largest code with non zero frequency */
- int node; /* new node being created */
-
- /* Construct the initial heap, with least frequent element in
- * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].
- * heap[0] is not used.
- */
- s->heap_len = 0, s->heap_max = HEAP_SIZE;
-
- for (n = 0; n < elems; n++) {
- if (tree[n].Freq != 0) {
- s->heap[++(s->heap_len)] = max_code = n;
- s->depth[n] = 0;
- } else {
- tree[n].Len = 0;
- }
- }
-
- /* The pkzip format requires that at least one distance code exists,
- * and that at least one bit should be sent even if there is only one
- * possible code. So to avoid special checks later on we force at least
- * two codes of non zero frequency.
- */
- while (s->heap_len < 2) {
- node = s->heap[++(s->heap_len)] = (max_code < 2 ? ++max_code : 0);
- tree[node].Freq = 1;
- s->depth[node] = 0;
- s->opt_len--; if (stree) s->static_len -= stree[node].Len;
- /* node is 0 or 1 so it does not have extra bits */
- }
- desc->max_code = max_code;
-
- /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,
- * establish sub-heaps of increasing lengths:
- */
- for (n = s->heap_len/2; n >= 1; n--) pqdownheap(s, tree, n);
-
- /* Construct the Huffman tree by repeatedly combining the least two
- * frequent nodes.
- */
- node = elems; /* next internal node of the tree */
- do {
- pqremove(s, tree, n); /* n = node of least frequency */
- m = s->heap[SMALLEST]; /* m = node of next least frequency */
-
- s->heap[--(s->heap_max)] = n; /* keep the nodes sorted by frequency */
- s->heap[--(s->heap_max)] = m;
-
- /* Create a new node father of n and m */
- tree[node].Freq = tree[n].Freq + tree[m].Freq;
- s->depth[node] = (uch)((s->depth[n] >= s->depth[m] ?
- s->depth[n] : s->depth[m]) + 1);
- tree[n].Dad = tree[m].Dad = (ush)node;
-#ifdef DUMP_BL_TREE
- if (tree == s->bl_tree) {
- fprintf(stderr,"\nnode %d(%d), sons %d(%d) %d(%d)",
- node, tree[node].Freq, n, tree[n].Freq, m, tree[m].Freq);
- }
-#endif
- /* and insert the new node in the heap */
- s->heap[SMALLEST] = node++;
- pqdownheap(s, tree, SMALLEST);
-
- } while (s->heap_len >= 2);
-
- s->heap[--(s->heap_max)] = s->heap[SMALLEST];
-
- /* At this point, the fields freq and dad are set. We can now
- * generate the bit lengths.
- */
- gen_bitlen(s, (tree_desc *)desc);
-
- /* The field len is now set, we can generate the bit codes */
- gen_codes ((ct_data *)tree, max_code, s->bl_count);
-}
-
-/* ===========================================================================
- * Scan a literal or distance tree to determine the frequencies of the codes
- * in the bit length tree.
- */
-local void scan_tree (s, tree, max_code)
- deflate_state *s;
- ct_data *tree; /* the tree to be scanned */
- int max_code; /* and its largest code of non zero frequency */
-{
- int n; /* iterates over all tree elements */
- int prevlen = -1; /* last emitted length */
- int curlen; /* length of current code */
- int nextlen = tree[0].Len; /* length of next code */
- int count = 0; /* repeat count of the current code */
- int max_count = 7; /* max repeat count */
- int min_count = 4; /* min repeat count */
-
- if (nextlen == 0) max_count = 138, min_count = 3;
- tree[max_code+1].Len = (ush)0xffff; /* guard */
-
- for (n = 0; n <= max_code; n++) {
- curlen = nextlen; nextlen = tree[n+1].Len;
- if (++count < max_count && curlen == nextlen) {
- continue;
- } else if (count < min_count) {
- s->bl_tree[curlen].Freq += count;
- } else if (curlen != 0) {
- if (curlen != prevlen) s->bl_tree[curlen].Freq++;
- s->bl_tree[REP_3_6].Freq++;
- } else if (count <= 10) {
- s->bl_tree[REPZ_3_10].Freq++;
- } else {
- s->bl_tree[REPZ_11_138].Freq++;
- }
- count = 0; prevlen = curlen;
- if (nextlen == 0) {
- max_count = 138, min_count = 3;
- } else if (curlen == nextlen) {
- max_count = 6, min_count = 3;
- } else {
- max_count = 7, min_count = 4;
- }
- }
-}
-
-/* ===========================================================================
- * Send a literal or distance tree in compressed form, using the codes in
- * bl_tree.
- */
-local void send_tree (s, tree, max_code)
- deflate_state *s;
- ct_data *tree; /* the tree to be scanned */
- int max_code; /* and its largest code of non zero frequency */
-{
- int n; /* iterates over all tree elements */
- int prevlen = -1; /* last emitted length */
- int curlen; /* length of current code */
- int nextlen = tree[0].Len; /* length of next code */
- int count = 0; /* repeat count of the current code */
- int max_count = 7; /* max repeat count */
- int min_count = 4; /* min repeat count */
-
- /* tree[max_code+1].Len = -1; */ /* guard already set */
- if (nextlen == 0) max_count = 138, min_count = 3;
-
- for (n = 0; n <= max_code; n++) {
- curlen = nextlen; nextlen = tree[n+1].Len;
- if (++count < max_count && curlen == nextlen) {
- continue;
- } else if (count < min_count) {
- do { send_code(s, curlen, s->bl_tree); } while (--count != 0);
-
- } else if (curlen != 0) {
- if (curlen != prevlen) {
- send_code(s, curlen, s->bl_tree); count--;
- }
- Assert(count >= 3 && count <= 6, " 3_6?");
- send_code(s, REP_3_6, s->bl_tree); send_bits(s, count-3, 2);
-
- } else if (count <= 10) {
- send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count-3, 3);
-
- } else {
- send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count-11, 7);
- }
- count = 0; prevlen = curlen;
- if (nextlen == 0) {
- max_count = 138, min_count = 3;
- } else if (curlen == nextlen) {
- max_count = 6, min_count = 3;
- } else {
- max_count = 7, min_count = 4;
- }
- }
-}
-
-/* ===========================================================================
- * Construct the Huffman tree for the bit lengths and return the index in
- * bl_order of the last bit length code to send.
- */
-local int build_bl_tree(s)
- deflate_state *s;
-{
- int max_blindex; /* index of last bit length code of non zero freq */
-
- /* Determine the bit length frequencies for literal and distance trees */
- scan_tree(s, (ct_data *)s->dyn_ltree, s->l_desc.max_code);
- scan_tree(s, (ct_data *)s->dyn_dtree, s->d_desc.max_code);
-
- /* Build the bit length tree: */
- build_tree(s, (tree_desc *)(&(s->bl_desc)));
- /* opt_len now includes the length of the tree representations, except
- * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.
- */
-
- /* Determine the number of bit length codes to send. The pkzip format
- * requires that at least 4 bit length codes be sent. (appnote.txt says
- * 3 but the actual value used is 4.)
- */
- for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) {
- if (s->bl_tree[bl_order[max_blindex]].Len != 0) break;
- }
- /* Update opt_len to include the bit length tree and counts */
- s->opt_len += 3*(max_blindex+1) + 5+5+4;
- Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld",
- s->opt_len, s->static_len));
-
- return max_blindex;
-}
-
-/* ===========================================================================
- * Send the header for a block using dynamic Huffman trees: the counts, the
- * lengths of the bit length codes, the literal tree and the distance tree.
- * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.
- */
-local void send_all_trees(s, lcodes, dcodes, blcodes)
- deflate_state *s;
- int lcodes, dcodes, blcodes; /* number of codes for each tree */
-{
- int rank; /* index in bl_order */
-
- Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes");
- Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,
- "too many codes");
- Tracev((stderr, "\nbl counts: "));
- send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */
- send_bits(s, dcodes-1, 5);
- send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */
- for (rank = 0; rank < blcodes; rank++) {
- Tracev((stderr, "\nbl code %2d ", bl_order[rank]));
- send_bits(s, s->bl_tree[bl_order[rank]].Len, 3);
- }
- Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent));
-
- send_tree(s, (ct_data *)s->dyn_ltree, lcodes-1); /* literal tree */
- Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent));
-
- send_tree(s, (ct_data *)s->dyn_dtree, dcodes-1); /* distance tree */
- Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent));
-}
-
-/* ===========================================================================
- * Send a stored block
- */
-void ZLIB_INTERNAL _tr_stored_block(s, buf, stored_len, last)
- deflate_state *s;
- charf *buf; /* input block */
- ulg stored_len; /* length of input block */
- int last; /* one if this is the last block for a file */
-{
- send_bits(s, (STORED_BLOCK<<1)+last, 3); /* send block type */
-#ifdef DEBUG
- s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L;
- s->compressed_len += (stored_len + 4) << 3;
-#endif
- copy_block(s, buf, (unsigned)stored_len, 1); /* with header */
-}
-
-/* ===========================================================================
- * Send one empty static block to give enough lookahead for inflate.
- * This takes 10 bits, of which 7 may remain in the bit buffer.
- * The current inflate code requires 9 bits of lookahead. If the
- * last two codes for the previous block (real code plus EOB) were coded
- * on 5 bits or less, inflate may have only 5+3 bits of lookahead to decode
- * the last real code. In this case we send two empty static blocks instead
- * of one. (There are no problems if the previous block is stored or fixed.)
- * To simplify the code, we assume the worst case of last real code encoded
- * on one bit only.
- */
-void ZLIB_INTERNAL _tr_align(s)
- deflate_state *s;
-{
- send_bits(s, STATIC_TREES<<1, 3);
- send_code(s, END_BLOCK, static_ltree);
-#ifdef DEBUG
- s->compressed_len += 10L; /* 3 for block type, 7 for EOB */
-#endif
- bi_flush(s);
- /* Of the 10 bits for the empty block, we have already sent
- * (10 - bi_valid) bits. The lookahead for the last real code (before
- * the EOB of the previous block) was thus at least one plus the length
- * of the EOB plus what we have just sent of the empty static block.
- */
- if (1 + s->last_eob_len + 10 - s->bi_valid < 9) {
- send_bits(s, STATIC_TREES<<1, 3);
- send_code(s, END_BLOCK, static_ltree);
-#ifdef DEBUG
- s->compressed_len += 10L;
-#endif
- bi_flush(s);
- }
- s->last_eob_len = 7;
-}
-
-/* ===========================================================================
- * Determine the best encoding for the current block: dynamic trees, static
- * trees or store, and output the encoded block to the zip file.
- */
-void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last)
- deflate_state *s;
- charf *buf; /* input block, or NULL if too old */
- ulg stored_len; /* length of input block */
- int last; /* one if this is the last block for a file */
-{
- ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */
- int max_blindex = 0; /* index of last bit length code of non zero freq */
-
- /* Build the Huffman trees unless a stored block is forced */
- if (s->level > 0) {
-
- /* Check if the file is binary or text */
- if (s->strm->data_type == Z_UNKNOWN)
- s->strm->data_type = detect_data_type(s);
-
- /* Construct the literal and distance trees */
- build_tree(s, (tree_desc *)(&(s->l_desc)));
- Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len,
- s->static_len));
-
- build_tree(s, (tree_desc *)(&(s->d_desc)));
- Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len,
- s->static_len));
- /* At this point, opt_len and static_len are the total bit lengths of
- * the compressed block data, excluding the tree representations.
- */
-
- /* Build the bit length tree for the above two trees, and get the index
- * in bl_order of the last bit length code to send.
- */
- max_blindex = build_bl_tree(s);
-
- /* Determine the best encoding. Compute the block lengths in bytes. */
- opt_lenb = (s->opt_len+3+7)>>3;
- static_lenb = (s->static_len+3+7)>>3;
-
- Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ",
- opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,
- s->last_lit));
-
- if (static_lenb <= opt_lenb) opt_lenb = static_lenb;
-
- } else {
- Assert(buf != (char*)0, "lost buf");
- opt_lenb = static_lenb = stored_len + 5; /* force a stored block */
- }
-
-#ifdef FORCE_STORED
- if (buf != (char*)0) { /* force stored block */
-#else
- if (stored_len+4 <= opt_lenb && buf != (char*)0) {
- /* 4: two words for the lengths */
-#endif
- /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.
- * Otherwise we can't have processed more than WSIZE input bytes since
- * the last block flush, because compression would have been
- * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to
- * transform a block into a stored block.
- */
- _tr_stored_block(s, buf, stored_len, last);
-
-#ifdef FORCE_STATIC
- } else if (static_lenb >= 0) { /* force static trees */
-#else
- } else if (s->strategy == Z_FIXED || static_lenb == opt_lenb) {
-#endif
- send_bits(s, (STATIC_TREES<<1)+last, 3);
- compress_block(s, (ct_data *)static_ltree, (ct_data *)static_dtree);
-#ifdef DEBUG
- s->compressed_len += 3 + s->static_len;
-#endif
- } else {
- send_bits(s, (DYN_TREES<<1)+last, 3);
- send_all_trees(s, s->l_desc.max_code+1, s->d_desc.max_code+1,
- max_blindex+1);
- compress_block(s, (ct_data *)s->dyn_ltree, (ct_data *)s->dyn_dtree);
-#ifdef DEBUG
- s->compressed_len += 3 + s->opt_len;
-#endif
- }
- Assert (s->compressed_len == s->bits_sent, "bad compressed size");
- /* The above check is made mod 2^32, for files larger than 512 MB
- * and uLong implemented on 32 bits.
- */
- init_block(s);
-
- if (last) {
- bi_windup(s);
-#ifdef DEBUG
- s->compressed_len += 7; /* align on byte boundary */
-#endif
- }
- Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3,
- s->compressed_len-7*last));
-}
-
-/* ===========================================================================
- * Save the match info and tally the frequency counts. Return true if
- * the current block must be flushed.
- */
-int ZLIB_INTERNAL _tr_tally (s, dist, lc)
- deflate_state *s;
- unsigned dist; /* distance of matched string */
- unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */
-{
- s->d_buf[s->last_lit] = (ush)dist;
- s->l_buf[s->last_lit++] = (uch)lc;
- if (dist == 0) {
- /* lc is the unmatched char */
- s->dyn_ltree[lc].Freq++;
- } else {
- s->matches++;
- /* Here, lc is the match length - MIN_MATCH */
- dist--; /* dist = match distance - 1 */
- Assert((ush)dist < (ush)MAX_DIST(s) &&
- (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&
- (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match");
-
- s->dyn_ltree[_length_code[lc]+LITERALS+1].Freq++;
- s->dyn_dtree[d_code(dist)].Freq++;
- }
-
-#ifdef TRUNCATE_BLOCK
- /* Try to guess if it is profitable to stop the current block here */
- if ((s->last_lit & 0x1fff) == 0 && s->level > 2) {
- /* Compute an upper bound for the compressed length */
- ulg out_length = (ulg)s->last_lit*8L;
- ulg in_length = (ulg)((long)s->strstart - s->block_start);
- int dcode;
- for (dcode = 0; dcode < D_CODES; dcode++) {
- out_length += (ulg)s->dyn_dtree[dcode].Freq *
- (5L+extra_dbits[dcode]);
- }
- out_length >>= 3;
- Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ",
- s->last_lit, in_length, out_length,
- 100L - out_length*100L/in_length));
- if (s->matches < s->last_lit/2 && out_length < in_length/2) return 1;
- }
-#endif
- return (s->last_lit == s->lit_bufsize-1);
- /* We avoid equality with lit_bufsize because of wraparound at 64K
- * on 16 bit machines and because stored blocks are restricted to
- * 64K-1 bytes.
- */
-}
-
-/* ===========================================================================
- * Send the block data compressed using the given Huffman trees
- */
-local void compress_block(s, ltree, dtree)
- deflate_state *s;
- ct_data *ltree; /* literal tree */
- ct_data *dtree; /* distance tree */
-{
- unsigned dist; /* distance of matched string */
- int lc; /* match length or unmatched char (if dist == 0) */
- unsigned lx = 0; /* running index in l_buf */
- unsigned code; /* the code to send */
- int extra; /* number of extra bits to send */
-
- if (s->last_lit != 0) do {
- dist = s->d_buf[lx];
- lc = s->l_buf[lx++];
- if (dist == 0) {
- send_code(s, lc, ltree); /* send a literal byte */
- Tracecv(isgraph(lc), (stderr," '%c' ", lc));
- } else {
- /* Here, lc is the match length - MIN_MATCH */
- code = _length_code[lc];
- send_code(s, code+LITERALS+1, ltree); /* send the length code */
- extra = extra_lbits[code];
- if (extra != 0) {
- lc -= base_length[code];
- send_bits(s, lc, extra); /* send the extra length bits */
- }
- dist--; /* dist is now the match distance - 1 */
- code = d_code(dist);
- Assert (code < D_CODES, "bad d_code");
-
- send_code(s, code, dtree); /* send the distance code */
- extra = extra_dbits[code];
- if (extra != 0) {
- dist -= base_dist[code];
- send_bits(s, dist, extra); /* send the extra distance bits */
- }
- } /* literal or match pair ? */
-
- /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */
- Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,
- "pendingBuf overflow");
-
- } while (lx < s->last_lit);
-
- send_code(s, END_BLOCK, ltree);
- s->last_eob_len = ltree[END_BLOCK].Len;
-}
-
-/* ===========================================================================
- * Check if the data type is TEXT or BINARY, using the following algorithm:
- * - TEXT if the two conditions below are satisfied:
- * a) There are no non-portable control characters belonging to the
- * "black list" (0..6, 14..25, 28..31).
- * b) There is at least one printable character belonging to the
- * "white list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).
- * - BINARY otherwise.
- * - The following partially-portable control characters form a
- * "gray list" that is ignored in this detection algorithm:
- * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).
- * IN assertion: the fields Freq of dyn_ltree are set.
- */
-local int detect_data_type(s)
- deflate_state *s;
-{
- /* black_mask is the bit mask of black-listed bytes
- * set bits 0..6, 14..25, and 28..31
- * 0xf3ffc07f = binary 11110011111111111100000001111111
- */
- unsigned long black_mask = 0xf3ffc07fUL;
- int n;
-
- /* Check for non-textual ("black-listed") bytes. */
- for (n = 0; n <= 31; n++, black_mask >>= 1)
- if ((black_mask & 1) && (s->dyn_ltree[n].Freq != 0))
- return Z_BINARY;
-
- /* Check for textual ("white-listed") bytes. */
- if (s->dyn_ltree[9].Freq != 0 || s->dyn_ltree[10].Freq != 0
- || s->dyn_ltree[13].Freq != 0)
- return Z_TEXT;
- for (n = 32; n < LITERALS; n++)
- if (s->dyn_ltree[n].Freq != 0)
- return Z_TEXT;
-
- /* There are no "black-listed" or "white-listed" bytes:
- * this stream either is empty or has tolerated ("gray-listed") bytes only.
- */
- return Z_BINARY;
-}
-
-/* ===========================================================================
- * Reverse the first len bits of a code, using straightforward code (a faster
- * method would use a table)
- * IN assertion: 1 <= len <= 15
- */
-local unsigned bi_reverse(code, len)
- unsigned code; /* the value to invert */
- int len; /* its bit length */
-{
- register unsigned res = 0;
- do {
- res |= code & 1;
- code >>= 1, res <<= 1;
- } while (--len > 0);
- return res >> 1;
-}
-
-/* ===========================================================================
- * Flush the bit buffer, keeping at most 7 bits in it.
- */
-local void bi_flush(s)
- deflate_state *s;
-{
- if (s->bi_valid == 16) {
- put_short(s, s->bi_buf);
- s->bi_buf = 0;
- s->bi_valid = 0;
- } else if (s->bi_valid >= 8) {
- put_byte(s, (Byte)s->bi_buf);
- s->bi_buf >>= 8;
- s->bi_valid -= 8;
- }
-}
-
-/* ===========================================================================
- * Flush the bit buffer and align the output on a byte boundary
- */
-local void bi_windup(s)
- deflate_state *s;
-{
- if (s->bi_valid > 8) {
- put_short(s, s->bi_buf);
- } else if (s->bi_valid > 0) {
- put_byte(s, (Byte)s->bi_buf);
- }
- s->bi_buf = 0;
- s->bi_valid = 0;
-#ifdef DEBUG
- s->bits_sent = (s->bits_sent+7) & ~7;
-#endif
-}
-
-/* ===========================================================================
- * Copy a stored block, storing first the length and its
- * one's complement if requested.
- */
-local void copy_block(s, buf, len, header)
- deflate_state *s;
- charf *buf; /* the input data */
- unsigned len; /* its length */
- int header; /* true if block header must be written */
-{
- bi_windup(s); /* align on byte boundary */
- s->last_eob_len = 8; /* enough lookahead for inflate */
-
- if (header) {
- put_short(s, (ush)len);
- put_short(s, (ush)~len);
-#ifdef DEBUG
- s->bits_sent += 2*16;
-#endif
- }
-#ifdef DEBUG
- s->bits_sent += (ulg)len<<3;
-#endif
- while (len--) {
- put_byte(s, *buf++);
- }
-}
diff --git a/3rdparty/assimp/contrib/zlib/trees.h b/3rdparty/assimp/contrib/zlib/trees.h
deleted file mode 100644
index d35639d8..00000000
--- a/3rdparty/assimp/contrib/zlib/trees.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/* header created automatically with -DGEN_TREES_H */
-
-local const ct_data static_ltree[L_CODES+2] = {
-{{ 12},{ 8}}, {{140},{ 8}}, {{ 76},{ 8}}, {{204},{ 8}}, {{ 44},{ 8}},
-{{172},{ 8}}, {{108},{ 8}}, {{236},{ 8}}, {{ 28},{ 8}}, {{156},{ 8}},
-{{ 92},{ 8}}, {{220},{ 8}}, {{ 60},{ 8}}, {{188},{ 8}}, {{124},{ 8}},
-{{252},{ 8}}, {{ 2},{ 8}}, {{130},{ 8}}, {{ 66},{ 8}}, {{194},{ 8}},
-{{ 34},{ 8}}, {{162},{ 8}}, {{ 98},{ 8}}, {{226},{ 8}}, {{ 18},{ 8}},
-{{146},{ 8}}, {{ 82},{ 8}}, {{210},{ 8}}, {{ 50},{ 8}}, {{178},{ 8}},
-{{114},{ 8}}, {{242},{ 8}}, {{ 10},{ 8}}, {{138},{ 8}}, {{ 74},{ 8}},
-{{202},{ 8}}, {{ 42},{ 8}}, {{170},{ 8}}, {{106},{ 8}}, {{234},{ 8}},
-{{ 26},{ 8}}, {{154},{ 8}}, {{ 90},{ 8}}, {{218},{ 8}}, {{ 58},{ 8}},
-{{186},{ 8}}, {{122},{ 8}}, {{250},{ 8}}, {{ 6},{ 8}}, {{134},{ 8}},
-{{ 70},{ 8}}, {{198},{ 8}}, {{ 38},{ 8}}, {{166},{ 8}}, {{102},{ 8}},
-{{230},{ 8}}, {{ 22},{ 8}}, {{150},{ 8}}, {{ 86},{ 8}}, {{214},{ 8}},
-{{ 54},{ 8}}, {{182},{ 8}}, {{118},{ 8}}, {{246},{ 8}}, {{ 14},{ 8}},
-{{142},{ 8}}, {{ 78},{ 8}}, {{206},{ 8}}, {{ 46},{ 8}}, {{174},{ 8}},
-{{110},{ 8}}, {{238},{ 8}}, {{ 30},{ 8}}, {{158},{ 8}}, {{ 94},{ 8}},
-{{222},{ 8}}, {{ 62},{ 8}}, {{190},{ 8}}, {{126},{ 8}}, {{254},{ 8}},
-{{ 1},{ 8}}, {{129},{ 8}}, {{ 65},{ 8}}, {{193},{ 8}}, {{ 33},{ 8}},
-{{161},{ 8}}, {{ 97},{ 8}}, {{225},{ 8}}, {{ 17},{ 8}}, {{145},{ 8}},
-{{ 81},{ 8}}, {{209},{ 8}}, {{ 49},{ 8}}, {{177},{ 8}}, {{113},{ 8}},
-{{241},{ 8}}, {{ 9},{ 8}}, {{137},{ 8}}, {{ 73},{ 8}}, {{201},{ 8}},
-{{ 41},{ 8}}, {{169},{ 8}}, {{105},{ 8}}, {{233},{ 8}}, {{ 25},{ 8}},
-{{153},{ 8}}, {{ 89},{ 8}}, {{217},{ 8}}, {{ 57},{ 8}}, {{185},{ 8}},
-{{121},{ 8}}, {{249},{ 8}}, {{ 5},{ 8}}, {{133},{ 8}}, {{ 69},{ 8}},
-{{197},{ 8}}, {{ 37},{ 8}}, {{165},{ 8}}, {{101},{ 8}}, {{229},{ 8}},
-{{ 21},{ 8}}, {{149},{ 8}}, {{ 85},{ 8}}, {{213},{ 8}}, {{ 53},{ 8}},
-{{181},{ 8}}, {{117},{ 8}}, {{245},{ 8}}, {{ 13},{ 8}}, {{141},{ 8}},
-{{ 77},{ 8}}, {{205},{ 8}}, {{ 45},{ 8}}, {{173},{ 8}}, {{109},{ 8}},
-{{237},{ 8}}, {{ 29},{ 8}}, {{157},{ 8}}, {{ 93},{ 8}}, {{221},{ 8}},
-{{ 61},{ 8}}, {{189},{ 8}}, {{125},{ 8}}, {{253},{ 8}}, {{ 19},{ 9}},
-{{275},{ 9}}, {{147},{ 9}}, {{403},{ 9}}, {{ 83},{ 9}}, {{339},{ 9}},
-{{211},{ 9}}, {{467},{ 9}}, {{ 51},{ 9}}, {{307},{ 9}}, {{179},{ 9}},
-{{435},{ 9}}, {{115},{ 9}}, {{371},{ 9}}, {{243},{ 9}}, {{499},{ 9}},
-{{ 11},{ 9}}, {{267},{ 9}}, {{139},{ 9}}, {{395},{ 9}}, {{ 75},{ 9}},
-{{331},{ 9}}, {{203},{ 9}}, {{459},{ 9}}, {{ 43},{ 9}}, {{299},{ 9}},
-{{171},{ 9}}, {{427},{ 9}}, {{107},{ 9}}, {{363},{ 9}}, {{235},{ 9}},
-{{491},{ 9}}, {{ 27},{ 9}}, {{283},{ 9}}, {{155},{ 9}}, {{411},{ 9}},
-{{ 91},{ 9}}, {{347},{ 9}}, {{219},{ 9}}, {{475},{ 9}}, {{ 59},{ 9}},
-{{315},{ 9}}, {{187},{ 9}}, {{443},{ 9}}, {{123},{ 9}}, {{379},{ 9}},
-{{251},{ 9}}, {{507},{ 9}}, {{ 7},{ 9}}, {{263},{ 9}}, {{135},{ 9}},
-{{391},{ 9}}, {{ 71},{ 9}}, {{327},{ 9}}, {{199},{ 9}}, {{455},{ 9}},
-{{ 39},{ 9}}, {{295},{ 9}}, {{167},{ 9}}, {{423},{ 9}}, {{103},{ 9}},
-{{359},{ 9}}, {{231},{ 9}}, {{487},{ 9}}, {{ 23},{ 9}}, {{279},{ 9}},
-{{151},{ 9}}, {{407},{ 9}}, {{ 87},{ 9}}, {{343},{ 9}}, {{215},{ 9}},
-{{471},{ 9}}, {{ 55},{ 9}}, {{311},{ 9}}, {{183},{ 9}}, {{439},{ 9}},
-{{119},{ 9}}, {{375},{ 9}}, {{247},{ 9}}, {{503},{ 9}}, {{ 15},{ 9}},
-{{271},{ 9}}, {{143},{ 9}}, {{399},{ 9}}, {{ 79},{ 9}}, {{335},{ 9}},
-{{207},{ 9}}, {{463},{ 9}}, {{ 47},{ 9}}, {{303},{ 9}}, {{175},{ 9}},
-{{431},{ 9}}, {{111},{ 9}}, {{367},{ 9}}, {{239},{ 9}}, {{495},{ 9}},
-{{ 31},{ 9}}, {{287},{ 9}}, {{159},{ 9}}, {{415},{ 9}}, {{ 95},{ 9}},
-{{351},{ 9}}, {{223},{ 9}}, {{479},{ 9}}, {{ 63},{ 9}}, {{319},{ 9}},
-{{191},{ 9}}, {{447},{ 9}}, {{127},{ 9}}, {{383},{ 9}}, {{255},{ 9}},
-{{511},{ 9}}, {{ 0},{ 7}}, {{ 64},{ 7}}, {{ 32},{ 7}}, {{ 96},{ 7}},
-{{ 16},{ 7}}, {{ 80},{ 7}}, {{ 48},{ 7}}, {{112},{ 7}}, {{ 8},{ 7}},
-{{ 72},{ 7}}, {{ 40},{ 7}}, {{104},{ 7}}, {{ 24},{ 7}}, {{ 88},{ 7}},
-{{ 56},{ 7}}, {{120},{ 7}}, {{ 4},{ 7}}, {{ 68},{ 7}}, {{ 36},{ 7}},
-{{100},{ 7}}, {{ 20},{ 7}}, {{ 84},{ 7}}, {{ 52},{ 7}}, {{116},{ 7}},
-{{ 3},{ 8}}, {{131},{ 8}}, {{ 67},{ 8}}, {{195},{ 8}}, {{ 35},{ 8}},
-{{163},{ 8}}, {{ 99},{ 8}}, {{227},{ 8}}
-};
-
-local const ct_data static_dtree[D_CODES] = {
-{{ 0},{ 5}}, {{16},{ 5}}, {{ 8},{ 5}}, {{24},{ 5}}, {{ 4},{ 5}},
-{{20},{ 5}}, {{12},{ 5}}, {{28},{ 5}}, {{ 2},{ 5}}, {{18},{ 5}},
-{{10},{ 5}}, {{26},{ 5}}, {{ 6},{ 5}}, {{22},{ 5}}, {{14},{ 5}},
-{{30},{ 5}}, {{ 1},{ 5}}, {{17},{ 5}}, {{ 9},{ 5}}, {{25},{ 5}},
-{{ 5},{ 5}}, {{21},{ 5}}, {{13},{ 5}}, {{29},{ 5}}, {{ 3},{ 5}},
-{{19},{ 5}}, {{11},{ 5}}, {{27},{ 5}}, {{ 7},{ 5}}, {{23},{ 5}}
-};
-
-const uch ZLIB_INTERNAL _dist_code[DIST_CODE_LEN] = {
- 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8,
- 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10,
-10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
-11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
-12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13,
-13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
-13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
-14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
-14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
-14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15,
-15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
-15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 16, 17,
-18, 18, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22,
-23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
-24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
-26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
-26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27,
-27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
-27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
-28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
-29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
-29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
-29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29
-};
-
-const uch ZLIB_INTERNAL _length_code[MAX_MATCH-MIN_MATCH+1]= {
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12,
-13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16,
-17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19,
-19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
-21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22,
-22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23,
-23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
-24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
-25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
-25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26,
-26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
-26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
-27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28
-};
-
-local const int base_length[LENGTH_CODES] = {
-0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56,
-64, 80, 96, 112, 128, 160, 192, 224, 0
-};
-
-local const int base_dist[D_CODES] = {
- 0, 1, 2, 3, 4, 6, 8, 12, 16, 24,
- 32, 48, 64, 96, 128, 192, 256, 384, 512, 768,
- 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576
-};
-
diff --git a/3rdparty/assimp/contrib/zlib/zconf.h b/3rdparty/assimp/contrib/zlib/zconf.h
deleted file mode 100644
index 02ce56c4..00000000
--- a/3rdparty/assimp/contrib/zlib/zconf.h
+++ /dev/null
@@ -1,428 +0,0 @@
-/* zconf.h -- configuration of the zlib compression library
- * Copyright (C) 1995-2010 Jean-loup Gailly.
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* @(#) $Id$ */
-
-#ifndef ZCONF_H
-#define ZCONF_H
-
-/*
- * If you *really* need a unique prefix for all types and library functions,
- * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
- * Even better than compiling with -DZ_PREFIX would be to use configure to set
- * this permanently in zconf.h using "./configure --zprefix".
- */
-#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */
-
-/* all linked symbols */
-# define _dist_code z__dist_code
-# define _length_code z__length_code
-# define _tr_align z__tr_align
-# define _tr_flush_block z__tr_flush_block
-# define _tr_init z__tr_init
-# define _tr_stored_block z__tr_stored_block
-# define _tr_tally z__tr_tally
-# define adler32 z_adler32
-# define adler32_combine z_adler32_combine
-# define adler32_combine64 z_adler32_combine64
-# define compress z_compress
-# define compress2 z_compress2
-# define compressBound z_compressBound
-# define crc32 z_crc32
-# define crc32_combine z_crc32_combine
-# define crc32_combine64 z_crc32_combine64
-# define deflate z_deflate
-# define deflateBound z_deflateBound
-# define deflateCopy z_deflateCopy
-# define deflateEnd z_deflateEnd
-# define deflateInit2_ z_deflateInit2_
-# define deflateInit_ z_deflateInit_
-# define deflateParams z_deflateParams
-# define deflatePrime z_deflatePrime
-# define deflateReset z_deflateReset
-# define deflateSetDictionary z_deflateSetDictionary
-# define deflateSetHeader z_deflateSetHeader
-# define deflateTune z_deflateTune
-# define deflate_copyright z_deflate_copyright
-# define get_crc_table z_get_crc_table
-# define gz_error z_gz_error
-# define gz_intmax z_gz_intmax
-# define gz_strwinerror z_gz_strwinerror
-# define gzbuffer z_gzbuffer
-# define gzclearerr z_gzclearerr
-# define gzclose z_gzclose
-# define gzclose_r z_gzclose_r
-# define gzclose_w z_gzclose_w
-# define gzdirect z_gzdirect
-# define gzdopen z_gzdopen
-# define gzeof z_gzeof
-# define gzerror z_gzerror
-# define gzflush z_gzflush
-# define gzgetc z_gzgetc
-# define gzgets z_gzgets
-# define gzoffset z_gzoffset
-# define gzoffset64 z_gzoffset64
-# define gzopen z_gzopen
-# define gzopen64 z_gzopen64
-# define gzprintf z_gzprintf
-# define gzputc z_gzputc
-# define gzputs z_gzputs
-# define gzread z_gzread
-# define gzrewind z_gzrewind
-# define gzseek z_gzseek
-# define gzseek64 z_gzseek64
-# define gzsetparams z_gzsetparams
-# define gztell z_gztell
-# define gztell64 z_gztell64
-# define gzungetc z_gzungetc
-# define gzwrite z_gzwrite
-# define inflate z_inflate
-# define inflateBack z_inflateBack
-# define inflateBackEnd z_inflateBackEnd
-# define inflateBackInit_ z_inflateBackInit_
-# define inflateCopy z_inflateCopy
-# define inflateEnd z_inflateEnd
-# define inflateGetHeader z_inflateGetHeader
-# define inflateInit2_ z_inflateInit2_
-# define inflateInit_ z_inflateInit_
-# define inflateMark z_inflateMark
-# define inflatePrime z_inflatePrime
-# define inflateReset z_inflateReset
-# define inflateReset2 z_inflateReset2
-# define inflateSetDictionary z_inflateSetDictionary
-# define inflateSync z_inflateSync
-# define inflateSyncPoint z_inflateSyncPoint
-# define inflateUndermine z_inflateUndermine
-# define inflate_copyright z_inflate_copyright
-# define inflate_fast z_inflate_fast
-# define inflate_table z_inflate_table
-# define uncompress z_uncompress
-# define zError z_zError
-# define zcalloc z_zcalloc
-# define zcfree z_zcfree
-# define zlibCompileFlags z_zlibCompileFlags
-# define zlibVersion z_zlibVersion
-
-/* all zlib typedefs in zlib.h and zconf.h */
-# define Byte z_Byte
-# define Bytef z_Bytef
-# define alloc_func z_alloc_func
-# define charf z_charf
-# define free_func z_free_func
-# define gzFile z_gzFile
-# define gz_header z_gz_header
-# define gz_headerp z_gz_headerp
-# define in_func z_in_func
-# define intf z_intf
-# define out_func z_out_func
-# define uInt z_uInt
-# define uIntf z_uIntf
-# define uLong z_uLong
-# define uLongf z_uLongf
-# define voidp z_voidp
-# define voidpc z_voidpc
-# define voidpf z_voidpf
-
-/* all zlib structs in zlib.h and zconf.h */
-# define gz_header_s z_gz_header_s
-# define internal_state z_internal_state
-
-#endif
-
-#if defined(__MSDOS__) && !defined(MSDOS)
-# define MSDOS
-#endif
-#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
-# define OS2
-#endif
-#if defined(_WINDOWS) && !defined(WINDOWS)
-# define WINDOWS
-#endif
-#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
-# ifndef WIN32
-# define WIN32
-# endif
-#endif
-#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
-# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
-# ifndef SYS16BIT
-# define SYS16BIT
-# endif
-# endif
-#endif
-
-/*
- * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
- * than 64k bytes at a time (needed on systems with 16-bit int).
- */
-#ifdef SYS16BIT
-# define MAXSEG_64K
-#endif
-#ifdef MSDOS
-# define UNALIGNED_OK
-#endif
-
-#ifdef __STDC_VERSION__
-# ifndef STDC
-# define STDC
-# endif
-# if __STDC_VERSION__ >= 199901L
-# ifndef STDC99
-# define STDC99
-# endif
-# endif
-#endif
-#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
-# define STDC
-#endif
-#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
-# define STDC
-#endif
-#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
-# define STDC
-#endif
-#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
-# define STDC
-#endif
-
-#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
-# define STDC
-#endif
-
-#ifndef STDC
-# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
-# define const /* note: need a more gentle solution here */
-# endif
-#endif
-
-/* Some Mac compilers merge all .h files incorrectly: */
-#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
-# define NO_DUMMY_DECL
-#endif
-
-/* Maximum value for memLevel in deflateInit2 */
-#ifndef MAX_MEM_LEVEL
-# ifdef MAXSEG_64K
-# define MAX_MEM_LEVEL 8
-# else
-# define MAX_MEM_LEVEL 9
-# endif
-#endif
-
-/* Maximum value for windowBits in deflateInit2 and inflateInit2.
- * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
- * created by gzip. (Files created by minigzip can still be extracted by
- * gzip.)
- */
-#ifndef MAX_WBITS
-# define MAX_WBITS 15 /* 32K LZ77 window */
-#endif
-
-/* The memory requirements for deflate are (in bytes):
- (1 << (windowBits+2)) + (1 << (memLevel+9))
- that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
- plus a few kilobytes for small objects. For example, if you want to reduce
- the default memory requirements from 256K to 128K, compile with
- make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
- Of course this will generally degrade compression (there's no free lunch).
-
- The memory requirements for inflate are (in bytes) 1 << windowBits
- that is, 32K for windowBits=15 (default value) plus a few kilobytes
- for small objects.
-*/
-
- /* Type declarations */
-
-#ifndef OF /* function prototypes */
-# ifdef STDC
-# define OF(args) args
-# else
-# define OF(args) ()
-# endif
-#endif
-
-/* The following definitions for FAR are needed only for MSDOS mixed
- * model programming (small or medium model with some far allocations).
- * This was tested only with MSC; for other MSDOS compilers you may have
- * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
- * just define FAR to be empty.
- */
-#ifdef SYS16BIT
-# if defined(M_I86SM) || defined(M_I86MM)
- /* MSC small or medium model */
-# define SMALL_MEDIUM
-# ifdef _MSC_VER
-# define FAR _far
-# else
-# define FAR far
-# endif
-# endif
-# if (defined(__SMALL__) || defined(__MEDIUM__))
- /* Turbo C small or medium model */
-# define SMALL_MEDIUM
-# ifdef __BORLANDC__
-# define FAR _far
-# else
-# define FAR far
-# endif
-# endif
-#endif
-
-#if defined(WINDOWS) || defined(WIN32)
- /* If building or using zlib as a DLL, define ZLIB_DLL.
- * This is not mandatory, but it offers a little performance increase.
- */
-# ifdef ZLIB_DLL
-# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
-# ifdef ZLIB_INTERNAL
-# define ZEXTERN extern __declspec(dllexport)
-# else
-# define ZEXTERN extern __declspec(dllimport)
-# endif
-# endif
-# endif /* ZLIB_DLL */
- /* If building or using zlib with the WINAPI/WINAPIV calling convention,
- * define ZLIB_WINAPI.
- * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
- */
-# ifdef ZLIB_WINAPI
-# ifdef FAR
-# undef FAR
-# endif
-# include <windows.h>
- /* No need for _export, use ZLIB.DEF instead. */
- /* For complete Windows compatibility, use WINAPI, not __stdcall. */
-# define ZEXPORT WINAPI
-# ifdef WIN32
-# define ZEXPORTVA WINAPIV
-# else
-# define ZEXPORTVA FAR CDECL
-# endif
-# endif
-#endif
-
-#if defined (__BEOS__)
-# ifdef ZLIB_DLL
-# ifdef ZLIB_INTERNAL
-# define ZEXPORT __declspec(dllexport)
-# define ZEXPORTVA __declspec(dllexport)
-# else
-# define ZEXPORT __declspec(dllimport)
-# define ZEXPORTVA __declspec(dllimport)
-# endif
-# endif
-#endif
-
-#ifndef ZEXTERN
-# define ZEXTERN extern
-#endif
-#ifndef ZEXPORT
-# define ZEXPORT
-#endif
-#ifndef ZEXPORTVA
-# define ZEXPORTVA
-#endif
-
-#ifndef FAR
-# define FAR
-#endif
-
-#if !defined(__MACTYPES__)
-typedef unsigned char Byte; /* 8 bits */
-#endif
-typedef unsigned int uInt; /* 16 bits or more */
-typedef unsigned long uLong; /* 32 bits or more */
-
-#ifdef SMALL_MEDIUM
- /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
-# define Bytef Byte FAR
-#else
- typedef Byte FAR Bytef;
-#endif
-typedef char FAR charf;
-typedef int FAR intf;
-typedef uInt FAR uIntf;
-typedef uLong FAR uLongf;
-
-#ifdef STDC
- typedef void const *voidpc;
- typedef void FAR *voidpf;
- typedef void *voidp;
-#else
- typedef Byte const *voidpc;
- typedef Byte FAR *voidpf;
- typedef Byte *voidp;
-#endif
-
-#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
-# define Z_HAVE_UNISTD_H
-#endif
-
-#ifdef STDC
-# include <sys/types.h> /* for off_t */
-#endif
-
-/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
- * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
- * though the former does not conform to the LFS document), but considering
- * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
- * equivalently requesting no 64-bit operations
- */
-#if -_LARGEFILE64_SOURCE - -1 == 1
-# undef _LARGEFILE64_SOURCE
-#endif
-
-#if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
-# include <unistd.h> /* for SEEK_* and off_t */
-# ifdef VMS
-# include <unixio.h> /* for off_t */
-# endif
-# ifndef z_off_t
-# define z_off_t off_t
-# endif
-#endif
-
-#ifndef SEEK_SET
-# define SEEK_SET 0 /* Seek from beginning of file. */
-# define SEEK_CUR 1 /* Seek from current position. */
-# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
-#endif
-
-#ifndef z_off_t
-# define z_off_t long
-#endif
-
-#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
-# define z_off64_t off64_t
-#else
-# define z_off64_t z_off_t
-#endif
-
-#if defined(__OS400__)
-# define NO_vsnprintf
-#endif
-
-#if defined(__MVS__)
-# define NO_vsnprintf
-#endif
-
-/* MVS linker does not support external names larger than 8 bytes */
-#if defined(__MVS__)
- #pragma map(deflateInit_,"DEIN")
- #pragma map(deflateInit2_,"DEIN2")
- #pragma map(deflateEnd,"DEEND")
- #pragma map(deflateBound,"DEBND")
- #pragma map(inflateInit_,"ININ")
- #pragma map(inflateInit2_,"ININ2")
- #pragma map(inflateEnd,"INEND")
- #pragma map(inflateSync,"INSY")
- #pragma map(inflateSetDictionary,"INSEDI")
- #pragma map(compressBound,"CMBND")
- #pragma map(inflate_table,"INTABL")
- #pragma map(inflate_fast,"INFA")
- #pragma map(inflate_copyright,"INCOPY")
-#endif
-
-#endif /* ZCONF_H */
diff --git a/3rdparty/assimp/contrib/zlib/zconf.in.h b/3rdparty/assimp/contrib/zlib/zconf.in.h
deleted file mode 100644
index 03a9431c..00000000
--- a/3rdparty/assimp/contrib/zlib/zconf.in.h
+++ /dev/null
@@ -1,332 +0,0 @@
-/* zconf.h -- configuration of the zlib compression library
- * Copyright (C) 1995-2005 Jean-loup Gailly.
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* @(#) $Id$ */
-
-#ifndef ZCONF_H
-#define ZCONF_H
-
-/*
- * If you *really* need a unique prefix for all types and library functions,
- * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
- */
-#ifdef Z_PREFIX
-# define deflateInit_ z_deflateInit_
-# define deflate z_deflate
-# define deflateEnd z_deflateEnd
-# define inflateInit_ z_inflateInit_
-# define inflate z_inflate
-# define inflateEnd z_inflateEnd
-# define deflateInit2_ z_deflateInit2_
-# define deflateSetDictionary z_deflateSetDictionary
-# define deflateCopy z_deflateCopy
-# define deflateReset z_deflateReset
-# define deflateParams z_deflateParams
-# define deflateBound z_deflateBound
-# define deflatePrime z_deflatePrime
-# define inflateInit2_ z_inflateInit2_
-# define inflateSetDictionary z_inflateSetDictionary
-# define inflateSync z_inflateSync
-# define inflateSyncPoint z_inflateSyncPoint
-# define inflateCopy z_inflateCopy
-# define inflateReset z_inflateReset
-# define inflateBack z_inflateBack
-# define inflateBackEnd z_inflateBackEnd
-# define compress z_compress
-# define compress2 z_compress2
-# define compressBound z_compressBound
-# define uncompress z_uncompress
-# define adler32 z_adler32
-# define crc32 z_crc32
-# define get_crc_table z_get_crc_table
-# define zError z_zError
-
-# define alloc_func z_alloc_func
-# define free_func z_free_func
-# define in_func z_in_func
-# define out_func z_out_func
-# define Byte z_Byte
-# define uInt z_uInt
-# define uLong z_uLong
-# define Bytef z_Bytef
-# define charf z_charf
-# define intf z_intf
-# define uIntf z_uIntf
-# define uLongf z_uLongf
-# define voidpf z_voidpf
-# define voidp z_voidp
-#endif
-
-#if defined(__MSDOS__) && !defined(MSDOS)
-# define MSDOS
-#endif
-#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
-# define OS2
-#endif
-#if defined(_WINDOWS) && !defined(WINDOWS)
-# define WINDOWS
-#endif
-#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
-# ifndef WIN32
-# define WIN32
-# endif
-#endif
-#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
-# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
-# ifndef SYS16BIT
-# define SYS16BIT
-# endif
-# endif
-#endif
-
-/*
- * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
- * than 64k bytes at a time (needed on systems with 16-bit int).
- */
-#ifdef SYS16BIT
-# define MAXSEG_64K
-#endif
-#ifdef MSDOS
-# define UNALIGNED_OK
-#endif
-
-#ifdef __STDC_VERSION__
-# ifndef STDC
-# define STDC
-# endif
-# if __STDC_VERSION__ >= 199901L
-# ifndef STDC99
-# define STDC99
-# endif
-# endif
-#endif
-#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
-# define STDC
-#endif
-#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
-# define STDC
-#endif
-#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
-# define STDC
-#endif
-#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
-# define STDC
-#endif
-
-#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
-# define STDC
-#endif
-
-#ifndef STDC
-# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
-# define const /* note: need a more gentle solution here */
-# endif
-#endif
-
-/* Some Mac compilers merge all .h files incorrectly: */
-#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
-# define NO_DUMMY_DECL
-#endif
-
-/* Maximum value for memLevel in deflateInit2 */
-#ifndef MAX_MEM_LEVEL
-# ifdef MAXSEG_64K
-# define MAX_MEM_LEVEL 8
-# else
-# define MAX_MEM_LEVEL 9
-# endif
-#endif
-
-/* Maximum value for windowBits in deflateInit2 and inflateInit2.
- * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
- * created by gzip. (Files created by minigzip can still be extracted by
- * gzip.)
- */
-#ifndef MAX_WBITS
-# define MAX_WBITS 15 /* 32K LZ77 window */
-#endif
-
-/* The memory requirements for deflate are (in bytes):
- (1 << (windowBits+2)) + (1 << (memLevel+9))
- that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
- plus a few kilobytes for small objects. For example, if you want to reduce
- the default memory requirements from 256K to 128K, compile with
- make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
- Of course this will generally degrade compression (there's no free lunch).
-
- The memory requirements for inflate are (in bytes) 1 << windowBits
- that is, 32K for windowBits=15 (default value) plus a few kilobytes
- for small objects.
-*/
-
- /* Type declarations */
-
-#ifndef OF /* function prototypes */
-# ifdef STDC
-# define OF(args) args
-# else
-# define OF(args) ()
-# endif
-#endif
-
-/* The following definitions for FAR are needed only for MSDOS mixed
- * model programming (small or medium model with some far allocations).
- * This was tested only with MSC; for other MSDOS compilers you may have
- * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
- * just define FAR to be empty.
- */
-#ifdef SYS16BIT
-# if defined(M_I86SM) || defined(M_I86MM)
- /* MSC small or medium model */
-# define SMALL_MEDIUM
-# ifdef _MSC_VER
-# define FAR _far
-# else
-# define FAR far
-# endif
-# endif
-# if (defined(__SMALL__) || defined(__MEDIUM__))
- /* Turbo C small or medium model */
-# define SMALL_MEDIUM
-# ifdef __BORLANDC__
-# define FAR _far
-# else
-# define FAR far
-# endif
-# endif
-#endif
-
-#if defined(WINDOWS) || defined(WIN32)
- /* If building or using zlib as a DLL, define ZLIB_DLL.
- * This is not mandatory, but it offers a little performance increase.
- */
-# ifdef ZLIB_DLL
-# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
-# ifdef ZLIB_INTERNAL
-# define ZEXTERN extern __declspec(dllexport)
-# else
-# define ZEXTERN extern __declspec(dllimport)
-# endif
-# endif
-# endif /* ZLIB_DLL */
- /* If building or using zlib with the WINAPI/WINAPIV calling convention,
- * define ZLIB_WINAPI.
- * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
- */
-# ifdef ZLIB_WINAPI
-# ifdef FAR
-# undef FAR
-# endif
-# include <windows.h>
- /* No need for _export, use ZLIB.DEF instead. */
- /* For complete Windows compatibility, use WINAPI, not __stdcall. */
-# define ZEXPORT WINAPI
-# ifdef WIN32
-# define ZEXPORTVA WINAPIV
-# else
-# define ZEXPORTVA FAR CDECL
-# endif
-# endif
-#endif
-
-#if defined (__BEOS__)
-# ifdef ZLIB_DLL
-# ifdef ZLIB_INTERNAL
-# define ZEXPORT __declspec(dllexport)
-# define ZEXPORTVA __declspec(dllexport)
-# else
-# define ZEXPORT __declspec(dllimport)
-# define ZEXPORTVA __declspec(dllimport)
-# endif
-# endif
-#endif
-
-#ifndef ZEXTERN
-# define ZEXTERN extern
-#endif
-#ifndef ZEXPORT
-# define ZEXPORT
-#endif
-#ifndef ZEXPORTVA
-# define ZEXPORTVA
-#endif
-
-#ifndef FAR
-# define FAR
-#endif
-
-#if !defined(__MACTYPES__)
-typedef unsigned char Byte; /* 8 bits */
-#endif
-typedef unsigned int uInt; /* 16 bits or more */
-typedef unsigned long uLong; /* 32 bits or more */
-
-#ifdef SMALL_MEDIUM
- /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
-# define Bytef Byte FAR
-#else
- typedef Byte FAR Bytef;
-#endif
-typedef char FAR charf;
-typedef int FAR intf;
-typedef uInt FAR uIntf;
-typedef uLong FAR uLongf;
-
-#ifdef STDC
- typedef void const *voidpc;
- typedef void FAR *voidpf;
- typedef void *voidp;
-#else
- typedef Byte const *voidpc;
- typedef Byte FAR *voidpf;
- typedef Byte *voidp;
-#endif
-
-#if 0 /* HAVE_UNISTD_H -- this line is updated by ./configure */
-# include <sys/types.h> /* for off_t */
-# include <unistd.h> /* for SEEK_* and off_t */
-# ifdef VMS
-# include <unixio.h> /* for off_t */
-# endif
-# define z_off_t off_t
-#endif
-#ifndef SEEK_SET
-# define SEEK_SET 0 /* Seek from beginning of file. */
-# define SEEK_CUR 1 /* Seek from current position. */
-# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
-#endif
-#ifndef z_off_t
-# define z_off_t long
-#endif
-
-#if defined(__OS400__)
-# define NO_vsnprintf
-#endif
-
-#if defined(__MVS__)
-# define NO_vsnprintf
-# ifdef FAR
-# undef FAR
-# endif
-#endif
-
-/* MVS linker does not support external names larger than 8 bytes */
-#if defined(__MVS__)
-# pragma map(deflateInit_,"DEIN")
-# pragma map(deflateInit2_,"DEIN2")
-# pragma map(deflateEnd,"DEEND")
-# pragma map(deflateBound,"DEBND")
-# pragma map(inflateInit_,"ININ")
-# pragma map(inflateInit2_,"ININ2")
-# pragma map(inflateEnd,"INEND")
-# pragma map(inflateSync,"INSY")
-# pragma map(inflateSetDictionary,"INSEDI")
-# pragma map(compressBound,"CMBND")
-# pragma map(inflate_table,"INTABL")
-# pragma map(inflate_fast,"INFA")
-# pragma map(inflate_copyright,"INCOPY")
-#endif
-
-#endif /* ZCONF_H */
diff --git a/3rdparty/assimp/contrib/zlib/zlib.h b/3rdparty/assimp/contrib/zlib/zlib.h
deleted file mode 100644
index bfbba83e..00000000
--- a/3rdparty/assimp/contrib/zlib/zlib.h
+++ /dev/null
@@ -1,1613 +0,0 @@
-/* zlib.h -- interface of the 'zlib' general purpose compression library
- version 1.2.5, April 19th, 2010
-
- Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-
- Jean-loup Gailly Mark Adler
- jloup@gzip.org madler@alumni.caltech.edu
-
-
- The data format used by the zlib library is described by RFCs (Request for
- Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt
- (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
-*/
-
-#ifndef ZLIB_H
-#define ZLIB_H
-
-#include "zconf.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define ZLIB_VERSION "1.2.5"
-#define ZLIB_VERNUM 0x1250
-#define ZLIB_VER_MAJOR 1
-#define ZLIB_VER_MINOR 2
-#define ZLIB_VER_REVISION 5
-#define ZLIB_VER_SUBREVISION 0
-
-/*
- The 'zlib' compression library provides in-memory compression and
- decompression functions, including integrity checks of the uncompressed data.
- This version of the library supports only one compression method (deflation)
- but other algorithms will be added later and will have the same stream
- interface.
-
- Compression can be done in a single step if the buffers are large enough,
- or can be done by repeated calls of the compression function. In the latter
- case, the application must provide more input and/or consume the output
- (providing more output space) before each call.
-
- The compressed data format used by default by the in-memory functions is
- the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped
- around a deflate stream, which is itself documented in RFC 1951.
-
- The library also supports reading and writing files in gzip (.gz) format
- with an interface similar to that of stdio using the functions that start
- with "gz". The gzip format is different from the zlib format. gzip is a
- gzip wrapper, documented in RFC 1952, wrapped around a deflate stream.
-
- This library can optionally read and write gzip streams in memory as well.
-
- The zlib format was designed to be compact and fast for use in memory
- and on communications channels. The gzip format was designed for single-
- file compression on file systems, has a larger header than zlib to maintain
- directory information, and uses a different, slower check method than zlib.
-
- The library does not install any signal handler. The decoder checks
- the consistency of the compressed data, so the library should never crash
- even in case of corrupted input.
-*/
-
-typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
-typedef void (*free_func) OF((voidpf opaque, voidpf address));
-
-struct internal_state;
-
-typedef struct z_stream_s {
- Bytef *next_in; /* next input byte */
- uInt avail_in; /* number of bytes available at next_in */
- uLong total_in; /* total nb of input bytes read so far */
-
- Bytef *next_out; /* next output byte should be put there */
- uInt avail_out; /* remaining free space at next_out */
- uLong total_out; /* total nb of bytes output so far */
-
- char *msg; /* last error message, NULL if no error */
- struct internal_state FAR *state; /* not visible by applications */
-
- alloc_func zalloc; /* used to allocate the internal state */
- free_func zfree; /* used to free the internal state */
- voidpf opaque; /* private data object passed to zalloc and zfree */
-
- int data_type; /* best guess about the data type: binary or text */
- uLong adler; /* adler32 value of the uncompressed data */
- uLong reserved; /* reserved for future use */
-} z_stream;
-
-typedef z_stream FAR *z_streamp;
-
-/*
- gzip header information passed to and from zlib routines. See RFC 1952
- for more details on the meanings of these fields.
-*/
-typedef struct gz_header_s {
- int text; /* true if compressed data believed to be text */
- uLong time; /* modification time */
- int xflags; /* extra flags (not used when writing a gzip file) */
- int os; /* operating system */
- Bytef *extra; /* pointer to extra field or Z_NULL if none */
- uInt extra_len; /* extra field length (valid if extra != Z_NULL) */
- uInt extra_max; /* space at extra (only when reading header) */
- Bytef *name; /* pointer to zero-terminated file name or Z_NULL */
- uInt name_max; /* space at name (only when reading header) */
- Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */
- uInt comm_max; /* space at comment (only when reading header) */
- int hcrc; /* true if there was or will be a header crc */
- int done; /* true when done reading gzip header (not used
- when writing a gzip file) */
-} gz_header;
-
-typedef gz_header FAR *gz_headerp;
-
-/*
- The application must update next_in and avail_in when avail_in has dropped
- to zero. It must update next_out and avail_out when avail_out has dropped
- to zero. The application must initialize zalloc, zfree and opaque before
- calling the init function. All other fields are set by the compression
- library and must not be updated by the application.
-
- The opaque value provided by the application will be passed as the first
- parameter for calls of zalloc and zfree. This can be useful for custom
- memory management. The compression library attaches no meaning to the
- opaque value.
-
- zalloc must return Z_NULL if there is not enough memory for the object.
- If zlib is used in a multi-threaded application, zalloc and zfree must be
- thread safe.
-
- On 16-bit systems, the functions zalloc and zfree must be able to allocate
- exactly 65536 bytes, but will not be required to allocate more than this if
- the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, pointers
- returned by zalloc for objects of exactly 65536 bytes *must* have their
- offset normalized to zero. The default allocation function provided by this
- library ensures this (see zutil.c). To reduce memory requirements and avoid
- any allocation of 64K objects, at the expense of compression ratio, compile
- the library with -DMAX_WBITS=14 (see zconf.h).
-
- The fields total_in and total_out can be used for statistics or progress
- reports. After compression, total_in holds the total size of the
- uncompressed data and may be saved for use in the decompressor (particularly
- if the decompressor wants to decompress everything in a single step).
-*/
-
- /* constants */
-
-#define Z_NO_FLUSH 0
-#define Z_PARTIAL_FLUSH 1
-#define Z_SYNC_FLUSH 2
-#define Z_FULL_FLUSH 3
-#define Z_FINISH 4
-#define Z_BLOCK 5
-#define Z_TREES 6
-/* Allowed flush values; see deflate() and inflate() below for details */
-
-#define Z_OK 0
-#define Z_STREAM_END 1
-#define Z_NEED_DICT 2
-#define Z_ERRNO (-1)
-#define Z_STREAM_ERROR (-2)
-#define Z_DATA_ERROR (-3)
-#define Z_MEM_ERROR (-4)
-#define Z_BUF_ERROR (-5)
-#define Z_VERSION_ERROR (-6)
-/* Return codes for the compression/decompression functions. Negative values
- * are errors, positive values are used for special but normal events.
- */
-
-#define Z_NO_COMPRESSION 0
-#define Z_BEST_SPEED 1
-#define Z_BEST_COMPRESSION 9
-#define Z_DEFAULT_COMPRESSION (-1)
-/* compression levels */
-
-#define Z_FILTERED 1
-#define Z_HUFFMAN_ONLY 2
-#define Z_RLE 3
-#define Z_FIXED 4
-#define Z_DEFAULT_STRATEGY 0
-/* compression strategy; see deflateInit2() below for details */
-
-#define Z_BINARY 0
-#define Z_TEXT 1
-#define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */
-#define Z_UNKNOWN 2
-/* Possible values of the data_type field (though see inflate()) */
-
-#define Z_DEFLATED 8
-/* The deflate compression method (the only one supported in this version) */
-
-#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */
-
-#define zlib_version zlibVersion()
-/* for compatibility with versions < 1.0.2 */
-
-
- /* basic functions */
-
-ZEXTERN const char * ZEXPORT zlibVersion OF((void));
-/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
- If the first character differs, the library code actually used is not
- compatible with the zlib.h header file used by the application. This check
- is automatically made by deflateInit and inflateInit.
- */
-
-/*
-ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
-
- Initializes the internal stream state for compression. The fields
- zalloc, zfree and opaque must be initialized before by the caller. If
- zalloc and zfree are set to Z_NULL, deflateInit updates them to use default
- allocation functions.
-
- The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:
- 1 gives best speed, 9 gives best compression, 0 gives no compression at all
- (the input data is simply copied a block at a time). Z_DEFAULT_COMPRESSION
- requests a default compromise between speed and compression (currently
- equivalent to level 6).
-
- deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
- memory, Z_STREAM_ERROR if level is not a valid compression level, or
- Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible
- with the version assumed by the caller (ZLIB_VERSION). msg is set to null
- if there is no error message. deflateInit does not perform any compression:
- this will be done by deflate().
-*/
-
-
-ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
-/*
- deflate compresses as much data as possible, and stops when the input
- buffer becomes empty or the output buffer becomes full. It may introduce
- some output latency (reading input without producing any output) except when
- forced to flush.
-
- The detailed semantics are as follows. deflate performs one or both of the
- following actions:
-
- - Compress more input starting at next_in and update next_in and avail_in
- accordingly. If not all input can be processed (because there is not
- enough room in the output buffer), next_in and avail_in are updated and
- processing will resume at this point for the next call of deflate().
-
- - Provide more output starting at next_out and update next_out and avail_out
- accordingly. This action is forced if the parameter flush is non zero.
- Forcing flush frequently degrades the compression ratio, so this parameter
- should be set only when necessary (in interactive applications). Some
- output may be provided even if flush is not set.
-
- Before the call of deflate(), the application should ensure that at least
- one of the actions is possible, by providing more input and/or consuming more
- output, and updating avail_in or avail_out accordingly; avail_out should
- never be zero before the call. The application can consume the compressed
- output when it wants, for example when the output buffer is full (avail_out
- == 0), or after each call of deflate(). If deflate returns Z_OK and with
- zero avail_out, it must be called again after making room in the output
- buffer because there might be more output pending.
-
- Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to
- decide how much data to accumulate before producing output, in order to
- maximize compression.
-
- If the parameter flush is set to Z_SYNC_FLUSH, all pending output is
- flushed to the output buffer and the output is aligned on a byte boundary, so
- that the decompressor can get all input data available so far. (In
- particular avail_in is zero after the call if enough output space has been
- provided before the call.) Flushing may degrade compression for some
- compression algorithms and so it should be used only when necessary. This
- completes the current deflate block and follows it with an empty stored block
- that is three bits plus filler bits to the next byte, followed by four bytes
- (00 00 ff ff).
-
- If flush is set to Z_PARTIAL_FLUSH, all pending output is flushed to the
- output buffer, but the output is not aligned to a byte boundary. All of the
- input data so far will be available to the decompressor, as for Z_SYNC_FLUSH.
- This completes the current deflate block and follows it with an empty fixed
- codes block that is 10 bits long. This assures that enough bytes are output
- in order for the decompressor to finish the block before the empty fixed code
- block.
-
- If flush is set to Z_BLOCK, a deflate block is completed and emitted, as
- for Z_SYNC_FLUSH, but the output is not aligned on a byte boundary, and up to
- seven bits of the current block are held to be written as the next byte after
- the next deflate block is completed. In this case, the decompressor may not
- be provided enough bits at this point in order to complete decompression of
- the data provided so far to the compressor. It may need to wait for the next
- block to be emitted. This is for advanced applications that need to control
- the emission of deflate blocks.
-
- If flush is set to Z_FULL_FLUSH, all output is flushed as with
- Z_SYNC_FLUSH, and the compression state is reset so that decompression can
- restart from this point if previous compressed data has been damaged or if
- random access is desired. Using Z_FULL_FLUSH too often can seriously degrade
- compression.
-
- If deflate returns with avail_out == 0, this function must be called again
- with the same value of the flush parameter and more output space (updated
- avail_out), until the flush is complete (deflate returns with non-zero
- avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that
- avail_out is greater than six to avoid repeated flush markers due to
- avail_out == 0 on return.
-
- If the parameter flush is set to Z_FINISH, pending input is processed,
- pending output is flushed and deflate returns with Z_STREAM_END if there was
- enough output space; if deflate returns with Z_OK, this function must be
- called again with Z_FINISH and more output space (updated avail_out) but no
- more input data, until it returns with Z_STREAM_END or an error. After
- deflate has returned Z_STREAM_END, the only possible operations on the stream
- are deflateReset or deflateEnd.
-
- Z_FINISH can be used immediately after deflateInit if all the compression
- is to be done in a single step. In this case, avail_out must be at least the
- value returned by deflateBound (see below). If deflate does not return
- Z_STREAM_END, then it must be called again as described above.
-
- deflate() sets strm->adler to the adler32 checksum of all input read
- so far (that is, total_in bytes).
-
- deflate() may update strm->data_type if it can make a good guess about
- the input data type (Z_BINARY or Z_TEXT). In doubt, the data is considered
- binary. This field is only for information purposes and does not affect the
- compression algorithm in any manner.
-
- deflate() returns Z_OK if some progress has been made (more input
- processed or more output produced), Z_STREAM_END if all input has been
- consumed and all output has been produced (only when flush is set to
- Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example
- if next_in or next_out was Z_NULL), Z_BUF_ERROR if no progress is possible
- (for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is not
- fatal, and deflate() can be called again with more input and more output
- space to continue compressing.
-*/
-
-
-ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
-/*
- All dynamically allocated data structures for this stream are freed.
- This function discards any unprocessed input and does not flush any pending
- output.
-
- deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the
- stream state was inconsistent, Z_DATA_ERROR if the stream was freed
- prematurely (some input or output was discarded). In the error case, msg
- may be set but then points to a static string (which must not be
- deallocated).
-*/
-
-
-/*
-ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
-
- Initializes the internal stream state for decompression. The fields
- next_in, avail_in, zalloc, zfree and opaque must be initialized before by
- the caller. If next_in is not Z_NULL and avail_in is large enough (the
- exact value depends on the compression method), inflateInit determines the
- compression method from the zlib header and allocates all data structures
- accordingly; otherwise the allocation will be deferred to the first call of
- inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to
- use default allocation functions.
-
- inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
- memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
- version assumed by the caller, or Z_STREAM_ERROR if the parameters are
- invalid, such as a null pointer to the structure. msg is set to null if
- there is no error message. inflateInit does not perform any decompression
- apart from possibly reading the zlib header if present: actual decompression
- will be done by inflate(). (So next_in and avail_in may be modified, but
- next_out and avail_out are unused and unchanged.) The current implementation
- of inflateInit() does not process any header information -- that is deferred
- until inflate() is called.
-*/
-
-
-ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
-/*
- inflate decompresses as much data as possible, and stops when the input
- buffer becomes empty or the output buffer becomes full. It may introduce
- some output latency (reading input without producing any output) except when
- forced to flush.
-
- The detailed semantics are as follows. inflate performs one or both of the
- following actions:
-
- - Decompress more input starting at next_in and update next_in and avail_in
- accordingly. If not all input can be processed (because there is not
- enough room in the output buffer), next_in is updated and processing will
- resume at this point for the next call of inflate().
-
- - Provide more output starting at next_out and update next_out and avail_out
- accordingly. inflate() provides as much output as possible, until there is
- no more input data or no more space in the output buffer (see below about
- the flush parameter).
-
- Before the call of inflate(), the application should ensure that at least
- one of the actions is possible, by providing more input and/or consuming more
- output, and updating the next_* and avail_* values accordingly. The
- application can consume the uncompressed output when it wants, for example
- when the output buffer is full (avail_out == 0), or after each call of
- inflate(). If inflate returns Z_OK and with zero avail_out, it must be
- called again after making room in the output buffer because there might be
- more output pending.
-
- The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FINISH,
- Z_BLOCK, or Z_TREES. Z_SYNC_FLUSH requests that inflate() flush as much
- output as possible to the output buffer. Z_BLOCK requests that inflate()
- stop if and when it gets to the next deflate block boundary. When decoding
- the zlib or gzip format, this will cause inflate() to return immediately
- after the header and before the first block. When doing a raw inflate,
- inflate() will go ahead and process the first block, and will return when it
- gets to the end of that block, or when it runs out of data.
-
- The Z_BLOCK option assists in appending to or combining deflate streams.
- Also to assist in this, on return inflate() will set strm->data_type to the
- number of unused bits in the last byte taken from strm->next_in, plus 64 if
- inflate() is currently decoding the last block in the deflate stream, plus
- 128 if inflate() returned immediately after decoding an end-of-block code or
- decoding the complete header up to just before the first byte of the deflate
- stream. The end-of-block will not be indicated until all of the uncompressed
- data from that block has been written to strm->next_out. The number of
- unused bits may in general be greater than seven, except when bit 7 of
- data_type is set, in which case the number of unused bits will be less than
- eight. data_type is set as noted here every time inflate() returns for all
- flush options, and so can be used to determine the amount of currently
- consumed input in bits.
-
- The Z_TREES option behaves as Z_BLOCK does, but it also returns when the
- end of each deflate block header is reached, before any actual data in that
- block is decoded. This allows the caller to determine the length of the
- deflate block header for later use in random access within a deflate block.
- 256 is added to the value of strm->data_type when inflate() returns
- immediately after reaching the end of the deflate block header.
-
- inflate() should normally be called until it returns Z_STREAM_END or an
- error. However if all decompression is to be performed in a single step (a
- single call of inflate), the parameter flush should be set to Z_FINISH. In
- this case all pending input is processed and all pending output is flushed;
- avail_out must be large enough to hold all the uncompressed data. (The size
- of the uncompressed data may have been saved by the compressor for this
- purpose.) The next operation on this stream must be inflateEnd to deallocate
- the decompression state. The use of Z_FINISH is never required, but can be
- used to inform inflate that a faster approach may be used for the single
- inflate() call.
-
- In this implementation, inflate() always flushes as much output as
- possible to the output buffer, and always uses the faster approach on the
- first call. So the only effect of the flush parameter in this implementation
- is on the return value of inflate(), as noted below, or when it returns early
- because Z_BLOCK or Z_TREES is used.
-
- If a preset dictionary is needed after this call (see inflateSetDictionary
- below), inflate sets strm->adler to the adler32 checksum of the dictionary
- chosen by the compressor and returns Z_NEED_DICT; otherwise it sets
- strm->adler to the adler32 checksum of all output produced so far (that is,
- total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described
- below. At the end of the stream, inflate() checks that its computed adler32
- checksum is equal to that saved by the compressor and returns Z_STREAM_END
- only if the checksum is correct.
-
- inflate() can decompress and check either zlib-wrapped or gzip-wrapped
- deflate data. The header type is detected automatically, if requested when
- initializing with inflateInit2(). Any information contained in the gzip
- header is not retained, so applications that need that information should
- instead use raw inflate, see inflateInit2() below, or inflateBack() and
- perform their own processing of the gzip header and trailer.
-
- inflate() returns Z_OK if some progress has been made (more input processed
- or more output produced), Z_STREAM_END if the end of the compressed data has
- been reached and all uncompressed output has been produced, Z_NEED_DICT if a
- preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
- corrupted (input stream not conforming to the zlib format or incorrect check
- value), Z_STREAM_ERROR if the stream structure was inconsistent (for example
- next_in or next_out was Z_NULL), Z_MEM_ERROR if there was not enough memory,
- Z_BUF_ERROR if no progress is possible or if there was not enough room in the
- output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and
- inflate() can be called again with more input and more output space to
- continue decompressing. If Z_DATA_ERROR is returned, the application may
- then call inflateSync() to look for a good compression block if a partial
- recovery of the data is desired.
-*/
-
-
-ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
-/*
- All dynamically allocated data structures for this stream are freed.
- This function discards any unprocessed input and does not flush any pending
- output.
-
- inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state
- was inconsistent. In the error case, msg may be set but then points to a
- static string (which must not be deallocated).
-*/
-
-
- /* Advanced functions */
-
-/*
- The following functions are needed only in some special applications.
-*/
-
-/*
-ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
- int level,
- int method,
- int windowBits,
- int memLevel,
- int strategy));
-
- This is another version of deflateInit with more compression options. The
- fields next_in, zalloc, zfree and opaque must be initialized before by the
- caller.
-
- The method parameter is the compression method. It must be Z_DEFLATED in
- this version of the library.
-
- The windowBits parameter is the base two logarithm of the window size
- (the size of the history buffer). It should be in the range 8..15 for this
- version of the library. Larger values of this parameter result in better
- compression at the expense of memory usage. The default value is 15 if
- deflateInit is used instead.
-
- windowBits can also be -8..-15 for raw deflate. In this case, -windowBits
- determines the window size. deflate() will then generate raw deflate data
- with no zlib header or trailer, and will not compute an adler32 check value.
-
- windowBits can also be greater than 15 for optional gzip encoding. Add
- 16 to windowBits to write a simple gzip header and trailer around the
- compressed data instead of a zlib wrapper. The gzip header will have no
- file name, no extra data, no comment, no modification time (set to zero), no
- header crc, and the operating system will be set to 255 (unknown). If a
- gzip stream is being written, strm->adler is a crc32 instead of an adler32.
-
- The memLevel parameter specifies how much memory should be allocated
- for the internal compression state. memLevel=1 uses minimum memory but is
- slow and reduces compression ratio; memLevel=9 uses maximum memory for
- optimal speed. The default value is 8. See zconf.h for total memory usage
- as a function of windowBits and memLevel.
-
- The strategy parameter is used to tune the compression algorithm. Use the
- value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a
- filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no
- string match), or Z_RLE to limit match distances to one (run-length
- encoding). Filtered data consists mostly of small values with a somewhat
- random distribution. In this case, the compression algorithm is tuned to
- compress them better. The effect of Z_FILTERED is to force more Huffman
- coding and less string matching; it is somewhat intermediate between
- Z_DEFAULT_STRATEGY and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as
- fast as Z_HUFFMAN_ONLY, but give better compression for PNG image data. The
- strategy parameter only affects the compression ratio but not the
- correctness of the compressed output even if it is not set appropriately.
- Z_FIXED prevents the use of dynamic Huffman codes, allowing for a simpler
- decoder for special applications.
-
- deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
- memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid
- method), or Z_VERSION_ERROR if the zlib library version (zlib_version) is
- incompatible with the version assumed by the caller (ZLIB_VERSION). msg is
- set to null if there is no error message. deflateInit2 does not perform any
- compression: this will be done by deflate().
-*/
-
-ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
- const Bytef *dictionary,
- uInt dictLength));
-/*
- Initializes the compression dictionary from the given byte sequence
- without producing any compressed output. This function must be called
- immediately after deflateInit, deflateInit2 or deflateReset, before any call
- of deflate. The compressor and decompressor must use exactly the same
- dictionary (see inflateSetDictionary).
-
- The dictionary should consist of strings (byte sequences) that are likely
- to be encountered later in the data to be compressed, with the most commonly
- used strings preferably put towards the end of the dictionary. Using a
- dictionary is most useful when the data to be compressed is short and can be
- predicted with good accuracy; the data can then be compressed better than
- with the default empty dictionary.
-
- Depending on the size of the compression data structures selected by
- deflateInit or deflateInit2, a part of the dictionary may in effect be
- discarded, for example if the dictionary is larger than the window size
- provided in deflateInit or deflateInit2. Thus the strings most likely to be
- useful should be put at the end of the dictionary, not at the front. In
- addition, the current implementation of deflate will use at most the window
- size minus 262 bytes of the provided dictionary.
-
- Upon return of this function, strm->adler is set to the adler32 value
- of the dictionary; the decompressor may later use this value to determine
- which dictionary has been used by the compressor. (The adler32 value
- applies to the whole dictionary even if only a subset of the dictionary is
- actually used by the compressor.) If a raw deflate was requested, then the
- adler32 value is not computed and strm->adler is not set.
-
- deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a
- parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is
- inconsistent (for example if deflate has already been called for this stream
- or if the compression method is bsort). deflateSetDictionary does not
- perform any compression: this will be done by deflate().
-*/
-
-ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
- z_streamp source));
-/*
- Sets the destination stream as a complete copy of the source stream.
-
- This function can be useful when several compression strategies will be
- tried, for example when there are several ways of pre-processing the input
- data with a filter. The streams that will be discarded should then be freed
- by calling deflateEnd. Note that deflateCopy duplicates the internal
- compression state which can be quite large, so this strategy is slow and can
- consume lots of memory.
-
- deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
- enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
- (such as zalloc being Z_NULL). msg is left unchanged in both source and
- destination.
-*/
-
-ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
-/*
- This function is equivalent to deflateEnd followed by deflateInit,
- but does not free and reallocate all the internal compression state. The
- stream will keep the same compression level and any other attributes that
- may have been set by deflateInit2.
-
- deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
- stream state was inconsistent (such as zalloc or state being Z_NULL).
-*/
-
-ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
- int level,
- int strategy));
-/*
- Dynamically update the compression level and compression strategy. The
- interpretation of level and strategy is as in deflateInit2. This can be
- used to switch between compression and straight copy of the input data, or
- to switch to a different kind of input data requiring a different strategy.
- If the compression level is changed, the input available so far is
- compressed with the old level (and may be flushed); the new level will take
- effect only at the next call of deflate().
-
- Before the call of deflateParams, the stream state must be set as for
- a call of deflate(), since the currently available input may have to be
- compressed and flushed. In particular, strm->avail_out must be non-zero.
-
- deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source
- stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR if
- strm->avail_out was zero.
-*/
-
-ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm,
- int good_length,
- int max_lazy,
- int nice_length,
- int max_chain));
-/*
- Fine tune deflate's internal compression parameters. This should only be
- used by someone who understands the algorithm used by zlib's deflate for
- searching for the best matching string, and even then only by the most
- fanatic optimizer trying to squeeze out the last compressed bit for their
- specific input data. Read the deflate.c source code for the meaning of the
- max_lazy, good_length, nice_length, and max_chain parameters.
-
- deflateTune() can be called after deflateInit() or deflateInit2(), and
- returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream.
- */
-
-ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm,
- uLong sourceLen));
-/*
- deflateBound() returns an upper bound on the compressed size after
- deflation of sourceLen bytes. It must be called after deflateInit() or
- deflateInit2(), and after deflateSetHeader(), if used. This would be used
- to allocate an output buffer for deflation in a single pass, and so would be
- called before deflate().
-*/
-
-ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm,
- int bits,
- int value));
-/*
- deflatePrime() inserts bits in the deflate output stream. The intent
- is that this function is used to start off the deflate output with the bits
- leftover from a previous deflate stream when appending to it. As such, this
- function can only be used for raw deflate, and must be used before the first
- deflate() call after a deflateInit2() or deflateReset(). bits must be less
- than or equal to 16, and that many of the least significant bits of value
- will be inserted in the output.
-
- deflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
- stream state was inconsistent.
-*/
-
-ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm,
- gz_headerp head));
-/*
- deflateSetHeader() provides gzip header information for when a gzip
- stream is requested by deflateInit2(). deflateSetHeader() may be called
- after deflateInit2() or deflateReset() and before the first call of
- deflate(). The text, time, os, extra field, name, and comment information
- in the provided gz_header structure are written to the gzip header (xflag is
- ignored -- the extra flags are set according to the compression level). The
- caller must assure that, if not Z_NULL, name and comment are terminated with
- a zero byte, and that if extra is not Z_NULL, that extra_len bytes are
- available there. If hcrc is true, a gzip header crc is included. Note that
- the current versions of the command-line version of gzip (up through version
- 1.3.x) do not support header crc's, and will report that it is a "multi-part
- gzip file" and give up.
-
- If deflateSetHeader is not used, the default gzip header has text false,
- the time set to zero, and os set to 255, with no extra, name, or comment
- fields. The gzip header is returned to the default state by deflateReset().
-
- deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
- stream state was inconsistent.
-*/
-
-/*
-ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
- int windowBits));
-
- This is another version of inflateInit with an extra parameter. The
- fields next_in, avail_in, zalloc, zfree and opaque must be initialized
- before by the caller.
-
- The windowBits parameter is the base two logarithm of the maximum window
- size (the size of the history buffer). It should be in the range 8..15 for
- this version of the library. The default value is 15 if inflateInit is used
- instead. windowBits must be greater than or equal to the windowBits value
- provided to deflateInit2() while compressing, or it must be equal to 15 if
- deflateInit2() was not used. If a compressed stream with a larger window
- size is given as input, inflate() will return with the error code
- Z_DATA_ERROR instead of trying to allocate a larger window.
-
- windowBits can also be zero to request that inflate use the window size in
- the zlib header of the compressed stream.
-
- windowBits can also be -8..-15 for raw inflate. In this case, -windowBits
- determines the window size. inflate() will then process raw deflate data,
- not looking for a zlib or gzip header, not generating a check value, and not
- looking for any check values for comparison at the end of the stream. This
- is for use with other formats that use the deflate compressed data format
- such as zip. Those formats provide their own check values. If a custom
- format is developed using the raw deflate format for compressed data, it is
- recommended that a check value such as an adler32 or a crc32 be applied to
- the uncompressed data as is done in the zlib, gzip, and zip formats. For
- most applications, the zlib format should be used as is. Note that comments
- above on the use in deflateInit2() applies to the magnitude of windowBits.
-
- windowBits can also be greater than 15 for optional gzip decoding. Add
- 32 to windowBits to enable zlib and gzip decoding with automatic header
- detection, or add 16 to decode only the gzip format (the zlib format will
- return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a
- crc32 instead of an adler32.
-
- inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
- memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
- version assumed by the caller, or Z_STREAM_ERROR if the parameters are
- invalid, such as a null pointer to the structure. msg is set to null if
- there is no error message. inflateInit2 does not perform any decompression
- apart from possibly reading the zlib header if present: actual decompression
- will be done by inflate(). (So next_in and avail_in may be modified, but
- next_out and avail_out are unused and unchanged.) The current implementation
- of inflateInit2() does not process any header information -- that is
- deferred until inflate() is called.
-*/
-
-ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
- const Bytef *dictionary,
- uInt dictLength));
-/*
- Initializes the decompression dictionary from the given uncompressed byte
- sequence. This function must be called immediately after a call of inflate,
- if that call returned Z_NEED_DICT. The dictionary chosen by the compressor
- can be determined from the adler32 value returned by that call of inflate.
- The compressor and decompressor must use exactly the same dictionary (see
- deflateSetDictionary). For raw inflate, this function can be called
- immediately after inflateInit2() or inflateReset() and before any call of
- inflate() to set the dictionary. The application must insure that the
- dictionary that was used for compression is provided.
-
- inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
- parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is
- inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
- expected one (incorrect adler32 value). inflateSetDictionary does not
- perform any decompression: this will be done by subsequent calls of
- inflate().
-*/
-
-ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
-/*
- Skips invalid compressed data until a full flush point (see above the
- description of deflate with Z_FULL_FLUSH) can be found, or until all
- available input is skipped. No output is provided.
-
- inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR
- if no more input was provided, Z_DATA_ERROR if no flush point has been
- found, or Z_STREAM_ERROR if the stream structure was inconsistent. In the
- success case, the application may save the current current value of total_in
- which indicates where valid compressed data was found. In the error case,
- the application may repeatedly call inflateSync, providing more input each
- time, until success or end of the input data.
-*/
-
-ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
- z_streamp source));
-/*
- Sets the destination stream as a complete copy of the source stream.
-
- This function can be useful when randomly accessing a large stream. The
- first pass through the stream can periodically record the inflate state,
- allowing restarting inflate at those points when randomly accessing the
- stream.
-
- inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
- enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
- (such as zalloc being Z_NULL). msg is left unchanged in both source and
- destination.
-*/
-
-ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
-/*
- This function is equivalent to inflateEnd followed by inflateInit,
- but does not free and reallocate all the internal decompression state. The
- stream will keep attributes that may have been set by inflateInit2.
-
- inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
- stream state was inconsistent (such as zalloc or state being Z_NULL).
-*/
-
-ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm,
- int windowBits));
-/*
- This function is the same as inflateReset, but it also permits changing
- the wrap and window size requests. The windowBits parameter is interpreted
- the same as it is for inflateInit2.
-
- inflateReset2 returns Z_OK if success, or Z_STREAM_ERROR if the source
- stream state was inconsistent (such as zalloc or state being Z_NULL), or if
- the windowBits parameter is invalid.
-*/
-
-ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm,
- int bits,
- int value));
-/*
- This function inserts bits in the inflate input stream. The intent is
- that this function is used to start inflating at a bit position in the
- middle of a byte. The provided bits will be used before any bytes are used
- from next_in. This function should only be used with raw inflate, and
- should be used before the first inflate() call after inflateInit2() or
- inflateReset(). bits must be less than or equal to 16, and that many of the
- least significant bits of value will be inserted in the input.
-
- If bits is negative, then the input stream bit buffer is emptied. Then
- inflatePrime() can be called again to put bits in the buffer. This is used
- to clear out bits leftover after feeding inflate a block description prior
- to feeding inflate codes.
-
- inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
- stream state was inconsistent.
-*/
-
-ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm));
-/*
- This function returns two values, one in the lower 16 bits of the return
- value, and the other in the remaining upper bits, obtained by shifting the
- return value down 16 bits. If the upper value is -1 and the lower value is
- zero, then inflate() is currently decoding information outside of a block.
- If the upper value is -1 and the lower value is non-zero, then inflate is in
- the middle of a stored block, with the lower value equaling the number of
- bytes from the input remaining to copy. If the upper value is not -1, then
- it is the number of bits back from the current bit position in the input of
- the code (literal or length/distance pair) currently being processed. In
- that case the lower value is the number of bytes already emitted for that
- code.
-
- A code is being processed if inflate is waiting for more input to complete
- decoding of the code, or if it has completed decoding but is waiting for
- more output space to write the literal or match data.
-
- inflateMark() is used to mark locations in the input data for random
- access, which may be at bit positions, and to note those cases where the
- output of a code may span boundaries of random access blocks. The current
- location in the input stream can be determined from avail_in and data_type
- as noted in the description for the Z_BLOCK flush parameter for inflate.
-
- inflateMark returns the value noted above or -1 << 16 if the provided
- source stream state was inconsistent.
-*/
-
-ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm,
- gz_headerp head));
-/*
- inflateGetHeader() requests that gzip header information be stored in the
- provided gz_header structure. inflateGetHeader() may be called after
- inflateInit2() or inflateReset(), and before the first call of inflate().
- As inflate() processes the gzip stream, head->done is zero until the header
- is completed, at which time head->done is set to one. If a zlib stream is
- being decoded, then head->done is set to -1 to indicate that there will be
- no gzip header information forthcoming. Note that Z_BLOCK or Z_TREES can be
- used to force inflate() to return immediately after header processing is
- complete and before any actual data is decompressed.
-
- The text, time, xflags, and os fields are filled in with the gzip header
- contents. hcrc is set to true if there is a header CRC. (The header CRC
- was valid if done is set to one.) If extra is not Z_NULL, then extra_max
- contains the maximum number of bytes to write to extra. Once done is true,
- extra_len contains the actual extra field length, and extra contains the
- extra field, or that field truncated if extra_max is less than extra_len.
- If name is not Z_NULL, then up to name_max characters are written there,
- terminated with a zero unless the length is greater than name_max. If
- comment is not Z_NULL, then up to comm_max characters are written there,
- terminated with a zero unless the length is greater than comm_max. When any
- of extra, name, or comment are not Z_NULL and the respective field is not
- present in the header, then that field is set to Z_NULL to signal its
- absence. This allows the use of deflateSetHeader() with the returned
- structure to duplicate the header. However if those fields are set to
- allocated memory, then the application will need to save those pointers
- elsewhere so that they can be eventually freed.
-
- If inflateGetHeader is not used, then the header information is simply
- discarded. The header is always checked for validity, including the header
- CRC if present. inflateReset() will reset the process to discard the header
- information. The application would need to call inflateGetHeader() again to
- retrieve the header from the next gzip stream.
-
- inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
- stream state was inconsistent.
-*/
-
-/*
-ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
- unsigned char FAR *window));
-
- Initialize the internal stream state for decompression using inflateBack()
- calls. The fields zalloc, zfree and opaque in strm must be initialized
- before the call. If zalloc and zfree are Z_NULL, then the default library-
- derived memory allocation routines are used. windowBits is the base two
- logarithm of the window size, in the range 8..15. window is a caller
- supplied buffer of that size. Except for special applications where it is
- assured that deflate was used with small window sizes, windowBits must be 15
- and a 32K byte window must be supplied to be able to decompress general
- deflate streams.
-
- See inflateBack() for the usage of these routines.
-
- inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of
- the paramaters are invalid, Z_MEM_ERROR if the internal state could not be
- allocated, or Z_VERSION_ERROR if the version of the library does not match
- the version of the header file.
-*/
-
-typedef unsigned (*in_func) OF((void FAR *, unsigned char FAR * FAR *));
-typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned));
-
-ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
- in_func in, void FAR *in_desc,
- out_func out, void FAR *out_desc));
-/*
- inflateBack() does a raw inflate with a single call using a call-back
- interface for input and output. This is more efficient than inflate() for
- file i/o applications in that it avoids copying between the output and the
- sliding window by simply making the window itself the output buffer. This
- function trusts the application to not change the output buffer passed by
- the output function, at least until inflateBack() returns.
-
- inflateBackInit() must be called first to allocate the internal state
- and to initialize the state with the user-provided window buffer.
- inflateBack() may then be used multiple times to inflate a complete, raw
- deflate stream with each call. inflateBackEnd() is then called to free the
- allocated state.
-
- A raw deflate stream is one with no zlib or gzip header or trailer.
- This routine would normally be used in a utility that reads zip or gzip
- files and writes out uncompressed files. The utility would decode the
- header and process the trailer on its own, hence this routine expects only
- the raw deflate stream to decompress. This is different from the normal
- behavior of inflate(), which expects either a zlib or gzip header and
- trailer around the deflate stream.
-
- inflateBack() uses two subroutines supplied by the caller that are then
- called by inflateBack() for input and output. inflateBack() calls those
- routines until it reads a complete deflate stream and writes out all of the
- uncompressed data, or until it encounters an error. The function's
- parameters and return types are defined above in the in_func and out_func
- typedefs. inflateBack() will call in(in_desc, &buf) which should return the
- number of bytes of provided input, and a pointer to that input in buf. If
- there is no input available, in() must return zero--buf is ignored in that
- case--and inflateBack() will return a buffer error. inflateBack() will call
- out(out_desc, buf, len) to write the uncompressed data buf[0..len-1]. out()
- should return zero on success, or non-zero on failure. If out() returns
- non-zero, inflateBack() will return with an error. Neither in() nor out()
- are permitted to change the contents of the window provided to
- inflateBackInit(), which is also the buffer that out() uses to write from.
- The length written by out() will be at most the window size. Any non-zero
- amount of input may be provided by in().
-
- For convenience, inflateBack() can be provided input on the first call by
- setting strm->next_in and strm->avail_in. If that input is exhausted, then
- in() will be called. Therefore strm->next_in must be initialized before
- calling inflateBack(). If strm->next_in is Z_NULL, then in() will be called
- immediately for input. If strm->next_in is not Z_NULL, then strm->avail_in
- must also be initialized, and then if strm->avail_in is not zero, input will
- initially be taken from strm->next_in[0 .. strm->avail_in - 1].
-
- The in_desc and out_desc parameters of inflateBack() is passed as the
- first parameter of in() and out() respectively when they are called. These
- descriptors can be optionally used to pass any information that the caller-
- supplied in() and out() functions need to do their job.
-
- On return, inflateBack() will set strm->next_in and strm->avail_in to
- pass back any unused input that was provided by the last in() call. The
- return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR
- if in() or out() returned an error, Z_DATA_ERROR if there was a format error
- in the deflate stream (in which case strm->msg is set to indicate the nature
- of the error), or Z_STREAM_ERROR if the stream was not properly initialized.
- In the case of Z_BUF_ERROR, an input or output error can be distinguished
- using strm->next_in which will be Z_NULL only if in() returned an error. If
- strm->next_in is not Z_NULL, then the Z_BUF_ERROR was due to out() returning
- non-zero. (in() will always be called before out(), so strm->next_in is
- assured to be defined if out() returns non-zero.) Note that inflateBack()
- cannot return Z_OK.
-*/
-
-ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm));
-/*
- All memory allocated by inflateBackInit() is freed.
-
- inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream
- state was inconsistent.
-*/
-
-ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
-/* Return flags indicating compile-time options.
-
- Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other:
- 1.0: size of uInt
- 3.2: size of uLong
- 5.4: size of voidpf (pointer)
- 7.6: size of z_off_t
-
- Compiler, assembler, and debug options:
- 8: DEBUG
- 9: ASMV or ASMINF -- use ASM code
- 10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention
- 11: 0 (reserved)
-
- One-time table building (smaller code, but not thread-safe if true):
- 12: BUILDFIXED -- build static block decoding tables when needed
- 13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed
- 14,15: 0 (reserved)
-
- Library content (indicates missing functionality):
- 16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking
- deflate code when not needed)
- 17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect
- and decode gzip streams (to avoid linking crc code)
- 18-19: 0 (reserved)
-
- Operation variations (changes in library functionality):
- 20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate
- 21: FASTEST -- deflate algorithm with only one, lowest compression level
- 22,23: 0 (reserved)
-
- The sprintf variant used by gzprintf (zero is best):
- 24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format
- 25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure!
- 26: 0 = returns value, 1 = void -- 1 means inferred string length returned
-
- Remainder:
- 27-31: 0 (reserved)
- */
-
-
- /* utility functions */
-
-/*
- The following utility functions are implemented on top of the basic
- stream-oriented functions. To simplify the interface, some default options
- are assumed (compression level and memory usage, standard memory allocation
- functions). The source code of these utility functions can be modified if
- you need special options.
-*/
-
-ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen,
- const Bytef *source, uLong sourceLen));
-/*
- Compresses the source buffer into the destination buffer. sourceLen is
- the byte length of the source buffer. Upon entry, destLen is the total size
- of the destination buffer, which must be at least the value returned by
- compressBound(sourceLen). Upon exit, destLen is the actual size of the
- compressed buffer.
-
- compress returns Z_OK if success, Z_MEM_ERROR if there was not
- enough memory, Z_BUF_ERROR if there was not enough room in the output
- buffer.
-*/
-
-ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen,
- const Bytef *source, uLong sourceLen,
- int level));
-/*
- Compresses the source buffer into the destination buffer. The level
- parameter has the same meaning as in deflateInit. sourceLen is the byte
- length of the source buffer. Upon entry, destLen is the total size of the
- destination buffer, which must be at least the value returned by
- compressBound(sourceLen). Upon exit, destLen is the actual size of the
- compressed buffer.
-
- compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
- memory, Z_BUF_ERROR if there was not enough room in the output buffer,
- Z_STREAM_ERROR if the level parameter is invalid.
-*/
-
-ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen));
-/*
- compressBound() returns an upper bound on the compressed size after
- compress() or compress2() on sourceLen bytes. It would be used before a
- compress() or compress2() call to allocate the destination buffer.
-*/
-
-ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen,
- const Bytef *source, uLong sourceLen));
-/*
- Decompresses the source buffer into the destination buffer. sourceLen is
- the byte length of the source buffer. Upon entry, destLen is the total size
- of the destination buffer, which must be large enough to hold the entire
- uncompressed data. (The size of the uncompressed data must have been saved
- previously by the compressor and transmitted to the decompressor by some
- mechanism outside the scope of this compression library.) Upon exit, destLen
- is the actual size of the uncompressed buffer.
-
- uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
- enough memory, Z_BUF_ERROR if there was not enough room in the output
- buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete.
-*/
-
-
- /* gzip file access functions */
-
-/*
- This library supports reading and writing files in gzip (.gz) format with
- an interface similar to that of stdio, using the functions that start with
- "gz". The gzip format is different from the zlib format. gzip is a gzip
- wrapper, documented in RFC 1952, wrapped around a deflate stream.
-*/
-
-typedef voidp gzFile; /* opaque gzip file descriptor */
-
-/*
-ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
-
- Opens a gzip (.gz) file for reading or writing. The mode parameter is as
- in fopen ("rb" or "wb") but can also include a compression level ("wb9") or
- a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman-only
- compression as in "wb1h", 'R' for run-length encoding as in "wb1R", or 'F'
- for fixed code compression as in "wb9F". (See the description of
- deflateInit2 for more information about the strategy parameter.) Also "a"
- can be used instead of "w" to request that the gzip stream that will be
- written be appended to the file. "+" will result in an error, since reading
- and writing to the same gzip file is not supported.
-
- gzopen can be used to read a file which is not in gzip format; in this
- case gzread will directly read from the file without decompression.
-
- gzopen returns NULL if the file could not be opened, if there was
- insufficient memory to allocate the gzFile state, or if an invalid mode was
- specified (an 'r', 'w', or 'a' was not provided, or '+' was provided).
- errno can be checked to determine if the reason gzopen failed was that the
- file could not be opened.
-*/
-
-ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
-/*
- gzdopen associates a gzFile with the file descriptor fd. File descriptors
- are obtained from calls like open, dup, creat, pipe or fileno (if the file
- has been previously opened with fopen). The mode parameter is as in gzopen.
-
- The next call of gzclose on the returned gzFile will also close the file
- descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor
- fd. If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd,
- mode);. The duplicated descriptor should be saved to avoid a leak, since
- gzdopen does not close fd if it fails.
-
- gzdopen returns NULL if there was insufficient memory to allocate the
- gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not
- provided, or '+' was provided), or if fd is -1. The file descriptor is not
- used until the next gz* read, write, seek, or close operation, so gzdopen
- will not detect if fd is invalid (unless fd is -1).
-*/
-
-ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
-/*
- Set the internal buffer size used by this library's functions. The
- default buffer size is 8192 bytes. This function must be called after
- gzopen() or gzdopen(), and before any other calls that read or write the
- file. The buffer memory allocation is always deferred to the first read or
- write. Two buffers are allocated, either both of the specified size when
- writing, or one of the specified size and the other twice that size when
- reading. A larger buffer size of, for example, 64K or 128K bytes will
- noticeably increase the speed of decompression (reading).
-
- The new buffer size also affects the maximum length for gzprintf().
-
- gzbuffer() returns 0 on success, or -1 on failure, such as being called
- too late.
-*/
-
-ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
-/*
- Dynamically update the compression level or strategy. See the description
- of deflateInit2 for the meaning of these parameters.
-
- gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not
- opened for writing.
-*/
-
-ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
-/*
- Reads the given number of uncompressed bytes from the compressed file. If
- the input file was not in gzip format, gzread copies the given number of
- bytes into the buffer.
-
- After reaching the end of a gzip stream in the input, gzread will continue
- to read, looking for another gzip stream, or failing that, reading the rest
- of the input file directly without decompression. The entire input file
- will be read if gzread is called until it returns less than the requested
- len.
-
- gzread returns the number of uncompressed bytes actually read, less than
- len for end of file, or -1 for error.
-*/
-
-ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
- voidpc buf, unsigned len));
-/*
- Writes the given number of uncompressed bytes into the compressed file.
- gzwrite returns the number of uncompressed bytes written or 0 in case of
- error.
-*/
-
-ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...));
-/*
- Converts, formats, and writes the arguments to the compressed file under
- control of the format string, as in fprintf. gzprintf returns the number of
- uncompressed bytes actually written, or 0 in case of error. The number of
- uncompressed bytes written is limited to 8191, or one less than the buffer
- size given to gzbuffer(). The caller should assure that this limit is not
- exceeded. If it is exceeded, then gzprintf() will return an error (0) with
- nothing written. In this case, there may also be a buffer overflow with
- unpredictable consequences, which is possible only if zlib was compiled with
- the insecure functions sprintf() or vsprintf() because the secure snprintf()
- or vsnprintf() functions were not available. This can be determined using
- zlibCompileFlags().
-*/
-
-ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
-/*
- Writes the given null-terminated string to the compressed file, excluding
- the terminating null character.
-
- gzputs returns the number of characters written, or -1 in case of error.
-*/
-
-ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
-/*
- Reads bytes from the compressed file until len-1 characters are read, or a
- newline character is read and transferred to buf, or an end-of-file
- condition is encountered. If any characters are read or if len == 1, the
- string is terminated with a null character. If no characters are read due
- to an end-of-file or len < 1, then the buffer is left untouched.
-
- gzgets returns buf which is a null-terminated string, or it returns NULL
- for end-of-file or in case of error. If there was an error, the contents at
- buf are indeterminate.
-*/
-
-ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
-/*
- Writes c, converted to an unsigned char, into the compressed file. gzputc
- returns the value that was written, or -1 in case of error.
-*/
-
-ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
-/*
- Reads one byte from the compressed file. gzgetc returns this byte or -1
- in case of end of file or error.
-*/
-
-ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
-/*
- Push one character back onto the stream to be read as the first character
- on the next read. At least one character of push-back is allowed.
- gzungetc() returns the character pushed, or -1 on failure. gzungetc() will
- fail if c is -1, and may fail if a character has been pushed but not read
- yet. If gzungetc is used immediately after gzopen or gzdopen, at least the
- output buffer size of pushed characters is allowed. (See gzbuffer above.)
- The pushed character will be discarded if the stream is repositioned with
- gzseek() or gzrewind().
-*/
-
-ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
-/*
- Flushes all pending output into the compressed file. The parameter flush
- is as in the deflate() function. The return value is the zlib error number
- (see function gzerror below). gzflush is only permitted when writing.
-
- If the flush parameter is Z_FINISH, the remaining data is written and the
- gzip stream is completed in the output. If gzwrite() is called again, a new
- gzip stream will be started in the output. gzread() is able to read such
- concatented gzip streams.
-
- gzflush should be called only when strictly necessary because it will
- degrade compression if called too often.
-*/
-
-/*
-ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
- z_off_t offset, int whence));
-
- Sets the starting position for the next gzread or gzwrite on the given
- compressed file. The offset represents a number of bytes in the
- uncompressed data stream. The whence parameter is defined as in lseek(2);
- the value SEEK_END is not supported.
-
- If the file is opened for reading, this function is emulated but can be
- extremely slow. If the file is opened for writing, only forward seeks are
- supported; gzseek then compresses a sequence of zeroes up to the new
- starting position.
-
- gzseek returns the resulting offset location as measured in bytes from
- the beginning of the uncompressed stream, or -1 in case of error, in
- particular if the file is opened for writing and the new starting position
- would be before the current position.
-*/
-
-ZEXTERN int ZEXPORT gzrewind OF((gzFile file));
-/*
- Rewinds the given file. This function is supported only for reading.
-
- gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
-*/
-
-/*
-ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
-
- Returns the starting position for the next gzread or gzwrite on the given
- compressed file. This position represents a number of bytes in the
- uncompressed data stream, and is zero when starting, even if appending or
- reading a gzip stream from the middle of a file using gzdopen().
-
- gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
-*/
-
-/*
-ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file));
-
- Returns the current offset in the file being read or written. This offset
- includes the count of bytes that precede the gzip stream, for example when
- appending or when using gzdopen() for reading. When reading, the offset
- does not include as yet unused buffered input. This information can be used
- for a progress indicator. On error, gzoffset() returns -1.
-*/
-
-ZEXTERN int ZEXPORT gzeof OF((gzFile file));
-/*
- Returns true (1) if the end-of-file indicator has been set while reading,
- false (0) otherwise. Note that the end-of-file indicator is set only if the
- read tried to go past the end of the input, but came up short. Therefore,
- just like feof(), gzeof() may return false even if there is no more data to
- read, in the event that the last read request was for the exact number of
- bytes remaining in the input file. This will happen if the input file size
- is an exact multiple of the buffer size.
-
- If gzeof() returns true, then the read functions will return no more data,
- unless the end-of-file indicator is reset by gzclearerr() and the input file
- has grown since the previous end of file was detected.
-*/
-
-ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
-/*
- Returns true (1) if file is being copied directly while reading, or false
- (0) if file is a gzip stream being decompressed. This state can change from
- false to true while reading the input file if the end of a gzip stream is
- reached, but is followed by data that is not another gzip stream.
-
- If the input file is empty, gzdirect() will return true, since the input
- does not contain a gzip stream.
-
- If gzdirect() is used immediately after gzopen() or gzdopen() it will
- cause buffers to be allocated to allow reading the file to determine if it
- is a gzip file. Therefore if gzbuffer() is used, it should be called before
- gzdirect().
-*/
-
-ZEXTERN int ZEXPORT gzclose OF((gzFile file));
-/*
- Flushes all pending output if necessary, closes the compressed file and
- deallocates the (de)compression state. Note that once file is closed, you
- cannot call gzerror with file, since its structures have been deallocated.
- gzclose must not be called more than once on the same file, just as free
- must not be called more than once on the same allocation.
-
- gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a
- file operation error, or Z_OK on success.
-*/
-
-ZEXTERN int ZEXPORT gzclose_r OF((gzFile file));
-ZEXTERN int ZEXPORT gzclose_w OF((gzFile file));
-/*
- Same as gzclose(), but gzclose_r() is only for use when reading, and
- gzclose_w() is only for use when writing or appending. The advantage to
- using these instead of gzclose() is that they avoid linking in zlib
- compression or decompression code that is not used when only reading or only
- writing respectively. If gzclose() is used, then both compression and
- decompression code will be included the application when linking to a static
- zlib library.
-*/
-
-ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
-/*
- Returns the error message for the last error which occurred on the given
- compressed file. errnum is set to zlib error number. If an error occurred
- in the file system and not in the compression library, errnum is set to
- Z_ERRNO and the application may consult errno to get the exact error code.
-
- The application must not modify the returned string. Future calls to
- this function may invalidate the previously returned string. If file is
- closed, then the string previously returned by gzerror will no longer be
- available.
-
- gzerror() should be used to distinguish errors from end-of-file for those
- functions above that do not distinguish those cases in their return values.
-*/
-
-ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
-/*
- Clears the error and end-of-file flags for file. This is analogous to the
- clearerr() function in stdio. This is useful for continuing to read a gzip
- file that is being written concurrently.
-*/
-
-
- /* checksum functions */
-
-/*
- These functions are not related to compression but are exported
- anyway because they might be useful in applications using the compression
- library.
-*/
-
-ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
-/*
- Update a running Adler-32 checksum with the bytes buf[0..len-1] and
- return the updated checksum. If buf is Z_NULL, this function returns the
- required initial value for the checksum.
-
- An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
- much faster.
-
- Usage example:
-
- uLong adler = adler32(0L, Z_NULL, 0);
-
- while (read_buffer(buffer, length) != EOF) {
- adler = adler32(adler, buffer, length);
- }
- if (adler != original_adler) error();
-*/
-
-/*
-ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
- z_off_t len2));
-
- Combine two Adler-32 checksums into one. For two sequences of bytes, seq1
- and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for
- each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of
- seq1 and seq2 concatenated, requiring only adler1, adler2, and len2.
-*/
-
-ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
-/*
- Update a running CRC-32 with the bytes buf[0..len-1] and return the
- updated CRC-32. If buf is Z_NULL, this function returns the required
- initial value for the for the crc. Pre- and post-conditioning (one's
- complement) is performed within this function so it shouldn't be done by the
- application.
-
- Usage example:
-
- uLong crc = crc32(0L, Z_NULL, 0);
-
- while (read_buffer(buffer, length) != EOF) {
- crc = crc32(crc, buffer, length);
- }
- if (crc != original_crc) error();
-*/
-
-/*
-ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2));
-
- Combine two CRC-32 check values into one. For two sequences of bytes,
- seq1 and seq2 with lengths len1 and len2, CRC-32 check values were
- calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32
- check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and
- len2.
-*/
-
-
- /* various hacks, don't look :) */
-
-/* deflateInit and inflateInit are macros to allow checking the zlib version
- * and the compiler's view of z_stream:
- */
-ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level,
- const char *version, int stream_size));
-ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm,
- const char *version, int stream_size));
-ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method,
- int windowBits, int memLevel,
- int strategy, const char *version,
- int stream_size));
-ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits,
- const char *version, int stream_size));
-ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
- unsigned char FAR *window,
- const char *version,
- int stream_size));
-#define deflateInit(strm, level) \
- deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream))
-#define inflateInit(strm) \
- inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream))
-#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
- deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
- (strategy), ZLIB_VERSION, sizeof(z_stream))
-#define inflateInit2(strm, windowBits) \
- inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream))
-#define inflateBackInit(strm, windowBits, window) \
- inflateBackInit_((strm), (windowBits), (window), \
- ZLIB_VERSION, sizeof(z_stream))
-
-/* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or
- * change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if
- * both are true, the application gets the *64 functions, and the regular
- * functions are changed to 64 bits) -- in case these are set on systems
- * without large file support, _LFS64_LARGEFILE must also be true
- */
-#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
- ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
- ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int));
- ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile));
- ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
- ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t));
- ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t));
-#endif
-
-#if !defined(ZLIB_INTERNAL) && _FILE_OFFSET_BITS-0 == 64 && _LFS64_LARGEFILE-0
-# define gzopen gzopen64
-# define gzseek gzseek64
-# define gztell gztell64
-# define gzoffset gzoffset64
-# define adler32_combine adler32_combine64
-# define crc32_combine crc32_combine64
-# ifdef _LARGEFILE64_SOURCE
- ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
- ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int));
- ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile));
- ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile));
- ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
- ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
-# endif
-#else
- ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *));
- ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int));
- ZEXTERN z_off_t ZEXPORT gztell OF((gzFile));
- ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile));
- ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
- ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
-#endif
-
-/* hack for buggy compilers */
-#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL)
- struct internal_state {int dummy;};
-#endif
-
-/* undocumented functions */
-ZEXTERN const char * ZEXPORT zError OF((int));
-ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp));
-ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void));
-ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int));
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* ZLIB_H */
diff --git a/3rdparty/assimp/contrib/zlib/zutil.c b/3rdparty/assimp/contrib/zlib/zutil.c
deleted file mode 100644
index 898ed345..00000000
--- a/3rdparty/assimp/contrib/zlib/zutil.c
+++ /dev/null
@@ -1,318 +0,0 @@
-/* zutil.c -- target dependent utility functions for the compression library
- * Copyright (C) 1995-2005, 2010 Jean-loup Gailly.
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* @(#) $Id$ */
-
-#include "zutil.h"
-
-#ifndef NO_DUMMY_DECL
-struct internal_state {int dummy;}; /* for buggy compilers */
-#endif
-
-const char * const z_errmsg[10] = {
-"need dictionary", /* Z_NEED_DICT 2 */
-"stream end", /* Z_STREAM_END 1 */
-"", /* Z_OK 0 */
-"file error", /* Z_ERRNO (-1) */
-"stream error", /* Z_STREAM_ERROR (-2) */
-"data error", /* Z_DATA_ERROR (-3) */
-"insufficient memory", /* Z_MEM_ERROR (-4) */
-"buffer error", /* Z_BUF_ERROR (-5) */
-"incompatible version",/* Z_VERSION_ERROR (-6) */
-""};
-
-
-const char * ZEXPORT zlibVersion()
-{
- return ZLIB_VERSION;
-}
-
-uLong ZEXPORT zlibCompileFlags()
-{
- uLong flags;
-
- flags = 0;
- switch ((int)(sizeof(uInt))) {
- case 2: break;
- case 4: flags += 1; break;
- case 8: flags += 2; break;
- default: flags += 3;
- }
- switch ((int)(sizeof(uLong))) {
- case 2: break;
- case 4: flags += 1 << 2; break;
- case 8: flags += 2 << 2; break;
- default: flags += 3 << 2;
- }
- switch ((int)(sizeof(voidpf))) {
- case 2: break;
- case 4: flags += 1 << 4; break;
- case 8: flags += 2 << 4; break;
- default: flags += 3 << 4;
- }
- switch ((int)(sizeof(z_off_t))) {
- case 2: break;
- case 4: flags += 1 << 6; break;
- case 8: flags += 2 << 6; break;
- default: flags += 3 << 6;
- }
-#ifdef DEBUG
- flags += 1 << 8;
-#endif
-#if defined(ASMV) || defined(ASMINF)
- flags += 1 << 9;
-#endif
-#ifdef ZLIB_WINAPI
- flags += 1 << 10;
-#endif
-#ifdef BUILDFIXED
- flags += 1 << 12;
-#endif
-#ifdef DYNAMIC_CRC_TABLE
- flags += 1 << 13;
-#endif
-#ifdef NO_GZCOMPRESS
- flags += 1L << 16;
-#endif
-#ifdef NO_GZIP
- flags += 1L << 17;
-#endif
-#ifdef PKZIP_BUG_WORKAROUND
- flags += 1L << 20;
-#endif
-#ifdef FASTEST
- flags += 1L << 21;
-#endif
-#ifdef STDC
-# ifdef NO_vsnprintf
- flags += 1L << 25;
-# ifdef HAS_vsprintf_void
- flags += 1L << 26;
-# endif
-# else
-# ifdef HAS_vsnprintf_void
- flags += 1L << 26;
-# endif
-# endif
-#else
- flags += 1L << 24;
-# ifdef NO_snprintf
- flags += 1L << 25;
-# ifdef HAS_sprintf_void
- flags += 1L << 26;
-# endif
-# else
-# ifdef HAS_snprintf_void
- flags += 1L << 26;
-# endif
-# endif
-#endif
- return flags;
-}
-
-#ifdef DEBUG
-
-# ifndef verbose
-# define verbose 0
-# endif
-int ZLIB_INTERNAL z_verbose = verbose;
-
-void ZLIB_INTERNAL z_error (m)
- char *m;
-{
- fprintf(stderr, "%s\n", m);
- exit(1);
-}
-#endif
-
-/* exported to allow conversion of error code to string for compress() and
- * uncompress()
- */
-const char * ZEXPORT zError(err)
- int err;
-{
- return ERR_MSG(err);
-}
-
-#if defined(_WIN32_WCE)
- /* The Microsoft C Run-Time Library for Windows CE doesn't have
- * errno. We define it as a global variable to simplify porting.
- * Its value is always 0 and should not be used.
- */
- int errno = 0;
-#endif
-
-#ifndef HAVE_MEMCPY
-
-void ZLIB_INTERNAL zmemcpy(dest, source, len)
- Bytef* dest;
- const Bytef* source;
- uInt len;
-{
- if (len == 0) return;
- do {
- *dest++ = *source++; /* ??? to be unrolled */
- } while (--len != 0);
-}
-
-int ZLIB_INTERNAL zmemcmp(s1, s2, len)
- const Bytef* s1;
- const Bytef* s2;
- uInt len;
-{
- uInt j;
-
- for (j = 0; j < len; j++) {
- if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1;
- }
- return 0;
-}
-
-void ZLIB_INTERNAL zmemzero(dest, len)
- Bytef* dest;
- uInt len;
-{
- if (len == 0) return;
- do {
- *dest++ = 0; /* ??? to be unrolled */
- } while (--len != 0);
-}
-#endif
-
-
-#ifdef SYS16BIT
-
-#ifdef __TURBOC__
-/* Turbo C in 16-bit mode */
-
-# define MY_ZCALLOC
-
-/* Turbo C malloc() does not allow dynamic allocation of 64K bytes
- * and farmalloc(64K) returns a pointer with an offset of 8, so we
- * must fix the pointer. Warning: the pointer must be put back to its
- * original form in order to free it, use zcfree().
- */
-
-#define MAX_PTR 10
-/* 10*64K = 640K */
-
-local int next_ptr = 0;
-
-typedef struct ptr_table_s {
- voidpf org_ptr;
- voidpf new_ptr;
-} ptr_table;
-
-local ptr_table table[MAX_PTR];
-/* This table is used to remember the original form of pointers
- * to large buffers (64K). Such pointers are normalized with a zero offset.
- * Since MSDOS is not a preemptive multitasking OS, this table is not
- * protected from concurrent access. This hack doesn't work anyway on
- * a protected system like OS/2. Use Microsoft C instead.
- */
-
-voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, unsigned items, unsigned size)
-{
- voidpf buf = opaque; /* just to make some compilers happy */
- ulg bsize = (ulg)items*size;
-
- /* If we allocate less than 65520 bytes, we assume that farmalloc
- * will return a usable pointer which doesn't have to be normalized.
- */
- if (bsize < 65520L) {
- buf = farmalloc(bsize);
- if (*(ush*)&buf != 0) return buf;
- } else {
- buf = farmalloc(bsize + 16L);
- }
- if (buf == NULL || next_ptr >= MAX_PTR) return NULL;
- table[next_ptr].org_ptr = buf;
-
- /* Normalize the pointer to seg:0 */
- *((ush*)&buf+1) += ((ush)((uch*)buf-0) + 15) >> 4;
- *(ush*)&buf = 0;
- table[next_ptr++].new_ptr = buf;
- return buf;
-}
-
-void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr)
-{
- int n;
- if (*(ush*)&ptr != 0) { /* object < 64K */
- farfree(ptr);
- return;
- }
- /* Find the original pointer */
- for (n = 0; n < next_ptr; n++) {
- if (ptr != table[n].new_ptr) continue;
-
- farfree(table[n].org_ptr);
- while (++n < next_ptr) {
- table[n-1] = table[n];
- }
- next_ptr--;
- return;
- }
- ptr = opaque; /* just to make some compilers happy */
- Assert(0, "zcfree: ptr not found");
-}
-
-#endif /* __TURBOC__ */
-
-
-#ifdef M_I86
-/* Microsoft C in 16-bit mode */
-
-# define MY_ZCALLOC
-
-#if (!defined(_MSC_VER) || (_MSC_VER <= 600))
-# define _halloc halloc
-# define _hfree hfree
-#endif
-
-voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, uInt items, uInt size)
-{
- if (opaque) opaque = 0; /* to make compiler happy */
- return _halloc((long)items, size);
-}
-
-void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr)
-{
- if (opaque) opaque = 0; /* to make compiler happy */
- _hfree(ptr);
-}
-
-#endif /* M_I86 */
-
-#endif /* SYS16BIT */
-
-
-#ifndef MY_ZCALLOC /* Any system without a special alloc function */
-
-#ifndef STDC
-extern voidp malloc OF((uInt size));
-extern voidp calloc OF((uInt items, uInt size));
-extern void free OF((voidpf ptr));
-#endif
-
-voidpf ZLIB_INTERNAL zcalloc (opaque, items, size)
- voidpf opaque;
- unsigned items;
- unsigned size;
-{
- if (opaque) items += size - size; /* make compiler happy */
- return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) :
- (voidpf)calloc(items, size);
-}
-
-void ZLIB_INTERNAL zcfree (opaque, ptr)
- voidpf opaque;
- voidpf ptr;
-{
- free(ptr);
- if (opaque) return; /* make compiler happy */
-}
-
-#endif /* MY_ZCALLOC */
diff --git a/3rdparty/assimp/contrib/zlib/zutil.h b/3rdparty/assimp/contrib/zlib/zutil.h
deleted file mode 100644
index 439d41c9..00000000
--- a/3rdparty/assimp/contrib/zlib/zutil.h
+++ /dev/null
@@ -1,274 +0,0 @@
-/* zutil.h -- internal interface and configuration of the compression library
- * Copyright (C) 1995-2010 Jean-loup Gailly.
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* WARNING: this file should *not* be used by applications. It is
- part of the implementation of the compression library and is
- subject to change. Applications should only use zlib.h.
- */
-
-/* @(#) $Id$ */
-
-#ifndef ZUTIL_H
-#define ZUTIL_H
-
-#if ((__GNUC__-0) * 10 + __GNUC_MINOR__-0 >= 33) && !defined(NO_VIZ)
-# define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
-#else
-# define ZLIB_INTERNAL
-#endif
-
-#include "zlib.h"
-
-#ifdef STDC
-# if !(defined(_WIN32_WCE) && defined(_MSC_VER))
-# include <stddef.h>
-# endif
-# include <string.h>
-# include <stdlib.h>
-#endif
-
-#ifndef local
-# define local static
-#endif
-/* compile with -Dlocal if your debugger can't find static symbols */
-
-typedef unsigned char uch;
-typedef uch FAR uchf;
-typedef unsigned short ush;
-typedef ush FAR ushf;
-typedef unsigned long ulg;
-
-extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
-/* (size given to avoid silly warnings with Visual C++) */
-
-#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
-
-#define ERR_RETURN(strm,err) \
- return (strm->msg = (char*)ERR_MSG(err), (err))
-/* To be used only when the state is known to be valid */
-
- /* common constants */
-
-#ifndef DEF_WBITS
-# define DEF_WBITS MAX_WBITS
-#endif
-/* default windowBits for decompression. MAX_WBITS is for compression only */
-
-#if MAX_MEM_LEVEL >= 8
-# define DEF_MEM_LEVEL 8
-#else
-# define DEF_MEM_LEVEL MAX_MEM_LEVEL
-#endif
-/* default memLevel */
-
-#define STORED_BLOCK 0
-#define STATIC_TREES 1
-#define DYN_TREES 2
-/* The three kinds of block type */
-
-#define MIN_MATCH 3
-#define MAX_MATCH 258
-/* The minimum and maximum match lengths */
-
-#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */
-
- /* target dependencies */
-
-#if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32))
-# define OS_CODE 0x00
-# if defined(__TURBOC__) || defined(__BORLANDC__)
-# if (__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__))
- /* Allow compilation with ANSI keywords only enabled */
- void _Cdecl farfree( void *block );
- void *_Cdecl farmalloc( unsigned long nbytes );
-# else
-# include <alloc.h>
-# endif
-# else /* MSC or DJGPP */
-# include <malloc.h>
-# endif
-#endif
-
-#ifdef AMIGA
-# define OS_CODE 0x01
-#endif
-
-#if defined(VAXC) || defined(VMS)
-# define OS_CODE 0x02
-# define F_OPEN(name, mode) \
- fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512")
-#endif
-
-#if defined(ATARI) || defined(atarist)
-# define OS_CODE 0x05
-#endif
-
-#ifdef OS2
-# define OS_CODE 0x06
-# ifdef M_I86
-# include <malloc.h>
-# endif
-#endif
-
-#if defined(MACOS) || defined(TARGET_OS_MAC)
-# define OS_CODE 0x07
-# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
-# include <unix.h> /* for fdopen */
-# else
-# ifndef fdopen
-# define fdopen(fd,mode) NULL /* No fdopen() */
-# endif
-# endif
-#endif
-
-#ifdef TOPS20
-# define OS_CODE 0x0a
-#endif
-
-#ifdef WIN32
-# ifndef __CYGWIN__ /* Cygwin is Unix, not Win32 */
-# define OS_CODE 0x0b
-# endif
-#endif
-
-#ifdef __50SERIES /* Prime/PRIMOS */
-# define OS_CODE 0x0f
-#endif
-
-#if defined(_BEOS_) || defined(RISCOS)
-# define fdopen(fd,mode) NULL /* No fdopen() */
-#endif
-
-#if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX
-# if defined(_WIN32_WCE)
-# define fdopen(fd,mode) NULL /* No fdopen() */
-# ifndef _PTRDIFF_T_DEFINED
- typedef int ptrdiff_t;
-# define _PTRDIFF_T_DEFINED
-# endif
-# else
-# define fdopen(fd,type) _fdopen(fd,type)
-# endif
-#endif
-
-#if defined(__BORLANDC__)
- #pragma warn -8004
- #pragma warn -8008
- #pragma warn -8066
-#endif
-
-/* provide prototypes for these when building zlib without LFS */
-#if !defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0
- ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
- ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
-#endif
-
- /* common defaults */
-
-#ifndef OS_CODE
-# define OS_CODE 0x03 /* assume Unix */
-#endif
-
-#ifndef F_OPEN
-# define F_OPEN(name, mode) fopen((name), (mode))
-#endif
-
- /* functions */
-
-#if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550)
-# ifndef HAVE_VSNPRINTF
-# define HAVE_VSNPRINTF
-# endif
-#endif
-#if defined(__CYGWIN__)
-# ifndef HAVE_VSNPRINTF
-# define HAVE_VSNPRINTF
-# endif
-#endif
-#ifndef HAVE_VSNPRINTF
-# ifdef MSDOS
- /* vsnprintf may exist on some MS-DOS compilers (DJGPP?),
- but for now we just assume it doesn't. */
-# define NO_vsnprintf
-# endif
-# ifdef __TURBOC__
-# define NO_vsnprintf
-# endif
-# ifdef WIN32
- /* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */
-# if !defined(vsnprintf) && !defined(NO_vsnprintf)
-# if !defined(_MSC_VER) || ( defined(_MSC_VER) && _MSC_VER < 1500 )
-# define vsnprintf _vsnprintf
-# endif
-# endif
-# endif
-# ifdef __SASC
-# define NO_vsnprintf
-# endif
-#endif
-#ifdef VMS
-# define NO_vsnprintf
-#endif
-
-#if defined(pyr)
-# define NO_MEMCPY
-#endif
-#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__)
- /* Use our own functions for small and medium model with MSC <= 5.0.
- * You may have to use the same strategy for Borland C (untested).
- * The __SC__ check is for Symantec.
- */
-# define NO_MEMCPY
-#endif
-#if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY)
-# define HAVE_MEMCPY
-#endif
-#ifdef HAVE_MEMCPY
-# ifdef SMALL_MEDIUM /* MSDOS small or medium model */
-# define zmemcpy _fmemcpy
-# define zmemcmp _fmemcmp
-# define zmemzero(dest, len) _fmemset(dest, 0, len)
-# else
-# define zmemcpy memcpy
-# define zmemcmp memcmp
-# define zmemzero(dest, len) memset(dest, 0, len)
-# endif
-#else
- void ZLIB_INTERNAL zmemcpy OF((Bytef* dest, const Bytef* source, uInt len));
- int ZLIB_INTERNAL zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len));
- void ZLIB_INTERNAL zmemzero OF((Bytef* dest, uInt len));
-#endif
-
-/* Diagnostic functions */
-#ifdef DEBUG
-# include <stdio.h>
- extern int ZLIB_INTERNAL z_verbose;
- extern void ZLIB_INTERNAL z_error OF((char *m));
-# define Assert(cond,msg) {if (!(cond)) z_error(msg);}
-# define Trace(x) {if (z_verbose>=0) fprintf x ;}
-# define Tracev(x) {if (z_verbose>0) fprintf x ;}
-# define Tracevv(x) {if (z_verbose>1) fprintf x ;}
-# define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;}
-# define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;}
-#else
-# define Assert(cond,msg)
-# define Trace(x)
-# define Tracev(x)
-# define Tracevv(x)
-# define Tracec(c,x)
-# define Tracecv(c,x)
-#endif
-
-
-voidpf ZLIB_INTERNAL zcalloc OF((voidpf opaque, unsigned items,
- unsigned size));
-void ZLIB_INTERNAL zcfree OF((voidpf opaque, voidpf ptr));
-
-#define ZALLOC(strm, items, size) \
- (*((strm)->zalloc))((strm)->opaque, (items), (size))
-#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
-#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
-
-#endif /* ZUTIL_H */
diff --git a/3rdparty/assimp/include/Compiler/poppack1.h b/3rdparty/assimp/include/Compiler/poppack1.h
deleted file mode 100644
index 8944b2b6..00000000
--- a/3rdparty/assimp/include/Compiler/poppack1.h
+++ /dev/null
@@ -1,22 +0,0 @@
-
-// ===============================================================================
-// May be included multiple times - resets structure packing to the defaults
-// for all supported compilers. Reverts the changes made by #include <pushpack1.h>
-//
-// Currently this works on the following compilers:
-// MSVC 7,8,9
-// GCC
-// BORLAND (complains about 'pack state changed but not reverted', but works)
-// ===============================================================================
-
-#ifndef AI_PUSHPACK_IS_DEFINED
-# error pushpack1.h must be included after poppack1.h
-#endif
-
-// reset packing to the original value
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
-# pragma pack( pop )
-#endif
-#undef PACK_STRUCT
-
-#undef AI_PUSHPACK_IS_DEFINED
diff --git a/3rdparty/assimp/include/Compiler/pushpack1.h b/3rdparty/assimp/include/Compiler/pushpack1.h
deleted file mode 100644
index b89a8ff7..00000000
--- a/3rdparty/assimp/include/Compiler/pushpack1.h
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-// ===============================================================================
-// May be included multiple times - sets structure packing to 1
-// for all supported compilers. #include <poppack1.h> reverts the changes.
-//
-// Currently this works on the following compilers:
-// MSVC 7,8,9
-// GCC
-// BORLAND (complains about 'pack state changed but not reverted', but works)
-//
-//
-// USAGE:
-//
-// struct StructToBePacked {
-// } PACK_STRUCT;
-//
-// ===============================================================================
-
-#ifdef AI_PUSHPACK_IS_DEFINED
-# error poppack1.h must be included after pushpack1.h
-#endif
-
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
-# pragma pack(push,1)
-# define PACK_STRUCT
-#elif defined( __GNUC__ )
-# define PACK_STRUCT __attribute__((packed))
-#else
-# define PACK_STRUCT
-//# error Compiler not supported
-#endif
-
-#if defined(_MSC_VER)
-
-// C4103: Packing was changed after the inclusion of the header, propably missing #pragma pop
-# pragma warning (disable : 4103)
-#endif
-
-#define AI_PUSHPACK_IS_DEFINED
-
-
diff --git a/3rdparty/assimp/include/DefaultLogger.h b/3rdparty/assimp/include/DefaultLogger.h
deleted file mode 100644
index 6d939d6a..00000000
--- a/3rdparty/assimp/include/DefaultLogger.h
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-/** @file DefaultLogger.h
-*/
-
-#ifndef INCLUDED_AI_DEFAULTLOGGER
-#define INCLUDED_AI_DEFAULTLOGGER
-
-#include "Logger.h"
-#include "LogStream.h"
-#include "NullLogger.h"
-#include <vector>
-
-namespace Assimp {
-// ------------------------------------------------------------------------------------
-class IOStream;
-struct LogStreamInfo;
-
-/** default name of logfile */
-#define ASSIMP_DEFAULT_LOG_NAME "AssimpLog.txt"
-
-// ------------------------------------------------------------------------------------
-/** @brief CPP-API: Primary logging facility of Assimp.
- *
- * The library stores its primary #Logger as a static member of this class.
- * #get() returns this primary logger. By default the underlying implementation is
- * just a #NullLogger which rejects all log messages. By calling #create(), logging
- * is turned on. To capture the log output multiple log streams (#LogStream) can be
- * attach to the logger. Some default streams for common streaming locations (such as
- * a file, std::cout, OutputDebugString()) are also provided.
- *
- * If you wish to customize the logging at an even deeper level supply your own
- * implementation of #Logger to #set().
- * @note The whole logging stuff causes a small extra overhead for all imports. */
-class ASSIMP_API DefaultLogger :
- public Logger {
-
-public:
-
- // ----------------------------------------------------------------------
- /** @brief Creates a logging instance.
- * @param name Name for log file. Only valid in combination
- * with the aiDefaultLogStream_FILE flag.
- * @param severity Log severity, VERBOSE turns on debug messages
- * @param defStreams Default log streams to be attached. Any bitwise
- * combination of the aiDefaultLogStream enumerated values.
- * If #aiDefaultLogStream_FILE is specified but an empty string is
- * passed for 'name', no log file is created at all.
- * @param io IOSystem to be used to open external files (such as the
- * log file). Pass NULL to rely on the default implementation.
- * This replaces the default #NullLogger with a #DefaultLogger instance. */
- static Logger *create(const char* name = ASSIMP_DEFAULT_LOG_NAME,
- LogSeverity severity = NORMAL,
- unsigned int defStreams = aiDefaultLogStream_DEBUGGER | aiDefaultLogStream_FILE,
- IOSystem* io = NULL);
-
- // ----------------------------------------------------------------------
- /** @brief Setup a custom #Logger implementation.
- *
- * Use this if the provided #DefaultLogger class doesn't fit into
- * your needs. If the provided message formatting is OK for you,
- * it's much easier to use #create() and to attach your own custom
- * output streams to it.
- * @param logger Pass NULL to setup a default NullLogger*/
- static void set (Logger *logger);
-
- // ----------------------------------------------------------------------
- /** @brief Getter for singleton instance
- * @return Only instance. This is never null, but it could be a
- * NullLogger. Use isNullLogger to check this.*/
- static Logger *get();
-
- // ----------------------------------------------------------------------
- /** @brief Return whether a #NullLogger is currently active
- * @return true if the current logger is a #NullLogger.
- * Use create() or set() to setup a logger that does actually do
- * something else than just rejecting all log messages. */
- static bool isNullLogger();
-
- // ----------------------------------------------------------------------
- /** @brief Kills the current singleton logger and replaces it with a
- * #NullLogger instance. */
- static void kill();
-
- // ----------------------------------------------------------------------
- /** @copydoc Logger::attachStream */
- bool attachStream(LogStream *pStream,
- unsigned int severity);
-
- // ----------------------------------------------------------------------
- /** @copydoc Logger::detatchStream */
- bool detatchStream(LogStream *pStream,
- unsigned int severity);
-
-
-private:
-
- // ----------------------------------------------------------------------
- /** @briefPrivate construction for internal use by create().
- * @param severity Logging granularity */
- DefaultLogger(LogSeverity severity);
-
- // ----------------------------------------------------------------------
- /** @briefDestructor */
- ~DefaultLogger();
-
-private:
-
- /** @brief Logs debug infos, only been written when severity level VERBOSE is set */
- void OnDebug(const char* message);
-
- /** @brief Logs an info message */
- void OnInfo(const char* message);
-
- /** @brief Logs a warning message */
- void OnWarn(const char* message);
-
- /** @brief Logs an error message */
- void OnError(const char* message);
-
- // ----------------------------------------------------------------------
- /** @brief Writes a message to all streams */
- void WriteToStreams(const char* message, ErrorSeverity ErrorSev );
-
- // ----------------------------------------------------------------------
- /** @brief Returns the thread id.
- * @note This is an OS specific feature, if not supported, a
- * zero will be returned.
- */
- unsigned int GetThreadID();
-
-private:
- // Aliases for stream container
- typedef std::vector<LogStreamInfo*> StreamArray;
- typedef std::vector<LogStreamInfo*>::iterator StreamIt;
- typedef std::vector<LogStreamInfo*>::const_iterator ConstStreamIt;
-
- //! only logging instance
- static Logger *m_pLogger;
- static NullLogger s_pNullLogger;
-
- //! Attached streams
- StreamArray m_StreamArray;
-
- bool noRepeatMsg;
- char lastMsg[MAX_LOG_MESSAGE_LENGTH*2];
- size_t lastLen;
-};
-// ------------------------------------------------------------------------------------
-
-} // Namespace Assimp
-
-#endif // !! INCLUDED_AI_DEFAULTLOGGER
diff --git a/3rdparty/assimp/include/IOStream.h b/3rdparty/assimp/include/IOStream.h
deleted file mode 100644
index 22fdbde9..00000000
--- a/3rdparty/assimp/include/IOStream.h
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-/** @file IOStream.h
- * @brief File I/O wrappers for C++.
- */
-
-#ifndef AI_IOSTREAM_H_INC
-#define AI_IOSTREAM_H_INC
-
-#include "aiTypes.h"
-
-#ifndef __cplusplus
-# error This header requires C++ to be used. aiFileIO.h is the \
- corresponding C interface.
-#endif
-
-namespace Assimp {
-
-// ----------------------------------------------------------------------------------
-/** @brief CPP-API: Class to handle file I/O for C++
- *
- * Derive an own implementation from this interface to provide custom IO handling
- * to the Importer. If you implement this interface, be sure to also provide an
- * implementation for IOSystem that creates instances of your custom IO class.
-*/
-class ASSIMP_API IOStream : public Intern::AllocateFromAssimpHeap
-{
-protected:
- /** Constructor protected, use IOSystem::Open() to create an instance. */
- IOStream(void);
-
-public:
- // -------------------------------------------------------------------
- /** @brief Destructor. Deleting the object closes the underlying file,
- * alternatively you may use IOSystem::Close() to release the file.
- */
- virtual ~IOStream();
-
- // -------------------------------------------------------------------
- /** @brief Read from the file
- *
- * See fread() for more details
- * This fails for write-only files */
- virtual size_t Read(void* pvBuffer,
- size_t pSize,
- size_t pCount) = 0;
-
- // -------------------------------------------------------------------
- /** @brief Write to the file
- *
- * See fwrite() for more details
- * This fails for read-only files */
- virtual size_t Write(const void* pvBuffer,
- size_t pSize,
- size_t pCount) = 0;
-
- // -------------------------------------------------------------------
- /** @brief Set the read/write cursor of the file
- *
- * Note that the offset is _negative_ for aiOrigin_END.
- * See fseek() for more details */
- virtual aiReturn Seek(size_t pOffset,
- aiOrigin pOrigin) = 0;
-
- // -------------------------------------------------------------------
- /** @brief Get the current position of the read/write cursor
- *
- * See ftell() for more details */
- virtual size_t Tell() const = 0;
-
- // -------------------------------------------------------------------
- /** @brief Returns filesize
- * Returns the filesize. */
- virtual size_t FileSize() const = 0;
-
- // -------------------------------------------------------------------
- /** @brief Flush the contents of the file buffer (for writers)
- * See fflush() for more details.
- */
- virtual void Flush() = 0;
-}; //! class IOStream
-
-// ----------------------------------------------------------------------------------
-inline IOStream::IOStream()
-{
- // empty
-}
-
-// ----------------------------------------------------------------------------------
-inline IOStream::~IOStream()
-{
- // empty
-}
-// ----------------------------------------------------------------------------------
-} //!namespace Assimp
-
-#endif //!!AI_IOSTREAM_H_INC
diff --git a/3rdparty/assimp/include/IOSystem.h b/3rdparty/assimp/include/IOSystem.h
deleted file mode 100644
index f41dda90..00000000
--- a/3rdparty/assimp/include/IOSystem.h
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file IOSystem.h
- * @brief File system wrapper for C++. Inherit this class to supply
- * custom file handling logic to the Import library.
-*/
-
-#ifndef AI_IOSYSTEM_H_INC
-#define AI_IOSYSTEM_H_INC
-
-#ifndef __cplusplus
-# error This header requires C++ to be used. aiFileIO.h is the \
- corresponding C interface.
-#endif
-
-#include "aiTypes.h"
-namespace Assimp {
-class IOStream;
-
-// ---------------------------------------------------------------------------
-/** @brief CPP-API: Interface to the file system.
- *
- * Derive an own implementation from this interface to supply custom file handling
- * to the importer library. If you implement this interface, you also want to
- * supply a custom implementation for IOStream.
- *
- * @see Importer::SetIOHandler() */
-class ASSIMP_API IOSystem : public Intern::AllocateFromAssimpHeap
-{
-public:
-
- // -------------------------------------------------------------------
- /** @brief Default constructor.
- *
- * Create an instance of your derived class and assign it to an
- * #Assimp::Importer instance by calling Importer::SetIOHandler().
- */
- IOSystem();
-
- // -------------------------------------------------------------------
- /** @brief Virtual destructor.
- *
- * It is safe to be called from within DLL Assimp, we're constructed
- * on Assimp's heap.
- */
- virtual ~IOSystem();
-
-
-public:
-
- // -------------------------------------------------------------------
- /** @brief For backward compatibility
- * @see Exists(const char*)
- */
- AI_FORCE_INLINE bool Exists( const std::string& pFile) const;
-
- // -------------------------------------------------------------------
- /** @brief Tests for the existence of a file at the given path.
- *
- * @param pFile Path to the file
- * @return true if there is a file with this path, else false.
- */
-
- virtual bool Exists( const char* pFile) const = 0;
-
-
-
- // -------------------------------------------------------------------
- /** @brief Returns the system specific directory separator
- * @return System specific directory separator
- */
- virtual char getOsSeparator() const = 0;
-
-
- // -------------------------------------------------------------------
- /** @brief Open a new file with a given path.
- *
- * When the access to the file is finished, call Close() to release
- * all associated resources (or the virtual dtor of the IOStream).
- *
- * @param pFile Path to the file
- * @param pMode Desired file I/O mode. Required are: "wb", "w", "wt",
- * "rb", "r", "rt".
- *
- * @return New IOStream interface allowing the lib to access
- * the underlying file.
- * @note When implementing this class to provide custom IO handling,
- * you probably have to supply an own implementation of IOStream as well.
- */
- virtual IOStream* Open(const char* pFile,
- const char* pMode = "rb") = 0;
-
- // -------------------------------------------------------------------
- /** @brief For backward compatibility
- * @see Open(const char*, const char*)
- */
- inline IOStream* Open(const std::string& pFile,
- const std::string& pMode = std::string("rb"));
-
-
-
- // -------------------------------------------------------------------
- /** @brief Closes the given file and releases all resources
- * associated with it.
- * @param pFile The file instance previously created by Open().
- */
- virtual void Close( IOStream* pFile) = 0;
-
- // -------------------------------------------------------------------
- /** @brief Compares two paths and check whether the point to
- * identical files.
- *
- * The dummy implementation of this virtual performs a
- * case-insensitive comparison of the given strings. The default IO
- * system implementation uses OS mechanisms to convert relative into
- * absolute paths, so the result can be trusted.
- * @param one First file
- * @param second Second file
- * @return true if the paths point to the same file. The file needn't
- * be existing, however.
- */
- virtual bool ComparePaths (const char* one,
- const char* second) const;
-
- // -------------------------------------------------------------------
- /** @brief For backward compatibility
- * @see ComparePaths(const char*, const char*)
- */
- inline bool ComparePaths (const std::string& one,
- const std::string& second) const;
-};
-
-// ----------------------------------------------------------------------------
-AI_FORCE_INLINE IOSystem::IOSystem()
-{
- // empty
-}
-
-// ----------------------------------------------------------------------------
-AI_FORCE_INLINE IOSystem::~IOSystem()
-{
- // empty
-}
-
-// ----------------------------------------------------------------------------
-// For compatibility, the interface of some functions taking a std::string was
-// changed to const char* to avoid crashes between binary incompatible STL
-// versions. This code her is inlined, so it shouldn't cause any problems.
-// ----------------------------------------------------------------------------
-
-// ----------------------------------------------------------------------------
-AI_FORCE_INLINE IOStream* IOSystem::Open(const std::string& pFile,
- const std::string& pMode)
-{
- // NOTE:
- // For compatibility, interface was changed to const char* to
- // avoid crashes between binary incompatible STL versions
- return Open(pFile.c_str(),pMode.c_str());
-}
-
-// ----------------------------------------------------------------------------
-AI_FORCE_INLINE bool IOSystem::Exists( const std::string& pFile) const
-{
- // NOTE:
- // For compatibility, interface was changed to const char* to
- // avoid crashes between binary incompatible STL versions
- return Exists(pFile.c_str());
-}
-
-// ----------------------------------------------------------------------------
-inline bool IOSystem::ComparePaths (const std::string& one,
- const std::string& second) const
-{
- // NOTE:
- // For compatibility, interface was changed to const char* to
- // avoid crashes between binary incompatible STL versions
- return ComparePaths(one.c_str(),second.c_str());
-}
-
-// ----------------------------------------------------------------------------
-} //!ns Assimp
-
-#endif //AI_IOSYSTEM_H_INC
diff --git a/3rdparty/assimp/include/LogStream.h b/3rdparty/assimp/include/LogStream.h
deleted file mode 100644
index 760a9f65..00000000
--- a/3rdparty/assimp/include/LogStream.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file LogStream.h
- * @brief Abstract base class 'LogStream', representing an output log stream.
- */
-#ifndef INCLUDED_AI_LOGSTREAM_H
-#define INCLUDED_AI_LOGSTREAM_H
-#include "aiTypes.h"
-namespace Assimp {
-class IOSystem;
-
-// ------------------------------------------------------------------------------------
-/** @brief CPP-API: Abstract interface for log stream implementations.
- *
- * Several default implementations are provided, see #aiDefaultLogStream for more
- * details. Writing your own implementation of LogStream is just necessary if these
- * are not enough for your purpose. */
-class ASSIMP_API LogStream
- : public Intern::AllocateFromAssimpHeap {
-protected:
- /** @brief Default constructor */
- LogStream() {
- }
-public:
- /** @brief Virtual destructor */
- virtual ~LogStream() {
- }
-
- // -------------------------------------------------------------------
- /** @brief Overwrite this for your own output methods
- *
- * Log messages *may* consist of multiple lines and you shouldn't
- * expect a consistent formatting. If you want custom formatting
- * (e.g. generate HTML), supply a custom instance of Logger to
- * #DefaultLogger:set(). Usually you can *expect* that a log message
- * is exactly one line and terminated with a single \n character.
- * @param message Message to be written */
- virtual void write(const char* message) = 0;
-
- // -------------------------------------------------------------------
- /** @brief Creates a default log stream
- * @param streams Type of the default stream
- * @param name For aiDefaultLogStream_FILE: name of the output file
- * @param io For aiDefaultLogStream_FILE: IOSystem to be used to open the output
- * file. Pass NULL for the default implementation.
- * @return New LogStream instance. */
- static LogStream* createDefaultStream(aiDefaultLogStream stream,
- const char* name = "AssimpLog.txt",
- IOSystem* io = NULL);
-
-}; // !class LogStream
-// ------------------------------------------------------------------------------------
-} // Namespace Assimp
-
-#endif
diff --git a/3rdparty/assimp/include/Logger.h b/3rdparty/assimp/include/Logger.h
deleted file mode 100644
index 94a42141..00000000
--- a/3rdparty/assimp/include/Logger.h
+++ /dev/null
@@ -1,234 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file Logger.h
- * @brief Abstract base class 'Logger', base of the logging system.
- */
-#ifndef INCLUDED_AI_LOGGER_H
-#define INCLUDED_AI_LOGGER_H
-
-#include "aiTypes.h"
-namespace Assimp {
-class LogStream;
-
-// Maximum length of a log message. Longer messages are rejected.
-#define MAX_LOG_MESSAGE_LENGTH 1024u
-
-// ----------------------------------------------------------------------------------
-/** @brief CPP-API: Abstract interface for logger implementations.
- * Assimp provides a default implementation and uses it for almost all
- * logging stuff ('DefaultLogger'). This class defines just basic logging
- * behaviour and is not of interest for you. Instead, take a look at #DefaultLogger. */
-class ASSIMP_API Logger
- : public Intern::AllocateFromAssimpHeap {
-public:
-
- // ----------------------------------------------------------------------
- /** @enum LogSeverity
- * @brief Log severity to describe the granularity of logging.
- */
- enum LogSeverity
- {
- NORMAL, //!< Normal granularity of logging
- VERBOSE //!< Debug infos will be logged, too
- };
-
- // ----------------------------------------------------------------------
- /** @enum ErrorSeverity
- * @brief Description for severity of a log message.
- *
- * Every LogStream has a bitwise combination of these flags.
- * A LogStream doesn't receive any messages of a specific type
- * if it doesn't specify the corresponding ErrorSeverity flag.
- */
- enum ErrorSeverity
- {
- DEBUGGING = 1, //!< Debug log message
- INFO = 2, //!< Info log message
- WARN = 4, //!< Warn log message
- ERR = 8 //!< Error log message
- };
-
-public:
-
- /** @brief Virtual destructor */
- virtual ~Logger();
-
- // ----------------------------------------------------------------------
- /** @brief Writes a debug message
- * @param message Debug message*/
- void debug(const std::string &message);
-
- // ----------------------------------------------------------------------
- /** @brief Writes a info message
- * @param message Info message*/
- void info(const std::string &message);
-
- // ----------------------------------------------------------------------
- /** @brief Writes a warning message
- * @param message Warn message*/
- void warn(const std::string &message);
-
- // ----------------------------------------------------------------------
- /** @brief Writes an error message
- * @param message Error message*/
- void error(const std::string &message);
-
- // ----------------------------------------------------------------------
- /** @brief Set a new log severity.
- * @param log_severity New severity for logging*/
- void setLogSeverity(LogSeverity log_severity);
-
- // ----------------------------------------------------------------------
- /** @brief Get the current log severity*/
- LogSeverity getLogSeverity() const;
-
- // ----------------------------------------------------------------------
- /** @brief Attach a new logstream
- *
- * The logger takes ownership of the stream and is responsible
- * for its destruction (which is done using ::delete when the logger
- * itself is destroyed). Call detachStream to detach a stream and to
- * gain ownership of it again.
- * @param pStream Logstream to attach
- * @param severity Message filter, specified which types of log
- * messages are dispatched to the stream. Provide a bitwise
- * combination of the ErrorSeverity flags.
- * @return true if the stream has been attached, false otherwise.*/
- virtual bool attachStream(LogStream *pStream,
- unsigned int severity = DEBUGGING | ERR | WARN | INFO) = 0;
-
- // ----------------------------------------------------------------------
- /** @brief Detach a still attached stream from the logger (or
- * modify the filter flags bits)
- * @param pStream Logstream instance for detaching
- * @param severity Provide a bitwise combination of the ErrorSeverity
- * flags. This value is &~ed with the current flags of the stream,
- * if the result is 0 the stream is detached from the Logger and
- * the caller retakes the possession of the stream.
- * @return true if the stream has been dettached, false otherwise.*/
- virtual bool detatchStream(LogStream *pStream,
- unsigned int severity = DEBUGGING | ERR | WARN | INFO) = 0;
-
-protected:
-
- /** Default constructor */
- Logger();
-
- /** Construction with a given log severity */
- Logger(LogSeverity severity);
-
- // ----------------------------------------------------------------------
- /** @brief Called as a request to write a specific debug message
- * @param message Debug message. Never longer than
- * MAX_LOG_MESSAGE_LENGTH characters (exluding the '0').
- * @note The message string is only valid until the scope of
- * the function is left.
- */
- virtual void OnDebug(const char* message)= 0;
-
- // ----------------------------------------------------------------------
- /** @brief Called as a request to write a specific info message
- * @param message Info message. Never longer than
- * MAX_LOG_MESSAGE_LENGTH characters (exluding the '0').
- * @note The message string is only valid until the scope of
- * the function is left.
- */
- virtual void OnInfo(const char* message) = 0;
-
- // ----------------------------------------------------------------------
- /** @brief Called as a request to write a specific warn message
- * @param message Warn message. Never longer than
- * MAX_LOG_MESSAGE_LENGTH characters (exluding the '0').
- * @note The message string is only valid until the scope of
- * the function is left.
- */
- virtual void OnWarn(const char* essage) = 0;
-
- // ----------------------------------------------------------------------
- /** @brief Called as a request to write a specific error message
- * @param message Error message. Never longer than
- * MAX_LOG_MESSAGE_LENGTH characters (exluding the '0').
- * @note The message string is only valid until the scope of
- * the function is left.
- */
- virtual void OnError(const char* message) = 0;
-
-protected:
-
- //! Logger severity
- LogSeverity m_Severity;
-};
-
-// ----------------------------------------------------------------------------------
-// Default constructor
-inline Logger::Logger() {
- setLogSeverity(NORMAL);
-}
-
-// ----------------------------------------------------------------------------------
-// Virtual destructor
-inline Logger::~Logger()
-{
-}
-
-// ----------------------------------------------------------------------------------
-// Construction with given logging severity
-inline Logger::Logger(LogSeverity severity) {
- setLogSeverity(severity);
-}
-
-// ----------------------------------------------------------------------------------
-// Log severity setter
-inline void Logger::setLogSeverity(LogSeverity log_severity){
- m_Severity = log_severity;
-}
-
-// ----------------------------------------------------------------------------------
-// Log severity getter
-inline Logger::LogSeverity Logger::getLogSeverity() const {
- return m_Severity;
-}
-
-// ----------------------------------------------------------------------------------
-
-} // Namespace Assimp
-
-#endif // !! INCLUDED_AI_LOGGER_H
diff --git a/3rdparty/assimp/include/NullLogger.h b/3rdparty/assimp/include/NullLogger.h
deleted file mode 100644
index 152abafa..00000000
--- a/3rdparty/assimp/include/NullLogger.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file NullLogger.h
- * @brief Dummy logger
-*/
-
-#ifndef INCLUDED_AI_NULLLOGGER_H
-#define INCLUDED_AI_NULLLOGGER_H
-
-#include "Logger.h"
-namespace Assimp {
-// ---------------------------------------------------------------------------
-/** @brief CPP-API: Empty logging implementation.
- *
- * Does nothing! Used by default if the application hasn't requested a
- * custom logger via #DefaultLogger::set() or #DefaultLogger::create(); */
-class ASSIMP_API NullLogger
- : public Logger {
-
-public:
-
- /** @brief Logs a debug message */
- void OnDebug(const char* message) {
- (void)message; //this avoids compiler warnings
- }
-
- /** @brief Logs an info message */
- void OnInfo(const char* message) {
- (void)message; //this avoids compiler warnings
- }
-
- /** @brief Logs a warning message */
- void OnWarn(const char* message) {
- (void)message; //this avoids compiler warnings
- }
-
- /** @brief Logs an error message */
- void OnError(const char* message) {
- (void)message; //this avoids compiler warnings
- }
-
- /** @brief Detach a still attached stream from logger */
- bool attachStream(LogStream *pStream, unsigned int severity) {
- (void)pStream; (void)severity; //this avoids compiler warnings
- return false;
- }
-
- /** @brief Detach a still attached stream from logger */
- bool detatchStream(LogStream *pStream, unsigned int severity) {
- (void)pStream; (void)severity; //this avoids compiler warnings
- return false;
- }
-
-private:
-};
-}
-#endif // !! AI_NULLLOGGER_H_INCLUDED
diff --git a/3rdparty/assimp/include/ProgressHandler.h b/3rdparty/assimp/include/ProgressHandler.h
deleted file mode 100644
index 24c393d3..00000000
--- a/3rdparty/assimp/include/ProgressHandler.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file ProgressHandler.h
- * @brief Abstract base class 'ProgressHandler'.
- */
-#ifndef INCLUDED_AI_PROGRESSHANDLER_H
-#define INCLUDED_AI_PROGRESSHANDLER_H
-#include "aiTypes.h"
-namespace Assimp {
-
-// ------------------------------------------------------------------------------------
-/** @brief CPP-API: Abstract interface for custom progress report receivers.
- *
- * Each #Importer instance maintains its own #ProgressHandler. The default
- * implementation provided by Assimp doesn't do anything at all. */
-class ASSIMP_API ProgressHandler
- : public Intern::AllocateFromAssimpHeap {
-protected:
- /** @brief Default constructor */
- ProgressHandler () {
- }
-public:
- /** @brief Virtual destructor */
- virtual ~ProgressHandler () {
- }
-
- // -------------------------------------------------------------------
- /** @brief Progress callback.
- * @param percentage An estimate of the current loading progress,
- * in percent. Or -1.f if such an estimate is not available.
- *
- * There are restriction on what you may do from within your
- * implementation of this method: no exceptions may be thrown and no
- * non-const #Importer methods may be called. It is
- * not generally possible to predict the number of callbacks
- * fired during a single import.
- *
- * @return Return false to abort loading at the next possible
- * occasion (loaders and Assimp are generally allowed to perform
- * all needed cleanup tasks prior to returning control to the
- * caller). If the loading is aborted, #Importer::ReadFile()
- * returns always NULL.
- *
- * @note Currently, percentage is always -1.f because there is
- * no reliable way to compute it.
- * */
- virtual bool Update(float percentage = -1.f) = 0;
-
-
-
-}; // !class ProgressHandler
-// ------------------------------------------------------------------------------------
-} // Namespace Assimp
-
-#endif
diff --git a/3rdparty/assimp/include/aiAnim.h b/3rdparty/assimp/include/aiAnim.h
deleted file mode 100644
index a9e9a491..00000000
--- a/3rdparty/assimp/include/aiAnim.h
+++ /dev/null
@@ -1,484 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file aiAnim.h
- * @brief Defines the data structures in which the imported animations
- * are returned.
- */
-#ifndef AI_ANIM_H_INC
-#define AI_ANIM_H_INC
-
-#include "aiTypes.h"
-#include "aiQuaternion.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// ---------------------------------------------------------------------------
-/** A time-value pair specifying a certain 3D vector for the given time. */
-struct aiVectorKey
-{
- /** The time of this key */
- double mTime;
-
- /** The value of this key */
- C_STRUCT aiVector3D mValue;
-
-#ifdef __cplusplus
-
- //! Default constructor
- aiVectorKey(){}
-
- //! Construction from a given time and key value
- aiVectorKey(double time, const aiVector3D& value)
- : mTime (time)
- , mValue (value)
- {}
-
-
- typedef aiVector3D elem_type;
-
- // Comparison operators. For use with std::find();
- bool operator == (const aiVectorKey& o) const {
- return o.mValue == this->mValue;
- }
- bool operator != (const aiVectorKey& o) const {
- return o.mValue != this->mValue;
- }
-
- // Relational operators. For use with std::sort();
- bool operator < (const aiVectorKey& o) const {
- return mTime < o.mTime;
- }
- bool operator > (const aiVectorKey& o) const {
- return mTime > o.mTime;
- }
-#endif
-};
-
-// ---------------------------------------------------------------------------
-/** A time-value pair specifying a rotation for the given time.
- * Rotations are expressed with quaternions. */
-struct aiQuatKey
-{
- /** The time of this key */
- double mTime;
-
- /** The value of this key */
- C_STRUCT aiQuaternion mValue;
-
-#ifdef __cplusplus
- aiQuatKey(){
- }
-
- /** Construction from a given time and key value */
- aiQuatKey(double time, const aiQuaternion& value)
- : mTime (time)
- , mValue (value)
- {}
-
- typedef aiQuaternion elem_type;
-
- // Comparison operators. For use with std::find();
- bool operator == (const aiQuatKey& o) const {
- return o.mValue == this->mValue;
- }
- bool operator != (const aiQuatKey& o) const {
- return o.mValue != this->mValue;
- }
-
- // Relational operators. For use with std::sort();
- bool operator < (const aiQuatKey& o) const {
- return mTime < o.mTime;
- }
- bool operator > (const aiQuatKey& o) const {
- return mTime > o.mTime;
- }
-#endif
-};
-
-// ---------------------------------------------------------------------------
-/** Binds a anim mesh to a specific point in time. */
-struct aiMeshKey
-{
- /** The time of this key */
- double mTime;
-
- /** Index into the aiMesh::mAnimMeshes array of the
- * mesh coresponding to the #aiMeshAnim hosting this
- * key frame. The referenced anim mesh is evaluated
- * according to the rules defined in the docs for #aiAnimMesh.*/
- unsigned int mValue;
-
-#ifdef __cplusplus
-
- aiMeshKey() {
- }
-
- /** Construction from a given time and key value */
- aiMeshKey(double time, const unsigned int value)
- : mTime (time)
- , mValue (value)
- {}
-
- typedef unsigned int elem_type;
-
- // Comparison operators. For use with std::find();
- bool operator == (const aiMeshKey& o) const {
- return o.mValue == this->mValue;
- }
- bool operator != (const aiMeshKey& o) const {
- return o.mValue != this->mValue;
- }
-
- // Relational operators. For use with std::sort();
- bool operator < (const aiMeshKey& o) const {
- return mTime < o.mTime;
- }
- bool operator > (const aiMeshKey& o) const {
- return mTime > o.mTime;
- }
-
-#endif
-};
-
-// ---------------------------------------------------------------------------
-/** Defines how an animation channel behaves outside the defined time
- * range. This corresponds to aiNodeAnim::mPreState and
- * aiNodeAnim::mPostState.*/
-enum aiAnimBehaviour
-{
- /** The value from the default node transformation is taken*/
- aiAnimBehaviour_DEFAULT = 0x0,
-
- /** The nearest key value is used without interpolation */
- aiAnimBehaviour_CONSTANT = 0x1,
-
- /** The value of the nearest two keys is linearly
- * extrapolated for the current time value.*/
- aiAnimBehaviour_LINEAR = 0x2,
-
- /** The animation is repeated.
- *
- * If the animation key go from n to m and the current
- * time is t, use the value at (t-n) % (|m-n|).*/
- aiAnimBehaviour_REPEAT = 0x3,
-
-
-
- /** This value is not used, it is just here to force the
- * the compiler to map this enum to a 32 Bit integer */
-#ifndef SWIG
- _aiAnimBehaviour_Force32Bit = 0x8fffffff
-#endif
-};
-
-// ---------------------------------------------------------------------------
-/** Describes the animation of a single node. The name specifies the
- * bone/node which is affected by this animation channel. The keyframes
- * are given in three separate series of values, one each for position,
- * rotation and scaling. The transformation matrix computed from these
- * values replaces the node's original transformation matrix at a
- * specific time.
- * This means all keys are absolute and not relative to the bone default pose.
- * The order in which the transformations are applied is
- * - as usual - scaling, rotation, translation.
- *
- * @note All keys are returned in their correct, chronological order.
- * Duplicate keys don't pass the validation step. Most likely there
- * will be no negative time values, but they are not forbidden also ( so
- * implementations need to cope with them! ) */
-struct aiNodeAnim
-{
- /** The name of the node affected by this animation. The node
- * must exist and it must be unique.*/
- C_STRUCT aiString mNodeName;
-
- /** The number of position keys */
- unsigned int mNumPositionKeys;
-
- /** The position keys of this animation channel. Positions are
- * specified as 3D vector. The array is mNumPositionKeys in size.
- *
- * If there are position keys, there will also be at least one
- * scaling and one rotation key.*/
- C_STRUCT aiVectorKey* mPositionKeys;
-
- /** The number of rotation keys */
- unsigned int mNumRotationKeys;
-
- /** The rotation keys of this animation channel. Rotations are
- * given as quaternions, which are 4D vectors. The array is
- * mNumRotationKeys in size.
- *
- * If there are rotation keys, there will also be at least one
- * scaling and one position key. */
- C_STRUCT aiQuatKey* mRotationKeys;
-
-
- /** The number of scaling keys */
- unsigned int mNumScalingKeys;
-
- /** The scaling keys of this animation channel. Scalings are
- * specified as 3D vector. The array is mNumScalingKeys in size.
- *
- * If there are scaling keys, there will also be at least one
- * position and one rotation key.*/
- C_STRUCT aiVectorKey* mScalingKeys;
-
-
- /** Defines how the animation behaves before the first
- * key is encountered.
- *
- * The default value is aiAnimBehaviour_DEFAULT (the original
- * transformation matrix of the affected node is used).*/
- C_ENUM aiAnimBehaviour mPreState;
-
- /** Defines how the animation behaves after the last
- * key was processed.
- *
- * The default value is aiAnimBehaviour_DEFAULT (the original
- * transformation matrix of the affected node is taken).*/
- C_ENUM aiAnimBehaviour mPostState;
-
-#ifdef __cplusplus
- aiNodeAnim()
- {
- mNumPositionKeys = 0; mPositionKeys = NULL;
- mNumRotationKeys = 0; mRotationKeys = NULL;
- mNumScalingKeys = 0; mScalingKeys = NULL;
-
- mPreState = mPostState = aiAnimBehaviour_DEFAULT;
- }
-
- ~aiNodeAnim()
- {
- delete [] mPositionKeys;
- delete [] mRotationKeys;
- delete [] mScalingKeys;
- }
-#endif // __cplusplus
-};
-
-// ---------------------------------------------------------------------------
-/** Describes vertex-based animations for a single mesh or a group of
- * meshes. Meshes carry the animation data for each frame in their
- * aiMesh::mAnimMeshes array. The purpose of aiMeshAnim is to
- * define keyframes linking each mesh attachment to a particular
- * point in time. */
-struct aiMeshAnim
-{
- /** Name of the mesh to be animated. An empty string is not allowed,
- * animated meshes need to be named (not necessarily uniquely,
- * the name can basically serve as wildcard to select a group
- * of meshes with similar animation setup)*/
- C_STRUCT aiString mName;
-
- /** Size of the #mKeys array. Must be 1, at least. */
- unsigned int mNumKeys;
-
- /** Key frames of the animation. May not be NULL. */
- C_STRUCT aiMeshKey* mKeys;
-
-#ifdef __cplusplus
-
- aiMeshAnim()
- : mNumKeys()
- , mKeys()
- {}
-
- ~aiMeshAnim()
- {
- delete[] mKeys;
- }
-
-#endif
-};
-
-// ---------------------------------------------------------------------------
-/** An animation consists of keyframe data for a number of nodes. For
- * each node affected by the animation a separate series of data is given.*/
-struct aiAnimation
-{
- /** The name of the animation. If the modeling package this data was
- * exported from does support only a single animation channel, this
- * name is usually empty (length is zero). */
- C_STRUCT aiString mName;
-
- /** Duration of the animation in ticks. */
- double mDuration;
-
- /** Ticks per second. 0 if not specified in the imported file */
- double mTicksPerSecond;
-
- /** The number of bone animation channels. Each channel affects
- * a single node. */
- unsigned int mNumChannels;
-
- /** The node animation channels. Each channel affects a single node.
- * The array is mNumChannels in size. */
- C_STRUCT aiNodeAnim** mChannels;
-
-
- /** The number of mesh animation channels. Each channel affects
- * a single mesh and defines vertex-based animation. */
- unsigned int mNumMeshChannels;
-
- /** The mesh animation channels. Each channel affects a single mesh.
- * The array is mNumMeshChannels in size. */
- C_STRUCT aiMeshAnim** mMeshChannels;
-
-#ifdef __cplusplus
- aiAnimation()
- : mDuration(-1.)
- , mTicksPerSecond()
- , mNumChannels()
- , mChannels()
- , mNumMeshChannels()
- , mMeshChannels()
- {
- }
-
- ~aiAnimation()
- {
- // DO NOT REMOVE THIS ADDITIONAL CHECK
- if (mNumChannels && mChannels) {
- for ( unsigned int a = 0; a < mNumChannels; a++) {
- delete mChannels[a];
- }
-
- delete [] mChannels;
- }
- if (mNumMeshChannels && mMeshChannels) {
- for ( unsigned int a = 0; a < mNumMeshChannels; a++) {
- delete mMeshChannels[a];
- }
-
- delete [] mMeshChannels;
- }
- }
-#endif // __cplusplus
-};
-
-#ifdef __cplusplus
-}
-
-
-// some C++ utilities for inter- and extrapolation
-namespace Assimp {
-
-// ---------------------------------------------------------------------------
-/** @brief CPP-API: Utility class to simplify interpolations of various data types.
- *
- * The type of interpolation is choosen automatically depending on the
- * types of the arguments. */
-template <typename T>
-struct Interpolator
-{
- // ------------------------------------------------------------------
- /** @brief Get the result of the interpolation between a,b.
- *
- * The interpolation algorithm depends on the type of the operands.
- * aiQuaternion's and aiQuatKey's SLERP, the rest does a simple
- * linear interpolation. */
- void operator () (T& out,const T& a, const T& b, float d) const {
- out = a + (b-a)*d;
- }
-}; // ! Interpolator <T>
-
-//! @cond Never
-
-template <>
-struct Interpolator <aiQuaternion> {
- void operator () (aiQuaternion& out,const aiQuaternion& a,
- const aiQuaternion& b, float d) const
- {
- aiQuaternion::Interpolate(out,a,b,d);
- }
-}; // ! Interpolator <aiQuaternion>
-
-template <>
-struct Interpolator <unsigned int> {
- void operator () (unsigned int& out,unsigned int a,
- unsigned int b, float d) const
- {
- out = d>0.5f ? b : a;
- }
-}; // ! Interpolator <aiQuaternion>
-
-template <>
-struct Interpolator <aiVectorKey> {
- void operator () (aiVector3D& out,const aiVectorKey& a,
- const aiVectorKey& b, float d) const
- {
- Interpolator<aiVector3D> ipl;
- ipl(out,a.mValue,b.mValue,d);
- }
-}; // ! Interpolator <aiVectorKey>
-
-template <>
-struct Interpolator <aiQuatKey> {
- void operator () (aiQuaternion& out, const aiQuatKey a,
- const aiQuatKey& b, float d) const
- {
- Interpolator<aiQuaternion> ipl;
- ipl(out,a.mValue,b.mValue,d);
- }
-}; // ! Interpolator <aiQuatKey>
-
-template <>
-struct Interpolator <aiMeshKey> {
- void operator () (unsigned int& out, const aiMeshKey a,
- const aiMeshKey& b, float d) const
- {
- Interpolator<unsigned int> ipl;
- ipl(out,a.mValue,b.mValue,d);
- }
-}; // ! Interpolator <aiQuatKey>
-
-//! @endcond
-} // ! end namespace Assimp
-
-
-
-#endif // __cplusplus
-#endif // AI_ANIM_H_INC
diff --git a/3rdparty/assimp/include/aiAssert.h b/3rdparty/assimp/include/aiAssert.h
deleted file mode 100644
index 5e00d846..00000000
--- a/3rdparty/assimp/include/aiAssert.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/** @file aiAssert.h
- */
-#ifndef AI_DEBUG_H_INC
-#define AI_DEBUG_H_INC
-
-#include <string>
-
-#ifndef __cplusplus
-#error This header requires C++ to be used.
-#endif
-
-namespace Assimp {
-
-//! \brief ASSIMP specific assertion test, only works in debug mode
-//! \param uiLine Line in file
-//! \param file Source file
-AI_WONT_RETURN void aiAssert(const std::string &message, unsigned int uiLine, const std::string &file);
-
-
-//! \def ai_assert
-//! \brief ASSIMP specific assertion test
-#ifdef DEBUG
-# define ai_assert(expression) if ( !(expression)) Assimp::aiAssert( #expression, __LINE__, __FILE__);
-#else
-# define ai_assert(expression)
-#endif
-
-} // Namespace Assimp
-
-#endif
diff --git a/3rdparty/assimp/include/aiCamera.h b/3rdparty/assimp/include/aiCamera.h
deleted file mode 100644
index 8f3d0a71..00000000
--- a/3rdparty/assimp/include/aiCamera.h
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file aiCamera.h
- * @brief Defines the aiCamera data structure
- */
-
-#ifndef AI_CAMERA_H_INC
-#define AI_CAMERA_H_INC
-
-#include "aiTypes.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// ---------------------------------------------------------------------------
-/** Helper structure to describe a virtual camera.
- *
- * Cameras have a representation in the node graph and can be animated.
- * An important aspect is that the camera itself is also part of the
- * scenegraph. This means, any values such as the look-at vector are not
- * *absolute*, they're <b>relative</b> to the coordinate system defined
- * by the node which corresponds to the camera. This allows for camera
- * animations. For static cameras parameters like the 'look-at' or 'up' vectors
- * are usually specified directly in aiCamera, but beware, they could also
- * be encoded in the node transformation. The following (pseudo)code sample
- * shows how to do it: <br><br>
- * @code
- * // Get the camera matrix for a camera at a specific time
- * // if the node hierarchy for the camera does not contain
- * // at least one animated node this is a static computation
- * get-camera-matrix (node sceneRoot, camera cam) : matrix
- * {
- * node cnd = find-node-for-camera(cam)
- * matrix cmt = identity()
- *
- * // as usual - get the absolute camera transformation for this frame
- * for each node nd in hierarchy from sceneRoot to cnd
- * matrix cur
- * if (is-animated(nd))
- * cur = eval-animation(nd)
- * else cur = nd->mTransformation;
- * cmt = mult-matrices( cmt, cur )
- * end for
- *
- * // now multiply with the camera's own local transform
- * cam = mult-matrices (cam, get-camera-matrix(cmt) )
- * }
- * @endcode
- *
- * @note some file formats (such as 3DS, ASE) export a "target point" -
- * the point the camera is looking at (it can even be animated). Assimp
- * writes the target point as a subnode of the camera's main node,
- * called "<camName>.Target". However this is just additional information
- * then the transformation tracks of the camera main node make the
- * camera already look in the right direction.
- *
-*/
-struct aiCamera
-{
- /** The name of the camera.
- *
- * There must be a node in the scenegraph with the same name.
- * This node specifies the position of the camera in the scene
- * hierarchy and can be animated.
- */
- C_STRUCT aiString mName;
-
- /** Position of the camera relative to the coordinate space
- * defined by the corresponding node.
- *
- * The default value is 0|0|0.
- */
- C_STRUCT aiVector3D mPosition;
-
-
- /** 'Up' - vector of the camera coordinate system relative to
- * the coordinate space defined by the corresponding node.
- *
- * The 'right' vector of the camera coordinate system is
- * the cross product of the up and lookAt vectors.
- * The default value is 0|1|0. The vector
- * may be normalized, but it needn't.
- */
- C_STRUCT aiVector3D mUp;
-
-
- /** 'LookAt' - vector of the camera coordinate system relative to
- * the coordinate space defined by the corresponding node.
- *
- * This is the viewing direction of the user.
- * The default value is 0|0|1. The vector
- * may be normalized, but it needn't.
- */
- C_STRUCT aiVector3D mLookAt;
-
-
- /** Half horizontal field of view angle, in radians.
- *
- * The field of view angle is the angle between the center
- * line of the screen and the left or right border.
- * The default value is 1/4PI.
- */
- float mHorizontalFOV;
-
- /** Distance of the near clipping plane from the camera.
- *
- * The value may not be 0.f (for arithmetic reasons to prevent
- * a division through zero). The default value is 0.1f.
- */
- float mClipPlaneNear;
-
- /** Distance of the far clipping plane from the camera.
- *
- * The far clipping plane must, of course, be further away than the
- * near clipping plane. The default value is 1000.f. The ratio
- * between the near and the far plane should not be too
- * large (between 1000-10000 should be ok) to avoid floating-point
- * inaccuracies which could lead to z-fighting.
- */
- float mClipPlaneFar;
-
-
- /** Screen aspect ratio.
- *
- * This is the ration between the width and the height of the
- * screen. Typical values are 4/3, 1/2 or 1/1. This value is
- * 0 if the aspect ratio is not defined in the source file.
- * 0 is also the default value.
- */
- float mAspect;
-
-#ifdef __cplusplus
-
- aiCamera()
- : mUp (0.f,1.f,0.f)
- , mLookAt (0.f,0.f,1.f)
- , mHorizontalFOV (0.25f * (float)AI_MATH_PI)
- , mClipPlaneNear (0.1f)
- , mClipPlaneFar (1000.f)
- , mAspect (0.f)
- {}
-
- /** @brief Get a *right-handed* camera matrix from me
- * @param out Camera matrix to be filled
- */
- void GetCameraMatrix (aiMatrix4x4& out) const
- {
- /** todo: test ... should work, but i'm not absolutely sure */
-
- /** We don't know whether these vectors are already normalized ...*/
- aiVector3D zaxis = mLookAt; zaxis.Normalize();
- aiVector3D yaxis = mUp; yaxis.Normalize();
- aiVector3D xaxis = mUp^mLookAt; xaxis.Normalize();
-
- out.a4 = -(xaxis * mPosition);
- out.b4 = -(yaxis * mPosition);
- out.c4 = -(zaxis * mPosition);
-
- out.a1 = xaxis.x;
- out.a2 = xaxis.y;
- out.a3 = xaxis.z;
-
- out.b1 = yaxis.x;
- out.b2 = yaxis.y;
- out.b3 = yaxis.z;
-
- out.c1 = zaxis.x;
- out.c2 = zaxis.y;
- out.c3 = zaxis.z;
-
- out.d1 = out.d2 = out.d3 = 0.f;
- out.d4 = 1.f;
- }
-
-#endif
-};
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // AI_CAMERA_H_INC
diff --git a/3rdparty/assimp/include/aiColor4D.h b/3rdparty/assimp/include/aiColor4D.h
deleted file mode 100644
index ce7e9dfe..00000000
--- a/3rdparty/assimp/include/aiColor4D.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-/** @file aiColor4D.h
- * @brief RGBA color structure, including operators when compiling in C++
- */
-#ifndef AI_COLOR4D_H_INC
-#define AI_COLOR4D_H_INC
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "./Compiler/pushpack1.h"
-// ----------------------------------------------------------------------------------
-/** Represents a color in Red-Green-Blue space including an
-* alpha component. Color values range from 0 to 1. */
-// ----------------------------------------------------------------------------------
-struct aiColor4D
-{
-#ifdef __cplusplus
- aiColor4D () : r(0.0f), g(0.0f), b(0.0f), a(0.0f) {}
- aiColor4D (float _r, float _g, float _b, float _a)
- : r(_r), g(_g), b(_b), a(_a) {}
- aiColor4D (float _r) : r(_r), g(_r), b(_r), a(_r) {}
- aiColor4D (const aiColor4D& o)
- : r(o.r), g(o.g), b(o.b), a(o.a) {}
-
- // combined operators
- const aiColor4D& operator += (const aiColor4D& o);
- const aiColor4D& operator -= (const aiColor4D& o);
- const aiColor4D& operator *= (float f);
- const aiColor4D& operator /= (float f);
-
- // comparison
- bool operator == (const aiColor4D& other) const;
- bool operator != (const aiColor4D& other) const;
-
- // color tuple access, rgba order
- inline float operator[](unsigned int i) const;
- inline float& operator[](unsigned int i);
-
- /** check whether a color is (close to) black */
- inline bool IsBlack() const;
-
-#endif // !__cplusplus
-
- // Red, green, blue and alpha color values
- float r, g, b, a;
-} PACK_STRUCT; // !struct aiColor4D
-
-#include "./Compiler/poppack1.h"
-#ifdef __cplusplus
-} // end extern "C"
-
-#endif // __cplusplus
-#endif // AI_VECTOR3D_H_INC
diff --git a/3rdparty/assimp/include/aiColor4D.inl b/3rdparty/assimp/include/aiColor4D.inl
deleted file mode 100644
index a4985ead..00000000
--- a/3rdparty/assimp/include/aiColor4D.inl
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file aiColor4D.inl
- * @brief Inline implementation of aiColor4D operators
- */
-#ifndef AI_COLOR4D_INL_INC
-#define AI_COLOR4D_INL_INC
-
-#include "aiColor4D.h"
-#ifdef __cplusplus
-
-// ------------------------------------------------------------------------------------------------
-AI_FORCE_INLINE const aiColor4D& aiColor4D::operator += (const aiColor4D& o) {
- r += o.r; g += o.g; b += o.b; a += o.a; return *this;
-}
-// ------------------------------------------------------------------------------------------------
-AI_FORCE_INLINE const aiColor4D& aiColor4D::operator -= (const aiColor4D& o) {
- r -= o.r; g -= o.g; b -= o.b; a -= o.a; return *this;
-}
-// ------------------------------------------------------------------------------------------------
-AI_FORCE_INLINE const aiColor4D& aiColor4D::operator *= (float f) {
- r *= f; g *= f; b *= f; a *= f; return *this;
-}
-// ------------------------------------------------------------------------------------------------
-AI_FORCE_INLINE const aiColor4D& aiColor4D::operator /= (float f) {
- r /= f; g /= f; b /= f; a /= f; return *this;
-}
-// ------------------------------------------------------------------------------------------------
-AI_FORCE_INLINE float aiColor4D::operator[](unsigned int i) const {
- return *(&r + i);
-}
-// ------------------------------------------------------------------------------------------------
-AI_FORCE_INLINE float& aiColor4D::operator[](unsigned int i) {
- return *(&r + i);
-}
-// ------------------------------------------------------------------------------------------------
-AI_FORCE_INLINE bool aiColor4D::operator== (const aiColor4D& other) const {
- return r == other.r && g == other.g && b == other.b && a == other.a;
-}
-// ------------------------------------------------------------------------------------------------
-AI_FORCE_INLINE bool aiColor4D::operator!= (const aiColor4D& other) const {
- return r != other.r || g != other.g || b != other.b || a != other.a;
-}
-// ------------------------------------------------------------------------------------------------
-AI_FORCE_INLINE aiColor4D operator + (const aiColor4D& v1, const aiColor4D& v2) {
- return aiColor4D( v1.r + v2.r, v1.g + v2.g, v1.b + v2.b, v1.a + v2.a);
-}
-// ------------------------------------------------------------------------------------------------
-AI_FORCE_INLINE aiColor4D operator - (const aiColor4D& v1, const aiColor4D& v2) {
- return aiColor4D( v1.r - v2.r, v1.g - v2.g, v1.b - v2.b, v1.a - v2.a);
-}
-// ------------------------------------------------------------------------------------------------
-AI_FORCE_INLINE aiColor4D operator * (const aiColor4D& v1, const aiColor4D& v2) {
- return aiColor4D( v1.r * v2.r, v1.g * v2.g, v1.b * v2.b, v1.a * v2.a);
-}
-// ------------------------------------------------------------------------------------------------
-AI_FORCE_INLINE aiColor4D operator / (const aiColor4D& v1, const aiColor4D& v2) {
- return aiColor4D( v1.r / v2.r, v1.g / v2.g, v1.b / v2.b, v1.a / v2.a);
-}
-// ------------------------------------------------------------------------------------------------
-AI_FORCE_INLINE aiColor4D operator * ( float f, const aiColor4D& v) {
- return aiColor4D( f*v.r, f*v.g, f*v.b, f*v.a);
-}
-// ------------------------------------------------------------------------------------------------
-AI_FORCE_INLINE aiColor4D operator * ( const aiColor4D& v, float f) {
- return aiColor4D( f*v.r, f*v.g, f*v.b, f*v.a);
-}
-// ------------------------------------------------------------------------------------------------
-AI_FORCE_INLINE aiColor4D operator / ( const aiColor4D& v, float f) {
- return v * (1/f);
-}
-// ------------------------------------------------------------------------------------------------
-AI_FORCE_INLINE aiColor4D operator / ( float f,const aiColor4D& v) {
- return aiColor4D(f,f,f,f)/v;
-}
-// ------------------------------------------------------------------------------------------------
-AI_FORCE_INLINE aiColor4D operator + ( const aiColor4D& v, float f) {
- return aiColor4D( f+v.r, f+v.g, f+v.b, f+v.a);
-}
-// ------------------------------------------------------------------------------------------------
-AI_FORCE_INLINE aiColor4D operator - ( const aiColor4D& v, float f) {
- return aiColor4D( v.r-f, v.g-f, v.b-f, v.a-f);
-}
-// ------------------------------------------------------------------------------------------------
-AI_FORCE_INLINE aiColor4D operator + ( float f, const aiColor4D& v) {
- return aiColor4D( f+v.r, f+v.g, f+v.b, f+v.a);
-}
-// ------------------------------------------------------------------------------------------------
-AI_FORCE_INLINE aiColor4D operator - ( float f, const aiColor4D& v) {
- return aiColor4D( f-v.r, f-v.g, f-v.b, f-v.a);
-}
-
-// ------------------------------------------------------------------------------------------------
-inline bool aiColor4D :: IsBlack() const {
- // The alpha component doesn't care here. black is black.
- static const float epsilon = 10e-3f;
- return fabs( r ) < epsilon && fabs( g ) < epsilon && fabs( b ) < epsilon;
-}
-
-#endif // __cplusplus
-#endif // AI_VECTOR3D_INL_INC
diff --git a/3rdparty/assimp/include/aiConfig.h b/3rdparty/assimp/include/aiConfig.h
deleted file mode 100644
index e53a2870..00000000
--- a/3rdparty/assimp/include/aiConfig.h
+++ /dev/null
@@ -1,634 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file aiConfig.h
- * @brief Defines constants for configurable properties for the library
- *
- * Typically these properties are set via
- * #Assimp::Importer::SetPropertyFloat,
- * #Assimp::Importer::SetPropertyInteger or
- * #Assimp::Importer::SetPropertyString,
- * depending on the data type of a property. All properties have a
- * default value. See the doc for the mentioned methods for more details.
- *
- * <br><br>
- * The corresponding functions for use with the plain-c API are:
- * #aiSetImportPropertyInteger,
- * #aiSetImportPropertyFloat,
- * #aiSetImportPropertyString
- */
-#ifndef INCLUDED_AI_CONFIG_H
-#define INCLUDED_AI_CONFIG_H
-
-
-// ###########################################################################
-// LIBRARY SETTINGS
-// General, global settings
-// ###########################################################################
-
-// ---------------------------------------------------------------------------
-/** @brief Enables time measurements.
- *
- * If enabled, measures the time needed for each part of the loading
- * process (i.e. IO time, importing, postprocessing, ..) and dumps
- * these timings to the DefaultLogger. See the @link perf Performance
- * Page@endlink for more information on this topic.
- *
- * Property type: bool. Default value: false.
- */
-#define AI_CONFIG_GLOB_MEASURE_TIME \
- "GLOB_MEASURE_TIME"
-
-# if 0 // not implemented yet
-// ---------------------------------------------------------------------------
-/** @brief Set Assimp's multithreading policy.
- *
- * This setting is ignored if Assimp was built without boost.thread
- * support (ASSIMP_BUILD_NO_THREADING, which is implied by ASSIMP_BUILD_BOOST_WORKAROUND).
- * Possible values are: -1 to let Assimp decide what to do, 0 to disable
- * multithreading entirely and any number larger than 0 to force a specific
- * number of threads. Assimp is always free to ignore this settings, which is
- * merely a hint. Usually, the default value (-1) will be fine. However, if
- * Assimp is used concurrently from multiple user threads, it might be useful
- * to limit each Importer instance to a specific number of cores.
- *
- * For more information, see the @link threading Threading page@endlink.
- * Property type: int, default value: -1.
- */
-#define AI_CONFIG_GLOB_MULTITHREADING \
- "GLOB_MULTITHREADING"
-#endif
-
-// ###########################################################################
-// POST PROCESSING SETTINGS
-// Various stuff to fine-tune the behavior of a specific post processing step.
-// ###########################################################################
-
-// ---------------------------------------------------------------------------
-/** @brief Specifies the maximum angle that may be between two vertex tangents
- * that their tangents and bitangents are smoothed.
- *
- * This applies to the CalcTangentSpace-Step. The angle is specified
- * in degrees, so 180 is PI. The default value is
- * 45 degrees. The maximum value is 175.
- * Property type: float.
- */
-#define AI_CONFIG_PP_CT_MAX_SMOOTHING_ANGLE \
- "PP_CT_MAX_SMOOTHING_ANGLE"
-
-// ---------------------------------------------------------------------------
-/** @brief Specifies the maximum angle that may be between two face normals
- * at the same vertex position that their are smoothed together.
- *
- * Sometimes referred to as 'crease angle'.
- * This applies to the GenSmoothNormals-Step. The angle is specified
- * in degrees, so 180 is PI. The default value is 175 degrees (all vertex
- * normals are smoothed). The maximum value is 175, too. Property type: float.
- * Warning: setting this option may cause a severe loss of performance. The
- * performance is unaffected if the #AI_CONFIG_FAVOUR_SPEED flag is set but
- * the output quality may be reduced.
- */
-#define AI_CONFIG_PP_GSN_MAX_SMOOTHING_ANGLE \
- "PP_GSN_MAX_SMOOTHING_ANGLE"
-
-// ---------------------------------------------------------------------------
-/** @brief Sets the colormap (= palette) to be used to decode embedded
- * textures in MDL (Quake or 3DGS) files.
- *
- * This must be a valid path to a file. The file is 768 (256*3) bytes
- * large and contains RGB triplets for each of the 256 palette entries.
- * The default value is colormap.lmp. If the file is not found,
- * a default palette (from Quake 1) is used.
- * Property type: string.
- */
-#define AI_CONFIG_IMPORT_MDL_COLORMAP \
- "IMPORT_MDL_COLORMAP"
-
-// ---------------------------------------------------------------------------
-/** @brief Configures the #aiProcess_RemoveRedundantMaterials step to
- * keep materials matching a name in a given list.
- *
- * This is a list of 1 to n strings, ' ' serves as delimiter character.
- * Identifiers containing whitespaces must be enclosed in *single*
- * quotation marks. For example:<tt>
- * "keep-me and_me_to anotherMaterialToBeKept \'name with whitespace\'"</tt>.
- * If a material matches on of these names, it will not be modified or
- * removed by the postprocessing step nor will other materials be replaced
- * by a reference to it. <br>
- * This option might be useful if you are using some magic material names
- * to pass additional semantics through the content pipeline. This ensures
- * they won't be optimized away, but a general optimization is still
- * performed for materials not contained in the list.
- * Property type: String. Default value: n/a
- * @note Linefeeds, tabs or carriage returns are treated as whitespace.
- * Material names are case sensitive.
- */
-#define AI_CONFIG_PP_RRM_EXCLUDE_LIST \
- "PP_RRM_EXCLUDE_LIST"
-
-// ---------------------------------------------------------------------------
-/** @brief Configures the #aiProcess_PretransformVertices step to
- * keep the scene hierarchy. Meshes are moved to worldspace, but
- * no optimization is performed (read: meshes with equal materials are not
- * joined. The total number of meshes won't change).
- *
- * This option could be of use for you if the scene hierarchy contains
- * important additional information which you intend to parse.
- * For rendering, you can still render all meshes in the scene without
- * any transformations.
- * Property type: bool. Default value: false.
- */
-#define AI_CONFIG_PP_PTV_KEEP_HIERARCHY \
- "PP_PTV_KEEP_HIERARCHY"
-
-// ---------------------------------------------------------------------------
-/** @brief Configures the #aiProcess_PretransformVertices step to normalize
- * all vertex components into the -1...1 range. That is, a bounding box
- * for the whole scene is computed, the maximum component is taken and all
- * meshes are scaled appropriately (uniformly of course!).
- * This might be useful if you don't know the spatial dimension of the input
- * data*/
-#define AI_CONFIG_PP_PTV_NORMALIZE \
- "PP_PTV_NORMALIZE"
-
-// ---------------------------------------------------------------------------
-/** @brief Configures the #aiProcess_FindDegenerates step to
- * remove degenerated primitives from the import - immediately.
- *
- * The default behaviour converts degenerated triangles to lines and
- * degenerated lines to points. See the documentation to the
- * #aiProcess_FindDegenerates step for a detailed example of the various ways
- * to get rid of these lines and points if you don't want them.
- * Property type: bool. Default value: false.
- */
-#define AI_CONFIG_PP_FD_REMOVE \
- "PP_FD_REMOVE"
-
-// ---------------------------------------------------------------------------
-/** @brief Configures the #aiProcess_OptimizeGraph step to preserve nodes
- * matching a name in a given list.
- *
- * This is a list of 1 to n strings, ' ' serves as delimiter character.
- * Identifiers containing whitespaces must be enclosed in *single*
- * quotation marks. For example:<tt>
- * "keep-me and_me_to anotherNodeToBeKept \'name with whitespace\'"</tt>.
- * If a node matches on of these names, it will not be modified or
- * removed by the postprocessing step.<br>
- * This option might be useful if you are using some magic node names
- * to pass additional semantics through the content pipeline. This ensures
- * they won't be optimized away, but a general optimization is still
- * performed for nodes not contained in the list.
- * Property type: String. Default value: n/a
- * @note Linefeeds, tabs or carriage returns are treated as whitespace.
- * Node names are case sensitive.
- */
-#define AI_CONFIG_PP_OG_EXCLUDE_LIST \
- "PP_OG_EXCLUDE_LIST"
-
-// ---------------------------------------------------------------------------
-/** @brief Set the maximum number of triangles in a mesh.
- *
- * This is used by the "SplitLargeMeshes" PostProcess-Step to determine
- * whether a mesh must be split or not.
- * @note The default value is AI_SLM_DEFAULT_MAX_TRIANGLES
- * Property type: integer.
- */
-#define AI_CONFIG_PP_SLM_TRIANGLE_LIMIT \
- "PP_SLM_TRIANGLE_LIMIT"
-
-// default value for AI_CONFIG_PP_SLM_TRIANGLE_LIMIT
-#if (!defined AI_SLM_DEFAULT_MAX_TRIANGLES)
-# define AI_SLM_DEFAULT_MAX_TRIANGLES 1000000
-#endif
-
-// ---------------------------------------------------------------------------
-/** @brief Set the maximum number of vertices in a mesh.
- *
- * This is used by the "SplitLargeMeshes" PostProcess-Step to determine
- * whether a mesh must be split or not.
- * @note The default value is AI_SLM_DEFAULT_MAX_VERTICES
- * Property type: integer.
- */
-#define AI_CONFIG_PP_SLM_VERTEX_LIMIT \
- "PP_SLM_VERTEX_LIMIT"
-
-// default value for AI_CONFIG_PP_SLM_VERTEX_LIMIT
-#if (!defined AI_SLM_DEFAULT_MAX_VERTICES)
-# define AI_SLM_DEFAULT_MAX_VERTICES 1000000
-#endif
-
-// ---------------------------------------------------------------------------
-/** @brief Set the maximum number of bones affecting a single vertex
- *
- * This is used by the #aiProcess_LimitBoneWeights PostProcess-Step.
- * @note The default value is AI_LBW_MAX_WEIGHTS
- * Property type: integer.*/
-#define AI_CONFIG_PP_LBW_MAX_WEIGHTS \
- "PP_LBW_MAX_WEIGHTS"
-
-// default value for AI_CONFIG_PP_LBW_MAX_WEIGHTS
-#if (!defined AI_LMW_MAX_WEIGHTS)
-# define AI_LMW_MAX_WEIGHTS 0x4
-#endif // !! AI_LMW_MAX_WEIGHTS
-
-/** @brief Default value for the #AI_CONFIG_PP_ICL_PTCACHE_SIZE property
- */
-#ifndef PP_ICL_PTCACHE_SIZE
-# define PP_ICL_PTCACHE_SIZE 12
-#endif
-
-// ---------------------------------------------------------------------------
-/** @brief Set the size of the post-transform vertex cache to optimize the
- * vertices for. This configures the #aiProcess_ImproveCacheLocality step.
- *
- * The size is given in vertices. Of course you can't know how the vertex
- * format will exactly look like after the import returns, but you can still
- * guess what your meshes will probably have.
- * @note The default value is #PP_ICL_PTCACHE_SIZE. That results in slight
- * performance improvements for most nVidia/AMD cards since 2002.
- * Property type: integer.
- */
-#define AI_CONFIG_PP_ICL_PTCACHE_SIZE "PP_ICL_PTCACHE_SIZE"
-
-// ---------------------------------------------------------------------------
-/** @brief Enumerates components of the aiScene and aiMesh data structures
- * that can be excluded from the import using the #aiPrpcess_RemoveComponent step.
- *
- * See the documentation to #aiProcess_RemoveComponent for more details.
- */
-enum aiComponent
-{
- /** Normal vectors */
-#ifdef SWIG
- aiComponent_NORMALS = 0x2,
-#else
- aiComponent_NORMALS = 0x2u,
-#endif
-
- /** Tangents and bitangents go always together ... */
-#ifdef SWIG
- aiComponent_TANGENTS_AND_BITANGENTS = 0x4,
-#else
- aiComponent_TANGENTS_AND_BITANGENTS = 0x4u,
-#endif
-
- /** ALL color sets
- * Use aiComponent_COLORn(N) to specify the N'th set */
- aiComponent_COLORS = 0x8,
-
- /** ALL texture UV sets
- * aiComponent_TEXCOORDn(N) to specify the N'th set */
- aiComponent_TEXCOORDS = 0x10,
-
- /** Removes all bone weights from all meshes.
- * The scenegraph nodes corresponding to the bones are NOT removed.
- * use the #aiProcess_OptimizeGraph step to do this */
- aiComponent_BONEWEIGHTS = 0x20,
-
- /** Removes all node animations (aiScene::mAnimations).
- * The corresponding scenegraph nodes are NOT removed.
- * use the #aiProcess_OptimizeGraph step to do this */
- aiComponent_ANIMATIONS = 0x40,
-
- /** Removes all embedded textures (aiScene::mTextures) */
- aiComponent_TEXTURES = 0x80,
-
- /** Removes all light sources (aiScene::mLights).
- * The corresponding scenegraph nodes are NOT removed.
- * use the #aiProcess_OptimizeGraph step to do this */
- aiComponent_LIGHTS = 0x100,
-
- /** Removes all light sources (aiScene::mCameras).
- * The corresponding scenegraph nodes are NOT removed.
- * use the #aiProcess_OptimizeGraph step to do this */
- aiComponent_CAMERAS = 0x200,
-
- /** Removes all meshes (aiScene::mMeshes). */
- aiComponent_MESHES = 0x400,
-
- /** Removes all materials. One default material will
- * be generated, so aiScene::mNumMaterials will be 1. */
- aiComponent_MATERIALS = 0x800,
-
-
- /** This value is not used. It is just there to force the
- * compiler to map this enum to a 32 Bit integer. */
-#ifndef SWIG
- _aiComponent_Force32Bit = 0x9fffffff
-#endif
-};
-
-// Remove a specific color channel 'n'
-#define aiComponent_COLORSn(n) (1u << (n+20u))
-
-// Remove a specific UV channel 'n'
-#define aiComponent_TEXCOORDSn(n) (1u << (n+25u))
-
-// ---------------------------------------------------------------------------
-/** @brief Input parameter to the #aiProcess_RemoveComponent step:
- * Specifies the parts of the data structure to be removed.
- *
- * See the documentation to this step for further details. The property
- * is expected to be an integer, a bitwise combination of the
- * #aiComponent flags defined above in this header. The default
- * value is 0. Important: if no valid mesh is remaining after the
- * step has been executed (e.g you thought it was funny to specify ALL
- * of the flags defined above) the import FAILS. Mainly because there is
- * no data to work on anymore ...
- */
-#define AI_CONFIG_PP_RVC_FLAGS \
- "PP_RVC_FLAGS"
-
-// ---------------------------------------------------------------------------
-/** @brief Input parameter to the #aiProcess_SortByPType step:
- * Specifies which primitive types are removed by the step.
- *
- * This is a bitwise combination of the aiPrimitiveType flags.
- * Specifying all of them is illegal, of course. A typical use would
- * be to exclude all line and point meshes from the import. This
- * is an integer property, its default value is 0.
- */
-#define AI_CONFIG_PP_SBP_REMOVE \
- "PP_SBP_REMOVE"
-
-// ---------------------------------------------------------------------------
-/** @brief Input parameter to the #aiProcess_FindInvalidData step:
- * Specifies the floating-point accuracy for animation values. The step
- * checks for animation tracks where all frame values are absolutely equal
- * and removes them. This tweakable controls the epsilon for floating-point
- * comparisons - two keys are considered equal if the invariant
- * abs(n0-n1)>epsilon holds true for all vector respectively quaternion
- * components. The default value is 0.f - comparisons are exact then.
- */
-#define AI_CONFIG_PP_FID_ANIM_ACCURACY \
- "PP_FID_ANIM_ACCURACY"
-
-
-// TransformUVCoords evaluates UV scalings
-#define AI_UVTRAFO_SCALING 0x1
-
-// TransformUVCoords evaluates UV rotations
-#define AI_UVTRAFO_ROTATION 0x2
-
-// TransformUVCoords evaluates UV translation
-#define AI_UVTRAFO_TRANSLATION 0x4
-
-// Everything baked together -> default value
-#define AI_UVTRAFO_ALL (AI_UVTRAFO_SCALING | AI_UVTRAFO_ROTATION | AI_UVTRAFO_TRANSLATION)
-
-// ---------------------------------------------------------------------------
-/** @brief Input parameter to the #aiProcess_TransformUVCoords step:
- * Specifies which UV transformations are evaluated.
- *
- * This is a bitwise combination of the AI_UVTRAFO_XXX flags (integer
- * property, of course). By default all transformations are enabled
- * (AI_UVTRAFO_ALL).
- */
-#define AI_CONFIG_PP_TUV_EVALUATE \
- "PP_TUV_EVALUATE"
-
-// ---------------------------------------------------------------------------
-/** @brief A hint to assimp to favour speed against import quality.
- *
- * Enabling this option may result in faster loading, but it needn't.
- * It represents just a hint to loaders and post-processing steps to use
- * faster code paths, if possible.
- * This property is expected to be an integer, != 0 stands for true.
- * The default value is 0.
- */
-#define AI_CONFIG_FAVOUR_SPEED \
- "FAVOUR_SPEED"
-
-
-// ###########################################################################
-// IMPORTER SETTINGS
-// Various stuff to fine-tune the behaviour of specific importer plugins.
-// ###########################################################################
-
-
-// ---------------------------------------------------------------------------
-/** @brief Set the vertex animation keyframe to be imported
- *
- * ASSIMP does not support vertex keyframes (only bone animation is supported).
- * The library reads only one frame of models with vertex animations.
- * By default this is the first frame.
- * \note The default value is 0. This option applies to all importers.
- * However, it is also possible to override the global setting
- * for a specific loader. You can use the AI_CONFIG_IMPORT_XXX_KEYFRAME
- * options (where XXX is a placeholder for the file format for which you
- * want to override the global setting).
- * Property type: integer.
- */
-#define AI_CONFIG_IMPORT_GLOBAL_KEYFRAME "IMPORT_GLOBAL_KEYFRAME"
-
-#define AI_CONFIG_IMPORT_MD3_KEYFRAME "IMPORT_MD3_KEYFRAME"
-#define AI_CONFIG_IMPORT_MD2_KEYFRAME "IMPORT_MD2_KEYFRAME"
-#define AI_CONFIG_IMPORT_MDL_KEYFRAME "IMPORT_MDL_KEYFRAME"
-#define AI_CONFIG_IMPORT_MDC_KEYFRAME "IMPORT_MDC_KEYFRAME"
-#define AI_CONFIG_IMPORT_SMD_KEYFRAME "IMPORT_SMD_KEYFRAME"
-#define AI_CONFIG_IMPORT_UNREAL_KEYFRAME "IMPORT_UNREAL_KEYFRAME"
-
-
-// ---------------------------------------------------------------------------
-/** @brief Configures the AC loader to collect all surfaces which have the
- * "Backface cull" flag set in separate meshes.
- *
- * Property type: bool. Default value: true.
- */
-#define AI_CONFIG_IMPORT_AC_SEPARATE_BFCULL \
- "IMPORT_AC_SEPARATE_BFCULL"
-
-// ---------------------------------------------------------------------------
-/** @brief Configures whether the AC loader evaluates subdivision surfaces (
- * indicated by the presence of the 'subdiv' attribute in the file). By
- * default, Assimp performs the subdivision using the standard
- * Catmull-Clark algorithm
- *
- * * Property type: bool. Default value: true.
- */
-#define AI_CONFIG_IMPORT_AC_EVAL_SUBDIVISION \
- "IMPORT_AC_EVAL_SUBDIVISION"
-
-// ---------------------------------------------------------------------------
-/** @brief Configures the UNREAL 3D loader to separate faces with different
- * surface flags (e.g. two-sided vs. single-sided).
- *
- * * Property type: bool. Default value: true.
- */
-#define AI_CONFIG_IMPORT_UNREAL_HANDLE_FLAGS \
- "UNREAL_HANDLE_FLAGS"
-
-// ---------------------------------------------------------------------------
-/** @brief Configures the terragen import plugin to compute uv's for
- * terrains, if not given. Furthermore a default texture is assigned.
- *
- * UV coordinates for terrains are so simple to compute that you'll usually
- * want to compute them on your own, if you need them. This option is intended
- * for model viewers which want to offer an easy way to apply textures to
- * terrains.
- * * Property type: bool. Default value: false.
- */
-#define AI_CONFIG_IMPORT_TER_MAKE_UVS \
- "IMPORT_TER_MAKE_UVS"
-
-// ---------------------------------------------------------------------------
-/** @brief Configures the ASE loader to always reconstruct normal vectors
- * basing on the smoothing groups loaded from the file.
- *
- * Some ASE files have carry invalid normals, other don't.
- * * Property type: bool. Default value: true.
- */
-#define AI_CONFIG_IMPORT_ASE_RECONSTRUCT_NORMALS \
- "IMPORT_ASE_RECONSTRUCT_NORMALS"
-
-// ---------------------------------------------------------------------------
-/** @brief Configures the M3D loader to detect and process multi-part
- * Quake player models.
- *
- * These models usually consist of 3 files, lower.md3, upper.md3 and
- * head.md3. If this property is set to true, Assimp will try to load and
- * combine all three files if one of them is loaded.
- * Property type: bool. Default value: true.
- */
-#define AI_CONFIG_IMPORT_MD3_HANDLE_MULTIPART \
- "IMPORT_MD3_HANDLE_MULTIPART"
-
-// ---------------------------------------------------------------------------
-/** @brief Tells the MD3 loader which skin files to load.
- *
- * When loading MD3 files, Assimp checks whether a file
- * <md3_file_name>_<skin_name>.skin is existing. These files are used by
- * Quake III to be able to assign different skins (e.g. red and blue team)
- * to models. 'default', 'red', 'blue' are typical skin names.
- * Property type: String. Default value: "default".
- */
-#define AI_CONFIG_IMPORT_MD3_SKIN_NAME \
- "IMPORT_MD3_SKIN_NAME"
-
-// ---------------------------------------------------------------------------
-/** @brief Specify the Quake 3 shader file to be used for a particular
- * MD3 file. This can also be a search path.
- *
- * By default Assimp's behaviour is as follows: If a MD3 file
- * <tt><any_path>/models/<any_q3_subdir>/<model_name>/<file_name>.md3</tt> is
- * loaded, the library tries to locate the corresponding shader file in
- * <tt><any_path>/scripts/<model_name>.shader</tt>. This property overrides this
- * behaviour. It can either specify a full path to the shader to be loaded
- * or alternatively the path (relative or absolute) to the directory where
- * the shaders for all MD3s to be loaded reside. Assimp attempts to open
- * <tt><dir>/<model_name>.shader</tt> first, <tt><dir>/<file_name>.shader</tt>
- * is the fallback file. Note that <dir> should have a terminal (back)slash.
- * Property type: String. Default value: n/a.
- */
-#define AI_CONFIG_IMPORT_MD3_SHADER_SRC \
- "IMPORT_MD3_SHADER_SRC"
-
-// ---------------------------------------------------------------------------
-/** @brief Configures the LWO loader to load just one layer from the model.
- *
- * LWO files consist of layers and in some cases it could be useful to load
- * only one of them. This property can be either a string - which specifies
- * the name of the layer - or an integer - the index of the layer. If the
- * property is not set the whole LWO model is loaded. Loading fails if the
- * requested layer is not available. The layer index is zero-based and the
- * layer name may not be empty.<br>
- * Property type: Integer. Default value: all layers are loaded.
- */
-#define AI_CONFIG_IMPORT_LWO_ONE_LAYER_ONLY \
- "IMPORT_LWO_ONE_LAYER_ONLY"
-
-// ---------------------------------------------------------------------------
-/** @brief Configures the MD5 loader to not load the MD5ANIM file for
- * a MD5MESH file automatically.
- *
- * The default strategy is to look for a file with the same name but the
- * MD5ANIM extension in the same directory. If it is found, it is loaded
- * and combined with the MD5MESH file. This configuration option can be
- * used to disable this behaviour.
- *
- * * Property type: bool. Default value: false.
- */
-#define AI_CONFIG_IMPORT_MD5_NO_ANIM_AUTOLOAD \
- "IMPORT_MD5_NO_ANIM_AUTOLOAD"
-
-// ---------------------------------------------------------------------------
-/** @brief Defines the begin of the time range for which the LWS loader
- * evaluates animations and computes aiNodeAnim's.
- *
- * Assimp provides full conversion of LightWave's envelope system, including
- * pre and post conditions. The loader computes linearly subsampled animation
- * chanels with the frame rate given in the LWS file. This property defines
- * the start time. Note: animation channels are only generated if a node
- * has at least one envelope with more tan one key assigned. This property.
- * is given in frames, '0' is the first frame. By default, if this property
- * is not set, the importer takes the animation start from the input LWS
- * file ('FirstFrame' line)<br>
- * Property type: Integer. Default value: taken from file.
- *
- * @see AI_CONFIG_IMPORT_LWS_ANIM_END - end of the imported time range
- */
-#define AI_CONFIG_IMPORT_LWS_ANIM_START \
- "IMPORT_LWS_ANIM_START"
-#define AI_CONFIG_IMPORT_LWS_ANIM_END \
- "IMPORT_LWS_ANIM_END"
-
-// ---------------------------------------------------------------------------
-/** @brief Defines the output frame rate of the IRR loader.
- *
- * IRR animations are difficult to convert for Assimp and there will
- * always be a loss of quality. This setting defines how many keys per second
- * are returned by the converter.<br>
- * Property type: integer. Default value: 100
- */
-#define AI_CONFIG_IMPORT_IRR_ANIM_FPS \
- "IMPORT_IRR_ANIM_FPS"
-
-
-// ---------------------------------------------------------------------------
-/** Ogre Importer will try to load this Materialfile
- * Ogre Mehs contain only the MaterialName, not the MaterialFile. If there
- * is no material file with the same name as the material, Ogre Importer will
- * try to load this file and search the material in it.
- */
-#define AI_CONFIG_IMPORT_OGRE_MATERIAL_FILE "IMPORT_OGRE_MATERIAL_FILE"
-
-
-#endif // !! AI_CONFIG_H_INC
diff --git a/3rdparty/assimp/include/aiDefines.h b/3rdparty/assimp/include/aiDefines.h
deleted file mode 100644
index b6c5ff9c..00000000
--- a/3rdparty/assimp/include/aiDefines.h
+++ /dev/null
@@ -1,279 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file aiDefines.h
- * @brief Assimp build configuration setup. See the notes in the comment
- * blocks to find out how to customize _your_ Assimp build.
- */
-
-#ifndef INCLUDED_AI_DEFINES_H
-#define INCLUDED_AI_DEFINES_H
-
- //////////////////////////////////////////////////////////////////////////
- /* Define ASSIMP_BUILD_NO_XX_IMPORTER to disable a specific
- * file format loader. The loader is be excluded from the
- * build in this case. 'XX' stands for the most common file
- * extension of the file format. E.g.:
- * ASSIMP_BUILD_NO_X_IMPORTER disables the X loader.
- *
- * If you're unsure about that, take a look at the implementation of the
- * import plugin you wish to disable. You'll find the right define in the
- * first lines of the corresponding unit.
- *
- * Other (mixed) configuration switches are listed here:
- * ASSIMP_BUILD_NO_COMPRESSED_X
- * - Disable support for compressed X files
- * ASSIMP_BUILD_NO_COMPRESSED_BLEND
- * - Disable support for compressed Blender files*/
- //////////////////////////////////////////////////////////////////////////
-
-#ifndef ASSIMP_BUILD_NO_COMPRESSED_X
-# define ASSIMP_BUILD_NEED_Z_INFLATE
-#endif
-
-#ifndef ASSIMP_BUILD_NO_COMPRESSED_BLEND
-# define ASSIMP_BUILD_NEED_Z_INFLATE
-#endif
-
- //////////////////////////////////////////////////////////////////////////
- /* Define ASSIMP_BUILD_NO_XX_PROCESS to disable a specific
- * post processing step. This is the current list of process names ('XX'):
- * CALCTANGENTS
- * JOINVERTICES
- * TRIANGULATE
- * GENFACENORMALS
- * GENVERTEXNORMALS
- * REMOVEVC
- * SPLITLARGEMESHES
- * PRETRANSFORMVERTICES
- * LIMITBONEWEIGHTS
- * VALIDATEDS
- * IMPROVECACHELOCALITY
- * FIXINFACINGNORMALS
- * REMOVE_REDUNDANTMATERIALS
- * OPTIMIZEGRAPH
- * SORTBYPTYPE
- * FINDINVALIDDATA
- * TRANSFORMTEXCOORDS
- * GENUVCOORDS
- * ENTITYMESHBUILDER
- * MAKELEFTHANDED
- * FLIPUVS
- * FLIPWINDINGORDER
- * OPTIMIZEMESHES
- * OPTIMIZEANIMS
- * OPTIMIZEGRAPH
- * GENENTITYMESHES
- * FIXTEXTUREPATHS */
- //////////////////////////////////////////////////////////////////////////
-
-#ifdef _MSC_VER
-# undef ASSIMP_API
-
- //////////////////////////////////////////////////////////////////////////
- /* Define 'ASSIMP_BUILD_DLL_EXPORT' to build a DLL of the library */
- //////////////////////////////////////////////////////////////////////////
-# ifdef ASSIMP_BUILD_DLL_EXPORT
-# define ASSIMP_API __declspec(dllexport)
-# pragma warning (disable : 4251)
-
- //////////////////////////////////////////////////////////////////////////
- /* Define 'ASSIMP_DLL' before including Assimp to link to ASSIMP in
- * an external DLL under Windows. Default is static linkage. */
- //////////////////////////////////////////////////////////////////////////
-# elif (defined ASSIMP_DLL)
-# define ASSIMP_API __declspec(dllimport)
-# else
-# define ASSIMP_API
-# endif
-
- /* Force the compiler to inline a function, if possible
- */
-# define AI_FORCE_INLINE __forceinline
-
- /* Tells the compiler that a function never returns. Used in code analysis
- * to skip dead paths (e.g. after an assertion evaluated to false). */
-# define AI_WONT_RETURN __declspec(noreturn)
-#else
-
-# define AI_WONT_RETURN
-
-# define ASSIMP_API
-# define AI_FORCE_INLINE inline
-#endif // (defined _MSC_VER)
-
-#ifdef __cplusplus
- /* No explicit 'struct' and 'enum' tags for C++, we don't want to
- * confuse the _AI_ of our IDE.
- */
-# define C_STRUCT
-# define C_ENUM
-#else
- //////////////////////////////////////////////////////////////////////////
- /* To build the documentation, make sure ASSIMP_DOXYGEN_BUILD
- * is defined by Doxygen's preprocessor. The corresponding
- * entries in the DOXYFILE are: */
- //////////////////////////////////////////////////////////////////////////
-#if 0
- ENABLE_PREPROCESSING = YES
- MACRO_EXPANSION = YES
- EXPAND_ONLY_PREDEF = YES
- SEARCH_INCLUDES = YES
- INCLUDE_PATH =
- INCLUDE_FILE_PATTERNS =
- PREDEFINED = ASSIMP_DOXYGEN_BUILD=1
- EXPAND_AS_DEFINED = C_STRUCT C_ENUM
- SKIP_FUNCTION_MACROS = YES
-#endif
- //////////////////////////////////////////////////////////////////////////
- /* Doxygen gets confused if we use c-struct typedefs to avoid
- * the explicit 'struct' notation. This trick here has the same
- * effect as the TYPEDEF_HIDES_STRUCT option, but we don't need
- * to typedef all structs/enums. */
- //////////////////////////////////////////////////////////////////////////
-# if (defined ASSIMP_DOXYGEN_BUILD)
-# define C_STRUCT
-# define C_ENUM
-# else
-# define C_STRUCT struct
-# define C_ENUM enum
-# endif
-#endif
-
-#if (defined(__BORLANDC__) || defined (__BCPLUSPLUS__))
-#error Currently, Borland is unsupported. Feel free to port Assimp.
-
-// "W8059 Packgre der Struktur gendert"
-
-#endif
- //////////////////////////////////////////////////////////////////////////
- /* Define 'ASSIMP_BUILD_BOOST_WORKAROUND' to compile assimp
- * without boost. This is done by using a few workaround
- * classes and brings some limitations (e.g. some logging won't be done,
- * the library won't utilize threads or be threadsafe at all).
- * This implies the 'ASSIMP_BUILD_SINGLETHREADED' setting. */
- //////////////////////////////////////////////////////////////////////////
-#ifdef ASSIMP_BUILD_BOOST_WORKAROUND
-
- // threading support requires boost
-#ifndef ASSIMP_BUILD_SINGLETHREADED
-# define ASSIMP_BUILD_SINGLETHREADED
-#endif
-
-#endif // !! ASSIMP_BUILD_BOOST_WORKAROUND
-
- //////////////////////////////////////////////////////////////////////////
- /* Define ASSIMP_BUILD_SINGLETHREADED to compile assimp
- * without threading support. The library doesn't utilize
- * threads then and is itself not threadsafe.
- * If this flag is specified boost::threads is *not* required. */
- //////////////////////////////////////////////////////////////////////////
-#ifndef ASSIMP_BUILD_SINGLETHREADED
-# define ASSIMP_BUILD_SINGLETHREADED
-#endif
-
-#ifndef ASSIMP_BUILD_SINGLETHREADED
-# define AI_C_THREADSAFE
-#endif // !! ASSIMP_BUILD_SINGLETHREADED
-
-#if (defined _DEBUG || defined DEBUG) // one of the two should be defined ..
-# define ASSIMP_BUILD_DEBUG
-#endif
-
- //////////////////////////////////////////////////////////////////////////
- /* ASSIMP_BUILD_XXXX_NNBIT_ARCHITECTURE */
- //////////////////////////////////////////////////////////////////////////
-#if defined(_MSC_VER)
- // See http://msdn.microsoft.com/en-us/library/b0084kay.
-# if defined(_M_IX86)
-# define ASSIMP_BUILD_X86_32BIT_ARCHITECTURE
-# elif defined(_M_X64)
-# define ASSIMP_BUILD_X86_64BIT_ARCHITECTURE
-# elif defined(_M_IA64)
-# define ASSIMP_BUILD_IA_64BIT_ARCHITECTURE
-# else
-# error unknown architecture
-# endif
-#elif defined(__GNUC__)
- // See http://gcc.gnu.org/onlinedocs/cpp/Predefined-Macros.html.
-# if defined(__x86_32__) || defined(__i386__)
-# define ASSIMP_BUILD_X86_32BIT_ARCHITECTURE
-# elif defined(__x86_64__)
-# define ASSIMP_BUILD_X86_64BIT_ARCHITECTURE
-# elif defined(__ppc__)
-# define ASSIMP_BUILD_PPC_32BIT_ARCHITECTURE
-# elif defined(__arm__)
-# define ASSIMP_BUILD_ARM_32BIT_ARCHITECTURE
-# else
-# error unknown architecture
-# endif
-#elif defined (__GCCE__)
-#define ASSIMP_BUILD_ARM_32BIT_ARCHITECTURE
-#elif defined (__arm__)
-#define ASSIMP_BUILD_ARM_32BIT_ARCHITECTURE
-#else //assume
-# error unknown compiler
-#endif
-
- //////////////////////////////////////////////////////////////////////////
- /* Useful constants */
- //////////////////////////////////////////////////////////////////////////
-
-/* This is PI. Hi PI. */
-#define AI_MATH_PI (3.141592653589793238462643383279 )
-#define AI_MATH_TWO_PI (AI_MATH_PI * 2.0)
-#define AI_MATH_HALF_PI (AI_MATH_PI * 0.5)
-
-/* And this is to avoid endless casts to float */
-#define AI_MATH_PI_F (3.1415926538f)
-#define AI_MATH_TWO_PI_F (AI_MATH_PI_F * 2.0f)
-#define AI_MATH_HALF_PI_F (AI_MATH_PI_F * 0.5f)
-
-/* Tiny macro to convert from radians to degrees and back */
-#define AI_DEG_TO_RAD(x) (x*0.0174532925f)
-#define AI_RAD_TO_DEG(x) (x*57.2957795f)
-
-/* Support for big-endian builds on Mac OS X. */
-#if defined(__APPLE__) && defined(__BIG_ENDIAN__)
-#define AI_BUILD_BIG_ENDIAN
-#endif
-
-#endif // !! INCLUDED_AI_DEFINES_H
diff --git a/3rdparty/assimp/include/aiFileIO.h b/3rdparty/assimp/include/aiFileIO.h
deleted file mode 100644
index bc012fde..00000000
--- a/3rdparty/assimp/include/aiFileIO.h
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file aiFileIO.h
- * @brief Defines generic C routines to access memory-mapped files
- */
-#ifndef AI_FILEIO_H_INC
-#define AI_FILEIO_H_INC
-
-#include "aiTypes.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-struct aiFileIO;
-struct aiFile;
-
-// aiFile callbacks
-typedef size_t (*aiFileWriteProc) (C_STRUCT aiFile*, const char*, size_t, size_t);
-typedef size_t (*aiFileReadProc) (C_STRUCT aiFile*, char*, size_t,size_t);
-typedef size_t (*aiFileTellProc) (C_STRUCT aiFile*);
-typedef void (*aiFileFlushProc) (C_STRUCT aiFile*);
-typedef aiReturn (*aiFileSeek)(C_STRUCT aiFile*, size_t, aiOrigin);
-
-// aiFileIO callbacks
-typedef aiFile* (*aiFileOpenProc) (C_STRUCT aiFileIO*, const char*, const char*);
-typedef void (*aiFileCloseProc) (C_STRUCT aiFileIO*, C_STRUCT aiFile*);
-
-// Represents user-defined data
-typedef char* aiUserData;
-
-// ----------------------------------------------------------------------------------
-/** @brief C-API: File system callbacks
- *
- * Provided are functions to open and close files. Supply a custom structure to
- * the import function. If you don't, a default implementation is used. Use custom
- * file systems to enable reading from other sources, such as ZIPs
- * or memory locations. */
-struct aiFileIO
-{
- /** Function used to open a new file
- */
- aiFileOpenProc OpenProc;
-
- /** Function used to close an existing file
- */
- aiFileCloseProc CloseProc;
-
- /** User-defined, opaque data */
- aiUserData UserData;
-};
-
-// ----------------------------------------------------------------------------------
-/** @brief C-API: File callbacks
- *
- * Actually, it's a data structure to wrap a set of fXXXX (e.g fopen)
- * replacement functions.
- *
- * The default implementation of the functions utilizes the fXXX functions from
- * the CRT. However, you can supply a custom implementation to Assimp by
- * delivering a custom aiFileIO. Use this to enable reading from other sources,
- * such as ZIP archives or memory locations. */
-struct aiFile
-{
- /** Callback to read from a file */
- aiFileReadProc ReadProc;
-
- /** Callback to write to a file */
- aiFileWriteProc WriteProc;
-
- /** Callback to retrieve the current position of
- * the file cursor (ftell())
- */
- aiFileTellProc TellProc;
-
- /** Callback to retrieve the size of the file,
- * in bytes
- */
- aiFileTellProc FileSizeProc;
-
- /** Callback to set the current position
- * of the file cursor (fseek())
- */
- aiFileSeek SeekProc;
-
- /** Callback to flush the file contents
- */
- aiFileFlushProc FlushProc;
-
- /** User-defined, opaque data
- */
- aiUserData UserData;
-};
-
-#ifdef __cplusplus
-}
-#endif
-#endif // AI_FILEIO_H_INC
diff --git a/3rdparty/assimp/include/aiLight.h b/3rdparty/assimp/include/aiLight.h
deleted file mode 100644
index 9d1ab10e..00000000
--- a/3rdparty/assimp/include/aiLight.h
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file aiLight.h
- * @brief Defines the aiLight data structure
- */
-
-#ifndef __AI_LIGHT_H_INC__
-#define __AI_LIGHT_H_INC__
-
-#include "aiTypes.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// ---------------------------------------------------------------------------
-/** Enumerates all supported types of light sources.
- */
-enum aiLightSourceType
-{
- aiLightSource_UNDEFINED = 0x0,
-
- //! A directional light source has a well-defined direction
- //! but is infinitely far away. That's quite a good
- //! approximation for sun light.
- aiLightSource_DIRECTIONAL = 0x1,
-
- //! A point light source has a well-defined position
- //! in space but no direction - it emits light in all
- //! directions. A normal bulb is a point light.
- aiLightSource_POINT = 0x2,
-
- //! A spot light source emits light in a specific
- //! angle. It has a position and a direction it is pointing to.
- //! A good example for a spot light is a light spot in
- //! sport arenas.
- aiLightSource_SPOT = 0x3,
-
-
- /** This value is not used. It is just there to force the
- * compiler to map this enum to a 32 Bit integer.
- */
-#ifndef SWIG
- _aiLightSource_Force32Bit = 0x9fffffff
-#endif
-};
-
-// ---------------------------------------------------------------------------
-/** Helper structure to describe a light source.
- *
- * Assimp supports multiple sorts of light sources, including
- * directional, point and spot lights. All of them are defined with just
- * a single structure and distinguished by their parameters.
- * Note - some file formats (such as 3DS, ASE) export a "target point" -
- * the point a spot light is looking at (it can even be animated). Assimp
- * writes the target point as a subnode of a spotlights's main node,
- * called "<spotName>.Target". However, this is just additional information
- * then, the transformation tracks of the main node make the
- * spot light already point in the right direction.
-*/
-struct aiLight
-{
- /** The name of the light source.
- *
- * There must be a node in the scenegraph with the same name.
- * This node specifies the position of the light in the scene
- * hierarchy and can be animated.
- */
- C_STRUCT aiString mName;
-
- /** The type of the light source.
- *
- * aiLightSource_UNDEFINED is not a valid value for this member.
- */
- C_ENUM aiLightSourceType mType;
-
- /** Position of the light source in space. Relative to the
- * transformation of the node corresponding to the light.
- *
- * The position is undefined for directional lights.
- */
- C_STRUCT aiVector3D mPosition;
-
- /** Direction of the light source in space. Relative to the
- * transformation of the node corresponding to the light.
- *
- * The direction is undefined for point lights. The vector
- * may be normalized, but it needn't.
- */
- C_STRUCT aiVector3D mDirection;
-
- /** Constant light attenuation factor.
- *
- * The intensity of the light source at a given distance 'd' from
- * the light's position is
- * @code
- * Atten = 1/( att0 + att1 * d + att2 * d*d)
- * @endcode
- * This member corresponds to the att0 variable in the equation.
- * Naturally undefined for directional lights.
- */
- float mAttenuationConstant;
-
- /** Linear light attenuation factor.
- *
- * The intensity of the light source at a given distance 'd' from
- * the light's position is
- * @code
- * Atten = 1/( att0 + att1 * d + att2 * d*d)
- * @endcode
- * This member corresponds to the att1 variable in the equation.
- * Naturally undefined for directional lights.
- */
- float mAttenuationLinear;
-
- /** Quadratic light attenuation factor.
- *
- * The intensity of the light source at a given distance 'd' from
- * the light's position is
- * @code
- * Atten = 1/( att0 + att1 * d + att2 * d*d)
- * @endcode
- * This member corresponds to the att2 variable in the equation.
- * Naturally undefined for directional lights.
- */
- float mAttenuationQuadratic;
-
- /** Diffuse color of the light source
- *
- * The diffuse light color is multiplied with the diffuse
- * material color to obtain the final color that contributes
- * to the diffuse shading term.
- */
- C_STRUCT aiColor3D mColorDiffuse;
-
- /** Specular color of the light source
- *
- * The specular light color is multiplied with the specular
- * material color to obtain the final color that contributes
- * to the specular shading term.
- */
- C_STRUCT aiColor3D mColorSpecular;
-
- /** Ambient color of the light source
- *
- * The ambient light color is multiplied with the ambient
- * material color to obtain the final color that contributes
- * to the ambient shading term. Most renderers will ignore
- * this value it, is just a remaining of the fixed-function pipeline
- * that is still supported by quite many file formats.
- */
- C_STRUCT aiColor3D mColorAmbient;
-
- /** Inner angle of a spot light's light cone.
- *
- * The spot light has maximum influence on objects inside this
- * angle. The angle is given in radians. It is 2PI for point
- * lights and undefined for directional lights.
- */
- float mAngleInnerCone;
-
- /** Outer angle of a spot light's light cone.
- *
- * The spot light does not affect objects outside this angle.
- * The angle is given in radians. It is 2PI for point lights and
- * undefined for directional lights. The outer angle must be
- * greater than or equal to the inner angle.
- * It is assumed that the application uses a smooth
- * interpolation between the inner and the outer cone of the
- * spot light.
- */
- float mAngleOuterCone;
-
-#ifdef __cplusplus
-
- aiLight()
- : mType (aiLightSource_UNDEFINED)
- , mAttenuationConstant (0.f)
- , mAttenuationLinear (1.f)
- , mAttenuationQuadratic (0.f)
- , mAngleInnerCone ((float)AI_MATH_TWO_PI)
- , mAngleOuterCone ((float)AI_MATH_TWO_PI)
- {
- }
-
-#endif
-};
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif // !! __AI_LIGHT_H_INC__
diff --git a/3rdparty/assimp/include/aiMaterial.h b/3rdparty/assimp/include/aiMaterial.h
deleted file mode 100644
index 34914d23..00000000
--- a/3rdparty/assimp/include/aiMaterial.h
+++ /dev/null
@@ -1,1422 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file aiMaterial.h
- * @brief Defines the material system of the library
- */
-
-#ifndef AI_MATERIAL_H_INC
-#define AI_MATERIAL_H_INC
-
-#include "aiTypes.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// Name for default materials (2nd is used if meshes have UV coords)
-#define AI_DEFAULT_MATERIAL_NAME "DefaultMaterial"
-#define AI_DEFAULT_TEXTURED_MATERIAL_NAME "TexturedDefaultMaterial"
-
-// ---------------------------------------------------------------------------
-/** @brief Defines how the Nth texture of a specific type is combined with
- * the result of all previous layers.
- *
- * Example (left: key, right: value): <br>
- * @code
- * DiffColor0 - gray
- * DiffTextureOp0 - aiTextureOpMultiply
- * DiffTexture0 - tex1.png
- * DiffTextureOp0 - aiTextureOpAdd
- * DiffTexture1 - tex2.png
- * @endcode
- * Written as equation, the final diffuse term for a specific pixel would be:
- * @code
- * diffFinal = DiffColor0 * sampleTex(DiffTexture0,UV0) +
- * sampleTex(DiffTexture1,UV0) * diffContrib;
- * @endcode
- * where 'diffContrib' is the intensity of the incoming light for that pixel.
- */
-enum aiTextureOp
-{
- /** T = T1 * T2 */
- aiTextureOp_Multiply = 0x0,
-
- /** T = T1 + T2 */
- aiTextureOp_Add = 0x1,
-
- /** T = T1 - T2 */
- aiTextureOp_Subtract = 0x2,
-
- /** T = T1 / T2 */
- aiTextureOp_Divide = 0x3,
-
- /** T = (T1 + T2) - (T1 * T2) */
- aiTextureOp_SmoothAdd = 0x4,
-
- /** T = T1 + (T2-0.5) */
- aiTextureOp_SignedAdd = 0x5,
-
-
- /** @cond never
- * This value is not used. It forces the compiler to use at least
- * 32 Bit integers to represent this enum.
- */
-#ifndef SWIG
- _aiTextureOp_Force32Bit = 0x9fffffff
-#endif
- //! @endcond
-};
-
-// ---------------------------------------------------------------------------
-/** @brief Defines how UV coordinates outside the [0...1] range are handled.
- *
- * Commonly refered to as 'wrapping mode'.
- */
-enum aiTextureMapMode
-{
- /** A texture coordinate u|v is translated to u%1|v%1
- */
- aiTextureMapMode_Wrap = 0x0,
-
- /** Texture coordinates outside [0...1]
- * are clamped to the nearest valid value.
- */
- aiTextureMapMode_Clamp = 0x1,
-
- /** If the texture coordinates for a pixel are outside [0...1]
- * the texture is not applied to that pixel
- */
- aiTextureMapMode_Decal = 0x3,
-
- /** A texture coordinate u|v becomes u%1|v%1 if (u-(u%1))%2 is zero and
- * 1-(u%1)|1-(v%1) otherwise
- */
- aiTextureMapMode_Mirror = 0x2,
-
- /** @cond never
- * This value is not used. It forces the compiler to use at least
- * 32 Bit integers to represent this enum.
- */
-#ifndef SWIG
- _aiTextureMapMode_Force32Bit = 0x9fffffff
-#endif
- //! @endcond
-};
-
-// ---------------------------------------------------------------------------
-/** @brief Defines how the mapping coords for a texture are generated.
- *
- * Real-time applications typically require full UV coordinates, so the use of
- * the aiProcess_GenUVCoords step is highly recommended. It generates proper
- * UV channels for non-UV mapped objects, as long as an accurate description
- * how the mapping should look like (e.g spherical) is given.
- * See the #AI_MATKEY_MAPPING property for more details.
- */
-enum aiTextureMapping
-{
- /** The mapping coordinates are taken from an UV channel.
- *
- * The #AI_MATKEY_UVWSRC key specifies from which UV channel
- * the texture coordinates are to be taken from (remember,
- * meshes can have more than one UV channel).
- */
- aiTextureMapping_UV = 0x0,
-
- /** Spherical mapping */
- aiTextureMapping_SPHERE = 0x1,
-
- /** Cylindrical mapping */
- aiTextureMapping_CYLINDER = 0x2,
-
- /** Cubic mapping */
- aiTextureMapping_BOX = 0x3,
-
- /** Planar mapping */
- aiTextureMapping_PLANE = 0x4,
-
- /** Undefined mapping. Have fun. */
- aiTextureMapping_OTHER = 0x5,
-
-
- /** @cond never
- * This value is not used. It forces the compiler to use at least
- * 32 Bit integers to represent this enum.
- */
-#ifndef SWIG
- _aiTextureMapping_Force32Bit = 0x9fffffff
-#endif
- //! @endcond
-};
-
-// ---------------------------------------------------------------------------
-/** @brief Defines the purpose of a texture
- *
- * This is a very difficult topic. Different 3D packages support different
- * kinds of textures. For very common texture types, such as bumpmaps, the
- * rendering results depend on implementation details in the rendering
- * pipelines of these applications. Assimp loads all texture references from
- * the model file and tries to determine which of the predefined texture
- * types below is the best choice to match the original use of the texture
- * as closely as possible.<br>
- *
- * In content pipelines you'll usually define how textures have to be handled,
- * and the artists working on models have to conform to this specification,
- * regardless which 3D tool they're using.
- */
-enum aiTextureType
-{
- /** Dummy value.
- *
- * No texture, but the value to be used as 'texture semantic'
- * (#aiMaterialProperty::mSemantic) for all material properties
- * *not* related to textures.
- */
- aiTextureType_NONE = 0x0,
-
-
-
- /** The texture is combined with the result of the diffuse
- * lighting equation.
- */
- aiTextureType_DIFFUSE = 0x1,
-
- /** The texture is combined with the result of the specular
- * lighting equation.
- */
- aiTextureType_SPECULAR = 0x2,
-
- /** The texture is combined with the result of the ambient
- * lighting equation.
- */
- aiTextureType_AMBIENT = 0x3,
-
- /** The texture is added to the result of the lighting
- * calculation. It isn't influenced by incoming light.
- */
- aiTextureType_EMISSIVE = 0x4,
-
- /** The texture is a height map.
- *
- * By convention, higher gray-scale values stand for
- * higher elevations from the base height.
- */
- aiTextureType_HEIGHT = 0x5,
-
- /** The texture is a (tangent space) normal-map.
- *
- * Again, there are several conventions for tangent-space
- * normal maps. Assimp does (intentionally) not
- * distinguish here.
- */
- aiTextureType_NORMALS = 0x6,
-
- /** The texture defines the glossiness of the material.
- *
- * The glossiness is in fact the exponent of the specular
- * (phong) lighting equation. Usually there is a conversion
- * function defined to map the linear color values in the
- * texture to a suitable exponent. Have fun.
- */
- aiTextureType_SHININESS = 0x7,
-
- /** The texture defines per-pixel opacity.
- *
- * Usually 'white' means opaque and 'black' means
- * 'transparency'. Or quite the opposite. Have fun.
- */
- aiTextureType_OPACITY = 0x8,
-
- /** Displacement texture
- *
- * The exact purpose and format is application-dependent.
- * Higher color values stand for higher vertex displacements.
- */
- aiTextureType_DISPLACEMENT = 0x9,
-
- /** Lightmap texture (aka Ambient Occlusion)
- *
- * Both 'Lightmaps' and dedicated 'ambient occlusion maps' are
- * covered by this material property. The texture contains a
- * scaling value for the final color value of a pixel. Its
- * intensity is not affected by incoming light.
- */
- aiTextureType_LIGHTMAP = 0xA,
-
- /** Reflection texture
- *
- * Contains the color of a perfect mirror reflection.
- * Rarely used, almost never for real-time applications.
- */
- aiTextureType_REFLECTION = 0xB,
-
- /** Unknown texture
- *
- * A texture reference that does not match any of the definitions
- * above is considered to be 'unknown'. It is still imported,
- * but is excluded from any further postprocessing.
- */
- aiTextureType_UNKNOWN = 0xC,
-
-
- /** @cond never
- * This value is not used. It forces the compiler to use at least
- * 32 Bit integers to represent this enum.
- */
-#ifndef SWIG
- _aiTextureType_Force32Bit = 0x9fffffff
-#endif
- //! @endcond
-};
-
-#define AI_TEXTURE_TYPE_MAX aiTextureType_UNKNOWN
-
-// ---------------------------------------------------------------------------
-/** @brief Defines all shading models supported by the library
- *
- * The list of shading modes has been taken from Blender.
- * See Blender documentation for more information. The API does
- * not distinguish between "specular" and "diffuse" shaders (thus the
- * specular term for diffuse shading models like Oren-Nayar remains
- * undefined). <br>
- * Again, this value is just a hint. Assimp tries to select the shader whose
- * most common implementation matches the original rendering results of the
- * 3D modeller which wrote a particular model as closely as possible.
- */
-enum aiShadingMode
-{
- /** Flat shading. Shading is done on per-face base,
- * diffuse only. Also known as 'faceted shading'.
- */
- aiShadingMode_Flat = 0x1,
-
- /** Simple Gouraud shading.
- */
- aiShadingMode_Gouraud = 0x2,
-
- /** Phong-Shading -
- */
- aiShadingMode_Phong = 0x3,
-
- /** Phong-Blinn-Shading
- */
- aiShadingMode_Blinn = 0x4,
-
- /** Toon-Shading per pixel
- *
- * Also known as 'comic' shader.
- */
- aiShadingMode_Toon = 0x5,
-
- /** OrenNayar-Shading per pixel
- *
- * Extension to standard Lambertian shading, taking the
- * roughness of the material into account
- */
- aiShadingMode_OrenNayar = 0x6,
-
- /** Minnaert-Shading per pixel
- *
- * Extension to standard Lambertian shading, taking the
- * "darkness" of the material into account
- */
- aiShadingMode_Minnaert = 0x7,
-
- /** CookTorrance-Shading per pixel
- *
- * Special shader for metallic surfaces.
- */
- aiShadingMode_CookTorrance = 0x8,
-
- /** No shading at all. Constant light influence of 1.0.
- */
- aiShadingMode_NoShading = 0x9,
-
- /** Fresnel shading
- */
- aiShadingMode_Fresnel = 0xa,
-
-
- /** @cond never
- * This value is not used. It forces the compiler to use at least
- * 32 Bit integers to represent this enum.
- */
-#ifndef SWIG
- _aiShadingMode_Force32Bit = 0x9fffffff
-#endif
- //! @endcond
-};
-
-
-// ---------------------------------------------------------------------------
-/** @brief Defines some mixed flags for a particular texture.
- *
- * Usually you'll instruct your cg artists how textures have to look like ...
- * and how they will be processed in your application. However, if you use
- * Assimp for completely generic loading purposes you might also need to
- * process these flags in order to display as many 'unknown' 3D models as
- * possible correctly.
- *
- * This corresponds to the #AI_MATKEY_TEXFLAGS property.
-*/
-enum aiTextureFlags
-{
- /** The texture's color values have to be inverted (componentwise 1-n)
- */
- aiTextureFlags_Invert = 0x1,
-
- /** Explicit request to the application to process the alpha channel
- * of the texture.
- *
- * Mutually exclusive with #aiTextureFlags_IgnoreAlpha. These
- * flags are set if the library can say for sure that the alpha
- * channel is used/is not used. If the model format does not
- * define this, it is left to the application to decide whether
- * the texture alpha channel - if any - is evaluated or not.
- */
- aiTextureFlags_UseAlpha = 0x2,
-
- /** Explicit request to the application to ignore the alpha channel
- * of the texture.
- *
- * Mutually exclusive with #aiTextureFlags_UseAlpha.
- */
- aiTextureFlags_IgnoreAlpha = 0x4,
-
- /** @cond never
- * This value is not used. It forces the compiler to use at least
- * 32 Bit integers to represent this enum.
- */
-#ifndef SWIG
- _aiTextureFlags_Force32Bit = 0x9fffffff
-#endif
- //! @endcond
-};
-
-
-// ---------------------------------------------------------------------------
-/** @brief Defines alpha-blend flags.
- *
- * If you're familiar with OpenGL or D3D, these flags aren't new to you.
- * They define *how* the final color value of a pixel is computed, basing
- * on the previous color at that pixel and the new color value from the
- * material.
- * The blend formula is:
- * @code
- * SourceColor * SourceBlend + DestColor * DestBlend
- * @endcode
- * where <DestColor> is the previous color in the framebuffer at this
- * position and <SourceColor> is the material colro before the transparency
- * calculation.<br>
- * This corresponds to the #AI_MATKEY_BLEND_FUNC property.
-*/
-enum aiBlendMode
-{
- /**
- * Formula:
- * @code
- * SourceColor*SourceAlpha + DestColor*(1-SourceAlpha)
- * @endcode
- */
- aiBlendMode_Default = 0x0,
-
- /** Additive blending
- *
- * Formula:
- * @code
- * SourceColor*1 + DestColor*1
- * @endcode
- */
- aiBlendMode_Additive = 0x1,
-
- // we don't need more for the moment, but we might need them
- // in future versions ...
-
- /** @cond never
- * This value is not used. It forces the compiler to use at least
- * 32 Bit integers to represent this enum.
- */
-#ifndef SWIG
- _aiBlendMode_Force32Bit = 0x9fffffff
-#endif
- //! @endcond
-};
-
-
-#include "./Compiler/pushpack1.h"
-
-// ---------------------------------------------------------------------------
-/** @brief Defines how an UV channel is transformed.
- *
- * This is just a helper structure for the #AI_MATKEY_UVTRANSFORM key.
- * See its documentation for more details.
- *
- * Typically you'll want to build a matrix of this information. However,
- * we keep separate scaling/translation/rotation values to make it
- * easier to process and optimize UV transformations internally.
- */
-struct aiUVTransform
-{
- /** Translation on the u and v axes.
- *
- * The default value is (0|0).
- */
- C_STRUCT aiVector2D mTranslation;
-
- /** Scaling on the u and v axes.
- *
- * The default value is (1|1).
- */
- C_STRUCT aiVector2D mScaling;
-
- /** Rotation - in counter-clockwise direction.
- *
- * The rotation angle is specified in radians. The
- * rotation center is 0.5f|0.5f. The default value
- * 0.f.
- */
- float mRotation;
-
-
-#ifdef __cplusplus
- aiUVTransform()
- : mScaling (1.f,1.f)
- , mRotation (0.f)
- {
- // nothing to be done here ...
- }
-#endif
-
-} PACK_STRUCT;
-
-#include "./Compiler/poppack1.h"
-
-//! @cond AI_DOX_INCLUDE_INTERNAL
-// ---------------------------------------------------------------------------
-/** @brief A very primitive RTTI system for the contents of material
- * properties.
- */
-enum aiPropertyTypeInfo
-{
- /** Array of single-precision (32 Bit) floats
- *
- * It is possible to use aiGetMaterialInteger[Array]() (or the C++-API
- * aiMaterial::Get()) to query properties stored in floating-point format.
- * The material system performs the type conversion automatically.
- */
- aiPTI_Float = 0x1,
-
- /** The material property is an aiString.
- *
- * Arrays of strings aren't possible, aiGetMaterialString() (or the
- * C++-API aiMaterial::Get()) *must* be used to query a string property.
- */
- aiPTI_String = 0x3,
-
- /** Array of (32 Bit) integers
- *
- * It is possible to use aiGetMaterialFloat[Array]() (or the C++-API
- * aiMaterial::Get()) to query properties stored in integer format.
- * The material system performs the type conversion automatically.
- */
- aiPTI_Integer = 0x4,
-
-
- /** Simple binary buffer, content undefined. Not convertible to anything.
- */
- aiPTI_Buffer = 0x5,
-
-
- /** This value is not used. It is just there to force the
- * compiler to map this enum to a 32 Bit integer.
- */
-#ifndef SWIG
- _aiPTI_Force32Bit = 0x9fffffff
-#endif
-};
-
-// ---------------------------------------------------------------------------
-/** @brief Data structure for a single material property
- *
- * As an user, you'll probably never need to deal with this data structure.
- * Just use the provided aiGetMaterialXXX() or aiMaterial::Get() family
- * of functions to query material properties easily. Processing them
- * manually is faster, but it is not the recommended way. It isn't worth
- * the effort. <br>
- * Material property names follow a simple scheme:
- * @code
- * $<name>
- * ?<name>
- * A public property, there must be corresponding AI_MATKEY_XXX define
- * 2nd: Public, but ignored by the #aiProcess_RemoveRedundantMaterials
- * post-processing step.
- * ~<name>
- * A temporary property for internal use.
- * @endcode
- * @see aiMaterial
- */
-struct aiMaterialProperty
-{
- /** Specifies the name of the property (key)
- * Keys are generally case insensitive.
- */
- C_STRUCT aiString mKey;
-
- /** Textures: Specifies their exact usage semantic.
- * For non-texture properties, this member is always 0
- * (or, better-said, #aiTextureType_NONE).
- */
- unsigned int mSemantic;
-
- /** Textures: Specifies the index of the texture.
- * For non-texture properties, this member is always 0.
- */
- unsigned int mIndex;
-
- /** Size of the buffer mData is pointing to, in bytes.
- * This value may not be 0.
- */
- unsigned int mDataLength;
-
- /** Type information for the property.
- *
- * Defines the data layout inside the data buffer. This is used
- * by the library internally to perform debug checks and to
- * utilize proper type conversions.
- * (It's probably a hacky solution, but it works.)
- */
- C_ENUM aiPropertyTypeInfo mType;
-
- /** Binary buffer to hold the property's value.
- * The size of the buffer is always mDataLength.
- */
- char* mData;
-
-#ifdef __cplusplus
-
- aiMaterialProperty() {
- mData = NULL;
- mIndex = mSemantic = 0;
- }
-
- ~aiMaterialProperty() {
- delete[] mData;
- }
-
-#endif
-};
-//! @endcond
-
-#ifdef __cplusplus
-} // We need to leave the "C" block here to allow template member functions
-#endif
-
-// ---------------------------------------------------------------------------
-/** @brief Data structure for a material
-*
-* Material data is stored using a key-value structure. A single key-value
-* pair is called a 'material property'. C++ users should use the provided
-* member functions of aiMaterial to process material properties, C users
-* have to stick with the aiMaterialGetXXX family of unbound functions.
-* The library defines a set of standard keys (AI_MATKEY_XXX).
-*/
-struct ASSIMP_API aiMaterial
-{
-
-#ifdef __cplusplus
-
- /// NOTE: no initialization, instance Assimp::MaterialHelper instead
- aiMaterial() {}
-
-public:
-
- ~aiMaterial();
-
- // -------------------------------------------------------------------
- /** @brief Retrieve an array of Type values with a specific key
- * from the material
- *
- * @param pKey Key to search for. One of the AI_MATKEY_XXX constants.
- * @param type .. set by AI_MATKEY_XXX
- * @param idx .. set by AI_MATKEY_XXX
- * @param pOut Pointer to a buffer to receive the result.
- * @param pMax Specifies the size of the given buffer, in Type's.
- * Receives the number of values (not bytes!) read.
- * NULL is a valid value for this parameter.
- */
- template <typename Type>
- aiReturn Get(const char* pKey,unsigned int type,
- unsigned int idx, Type* pOut, unsigned int* pMax) const;
-
- // -------------------------------------------------------------------
- /** @brief Retrieve a Type value with a specific key
- * from the material
- *
- * @param pKey Key to search for. One of the AI_MATKEY_XXX constants.
- * @param type Specifies the type of the texture to be retrieved (
- * e.g. diffuse, specular, height map ...)
- * @param idx Index of the texture to be retrieved.
- * @param pOut Reference to receive the output value
- */
- template <typename Type>
- aiReturn Get(const char* pKey,unsigned int type,
- unsigned int idx,Type& pOut) const;
-
- // -------------------------------------------------------------------
- /** Get the number of textures for a particular texture type.
- * @param type Texture type to check for
- * @return Number of textures for this type.
- * @note A texture can be easily queried using #GetTexture() */
- unsigned int GetTextureCount(aiTextureType type) const;
-
- // -------------------------------------------------------------------
- /** Helper function to get all parameters pertaining to a
- * particular texture slot from a material.
- *
- * This function is provided just for convenience, you could also
- * read the single material properties manually.
- * @param type Specifies the type of the texture to be retrieved (
- * e.g. diffuse, specular, height map ...)
- * @param index Index of the texture to be retrieved. The function fails
- * if there is no texture of that type with this index.
- * #GetTextureCount() can be used to determine the number of textures
- * per texture type.
- * @param path Receives the path to the texture.
- * NULL is a valid value.
- * @param mapping The texture mapping.
- * NULL is allowed as value.
- * @param uvindex Receives the UV index of the texture.
- * NULL is a valid value.
- * @param blend Receives the blend factor for the texture
- * NULL is a valid value.
- * @param op Receives the texture operation to be performed between
- * this texture and the previous texture. NULL is allowed as value.
- * @param mapmode Receives the mapping modes to be used for the texture.
- * The parameter may be NULL but if it is a valid pointer it MUST
- * point to an array of 3 aiTextureMapMode's (one for each
- * axis: UVW order (=XYZ)).
- */
- // -------------------------------------------------------------------
- aiReturn GetTexture(aiTextureType type,
- unsigned int index,
- C_STRUCT aiString* path,
- aiTextureMapping* mapping = NULL,
- unsigned int* uvindex = NULL,
- float* blend = NULL,
- aiTextureOp* op = NULL,
- aiTextureMapMode* mapmode = NULL) const;
-
-#endif
-
- /** List of all material properties loaded. */
- C_STRUCT aiMaterialProperty** mProperties;
-
- /** Number of properties in the data base */
- unsigned int mNumProperties;
-
- /** Storage allocated */
- unsigned int mNumAllocated;
-};
-
-// Go back to extern "C" again
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// ---------------------------------------------------------------------------
-#define AI_MATKEY_NAME "?mat.name",0,0
-#define AI_MATKEY_TWOSIDED "$mat.twosided",0,0
-#define AI_MATKEY_SHADING_MODEL "$mat.shadingm",0,0
-#define AI_MATKEY_ENABLE_WIREFRAME "$mat.wireframe",0,0
-#define AI_MATKEY_BLEND_FUNC "$mat.blend",0,0
-#define AI_MATKEY_OPACITY "$mat.opacity",0,0
-#define AI_MATKEY_BUMPSCALING "$mat.bumpscaling",0,0
-#define AI_MATKEY_SHININESS "$mat.shininess",0,0
-#define AI_MATKEY_REFLECTIVITY "$mat.reflectivity",0,0
-#define AI_MATKEY_SHININESS_STRENGTH "$mat.shinpercent",0,0
-#define AI_MATKEY_REFRACTI "$mat.refracti",0,0
-#define AI_MATKEY_COLOR_DIFFUSE "$clr.diffuse",0,0
-#define AI_MATKEY_COLOR_AMBIENT "$clr.ambient",0,0
-#define AI_MATKEY_COLOR_SPECULAR "$clr.specular",0,0
-#define AI_MATKEY_COLOR_EMISSIVE "$clr.emissive",0,0
-#define AI_MATKEY_COLOR_TRANSPARENT "$clr.transparent",0,0
-#define AI_MATKEY_COLOR_REFLECTIVE "$clr.reflective",0,0
-#define AI_MATKEY_GLOBAL_BACKGROUND_IMAGE "?bg.global",0,0
-
-// ---------------------------------------------------------------------------
-// Pure key names for all texture-related properties
-//! @cond MATS_DOC_FULL
-#define _AI_MATKEY_TEXTURE_BASE "$tex.file"
-#define _AI_MATKEY_UVWSRC_BASE "$tex.uvwsrc"
-#define _AI_MATKEY_TEXOP_BASE "$tex.op"
-#define _AI_MATKEY_MAPPING_BASE "$tex.mapping"
-#define _AI_MATKEY_TEXBLEND_BASE "$tex.blend"
-#define _AI_MATKEY_MAPPINGMODE_U_BASE "$tex.mapmodeu"
-#define _AI_MATKEY_MAPPINGMODE_V_BASE "$tex.mapmodev"
-#define _AI_MATKEY_TEXMAP_AXIS_BASE "$tex.mapaxis"
-#define _AI_MATKEY_UVTRANSFORM_BASE "$tex.uvtrafo"
-#define _AI_MATKEY_TEXFLAGS_BASE "$tex.flags"
-//! @endcond
-
-// ---------------------------------------------------------------------------
-#define AI_MATKEY_TEXTURE(type, N) _AI_MATKEY_TEXTURE_BASE,type,N
-
-// For backward compatibility and simplicity
-//! @cond MATS_DOC_FULL
-#define AI_MATKEY_TEXTURE_DIFFUSE(N) \
- AI_MATKEY_TEXTURE(aiTextureType_DIFFUSE,N)
-
-#define AI_MATKEY_TEXTURE_SPECULAR(N) \
- AI_MATKEY_TEXTURE(aiTextureType_SPECULAR,N)
-
-#define AI_MATKEY_TEXTURE_AMBIENT(N) \
- AI_MATKEY_TEXTURE(aiTextureType_AMBIENT,N)
-
-#define AI_MATKEY_TEXTURE_EMISSIVE(N) \
- AI_MATKEY_TEXTURE(aiTextureType_EMISSIVE,N)
-
-#define AI_MATKEY_TEXTURE_NORMALS(N) \
- AI_MATKEY_TEXTURE(aiTextureType_NORMALS,N)
-
-#define AI_MATKEY_TEXTURE_HEIGHT(N) \
- AI_MATKEY_TEXTURE(aiTextureType_HEIGHT,N)
-
-#define AI_MATKEY_TEXTURE_SHININESS(N) \
- AI_MATKEY_TEXTURE(aiTextureType_SHININESS,N)
-
-#define AI_MATKEY_TEXTURE_OPACITY(N) \
- AI_MATKEY_TEXTURE(aiTextureType_OPACITY,N)
-
-#define AI_MATKEY_TEXTURE_DISPLACEMENT(N) \
- AI_MATKEY_TEXTURE(aiTextureType_DISPLACEMENT,N)
-
-#define AI_MATKEY_TEXTURE_LIGHTMAP(N) \
- AI_MATKEY_TEXTURE(aiTextureType_LIGHTMAP,N)
-
-#define AI_MATKEY_TEXTURE_REFLECTION(N) \
- AI_MATKEY_TEXTURE(aiTextureType_REFLECTION,N)
-
-//! @endcond
-
-// ---------------------------------------------------------------------------
-#define AI_MATKEY_UVWSRC(type, N) _AI_MATKEY_UVWSRC_BASE,type,N
-
-// For backward compatibility and simplicity
-//! @cond MATS_DOC_FULL
-#define AI_MATKEY_UVWSRC_DIFFUSE(N) \
- AI_MATKEY_UVWSRC(aiTextureType_DIFFUSE,N)
-
-#define AI_MATKEY_UVWSRC_SPECULAR(N) \
- AI_MATKEY_UVWSRC(aiTextureType_SPECULAR,N)
-
-#define AI_MATKEY_UVWSRC_AMBIENT(N) \
- AI_MATKEY_UVWSRC(aiTextureType_AMBIENT,N)
-
-#define AI_MATKEY_UVWSRC_EMISSIVE(N) \
- AI_MATKEY_UVWSRC(aiTextureType_EMISSIVE,N)
-
-#define AI_MATKEY_UVWSRC_NORMALS(N) \
- AI_MATKEY_UVWSRC(aiTextureType_NORMALS,N)
-
-#define AI_MATKEY_UVWSRC_HEIGHT(N) \
- AI_MATKEY_UVWSRC(aiTextureType_HEIGHT,N)
-
-#define AI_MATKEY_UVWSRC_SHININESS(N) \
- AI_MATKEY_UVWSRC(aiTextureType_SHININESS,N)
-
-#define AI_MATKEY_UVWSRC_OPACITY(N) \
- AI_MATKEY_UVWSRC(aiTextureType_OPACITY,N)
-
-#define AI_MATKEY_UVWSRC_DISPLACEMENT(N) \
- AI_MATKEY_UVWSRC(aiTextureType_DISPLACEMENT,N)
-
-#define AI_MATKEY_UVWSRC_LIGHTMAP(N) \
- AI_MATKEY_UVWSRC(aiTextureType_LIGHTMAP,N)
-
-#define AI_MATKEY_UVWSRC_REFLECTION(N) \
- AI_MATKEY_UVWSRC(aiTextureType_REFLECTION,N)
-
-//! @endcond
-// ---------------------------------------------------------------------------
-#define AI_MATKEY_TEXOP(type, N) _AI_MATKEY_TEXOP_BASE,type,N
-
-// For backward compatibility and simplicity
-//! @cond MATS_DOC_FULL
-#define AI_MATKEY_TEXOP_DIFFUSE(N) \
- AI_MATKEY_TEXOP(aiTextureType_DIFFUSE,N)
-
-#define AI_MATKEY_TEXOP_SPECULAR(N) \
- AI_MATKEY_TEXOP(aiTextureType_SPECULAR,N)
-
-#define AI_MATKEY_TEXOP_AMBIENT(N) \
- AI_MATKEY_TEXOP(aiTextureType_AMBIENT,N)
-
-#define AI_MATKEY_TEXOP_EMISSIVE(N) \
- AI_MATKEY_TEXOP(aiTextureType_EMISSIVE,N)
-
-#define AI_MATKEY_TEXOP_NORMALS(N) \
- AI_MATKEY_TEXOP(aiTextureType_NORMALS,N)
-
-#define AI_MATKEY_TEXOP_HEIGHT(N) \
- AI_MATKEY_TEXOP(aiTextureType_HEIGHT,N)
-
-#define AI_MATKEY_TEXOP_SHININESS(N) \
- AI_MATKEY_TEXOP(aiTextureType_SHININESS,N)
-
-#define AI_MATKEY_TEXOP_OPACITY(N) \
- AI_MATKEY_TEXOP(aiTextureType_OPACITY,N)
-
-#define AI_MATKEY_TEXOP_DISPLACEMENT(N) \
- AI_MATKEY_TEXOP(aiTextureType_DISPLACEMENT,N)
-
-#define AI_MATKEY_TEXOP_LIGHTMAP(N) \
- AI_MATKEY_TEXOP(aiTextureType_LIGHTMAP,N)
-
-#define AI_MATKEY_TEXOP_REFLECTION(N) \
- AI_MATKEY_TEXOP(aiTextureType_REFLECTION,N)
-
-//! @endcond
-// ---------------------------------------------------------------------------
-#define AI_MATKEY_MAPPING(type, N) _AI_MATKEY_MAPPING_BASE,type,N
-
-// For backward compatibility and simplicity
-//! @cond MATS_DOC_FULL
-#define AI_MATKEY_MAPPING_DIFFUSE(N) \
- AI_MATKEY_MAPPING(aiTextureType_DIFFUSE,N)
-
-#define AI_MATKEY_MAPPING_SPECULAR(N) \
- AI_MATKEY_MAPPING(aiTextureType_SPECULAR,N)
-
-#define AI_MATKEY_MAPPING_AMBIENT(N) \
- AI_MATKEY_MAPPING(aiTextureType_AMBIENT,N)
-
-#define AI_MATKEY_MAPPING_EMISSIVE(N) \
- AI_MATKEY_MAPPING(aiTextureType_EMISSIVE,N)
-
-#define AI_MATKEY_MAPPING_NORMALS(N) \
- AI_MATKEY_MAPPING(aiTextureType_NORMALS,N)
-
-#define AI_MATKEY_MAPPING_HEIGHT(N) \
- AI_MATKEY_MAPPING(aiTextureType_HEIGHT,N)
-
-#define AI_MATKEY_MAPPING_SHININESS(N) \
- AI_MATKEY_MAPPING(aiTextureType_SHININESS,N)
-
-#define AI_MATKEY_MAPPING_OPACITY(N) \
- AI_MATKEY_MAPPING(aiTextureType_OPACITY,N)
-
-#define AI_MATKEY_MAPPING_DISPLACEMENT(N) \
- AI_MATKEY_MAPPING(aiTextureType_DISPLACEMENT,N)
-
-#define AI_MATKEY_MAPPING_LIGHTMAP(N) \
- AI_MATKEY_MAPPING(aiTextureType_LIGHTMAP,N)
-
-#define AI_MATKEY_MAPPING_REFLECTION(N) \
- AI_MATKEY_MAPPING(aiTextureType_REFLECTION,N)
-
-//! @endcond
-// ---------------------------------------------------------------------------
-#define AI_MATKEY_TEXBLEND(type, N) _AI_MATKEY_TEXBLEND_BASE,type,N
-
-// For backward compatibility and simplicity
-//! @cond MATS_DOC_FULL
-#define AI_MATKEY_TEXBLEND_DIFFUSE(N) \
- AI_MATKEY_TEXBLEND(aiTextureType_DIFFUSE,N)
-
-#define AI_MATKEY_TEXBLEND_SPECULAR(N) \
- AI_MATKEY_TEXBLEND(aiTextureType_SPECULAR,N)
-
-#define AI_MATKEY_TEXBLEND_AMBIENT(N) \
- AI_MATKEY_TEXBLEND(aiTextureType_AMBIENT,N)
-
-#define AI_MATKEY_TEXBLEND_EMISSIVE(N) \
- AI_MATKEY_TEXBLEND(aiTextureType_EMISSIVE,N)
-
-#define AI_MATKEY_TEXBLEND_NORMALS(N) \
- AI_MATKEY_TEXBLEND(aiTextureType_NORMALS,N)
-
-#define AI_MATKEY_TEXBLEND_HEIGHT(N) \
- AI_MATKEY_TEXBLEND(aiTextureType_HEIGHT,N)
-
-#define AI_MATKEY_TEXBLEND_SHININESS(N) \
- AI_MATKEY_TEXBLEND(aiTextureType_SHININESS,N)
-
-#define AI_MATKEY_TEXBLEND_OPACITY(N) \
- AI_MATKEY_TEXBLEND(aiTextureType_OPACITY,N)
-
-#define AI_MATKEY_TEXBLEND_DISPLACEMENT(N) \
- AI_MATKEY_TEXBLEND(aiTextureType_DISPLACEMENT,N)
-
-#define AI_MATKEY_TEXBLEND_LIGHTMAP(N) \
- AI_MATKEY_TEXBLEND(aiTextureType_LIGHTMAP,N)
-
-#define AI_MATKEY_TEXBLEND_REFLECTION(N) \
- AI_MATKEY_TEXBLEND(aiTextureType_REFLECTION,N)
-
-//! @endcond
-// ---------------------------------------------------------------------------
-#define AI_MATKEY_MAPPINGMODE_U(type, N) _AI_MATKEY_MAPPINGMODE_U_BASE,type,N
-
-// For backward compatibility and simplicity
-//! @cond MATS_DOC_FULL
-#define AI_MATKEY_MAPPINGMODE_U_DIFFUSE(N) \
- AI_MATKEY_MAPPINGMODE_U(aiTextureType_DIFFUSE,N)
-
-#define AI_MATKEY_MAPPINGMODE_U_SPECULAR(N) \
- AI_MATKEY_MAPPINGMODE_U(aiTextureType_SPECULAR,N)
-
-#define AI_MATKEY_MAPPINGMODE_U_AMBIENT(N) \
- AI_MATKEY_MAPPINGMODE_U(aiTextureType_AMBIENT,N)
-
-#define AI_MATKEY_MAPPINGMODE_U_EMISSIVE(N) \
- AI_MATKEY_MAPPINGMODE_U(aiTextureType_EMISSIVE,N)
-
-#define AI_MATKEY_MAPPINGMODE_U_NORMALS(N) \
- AI_MATKEY_MAPPINGMODE_U(aiTextureType_NORMALS,N)
-
-#define AI_MATKEY_MAPPINGMODE_U_HEIGHT(N) \
- AI_MATKEY_MAPPINGMODE_U(aiTextureType_HEIGHT,N)
-
-#define AI_MATKEY_MAPPINGMODE_U_SHININESS(N) \
- AI_MATKEY_MAPPINGMODE_U(aiTextureType_SHININESS,N)
-
-#define AI_MATKEY_MAPPINGMODE_U_OPACITY(N) \
- AI_MATKEY_MAPPINGMODE_U(aiTextureType_OPACITY,N)
-
-#define AI_MATKEY_MAPPINGMODE_U_DISPLACEMENT(N) \
- AI_MATKEY_MAPPINGMODE_U(aiTextureType_DISPLACEMENT,N)
-
-#define AI_MATKEY_MAPPINGMODE_U_LIGHTMAP(N) \
- AI_MATKEY_MAPPINGMODE_U(aiTextureType_LIGHTMAP,N)
-
-#define AI_MATKEY_MAPPINGMODE_U_REFLECTION(N) \
- AI_MATKEY_MAPPINGMODE_U(aiTextureType_REFLECTION,N)
-
-//! @endcond
-// ---------------------------------------------------------------------------
-#define AI_MATKEY_MAPPINGMODE_V(type, N) _AI_MATKEY_MAPPINGMODE_V_BASE,type,N
-
-// For backward compatibility and simplicity
-//! @cond MATS_DOC_FULL
-#define AI_MATKEY_MAPPINGMODE_V_DIFFUSE(N) \
- AI_MATKEY_MAPPINGMODE_V(aiTextureType_DIFFUSE,N)
-
-#define AI_MATKEY_MAPPINGMODE_V_SPECULAR(N) \
- AI_MATKEY_MAPPINGMODE_V(aiTextureType_SPECULAR,N)
-
-#define AI_MATKEY_MAPPINGMODE_V_AMBIENT(N) \
- AI_MATKEY_MAPPINGMODE_V(aiTextureType_AMBIENT,N)
-
-#define AI_MATKEY_MAPPINGMODE_V_EMISSIVE(N) \
- AI_MATKEY_MAPPINGMODE_V(aiTextureType_EMISSIVE,N)
-
-#define AI_MATKEY_MAPPINGMODE_V_NORMALS(N) \
- AI_MATKEY_MAPPINGMODE_V(aiTextureType_NORMALS,N)
-
-#define AI_MATKEY_MAPPINGMODE_V_HEIGHT(N) \
- AI_MATKEY_MAPPINGMODE_V(aiTextureType_HEIGHT,N)
-
-#define AI_MATKEY_MAPPINGMODE_V_SHININESS(N) \
- AI_MATKEY_MAPPINGMODE_V(aiTextureType_SHININESS,N)
-
-#define AI_MATKEY_MAPPINGMODE_V_OPACITY(N) \
- AI_MATKEY_MAPPINGMODE_V(aiTextureType_OPACITY,N)
-
-#define AI_MATKEY_MAPPINGMODE_V_DISPLACEMENT(N) \
- AI_MATKEY_MAPPINGMODE_V(aiTextureType_DISPLACEMENT,N)
-
-#define AI_MATKEY_MAPPINGMODE_V_LIGHTMAP(N) \
- AI_MATKEY_MAPPINGMODE_V(aiTextureType_LIGHTMAP,N)
-
-#define AI_MATKEY_MAPPINGMODE_V_REFLECTION(N) \
- AI_MATKEY_MAPPINGMODE_V(aiTextureType_REFLECTION,N)
-
-//! @endcond
-// ---------------------------------------------------------------------------
-#define AI_MATKEY_TEXMAP_AXIS(type, N) _AI_MATKEY_TEXMAP_AXIS_BASE,type,N
-
-// For backward compatibility and simplicity
-//! @cond MATS_DOC_FULL
-#define AI_MATKEY_TEXMAP_AXIS_DIFFUSE(N) \
- AI_MATKEY_TEXMAP_AXIS(aiTextureType_DIFFUSE,N)
-
-#define AI_MATKEY_TEXMAP_AXIS_SPECULAR(N) \
- AI_MATKEY_TEXMAP_AXIS(aiTextureType_SPECULAR,N)
-
-#define AI_MATKEY_TEXMAP_AXIS_AMBIENT(N) \
- AI_MATKEY_TEXMAP_AXIS(aiTextureType_AMBIENT,N)
-
-#define AI_MATKEY_TEXMAP_AXIS_EMISSIVE(N) \
- AI_MATKEY_TEXMAP_AXIS(aiTextureType_EMISSIVE,N)
-
-#define AI_MATKEY_TEXMAP_AXIS_NORMALS(N) \
- AI_MATKEY_TEXMAP_AXIS(aiTextureType_NORMALS,N)
-
-#define AI_MATKEY_TEXMAP_AXIS_HEIGHT(N) \
- AI_MATKEY_TEXMAP_AXIS(aiTextureType_HEIGHT,N)
-
-#define AI_MATKEY_TEXMAP_AXIS_SHININESS(N) \
- AI_MATKEY_TEXMAP_AXIS(aiTextureType_SHININESS,N)
-
-#define AI_MATKEY_TEXMAP_AXIS_OPACITY(N) \
- AI_MATKEY_TEXMAP_AXIS(aiTextureType_OPACITY,N)
-
-#define AI_MATKEY_TEXMAP_AXIS_DISPLACEMENT(N) \
- AI_MATKEY_TEXMAP_AXIS(aiTextureType_DISPLACEMENT,N)
-
-#define AI_MATKEY_TEXMAP_AXIS_LIGHTMAP(N) \
- AI_MATKEY_TEXMAP_AXIS(aiTextureType_LIGHTMAP,N)
-
-#define AI_MATKEY_TEXMAP_AXIS_REFLECTION(N) \
- AI_MATKEY_TEXMAP_AXIS(aiTextureType_REFLECTION,N)
-
-//! @endcond
-// ---------------------------------------------------------------------------
-#define AI_MATKEY_UVTRANSFORM(type, N) _AI_MATKEY_UVTRANSFORM_BASE,type,N
-
-// For backward compatibility and simplicity
-//! @cond MATS_DOC_FULL
-#define AI_MATKEY_UVTRANSFORM_DIFFUSE(N) \
- AI_MATKEY_UVTRANSFORM(aiTextureType_DIFFUSE,N)
-
-#define AI_MATKEY_UVTRANSFORM_SPECULAR(N) \
- AI_MATKEY_UVTRANSFORM(aiTextureType_SPECULAR,N)
-
-#define AI_MATKEY_UVTRANSFORM_AMBIENT(N) \
- AI_MATKEY_UVTRANSFORM(aiTextureType_AMBIENT,N)
-
-#define AI_MATKEY_UVTRANSFORM_EMISSIVE(N) \
- AI_MATKEY_UVTRANSFORM(aiTextureType_EMISSIVE,N)
-
-#define AI_MATKEY_UVTRANSFORM_NORMALS(N) \
- AI_MATKEY_UVTRANSFORM(aiTextureType_NORMALS,N)
-
-#define AI_MATKEY_UVTRANSFORM_HEIGHT(N) \
- AI_MATKEY_UVTRANSFORM(aiTextureType_HEIGHT,N)
-
-#define AI_MATKEY_UVTRANSFORM_SHININESS(N) \
- AI_MATKEY_UVTRANSFORM(aiTextureType_SHININESS,N)
-
-#define AI_MATKEY_UVTRANSFORM_OPACITY(N) \
- AI_MATKEY_UVTRANSFORM(aiTextureType_OPACITY,N)
-
-#define AI_MATKEY_UVTRANSFORM_DISPLACEMENT(N) \
- AI_MATKEY_UVTRANSFORM(aiTextureType_DISPLACEMENT,N)
-
-#define AI_MATKEY_UVTRANSFORM_LIGHTMAP(N) \
- AI_MATKEY_UVTRANSFORM(aiTextureType_LIGHTMAP,N)
-
-#define AI_MATKEY_UVTRANSFORM_REFLECTION(N) \
- AI_MATKEY_UVTRANSFORM(aiTextureType_REFLECTION,N)
-
-#define AI_MATKEY_UVTRANSFORM_UNKNOWN(N) \
- AI_MATKEY_UVTRANSFORM(aiTextureType_UNKNOWN,N)
-
-//! @endcond
-// ---------------------------------------------------------------------------
-#define AI_MATKEY_TEXFLAGS(type, N) _AI_MATKEY_TEXFLAGS_BASE,type,N
-
-// For backward compatibility and simplicity
-//! @cond MATS_DOC_FULL
-#define AI_MATKEY_TEXFLAGS_DIFFUSE(N) \
- AI_MATKEY_TEXFLAGS(aiTextureType_DIFFUSE,N)
-
-#define AI_MATKEY_TEXFLAGS_SPECULAR(N) \
- AI_MATKEY_TEXFLAGS(aiTextureType_SPECULAR,N)
-
-#define AI_MATKEY_TEXFLAGS_AMBIENT(N) \
- AI_MATKEY_TEXFLAGS(aiTextureType_AMBIENT,N)
-
-#define AI_MATKEY_TEXFLAGS_EMISSIVE(N) \
- AI_MATKEY_TEXFLAGS(aiTextureType_EMISSIVE,N)
-
-#define AI_MATKEY_TEXFLAGS_NORMALS(N) \
- AI_MATKEY_TEXFLAGS(aiTextureType_NORMALS,N)
-
-#define AI_MATKEY_TEXFLAGS_HEIGHT(N) \
- AI_MATKEY_TEXFLAGS(aiTextureType_HEIGHT,N)
-
-#define AI_MATKEY_TEXFLAGS_SHININESS(N) \
- AI_MATKEY_TEXFLAGS(aiTextureType_SHININESS,N)
-
-#define AI_MATKEY_TEXFLAGS_OPACITY(N) \
- AI_MATKEY_TEXFLAGS(aiTextureType_OPACITY,N)
-
-#define AI_MATKEY_TEXFLAGS_DISPLACEMENT(N) \
- AI_MATKEY_TEXFLAGS(aiTextureType_DISPLACEMENT,N)
-
-#define AI_MATKEY_TEXFLAGS_LIGHTMAP(N) \
- AI_MATKEY_TEXFLAGS(aiTextureType_LIGHTMAP,N)
-
-#define AI_MATKEY_TEXFLAGS_REFLECTION(N) \
- AI_MATKEY_TEXFLAGS(aiTextureType_REFLECTION,N)
-
-#define AI_MATKEY_TEXFLAGS_UNKNOWN(N) \
- AI_MATKEY_TEXFLAGS(aiTextureType_UNKNOWN,N)
-
-// ---------------------------------------------------------------------------
-/** @brief Retrieve a material property with a specific key from the material
- *
- * @param pMat Pointer to the input material. May not be NULL
- * @param pKey Key to search for. One of the AI_MATKEY_XXX constants.
- * @param type Specifies the type of the texture to be retrieved (
- * e.g. diffuse, specular, height map ...)
- * @param index Index of the texture to be retrieved.
- * @param pPropOut Pointer to receive a pointer to a valid aiMaterialProperty
- * structure or NULL if the key has not been found. */
-// ---------------------------------------------------------------------------
-ASSIMP_API C_ENUM aiReturn aiGetMaterialProperty(
- const C_STRUCT aiMaterial* pMat,
- const char* pKey,
- unsigned int type,
- unsigned int index,
- const C_STRUCT aiMaterialProperty** pPropOut);
-
-// ---------------------------------------------------------------------------
-/** @brief Retrieve an array of float values with a specific key
- * from the material
- *
- * Pass one of the AI_MATKEY_XXX constants for the last three parameters (the
- * example reads the #AI_MATKEY_UVTRANSFORM property of the first diffuse texture)
- * @code
- * aiUVTransform trafo;
- * unsigned int max = sizeof(aiUVTransform);
- * if (AI_SUCCESS != aiGetMaterialFloatArray(mat, AI_MATKEY_UVTRANSFORM(aiTextureType_DIFFUSE,0),
- * (float*)&trafo, &max) || sizeof(aiUVTransform) != max)
- * {
- * // error handling
- * }
- * @endcode
- *
- * @param pMat Pointer to the input material. May not be NULL
- * @param pKey Key to search for. One of the AI_MATKEY_XXX constants.
- * @param pOut Pointer to a buffer to receive the result.
- * @param pMax Specifies the size of the given buffer, in float's.
- * Receives the number of values (not bytes!) read.
- * @param type (see the code sample above)
- * @param index (see the code sample above)
- * @return Specifies whether the key has been found. If not, the output
- * arrays remains unmodified and pMax is set to 0.*/
-// ---------------------------------------------------------------------------
-ASSIMP_API C_ENUM aiReturn aiGetMaterialFloatArray(
- const C_STRUCT aiMaterial* pMat,
- const char* pKey,
- unsigned int type,
- unsigned int index,
- float* pOut,
- unsigned int* pMax);
-
-
-#ifdef __cplusplus
-
-// ---------------------------------------------------------------------------
-/** @brief Retrieve a single float property with a specific key from the material.
-*
-* Pass one of the AI_MATKEY_XXX constants for the last three parameters (the
-* example reads the #AI_MATKEY_SHININESS_STRENGTH property of the first diffuse texture)
-* @code
-* float specStrength = 1.f; // default value, remains unmodified if we fail.
-* aiGetMaterialFloat(mat, AI_MATKEY_SHININESS_STRENGTH,
-* (float*)&specStrength);
-* @endcode
-*
-* @param pMat Pointer to the input material. May not be NULL
-* @param pKey Key to search for. One of the AI_MATKEY_XXX constants.
-* @param pOut Receives the output float.
-* @param type (see the code sample above)
-* @param index (see the code sample above)
-* @return Specifies whether the key has been found. If not, the output
-* float remains unmodified.*/
-// ---------------------------------------------------------------------------
-inline aiReturn aiGetMaterialFloat(const aiMaterial* pMat,
- const char* pKey,
- unsigned int type,
- unsigned int index,
- float* pOut)
-{
- return aiGetMaterialFloatArray(pMat,pKey,type,index,pOut,(unsigned int*)0x0);
-}
-
-#else
-
-// Use our friend, the C preprocessor
-#define aiGetMaterialFloat (pMat, type, index, pKey, pOut) \
- aiGetMaterialFloatArray(pMat, type, index, pKey, pOut, NULL)
-
-#endif //!__cplusplus
-
-
-// ---------------------------------------------------------------------------
-/** @brief Retrieve an array of integer values with a specific key
- * from a material
- *
- * See the sample for aiGetMaterialFloatArray for more information.*/
-ASSIMP_API C_ENUM aiReturn aiGetMaterialIntegerArray(const C_STRUCT aiMaterial* pMat,
- const char* pKey,
- unsigned int type,
- unsigned int index,
- int* pOut,
- unsigned int* pMax);
-
-
-#ifdef __cplusplus
-
-// ---------------------------------------------------------------------------
-/** @brief Retrieve an integer property with a specific key from a material
- *
- * See the sample for aiGetMaterialFloat for more information.*/
-// ---------------------------------------------------------------------------
-inline aiReturn aiGetMaterialInteger(const C_STRUCT aiMaterial* pMat,
- const char* pKey,
- unsigned int type,
- unsigned int index,
- int* pOut)
-{
- return aiGetMaterialIntegerArray(pMat,pKey,type,index,pOut,(unsigned int*)0x0);
-}
-
-#else
-
-// use our friend, the C preprocessor
-#define aiGetMaterialInteger (pMat, type, index, pKey, pOut) \
- aiGetMaterialIntegerArray(pMat, type, index, pKey, pOut, NULL)
-
-#endif //!__cplusplus
-
-
-
-// ---------------------------------------------------------------------------
-/** @brief Retrieve a color value from the material property table
-*
-* See the sample for aiGetMaterialFloat for more information*/
-// ---------------------------------------------------------------------------
-ASSIMP_API C_ENUM aiReturn aiGetMaterialColor(const C_STRUCT aiMaterial* pMat,
- const char* pKey,
- unsigned int type,
- unsigned int index,
- C_STRUCT aiColor4D* pOut);
-
-
-// ---------------------------------------------------------------------------
-/** @brief Retrieve a string from the material property table
-*
-* See the sample for aiGetMaterialFloat for more information.*/
-// ---------------------------------------------------------------------------
-ASSIMP_API C_ENUM aiReturn aiGetMaterialString(const C_STRUCT aiMaterial* pMat,
- const char* pKey,
- unsigned int type,
- unsigned int index,
- C_STRUCT aiString* pOut);
-
-// ---------------------------------------------------------------------------
-/** Get the number of textures for a particular texture type.
- * @param[in] pMat Pointer to the input material. May not be NULL
- * @param type Texture type to check for
- * @return Number of textures for this type.
- * @note A texture can be easily queried using #aiGetMaterialTexture() */
-// ---------------------------------------------------------------------------
-ASSIMP_API unsigned int aiGetMaterialTextureCount(const C_STRUCT aiMaterial* pMat,
- C_ENUM aiTextureType type);
-
-// ---------------------------------------------------------------------------
-/** @brief Helper function to get all values pertaining to a particular
- * texture slot from a material structure.
- *
- * This function is provided just for convenience. You could also read the
- * texture by parsing all of its properties manually. This function bundles
- * all of them in a huge function monster.
- *
- * @param[in] mat Pointer to the input material. May not be NULL
- * @param[in] type Specifies the texture stack to read from (e.g. diffuse,
- * specular, height map ...).
- * @param[in] index Index of the texture. The function fails if the
- * requested index is not available for this texture type.
- * #aiGetMaterialTextureCount() can be used to determine the number of
- * textures in a particular texture stack.
- * @param[out] path Receives the output path
- * This parameter must be non-null.
- * @param mapping The texture mapping mode to be used.
- * Pass NULL if you're not interested in this information.
- * @param[out] uvindex For UV-mapped textures: receives the index of the UV
- * source channel. Unmodified otherwise.
- * Pass NULL if you're not interested in this information.
- * @param[out] blend Receives the blend factor for the texture
- * Pass NULL if you're not interested in this information.
- * @param[out] op Receives the texture blend operation to be perform between
- * this texture and the previous texture.
- * Pass NULL if you're not interested in this information.
- * @param[out] mapmode Receives the mapping modes to be used for the texture.
- * Pass NULL if you're not interested in this information. Otherwise,
- * pass a pointer to an array of two aiTextureMapMode's (one for each
- * axis, UV order).
- * @return AI_SUCCESS on success, otherwise something else. Have fun.*/
-// ---------------------------------------------------------------------------
-#ifdef __cplusplus
-ASSIMP_API aiReturn aiGetMaterialTexture(const C_STRUCT aiMaterial* mat,
- aiTextureType type,
- unsigned int index,
- aiString* path,
- aiTextureMapping* mapping = NULL,
- unsigned int* uvindex = NULL,
- float* blend = NULL,
- aiTextureOp* op = NULL,
- aiTextureMapMode* mapmode = NULL,
- unsigned int* flags = NULL);
-#else
-C_ENUM aiReturn aiGetMaterialTexture(const C_STRUCT aiMaterial* mat,
- C_ENUM aiTextureType type,
- unsigned int index,
- C_STRUCT aiString* path,
- C_ENUM aiTextureMapping* mapping /*= NULL*/,
- unsigned int* uvindex /*= NULL*/,
- float* blend /*= NULL*/,
- C_ENUM aiTextureOp* op /*= NULL*/,
- C_ENUM aiTextureMapMode* mapmode /*= NULL*/,
- unsigned int* flags /*= NULL*/);
-#endif // !#ifdef __cplusplus
-
-#ifdef __cplusplus
-}
-
-#include "aiMaterial.inl"
-
-#endif //!__cplusplus
-#endif //!!AI_MATERIAL_H_INC
diff --git a/3rdparty/assimp/include/aiMaterial.inl b/3rdparty/assimp/include/aiMaterial.inl
deleted file mode 100644
index 6be16ff6..00000000
--- a/3rdparty/assimp/include/aiMaterial.inl
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file aiMaterial.inl
- * @brief Defines the C++ getters for the material system
- */
-
-#ifndef AI_MATERIAL_INL_INC
-#define AI_MATERIAL_INL_INC
-
-//! @cond never
-
-// ---------------------------------------------------------------------------
-inline aiReturn aiMaterial::GetTexture( aiTextureType type,
- unsigned int index,
- C_STRUCT aiString* path,
- aiTextureMapping* mapping /*= NULL*/,
- unsigned int* uvindex /*= NULL*/,
- float* blend /*= NULL*/,
- aiTextureOp* op /*= NULL*/,
- aiTextureMapMode* mapmode /*= NULL*/) const
-{
- return ::aiGetMaterialTexture(this,type,index,path,mapping,uvindex,blend,op,mapmode);
-}
-
-// ---------------------------------------------------------------------------
-inline unsigned int aiMaterial::GetTextureCount(aiTextureType type) const
-{
- return ::aiGetMaterialTextureCount(this,type);
-}
-
-// ---------------------------------------------------------------------------
-template <typename Type>
-inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type,
- unsigned int idx, Type* pOut,
- unsigned int* pMax) const
-{
- unsigned int iNum = pMax ? *pMax : 1;
-
- const aiMaterialProperty* prop;
- const aiReturn ret = ::aiGetMaterialProperty(this,pKey,type,idx,
- (const aiMaterialProperty**)&prop);
- if ( AI_SUCCESS == ret ) {
-
- if (prop->mDataLength < sizeof(Type)*iNum) {
- return AI_FAILURE;
- }
-
- // if (::strcmp(prop->mData,(char*)aiPTI_Buffer)!=0)
- // return AI_FAILURE;
-
- iNum = std::min((size_t)iNum,prop->mDataLength / sizeof(Type));
- memcpy(pOut,prop->mData,iNum * sizeof(Type));
- if (pMax) {
- *pMax = iNum;
- }
- }
- return ret;
-}
-
-// ---------------------------------------------------------------------------
-template <typename Type>
-inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type,
- unsigned int idx,Type& pOut) const
-{
- const aiMaterialProperty* prop;
- const aiReturn ret = ::aiGetMaterialProperty(this,pKey,type,idx,
- (const aiMaterialProperty**)&prop);
- if ( AI_SUCCESS == ret ) {
-
- /*
- if (prop->mDataLength < sizeof(Type)) {
- return AI_FAILURE;
- }
-
- if (strcmp(prop->mData,(char*)aiPTI_Buffer)!=0) {
- return AI_FAILURE;
- }
-
- memcpy(&pOut,prop->mData,sizeof(Type));
- */
-
- if (prop->mType == aiPTI_Buffer) {
- return AI_FAILURE;
- } else {
- if (prop->mDataLength < sizeof(Type)) {
- return AI_FAILURE;
- } else {
- memcpy(&pOut,prop->mData,sizeof(Type));
- }
- }
- }
- return ret;
-}
-// ---------------------------------------------------------------------------
-template <>
-inline aiReturn aiMaterial::Get<float>(const char* pKey,unsigned int type,
- unsigned int idx,float* pOut,
- unsigned int* pMax) const
-{
- return ::aiGetMaterialFloatArray(this,pKey,type,idx,pOut,pMax);
-}
-// ---------------------------------------------------------------------------
-template <>
-inline aiReturn aiMaterial::Get<int>(const char* pKey,unsigned int type,
- unsigned int idx,int* pOut,
- unsigned int* pMax) const
-{
- return ::aiGetMaterialIntegerArray(this,pKey,type,idx,pOut,pMax);
-}
-
-// ---------------------------------------------------------------------------
-template <>
-inline aiReturn aiMaterial::Get<float>(const char* pKey,unsigned int type,
- unsigned int idx,float& pOut) const
-{
- return aiGetMaterialFloat(this,pKey,type,idx,&pOut);
-}
-// ---------------------------------------------------------------------------
-template <>
-inline aiReturn aiMaterial::Get<int>(const char* pKey,unsigned int type,
- unsigned int idx,int& pOut) const
-{
- return aiGetMaterialInteger(this,pKey,type,idx,&pOut);
-}
-// ---------------------------------------------------------------------------
-template <>
-inline aiReturn aiMaterial::Get<aiColor4D>(const char* pKey,unsigned int type,
- unsigned int idx,aiColor4D& pOut) const
-{
- return aiGetMaterialColor(this,pKey,type,idx,&pOut);
-}
-// ---------------------------------------------------------------------------
-template <>
-inline aiReturn aiMaterial::Get<aiColor3D>(const char* pKey,unsigned int type,
- unsigned int idx,aiColor3D& pOut) const
-{
- aiColor4D c;
- const aiReturn ret = aiGetMaterialColor(this,pKey,type,idx,&c);
- pOut = aiColor3D(c.r,c.g,c.b);
- return ret;
-}
-// ---------------------------------------------------------------------------
-template <>
-inline aiReturn aiMaterial::Get<aiString>(const char* pKey,unsigned int type,
- unsigned int idx,aiString& pOut) const
-{
- return aiGetMaterialString(this,pKey,type,idx,&pOut);
-}
-
-//! @endcond
-
-#endif //! AI_MATERIAL_INL_INC
diff --git a/3rdparty/assimp/include/aiMatrix3x3.h b/3rdparty/assimp/include/aiMatrix3x3.h
deleted file mode 100644
index dc3d6314..00000000
--- a/3rdparty/assimp/include/aiMatrix3x3.h
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file aiMatrix3x3.h
- * @brief Definition of a 3x3 matrix, including operators when compiling in C++
- */
-#ifndef AI_MATRIX3x3_H_INC
-#define AI_MATRIX3x3_H_INC
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct aiMatrix4x4;
-struct aiVector2D;
-
-// ---------------------------------------------------------------------------
-/** @brief Represents a row-major 3x3 matrix
- *
- * There's much confusion about matrix layouts (colum vs. row order).
- * This is *always* a row-major matrix. Even with the
- * aiProcess_ConvertToLeftHanded flag.
- */
-struct aiMatrix3x3
-{
-#ifdef __cplusplus
-
- aiMatrix3x3 () :
- a1(1.0f), a2(0.0f), a3(0.0f),
- b1(0.0f), b2(1.0f), b3(0.0f),
- c1(0.0f), c2(0.0f), c3(1.0f) {}
-
- aiMatrix3x3 ( float _a1, float _a2, float _a3,
- float _b1, float _b2, float _b3,
- float _c1, float _c2, float _c3) :
- a1(_a1), a2(_a2), a3(_a3),
- b1(_b1), b2(_b2), b3(_b3),
- c1(_c1), c2(_c2), c3(_c3)
- {}
-
-public:
-
- // matrix multiplication. beware, not commutative
- aiMatrix3x3& operator *= (const aiMatrix3x3& m);
- aiMatrix3x3 operator * (const aiMatrix3x3& m) const;
-
- // array access operators
- float* operator[] (unsigned int p_iIndex);
- const float* operator[] (unsigned int p_iIndex) const;
-
- // comparison operators
- bool operator== (const aiMatrix4x4 m) const;
- bool operator!= (const aiMatrix4x4 m) const;
-
-public:
-
- // -------------------------------------------------------------------
- /** @brief Construction from a 4x4 matrix. The remaining parts
- * of the matrix are ignored.
- */
- explicit aiMatrix3x3( const aiMatrix4x4& pMatrix);
-
- // -------------------------------------------------------------------
- /** @brief Transpose the matrix
- */
- aiMatrix3x3& Transpose();
-
- // -------------------------------------------------------------------
- /** @brief Invert the matrix.
- * If the matrix is not invertible all elements are set to qnan.
- * Beware, use (f != f) to check whether a float f is qnan.
- */
- aiMatrix3x3& Inverse();
- float Determinant() const;
-
-public:
- // -------------------------------------------------------------------
- /** @brief Returns a rotation matrix for a rotation around z
- * @param a Rotation angle, in radians
- * @param out Receives the output matrix
- * @return Reference to the output matrix
- */
- static aiMatrix3x3& RotationZ(float a, aiMatrix3x3& out);
-
- // -------------------------------------------------------------------
- /** @brief Returns a rotation matrix for a rotation around
- * an arbitrary axis.
- *
- * @param a Rotation angle, in radians
- * @param axis Axis to rotate around
- * @param out To be filled
- */
- static aiMatrix3x3& Rotation( float a,
- const aiVector3D& axis, aiMatrix3x3& out);
-
- // -------------------------------------------------------------------
- /** @brief Returns a translation matrix
- * @param v Translation vector
- * @param out Receives the output matrix
- * @return Reference to the output matrix
- */
- static aiMatrix3x3& Translation( const aiVector2D& v, aiMatrix3x3& out);
-
- // -------------------------------------------------------------------
- /** @brief A function for creating a rotation matrix that rotates a
- * vector called "from" into another vector called "to".
- * Input : from[3], to[3] which both must be *normalized* non-zero vectors
- * Output: mtx[3][3] -- a 3x3 matrix in colum-major form
- * Authors: Tomas Möller, John Hughes
- * "Efficiently Building a Matrix to Rotate One Vector to Another"
- * Journal of Graphics Tools, 4(4):1-4, 1999
- */
- static aiMatrix3x3& FromToMatrix(const aiVector3D& from,
- const aiVector3D& to, aiMatrix3x3& out);
-
-#endif // __cplusplus
-
-
- float a1, a2, a3;
- float b1, b2, b3;
- float c1, c2, c3;
-};
-
-#ifdef __cplusplus
-} // end of extern C
-#endif
-
-#endif // AI_MATRIX3x3_H_INC
diff --git a/3rdparty/assimp/include/aiMatrix3x3.inl b/3rdparty/assimp/include/aiMatrix3x3.inl
deleted file mode 100644
index 3a9e6162..00000000
--- a/3rdparty/assimp/include/aiMatrix3x3.inl
+++ /dev/null
@@ -1,250 +0,0 @@
-/** @file aiMatrix3x3.inl
- * @brief Inline implementation of the 3x3 matrix operators
- */
-#ifndef AI_MATRIX3x3_INL_INC
-#define AI_MATRIX3x3_INL_INC
-
-#include "aiMatrix3x3.h"
-
-#ifdef __cplusplus
-#include "aiMatrix4x4.h"
-#include <algorithm>
-#include <limits>
-
-// ------------------------------------------------------------------------------------------------
-// Construction from a 4x4 matrix. The remaining parts of the matrix are ignored.
-inline aiMatrix3x3::aiMatrix3x3( const aiMatrix4x4& pMatrix)
-{
- a1 = pMatrix.a1; a2 = pMatrix.a2; a3 = pMatrix.a3;
- b1 = pMatrix.b1; b2 = pMatrix.b2; b3 = pMatrix.b3;
- c1 = pMatrix.c1; c2 = pMatrix.c2; c3 = pMatrix.c3;
-}
-
-// ------------------------------------------------------------------------------------------------
-inline aiMatrix3x3& aiMatrix3x3::operator *= (const aiMatrix3x3& m)
-{
- *this = aiMatrix3x3(m.a1 * a1 + m.b1 * a2 + m.c1 * a3,
- m.a2 * a1 + m.b2 * a2 + m.c2 * a3,
- m.a3 * a1 + m.b3 * a2 + m.c3 * a3,
- m.a1 * b1 + m.b1 * b2 + m.c1 * b3,
- m.a2 * b1 + m.b2 * b2 + m.c2 * b3,
- m.a3 * b1 + m.b3 * b2 + m.c3 * b3,
- m.a1 * c1 + m.b1 * c2 + m.c1 * c3,
- m.a2 * c1 + m.b2 * c2 + m.c2 * c3,
- m.a3 * c1 + m.b3 * c2 + m.c3 * c3);
- return *this;
-}
-
-// ------------------------------------------------------------------------------------------------
-inline aiMatrix3x3 aiMatrix3x3::operator* (const aiMatrix3x3& m) const
-{
- aiMatrix3x3 temp( *this);
- temp *= m;
- return temp;
-}
-
-// ------------------------------------------------------------------------------------------------
-inline float* aiMatrix3x3::operator[] (unsigned int p_iIndex)
-{
- return &this->a1 + p_iIndex * 3;
-}
-
-// ------------------------------------------------------------------------------------------------
-inline const float* aiMatrix3x3::operator[] (unsigned int p_iIndex) const
-{
- return &this->a1 + p_iIndex * 3;
-}
-
-// ------------------------------------------------------------------------------------------------
-inline bool aiMatrix3x3::operator== (const aiMatrix4x4 m) const
-{
- return a1 == m.a1 && a2 == m.a2 && a3 == m.a3 &&
- b1 == m.b1 && b2 == m.b2 && b3 == m.b3 &&
- c1 == m.c1 && c2 == m.c2 && c3 == m.c3;
-}
-
-// ------------------------------------------------------------------------------------------------
-inline bool aiMatrix3x3::operator!= (const aiMatrix4x4 m) const
-{
- return !(*this == m);
-}
-
-// ------------------------------------------------------------------------------------------------
-inline aiMatrix3x3& aiMatrix3x3::Transpose()
-{
- // (float&) don't remove, GCC complains cause of packed fields
- std::swap( (float&)a2, (float&)b1);
- std::swap( (float&)a3, (float&)c1);
- std::swap( (float&)b3, (float&)c2);
- return *this;
-}
-
-// ----------------------------------------------------------------------------------------
-inline float aiMatrix3x3::Determinant() const
-{
- return a1*b2*c3 - a1*b3*c2 + a2*b3*c1 - a2*b1*c3 + a3*b1*c2 - a3*b2*c1;
-}
-
-// ----------------------------------------------------------------------------------------
-inline aiMatrix3x3& aiMatrix3x3::Inverse()
-{
- // Compute the reciprocal determinant
- float det = Determinant();
- if(det == 0.0f)
- {
- // Matrix not invertible. Setting all elements to nan is not really
- // correct in a mathematical sense but it is easy to debug for the
- // programmer.
- const float nan = std::numeric_limits<float>::quiet_NaN();
- *this = aiMatrix3x3( nan,nan,nan,nan,nan,nan,nan,nan,nan);
-
- return *this;
- }
-
- float invdet = 1.0f / det;
-
- aiMatrix3x3 res;
- res.a1 = invdet * (b2 * c3 - b3 * c2);
- res.a2 = -invdet * (a2 * c3 - a3 * c2);
- res.a3 = invdet * (a2 * b3 - a3 * b2);
- res.b1 = -invdet * (b1 * c3 - b3 * c1);
- res.b2 = invdet * (a1 * c3 - a3 * c1);
- res.b3 = -invdet * (a1 * b3 - a3 * b1);
- res.c1 = invdet * (b1 * c2 - b2 * c1);
- res.c2 = -invdet * (a1 * c2 - a2 * c1);
- res.c3 = invdet * (a1 * b2 - a2 * b1);
- *this = res;
-
- return *this;
-}
-
-// ------------------------------------------------------------------------------------------------
-inline aiMatrix3x3& aiMatrix3x3::RotationZ(float a, aiMatrix3x3& out)
-{
- out.a1 = out.b2 = ::cos(a);
- out.b1 = ::sin(a);
- out.a2 = - out.b1;
-
- out.a3 = out.b3 = out.c1 = out.c2 = 0.f;
- out.c3 = 1.f;
-
- return out;
-}
-
-// ------------------------------------------------------------------------------------------------
-// Returns a rotation matrix for a rotation around an arbitrary axis.
-inline aiMatrix3x3& aiMatrix3x3::Rotation( float a, const aiVector3D& axis, aiMatrix3x3& out)
-{
- float c = cos( a), s = sin( a), t = 1 - c;
- float x = axis.x, y = axis.y, z = axis.z;
-
- // Many thanks to MathWorld and Wikipedia
- out.a1 = t*x*x + c; out.a2 = t*x*y - s*z; out.a3 = t*x*z + s*y;
- out.b1 = t*x*y + s*z; out.b2 = t*y*y + c; out.b3 = t*y*z - s*x;
- out.c1 = t*x*z - s*y; out.c2 = t*y*z + s*x; out.c3 = t*z*z + c;
-
- return out;
-}
-
-// ------------------------------------------------------------------------------------------------
-inline aiMatrix3x3& aiMatrix3x3::Translation( const aiVector2D& v, aiMatrix3x3& out)
-{
- out = aiMatrix3x3();
- out.a3 = v.x;
- out.b3 = v.y;
- return out;
-}
-
-// ----------------------------------------------------------------------------------------
-/** A function for creating a rotation matrix that rotates a vector called
- * "from" into another vector called "to".
- * Input : from[3], to[3] which both must be *normalized* non-zero vectors
- * Output: mtx[3][3] -- a 3x3 matrix in colum-major form
- * Authors: Tomas Möller, John Hughes
- * "Efficiently Building a Matrix to Rotate One Vector to Another"
- * Journal of Graphics Tools, 4(4):1-4, 1999
- */
-// ----------------------------------------------------------------------------------------
-inline aiMatrix3x3& aiMatrix3x3::FromToMatrix(const aiVector3D& from,
- const aiVector3D& to, aiMatrix3x3& mtx)
-{
- const float e = from * to;
- const float f = (e < 0)? -e:e;
-
- if (f > 1.0 - 0.00001f) /* "from" and "to"-vector almost parallel */
- {
- aiVector3D u,v; /* temporary storage vectors */
- aiVector3D x; /* vector most nearly orthogonal to "from" */
-
- x.x = (from.x > 0.0)? from.x : -from.x;
- x.y = (from.y > 0.0)? from.y : -from.y;
- x.z = (from.z > 0.0)? from.z : -from.z;
-
- if (x.x < x.y)
- {
- if (x.x < x.z)
- {
- x.x = 1.0; x.y = x.z = 0.0;
- }
- else
- {
- x.z = 1.0; x.y = x.z = 0.0;
- }
- }
- else
- {
- if (x.y < x.z)
- {
- x.y = 1.0; x.x = x.z = 0.0;
- }
- else
- {
- x.z = 1.0; x.x = x.y = 0.0;
- }
- }
-
- u.x = x.x - from.x; u.y = x.y - from.y; u.z = x.z - from.z;
- v.x = x.x - to.x; v.y = x.y - to.y; v.z = x.z - to.z;
-
- const float c1 = 2.0f / (u * u);
- const float c2 = 2.0f / (v * v);
- const float c3 = c1 * c2 * (u * v);
-
- for (unsigned int i = 0; i < 3; i++)
- {
- for (unsigned int j = 0; j < 3; j++)
- {
- mtx[i][j] = - c1 * u[i] * u[j] - c2 * v[i] * v[j]
- + c3 * v[i] * u[j];
- }
- mtx[i][i] += 1.0;
- }
- }
- else /* the most common case, unless "from"="to", or "from"=-"to" */
- {
- const aiVector3D v = from ^ to;
- /* ... use this hand optimized version (9 mults less) */
- const float h = 1.0f/(1.0f + e); /* optimization by Gottfried Chen */
- const float hvx = h * v.x;
- const float hvz = h * v.z;
- const float hvxy = hvx * v.y;
- const float hvxz = hvx * v.z;
- const float hvyz = hvz * v.y;
- mtx[0][0] = e + hvx * v.x;
- mtx[0][1] = hvxy - v.z;
- mtx[0][2] = hvxz + v.y;
-
- mtx[1][0] = hvxy + v.z;
- mtx[1][1] = e + h * v.y * v.y;
- mtx[1][2] = hvyz - v.x;
-
- mtx[2][0] = hvxz - v.y;
- mtx[2][1] = hvyz + v.x;
- mtx[2][2] = e + hvz * v.z;
- }
- return mtx;
-}
-
-
-#endif // __cplusplus
-#endif // AI_MATRIX3x3_INL_INC
diff --git a/3rdparty/assimp/include/aiMatrix4x4.h b/3rdparty/assimp/include/aiMatrix4x4.h
deleted file mode 100644
index 625c9b9a..00000000
--- a/3rdparty/assimp/include/aiMatrix4x4.h
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-/** @file aiMatrix4x4.h
- * @brief 4x4 matrix structure, including operators when compiling in C++
- */
-#ifndef AI_MATRIX4X4_H_INC
-#define AI_MATRIX4X4_H_INC
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct aiMatrix3x3;
-struct aiQuaternion;
-
-#include "./Compiler/pushpack1.h"
-
-// ---------------------------------------------------------------------------
-/** @brief Represents a row-major 4x4 matrix, use this for homogeneous
- * coordinates.
- *
- * There's much confusion about matrix layouts (colum vs. row order).
- * This is *always* a row-major matrix. Even with the
- * aiProcess_ConvertToLeftHanded flag.
- */
-struct aiMatrix4x4
-{
-#ifdef __cplusplus
-
- // default c'tor, init to zero
- aiMatrix4x4 () :
- a1(1.0f), a2(0.0f), a3(0.0f), a4(0.0f),
- b1(0.0f), b2(1.0f), b3(0.0f), b4(0.0f),
- c1(0.0f), c2(0.0f), c3(1.0f), c4(0.0f),
- d1(0.0f), d2(0.0f), d3(0.0f), d4(1.0f)
- {}
-
- // from single values
- aiMatrix4x4 ( float _a1, float _a2, float _a3, float _a4,
- float _b1, float _b2, float _b3, float _b4,
- float _c1, float _c2, float _c3, float _c4,
- float _d1, float _d2, float _d3, float _d4) :
- a1(_a1), a2(_a2), a3(_a3), a4(_a4),
- b1(_b1), b2(_b2), b3(_b3), b4(_b4),
- c1(_c1), c2(_c2), c3(_c3), c4(_c4),
- d1(_d1), d2(_d2), d3(_d3), d4(_d4)
- {}
-
-
- // -------------------------------------------------------------------
- /** @brief Constructor from 3x3 matrix.
- * The remaining elements are set to identity.
- */
- explicit aiMatrix4x4( const aiMatrix3x3& m);
-
-public:
-
- // array access operators
- float* operator[] (unsigned int p_iIndex);
- const float* operator[] (unsigned int p_iIndex) const;
-
- // comparison operators
- bool operator== (const aiMatrix4x4 m) const;
- bool operator!= (const aiMatrix4x4 m) const;
-
- // Matrix multiplication. Not commutative.
- aiMatrix4x4& operator *= (const aiMatrix4x4& m);
- aiMatrix4x4 operator * (const aiMatrix4x4& m) const;
-
-public:
-
- // -------------------------------------------------------------------
- /** @brief Transpose the matrix
- */
- aiMatrix4x4& Transpose();
-
- // -------------------------------------------------------------------
- /** @brief Invert the matrix.
- * If the matrix is not invertible all elements are set to qnan.
- * Beware, use (f != f) to check whether a float f is qnan.
- */
- aiMatrix4x4& Inverse();
- float Determinant() const;
-
-
- // -------------------------------------------------------------------
- /** @brief Returns true of the matrix is the identity matrix.
- * The check is performed against a not so small epsilon.
- */
- inline bool IsIdentity() const;
-
- // -------------------------------------------------------------------
- /** @brief Decompose a trafo matrix into its original components
- * @param scaling Receives the output scaling for the x,y,z axes
- * @param rotation Receives the output rotation as a hamilton
- * quaternion
- * @param position Receives the output position for the x,y,z axes
- */
- void Decompose (aiVector3D& scaling, aiQuaternion& rotation,
- aiVector3D& position) const;
-
- // -------------------------------------------------------------------
- /** @brief Decompose a trafo matrix with no scaling into its
- * original components
- * @param rotation Receives the output rotation as a hamilton
- * quaternion
- * @param position Receives the output position for the x,y,z axes
- */
- void DecomposeNoScaling (aiQuaternion& rotation,
- aiVector3D& position) const;
-
-
- // -------------------------------------------------------------------
- /** @brief Creates a trafo matrix from a set of euler angles
- * @param x Rotation angle for the x-axis, in radians
- * @param y Rotation angle for the y-axis, in radians
- * @param z Rotation angle for the z-axis, in radians
- */
- aiMatrix4x4& FromEulerAnglesXYZ(float x, float y, float z);
- aiMatrix4x4& FromEulerAnglesXYZ(const aiVector3D& blubb);
-
-public:
- // -------------------------------------------------------------------
- /** @brief Returns a rotation matrix for a rotation around the x axis
- * @param a Rotation angle, in radians
- * @param out Receives the output matrix
- * @return Reference to the output matrix
- */
- static aiMatrix4x4& RotationX(float a, aiMatrix4x4& out);
-
- // -------------------------------------------------------------------
- /** @brief Returns a rotation matrix for a rotation around the y axis
- * @param a Rotation angle, in radians
- * @param out Receives the output matrix
- * @return Reference to the output matrix
- */
- static aiMatrix4x4& RotationY(float a, aiMatrix4x4& out);
-
- // -------------------------------------------------------------------
- /** @brief Returns a rotation matrix for a rotation around the z axis
- * @param a Rotation angle, in radians
- * @param out Receives the output matrix
- * @return Reference to the output matrix
- */
- static aiMatrix4x4& RotationZ(float a, aiMatrix4x4& out);
-
- // -------------------------------------------------------------------
- /** Returns a rotation matrix for a rotation around an arbitrary axis.
- * @param a Rotation angle, in radians
- * @param axis Rotation axis, should be a normalized vector.
- * @param out Receives the output matrix
- * @return Reference to the output matrix
- */
- static aiMatrix4x4& Rotation(float a, const aiVector3D& axis,
- aiMatrix4x4& out);
-
- // -------------------------------------------------------------------
- /** @brief Returns a translation matrix
- * @param v Translation vector
- * @param out Receives the output matrix
- * @return Reference to the output matrix
- */
- static aiMatrix4x4& Translation( const aiVector3D& v, aiMatrix4x4& out);
-
- // -------------------------------------------------------------------
- /** @brief Returns a scaling matrix
- * @param v Scaling vector
- * @param out Receives the output matrix
- * @return Reference to the output matrix
- */
- static aiMatrix4x4& Scaling( const aiVector3D& v, aiMatrix4x4& out);
-
- // -------------------------------------------------------------------
- /** @brief A function for creating a rotation matrix that rotates a
- * vector called "from" into another vector called "to".
- * Input : from[3], to[3] which both must be *normalized* non-zero vectors
- * Output: mtx[3][3] -- a 3x3 matrix in colum-major form
- * Authors: Tomas Möller, John Hughes
- * "Efficiently Building a Matrix to Rotate One Vector to Another"
- * Journal of Graphics Tools, 4(4):1-4, 1999
- */
- static aiMatrix4x4& FromToMatrix(const aiVector3D& from,
- const aiVector3D& to, aiMatrix4x4& out);
-
-#endif // __cplusplus
-
- float a1, a2, a3, a4;
- float b1, b2, b3, b4;
- float c1, c2, c3, c4;
- float d1, d2, d3, d4;
-
-} PACK_STRUCT; // !class aiMatrix4x4
-
-
-#include "./Compiler/poppack1.h"
-
-#ifdef __cplusplus
-} // end extern "C"
-
-
-#endif // __cplusplus
-#endif // AI_MATRIX4X4_H_INC
diff --git a/3rdparty/assimp/include/aiMatrix4x4.inl b/3rdparty/assimp/include/aiMatrix4x4.inl
deleted file mode 100644
index c24fcede..00000000
--- a/3rdparty/assimp/include/aiMatrix4x4.inl
+++ /dev/null
@@ -1,419 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file aiMatrix4x4.inl
- * @brief Inline implementation of the 4x4 matrix operators
- */
-#ifndef AI_MATRIX4x4_INL_INC
-#define AI_MATRIX4x4_INL_INC
-
-#include "aiMatrix4x4.h"
-
-#ifdef __cplusplus
-#include "aiMatrix3x3.h"
-
-#include <algorithm>
-#include <limits>
-#include <math.h>
-
-#include "aiAssert.h"
-#include "aiQuaternion.h"
-
-// ----------------------------------------------------------------------------------------
-inline aiMatrix4x4::aiMatrix4x4( const aiMatrix3x3& m)
-{
- a1 = m.a1; a2 = m.a2; a3 = m.a3; a4 = 0.0f;
- b1 = m.b1; b2 = m.b2; b3 = m.b3; b4 = 0.0f;
- c1 = m.c1; c2 = m.c2; c3 = m.c3; c4 = 0.0f;
- d1 = 0.0f; d2 = 0.0f; d3 = 0.0f; d4 = 1.0f;
-}
-
-// ----------------------------------------------------------------------------------------
-inline aiMatrix4x4& aiMatrix4x4::operator *= (const aiMatrix4x4& m)
-{
- *this = aiMatrix4x4(
- m.a1 * a1 + m.b1 * a2 + m.c1 * a3 + m.d1 * a4,
- m.a2 * a1 + m.b2 * a2 + m.c2 * a3 + m.d2 * a4,
- m.a3 * a1 + m.b3 * a2 + m.c3 * a3 + m.d3 * a4,
- m.a4 * a1 + m.b4 * a2 + m.c4 * a3 + m.d4 * a4,
- m.a1 * b1 + m.b1 * b2 + m.c1 * b3 + m.d1 * b4,
- m.a2 * b1 + m.b2 * b2 + m.c2 * b3 + m.d2 * b4,
- m.a3 * b1 + m.b3 * b2 + m.c3 * b3 + m.d3 * b4,
- m.a4 * b1 + m.b4 * b2 + m.c4 * b3 + m.d4 * b4,
- m.a1 * c1 + m.b1 * c2 + m.c1 * c3 + m.d1 * c4,
- m.a2 * c1 + m.b2 * c2 + m.c2 * c3 + m.d2 * c4,
- m.a3 * c1 + m.b3 * c2 + m.c3 * c3 + m.d3 * c4,
- m.a4 * c1 + m.b4 * c2 + m.c4 * c3 + m.d4 * c4,
- m.a1 * d1 + m.b1 * d2 + m.c1 * d3 + m.d1 * d4,
- m.a2 * d1 + m.b2 * d2 + m.c2 * d3 + m.d2 * d4,
- m.a3 * d1 + m.b3 * d2 + m.c3 * d3 + m.d3 * d4,
- m.a4 * d1 + m.b4 * d2 + m.c4 * d3 + m.d4 * d4);
- return *this;
-}
-
-// ----------------------------------------------------------------------------------------
-inline aiMatrix4x4 aiMatrix4x4::operator* (const aiMatrix4x4& m) const
-{
- aiMatrix4x4 temp( *this);
- temp *= m;
- return temp;
-}
-
-
-// ----------------------------------------------------------------------------------------
-inline aiMatrix4x4& aiMatrix4x4::Transpose()
-{
- // (float&) don't remove, GCC complains cause of packed fields
- std::swap( (float&)b1, (float&)a2);
- std::swap( (float&)c1, (float&)a3);
- std::swap( (float&)c2, (float&)b3);
- std::swap( (float&)d1, (float&)a4);
- std::swap( (float&)d2, (float&)b4);
- std::swap( (float&)d3, (float&)c4);
- return *this;
-}
-
-
-// ----------------------------------------------------------------------------------------
-inline float aiMatrix4x4::Determinant() const
-{
- return a1*b2*c3*d4 - a1*b2*c4*d3 + a1*b3*c4*d2 - a1*b3*c2*d4
- + a1*b4*c2*d3 - a1*b4*c3*d2 - a2*b3*c4*d1 + a2*b3*c1*d4
- - a2*b4*c1*d3 + a2*b4*c3*d1 - a2*b1*c3*d4 + a2*b1*c4*d3
- + a3*b4*c1*d2 - a3*b4*c2*d1 + a3*b1*c2*d4 - a3*b1*c4*d2
- + a3*b2*c4*d1 - a3*b2*c1*d4 - a4*b1*c2*d3 + a4*b1*c3*d2
- - a4*b2*c3*d1 + a4*b2*c1*d3 - a4*b3*c1*d2 + a4*b3*c2*d1;
-}
-
-// ----------------------------------------------------------------------------------------
-inline aiMatrix4x4& aiMatrix4x4::Inverse()
-{
- // Compute the reciprocal determinant
- float det = Determinant();
- if(det == 0.0f)
- {
- // Matrix not invertible. Setting all elements to nan is not really
- // correct in a mathematical sense but it is easy to debug for the
- // programmer.
- const float nan = std::numeric_limits<float>::quiet_NaN();
- *this = aiMatrix4x4(
- nan,nan,nan,nan,
- nan,nan,nan,nan,
- nan,nan,nan,nan,
- nan,nan,nan,nan);
-
- return *this;
- }
-
- float invdet = 1.0f / det;
-
- aiMatrix4x4 res;
- res.a1 = invdet * (b2 * (c3 * d4 - c4 * d3) + b3 * (c4 * d2 - c2 * d4) + b4 * (c2 * d3 - c3 * d2));
- res.a2 = -invdet * (a2 * (c3 * d4 - c4 * d3) + a3 * (c4 * d2 - c2 * d4) + a4 * (c2 * d3 - c3 * d2));
- res.a3 = invdet * (a2 * (b3 * d4 - b4 * d3) + a3 * (b4 * d2 - b2 * d4) + a4 * (b2 * d3 - b3 * d2));
- res.a4 = -invdet * (a2 * (b3 * c4 - b4 * c3) + a3 * (b4 * c2 - b2 * c4) + a4 * (b2 * c3 - b3 * c2));
- res.b1 = -invdet * (b1 * (c3 * d4 - c4 * d3) + b3 * (c4 * d1 - c1 * d4) + b4 * (c1 * d3 - c3 * d1));
- res.b2 = invdet * (a1 * (c3 * d4 - c4 * d3) + a3 * (c4 * d1 - c1 * d4) + a4 * (c1 * d3 - c3 * d1));
- res.b3 = -invdet * (a1 * (b3 * d4 - b4 * d3) + a3 * (b4 * d1 - b1 * d4) + a4 * (b1 * d3 - b3 * d1));
- res.b4 = invdet * (a1 * (b3 * c4 - b4 * c3) + a3 * (b4 * c1 - b1 * c4) + a4 * (b1 * c3 - b3 * c1));
- res.c1 = invdet * (b1 * (c2 * d4 - c4 * d2) + b2 * (c4 * d1 - c1 * d4) + b4 * (c1 * d2 - c2 * d1));
- res.c2 = -invdet * (a1 * (c2 * d4 - c4 * d2) + a2 * (c4 * d1 - c1 * d4) + a4 * (c1 * d2 - c2 * d1));
- res.c3 = invdet * (a1 * (b2 * d4 - b4 * d2) + a2 * (b4 * d1 - b1 * d4) + a4 * (b1 * d2 - b2 * d1));
- res.c4 = -invdet * (a1 * (b2 * c4 - b4 * c2) + a2 * (b4 * c1 - b1 * c4) + a4 * (b1 * c2 - b2 * c1));
- res.d1 = -invdet * (b1 * (c2 * d3 - c3 * d2) + b2 * (c3 * d1 - c1 * d3) + b3 * (c1 * d2 - c2 * d1));
- res.d2 = invdet * (a1 * (c2 * d3 - c3 * d2) + a2 * (c3 * d1 - c1 * d3) + a3 * (c1 * d2 - c2 * d1));
- res.d3 = -invdet * (a1 * (b2 * d3 - b3 * d2) + a2 * (b3 * d1 - b1 * d3) + a3 * (b1 * d2 - b2 * d1));
- res.d4 = invdet * (a1 * (b2 * c3 - b3 * c2) + a2 * (b3 * c1 - b1 * c3) + a3 * (b1 * c2 - b2 * c1));
- *this = res;
-
- return *this;
-}
-
-// ----------------------------------------------------------------------------------------
-inline float* aiMatrix4x4::operator[](unsigned int p_iIndex)
-{
- return &this->a1 + p_iIndex * 4;
-}
-
-// ----------------------------------------------------------------------------------------
-inline const float* aiMatrix4x4::operator[](unsigned int p_iIndex) const
-{
- return &this->a1 + p_iIndex * 4;
-}
-
-// ----------------------------------------------------------------------------------------
-inline bool aiMatrix4x4::operator== (const aiMatrix4x4 m) const
-{
- return (a1 == m.a1 && a2 == m.a2 && a3 == m.a3 && a4 == m.a4 &&
- b1 == m.b1 && b2 == m.b2 && b3 == m.b3 && b4 == m.b4 &&
- c1 == m.c1 && c2 == m.c2 && c3 == m.c3 && c4 == m.c4 &&
- d1 == m.d1 && d2 == m.d2 && d3 == m.d3 && d4 == m.d4);
-}
-
-// ----------------------------------------------------------------------------------------
-inline bool aiMatrix4x4::operator!= (const aiMatrix4x4 m) const
-{
- return !(*this == m);
-}
-
-// ----------------------------------------------------------------------------------------
-inline void aiMatrix4x4::Decompose (aiVector3D& scaling, aiQuaternion& rotation,
- aiVector3D& position) const
-{
- const aiMatrix4x4& _this = *this;
-
- // extract translation
- position.x = _this[0][3];
- position.y = _this[1][3];
- position.z = _this[2][3];
-
- // extract the rows of the matrix
- aiVector3D vRows[3] = {
- aiVector3D(_this[0][0],_this[1][0],_this[2][0]),
- aiVector3D(_this[0][1],_this[1][1],_this[2][1]),
- aiVector3D(_this[0][2],_this[1][2],_this[2][2])
- };
-
- // extract the scaling factors
- scaling.x = vRows[0].Length();
- scaling.y = vRows[1].Length();
- scaling.z = vRows[2].Length();
-
- // and remove all scaling from the matrix
- if(scaling.x)
- {
- vRows[0] /= scaling.x;
- }
- if(scaling.y)
- {
- vRows[1] /= scaling.y;
- }
- if(scaling.z)
- {
- vRows[2] /= scaling.z;
- }
-
- // build a 3x3 rotation matrix
- aiMatrix3x3 m(vRows[0].x,vRows[1].x,vRows[2].x,
- vRows[0].y,vRows[1].y,vRows[2].y,
- vRows[0].z,vRows[1].z,vRows[2].z);
-
- // and generate the rotation quaternion from it
- rotation = aiQuaternion(m);
-}
-
-// ----------------------------------------------------------------------------------------
-inline void aiMatrix4x4::DecomposeNoScaling (aiQuaternion& rotation,
- aiVector3D& position) const
-{
- const aiMatrix4x4& _this = *this;
-
- // extract translation
- position.x = _this[0][3];
- position.y = _this[1][3];
- position.z = _this[2][3];
-
- // extract rotation
- rotation = aiQuaternion((aiMatrix3x3)_this);
-}
-
-// ----------------------------------------------------------------------------------------
-inline aiMatrix4x4& aiMatrix4x4::FromEulerAnglesXYZ(const aiVector3D& blubb)
-{
- return FromEulerAnglesXYZ(blubb.x,blubb.y,blubb.z);
-}
-
-// ----------------------------------------------------------------------------------------
-inline aiMatrix4x4& aiMatrix4x4::FromEulerAnglesXYZ(float x, float y, float z)
-{
- aiMatrix4x4& _this = *this;
-
- float cr = cos( x );
- float sr = sin( x );
- float cp = cos( y );
- float sp = sin( y );
- float cy = cos( z );
- float sy = sin( z );
-
- _this.a1 = cp*cy ;
- _this.a2 = cp*sy;
- _this.a3 = -sp ;
-
- float srsp = sr*sp;
- float crsp = cr*sp;
-
- _this.b1 = srsp*cy-cr*sy ;
- _this.b2 = srsp*sy+cr*cy ;
- _this.b3 = sr*cp ;
-
- _this.c1 = crsp*cy+sr*sy ;
- _this.c2 = crsp*sy-sr*cy ;
- _this.c3 = cr*cp ;
-
- return *this;
-}
-
-// ----------------------------------------------------------------------------------------
-inline bool aiMatrix4x4::IsIdentity() const
-{
- // Use a small epsilon to solve floating-point inaccuracies
- const static float epsilon = 10e-3f;
-
- return (a2 <= epsilon && a2 >= -epsilon &&
- a3 <= epsilon && a3 >= -epsilon &&
- a4 <= epsilon && a4 >= -epsilon &&
- b1 <= epsilon && b1 >= -epsilon &&
- b3 <= epsilon && b3 >= -epsilon &&
- b4 <= epsilon && b4 >= -epsilon &&
- c1 <= epsilon && c1 >= -epsilon &&
- c2 <= epsilon && c2 >= -epsilon &&
- c4 <= epsilon && c4 >= -epsilon &&
- d1 <= epsilon && d1 >= -epsilon &&
- d2 <= epsilon && d2 >= -epsilon &&
- d3 <= epsilon && d3 >= -epsilon &&
- a1 <= 1.f+epsilon && a1 >= 1.f-epsilon &&
- b2 <= 1.f+epsilon && b2 >= 1.f-epsilon &&
- c3 <= 1.f+epsilon && c3 >= 1.f-epsilon &&
- d4 <= 1.f+epsilon && d4 >= 1.f-epsilon);
-}
-
-// ----------------------------------------------------------------------------------------
-inline aiMatrix4x4& aiMatrix4x4::RotationX(float a, aiMatrix4x4& out)
-{
- /*
- | 1 0 0 0 |
- M = | 0 cos(A) -sin(A) 0 |
- | 0 sin(A) cos(A) 0 |
- | 0 0 0 1 | */
- out = aiMatrix4x4();
- out.b2 = out.c3 = cos(a);
- out.b3 = -(out.c2 = sin(a));
- return out;
-}
-
-// ----------------------------------------------------------------------------------------
-inline aiMatrix4x4& aiMatrix4x4::RotationY(float a, aiMatrix4x4& out)
-{
- /*
- | cos(A) 0 sin(A) 0 |
- M = | 0 1 0 0 |
- | -sin(A) 0 cos(A) 0 |
- | 0 0 0 1 |
- */
- out = aiMatrix4x4();
- out.a1 = out.c3 = cos(a);
- out.c1 = -(out.a3 = sin(a));
- return out;
-}
-
-// ----------------------------------------------------------------------------------------
-inline aiMatrix4x4& aiMatrix4x4::RotationZ(float a, aiMatrix4x4& out)
-{
- /*
- | cos(A) -sin(A) 0 0 |
- M = | sin(A) cos(A) 0 0 |
- | 0 0 1 0 |
- | 0 0 0 1 | */
- out = aiMatrix4x4();
- out.a1 = out.b2 = cos(a);
- out.a2 = -(out.b1 = sin(a));
- return out;
-}
-
-// ----------------------------------------------------------------------------------------
-// Returns a rotation matrix for a rotation around an arbitrary axis.
-inline aiMatrix4x4& aiMatrix4x4::Rotation( float a, const aiVector3D& axis, aiMatrix4x4& out)
-{
- float c = cos( a), s = sin( a), t = 1 - c;
- float x = axis.x, y = axis.y, z = axis.z;
-
- // Many thanks to MathWorld and Wikipedia
- out.a1 = t*x*x + c; out.a2 = t*x*y - s*z; out.a3 = t*x*z + s*y;
- out.b1 = t*x*y + s*z; out.b2 = t*y*y + c; out.b3 = t*y*z - s*x;
- out.c1 = t*x*z - s*y; out.c2 = t*y*z + s*x; out.c3 = t*z*z + c;
- out.a4 = out.b4 = out.c4 = 0.0f;
- out.d1 = out.d2 = out.d3 = 0.0f;
- out.d4 = 1.0f;
-
- return out;
-}
-
-// ----------------------------------------------------------------------------------------
-inline aiMatrix4x4& aiMatrix4x4::Translation( const aiVector3D& v, aiMatrix4x4& out)
-{
- out = aiMatrix4x4();
- out.a4 = v.x;
- out.b4 = v.y;
- out.c4 = v.z;
- return out;
-}
-
-// ----------------------------------------------------------------------------------------
-inline aiMatrix4x4& aiMatrix4x4::Scaling( const aiVector3D& v, aiMatrix4x4& out)
-{
- out = aiMatrix4x4();
- out.a1 = v.x;
- out.b2 = v.y;
- out.c3 = v.z;
- return out;
-}
-
-// ----------------------------------------------------------------------------------------
-/** A function for creating a rotation matrix that rotates a vector called
- * "from" into another vector called "to".
- * Input : from[3], to[3] which both must be *normalized* non-zero vectors
- * Output: mtx[3][3] -- a 3x3 matrix in colum-major form
- * Authors: Tomas Möller, John Hughes
- * "Efficiently Building a Matrix to Rotate One Vector to Another"
- * Journal of Graphics Tools, 4(4):1-4, 1999
- */
-// ----------------------------------------------------------------------------------------
-inline aiMatrix4x4& aiMatrix4x4::FromToMatrix(const aiVector3D& from,
- const aiVector3D& to, aiMatrix4x4& mtx)
-{
- aiMatrix3x3 m3;
- aiMatrix3x3::FromToMatrix(from,to,m3);
- mtx = aiMatrix4x4(m3);
- return mtx;
-}
-
-#endif // __cplusplus
-#endif // AI_MATRIX4x4_INL_INC
diff --git a/3rdparty/assimp/include/aiMesh.h b/3rdparty/assimp/include/aiMesh.h
deleted file mode 100644
index 1fec346d..00000000
--- a/3rdparty/assimp/include/aiMesh.h
+++ /dev/null
@@ -1,733 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file aiMesh.h
- * @brief Declares the data structures in which the imported geometry is
- returned by ASSIMP: aiMesh, aiFace and aiBone data structures.
- */
-#ifndef INCLUDED_AI_MESH_H
-#define INCLUDED_AI_MESH_H
-
-#include "aiTypes.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// ---------------------------------------------------------------------------
-// Limits. These values are required to match the settings Assimp was
-// compiled against. Therfore, do not redefine them unless you build the
-// library from source using the same definitions.
-// ---------------------------------------------------------------------------
-
-/** @def AI_MAX_FACE_INDICES
- * Maximum number of indices per face (polygon). */
-
-#ifndef AI_MAX_FACE_INDICES
-# define AI_MAX_FACE_INDICES 0x7fff
-#endif
-
-/** @def AI_MAX_BONE_WEIGHTS
- * Maximum number of indices per face (polygon). */
-
-#ifndef AI_MAX_BONE_WEIGHTS
-# define AI_MAX_BONE_WEIGHTS 0x7fffffff
-#endif
-
-/** @def AI_MAX_VERTICES
- * Maximum number of vertices per mesh. */
-
-#ifndef AI_MAX_VERTICES
-# define AI_MAX_VERTICES 0x7fffffff
-#endif
-
-/** @def AI_MAX_FACES
- * Maximum number of faces per mesh. */
-
-#ifndef AI_MAX_FACES
-# define AI_MAX_FACES 0x7fffffff
-#endif
-
-/** @def AI_MAX_NUMBER_OF_COLOR_SETS
- * Supported number of vertex color sets per mesh. */
-
-#ifndef AI_MAX_NUMBER_OF_COLOR_SETS
-# define AI_MAX_NUMBER_OF_COLOR_SETS 0x4
-#endif // !! AI_MAX_NUMBER_OF_COLOR_SETS
-
-/** @def AI_MAX_NUMBER_OF_TEXTURECOORDS
- * Supported number of texture coord sets (UV(W) channels) per mesh */
-
-#ifndef AI_MAX_NUMBER_OF_TEXTURECOORDS
-# define AI_MAX_NUMBER_OF_TEXTURECOORDS 0x4
-#endif // !! AI_MAX_NUMBER_OF_TEXTURECOORDS
-
-// ---------------------------------------------------------------------------
-/** @brief A single face in a mesh, referring to multiple vertices.
- *
- * If mNumIndices is 3, we call the face 'triangle', for mNumIndices > 3
- * it's called 'polygon' (hey, that's just a definition!).
- * <br>
- * aiMesh::mPrimitiveTypes can be queried to quickly examine which types of
- * primitive are actually present in a mesh. The #aiProcess_SortByPType flag
- * executes a special post-processing algorithm which splits meshes with
- * *different* primitive types mixed up (e.g. lines and triangles) in several
- * 'clean' submeshes. Furthermore there is a configuration option (
- * #AI_CONFIG_PP_SBP_REMOVE) to force #aiProcess_SortByPType to remove
- * specific kinds of primitives from the imported scene, completely and forever.
- * In many cases you'll probably want to set this setting to
- * @code
- * aiPrimitiveType_LINE|aiPrimitiveType_POINT
- * @endcode
- * Together with the #aiProcess_Triangulate flag you can then be sure that
- * #aiFace::mNumIndices is always 3.
- * @note Take a look at the @link data Data Structures page @endlink for
- * more information on the layout and winding order of a face.
- */
-struct aiFace
-{
- //! Number of indices defining this face.
- //! The maximum value for this member is #AI_MAX_FACE_INDICES.
- unsigned int mNumIndices;
-
- //! Pointer to the indices array. Size of the array is given in numIndices.
- unsigned int* mIndices;
-
-#ifdef __cplusplus
-
- //! Default constructor
- aiFace()
- {
- mNumIndices = 0; mIndices = NULL;
- }
-
- //! Default destructor. Delete the index array
- ~aiFace()
- {
- delete [] mIndices;
- }
-
- //! Copy constructor. Copy the index array
- aiFace( const aiFace& o)
- {
- mIndices = NULL;
- *this = o;
- }
-
- //! Assignment operator. Copy the index array
- const aiFace& operator = ( const aiFace& o)
- {
- if (&o == this)
- return *this;
-
- delete[] mIndices;
- mNumIndices = o.mNumIndices;
- mIndices = new unsigned int[mNumIndices];
- ::memcpy( mIndices, o.mIndices, mNumIndices * sizeof( unsigned int));
- return *this;
- }
-
- //! Comparison operator. Checks whether the index array
- //! of two faces is identical
- bool operator== (const aiFace& o) const
- {
- if (mIndices == o.mIndices)return true;
- else if (mIndices && mNumIndices == o.mNumIndices)
- {
- for (unsigned int i = 0;i < this->mNumIndices;++i)
- if (mIndices[i] != o.mIndices[i])return false;
- return true;
- }
- return false;
- }
-
- //! Inverse comparison operator. Checks whether the index
- //! array of two faces is NOT identical
- bool operator != (const aiFace& o) const
- {
- return !(*this == o);
- }
-#endif // __cplusplus
-}; // struct aiFace
-
-
-// ---------------------------------------------------------------------------
-/** @brief A single influence of a bone on a vertex.
- */
-struct aiVertexWeight
-{
- //! Index of the vertex which is influenced by the bone.
- unsigned int mVertexId;
-
- //! The strength of the influence in the range (0...1).
- //! The influence from all bones at one vertex amounts to 1.
- float mWeight;
-
-#ifdef __cplusplus
-
- //! Default constructor
- aiVertexWeight() { }
-
- //! Initialisation from a given index and vertex weight factor
- //! \param pID ID
- //! \param pWeight Vertex weight factor
- aiVertexWeight( unsigned int pID, float pWeight)
- : mVertexId( pID), mWeight( pWeight)
- { /* nothing to do here */ }
-
-#endif // __cplusplus
-};
-
-
-// ---------------------------------------------------------------------------
-/** @brief A single bone of a mesh.
- *
- * A bone has a name by which it can be found in the frame hierarchy and by
- * which it can be addressed by animations. In addition it has a number of
- * influences on vertices.
- */
-struct aiBone
-{
- //! The name of the bone.
- C_STRUCT aiString mName;
-
- //! The number of vertices affected by this bone
- //! The maximum value for this member is #AI_MAX_BONE_WEIGHTS.
- unsigned int mNumWeights;
-
- //! The vertices affected by this bone
- C_STRUCT aiVertexWeight* mWeights;
-
- //! Matrix that transforms from mesh space to bone space in bind pose
- C_STRUCT aiMatrix4x4 mOffsetMatrix;
-
-#ifdef __cplusplus
-
- //! Default constructor
- aiBone()
- {
- mNumWeights = 0; mWeights = NULL;
- }
-
- //! Copy constructor
- aiBone(const aiBone& other)
- {
- mNumWeights = other.mNumWeights;
- mOffsetMatrix = other.mOffsetMatrix;
- mName = other.mName;
-
- if (other.mWeights && other.mNumWeights)
- {
- mWeights = new aiVertexWeight[mNumWeights];
- ::memcpy(mWeights,other.mWeights,mNumWeights * sizeof(aiVertexWeight));
- }
- }
-
- //! Destructor - deletes the array of vertex weights
- ~aiBone()
- {
- delete [] mWeights;
- }
-#endif // __cplusplus
-};
-
-
-// ---------------------------------------------------------------------------
-/** @brief Enumerates the types of geometric primitives supported by Assimp.
- *
- * @see aiFace Face data structure
- * @see aiProcess_SortByPType Per-primitive sorting of meshes
- * @see aiProcess_Triangulate Automatic triangulation
- * @see AI_CONFIG_PP_SBP_REMOVE Removal of specific primitive types.
- */
-enum aiPrimitiveType
-{
- /** A point primitive.
- *
- * This is just a single vertex in the virtual world,
- * #aiFace contains just one index for such a primitive.
- */
- aiPrimitiveType_POINT = 0x1,
-
- /** A line primitive.
- *
- * This is a line defined through a start and an end position.
- * #aiFace contains exactly two indices for such a primitive.
- */
- aiPrimitiveType_LINE = 0x2,
-
- /** A triangular primitive.
- *
- * A triangle consists of three indices.
- */
- aiPrimitiveType_TRIANGLE = 0x4,
-
- /** A higher-level polygon with more than 3 edges.
- *
- * A triangle is a polygon, but polygon in this context means
- * "all polygons that are not triangles". The "Triangulate"-Step
- * is provided for your convenience, it splits all polygons in
- * triangles (which are much easier to handle).
- */
- aiPrimitiveType_POLYGON = 0x8,
-
-
- /** This value is not used. It is just here to force the
- * compiler to map this enum to a 32 Bit integer.
- */
-#ifndef SWIG
- _aiPrimitiveType_Force32Bit = 0x9fffffff
-#endif
-}; //! enum aiPrimitiveType
-
-// Get the #aiPrimitiveType flag for a specific number of face indices
-#define AI_PRIMITIVE_TYPE_FOR_N_INDICES(n) \
- ((n) > 3 ? aiPrimitiveType_POLYGON : (aiPrimitiveType)(1u << ((n)-1)))
-
-
-
-// ---------------------------------------------------------------------------
-/** @brief NOT CURRENTLY IN USE. An AnimMesh is an attachment to an #aiMesh stores per-vertex
- * animations for a particular frame.
- *
- * You may think of an #aiAnimMesh as a `patch` for the host mesh, which
- * replaces only certain vertex data streams at a particular time.
- * Each mesh stores n attached attached meshes (#aiMesh::mAnimMeshes).
- * The actual relationship between the time line and anim meshes is
- * established by #aiMeshAnim, which references singular mesh attachments
- * by their ID and binds them to a time offset.
-*/
-struct aiAnimMesh
-{
- /** Replacement for aiMesh::mVertices. If this array is non-NULL,
- * it *must* contain mNumVertices entries. The corresponding
- * array in the host mesh must be non-NULL as well - animation
- * meshes may neither add or nor remove vertex components (if
- * a replacement array is NULL and the corresponding source
- * array is not, the source data is taken instead)*/
- C_STRUCT aiVector3D* mVertices;
-
- /** Replacement for aiMesh::mNormals. */
- C_STRUCT aiVector3D* mNormals;
-
- /** Replacement for aiMesh::mTangents. */
- C_STRUCT aiVector3D* mTangents;
-
- /** Replacement for aiMesh::mBitangents. */
- C_STRUCT aiVector3D* mBitangents;
-
- /** Replacement for aiMesh::mColors */
- C_STRUCT aiColor4D* mColors[AI_MAX_NUMBER_OF_COLOR_SETS];
-
- /** Replacement for aiMesh::mTextureCoords */
- C_STRUCT aiVector3D* mTextureCoords[AI_MAX_NUMBER_OF_TEXTURECOORDS];
-
- /** The number of vertices in the aiAnimMesh, and thus the length of all
- * the member arrays.
- *
- * This has always the same value as the mNumVertices property in the
- * corresponding aiMesh. It is duplicated here merely to make the length
- * of the member arrays accessible even if the aiMesh is not known, e.g.
- * from language bindings.
- */
- unsigned int mNumVertices;
-
-#ifdef __cplusplus
-
- aiAnimMesh()
- : mVertices()
- , mNormals()
- , mTangents()
- , mBitangents()
- {
- // fixme consider moving this to the ctor initializer list as well
- for ( unsigned int a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; a++){
- mTextureCoords[a] = NULL;
- }
- for ( unsigned int a = 0; a < AI_MAX_NUMBER_OF_COLOR_SETS; a++) {
- mColors[a] = NULL;
- }
- }
-
- ~aiAnimMesh()
- {
- delete [] mVertices;
- delete [] mNormals;
- delete [] mTangents;
- delete [] mBitangents;
- for ( unsigned int a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; a++) {
- delete [] mTextureCoords[a];
- }
- for ( unsigned int a = 0; a < AI_MAX_NUMBER_OF_COLOR_SETS; a++) {
- delete [] mColors[a];
- }
- }
-
- /** Check whether the anim mesh overrides the vertex positions
- * of its host mesh*/
- bool HasPositions() const {
- return mVertices != NULL;
- }
-
- /** Check whether the anim mesh overrides the vertex normals
- * of its host mesh*/
- bool HasNormals() const {
- return mNormals != NULL;
- }
-
- /** Check whether the anim mesh overrides the vertex tangents
- * and bitangents of its host mesh. As for aiMesh,
- * tangents and bitangents always go together. */
- bool HasTangentsAndBitangents() const {
- return mTangents != NULL;
- }
-
- /** Check whether the anim mesh overrides a particular
- * set of vertex colors on his host mesh.
- * @param pIndex 0<index<AI_MAX_NUMBER_OF_COLOR_SETS */
- bool HasVertexColors( unsigned int pIndex) const {
- return pIndex >= AI_MAX_NUMBER_OF_COLOR_SETS ? false : mColors[pIndex] != NULL;
- }
-
- /** Check whether the anim mesh overrides a particular
- * set of texture coordinates on his host mesh.
- * @param pIndex 0<index<AI_MAX_NUMBER_OF_TEXTURECOORDS */
- bool HasTextureCoords( unsigned int pIndex) const {
- return pIndex >= AI_MAX_NUMBER_OF_TEXTURECOORDS ? false : mTextureCoords[pIndex] != NULL;
- }
-
-#endif
-};
-
-
-// ---------------------------------------------------------------------------
-/** @brief A mesh represents a geometry or model with a single material.
-*
-* It usually consists of a number of vertices and a series of primitives/faces
-* referencing the vertices. In addition there might be a series of bones, each
-* of them addressing a number of vertices with a certain weight. Vertex data
-* is presented in channels with each channel containing a single per-vertex
-* information such as a set of texture coords or a normal vector.
-* If a data pointer is non-null, the corresponding data stream is present.
-* From C++-programs you can also use the comfort functions Has*() to
-* test for the presence of various data streams.
-*
-* A Mesh uses only a single material which is referenced by a material ID.
-* @note The mPositions member is usually not optional. However, vertex positions
-* *could* be missing if the #AI_SCENE_FLAGS_INCOMPLETE flag is set in
-* @code
-* aiScene::mFlags
-* @endcode
-*/
-struct aiMesh
-{
- /** Bitwise combination of the members of the #aiPrimitiveType enum.
- * This specifies which types of primitives are present in the mesh.
- * The "SortByPrimitiveType"-Step can be used to make sure the
- * output meshes consist of one primitive type each.
- */
- unsigned int mPrimitiveTypes;
-
- /** The number of vertices in this mesh.
- * This is also the size of all of the per-vertex data arrays.
- * The maximum value for this member is #AI_MAX_VERTICES.
- */
- unsigned int mNumVertices;
-
- /** The number of primitives (triangles, polygons, lines) in this mesh.
- * This is also the size of the mFaces array.
- * The maximum value for this member is #AI_MAX_FACES.
- */
- unsigned int mNumFaces;
-
- /** Vertex positions.
- * This array is always present in a mesh. The array is
- * mNumVertices in size.
- */
- C_STRUCT aiVector3D* mVertices;
-
- /** Vertex normals.
- * The array contains normalized vectors, NULL if not present.
- * The array is mNumVertices in size. Normals are undefined for
- * point and line primitives. A mesh consisting of points and
- * lines only may not have normal vectors. Meshes with mixed
- * primitive types (i.e. lines and triangles) may have normals,
- * but the normals for vertices that are only referenced by
- * point or line primitives are undefined and set to QNaN (WARN:
- * qNaN compares to inequal to *everything*, even to qNaN itself.
- * Using code like this to check whether a field is qnan is:
- * @code
- * #define IS_QNAN(f) (f != f)
- * @endcode
- * still dangerous because even 1.f == 1.f could evaluate to false! (
- * remember the subtleties of IEEE754 artithmetics). Use stuff like
- * @c fpclassify instead.
- * @note Normal vectors computed by Assimp are always unit-length.
- * However, this needn't apply for normals that have been taken
- * directly from the model file.
- */
- C_STRUCT aiVector3D* mNormals;
-
- /** Vertex tangents.
- * The tangent of a vertex points in the direction of the positive
- * X texture axis. The array contains normalized vectors, NULL if
- * not present. The array is mNumVertices in size. A mesh consisting
- * of points and lines only may not have normal vectors. Meshes with
- * mixed primitive types (i.e. lines and triangles) may have
- * normals, but the normals for vertices that are only referenced by
- * point or line primitives are undefined and set to qNaN. See
- * the #mNormals member for a detailled discussion of qNaNs.
- * @note If the mesh contains tangents, it automatically also
- * contains bitangents (the bitangent is just the cross product of
- * tangent and normal vectors).
- */
- C_STRUCT aiVector3D* mTangents;
-
- /** Vertex bitangents.
- * The bitangent of a vertex points in the direction of the positive
- * Y texture axis. The array contains normalized vectors, NULL if not
- * present. The array is mNumVertices in size.
- * @note If the mesh contains tangents, it automatically also contains
- * bitangents.
- */
- C_STRUCT aiVector3D* mBitangents;
-
- /** Vertex color sets.
- * A mesh may contain 0 to #AI_MAX_NUMBER_OF_COLOR_SETS vertex
- * colors per vertex. NULL if not present. Each array is
- * mNumVertices in size if present.
- */
- C_STRUCT aiColor4D* mColors[AI_MAX_NUMBER_OF_COLOR_SETS];
-
- /** Vertex texture coords, also known as UV channels.
- * A mesh may contain 0 to AI_MAX_NUMBER_OF_TEXTURECOORDS per
- * vertex. NULL if not present. The array is mNumVertices in size.
- */
- C_STRUCT aiVector3D* mTextureCoords[AI_MAX_NUMBER_OF_TEXTURECOORDS];
-
- /** Specifies the number of components for a given UV channel.
- * Up to three channels are supported (UVW, for accessing volume
- * or cube maps). If the value is 2 for a given channel n, the
- * component p.z of mTextureCoords[n][p] is set to 0.0f.
- * If the value is 1 for a given channel, p.y is set to 0.0f, too.
- * @note 4D coords are not supported
- */
- unsigned int mNumUVComponents[AI_MAX_NUMBER_OF_TEXTURECOORDS];
-
- /** The faces the mesh is constructed from.
- * Each face refers to a number of vertices by their indices.
- * This array is always present in a mesh, its size is given
- * in mNumFaces. If the #AI_SCENE_FLAGS_NON_VERBOSE_FORMAT
- * is NOT set each face references an unique set of vertices.
- */
- C_STRUCT aiFace* mFaces;
-
- /** The number of bones this mesh contains.
- * Can be 0, in which case the mBones array is NULL.
- */
- unsigned int mNumBones;
-
- /** The bones of this mesh.
- * A bone consists of a name by which it can be found in the
- * frame hierarchy and a set of vertex weights.
- */
- C_STRUCT aiBone** mBones;
-
- /** The material used by this mesh.
- * A mesh does use only a single material. If an imported model uses
- * multiple materials, the import splits up the mesh. Use this value
- * as index into the scene's material list.
- */
- unsigned int mMaterialIndex;
-
- /** Name of the mesh. Meshes can be named, but this is not a
- * requirement and leaving this field empty is totally fine.
- * There are mainly three uses for mesh names:
- * - some formats name nodes and meshes independently.
- * - importers tend to split meshes up to meet the
- * one-material-per-mesh requirement. Assigning
- * the same (dummy) name to each of the result meshes
- * aids the caller at recovering the original mesh
- * partitioning.
- * - Vertex animations refer to meshes by their names.
- **/
- C_STRUCT aiString mName;
-
-
- /** NOT CURRENTLY IN USE. The number of attachment meshes */
- unsigned int mNumAnimMeshes;
-
- /** NOT CURRENTLY IN USE. Attachment meshes for this mesh, for vertex-based animation.
- * Attachment meshes carry replacement data for some of the
- * mesh'es vertex components (usually positions, normals). */
- C_STRUCT aiAnimMesh** mAnimMeshes;
-
-
-#ifdef __cplusplus
-
- //! Default constructor. Initializes all members to 0
- aiMesh()
- {
- mNumVertices = 0;
- mNumFaces = 0;
-
- mNumAnimMeshes = 0;
-
- mPrimitiveTypes = 0;
- mVertices = NULL; mFaces = NULL;
- mNormals = NULL; mTangents = NULL;
- mBitangents = NULL;
- mAnimMeshes = NULL;
-
- for ( unsigned int a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; a++)
- {
- mNumUVComponents[a] = 0;
- mTextureCoords[a] = NULL;
- }
- for ( unsigned int a = 0; a < AI_MAX_NUMBER_OF_COLOR_SETS; a++)
- mColors[a] = NULL;
- mNumBones = 0; mBones = NULL;
- mMaterialIndex = 0;
- }
-
- //! Deletes all storage allocated for the mesh
- ~aiMesh()
- {
- delete [] mVertices;
- delete [] mNormals;
- delete [] mTangents;
- delete [] mBitangents;
- for ( unsigned int a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; a++) {
- delete [] mTextureCoords[a];
- }
- for ( unsigned int a = 0; a < AI_MAX_NUMBER_OF_COLOR_SETS; a++) {
- delete [] mColors[a];
- }
-
- // DO NOT REMOVE THIS ADDITIONAL CHECK
- if (mNumBones && mBones) {
- for ( unsigned int a = 0; a < mNumBones; a++) {
- delete mBones[a];
- }
- delete [] mBones;
- }
-
- if (mNumAnimMeshes && mAnimMeshes) {
- for ( unsigned int a = 0; a < mNumAnimMeshes; a++) {
- delete mAnimMeshes[a];
- }
- delete [] mAnimMeshes;
- }
-
- delete [] mFaces;
- }
-
- //! Check whether the mesh contains positions. Provided no special
- //! scene flags are set (such as #AI_SCENE_FLAGS_ANIM_SKELETON_ONLY),
- //! this will always be true
- bool HasPositions() const
- { return mVertices != NULL && mNumVertices > 0; }
-
- //! Check whether the mesh contains faces. If no special scene flags
- //! are set this should always return true
- bool HasFaces() const
- { return mFaces != NULL && mNumFaces > 0; }
-
- //! Check whether the mesh contains normal vectors
- bool HasNormals() const
- { return mNormals != NULL && mNumVertices > 0; }
-
- //! Check whether the mesh contains tangent and bitangent vectors
- //! It is not possible that it contains tangents and no bitangents
- //! (or the other way round). The existence of one of them
- //! implies that the second is there, too.
- bool HasTangentsAndBitangents() const
- { return mTangents != NULL && mBitangents != NULL && mNumVertices > 0; }
-
- //! Check whether the mesh contains a vertex color set
- //! \param pIndex Index of the vertex color set
- bool HasVertexColors( unsigned int pIndex) const
- {
- if ( pIndex >= AI_MAX_NUMBER_OF_COLOR_SETS)
- return false;
- else
- return mColors[pIndex] != NULL && mNumVertices > 0;
- }
-
- //! Check whether the mesh contains a texture coordinate set
- //! \param pIndex Index of the texture coordinates set
- bool HasTextureCoords( unsigned int pIndex) const
- {
- if ( pIndex >= AI_MAX_NUMBER_OF_TEXTURECOORDS)
- return false;
- else
- return mTextureCoords[pIndex] != NULL && mNumVertices > 0;
- }
-
- //! Get the number of UV channels the mesh contains
- unsigned int GetNumUVChannels() const
- {
- unsigned int n = 0;
- while (n < AI_MAX_NUMBER_OF_TEXTURECOORDS && mTextureCoords[n])++n;
- return n;
- }
-
- //! Get the number of vertex color channels the mesh contains
- unsigned int GetNumColorChannels() const
- {
- unsigned int n = 0;
- while (n < AI_MAX_NUMBER_OF_COLOR_SETS && mColors[n])++n;
- return n;
- }
-
- //! Check whether the mesh contains bones
- inline bool HasBones() const
- { return mBones != NULL && mNumBones > 0; }
-
-#endif // __cplusplus
-};
-
-
-#ifdef __cplusplus
-}
-#endif //! extern "C"
-#endif // __AI_MESH_H_INC
-
diff --git a/3rdparty/assimp/include/aiPostProcess.h b/3rdparty/assimp/include/aiPostProcess.h
deleted file mode 100644
index f9a23107..00000000
--- a/3rdparty/assimp/include/aiPostProcess.h
+++ /dev/null
@@ -1,604 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file aiPostProcess.h
- * @brief Definitions for import post processing steps
- */
-#ifndef AI_POSTPROCESS_H_INC
-#define AI_POSTPROCESS_H_INC
-
-#include "aiTypes.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// -----------------------------------------------------------------------------------
-/** @enum aiPostProcessSteps
- * @brief Defines the flags for all possible post processing steps.
- *
- * @see Importer::ReadFile
- * @see aiImportFile
- * @see aiImportFileEx
- */
-// -----------------------------------------------------------------------------------
-enum aiPostProcessSteps
-{
-
- // -------------------------------------------------------------------------
- /** <hr>Calculates the tangents and bitangents for the imported meshes.
- *
- * Does nothing if a mesh does not have normals. You might want this post
- * processing step to be executed if you plan to use tangent space calculations
- * such as normal mapping applied to the meshes. There's a config setting,
- * <tt>#AI_CONFIG_PP_CT_MAX_SMOOTHING_ANGLE</tt>, which allows you to specify
- * a maximum smoothing angle for the algorithm. However, usually you'll
- * want to leave it at the default value. Thanks.
- */
- aiProcess_CalcTangentSpace = 0x1,
-
- // -------------------------------------------------------------------------
- /** <hr>Identifies and joins identical vertex data sets within all
- * imported meshes.
- *
- * After this step is run each mesh does contain only unique vertices anymore,
- * so a vertex is possibly used by multiple faces. You usually want
- * to use this post processing step. If your application deals with
- * indexed geometry, this step is compulsory or you'll just waste rendering
- * time. <b>If this flag is not specified</b>, no vertices are referenced by
- * more than one face and <b>no index buffer is required</b> for rendering.
- */
- aiProcess_JoinIdenticalVertices = 0x2,
-
- // -------------------------------------------------------------------------
- /** <hr>Converts all the imported data to a left-handed coordinate space.
- *
- * By default the data is returned in a right-handed coordinate space which
- * for example OpenGL prefers. In this space, +X points to the right,
- * +Z points towards the viewer and and +Y points upwards. In the DirectX
- * coordinate space +X points to the right, +Y points upwards and +Z points
- * away from the viewer.
- *
- * You'll probably want to consider this flag if you use Direct3D for
- * rendering. The #aiProcess_ConvertToLeftHanded flag supersedes this
- * setting and bundles all conversions typically required for D3D-based
- * applications.
- */
- aiProcess_MakeLeftHanded = 0x4,
-
- // -------------------------------------------------------------------------
- /** <hr>Triangulates all faces of all meshes.
- *
- * By default the imported mesh data might contain faces with more than 3
- * indices. For rendering you'll usually want all faces to be triangles.
- * This post processing step splits up all higher faces to triangles.
- * Line and point primitives are *not* modified!. If you want
- * 'triangles only' with no other kinds of primitives, try the following
- * solution:
- * <ul>
- * <li>Specify both #aiProcess_Triangulate and #aiProcess_SortByPType </li>
- * </li>Ignore all point and line meshes when you process assimp's output</li>
- * </ul>
- */
- aiProcess_Triangulate = 0x8,
-
- // -------------------------------------------------------------------------
- /** <hr>Removes some parts of the data structure (animations, materials,
- * light sources, cameras, textures, vertex components).
- *
- * The components to be removed are specified in a separate
- * configuration option, <tt>#AI_CONFIG_PP_RVC_FLAGS</tt>. This is quite useful
- * if you don't need all parts of the output structure. Especially vertex
- * colors are rarely used today ... . Calling this step to remove unrequired
- * stuff from the pipeline as early as possible results in an increased
- * performance and a better optimized output data structure.
- * This step is also useful if you want to force Assimp to recompute
- * normals or tangents. The corresponding steps don't recompute them if
- * they're already there (loaded from the source asset). By using this
- * step you can make sure they are NOT there.
- *
- * This flag is a poor one, mainly because its purpose is usually
- * misunderstood. Consider the following case: a 3d model has been exported
- * from a CAD app, it has per-face vertex colors. Vertex positions can't be
- * shared, thus the #aiProcess_JoinIdenticalVertices step fails to
- * optimize the data. Just because these nasty, little vertex colors.
- * Most apps don't even process them, so it's all for nothing. By using
- * this step, unneeded components are excluded as early as possible
- * thus opening more room for internal optimzations.
- */
- aiProcess_RemoveComponent = 0x10,
-
- // -------------------------------------------------------------------------
- /** <hr>Generates normals for all faces of all meshes.
- *
- * This is ignored if normals are already there at the time where this flag
- * is evaluated. Model importers try to load them from the source file, so
- * they're usually already there. Face normals are shared between all points
- * of a single face, so a single point can have multiple normals, which in
- * other words, enforces the library to duplicate vertices in some cases.
- * #aiProcess_JoinIdenticalVertices is *senseless* then.
- *
- * This flag may not be specified together with #aiProcess_GenSmoothNormals.
- */
- aiProcess_GenNormals = 0x20,
-
- // -------------------------------------------------------------------------
- /** <hr>Generates smooth normals for all vertices in the mesh.
- *
- * This is ignored if normals are already there at the time where this flag
- * is evaluated. Model importers try to load them from the source file, so
- * they're usually already there.
- *
- * This flag may (of course) not be specified together with
- * #aiProcess_GenNormals. There's a configuration option,
- * <tt>#AI_CONFIG_PP_GSN_MAX_SMOOTHING_ANGLE</tt> which allows you to specify
- * an angle maximum for the normal smoothing algorithm. Normals exceeding
- * this limit are not smoothed, resulting in a a 'hard' seam between two faces.
- * Using a decent angle here (e.g. 80°) results in very good visual
- * appearance.
- */
- aiProcess_GenSmoothNormals = 0x40,
-
- // -------------------------------------------------------------------------
- /** <hr>Splits large meshes into smaller submeshes
- *
- * This is quite useful for realtime rendering where the number of triangles
- * which can be maximally processed in a single draw-call is usually limited
- * by the video driver/hardware. The maximum vertex buffer is usually limited,
- * too. Both requirements can be met with this step: you may specify both a
- * triangle and vertex limit for a single mesh.
- *
- * The split limits can (and should!) be set through the
- * <tt>#AI_CONFIG_PP_SLM_VERTEX_LIMIT</tt> and <tt>#AI_CONFIG_PP_SLM_TRIANGLE_LIMIT</tt>
- * settings. The default values are <tt>#AI_SLM_DEFAULT_MAX_VERTICES</tt> and
- * <tt>#AI_SLM_DEFAULT_MAX_TRIANGLES</tt>.
- *
- * Note that splitting is generally a time-consuming task, but not if there's
- * nothing to split. The use of this step is recommended for most users.
- */
- aiProcess_SplitLargeMeshes = 0x80,
-
- // -------------------------------------------------------------------------
- /** <hr>Removes the node graph and pre-transforms all vertices with
- * the local transformation matrices of their nodes. The output
- * scene does still contain nodes, however, there is only a
- * root node with children, each one referencing only one mesh,
- * each mesh referencing one material. For rendering, you can
- * simply render all meshes in order, you don't need to pay
- * attention to local transformations and the node hierarchy.
- * Animations are removed during this step.
- * This step is intended for applications without a scenegraph.
- * The step CAN cause some problems: if e.g. a mesh of the asset
- * contains normals and another, using the same material index, does not,
- * they will be brought together, but the first meshes's part of
- * the normal list is zeroed. However, these artifacts are rare.
- * @note The <tt>#AI_CONFIG_PP_PTV_NORMALIZE</tt> configuration property
- * can be set to normalize the scene's spatial dimension to the -1...1
- * range.
- */
- aiProcess_PreTransformVertices = 0x100,
-
- // -------------------------------------------------------------------------
- /** <hr>Limits the number of bones simultaneously affecting a single vertex
- * to a maximum value.
- *
- * If any vertex is affected by more than that number of bones, the least
- * important vertex weights are removed and the remaining vertex weights are
- * renormalized so that the weights still sum up to 1.
- * The default bone weight limit is 4 (defined as <tt>#AI_LMW_MAX_WEIGHTS</tt> in
- * aiConfig.h), but you can use the <tt>#AI_CONFIG_PP_LBW_MAX_WEIGHTS</tt> setting to
- * supply your own limit to the post processing step.
- *
- * If you intend to perform the skinning in hardware, this post processing
- * step might be of interest for you.
- */
- aiProcess_LimitBoneWeights = 0x200,
-
- // -------------------------------------------------------------------------
- /** <hr>Validates the imported scene data structure
- * This makes sure that all indices are valid, all animations and
- * bones are linked correctly, all material references are correct .. etc.
- *
- * It is recommended to capture Assimp's log output if you use this flag,
- * so you can easily find ot what's actually wrong if a file fails the
- * validation. The validator is quite rude and will find *all*
- * inconsistencies in the data structure ... plugin developers are
- * recommended to use it to debug their loaders. There are two types of
- * validation failures:
- * <ul>
- * <li>Error: There's something wrong with the imported data. Further
- * postprocessing is not possible and the data is not usable at all.
- * The import fails. #Importer::GetErrorString() or #aiGetErrorString()
- * carry the error message around.</li>
- * <li>Warning: There are some minor issues (e.g. 1000000 animation
- * keyframes with the same time), but further postprocessing and use
- * of the data structure is still safe. Warning details are written
- * to the log file, <tt>#AI_SCENE_FLAGS_VALIDATION_WARNING</tt> is set
- * in #aiScene::mFlags</li>
- * </ul>
- *
- * This post-processing step is not time-consuming. It's use is not
- * compulsory, but recommended.
- */
- aiProcess_ValidateDataStructure = 0x400,
-
- // -------------------------------------------------------------------------
- /** <hr>Reorders triangles for better vertex cache locality.
- *
- * The step tries to improve the ACMR (average post-transform vertex cache
- * miss ratio) for all meshes. The implementation runs in O(n) and is
- * roughly based on the 'tipsify' algorithm (see <a href="
- * http://www.cs.princeton.edu/gfx/pubs/Sander_2007_%3ETR/tipsy.pdf">this
- * paper</a>).
- *
- * If you intend to render huge models in hardware, this step might
- * be of interest for you. The <tt>#AI_CONFIG_PP_ICL_PTCACHE_SIZE</tt>config
- * setting can be used to fine-tune the cache optimization.
- */
- aiProcess_ImproveCacheLocality = 0x800,
-
- // -------------------------------------------------------------------------
- /** <hr>Searches for redundant/unreferenced materials and removes them.
- *
- * This is especially useful in combination with the
- * #aiProcess_PretransformVertices and #aiProcess_OptimizeMeshes flags.
- * Both join small meshes with equal characteristics, but they can't do
- * their work if two meshes have different materials. Because several
- * material settings are always lost during Assimp's import filters,
- * (and because many exporters don't check for redundant materials), huge
- * models often have materials which are are defined several times with
- * exactly the same settings ..
- *
- * Several material settings not contributing to the final appearance of
- * a surface are ignored in all comparisons ... the material name is
- * one of them. So, if you're passing additional information through the
- * content pipeline (probably using *magic* material names), don't
- * specify this flag. Alternatively take a look at the
- * <tt>#AI_CONFIG_PP_RRM_EXCLUDE_LIST</tt> setting.
- */
- aiProcess_RemoveRedundantMaterials = 0x1000,
-
- // -------------------------------------------------------------------------
- /** <hr>This step tries to determine which meshes have normal vectors
- * that are facing inwards. The algorithm is simple but effective:
- * the bounding box of all vertices + their normals is compared against
- * the volume of the bounding box of all vertices without their normals.
- * This works well for most objects, problems might occur with planar
- * surfaces. However, the step tries to filter such cases.
- * The step inverts all in-facing normals. Generally it is recommended
- * to enable this step, although the result is not always correct.
- */
- aiProcess_FixInfacingNormals = 0x2000,
-
- // -------------------------------------------------------------------------
- /** <hr>This step splits meshes with more than one primitive type in
- * homogeneous submeshes.
- *
- * The step is executed after the triangulation step. After the step
- * returns, just one bit is set in aiMesh::mPrimitiveTypes. This is
- * especially useful for real-time rendering where point and line
- * primitives are often ignored or rendered separately.
- * You can use the <tt>#AI_CONFIG_PP_SBP_REMOVE</tt> option to specify which
- * primitive types you need. This can be used to easily exclude
- * lines and points, which are rarely used, from the import.
- */
- aiProcess_SortByPType = 0x8000,
-
- // -------------------------------------------------------------------------
- /** <hr>This step searches all meshes for degenerated primitives and
- * converts them to proper lines or points.
- *
- * A face is 'degenerated' if one or more of its points are identical.
- * To have the degenerated stuff not only detected and collapsed but
- * also removed, try one of the following procedures:
- * <br><b>1.</b> (if you support lines&points for rendering but don't
- * want the degenerates)</br>
- * <ul>
- * <li>Specify the #aiProcess_FindDegenerates flag.
- * </li>
- * <li>Set the <tt>AI_CONFIG_PP_FD_REMOVE</tt> option to 1. This will
- * cause the step to remove degenerated triangles from the import
- * as soon as they're detected. They won't pass any further
- * pipeline steps.
- * </li>
- * </ul>
- * <br><b>2.</b>(if you don't support lines&points at all ...)</br>
- * <ul>
- * <li>Specify the #aiProcess_FindDegenerates flag.
- * </li>
- * <li>Specify the #aiProcess_SortByPType flag. This moves line and
- * point primitives to separate meshes.
- * </li>
- * <li>Set the <tt>AI_CONFIG_PP_SBP_REMOVE</tt> option to
- * @code aiPrimitiveType_POINTS | aiPrimitiveType_LINES
- * @endcode to cause SortByPType to reject point
- * and line meshes from the scene.
- * </li>
- * </ul>
- * @note Degenerated polygons are not necessarily evil and that's why
- * they're not removed by default. There are several file formats which
- * don't support lines or points ... some exporters bypass the
- * format specification and write them as degenerated triangle instead.
- */
- aiProcess_FindDegenerates = 0x10000,
-
- // -------------------------------------------------------------------------
- /** <hr>This step searches all meshes for invalid data, such as zeroed
- * normal vectors or invalid UV coords and removes/fixes them. This is
- * intended to get rid of some common exporter errors.
- *
- * This is especially useful for normals. If they are invalid, and
- * the step recognizes this, they will be removed and can later
- * be recomputed, i.e. by the #aiProcess_GenSmoothNormals flag.<br>
- * The step will also remove meshes that are infinitely small and reduce
- * animation tracks consisting of hundreds if redundant keys to a single
- * key. The <tt>AI_CONFIG_PP_FID_ANIM_ACCURACY</tt> config property decides
- * the accuracy of the check for duplicate animation tracks.
- */
- aiProcess_FindInvalidData = 0x20000,
-
- // -------------------------------------------------------------------------
- /** <hr>This step converts non-UV mappings (such as spherical or
- * cylindrical mapping) to proper texture coordinate channels.
- *
- * Most applications will support UV mapping only, so you will
- * probably want to specify this step in every case. Note tha Assimp is not
- * always able to match the original mapping implementation of the
- * 3d app which produced a model perfectly. It's always better to let the
- * father app compute the UV channels, at least 3ds max, maja, blender,
- * lightwave, modo, ... are able to achieve this.
- *
- * @note If this step is not requested, you'll need to process the
- * <tt>#AI_MATKEY_MAPPING</tt> material property in order to display all assets
- * properly.
- */
- aiProcess_GenUVCoords = 0x40000,
-
- // -------------------------------------------------------------------------
- /** <hr>This step applies per-texture UV transformations and bakes
- * them to stand-alone vtexture coordinate channelss.
- *
- * UV transformations are specified per-texture - see the
- * <tt>#AI_MATKEY_UVTRANSFORM</tt> material key for more information.
- * This step processes all textures with
- * transformed input UV coordinates and generates new (pretransformed) UV channel
- * which replace the old channel. Most applications won't support UV
- * transformations, so you will probably want to specify this step.
- *
- * @note UV transformations are usually implemented in realtime apps by
- * transforming texture coordinates at vertex shader stage with a 3x3
- * (homogenous) transformation matrix.
- */
- aiProcess_TransformUVCoords = 0x80000,
-
- // -------------------------------------------------------------------------
- /** <hr>This step searches for duplicate meshes and replaces duplicates
- * with references to the first mesh.
- *
- * This step takes a while, don't use it if you have no time.
- * Its main purpose is to workaround the limitation that many export
- * file formats don't support instanced meshes, so exporters need to
- * duplicate meshes. This step removes the duplicates again. Please
- * note that Assimp does currently not support per-node material
- * assignment to meshes, which means that identical meshes with
- * differnent materials are currently *not* joined, although this is
- * planned for future versions.
- */
- aiProcess_FindInstances = 0x100000,
-
- // -------------------------------------------------------------------------
- /** <hr>A postprocessing step to reduce the number of meshes.
- *
- * In fact, it will reduce the number of drawcalls.
- *
- * This is a very effective optimization and is recommended to be used
- * together with #aiProcess_OptimizeGraph, if possible. The flag is fully
- * compatible with both #aiProcess_SplitLargeMeshes and #aiProcess_SortByPType.
- */
- aiProcess_OptimizeMeshes = 0x200000,
-
-
- // -------------------------------------------------------------------------
- /** <hr>A postprocessing step to optimize the scene hierarchy.
- *
- * Nodes with no animations, bones, lights or cameras assigned are
- * collapsed and joined.
- *
- * Node names can be lost during this step. If you use special 'tag nodes'
- * to pass additional information through your content pipeline, use the
- * <tt>#AI_CONFIG_PP_OG_EXCLUDE_LIST</tt> setting to specify a list of node
- * names you want to be kept. Nodes matching one of the names in this list won't
- * be touched or modified.
- *
- * Use this flag with caution. Most simple files will be collapsed to a
- * single node, complex hierarchies are usually completely lost. That's not
- * the right choice for editor environments, but probably a very effective
- * optimization if you just want to get the model data, convert it to your
- * own format and render it as fast as possible.
- *
- * This flag is designed to be used with #aiProcess_OptimizeMeshes for best
- * results.
- *
- * @note 'crappy' scenes with thousands of extremely small meshes packed
- * in deeply nested nodes exist for almost all file formats.
- * #aiProcess_OptimizeMeshes in combination with #aiProcess_OptimizeGraph
- * usually fixes them all and makes them renderable.
- */
- aiProcess_OptimizeGraph = 0x400000,
-
- // -------------------------------------------------------------------------
- /** <hr>This step flips all UV coordinates along the y-axis and adjusts
- * material settings and bitangents accordingly.
- * <br><b>Output UV coordinate system:</b>
- * @code
- * 0y|0y ---------- 1x|0y
- * | |
- * | |
- * | |
- * 0x|1y ---------- 1x|1y
- * @endcode
- *
- * You'll probably want to consider this flag if you use Direct3D for
- * rendering. The #aiProcess_ConvertToLeftHanded flag supersedes this
- * setting and bundles all conversions typically required for D3D-based
- * applications.
- */
- aiProcess_FlipUVs = 0x800000,
-
- // -------------------------------------------------------------------------
- /** <hr>This step adjusts the output face winding order to be cw.
- *
- * The default face winding order is counter clockwise.
- * <br><b>Output face order:</b>
- * @code
- * x2
- *
- * x0
- * x1
- * @endcode
- */
- aiProcess_FlipWindingOrder = 0x1000000
-
- // aiProcess_GenEntityMeshes = 0x100000,
- // aiProcess_OptimizeAnimations = 0x200000
- // aiProcess_FixTexturePaths = 0x200000
-};
-
-
-// ---------------------------------------------------------------------------------------
-/** @def aiProcess_ConvertToLeftHanded
- * @brief Shortcut flag for Direct3D-based applications.
- *
- * Supersedes the #aiProcess_MakeLeftHanded and #aiProcess_FlipUVs and
- * #aiProcess_FlipWindingOrder flags.
- * The output data matches Direct3D's conventions: left-handed geometry, upper-left
- * origin for UV coordinates and finally clockwise face order, suitable for CCW culling.
- *
- * @deprecated
- */
-#define aiProcess_ConvertToLeftHanded ( \
- aiProcess_MakeLeftHanded | \
- aiProcess_FlipUVs | \
- aiProcess_FlipWindingOrder | \
- 0 )
-
-
-// ---------------------------------------------------------------------------------------
-/** @def aiProcessPreset_TargetRealtimeUse_Fast
- * @brief Default postprocess configuration optimizing the data for real-time rendering.
- *
- * Applications would want to use this preset to load models on end-user PCs,
- * maybe for direct use in game.
- *
- * If you're using DirectX, don't forget to combine this value with
- * the #aiProcess_ConvertToLeftHanded step. If you don't support UV transformations
- * in your application apply the #aiProcess_TransformUVCoords step, too.
- * @note Please take the time to read the doc to the steps enabled by this preset.
- * Some of them offer further configurable properties, some of them might not be of
- * use for you so it might be better to not specify them.
- */
-#define aiProcessPreset_TargetRealtime_Fast ( \
- aiProcess_CalcTangentSpace | \
- aiProcess_GenNormals | \
- aiProcess_JoinIdenticalVertices | \
- aiProcess_Triangulate | \
- aiProcess_GenUVCoords | \
- aiProcess_SortByPType | \
- 0 )
-
- // ---------------------------------------------------------------------------------------
- /** @def aiProcessPreset_TargetRealtime_Quality
- * @brief Default postprocess configuration optimizing the data for real-time rendering.
- *
- * Unlike #aiProcessPreset_TargetRealtime_Fast, this configuration
- * performs some extra optimizations to improve rendering speed and
- * to minimize memory usage. It could be a good choice for a level editor
- * environment where import speed is not so important.
- *
- * If you're using DirectX, don't forget to combine this value with
- * the #aiProcess_ConvertToLeftHanded step. If you don't support UV transformations
- * in your application apply the #aiProcess_TransformUVCoords step, too.
- * @note Please take the time to read the doc for the steps enabled by this preset.
- * Some of them offer further configurable properties, some of them might not be of
- * use for you so it might be better to not specify them.
- */
-#define aiProcessPreset_TargetRealtime_Quality ( \
- aiProcess_CalcTangentSpace | \
- aiProcess_GenSmoothNormals | \
- aiProcess_JoinIdenticalVertices | \
- aiProcess_ImproveCacheLocality | \
- aiProcess_LimitBoneWeights | \
- aiProcess_RemoveRedundantMaterials | \
- aiProcess_SplitLargeMeshes | \
- aiProcess_Triangulate | \
- aiProcess_GenUVCoords | \
- aiProcess_SortByPType | \
- aiProcess_FindDegenerates | \
- aiProcess_FindInvalidData | \
- 0 )
-
- // ---------------------------------------------------------------------------------------
- /** @def aiProcessPreset_TargetRealtime_MaxQuality
- * @brief Default postprocess configuration optimizing the data for real-time rendering.
- *
- * This preset enables almost every optimization step to achieve perfectly
- * optimized data. It's your choice for level editor environments where import speed
- * is not important.
- *
- * If you're using DirectX, don't forget to combine this value with
- * the #aiProcess_ConvertToLeftHanded step. If you don't support UV transformations
- * in your application, apply the #aiProcess_TransformUVCoords step, too.
- * @note Please take the time to read the doc for the steps enabled by this preset.
- * Some of them offer further configurable properties, some of them might not be of
- * use for you so it might be better to not specify them.
- */
-#define aiProcessPreset_TargetRealtime_MaxQuality ( \
- aiProcessPreset_TargetRealtime_Quality | \
- aiProcess_FindInstances | \
- aiProcess_ValidateDataStructure | \
- aiProcess_OptimizeMeshes | \
- 0 )
-
-
-#ifdef __cplusplus
-} // end of extern "C"
-#endif
-
-#endif // AI_POSTPROCESS_H_INC
diff --git a/3rdparty/assimp/include/aiQuaternion.h b/3rdparty/assimp/include/aiQuaternion.h
deleted file mode 100644
index 790cd060..00000000
--- a/3rdparty/assimp/include/aiQuaternion.h
+++ /dev/null
@@ -1,311 +0,0 @@
-/*
-Open Asset Import Library (ASSIMP)
-----------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-----------------------------------------------------------------------
-*/
-
-/** @file aiQuaternion.h
- * @brief Quaternion structure, including operators when compiling in C++
- */
-#ifndef AI_QUATERNION_H_INC
-#define AI_QUATERNION_H_INC
-
-#include <math.h>
-#include "aiTypes.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// ---------------------------------------------------------------------------
-/** Represents a quaternion in a 4D vector. */
-struct aiQuaternion
-{
-#ifdef __cplusplus
- aiQuaternion() : w(0.0f), x(0.0f), y(0.0f), z(0.0f) {}
- aiQuaternion(float _w, float _x, float _y, float _z) : w(_w), x(_x), y(_y), z(_z) {}
-
- /** Construct from rotation matrix. Result is undefined if the matrix is not orthonormal. */
- aiQuaternion( const aiMatrix3x3& pRotMatrix);
-
- /** Construct from euler angles */
- aiQuaternion( float rotx, float roty, float rotz);
-
- /** Construct from an axis-angle pair */
- aiQuaternion( aiVector3D axis, float angle);
-
- /** Construct from a normalized quaternion stored in a vec3 */
- aiQuaternion( aiVector3D normalized);
-
- /** Returns a matrix representation of the quaternion */
- aiMatrix3x3 GetMatrix() const;
-
-
- bool operator== (const aiQuaternion& o) const
- {return x == o.x && y == o.y && z == o.z && w == o.w;}
-
- bool operator!= (const aiQuaternion& o) const
- {return !(*this == o);}
-
- /** Normalize the quaternion */
- aiQuaternion& Normalize();
-
- /** Compute quaternion conjugate */
- aiQuaternion& Conjugate ();
-
- /** Rotate a point by this quaternion */
- aiVector3D Rotate (const aiVector3D& in);
-
- /** Multiply two quaternions */
- aiQuaternion operator* (const aiQuaternion& two) const;
-
- /** Performs a spherical interpolation between two quaternions and writes the result into the third.
- * @param pOut Target object to received the interpolated rotation.
- * @param pStart Start rotation of the interpolation at factor == 0.
- * @param pEnd End rotation, factor == 1.
- * @param pFactor Interpolation factor between 0 and 1. Values outside of this range yield undefined results.
- */
- static void Interpolate( aiQuaternion& pOut, const aiQuaternion& pStart, const aiQuaternion& pEnd, float pFactor);
-
-#endif // __cplusplus
-
- //! w,x,y,z components of the quaternion
- float w, x, y, z;
-} ;
-
-
-#ifdef __cplusplus
-
-// ---------------------------------------------------------------------------
-// Constructs a quaternion from a rotation matrix
-inline aiQuaternion::aiQuaternion( const aiMatrix3x3 &pRotMatrix)
-{
- float t = 1 + pRotMatrix.a1 + pRotMatrix.b2 + pRotMatrix.c3;
-
- // large enough
- if ( t > 0.001f)
- {
- float s = sqrt( t) * 2.0f;
- x = (pRotMatrix.c2 - pRotMatrix.b3) / s;
- y = (pRotMatrix.a3 - pRotMatrix.c1) / s;
- z = (pRotMatrix.b1 - pRotMatrix.a2) / s;
- w = 0.25f * s;
- } // else we have to check several cases
- else if ( pRotMatrix.a1 > pRotMatrix.b2 && pRotMatrix.a1 > pRotMatrix.c3 )
- {
- // Column 0:
- float s = sqrt( 1.0f + pRotMatrix.a1 - pRotMatrix.b2 - pRotMatrix.c3) * 2.0f;
- x = 0.25f * s;
- y = (pRotMatrix.b1 + pRotMatrix.a2) / s;
- z = (pRotMatrix.a3 + pRotMatrix.c1) / s;
- w = (pRotMatrix.c2 - pRotMatrix.b3) / s;
- }
- else if ( pRotMatrix.b2 > pRotMatrix.c3)
- {
- // Column 1:
- float s = sqrt( 1.0f + pRotMatrix.b2 - pRotMatrix.a1 - pRotMatrix.c3) * 2.0f;
- x = (pRotMatrix.b1 + pRotMatrix.a2) / s;
- y = 0.25f * s;
- z = (pRotMatrix.c2 + pRotMatrix.b3) / s;
- w = (pRotMatrix.a3 - pRotMatrix.c1) / s;
- } else
- {
- // Column 2:
- float s = sqrt( 1.0f + pRotMatrix.c3 - pRotMatrix.a1 - pRotMatrix.b2) * 2.0f;
- x = (pRotMatrix.a3 + pRotMatrix.c1) / s;
- y = (pRotMatrix.c2 + pRotMatrix.b3) / s;
- z = 0.25f * s;
- w = (pRotMatrix.b1 - pRotMatrix.a2) / s;
- }
-}
-
-// ---------------------------------------------------------------------------
-// Construction from euler angles
-inline aiQuaternion::aiQuaternion( float fPitch, float fYaw, float fRoll )
-{
- const float fSinPitch(sin(fPitch*0.5F));
- const float fCosPitch(cos(fPitch*0.5F));
- const float fSinYaw(sin(fYaw*0.5F));
- const float fCosYaw(cos(fYaw*0.5F));
- const float fSinRoll(sin(fRoll*0.5F));
- const float fCosRoll(cos(fRoll*0.5F));
- const float fCosPitchCosYaw(fCosPitch*fCosYaw);
- const float fSinPitchSinYaw(fSinPitch*fSinYaw);
- x = fSinRoll * fCosPitchCosYaw - fCosRoll * fSinPitchSinYaw;
- y = fCosRoll * fSinPitch * fCosYaw + fSinRoll * fCosPitch * fSinYaw;
- z = fCosRoll * fCosPitch * fSinYaw - fSinRoll * fSinPitch * fCosYaw;
- w = fCosRoll * fCosPitchCosYaw + fSinRoll * fSinPitchSinYaw;
-}
-
-// ---------------------------------------------------------------------------
-// Returns a matrix representation of the quaternion
-inline aiMatrix3x3 aiQuaternion::GetMatrix() const
-{
- aiMatrix3x3 resMatrix;
- resMatrix.a1 = 1.0f - 2.0f * (y * y + z * z);
- resMatrix.a2 = 2.0f * (x * y - z * w);
- resMatrix.a3 = 2.0f * (x * z + y * w);
- resMatrix.b1 = 2.0f * (x * y + z * w);
- resMatrix.b2 = 1.0f - 2.0f * (x * x + z * z);
- resMatrix.b3 = 2.0f * (y * z - x * w);
- resMatrix.c1 = 2.0f * (x * z - y * w);
- resMatrix.c2 = 2.0f * (y * z + x * w);
- resMatrix.c3 = 1.0f - 2.0f * (x * x + y * y);
-
- return resMatrix;
-}
-
-// ---------------------------------------------------------------------------
-// Construction from an axis-angle pair
-inline aiQuaternion::aiQuaternion( aiVector3D axis, float angle)
-{
- axis.Normalize();
-
- const float sin_a = sin( angle / 2 );
- const float cos_a = cos( angle / 2 );
- x = axis.x * sin_a;
- y = axis.y * sin_a;
- z = axis.z * sin_a;
- w = cos_a;
-}
-// ---------------------------------------------------------------------------
-// Construction from am existing, normalized quaternion
-inline aiQuaternion::aiQuaternion( aiVector3D normalized)
-{
- x = normalized.x;
- y = normalized.y;
- z = normalized.z;
-
- const float t = 1.0f - (x*x) - (y*y) - (z*z);
-
- if (t < 0.0f)
- w = 0.0f;
- else w = sqrt (t);
-}
-
-// ---------------------------------------------------------------------------
-// Performs a spherical interpolation between two quaternions
-// Implementation adopted from the gmtl project. All others I found on the net fail in some cases.
-// Congrats, gmtl!
-inline void aiQuaternion::Interpolate( aiQuaternion& pOut, const aiQuaternion& pStart, const aiQuaternion& pEnd, float pFactor)
-{
- // calc cosine theta
- float cosom = pStart.x * pEnd.x + pStart.y * pEnd.y + pStart.z * pEnd.z + pStart.w * pEnd.w;
-
- // adjust signs (if necessary)
- aiQuaternion end = pEnd;
- if ( cosom < 0.0f)
- {
- cosom = -cosom;
- end.x = -end.x; // Reverse all signs
- end.y = -end.y;
- end.z = -end.z;
- end.w = -end.w;
- }
-
- // Calculate coefficients
- float sclp, sclq;
- if ( (1.0f - cosom) > 0.0001f) // 0.0001 -> some epsillon
- {
- // Standard case (slerp)
- float omega, sinom;
- omega = acos( cosom); // extract theta from dot product's cos theta
- sinom = sin( omega);
- sclp = sin( (1.0f - pFactor) * omega) / sinom;
- sclq = sin( pFactor * omega) / sinom;
- } else
- {
- // Very close, do linear interp (because it's faster)
- sclp = 1.0f - pFactor;
- sclq = pFactor;
- }
-
- pOut.x = sclp * pStart.x + sclq * end.x;
- pOut.y = sclp * pStart.y + sclq * end.y;
- pOut.z = sclp * pStart.z + sclq * end.z;
- pOut.w = sclp * pStart.w + sclq * end.w;
-}
-
-// ---------------------------------------------------------------------------
-inline aiQuaternion& aiQuaternion::Normalize()
-{
- // compute the magnitude and divide through it
- const float mag = x*x+y*y+z*z+w*w;
- if (mag)
- {
- x /= mag;
- y /= mag;
- z /= mag;
- w /= mag;
- }
- return *this;
-}
-
-// ---------------------------------------------------------------------------
-inline aiQuaternion aiQuaternion::operator* (const aiQuaternion& t) const
-{
- return aiQuaternion(w*t.w - x*t.x - y*t.y - z*t.z,
- w*t.x + x*t.w + y*t.z - z*t.y,
- w*t.y + y*t.w + z*t.x - x*t.z,
- w*t.z + z*t.w + x*t.y - y*t.x);
-}
-
-// ---------------------------------------------------------------------------
-inline aiQuaternion& aiQuaternion::Conjugate ()
-{
- x = -x;
- y = -y;
- z = -z;
- return *this;
-}
-
-// ---------------------------------------------------------------------------
-inline aiVector3D aiQuaternion::Rotate (const aiVector3D& v)
-{
- aiQuaternion q2(0.f,v.x,v.y,v.z), q = *this, qinv = q;
- q.Conjugate();
-
- q = q*q2*qinv;
- return aiVector3D(q.x,q.y,q.z);
-
-}
-
-} // end extern "C"
-
-#endif // __cplusplus
-
-#endif // AI_QUATERNION_H_INC
diff --git a/3rdparty/assimp/include/aiScene.h b/3rdparty/assimp/include/aiScene.h
deleted file mode 100644
index 6c4b4900..00000000
--- a/3rdparty/assimp/include/aiScene.h
+++ /dev/null
@@ -1,417 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file aiScene.h
- * @brief Defines the data structures in which the imported scene is returned.
- */
-#ifndef __AI_SCENE_H_INC__
-#define __AI_SCENE_H_INC__
-
-#include "aiTypes.h"
-#include "aiTexture.h"
-#include "aiMesh.h"
-#include "aiLight.h"
-#include "aiCamera.h"
-#include "aiMaterial.h"
-#include "aiAnim.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// -------------------------------------------------------------------------------
-/** A node in the imported hierarchy.
- *
- * Each node has name, a parent node (except for the root node),
- * a transformation relative to its parent and possibly several child nodes.
- * Simple file formats don't support hierarchical structures - for these formats
- * the imported scene does consist of only a single root node without children.
- */
-// -------------------------------------------------------------------------------
-struct aiNode
-{
- /** The name of the node.
- *
- * The name might be empty (length of zero) but all nodes which
- * need to be accessed afterwards by bones or anims are usually named.
- * Multiple nodes may have the same name, but nodes which are accessed
- * by bones (see #aiBone and #aiMesh::mBones) *must* be unique.
- *
- * Cameras and lights are assigned to a specific node name - if there
- * are multiple nodes with this name, they're assigned to each of them.
- * <br>
- * There are no limitations regarding the characters contained in
- * this text. You should be able to handle stuff like whitespace, tabs,
- * linefeeds, quotation marks, ampersands, ... .
- */
- C_STRUCT aiString mName;
-
- /** The transformation relative to the node's parent. */
- C_STRUCT aiMatrix4x4 mTransformation;
-
- /** Parent node. NULL if this node is the root node. */
- C_STRUCT aiNode* mParent;
-
- /** The number of child nodes of this node. */
- unsigned int mNumChildren;
-
- /** The child nodes of this node. NULL if mNumChildren is 0. */
- C_STRUCT aiNode** mChildren;
-
- /** The number of meshes of this node. */
- unsigned int mNumMeshes;
-
- /** The meshes of this node. Each entry is an index into the mesh */
- unsigned int* mMeshes;
-
-#ifdef __cplusplus
- /** Constructor */
- aiNode()
- {
- // set all members to zero by default
- mParent = NULL;
- mNumChildren = 0; mChildren = NULL;
- mNumMeshes = 0; mMeshes = NULL;
- }
-
- /** Construction from a specific name */
- aiNode(const std::string& name)
- {
- // set all members to zero by default
- mParent = NULL;
- mNumChildren = 0; mChildren = NULL;
- mNumMeshes = 0; mMeshes = NULL;
- mName = name;
- }
-
- /** Destructor */
- ~aiNode()
- {
- // delete all children recursively
- // to make sure we won't crash if the data is invalid ...
- if (mChildren && mNumChildren)
- {
- for ( unsigned int a = 0; a < mNumChildren; a++)
- delete mChildren[a];
- }
- delete [] mChildren;
- delete [] mMeshes;
- }
-
- /** Searches for a node with a specific name, beginning at this
- * nodes. Normally you will call this method on the root node
- * of the scene.
- *
- * @param name Name to search for
- * @return NULL or a valid Node if the search was successful.
- */
- inline aiNode* FindNode(const aiString& name)
- {
- return FindNode(name.data);
- }
-
- /** @override
- */
- inline aiNode* FindNode(const char* name)
- {
- if (!::strcmp( mName.data,name))return this;
- for (unsigned int i = 0; i < mNumChildren;++i)
- {
- aiNode* p = mChildren[i]->FindNode(name);
- if (p)return p;
- }
- // there is definitely no sub node with this name
- return NULL;
- }
-
-#endif // __cplusplus
-};
-
-
-// -------------------------------------------------------------------------------
-/** @def AI_SCENE_FLAGS_INCOMPLETE
- * Specifies that the scene data structure that was imported is not complete.
- * This flag bypasses some internal validations and allows the import
- * of animation skeletons, material libraries or camera animation paths
- * using Assimp. Most applications won't support such data.
- */
-#define AI_SCENE_FLAGS_INCOMPLETE 0x1
-
-/** @def AI_SCENE_FLAGS_VALIDATED
- * This flag is set by the validation postprocess-step (aiPostProcess_ValidateDS)
- * if the validation is successful. In a validated scene you can be sure that
- * any cross references in the data structure (e.g. vertex indices) are valid.
- */
-#define AI_SCENE_FLAGS_VALIDATED 0x2
-
-/** @def AI_SCENE_FLAGS_VALIDATION_WARNING
- * This flag is set by the validation postprocess-step (aiPostProcess_ValidateDS)
- * if the validation is successful but some issues have been found.
- * This can for example mean that a texture that does not exist is referenced
- * by a material or that the bone weights for a vertex don't sum to 1.0 ... .
- * In most cases you should still be able to use the import. This flag could
- * be useful for applications which don't capture Assimp's log output.
- */
-#define AI_SCENE_FLAGS_VALIDATION_WARNING 0x4
-
-/** @def AI_SCENE_FLAGS_NON_VERBOSE_FORMAT
- * This flag is currently only set by the aiProcess_JoinIdenticalVertices step.
- * It indicates that the vertices of the output meshes aren't in the internal
- * verbose format anymore. In the verbose format all vertices are unique,
- * no vertex is ever referenced by more than one face.
- */
-#define AI_SCENE_FLAGS_NON_VERBOSE_FORMAT 0x8
-
- /** @def AI_SCENE_FLAGS_TERRAIN
- * Denotes pure height-map terrain data. Pure terrains usually consist of quads,
- * sometimes triangles, in a regular grid. The x,y coordinates of all vertex
- * positions refer to the x,y coordinates on the terrain height map, the z-axis
- * stores the elevation at a specific point.
- *
- * TER (Terragen) and HMP (3D Game Studio) are height map formats.
- * @note Assimp is probably not the best choice for loading *huge* terrains -
- * fully triangulated data takes extremely much free store and should be avoided
- * as long as possible (typically you'll do the triangulation when you actually
- * need to render it).
- */
-#define AI_SCENE_FLAGS_TERRAIN 0x10
-
-
-// -------------------------------------------------------------------------------
-/** The root structure of the imported data.
- *
- * Everything that was imported from the given file can be accessed from here.
- * Objects of this class are generally maintained and owned by Assimp, not
- * by the caller. You shouldn't want to instance it, nor should you ever try to
- * delete a given scene on your own.
- */
-// -------------------------------------------------------------------------------
-struct aiScene
-{
-
- /** Any combination of the AI_SCENE_FLAGS_XXX flags. By default
- * this value is 0, no flags are set. Most applications will
- * want to reject all scenes with the AI_SCENE_FLAGS_INCOMPLETE
- * bit set.
- */
- unsigned int mFlags;
-
-
- /** The root node of the hierarchy.
- *
- * There will always be at least the root node if the import
- * was successful (and no special flags have been set).
- * Presence of further nodes depends on the format and content
- * of the imported file.
- */
- C_STRUCT aiNode* mRootNode;
-
-
-
- /** The number of meshes in the scene. */
- unsigned int mNumMeshes;
-
- /** The array of meshes.
- *
- * Use the indices given in the aiNode structure to access
- * this array. The array is mNumMeshes in size. If the
- * AI_SCENE_FLAGS_INCOMPLETE flag is not set there will always
- * be at least ONE material.
- */
- C_STRUCT aiMesh** mMeshes;
-
-
-
- /** The number of materials in the scene. */
- unsigned int mNumMaterials;
-
- /** The array of materials.
- *
- * Use the index given in each aiMesh structure to access this
- * array. The array is mNumMaterials in size. If the
- * AI_SCENE_FLAGS_INCOMPLETE flag is not set there will always
- * be at least ONE material.
- */
- C_STRUCT aiMaterial** mMaterials;
-
-
-
- /** The number of animations in the scene. */
- unsigned int mNumAnimations;
-
- /** The array of animations.
- *
- * All animations imported from the given file are listed here.
- * The array is mNumAnimations in size.
- */
- C_STRUCT aiAnimation** mAnimations;
-
-
-
- /** The number of textures embedded into the file */
- unsigned int mNumTextures;
-
- /** The array of embedded textures.
- *
- * Not many file formats embed their textures into the file.
- * An example is Quake's MDL format (which is also used by
- * some GameStudio versions)
- */
- C_STRUCT aiTexture** mTextures;
-
-
- /** The number of light sources in the scene. Light sources
- * are fully optional, in most cases this attribute will be 0
- */
- unsigned int mNumLights;
-
- /** The array of light sources.
- *
- * All light sources imported from the given file are
- * listed here. The array is mNumLights in size.
- */
- C_STRUCT aiLight** mLights;
-
-
- /** The number of cameras in the scene. Cameras
- * are fully optional, in most cases this attribute will be 0
- */
- unsigned int mNumCameras;
-
- /** The array of cameras.
- *
- * All cameras imported from the given file are listed here.
- * The array is mNumCameras in size. The first camera in the
- * array (if existing) is the default camera view into
- * the scene.
- */
- C_STRUCT aiCamera** mCameras;
-
-#ifdef __cplusplus
-
- //! Default constructor
- aiScene()
- {
- // set all members to zero by default
- mRootNode = NULL;
- mNumMeshes = 0; mMeshes = NULL;
- mNumMaterials = 0; mMaterials = NULL;
- mNumAnimations = 0; mAnimations = NULL;
- mNumTextures = 0; mTextures = NULL;
- mNumCameras = 0; mCameras = NULL;
- mNumLights = 0; mLights = NULL;
- mFlags = 0;
- }
-
- //! Destructor
- ~aiScene()
- {
- // delete all sub-objects recursively
- delete mRootNode;
-
- // To make sure we won't crash if the data is invalid it's
- // much better to check whether both mNumXXX and mXXX are
- // valid instead of relying on just one of them.
- if (mNumMeshes && mMeshes)
- for ( unsigned int a = 0; a < mNumMeshes; a++)
- delete mMeshes[a];
- delete [] mMeshes;
-
- if (mNumMaterials && mMaterials)
- for ( unsigned int a = 0; a < mNumMaterials; a++)
- delete mMaterials[a];
- delete [] mMaterials;
-
- if (mNumAnimations && mAnimations)
- for ( unsigned int a = 0; a < mNumAnimations; a++)
- delete mAnimations[a];
- delete [] mAnimations;
-
- if (mNumTextures && mTextures)
- for ( unsigned int a = 0; a < mNumTextures; a++)
- delete mTextures[a];
- delete [] mTextures;
-
- if (mNumLights && mLights)
- for ( unsigned int a = 0; a < mNumLights; a++)
- delete mLights[a];
- delete [] mLights;
-
- if (mNumCameras && mCameras)
- for ( unsigned int a = 0; a < mNumCameras; a++)
- delete mCameras[a];
- delete [] mCameras;
- }
-
- //! Check whether the scene contains meshes
- //! Unless no special scene flags are set this will always be true.
- inline bool HasMeshes() const
- { return mMeshes != NULL && mNumMeshes > 0; }
-
- //! Check whether the scene contains materials
- //! Unless no special scene flags are set this will always be true.
- inline bool HasMaterials() const
- { return mMaterials != NULL && mNumMaterials > 0; }
-
- //! Check whether the scene contains lights
- inline bool HasLights() const
- { return mLights != NULL && mNumLights > 0; }
-
- //! Check whether the scene contains textures
- inline bool HasTextures() const
- { return mTextures != NULL && mNumTextures > 0; }
-
- //! Check whether the scene contains cameras
- inline bool HasCameras() const
- { return mCameras != NULL && mNumCameras > 0; }
-
- //! Check whether the scene contains animations
- inline bool HasAnimations() const
- { return mAnimations != NULL && mNumAnimations > 0; }
-
-#endif // __cplusplus
-};
-
-#ifdef __cplusplus
-} //! namespace Assimp
-#endif
-
-#endif // __AI_SCENE_H_INC__
diff --git a/3rdparty/assimp/include/aiTexture.h b/3rdparty/assimp/include/aiTexture.h
deleted file mode 100644
index e64f0205..00000000
--- a/3rdparty/assimp/include/aiTexture.h
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file aiTexture.h
- * @brief Defines texture helper structures for the library
- *
- * Used for file formats which embed their textures into the model file.
- * Supported are both normal textures, which are stored as uncompressed
- * pixels, and "compressed" textures, which are stored in a file format
- * such as PNG or TGA.
- */
-
-#ifndef AI_TEXTURE_H_INC
-#define AI_TEXTURE_H_INC
-
-#include "aiTypes.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-// --------------------------------------------------------------------------------
-/** @def AI_MAKE_EMBEDDED_TEXNAME
- * Used to build the reserved path name used by the material system to
- * reference textures that are embedded into their corresponding
- * model files. The parameter specifies the index of the texture
- * (zero-based, in the aiScene::mTextures array)
- */
-#if (!defined AI_MAKE_EMBEDDED_TEXNAME)
-# define AI_MAKE_EMBEDDED_TEXNAME(_n_) "*" # _n_
-#endif
-
-
-#include "./Compiler/pushpack1.h"
-
-// --------------------------------------------------------------------------------
-/** @brief Helper structure to represent a texel in a ARGB8888 format
-*
-* Used by aiTexture.
-*/
-struct aiTexel
-{
- unsigned char b,g,r,a;
-
-#ifdef __cplusplus
- //! Comparison operator
- bool operator== (const aiTexel& other) const
- {
- return b == other.b && r == other.r &&
- g == other.g && a == other.a;
- }
-
- //! Inverse comparison operator
- bool operator!= (const aiTexel& other) const
- {
- return b != other.b || r != other.r ||
- g != other.g || a != other.a;
- }
-
- //! Conversion to a floating-point 4d color
- operator aiColor4D() const
- {
- return aiColor4D(r/255.f,g/255.f,b/255.f,a/255.f);
- }
-#endif // __cplusplus
-
-} PACK_STRUCT;
-
-#include "./Compiler/poppack1.h"
-
-// --------------------------------------------------------------------------------
-/** Helper structure to describe an embedded texture
- *
- * Normally textures are contained in external files but some file formats embed
- * them directly in the model file. There are two types of embedded textures:
- * 1. Uncompressed textures. The color data is given in an uncompressed format.
- * 2. Compressed textures stored in a file format like png or jpg. The raw file
- * bytes are given so the application must utilize an image decoder (e.g. DevIL) to
- * get access to the actual color data.
- */
-struct aiTexture
-{
- /** Width of the texture, in pixels
- *
- * If mHeight is zero the texture is compressed in a format
- * like JPEG. In this case mWidth specifies the size of the
- * memory area pcData is pointing to, in bytes.
- */
- unsigned int mWidth;
-
- /** Height of the texture, in pixels
- *
- * If this value is zero, pcData points to an compressed texture
- * in any format (e.g. JPEG).
- */
- unsigned int mHeight;
-
- /** A hint from the loader to make it easier for applications
- * to determine the type of embedded compressed textures.
- *
- * If mHeight != 0 this member is undefined. Otherwise it
- * is set set to '\\0\\0\\0\\0' if the loader has no additional
- * information about the texture file format used OR the
- * file extension of the format without a trailing dot. If there
- * are multiple file extensions for a format, the shortest
- * extension is chosen (JPEG maps to 'jpg', not to 'jpeg').
- * E.g. 'dds\\0', 'pcx\\0', 'jpg\\0'. All characters are lower-case.
- * The fourth character will always be '\\0'.
- */
- char achFormatHint[4];
-
- /** Data of the texture.
- *
- * Points to an array of mWidth * mHeight aiTexel's.
- * The format of the texture data is always ARGB8888 to
- * make the implementation for user of the library as easy
- * as possible. If mHeight = 0 this is a pointer to a memory
- * buffer of size mWidth containing the compressed texture
- * data. Good luck, have fun!
- */
- C_STRUCT aiTexel* pcData;
-
-#ifdef __cplusplus
-
- //! For compressed textures (mHeight == 0): compare the
- //! format hint against a given string.
- //! @param s Input string. 3 characters are maximally processed.
- //! Example values: "jpg", "png"
- //! @return true if the given string matches the format hint
- bool CheckFormat(const char* s) const
- {
- ai_assert(s && !mHeight);
- return (0 == ::strncmp(achFormatHint,s,3));
- }
-
- // Construction
- aiTexture ()
- : mWidth (0)
- , mHeight (0)
- , pcData (NULL)
- {
- achFormatHint[0] = achFormatHint[1] = 0;
- achFormatHint[2] = achFormatHint[3] = 0;
- }
-
- // Destruction
- ~aiTexture ()
- {
- delete[] pcData;
- }
-#endif
-};
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // AI_TEXTURE_H_INC
diff --git a/3rdparty/assimp/include/aiTypes.h b/3rdparty/assimp/include/aiTypes.h
deleted file mode 100644
index de956dad..00000000
--- a/3rdparty/assimp/include/aiTypes.h
+++ /dev/null
@@ -1,492 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file aiTypes.h
- * Basic data types and primitives, such as vectors or colors.
- */
-#ifndef AI_TYPES_H_INC
-#define AI_TYPES_H_INC
-
-// Some runtime headers
-#include <sys/types.h>
-#include <memory.h>
-#include <math.h>
-#include <stddef.h>
-
-// Our compile configuration
-#include "aiDefines.h"
-
-// Some types moved to separate header due to size of operators
-#include "aiVector3D.h"
-#include "aiVector2D.h"
-#include "aiColor4D.h"
-#include "aiMatrix3x3.h"
-#include "aiMatrix4x4.h"
-#include "aiQuaternion.h"
-
-#ifdef __cplusplus
-#include <new> // for std::nothrow_t
-#include <string> // for aiString::Set(const std::string&)
-
-namespace Assimp {
- //! @cond never
-namespace Intern {
- // --------------------------------------------------------------------
- /** @brief Internal helper class to utilize our internal new/delete
- * routines for allocating object of this and derived classes.
- *
- * By doing this you can safely share class objects between Assimp
- * and the application - it works even over DLL boundaries. A good
- * example is the #IOSystem where the application allocates its custom
- * #IOSystem, then calls #Importer::SetIOSystem(). When the Importer
- * destructs, Assimp calls operator delete on the stored #IOSystem.
- * If it lies on a different heap than Assimp is working with,
- * the application is determined to crash.
- */
- // --------------------------------------------------------------------
-#ifndef SWIG
- struct ASSIMP_API AllocateFromAssimpHeap {
- // http://www.gotw.ca/publications/mill15.htm
-
- // new/delete overload
- void *operator new ( size_t num_bytes) /* throw( std::bad_alloc ) */;
- void *operator new ( size_t num_bytes, const std::nothrow_t& ) throw();
- void operator delete ( void* data);
-
- // array new/delete overload
- void *operator new[] ( size_t num_bytes) /* throw( std::bad_alloc ) */;
- void *operator new[] ( size_t num_bytes, const std::nothrow_t& ) throw();
- void operator delete[] ( void* data);
-
- }; // struct AllocateFromAssimpHeap
-#endif
-} // namespace Intern
- //! @endcond
-} // namespace Assimp
-
-extern "C" {
-#endif
-
-/** Maximum dimension for strings, ASSIMP strings are zero terminated. */
-#ifdef __cplusplus
-const size_t MAXLEN = 1024;
-#else
-# define MAXLEN 1024
-#endif
-
-#include "./Compiler/pushpack1.h"
-
-// ----------------------------------------------------------------------------------
-/** Represents a plane in a three-dimensional, euclidean space
-*/
-struct aiPlane
-{
-#ifdef __cplusplus
- aiPlane () : a(0.f), b(0.f), c(0.f), d(0.f) {}
- aiPlane (float _a, float _b, float _c, float _d)
- : a(_a), b(_b), c(_c), d(_d) {}
-
- aiPlane (const aiPlane& o) : a(o.a), b(o.b), c(o.c), d(o.d) {}
-
-#endif // !__cplusplus
-
- //! Plane equation
- float a,b,c,d;
-} PACK_STRUCT; // !struct aiPlane
-
-// ----------------------------------------------------------------------------------
-/** Represents a ray
-*/
-struct aiRay
-{
-#ifdef __cplusplus
- aiRay () {}
- aiRay (const aiVector3D& _pos, const aiVector3D& _dir)
- : pos(_pos), dir(_dir) {}
-
- aiRay (const aiRay& o) : pos (o.pos), dir (o.dir) {}
-
-#endif // !__cplusplus
-
- //! Position and direction of the ray
- C_STRUCT aiVector3D pos, dir;
-} PACK_STRUCT; // !struct aiRay
-
-// ----------------------------------------------------------------------------------
-/** Represents a color in Red-Green-Blue space.
-*/
-struct aiColor3D
-{
-#ifdef __cplusplus
- aiColor3D () : r(0.0f), g(0.0f), b(0.0f) {}
- aiColor3D (float _r, float _g, float _b) : r(_r), g(_g), b(_b) {}
- aiColor3D (float _r) : r(_r), g(_r), b(_r) {}
- aiColor3D (const aiColor3D& o) : r(o.r), g(o.g), b(o.b) {}
-
- /** Component-wise comparison */
- // TODO: add epsilon?
- bool operator == (const aiColor3D& other) const
- {return r == other.r && g == other.g && b == other.b;}
-
- /** Component-wise inverse comparison */
- // TODO: add epsilon?
- bool operator != (const aiColor3D& other) const
- {return r != other.r || g != other.g || b != other.b;}
-
- /** Component-wise addition */
- aiColor3D operator+(const aiColor3D& c) const {
- return aiColor3D(r+c.r,g+c.g,b+c.b);
- }
-
- /** Component-wise subtraction */
- aiColor3D operator-(const aiColor3D& c) const {
- return aiColor3D(r+c.r,g+c.g,b+c.b);
- }
-
- /** Component-wise multiplication */
- aiColor3D operator*(const aiColor3D& c) const {
- return aiColor3D(r*c.r,g*c.g,b*c.b);
- }
-
- /** Multiply with a scalar */
- aiColor3D operator*(float f) const {
- return aiColor3D(r*f,g*f,b*f);
- }
-
- /** Access a specific color component */
- float operator[](unsigned int i) const {
- return *(&r + i);
- }
-
- /** Access a specific color component */
- float& operator[](unsigned int i) {
- return *(&r + i);
- }
-
- /** Check whether a color is black */
- bool IsBlack() const {
- static const float epsilon = 10e-3f;
- return fabs( r ) < epsilon && fabs( g ) < epsilon && fabs( b ) < epsilon;
- }
-
-#endif // !__cplusplus
-
- //! Red, green and blue color values
- float r, g, b;
-} PACK_STRUCT; // !struct aiColor3D
-#include "./Compiler/poppack1.h"
-
-// ----------------------------------------------------------------------------------
-/** Represents an UTF-8 string, zero byte terminated.
- *
- * The character set of an aiString is explicitly defined to be UTF-8. This Unicode
- * transformation was chosen in the belief that most strings in 3d files are limited
- * to the ASCII characters, thus the character set needed to be ASCII compatible.
- *
- * Most text file loaders provide proper Unicode input file handling, special unicode
- * characters are correctly transcoded to UTF8 and are kept throughout the libraries'
- * import pipeline.
- *
- * For most applications, it will be absolutely sufficient to interpret the
- * aiString as ASCII data and work with it as one would work with a plain char*.
- * Windows users in need of proper support for i.e asian characters can use the
- * #MultiByteToWideChar(), #WideCharToMultiByte() WinAPI functionality to convert the
- * UTF-8 strings to their working character set (i.e. MBCS, WideChar).
- *
- * We use this representation instead of std::string to be C-compatible. The
- * (binary) length of such a string is limited to MAXLEN characters (including the
- * the terminating zero).
-*/
-struct aiString
-{
-#ifdef __cplusplus
- /** Default constructor, the string is set to have zero length */
- aiString() :
- length(0)
- {
- data[0] = '\0';
-
-#ifdef _DEBUG
- // Debug build: overwrite the string on its full length with ESC (27)
- memset(data+1,27,MAXLEN-1);
-#endif
- }
-
- /** Copy constructor */
- aiString(const aiString& rOther) :
- length(rOther.length)
- {
- // Crop the string to the maximum length
- length = length>=MAXLEN?MAXLEN-1:length;
- memcpy( data, rOther.data, length);
- data[length] = '\0';
- }
-
- /** Constructor from std::string */
- aiString(const std::string& pString) :
- length(pString.length())
- {
- length = length>=MAXLEN?MAXLEN-1:length;
- memcpy( data, pString.c_str(), length);
- data[length] = '\0';
- }
-
- /** Copy a std::string to the aiString */
- void Set( const std::string& pString) {
- if ( pString.length() > MAXLEN - 1) {
- return;
- }
- length = pString.length();
- ::memcpy( data, pString.c_str(), length);
- data[length] = 0;
- }
-
- /** Copy a const char* to the aiString */
- void Set( const char* sz) {
- const size_t len = ::strlen(sz);
- if ( len > MAXLEN - 1) {
- return;
- }
- length = len;
- ::memcpy( data, sz, len);
- data[len] = 0;
- }
-
- /** Assign a const char* to the string */
- aiString& operator = (const char* sz) {
- Set(sz);
- return *this;
- }
-
- /** Assign a cstd::string to the string */
- aiString& operator = ( const std::string& pString) {
- Set(pString);
- return *this;
- }
-
- /** Comparison operator */
- bool operator==(const aiString& other) const {
- return (length == other.length && 0 == strcmp(this->data,other.data));
- }
-
- /** Inverse comparison operator */
- bool operator!=(const aiString& other) const {
- return (length != other.length || 0 != ::strcmp(this->data,other.data));
- }
-
- /** Append a string to the string */
- void Append (const char* app) {
- const size_t len = ::strlen(app);
- if (!len) {
- return;
- }
- if (length + len >= MAXLEN) {
- return;
- }
-
- memcpy(&data[length],app,len+1);
- length += len;
- }
-
- /** Clear the string - reset its length to zero */
- void Clear () {
- length = 0;
- data[0] = '\0';
-
-#ifdef _DEBUG
- // Debug build: overwrite the string on its full length with ESC (27)
- memset(data+1,27,MAXLEN-1);
-#endif
- }
-
-#endif // !__cplusplus
-
- /** Binary length of the string excluding the terminal 0. This is NOT the
- * logical length of strings containing UTF-8 multibyte sequences! It's
- * the number of bytes from the beginning of the string to its end.*/
- size_t length;
-
- /** String buffer. Size limit is MAXLEN */
- char data[MAXLEN];
-} ; // !struct aiString
-
-
-// ----------------------------------------------------------------------------------
-/** Standard return type for some library functions.
- * Rarely used, and if, mostly in the C API.
- */
-enum aiReturn
-{
- /** Indicates that a function was successful */
- aiReturn_SUCCESS = 0x0,
-
- /** Indicates that a function failed */
- aiReturn_FAILURE = -0x1,
-
- /** Indicates that not enough memory was available
- * to perform the requested operation
- */
- aiReturn_OUTOFMEMORY = -0x3,
-
- /** @cond never
- * Force 32-bit size enum
- */
- _AI_ENFORCE_ENUM_SIZE = 0x7fffffff
-}; // !enum aiReturn
-
-// just for backwards compatibility, don't use these constants anymore
-#define AI_SUCCESS aiReturn_SUCCESS
-#define AI_FAILURE aiReturn_FAILURE
-#define AI_OUTOFMEMORY aiReturn_OUTOFMEMORY
-
-// ----------------------------------------------------------------------------------
-/** Seek origins (for the virtual file system API).
- * Much cooler than using SEEK_SET, SEEK_CUR or SEEK_END.
- */
-enum aiOrigin
-{
- /** Beginning of the file */
- aiOrigin_SET = 0x0,
-
- /** Current position of the file pointer */
- aiOrigin_CUR = 0x1,
-
- /** End of the file, offsets must be negative */
- aiOrigin_END = 0x2,
-
- /** @cond never
- * Force 32-bit size enum
- */
- _AI_ORIGIN_ENFORCE_ENUM_SIZE = 0x7fffffff
-}; // !enum aiOrigin
-
-// ----------------------------------------------------------------------------------
-/** @brief Enumerates predefined log streaming destinations.
- * Logging to these streams can be enabled with a single call to
- * #LogStream::createDefaultStream or #aiAttachPredefinedLogStream(),
- * respectively.
- */
-enum aiDefaultLogStream
-{
- /** Stream the log to a file */
- aiDefaultLogStream_FILE = 0x1,
-
- /** Stream the log to std::cout */
- aiDefaultLogStream_STDOUT = 0x2,
-
- /** Stream the log to std::cerr */
- aiDefaultLogStream_STDERR = 0x4,
-
- /** MSVC only: Stream the log the the debugger
- * (this relies on OutputDebugString from the Win32 SDK)
- */
- aiDefaultLogStream_DEBUGGER = 0x8,
-
- /** @cond never
- * Force 32-bit size enum
- */
- _AI_DLS_ENFORCE_ENUM_SIZE = 0x7fffffff
-}; // !enum aiDefaultLogStream
-
-// just for backwards compatibility, don't use these constants anymore
-#define DLS_FILE aiDefaultLogStream_FILE
-#define DLS_STDOUT aiDefaultLogStream_STDOUT
-#define DLS_STDERR aiDefaultLogStream_STDERR
-#define DLS_DEBUGGER aiDefaultLogStream_DEBUGGER
-
-// ----------------------------------------------------------------------------------
-/** Stores the memory requirements for different components (e.g. meshes, materials,
- * animations) of an import. All sizes are in bytes.
- * @see Importer::GetMemoryRequirements()
-*/
-struct aiMemoryInfo
-{
-#ifdef __cplusplus
-
- /** Default constructor */
- aiMemoryInfo()
- : textures (0)
- , materials (0)
- , meshes (0)
- , nodes (0)
- , animations (0)
- , cameras (0)
- , lights (0)
- , total (0)
- {}
-
-#endif
-
- /** Storage allocated for texture data */
- unsigned int textures;
-
- /** Storage allocated for material data */
- unsigned int materials;
-
- /** Storage allocated for mesh data */
- unsigned int meshes;
-
- /** Storage allocated for node data */
- unsigned int nodes;
-
- /** Storage allocated for animation data */
- unsigned int animations;
-
- /** Storage allocated for camera data */
- unsigned int cameras;
-
- /** Storage allocated for light data */
- unsigned int lights;
-
- /** Total storage allocated for the full import. */
- unsigned int total;
-}; // !struct aiMemoryInfo
-
-#ifdef __cplusplus
-}
-#endif //! __cplusplus
-
-// Include implementations
-#include "aiVector3D.inl"
-#include "aiColor4D.inl"
-#include "aiMatrix3x3.inl"
-#include "aiMatrix4x4.inl"
-#endif
diff --git a/3rdparty/assimp/include/aiVector2D.h b/3rdparty/assimp/include/aiVector2D.h
deleted file mode 100644
index c9533aa7..00000000
--- a/3rdparty/assimp/include/aiVector2D.h
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-/** @file aiVector2D.h
- * @brief 2D vector structure, including operators when compiling in C++
- */
-#ifndef AI_VECTOR2D_H_INC
-#define AI_VECTOR2D_H_INC
-
-#include <math.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "./Compiler/pushpack1.h"
-
-// ----------------------------------------------------------------------------------
-/** Represents a two-dimensional vector.
- */
-struct aiVector2D
-{
-#ifdef __cplusplus
- aiVector2D () : x(0.0f), y(0.0f) {}
- aiVector2D (float _x, float _y) : x(_x), y(_y) {}
- aiVector2D (float _xyz) : x(_xyz), y(_xyz) {}
- aiVector2D (const aiVector2D& o) : x(o.x), y(o.y) {}
-
- void Set( float pX, float pY) {
- x = pX; y = pY;
- }
-
- float SquareLength() const {
- return x*x + y*y;
- }
-
- float Length() const {
- return ::sqrt( SquareLength());
- }
-
- aiVector2D& Normalize() {
- *this /= Length(); return *this;
- }
-
- const aiVector2D& operator += (const aiVector2D& o) {
- x += o.x; y += o.y; return *this;
- }
- const aiVector2D& operator -= (const aiVector2D& o) {
- x -= o.x; y -= o.y; return *this;
- }
- const aiVector2D& operator *= (float f) {
- x *= f; y *= f; return *this;
- }
- const aiVector2D& operator /= (float f) {
- x /= f; y /= f; return *this;
- }
-
- float operator[](unsigned int i) const {
- return *(&x + i);
- }
-
- float& operator[](unsigned int i) {
- return *(&x + i);
- }
-
- bool operator== (const aiVector2D& other) const {
- return x == other.x && y == other.y;
- }
-
- bool operator!= (const aiVector2D& other) const {
- return x != other.x || y != other.y;
- }
-
- aiVector2D& operator= (float f) {
- x = y = f;return *this;
- }
-
- const aiVector2D SymMul(const aiVector2D& o) {
- return aiVector2D(x*o.x,y*o.y);
- }
-
-#endif // __cplusplus
-
- float x, y;
-} PACK_STRUCT;
-
-#include "./Compiler/poppack1.h"
-
-#ifdef __cplusplus
-} // end extern "C"
-
-// ----------------------------------------------------------------------------------
-// symmetric addition
-inline aiVector2D operator + (const aiVector2D& v1, const aiVector2D& v2)
-{
- return aiVector2D( v1.x + v2.x, v1.y + v2.y);
-}
-
-// ----------------------------------------------------------------------------------
-// symmetric subtraction
-inline aiVector2D operator - (const aiVector2D& v1, const aiVector2D& v2)
-{
- return aiVector2D( v1.x - v2.x, v1.y - v2.y);
-}
-
-// ----------------------------------------------------------------------------------
-// scalar product
-inline float operator * (const aiVector2D& v1, const aiVector2D& v2)
-{
- return v1.x*v2.x + v1.y*v2.y;
-}
-
-// ----------------------------------------------------------------------------------
-// scalar multiplication
-inline aiVector2D operator * ( float f, const aiVector2D& v)
-{
- return aiVector2D( f*v.x, f*v.y);
-}
-
-// ----------------------------------------------------------------------------------
-// and the other way around
-inline aiVector2D operator * ( const aiVector2D& v, float f)
-{
- return aiVector2D( f*v.x, f*v.y);
-}
-
-// ----------------------------------------------------------------------------------
-// scalar division
-inline aiVector2D operator / ( const aiVector2D& v, float f)
-{
-
- return v * (1/f);
-}
-
-// ----------------------------------------------------------------------------------
-// vector division
-inline aiVector2D operator / ( const aiVector2D& v, const aiVector2D& v2)
-{
- return aiVector2D(v.x / v2.x,v.y / v2.y);
-}
-
-// ----------------------------------------------------------------------------------
-// vector inversion
-inline aiVector2D operator - ( const aiVector2D& v)
-{
- return aiVector2D( -v.x, -v.y);
-}
-
-#endif // __cplusplus
-#endif // AI_VECTOR2D_H_INC
diff --git a/3rdparty/assimp/include/aiVector3D.h b/3rdparty/assimp/include/aiVector3D.h
deleted file mode 100644
index 3a6a6ff3..00000000
--- a/3rdparty/assimp/include/aiVector3D.h
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-/** @file aiVector3D.h
- * @brief 3D vector structure, including operators when compiling in C++
- */
-#ifndef AI_VECTOR3D_H_INC
-#define AI_VECTOR3D_H_INC
-
-#include <math.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "./Compiler/pushpack1.h"
-
-struct aiMatrix3x3;
-struct aiMatrix4x4;
-
-// ---------------------------------------------------------------------------
-/** Represents a three-dimensional vector. */
-struct aiVector3D
-{
-#ifdef __cplusplus
- aiVector3D () : x(0.0f), y(0.0f), z(0.0f) {}
- aiVector3D (float _x, float _y, float _z) : x(_x), y(_y), z(_z) {}
- aiVector3D (float _xyz) : x(_xyz), y(_xyz), z(_xyz) {}
- aiVector3D (const aiVector3D& o) : x(o.x), y(o.y), z(o.z) {}
-
-public:
-
- // combined operators
- const aiVector3D& operator += (const aiVector3D& o);
- const aiVector3D& operator -= (const aiVector3D& o);
- const aiVector3D& operator *= (float f);
- const aiVector3D& operator /= (float f);
-
- // transform vector by matrix
- aiVector3D& operator *= (const aiMatrix3x3& mat);
- aiVector3D& operator *= (const aiMatrix4x4& mat);
-
- // access a single element
- float operator[](unsigned int i) const;
- float& operator[](unsigned int i);
-
- // comparison
- bool operator== (const aiVector3D& other) const;
- bool operator!= (const aiVector3D& other) const;
-
-public:
-
- /** @brief Set the components of a vector
- * @param pX X component
- * @param pY Y component
- * @param pZ Z component */
- void Set( float pX, float pY, float pZ = 0.f);
-
- /** @brief Get the squared length of the vector
- * @return Square length */
- float SquareLength() const;
-
-
- /** @brief Get the length of the vector
- * @return length */
- float Length() const;
-
-
- /** @brief Normalize the vector */
- aiVector3D& Normalize();
-
-
- /** @brief Componentwise multiplication of two vectors
- *
- * Note that vec*vec yields the dot product.
- * @param o Second factor */
- const aiVector3D SymMul(const aiVector3D& o);
-
-#endif // __cplusplus
-
- float x, y, z;
-} PACK_STRUCT;
-
-#include "./Compiler/poppack1.h"
-
-#ifdef __cplusplus
-} // end extern "C"
-
-
-#endif // __cplusplus
-
-#endif // AI_VECTOR3D_H_INC
diff --git a/3rdparty/assimp/include/aiVector3D.inl b/3rdparty/assimp/include/aiVector3D.inl
deleted file mode 100644
index c14b347b..00000000
--- a/3rdparty/assimp/include/aiVector3D.inl
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file aiVector3D.inl
- * @brief Inline implementation of aiVector3D operators
- */
-#ifndef AI_VECTOR3D_INL_INC
-#define AI_VECTOR3D_INL_INC
-
-#include "aiVector3D.h"
-#ifdef __cplusplus
-
-// ------------------------------------------------------------------------------------------------
-/** Transformation of a vector by a 3x3 matrix */
-inline aiVector3D operator * (const aiMatrix3x3& pMatrix, const aiVector3D& pVector)
-{
- aiVector3D res;
- res.x = pMatrix.a1 * pVector.x + pMatrix.a2 * pVector.y + pMatrix.a3 * pVector.z;
- res.y = pMatrix.b1 * pVector.x + pMatrix.b2 * pVector.y + pMatrix.b3 * pVector.z;
- res.z = pMatrix.c1 * pVector.x + pMatrix.c2 * pVector.y + pMatrix.c3 * pVector.z;
- return res;
-}
-
-// ------------------------------------------------------------------------------------------------
-/** Transformation of a vector by a 4x4 matrix */
-inline aiVector3D operator * (const aiMatrix4x4& pMatrix, const aiVector3D& pVector)
-{
- aiVector3D res;
- res.x = pMatrix.a1 * pVector.x + pMatrix.a2 * pVector.y + pMatrix.a3 * pVector.z + pMatrix.a4;
- res.y = pMatrix.b1 * pVector.x + pMatrix.b2 * pVector.y + pMatrix.b3 * pVector.z + pMatrix.b4;
- res.z = pMatrix.c1 * pVector.x + pMatrix.c2 * pVector.y + pMatrix.c3 * pVector.z + pMatrix.c4;
- return res;
-}
-// ------------------------------------------------------------------------------------------------
-AI_FORCE_INLINE void aiVector3D::Set( float pX, float pY, float pZ) {
- x = pX; y = pY; z = pZ;
-}
-// ------------------------------------------------------------------------------------------------
-AI_FORCE_INLINE float aiVector3D::SquareLength() const {
- return x*x + y*y + z*z;
-}
-// ------------------------------------------------------------------------------------------------
-AI_FORCE_INLINE float aiVector3D::Length() const {
- return sqrt( SquareLength());
-}
-// ------------------------------------------------------------------------------------------------
-AI_FORCE_INLINE aiVector3D& aiVector3D::Normalize() {
- *this /= Length(); return *this;
-}
-// ------------------------------------------------------------------------------------------------
-AI_FORCE_INLINE const aiVector3D& aiVector3D::operator += (const aiVector3D& o) {
- x += o.x; y += o.y; z += o.z; return *this;
-}
-// ------------------------------------------------------------------------------------------------
-AI_FORCE_INLINE const aiVector3D& aiVector3D::operator -= (const aiVector3D& o) {
- x -= o.x; y -= o.y; z -= o.z; return *this;
-}
-// ------------------------------------------------------------------------------------------------
-AI_FORCE_INLINE const aiVector3D& aiVector3D::operator *= (float f) {
- x *= f; y *= f; z *= f; return *this;
-}
-// ------------------------------------------------------------------------------------------------
-AI_FORCE_INLINE const aiVector3D& aiVector3D::operator /= (float f) {
- x /= f; y /= f; z /= f; return *this;
-}
-// ------------------------------------------------------------------------------------------------
-AI_FORCE_INLINE aiVector3D& aiVector3D::operator *= (const aiMatrix3x3& mat){
- return(*this = mat * (*this));
-}
-// ------------------------------------------------------------------------------------------------
-AI_FORCE_INLINE aiVector3D& aiVector3D::operator *= (const aiMatrix4x4& mat){
- return(*this = mat * (*this));
-}
-// ------------------------------------------------------------------------------------------------
-AI_FORCE_INLINE float aiVector3D::operator[](unsigned int i) const {
- return *(&x + i);
-}
-// ------------------------------------------------------------------------------------------------
-AI_FORCE_INLINE float& aiVector3D::operator[](unsigned int i) {
- return *(&x + i);
-}
-// ------------------------------------------------------------------------------------------------
-AI_FORCE_INLINE bool aiVector3D::operator== (const aiVector3D& other) const {
- return x == other.x && y == other.y && z == other.z;
-}
-// ------------------------------------------------------------------------------------------------
-AI_FORCE_INLINE bool aiVector3D::operator!= (const aiVector3D& other) const {
- return x != other.x || y != other.y || z != other.z;
-}
-// ------------------------------------------------------------------------------------------------
-AI_FORCE_INLINE const aiVector3D aiVector3D::SymMul(const aiVector3D& o) {
- return aiVector3D(x*o.x,y*o.y,z*o.z);
-}
-// ------------------------------------------------------------------------------------------------
-// symmetric addition
-AI_FORCE_INLINE aiVector3D operator + (const aiVector3D& v1, const aiVector3D& v2) {
- return aiVector3D( v1.x + v2.x, v1.y + v2.y, v1.z + v2.z);
-}
-// ------------------------------------------------------------------------------------------------
-// symmetric subtraction
-AI_FORCE_INLINE aiVector3D operator - (const aiVector3D& v1, const aiVector3D& v2) {
- return aiVector3D( v1.x - v2.x, v1.y - v2.y, v1.z - v2.z);
-}
-// ------------------------------------------------------------------------------------------------
-// scalar product
-AI_FORCE_INLINE float operator * (const aiVector3D& v1, const aiVector3D& v2) {
- return v1.x*v2.x + v1.y*v2.y + v1.z*v2.z;
-}
-// ------------------------------------------------------------------------------------------------
-// scalar multiplication
-AI_FORCE_INLINE aiVector3D operator * ( float f, const aiVector3D& v) {
- return aiVector3D( f*v.x, f*v.y, f*v.z);
-}
-// ------------------------------------------------------------------------------------------------
-// and the other way around
-AI_FORCE_INLINE aiVector3D operator * ( const aiVector3D& v, float f) {
- return aiVector3D( f*v.x, f*v.y, f*v.z);
-}
-// ------------------------------------------------------------------------------------------------
-// scalar division
-AI_FORCE_INLINE aiVector3D operator / ( const aiVector3D& v, float f) {
- return v * (1/f);
-}
-// ------------------------------------------------------------------------------------------------
-// vector division
-AI_FORCE_INLINE aiVector3D operator / ( const aiVector3D& v, const aiVector3D& v2) {
- return aiVector3D(v.x / v2.x,v.y / v2.y,v.z / v2.z);
-}
-// ------------------------------------------------------------------------------------------------
-// cross product
-AI_FORCE_INLINE aiVector3D operator ^ ( const aiVector3D& v1, const aiVector3D& v2) {
- return aiVector3D( v1.y*v2.z - v1.z*v2.y, v1.z*v2.x - v1.x*v2.z, v1.x*v2.y - v1.y*v2.x);
-}
-// ------------------------------------------------------------------------------------------------
-// vector inversion
-AI_FORCE_INLINE aiVector3D operator - ( const aiVector3D& v) {
- return aiVector3D( -v.x, -v.y, -v.z);
-}
-
-
-#endif // __cplusplus
-#endif // AI_VECTOR3D_INL_INC
diff --git a/3rdparty/assimp/include/aiVersion.h b/3rdparty/assimp/include/aiVersion.h
deleted file mode 100644
index 98e95b7d..00000000
--- a/3rdparty/assimp/include/aiVersion.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file aiVersion.h
- * @brief Functions to query the version of the Assimp runtime, check
- * compile flags, ...
- */
-#ifndef INCLUDED_AI_VERSION_H
-#define INCLUDED_AI_VERSION_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// ---------------------------------------------------------------------------
-/** @brief Returns a string with legal copyright and licensing information
- * about Assimp. The string may include multiple lines.
- * @return Pointer to static string.
- */
-ASSIMP_API const char* aiGetLegalString (void);
-
-// ---------------------------------------------------------------------------
-/** @brief Returns the current minor version number of Assimp.
- * @return Minor version of the Assimp runtime the application was
- * linked/built against
- */
-ASSIMP_API unsigned int aiGetVersionMinor (void);
-
-// ---------------------------------------------------------------------------
-/** @brief Returns the current major version number of Assimp.
- * @return Major version of the Assimp runtime the application was
- * linked/built against
- */
-ASSIMP_API unsigned int aiGetVersionMajor (void);
-
-// ---------------------------------------------------------------------------
-/** @brief Returns the repository revision of the Assimp runtime.
- * @return SVN Repository revision number of the Assimp runtime the
- * application was linked/built against
- */
-ASSIMP_API unsigned int aiGetVersionRevision (void);
-
-
-//! Assimp was compiled as a shared object (Windows: DLL)
-#define ASSIMP_CFLAGS_SHARED 0x1
-//! Assimp was compiled against STLport
-#define ASSIMP_CFLAGS_STLPORT 0x2
-//! Assimp was compiled as a debug build
-#define ASSIMP_CFLAGS_DEBUG 0x4
-
-//! Assimp was compiled with ASSIMP_BUILD_BOOST_WORKAROUND defined
-#define ASSIMP_CFLAGS_NOBOOST 0x8
-//! Assimp was compiled with ASSIMP_BUILD_SINGLETHREADED defined
-#define ASSIMP_CFLAGS_SINGLETHREADED 0x10
-
-// ---------------------------------------------------------------------------
-/** @brief Returns assimp's compile flags
- * @return Any bitwise combination of the ASSIMP_CFLAGS_xxx constants.
- */
-ASSIMP_API unsigned int aiGetCompileFlags (void);
-
-#ifdef __cplusplus
-} // end extern "C"
-#endif
-
-#endif // !! #ifndef INCLUDED_AI_VERSION_H
diff --git a/3rdparty/assimp/include/assimp.h b/3rdparty/assimp/include/assimp.h
deleted file mode 100644
index bc1a6cdd..00000000
--- a/3rdparty/assimp/include/assimp.h
+++ /dev/null
@@ -1,434 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file assimp.h
- * @brief Defines the C-API to the Open Asset Import Library.
- */
-#ifndef AI_ASSIMP_H_INC
-#define AI_ASSIMP_H_INC
-#include "aiTypes.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct aiScene; // aiScene.h
-struct aiFileIO; // aiFileIO.h
-typedef void (*aiLogStreamCallback)(const char* /* message */, char* /* user */);
-
-// --------------------------------------------------------------------------------
-/** C-API: Represents a log stream. A log stream receives all log messages and
- * streams them _somewhere_.
- * @see aiGetPredefinedLogStream
- * @see aiAttachLogStream
- * @see aiDetachLogStream */
-// --------------------------------------------------------------------------------
-struct aiLogStream
-{
- /** callback to be called */
- aiLogStreamCallback callback;
-
- /** user data to be passed to the callback */
- char* user;
-};
-
-/** Our own C boolean type */
-typedef int aiBool;
-
-#define AI_FALSE 0
-#define AI_TRUE 1
-
-// --------------------------------------------------------------------------------
-/** Reads the given file and returns its content.
- *
- * If the call succeeds, the imported data is returned in an aiScene structure.
- * The data is intended to be read-only, it stays property of the ASSIMP
- * library and will be stable until aiReleaseImport() is called. After you're
- * done with it, call aiReleaseImport() to free the resources associated with
- * this file. If the import fails, NULL is returned instead. Call
- * aiGetErrorString() to retrieve a human-readable error text.
- * @param pFile Path and filename of the file to be imported,
- * expected to be a null-terminated c-string. NULL is not a valid value.
- * @param pFlags Optional post processing steps to be executed after
- * a successful import. Provide a bitwise combination of the
- * #aiPostProcessSteps flags.
- * @return Pointer to the imported data or NULL if the import failed.
- */
-ASSIMP_API const C_STRUCT aiScene* aiImportFile(
- const char* pFile,
- unsigned int pFlags);
-
-// --------------------------------------------------------------------------------
-/** Reads the given file using user-defined I/O functions and returns
- * its content.
- *
- * If the call succeeds, the imported data is returned in an aiScene structure.
- * The data is intended to be read-only, it stays property of the ASSIMP
- * library and will be stable until aiReleaseImport() is called. After you're
- * done with it, call aiReleaseImport() to free the resources associated with
- * this file. If the import fails, NULL is returned instead. Call
- * aiGetErrorString() to retrieve a human-readable error text.
- * @param pFile Path and filename of the file to be imported,
- * expected to be a null-terminated c-string. NULL is not a valid value.
- * @param pFlags Optional post processing steps to be executed after
- * a successful import. Provide a bitwise combination of the
- * #aiPostProcessSteps flags.
- * @param pFS aiFileIO structure. Will be used to open the model file itself
- * and any other files the loader needs to open.
- * @return Pointer to the imported data or NULL if the import failed.
- * @note Include <aiFileIO.h> for the definition of #aiFileIO.
- */
-ASSIMP_API const C_STRUCT aiScene* aiImportFileEx(
- const char* pFile,
- unsigned int pFlags,
- C_STRUCT aiFileIO* pFS);
-
-// --------------------------------------------------------------------------------
-/** Reads the given file from a given memory buffer,
- *
- * If the call succeeds, the contents of the file are returned as a pointer to an
- * aiScene object. The returned data is intended to be read-only, the importer keeps
- * ownership of the data and will destroy it upon destruction. If the import fails,
- * NULL is returned.
- * A human-readable error description can be retrieved by calling aiGetErrorString().
- * @param pBuffer Pointer to the file data
- * @param pLength Length of pBuffer, in bytes
- * @param pFlags Optional post processing steps to be executed after
- * a successful import. Provide a bitwise combination of the
- * #aiPostProcessSteps flags. If you wish to inspect the imported
- * scene first in order to fine-tune your post-processing setup,
- * consider to use #aiApplyPostProcessing().
- * @param pHint An additional hint to the library. If this is a non empty string,
- * the library looks for a loader to support the file extension specified by pHint
- * and passes the file to the first matching loader. If this loader is unable to
- * completely the request, the library continues and tries to determine the file
- * format on its own, a task that may or may not be successful.
- * Check the return value, and you'll know ...
- * @return A pointer to the imported data, NULL if the import failed.
- *
- * @note This is a straightforward way to decode models from memory buffers, but it
- * doesn't handle model formats spreading their data across multiple files or even
- * directories. Examples include OBJ or MD3, which outsource parts of their material
- * stuff into external scripts. If you need the full functionality, provide a custom
- * IOSystem to make Assimp find these files.
- */
-ASSIMP_API const C_STRUCT aiScene* aiImportFileFromMemory(
- const char* pBuffer,
- unsigned int pLength,
- unsigned int pFlags,
- const char* pHint);
-
-// --------------------------------------------------------------------------------
-/** Apply post-processing to an already-imported scene.
- *
- * This is strictly equivalent to calling #aiImportFile()/#aiImportFileEx with the
- * same flags. However, you can use this separate function to inspect the imported
- * scene first to fine-tune your post-processing setup.
- * @param pScene Scene to work on.
- * @param pFlags Provide a bitwise combination of the #aiPostProcessSteps flags.
- * @return A pointer to the post-processed data. Post processing is done in-place,
- * meaning this is still the same #aiScene which you passed for pScene. However,
- * _if_ post-processing failed, the scene could now be NULL. That's quite a rare
- * case, post processing steps are not really designed to 'fail'. To be exact,
- * the #aiProcess_ValidateDS flag is currently the only post processing step
- * which can actually cause the scene to be reset to NULL.
- */
-ASSIMP_API const C_STRUCT aiScene* aiApplyPostProcessing(
- const C_STRUCT aiScene* pScene,
- unsigned int pFlags);
-
-// --------------------------------------------------------------------------------
-/** Get one of the predefine log streams. This is the quick'n'easy solution to
- * access Assimp's log system. Attaching a log stream can slightly reduce Assimp's
- * overall import performance.
- *
- * Usage is rather simple (this will stream the log to a file, named log.txt, and
- * the stdout stream of the process:
- * @code
- * struct aiLogStream c;
- * c = aiGetPredefinedLogStream(aiDefaultLogStream_FILE,"log.txt");
- * aiAttachLogStream(&c);
- * c = aiGetPredefinedLogStream(aiDefaultLogStream_STDOUT,NULL);
- * aiAttachLogStream(&c);
- * @endcode
- *
- * @param pStreams One of the #aiDefaultLogStream enumerated values.
- * @param file Solely for the #aiDefaultLogStream_FILE flag: specifies the file to write to.
- * Pass NULL for all other flags.
- * @return The log stream. callback is set to NULL if something went wrong.
- */
-ASSIMP_API C_STRUCT aiLogStream aiGetPredefinedLogStream(
- C_ENUM aiDefaultLogStream pStreams,
- const char* file);
-
-// --------------------------------------------------------------------------------
-/** Attach a custom log stream to the libraries' logging system.
- *
- * Attaching a log stream can slightly reduce Assimp's overall import
- * performance. Multiple log-streams can be attached.
- * @param stream Describes the new log stream.
- * @note To ensure proepr destruction of the logging system, you need to manually
- * call aiDetachLogStream() on every single log stream you attach.
- * Alternatively (for the lazy folks) #aiDetachAllLogStreams is provided.
- */
-ASSIMP_API void aiAttachLogStream(
- const C_STRUCT aiLogStream* stream);
-
-// --------------------------------------------------------------------------------
-/** Enable verbose logging. Verbose logging includes debug-related stuff and
- * detailed import statistics. This can have severe impact on import performance
- * and memory consumption. However, it might be useful to find out why a file
- * didn't read correctly.
- * @param d AI_TRUE or AI_FALSE, your decision.
- */
-ASSIMP_API void aiEnableVerboseLogging(aiBool d);
-
-// --------------------------------------------------------------------------------
-/** Detach a custom log stream from the libraries' logging system.
- *
- * This is the counterpart of #aiAttachPredefinedLogStream. If you attached a stream,
- * don't forget to detach it again.
- * @param stream The log stream to be detached.
- * @return AI_SUCCESS if the log stream has been detached successfully.
- * @see aiDetachAllLogStreams
- */
-ASSIMP_API C_ENUM aiReturn aiDetachLogStream(
- const C_STRUCT aiLogStream* stream);
-
-// --------------------------------------------------------------------------------
-/** Detach all active log streams from the libraries' logging system.
- * This ensures that the logging system is terminated properly and all
- * resources allocated by it are actually freed. If you attached a stream,
- * don't forget to detach it again.
- * @see aiAttachLogStream
- * @see aiDetachLogStream
- */
-ASSIMP_API void aiDetachAllLogStreams(void);
-
-// --------------------------------------------------------------------------------
-/** Releases all resources associated with the given import process.
- *
- * Call this function after you're done with the imported data.
- * @param pScene The imported data to release. NULL is a valid value.
- */
-ASSIMP_API void aiReleaseImport(
- const C_STRUCT aiScene* pScene);
-
-// --------------------------------------------------------------------------------
-/** Returns the error text of the last failed import process.
- *
- * @return A textual description of the error that occurred at the last
- * import process. NULL if there was no error. There can't be an error if you
- * got a non-NULL #aiScene from #aiImportFile/#aiImportFileEx/#aiApplyPostProcessing.
- */
-ASSIMP_API const char* aiGetErrorString();
-
-// --------------------------------------------------------------------------------
-/** Returns whether a given file extension is supported by ASSIMP
- *
- * @param szExtension Extension for which the function queries support for.
- * Must include a leading dot '.'. Example: ".3ds", ".md3"
- * @return AI_TRUE if the file extension is supported.
- */
-ASSIMP_API aiBool aiIsExtensionSupported(
- const char* szExtension);
-
-// --------------------------------------------------------------------------------
-/** Get a list of all file extensions supported by ASSIMP.
- *
- * If a file extension is contained in the list this does, of course, not
- * mean that ASSIMP is able to load all files with this extension.
- * @param szOut String to receive the extension list.
- * Format of the list: "*.3ds;*.obj;*.dae". NULL is not a valid parameter.
- */
-ASSIMP_API void aiGetExtensionList(
- C_STRUCT aiString* szOut);
-
-// --------------------------------------------------------------------------------
-/** Get the storage required by an imported asset
- * @param pIn Input asset.
- * @param in Data structure to be filled.
- */
-ASSIMP_API void aiGetMemoryRequirements(
- const C_STRUCT aiScene* pIn,
- C_STRUCT aiMemoryInfo* in);
-
-// --------------------------------------------------------------------------------
-/** Set an integer property.
- *
- * This is the C-version of #Assimp::Importer::SetPropertyInteger(). In the C
- * interface, properties are always shared by all imports. It is not possible to
- * specify them per import.
- *
- * @param szName Name of the configuration property to be set. All supported
- * public properties are defined in the aiConfig.h header file (#AI_CONFIG_XXX).
- * @param value New value for the property
- */
-ASSIMP_API void aiSetImportPropertyInteger(
- const char* szName,
- int value);
-
-// --------------------------------------------------------------------------------
-/** Set a floating-point property.
- *
- * This is the C-version of #Assimp::Importer::SetPropertyFloat(). In the C
- * interface, properties are always shared by all imports. It is not possible to
- * specify them per import.
- *
- * @param szName Name of the configuration property to be set. All supported
- * public properties are defined in the aiConfig.h header file (#AI_CONFIG_XXX).
- * @param value New value for the property
- */
-ASSIMP_API void aiSetImportPropertyFloat(
- const char* szName,
- float value);
-
-// --------------------------------------------------------------------------------
-/** Set a string property.
- *
- * This is the C-version of #Assimp::Importer::SetPropertyString(). In the C
- * interface, properties are always shared by all imports. It is not possible to
- * specify them per import.
- *
- * @param szName Name of the configuration property to be set. All supported
- * public properties are defined in the aiConfig.h header file (#AI_CONFIG_XXX).
- * @param value New value for the property
- */
-ASSIMP_API void aiSetImportPropertyString(
- const char* szName,
- const C_STRUCT aiString* st);
-
-// --------------------------------------------------------------------------------
-/** Construct a quaternion from a 3x3 rotation matrix.
- * @param quat Receives the output quaternion.
- * @param mat Matrix to 'quaternionize'.
- * @see aiQuaternion(const aiMatrix3x3& pRotMatrix)
- */
-ASSIMP_API void aiCreateQuaternionFromMatrix(
- C_STRUCT aiQuaternion* quat,
- const C_STRUCT aiMatrix3x3* mat);
-
-// --------------------------------------------------------------------------------
-/** Decompose a transformation matrix into its rotational, translational and
- * scaling components.
- *
- * @param mat Matrix to decompose
- * @param scaling Receives the scaling component
- * @param rotation Receives the rotational component
- * @param position Receives the translational component.
- * @see aiMatrix4x4::Decompose (aiVector3D&, aiQuaternion&, aiVector3D&) const;
- */
-ASSIMP_API void aiDecomposeMatrix(
- const C_STRUCT aiMatrix4x4* mat,
- C_STRUCT aiVector3D* scaling,
- C_STRUCT aiQuaternion* rotation,
- C_STRUCT aiVector3D* position);
-
-// --------------------------------------------------------------------------------
-/** Transpose a 4x4 matrix.
- * @param mat Pointer to the matrix to be transposed
- */
-ASSIMP_API void aiTransposeMatrix4(
- C_STRUCT aiMatrix4x4* mat);
-
-// --------------------------------------------------------------------------------
-/** Transpose a 3x3 matrix.
- * @param mat Pointer to the matrix to be transposed
- */
-ASSIMP_API void aiTransposeMatrix3(
- C_STRUCT aiMatrix3x3* mat);
-
-// --------------------------------------------------------------------------------
-/** Transform a vector by a 3x3 matrix
- * @param vec Vector to be transformed.
- * @param mat Matrix to transform the vector with.
- */
-ASSIMP_API void aiTransformVecByMatrix3(
- C_STRUCT aiVector3D* vec,
- const C_STRUCT aiMatrix3x3* mat);
-
-// --------------------------------------------------------------------------------
-/** Transform a vector by a 4x4 matrix
- * @param vec Vector to be transformed.
- * @param mat Matrix to transform the vector with.
- */
-ASSIMP_API void aiTransformVecByMatrix4(
- C_STRUCT aiVector3D* vec,
- const C_STRUCT aiMatrix4x4* mat);
-
-// --------------------------------------------------------------------------------
-/** Multiply two 4x4 matrices.
- * @param dst First factor, receives result.
- * @param src Matrix to be multiplied with 'dst'.
- */
-ASSIMP_API void aiMultiplyMatrix4(
- C_STRUCT aiMatrix4x4* dst,
- const C_STRUCT aiMatrix4x4* src);
-
-// --------------------------------------------------------------------------------
-/** Multiply two 3x3 matrices.
- * @param dst First factor, receives result.
- * @param src Matrix to be multiplied with 'dst'.
- */
-ASSIMP_API void aiMultiplyMatrix3(
- C_STRUCT aiMatrix3x3* dst,
- const C_STRUCT aiMatrix3x3* src);
-
-// --------------------------------------------------------------------------------
-/** Get a 3x3 identity matrix.
- * @param mat Matrix to receive its personal identity
- */
-ASSIMP_API void aiIdentityMatrix3(
- C_STRUCT aiMatrix3x3* mat);
-
-// --------------------------------------------------------------------------------
-/** Get a 4x4 identity matrix.
- * @param mat Matrix to receive its personal identity
- */
-ASSIMP_API void aiIdentityMatrix4(
- C_STRUCT aiMatrix4x4* mat);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // AI_ASSIMP_H_INC
diff --git a/3rdparty/assimp/include/assimp.hpp b/3rdparty/assimp/include/assimp.hpp
deleted file mode 100644
index 098a6cce..00000000
--- a/3rdparty/assimp/include/assimp.hpp
+++ /dev/null
@@ -1,609 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (ASSIMP)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2010, ASSIMP Development Team
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
----------------------------------------------------------------------------
-*/
-
-/** @file assimp.hpp
- * @brief Defines the C++-API to the Open Asset Import Library.
- */
-#ifndef INCLUDED_AI_ASSIMP_HPP
-#define INCLUDED_AI_ASSIMP_HPP
-
-#ifndef __cplusplus
-# error This header requires C++ to be used. Use assimp.h for plain C.
-#endif
-
-// Public ASSIMP data structures
-#include "aiTypes.h"
-#include "aiConfig.h"
-#include "aiAssert.h"
-
-namespace Assimp {
- // =======================================================================
- // Public interface to Assimp
- class Importer;
- class IOStream;
- class IOSystem;
- class ProgressHandler;
-
- // =======================================================================
- // Plugin development
- //
- // Include the following headers for the declarations:
- // BaseImporter.h
- // BaseProcess.h
- class BaseImporter;
- class BaseProcess;
- class SharedPostProcessInfo;
- class BatchLoader;
-
- // =======================================================================
- // Holy stuff, only for members of the high council of the Jedi.
- class ImporterPimpl;
-} //! namespace Assimp
-
-#define AI_PROPERTY_WAS_NOT_EXISTING 0xffffffff
-
-struct aiScene;
-struct aiFileIO;
-extern "C" ASSIMP_API const aiScene* aiImportFileEx( const char*, unsigned int, aiFileIO*);
-extern "C" ASSIMP_API const aiScene* aiImportFileFromMemory( const char*,
- unsigned int,unsigned int,const char*);
-
-/** @namespace Assimp Assimp's CPP-API and all internal APIs */
-namespace Assimp {
-
-// ----------------------------------------------------------------------------------
-/** CPP-API: The Importer class forms an C++ interface to the functionality of the
-* Open Asset Import Library.
-*
-* Create an object of this class and call ReadFile() to import a file.
-* If the import succeeds, the function returns a pointer to the imported data.
-* The data remains property of the object, it is intended to be accessed
-* read-only. The imported data will be destroyed along with the Importer
-* object. If the import fails, ReadFile() returns a NULL pointer. In this
-* case you can retrieve a human-readable error description be calling
-* GetErrorString(). You can call ReadFile() multiple times with a single Importer
-* instance. Actually, constructing Importer objects involves quite many
-* allocations and may take some time, so it's better to reuse them as often as
-* possible.
-*
-* If you need the Importer to do custom file handling to access the files,
-* implement IOSystem and IOStream and supply an instance of your custom
-* IOSystem implementation by calling SetIOHandler() before calling ReadFile().
-* If you do not assign a custion IO handler, a default handler using the
-* standard C++ IO logic will be used.
-*
-* @note One Importer instance is not thread-safe. If you use multiple
-* threads for loading, each thread should maintain its own Importer instance.
-*/
-class ASSIMP_API Importer {
-
- // for internal use
- friend class BaseProcess;
- friend class BatchLoader;
- friend const aiScene* ::aiImportFileEx( const char*, unsigned int, aiFileIO*);
- friend const aiScene* ::aiImportFileFromMemory( const char*,
- unsigned int,unsigned int,const char*);
-
-public:
-
- // -------------------------------------------------------------------
- /** Constructor. Creates an empty importer object.
- *
- * Call ReadFile() to start the import process. The configuration
- * property table is initially empty.
- */
- Importer();
-
- // -------------------------------------------------------------------
- /** Copy constructor.
- *
- * This copies the configuration properties of another Importer.
- * If this Importer owns a scene it won't be copied.
- * Call ReadFile() to start the import process.
- */
- Importer(const Importer& other);
-
- // -------------------------------------------------------------------
- /** Destructor. The object kept ownership of the imported data,
- * which now will be destroyed along with the object.
- */
- ~Importer();
-
-
- // -------------------------------------------------------------------
- /** Registers a new loader.
- *
- * @param pImp Importer to be added. The Importer instance takes
- * ownership of the pointer, so it will be automatically deleted
- * with the Importer instance.
- * @return AI_SUCCESS if the loader has been added. The registration
- * fails if there is already a loader for a specific file extension.
- */
- aiReturn RegisterLoader(BaseImporter* pImp);
-
- // -------------------------------------------------------------------
- /** Unregisters a loader.
- *
- * @param pImp Importer to be unregistered.
- * @return AI_SUCCESS if the loader has been removed. The function
- * fails if the loader is currently in use (this could happen
- * if the #Importer instance is used by more than one thread) or
- * if it has not yet been registered.
- */
- aiReturn UnregisterLoader(BaseImporter* pImp);
-
- // -------------------------------------------------------------------
- /** Registers a new post-process step.
- *
- * At the moment, there's a small limitation: new post processing
- * steps are added to end of the list, or in other words, executed
- * last, after all built-in steps.
- * @param pImp Post-process step to be added. The Importer instance
- * takes ownership of the pointer, so it will be automatically
- * deleted with the Importer instance.
- * @return AI_SUCCESS if the step has been added correctly.
- */
- aiReturn RegisterPPStep(BaseProcess* pImp);
-
- // -------------------------------------------------------------------
- /** Unregisters a post-process step.
- *
- * @param pImp Step to be unregistered.
- * @return AI_SUCCESS if the step has been removed. The function
- * fails if the step is currently in use (this could happen
- * if the #Importer instance is used by more than one thread) or
- * if it has not yet been registered.
- */
- aiReturn UnregisterPPStep(BaseProcess* pImp);
-
-
- // -------------------------------------------------------------------
- /** Set an integer configuration property.
- * @param szName Name of the property. All supported properties
- * are defined in the aiConfig.g header (all constants share the
- * prefix AI_CONFIG_XXX and are simple strings).
- * @param iValue New value of the property
- * @param bWasExisting Optional pointer to receive true if the
- * property was set before. The new value replaces the previous value
- * in this case.
- * @note Property of different types (float, int, string ..) are kept
- * on different stacks, so calling SetPropertyInteger() for a
- * floating-point property has no effect - the loader will call
- * GetPropertyFloat() to read the property, but it won't be there.
- */
- void SetPropertyInteger(const char* szName, int iValue,
- bool* bWasExisting = NULL);
-
- // -------------------------------------------------------------------
- /** Set a boolean configuration property. Boolean properties
- * are stored on the integer stack internally so it's possible
- * to set them via #SetPropertyBool and query them with
- * #GetPropertyBool and vice versa.
- * @see SetPropertyInteger()
- */
- void SetPropertyBool(const char* szName, bool value, bool* bWasExisting = NULL) {
- SetPropertyInteger(szName,value);
- }
-
- // -------------------------------------------------------------------
- /** Set a floating-point configuration property.
- * @see SetPropertyInteger()
- */
- void SetPropertyFloat(const char* szName, float fValue,
- bool* bWasExisting = NULL);
-
- // -------------------------------------------------------------------
- /** Set a string configuration property.
- * @see SetPropertyInteger()
- */
- void SetPropertyString(const char* szName, const std::string& sValue,
- bool* bWasExisting = NULL);
-
- // -------------------------------------------------------------------
- /** Get a configuration property.
- * @param szName Name of the property. All supported properties
- * are defined in the aiConfig.g header (all constants share the
- * prefix AI_CONFIG_XXX).
- * @param iErrorReturn Value that is returned if the property
- * is not found.
- * @return Current value of the property
- * @note Property of different types (float, int, string ..) are kept
- * on different lists, so calling SetPropertyInteger() for a
- * floating-point property has no effect - the loader will call
- * GetPropertyFloat() to read the property, but it won't be there.
- */
- int GetPropertyInteger(const char* szName,
- int iErrorReturn = 0xffffffff) const;
-
- // -------------------------------------------------------------------
- /** Get a boolean configuration property. Boolean properties
- * are stored on the integer stack internally so it's possible
- * to set them via #SetPropertyBool and query them with
- * #GetPropertyBool and vice versa.
- * @see GetPropertyInteger()
- */
- bool GetPropertyBool(const char* szName, bool bErrorReturn = false) const {
- return GetPropertyInteger(szName,bErrorReturn)!=0;
- }
-
- // -------------------------------------------------------------------
- /** Get a floating-point configuration property
- * @see GetPropertyInteger()
- */
- float GetPropertyFloat(const char* szName,
- float fErrorReturn = 10e10f) const;
-
- // -------------------------------------------------------------------
- /** Get a string configuration property
- *
- * The return value remains valid until the property is modified.
- * @see GetPropertyInteger()
- */
- const std::string& GetPropertyString(const char* szName,
- const std::string& sErrorReturn = "") const;
-
- // -------------------------------------------------------------------
- /** Supplies a custom IO handler to the importer to use to open and
- * access files. If you need the importer to use custion IO logic to
- * access the files, you need to provide a custom implementation of
- * IOSystem and IOFile to the importer. Then create an instance of
- * your custion IOSystem implementation and supply it by this function.
- *
- * The Importer takes ownership of the object and will destroy it
- * afterwards. The previously assigned handler will be deleted.
- * Pass NULL to take again ownership of your IOSystem and reset Assimp
- * to use its default implementation.
- *
- * @param pIOHandler The IO handler to be used in all file accesses
- * of the Importer.
- */
- void SetIOHandler( IOSystem* pIOHandler);
-
- // -------------------------------------------------------------------
- /** Retrieves the IO handler that is currently set.
- * You can use #IsDefaultIOHandler() to check whether the returned
- * interface is the default IO handler provided by ASSIMP. The default
- * handler is active as long the application doesn't supply its own
- * custom IO handler via #SetIOHandler().
- * @return A valid IOSystem interface, never NULL.
- */
- IOSystem* GetIOHandler() const;
-
- // -------------------------------------------------------------------
- /** Checks whether a default IO handler is active
- * A default handler is active as long the application doesn't
- * supply its own custom IO handler via #SetIOHandler().
- * @return true by default
- */
- bool IsDefaultIOHandler() const;
-
- // -------------------------------------------------------------------
- /** Supplies a custom progress handler to the importer. This
- * interface exposes a #Update() callback, which is called
- * more or less periodically (please don't sue us if it
- * isn't as periodically as you'd like it to have ...).
- * This can be used to implement progress bars and loading
- * timeouts.
- * @param pHandler Progress callback interface. Pass NULL to
- * disable progress reporting.
- * @note Progress handlers can be used to abort the loading
- * at almost any time.*/
- void SetProgressHandler ( ProgressHandler* pHandler );
-
- // -------------------------------------------------------------------
- /** Retrieves the progress handler that is currently set.
- * You can use #IsDefaultProgressHandler() to check whether the returned
- * interface is the default handler provided by ASSIMP. The default
- * handler is active as long the application doesn't supply its own
- * custom handler via #SetProgressHandler().
- * @return A valid ProgressHandler interface, never NULL.
- */
- ProgressHandler* GetProgressHandler() const;
-
- // -------------------------------------------------------------------
- /** Checks whether a default progress handler is active
- * A default handler is active as long the application doesn't
- * supply its own custom progress handler via #SetProgressHandler().
- * @return true by default
- */
- bool IsDefaultProgressHandler() const;
-
- // -------------------------------------------------------------------
- /** @brief Check whether a given set of postprocessing flags
- * is supported.
- *
- * Some flags are mutually exclusive, others are probably
- * not available because your excluded them from your
- * Assimp builds. Calling this function is recommended if
- * you're unsure.
- *
- * @param pFlags Bitwise combination of the aiPostProcess flags.
- * @return true if this flag combination is fine.
- */
- bool ValidateFlags(unsigned int pFlags) const;
-
- // -------------------------------------------------------------------
- /** Reads the given file and returns its contents if successful.
- *
- * If the call succeeds, the contents of the file are returned as a
- * pointer to an aiScene object. The returned data is intended to be
- * read-only, the importer object keeps ownership of the data and will
- * destroy it upon destruction. If the import fails, NULL is returned.
- * A human-readable error description can be retrieved by calling
- * GetErrorString(). The previous scene will be deleted during this call.
- * @param pFile Path and filename to the file to be imported.
- * @param pFlags Optional post processing steps to be executed after
- * a successful import. Provide a bitwise combination of the
- * #aiPostProcessSteps flags. If you wish to inspect the imported
- * scene first in order to fine-tune your post-processing setup,
- * consider to use #ApplyPostProcessing().
- * @return A pointer to the imported data, NULL if the import failed.
- * The pointer to the scene remains in possession of the Importer
- * instance. Use GetOrphanedScene() to take ownership of it.
- *
- * @note Assimp is able to determine the file format of a file
- * automatically.
- */
- const aiScene* ReadFile(
- const char* pFile,
- unsigned int pFlags);
-
- // -------------------------------------------------------------------
- /** Reads the given file from a memory buffer and returns its
- * contents if successful.
- *
- * If the call succeeds, the contents of the file are returned as a
- * pointer to an aiScene object. The returned data is intended to be
- * read-only, the importer object keeps ownership of the data and will
- * destroy it upon destruction. If the import fails, NULL is returned.
- * A human-readable error description can be retrieved by calling
- * GetErrorString(). The previous scene will be deleted during this call.
- * Calling this method doesn't affect the active IOSystem.
- * @param pBuffer Pointer to the file data
- * @param pLength Length of pBuffer, in bytes
- * @param pFlags Optional post processing steps to be executed after
- * a successful import. Provide a bitwise combination of the
- * #aiPostProcessSteps flags. If you wish to inspect the imported
- * scene first in order to fine-tune your post-processing setup,
- * consider to use #ApplyPostProcessing().
- * @param pHint An additional hint to the library. If this is a non
- * empty string, the library looks for a loader to support
- * the file extension specified by pHint and passes the file to
- * the first matching loader. If this loader is unable to completely
- * the request, the library continues and tries to determine the
- * file format on its own, a task that may or may not be successful.
- * Check the return value, and you'll know ...
- * @return A pointer to the imported data, NULL if the import failed.
- * The pointer to the scene remains in possession of the Importer
- * instance. Use GetOrphanedScene() to take ownership of it.
- *
- * @note This is a straightforward way to decode models from memory
- * buffers, but it doesn't handle model formats spreading their
- * data across multiple files or even directories. Examples include
- * OBJ or MD3, which outsource parts of their material stuff into
- * external scripts. If you need the full functionality, provide
- * a custom IOSystem to make Assimp find these files.
- */
- const aiScene* ReadFileFromMemory(
- const void* pBuffer,
- size_t pLength,
- unsigned int pFlags,
- const char* pHint = "");
-
- // -------------------------------------------------------------------
- /** Apply post-processing to an already-imported scene.
- *
- * This is strictly equivalent to calling #ReadFile() with the same
- * flags. However, you can use this separate function to inspect
- * the imported scene first to fine-tune your post-processing setup.
- * @param pFlags Provide a bitwise combination of the
- * #aiPostProcessSteps flags.
- * @return A pointer to the post-processed data. This is still the
- * same as the pointer returned by #ReadFile(). However, if
- * post-processing fails, the scene could now be NULL.
- * That's quite a rare case, post processing steps are not really
- * designed to 'fail'. To be exact, the #aiProcess_ValidateDS
- * flag is currently the only post processing step which can actually
- * cause the scene to be reset to NULL.
- *
- * @note The method does nothing if no scene is currently bound
- * to the #Importer instance. */
- const aiScene* ApplyPostProcessing(unsigned int pFlags);
-
- // -------------------------------------------------------------------
- /** @brief Reads the given file and returns its contents if successful.
- *
- * This function is provided for backward compatibility.
- * See the const char* version for detailled docs.
- * @see ReadFile(const char*, pFlags) */
- const aiScene* ReadFile(
- const std::string& pFile,
- unsigned int pFlags);
-
- // -------------------------------------------------------------------
- /** Frees the current scene.
- *
- * The function does nothing if no scene has previously been
- * read via ReadFile(). FreeScene() is called automatically by the
- * destructor and ReadFile() itself. */
- void FreeScene( );
-
- // -------------------------------------------------------------------
- /** Returns an error description of an error that occurred in ReadFile().
- *
- * Returns an empty string if no error occurred.
- * @return A description of the last error, an empty string if no
- * error occurred. The string is never NULL.
- *
- * @note The returned function remains valid until one of the
- * following methods is called: #ReadFile(), #FreeScene(). */
- const char* GetErrorString() const;
-
-
- // -------------------------------------------------------------------
- /** Returns whether a given file extension is supported by ASSIMP.
- *
- * @param szExtension Extension to be checked.
- * Must include a trailing dot '.'. Example: ".3ds", ".md3".
- * Cases-insensitive.
- * @return true if the extension is supported, false otherwise */
- bool IsExtensionSupported(const char* szExtension) const;
-
- // -------------------------------------------------------------------
- /** @brief Returns whether a given file extension is supported by ASSIMP.
- *
- * This function is provided for backward compatibility.
- * See the const char* version for detailed and up-to-date docs.
- * @see IsExtensionSupported(const char*) */
- inline bool IsExtensionSupported(const std::string& szExtension) const;
-
-
- // -------------------------------------------------------------------
- /** Get a full list of all file extensions supported by ASSIMP.
- *
- * If a file extension is contained in the list this does of course not
- * mean that ASSIMP is able to load all files with this extension ---
- * it simply means there is an importer loaded which claims to handle
- * files with this file extension.
- * @param szOut String to receive the extension list.
- * Format of the list: "*.3ds;*.obj;*.dae". This is useful for
- * use with the WinAPI call GetOpenFileName(Ex). */
- void GetExtensionList(aiString& szOut) const;
-
- // -------------------------------------------------------------------
- /** @brief Get a full list of all file extensions supported by ASSIMP.
- *
- * This function is provided for backward compatibility.
- * See the aiString version for detailed and up-to-date docs.
- * @see GetExtensionList(aiString&)*/
- inline void GetExtensionList(std::string& szOut) const;
-
-
- // -------------------------------------------------------------------
- /** Find the loader corresponding to a specific file extension.
- *
- * This is quite similar to IsExtensionSupported() except a
- * BaseImporter instance is returned.
- * @param szExtension Extension to check for. The following formats
- * are recgnized (BAH being the file extension): "BAH" (comparison
- * is case-insensitive), ".bah", "*.bah" (wild card and dot
- * characters at the beginning of the extension are skipped).
- * @return NULL if there is no loader for the extension.*/
- BaseImporter* FindLoader (const char* szExtension) const;
-
-
- // -------------------------------------------------------------------
- /** Returns the scene loaded by the last successful call to ReadFile()
- *
- * @return Current scene or NULL if there is currently no scene loaded */
- const aiScene* GetScene() const;
-
- // -------------------------------------------------------------------
- /** Returns the scene loaded by the last successful call to ReadFile()
- * and releases the scene from the ownership of the Importer
- * instance. The application is now responsible for deleting the
- * scene. Any further calls to GetScene() or GetOrphanedScene()
- * will return NULL - until a new scene has been loaded via ReadFile().
- *
- * @return Current scene or NULL if there is currently no scene loaded
- * @note Use this method with maximal caution, and only if you have to.
- * By design, aiScene's are exclusively maintained, allocated and
- * deallocated by Assimp and no one else. The reasoning behind this
- * is the golden rule that deallocations should always be done
- * by the module that did the original allocation because heaps
- * are not necessarily shared. GetOrphanedScene() enforces you
- * to delete the returned scene by yourself, but this will only
- * be fine if and only if you're using the same heap as assimp.
- * On Windows, it's typically fine when everything is linked
- * against the multithreaded-dll version of the runtime library.
- * It will work as well for static linkage with Assimp.*/
- aiScene* GetOrphanedScene();
-
- // -------------------------------------------------------------------
- /** Returns the storage allocated by ASSIMP to hold the scene data
- * in memory.
- *
- * This refers to the currently loaded file, see #ReadFile().
- * @param in Data structure to be filled.
- * @note The returned memory statistics refer to the actual
- * size of the use data of the aiScene. Heap-related overhead
- * is (naturally) not included.*/
- void GetMemoryRequirements(aiMemoryInfo& in) const;
-
- // -------------------------------------------------------------------
- /** Enables "extra verbose" mode.
- *
- * 'Extra verbose' means the data structure is validated after *every*
- * single post processing step to make sure everyone modifies the data
- * structure in a well-defined manner. This is a debug feature and not
- * intended for use in production environments. */
- void SetExtraVerbose(bool bDo);
-
-protected:
-
- // Just because we don't want you to know how we're hacking around.
- ImporterPimpl* pimpl;
-}; //! class Importer
-
-
-// ----------------------------------------------------------------------------
-// For compatibility, the interface of some functions taking a std::string was
-// changed to const char* to avoid crashes between binary incompatible STL
-// versions. This code her is inlined, so it shouldn't cause any problems.
-// ----------------------------------------------------------------------------
-
-// ----------------------------------------------------------------------------
-AI_FORCE_INLINE const aiScene* Importer::ReadFile( const std::string& pFile,unsigned int pFlags){
- return ReadFile(pFile.c_str(),pFlags);
-}
-// ----------------------------------------------------------------------------
-AI_FORCE_INLINE void Importer::GetExtensionList(std::string& szOut) const {
- aiString s;
- GetExtensionList(s);
- szOut = s.data;
-}
-// ----------------------------------------------------------------------------
-AI_FORCE_INLINE bool Importer::IsExtensionSupported(const std::string& szExtension) const {
- return IsExtensionSupported(szExtension.c_str());
-}
-
-} // !namespace Assimp
-#endif // INCLUDED_AI_ASSIMP_HPP
diff --git a/3rdparty/assimp/revision.h b/3rdparty/assimp/revision.h
deleted file mode 100644
index d24da62f..00000000
--- a/3rdparty/assimp/revision.h
+++ /dev/null
@@ -1 +0,0 @@
-#define SVNRevision 863
diff --git a/3rdparty/lib3ds/README b/3rdparty/lib3ds/README
deleted file mode 100644
index 71722ce8..00000000
--- a/3rdparty/lib3ds/README
+++ /dev/null
@@ -1,15 +0,0 @@
-
-Lib3ds is a free toolkit for handling the "3DS" format for 3D model files.
-Its main goal is to simplify the creation of 3DS import and export filters.
-
-This project is not related in any form to Autodesk Inc. The library is
-based on unofficial information about the 3DS format found on the web.
-
-This program is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
-License for more details.
-
-The official Lib3ds Homepage can be found under:
- http://lib3ds.sourceforge.net
-
diff --git a/3rdparty/lib3ds/atmosphere.c b/3rdparty/lib3ds/atmosphere.c
deleted file mode 100644
index 3e51f9d4..00000000
--- a/3rdparty/lib3ds/atmosphere.c
+++ /dev/null
@@ -1,296 +0,0 @@
-/*
- * The 3D Studio File Format Library
- * Copyright (C) 1996-2007 by Jan Eric Kyprianidis <www.kyprianidis.com>
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id: atmosphere.c,v 1.12 2007/06/20 17:04:08 jeh Exp $
- */
-#include <lib3ds/atmosphere.h>
-#include <lib3ds/chunk.h>
-#include <lib3ds/io.h>
-
-
-/*!
- * \defgroup atmosphere Atmosphere Settings
- */
-
-
-static Lib3dsBool
-fog_read(Lib3dsFog *fog, Lib3dsIo *io)
-{
- Lib3dsChunk c;
- Lib3dsWord chunk;
-
- if (!lib3ds_chunk_read_start(&c, LIB3DS_FOG, io)) {
- return(LIB3DS_FALSE);
- }
- fog->near_plane = lib3ds_io_read_float(io);
- fog->near_density=lib3ds_io_read_float(io);
- fog->far_plane=lib3ds_io_read_float(io);
- fog->far_density=lib3ds_io_read_float(io);
- lib3ds_chunk_read_tell(&c, io);
-
- while ((chunk=lib3ds_chunk_read_next(&c, io))!=0) {
- switch (chunk) {
- case LIB3DS_LIN_COLOR_F:
- {
- int i;
- for (i=0; i<3; ++i) {
- fog->col[i]=lib3ds_io_read_float(io);
- }
- }
- break;
- case LIB3DS_COLOR_F:
- break;
- case LIB3DS_FOG_BGND:
- {
- fog->fog_background=LIB3DS_TRUE;
- }
- break;
- default:
- lib3ds_chunk_unknown(chunk);
- }
- }
-
- lib3ds_chunk_read_end(&c, io);
- return(LIB3DS_TRUE);
-}
-
-
-static Lib3dsBool
-layer_fog_read(Lib3dsLayerFog *fog, Lib3dsIo *io)
-{
- Lib3dsChunk c;
- Lib3dsWord chunk;
- Lib3dsBool have_lin=LIB3DS_FALSE;
-
- if (!lib3ds_chunk_read_start(&c, LIB3DS_LAYER_FOG, io)) {
- return(LIB3DS_FALSE);
- }
- fog->near_y=lib3ds_io_read_float(io);
- fog->far_y=lib3ds_io_read_float(io);
- fog->density=lib3ds_io_read_float(io);
- fog->flags=lib3ds_io_read_dword(io);
- lib3ds_chunk_read_tell(&c, io);
-
- while ((chunk=lib3ds_chunk_read_next(&c, io))!=0) {
- switch (chunk) {
- case LIB3DS_LIN_COLOR_F:
- lib3ds_io_read_rgb(io, fog->col);
- have_lin=LIB3DS_TRUE;
- break;
- case LIB3DS_COLOR_F:
- lib3ds_io_read_rgb(io, fog->col);
- break;
- default:
- lib3ds_chunk_unknown(chunk);
- }
- }
-
- lib3ds_chunk_read_end(&c, io);
- return(LIB3DS_TRUE);
-}
-
-
-static Lib3dsBool
-distance_cue_read(Lib3dsDistanceCue *cue, Lib3dsIo *io)
-{
- Lib3dsChunk c;
- Lib3dsWord chunk;
-
- if (!lib3ds_chunk_read_start(&c, LIB3DS_DISTANCE_CUE, io)) {
- return(LIB3DS_FALSE);
- }
- cue->near_plane=lib3ds_io_read_float(io);
- cue->near_dimming=lib3ds_io_read_float(io);
- cue->far_plane=lib3ds_io_read_float(io);
- cue->far_dimming=lib3ds_io_read_float(io);
- lib3ds_chunk_read_tell(&c, io);
-
- while ((chunk=lib3ds_chunk_read_next(&c, io))!=0) {
- switch (chunk) {
- case LIB3DS_DCUE_BGND:
- {
- cue->cue_background=LIB3DS_TRUE;
- }
- break;
- default:
- lib3ds_chunk_unknown(chunk);
- }
- }
-
- lib3ds_chunk_read_end(&c, io);
- return(LIB3DS_TRUE);
-}
-
-
-/*!
- * \ingroup atmosphere
- */
-Lib3dsBool
-lib3ds_atmosphere_read(Lib3dsAtmosphere *atmosphere, Lib3dsIo *io)
-{
- Lib3dsChunk c;
-
- if (!lib3ds_chunk_read(&c, io)) {
- return(LIB3DS_FALSE);
- }
-
- switch (c.chunk) {
- case LIB3DS_FOG:
- {
- lib3ds_chunk_read_reset(&c, io);
- if (!fog_read(&atmosphere->fog, io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_LAYER_FOG:
- {
- lib3ds_chunk_read_reset(&c, io);
- if (!layer_fog_read(&atmosphere->layer_fog, io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_DISTANCE_CUE:
- {
- lib3ds_chunk_read_reset(&c, io);
- if (!distance_cue_read(&atmosphere->dist_cue, io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_USE_FOG:
- {
- atmosphere->fog.use=LIB3DS_TRUE;
- }
- break;
- case LIB3DS_USE_LAYER_FOG:
- {
- atmosphere->fog.use=LIB3DS_TRUE;
- }
- break;
- case LIB3DS_USE_DISTANCE_CUE:
- {
- atmosphere->dist_cue.use=LIB3DS_TRUE;
- }
- break;
- }
-
- return(LIB3DS_TRUE);
-}
-
-
-/*!
- * \ingroup atmosphere
- */
-Lib3dsBool
-lib3ds_atmosphere_write(Lib3dsAtmosphere *atmosphere, Lib3dsIo *io)
-{
- if (atmosphere->fog.use) { /*---- LIB3DS_FOG ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_FOG;
- if (!lib3ds_chunk_write_start(&c,io)) {
- return(LIB3DS_FALSE);
- }
- lib3ds_io_write_float(io, atmosphere->fog.near_plane);
- lib3ds_io_write_float(io, atmosphere->fog.near_density);
- lib3ds_io_write_float(io, atmosphere->fog.far_plane);
- lib3ds_io_write_float(io, atmosphere->fog.far_density);
- {
- Lib3dsChunk c;
- c.chunk=LIB3DS_COLOR_F;
- c.size=18;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_rgb(io, atmosphere->fog.col);
- }
- if (atmosphere->fog.fog_background) {
- Lib3dsChunk c;
- c.chunk=LIB3DS_FOG_BGND;
- c.size=6;
- lib3ds_chunk_write(&c,io);
- }
- if (!lib3ds_chunk_write_end(&c,io)) {
- return(LIB3DS_FALSE);
- }
- }
-
- if (atmosphere->layer_fog.use) { /*---- LIB3DS_LAYER_FOG ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_LAYER_FOG;
- c.size=40;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_float(io, atmosphere->layer_fog.near_y);
- lib3ds_io_write_float(io, atmosphere->layer_fog.far_y);
- lib3ds_io_write_float(io, atmosphere->layer_fog.near_y);
- lib3ds_io_write_dword(io, atmosphere->layer_fog.flags);
- {
- Lib3dsChunk c;
- c.chunk=LIB3DS_COLOR_F;
- c.size=18;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_rgb(io, atmosphere->fog.col);
- }
- }
-
- if (atmosphere->dist_cue.use) { /*---- LIB3DS_DISTANCE_CUE ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_DISTANCE_CUE;
- if (!lib3ds_chunk_write_start(&c,io)) {
- return(LIB3DS_FALSE);
- }
- lib3ds_io_write_float(io, atmosphere->dist_cue.near_plane);
- lib3ds_io_write_float(io, atmosphere->dist_cue.near_dimming);
- lib3ds_io_write_float(io, atmosphere->dist_cue.far_plane);
- lib3ds_io_write_float(io, atmosphere->dist_cue.far_dimming);
- if (atmosphere->dist_cue.cue_background) {
- Lib3dsChunk c;
- c.chunk=LIB3DS_DCUE_BGND;
- c.size=6;
- lib3ds_chunk_write(&c,io);
- }
- if (!lib3ds_chunk_write_end(&c,io)) {
- return(LIB3DS_FALSE);
- }
- }
-
- if (atmosphere->fog.use) { /*---- LIB3DS_USE_FOG ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_USE_FOG;
- c.size=6;
- lib3ds_chunk_write(&c,io);
- }
-
- if (atmosphere->layer_fog.use) { /*---- LIB3DS_USE_LAYER_FOG ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_USE_LAYER_FOG;
- c.size=6;
- lib3ds_chunk_write(&c,io);
- }
-
- if (atmosphere->dist_cue.use) { /*---- LIB3DS_USE_DISTANCE_CUE ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_USE_V_GRADIENT;
- c.size=6;
- lib3ds_chunk_write(&c,io);
- }
-
- return(LIB3DS_TRUE);
-}
-
-
diff --git a/3rdparty/lib3ds/atmosphere.h b/3rdparty/lib3ds/atmosphere.h
deleted file mode 100644
index c261e7e2..00000000
--- a/3rdparty/lib3ds/atmosphere.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/* -*- c -*- */
-#ifndef INCLUDED_LIB3DS_ATMOSPHERE_H
-#define INCLUDED_LIB3DS_ATMOSPHERE_H
-/*
- * The 3D Studio File Format Library
- * Copyright (C) 1996-2007 by Jan Eric Kyprianidis <www.kyprianidis.com>
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id: atmosphere.h,v 1.8 2007/06/20 17:04:08 jeh Exp $
- */
-
-#ifndef INCLUDED_LIB3DS_TYPES_H
-#include <lib3ds/types.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * Fog atmosphere settings
- * \ingroup atmosphere
- */
-typedef struct Lib3dsFog {
- Lib3dsBool use;
- Lib3dsRgb col;
- Lib3dsBool fog_background;
- Lib3dsFloat near_plane;
- Lib3dsFloat near_density;
- Lib3dsFloat far_plane;
- Lib3dsFloat far_density;
-} Lib3dsFog;
-
-/**
- * Layer fog atmosphere flags
- * \ingroup atmosphere
- */
-typedef enum Lib3dsLayerFogFlags {
- LIB3DS_BOTTOM_FALL_OFF =0x00000001,
- LIB3DS_TOP_FALL_OFF =0x00000002,
- LIB3DS_FOG_BACKGROUND =0x00100000
-} Lib3dsLayerFogFlags;
-
-/**
- * Layer fog atmosphere settings
- * \ingroup atmosphere
- */
-typedef struct Lib3dsLayerFog {
- Lib3dsBool use;
- Lib3dsDword flags;
- Lib3dsRgb col;
- Lib3dsFloat near_y;
- Lib3dsFloat far_y;
- Lib3dsFloat density;
-} Lib3dsLayerFog;
-
-/**
- * Distance cue atmosphere settings
- * \ingroup atmosphere
- */
-typedef struct Lib3dsDistanceCue {
- Lib3dsBool use;
- Lib3dsBool cue_background;
- Lib3dsFloat near_plane;
- Lib3dsFloat near_dimming;
- Lib3dsFloat far_plane;
- Lib3dsFloat far_dimming;
-} Lib3dsDistanceCue;
-
-/**
- * Atmosphere settings
- * \ingroup atmosphere
- */
-struct Lib3dsAtmosphere {
- Lib3dsFog fog;
- Lib3dsLayerFog layer_fog;
- Lib3dsDistanceCue dist_cue;
-};
-
-extern LIB3DSAPI Lib3dsBool lib3ds_atmosphere_read(Lib3dsAtmosphere *atmosphere, Lib3dsIo *io);
-extern LIB3DSAPI Lib3dsBool lib3ds_atmosphere_write(Lib3dsAtmosphere *atmosphere, Lib3dsIo *io);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/3rdparty/lib3ds/background.c b/3rdparty/lib3ds/background.c
deleted file mode 100644
index a72c554d..00000000
--- a/3rdparty/lib3ds/background.c
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
- * The 3D Studio File Format Library
- * Copyright (C) 1996-2007 by Jan Eric Kyprianidis <www.kyprianidis.com>
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id: background.c,v 1.12 2007/06/20 17:04:08 jeh Exp $
- */
-#include <lib3ds/background.h>
-#include <lib3ds/chunk.h>
-#include <lib3ds/io.h>
-#include <string.h>
-#include <math.h>
-
-
-/*!
- * \defgroup background Background Settings
- */
-
-
-static Lib3dsBool
-solid_bgnd_read(Lib3dsBackground *background, Lib3dsIo *io)
-{
- Lib3dsChunk c;
- Lib3dsWord chunk;
- Lib3dsBool have_lin=LIB3DS_FALSE;
-
- if (!lib3ds_chunk_read_start(&c, LIB3DS_SOLID_BGND, io)) {
- return(LIB3DS_FALSE);
- }
-
- while ((chunk=lib3ds_chunk_read_next(&c, io))!=0) {
- switch (chunk) {
- case LIB3DS_LIN_COLOR_F:
- lib3ds_io_read_rgb(io, background->solid.col);
- have_lin=LIB3DS_TRUE;
- break;
- case LIB3DS_COLOR_F:
- lib3ds_io_read_rgb(io, background->solid.col);
- break;
- default:
- lib3ds_chunk_unknown(chunk);
- }
- }
-
- lib3ds_chunk_read_end(&c, io);
- return(LIB3DS_TRUE);
-}
-
-
-static Lib3dsBool
-v_gradient_read(Lib3dsBackground *background, Lib3dsIo *io)
-{
- Lib3dsChunk c;
- Lib3dsWord chunk;
- int index[2];
- Lib3dsRgb col[2][3];
- int have_lin=0;
-
-
- if (!lib3ds_chunk_read_start(&c, LIB3DS_V_GRADIENT, io)) {
- return(LIB3DS_FALSE);
- }
- background->gradient.percent=lib3ds_io_read_float(io);
- lib3ds_chunk_read_tell(&c, io);
-
- index[0]=index[1]=0;
- while ((chunk=lib3ds_chunk_read_next(&c, io))!=0) {
- switch (chunk) {
- case LIB3DS_COLOR_F:
- lib3ds_io_read_rgb(io, col[0][index[0]]);
- index[0]++;
- break;
- case LIB3DS_LIN_COLOR_F:
- lib3ds_io_read_rgb(io, col[1][index[1]]);
- index[1]++;
- have_lin=1;
- break;
- default:
- lib3ds_chunk_unknown(chunk);
- }
- }
- {
- int i;
- for (i=0; i<3; ++i) {
- background->gradient.top[i]=col[have_lin][0][i];
- background->gradient.middle[i]=col[have_lin][1][i];
- background->gradient.bottom[i]=col[have_lin][2][i];
- }
- }
- lib3ds_chunk_read_end(&c, io);
- return(LIB3DS_TRUE);
-}
-
-
-/*!
- * \ingroup background
- */
-Lib3dsBool
-lib3ds_background_read(Lib3dsBackground *background, Lib3dsIo *io)
-{
- Lib3dsChunk c;
-
- if (!lib3ds_chunk_read(&c, io)) {
- return(LIB3DS_FALSE);
- }
-
- switch (c.chunk) {
- case LIB3DS_BIT_MAP:
- {
- if (!lib3ds_io_read_string(io, background->bitmap.name, 64)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_SOLID_BGND:
- {
- lib3ds_chunk_read_reset(&c, io);
- if (!solid_bgnd_read(background, io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_V_GRADIENT:
- {
- lib3ds_chunk_read_reset(&c, io);
- if (!v_gradient_read(background, io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_USE_BIT_MAP:
- {
- background->bitmap.use=LIB3DS_TRUE;
- }
- break;
- case LIB3DS_USE_SOLID_BGND:
- {
- background->solid.use=LIB3DS_TRUE;
- }
- break;
- case LIB3DS_USE_V_GRADIENT:
- {
- background->gradient.use=LIB3DS_TRUE;
- }
- break;
- }
-
- return(LIB3DS_TRUE);
-}
-
-
-static Lib3dsBool
-colorf_write(Lib3dsRgba rgb, Lib3dsIo *io)
-{
- Lib3dsChunk c;
-
- c.chunk=LIB3DS_COLOR_F;
- c.size=18;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_rgb(io, rgb);
-
- c.chunk=LIB3DS_LIN_COLOR_F;
- c.size=18;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_rgb(io, rgb);
- return(LIB3DS_TRUE);
-}
-
-
-static Lib3dsBool
-colorf_defined(Lib3dsRgba rgb)
-{
- int i;
- for (i=0; i<3; ++i) {
- if (fabs(rgb[i])>LIB3DS_EPSILON) {
- break;
- }
- }
- return(i<3);
-}
-
-
-/*!
- * \ingroup background
- */
-Lib3dsBool
-lib3ds_background_write(Lib3dsBackground *background, Lib3dsIo *io)
-{
- if (strlen(background->bitmap.name)) { /*---- LIB3DS_BIT_MAP ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_BIT_MAP;
- c.size=6+1+(Lib3dsDword)strlen(background->bitmap.name);
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_string(io, background->bitmap.name);
- }
-
- if (colorf_defined(background->solid.col)) { /*---- LIB3DS_SOLID_BGND ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_SOLID_BGND;
- c.size=42;
- lib3ds_chunk_write(&c,io);
- colorf_write(background->solid.col, io);
- }
-
- if (colorf_defined(background->gradient.top) ||
- colorf_defined(background->gradient.middle) ||
- colorf_defined(background->gradient.bottom)) { /*---- LIB3DS_V_GRADIENT ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_V_GRADIENT;
- c.size=118;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_float(io, background->gradient.percent);
- colorf_write(background->gradient.top,io);
- colorf_write(background->gradient.middle,io);
- colorf_write(background->gradient.bottom,io);
- }
-
- if (background->bitmap.use) { /*---- LIB3DS_USE_BIT_MAP ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_USE_BIT_MAP;
- c.size=6;
- lib3ds_chunk_write(&c,io);
- }
-
- if (background->solid.use) { /*---- LIB3DS_USE_SOLID_BGND ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_USE_SOLID_BGND;
- c.size=6;
- lib3ds_chunk_write(&c,io);
- }
-
- if (background->gradient.use) { /*---- LIB3DS_USE_V_GRADIENT ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_USE_V_GRADIENT;
- c.size=6;
- lib3ds_chunk_write(&c,io);
- }
-
- return(LIB3DS_TRUE);
-}
-
diff --git a/3rdparty/lib3ds/background.h b/3rdparty/lib3ds/background.h
deleted file mode 100644
index e1083708..00000000
--- a/3rdparty/lib3ds/background.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/* -*- c -*- */
-#ifndef INCLUDED_LIB3DS_BACKGROUND_H
-#define INCLUDED_LIB3DS_BACKGROUND_H
-/*
- * The 3D Studio File Format Library
- * Copyright (C) 1996-2007 by Jan Eric Kyprianidis <www.kyprianidis.com>
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id: background.h,v 1.8 2007/06/20 17:04:08 jeh Exp $
- */
-
-#ifndef INCLUDED_LIB3DS_TYPES_H
-#include <lib3ds/types.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * Bitmap background settings
- * \ingroup background
- */
-typedef struct Lib3dsBitmap {
- Lib3dsBool use;
- char name[64];
-} Lib3dsBitmap;
-
-/**
- * Solid color background settings
- * \ingroup background
- */
-typedef struct Lib3dsSolid {
- Lib3dsBool use;
- Lib3dsRgb col;
-} Lib3dsSolid;
-
-/**
- * Gradient background settings
- * \ingroup background
- */
-typedef struct Lib3dsGradient {
- Lib3dsBool use;
- Lib3dsFloat percent;
- Lib3dsRgb top;
- Lib3dsRgb middle;
- Lib3dsRgb bottom;
-} Lib3dsGradient;
-
-/**
- * Background settings
- * \ingroup background
- */
-struct Lib3dsBackground {
- Lib3dsBitmap bitmap;
- Lib3dsSolid solid;
- Lib3dsGradient gradient;
-};
-
-extern LIB3DSAPI Lib3dsBool lib3ds_background_read(Lib3dsBackground *background, Lib3dsIo *io);
-extern LIB3DSAPI Lib3dsBool lib3ds_background_write(Lib3dsBackground *background, Lib3dsIo *io);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
-
-
-
-
-
diff --git a/3rdparty/lib3ds/camera.c b/3rdparty/lib3ds/camera.c
deleted file mode 100644
index 7bbea0f7..00000000
--- a/3rdparty/lib3ds/camera.c
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * The 3D Studio File Format Library
- * Copyright (C) 1996-2007 by Jan Eric Kyprianidis <www.kyprianidis.com>
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id: camera.c,v 1.17 2007/06/20 17:04:08 jeh Exp $
- */
-#include <lib3ds/camera.h>
-#include <lib3ds/chunk.h>
-#include <lib3ds/io.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-
-/*!
- * \defgroup camera Cameras
- */
-
-
-/*!
- * Return a new Lib3dsCamera object.
- *
- * Object is initialized with the given name and fov=45. All other
- * values are 0.
- *
- * \param name Name of this camera. Must not be NULL. Must be < 64 characters.
- *
- * \return Lib3dsCamera object or NULL on failure.
- *
- * \ingroup camera
- */
-Lib3dsCamera*
-lib3ds_camera_new(const char *name)
-{
- Lib3dsCamera *camera;
-
- ASSERT(name);
- ASSERT(strlen(name)<64);
-
- camera=(Lib3dsCamera*)calloc(sizeof(Lib3dsCamera), 1);
- if (!camera) {
- return(0);
- }
- strcpy(camera->name, name);
- camera->fov=45.0f;
- return(camera);
-}
-
-
-/*!
- * Free a Lib3dsCamera object and all of its resources.
- *
- * \param camera Lib3dsCamera object to be freed.
- *
- * \ingroup camera
- */
-void
-lib3ds_camera_free(Lib3dsCamera *camera)
-{
- memset(camera, 0, sizeof(Lib3dsCamera));
- free(camera);
-}
-
-
-/*!
- * Dump information about a Lib3dsCamera object to stdout.
- *
- * \param camera Object to be dumped.
- *
- * \see lib3ds_file_dump_cameras
- *
- * \ingroup camera
- */
-void
-lib3ds_camera_dump(Lib3dsCamera *camera)
-{
- ASSERT(camera);
- printf(" name: %s\n", camera->name);
- printf(" position: (%f, %f, %f)\n",
- camera->position[0], camera->position[1], camera->position[2]);
- printf(" target (%f, %f, %f)\n",
- camera->target[0], camera->target[1], camera->target[2]);
- printf(" roll: %f\n", camera->roll);
- printf(" fov: %f\n", camera->fov);
- printf(" see_cone: %s\n", camera->see_cone ? "yes" : "no");
- printf(" near_range: %f\n", camera->near_range);
- printf(" far_range: %f\n", camera->far_range);
- printf("\n");
-}
-
-
-/*!
- * Read a camera definition from a file.
- *
- * This function is called by lib3ds_file_read(), and you probably
- * don't want to call it directly.
- *
- * \param camera A Lib3dsCamera to be filled in.
- * \param io A Lib3dsIo object previously set up by the caller.
- *
- * \return LIB3DS_TRUE on success, LIB3DS_FALSE on failure.
- *
- * \see lib3ds_file_read
- *
- * \ingroup camera
- */
-Lib3dsBool
-lib3ds_camera_read(Lib3dsCamera *camera, Lib3dsIo *io)
-{
- Lib3dsChunk c;
- Lib3dsWord chunk;
-
- if (!lib3ds_chunk_read_start(&c, LIB3DS_N_CAMERA, io)) {
- return(LIB3DS_FALSE);
- }
- {
- int i;
- for (i=0; i<3; ++i) {
- camera->position[i]=lib3ds_io_read_float(io);
- }
- for (i=0; i<3; ++i) {
- camera->target[i]=lib3ds_io_read_float(io);
- }
- }
- camera->roll=lib3ds_io_read_float(io);
- {
- float s;
- s=lib3ds_io_read_float(io);
- if (fabs(s)<LIB3DS_EPSILON) {
- camera->fov=45.0;
- }
- else {
- camera->fov=2400.0f/s;
- }
- }
- lib3ds_chunk_read_tell(&c, io);
-
- while ((chunk=lib3ds_chunk_read_next(&c, io))!=0) {
- switch (chunk) {
- case LIB3DS_CAM_SEE_CONE:
- {
- camera->see_cone=LIB3DS_TRUE;
- }
- break;
- case LIB3DS_CAM_RANGES:
- {
- camera->near_range=lib3ds_io_read_float(io);
- camera->far_range=lib3ds_io_read_float(io);
- }
- break;
- default:
- lib3ds_chunk_unknown(chunk);
- }
- }
-
- lib3ds_chunk_read_end(&c, io);
- return(LIB3DS_TRUE);
-}
-
-
-/*!
- * Write a camera definition to a file.
- *
- * This function is called by lib3ds_file_write(), and you probably
- * don't want to call it directly.
- *
- * \param camera A Lib3dsCamera to be written.
- * \param io A Lib3dsIo object previously set up by the caller.
- *
- * \return LIB3DS_TRUE on success, LIB3DS_FALSE on failure.
- *
- * \see lib3ds_file_write
- *
- * \ingroup camera
- */
-Lib3dsBool
-lib3ds_camera_write(Lib3dsCamera *camera, Lib3dsIo *io)
-{
- Lib3dsChunk c;
-
- c.chunk=LIB3DS_N_CAMERA;
- if (!lib3ds_chunk_write_start(&c,io)) {
- return(LIB3DS_FALSE);
- }
-
- lib3ds_io_write_vector(io, camera->position);
- lib3ds_io_write_vector(io, camera->target);
- lib3ds_io_write_float(io, camera->roll);
- if (fabs(camera->fov)<LIB3DS_EPSILON) {
- lib3ds_io_write_float(io, 2400.0f/45.0f);
- }
- else {
- lib3ds_io_write_float(io, 2400.0f/camera->fov);
- }
-
- if (camera->see_cone) {
- Lib3dsChunk c;
- c.chunk=LIB3DS_CAM_SEE_CONE;
- c.size=6;
- lib3ds_chunk_write(&c, io);
- }
- {
- Lib3dsChunk c;
- c.chunk=LIB3DS_CAM_RANGES;
- c.size=14;
- lib3ds_chunk_write(&c, io);
- lib3ds_io_write_float(io, camera->near_range);
- lib3ds_io_write_float(io, camera->far_range);
- }
-
- if (!lib3ds_chunk_write_end(&c,io)) {
- return(LIB3DS_FALSE);
- }
- return(LIB3DS_TRUE);
-}
-
diff --git a/3rdparty/lib3ds/camera.h b/3rdparty/lib3ds/camera.h
deleted file mode 100644
index 2d48db80..00000000
--- a/3rdparty/lib3ds/camera.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* -*- c -*- */
-#ifndef INCLUDED_LIB3DS_CAMERA_H
-#define INCLUDED_LIB3DS_CAMERA_H
-/*
- * The 3D Studio File Format Library
- * Copyright (C) 1996-2007 by Jan Eric Kyprianidis <www.kyprianidis.com>
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id: camera.h,v 1.11 2007/06/20 17:04:08 jeh Exp $
- */
-
-#ifndef INCLUDED_LIB3DS_TYPES_H
-#include <lib3ds/types.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * Camera object
- * \ingroup camera
- */
-struct Lib3dsCamera {
- Lib3dsCamera *next;
- char name[64];
- Lib3dsDword object_flags; /*< @see Lib3dsObjectFlags */
- Lib3dsVector position;
- Lib3dsVector target;
- Lib3dsFloat roll;
- Lib3dsFloat fov;
- Lib3dsBool see_cone;
- Lib3dsFloat near_range;
- Lib3dsFloat far_range;
-};
-
-extern LIB3DSAPI Lib3dsCamera* lib3ds_camera_new(const char *name);
-extern LIB3DSAPI void lib3ds_camera_free(Lib3dsCamera *mesh);
-extern LIB3DSAPI void lib3ds_camera_dump(Lib3dsCamera *camera);
-extern LIB3DSAPI Lib3dsBool lib3ds_camera_read(Lib3dsCamera *camera, Lib3dsIo *io);
-extern LIB3DSAPI Lib3dsBool lib3ds_camera_write(Lib3dsCamera *camera, Lib3dsIo *io);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
-
diff --git a/3rdparty/lib3ds/chunk.c b/3rdparty/lib3ds/chunk.c
deleted file mode 100644
index 4a377335..00000000
--- a/3rdparty/lib3ds/chunk.c
+++ /dev/null
@@ -1,320 +0,0 @@
-/*
- * The 3D Studio File Format Library
- * Copyright (C) 1996-2007 by Jan Eric Kyprianidis <www.kyprianidis.com>
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id: chunk.c,v 1.18 2007/06/20 17:04:08 jeh Exp $
- */
-#include <lib3ds/chunk.h>
-#include <lib3ds/io.h>
-#include <lib3ds/chunktable.h>
-#include <string.h>
-#include <stdarg.h>
-
-
-/*#define LIB3DS_CHUNK_DEBUG*/
-/*#define LIB3DS_CHUNK_WARNING*/
-
-
-/*!
- * \defgroup chunk Chunk Handling
- */
-
-
-static Lib3dsBool enable_dump=LIB3DS_FALSE;
-static Lib3dsBool enable_unknown=LIB3DS_FALSE;
-static char lib3ds_chunk_level[128]="";
-
-
-static void
-lib3ds_chunk_debug_enter(Lib3dsChunk *c)
-{
- LIB3DS_UNUSED(c);
- strcat(lib3ds_chunk_level, " ");
-}
-
-
-static void
-lib3ds_chunk_debug_leave(Lib3dsChunk *c)
-{
- LIB3DS_UNUSED(c);
- lib3ds_chunk_level[strlen(lib3ds_chunk_level)-2]=0;
-}
-
-
-static void
-lib3ds_chunk_debug_dump(Lib3dsChunk *c)
-{
- if (enable_dump) {
- printf("%s%s (0x%X) size=%lu\n",
- lib3ds_chunk_level,
- lib3ds_chunk_name(c->chunk),
- c->chunk,
- (unsigned long)(c->size)
- );
- }
-}
-
-
-/*!
- * \ingroup chunk
- */
-void
-lib3ds_chunk_enable_dump(Lib3dsBool enable, Lib3dsBool unknown)
-{
- enable_dump=enable;
- enable_unknown=unknown;
-}
-
-
-/*!
- * \ingroup chunk
- *
- * Reads a 3d-Studio chunk header from a little endian file stream.
- *
- * \param c The chunk to store the data.
- * \param io The file stream.
- *
- * \return True on success, False otherwise.
- */
-Lib3dsBool
-lib3ds_chunk_read(Lib3dsChunk *c, Lib3dsIo *io)
-{
- ASSERT(c);
- ASSERT(io);
- c->cur=lib3ds_io_tell(io);
- c->chunk=lib3ds_io_read_word(io);
- c->size=lib3ds_io_read_dword(io);
- c->end=c->cur+c->size;
- c->cur+=6;
- if (lib3ds_io_error(io) || (c->size<6)) {
- return(LIB3DS_FALSE);
- }
- return(LIB3DS_TRUE);
-
-}
-
-
-/*!
- * \ingroup chunk
- */
-Lib3dsBool
-lib3ds_chunk_read_start(Lib3dsChunk *c, Lib3dsWord chunk, Lib3dsIo *io)
-{
- ASSERT(c);
- ASSERT(io);
- if (!lib3ds_chunk_read(c, io)) {
- return(LIB3DS_FALSE);
- }
- lib3ds_chunk_debug_enter(c);
- return((chunk==0) || (c->chunk==chunk));
-}
-
-
-/*!
- * \ingroup chunk
- */
-void
-lib3ds_chunk_read_tell(Lib3dsChunk *c, Lib3dsIo *io)
-{
- c->cur=lib3ds_io_tell(io);
-}
-
-
-/*!
- * \ingroup chunk
- */
-Lib3dsWord
-lib3ds_chunk_read_next(Lib3dsChunk *c, Lib3dsIo *io)
-{
- Lib3dsChunk d;
-
- if (c->cur>=c->end) {
- ASSERT(c->cur==c->end);
- return(0);
- }
-
- lib3ds_io_seek(io, (long)c->cur, LIB3DS_SEEK_SET);
- d.chunk=lib3ds_io_read_word(io);
- d.size=lib3ds_io_read_dword(io);
- lib3ds_chunk_debug_dump(&d);
- c->cur+=d.size;
- return(d.chunk);
-}
-
-
-/*!
- * \ingroup chunk
- */
-void
-lib3ds_chunk_read_reset(Lib3dsChunk *c, Lib3dsIo *io)
-{
- LIB3DS_UNUSED(c);
- lib3ds_io_seek(io, -6, LIB3DS_SEEK_CUR);
-}
-
-
-/*!
- * \ingroup chunk
- */
-void
-lib3ds_chunk_read_end(Lib3dsChunk *c, Lib3dsIo *io)
-{
- lib3ds_chunk_debug_leave(c);
- lib3ds_io_seek(io, c->end, LIB3DS_SEEK_SET);
-}
-
-
-/*!
- * \ingroup chunk
- *
- * Writes a 3d-Studio chunk header into a little endian file stream.
- *
- * \param c The chunk to be written.
- * \param io The file stream.
- *
- * \return True on success, False otherwise.
- */
-Lib3dsBool
-lib3ds_chunk_write(Lib3dsChunk *c, Lib3dsIo *io)
-{
- ASSERT(c);
- if (!lib3ds_io_write_word(io, c->chunk)) {
- LIB3DS_ERROR_LOG;
- return(LIB3DS_FALSE);
- }
- if (!lib3ds_io_write_dword(io, c->size)) {
- LIB3DS_ERROR_LOG;
- return(LIB3DS_FALSE);
- }
- return(LIB3DS_TRUE);
-}
-
-
-/*!
- * \ingroup chunk
- */
-Lib3dsBool
-lib3ds_chunk_write_start(Lib3dsChunk *c, Lib3dsIo *io)
-{
- ASSERT(c);
- c->size=0;
- c->cur=lib3ds_io_tell(io);
- if (!lib3ds_io_write_word(io, c->chunk)) {
- return(LIB3DS_FALSE);
- }
- if (!lib3ds_io_write_dword(io, c->size)) {
- return(LIB3DS_FALSE);
- }
- return(LIB3DS_TRUE);
-}
-
-
-/*!
- * \ingroup chunk
- */
-Lib3dsBool
-lib3ds_chunk_write_end(Lib3dsChunk *c, Lib3dsIo *io)
-{
- ASSERT(c);
- c->size=lib3ds_io_tell(io) - c->cur;
- lib3ds_io_seek(io, c->cur+2, LIB3DS_SEEK_SET);
- if (!lib3ds_io_write_dword(io, c->size)) {
- LIB3DS_ERROR_LOG;
- return(LIB3DS_FALSE);
- }
-
- c->cur+=c->size;
- lib3ds_io_seek(io, c->cur, LIB3DS_SEEK_SET);
- if (lib3ds_io_error(io)) {
- LIB3DS_ERROR_LOG;
- return(LIB3DS_FALSE);
- }
- return(LIB3DS_TRUE);
-}
-
-
-/*!
-* \ingroup chunk
-*/
-Lib3dsBool
-lib3ds_chunk_write_switch(Lib3dsWord chunk, Lib3dsIo *io)
-{
- Lib3dsChunk c;
- c.chunk=chunk;
- c.size=6;
- return lib3ds_chunk_write(&c,io);
-}
-
-
-/*!
- * \ingroup chunk
- */
-const char*
-lib3ds_chunk_name(Lib3dsWord chunk)
-{
- Lib3dsChunkTable *p;
-
- for (p=lib3ds_chunk_table; p->name!=0; ++p) {
- if (p->chunk==chunk) {
- return(p->name);
- }
- }
- return("***UNKNOWN***");
-}
-
-
-/*!
- * \ingroup chunk
- */
-void
-lib3ds_chunk_unknown(Lib3dsWord chunk)
-{
- if (enable_unknown) {
- printf("%s***WARNING*** Unknown Chunk: %s (0x%X)\n",
- lib3ds_chunk_level,
- lib3ds_chunk_name(chunk),
- chunk
- );
- }
-}
-
-
-/*!
- * \ingroup chunk
- */
-void
-lib3ds_chunk_dump_info(const char *format, ...)
-{
- if (enable_dump) {
- char s[1024];
- va_list marker;
-
- va_start(marker, format);
- vsprintf(s, format, marker);
- va_end(marker);
-
- printf("%s%s\n", lib3ds_chunk_level, s);
- }
-}
-
-
-
-
-
-
-
diff --git a/3rdparty/lib3ds/chunk.h b/3rdparty/lib3ds/chunk.h
deleted file mode 100644
index 4cbda1b8..00000000
--- a/3rdparty/lib3ds/chunk.h
+++ /dev/null
@@ -1,290 +0,0 @@
-/* -*- c -*- */
-#ifndef INCLUDED_LIB3DS_CHUNK_H
-#define INCLUDED_LIB3DS_CHUNK_H
-/*
- * The 3D Studio File Format Library
- * Copyright (C) 1996-2007 by Jan Eric Kyprianidis <www.kyprianidis.com>
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id: chunk.h,v 1.16 2007/06/20 17:04:08 jeh Exp $
- */
-
-#ifndef INCLUDED_LIB3DS_TYPES_H
-#include <lib3ds/types.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef enum _Lib3dsChunks {
- LIB3DS_NULL_CHUNK =0x0000,
- LIB3DS_M3DMAGIC =0x4D4D, /*3DS file*/
- LIB3DS_SMAGIC =0x2D2D,
- LIB3DS_LMAGIC =0x2D3D,
- LIB3DS_MLIBMAGIC =0x3DAA, /*MLI file*/
- LIB3DS_MATMAGIC =0x3DFF,
- LIB3DS_CMAGIC =0xC23D, /*PRJ file*/
- LIB3DS_M3D_VERSION =0x0002,
- LIB3DS_M3D_KFVERSION =0x0005,
-
- LIB3DS_COLOR_F =0x0010,
- LIB3DS_COLOR_24 =0x0011,
- LIB3DS_LIN_COLOR_24 =0x0012,
- LIB3DS_LIN_COLOR_F =0x0013,
- LIB3DS_INT_PERCENTAGE =0x0030,
- LIB3DS_FLOAT_PERCENTAGE =0x0031,
-
- LIB3DS_MDATA =0x3D3D,
- LIB3DS_MESH_VERSION =0x3D3E,
- LIB3DS_MASTER_SCALE =0x0100,
- LIB3DS_LO_SHADOW_BIAS =0x1400,
- LIB3DS_HI_SHADOW_BIAS =0x1410,
- LIB3DS_SHADOW_MAP_SIZE =0x1420,
- LIB3DS_SHADOW_SAMPLES =0x1430,
- LIB3DS_SHADOW_RANGE =0x1440,
- LIB3DS_SHADOW_FILTER =0x1450,
- LIB3DS_RAY_BIAS =0x1460,
- LIB3DS_O_CONSTS =0x1500,
- LIB3DS_AMBIENT_LIGHT =0x2100,
- LIB3DS_BIT_MAP =0x1100,
- LIB3DS_SOLID_BGND =0x1200,
- LIB3DS_V_GRADIENT =0x1300,
- LIB3DS_USE_BIT_MAP =0x1101,
- LIB3DS_USE_SOLID_BGND =0x1201,
- LIB3DS_USE_V_GRADIENT =0x1301,
- LIB3DS_FOG =0x2200,
- LIB3DS_FOG_BGND =0x2210,
- LIB3DS_LAYER_FOG =0x2302,
- LIB3DS_DISTANCE_CUE =0x2300,
- LIB3DS_DCUE_BGND =0x2310,
- LIB3DS_USE_FOG =0x2201,
- LIB3DS_USE_LAYER_FOG =0x2303,
- LIB3DS_USE_DISTANCE_CUE =0x2301,
-
- LIB3DS_MAT_ENTRY =0xAFFF,
- LIB3DS_MAT_NAME =0xA000,
- LIB3DS_MAT_AMBIENT =0xA010,
- LIB3DS_MAT_DIFFUSE =0xA020,
- LIB3DS_MAT_SPECULAR =0xA030,
- LIB3DS_MAT_SHININESS =0xA040,
- LIB3DS_MAT_SHIN2PCT =0xA041,
- LIB3DS_MAT_TRANSPARENCY =0xA050,
- LIB3DS_MAT_XPFALL =0xA052,
- LIB3DS_MAT_USE_XPFALL =0xA240,
- LIB3DS_MAT_REFBLUR =0xA053,
- LIB3DS_MAT_SHADING =0xA100,
- LIB3DS_MAT_USE_REFBLUR =0xA250,
- LIB3DS_MAT_SELF_ILLUM =0xA080,
- LIB3DS_MAT_TWO_SIDE =0xA081,
- LIB3DS_MAT_DECAL =0xA082,
- LIB3DS_MAT_ADDITIVE =0xA083,
- LIB3DS_MAT_SELF_ILPCT =0xA084,
- LIB3DS_MAT_WIRE =0xA085,
- LIB3DS_MAT_FACEMAP =0xA088,
- LIB3DS_MAT_PHONGSOFT =0xA08C,
- LIB3DS_MAT_WIREABS =0xA08E,
- LIB3DS_MAT_WIRE_SIZE =0xA087,
- LIB3DS_MAT_TEXMAP =0xA200,
- LIB3DS_MAT_SXP_TEXT_DATA =0xA320,
- LIB3DS_MAT_TEXMASK =0xA33E,
- LIB3DS_MAT_SXP_TEXTMASK_DATA =0xA32A,
- LIB3DS_MAT_TEX2MAP =0xA33A,
- LIB3DS_MAT_SXP_TEXT2_DATA =0xA321,
- LIB3DS_MAT_TEX2MASK =0xA340,
- LIB3DS_MAT_SXP_TEXT2MASK_DATA =0xA32C,
- LIB3DS_MAT_OPACMAP =0xA210,
- LIB3DS_MAT_SXP_OPAC_DATA =0xA322,
- LIB3DS_MAT_OPACMASK =0xA342,
- LIB3DS_MAT_SXP_OPACMASK_DATA =0xA32E,
- LIB3DS_MAT_BUMPMAP =0xA230,
- LIB3DS_MAT_SXP_BUMP_DATA =0xA324,
- LIB3DS_MAT_BUMPMASK =0xA344,
- LIB3DS_MAT_SXP_BUMPMASK_DATA =0xA330,
- LIB3DS_MAT_SPECMAP =0xA204,
- LIB3DS_MAT_SXP_SPEC_DATA =0xA325,
- LIB3DS_MAT_SPECMASK =0xA348,
- LIB3DS_MAT_SXP_SPECMASK_DATA =0xA332,
- LIB3DS_MAT_SHINMAP =0xA33C,
- LIB3DS_MAT_SXP_SHIN_DATA =0xA326,
- LIB3DS_MAT_SHINMASK =0xA346,
- LIB3DS_MAT_SXP_SHINMASK_DATA =0xA334,
- LIB3DS_MAT_SELFIMAP =0xA33D,
- LIB3DS_MAT_SXP_SELFI_DATA =0xA328,
- LIB3DS_MAT_SELFIMASK =0xA34A,
- LIB3DS_MAT_SXP_SELFIMASK_DATA =0xA336,
- LIB3DS_MAT_REFLMAP =0xA220,
- LIB3DS_MAT_REFLMASK =0xA34C,
- LIB3DS_MAT_SXP_REFLMASK_DATA =0xA338,
- LIB3DS_MAT_ACUBIC =0xA310,
- LIB3DS_MAT_MAPNAME =0xA300,
- LIB3DS_MAT_MAP_TILING =0xA351,
- LIB3DS_MAT_MAP_TEXBLUR =0xA353,
- LIB3DS_MAT_MAP_USCALE =0xA354,
- LIB3DS_MAT_MAP_VSCALE =0xA356,
- LIB3DS_MAT_MAP_UOFFSET =0xA358,
- LIB3DS_MAT_MAP_VOFFSET =0xA35A,
- LIB3DS_MAT_MAP_ANG =0xA35C,
- LIB3DS_MAT_MAP_COL1 =0xA360,
- LIB3DS_MAT_MAP_COL2 =0xA362,
- LIB3DS_MAT_MAP_RCOL =0xA364,
- LIB3DS_MAT_MAP_GCOL =0xA366,
- LIB3DS_MAT_MAP_BCOL =0xA368,
-
- LIB3DS_NAMED_OBJECT =0x4000,
- LIB3DS_N_DIRECT_LIGHT =0x4600,
- LIB3DS_DL_OFF =0x4620,
- LIB3DS_DL_OUTER_RANGE =0x465A,
- LIB3DS_DL_INNER_RANGE =0x4659,
- LIB3DS_DL_MULTIPLIER =0x465B,
- LIB3DS_DL_EXCLUDE =0x4654,
- LIB3DS_DL_ATTENUATE =0x4625,
- LIB3DS_DL_SPOTLIGHT =0x4610,
- LIB3DS_DL_SPOT_ROLL =0x4656,
- LIB3DS_DL_SHADOWED =0x4630,
- LIB3DS_DL_LOCAL_SHADOW2 =0x4641,
- LIB3DS_DL_SEE_CONE =0x4650,
- LIB3DS_DL_SPOT_RECTANGULAR =0x4651,
- LIB3DS_DL_SPOT_ASPECT =0x4657,
- LIB3DS_DL_SPOT_PROJECTOR =0x4653,
- LIB3DS_DL_SPOT_OVERSHOOT =0x4652,
- LIB3DS_DL_RAY_BIAS =0x4658,
- LIB3DS_DL_RAYSHAD =0x4627,
- LIB3DS_N_CAMERA =0x4700,
- LIB3DS_CAM_SEE_CONE =0x4710,
- LIB3DS_CAM_RANGES =0x4720,
- LIB3DS_OBJ_HIDDEN =0x4010,
- LIB3DS_OBJ_VIS_LOFTER =0x4011,
- LIB3DS_OBJ_DOESNT_CAST =0x4012,
- LIB3DS_OBJ_DONT_RCVSHADOW =0x4017,
- LIB3DS_OBJ_MATTE =0x4013,
- LIB3DS_OBJ_FAST =0x4014,
- LIB3DS_OBJ_PROCEDURAL =0x4015,
- LIB3DS_OBJ_FROZEN =0x4016,
- LIB3DS_N_TRI_OBJECT =0x4100,
- LIB3DS_POINT_ARRAY =0x4110,
- LIB3DS_POINT_FLAG_ARRAY =0x4111,
- LIB3DS_FACE_ARRAY =0x4120,
- LIB3DS_MSH_MAT_GROUP =0x4130,
- LIB3DS_SMOOTH_GROUP =0x4150,
- LIB3DS_MSH_BOXMAP =0x4190,
- LIB3DS_TEX_VERTS =0x4140,
- LIB3DS_MESH_MATRIX =0x4160,
- LIB3DS_MESH_COLOR =0x4165,
- LIB3DS_MESH_TEXTURE_INFO =0x4170,
-
- LIB3DS_KFDATA =0xB000,
- LIB3DS_KFHDR =0xB00A,
- LIB3DS_KFSEG =0xB008,
- LIB3DS_KFCURTIME =0xB009,
- LIB3DS_AMBIENT_NODE_TAG =0xB001,
- LIB3DS_OBJECT_NODE_TAG =0xB002,
- LIB3DS_CAMERA_NODE_TAG =0xB003,
- LIB3DS_TARGET_NODE_TAG =0xB004,
- LIB3DS_LIGHT_NODE_TAG =0xB005,
- LIB3DS_L_TARGET_NODE_TAG =0xB006,
- LIB3DS_SPOTLIGHT_NODE_TAG =0xB007,
- LIB3DS_NODE_ID =0xB030,
- LIB3DS_NODE_HDR =0xB010,
- LIB3DS_PIVOT =0xB013,
- LIB3DS_INSTANCE_NAME =0xB011,
- LIB3DS_MORPH_SMOOTH =0xB015,
- LIB3DS_BOUNDBOX =0xB014,
- LIB3DS_POS_TRACK_TAG =0xB020,
- LIB3DS_COL_TRACK_TAG =0xB025,
- LIB3DS_ROT_TRACK_TAG =0xB021,
- LIB3DS_SCL_TRACK_TAG =0xB022,
- LIB3DS_MORPH_TRACK_TAG =0xB026,
- LIB3DS_FOV_TRACK_TAG =0xB023,
- LIB3DS_ROLL_TRACK_TAG =0xB024,
- LIB3DS_HOT_TRACK_TAG =0xB027,
- LIB3DS_FALL_TRACK_TAG =0xB028,
- LIB3DS_HIDE_TRACK_TAG =0xB029,
-
- LIB3DS_POLY_2D = 0x5000,
- LIB3DS_SHAPE_OK = 0x5010,
- LIB3DS_SHAPE_NOT_OK = 0x5011,
- LIB3DS_SHAPE_HOOK = 0x5020,
- LIB3DS_PATH_3D = 0x6000,
- LIB3DS_PATH_MATRIX = 0x6005,
- LIB3DS_SHAPE_2D = 0x6010,
- LIB3DS_M_SCALE = 0x6020,
- LIB3DS_M_TWIST = 0x6030,
- LIB3DS_M_TEETER = 0x6040,
- LIB3DS_M_FIT = 0x6050,
- LIB3DS_M_BEVEL = 0x6060,
- LIB3DS_XZ_CURVE = 0x6070,
- LIB3DS_YZ_CURVE = 0x6080,
- LIB3DS_INTERPCT = 0x6090,
- LIB3DS_DEFORM_LIMIT = 0x60A0,
-
- LIB3DS_USE_CONTOUR = 0x6100,
- LIB3DS_USE_TWEEN = 0x6110,
- LIB3DS_USE_SCALE = 0x6120,
- LIB3DS_USE_TWIST = 0x6130,
- LIB3DS_USE_TEETER = 0x6140,
- LIB3DS_USE_FIT = 0x6150,
- LIB3DS_USE_BEVEL = 0x6160,
-
- LIB3DS_DEFAULT_VIEW = 0x3000,
- LIB3DS_VIEW_TOP = 0x3010,
- LIB3DS_VIEW_BOTTOM = 0x3020,
- LIB3DS_VIEW_LEFT = 0x3030,
- LIB3DS_VIEW_RIGHT = 0x3040,
- LIB3DS_VIEW_FRONT = 0x3050,
- LIB3DS_VIEW_BACK = 0x3060,
- LIB3DS_VIEW_USER = 0x3070,
- LIB3DS_VIEW_CAMERA = 0x3080,
- LIB3DS_VIEW_WINDOW = 0x3090,
-
- LIB3DS_VIEWPORT_LAYOUT_OLD = 0x7000,
- LIB3DS_VIEWPORT_DATA_OLD = 0x7010,
- LIB3DS_VIEWPORT_LAYOUT = 0x7001,
- LIB3DS_VIEWPORT_DATA = 0x7011,
- LIB3DS_VIEWPORT_DATA_3 = 0x7012,
- LIB3DS_VIEWPORT_SIZE = 0x7020,
- LIB3DS_NETWORK_VIEW = 0x7030
-} Lib3dsChunks;
-
-typedef struct Lib3dsChunk {
- Lib3dsWord chunk;
- Lib3dsDword size;
- Lib3dsDword end;
- Lib3dsDword cur;
-} Lib3dsChunk;
-
-extern LIB3DSAPI void lib3ds_chunk_enable_dump(Lib3dsBool enable, Lib3dsBool unknown);
-extern LIB3DSAPI Lib3dsBool lib3ds_chunk_read(Lib3dsChunk *c, Lib3dsIo *io);
-extern LIB3DSAPI Lib3dsBool lib3ds_chunk_read_start(Lib3dsChunk *c, Lib3dsWord chunk, Lib3dsIo *io);
-extern LIB3DSAPI void lib3ds_chunk_read_tell(Lib3dsChunk *c, Lib3dsIo *io);
-extern LIB3DSAPI Lib3dsWord lib3ds_chunk_read_next(Lib3dsChunk *c, Lib3dsIo *io);
-extern LIB3DSAPI void lib3ds_chunk_read_reset(Lib3dsChunk *c, Lib3dsIo *io);
-extern LIB3DSAPI void lib3ds_chunk_read_end(Lib3dsChunk *c, Lib3dsIo *io);
-extern LIB3DSAPI Lib3dsBool lib3ds_chunk_write(Lib3dsChunk *c, Lib3dsIo *io);
-extern LIB3DSAPI Lib3dsBool lib3ds_chunk_write_start(Lib3dsChunk *c, Lib3dsIo *io);
-extern LIB3DSAPI Lib3dsBool lib3ds_chunk_write_end(Lib3dsChunk *c, Lib3dsIo *io);
-extern LIB3DSAPI Lib3dsBool lib3ds_chunk_write_switch(Lib3dsWord chunk, Lib3dsIo *io);
-extern LIB3DSAPI const char* lib3ds_chunk_name(Lib3dsWord chunk);
-extern LIB3DSAPI void lib3ds_chunk_unknown(Lib3dsWord chunk);
-extern LIB3DSAPI void lib3ds_chunk_dump_info(const char *format, ...);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
-
-
diff --git a/3rdparty/lib3ds/chunktable.h b/3rdparty/lib3ds/chunktable.h
deleted file mode 100644
index 2b50c021..00000000
--- a/3rdparty/lib3ds/chunktable.h
+++ /dev/null
@@ -1,264 +0,0 @@
-/* -*- c -*- */
-#ifndef INCLUDED_LIB3DS_CHUNKTABLE_H
-#define INCLUDED_LIB3DS_CHUNKTABLE_H
-/*
- * The 3D Studio File Format Library
- * Copyright (C) 1996-2007 by Jan Eric Kyprianidis <www.kyprianidis.com>
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id: chunktable.h,v 1.16 2007/06/20 17:04:08 jeh Exp $
- */
-
-#ifndef INCLUDED_LIB3DS_CHUNK_H
-#include <lib3ds/chunk.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct Lib3dsChunkTable {
- Lib3dsDword chunk;
- const char* name;
-} Lib3dsChunkTable;
-
-static Lib3dsChunkTable lib3ds_chunk_table[]={
- {LIB3DS_NULL_CHUNK, "LIB3DS_NULL_CHUNK"},
- {LIB3DS_M3DMAGIC, "LIB3DS_M3DMAGIC"},
- {LIB3DS_SMAGIC, "LIB3DS_SMAGIC"},
- {LIB3DS_LMAGIC, "LIB3DS_LMAGIC"},
- {LIB3DS_MLIBMAGIC, "LIB3DS_MLIBMAGIC"},
- {LIB3DS_MATMAGIC, "LIB3DS_MATMAGIC"},
- {LIB3DS_CMAGIC, "LIB3DS_CMAGIC"},
- {LIB3DS_M3D_VERSION, "LIB3DS_M3D_VERSION"},
- {LIB3DS_M3D_KFVERSION, "LIB3DS_M3D_KFVERSION"},
- {LIB3DS_COLOR_F, "LIB3DS_COLOR_F"},
- {LIB3DS_COLOR_24, "LIB3DS_COLOR_24"},
- {LIB3DS_LIN_COLOR_24, "LIB3DS_LIN_COLOR_24"},
- {LIB3DS_LIN_COLOR_F, "LIB3DS_LIN_COLOR_F"},
- {LIB3DS_INT_PERCENTAGE, "LIB3DS_INT_PERCENTAGE"},
- {LIB3DS_FLOAT_PERCENTAGE, "LIB3DS_FLOAT_PERCENTAGE"},
- {LIB3DS_MDATA, "LIB3DS_MDATA"},
- {LIB3DS_MESH_VERSION, "LIB3DS_MESH_VERSION"},
- {LIB3DS_MASTER_SCALE, "LIB3DS_MASTER_SCALE"},
- {LIB3DS_LO_SHADOW_BIAS, "LIB3DS_LO_SHADOW_BIAS"},
- {LIB3DS_HI_SHADOW_BIAS, "LIB3DS_HI_SHADOW_BIAS"},
- {LIB3DS_SHADOW_MAP_SIZE, "LIB3DS_SHADOW_MAP_SIZE"},
- {LIB3DS_SHADOW_SAMPLES, "LIB3DS_SHADOW_SAMPLES"},
- {LIB3DS_SHADOW_RANGE, "LIB3DS_SHADOW_RANGE"},
- {LIB3DS_SHADOW_FILTER, "LIB3DS_SHADOW_FILTER"},
- {LIB3DS_RAY_BIAS, "LIB3DS_RAY_BIAS"},
- {LIB3DS_O_CONSTS, "LIB3DS_O_CONSTS"},
- {LIB3DS_AMBIENT_LIGHT, "LIB3DS_AMBIENT_LIGHT"},
- {LIB3DS_BIT_MAP, "LIB3DS_BIT_MAP"},
- {LIB3DS_SOLID_BGND, "LIB3DS_SOLID_BGND"},
- {LIB3DS_V_GRADIENT, "LIB3DS_V_GRADIENT"},
- {LIB3DS_USE_BIT_MAP, "LIB3DS_USE_BIT_MAP"},
- {LIB3DS_USE_SOLID_BGND, "LIB3DS_USE_SOLID_BGND"},
- {LIB3DS_USE_V_GRADIENT, "LIB3DS_USE_V_GRADIENT"},
- {LIB3DS_FOG, "LIB3DS_FOG"},
- {LIB3DS_FOG_BGND, "LIB3DS_FOG_BGND"},
- {LIB3DS_LAYER_FOG, "LIB3DS_LAYER_FOG"},
- {LIB3DS_DISTANCE_CUE, "LIB3DS_DISTANCE_CUE"},
- {LIB3DS_DCUE_BGND, "LIB3DS_DCUE_BGND"},
- {LIB3DS_USE_FOG, "LIB3DS_USE_FOG"},
- {LIB3DS_USE_LAYER_FOG, "LIB3DS_USE_LAYER_FOG"},
- {LIB3DS_USE_DISTANCE_CUE, "LIB3DS_USE_DISTANCE_CUE"},
- {LIB3DS_MAT_ENTRY, "LIB3DS_MAT_ENTRY"},
- {LIB3DS_MAT_NAME, "LIB3DS_MAT_NAME"},
- {LIB3DS_MAT_AMBIENT, "LIB3DS_MAT_AMBIENT"},
- {LIB3DS_MAT_DIFFUSE, "LIB3DS_MAT_DIFFUSE"},
- {LIB3DS_MAT_SPECULAR, "LIB3DS_MAT_SPECULAR"},
- {LIB3DS_MAT_SHININESS, "LIB3DS_MAT_SHININESS"},
- {LIB3DS_MAT_SHIN2PCT, "LIB3DS_MAT_SHIN2PCT"},
- {LIB3DS_MAT_TRANSPARENCY, "LIB3DS_MAT_TRANSPARENCY"},
- {LIB3DS_MAT_XPFALL, "LIB3DS_MAT_XPFALL"},
- {LIB3DS_MAT_USE_XPFALL, "LIB3DS_MAT_USE_XPFALL"},
- {LIB3DS_MAT_REFBLUR, "LIB3DS_MAT_REFBLUR"},
- {LIB3DS_MAT_SHADING, "LIB3DS_MAT_SHADING"},
- {LIB3DS_MAT_USE_REFBLUR, "LIB3DS_MAT_USE_REFBLUR"},
- {LIB3DS_MAT_SELF_ILLUM, "LIB3DS_MAT_SELF_ILLUM"},
- {LIB3DS_MAT_TWO_SIDE, "LIB3DS_MAT_TWO_SIDE"},
- {LIB3DS_MAT_DECAL, "LIB3DS_MAT_DECAL"},
- {LIB3DS_MAT_ADDITIVE, "LIB3DS_MAT_ADDITIVE"},
- {LIB3DS_MAT_SELF_ILPCT, "LIB3DS_MAT_SELF_ILPCT"},
- {LIB3DS_MAT_WIRE, "LIB3DS_MAT_WIRE"},
- {LIB3DS_MAT_FACEMAP, "LIB3DS_MAT_FACEMAP"},
- {LIB3DS_MAT_PHONGSOFT, "LIB3DS_MAT_PHONGSOFT"},
- {LIB3DS_MAT_WIREABS, "LIB3DS_MAT_WIREABS"},
- {LIB3DS_MAT_WIRE_SIZE, "LIB3DS_MAT_WIRE_SIZE"},
- {LIB3DS_MAT_TEXMAP, "LIB3DS_MAT_TEXMAP"},
- {LIB3DS_MAT_SXP_TEXT_DATA, "LIB3DS_MAT_SXP_TEXT_DATA"},
- {LIB3DS_MAT_TEXMASK, "LIB3DS_MAT_TEXMASK"},
- {LIB3DS_MAT_SXP_TEXTMASK_DATA, "LIB3DS_MAT_SXP_TEXTMASK_DATA"},
- {LIB3DS_MAT_TEX2MAP, "LIB3DS_MAT_TEX2MAP"},
- {LIB3DS_MAT_SXP_TEXT2_DATA, "LIB3DS_MAT_SXP_TEXT2_DATA"},
- {LIB3DS_MAT_TEX2MASK, "LIB3DS_MAT_TEX2MASK"},
- {LIB3DS_MAT_SXP_TEXT2MASK_DATA, "LIB3DS_MAT_SXP_TEXT2MASK_DATA"},
- {LIB3DS_MAT_OPACMAP, "LIB3DS_MAT_OPACMAP"},
- {LIB3DS_MAT_SXP_OPAC_DATA, "LIB3DS_MAT_SXP_OPAC_DATA"},
- {LIB3DS_MAT_OPACMASK, "LIB3DS_MAT_OPACMASK"},
- {LIB3DS_MAT_SXP_OPACMASK_DATA, "LIB3DS_MAT_SXP_OPACMASK_DATA"},
- {LIB3DS_MAT_BUMPMAP, "LIB3DS_MAT_BUMPMAP"},
- {LIB3DS_MAT_SXP_BUMP_DATA, "LIB3DS_MAT_SXP_BUMP_DATA"},
- {LIB3DS_MAT_BUMPMASK, "LIB3DS_MAT_BUMPMASK"},
- {LIB3DS_MAT_SXP_BUMPMASK_DATA, "LIB3DS_MAT_SXP_BUMPMASK_DATA"},
- {LIB3DS_MAT_SPECMAP, "LIB3DS_MAT_SPECMAP"},
- {LIB3DS_MAT_SXP_SPEC_DATA, "LIB3DS_MAT_SXP_SPEC_DATA"},
- {LIB3DS_MAT_SPECMASK, "LIB3DS_MAT_SPECMASK"},
- {LIB3DS_MAT_SXP_SPECMASK_DATA, "LIB3DS_MAT_SXP_SPECMASK_DATA"},
- {LIB3DS_MAT_SHINMAP, "LIB3DS_MAT_SHINMAP"},
- {LIB3DS_MAT_SXP_SHIN_DATA, "LIB3DS_MAT_SXP_SHIN_DATA"},
- {LIB3DS_MAT_SHINMASK, "LIB3DS_MAT_SHINMASK"},
- {LIB3DS_MAT_SXP_SHINMASK_DATA, "LIB3DS_MAT_SXP_SHINMASK_DATA"},
- {LIB3DS_MAT_SELFIMAP, "LIB3DS_MAT_SELFIMAP"},
- {LIB3DS_MAT_SXP_SELFI_DATA, "LIB3DS_MAT_SXP_SELFI_DATA"},
- {LIB3DS_MAT_SELFIMASK, "LIB3DS_MAT_SELFIMASK"},
- {LIB3DS_MAT_SXP_SELFIMASK_DATA, "LIB3DS_MAT_SXP_SELFIMASK_DATA"},
- {LIB3DS_MAT_REFLMAP, "LIB3DS_MAT_REFLMAP"},
- {LIB3DS_MAT_REFLMASK, "LIB3DS_MAT_REFLMASK"},
- {LIB3DS_MAT_SXP_REFLMASK_DATA, "LIB3DS_MAT_SXP_REFLMASK_DATA"},
- {LIB3DS_MAT_ACUBIC, "LIB3DS_MAT_ACUBIC"},
- {LIB3DS_MAT_MAPNAME, "LIB3DS_MAT_MAPNAME"},
- {LIB3DS_MAT_MAP_TILING, "LIB3DS_MAT_MAP_TILING"},
- {LIB3DS_MAT_MAP_TEXBLUR, "LIB3DS_MAT_MAP_TEXBLUR"},
- {LIB3DS_MAT_MAP_USCALE, "LIB3DS_MAT_MAP_USCALE"},
- {LIB3DS_MAT_MAP_VSCALE, "LIB3DS_MAT_MAP_VSCALE"},
- {LIB3DS_MAT_MAP_UOFFSET, "LIB3DS_MAT_MAP_UOFFSET"},
- {LIB3DS_MAT_MAP_VOFFSET, "LIB3DS_MAT_MAP_VOFFSET"},
- {LIB3DS_MAT_MAP_ANG, "LIB3DS_MAT_MAP_ANG"},
- {LIB3DS_MAT_MAP_COL1, "LIB3DS_MAT_MAP_COL1"},
- {LIB3DS_MAT_MAP_COL2, "LIB3DS_MAT_MAP_COL2"},
- {LIB3DS_MAT_MAP_RCOL, "LIB3DS_MAT_MAP_RCOL"},
- {LIB3DS_MAT_MAP_GCOL, "LIB3DS_MAT_MAP_GCOL"},
- {LIB3DS_MAT_MAP_BCOL, "LIB3DS_MAT_MAP_BCOL"},
- {LIB3DS_NAMED_OBJECT, "LIB3DS_NAMED_OBJECT"},
- {LIB3DS_N_DIRECT_LIGHT, "LIB3DS_N_DIRECT_LIGHT"},
- {LIB3DS_DL_OFF, "LIB3DS_DL_OFF"},
- {LIB3DS_DL_OUTER_RANGE, "LIB3DS_DL_OUTER_RANGE"},
- {LIB3DS_DL_INNER_RANGE, "LIB3DS_DL_INNER_RANGE"},
- {LIB3DS_DL_MULTIPLIER, "LIB3DS_DL_MULTIPLIER"},
- {LIB3DS_DL_EXCLUDE, "LIB3DS_DL_EXCLUDE"},
- {LIB3DS_DL_ATTENUATE, "LIB3DS_DL_ATTENUATE"},
- {LIB3DS_DL_SPOTLIGHT, "LIB3DS_DL_SPOTLIGHT"},
- {LIB3DS_DL_SPOT_ROLL, "LIB3DS_DL_SPOT_ROLL"},
- {LIB3DS_DL_SHADOWED, "LIB3DS_DL_SHADOWED"},
- {LIB3DS_DL_LOCAL_SHADOW2, "LIB3DS_DL_LOCAL_SHADOW2"},
- {LIB3DS_DL_SEE_CONE, "LIB3DS_DL_SEE_CONE"},
- {LIB3DS_DL_SPOT_RECTANGULAR, "LIB3DS_DL_SPOT_RECTANGULAR"},
- {LIB3DS_DL_SPOT_ASPECT, "LIB3DS_DL_SPOT_ASPECT"},
- {LIB3DS_DL_SPOT_PROJECTOR, "LIB3DS_DL_SPOT_PROJECTOR"},
- {LIB3DS_DL_SPOT_OVERSHOOT, "LIB3DS_DL_SPOT_OVERSHOOT"},
- {LIB3DS_DL_RAY_BIAS, "LIB3DS_DL_RAY_BIAS"},
- {LIB3DS_DL_RAYSHAD, "LIB3DS_DL_RAYSHAD"},
- {LIB3DS_N_CAMERA, "LIB3DS_N_CAMERA"},
- {LIB3DS_CAM_SEE_CONE, "LIB3DS_CAM_SEE_CONE"},
- {LIB3DS_CAM_RANGES, "LIB3DS_CAM_RANGES"},
- {LIB3DS_OBJ_HIDDEN, "LIB3DS_OBJ_HIDDEN"},
- {LIB3DS_OBJ_VIS_LOFTER, "LIB3DS_OBJ_VIS_LOFTER"},
- {LIB3DS_OBJ_DOESNT_CAST, "LIB3DS_OBJ_DOESNT_CAST"},
- {LIB3DS_OBJ_DONT_RCVSHADOW, "LIB3DS_OBJ_DONT_RCVSHADOW"},
- {LIB3DS_OBJ_MATTE, "LIB3DS_OBJ_MATTE"},
- {LIB3DS_OBJ_FAST, "LIB3DS_OBJ_FAST"},
- {LIB3DS_OBJ_PROCEDURAL, "LIB3DS_OBJ_PROCEDURAL"},
- {LIB3DS_OBJ_FROZEN, "LIB3DS_OBJ_FROZEN"},
- {LIB3DS_N_TRI_OBJECT, "LIB3DS_N_TRI_OBJECT"},
- {LIB3DS_POINT_ARRAY, "LIB3DS_POINT_ARRAY"},
- {LIB3DS_POINT_FLAG_ARRAY, "LIB3DS_POINT_FLAG_ARRAY"},
- {LIB3DS_FACE_ARRAY, "LIB3DS_FACE_ARRAY"},
- {LIB3DS_MSH_MAT_GROUP, "LIB3DS_MSH_MAT_GROUP"},
- {LIB3DS_SMOOTH_GROUP, "LIB3DS_SMOOTH_GROUP"},
- {LIB3DS_MSH_BOXMAP, "LIB3DS_MSH_BOXMAP"},
- {LIB3DS_TEX_VERTS, "LIB3DS_TEX_VERTS"},
- {LIB3DS_MESH_MATRIX, "LIB3DS_MESH_MATRIX"},
- {LIB3DS_MESH_COLOR, "LIB3DS_MESH_COLOR"},
- {LIB3DS_MESH_TEXTURE_INFO, "LIB3DS_MESH_TEXTURE_INFO"},
- {LIB3DS_KFDATA, "LIB3DS_KFDATA"},
- {LIB3DS_KFHDR, "LIB3DS_KFHDR"},
- {LIB3DS_KFSEG, "LIB3DS_KFSEG"},
- {LIB3DS_KFCURTIME, "LIB3DS_KFCURTIME"},
- {LIB3DS_AMBIENT_NODE_TAG, "LIB3DS_AMBIENT_NODE_TAG"},
- {LIB3DS_OBJECT_NODE_TAG, "LIB3DS_OBJECT_NODE_TAG"},
- {LIB3DS_CAMERA_NODE_TAG, "LIB3DS_CAMERA_NODE_TAG"},
- {LIB3DS_TARGET_NODE_TAG, "LIB3DS_TARGET_NODE_TAG"},
- {LIB3DS_LIGHT_NODE_TAG, "LIB3DS_LIGHT_NODE_TAG"},
- {LIB3DS_L_TARGET_NODE_TAG, "LIB3DS_L_TARGET_NODE_TAG"},
- {LIB3DS_SPOTLIGHT_NODE_TAG, "LIB3DS_SPOTLIGHT_NODE_TAG"},
- {LIB3DS_NODE_ID, "LIB3DS_NODE_ID"},
- {LIB3DS_NODE_HDR, "LIB3DS_NODE_HDR"},
- {LIB3DS_PIVOT, "LIB3DS_PIVOT"},
- {LIB3DS_INSTANCE_NAME, "LIB3DS_INSTANCE_NAME"},
- {LIB3DS_MORPH_SMOOTH, "LIB3DS_MORPH_SMOOTH"},
- {LIB3DS_BOUNDBOX, "LIB3DS_BOUNDBOX"},
- {LIB3DS_POS_TRACK_TAG, "LIB3DS_POS_TRACK_TAG"},
- {LIB3DS_COL_TRACK_TAG, "LIB3DS_COL_TRACK_TAG"},
- {LIB3DS_ROT_TRACK_TAG, "LIB3DS_ROT_TRACK_TAG"},
- {LIB3DS_SCL_TRACK_TAG, "LIB3DS_SCL_TRACK_TAG"},
- {LIB3DS_MORPH_TRACK_TAG, "LIB3DS_MORPH_TRACK_TAG"},
- {LIB3DS_FOV_TRACK_TAG, "LIB3DS_FOV_TRACK_TAG"},
- {LIB3DS_ROLL_TRACK_TAG, "LIB3DS_ROLL_TRACK_TAG"},
- {LIB3DS_HOT_TRACK_TAG, "LIB3DS_HOT_TRACK_TAG"},
- {LIB3DS_FALL_TRACK_TAG, "LIB3DS_FALL_TRACK_TAG"},
- {LIB3DS_HIDE_TRACK_TAG, "LIB3DS_HIDE_TRACK_TAG"},
- {LIB3DS_POLY_2D, "LIB3DS_POLY_2D"},
- {LIB3DS_SHAPE_OK, "LIB3DS_SHAPE_OK"},
- {LIB3DS_SHAPE_NOT_OK, "LIB3DS_SHAPE_NOT_OK"},
- {LIB3DS_SHAPE_HOOK, "LIB3DS_SHAPE_HOOK"},
- {LIB3DS_PATH_3D, "LIB3DS_PATH_3D"},
- {LIB3DS_PATH_MATRIX, "LIB3DS_PATH_MATRIX"},
- {LIB3DS_SHAPE_2D, "LIB3DS_SHAPE_2D"},
- {LIB3DS_M_SCALE, "LIB3DS_M_SCALE"},
- {LIB3DS_M_TWIST, "LIB3DS_M_TWIST"},
- {LIB3DS_M_TEETER, "LIB3DS_M_TEETER"},
- {LIB3DS_M_FIT, "LIB3DS_M_FIT"},
- {LIB3DS_M_BEVEL, "LIB3DS_M_BEVEL"},
- {LIB3DS_XZ_CURVE, "LIB3DS_XZ_CURVE"},
- {LIB3DS_YZ_CURVE, "LIB3DS_YZ_CURVE"},
- {LIB3DS_INTERPCT, "LIB3DS_INTERPCT"},
- {LIB3DS_DEFORM_LIMIT, "LIB3DS_DEFORM_LIMIT"},
- {LIB3DS_USE_CONTOUR, "LIB3DS_USE_CONTOUR"},
- {LIB3DS_USE_TWEEN, "LIB3DS_USE_TWEEN"},
- {LIB3DS_USE_SCALE, "LIB3DS_USE_SCALE"},
- {LIB3DS_USE_TWIST, "LIB3DS_USE_TWIST"},
- {LIB3DS_USE_TEETER, "LIB3DS_USE_TEETER"},
- {LIB3DS_USE_FIT, "LIB3DS_USE_FIT"},
- {LIB3DS_USE_BEVEL, "LIB3DS_USE_BEVEL"},
- {LIB3DS_DEFAULT_VIEW, "LIB3DS_DEFAULT_VIEW"},
- {LIB3DS_VIEW_TOP, "LIB3DS_VIEW_TOP"},
- {LIB3DS_VIEW_BOTTOM, "LIB3DS_VIEW_BOTTOM"},
- {LIB3DS_VIEW_LEFT, "LIB3DS_VIEW_LEFT"},
- {LIB3DS_VIEW_RIGHT, "LIB3DS_VIEW_RIGHT"},
- {LIB3DS_VIEW_FRONT, "LIB3DS_VIEW_FRONT"},
- {LIB3DS_VIEW_BACK, "LIB3DS_VIEW_BACK"},
- {LIB3DS_VIEW_USER, "LIB3DS_VIEW_USER"},
- {LIB3DS_VIEW_CAMERA, "LIB3DS_VIEW_CAMERA"},
- {LIB3DS_VIEW_WINDOW, "LIB3DS_VIEW_WINDOW"},
- {LIB3DS_VIEWPORT_LAYOUT_OLD, "LIB3DS_VIEWPORT_LAYOUT_OLD"},
- {LIB3DS_VIEWPORT_DATA_OLD, "LIB3DS_VIEWPORT_DATA_OLD"},
- {LIB3DS_VIEWPORT_LAYOUT, "LIB3DS_VIEWPORT_LAYOUT"},
- {LIB3DS_VIEWPORT_DATA, "LIB3DS_VIEWPORT_DATA"},
- {LIB3DS_VIEWPORT_DATA_3, "LIB3DS_VIEWPORT_DATA_3"},
- {LIB3DS_VIEWPORT_SIZE, "LIB3DS_VIEWPORT_SIZE"},
- {LIB3DS_NETWORK_VIEW, "LIB3DS_NETWORK_VIEW"},
- {0,0}
-};
-
-#ifdef __cplusplus
-}
-#endif
-#endif
-
diff --git a/3rdparty/lib3ds/chunktable.sed b/3rdparty/lib3ds/chunktable.sed
deleted file mode 100644
index 11a62fc0..00000000
--- a/3rdparty/lib3ds/chunktable.sed
+++ /dev/null
@@ -1,62 +0,0 @@
-1 {
- a\
-/* -*- c -*- */\
-#ifndef INCLUDED_LIB3DS_CHUNKTABLE_H\
-#define INCLUDED_LIB3DS_CHUNKTABLE_H\
-/*\
- * The 3D Studio File Format Library\
- * Copyright (C) 1996-2007 by Jan Eric Kyprianidis <www.kyprianidis.com>\
- * All rights reserved.\
- *\
- * This program is free software; you can redistribute it and/or modify it\
- * under the terms of the GNU Lesser General Public License as published by\
- * the Free Software Foundation; either version 2.1 of the License, or (at\
- * your option) any later version.\
- *\
- * This program is distributed in the hope that it will be useful, but\
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public\
- * License for more details.\
- *\
- * You should have received a copy of the GNU Lesser General Public License\
- * along with this program; if not, write to the Free Software Foundation,\
- * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\
- *\
- * $Id: chunktable.sed,v 1.7 2007/06/14 09:59:10 jeh Exp $\
- */\
-\
-#ifndef INCLUDED_LIB3DS_CHUNK_H\
-#include <lib3ds/chunk.h>\
-#endif\
-\
-#ifdef __cplusplus\
-extern "C" {\
-#endif\
-\
-typedef struct _Lib3dsChunkTable {\
- Lib3dsDword chunk;\
- const char* name;\
-} Lib3dsChunkTable;\
-\
-static Lib3dsChunkTable lib3ds_chunk_table[]={
-}
-/^ *LIB3DS_/ {
- s/ *\([0-9A-Z_]*\).*/ {\1, "\1"},/
- p
-}
-$ {
- i\
- {0,0}\
-};\
-\
-#ifdef __cplusplus\
-};\
-#endif\
-#endif\
-
-}
-d
-
-
-
-
diff --git a/3rdparty/lib3ds/ease.c b/3rdparty/lib3ds/ease.c
deleted file mode 100644
index 57b9504c..00000000
--- a/3rdparty/lib3ds/ease.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * The 3D Studio File Format Library
- * Copyright (C) 1996-2007 by Jan Eric Kyprianidis <www.kyprianidis.com>
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id: ease.c,v 1.6 2007/06/15 09:33:19 jeh Exp $
- */
-#include <lib3ds/ease.h>
-
-
-/*!
- * \defgroup ease Ease
- */
-
-
-/*!
- * \ingroup ease
- */
-Lib3dsFloat
-lib3ds_ease(Lib3dsFloat fp, Lib3dsFloat fc, Lib3dsFloat fn,
- Lib3dsFloat ease_from, Lib3dsFloat ease_to)
-{
- Lib3dsDouble s,step;
- Lib3dsDouble tofrom;
- Lib3dsDouble a;
-
- s=step=(Lib3dsFloat)(fc-fp)/(fn-fp);
- tofrom=ease_to+ease_from;
- if (tofrom!=0.0) {
- if (tofrom>1.0) {
- ease_to=(Lib3dsFloat)(ease_to/tofrom);
- ease_from=(Lib3dsFloat)(ease_from/tofrom);
- }
- a=1.0/(2.0-(ease_to+ease_from));
-
- if (step<ease_from) s=a/ease_from*step*step;
- else {
- if ((1.0-ease_to)<=step) {
- step=1.0-step;
- s=1.0-a/ease_to*step*step;
- }
- else {
- s=((2.0*step)-ease_from)*a;
- }
- }
- }
- return((Lib3dsFloat)s);
-}
diff --git a/3rdparty/lib3ds/ease.h b/3rdparty/lib3ds/ease.h
deleted file mode 100644
index 456f3914..00000000
--- a/3rdparty/lib3ds/ease.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* -*- c -*- */
-#ifndef INCLUDED_LIB3DS_EASE_H
-#define INCLUDED_LIB3DS_EASE_H
-/*
- * The 3D Studio File Format Library
- * Copyright (C) 1996-2007 by Jan Eric Kyprianidis <www.kyprianidis.com>
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id: ease.h,v 1.6 2007/06/14 09:59:10 jeh Exp $
- */
-
-#ifndef INCLUDED_LIB3DS_TYPES_H
-#include <lib3ds/types.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern LIB3DSAPI Lib3dsFloat lib3ds_ease(Lib3dsFloat fp, Lib3dsFloat fc,
- Lib3dsFloat fn, Lib3dsFloat ease_from, Lib3dsFloat ease_to);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
-
diff --git a/3rdparty/lib3ds/file.c b/3rdparty/lib3ds/file.c
deleted file mode 100644
index 01fc4bd4..00000000
--- a/3rdparty/lib3ds/file.c
+++ /dev/null
@@ -1,2029 +0,0 @@
-/*
- * The 3D Studio File Format Library
- * Copyright (C) 1996-2007 by Jan Eric Kyprianidis <www.kyprianidis.com>
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id: file.c,v 1.34 2007/06/20 17:04:08 jeh Exp $
- */
-#include <lib3ds/file.h>
-#include <lib3ds/chunk.h>
-#include <lib3ds/io.h>
-#include <lib3ds/material.h>
-#include <lib3ds/mesh.h>
-#include <lib3ds/camera.h>
-#include <lib3ds/light.h>
-#include <lib3ds/node.h>
-#include <lib3ds/matrix.h>
-#include <lib3ds/vector.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-#include <float.h>
-
-
-/*!
- * \defgroup file Files
- */
-
-
-static Lib3dsBool
-fileio_error_func(void *self)
-{
- FILE *f = (FILE*)self;
- return(ferror(f)!=0);
-}
-
-
-static long
-fileio_seek_func(void *self, long offset, Lib3dsIoSeek origin)
-{
- FILE *f = (FILE*)self;
- int o;
- switch (origin) {
- case LIB3DS_SEEK_SET:
- o = SEEK_SET;
- break;
- case LIB3DS_SEEK_CUR:
- o = SEEK_CUR;
- break;
- case LIB3DS_SEEK_END:
- o = SEEK_END;
- break;
- default:
- ASSERT(0);
- return(0);
- }
- return (fseek(f, offset, o));
-}
-
-
-static long
-fileio_tell_func(void *self)
-{
- FILE *f = (FILE*)self;
- return(ftell(f));
-}
-
-
-static size_t
-fileio_read_func(void *self, void *buffer, size_t size)
-{
- FILE *f = (FILE*)self;
- return(fread(buffer, 1, size, f));
-}
-
-
-static size_t
-fileio_write_func(void *self, const void *buffer, size_t size)
-{
- FILE *f = (FILE*)self;
- return(fwrite(buffer, 1, size, f));
-}
-
-
-/*!
- * Loads a .3DS file from disk into memory.
- *
- * \param filename The filename of the .3DS file
- *
- * \return A pointer to the Lib3dsFile structure containing the
- * data of the .3DS file.
- * If the .3DS file can not be loaded NULL is returned.
- *
- * \note To free the returned structure use lib3ds_free.
- *
- * \see lib3ds_file_save
- * \see lib3ds_file_new
- * \see lib3ds_file_free
- *
- * \ingroup file
- */
-Lib3dsFile*
-lib3ds_file_load(const char *filename)
-{
- FILE *f;
- Lib3dsFile *file;
- Lib3dsIo *io;
-
- f = fopen(filename, "rb");
- if (!f) {
- return(0);
- }
- file = lib3ds_file_new();
- if (!file) {
- fclose(f);
- return(0);
- }
-
- io = lib3ds_io_new(
- f,
- fileio_error_func,
- fileio_seek_func,
- fileio_tell_func,
- fileio_read_func,
- fileio_write_func
- );
- if (!io) {
- lib3ds_file_free(file);
- fclose(f);
- return(0);
- }
-
- if (!lib3ds_file_read(file, io)) {
- free(file);
- lib3ds_io_free(io);
- fclose(f);
- return(0);
- }
-
- lib3ds_io_free(io);
- fclose(f);
- return(file);
-}
-
-
-/*!
- * Saves a .3DS file from memory to disk.
- *
- * \param file A pointer to a Lib3dsFile structure containing the
- * the data that should be stored.
- * \param filename The filename of the .3DS file to store the data in.
- *
- * \return TRUE on success, FALSE otherwise.
- *
- * \see lib3ds_file_load
- *
- * \ingroup file
- */
-Lib3dsBool
-lib3ds_file_save(Lib3dsFile *file, const char *filename)
-{
- FILE *f;
- Lib3dsIo *io;
- Lib3dsBool result;
-
- f = fopen(filename, "wb");
- if (!f) {
- return(LIB3DS_FALSE);
- }
- io = lib3ds_io_new(
- f,
- fileio_error_func,
- fileio_seek_func,
- fileio_tell_func,
- fileio_read_func,
- fileio_write_func
- );
- if (!io) {
- fclose(f);
- return LIB3DS_FALSE;
- }
-
- result = lib3ds_file_write(file, io);
-
- fclose(f);
-
- lib3ds_io_free(io);
- return(result);
-}
-
-
-/*!
- * Creates and returns a new, empty Lib3dsFile object.
- *
- * \return A pointer to the Lib3dsFile structure.
- * If the structure cannot be allocated, NULL is returned.
- *
- * \ingroup file
- */
-Lib3dsFile*
-lib3ds_file_new()
-{
- Lib3dsFile *file;
-
- file=(Lib3dsFile*)calloc(sizeof(Lib3dsFile),1);
- if (!file) {
- return(0);
- }
- file->mesh_version=3;
- file->master_scale=1.0f;
- file->keyf_revision=5;
- strcpy(file->name, "LIB3DS");
-
- file->frames=100;
- file->segment_from=0;
- file->segment_to=100;
- file->current_frame=0;
-
- return(file);
-}
-
-
-/*!
- * Free a Lib3dsFile object and all of its resources.
- *
- * \param file The Lib3dsFile object to be freed.
- *
- * \ingroup file
- */
-void
-lib3ds_file_free(Lib3dsFile* file)
-{
- ASSERT(file);
- lib3ds_viewport_set_views(&file->viewport,0);
- lib3ds_viewport_set_views(&file->viewport_keyf,0);
- {
- Lib3dsMaterial *p,*q;
-
- for (p=file->materials; p; p=q) {
- q=p->next;
- lib3ds_material_free(p);
- }
- file->materials=0;
- }
- {
- Lib3dsCamera *p,*q;
-
- for (p=file->cameras; p; p=q) {
- q=p->next;
- lib3ds_camera_free(p);
- }
- file->cameras=0;
- }
- {
- Lib3dsLight *p,*q;
-
- for (p=file->lights; p; p=q) {
- q=p->next;
- lib3ds_light_free(p);
- }
- file->lights=0;
- }
- {
- Lib3dsMesh *p,*q;
-
- for (p=file->meshes; p; p=q) {
- q=p->next;
- lib3ds_mesh_free(p);
- }
- file->meshes=0;
- }
- {
- Lib3dsNode *p,*q;
-
- for (p=file->nodes; p; p=q) {
- q=p->next;
- lib3ds_node_free(p);
- }
- }
- free(file);
-}
-
-
-/*!
- * Evaluate all of the nodes in this Lib3dsFile object.
- *
- * \param file The Lib3dsFile object to be evaluated.
- * \param t time value, between 0. and file->frames
- *
- * \see lib3ds_node_eval
- *
- * \ingroup file
- */
-void
-lib3ds_file_eval(Lib3dsFile *file, Lib3dsFloat t)
-{
- Lib3dsNode *p;
-
- for (p=file->nodes; p!=0; p=p->next) {
- lib3ds_node_eval(p, t);
- }
-}
-
-
-static Lib3dsBool
-named_object_read(Lib3dsFile *file, Lib3dsIo *io)
-{
- Lib3dsChunk c;
- char name[64];
- Lib3dsWord chunk;
- Lib3dsMesh *mesh = NULL;
- Lib3dsCamera *camera = NULL;
- Lib3dsLight *light = NULL;
- Lib3dsDword object_flags;
-
- if (!lib3ds_chunk_read_start(&c, LIB3DS_NAMED_OBJECT, io)) {
- return(LIB3DS_FALSE);
- }
- if (!lib3ds_io_read_string(io, name, 64)) {
- return(LIB3DS_FALSE);
- }
- lib3ds_chunk_dump_info(" NAME=%s", name);
- lib3ds_chunk_read_tell(&c, io);
-
- object_flags = 0;
- while ((chunk=lib3ds_chunk_read_next(&c, io))!=0) {
- switch (chunk) {
- case LIB3DS_N_TRI_OBJECT:
- {
- mesh=lib3ds_mesh_new(name);
- if (!mesh) {
- return(LIB3DS_FALSE);
- }
- lib3ds_chunk_read_reset(&c, io);
- if (!lib3ds_mesh_read(mesh, io)) {
- return(LIB3DS_FALSE);
- }
- lib3ds_file_insert_mesh(file, mesh);
- }
- break;
-
- case LIB3DS_N_CAMERA:
- {
- camera=lib3ds_camera_new(name);
- if (!camera) {
- return(LIB3DS_FALSE);
- }
- lib3ds_chunk_read_reset(&c, io);
- if (!lib3ds_camera_read(camera, io)) {
- return(LIB3DS_FALSE);
- }
- lib3ds_file_insert_camera(file, camera);
- }
- break;
-
- case LIB3DS_N_DIRECT_LIGHT:
- {
- light=lib3ds_light_new(name);
- if (!light) {
- return(LIB3DS_FALSE);
- }
- lib3ds_chunk_read_reset(&c, io);
- if (!lib3ds_light_read(light, io)) {
- return(LIB3DS_FALSE);
- }
- lib3ds_file_insert_light(file, light);
- }
- break;
-
- case LIB3DS_OBJ_HIDDEN:
- object_flags |= LIB3DS_OBJECT_HIDDEN;
- break;
-
- case LIB3DS_OBJ_DOESNT_CAST:
- object_flags |= LIB3DS_OBJECT_DOESNT_CAST;
- break;
-
- case LIB3DS_OBJ_VIS_LOFTER:
- object_flags |= LIB3DS_OBJECT_VIS_LOFTER;
- break;
-
- case LIB3DS_OBJ_MATTE:
- object_flags |= LIB3DS_OBJECT_MATTE;
- break;
-
- case LIB3DS_OBJ_DONT_RCVSHADOW:
- object_flags |= LIB3DS_OBJECT_DONT_RCVSHADOW;
- break;
-
- case LIB3DS_OBJ_FAST:
- object_flags |= LIB3DS_OBJECT_FAST;
- break;
-
- case LIB3DS_OBJ_FROZEN:
- object_flags |= LIB3DS_OBJECT_FROZEN;
- break;
-
- default:
- lib3ds_chunk_unknown(chunk);
- }
- }
-
- if (mesh)
- mesh->object_flags = object_flags;
- if (camera)
- camera->object_flags = object_flags;
- if (light)
- light->object_flags = object_flags;
-
- lib3ds_chunk_read_end(&c, io);
- return(LIB3DS_TRUE);
-}
-
-
-static Lib3dsBool
-ambient_read(Lib3dsFile *file, Lib3dsIo *io)
-{
- Lib3dsChunk c;
- Lib3dsWord chunk;
- Lib3dsBool have_lin=LIB3DS_FALSE;
-
- if (!lib3ds_chunk_read_start(&c, LIB3DS_AMBIENT_LIGHT, io)) {
- return(LIB3DS_FALSE);
- }
-
- while ((chunk=lib3ds_chunk_read_next(&c, io))!=0) {
- switch (chunk) {
- case LIB3DS_LIN_COLOR_F:
- {
- int i;
- for (i=0; i<3; ++i) {
- file->ambient[i]=lib3ds_io_read_float(io);
- }
- }
- have_lin=LIB3DS_TRUE;
- break;
- case LIB3DS_COLOR_F:
- {
- /* gamma corrected color chunk
- replaced in 3ds R3 by LIN_COLOR_24 */
- if (!have_lin) {
- int i;
- for (i=0; i<3; ++i) {
- file->ambient[i]=lib3ds_io_read_float(io);
- }
- }
- }
- break;
- default:
- lib3ds_chunk_unknown(chunk);
- }
- }
-
- lib3ds_chunk_read_end(&c, io);
- return(LIB3DS_TRUE);
-}
-
-
-static Lib3dsBool
-mdata_read(Lib3dsFile *file, Lib3dsIo *io)
-{
- Lib3dsChunk c;
- Lib3dsWord chunk;
-
- if (!lib3ds_chunk_read_start(&c, LIB3DS_MDATA, io)) {
- return(LIB3DS_FALSE);
- }
-
- while ((chunk=lib3ds_chunk_read_next(&c, io))!=0) {
- switch (chunk) {
- case LIB3DS_MESH_VERSION:
- {
- file->mesh_version=lib3ds_io_read_intd(io);
- }
- break;
- case LIB3DS_MASTER_SCALE:
- {
- file->master_scale=lib3ds_io_read_float(io);
- }
- break;
- case LIB3DS_SHADOW_MAP_SIZE:
- case LIB3DS_LO_SHADOW_BIAS:
- case LIB3DS_HI_SHADOW_BIAS:
- case LIB3DS_SHADOW_SAMPLES:
- case LIB3DS_SHADOW_RANGE:
- case LIB3DS_SHADOW_FILTER:
- case LIB3DS_RAY_BIAS:
- {
- lib3ds_chunk_read_reset(&c, io);
- if (!lib3ds_shadow_read(&file->shadow, io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_VIEWPORT_LAYOUT:
- case LIB3DS_DEFAULT_VIEW:
- {
- lib3ds_chunk_read_reset(&c, io);
- if (!lib3ds_viewport_read(&file->viewport, io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_O_CONSTS:
- {
- int i;
- for (i=0; i<3; ++i) {
- file->construction_plane[i]=lib3ds_io_read_float(io);
- }
- }
- break;
- case LIB3DS_AMBIENT_LIGHT:
- {
- lib3ds_chunk_read_reset(&c, io);
- if (!ambient_read(file, io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_BIT_MAP:
- case LIB3DS_SOLID_BGND:
- case LIB3DS_V_GRADIENT:
- case LIB3DS_USE_BIT_MAP:
- case LIB3DS_USE_SOLID_BGND:
- case LIB3DS_USE_V_GRADIENT:
- {
- lib3ds_chunk_read_reset(&c, io);
- if (!lib3ds_background_read(&file->background, io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_FOG:
- case LIB3DS_LAYER_FOG:
- case LIB3DS_DISTANCE_CUE:
- case LIB3DS_USE_FOG:
- case LIB3DS_USE_LAYER_FOG:
- case LIB3DS_USE_DISTANCE_CUE:
- {
- lib3ds_chunk_read_reset(&c, io);
- if (!lib3ds_atmosphere_read(&file->atmosphere, io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_MAT_ENTRY:
- {
- Lib3dsMaterial *material;
-
- material=lib3ds_material_new();
- if (!material) {
- return(LIB3DS_FALSE);
- }
- lib3ds_chunk_read_reset(&c, io);
- if (!lib3ds_material_read(material, io)) {
- return(LIB3DS_FALSE);
- }
- lib3ds_file_insert_material(file, material);
- }
- break;
- case LIB3DS_NAMED_OBJECT:
- {
- lib3ds_chunk_read_reset(&c, io);
- if (!named_object_read(file, io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- default:
- lib3ds_chunk_unknown(chunk);
- }
- }
-
- lib3ds_chunk_read_end(&c, io);
- return(LIB3DS_TRUE);
-}
-
-
-static Lib3dsBool
-kfdata_read(Lib3dsFile *file, Lib3dsIo *io)
-{
- Lib3dsChunk c;
- Lib3dsWord chunk;
- Lib3dsDword node_number = 0;
-
- if (!lib3ds_chunk_read_start(&c, LIB3DS_KFDATA, io)) {
- return(LIB3DS_FALSE);
- }
-
- while ((chunk=lib3ds_chunk_read_next(&c, io))!=0) {
- switch (chunk) {
- case LIB3DS_KFHDR:
- {
- file->keyf_revision=lib3ds_io_read_word(io);
- if (!lib3ds_io_read_string(io, file->name, 12+1)) {
- return(LIB3DS_FALSE);
- }
- file->frames=lib3ds_io_read_intd(io);
- }
- break;
- case LIB3DS_KFSEG:
- {
- file->segment_from=lib3ds_io_read_intd(io);
- file->segment_to=lib3ds_io_read_intd(io);
- }
- break;
- case LIB3DS_KFCURTIME:
- {
- file->current_frame=lib3ds_io_read_intd(io);
- }
- break;
- case LIB3DS_VIEWPORT_LAYOUT:
- case LIB3DS_DEFAULT_VIEW:
- {
- lib3ds_chunk_read_reset(&c, io);
- if (!lib3ds_viewport_read(&file->viewport_keyf, io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_AMBIENT_NODE_TAG:
- {
- Lib3dsNode *node;
-
- node=lib3ds_node_new_ambient();
- if (!node) {
- return(LIB3DS_FALSE);
- }
- node->node_id=node_number++;
- lib3ds_chunk_read_reset(&c, io);
- if (!lib3ds_node_read(node, file, io)) {
- return(LIB3DS_FALSE);
- }
- lib3ds_file_insert_node(file, node);
- }
- break;
- case LIB3DS_OBJECT_NODE_TAG:
- {
- Lib3dsNode *node;
-
- node=lib3ds_node_new_object();
- if (!node) {
- return(LIB3DS_FALSE);
- }
- node->node_id=node_number++;
- lib3ds_chunk_read_reset(&c, io);
- if (!lib3ds_node_read(node, file, io)) {
- return(LIB3DS_FALSE);
- }
- lib3ds_file_insert_node(file, node);
- }
- break;
- case LIB3DS_CAMERA_NODE_TAG:
- {
- Lib3dsNode *node;
-
- node=lib3ds_node_new_camera();
- if (!node) {
- return(LIB3DS_FALSE);
- }
- node->node_id=node_number++;
- lib3ds_chunk_read_reset(&c, io);
- if (!lib3ds_node_read(node, file, io)) {
- return(LIB3DS_FALSE);
- }
- lib3ds_file_insert_node(file, node);
- }
- break;
- case LIB3DS_TARGET_NODE_TAG:
- {
- Lib3dsNode *node;
-
- node=lib3ds_node_new_target();
- if (!node) {
- return(LIB3DS_FALSE);
- }
- node->node_id=node_number++;
- lib3ds_chunk_read_reset(&c, io);
- if (!lib3ds_node_read(node, file, io)) {
- return(LIB3DS_FALSE);
- }
- lib3ds_file_insert_node(file, node);
- }
- break;
- case LIB3DS_LIGHT_NODE_TAG:
- case LIB3DS_SPOTLIGHT_NODE_TAG:
- {
- Lib3dsNode *node;
-
- node=lib3ds_node_new_light();
- if (!node) {
- return(LIB3DS_FALSE);
- }
- node->node_id=node_number++;
- lib3ds_chunk_read_reset(&c, io);
- if (!lib3ds_node_read(node, file, io)) {
- return(LIB3DS_FALSE);
- }
- lib3ds_file_insert_node(file, node);
- }
- break;
- case LIB3DS_L_TARGET_NODE_TAG:
- {
- Lib3dsNode *node;
-
- node=lib3ds_node_new_spot();
- if (!node) {
- return(LIB3DS_FALSE);
- }
- node->node_id=node_number++;
- lib3ds_chunk_read_reset(&c, io);
- if (!lib3ds_node_read(node, file, io)) {
- return(LIB3DS_FALSE);
- }
- lib3ds_file_insert_node(file, node);
- }
- break;
- default:
- lib3ds_chunk_unknown(chunk);
- }
- }
-
- lib3ds_chunk_read_end(&c, io);
- return(LIB3DS_TRUE);
-}
-
-
-/*!
- * Read 3ds file data into a Lib3dsFile object.
- *
- * \param file The Lib3dsFile object to be filled.
- * \param io A Lib3dsIo object previously set up by the caller.
- *
- * \return LIB3DS_TRUE on success, LIB3DS_FALSE on failure.
- *
- * \ingroup file
- */
-Lib3dsBool
-lib3ds_file_read(Lib3dsFile *file, Lib3dsIo *io)
-{
- Lib3dsChunk c;
- Lib3dsWord chunk;
-
- if (!lib3ds_chunk_read_start(&c, 0, io)) {
- return(LIB3DS_FALSE);
- }
- switch (c.chunk) {
- case LIB3DS_MDATA:
- {
- lib3ds_chunk_read_reset(&c, io);
- if (!mdata_read(file, io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_M3DMAGIC:
- case LIB3DS_MLIBMAGIC:
- case LIB3DS_CMAGIC:
- {
- while ((chunk=lib3ds_chunk_read_next(&c, io))!=0) {
- switch (chunk) {
- case LIB3DS_M3D_VERSION:
- {
- file->mesh_version=lib3ds_io_read_dword(io);
- }
- break;
- case LIB3DS_MDATA:
- {
- lib3ds_chunk_read_reset(&c, io);
- if (!mdata_read(file, io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_KFDATA:
- {
- lib3ds_chunk_read_reset(&c, io);
- if (!kfdata_read(file, io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- default:
- lib3ds_chunk_unknown(chunk);
- }
- }
- }
- break;
- default:
- lib3ds_chunk_unknown(c.chunk);
- return(LIB3DS_FALSE);
- }
-
- lib3ds_chunk_read_end(&c, io);
- return(LIB3DS_TRUE);
-}
-
-
-static Lib3dsBool
-colorf_write(Lib3dsRgba rgb, Lib3dsIo *io)
-{
- Lib3dsChunk c;
-
- c.chunk=LIB3DS_COLOR_F;
- c.size=18;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_rgb(io, rgb);
-
- c.chunk=LIB3DS_LIN_COLOR_F;
- c.size=18;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_rgb(io, rgb);
- return(LIB3DS_TRUE);
-}
-
-
-static Lib3dsBool
-object_flags_write(Lib3dsDword flags, Lib3dsIo *io)
-{
- if (flags){
- if (flags & LIB3DS_OBJECT_HIDDEN) {
- if (!lib3ds_chunk_write_switch(LIB3DS_OBJ_HIDDEN, io))
- return LIB3DS_FALSE;
- }
- if (flags & LIB3DS_OBJECT_VIS_LOFTER) {
- if (!lib3ds_chunk_write_switch(LIB3DS_OBJ_VIS_LOFTER, io))
- return LIB3DS_FALSE;
- }
- if (flags & LIB3DS_OBJECT_DOESNT_CAST) {
- if (!lib3ds_chunk_write_switch(LIB3DS_OBJ_DOESNT_CAST, io))
- return LIB3DS_FALSE;
- }
- if (flags & LIB3DS_OBJECT_MATTE) {
- if (!lib3ds_chunk_write_switch(LIB3DS_OBJ_MATTE, io))
- return LIB3DS_FALSE;
- }
- if (flags & LIB3DS_OBJECT_DONT_RCVSHADOW) {
- if (!lib3ds_chunk_write_switch(LIB3DS_OBJ_DOESNT_CAST, io))
- return LIB3DS_FALSE;
- }
- if (flags & LIB3DS_OBJECT_FAST) {
- if (!lib3ds_chunk_write_switch(LIB3DS_OBJ_FAST, io))
- return LIB3DS_FALSE;
- }
- if (flags & LIB3DS_OBJECT_FROZEN) {
- if (!lib3ds_chunk_write_switch(LIB3DS_OBJ_FROZEN, io))
- return LIB3DS_FALSE;
- }
- }
- return LIB3DS_TRUE;
-}
-
-
-static Lib3dsBool
-mdata_write(Lib3dsFile *file, Lib3dsIo *io)
-{
- Lib3dsChunk c;
-
- c.chunk=LIB3DS_MDATA;
- if (!lib3ds_chunk_write_start(&c,io)) {
- return(LIB3DS_FALSE);
- }
-
- { /*---- LIB3DS_MESH_VERSION ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_MESH_VERSION;
- c.size=10;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_intd(io, file->mesh_version);
- }
- { /*---- LIB3DS_MASTER_SCALE ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_MASTER_SCALE;
- c.size=10;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_float(io, file->master_scale);
- }
- { /*---- LIB3DS_O_CONSTS ----*/
- int i;
- for (i=0; i<3; ++i) {
- if (fabs(file->construction_plane[i])>LIB3DS_EPSILON) {
- break;
- }
- }
- if (i<3) {
- Lib3dsChunk c;
- c.chunk=LIB3DS_O_CONSTS;
- c.size=18;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_vector(io, file->construction_plane);
- }
- }
-
- { /*---- LIB3DS_AMBIENT_LIGHT ----*/
- int i;
- for (i=0; i<3; ++i) {
- if (fabs(file->ambient[i])>LIB3DS_EPSILON) {
- break;
- }
- }
- if (i<3) {
- Lib3dsChunk c;
- c.chunk=LIB3DS_AMBIENT_LIGHT;
- c.size=42;
- lib3ds_chunk_write(&c,io);
- colorf_write(file->ambient,io);
- }
- }
- lib3ds_background_write(&file->background, io);
- lib3ds_atmosphere_write(&file->atmosphere, io);
- lib3ds_shadow_write(&file->shadow, io);
- lib3ds_viewport_write(&file->viewport, io);
- {
- Lib3dsMaterial *p;
- for (p=file->materials; p!=0; p=p->next) {
- if (!lib3ds_material_write(p,io)) {
- return(LIB3DS_FALSE);
- }
- }
- }
- {
- Lib3dsCamera *p;
- Lib3dsChunk c;
-
- for (p=file->cameras; p!=0; p=p->next) {
- c.chunk=LIB3DS_NAMED_OBJECT;
- if (!lib3ds_chunk_write_start(&c,io)) {
- return(LIB3DS_FALSE);
- }
- lib3ds_io_write_string(io, p->name);
- lib3ds_camera_write(p,io);
- object_flags_write(p->object_flags,io);
- if (!lib3ds_chunk_write_end(&c,io)) {
- return(LIB3DS_FALSE);
- }
- }
- }
- {
- Lib3dsLight *p;
- Lib3dsChunk c;
-
- for (p=file->lights; p!=0; p=p->next) {
- c.chunk=LIB3DS_NAMED_OBJECT;
- if (!lib3ds_chunk_write_start(&c,io)) {
- return(LIB3DS_FALSE);
- }
- lib3ds_io_write_string(io,p->name);
- lib3ds_light_write(p,io);
- object_flags_write(p->object_flags,io);
- if (!lib3ds_chunk_write_end(&c,io)) {
- return(LIB3DS_FALSE);
- }
- }
- }
- {
- Lib3dsMesh *p;
- Lib3dsChunk c;
-
- for (p=file->meshes; p!=0; p=p->next) {
- c.chunk=LIB3DS_NAMED_OBJECT;
- if (!lib3ds_chunk_write_start(&c,io)) {
- return(LIB3DS_FALSE);
- }
- lib3ds_io_write_string(io, p->name);
- lib3ds_mesh_write(p,io);
- object_flags_write(p->object_flags,io);
- if (!lib3ds_chunk_write_end(&c,io)) {
- return(LIB3DS_FALSE);
- }
- }
- }
-
- if (!lib3ds_chunk_write_end(&c,io)) {
- return(LIB3DS_FALSE);
- }
- return(LIB3DS_TRUE);
-}
-
-
-
-static Lib3dsBool
-nodes_write(Lib3dsNode *node, Lib3dsFile *file, Lib3dsIo *io)
-{
- {
- Lib3dsNode *p;
- for (p=node->childs; p!=0; p=p->next) {
- if (!lib3ds_node_write(p, file, io)) {
- return(LIB3DS_FALSE);
- }
- nodes_write(p, file, io);
- }
- }
- return(LIB3DS_TRUE);
-}
-
-
-static Lib3dsBool
-kfdata_write(Lib3dsFile *file, Lib3dsIo *io)
-{
- Lib3dsChunk c;
-
- if (!file->nodes) {
- return(LIB3DS_TRUE);
- }
-
- c.chunk=LIB3DS_KFDATA;
- if (!lib3ds_chunk_write_start(&c,io)) {
- return(LIB3DS_FALSE);
- }
-
- { /*---- LIB3DS_KFHDR ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_KFHDR;
- c.size=6 + 2 + (Lib3dsDword)strlen(file->name)+1 +4;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_intw(io, file->keyf_revision);
- lib3ds_io_write_string(io, file->name);
- lib3ds_io_write_intd(io, file->frames);
- }
- { /*---- LIB3DS_KFSEG ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_KFSEG;
- c.size=14;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_intd(io, file->segment_from);
- lib3ds_io_write_intd(io, file->segment_to);
- }
- { /*---- LIB3DS_KFCURTIME ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_KFCURTIME;
- c.size=10;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_intd(io, file->current_frame);
- }
- lib3ds_viewport_write(&file->viewport_keyf, io);
-
- {
- Lib3dsNode *p;
- for (p=file->nodes; p!=0; p=p->next) {
- if (!lib3ds_node_write(p, file, io)) {
- return(LIB3DS_FALSE);
- }
- if (!nodes_write(p, file, io)) {
- return(LIB3DS_FALSE);
- }
- }
- }
-
- if (!lib3ds_chunk_write_end(&c,io)) {
- return(LIB3DS_FALSE);
- }
- return(LIB3DS_TRUE);
-}
-
-
-/*!
- * Write 3ds file data from a Lib3dsFile object to a file.
- *
- * \param file The Lib3dsFile object to be written.
- * \param io A Lib3dsIo object previously set up by the caller.
- *
- * \return LIB3DS_TRUE on success, LIB3DS_FALSE on failure.
- *
- * \ingroup file
- */
-Lib3dsBool
-lib3ds_file_write(Lib3dsFile *file, Lib3dsIo *io)
-{
- Lib3dsChunk c;
-
- c.chunk=LIB3DS_M3DMAGIC;
- if (!lib3ds_chunk_write_start(&c,io)) {
- LIB3DS_ERROR_LOG;
- return(LIB3DS_FALSE);
- }
-
- { /*---- LIB3DS_M3D_VERSION ----*/
- Lib3dsChunk c;
-
- c.chunk=LIB3DS_M3D_VERSION;
- c.size=10;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_dword(io, file->mesh_version);
- }
-
- if (!mdata_write(file, io)) {
- return(LIB3DS_FALSE);
- }
- if (!kfdata_write(file, io)) {
- return(LIB3DS_FALSE);
- }
-
- if (!lib3ds_chunk_write_end(&c,io)) {
- return(LIB3DS_FALSE);
- }
- return(LIB3DS_TRUE);
-}
-
-
-/*!
- * Insert a new Lib3dsMaterial object into the materials list of
- * a Lib3dsFile object.
- *
- * The new Lib3dsMaterial object is inserted into the materials list
- * in alphabetic order by name.
- *
- * \param file The Lib3dsFile object to be modified.
- * \param material The Lib3dsMaterial object to be inserted into file->materials
- *
- * \ingroup file
- */
-void
-lib3ds_file_insert_material(Lib3dsFile *file, Lib3dsMaterial *material)
-{
- Lib3dsMaterial *p,*q;
-
- ASSERT(file);
- ASSERT(material);
- ASSERT(!material->next);
-
- q=0;
- for (p=file->materials; p!=0; p=p->next) {
- if (strcmp(material->name, p->name)<0) {
- break;
- }
- q=p;
- }
- if (!q) {
- material->next=file->materials;
- file->materials=material;
- }
- else {
- material->next=q->next;
- q->next=material;
- }
-}
-
-
-/*!
- * Remove a Lib3dsMaterial object from the materials list of
- * a Lib3dsFile object.
- *
- * If the Lib3dsMaterial is not found in the materials list, nothing is
- * done (except that an error log message may be generated.)
- *
- * \param file The Lib3dsFile object to be modified.
- * \param material The Lib3dsMaterial object to be removed from file->materials
- *
- * \ingroup file
- */
-void
-lib3ds_file_remove_material(Lib3dsFile *file, Lib3dsMaterial *material)
-{
- Lib3dsMaterial *p,*q;
-
- ASSERT(file);
- ASSERT(material);
- ASSERT(file->materials);
- for (p=0,q=file->materials; q; p=q,q=q->next) {
- if (q==material) {
- break;
- }
- }
- if (!q) {
- ASSERT(LIB3DS_FALSE);
- return;
- }
- if (!p) {
- file->materials=material->next;
- }
- else {
- p->next=q->next;
- }
- material->next=0;
-}
-
-
-/*!
- * Return a Lib3dsMaterial object by name.
- *
- * \param file Lib3dsFile object to be searched.
- * \param name Name of the Lib3dsMaterial object to be searched for.
- *
- * \return A pointer to the named Lib3dsMaterial, or NULL if not found.
- *
- * \ingroup file
- */
-Lib3dsMaterial*
-lib3ds_file_material_by_name(Lib3dsFile *file, const char *name)
-{
- Lib3dsMaterial *p;
-
- ASSERT(file);
- for (p=file->materials; p!=0; p=p->next) {
- if (strcmp(p->name,name)==0) {
- return(p);
- }
- }
- return(0);
-}
-
-
-/*!
- * Dump all Lib3dsMaterial objects found in a Lib3dsFile object.
- *
- * \param file Lib3dsFile object to be dumped.
- *
- * \see lib3ds_material_dump
- *
- * \ingroup file
- */
-void
-lib3ds_file_dump_materials(Lib3dsFile *file)
-{
- Lib3dsMaterial *p;
-
- ASSERT(file);
- for (p=file->materials; p!=0; p=p->next) {
- lib3ds_material_dump(p);
- }
-}
-
-
-/*!
- * Insert a new Lib3dsMesh object into the meshes list of
- * a Lib3dsFile object.
- *
- * The new Lib3dsMesh object is inserted into the meshes list
- * in alphabetic order by name.
- *
- * \param file The Lib3dsFile object to be modified.
- * \param mesh The Lib3dsMesh object to be inserted into file->meshes
- *
- * \ingroup file
- */
-void
-lib3ds_file_insert_mesh(Lib3dsFile *file, Lib3dsMesh *mesh)
-{
- Lib3dsMesh *p,*q;
-
- ASSERT(file);
- ASSERT(mesh);
- ASSERT(!mesh->next);
-
- q=0;
- for (p=file->meshes; p!=0; p=p->next) {
- if (strcmp(mesh->name, p->name)<0) {
- break;
- }
- q=p;
- }
- if (!q) {
- mesh->next=file->meshes;
- file->meshes=mesh;
- }
- else {
- mesh->next=q->next;
- q->next=mesh;
- }
-}
-
-
-/*!
- * Remove a Lib3dsMesh object from the meshes list of
- * a Lib3dsFile object.
- *
- * If the Lib3dsMesh is not found in the meshes list, nothing is done
- * (except that an error log message may be generated.)
- *
- * \param file The Lib3dsFile object to be modified.
- * \param mesh The Lib3dsMesh object to be removed from file->meshes
- *
- * \ingroup file
- */
-void
-lib3ds_file_remove_mesh(Lib3dsFile *file, Lib3dsMesh *mesh)
-{
- Lib3dsMesh *p,*q;
-
- ASSERT(file);
- ASSERT(mesh);
- ASSERT(file->meshes);
- for (p=0,q=file->meshes; q; p=q,q=q->next) {
- if (q==mesh) {
- break;
- }
- }
- if (!q) {
- ASSERT(LIB3DS_FALSE);
- return;
- }
- if (!p) {
- file->meshes=mesh->next;
- }
- else {
- p->next=q->next;
- }
- mesh->next=0;
-}
-
-
-/*!
- * Return a Lib3dsMesh object from a Lib3dsFile by name.
- *
- * \param file Lib3dsFile object to be searched.
- * \param name Name of the Lib3dsMesh object to be searched for.
- *
- * \return A pointer to the named Lib3dsMesh, or NULL if not found.
- *
- * \ingroup file
- */
-Lib3dsMesh*
-lib3ds_file_mesh_by_name(Lib3dsFile *file, const char *name)
-{
- Lib3dsMesh *p;
-
- ASSERT(file);
- for (p=file->meshes; p!=0; p=p->next) {
- if (strcmp(p->name,name)==0) {
- return(p);
- }
- }
- return(0);
-}
-
-
-/*!
- * Dump all Lib3dsMesh objects found in a Lib3dsFile object.
- *
- * \param file Lib3dsFile object to be dumped.
- *
- * \see lib3ds_mesh_dump
- *
- * \ingroup file
- */
-void
-lib3ds_file_dump_meshes(Lib3dsFile *file)
-{
- Lib3dsMesh *p;
-
- ASSERT(file);
- for (p=file->meshes; p!=0; p=p->next) {
- lib3ds_mesh_dump(p);
- }
-}
-
-
-static void
-dump_instances(Lib3dsNode *node, const char* parent)
-{
- Lib3dsNode *p;
- char name[255];
-
- ASSERT(node);
- ASSERT(parent);
- strcpy(name, parent);
- strcat(name, ".");
- strcat(name, node->name);
- if (node->type==LIB3DS_OBJECT_NODE) {
- printf(" %s : %s\n", name, node->data.object.instance);
- }
- for (p=node->childs; p!=0; p=p->next) {
- dump_instances(p, parent);
- }
-}
-
-
-/*!
- * Dump all Lib3dsNode object names found in a Lib3dsFile object.
- *
- * For each node of type OBJECT_NODE, its name and data.object.instance
- * fields are printed to stdout. Consider using lib3ds_file_dump_nodes()
- * instead, as that function dumps more information.
- *
- * Nodes are dumped recursively.
- *
- * \param file Lib3dsFile object to be dumped.
- *
- * \see lib3ds_file_dump_nodes
- *
- * \ingroup file
- */
-void
-lib3ds_file_dump_instances(Lib3dsFile *file)
-{
- Lib3dsNode *p;
-
- ASSERT(file);
- for (p=file->nodes; p!=0; p=p->next) {
- dump_instances(p,"");
- }
-}
-
-
-/*!
- * Insert a new Lib3dsCamera object into the cameras list of
- * a Lib3dsFile object.
- *
- * The new Lib3dsCamera object is inserted into the cameras list
- * in alphabetic order by name.
- *
- * \param file The Lib3dsFile object to be modified.
- * \param camera The Lib3dsCamera object to be inserted into file->cameras
- *
- * \ingroup file
- */
-void
-lib3ds_file_insert_camera(Lib3dsFile *file, Lib3dsCamera *camera)
-{
- Lib3dsCamera *p,*q;
-
- ASSERT(file);
- ASSERT(camera);
- ASSERT(!camera->next);
-
- q=0;
- for (p=file->cameras; p!=0; p=p->next) {
- if (strcmp(camera->name, p->name)<0) {
- break;
- }
- q=p;
- }
- if (!q) {
- camera->next=file->cameras;
- file->cameras=camera;
- }
- else {
- camera->next=q->next;
- q->next=camera;
- }
-}
-
-
-/*!
- * Remove a Lib3dsCamera object from the cameras list of
- * a Lib3dsFile object.
- *
- * If the Lib3dsCamera is not found in the cameras list, nothing is done
- * (except that an error log message may be generated.)
- *
- * \param file The Lib3dsFile object to be modified.
- * \param camera The Lib3dsCamera object to be removed from file->cameras
- *
- * \ingroup file
- */
-void
-lib3ds_file_remove_camera(Lib3dsFile *file, Lib3dsCamera *camera)
-{
- Lib3dsCamera *p,*q;
-
- ASSERT(file);
- ASSERT(camera);
- ASSERT(file->cameras);
- for (p=0,q=file->cameras; q; p=q,q=q->next) {
- if (q==camera) {
- break;
- }
- }
- if (!q) {
- ASSERT(LIB3DS_FALSE);
- return;
- }
- if (!p) {
- file->cameras=camera->next;
- }
- else {
- p->next=q->next;
- }
- camera->next=0;
-}
-
-
-/*!
- * Return a Lib3dsCamera object from a Lib3dsFile by name.
- *
- * \param file Lib3dsFile object to be searched.
- * \param name Name of the Lib3dsCamera object to be searched for.
- *
- * \return A pointer to the named Lib3dsCamera, or NULL if not found.
- *
- * \ingroup file
- */
-Lib3dsCamera*
-lib3ds_file_camera_by_name(Lib3dsFile *file, const char *name)
-{
- Lib3dsCamera *p;
-
- ASSERT(file);
- for (p=file->cameras; p!=0; p=p->next) {
- if (strcmp(p->name,name)==0) {
- return(p);
- }
- }
- return(0);
-}
-
-
-/*!
- * Dump all Lib3dsCamera objects found in a Lib3dsFile object.
- *
- * \param file Lib3dsFile object to be dumped.
- *
- * \see lib3ds_camera_dump
- *
- * \ingroup file
- */
-void
-lib3ds_file_dump_cameras(Lib3dsFile *file)
-{
- Lib3dsCamera *p;
-
- ASSERT(file);
- for (p=file->cameras; p!=0; p=p->next) {
- lib3ds_camera_dump(p);
- }
-}
-
-
-/*!
- * Insert a new Lib3dsLight object into the lights list of
- * a Lib3dsFile object.
- *
- * The new Lib3dsLight object is inserted into the lights list
- * in alphabetic order by name.
- *
- * \param file The Lib3dsFile object to be modified.
- * \param light The Lib3dsLight object to be inserted into file->lights
- *
- * \ingroup file
- */
-void
-lib3ds_file_insert_light(Lib3dsFile *file, Lib3dsLight *light)
-{
- Lib3dsLight *p,*q;
-
- ASSERT(file);
- ASSERT(light);
- ASSERT(!light->next);
-
- q=0;
- for (p=file->lights; p!=0; p=p->next) {
- if (strcmp(light->name, p->name)<0) {
- break;
- }
- q=p;
- }
- if (!q) {
- light->next=file->lights;
- file->lights=light;
- }
- else {
- light->next=q->next;
- q->next=light;
- }
-}
-
-
-/*!
- * Remove a Lib3dsLight object from the lights list of
- * a Lib3dsFile object.
- *
- * If the Lib3dsLight is not found in the lights list, nothing is done
- * (except that an error log message may be generated.)
- *
- * \param file The Lib3dsFile object to be modified.
- * \param light The Lib3dsLight object to be removed from file->lights
- *
- * \ingroup file
- */
-void
-lib3ds_file_remove_light(Lib3dsFile *file, Lib3dsLight *light)
-{
- Lib3dsLight *p,*q;
-
- ASSERT(file);
- ASSERT(light);
- ASSERT(file->lights);
- for (p=0,q=file->lights; q; p=q,q=q->next) {
- if (q==light) {
- break;
- }
- }
- if (!q) {
- ASSERT(LIB3DS_FALSE);
- return;
- }
- if (!p) {
- file->lights=light->next;
- }
- else {
- p->next=q->next;
- }
- light->next=0;
-}
-
-
-/*!
- * Return a Lib3dsLight object from a Lib3dsFile by name.
- *
- * \param file Lib3dsFile object to be searched.
- * \param name Name of the Lib3dsLight object to be searched for.
- *
- * \return A pointer to the named Lib3dsLight, or NULL if not found.
- *
- * \ingroup file
- */
-Lib3dsLight*
-lib3ds_file_light_by_name(Lib3dsFile *file, const char *name)
-{
- Lib3dsLight *p;
-
- ASSERT(file);
- for (p=file->lights; p!=0; p=p->next) {
- if (strcmp(p->name,name)==0) {
- return(p);
- }
- }
- return(0);
-}
-
-
-/*!
- * Dump all Lib3dsLight objects found in a Lib3dsFile object.
- *
- * \param file Lib3dsFile object to be dumped.
- *
- * \see lib3ds_light_dump
- *
- * \ingroup file
- */
-void
-lib3ds_file_dump_lights(Lib3dsFile *file)
-{
- Lib3dsLight *p;
-
- ASSERT(file);
- for (p=file->lights; p!=0; p=p->next) {
- lib3ds_light_dump(p);
- }
-}
-
-
-/*!
- * Return a node object by name and type.
- *
- * This function performs a recursive search for the specified node.
- * Both name and type must match.
- *
- * \param file The Lib3dsFile to be searched.
- * \param name The target node name.
- * \param type The target node type
- *
- * \return A pointer to the first matching node, or NULL if not found.
- *
- * \see lib3ds_node_by_name
- *
- * \ingroup file
- */
-Lib3dsNode*
-lib3ds_file_node_by_name(Lib3dsFile *file, const char* name, Lib3dsNodeTypes type)
-{
- Lib3dsNode *p,*q;
-
- ASSERT(file);
- for (p=file->nodes; p!=0; p=p->next) {
- if ((p->type==type) && (strcmp(p->name, name)==0)) {
- return(p);
- }
- q=lib3ds_node_by_name(p, name, type);
- if (q) {
- return(q);
- }
- }
- return(0);
-}
-
-
-/*!
- * Return a node object by id.
- *
- * This function performs a recursive search for the specified node.
- *
- * \param file The Lib3dsFile to be searched.
- * \param node_id The target node id.
- *
- * \return A pointer to the first matching node, or NULL if not found.
- *
- * \see lib3ds_node_by_id
- *
- * \ingroup file
- */
-Lib3dsNode*
-lib3ds_file_node_by_id(Lib3dsFile *file, Lib3dsWord node_id)
-{
- Lib3dsNode *p,*q;
-
- ASSERT(file);
- for (p=file->nodes; p!=0; p=p->next) {
- if (p->node_id==node_id) {
- return(p);
- }
- q=lib3ds_node_by_id(p, node_id);
- if (q) {
- return(q);
- }
- }
- return(0);
-}
-
-
-/*!
- * Insert a new node into a Lib3dsFile object.
- *
- * If the node's parent_id structure is not LIB3DS_NO_PARENT and the
- * specified parent is found inside the Lib3dsFile object, then the
- * node is inserted as a child of that parent. If the parent_id
- * structure is LIB3DS_NO_PARENT or the specified parent is not found,
- * then the node is inserted at the top level.
- *
- * Node is inserted in alphabetic order by name.
- *
- * Finally, if any other top-level nodes in file specify this node as
- * their parent, they are relocated as a child of this node.
- *
- * \param file The Lib3dsFile object to be modified.
- * \param node The node to be inserted into file
- *
- * \ingroup file
- */
-void
-lib3ds_file_insert_node(Lib3dsFile *file, Lib3dsNode *node)
-{
- Lib3dsNode *parent,*p,*n;
-
- ASSERT(node);
- ASSERT(!node->next);
- ASSERT(!node->parent);
-
- parent=0;
- if (node->parent_id!=LIB3DS_NO_PARENT) {
- parent=lib3ds_file_node_by_id(file, node->parent_id);
- }
- node->parent=parent;
-
- if (!parent) {
- for (p=0,n=file->nodes; n!=0; p=n,n=n->next) {
- if (strcmp(n->name, node->name)>0) {
- break;
- }
- }
- if (!p) {
- node->next=file->nodes;
- file->nodes=node;
- }
- else {
- node->next=p->next;
- p->next=node;
- }
- }
- else {
- for (p=0,n=parent->childs; n!=0; p=n,n=n->next) {
- if (strcmp(n->name, node->name)>0) {
- break;
- }
- }
- if (!p) {
- node->next=parent->childs;
- parent->childs=node;
- }
- else {
- node->next=p->next;
- p->next=node;
- }
- }
-
- if (node->node_id!=LIB3DS_NO_PARENT) {
- for (n=file->nodes; n!=0; n=p) {
- p=n->next;
- if (n->parent_id==node->node_id) {
- lib3ds_file_remove_node(file, n);
- lib3ds_file_insert_node(file, n);
- }
- }
- }
-}
-
-
-/*!
- * Remove a node from the a Lib3dsFile object.
- *
- * \param file The Lib3dsFile object to be modified.
- * \param node The Lib3dsNode object to be removed from file
- *
- * \return LIB3DS_TRUE on success, LIB3DS_FALSE if node is not found in file
- *
- * \ingroup file
- */
-Lib3dsBool
-lib3ds_file_remove_node(Lib3dsFile *file, Lib3dsNode *node)
-{
- Lib3dsNode *p,*n;
-
- if (node->parent) {
- for (p=0,n=node->parent->childs; n; p=n,n=n->next) {
- if (n==node) {
- break;
- }
- }
- if (!n) {
- return(LIB3DS_FALSE);
- }
-
- if (!p) {
- node->parent->childs=n->next;
- }
- else {
- p->next=n->next;
- }
- }
- else {
- for (p=0,n=file->nodes; n; p=n,n=n->next) {
- if (n==node) {
- break;
- }
- }
- if (!n) {
- return(LIB3DS_FALSE);
- }
-
- if (!p) {
- file->nodes=n->next;
- }
- else {
- p->next=n->next;
- }
- }
- return(LIB3DS_TRUE);
-}
-
-
-/*!
- * This function computes the bounding box of meshes, cameras and lights
- * defined in the 3D editor.
- *
- * \param file The Lib3dsFile object to be examined.
- * \param include_meshes Include meshes in bounding box calculation.
- * \param include_cameras Include cameras in bounding box calculation.
- * \param include_lights Include lights in bounding box calculation.
- * \param bmin Returned minimum x,y,z values.
- * \param bmax Returned maximum x,y,z values.
- *
- * \ingroup file
- */
-void
-lib3ds_file_bounding_box_of_objects(Lib3dsFile *file, Lib3dsBool include_meshes,
- Lib3dsBool include_cameras, Lib3dsBool include_lights,
- Lib3dsVector bmin, Lib3dsVector bmax)
-{
- bmin[0] = bmin[1] = bmin[2] = FLT_MAX;
- bmax[0] = bmax[1] = bmax[2] = FLT_MIN;
-
- if (include_meshes) {
- Lib3dsVector lmin, lmax;
- Lib3dsMesh *p=file->meshes;
- while (p) {
- lib3ds_mesh_bounding_box(p, lmin, lmax);
- lib3ds_vector_min(bmin, lmin);
- lib3ds_vector_max(bmax, lmax);
- p=p->next;
- }
- }
- if (include_cameras) {
- Lib3dsCamera *p=file->cameras;
- while (p) {
- lib3ds_vector_min(bmin, p->position);
- lib3ds_vector_max(bmax, p->position);
- lib3ds_vector_min(bmin, p->target);
- lib3ds_vector_max(bmax, p->target);
- p=p->next;
- }
- }
- if (include_lights) {
- Lib3dsLight *p=file->lights;
- while (p) {
- lib3ds_vector_min(bmin, p->position);
- lib3ds_vector_max(bmax, p->position);
- if (p->spot_light) {
- lib3ds_vector_min(bmin, p->spot);
- lib3ds_vector_max(bmax, p->spot);
- }
- p=p->next;
- }
- }
-}
-
-
-static void
-file_bounding_box_of_nodes_impl(Lib3dsNode *node, Lib3dsFile *file, Lib3dsBool include_meshes,
- Lib3dsBool include_cameras, Lib3dsBool include_lights,
- Lib3dsVector bmin, Lib3dsVector bmax)
-{
- switch (node->type)
- {
- case LIB3DS_OBJECT_NODE:
- if (include_meshes) {
- Lib3dsMesh *mesh;
-
- mesh = lib3ds_file_mesh_by_name(file, node->data.object.instance);
- if (!mesh)
- mesh = lib3ds_file_mesh_by_name(file, node->name);
- if (mesh) {
- Lib3dsMatrix inv_matrix, M;
- Lib3dsVector v;
- unsigned i;
-
- lib3ds_matrix_copy(inv_matrix, mesh->matrix);
- lib3ds_matrix_inv(inv_matrix);
- lib3ds_matrix_copy(M, node->matrix);
- lib3ds_matrix_translate_xyz(M, -node->data.object.pivot[0], -node->data.object.pivot[1], -node->data.object.pivot[2]);
- lib3ds_matrix_mult(M, inv_matrix);
-
- for (i=0; i<mesh->points; ++i) {
- lib3ds_vector_transform(v, M, mesh->pointL[i].pos);
- lib3ds_vector_min(bmin, v);
- lib3ds_vector_max(bmax, v);
- }
- }
- }
- break;
- /*
- case LIB3DS_CAMERA_NODE:
- case LIB3DS_TARGET_NODE:
- if (include_cameras) {
- Lib3dsVector z,v;
- lib3ds_vector_zero(z);
- lib3ds_vector_transform(v, node->matrix, z);
- lib3ds_vector_min(bmin, v);
- lib3ds_vector_max(bmax, v);
- }
- break;
-
- case LIB3DS_LIGHT_NODE:
- case LIB3DS_SPOT_NODE:
- if (include_lights) {
- Lib3dsVector z,v;
- lib3ds_vector_zero(z);
- lib3ds_vector_transform(v, node->matrix, z);
- lib3ds_vector_min(bmin, v);
- lib3ds_vector_max(bmax, v);
- }
- break;
- */
- default: break;
- }
- {
- Lib3dsNode *p=node->childs;
- while (p) {
- file_bounding_box_of_nodes_impl(p, file, include_meshes, include_cameras, include_lights, bmin, bmax);
- p=p->next;
- }
- }
-}
-
-
-/*!
- * This function computes the bounding box of mesh, camera and light instances
- * defined in the Keyframer.
- *
- * \param file The Lib3dsFile object to be examined.
- * \param include_meshes Include meshes in bounding box calculation.
- * \param include_cameras Include cameras in bounding box calculation.
- * \param include_lights Include lights in bounding box calculation.
- * \param bmin Returned minimum x,y,z values.
- * \param bmax Returned maximum x,y,z values.
- *
- * \ingroup file
- */
-void
-lib3ds_file_bounding_box_of_nodes(Lib3dsFile *file, Lib3dsBool include_meshes,
- Lib3dsBool include_cameras, Lib3dsBool include_lights,
- Lib3dsVector bmin, Lib3dsVector bmax)
-{
- Lib3dsNode *p;
-
- bmin[0] = bmin[1] = bmin[2] = FLT_MAX;
- bmax[0] = bmax[1] = bmax[2] = FLT_MIN;
- p=file->nodes;
- while (p) {
- file_bounding_box_of_nodes_impl(p, file, include_meshes, include_cameras, include_lights, bmin, bmax);
- p=p->next;
- }
-}
-
-
-/*!
- * Dump all node objects found in a Lib3dsFile object.
- *
- * Nodes are dumped recursively.
- *
- * \param file Lib3dsFile object to be dumped.
- *
- * \see lib3ds_node_dump
- *
- * \ingroup file
- */
-void
-lib3ds_file_dump_nodes(Lib3dsFile *file)
-{
- Lib3dsNode *p;
-
- ASSERT(file);
- for (p=file->nodes; p!=0; p=p->next) {
- lib3ds_node_dump(p,1);
- }
-}
-
diff --git a/3rdparty/lib3ds/file.h b/3rdparty/lib3ds/file.h
deleted file mode 100644
index fa8138a1..00000000
--- a/3rdparty/lib3ds/file.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/* -*- c -*- */
-#ifndef INCLUDED_LIB3DS_FILE_H
-#define INCLUDED_LIB3DS_FILE_H
-/*
- * The 3D Studio File Format Library
- * Copyright (C) 1996-2007 by Jan Eric Kyprianidis <www.kyprianidis.com>
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id: file.h,v 1.24 2007/06/20 17:04:08 jeh Exp $
- */
-
-#ifndef INCLUDED_LIB3DS_BACKGROUND_H
-#include <lib3ds/background.h>
-#endif
-#ifndef INCLUDED_LIB3DS_ATMOSPHERE_H
-#include <lib3ds/atmosphere.h>
-#endif
-#ifndef INCLUDED_LIB3DS_SHADOW_H
-#include <lib3ds/shadow.h>
-#endif
-#ifndef INCLUDED_LIB3DS_VIEWPORT_H
-#include <lib3ds/viewport.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * 3DS file structure
- * \ingroup file
- */
-struct Lib3dsFile {
- Lib3dsDword mesh_version;
- Lib3dsWord keyf_revision;
- char name[12+1];
- Lib3dsFloat master_scale;
- Lib3dsVector construction_plane;
- Lib3dsRgb ambient;
- Lib3dsShadow shadow;
- Lib3dsBackground background;
- Lib3dsAtmosphere atmosphere;
- Lib3dsViewport viewport;
- Lib3dsViewport viewport_keyf;
- Lib3dsIntd frames;
- Lib3dsIntd segment_from;
- Lib3dsIntd segment_to;
- Lib3dsIntd current_frame;
- Lib3dsMaterial *materials;
- Lib3dsMesh *meshes;
- Lib3dsCamera *cameras;
- Lib3dsLight *lights;
- Lib3dsNode *nodes;
-};
-
-extern LIB3DSAPI Lib3dsFile* lib3ds_file_load(const char *filename);
-extern LIB3DSAPI Lib3dsBool lib3ds_file_save(Lib3dsFile *file, const char *filename);
-extern LIB3DSAPI Lib3dsFile* lib3ds_file_new();
-extern LIB3DSAPI void lib3ds_file_free(Lib3dsFile *file);
-extern LIB3DSAPI void lib3ds_file_eval(Lib3dsFile *file, Lib3dsFloat t);
-extern LIB3DSAPI Lib3dsBool lib3ds_file_read(Lib3dsFile *file, Lib3dsIo *io);
-extern LIB3DSAPI Lib3dsBool lib3ds_file_write(Lib3dsFile *file, Lib3dsIo *io);
-extern LIB3DSAPI void lib3ds_file_insert_material(Lib3dsFile *file, Lib3dsMaterial *material);
-extern LIB3DSAPI void lib3ds_file_remove_material(Lib3dsFile *file, Lib3dsMaterial *material);
-extern LIB3DSAPI Lib3dsMaterial* lib3ds_file_material_by_name(Lib3dsFile *file, const char *name);
-extern LIB3DSAPI void lib3ds_file_dump_materials(Lib3dsFile *file);
-extern LIB3DSAPI void lib3ds_file_insert_mesh(Lib3dsFile *file, Lib3dsMesh *mesh);
-extern LIB3DSAPI void lib3ds_file_remove_mesh(Lib3dsFile *file, Lib3dsMesh *mesh);
-extern LIB3DSAPI Lib3dsMesh* lib3ds_file_mesh_by_name(Lib3dsFile *file, const char *name);
-extern LIB3DSAPI void lib3ds_file_dump_meshes(Lib3dsFile *file);
-extern LIB3DSAPI void lib3ds_file_dump_instances(Lib3dsFile *file);
-extern LIB3DSAPI void lib3ds_file_insert_camera(Lib3dsFile *file, Lib3dsCamera *camera);
-extern LIB3DSAPI void lib3ds_file_remove_camera(Lib3dsFile *file, Lib3dsCamera *camera);
-extern LIB3DSAPI Lib3dsCamera* lib3ds_file_camera_by_name(Lib3dsFile *file, const char *name);
-extern LIB3DSAPI void lib3ds_file_dump_cameras(Lib3dsFile *file);
-extern LIB3DSAPI void lib3ds_file_insert_light(Lib3dsFile *file, Lib3dsLight *light);
-extern LIB3DSAPI void lib3ds_file_remove_light(Lib3dsFile *file, Lib3dsLight *light);
-extern LIB3DSAPI Lib3dsLight* lib3ds_file_light_by_name(Lib3dsFile *file, const char *name);
-extern LIB3DSAPI void lib3ds_file_dump_lights(Lib3dsFile *file);
-extern LIB3DSAPI Lib3dsNode* lib3ds_file_node_by_name(Lib3dsFile *file, const char* name, Lib3dsNodeTypes type);
-extern LIB3DSAPI Lib3dsNode* lib3ds_file_node_by_id(Lib3dsFile *file, Lib3dsWord node_id);
-extern LIB3DSAPI void lib3ds_file_insert_node(Lib3dsFile *file, Lib3dsNode *node);
-extern LIB3DSAPI Lib3dsBool lib3ds_file_remove_node(Lib3dsFile *file, Lib3dsNode *node);
-extern LIB3DSAPI void lib3ds_file_bounding_box_of_objects(Lib3dsFile *file, Lib3dsBool include_meshes, Lib3dsBool include_cameras, Lib3dsBool include_lights, Lib3dsVector bmin, Lib3dsVector bmax);
-extern LIB3DSAPI void lib3ds_file_bounding_box_of_nodes(Lib3dsFile *file, Lib3dsBool include_meshes, Lib3dsBool include_cameras, Lib3dsBool include_lights, Lib3dsVector bmin, Lib3dsVector bmax);
-extern LIB3DSAPI void lib3ds_file_dump_nodes(Lib3dsFile *file);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
-
diff --git a/3rdparty/lib3ds/io.c b/3rdparty/lib3ds/io.c
deleted file mode 100644
index 508b845b..00000000
--- a/3rdparty/lib3ds/io.c
+++ /dev/null
@@ -1,524 +0,0 @@
-/*
- * The 3D Studio File Format Library
- * Copyright (C) 1996-2007 by Jan Eric Kyprianidis <www.kyprianidis.com>
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id: io.c,v 1.9 2007/06/20 17:04:08 jeh Exp $
- */
-#include <lib3ds/io.h>
-#include <stdlib.h>
-#include <string.h>
-
-
-/*!
- * \defgroup io Binary Input/Ouput Abstraction Layer
- */
-
-typedef union {
- Lib3dsDword dword_value;
- Lib3dsFloat float_value;
-} Lib3dsDwordFloat;
-
-
-struct Lib3dsIo {
- void *self;
- Lib3dsIoErrorFunc error_func;
- Lib3dsIoSeekFunc seek_func;
- Lib3dsIoTellFunc tell_func;
- Lib3dsIoReadFunc read_func;
- Lib3dsIoWriteFunc write_func;
-};
-
-
-Lib3dsIo*
-lib3ds_io_new(void *self, Lib3dsIoErrorFunc error_func, Lib3dsIoSeekFunc seek_func,
- Lib3dsIoTellFunc tell_func, Lib3dsIoReadFunc read_func, Lib3dsIoWriteFunc write_func)
-{
- Lib3dsIo *io = calloc(sizeof(Lib3dsIo),1);
- ASSERT(io);
- if (!io) {
- return 0;
- }
-
- io->self = self;
- io->error_func = error_func;
- io->seek_func = seek_func;
- io->tell_func = tell_func;
- io->read_func = read_func;
- io->write_func = write_func;
-
- return io;
-}
-
-
-void
-lib3ds_io_free(Lib3dsIo *io)
-{
- ASSERT(io);
- if (!io) {
- return;
- }
- free(io);
-}
-
-
-Lib3dsBool
-lib3ds_io_error(Lib3dsIo *io)
-{
- ASSERT(io);
- if (!io || !io->error_func) {
- return 0;
- }
- return (*io->error_func)(io->self);
-}
-
-
-long
-lib3ds_io_seek(Lib3dsIo *io, long offset, Lib3dsIoSeek origin)
-{
- ASSERT(io);
- if (!io || !io->seek_func) {
- return 0;
- }
- return (*io->seek_func)(io->self, offset, origin);
-}
-
-
-long
-lib3ds_io_tell(Lib3dsIo *io)
-{
- ASSERT(io);
- if (!io || !io->tell_func) {
- return 0;
- }
- return (*io->tell_func)(io->self);
-}
-
-
-size_t
-lib3ds_io_read(Lib3dsIo *io, void *buffer, size_t size)
-{
- ASSERT(io);
- if (!io || !io->read_func) {
- return 0;
- }
- return (*io->read_func)(io->self, buffer, size);
-}
-
-
-size_t
-lib3ds_io_write(Lib3dsIo *io, const void *buffer, size_t size)
-{
- ASSERT(io);
- if (!io || !io->write_func) {
- return 0;
- }
- return (*io->write_func)(io->self, buffer, size);
-}
-
-
-/*!
- * \ingroup io
- *
- * Read a byte from a file stream.
- */
-Lib3dsByte
-lib3ds_io_read_byte(Lib3dsIo *io)
-{
- Lib3dsByte b;
-
- ASSERT(io);
- lib3ds_io_read(io, &b, 1);
- return(b);
-}
-
-
-/**
- * Read a word from a file stream in little endian format.
- */
-Lib3dsWord
-lib3ds_io_read_word(Lib3dsIo *io)
-{
- Lib3dsByte b[2];
- Lib3dsWord w;
-
- ASSERT(io);
- lib3ds_io_read(io, b, 2);
- w=((Lib3dsWord)b[1] << 8) |
- ((Lib3dsWord)b[0]);
- return(w);
-}
-
-
-/*!
- * \ingroup io
- *
- * Read a dword from file a stream in little endian format.
- */
-Lib3dsDword
-lib3ds_io_read_dword(Lib3dsIo *io)
-{
- Lib3dsByte b[4];
- Lib3dsDword d;
-
- ASSERT(io);
- lib3ds_io_read(io, b, 4);
- d=((Lib3dsDword)b[3] << 24) |
- ((Lib3dsDword)b[2] << 16) |
- ((Lib3dsDword)b[1] << 8) |
- ((Lib3dsDword)b[0]);
- return(d);
-}
-
-
-/*!
- * \ingroup io
- *
- * Read a signed byte from a file stream.
- */
-Lib3dsIntb
-lib3ds_io_read_intb(Lib3dsIo *io)
-{
- Lib3dsIntb b;
-
- ASSERT(io);
- lib3ds_io_read(io, &b, 1);
- return(b);
-}
-
-
-/*!
- * \ingroup io
- *
- * Read a signed word from a file stream in little endian format.
- */
-Lib3dsIntw
-lib3ds_io_read_intw(Lib3dsIo *io)
-{
- Lib3dsByte b[2];
- Lib3dsWord w;
-
- ASSERT(io);
- lib3ds_io_read(io, b, 2);
- w=((Lib3dsWord)b[1] << 8) |
- ((Lib3dsWord)b[0]);
- return((Lib3dsIntw)w);
-}
-
-
-/*!
- * \ingroup io
- *
- * Read a signed dword a from file stream in little endian format.
- */
-Lib3dsIntd
-lib3ds_io_read_intd(Lib3dsIo *io)
-{
- Lib3dsByte b[4];
- Lib3dsDword d;
-
- ASSERT(io);
- lib3ds_io_read(io, b, 4);
- d=((Lib3dsDword)b[3] << 24) |
- ((Lib3dsDword)b[2] << 16) |
- ((Lib3dsDword)b[1] << 8) |
- ((Lib3dsDword)b[0]);
- return((Lib3dsIntd)d);
-}
-
-
-/*!
- * \ingroup io
- *
- * Read a float from a file stream in little endian format.
- */
-Lib3dsFloat
-lib3ds_io_read_float(Lib3dsIo *io)
-{
- Lib3dsByte b[4];
- Lib3dsDwordFloat d;
-
- ASSERT(io);
- lib3ds_io_read(io, b, 4);
- d.dword_value=((Lib3dsDword)b[3] << 24) |
- ((Lib3dsDword)b[2] << 16) |
- ((Lib3dsDword)b[1] << 8) |
- ((Lib3dsDword)b[0]);
- return d.float_value;
-}
-
-
-/*!
- * \ingroup io
- *
- * Read a vector from a file stream in little endian format.
- *
- * \param io IO input handle.
- * \param v The vector to store the data.
- */
-Lib3dsBool
-lib3ds_io_read_vector(Lib3dsIo *io, Lib3dsVector v)
-{
- ASSERT(io);
-
- v[0]=lib3ds_io_read_float(io);
- v[1]=lib3ds_io_read_float(io);
- v[2]=lib3ds_io_read_float(io);
-
- return(!lib3ds_io_error(io));
-}
-
-
-/*!
- * \ingroup io
- */
-Lib3dsBool
-lib3ds_io_read_rgb(Lib3dsIo *io, Lib3dsRgb rgb)
-{
- ASSERT(io);
-
- rgb[0]=lib3ds_io_read_float(io);
- rgb[1]=lib3ds_io_read_float(io);
- rgb[2]=lib3ds_io_read_float(io);
-
- return(!lib3ds_io_error(io));
-}
-
-
-/*!
- * \ingroup io
- *
- * Read a zero-terminated string from a file stream.
- *
- * \param io IO input handle.
- * \param s The buffer to store the read string.
- * \param buflen Buffer length.
- *
- * \return True on success, False otherwise.
- */
-Lib3dsBool
-lib3ds_io_read_string(Lib3dsIo *io, char *s, int buflen)
-{
- char c;
- int k=0;
-
- ASSERT(io);
- for (;;) {
- if (lib3ds_io_read(io, &c, 1)!=1) {
- return LIB3DS_FALSE;
- }
- *s++ = c;
- if (!c) {
- break;
- }
- ++k;
- if (k>=buflen) {
- return(LIB3DS_FALSE);
- }
- }
-
- return(!lib3ds_io_error(io));
-}
-
-
-/*!
- * \ingroup io
- *
- * Writes a byte into a file stream.
- */
-Lib3dsBool
-lib3ds_io_write_byte(Lib3dsIo *io, Lib3dsByte b)
-{
- ASSERT(io);
- if (lib3ds_io_write(io, &b, 1)!=1) {
- return(LIB3DS_FALSE);
- }
- return(LIB3DS_TRUE);
-}
-
-
-/*!
- * \ingroup io
- *
- * Writes a word into a little endian file stream.
- */
-Lib3dsBool
-lib3ds_io_write_word(Lib3dsIo *io, Lib3dsWord w)
-{
- Lib3dsByte b[2];
-
- ASSERT(io);
- b[1]=((Lib3dsWord)w & 0xFF00) >> 8;
- b[0]=((Lib3dsWord)w & 0x00FF);
- if (lib3ds_io_write(io, b, 2)!=2) {
- return(LIB3DS_FALSE);
- }
- return(LIB3DS_TRUE);
-}
-
-
-/*!
- * \ingroup io
- *
- * Writes a dword into a little endian file stream.
- */
-Lib3dsBool
-lib3ds_io_write_dword(Lib3dsIo *io, Lib3dsDword d)
-{
- Lib3dsByte b[4];
-
- ASSERT(io);
- b[3]=(Lib3dsByte)(((Lib3dsDword)d & 0xFF000000) >> 24);
- b[2]=(Lib3dsByte)(((Lib3dsDword)d & 0x00FF0000) >> 16);
- b[1]=(Lib3dsByte)(((Lib3dsDword)d & 0x0000FF00) >> 8);
- b[0]=(Lib3dsByte)(((Lib3dsDword)d & 0x000000FF));
- if (lib3ds_io_write(io, b, 4)!=4) {
- return(LIB3DS_FALSE);
- }
- return(LIB3DS_TRUE);
-}
-
-
-/*!
- * \ingroup io
- *
- * Writes a signed byte in a file stream.
- */
-Lib3dsBool
-lib3ds_io_write_intb(Lib3dsIo *io, Lib3dsIntb b)
-{
- ASSERT(io);
- if (lib3ds_io_write(io, &b, 1)!=1) {
- return(LIB3DS_FALSE);
- }
- return(LIB3DS_TRUE);
-}
-
-
-/*!
- * \ingroup io
- *
- * Writes a signed word into a little endian file stream.
- */
-Lib3dsBool
-lib3ds_io_write_intw(Lib3dsIo *io, Lib3dsIntw w)
-{
- Lib3dsByte b[2];
-
- ASSERT(io);
- b[1]=((Lib3dsWord)w & 0xFF00) >> 8;
- b[0]=((Lib3dsWord)w & 0x00FF);
- if (lib3ds_io_write(io, b, 2)!=2) {
- return(LIB3DS_FALSE);
- }
- return(LIB3DS_TRUE);
-}
-
-
-/*!
- * \ingroup io
- *
- * Writes a signed dword into a little endian file stream.
- */
-Lib3dsBool
-lib3ds_io_write_intd(Lib3dsIo *io, Lib3dsIntd d)
-{
- Lib3dsByte b[4];
-
- ASSERT(io);
- b[3]=(Lib3dsByte)(((Lib3dsDword)d & 0xFF000000) >> 24);
- b[2]=(Lib3dsByte)(((Lib3dsDword)d & 0x00FF0000) >> 16);
- b[1]=(Lib3dsByte)(((Lib3dsDword)d & 0x0000FF00) >> 8);
- b[0]=(Lib3dsByte)(((Lib3dsDword)d & 0x000000FF));
- if (lib3ds_io_write(io, b, 4)!=4) {
- return(LIB3DS_FALSE);
- }
- return(LIB3DS_TRUE);
-}
-
-
-/*!
- * \ingroup io
- *
- * Writes a float into a little endian file stream.
- */
-Lib3dsBool
-lib3ds_io_write_float(Lib3dsIo *io, Lib3dsFloat l)
-{
- Lib3dsByte b[4];
- Lib3dsDwordFloat d;
-
- ASSERT(io);
- d.float_value=l;
- b[3]=(Lib3dsByte)(((Lib3dsDword)d.dword_value & 0xFF000000) >> 24);
- b[2]=(Lib3dsByte)(((Lib3dsDword)d.dword_value & 0x00FF0000) >> 16);
- b[1]=(Lib3dsByte)(((Lib3dsDword)d.dword_value & 0x0000FF00) >> 8);
- b[0]=(Lib3dsByte)(((Lib3dsDword)d.dword_value & 0x000000FF));
- if (lib3ds_io_write(io, b, 4)!=4) {
- return(LIB3DS_FALSE);
- }
- return(LIB3DS_TRUE);
-}
-
-
-/*!
- * \ingroup io
- *
- * Writes a vector into a file stream in little endian format.
- */
-Lib3dsBool
-lib3ds_io_write_vector(Lib3dsIo *io, Lib3dsVector v)
-{
- int i;
- for (i=0; i<3; ++i) {
- if (!lib3ds_io_write_float(io, v[i])) {
- return(LIB3DS_FALSE);
- }
- }
- return(LIB3DS_TRUE);
-}
-
-
-/*!
- * \ingroup io
- */
-Lib3dsBool
-lib3ds_io_write_rgb(Lib3dsIo *io, Lib3dsRgb rgb)
-{
- int i;
- for (i=0; i<3; ++i) {
- if (!lib3ds_io_write_float(io, rgb[i])) {
- return(LIB3DS_FALSE);
- }
- }
- return(LIB3DS_TRUE);
-}
-
-
-/*!
- * \ingroup io
- *
- * Writes a zero-terminated string into a file stream.
- */
-Lib3dsBool
-lib3ds_io_write_string(Lib3dsIo *io, const char *s)
-{
- ASSERT(s);
- ASSERT(io);
- lib3ds_io_write(io, s, strlen(s)+1);
- return(!lib3ds_io_error(io));
-}
diff --git a/3rdparty/lib3ds/io.h b/3rdparty/lib3ds/io.h
deleted file mode 100644
index b69a973a..00000000
--- a/3rdparty/lib3ds/io.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/* -*- c -*- */
-#ifndef INCLUDED_LIB3DS_IO_H
-#define INCLUDED_LIB3DS_IO_H
-/*
- * The 3D Studio File Format Library
- * Copyright (C) 1996-2007 by Jan Eric Kyprianidis <www.kyprianidis.com>
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id: io.h,v 1.6 2007/06/20 17:04:08 jeh Exp $
- */
-
-#ifndef INCLUDED_LIB3DS_TYPES_H
-#include <lib3ds/types.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef enum Lib3dsIoSeek {
- LIB3DS_SEEK_SET =0,
- LIB3DS_SEEK_CUR =1,
- LIB3DS_SEEK_END =2
-} Lib3dsIoSeek;
-
-typedef Lib3dsBool (*Lib3dsIoErrorFunc)(void *self);
-typedef long (*Lib3dsIoSeekFunc)(void *self, long offset, Lib3dsIoSeek origin);
-typedef long (*Lib3dsIoTellFunc)(void *self);
-typedef size_t (*Lib3dsIoReadFunc)(void *self, void *buffer, size_t size);
-typedef size_t (*Lib3dsIoWriteFunc)(void *self, const void *buffer, size_t size);
-
-extern LIB3DSAPI Lib3dsIo* lib3ds_io_new(void *self, Lib3dsIoErrorFunc error_func,
- Lib3dsIoSeekFunc seek_func, Lib3dsIoTellFunc tell_func,
- Lib3dsIoReadFunc read_func, Lib3dsIoWriteFunc write_func);
-extern LIB3DSAPI void lib3ds_io_free(Lib3dsIo *io);
-extern LIB3DSAPI Lib3dsBool lib3ds_io_error(Lib3dsIo *io);
-extern LIB3DSAPI long lib3ds_io_seek(Lib3dsIo *io, long offset, Lib3dsIoSeek origin);
-extern LIB3DSAPI long lib3ds_io_tell(Lib3dsIo *io);
-extern LIB3DSAPI size_t lib3ds_io_read(Lib3dsIo *io, void *buffer, size_t size);
-extern LIB3DSAPI size_t lib3ds_io_write(Lib3dsIo *io, const void *buffer, size_t size);
-
-extern LIB3DSAPI Lib3dsByte lib3ds_io_read_byte(Lib3dsIo *io);
-extern LIB3DSAPI Lib3dsWord lib3ds_io_read_word(Lib3dsIo *io);
-extern LIB3DSAPI Lib3dsDword lib3ds_io_read_dword(Lib3dsIo *io);
-extern LIB3DSAPI Lib3dsIntb lib3ds_io_read_intb(Lib3dsIo *io);
-extern LIB3DSAPI Lib3dsIntw lib3ds_io_read_intw(Lib3dsIo *io);
-extern LIB3DSAPI Lib3dsIntd lib3ds_io_read_intd(Lib3dsIo *io);
-extern LIB3DSAPI Lib3dsFloat lib3ds_io_read_float(Lib3dsIo *io);
-extern LIB3DSAPI Lib3dsBool lib3ds_io_read_vector(Lib3dsIo *io, Lib3dsVector v);
-extern LIB3DSAPI Lib3dsBool lib3ds_io_read_rgb(Lib3dsIo *io, Lib3dsRgb rgb);
-extern LIB3DSAPI Lib3dsBool lib3ds_io_read_string(Lib3dsIo *io, char *s, int buflen);
-
-extern LIB3DSAPI Lib3dsBool lib3ds_io_write_byte(Lib3dsIo *io, Lib3dsByte b);
-extern LIB3DSAPI Lib3dsBool lib3ds_io_write_word(Lib3dsIo *io, Lib3dsWord w);
-extern LIB3DSAPI Lib3dsBool lib3ds_io_write_dword(Lib3dsIo *io, Lib3dsDword d);
-extern LIB3DSAPI Lib3dsBool lib3ds_io_write_intb(Lib3dsIo *io, Lib3dsIntb b);
-extern LIB3DSAPI Lib3dsBool lib3ds_io_write_intw(Lib3dsIo *io, Lib3dsIntw w);
-extern LIB3DSAPI Lib3dsBool lib3ds_io_write_intd(Lib3dsIo *io, Lib3dsIntd d);
-extern LIB3DSAPI Lib3dsBool lib3ds_io_write_float(Lib3dsIo *io, Lib3dsFloat l);
-extern LIB3DSAPI Lib3dsBool lib3ds_io_write_vector(Lib3dsIo *io, Lib3dsVector v);
-extern LIB3DSAPI Lib3dsBool lib3ds_io_write_rgb(Lib3dsIo *io, Lib3dsRgb rgb);
-extern LIB3DSAPI Lib3dsBool lib3ds_io_write_string(Lib3dsIo *io, const char *s);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
-
diff --git a/3rdparty/lib3ds/lib3ds.pri b/3rdparty/lib3ds/lib3ds.pri
deleted file mode 100644
index 4f08f981..00000000
--- a/3rdparty/lib3ds/lib3ds.pri
+++ /dev/null
@@ -1,44 +0,0 @@
-INCLUDEPATH += $$PWD $$PWD/..
-VPATH += $$PWD
-
-HEADERS += \
- atmosphere.h \
- background.h \
- camera.h \
- chunk.h \
- chunktable.h \
- ease.h \
- file.h \
- io.h \
- light.h \
- material.h \
- matrix.h \
- mesh.h \
- node.h \
- quat.h \
- shadow.h \
- tcb.h \
- tracks.h \
- types.h \
- vector.h \
- viewport.h
-
-SOURCES += \
- atmosphere.c \
- background.c \
- camera.c \
- chunk.c \
- ease.c \
- file.c \
- io.c \
- light.c \
- material.c \
- matrix.c \
- mesh.c \
- node.c \
- quat.c \
- shadow.c \
- tcb.c \
- tracks.c \
- vector.c \
- viewport.c
diff --git a/3rdparty/lib3ds/light.c b/3rdparty/lib3ds/light.c
deleted file mode 100644
index 99a3ee68..00000000
--- a/3rdparty/lib3ds/light.c
+++ /dev/null
@@ -1,414 +0,0 @@
-/*
- * The 3D Studio File Format Library
- * Copyright (C) 1996-2007 by Jan Eric Kyprianidis <www.kyprianidis.com>
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id: light.c,v 1.15 2007/06/20 17:04:08 jeh Exp $
- */
-#include <lib3ds/light.h>
-#include <lib3ds/chunk.h>
-#include <lib3ds/io.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-
-/*!
- * \defgroup light Lights
- */
-
-
-/*!
- * \ingroup light
- */
-Lib3dsLight*
-lib3ds_light_new(const char *name)
-{
- Lib3dsLight *light;
-
- ASSERT(name);
- ASSERT(strlen(name)<64);
-
- light=(Lib3dsLight*)calloc(sizeof(Lib3dsLight), 1);
- if (!light) {
- return(0);
- }
- strcpy(light->name, name);
- return(light);
-}
-
-
-/*!
- * \ingroup light
- */
-void
-lib3ds_light_free(Lib3dsLight *light)
-{
- memset(light, 0, sizeof(Lib3dsLight));
- free(light);
-}
-
-
-/*!
- * \ingroup light
- */
-void
-lib3ds_light_dump(Lib3dsLight *light)
-{
- ASSERT(light);
- printf(" name: %s\n", light->name);
- printf(" spot_light: %s\n", light->spot_light ? "yes" : "no");
- printf(" see_cone: %s\n", light->see_cone ? "yes" : "no");
- printf(" color: (%f, %f, %f)\n",
- light->color[0], light->color[1], light->color[2]);
- printf(" position (%f, %f, %f)\n",
- light->position[0], light->position[1], light->position[2]);
- printf(" spot (%f, %f, %f)\n",
- light->spot[0], light->spot[1], light->spot[2]);
- printf(" roll: %f\n", light->roll);
- printf(" off: %s\n", light->off ? "yes" : "no");
- printf(" outer_range: %f\n", light->outer_range);
- printf(" inner_range: %f\n", light->inner_range);
- printf(" multiplier: %f\n", light->multiplier);
- printf(" attenuation: %f\n", light->attenuation);
- printf(" rectangular_spot: %s\n", light->rectangular_spot ? "yes" : "no");
- printf(" shadowed: %s\n", light->shadowed ? "yes" : "no");
- printf(" shadow_bias: %f\n", light->shadow_bias);
- printf(" shadow_filter: %f\n", light->shadow_filter);
- printf(" shadow_size: %d\n", light->shadow_size);
- printf(" spot_aspect: %f\n", light->spot_aspect);
- printf(" use_projector: %s\n", light->use_projector ? "yes" : "no");
- printf(" projector: %s\n", light->projector);
- printf(" spot_overshoot: %d\n", (int)light->spot_overshoot);
- printf(" ray_shadows: %s\n", light->ray_shadows ? "yes" : "no");
- printf(" ray_bias: %f\n", light->ray_bias);
- printf(" hot_spot: %f\n", light->hot_spot);
- printf(" fall_off: %f\n", light->fall_off);
- printf("\n");
-}
-
-
-/*!
- * \ingroup light
- */
-static Lib3dsBool
-spotlight_read(Lib3dsLight *light, Lib3dsIo *io)
-{
- Lib3dsChunk c;
- Lib3dsWord chunk;
- int i;
-
- if (!lib3ds_chunk_read_start(&c, LIB3DS_DL_SPOTLIGHT, io)) {
- return(LIB3DS_FALSE);
- }
- light->spot_light=LIB3DS_TRUE;
- for (i=0; i<3; ++i) {
- light->spot[i]=lib3ds_io_read_float(io);
- }
- light->hot_spot = lib3ds_io_read_float(io);
- light->fall_off = lib3ds_io_read_float(io);
- lib3ds_chunk_read_tell(&c, io);
-
- while ((chunk=lib3ds_chunk_read_next(&c, io))!=0) {
- switch (chunk) {
- case LIB3DS_DL_SPOT_ROLL:
- {
- light->roll=lib3ds_io_read_float(io);
- }
- break;
- case LIB3DS_DL_SHADOWED:
- {
- light->shadowed=LIB3DS_TRUE;
- }
- break;
- case LIB3DS_DL_LOCAL_SHADOW2:
- {
- light->shadow_bias=lib3ds_io_read_float(io);
- light->shadow_filter=lib3ds_io_read_float(io);
- light->shadow_size=lib3ds_io_read_intw(io);
- }
- break;
- case LIB3DS_DL_SEE_CONE:
- {
- light->see_cone=LIB3DS_TRUE;
- }
- break;
- case LIB3DS_DL_SPOT_RECTANGULAR:
- {
- light->rectangular_spot=LIB3DS_TRUE;
- }
- break;
- case LIB3DS_DL_SPOT_ASPECT:
- {
- light->spot_aspect=lib3ds_io_read_float(io);
- }
- break;
- case LIB3DS_DL_SPOT_PROJECTOR:
- {
- light->use_projector=LIB3DS_TRUE;
- if (!lib3ds_io_read_string(io, light->projector, 64)) {
- return(LIB3DS_FALSE);
- }
- }
- case LIB3DS_DL_SPOT_OVERSHOOT:
- {
- light->spot_overshoot=LIB3DS_TRUE;
- }
- break;
- case LIB3DS_DL_RAY_BIAS:
- {
- light->ray_bias=lib3ds_io_read_float(io);
- }
- break;
- case LIB3DS_DL_RAYSHAD:
- {
- light->ray_shadows=LIB3DS_TRUE;
- }
- break;
- default:
- lib3ds_chunk_unknown(chunk);
- }
- }
-
- lib3ds_chunk_read_end(&c, io);
- return(LIB3DS_TRUE);
-}
-
-
-/*!
- * \ingroup light
- */
-Lib3dsBool
-lib3ds_light_read(Lib3dsLight *light, Lib3dsIo *io)
-{
- Lib3dsChunk c;
- Lib3dsWord chunk;
-
- if (!lib3ds_chunk_read_start(&c, LIB3DS_N_DIRECT_LIGHT, io)) {
- return(LIB3DS_FALSE);
- }
- {
- int i;
- for (i=0; i<3; ++i) {
- light->position[i]=lib3ds_io_read_float(io);
- }
- }
- lib3ds_chunk_read_tell(&c, io);
-
- while ((chunk=lib3ds_chunk_read_next(&c, io))!=0) {
- switch (chunk) {
- case LIB3DS_COLOR_F:
- {
- int i;
- for (i=0; i<3; ++i) {
- light->color[i]=lib3ds_io_read_float(io);
- }
- }
- break;
- case LIB3DS_DL_OFF:
- {
- light->off=LIB3DS_TRUE;
- }
- break;
- case LIB3DS_DL_OUTER_RANGE:
- {
- light->outer_range=lib3ds_io_read_float(io);
- }
- break;
- case LIB3DS_DL_INNER_RANGE:
- {
- light->inner_range=lib3ds_io_read_float(io);
- }
- break;
- case LIB3DS_DL_MULTIPLIER:
- {
- light->multiplier=lib3ds_io_read_float(io);
- }
- break;
- case LIB3DS_DL_EXCLUDE:
- {
- /* FIXME: */
- lib3ds_chunk_unknown(chunk);
- }
- case LIB3DS_DL_ATTENUATE:
- {
- light->attenuation=lib3ds_io_read_float(io);
- }
- break;
- case LIB3DS_DL_SPOTLIGHT:
- {
- lib3ds_chunk_read_reset(&c, io);
- if (!spotlight_read(light, io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- default:
- lib3ds_chunk_unknown(chunk);
- }
- }
-
- lib3ds_chunk_read_end(&c, io);
- return(LIB3DS_TRUE);
-}
-
-
-/*!
- * \ingroup light
- */
-Lib3dsBool
-lib3ds_light_write(Lib3dsLight *light, Lib3dsIo *io)
-{
- Lib3dsChunk c;
-
- c.chunk=LIB3DS_N_DIRECT_LIGHT;
- if (!lib3ds_chunk_write_start(&c,io)) {
- return(LIB3DS_FALSE);
- }
- lib3ds_io_write_vector(io, light->position);
- { /*---- LIB3DS_COLOR_F ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_COLOR_F;
- c.size=18;
- lib3ds_chunk_write(&c, io);
- lib3ds_io_write_rgb(io, light->color);
- }
- if (light->off) { /*---- LIB3DS_DL_OFF ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_DL_OFF;
- c.size=6;
- lib3ds_chunk_write(&c, io);
- }
- { /*---- LIB3DS_DL_OUTER_RANGE ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_DL_OUTER_RANGE;
- c.size=10;
- lib3ds_chunk_write(&c, io);
- lib3ds_io_write_float(io, light->outer_range);
- }
- { /*---- LIB3DS_DL_INNER_RANGE ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_DL_INNER_RANGE;
- c.size=10;
- lib3ds_chunk_write(&c, io);
- lib3ds_io_write_float(io, light->inner_range);
- }
- { /*---- LIB3DS_DL_MULTIPLIER ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_DL_MULTIPLIER;
- c.size=10;
- lib3ds_chunk_write(&c, io);
- lib3ds_io_write_float(io, light->multiplier);
- }
- if (light->attenuation) { /*---- LIB3DS_DL_ATTENUATE ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_DL_ATTENUATE;
- c.size=6;
- lib3ds_chunk_write(&c, io);
- }
-
- if (light->spot_light) {
- Lib3dsChunk c;
-
- c.chunk=LIB3DS_DL_SPOTLIGHT;
- if (!lib3ds_chunk_write_start(&c,io)) {
- return(LIB3DS_FALSE);
- }
- lib3ds_io_write_vector(io, light->spot);
- lib3ds_io_write_float(io, light->hot_spot);
- lib3ds_io_write_float(io, light->fall_off);
-
- { /*---- LIB3DS_DL_SPOT_ROLL ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_DL_SPOT_ROLL;
- c.size=10;
- lib3ds_chunk_write(&c, io);
- lib3ds_io_write_float(io, light->roll);
- }
- if (light->shadowed) { /*---- LIB3DS_DL_SHADOWED ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_DL_SHADOWED;
- c.size=6;
- lib3ds_chunk_write(&c, io);
- }
- if ((fabs(light->shadow_bias)>LIB3DS_EPSILON) ||
- (fabs(light->shadow_filter)>LIB3DS_EPSILON) ||
- (light->shadow_size!=0)) { /*---- LIB3DS_DL_LOCAL_SHADOW2 ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_DL_LOCAL_SHADOW2;
- c.size=16;
- lib3ds_chunk_write(&c, io);
- lib3ds_io_write_float(io, light->shadow_bias);
- lib3ds_io_write_float(io, light->shadow_filter);
- lib3ds_io_write_intw(io, light->shadow_size);
- }
- if (light->see_cone) { /*---- LIB3DS_DL_SEE_CONE ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_DL_SEE_CONE;
- c.size=6;
- lib3ds_chunk_write(&c, io);
- }
- if (light->rectangular_spot) { /*---- LIB3DS_DL_SPOT_RECTANGULAR ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_DL_SPOT_RECTANGULAR;
- c.size=6;
- lib3ds_chunk_write(&c, io);
- }
- if (fabs(light->spot_aspect)>LIB3DS_EPSILON) { /*---- LIB3DS_DL_SPOT_ASPECT ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_DL_SPOT_ASPECT;
- c.size=10;
- lib3ds_chunk_write(&c, io);
- lib3ds_io_write_float(io, light->spot_aspect);
- }
- if (light->use_projector) { /*---- LIB3DS_DL_SPOT_PROJECTOR ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_DL_SPOT_PROJECTOR;
- c.size=10;
- lib3ds_chunk_write(&c, io);
- lib3ds_io_write_string(io, light->projector);
- }
- if (light->spot_overshoot) { /*---- LIB3DS_DL_SPOT_OVERSHOOT ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_DL_SPOT_OVERSHOOT;
- c.size=6;
- lib3ds_chunk_write(&c, io);
- }
- if (fabs(light->ray_bias)>LIB3DS_EPSILON) { /*---- LIB3DS_DL_RAY_BIAS ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_DL_RAY_BIAS;
- c.size=10;
- lib3ds_chunk_write(&c, io);
- lib3ds_io_write_float(io, light->ray_bias);
- }
- if (light->ray_shadows) { /*---- LIB3DS_DL_RAYSHAD ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_DL_RAYSHAD;
- c.size=6;
- lib3ds_chunk_write(&c, io);
- }
- if (!lib3ds_chunk_write_end(&c,io)) {
- return(LIB3DS_FALSE);
- }
- }
- if (!lib3ds_chunk_write_end(&c,io)) {
- return(LIB3DS_FALSE);
- }
- return(LIB3DS_TRUE);
-}
-
-
diff --git a/3rdparty/lib3ds/light.h b/3rdparty/lib3ds/light.h
deleted file mode 100644
index d8010d93..00000000
--- a/3rdparty/lib3ds/light.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/* -*- c -*- */
-#ifndef INCLUDED_LIB3DS_LIGHT_H
-#define INCLUDED_LIB3DS_LIGHT_H
-/*
- * The 3D Studio File Format Library
- * Copyright (C) 1996-2007 by Jan Eric Kyprianidis <www.kyprianidis.com>
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id: light.h,v 1.13 2007/06/20 17:04:08 jeh Exp $
- */
-
-#ifndef INCLUDED_LIB3DS_TYPES_H
-#include <lib3ds/types.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * Light
- * \ingroup light
- */
-struct Lib3dsLight {
- Lib3dsLight *next;
- char name[64];
- Lib3dsDword object_flags; /*< @see Lib3dsObjectFlags */
- Lib3dsBool spot_light;
- Lib3dsBool see_cone;
- Lib3dsRgb color;
- Lib3dsVector position;
- Lib3dsVector spot;
- Lib3dsFloat roll;
- Lib3dsBool off;
- Lib3dsFloat outer_range;
- Lib3dsFloat inner_range;
- Lib3dsFloat multiplier;
- /*const char** excludes;*/
- Lib3dsFloat attenuation;
- Lib3dsBool rectangular_spot;
- Lib3dsBool shadowed;
- Lib3dsFloat shadow_bias;
- Lib3dsFloat shadow_filter;
- Lib3dsIntw shadow_size;
- Lib3dsFloat spot_aspect;
- Lib3dsBool use_projector;
- char projector[64];
- Lib3dsIntd spot_overshoot;
- Lib3dsBool ray_shadows;
- Lib3dsFloat ray_bias;
- Lib3dsFloat hot_spot;
- Lib3dsFloat fall_off;
-};
-
-extern LIB3DSAPI Lib3dsLight* lib3ds_light_new(const char *name);
-extern LIB3DSAPI void lib3ds_light_free(Lib3dsLight *mesh);
-extern LIB3DSAPI void lib3ds_light_dump(Lib3dsLight *light);
-extern LIB3DSAPI Lib3dsBool lib3ds_light_read(Lib3dsLight *light, Lib3dsIo *io);
-extern LIB3DSAPI Lib3dsBool lib3ds_light_write(Lib3dsLight *light, Lib3dsIo *io);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
-
diff --git a/3rdparty/lib3ds/material.c b/3rdparty/lib3ds/material.c
deleted file mode 100644
index 4cd64e95..00000000
--- a/3rdparty/lib3ds/material.c
+++ /dev/null
@@ -1,1089 +0,0 @@
-/*
- * The 3D Studio File Format Library
- * Copyright (C) 1996-2007 by Jan Eric Kyprianidis <www.kyprianidis.com>
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id: material.c,v 1.24 2007/06/20 17:04:08 jeh Exp $
- */
-#include <lib3ds/material.h>
-#include <lib3ds/chunk.h>
-#include <lib3ds/io.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-
-/*!
- * \defgroup material Materials
- */
-
-
-static void
-initialize_texture_map(Lib3dsTextureMap *map)
-{
- map->flags = 0x10;
- map->percent = 1.0f;
- map->scale[0] = 1.0f;
- map->scale[1] = 1.0f;
-}
-
-
-/*!
- * Creates and returns a new, empty Lib3dsMaterial object.
- *
- * Initial value of the material is a shiny grey.
- *
- * \return A pointer to the Lib3dsMaterial structure.
- * If the structure cannot be allocated, NULL is returned.
- *
- * \ingroup material
- */
-Lib3dsMaterial*
-lib3ds_material_new()
-{
- Lib3dsMaterial *mat;
-
- mat = (Lib3dsMaterial*)calloc(sizeof(Lib3dsMaterial), 1);
- if (!mat) {
- return(0);
- }
-
- mat->ambient[0] = mat->ambient[1] = mat->ambient[2] = 0.588235f;
- mat->diffuse[0] = mat->diffuse[1] = mat->diffuse[2] = 0.588235f;
- mat->specular[0] = mat->specular[1] = mat->specular[2] = 0.898039f;
- mat->shininess = 0.1f;
- mat->wire_size = 1.0f;
- mat->shading = 3;
-
- initialize_texture_map(&mat->texture1_map);
- initialize_texture_map(&mat->texture1_mask);
- initialize_texture_map(&mat->texture2_map);
- initialize_texture_map(&mat->texture2_mask);
- initialize_texture_map(&mat->opacity_map);
- initialize_texture_map(&mat->opacity_mask);
- initialize_texture_map(&mat->bump_map);
- initialize_texture_map(&mat->bump_mask);
- initialize_texture_map(&mat->specular_map);
- initialize_texture_map(&mat->specular_mask);
- initialize_texture_map(&mat->shininess_map);
- initialize_texture_map(&mat->shininess_mask);
- initialize_texture_map(&mat->self_illum_map);
- initialize_texture_map(&mat->self_illum_mask);
- initialize_texture_map(&mat->reflection_map);
- initialize_texture_map(&mat->reflection_mask);
-
- return(mat);
-}
-
-
-/*!
- * \ingroup material
- */
-void
-lib3ds_material_free(Lib3dsMaterial *material)
-{
- memset(material, 0, sizeof(Lib3dsMaterial));
- free(material);
-}
-
-
-static Lib3dsBool
-color_read(Lib3dsRgba rgb, Lib3dsIo *io)
-{
- Lib3dsChunk c;
- Lib3dsWord chunk;
- Lib3dsBool have_lin=LIB3DS_FALSE;
-
- if (!lib3ds_chunk_read_start(&c, 0, io)) {
- return(LIB3DS_FALSE);
- }
-
- while ((chunk=lib3ds_chunk_read_next(&c, io))!=0) {
- switch (chunk) {
- case LIB3DS_LIN_COLOR_24:
- {
- int i;
- for (i=0; i<3; ++i) {
- rgb[i]=1.0f*lib3ds_io_read_byte(io)/255.0f;
- }
- rgb[3]=1.0f;
- }
- have_lin=LIB3DS_TRUE;
- break;
- case LIB3DS_COLOR_24:
- /* gamma corrected color chunk
- replaced in 3ds R3 by LIN_COLOR_24 */
- if (!have_lin) {
- int i;
- for (i=0; i<3; ++i) {
- rgb[i]=1.0f*lib3ds_io_read_byte(io)/255.0f;
- }
- rgb[3]=1.0f;
- }
- break;
- case LIB3DS_LIN_COLOR_F:
- {
- int i;
- for (i=0; i<3; ++i) {
- rgb[i]=lib3ds_io_read_float(io);
- }
- rgb[3]=1.0f;
- }
- have_lin=LIB3DS_TRUE;
- break;
- case LIB3DS_COLOR_F:
- if (!have_lin) {
- int i;
- for (i=0; i<3; ++i) {
- rgb[i]=lib3ds_io_read_float(io);
- }
- rgb[3]=1.0f;
- }
- break;
- default:
- lib3ds_chunk_unknown(chunk);
- }
- }
-
- lib3ds_chunk_read_end(&c, io);
- return(LIB3DS_TRUE);
-}
-
-
-static Lib3dsBool
-int_percentage_read(Lib3dsFloat *p, Lib3dsIo *io)
-{
- Lib3dsChunk c;
- Lib3dsWord chunk;
-
- if (!lib3ds_chunk_read_start(&c, 0, io)) {
- return(LIB3DS_FALSE);
- }
-
- while ((chunk=lib3ds_chunk_read_next(&c, io))!=0) {
- switch (chunk) {
- case LIB3DS_INT_PERCENTAGE:
- {
- Lib3dsIntw i=lib3ds_io_read_intw(io);
- *p=(Lib3dsFloat)(1.0*i/100.0);
- }
- break;
- default:
- lib3ds_chunk_unknown(chunk);
- }
- }
-
- lib3ds_chunk_read_end(&c, io);
- return(LIB3DS_TRUE);
-}
-
-
-static Lib3dsBool
-texture_map_read(Lib3dsTextureMap *map, Lib3dsIo *io)
-{
- Lib3dsChunk c;
- Lib3dsWord chunk;
-
- if (!lib3ds_chunk_read_start(&c, 0, io)) {
- return(LIB3DS_FALSE);
- }
-
- while ((chunk=lib3ds_chunk_read_next(&c, io))!=0) {
- switch (chunk) {
- case LIB3DS_INT_PERCENTAGE:
- {
- map->percent=1.0f*lib3ds_io_read_intw(io)/100.0f;
- }
- break;
- case LIB3DS_MAT_MAPNAME:
- {
- if (!lib3ds_io_read_string(io, map->name, 64)) {
- return(LIB3DS_FALSE);
- }
- lib3ds_chunk_dump_info(" NAME=%s", map->name);
- }
- break;
- case LIB3DS_MAT_MAP_TILING:
- {
- map->flags=lib3ds_io_read_word(io);
- }
- break;
- case LIB3DS_MAT_MAP_TEXBLUR:
- {
- map->blur=lib3ds_io_read_float(io);
- }
- break;
- case LIB3DS_MAT_MAP_USCALE:
- {
- map->scale[0]=lib3ds_io_read_float(io);
- }
- break;
- case LIB3DS_MAT_MAP_VSCALE:
- {
- map->scale[1]=lib3ds_io_read_float(io);
- }
- break;
- case LIB3DS_MAT_MAP_UOFFSET:
- {
- map->offset[0]=lib3ds_io_read_float(io);
- }
- break;
- case LIB3DS_MAT_MAP_VOFFSET:
- {
- map->offset[1]=lib3ds_io_read_float(io);
- }
- break;
- case LIB3DS_MAT_MAP_ANG:
- {
- map->rotation=lib3ds_io_read_float(io);
- }
- break;
- case LIB3DS_MAT_MAP_COL1:
- {
- map->tint_1[0]=1.0f*lib3ds_io_read_byte(io)/255.0f;
- map->tint_1[1]=1.0f*lib3ds_io_read_byte(io)/255.0f;
- map->tint_1[2]=1.0f*lib3ds_io_read_byte(io)/255.0f;
- }
- break;
- case LIB3DS_MAT_MAP_COL2:
- {
- map->tint_2[0]=1.0f*lib3ds_io_read_byte(io)/255.0f;
- map->tint_2[1]=1.0f*lib3ds_io_read_byte(io)/255.0f;
- map->tint_2[2]=1.0f*lib3ds_io_read_byte(io)/255.0f;
- }
- break;
- case LIB3DS_MAT_MAP_RCOL:
- {
- map->tint_r[0]=1.0f*lib3ds_io_read_byte(io)/255.0f;
- map->tint_r[1]=1.0f*lib3ds_io_read_byte(io)/255.0f;
- map->tint_r[2]=1.0f*lib3ds_io_read_byte(io)/255.0f;
- }
- break;
- case LIB3DS_MAT_MAP_GCOL:
- {
- map->tint_g[0]=1.0f*lib3ds_io_read_byte(io)/255.0f;
- map->tint_g[1]=1.0f*lib3ds_io_read_byte(io)/255.0f;
- map->tint_g[2]=1.0f*lib3ds_io_read_byte(io)/255.0f;
- }
- break;
- case LIB3DS_MAT_MAP_BCOL:
- {
- map->tint_b[0]=1.0f*lib3ds_io_read_byte(io)/255.0f;
- map->tint_b[1]=1.0f*lib3ds_io_read_byte(io)/255.0f;
- map->tint_b[2]=1.0f*lib3ds_io_read_byte(io)/255.0f;
- }
- break;
- default:
- lib3ds_chunk_unknown(chunk);
- }
- }
-
- lib3ds_chunk_read_end(&c, io);
- return(LIB3DS_TRUE);
-}
-
-
-/*!
- * \ingroup material
- */
-static void
-texture_dump(const char *maptype, Lib3dsTextureMap *texture)
-{
- ASSERT(texture);
- if (strlen(texture->name)==0) {
- return;
- }
- printf(" %s:\n", maptype);
- printf(" name: %s\n", texture->name);
- printf(" flags: %X\n", (unsigned)texture->flags);
- printf(" percent: %f\n", texture->percent);
- printf(" blur: %f\n", texture->blur);
- printf(" scale: (%f, %f)\n", texture->scale[0], texture->scale[1]);
- printf(" offset: (%f, %f)\n", texture->offset[0], texture->offset[1]);
- printf(" rotation: %f\n", texture->rotation);
- printf(" tint_1: (%f, %f, %f)\n",
- texture->tint_1[0], texture->tint_1[1], texture->tint_1[2]);
- printf(" tint_2: (%f, %f, %f)\n",
- texture->tint_2[0], texture->tint_2[1], texture->tint_2[2]);
- printf(" tint_r: (%f, %f, %f)\n",
- texture->tint_r[0], texture->tint_r[1], texture->tint_r[2]);
- printf(" tint_g: (%f, %f, %f)\n",
- texture->tint_g[0], texture->tint_g[1], texture->tint_g[2]);
- printf(" tint_b: (%f, %f, %f)\n",
- texture->tint_b[0], texture->tint_b[1], texture->tint_b[2]);
-}
-
-
-/*!
- * \ingroup material
- */
-void
-lib3ds_material_dump(Lib3dsMaterial *material)
-{
- ASSERT(material);
- printf(" name: %s\n", material->name);
- printf(" ambient: (%f, %f, %f)\n",
- material->ambient[0], material->ambient[1], material->ambient[2]);
- printf(" diffuse: (%f, %f, %f)\n",
- material->diffuse[0], material->diffuse[1], material->diffuse[2]);
- printf(" specular: (%f, %f, %f)\n",
- material->specular[0], material->specular[1], material->specular[2]);
- printf(" shininess: %f\n", material->shininess);
- printf(" shin_strength: %f\n", material->shin_strength);
- printf(" use_blur: %s\n", material->use_blur ? "yes" : "no");
- printf(" blur: %f\n", material->blur);
- printf(" falloff: %f\n", material->falloff);
- printf(" additive: %s\n", material->additive ? "yes" : "no");
- printf(" use_falloff: %s\n", material->use_falloff ? "yes" : "no");
- printf(" self_illum: %s\n", material->self_illum ? "yes" : "no");
- printf(" self_ilpct: %f\n", material->self_ilpct);
- printf(" shading: %d\n", material->shading);
- printf(" soften: %s\n", material->soften ? "yes" : "no");
- printf(" face_map: %s\n", material->face_map ? "yes" : "no");
- printf(" two_sided: %s\n", material->two_sided ? "yes" : "no");
- printf(" map_decal: %s\n", material->map_decal ? "yes" : "no");
- printf(" use_wire: %s\n", material->use_wire ? "yes" : "no");
- printf(" use_wire_abs: %s\n", material->use_wire_abs ? "yes" : "no");
- printf(" wire_size: %f\n", material->wire_size);
- texture_dump("texture1_map", &material->texture1_map);
- texture_dump("texture1_mask", &material->texture1_mask);
- texture_dump("texture2_map", &material->texture2_map);
- texture_dump("texture2_mask", &material->texture2_mask);
- texture_dump("opacity_map", &material->opacity_map);
- texture_dump("opacity_mask", &material->opacity_mask);
- texture_dump("bump_map", &material->bump_map);
- texture_dump("bump_mask", &material->bump_mask);
- texture_dump("specular_map", &material->specular_map);
- texture_dump("specular_mask", &material->specular_mask);
- texture_dump("shininess_map", &material->shininess_map);
- texture_dump("shininess_mask", &material->shininess_mask);
- texture_dump("self_illum_map", &material->self_illum_map);
- texture_dump("self_illum_mask", &material->self_illum_mask);
- texture_dump("reflection_map", &material->reflection_map);
- texture_dump("reflection_mask", &material->reflection_mask);
- printf(" autorefl_map:\n");
- printf(" flags %X\n", (unsigned)material->autorefl_map.flags);
- printf(" level %d\n", (int)material->autorefl_map.level);
- printf(" size %d\n", (int)material->autorefl_map.size);
- printf(" frame_step %d\n", (int)material->autorefl_map.frame_step);
- printf("\n");
-}
-
-
-/*!
- * \ingroup material
- */
-Lib3dsBool
-lib3ds_material_read(Lib3dsMaterial *material, Lib3dsIo *io)
-{
- Lib3dsChunk c;
- Lib3dsWord chunk;
-
- ASSERT(material);
- if (!lib3ds_chunk_read_start(&c, LIB3DS_MAT_ENTRY, io)) {
- return(LIB3DS_FALSE);
- }
-
- while ((chunk=lib3ds_chunk_read_next(&c, io))!=0) {
- switch (chunk) {
- case LIB3DS_MAT_NAME:
- {
- if (!lib3ds_io_read_string(io, material->name, 64)) {
- return(LIB3DS_FALSE);
- }
- lib3ds_chunk_dump_info(" NAME=%s", material->name);
- }
- break;
- case LIB3DS_MAT_AMBIENT:
- {
- lib3ds_chunk_read_reset(&c, io);
- if (!color_read(material->ambient, io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_MAT_DIFFUSE:
- {
- lib3ds_chunk_read_reset(&c, io);
- if (!color_read(material->diffuse, io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_MAT_SPECULAR:
- {
- lib3ds_chunk_read_reset(&c, io);
- if (!color_read(material->specular, io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_MAT_SHININESS:
- {
- lib3ds_chunk_read_reset(&c, io);
- if (!int_percentage_read(&material->shininess, io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_MAT_SHIN2PCT:
- {
- lib3ds_chunk_read_reset(&c, io);
- if (!int_percentage_read(&material->shin_strength, io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_MAT_TRANSPARENCY:
- {
- lib3ds_chunk_read_reset(&c, io);
- if (!int_percentage_read(&material->transparency, io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_MAT_XPFALL:
- {
- lib3ds_chunk_read_reset(&c, io);
- if (!int_percentage_read(&material->falloff, io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_MAT_SELF_ILPCT:
- {
- lib3ds_chunk_read_reset(&c, io);
- if (!int_percentage_read(&material->self_ilpct, io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_MAT_USE_XPFALL:
- {
- material->use_falloff=LIB3DS_TRUE;
- }
- break;
- case LIB3DS_MAT_REFBLUR:
- {
- lib3ds_chunk_read_reset(&c, io);
- if (!int_percentage_read(&material->blur, io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_MAT_USE_REFBLUR:
- {
- material->use_blur=LIB3DS_TRUE;
- }
- break;
- case LIB3DS_MAT_SHADING:
- {
- material->shading=lib3ds_io_read_intw(io);
- }
- break;
- case LIB3DS_MAT_SELF_ILLUM:
- {
- material->self_illum=LIB3DS_TRUE;
- }
- break;
- case LIB3DS_MAT_TWO_SIDE:
- {
- material->two_sided=LIB3DS_TRUE;
- }
- break;
- case LIB3DS_MAT_DECAL:
- {
- material->map_decal=LIB3DS_TRUE;
- }
- break;
- case LIB3DS_MAT_ADDITIVE:
- {
- material->additive=LIB3DS_TRUE;
- }
- break;
- case LIB3DS_MAT_FACEMAP:
- {
- material->face_map=LIB3DS_TRUE;
- }
- break;
- case LIB3DS_MAT_PHONGSOFT:
- {
- material->soften=LIB3DS_TRUE;
- }
- break;
- case LIB3DS_MAT_WIRE:
- {
- material->use_wire=LIB3DS_TRUE;
- }
- break;
- case LIB3DS_MAT_WIREABS:
- {
- material->use_wire_abs=LIB3DS_TRUE;
- }
- break;
- case LIB3DS_MAT_WIRE_SIZE:
- {
- material->wire_size=lib3ds_io_read_float(io);
- }
- break;
- case LIB3DS_MAT_TEXMAP:
- {
- lib3ds_chunk_read_reset(&c, io);
- if (!texture_map_read(&material->texture1_map, io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_MAT_TEXMASK:
- {
- lib3ds_chunk_read_reset(&c, io);
- if (!texture_map_read(&material->texture1_mask, io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_MAT_TEX2MAP:
- {
- lib3ds_chunk_read_reset(&c, io);
- if (!texture_map_read(&material->texture2_map, io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_MAT_TEX2MASK:
- {
- lib3ds_chunk_read_reset(&c, io);
- if (!texture_map_read(&material->texture2_mask, io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_MAT_OPACMAP:
- {
- lib3ds_chunk_read_reset(&c, io);
- if (!texture_map_read(&material->opacity_map, io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_MAT_OPACMASK:
- {
- lib3ds_chunk_read_reset(&c, io);
- if (!texture_map_read(&material->opacity_mask, io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_MAT_BUMPMAP:
- {
- lib3ds_chunk_read_reset(&c, io);
- if (!texture_map_read(&material->bump_map, io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_MAT_BUMPMASK:
- {
- lib3ds_chunk_read_reset(&c, io);
- if (!texture_map_read(&material->bump_mask, io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_MAT_SPECMAP:
- {
- lib3ds_chunk_read_reset(&c, io);
- if (!texture_map_read(&material->specular_map, io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_MAT_SPECMASK:
- {
- lib3ds_chunk_read_reset(&c, io);
- if (!texture_map_read(&material->specular_mask, io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_MAT_SHINMAP:
- {
- lib3ds_chunk_read_reset(&c, io);
- if (!texture_map_read(&material->shininess_map, io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_MAT_SHINMASK:
- {
- lib3ds_chunk_read_reset(&c, io);
- if (!texture_map_read(&material->shininess_mask, io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_MAT_SELFIMAP:
- {
- lib3ds_chunk_read_reset(&c, io);
- if (!texture_map_read(&material->self_illum_map, io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_MAT_SELFIMASK:
- {
- lib3ds_chunk_read_reset(&c, io);
- if (!texture_map_read(&material->self_illum_mask, io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_MAT_REFLMAP:
- {
- lib3ds_chunk_read_reset(&c, io);
- if (!texture_map_read(&material->reflection_map, io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_MAT_REFLMASK:
- {
- lib3ds_chunk_read_reset(&c, io);
- if (!texture_map_read(&material->reflection_mask, io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_MAT_ACUBIC:
- {
- lib3ds_io_read_intb(io);
- material->autorefl_map.level=lib3ds_io_read_intb(io);
- material->autorefl_map.flags=lib3ds_io_read_intw(io);
- material->autorefl_map.size=lib3ds_io_read_intd(io);
- material->autorefl_map.frame_step=lib3ds_io_read_intd(io);
- }
- break;
- default:
- lib3ds_chunk_unknown(chunk);
- }
- }
-
- lib3ds_chunk_read_end(&c, io);
- return(LIB3DS_TRUE);
-}
-
-
-static Lib3dsBool
-color_write(Lib3dsRgba rgb, Lib3dsIo *io)
-{
- Lib3dsChunk c;
-
- c.chunk=LIB3DS_COLOR_24;
- c.size=9;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_byte(io, (Lib3dsByte)floor(255.0*rgb[0]+0.5));
- lib3ds_io_write_byte(io, (Lib3dsByte)floor(255.0*rgb[1]+0.5));
- lib3ds_io_write_byte(io, (Lib3dsByte)floor(255.0*rgb[2]+0.5));
-
- c.chunk=LIB3DS_LIN_COLOR_24;
- c.size=9;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_byte(io, (Lib3dsByte)floor(255.0*rgb[0]+0.5));
- lib3ds_io_write_byte(io, (Lib3dsByte)floor(255.0*rgb[1]+0.5));
- lib3ds_io_write_byte(io, (Lib3dsByte)floor(255.0*rgb[2]+0.5));
-
- return(LIB3DS_TRUE);
-}
-
-
-static Lib3dsBool
-int_percentage_write(Lib3dsFloat p, Lib3dsIo *io)
-{
- Lib3dsChunk c;
-
- c.chunk=LIB3DS_INT_PERCENTAGE;
- c.size=8;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_intw(io, (Lib3dsByte)floor(100.0*p+0.5));
-
- return(LIB3DS_TRUE);
-}
-
-
-static Lib3dsBool
-texture_map_write(Lib3dsWord chunk, Lib3dsTextureMap *map, Lib3dsIo *io)
-{
- Lib3dsChunk c;
-
- if (strlen(map->name)==0) {
- return(LIB3DS_TRUE);
- }
- c.chunk=chunk;
- if (!lib3ds_chunk_write_start(&c,io)) {
- return(LIB3DS_FALSE);
- }
-
- int_percentage_write(map->percent,io);
-
- { /*---- LIB3DS_MAT_MAPNAME ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_MAT_MAPNAME;
- c.size=6+(Lib3dsDword)strlen(map->name)+1;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_string(io, map->name);
- }
-
- { /*---- LIB3DS_MAT_MAP_TILING ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_MAT_MAP_TILING;
- c.size=8;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_word(io, (Lib3dsWord)map->flags);
- }
-
- { /*---- LIB3DS_MAT_MAP_TEXBLUR ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_MAT_MAP_TEXBLUR;
- c.size=10;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_float(io, map->blur);
- }
-
- { /*---- LIB3DS_MAT_MAP_USCALE ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_MAT_MAP_USCALE;
- c.size=10;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_float(io, map->scale[0]);
- }
-
- { /*---- LIB3DS_MAT_MAP_VSCALE ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_MAT_MAP_VSCALE;
- c.size=10;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_float(io, map->scale[1]);
- }
-
- { /*---- LIB3DS_MAT_MAP_UOFFSET ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_MAT_MAP_UOFFSET;
- c.size=10;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_float(io, map->offset[0]);
- }
-
- { /*---- LIB3DS_MAT_MAP_VOFFSET ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_MAT_MAP_VOFFSET;
- c.size=10;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_float(io, map->offset[1]);
- }
-
- { /*---- LIB3DS_MAT_MAP_ANG ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_MAT_MAP_ANG;
- c.size=10;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_float(io, map->rotation);
- }
-
- { /*---- LIB3DS_MAT_MAP_COL1 ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_MAT_MAP_COL1;
- c.size=9;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_byte(io, (Lib3dsByte)floor(255.0*map->tint_1[0]+0.5));
- lib3ds_io_write_byte(io, (Lib3dsByte)floor(255.0*map->tint_1[1]+0.5));
- lib3ds_io_write_byte(io, (Lib3dsByte)floor(255.0*map->tint_1[2]+0.5));
- }
-
- { /*---- LIB3DS_MAT_MAP_COL2 ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_MAT_MAP_COL2;
- c.size=9;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_byte(io, (Lib3dsByte)floor(255.0*map->tint_2[0]+0.5));
- lib3ds_io_write_byte(io, (Lib3dsByte)floor(255.0*map->tint_2[1]+0.5));
- lib3ds_io_write_byte(io, (Lib3dsByte)floor(255.0*map->tint_2[2]+0.5));
- }
-
- { /*---- LIB3DS_MAT_MAP_RCOL ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_MAT_MAP_RCOL;
- c.size=9;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_byte(io, (Lib3dsByte)floor(255.0*map->tint_r[0]+0.5));
- lib3ds_io_write_byte(io, (Lib3dsByte)floor(255.0*map->tint_r[1]+0.5));
- lib3ds_io_write_byte(io, (Lib3dsByte)floor(255.0*map->tint_r[2]+0.5));
- }
-
- { /*---- LIB3DS_MAT_MAP_GCOL ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_MAT_MAP_GCOL;
- c.size=9;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_byte(io, (Lib3dsByte)floor(255.0*map->tint_g[0]+0.5));
- lib3ds_io_write_byte(io, (Lib3dsByte)floor(255.0*map->tint_g[1]+0.5));
- lib3ds_io_write_byte(io, (Lib3dsByte)floor(255.0*map->tint_g[2]+0.5));
- }
-
- { /*---- LIB3DS_MAT_MAP_BCOL ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_MAT_MAP_BCOL;
- c.size=9;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_byte(io, (Lib3dsByte)floor(255.0*map->tint_b[0]+0.5));
- lib3ds_io_write_byte(io, (Lib3dsByte)floor(255.0*map->tint_b[1]+0.5));
- lib3ds_io_write_byte(io, (Lib3dsByte)floor(255.0*map->tint_b[2]+0.5));
- }
-
- if (!lib3ds_chunk_write_end(&c,io)) {
- return(LIB3DS_FALSE);
- }
- return(LIB3DS_TRUE);
-}
-
-
-/*!
- * \ingroup material
- */
-Lib3dsBool
-lib3ds_material_write(Lib3dsMaterial *material, Lib3dsIo *io)
-{
- Lib3dsChunk c;
-
- c.chunk=LIB3DS_MAT_ENTRY;
- if (!lib3ds_chunk_write_start(&c,io)) {
- return(LIB3DS_FALSE);
- }
-
- { /*---- LIB3DS_MAT_NAME ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_MAT_NAME;
- c.size=6+(Lib3dsDword)strlen(material->name)+1;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_string(io, material->name);
- }
-
- { /*---- LIB3DS_MAT_AMBIENT ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_MAT_AMBIENT;
- c.size=24;
- lib3ds_chunk_write(&c,io);
- color_write(material->ambient,io);
- }
-
- { /*---- LIB3DS_MAT_DIFFUSE ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_MAT_DIFFUSE;
- c.size=24;
- lib3ds_chunk_write(&c,io);
- color_write(material->diffuse,io);
- }
-
- { /*---- LIB3DS_MAT_SPECULAR ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_MAT_SPECULAR;
- c.size=24;
- lib3ds_chunk_write(&c,io);
- color_write(material->specular,io);
- }
-
- { /*---- LIB3DS_MAT_SHININESS ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_MAT_SHININESS;
- c.size=14;
- lib3ds_chunk_write(&c,io);
- int_percentage_write(material->shininess,io);
- }
-
- { /*---- LIB3DS_MAT_SHIN2PCT ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_MAT_SHIN2PCT;
- c.size=14;
- lib3ds_chunk_write(&c,io);
- int_percentage_write(material->shin_strength,io);
- }
-
- { /*---- LIB3DS_MAT_TRANSPARENCY ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_MAT_TRANSPARENCY;
- c.size=14;
- lib3ds_chunk_write(&c,io);
- int_percentage_write(material->transparency,io);
- }
-
- { /*---- LIB3DS_MAT_XPFALL ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_MAT_XPFALL;
- c.size=14;
- lib3ds_chunk_write(&c,io);
- int_percentage_write(material->falloff,io);
- }
-
- if (material->use_falloff) { /*---- LIB3DS_MAT_USE_XPFALL ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_MAT_USE_XPFALL;
- c.size=6;
- lib3ds_chunk_write(&c,io);
- }
-
- { /*---- LIB3DS_MAT_SHADING ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_MAT_SHADING;
- c.size=8;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_intw(io, material->shading);
- }
-
- { /*---- LIB3DS_MAT_REFBLUR ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_MAT_REFBLUR;
- c.size=14;
- lib3ds_chunk_write(&c,io);
- int_percentage_write(material->blur,io);
- }
-
- if (material->use_blur) { /*---- LIB3DS_MAT_USE_REFBLUR ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_MAT_USE_REFBLUR;
- c.size=6;
- lib3ds_chunk_write(&c,io);
- }
-
- if (material->self_illum) { /*---- LIB3DS_MAT_SELF_ILLUM ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_MAT_SELF_ILLUM;
- c.size=6;
- lib3ds_chunk_write(&c,io);
- }
-
- if (material->two_sided) { /*---- LIB3DS_MAT_TWO_SIDE ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_MAT_TWO_SIDE;
- c.size=6;
- lib3ds_chunk_write(&c,io);
- }
-
- if (material->map_decal) { /*---- LIB3DS_MAT_DECAL ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_MAT_DECAL;
- c.size=6;
- lib3ds_chunk_write(&c,io);
- }
-
- if (material->additive) { /*---- LIB3DS_MAT_ADDITIVE ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_MAT_ADDITIVE;
- c.size=6;
- lib3ds_chunk_write(&c,io);
- }
-
- if (material->use_wire) { /*---- LIB3DS_MAT_WIRE ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_MAT_WIRE;
- c.size=6;
- lib3ds_chunk_write(&c,io);
- }
-
- if (material->use_wire_abs) { /*---- LIB3DS_MAT_WIREABS ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_MAT_WIREABS;
- c.size=6;
- lib3ds_chunk_write(&c,io);
- }
-
- { /*---- LIB3DS_MAT_WIRE_SIZE ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_MAT_WIRE_SIZE;
- c.size=10;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_float(io, material->wire_size);
- }
-
- if (material->face_map) { /*---- LIB3DS_MAT_FACEMAP ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_MAT_FACEMAP;
- c.size=6;
- lib3ds_chunk_write(&c,io);
- }
-
- if (material->soften) { /*---- LIB3DS_MAT_PHONGSOFT ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_MAT_PHONGSOFT;
- c.size=6;
- lib3ds_chunk_write(&c,io);
- }
-
- if (!texture_map_write(LIB3DS_MAT_TEXMAP, &material->texture1_map, io)) {
- return(LIB3DS_FALSE);
- }
- if (!texture_map_write(LIB3DS_MAT_TEXMASK, &material->texture1_mask, io)) {
- return(LIB3DS_FALSE);
- }
- if (!texture_map_write(LIB3DS_MAT_TEX2MAP, &material->texture2_map, io)) {
- return(LIB3DS_FALSE);
- }
- if (!texture_map_write(LIB3DS_MAT_TEX2MASK, &material->texture2_mask, io)) {
- return(LIB3DS_FALSE);
- }
- if (!texture_map_write(LIB3DS_MAT_OPACMAP, &material->opacity_map, io)) {
- return(LIB3DS_FALSE);
- }
- if (!texture_map_write(LIB3DS_MAT_OPACMASK, &material->opacity_mask, io)) {
- return(LIB3DS_FALSE);
- }
- if (!texture_map_write(LIB3DS_MAT_BUMPMAP, &material->bump_map, io)) {
- return(LIB3DS_FALSE);
- }
- if (!texture_map_write(LIB3DS_MAT_BUMPMASK, &material->bump_mask, io)) {
- return(LIB3DS_FALSE);
- }
- if (!texture_map_write(LIB3DS_MAT_SPECMAP, &material->specular_map, io)) {
- return(LIB3DS_FALSE);
- }
- if (!texture_map_write(LIB3DS_MAT_SPECMASK, &material->specular_mask, io)) {
- return(LIB3DS_FALSE);
- }
- if (!texture_map_write(LIB3DS_MAT_SHINMAP, &material->shininess_map, io)) {
- return(LIB3DS_FALSE);
- }
- if (!texture_map_write(LIB3DS_MAT_SHINMASK, &material->shininess_mask, io)) {
- return(LIB3DS_FALSE);
- }
- if (!texture_map_write(LIB3DS_MAT_SELFIMAP, &material->self_illum_map, io)) {
- return(LIB3DS_FALSE);
- }
- if (!texture_map_write(LIB3DS_MAT_SELFIMASK, &material->self_illum_mask, io)) {
- return(LIB3DS_FALSE);
- }
- if (!texture_map_write(LIB3DS_MAT_REFLMAP, &material->reflection_map, io)) {
- return(LIB3DS_FALSE);
- }
- if (!texture_map_write(LIB3DS_MAT_REFLMASK, &material->reflection_mask, io)) {
- return(LIB3DS_FALSE);
- }
-
- if (!lib3ds_chunk_write_end(&c,io)) {
- return(LIB3DS_FALSE);
- }
- return(LIB3DS_TRUE);
-}
-
-
diff --git a/3rdparty/lib3ds/material.h b/3rdparty/lib3ds/material.h
deleted file mode 100644
index 7e3e168e..00000000
--- a/3rdparty/lib3ds/material.h
+++ /dev/null
@@ -1,170 +0,0 @@
-/* -*- c -*- */
-#ifndef INCLUDED_LIB3DS_MATERIAL_H
-#define INCLUDED_LIB3DS_MATERIAL_H
-/*
- * The 3D Studio File Format Library
- * Copyright (C) 1996-2007 by Jan Eric Kyprianidis <www.kyprianidis.com>
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id: material.h,v 1.18 2007/06/20 17:04:08 jeh Exp $
- */
-
-#ifndef INCLUDED_LIB3DS_TYPES_H
-#include <lib3ds/types.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * \ingroup material
- */
-typedef enum Lib3dsTextureMapFlags {
- LIB3DS_DECALE =0x0001,
- LIB3DS_MIRROR =0x0002,
- LIB3DS_NEGATE =0x0008,
- LIB3DS_NO_TILE =0x0010,
- LIB3DS_SUMMED_AREA =0x0020,
- LIB3DS_ALPHA_SOURCE =0x0040,
- LIB3DS_TINT =0x0080,
- LIB3DS_IGNORE_ALPHA =0x0100,
- LIB3DS_RGB_TINT =0x0200
-} Lib3dsTextureMapFlags;
-
-/**
- * Mateial texture map
- * \ingroup material
- */
-typedef struct Lib3dsTextureMap {
- Lib3dsUserData user;
- char name[64];
- Lib3dsDword flags;
- Lib3dsFloat percent;
- Lib3dsFloat blur;
- Lib3dsFloat scale[2];
- Lib3dsFloat offset[2];
- Lib3dsFloat rotation;
- Lib3dsRgb tint_1;
- Lib3dsRgb tint_2;
- Lib3dsRgb tint_r;
- Lib3dsRgb tint_g;
- Lib3dsRgb tint_b;
-} Lib3dsTextureMap;
-
-/**
- * \ingroup material
- */
-typedef enum Lib3dsAutoReflMapFlags {
- LIB3DS_USE_REFL_MAP =0x0001,
- LIB3DS_READ_FIRST_FRAME_ONLY =0x0004,
- LIB3DS_FLAT_MIRROR =0x0008
-} Lib3dsAutoReflectionMapFlags;
-
-/**
- * \ingroup material
- */
-typedef enum Lib3dsAutoReflMapAntiAliasLevel {
- LIB3DS_ANTI_ALIAS_NONE =0,
- LIB3DS_ANTI_ALIAS_LOW =1,
- LIB3DS_ANTI_ALIAS_MEDIUM =2,
- LIB3DS_ANTI_ALIAS_HIGH =3
-} Lib3dsAutoReflMapAntiAliasLevel;
-
-/**
- * Auto reflection map settings
- * \ingroup material
- */
-typedef struct Lib3dsAutoReflMap {
- Lib3dsDword flags;
- Lib3dsIntd level;
- Lib3dsIntd size;
- Lib3dsIntd frame_step;
-} Lib3dsAutoReflMap;
-
-/**
- * \ingroup material
- */
-typedef enum Lib3dsMaterialShading {
- LIB3DS_WIRE_FRAME =0,
- LIB3DS_FLAT =1,
- LIB3DS_GOURAUD =2,
- LIB3DS_PHONG =3,
- LIB3DS_METAL =4
-} Lib3dsMaterialShading;
-
-/**
- * Material
- * \ingroup material
- */
-struct Lib3dsMaterial {
- Lib3dsUserData user; /*! Arbitrary user data */
- Lib3dsMaterial *next;
- char name[64]; /*! Material name */
- Lib3dsRgba ambient; /*! Material ambient reflectivity */
- Lib3dsRgba diffuse; /*! Material diffuse reflectivity */
- Lib3dsRgba specular; /*! Material specular reflectivity */
- Lib3dsFloat shininess; /*! Material specular exponent */
- Lib3dsFloat shin_strength;
- Lib3dsBool use_blur;
- Lib3dsFloat blur;
- Lib3dsFloat transparency;
- Lib3dsFloat falloff;
- Lib3dsBool additive;
- Lib3dsFloat self_ilpct;
- Lib3dsBool use_falloff;
- Lib3dsBool self_illum;
- Lib3dsIntw shading;
- Lib3dsBool soften;
- Lib3dsBool face_map;
- Lib3dsBool two_sided; /*! Material visible from back */
- Lib3dsBool map_decal;
- Lib3dsBool use_wire;
- Lib3dsBool use_wire_abs;
- Lib3dsFloat wire_size;
- Lib3dsTextureMap texture1_map;
- Lib3dsTextureMap texture1_mask;
- Lib3dsTextureMap texture2_map;
- Lib3dsTextureMap texture2_mask;
- Lib3dsTextureMap opacity_map;
- Lib3dsTextureMap opacity_mask;
- Lib3dsTextureMap bump_map;
- Lib3dsTextureMap bump_mask;
- Lib3dsTextureMap specular_map;
- Lib3dsTextureMap specular_mask;
- Lib3dsTextureMap shininess_map;
- Lib3dsTextureMap shininess_mask;
- Lib3dsTextureMap self_illum_map;
- Lib3dsTextureMap self_illum_mask;
- Lib3dsTextureMap reflection_map;
- Lib3dsTextureMap reflection_mask;
- Lib3dsAutoReflMap autorefl_map;
-};
-
-extern LIB3DSAPI Lib3dsMaterial* lib3ds_material_new();
-extern LIB3DSAPI void lib3ds_material_free(Lib3dsMaterial *material);
-extern LIB3DSAPI void lib3ds_material_dump(Lib3dsMaterial *material);
-extern LIB3DSAPI Lib3dsBool lib3ds_material_read(Lib3dsMaterial *material, Lib3dsIo *io);
-extern LIB3DSAPI Lib3dsBool lib3ds_material_write(Lib3dsMaterial *material, Lib3dsIo *io);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
-
-
-
diff --git a/3rdparty/lib3ds/matrix.c b/3rdparty/lib3ds/matrix.c
deleted file mode 100644
index 58e7584a..00000000
--- a/3rdparty/lib3ds/matrix.c
+++ /dev/null
@@ -1,718 +0,0 @@
-/*
- * The 3D Studio File Format Library
- * Copyright (C) 1996-2007 by Jan Eric Kyprianidis <www.kyprianidis.com>
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id: matrix.c,v 1.14 2007/06/20 17:04:08 jeh Exp $
- */
-#include <lib3ds/matrix.h>
-#include <lib3ds/quat.h>
-#include <lib3ds/vector.h>
-#include <string.h>
-#include <math.h>
-
-
-/*!
- * \defgroup matrix Matrix Mathematics
- */
-
-
-/*!
-* \typedef Lib3dsMatrix
-* \ingroup matrix
-*/
-
-
-/*!
- * Clear a matrix to all zeros.
- *
- * \param m Matrix to be cleared.
- *
- * \ingroup matrix
- */
-void
-lib3ds_matrix_zero(Lib3dsMatrix m)
-{
- int i,j;
-
- for (i=0; i<4; i++) {
- for (j=0; j<4; j++) m[i][j]=0.0f;
- }
-}
-
-
-/*!
- * Set a matrix to identity.
- *
- * \param m Matrix to be set.
- *
- * \ingroup matrix
- */
-void
-lib3ds_matrix_identity(Lib3dsMatrix m)
-{
- int i,j;
-
- for (i=0; i<4; i++) {
- for (j=0; j<4; j++) m[i][j]=0.0;
- }
- for (i=0; i<4; i++) m[i][i]=1.0;
-}
-
-
-/*!
- * Copy a matrix.
- *
- * \ingroup matrix
- */
-void
-lib3ds_matrix_copy(Lib3dsMatrix dest, Lib3dsMatrix src)
-{
- memcpy(dest, src, sizeof(Lib3dsMatrix));
-}
-
-
-/*!
- * Negate a matrix -- all elements negated.
- *
- * \ingroup matrix
- */
-void
-lib3ds_matrix_neg(Lib3dsMatrix m)
-{
- int i,j;
-
- for (j=0; j<4; j++) {
- for (i=0; i<4; i++) {
- m[j][i]=-m[j][i];
- }
- }
-}
-
-
-/*!
- * Set all matrix elements to their absolute value.
- *
- * \ingroup matrix
- */
-void
-lib3ds_matrix_abs(Lib3dsMatrix m)
-{
- int i,j;
-
- for (j=0; j<4; j++) {
- for (i=0; i<4; i++) {
- m[j][i]=(Lib3dsFloat)fabs(m[j][i]);
- }
- }
-}
-
-
-/*!
- * Transpose a matrix in place.
- *
- * \ingroup matrix
- */
-void
-lib3ds_matrix_transpose(Lib3dsMatrix m)
-{
- int i,j;
- Lib3dsFloat swp;
-
- for (j=0; j<4; j++) {
- for (i=j+1; i<4; i++) {
- swp=m[j][i];
- m[j][i]=m[i][j];
- m[i][j]=swp;
- }
- }
-}
-
-
-/*!
- * Add two matrices.
- *
- * \ingroup matrix
- */
-void
-_lib3ds_matrix_add(Lib3dsMatrix m, Lib3dsMatrix a, Lib3dsMatrix b)
-{
- int i,j;
-
- for (j=0; j<4; j++) {
- for (i=0; i<4; i++) {
- m[j][i]=a[j][i]+b[j][i];
- }
- }
-}
-
-
-/*!
- * Subtract two matrices.
- *
- * \param m Result.
- * \param a Addend.
- * \param b Minuend.
- *
- * \ingroup matrix
- */
-void
-_lib3ds_matrix_sub(Lib3dsMatrix m, Lib3dsMatrix a, Lib3dsMatrix b)
-{
- int i,j;
-
- for (j=0; j<4; j++) {
- for (i=0; i<4; i++) {
- m[j][i]=a[j][i]-b[j][i];
- }
- }
-}
-
-
-/*!
- * Multiplies a matrix by a second one (m = m * n).
- *
- * \ingroup matrix
- */
-void
-lib3ds_matrix_mult(Lib3dsMatrix m, Lib3dsMatrix n)
-{
- Lib3dsMatrix tmp;
- int i,j,k;
- Lib3dsFloat ab;
-
- memcpy(tmp, m, sizeof(Lib3dsMatrix));
- for (j=0; j<4; j++) {
- for (i=0; i<4; i++) {
- ab=0.0f;
- for (k=0; k<4; k++) ab+=tmp[k][i]*n[j][k];
- m[j][i]=ab;
- }
- }
-}
-
-
-/*!
- * Multiply a matrix by a scalar.
- *
- * \param m Matrix to be set.
- * \param k Scalar.
- *
- * \ingroup matrix
- */
-void
-lib3ds_matrix_scalar(Lib3dsMatrix m, Lib3dsFloat k)
-{
- int i,j;
-
- for (j=0; j<4; j++) {
- for (i=0; i<4; i++) {
- m[j][i]*=k;
- }
- }
-}
-
-
-static Lib3dsFloat
-det2x2(
- Lib3dsFloat a, Lib3dsFloat b,
- Lib3dsFloat c, Lib3dsFloat d)
-{
- return((a)*(d)-(b)*(c));
-}
-
-
-static Lib3dsFloat
-det3x3(
- Lib3dsFloat a1, Lib3dsFloat a2, Lib3dsFloat a3,
- Lib3dsFloat b1, Lib3dsFloat b2, Lib3dsFloat b3,
- Lib3dsFloat c1, Lib3dsFloat c2, Lib3dsFloat c3)
-{
- return(
- a1*det2x2(b2,b3,c2,c3)-
- b1*det2x2(a2,a3,c2,c3)+
- c1*det2x2(a2,a3,b2,b3)
- );
-}
-
-
-/*!
- * Find determinant of a matrix.
- *
- * \ingroup matrix
- */
-Lib3dsFloat
-lib3ds_matrix_det(Lib3dsMatrix m)
-{
- Lib3dsFloat a1,a2,a3,a4,b1,b2,b3,b4,c1,c2,c3,c4,d1,d2,d3,d4;
-
- a1 = m[0][0];
- b1 = m[1][0];
- c1 = m[2][0];
- d1 = m[3][0];
- a2 = m[0][1];
- b2 = m[1][1];
- c2 = m[2][1];
- d2 = m[3][1];
- a3 = m[0][2];
- b3 = m[1][2];
- c3 = m[2][2];
- d3 = m[3][2];
- a4 = m[0][3];
- b4 = m[1][3];
- c4 = m[2][3];
- d4 = m[3][3];
- return(
- a1 * det3x3(b2, b3, b4, c2, c3, c4, d2, d3, d4)-
- b1 * det3x3(a2, a3, a4, c2, c3, c4, d2, d3, d4)+
- c1 * det3x3(a2, a3, a4, b2, b3, b4, d2, d3, d4)-
- d1 * det3x3(a2, a3, a4, b2, b3, b4, c2, c3, c4)
- );
-}
-
-
-/*!
- * Find the adjoint of a matrix.
- *
- * \ingroup matrix
- */
-void
-lib3ds_matrix_adjoint(Lib3dsMatrix m)
-{
- Lib3dsFloat a1,a2,a3,a4,b1,b2,b3,b4,c1,c2,c3,c4,d1,d2,d3,d4;
-
- a1 = m[0][0];
- b1 = m[1][0];
- c1 = m[2][0];
- d1 = m[3][0];
- a2 = m[0][1];
- b2 = m[1][1];
- c2 = m[2][1];
- d2 = m[3][1];
- a3 = m[0][2];
- b3 = m[1][2];
- c3 = m[2][2];
- d3 = m[3][2];
- a4 = m[0][3];
- b4 = m[1][3];
- c4 = m[2][3];
- d4 = m[3][3];
- m[0][0]= det3x3 (b2, b3, b4, c2, c3, c4, d2, d3, d4);
- m[0][1]= -det3x3 (a2, a3, a4, c2, c3, c4, d2, d3, d4);
- m[0][2]= det3x3 (a2, a3, a4, b2, b3, b4, d2, d3, d4);
- m[0][3]= -det3x3 (a2, a3, a4, b2, b3, b4, c2, c3, c4);
- m[1][0]= -det3x3 (b1, b3, b4, c1, c3, c4, d1, d3, d4);
- m[1][1]= det3x3 (a1, a3, a4, c1, c3, c4, d1, d3, d4);
- m[1][2]= -det3x3 (a1, a3, a4, b1, b3, b4, d1, d3, d4);
- m[1][3]= det3x3 (a1, a3, a4, b1, b3, b4, c1, c3, c4);
- m[2][0]= det3x3 (b1, b2, b4, c1, c2, c4, d1, d2, d4);
- m[2][1]= -det3x3 (a1, a2, a4, c1, c2, c4, d1, d2, d4);
- m[2][2]= det3x3 (a1, a2, a4, b1, b2, b4, d1, d2, d4);
- m[2][3]= -det3x3 (a1, a2, a4, b1, b2, b4, c1, c2, c4);
- m[3][0]= -det3x3 (b1, b2, b3, c1, c2, c3, d1, d2, d3);
- m[3][1]= det3x3 (a1, a2, a3, c1, c2, c3, d1, d2, d3);
- m[3][2]= -det3x3 (a1, a2, a3, b1, b2, b3, d1, d2, d3);
- m[3][3]= det3x3 (a1, a2, a3, b1, b2, b3, c1, c2, c3);
-}
-
-
-/*!
- * Invert a matrix in place.
- *
- * \param m Matrix to invert.
- *
- * \return LIB3DS_TRUE on success, LIB3DS_FALSE on failure.
- * \ingroup matrix
- *
- * GGemsII, K.Wu, Fast Matrix Inversion
- */
-Lib3dsBool
-lib3ds_matrix_inv(Lib3dsMatrix m)
-{
- int i,j,k;
- int pvt_i[4], pvt_j[4]; /* Locations of pivot elements */
- Lib3dsFloat pvt_val; /* Value of current pivot element */
- Lib3dsFloat hold; /* Temporary storage */
- Lib3dsFloat determinat;
-
- determinat = 1.0f;
- for (k=0; k<4; k++) {
- /* Locate k'th pivot element */
- pvt_val=m[k][k]; /* Initialize for search */
- pvt_i[k]=k;
- pvt_j[k]=k;
- for (i=k; i<4; i++) {
- for (j=k; j<4; j++) {
- if (fabs(m[i][j]) > fabs(pvt_val)) {
- pvt_i[k]=i;
- pvt_j[k]=j;
- pvt_val=m[i][j];
- }
- }
- }
-
- /* Product of pivots, gives determinant when finished */
- determinat*=pvt_val;
- if (fabs(determinat)<LIB3DS_EPSILON) {
- return(LIB3DS_FALSE); /* Matrix is singular (zero determinant) */
- }
-
- /* "Interchange" rows (with sign change stuff) */
- i=pvt_i[k];
- if (i!=k) { /* If rows are different */
- for (j=0; j<4; j++) {
- hold=-m[k][j];
- m[k][j]=m[i][j];
- m[i][j]=hold;
- }
- }
-
- /* "Interchange" columns */
- j=pvt_j[k];
- if (j!=k) { /* If columns are different */
- for (i=0; i<4; i++) {
- hold=-m[i][k];
- m[i][k]=m[i][j];
- m[i][j]=hold;
- }
- }
-
- /* Divide column by minus pivot value */
- for (i=0; i<4; i++) {
- if (i!=k) m[i][k]/=( -pvt_val) ;
- }
-
- /* Reduce the matrix */
- for (i=0; i<4; i++) {
- hold = m[i][k];
- for (j=0; j<4; j++) {
- if (i!=k && j!=k) m[i][j]+=hold*m[k][j];
- }
- }
-
- /* Divide row by pivot */
- for (j=0; j<4; j++) {
- if (j!=k) m[k][j]/=pvt_val;
- }
-
- /* Replace pivot by reciprocal (at last we can touch it). */
- m[k][k] = 1.0f/pvt_val;
- }
-
- /* That was most of the work, one final pass of row/column interchange */
- /* to finish */
- for (k=4-2; k>=0; k--) { /* Don't need to work with 1 by 1 corner*/
- i=pvt_j[k]; /* Rows to swap correspond to pivot COLUMN */
- if (i!=k) { /* If rows are different */
- for (j=0; j<4; j++) {
- hold = m[k][j];
- m[k][j]=-m[i][j];
- m[i][j]=hold;
- }
- }
-
- j=pvt_i[k]; /* Columns to swap correspond to pivot ROW */
- if (j!=k) /* If columns are different */
- for (i=0; i<4; i++) {
- hold=m[i][k];
- m[i][k]=-m[i][j];
- m[i][j]=hold;
- }
- }
- return(LIB3DS_TRUE);
-}
-
-
-/*!
- * Apply a translation to a matrix.
- *
- * \ingroup matrix
- */
-void
-lib3ds_matrix_translate_xyz(Lib3dsMatrix m, Lib3dsFloat x, Lib3dsFloat y, Lib3dsFloat z)
-{
- int i;
-
- for (i=0; i<3; i++) {
- m[3][i]+= m[0][i]*x + m[1][i]*y + m[2][i]*z;
- }
-}
-
-
-/*!
- * Apply a translation to a matrix.
- *
- * \ingroup matrix
- */
-void
-lib3ds_matrix_translate(Lib3dsMatrix m, Lib3dsVector t)
-{
- int i;
-
- for (i=0; i<3; i++) {
- m[3][i]+= m[0][i]*t[0] + m[1][i]*t[1] + m[2][i]*t[2];
- }
-}
-
-
-/*!
- * Apply scale factors to a matrix.
- *
- * \ingroup matrix
- */
-void
-lib3ds_matrix_scale_xyz(Lib3dsMatrix m, Lib3dsFloat x, Lib3dsFloat y, Lib3dsFloat z)
-{
- int i;
-
- for (i=0; i<4; i++) {
- m[0][i]*=x;
- m[1][i]*=y;
- m[2][i]*=z;
- }
-}
-
-
-/*!
- * Apply scale factors to a matrix.
- *
- * \ingroup matrix
- */
-void
-lib3ds_matrix_scale(Lib3dsMatrix m, Lib3dsVector s)
-{
- int i;
-
- for (i=0; i<4; i++) {
- m[0][i]*=s[0];
- m[1][i]*=s[1];
- m[2][i]*=s[2];
- }
-}
-
-
-/*!
- * Apply a rotation about the x axis to a matrix.
- *
- * \ingroup matrix
- */
-void
-lib3ds_matrix_rotate_x(Lib3dsMatrix m, Lib3dsFloat phi)
-{
- Lib3dsFloat SinPhi,CosPhi;
- Lib3dsFloat a1[4],a2[4];
-
- SinPhi=(Lib3dsFloat)sin(phi);
- CosPhi=(Lib3dsFloat)cos(phi);
- memcpy(a1,m[1],4*sizeof(Lib3dsFloat));
- memcpy(a2,m[2],4*sizeof(Lib3dsFloat));
- m[1][0]=CosPhi*a1[0]+SinPhi*a2[0];
- m[1][1]=CosPhi*a1[1]+SinPhi*a2[1];
- m[1][2]=CosPhi*a1[2]+SinPhi*a2[2];
- m[1][3]=CosPhi*a1[3]+SinPhi*a2[3];
- m[2][0]=-SinPhi*a1[0]+CosPhi*a2[0];
- m[2][1]=-SinPhi*a1[1]+CosPhi*a2[1];
- m[2][2]=-SinPhi*a1[2]+CosPhi*a2[2];
- m[2][3]=-SinPhi*a1[3]+CosPhi*a2[3];
-}
-
-
-/*!
- * Apply a rotation about the y axis to a matrix.
- *
- * \ingroup matrix
- */
-void
-lib3ds_matrix_rotate_y(Lib3dsMatrix m, Lib3dsFloat phi)
-{
- Lib3dsFloat SinPhi,CosPhi;
- Lib3dsFloat a0[4],a2[4];
-
- SinPhi=(Lib3dsFloat)sin(phi);
- CosPhi=(Lib3dsFloat)cos(phi);
- memcpy(a0,m[0],4*sizeof(Lib3dsFloat));
- memcpy(a2,m[2],4*sizeof(Lib3dsFloat));
- m[0][0]=CosPhi*a0[0]-SinPhi*a2[0];
- m[0][1]=CosPhi*a0[1]-SinPhi*a2[1];
- m[0][2]=CosPhi*a0[2]-SinPhi*a2[2];
- m[0][3]=CosPhi*a0[3]-SinPhi*a2[3];
- m[2][0]=SinPhi*a0[0]+CosPhi*a2[0];
- m[2][1]=SinPhi*a0[1]+CosPhi*a2[1];
- m[2][2]=SinPhi*a0[2]+CosPhi*a2[2];
- m[2][3]=SinPhi*a0[3]+CosPhi*a2[3];
-}
-
-
-/*!
- * Apply a rotation about the z axis to a matrix.
- *
- * \ingroup matrix
- */
-void
-lib3ds_matrix_rotate_z(Lib3dsMatrix m, Lib3dsFloat phi)
-{
- Lib3dsFloat SinPhi,CosPhi;
- Lib3dsFloat a0[4],a1[4];
-
- SinPhi=(Lib3dsFloat)sin(phi);
- CosPhi=(Lib3dsFloat)cos(phi);
- memcpy(a0,m[0],4*sizeof(Lib3dsFloat));
- memcpy(a1,m[1],4*sizeof(Lib3dsFloat));
- m[0][0]=CosPhi*a0[0]+SinPhi*a1[0];
- m[0][1]=CosPhi*a0[1]+SinPhi*a1[1];
- m[0][2]=CosPhi*a0[2]+SinPhi*a1[2];
- m[0][3]=CosPhi*a0[3]+SinPhi*a1[3];
- m[1][0]=-SinPhi*a0[0]+CosPhi*a1[0];
- m[1][1]=-SinPhi*a0[1]+CosPhi*a1[1];
- m[1][2]=-SinPhi*a0[2]+CosPhi*a1[2];
- m[1][3]=-SinPhi*a0[3]+CosPhi*a1[3];
-}
-
-
-/*!
- * Apply a rotation about an arbitrary axis to a matrix.
- *
- * \ingroup matrix
- */
-void
-lib3ds_matrix_rotate(Lib3dsMatrix m, Lib3dsQuat q)
-{
- Lib3dsFloat s,xs,ys,zs,wx,wy,wz,xx,xy,xz,yy,yz,zz,l;
- Lib3dsMatrix R;
-
- l=q[0]*q[0] + q[1]*q[1] + q[2]*q[2] + q[3]*q[3];
- if (fabs(l)<LIB3DS_EPSILON) {
- s=1.0f;
- }
- else {
- s=2.0f/l;
- }
-
- xs = q[0] * s; ys = q[1] * s; zs = q[2] * s;
- wx = q[3] * xs; wy = q[3] * ys; wz = q[3] * zs;
- xx = q[0] * xs; xy = q[0] * ys; xz = q[0] * zs;
- yy = q[1] * ys; yz = q[1] * zs; zz = q[2] * zs;
-
- R[0][0]=1.0f - (yy +zz);
- R[1][0]=xy - wz;
- R[2][0]=xz + wy;
- R[0][1]=xy + wz;
- R[1][1]=1.0f - (xx +zz);
- R[2][1]=yz - wx;
- R[0][2]=xz - wy;
- R[1][2]=yz + wx;
- R[2][2]=1.0f - (xx + yy);
- R[3][0]=R[3][1]=R[3][2]=R[0][3]=R[1][3]=R[2][3]=0.0f;
- R[3][3]=1.0f;
-
- lib3ds_matrix_mult(m,R);
-}
-
-
-/*!
- * Apply a rotation about an arbitrary axis to a matrix.
- *
- * \ingroup matrix
- */
-void
-lib3ds_matrix_rotate_axis(Lib3dsMatrix m, Lib3dsVector axis, Lib3dsFloat angle)
-{
- Lib3dsQuat q;
-
- lib3ds_quat_axis_angle(q,axis,angle);
- lib3ds_matrix_rotate(m,q);
-}
-
-
-/*!
- * Compute a camera matrix based on position, target and roll.
- *
- * Generates a translate/rotate matrix that maps world coordinates
- * to camera coordinates. Resulting matrix does not include perspective
- * transform.
- *
- * \param matrix Destination matrix.
- * \param pos Camera position
- * \param tgt Camera target
- * \param roll Roll angle
- *
- * \ingroup matrix
- */
-void
-lib3ds_matrix_camera(Lib3dsMatrix matrix, Lib3dsVector pos,
- Lib3dsVector tgt, Lib3dsFloat roll)
-{
- Lib3dsMatrix M;
- Lib3dsVector x, y, z;
-
- lib3ds_vector_sub(y, tgt, pos);
- lib3ds_vector_normalize(y);
-
- if (y[0] != 0. || y[1] != 0) {
- z[0] = 0;
- z[1] = 0;
- z[2] = 1.0;
- }
- else { /* Special case: looking straight up or down z axis */
- z[0] = -1.0;
- z[1] = 0;
- z[2] = 0;
- }
-
- lib3ds_vector_cross(x, y, z);
- lib3ds_vector_cross(z, x, y);
- lib3ds_vector_normalize(x);
- lib3ds_vector_normalize(z);
-
- lib3ds_matrix_identity(M);
- M[0][0] = x[0];
- M[1][0] = x[1];
- M[2][0] = x[2];
- M[0][1] = y[0];
- M[1][1] = y[1];
- M[2][1] = y[2];
- M[0][2] = z[0];
- M[1][2] = z[1];
- M[2][2] = z[2];
-
- lib3ds_matrix_identity(matrix);
- lib3ds_matrix_rotate_y(matrix, roll);
- lib3ds_matrix_mult(matrix, M);
- lib3ds_matrix_translate_xyz(matrix, -pos[0],-pos[1],-pos[2]);
-}
-
-
-/*!
- * \ingroup matrix
- */
-void
-lib3ds_matrix_dump(Lib3dsMatrix matrix)
-{
- int i,j;
-
- for (i=0; i<4; ++i) {
- for (j=0; j<4; ++j) {
- printf("%f ", matrix[j][i]);
- }
- printf("\n");
- }
-}
-
-
-
-
-
diff --git a/3rdparty/lib3ds/matrix.h b/3rdparty/lib3ds/matrix.h
deleted file mode 100644
index 756b52d2..00000000
--- a/3rdparty/lib3ds/matrix.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- c -*- */
-#ifndef INCLUDED_LIB3DS_MATRIX_H
-#define INCLUDED_LIB3DS_MATRIX_H
-/*
- * The 3D Studio File Format Library
- * Copyright (C) 1996-2007 by Jan Eric Kyprianidis <www.kyprianidis.com>
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id: matrix.h,v 1.8 2007/06/18 06:11:32 jeh Exp $
- */
-
-#ifndef INCLUDED_LIB3DS_TYPES_H
-#include <lib3ds/types.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern LIB3DSAPI void lib3ds_matrix_zero(Lib3dsMatrix m);
-extern LIB3DSAPI void lib3ds_matrix_identity(Lib3dsMatrix m);
-extern LIB3DSAPI void lib3ds_matrix_copy(Lib3dsMatrix dest, Lib3dsMatrix src);
-extern LIB3DSAPI void lib3ds_matrix_neg(Lib3dsMatrix m);
-extern LIB3DSAPI void lib3ds_matrix_abs(Lib3dsMatrix m);
-extern LIB3DSAPI void lib3ds_matrix_transpose(Lib3dsMatrix m);
-extern LIB3DSAPI void _lib3ds_matrix_add(Lib3dsMatrix m, Lib3dsMatrix a, Lib3dsMatrix b);
-extern LIB3DSAPI void _lib3ds_matrix_sub(Lib3dsMatrix m, Lib3dsMatrix a, Lib3dsMatrix b);
-extern LIB3DSAPI void lib3ds_matrix_mult(Lib3dsMatrix m, Lib3dsMatrix n);
-extern LIB3DSAPI void lib3ds_matrix_scalar(Lib3dsMatrix m, Lib3dsFloat k);
-extern LIB3DSAPI Lib3dsFloat lib3ds_matrix_det(Lib3dsMatrix m);
-extern LIB3DSAPI void lib3ds_matrix_adjoint(Lib3dsMatrix m);
-extern LIB3DSAPI Lib3dsBool lib3ds_matrix_inv(Lib3dsMatrix m);
-extern LIB3DSAPI void lib3ds_matrix_translate_xyz(Lib3dsMatrix m, Lib3dsFloat x, Lib3dsFloat y, Lib3dsFloat z);
-extern LIB3DSAPI void lib3ds_matrix_translate(Lib3dsMatrix m, Lib3dsVector t);
-extern LIB3DSAPI void lib3ds_matrix_scale_xyz(Lib3dsMatrix m, Lib3dsFloat x, Lib3dsFloat y, Lib3dsFloat z);
-extern LIB3DSAPI void lib3ds_matrix_scale(Lib3dsMatrix m, Lib3dsVector s);
-extern LIB3DSAPI void lib3ds_matrix_rotate_x(Lib3dsMatrix m, Lib3dsFloat phi);
-extern LIB3DSAPI void lib3ds_matrix_rotate_y(Lib3dsMatrix m, Lib3dsFloat phi);
-extern LIB3DSAPI void lib3ds_matrix_rotate_z(Lib3dsMatrix m, Lib3dsFloat phi);
-extern LIB3DSAPI void lib3ds_matrix_rotate(Lib3dsMatrix m, Lib3dsQuat q);
-extern LIB3DSAPI void lib3ds_matrix_rotate_axis(Lib3dsMatrix m, Lib3dsVector axis, Lib3dsFloat angle);
-extern LIB3DSAPI void lib3ds_matrix_camera(Lib3dsMatrix matrix, Lib3dsVector pos, Lib3dsVector tgt, Lib3dsFloat roll);
-extern LIB3DSAPI void lib3ds_matrix_dump(Lib3dsMatrix matrix);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
-
diff --git a/3rdparty/lib3ds/mesh.c b/3rdparty/lib3ds/mesh.c
deleted file mode 100644
index 6ff65554..00000000
--- a/3rdparty/lib3ds/mesh.c
+++ /dev/null
@@ -1,1056 +0,0 @@
-/*
- * The 3D Studio File Format Library
- * Copyright (C) 1996-2007 by Jan Eric Kyprianidis <www.kyprianidis.com>
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id: mesh.c,v 1.29 2007/06/20 17:04:08 jeh Exp $
- */
-#include <lib3ds/mesh.h>
-#include <lib3ds/io.h>
-#include <lib3ds/chunk.h>
-#include <lib3ds/vector.h>
-#include <lib3ds/matrix.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-#include <float.h>
-
-
-/*!
- * \defgroup mesh Meshes
- */
-
-
-static Lib3dsBool
-face_array_read(Lib3dsMesh *mesh, Lib3dsIo *io)
-{
- Lib3dsChunk c;
- Lib3dsWord chunk;
- int i;
- int faces;
-
- if (!lib3ds_chunk_read_start(&c, LIB3DS_FACE_ARRAY, io)) {
- return(LIB3DS_FALSE);
- }
- lib3ds_mesh_free_face_list(mesh);
-
- faces=lib3ds_io_read_word(io);
- if (faces) {
- if (!lib3ds_mesh_new_face_list(mesh, faces)) {
- LIB3DS_ERROR_LOG;
- return(LIB3DS_FALSE);
- }
- for (i=0; i<faces; ++i) {
- strcpy(mesh->faceL[i].material, "");
- mesh->faceL[i].points[0]=lib3ds_io_read_word(io);
- mesh->faceL[i].points[1]=lib3ds_io_read_word(io);
- mesh->faceL[i].points[2]=lib3ds_io_read_word(io);
- mesh->faceL[i].flags=lib3ds_io_read_word(io);
- }
- lib3ds_chunk_read_tell(&c, io);
-
- while ((chunk=lib3ds_chunk_read_next(&c, io))!=0) {
- switch (chunk) {
- case LIB3DS_SMOOTH_GROUP:
- {
- unsigned i;
-
- for (i=0; i<mesh->faces; ++i) {
- mesh->faceL[i].smoothing=lib3ds_io_read_dword(io);
- }
- }
- break;
- case LIB3DS_MSH_MAT_GROUP:
- {
- char name[64];
- unsigned faces;
- unsigned i;
- unsigned index;
-
- if (!lib3ds_io_read_string(io, name, 64)) {
- return(LIB3DS_FALSE);
- }
- faces=lib3ds_io_read_word(io);
- for (i=0; i<faces; ++i) {
- index=lib3ds_io_read_word(io);
- ASSERT(index<mesh->faces);
- strcpy(mesh->faceL[index].material, name);
- }
- }
- break;
- case LIB3DS_MSH_BOXMAP:
- {
- char name[64];
-
- if (!lib3ds_io_read_string(io, name, 64)) {
- return(LIB3DS_FALSE);
- }
- strcpy(mesh->box_map.front, name);
- if (!lib3ds_io_read_string(io, name, 64)) {
- return(LIB3DS_FALSE);
- }
- strcpy(mesh->box_map.back, name);
- if (!lib3ds_io_read_string(io, name, 64)) {
- return(LIB3DS_FALSE);
- }
- strcpy(mesh->box_map.left, name);
- if (!lib3ds_io_read_string(io, name, 64)) {
- return(LIB3DS_FALSE);
- }
- strcpy(mesh->box_map.right, name);
- if (!lib3ds_io_read_string(io, name, 64)) {
- return(LIB3DS_FALSE);
- }
- strcpy(mesh->box_map.top, name);
- if (!lib3ds_io_read_string(io, name, 64)) {
- return(LIB3DS_FALSE);
- }
- strcpy(mesh->box_map.bottom, name);
- }
- break;
- default:
- lib3ds_chunk_unknown(chunk);
- }
- }
-
- }
- lib3ds_chunk_read_end(&c, io);
- return(LIB3DS_TRUE);
-}
-
-
-/*!
- * Create and return a new empty mesh object.
- *
- * Mesh is initialized with the name and an identity matrix; all
- * other fields are zero.
- *
- * See Lib3dsFaceFlag for definitions of per-face flags.
- *
- * \param name Mesh name. Must not be NULL. Must be < 64 characters.
- *
- * \return mesh object or NULL on error.
- *
- * \ingroup mesh
- */
-Lib3dsMesh*
-lib3ds_mesh_new(const char *name)
-{
- Lib3dsMesh *mesh;
-
- ASSERT(name);
- ASSERT(strlen(name)<64);
-
- mesh=(Lib3dsMesh*)calloc(sizeof(Lib3dsMesh), 1);
- if (!mesh) {
- return(0);
- }
- strcpy(mesh->name, name);
- lib3ds_matrix_identity(mesh->matrix);
- mesh->map_data.maptype=LIB3DS_MAP_NONE;
- return(mesh);
-}
-
-
-/*!
- * Free a mesh object and all of its resources.
- *
- * \param mesh Mesh object to be freed.
- *
- * \ingroup mesh
- */
-void
-lib3ds_mesh_free(Lib3dsMesh *mesh)
-{
- lib3ds_mesh_free_point_list(mesh);
- lib3ds_mesh_free_flag_list(mesh);
- lib3ds_mesh_free_texel_list(mesh);
- lib3ds_mesh_free_face_list(mesh);
- memset(mesh, 0, sizeof(Lib3dsMesh));
- free(mesh);
-}
-
-
-/*!
- * Allocate point list in mesh object.
- *
- * This function frees the current point list, if any, and allocates
- * a new one large enough to hold the specified number of points.
- *
- * \param mesh Mesh object for which points are to be allocated.
- * \param points Number of points in the new point list.
- *
- * \return LIB3DS_TRUE on success, LIB3DS_FALSE on failure.
- *
- * \ingroup mesh
- */
-Lib3dsBool
-lib3ds_mesh_new_point_list(Lib3dsMesh *mesh, Lib3dsDword points)
-{
- ASSERT(mesh);
- if (mesh->pointL) {
- ASSERT(mesh->points);
- lib3ds_mesh_free_point_list(mesh);
- }
- ASSERT(!mesh->pointL && !mesh->points);
- mesh->points=0;
- mesh->pointL=calloc(sizeof(Lib3dsPoint)*points,1);
- if (!mesh->pointL) {
- LIB3DS_ERROR_LOG;
- return(LIB3DS_FALSE);
- }
- mesh->points=points;
- return(LIB3DS_TRUE);
-}
-
-
-/*!
- * Free point list in mesh object.
- *
- * The current point list is freed and set to NULL. mesh->points is
- * set to zero.
- *
- * \param mesh Mesh object to be modified.
- *
- * \ingroup mesh
- */
-void
-lib3ds_mesh_free_point_list(Lib3dsMesh *mesh)
-{
- ASSERT(mesh);
- if (mesh->pointL) {
- ASSERT(mesh->points);
- free(mesh->pointL);
- mesh->pointL=0;
- mesh->points=0;
- }
- else {
- ASSERT(!mesh->points);
- }
-}
-
-
-/*!
- * Allocate flag list in mesh object.
- *
- * This function frees the current flag list, if any, and allocates
- * a new one large enough to hold the specified number of flags.
- * All flags are initialized to 0
- *
- * \param mesh Mesh object for which points are to be allocated.
- * \param flags Number of flags in the new flag list.
- *
- * \return LIB3DS_TRUE on success, LIB3DS_FALSE on failure.
- *
- * \ingroup mesh
- */
-Lib3dsBool
-lib3ds_mesh_new_flag_list(Lib3dsMesh *mesh, Lib3dsDword flags)
-{
- ASSERT(mesh);
- if (mesh->flagL) {
- ASSERT(mesh->flags);
- lib3ds_mesh_free_flag_list(mesh);
- }
- ASSERT(!mesh->flagL && !mesh->flags);
- mesh->flags=0;
- mesh->flagL=calloc(sizeof(Lib3dsWord)*flags,1);
- if (!mesh->flagL) {
- LIB3DS_ERROR_LOG;
- return(LIB3DS_FALSE);
- }
- mesh->flags=flags;
- return(LIB3DS_TRUE);
-}
-
-
-/*!
- * Free flag list in mesh object.
- *
- * The current flag list is freed and set to NULL. mesh->flags is
- * set to zero.
- *
- * \param mesh Mesh object to be modified.
- *
- * \ingroup mesh
- */
-void
-lib3ds_mesh_free_flag_list(Lib3dsMesh *mesh)
-{
- ASSERT(mesh);
- if (mesh->flagL) {
- ASSERT(mesh->flags);
- free(mesh->flagL);
- mesh->flagL=0;
- mesh->flags=0;
- }
- else {
- ASSERT(!mesh->flags);
- }
-}
-
-
-/*!
- * Allocate texel list in mesh object.
- *
- * This function frees the current texel list, if any, and allocates
- * a new one large enough to hold the specified number of texels.
- *
- * \param mesh Mesh object for which points are to be allocated.
- * \param texels Number of texels in the new texel list.
- *
- * \return LIB3DS_TRUE on success, LIB3DS_FALSE on failure.
- *
- * \ingroup mesh
- */
-Lib3dsBool
-lib3ds_mesh_new_texel_list(Lib3dsMesh *mesh, Lib3dsDword texels)
-{
- ASSERT(mesh);
- if (mesh->texelL) {
- ASSERT(mesh->texels);
- lib3ds_mesh_free_texel_list(mesh);
- }
- ASSERT(!mesh->texelL && !mesh->texels);
- mesh->texels=0;
- mesh->texelL=calloc(sizeof(Lib3dsTexel)*texels,1);
- if (!mesh->texelL) {
- LIB3DS_ERROR_LOG;
- return(LIB3DS_FALSE);
- }
- mesh->texels=texels;
- return(LIB3DS_TRUE);
-}
-
-
-/*!
- * Free texel list in mesh object.
- *
- * The current texel list is freed and set to NULL. mesh->texels is
- * set to zero.
- *
- * \param mesh Mesh object to be modified.
- *
- * \ingroup mesh
- */
-void
-lib3ds_mesh_free_texel_list(Lib3dsMesh *mesh)
-{
- ASSERT(mesh);
- if (mesh->texelL) {
- ASSERT(mesh->texels);
- free(mesh->texelL);
- mesh->texelL=0;
- mesh->texels=0;
- }
- else {
- ASSERT(!mesh->texels);
- }
-}
-
-
-/*!
- * Allocate face list in mesh object.
- *
- * This function frees the current face list, if any, and allocates
- * a new one large enough to hold the specified number of faces.
- *
- * \param mesh Mesh object for which points are to be allocated.
- * \param faces Number of faces in the new face list.
- *
- * \return LIB3DS_TRUE on success, LIB3DS_FALSE on failure.
- *
- * \ingroup mesh
- */
-Lib3dsBool
-lib3ds_mesh_new_face_list(Lib3dsMesh *mesh, Lib3dsDword faces)
-{
- ASSERT(mesh);
- if (mesh->faceL) {
- ASSERT(mesh->faces);
- lib3ds_mesh_free_face_list(mesh);
- }
- ASSERT(!mesh->faceL && !mesh->faces);
- mesh->faces=0;
- mesh->faceL=calloc(sizeof(Lib3dsFace)*faces,1);
- if (!mesh->faceL) {
- LIB3DS_ERROR_LOG;
- return(LIB3DS_FALSE);
- }
- mesh->faces=faces;
- return(LIB3DS_TRUE);
-}
-
-
-/*!
- * Free face list in mesh object.
- *
- * The current face list is freed and set to NULL. mesh->faces is
- * set to zero.
- *
- * \param mesh Mesh object to be modified.
- *
- * \ingroup mesh
- */
-void
-lib3ds_mesh_free_face_list(Lib3dsMesh *mesh)
-{
- ASSERT(mesh);
- if (mesh->faceL) {
- ASSERT(mesh->faces);
- free(mesh->faceL);
- mesh->faceL=0;
- mesh->faces=0;
- }
- else {
- ASSERT(!mesh->faces);
- }
-}
-
-
-/*!
- * Find the bounding box of a mesh object.
- *
- * \param mesh The mesh object
- * \param bmin Returned bounding box
- * \param bmax Returned bounding box
- *
- * \ingroup mesh
- */
-void
-lib3ds_mesh_bounding_box(Lib3dsMesh *mesh, Lib3dsVector bmin, Lib3dsVector bmax)
-{
- unsigned i;
- bmin[0] = bmin[1] = bmin[2] = FLT_MAX;
- bmax[0] = bmax[1] = bmax[2] = FLT_MIN;
-
- for (i=0; i<mesh->points; ++i) {
- lib3ds_vector_min(bmin, mesh->pointL[i].pos);
- lib3ds_vector_max(bmax, mesh->pointL[i].pos);
- }
-}
-
-
-typedef struct _Lib3dsFaces Lib3dsFaces;
-
-struct _Lib3dsFaces {
- Lib3dsFaces *next;
- Lib3dsFace *face;
-};
-
-
-/*!
- * Calculates the vertex normals corresponding to the smoothing group
- * settings for each face of a mesh.
- *
- * \param mesh A pointer to the mesh to calculate the normals for.
- * \param normalL A pointer to a buffer to store the calculated
- * normals. The buffer must have the size:
- * 3*sizeof(Lib3dsVector)*mesh->faces.
- *
- * To allocate the normal buffer do for example the following:
- * \code
- * Lib3dsVector *normalL = malloc(3*sizeof(Lib3dsVector)*mesh->faces);
- * \endcode
- *
- * To access the normal of the i-th vertex of the j-th face do the
- * following:
- * \code
- * normalL[3*j+i]
- * \endcode
- *
- * \ingroup mesh
- */
-void
-lib3ds_mesh_calculate_normals(Lib3dsMesh *mesh, Lib3dsVector *normalL)
-{
- Lib3dsFaces **fl;
- Lib3dsFaces *fa;
- unsigned i,j,k;
-
- if (!mesh->faces) {
- return;
- }
-
- fl=calloc(sizeof(Lib3dsFaces*),mesh->points);
- ASSERT(fl);
- fa=calloc(sizeof(Lib3dsFaces),3*mesh->faces);
- ASSERT(fa);
- k=0;
- for (i=0; i<mesh->faces; ++i) {
- Lib3dsFace *f=&mesh->faceL[i];
- for (j=0; j<3; ++j) {
- Lib3dsFaces* l=&fa[k++];
- ASSERT(f->points[j]<mesh->points);
- l->face=f;
- l->next=fl[f->points[j]];
- fl[f->points[j]]=l;
- }
- }
-
- for (i=0; i<mesh->faces; ++i) {
- Lib3dsFace *f=&mesh->faceL[i];
- for (j=0; j<3; ++j) {
- // FIXME: static array needs at least check!!
- Lib3dsVector n,N[128];
- Lib3dsFaces *p;
- int k,l;
- int found;
-
- ASSERT(f->points[j]<mesh->points);
-
- if (f->smoothing) {
- lib3ds_vector_zero(n);
- k=0;
- for (p=fl[f->points[j]]; p; p=p->next) {
- found=0;
- for (l=0; l<k; ++l) {
- if ( l >= 128 )
- printf("array N overflow: i=%d, j=%d, k=%d\n", i,j,k);
- if (fabs(lib3ds_vector_dot(N[l], p->face->normal)-1.0)<1e-5) {
- found=1;
- break;
- }
- }
- if (!found) {
- if (f->smoothing & p->face->smoothing) {
- lib3ds_vector_add(n,n, p->face->normal);
- lib3ds_vector_copy(N[k], p->face->normal);
- ++k;
- }
- }
- }
- }
- else {
- lib3ds_vector_copy(n, f->normal);
- }
- lib3ds_vector_normalize(n);
-
- lib3ds_vector_copy(normalL[3*i+j], n);
- }
- }
-
- free(fa);
- free(fl);
-}
-
-
-/*!
- * This function prints data associated with the specified mesh such as
- * vertex and point lists.
- *
- * \param mesh Points to a mesh that you wish to view the data for.
- *
- * \return None
- *
- * \warning WIN32: Should only be used in a console window not in a GUI.
- *
- * \ingroup mesh
- */
-void
-lib3ds_mesh_dump(Lib3dsMesh *mesh)
-{
- unsigned i;
- Lib3dsVector p;
-
- ASSERT(mesh);
- printf(" %s vertices=%ld faces=%ld\n",
- mesh->name,
- (long)(mesh->points),
- (long)(mesh->faces)
- );
- printf(" matrix:\n");
- lib3ds_matrix_dump(mesh->matrix);
- printf(" point list:\n");
- for (i=0; i<mesh->points; ++i) {
- lib3ds_vector_copy(p, mesh->pointL[i].pos);
- printf (" %8f %8f %8f\n", p[0], p[1], p[2]);
- }
- printf(" facelist:\n");
- for (i=0; i<mesh->faces; ++i) {
- printf (" %4d %4d %4d smoothing:%X flags:%X material:\"%s\"\n",
- mesh->faceL[i].points[0],
- mesh->faceL[i].points[1],
- mesh->faceL[i].points[2],
- (unsigned)mesh->faceL[i].smoothing,
- mesh->faceL[i].flags,
- mesh->faceL[i].material
- );
- }
-}
-
-
-/*!
- * \ingroup mesh
- */
-Lib3dsBool
-lib3ds_mesh_read(Lib3dsMesh *mesh, Lib3dsIo *io)
-{
- Lib3dsChunk c;
- Lib3dsWord chunk;
-
- if (!lib3ds_chunk_read_start(&c, LIB3DS_N_TRI_OBJECT, io)) {
- return(LIB3DS_FALSE);
- }
-
- while ((chunk=lib3ds_chunk_read_next(&c, io))!=0) {
- switch (chunk) {
- case LIB3DS_MESH_MATRIX:
- {
- int i,j;
-
- lib3ds_matrix_identity(mesh->matrix);
- for (i=0; i<4; i++) {
- for (j=0; j<3; j++) {
- mesh->matrix[i][j]=lib3ds_io_read_float(io);
- }
- }
- }
- break;
- case LIB3DS_MESH_COLOR:
- {
- mesh->color=lib3ds_io_read_byte(io);
- }
- break;
- case LIB3DS_POINT_ARRAY:
- {
- unsigned i,j;
- unsigned points;
-
- lib3ds_mesh_free_point_list(mesh);
- points=lib3ds_io_read_word(io);
- if (points) {
- if (!lib3ds_mesh_new_point_list(mesh, points)) {
- LIB3DS_ERROR_LOG;
- return(LIB3DS_FALSE);
- }
- for (i=0; i<mesh->points; ++i) {
- for (j=0; j<3; ++j) {
- mesh->pointL[i].pos[j]=lib3ds_io_read_float(io);
- }
- }
- ASSERT((!mesh->flags) || (mesh->points==mesh->flags));
- ASSERT((!mesh->texels) || (mesh->points==mesh->texels));
- }
- }
- break;
- case LIB3DS_POINT_FLAG_ARRAY:
- {
- unsigned i;
- unsigned flags;
-
- lib3ds_mesh_free_flag_list(mesh);
- flags=lib3ds_io_read_word(io);
- if (flags) {
- if (!lib3ds_mesh_new_flag_list(mesh, flags)) {
- LIB3DS_ERROR_LOG;
- return(LIB3DS_FALSE);
- }
- for (i=0; i<mesh->flags; ++i) {
- mesh->flagL[i]=lib3ds_io_read_word(io);
- }
- ASSERT((!mesh->points) || (mesh->flags==mesh->points));
- ASSERT((!mesh->texels) || (mesh->flags==mesh->texels));
- }
- }
- break;
- case LIB3DS_FACE_ARRAY:
- {
- lib3ds_chunk_read_reset(&c, io);
- if (!face_array_read(mesh, io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_MESH_TEXTURE_INFO:
- {
- int i,j;
-
- for (i=0; i<2; ++i) {
- mesh->map_data.tile[i]=lib3ds_io_read_float(io);
- }
- for (i=0; i<3; ++i) {
- mesh->map_data.pos[i]=lib3ds_io_read_float(io);
- }
- mesh->map_data.scale=lib3ds_io_read_float(io);
-
- lib3ds_matrix_identity(mesh->map_data.matrix);
- for (i=0; i<4; i++) {
- for (j=0; j<3; j++) {
- mesh->map_data.matrix[i][j]=lib3ds_io_read_float(io);
- }
- }
- for (i=0; i<2; ++i) {
- mesh->map_data.planar_size[i]=lib3ds_io_read_float(io);
- }
- mesh->map_data.cylinder_height=lib3ds_io_read_float(io);
- }
- break;
- case LIB3DS_TEX_VERTS:
- {
- unsigned i;
- unsigned texels;
-
- lib3ds_mesh_free_texel_list(mesh);
- texels=lib3ds_io_read_word(io);
- if (texels) {
- if (!lib3ds_mesh_new_texel_list(mesh, texels)) {
- LIB3DS_ERROR_LOG;
- return(LIB3DS_FALSE);
- }
- for (i=0; i<mesh->texels; ++i) {
- mesh->texelL[i][0]=lib3ds_io_read_float(io);
- mesh->texelL[i][1]=lib3ds_io_read_float(io);
- }
- ASSERT((!mesh->points) || (mesh->texels==mesh->points));
- ASSERT((!mesh->flags) || (mesh->texels==mesh->flags));
- }
- }
- break;
- default:
- lib3ds_chunk_unknown(chunk);
- }
- }
- {
- unsigned j;
-
- for (j=0; j<mesh->faces; ++j) {
- ASSERT(mesh->faceL[j].points[0]<mesh->points);
- ASSERT(mesh->faceL[j].points[1]<mesh->points);
- ASSERT(mesh->faceL[j].points[2]<mesh->points);
- lib3ds_vector_normal(
- mesh->faceL[j].normal,
- mesh->pointL[mesh->faceL[j].points[0]].pos,
- mesh->pointL[mesh->faceL[j].points[1]].pos,
- mesh->pointL[mesh->faceL[j].points[2]].pos
- );
- }
- }
-
- if (lib3ds_matrix_det(mesh->matrix) < 0.0)
- {
- /* Flip X coordinate of vertices if mesh matrix
- has negative determinant */
- Lib3dsMatrix inv_matrix, M;
- Lib3dsVector tmp;
- unsigned i;
-
- lib3ds_matrix_copy(inv_matrix, mesh->matrix);
- lib3ds_matrix_inv(inv_matrix);
-
- lib3ds_matrix_copy(M, mesh->matrix);
- lib3ds_matrix_scale_xyz(M, -1.0f, 1.0f, 1.0f);
- lib3ds_matrix_mult(M, inv_matrix);
-
- for (i=0; i<mesh->points; ++i) {
- lib3ds_vector_transform(tmp, M, mesh->pointL[i].pos);
- lib3ds_vector_copy(mesh->pointL[i].pos, tmp);
- }
- }
-
- lib3ds_chunk_read_end(&c, io);
-
- return(LIB3DS_TRUE);
-}
-
-
-static Lib3dsBool
-point_array_write(Lib3dsMesh *mesh, Lib3dsIo *io)
-{
- Lib3dsChunk c;
- unsigned i;
-
- if (!mesh->points || !mesh->pointL) {
- return(LIB3DS_TRUE);
- }
- ASSERT(mesh->points<0x10000);
- c.chunk=LIB3DS_POINT_ARRAY;
- c.size=8+12*mesh->points;
- lib3ds_chunk_write(&c, io);
-
- lib3ds_io_write_word(io, (Lib3dsWord)mesh->points);
-
- if (lib3ds_matrix_det(mesh->matrix) >= 0.0f) {
- for (i=0; i<mesh->points; ++i) {
- lib3ds_io_write_vector(io, mesh->pointL[i].pos);
- }
- }
- else {
- /* Flip X coordinate of vertices if mesh matrix
- has negative determinant */
- Lib3dsMatrix inv_matrix, M;
- Lib3dsVector tmp;
-
- lib3ds_matrix_copy(inv_matrix, mesh->matrix);
- lib3ds_matrix_inv(inv_matrix);
- lib3ds_matrix_copy(M, mesh->matrix);
- lib3ds_matrix_scale_xyz(M, -1.0f, 1.0f, 1.0f);
- lib3ds_matrix_mult(M, inv_matrix);
-
- for (i=0; i<mesh->points; ++i) {
- lib3ds_vector_transform(tmp, M, mesh->pointL[i].pos);
- lib3ds_io_write_vector(io, tmp);
- }
- }
-
- return(LIB3DS_TRUE);
-}
-
-
-static Lib3dsBool
-flag_array_write(Lib3dsMesh *mesh, Lib3dsIo *io)
-{
- Lib3dsChunk c;
- unsigned i;
-
- if (!mesh->flags || !mesh->flagL) {
- return(LIB3DS_TRUE);
- }
- ASSERT(mesh->flags<0x10000);
- c.chunk=LIB3DS_POINT_FLAG_ARRAY;
- c.size=8+2*mesh->flags;
- lib3ds_chunk_write(&c, io);
-
- lib3ds_io_write_word(io, (Lib3dsWord)mesh->flags);
- for (i=0; i<mesh->flags; ++i) {
- lib3ds_io_write_word(io, mesh->flagL[i]);
- }
- return(LIB3DS_TRUE);
-}
-
-
-static Lib3dsBool
-face_array_write(Lib3dsMesh *mesh, Lib3dsIo *io)
-{
- Lib3dsChunk c;
-
- if (!mesh->faces || !mesh->faceL) {
- return(LIB3DS_TRUE);
- }
- ASSERT(mesh->faces<0x10000);
- c.chunk=LIB3DS_FACE_ARRAY;
- if (!lib3ds_chunk_write_start(&c, io)) {
- return(LIB3DS_FALSE);
- }
- {
- unsigned i;
-
- lib3ds_io_write_word(io, (Lib3dsWord)mesh->faces);
- for (i=0; i<mesh->faces; ++i) {
- lib3ds_io_write_word(io, mesh->faceL[i].points[0]);
- lib3ds_io_write_word(io, mesh->faceL[i].points[1]);
- lib3ds_io_write_word(io, mesh->faceL[i].points[2]);
- lib3ds_io_write_word(io, mesh->faceL[i].flags);
- }
- }
-
- { /*---- MSH_MAT_GROUP ----*/
- Lib3dsChunk c;
- unsigned i,j;
- Lib3dsWord num;
- char *matf=calloc(sizeof(char), mesh->faces);
- if (!matf) {
- return(LIB3DS_FALSE);
- }
-
- for (i=0; i<mesh->faces; ++i) {
- if (!matf[i] && strlen(mesh->faceL[i].material)) {
- matf[i]=1;
- num=1;
-
- for (j=i+1; j<mesh->faces; ++j) {
- if (strcmp(mesh->faceL[i].material, mesh->faceL[j].material)==0) ++num;
- }
-
- c.chunk=LIB3DS_MSH_MAT_GROUP;
- c.size=6+ (Lib3dsDword)strlen(mesh->faceL[i].material)+1 +2+2*num;
- lib3ds_chunk_write(&c, io);
- lib3ds_io_write_string(io, mesh->faceL[i].material);
- lib3ds_io_write_word(io, num);
- lib3ds_io_write_word(io, (Lib3dsWord)i);
-
- for (j=i+1; j<mesh->faces; ++j) {
- if (strcmp(mesh->faceL[i].material, mesh->faceL[j].material)==0) {
- lib3ds_io_write_word(io, (Lib3dsWord)j);
- matf[j]=1;
- }
- }
- }
- }
- free(matf);
- }
-
- { /*---- SMOOTH_GROUP ----*/
- Lib3dsChunk c;
- unsigned i;
-
- c.chunk=LIB3DS_SMOOTH_GROUP;
- c.size=6+4*mesh->faces;
- lib3ds_chunk_write(&c, io);
-
- for (i=0; i<mesh->faces; ++i) {
- lib3ds_io_write_dword(io, mesh->faceL[i].smoothing);
- }
- }
-
- { /*---- MSH_BOXMAP ----*/
- Lib3dsChunk c;
-
- if (strlen(mesh->box_map.front) ||
- strlen(mesh->box_map.back) ||
- strlen(mesh->box_map.left) ||
- strlen(mesh->box_map.right) ||
- strlen(mesh->box_map.top) ||
- strlen(mesh->box_map.bottom)) {
-
- c.chunk=LIB3DS_MSH_BOXMAP;
- if (!lib3ds_chunk_write_start(&c, io)) {
- return(LIB3DS_FALSE);
- }
-
- lib3ds_io_write_string(io, mesh->box_map.front);
- lib3ds_io_write_string(io, mesh->box_map.back);
- lib3ds_io_write_string(io, mesh->box_map.left);
- lib3ds_io_write_string(io, mesh->box_map.right);
- lib3ds_io_write_string(io, mesh->box_map.top);
- lib3ds_io_write_string(io, mesh->box_map.bottom);
-
- if (!lib3ds_chunk_write_end(&c, io)) {
- return(LIB3DS_FALSE);
- }
- }
- }
-
- if (!lib3ds_chunk_write_end(&c, io)) {
- return(LIB3DS_FALSE);
- }
- return(LIB3DS_TRUE);
-}
-
-
-static Lib3dsBool
-texel_array_write(Lib3dsMesh *mesh, Lib3dsIo *io)
-{
- Lib3dsChunk c;
- unsigned i;
-
- if (!mesh->texels || !mesh->texelL) {
- return(LIB3DS_TRUE);
- }
- ASSERT(mesh->texels<0x10000);
- c.chunk=LIB3DS_TEX_VERTS;
- c.size=8+8*mesh->texels;
- lib3ds_chunk_write(&c, io);
-
- lib3ds_io_write_word(io, (Lib3dsWord)mesh->texels);
- for (i=0; i<mesh->texels; ++i) {
- lib3ds_io_write_float(io, mesh->texelL[i][0]);
- lib3ds_io_write_float(io, mesh->texelL[i][1]);
- }
- return(LIB3DS_TRUE);
-}
-
-
-/*!
- * \ingroup mesh
- */
-Lib3dsBool
-lib3ds_mesh_write(Lib3dsMesh *mesh, Lib3dsIo *io)
-{
- Lib3dsChunk c;
-
- c.chunk=LIB3DS_N_TRI_OBJECT;
- if (!lib3ds_chunk_write_start(&c,io)) {
- return(LIB3DS_FALSE);
- }
- if (!point_array_write(mesh, io)) {
- return(LIB3DS_FALSE);
- }
- if (!texel_array_write(mesh, io)) {
- return(LIB3DS_FALSE);
- }
-
- if (mesh->map_data.maptype!=LIB3DS_MAP_NONE) { /*---- LIB3DS_MESH_TEXTURE_INFO ----*/
- Lib3dsChunk c;
- int i,j;
-
- c.chunk=LIB3DS_MESH_TEXTURE_INFO;
- c.size=92;
- if (!lib3ds_chunk_write(&c,io)) {
- return(LIB3DS_FALSE);
- }
-
- lib3ds_io_write_word(io, mesh->map_data.maptype);
-
- for (i=0; i<2; ++i) {
- lib3ds_io_write_float(io, mesh->map_data.tile[i]);
- }
- for (i=0; i<3; ++i) {
- lib3ds_io_write_float(io, mesh->map_data.pos[i]);
- }
- lib3ds_io_write_float(io, mesh->map_data.scale);
-
- for (i=0; i<4; i++) {
- for (j=0; j<3; j++) {
- lib3ds_io_write_float(io, mesh->map_data.matrix[i][j]);
- }
- }
- for (i=0; i<2; ++i) {
- lib3ds_io_write_float(io, mesh->map_data.planar_size[i]);
- }
- lib3ds_io_write_float(io, mesh->map_data.cylinder_height);
- }
-
- if (!flag_array_write(mesh, io)) {
- return(LIB3DS_FALSE);
- }
- { /*---- LIB3DS_MESH_MATRIX ----*/
- Lib3dsChunk c;
- int i,j;
-
- c.chunk=LIB3DS_MESH_MATRIX;
- c.size=54;
- if (!lib3ds_chunk_write(&c,io)) {
- return(LIB3DS_FALSE);
- }
- for (i=0; i<4; i++) {
- for (j=0; j<3; j++) {
- lib3ds_io_write_float(io, mesh->matrix[i][j]);
- }
- }
- }
-
- if (mesh->color) { /*---- LIB3DS_MESH_COLOR ----*/
- Lib3dsChunk c;
-
- c.chunk=LIB3DS_MESH_COLOR;
- c.size=7;
- if (!lib3ds_chunk_write(&c,io)) {
- return(LIB3DS_FALSE);
- }
- lib3ds_io_write_byte(io, mesh->color);
- }
- if (!face_array_write(mesh, io)) {
- return(LIB3DS_FALSE);
- }
-
- if (!lib3ds_chunk_write_end(&c,io)) {
- return(LIB3DS_FALSE);
- }
- return(LIB3DS_TRUE);
-}
-
diff --git a/3rdparty/lib3ds/mesh.h b/3rdparty/lib3ds/mesh.h
deleted file mode 100644
index 66282e26..00000000
--- a/3rdparty/lib3ds/mesh.h
+++ /dev/null
@@ -1,157 +0,0 @@
-/* -*- c -*- */
-#ifndef INCLUDED_LIB3DS_MESH_H
-#define INCLUDED_LIB3DS_MESH_H
-/*
- * The 3D Studio File Format Library
- * Copyright (C) 1996-2007 by Jan Eric Kyprianidis <www.kyprianidis.com>
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id: mesh.h,v 1.20 2007/06/20 17:04:08 jeh Exp $
- */
-
-#ifndef INCLUDED_LIB3DS_TYPES_H
-#include <lib3ds/types.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * Triangular mesh point
- * \ingroup mesh
- */
-typedef struct Lib3dsPoint {
- Lib3dsVector pos;
-} Lib3dsPoint;
-
-/**
- * Triangular mesh face
- * \ingroup mesh
- * \sa Lib3dsFaceFlag
- */
-struct Lib3dsFace {
- Lib3dsUserData user; /*! Arbitrary user data */
- char material[64]; /*! Material name */
- Lib3dsWord points[3]; /*! Indices into mesh points list */
- Lib3dsWord flags; /*! See Lib3dsFaceFlag, below */
- Lib3dsDword smoothing; /*! Bitmask; each bit identifies a group */
- Lib3dsVector normal;
-};
-
-
-/**
- * Vertex flags
- * Meaning of _Lib3dsFace::flags. ABC are points of the current face
- * (A: is 1st vertex, B is 2nd vertex, C is 3rd vertex)
- */
-typedef enum {
- LIB3DS_FACE_FLAG_VIS_AC = 0x1, /*!< Bit 0: Edge visibility AC */
- LIB3DS_FACE_FLAG_VIS_BC = 0x2, /*!< Bit 1: Edge visibility BC */
- LIB3DS_FACE_FLAG_VIS_AB = 0x4, /*!< Bit 2: Edge visibility AB */
- LIB3DS_FACE_FLAG_WRAP_U = 0x8, /*!< Bit 3: Face is at tex U wrap seam */
- LIB3DS_FACE_FLAG_WRAP_V = 0x10, /*!< Bit 4: Face is at tex V wrap seam */
- LIB3DS_FACE_FLAG_UNK7 = 0x80, /* Bit 5-8: Unused ? */
- LIB3DS_FACE_FLAG_UNK10 = 0x400, /* Bit 9-10: Random ? */
- /* Bit 11-12: Unused ? */
- LIB3DS_FACE_FLAG_SELECT_3 = (1<<13), /*!< Bit 13: Selection of the face in selection 3*/
- LIB3DS_FACE_FLAG_SELECT_2 = (1<<14), /*!< Bit 14: Selection of the face in selection 2*/
- LIB3DS_FACE_FLAG_SELECT_1 = (1<<15), /*!< Bit 15: Selection of the face in selection 1*/
-} Lib3dsFaceFlag;
-
-/**
- * Triangular mesh box mapping settings
- * \ingroup mesh
- */
-struct Lib3dsBoxMap {
- char front[64];
- char back[64];
- char left[64];
- char right[64];
- char top[64];
- char bottom[64];
-};
-
-/**
- * Texture projection type
- * \ingroup tracks
- */
-typedef enum {
- LIB3DS_MAP_NONE =0xFFFF,
- LIB3DS_MAP_PLANAR =0,
- LIB3DS_MAP_CYLINDRICAL =1,
- LIB3DS_MAP_SPHERICAL =2
-} Lib3dsMapType;
-
-/**
- * Triangular mesh texture mapping data
- * \ingroup mesh
- */
-struct Lib3dsMapData {
- Lib3dsWord maptype;
- Lib3dsVector pos;
- Lib3dsMatrix matrix;
- Lib3dsFloat scale;
- Lib3dsFloat tile[2];
- Lib3dsFloat planar_size[2];
- Lib3dsFloat cylinder_height;
-};
-
-/**
- * Triangular mesh object
- * \ingroup mesh
- */
-struct Lib3dsMesh {
- Lib3dsUserData user; /*< Arbitrary user data */
- Lib3dsMesh *next;
- char name[64]; /*< Mesh name. Don't use more than 8 characters */
- Lib3dsDword object_flags; /*< @see Lib3dsObjectFlags */
- Lib3dsByte color;
- Lib3dsMatrix matrix; /*< Transformation matrix for mesh data */
- Lib3dsDword points; /*< Number of points in point list */
- Lib3dsPoint *pointL; /*< Point list */
- Lib3dsDword flags; /*< Number of flags in per-point flags list */
- Lib3dsWord *flagL; /*< Per-point flags list */
- Lib3dsDword texels; /*< Number of U-V texture coordinates */
- Lib3dsTexel *texelL; /*< U-V texture coordinates */
- Lib3dsDword faces; /*< Number of faces in face list */
- Lib3dsFace *faceL; /*< Face list */
- Lib3dsBoxMap box_map;
- Lib3dsMapData map_data;
-};
-
-extern LIB3DSAPI Lib3dsMesh* lib3ds_mesh_new(const char *name);
-extern LIB3DSAPI void lib3ds_mesh_free(Lib3dsMesh *mesh);
-extern LIB3DSAPI Lib3dsBool lib3ds_mesh_new_point_list(Lib3dsMesh *mesh, Lib3dsDword points);
-extern LIB3DSAPI void lib3ds_mesh_free_point_list(Lib3dsMesh *mesh);
-extern LIB3DSAPI Lib3dsBool lib3ds_mesh_new_flag_list(Lib3dsMesh *mesh, Lib3dsDword flags);
-extern LIB3DSAPI void lib3ds_mesh_free_flag_list(Lib3dsMesh *mesh);
-extern LIB3DSAPI Lib3dsBool lib3ds_mesh_new_texel_list(Lib3dsMesh *mesh, Lib3dsDword texels);
-extern LIB3DSAPI void lib3ds_mesh_free_texel_list(Lib3dsMesh *mesh);
-extern LIB3DSAPI Lib3dsBool lib3ds_mesh_new_face_list(Lib3dsMesh *mesh, Lib3dsDword flags);
-extern LIB3DSAPI void lib3ds_mesh_free_face_list(Lib3dsMesh *mesh);
-extern LIB3DSAPI void lib3ds_mesh_bounding_box(Lib3dsMesh *mesh, Lib3dsVector bmin, Lib3dsVector bmax);
-extern LIB3DSAPI void lib3ds_mesh_calculate_normals(Lib3dsMesh *mesh, Lib3dsVector *normalL);
-extern LIB3DSAPI void lib3ds_mesh_dump(Lib3dsMesh *mesh);
-extern LIB3DSAPI Lib3dsBool lib3ds_mesh_read(Lib3dsMesh *mesh, Lib3dsIo *io);
-extern LIB3DSAPI Lib3dsBool lib3ds_mesh_write(Lib3dsMesh *mesh, Lib3dsIo *io);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
-
diff --git a/3rdparty/lib3ds/node.c b/3rdparty/lib3ds/node.c
deleted file mode 100644
index 58f8a397..00000000
--- a/3rdparty/lib3ds/node.c
+++ /dev/null
@@ -1,1089 +0,0 @@
-/*
- * The 3D Studio File Format Library
- * Copyright (C) 1996-2007 by Jan Eric Kyprianidis <www.kyprianidis.com>
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id: node.c,v 1.20 2007/06/20 17:04:08 jeh Exp $
- */
-#include <lib3ds/node.h>
-#include <lib3ds/file.h>
-#include <lib3ds/io.h>
-#include <lib3ds/chunk.h>
-#include <lib3ds/matrix.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-
-
-/*!
- * \defgroup node Animation Nodes
- */
-
-
-/*!
- * Create and return a new ambient node.
- *
- * The node is returned with an identity matrix. All other fields
- * are zero.
- *
- * \return Lib3dsNode
- *
- * \ingroup node
- */
-Lib3dsNode*
-lib3ds_node_new_ambient()
-{
- Lib3dsNode *node=(Lib3dsNode*)calloc(sizeof(Lib3dsNode), 1);
- node->type=LIB3DS_AMBIENT_NODE;
- lib3ds_matrix_identity(node->matrix);
- return(node);
-}
-
-
-/*!
- * Create and return a new object node.
- *
- * The node is returned with an identity matrix. All other fields
- * are zero.
- *
- * \return Lib3dsNode
- *
- * \ingroup node
- */
-Lib3dsNode*
-lib3ds_node_new_object()
-{
- Lib3dsNode *node=(Lib3dsNode*)calloc(sizeof(Lib3dsNode), 1);
- node->type=LIB3DS_OBJECT_NODE;
- lib3ds_matrix_identity(node->matrix);
- return(node);
-}
-
-
-/*!
- * Create and return a new camera node.
- *
- * The node is returned with an identity matrix. All other fields
- * are zero.
- *
- * \return Lib3dsNode
- *
- * \ingroup node
- */
-Lib3dsNode*
-lib3ds_node_new_camera()
-{
- Lib3dsNode *node=(Lib3dsNode*)calloc(sizeof(Lib3dsNode), 1);
- node->type=LIB3DS_CAMERA_NODE;
- lib3ds_matrix_identity(node->matrix);
- return(node);
-}
-
-
-/*!
- * Create and return a new target node.
- *
- * The node is returned with an identity matrix. All other fields
- * are zero.
- *
- * \return Lib3dsNode
- *
- * \ingroup node
- */
-Lib3dsNode*
-lib3ds_node_new_target()
-{
- Lib3dsNode *node=(Lib3dsNode*)calloc(sizeof(Lib3dsNode), 1);
- node->type=LIB3DS_TARGET_NODE;
- lib3ds_matrix_identity(node->matrix);
- return(node);
-}
-
-
-/*!
- * Create and return a new light node.
- *
- * The node is returned with an identity matrix. All other fields
- * are zero.
- *
- * \return Lib3dsNode
- *
- * \ingroup node
- */
-Lib3dsNode*
-lib3ds_node_new_light()
-{
- Lib3dsNode *node=(Lib3dsNode*)calloc(sizeof(Lib3dsNode), 1);
- node->type=LIB3DS_LIGHT_NODE;
- lib3ds_matrix_identity(node->matrix);
- return(node);
-}
-
-
-/*!
- * Create and return a new spot node.
- *
- * The node is returned with an identity matrix. All other fields
- * are zero.
- *
- * \return Lib3dsNode
- *
- * \ingroup node
- */
-Lib3dsNode*
-lib3ds_node_new_spot()
-{
- Lib3dsNode *node=(Lib3dsNode*)calloc(sizeof(Lib3dsNode), 1);
- node->type=LIB3DS_SPOT_NODE;
- lib3ds_matrix_identity(node->matrix);
- return(node);
-}
-
-
-static void
-free_node_and_childs(Lib3dsNode *node)
-{
- ASSERT(node);
- switch (node->type) {
- case LIB3DS_UNKNOWN_NODE:
- break;
- case LIB3DS_AMBIENT_NODE:
- {
- Lib3dsAmbientData *n=&node->data.ambient;
- lib3ds_lin3_track_free_keys(&n->col_track);
- }
- break;
- case LIB3DS_OBJECT_NODE:
- {
- Lib3dsObjectData *n=&node->data.object;
-
- lib3ds_lin3_track_free_keys(&n->pos_track);
- lib3ds_quat_track_free_keys(&n->rot_track);
- lib3ds_lin3_track_free_keys(&n->scl_track);
- lib3ds_bool_track_free_keys(&n->hide_track);
- lib3ds_morph_track_free_keys(&n->morph_track);
- }
- break;
- case LIB3DS_CAMERA_NODE:
- {
- Lib3dsCameraData *n=&node->data.camera;
- lib3ds_lin3_track_free_keys(&n->pos_track);
- lib3ds_lin1_track_free_keys(&n->fov_track);
- lib3ds_lin1_track_free_keys(&n->roll_track);
- }
- break;
- case LIB3DS_TARGET_NODE:
- {
- Lib3dsTargetData *n=&node->data.target;
- lib3ds_lin3_track_free_keys(&n->pos_track);
- }
- break;
- case LIB3DS_LIGHT_NODE:
- {
- Lib3dsLightData *n=&node->data.light;
- lib3ds_lin3_track_free_keys(&n->pos_track);
- lib3ds_lin3_track_free_keys(&n->col_track);
- lib3ds_lin1_track_free_keys(&n->hotspot_track);
- lib3ds_lin1_track_free_keys(&n->falloff_track);
- lib3ds_lin1_track_free_keys(&n->roll_track);
- }
- break;
- case LIB3DS_SPOT_NODE:
- {
- Lib3dsSpotData *n=&node->data.spot;
- lib3ds_lin3_track_free_keys(&n->pos_track);
- }
- break;
- }
- {
- Lib3dsNode *p,*q;
- for (p=node->childs; p; p=q) {
- q=p->next;
- free_node_and_childs(p);
- }
- }
- node->type=LIB3DS_UNKNOWN_NODE;
- free(node);
-}
-
-
-/*!
- * Free a node and all of its resources.
- *
- * \param node Lib3dsNode object to be freed.
- *
- * \ingroup node
- */
-void
-lib3ds_node_free(Lib3dsNode *node)
-{
- ASSERT(node);
- free_node_and_childs(node);
-}
-
-
-/*!
- * Evaluate an animation node.
- *
- * Recursively sets node and its children to their appropriate values
- * for this point in the animation.
- *
- * \param node Node to be evaluated.
- * \param t time value, between 0. and file->frames
- *
- * \ingroup node
- */
-void
-lib3ds_node_eval(Lib3dsNode *node, Lib3dsFloat t)
-{
- ASSERT(node);
- switch (node->type) {
- case LIB3DS_UNKNOWN_NODE:
- {
- ASSERT(LIB3DS_FALSE);
- }
- break;
- case LIB3DS_AMBIENT_NODE:
- {
- Lib3dsAmbientData *n=&node->data.ambient;
- if (node->parent) {
- lib3ds_matrix_copy(node->matrix, node->parent->matrix);
- }
- else {
- lib3ds_matrix_identity(node->matrix);
- }
- lib3ds_lin3_track_eval(&n->col_track, n->col, t);
- }
- break;
- case LIB3DS_OBJECT_NODE:
- {
- Lib3dsMatrix M;
- Lib3dsObjectData *n=&node->data.object;
-
- lib3ds_lin3_track_eval(&n->pos_track, n->pos, t);
- lib3ds_quat_track_eval(&n->rot_track, n->rot, t);
- if (n->scl_track.keyL) {
- lib3ds_lin3_track_eval(&n->scl_track, n->scl, t);
- }
- else {
- n->scl[0] = n->scl[1] = n->scl[2] = 1.0f;
- }
- lib3ds_bool_track_eval(&n->hide_track, &n->hide, t);
- lib3ds_morph_track_eval(&n->morph_track, n->morph, t);
-
- lib3ds_matrix_identity(M);
- lib3ds_matrix_translate(M, n->pos);
- lib3ds_matrix_rotate(M, n->rot);
- lib3ds_matrix_scale(M, n->scl);
-
- if (node->parent) {
- lib3ds_matrix_copy(node->matrix, node->parent->matrix);
- lib3ds_matrix_mult(node->matrix, M);
- }
- else {
- lib3ds_matrix_copy(node->matrix, M);
- }
- }
- break;
- case LIB3DS_CAMERA_NODE:
- {
- Lib3dsCameraData *n=&node->data.camera;
- lib3ds_lin3_track_eval(&n->pos_track, n->pos, t);
- lib3ds_lin1_track_eval(&n->fov_track, &n->fov, t);
- lib3ds_lin1_track_eval(&n->roll_track, &n->roll, t);
- if (node->parent) {
- lib3ds_matrix_copy(node->matrix, node->parent->matrix);
- }
- else {
- lib3ds_matrix_identity(node->matrix);
- }
- lib3ds_matrix_translate(node->matrix, n->pos);
- }
- break;
- case LIB3DS_TARGET_NODE:
- {
- Lib3dsTargetData *n=&node->data.target;
- lib3ds_lin3_track_eval(&n->pos_track, n->pos, t);
- if (node->parent) {
- lib3ds_matrix_copy(node->matrix, node->parent->matrix);
- }
- else {
- lib3ds_matrix_identity(node->matrix);
- }
- lib3ds_matrix_translate(node->matrix, n->pos);
- }
- break;
- case LIB3DS_LIGHT_NODE:
- {
- Lib3dsLightData *n=&node->data.light;
- lib3ds_lin3_track_eval(&n->pos_track, n->pos, t);
- lib3ds_lin3_track_eval(&n->col_track, n->col, t);
- lib3ds_lin1_track_eval(&n->hotspot_track, &n->hotspot, t);
- lib3ds_lin1_track_eval(&n->falloff_track, &n->falloff, t);
- lib3ds_lin1_track_eval(&n->roll_track, &n->roll, t);
- if (node->parent) {
- lib3ds_matrix_copy(node->matrix, node->parent->matrix);
- }
- else {
- lib3ds_matrix_identity(node->matrix);
- }
- lib3ds_matrix_translate(node->matrix, n->pos);
- }
- break;
- case LIB3DS_SPOT_NODE:
- {
- Lib3dsSpotData *n=&node->data.spot;
- lib3ds_lin3_track_eval(&n->pos_track, n->pos, t);
- if (node->parent) {
- lib3ds_matrix_copy(node->matrix, node->parent->matrix);
- }
- else {
- lib3ds_matrix_identity(node->matrix);
- }
- lib3ds_matrix_translate(node->matrix, n->pos);
- }
- break;
- }
- {
- Lib3dsNode *p;
-
- for (p=node->childs; p!=0; p=p->next) {
- lib3ds_node_eval(p, t);
- }
- }
-}
-
-
-/*!
- * Return a node object by name and type.
- *
- * This function performs a recursive search for the specified node.
- * Both name and type must match.
- *
- * \param node The parent node for the search
- * \param name The target node name.
- * \param type The target node type
- *
- * \return A pointer to the first matching node, or NULL if not found.
- *
- * \ingroup node
- */
-Lib3dsNode*
-lib3ds_node_by_name(Lib3dsNode *node, const char* name, Lib3dsNodeTypes type)
-{
- Lib3dsNode *p,*q;
-
- for (p=node->childs; p!=0; p=p->next) {
- if ((p->type==type) && (strcmp(p->name, name)==0)) {
- return(p);
- }
- q=lib3ds_node_by_name(p, name, type);
- if (q) {
- return(q);
- }
- }
- return(0);
-}
-
-
-/*!
- * Return a node object by id.
- *
- * This function performs a recursive search for the specified node.
- *
- * \param node The parent node for the search
- * \param node_id The target node id.
- *
- * \return A pointer to the first matching node, or NULL if not found.
- *
- * \ingroup node
- */
-Lib3dsNode*
-lib3ds_node_by_id(Lib3dsNode *node, Lib3dsWord node_id)
-{
- Lib3dsNode *p,*q;
-
- for (p=node->childs; p!=0; p=p->next) {
- if (p->node_id==node_id) {
- return(p);
- }
- q=lib3ds_node_by_id(p, node_id);
- if (q) {
- return(q);
- }
- }
- return(0);
-}
-
-
-static const char* node_names_table[]= {
- "***Unknown***",
- "Ambient",
- "Object",
- "Camera",
- "Target",
- "Light",
- "Spot"
-};
-
-
-/*!
- * Dump node and all descendants recursively.
- *
- * \param node The top-level node to be dumped.
- * \param level current recursion depth
- *
- * \ingroup node
- */
-void
-lib3ds_node_dump(Lib3dsNode *node, Lib3dsIntd level)
-{
- Lib3dsNode *p;
- char l[128];
-
- ASSERT(node);
- memset(l, ' ', 2*level);
- l[2*level]=0;
-
- if (node->type==LIB3DS_OBJECT_NODE) {
- printf("%s%s [%s] (%s)\n",
- l,
- node->name,
- node->data.object.instance,
- node_names_table[node->type]
- );
- }
- else {
- printf("%s%s (%s)\n",
- l,
- node->name,
- node_names_table[node->type]
- );
- }
-
- for (p=node->childs; p!=0; p=p->next) {
- lib3ds_node_dump(p, level+1);
- }
-}
-
-
-/*!
- * \ingroup node
- */
-Lib3dsBool
-lib3ds_node_read(Lib3dsNode *node, Lib3dsFile *file, Lib3dsIo *io)
-{
- Lib3dsChunk c;
- Lib3dsWord chunk;
- LIB3DS_UNUSED(file);
-
- ASSERT(node);
- if (!lib3ds_chunk_read_start(&c, 0, io)) {
- return(LIB3DS_FALSE);
- }
- switch (c.chunk) {
- case LIB3DS_AMBIENT_NODE_TAG:
- case LIB3DS_OBJECT_NODE_TAG:
- case LIB3DS_CAMERA_NODE_TAG:
- case LIB3DS_TARGET_NODE_TAG:
- case LIB3DS_LIGHT_NODE_TAG:
- case LIB3DS_SPOTLIGHT_NODE_TAG:
- case LIB3DS_L_TARGET_NODE_TAG:
- break;
- default:
- return(LIB3DS_FALSE);
- }
-
- while ((chunk=lib3ds_chunk_read_next(&c, io))!=0) {
- switch (chunk) {
- case LIB3DS_NODE_ID:
- {
- node->node_id=lib3ds_io_read_word(io);
- lib3ds_chunk_dump_info(" ID = %d", (short)node->node_id);
- }
- break;
- case LIB3DS_NODE_HDR:
- {
- if (!lib3ds_io_read_string(io, node->name, 64)) {
- return(LIB3DS_FALSE);
- }
- node->flags1=lib3ds_io_read_word(io);
- node->flags2=lib3ds_io_read_word(io);
- node->parent_id=lib3ds_io_read_word(io);
- lib3ds_chunk_dump_info(" NAME =%s", node->name);
- lib3ds_chunk_dump_info(" PARENT=%d", (short)node->parent_id);
- }
- break;
- case LIB3DS_PIVOT:
- {
- if (node->type==LIB3DS_OBJECT_NODE) {
- int i;
- for (i=0; i<3; ++i) {
- node->data.object.pivot[i]=lib3ds_io_read_float(io);
- }
- }
- else {
- lib3ds_chunk_unknown(chunk);
- }
- }
- break;
- case LIB3DS_INSTANCE_NAME:
- {
- if (node->type==LIB3DS_OBJECT_NODE) {
- if (!lib3ds_io_read_string(io, node->data.object.instance, 64)) {
- return(LIB3DS_FALSE);
- }
- }
- else {
- lib3ds_chunk_unknown(chunk);
- }
- }
- break;
- case LIB3DS_BOUNDBOX:
- {
- if (node->type==LIB3DS_OBJECT_NODE) {
- int i;
- for (i=0; i<3; ++i) {
- node->data.object.bbox_min[i]=lib3ds_io_read_float(io);
- }
- for (i=0; i<3; ++i) {
- node->data.object.bbox_max[i]=lib3ds_io_read_float(io);
- }
- }
- else {
- lib3ds_chunk_unknown(chunk);
- }
- }
- break;
- case LIB3DS_COL_TRACK_TAG:
- {
- Lib3dsBool result=LIB3DS_TRUE;
-
- switch (node->type) {
- case LIB3DS_AMBIENT_NODE:
- result=lib3ds_lin3_track_read(&node->data.ambient.col_track, io);
- break;
- case LIB3DS_LIGHT_NODE:
- result=lib3ds_lin3_track_read(&node->data.light.col_track, io);
- break;
- default:
- lib3ds_chunk_unknown(chunk);
- }
- if (!result) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_POS_TRACK_TAG:
- {
- Lib3dsBool result=LIB3DS_TRUE;
-
- switch (node->type) {
- case LIB3DS_OBJECT_NODE:
- result=lib3ds_lin3_track_read(&node->data.object.pos_track, io);
- break;
- case LIB3DS_CAMERA_NODE:
- result=lib3ds_lin3_track_read(&node->data.camera.pos_track, io);
- break;
- case LIB3DS_TARGET_NODE:
- result=lib3ds_lin3_track_read(&node->data.target.pos_track, io);
- break;
- case LIB3DS_LIGHT_NODE:
- result=lib3ds_lin3_track_read(&node->data.light.pos_track, io);
- break;
- case LIB3DS_SPOT_NODE:
- result=lib3ds_lin3_track_read(&node->data.spot.pos_track, io);
- break;
- default:
- lib3ds_chunk_unknown(chunk);
- }
- if (!result) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_ROT_TRACK_TAG:
- {
- if (node->type==LIB3DS_OBJECT_NODE) {
- if (!lib3ds_quat_track_read(&node->data.object.rot_track, io)) {
- return(LIB3DS_FALSE);
- }
- }
- else {
- lib3ds_chunk_unknown(chunk);
- }
- }
- break;
- case LIB3DS_SCL_TRACK_TAG:
- {
- if (node->type==LIB3DS_OBJECT_NODE) {
- if (!lib3ds_lin3_track_read(&node->data.object.scl_track, io)) {
- return(LIB3DS_FALSE);
- }
- }
- else {
- lib3ds_chunk_unknown(chunk);
- }
- }
- break;
- case LIB3DS_FOV_TRACK_TAG:
- {
- if (node->type==LIB3DS_CAMERA_NODE) {
- if (!lib3ds_lin1_track_read(&node->data.camera.fov_track, io)) {
- return(LIB3DS_FALSE);
- }
- }
- else {
- lib3ds_chunk_unknown(chunk);
- }
- }
- break;
- case LIB3DS_HOT_TRACK_TAG:
- {
- if (node->type==LIB3DS_LIGHT_NODE) {
- if (!lib3ds_lin1_track_read(&node->data.light.hotspot_track, io)) {
- return(LIB3DS_FALSE);
- }
- }
- else {
- lib3ds_chunk_unknown(chunk);
- }
- }
- break;
- case LIB3DS_FALL_TRACK_TAG:
- {
- if (node->type==LIB3DS_LIGHT_NODE) {
- if (!lib3ds_lin1_track_read(&node->data.light.falloff_track, io)) {
- return(LIB3DS_FALSE);
- }
- }
- else {
- lib3ds_chunk_unknown(chunk);
- }
- }
- break;
- case LIB3DS_ROLL_TRACK_TAG:
- {
- Lib3dsBool result=LIB3DS_TRUE;
-
- switch (node->type) {
- case LIB3DS_CAMERA_NODE:
- result=lib3ds_lin1_track_read(&node->data.camera.roll_track, io);
- break;
- case LIB3DS_LIGHT_NODE:
- result=lib3ds_lin1_track_read(&node->data.light.roll_track, io);
- break;
- default:
- lib3ds_chunk_unknown(chunk);
- }
- if (!result) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_HIDE_TRACK_TAG:
- {
- if (node->type==LIB3DS_OBJECT_NODE) {
- if (!lib3ds_bool_track_read(&node->data.object.hide_track, io)) {
- return(LIB3DS_FALSE);
- }
- }
- else {
- lib3ds_chunk_unknown(chunk);
- }
- }
- break;
- case LIB3DS_MORPH_SMOOTH:
- {
- if (node->type==LIB3DS_OBJECT_NODE) {
- node->data.object.morph_smooth=lib3ds_io_read_float(io);
- }
- else {
- lib3ds_chunk_unknown(chunk);
- }
- }
- break;
- case LIB3DS_MORPH_TRACK_TAG:
- {
- if (node->type==LIB3DS_OBJECT_NODE) {
- if (!lib3ds_morph_track_read(&node->data.object.morph_track, io)) {
- return(LIB3DS_FALSE);
- }
- }
- else {
- lib3ds_chunk_unknown(chunk);
- }
- }
- break;
- default:
- lib3ds_chunk_unknown(chunk);
- }
- }
-
- lib3ds_chunk_read_end(&c, io);
- return(LIB3DS_TRUE);
-}
-
-
-/*!
- * \ingroup node
- */
-Lib3dsBool
-lib3ds_node_write(Lib3dsNode *node, Lib3dsFile *file, Lib3dsIo *io)
-{
- Lib3dsChunk c;
-
- switch (node->type) {
- case LIB3DS_AMBIENT_NODE:
- c.chunk=LIB3DS_AMBIENT_NODE_TAG;
- break;
- case LIB3DS_OBJECT_NODE:
- c.chunk=LIB3DS_OBJECT_NODE_TAG;
- break;
- case LIB3DS_CAMERA_NODE:
- c.chunk=LIB3DS_CAMERA_NODE_TAG;
- break;
- case LIB3DS_TARGET_NODE:
- c.chunk=LIB3DS_TARGET_NODE_TAG;
- break;
- case LIB3DS_LIGHT_NODE:
- if (lib3ds_file_node_by_name(file, node->name, LIB3DS_SPOT_NODE)) {
- c.chunk=LIB3DS_SPOTLIGHT_NODE_TAG;
- }
- else {
- c.chunk=LIB3DS_LIGHT_NODE_TAG;
- }
- break;
- case LIB3DS_SPOT_NODE:
- c.chunk=LIB3DS_L_TARGET_NODE_TAG;
- break;
- default:
- return(LIB3DS_FALSE);
- }
- if (!lib3ds_chunk_write_start(&c,io)) {
- return(LIB3DS_FALSE);
- }
-
- { /*---- LIB3DS_NODE_ID ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_NODE_ID;
- c.size=8;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_intw(io, node->node_id);
- }
-
- { /*---- LIB3DS_NODE_HDR ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_NODE_HDR;
- c.size=6+ 1+(Lib3dsDword)strlen(node->name) +2+2+2;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_string(io, node->name);
- lib3ds_io_write_word(io, node->flags1);
- lib3ds_io_write_word(io, node->flags2);
- lib3ds_io_write_word(io, node->parent_id);
- }
-
- switch (c.chunk) {
- case LIB3DS_AMBIENT_NODE_TAG:
- { /*---- LIB3DS_COL_TRACK_TAG ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_COL_TRACK_TAG;
- if (!lib3ds_chunk_write_start(&c,io)) {
- return(LIB3DS_FALSE);
- }
- if (!lib3ds_lin3_track_write(&node->data.ambient.col_track,io)) {
- return(LIB3DS_FALSE);
- }
- if (!lib3ds_chunk_write_end(&c,io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_OBJECT_NODE_TAG:
- { /*---- LIB3DS_PIVOT ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_PIVOT;
- c.size=18;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_vector(io, node->data.object.pivot);
- }
- { /*---- LIB3DS_INSTANCE_NAME ----*/
- Lib3dsChunk c;
- const char *name;
- if (strlen(node->data.object.instance)) {
- name=node->data.object.instance;
-
- c.chunk=LIB3DS_INSTANCE_NAME;
- c.size=6+1+(Lib3dsDword)strlen(name);
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_string(io, name);
- }
- }
- {
- int i;
- for (i=0; i<3; ++i) {
- if ((fabs(node->data.object.bbox_min[i])>LIB3DS_EPSILON) ||
- (fabs(node->data.object.bbox_max[i])>LIB3DS_EPSILON)) {
- break;
- }
- }
-
- if (i<3) { /*---- LIB3DS_BOUNDBOX ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_BOUNDBOX;
- c.size=30;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_vector(io, node->data.object.bbox_min);
- lib3ds_io_write_vector(io, node->data.object.bbox_max);
- }
- }
- { /*---- LIB3DS_POS_TRACK_TAG ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_POS_TRACK_TAG;
- if (!lib3ds_chunk_write_start(&c,io)) {
- return(LIB3DS_FALSE);
- }
- if (!lib3ds_lin3_track_write(&node->data.object.pos_track,io)) {
- return(LIB3DS_FALSE);
- }
- if (!lib3ds_chunk_write_end(&c,io)) {
- return(LIB3DS_FALSE);
- }
- }
- { /*---- LIB3DS_ROT_TRACK_TAG ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_ROT_TRACK_TAG;
- if (!lib3ds_chunk_write_start(&c,io)) {
- return(LIB3DS_FALSE);
- }
- if (!lib3ds_quat_track_write(&node->data.object.rot_track,io)) {
- return(LIB3DS_FALSE);
- }
- if (!lib3ds_chunk_write_end(&c,io)) {
- return(LIB3DS_FALSE);
- }
- }
- { /*---- LIB3DS_SCL_TRACK_TAG ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_SCL_TRACK_TAG;
- if (!lib3ds_chunk_write_start(&c,io)) {
- return(LIB3DS_FALSE);
- }
- if (!lib3ds_lin3_track_write(&node->data.object.scl_track,io)) {
- return(LIB3DS_FALSE);
- }
- if (!lib3ds_chunk_write_end(&c,io)) {
- return(LIB3DS_FALSE);
- }
- }
- if (node->data.object.hide_track.keyL) { /*---- LIB3DS_HIDE_TRACK_TAG ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_HIDE_TRACK_TAG;
- if (!lib3ds_chunk_write_start(&c,io)) {
- return(LIB3DS_FALSE);
- }
- if (!lib3ds_bool_track_write(&node->data.object.hide_track,io)) {
- return(LIB3DS_FALSE);
- }
- if (!lib3ds_chunk_write_end(&c,io)) {
- return(LIB3DS_FALSE);
- }
- }
- if (fabs(node->data.object.morph_smooth)>LIB3DS_EPSILON){ /*---- LIB3DS_MORPH_SMOOTH ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_MORPH_SMOOTH;
- c.size=10;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_float(io, node->data.object.morph_smooth);
- }
- break;
- case LIB3DS_CAMERA_NODE_TAG:
- { /*---- LIB3DS_POS_TRACK_TAG ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_POS_TRACK_TAG;
- if (!lib3ds_chunk_write_start(&c,io)) {
- return(LIB3DS_FALSE);
- }
- if (!lib3ds_lin3_track_write(&node->data.camera.pos_track,io)) {
- return(LIB3DS_FALSE);
- }
- if (!lib3ds_chunk_write_end(&c,io)) {
- return(LIB3DS_FALSE);
- }
- }
- { /*---- LIB3DS_FOV_TRACK_TAG ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_FOV_TRACK_TAG;
- if (!lib3ds_chunk_write_start(&c,io)) {
- return(LIB3DS_FALSE);
- }
- if (!lib3ds_lin1_track_write(&node->data.camera.fov_track,io)) {
- return(LIB3DS_FALSE);
- }
- if (!lib3ds_chunk_write_end(&c,io)) {
- return(LIB3DS_FALSE);
- }
- }
- { /*---- LIB3DS_ROLL_TRACK_TAG ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_ROLL_TRACK_TAG;
- if (!lib3ds_chunk_write_start(&c,io)) {
- return(LIB3DS_FALSE);
- }
- if (!lib3ds_lin1_track_write(&node->data.camera.roll_track,io)) {
- return(LIB3DS_FALSE);
- }
- if (!lib3ds_chunk_write_end(&c,io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_TARGET_NODE_TAG:
- { /*---- LIB3DS_POS_TRACK_TAG ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_POS_TRACK_TAG;
- if (!lib3ds_chunk_write_start(&c,io)) {
- return(LIB3DS_FALSE);
- }
- if (!lib3ds_lin3_track_write(&node->data.target.pos_track,io)) {
- return(LIB3DS_FALSE);
- }
- if (!lib3ds_chunk_write_end(&c,io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_LIGHT_NODE_TAG:
- { /*---- LIB3DS_POS_TRACK_TAG ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_POS_TRACK_TAG;
- if (!lib3ds_chunk_write_start(&c,io)) {
- return(LIB3DS_FALSE);
- }
- if (!lib3ds_lin3_track_write(&node->data.light.pos_track,io)) {
- return(LIB3DS_FALSE);
- }
- if (!lib3ds_chunk_write_end(&c,io)) {
- return(LIB3DS_FALSE);
- }
- }
- { /*---- LIB3DS_COL_TRACK_TAG ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_COL_TRACK_TAG;
- if (!lib3ds_chunk_write_start(&c,io)) {
- return(LIB3DS_FALSE);
- }
- if (!lib3ds_lin3_track_write(&node->data.light.col_track,io)) {
- return(LIB3DS_FALSE);
- }
- if (!lib3ds_chunk_write_end(&c,io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_SPOTLIGHT_NODE_TAG:
- { /*---- LIB3DS_POS_TRACK_TAG ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_POS_TRACK_TAG;
- if (!lib3ds_chunk_write_start(&c,io)) {
- return(LIB3DS_FALSE);
- }
- if (!lib3ds_lin3_track_write(&node->data.light.pos_track,io)) {
- return(LIB3DS_FALSE);
- }
- if (!lib3ds_chunk_write_end(&c,io)) {
- return(LIB3DS_FALSE);
- }
- }
- { /*---- LIB3DS_COL_TRACK_TAG ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_COL_TRACK_TAG;
- if (!lib3ds_chunk_write_start(&c,io)) {
- return(LIB3DS_FALSE);
- }
- if (!lib3ds_lin3_track_write(&node->data.light.col_track,io)) {
- return(LIB3DS_FALSE);
- }
- if (!lib3ds_chunk_write_end(&c,io)) {
- return(LIB3DS_FALSE);
- }
- }
- { /*---- LIB3DS_HOT_TRACK_TAG ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_HOT_TRACK_TAG;
- if (!lib3ds_chunk_write_start(&c,io)) {
- return(LIB3DS_FALSE);
- }
- if (!lib3ds_lin1_track_write(&node->data.light.hotspot_track,io)) {
- return(LIB3DS_FALSE);
- }
- if (!lib3ds_chunk_write_end(&c,io)) {
- return(LIB3DS_FALSE);
- }
- }
- { /*---- LIB3DS_FALL_TRACK_TAG ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_FALL_TRACK_TAG;
- if (!lib3ds_chunk_write_start(&c,io)) {
- return(LIB3DS_FALSE);
- }
- if (!lib3ds_lin1_track_write(&node->data.light.falloff_track,io)) {
- return(LIB3DS_FALSE);
- }
- if (!lib3ds_chunk_write_end(&c,io)) {
- return(LIB3DS_FALSE);
- }
- }
- { /*---- LIB3DS_ROLL_TRACK_TAG ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_ROLL_TRACK_TAG;
- if (!lib3ds_chunk_write_start(&c,io)) {
- return(LIB3DS_FALSE);
- }
- if (!lib3ds_lin1_track_write(&node->data.light.roll_track,io)) {
- return(LIB3DS_FALSE);
- }
- if (!lib3ds_chunk_write_end(&c,io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- case LIB3DS_L_TARGET_NODE_TAG:
- { /*---- LIB3DS_POS_TRACK_TAG ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_POS_TRACK_TAG;
- if (!lib3ds_chunk_write_start(&c,io)) {
- return(LIB3DS_FALSE);
- }
- if (!lib3ds_lin3_track_write(&node->data.spot.pos_track,io)) {
- return(LIB3DS_FALSE);
- }
- if (!lib3ds_chunk_write_end(&c,io)) {
- return(LIB3DS_FALSE);
- }
- }
- break;
- default:
- return(LIB3DS_FALSE);
- }
-
- if (!lib3ds_chunk_write_end(&c,io)) {
- return(LIB3DS_FALSE);
- }
- return(LIB3DS_TRUE);
-}
-
diff --git a/3rdparty/lib3ds/node.h b/3rdparty/lib3ds/node.h
deleted file mode 100644
index 2b7de9af..00000000
--- a/3rdparty/lib3ds/node.h
+++ /dev/null
@@ -1,188 +0,0 @@
-/* -*- c -*- */
-#ifndef INCLUDED_LIB3DS_NODE_H
-#define INCLUDED_LIB3DS_NODE_H
-/*
- * The 3D Studio File Format Library
- * Copyright (C) 1996-2007 by Jan Eric Kyprianidis <www.kyprianidis.com>
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id: node.h,v 1.12 2007/06/20 17:04:09 jeh Exp $
- */
-
-#ifndef INCLUDED_LIB3DS_TRACKS_H
-#include <lib3ds/tracks.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * Scene graph ambient color node data
- * \ingroup node
- */
-typedef struct Lib3dsAmbientData {
- Lib3dsRgb col;
- Lib3dsLin3Track col_track;
-} Lib3dsAmbientData;
-
-/**
- * Scene graph object instance node data
- * \ingroup node
- */
-typedef struct Lib3dsObjectData {
- Lib3dsVector pivot;
- char instance[64];
- Lib3dsVector bbox_min;
- Lib3dsVector bbox_max;
- Lib3dsVector pos;
- Lib3dsLin3Track pos_track;
- Lib3dsQuat rot;
- Lib3dsQuatTrack rot_track;
- Lib3dsVector scl;
- Lib3dsLin3Track scl_track;
- Lib3dsFloat morph_smooth;
- char morph[64];
- Lib3dsMorphTrack morph_track;
- Lib3dsBool hide;
- Lib3dsBoolTrack hide_track;
-} Lib3dsObjectData;
-
-/**
- * Scene graph camera node data
- * \ingroup node
- */
-typedef struct Lib3dsCameraData {
- Lib3dsVector pos;
- Lib3dsLin3Track pos_track;
- Lib3dsFloat fov;
- Lib3dsLin1Track fov_track;
- Lib3dsFloat roll;
- Lib3dsLin1Track roll_track;
-} Lib3dsCameraData;
-
-/**
- * Scene graph camera target node data
- * \ingroup node
- */
-typedef struct Lib3dsTargetData {
- Lib3dsVector pos;
- Lib3dsLin3Track pos_track;
-} Lib3dsTargetData;
-
-/**
- * Scene graph light node data
- * \ingroup node
- */
-typedef struct Lib3dsLightData {
- Lib3dsVector pos;
- Lib3dsLin3Track pos_track;
- Lib3dsRgb col;
- Lib3dsLin3Track col_track;
- Lib3dsFloat hotspot;
- Lib3dsLin1Track hotspot_track;
- Lib3dsFloat falloff;
- Lib3dsLin1Track falloff_track;
- Lib3dsFloat roll;
- Lib3dsLin1Track roll_track;
-} Lib3dsLightData;
-
-/**
- * Scene graph spotlight target node data
- * \ingroup node
- */
-typedef struct Lib3dsSpotData {
- Lib3dsVector pos;
- Lib3dsLin3Track pos_track;
-} Lib3dsSpotData;
-
-/**
- * Scene graph node data union
- * \ingroup node
- */
-typedef union Lib3dsNodeData {
- Lib3dsAmbientData ambient;
- Lib3dsObjectData object;
- Lib3dsCameraData camera;
- Lib3dsTargetData target;
- Lib3dsLightData light;
- Lib3dsSpotData spot;
-} Lib3dsNodeData;
-
-/*!
- * \ingroup node
- */
-#define LIB3DS_NO_PARENT 65535
-
-/**
- * Scene graph node
- * \ingroup node
- */
-struct Lib3dsNode {
- Lib3dsUserData user;
- Lib3dsNode *next;
- Lib3dsNode *childs;
- Lib3dsNode *parent;
- Lib3dsNodeTypes type;
- Lib3dsWord node_id;
- char name[64];
- Lib3dsWord flags1;
- Lib3dsWord flags2;
- Lib3dsWord parent_id;
- Lib3dsMatrix matrix;
- Lib3dsNodeData data;
-};
-
-/**
- * Node flags #1
- * \ingroup node
- */
-typedef enum {
- LIB3DS_HIDDEN = 0x800
-} Lib3dsNodeFlags1;
-
-/**
- * Node flags #2
- * \ingroup node
- */
-typedef enum {
- LIB3DS_SHOW_PATH = 0x1,
- LIB3DS_SMOOTHING = 0x2,
- LIB3DS_MOTION_BLUR = 0x10,
- LIB3DS_MORPH_MATERIALS = 0x40
-} Lib3dsNodeFlags2;
-
-extern LIB3DSAPI Lib3dsNode* lib3ds_node_new_ambient();
-extern LIB3DSAPI Lib3dsNode* lib3ds_node_new_object();
-extern LIB3DSAPI Lib3dsNode* lib3ds_node_new_camera();
-extern LIB3DSAPI Lib3dsNode* lib3ds_node_new_target();
-extern LIB3DSAPI Lib3dsNode* lib3ds_node_new_light();
-extern LIB3DSAPI Lib3dsNode* lib3ds_node_new_spot();
-extern LIB3DSAPI void lib3ds_node_free(Lib3dsNode *node);
-extern LIB3DSAPI void lib3ds_node_eval(Lib3dsNode *node, Lib3dsFloat t);
-extern LIB3DSAPI Lib3dsNode* lib3ds_node_by_name(Lib3dsNode *node, const char* name,
- Lib3dsNodeTypes type);
-extern LIB3DSAPI Lib3dsNode* lib3ds_node_by_id(Lib3dsNode *node, Lib3dsWord node_id);
-extern LIB3DSAPI void lib3ds_node_dump(Lib3dsNode *node, Lib3dsIntd level);
-extern LIB3DSAPI Lib3dsBool lib3ds_node_read(Lib3dsNode *node, Lib3dsFile *file, Lib3dsIo *io);
-extern LIB3DSAPI Lib3dsBool lib3ds_node_write(Lib3dsNode *node, Lib3dsFile *file, Lib3dsIo *io);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
-
diff --git a/3rdparty/lib3ds/quat.c b/3rdparty/lib3ds/quat.c
deleted file mode 100644
index 3553a95f..00000000
--- a/3rdparty/lib3ds/quat.c
+++ /dev/null
@@ -1,418 +0,0 @@
-/*
- * The 3D Studio File Format Library
- * Copyright (C) 1996-2007 by Jan Eric Kyprianidis <www.kyprianidis.com>
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id: quat.c,v 1.9 2007/06/20 17:04:09 jeh Exp $
- */
-#include <lib3ds/quat.h>
-#include <math.h>
-
-
-/*!
- * \defgroup quat Quaternion Mathematics
- */
-
-
-/*!
-* \typedef Lib3dsQuat
-* \ingroup quat
-*/
-
-
-/*!
- * Clear a quaternion.
- * \ingroup quat
- */
-void
-lib3ds_quat_zero(Lib3dsQuat c)
-{
- c[0]=c[1]=c[2]=c[3]=0.0f;
-}
-
-
-/*!
- * Set a quaternion to Identity
- * \ingroup quat
- */
-void
-lib3ds_quat_identity(Lib3dsQuat c)
-{
- c[0]=c[1]=c[2]=0.0f;
- c[3]=1.0f;
-}
-
-
-/*!
- * Copy a quaternion.
- * \ingroup quat
- */
-void
-lib3ds_quat_copy(Lib3dsQuat dest, Lib3dsQuat src)
-{
- int i;
- for (i=0; i<4; ++i) {
- dest[i]=src[i];
- }
-}
-
-
-/*!
- * Compute a quaternion from axis and angle.
- *
- * \param c Computed quaternion
- * \param axis Rotation axis
- * \param angle Angle of rotation, radians.
- *
- * \ingroup quat
- */
-void
-lib3ds_quat_axis_angle(Lib3dsQuat c, Lib3dsVector axis, Lib3dsFloat angle)
-{
- Lib3dsDouble omega,s;
- Lib3dsDouble l;
-
- l=sqrt(axis[0]*axis[0] + axis[1]*axis[1] + axis[2]*axis[2]);
- if (l<LIB3DS_EPSILON) {
- c[0]=c[1]=c[2]=0.0f;
- c[3]=1.0f;
- }
- else {
- omega=-0.5*angle;
- s=sin(omega)/l;
- c[0]=(Lib3dsFloat)s*axis[0];
- c[1]=(Lib3dsFloat)s*axis[1];
- c[2]=(Lib3dsFloat)s*axis[2];
- c[3]=(Lib3dsFloat)cos(omega);
- }
-}
-
-
-/*!
- * Negate a quaternion
- *
- * \ingroup quat
- */
-void
-lib3ds_quat_neg(Lib3dsQuat c)
-{
- int i;
- for (i=0; i<4; ++i) {
- c[i]=-c[i];
- }
-}
-
-
-/*!
- * Compute the absolute value of a quaternion
- *
- * \ingroup quat
- */
-void
-lib3ds_quat_abs(Lib3dsQuat c)
-{
- int i;
- for (i=0; i<4; ++i) {
- c[i]=(Lib3dsFloat)fabs(c[i]);
- }
-}
-
-
-/*!
- * Compute the conjugate of a quaternion
- *
- * \ingroup quat
- */
-void
-lib3ds_quat_cnj(Lib3dsQuat c)
-{
- int i;
- for (i=0; i<3; ++i) {
- c[i]=-c[i];
- }
-}
-
-
-/*!
- * Multiply two quaternions.
- *
- * \param c Result
- * \param a,b Inputs
- * \ingroup quat
- */
-void
-lib3ds_quat_mul(Lib3dsQuat c, Lib3dsQuat a, Lib3dsQuat b)
-{
- c[0]=a[3]*b[0] + a[0]*b[3] + a[1]*b[2] - a[2]*b[1];
- c[1]=a[3]*b[1] + a[1]*b[3] + a[2]*b[0] - a[0]*b[2];
- c[2]=a[3]*b[2] + a[2]*b[3] + a[0]*b[1] - a[1]*b[0];
- c[3]=a[3]*b[3] - a[0]*b[0] - a[1]*b[1] - a[2]*b[2];
-}
-
-
-/*!
- * Multiply a quaternion by a scalar.
- *
- * \ingroup quat
- */
-void
-lib3ds_quat_scalar(Lib3dsQuat c, Lib3dsFloat k)
-{
- int i;
- for (i=0; i<4; ++i) {
- c[i]*=k;
- }
-}
-
-
-/*!
- * Normalize a quaternion.
- *
- * \ingroup quat
- */
-void
-lib3ds_quat_normalize(Lib3dsQuat c)
-{
- Lib3dsDouble l,m;
-
- l=sqrt(c[0]*c[0] + c[1]*c[1] + c[2]*c[2] + c[3]*c[3]);
- if (fabs(l)<LIB3DS_EPSILON) {
- c[0]=c[1]=c[2]=0.0f;
- c[3]=1.0f;
- }
- else {
- int i;
- m=1.0f/l;
- for (i=0; i<4; ++i) {
- c[i]=(Lib3dsFloat)(c[i]*m);
- }
- }
-}
-
-
-/*!
- * Compute the inverse of a quaternion.
- *
- * \ingroup quat
- */
-void
-lib3ds_quat_inv(Lib3dsQuat c)
-{
- Lib3dsDouble l,m;
-
- l=sqrt(c[0]*c[0] + c[1]*c[1] + c[2]*c[2] + c[3]*c[3]);
- if (fabs(l)<LIB3DS_EPSILON) {
- c[0]=c[1]=c[2]=0.0f;
- c[3]=1.0f;
- }
- else {
- m=1.0f/l;
- c[0]=(Lib3dsFloat)(-c[0]*m);
- c[1]=(Lib3dsFloat)(-c[1]*m);
- c[2]=(Lib3dsFloat)(-c[2]*m);
- c[3]=(Lib3dsFloat)(c[3]*m);
- }
-}
-
-
-/*!
- * Compute the dot-product of a quaternion.
- *
- * \ingroup quat
- */
-Lib3dsFloat
-lib3ds_quat_dot(Lib3dsQuat a, Lib3dsQuat b)
-{
- return(a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + a[3]*b[3]);
-}
-
-
-/*!
- * \ingroup quat
- */
-Lib3dsFloat
-lib3ds_quat_squared(Lib3dsQuat c)
-{
- return(c[0]*c[0] + c[1]*c[1] + c[2]*c[2] + c[3]*c[3]);
-}
-
-
-/*!
- * \ingroup quat
- */
-Lib3dsFloat
-lib3ds_quat_length(Lib3dsQuat c)
-{
- return((Lib3dsFloat)sqrt(c[0]*c[0] + c[1]*c[1] + c[2]*c[2] + c[3]*c[3]));
-}
-
-
-/*!
- * \ingroup quat
- */
-void
-lib3ds_quat_ln(Lib3dsQuat c)
-{
- Lib3dsDouble om,s,t;
-
- s=sqrt(c[0]*c[0] + c[1]*c[1] + c[2]*c[2]);
- om=atan2(s,c[3]);
- if (fabs(s)<LIB3DS_EPSILON) {
- t=0.0f;
- }
- else {
- t=om/s;
- }
- {
- int i;
- for (i=0; i<3; ++i) {
- c[i]=(Lib3dsFloat)(c[i]*t);
- }
- c[3]=0.0f;
- }
-}
-
-
-/*!
- * \ingroup quat
- */
-void
-lib3ds_quat_ln_dif(Lib3dsQuat c, Lib3dsQuat a, Lib3dsQuat b)
-{
- Lib3dsQuat invp;
-
- lib3ds_quat_copy(invp, a);
- lib3ds_quat_inv(invp);
- lib3ds_quat_mul(c, invp, b);
- lib3ds_quat_ln(c);
-}
-
-
-/*!
- * \ingroup quat
- */
-void
-lib3ds_quat_exp(Lib3dsQuat c)
-{
- Lib3dsDouble om,sinom;
-
- om=sqrt(c[0]*c[0] + c[1]*c[1] + c[2]*c[2]);
- if (fabs(om)<LIB3DS_EPSILON) {
- sinom=1.0f;
- }
- else {
- sinom=sin(om)/om;
- }
- {
- int i;
- for (i=0; i<3; ++i) {
- c[i]=(Lib3dsFloat)(c[i]*sinom);
- }
- c[3]=(Lib3dsFloat)cos(om);
- }
-}
-
-
-/*!
- * \ingroup quat
- */
-void
-lib3ds_quat_slerp(Lib3dsQuat c, Lib3dsQuat a, Lib3dsQuat b, Lib3dsFloat t)
-{
- Lib3dsDouble l;
- Lib3dsDouble om,sinom;
- Lib3dsDouble sp,sq;
- Lib3dsQuat q;
-
- l=a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + a[3]*b[3];
- if ((1.0+l)>LIB3DS_EPSILON) {
- if (fabs(l)>1.0f) l/=fabs(l);
- om=acos(l);
- sinom=sin(om);
- if (fabs(sinom)>LIB3DS_EPSILON) {
- sp=sin((1.0f-t)*om)/sinom;
- sq=sin(t*om)/sinom;
- }
- else {
- sp=1.0f-t;
- sq=t;
- }
- c[0]=(Lib3dsFloat)(sp*a[0] + sq*b[0]);
- c[1]=(Lib3dsFloat)(sp*a[1] + sq*b[1]);
- c[2]=(Lib3dsFloat)(sp*a[2] + sq*b[2]);
- c[3]=(Lib3dsFloat)(sp*a[3] + sq*b[3]);
- }
- else {
- q[0]=-a[1];
- q[1]=a[0];
- q[2]=-a[3];
- q[3]=a[2];
- sp=sin((1.0-t)*LIB3DS_HALFPI);
- sq=sin(t*LIB3DS_HALFPI);
- c[0]=(Lib3dsFloat)(sp*a[0] + sq*q[0]);
- c[1]=(Lib3dsFloat)(sp*a[1] + sq*q[1]);
- c[2]=(Lib3dsFloat)(sp*a[2] + sq*q[2]);
- c[3]=(Lib3dsFloat)(sp*a[3] + sq*q[3]);
- }
-}
-
-
-/*!
- * \ingroup quat
- */
-void
-lib3ds_quat_squad(Lib3dsQuat c, Lib3dsQuat a, Lib3dsQuat p, Lib3dsQuat q,
- Lib3dsQuat b, Lib3dsFloat t)
-{
- Lib3dsQuat ab;
- Lib3dsQuat pq;
-
- lib3ds_quat_slerp(ab,a,b,t);
- lib3ds_quat_slerp(pq,p,q,t);
- lib3ds_quat_slerp(c,ab,pq,2*t*(1-t));
-}
-
-
-/*!
- * \ingroup quat
- */
-void
-lib3ds_quat_tangent(Lib3dsQuat c, Lib3dsQuat p, Lib3dsQuat q, Lib3dsQuat n)
-{
- Lib3dsQuat dn,dp,x;
- int i;
-
- lib3ds_quat_ln_dif(dn, q, n);
- lib3ds_quat_ln_dif(dp, q, p);
-
- for (i=0; i<4; i++) {
- x[i]=-1.0f/4.0f*(dn[i]+dp[i]);
- }
- lib3ds_quat_exp(x);
- lib3ds_quat_mul(c,q,x);
-}
-
-
-/*!
- * \ingroup quat
- */
-void
-lib3ds_quat_dump(Lib3dsQuat q)
-{
- printf("%f %f %f %f\n", q[0], q[1], q[2], q[3]);
-}
-
diff --git a/3rdparty/lib3ds/quat.h b/3rdparty/lib3ds/quat.h
deleted file mode 100644
index 28912829..00000000
--- a/3rdparty/lib3ds/quat.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* -*- c -*- */
-#ifndef INCLUDED_LIB3DS_QUAT_H
-#define INCLUDED_LIB3DS_QUAT_H
-/*
- * The 3D Studio File Format Library
- * Copyright (C) 1996-2007 by Jan Eric Kyprianidis <www.kyprianidis.com>
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id: quat.h,v 1.7 2007/06/14 09:59:10 jeh Exp $
- */
-
-#ifndef INCLUDED_LIB3DS_TYPES_H
-#include <lib3ds/types.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern LIB3DSAPI void lib3ds_quat_zero(Lib3dsQuat c);
-extern LIB3DSAPI void lib3ds_quat_identity(Lib3dsQuat c);
-extern LIB3DSAPI void lib3ds_quat_copy(Lib3dsQuat dest, Lib3dsQuat src);
-extern LIB3DSAPI void lib3ds_quat_axis_angle(Lib3dsQuat c, Lib3dsVector axis, Lib3dsFloat angle);
-extern LIB3DSAPI void lib3ds_quat_neg(Lib3dsQuat c);
-extern LIB3DSAPI void lib3ds_quat_abs(Lib3dsQuat c);
-extern LIB3DSAPI void lib3ds_quat_cnj(Lib3dsQuat c);
-extern LIB3DSAPI void lib3ds_quat_mul(Lib3dsQuat c, Lib3dsQuat a, Lib3dsQuat b);
-extern LIB3DSAPI void lib3ds_quat_scalar(Lib3dsQuat c, Lib3dsFloat k);
-extern LIB3DSAPI void lib3ds_quat_normalize(Lib3dsQuat c);
-extern LIB3DSAPI void lib3ds_quat_inv(Lib3dsQuat c);
-extern LIB3DSAPI Lib3dsFloat lib3ds_quat_dot(Lib3dsQuat a, Lib3dsQuat b);
-extern LIB3DSAPI Lib3dsFloat lib3ds_quat_squared(Lib3dsQuat c);
-extern LIB3DSAPI Lib3dsFloat lib3ds_quat_length(Lib3dsQuat c);
-extern LIB3DSAPI void lib3ds_quat_ln(Lib3dsQuat c);
-extern LIB3DSAPI void lib3ds_quat_ln_dif(Lib3dsQuat c, Lib3dsQuat a, Lib3dsQuat b);
-extern LIB3DSAPI void lib3ds_quat_exp(Lib3dsQuat c);
-extern LIB3DSAPI void lib3ds_quat_slerp(Lib3dsQuat c, Lib3dsQuat a, Lib3dsQuat b, Lib3dsFloat t);
-extern LIB3DSAPI void lib3ds_quat_squad(Lib3dsQuat c, Lib3dsQuat a, Lib3dsQuat p, Lib3dsQuat q,
- Lib3dsQuat b, Lib3dsFloat t);
-extern LIB3DSAPI void lib3ds_quat_tangent(Lib3dsQuat c, Lib3dsQuat p, Lib3dsQuat q, Lib3dsQuat n);
-extern LIB3DSAPI void lib3ds_quat_dump(Lib3dsQuat q);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
-
diff --git a/3rdparty/lib3ds/shadow.c b/3rdparty/lib3ds/shadow.c
deleted file mode 100644
index 601dd378..00000000
--- a/3rdparty/lib3ds/shadow.c
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * The 3D Studio File Format Library
- * Copyright (C) 1996-2007 by Jan Eric Kyprianidis <www.kyprianidis.com>
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id: shadow.c,v 1.11 2007/06/20 17:04:09 jeh Exp $
- */
-#include <lib3ds/shadow.h>
-#include <lib3ds/chunk.h>
-#include <lib3ds/io.h>
-#include <math.h>
-
-
-/*!
- * \defgroup shadow Shadow Map Settings
- */
-
-
-/*!
- * \ingroup shadow
- */
-Lib3dsBool
-lib3ds_shadow_read(Lib3dsShadow *shadow, Lib3dsIo *io)
-{
- Lib3dsChunk c;
-
- if (!lib3ds_chunk_read(&c, io)) {
- return(LIB3DS_FALSE);
- }
-
- switch (c.chunk) {
- case LIB3DS_SHADOW_MAP_SIZE:
- {
- shadow->map_size=lib3ds_io_read_intw(io);
- }
- break;
- case LIB3DS_LO_SHADOW_BIAS:
- {
- shadow->lo_bias=lib3ds_io_read_float(io);
- }
- break;
- case LIB3DS_HI_SHADOW_BIAS:
- {
- shadow->hi_bias=lib3ds_io_read_float(io);
- }
- break;
- case LIB3DS_SHADOW_SAMPLES:
- {
- shadow->samples=lib3ds_io_read_intw(io);
- }
- break;
- case LIB3DS_SHADOW_RANGE:
- {
- shadow->range=lib3ds_io_read_intd(io);
- }
- break;
- case LIB3DS_SHADOW_FILTER:
- {
- shadow->filter=lib3ds_io_read_float(io);
- }
- break;
- case LIB3DS_RAY_BIAS:
- {
- shadow->ray_bias=lib3ds_io_read_float(io);
- }
- break;
- }
-
- return(LIB3DS_TRUE);
-}
-
-
-/*!
- * \ingroup shadow
- */
-Lib3dsBool
-lib3ds_shadow_write(Lib3dsShadow *shadow, Lib3dsIo *io)
-{
- if (fabs(shadow->lo_bias)>LIB3DS_EPSILON) { /*---- LIB3DS_LO_SHADOW_BIAS ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_LO_SHADOW_BIAS;
- c.size=10;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_float(io, shadow->lo_bias);
- }
-
- if (fabs(shadow->hi_bias)>LIB3DS_EPSILON) { /*---- LIB3DS_HI_SHADOW_BIAS ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_HI_SHADOW_BIAS;
- c.size=10;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_float(io, shadow->hi_bias);
- }
-
- if (shadow->map_size) { /*---- LIB3DS_SHADOW_MAP_SIZE ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_SHADOW_MAP_SIZE;
- c.size=8;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_intw(io, shadow->map_size);
- }
-
- if (shadow->samples) { /*---- LIB3DS_SHADOW_SAMPLES ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_SHADOW_SAMPLES;
- c.size=8;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_intw(io, shadow->samples);
- }
-
- if (shadow->range) { /*---- LIB3DS_SHADOW_RANGE ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_SHADOW_RANGE;
- c.size=10;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_intd(io, shadow->range);
- }
-
- if (fabs(shadow->filter)>LIB3DS_EPSILON) { /*---- LIB3DS_SHADOW_FILTER ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_SHADOW_FILTER;
- c.size=10;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_float(io, shadow->filter);
- }
- if (fabs(shadow->ray_bias)>LIB3DS_EPSILON) { /*---- LIB3DS_RAY_BIAS ----*/
- Lib3dsChunk c;
- c.chunk=LIB3DS_RAY_BIAS;
- c.size=10;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_float(io, shadow->ray_bias);
- }
- return(LIB3DS_TRUE);
-}
-
diff --git a/3rdparty/lib3ds/shadow.h b/3rdparty/lib3ds/shadow.h
deleted file mode 100644
index cc31ba95..00000000
--- a/3rdparty/lib3ds/shadow.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* -*- c -*- */
-#ifndef INCLUDED_LIB3DS_SHADOW_H
-#define INCLUDED_LIB3DS_SHADOW_H
-/*
- * The 3D Studio File Format Library
- * Copyright (C) 1996-2007 by Jan Eric Kyprianidis <www.kyprianidis.com>
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id: shadow.h,v 1.11 2007/06/20 17:04:09 jeh Exp $
- */
-
-#ifndef INCLUDED_LIB3DS_TYPES_H
-#include <lib3ds/types.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * Shadow map settings
- * \ingroup shadow
- */
-struct Lib3dsShadow {
- Lib3dsIntw map_size;
- Lib3dsFloat lo_bias;
- Lib3dsFloat hi_bias;
- Lib3dsIntw samples;
- Lib3dsIntd range;
- Lib3dsFloat filter;
- Lib3dsFloat ray_bias;
-};
-
-extern LIB3DSAPI Lib3dsBool lib3ds_shadow_read(Lib3dsShadow *shadow, Lib3dsIo *io);
-extern LIB3DSAPI Lib3dsBool lib3ds_shadow_write(Lib3dsShadow *shadow, Lib3dsIo *io);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
-
-
-
-
-
diff --git a/3rdparty/lib3ds/tcb.c b/3rdparty/lib3ds/tcb.c
deleted file mode 100644
index b1a0cac2..00000000
--- a/3rdparty/lib3ds/tcb.c
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * The 3D Studio File Format Library
- * Copyright (C) 1996-2007 by Jan Eric Kyprianidis <www.kyprianidis.com>
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id: tcb.c,v 1.11 2007/06/15 09:33:19 jeh Exp $
- */
-#include <lib3ds/tcb.h>
-#include <lib3ds/io.h>
-#include <math.h>
-
-
-/*!
- * \defgroup tcb Tension/Continuity/Bias Splines
- */
-
-
-/*!
- * \ingroup tcb
- */
-void
-lib3ds_tcb(Lib3dsTcb *p, Lib3dsTcb *pc, Lib3dsTcb *c, Lib3dsTcb *nc, Lib3dsTcb *n,
- Lib3dsFloat *ksm, Lib3dsFloat *ksp, Lib3dsFloat *kdm, Lib3dsFloat *kdp)
-{
- Lib3dsFloat tm,cm,cp,bm,bp,tmcm,tmcp,cc;
- Lib3dsFloat dt,fp,fn;
-
- if (!pc) {
- pc=c;
- }
- if (!nc) {
- nc=c;
- }
-
- fp=fn=1.0f;
- if (p&&n) {
- dt=0.5f*(Lib3dsFloat)(pc->frame-p->frame+n->frame-nc->frame);
- fp=((Lib3dsFloat)(pc->frame-p->frame))/dt;
- fn=((Lib3dsFloat)(n->frame-nc->frame))/dt;
- cc=(Lib3dsFloat)fabs(c->cont);
- fp=fp+cc-cc*fp;
- fn=fn+cc-cc*fn;
- }
-
- cm=1.0f-c->cont;
- tm=0.5f*(1.0f-c->tens);
- cp=2.0f-cm;
- bm=1.0f-c->bias;
- bp=2.0f-bm;
- tmcm=tm*cm;
- tmcp=tm*cp;
- *ksm=tmcm*bp*fp;
- *ksp=tmcp*bm*fp;
- *kdm=tmcp*bp*fn;
- *kdp=tmcm*bm*fn;
-}
-
-
-/*!
- * \ingroup tcb
- */
-Lib3dsBool
-lib3ds_tcb_read(Lib3dsTcb *tcb, Lib3dsIo *io)
-{
- Lib3dsWord flags;
-
- tcb->frame=lib3ds_io_read_intd(io);
- tcb->flags=flags=lib3ds_io_read_word(io);
- if (flags&LIB3DS_USE_TENSION) {
- tcb->tens=lib3ds_io_read_float(io);
- }
- if (flags&LIB3DS_USE_CONTINUITY) {
- tcb->cont=lib3ds_io_read_float(io);
- }
- if (flags&LIB3DS_USE_BIAS) {
- tcb->bias=lib3ds_io_read_float(io);
- }
- if (flags&LIB3DS_USE_EASE_TO) {
- tcb->ease_to=lib3ds_io_read_float(io);
- }
- if (flags&LIB3DS_USE_EASE_FROM) {
- tcb->ease_from=lib3ds_io_read_float(io);
- }
- if (lib3ds_io_error(io)) {
- return(LIB3DS_FALSE);
- }
- return(LIB3DS_TRUE);
-}
-
-
-/*!
- * \ingroup tcb
- */
-Lib3dsBool
-lib3ds_tcb_write(Lib3dsTcb *tcb, Lib3dsIo *io)
-{
- lib3ds_io_write_intd(io, tcb->frame);
- lib3ds_io_write_word(io, tcb->flags);
- if (tcb->flags&LIB3DS_USE_TENSION) {
- lib3ds_io_write_float(io, tcb->tens);
- }
- if (tcb->flags&LIB3DS_USE_CONTINUITY) {
- lib3ds_io_write_float(io, tcb->cont);
- }
- if (tcb->flags&LIB3DS_USE_BIAS) {
- lib3ds_io_write_float(io, tcb->bias);
- }
- if (tcb->flags&LIB3DS_USE_EASE_TO) {
- lib3ds_io_write_float(io, tcb->ease_to);
- }
- if (tcb->flags&LIB3DS_USE_EASE_FROM) {
- lib3ds_io_write_float(io, tcb->ease_from);
- }
- if (lib3ds_io_error(io)) {
- return(LIB3DS_FALSE);
- }
- return(LIB3DS_TRUE);
-}
-
-
-
-
diff --git a/3rdparty/lib3ds/tcb.h b/3rdparty/lib3ds/tcb.h
deleted file mode 100644
index 3d8e3f63..00000000
--- a/3rdparty/lib3ds/tcb.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -*- c -*- */
-#ifndef INCLUDED_LIB3DS_TCB_H
-#define INCLUDED_LIB3DS_TCB_H
-/*
- * The 3D Studio File Format Library
- * Copyright (C) 1996-2007 by Jan Eric Kyprianidis <www.kyprianidis.com>
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id: tcb.h,v 1.11 2007/06/20 17:04:09 jeh Exp $
- */
-
-#ifndef INCLUDED_LIB3DS_TYPES_H
-#include <lib3ds/types.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef enum Lib3dsTcbFlags{
- LIB3DS_USE_TENSION =0x0001,
- LIB3DS_USE_CONTINUITY =0x0002,
- LIB3DS_USE_BIAS =0x0004,
- LIB3DS_USE_EASE_TO =0x0008,
- LIB3DS_USE_EASE_FROM =0x0010
-} Lib3dsTcbFlags;
-
-typedef struct Lib3dsTcb {
- Lib3dsIntd frame;
- Lib3dsWord flags;
- Lib3dsFloat tens;
- Lib3dsFloat cont;
- Lib3dsFloat bias;
- Lib3dsFloat ease_to;
- Lib3dsFloat ease_from;
-} Lib3dsTcb;
-
-extern LIB3DSAPI void lib3ds_tcb(Lib3dsTcb *p, Lib3dsTcb *pc, Lib3dsTcb *c,
- Lib3dsTcb *nc, Lib3dsTcb *n, Lib3dsFloat *ksm, Lib3dsFloat *ksp,
- Lib3dsFloat *kdm, Lib3dsFloat *kdp);
-extern LIB3DSAPI Lib3dsBool lib3ds_tcb_read(Lib3dsTcb *tcb, Lib3dsIo *io);
-extern LIB3DSAPI Lib3dsBool lib3ds_tcb_write(Lib3dsTcb *tcb, Lib3dsIo *io);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
-
diff --git a/3rdparty/lib3ds/tracks.c b/3rdparty/lib3ds/tracks.c
deleted file mode 100644
index cc24455a..00000000
--- a/3rdparty/lib3ds/tracks.c
+++ /dev/null
@@ -1,1556 +0,0 @@
-/*
- * The 3D Studio File Format Library
- * Copyright (C) 1996-2007 by Jan Eric Kyprianidis <www.kyprianidis.com>
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id: tracks.c,v 1.20 2007/06/15 09:33:19 jeh Exp $
- */
-#include <lib3ds/tracks.h>
-#include <lib3ds/io.h>
-#include <lib3ds/chunk.h>
-#include <lib3ds/vector.h>
-#include <lib3ds/quat.h>
-#include <lib3ds/node.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-
-
-/*!
- * \defgroup tracks Keyframing Tracks
- */
-
-
-/*!
- * \ingroup tracks
- */
-Lib3dsBoolKey*
-lib3ds_bool_key_new()
-{
- Lib3dsBoolKey* k;
- k=(Lib3dsBoolKey*)calloc(sizeof(Lib3dsBoolKey), 1);
- return(k);
-}
-
-
-/*!
- * \ingroup tracks
- */
-void
-lib3ds_bool_key_free(Lib3dsBoolKey *key)
-{
- ASSERT(key);
- free(key);
-}
-
-
-/*!
- * \ingroup tracks
- */
-void
-lib3ds_bool_track_free_keys(Lib3dsBoolTrack *track)
-{
- Lib3dsBoolKey *p,*q;
-
- ASSERT(track);
- for (p=track->keyL; p; p=q) {
- q=p->next;
- lib3ds_bool_key_free(p);
- }
-}
-
-
-/*!
- * \ingroup tracks
- */
-void
-lib3ds_bool_track_insert(Lib3dsBoolTrack *track, Lib3dsBoolKey *key)
-{
- ASSERT(track);
- ASSERT(key);
- ASSERT(!key->next);
-
- if (!track->keyL) {
- track->keyL=key;
- key->next=0;
- }
- else {
- Lib3dsBoolKey *k,*p;
-
- for (p=0,k=track->keyL; k!=0; p=k, k=k->next) {
- if (k->tcb.frame>key->tcb.frame) {
- break;
- }
- }
- if (!p) {
- key->next=track->keyL;
- track->keyL=key;
- }
- else {
- key->next=k;
- p->next=key;
- }
-
- if (k && (key->tcb.frame==k->tcb.frame)) {
- key->next=k->next;
- lib3ds_bool_key_free(k);
- }
- }
-}
-
-
-/*!
- * \ingroup tracks
- */
-void
-lib3ds_bool_track_remove(Lib3dsBoolTrack *track, Lib3dsIntd frame)
-{
- Lib3dsBoolKey *k,*p;
-
- ASSERT(track);
- if (!track->keyL) {
- return;
- }
- for (p=0,k=track->keyL; k!=0; p=k, k=k->next) {
- if (k->tcb.frame==frame) {
- if (!p) {
- track->keyL=track->keyL->next;
- }
- else {
- p->next=k->next;
- }
- lib3ds_bool_key_free(k);
- break;
- }
- }
-}
-
-
-/*!
- * \ingroup tracks
- */
-void
-lib3ds_bool_track_eval(Lib3dsBoolTrack *track, Lib3dsBool *p, Lib3dsFloat t)
-{
- Lib3dsBoolKey *k;
- Lib3dsBool result;
-
- ASSERT(p);
- if (!track->keyL) {
- *p=LIB3DS_FALSE;
- return;
- }
- if (!track->keyL->next) {
- *p = LIB3DS_TRUE;
- return;
- }
-
- result=LIB3DS_FALSE;
- k=track->keyL;
- while ((t<(Lib3dsFloat)k->tcb.frame) && (t>=(Lib3dsFloat)k->next->tcb.frame)) {
- if (result) {
- result=LIB3DS_FALSE;
- }
- else {
- result=LIB3DS_TRUE;
- }
- if (!k->next) {
- if (track->flags&LIB3DS_REPEAT) {
- t-=(Lib3dsFloat)k->tcb.frame;
- k=track->keyL;
- }
- else {
- break;
- }
- }
- else {
- k=k->next;
- }
- }
- *p=result;
-}
-
-
-/*!
- * \ingroup tracks
- */
-Lib3dsBool
-lib3ds_bool_track_read(Lib3dsBoolTrack *track, Lib3dsIo *io)
-{
- int keys;
- int i;
- Lib3dsBoolKey *k;
-
- track->flags=lib3ds_io_read_word(io);
- lib3ds_io_read_dword(io);
- lib3ds_io_read_dword(io);
- keys=lib3ds_io_read_intd(io);
-
- for (i=0; i<keys; ++i) {
- k=lib3ds_bool_key_new();
- if (!lib3ds_tcb_read(&k->tcb, io)) {
- return(LIB3DS_FALSE);
- }
- lib3ds_bool_track_insert(track, k);
- }
-
- return(LIB3DS_TRUE);
-}
-
-
-/*!
- * \ingroup tracks
- */
-Lib3dsBool
-lib3ds_bool_track_write(Lib3dsBoolTrack *track, Lib3dsIo *io)
-{
- Lib3dsBoolKey *k;
- Lib3dsDword num=0;
- for (k=track->keyL; k; k=k->next) {
- ++num;
- }
- lib3ds_io_write_word(io, (Lib3dsWord)track->flags);
- lib3ds_io_write_dword(io, 0);
- lib3ds_io_write_dword(io, 0);
- lib3ds_io_write_dword(io, num);
-
- for (k=track->keyL; k; k=k->next) {
- if (!lib3ds_tcb_write(&k->tcb,io)) {
- return(LIB3DS_FALSE);
- }
- }
- return(LIB3DS_TRUE);
-}
-
-
-/*!
- * \ingroup tracks
- */
-Lib3dsLin1Key*
-lib3ds_lin1_key_new()
-{
- Lib3dsLin1Key* k;
- k=(Lib3dsLin1Key*)calloc(sizeof(Lib3dsLin1Key), 1);
- return(k);
-}
-
-
-/*!
- * \ingroup tracks
- */
-void
-lib3ds_lin1_key_free(Lib3dsLin1Key *key)
-{
- ASSERT(key);
- free(key);
-}
-
-
-/*!
- * \ingroup tracks
- */
-void
-lib3ds_lin1_track_free_keys(Lib3dsLin1Track *track)
-{
- Lib3dsLin1Key *p,*q;
-
- ASSERT(track);
- for (p=track->keyL; p; p=q) {
- q=p->next;
- lib3ds_lin1_key_free(p);
- }
-}
-
-
-/*!
- * \ingroup tracks
- */
-void
-lib3ds_lin1_key_setup(Lib3dsLin1Key *p, Lib3dsLin1Key *cp, Lib3dsLin1Key *c,
- Lib3dsLin1Key *cn, Lib3dsLin1Key *n)
-{
- Lib3dsFloat np,nn;
- Lib3dsFloat ksm,ksp,kdm,kdp;
-
- ASSERT(c);
- if (!cp) {
- cp=c;
- }
- if (!cn) {
- cn=c;
- }
- if (!p && !n) {
- c->ds=0;
- c->dd=0;
- return;
- }
-
- if (n && p) {
- lib3ds_tcb(&p->tcb, &cp->tcb, &c->tcb, &cn->tcb, &n->tcb, &ksm, &ksp, &kdm, &kdp);
- np = c->value - p->value;
- nn = n->value - c->value;
-
- c->ds=ksm*np + ksp*nn;
- c->dd=kdm*np + kdp*nn;
- }
- else {
- if (p) {
- np = c->value - p->value;
- c->ds = np;
- c->dd = np;
- }
- if (n) {
- nn = n->value - c->value;
- c->ds = nn;
- c->dd = nn;
- }
- }
-}
-
-
-/*!
- * \ingroup tracks
- */
-void
-lib3ds_lin1_track_setup(Lib3dsLin1Track *track)
-{
- Lib3dsLin1Key *pp,*pc,*pn,*pl;
-
- ASSERT(track);
- pc=track->keyL;
- if (!pc) {
- return;
- }
- if (!pc->next) {
- pc->ds=0;
- pc->dd=0;
- return;
- }
-
- if (track->flags&LIB3DS_SMOOTH) {
- for (pl=track->keyL; pl->next->next; pl=pl->next);
- lib3ds_lin1_key_setup(pl, pl->next, pc, 0, pc->next);
- }
- else {
- lib3ds_lin1_key_setup(0, 0, pc, 0, pc->next);
- }
- for (;;) {
- pp=pc;
- pc=pc->next;
- pn=pc->next;
- if (!pn) {
- break;
- }
- lib3ds_lin1_key_setup(pp, 0, pc, 0, pn);
- }
-
- if (track->flags&LIB3DS_SMOOTH) {
- lib3ds_lin1_key_setup(pp, 0, pc, track->keyL, track->keyL->next);
- }
- else {
- lib3ds_lin1_key_setup(pp, 0, pc, 0, 0);
- }
-}
-
-
-/*!
- * \ingroup tracks
- */
-void
-lib3ds_lin1_track_insert(Lib3dsLin1Track *track, Lib3dsLin1Key *key)
-{
- ASSERT(track);
- ASSERT(key);
- ASSERT(!key->next);
-
- if (!track->keyL) {
- track->keyL=key;
- key->next=0;
- }
- else {
- Lib3dsLin1Key *k,*p;
-
- for (p=0,k=track->keyL; k!=0; p=k, k=k->next) {
- if (k->tcb.frame>key->tcb.frame) {
- break;
- }
- }
- if (!p) {
- key->next=track->keyL;
- track->keyL=key;
- }
- else {
- key->next=k;
- p->next=key;
- }
-
- if (k && (key->tcb.frame==k->tcb.frame)) {
- key->next=k->next;
- lib3ds_lin1_key_free(k);
- }
- }
-}
-
-
-/*!
- * \ingroup tracks
- */
-void
-lib3ds_lin1_track_remove(Lib3dsLin1Track *track, Lib3dsIntd frame)
-{
- Lib3dsLin1Key *k,*p;
-
- ASSERT(track);
- if (!track->keyL) {
- return;
- }
- for (p=0,k=track->keyL; k!=0; p=k, k=k->next) {
- if (k->tcb.frame==frame) {
- if (!p) {
- track->keyL=track->keyL->next;
- }
- else {
- p->next=k->next;
- }
- lib3ds_lin1_key_free(k);
- break;
- }
- }
-}
-
-
-static Lib3dsFloat
-lib3ds_float_cubic(Lib3dsFloat a, Lib3dsFloat p, Lib3dsFloat q, Lib3dsFloat b, Lib3dsFloat t)
-{
- Lib3dsDouble x,y,z,w;
-
- x=2*t*t*t - 3*t*t + 1;
- y=-2*t*t*t + 3*t*t;
- z=t*t*t - 2*t*t + t;
- w=t*t*t - t*t;
- return((Lib3dsFloat)(x*a + y*b + z*p + w*q));
-}
-
-
-/*!
- * \ingroup tracks
- */
-void
-lib3ds_lin1_track_eval(Lib3dsLin1Track *track, Lib3dsFloat *p, Lib3dsFloat t)
-{
- Lib3dsLin1Key *k;
- Lib3dsFloat nt;
- Lib3dsFloat u;
-
- ASSERT(p);
- if (!track->keyL) {
- *p=0;
- return;
- }
- if (!track->keyL->next || ((t<track->keyL->tcb.frame) && ((track->flags&LIB3DS_REPEAT) != 0))) {
- *p = track->keyL->value;
- return;
- }
-
- for (k=track->keyL; k->next!=0; k=k->next) {
- if ((t>=(Lib3dsFloat)k->tcb.frame) && (t<(Lib3dsFloat)k->next->tcb.frame)) {
- break;
- }
- }
- if (!k->next) {
- if (track->flags&LIB3DS_REPEAT) {
- nt=(Lib3dsFloat)fmod(t - track->keyL->tcb.frame, k->tcb.frame - track->keyL->tcb.frame) + track->keyL->tcb.frame;
- for (k=track->keyL; k->next!=0; k=k->next) {
- if ((nt>=(Lib3dsFloat)k->tcb.frame) && (nt<(Lib3dsFloat)k->next->tcb.frame)) {
- break;
- }
- }
- ASSERT(k->next);
- }
- else {
- *p = k->value;
- return;
- }
- }
- else {
- nt=t;
- }
- u=nt - (Lib3dsFloat)k->tcb.frame;
- u/=(Lib3dsFloat)(k->next->tcb.frame - k->tcb.frame);
-
- *p = lib3ds_float_cubic(
- k->value,
- k->dd,
- k->next->ds,
- k->next->value,
- u
- );
-}
-
-
-/*!
- * \ingroup tracks
- */
-Lib3dsBool
-lib3ds_lin1_track_read(Lib3dsLin1Track *track, Lib3dsIo *io)
-{
- int keys;
- int i;
- Lib3dsLin1Key *k;
-
- track->flags=lib3ds_io_read_word(io);
- lib3ds_io_read_dword(io);
- lib3ds_io_read_dword(io);
- keys=lib3ds_io_read_intd(io);
-
- for (i=0; i<keys; ++i) {
- k=lib3ds_lin1_key_new();
- if (!lib3ds_tcb_read(&k->tcb, io)) {
- return(LIB3DS_FALSE);
- }
- k->value=lib3ds_io_read_float(io);
- lib3ds_lin1_track_insert(track, k);
- }
- lib3ds_lin1_track_setup(track);
- return(LIB3DS_TRUE);
-}
-
-
-/*!
- * \ingroup tracks
- */
-Lib3dsBool
-lib3ds_lin1_track_write(Lib3dsLin1Track *track, Lib3dsIo *io)
-{
- Lib3dsLin1Key *k;
- Lib3dsDword num=0;
- for (k=track->keyL; k; k=k->next) {
- ++num;
- }
- lib3ds_io_write_word(io, (Lib3dsWord)track->flags);
- lib3ds_io_write_dword(io, 0);
- lib3ds_io_write_dword(io, 0);
- lib3ds_io_write_dword(io, num);
-
- for (k=track->keyL; k; k=k->next) {
- if (!lib3ds_tcb_write(&k->tcb,io)) {
- return(LIB3DS_FALSE);
- }
- lib3ds_io_write_float(io, k->value);
- }
- return(LIB3DS_TRUE);
-}
-
-
-/*!
- * Create and return one keyframe in a Lin3 track. All values are
- * initialized to zero.
- *
- * \ingroup tracks
- */
-Lib3dsLin3Key*
-lib3ds_lin3_key_new()
-{
- Lib3dsLin3Key* k;
- k=(Lib3dsLin3Key*)calloc(sizeof(Lib3dsLin3Key), 1);
- return(k);
-}
-
-
-/*!
- * Free a Lin3 keyframe.
- *
- * \ingroup tracks
- */
-void
-lib3ds_lin3_key_free(Lib3dsLin3Key *key)
-{
- ASSERT(key);
- free(key);
-}
-
-
-/*!
- * Free all keyframes in a Lin3 track.
- *
- * \ingroup tracks
- */
-void
-lib3ds_lin3_track_free_keys(Lib3dsLin3Track *track)
-{
- Lib3dsLin3Key *p,*q;
-
- ASSERT(track);
- for (p=track->keyL; p; p=q) {
- q=p->next;
- lib3ds_lin3_key_free(p);
- }
-}
-
-
-/*!
- * \ingroup tracks
- */
-void
-lib3ds_lin3_key_setup(Lib3dsLin3Key *p, Lib3dsLin3Key *cp, Lib3dsLin3Key *c,
- Lib3dsLin3Key *cn, Lib3dsLin3Key *n)
-{
- Lib3dsVector np,nn;
- Lib3dsFloat ksm,ksp,kdm,kdp;
- int i;
-
- ASSERT(c);
- if (!cp) {
- cp=c;
- }
- if (!cn) {
- cn=c;
- }
- if (!p && !n) {
- lib3ds_vector_zero(c->ds);
- lib3ds_vector_zero(c->dd);
- return;
- }
-
- if (n && p) {
- lib3ds_tcb(&p->tcb, &cp->tcb, &c->tcb, &cn->tcb, &n->tcb, &ksm, &ksp, &kdm, &kdp);
- lib3ds_vector_sub(np, c->value, p->value);
- lib3ds_vector_sub(nn, n->value, c->value);
-
- for (i=0; i<3; ++i) {
- c->ds[i]=ksm*np[i] + ksp*nn[i];
- c->dd[i]=kdm*np[i] + kdp*nn[i];
- }
- }
- else {
- if (p) {
- lib3ds_vector_sub(np, c->value, p->value);
- lib3ds_vector_copy(c->ds, np);
- lib3ds_vector_copy(c->dd, np);
- }
- if (n) {
- lib3ds_vector_sub(nn, n->value, c->value);
- lib3ds_vector_copy(c->ds, nn);
- lib3ds_vector_copy(c->dd, nn);
- }
- }
-}
-
-
-/*!
- * \ingroup tracks
- */
-void
-lib3ds_lin3_track_setup(Lib3dsLin3Track *track)
-{
- Lib3dsLin3Key *pp,*pc,*pn,*pl;
-
- ASSERT(track);
- pc=track->keyL;
- if (!pc) {
- return;
- }
- if (!pc->next) {
- lib3ds_vector_zero(pc->ds);
- lib3ds_vector_zero(pc->dd);
- return;
- }
-
- if (track->flags&LIB3DS_SMOOTH) {
- for (pl=track->keyL; pl->next->next; pl=pl->next);
- lib3ds_lin3_key_setup(pl, pl->next, pc, 0, pc->next);
- }
- else {
- lib3ds_lin3_key_setup(0, 0, pc, 0, pc->next);
- }
- for (;;) {
- pp=pc;
- pc=pc->next;
- pn=pc->next;
- if (!pn) {
- break;
- }
- lib3ds_lin3_key_setup(pp, 0, pc, 0, pn);
- }
-
- if (track->flags&LIB3DS_SMOOTH) {
- lib3ds_lin3_key_setup(pp, 0, pc, track->keyL, track->keyL->next);
- }
- else {
- lib3ds_lin3_key_setup(pp, 0, pc, 0, 0);
- }
-}
-
-
-/*!
- * \ingroup tracks
- */
-void
-lib3ds_lin3_track_insert(Lib3dsLin3Track *track, Lib3dsLin3Key *key)
-{
- ASSERT(track);
- ASSERT(key);
- ASSERT(!key->next);
-
- if (!track->keyL) {
- track->keyL=key;
- key->next=0;
- }
- else {
- Lib3dsLin3Key *k,*p;
-
- for (p=0,k=track->keyL; k!=0; p=k, k=k->next) {
- if (k->tcb.frame>key->tcb.frame) {
- break;
- }
- }
- if (!p) {
- key->next=track->keyL;
- track->keyL=key;
- }
- else {
- key->next=k;
- p->next=key;
- }
-
- if (k && (key->tcb.frame==k->tcb.frame)) {
- key->next=k->next;
- lib3ds_lin3_key_free(k);
- }
- }
-}
-
-
-/*!
- * \ingroup tracks
- */
-void
-lib3ds_lin3_track_remove(Lib3dsLin3Track *track, Lib3dsIntd frame)
-{
- Lib3dsLin3Key *k,*p;
-
- ASSERT(track);
- if (!track->keyL) {
- return;
- }
- for (p=0,k=track->keyL; k!=0; p=k, k=k->next) {
- if (k->tcb.frame==frame) {
- if (!p) {
- track->keyL=track->keyL->next;
- }
- else {
- p->next=k->next;
- }
- lib3ds_lin3_key_free(k);
- break;
- }
- }
-}
-
-
-/*!
- * \ingroup tracks
- */
-void
-lib3ds_lin3_track_eval(Lib3dsLin3Track *track, Lib3dsVector p, Lib3dsFloat t)
-{
- Lib3dsLin3Key *k;
- Lib3dsFloat nt;
- Lib3dsFloat u;
-
- if (!track->keyL) {
- lib3ds_vector_zero(p);
- return;
- }
- if (!track->keyL->next || ((t<track->keyL->tcb.frame) && ((track->flags&LIB3DS_REPEAT) != 0))) {
- lib3ds_vector_copy(p, track->keyL->value);
- return;
- }
-
- for (k=track->keyL; k->next!=0; k=k->next) {
- if ((t>=(Lib3dsFloat)k->tcb.frame) && (t<(Lib3dsFloat)k->next->tcb.frame)) {
- break;
- }
- }
- if (!k->next) {
- if (track->flags&LIB3DS_REPEAT) {
- nt=(Lib3dsFloat)fmod(t - track->keyL->tcb.frame, k->tcb.frame - track->keyL->tcb.frame) + track->keyL->tcb.frame;
- for (k=track->keyL; k->next!=0; k=k->next) {
- if ((nt>=(Lib3dsFloat)k->tcb.frame) && (nt<(Lib3dsFloat)k->next->tcb.frame)) {
- break;
- }
- }
- ASSERT(k->next);
- }
- else {
- lib3ds_vector_copy(p, k->value);
- return;
- }
- }
- else {
- nt=t;
- }
- u=nt - (Lib3dsFloat)k->tcb.frame;
- u/=(Lib3dsFloat)(k->next->tcb.frame - k->tcb.frame);
-
- lib3ds_vector_cubic(
- p,
- k->value,
- k->dd,
- k->next->ds,
- k->next->value,
- u
- );
-}
-
-
-/*!
- * \ingroup tracks
- */
-Lib3dsBool
-lib3ds_lin3_track_read(Lib3dsLin3Track *track, Lib3dsIo *io)
-{
- int keys;
- int i,j;
- Lib3dsLin3Key *k;
-
- track->flags=lib3ds_io_read_word(io);
- lib3ds_io_read_dword(io);
- lib3ds_io_read_dword(io);
- keys=lib3ds_io_read_intd(io);
-
- for (i=0; i<keys; ++i) {
- k=lib3ds_lin3_key_new();
- if (!lib3ds_tcb_read(&k->tcb, io)) {
- return(LIB3DS_FALSE);
- }
- for (j=0; j<3; ++j) {
- k->value[j]=lib3ds_io_read_float(io);
- }
- lib3ds_lin3_track_insert(track, k);
- }
- lib3ds_lin3_track_setup(track);
- return(LIB3DS_TRUE);
-}
-
-
-/*!
- * \ingroup tracks
- */
-Lib3dsBool
-lib3ds_lin3_track_write(Lib3dsLin3Track *track, Lib3dsIo *io)
-{
- Lib3dsLin3Key *k;
- Lib3dsDword num=0;
- for (k=track->keyL; k; k=k->next) {
- ++num;
- }
- lib3ds_io_write_word(io, (Lib3dsWord)track->flags);
- lib3ds_io_write_dword(io, 0);
- lib3ds_io_write_dword(io, 0);
- lib3ds_io_write_dword(io, num);
-
- for (k=track->keyL; k; k=k->next) {
- if (!lib3ds_tcb_write(&k->tcb,io)) {
- return(LIB3DS_FALSE);
- }
- lib3ds_io_write_vector(io, k->value);
- }
- return(LIB3DS_TRUE);
-}
-
-
-/*!
- * \ingroup tracks
- */
-Lib3dsQuatKey*
-lib3ds_quat_key_new()
-{
- Lib3dsQuatKey* k;
- k=(Lib3dsQuatKey*)calloc(sizeof(Lib3dsQuatKey), 1);
- return(k);
-}
-
-
-/*!
- * \ingroup tracks
- */
-void
-lib3ds_quat_key_free(Lib3dsQuatKey *key)
-{
- ASSERT(key);
- free(key);
-}
-
-
-/*!
- * \ingroup tracks
- */
-void
-lib3ds_quat_track_free_keys(Lib3dsQuatTrack *track)
-{
- Lib3dsQuatKey *p,*q;
-
- ASSERT(track);
- for (p=track->keyL; p; p=q) {
- q=p->next;
- lib3ds_quat_key_free(p);
- }
-}
-
-
-/*!
- * \ingroup tracks
- */
-void
-lib3ds_quat_key_setup(Lib3dsQuatKey *p, Lib3dsQuatKey *cp, Lib3dsQuatKey *c,
- Lib3dsQuatKey *cn, Lib3dsQuatKey *n)
-{
- Lib3dsFloat ksm,ksp,kdm,kdp;
- Lib3dsQuat q,qp,qn,qa,qb;
- int i;
-
- ASSERT(c);
- if (!cp) {
- cp=c;
- }
- if (!cn) {
- cn=c;
- }
- if (!p || !n) {
- lib3ds_quat_copy(c->ds, c->q);
- lib3ds_quat_copy(c->dd, c->q);
- return;
- }
-
- if (p) {
- if (p->angle>LIB3DS_TWOPI-LIB3DS_EPSILON) {
- lib3ds_quat_axis_angle(qp, p->axis, 0.0f);
- lib3ds_quat_ln(qp);
- }
- else {
- lib3ds_quat_copy(q, p->q);
- if (lib3ds_quat_dot(q,c->q)<0) lib3ds_quat_neg(q);
-
- lib3ds_quat_ln_dif(qp, q, c->q);
- }
- }
- if (n) {
- if (n->angle>LIB3DS_TWOPI-LIB3DS_EPSILON) {
- lib3ds_quat_axis_angle(qn, n->axis, 0.0f);
- lib3ds_quat_ln(qn);
- }
- else {
- lib3ds_quat_copy(q, n->q);
- if (lib3ds_quat_dot(q,c->q)<0) lib3ds_quat_neg(q);
- lib3ds_quat_ln_dif(qn, c->q, q);
- }
- }
-
- if (n && p) {
- lib3ds_tcb(&p->tcb, &cp->tcb, &c->tcb, &cn->tcb, &n->tcb, &ksm, &ksp, &kdm, &kdp);
- for (i=0; i<4; i++) {
- qa[i]=0.5f*(kdm*qp[i]+(kdp-1.f)*qn[i]);
- qb[i]=0.5f*((1.f-ksm)*qp[i]-ksp*qn[i]);
- }
- lib3ds_quat_exp(qa);
- lib3ds_quat_exp(qb);
-
- lib3ds_quat_mul(c->ds, c->q, qb);
- lib3ds_quat_mul(c->dd, c->q, qa);
- }
- else {
- if (p) {
- lib3ds_quat_exp(qp);
- lib3ds_quat_mul(c->ds, c->q, qp);
- lib3ds_quat_mul(c->dd, c->q, qp);
- }
- if (n) {
- lib3ds_quat_exp(qn);
- lib3ds_quat_mul(c->ds, c->q, qn);
- lib3ds_quat_mul(c->dd, c->q, qn);
- }
- }
-}
-
-
-/*!
- * \ingroup tracks
- */
-void
-lib3ds_quat_track_setup(Lib3dsQuatTrack *track)
-{
- Lib3dsQuatKey *pp,*pc,*pn,*pl;
- Lib3dsQuat q;
-
- ASSERT(track);
- for (pp=0,pc=track->keyL; pc; pp=pc,pc=pc->next) {
- lib3ds_quat_axis_angle(q, pc->axis, pc->angle);
- if (pp) {
- lib3ds_quat_mul(pc->q, q, pp->q);
- }
- else {
- lib3ds_quat_copy(pc->q, q);
- }
- }
-
- pc=track->keyL;
- if (!pc) {
- return;
- }
- if (!pc->next) {
- lib3ds_quat_copy(pc->ds, pc->q);
- lib3ds_quat_copy(pc->dd, pc->q);
- return;
- }
-
- if (track->flags&LIB3DS_SMOOTH) {
- for (pl=track->keyL; pl->next->next; pl=pl->next);
- lib3ds_quat_key_setup(pl, pl->next, pc, 0, pc->next);
- }
- else {
- lib3ds_quat_key_setup(0, 0, pc, 0, pc->next);
- }
- for (;;) {
- pp=pc;
- pc=pc->next;
- pn=pc->next;
- if (!pn) {
- break;
- }
- lib3ds_quat_key_setup(pp, 0, pc, 0, pn);
- }
-
- if (track->flags&LIB3DS_SMOOTH) {
- lib3ds_quat_key_setup(pp, 0, pc, track->keyL, track->keyL->next);
- }
- else {
- lib3ds_quat_key_setup(pp, 0, pc, 0, 0);
- }
-}
-
-
-/*!
- * \ingroup tracks
- */
-void
-lib3ds_quat_track_insert(Lib3dsQuatTrack *track, Lib3dsQuatKey *key)
-{
- ASSERT(track);
- ASSERT(key);
- ASSERT(!key->next);
-
- if (!track->keyL) {
- track->keyL=key;
- key->next=0;
- }
- else {
- Lib3dsQuatKey *k,*p;
-
- for (p=0,k=track->keyL; k!=0; p=k, k=k->next) {
- if (k->tcb.frame>key->tcb.frame) {
- break;
- }
- }
- if (!p) {
- key->next=track->keyL;
- track->keyL=key;
- }
- else {
- key->next=k;
- p->next=key;
- }
-
- if (k && (key->tcb.frame==k->tcb.frame)) {
- key->next=k->next;
- lib3ds_quat_key_free(k);
- }
- }
-}
-
-
-/*!
- * \ingroup tracks
- */
-void
-lib3ds_quat_track_remove(Lib3dsQuatTrack *track, Lib3dsIntd frame)
-{
- Lib3dsQuatKey *k,*p;
-
- ASSERT(track);
- if (!track->keyL) {
- return;
- }
- for (p=0,k=track->keyL; k!=0; p=k, k=k->next) {
- if (k->tcb.frame==frame) {
- if (!p) {
- track->keyL=track->keyL->next;
- }
- else {
- p->next=k->next;
- }
- lib3ds_quat_key_free(k);
- break;
- }
- }
-}
-
-
-/*!
- * \ingroup tracks
- */
-void
-lib3ds_quat_track_eval(Lib3dsQuatTrack *track, Lib3dsQuat q, Lib3dsFloat t)
-{
- Lib3dsQuatKey *k;
- Lib3dsFloat nt;
- Lib3dsFloat u;
-
- if (!track->keyL) {
- lib3ds_quat_identity(q);
- return;
- }
- if (!track->keyL->next || ((t<track->keyL->tcb.frame) && ((track->flags&LIB3DS_REPEAT) != 0))) {
- lib3ds_quat_copy(q, track->keyL->q);
- return;
- }
-
- for (k=track->keyL; k->next!=0; k=k->next) {
- if ((t>=k->tcb.frame) && (t<k->next->tcb.frame)) {
- break;
- }
- }
- if (!k->next) {
- if (track->flags&LIB3DS_REPEAT) {
- nt=(Lib3dsFloat)fmod(t - track->keyL->tcb.frame, k->tcb.frame - track->keyL->tcb.frame) + track->keyL->tcb.frame;
- for (k=track->keyL; k->next!=0; k=k->next) {
- if ((nt>=k->tcb.frame) && (nt<k->next->tcb.frame)) {
- break;
- }
- }
- ASSERT(k->next);
- }
- else {
- lib3ds_quat_copy(q, k->q);
- return;
- }
- }
- else {
- nt=t;
- }
- u=nt - k->tcb.frame;
- u/=(k->next->tcb.frame - k->tcb.frame);
-
- lib3ds_quat_squad(
- q,
- k->q,
- k->dd,
- k->next->ds,
- k->next->q,
- u
- );
-}
-
-
-/*!
- * \ingroup tracks
- */
-Lib3dsBool
-lib3ds_quat_track_read(Lib3dsQuatTrack *track, Lib3dsIo *io)
-{
- int keys;
- int i,j;
- Lib3dsQuatKey *p,*k;
-
- track->flags=lib3ds_io_read_word(io);
- lib3ds_io_read_dword(io);
- lib3ds_io_read_dword(io);
- keys=lib3ds_io_read_intd(io);
-
- for (p=0,i=0; i<keys; p=k,++i) {
- k=lib3ds_quat_key_new();
- if (!lib3ds_tcb_read(&k->tcb, io)) {
- return(LIB3DS_FALSE);
- }
- k->angle=lib3ds_io_read_float(io);
- for (j=0; j<3; ++j) {
- k->axis[j]=lib3ds_io_read_float(io);
- }
- lib3ds_quat_track_insert(track, k);
- }
- lib3ds_quat_track_setup(track);
- return(LIB3DS_TRUE);
-}
-
-
-/*!
- * \ingroup tracks
- */
-Lib3dsBool
-lib3ds_quat_track_write(Lib3dsQuatTrack *track, Lib3dsIo *io)
-{
- Lib3dsQuatKey *k;
- Lib3dsDword num=0;
- for (k=track->keyL; k; k=k->next) {
- ++num;
- }
- lib3ds_io_write_word(io, (Lib3dsWord)track->flags);
- lib3ds_io_write_dword(io, 0);
- lib3ds_io_write_dword(io, 0);
- lib3ds_io_write_dword(io, num);
-
- for (k=track->keyL; k; k=k->next) {
- if (!lib3ds_tcb_write(&k->tcb,io)) {
- return(LIB3DS_FALSE);
- }
- lib3ds_io_write_float(io, k->angle);
- lib3ds_io_write_vector(io, k->axis);
- }
- return(LIB3DS_TRUE);
-}
-
-
-/*!
- * \ingroup tracks
- */
-Lib3dsMorphKey*
-lib3ds_morph_key_new()
-{
- Lib3dsMorphKey* k;
- k=(Lib3dsMorphKey*)calloc(sizeof(Lib3dsMorphKey), 1);
- return(k);
-}
-
-
-/*!
- * \ingroup tracks
- */
-void
-lib3ds_morph_key_free(Lib3dsMorphKey *key)
-{
- ASSERT(key);
- free(key);
-}
-
-
-/*!
- * \ingroup tracks
- */
-void
-lib3ds_morph_track_free_keys(Lib3dsMorphTrack *track)
-{
- Lib3dsMorphKey *p,*q;
-
- ASSERT(track);
- for (p=track->keyL; p; p=q) {
- q=p->next;
- lib3ds_morph_key_free(p);
- }
-}
-
-
-/*!
- * \ingroup tracks
- */
-void
-lib3ds_morph_track_insert(Lib3dsMorphTrack *track, Lib3dsMorphKey *key)
-{
- ASSERT(track);
- ASSERT(key);
- ASSERT(!key->next);
-
- if (!track->keyL) {
- track->keyL=key;
- key->next=0;
- }
- else {
- Lib3dsMorphKey *k,*p;
-
- for (p=0,k=track->keyL; k!=0; p=k, k=k->next) {
- if (k->tcb.frame>key->tcb.frame) {
- break;
- }
- }
- if (!p) {
- key->next=track->keyL;
- track->keyL=key;
- }
- else {
- key->next=k;
- p->next=key;
- }
-
- if (k && (key->tcb.frame==k->tcb.frame)) {
- key->next=k->next;
- lib3ds_morph_key_free(k);
- }
- }
-}
-
-
-/*!
- * \ingroup tracks
- */
-void
-lib3ds_morph_track_remove(Lib3dsMorphTrack *track, Lib3dsIntd frame)
-{
- Lib3dsMorphKey *k,*p;
-
- ASSERT(track);
- if (!track->keyL) {
- return;
- }
- for (p=0,k=track->keyL; k!=0; p=k, k=k->next) {
- if (k->tcb.frame==frame) {
- if (!p) {
- track->keyL=track->keyL->next;
- }
- else {
- p->next=k->next;
- }
- lib3ds_morph_key_free(k);
- break;
- }
- }
-}
-
-
-/*!
- * \ingroup tracks
- */
-void
-lib3ds_morph_track_eval(Lib3dsMorphTrack *track, char *p, Lib3dsFloat t)
-{
- Lib3dsMorphKey *k;
- char* result;
-
- ASSERT(p);
- if (!track->keyL) {
- strcpy(p,"");
- return;
- }
- if (!track->keyL->next) {
- strcpy(p,track->keyL->name);
- return;
- }
-
-
- /* TODO: this function finds the mesh frame that corresponds to this
- * timeframe. It would be better to actually interpolate the mesh.
- */
-
- result=0;
-
- for (k = track->keyL;
- k->next != NULL && t >= k->next->tcb.frame;
- k = k->next);
-
- result=k->name;
-
- if (result) {
- strcpy(p,result);
- }
- else {
- strcpy(p,"");
- }
-}
-
-
-/*!
- * \ingroup tracks
- */
-Lib3dsBool
-lib3ds_morph_track_read(Lib3dsMorphTrack *track, Lib3dsIo *io)
-{
- /* This function was written by Stephane Denis on 5-18-04 */
- int i;
- Lib3dsMorphKey *k, *pk = 0;
- int keys;
- track->flags=lib3ds_io_read_word(io);
- lib3ds_io_read_dword(io);
- lib3ds_io_read_dword(io);
- keys=lib3ds_io_read_intd(io);
-
- for (i=0; i<keys; ++i) {
- k=lib3ds_morph_key_new();
- if (!lib3ds_tcb_read(&k->tcb, io)) {
- return(LIB3DS_FALSE);
- }
- if (!lib3ds_io_read_string(io, k->name, 11)) {
- return(LIB3DS_FALSE);
- }
- if (!track->keyL)
- track->keyL = k;
- else
- pk->next = k;
- pk = k;
- }
- return(LIB3DS_TRUE);
-}
-
-
-/*!
- * \ingroup tracks
- */
-Lib3dsBool
-lib3ds_morph_track_write(Lib3dsMorphTrack *track, Lib3dsIo *io)
-{
- /* FIXME: */
- ASSERT(0);
- LIB3DS_UNUSED(track);
- LIB3DS_UNUSED(io);
- return(LIB3DS_FALSE);
-}
-
-
-
-void
-tcb_dump(Lib3dsTcb *tcb)
-{
- printf(" tcb: frame=%d, flags=%04x, tens=%g, cont=%g, ",
- tcb->frame, tcb->flags, tcb->tens, tcb->cont);
- printf("bias=%g, ease_to=%g, ease_from=%g\n",
- tcb->bias, tcb->ease_to, tcb->ease_from);
-}
-
-
-void
-lib3ds_boolTrack_dump(Lib3dsBoolTrack *track)
-{
- Lib3dsBoolKey *key;
- printf("flags: %08x, keys:\n", track->flags);
- for ( key = track->keyL; key != NULL; key = key->next)
- {
- tcb_dump(&key->tcb);
- }
-}
-
-
-void
-lib3ds_lin1Track_dump(Lib3dsLin1Track *track)
-{
- Lib3dsLin1Key *key;
- printf("flags: %08x, keys:\n", track->flags);
- for ( key = track->keyL; key != NULL; key = key->next)
- {
- tcb_dump(&key->tcb);
- printf(" value = %g, dd=%g, ds=%g\n",
- key->value, key->dd, key->ds);
- }
-}
-
-
-void
-lib3ds_lin3Track_dump(Lib3dsLin3Track *track)
-{
- Lib3dsLin3Key *key;
- printf("flags: %08x, keys:\n", track->flags);
- for ( key = track->keyL; key != NULL; key = key->next)
- {
- tcb_dump(&key->tcb);
- printf(" value = %g,%g,%g, dd=%g,%g,%g, ds=%g,%g,%g\n",
- key->value[0], key->value[1], key->value[2],
- key->dd[0], key->dd[1], key->dd[2],
- key->ds[0], key->ds[1], key->ds[2]);
- }
-}
-
-
-void
-lib3ds_quatTrack_dump(Lib3dsQuatTrack *track)
-{
- Lib3dsQuatKey *key;
- printf("flags: %08x, keys:\n", track->flags);
- for ( key = track->keyL; key != NULL; key = key->next)
- {
- tcb_dump(&key->tcb);
- printf(" axis = %g,%g,%g, angle=%g, q=%g,%g,%g,%g\n",
- key->axis[0], key->axis[1], key->axis[2], key->angle,
- key->q[0], key->q[1], key->q[2], key->q[3]);
- printf(" dd = %g,%g,%g,%g, ds=%g,%g,%g,%g\n",
- key->dd[0], key->dd[1], key->dd[2], key->dd[3],
- key->ds[0], key->ds[1], key->ds[2], key->ds[3]);
- }
-}
-
-
-void
-lib3ds_morphTrack_dump(Lib3dsMorphTrack *track)
-{
- Lib3dsMorphKey *key;
- printf("flags: %08x, keys:\n", track->flags);
- for ( key = track->keyL; key != NULL; key = key->next)
- {
- tcb_dump(&key->tcb);
- printf(" name = %s\n", key->name);
- }
-}
-
-
-
-void
-lib3ds_dump_tracks(Lib3dsNode *node)
-{
- switch( node->type ) {
- case LIB3DS_AMBIENT_NODE:
- printf("ambient: ");
- lib3ds_lin3Track_dump(&node->data.ambient.col_track);
- break;
- case LIB3DS_OBJECT_NODE:
- printf("pos: ");
- lib3ds_lin3Track_dump(&node->data.object.pos_track);
- printf("rot: ");
- lib3ds_quatTrack_dump(&node->data.object.rot_track);
- printf("scl: ");
- lib3ds_lin3Track_dump(&node->data.object.scl_track);
- printf("morph: ");
- lib3ds_morphTrack_dump(&node->data.object.morph_track);
- printf("hide: ");
- lib3ds_boolTrack_dump(&node->data.object.hide_track);
- break;
- case LIB3DS_CAMERA_NODE:
- printf("pos: ");
- lib3ds_lin3Track_dump(&node->data.camera.pos_track);
- printf("fov: ");
- lib3ds_lin1Track_dump(&node->data.camera.fov_track);
- printf("roll: ");
- lib3ds_lin1Track_dump(&node->data.camera.roll_track);
- break;
- case LIB3DS_TARGET_NODE:
- printf("pos: ");
- lib3ds_lin3Track_dump(&node->data.target.pos_track);
- break;
- case LIB3DS_LIGHT_NODE:
- printf("pos: ");
- lib3ds_lin3Track_dump(&node->data.light.pos_track);
- printf("col: ");
- lib3ds_lin3Track_dump(&node->data.light.col_track);
- printf("hotspot: ");
- lib3ds_lin1Track_dump(&node->data.light.hotspot_track);
- printf("falloff: ");
- lib3ds_lin1Track_dump(&node->data.light.falloff_track);
- printf("roll: ");
- lib3ds_lin1Track_dump(&node->data.light.roll_track);
- break;
- case LIB3DS_SPOT_NODE:
- printf("pos: ");
- lib3ds_lin3Track_dump(&node->data.spot.pos_track);
- break;
- default:
- break;
- }
-}
diff --git a/3rdparty/lib3ds/tracks.h b/3rdparty/lib3ds/tracks.h
deleted file mode 100644
index 7783e51c..00000000
--- a/3rdparty/lib3ds/tracks.h
+++ /dev/null
@@ -1,209 +0,0 @@
-/* -*- c -*- */
-#ifndef INCLUDED_LIB3DS_TRACKS_H
-#define INCLUDED_LIB3DS_TRACKS_H
-/*
- * The 3D Studio File Format Library
- * Copyright (C) 1996-2007 by Jan Eric Kyprianidis <www.kyprianidis.com>
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id: tracks.h,v 1.11 2007/06/20 17:04:09 jeh Exp $
- */
-
-#ifndef INCLUDED_LIB3DS_TCB_H
-#include <lib3ds/tcb.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * Track flags
- * \ingroup tracks
- */
-typedef enum {
- LIB3DS_REPEAT =0x0001,
- LIB3DS_SMOOTH =0x0002,
- LIB3DS_LOCK_X =0x0008,
- LIB3DS_LOCK_Y =0x0010,
- LIB3DS_LOCK_Z =0x0020,
- LIB3DS_UNLINK_X =0x0100,
- LIB3DS_UNLINK_Y =0x0200,
- LIB3DS_UNLINK_Z =0x0400
-} Lib3dsTrackFlags;
-
-/**
- * Boolean track key
- * \ingroup tracks
- */
-struct Lib3dsBoolKey {
- Lib3dsTcb tcb;
- Lib3dsBoolKey *next;
-};
-
-/**
- * Boolean track
- * \ingroup tracks
- */
-struct Lib3dsBoolTrack {
- Lib3dsDword flags;
- Lib3dsBoolKey *keyL;
-};
-
-/**
- * Floating-point track key
- * \ingroup tracks
- */
-struct Lib3dsLin1Key {
- Lib3dsTcb tcb;
- Lib3dsLin1Key *next;
- Lib3dsFloat value;
- Lib3dsFloat dd;
- Lib3dsFloat ds;
-};
-
-/**
- * Floating-point track
- * \ingroup tracks
- */
-struct Lib3dsLin1Track {
- Lib3dsDword flags;
- Lib3dsLin1Key *keyL;
-};
-
-/**
- * Vector track key
- * \ingroup tracks
- */
-struct Lib3dsLin3Key {
- Lib3dsTcb tcb;
- Lib3dsLin3Key *next;
- Lib3dsVector value;
- Lib3dsVector dd;
- Lib3dsVector ds;
-};
-
-/**
- * Vector track
- * \ingroup tracks
- */
-struct Lib3dsLin3Track {
- Lib3dsDword flags;
- Lib3dsLin3Key *keyL;
-};
-
-/**
- * Rotation track key
- * \ingroup tracks
- */
-struct Lib3dsQuatKey {
- Lib3dsTcb tcb;
- Lib3dsQuatKey *next;
- Lib3dsVector axis;
- Lib3dsFloat angle;
- Lib3dsQuat q;
- Lib3dsQuat dd;
- Lib3dsQuat ds;
-};
-
-/**
- * Rotation track
- * \ingroup tracks
- */
-struct Lib3dsQuatTrack {
- Lib3dsDword flags;
- Lib3dsQuatKey *keyL;
-};
-
-/**
- * Morph track key
- * \ingroup tracks
- */
-struct Lib3dsMorphKey {
- Lib3dsTcb tcb;
- Lib3dsMorphKey *next;
- char name[64];
-};
-
-/**
- * Morph track
- * \ingroup tracks
- */
-struct Lib3dsMorphTrack {
- Lib3dsDword flags;
- Lib3dsMorphKey *keyL;
-};
-
-extern LIB3DSAPI Lib3dsBoolKey* lib3ds_bool_key_new();
-extern LIB3DSAPI void lib3ds_bool_key_free(Lib3dsBoolKey* key);
-extern LIB3DSAPI void lib3ds_bool_track_free_keys(Lib3dsBoolTrack *track);
-extern LIB3DSAPI void lib3ds_bool_track_insert(Lib3dsBoolTrack *track, Lib3dsBoolKey* key);
-extern LIB3DSAPI void lib3ds_bool_track_remove(Lib3dsBoolTrack *track, Lib3dsIntd frame);
-extern LIB3DSAPI void lib3ds_bool_track_eval(Lib3dsBoolTrack *track, Lib3dsBool *p, Lib3dsFloat t);
-extern LIB3DSAPI Lib3dsBool lib3ds_bool_track_read(Lib3dsBoolTrack *track, Lib3dsIo *io);
-extern LIB3DSAPI Lib3dsBool lib3ds_bool_track_write(Lib3dsBoolTrack *track, Lib3dsIo *io);
-
-extern LIB3DSAPI Lib3dsLin1Key* lib3ds_lin1_key_new();
-extern LIB3DSAPI void lib3ds_lin1_key_free(Lib3dsLin1Key* key);
-extern LIB3DSAPI void lib3ds_lin1_track_free_keys(Lib3dsLin1Track *track);
-extern LIB3DSAPI void lib3ds_lin1_key_setup(Lib3dsLin1Key *p, Lib3dsLin1Key *cp, Lib3dsLin1Key *c,
- Lib3dsLin1Key *cn, Lib3dsLin1Key *n);
-extern LIB3DSAPI void lib3ds_lin1_track_setup(Lib3dsLin1Track *track);
-extern LIB3DSAPI void lib3ds_lin1_track_insert(Lib3dsLin1Track *track, Lib3dsLin1Key *key);
-extern LIB3DSAPI void lib3ds_lin1_track_remove(Lib3dsLin1Track *track, Lib3dsIntd frame);
-extern LIB3DSAPI void lib3ds_lin1_track_eval(Lib3dsLin1Track *track, Lib3dsFloat *p, Lib3dsFloat t);
-extern LIB3DSAPI Lib3dsBool lib3ds_lin1_track_read(Lib3dsLin1Track *track, Lib3dsIo *io);
-extern LIB3DSAPI Lib3dsBool lib3ds_lin1_track_write(Lib3dsLin1Track *track, Lib3dsIo *io);
-
-extern LIB3DSAPI Lib3dsLin3Key* lib3ds_lin3_key_new();
-extern LIB3DSAPI void lib3ds_lin3_key_free(Lib3dsLin3Key* key);
-extern LIB3DSAPI void lib3ds_lin3_track_free_keys(Lib3dsLin3Track *track);
-extern LIB3DSAPI void lib3ds_lin3_key_setup(Lib3dsLin3Key *p, Lib3dsLin3Key *cp, Lib3dsLin3Key *c,
- Lib3dsLin3Key *cn, Lib3dsLin3Key *n);
-extern LIB3DSAPI void lib3ds_lin3_track_setup(Lib3dsLin3Track *track);
-extern LIB3DSAPI void lib3ds_lin3_track_insert(Lib3dsLin3Track *track, Lib3dsLin3Key *key);
-extern LIB3DSAPI void lib3ds_lin3_track_remove(Lib3dsLin3Track *track, Lib3dsIntd frame);
-extern LIB3DSAPI void lib3ds_lin3_track_eval(Lib3dsLin3Track *track, Lib3dsVector p, Lib3dsFloat t);
-extern LIB3DSAPI Lib3dsBool lib3ds_lin3_track_read(Lib3dsLin3Track *track, Lib3dsIo *io);
-extern LIB3DSAPI Lib3dsBool lib3ds_lin3_track_write(Lib3dsLin3Track *track, Lib3dsIo *io);
-
-extern LIB3DSAPI Lib3dsQuatKey* lib3ds_quat_key_new();
-extern LIB3DSAPI void lib3ds_quat_key_free(Lib3dsQuatKey* key);
-extern LIB3DSAPI void lib3ds_quat_track_free_keys(Lib3dsQuatTrack *track);
-extern LIB3DSAPI void lib3ds_quat_key_setup(Lib3dsQuatKey *p, Lib3dsQuatKey *cp, Lib3dsQuatKey *c,
- Lib3dsQuatKey *cn, Lib3dsQuatKey *n);
-extern LIB3DSAPI void lib3ds_quat_track_setup(Lib3dsQuatTrack *track);
-extern LIB3DSAPI void lib3ds_quat_track_insert(Lib3dsQuatTrack *track, Lib3dsQuatKey *key);
-extern LIB3DSAPI void lib3ds_quat_track_remove(Lib3dsQuatTrack *track, Lib3dsIntd frame);
-extern LIB3DSAPI void lib3ds_quat_track_eval(Lib3dsQuatTrack *track, Lib3dsQuat p, Lib3dsFloat t);
-extern LIB3DSAPI Lib3dsBool lib3ds_quat_track_read(Lib3dsQuatTrack *track, Lib3dsIo *io);
-extern LIB3DSAPI Lib3dsBool lib3ds_quat_track_write(Lib3dsQuatTrack *track, Lib3dsIo *io);
-
-extern LIB3DSAPI Lib3dsMorphKey* lib3ds_morph_key_new();
-extern LIB3DSAPI void lib3ds_morph_key_free(Lib3dsMorphKey* key);
-extern LIB3DSAPI void lib3ds_morph_track_free_keys(Lib3dsMorphTrack *track);
-extern LIB3DSAPI void lib3ds_morph_track_insert(Lib3dsMorphTrack *track, Lib3dsMorphKey *key);
-extern LIB3DSAPI void lib3ds_morph_track_remove(Lib3dsMorphTrack *track, Lib3dsIntd frame);
-extern LIB3DSAPI void lib3ds_morph_track_eval(Lib3dsMorphTrack *track, char *p, Lib3dsFloat t);
-extern LIB3DSAPI Lib3dsBool lib3ds_morph_track_read(Lib3dsMorphTrack *track, Lib3dsIo *io);
-extern LIB3DSAPI Lib3dsBool lib3ds_morph_track_write(Lib3dsMorphTrack *track, Lib3dsIo *io);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
-
diff --git a/3rdparty/lib3ds/types.h b/3rdparty/lib3ds/types.h
deleted file mode 100644
index 77fe00c7..00000000
--- a/3rdparty/lib3ds/types.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/* -*- c -*- */
-#ifndef INCLUDED_LIB3DS_TYPES_H
-#define INCLUDED_LIB3DS_TYPES_H
-/*
- * The 3D Studio File Format Library
- * Copyright (C) 1996-2007 by Jan Eric Kyprianidis <www.kyprianidis.com>
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id: types.h,v 1.25 2007/06/21 08:36:41 jeh Exp $
- */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*!
-#ifdef _MSC_VER
-#ifdef LIB3DS_EXPORTS
-#define LIB3DSAPI __declspec(dllexport)
-#else
-#define LIB3DSAPI __declspec(dllimport)
-#endif
-#else
-#define LIB3DSAPI
-#endif
-*/
-#define LIB3DSAPI
-#define LIB3DS_UNUSED(x) (void)x
-
-#define LIB3DS_TRUE 1
-#define LIB3DS_FALSE 0
-
-#ifdef _MSC_VER
-typedef __int32 Lib3dsBool;
-typedef unsigned __int8 Lib3dsByte;
-typedef unsigned __int16 Lib3dsWord;
-typedef unsigned __int32 Lib3dsDword;
-typedef signed __int8 Lib3dsIntb;
-typedef signed __int16 Lib3dsIntw;
-typedef signed __int16 Lib3dsIntd;
-#else
-#include <stdint.h>
-typedef int32_t Lib3dsBool;
-typedef uint8_t Lib3dsByte;
-typedef uint16_t Lib3dsWord;
-typedef uint32_t Lib3dsDword;
-typedef int8_t Lib3dsIntb;
-typedef int16_t Lib3dsIntw;
-typedef int32_t Lib3dsIntd;
-#endif
-
-typedef float Lib3dsFloat;
-typedef double Lib3dsDouble;
-
-typedef float Lib3dsVector[3];
-typedef float Lib3dsTexel[2];
-typedef float Lib3dsQuat[4];
-typedef float Lib3dsMatrix[4][4];
-typedef float Lib3dsRgb[3];
-typedef float Lib3dsRgba[4];
-
-#define LIB3DS_EPSILON (1e-8)
-#define LIB3DS_PI 3.14159265358979323846
-#define LIB3DS_TWOPI (2.0*LIB3DS_PI)
-#define LIB3DS_HALFPI (LIB3DS_PI/2.0)
-#define LIB3DS_RAD_TO_DEG(x) ((180.0/LIB3DS_PI)*(x))
-#define LIB3DS_DEG_TO_RAD(x) ((LIB3DS_PI/180.0)*(x))
-
-#include <stdio.h>
-
-#ifdef _DEBUG
- #ifndef ASSERT
- #include <assert.h>
- #define ASSERT(__expr) assert(__expr)
- #endif
- #define LIB3DS_ERROR_LOG \
- {printf("\t***LIB3DS_ERROR_LOG*** %s : %d\n", __FILE__, __LINE__);}
-#else
- #ifndef ASSERT
- #define ASSERT(__expr)
- #endif
- #define LIB3DS_ERROR_LOG
-#endif
-
-typedef struct Lib3dsIo Lib3dsIo;
-typedef struct Lib3dsFile Lib3dsFile;
-typedef struct Lib3dsBackground Lib3dsBackground;
-typedef struct Lib3dsAtmosphere Lib3dsAtmosphere;
-typedef struct Lib3dsShadow Lib3dsShadow;
-typedef struct Lib3dsViewport Lib3dsViewport;
-typedef struct Lib3dsMaterial Lib3dsMaterial;
-typedef struct Lib3dsFace Lib3dsFace;
-typedef struct Lib3dsBoxMap Lib3dsBoxMap;
-typedef struct Lib3dsMapData Lib3dsMapData;
-typedef struct Lib3dsMesh Lib3dsMesh;
-typedef struct Lib3dsCamera Lib3dsCamera;
-typedef struct Lib3dsLight Lib3dsLight;
-typedef struct Lib3dsBoolKey Lib3dsBoolKey;
-typedef struct Lib3dsBoolTrack Lib3dsBoolTrack;
-typedef struct Lib3dsLin1Key Lib3dsLin1Key;
-typedef struct Lib3dsLin1Track Lib3dsLin1Track;
-typedef struct Lib3dsLin3Key Lib3dsLin3Key;
-typedef struct Lib3dsLin3Track Lib3dsLin3Track;
-typedef struct Lib3dsQuatKey Lib3dsQuatKey;
-typedef struct Lib3dsQuatTrack Lib3dsQuatTrack;
-typedef struct Lib3dsMorphKey Lib3dsMorphKey;
-typedef struct Lib3dsMorphTrack Lib3dsMorphTrack;
-
-typedef enum Lib3dsNodeTypes {
- LIB3DS_UNKNOWN_NODE =0,
- LIB3DS_AMBIENT_NODE =1,
- LIB3DS_OBJECT_NODE =2,
- LIB3DS_CAMERA_NODE =3,
- LIB3DS_TARGET_NODE =4,
- LIB3DS_LIGHT_NODE =5,
- LIB3DS_SPOT_NODE =6
-} Lib3dsNodeTypes;
-
-typedef struct Lib3dsNode Lib3dsNode;
-
-typedef enum Lib3dsObjectFlags {
- LIB3DS_OBJECT_HIDDEN =0x01,
- LIB3DS_OBJECT_VIS_LOFTER =0x02,
- LIB3DS_OBJECT_DOESNT_CAST =0x04,
- LIB3DS_OBJECT_MATTE =0x08,
- LIB3DS_OBJECT_DONT_RCVSHADOW =0x10,
- LIB3DS_OBJECT_FAST =0x20,
- LIB3DS_OBJECT_FROZEN =0x40
-} Lib3dsObjectFlags;
-
-typedef union Lib3dsUserData {
- void *p;
- Lib3dsIntd i;
- Lib3dsDword d;
- Lib3dsFloat f;
- Lib3dsMaterial *material;
- Lib3dsMesh *mesh;
- Lib3dsCamera *camera;
- Lib3dsLight *light;
- Lib3dsNode *node;
-} Lib3dsUserData;
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/3rdparty/lib3ds/types.txt b/3rdparty/lib3ds/types.txt
deleted file mode 100644
index 08d65441..00000000
--- a/3rdparty/lib3ds/types.txt
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * The 3D Studio File Format Library
- * Copyright (C) 1996-2007 by Jan Eric Kyprianidis <www.kyprianidis.com>
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id: types.txt,v 1.3 2007/06/20 17:04:09 jeh Exp $
- */
-/*!
-
-\defgroup types General Types
-
-*/
-/*!
-
-\typedef Lib3dsBool
- \ingroup types
- Bool Typedef
-
-*/
-/*!
-
-\typedef Lib3dsByte
- \ingroup types
- Byte (== 8bit unsigned int) Typedef
-
-*/
-/*!
-
-\typedef Lib3dsWord
- \ingroup types
- Word (== 16bit unsigned int) Typedef
-
-*/
-/*!
-
-\typedef Lib3dsDword
- \ingroup types
- Double-Word (== 32bit unsigned int) Typedef
-
-*/
-/*!
-
-\typedef Lib3dsIntb
- \ingroup types
- Signed Byte (== 8bit signed int) Typedef
-
-*/
-/*!
-
-\typedef Lib3dsIntw
- \ingroup types
- Signed Word (== 16bit signed int) Typedef
-
-*/
-/*!
-
-\typedef Lib3dsIntd
- \ingroup types
- Signed Double-Word (== 32bit signed int) Typedef
-
-*/
-/*!
-
-\typedef Lib3dsRgb
- \ingroup types
- Red, Green, Blue color Typedef
-
-*/
-/*!
-
-\typedef Lib3dsRgba
- \ingroup types
- Red, Green, Blue, Alpha color Typedef
-
-*/
-/*!
-
-\typedef Lib3dsTexel
- \ingroup types
- UV texture coordinates
-
-*/
diff --git a/3rdparty/lib3ds/vector.c b/3rdparty/lib3ds/vector.c
deleted file mode 100644
index 46f48f20..00000000
--- a/3rdparty/lib3ds/vector.c
+++ /dev/null
@@ -1,376 +0,0 @@
-/*
- * The 3D Studio File Format Library
- * Copyright (C) 1996-2007 by Jan Eric Kyprianidis <www.kyprianidis.com>
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id: vector.c,v 1.12 2007/06/20 17:04:09 jeh Exp $
- */
-#include <lib3ds/vector.h>
-#include <math.h>
-
-
-/*!
- * \defgroup vector Vector Mathematics
- */
-
-
-/*!
- * \typedef Lib3dsVector
- * \ingroup vector
- */
-
-
-/*!
- * Clear a vector to zero.
- *
- * \param c Vector to clear.
- *
- * \ingroup vector
- */
-void
-lib3ds_vector_zero(Lib3dsVector c)
-{
- int i;
- for (i=0; i<3; ++i) {
- c[i]=0.0f;
- }
-}
-
-
-/*!
- * Copy a vector.
- *
- * \param dest Destination vector.
- * \param src Source vector.
- *
- * \ingroup vector
- */
-void
-lib3ds_vector_copy(Lib3dsVector dest, Lib3dsVector src)
-{
- int i;
- for (i=0; i<3; ++i) {
- dest[i]=src[i];
- }
-}
-
-
-/*!
- * Negate a vector.
- *
- * \param c Vector to negate.
- *
- * \ingroup vector
- */
-void
-lib3ds_vector_neg(Lib3dsVector c)
-{
- int i;
- for (i=0; i<3; ++i) {
- c[i]=-c[i];
- }
-}
-
-
-/*!
- * Add two vectors.
- *
- * \param c Result.
- * \param a First addend.
- * \param b Second addend.
- *
- * \ingroup vector
- */
-void
-lib3ds_vector_add(Lib3dsVector c, Lib3dsVector a, Lib3dsVector b)
-{
- int i;
- for (i=0; i<3; ++i) {
- c[i]=a[i]+b[i];
- }
-}
-
-
-/*!
- * Subtract two vectors.
- *
- * \param c Result.
- * \param a Addend.
- * \param b Minuend.
- *
- * \ingroup vector
- */
-void
-lib3ds_vector_sub(Lib3dsVector c, Lib3dsVector a, Lib3dsVector b)
-{
- int i;
- for (i=0; i<3; ++i) {
- c[i]=a[i]-b[i];
- }
-}
-
-
-/*!
- * Multiply a vector by a scalar.
- *
- * \param c Vector to be multiplied.
- * \param k Scalar.
- *
- * \ingroup vector
- */
-void
-lib3ds_vector_scalar(Lib3dsVector c, Lib3dsFloat k)
-{
- int i;
- for (i=0; i<3; ++i) {
- c[i]*=k;
- }
-}
-
-
-/*!
- * Compute cross product.
- *
- * \param c Result.
- * \param a First vector.
- * \param b Second vector.
- *
- * \ingroup vector
- */
-void
-lib3ds_vector_cross(Lib3dsVector c, Lib3dsVector a, Lib3dsVector b)
-{
- c[0]=a[1]*b[2] - a[2]*b[1];
- c[1]=a[2]*b[0] - a[0]*b[2];
- c[2]=a[0]*b[1] - a[1]*b[0];
-}
-
-
-/*!
- * Compute dot product.
- *
- * \param a First vector.
- * \param b Second vector.
- *
- * \return Dot product.
- *
- * \ingroup vector
- */
-Lib3dsFloat
-lib3ds_vector_dot(Lib3dsVector a, Lib3dsVector b)
-{
- return(a[0]*b[0] + a[1]*b[1] + a[2]*b[2]);
-}
-
-
-/*!
- * Compute square of vector.
- *
- * Computes x*x + y*y + z*z.
- *
- * \param c Vector to square.
- *
- * \return Square of vector.
- *
- * \ingroup vector
- */
-Lib3dsFloat
-lib3ds_vector_squared(Lib3dsVector c)
-{
- return(c[0]*c[0] + c[1]*c[1] + c[2]*c[2]);
-}
-
-
-/*!
- * Compute length of vector.
- *
- * Computes |c| = sqrt(x*x + y*y + z*z)
- *
- * \param c Vector to compute.
- *
- * \return Length of vector.
- *
- * \ingroup vector
- */
-Lib3dsFloat
-lib3ds_vector_length(Lib3dsVector c)
-{
- return((Lib3dsFloat)sqrt(c[0]*c[0] + c[1]*c[1] + c[2]*c[2]));
-}
-
-
-/*!
- * Normalize a vector.
- *
- * Scales a vector so that its length is 1.0.
- *
- * \param c Vector to normalize.
- *
- * \ingroup vector
- */
-void
-lib3ds_vector_normalize(Lib3dsVector c)
-{
- Lib3dsFloat l,m;
-
- l=(Lib3dsFloat)sqrt(c[0]*c[0] + c[1]*c[1] + c[2]*c[2]);
- if (fabs(l)<LIB3DS_EPSILON) {
- if ((c[0]>=c[1]) && (c[0]>=c[2])) {
- c[0]=1.0f;
- c[1]=c[2]=0.0f;
- }
- else
- if (c[1]>=c[2]) {
- c[1]=1.0f;
- c[0]=c[2]=0.0f;
- }
- else {
- c[2]=1.0f;
- c[0]=c[1]=0.0f;
- }
- }
- else {
- m=1.0f/l;
- c[0]*=m;
- c[1]*=m;
- c[2]*=m;
- }
-}
-
-
-/*!
- * Compute a vector normal to two line segments.
- *
- * Computes the normal vector to the lines b-a and b-c.
- *
- * \param n Returned normal vector.
- * \param a Endpoint of first line.
- * \param b Base point of both lines.
- * \param c Endpoint of second line.
- *
- * \ingroup vector
- */
-void
-lib3ds_vector_normal(Lib3dsVector n, Lib3dsVector a, Lib3dsVector b, Lib3dsVector c)
-{
- Lib3dsVector p,q;
-
- lib3ds_vector_sub(p,c,b);
- lib3ds_vector_sub(q,a,b);
- lib3ds_vector_cross(n,p,q);
- lib3ds_vector_normalize(n);
-}
-
-
-/*!
- * Multiply a point by a transformation matrix.
- *
- * Applies the given transformation matrix to the given point. With some
- * transformation matrices, a vector may also be transformed.
- *
- * \param c Result.
- * \param m Transformation matrix.
- * \param a Input point.
- *
- * \ingroup vector
- */
-void
-lib3ds_vector_transform(Lib3dsVector c, Lib3dsMatrix m, Lib3dsVector a)
-{
- c[0]= m[0][0]*a[0] + m[1][0]*a[1] + m[2][0]*a[2] + m[3][0];
- c[1]= m[0][1]*a[0] + m[1][1]*a[1] + m[2][1]*a[2] + m[3][1];
- c[2]= m[0][2]*a[0] + m[1][2]*a[1] + m[2][2]*a[2] + m[3][2];
-}
-
-
-/*!
- * Compute a point on a cubic spline.
- *
- * Computes a point on a parametric Bezier spline.
- *
- * \param c Result.
- * \param a First endpoint of the spline.
- * \param p First tangent vector of the spline.
- * \param q Second tangent vector of the spline.
- * \param b Second endpoint of the spline.
- * \param t Spline parameter [0. 1.]
- *
- * \ingroup vector
- */
-void
-lib3ds_vector_cubic(Lib3dsVector c, Lib3dsVector a, Lib3dsVector p, Lib3dsVector q,
- Lib3dsVector b, Lib3dsFloat t)
-{
- Lib3dsDouble x,y,z,w;
-
- x=2*t*t*t - 3*t*t + 1;
- y=-2*t*t*t + 3*t*t;
- z=t*t*t - 2*t*t + t;
- w=t*t*t - t*t;
- c[0]=(Lib3dsFloat)(x*a[0] + y*b[0] + z*p[0] + w*q[0]);
- c[1]=(Lib3dsFloat)(x*a[1] + y*b[1] + z*p[1] + w*q[1]);
- c[2]=(Lib3dsFloat)(x*a[2] + y*b[2] + z*p[2] + w*q[2]);
-}
-
-
-/*!
- * c[i] = min(c[i], a[i]);
- *
- * Computes minimum values of x,y,z independently.
- *
- * \ingroup vector
- */
-void
-lib3ds_vector_min(Lib3dsVector c, Lib3dsVector a)
-{
- int i;
- for (i=0; i<3; ++i) {
- if (a[i]<c[i]) {
- c[i] = a[i];
- }
- }
-}
-
-
-/*!
- * c[i] = max(c[i], a[i]);
- *
- * Computes maximum values of x,y,z independently.
- *
- * \ingroup vector
- */
-void
-lib3ds_vector_max(Lib3dsVector c, Lib3dsVector a)
-{
- int i;
- for (i=0; i<3; ++i) {
- if (a[i]>c[i]) {
- c[i] = a[i];
- }
- }
-}
-
-
-/*!
- * \ingroup vector
- */
-void
-lib3ds_vector_dump(Lib3dsVector c)
-{
- fprintf(stderr, "%f %f %f\n", c[0], c[1], c[2]);
-}
-
diff --git a/3rdparty/lib3ds/vector.h b/3rdparty/lib3ds/vector.h
deleted file mode 100644
index 00f273b2..00000000
--- a/3rdparty/lib3ds/vector.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* -*- c -*- */
-#ifndef INCLUDED_LIB3DS_VECTOR_H
-#define INCLUDED_LIB3DS_VECTOR_H
-/*
- * The 3D Studio File Format Library
- * Copyright (C) 1996-2007 by Jan Eric Kyprianidis <www.kyprianidis.com>
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id: vector.h,v 1.7 2007/06/14 09:59:10 jeh Exp $
- */
-
-#ifndef INCLUDED_LIB3DS_TYPES_H
-#include <lib3ds/types.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern LIB3DSAPI void lib3ds_vector_zero(Lib3dsVector c);
-extern LIB3DSAPI void lib3ds_vector_copy(Lib3dsVector dest, Lib3dsVector src);
-extern LIB3DSAPI void lib3ds_vector_neg(Lib3dsVector c);
-extern LIB3DSAPI void lib3ds_vector_add(Lib3dsVector c, Lib3dsVector a, Lib3dsVector b);
-extern LIB3DSAPI void lib3ds_vector_sub(Lib3dsVector c, Lib3dsVector a, Lib3dsVector b);
-extern LIB3DSAPI void lib3ds_vector_scalar(Lib3dsVector c, Lib3dsFloat k);
-extern LIB3DSAPI void lib3ds_vector_cross(Lib3dsVector c, Lib3dsVector a, Lib3dsVector b);
-extern LIB3DSAPI Lib3dsFloat lib3ds_vector_dot(Lib3dsVector a, Lib3dsVector b);
-extern LIB3DSAPI Lib3dsFloat lib3ds_vector_squared(Lib3dsVector c);
-extern LIB3DSAPI Lib3dsFloat lib3ds_vector_length(Lib3dsVector c);
-extern LIB3DSAPI void lib3ds_vector_normalize(Lib3dsVector c);
-extern LIB3DSAPI void lib3ds_vector_normal(Lib3dsVector n, Lib3dsVector a,
- Lib3dsVector b, Lib3dsVector c);
-extern LIB3DSAPI void lib3ds_vector_transform(Lib3dsVector c, Lib3dsMatrix m, Lib3dsVector a);
-extern LIB3DSAPI void lib3ds_vector_cubic(Lib3dsVector c, Lib3dsVector a, Lib3dsVector p,
- Lib3dsVector q, Lib3dsVector b, Lib3dsFloat t);
-extern LIB3DSAPI void lib3ds_vector_min(Lib3dsVector c, Lib3dsVector a);
-extern LIB3DSAPI void lib3ds_vector_max(Lib3dsVector c, Lib3dsVector a);
-extern LIB3DSAPI void lib3ds_vector_dump(Lib3dsVector c);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
-
diff --git a/3rdparty/lib3ds/viewport.c b/3rdparty/lib3ds/viewport.c
deleted file mode 100644
index 270caf8f..00000000
--- a/3rdparty/lib3ds/viewport.c
+++ /dev/null
@@ -1,413 +0,0 @@
-/*
- * The 3D Studio File Format Library
- * Copyright (C) 1996-2007 by Jan Eric Kyprianidis <www.kyprianidis.com>
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id: viewport.c,v 1.11 2007/06/20 17:04:09 jeh Exp $
- */
-#include <lib3ds/viewport.h>
-#include <lib3ds/chunk.h>
-#include <lib3ds/io.h>
-#include <stdlib.h>
-#include <string.h>
-
-
-/*!
- * \defgroup viewport Viewport and default view settings
- */
-
-
-/*!
- * \ingroup viewport
- */
-Lib3dsBool
-lib3ds_viewport_read(Lib3dsViewport *viewport, Lib3dsIo *io)
-{
- Lib3dsChunk c;
- Lib3dsWord chunk;
-
- if (!lib3ds_chunk_read_start(&c, 0, io)) {
- return(LIB3DS_FALSE);
- }
-
- switch (c.chunk) {
- case LIB3DS_VIEWPORT_LAYOUT:
- {
- int cur=0;
- viewport->layout.style=lib3ds_io_read_word(io);
- viewport->layout.active=lib3ds_io_read_intw(io);
- lib3ds_io_read_intw(io);
- viewport->layout.swap=lib3ds_io_read_intw(io);
- lib3ds_io_read_intw(io);
- viewport->layout.swap_prior=lib3ds_io_read_intw(io);
- viewport->layout.swap_view=lib3ds_io_read_intw(io);
- lib3ds_chunk_read_tell(&c, io);
- while ((chunk=lib3ds_chunk_read_next(&c, io))!=0) {
- switch (chunk) {
- case LIB3DS_VIEWPORT_SIZE:
- {
- viewport->layout.position[0]=lib3ds_io_read_word(io);
- viewport->layout.position[1]=lib3ds_io_read_word(io);
- viewport->layout.size[0]=lib3ds_io_read_word(io);
- viewport->layout.size[1]=lib3ds_io_read_word(io);
- }
- break;
- case LIB3DS_VIEWPORT_DATA_3:
- {
- lib3ds_viewport_set_views(viewport,cur+1);
- lib3ds_io_read_intw(io);
- viewport->layout.viewL[cur].axis_lock=lib3ds_io_read_word(io);
- viewport->layout.viewL[cur].position[0]=lib3ds_io_read_intw(io);
- viewport->layout.viewL[cur].position[1]=lib3ds_io_read_intw(io);
- viewport->layout.viewL[cur].size[0]=lib3ds_io_read_intw(io);
- viewport->layout.viewL[cur].size[1]=lib3ds_io_read_intw(io);
- viewport->layout.viewL[cur].type=lib3ds_io_read_word(io);
- viewport->layout.viewL[cur].zoom=lib3ds_io_read_float(io);
- lib3ds_io_read_vector(io, viewport->layout.viewL[cur].center);
- viewport->layout.viewL[cur].horiz_angle=lib3ds_io_read_float(io);
- viewport->layout.viewL[cur].vert_angle=lib3ds_io_read_float(io);
- lib3ds_io_read(io, viewport->layout.viewL[cur].camera, 11);
- ++cur;
- }
- break;
- case LIB3DS_VIEWPORT_DATA:
- /* 3DS R2 & R3 chunk
- unsupported */
- break;
- default:
- lib3ds_chunk_unknown(chunk);
- }
- }
- }
- break;
- case LIB3DS_DEFAULT_VIEW:
- {
- memset(&viewport->default_view,0,sizeof(Lib3dsDefaultView));
- while ((chunk=lib3ds_chunk_read_next(&c, io))!=0) {
- switch (chunk) {
- case LIB3DS_VIEW_TOP:
- {
- viewport->default_view.type=LIB3DS_VIEW_TYPE_TOP;
- lib3ds_io_read_vector(io, viewport->default_view.position);
- viewport->default_view.width=lib3ds_io_read_float(io);
- }
- break;
- case LIB3DS_VIEW_BOTTOM:
- {
- viewport->default_view.type=LIB3DS_VIEW_TYPE_BOTTOM;
- lib3ds_io_read_vector(io, viewport->default_view.position);
- viewport->default_view.width=lib3ds_io_read_float(io);
- }
- break;
- case LIB3DS_VIEW_LEFT:
- {
- viewport->default_view.type=LIB3DS_VIEW_TYPE_LEFT;
- lib3ds_io_read_vector(io, viewport->default_view.position);
- viewport->default_view.width=lib3ds_io_read_float(io);
- }
- break;
- case LIB3DS_VIEW_RIGHT:
- {
- viewport->default_view.type=LIB3DS_VIEW_TYPE_RIGHT;
- lib3ds_io_read_vector(io, viewport->default_view.position);
- viewport->default_view.width=lib3ds_io_read_float(io);
- }
- break;
- case LIB3DS_VIEW_FRONT:
- {
- viewport->default_view.type=LIB3DS_VIEW_TYPE_FRONT;
- lib3ds_io_read_vector(io, viewport->default_view.position);
- viewport->default_view.width=lib3ds_io_read_float(io);
- }
- break;
- case LIB3DS_VIEW_BACK:
- {
- viewport->default_view.type=LIB3DS_VIEW_TYPE_BACK;
- lib3ds_io_read_vector(io, viewport->default_view.position);
- viewport->default_view.width=lib3ds_io_read_float(io);
- }
- break;
- case LIB3DS_VIEW_USER:
- {
- viewport->default_view.type=LIB3DS_VIEW_TYPE_USER;
- lib3ds_io_read_vector(io, viewport->default_view.position);
- viewport->default_view.width=lib3ds_io_read_float(io);
- viewport->default_view.horiz_angle=lib3ds_io_read_float(io);
- viewport->default_view.vert_angle=lib3ds_io_read_float(io);
- viewport->default_view.roll_angle=lib3ds_io_read_float(io);
- }
- break;
- case LIB3DS_VIEW_CAMERA:
- {
- viewport->default_view.type=LIB3DS_VIEW_TYPE_CAMERA;
- lib3ds_io_read(io, viewport->default_view.camera, 11);
- }
- break;
- default:
- lib3ds_chunk_unknown(chunk);
- }
- }
- }
- break;
- }
-
- lib3ds_chunk_read_end(&c, io);
- return(LIB3DS_TRUE);
-}
-
-
-/*!
- * \ingroup viewport
- */
-void
-lib3ds_viewport_set_views(Lib3dsViewport *viewport, Lib3dsDword views)
-{
- ASSERT(viewport);
- if (viewport->layout.views) {
- if (views) {
- viewport->layout.views=views;
- viewport->layout.viewL=(Lib3dsView*)realloc(viewport->layout.viewL, sizeof(Lib3dsView)*views);
- }
- else {
- free(viewport->layout.viewL);
- viewport->layout.views=0;
- viewport->layout.viewL=0;
- }
- }
- else {
- if (views) {
- viewport->layout.views=views;
- viewport->layout.viewL=(Lib3dsView*)calloc(sizeof(Lib3dsView),views);
- }
- }
-}
-
-
-/*!
- * \ingroup viewport
- */
-Lib3dsBool
-lib3ds_viewport_write(Lib3dsViewport *viewport, Lib3dsIo *io)
-{
- if (viewport->layout.views) {
- Lib3dsChunk c;
- unsigned i;
-
- c.chunk=LIB3DS_VIEWPORT_LAYOUT;
- if (!lib3ds_chunk_write_start(&c,io)) {
- return(LIB3DS_FALSE);
- }
-
- lib3ds_io_write_word(io, viewport->layout.style);
- lib3ds_io_write_intw(io, viewport->layout.active);
- lib3ds_io_write_intw(io, 0);
- lib3ds_io_write_intw(io, viewport->layout.swap);
- lib3ds_io_write_intw(io, 0);
- lib3ds_io_write_intw(io, viewport->layout.swap_prior);
- lib3ds_io_write_intw(io, viewport->layout.swap_view);
-
- {
- Lib3dsChunk c;
- c.chunk=LIB3DS_VIEWPORT_SIZE;
- c.size=14;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_intw(io, viewport->layout.position[0]);
- lib3ds_io_write_intw(io, viewport->layout.position[1]);
- lib3ds_io_write_intw(io, viewport->layout.size[0]);
- lib3ds_io_write_intw(io, viewport->layout.size[1]);
- }
-
- for (i=0; i<viewport->layout.views; ++i) {
- Lib3dsChunk c;
- c.chunk=LIB3DS_VIEWPORT_DATA_3;
- c.size=55;
- lib3ds_chunk_write(&c,io);
-
- lib3ds_io_write_intw(io, 0);
- lib3ds_io_write_word(io, viewport->layout.viewL[i].axis_lock);
- lib3ds_io_write_intw(io, viewport->layout.viewL[i].position[0]);
- lib3ds_io_write_intw(io, viewport->layout.viewL[i].position[1]);
- lib3ds_io_write_intw(io, viewport->layout.viewL[i].size[0]);
- lib3ds_io_write_intw(io, viewport->layout.viewL[i].size[1]);
- lib3ds_io_write_word(io, viewport->layout.viewL[i].type);
- lib3ds_io_write_float(io, viewport->layout.viewL[i].zoom);
- lib3ds_io_write_vector(io, viewport->layout.viewL[i].center);
- lib3ds_io_write_float(io, viewport->layout.viewL[i].horiz_angle);
- lib3ds_io_write_float(io, viewport->layout.viewL[i].vert_angle);
- lib3ds_io_write(io, viewport->layout.viewL[i].camera,11);
- }
-
- if (!lib3ds_chunk_write_end(&c,io)) {
- return(LIB3DS_FALSE);
- }
- }
-
- if (viewport->default_view.type) {
- Lib3dsChunk c;
-
- c.chunk=LIB3DS_DEFAULT_VIEW;
- if (!lib3ds_chunk_write_start(&c,io)) {
- return(LIB3DS_FALSE);
- }
-
- switch (viewport->default_view.type) {
- case LIB3DS_VIEW_TYPE_TOP:
- {
- Lib3dsChunk c;
- c.chunk=LIB3DS_VIEW_TOP;
- c.size=22;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_vector(io, viewport->default_view.position);
- lib3ds_io_write_float(io, viewport->default_view.width);
- }
- break;
- case LIB3DS_VIEW_TYPE_BOTTOM:
- {
- Lib3dsChunk c;
- c.chunk=LIB3DS_VIEW_BOTTOM;
- c.size=22;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_vector(io, viewport->default_view.position);
- lib3ds_io_write_float(io, viewport->default_view.width);
- }
- break;
- case LIB3DS_VIEW_TYPE_LEFT:
- {
- Lib3dsChunk c;
- c.chunk=LIB3DS_VIEW_LEFT;
- c.size=22;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_vector(io, viewport->default_view.position);
- lib3ds_io_write_float(io, viewport->default_view.width);
- }
- break;
- case LIB3DS_VIEW_TYPE_RIGHT:
- {
- Lib3dsChunk c;
- c.chunk=LIB3DS_VIEW_RIGHT;
- c.size=22;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_vector(io, viewport->default_view.position);
- lib3ds_io_write_float(io, viewport->default_view.width);
- }
- break;
- case LIB3DS_VIEW_TYPE_FRONT:
- {
- Lib3dsChunk c;
- c.chunk=LIB3DS_VIEW_FRONT;
- c.size=22;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_vector(io, viewport->default_view.position);
- lib3ds_io_write_float(io, viewport->default_view.width);
- }
- break;
- case LIB3DS_VIEW_TYPE_BACK:
- {
- Lib3dsChunk c;
- c.chunk=LIB3DS_VIEW_BACK;
- c.size=22;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_vector(io, viewport->default_view.position);
- lib3ds_io_write_float(io, viewport->default_view.width);
- }
- break;
- case LIB3DS_VIEW_TYPE_USER:
- {
- Lib3dsChunk c;
- c.chunk=LIB3DS_VIEW_USER;
- c.size=34;
- lib3ds_chunk_write(&c,io);
- lib3ds_io_write_vector(io, viewport->default_view.position);
- lib3ds_io_write_float(io, viewport->default_view.width);
- lib3ds_io_write_float(io, viewport->default_view.horiz_angle);
- lib3ds_io_write_float(io, viewport->default_view.vert_angle);
- lib3ds_io_write_float(io, viewport->default_view.roll_angle);
- }
- break;
- case LIB3DS_VIEW_TYPE_CAMERA:
- {
- Lib3dsChunk c;
- c.chunk=LIB3DS_VIEW_CAMERA;
- c.size=17;
- lib3ds_chunk_write(&c, io);
- lib3ds_io_write(io, viewport->default_view.camera, 11);
- }
- break;
- }
-
- if (!lib3ds_chunk_write_end(&c, io)) {
- return(LIB3DS_FALSE);
- }
- }
- return(LIB3DS_TRUE);
-}
-
-
-/*!
- * Dump viewport.
- *
- * \param vp The viewport to be dumped.
- *
- * \ingroup node
- */
-void
-lib3ds_viewport_dump(Lib3dsViewport *vp)
-{
- Lib3dsView *view;
- unsigned i;
- ASSERT(vp);
-
- printf(" viewport:\n");
- printf(" layout:\n");
- printf(" style: %d\n", vp->layout.style);
- printf(" active: %d\n", vp->layout.active);
- printf(" swap: %d\n", vp->layout.swap);
- printf(" swap_prior: %d\n", vp->layout.swap_prior);
- printf(" position: %d,%d\n",
- vp->layout.position[0], vp->layout.position[1]);
- printf(" size: %d,%d\n", vp->layout.size[0], vp->layout.size[1]);
- printf(" views: %ld\n", (long)(vp->layout.views));
- if (vp->layout.views > 0 && vp->layout.viewL != NULL) {
- for (i=0, view=vp->layout.viewL; i < vp->layout.views; ++i, ++view) {
- printf(" view %d:\n", i);
- printf(" type: %d\n", view->type);
- printf(" axis_lock: %d\n", view->axis_lock);
- printf(" position: (%d,%d)\n",
- view->position[0], view->position[1]);
- printf(" size: (%d,%d)\n", view->size[0], view->size[1]);
- printf(" zoom: %g\n", view->zoom);
- printf(" center: (%g,%g,%g)\n",
- view->center[0], view->center[1], view->center[2]);
- printf(" horiz_angle: %g\n", view->horiz_angle);
- printf(" vert_angle: %g\n", view->vert_angle);
- printf(" camera: %s\n", view->camera);
- }
- }
-
- printf(" default_view:\n");
- printf(" type: %d\n", vp->default_view.type);
- printf(" position: (%g,%g,%g)\n",
- vp->default_view.position[0],
- vp->default_view.position[1],
- vp->default_view.position[2]);
- printf(" width: %g\n", vp->default_view.width);
- printf(" horiz_angle: %g\n", vp->default_view.horiz_angle);
- printf(" vert_angle: %g\n", vp->default_view.vert_angle);
- printf(" roll_angle: %g\n", vp->default_view.roll_angle);
- printf(" camera: %s\n", vp->default_view.camera);
-}
-
diff --git a/3rdparty/lib3ds/viewport.h b/3rdparty/lib3ds/viewport.h
deleted file mode 100644
index 03faa184..00000000
--- a/3rdparty/lib3ds/viewport.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/* -*- c -*- */
-#ifndef INCLUDED_LIB3DS_VIEWPORT_H
-#define INCLUDED_LIB3DS_VIEWPORT_H
-/*
- * The 3D Studio File Format Library
- * Copyright (C) 1996-2007 by Jan Eric Kyprianidis <www.kyprianidis.com>
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id: viewport.h,v 1.8 2007/06/20 17:04:09 jeh Exp $
- */
-
-#ifndef INCLUDED_LIB3DS_TYPES_H
-#include <lib3ds/types.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * Layout view types
- * \ingroup viewport
- */
-typedef enum Lib3dsViewType {
- LIB3DS_VIEW_TYPE_NOT_USED =0,
- LIB3DS_VIEW_TYPE_TOP =1,
- LIB3DS_VIEW_TYPE_BOTTOM =2,
- LIB3DS_VIEW_TYPE_LEFT =3,
- LIB3DS_VIEW_TYPE_RIGHT =4,
- LIB3DS_VIEW_TYPE_FRONT =5,
- LIB3DS_VIEW_TYPE_BACK =6,
- LIB3DS_VIEW_TYPE_USER =7,
- LIB3DS_VIEW_TYPE_SPOTLIGHT =18,
- LIB3DS_VIEW_TYPE_CAMERA =65535
-} Lib3dsViewType;
-
-/**
- * Layout view settings
- * \ingroup viewport
- */
-typedef struct Lib3dsView {
- Lib3dsWord type;
- Lib3dsWord axis_lock;
- Lib3dsIntw position[2];
- Lib3dsIntw size[2];
- Lib3dsFloat zoom;
- Lib3dsVector center;
- Lib3dsFloat horiz_angle;
- Lib3dsFloat vert_angle;
- char camera[11];
-} Lib3dsView;
-
-/**
- * Layout styles
- * \ingroup viewport
- */
-typedef enum Lib3dsLayoutStyle {
- LIB3DS_LAYOUT_SINGLE =0,
- LIB3DS_LAYOUT_TWO_PANE_VERT_SPLIT =1,
- LIB3DS_LAYOUT_TWO_PANE_HORIZ_SPLIT =2,
- LIB3DS_LAYOUT_FOUR_PANE =3,
- LIB3DS_LAYOUT_THREE_PANE_LEFT_SPLIT =4,
- LIB3DS_LAYOUT_THREE_PANE_BOTTOM_SPLIT =5,
- LIB3DS_LAYOUT_THREE_PANE_RIGHT_SPLIT =6,
- LIB3DS_LAYOUT_THREE_PANE_TOP_SPLIT =7,
- LIB3DS_LAYOUT_THREE_PANE_VERT_SPLIT =8,
- LIB3DS_LAYOUT_THREE_PANE_HORIZ_SPLIT =9,
- LIB3DS_LAYOUT_FOUR_PANE_LEFT_SPLIT =10,
- LIB3DS_LAYOUT_FOUR_PANE_RIGHT_SPLIT =11
-} Lib3dsLayoutStyle;
-
-/**
- * Viewport layout settings
- * \ingroup viewport
- */
-typedef struct Lib3dsLayout {
- Lib3dsWord style;
- Lib3dsIntw active;
- Lib3dsIntw swap;
- Lib3dsIntw swap_prior;
- Lib3dsIntw swap_view;
- Lib3dsWord position[2];
- Lib3dsWord size[2];
- Lib3dsDword views;
- Lib3dsView *viewL;
-} Lib3dsLayout;
-
-/**
- * Default view settings
- * \ingroup viewport
- */
-typedef struct Lib3dsDefaultView {
- Lib3dsWord type;
- Lib3dsVector position;
- Lib3dsFloat width;
- Lib3dsFloat horiz_angle;
- Lib3dsFloat vert_angle;
- Lib3dsFloat roll_angle;
- char camera[64];
-} Lib3dsDefaultView;
-
-/**
- * Viewport and default view settings
- * \ingroup viewport
- */
-struct Lib3dsViewport {
- Lib3dsLayout layout;
- Lib3dsDefaultView default_view;
-};
-
-extern LIB3DSAPI Lib3dsBool lib3ds_viewport_read(Lib3dsViewport *viewport, Lib3dsIo *io);
-extern LIB3DSAPI void lib3ds_viewport_set_views(Lib3dsViewport *viewport, Lib3dsDword views);
-extern LIB3DSAPI Lib3dsBool lib3ds_viewport_write(Lib3dsViewport *viewport, Lib3dsIo *io);
-extern LIB3DSAPI void lib3ds_viewport_dump(Lib3dsViewport *viewport);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
-
-
-
-
diff --git a/LGPL_EXCEPTION.txt b/LGPL_EXCEPTION.txt
deleted file mode 100644
index a54c00e4..00000000
--- a/LGPL_EXCEPTION.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-Nokia Qt LGPL Exception version 1.1
-
-As an additional permission to the GNU Lesser General Public License version
-2.1, the object code form of a "work that uses the Library" may incorporate
-material from a header file that is part of the Library. You may distribute
-such object code under terms of your choice, provided that:
- (i) the header files of the Library have not been modified; and
- (ii) the incorporated material is limited to numerical parameters, data
- structure layouts, accessors, macros, inline functions and
- templates; and
- (iii) you comply with the terms of Section 6 of the GNU Lesser General
- Public License version 2.1.
-
-Moreover, you may apply this exception to a modified version of the Library,
-provided that such modification does not involve copying material from the
-Library into the modified Library's header files unless such material is
-limited to (i) numerical parameters; (ii) data structure layouts;
-(iii) accessors; and (iv) small macros, templates and inline functions of
-five lines or less in length.
-
-Furthermore, you are not required to apply this additional permission to a
-modified version of the Library.
diff --git a/LICENSE.FDL b/LICENSE.FDL
deleted file mode 100644
index 086177c0..00000000
--- a/LICENSE.FDL
+++ /dev/null
@@ -1,450 +0,0 @@
- GNU Free Documentation License
- Version 1.3, 3 November 2008
-
-
- Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
- <http://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-0. PREAMBLE
-
-The purpose of this License is to make a manual, textbook, or other
-functional and useful document "free" in the sense of freedom: to
-assure everyone the effective freedom to copy and redistribute it,
-with or without modifying it, either commercially or noncommercially.
-Secondarily, this License preserves for the author and publisher a way
-to get credit for their work, while not being considered responsible
-for modifications made by others.
-
-This License is a kind of "copyleft", which means that derivative
-works of the document must themselves be free in the same sense. It
-complements the GNU General Public License, which is a copyleft
-license designed for free software.
-
-We have designed this License in order to use it for manuals for free
-software, because free software needs free documentation: a free
-program should come with manuals providing the same freedoms that the
-software does. But this License is not limited to software manuals;
-it can be used for any textual work, regardless of subject matter or
-whether it is published as a printed book. We recommend this License
-principally for works whose purpose is instruction or reference.
-
-
-1. APPLICABILITY AND DEFINITIONS
-
-This License applies to any manual or other work, in any medium, that
-contains a notice placed by the copyright holder saying it can be
-distributed under the terms of this License. Such a notice grants a
-world-wide, royalty-free license, unlimited in duration, to use that
-work under the conditions stated herein. The "Document", below,
-refers to any such manual or work. Any member of the public is a
-licensee, and is addressed as "you". You accept the license if you
-copy, modify or distribute the work in a way requiring permission
-under copyright law.
-
-A "Modified Version" of the Document means any work containing the
-Document or a portion of it, either copied verbatim, or with
-modifications and/or translated into another language.
-
-A "Secondary Section" is a named appendix or a front-matter section of
-the Document that deals exclusively with the relationship of the
-publishers or authors of the Document to the Document's overall
-subject (or to related matters) and contains nothing that could fall
-directly within that overall subject. (Thus, if the Document is in
-part a textbook of mathematics, a Secondary Section may not explain
-any mathematics.) The relationship could be a matter of historical
-connection with the subject or with related matters, or of legal,
-commercial, philosophical, ethical or political position regarding
-them.
-
-The "Invariant Sections" are certain Secondary Sections whose titles
-are designated, as being those of Invariant Sections, in the notice
-that says that the Document is released under this License. If a
-section does not fit the above definition of Secondary then it is not
-allowed to be designated as Invariant. The Document may contain zero
-Invariant Sections. If the Document does not identify any Invariant
-Sections then there are none.
-
-The "Cover Texts" are certain short passages of text that are listed,
-as Front-Cover Texts or Back-Cover Texts, in the notice that says that
-the Document is released under this License. A Front-Cover Text may
-be at most 5 words, and a Back-Cover Text may be at most 25 words.
-
-A "Transparent" copy of the Document means a machine-readable copy,
-represented in a format whose specification is available to the
-general public, that is suitable for revising the document
-straightforwardly with generic text editors or (for images composed of
-pixels) generic paint programs or (for drawings) some widely available
-drawing editor, and that is suitable for input to text formatters or
-for automatic translation to a variety of formats suitable for input
-to text formatters. A copy made in an otherwise Transparent file
-format whose markup, or absence of markup, has been arranged to thwart
-or discourage subsequent modification by readers is not Transparent.
-An image format is not Transparent if used for any substantial amount
-of text. A copy that is not "Transparent" is called "Opaque".
-
-Examples of suitable formats for Transparent copies include plain
-ASCII without markup, Texinfo input format, LaTeX input format, SGML
-or XML using a publicly available DTD, and standard-conforming simple
-HTML, PostScript or PDF designed for human modification. Examples of
-transparent image formats include PNG, XCF and JPG. Opaque formats
-include proprietary formats that can be read and edited only by
-proprietary word processors, SGML or XML for which the DTD and/or
-processing tools are not generally available, and the
-machine-generated HTML, PostScript or PDF produced by some word
-processors for output purposes only.
-
-The "Title Page" means, for a printed book, the title page itself,
-plus such following pages as are needed to hold, legibly, the material
-this License requires to appear in the title page. For works in
-formats which do not have any title page as such, "Title Page" means
-the text near the most prominent appearance of the work's title,
-preceding the beginning of the body of the text.
-
-The "publisher" means any person or entity that distributes copies of
-the Document to the public.
-
-A section "Entitled XYZ" means a named subunit of the Document whose
-title either is precisely XYZ or contains XYZ in parentheses following
-text that translates XYZ in another language. (Here XYZ stands for a
-specific section name mentioned below, such as "Acknowledgements",
-"Dedications", "Endorsements", or "History".) To "Preserve the Title"
-of such a section when you modify the Document means that it remains a
-section "Entitled XYZ" according to this definition.
-
-The Document may include Warranty Disclaimers next to the notice which
-states that this License applies to the Document. These Warranty
-Disclaimers are considered to be included by reference in this
-License, but only as regards disclaiming warranties: any other
-implication that these Warranty Disclaimers may have is void and has
-no effect on the meaning of this License.
-
-2. VERBATIM COPYING
-
-You may copy and distribute the Document in any medium, either
-commercially or noncommercially, provided that this License, the
-copyright notices, and the license notice saying this License applies
-to the Document are reproduced in all copies, and that you add no
-other conditions whatsoever to those of this License. You may not use
-technical measures to obstruct or control the reading or further
-copying of the copies you make or distribute. However, you may accept
-compensation in exchange for copies. If you distribute a large enough
-number of copies you must also follow the conditions in section 3.
-
-You may also lend copies, under the same conditions stated above, and
-you may publicly display copies.
-
-
-3. COPYING IN QUANTITY
-
-If you publish printed copies (or copies in media that commonly have
-printed covers) of the Document, numbering more than 100, and the
-Document's license notice requires Cover Texts, you must enclose the
-copies in covers that carry, clearly and legibly, all these Cover
-Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
-the back cover. Both covers must also clearly and legibly identify
-you as the publisher of these copies. The front cover must present
-the full title with all words of the title equally prominent and
-visible. You may add other material on the covers in addition.
-Copying with changes limited to the covers, as long as they preserve
-the title of the Document and satisfy these conditions, can be treated
-as verbatim copying in other respects.
-
-If the required texts for either cover are too voluminous to fit
-legibly, you should put the first ones listed (as many as fit
-reasonably) on the actual cover, and continue the rest onto adjacent
-pages.
-
-If you publish or distribute Opaque copies of the Document numbering
-more than 100, you must either include a machine-readable Transparent
-copy along with each Opaque copy, or state in or with each Opaque copy
-a computer-network location from which the general network-using
-public has access to download using public-standard network protocols
-a complete Transparent copy of the Document, free of added material.
-If you use the latter option, you must take reasonably prudent steps,
-when you begin distribution of Opaque copies in quantity, to ensure
-that this Transparent copy will remain thus accessible at the stated
-location until at least one year after the last time you distribute an
-Opaque copy (directly or through your agents or retailers) of that
-edition to the public.
-
-It is requested, but not required, that you contact the authors of the
-Document well before redistributing any large number of copies, to
-give them a chance to provide you with an updated version of the
-Document.
-
-
-4. MODIFICATIONS
-
-You may copy and distribute a Modified Version of the Document under
-the conditions of sections 2 and 3 above, provided that you release
-the Modified Version under precisely this License, with the Modified
-Version filling the role of the Document, thus licensing distribution
-and modification of the Modified Version to whoever possesses a copy
-of it. In addition, you must do these things in the Modified Version:
-
-A. Use in the Title Page (and on the covers, if any) a title distinct
- from that of the Document, and from those of previous versions
- (which should, if there were any, be listed in the History section
- of the Document). You may use the same title as a previous version
- if the original publisher of that version gives permission.
-B. List on the Title Page, as authors, one or more persons or entities
- responsible for authorship of the modifications in the Modified
- Version, together with at least five of the principal authors of the
- Document (all of its principal authors, if it has fewer than five),
- unless they release you from this requirement.
-C. State on the Title page the name of the publisher of the
- Modified Version, as the publisher.
-D. Preserve all the copyright notices of the Document.
-E. Add an appropriate copyright notice for your modifications
- adjacent to the other copyright notices.
-F. Include, immediately after the copyright notices, a license notice
- giving the public permission to use the Modified Version under the
- terms of this License, in the form shown in the Addendum below.
-G. Preserve in that license notice the full lists of Invariant Sections
- and required Cover Texts given in the Document's license notice.
-H. Include an unaltered copy of this License.
-I. Preserve the section Entitled "History", Preserve its Title, and add
- to it an item stating at least the title, year, new authors, and
- publisher of the Modified Version as given on the Title Page. If
- there is no section Entitled "History" in the Document, create one
- stating the title, year, authors, and publisher of the Document as
- given on its Title Page, then add an item describing the Modified
- Version as stated in the previous sentence.
-J. Preserve the network location, if any, given in the Document for
- public access to a Transparent copy of the Document, and likewise
- the network locations given in the Document for previous versions
- it was based on. These may be placed in the "History" section.
- You may omit a network location for a work that was published at
- least four years before the Document itself, or if the original
- publisher of the version it refers to gives permission.
-K. For any section Entitled "Acknowledgements" or "Dedications",
- Preserve the Title of the section, and preserve in the section all
- the substance and tone of each of the contributor acknowledgements
- and/or dedications given therein.
-L. Preserve all the Invariant Sections of the Document,
- unaltered in their text and in their titles. Section numbers
- or the equivalent are not considered part of the section titles.
-M. Delete any section Entitled "Endorsements". Such a section
- may not be included in the Modified Version.
-N. Do not retitle any existing section to be Entitled "Endorsements"
- or to conflict in title with any Invariant Section.
-O. Preserve any Warranty Disclaimers.
-
-If the Modified Version includes new front-matter sections or
-appendices that qualify as Secondary Sections and contain no material
-copied from the Document, you may at your option designate some or all
-of these sections as invariant. To do this, add their titles to the
-list of Invariant Sections in the Modified Version's license notice.
-These titles must be distinct from any other section titles.
-
-You may add a section Entitled "Endorsements", provided it contains
-nothing but endorsements of your Modified Version by various
-parties--for example, statements of peer review or that the text has
-been approved by an organization as the authoritative definition of a
-standard.
-
-You may add a passage of up to five words as a Front-Cover Text, and a
-passage of up to 25 words as a Back-Cover Text, to the end of the list
-of Cover Texts in the Modified Version. Only one passage of
-Front-Cover Text and one of Back-Cover Text may be added by (or
-through arrangements made by) any one entity. If the Document already
-includes a cover text for the same cover, previously added by you or
-by arrangement made by the same entity you are acting on behalf of,
-you may not add another; but you may replace the old one, on explicit
-permission from the previous publisher that added the old one.
-
-The author(s) and publisher(s) of the Document do not by this License
-give permission to use their names for publicity for or to assert or
-imply endorsement of any Modified Version.
-
-
-5. COMBINING DOCUMENTS
-
-You may combine the Document with other documents released under this
-License, under the terms defined in section 4 above for modified
-versions, provided that you include in the combination all of the
-Invariant Sections of all of the original documents, unmodified, and
-list them all as Invariant Sections of your combined work in its
-license notice, and that you preserve all their Warranty Disclaimers.
-
-The combined work need only contain one copy of this License, and
-multiple identical Invariant Sections may be replaced with a single
-copy. If there are multiple Invariant Sections with the same name but
-different contents, make the title of each such section unique by
-adding at the end of it, in parentheses, the name of the original
-author or publisher of that section if known, or else a unique number.
-Make the same adjustment to the section titles in the list of
-Invariant Sections in the license notice of the combined work.
-
-In the combination, you must combine any sections Entitled "History"
-in the various original documents, forming one section Entitled
-"History"; likewise combine any sections Entitled "Acknowledgements",
-and any sections Entitled "Dedications". You must delete all sections
-Entitled "Endorsements".
-
-
-6. COLLECTIONS OF DOCUMENTS
-
-You may make a collection consisting of the Document and other
-documents released under this License, and replace the individual
-copies of this License in the various documents with a single copy
-that is included in the collection, provided that you follow the rules
-of this License for verbatim copying of each of the documents in all
-other respects.
-
-You may extract a single document from such a collection, and
-distribute it individually under this License, provided you insert a
-copy of this License into the extracted document, and follow this
-License in all other respects regarding verbatim copying of that
-document.
-
-
-7. AGGREGATION WITH INDEPENDENT WORKS
-
-A compilation of the Document or its derivatives with other separate
-and independent documents or works, in or on a volume of a storage or
-distribution medium, is called an "aggregate" if the copyright
-resulting from the compilation is not used to limit the legal rights
-of the compilation's users beyond what the individual works permit.
-When the Document is included in an aggregate, this License does not
-apply to the other works in the aggregate which are not themselves
-derivative works of the Document.
-
-If the Cover Text requirement of section 3 is applicable to these
-copies of the Document, then if the Document is less than one half of
-the entire aggregate, the Document's Cover Texts may be placed on
-covers that bracket the Document within the aggregate, or the
-electronic equivalent of covers if the Document is in electronic form.
-Otherwise they must appear on printed covers that bracket the whole
-aggregate.
-
-
-8. TRANSLATION
-
-Translation is considered a kind of modification, so you may
-distribute translations of the Document under the terms of section 4.
-Replacing Invariant Sections with translations requires special
-permission from their copyright holders, but you may include
-translations of some or all Invariant Sections in addition to the
-original versions of these Invariant Sections. You may include a
-translation of this License, and all the license notices in the
-Document, and any Warranty Disclaimers, provided that you also include
-the original English version of this License and the original versions
-of those notices and disclaimers. In case of a disagreement between
-the translation and the original version of this License or a notice
-or disclaimer, the original version will prevail.
-
-If a section in the Document is Entitled "Acknowledgements",
-"Dedications", or "History", the requirement (section 4) to Preserve
-its Title (section 1) will typically require changing the actual
-title.
-
-
-9. TERMINATION
-
-You may not copy, modify, sublicense, or distribute the Document
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense, or distribute it is void, and
-will automatically terminate your rights under this License.
-
-However, if you cease all violation of this License, then your license
-from a particular copyright holder is reinstated (a) provisionally,
-unless and until the copyright holder explicitly and finally
-terminates your license, and (b) permanently, if the copyright holder
-fails to notify you of the violation by some reasonable means prior to
-60 days after the cessation.
-
-Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
-Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License. If your rights have been terminated and not permanently
-reinstated, receipt of a copy of some or all of the same material does
-not give you any rights to use it.
-
-
-10. FUTURE REVISIONS OF THIS LICENSE
-
-The Free Software Foundation may publish new, revised versions of the
-GNU Free Documentation License from time to time. Such new versions
-will be similar in spirit to the present version, but may differ in
-detail to address new problems or concerns. See
-http://www.gnu.org/copyleft/.
-
-Each version of the License is given a distinguishing version number.
-If the Document specifies that a particular numbered version of this
-License "or any later version" applies to it, you have the option of
-following the terms and conditions either of that specified version or
-of any later version that has been published (not as a draft) by the
-Free Software Foundation. If the Document does not specify a version
-number of this License, you may choose any version ever published (not
-as a draft) by the Free Software Foundation. If the Document
-specifies that a proxy can decide which future versions of this
-License can be used, that proxy's public statement of acceptance of a
-version permanently authorizes you to choose that version for the
-Document.
-
-11. RELICENSING
-
-"Massive Multiauthor Collaboration Site" (or "MMC Site") means any
-World Wide Web server that publishes copyrightable works and also
-provides prominent facilities for anybody to edit those works. A
-public wiki that anybody can edit is an example of such a server. A
-"Massive Multiauthor Collaboration" (or "MMC") contained in the site
-means any set of copyrightable works thus published on the MMC site.
-
-"CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0
-license published by Creative Commons Corporation, a not-for-profit
-corporation with a principal place of business in San Francisco,
-California, as well as future copyleft versions of that license
-published by that same organization.
-
-"Incorporate" means to publish or republish a Document, in whole or in
-part, as part of another Document.
-
-An MMC is "eligible for relicensing" if it is licensed under this
-License, and if all works that were first published under this License
-somewhere other than this MMC, and subsequently incorporated in whole or
-in part into the MMC, (1) had no cover texts or invariant sections, and
-(2) were thus incorporated prior to November 1, 2008.
-
-The operator of an MMC Site may republish an MMC contained in the site
-under CC-BY-SA on the same site at any time before August 1, 2009,
-provided the MMC is eligible for relicensing.
-
-
-ADDENDUM: How to use this License for your documents
-
-To use this License in a document you have written, include a copy of
-the License in the document and put the following copyright and
-license notices just after the title page:
-
- Copyright (c) YEAR YOUR NAME.
- Permission is granted to copy, distribute and/or modify this document
- under the terms of the GNU Free Documentation License, Version 1.3
- or any later version published by the Free Software Foundation;
- with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
- A copy of the license is included in the section entitled "GNU
- Free Documentation License".
-
-If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
-replace the "with...Texts." line with this:
-
- with the Invariant Sections being LIST THEIR TITLES, with the
- Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
-
-If you have Invariant Sections without Cover Texts, or some other
-combination of the three, merge those two alternatives to suit the
-situation.
-
-If your document contains nontrivial examples of program code, we
-recommend releasing these examples in parallel under your choice of
-free software license, such as the GNU General Public License,
-to permit their use in free software.
diff --git a/LICENSE.LGPL b/LICENSE.LGPL
deleted file mode 100644
index 2db28fb5..00000000
--- a/LICENSE.LGPL
+++ /dev/null
@@ -1,514 +0,0 @@
- GNU LESSER GENERAL PUBLIC LICENSE
-
- The Qt GUI Toolkit is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
- Contact: Nokia Corporation (qt-info@nokia.com)
-
- You may use, distribute and copy the Qt GUI Toolkit under the terms of
- GNU Lesser General Public License version 2.1, which is displayed below.
-
--------------------------------------------------------------------------
-
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL. It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
- This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it. You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
- When we speak of free software, we are referring to freedom of use,
-not price. Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
- To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights. These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
- For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you. You must make sure that they, too, receive or can get the source
-code. If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it. And you must show them these terms so they know their rights.
-
- We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
- To protect each distributor, we want to make it very clear that
-there is no warranty for the free library. Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-
- Finally, software patents pose a constant threat to the existence of
-any free program. We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder. Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
- Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License. This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License. We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
- When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library. The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom. The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
- We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License. It also provides other free software developers Less
-of an advantage over competing non-free programs. These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries. However, the Lesser license provides advantages in certain
-special circumstances.
-
- For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard. To achieve this, non-free programs must be
-allowed to use the library. A more frequent case is that a free
-library does the same job as widely used non-free libraries. In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
- In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software. For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
- Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
- The precise terms and conditions for copying, distribution and
-modification follow. Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library". The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-
- GNU LESSER GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
- A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
- The "Library", below, refers to any such software library or work
-which has been distributed under these terms. A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language. (Hereinafter, translation is
-included without limitation in the term "modification".)
-
- "Source code" for a work means the preferred form of the work for
-making modifications to it. For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
- Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it). Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
- 1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
- You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
- 2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) The modified work must itself be a software library.
-
- b) You must cause the files modified to carry prominent notices
- stating that you changed the files and the date of any change.
-
- c) You must cause the whole of the work to be licensed at no
- charge to all third parties under the terms of this License.
-
- d) If a facility in the modified Library refers to a function or a
- table of data to be supplied by an application program that uses
- the facility, other than as an argument passed when the facility
- is invoked, then you must make a good faith effort to ensure that,
- in the event an application does not supply such function or
- table, the facility still operates, and performs whatever part of
- its purpose remains meaningful.
-
- (For example, a function in a library to compute square roots has
- a purpose that is entirely well-defined independent of the
- application. Therefore, Subsection 2d requires that any
- application-supplied function or table used by this function must
- be optional: if the application does not supply it, the square
- root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library. To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License. (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.) Do not make any other change in
-these notices.
-
- Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
- This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
- 4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
- If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library". Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
- However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library". The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
- When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library. The
-threshold for this to be true is not precisely defined by law.
-
- If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work. (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
- Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
- 6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
- You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License. You must supply a copy of this License. If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License. Also, you must do one
-of these things:
-
- a) Accompany the work with the complete corresponding
- machine-readable source code for the Library including whatever
- changes were used in the work (which must be distributed under
- Sections 1 and 2 above); and, if the work is an executable linked
- with the Library, with the complete machine-readable "work that
- uses the Library", as object code and/or source code, so that the
- user can modify the Library and then relink to produce a modified
- executable containing the modified Library. (It is understood
- that the user who changes the contents of definitions files in the
- Library will not necessarily be able to recompile the application
- to use the modified definitions.)
-
- b) Use a suitable shared library mechanism for linking with the
- Library. A suitable mechanism is one that (1) uses at run time a
- copy of the library already present on the user's computer system,
- rather than copying library functions into the executable, and (2)
- will operate properly with a modified version of the library, if
- the user installs one, as long as the modified version is
- interface-compatible with the version that the work was made with.
-
- c) Accompany the work with a written offer, valid for at
- least three years, to give the same user the materials
- specified in Subsection 6a, above, for a charge no more
- than the cost of performing this distribution.
-
- d) If distribution of the work is made by offering access to copy
- from a designated place, offer equivalent access to copy the above
- specified materials from the same place.
-
- e) Verify that the user has already received a copy of these
- materials or that you have already sent this user a copy.
-
- For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it. However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
- It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system. Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
- 7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
- a) Accompany the combined library with a copy of the same work
- based on the Library, uncombined with any other library
- facilities. This must be distributed under the terms of the
- Sections above.
-
- b) Give prominent notice with the combined library of the fact
- that part of it is a work based on the Library, and explaining
- where to find the accompanying uncombined form of the same work.
-
- 8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License. Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License. However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
- 9. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Library or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
- 10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-
- 11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all. For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded. In such case, this License incorporates the limitation as if
-written in the body of this License.
-
- 13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation. If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
- 14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission. For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this. Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
- NO WARRANTY
-
- 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Libraries
-
- If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change. You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
- To apply these terms, attach the following notices to the library. It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
- <one line to give the library's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the
- library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
- <signature of Ty Coon>, 1 April 1990
- Ty Coon, President of Vice
-
-That's all there is to it!
-
-
diff --git a/LICENSE.PREVIEW.COMMERCIAL b/LICENSE.PREVIEW.COMMERCIAL
deleted file mode 100644
index 8827038e..00000000
--- a/LICENSE.PREVIEW.COMMERCIAL
+++ /dev/null
@@ -1,629 +0,0 @@
-TECHNOLOGY PREVIEW LICENSE AGREEMENT
-
-For individuals and/or legal entities resident in the Americas (North
-America, Central America and South America), the applicable licensing
-terms are specified under the heading "Technology Preview License
-Agreement: The Americas".
-
-For individuals and/or legal entities not resident in The Americas, the
-applicable licensing terms are specified under the heading "Technology
-Preview License Agreement: Rest of the World".
-
-
-TECHNOLOGY PREVIEW LICENSE AGREEMENT: The Americas
-Agreement version 2.4
-
-This Technology Preview License Agreement ("Agreement") is a legal
-agreement between Nokia Inc. ("Nokia"), with its registered office at
-102 Corporate Park Drive, White Plains, N.Y., U.S.A. 10604 and you (either an
-individual or a legal entity) ("Licensee") for the Licensed Software (as
-defined below).
-
-1. DEFINITIONS
-
-"Affiliate" of a Party shall mean an entity (i) which is directly or
-indirectly controlling such Party; (ii) which is under the same direct
-or indirect ownership or control as such Party; or (iii) which is
-directly or indirectly owned or controlled by such Party. For these
-purposes, an entity shall be treated as being controlled by another if
-that other entity has fifty percent (50 %) or more of the votes in such
-entity, is able to direct its affairs and/or to control the composition
-of its board of directors or equivalent body.
-
-"Applications" shall mean Licensee's software products created using the
-Licensed Software which may include portions of the Licensed Software.
-
-"Term" shall mean the period of time six (6) months from the later of
-(a) the Effective Date; or (b) the date the Licensed Software was
-initially delivered to Licensee by Nokia. If no specific Effective Date
-is set forth in the Agreement, the Effective Date shall be deemed to be
-the date the Licensed Software was initially delivered to Licensee.
-
-"Licensed Software" shall mean the computer software, "online" or
-electronic documentation, associated media and printed materials,
-including the source code, example programs and the documentation
-delivered by Nokia to Licensee in conjunction with this Agreement.
-
-"Party" or "Parties" shall mean Licensee and/or Nokia.
-
-
-2. OWNERSHIP
-
-The Licensed Software is protected by copyright laws and international
-copyright treaties, as well as other intellectual property laws and
-treaties. The Licensed Software is licensed, not sold.
-
-If Licensee provides any findings, proposals, suggestions or other
-feedback ("Feedback") to Nokia regarding the Licensed Software, Nokia
-shall own all right, title and interest including the intellectual
-property rights in and to such Feedback, excluding however any existing
-patent rights of Licensee. To the extent Licensee owns or controls any
-patents for such Feedback Licensee hereby grants to Nokia and its
-Affiliates, a worldwide, perpetual, non-transferable, sublicensable,
-royalty-free license to (i) use, copy and modify Feedback and to create
-derivative works thereof, (ii) to make (and have made), use, import,
-sell, offer for sale, lease, dispose, offer for disposal or otherwise
-exploit any products or services of Nokia containing Feedback,, and
-(iii) sublicense all the foregoing rights to third party licensees and
-customers of Nokia and/or its Affiliates.
-
-
-3. VALIDITY OF THE AGREEMENT
-
-By installing, copying, or otherwise using the Licensed Software,
-Licensee agrees to be bound by the terms of this Agreement. If Licensee
-does not agree to the terms of this Agreement, Licensee may not install,
-copy, or otherwise use the Licensed Software. Upon Licensee's acceptance
-of the terms and conditions of this Agreement, Nokia grants Licensee the
-right to use the Licensed Software in the manner provided below.
-
-
-4. LICENSES
-
-4.1. Using and Copying
-
-Nokia grants to Licensee a non-exclusive, non-transferable, time-limited
-license to use and copy the Licensed Software for sole purpose of
-designing, developing and testing Applications, and evaluating and the
-Licensed Software during the Term.
-
-Licensee may install copies of the Licensed Software on an unlimited
-number of computers provided that (a) if an individual, only such
-individual; or (b) if a legal entity only its employees; use the
-Licensed Software for the authorized purposes.
-
-4.2 No Distribution or Modifications
-
-Licensee may not disclose, modify, sell, market, commercialise,
-distribute, loan, rent, lease, or license the Licensed Software or any
-copy of it or use the Licensed Software for any purpose that is not
-expressly granted in this Section 4. Licensee may not alter or remove
-any details of ownership, copyright, trademark or other property right
-connected with the Licensed Software. Licensee may not distribute any
-software statically or dynamically linked with the Licensed Software.
-
-4.3 No Technical Support
-
-Nokia has no obligation to furnish Licensee with any technical support
-whatsoever. Any such support is subject to separate agreement between
-the Parties.
-
-
-5. PRE-RELEASE CODE
-The Licensed Software contains pre-release code that is not at the level
-of performance and compatibility of a final, generally available,
-product offering. The Licensed Software may not operate correctly and
-may be substantially modified prior to the first commercial product
-release, if any. Nokia is not obligated to make this or any later
-version of the Licensed Software commercially available. The License
-Software is "Not for Commercial Use" and may only be used for the
-purposes described in Section 4. The Licensed Software may not be used
-in a live operating environment where it may be relied upon to perform
-in the same manner as a commercially released product or with data that
-has not been sufficiently backed up.
-
-6. THIRD PARTY SOFTWARE
-
-The Licensed Software may provide links to third party libraries or code
-(collectively "Third Party Software") to implement various functions.
-Third Party Software does not comprise part of the Licensed Software. In
-some cases, access to Third Party Software may be included along with
-the Licensed Software delivery as a convenience for development and
-testing only. Such source code and libraries may be listed in the
-".../src/3rdparty" source tree delivered with the Licensed Software or
-documented in the Licensed Software where the Third Party Software is
-used, as may be amended from time to time, do not comprise the Licensed
-Software. Licensee acknowledges (1) that some part of Third Party
-Software may require additional licensing of copyright and patents from
-the owners of such, and (2) that distribution of any of the Licensed
-Software referencing any portion of a Third Party Software may require
-appropriate licensing from such third parties.
-
-
-7. LIMITED WARRANTY AND WARRANTY DISCLAIMER
-
-The Licensed Software is licensed to Licensee "as is". To the maximum
-extent permitted by applicable law, Nokia on behalf of itself and its
-suppliers, disclaims all warranties and conditions, either express or
-implied, including, but not limited to, implied warranties of
-merchantability, fitness for a particular purpose, title and
-non-infringement with regard to the Licensed Software.
-
-
-8. LIMITATION OF LIABILITY
-
-If, Nokia's warranty disclaimer notwithstanding, Nokia is held liable to
-Licensee, whether in contract, tort or any other legal theory, based on
-the Licensed Software, Nokia's entire liability to Licensee and
-Licensee's exclusive remedy shall be, at Nokia's option, either (A)
-return of the price Licensee paid for the Licensed Software, or (B)
-repair or replacement of the Licensed Software, provided Licensee
-returns to Nokia all copies of the Licensed Software as originally
-delivered to Licensee. Nokia shall not under any circumstances be liable
-to Licensee based on failure of the Licensed Software if the failure
-resulted from accident, abuse or misapplication, nor shall Nokia under
-any circumstances be liable for special damages, punitive or exemplary
-damages, damages for loss of profits or interruption of business or for
-loss or corruption of data. Any award of damages from Nokia to Licensee
-shall not exceed the total amount Licensee has paid to Nokia in
-connection with this Agreement.
-
-
-9. CONFIDENTIALITY
-
-Each party acknowledges that during the Term of this Agreement it shall
-have access to information about the other party's business, business
-methods, business plans, customers, business relations, technology, and
-other information, including the terms of this Agreement, that is
-confidential and of great value to the other party, and the value of
-which would be significantly reduced if disclosed to third parties (the
-"Confidential Information"). Accordingly, when a party (the "Receiving
-Party") receives Confidential Information from another party (the
-"Disclosing Party"), the Receiving Party shall, and shall obligate its
-employees and agents and employees and agents of its Affiliates to: (i)
-maintain the Confidential Information in strict confidence; (ii) not
-disclose the Confidential Information to a third party without the
-Disclosing Party's prior written approval; and (iii) not, directly or
-indirectly, use the Confidential Information for any purpose other than
-for exercising its rights and fulfilling its responsibilities pursuant
-to this Agreement. Each party shall take reasonable measures to protect
-the Confidential Information of the other party, which measures shall
-not be less than the measures taken by such party to protect its own
-confidential and proprietary information.
-
-"Confidential Information" shall not include information that (a) is or
-becomes generally known to the public through no act or omission of the
-Receiving Party; (b) was in the Receiving Party's lawful possession
-prior to the disclosure hereunder and was not subject to limitations on
-disclosure or use; (c) is developed by the Receiving Party without
-access to the Confidential Information of the Disclosing Party or by
-persons who have not had access to the Confidential Information of the
-Disclosing Party as proven by the written records of the Receiving
-Party; (d) is lawfully disclosed to the Receiving Party without
-restrictions, by a third party not under an obligation of
-confidentiality; or (e) the Receiving Party is legally compelled to
-disclose the information, in which case the Receiving Party shall assert
-the privileged and confidential nature of the information and cooperate
-fully with the Disclosing Party to protect against and prevent
-disclosure of any Confidential Information and to limit the scope of
-disclosure and the dissemination of disclosed Confidential Information
-by all legally available means.
-
-The obligations of the Receiving Party under this Section shall continue
-during the Initial Term and for a period of five (5) years after
-expiration or termination of this Agreement. To the extent that the
-terms of the Non-Disclosure Agreement between Nokia and Licensee
-conflict with the terms of this Section 9, this Section 9 shall be
-controlling over the terms of the Non-Disclosure Agreement.
-
-
-10. GENERAL PROVISIONS
-
-10.1 No Assignment
-
-Licensee shall not be entitled to assign or transfer all or any of its
-rights, benefits and obligations under this Agreement without the prior
-written consent of Nokia, which shall not be unreasonably withheld.
-
-10.2 Termination
-
-Nokia may terminate the Agreement at any time immediately upon written
-notice by Nokia to Licensee if Licensee breaches this Agreement.
-
-Upon termination of this Agreement, Licensee shall return to Nokia all
-copies of Licensed Software that were supplied by Nokia. All other
-copies of Licensed Software in the possession or control of Licensee
-must be erased or destroyed. An officer of Licensee must promptly
-deliver to Nokia a written confirmation that this has occurred.
-
-10.3 Surviving Sections
-
-Any terms and conditions that by their nature or otherwise reasonably
-should survive a cancellation or termination of this Agreement shall
-also be deemed to survive. Such terms and conditions include, but are
-not limited to the following Sections: 2, 5, 6, 7, 8, 9, 10.2, 10.3, 10.4,
-10.5, 10.6, 10.7, and 10.8 of this Agreement.
-
-10.4 Entire Agreement
-
-This Agreement constitutes the complete agreement between the parties
-and supersedes all prior or contemporaneous discussions,
-representations, and proposals, written or oral, with respect to the
-subject matters discussed herein, with the exception of the
-non-disclosure agreement executed by the parties in connection with this
-Agreement ("Non-Disclosure Agreement"), if any, shall be subject to
-Section 9. No modification of this Agreement shall be effective unless
-contained in a writing executed by an authorized representative of each
-party. No term or condition contained in Licensee's purchase order shall
-apply unless expressly accepted by Nokia in writing. If any provision of
-the Agreement is found void or unenforceable, the remainder shall remain
-valid and enforceable according to its terms. If any remedy provided is
-determined to have failed for its essential purpose, all limitations of
-liability and exclusions of damages set forth in this Agreement shall
-remain in effect.
-
-10.5 Export Control
-
-Licensee acknowledges that the Licensed Software may be subject to
-export control restrictions of various countries. Licensee shall fully
-comply with all applicable export license restrictions and requirements
-as well as with all laws and regulations relating to the importation of
-the Licensed Software and shall procure all necessary governmental
-authorizations, including without limitation, all necessary licenses,
-approvals, permissions or consents, where necessary for the
-re-exportation of the Licensed Software.,
-
-10.6 Governing Law and Legal Venue
-
-This Agreement shall be governed by and construed in accordance with the
-federal laws of the United States of America and the internal laws of
-the State of New York without given effect to any choice of law rule
-that would result in the application of the laws of any other
-jurisdiction. The United Nations Convention on Contracts for the
-International Sale of Goods (CISG) shall not apply. Each Party (a)
-hereby irrevocably submits itself to and consents to the jurisdiction of
-the United States District Court for the Southern District of New York
-(or if such court lacks jurisdiction, the state courts of the State of
-New York) for the purposes of any action, claim, suit or proceeding
-between the Parties in connection with any controversy, claim, or
-dispute arising out of or relating to this Agreement; and (b) hereby
-waives, and agrees not to assert by way of motion, as a defense or
-otherwise, in any such action, claim, suit or proceeding, any claim that
-is not personally subject to the jurisdiction of such court(s), that the
-action, claim, suit or proceeding is brought in an inconvenient forum or
-that the venue of the action, claim, suit or proceeding is improper.
-Notwithstanding the foregoing, nothing in this Section 9.6 is intended
-to, or shall be deemed to, constitute a submission or consent to, or
-selection of, jurisdiction, forum or venue for any action for patent
-infringement, whether or not such action relates to this Agreement.
-
-10.7 No Implied License
-
-There are no implied licenses or other implied rights granted under this
-Agreement, and all rights, save for those expressly granted hereunder,
-shall remain with Nokia and its licensors. In addition, no licenses or
-immunities are granted to the combination of the Licensed Software with
-any other software or hardware not delivered by Nokia under this
-Agreement.
-
-10.8 Government End Users
-
-A "U.S. Government End User" shall mean any agency or entity of the
-government of the United States. The following shall apply if Licensee
-is a U.S. Government End User. The Licensed Software is a "commercial
-item," as that term is defined in 48 C.F.R. 2.101 (Oct. 1995),
-consisting of "commercial computer software" and "commercial computer
-software documentation," as such terms are used in 48 C.F.R. 12.212
-(Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1
-through 227.7202-4 (June 1995), all U.S. Government End Users acquire
-the Licensed Software with only those rights set forth herein. The
-Licensed Software (including related documentation) is provided to U.S.
-Government End Users: (a) only as a commercial end item; and (b) only
-pursuant to this Agreement.
-
-
-
-
-
-TECHNOLOGY PREVIEW LICENSE AGREEMENT: Rest of the World
-Agreement version 2.4
-
-This Technology Preview License Agreement ("Agreement") is a legal
-agreement between Nokia Corporation ("Nokia"), with its registered
-office at Keilalahdentie 4, 02150 Espoo, Finland and you (either an
-individual or a legal entity) ("Licensee") for the Licensed Software (as
-defined below).
-
-1. DEFINITIONS
-
-"Affiliate" of a Party shall mean an entity (i) which is directly or
-indirectly controlling such Party; (ii) which is under the same direct
-or indirect ownership or control as such Party; or (iii) which is
-directly or indirectly owned or controlled by such Party. For these
-purposes, an entity shall be treated as being controlled by another if
-that other entity has fifty percent (50 %) or more of the votes in such
-entity, is able to direct its affairs and/or to control the composition
-of its board of directors or equivalent body.
-
-"Applications" shall mean Licensee's software products created using the
-Licensed Software which may include portions of the Licensed Software.
-
-"Term" shall mean the period of time six (6) months from the later of
-(a) the Effective Date; or (b) the date the Licensed Software was
-initially delivered to Licensee by Nokia. If no specific Effective Date
-is set forth in the Agreement, the Effective Date shall be deemed to be
-the date the Licensed Software was initially delivered to Licensee.
-
-"Licensed Software" shall mean the computer software, "online" or
-electronic documentation, associated media and printed materials,
-including the source code, example programs and the documentation
-delivered by Nokia to Licensee in conjunction with this Agreement.
-
-"Party" or "Parties" shall mean Licensee and/or Nokia.
-
-
-2. OWNERSHIP
-
-The Licensed Software is protected by copyright laws and international
-copyright treaties, as well as other intellectual property laws and
-treaties. The Licensed Software is licensed, not sold.
-
-If Licensee provides any findings, proposals, suggestions or other
-feedback ("Feedback") to Nokia regarding the Licensed Software, Nokia
-shall own all right, title and interest including the intellectual
-property rights in and to such Feedback, excluding however any existing
-patent rights of Licensee. To the extent Licensee owns or controls any
-patents for such Feedback Licensee hereby grants to Nokia and its
-Affiliates, a worldwide, perpetual, non-transferable, sublicensable,
-royalty-free license to (i) use, copy and modify Feedback and to create
-derivative works thereof, (ii) to make (and have made), use, import,
-sell, offer for sale, lease, dispose, offer for disposal or otherwise
-exploit any products or services of Nokia containing Feedback,, and
-(iii) sublicense all the foregoing rights to third party licensees and
-customers of Nokia and/or its Affiliates.
-
-3. VALIDITY OF THE AGREEMENT
-
-By installing, copying, or otherwise using the Licensed Software,
-Licensee agrees to be bound by the terms of this Agreement. If Licensee
-does not agree to the terms of this Agreement, Licensee may not install,
-copy, or otherwise use the Licensed Software. Upon Licensee's acceptance
-of the terms and conditions of this Agreement, Nokia grants Licensee the
-right to use the Licensed Software in the manner provided below.
-
-
-4. LICENSES
-
-4.1. Using and Copying
-
-Nokia grants to Licensee a non-exclusive, non-transferable, time-limited
-license to use and copy the Licensed Software for sole purpose of
-designing, developing and testing Applications, and evaluating and the
-Licensed Software during the Term.
-
-Licensee may install copies of the Licensed Software on an unlimited
-number of computers provided that (a) if an individual, only such
-individual; or (b) if a legal entity only its employees; use the
-Licensed Software for the authorized purposes.
-
-4.2 No Distribution or Modifications
-
-Licensee may not disclose, modify, sell, market, commercialise,
-distribute, loan, rent, lease, or license the Licensed Software or any
-copy of it or use the Licensed Software for any purpose that is not
-expressly granted in this Section 4. Licensee may not alter or remove
-any details of ownership, copyright, trademark or other property right
-connected with the Licensed Software. Licensee may not distribute any
-software statically or dynamically linked with the Licensed Software.
-
-4.3 No Technical Support
-
-Nokia has no obligation to furnish Licensee with any technical support
-whatsoever. Any such support is subject to separate agreement between
-the Parties.
-
-
-5. PRE-RELEASE CODE
-
-The Licensed Software contains pre-release code that is not at the level
-of performance and compatibility of a final, generally available,
-product offering. The Licensed Software may not operate correctly and
-may be substantially modified prior to the first commercial product
-release, if any. Nokia is not obligated to make this or any later
-version of the Licensed Software commercially available. The License
-Software is "Not for Commercial Use" and may only be used for the
-purposes described in Section 4. The Licensed Software may not be used
-in a live operating environment where it may be relied upon to perform
-in the same manner as a commercially released product or with data that
-has not been sufficiently backed up.
-
-6. THIRD PARTY SOFTWARE
-
-The Licensed Software may provide links to third party libraries or code
-(collectively "Third Party Software") to implement various functions.
-Third Party Software does not comprise part of the Licensed Software. In
-some cases, access to Third Party Software may be included along with
-the Licensed Software delivery as a convenience for development and
-testing only. Such source code and libraries may be listed in the
-".../src/3rdparty" source tree delivered with the Licensed Software or
-documented in the Licensed Software where the Third Party Software is
-used, as may be amended from time to time, do not comprise the Licensed
-Software. Licensee acknowledges (1) that some part of Third Party
-Software may require additional licensing of copyright and patents from
-the owners of such, and (2) that distribution of any of the Licensed
-Software referencing any portion of a Third Party Software may require
-appropriate licensing from such third parties.
-
-
-7. LIMITED WARRANTY AND WARRANTY DISCLAIMER
-
-The Licensed Software is licensed to Licensee "as is". To the maximum
-extent permitted by applicable law, Nokia on behalf of itself and its
-suppliers, disclaims all warranties and conditions, either express or
-implied, including, but not limited to, implied warranties of
-merchantability, fitness for a particular purpose, title and
-non-infringement with regard to the Licensed Software.
-
-
-8. LIMITATION OF LIABILITY
-
-If, Nokia's warranty disclaimer notwithstanding, Nokia is held liable to
-Licensee, whether in contract, tort or any other legal theory, based on
-the Licensed Software, Nokia's entire liability to Licensee and
-Licensee's exclusive remedy shall be, at Nokia's option, either (A)
-return of the price Licensee paid for the Licensed Software, or (B)
-repair or replacement of the Licensed Software, provided Licensee
-returns to Nokia all copies of the Licensed Software as originally
-delivered to Licensee. Nokia shall not under any circumstances be liable
-to Licensee based on failure of the Licensed Software if the failure
-resulted from accident, abuse or misapplication, nor shall Nokia under
-any circumstances be liable for special damages, punitive or exemplary
-damages, damages for loss of profits or interruption of business or for
-loss or corruption of data. Any award of damages from Nokia to Licensee
-shall not exceed the total amount Licensee has paid to Nokia in
-connection with this Agreement.
-
-
-9. CONFIDENTIALITY
-
-Each party acknowledges that during the Term of this Agreement it shall
-have access to information about the other party's business, business
-methods, business plans, customers, business relations, technology, and
-other information, including the terms of this Agreement, that is
-confidential and of great value to the other party, and the value of
-which would be significantly reduced if disclosed to third parties (the
-"Confidential Information"). Accordingly, when a party (the "Receiving
-Party") receives Confidential Information from another party (the
-"Disclosing Party"), the Receiving Party shall, and shall obligate its
-employees and agents and employees and agents of its Affiliates to: (i)
-maintain the Confidential Information in strict confidence; (ii) not
-disclose the Confidential Information to a third party without the
-Disclosing Party's prior written approval; and (iii) not, directly or
-indirectly, use the Confidential Information for any purpose other than
-for exercising its rights and fulfilling its responsibilities pursuant
-to this Agreement. Each party shall take reasonable measures to protect
-the Confidential Information of the other party, which measures shall
-not be less than the measures taken by such party to protect its own
-confidential and proprietary information.
-
-"Confidential Information" shall not include information that (a) is or
-becomes generally known to the public through no act or omission of the
-Receiving Party; (b) was in the Receiving Party's lawful possession
-prior to the disclosure hereunder and was not subject to limitations on
-disclosure or use; (c) is developed by the Receiving Party without
-access to the Confidential Information of the Disclosing Party or by
-persons who have not had access to the Confidential Information of the
-Disclosing Party as proven by the written records of the Receiving
-Party; (d) is lawfully disclosed to the Receiving Party without
-restrictions, by a third party not under an obligation of
-confidentiality; or (e) the Receiving Party is legally compelled to
-disclose the information, in which case the Receiving Party shall assert
-the privileged and confidential nature of the information and cooperate
-fully with the Disclosing Party to protect against and prevent
-disclosure of any Confidential Information and to limit the scope of
-disclosure and the dissemination of disclosed Confidential Information
-by all legally available means.
-
-The obligations of the Receiving Party under this Section shall continue
-during the Initial Term and for a period of five (5) years after
-expiration or termination of this Agreement. To the extent that the
-terms of the Non-Disclosure Agreement between Nokia and Licensee
-conflict with the terms of this Section 9, this Section 9 shall be
-controlling over the terms of the Non-Disclosure Agreement.
-
-
-10. GENERAL PROVISIONS
-
-10.1 No Assignment
-
-Licensee shall not be entitled to assign or transfer all or any of its
-rights, benefits and obligations under this Agreement without the prior
-written consent of Nokia, which shall not be unreasonably withheld.
-
-10.2 Termination
-
-Nokia may terminate the Agreement at any time immediately upon written
-notice by Nokia to Licensee if Licensee breaches this Agreement.
-
-Upon termination of this Agreement, Licensee shall return to Nokia all
-copies of Licensed Software that were supplied by Nokia. All other
-copies of Licensed Software in the possession or control of Licensee
-must be erased or destroyed. An officer of Licensee must promptly
-deliver to Nokia a written confirmation that this has occurred.
-
-10.3 Surviving Sections
-
-Any terms and conditions that by their nature or otherwise reasonably
-should survive a cancellation or termination of this Agreement shall
-also be deemed to survive. Such terms and conditions include, but are
-not limited to the following Sections: 2, 5, 6, 7, 8, 9, 10.2, 10.3, 10.4,
-10.5, 10.6, 10.7, and 10.8 of this Agreement.
-
-10.4 Entire Agreement
-
-This Agreement constitutes the complete agreement between the parties
-and supersedes all prior or contemporaneous discussions,
-representations, and proposals, written or oral, with respect to the
-subject matters discussed herein, with the exception of the
-non-disclosure agreement executed by the parties in connection with this
-Agreement ("Non-Disclosure Agreement"), if any, shall be subject to
-Section 9. No modification of this Agreement shall be effective unless
-contained in a writing executed by an authorized representative of each
-party. No term or condition contained in Licensee's purchase order shall
-apply unless expressly accepted by Nokia in writing. If any provision of
-the Agreement is found void or unenforceable, the remainder shall remain
-valid and enforceable according to its terms. If any remedy provided is
-determined to have failed for its essential purpose, all limitations of
-liability and exclusions of damages set forth in this Agreement shall
-remain in effect.
-
-10.5 Export Control
-
-Licensee acknowledges that the Licensed Software may be subject to
-export control restrictions of various countries. Licensee shall fully
-comply with all applicable export license restrictions and requirements
-as well as with all laws and regulations relating to the importation of
-the Licensed Software and shall procure all necessary governmental
-authorizations, including without limitation, all necessary licenses,
-approvals, permissions or consents, where necessary for the
-re-exportation of the Licensed Software.,
-
-10.6 Governing Law and Legal Venue
-
-This Agreement shall be construed and interpreted in accordance with the
-laws of Finland, excluding its choice of law provisions. Any disputes
-arising out of or relating to this Agreement shall be resolved in
-arbitration under the Rules of Arbitration of the Chamber of Commerce of
-Helsinki, Finland. The arbitration tribunal shall consist of one (1), or
-if either Party so requires, of three (3), arbitrators. The award shall
-be final and binding and enforceable in any court of competent
-jurisdiction. The arbitration shall be held in Helsinki, Finland and the
-process shall be conducted in the English language.
-
-10.7 No Implied License
-
-There are no implied licenses or other implied rights granted under this
-Agreement, and all rights, save for those expressly granted hereunder,
-shall remain with Nokia and its licensors. In addition, no licenses or
-immunities are granted to the combination of the Licensed Software with
-any other software or hardware not delivered by Nokia under this
-Agreement.
-
-10.8 Government End Users
-
-A "U.S. Government End User" shall mean any agency or entity of the
-government of the United States. The following shall apply if Licensee
-is a U.S. Government End User. The Licensed Software is a "commercial
-item," as that term is defined in 48 C.F.R. 2.101 (Oct. 1995),
-consisting of "commercial computer software" and "commercial computer
-software documentation," as such terms are used in 48 C.F.R. 12.212
-(Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1
-through 227.7202-4 (June 1995), all U.S. Government End Users acquire
-the Licensed Software with only those rights set forth herein. The
-Licensed Software (including related documentation) is provided to U.S.
-Government End Users: (a) only as a commercial end item; and (b) only
-pursuant to this Agreement.
-
-
-
-
diff --git a/README b/README
index b04dfde8..826b5d49 100644
--- a/README
+++ b/README
@@ -1,95 +1,39 @@
-This directory contains the Qt3D project for Qt 4.x:
- * QtQuick3D QML bindings and
- * Qt3D C++ APIs
+!!! WARNING !!!
+===============
+This is not the code you're looking for!
-Building QtQuick3D
-==================
+The qt/quick3d repository has been deprecated. We have moved to a new
+repository in qt/qt3d.
-Check the building instructions in doc/src/qt3d-building.qdoc also available
-online at: http://doc.qt.nokia.com/qt-quick3d-snapshot/qt3d-building.html
+If you're working with Qt5 then to move from the (old) qml2 branch, use qt/qt3d
+and it will be built as part of the qt5 build (you'll be on branch: master).
+If you're working with Qt4.x you will now be working out of the qt4 branch
+of the qt/qt3d repository.
-Whats in QtQuick3D
-==================
+So: For Qt5 -
-Directory structure:
+# get the sources - qt3d will be cloned as a sub-project
+cd ~/depot
+git clone ssh://codereview.qt-project.org:29418/qt/qt5.git
+cd qt5
+./init-repository
-src/threed/
- This is the main library of the Qt3D project, containing abstractions
- for cross-platform GL, shaders, lighting models, and so on.
-src/plugins/
- Scene format loading plugins.
-src/imports/
- QML import plugins.
-util/
- Various utilities that are useful when working with Qt3D.
-examples/
- Some examples of using QtQuick3D (QML bindings) and Qt3D (C++ API).
-demos/
- Some more complex demos of using QtQuick3D (QML bindings) and Qt3D (C++ API).
-tests/auto/qml3d/
- Unit tests for the QtQuick3D bindings.
-tests/auto/threed/
- Unit tests for the Qt3D C++ API
-doc/
- Documentation.
-devices/symbian/
- Symbian deployment file
+# build - qt3d will be built as part of Qt5
+cd ~/build
+mkdir qt5; cd qt5
+~/depot/qt5/configure
+make
+For Qt4 -
+# get the sources
+cd ~/depot/qt
+git clone ssh://codereview.qt-project.org:29418/qt/qt3d.git
+cd qt3d
+git checkout qt4
-Documentation
-=============
-
-The documentation can be generated with "make docs". It will be placed
-into "doc/html" in the build directory.
-
-
-Packages
-========
-
-This section is only for those developing QtQuick3D. Read on to discover how
-the building of packages works. This section is also important if you want to
-change how the structure of the QtQuick3D pro files work.
-
-QtQuick3D is intended to be built in one of two ways:
-
-1) Normal developer way:
- qmake && make
-2) Package creation way:
- qmake CONFIG+=package && INSTALL_ROOT=tmp make install
-
-In 1) the .pro files will cause the toolchain to place the libraries, plugins
-header files and other components of QtQuick3D directly into place, as part of
-the compile process. What does "in place" mean? Run "qmake -query" to see
-the paths where the files are placed - QML plugins go in $$[QT_INSTALL_IMPORTS]
-for example. In this mode, there is no need to run "make install" because the
-files are already in their target destination. Here the "target destination"
-means the Qt which is being built against.
-
-First note that QtQuick3D has to be installed into the target Qt. This is because
-QtQuick3D has QML plugins and resources, as well as shared libraries, all of which
-must be resolved by the QMLViewer of the target Qt at runtime. Here where "qmake"
-is referred to it means the qmake inside the target Qt. Since QtDeclarative
-recommends using QMLViewer when developing and debugging QML Apps, in the developer
-case - which is what Qt3D is for - it has to install directly into the target Qt.
-
-In this mode 1) after the main library is compiled subsequent targets can simply
-resolve includes and link time dependencies by use of qt3d.prf and qtquick3d.prf.
-These two files are installed into the target Qt's makespecs/features directory
-during the processing of the quick3d.pro file.
-
-In 2) the libraries, plugins and so on are sitting inside the build tree after
-the compile step. As a result in order to resolve includes and dependencies
-the build system has to navigate the build tree with paths like "-L../../../threed"
-to locate the Qt3D libraries.
-
-Actually there is one build artifact that is not just left where it lands in the
-build tree - the header files. These are actually copied into an "include"
-directory inside the build root directory. This is because at present the header
-files all live inside their own seperate subdirectories under "threed" and would
-be too cumbersome to path in explicitly.
-
-After building the tree the install step is invoked using the INSTALL_ROOT environment
-export to cause the installation rules to place all the files into a sandboxed
-install tree, ready for packaging.
+# build - using your Qt 4.8
+cd ~/build/qt/qt3d
+~/build/qt/48/bin/qmake quick3d.pro
+make
diff --git a/debian/changelog b/debian/changelog
deleted file mode 100644
index 6346484a..00000000
--- a/debian/changelog
+++ /dev/null
@@ -1,5 +0,0 @@
-libqt4-3d (1.0-tp2) unstable; urgency=low
-
- * Technology Preview 2 Release.
-
- -- Julian de Bhal <julian.debhal@nokia.com> Mon, 12 Sep 2011 16:30:00 +1000
diff --git a/debian/compat b/debian/compat
deleted file mode 100644
index 7f8f011e..00000000
--- a/debian/compat
+++ /dev/null
@@ -1 +0,0 @@
-7
diff --git a/debian/control b/debian/control
deleted file mode 100644
index 6fae1a52..00000000
--- a/debian/control
+++ /dev/null
@@ -1,33 +0,0 @@
-Source: libqt4-3d
-Section: libdevel
-Priority: extra
-Maintainer: Sarah Smith <sarah.j.smith@nokia.com>
-Build-Depends: debhelper (>= 7), libqtcore4 (>= 4.7.3), libqtgui4 (>= 4.7.3), libqt4-opengl (>= 4.7.3), libqt4-declarative-dev (>= 4.7.3), cdbs (>= 0.4.87+maemo2+0m6)
-Standards-Version: 3.8.4
-
-Package: libqt4-3d
-Architecture: any
-Depends: libqtcore4 (>= 4.7.3), libqtgui4 (>= 4.7.3), libqt4-opengl (>= 4.7.3), libqt4-declarative (>= 4.7.3)
-Description: Qt4 3D module
- Qt is a cross-platform C++ application framework. Qt's primary feature
- is its rich set of widgets that provide standard GUI functionality.
- .
- The Qt3d module contains functionality for 3D scenes and UIs.
-
-Package: libqt4-3d-examples
-Architecture: any
-Depends: libqt4-3d (= ${binary:Version})
-Description: Qt 4 3d module examples
- Qt is a cross-platform C++ application framework. Qt's primary feature
- is its rich set of widgets that provide standard GUI functionality.
- .
- This package contains examples and demos for the Qt3d module
-
-Package: libqt4-3d-dev
-Architecture: any
-Depends: libqt4-3d (= ${binary:Version})
-Description: Qt 4 3d module development files
- Qt is a cross-platform C++ application framework. Qt's primary feature
- is its rich set of widgets that provide standard GUI functionality.
- .
- This package contains the development headers for the Qt3d module
diff --git a/debian/copyright b/debian/copyright
deleted file mode 100644
index 2d247d5b..00000000
--- a/debian/copyright
+++ /dev/null
@@ -1,106 +0,0 @@
-This work was packaged for Debian by:
-
- Sarah Smith <sarah.j.smith@nokia.com> on Wed, 09 Feb 2011 20:59:27 +1000
-
-Copyright:
-
- The Qt GUI Toolkit is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
- Contact: Nokia Corporation (qt-info@nokia.com)
-
-
-License:
-
- You may use, distribute and copy the Qt GUI Toolkit under the terms of
- GNU Lesser General Public License version 2.1, which is displayed below.
-
- GNU LESSER GENERAL PUBLIC LICENSE
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This package is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-The Debian packaging is:
-
- The Qt GUI Toolkit is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
- Contact: Nokia Corporation (qt-info@nokia.com)
-
-and is licensed under the GNU Lesser General Public License version
-2.1, which is displayed above.
-
-
-Third party libraries code includes the Asset Importer library:
-
-Open Asset Import Library (Assimp)
-
-Copyright (c) 2006-2010, Assimp Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-
-
-AN EXCEPTION applies to all files in the ./test/models-nonbsd subfolder.
-These are 3d models for testing purposes, from various free sources
-on the internet. They are - unless otherwise stated - copyright of
-their respective creators, which may impose additional requirements
-on the use of their work. For any of these models, see
-<model-name>.source.txt for more legal information. Contact us if you
-are a copyright holder and believe that we credited you inproperly or
-if you don't want your files to appear in the repository.
-
-
-
-...and the lib3ds library:
-
-
-Lib3ds is a free toolkit for handling the "3DS" format for 3D model files.
-Its main goal is to simplify the creation of 3DS import and export filters.
-
-This project is not related in any form to Autodesk Inc. The library is
-based on unofficial information about the 3DS format found on the web.
-
-This program is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
-License for more details.
-
-The official Lib3ds Homepage can be found under:
- http://lib3ds.sourceforge.net
-
diff --git a/debian/docs b/debian/docs
deleted file mode 100644
index 4a1f4770..00000000
--- a/debian/docs
+++ /dev/null
@@ -1,2 +0,0 @@
-LGPL_EXCEPTION.txt
-README
diff --git a/debian/libqt4-3d-dev.install b/debian/libqt4-3d-dev.install
deleted file mode 100644
index aef1dfd0..00000000
--- a/debian/libqt4-3d-dev.install
+++ /dev/null
@@ -1,2 +0,0 @@
-usr/share/qt4/mkspecs/features/
-usr/include/qt4/Qt3D/
diff --git a/debian/libqt4-3d-examples.install b/debian/libqt4-3d-examples.install
deleted file mode 100644
index 47d99cab..00000000
--- a/debian/libqt4-3d-examples.install
+++ /dev/null
@@ -1,4 +0,0 @@
-usr/bin/*
-usr/share/qt4/quick3d
-usr/share/icons/hicolor/80x80/apps
-usr/share/applications
diff --git a/debian/libqt4-3d.install b/debian/libqt4-3d.install
deleted file mode 100644
index d650a0c8..00000000
--- a/debian/libqt4-3d.install
+++ /dev/null
@@ -1,4 +0,0 @@
-usr/lib/libQt3D.so.*
-usr/lib/libQt3DQuick.so.*
-usr/lib/qt4/plugins/
-usr/lib/qt4/imports/
diff --git a/debian/rules b/debian/rules
deleted file mode 100755
index a09b5b39..00000000
--- a/debian/rules
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/usr/bin/make -f
-# -*- makefile -*-
-
-# This rules file is for new Nokia devices using maemo6/meego.
-# For fremantle / N900 see the file devices/maemo5/debian/rules.
-# For ubuntu desktop see the file devices/ubuntu/debian/rules.
-
-# To build using this rules file:
-# #
-# ### install debian packaging stuff if not already present:
-# sudo apt-get install dpkg-dev debhelper cdbs
-#
-# ### set up the build directory with version number - DO NOT CD INTO IT YET!
-# mkdir quick3d-tp1
-#
-# ### copy all the stuff across - cannot shadow build (probably don't want git)
-# (cd ~/depot/qt/quick3d && tar cf - --exclude-vcs .)|(cd quick3d-tp1 && tar xf -)
-#
-# ### if the qmake in the $PATH is not the Qt you want to use
-# ### you can use a binary package or a Qt built from source (even if its installed with
-# ### "make install") as long as it has declarative & opengl
-# # export PATH=/usr/local/qt/%VERSION%/bin:$PATH
-#
-# cd quick3d-tp1
-# export DEB_BUILD_OPTIONS="parallel=4"
-# dpkg-buildpackage -b
-
-# Uncomment this to turn on verbose mode.
-export DH_OPTIONS=-v
-export DH_VERBOSE=1
-
-include /usr/share/cdbs/1/rules/debhelper.mk
-include /usr/share/cdbs/1/class/makefile.mk
-
-# Find out how many parallel threads to run
-TMP_BUILD_OPTS = $(subst $(comma),$(space),$(DEB_BUILD_OPTIONS))
-ifneq (,$(filter parallel=%,$(TMP_BUILD_OPTS)))
- NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(TMP_BUILD_OPTS)))
- PARALLEL_MAKEFLAGS += -j$(NUMJOBS)
-endif
-
-DEB_MAKE_INVOKE := $(MAKE) $(PARALLEL_MAKEFLAGS)
-DEB_MAKE_INSTALL_TARGET := INSTALL_ROOT=$(DEB_DESTDIR) install
-DEB_DH_INSTALL_SOURCEDIR := debian/tmp
-
-common-configure-arch::
- qmake -spec linux-g++-maemo quick3d.pro CONFIG+=maemo CONFIG+=package
diff --git a/demos/demos.pro b/demos/demos.pro
deleted file mode 100644
index c5663106..00000000
--- a/demos/demos.pro
+++ /dev/null
@@ -1,2 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS = quick3d qt3d
diff --git a/demos/qt3d/README b/demos/qt3d/README
deleted file mode 100644
index 9188d92d..00000000
--- a/demos/qt3d/README
+++ /dev/null
@@ -1,14 +0,0 @@
-This directory contains demos for the Qt3D C++ API.
-
-Qt3D can be used to extend Qt Quick3D with custom 3D items. Qt3D is also
-a general 3D toolkit, featuring a scenegraph API, support for OpenGL VBO's
-and other utilities for general 3D programming.
-
-Research work on Qt3D also continues in the labs repository:
-
- http://qt.gitorious.org/qt-labs/qt3d
-
-...and is from time to time ported into Qt Quick3D.
-
-Check the labs version of Qt3D for additional cutting edge features such as
-support for stereoscopic hardware.
diff --git a/demos/qt3d/cubehouse/cube.qrc b/demos/qt3d/cubehouse/cube.qrc
deleted file mode 100644
index 9de1d255..00000000
--- a/demos/qt3d/cubehouse/cube.qrc
+++ /dev/null
@@ -1,7 +0,0 @@
-<!DOCTYPE RCC><RCC version="1.0">
-<qresource>
- <file>qtlogo.png</file>
- <file>shaders/objectlineartexgen.frag</file>
- <file>shaders/objectlineartexgen.vert</file>
-</qresource>
-</RCC>
diff --git a/demos/qt3d/cubehouse/cubehouse.desktop b/demos/qt3d/cubehouse/cubehouse.desktop
deleted file mode 100644
index 685e6418..00000000
--- a/demos/qt3d/cubehouse/cubehouse.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=CubeHouse
-Icon=/usr/share/icons/hicolor/80x80/apps/qt3d.png
-Exec=/usr/bin/invoker --type=e -s /usr/bin/cubehouse -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_cubehouse
diff --git a/demos/qt3d/cubehouse/cubehouse.pro b/demos/qt3d/cubehouse/cubehouse.pro
deleted file mode 100644
index f809849e..00000000
--- a/demos/qt3d/cubehouse/cubehouse.pro
+++ /dev/null
@@ -1,22 +0,0 @@
-TEMPLATE = app
-TARGET = cubehouse
-CONFIG += qt warn_on
-
-CONFIG += qt3d_deploy_pkg
-include(../../../pkg.pri)
-
-SOURCES = cubeview.cpp main.cpp projectivetextureeffect.cpp
-HEADERS = cubeview.h projectivetextureeffect.h
-win32:DEFINES+=_CRT_SECURE_NO_WARNINGS
-RESOURCES = cube.qrc
-
-OTHER_FILES += \
- shaders/objectlineartexgen.frag \
- shaders/objectlineartexgen.vert
-
-OTHER_FILES += \
- cubehouse.rc \
- cubehouse.desktop
-
-RC_FILE = cubehouse.rc
-
diff --git a/demos/qt3d/cubehouse/cubehouse.rc b/demos/qt3d/cubehouse/cubehouse.rc
deleted file mode 100644
index b40ecdc1..00000000
--- a/demos/qt3d/cubehouse/cubehouse.rc
+++ /dev/null
@@ -1 +0,0 @@
-IDI_ICON1 ICON DISCARDABLE "qt3d.ico"
diff --git a/demos/qt3d/cubehouse/cubeview.cpp b/demos/qt3d/cubehouse/cubeview.cpp
deleted file mode 100644
index 8c4f5e30..00000000
--- a/demos/qt3d/cubehouse/cubeview.cpp
+++ /dev/null
@@ -1,460 +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 "cubeview.h"
-#include "qglcube.h"
-#include "qglteapot.h"
-#include <QtCore/qdebug.h>
-#include <QtCore/qtimer.h>
-#include <QtCore/qpropertyanimation.h>
-#include <stdio.h>
-#include <qmath.h>
-#include "projectivetextureeffect.h"
-
-//#define PROJECTOR_CAMERA_DEBUG_MARKERS
-
-
-CubeView::CubeView(QWidget *parent)
- : QGLView(parent), scene(0), cube(0), teapot(0), room(0),
- sensitivity(0.1f),
- lightParameters(0),
- showFrameRate(false),
- stereo(false),
- useProjectiveTextureEffect(false),
- cangle(0.0f),
- prevX(0),
- prevY(0),
- prevZ(0),
- havePrev(false),
- projectiveTextureEffect(0)
-{
- setOption(CameraNavigation, false);
-
- roomCamera = new QGLCamera(this);
- roomCamera->setAdjustForAspectRatio(false);
-
- QPropertyAnimation *animation;
-
- animation = new QPropertyAnimation(this, "cubeAngle", this);
- animation->setStartValue(0.0f);
- animation->setEndValue(360.0f);
- animation->setDuration(5000);
- animation->setLoopCount(-1);
- animation->start();
-
- time.start();
-}
-
-void CubeView::initializeGL(QGLPainter *painter)
-{
- QGLBuilder builder;
- builder << QGL::Faceted << QGLCube(1.0f);
- cube = builder.currentNode();
- builder << QGL::Faceted;
- room = builder.currentNode();
- builder.pushNode();
- QGLSceneNode *back = builder.newNode();
- {
- QGeometryData quad;
- quad.appendVertex(QVector3D(-3.0f, -3.0f, -15.0f));
- quad.appendVertex(QVector3D( 3.0f, -3.0f, -15.0f));
- quad.appendVertex(QVector3D( 3.0f, 3.0f, -15.0f));
- quad.appendVertex(QVector3D(-3.0f, 3.0f, -15.0f));
- builder.addQuads(quad);
- }
- QGLSceneNode *left = builder.newNode();
- {
- QGeometryData quad;
- quad.appendVertex(QVector3D(-3.0f, -3.0f, -15.0f));
- quad.appendVertex(QVector3D(-3.0f, 3.0f, -15.0f));
- quad.appendVertex(QVector3D(-3.0f, 3.0f, 0.0f));
- quad.appendVertex(QVector3D(-3.0f, -3.0f, 0.0f));
- builder.addQuads(quad);
- }
- QGLSceneNode *right = builder.newNode();
- {
- QGeometryData quad;
- quad.appendVertex(QVector3D(3.0f, 3.0f, -15.0f));
- quad.appendVertex(QVector3D(3.0f, -3.0f, -15.0f));
- quad.appendVertex(QVector3D(3.0f, -3.0f, 0.0f));
- quad.appendVertex(QVector3D(3.0f, 3.0f, 0.0f));
- builder.addQuads(quad);
- }
- QGLSceneNode *top = builder.newNode();
- {
- QGeometryData quad;
- quad.appendVertex(QVector3D(-3.0f, 3.0f, -15.0f));
- quad.appendVertex(QVector3D( 3.0f, 3.0f, -15.0f));
- quad.appendVertex(QVector3D( 3.0f, 3.0f, 0.0f));
- quad.appendVertex(QVector3D(-3.0f, 3.0f, 0.0f));
- builder.addQuads(quad);
- }
- QGLSceneNode *bottom = builder.newNode();
- {
- QGeometryData quad;
- quad.appendVertex(QVector3D(-3.0f, -3.0f, -15.0f));
- quad.appendVertex(QVector3D(-3.0f, -3.0f, 0.0f));
- quad.appendVertex(QVector3D( 3.0f, -3.0f, 0.0f));
- quad.appendVertex(QVector3D( 3.0f, -3.0f, -15.0f));
- builder.addQuads(quad);
- }
- builder.popNode();
-
- int index;
- QGLMaterialCollection *palette = builder.sceneNode()->palette();
-
- QGLMaterial *mat1 = new QGLMaterial();
- mat1->setDiffuseColor(QColor(128, 100, 0));
- index = palette->addMaterial(mat1);
- back->setMaterialIndex(index);
-
- QGLMaterial *mat2 = new QGLMaterial();
- mat2->setDiffuseColor(Qt::cyan);
- index = palette->addMaterial(mat2);
- left->setMaterialIndex(index);
- right->setMaterialIndex(index);
-
- QGLMaterial *mat3 = new QGLMaterial();
- mat3->setDiffuseColor(Qt::yellow);
- index = palette->addMaterial(mat3);
- top->setMaterialIndex(index);
- bottom->setMaterialIndex(index);
-
- //qDumpScene(room);
-
- builder.newSection();
- builder << QGLTeapot();
- teapot = builder.currentNode();
- QGLMaterial *china = new QGLMaterial();
- china->setAmbientColor(QColor(192, 150, 128));
- china->setSpecularColor(QColor(60, 60, 60));
- china->setShininess(128);
- teapot->setMaterial(china);
-
- scene = builder.finalizedSceneNode();
- scene->setParent(this);
-
- roomModel = new QGLLightModel(this);
- roomModel->setAmbientSceneColor(Qt::white);
- roomModel->setViewerPosition(QGLLightModel::LocalViewer);
-
- normalModel = new QGLLightModel(this);
-
- lightParameters = new QGLLightParameters(this);
- lightParameters->setPosition(QVector3D(0.0f, 0.0f, 3.0f));
- painter->setMainLight(lightParameters);
-
- QImage textureImage(QLatin1String(":/qtlogo.png"));
- texture.setImage(textureImage);
-
- if (stereo) {
- camera()->setEyeSeparation(0.4f);
- roomCamera->setEyeSeparation(0.1f);
- }
-
- if (useProjectiveTextureEffect)
- {
- // initialize the projector camera
- projectorCamera = new QGLCamera(this);
- projectiveTextureEffect = new ProjectiveTextureEffect;
- connect(projectorCamera, SIGNAL(viewChanged()),
- this, SLOT(updateProjectorViewMatrix()));
- connect(projectorCamera, SIGNAL(projectionChanged()),
- this, SLOT(updateProjectorProjectionMatrix()));
- }
-}
-
-void CubeView::paintGL(QGLPainter *painter)
-{
- if (showFrameRate)
- qWarning("time since last frame: %d ms", time.restart());
-
- glDisable(GL_BLEND);
-
- // Animate the projector position so the effect can be seen
- if (useProjectiveTextureEffect)
- {
- projectorCamera->tiltPanRollCenter
- (-0.1f, -0.3f, 0.0f, QGLCamera::PanTiltRoll);
- }
-
- painter->modelViewMatrix().push();
- painter->projectionMatrix().push();
-
- painter->setStandardEffect(QGL::LitMaterial);
- painter->setCamera(roomCamera);
- painter->setLightModel(roomModel);
- room->draw(painter);
-
- painter->modelViewMatrix().pop();
- painter->projectionMatrix().pop();
-
- painter->modelViewMatrix().push();
- // These are the model transformations
- painter->modelViewMatrix().translate(-0.8f, -1.5f, -3.0f);
- painter->setLightModel(normalModel);
- if (useProjectiveTextureEffect)
- {
- modelMatrix.push();
- // For an effect that looks like we have only one projector
- // Over the whole screen, we duplicate transformations into the
- // projector's model matrix. For now, we don't apply the transform
- // to center the effect on each object and see it more clearly.
- // modelMatrix.translate(-0.8f, -1.5f, -3.0f);
-
- updateProjectiveTextureEffect();
-
- painter->setUserEffect(projectiveTextureEffect);
- texture.bind();
- }
- else
- {
- painter->setStandardEffect(QGL::LitMaterial);
- }
- teapot->draw(painter);
-
- if (useProjectiveTextureEffect)
- modelMatrix.pop();
- painter->modelViewMatrix().pop();
-
-
- // These are the model transformations
- painter->modelViewMatrix().push();
- painter->modelViewMatrix().translate(1.0f, -0.5f, 0.0f);
- painter->modelViewMatrix().rotate(cangle, 1.0f, 1.0f, 1.0f);
-
- texture.bind();
- if (useProjectiveTextureEffect)
- {
- modelMatrix.push();
- // For an effect that looks like we have only one projector
- // Over the whole screen, we duplicate transformations into the
- // projector's model matrix. For now, we don't apply the transform
- // to center the effect on each object and see it more clearly.
-// modelMatrix.translate(1.0f, -0.5f, 0.0f);
- modelMatrix.rotate(cangle, 1.0f, 1.0f, 1.0f);
- updateProjectiveTextureEffect();
- painter->setUserEffect(projectiveTextureEffect);
-// painter->setStandardEffect(QGL::FlatDecalTexture2D);
- cube->draw(painter);
- modelMatrix.pop();
- }
- else
- {
- glEnable(GL_BLEND);
- painter->setStandardEffect(QGL::LitDecalTexture2D);
- painter->setFaceColor(QGL::AllFaces, QColor(170, 202, 0, 120));
- glDisable(GL_DEPTH_TEST);
- glCullFace(GL_FRONT);
- glEnable(GL_CULL_FACE);
- cube->draw(painter);
- glCullFace(GL_BACK);
- cube->draw(painter);
- glDisable(GL_CULL_FACE);
- glEnable(GL_DEPTH_TEST);
- glBindTexture(GL_TEXTURE_2D, 0);
- }
-
- painter->modelViewMatrix().pop();
-#ifdef PROJECTOR_CAMERA_DEBUG_MARKERS
- if (useProjectiveTextureEffect)
- {
-
- painter->modelViewMatrix().push();
- modelMatrix.push();
- painter->modelViewMatrix().translate(projectorCamera->eye());
- painter->modelViewMatrix().scale(0.2);
- painter->setStandardEffect(QGL::LitMaterial);
- modelMatrix.translate(projectorCamera->eye());
- cube->draw(painter);
-
- modelMatrix.pop();
- painter->modelViewMatrix().pop();
-
- painter->modelViewMatrix().push();
- modelMatrix.push();
- painter->modelViewMatrix().translate(projectorCamera->center());
- painter->modelViewMatrix().scale(0.1);
- painter->setStandardEffect(QGL::LitMaterial);
- cube->draw(painter);
- modelMatrix.pop();
- painter->modelViewMatrix().pop();
-
- QVector3DArray verts;
-
- QVector3D origin = projectorCamera->eye();
-
- QVector3D target = projectorCamera->center();
- QVector3D direction = projectorCamera->center() - projectorCamera->eye();
-
- QVector3D normal = projectorCamera->upVector().normalized();
- qreal nearPlane = projectorCamera->nearPlane();
- qreal farPlane = projectorCamera->farPlane();
- qreal fieldOfView = projectorCamera->fieldOfView();
-
- QVector3D nearTopLeft;
- QVector3D nearTopRight;
- QVector3D nearBottomLeft;
- QVector3D nearBottomRight;
- QVector3D farTopLeft;
- QVector3D farTopRight;
- QVector3D farBottomLeft;
- QVector3D farBottomRight;
-
- QSizeF viewSize = projectorCamera->viewSize();
-
- qreal fieldDepthRatio = farPlane / nearPlane;
-
- QVector3D rightVector = QVector3D::crossProduct(direction, normal).normalized() * viewSize.width() / 2.0;
- QVector3D topVector = normal * viewSize.height() / 2.0;
-
- QVector3D topLeftVector = direction + topVector - rightVector;
- QVector3D topRightVector = direction + topVector + rightVector;
- QVector3D bottomLeftVector = direction - topVector - rightVector;
- QVector3D bottomRightVector = direction - topVector + rightVector;
-
- verts.append(origin, origin + (direction * (farPlane / direction.length())));
-
- verts.append(origin, origin + (topLeftVector * fieldDepthRatio));
- verts.append(origin, origin + (topRightVector * fieldDepthRatio));
- verts.append(origin, origin + (bottomLeftVector * fieldDepthRatio));
- verts.append(origin, origin + (bottomRightVector * fieldDepthRatio));
-
- verts.append(origin + topLeftVector, origin + topRightVector);
- verts.append(origin + topRightVector, origin + bottomRightVector);
- verts.append(origin + bottomRightVector, origin + bottomLeftVector);
- verts.append(origin + bottomLeftVector, origin + topLeftVector);
-
- verts.append(origin + (topLeftVector * fieldDepthRatio),
- (origin + topRightVector * fieldDepthRatio));
- verts.append(origin + (topRightVector * fieldDepthRatio),
- (origin + bottomRightVector * fieldDepthRatio));
- verts.append(origin + (bottomRightVector * fieldDepthRatio),
- (origin + bottomLeftVector * fieldDepthRatio));
- verts.append(origin + (bottomLeftVector * fieldDepthRatio),
- (origin + topLeftVector * fieldDepthRatio));
-
- verts.append(origin, origin + normal);
-
- painter->modelViewMatrix().push();
- painter->setStandardEffect(QGL::FlatColor);
- painter->clearAttributes();
- painter->setVertexAttribute(QGL::Position, QGLAttributeValue(verts));
- glLineWidth(1.0f);
-
- painter->setColor(QColor(255,255,255,255));
- painter->draw(QGL::Lines, verts.size());
- painter->modelViewMatrix().pop();
- }
-#endif
-}
-
-//inline void CubeView::setProjectiveTextureEffect(bool value)
-//{
-// useProjectiveTextureEffect = value;
-//}
-
-void CubeView::setCubeAngle(qreal angle)
-{
- cangle = angle;
- accelerometerTimeout();
- update();
-}
-
-void CubeView::accelerometerTimeout()
-{
- QVector3D g = gravity();
- camera()->setMotionAdjustment(g);
- roomCamera->setMotionAdjustment(g);
-}
-
-QVector3D CubeView::gravity() const
-{
- // Access the raw accelerometer data on the N900.
- FILE *file = fopen("/sys/class/i2c-adapter/i2c-3/3-001d/coord", "r");
- if (!file)
- return QVector3D(0, 0, -1);
- float x = 0;
- float y = 0;
- float z = 0;
- fscanf(file, "%f %f %f", &x, &y, &z);
- fclose(file);
-
- // Smooth out the reported values. Large changes are applied as-is,
- // and small jitters smooth to the rest position.
- if (havePrev) {
- qreal xdiff = x - prevX;
- qreal ydiff = y - prevY;
- qreal zdiff = z - prevZ;
- if (qAbs(xdiff) < 20.0f && qAbs(ydiff) < 20.0f && qAbs(zdiff) < 20.0f) {
- x = prevX + xdiff * 0.1f;
- y = prevY + ydiff * 0.1f;
- z = prevZ + zdiff * 0.1f;
- }
- }
- prevX = x;
- prevY = y;
- prevZ = z;
- havePrev = true;
-
- return QVector3D((x / 1000.0f) * sensitivity,
- (-y / 1000.0f) * sensitivity, -z / 1000.0f);
-}
-
-void CubeView::updateProjectorViewMatrix()
-{
- Q_ASSERT_X(projectorCamera != 0, Q_FUNC_INFO, "Null projector camera in updateProjectorViewMatrix()");
- projectiveTextureEffect->setProjectorViewMatrix(projectorCamera->modelViewMatrix());
- updateProjectiveTextureEffect();
-}
-
-void CubeView::updateProjectorProjectionMatrix()
-{
- qreal projectorAspectRatio = 1.0;
- projectiveTextureEffect->setProjectorProjectionMatrix(projectorCamera->projectionMatrix(projectorAspectRatio));
- updateProjectiveTextureEffect();
-}
-
-void CubeView::updateProjectiveTextureEffect()
-{
- projectiveTextureEffect->setProjectorDirection(projectorCamera->center() - projectorCamera->eye());
- projectiveTextureEffect->setModelMatrix(modelMatrix);
-}
diff --git a/demos/qt3d/cubehouse/cubeview.h b/demos/qt3d/cubehouse/cubeview.h
deleted file mode 100644
index 52517ea1..00000000
--- a/demos/qt3d/cubehouse/cubeview.h
+++ /dev/null
@@ -1,108 +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 CUBEVIEW_H
-#define CUBEVIEW_H
-
-#include "qglview.h"
-#include "qglbuilder.h"
-#include "qgltexture2d.h"
-#include <QtCore/qdatetime.h>
-
-class ProjectiveTextureEffect;
-
-class CubeView : public QGLView
-{
- Q_OBJECT
- Q_PROPERTY(qreal cubeAngle READ cubeAngle WRITE setCubeAngle)
-public:
- CubeView(QWidget *parent = 0);
- ~CubeView() {}
-
- void setShowFrameRate(bool value) { showFrameRate = value; }
- void setStereo(bool value) { stereo = value; }
- void setProjectiveTextureEffect(bool value)
-{
- useProjectiveTextureEffect = value;
-}
-
- qreal cubeAngle() const { return cangle; }
- void setCubeAngle(qreal angle);
-
-protected:
- void initializeGL(QGLPainter *painter);
- void paintGL(QGLPainter *painter);
-
-private slots:
- void accelerometerTimeout();
- void updateProjectorViewMatrix();
- void updateProjectorProjectionMatrix();
- void updateProjectiveTextureEffect();
-
-private:
- QGLTexture2D texture;
- QGLSceneNode *scene;
- QGLSceneNode *cube;
- QGLSceneNode *teapot;
- QGLSceneNode *room;
- QGLCamera *roomCamera;
- QGLCamera *projectorCamera;
- qreal sensitivity;
- QGLLightModel *roomModel;
- QGLLightModel *normalModel;
- QGLLightParameters *lightParameters;
- bool showFrameRate;
- bool stereo;
- bool useProjectiveTextureEffect;
- QTime time;
- qreal cangle;
- mutable qreal prevX, prevY, prevZ;
- mutable bool havePrev;
-
- QVector3D gravity() const;
-
- ProjectiveTextureEffect* projectiveTextureEffect;
- QMatrix4x4 biasMatrix;
- QMatrix4x4Stack modelMatrix;
- QMatrix4x4 objectLinearTexgenMatrix;
-};
-
-#endif
diff --git a/demos/qt3d/cubehouse/main.cpp b/demos/qt3d/cubehouse/main.cpp
deleted file mode 100644
index a18b6584..00000000
--- a/demos/qt3d/cubehouse/main.cpp
+++ /dev/null
@@ -1,70 +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 <QApplication>
-#include "cubeview.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
- CubeView view;
- if (QApplication::arguments().contains(QLatin1String("-framerate")))
- view.setShowFrameRate(true);
- if (QApplication::arguments().contains(QLatin1String("-projectivetexture")))
- view.setProjectiveTextureEffect(true);
- if (QApplication::arguments().contains(QLatin1String("-stereo")))
- view.setStereo(true);
- else if (view.stereoType() != QGLView::RedCyanAnaglyph)
- view.setStereo(true);
-
-#ifdef Q_OS_SYMBIAN
- view.setAttribute(Qt::WA_LockLandscapeOrientation, true);
- view.showFullScreen();
-#else
- if (QApplication::arguments().contains(QLatin1String("-maximize")))
- view.showMaximized();
- else if (QApplication::arguments().contains(QLatin1String("-fullscreen")))
- view.showFullScreen();
- else
- view.show();
-#endif
- return app.exec();
-}
diff --git a/demos/qt3d/cubehouse/projectivetextureeffect.cpp b/demos/qt3d/cubehouse/projectivetextureeffect.cpp
deleted file mode 100644
index 4a88dd37..00000000
--- a/demos/qt3d/cubehouse/projectivetextureeffect.cpp
+++ /dev/null
@@ -1,148 +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 <QFile>
-#include "projectivetextureeffect.h"
-#include <QtOpenGL/qglshaderprogram.h>
-
-static const QMatrix4x4 biasMatrix = QMatrix4x4(0.5, 0.0, 0.0, 0.5,
- 0.0, 0.5, 0.0, 0.5,
- 0.0, 0.0, 0.5, 0.5,
- 0.0, 0.0, 0.0, 1.0);
-
-/*!
- The ProjectiveTextureEffect mimics the effect of shining a projector onto
- a scene from a specific direction. Vertex coordinates in object space are
- transformed into eye-space coordinates relative to the light direction,
- using the objectLinearTexgenMatrix.
-*/
-ProjectiveTextureEffect::ProjectiveTextureEffect() :
- matrixDirty(true)
-{
- setupShaders();
-}
-
-void ProjectiveTextureEffect::setActive(QGLPainter *painter, bool flag)
-{
- QGLShaderProgramEffect::setActive(painter, flag);
-}
-
-void ProjectiveTextureEffect::update(QGLPainter *painter, QGLPainter::Updates updates)
-{
- QGLShaderProgramEffect::update(painter, updates);
-
- if (matrixDirty)
- {
- recalulateObjectLinearTexgenMatrix();
- matrixDirty = false;
- }
-
- program()->setUniformValue("objectLinearTexgenMatrix",
- objectLinearTexgenMatrix);
- program()->setUniformValue("projectorDirection",
- projectorDirection);
-}
-
-void ProjectiveTextureEffect::setProjectorDirection(const QVector4D &direction)
-{
- this->projectorDirection = direction;
- matrixDirty = true;
-}
-
-void ProjectiveTextureEffect::setCameraModelViewMatrix(const QMatrix4x4 &newCameraModelViewMatrix)
-{
- cameraModelViewMatrix = newCameraModelViewMatrix;
- bool invertible;
- inverseCameraModelViewMatrix =
- newCameraModelViewMatrix.inverted(&invertible);
- Q_ASSERT(invertible);
- if (!invertible)
- qWarning() << "camera Model view matrix not invertible in ProjectiveDepthTestEffect::setCameraModelViewMatrix()";
- matrixDirty = true;
-}
-
-void ProjectiveTextureEffect::setProjectorProjectionMatrix(const QMatrix4x4 &newMatrix)
-{
- projectorProjectionMatrix = newMatrix;
- matrixDirty = true;
-}
-
-void ProjectiveTextureEffect::setProjectorViewMatrix(const QMatrix4x4 &newMatrix)
-{
- projectorViewMatrix = newMatrix;
- matrixDirty = true;
-}
-
-void ProjectiveTextureEffect::setModelMatrix(const QMatrix4x4 &newMatrix)
-{
- modelMatrix = newMatrix;
- matrixDirty = true;
-}
-
-void ProjectiveTextureEffect::recalulateObjectLinearTexgenMatrix()
-{
- objectLinearTexgenMatrix = biasMatrix *
- projectorProjectionMatrix *
- projectorViewMatrix *
- modelMatrix;
-}
-
-void ProjectiveTextureEffect::setupShaders()
-{
- QString vertexShaderFileName = QLatin1String(":/shaders/objectlineartexgen.vert");
- QFile vertexShaderFile(vertexShaderFileName);
- if (vertexShaderFile.open(QIODevice::ReadOnly | QIODevice::Text))
- {
- setVertexShader(vertexShaderFile.readAll());
- } else {
- qWarning() << "Could not open file "<<vertexShaderFileName<<", failed to load vertex shader";
- }
-
- QString fragmentShaderFileName = QLatin1String(":/shaders/objectlineartexgen.frag");
- QFile fragmentShaderFile(fragmentShaderFileName);
- if (fragmentShaderFile.open(QIODevice::ReadOnly | QIODevice::Text))
- {
- setFragmentShader(fragmentShaderFile.readAll());
- } else {
- qWarning() << "Could not open file "<<fragmentShaderFileName<<", failed to load fragment shader";
- }
-
-}
diff --git a/demos/qt3d/cubehouse/projectivetextureeffect.h b/demos/qt3d/cubehouse/projectivetextureeffect.h
deleted file mode 100644
index 8730710a..00000000
--- a/demos/qt3d/cubehouse/projectivetextureeffect.h
+++ /dev/null
@@ -1,79 +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 PROJECTIVEDTEXTUREEFFECT_H
-#define PROJECTIVEDTEXTUREEFFECT_H
-
-#include "qglshaderprogrameffect.h"
-//#include "deptheffect.h"
-#include "qmatrix4x4.h"
-
-class ProjectiveTextureEffect : public QGLShaderProgramEffect
-{
-public:
- explicit ProjectiveTextureEffect();
- virtual void setActive(QGLPainter *painter, bool flag);
- virtual void update(QGLPainter *painter, QGLPainter::Updates updates);
- virtual void setProjectorDirection(const QVector4D &direction);
-
- void setCameraModelViewMatrix(const QMatrix4x4 &newCameraModelViewMatrix);
- void setProjectorProjectionMatrix(const QMatrix4x4 &newMatrix);
- void setProjectorViewMatrix(const QMatrix4x4 &newMatrix);
- void setModelMatrix(const QMatrix4x4 &newMatrix);
-
-// TODO:
-// QMatrix4x4 eyeLinearTexgenMatrix;
-
-protected:
- virtual void setupShaders();
-private:
- virtual void recalulateObjectLinearTexgenMatrix();
- bool matrixDirty;
- QMatrix4x4 modelMatrix;
- QMatrix4x4 objectLinearTexgenMatrix;
- QMatrix4x4 cameraModelViewMatrix;
- QMatrix4x4 inverseCameraModelViewMatrix;
- QMatrix4x4 projectorProjectionMatrix;
- QMatrix4x4 projectorViewMatrix;
- QVector4D projectorDirection;
-};
-
-#endif // PROJECTIVEDTEXTUREEFFECT_H
diff --git a/demos/qt3d/cubehouse/qt3d.ico b/demos/qt3d/cubehouse/qt3d.ico
deleted file mode 100644
index e6442baf..00000000
--- a/demos/qt3d/cubehouse/qt3d.ico
+++ /dev/null
Binary files differ
diff --git a/demos/qt3d/cubehouse/qt3d.png b/demos/qt3d/cubehouse/qt3d.png
deleted file mode 100644
index 21ec0176..00000000
--- a/demos/qt3d/cubehouse/qt3d.png
+++ /dev/null
Binary files differ
diff --git a/demos/qt3d/cubehouse/qtlogo.png b/demos/qt3d/cubehouse/qtlogo.png
deleted file mode 100644
index 7d3e97eb..00000000
--- a/demos/qt3d/cubehouse/qtlogo.png
+++ /dev/null
Binary files differ
diff --git a/demos/qt3d/cubehouse/shaders/depth.frag b/demos/qt3d/cubehouse/shaders/depth.frag
deleted file mode 100644
index 939cfc95..00000000
--- a/demos/qt3d/cubehouse/shaders/depth.frag
+++ /dev/null
@@ -1,50 +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 module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-varying float depth;
-
-void main(void)
-{
- float stupidMathsDepth = depth;
- stupidMathsDepth = (stupidMathsDepth + 10.0) / 20.0;
-// gl_FragColor = vec4(vec3(stupidMathsDepth), 1.0);
- gl_FragColor = vec4(1.0, 0.0, 1.0, 1.0);
-};
diff --git a/demos/qt3d/cubehouse/shaders/depth.vert b/demos/qt3d/cubehouse/shaders/depth.vert
deleted file mode 100644
index 8e13193b..00000000
--- a/demos/qt3d/cubehouse/shaders/depth.vert
+++ /dev/null
@@ -1,75 +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 module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-attribute highp vec4 vertex;
-varying float depth;
-uniform highp mat4 qt_ModelViewMatrix;
-uniform highp mat4 qt_ProjectionMatrix;
-
-attribute highp vec4 texCoords;
-
-uniform highp mat4 cameraCombinedMatrix;
-uniform highp mat4 cameraModelViewMatrix;
-uniform highp mat4 cameraProjectionMatrix;
-
-uniform highp mat4 lightCombinedMatrix;
-
-varying highp vec4 qt_TexCoord0;
-varying highp vec4 onScreenPosition;
-varying highp vec4 lightScreenPosition;
-varying highp vec4 worldSpaceVertex;
-
-void main(void)
-{
- qt_TexCoord0 = texCoords;
-
- // qt_ProjectionMatrix == cameraProjectionMatrix
-// onScreenPosition = qt_ProjectionMatrix * qt_ModelViewMatrix * vertex;
-//onScreenPosition = cameraProjectionMatrix * qt_ModelViewMatrix * vertex;
-
- onScreenPosition = cameraProjectionMatrix
- * cameraModelViewMatrix
-// * qt_ModelViewMatrix
- * vertex;
- depth = onScreenPosition.z;
-
- gl_Position = onScreenPosition;
-};
diff --git a/demos/qt3d/cubehouse/shaders/depthTestShader.frag b/demos/qt3d/cubehouse/shaders/depthTestShader.frag
deleted file mode 100644
index b2c6957b..00000000
--- a/demos/qt3d/cubehouse/shaders/depthTestShader.frag
+++ /dev/null
@@ -1,91 +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 module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-// This is equivilent to GL_REPLACE
-varying highp vec4 qt_TexCoord0;
-
-uniform mediump sampler2D texture;
-uniform mediump mat4 textureMatrix;
-varying highp vec4 onScreenPosition;
-varying highp vec4 lightScreenPosition;
-varying highp vec4 worldSpaceVertex;
-varying float lightDepth;
-varying float actualDepth;
-
-void main(void)
-{
-
- // I should be able to build a matrix to do this:
-// vec4 normalizedOnScreenPosition = (onScreenPosition + 5.0) / 10.0;
-vec4 normalizedLightScreenPosition = (((lightScreenPosition
-//+ lightScreenPosition.w
-) / lightScreenPosition.w ) + 1.0) / 2.0;
-
-// float lightMapDepth = texture2D(texture, normalizedLightScreenPosition.st).z;
- float lightMapDepth = texture2D(texture, normalizedLightScreenPosition.st ).z;
-// gl_FragColor = vec4(lightMapDepth, lightMapDepth, lightMapDepth, 1.0);
-
-// gl_FragColor = vec4(normalizedLightScreenPosition.st,0.0,1.0);
-
-// float lightActualDepth = normalizedLightScreenPosition.z;
- float lightActualDepth = lightDepth;
-// gl_FragColor = vec4(lightActualDepth, lightActualDepth, lightActualDepth, 1.0);
- float lightActualDepthWithStupidMaths = (lightActualDepth + 10.0) / 20.0;
- float lightDepthWithStupidMaths = (lightDepth + 10.0) / 20.0;
-// gl_FragColor = vec4(vec3(lightActualDepthWithStupidMaths), 1.0);
-
-
-// if (lightActualDepthWithStupidMaths > lightMapDepth )
-// gl_FragColor = vec4(0.2, 0.2, 0.2, 1.0);
-// else
- gl_FragColor = vec4(1.0, 1.0, 0.5, 1.0);
-
-
-// gl_FragColor = vec4(lightDepthWithStupidMaths, lightDepthWithStupidMaths, lightDepthWithStupidMaths, 1.0);
-
-
-//float stupidMathslightDepth = (lightDepth + 10.0) / 20;
-//gl_FragColor = vec4(stupidMathslightDepth, stupidMathslightDepth, stupidMathslightDepth, 1.0);
-
-//float stupidMathsActualDepth = (actualDepth + 10.0) / 20.0;
-//gl_FragColor = vec4(stupidMathsActualDepth, stupidMathsActualDepth, stupidMathsActualDepth, 1.0);
-
-};
diff --git a/demos/qt3d/cubehouse/shaders/depthTestShader.vert b/demos/qt3d/cubehouse/shaders/depthTestShader.vert
deleted file mode 100644
index 6f640c87..00000000
--- a/demos/qt3d/cubehouse/shaders/depthTestShader.vert
+++ /dev/null
@@ -1,91 +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 module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-attribute highp vec4 vertex;
-attribute highp vec4 texCoords;
-
-uniform highp mat4 matrix;
-uniform highp mat4 qt_ProjectionMatrix;
-uniform highp mat4 qt_ModelViewMatrix;
-
-uniform highp mat4 cameraCombinedMatrix;
-uniform highp mat4 lightCombinedMatrix;
-
-uniform highp mat4 cameraModelViewMatrix;
-uniform highp mat4 inverseCameraModelViewMatrix;
-uniform highp mat4 lightModelViewMatrix;
-
-uniform highp mat4 cameraProjectionMatrix;
-uniform highp mat4 lightProjectionMatrix;
-
-varying highp vec4 qt_TexCoord0;
-varying highp vec4 onScreenPosition;
-varying highp vec4 lightScreenPosition;
-varying highp vec4 worldSpaceVertex;
-varying float lightDepth;
-varying float actualDepth;
-
-void main(void)
-{
- qt_TexCoord0 = texCoords;
-// onScreenPosition = matrix * vertex;
-//onScreenPosition = cameraCombinedMatrix * vertex; // works
- onScreenPosition = qt_ProjectionMatrix *
- qt_ModelViewMatrix
- * vertex;
-
- highp vec4 worldPosition = inverseCameraModelViewMatrix *
- qt_ModelViewMatrix * vertex;
-
-// lightScreenPosition = lightCombinedMatrix * vertex;
-// lightScreenPosition = lightCombinedMatrix * worldPosition;
- lightScreenPosition = lightProjectionMatrix * lightModelViewMatrix * vertex;
- lightDepth = lightScreenPosition.z;
-
- actualDepth = onScreenPosition.z;
-
- worldSpaceVertex = vertex;
-
-// gl_Position = qt_ProjectionMatrix * worldPosition;
-//gl_Position = onScreenPosition;
-gl_Position = onScreenPosition;
-// gl_Position = lightScreenPosition;
-};
diff --git a/demos/qt3d/cubehouse/shaders/objectlineartexgen.frag b/demos/qt3d/cubehouse/shaders/objectlineartexgen.frag
deleted file mode 100644
index a4439f28..00000000
--- a/demos/qt3d/cubehouse/shaders/objectlineartexgen.frag
+++ /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 module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-uniform sampler2D texture;
-varying highp vec4 texCoord;
-varying float facingProjector;
-
-void main(void)
-{
- vec2 clampedCoords = texCoord.st;
- clampedCoords = clamp(texCoord.st, vec2(0.0), vec2(1.0));
- vec4 textureColor = texture2D(texture, clampedCoords);
- gl_FragColor = vec4(textureColor.rgb * facingProjector, 1.0);
-};
diff --git a/demos/qt3d/cubehouse/shaders/objectlineartexgen.vert b/demos/qt3d/cubehouse/shaders/objectlineartexgen.vert
deleted file mode 100644
index b78b938c..00000000
--- a/demos/qt3d/cubehouse/shaders/objectlineartexgen.vert
+++ /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 module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-attribute highp vec4 qt_Vertex;
-attribute highp vec4 qt_Normal;
-uniform highp mat3 qt_NormalMatrix;
-uniform highp mat4 qt_ModelViewProjectionMatrix;
-
-uniform highp mat4 objectLinearTexgenMatrix;
-uniform highp vec4 projectorDirection;
-
-varying highp vec4 texCoord;
-varying float facingProjector;
-
-void main(void)
-{
- texCoord = objectLinearTexgenMatrix * qt_Vertex;
- vec4 normal = normalize(vec4(qt_NormalMatrix * vec3(qt_Vertex), qt_Vertex.w));
- // We're facing the projector if the normal and projector direction
- // are pointing in opposite directions, i.e. if their dot product
- // is negative.
- facingProjector = -dot(normalize(normal), normalize(projectorDirection));
- facingProjector = clamp(facingProjector, 0.0, 1.0);
- gl_Position = qt_ModelViewProjectionMatrix * qt_Vertex;
-};
diff --git a/demos/qt3d/pageflip/gradient.png b/demos/qt3d/pageflip/gradient.png
deleted file mode 100644
index ddadf69d..00000000
--- a/demos/qt3d/pageflip/gradient.png
+++ /dev/null
Binary files differ
diff --git a/demos/qt3d/pageflip/pageflip.cpp b/demos/qt3d/pageflip/pageflip.cpp
deleted file mode 100644
index a6e1f232..00000000
--- a/demos/qt3d/pageflip/pageflip.cpp
+++ /dev/null
@@ -1,388 +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 <QApplication>
-#include <QTimer>
-#include <QMouseEvent>
-#include "qglpainter.h"
-#include "qglabstracteffect.h"
-#include "qgltexture2d.h"
-#include "qglshaderprogrameffect.h"
-#include <QtOpenGL/qglshaderprogram.h>
-#include "pageflipmath_p.h"
-
-class PageFlipGradientEffect;
-
-class PageFlipView : public QGLWidget
-{
- Q_OBJECT
-public:
- PageFlipView(QWidget *parent = 0);
- ~PageFlipView();
-
- void setBlend(bool value) { blend = value; }
- void setVertical(bool value) { vertical = value; }
-
-protected:
- void resizeGL(int width, int height);
- void initializeGL();
- void paintGL();
- void mousePressEvent(QMouseEvent *e);
-
-private slots:
- void animate();
-
-private:
- bool blend;
- bool vertical;
-
- qreal posn; // Position within the animation - 0...1
- QSize pageSize; // Size of a page within the window.
-
- QRect pageRect1;
- QRect pageRect2;
-
- QColor colors[4];
- int colorIndex;
-
- QGLTexture2D textures[4];
-
- QGLTexture2D gradientTexture;
-
- PageFlipMath pageFlipMath;
-
- PageFlipGradientEffect *effect;
-
- void setAlphaValue(QGLPainter *painter, GLfloat value);
-};
-
-class PageFlipGradientEffect : public QGLShaderProgramEffect
-{
-public:
- PageFlipGradientEffect();
- ~PageFlipGradientEffect();
-
- void setAlphaValue(GLfloat value);
-};
-
-PageFlipView::PageFlipView(QWidget *parent)
- : QGLWidget(parent)
-{
- posn = 0.0f;
- blend = false;
- vertical = false;
-
- colors[0] = QColor(0, 192, 192, 255);
- colors[1] = QColor(192, 0, 0, 255);
- colors[2] = QColor(192, 192, 0, 255);
- colors[3] = QColor(128, 128, 0, 255);
- colorIndex = 0;
-
- QTimer *timer = new QTimer(this);
- connect(timer, SIGNAL(timeout()), this, SLOT(animate()));
- timer->start(40);
-
- effect = new PageFlipGradientEffect();
-}
-
-PageFlipView::~PageFlipView()
-{
- delete effect;
-}
-
-void PageFlipView::resizeGL(int width, int height)
-{
- glViewport(0, 0, width, height);
-}
-
-void PageFlipView::initializeGL()
-{
- QGLPainter painter(this);
-
- //QSize size = rect().size();
- //int width = size.width() / 3;
- //int height = (int)(width * 1.414f);
- int width = 227;
- int height = 320;
- pageSize = QSize(width, height);
-
- textures[0].setImage(QImage(QLatin1String(":/qqpage1.png")));
- textures[1].setImage(QImage(QLatin1String(":/qqpage2.png")));
- textures[2].setImage(QImage(QLatin1String(":/qqpage3.png")));
- textures[3].setImage(QImage(QLatin1String(":/qqpage4.png")));
-
- gradientTexture.setImage(QImage(QLatin1String(":/gradient.png")));
-
- 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);
-
- glEnable(GL_BLEND);
-
- if (vertical)
- pageFlipMath.setStartCorner(PageFlipMath::VerticalBottomRight);
- else
- pageFlipMath.setStartCorner(PageFlipMath::BottomRight);
-}
-
-void PageFlipView::paintGL()
-{
- QGLPainter painter(this);
-
- QRect rect = this->rect();
- int midx = rect.width() / 2;
- int topy = (rect.height() - pageSize.height()) / 2;
-
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- QMatrix4x4 projm;
- projm.ortho(rect);
- painter.projectionMatrix() = projm;
- painter.modelViewMatrix().setToIdentity();
-
- if (vertical) {
- pageRect2 = QRect(QPoint(midx - pageSize.width() / 2, topy), pageSize);
- pageRect1 = QRect(QPoint(pageRect2.x() - pageSize.width(), topy), pageSize);
- } else {
- pageRect1 = QRect(QPoint(midx - pageSize.width(), topy), pageSize);
- pageRect2 = QRect(QPoint(midx, topy), pageSize);
- }
- pageFlipMath.setPageRect(pageRect2);
- pageFlipMath.setShowPageReverse(false);
- pageFlipMath.compute(posn);
-
- QGLAttributeValue positions
- (2, GL_FLOAT, pageFlipMath.stride(), pageFlipMath.vertexArray());
- QGLAttributeValue texCoords
- (2, GL_FLOAT, pageFlipMath.stride(), pageFlipMath.vertexArray() + 2);
- QGLAttributeValue gradientCoords
- (1, GL_FLOAT, pageFlipMath.stride(), pageFlipMath.vertexArray() + 4);
-
- if (painter.isFixedFunction())
- painter.setStandardEffect(QGL::FlatReplaceTexture2D);
- else
- painter.setUserEffect(effect);
- painter.setColor(colors[colorIndex]);
- painter.glActiveTexture(GL_TEXTURE0);
- textures[colorIndex].bind();
- if (!painter.isFixedFunction()) {
- painter.glActiveTexture(GL_TEXTURE1);
- gradientTexture.bind();
- }
- painter.clearAttributes();
- painter.setVertexAttribute(QGL::Position, positions);
- painter.setVertexAttribute(QGL::TextureCoord0, texCoords);
- painter.setVertexAttribute(QGL::CustomVertex0, gradientCoords);
- setAlphaValue(&painter, 1.0f);
- painter.update();
- pageFlipMath.drawPage(0);
-
- painter.setColor(colors[(colorIndex + 1) % 4]);
- painter.glActiveTexture(GL_TEXTURE0);
- textures[(colorIndex + 1) % 4].bind();
- setAlphaValue(&painter, 1.0f);
- painter.update();
- pageFlipMath.drawPage(1);
-
- painter.setColor(colors[(colorIndex + 2) % 4]);
- if (!pageFlipMath.showPageReverse())
- textures[(colorIndex + 2) % 4].bind();
- if (blend)
- setAlphaValue(&painter, 0.75f);
- else
- setAlphaValue(&painter, 1.0f);
- painter.update();
- pageFlipMath.drawPage(2);
-
- painter.setColor(colors[(colorIndex + 3) % 4]);
- textures[(colorIndex + 3) % 4].bind();
- setAlphaValue(&painter, 1.0f);
- painter.update();
- pageFlipMath.drawPage(3);
-
- glBindTexture(GL_TEXTURE_2D, 0);
- painter.glActiveTexture(GL_TEXTURE1);
- glBindTexture(GL_TEXTURE_2D, 0);
-
- painter.setStandardEffect(QGL::FlatColor);
- painter.clearAttributes();
- painter.setVertexAttribute(QGL::Position, positions);
- painter.setVertexAttribute(QGL::TextureCoord0, texCoords);
- painter.setVertexAttribute(QGL::CustomVertex0, gradientCoords);
- painter.setColor(QColor(0, 0, 0, 255));
- painter.update();
- pageFlipMath.drawOutline(2);
-}
-
-void PageFlipView::mousePressEvent(QMouseEvent *e)
-{
- int x = e->x();
- int y = e->y();
- bool changed = true;
- if (vertical) {
- if (x >= pageRect2.x() && x < (pageRect2.x() + 20) &&
- y >= pageRect2.y() && y < (pageRect2.y() + 20))
- pageFlipMath.setStartCorner(PageFlipMath::VerticalTopLeft);
- else if (x >= pageRect2.x() && x < (pageRect2.x() + 20) &&
- y >= (pageRect2.bottom() - 20) && y <= pageRect2.bottom())
- pageFlipMath.setStartCorner(PageFlipMath::VerticalBottomLeft);
- else if (x >= (pageRect2.right() - 20) && x <= pageRect2.right() &&
- y >= pageRect2.y() && y < (pageRect2.y() + 20))
- pageFlipMath.setStartCorner(PageFlipMath::VerticalTopRight);
- else if (x >= (pageRect2.right() - 20) && x <= pageRect2.right() &&
- y >= (pageRect2.bottom() - 20) && y <= pageRect2.bottom())
- pageFlipMath.setStartCorner(PageFlipMath::VerticalBottomRight);
- else
- changed = false;
- } else {
- if (x >= pageRect1.x() && x < (pageRect1.x() + 20) &&
- y >= pageRect1.y() && y < (pageRect1.y() + 20))
- pageFlipMath.setStartCorner(PageFlipMath::TopLeft);
- else if (x >= pageRect1.x() && x < (pageRect1.x() + 20) &&
- y >= (pageRect1.bottom() - 20) && y <= pageRect1.bottom())
- pageFlipMath.setStartCorner(PageFlipMath::BottomLeft);
- else if (x >= pageRect2.x() && x < (pageRect2.x() + 20) &&
- y >= pageRect2.y() && y < (pageRect2.y() + 20))
- pageFlipMath.setStartCorner(PageFlipMath::TopLeftOnePage);
- else if (x >= pageRect2.x() && x < (pageRect2.x() + 20) &&
- y >= (pageRect2.bottom() - 20) && y <= pageRect2.bottom())
- pageFlipMath.setStartCorner(PageFlipMath::BottomLeftOnePage);
- else if (x >= (pageRect2.right() - 20) && x <= pageRect2.right() &&
- y >= pageRect2.y() && y < (pageRect2.y() + 20))
- pageFlipMath.setStartCorner(PageFlipMath::TopRight);
- else if (x >= (pageRect2.right() - 20) && x <= pageRect2.right() &&
- y >= (pageRect2.bottom() - 20) && y <= pageRect2.bottom())
- pageFlipMath.setStartCorner(PageFlipMath::BottomRight);
- else
- changed = false;
- }
- if (changed)
- posn = 0.0f;
- QGLWidget::mousePressEvent(e);
-}
-
-void PageFlipView::animate()
-{
- posn += 0.04f;
- if (posn >= 1.0f) {
- posn = 0.0f;
- colorIndex = (colorIndex + 2) % 4;
- }
- updateGL();
-}
-
-void PageFlipView::setAlphaValue(QGLPainter *painter, GLfloat value)
-{
- if (!painter->isFixedFunction())
- effect->setAlphaValue(value);
-}
-
-static char const gradientVertexShader[] =
- "attribute highp vec4 qt_Vertex;\n"
- "attribute highp vec4 qt_MultiTexCoord0;\n"
- "attribute highp float qt_Custom0;\n"
- "uniform mediump mat4 qt_ModelViewProjectionMatrix;\n"
- "varying highp vec4 qt_TexCoord0;\n"
- "varying highp float qGradCtrl;\n"
- "void main(void)\n"
- "{\n"
- " gl_Position = qt_ModelViewProjectionMatrix * qt_Vertex;\n"
- " qt_TexCoord0 = qt_MultiTexCoord0;\n"
- " qGradCtrl = qt_Custom0;\n"
- "}\n";
-
-static char const gradientFragmentShader[] =
- "uniform sampler2D qt_Texture0;\n"
- "uniform sampler2D qt_Texture1;\n"
- "uniform mediump float alphaValue;\n"
- "varying highp vec4 qt_TexCoord0;\n"
- "varying highp float qGradCtrl;\n"
- "void main(void)\n"
- "{\n"
- " mediump vec4 col = texture2D(qt_Texture0, qt_TexCoord0.st);\n"
- " mediump vec4 gradcol = texture2D(qt_Texture1, vec2(qGradCtrl, qt_TexCoord0.t));\n"
- " gl_FragColor = vec4((col * gradcol).xyz, alphaValue);\n"
- "}\n";
-
-PageFlipGradientEffect::PageFlipGradientEffect()
-{
- setVertexShader(gradientVertexShader);
- setFragmentShader(gradientFragmentShader);
-}
-
-PageFlipGradientEffect::~PageFlipGradientEffect()
-{
-}
-
-void PageFlipGradientEffect::setAlphaValue(GLfloat value)
-{
- program()->setUniformValue("alphaValue", value);
-}
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
- PageFlipView view;
- if (QApplication::arguments().contains(QLatin1String("-blend")))
- view.setBlend(true);
- if (QApplication::arguments().contains(QLatin1String("-vertical")))
- view.setVertical(true);
-
-
-#ifdef Q_OS_SYMBIAN
- view.setAttribute(Qt::WA_LockLandscapeOrientation, true);
- view.showFullScreen();
-#else
- if (QApplication::arguments().contains(QLatin1String("-maximize")))
- view.showMaximized();
- else if (QApplication::arguments().contains(QLatin1String("-fullscreen")))
- view.showFullScreen();
- else
- view.show();
-#endif
-
- return app.exec();
-}
-
-#include "pageflip.moc"
diff --git a/demos/qt3d/pageflip/pageflip.desktop b/demos/qt3d/pageflip/pageflip.desktop
deleted file mode 100644
index 4ee69dad..00000000
--- a/demos/qt3d/pageflip/pageflip.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=Pageflip
-Icon=/usr/share/icons/hicolor/80x80/apps/qt3d.png
-Exec=/usr/bin/invoker --type=e -s /usr/bin/pageflip -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_pageflip
diff --git a/demos/qt3d/pageflip/pageflip.pro b/demos/qt3d/pageflip/pageflip.pro
deleted file mode 100644
index cdcfd4f9..00000000
--- a/demos/qt3d/pageflip/pageflip.pro
+++ /dev/null
@@ -1,17 +0,0 @@
-TEMPLATE = app
-TARGET = pageflip
-CONFIG += qt warn_on
-
-CONFIG += qt3d_deploy_pkg
-include(../../../pkg.pri)
-
-SOURCES = pageflip.cpp pageflipmath.cpp
-HEADERS = pageflipmath_p.h
-RESOURCES = pageflip.qrc
-
-OTHER_FILES += \
- pageflip.rc \
- pageflip.desktop
-
-RC_FILE = pageflip.rc
-
diff --git a/demos/qt3d/pageflip/pageflip.qrc b/demos/qt3d/pageflip/pageflip.qrc
deleted file mode 100644
index 1584add5..00000000
--- a/demos/qt3d/pageflip/pageflip.qrc
+++ /dev/null
@@ -1,9 +0,0 @@
-<!DOCTYPE RCC><RCC version="1.0">
-<qresource>
- <file>qqpage1.png</file>
- <file>qqpage2.png</file>
- <file>qqpage3.png</file>
- <file>qqpage4.png</file>
- <file>gradient.png</file>
-</qresource>
-</RCC>
diff --git a/demos/qt3d/pageflip/pageflip.rc b/demos/qt3d/pageflip/pageflip.rc
deleted file mode 100644
index b40ecdc1..00000000
--- a/demos/qt3d/pageflip/pageflip.rc
+++ /dev/null
@@ -1 +0,0 @@
-IDI_ICON1 ICON DISCARDABLE "qt3d.ico"
diff --git a/demos/qt3d/pageflip/pageflipmath.cpp b/demos/qt3d/pageflip/pageflipmath.cpp
deleted file mode 100644
index afb66dbc..00000000
--- a/demos/qt3d/pageflip/pageflipmath.cpp
+++ /dev/null
@@ -1,592 +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 "pageflipmath_p.h"
-#include <QtCore/qmath.h>
-
-QT_BEGIN_NAMESPACE
-
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-
-PageFlipMath::PageFlipMath()
-{
- m_showPageReverse = false;
- m_startCorner = BottomRight;
-
- qMemSet(vertices, 0, sizeof(vertices));
- qMemSet(pageCount, 0, sizeof(pageCount));
-}
-
-PageFlipMath::~PageFlipMath()
-{
-}
-
-void PageFlipMath::drawPage(int page) const
-{
- if (page < 0 || page >= 4 || pageCount[page] == 0)
- return;
- glDrawArrays(GL_TRIANGLE_FAN, page * 5, pageCount[page]);
-}
-
-void PageFlipMath::drawOutline(int page) const
-{
- if (page < 0 || page >= 4 || pageCount[page] == 0)
- return;
- glDrawArrays(GL_LINE_LOOP, page * 5, pageCount[page]);
-}
-
-void PageFlipMath::compute(qreal t)
-{
- int page, vertex;
-
- // Compute the relative vertices for position t.
- if (m_startCorner < VerticalBottomRight)
- flip(m_pageRect.width() - 1, m_pageRect.height() - 1, t);
- else
- flip(m_pageRect.height() - 1, m_pageRect.width() - 1, t);
-
- // Deal with starting corner issues by swapping co-ordinates.
- switch (m_startCorner) {
-
- case BottomRight: break;
-
- case TopRight:
- for (page = 0; page < 4; ++page) {
- for (vertex = 0; vertex < pageCount[page]; ++vertex) {
- vertices[page][vertex][1]
- = m_pageRect.height() - 1 - vertices[page][vertex][1];
- vertices[page][vertex][3]
- = 1.0f - vertices[page][vertex][3];
- }
- }
- break;
-
- case BottomLeft:
- for (page = 0; page < 4; ++page) {
- for (vertex = 0; vertex < pageCount[page]; ++vertex) {
- vertices[page][vertex][0]
- = m_pageRect.width() - 1 - vertices[page][vertex][0];
- vertices[page][vertex][0] -= m_pageRect.width();
- vertices[page][vertex][2]
- = 1.0f - vertices[page][vertex][2];
- }
- }
- break;
-
- case TopLeft:
- for (page = 0; page < 4; ++page) {
- for (vertex = 0; vertex < pageCount[page]; ++vertex) {
- vertices[page][vertex][0]
- = m_pageRect.width() - 1 - vertices[page][vertex][0];
- vertices[page][vertex][0] -= m_pageRect.width();
- vertices[page][vertex][1]
- = m_pageRect.height() - 1 - vertices[page][vertex][1];
- vertices[page][vertex][2]
- = 1.0f - vertices[page][vertex][2];
- vertices[page][vertex][3]
- = 1.0f - vertices[page][vertex][3];
- }
- }
- break;
-
- case BottomLeftOnePage:
- for (page = 1; page < 4; ++page) {
- for (vertex = 0; vertex < pageCount[page]; ++vertex) {
- vertices[page][vertex][0]
- = m_pageRect.width() - 1 - vertices[page][vertex][0];
- vertices[page][vertex][2]
- = 1.0f - vertices[page][vertex][2];
- }
- }
- break;
-
- case TopLeftOnePage:
- for (page = 1; page < 4; ++page) {
- for (vertex = 0; vertex < pageCount[page]; ++vertex) {
- vertices[page][vertex][0]
- = m_pageRect.width() - 1 - vertices[page][vertex][0];
- vertices[page][vertex][1]
- = m_pageRect.height() - 1 - vertices[page][vertex][1];
- vertices[page][vertex][2]
- = 1.0f - vertices[page][vertex][2];
- vertices[page][vertex][3]
- = 1.0f - vertices[page][vertex][3];
- }
- }
- break;
-
- case VerticalBottomRight:
- for (page = 0; page < 4; ++page) {
- for (vertex = 0; vertex < pageCount[page]; ++vertex) {
- qSwap(vertices[page][vertex][0], vertices[page][vertex][1]);
- vertices[page][vertex][0]
- = m_pageRect.width() - 1 - vertices[page][vertex][0];
- vertices[page][vertex][1]
- = m_pageRect.height() - 1 - vertices[page][vertex][1];
- qSwap(vertices[page][vertex][2], vertices[page][vertex][3]);
- vertices[page][vertex][2]
- = 1.0f - vertices[page][vertex][2];
- vertices[page][vertex][3]
- = 1.0f - vertices[page][vertex][3];
- }
- }
- break;
-
- case VerticalTopRight:
- for (page = 0; page < 4; ++page) {
- for (vertex = 0; vertex < pageCount[page]; ++vertex) {
- qSwap(vertices[page][vertex][0], vertices[page][vertex][1]);
- vertices[page][vertex][0]
- = m_pageRect.width() - 1 - vertices[page][vertex][0];
- qSwap(vertices[page][vertex][2], vertices[page][vertex][3]);
- vertices[page][vertex][2]
- = 1.0f - vertices[page][vertex][2];
- }
- }
- break;
-
- case VerticalBottomLeft:
- for (page = 0; page < 4; ++page) {
- for (vertex = 0; vertex < pageCount[page]; ++vertex) {
- qSwap(vertices[page][vertex][0], vertices[page][vertex][1]);
- vertices[page][vertex][1]
- = m_pageRect.height() - 1 - vertices[page][vertex][1];
- qSwap(vertices[page][vertex][2], vertices[page][vertex][3]);
- vertices[page][vertex][3]
- = 1.0f - vertices[page][vertex][3];
- }
- }
- break;
-
- case VerticalTopLeft:
- for (page = 0; page < 4; ++page) {
- for (vertex = 0; vertex < pageCount[page]; ++vertex) {
- qSwap(vertices[page][vertex][0], vertices[page][vertex][1]);
- qSwap(vertices[page][vertex][2], vertices[page][vertex][3]);
- }
- }
- break;
- }
-
- // Adjust the vertices for the final rectangle position.
- for (page = 0; page < 4; ++page) {
- for (vertex = 0; vertex < pageCount[page]; ++vertex) {
- vertices[page][vertex][0] += m_pageRect.x();
- vertices[page][vertex][1]
- = m_pageRect.y() +
- (m_pageRect.height() - 1 - vertices[page][vertex][1]);
- }
- }
-
- // Flip the x texture co-ordinates for page 2 if showing the page reverse.
- if (m_showPageReverse) {
- if (m_startCorner < VerticalBottomRight) {
- for (int vertex = 0; vertex < pageCount[2]; ++vertex)
- vertices[2][vertex][2] = 1.0f - vertices[2][vertex][2];
- } else {
- for (int vertex = 0; vertex < pageCount[2]; ++vertex)
- vertices[2][vertex][3] = 1.0f - vertices[2][vertex][3];
- }
- }
-}
-
-// Page 1 is the reference page and extends from the bottom-left
-// corner at (0, 0) to the top-right corner at (pageWidth, pageHeight).
-// The flip starts at the bottom-right corner and proceeds leftwards
-// across the page. All other flip directions and starting corners
-// can be derived from this basic reference flip animation.
-void PageFlipMath::flip(qreal pageWidth, qreal pageHeight, qreal t)
-{
- // Handle the simple start and end position cases first.
- if (t <= 0.0f) {
- // Starting position: pages 0 and 1 in their rest states
- // and pages 2 and 3 not visible.
- pageCount[0] = 4;
- pageCount[1] = 4;
- pageCount[2] = 0;
- pageCount[3] = 0;
-
- vertices[0][0][0] = -pageWidth; // corner 0 at (-pageWidth, 0)
- vertices[0][0][1] = 0.0f;
- vertices[0][0][2] = 0.0f; // texture co-ordinate
- vertices[0][0][3] = 0.0f;
- vertices[0][0][4] = 0.0f; // gradient control
-
- vertices[0][1][0] = 0.0f; // corner 1 at (0, 0)
- vertices[0][1][1] = 0.0f;
- vertices[0][1][2] = 1.0f;
- vertices[0][1][3] = 0.0f;
- vertices[0][1][4] = 1.0f; // gradient along fold on the right
-
- vertices[0][2][0] = 0.0f; // corner 2 at (0, pageHeight)
- vertices[0][2][1] = pageHeight;
- vertices[0][2][2] = 1.0f;
- vertices[0][2][3] = 1.0f;
- vertices[0][2][4] = 1.0f;
-
- vertices[0][3][0] = -pageWidth; // corner 3 at (-pageWidth, pageHeight)
- vertices[0][3][1] = pageHeight;
- vertices[0][3][2] = 0.0f;
- vertices[0][3][3] = 1.0f;
- vertices[0][3][4] = 0.0f;
-
- vertices[1][0][0] = 0.0f; // corner 0 at (0, 0)
- vertices[1][0][1] = 0.0f;
- vertices[1][0][2] = 0.0f; // texture co-ordinate
- vertices[1][0][3] = 0.0f;
- vertices[1][0][4] = 1.0f; // gradient along fold on the left
-
- vertices[1][1][0] = pageWidth; // corner 1 at (pageWidth, 0)
- vertices[1][1][1] = 0.0f;
- vertices[1][1][2] = 1.0f;
- vertices[1][1][3] = 0.0f;
- vertices[1][1][4] = 0.0f;
-
- vertices[1][2][0] = pageWidth; // corner 2 at (pageWidth, pageHeight)
- vertices[1][2][1] = pageHeight;
- vertices[1][2][2] = 1.0f;
- vertices[1][2][3] = 1.0f;
- vertices[1][2][4] = 0.0f;
-
- vertices[1][3][0] = 0.0f; // corner 3 at (0, pageHeight)
- vertices[1][3][1] = pageHeight;
- vertices[1][3][2] = 0.0f;
- vertices[1][3][3] = 1.0f;
- vertices[1][3][4] = 1.0f;
- return;
- } else if (t >= 1.0f) {
- // Ending position: pages 0 and 1 are not visible, but
- // pages 2 and 3 are visible in the rest states.
- pageCount[0] = 0;
- pageCount[1] = 0;
- pageCount[2] = 4;
- pageCount[3] = 4;
-
- vertices[2][0][0] = -pageWidth; // corner 0 at (-pageWidth, 0)
- vertices[2][0][1] = 0.0f;
- vertices[2][0][2] = 0.0f; // texture co-ordinate
- vertices[2][0][3] = 0.0f;
- vertices[2][0][4] = 0.0f; // gradient control
-
- vertices[2][1][0] = 0.0f; // corner 1 at (0, 0)
- vertices[2][1][1] = 0.0f;
- vertices[2][1][2] = 1.0f;
- vertices[2][1][3] = 0.0f;
- vertices[2][1][4] = 1.0f; // gradient along fold on the right
-
- vertices[2][2][0] = 0.0f; // corner 2 at (0, pageHeight)
- vertices[2][2][1] = pageHeight;
- vertices[2][2][2] = 1.0f;
- vertices[2][2][3] = 1.0f;
- vertices[2][2][4] = 1.0f;
-
- vertices[2][3][0] = -pageWidth; // corner 3 at (-pageWidth, pageHeight)
- vertices[2][3][1] = pageHeight;
- vertices[2][3][2] = 0.0f;
- vertices[2][3][3] = 1.0f;
- vertices[2][3][4] = 0.0f;
-
- vertices[3][0][0] = 0.0f; // corner 0 at (0, 0)
- vertices[3][0][1] = 0.0f;
- vertices[3][0][2] = 0.0f; // texture co-ordinate
- vertices[3][0][3] = 0.0f;
- vertices[3][0][4] = 1.0f; // gradient along fold on the left
-
- vertices[3][1][0] = pageWidth; // corner 1 at (pageWidth, 0)
- vertices[3][1][1] = 0.0f;
- vertices[3][1][2] = 1.0f;
- vertices[3][1][3] = 0.0f;
- vertices[3][1][4] = 0.0f;
-
- vertices[3][2][0] = pageWidth; // corner 2 at (pageWidth, pageHeight)
- vertices[3][2][1] = pageHeight;
- vertices[3][2][2] = 1.0f;
- vertices[3][2][3] = 1.0f;
- vertices[3][2][4] = 0.0f;
-
- vertices[3][3][0] = 0.0f; // corner 3 at (0, pageHeight)
- vertices[3][3][1] = pageHeight;
- vertices[3][3][2] = 0.0f;
- vertices[3][3][3] = 1.0f;
- vertices[3][3][4] = 1.0f;
- return;
- }
-
- // Page 0 is the same for all other animation positions.
- pageCount[0] = 4;
-
- vertices[0][0][0] = -pageWidth; // corner 0 at (-pageWidth, 0)
- vertices[0][0][1] = 0.0f;
- vertices[0][0][2] = 0.0f; // texture co-ordinate
- vertices[0][0][3] = 0.0f;
- vertices[0][0][4] = 0.0f; // gradient control
-
- vertices[0][1][0] = 0.0f; // corner 1 at (0, 0)
- vertices[0][1][1] = 0.0f;
- vertices[0][1][2] = 1.0f;
- vertices[0][1][3] = 0.0f;
- vertices[0][1][4] = 1.0f; // gradient along fold on the right
-
- vertices[0][2][0] = 0.0f; // corner 2 at (0, pageHeight)
- vertices[0][2][1] = pageHeight;
- vertices[0][2][2] = 1.0f;
- vertices[0][2][3] = 1.0f;
- vertices[0][2][4] = 1.0f;
-
- vertices[0][3][0] = -pageWidth; // corner 3 at (-pageWidth, pageHeight)
- vertices[0][3][1] = pageHeight;
- vertices[0][3][2] = 0.0f;
- vertices[0][3][3] = 1.0f;
- vertices[0][3][4] = 0.0f;
-
- // Get the angle of the "curling" dividing line to the bottom of the page.
- // Basically: 45deg + (45deg * t) = 45deg * (1 + t), where t is between
- // 0 and 1 but is neither 0 nor 1.
- qreal angle = (M_PI / 4.0f) * (1.0f + t);
-
- // We need the cos and sin of both the angle and angle * 2.
- qreal cosAngle = qCos(angle);
- qreal sinAngle = qSin(angle);
- qreal cosAngle2 = qCos(angle * 2.0f);
- qreal sinAngle2 = qSin(angle * 2.0f);
-
- // Find the reference point. This is the point along the bottom of
- // the page where the dividing line intersects the page bottom.
- qreal refx = pageWidth * (1.0f - t);
- qreal refy = 0.0f;
-
- // Distance from the reference point to the right side of the page.
- qreal d = pageWidth - refx;
-
- // Determine the intersection of the dividing line with the
- // top of the page. If the intersection is not on the page (k >= d),
- // then we need to generate similar triangles. If the intersection is
- // on the page (k < d), then we need to generate similar trapezoids.
- qreal k = (pageHeight * cosAngle) / sinAngle;
- if (k >= d) {
- // Generate similar triangles. Find the intersection with
- // the right-hand side of the page at x == pageWidth.
- qreal intx = pageWidth;
- qreal inty = refy + (d * sinAngle) / cosAngle;
-
- // Find the opposite triangle corner on the back page.
- qreal oppx = refx + d * cosAngle2;
- qreal oppy = refy + d * sinAngle2;
-
- // Generate vertices and texture co-ordinates for the back page.
- qreal texa = 1.0f - (d * sinAngle) / (pageHeight * cosAngle);
- qreal texb = d / pageWidth;
- vertices[2][0][0] = intx;
- vertices[2][0][1] = inty;
- vertices[2][0][2] = 0.0f;
- vertices[2][0][3] = 1.0f - texa;
- vertices[2][0][4] = 1.0f;
-
- vertices[2][1][0] = oppx;
- vertices[2][1][1] = oppy;
- vertices[2][1][2] = 0.0f;
- vertices[2][1][3] = 0.0f;
- vertices[2][1][4] = 1.0f - texb;
-
- vertices[2][2][0] = refx;
- vertices[2][2][1] = refy;
- vertices[2][2][2] = texb;
- vertices[2][2][3] = 0.0f;
- vertices[2][2][4] = 1.0f;
-
- pageCount[2] = 3;
-
- // Generate vertices and texture co-ordinates for the next page.
- vertices[3][0][0] = intx;
- vertices[3][0][1] = inty;
- vertices[3][0][2] = 1.0f;
- vertices[3][0][3] = 1.0f - texa;
- vertices[3][0][4] = 1.0f;
-
- vertices[3][1][0] = refx;
- vertices[3][1][1] = refy;
- vertices[3][1][2] = 1.0f - texb;
- vertices[3][1][3] = 0.0f;
- vertices[3][1][4] = 1.0f;
-
- vertices[3][2][0] = pageWidth;
- vertices[3][2][1] = 0.0f;
- vertices[3][2][2] = 1.0f;
- vertices[3][2][3] = 0.0f;
- vertices[3][2][4] = 1.0f - texb;
-
- pageCount[3] = 3;
-
- // Set page 1's vertices to clip off pixels we don't need to draw.
- vertices[1][0][0] = 0.0f;
- vertices[1][0][1] = 0.0f;
- vertices[1][0][2] = 0.0f;
- vertices[1][0][3] = 0.0f;
- vertices[1][0][4] = 1.0f;
-
- vertices[1][1][0] = pageWidth - d;
- vertices[1][1][1] = 0.0f;
- vertices[1][1][2] = 1.0f - texb;
- vertices[1][1][3] = 0.0f;
- vertices[1][1][4] = texb;
-
- vertices[1][2][0] = intx;
- vertices[1][2][1] = inty;
- vertices[1][2][2] = 1.0f;
- vertices[1][2][3] = 1.0f - texa;
- vertices[1][2][4] = 0.0f;
-
- vertices[1][3][0] = pageWidth;
- vertices[1][3][1] = pageHeight;
- vertices[1][3][2] = 1.0f;
- vertices[1][3][3] = 1.0f;
- vertices[1][3][4] = 0.0f;
-
- vertices[1][4][0] = 0.0f;
- vertices[1][4][1] = pageHeight;
- vertices[1][4][2] = 0.0f;
- vertices[1][4][3] = 1.0f;
- vertices[1][4][4] = 1.0f;
-
- pageCount[1] = 5;
- } else {
- // Generate similar trapezoids. Find the intersection with
- // the top of the page at y == pageHeight.
- qreal intx = refx + (pageHeight * cosAngle) / sinAngle;
- qreal inty = pageHeight;
-
- // Get the distance between the intersection and the right of the page.
- qreal e = pageWidth - intx;
-
- // Find the opposite trapezoid corners to "ref" and "int".
- qreal opprefx = refx + d * cosAngle2;
- qreal opprefy = refy + d * sinAngle2;
- qreal oppintx = intx + e * cosAngle2;
- qreal oppinty = inty + e * sinAngle2;
-
- // Generate vertices and texture co-ordinates for the back page.
- qreal texa = e / pageWidth;
- qreal texb = d / pageWidth;
- vertices[2][0][0] = intx;
- vertices[2][0][1] = inty;
- vertices[2][0][2] = texa;
- vertices[2][0][3] = 1.0f;
- vertices[2][0][4] = 1.0f;
-
- vertices[2][1][0] = oppintx;
- vertices[2][1][1] = oppinty;
- vertices[2][1][2] = 0.0f;
- vertices[2][1][3] = 1.0f;
- vertices[2][1][4] = 1.0f - texa;
-
- vertices[2][2][0] = opprefx;
- vertices[2][2][1] = opprefy;
- vertices[2][2][2] = 0.0f;
- vertices[2][2][3] = 0.0f;
- vertices[2][2][4] = 1.0f - texb;
-
- vertices[2][3][0] = refx;
- vertices[2][3][1] = refy;
- vertices[2][3][2] = texb;
- vertices[2][3][3] = 0.0f;
- vertices[2][3][4] = 1.0f;
-
- pageCount[2] = 4;
-
- // Generate vertices and texture co-ordinates for the next page.
- vertices[3][0][0] = intx;
- vertices[3][0][1] = inty;
- vertices[3][0][2] = 1.0f - texa;
- vertices[3][0][3] = 1.0f;
- vertices[3][0][4] = 1.0f;
-
- vertices[3][1][0] = refx;
- vertices[3][1][1] = refy;
- vertices[3][1][2] = 1.0f - texb;
- vertices[3][1][3] = 0.0f;
- vertices[3][1][4] = 1.0f;
-
- vertices[3][2][0] = pageWidth;
- vertices[3][2][1] = 0.0f;
- vertices[3][2][2] = 1.0f;
- vertices[3][2][3] = 0.0f;
- vertices[3][2][4] = 1.0f - texb;
-
- vertices[3][3][0] = pageWidth;
- vertices[3][3][1] = pageHeight;
- vertices[3][3][2] = 1.0f;
- vertices[3][3][3] = 1.0f;
- vertices[3][3][4] = 1.0f - texa;
-
- pageCount[3] = 4;
-
- // Set page 1's vertices to clip off pixels we don't need to draw.
- vertices[1][0][0] = 0.0f;
- vertices[1][0][1] = 0.0f;
- vertices[1][0][2] = 0.0f;
- vertices[1][0][3] = 0.0f;
- vertices[1][0][4] = 1.0f;
-
- vertices[1][1][0] = pageWidth - d;
- vertices[1][1][1] = 0.0f;
- vertices[1][1][2] = 1.0f - texb;
- vertices[1][1][3] = 0.0f;
- vertices[1][1][4] = texb;
-
- vertices[1][2][0] = pageWidth - e;
- vertices[1][2][1] = pageHeight;
- vertices[1][2][2] = 1.0f - texa;
- vertices[1][2][3] = 1.0f;
- vertices[1][2][4] = texa;
-
- vertices[1][3][0] = 0.0f;
- vertices[1][3][1] = pageHeight;
- vertices[1][3][2] = 0.0f;
- vertices[1][3][3] = 1.0f;
- vertices[1][3][4] = 1.0f;
-
- pageCount[1] = 4;
- }
-}
-
-QT_END_NAMESPACE
diff --git a/demos/qt3d/pageflip/pageflipmath_p.h b/demos/qt3d/pageflip/pageflipmath_p.h
deleted file mode 100644
index 21280b05..00000000
--- a/demos/qt3d/pageflip/pageflipmath_p.h
+++ /dev/null
@@ -1,120 +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 PAGEFLIPMATH_P_H
-#define PAGEFLIPMATH_P_H
-
-#include <QtOpenGL/qgl.h>
-
-QT_BEGIN_NAMESPACE
-
-class PageFlipMath
-{
-public:
- PageFlipMath();
- ~PageFlipMath();
-
- enum StartCorner
- {
- BottomRight,
- TopRight,
- BottomLeft,
- TopLeft,
- BottomLeftOnePage,
- TopLeftOnePage,
- VerticalBottomRight,
- VerticalTopRight,
- VerticalBottomLeft,
- VerticalTopLeft
- };
-
- // Corner to start flipping from.
- StartCorner startCorner() const { return m_startCorner; }
- void setStartCorner(StartCorner value) { m_startCorner = value; }
-
- // Rectangle to display the main page (usually the one on the right).
- QRect pageRect() const { return m_pageRect; }
- void setPageRect(const QRect& rect) { m_pageRect = rect; }
-
- // Show the reverse of the right-hand page on the back when
- // flipping pages. That is, the user will essentially see
- // the texture on the front of the page "through" it in reverse
- // while it is being flipped.
- bool showPageReverse() const { return m_showPageReverse; }
- void setShowPageReverse(bool value) { m_showPageReverse = value; }
-
- // Get the vertex array pointer.
- const GLfloat *vertexArray() const { return vertices[0][0]; }
-
- // Get the vertex array stride in bytes.
- int stride() const { return 5 * sizeof(GLfloat); }
-
- // Draw a specific page.
- void drawPage(int page) const;
-
- // Draw the outline of a page as a set of lines.
- void drawOutline(int page) const;
-
- // Compute the frame at position t (0...1) in the animation.
- void compute(qreal t);
-
-private:
- StartCorner m_startCorner;
- QRect m_pageRect;
- bool m_showPageReverse;
-
- // Vertex array: up to 4 pages, with up to 5 vertices per page,
- // and 5 components (2D position, 2D texcoord, 1D gradient control)
- // per vertex. The gradient control value is interpolated between
- // 0 and 1 - it is 1 at the fold point and 0 on the side of the page
- // opposite the fold point. Shaders can use this to extract a color
- // value from a gradient texture to blend with the page texture.
- GLfloat vertices[4][5][5];
-
- // Number of vertices for drawing the triangle fan for each page.
- int pageCount[4];
-
- void flip(qreal pageWidth, qreal pageHeight, qreal t);
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/demos/qt3d/pageflip/qqpage1.png b/demos/qt3d/pageflip/qqpage1.png
deleted file mode 100644
index 8abf37d9..00000000
--- a/demos/qt3d/pageflip/qqpage1.png
+++ /dev/null
Binary files differ
diff --git a/demos/qt3d/pageflip/qqpage2.png b/demos/qt3d/pageflip/qqpage2.png
deleted file mode 100644
index afd1b047..00000000
--- a/demos/qt3d/pageflip/qqpage2.png
+++ /dev/null
Binary files differ
diff --git a/demos/qt3d/pageflip/qqpage3.png b/demos/qt3d/pageflip/qqpage3.png
deleted file mode 100644
index fa2a85a0..00000000
--- a/demos/qt3d/pageflip/qqpage3.png
+++ /dev/null
Binary files differ
diff --git a/demos/qt3d/pageflip/qqpage4.png b/demos/qt3d/pageflip/qqpage4.png
deleted file mode 100644
index 0a6ba7b0..00000000
--- a/demos/qt3d/pageflip/qqpage4.png
+++ /dev/null
Binary files differ
diff --git a/demos/qt3d/pageflip/qt3d.ico b/demos/qt3d/pageflip/qt3d.ico
deleted file mode 100644
index e6442baf..00000000
--- a/demos/qt3d/pageflip/qt3d.ico
+++ /dev/null
Binary files differ
diff --git a/demos/qt3d/pageflip/qt3d.png b/demos/qt3d/pageflip/qt3d.png
deleted file mode 100644
index 21ec0176..00000000
--- a/demos/qt3d/pageflip/qt3d.png
+++ /dev/null
Binary files differ
diff --git a/demos/qt3d/photobrowser3d/buttons.cpp b/demos/qt3d/photobrowser3d/buttons.cpp
deleted file mode 100644
index 16373e65..00000000
--- a/demos/qt3d/photobrowser3d/buttons.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 "buttons.h"
-#include "qglpainter.h"
-
-Buttons::Buttons(QObject *parent, QGLMaterialCollection *palette)
- : QGLSceneNode(parent)
-{
- setObjectName("Buttons");
- setPalette(palette);
- setOption(QGLSceneNode::CullBoundingBox, false);
-
- m_left = new QGLSceneNode(this);
- m_left->setObjectName("Left Button");
- m_right = new QGLSceneNode(this);
- m_right->setObjectName("Right Button");
-
- QGLMaterial *mat = new QGLMaterial;
- QImage im(":/controls/arrows-left.png");
- m_size = im.size();
- QGLTexture2D *tex = new QGLTexture2D(mat);
- tex->setImage(im);
- mat->setTexture(tex);
-
- setMaterial(mat);
- setEffect(QGL::FlatReplaceTexture2D);
-
- QGeometryData data;
- QSize f = im.size() / 2;
- QVector2D a(-f.width(), -f.height());
- QVector2D b(f.width(), -f.height());
- QVector2D c(f.width(), f.height());
- QVector2D d(-f.width(), f.height());
- QVector2D ta(0, 1);
- QVector2D tb(1, 1);
- QVector2D tc(1, 0);
- QVector2D td(0, 0);
- data.appendVertex(a, b, c, d);
- data.appendTexCoord(ta, tb, tc, td);
- data.appendIndices(0, 1, 2);
- data.appendIndices(0, 2, 3);
-
- // the right hand arrow geometry is same as above, flipped X <-> -X
- data.appendGeometry(data);
- data.texCoord(4).setX(1);
- data.texCoord(5).setX(0);
- data.texCoord(6).setX(0);
- data.texCoord(7).setX(1);
- data.appendIndices(4, 5, 6);
- data.appendIndices(4, 6, 7);
-
- m_left->setGeometry(data);
- m_left->setCount(6);
- m_left->setOption(QGLSceneNode::CullBoundingBox, false);
-
- m_right->setGeometry(data);
- m_right->setStart(6);
- m_right->setCount(6);
- m_left->setOption(QGLSceneNode::CullBoundingBox, false);
-}
-
-void Buttons::draw(QGLPainter *painter)
-{
- painter->projectionMatrix().push();
- painter->modelViewMatrix().push();
-
- QRect rect = painter->currentSurface()->viewportRect();
- QMatrix4x4 projm;
- projm.ortho(rect);
- painter->projectionMatrix() = projm;
- painter->modelViewMatrix().setToIdentity();
-
- if (m_left->position().isNull())
- {
- QVector2D pos(m_size.width() / 2, rect.height() - m_size.height() / 2);
- m_left->setPosition(pos);
- pos.setX(rect.width() - (m_size.width() / 2));
- m_right->setPosition(pos);
- }
-
- glDisable(GL_DEPTH_TEST);
-
- QGLSceneNode::draw(painter);
-
- glEnable(GL_DEPTH_TEST);
-
- painter->projectionMatrix().pop();
- painter->modelViewMatrix().pop();
-}
-
-void Buttons::clearPositions()
-{
- m_left->setPosition(QVector3D());
- m_right->setPosition(QVector3D());
-}
diff --git a/demos/qt3d/photobrowser3d/buttons.h b/demos/qt3d/photobrowser3d/buttons.h
deleted file mode 100644
index 1d0155c2..00000000
--- a/demos/qt3d/photobrowser3d/buttons.h
+++ /dev/null
@@ -1,62 +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 BUTTONS_H
-#define BUTTONS_H
-
-#include "qglscenenode.h"
-
-#include <Qt>
-
-class Buttons : public QGLSceneNode
-{
- Q_OBJECT
-public:
- explicit Buttons(QObject *parent, QGLMaterialCollection *palette);
- void draw(QGLPainter *painter);
- void clearPositions();
-private:
- QGLSceneNode *m_left;
- QGLSceneNode *m_right;
- QSize m_size;
-};
-
-#endif // BUTTONS_H
diff --git a/demos/qt3d/photobrowser3d/bytereader.cpp b/demos/qt3d/photobrowser3d/bytereader.cpp
deleted file mode 100644
index 317c3ab3..00000000
--- a/demos/qt3d/photobrowser3d/bytereader.cpp
+++ /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 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 "bytereader.h"
-#include "thumbnailableimage.h"
-
-#include <QByteArray>
-#include <QThread>
-#include <QImage>
-#include <QImageReader>
-#include <QUrl>
-#include <QFile>
-#include <QCoreApplication>
-
-ByteReader::ByteReader()
-{
- m_stop = 0;
- m_loading = 0;
-}
-
-void ByteReader::loadFile(const ThumbnailableImage &image)
-{
- if (!m_stop)
- {
- m_loading.ref();
-
- // FIXME: actually handle remote files
- QUrl url = image.url();
- QString fn = url.toLocalFile();
- int pos = fn.lastIndexOf('.');
- QString ext;
- if (pos != -1)
- ext = fn.mid(pos).toUpper();
- if (ext.isEmpty() ||
- !QImageReader::supportedImageFormats().contains(ext.toLocal8Bit()))
- ext = QString();
- QImage im;
- QFile f(fn);
- QString errorMessage;
- if (f.open(QIODevice::ReadOnly))
- {
- QByteArray bytes;
- while (!f.atEnd() & !m_stop)
- {
- bytes.append(f.read(1024));
- QCoreApplication::processEvents();
- }
- im = ext.isEmpty() ? QImage::fromData(bytes)
- : QImage::fromData(bytes, qPrintable(ext));
- }
- else
- {
- errorMessage = tr("Could not read: %1").arg(url.toString());
- }
-
- QCoreApplication::processEvents();
- if (!m_stop)
- {
- if (im.isNull())
- {
- im = QImage(QSize(128, 128), QImage::Format_ARGB32);
- im.fill(qRgba(0, 30, 50, 64));
- QPainter ptr;
- ptr.begin(&im);
- ptr.setBackgroundMode(Qt::TransparentMode);
- if (errorMessage.isEmpty())
- errorMessage = tr("Could not load: %1").arg(url.toString());
- ptr.setPen(QColor("orange"));
- ptr.drawText(im.rect(), Qt::AlignCenter, errorMessage);
- ptr.end();
- }
- else
- {
- // TODO: Fix size limit
- // This arbitrary size limit is really a debugging/development thing
- // In a real program once you had loaded the full image, the photo-
- // viewer would allow zooming and panning all around in the image
- // so loading a 2896 pixel × 1944 pixel photo would make sense even
- // on a small screen. For now work with fairly cruddy image quality.
- // Probably the fix is to have a separate load call that re-fetches
- // the full image on a zoom
- QSize workSize(1024, 768);
- Qt::TransformationMode mode = Qt::SmoothTransformation;
- if (QThread::idealThreadCount() < 2)
- {
- workSize = workSize / 2;
- mode = Qt::FastTransformation;
- }
- if (im.size().width() > workSize.width() || im.size().height() > workSize.height())
- im = im.scaled(workSize, Qt::KeepAspectRatio, mode);
- }
-
- Q_ASSERT(!im.isNull());
- ThumbnailableImage result(image);
- result.setData(im);
-
- // it would be nice to incur the cost of setThumbnailed() on the image
- // at this point - in the background thread. Trouble is the atlas is
- // constantly being accessed by the draw loop and to do anything about
- // that would mean locking the GUI thread...
-
- Q_ASSERT(!result.isNull());
-
- emit imageLoaded(result);
- }
-
- m_loading.deref();
- }
-
- if (m_stop)
- emit stopped();
-
-}
-
-void ByteReader::stop()
-{
- m_stop.ref();
- if (!m_loading)
- emit stopped();
-}
diff --git a/demos/qt3d/photobrowser3d/bytereader.h b/demos/qt3d/photobrowser3d/bytereader.h
deleted file mode 100644
index c790b823..00000000
--- a/demos/qt3d/photobrowser3d/bytereader.h
+++ /dev/null
@@ -1,69 +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 BYTEREADER_H
-#define BYTEREADER_H
-
-#include <QObject>
-
-QT_BEGIN_NAMESPACE
-class QUrl;
-QT_END_NAMESPACE
-
-class ThumbnailableImage;
-
-class ByteReader : public QObject
-{
- Q_OBJECT
-public:
- ByteReader();
-signals:
- void imageLoaded(const ThumbnailableImage &image);
- void stopped();
-public slots:
- void loadFile(const ThumbnailableImage &url);
- void stop();
-private:
- QAtomicInt m_stop;
- QAtomicInt m_loading;
-};
-
-#endif // BYTEREADER_H
diff --git a/demos/qt3d/photobrowser3d/filescanner.cpp b/demos/qt3d/photobrowser3d/filescanner.cpp
deleted file mode 100644
index 01c4c19e..00000000
--- a/demos/qt3d/photobrowser3d/filescanner.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 "filescanner.h"
-
-#include <QTime>
-#include <QFileInfo>
-#include <QStringList>
-#include <QSet>
-#include <QDir>
-#include <QCoreApplication>
-#include <QImageReader>
-#include <QDebug>
-
-FileScanner::FileScanner(QObject *parent)
- : QThread(parent)
-{
- m_stop = 0;
-}
-
-FileScanner::~FileScanner()
-{
- // nothing to do here
-}
-
-void FileScanner::stop()
-{
- m_stop.ref();
-}
-
-void FileScanner::run()
-{
- scan();
-}
-
-void FileScanner::scan()
-{
- QStringList queue;
- queue.append(m_url.path());
- QSet<QString> loopProtect;
- int count = 0;
- while (queue.size() > 0 && !m_stop && count < 300)
- {
- QString path = queue.takeFirst();
- QFileInfo u(path);
- if (u.isSymLink())
- {
- path = u.symLinkTarget();
- u = QFileInfo(path);
- }
- if (u.isDir())
- {
- if (!loopProtect.contains(path))
- {
- loopProtect.insert(path);
- QDir dir(path);
- QStringList entries = dir.entryList();
- QStringList::const_iterator it = entries.constBegin();
- for ( ; it != entries.constEnd(); ++it)
- {
- // ignore hidden files, system directories
- if ((*it).startsWith("."))
- continue;
- queue.append(dir.absoluteFilePath(*it));
- }
- }
- }
- else
- {
- if (u.isFile() && u.isReadable())
- {
- // small optimization: if the file has a suffix, check if that
- // is known as an image format before sending to loader
- QString ext = u.suffix().toLower();
- if (ext.isEmpty() ||
- QImageReader::supportedImageFormats().contains(ext.toLocal8Bit()))
- {
- QUrl url2;
- url2.setScheme("file");
- url2.setPath(u.absoluteFilePath());
- emit imageUrl(url2);
- ++count;
- }
- }
- }
- QCoreApplication::processEvents();
- QThread::yieldCurrentThread();
- }
-}
diff --git a/demos/qt3d/photobrowser3d/filescanner.h b/demos/qt3d/photobrowser3d/filescanner.h
deleted file mode 100644
index 0431b54b..00000000
--- a/demos/qt3d/photobrowser3d/filescanner.h
+++ /dev/null
@@ -1,79 +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 FILESCANNER_H
-#define FILESCANNER_H
-
-#include <QThread>
-#include <QUrl>
-#include <QDebug>
-
-class FileScanner : public QThread
-{
- Q_OBJECT
-public:
- explicit FileScanner(QObject *parent = 0);
- ~FileScanner();
-
- // INVARIANT: never get called when the thread is running
- void setBaseUrl(const QUrl &url)
- {
- Q_ASSERT(!isRunning());
- m_url = url;
- }
-
-signals:
- void imageUrl(const QUrl &url);
-
-public slots:
- void stop();
- void scan();
-
-protected:
- void run();
-
- QUrl m_url;
- QAtomicInt m_stop;
-private:
-
-};
-
-#endif // FILESCANNER_H
diff --git a/demos/qt3d/photobrowser3d/imagedisplay.cpp b/demos/qt3d/photobrowser3d/imagedisplay.cpp
deleted file mode 100644
index a39cfa02..00000000
--- a/demos/qt3d/photobrowser3d/imagedisplay.cpp
+++ /dev/null
@@ -1,224 +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 "imagedisplay.h"
-#include "thumbnailableimage.h"
-#include "thumbnailnode.h"
-#include "thumbnaileffect.h"
-#include "qglbuilder.h"
-#include "qglcube.h"
-#include "imagemanager.h"
-#include "qatlas.h"
-#include "qglshaderprogrameffect.h"
-#include "qphotobrowser3dscene.h"
-#include "photobrowser3dview.h"
-
-#include <QApplication>
-#include <QChildEvent>
-#include <QUrl>
-#include <QImage>
-
-static inline QImage qMakeFrameImage()
-{
- QImage frm(QSize(128, 128), QImage::Format_ARGB32);
- frm.fill(qRgba(8, 8, 8, 255)); // dark grey frame
- QPainter ptr;
- ptr.begin(&frm);
- QRect r(8, 8, 112, 112);
- ptr.setBackgroundMode(Qt::TransparentMode);
- ptr.fillRect(r, QColor(0, 30, 50, 64));
- ptr.setPen(QColor("orange"));
- ptr.drawText(frm.rect(), Qt::AlignCenter, "Loading...");
- ptr.end();
- return frm;
-}
-
-static inline void qAddPane(QSizeF size, QGeometryData *data)
-{
- Q_ASSERT(data);
- QSizeF f = size / 2.0f;
- QVector2D a(-f.width(), -f.height());
- QVector2D b(f.width(), -f.height());
- QVector2D c(f.width(), f.height());
- QVector2D d(-f.width(), f.height());
- QVector2D ta(0.0f, 0.0f);
- QVector2D tb(1.0f, 0.0f);
- QVector2D tc(1.0f, 1.0f);
- QVector2D td(0.0f, 1.0f);
- int k = data->count();
- data->appendVertex(a, b, c, d);
- data->appendTexCoord(ta, tb, tc, td);
- data->appendIndices(k, k+1, k+2);
- data->appendIndices(k, k+2, k+3);
-}
-
-ImageDisplay::ImageDisplay(QObject *parent, QGLMaterialCollection *materials, qreal wallSize)
- : QGLSceneNode(parent)
- , m_wall(0)
- , m_frames(0)
- , m_currentWall(0)
- , m_currentFrame(0)
- , m_imageSetToDefault(false)
- , m_count(0)
- , m_size(wallSize)
- , m_frameSize((m_size * 3.0f) / 4.0f)
- , m_maxImages(500)
- , m_frameLoadingMaterial(-1)
-{
- // the real values will get poked in here by the atlas
- m_atlasPlaceHolder.append(QVector2D(), QVector2D(), QVector2D(), QVector2D());
-
- setObjectName("ImageDisplay");
- setPalette(materials);
-
- // the frames lie in Z = 0, the wall is set back and lies in
- // the plane Z = (m_size / -4.0)
-
- // build the wall
- qAddPane(QSize(m_size, m_size), &m_wallGeometry);
- m_wall = new QGLSceneNode(this);
- m_wall->setObjectName("Wall");
- m_wall->setPalette(materials);
- m_currentWall = new QGLSceneNode(m_wall);
- m_currentWall->setObjectName("wall 0");
- m_currentWall->setGeometry(m_wallGeometry);
- m_currentWall->setCount(m_wallGeometry.indexCount());
- m_wall->setPosition(QVector3D(0.0f, 0.0f, m_size / -4.0));
-
- // paint the wall
- m_wall->setEffect(QGL::FlatReplaceTexture2D);
- QGLMaterial *mat = new QGLMaterial();
- QGLTexture2D *tex = new QGLTexture2D(mat);
- tex->setImage(QImage(":/res/images/girder.png"));
- mat->setTexture(tex);
- mat->setObjectName("girder material");
- m_wall->setMaterial(mat);
-
- // build the frames
- qAddPane(QSize(m_frameSize, m_frameSize), &m_frameGeometry);
- m_frameGeometry.appendTexCoordArray(m_atlasPlaceHolder, QGL::TextureCoord1);
- m_frames = new QGLSceneNode(this);
- m_frames->setObjectName("Frames");
- m_currentFrame = new ThumbnailNode(m_frames);
- m_currentFrame->setObjectName("frame 0");
- m_currentFrame->setGeometry(m_frameGeometry);
- m_currentFrame->setCount(m_frameGeometry.indexCount());
-
- // use the frames geometry to put the atlas data into
- QAtlas *atlas = QAtlas::instance();
- atlas->setGeometry(m_frameGeometry);
-
- // generally the frames use the thumbnail material & effect
- m_effect = new ThumbnailEffect;
- m_frames->setUserEffect(m_effect);
- m_frames->setEffectEnabled(true);
- m_frames->setMaterial(atlas->material());
-
- // unless they're loading, in which case use the "loading" image
- m_frameImage = qMakeFrameImage();
- mat = new QGLMaterial();
- tex = new QGLTexture2D(mat);
- tex->setHorizontalWrap(QGL::Clamp);
- tex->setImage(m_frameImage);
- mat->setTexture(tex);
- mat->setObjectName("loading image material - default");
- m_frameLoadingMaterial = materials->addMaterial(mat);
- m_currentFrame->setMaterialIndex(m_frameLoadingMaterial);
-
- // make the frames pickable
- PhotoBrowser3DView *view = qobject_cast<PhotoBrowser3DView*>(parent);
- view->scene()->mainNode()->addNode(m_frames);
-
- m_imageSetToDefault = true;
-}
-
-ImageDisplay::~ImageDisplay()
-{
- delete m_effect;
-}
-
-void ImageDisplay::addThumbnailNode(const QUrl &image)
-{
- Q_ASSERT(QThread::currentThread() == thread());
- ImageManager *manager = qobject_cast<ImageManager*>(sender());
- if (!m_imageSetToDefault)
- {
- QVector3D p = m_currentFrame->position();
- p.setX(p.x() - m_size);
- int start = m_frameGeometry.indexCount();
- qAddPane(QSize(m_frameSize, m_frameSize), &m_frameGeometry);
- int count = m_frameGeometry.indexCount() - start;
- m_frameGeometry.appendTexCoordArray(m_atlasPlaceHolder, QGL::TextureCoord1);
- m_currentFrame = new ThumbnailNode(m_frames);
- QString name = QLatin1String("frame %1");
- name.arg(m_count);
- m_currentFrame->setObjectName(name);
- m_currentFrame->setPosition(p);
- m_currentFrame->setStart(start);
- m_currentFrame->setCount(count);
- m_currentFrame->setGeometry(m_frameGeometry);
- m_currentFrame->setMaterialIndex(m_frameLoadingMaterial);
-
- QGLSceneNode *s = m_currentWall->clone(m_wall);
- name = QLatin1String("wall %1");
- name.arg(m_count);
- s->setObjectName(name);
- p = s->position();
- p.setX(p.x() - m_size);
- s->setPosition(p);
- m_currentWall = s;
- }
- m_currentFrame->setUrl(image);
- if (manager)
- {
- connect(m_currentFrame, SIGNAL(imageRequired(ThumbnailableImage)),
- manager, SIGNAL(deployLoader(ThumbnailableImage)));
- connect(manager, SIGNAL(imageReady(ThumbnailableImage)),
- m_currentFrame, SLOT(setImage(ThumbnailableImage)));
- }
- PhotoBrowser3DView *view = qobject_cast<PhotoBrowser3DView*>(parent());
- Q_ASSERT(view);
- connect(m_currentFrame, SIGNAL(nodeChanged()), view, SLOT(update()));
-
- m_imageSetToDefault = false;
- emit framesChanged();
- ++m_count;
-}
diff --git a/demos/qt3d/photobrowser3d/imagedisplay.h b/demos/qt3d/photobrowser3d/imagedisplay.h
deleted file mode 100644
index b0d7a56d..00000000
--- a/demos/qt3d/photobrowser3d/imagedisplay.h
+++ /dev/null
@@ -1,88 +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 IMAGEDISPLAY_H
-#define IMAGEDISPLAY_H
-
-#include "qglscenenode.h"
-#include "qglmaterialcollection.h"
-
-#include <QString>
-
-QT_BEGIN_NAMESPACE
-class QGLBuilder;
-class QGLTexture2D;
-class QGLPainter;
-QT_END_NAMESPACE
-
-class ThumbnailNode;
-
-class ImageDisplay : public QGLSceneNode
-{
- Q_OBJECT
-public:
- ImageDisplay(QObject *parent, QGLMaterialCollection *materials, qreal wallSize = 4.0);
- ~ImageDisplay();
- int maxImages() const { return m_maxImages; }
- void setMaxImages(int max) { m_maxImages = max; }
-signals:
- void framesChanged();
-public slots:
- void addThumbnailNode(const QUrl &url);
-private:
- QGLSceneNode *m_wall;
- QGLSceneNode *m_frames;
- QGLSceneNode *m_currentWall;
- ThumbnailNode *m_currentFrame;
- QGLAbstractEffect *m_effect;
- bool m_imageSetToDefault;
- int m_count;
- qreal m_size;
- qreal m_frameSize;
- int m_maxImages;
- QImage m_frameImage;
- int m_frameLoadingMaterial;
- QGeometryData m_frameGeometry;
- QGeometryData m_wallGeometry;
- QVector2DArray m_atlasPlaceHolder;
-};
-
-#endif // IMAGEDISPLAY_H
diff --git a/demos/qt3d/photobrowser3d/imageloader.cpp b/demos/qt3d/photobrowser3d/imageloader.cpp
deleted file mode 100644
index a8d58978..00000000
--- a/demos/qt3d/photobrowser3d/imageloader.cpp
+++ /dev/null
@@ -1,115 +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 "imageloader.h"
-#include "imagemanager.h"
-#include "bytereader.h"
-
-#include <QFileInfo>
-#include <QTime>
-#include <QDir>
-#include <QStringList>
-#include <QPixmap>
-#include <QPainter>
-#include <QBuffer>
-#include <QImageReader>
-#include <QMutex>
-#include <QMutexLocker>
-#include <QTimer>
-
-ImageLoader::ImageLoader()
-{
- m_stop = 0;
-}
-
-ImageLoader::~ImageLoader()
-{
- // nothing to do here
-}
-
-ThumbnailableImage ImageLoader::image() const
-{
- return m_image;
-}
-
-void ImageLoader::setImage(const ThumbnailableImage &image)
-{
- m_image = image;
- if (!m_stop && isRunning())
- emit readRequired(image);
-}
-
-void ImageLoader::stop()
-{
- m_stop.ref();
- emit stopLoading();
-}
-
-void ImageLoader::queueInitialImage()
-{
- emit readRequired(m_image);
-}
-
-void ImageLoader::unusedTimeout()
-{
- emit unused();
-}
-
-void ImageLoader::run()
-{
- ByteReader reader;
- connect(this, SIGNAL(readRequired(ThumbnailableImage)),
- &reader, SLOT(loadFile(ThumbnailableImage)));
- connect(&reader, SIGNAL(imageLoaded(ThumbnailableImage)),
- this, SIGNAL(imageLoaded(ThumbnailableImage)));
-
- connect(this, SIGNAL(stopLoading()), &reader, SLOT(stop()));
- connect(&reader, SIGNAL(stopped()), this, SLOT(quit()));
-
- QTimer timer;
- connect(&timer, SIGNAL(timeout()), this, SLOT(unusedTimeout()));
- timer.start(2 * 60 * 1000);
-
- if (!m_image.isNull())
- QTimer::singleShot(0, this, SLOT(queueInitialImage()));
-
- exec();
-}
diff --git a/demos/qt3d/photobrowser3d/imageloader.h b/demos/qt3d/photobrowser3d/imageloader.h
deleted file mode 100644
index f8f23ac4..00000000
--- a/demos/qt3d/photobrowser3d/imageloader.h
+++ /dev/null
@@ -1,83 +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 IMAGELOADER_H
-#define IMAGELOADER_H
-
-#include <QThread>
-#include <QUrl>
-#include <QMutex>
-#include <QAtomicInt>
-
-#include "thumbnailableimage.h"
-
-class ImageManager;
-class ByteReader;
-
-class ImageLoader : public QThread
-{
- Q_OBJECT
-public:
- ImageLoader();
- ~ImageLoader();
- ThumbnailableImage image() const;
- void setImage(const ThumbnailableImage &image);
-signals:
- void imageLoaded(const ThumbnailableImage &image);
- void stopLoading();
- void readRequired(const ThumbnailableImage &image);
- void thumbnailRequired(const ThumbnailableImage &image);
- void thumbnailDone(const ThumbnailableImage &image);
- void unused();
-public slots:
- void stop();
-protected:
- void run();
-private slots:
- void queueInitialImage();
- void unusedTimeout();
-private:
- ThumbnailableImage m_image;
- QAtomicInt m_stop;
- ByteReader *m_reader;
-};
-
-#endif // IMAGELOADER_H
diff --git a/demos/qt3d/photobrowser3d/imagemanager.cpp b/demos/qt3d/photobrowser3d/imagemanager.cpp
deleted file mode 100644
index 6f2ec5bc..00000000
--- a/demos/qt3d/photobrowser3d/imagemanager.cpp
+++ /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 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 "imagemanager.h"
-#include "qatlas.h"
-#include "filescanner.h"
-#include "threadpool.h"
-
-#include <QTime>
-#include <QTimer>
-#include <QDir>
-
-ImageManager::ImageManager()
-{
-}
-
-ImageManager::~ImageManager()
-{
-}
-
-// INVARIANT: only ever called before the run() function is started
-// therefore no need for synchronized url
-void ImageManager::setImageBaseUrl(const QUrl &url)
-{
- Q_ASSERT(!isRunning());
- m_url = url;
-}
-
-/*!
- Stop the running threads if any, then sit waiting in the event loop
- for a quit call.
-*/
-void ImageManager::stop()
-{
- emit stopAll();
-}
-
-void ImageManager::scanForFiles()
-{
- // TODO: In a real app there would be a way to detect new files arriving
- // and trigger a rescan to pick these new files up. Here we just scan
- // once and then destroy the scanner, to save on resources.
-
-#ifndef QT_USE_TEST_IMAGES
- // TODO: If the amount of files is large and the app is quit early the
- // scanner could still be going when the threadpool quits. For now
- // assume its ok...
- FileScanner *scanner = new FileScanner;
- scanner->setBaseUrl(m_url);
- connect(scanner, SIGNAL(imageUrl(QUrl)), this, SIGNAL(imageUrl(QUrl)));
- connect(scanner, SIGNAL(finished()), scanner, SLOT(deleteLater()));
- connect(this, SIGNAL(stopAll()), scanner, SLOT(stop()));
- scanner->start();
-#else
- QDir testImages(":/pictures");
- QStringList pics = testImages.entryList();
- for (int i = 0; i < pics.size(); ++i)
- {
- QUrl url;
- url.setScheme("file");
- url.setPath(testImages.filePath(pics.at(i)));
- emit imageUrl(url);
- }
- qDebug() << "== test images loaded ==";
-#endif
-}
-
-void ImageManager::quit()
-{
- QThread::quit();
-}
-
-void ImageManager::run()
-{
- if (m_url.scheme() != "file")
- {
- qWarning("URL scheme %s not yet supported", qPrintable(m_url.scheme()));
- return;
- }
-
- // execute once in the event loop below
- QTimer::singleShot(0, this, SLOT(scanForFiles()));
-
-#ifndef QT_NO_THREADED_FILE_LOAD
- ThreadPool pool;
-
- connect(this, SIGNAL(deployLoader(ThumbnailableImage)),
- &pool, SLOT(deployLoader(ThumbnailableImage)));
-
- connect(this, SIGNAL(stopAll()), &pool, SLOT(stop()));
- connect(&pool, SIGNAL(stopped()), this, SLOT(quit()));
-#endif
-
- exec();
-}
diff --git a/demos/qt3d/photobrowser3d/imagemanager.h b/demos/qt3d/photobrowser3d/imagemanager.h
deleted file mode 100644
index 412f590a..00000000
--- a/demos/qt3d/photobrowser3d/imagemanager.h
+++ /dev/null
@@ -1,78 +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 IMAGEMANAGER_H
-#define IMAGEMANAGER_H
-
-#include <QThread>
-#include <QUrl>
-#include <QImage>
-#include <QMutex>
-
-#include "thumbnailableimage.h"
-
-class Launcher;
-
-class ImageManager : public QThread
-{
- Q_OBJECT
-public:
- ImageManager();
- ~ImageManager();
- QUrl imageBaseUrl() const { return m_url; }
- void setImageBaseUrl(const QUrl &url);
-public slots:
- void stop();
- void quit();
-signals:
- void imageUrl(const QUrl &);
- void imageReady(const ThumbnailableImage &);
- void deployLoader(const ThumbnailableImage &);
- void stopAll();
-protected:
- void run();
-private slots:
- void scanForFiles();
-private:
- QUrl m_url;
-};
-
-#endif // IMAGEMANAGER_H
diff --git a/demos/qt3d/photobrowser3d/images/P1000223.JPG b/demos/qt3d/photobrowser3d/images/P1000223.JPG
deleted file mode 100644
index 48edfbc2..00000000
--- a/demos/qt3d/photobrowser3d/images/P1000223.JPG
+++ /dev/null
Binary files differ
diff --git a/demos/qt3d/photobrowser3d/images/P1000228.JPG b/demos/qt3d/photobrowser3d/images/P1000228.JPG
deleted file mode 100644
index 2797b6df..00000000
--- a/demos/qt3d/photobrowser3d/images/P1000228.JPG
+++ /dev/null
Binary files differ
diff --git a/demos/qt3d/photobrowser3d/images/P1000472.JPG b/demos/qt3d/photobrowser3d/images/P1000472.JPG
deleted file mode 100644
index 067afdd4..00000000
--- a/demos/qt3d/photobrowser3d/images/P1000472.JPG
+++ /dev/null
Binary files differ
diff --git a/demos/qt3d/photobrowser3d/images/arrows-left.png b/demos/qt3d/photobrowser3d/images/arrows-left.png
deleted file mode 100644
index 791f2c6b..00000000
--- a/demos/qt3d/photobrowser3d/images/arrows-left.png
+++ /dev/null
Binary files differ
diff --git a/demos/qt3d/photobrowser3d/images/arrows.xcf b/demos/qt3d/photobrowser3d/images/arrows.xcf
deleted file mode 100644
index 302bcd6e..00000000
--- a/demos/qt3d/photobrowser3d/images/arrows.xcf
+++ /dev/null
Binary files differ
diff --git a/demos/qt3d/photobrowser3d/images/default_sky_base.xcf b/demos/qt3d/photobrowser3d/images/default_sky_base.xcf
deleted file mode 100644
index 050812f7..00000000
--- a/demos/qt3d/photobrowser3d/images/default_sky_base.xcf
+++ /dev/null
Binary files differ
diff --git a/demos/qt3d/photobrowser3d/images/default_sky_down.png b/demos/qt3d/photobrowser3d/images/default_sky_down.png
deleted file mode 100644
index 685c28c4..00000000
--- a/demos/qt3d/photobrowser3d/images/default_sky_down.png
+++ /dev/null
Binary files differ
diff --git a/demos/qt3d/photobrowser3d/images/default_sky_east.png b/demos/qt3d/photobrowser3d/images/default_sky_east.png
deleted file mode 100644
index f6463abf..00000000
--- a/demos/qt3d/photobrowser3d/images/default_sky_east.png
+++ /dev/null
Binary files differ
diff --git a/demos/qt3d/photobrowser3d/images/default_sky_north.png b/demos/qt3d/photobrowser3d/images/default_sky_north.png
deleted file mode 100644
index 153b833c..00000000
--- a/demos/qt3d/photobrowser3d/images/default_sky_north.png
+++ /dev/null
Binary files differ
diff --git a/demos/qt3d/photobrowser3d/images/default_sky_south.png b/demos/qt3d/photobrowser3d/images/default_sky_south.png
deleted file mode 100644
index b3b01321..00000000
--- a/demos/qt3d/photobrowser3d/images/default_sky_south.png
+++ /dev/null
Binary files differ
diff --git a/demos/qt3d/photobrowser3d/images/default_sky_up.png b/demos/qt3d/photobrowser3d/images/default_sky_up.png
deleted file mode 100644
index 3d4d6233..00000000
--- a/demos/qt3d/photobrowser3d/images/default_sky_up.png
+++ /dev/null
Binary files differ
diff --git a/demos/qt3d/photobrowser3d/images/default_sky_west.png b/demos/qt3d/photobrowser3d/images/default_sky_west.png
deleted file mode 100644
index 14325371..00000000
--- a/demos/qt3d/photobrowser3d/images/default_sky_west.png
+++ /dev/null
Binary files differ
diff --git a/demos/qt3d/photobrowser3d/images/girder.png b/demos/qt3d/photobrowser3d/images/girder.png
deleted file mode 100644
index f9b6c4dc..00000000
--- a/demos/qt3d/photobrowser3d/images/girder.png
+++ /dev/null
Binary files differ
diff --git a/demos/qt3d/photobrowser3d/launcher.cpp b/demos/qt3d/photobrowser3d/launcher.cpp
deleted file mode 100644
index 6d90636b..00000000
--- a/demos/qt3d/photobrowser3d/launcher.cpp
+++ /dev/null
@@ -1,115 +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 "launcher.h"
-#include "imageloader.h"
-#include "imagemanager.h"
-
-#include <QSemaphore>
-#include <QTime>
-#include <QFileInfo>
-#include <QDir>
-#include <QStringList>
-#include <QSet>
-#include <QDebug>
-
-Launcher::Launcher(ImageManager *manager)
- : m_manager(manager)
- , m_stop(false)
-{
- Q_ASSERT(m_manager);
-}
-
-void Launcher::run()
-{
- if (m_url.isEmpty())
- {
- qWarning("Launcher::run - empty URL!");
- return;
- }
- if (m_url.scheme() != QLatin1String("file"))
- {
- qWarning("URL scheme %s not yet supported", qPrintable(m_url.scheme()));
- return;
- }
- QStringList queue;
- queue.append(m_url.path());
- QSet<QString> loopProtect;
- while (queue.size() > 0 && !m_stop)
- {
- QString path = queue.takeFirst();
- QFileInfo u(path);
- if (u.isSymLink())
- path = u.symLinkTarget();
- if (u.isDir())
- {
- if (!loopProtect.contains(path))
- {
- loopProtect.insert(path);
- QDir dir(path);
- QStringList entries = dir.entryList();
- QStringList::const_iterator it = entries.constBegin();
- for ( ; it != entries.constEnd(); ++it)
- {
- // ignore hidden files, system directories
- if ((*it).startsWith(QLatin1Char('.')))
- continue;
- queue.append(dir.absoluteFilePath(*it));
- }
- }
- }
- else
- {
- if (u.isFile() && u.isReadable())
- {
- // do no checking here for file extensions etc - just
- // forward any readable file found under the pictures
- // directory to the QImage loader, and let it sort out
- // if the thing can be loaded as an image.
- QUrl url2;
- url2.setScheme(QLatin1String("file"));
- url2.setPath(u.absoluteFilePath());
- m_manager->acquire();
- emit imageUrl(url2);
- }
- }
- }
-}
diff --git a/demos/qt3d/photobrowser3d/main.cpp b/demos/qt3d/photobrowser3d/main.cpp
deleted file mode 100644
index c26a9c54..00000000
--- a/demos/qt3d/photobrowser3d/main.cpp
+++ /dev/null
@@ -1,83 +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/QApplication>
-#include <QtCore/QThread>
-#include "qgltexture2d.h"
-#include "photobrowser3dview.h"
-
-int main(int argc, char *argv[])
-{
-#ifdef Q_OS_SYMBIAN
- QGLTexture2D::setMaxImageSize(256,256);
-#endif
-
- Q_INIT_RESOURCE(photobrowser3d);
-
- QApplication app(argc, argv);
-
- // for QSettings
- QCoreApplication::setOrganizationName("Nokia");
- QCoreApplication::setOrganizationDomain("nokia.com");
- QCoreApplication::setApplicationName("photobrowser3d");
-
- int result = 0;
- {
- PhotoBrowser3DView view;
-
-#ifdef Q_OS_SYMBIAN
- view.setAttribute(Qt::WA_LockLandscapeOrientation, true);
- view.showFullScreen();
-#else
- if (view.stereoType() != QGLView::RedCyanAnaglyph)
- view.camera()->setEyeSeparation(0.3f);
- if (QApplication::arguments().contains(QLatin1String("-maximize")))
- view.showMaximized();
- else if (QApplication::arguments().contains(QLatin1String("-fullscreen")))
- view.showFullScreen();
- else
- view.show();
-#endif
-
- result = app.exec();
- }
- return result;
-}
diff --git a/demos/qt3d/photobrowser3d/pancontroller.cpp b/demos/qt3d/photobrowser3d/pancontroller.cpp
deleted file mode 100644
index 1ed5639b..00000000
--- a/demos/qt3d/photobrowser3d/pancontroller.cpp
+++ /dev/null
@@ -1,244 +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 "pancontroller.h"
-#include "qglview.h"
-#include "qglcamera.h"
-#include "photobrowser3dview.h"
-
-#include <qmath.h>
-
-#include <QtGlobal>
-#include <QTime>
-
-class PanControllerPrivate
-{
-public:
- PanControllerPrivate()
- : speed(0.0f)
- , angle(0.0f)
- , arrowDirection(Qt::NoArrow)
- , view(0)
- , maxSpeed(4.0f)
- , defaultDistance(0.0f)
- , panDistance(0.0f)
- , panViewAngle(M_PI / 4.0f) // 45 degrees in radians
- , animating(false)
- , elapsed(0.0f)
- {
- panTime.start();
- }
-
- void calculateValues();
-
- qreal speed;
- qreal angle;
- Qt::ArrowType arrowDirection;
- QGLView *view;
- QTime panTime;
- qreal maxSpeed;
- qreal defaultDistance;
- qreal panDistance;
- qreal panViewAngle;
- bool animating;
- qreal elapsed;
-};
-
-PanController::PanController(QObject *parent)
- : QObject(parent)
- , d(new PanControllerPrivate)
-{
- QGLView *v = qobject_cast<QGLView*>(parent);
- if (v)
- d->view = v;
-}
-
-PanController::~PanController()
-{
- delete d;
-}
-
-qreal PanController::defaultDistance() const
-{
- return d->defaultDistance;
-}
-
-void PanController::setDefaultDistance(qreal dist)
-{
- d->defaultDistance = dist;
-}
-
-qreal PanController::panDistance() const
-{
- return d->panDistance;
-}
-
-void PanController::setPanDistance(qreal dist)
-{
- d->panDistance = dist;
-}
-
-qreal PanController::panViewAngle() const
-{
- return d->panViewAngle;
-}
-
-void PanController::setPanViewAngle(qreal angle)
-{
- d->panViewAngle = angle;
-}
-
-void PanController::setMaxSpeed(qreal maxSpeed)
-{
- d->maxSpeed = maxSpeed;
-}
-
-qreal PanController::maxSpeed() const
-{
- return d->maxSpeed;
-}
-
-void PanController::setSpeed(qreal speed)
-{
- qreal t = d->panTime.restart();
- if (d->speed != speed)
- {
- d->speed = speed;
- d->angle = speed * d->panViewAngle;
- if (!qIsNull(d->speed))
- d->animating = true;
- d->elapsed += t;
- d->calculateValues();
- emit speedChanged();
- }
-}
-
-qreal PanController::speed() const
-{
- return d->speed;
-}
-
-void PanController::pan()
-{
- if (d->animating)
- {
- qreal t = d->panTime.restart();
- d->elapsed += t;
- // dont recalculate every single time
- // 30ms frame time == 33fps - more than enough
- if (d->elapsed > 30)
- d->calculateValues();
-
- PhotoBrowser3DView *view = qobject_cast<PhotoBrowser3DView*>(parent());
- Q_ASSERT(view);
- view->update();
- }
-}
-
-void PanControllerPrivate::calculateValues()
-{
- if (view && animating)
- {
- QGLCamera *cam = view->camera();
- Q_ASSERT(cam);
-
- QVector3D c = cam->center();
- QVector3D e = cam->eye();
-
- if (qFuzzyIsNull(speed))
- {
- c.setX(e.x());
- e.setZ(defaultDistance);
- }
- else
- {
- // as speed goes from 0 -> 1, eye moves closer to z=0 plane
- e.setZ(defaultDistance - (speed * (defaultDistance - panDistance)));
-
- // the view angle is a direct function of the speed see setSpeed() above
- // and as view angle increases we look further along the x-axis
- qreal opp = (e.z() - c.z()) * qTan(angle);
-
- // velocity along the x axis is controlled by speed (a value from 0 -> 1
- // which is a modifier for the maxSpeed, a constant). the velocity gives
- // us the incremental change in x for this unit time
- qreal dx = (speed * maxSpeed * elapsed);
-
- if (arrowDirection == Qt::LeftArrow)
- {
- e.setX(e.x() - dx);
- c.setX(e.x() - opp);
- }
- else if (arrowDirection == Qt::RightArrow)
- {
- e.setX(e.x() + dx);
- c.setX(e.x() + opp);
- }
- }
- cam->setEye(e);
- cam->setCenter(c);
- }
- elapsed = 0;
- if (qIsNull(speed))
- animating = false;
-}
-
-Qt::ArrowType PanController::direction() const
-{
- return d->arrowDirection;
-}
-
-void PanController::setDirection(Qt::ArrowType arrow)
-{
- Q_ASSERT(arrow == Qt::LeftArrow || arrow == Qt::RightArrow);
- d->arrowDirection = arrow;
-}
-
-QGLView *PanController::view() const
-{
- return d->view;
-}
-
-void PanController::setView(QGLView *view)
-{
- d->view = view;
-}
-
diff --git a/demos/qt3d/photobrowser3d/pancontroller.h b/demos/qt3d/photobrowser3d/pancontroller.h
deleted file mode 100644
index b6e938ab..00000000
--- a/demos/qt3d/photobrowser3d/pancontroller.h
+++ /dev/null
@@ -1,92 +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 PANCONTROLLER_H
-#define PANCONTROLLER_H
-
-#include <QObject>
-#include <Qt>
-
-QT_BEGIN_NAMESPACE
-class QGLView;
-QT_END_NAMESPACE
-
-class PanControllerPrivate;
-
-class PanController : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(qreal speed READ speed WRITE setSpeed NOTIFY speedChanged)
-public:
- explicit PanController(QObject *parent = 0);
- ~PanController();
-
- qreal defaultDistance() const;
- void setDefaultDistance(qreal d);
-
- qreal panDistance() const;
- void setPanDistance(qreal d);
-
- qreal panViewAngle() const;
- void setPanViewAngle(qreal angle);
-
- qreal maxSpeed() const;
- void setMaxSpeed(qreal maxSpeed);
-
- qreal speed() const;
- void setSpeed(qreal speed);
-
- Qt::ArrowType direction() const;
- void setDirection(Qt::ArrowType arrow);
-
- QGLView *view() const;
- void setView(QGLView *view);
-
- void pan();
-
-signals:
- void speedChanged();
-
-private:
- PanControllerPrivate *d;
-};
-
-#endif // PANCONTROLLER_H
diff --git a/demos/qt3d/photobrowser3d/photobrowser.rc b/demos/qt3d/photobrowser3d/photobrowser.rc
deleted file mode 100644
index b40ecdc1..00000000
--- a/demos/qt3d/photobrowser3d/photobrowser.rc
+++ /dev/null
@@ -1 +0,0 @@
-IDI_ICON1 ICON DISCARDABLE "qt3d.ico"
diff --git a/demos/qt3d/photobrowser3d/photobrowser3d.desktop b/demos/qt3d/photobrowser3d/photobrowser3d.desktop
deleted file mode 100644
index 6c4085d5..00000000
--- a/demos/qt3d/photobrowser3d/photobrowser3d.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=Photobrowser 3D
-Icon=/usr/share/icons/hicolor/80x80/apps/qt3d.png
-Exec=/usr/bin/invoker --type=e -s /usr/bin/photobrowser3d -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_photobrowser3d
diff --git a/demos/qt3d/photobrowser3d/photobrowser3d.pro b/demos/qt3d/photobrowser3d/photobrowser3d.pro
deleted file mode 100644
index 8830bb88..00000000
--- a/demos/qt3d/photobrowser3d/photobrowser3d.pro
+++ /dev/null
@@ -1,71 +0,0 @@
-TEMPLATE = app
-TARGET = photobrowser3d
-CONFIG += qt warn_on
-
-CONFIG += qt3d_deploy_pkg
-include(../../../pkg.pri)
-
-SOURCES += main.cpp\
- photobrowser3dview.cpp \
- imagedisplay.cpp \
- skybox.cpp \
- imagemanager.cpp \
- imageloader.cpp \
- qfocusadaptor.cpp \
- thumbnailableimage.cpp \
- qatlas.cpp \
- thumbnailnode.cpp \
- thumbnaileffect.cpp \
- filescanner.cpp \
- bytereader.cpp \
- threadpool.cpp \
- buttons.cpp \
- qphotobrowser3dscene.cpp \
- pancontroller.cpp
-
-HEADERS += photobrowser3dview.h \
- imagedisplay.h \
- skybox.h \
- imagemanager.h \
- imageloader.h \
- qfocusadaptor.h \
- thumbnailableimage.h \
- qatlas.h \
- thumbnailnode.h \
- thumbnaileffect.h \
- filescanner.h \
- bytereader.h \
- threadpool.h \
- buttons.h \
- qphotobrowser3dscene.h \
- pancontroller.h
-
-# Uncomment this line to force all file loading is done in the gui thread
-# instead of a background thread - useful for debugging.
-# DEFINES += QT_NO_THREADED_FILE_LOAD
-
-# Uncomment this to use test images instead of scanning the file-system for
-# pictures. The test images are stored in in-memory resources "files".
-# DEFINES += QT_USE_TEST_IMAGES
-
-RESOURCES += \
- photobrowser3d.qrc
-
-OTHER_FILES += \
- shaders/replace_texture.fsh \
- shaders/replace_texture.vsh
-
-symbian {
-# symbian-abld|symbian-sbsv2 {
-# # ro-section in photobrowser3d can exceed default allocated space, so move rw-section a little further
-# QMAKE_LFLAGS.ARMCC += --rw-base 0x800000
-# QMAKE_LFLAGS.GCCE += -Tdata 0xC00000
-# }
- TARGET.EPOCHEAPSIZE = 0x80000 0x8000000
-}
-
-OTHER_FILES += \
- photobrowser.rc \
- photobrowser3d.desktop
-
-RC_FILE = photobrowser.rc
diff --git a/demos/qt3d/photobrowser3d/photobrowser3d.qrc b/demos/qt3d/photobrowser3d/photobrowser3d.qrc
deleted file mode 100644
index 4d310bd8..00000000
--- a/demos/qt3d/photobrowser3d/photobrowser3d.qrc
+++ /dev/null
@@ -1,23 +0,0 @@
-<RCC>
- <qresource prefix="/res">
- <file alias="down.png">images/default_sky_down.png</file>
- <file alias="west.png">images/default_sky_east.png</file>
- <file alias="north.png">images/default_sky_north.png</file>
- <file alias="south.png">images/default_sky_south.png</file>
- <file alias="up.png">images/default_sky_up.png</file>
- <file alias="east.png">images/default_sky_west.png</file>
- <file>images/girder.png</file>
- </qresource>
- <qresource prefix="/shaders">
- <file alias="replace_texture.fsh">shaders/replace_texture.fsh</file>
- <file alias="replace_texture.vsh">shaders/replace_texture.vsh</file>
- </qresource>
- <qresource prefix="/pictures">
- <file alias="im1.jpg">images/P1000223.JPG</file>
- <file alias="im2.jpg">images/P1000228.JPG</file>
- <file alias="im3.jpg">images/P1000472.JPG</file>
- </qresource>
- <qresource prefix="/controls">
- <file alias="arrows-left.png">images/arrows-left.png</file>
- </qresource>
-</RCC>
diff --git a/demos/qt3d/photobrowser3d/photobrowser3dview.cpp b/demos/qt3d/photobrowser3d/photobrowser3dview.cpp
deleted file mode 100644
index 4227832b..00000000
--- a/demos/qt3d/photobrowser3d/photobrowser3dview.cpp
+++ /dev/null
@@ -1,446 +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 "photobrowser3dview.h"
-#include "imagemanager.h"
-#include "imagedisplay.h"
-#include "skybox.h"
-#include "qglpicknode.h"
-#include "qfocusadaptor.h"
-#include "thumbnailableimage.h"
-#include "qatlas.h"
-#include "filescanner.h"
-#include "buttons.h"
-#include "qphotobrowser3dscene.h"
-#include "pancontroller.h"
-#include "thumbnailnode.h"
-
-#include <QApplication>
-#include <QDesktopWidget>
-#include <QWheelEvent>
-#include <QDir>
-#include <QTimer>
-#include <QTime>
-#include <QStateMachine>
-#include <QState>
-#include <QFinalState>
-#include <QSignalTransition>
-#include <QPropertyAnimation>
-
-PhotoBrowser3DView::PhotoBrowser3DView()
- : QGLView()
- , m_scene(0)
- , m_display(0)
- , m_images(0)
- , m_buttons(0)
- , m_skybox(0)
- , m_palette(new QGLMaterialCollection(this))
- , m_state(0)
- , m_app(0)
- , m_zoomed(0)
- , m_browse(0)
- , m_pan(0)
- , m_fa(0)
- , m_pc(0)
- , m_pickableDirty(true)
- , m_done(false)
- , m_closing(false)
-{
- setOption(QGLView::ObjectPicking, true);
- // setOption(QGLView::ShowPicking, true);
- //setOption(QGLView::CameraNavigation, false);
-
- qRegisterMetaType<ThumbnailableImage>("ThumbnailableImage");
-
- QString path = ":/res";
- int ix = qApp->arguments().indexOf("--skybox");
- if (ix != -1)
- {
- if (qApp->arguments().size() > ix+1)
- path = qApp->arguments().at(ix+1);
- else
- qWarning("Expected path/to/skybox/files after \"--skybox\" switch\n");
- }
-
- m_displaySize = 4.0;
- m_scene = new QPhotoBrowser3DScene(this);
- m_buttons = new Buttons(this, m_palette);
- m_scene->mainNode()->addNode(m_buttons);
- m_scene->setPickable(true);
- m_skybox = new SkyBox(this, path);
- m_display = new ImageDisplay(this, m_palette, m_displaySize);
-
- setupStates();
-
- // make sure this only gets created in the GUI thread
- QAtlas::instance();
-
- QTimer::singleShot(0, this, SLOT(initialise()));
-}
-
-PhotoBrowser3DView::~PhotoBrowser3DView()
-{
- // nothing to be done here
-}
-
-void PhotoBrowser3DView::setupStates()
-{
- m_state = new QStateMachine(this);
- m_app = new QState;
- m_zoomed = new QState(m_app);
- m_browse = new QState(m_app);
- m_pan = new QState(m_app);
- m_app->setInitialState(m_browse);
- m_state->addState(m_app);
- QFinalState *end_state = new QFinalState;
- m_app->addTransition(this, SIGNAL(done()), end_state);
- m_state->addState(end_state);
- connect(m_state, SIGNAL(finished()), this, SLOT(close()));
-
- m_fa = new QFocusAdaptor(this);
- m_browse->assignProperty(m_fa, "progress", 0.0);
- m_zoomed->assignProperty(m_fa, "progress", 1.0);
-
- m_pc = new PanController(this);
- m_pc->setMaxSpeed(m_displaySize / 1000.0f);
- m_browse->assignProperty(m_pc, "speed", 0.0);
- m_pan->assignProperty(m_pc, "speed", 1.0);
-
- m_state->setObjectName("StateMachine");
- m_app->setObjectName("Application");
- m_zoomed->setObjectName("Zoomed");
- m_browse->setObjectName("Browse");
- m_pan->setObjectName("Pan");
- end_state->setObjectName("EndState");
-
- QSignalTransition *transition = m_browse->addTransition(this, SIGNAL(zoom()), m_zoomed);
- QPropertyAnimation *a = new QPropertyAnimation(m_fa, "progress");
- a->setDuration(500);
- a->setEasingCurve(QEasingCurve::OutQuad);
- transition->addAnimation(a);
-
- transition = m_zoomed->addTransition(this, SIGNAL(zoom()), m_browse);
- a = new QPropertyAnimation(m_fa, "progress");
- a->setDuration(500);
- a->setEasingCurve(QEasingCurve::InQuad);
- transition->addAnimation(a);
-
- transition = m_browse->addTransition(this, SIGNAL(pan()), m_pan);
- a = new QPropertyAnimation(m_pc, "speed");
- a->setDuration(500);
- a->setEasingCurve(QEasingCurve::OutQuad);
- transition->addAnimation(a);
-
- transition = m_pan->addTransition(this, SIGNAL(pan()), m_browse);
- a = new QPropertyAnimation(m_pc, "speed");
- a->setDuration(500);
- a->setEasingCurve(QEasingCurve::InQuad);
- transition->addAnimation(a);
-
- m_state->setInitialState(m_app);
- m_state->start();
-}
-
-void PhotoBrowser3DView::initialise()
-{
- QString path = QDir::home().absoluteFilePath("Pictures");
- int ix = qApp->arguments().indexOf("--pictures");
- if (ix != -1)
- {
- if (qApp->arguments().size() > ix+1)
- path = qApp->arguments().at(ix+1);
- else
- qWarning("Expected /path/to/image/files after \"--pictures\" switch\n");
- }
-
- QUrl url;
- url.setScheme("file");
- url.setPath(path);
-
- bool atLeastOneImageFound = false;
- QFileInfo fi(path);
- if (fi.exists() && fi.isDir())
- {
- QDir pics(path);
- QStringList entries = pics.entryList(QDir::Files);
- for (int i = 0; i < entries.size() && !atLeastOneImageFound; ++i)
- {
- QImage im(pics.filePath(entries.at(i)));
- if (!im.isNull())
- atLeastOneImageFound = true;
- }
- }
- if (!atLeastOneImageFound)
- {
- qWarning("No pictures directory found at %s\n"
- "using test images", qPrintable(path));
-
- url.setPath(":/pictures");
- }
-
-#ifdef QT_NO_THREADED_FILE_LOAD
- nonThreadedFileLoad(url);
-#else
- initialiseImageManager(url);
-#endif
-}
-
-void PhotoBrowser3DView::initialiseImageManager(const QUrl &url)
-{
- m_images = new ImageManager;
-
- connect(m_images, SIGNAL(imageUrl(QUrl)), m_display, SLOT(addThumbnailNode(QUrl)));
- connect(m_images, SIGNAL(finished()), this, SLOT(waitForExit()));
-
- connect(m_display, SIGNAL(framesChanged()), this, SLOT(pickableDirty()));
- connect(m_display, SIGNAL(framesChanged()), this, SLOT(update()));
-
- m_images->setImageBaseUrl(url);
- QThread::Priority p = QThread::idealThreadCount() < 2 ?
- QThread::IdlePriority : QThread::NormalPriority;
- m_images->start(p);
-}
-
-void PhotoBrowser3DView::nonThreadedFileLoad(const QUrl &url)
-{
-#if defined(QT_USE_TEST_IMAGES)
- Q_UNUSED(url);
- QDir testImages(":/pictures");
- QStringList pics = testImages.entryList();
- for (int i = 0; i < pics.size(); ++i)
- {
- QUrl url;
- url.setScheme("file");
- url.setPath(testImages.filePath(pics.at(i)));
- m_display->addThumbnailNode(url);
- }
- pickableDirty();
-#else
- FileScanner *scanner = new FileScanner(this);
- scanner->setBaseUrl(url);
- QTimer::singleShot(0, scanner, SLOT(scan()));
- connect(scanner, SIGNAL(imageUrl(QUrl)), m_display, SLOT(addThumbnailNode(QUrl)));
-#endif
-}
-
-void PhotoBrowser3DView::wheelEvent(QWheelEvent *e)
-{
- e->accept();
- QVector3D viewVec = camera()->eye() - camera()->center();
- qreal zoomMag = viewVec.length();
- qreal inc = float(e->delta()) / 50.0f;
- if (!qFuzzyIsNull(inc))
- {
- zoomMag += inc;
- if (zoomMag < 2.0f)
- zoomMag = 2.0f;
- QRay3D viewLine(camera()->center(), viewVec.normalized());
- camera()->setEye(viewLine.point(zoomMag));
- update();
- }
-}
-
-void PhotoBrowser3DView::keyPressEvent(QKeyEvent *e)
-{
- if (e->key() == Qt::Key_Q)
- {
- m_done = true;
- emit done();
- }
- else if (e->key() == Qt::Key_Right)
- {
- m_pc->setDirection(Qt::RightArrow);
- emit pan();
- }
- else if (e->key() == Qt::Key_Left)
- {
- m_pc->setDirection(Qt::LeftArrow);
- emit pan();
- }
- else if (e->key() == Qt::Key_Up || e->key() == Qt::Key_Down)
- {
- QVector3D viewVec = camera()->eye() - camera()->center();
- qreal zoomMag = viewVec.length();
- zoomMag += (e->key() == Qt::Key_Up) ? -0.5f : 0.5f;
- if (zoomMag < 5.0f)
- zoomMag = 5.0f;
- QRay3D viewLine(camera()->center(), viewVec.normalized());
- camera()->setEye(viewLine.point(zoomMag));
- update();
- }
- else
- {
- QGLView::keyPressEvent(e);
- }
-}
-
-void PhotoBrowser3DView::waitForExit()
-{
- QThread::yieldCurrentThread();
- m_images->wait();
- m_images->deleteLater();
- m_images = 0;
- if (m_closing)
- {
- if (!m_done)
- {
- emit done();
- m_done = true;
- }
- }
-}
-
-void PhotoBrowser3DView::closeEvent(QCloseEvent *e)
-{
- if (m_images)
- {
- e->ignore();
- m_images->stop();
-
- // this was a request to close the main window, so we are closing up shop
- // set this flag to indicate that when the image manager stops done event
- // should be signalled to the state machine, resulting in close
- m_closing = true;
- }
- else
- {
- e->accept();
- }
-}
-
-void PhotoBrowser3DView::mousePressEvent(QMouseEvent *e)
-{
- Q_UNUSED(e);
- registerPickableNodes();
- QGLView::mousePressEvent(e);
-}
-
-void PhotoBrowser3DView::initializeGL(QGLPainter *painter)
-{
- Q_UNUSED(painter);
- QAtlas::instance()->initialize(painter);
- camera()->setEye(QVector3D(0.0f, 0.0f, 4.0f * m_displaySize));
- registerPickableNodes();
- qreal q = camera()->eye().z();
- qreal r = qBound(camera()->nearPlane(), q / 2.0f, camera()->nearPlane() * 3.0f);
- m_pc->setDefaultDistance(q);
- m_pc->setPanDistance(r);
-}
-
-void PhotoBrowser3DView::earlyPaintGL(QGLPainter *painter)
-{
- Q_UNUSED(painter);
-
- if (!painter->isPicking())
- {
- QAtlas::instance()->paint(painter);
- }
-
- if (!m_done)
- m_pc->pan();
-
- painter->setClearColor(Qt::blue);
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-}
-
-void PhotoBrowser3DView::paintGL(QGLPainter *painter)
-{
- if (!m_done)
- {
- glEnable(GL_BLEND);
- m_skybox->draw(painter);
- m_display->draw(painter);
- m_buttons->draw(painter);
- }
-}
-
-void PhotoBrowser3DView::resizeGL(int w, int h)
-{
- Q_UNUSED(w);
- Q_UNUSED(h);
- m_buttons->clearPositions();
- m_updateRequired = true;
-}
-
-void PhotoBrowser3DView::zoomImage()
-{
- QGLPickNode *pn = qobject_cast<QGLPickNode*>(sender());
- Q_ASSERT(pn);
- QGLSceneNode *n = pn->target();
- m_fa->setTarget(n);
- emit zoom();
-}
-
-void PhotoBrowser3DView::goPan()
-{
- QGLPickNode *pn = qobject_cast<QGLPickNode*>(sender());
- Q_ASSERT(pn);
- QGLSceneNode *n = pn->target();
- m_pc->setDirection(n->objectName() == "Left Button" ? Qt::LeftArrow : Qt::RightArrow);
- emit pan();
-}
-
-void PhotoBrowser3DView::pickableDirty()
-{
- m_pickableDirty = true;
-}
-
-void PhotoBrowser3DView::registerPickableNodes()
-{
- if (m_pickableDirty)
- {
- m_scene->generatePickNodes();
- QList<QGLPickNode*> pickList = m_scene->pickNodes();
- QList<QGLPickNode*>::const_iterator it = pickList.constBegin();
- for ( ; it != pickList.constEnd(); ++it)
- {
- QGLPickNode *pn = *it;
- pn->disconnect(this);
- ThumbnailNode *node = qobject_cast<ThumbnailNode*>(pn->target());
- if (node)
- QObject::connect(pn, SIGNAL(clicked()), this, SLOT(zoomImage()));
- else
- QObject::connect(pn, SIGNAL(clicked()), this, SLOT(goPan()));
- registerObject(pn->id(), pn);
- }
- m_pickableDirty = false;
- }
-}
diff --git a/demos/qt3d/photobrowser3d/photobrowser3dview.h b/demos/qt3d/photobrowser3d/photobrowser3dview.h
deleted file mode 100644
index 50443c31..00000000
--- a/demos/qt3d/photobrowser3d/photobrowser3dview.h
+++ /dev/null
@@ -1,116 +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 PHOTOBROWSER3DVIEW_H
-#define PHOTOBROWSER3DVIEW_H
-
-#include "qglview.h"
-
-QT_BEGIN_NAMESPACE
-class QGLMaterialCollection;
-class QGLSceneNode;
-class QState;
-class QStateMachine;
-QT_END_NAMESPACE
-
-
-class SkyBox;
-class ImageDisplay;
-class ImageManager;
-class QAtlas;
-class Buttons;
-class QPhotoBrowser3DScene;
-class PanController;
-class QFocusAdaptor;
-
-class PhotoBrowser3DView : public QGLView
-{
- Q_OBJECT
-public:
- PhotoBrowser3DView();
- ~PhotoBrowser3DView();
- void initializeGL(QGLPainter *);
- QPhotoBrowser3DScene *scene() { return m_scene; }
-signals:
- void done();
- void zoom();
- void pan();
-protected:
- void earlyPaintGL(QGLPainter *);
- void paintGL(QGLPainter *);
- void resizeGL(int w, int h);
- void wheelEvent(QWheelEvent *e);
- void keyPressEvent(QKeyEvent *e);
- void closeEvent(QCloseEvent *e);
- void mousePressEvent(QMouseEvent *e);
-private slots:
- void initialise();
- void zoomImage();
- void pickableDirty();
- void waitForExit();
- void goPan();
-private:
- void registerPickableNodes();
- void setupStates();
- void nonThreadedFileLoad(const QUrl &url);
- void initialiseImageManager(const QUrl &url);
-
- QPhotoBrowser3DScene *m_scene;
- ImageDisplay *m_display;
- ImageManager *m_images;
- Buttons *m_buttons;
- SkyBox *m_skybox;
- QGLMaterialCollection *m_palette;
- QStateMachine *m_state;
- QState *m_app;
- QState *m_zoomed;
- QState *m_browse;
- QState *m_pan;
- QFocusAdaptor *m_fa;
- PanController *m_pc;
- bool m_pickableDirty;
- qreal m_displaySize;
- bool m_done;
- bool m_closing;
- bool m_updateRequired;
-};
-
-#endif // PHOTOBROWSER3DVIEW_H
diff --git a/demos/qt3d/photobrowser3d/qatlas.cpp b/demos/qt3d/photobrowser3d/qatlas.cpp
deleted file mode 100644
index 24c9b6a3..00000000
--- a/demos/qt3d/photobrowser3d/qatlas.cpp
+++ /dev/null
@@ -1,188 +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 "qatlas.h"
-#include "qareaallocator.h"
-#include "qgltexture2d.h"
-#include "qglpainter.h"
-#include "qgeometrydata.h"
-#include "qglmaterial.h"
-#include "qglpainter.h"
-#include "qglframebufferobjectsurface.h"
-#include "qglbuilder.h"
-
-#include <QImage>
-#include <QThread>
-#include <QGLFramebufferObject>
-#include <QGLFramebufferObjectFormat>
-#include <QCoreApplication>
-
-#ifndef GL_MULTISAMPLE
-#define GL_MULTISAMPLE 0x809D
-#endif
-
-QAtlas::QAtlas()
- : m_size(1024, 1024)
- , m_data(0)
- , m_renderTarget(0)
- , m_allocator(new QSimpleAreaAllocator(m_size))
- , m_tex(0)
- , m_material(new QGLMaterial)
- , m_initialized(false)
- , m_count(0)
-{
-}
-
-QAtlas::~QAtlas()
-{
- delete m_data;
- delete m_renderTarget;
- delete m_allocator;
-}
-
-void QAtlas::initialize(QGLPainter *painter)
-{
- Q_UNUSED(painter);
- if (!m_initialized)
- {
- m_data = new QGLFramebufferObject(m_size);
- m_renderTarget = new QGLFramebufferObjectSurface(m_data);
- m_tex = QGLTexture2D::fromTextureId(m_data->texture(), m_size);
- m_material->setTexture(m_tex, 1);
- m_material->setObjectName("Atlas material");
- m_initialized = true;
- }
-}
-
-void QAtlas::paint(QGLPainter *painter)
-{
- Q_ASSERT(QThread::currentThread() == qApp->thread());
-
- if (m_allocationQueue.isEmpty() || painter->isPicking())
- return;
-
- glDisable(GL_DEPTH_TEST);
-
- painter->pushSurface(m_renderTarget);
- painter->setStandardEffect(QGL::FlatReplaceTexture2D);
- painter->projectionMatrix().push();
- painter->modelViewMatrix().push();
- QRect rect = painter->currentSurface()->viewportRect();
- QMatrix4x4 proj;
- proj.ortho(rect);
- painter->projectionMatrix() = proj;
- painter->modelViewMatrix().setToIdentity();
-
- painter->update();
-
- QAtlasEntry entry = m_allocationQueue.takeFirst();
-
- QRect a = entry.rect;
- QImage image = entry.image;
-
- if (a.left() == 0 && a.top() == 0) // first one - paint fill color
- {
- painter->setClearColor(Qt::red);
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- }
-
- QGLTexture2D t;
- t.setImage(image);
- t.bind();
- QVector3D va(a.left(), a.bottom()+1, 0);
- QVector3D vb(a.right()+1, a.bottom()+1, 0);
- QVector3D vc(a.right()+1, a.top(), 0);
- QVector3D vd(a.left(), a.top(), 0);
- 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 quad;
- quad.setBufferStrategy(QGeometryData::KeepClientData);
- quad.appendVertex(va, vb, vc, vd);
- quad.appendTexCoord(ta, tb, tc, td);
- quad.appendIndices(0, 1, 2);
- quad.appendIndices(0, 2, 3);
- quad.draw(painter, 0, 6);
-
- painter->popSurface();
-
- glEnable(GL_DEPTH_TEST);
-}
-
-QRect QAtlas::allocate(const QSize &size, const QImage &image, const QGL::IndexArray &indices)
-{
- Q_ASSERT(QThread::currentThread() == qApp->thread());
-
- QRect a = m_allocator->allocate(size);
- if (a.isEmpty())
- {
- qWarning("QAtlas::allocate: overflowed");
- return a;
- }
-
- m_allocationQueue.append(QAtlasEntry(image, a));
- ++m_count;
-
- QRectF af(a);
- QSizeF szf(m_size);
- float l = af.left() / szf.width();
- float r = af.right() / szf.width();
- float t = 1.0f - (af.top() / szf.height());
- float b = 1.0f - (af.bottom() / szf.height());
- m_geometry.texCoord(indices.at(0), QGL::TextureCoord1) = QVector2D(l, b);
- m_geometry.texCoord(indices.at(1), QGL::TextureCoord1) = QVector2D(r, b);
- m_geometry.texCoord(indices.at(2), QGL::TextureCoord1) = QVector2D(r, t);
- m_geometry.texCoord(indices.at(5), QGL::TextureCoord1) = QVector2D(l, t);
- return a;
-}
-
-void QAtlas::release(QRect frame)
-{
- m_allocator->release(frame);
-}
-
-Q_GLOBAL_STATIC(QAtlas, atlasInstance);
-
-QAtlas *QAtlas::instance()
-{
- return atlasInstance();
-}
diff --git a/demos/qt3d/photobrowser3d/qatlas.h b/demos/qt3d/photobrowser3d/qatlas.h
deleted file mode 100644
index 33b5b542..00000000
--- a/demos/qt3d/photobrowser3d/qatlas.h
+++ /dev/null
@@ -1,104 +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 QATLAS_H
-#define QATLAS_H
-
-#include <QSize>
-
-#include "qarray.h"
-#include "qgeometrydata.h"
-
-QT_BEGIN_NAMESPACE
-class QAreaAllocator;
-class QGLTexture2D;
-class QGLMaterial;
-class QGeometryData;
-class QGLFramebufferObject;
-class QGLFramebufferObjectSurface;
-QT_END_NAMESPACE
-
-struct QAtlasEntry
-{
- QAtlasEntry(QImage i, QRect r) : image(i), rect(r) {}
- QImage image;
- QRect rect;
-};
-
-class QAtlas
-{
-public:
- QAtlas();
- ~QAtlas();
-
- QAreaAllocator *allocator() const { return m_allocator; }
- void setAllocator(QAreaAllocator *allocator) { m_allocator = allocator; }
-
- QRect allocate(const QSize &size, const QImage &image, const QGL::IndexArray &indices);
-
- void initialize(QGLPainter *painter);
- void paint(QGLPainter *painter);
-
- void release(QRect frame);
-
- void setGeometry(QGeometryData geometry) { m_geometry = geometry; }
- QGeometryData geometry() { return m_geometry; }
-
- QGLMaterial *material() { return m_material; }
-
- QList<QAtlasEntry> allocationQueue() const { return m_allocationQueue; }
-
- static QAtlas *instance();
-
-private:
- QSize m_size;
- QGLFramebufferObject *m_data;
- QGLFramebufferObjectSurface *m_renderTarget;
- QAreaAllocator *m_allocator;
- QGLTexture2D *m_tex;
- QGLMaterial *m_material;
- QGeometryData m_geometry;
- bool m_initialized;
- QList<QAtlasEntry> m_allocationQueue;
- int m_count;
-};
-
-#endif // QATLAS_H
diff --git a/demos/qt3d/photobrowser3d/qfocusadaptor.cpp b/demos/qt3d/photobrowser3d/qfocusadaptor.cpp
deleted file mode 100644
index 64e93c61..00000000
--- a/demos/qt3d/photobrowser3d/qfocusadaptor.cpp
+++ /dev/null
@@ -1,187 +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 "qfocusadaptor.h"
-#include "qglscenenode.h"
-#include "qglview.h"
-#include "qglcamera.h"
-#include "thumbnailnode.h"
-
-class QFocusAdaptorPrivate
-{
-public:
- QFocusAdaptorPrivate()
- : progress(0.0)
- , reset(true)
- , target(0)
- , view(0)
- {}
- qreal progress;
- QVector3D targetEye;
- QVector3D targetCenter;
- QVector3D sourceEye;
- QVector3D sourceCenter;
- bool reset;
- QGLSceneNode *target;
- QGLView *view;
-};
-
-QFocusAdaptor::QFocusAdaptor(QObject *parent)
- : QObject(parent)
- , d(new QFocusAdaptorPrivate)
-{
- QGLView *v = qobject_cast<QGLView*>(parent);
- if (v)
- d->view = v;
-}
-
-QFocusAdaptor::~QFocusAdaptor()
-{
- delete d;
-}
-
-qreal QFocusAdaptor::progress() const
-{
- return d->progress;
-}
-
-void QFocusAdaptor::setProgress(qreal progress)
-{
- if (d->progress != progress)
- {
- d->progress = progress;
- calculateValues();
- emit progressChanged();
- }
-}
-
-QGLView *QFocusAdaptor::view() const
-{
- return d->view;
-}
-
-void QFocusAdaptor::setView(QGLView *view)
-{
- d->view = view;
- d->reset = true;
-}
-
-QGLSceneNode *QFocusAdaptor::target() const
-{
- return d->target;
-}
-
-void QFocusAdaptor::setTarget(QGLSceneNode *target)
-{
- if (d->target != target)
- {
- d->target = target;
- d->reset = true;
- }
-}
-
-void QFocusAdaptor::calculateValues()
-{
- if (d->target && d->view)
- {
- QGLCamera *cam = d->view->camera();
- Q_ASSERT(cam);
- if (d->reset)
- {
- QGeometryData data = d->target->geometry();
- if (data.count() == 0 || d->target->count() == 0)
- {
- qWarning("Could not setup focus animation");
- return;
- }
- // assume that the first triangle referenced by this node is the one
- // you want to focus on - works for simple rects and like cases
- QGL::IndexArray ixs = data.indices();
- QVector3D a = data.vertexAt(ixs.at(d->target->start()));
- QVector3D b = data.vertexAt(ixs.at(d->target->start() + 1));
- QVector3D c = data.vertexAt(ixs.at(d->target->start() + 2));
-
- // assumes that first triangle is facing the camera
- QVector3D toCam = QVector3D::normal(a, b, c);
-
- // wont work very well if the target is not axis-aligned
- // find the distance q for the eye to be away from this object
- // in order that it is a tight fit in the viewport
- QGeometryData g = d->target->geometry();
- QGL::IndexArray inxs = g.indices();
- QBox3D box;
- for (int i = d->target->start(); i < (d->target->start() + d->target->count()); ++i)
- box.unite(g.vertexAt(inxs.at(i)));
- QVector3D sz = box.size();
-
- qreal nearDist = cam->nearPlane();
-
- QSizeF v = cam->viewSize();
-
- qreal vh = d->view->rect().height();
- qreal vw = d->view->rect().width();
- if (!qFuzzyIsNull(vw - vh))
- {
- qreal asp = vh / vw;
- if (vh > vw)
- v.setHeight(v.height() * asp);
- else
- v.setWidth(v.width() / asp);
- }
-
- qreal qh = (nearDist * sz.y()) / v.height();
- qreal qw = (nearDist * sz.x()) / v.width();
-
- qreal q = qMax(qh, qw);
- q = qMax(q, qreal(nearDist * 1.05));
-
- d->sourceCenter = cam->center();
- d->sourceEye = cam->eye();
-
- d->targetCenter = d->target->position();
- d->targetEye = d->targetCenter + (toCam * q);
-
- d->reset = false;
- }
- cam->setCenter(d->sourceCenter + ((d->targetCenter - d->sourceCenter) * d->progress));
- cam->setEye(d->sourceEye + ((d->targetEye - d->sourceEye) * d->progress));
- }
-}
diff --git a/demos/qt3d/photobrowser3d/qfocusadaptor.h b/demos/qt3d/photobrowser3d/qfocusadaptor.h
deleted file mode 100644
index 8d0fe895..00000000
--- a/demos/qt3d/photobrowser3d/qfocusadaptor.h
+++ /dev/null
@@ -1,82 +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 QFOCUSADAPTOR_H
-#define QFOCUSADAPTOR_H
-
-#include <QObject>
-
-QT_BEGIN_NAMESPACE
-class QGLView;
-class QGLSceneNode;
-QT_END_NAMESPACE
-
-class QFocusAdaptorPrivate;
-
-class QFocusAdaptor : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(qreal progress READ progress WRITE setProgress NOTIFY progressChanged)
-public:
- explicit QFocusAdaptor(QObject *parent = 0);
- ~QFocusAdaptor();
-
- qreal progress() const;
- void setProgress(qreal progress);
-
- QGLView *view() const;
- void setView(QGLView *view);
-
- QGLSceneNode *target() const;
- void setTarget(QGLSceneNode *target);
-
-signals:
- void progressChanged();
-
-public slots:
-
-private:
- void calculateValues();
-
- QFocusAdaptorPrivate *d;
-};
-
-#endif // QFOCUSADAPTOR_H
diff --git a/demos/qt3d/photobrowser3d/qphotobrowser3dscene.cpp b/demos/qt3d/photobrowser3d/qphotobrowser3dscene.cpp
deleted file mode 100644
index e05e7d46..00000000
--- a/demos/qt3d/photobrowser3d/qphotobrowser3dscene.cpp
+++ /dev/null
@@ -1,58 +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 "qphotobrowser3dscene.h"
-#include "qglscenenode.h"
-
-QPhotoBrowser3DScene::QPhotoBrowser3DScene(QObject *parent)
- : QGLAbstractScene(parent)
- , m_rootNode(new QGLSceneNode(this))
-{
-}
-
-QList<QObject *> QPhotoBrowser3DScene::objects() const
-{
- QList<QGLSceneNode *> children = m_rootNode->allChildren();
- QList<QObject *> objects;
- for (int index = 0; index < children.size(); ++index)
- objects.append(children.at(index));
- return objects;
-}
diff --git a/demos/qt3d/photobrowser3d/qphotobrowser3dscene.h b/demos/qt3d/photobrowser3d/qphotobrowser3dscene.h
deleted file mode 100644
index 73eb7159..00000000
--- a/demos/qt3d/photobrowser3d/qphotobrowser3dscene.h
+++ /dev/null
@@ -1,62 +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 QFRAMESSCENE_H
-#define QFRAMESSCENE_H
-
-#include "qglabstractscene.h"
-
-QT_BEGIN_NAMESPACE
-class QGLSceneNode;
-QT_END_NAMESPACE
-
-class QPhotoBrowser3DScene : public QGLAbstractScene
-{
- Q_OBJECT
-public:
- explicit QPhotoBrowser3DScene(QObject *parent = 0);
- virtual QList<QObject *> objects() const;
- QGLSceneNode *mainNode() const { return m_rootNode; }
-private:
- QGLSceneNode *m_rootNode;
-};
-
-#endif // QFRAMESSCENE_H
diff --git a/demos/qt3d/photobrowser3d/qt3d.ico b/demos/qt3d/photobrowser3d/qt3d.ico
deleted file mode 100644
index e6442baf..00000000
--- a/demos/qt3d/photobrowser3d/qt3d.ico
+++ /dev/null
Binary files differ
diff --git a/demos/qt3d/photobrowser3d/qt3d.png b/demos/qt3d/photobrowser3d/qt3d.png
deleted file mode 100644
index 21ec0176..00000000
--- a/demos/qt3d/photobrowser3d/qt3d.png
+++ /dev/null
Binary files differ
diff --git a/demos/qt3d/photobrowser3d/shaders/replace_texture.fsh b/demos/qt3d/photobrowser3d/shaders/replace_texture.fsh
deleted file mode 100644
index bb5e6107..00000000
--- a/demos/qt3d/photobrowser3d/shaders/replace_texture.fsh
+++ /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$
-**
-****************************************************************************/
-
-// This is equivilent to GL_REPLACE
-varying highp vec4 qt_TexCoord0;
-uniform bool picking;
-uniform mediump vec4 color;
-uniform sampler2D texture;
-
-void main(void)
-{
- if (picking)
- gl_FragColor = color;
- else
- gl_FragColor = texture2D(texture, qt_TexCoord0.st);
-}
diff --git a/demos/qt3d/photobrowser3d/shaders/replace_texture.vsh b/demos/qt3d/photobrowser3d/shaders/replace_texture.vsh
deleted file mode 100644
index 02a14fc5..00000000
--- a/demos/qt3d/photobrowser3d/shaders/replace_texture.vsh
+++ /dev/null
@@ -1,58 +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$
-**
-****************************************************************************/
-
-attribute highp vec4 vertex;
-attribute highp vec4 texcoord;
-attribute highp vec4 thumbcoord;
-
-uniform highp mat4 matrix;
-uniform bool thumb;
-
-varying highp vec4 qt_TexCoord0;
-
-void main(void)
-{
- if (thumb)
- qt_TexCoord0 = thumbcoord;
- else
- qt_TexCoord0 = texcoord;
- gl_Position = matrix * vertex;
-}
diff --git a/demos/qt3d/photobrowser3d/skybox.cpp b/demos/qt3d/photobrowser3d/skybox.cpp
deleted file mode 100644
index 3162a76d..00000000
--- a/demos/qt3d/photobrowser3d/skybox.cpp
+++ /dev/null
@@ -1,223 +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 "skybox.h"
-#include "qglbuilder.h"
-#include "qglcube.h"
-#include "qglpainter.h"
-#include "qglview.h"
-
-#include <QDir>
-#include <QFileInfo>
-
-SkyBox::SkyBox(QGLView *view, const QString &imagePath)
- : m_scene(0)
- , m_view(view)
- , m_camera(new QGLCamera(this))
-{
- m_camera->setEye(QVector3D());
- m_camera->setNearPlane(0.3f);
- m_camera->setViewSize(QSizeF(0.3f, 0.3f));
-
- QGLBuilder builder;
- builder.newSection(QGL::Faceted);
- QVector3D blb(-1.0, -1.0, -1.0);
- QVector3D blf(-1.0, -1.0, 1.0);
- QVector3D tlf(-1.0, 1.0, 1.0);
- QVector3D tlb(-1.0, 1.0, -1.0);
- QVector3D brb(1.0, -1.0, -1.0);
- QVector3D brf(1.0, -1.0, 1.0);
- QVector3D trf(1.0, 1.0, 1.0);
- QVector3D trb(1.0, 1.0, -1.0);
- QVector2D bl(0.0f, 0.0f);
- QVector2D br(1.0f, 0.0f);
- QVector2D tr(1.0f, 1.0f);
- QVector2D tl(0.0f, 1.0f);
- {
- QGeometryData q; // left
- builder.currentNode()->setObjectName("left");
- q.appendVertex(blf, blb, tlb, tlf);
- q.appendTexCoord(bl, br, tr, tl);
- builder.addQuads(q);
- m_faces[0] = builder.currentNode();
- m_faces[0]->setMaterial(new QGLMaterial);
- }
- {
- builder.newNode(); // top
- builder.currentNode()->setObjectName("top");
- QGeometryData q;
- q.appendVertex(trf, tlf, tlb, trb);
- q.appendTexCoord(bl, br, tr, tl);
- builder.addQuads(q);
- m_faces[1] = builder.currentNode();
- m_faces[1]->setMaterial(new QGLMaterial);
- }
- {
- builder.newNode(); // right
- builder.currentNode()->setObjectName("right");
- QGeometryData q;
- q.appendVertex(brb, brf, trf, trb);
- q.appendTexCoord(bl, br, tr, tl);
- builder.addQuads(q);
- m_faces[2] = builder.currentNode();
- m_faces[2]->setMaterial(new QGLMaterial);
- }
- {
- builder.newNode(); // bottom
- builder.currentNode()->setObjectName("bottom");
- QGeometryData q;
- q.appendVertex(brb, blb, blf, brf);
- q.appendTexCoord(bl, br, tr, tl);
- builder.addQuads(q);
- m_faces[3] = builder.currentNode();
- m_faces[3]->setMaterial(new QGLMaterial);
- }
- {
- builder.newNode(); // front
- builder.currentNode()->setObjectName("front");
- QGeometryData q;
- q.appendVertex(brf, blf, tlf, trf);
- q.appendTexCoord(bl, br, tr, tl);
- builder.addQuads(q);
- m_faces[4] = builder.currentNode();
- m_faces[4]->setMaterial(new QGLMaterial);
- }
- {
- builder.newNode(); // back
- builder.currentNode()->setObjectName("back");
- QGeometryData q;
- q.appendVertex(blb, brb, trb, tlb);
- q.appendTexCoord(bl, br, tr, tl);
- builder.addQuads(q);
- m_faces[5] = builder.currentNode();
- m_faces[5]->setMaterial(new QGLMaterial);
- }
- m_scene = builder.finalizedSceneNode();
- m_scene->setObjectName("SkyboxList");
- m_scene->setEffect(QGL::FlatReplaceTexture2D);
- m_scene->setEffectEnabled(true);
- m_scene->setParent(this);
-
- QString resourceBase = QLatin1String(":/");
- setImagePath(imagePath.isEmpty() ? resourceBase : imagePath);
-}
-
-
-void SkyBox::setImagePath(const QString &imagePath)
-{
- static QStringList expected2;
- static QStringList expected;
-
- if (expected.isEmpty())
- expected << QLatin1String("east") << QLatin1String("up") << QLatin1String("west")
- << QLatin1String("down") << QLatin1String("south") << QLatin1String("north");
- if (expected2.isEmpty())
- expected2 << QLatin1String("right") << QLatin1String("top") << QLatin1String("left")
- << QLatin1String("bottom") << QLatin1String("front") << QLatin1String("back");
- if (imagePath != m_imagePath)
- {
- m_imagePath = imagePath;
- QStringList notFound = expected;
- QFileInfo info(m_imagePath);
- if (info.exists() && info.isDir())
- {
- QDir imDir(imagePath);
- QFileInfoList files = imDir.entryInfoList(QDir::Files);
- QFileInfoList::const_iterator it = files.constBegin();
- for ( ; it != files.constEnd() && notFound.size() > 0; ++it)
- {
- QFileInfo ent = *it;
- QString tok = ent.baseName().toLower();
- int ix = 0;
- for ( ; ix < 6; ++ix)
- if (tok.contains(expected.at(ix)))
- break;
- if (ix == 6)
- {
- ix = 0;
- for ( ; ix < 6; ++ix)
- if (tok.contains(expected2.at(ix)))
- break;
- }
- if (ix != 6)
- {
- notFound.removeOne(expected.at(ix));
- QUrl url;
- url.setScheme("file");
- url.setPath(ent.absoluteFilePath());
- m_faces[ix]->material()->setTextureUrl(url);
- m_faces[ix]->material()->texture()->setHorizontalWrap(QGL::ClampToEdge);
- m_faces[ix]->material()->texture()->setVerticalWrap(QGL::ClampToEdge);
- }
- }
- if (notFound.size() > 2)
- {
- qWarning("Could not load textures for");
- for (int i = 0; i < notFound.size(); ++i)
- qWarning("\t%s", qPrintable(notFound.at(i)));
- }
- }
- else
- {
- qWarning("SkyBox::setImagePath: Not an existing directory %s",
- qPrintable(m_imagePath));
- }
- }
-}
-
-void SkyBox::draw(QGLPainter *painter) const
-{
- painter->modelViewMatrix().push();
- painter->modelViewMatrix().setToIdentity();
-
- QGLCamera *cam = m_view->camera();
- m_camera->setCenter(-cam->eye());
- painter->setCamera(m_camera);
-
- glDisable(GL_DEPTH_TEST);
-
- m_scene->draw(painter);
-
- glEnable(GL_DEPTH_TEST);
-
- painter->setCamera(cam);
- painter->modelViewMatrix().pop();
-}
diff --git a/demos/qt3d/photobrowser3d/skybox.h b/demos/qt3d/photobrowser3d/skybox.h
deleted file mode 100644
index 79b17219..00000000
--- a/demos/qt3d/photobrowser3d/skybox.h
+++ /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 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 SKYBOX_H
-#define SKYBOX_H
-
-#include <QString>
-#include <QObject>
-
-QT_BEGIN_NAMESPACE
-class QGLBuilder;
-class QGLSceneNode;
-class QGLPainter;
-class QGLView;
-class QGLCamera;
-QT_END_NAMESPACE
-
-class SkyBox : public QObject
-{
- Q_OBJECT
-public:
- SkyBox(QGLView *view, const QString &imagePath = QString());
- QString imagePath() const { return m_imagePath; }
- void setImagePath(const QString &imagePath);
- void draw(QGLPainter *painter) const;
-private:
- QGLSceneNode *m_scene;
- QString m_imagePath;
- QGLSceneNode *m_faces[6];
- QGLView *m_view;
- QGLCamera *m_camera;
-};
-
-#endif // SKYBOX_H
diff --git a/demos/qt3d/photobrowser3d/threadpool.cpp b/demos/qt3d/photobrowser3d/threadpool.cpp
deleted file mode 100644
index 01517d59..00000000
--- a/demos/qt3d/photobrowser3d/threadpool.cpp
+++ /dev/null
@@ -1,135 +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 "threadpool.h"
-#include "imageloader.h"
-#include "imagemanager.h"
-
-#include <QSemaphore>
-
-ThreadPool::ThreadPool()
-{
- m_threadPoolSize = QThread::idealThreadCount();
- if (m_threadPoolSize < 2)
- m_threadPoolSize = 2;
- m_stop = 0;
-}
-
-ThreadPool::~ThreadPool()
-{
- Q_ASSERT(m_allWorkers.size() == 0);
-}
-
-void ThreadPool::deployLoader(const ThumbnailableImage &image)
-{
- // INVARIANT: this critical section is only ever executed from its
- // own thread via queued signals - thus access to it is serialized
- Q_ASSERT(QThread::currentThread() == thread());
-
- if (m_stop)
- return;
-
- ImageManager *manager = qobject_cast<ImageManager*>(sender());
- Q_ASSERT(manager);
-
- ImageLoader *loader = 0;
- if (m_freeWorkers.size() > 0)
- loader = m_freeWorkers.takeFirst();
-
- if (loader)
- {
- loader->setImage(image);
- }
- else
- {
- if (m_allWorkers.size() < m_threadPoolSize)
- {
- loader = new ImageLoader;
- m_allWorkers.append(loader);
- loader->setImage(image);
- connect(loader, SIGNAL(imageLoaded(ThumbnailableImage)), manager,
- SIGNAL(imageReady(ThumbnailableImage)));
- connect(loader, SIGNAL(imageLoaded(ThumbnailableImage)), this,
- SLOT(retrieveLoader()));
- connect(loader, SIGNAL(finished()), this, SLOT(closeLoader()));
- connect(this, SIGNAL(stopAll()), loader, SLOT(stop()));
- loader->start();
- }
- else
- {
- m_workList.append(image);
- }
- }
-}
-
-void ThreadPool::retrieveLoader()
-{
- ImageLoader *loader = qobject_cast<ImageLoader*>(sender());
- Q_ASSERT(loader);
- if (!m_stop)
- {
- if (!m_workList.isEmpty())
- loader->setImage(m_workList.takeFirst());
- else
- m_freeWorkers.append(loader);
- }
-}
-
-void ThreadPool::stop()
-{
- m_stop.ref();
- if (m_allWorkers.isEmpty())
- emit stopped();
- else
- emit stopAll();
-}
-
-void ThreadPool::closeLoader()
-{
- ImageLoader *loader = qobject_cast<ImageLoader*>(sender());
- Q_ASSERT(loader);
- m_allWorkers.removeOne(loader);
- loader->deleteLater();
- if (m_allWorkers.isEmpty() && m_stop)
- {
- emit stopped();
- }
-}
diff --git a/demos/qt3d/photobrowser3d/threadpool.h b/demos/qt3d/photobrowser3d/threadpool.h
deleted file mode 100644
index ff13b2b1..00000000
--- a/demos/qt3d/photobrowser3d/threadpool.h
+++ /dev/null
@@ -1,81 +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 LOADINGJOB_H
-#define LOADINGJOB_H
-
-#include <QObject>
-#include <QAtomicInt>
-#include <QList>
-#include <QUrl>
-
-#include "thumbnailableimage.h"
-
-class ImageLoader;
-
-class ThreadPool : public QObject
-{
- Q_OBJECT
-public:
- ThreadPool();
- ~ThreadPool();
-
-signals:
- void stopped();
- void stopAll();
-
-public slots:
- void deployLoader(const ThumbnailableImage &url);
- void stop();
-
-private slots:
- void retrieveLoader();
- void closeLoader();
-
-private:
- QList<ImageLoader*> m_freeWorkers;
- QList<ImageLoader*> m_allWorkers;
- QList<ThumbnailableImage> m_workList;
- QAtomicInt m_stop;
- int m_threadPoolSize;
-};
-
-#endif // LOADINGJOB_H
diff --git a/demos/qt3d/photobrowser3d/thumbnailableimage.cpp b/demos/qt3d/photobrowser3d/thumbnailableimage.cpp
deleted file mode 100644
index 970d31c4..00000000
--- a/demos/qt3d/photobrowser3d/thumbnailableimage.cpp
+++ /dev/null
@@ -1,302 +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 "thumbnailableimage.h"
-#include "qareaallocator.h"
-#include "qgltexture2d.h"
-#include "qglmaterial.h"
-#include "qatlas.h"
-
-#include <QUrl>
-
-class ThumbnailableImagePrivate
-{
-public:
- ThumbnailableImagePrivate();
- ~ThumbnailableImagePrivate();
-
- ThumbnailableImagePrivate *clone() const
- {
- ThumbnailableImagePrivate *temp = new ThumbnailableImagePrivate;
- temp->thumbnailed = thumbnailed;
- temp->pending = pending;
- temp->url = url;
- temp->data = data;
- temp->tex = tex;
- temp->mat = mat;
- temp->frame = frame;
- temp->scale = scale;
- temp->indices = indices;
- return temp;
- }
-
- QBasicAtomicInt ref;
-
- bool thumbnailed;
- bool pending;
- QUrl url;
- QImage data;
- QGLTexture2D *tex;
- QGLMaterial *mat;
- QRect frame;
- qreal scale;
- QGL::IndexArray indices;
-};
-
-ThumbnailableImagePrivate::ThumbnailableImagePrivate()
- : thumbnailed(false)
- , pending(false)
- , tex(0)
- , mat(0)
- , scale(15.0f)
-{
- ref = 0;
-}
-
-ThumbnailableImagePrivate::~ThumbnailableImagePrivate()
-{
-}
-
-ThumbnailableImage::ThumbnailableImage()
- : d(0)
-{
-}
-
-/*!
- Construct ThumbnailableImage as a copy of \a other
-*/
-ThumbnailableImage::ThumbnailableImage(const ThumbnailableImage &other)
- : d(other.d)
-{
- if (d)
- d->ref.ref();
-}
-
-/*!
- Destroys this ThumbnailableImage recovering any resources.
-*/
-ThumbnailableImage::~ThumbnailableImage()
-{
- if (d && !d->ref.deref())
- delete d;
-}
-
-/*!
- Assigns this ThumbnailableImage to be a copy of \a other.
-*/
-ThumbnailableImage &ThumbnailableImage::operator=(const ThumbnailableImage &other)
-{
- if (d != other.d)
- {
- if (d && !d->ref.deref())
- delete d;
- d = other.d;
- if (d)
- d->ref.ref();
- }
- return *this;
-}
-
-void ThumbnailableImage::setThumbnailed(bool enable)
-{
- detach();
- if (enable != d->thumbnailed && !d->data.isNull())
- {
- if (enable)
- {
- if (d->frame.isNull())
- {
- Q_ASSERT(!d->data.isNull());
- QSize sz = (QSizeF(d->data.size()) / d->scale).toSize();
- QAtlas *atlas = QAtlas::instance();
- d->frame = atlas->allocate(sz, d->data, d->indices);
- d->pending = true;
- }
- }
- if (!d->pending)
- d->thumbnailed = enable;
- }
-}
-
-bool ThumbnailableImage::isThumbnailed() const
-{
- bool result = false;
- if (d)
- {
- if (d->pending)
- {
- QList<QAtlasEntry> queue = QAtlas::instance()->allocationQueue();
- int i = 0;
- for ( ; i < queue.count(); ++i)
- if (d->frame == queue.at(i).rect)
- break;
- if (i == queue.count())
- {
- d->pending = false;
- d->thumbnailed = true;
- }
- }
- result = d->thumbnailed;
- }
- return result;
-}
-
-QImage ThumbnailableImage::data() const
-{
- QImage result;
- if (d)
- result = d->data;
- return result;
-}
-
-void ThumbnailableImage::setData(QImage data)
-{
- detach();
- d->data = data;
-}
-
-QUrl ThumbnailableImage::url() const
-{
- QUrl result;
- if (d)
- result = d->url;
- return result;
-}
-
-void ThumbnailableImage::setUrl(const QUrl &url)
-{
- detach();
- d->url = url;
-}
-
-QRectF ThumbnailableImage::frame() const
-{
- QRectF result;
- if (d)
- result = d->frame;
- return result;
-}
-
-qreal ThumbnailableImage::scale() const
-{
- qreal result = 0.0f;
- if (d)
- result = d->scale;
- return result;
-}
-
-void ThumbnailableImage::minimize()
-{
- if (!d)
- return;
- detach();
- if (!isMinimized())
- {
- if (d->thumbnailed)
- {
- // If thumbnailed, I don't really need the full size image
- d->data = QImage();
- }
- else
- {
- // If not thumbnailed, I don't need the atlas resources
- QAtlas *atlas = QAtlas::instance();
- atlas->release(d->frame);
- d->frame = QRect();
- }
- }
-}
-
-bool ThumbnailableImage::isMinimized() const
-{
- bool result = true;
- if (d)
- result = (d->thumbnailed) ? (d->data.isNull()) : (d->frame.isNull());
- return result;
-}
-
-void ThumbnailableImage::setIndices(const QGL::IndexArray &indices)
-{
- detach();
- d->indices = indices;
-}
-
-QGL::IndexArray ThumbnailableImage::indices() const
-{
- QGL::IndexArray result;
- if (d)
- result = d->indices;
- return result;
-}
-
-/*!
- \internal
- You know what this is for. No user serviceable parts below here.
-*/
-void ThumbnailableImage::detach()
-{
- if (!d) // lazy creation of data block
- {
- d = new ThumbnailableImagePrivate;
- d->ref.ref();
- }
- else
- {
- if (d->ref > 1) // being shared, must detach
- {
- ThumbnailableImagePrivate *temp = d->clone();
- d->ref.deref();
- d = temp;
- d->ref.ref();
- }
- }
-}
-
-#ifndef QT_NO_DEBUG_STREAM
-QDebug operator<<(QDebug dbg, const ThumbnailableImage &image)
-{
- dbg << "ThumbnailableImage" << image.url() << "size:" << image.data().size() <<
- "minimized:" << image.isMinimized() << "-- thumbnailed:" << image.isThumbnailed()
- << "-- null:" << image.isNull() << "-- image loaded:" << (!image.data().isNull())
- << "-- index count:" << image.indices().count();
- return dbg;
-}
-#endif
diff --git a/demos/qt3d/photobrowser3d/thumbnailableimage.h b/demos/qt3d/photobrowser3d/thumbnailableimage.h
deleted file mode 100644
index 2f5b5b98..00000000
--- a/demos/qt3d/photobrowser3d/thumbnailableimage.h
+++ /dev/null
@@ -1,101 +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 THUMBNAILABLEIMAGE_H
-#define THUMBNAILABLEIMAGE_H
-
-#include <QRectF>
-#include <QMetaType>
-
-#include "qarray.h"
-#include "qgeometrydata.h"
-
-QT_BEGIN_NAMESPACE
-class QImage;
-class QGLPainter;
-QT_END_NAMESPACE
-
-class ThumbnailableImagePrivate;
-
-class ThumbnailableImage
-{
-public:
- ThumbnailableImage();
- ThumbnailableImage(const ThumbnailableImage&);
- ~ThumbnailableImage();
-
- ThumbnailableImage &operator=(const ThumbnailableImage &);
-
- void setThumbnailed(bool enable);
- bool isThumbnailed() const;
-
- QImage data() const;
- void setData(QImage data);
-
- QUrl url() const;
- void setUrl(const QUrl &url);
-
- QRectF frame() const;
- qreal scale() const;
-
- void minimize();
- bool isMinimized() const;
-
- QGL::IndexArray indices() const;
- void setIndices(const QGL::IndexArray &indices);
-
- bool isNull() const { return d == 0; }
-
- ThumbnailableImagePrivate *priv() const { return d; } /// debug = remove me
-
-private:
- void detach();
-
- ThumbnailableImagePrivate *d;
-};
-
-Q_DECLARE_METATYPE(ThumbnailableImage);
-
-#ifndef QT_NO_DEBUG_STREAM
-QDebug operator<<(QDebug dbg, const ThumbnailableImage &image);
-#endif
-
-#endif // THUMBNAILABLEIMAGE_H
diff --git a/demos/qt3d/photobrowser3d/thumbnaileffect.cpp b/demos/qt3d/photobrowser3d/thumbnaileffect.cpp
deleted file mode 100644
index 927bf8b7..00000000
--- a/demos/qt3d/photobrowser3d/thumbnaileffect.cpp
+++ /dev/null
@@ -1,186 +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 "thumbnaileffect.h"
-
-#include <QtOpenGL/qglshaderprogram.h>
-
-class ThumbnailEffectPrivate
-{
-public:
- ThumbnailEffectPrivate()
- : program(0)
- , matrixUniform(-1)
- , thumbnailUniform(-1)
- , thumbnail(false)
- , thumbnailUpdateRequired(false)
- {
- }
- ~ThumbnailEffectPrivate() { delete program; }
-
- QGLShaderProgram *program;
- int matrixUniform;
- int thumbnailUniform;
- int colorUniform;
- int pickingUniform;
- // true if we render a thumbnail, false do the large size
- bool thumbnail;
- bool thumbnailUpdateRequired;
-};
-
-/*!
- Constructs a new flat texture effect.
-*/
-ThumbnailEffect::ThumbnailEffect()
- : d(new ThumbnailEffectPrivate)
-{
-}
-
-/*!
- Destroys this flat texture effect.
-*/
-ThumbnailEffect::~ThumbnailEffect()
-{
- delete d;
-}
-
-/*!
- \reimp
-*/
-QList<QGL::VertexAttribute> ThumbnailEffect::requiredFields() const
-{
- QList<QGL::VertexAttribute> fields;
- fields += QGL::Position;
- fields += QGL::TextureCoord0;
- fields += QGL::TextureCoord1;
- return fields;
-}
-
-/*!
- \reimp
-*/
-void ThumbnailEffect::setActive(QGLPainter *painter, bool flag)
-{
- Q_UNUSED(painter);
- if (!d->program) {
- if (!flag)
- return;
- d->program = new QGLShaderProgram();
- d->program->addShaderFromSourceFile(QGLShader::Vertex, ":/shaders/replace_texture.vsh");
- d->program->addShaderFromSourceFile(QGLShader::Fragment, ":/shaders/replace_texture.fsh");
- d->program->bindAttributeLocation("vertex", QGL::Position);
- d->program->bindAttributeLocation("texcoord", QGL::TextureCoord0);
- d->program->bindAttributeLocation("thumbcoord", QGL::TextureCoord1);
- if (!d->program->link()) {
- qWarning("ThumbnailEffect::setActive(): could not link shader d->program");
- delete d->program;
- d->program = 0;
- return;
- }
- d->matrixUniform = d->program->uniformLocation("matrix");
- d->thumbnailUniform = d->program->uniformLocation("thumb");
- d->colorUniform = d->program->uniformLocation("color");
- d->pickingUniform = d->program->uniformLocation("picking");
- d->program->bind();
- d->program->setUniformValue("texture", 0);
- d->program->enableAttributeArray(QGL::Position);
- d->program->enableAttributeArray(QGL::TextureCoord0);
- d->program->enableAttributeArray(QGL::TextureCoord1);
- } else if (flag) {
- d->matrixUniform = d->program->uniformLocation("matrix");
- d->program->bind();
- d->program->setUniformValue("texture", 0);
- d->program->enableAttributeArray(QGL::Position);
- d->program->enableAttributeArray(QGL::TextureCoord0);
- d->program->enableAttributeArray(QGL::TextureCoord1);
- } else {
- d->program->disableAttributeArray(QGL::Position);
- d->program->disableAttributeArray(QGL::TextureCoord0);
- d->program->disableAttributeArray(QGL::TextureCoord1);
- d->program->release();
- }
-}
-
-/*!
- \reimp
-*/
-void ThumbnailEffect::update
- (QGLPainter *painter, QGLPainter::Updates updates)
-{
- Q_ASSERT(d->program);
- if ((updates & QGLPainter::UpdateMatrices) != 0)
- {
- d->program->setUniformValue(d->matrixUniform,
- painter->combinedMatrix());
- }
- if ((updates & QGLPainter::UpdateColor) != 0) {
- d->program->setUniformValue(d->pickingUniform, painter->isPicking());
- if (painter->isPicking())
- d->program->setUniformValue(d->colorUniform, painter->pickColor());
- else
- d->program->setUniformValue(d->colorUniform, Qt::green);
- }
- if (d->thumbnailUpdateRequired)
- {
- d->program->setUniformValue(d->thumbnailUniform, d->thumbnail);
- d->thumbnailUpdateRequired = false;
- }
-}
-
-bool ThumbnailEffect::supportsPicking() const
-{
- return true;
-}
-
-
-void ThumbnailEffect::setThumbnail(bool enable)
-{
- if (d->thumbnail != enable)
- {
- d->thumbnailUpdateRequired = true;
- d->thumbnail = enable;
- }
-}
-
-bool ThumbnailEffect::thumbnail() const
-{
- return d->thumbnail;
-}
diff --git a/demos/qt3d/photobrowser3d/thumbnaileffect.h b/demos/qt3d/photobrowser3d/thumbnaileffect.h
deleted file mode 100644
index 488887de..00000000
--- a/demos/qt3d/photobrowser3d/thumbnaileffect.h
+++ /dev/null
@@ -1,70 +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 QGLFLATTEXTUREEFFECT_H
-#define QGLFLATTEXTUREEFFECT_H
-
-#include "qglabstracteffect.h"
-#include <QtCore/qscopedpointer.h>
-
-class ThumbnailEffectPrivate;
-
-class ThumbnailEffect : public QGLAbstractEffect
-{
-public:
- ThumbnailEffect();
- virtual ~ThumbnailEffect();
-
- QList<QGL::VertexAttribute> requiredFields() const;
- void setActive(QGLPainter *painter, bool flag);
- void update(QGLPainter *painter, QGLPainter::Updates updates);
- bool supportsPicking() const;
-
- void setThumbnail(bool enable);
- bool thumbnail() const;
-
- QString name() const { return QLatin1String("ThumbnailEffect"); }
-
-private:
- ThumbnailEffectPrivate *d;
-};
-
-#endif
diff --git a/demos/qt3d/photobrowser3d/thumbnailnode.cpp b/demos/qt3d/photobrowser3d/thumbnailnode.cpp
deleted file mode 100644
index f80bec8c..00000000
--- a/demos/qt3d/photobrowser3d/thumbnailnode.cpp
+++ /dev/null
@@ -1,281 +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 "thumbnailnode.h"
-#include "qglpainter.h"
-#include "thumbnaileffect.h"
-#include "imagemanager.h"
-#include "qatlas.h"
-#include "qglrendersequencer.h"
-#include "qglpicknode.h"
-#include "qlogicalvertex.h"
-
-#include <QMatrix4x4>
-#include <QTimer>
-
-ThumbnailNode::ThumbnailNode(QObject *parent)
- : QGLSceneNode(parent)
- , m_thresholdSquared(20.0f * 20.0f)
- , m_defaultMaterial(-1)
- , m_loading(false)
- , m_full(0)
- , m_manager(0)
- , m_lastDistance(ThumbnailNode::Unknown)
-{
- setPalette(new QGLMaterialCollection(this));
-}
-
-ThumbnailNode::~ThumbnailNode()
-{
- delete m_full;
-}
-
-void ThumbnailNode::setUrl(const QUrl &url)
-{
- m_url = url;
- m_image = ThumbnailableImage();
- m_image.setUrl(m_url);
- QGL::IndexArray inxs = geometry().indices();
- m_image.setIndices(inxs.mid(start(), count()));
-}
-
-void ThumbnailNode::setupLoading()
-{
- if (!m_loading && !m_url.isEmpty() && m_image.data().isNull())
- {
- m_loading = true;
-#ifdef QT_NO_THREADED_FILE_LOAD
- ThumbnailableImage image;
- image.setUrl(m_url);
- QImage im(m_url.toLocalFile());
- if (im.isNull())
- qDebug() << "ThumbnailNode::setupLoading: could not load image:"
- << m_url.toLocalFile();
- if (im.size().width() > 1024 || im.size().height() > 768)
- im = im.scaled(QSize(1024, 768), Qt::KeepAspectRatio,
- Qt::SmoothTransformation);
- image.setData(im);
- setImage(image);
-#else
- if (m_manager)
- // reconnect the signal we disconnnected in setImage() below
- connect(m_manager, SIGNAL(imageReady(ThumbnailableImage)),
- this, SLOT(setImage(ThumbnailableImage)));
- emit imageRequired(m_image);
- setMaterialIndex(m_defaultMaterial);
-#endif
- }
-}
-
-void ThumbnailNode::createFullNode()
-{
- m_full = new QGLSceneNode;
- m_full->setPosition(position());
- m_full->setGeometry(geometry());
- m_full->setStart(start());
- m_full->setCount(count());
- m_full->setPalette(palette());
- m_full->setMaterialIndex(m_defaultMaterial);
-}
-
-void ThumbnailNode::destroyFullNode()
-{
- if (!m_full)
- return;
- QGLMaterial *mat = m_full->material();
- if (m_full->materialIndex() != m_defaultMaterial)
- m_full->palette()->removeMaterial(mat);
- delete m_full;
- m_full = 0;
-}
-
-void ThumbnailNode::loadFullImage()
-{
- if (!m_full)
- createFullNode();
- Q_CHECK_PTR(m_full);
- // if we have a valid image, and the full node still has the
- // default material, switch to a new material which displays
- // the full size image
- if (!m_image.data().isNull() &&
- m_full->materialIndex() == m_defaultMaterial)
- {
- QGLMaterial *mat = new QGLMaterial;
- QGLTexture2D *tex = new QGLTexture2D;
- tex->setImage(m_image.data());
- mat->setTexture(tex);
- mat->setObjectName(m_image.url().path());
- int ix = palette()->addMaterial(mat);
- m_full->setMaterialIndex(ix);
- mat->setParent(m_full);
- }
-}
-
-void ThumbnailNode::drawGeometry(QGLPainter *painter)
-{
- QGLSceneNode::drawGeometry(painter);
-}
-
-void ThumbnailNode::draw(QGLPainter *painter)
-{
- QGLSceneNode *p = qobject_cast<QGLSceneNode*>(parent());
- Q_ASSERT_X(p && p->userEffect() && (!hasEffect()),
- "ThumbnailNode::draw", "Should only inherit parents ThumbnailEffect");
-
- ThumbnailEffect *effect = static_cast<ThumbnailEffect*>(p->userEffect());
- Q_ASSERT_X(effect && effect->name() == QLatin1String("ThumbnailEffect"),
- "ThumbnailNode::draw", "Can only be drawn with custom ThumbnailEffect");
-
- if (m_defaultMaterial == -1)
- m_defaultMaterial = materialIndex();
-
- QMatrix4x4 m = painter->modelViewMatrix().top();
- QVector3D pos = m.map(position());
- qreal magSquared = pos.lengthSquared();
-
- Distance distance = Unknown;
-
- if (magSquared > (4.0f * m_thresholdSquared))
- distance = VeryFar;
- else if (magSquared > (2.0f * m_thresholdSquared))
- distance = Far;
- else if (magSquared > m_thresholdSquared)
- distance = Middle;
- else
- distance = Near;
-
- if (true) // distance != m_lastDistance)
- {
- m_lastDistance = distance;
- m_image.setThumbnailed(m_lastDistance > Near);
- switch (distance)
- {
- case Unknown:
- case Near:
- setupLoading();
- loadFullImage();
- break;
- case Middle:
- setupLoading();
- loadFullImage();
- break;
- case Far:
- setupLoading();
- break;
- case VeryFar:
- destroyFullNode();
- break;
- }
- }
-
- effect->setThumbnail(m_image.isThumbnailed());
- if (m_image.isThumbnailed() || !m_full)
- {
- QGLSceneNode::draw(painter);
- }
- else
- {
- if (m_image.data().isNull())
- m_full->setMaterialIndex(m_defaultMaterial);
- if (pickNode() && painter->isPicking())
- painter->setObjectPickId(pickNode()->id());
- m_full->draw(painter);
- }
-
-}
-
-void ThumbnailNode::setImage(const ThumbnailableImage &image)
-{
- Q_ASSERT(QThread::currentThread() == thread());
- Q_ASSERT(!image.isNull());
-
- // the manager will be (potentially) loading a number of images, but
- // we only want our one, so just check this is our order
- if (m_url != image.url())
- return;
-
- // ok we got the right one, stop listening to the manager
- if (sender())
- {
- m_manager = sender();
- m_manager->disconnect(this, SLOT(setImage(ThumbnailableImage)));
- }
-
- // ok maybe we got what we asked for but in the meantime we decided
- // we did not want it anymore
- if (!m_loading)
- return;
-
- // the indices we are about to set will index this thumbnail image
- // into the image that its atlas is based on via the texture coords
- // that the atlas is using - those texture coords must be in the
- // same geometry that this node is referencing, so that they will
- // arrive at the vertex shader at the same time - ie they are all
- // matched in the data arrays in the geometry object
- //Q_ASSERT(QAtlas::instance()->geometry() == geometry());
-
- m_image = image;
- Q_ASSERT(!m_image.data().isNull());
-
- // configure the placeholder for the actual image size
- // this makes a photo of 1024 x 768 display on approx 3.0 x 2.8 pane
- // add salt to taste
- //QSizeF f = QSizeF(m_image.data().size()) / 600.0f;
- QSizeF f = QSizeF(m_image.data().size());
- f.scale(1.6, 1.2, Qt::KeepAspectRatio);
- QVector3D a(-f.width(), -f.height(), 0.0f);
- QVector3D b(f.width(), -f.height(), 0.0f);
- QVector3D c(f.width(), f.height(), 0.0f);
- QVector3D d(-f.width(), f.height(), 0.0f);
- int k = start();
- Q_ASSERT(count() == 6);
- QGeometryData g = geometry();
- QGL::IndexArray inxs = g.indices();
- g.vertex(inxs.at(k)) = a;
- g.vertex(inxs.at(k+1)) = b;
- g.vertex(inxs.at(k+2)) = c;
- g.vertex(inxs.at(k+5)) = d;
-
- setMaterialIndex(-1);
- m_loading = false;
-
- emit nodeChanged();
-}
diff --git a/demos/qt3d/photobrowser3d/thumbnailnode.h b/demos/qt3d/photobrowser3d/thumbnailnode.h
deleted file mode 100644
index c05da591..00000000
--- a/demos/qt3d/photobrowser3d/thumbnailnode.h
+++ /dev/null
@@ -1,96 +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 THUMBNAILNODE_H
-#define THUMBNAILNODE_H
-
-#include "qglscenenode.h"
-#include "thumbnailableimage.h"
-
-#include <QtCore/qmath.h>
-#include <QUrl>
-
-class ThumbnailNode : public QGLSceneNode
-{
- Q_OBJECT
-public:
- enum Distance
- {
- Unknown,
- Near,
- Middle,
- Far,
- VeryFar
- };
-
- explicit ThumbnailNode(QObject *parent = 0);
- ~ThumbnailNode();
- QUrl url() const { return m_url; }
- void setUrl(const QUrl &url);
- void setThreshold(qreal threshold) { m_thresholdSquared = threshold * threshold; }
- qreal threshold() const { return qSqrt(m_thresholdSquared); }
- void draw(QGLPainter *painter);
- void drawGeometry(QGLPainter *painter);
- ThumbnailableImage image() const { return m_image; }
-signals:
- void imageRequired(const ThumbnailableImage &);
- void nodeChanged();
-public slots:
- void setImage(const ThumbnailableImage &image);
-private:
- void createFullNode();
- void destroyFullNode();
- void setupLoading();
- void setupThumbnailing();
- void loadFullImage();
-
- ThumbnailableImage m_image;
- qreal m_thresholdSquared;
- int m_defaultMaterial;
- QUrl m_url;
- bool m_loading;
- QGLSceneNode *m_full;
- QSizeF m_max;
- QObject *m_manager;
- Distance m_lastDistance;
-};
-
-#endif // THUMBNAILNODE_H
diff --git a/demos/qt3d/qt3d.pro b/demos/qt3d/qt3d.pro
deleted file mode 100644
index 90e858a3..00000000
--- a/demos/qt3d/qt3d.pro
+++ /dev/null
@@ -1,2 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS = teaservice shapes pageflip cubehouse photobrowser3d
diff --git a/demos/qt3d/qt3d.svg b/demos/qt3d/qt3d.svg
deleted file mode 100644
index 4b25ec50..00000000
--- a/demos/qt3d/qt3d.svg
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<!-- Converted with SVG Converter - Version 0.9.5 (Compiled Mon May 30 09:08:51 2011) - Copyright (C) 2011 Nokia -->
-<svg xmlns="http://www.w3.org/2000/svg" width="287" version="1.1" height="286" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="tiny" id="svg2">
- <defs id="defs4">
- <linearGradient id="linearGradient4309">
- <stop offset="0" style="stop-color:#d4f301;stop-opacity:1;" id="stop4311"/>
- <stop offset="1" style="stop-color:#d4f301;stop-opacity:0;" id="stop4313"/>
- </linearGradient>
- <linearGradient gradientTransform="matrix(1.0104795,0,0,1.004441,23.387309,76.758859)" id="linearGradient3730-2" y1="131.35715" y2="156.39526" x1="23.626827" gradientUnits="userSpaceOnUse" x2="303.57144">
- <stop offset="0" style="stop-color:#038d30;stop-opacity:1;" id="stop3726-7"/>
- <stop offset="1" style="stop-color:#038d30;stop-opacity:0;" id="stop3728-1"/>
- </linearGradient>
- <linearGradient id="linearGradient3724-7">
- <stop offset="0" style="stop-color:#038d30;stop-opacity:1;" id="stop3726-7"/>
- <stop offset="1" style="stop-color:#038d30;stop-opacity:0;" id="stop3728-1"/>
- </linearGradient>
- <linearGradient id="linearGradient4315" y1="62.920685" y2="62.920685" x1="72.492188" gradientUnits="userSpaceOnUse" x2="165.83203">
- <stop offset="0" style="stop-color:#d4f301;stop-opacity:1;" id="stop4311"/>
- <stop offset="1" style="stop-color:#d4f301;stop-opacity:0;" id="stop4313"/>
- </linearGradient>
- </defs>
- <metadata id="metadata7"/>
- <g id="layer1" transform="translate(-25.071424,-77.933617)">
- <path style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#d4f301;stroke-width:8.85648727;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="path3722" d="M 149.39285,339.37194 C 118.29002,338.06386 93.410274,329.21846 78.267585,314.08502 66.239667,302.06444 58.159936,285.11057 54.818135,264.88047 c -1.962614,-11.881 -2.442596,-20.11519 -2.455216,-42.1199 -0.01051,-18.36712 0.160997,-23.0644 1.239861,-33.95521 2.529982,-25.53941 11.482605,-46.43472 25.677112,-59.93007 16.042727,-15.25252 39.462148,-23.21337 72.203768,-24.54383 6.77105,-0.27512 31.97542,0.38686 41.46813,1.08915 17.85829,1.32123 29.86273,4.01251 41.92069,9.39824 16.71724,7.46685 28.60768,18.52238 36.44553,33.88638 5.7477,11.26691 9.34961,23.29707 11.69339,39.05536 2.22754,14.97664 2.81073,44.00559 1.22086,60.77114 -2.76934,29.20404 -10.704,50.36949 -24.19378,64.53629 -8.65346,9.08774 -21.29946,16.39504 -35.37578,20.44137 -13.11053,3.76868 -25.14568,5.0858 -52.44498,5.73944 -13.81368,0.33078 -17.4242,0.35023 -22.82487,0.12311 l 0,0 z"/>
- <rect width="236.93414" x="49.282932" y="102.78797" rx="95.84404" ry="92.255867" height="239.43414" style="opacity:0;fill:none;stroke:#008000;stroke-width:3.29858350999999980;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="rect2852"/>
- <rect width="175" x="28.571428" y="19.214285" rx="95.84404" ry="92.255867" height="206.07143" style="opacity:0;fill:#b94b4b;fill-opacity:1;stroke:#05d105;stroke-width:4.147;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="rect3704" transform="translate(25.071424,77.933617)"/>
- <image width="172.71428" x="86.571419" y="214.50505" height="93.14286" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIkAAABMCAYAAABZAZTOAAAABHNCSVQICAgIfAhkiAAAF+NJREFU eJztXVlzHMeR/qq6e06ABE9QomTJlu0IKdaxftmH/Xf783Zf1l7FWpbWFiXSFA+QIIDBYDBXd+1D ZlZlVdcMTpLYBTKi0T19d9fXmV8eVTAAHG7kRtaI/dg3cCNXX25AciMnSvmxb+CDiwEMAGPW7+Zc PL/Ocu1A0ukAvT5QdQFjAWsUYBzQOKBeAssFMD0GFvMboFwLkBgDdHtApwfc3wbubQMbt4CiBMoK sJa0S+OA5RyYToHpBNh9Dbx9DRwfAYsFri3FvxYgAYBuH9jcAh4+Bh59Bty+QwCpukBR0D5NA8yn wPGEgFFWwGxKWmWx+Lj3/zHleoDEUIN3e8CdB8CDT4BbW0BVkXaxBWmbpiZQTI6AyRiYHQM7L0jj XGe5Ho/vgMkhcY3Xz4mT1EsGSZdBYGjdfAYcHQLjEfD6BXDwjsByXU0NcE1A4hybkAnw0/fEPyrW LDBA6UiTLBekRXbfAO92gJ//h+Y3xPWayeyYTMliAVQdIq1lSZ6Oc4BraPtkTJ7NjVxDkBxPSFMc vCPCWnWA/pDAcmyA+Rx4+xLY3yXyet21CHANQeIccY53O2RuXEOmxhjaNjkERnvESZbX2KPRcu1A AhBBPT4id3fJgTNb0Hw2JVNU1zdaROTagaTTBe7cBwYbpFF++JY5iSFgTI6ArXtkhgRM110M/j86 d5yfcY6JaUWNLhyk6pCpMYYIq4TlHcj81EvSMHMOpDVNCNHLuYHro2mupCaRRut0QxzDWjIJlvPW Pu9iQ2PLfmVF6wrev6jI5bWW1jmoBs40tFH5HPF4plMCScNmyKkcT63WOUfndI7A1TR0TF3zvks+ T/OeX+IFxFh6ZpErBRJp7LKixhxuAP0NBkrB68sAgKII0VIBg4DEWs7JMLgKtd+Z9Cc3+HJJDdzU 1MACksWC1zGYBDBNTdsFHIs5ud/zOXA8prkA6H2LB70Cv/F/wnZ5l84Bi1kA+tUBiQFsScC4fZfM wa3bwGAT6A2okTtdjm0UxCPKkoAhD1iWQVsYGwBhlUnRLwxh5kWbEOf/MDAaNXcEgHoZGrupCUxN HfI9TU2AmB0zWZ4BhwfAaJ/WHR68X6BYS6mHwRAoO6RRiwoo1DuRj6jqUYHRaJ/SEYs50MyvEEgs Z2rv3KfcSn9ID9br00NqPiHaoigDIESrCCBEi5gMSPQXBSiOgXhBmyWnQSLmhsEhPEbMigcJr1vM CRyzTQLOcJOeazImrjM7fj/vtOoQQd9+TInNwQa9006PPijnQklEvQCOjoDxfvoyrhBIjAGqklP6 rDEKBQRtXsSUWAuYggCmzYsnpDYUGEUaRJFPveytUI6vGAB8PjDvsLzsjAIT72sdUDguQWAtt+S3 3elSVrppQgb6fUhZUUnE9mPgs18Dw1sE0G6frtvUpN3evSFP781r0iCjPQK18KYrA5Jun0zLcJNe YlkG4pkCAMpciERawCTLLr9JrxRvSPb3WiTRKn7u0AaRCbfmgerC/RcFHVNWpEkMqHxhPrv8wF1/ CPzun4D7j4Cvviag9AZ03aKkeNDxGHjzCvjHE2DvLfDLTwSY1Gs7F0iM/vQQiKT/itU2v7imXLAo AkB6A9YiZWJCeBJT4af4VmJyZlZf1rQWkuUcsV1DeD1uDWJN5kjbGX4W5+jZqg6d6+4DzjofrH4/ Z5VuD3j8JfCHfyEQ3t+m91uWpB3G74BXzwkY3/8JePI93cMqj+tsIDFAr8cVXZ3gMfT6wK07ZPOq iolQGbiA9ypsu1GNBQ73gd0dQr8HSKkAIgBEMC1GN4bWLhktk65vgbilXuJjDaixW8emgEy8CNEo 1hBRtBYAm56qousNNqi2ZT4NRPi8Ivdy/xHw+z8QOPpDoD+g68MR/3n6d+Db/6DKu5fPSJOti/mc CBJ58P6Q0Hj7DpkD+eJtQSAZbhKCS/EsVMNmPQpeNxnTC6o6wTvJmZhUe/hzIOEdrQc4+eVGPEQf 5+Kf6emymDLEUVIuJN6Wc0HLiEfW6QbQXMTRES9lsKHMdhU0mFTe7b6mj/Lw4HSgXAkSY+gim7eJ Lzx8DDz8BLj7kIuJB6RNrA3aQ9v1ls120cy/vNc1ub79AYFMIqOeoKa8JNEgOfBIA4WHQb6VVz58 sqvmNmqug24pICJzo0DhwDEfRWKHt4CjUShhOG8kVz7e+4/IjIlmNpbiHvMZ8OIZ8ONfgJdPQ2T5 JMmCxBg6+fZnwG++plzG9uNQ8tc0RLTm88CQ5zN6QAljiyvolMuoo3jglznap+O7/aBNVvERkwML nwspWBLVn4KkxUl4LlrFgDRCxHa1meHtWZBwEZNlFd+o+4YD6iKURJYdig0NNsmlnh7TuzuPdHuk 6R88AjY2qX63ZC/m8ICmv/wn8PxnIq6nlZWapKwIHJ99Sdrj3jY14mJOKutoTOn0xRyYcdXXfBZC zgsOQUtsAS4mRkJC6yVHVzdVBNW2Gzl1YdMG02BJt/lrrtEmEmmMwKH3zWgTMS1+PwXAVMshXaeA L7kl0cjnBYl4Tf2B4oyWYiDTCZdk/kIk9Uznza3sDwmNv/0G+OJ3pA6XS+DtK+DNSyKaL55Sd4Pp hIDhw9N1sH86zwEETeJcCIY9+pyupTWIkDxjedmE/jHpi86SVQ0utSpaUECITBNIE6TerTOZfV0C PDXp+7RQGhEh5uMcfellRQ3b1NSAy3OYnKpDMZHNLU5ldOjaDZdu7rwkj+bNy7O721mQbD8GfvUV 8PlXBBg4Asj3fwZ++C+66PiA7JyOQJ7lwaouTRI8KysVGylUviU1NRlOYtWEXGOyrAKM079V3CQi rupgp8Bl1Pas9hPvzNEzAYFrFS54Or0hNWi3T+b3LNrEGKDbJROzeZvAUnZoW72kj/rlM4qHHE9O f16RFkiKki60dZ/mAHGP3dfAs78Dz39SJuSckrrNHiBlTFRNMq36UrONg2CCUrWfmqGc+UnicJ6n yP37fRSovHbj9alpsQaASjjCBXe/0yVN0h8A44r4yWmTkMYC3QGweYc0SZcDZjWnBEb7ZGZePD2f i21bFzSxNyEZzcWcyI5zp773tQ8lNR1RxnYdAIAAEMRT2sgJLYnP0bqZNatTMCXb9PH+OgjPcSow q2hsWZKZEA/vtGItl1X0QsbcmACS6XGojTmPZM2NqHshc00TCKvkLc4r1nJc5RYxenkoq7wZvexN inATGzdGLlejGyj1blJTA8QAih5NtETGfZdzCNk1FrBNzF2sod8N37ezdA7/AdrAT6oScB3Or4zp nU/Gp3ifnB3f3CLPZvM2/QaIDowPgN1XF6vZbWkSIJiTxoWHLbjxWiTxjGIs+fL9IdlRT1hVIs9r MhNrGZ/V1eBITYwGhdIgGhyt7RpEa85p2Fx4DaPWCx+KMs/KzPjaFj2pj0L6JQ84+y0NfZJ0e8RB 7tyjEMWQzbcEzkb7oT/zeaUFEteQWZlOCInG0AN02bUqOOt6XikKerBeN46L5AJnOU2SU9+Riwm1 vAYQkVkQSc3WCrMh+6agjDhI5ncE/ISgF1wbU3WATj8k4tZJWREw7j4A7j0ksPSGdL6a41dSuzKf nbvJ2uamaeiE82noJG25lqPTZTV5AdJqC2Lzvje/IqVrbXem0VMiC7SP0XKS2QHa5iY1RaJBnCKy Lr0fledx6ppyD61JaxnJ7XAOax3RLCtOl2zQXLxEYwG3JIdDx67OKy2QOAeMDoC9XbJnW/fowptb 1Nm6NyBNc54uB12ukNq4RZpJyhRT7dHSJNrLWQOeVFPkTAigtqt9WuLibf6nWu84gmqA4M3IaeW+ HXxo3qacxAVgFAV9fEVJ78iAu5wmkVF5xm6PirM+/YK8xC3uASBdV+dz4GAvRLQvUv2WVWiTMfVw Gx1wYUwJbNymrOKtLSJB8xngznjh4SarxEGc6S2U+jUFgAKAtu0G4UPVQFhBVr0bKiCxiEChG1PW +UWT9+C01vDLvN4n7RxaILZ8jLM8V/doQc9r6hA3kTKCpiF+MT7gELoJprqqCCCffEGpk8GQCStn 6F1D2d69N8D+W2rP80ZxgRUgkWqlnV+AX/2G3LLBkBJHn35JUbujMTA/44WlIkvGBFlVbeYjrClR TQhsRDiR0SbatJhkLpKYJZeaGBWeN0BUSS6WJdIeBpCSCIncmgQYjTyLow+ksUCtvJ2youv2+qx1 B2SCBpvA1l36yG5vUbrkzgPebzP0CJhPCRij/RDBvYhkQeIaIq2SmZRsYn9IbtbxEedxTqhDSMVm ABE1vvrKV5FT31h60iYmlVXblCnKHmYCYHLP6I9TWici0XKvLr5Xl3muyKSa8G46XQIJLAFnuAHc uhtAMdig+h5fEsCorbnP0PiAHJCLdt/IgkQ6I736BfjlKf1+9CtC8eMv6WHe7TC5PWXP+6LkUDxH V6NYiG3PtWu5jtBa9Vt8NYN4fY6wZvmJLnPQ+8SbY8TJuZtwPQe6F+uYuEpQ0gKmUfetNKOPm6h3 I2O7CS/sD7lOpEfbxF2WEZvAgc/phOpUd17QR36acoB1stLJqpfUu/7JX0lzDDaIHD38hLa/2yFV Nto/OdRrjKp87yalABnNos1OzsxkiaoNjeo5xxqQrCKvEQgUWCJtokHC5FV7OFq7yXZ9zwIIIH52 pyr/Gx4Oo7BETqtOiKiWFcWYpPOaZM6Xc/poj5hTSpb+It4osAYkzhE4dnfoBscj4O42+eFDzjZ2 B0AxPl0+QKqvfFlj0uCrYhGnmpSk54M6lcx9HYhyVVuu8KptibbR19XurlwnfY6cG58zPdaGuhwx 974XQRm/TyFHNff7mfG4b3V9OT0F14Zr6pqyv+MReTdb98hG3r1PFdjLBZHYH787OVhji5DI00Gk KNxu4xflzY+sQ0a7aO2hAZJoltw8dZU9EwWywPFASESbMGNBpoeJqVPrxQXWw11Y8W7YJBWJO2wL 6qzW6XL6X7nM0pvRcf3O9IjLAl5QIvasnHGVnFjjenxE09/+mzjJ13/kqrXHhNqt+2T3XjxdzU8K 7k8TdZNQDZ8lr3p7zryo7VEjp5pIFlPNohtbmRdn4DO7QMxPUs9HjoHaJvfjeO7vHyvuXwG69YGw GRlucnS64nuxIeot2mY2BQ5HYay3N68u5vZqOXW1/OvnwJ//nR7i3jYNc/nJZwScxZwa/uUzIryt i1RcE1vFZHWlqUkAsA44KWDSCXpfZLSJlmSda68KG5JjxHzpub8WE1Z/SAYsonly+R0BoM8M83ll IMDlgvjh21dED14+O11y8LRyapA0NQ0R9exHQu1gg0xPfwBsfwqMeJTCN69DhZqItTEXQdLQuoFb Lm6qDdQ26PkpNciZRZmgaLVRqzP8JL1HWaezxC0Srvc1wdROJ8ElFq3lu5IyWT2ekBOx94Y8m8sc UKQA8G+n2dE5AoEEaKwN+YI797lGlXMNUgsr6q7ToyTUYCPUTEgNps8AC5vnCKwspyUDkXuccpbU C0rJ8YrGyWmwXKPJexAwpw2hf0Ydz13gIv63C8v+o3KIRiZYcmf0kjtyDTbIzPg6kQlpjKND8kSf /g149Q/SJpcpZ+qc5RwF2KTn/HhEAPnqawLB1/9MYfu9t0Sc3u2QOkw9mtQmpBoFutGgGu2kSR+r j0H4vU6rpO0uPATpOkDF5ONz68CaFFTrZ/Che3XMKr5lLTsHL+g8W3fpg5Nhu45G7OoeAs+fUA3r aB+XLmfu5ukcBdHe7VDjj/aoluHTL4jENo40zGJBX8XRIS1LPiXiG6cR1dBnshpm9XL0Mz2pEFFe 9hoEaBVI63NEATi9X+aDkNW5/FAKbIC8lOU8jO0mVYJTHrpitEftITm1y5Zz9QUWLTIe0e/FjDon f/l74OGnpF3uPgRefU5If/ksVIdrF7PV6Ep7ZOUs4JLzyeIqoCQnlMYzGiz8u+X+Jtpk5c2l15CH zxyXey8yRIQMVTGfETCkbvXwgNze9zW+26WMKvDDt9Th57ffAH/8V+InW3eBzVuE+Nt3gCc/UP+P plA2Wk7g4imy7VjjZeidTkJP0iD62kbvkmqC5D5OukZ2PxdmDupjcfGy/NaT1PdMxlS+0TTERXZe AE++o9TJ+x4x6VJAUteE7O/+RP07tu4BX31DHbv6A2DrAeD+GiKATUPV4EaVSTYOAP+2QvB44Biw ffeA4cCTa1TDcgALoHMYw+dMuY5TxyCsB58bDSIAybJb0YhCRmUEJMdV7nrAG7/Nhed3yTrH76Bu 4v3rZci2i3k5PKCQxOH+xfMyp5FLHZ9kuaAbbxqg/zMAR9lKZxAVVusXlJsax8kx2ZcbX48LYtT+ XolkNIDXEhkSIACJBqDR59AaYBVIZB+X7OMPVOvUMzcunDf3/H40Je6iOZ2QyT46pGKk6fGHG5zv 0kEy2uPxNvYJ7YMNCr4tmbxKfqFckjvXcD1Fw/1QahV4Ehc6jYEYfvHWhWJtqc/wmoOjkrq/rpwr t+wlNXcuXpYvHwiNHmmOjMaQwfiaRJNKtLSugWUdhtOSjtxL7p75+he6hsRGlssP+0+aLn2kIyFZ o31CfFFSfqeoCCx1P+RwAOUCcnSRTqLyHAj7WQaGjpFYDs61+u1Y6sqQur0rCax/gLOBRGuJRpuO ug2Sekn7CABcw8vLMLqjdJldLihAdnhAdSEX7RB3EXmvw2Et+WFnx9x7fjNUctd10Cy2BgrWGtKw cPBxldogqtD37jTgE2iyfxoQS93KlvZIgbLK9EBpCW1GmMOk/EP3hfbjuer1Ah498bp6GULu3qx8 IK2Rkw82ZtpyDhzuAa6miKtlgGhtYYvQEMYCtQPKBr7OwloClK4sj7pdJJokDf8DaMdcMiYnCqBp XiKjIyT8BIhBEGkSF5sRPeJ0U5PWWCwojFDXFIOasZs7PiCOd9F6kIvKBx1Yb7TPyUBu9G6P24hf uqTIGxcA4ZZAw90EJINsEMyTjEfqM6MJUFogAdbGSYD1IIkIqvzGCk3Cy37YziXvw+amqYH5gj6g +ZzAM5tS/OnokOqMp+fo4H3Z8kFBMuevRcr2BhtB7bqGGr2qidRJ/9i6JFNkLWDLABKdJdXJsCjM L/smWsRHPl2yHsh6N7KoPZQsSBK3V4OkpUl4uPEFg2TGpaACjvGI+MjHNDMiH3yITin3nxzBdxz3 ZYxNaGjpdS/SWOpy4BgMToJyTGSdZJjRBkmT0ySrgm+pG524wanrLmYn0iAOMScRDyYxN96TWYRO VPJfu+ZnGInofcsHB0nDINnf5RK7Zfj6ZADauiYzUlSkRYqatEE0lrwuotagMIlmQQwekWiZ5y0r k/FsUqDkQOKBkdEkjXg0MiIU95YccSxk721Iol4FLQJ8pMF+pexgPouZvfzzxIo7K5U19/JbJiDR pkaZn1aVvYDDhsCZSA4wKRdJXeGWuVFTFiSsSWqlSXysg0spZseUxd3f5dT/YeAuV0U+2ojQTQOg CX14un2gUZXfEpqnneG7VIrn42xYNoY5jXKBG61ZGpyOuCYNk4uReJAg/p31biQ+okHShH9OoP/F 7NEhmZurBhDgCgwbvpjTV+QcdbsAmLQ61X4SXHO83gZOIkBolIlpEdgUFGlsJLE3KXHV7q9f5g06 79I0gBPtoThJrYJlTUOJTuEge7uU5r/McsPLlo8OEoBe3miPvrbegLSKRF99dFWq2ETTpAXVmUJq DYg0TiKiNYyvCdE7SBxEeUNSMuAcIB2vDGuyxvD6Omg42S7nq5vwnyvkv4ZeZbkSIAFCctDVZK97 gzACtVSKd/thZKSyopELbZkQ2RQoUIBRyz4xuMrcrOAkIS0cPBkdPKszJmU2BdwYOOYBd0f7gbhP Dq+eeUnlyoAEoJc1nxORk7E1pNimKLkHWydolS4P+CIxlZbHk9S/AiHg5qBAlNxDdi6AELOjEnXi wYh2kP+WJbGQ+YzGuhXeMRmHcW+vOkAAZKvoPqpIg0uEteyq/58nBdPc8L0+daKOttn4HD4amxZF a4CkwTTxXhCWI2Kq4h9LxTumkzB2i/xrNdEuNY+gLUk97fpfdblyIGmJJp5JEExGBIqCZxle4jmJ Njnq/JHkPBwFGOcAKUzy3g248WUUbO0e8zl1nuf/mlx9kNzIRxd78i43ct3lBiQ3cqLcgORGTpQb kNzIiXIDkhs5Uf4XvCkz5B6wzDwAAAAASUVORK5CYII= " id="image3149"/>
- <image width="156.57143" x="89.857132" y="140.67836" height="65.897751" id="image3075" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPMAAABoCAIAAACrNVHoAAAAA3NCSVQICAjb4U/gAAAgAElEQVR4 nO29ebR9SVXn+Yk4w73vvvd+7zfkPJFJAmKiKS0qMpQMIlQJBYhoaQMKWpZFid2WrdCuokpKWykX WtqKJbZDtraKUoWKE6JLUFBAlDlBSCAHciCH3/SGe+8ZYug/dkTcc+f3ywGl+7fXXW+de96558SJ 2LHju8eA83SeztN5Ok9fKKQe3NsVRfGox1xx9aOOHL/MXXlNfuWJ8qKNo+3Gme2eHtbu5vF9e/vu 4Iz77Cfb2z/Z3PGZ4d4pOx6aB7cNX4i0ublx5TUnLr92MDiito/mR47nWb/dOZLtbGa9QtetOzU+ qCvfDNVdt47vunW4e8oenHGn76mr8fneW0z5A7/FxmDjWc/88mc96zGPf/zFX/IllxdFBqfgPtiF IRyH2+K1TfeHlpMtnDzwv/nes+/5vfyDb2/uuKlyzj/wJv3Tp6uvvfQF3/RFT/yKK6691lx77eb2 9gBKAE7GS05P/+IMAMfgDNwLPaBlb2z48G363Tf6t/+P3Y+9Z3T3ba017vP2Fv+U6f7L7LIsXvCC p73sZc946lOvL8scdjuDIZydwx7oDmff0b2DcDawz/4228Dt1fCG37V/9N/sx987tvb/ayOUZfqZ z33sC77++n/xL7708suPxdOfhFFka5Zz9gHUAFgYAfK1pgZ6bNYMK6rM9n/93fVv/eTw7942amr7 ABv8p3/6dU996hWQgdyqAKCNxzKaV8FnZ37oPd7f4RzO4Zx3Du9xzreOg9bfMjp1duTPjPw9J4f7 p/3eKfZPqXtus6fudGfv9fun7fiAauj8AxNx94ezd3aO/OAP/q/f/d3fesEFwrtngWnOPgs3gwbA wal4/o44KoB17BnQsMd+n4GCs+x72GZ7d+xf+WOn/+D1zXD3gQ7PPwXK8/wlL33iq3/o2Q9/+IVz /zwLQ7gXBnAx3BTPn4QCDqCB7Xh8Jv5333KQsdVyABRstRyMGA0YAAeMenbwY79z+pdeObzvzmbu iYelt7/9WU972pcAsAsZHAUDu5HFT8WTpxb9ujvWXbI1ewos7LPvsIAHCxbXYjwodIv9+Of8+9/p P/JO+5F3uDtv8u4cGeHcODvP81e84jte/eofOnHiOAxhP95hD26LnK3hNNwaf3Q6znhgHz4Xj/cM 1kEOYxpPpmCffQ9bbAP77AO/+PvmdS8ZjQ++gCHKS1/6nNe85rse9jDhiWX0YQC+LB70oyA8AGCr c3wQQd0ZwNICGduW/cTZIshbbEH2X/9g/NoXnRkd3B843uHsRCLL6Ejus53x7VJ3rCfk2KuxGXgY 04wZCQNVuBajICevMQ1WoTze4Szeo97x1/6NP+o//HZnD/cq+rBvCQ9/+DXvetdf/vRPv+7EieMA ZGDgs3Aa0tM0ODgOV8bPZucefdiKn1yTOazFajJAmFf+pgn33c/PP7RXvuiHc509yMru54HKsnzj G7/7hhte9rCHXQoXwEWwc7ifXgw7i9h6C9qEuSNbF2Bl5Y/gpCds3aN4xXPzj997waO/cnPRU+4H HYOHwQCIkttCBqPpzz704Vi8knSlJgcUaMjINJkmy8jAe8jIAYsVnvZ4i2/wFv+UJ6s3vE3/ea1e +l9Uf3M9MxyWs5/3vOd+6EPv/+qvfjwA+7APLWzC0c5VZ0HAcRcjnpi+ING2ZhNw4CIr+9imqWYp /uNrsrfevn38kgdB3/28UZbpN7/55d/yLY+HXbgd9uEiuGTd7/oRT/eAObYm8tMZIKOfUcQzAC2t MLewtZzc2VDved+Rf/7SQ06qw1DewdxHpnlAaBfOwtHuTPZhkd9Og1tRAR485Oic3IPBOLpLtFLg 8XJSa176Kt66p575nUqtZO9Dcfa3fdu3vPnNv769vQ0NGNiOnx24Aq6Gq+FL4Wo4Dsenl6djsBE/ bTxZQA5ln0FBSZim5BQ5mcN6KChAGbxCZ+jrLvXvv3Nw/VPuD3MrpbRWSiulldYLjrVWep6y2c+a vpym173um5/znEeBhUF88Q0oYLDocwIKsPAIuAjOQgGXwRHIIYeteNyHI1BEruqDg15BnpH16Fls TdtnQ5ErcsggK+n99g1bz3rJ8XPsuTJybTMtxURyS8MeBg+DSzrvUkAPaqii5O5BpsgtBhqL1eSa 3OBErlnIyHMKAagG7UGBxcsFLd7gTfzqtf/3v+x//O0UvaVNX88o3/7tL7zhhp9VysNB7GJR5A2Y KGCAI/CweJwAZQ/OwEb8uglDIK6qFWxoKDkYMgJbUBCUCVtQGJzFFGThJbV/y18OXvKN9V//bnro errsmo07b74m4iXpiXrJcRmbug/A9sytXv7jd73hP9x8mId+1ZO/+Pu+73lwd9T/5G4t3AtboOIj gCFYuAQU3A0XwxVwD2SQwz4ciQKo6qxnx+Ly6CCDPuy2mC22Ndkuw37s8z69fYZH2NZkf/LrW4/8 QHPzxw4O1XGBNmETboEzcM20eD4TdcQSroNbYA8acHBJXGdMd6wzgNbi5S1ychNxbIs1KIsHcrTD 2jhmwmd9lHA28bWvezK/eiv/5pGMF73QGpn9tKc98Zd+6VVKmQiYEp420EAZRfJC6kHZUeeBxTJj dSNETrpwx/xNb968/muKVT9YQIdh67rzdg+UfvYnXzQn4A/gLgAui7hCaA/uAeBioHPsZO2evjjR JmxHVfIIIL3ocJFdHLiGpgxiyJXkwF/+zaW9/uHXvRxuAeAaAG6ZxpMXx+UlXSPLctExYs5SS530 gU366XxN28YlPQvSLZDDC4cYZi2Bxy/h5z68WHKvYqpLLrvozW/+xaIQA2rXeJTYWl5+4Wv04vm2 c1LWpvujzSjIALDwpr/YOHphdvjfNtSHYGvAwS6M4+8M+C5mKMulA9alJzzlMY9//CM6J4awF3WP y4CopbRRV2ERc28uZ+tE/cjWe9DbnOvYfYbAduf85Tv6e3923vK4jC4FljP3UbgcLu9cs7OarYly KuoDOn08ygXxhcGZKMsSicBWTGFwa7ngCv7D7y140CrO/rUbvvfYsT2ooY4OxSGMIn7S0RJSwg7s RPB9AezAUbgMjsHF0IufCrbgMuhBAZlgRIGDJT2FbnElvZKixXpURiY6suBIWZi28vyN798+JOr1 oS/K+LIyFbXFwgbsTB9baGALNmAvWrgCtW274AFz9N0ve1LkWmnv6QjP+rAPN8Kn4GT8DKPWuBvF hxxvQj/eQUTYRnybLrrbhj1LDcdyeoKqbZADmUXF18/S5ye+69iJiwaLGj5PBTwMjkEFvc5xl47C paChgh24CI7C0Y4RbAsGiQdycrGHWFzTWSRzMh9fz3a41+BNEKVegI4XxONwlqbCGq5/Kk/4htmm L+Xsl7zk6c985pfDWTiYXoOGnTFoII/HaY4N4BrYAgMFnIA+9OEEHImz4sKo+ghGpMX02ejRN9g+ vT4bBqdQBYUP8EsrMheWKnvdlfzz7+hzCFIoTR6RhuhwY8gyetCCh63OsY3a0pF4LFRBY9r13oIs y573vMfBLtwNpzufk/Bx+Cu4NS4/QmfgTjiAfbgTRmDjT3ZhF1ScEgJqRSia9BkxtjgoG6x8PJno WxsMapqaxuG7n+/7ucsP03VgIIuAs4EMrpwzXI7BwAnYkV6Kw112PkVHPGcO7dE5vYKemahr1nTe qo0MXeHbqGXm4GDc0jTeGpoxtiXLMS3/9vVk0yBrMWdrrX/4h5/TObEHd3SUHqCCEeRxBvcj62yC WoS8N2EQdam7O48+0jkOWHCGCooiGrAy0GCxFvPzv7BRlOdgj09kJ2o7yTbsaWckdIcq2JuTVYvp mkdedPRoC7fOuccBC9tw7bQltIWNKA7nHlxt3XDDZ178v/z9k571ge/5sfd/6lN7EZdNZnU+N4qD aEXeYbulVaimAyZzej/0jcd7/XPVVYS24cS0VUfuLG80goPl3TihnEIUAIWST/e/Hu+j2Pbx7RS0 +HYurMhZrKHs85XPnnnEInr+tz7u2mu7ckUCcWzHXCAmDpmF0stj2IywdYpGo/Iv/uLWD9342auv 6D/hCUce8Ygx3A0uYURNb3s5+M7nGpmRgy8Kvu7b+n/yywtduGvIUmcAfajgDBxT9D0VAQgOibZ2 DbDraDT9w6CRr3jaJXB3XJp3u8bmSKfg7DTfH1l4q5Mne096yv+46eMh2Obdf8YvvuYTP/lb13/f N30plHC7nJ+f3H2KktLQQL+gaKNyVlLm9KCfZXzF04//zZ/cs/Z1DkHJVibO9q1oFVlGpbTEw6jj fi8p2yg7PF4ckOm/glLaBsS+3SETx+T5/573vmVyfjFn/+sXPbqDDj08HGyU3DvT5jDXWSWBYcQn Ym0df+ITd33ds37xjs/eK1drrd/ylmc95zlboGEb7jTUOZeUUahkFKArGkXh8WIVmvHdFLHZr/4v G2s5W2tVMIAsSkcUFeCwGiuNjP9qfBASB1DAhqeGxtGCgqpp1htPvuQrMvgMEHvvKJwF3VFM5ykB +q4diR/95RsTWwtZY3/o2z/2vS/48iwj3XBMC2wzHtECm/QdLeQaB06TG2rAUA/Ygj6MoffiV1x0 CM7uxxfZhJ1pEJVoG4ZxmgkMFtvuAQxgC0ZR6xuLXUGRC6oTyCFkOpYpizJRbJsIiRIQ9N6LnPYe 7wMKti0XXU1vQB3ZYQFn9/u9Zzwjg9shg+Oxu8VgNyO5gSqiFB2tWlfEK2vgNa/974mtAefcN/+r dwwPXqzUHuDwOT3AiIcJNhmMaUY0GwwsrcUS2Xoe5F55Ql1wWXnyrrVBP8dg12MUfdjtTJOmi50U mQo+0VZzFvoZwNkDqpICxv4QEbY7D9uNcAvYgTulpXAGduc0/hnq4j3e9POfmr+iGje//rYbX/b1 Fzt25TU8vqCAoShkffCoFgPaUo9oxxhggxLymj2gx/a3PEG/fO3L0Mb2XxB7aX7V2o0xQlfHWJEr oYx2emlj7dl7+gvvKfJ+OTCDHff0b26/4St7Rd6v4iuPqZPiqEDsJIJSrMUpdEe2mRYJkJK/1gSG PnYJd0d/wwKc+ugvu7AodGw0cKwTx+Fi8JN8JORFGF0mgLC1TJyRte6Pf/cjM/cfj6qbbrLx8Ucj 1Amt6VGOaErKTXqHAdFf/ow1eNF7oG+pFA5wHcTpwQfMHb66iXreCBY31AeLY9YW0xdflUUbkY+S +EoAbl8ZEbWg2ffcub/wX+985x6dkdtia4PtPfaBAf0+xdacnrNBuUGvZgz0OA5sHt3b3F5rxJQp enU8Prnoc2fnmmRIFS2ziq/cAu/9k/0//507//iGe/77z9z38ifefln/5u9/9V6Dk4+Ztoe0YFBt tJN4j3OYNnwkSMqa8BG27g24KLkKF3L2k77+onh4Bm6B0+A7Tq+uorPfcdcdi2x9B5wVz84HP/ix g4Ph/CPe/bdJqokS7RPecCBsTbQnr7btPfH5s8tO0cu2doqd4/0TF23tHO9dek3BZB3d7d4t3lzG o0qcLSTMPaIGcnRDe/HV2c7x3s7x3tET/SPHescuGOwc72s91YdXnQjtceyB77A1cBUcO2REw96e 8UsilE/f08RH0IJFt5iadkB/nqf79Av0Bj0HLa2wdc1pB5dceRjHwtXAEoVY6HjnGrF6dUmYu1Bz Tjpn3W/82Omf/IkmtnMioQxepLXHqwisZ0L8nMU0ALYF6A0ALrxycsECNPKML+s24kz8nOoMSXKx 1nArbHX0pDtiKIyG5tSpW+bvD9x496mudg8bDSNgQN/R5OQ11kErkevxooUmtyc9eZZRvuNHTrz6 lf4yLtRc44IHoYDMgafNUDP8YiGjGrKnO50rE2CXs2cZbrFRYU6y/wPfU77qey5OvyrJaurHXnrq 1N0Tb3/b3z/gMx4/ZLxFvcHuPiON3mbg+Og+I2BjkZ4NjCehCnzi7FJP4Z237MHdB7QFfUFrGWyx ZbGn2MvINthosGPGGdkWGwpVYV0YJL3H3RXVhVx46dX9z3x82UOE+tDCTXAWHrnkmnz6mrNRTie9 Qg60W5RK8tuvrX7gVSWQkyU0YkFFx431AXKYdjJuIqqVxjRYg1LYFms40rE5Lei+h18z7/fynYj4 e6NspuMhs50rT8BxuBk+s7fXNYRP6PTJUYyjEGplUDOKBl9HXaLB1DigR56j7SLv98Mv1Fqrbo6Z VtqDwZccNFgNJcbEOe/nfOgOcsb7DPscSRK9pm6xYxqHa7H3sX+WsaYedJhyFwPKuakBM/3hbQwl MO0+9kpyO4et+wsMJgAVLTCgt83g9rNLlYezJ+uzHHiUpRLzwhYDgzvJmQyOszOiPsMusMOORhv8 mAokLHD3DAfAGLN5bG3W0hBugwMCaEx0Zs60J5hkD4JO1bLbzcABFi5Boz07ipfUsaMaQSDy81p5 7733bSdWqImzpqkAlArcv3Px5JoFnH311WfnDDeXwolFwYrztAFbcFrsA3t7i+1Zwz0Lx6MbmTH7 hHWz0BT1tCKVQUlmwaE1et5a0h8Uo4MpPogG3bN0QM4ykgsazAANNNQtTgzABRlkQ6o2YHQnoaEV jQgVj54Zr0zLPVWIukSBnmfuhdSjN2AgiOLMeCm4t9YD22yOO8MkEaE77Fg4w66GHXY22FgBfTa2 DukNODFnl2yZBCw8IPKeW+7111y0AHIGQOL9MlTWvQmgFDsdKDTL2XmeHTkyz+5iBTsMZ1fw2ZjM d+3e3k0LLxrtGxgl7b6l7dPfmMOIGfTIC7THN7gNNjRacm2iywZgsJ2NOjNRad0LML3Jg0pdsRLe urAC4mHE2OAyMkKYjqvnDAJjmowMdDuFzKdIo8TxpFEDNkbUa/nb4VpaR0+jV7RWKTJQOIfqMdik r8HgMkpgl10Nx9kpl0aqBeoNDh+UOxtoADxYzH3nLYs5u0tKqWX9LCTMffSiyZlZJi57ckbBzvRM PQPtIsk9hM+Bg81OOJGCAXzyE6c/urAdZ0/XonrGQMzM4GqGhPS4ShS+lqakVGQjRi1skgMOp0EF Hywl+cbmFBuY1jZRrgsV3DfucOdCvF7jznCQkVUYh9M44ekG21XbSyrggCZ5zmaS7XcZp+9bceCH 1BXtNv0WO6LJlmvFA0oxP58ZLkUj3rPPqMUNqSyNoeei2XTEfku7yeaYZkgjnbBP5aCgaHGG3Qor cKgerZGFdqnPRSyYPjLDLhzANpxJFs9ddsUIXTBwuIrKL2FNWZxm+nmqGQZnZ/9lDc5GCN6gNEC/ g6PnZHap4ADUdLiIKNEycQdwXzy/0TFd7HcmcQW3wV333bdYoR4NR/ucTC6oEZWFPv2ScsyophXO VmiPbvAj2hZyKqCiLWO0YUHRoyz6UwNQ16ahngbT9TJpOabRaGBEW7EvonpE3U4wnwXKaFypaBvs OM4OD34aZzfYonNx3ckQUVTRtLxUO2xwDSOHGR4sjVFpmuaAsUjohsbhDEq8jC2mR5HTa8ITGVGP MIBDAS0VqApzmt3T966xZu4xhFsXQbn9ySXdy/ncaU726cvjWrwYtEdUw+WxCQdnzAjdYCdhq562 Dp3WVN7EOZ7MI209cT2KNpmXAGUn0Gt20Sv7aqW37JC0J16b7e3Z4P3V1NA0tD16EitSzsVD6ujJ FbY+ygDIe1Ndr9XsW60AAaOOOcLhxNTQ4prFkp0aM6Qdt7bFs8gi2ZUtLbY9HMLukryjXh6lm+Xq ODtZYFP69HtxcehTbFJmney7hkZBQZFTiPEnRf2tzZsehui3c6A+fVnKRNXJYkjnCrRRP3B2i9TF cPNoJHH2IQMdZ2gX7uvEIp9Zc/kcbbDRozzggGmfKnHIq2m2Psson+H/Q6PHMQ3QIx+TLMQOKNA5 irjEA23HlTBurWnIi8W29gZbd1pdoPvkDdathIkz72jALPerHruwB+yyS8ipC5SFHLJ2RCvzyUOL ETHh4zVp9O/97GEyLa4CDuE9nZBEfYwYNTQ9em4J/EvUHirSbA2J+Q9QKmDuuWCjQsy9Y4XtzNcB HIFB9K6neIMebMDFILlk/RgxgphC9/cWe9Ha1tzHWUOTRe2toHDRG1vTxNzPosYZzBgDmaGtMAf4 jKyHOqCuaD0+y6cYzLR2vDI7Jg3RkCZD7TLaZTwvpEcYgxf91URnb9s605CXFCgP7Zwtyzif6Ul7 PH6IaXEaDI3F9xZHX8SfY0Ly3/KJ0Nu093EmQ/foNTQ1lQ3PCnHcLv7VMVKyojGYHkVJUdHUmBpz 7x1rku4sXqDzHge9qSmU5RyB0QEHG/QzjsBoj4MRI48aMBgxGlG7EKBXVTRj2mUmjmrkxniHM/GC ejxBIGLXy3Lq0QSNpJOmDZ6agEk61tRZzlbaCSTamvqXpNovNOGN4dbOtExLSwOnqmqx5DHGjGmK YJEoM6hoRrTJ4tFiC3KDGlKJAa5E71GNsRmZwh3Q2IlncYop66rd76C6gsLhDCYEIcQyAkBDY7EV DhC7r/xEch2q1gFFQdU6ayhK3VQx6aNh7B1g2lmb1HOytYLwUOkLK6jcbA/QfcqGscVKzLrHtFgf 2K6Ufo9JTa2MaY+iot2jAmxTVKM14eb77NfcdobdDDbZsRFrWazlTFo0DGdOsUsIT/B7DGXJdbHy SY3Zp169aHl8Ytz59cqaWR+knJwYtsfASs4uSpXF2Am/0lL2oFBJucWxIcOaWgcFF9WRNJGtS0DY epOiiWwtcGWmFMkn/tb+6i8H7snz/KovUl/7BLGoaGHursys8Qo1ILeQsk2Fs+XYRsXFNHz8b/iH 96Tx8c6Cp10j+B58+poXbmwxABra1A/SdOmIEY2DLcoVq8ObfqM9ZHmxrNNjq21vqnNlzNpQHi8q 7DKU6L1z0/9TSq21Ya+leZkNka0f6tI1JeUxjrUg7OvxFgWosIq1gknKYAQIbE0UutKJBYVWU1Lw I++sPvLOicy+8IryqbdvabQwd/e1bGgGIrmTvVnYWrLRkku4bdwfvd7/7R8+0B5/gKSUev4Lcx1D XGSVk1BPTdajBBxNQdGnaJevD3/yS+tnZFJDTWdZXGNYBiIciterHnlG3ilzMP2UKD611jMO3ftD sX2znG2tG1J7yMl7MbTD4/YZ5VSDkNPWpVFMkuvDqGa/xwYUjtFZ9qtq8ctYYwELd3N6TANG5GVO XlCYiBF9QCbOYCzkqBG1CNcMxEJnqc3K2pbOulG8PzEmQWZFjXG4JkIUC9aRaRyY1kcrqfXem4am 6tQE+MejL35i7svqDJWHHK1xQEmRh1KWDTCgLCgampbWoaSYmBguK9oae+dd+hPvW8/ZDsaMK6o+ /ZRym0HNeMSopd1g44DxPqOadosNMTKOaSraAWXiLQ81y6zV4LRDgW+bxf1rmtlsAzo2bMC0WBNg d6JZznbWVTQa9rFDhg40eoutnLymrqlzzoqNqaBQXAA4Kqg04wOGHnpsA0OamnZZQLO1bkQjw5DJ CWwWu14WrxIabBMsccphJQhEgUNZrPg7HHZ1YWLvqbENrdzfhRpc6T6B5S1+PHRKqd4A03qxp5pa Os43438StdeOnMj+2zt6gIc+eY6OfegM3qMI41Ic0DbRwm2xJVmPvKLdpwZ++NnmMNWcq7q+jxbo U+4yHjFSuAxaWgs9elAe0FS0DrfLsMWmpN0RTVLK25XWEWudR7e1S/DatF7inyS1UdBglk9B7XSc 0HZWBG1SaAGQjqMejlvaMXUymrqYlr1PZTgNaHaAPXYVbHMcOMU9pzhVL1l9upSwsuTHDzH71BYr qk+3P0Q36pGJuM2hRyYJz6uT2JVCYbvXp/tYrMN5nMM1tSMGQ0ocWQr/Fbbu3T8r6AMmpVTR08cu yl/8nwZvvXdD0hdL8i0GGp3DFsUGpZj/RD9paMaMbaf/PFSixsFPf6/6zIcOVaB1f3doYYcdYJdd GVAB0BYc7oCDMWOF0g+5RhbisOXTZXGZD+VGuCbRnDNMTdAV6E02ALF59elnZB6lyUuOAC0Hjl3N jmbnCKU4IEecrg+RDJt1/nY5WKQLIJI7izpJFnnaYgk1DsMPV1dnEF2ke326T1ITFeQlZU8D46GT TKSkOBLZ+qGrWp8X6uU/2+tt0Buo/hb9LXp9+lvqsouLK46rCtMnB6qI2QYMDIxpSwrJE5Ukf+Hv ZfC6JPuZH3R/8PpzcI1cyA5wml3gGMcyGDHKOiKpoBC70wYbhgWx+GtJKa1QWuuuyTzLpwQ2LLCN COUlWQGdAMBwfunzoKU9HRfxGOxme/RaTEWVkYFSaMe9onuZ6MZrogK6TMG11o1pc3KPMpgam7KX Rbq0WNvx1ERYbIUdFXisw1nIWVNZ2TlvoniW69N9mhbnfBT5yuLTOjjpTeXLDUBVwwesri8nnfE/ /9us63ZJZKY1NmFrYMTI4z1ZDQZjcD6adLrSuiTLyfsU45bvfMb+R955Dqac3kaxz2hErdEDeoZR FYKNsZNWhbjIMfWQKifXqBpTR/+rRuuo2Cwk733beGtCBHZeBE4Ia2Y0V8+TNXQd76ZdafXDT3rF 4iRiuCBvY5dZlEZXjIEBmw59lqFcUwVM1s9iwb8VvJAHwSw9lSXOlooZhFD0ELahJbevdToXRjSt 986orKCB1bsjeO9rjOle3xq5T9e0NMPTpvUpBwmohh5WBuA9UJqtTNCl9NiS/AgDBSNGPdDkJrhR sxw9CuFWYtuZkhS//Wv1z728qcfnpgKPh80IDzjcuBNzYTutamgqGnlej9zCXqh0nMk6k5E12DHN soiotnGm7fi2vKfDtUpNjkVNDG0wk2Te5H1ciUY6VFKUFBbrUaKJb1AodEGvT89iW5yw9VE2FTlU FVVFlZPLcriCFTw+lQpQqKRkKMjJdFgorEJpfAaGwNZivxM2jUJ9lTBVSnm0My5dn+6TFXahE7ub WgdTxw8RKaUK8pnXmA+3yNEeK1kaIrkFT1tsjUvGUE+WKom96y/df3xPHo4AACAASURBVH1Zffet D9VGTbI+qFjbaUgLbFFqVNMZ02KlDbm/qauhA7JcZLY3LXlJltOMEacv08gkDUryqwO2M5rrixfa EAdcpBA2QikGIxL3KJvAPkNF1qdfUe0zcrC9MnjXhhi6EhhRV3EkhLNVtKlnkMXSE8KOclnWaY06 hI116vp4H9NIOI733nfBuhhG+pvK+ynJ7R4q9oBOEfFE6WtJ3o+dOaZtYMCghorKA2QW2+KzuOgL OMnI3vYH9sf/1Ti5Ts+ZViowDY04cYleCGHlLUpgj9oGh2iKYV88TFIOybQ+svWEAsYoJ4aRmZRe VuDvme/OhUB7jzGR2wryHA0MqS2uIPMB/6mCvKYZ07YYTSaZJi6YWrN2eYEO8ZuI5O4GxHkwUsJL NviQNGYXXiAvnW1RmVNKWaW8922lVuNf771xpnu9zsJ9rPHE5c/7qeVMVj1Rw8t+OH4IgXaY0lOU 1Iy8Y3lQZAP6wIiRwWh0RiZwzsRA0BoUpUU95bnmn42Lt/6G/X/+o7vn1nPm73rcenKFajAGV1Ao lME43AaFQqn43PQTYesDmhaXh1KMxmLt8hQNQAR2XijTemtoa99M2yC6gMQ0E/1yxk6SdWLj5jk7 pCHqKONydI4e06TmC9LokW2z5VB7sdJFE7bmkHpcbp9R0yxW0r2XkuBKdtzRFCkYX9ZWMbnrgsa7 qQS4Cmcp+hIxI+lxazyx3kmnyBqAaVWhfVP5ppqKZhLYncKCgbb2EcAp0/hlsuHBIt1xTQtPqGhr 78Y8ZhTAiJGGLUqLAZuRWXTiMAG4DXUOkD33xfnzX8w7/8y99lvr/dPnwN9KBXt5QVaiiZjeMjmf oROSFKPWAQ2wRSFs7TE+mtcWUts4UMLWos8kmjePCDKRACmR3DN27kRrdKIcXZIV5DMxzzlZn15B 4eYcc6lC69oujIqIzlihOs+1OINYQuVcScwg8zNhRaDCgxLDcBjSU8dSDHsBWayw9VEGm/SjNdN2 U9oUPsXbpNpxX/NM/fv3lY975jlsGqEzyQQNrpb0LJicrzrP9fjI1mWPXOxRxHCJFdTf1Mzhiiyn N5g16SZkkgBJt1BlF2ev4mxha8DgehSb9DbjrhElvRbuZfcke8ntlKSOiZXvV5BH5+R98pzMYAS0 Rdy2gLKcvAwfWZhEq8iLiZd1MSnS/hyJTeV40pjIu2qOPj9srZQq4jYA4hGzWBU1wu7gtrTC1sAu VQ2GrIa2s9aLTiU6TE3d0IxpDmhabV/3tvwF33/Y5EWpo1CElFCbnlV3mNtNP5cOzj6gHePqENOy dJASzgaKnip6isjWMOUwF7qfOLtLBufwEsxdTsSqFkbUczslHVJUx5v7AmOCQ2vqRx5vrdNag0oL EEwZL5Wa1JpYE87h6apQ4oIxbsFGmilLusv0MqOSBeohIqUoyTRFRiZSVuDppBnxYIOsT9/DWUbN HM6WayxsUGoY00RHBNajFTX2u36Ku2/O3v3761e9trUtFpyPrnuJglShepNz+IIsDV+Lk3D24Zzu tMKmScTZiZJ1rx5NneySsETC2SKtV+HsqRcL7pJMdawCedDExc7d68aE+nXZE5MrvdQBspKl231t h4sqnQclqENnmNbbaPVUWpnWm0aB4hylapZjWq81OpvqrJm7BNGeTQRDlpPlhwl0uz+klNpgIyOz WIPJyXPyhZxdUFjYC2VGluJsYesGMoqQvqUmfqDXvplnDEZdpWIhaa2ABqMhJxe2LikzsoamCk5i VU32mnHydT5HbsWTrHFSZDW1J4Q3RXPesvSibtB2iC3pcPaqhTyhCxePJWZSIvKAimomPuGcKAkb h7PeykfiGJVSqarYjMCGIKRDwO05avxyvcA1YjmLZZOjKzkOswfhAyeR2QazLOrGYseMCji2EmdX NLaDs7Ppkc40z/qO9YBb6eC4S0FEMmSi5d//l7xflJ2DggBr7dkpOmrOZZADHvPA369bBpyIdGeK 5XX1Re+9syKtURp9jvzmvV/WR6moRV5ODHwyo4StxUr4UFBd2Re9cHdrJxscVVtH1GCHctM84n/K vvq67Oh0VZA21JEaWDgIeWLBnq07fty6g7PdIoT4nT/JH/3CmlZ55xWqJHeQwKbUV1CoPFRTechj oe4fzQ6y977BATkKvMMpnEanDPsCL9uw5uQZRROnb0ZWYypMSZahDcazvLqPh07sgUZ3p451AVu3 xs2sRHJDpZMtb9WOgMso/ZZpSG3bhDqmkv5lJswYpB5cssb91ZsXZ4mXvfzCy8vv+okj//qFG4DH ZlBjFtqz5Sdtx1ewkK2B/oDt42r/9KqXstY3GDGX5miNDqZTvI1AIHvAnB2Acrs4SDVhkoRPZDi6 jGHj+UPZRnxMr5LCdhW2xfpOGtXkvtiGZkQ9pLE4HatoWuwKCKxTIur0Ja1x4wNrrfVY07ouWhAz vuiUkoDovbeGBcrg1Iv4LpFCbQy2VWIWNQ22pRp578kL5T2mCR/pVoGAM6nEnx9qanPnzaPXfNPd 11/yudtPO8FHllEPtil7kGN7UKLtpL56JjBd4fLlFrdrrl/zOtZ6i63D3jeemFwjcW82BpY9wBd0 Fu+mClKKXc80eDeFpGWk0tekO6aE3+7cWMrZDW6IqfB13ImkRCnUCHOGkXzOMq7BU9Yx6HQzuKDa tuPrWUhRWgO0LXXFeORGQzs+cN5LeN2s6iDA+pw20mXRuKb7dDm+bTzQH6hsST3uc8V5Dzqdvqf6 l4+5p2p8RjZgcIQj/Wmc3fHmZMLWZTQaLuyyr3z2GnHrnJMFIZuEDVuxzM6cf0CkALwPq2XyL84Y c7uWvimBbYDgJz4UZ3ftFTqydRPrEwi5GMFYUvbIha2HNDXGS/7Lci60PuolKljTRKDmhepvaqXU TLitNXgXknnPyRoyc2n3PkS7aV6SF4vZOsuDkVXsrP+4dPLu6t99255kaexRd+3ZlWgIoS6ccbS5 VOkFljD3l/yz9U9cuDfS/J5JD5CUpijVTNCInO8KlBSgNuVRzwNbzzjkFwii6BoUhyrgPK7BOcjQ WzF9AzC4MY2j0ugBpcFLLblNcos1y9Vn571SOJxxTmmvc1TmQ1N81lTOtB58N/9HsPWMoaqtg5t+ FXm8n+igAsjaOoRlK6XkEd1yPF3M948uqmfo3X94sNfpWIl89GHPFpv8AzqEywe8J2/d1bYd7srr 1gkIr2tosD0yiyTd2R5ZSS4Fg3pkM5WD2uADmaXWrCkllBVICMOKDk/RI13gkZVTgCTRnAbpggap cCmWQ8Vq6hY3pPHRwJRSlHPw2CoCEoUagVmZoZijrCBgi9ISbaeUUm3jxAShlLatT+YIa5Br5Ktp EPyQl+ttzDPVKqT8SlZ4pSYLRbezupgvL5RMp0PK7MuuzWVR0ZnOtC6KHGhbUxT5JNZNURST1UGO 27aVqCyhg7PujpsXbD9XjeyNHxs87TE5IBv6mFC2D9vxD1iQl/A+JJvoDKdcWu68973NIC+WkbMh iMigRMGR0MsGGzOeVHdXUvlqnQe65YRa49ZWxzSNlzJo8/mOws2i8yTvejdyVdi67K/LFtOLzHwr SKM1mXhWN0NhEPHjpDIYC8jirHdK451q6+BNBG+NV0ppvSCCbwrbKF/0gra3FprMuK9sS1aQFxOl W/TuejyZRSk7IyuCneSQwvt3Pp0XoENpQo6xBZzh4BhbabvVPCYXCvU4AozZAzZCGt7ol9973797 wuKNFf/shuZpP5kTEt663pwQCiFSXCvtfIxE6DlrfTsKwcDEpJCiN5tk1SXnPNG6ZwIr5y00GAUD cqKnPVxP4GnrfF27JJVM67Veil9M46thGIveBkA9mkCLmbETu9a8FWUeZy8YLhVLWKg5C/8MaXSE +yh0TgYMaVqcRhVkerm12VgRbOgMNQWblHcKyApvmsVMG2x/SpnmUJjbuyl1RNgayHKUVmI6n4Fu EnomX88VYffC3tvnRt00QENjlgeD3/7p0X0YwOOzaG820UzRhcJa+RCzb30zxvuAZVOn9TdVM17V gV22TsdZDCccTUsuE6V1ppVVU+ve2j7M8jAo9XjaN7zOE5c0zjU423vS1jCyeLbgURlKoVu86VSD VaiSTEesUmNkG2kxOY1oV+RxZZkWYKgUSk8h8mDRqydvKBkAosyZxkt9CcES5SG2qM5yZiq0iBiW AS5K5b1PBuy8UEohmXnS12KT8u5QWpMm0xTNJHezXruoWEYmFO3WLaNd9lvagV5a1333ZJSF+DFW hZJxzkLrvbPkeTDXOu+snQTYFD3l7JSTYXXvee+CXwIvkdkqHo8xFm+tzzJl7WSty3Lq2itFWeoy qi6tce3KbshylAplQ+yiwOfFeZBNF0CGpTjRXCUdE3YJKUK5ZQi1GbzFarSkcBLMSc7gxAusYuXS HK9xBm+X50F675t6gvmsmbCRaX27yDuTF+Sl6sakizcxL9fAbNGtBCsnPCO/FUEueL0r19uoyuSF Ejs30zXjVlBOLs2Pxe3bFIywjBqaOuQO9hxNS2ux+83S4tbD04mzXUNgK49KRQbbVjnrnfPeT3QG 72kqscp3WrvypZzz1ltCxp133mmFQhnv21qSu5Qxk/xR4U7xss2gkVWPCddMxT91SSzZM2jQNpPy xGkydGfFHGe3k7MyH4ogrQEXHVqZFLS1qDZMAxRKoX0szis5efcjOG4WV0XgkZfMhP+nQMf7lxMw I8jzUs07z9v4xBV27hmqMWBKaCAjKyj79BfmX9hJAJlW9GrqPXZNqCK0CtRXQ7Er2zrW8PadjvLe O+fs9CYBywLTV79Ulqlk9Rf9XgSFUirLlTXeTu/s5z22FROquh+DkgoEd++ZYlbzctprMwbobUyJ +VU429ogrRNbAy1OoQt0rJ0uhYKoUaDiFlKesPNQyl88N5KCY9ZMZGcaLZjNIEpsPWPdXEYzgalK hyCRiZyuJ+tGl7KcojwsWwMWuxFLo0hdm2VXusm+7mh0j15La5br3Il8cPFONifPofbee7ox5cs0 kODe8/J2a9y3EsiTmNt5sRT5LA/MPaPDCFuvfYWpp3SaIMxtO3npouCm9GrJjJT1TNTN+QDu0JKZ 7y6gEeVBhY3MlGdSrMGHUiRSUjYAcRf0YuexHhQelEPPby8SbuJoKpcSkqNhJFjmkyiNrqbgEp+h 6iCcXJtfY9rJnmtZEQIGQm7OdHyIAJ70LJkPsm/s4Q3b4uLOyBSFwUt96zLGlmUwoN/E45rxPqOZ 6I4R9e6ZpVVpnHUV1pNlqMq13vvGM9oL2EwY15rJjluACFeZt9bgnBf+my2qP/MgQ1sL2FBZjlLh WGc0lbcmVC43004GwTzWTMZFqVUPSgEhiUdnfM9ZHlYD007GC6ZweTJzJZqX2b5Bgc9RDp9qHkQ7 bBB90bPlbVwQhXx0g1XOe7fKni3KcpiaKlQCVxqlMTFDcR5dTd6q6XTEuoLU1TD0cpbj3cRPO6+v dFcGqcySF0QNWR0mYrZqKOIoNjQ1oXKs6ViZauxB3GWhDUVaCmI2uHC580vnq/dUzoOR+oOynoih d0YPkWY3Fbal3KBtJqn4UXte9S625eCsB8q+dzaZjSfHSnnnFut8XUGeIP5C0jpAi/n9aLotMS2j s6HxMPvQecvsLOOYJuSTWshQGd5G6ZJNQp28Rkm5x3SLVF1FSrs7u7Yo2WShkfntHd7hHNYEgSp1 1oh8PG95lUE9ZE6kmIeC3TT2TlYsaKesvykPb+3M6dK4IW1nbs8RmClULKu5Zg4lyFH0BCrM+i+m LyYrvPezRVS8X/NqpmMqTt6QmeOFfWhNQHdFb32YT7ZydiVq5jLEQv7vzCvEGTTH2TVA2mRDmFuF HTvpFsLL4vI6c9sWjFVaqyJDqcW5+EpjGu+9CI/Qv9OxqSomnIc3WQGm19ZmV2oBW6fMZ5kYaQTE mJhwfDUElKzjaxIuAdg7ZTe3fBbFR3k4th5PKtNmkFmwdtV8VQqtMqts9Mv6+UoGMySQr4yuEJkM K3bDkaesZms51nrWCCbjJX2+Vu4c0ujEzMCt+9V8VQYqR67ReFANyFYELd4Hb4IyDu99lvkM1Y3a 6AZZW+O8X6qg5IW3RnmPeB+dxbTeWXSWjHSTTCGBU3mxIBTbO0y7Zgsf76mGlP0QPaKzyUPlOC4v HibPIrhzvTWUfXQerlxL1TD4SlpaR1vFyZlKPHoo0Bk6HUshPIfX+JpaEirMkmLSAMrXlbXGtnVA z0pN2SJEF09+9O7Mlxqz8u5Au5KzrfFtrZrKm5ayz8yxtT72oerGBUiwcdFTs+hoyVPyguoAOq6W 7hS1bdhfnY6nPS8nEa3C6OJ4N5085wUw9s6b/RWPkO0DPRGZGBdqzaRsbu9pnE/4VetJGrP3yrTe VUv1BlF0vE8tDu+fYhRlMJTCxgjdtNfOPK0eHmlUKGCisS7cfOZYRU9kcrZ3UfXhK8Pvn/atweVS u3oy21PNkBIUqo7HqV74gNzg6xhRVC13DeaFb6rQ8miq985OtMbuYp06U0j+pWMi4GqZ3daMD3wa i7b2zgb5Ijb+2IfhWFhQ+rCpvIBjWIPoto7R1hP2nad6SD2aRENAKDaSqpFMCm83kwm0YH397I0L kJHWwSIzv92CsLVpqUbhI+qCziiWuLiKnmgwHuWT/68beisCQKz3yxg60Wqrn0g1caFL4xcetzVt PfHxQqgAca508nbnPd6HPsyjSi250hshjzADMmxDMwzZXxLhZO26NG+mDRpKhYhc0y7mnu460+0H maXnuslOVqAzlF7ah9HEBBKb2gtBwkVv6Vtd+oipvXeZVgTtEg9O6gR53EzhERZy9ifeu7hzhblF BiTpFaR1lKzRnh9yzpdVeUxRBEqhNHkxgVCmnTJXHYZWl9vzbhVDp2Nk4LPQgMU2mUM06Z7byAqf KbJOELP0lgxu2vXL42u8Rg86MRgScZKTFcutwkleRDMzOlN5QX+TotdBBQ3VcIrdpWPlfVsxNy6O uVpKPooAFvWhdxO2TmTb2QWwS1pPpamnltcH8bO8XOhqtWfBAH7mA97GfUDyHI9AzODE8k5mrRIt QWe0ErLQiYAR5JAsG/OUFb6K5toQM9Bg2omAmcEe3cStGTo4u6bcnutEh+XFpOS78HGbch8LdBas S7I6CU8049Aqa5YuQV2669N+uGuzAqWUs8EW6yy9DTXK2rp1zqpe39b4eKz3aaXgRrlBC80Y723R X/pWWT4BCUBagBNkEmOF5FjQWdPST6QfTDMbRTTbdSYYTGfGsa3D+CZLc0oRSHzv7Ox4LXyfwY7o 6NOBqXMDLSMoVloZwU44Rpg8TNcnWcDZd30aDWWJB2OihTz6XETKCoqaaYc1zHhVlgXcbO5M4jSk oc044niNaSYO1eDBUUsn6J03LT6fyDvSLJoZ2uTr0tmUNFJqcqWzKbssOL1W0+m7aGvBY15nypoA QK3xsSKPl8oT6VgYpegx3p9YHjaPLX1EXlINF9hAmwrRd1MHBpv9dOicjzv9jffWaA5pKW7rqZtM lKuMhO8TQwslT43E5yyDlJc9Mhwsk1zyL0mIlBUmWWyFhdKds2IKXC3g7DN3hwMvKGeMd+Tlqp3A l9E1X7b4/CMeF8wgiZQGh/eYemLn7rZbqdCPkxduMQ23fHBNGxZK9GR+UWoBROtSsi5lOf3NNc8C ztzj81KBMq131oMKoDOWfJin5KLrGtS2jy99xGB7sZVGqRgIurw4WOpn4NYb17/OCpI+DBLKLV05 vZ8Kypuhp3874wMAbydgz3Z8F2GBLWOgSEcZCz5s8dEU9DYYdbaMXjCkzZhbbuTSawFMnBnnFNsk AAN47NctvuAxXxOwR15M7L3SQV2Tc/KfC0kw90QqtDjDzR9a0xhZChb2e15MSuos/XmUat6zsbXq SqGTt4fcH2eVVKI6JDkngaYATcVgZykaufaxq2waEniTKiMzh0cFZJqGf/ibw7ZtBYmEUppMz7Jv wtzWLLDYln2e/T1cfHW8Tz41st2bJN5bZs8WtgbO3jM5uXhU3/oGvuN1YUERSCAsLpJb8ElYC8xk UUgezjScwjozw5CXHDkRWu8cXvaDmJ6jyeScyLTYCFEEIzpDVnDvbQvfYEKCRsr+pLWJlUXqdJcw ObYmHMhKGqycjvIQ2x7sn+bgTFBIyin04vOYnpMXOKvqsResn8CuXJDYcb7rhL74yRN81aUp614b hFzXWDZpige45SNr3sW0YSBEuUoUZmC0G0r7Z/R+QfzCMKJHXXot3tHb5MKreNRX8civmCmQtDhk j2j28Q5rqcchUsA2oZC2UD3GNBO4wTLOfv+f8u2vnYyu93iHswENJ/nnTRC9glOFBHilTMwX/Qi/ 9r93bq142U8ELS0xkOlk1HbPd220KRTGdMbv5g8uHuMu+a49O0PpMGALKWwA2QQJKiBbBqCtecTj 1jxL2nznpzh+6VSdeaGiF55b9CSiiKI3pWmlr0UPbzhxGffcOnv/vGQQE81E7U493+0Z0SKKPvVw MRLQGWc+t+5dDAdnYM404T1NhWwg19aT6VduTBojql7oZ08z5tv+D8oBLuL+ehh6OFGa4TOjM/Hg jINHhghIUqQUkOXsn5r8ajFnf+4z3PpRLn9UWESSy2oe3s3D30RicHjyC7n04bz3Ldx5E1ddx+Of y6WPCG0ietS7ekywTGXimMS16OV+1Lf9ytJ/TW7oQl84G15EZ7h1aUiy8swAle0T9DfXz6W//2O+ /uVrrkmYWCwzIurygtZNsPLXfSe/+Z9mgzxf9JrOV730Xbr3X0h3fnJ99G/XdFsNF/eY9xNT44y7 PvGGcGo5IMvxdtIwcesmO8FhqBslIVl/IkHkvMxDoaUY81d+gB99G8QJJAwhZcFmlRKFzoJ1LMFW YWspb3D19Tz8seFlJlXFYqyI0mRFzMyJc1Eelxeo3uTkDH3ib7n7M+v7wnvGe2wcCb18SOb2Dtfx TSZ62U/wrjfx2Y+F3RecxbnZif13f7Kes4VSpdmZlojkvv5pHH0Df/VG7rkFnXPlo/nq53HldWFJ TKvQindZYel/528fon1qKnxq4X5a0oBlPSm8UfRAzSXFRCf/YWJLupSS2FMya/q7d3Jy2VLO/uR7 ufkjXPrwkCUh3CzxYoK6dDbluRXvhpTuFTu3GU1hjIAKIo82lfjqZ8/Xo4DMkrOzHWNatKbohbmh NaM9fu+nDtsXt97I1V+CUmQl3mHbcNwdKmswUYSEN3K09ZTPNcu57FF846vCsWgRwI8+b2odvOcW Rrvoua410eyaDsKjW5oqSJ1ODCpKcdVjePGPTrnGxvuTJnXfRdSJQ6Q7T/pkLYk11jm8Xbqjo3eM 9zE1WY7KJogoWUsTiUxLDBOAmSZFCqR/zRg05XzXT5mFSovhWCZGU02Z55dytvf86HP5qfcGF2PX TulduIWzk64UNm06icczzt5UNYKo2IpiKq8hPaLj+a7dJ9nC2jo+1/B/fd+amIcufe5TXPEoYFZZ 7GpFExttHrg84Pt4Pu9hmhBLWQ6m7N8z1jzv+N3X8exXzDaju1vDVNFkj2koN3C2U0pTz4I02wT0 PC/hBOzK9DgMvfcPDyUmRbNCovkcZn7rFiDa0Wd0hmX2qK6jQLTbpIPKs2ZdmHGdrw4m5XKUDheX Ma3GtNz4V1M/XOWgPDjN6//NgvPJ4SRyWsLzz6mWktZTPvlECUWtgIB3fJLXv3w92O3SyTsOe6X3 tNUCrSudJ+LF1fSetwQz7WEoGfu67G4aqoPJpx7OSorZm2iK3qHibOsR7/uDQzVMZ7Mu9IX3X4jp TUMzXoX3unh19qEdidON7ureHCg3piJgP/m+6fssfTIAH/1LbnjVAoAlzN21NR6SsriCtzXVwcTQ o4sQgW5qmiVRUE3FW/5P3vTac5DWQje9b/01U43M6W1S9GffLssPxdaAs/zqD57bQ2eE6PKUmlW0 wlmb6Pd/5tC4thNnspq5mWu/aHXz5vyuKDTNVHURCZxCeGMYPqazR16WijCWU2yd5XzmgyEUNtH6 UXr3mzk4zct/fnImeJv1xM6d3jYZ7MKVanJewqDFmjavTCS8OEMCSUcHvPO3+PQH7ueWYtWQj76T L/2akNkaLPTNlAWzm6snEroZh/THmfPzk27hsnvnJ3njf+Yb/rfJmVSmsFuvsEsp0oNFOJVu+ISZ UzrdlJ95Gb3n9/jcp5f+d4bahtHegvgQgU/prWXEZ7bCKnpBExPPke0Euk00qHoCz4h5WDO8kRVB u0ua3iTxLwaF24a/+6PZxh8KQ3zkHbzm6/n+X2Pz2HTvu9BiUYG7YRghDjgLRhmZwSnsDvB2CnKl V01zIy+oK/72Ldz0PnbvO0wzV9Ff/N88/MvobQSeJioGRL5c5rWR7IQV0Z4rRPhH/4qNIzzj28NX UcjoGLZFqiWbtIQpCy3Dqd2YENfpw26cRhqXGfqHd/P+P13a2oXPEgg03y3E7QtTNJLwZWp/VwbZ ZmI47mb9iZiDEBaS/AYznrLUaXQMIyQzWs7v/cwC+HpYdHzPrfzQ0/mG7+drvnXqvJjSumwhCWAy tyS70blJOP9h6LYbef+fct/ts+vLA6F6xA2v5Dt/iqIMTBMTKWCJ0D0MpaSyZfS+P+SuT/HiH0Ev igrKiuACS6n7CbDKEHahczfgMe0oN6NoCnhlOj5E6IN/xgf+/H6+5gpKOHhma/TV1wsdxt4nPNMb UI/CYpvACTDa461vWKzSnEOUk/f8w7t53x9w7LLg7g/JAxri8jSVPaCD8zI1pWtLoVP5tzsA3vGB t3HT+84ZTK+ltubjf82jv5qyA6ATc89TEoHLKLH1e9+yKmNt7yTv/1OuvI6dC6NyooHgZWij5Scl sxFTtRObCokEzfJOTEicnHKrpNnbdqqUijH80ev5zAfWddAc58+0mQAABI9JREFUXfUYLnvE0v+K 5cTaifWT6TCbREHSuWA6U53IJ9NOLOIT37YLKZiy5ouTRGwpE0jjef9befebly6n5xy/Nz7gg3/G 37wZrbjk4cEgKIZVaUdThSUsCGyLM9g2BDA5SzvG1LRVuDL558WsKybkc9X5DknNmPe/jf1TXP5F YeyTg3pG1xFTvdarMKsi4IG/f+uaXEzT8OG/4OYPc/WXTrxdzhJSJt2UZ6CtMC1FT0pKh4Q/04RI VzkZAFsZOCn0sJkslSk++8Pv4M9/Zco5d3i6/NFc9oiA30I4bvdYh1iovAhjF1xXFinbEDQZFyx3 MrJZPjGSinYotj/bhqIfITRfBeaR0Bok8NjRNijNje/ir36T+25ftdg+oMr1WnPJtXzVv+Rxz8La KfRDdIB1bZzOBowoAQYzZqyJ08fxq69kvM9DR0WPa7+cx34tRy4AgsadqItlVySM+Wjm/5UfZHj2 UM8V58tTvoXjl01yFpetyCn8JuURdlNm0jXpQBiOaAu/8V189B1rcgtW0xNewGOfDtM7gi88TjMt jX5bT7S9FEBS9sPETtek8I0UZiOWCRt3uE3nqyGfeA9338xwXa6J0IO2J0Nvg6OXcPkjOXEFRy7k 6EXsXMBWJ3xeDPLiksgL2nopZwN7J3nnb3PPrdEHdo6bPh6e8oKjFzM4wuAIW8fYvoDNHXROkbOx E/T9rCCfwyRZPhmVX/kBhos3BltKW8e4/mlc/zTycilnJ+5JQQEsMq51L/aeWz/Kx97FyTsehE57 0gt57NeuYmgi0kj7RnQ5m2jKEC4XtoYpzhYFXVak8UHI1mlrhrsMdxnvMdqnGdM2a3IC5+mh3Xvl G1/JY54cjgPGikrSas6e/+qWlObRGX/8C9z+8QetzZ9nKvscv5Qrr+Oqx3DhVVOug8Q63XSsec42 Dbd9jFs/ysnbGe4+hFLgC4se2l1YJJoi5TgmzDRPgh1FRiZ8NlVBy4WSRTAVHWbN8koWXwjUVNx9 C3ffwt/9MRDihza2KPrB4JAXFCW6CPY1weimDsKsa1c+T116yDl7vB+NDAXeT6J2kpW+a7OUBA1Z fJEdhDs+oCTjU9zsOQVAfkGQqCLLKkmfp8PTQ8vZw5j0nxVkeTDCz4htifUh2miTf0TwWRdHpoyj vJzMBK0fakh1nr4g6aHl7HtvCxpSqECppgzeSQmTFBtiMWzxaOpsNoK0m+KQpPV8ZZ/zdJ54qDn7 vttC3ZJE3eR7STpKlRhSlrJox6JrzmSGJses2PbDnDkPNM/THD3Q7eBXkzV87K8heobn83GI0cmT qO54vDbxu5uBd57O0ww9tJwNvPUNfPbjh4ob7pI4lmcqrZ2n83R4esDbwR+CPvYu7voUV15HUU7F BkyOO9GkIqpTmc0Z/3ZK7ewef+rvpxLgztN54qHG2ULec8uHecMr2DrG0Yu56GFcdR0nLqfoL04a 9S7MOLF/J9u24JnDFxI/T/9/pn8CBjMVAtaWWqZ9+hN/oeJ5MY/Y896K83SeztN5Ok/n6Tydp/N0 ns7TeTpP5+k83T/6fwEfb2KSI/kgFgAAAABJRU5ErkJggg== "/>
- <rect width="285.97864" x="26.028843" y="78.512794" rx="0" height="284.96848" ry="0" style="fill:#000000;fill-opacity:1;stroke:none;opacity:0" id="rect2995"/>
- </g>
- <g id="layer2"/>
-</svg>
diff --git a/demos/qt3d/shapes/qt3d.ico b/demos/qt3d/shapes/qt3d.ico
deleted file mode 100644
index e6442baf..00000000
--- a/demos/qt3d/shapes/qt3d.ico
+++ /dev/null
Binary files differ
diff --git a/demos/qt3d/shapes/qt3d.png b/demos/qt3d/shapes/qt3d.png
deleted file mode 100644
index 21ec0176..00000000
--- a/demos/qt3d/shapes/qt3d.png
+++ /dev/null
Binary files differ
diff --git a/demos/qt3d/shapes/shapes.cpp b/demos/qt3d/shapes/shapes.cpp
deleted file mode 100644
index 7871d2e2..00000000
--- a/demos/qt3d/shapes/shapes.cpp
+++ /dev/null
@@ -1,430 +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 "qglpainter.h"
-#include "qglbuilder.h"
-#include "qglcube.h"
-#include "qglteapot.h"
-#include "qglcamera.h"
-#include "qgltexture2d.h"
-#include "qglsubsurface.h"
-#include <QApplication>
-#include <QImage>
-#include <QPainter>
-#include <QDebug>
-
-class ShapesWidget : public QGLWidget
-{
- Q_OBJECT
-public:
- ShapesWidget(QWidget *parent = 0);
- ~ShapesWidget();
-
-protected:
- void initializeGL();
- void paintGL();
-
-private:
- void paintPoints(QGLPainter *painter, const QRect& rect);
- void paintLines(QGLPainter *painter, const QRect& rect);
- void paintLineStrip(QGLPainter *painter, const QRect& rect);
- void paintLineLoop(QGLPainter *painter, const QRect& rect);
- void paintTriangles(QGLPainter *painter, const QRect& rect);
- void paintTriangleStrip(QGLPainter *painter, const QRect& rect);
- void paintTriangleFan(QGLPainter *painter, const QRect& rect);
- void paintCube(QGLPainter *painter, const QRect& rect);
- void paintTeapot(QGLPainter *painter, const QRect& rect);
- void drawText(QGLPainter *painter, const QRect& posn, const QString& str);
-
- static QVector2DArray basicPoints(const QRect& rect);
-
- QGLCamera camera;
- QGLSceneNode *scene;
- QGLSceneNode *cube;
- QGLSceneNode *teapot;
- QGLLightModel oneSidedModel;
- QGLLightModel twoSidedModel;
-};
-
-ShapesWidget::ShapesWidget(QWidget *parent)
- : QGLWidget(parent)
-{
- setWindowTitle(tr("GL Primitive Shapes"));
- oneSidedModel.setModel(QGLLightModel::OneSided);
- twoSidedModel.setModel(QGLLightModel::TwoSided);
-}
-
-ShapesWidget::~ShapesWidget()
-{
- delete scene;
-}
-
-void ShapesWidget::initializeGL()
-{
- QGLPainter painter(this);
-
- painter.setLightModel(&twoSidedModel);
- painter.setFaceColor(QGL::FrontFaces, QColor(170, 202, 0));
- painter.setFaceColor(QGL::BackFaces, QColor(202, 170, 0));
-
- QGLBuilder builder;
- builder << QGL::Faceted << QGLCube();
- cube = builder.currentNode();
- builder << QGL::Smooth << QGLTeapot();
- teapot = builder.currentNode();
- scene = builder.finalizedSceneNode();
-}
-
-void ShapesWidget::paintGL()
-{
- QGLPainter painter(this);
-
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
- glDisable(GL_DEPTH_TEST);
-
- QMatrix4x4 projm;
- projm.ortho(rect());
- painter.projectionMatrix() = projm;
- painter.modelViewMatrix().setToIdentity();
-
- QRect wrect = rect();
- int boxw = wrect.width() / 3;
- int boxh = wrect.height() / 3;
-
- paintLines(&painter, QRect(0, 0, boxw, boxh));
- paintLineStrip(&painter, QRect(boxw, 0, boxw, boxh));
- paintLineLoop(&painter, QRect(boxw * 2, 0, boxw, boxh));
- paintTriangles(&painter, QRect(0, boxh, boxw, boxh));
- paintTriangleStrip(&painter, QRect(boxw, boxh, boxw, boxh));
- paintTriangleFan(&painter, QRect(boxw * 2, boxh, boxw, boxh));
- paintPoints(&painter, QRect(0, boxh * 2, boxw, boxh));
-
- glEnable(GL_DEPTH_TEST);
-
- paintCube(&painter, QRect(boxw, boxh * 2, boxw, boxh));
- paintTeapot(&painter, QRect(boxw * 2, boxh * 2, boxw, boxh));
-}
-
-QVector2DArray ShapesWidget::basicPoints(const QRect& rect)
-{
- QVector2DArray vertices;
- int step = qMin(rect.width() / 6, rect.height() / 6);
- int midx = rect.x() + rect.width() / 2;
- int midy = rect.y() + rect.height() / 2;
- vertices.append(midx - step * 2, midy - step);
- vertices.append(midx + step, midy - step * 2);
- vertices.append(midx, midy - step);
- vertices.append(midx + step * 2 + step / 2, midy - step / 2);
- vertices.append(midx - step, midy);
- vertices.append(midx + step * 2, midy + step);
- vertices.append(midx - step, midy + step);
- vertices.append(midx + step * 2, midy);
- return vertices;
-}
-
-void ShapesWidget::paintPoints(QGLPainter *painter, const QRect& rect)
-{
- painter->setStandardEffect(QGL::FlatColor);
- painter->setColor(QColor(170, 202, 0));
-
- painter->clearAttributes();
- painter->setVertexAttribute(QGL::Position, basicPoints(rect));
- painter->draw(QGL::Points, 8);
-
- drawText(painter, rect, tr("Points"));
-}
-
-void ShapesWidget::paintLines(QGLPainter *painter, const QRect& rect)
-{
- painter->clearAttributes();
- painter->setVertexAttribute(QGL::Position, basicPoints(rect));
- painter->draw(QGL::Lines, 8);
-
- drawText(painter, rect, tr("Lines"));
-}
-
-void ShapesWidget::paintLineStrip(QGLPainter *painter, const QRect& rect)
-{
- painter->clearAttributes();
- painter->setVertexAttribute(QGL::Position, basicPoints(rect));
- painter->draw(QGL::LineStrip, 8);
-
- drawText(painter, rect, tr("Line strip"));
-}
-
-void ShapesWidget::paintLineLoop(QGLPainter *painter, const QRect& rect)
-{
- painter->clearAttributes();
- painter->setVertexAttribute(QGL::Position, basicPoints(rect));
- painter->draw(QGL::LineLoop, 8);
-
- drawText(painter, rect, tr("Line loop"));
-}
-
-void ShapesWidget::paintTriangles(QGLPainter *painter, const QRect& rect)
-{
- painter->setStandardEffect(QGL::LitMaterial);
-
- QVector2DArray vertices;
- QVector3DArray normals;
- int step = qMin(rect.width() / 8, rect.height() / 8);
- int midx = rect.x() + rect.width() / 2;
- int midy = rect.y() + rect.height() / 2;
-
- vertices.append(midx - step * 3, midy);
- vertices.append(midx - step * 3, midy + step * 2);
- vertices.append(midx - step, midy + step * 2);
-
- normals.append(0.0f, 0.0f, 1.0f);
- normals.append(0.0f, 0.0f, 1.0f);
- normals.append(0.0f, 0.0f, 1.0f);
-
- vertices.append(midx - step * 2, midy - step);
- vertices.append(midx + step / 2, midy + step * 2);
- vertices.append(midx + step * 3, midy - step);
-
- normals.append(0.0f, 0.0f, 1.0f);
- normals.append(0.0f, 0.0f, 1.0f);
- normals.append(0.0f, 0.0f, 1.0f);
-
- painter->clearAttributes();
- painter->setVertexAttribute(QGL::Position, vertices);
- painter->setVertexAttribute(QGL::Normal, normals);
- painter->draw(QGL::Triangles, 6);
-
- drawText(painter, rect, tr("Triangles"));
-}
-
-void ShapesWidget::paintTriangleStrip(QGLPainter *painter, const QRect& rect)
-{
- painter->setStandardEffect(QGL::LitMaterial);
-
- QVector2DArray vertices;
- QVector3DArray normals;
- int step = qMin(rect.width() / 8, rect.height() / 8);
- int midx = rect.x() + rect.width() / 2;
- int midy = rect.y() + rect.height() / 2;
-
- vertices.append(midx - step * 3, midy - step * 2);
- vertices.append(midx - step * 3, midy + step);
- vertices.append(midx - step, midy - step * 2);
- vertices.append(midx, midy + step);
- vertices.append(midx + step, midy - step * 2);
- vertices.append(midx + step * 2, midy + step * 2);
-
- normals.append(0.0f, 0.0f, 1.0f);
- normals.append(0.0f, 0.0f, 1.0f);
- normals.append(0.0f, 0.0f, 1.0f);
- normals.append(0.0f, 0.0f, 1.0f);
- normals.append(0.0f, 0.0f, 1.0f);
- normals.append(0.0f, 0.0f, 1.0f);
-
- painter->clearAttributes();
- painter->setVertexAttribute(QGL::Position, vertices);
- painter->setVertexAttribute(QGL::Normal, normals);
- painter->draw(QGL::TriangleStrip, 6);
-
- // Overpaint some lines to show the triangle boundaries.
- painter->clearAttributes();
- painter->setStandardEffect(QGL::FlatColor);
- painter->setColor(QColor(202, 170, 0));
- painter->setVertexAttribute(QGL::Position, vertices);
- painter->draw(QGL::LineStrip, 4, 1);
-
- drawText(painter, rect, tr("Triangle strip"));
-}
-
-void ShapesWidget::paintTriangleFan(QGLPainter *painter, const QRect& rect)
-{
- painter->setStandardEffect(QGL::LitMaterial);
-
- QVector2DArray vertices;
- QVector3DArray normals;
- int step = qMin(rect.width() / 8, rect.height() / 8);
- int midx = rect.x() + rect.width() / 2;
- int midy = rect.y() + rect.height() / 2;
-
- vertices.append(midx - step, midy + step);
- vertices.append(midx + step * 2, midy + step * 2);
- vertices.append(midx + step * 2, midy);
- vertices.append(midx + step, midy - step);
- vertices.append(midx - step, midy - step * 2);
-
- normals.append(0.0f, 0.0f, 1.0f);
- normals.append(0.0f, 0.0f, 1.0f);
- normals.append(0.0f, 0.0f, 1.0f);
- normals.append(0.0f, 0.0f, 1.0f);
- normals.append(0.0f, 0.0f, 1.0f);
-
- painter->clearAttributes();
- painter->setVertexAttribute(QGL::Position, vertices);
- painter->setVertexAttribute(QGL::Normal, normals);
- painter->draw(QGL::TriangleFan, 5);
-
- // Overpaint some lines to show the triangle boundaries.
- painter->clearAttributes();
- painter->setStandardEffect(QGL::FlatColor);
- painter->setColor(QColor(202, 170, 0));
- static ushort const indices[] = {0, 2, 0, 3};
- painter->setVertexAttribute(QGL::Position, vertices);
- painter->draw(QGL::Lines, indices, 4);
-
- drawText(painter, rect, tr("Triangle fan"));
-}
-
-void ShapesWidget::paintCube(QGLPainter *painter, const QRect& rect)
-{
- painter->setStandardEffect(QGL::LitMaterial);
-
- painter->projectionMatrix().push();
- painter->modelViewMatrix().push();
-
- QGLSubsurface surface(painter->currentSurface(), rect);
- painter->pushSurface(&surface);
-
- painter->setCamera(&camera);
- painter->modelViewMatrix().rotate(45.0f, 1.0f, 1.0f, 1.0f);
-
- cube->draw(painter);
-
- painter->projectionMatrix().pop();
- painter->modelViewMatrix().pop();
-
- painter->popSurface();
-
- drawText(painter, rect, tr("Cube"));
-}
-
-void ShapesWidget::paintTeapot(QGLPainter *painter, const QRect& rect)
-{
- painter->setStandardEffect(QGL::LitMaterial);
-
- painter->projectionMatrix().push();
- painter->modelViewMatrix().push();
-
- QGLSubsurface surface(painter->currentSurface(), rect);
- painter->pushSurface(&surface);
-
- painter->setCamera(&camera);
-
- // Need a one-sided lighting model for the teapot.
- painter->setLightModel(&oneSidedModel);
-
- teapot->draw(painter);
-
- painter->setLightModel(&twoSidedModel);
-
- painter->projectionMatrix().pop();
- painter->modelViewMatrix().pop();
-
- painter->popSurface();
-
- drawText(painter, rect, tr("Teapot"));
-}
-
-// Draw text centered on the bottom of the "posn" rectangle.
-void ShapesWidget::drawText
- (QGLPainter *painter, const QRect& posn, const QString& str)
-{
- QFontMetrics metrics = fontMetrics();
- QRect rect = metrics.boundingRect(str);
- rect.adjust(0, 0, 1, 1);
-
- QFont f = font();
-
- QImage image(rect.size(), QImage::Format_ARGB32);
- image.fill(0);
- QPainter p2(&image);
- p2.setFont(f);
- p2.setPen(Qt::white);
- p2.drawText(-rect.x(), metrics.ascent(), str);
- p2.end();
-
- QGLTexture2D texture;
- texture.setImage(image);
-
- int x = posn.x() + (posn.width() - rect.width()) / 2;
- int y = posn.y() + posn.height() - metrics.ascent() - metrics.descent();
- y -= 10;
-
- QVector2DArray vertices;
- vertices.append(x + rect.x(), y + metrics.ascent());
- vertices.append(x + rect.x(), y - metrics.descent());
- vertices.append(x + rect.x() + rect.width(), y - metrics.descent());
- vertices.append(x + rect.x() + rect.width(), y + metrics.ascent());
-
- QVector2DArray texCoord;
- texCoord.append(0.0f, 0.0f);
- texCoord.append(0.0f, 1.0f);
- texCoord.append(1.0f, 1.0f);
- texCoord.append(1.0f, 0.0f);
-
- painter->clearAttributes();
- painter->setStandardEffect(QGL::FlatReplaceTexture2D);
- texture.bind();
- painter->setVertexAttribute(QGL::Position, vertices);
- painter->setVertexAttribute(QGL::TextureCoord0, texCoord);
- painter->draw(QGL::TriangleFan, 4);
- painter->setStandardEffect(QGL::FlatColor);
- glBindTexture(GL_TEXTURE_2D, 0);
-}
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
- ShapesWidget w;
-
-#ifdef Q_OS_SYMBIAN
- w.setAttribute(Qt::WA_LockLandscapeOrientation, true);
- w.showFullScreen();
-#else
- if (QApplication::arguments().contains(QLatin1String("-maximize")))
- w.showMaximized();
- else if (QApplication::arguments().contains(QLatin1String("-fullscreen")))
- w.showFullScreen();
- else
- w.show();
-#endif
- return app.exec();
-}
-
-#include "shapes.moc"
diff --git a/demos/qt3d/shapes/shapes.desktop b/demos/qt3d/shapes/shapes.desktop
deleted file mode 100644
index 9880fbfb..00000000
--- a/demos/qt3d/shapes/shapes.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=shapes
-Icon=/usr/share/icons/hicolor/80x80/apps/qt3d.png
-Exec=/usr/bin/invoker --type=e -s /usr/bin/shapes -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_shapes
diff --git a/demos/qt3d/shapes/shapes.pro b/demos/qt3d/shapes/shapes.pro
deleted file mode 100644
index 3d6be070..00000000
--- a/demos/qt3d/shapes/shapes.pro
+++ /dev/null
@@ -1,14 +0,0 @@
-TEMPLATE = app
-TARGET = shapes
-CONFIG += qt warn_on
-
-CONFIG += qt3d_deploy_pkg
-include(../../../pkg.pri)
-
-SOURCES = shapes.cpp
-
-OTHER_FILES += \
- shapes.rc \
- shapes.desktop
-
-RC_FILE = shapes.rc
diff --git a/demos/qt3d/shapes/shapes.rc b/demos/qt3d/shapes/shapes.rc
deleted file mode 100644
index b40ecdc1..00000000
--- a/demos/qt3d/shapes/shapes.rc
+++ /dev/null
@@ -1 +0,0 @@
-IDI_ICON1 ICON DISCARDABLE "qt3d.ico"
diff --git a/demos/qt3d/teaservice/README b/demos/qt3d/teaservice/README
deleted file mode 100644
index d7d71a61..00000000
--- a/demos/qt3d/teaservice/README
+++ /dev/null
@@ -1,7 +0,0 @@
-
-This example demonstrates a view with multiple scene objects, plus material
-parameters. It shows a teapot, two teacups, and two teaspoons.
-
-The model source data came from "http://www.sjbaker.org/teapot/teaset.tgz".
-
-Note: the teacups have no bottoms in the original source data.
diff --git a/demos/qt3d/teaservice/meshobject.cpp b/demos/qt3d/teaservice/meshobject.cpp
deleted file mode 100644
index f2ef5242..00000000
--- a/demos/qt3d/teaservice/meshobject.cpp
+++ /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 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 "meshobject.h"
-#include "qglview.h"
-
-MeshObject::MeshObject(QGLSceneNode *meshObject, QObject *parent)
- : QObject(parent)
-{
- m_mesh = 0;
- m_meshObject = meshObject;
- m_scale = 1.0f;
- m_rotationAngle = 0.0f;
- m_effect = 0;
- m_objectId = -1;
- m_hovering = false;
- m_material = 0;
- m_hoverMaterial = 0;
-}
-
-MeshObject::MeshObject(QGLAbstractScene *scene, QObject *parent)
- : QObject(parent)
-{
- scene->setParent(this);
- m_mesh = 0;
- m_meshObject = scene->mainNode();
- m_scale = 1.0f;
- m_rotationAngle = 0.0f;
- m_effect = 0;
- m_objectId = -1;
- m_hovering = false;
- m_material = 0;
- m_hoverMaterial = 0;
-}
-
-MeshObject::~MeshObject()
-{
- delete m_mesh;
-}
-
-void MeshObject::initialize(QGLView *view, QGLPainter *painter)
-{
- Q_UNUSED(painter);
- if (m_objectId != -1)
- view->registerObject(m_objectId, this);
-}
-
-void MeshObject::draw(QGLPainter *painter)
-{
- // Position the model at its designated position, scale, and orientation.
- painter->modelViewMatrix().push();
- painter->modelViewMatrix().translate(m_position);
- if (m_scale != 1.0f)
- painter->modelViewMatrix().scale(m_scale);
- if (m_rotationAngle != 0.0f)
- painter->modelViewMatrix().rotate(m_rotationAngle, m_rotationVector);
-
- // Apply the material and effect to the painter.
- QGLMaterial *material;
- if (m_hovering)
- material = m_hoverMaterial;
- else
- material = m_material;
- painter->setColor(material->diffuseColor());
- painter->setFaceMaterial(QGL::AllFaces, material);
- if (m_effect)
- painter->setUserEffect(m_effect);
- else
- painter->setStandardEffect(QGL::LitMaterial);
-
- // Mark the object for object picking purposes.
- int prevObjectId = painter->objectPickId();
- if (m_objectId != -1)
- painter->setObjectPickId(m_objectId);
-
- // Draw the geometry mesh.
- if (m_meshObject)
- m_meshObject->draw(painter);
- else
- m_mesh->draw(painter);
-
- // Turn off the user effect, if present.
- if (m_effect)
- painter->setStandardEffect(QGL::LitMaterial);
-
- // Revert to the previous object identifier.
- painter->setObjectPickId(prevObjectId);
-
- // Restore the modelview matrix.
- painter->modelViewMatrix().pop();
-}
-
-bool MeshObject::event(QEvent *e)
-{
- // Convert the raw event into a signal representing the user's action.
- if (e->type() == QEvent::MouseButtonPress) {
- QMouseEvent *me = (QMouseEvent *)e;
- if (me->button() == Qt::LeftButton)
- emit pressed();
- } else if (e->type() == QEvent::MouseButtonRelease) {
- QMouseEvent *me = (QMouseEvent *)e;
- if (me->button() == Qt::LeftButton) {
- emit released();
- if (me->x() >= 0) // Positive: inside object, Negative: outside.
- emit clicked();
- }
- } else if (e->type() == QEvent::MouseButtonDblClick) {
- emit doubleClicked();
- } else if (e->type() == QEvent::Enter) {
- m_hovering = true;
- emit hoverChanged();
- } else if (e->type() == QEvent::Leave) {
- m_hovering = false;
- emit hoverChanged();
- }
- return QObject::event(e);
-}
diff --git a/demos/qt3d/teaservice/meshobject.h b/demos/qt3d/teaservice/meshobject.h
deleted file mode 100644
index 15b62f05..00000000
--- a/demos/qt3d/teaservice/meshobject.h
+++ /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 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 MESHOBJECT_H
-#define MESHOBJECT_H
-
-#include <QtCore/qobject.h>
-#include <QtGui/qevent.h>
-
-#include "qglpainter.h"
-#include "qglabstractscene.h"
-
-QT_BEGIN_NAMESPACE
-class QGLView;
-class QGLSceneNode;
-QT_END_NAMESPACE
-
-class MeshObject : public QObject
-{
- Q_OBJECT
-public:
- explicit MeshObject(QGLSceneNode *meshObject, QObject *parent=0);
- explicit MeshObject(QGLAbstractScene *scene, QObject *parent=0);
- virtual ~MeshObject();
-
- QVector3D position() const { return m_position; }
- void setPosition(const QVector3D& value) { m_position = value; }
-
- qreal scale() const { return m_scale; }
- void setScale(qreal value) { m_scale = value; }
-
- qreal rotationAngle() const { return m_rotationAngle; }
- void setRotationAngle(qreal value) { m_rotationAngle = value; }
-
- QVector3D rotationVector() const { return m_rotationVector; }
- void setRotationVector(const QVector3D& value) { m_rotationVector = value; }
-
- QGLMaterial *material() const { return m_material; }
- void setMaterial(QGLMaterial *value)
- { m_material = value; m_hoverMaterial = value; }
-
- QGLMaterial *hoverMaterial() const { return m_hoverMaterial; }
- void setHoverMaterial(QGLMaterial *value) { m_hoverMaterial = value; }
-
- QGLAbstractEffect *effect() const { return m_effect; }
- void setEffect(QGLAbstractEffect *value) { m_effect = value; }
-
- int objectId() const { return m_objectId; }
- void setObjectId(int id) { m_objectId = id; }
-
- void initialize(QGLView *view, QGLPainter *painter);
- void draw(QGLPainter *painter);
-
-signals:
- void pressed();
- void released();
- void clicked();
- void doubleClicked();
- void hoverChanged();
-
-protected:
- bool event(QEvent *e);
-
-private:
- QGLSceneNode *m_mesh;
- QGLSceneNode *m_meshObject;
- QGLAbstractScene *m_scene;
- QVector3D m_position;
- qreal m_scale;
- qreal m_rotationAngle;
- QVector3D m_rotationVector;
- QGLMaterial *m_material;
- QGLMaterial *m_hoverMaterial;
- QGLAbstractEffect *m_effect;
- int m_objectId;
- bool m_hovering;
-};
-
-#endif
diff --git a/demos/qt3d/teaservice/per_pixel_lighting.fsh b/demos/qt3d/teaservice/per_pixel_lighting.fsh
deleted file mode 100644
index d97a0461..00000000
--- a/demos/qt3d/teaservice/per_pixel_lighting.fsh
+++ /dev/null
@@ -1,112 +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$
-**
-****************************************************************************/
-
-// Per-pixel lighting - fragment shader side.
-
-struct qt_MaterialParameters {
- mediump vec4 emission;
- mediump vec4 ambient;
- mediump vec4 diffuse;
- mediump vec4 specular;
- mediump float shininess;
-};
-uniform qt_MaterialParameters qt_Material;
-
-struct qt_SingleLightParameters {
- mediump vec4 position;
- mediump vec3 spotDirection;
- mediump float spotExponent;
- mediump float spotCutoff;
- mediump float spotCosCutoff;
- mediump float constantAttenuation;
- mediump float linearAttenuation;
- mediump float quadraticAttenuation;
-};
-uniform qt_SingleLightParameters qt_Light;
-
-varying mediump vec3 qNormal;
-varying mediump vec3 qLightDirection;
-varying mediump vec3 qHalfVector;
-varying mediump vec3 qVertexToLight;
-varying mediump vec4 qAmbient;
-varying mediump vec4 qDiffuse;
-
-vec4 qLightPixel(vec4 ambient, vec4 diffuse)
-{
- float angle, spot;
- vec4 color;
- vec4 component;
- vec3 normal = normalize(qNormal);
-
- // Start with the ambient color.
- color = ambient;
-
- // Determine the cosine of the angle between the normal and the
- // vector from the vertex to the light.
- angle = max(dot(normal, qLightDirection), 0.0);
-
- // Calculate the diffuse light components.
- component = angle * diffuse;
-
- // Calculate the specular light components.
- if (angle != 0.0) {
- angle = max(dot(normal, qHalfVector), 0.0);
- component += pow(angle, qt_Material.shininess) * qt_Material.specular;
- }
-
- // Apply the spotlight angle and exponent.
- if (qt_Light.spotCutoff != 180.0) {
- spot = max(dot(normalize(qVertexToLight),
- normalize(qt_Light.spotDirection)), 0.0);
- if (spot < qt_Light.spotCosCutoff)
- spot = 0.0;
- else
- spot = pow(spot, qt_Light.spotExponent);
- component *= spot;
- }
-
- return clamp(color + component, 0.0, 1.0);
-}
-
-void main(void)
-{
- gl_FragColor = qLightPixel(qAmbient, qDiffuse);
-}
diff --git a/demos/qt3d/teaservice/per_pixel_lighting.vsh b/demos/qt3d/teaservice/per_pixel_lighting.vsh
deleted file mode 100644
index d5157840..00000000
--- a/demos/qt3d/teaservice/per_pixel_lighting.vsh
+++ /dev/null
@@ -1,96 +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$
-**
-****************************************************************************/
-
-// Per-pixel lighting - vertex shader side.
-
-attribute highp vec4 qt_Vertex;
-attribute mediump vec3 qt_Normal;
-uniform mediump mat4 qt_ModelViewMatrix;
-uniform mediump mat4 qt_ModelViewProjectionMatrix;
-uniform mediump mat3 qt_NormalMatrix;
-
-struct qt_MaterialParameters {
- mediump vec4 emission;
- mediump vec4 ambient;
- mediump vec4 diffuse;
- mediump vec4 specular;
- mediump float shininess;
-};
-uniform qt_MaterialParameters qt_Material;
-
-struct qt_SingleLightParameters {
- mediump vec4 position;
- mediump vec3 spotDirection;
- mediump float spotExponent;
- mediump float spotCutoff;
- mediump float spotCosCutoff;
- mediump float constantAttenuation;
- mediump float linearAttenuation;
- mediump float quadraticAttenuation;
-};
-uniform qt_SingleLightParameters qt_Light;
-
-varying mediump vec4 qAmbient;
-varying mediump vec4 qDiffuse;
-varying mediump vec3 qNormal;
-varying mediump vec3 qLightDirection;
-varying mediump vec3 qHalfVector;
-varying mediump vec3 qVertexToLight;
-
-void qLightVertex(vec4 vertex, vec3 normal)
-{
- vec3 toEye;
- qNormal = normal;
- qAmbient = qt_Material.emission + qt_Material.ambient;
- qDiffuse = qt_Material.diffuse;
- qLightDirection = normalize(qt_Light.position.xyz);
- toEye = vec3(0, 0, 1);
- qHalfVector = normalize(qLightDirection + toEye);
- qVertexToLight = vertex.xyz - qt_Light.position.xyz;
-}
-
-void main(void)
-{
- gl_Position = qt_ModelViewProjectionMatrix * qt_Vertex;
- vec4 vertex = qt_ModelViewMatrix * qt_Vertex;
- vec3 normal = normalize(qt_NormalMatrix * qt_Normal);
- qLightVertex(vertex, normal);
-}
diff --git a/demos/qt3d/teaservice/perpixeleffect.cpp b/demos/qt3d/teaservice/perpixeleffect.cpp
deleted file mode 100644
index fc3a4260..00000000
--- a/demos/qt3d/teaservice/perpixeleffect.cpp
+++ /dev/null
@@ -1,52 +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 "perpixeleffect.h"
-
-PerPixelEffect::PerPixelEffect()
-{
- setVertexShaderFromFile(":per_pixel_lighting.vsh");
- setFragmentShaderFromFile(":per_pixel_lighting.fsh");
-}
-
-PerPixelEffect::~PerPixelEffect()
-{
-}
diff --git a/demos/qt3d/teaservice/perpixeleffect.h b/demos/qt3d/teaservice/perpixeleffect.h
deleted file mode 100644
index dd265f2a..00000000
--- a/demos/qt3d/teaservice/perpixeleffect.h
+++ /dev/null
@@ -1,58 +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 PERPIXELEFFECT_H
-#define PERPIXELEFFECT_H
-
-#include "qglshaderprogrameffect.h"
-
-class PerPixelEffectPrivate;
-class QGLShader;
-
-class PerPixelEffect : public QGLShaderProgramEffect
-{
- Q_DISABLE_COPY(PerPixelEffect);
-public:
- PerPixelEffect();
- virtual ~PerPixelEffect();
-};
-
-#endif
diff --git a/demos/qt3d/teaservice/qt3d.ico b/demos/qt3d/teaservice/qt3d.ico
deleted file mode 100644
index e6442baf..00000000
--- a/demos/qt3d/teaservice/qt3d.ico
+++ /dev/null
Binary files differ
diff --git a/demos/qt3d/teaservice/qt3d.png b/demos/qt3d/teaservice/qt3d.png
deleted file mode 100644
index 21ec0176..00000000
--- a/demos/qt3d/teaservice/qt3d.png
+++ /dev/null
Binary files differ
diff --git a/demos/qt3d/teaservice/sceneobject.cpp b/demos/qt3d/teaservice/sceneobject.cpp
deleted file mode 100644
index 0c7ec4ed..00000000
--- a/demos/qt3d/teaservice/sceneobject.cpp
+++ /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 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 "sceneobject.h"
-#include "meshobject.h"
-
-SceneObject::SceneObject(QObject *parent)
- : QObject(parent)
-{
-}
-
-SceneObject::~SceneObject()
-{
-}
-
-void SceneObject::initialize(QGLView *view, QGLPainter *painter)
-{
- // Initialize all of the mesh objects that we have as children.
- foreach (QObject *obj, children()) {
- MeshObject *meshobj = qobject_cast<MeshObject *>(obj);
- if (meshobj)
- meshobj->initialize(view, painter);
- }
-}
-
-void SceneObject::draw(QGLPainter *painter)
-{
- // Draw all of the mesh objects that we have as children.
- foreach (QObject *obj, children()) {
- MeshObject *meshobj = qobject_cast<MeshObject *>(obj);
- if (meshobj)
- meshobj->draw(painter);
- }
-}
diff --git a/demos/qt3d/teaservice/sceneobject.h b/demos/qt3d/teaservice/sceneobject.h
deleted file mode 100644
index 0e3a3323..00000000
--- a/demos/qt3d/teaservice/sceneobject.h
+++ /dev/null
@@ -1,63 +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 SCENEOBJECT_H
-#define SCENEOBJECT_H
-
-#include <QtCore/qobject.h>
-#include "qglpainter.h"
-
-QT_BEGIN_NAMESPACE
-class QGLView;
-QT_END_NAMESPACE
-
-class SceneObject : public QObject
-{
- Q_OBJECT
-public:
- explicit SceneObject(QObject *parent=0);
- virtual ~SceneObject();
-
- virtual void initialize(QGLView *view, QGLPainter *painter);
- virtual void draw(QGLPainter *painter);
-};
-
-#endif
diff --git a/demos/qt3d/teaservice/teacup.txt b/demos/qt3d/teaservice/teacup.txt
deleted file mode 100644
index f4dde3ef..00000000
--- a/demos/qt3d/teaservice/teacup.txt
+++ /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/demos/qt3d/teaservice/teaservice.cpp b/demos/qt3d/teaservice/teaservice.cpp
deleted file mode 100644
index 3423916e..00000000
--- a/demos/qt3d/teaservice/teaservice.cpp
+++ /dev/null
@@ -1,386 +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 <QApplication>
-#include <QMainWindow>
-#include <QMenu>
-#include <QMenuBar>
-#include <QKeyEvent>
-#include <QAction>
-#include <QDebug>
-#include "qglview.h"
-#include "meshobject.h"
-#include "sceneobject.h"
-#include "qglteapot.h"
-#include "qglbuilder.h"
-#include "perpixeleffect.h"
-
-enum {
- ObjTeapot,
- ObjTeacup1,
- ObjTeacup2,
- ObjTeaspoon1,
- ObjTeaspoon2
-};
-
-class Teapot : public MeshObject
-{
- Q_OBJECT
-public:
- Teapot(QObject *parent=0);
- ~Teapot() {}
-};
-
-static QGLSceneNode *createTeapot(QObject *parent)
-{
- QGLBuilder builder;
- builder << QGLTeapot();
- QGLSceneNode *n = builder.finalizedSceneNode();
- n->setParent(parent);
- return n;
-}
-
-Teapot::Teapot(QObject *parent)
- : MeshObject(createTeapot(parent), parent)
-{
-}
-
-class Teacup : public MeshObject
-{
- Q_OBJECT
-public:
- Teacup(QObject *parent=0);
- ~Teacup() {}
-};
-
-static QGLAbstractScene *loadBezier(const QString& fileName)
-{
- QGLAbstractScene *scene;
- scene = QGLAbstractScene::loadScene(fileName, QLatin1String("bezier"));
- if (!scene)
- qFatal("Could not load %s, probably plugin could not be found",
- fileName.toLatin1().constData());
- return scene;
-}
-
-Teacup::Teacup(QObject *parent)
- : MeshObject(loadBezier(QLatin1String(":/teacup.txt")), parent)
-{
-}
-
-class Teaspoon : public MeshObject
-{
- Q_OBJECT
-public:
- Teaspoon(QObject *parent=0);
- ~Teaspoon() {}
-};
-
-Teaspoon::Teaspoon(QObject *parent)
- : MeshObject(loadBezier(QLatin1String(":/teaspoon.txt")), parent)
-{
-}
-
-class TeaService : public QObject
-{
- Q_OBJECT
-public:
- TeaService(QObject *parent=0);
- ~TeaService();
-
- SceneObject *service;
-
- Teapot *teapot;
- Teacup *teacup1;
- Teacup *teacup2;
- Teaspoon *teaspoon1;
- Teaspoon *teaspoon2;
- PerPixelEffect *lighting;
-
- void changeMaterials(bool perPixel);
-
-signals:
- void changed();
-
-private slots:
- void teapotClicked();
- void teacup1Clicked();
- void teacup2Clicked();
- void teaspoon1Clicked();
- void teaspoon2Clicked();
-
-private:
- QGLMaterial *china;
- QGLMaterial *chinaHighlight;
- QGLMaterial *metal;
- QGLMaterial *metalHighlight;
-};
-
-TeaService::TeaService(QObject *parent)
- : QObject(parent)
-{
- china = new QGLMaterial(this);
- china->setAmbientColor(QColor(192, 150, 128));
- china->setSpecularColor(QColor(60, 60, 60));
- china->setShininess(128);
-
- chinaHighlight = new QGLMaterial(this);
- chinaHighlight->setAmbientColor(QColor(255, 192, 0));
- chinaHighlight->setSpecularColor(QColor(60, 60, 0));
- chinaHighlight->setShininess(128);
-
- metal = new QGLMaterial(this);
- metal->setAmbientColor(QColor(255, 255, 255));
- metal->setDiffuseColor(QColor(150, 150, 150));
- metal->setSpecularColor(QColor(255, 255, 255));
- metal->setShininess(128);
-
- metalHighlight = new QGLMaterial(this);
- metalHighlight->setAmbientColor(QColor(255, 255, 96));
- metalHighlight->setDiffuseColor(QColor(150, 150, 96));
- metalHighlight->setSpecularColor(QColor(255, 255, 255));
- metalHighlight->setShininess(128);
-
- service = new SceneObject(this);
- teapot = new Teapot(service);
- teacup1 = new Teacup(service);
- teacup2 = new Teacup(service);
- teacup1->setPosition(QVector3D(-2.3f, -0.75f, 0.0f));
- teacup2->setRotationAngle(180);
- teacup2->setRotationVector(QVector3D(0, 1, 0));
- teacup2->setPosition(QVector3D(2.3f, -0.75f, 0.0f));
- teaspoon1 = new Teaspoon(service);
- teaspoon2 = new Teaspoon(service);
- teaspoon1->setRotationAngle(275);
- teaspoon1->setRotationVector(QVector3D(1, 0, 0));
- teaspoon1->setPosition(QVector3D(-1.7f, -0.58f, 0.0f));
- teaspoon2->setRotationAngle(275);
- teaspoon2->setRotationVector(QVector3D(1, 0, 0));
- teaspoon2->setPosition(QVector3D(1.7f, -0.58f, 0.0f));
-
- teapot->setObjectId(ObjTeapot);
- teacup1->setObjectId(ObjTeacup1);
- teacup2->setObjectId(ObjTeacup2);
- teaspoon1->setObjectId(ObjTeaspoon1);
- teaspoon2->setObjectId(ObjTeaspoon2);
-
- lighting = new PerPixelEffect();
- changeMaterials(false);
-
- connect(teapot, SIGNAL(hoverChanged()), this, SIGNAL(changed()));
- connect(teacup1, SIGNAL(hoverChanged()), this, SIGNAL(changed()));
- connect(teacup2, SIGNAL(hoverChanged()), this, SIGNAL(changed()));
- connect(teaspoon1, SIGNAL(hoverChanged()), this, SIGNAL(changed()));
- connect(teaspoon2, SIGNAL(hoverChanged()), this, SIGNAL(changed()));
-
- connect(teapot, SIGNAL(clicked()), this, SLOT(teapotClicked()));
- connect(teacup1, SIGNAL(clicked()), this, SLOT(teacup1Clicked()));
- connect(teacup2, SIGNAL(clicked()), this, SLOT(teacup2Clicked()));
- connect(teaspoon1, SIGNAL(clicked()), this, SLOT(teaspoon1Clicked()));
- connect(teaspoon2, SIGNAL(clicked()), this, SLOT(teaspoon2Clicked()));
-}
-
-TeaService::~TeaService()
-{
- delete lighting;
-}
-
-void TeaService::changeMaterials(bool perPixel)
-{
- teapot->setMaterial(china);
- teapot->setHoverMaterial(chinaHighlight);
- teacup1->setMaterial(china);
- teacup1->setHoverMaterial(chinaHighlight);
- teacup2->setMaterial(china);
- teacup2->setHoverMaterial(chinaHighlight);
- if (perPixel) {
- teapot->setEffect(lighting);
- teacup1->setEffect(lighting);
- teacup2->setEffect(lighting);
- } else
- {
- teapot->setEffect(0);
- teacup1->setEffect(0);
- teacup2->setEffect(0);
- }
-
- teaspoon1->setMaterial(metal);
- teaspoon1->setHoverMaterial(metalHighlight);
- teaspoon2->setMaterial(metal);
- teaspoon2->setHoverMaterial(metalHighlight);
- if (perPixel) {
- teaspoon1->setEffect(lighting);
- teaspoon2->setEffect(lighting);
- } else
- {
- teaspoon1->setEffect(0);
- teaspoon2->setEffect(0);
- }
-}
-
-void TeaService::teapotClicked()
-{
- qDebug("teapot clicked");
-}
-
-void TeaService::teacup1Clicked()
-{
- qDebug("teacup1 clicked");
-}
-
-void TeaService::teacup2Clicked()
-{
- qDebug("teacup2 clicked");
-}
-
-void TeaService::teaspoon1Clicked()
-{
- qDebug("teaspoon1 clicked");
-}
-
-void TeaService::teaspoon2Clicked()
-{
- qDebug("teaspoon2 clicked");
-}
-
-class TeaServiceView : public QGLView
-{
- Q_OBJECT
-public:
- TeaServiceView(QWidget *parent=0);
-
-public slots:
- void standardLighting();
- void perPixelLighting();
-
-protected:
- void initializeGL(QGLPainter *painter);
- void paintGL(QGLPainter *painter);
- void keyPressEvent(QKeyEvent *e);
-
-private:
- TeaService *teaService;
-};
-
-TeaServiceView::TeaServiceView(QWidget *parent)
- : QGLView(parent)
-{
- teaService = new TeaService(this);
-
- setOption(QGLView::ObjectPicking, true);
-
- connect(teaService, SIGNAL(changed()), this, SLOT(updateGL()));
-}
-
-void TeaServiceView::initializeGL(QGLPainter *painter)
-{
- teaService->service->initialize(this, painter);
-}
-
-void TeaServiceView::paintGL(QGLPainter *painter)
-{
- teaService->service->draw(painter);
-}
-
-void TeaServiceView::standardLighting()
-{
- teaService->changeMaterials(false);
- updateGL();
-}
-
-void TeaServiceView::perPixelLighting()
-{
- teaService->changeMaterials(true);
- updateGL();
-}
-
-void TeaServiceView::keyPressEvent(QKeyEvent *e)
-{
- if (e->key() == Qt::Key_Tab) {
- // The Tab key turns the ShowPicking option on and off,
- // which helps show what the pick buffer looks like.
- setOption(QGLView::ShowPicking, ((options() & QGLView::ShowPicking) == 0));
- updateGL();
- }
- QGLView::keyPressEvent(e);
-}
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
- QMainWindow mainw;
- mainw.setMinimumSize(850, 480);
- mainw.setWindowTitle(QLatin1String("Tea Service"));
-
- TeaServiceView view;
- mainw.setCentralWidget(&view);
- view.setFocus();
-
- view.camera()->setEye(QVector3D(0, 3, 10));
-
- QMenu *menu = mainw.menuBar()->addMenu(QLatin1String("Effects"));
-
- QAction *standardLighting = new QAction(QLatin1String("Standard lighting"), &mainw);
- menu->addAction(standardLighting);
- QObject::connect(standardLighting, SIGNAL(triggered()), &view, SLOT(standardLighting()));
-
- QAction *perPixelLighting = new QAction(QLatin1String("Per-pixel lighting"), &mainw);
- menu->addAction(perPixelLighting);
- QObject::connect(perPixelLighting, SIGNAL(triggered()), &view, SLOT(perPixelLighting()));
-
- menu->addSeparator();
-
- QAction *exitAction = new QAction(QLatin1String("E&xit"), &mainw);
- menu->addAction(exitAction);
- QObject::connect(exitAction, SIGNAL(triggered()), &app, SLOT(quit()));
-
-#ifdef Q_OS_SYMBIAN
- mainw.setAttribute(Qt::WA_LockLandscapeOrientation, true);
- mainw.showFullScreen();
-#endif
-
- view.updateGL();
- mainw.update();
- mainw.show();
- return app.exec();
-}
-
-#include "teaservice.moc"
diff --git a/demos/qt3d/teaservice/teaservice.desktop b/demos/qt3d/teaservice/teaservice.desktop
deleted file mode 100644
index eee50a74..00000000
--- a/demos/qt3d/teaservice/teaservice.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=Tea Service
-Icon=/usr/share/icons/hicolor/80x80/apps/qt3d.png
-Exec=/usr/bin/invoker --type=e -s /usr/bin/teaservice -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_teaservice
diff --git a/demos/qt3d/teaservice/teaservice.pro b/demos/qt3d/teaservice/teaservice.pro
deleted file mode 100644
index 94968531..00000000
--- a/demos/qt3d/teaservice/teaservice.pro
+++ /dev/null
@@ -1,17 +0,0 @@
-TEMPLATE = app
-TARGET = teaservice
-CONFIG += qt warn_on
-
-CONFIG += qt3d_deploy_pkg
-include(../../../pkg.pri)
-
-SOURCES = teaservice.cpp meshobject.cpp sceneobject.cpp perpixeleffect.cpp
-HEADERS = meshobject.h sceneobject.h perpixeleffect.h
-RESOURCES = teaservice.qrc
-
-OTHER_FILES += \
- teaservice.rc \
- teaservice.desktop
-
-RC_FILE = teaservice.rc
-
diff --git a/demos/qt3d/teaservice/teaservice.qrc b/demos/qt3d/teaservice/teaservice.qrc
deleted file mode 100644
index ab55d88c..00000000
--- a/demos/qt3d/teaservice/teaservice.qrc
+++ /dev/null
@@ -1,8 +0,0 @@
-<!DOCTYPE RCC><RCC version="1.0">
-<qresource>
- <file>per_pixel_lighting.vsh</file>
- <file>per_pixel_lighting.fsh</file>
- <file>teacup.txt</file>
- <file>teaspoon.txt</file>
-</qresource>
-</RCC>
diff --git a/demos/qt3d/teaservice/teaservice.rc b/demos/qt3d/teaservice/teaservice.rc
deleted file mode 100644
index b40ecdc1..00000000
--- a/demos/qt3d/teaservice/teaservice.rc
+++ /dev/null
@@ -1 +0,0 @@
-IDI_ICON1 ICON DISCARDABLE "qt3d.ico"
diff --git a/demos/qt3d/teaservice/teaspoon.txt b/demos/qt3d/teaservice/teaspoon.txt
deleted file mode 100644
index 3c6a1b74..00000000
--- a/demos/qt3d/teaservice/teaspoon.txt
+++ /dev/null
@@ -1,275 +0,0 @@
-16
-1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16
-17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32
-33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48
-49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64
-65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80
-81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96
-97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112
-113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128
-129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144
-145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160
-161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176
-177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192
-193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208
-209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224
-225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240
-241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256
-256
--0.000107143,0.205357,0.0
-0.0,0.196429,-0.0178571
-0.0,0.196429,-0.0178571
-0.000107143,0.205357,0.0
--0.0535714,0.205357,0.0
--0.0222714,0.178571,-0.0534286
-0.0222714,0.178571,-0.0534286
-0.0535714,0.205357,0.0
--0.107143,0.0952429,-0.0178571
--0.0446429,0.0952429,-0.0892857
-0.0446429,0.0952429,-0.0892857
-0.107143,0.0952429,-0.0178571
--0.107143,0.0,-0.0178571
--0.0446429,0.0,-0.0892857
-0.0446429,0.0,-0.0892857
-0.107143,0.0,-0.0178571
-0.000107143,0.205357,0.0
-0.000135714,0.207589,0.00446429
-0.000157143,0.216518,0.00446429
-0.000125,0.214286,0.0
-0.0535714,0.205357,0.0
-0.0613964,0.212054,0.0133571
-0.0714286,0.220982,0.015625
-0.0625,0.214286,0.0
-0.107143,0.0952429,-0.0178571
-0.122768,0.0952429,0.0
-0.142857,0.0952429,0.00446429
-0.125,0.0952429,-0.0178571
-0.107143,0.0,-0.0178571
-0.122768,0.0,0.0
-0.142857,0.0,0.00446429
-0.125,0.0,-0.0178571
-0.000125,0.214286,0.0
-0.0,0.205357,-0.0178571
-0.0,0.205357,-0.0178571
--0.000125,0.214286,0.0
-0.0625,0.214286,0.0
-0.0267857,0.1875,-0.0625
--0.0267857,0.1875,-0.0625
--0.0625,0.214286,0.0
-0.125,0.0952429,-0.0178571
-0.0535714,0.0952429,-0.107143
--0.0535714,0.0952429,-0.107143
--0.125,0.0952429,-0.0178571
-0.125,0.0,-0.0178571
-0.0535714,0.0,-0.107143
--0.0535714,0.0,-0.107143
--0.125,0.0,-0.0178571
--0.000125,0.214286,0.0
--0.000157143,0.216518,0.00446429
--0.000135714,0.207589,0.00446429
--0.000107143,0.205357,0.0
--0.0625,0.214286,0.0
--0.0714286,0.220982,0.015625
--0.0613964,0.212054,0.0133571
--0.0535714,0.205357,0.0
--0.125,0.0952429,-0.0178571
--0.142857,0.0952429,0.00446429
--0.122768,0.0952429,0.0
--0.107143,0.0952429,-0.0178571
--0.125,0.0,-0.0178571
--0.142857,0.0,0.00446429
--0.122768,0.0,0.0
--0.107143,0.0,-0.0178571
--0.107143,0.0,-0.0178571
--0.0446429,0.0,-0.0892857
-0.0446429,0.0,-0.0892857
-0.107143,0.0,-0.0178571
--0.107143,-0.142857,-0.0178571
--0.0446429,-0.142857,-0.0892857
-0.0446429,-0.142857,-0.0892857
-0.107143,-0.142857,-0.0178571
--0.0133929,-0.160714,0.0386893
--0.00557857,-0.160714,0.0386893
-0.00557857,-0.160714,0.0386893
-0.0133929,-0.160714,0.0386893
--0.0133929,-0.25,0.0535714
--0.00557857,-0.25,0.0535714
-0.00557857,-0.25,0.0535714
-0.0133929,-0.25,0.0535714
-0.107143,0.0,-0.0178571
-0.122768,0.0,0.0
-0.142857,0.0,0.00446429
-0.125,0.0,-0.0178571
-0.107143,-0.142857,-0.0178571
-0.122768,-0.142857,0.0
-0.142857,-0.142857,0.00446429
-0.125,-0.142857,-0.0178571
-0.0133929,-0.160714,0.0386893
-0.0153464,-0.160714,0.0386893
-0.0178571,-0.160714,0.0314357
-0.015625,-0.160714,0.0297607
-0.0133929,-0.25,0.0535714
-0.0153464,-0.25,0.0535714
-0.0178571,-0.25,0.0463179
-0.015625,-0.25,0.0446429
-0.125,0.0,-0.0178571
-0.0535714,0.0,-0.107143
--0.0535714,0.0,-0.107143
--0.125,0.0,-0.0178571
-0.125,-0.142857,-0.0178571
-0.0535714,-0.142857,-0.107143
--0.0535714,-0.142857,-0.107143
--0.125,-0.142857,-0.0178571
-0.015625,-0.160714,0.0297607
-0.00669643,-0.160714,0.0230643
--0.00781071,-0.160714,0.0208321
--0.015625,-0.160714,0.0297607
-0.015625,-0.25,0.0446429
-0.00669643,-0.25,0.0379464
--0.00781071,-0.25,0.0357143
--0.015625,-0.25,0.0446429
--0.125,0.0,-0.0178571
--0.142857,0.0,0.00446429
--0.122768,0.0,0.0
--0.107143,0.0,-0.0178571
--0.125,-0.142857,-0.0178571
--0.142857,-0.142857,0.00446429
--0.122768,-0.142857,0.0
--0.107143,-0.142857,-0.0178571
--0.015625,-0.160714,0.0297607
--0.0175786,-0.160714,0.0319929
--0.0153464,-0.160714,0.0386893
--0.0133929,-0.160714,0.0386893
--0.015625,-0.25,0.0446429
--0.0175786,-0.25,0.046875
--0.0153464,-0.25,0.0535714
--0.0133929,-0.25,0.0535714
--0.0133929,-0.25,0.0535714
--0.00557857,-0.25,0.0535714
-0.00557857,-0.25,0.0535714
-0.0133929,-0.25,0.0535714
--0.0133929,-0.46425,0.0892857
--0.00557857,-0.46425,0.0892857
-0.00557857,-0.46425,0.0892857
-0.0133929,-0.46425,0.0892857
--0.0446429,-0.678571,0.0535714
--0.00892857,-0.678571,0.0625
-0.00892857,-0.678571,0.0625
-0.0446429,-0.678571,0.0535714
--0.0446429,-0.857143,0.0357143
--0.00892857,-0.857143,0.0446429
-0.00892857,-0.857143,0.0446429
-0.0446429,-0.857143,0.0357143
-0.0133929,-0.25,0.0535714
-0.0153464,-0.25,0.0535714
-0.0178571,-0.25,0.0463179
-0.015625,-0.25,0.0446429
-0.0133929,-0.46425,0.0892857
-0.0153464,-0.464286,0.0892857
-0.0178571,-0.46425,0.0820321
-0.015625,-0.46425,0.0803571
-0.0446429,-0.678571,0.0535714
-0.0535714,-0.678571,0.0513393
-0.0535714,-0.678571,0.0334821
-0.0446429,-0.678571,0.0357143
-0.0446429,-0.857143,0.0357143
-0.0535714,-0.857143,0.0334821
-0.0535714,-0.857143,0.015625
-0.0446429,-0.857143,0.0178571
-0.015625,-0.25,0.0446429
-0.00669643,-0.25,0.0379464
--0.00781071,-0.25,0.0357143
--0.015625,-0.25,0.0446429
-0.015625,-0.46425,0.0803571
-0.00669643,-0.464286,0.0736607
--0.00781071,-0.46425,0.0714286
--0.015625,-0.46425,0.0803571
-0.0446429,-0.678571,0.0357143
-0.00892857,-0.678571,0.0446429
--0.00892857,-0.678571,0.0446429
--0.0446429,-0.678571,0.0357143
-0.0446429,-0.857143,0.0178571
-0.00892857,-0.857143,0.0267857
--0.00892857,-0.857143,0.0267857
--0.0446429,-0.857143,0.0178571
--0.015625,-0.25,0.0446429
--0.0175786,-0.25,0.046875
--0.0153464,-0.25,0.0535714
--0.0133929,-0.25,0.0535714
--0.015625,-0.46425,0.0803571
--0.0175786,-0.464286,0.0825893
--0.0153464,-0.464286,0.0892857
--0.0133929,-0.46425,0.0892857
--0.0446429,-0.678571,0.0357143
--0.0535714,-0.678571,0.0334821
--0.0535714,-0.678571,0.0513393
--0.0446429,-0.678571,0.0535714
--0.0446429,-0.857143,0.0178571
--0.0535714,-0.857143,0.015625
--0.0535714,-0.857143,0.0334821
--0.0446429,-0.857143,0.0357143
--0.0446429,-0.857143,0.0357143
--0.00892857,-0.857143,0.0446429
-0.00892857,-0.857143,0.0446429
-0.0446429,-0.857143,0.0357143
--0.0446429,-0.928571,0.0285714
--0.00892857,-0.928571,0.0375
-0.00892857,-0.928571,0.0375
-0.0446429,-0.928571,0.0285714
--0.0539286,-0.999643,0.0178571
-0.000357143,-0.999643,0.0178571
-0.0,-0.999643,0.0178571
-0.0535714,-0.999643,0.0178571
--0.000357143,-1,0.0178571
-0.000357143,-1,0.0178571
-0.0,-1,0.0178571
-0.0,-1,0.0178571
-0.0446429,-0.857143,0.0357143
-0.0535714,-0.857143,0.0334821
-0.0535714,-0.857143,0.015625
-0.0446429,-0.857143,0.0178571
-0.0446429,-0.928571,0.0285714
-0.0535714,-0.928571,0.0263393
-0.0535714,-0.928571,0.00848214
-0.0446429,-0.928571,0.0107143
-0.0535714,-0.999643,0.0178571
-0.0669643,-0.999643,0.0178571
-0.0673214,-0.999643,0.0
-0.0539286,-0.999643,0.0
-0.0,-1,0.0178571
-0.0,-1,0.0178571
-0.000357143,-1,0.0
-0.000357143,-1,0.0
-0.0446429,-0.857143,0.0178571
-0.00892857,-0.857143,0.0267857
--0.00892857,-0.857143,0.0267857
--0.0446429,-0.857143,0.0178571
-0.0446429,-0.928571,0.0107143
-0.00892857,-0.928571,0.0196429
--0.00892857,-0.928571,0.0196429
--0.0446429,-0.928571,0.0107143
-0.0539286,-0.999643,0.0
-0.000357143,-0.999643,0.0
--0.000357143,-0.999643,0.0
--0.0539286,-0.999643,0.0
-0.000357143,-1,0.0
-0.000357143,-1,0.0
--0.000357143,-1,0.0
--0.000357143,-1,0.0
--0.0446429,-0.857143,0.0178571
--0.0535714,-0.857143,0.015625
--0.0535714,-0.857143,0.0334821
--0.0446429,-0.857143,0.0357143
--0.0446429,-0.928571,0.0107143
--0.0535714,-0.928571,0.00848214
--0.0535714,-0.928571,0.0263393
--0.0446429,-0.928571,0.0285714
--0.0539286,-0.999643,0.0
--0.0673214,-0.999643,0.0
--0.0675,-0.999643,0.0178571
--0.0539286,-0.999643,0.0178571
--0.000357143,-1,0.0
--0.000357143,-1,0.0
--0.000535714,-1,0.0178571
--0.000357143,-1,0.0178571
-# reverse-patches
diff --git a/demos/quick3d/flickr3d/flickr3d.desktop b/demos/quick3d/flickr3d/flickr3d.desktop
deleted file mode 100644
index dc54c201..00000000
--- a/demos/quick3d/flickr3d/flickr3d.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=Flickr3D
-Icon=/usr/share/icons/hicolor/80x80/apps/qtquick3d.png
-Exec=/usr/bin/invoker --type=e -s /usr/bin/flickr3d -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_flickr3d
diff --git a/demos/quick3d/flickr3d/flickr3d.pro b/demos/quick3d/flickr3d/flickr3d.pro
deleted file mode 100644
index b4c84830..00000000
--- a/demos/quick3d/flickr3d/flickr3d.pro
+++ /dev/null
@@ -1,20 +0,0 @@
-TEMPLATE = app
-TARGET = flickr3d
-CONFIG += qt warn_on
-
-INSTALL_DIRS = qml
-CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg
-include(../../../pkg.pri)
-qtcAddDeployment()
-
-SOURCES += main.cpp
-
-OTHER_FILES += \
- flickr3d.rc \
- flickr3d.desktop
-
-RC_FILE = flickr3d.rc
-
-
-
-
diff --git a/demos/quick3d/flickr3d/flickr3d.rc b/demos/quick3d/flickr3d/flickr3d.rc
deleted file mode 100644
index 1b6228c9..00000000
--- a/demos/quick3d/flickr3d/flickr3d.rc
+++ /dev/null
@@ -1 +0,0 @@
-IDI_ICON1 ICON DISCARDABLE "qtquick3d.ico"
diff --git a/demos/quick3d/flickr3d/main.cpp b/demos/quick3d/flickr3d/main.cpp
deleted file mode 100644
index 7b01416b..00000000
--- a/demos/quick3d/flickr3d/main.cpp
+++ /dev/null
@@ -1,69 +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/QApplication>
-#include "qdeclarativeview3d.h"
-
-#include "../qmlres.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
-
- QDeclarativeView3D view;
- QString qml = q_get_qmldir(QLatin1String("qml/flickr3d.qml"));
- view.setSource(QUrl::fromLocalFile(qml));
-
-#ifdef Q_OS_SYMBIAN
- view.setAttribute(Qt::WA_LockLandscapeOrientation, true);
- view.setResizeMode(QDeclarativeView::SizeRootObjectToView);
- view.showFullScreen();
-#else
- if (QApplication::arguments().contains(QLatin1String("-maximize")))
- view.showMaximized();
- else if (QApplication::arguments().contains(QLatin1String("-fullscreen")))
- view.showFullScreen();
- else
- view.show();
-#endif
-
- return app.exec();
-}
diff --git a/demos/quick3d/flickr3d/qml/common/RssModel.qml b/demos/quick3d/flickr3d/qml/common/RssModel.qml
deleted file mode 100644
index 069918ec..00000000
--- a/demos/quick3d/flickr3d/qml/common/RssModel.qml
+++ /dev/null
@@ -1,66 +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 QtDeclarative 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
-
-XmlListModel {
- property string tags : ""
-
- function commasep(x)
- {
- return x.replace(' ',',');
- }
-
- source: "http://api.flickr.com/services/feeds/photos_public.gne?"+(tags ? "tags="+commasep(tags)+"&" : "")+"format=rss2"
- query: "/rss/channel/item"
- namespaceDeclarations: "declare namespace media=\"http://search.yahoo.com/mrss/\";"
-
- XmlRole { name: "title"; query: "title/string()" }
- XmlRole { name: "imagePath"; query: "media:thumbnail/@url/string()" }
- XmlRole { name: "url"; query: "media:content/@url/string()" }
- XmlRole { name: "description"; query: "description/string()" }
- XmlRole { name: "tags"; query: "media:category/string()" }
- XmlRole { name: "photoWidth"; query: "media:content/@width/string()" }
- XmlRole { name: "photoHeight"; query: "media:content/@height/string()" }
- XmlRole { name: "photoType"; query: "media:content/@type/string()" }
- XmlRole { name: "photoAuthor"; query: "author/string()" }
- XmlRole { name: "photoDate"; query: "pubDate/string()" }
-}
diff --git a/demos/quick3d/flickr3d/qml/common/qmldir b/demos/quick3d/flickr3d/qml/common/qmldir
deleted file mode 100644
index adc2479b..00000000
--- a/demos/quick3d/flickr3d/qml/common/qmldir
+++ /dev/null
@@ -1,10 +0,0 @@
-ImageDetails ImageDetails.qml
-LikeOMeter LikeOMeter.qml
-Loading Loading.qml
-MediaButton MediaButton.qml
-MediaLineEdit MediaLineEdit.qml
-Progress Progress.qml
-RssModel RssModel.qml
-ScrollBar ScrollBar.qml
-Slider Slider.qml
-Star Star.qml
diff --git a/demos/quick3d/flickr3d/qml/flickr3d.qml b/demos/quick3d/flickr3d/qml/flickr3d.qml
deleted file mode 100644
index e50861c2..00000000
--- a/demos/quick3d/flickr3d/qml/flickr3d.qml
+++ /dev/null
@@ -1,113 +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 1.0
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-import "common" as Common
-
-Viewport {
- width: 1024
- height: 768
-
- camera: Camera {
- id: cam
- property real viewAngle: 0.0
- eye: Qt.vector3d(Math.sin(cam.viewAngle) * 20.0, 3.0, Math.cos(cam.viewAngle) * 20.0)
- }
-
- NumberAnimation {
- running: true
- target: cam; property: "viewAngle";
- from: 0.0; to: 360.0; duration: 2000000;
- loops: Animation.Infinite
- }
-
- Skybox {
- source: "skybox"
- }
-
- Common.RssModel { id: rssModel }
-
- Item3D {
- transform: [
- Rotation3D { axis: Qt.vector3d(1, 0, 0); angle: 90 },
- Translation3D { translate: Qt.vector3d(0, 1, 0) }
- ]
-
- Cylinder {
- levelOfDetail: 1
- length: 2.0
- radius: 2.8
- effect: Effect {
- color: "#ccccdd"
- }
- }
-
- }
-
- Component {
- id: octoDisplayDelegate
- Item3D {
- transform: [
- Translation3D { translate: Qt.vector3d(0, 0, 2.6) },
- // index is a special variable that comes from model instancing
- Rotation3D { axis: Qt.vector3d(0, 1, 0); angle: (360 / 16) * (index * 2 + 1) }
- ]
- Item3D {
- enabled: index > -1 && index < 9
- transform: [
- Rotation3D { axis: Qt.vector3d(1, 0, 0); angle: 90 }
- ]
- Quad {
- effect: Effect {
- texture: model.imagePath
- }
- }
- }
- }
- }
-
- Repeater {
- delegate: octoDisplayDelegate
- model: rssModel
- }
-
-}
diff --git a/demos/quick3d/flickr3d/qml/skybox/default_sky_down.png b/demos/quick3d/flickr3d/qml/skybox/default_sky_down.png
deleted file mode 100644
index 685c28c4..00000000
--- a/demos/quick3d/flickr3d/qml/skybox/default_sky_down.png
+++ /dev/null
Binary files differ
diff --git a/demos/quick3d/flickr3d/qml/skybox/default_sky_east.png b/demos/quick3d/flickr3d/qml/skybox/default_sky_east.png
deleted file mode 100644
index f6463abf..00000000
--- a/demos/quick3d/flickr3d/qml/skybox/default_sky_east.png
+++ /dev/null
Binary files differ
diff --git a/demos/quick3d/flickr3d/qml/skybox/default_sky_north.png b/demos/quick3d/flickr3d/qml/skybox/default_sky_north.png
deleted file mode 100644
index 153b833c..00000000
--- a/demos/quick3d/flickr3d/qml/skybox/default_sky_north.png
+++ /dev/null
Binary files differ
diff --git a/demos/quick3d/flickr3d/qml/skybox/default_sky_south.png b/demos/quick3d/flickr3d/qml/skybox/default_sky_south.png
deleted file mode 100644
index b3b01321..00000000
--- a/demos/quick3d/flickr3d/qml/skybox/default_sky_south.png
+++ /dev/null
Binary files differ
diff --git a/demos/quick3d/flickr3d/qml/skybox/default_sky_up.png b/demos/quick3d/flickr3d/qml/skybox/default_sky_up.png
deleted file mode 100644
index 3d4d6233..00000000
--- a/demos/quick3d/flickr3d/qml/skybox/default_sky_up.png
+++ /dev/null
Binary files differ
diff --git a/demos/quick3d/flickr3d/qml/skybox/default_sky_west.png b/demos/quick3d/flickr3d/qml/skybox/default_sky_west.png
deleted file mode 100644
index 14325371..00000000
--- a/demos/quick3d/flickr3d/qml/skybox/default_sky_west.png
+++ /dev/null
Binary files differ
diff --git a/demos/quick3d/flickr3d/qtquick3d.ico b/demos/quick3d/flickr3d/qtquick3d.ico
deleted file mode 100644
index c695ac72..00000000
--- a/demos/quick3d/flickr3d/qtquick3d.ico
+++ /dev/null
Binary files differ
diff --git a/demos/quick3d/model_viewer/main.cpp b/demos/quick3d/model_viewer/main.cpp
deleted file mode 100644
index 127be272..00000000
--- a/demos/quick3d/model_viewer/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/QApplication>
-#include "qdeclarativeview3d.h"
-
-#include "../qmlres.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
- QDeclarativeView3D view;
- QString qml = q_get_qmldir(QLatin1String("qml/model_viewer.qml"));
- view.setSource(QUrl::fromLocalFile(qml));
-
-#ifdef Q_OS_SYMBIAN
- view.setAttribute(Qt::WA_LockLandscapeOrientation, true);
- view.setResizeMode(QDeclarativeView::SizeRootObjectToView);
- view.showFullScreen();
-#else
- if (QApplication::arguments().contains(QLatin1String("-maximize")))
- view.showMaximized();
- else if (QApplication::arguments().contains(QLatin1String("-fullscreen")))
- view.showFullScreen();
- else
- view.show();
-#endif
-
- return app.exec();
-}
diff --git a/demos/quick3d/model_viewer/model_viewer.desktop b/demos/quick3d/model_viewer/model_viewer.desktop
deleted file mode 100644
index 79350595..00000000
--- a/demos/quick3d/model_viewer/model_viewer.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=Model Viewer
-Icon=/usr/share/icons/hicolor/80x80/apps/qtquick3d.png
-Exec=/usr/bin/invoker --type=e -s /usr/bin/model_viewer -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_model_viewer
diff --git a/demos/quick3d/model_viewer/model_viewer.pro b/demos/quick3d/model_viewer/model_viewer.pro
deleted file mode 100644
index 2163c4f0..00000000
--- a/demos/quick3d/model_viewer/model_viewer.pro
+++ /dev/null
@@ -1,25 +0,0 @@
-TEMPLATE = app
-TARGET = model_viewer
-CONFIG += qt warn_on
-
-INSTALL_DIRS = qml
-CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg
-include(../../../pkg.pri)
-qtcAddDeployment()
-
-SOURCES += main.cpp
-
-symbian {
- qmlDeployment2.sources = qml\meshes\*
- qmlDeployment2.path = qml\meshes
- DEPLOYMENT += qmlDeployment2
- qmlDeployment3.sources = qml\images\*
- qmlDeployment3.path = qml\images
- DEPLOYMENT += qmlDeployment3
-}
-
-OTHER_FILES += \
- model_viewer.rc \
- model_viewer.desktop
-
-RC_FILE = model_viewer.rc
diff --git a/demos/quick3d/model_viewer/model_viewer.rc b/demos/quick3d/model_viewer/model_viewer.rc
deleted file mode 100644
index 1b6228c9..00000000
--- a/demos/quick3d/model_viewer/model_viewer.rc
+++ /dev/null
@@ -1 +0,0 @@
-IDI_ICON1 ICON DISCARDABLE "qtquick3d.ico"
diff --git a/demos/quick3d/model_viewer/qml/FourButtons.qml b/demos/quick3d/model_viewer/qml/FourButtons.qml
deleted file mode 100644
index 80d72313..00000000
--- a/demos/quick3d/model_viewer/qml/FourButtons.qml
+++ /dev/null
@@ -1,74 +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 1.0
-
-Item {
-
- anchors.left : parent.left
- anchors.leftMargin: 40
- width: 750
- height: 51
-
-
- ShortButton {
- id: button1
- //anchors.left:
- //anchors.verticalCenter: parent.verticalCenter
- }
- ShortButton {
- id: button2
- anchors.left: button1.right
- //anchors.leftMargin: 3
- //anchors.verticalCenter: parent.verticalCenter
- }
- ShortButton {
- id: button3
- anchors.left: button2.right
- //anchors.leftMargin: 3
- //anchors.verticalCenter: parent.verticalCenter
- }
- ShortButton {
- id: button4
- anchors.left: button3.right
- //anchors.leftMargin: 3
- //anchors.verticalCenter: parent.verticalCenter
- }
-}
diff --git a/demos/quick3d/model_viewer/qml/LongButton.qml b/demos/quick3d/model_viewer/qml/LongButton.qml
deleted file mode 100644
index fd7b223c..00000000
--- a/demos/quick3d/model_viewer/qml/LongButton.qml
+++ /dev/null
@@ -1,69 +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 1.0
-
-Rectangle {
- id: button
- anchors.left : parent.left
- anchors.leftMargin: 40
- gradient: Gradient {
- GradientStop { position: 1.0; color: "black" }
- GradientStop { position: 0.0; color: "gray" }
- }
- border.color : "gray"
- border.width : 1
- radius: 10
- width: 610
- height: 51
- property bool bounce: false
-
- MouseArea {
- anchors.fill: parent
- onClicked: { button.bounce = true; console.log("Clicked") }
- }
-
- SequentialAnimation on scale{
- running: button.bounce
- NumberAnimation { to : 0.98; duration: 300; easing.type: "OutQuad" }
- NumberAnimation { to : 1.0; duration: 300; easing.type: "OutBounce" }
- onCompleted: button.bounce = false
- }
-}
diff --git a/demos/quick3d/model_viewer/qml/MainButton.qml b/demos/quick3d/model_viewer/qml/MainButton.qml
deleted file mode 100644
index 0869b570..00000000
--- a/demos/quick3d/model_viewer/qml/MainButton.qml
+++ /dev/null
@@ -1,66 +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 1.0
-import Qt3D 1.0
-
-Image {
- id: mainbutton
-
- source: imageSource
-
- width: 100
- height: 100
- property bool bounce: false
- property string imageSource: "images/cog.svg"
-
- anchors.right: parent.right
- anchors.rightMargin: 10
- anchors.topMargin: 20
-
-
- SequentialAnimation on scale{
- running: mainbutton.bounce
- NumberAnimation { to : 0.8; duration: 50; easing.type: "OutQuad" }
- NumberAnimation { to : 1.0; duration: 50; easing.type: "OutBounce" }
-
- onCompleted: mainbutton.bounce = false
- }
-}
diff --git a/demos/quick3d/model_viewer/qml/ShortButton.qml b/demos/quick3d/model_viewer/qml/ShortButton.qml
deleted file mode 100644
index eb8ea4fb..00000000
--- a/demos/quick3d/model_viewer/qml/ShortButton.qml
+++ /dev/null
@@ -1,71 +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 1.0
-
-Rectangle {
- id: button
-
- gradient: Gradient {
- GradientStop { position: 1.0; color: "black" }
- GradientStop { position: 0.0; color: "gray" }
- }
- border.color : "gray"
- border.width : 1
- radius: 10
- width: 150
- height: 51
- property bool bounce: false
-
- MouseArea {
- anchors.fill: parent
- onClicked: { button.bounce = true; console.log("Clicked") }
- }
-
- SequentialAnimation on scale{
- running: button.bounce
- NumberAnimation { to : 0.98; duration: 300; easing.type: "OutQuad" }
- NumberAnimation { to : 1.0; duration: 300; easing.type: "OutBounce" }
-
- onCompleted: button.bounce = false
- }
-
- anchors.leftMargin: 3
-}
diff --git a/demos/quick3d/model_viewer/qml/images/arrow.png b/demos/quick3d/model_viewer/qml/images/arrow.png
deleted file mode 100644
index 0ea53c17..00000000
--- a/demos/quick3d/model_viewer/qml/images/arrow.png
+++ /dev/null
Binary files differ
diff --git a/demos/quick3d/model_viewer/qml/images/arrow.svg b/demos/quick3d/model_viewer/qml/images/arrow.svg
deleted file mode 100644
index 6665e81d..00000000
--- a/demos/quick3d/model_viewer/qml/images/arrow.svg
+++ /dev/null
@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="100"
- height="100"
- id="svg2"
- version="1.1"
- inkscape:version="0.47+devel r9541"
- sodipodi:docname="arrow.svg">
- <defs
- id="defs4" />
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="1.979899"
- inkscape:cx="36.315176"
- inkscape:cy="49.177003"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- showgrid="false"
- inkscape:window-width="1348"
- inkscape:window-height="684"
- inkscape:window-x="177"
- inkscape:window-y="346"
- inkscape:window-maximized="0" />
- <metadata
- id="metadata7">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title />
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="Layer 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(0,-952.36218)">
- <rect
- style="opacity:0.2;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- id="rect2993"
- width="100"
- height="100"
- x="0.16797371"
- y="952.60327"
- rx="15"
- ry="15" />
- <image
- y="970.86469"
- x="14.027932"
- id="image4316"
- xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAE0AAABACAYAAABfl/puAAAABHNCSVQICAgIfAhkiAAABMxJREFU eJzt3E9MI1UcB/DvvE63zBRIydRiCIfFg1E5cMAQEmLyAuUABAH/nMzqxWyiiXL1oKd116PJHoye PKmHNcsfkWAo8kw8woUEVAIMB08wBFYYbDvlPQ9QRISWTqfTfW2/pzm89+aXT3+vM520DUCyDAwM vNja2hra3t4+LFcNpFwndhNKaVhRlO/C4fAPlNLnylWHVGg4rddwHKcjHA5/Xy442dAAAN3d3cQw jBfKBSclWlNTE8bGxrRywUmJBvwP7hGl9Fm/zi0tGnAKNzIyomma9lJ9ff3nlNIGP84rNRoAGIaB oaGhukAg8Go4HP7CDzjp0QCgra0No6Ojuqqqr/kBVxFogL9wFYMG+AcnG1o9gDpd168d4AecbGjP cM71SCSSc1Cp4WRDu3FKCVexaEDp4CoaDSgNXMWjAf/CEUJeb2ho+IhSGihmvapAA07hent76xzH Gdc07cNi4KoGDQA6OjqUvr4+TQhxrxg4FQAopbcBNHpZYInyvBBCcTuZEILOzk4CQFtYWLinaRoo pQ8ZYyeFrKNSSm/ruv4r57zJbTE+hhBCQoeHh2hubna7QNFwKoBGznnT8PCwHo1GXRXiVyzLgmEY aG5uhhACiuKu6YqFU7MH0WjU9avnV2Kx2PmxW7BsioGrqgvB5WThCr04VDUa4A6u6tGAwuFqaGe5 DKfr+t1rx/pZ2NOeLFxPT48mhPg0Ho/Hrxznd2FPewgh6OrqIu3t7Q3BYPCbq+CkQ3McB0KIkp4j FAqhv78/2N7e3nQVnHRowWCw6Hu0myQXnHRofuY6uBpanoRCIcTj8aBhGJFAIPAZpTSs5p9W3eGc Y2VlJbmzs5PMZDJfAziudVqOcM6xtLSUTCQSyUwm8zHn/CvGmKh12jVxHAdLS0upxcXFLNiX2Q/z NbQrkkqlMD8/76ysrNiZTOaTsw47f/pRQ7uULNjq6uo+5/wO53yeMfafG8Ma2oVcBHMc561EIpG4 alztQnCWm4IBtU4DcAo2Nzf3ZG1t7fjk5OTtXGBADe0cbHV19TCdTr/DGPs535yq3p5uwADJOo1z DkK8eZ0PDg6QSCQO19fXCwIDLqBZluVJMaWMZVloaWlBvu+n5cv+/j4mJib+3tnZ+TOdTr/HGPul kPkqgL8URfljbm6uAUBpH1QVnwjn3BgfHye3bt1ytUAWbG9v7/dkMvkGY2yr0DVUxtg2pfQVSPD+ pmnau7quPxBC1LmZfxHMtm1XYMDZ9mSM2W4m+53BwcGk2weQXoEBEnSXF/ESDKgCNK/BAMluOQrN 3t4epqamPAUDKhjNNE3Mzs6mj4+Pf7Nt+02vwADJtichpFFVVZHvYmCaJqanpx3O+U+2bQ95CQZI 1mmKorwci8XUXPdoWbBAIDBrWdYdxpjnfxAgVacBCObqMj/AAPnQro1pmpiamkoSQn4sJRgg2fa8 LqZpYnJy8jiTyTw+ODh4v5RgQAV02kUw27ZLDgZI3Gmcc2xubmJmZsZXMEBSNM45lpeXwRhLKYry yLbtD/wCAyTcnkIILC8vY3FxMaVp2v2jo6O7foIBEnba1taWurGxkdJ1/b5lWQ8K/bWJF5Gq04QQ IpVKnZQTDJCs0zjnDyORyLe7u7uPywUGAP8AGpq/aU97o64AAAAASUVORK5CYII= "
- height="64"
- width="77"
- style="opacity:0.75" />
- </g>
-</svg>
diff --git a/demos/quick3d/model_viewer/qml/images/cog.svg b/demos/quick3d/model_viewer/qml/images/cog.svg
deleted file mode 100644
index e8a993d3..00000000
--- a/demos/quick3d/model_viewer/qml/images/cog.svg
+++ /dev/null
@@ -1,127 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="100"
- height="100"
- id="svg2"
- version="1.1"
- inkscape:version="0.47+devel r9541"
- sodipodi:docname="cog.svg">
- <defs
- id="defs4">
- <filter
- id="filter6134"
- inkscape:label="Jam spread"
- inkscape:menu="Textures"
- inkscape:menu-tooltip="Glossy clumpy jam spread"
- color-interpolation-filters="sRGB">
- <feGaussianBlur
- id="feGaussianBlur6136"
- stdDeviation="1"
- in="SourceGraphic"
- result="result0" />
- <feTurbulence
- id="feTurbulence6138"
- result="result1"
- numOctaves="7"
- seed="488"
- baseFrequency="0.017"
- type="turbulence" />
- <feComposite
- id="feComposite6140"
- in2="result1"
- in="result0"
- operator="out"
- result="result2" />
- <feGaussianBlur
- id="feGaussianBlur6142"
- stdDeviation="0.5"
- result="result5" />
- <feSpecularLighting
- id="feSpecularLighting6144"
- in="result5"
- specularExponent="100"
- specularConstant="4"
- result="result4"
- surfaceScale="1.5">
- <feDistantLight
- id="feDistantLight6146"
- azimuth="225"
- elevation="62" />
- </feSpecularLighting>
- <feComposite
- id="feComposite6148"
- in2="result2"
- operator="atop"
- in="result4"
- result="result91" />
- <feBlend
- id="feBlend6150"
- in2="result91"
- mode="multiply" />
- </filter>
- </defs>
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="1.979899"
- inkscape:cx="-21.768595"
- inkscape:cy="49.177003"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- showgrid="false"
- inkscape:window-width="1118"
- inkscape:window-height="684"
- inkscape:window-x="243"
- inkscape:window-y="161"
- inkscape:window-maximized="0" />
- <metadata
- id="metadata7">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title />
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="Layer 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(0,-952.36218)"
- style="opacity:0.75">
- <rect
- style="opacity:0.20000000000000001;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- id="rect2993"
- width="100"
- height="100"
- x="0.16797371"
- y="952.60327"
- rx="15"
- ry="15" />
- <image
- y="955.81396"
- x="2.9568648"
- id="image4099"
- xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFUAAABUCAYAAADzqXv/AAAABHNCSVQICAgIfAhkiAAAEntJREFU eJztnHtQXNd9x3/3uffuAxYWxGO1vIQMCJCQJeSxJUdHGFUeYtmRWtuJx27cjJPGU09n2k5mmubR R/qYdjKdZlwncdukzUPJpHY0tWrZxgjp2g56CwmQhNaS4IJAsOJxYXfv3r2vc/qHICWWxF7QLkgZ Pn/xx+/c89sv957zO7/zOwdghRVWWGGFFVZYYYUVVlhhhRXuGajldsApCCEKAMoAwOfAPCpJkpxR h+aBXa6OF8EGQRBaAcDrwLYPIfQpSZKUTDt1O+4bUUVR3CEIgm/v3r0iz/N3tJuYmIADBw6UA8Ba ADi5ZA7O4b4QFSFE0TTdVFxcTK9evRoo6s6jls/nA0EQaIqiNsEyiUovR6eLwIcxristLeXnExQA QBAEyMvLo2ia3rpEvt3C/SJqCGMcyM/PTzmx0jQNpaWlPMa4ESHkZFJLO/e8qAihQrfb/XlBENi8 vDxHbUKhEI0xXs3z/JMIoawMu3gLSxZSPfXUU4/QNO1RFOUDSZKM+WwRQjzDMPWiKH6BoqgnsrOz s7Zu3ZpVXV1Np/r8AQBM04RTp04ZnZ2dCV3Xr2OMf6Kq6psAcFWSJJKi76y8vLxdmqadOXjwYN/C fuVNlkTUPXv2PGGa5k8IIQLP863RaPRr7e3tFz5phxDK4Xm+SRCElwkhG4PBILdlyxZvMBikXC7X gvuNx+PQ399vnTp1KjExMaHRNN2hquqrGOOTkiQlPtE3I4riDp7nv22a5jqe5/sMw9j9zjvvXF5o vxkXdVbQmpqa7HXr1lHHjx9PDg0NqTRNfycWi/0rAMQAoMrn8z1n2/bnBEHIra6uFhoaGlx5eXlA 03c/QpmmCcPDw9DZ2ZmQZdmwbbsPAH6oquoBABgCgPKsrKy/tG37M3V1de5169axR44csaempq4s RtiMiYoQovx+/27Lsn5UU1OT3dzcTLlcLjBNE7q7u0lHR4eWTCb7CSHjAFAfCARcDz74oFhZWUln ZWVmGCSEwNjYGITDYfPs2bOGpmlRQkgXTdP1gUAgd/v27WJFRQXQNA2KosBbb71lT01NXVFV9dm2 trYup/1kRFSEEEPT9B/yPP8P9fX1vllB56IoCpw5c0bXNM2ura11B4NBWMwnvlhmhgZy5cqVRHFx sbB+/XpGFMVbfHz77bfNoaGhUV3XX5Qk6bCTZ6dd1BlBv8yy7N/u2LFD3Lx5s4vjuHR3s2Romgbv v//+9IULF2KGYXzeibBMOh2YK2hzc7OwZcsWgWXvi0XbHeE4DsrLy4VoNEomJydbQqFQlyzL/fO1 SauoFRUVuxiG+X5zc7OrsbFRSMckcy/AsiyUl5cLiqLA5OTk75SUlLwly/LUnezT/atVmqYpj8fj +m0RdBaO48DtdossyxIASM5nm9ZfjjE+yjDMj48cOZKYmJhI56Nvi2VZoOs6YIwz3tfVq1ehq6vL sG3765Ikjc5nm4mJqtDj8bSWlJRU7927l0/XJGVZFsRiMVAUJXH9+vXpSCTiUhSFTyaTrM/nM7Kz s82ioiKjuLg4z+/3cx6PJy0xLsDNKGDfvn3JZDL53/F4/IupVoQZCamam5u3siz7zs6dO32bNm1a dB+EEFAUBWRZNnt6esx4PD4Zi8VipmmO0TR9muO4KzN2rGma6wkhDYIgeL1eb1YgEPDX19e7QqEQ 4/U6yWvfHtu24eDBg1Y4HO5TVXV7qrcUIEP5VMuyjoqi+GZnZ+fz9fX1/HxJ5TuhKAocP37c6Onp sWzbjrhcrv9KJpOvG4aRAACzvb39lnENIeRRVZXWdT3HNM0vyrL8giAIeY2NjUJDQ8MtcagTpqam 4NKlS7Zt299yIihA5pLUIgBsCgaDzEI/f9u24eLFi1p7e7umaZqCMf5n0zTfam1tHU7VVpIkdebP GAB8AyH0fdu2Xzp8+PAr58+fJ48//nhg9erVjpIys3i9XsjJyYFYLLYNAH7qpE1aQ6pZHnjggUcp inqlqanJ5ff7HbfTdR3ef/99vaOjI6qq6g8sy3r58OHDh2VZji3GD1mWY6FQ6EOM8UFN0/LC4XA5 z/NMUVER41RYlmXBsixGluXiYDD4Cye+pF1UhBDldru/XVxcXPXII4+wTieLqakpeO+992JXrlwJ m6b5jG3b+yRJit6tP7IsgyzLYyUlJe9SFHV+cHAQYYxdhYWFrNOFic/no7q6uliWZa9dvnz5VCr7 tItaVlZWyTDM32/bts1bWFjoqM1M8sIaGBiIaJr2mcOHD1+QZTmtfsmybF+9ejVcUlIyMjg4+JSm aUxpaSnlRFiXywWKolBjY2PFwWDwp7Ism/PZpz1C9/l8z7ndbrG8vNyRvWma0NbWZo+MjERt2/6i JEkfp9unudi2/QbHcX9x9uxZ6/Tp04SQeXPWAABAURTU1dWxGOMqmqa3pLJP99o/h2XZ7zU2NgbW rl3raNA6d+4cOXnypEkI+bNDhw69mU5/bocsy2T16tWdPM+vHhoaqi0tLWWzs7NTtvN6vTA4OIgN w8gtLi5+Y74vKa1vKs/zTRRFFVZVVTl67tjYGHz44Ycmx3E/M03zR+n0ZT4kSTKSyeTXAaD3yJEj lq7rKdswDAPr168XLMvaAQBr5rNNm6gIIZ7n+S+VlZUxTjfozp07Z+u6fiORSHwj1Sol3UiSNEoI +crQ0JDV3z9v0unXlJeXg9vtFkRRfGY+u3S+qXWmaT68adMm3smMH4/Hobe3NwkA35UkKWUMmgk0 TfuQZVnp4sWLCSdjq9frhYaGBh4AvoAQyrmT3aKC/5liMS8A5NE0XSgIQj1N07/n9/vpYDDo6BnX rl0jyWRyIplM/ngxPqQDSZKMpqamf5Rl+SFFUdy5ubkp21RVVTEnTpwo8nq9f9fS0nI8kUj0AMAo 3CyKUwEWISpCKN/tdv8LADxi27afYRhOFEUmEAjAtm3bBKdbIuFwOMqy7C+W6y2dBWN8lKKoK0ND Qxtzc3NT6pGfnw87d+4Uz5w582IsFntxJnzQaJqefPLJJw9Go9GvLeZNLbIsa8/WrVuFwsJCKhAI gM/nA47jHGeFdF2HoaGhZDwe/9Ui+k8rkiQZu3bt6ujr6ytbv359fip7iqJgw4YNVG1trWgYBkSj URgfH3dPTEzkHj169EsA8INFff40TZPq6mqqoKBgMc0hFotBLBajMcaLKlZIN7qunx0ZGfmsZVng dJXFsiywLAtutxsKCwshEolQx44dAwBYnvT8xMQEMAyjA8DIcvR/Gz5WVVWMxRaVYriFZRFVURTD tu0pSLEtsYTEDcMAVVVTWzpgWUSNRCIUx3H9c1J1y80ITdNp2wJaFlEZhiGEEH4mNLsX4AkhDMOk Z9W+LKIWFhYS0zTLwVn9/lKQTwgRAoFAWh62LKIGAgEXTdMeuHdEzRMEAd/NXtZclkVUv98PFEVx AOAs4ZphKIqqzM7OTng8nkU/Y+42+WLiVGzbNtXe3m7k5+fTRUVFbCAQAK/XC16vd95DDrP4fD7w +/2UaZo1AHB2ET6kFVEUHy4uLhadLl4wxjA9PQ2qqsLY2Bhcv37dHh8fxxhjAgDGYkTto2n6T65f v/7Y8PBwZWdnZxEA+HiexwghcePGjSmfybIslJWVuROJRAtC6OepqpszCUIoi+O4hysqKhxtptm2 DW1tbdr58+ftGRGjDMMMAkAfx3H7DcO4vGBRZyqQXweA1xFCAgB4AKAIY/zcRx999Mdr165lnYxN VVVVnnPnzu0CgHUAcEtV9VLB8/xuhmEKg8Ggo0hkeHgYzp07Z+m6/mVCSCcAXAeAhCRJ1qzNXcUQ sixbsixrsizfCIVCA4SQF/Pz88WCgoKUDoqiCOFwGGzbdgeDwbfTvSflBIRQlsvl+vfa2tridevW pdSCEAIdHR3G+Pj4RdM0/1ySpBFZlnVZln+j7iidE9VVjuMOnj59WjfNeffFAODmZtqGDRtE27af YRhmQxr9cIzX633atu11NTU1jqo9FEWB3t5emxDy2ifPDMwlbaJKkkRUVf2PGzdu2CMjzpb0tbW1 VCAQEHmef3W+pG8mQAjVm6b5rbq6OtZpDvjy5csEYzyhadp789mlu+rvDE3T4fPnz1tOM+lNTU08 xniLy+X6JkIoI8UdnwQhlCOK4ms+ny9327ZttJOVlK7r0NXVpVEU9Vaq8p+0iipJUoKiqNd6e3st RXF2gLmiogIaGxs5jPHLLpfrjzK9dEUI+dxu93ds2354x44drpwcZx9If38/TE5OWqqqfi+VbdqD /3g8/o5t2+OXL192FCbRNA2PPvoo1dDQwAHAX7EsuzPdPs2CEGJcLtefWpb19M6dO9mamhpH7TDG 0NPTY7AsexQAwqns0/65ybIcr6qqqpyenl5fV1fnqLRmpvyb4nmeHh0d3VVZWakEg8Grsiyn3jt2 CEKo0Ov1fpXn+Zf37Nnjra2tpZwG+2NjY/DBBx8Ypml+43aH6j5JRsawUCg0aBjGHxQUFLicblcz DAPBYJB1u92egYEBRAhpKikp6S8rKxuRZdlerC8IIXd5efnvulyu72dlZe3cvXt3zpo1axZU+Xfs 2DEciUT6NU37qpN/dEZELS0tnXS73SiZTIZqamocV9hRFAVFRUXUmjVrXIqi5Eaj0ec5jtscCoVG FiouQoivqKh4VBTF12iafmXjxo05u3fvzlq1atWCxux4PA5tbW06IeS11tbWNidtMlWfShNCtEQi QTDGCy4TLygooJ5++umscDhMTp48+djY2Nh2nuc7n3jiiZ/F4/EzADAFAOMAYEqSlJxZ2fEAUAwA fq/Xu5nn+WdM06wPhUKuLVu2iCUlJYsqVzdNEwzDoDDGjncpMjLTtrS0vAAAr+/du1esrKy8q2eZ pgnj4+Nw9epVs7e3V52enk5algUURcUJIZMcx42YpllEUVQOxtgviqIdCASE2tpab1lZGev3+++q 9n9mFYU7OjomDcN4rL29vTtVm0wcpKgXRbH1wQcfXPXYY48x6Tz6Y1kWaJoGiUQCpqambFVVf710 8/v9nNfrZbxeLwiCkLZDFAA3T/29+eab+ujoaKeqqp9OdeFNWkVFCLndbvf+VatWferZZ58VF1Nj f68SiURg3759CdM0/0nTtL+ZL7OW1jiVYZhmy7I+tX379t8qQQEACgoK4KGHHhIwxq/Azfux7kha RbVtexgAJrq7u6edlCfeTyiKAhcuXJgmhIQBID6fbVpDKlmWR0KhUNfk5GRLNBol5eXl9/2BX4Cb gr7xxhvK+Pj4JcMwXkhV/5WJFVX/rLCTk5N0cXExLwjCbW11XQdd12Ex56zSASEEpqengWEYuFNS JRKJwP79+2cFfV6SpJSlShkJ/meE7UwkEs2Dg4NZpaWl9Nwx1rZt6OvrgwMHDqgnT560DMMAURQZ t9vtaI/rbrFtG4aGhqCjo0NvbW21hoeHrby8PNbj8fxG//39/bB//34jFoud1XX9950ICpAhUQEA ZFkeqKysfNc0zccHBgZyZoVVFAUOHTpkffTRR2oymdyv6/rbw8PDBT09PWIkEsGiKHIej+eOb87d oGkahMNhcujQocSxY8eSY2NjpwzDeF3TNHd3d3cBIYTOz8+nOY6D/v5+OHDggMkwzLvRaPSzkiQ5 rvvK+GvR0tKyluf5//X7/ZVr166lOzs7E6ZpXjZN8yuaph2RJMme3XwTBOFLGOOteXl5ns2bN4vl 5eV3da4U4P/Pt166dMno7OzUNU1TKIp6W9O0H9q23SNJkoEQcnu93s8RQr6Zm5ubX1tbK544ccJk GOad8fHxFyRJWlDl2pKU3bS0tKwVBOHnGON8Qsir09PT/3a7g2czudQ1Pp/vOYzxCy6XK7+hoUGo rq525efnL2hosG0bhoeHobu7O/7xxx+bGOM+Qsh/qqr6P3eaaBBCwZycnL8mhHya47hfjY2NfWGh ggIs4WVfM+tzxmlR2pw7qr4MAOsbGhqyEEKObrtQVRUOHjwYGxwcjDIMI8Visdcxxmfm21ea0+9s 6b02d4d0IdwrBWJ3BCHEsiz7vMvl+u5LL70kOsnUh8Nh2L9//7Su680AcGap6wru+Ts5JEmyLMv6 wLIs/caNG47aDA4OWizL9gHA+eUo1LjnRZ3hBsMwkRs3bqS818OyLLh27ZrNMMwJSZKWpaj4vhBV kiSVpunOgYEBK9V9KZqmwdTUFLEs69gSuXcL980aEmPcHolE9g4ODsJ8yZrR0VEwDMNOJpNnltC9 3+C+ETWRSEhut7v3l7/8pRcA7jhOEkJYhmF6AMDZ2cgMcM/P/nNBCHnA2ZBlLtd4ukKG+D+bIIXx sc8FnQAAAABJRU5ErkJggg== "
- height="84"
- width="85"
- style="opacity:0.75000000000000000;filter:url(#filter6134)" />
- </g>
-</svg>
diff --git a/demos/quick3d/model_viewer/qml/images/cog2.svg b/demos/quick3d/model_viewer/qml/images/cog2.svg
deleted file mode 100644
index 21f25d95..00000000
--- a/demos/quick3d/model_viewer/qml/images/cog2.svg
+++ /dev/null
@@ -1,126 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="100"
- height="100"
- id="svg2"
- version="1.1"
- inkscape:version="0.47+devel r9541"
- sodipodi:docname="cog.svg">
- <defs
- id="defs4">
- <filter
- id="filter6134"
- inkscape:label="Jam spread"
- inkscape:menu="Textures"
- inkscape:menu-tooltip="Glossy clumpy jam spread"
- color-interpolation-filters="sRGB">
- <feGaussianBlur
- id="feGaussianBlur6136"
- stdDeviation="1"
- in="SourceGraphic"
- result="result0" />
- <feTurbulence
- id="feTurbulence6138"
- result="result1"
- numOctaves="7"
- seed="488"
- baseFrequency="0.017"
- type="turbulence" />
- <feComposite
- id="feComposite6140"
- in2="result1"
- in="result0"
- operator="out"
- result="result2" />
- <feGaussianBlur
- id="feGaussianBlur6142"
- stdDeviation="0.5"
- result="result5" />
- <feSpecularLighting
- id="feSpecularLighting6144"
- in="result5"
- specularExponent="100"
- specularConstant="4"
- result="result4"
- surfaceScale="1.5">
- <feDistantLight
- id="feDistantLight6146"
- azimuth="225"
- elevation="62" />
- </feSpecularLighting>
- <feComposite
- id="feComposite6148"
- in2="result2"
- operator="atop"
- in="result4"
- result="result91" />
- <feBlend
- id="feBlend6150"
- in2="result91"
- mode="multiply" />
- </filter>
- </defs>
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="1.979899"
- inkscape:cx="36.315176"
- inkscape:cy="49.177003"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- showgrid="false"
- inkscape:window-width="1118"
- inkscape:window-height="684"
- inkscape:window-x="310"
- inkscape:window-y="375"
- inkscape:window-maximized="0" />
- <metadata
- id="metadata7">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="Layer 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(0,-952.36218)">
- <rect
- style="opacity:0.2;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- id="rect2993"
- width="100"
- height="100"
- x="0.16797371"
- y="952.60327"
- rx="15"
- ry="15" />
- <image
- y="955.81396"
- x="2.9568648"
- id="image4099"
- xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFUAAABUCAYAAADzqXv/AAAABHNCSVQICAgIfAhkiAAAEntJREFU eJztnHtQXNd9x3/3uffuAxYWxGO1vIQMCJCQJeSxJUdHGFUeYtmRWtuJx27cjJPGU09n2k5mmubR R/qYdjKdZlwncdukzUPJpHY0tWrZxgjp2g56CwmQhNaS4IJAsOJxYXfv3r2vc/qHICWWxF7QLkgZ Pn/xx+/c89sv957zO7/zOwdghRVWWGGFFVZYYYUVVlhhhRXuGajldsApCCEKAMoAwOfAPCpJkpxR h+aBXa6OF8EGQRBaAcDrwLYPIfQpSZKUTDt1O+4bUUVR3CEIgm/v3r0iz/N3tJuYmIADBw6UA8Ba ADi5ZA7O4b4QFSFE0TTdVFxcTK9evRoo6s6jls/nA0EQaIqiNsEyiUovR6eLwIcxristLeXnExQA QBAEyMvLo2ia3rpEvt3C/SJqCGMcyM/PTzmx0jQNpaWlPMa4ESHkZFJLO/e8qAihQrfb/XlBENi8 vDxHbUKhEI0xXs3z/JMIoawMu3gLSxZSPfXUU4/QNO1RFOUDSZKM+WwRQjzDMPWiKH6BoqgnsrOz s7Zu3ZpVXV1Np/r8AQBM04RTp04ZnZ2dCV3Xr2OMf6Kq6psAcFWSJJKi76y8vLxdmqadOXjwYN/C fuVNlkTUPXv2PGGa5k8IIQLP863RaPRr7e3tFz5phxDK4Xm+SRCElwkhG4PBILdlyxZvMBikXC7X gvuNx+PQ399vnTp1KjExMaHRNN2hquqrGOOTkiQlPtE3I4riDp7nv22a5jqe5/sMw9j9zjvvXF5o vxkXdVbQmpqa7HXr1lHHjx9PDg0NqTRNfycWi/0rAMQAoMrn8z1n2/bnBEHIra6uFhoaGlx5eXlA 03c/QpmmCcPDw9DZ2ZmQZdmwbbsPAH6oquoBABgCgPKsrKy/tG37M3V1de5169axR44csaempq4s RtiMiYoQovx+/27Lsn5UU1OT3dzcTLlcLjBNE7q7u0lHR4eWTCb7CSHjAFAfCARcDz74oFhZWUln ZWVmGCSEwNjYGITDYfPs2bOGpmlRQkgXTdP1gUAgd/v27WJFRQXQNA2KosBbb71lT01NXVFV9dm2 trYup/1kRFSEEEPT9B/yPP8P9fX1vllB56IoCpw5c0bXNM2ura11B4NBWMwnvlhmhgZy5cqVRHFx sbB+/XpGFMVbfHz77bfNoaGhUV3XX5Qk6bCTZ6dd1BlBv8yy7N/u2LFD3Lx5s4vjuHR3s2Romgbv v//+9IULF2KGYXzeibBMOh2YK2hzc7OwZcsWgWXvi0XbHeE4DsrLy4VoNEomJydbQqFQlyzL/fO1 SauoFRUVuxiG+X5zc7OrsbFRSMckcy/AsiyUl5cLiqLA5OTk75SUlLwly/LUnezT/atVmqYpj8fj +m0RdBaO48DtdossyxIASM5nm9ZfjjE+yjDMj48cOZKYmJhI56Nvi2VZoOs6YIwz3tfVq1ehq6vL sG3765Ikjc5nm4mJqtDj8bSWlJRU7927l0/XJGVZFsRiMVAUJXH9+vXpSCTiUhSFTyaTrM/nM7Kz s82ioiKjuLg4z+/3cx6PJy0xLsDNKGDfvn3JZDL53/F4/IupVoQZCamam5u3siz7zs6dO32bNm1a dB+EEFAUBWRZNnt6esx4PD4Zi8VipmmO0TR9muO4KzN2rGma6wkhDYIgeL1eb1YgEPDX19e7QqEQ 4/U6yWvfHtu24eDBg1Y4HO5TVXV7qrcUIEP5VMuyjoqi+GZnZ+fz9fX1/HxJ5TuhKAocP37c6Onp sWzbjrhcrv9KJpOvG4aRAACzvb39lnENIeRRVZXWdT3HNM0vyrL8giAIeY2NjUJDQ8MtcagTpqam 4NKlS7Zt299yIihA5pLUIgBsCgaDzEI/f9u24eLFi1p7e7umaZqCMf5n0zTfam1tHU7VVpIkdebP GAB8AyH0fdu2Xzp8+PAr58+fJ48//nhg9erVjpIys3i9XsjJyYFYLLYNAH7qpE1aQ6pZHnjggUcp inqlqanJ5ff7HbfTdR3ef/99vaOjI6qq6g8sy3r58OHDh2VZji3GD1mWY6FQ6EOM8UFN0/LC4XA5 z/NMUVER41RYlmXBsixGluXiYDD4Cye+pF1UhBDldru/XVxcXPXII4+wTieLqakpeO+992JXrlwJ m6b5jG3b+yRJit6tP7IsgyzLYyUlJe9SFHV+cHAQYYxdhYWFrNOFic/no7q6uliWZa9dvnz5VCr7 tItaVlZWyTDM32/bts1bWFjoqM1M8sIaGBiIaJr2mcOHD1+QZTmtfsmybF+9ejVcUlIyMjg4+JSm aUxpaSnlRFiXywWKolBjY2PFwWDwp7Ism/PZpz1C9/l8z7ndbrG8vNyRvWma0NbWZo+MjERt2/6i JEkfp9unudi2/QbHcX9x9uxZ6/Tp04SQeXPWAABAURTU1dWxGOMqmqa3pLJP99o/h2XZ7zU2NgbW rl3raNA6d+4cOXnypEkI+bNDhw69mU5/bocsy2T16tWdPM+vHhoaqi0tLWWzs7NTtvN6vTA4OIgN w8gtLi5+Y74vKa1vKs/zTRRFFVZVVTl67tjYGHz44Ycmx3E/M03zR+n0ZT4kSTKSyeTXAaD3yJEj lq7rKdswDAPr168XLMvaAQBr5rNNm6gIIZ7n+S+VlZUxTjfozp07Z+u6fiORSHwj1Sol3UiSNEoI +crQ0JDV3z9v0unXlJeXg9vtFkRRfGY+u3S+qXWmaT68adMm3smMH4/Hobe3NwkA35UkKWUMmgk0 TfuQZVnp4sWLCSdjq9frhYaGBh4AvoAQyrmT3aKC/5liMS8A5NE0XSgIQj1N07/n9/vpYDDo6BnX rl0jyWRyIplM/ngxPqQDSZKMpqamf5Rl+SFFUdy5ubkp21RVVTEnTpwo8nq9f9fS0nI8kUj0AMAo 3CyKUwEWISpCKN/tdv8LADxi27afYRhOFEUmEAjAtm3bBKdbIuFwOMqy7C+W6y2dBWN8lKKoK0ND Qxtzc3NT6pGfnw87d+4Uz5w582IsFntxJnzQaJqefPLJJw9Go9GvLeZNLbIsa8/WrVuFwsJCKhAI gM/nA47jHGeFdF2HoaGhZDwe/9Ui+k8rkiQZu3bt6ujr6ytbv359fip7iqJgw4YNVG1trWgYBkSj URgfH3dPTEzkHj169EsA8INFff40TZPq6mqqoKBgMc0hFotBLBajMcaLKlZIN7qunx0ZGfmsZVng dJXFsiywLAtutxsKCwshEolQx44dAwBYnvT8xMQEMAyjA8DIcvR/Gz5WVVWMxRaVYriFZRFVURTD tu0pSLEtsYTEDcMAVVVTWzpgWUSNRCIUx3H9c1J1y80ITdNp2wJaFlEZhiGEEH4mNLsX4AkhDMOk Z9W+LKIWFhYS0zTLwVn9/lKQTwgRAoFAWh62LKIGAgEXTdMeuHdEzRMEAd/NXtZclkVUv98PFEVx AOAs4ZphKIqqzM7OTng8nkU/Y+42+WLiVGzbNtXe3m7k5+fTRUVFbCAQAK/XC16vd95DDrP4fD7w +/2UaZo1AHB2ET6kFVEUHy4uLhadLl4wxjA9PQ2qqsLY2Bhcv37dHh8fxxhjAgDGYkTto2n6T65f v/7Y8PBwZWdnZxEA+HiexwghcePGjSmfybIslJWVuROJRAtC6OepqpszCUIoi+O4hysqKhxtptm2 DW1tbdr58+ftGRGjDMMMAkAfx3H7DcO4vGBRZyqQXweA1xFCAgB4AKAIY/zcRx999Mdr165lnYxN VVVVnnPnzu0CgHUAcEtV9VLB8/xuhmEKg8Ggo0hkeHgYzp07Z+m6/mVCSCcAXAeAhCRJ1qzNXcUQ sixbsixrsizfCIVCA4SQF/Pz88WCgoKUDoqiCOFwGGzbdgeDwbfTvSflBIRQlsvl+vfa2tridevW pdSCEAIdHR3G+Pj4RdM0/1ySpBFZlnVZln+j7iidE9VVjuMOnj59WjfNeffFAODmZtqGDRtE27af YRhmQxr9cIzX633atu11NTU1jqo9FEWB3t5emxDy2ifPDMwlbaJKkkRUVf2PGzdu2CMjzpb0tbW1 VCAQEHmef3W+pG8mQAjVm6b5rbq6OtZpDvjy5csEYzyhadp789mlu+rvDE3T4fPnz1tOM+lNTU08 xniLy+X6JkIoI8UdnwQhlCOK4ms+ny9327ZttJOVlK7r0NXVpVEU9Vaq8p+0iipJUoKiqNd6e3st RXF2gLmiogIaGxs5jPHLLpfrjzK9dEUI+dxu93ds2354x44drpwcZx9If38/TE5OWqqqfi+VbdqD /3g8/o5t2+OXL192FCbRNA2PPvoo1dDQwAHAX7EsuzPdPs2CEGJcLtefWpb19M6dO9mamhpH7TDG 0NPTY7AsexQAwqns0/65ybIcr6qqqpyenl5fV1fnqLRmpvyb4nmeHh0d3VVZWakEg8Grsiyn3jt2 CEKo0Ov1fpXn+Zf37Nnjra2tpZwG+2NjY/DBBx8Ypml+43aH6j5JRsawUCg0aBjGHxQUFLicblcz DAPBYJB1u92egYEBRAhpKikp6S8rKxuRZdlerC8IIXd5efnvulyu72dlZe3cvXt3zpo1axZU+Xfs 2DEciUT6NU37qpN/dEZELS0tnXS73SiZTIZqamocV9hRFAVFRUXUmjVrXIqi5Eaj0ec5jtscCoVG FiouQoivqKh4VBTF12iafmXjxo05u3fvzlq1atWCxux4PA5tbW06IeS11tbWNidtMlWfShNCtEQi QTDGCy4TLygooJ5++umscDhMTp48+djY2Nh2nuc7n3jiiZ/F4/EzADAFAOMAYEqSlJxZ2fEAUAwA fq/Xu5nn+WdM06wPhUKuLVu2iCUlJYsqVzdNEwzDoDDGjncpMjLTtrS0vAAAr+/du1esrKy8q2eZ pgnj4+Nw9epVs7e3V52enk5algUURcUJIZMcx42YpllEUVQOxtgviqIdCASE2tpab1lZGev3+++q 9n9mFYU7OjomDcN4rL29vTtVm0wcpKgXRbH1wQcfXPXYY48x6Tz6Y1kWaJoGiUQCpqambFVVf710 8/v9nNfrZbxeLwiCkLZDFAA3T/29+eab+ujoaKeqqp9OdeFNWkVFCLndbvf+VatWferZZ58VF1Nj f68SiURg3759CdM0/0nTtL+ZL7OW1jiVYZhmy7I+tX379t8qQQEACgoK4KGHHhIwxq/Azfux7kha RbVtexgAJrq7u6edlCfeTyiKAhcuXJgmhIQBID6fbVpDKlmWR0KhUNfk5GRLNBol5eXl9/2BX4Cb gr7xxhvK+Pj4JcMwXkhV/5WJFVX/rLCTk5N0cXExLwjCbW11XQdd12Ex56zSASEEpqengWEYuFNS JRKJwP79+2cFfV6SpJSlShkJ/meE7UwkEs2Dg4NZpaWl9Nwx1rZt6OvrgwMHDqgnT560DMMAURQZ t9vtaI/rbrFtG4aGhqCjo0NvbW21hoeHrby8PNbj8fxG//39/bB//34jFoud1XX9950ICpAhUQEA ZFkeqKysfNc0zccHBgZyZoVVFAUOHTpkffTRR2oymdyv6/rbw8PDBT09PWIkEsGiKHIej+eOb87d oGkahMNhcujQocSxY8eSY2NjpwzDeF3TNHd3d3cBIYTOz8+nOY6D/v5+OHDggMkwzLvRaPSzkiQ5 rvvK+GvR0tKyluf5//X7/ZVr166lOzs7E6ZpXjZN8yuaph2RJMme3XwTBOFLGOOteXl5ns2bN4vl 5eV3da4U4P/Pt166dMno7OzUNU1TKIp6W9O0H9q23SNJkoEQcnu93s8RQr6Zm5ubX1tbK544ccJk GOad8fHxFyRJWlDl2pKU3bS0tKwVBOHnGON8Qsir09PT/3a7g2czudQ1Pp/vOYzxCy6XK7+hoUGo rq525efnL2hosG0bhoeHobu7O/7xxx+bGOM+Qsh/qqr6P3eaaBBCwZycnL8mhHya47hfjY2NfWGh ggIs4WVfM+tzxmlR2pw7qr4MAOsbGhqyEEKObrtQVRUOHjwYGxwcjDIMI8Visdcxxmfm21ea0+9s 6b02d4d0IdwrBWJ3BCHEsiz7vMvl+u5LL70kOsnUh8Nh2L9//7Su680AcGap6wru+Ts5JEmyLMv6 wLIs/caNG47aDA4OWizL9gHA+eUo1LjnRZ3hBsMwkRs3bqS818OyLLh27ZrNMMwJSZKWpaj4vhBV kiSVpunOgYEBK9V9KZqmwdTUFLEs69gSuXcL980aEmPcHolE9g4ODsJ8yZrR0VEwDMNOJpNnltC9 3+C+ETWRSEhut7v3l7/8pRcA7jhOEkJYhmF6AMDZ2cgMcM/P/nNBCHnA2ZBlLtd4ukKG+D+bIIXx sc8FnQAAAABJRU5ErkJggg== "
- height="84"
- width="85"
- style="opacity:0.75000000000000000;filter:url(#filter6134)" />
- </g>
-</svg>
diff --git a/demos/quick3d/model_viewer/qml/images/knob.png b/demos/quick3d/model_viewer/qml/images/knob.png
deleted file mode 100644
index 0d5d8f0e..00000000
--- a/demos/quick3d/model_viewer/qml/images/knob.png
+++ /dev/null
Binary files differ
diff --git a/demos/quick3d/model_viewer/qml/images/knob.svg b/demos/quick3d/model_viewer/qml/images/knob.svg
deleted file mode 100644
index fb693371..00000000
--- a/demos/quick3d/model_viewer/qml/images/knob.svg
+++ /dev/null
@@ -1,867 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Generator: Adobe Illustrator 13.0.2, SVG Export Plug-In -->
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://web.resource.org/cc/"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- version="1.1"
- x="0px"
- y="0px"
- width="52px"
- height="52px"
- viewBox="0 0 52 52"
- enable-background="new 0 0 52 52"
- xml:space="preserve"
- id="svg3883"
- sodipodi:version="0.32"
- inkscape:version="0.44.1"
- sodipodi:docname="knob_on.svg"
- sodipodi:docbase="/local/axel/embeddedwidgets/embeddedstories/skins/svgslideswitch/MetallicBrush"><metadata
- id="metadata4200"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><sodipodi:namedview
- inkscape:window-height="640"
- inkscape:window-width="937"
- inkscape:pageshadow="2"
- inkscape:pageopacity="0.0"
- guidetolerance="10.0"
- gridtolerance="10.0"
- objecttolerance="10.0"
- borderopacity="1.0"
- bordercolor="#666666"
- pagecolor="#ffffff"
- id="base"
- inkscape:zoom="8.3653846"
- inkscape:cx="26.000002"
- inkscape:cy="26"
- inkscape:window-x="0"
- inkscape:window-y="0"
- inkscape:current-layer="svg3883" />
-<defs
- id="defs3885">
-</defs>
-<linearGradient
- id="SVGID_1_"
- gradientUnits="userSpaceOnUse"
- x1="-59.7866"
- y1="-115.917"
- x2="-93.2123"
- y2="-76.0818"
- gradientTransform="matrix(1,0,0,-1,102.5,-70)">
- <stop
- offset="0.0056"
- style="stop-color:#000000"
- id="stop3888" />
- <stop
- offset="1"
- style="stop-color:#EAECEF"
- id="stop3890" />
-</linearGradient>
-<circle
- cx="26"
- cy="26"
- r="26"
- id="circle3892"
- style="fill:url(#SVGID_1_)"
- sodipodi:cx="26"
- sodipodi:cy="26"
- sodipodi:rx="26"
- sodipodi:ry="26"
- transform="matrix(0.923077,0,0,0.923077,2,1.999996)" />
-<linearGradient
- id="SVGID_2_"
- gradientUnits="userSpaceOnUse"
- x1="-100.5"
- y1="-96"
- x2="-52.5"
- y2="-96"
- gradientTransform="matrix(1,0,0,-1,102.5,-70)">
- <stop
- offset="0.0056"
- style="stop-color:#8AADCE"
- id="stop3895" />
- <stop
- offset="0.5"
- style="stop-color:#EAECEF"
- id="stop3897" />
- <stop
- offset="0.6043"
- style="stop-color:#E7EAED"
- id="stop3899" />
- <stop
- offset="0.6751"
- style="stop-color:#DEE4E7"
- id="stop3901" />
- <stop
- offset="0.7358"
- style="stop-color:#CFD9DD"
- id="stop3903" />
- <stop
- offset="0.791"
- style="stop-color:#B9CACF"
- id="stop3905" />
- <stop
- offset="0.8425"
- style="stop-color:#9EB6BD"
- id="stop3907" />
- <stop
- offset="0.891"
- style="stop-color:#7B9EA7"
- id="stop3909" />
- <stop
- offset="0.9374"
- style="stop-color:#53828C"
- id="stop3911" />
- <stop
- offset="0.9809"
- style="stop-color:#25626E"
- id="stop3913" />
- <stop
- offset="1"
- style="stop-color:#0E525F"
- id="stop3915" />
-</linearGradient>
-<circle
- cx="26"
- cy="26"
- r="24"
- id="circle3917"
- style="fill:url(#SVGID_2_)"
- sodipodi:cx="26"
- sodipodi:cy="26"
- sodipodi:rx="24"
- sodipodi:ry="24"
- transform="matrix(0.923077,0,0,0.923077,2,1.999996)" />
-<linearGradient
- id="SVGID_3_"
- gradientUnits="userSpaceOnUse"
- x1="-98.6328"
- y1="-96"
- x2="-54.3672"
- y2="-96"
- gradientTransform="matrix(1,0,0,-1,102.5,-70)">
- <stop
- offset="0.0056"
- style="stop-color:#8AADCE"
- id="stop3920" />
- <stop
- offset="0.073"
- style="stop-color:#8FAECB"
- id="stop3922" />
- <stop
- offset="0.5"
- style="stop-color:#EAECEF"
- id="stop3924" />
- <stop
- offset="0.5902"
- style="stop-color:#E7E9ED"
- id="stop3926" />
- <stop
- offset="0.618"
- style="stop-color:#E4E7EB"
- id="stop3928" />
- <stop
- offset="0.6697"
- style="stop-color:#E0E4E9"
- id="stop3930" />
- <stop
- offset="0.7211"
- style="stop-color:#D4DCE1"
- id="stop3932" />
- <stop
- offset="0.7722"
- style="stop-color:#C0CFD5"
- id="stop3934" />
- <stop
- offset="0.809"
- style="stop-color:#ADC2C9"
- id="stop3936" />
- <stop
- offset="1"
- style="stop-color:#0E525F"
- id="stop3938" />
-</linearGradient>
-<circle
- cx="26"
- cy="26"
- r="22.132999"
- id="circle3940"
- style="fill:url(#SVGID_3_)"
- sodipodi:cx="26"
- sodipodi:cy="26"
- sodipodi:rx="22.132999"
- sodipodi:ry="22.132999"
- transform="matrix(0.923077,0,0,0.923077,2,1.999996)" />
-<linearGradient
- id="SVGID_4_"
- gradientUnits="userSpaceOnUse"
- x1="-96.7671"
- y1="-96"
- x2="-56.2324"
- y2="-96"
- gradientTransform="matrix(1,0,0,-1,102.5,-70)">
- <stop
- offset="0.0056"
- style="stop-color:#8AADCE"
- id="stop3943" />
- <stop
- offset="0.073"
- style="stop-color:#86A7C4"
- id="stop3945" />
- <stop
- offset="0.5"
- style="stop-color:#EAECEF"
- id="stop3947" />
- <stop
- offset="0.577"
- style="stop-color:#E7EAED"
- id="stop3949" />
- <stop
- offset="0.618"
- style="stop-color:#E1E6EA"
- id="stop3951" />
- <stop
- offset="0.6697"
- style="stop-color:#DDE3E8"
- id="stop3953" />
- <stop
- offset="0.7211"
- style="stop-color:#D1DBE1"
- id="stop3955" />
- <stop
- offset="0.7722"
- style="stop-color:#BDCDD5"
- id="stop3957" />
- <stop
- offset="0.809"
- style="stop-color:#AAC0CA"
- id="stop3959" />
- <stop
- offset="1"
- style="stop-color:#0E525F"
- id="stop3961" />
-</linearGradient>
-<circle
- cx="26"
- cy="26"
- r="20.267"
- id="circle3963"
- style="fill:url(#SVGID_4_)"
- sodipodi:cx="26"
- sodipodi:cy="26"
- sodipodi:rx="20.267"
- sodipodi:ry="20.267"
- transform="matrix(0.923077,0,0,0.923077,2,1.999996)" />
-<linearGradient
- id="SVGID_5_"
- gradientUnits="userSpaceOnUse"
- x1="-94.8999"
- y1="-96"
- x2="-58.0996"
- y2="-96"
- gradientTransform="matrix(1,0,0,-1,102.5,-70)">
- <stop
- offset="0.0056"
- style="stop-color:#8AADCE"
- id="stop3966" />
- <stop
- offset="0.073"
- style="stop-color:#7E9FBC"
- id="stop3968" />
- <stop
- offset="0.5"
- style="stop-color:#EAECEF"
- id="stop3970" />
- <stop
- offset="0.5709"
- style="stop-color:#E6E9ED"
- id="stop3972" />
- <stop
- offset="0.618"
- style="stop-color:#DFE4E9"
- id="stop3974" />
- <stop
- offset="0.6687"
- style="stop-color:#DBE1E7"
- id="stop3976" />
- <stop
- offset="0.7193"
- style="stop-color:#CFD9E0"
- id="stop3978" />
- <stop
- offset="0.7695"
- style="stop-color:#BBCCD6"
- id="stop3980" />
- <stop
- offset="0.809"
- style="stop-color:#A6BECA"
- id="stop3982" />
- <stop
- offset="1"
- style="stop-color:#0E525F"
- id="stop3984" />
-</linearGradient>
-<circle
- cx="26"
- cy="26"
- r="18.4"
- id="circle3986"
- style="fill:url(#SVGID_5_)"
- sodipodi:cx="26"
- sodipodi:cy="26"
- sodipodi:rx="18.4"
- sodipodi:ry="18.4"
- transform="matrix(0.923077,0,0,0.923077,2,1.999996)" />
-<linearGradient
- id="SVGID_6_"
- gradientUnits="userSpaceOnUse"
- x1="-93.0332"
- y1="-96"
- x2="-59.9668"
- y2="-96"
- gradientTransform="matrix(1,0,0,-1,102.5,-70)">
- <stop
- offset="0.0056"
- style="stop-color:#8AADCE"
- id="stop3989" />
- <stop
- offset="0.073"
- style="stop-color:#7697B4"
- id="stop3991" />
- <stop
- offset="0.5"
- style="stop-color:#EAECEF"
- id="stop3993" />
- <stop
- offset="0.5636"
- style="stop-color:#E6E9ED"
- id="stop3995" />
- <stop
- offset="0.618"
- style="stop-color:#DCE2E8"
- id="stop3997" />
- <stop
- offset="0.6687"
- style="stop-color:#D8DFE6"
- id="stop3999" />
- <stop
- offset="0.7193"
- style="stop-color:#CCD7E0"
- id="stop4001" />
- <stop
- offset="0.7695"
- style="stop-color:#B8CAD5"
- id="stop4003" />
- <stop
- offset="0.809"
- style="stop-color:#A3BCCA"
- id="stop4005" />
- <stop
- offset="1"
- style="stop-color:#0E525F"
- id="stop4007" />
-</linearGradient>
-<circle
- cx="26"
- cy="26"
- r="16.533001"
- id="circle4009"
- style="fill:url(#SVGID_6_)"
- sodipodi:cx="26"
- sodipodi:cy="26"
- sodipodi:rx="16.533001"
- sodipodi:ry="16.533001"
- transform="matrix(0.923077,0,0,0.923077,2,1.999996)" />
-<linearGradient
- id="SVGID_7_"
- gradientUnits="userSpaceOnUse"
- x1="-91.167"
- y1="-96"
- x2="-61.833"
- y2="-96"
- gradientTransform="matrix(1,0,0,-1,102.5,-70)">
- <stop
- offset="0.0056"
- style="stop-color:#8AADCE"
- id="stop4012" />
- <stop
- offset="0.073"
- style="stop-color:#6D8FAD"
- id="stop4014" />
- <stop
- offset="0.5"
- style="stop-color:#EAECEF"
- id="stop4016" />
- <stop
- offset="0.5605"
- style="stop-color:#E5E8EC"
- id="stop4018" />
- <stop
- offset="0.618"
- style="stop-color:#DAE1E7"
- id="stop4020" />
- <stop
- offset="0.6679"
- style="stop-color:#D6DEE5"
- id="stop4022" />
- <stop
- offset="0.7175"
- style="stop-color:#CAD6DF"
- id="stop4024" />
- <stop
- offset="0.7669"
- style="stop-color:#B6C9D6"
- id="stop4026" />
- <stop
- offset="0.809"
- style="stop-color:#9FBACB"
- id="stop4028" />
- <stop
- offset="1"
- style="stop-color:#0E525F"
- id="stop4030" />
-</linearGradient>
-<circle
- cx="26"
- cy="26"
- r="14.667"
- id="circle4032"
- style="fill:url(#SVGID_7_)"
- sodipodi:cx="26"
- sodipodi:cy="26"
- sodipodi:rx="14.667"
- sodipodi:ry="14.667"
- transform="matrix(0.923077,0,0,0.923077,2,1.999996)" />
-<linearGradient
- id="SVGID_8_"
- gradientUnits="userSpaceOnUse"
- x1="-89.2998"
- y1="-96"
- x2="-63.7002"
- y2="-96"
- gradientTransform="matrix(1,0,0,-1,102.5,-70)">
- <stop
- offset="0.0056"
- style="stop-color:#8AADCE"
- id="stop4035" />
- <stop
- offset="0.073"
- style="stop-color:#6587A5"
- id="stop4037" />
- <stop
- offset="0.5"
- style="stop-color:#EAECEF"
- id="stop4039" />
- <stop
- offset="0.5588"
- style="stop-color:#E4E8EC"
- id="stop4041" />
- <stop
- offset="0.618"
- style="stop-color:#D8DFE7"
- id="stop4043" />
- <stop
- offset="0.6675"
- style="stop-color:#D4DCE5"
- id="stop4045" />
- <stop
- offset="0.7167"
- style="stop-color:#C8D5E0"
- id="stop4047" />
- <stop
- offset="0.7657"
- style="stop-color:#B4C8D6"
- id="stop4049" />
- <stop
- offset="0.809"
- style="stop-color:#9CB8CB"
- id="stop4051" />
- <stop
- offset="1"
- style="stop-color:#0E525F"
- id="stop4053" />
-</linearGradient>
-<circle
- cx="26"
- cy="26"
- r="12.8"
- id="circle4055"
- style="fill:url(#SVGID_8_)"
- sodipodi:cx="26"
- sodipodi:cy="26"
- sodipodi:rx="12.8"
- sodipodi:ry="12.8"
- transform="matrix(0.923077,0,0,0.923077,2,1.999996)" />
-<linearGradient
- id="SVGID_9_"
- gradientUnits="userSpaceOnUse"
- x1="-87.4331"
- y1="-96"
- x2="-65.5664"
- y2="-96"
- gradientTransform="matrix(1,0,0,-1,102.5,-70)">
- <stop
- offset="0.0056"
- style="stop-color:#8AADCE"
- id="stop4058" />
- <stop
- offset="0.073"
- style="stop-color:#5D809D"
- id="stop4060" />
- <stop
- offset="0.5"
- style="stop-color:#EAECEF"
- id="stop4062" />
- <stop
- offset="0.5567"
- style="stop-color:#E3E7EC"
- id="stop4064" />
- <stop
- offset="0.618"
- style="stop-color:#D5DDE6"
- id="stop4066" />
- <stop
- offset="0.6671"
- style="stop-color:#D1DAE4"
- id="stop4068" />
- <stop
- offset="0.7159"
- style="stop-color:#C5D3DF"
- id="stop4070" />
- <stop
- offset="0.7645"
- style="stop-color:#B1C6D6"
- id="stop4072" />
- <stop
- offset="0.809"
- style="stop-color:#98B5CB"
- id="stop4074" />
- <stop
- offset="1"
- style="stop-color:#0E525F"
- id="stop4076" />
-</linearGradient>
-<circle
- cx="26"
- cy="26"
- r="10.933"
- id="circle4078"
- style="fill:url(#SVGID_9_)"
- sodipodi:cx="26"
- sodipodi:cy="26"
- sodipodi:rx="10.933"
- sodipodi:ry="10.933"
- transform="matrix(0.923077,0,0,0.923077,2,1.999996)" />
-<linearGradient
- id="SVGID_10_"
- gradientUnits="userSpaceOnUse"
- x1="-85.5659"
- y1="-96"
- x2="-67.4336"
- y2="-96"
- gradientTransform="matrix(1,0,0,-1,102.5,-70)">
- <stop
- offset="0.0056"
- style="stop-color:#8AADCE"
- id="stop4081" />
- <stop
- offset="0.073"
- style="stop-color:#547896"
- id="stop4083" />
- <stop
- offset="0.5"
- style="stop-color:#EAECEF"
- id="stop4085" />
- <stop
- offset="0.5588"
- style="stop-color:#E1E6EB"
- id="stop4087" />
- <stop
- offset="0.618"
- style="stop-color:#D3DCE5"
- id="stop4089" />
- <stop
- offset="0.6663"
- style="stop-color:#CFD9E3"
- id="stop4091" />
- <stop
- offset="0.7143"
- style="stop-color:#C3D2DF"
- id="stop4093" />
- <stop
- offset="0.7621"
- style="stop-color:#AFC5D7"
- id="stop4095" />
- <stop
- offset="0.809"
- style="stop-color:#94B3CC"
- id="stop4097" />
- <stop
- offset="1"
- style="stop-color:#0E525F"
- id="stop4099" />
-</linearGradient>
-<circle
- cx="26"
- cy="26"
- r="9.066"
- id="circle4101"
- style="fill:url(#SVGID_10_)"
- sodipodi:cx="26"
- sodipodi:cy="26"
- sodipodi:rx="9.066"
- sodipodi:ry="9.066"
- transform="matrix(0.923077,0,0,0.923077,2,1.999996)" />
-<linearGradient
- id="SVGID_11_"
- gradientUnits="userSpaceOnUse"
- x1="-83.7002"
- y1="-96"
- x2="-69.2998"
- y2="-96"
- gradientTransform="matrix(1,0,0,-1,102.5,-70)">
- <stop
- offset="0.0056"
- style="stop-color:#8AADCE"
- id="stop4104" />
- <stop
- offset="0.073"
- style="stop-color:#4C708E"
- id="stop4106" />
- <stop
- offset="0.5"
- style="stop-color:#EAECEF"
- id="stop4108" />
- <stop
- offset="0.5625"
- style="stop-color:#DEE4EA"
- id="stop4110" />
- <stop
- offset="0.618"
- style="stop-color:#D0DAE4"
- id="stop4112" />
- <stop
- offset="0.6663"
- style="stop-color:#CCD7E2"
- id="stop4114" />
- <stop
- offset="0.7143"
- style="stop-color:#C0D0DE"
- id="stop4116" />
- <stop
- offset="0.7621"
- style="stop-color:#ACC3D6"
- id="stop4118" />
- <stop
- offset="0.809"
- style="stop-color:#91B1CC"
- id="stop4120" />
- <stop
- offset="1"
- style="stop-color:#0E525F"
- id="stop4122" />
-</linearGradient>
-<circle
- cx="26"
- cy="26"
- r="7.1999998"
- id="circle4124"
- style="fill:url(#SVGID_11_)"
- sodipodi:cx="26"
- sodipodi:cy="26"
- sodipodi:rx="7.1999998"
- sodipodi:ry="7.1999998"
- transform="matrix(0.923077,0,0,0.923077,2,1.999996)" />
-<linearGradient
- id="SVGID_12_"
- gradientUnits="userSpaceOnUse"
- x1="-81.833"
- y1="-96"
- x2="-71.167"
- y2="-96"
- gradientTransform="matrix(1,0,0,-1,102.5,-70)">
- <stop
- offset="0.0056"
- style="stop-color:#8AADCE"
- id="stop4127" />
- <stop
- offset="0.073"
- style="stop-color:#446986"
- id="stop4129" />
- <stop
- offset="0.5"
- style="stop-color:#EAECEF"
- id="stop4131" />
- <stop
- offset="0.5757"
- style="stop-color:#D9E0E8"
- id="stop4133" />
- <stop
- offset="0.618"
- style="stop-color:#CED8E3"
- id="stop4135" />
- <stop
- offset="0.6655"
- style="stop-color:#CAD5E2"
- id="stop4137" />
- <stop
- offset="0.7129"
- style="stop-color:#BECEDD"
- id="stop4139" />
- <stop
- offset="0.7601"
- style="stop-color:#AAC1D6"
- id="stop4141" />
- <stop
- offset="0.807"
- style="stop-color:#8EB0CC"
- id="stop4143" />
- <stop
- offset="0.809"
- style="stop-color:#8DAFCC"
- id="stop4145" />
- <stop
- offset="1"
- style="stop-color:#0E525F"
- id="stop4147" />
-</linearGradient>
-<circle
- cx="26"
- cy="26"
- r="5.3330002"
- id="circle4149"
- style="fill:url(#SVGID_12_)"
- sodipodi:cx="26"
- sodipodi:cy="26"
- sodipodi:rx="5.3330002"
- sodipodi:ry="5.3330002"
- transform="matrix(0.923077,0,0,0.923077,2,1.999996)" />
-<linearGradient
- id="SVGID_13_"
- gradientUnits="userSpaceOnUse"
- x1="-79.9658"
- y1="-96"
- x2="-73.0342"
- y2="-96"
- gradientTransform="matrix(1,0,0,-1,102.5,-70)">
- <stop
- offset="0.0056"
- style="stop-color:#8AADCE"
- id="stop4152" />
- <stop
- offset="0.073"
- style="stop-color:#3B617F"
- id="stop4154" />
- <stop
- offset="0.5"
- style="stop-color:#EAECEF"
- id="stop4156" />
- <stop
- offset="0.6087"
- style="stop-color:#CED9E3"
- id="stop4158" />
- <stop
- offset="0.618"
- style="stop-color:#CBD7E2"
- id="stop4160" />
- <stop
- offset="0.6655"
- style="stop-color:#C7D4E1"
- id="stop4162" />
- <stop
- offset="0.7129"
- style="stop-color:#BBCDDD"
- id="stop4164" />
- <stop
- offset="0.7601"
- style="stop-color:#A7C0D6"
- id="stop4166" />
- <stop
- offset="0.807"
- style="stop-color:#8BAECD"
- id="stop4168" />
- <stop
- offset="0.809"
- style="stop-color:#8AADCD"
- id="stop4170" />
- <stop
- offset="1"
- style="stop-color:#0E525F"
- id="stop4172" />
-</linearGradient>
-<circle
- cx="26"
- cy="26"
- r="3.4660001"
- id="circle4174"
- style="fill:url(#SVGID_13_)"
- sodipodi:cx="26"
- sodipodi:cy="26"
- sodipodi:rx="3.4660001"
- sodipodi:ry="3.4660001"
- transform="matrix(0.923077,0,0,0.923077,2,1.999996)" />
-<linearGradient
- id="SVGID_14_"
- gradientUnits="userSpaceOnUse"
- x1="-78.1001"
- y1="-96"
- x2="-74.9004"
- y2="-96"
- gradientTransform="matrix(1,0,0,-1,102.5,-70)">
- <stop
- offset="0.0056"
- style="stop-color:#8AADCE"
- id="stop4177" />
- <stop
- offset="0.073"
- style="stop-color:#335977"
- id="stop4179" />
- <stop
- offset="0.5"
- style="stop-color:#EAECEF"
- id="stop4181" />
- <stop
- offset="0.618"
- style="stop-color:#C9D5E1"
- id="stop4183" />
- <stop
- offset="0.6648"
- style="stop-color:#C5D3E0"
- id="stop4185" />
- <stop
- offset="0.7114"
- style="stop-color:#B9CBDC"
- id="stop4187" />
- <stop
- offset="0.758"
- style="stop-color:#A5BFD6"
- id="stop4189" />
- <stop
- offset="0.8042"
- style="stop-color:#89ADCE"
- id="stop4191" />
- <stop
- offset="0.809"
- style="stop-color:#86ABCD"
- id="stop4193" />
- <stop
- offset="1"
- style="stop-color:#0E525F"
- id="stop4195" />
-</linearGradient>
-<circle
- cx="26"
- cy="26"
- r="1.6"
- id="circle4197"
- style="fill:url(#SVGID_14_)"
- sodipodi:cx="26"
- sodipodi:cy="26"
- sodipodi:rx="1.6"
- sodipodi:ry="1.6"
- transform="matrix(0.923077,0,0,0.923077,2,1.999996)" />
-</svg> \ No newline at end of file
diff --git a/demos/quick3d/model_viewer/qml/images/test.svg b/demos/quick3d/model_viewer/qml/images/test.svg
deleted file mode 100644
index 6d51cc9e..00000000
--- a/demos/quick3d/model_viewer/qml/images/test.svg
+++ /dev/null
@@ -1,136 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="100"
- height="100"
- id="svg2"
- version="1.1"
- inkscape:version="0.47+devel r9541"
- sodipodi:docname="test.svg">
- <defs
- id="defs4" />
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="1.979899"
- inkscape:cx="114.34946"
- inkscape:cy="49.177003"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- showgrid="false"
- inkscape:window-width="1118"
- inkscape:window-height="684"
- inkscape:window-x="465"
- inkscape:window-y="406"
- inkscape:window-maximized="0" />
- <metadata
- id="metadata7">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="Layer 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(0,-952.36218)">
- <rect
- style="opacity:0.2;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- id="rect2993"
- width="100"
- height="100"
- x="0.16797371"
- y="952.60327"
- rx="15"
- ry="15" />
- <image
- y="952.36218"
- x="0.173319"
- id="image3901"
- xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAABHNCSVQICAgIfAhkiAAADYxJREFU
-eJztnftznFUZxz/ZpE2apGm6aROa0khbWihFAQW8oAheUJTKMDLjjI7OOP5hjr846A91uEhFHEXB
-CxeFQgVpa5sW2iZNSdKkuTRtNv7wfY/vm7Pvfc+7u5l5vzM7SXbf3X3e8z3P9TznBEqUKFGiRIkS
-JUqUKFGiRIkSJfKio9UCFI2NeIMVYDPQB/QAa97DRgewCiwA15omXYPoarUAObAJ2A0cBvYCK0DN
-uqYD6EREvAccR+S0PTYiIVXgi8C3gXuARcIHuxeYAZ4FzgNXgRtNkjE3NiIhQ8BdwCHv96GYa3cC
-B4ERRFzbE1JptQA5MAiMATtSXNuBSBlCJqztsREJGQZ2IV8SBtvJDwP7kQlre2xEk9WPIqwo2JFj
-FWnJhtCQDSEk0oa7gAeBJ5D/iNIQG73oPnuAWRSRLRcgoxM0k5AKsvu3oRk+R3j+EMRmYA/wGeBx
-4DFEyhay5VDbvO/djohcQ06+lkKGAeBTSDPnU1zfEJpJyG7gCPBdZNPngMuE3+AAsA+Ftt8CvgF8
-Hrid9WSY94aRE3xtMzJdo4iYQ2hy9KPQ+HqEzKOevEfQxPgEuBJ43Xli3Swfsg/4DvAT4FY0O3cC
-fwD+Ciyhmxv2Hp8DDgAPoYGwEUdE2LXmuhHvASL4Q+/7TwPjwAQyZ1tQuPxV4PuIxBmkaS8Ar1ty
-OEMzNGQX8E1kbg57z21CM7SKkrqbaDY+hrTiUeAOkp1x2hkadl0PfgS23/u95slzEHgSeARNpgoi
-aZsn63mk4c5RdC1rM/Aj4If4ZNh4FziFBug+REwY7NmYRfbge6PeNwOcQIM9gnzVQMh1k8AvgGNI
-w5yiSEKqwKeBnwEPI3LCUEOzrgOZ0FYWPNPK8hbwG+AoKsk4Q1EmqxOR8AQyVz3e82Ez1RQCO6kf
-gCy+IguiNCZMljAZBpCJm0Mas+RKsCII6UfO8KfIBpsMOWwQgg43eE2QrCI0poP6z46TpYP6qG0U
-kXIDmMaRT3FNSAdykE+iqKon5rqw3+OeawbSyGJrSj9wCUVqDcN12LuGbHAf6zPpKNOT9Hfw/a5I
-yiuL+buGXwPsRxbAWU2wCJO1iDRjDxLWOPM8A1pkVmzMUFa5gtd/ADyPchknzr2IxHAZeBPlEX1o
-FmVFmjAVZL+vIZMxi5zrIMpxdhEd2dnfkUWmoP87DrwGfJTxsyJRVKZ+Dvgdqh3dQrQvCUMUGfMo
-V5hHpY5rwAXkUP/r/VxEax+7UXY96D2qQDciaisyMXYUZX+fjeBrs8D7KBd5N+2NpUGRpZOLwNvA
-vah2lAVhAzMOvIEGYAWZiCuoiWEeZdirSCu68R1uLyJoCPga8FnW2/w8ZmsW5SIfZHxfIookZAHN
-5LTNBVHOdhxl0Me8n6dSft6FwO9diJzTwFeAB9AkqVBPTpgMNmrIPC6mlCU1iqxl7QW+jgqE3WSr
-O5mBOYEKkEeBV1C1NQ/MGsg5ZO/nkSnrRjUqW0uSHP6a95nngI9zyhSKIgk5jEyEMVdxN2deN9dc
-QhXVXyMiTqBwulHUkJm7gMzONPIrg5YMYZpiy9mNtPU/1Lch5UZRhOxE6xhfRo4dogkJElFDxb2j
-qFZ0DA2gsxv2sICcsikObkWO3x4PW2vM313oviaAk4hcJyiqyWEXMllJjQV26HkT+BfwMpp5ReMi
-ClvfIp85HEaTL+1yciKK0JAuZKqeon49I640YeL6XwF/xmHBLgEXUR1qBOVOQZns32G9b6kh7biA
-o1pWERpSRdoxyvooLqlONA78DZmAZuMk8lnjrJ8ISTIPAXcTvYaTGa4JqSBzNYbUOOrzwxqkTwB/
-QkleszEH/MN7BBuzw7L54HNDSKtudSWIa5N1C1p+fRiZKwiPWIIOcgGR8AwixEU0lQcmeDDLulER
-l601fci5v49C64bqb641ZCu6mWrCdUENWUDZ90la36F+Dg3sZIb3dKNKwAgOosGsGhJmUyto8X8A
-tcs8jiq9ceXsoIacBp5D2tFqmOrCGPKDYQtZsF5rKqgKYEo3V1CyeZMc2pK1dGIijE782N30UI2i
-zHyU+CjFxmWUCLYDTB70EaqXpVlgA5nqR9CY7Mavs00in5S6wS5PLasPNaw95P2s4hMzSv2SbRwh
-ayhsnMkhRxG4gQZymnhCbFRQ61AVdVkuomjtDHAW+AuK4BKRl5B7UWvP3ohr0qrqFIrhF3LIUQTW
-EBGXESlhbUD29eCXUnZ7D4Nl4B10j+NpBMjj1CsopM27Ahgk6yoipd2an68irU0b8UVNwJvIvKee
-+HkI6UCEhAUEZsCjnKGNi0itnZexG8QkquImbRYN3uca9ROugsgolBDTyLBK/cxIIsEuJM4gm92q
-3CMKC0hzs5jSsEloxil1ON/KHVTLSEMu0X57/2aRM3balZgGrSSkFngUuuciB0zTteuyfyJaSUgP
-ChO3035b6/pQbpGnY6Yh5HXqXURHWlEnK9ivdeFnxN055CgSO1AJaHvCdWGOPIjNaJya4tRvBASJ
-EizJ6e9AcXuWNqFmoIo0JGmBLXg/a9SPwwoap9RBSx5CVpGzm8Z3xh0hj6jSdfD57ai6GtfQ1gqY
-slDSSmBYmB8kaRGNU+qzVvLY7gW0dvEc6ksaRhmt6QgfInpvhf1cFWnINhx2/zUA09m+C7/xIel6
-ECkzaBnYlF2WUBPEaVRFToU8hJgazSwSuh+R0IMaGx4lvTPc5H1G3L7zZqITTY7tqGIbBbtOdxOV
-7V9Dk7WCCopXkHZMpxUgKyEV/CaxC6xvRjMYQ8uaJpNPKjKOAXeiLseVjPK4Ri/a9XWI+k1GcQnv
-eeAl4PfEa3qUKf8/svqQpLj8DPBvsm0dHkKDcHtGWYrAMNrneDvh/WKEPFdDi2vHSW4HSsy3XOch
-HyPBklbcgs59EPgC6rltdbR1B3A/irDs6CkKS2gJ+iQyUw3B9Zq6OQJpPzoKI4goJ2+azkBO8TLN
-L6V0Is34Adq/btpLjYx2B6P5exUFNi/iqAu+iEx9Gg1s3MwKMwP70FbkkfrLC8cWZDbvI9upQfPI
-f1x2JUgRjXJLKJzdh6KtYCwf13RmVh6n0LF8zUIXOqHuaUSIHejEhe+nUbvrmzhaZCtCQ2pI0BOs
-t6lp8pI9SEvupnl1pENo1/AB6/mopYTgcxdRf7Cz3t6imq2XUHJl1pkhXff7JhR1mQWwc9SvJeRZ
-qQxDtyff06hBwXSZ2DKFyWnwCupDbntCrqMb3oNuGpIH0rzej4KCPd5nrCKCXeUovSiKehxt3z6C
-Og/tpri4UNc0972AmsPbfjsCyFHuRoOb5nyr4OvmcJoRlDkvIefpAgfRITdPoT0sO0OuSZJ1DoX3
-fyQ8Oc6NItchJpAvmSS+k9E2E6CJ0ouc7G2I1L2oc+Ms0sB5kjvku1BusyPweQ+gvGfMujbLItk1
-5DvOZnxfIookxGy4TPsdUbNyO3K6Y2gA3kWzchJ/G8AM6zd9msWvKiLjEDJL9+Pvn0/7/WGo4G/5
-zrvNLhRFErIHxfb2TExC2DblLhQFjaCyxlVExIT384L33DL+PvVRVIUe9N63lfAcJ88BN9sQuf9E
-1QlnPclFENKFTMwRtOPVnM+eFnGRzQDhzWtT+IQMoEgtroKcdm962Hs6ECEPogaNadQMF3VMYCYU
-eRrQ99CMbORoDYOk9272vncb0oRu0udYWeWyr19G5jN1iT0ORWjIDjR77FpWo+eKBD/Hfm0T8at7
-SXs8ssgSPHzmTmQy3yf9/vlYFEFIBcXpK97n2zM1SExcrSuKwEYGMw5pZQl+1jwixJkPKcJkraJq
-7QCKckwOErU4E7YWHXytaNjJYFIbbPD5N4DfouSwLQ8wAzm3M/hbxG7DX+cI3kxcrSiMQJfk2DM+
-zeAHr/sEkfBzVHp34j+g2Ez9Opo15mQeGy78SSNo5PtPIc14Ga0BOUsOiyRkAWXWq/jHNJnDJc3N
-zaHS9aso8zVdH0GNClsggmwDmuTUF1Fp5nX88696UdRmf/8p4JdIM6ZwnKk34yDleeRTBlm/fXgW
-DcAz6GytdxBBKyiENf9rypiXKP+TFL1Fvc8cCTuJvyX7KJr14/jb9oL/MGYcacazyCQ736TaLEI+
-QcKbjHkKVUpfQDNywnvuMpqB5/EHpQ//NKEs/sV+PfioIRJeR4P7Cjq04EM0KS6hAZ/z5O1H1YDn
-0eT5kIJ2DDcjijHYgY7cuAfd8IvI+UdhGPgSKggeQH5oKzIjxvSlNV83keZdQaWOj4C/o/zhRMz7
-tqEk9140aY6xvs0nSnNzo5mEdCH1r6Ls9hLxW9k2odB5J/I/5tCxB/Grx2kJmUFa9ypaHj6LBniR
-+N1bFUvmCRyVSKLQDEJczaJd6P94/Bj9+4qtKd+3inbBvoRMpIsQ1blmGDRjX4YrwS95jwOohysN
-Iabn9j1Eiqt8obANRhvxn4JNEf/feYLtRx3457O3y174WGxEQq4hWx61WmjnDVOoO2RD3OuGENKC
-OQ00rbldQTlPqw+2SYV229uXBhPoaO9O1LCwTPhgm388Zo61aNYJdQ2hmWGvK5huln0oHF4h3J90
-IRJOo/7bXKfzNBsbkRBQjtJL+n/f3W5Hd5QoUaJEiRIlSpQoUaJEiRLh+B9IcBw4QeHSsgAAAABJ
-RU5ErkJggg==
-"
- height="100"
- width="100" />
- </g>
-</svg>
diff --git a/demos/quick3d/model_viewer/qml/images/zoomin.png b/demos/quick3d/model_viewer/qml/images/zoomin.png
deleted file mode 100644
index b17cbe81..00000000
--- a/demos/quick3d/model_viewer/qml/images/zoomin.png
+++ /dev/null
Binary files differ
diff --git a/demos/quick3d/model_viewer/qml/images/zoomin.svg b/demos/quick3d/model_viewer/qml/images/zoomin.svg
deleted file mode 100644
index d517e3e5..00000000
--- a/demos/quick3d/model_viewer/qml/images/zoomin.svg
+++ /dev/null
@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="100"
- height="100"
- id="svg2"
- version="1.1"
- inkscape:version="0.47+devel r9541"
- sodipodi:docname="zoomin.svg">
- <defs
- id="defs4" />
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="1.979899"
- inkscape:cx="36.315176"
- inkscape:cy="49.177003"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- showgrid="false"
- inkscape:window-width="1118"
- inkscape:window-height="684"
- inkscape:window-x="465"
- inkscape:window-y="406"
- inkscape:window-maximized="0" />
- <metadata
- id="metadata7">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title />
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="Layer 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(0,-952.36218)">
- <rect
- style="opacity:0.2;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- id="rect2993"
- width="100"
- height="100"
- x="0.16797371"
- y="952.60327"
- rx="15"
- ry="15" />
- <image
- y="957.90533"
- x="7.5177755"
- id="image4088"
- xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFgAAABiCAYAAADUdBT/AAAABHNCSVQICAgIfAhkiAAAFYtJREFU eJztnXtwG8d9x397bxxBgCBIvEgIACmKlijGiZTaliPFZ5NyLNmSbElunKTJxJNHM5M2adrOZJpM J23TdDqeJu1k4raTaep0ksaxVUkeyrZkiZRPlpXYjmTJFCU+BRxI6kEKIEg8Drg73G3/INXKEg4g RZByLHxmMJrh7e3+7ovF7m9/+9sTQIUKFSpUqFChwq2AblfDgiBwAEADQB0AVM/9+SoApAEgK4pi /nbZVk6WXGBBEBAA1JIk6bPb7e0Mw7Spqnq3rutNhmHQuq7bDcOoAgCgKCoJAFmapqcRQhdYlu3N 5XKnE4nECABcFEUxtdT2lpslE1gQBL62tnajrutf0DRtE8a4jqIo2mazEU6nE9xuNxkIBICm6ffd J8syXLhwAaampvKxWAwymYyBMVYQQpdpmn6JIIgXpqamen9fenjZBRYEocHpdD6FMf6qqqrBuro6 tH79esrlciGGYaCqqgoYhilZD8YYVFWFVCoFmqaBJEnGmTNn9HQ6rVssllOqqj6bTCZfEUUxWe5n KCdlE1gQBJvD4fiapmnfoCiqvrW1lWlrawOv13tTL71VstksRKNR6OvrMyRJUhFCF0iS/Ovp6elX RFFUy9JImVm0wIIgIKfT+RDG+CckSQbvvfdetrW1FVmtVkBoaUYgwzBgenoaTp06pff19Skcx51I pVJff/XVV4eXpMFFsCgFBEHw2O32v8UYf6alpcW6ceNG5HA4ymVbSTDGMD4+DidOnMhfunQpruv6 P2YymZ+KoigvmxEluGWBt27d2kKS5K/tdnurIAhVoVAISJIsp23zRtM0eO+994zf/OY36Xw+fzCZ TH7lg+Jx3JLAn//85z8my/ILwWBwRWdnJ2uxWMpt1y0Rj8ehq6tLVhTlhCzLT3d1dV283TYtWOAn nnjiMcMwnlu1apWzs7MTsSw773sNw4BMJgMzMzMwMTGhXL58GWma9j4brFYr9ng8qL6+nrbZbGCx WBY0licSCejq6tKnp6eHU6nUY93d3Rfm/3TlZ0ECd3Z2djIM83xbW9uCxM1msyBJknr27Fn90qVL RjabNQzDmKJp+kJNTc07JElmAQByuVxtKpXaoOt6I0mSNqvVSoRCIaK9vZ32er3kfL2RRCIBL730 khqLxc5nMpldoiiGF/Kc5WTeAm/ZsmU1QRCHV69e7d68eTM9H3HT6TScPXtWP3XqlDw9Pa1TFPUm QRD/LstyFAAuA8DMjQuGuSW0AwDqq6qq1mua9jWM8V1er5e85557+NbWVjQfoROJBOzduzebTCbf SiaTO27XmDwvgQVB4Gtqag45nc77du/eTZcacw3DgHA4bBw5ciQ9PT2dxRj/SlXVXwJA30L9VUEQ bABwD8dxX9Z1fWsoFMIdHR02t9td8t7x8XF48cUXFZIk/yWRSPyVKIp4IW2Xg3lN+xs2bPgOxvip 7du3MzU1NUXLKooCoiiqR48ezciy/JKqql/t6en5pSRJlyVJ0hdqoCRJiiRJ4cbGxv2GYZzIZDKB c+fO1VssFsrtdhPFxmebzQYcx1EXLlxYZ7fb3z5//vyyDxUlBe7s7NwAAP+8efNmWygUKlo2nU7D a6+9NjMwMBBRFOWLmqb9qyiKV8phqCRJWJKkaGNj436CIMYkSbqHIAjweDxsMffQ5XLBzMwMMTEx 8XGv17tPkqR0OeyZL0UFFgSBsVqt/3nXXXet3LBhA1WstyQSCdizZ8/M2NhYvyzLTx49evT0rfTY UkiSpI2MjJzx+/29o6Ojn0omk3QwGKQpiipYniAI8Hq9xMDAQBVJkurg4KBYbpuKUXQM3rVr11Zd 11/47Gc/a3W5XKbl0uk07NmzJ3v16tV+WZafnM+sLQhCEABsJpeToihKpep46KGHOliW/dW6detq Ojo6GIIgTMv29fXhw4cPT2az2Y8fOXJkvFTd5cLUIkEQKITQd0KhEF9fX29aga7rcOzYMfXKlSsJ WZa/OF9xeZ5/k+O43xb68Dz/5twXUJSjR4/2qKr6zZMnTyrnz583ipVtbm5GPM/XulyuL5aqt5wU /l0BQF1d3d2Koqxrb28vOpH09vZCb2+vls/n/0IUxbPzbNdmGIZj27ZtfF1d3fsuxGIxOHDgAIB5 734fuq7voSjq3u7u7q/W19fzZt6FxWKBtWvX0qdPn/6yIAg/Xq4wZ8EeLAgC0jTtGw6Hg2poaDC9 OZlMwvHjx3M0Tb+o6/qehTZeV1cHbrf7fZ8bBS+FKIq6oih/p2nayBtvvKHquvmwv2rVKlBV1c3z /OMLtfVWMRsiajVN62xvb6eKLSjOnz+vp1KpTDqd/qEoimWf0OaLKIqJXC73j8PDw/rFi+bhh/r6 eggEAgRJkk/NbWUtOQUFZll2Fca41ufzmRqhKAqcOXMmAwC/BoDzS2XgfNF1/RWEUF9vb6+MceH1 BEIIAoEAo+v6RwGgdjnsKiiwxWJ5gOd5olhsNxqNwvT0NGia9m+3Y4V0I3Nj6k8GBgbQ9PS0aTmf zwcYYwfLsquWw66bBBYEARmGIXi9XqLYkjgajeZJkrwAALc1WnU9iqIc1zRNmZycNC3jcDiA53lE 0/QnlsOmQl5EraZpawOBgOnCwjAMuHLliooxPiGKYq5QmRJ+7ioo4iLOXVslCEKha8V85EmE0KXJ yUlra2trQQ/JYrGA1+slIpGIIAjCD5f611fICK+u69Ver9f0plwuB/F4HOu6/nah69f8XMMwCo4x GGMCALgidnEsy/4CIXSTb0sQREIQhI2FRBZFMfPoo4+evnTpUghjXLCDIITA7/fDyMhIKwBYAWBJ o2yFBLYSBEEV21pPp9OgKAooinLOpIipn3s9Zj7r008/DVDgC5iPj2wYxtuxWGynqqpg5gFxHEcD QBUAlM4fWCQ3CcwwTBvHcWC1Wk1vSiQSgBDKAkDRQM41P3chLLT8jeTz+TFZlkGWZVOBnU4nYIyr AcALAPFFNViCm8ZBiqIYkiRRsQiVLMsAADmYzSP7QKFpWlTXdayq5mFnmqYBIURA8XmgLNzUQDab TSiKohczsKamBhBCNphN3PtAwfN8O8MwBM/zpmXmOogMSzz+AhQQGGM8mM/niTkjClJdXQ0YYxIA Fvd7XgIwxi6e541iK9Dp6WmMEJIBILbU9hSa5KYBQJZl2bQLVFdXg8ViAV3X7wWAt8zKxWKz9sfj hYe5NWvW3PS3iYkJU2Ov1WeGIAgIIfRJt9tNFpukY7GYhjGeAACtaIVloJDAlxmGmbh48aIzFAoV dIQZhgGXy0XIsvzgXGTqRl8yiRAaPHToUDUA3ORn6rrOGobhdzqdqNCk9txzz2GCIMZIklRuuIQQ QikAMIuE1eq6frfP5zPdFc3n8zA+Po44jjtz6NChgj58OblJYFEUczt27DgbjUZb77//fqpQEBsh BD6fj41EIutgdk0fv6EOSRCETWA+iazlOK4HAMyWijlZlp8CgL4C1wxRFDMm9zVjjOtcLpfp5JVK pSAej2OSJHvMypQTs3iwODk5uTOTyUB1dXXBAoFAgDh+/Hg9AHQCwAs3VWAuAgiCkIECPfs6MABk FrLVLggComn6C1arFRXbIJicnARN0/RsNts737oXQ8FvOp1On1BVNV9szGtoaIBgMKjQNP3Nua31 280ajPGT69evR8V8+LGxMaAo6pKu68uybVRQYF3XowihiwMDA4ZZ6I8kSbj//vttAPARhNDWpTSy FIIgIIqi/riqqoprb283XYIrigJzecVvL1ciSkGBRVFMcRz3Qn9/P04kEqY3+/1+1NLSQrIs+11B EDxLZmVp7iMI4nObNm3ibTbzH1MkEoGrV6+Cqqo/Wy7DTCcDjPF/EASRGh42z2kmSRI6Ojo4i8Xi p2n624IgLHv+qiAIDpZln2lpaSHuvvtu0z1GwzDg3Llz4HA4zqmq+uZy2Wcq8P79+6M2m+2/+/r6 8opyo7f0/zidTti6dWs1wzBPsyz76EIaj8ViMDEx8b5PKV/3egRBIO12+7dramraN2/eXFMsZy0W i8H4+LjCsuwPlvO4gek3DgCQSCSeIQjiyeHhYdfatWtNyzU3NxMPPPCA5dixY892dHTwuq7vKbFH V8xPLuXrAsBsvhzHcV9HCH1ly5Yt9mIpXRhjePfdd/MEQZyKRqMHitVbbkpu/O3atev7DMP8+ac/ /Wm+2EMYhgEnT57M9fT0qARB/E02m322WE8RBKEKzH9BxXxdEATBwXHcj2ia3rFz5057KBQqGrSR JAn27ds3o2na7oMHD3YXK1tuSgosCILDbreLK1euXLt161aiWJTNMAw4deqU0d3dnUMI7cvlct8r Z27u3E7wfSzLPsNx3LrHH3/cYrbavEY6nYbnn39ezWazv5qamvrycu9+l5yUJEnKrV69enBycnKn w+FgXC6X6QMhhMDr9SKn00mNj4+v1HV9Z1NT0/SKFSsikiSZD+TzQBCEBpZlv0UQxI+9Xq9v27Zt 1kAgUFRcwzDg2LFj6vj4+Hgmk/nc0aNHl/1M3bxmfY/HE+U4jo9EIh8PhUJMMUceIQQulwutWrWK yWazVbFYbBvLso81NTUhv99/WZKkBa3OgsFg2+rVq/+EoqhnKYr61MaNGy0PP/ww53Q6i96LMYZI JIJff/31XC6Xe7q7u/v0fNstJ/NOvphzh/bV1dV9dPfu3TXzOa6l6zpcvHgR+vv71eHhYUXTtATG +LSiKG8oihIDgCGYDdpfnrvFCwAuAAhYLJYgwzCfwBh/pLq6mluzZg3f0tJC1tfXlzyzgTEGjDEW RRGdOnVKYRjmD/fv398132ctJwvKbhEEoclisbzgdDrbHnnkEUtjY+O8781mszA1NQXhcDgbjUZT sViMxBijbDZLMAyTAABQVbWG53mDJEnD4/EQzc3N1Y2NjYzD4Zj3adHrV56jo6O4t7cXBgcHr+i6 3nHw4MH+hTxvOVhw+pAgCE12u/1nCKENO3bsYEslZRfi2jlkVVXh+sA+QgisVitQFDWv88yF6oVZ tw9d+zeTycDevXv1RCIxoqrqtuU+DbrglZckSQmv17uPoqjmoaGhZpvNRjmdTlQsN/dGEEJAURSw LAtWq/X/PlVVVUDT9C0daLxB3LlmEDAMA4FAgIhGow5N0x5pbGw8GA6Hzdf/ZeaWlraSJKk+n+8I Qsg3NDS0emZmhnK5XOh2HEjEGMPo6Chomobn9uEQQuh947TFYoFAIEBIkmQzDGOd1+vdK0nSsqzm bjl2IEmS2tjY+JrNZjs5MzNzT39/f7XFYiGdTicspDcvhmw2C++88w7u6elR+/r6MjU1NWxdXR0q NAlaLBZYsWIF2d/f7+V5/iMul+uV5RB5UcEZSZL0/v7+kWAw+Aue5/NDQ0N3jY2NkRaLheZ5HszO TSyWdDoNg4OD+PDhwxlJkkZ5nv9WKpX6QTgcfmxyctLW3NxcMO2A53mor6+nBgYGmi0Wy2qPx3Nw qUUuS/RrZGREOXv2rOj3+1/AGEN/f//K8+fPk/l8nuJ5HnEct+hXG+i6DhMTE/DWW2/pPT09uUgk IhmG8f1YLPanBw4cODkyMnK1tbW1Px6Pb0smk2wgEECFvmCHwwFut5vs7+8PsSzr8nq9hyRJWrL8 tCVJQt68eXOj3W5/StO0LxmG4ff7/TgQCPA1NTWE0+mE6upqoGnadCjJ5/Ogqiokk0mIxWKQSCTy kUhEmZiYwBRFncMY/zSZTP5PoWMATzzxxGOapv2ira3N/vDDD5sm0EQiEejq6kqTJPlMLBb7h6Va Qi9plrcgCDaapjtJktyNELoPAOpJkqQ5jkMOh4PgeR5brVbsdDoNAIB4PE6k02k0MzODksmkoSgK xhhnDcO4hBASFUX5tWEYb5cKN27fvn2Xqqo/7+jo4NevX0+YfZGnT5+GI0eOKDRNf29mZuaflkLk ZUmjnwvSWAGgrra2NogQamdZ1ptKpVrghpApQRCy1WodkmV5XNf1s8lkchRmU1ZNo2sF2iOrqqr+ DGP89w8++CC3fv36gr+WueAU7unpkSmK+vrLL7/8X4t81Ju4be9NW2oEQSDr6uq+I8vydx999FG2 ra2tYLlrEcA333xziiCIp/fv3/9yOe24Pa8oWQYkScIul+uExWLxhcPhNR6Phy4UP7kWAdR1nYtG o1sCgcC74XC4bCHWD63AALMie73eNyiKahoeHl7ldrspM5E9Hg9KJpNUPB5/JBQKdYfDYfMcrgXw oRYYYHZB1NDQ0F1VVdU+ODjYFAwGyULhVoqiIBAIkKlUis1kMg81NTUdHh4enlps+x96gQFmRXa7 3YdJkuwYHx93BoPBgu+8uCZyPB63TU1NPejz+Y5IkrSouMUdITDA7M6Mz+c7ms/nH4pGozXFRG5o aKAikYg9n88/2NDQ0LWYVyDcMQIDzEYCGxoajhiGsSUWizlWrlxJFFrtMQwDwWCQHh0draEoao3b 7b7luMUdJTDArMgrVqw4nUwmd6RSKSYQCJCFRLZYLBAMBumRkRGPrustDQ0N3bci8h0nMABAOBwe DwaDZ+Lx+NZUKsWEQiGy0JJ6LszJ9ff3N5EkGfT5fK8u9CUjd6TAAADhcDgcDAZ7r169up1lWcbn 8xV8bQPP8+ByuZiRkZGVLMtqXq/3rYUEh+5YgQEAVqxYEaYoKhuNRh/gOI7yer0FY8lzETh6YGDg YwRBqI2Njb+br8h3tMCSJIHf7z9J07QcDoc3Wa1Wyuv1FgwfOBwO5PF4uKGhoT8gCEJpbGx8W5Kk km3c0QIDzK72Ghsbf0eSJCVJ0nqfz0c7HA5TkTmO4yRJ2oAQOnPhwoWRUvXf8QIDzIrs9/vfRQj5 R0ZG7vJ4PIxZ3ofb7UY0TRNjY2MdgUDgbKm4RUXgOSRJUv1+/+sURTUPDw83m2UwzQWHSIZhmPHx 8YcDgcCZcDgsmdVbEfg65uIWIsZ40+joqL2pqclSaLU3JzJlGAY7MTGxac59K7ikrgh8A5Ik5fx+ /3FFUT45OjpqD4VCBd+PPBeBo2KxGJ1KpR5saGh4SZKkm47HLs/++u8ZoiiGVVX9o6mpqZGuri45 m80WLKdpGmCMQdO0eph9PcJNVHqwCXNxi9/Ksvx4KpWCUCjEXb+kTiQSsG/fvmw0Gp1QVfUroigW zN6sCFwESZIm/X5/79TU1NZkMomviTz3buJkPB4fyuVyO0VRPGlWR0XgEkiSFPH7/e9NTU3tIEmS NgyD2r9/fzIej5/L5XKfEUWxqC/8od30LDcdHR1fIgjiRyRJsgRBHJBl+S9FUYyWum9pcps+hOi6 /nOM8UWCIGplWT7wQflvJCpUqFChQoUKFSpUqFChQoUKFSosI/8LR8Gnq9GbPBgAAAAASUVORK5C YII= "
- height="98"
- width="88"
- style="opacity:0.75" />
- </g>
-</svg>
diff --git a/demos/quick3d/model_viewer/qml/images/zoomout.png b/demos/quick3d/model_viewer/qml/images/zoomout.png
deleted file mode 100644
index 01ed6f25..00000000
--- a/demos/quick3d/model_viewer/qml/images/zoomout.png
+++ /dev/null
Binary files differ
diff --git a/demos/quick3d/model_viewer/qml/images/zoomout.svg b/demos/quick3d/model_viewer/qml/images/zoomout.svg
deleted file mode 100644
index ab722c1b..00000000
--- a/demos/quick3d/model_viewer/qml/images/zoomout.svg
+++ /dev/null
@@ -1,169 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="100"
- height="100"
- id="svg2"
- version="1.1"
- inkscape:version="0.47+devel r9541"
- sodipodi:docname="zoomout.svg">
- <defs
- id="defs4" />
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="1.979899"
- inkscape:cx="114.34946"
- inkscape:cy="49.177003"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- showgrid="false"
- inkscape:window-width="1118"
- inkscape:window-height="684"
- inkscape:window-x="465"
- inkscape:window-y="406"
- inkscape:window-maximized="0" />
- <metadata
- id="metadata7">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="Layer 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(0,-952.36218)">
- <rect
- style="opacity:0.2;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- id="rect2993"
- width="100"
- height="100"
- x="0.16797371"
- y="952.60327"
- rx="15"
- ry="15" />
- <image
- y="962.42053"
- x="-2.5685232"
- id="image4305"
- xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFsAAABcCAYAAAABM8khAAAABHNCSVQICAgIfAhkiAAAFLZJREFU
-eJztnXlwG9d9x39vbyxBkCBIXAQIgBJFyzTjxIztyJGSlUn5kC0pcpSOM6kz8eRopmnjZNqZTJ3p
-dHqkk8k0bceT1J1Mk6aTtPVRSQ7lQ7Yoda0jtR3JkqmDN/DASyIFECSOBXYXu69/iPLINgCRICB5
-Ynxm+I/wW7zffvH2vff7vd9bIfiQIkmSAAAsADQDQP3yP18GgDQAZGVZzt8s38oF3WwHJElCANBE
-07S3oaGhm+O4Lk3TbjcMo900TdYwjAbTNOsAABiGSQJAlmXZRYTQBM/zg7lc7nQikRgHgBlZllM3
-9Wauw00TW5IksampabNhGF/WdX0LIaSZYRjWZrNRDocDXC4XHQgEgGXZ91ynKApMTEzAwsJCPhaL
-QSaTMQkhKkLoIsuyL1AU9ezCwsLgh7Hn33CxJUlqdTgcjxJCvqFpWrC5uRn19PQwTqcTcRwHdXV1
-wHHcdb+HEAKapkEqlQJd1wFjbJ45c8ZIp9OGxWI5pWnaT5PJ5EuyLCdvwG2tiBsmtiRJNrvd/k1d
-17/NMExLZ2cn19XVBR6P5wO9t1yy2SxEo1E4d+6ciTHWEEITNE3/5eLi4kuyLGsVaWQNVF1sSZKQ
-w+G4lxDyE5qmg3fffTff2dmJrFYrIFSd5k3ThMXFRTh16pRx7tw5VRCEE6lU6lsvv/zyWFUaXCFV
-FVuSJHdDQ8NfE0K+2NHRYd28eTOy2+3VbPI9EEJgenoaTpw4kZ+dnY0bhvHDTCbzM1mWlRvmxDVU
-Tezt27d30DT9TENDQ6ckSXWhUAhomq5WcyXRdR3eeecd87e//W06n8+/kkwmv34zVi5VEfuxxx77
-hKIozwaDwba+vj7eYrFUo5lVE4/Hob+/X1FV9YSiKI/39/fP3Mj2Ky727t27HzZN8983bNjg6Ovr
-QzzPr/ha0zQhk8nA0tISzM3NqRcvXkS6rr/HR6vVStxuN2ppaWFtNhtYLJZVjf2JRAL6+/uNxcXF
-sVQq9fDAwMDEyu9ubVRU7L6+vj6O4/67q6trVUJns1nAGGtnz541ZmdnzWw2a5qmucCy7ERjY+Nb
-NE1nAQByuVxTKpXaZBiGj6Zpm9VqpUKhENXd3c16PB56pauaRCIBL7zwghaLxS5kMpnPy7IcLv+u
-V07FxH7wwQc3UhT12saNG13btm1jVyJ0Op2Gs2fPGqdOnVIWFxcNhmGOUxT1r4qiRAHgIgAsvT84
-WQ7j7QDQUldX16Pr+jcJIbd4PB76rrvuEjs7O9FKRE8kErB3795sMpl8I5lM7roRY3hFxJYkSWxs
-bDzocDg+tWfPHvZ6Y7RpmhAOh81Dhw6lFxcXs4SQ/9I07dcAcG6162FJkmwAcJcgCF8zDGN7KBQi
-vb29NpfLdd1rp6en4bnnnlNpmv7nRCLxF7Isk9W0vVoqsjzYtGnTk4SQR3fu3Mk1NjaWtFVVFWRZ
-1o4cOZJRFOUFTdO+cfjw4V9jjC9ijI3Vto0xVjHGYZ/Pt980zROZTCZw/vz5FovFwrhcLqrUeG6z
-2UAQBGZiYuKOhoaGNy9cuFDV4WTNYvf19W0CgH/atm2bLRQKlbRNp9Pw6quvLg0PD0dUVf2Kruv/
-IsvypbX6AACAMSYY46jP59tPUdQUxvguiqLA7XbzpZacTqcTlpaWqLm5uU96PJ59GON0JfwpxJrE
-liSJs1qtv7jlllvWb9q0iSnVixKJBDz//PNLU1NTQ4qifOHIkSOny+nJ1wNjrI+Pj5/x+/2Dk5OT
-9yeTSTYYDLIMwxS0pygKPB4PNTw8XEfTtDYyMiJX2qerrEnsnp6e+wHgO/fff79otVqL2qXTadi3
-b182Ho+PZrPZR2/E7B+JRCKBQOBsIpHYoWkaGwqF6GKdgeM4EASBnZiY2NjW1vZMOByuSvKKKvdC
-SZIYhNCToVBIbGlpKWpnGAa8/vrr2qVLlxKKonzlRi2zAACOHDlyWNO0J06ePKleuHDBLGW7bt06
-JIpik9Pp/Eq1/Clb7Obm5ttVVb2ju7u75CQ0ODgIg4ODej6f/zNZls+W2165GIbxPAD8fGBgIDc3
-N1fUzmKxwG233cbmcrmvLa9wKk5ZYkuShHRd/7bdbmdaW1uL2iWTSTh27FiOZdnnlm/6hiPLsqGq
-6t/ouj5+9OhRzTCKTxMbNmwATdNcoih+rhq+lNuzm3Rd7+vu7mZKBS8XLlwwUqlUJp1O/1iW5YpP
-hitFluVELpf74djYmDEzUzwd0tLSAoFAgKJp+tHl7bqKUpbYPM9vIIQ0eb3eog6pqgpnzpzJAMAz
-AHChXAcrhWEYLyGEzg0ODiqEFI5dEEIQCAQ4wzA+DgBNlfahLLEtFstnRVGkSuWmo9EoLC4ugq7r
-T1c7MlsJy9tjPxkeHkaLi4tF7bxeLxBC7DzPb6i0D6sWW5IkZJqm5PF4qFJheTQazdM0PQEANyyr
-dj1UVT2m67o6Pz9f1MZut4Moiohl2U9Xuv3CK/3SNOm6flsgECgaxJimCZcuXdIIISdkWc4VspEk
-KQgA1Zj1k7Is4yKfzSOEZufn562dnZ0F791isYDH46EikYgkSdKPK/lUliO2xzCMeo/HU9Qgl8tB
-PB4nhmG8WehzSZKCoigeN02z4ntkFEUlJEnaXEhwWZYzDz300OnZ2dkQIaRgZ0EIgd/vh/Hx8U4A
-sAJAxbKB5YhtpSiKKVVukE6nQVVVUFX1fBETm2ma9h07dojNzc1luFCYWCwGBw4cACjxxJim+WYs
-FntE0zQotpISBIEFgDoAuH5NxSpYtdgcx3UJggClwvNEIgEIoSwAlEwyNTc3w0pSoZUkn89PKYoC
-iqIUFdvhcAAhpB4APAAQr1Tbq54gGYbhaJpGpTJpiqIAAOTgSl3ehwpd16OGYRBNK542Z1kWEEIU
-rCHCLsSqvyybzSZUVTVKOdvY2AgIIRtcKYr8UCGKYjfHcZQoikVtljuLAhUcrwHKEJsQMpLP56ll
-hwpSX18PhBAaAG7sGLECCCFOURTNUpHv4uIiQQgpABCrZNvlTJCLAKAoilK0a9TX14PFYgHDMO4G
-gDeK2cViFb2X636fJEkIIfQZl8tFl5rgY7GYTgiZAwC9kv6VI/ZFjuPmZmZmHKFQqOBCm+M4cDqd
-lKIoWyVJeqrAWjWJEBo5ePBgPQBUMrpECKEUABTLRzcZhnG71+stuiOcz+dhenoaCYJw5uDBgwVj
-hHJZtdiyLOd27dp1NhqNdt5zzz0MRX1wJEIIgdfr5SORyB1wJccQf993YEmStkCFJ6BlTFmWM0U+
-W0cIaXY6nUXbTaVSEI/HCU3ThyvtWDk9GwBAnp+ffySTyUB9fX1Bg0AgQB07dqwFAPoA4NkPfEFx
-QaqCJEmIZdkvW61WVGqzY35+HnRdN7LZ7GClfSirZ6XT6ROapuVLjZGtra0QDAZVlmWfqFYyfpXc
-Sgj5Qk9PDyoVI0xNTQHDMLOGYUxX2oGyxDYMI4oQmhkeHjaLpStpmoZ77rnHBgAfQwhtX4uTa0WS
-JMQwzB/V1dUJ3d3dQjE7VVVhua77zWoU7ZQltizLKUEQnh0aGiKJRKKond/vRx0dHTTP89+XJMld
-tpdr51MURX1py5Ytos1W/CGLRCJw+fJl0DTt59VwouwJihDybxRFpcbGiteX0zQNvb29gsVi8bMs
-+z1Jkm54zbAkSXae53/U0dFB3X777UXnKNM04fz582C3289rmna8Gr6ULfb+/fujNpvtP8+dO5dX
-VbWoncPhgO3bt9dzHPc4z/MPldteOUiSRDc0NHyvsbGxe9u2bY2lagBjsRhMT0+rPM//oFpHQtbU
-09ra2s5pmvZYY2NjndPpLGpnt9sRx3HU1NSU1NbWdjEQCAxhjKu6eyNJkigIwhMsyz6xY8cOu9td
-fBQjhMDx48fziUTi5MWLF5+sRvEQwBrFHh0dXbrtttsaZmdnP7l+/XpWEArPPQgh8Hg8NMdxXDQa
-3c5xXNbn871drZuSJMkuCMJTLMt+bffu3Y3Fgq+rRKNROHr0aEpV1T8eGBio2rmbNY+hLpfrDE3T
-O9PpdMv69etRoSAH4F3BGYvFwk5MTHyGZdkNPp/vHYxx8Rl2lUiShILB4Cae538hCELf7t2760Oh
-UMmhMp1Ow29+8xvNNM3nU6nUU9V84tYsNsY4t3HjxpH5+flH7HY753Q6i/aiZcGRw+Fgpqen1xuG
-8Uh7e/tiW1tbBGNcfOBfAZIktfI8/12Kop7yeDzeHTt2WAOBQMkebZomvP7669r09PR0JpP50pEj
-R6p6ZrIiqwO32x0VBEGMRCKfDIVCXKmgASEETqcTbdiwgctms3WxWGwHz/MPt7e3I7/ffxFjvOL1
-7XJP7tq4ceOfMAzzU4Zh7t+8ebPlvvvuExwOR8lrTdMEWZbJ22+/ncvlco8PDAycXvENl0nFClGW
-l1j7mpubP75nz57GlRzBMwwDZmZmYGhoSBsbG1N1XU8QQk6rqnpUVdUYAIzClQ2Ii8uXeADACQAB
-i8US5Dju04SQj9XX1wu33nqr2NHRQbe0tKzojI1pmqAoCjz99NMqx3F/sH///v7y735lVLTqR5Kk
-dovF8qzD4eh64IEHLD6fb8XXZrNZWFhYgHA4nI1Go6lYLEYTQlA2m6U4jksAAGia1iiKoknTtOl2
-u6l169bV+3w+zm63l31K+MCBA2RkZOSSYRi9r7zyylBZX7JCKl5iJUlSe0NDw88RQpt27drFX69A
-vhBXz6VrmgbXblIghMBqtQLDMCs63/5+TNME0zThaoqBZVlIp9Owd+9eI5FIjGuatqOap4ArHtFh
-jBMej2cfwzDrRkdH19lsNsbhcBRdpRQCIQQMwwDP82C1Wt/9q6urA5Zlyz68ihACiqKApmmgaRp0
-XQeLxQKBQICKRqN2Xdcf8Pl8r4TD4YqtkK6lKuEzxljzer2HEELe0dHRjUtLS4zT6UQ34/ApIQQm
-JydheHiY+Hy+9zzJV380hmGgvb2dwhjbTNO8w+Px7MUYVzyKrFquAmOs+Xy+V20228mlpaW7hoaG
-6i0WC+1wOGA1vXwtZLNZeOutt8jhw4e1mZmZzOnTp7k777zzA0OnaZpQV1cHbW1t9NDQkEcUxY85
-nc6XKi14VRNDGGNjaGhoPBgM/koUxfzo6OgtU1NTtMViYUVRhGLnXNZKOp2GkZER8tprr2UwxpOi
-KH43lUr9wDTNHXNzc7ZQKISubftqDxdFEVpaWpjh4eF1Fotlo9vtfqWSgt+QLNz4+Lh69uxZ2e/3
-P0sIgaGhofUXLlyg8/k8I4oiEgRhza/DMAwD5ubm4I033jAOHz6ci0Qi2DTNv43FYn964MCBk+Pj
-45c7OzuH4vH4jlQqxQcCAVTox7bb7eByueihoaEQz/NOj8dzsFJR5U15bdG2bdt8DQ0Nj+q6/lXT
-NP1+v58EAgGxsbGRcjgcUF9fDyzLFh1u8vk8aJoGyWQSYrEYJBKJfCQSUefm5gjDMOcJIT9LJpP/
-U+gtOrt3735Y1/VfdXV1Ndx3331Fi40ikQj09/enaZr+USwW+/tKFPPf1BdySZJkY1m2j6bpPQih
-TwFAC03TrCAIyG63U6IoEqvVShwOhwkAEI/HqXQ6jZaWllAymTRVVSWEkKxpmrMIIVlV1WdM03zz
-einSnTt3fl7TtF/29vaKPT09VLEf9fTp03Do0CGVZdm/Wlpa+oe1Cn7T334G8O4b0KwA0NzU1BRE
-CHXzPO9JpVId8L5NaYqiFKvVOqooyrRhGGeTyeQkXCkTXvEGsiRJdF1d3XcIIX+3detWoaenp+BT
-ZJomnDp1ihw+fFhhGOZbL7744n+s5T4/FGLfDCRJopubm59UFOX7Dz30EN/V1VXQbllw8/jx4wsU
-RT2+f//+F8tt8+a82uZDAMaYOJ3OExaLxRsOh291u91soXzO1UylYRhCNBp9MBAIvB0Oh8s6y/mR
-FRvgiuAej+cowzDtY2NjG1wuF1NMcLfbjZLJJBOPxx8IhUID4XC4+KHKInykxQa4Eny1trYO1NXV
-dY+MjLQHg0G6UIqYYRgIBAJ0KpXiM5nMve3t7a+NjY0trKatj7zYAFcEd7lcr9E03Ts9Pe0IBoMF
-35lyVfB4PG5bWFjY6vV6D61mp6km9jIY45zX6z2Sz+fvjUajjaUEb21tZSKRSEM+n9/a2trav9LX
-ZtTEvgaMcaK1tfWQaZoPxmIx+/r166lCUSbHcRAMBtnJyclGhmFudblcK8qj1MR+HxjjRFtb2+lk
-MrkrlUpxgUCALiS4xWKBYDDIjo+Puw3D6GhtbR24nuA1sQsQDoeng8HgmXg8vj2VSnGhUIguFNYv
-58KFoaGhdpqmg16v9+VS5Rk1sYsQDofDwWBw8PLlyzt5nue8Xm/BV32IoghOp5MbHx9fz/O87vF4
-3iiWuKqJXYK2trYwwzDZaDT6WUEQGI/HgwoJvpwpZIeHhz9BUZTm8/l+V0jwmtglwBiD3+8/ybKs
-Eg6Ht1itVsbj8RRMcdjtduR2u4XR0dE7KYpSfT7fmxjj99jUxL4OGGPi8/l+R9M0gzHu8Xq9rN1u
-Lyq4IAgCxngTQujMxMTE+LWf18ReARhj4vf730YI+cfHx29xu91csboYl8uFWJalpqamegOBwNlr
-8yg1sVcIxljz+/3/yzDMurGxsXXFKr+uLSKdnp6+LxAInAmHwxigJvaqWM6jyISQLZOTkw3t7e2W
-QlHm1SJS0zT5ubm5LctLwkRN7FWCMc75/f5jqqp+ZnJysiEUChV8P/hyppCJxWJsKpXa2tra+sKN
-qSn4PUOW5bCmaX+4sLAw3t/fr2Sz2YJ2uq4DIQR0XW8BgLpazy6T5TzK/ymK8rlUKgWhUEi4NqxP
-JBKwb9++bDQandM07euyLJ+uib0GMMbzfr9/cGFhYXsymSRXBV9+N3cyHo+P5nK5R2RZPglQmyDX
-DMY44vf731lYWNhF0zRrmiazf//+ZDweP5/L5b4oy/K7a+2P7IZvpent7f0qRVH/SNM0T1HUAUVR
-/lyW5ei1NtWp//oIYhjGLwkhMxRFNSmKcuDD/p/K1ahRo0aNGjVq1KhRo0aNGjVq1Pg95v8Bvro/
-kIVqMoUAAAAASUVORK5CYII=
-"
- height="92"
- width="91"
- style="opacity:0.75" />
- </g>
-</svg>
diff --git a/demos/quick3d/model_viewer/qml/meshes/monkey.3ds b/demos/quick3d/model_viewer/qml/meshes/monkey.3ds
deleted file mode 100644
index e9a007b2..00000000
--- a/demos/quick3d/model_viewer/qml/meshes/monkey.3ds
+++ /dev/null
Binary files differ
diff --git a/demos/quick3d/model_viewer/qml/meshes/penguin.3ds b/demos/quick3d/model_viewer/qml/meshes/penguin.3ds
deleted file mode 100644
index 26c09ac0..00000000
--- a/demos/quick3d/model_viewer/qml/meshes/penguin.3ds
+++ /dev/null
Binary files differ
diff --git a/demos/quick3d/model_viewer/qml/model_viewer.qml b/demos/quick3d/model_viewer/qml/model_viewer.qml
deleted file mode 100644
index a8b9c0b4..00000000
--- a/demos/quick3d/model_viewer/qml/model_viewer.qml
+++ /dev/null
@@ -1,272 +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 1.0
-import Qt3D 1.0
-
-Rectangle {
- id: mainwindow
- width: 640
- height: 360
-
- gradient: Gradient {
- GradientStop { position: 0.0; color: "#300000" }
- GradientStop { position: 0.3; color: "darkred" }
- GradientStop { position: 1.0; color: "#300000" }
- }
-
- states: [
- State {
- name: "Open"
-
- PropertyChanges { target: mainwindow; x: -800}
-
- },
- State {
- name: "NotImplemented"
-
- //PropertyChanges { target: container; y: 0 }
- }
- ]
-
- transitions: Transition {
- NumberAnimation { properties: "x"; easing.type: Easing.OutQuad; duration: 600 }
- }
-
- Item {
- width: 640; height: 360
-
- Viewport {
- anchors.fill: parent
- id: viewport
- picking: false
- blending: true
-
- camera: Camera {
- eye: Qt.vector3d(0, 0, 350)
- farPlane: 2000
- }
-
- Item3D {
- id: mainItem
- scale: 50
- mesh: source_mesh
- effect: Effect {}
- cullFaces: "CullBackFaces"
- }
-
- Mesh {
- id: source_mesh
- source: "meshes/monkey.3ds"
- }
-
- MouseArea {
- id: mouseArea
- property bool rotating: false
- property int startX: 0
- property int startY: 0
- property variant startEye
- property variant startCenter
- property variant startUpVector
- anchors.fill: parent
- onPressed: {
- if (mouse.button == Qt.LeftButton) {
- rotating = true;
- startX = mouse.x;
- startY = mouse.y;
- startEye = viewport.camera.eye;
- startCenter = viewport.camera.center;
- startUpVector = viewport.camera.upVector;
- }
- }
- onReleased: {
- if (mouse.button == Qt.LeftButton)
- rotating = false;
- }
- onPositionChanged: {
- if (rotating) {
- var deltaX = mouse.x - startX;
- var deltaY = mouse.y - startY;
- var angleAroundY = deltaX * 90 / mouseArea.width;
- var angleAroundX = deltaY * 90 / mouseArea.height;
-
- viewport.camera.eye = startEye;
- viewport.camera.center = startCenter;
- viewport.camera.upVector = startUpVector;
- viewport.camera.tiltPanRollCenter
- (-angleAroundX, -angleAroundY, 0);
- }
- }
- }
- }
-
- Rectangle {
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.bottomMargin: 15
- anchors.bottom: parent.bottom
- radius: 10
- border.width: 1
- border.color: "black"
- color: "white"
- width: 500
- height: 25
- //Enter text here
- TextInput {
- anchors.verticalCenter: parent.verticalCenter
- anchors.horizontalCenter: parent.horizontalCenter
- id: textInput
- text: source_mesh.source
- activeFocusOnPress: false
- MouseArea {
- anchors.fill: parent
- onClicked: {
- if (!textInput.activeFocus) {
- textInput.forceActiveFocus();
- textInput.openSoftwareInputPanel();
- } else {
- textInput.focus = false;
- }
- }
- onPressAndHold: textInput.closeSoftwareInputPanel();
- }
- }
- }
-
-
- //Button 1
- /* MainButton {
- id: button1
- anchors.top: parent.top
- imageSource: "images/cog.svg"
-
- MouseArea {
- //property bool on: false
- anchors.fill: parent
- onClicked: {
- //source_mesh.options = "ForceSmooth";
- //source_mesh.source = textInput.text;
- parent.bounce = true;
-
- if (mainwindow.state == "")mainwindow.state = "Open"; else mainwindow.state = "";
- }
- }
- }*/
-
- //Button 2
- MainButton {
- id: button2
- anchors.top: parent.top
- imageSource: "images/zoomin.svg";
- property bool zoom: false
- property real changeScale: 1.1
-
- MouseArea {
- anchors.fill: parent
- onClicked: {
- button2.changeScale = 1.1
- button2.zoom = true
- parent.bounce = true;
- }
- onPressAndHold: {
- button2.changeScale = 2
- button2.zoom = true
- parent.bounce = true;
- }
-
- }
-
- SequentialAnimation {
- running: button2.zoom
- loops: 1
- NumberAnimation { target: mainItem; property: "scale"; to: mainItem.scale*button2.changeScale; duration: 50;}
- onCompleted: button2.zoom = false
- }
- }
-
- //Buton 3
- MainButton {
- id: button3
- anchors.top: button2.bottom
- imageSource: "images/zoomout.svg"
- property bool zoom: false
- property real changeScale: 1.1
-
- MouseArea {
- anchors.fill: parent
- onClicked: {
- button3.changeScale = 1.1
- button3.zoom = true
- parent.bounce = true;
- }
- onPressAndHold: {
- button3.changeScale = 2
- button3.zoom = true
- parent.bounce = true;
- }
- }
-
- SequentialAnimation {
- running: button3.zoom
- loops: 1
- NumberAnimation { target: mainItem; property: "scale"; to: mainItem.scale/button3.changeScale; duration: 50;}
- onCompleted: button3.zoom = false
- }
- }
-
- //Buton 4
- MainButton {
- id: button4
- anchors.top: button3.bottom
- imageSource: "images/arrow.svg"
-
- MouseArea {
- anchors.fill: parent
- onClicked: {
-
- parent.bounce = true;
-
- source_mesh.source = textInput.text;
- }
- }
- }
-
-
- }
-}
diff --git a/demos/quick3d/model_viewer/qtquick3d.ico b/demos/quick3d/model_viewer/qtquick3d.ico
deleted file mode 100644
index c695ac72..00000000
--- a/demos/quick3d/model_viewer/qtquick3d.ico
+++ /dev/null
Binary files differ
diff --git a/demos/quick3d/model_viewer/qtquick3d.png b/demos/quick3d/model_viewer/qtquick3d.png
deleted file mode 100644
index 8351083e..00000000
--- a/demos/quick3d/model_viewer/qtquick3d.png
+++ /dev/null
Binary files differ
diff --git a/demos/quick3d/qmlres.h b/demos/quick3d/qmlres.h
deleted file mode 100644
index cae7d29a..00000000
--- a/demos/quick3d/qmlres.h
+++ /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$
-**
-****************************************************************************/
-
-#ifndef QMLRES_H
-#define QMLRES_H
-
-#include <QtCore/qdir.h>
-#include <QtCore/qcoreapplication.h>
-
-#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())
- {
- QString app = QCoreApplication::applicationFilePath();
- 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;
-}
-
-#endif // QMLRES_H
diff --git a/demos/quick3d/qtquick3d.svg b/demos/quick3d/qtquick3d.svg
deleted file mode 100644
index 3b8a5c7a..00000000
--- a/demos/quick3d/qtquick3d.svg
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0"?>
-<!-- Converted with SVG Converter - Version 0.9.5 (Compiled Mon May 30 09:08:51 2011) - Copyright (C) 2011 Nokia -->
-<svg xmlns="http://www.w3.org/2000/svg" width="287" version="1.1" height="286" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="tiny" id="svg2">
- <defs id="defs4">
- <linearGradient gradientTransform="matrix(1.0104795,0,0,1.004441,23.387309,76.758859)" id="linearGradient3730-2" y1="131.35715" y2="156.39526" x1="23.626827" gradientUnits="userSpaceOnUse" x2="303.57144">
- <stop offset="0" style="stop-color:#038d30;stop-opacity:1;" id="stop3726-7"/>
- <stop offset="1" style="stop-color:#038d30;stop-opacity:0;" id="stop3728-1"/>
- </linearGradient>
- <linearGradient id="linearGradient3724-7">
- <stop offset="0" style="stop-color:#038d30;stop-opacity:1;" id="stop3726-7"/>
- <stop offset="1" style="stop-color:#038d30;stop-opacity:0;" id="stop3728-1"/>
- </linearGradient>
- </defs>
- <metadata id="metadata7"/>
- <g id="layer1" transform="translate(-25.071424,-77.933617)">
- <path style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#00ffff;stroke-width:8.85648727000000060;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="path3722" d="M 149.39285,339.37194 C 118.29002,338.06386 93.410274,329.21846 78.267585,314.08502 66.239667,302.06444 58.159936,285.11057 54.818135,264.88047 c -1.962614,-11.881 -2.442596,-20.11519 -2.455216,-42.1199 -0.01051,-18.36712 0.160997,-23.0644 1.239861,-33.95521 2.529982,-25.53941 11.482605,-46.43472 25.677112,-59.93007 16.042727,-15.25252 39.462148,-23.21337 72.203768,-24.54383 6.77105,-0.27512 31.97542,0.38686 41.46813,1.08915 17.85829,1.32123 29.86273,4.01251 41.92069,9.39824 16.71724,7.46685 28.60768,18.52238 36.44553,33.88638 5.7477,11.26691 9.34961,23.29707 11.69339,39.05536 2.22754,14.97664 2.81073,44.00559 1.22086,60.77114 -2.76934,29.20404 -10.704,50.36949 -24.19378,64.53629 -8.65346,9.08774 -21.29946,16.39504 -35.37578,20.44137 -13.11053,3.76868 -25.14568,5.0858 -52.44498,5.73944 -13.81368,0.33078 -17.4242,0.35023 -22.82487,0.12311 l 0,0 z"/>
- <rect width="236.93414" x="49.282932" y="102.78797" rx="95.84404" ry="92.255867" height="239.43414" style="opacity:0;fill:none;stroke:#008000;stroke-width:3.29858350999999980;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="rect2852"/>
- <rect width="175" x="28.571428" y="19.214285" rx="95.84404" ry="92.255867" height="206.07143" style="opacity:0;fill:#b94b4b;fill-opacity:1;stroke:#05d105;stroke-width:4.147;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="rect3704" transform="translate(25.071424,77.933617)"/>
- <image width="191.18274" x="73.931854" y="148.93103" height="144.13199" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAK0AAACDCAYAAAD/CZsFAAAABHNCSVQICAgIfAhkiAAAIABJREFU&#xa;eJzsvXmUXdV5L/jb+0x3qltzqVSTZglJIECI0QYMjTEE45jwVszCcUgcp1fil3ZC2unl9PJb7tXL&#xa;dl4Sk7x46DhJ20mcvNjQL7Ed2wkewIARYIVJDJoQmkpIVarxzveeYe/+Yw9nn3NvSaUBnO7w2YXu&#xa;PfecPX77+37fsPchADjeprfp/0NEf9YNeJveprMl+2fdgNMRIUR/5vxthfA2Cfp3LWkVoxJCEgz8&#xa;Nv3Hpn93kra7uxvr1q3DwMAABgYGYFkWbNtGFEWYnZ1FqVRCqVTC3r17EUXRz7q5b9PPgP5dMO3Y&#xa;2BjGxsZwzTXXYGhoCFu3btVMSymFZVngnGNmZgblchmlUgkvvPAC9uzZg/3792Pfvn1vw4f/QETw&#xa;M/QeZLNZbNu2DR/4wAewefNmXH311chkMshkMvoexYyUUjDG9PVWq4V9+/Zhz5492LNnD772ta+h&#xa;XC6jXC6/5f14m9564j+rv76+Pv6xj32MT05OcsYYZ4zxKIp4FEVt3znnPAxD/ad+bzabvFwu86uv&#xa;vpqPjY39zPry9t9b+vfWVkgI4ZlMhheLRT43N8er1SoPw1Azp/mnGFR9Nhk6fQ/nnH/1q1/lq1at&#xa;+lkP6Nt/b/LfW+49cBwH999/P15//XX09vYil8t19AwQQkApBSEEnHNQGjfV9CpQSkEpBecc9957&#xa;L+677z7kcrm3rD9v01tPbzmmffrpp7XhZRpPijnTZDJo+n71u2Jqzjmmp6dx6tQpXH755Ynnz0SE&#xa;EHz4wx/Gr/7qr2J6ehpzc3M4dOgQFhcXceLECUxOTuLYsWOYm5s7574DgOu6GBkZwcjICIaGhlCv&#xa;1zE1NYWpqSmcOnXqvMr+j0Jvqffg6quvxujoKLq6ujQzcc4TDLkUk6WvL3VfPp/H0NAQNmzYgLm5&#xa;uWUzmWVZ6O3txfj4OPr6+lCv17FmzRo0m01UKhU89dRTIIScNdOqxTU6OorR0VHccccd6OrqQldX&#xa;F/L5PIIgQLVaRbVaxbPPPov9+/fj1VdfRRiGZ1XPfyR6S5jWcRzYto1PfvKTGB0dBRAz61K01O+m&#xa;5FWkgg+cc+TzeeRyOdx///34l3/5F3zve9/T0vhMbRwYGMD4+HjHunzfx969e5ffaYOuuOIK3Hvv&#xa;vdi0aRNuv/32JbXHvn378Oqrr+Kv/uqv8NRTT6FWq51Tff9/p7eEabds2YJLL70Ut912WxvTLcW4&#xa;CsMGQYAwDEEpheu6p2V0xQSEEHzwgx9EvV7HM888g9nZ2TO20XVdOI6jv6eZvNFonBM0+MhHPoJ3&#xa;vetdeO9734tCodD2u7k4N2/ejA0bNqCvrw87d+7EZz7zGURR9JYHUbZv3w7f91EqlVCv17GwsLCs&#xa;hf9W0VtiiG3atAl33nknLMtaVkhW3UMIQRRFaDabaLVaietLlaMMs66uLqxcuRJ9fX3LGmwVxEiX&#xa;abaj1WqdXcchmPbGG29EV1dXW5nqs/mvbdu47rrr8Fu/9VtwHAeWZZ11nedLl19+OS6++GKMjY2h&#xa;r6/v310Y/U2TtKqTfX192LZtG+644w5EUaQl6OlU/+HDh3H48GH89m//NmZnZzEzMwPOOa699lrc&#xa;dtttuO2227Bjx46Oq9/Extu3b8cVV1yB/fv3n7G9StIuZQy2Wi1UKpVl9/+6667DddddhyuvvLKt&#xa;nemcCvW7GhMVYPnsZz+Lhx9+GP/6r/+67HovBD3wwAPwPE8HeS6//HJtLP57oTfVp/bVr36VP//8&#xa;823BAtPPqnyvnHO+a9cufscdd5yx3EcffbQt+GCWF4Yh932ff/rTn+bd3d1nLG/16tX8r//6rzsG&#xa;OGZnZ/l/+S//hReLxWX1ua+vj//Zn/2ZLssMipj97eSPNr8zxviXvvQlPjQ09Jb6QZvNJg+CgCta&#xa;v3497+vrO+fy8vk8Hx8f5+vXr+ee53Hbts+rfW8aPMjlcujv78d9992Hbdu2gTHWUYqZEvfHP/4x&#xa;vvSlL+F73/veGcu/55579GclqdIuMcuysGbNGlx//fVnLK+vrw99fX2Ja6q8crmMSqWCarV6xnIA&#xa;4IYbbsD111+fCDub7TLL7kSmOr7mmmtwzTXXLKve8yXHcZDNZuG6bgKWNBqN8/JmbNu2DX/+53+O&#xa;V155BaVSCZ/73OcwODh4zuW9aUzb29uLdevWnRUe+uY3v4l9+/Yt6/5arYannnoKk5OTpzXqBgYG&#xa;sHnz5jOWl81mkc1mE9dUeY1GA0EQLIvRuru7sWrVKqxYsaKjp8O8f3p6GtVqFUEQtPmd1eeenh70&#xa;9vaesf0XghzHQT6f199VW4IgOC9j0LIsjc8tywJj7LwWwZuGabdt24bbbrsNQLt7Kj35J0+exIkT&#xa;J/C3f/u3yzZ2arUaPv/5z+Puu+9OuKlMnAgAa9euxS233II//uM/TjyvjC5KKXzfR09PD7q7uzvW&#xa;deLECVQqlTY3XCcmvu222/COd7wDw8PDievqOd/38dxzz+G5557D3r17kc/ncfHFF+Piiy/G9u3b&#xa;2xh85cqV2LRpEyYmJnDs2LFljc25UldXF1asWNF2/XwlbSaTQS6X09K71Wqh0Wicc3lvCtO6rotL&#xa;L70Ud99995I+SXUtiiI8+uijeOihh846Q+uxxx7D9u3bEUURbLtzV3p7e7F27dq261dddRXWr1+P&#xa;9evXo1KpaGs5HewAgFKpBMdxsHLlSgRBgHq9jiAIEASBvkfdf99992H9+vVtMIBzDsYY/uiP/gg/&#xa;/elP8cwzz2B+fh6A8K5s3LgRX/jCF9Dd3Y1isajLzWQy2LJlC9797nfjK1/5ylmNz9lSp7EihKDV&#xa;ap2XpM3lcjq0roxa3/fPubw3jWn7+/sxMjJyxkgWYwz79+/Hd7/73bOup1arwff906pt27YTqY6K&#xa;duzYgXe/+9249dZbsbi4CNd1kc/nO7q8lAtteHgY9Xpd43OTaRVt3LgRPT09mvlVecrf+vnPfx6N&#xa;RgP1el0/s3//fuzfvx+/93u/h4mJCc206tmBgQFs2rTprMfnbCmbzSZwvdn28/HROo6jfeCMMf13&#xa;rvSmMK2SYMvJF1DQ4FyoXq9jbm4Ok5OTWLt2bcJ9pCjNjOq3DRs2YGhoCJ7nYWhoqK1ss6y77roL&#xa;d911FwBoKRGGIcIwxNe+9jV8/OMf10nrnaQ6ALz66qvYvXt3xwCFatsf/MEf4IMf/CDuvffexO8b&#xa;N25EX18fPvGJT7ypTv5XXnkF+/fvx5NPPgnP81AsFpHJZM47uKEkLSEECwsL5wUNgDeJadesWYM1&#xa;a9YAgE5kAdCRgV988UW8+OKL51QP5xyTk5N4+umnsW7duoR0U5Nr27YeMLN+FXlK50Ck/abmd1We&#xa;GSRRSS47duzAe97zno4LBwB+9KMf4U/+5E+W7AshBDt37sRVV12FZrMJ13W1T7tQKMC2bb3tyGQi&#xa;Fbau1WpoNpvnxdRhGCKKIhw8ePCCLg7VRs45pqamlu2FWYreFO/B+Pg4xsbGtBroNACKaV999VW8&#xa;+uqr51zX3NwcXnvtNQAxboyiSNerLNdCoQDXdfVzmzZtwsDAgH5OPWuqLXUtHQwwIcSxY8dAKcW2&#xa;bdvaJKS67/XXX8fu3btx8uTJjn1Q9ZTLZRw5cgRvvPGGVslKIzmO0+aKIoTg/vvvx9GjR1GtVtFo&#xa;NPDiiy/iwQcfbKujt7cXl19+OW655RZcffXVuOiii7BixYpE6NociwtFlFLk83ntlZienj7vnIoL&#xa;LmkzmQyy2WzbYABJaQaICZ+fnz8v9eP7/mkjVapOx3G0BUwIged5eu/Z+VC9Xkcmk4HnefA8r81l&#xa;BYiJmp6eXnZ5jUajY0KQbdsJKz6Nv5Vk7oQXx8fHce211+Kqq66C7/toNpt44okn8MQTT2htsX79&#xa;emzYsAGDg4NoNps4evQopqencfjw4SXbOzo6ik2bNmm49G//9m8JrG9ZFlzX1YZytVo9LyMMeBOY&#xa;dv369RgdHW3zeSoyB/rpp5/G0aNHz4tpFa5N+0TT37PZrB7MbDaLrq4unYCzHFfWUn2Ym5tDb28v&#xa;urq62pLPlZQ8dOgQXn/99WX1Z25uDvPz8xqCqLbZtg3P8xJMm8/n4XkebNvWWqXZbHbEzZs3b8a7&#xa;3vUu3H333fpaFEV47rnndJ+uuOIKfOADH8C2bdvQbDbx4x//GE899VRHplUQ8J577kkw7eOPP46/&#xa;+Zu/QaVSQaVS0QELz/MAAKdOnUpIWpWTQQhJuNZOa1wvayTPgq6++mpMTEzolZXGsSaD7Nq1C2+8&#xa;8cZ51ReGIZrNZqJ8sz51Te2CAET0K5PJJPIgTjdIp+vD7OwsNm3ahMHBwbbkFkIIyuUyjh07tmxJ&#xa;22lzpmqn67q6r4CQct3d3Yl6FxYWOjLZ2NgYisViYsGZWooQgr6+Pqxdu1bbIwcOHEhAKkVbt27F&#xa;HXfcgTvuuCMRbeSc47rrrgMA/OQnP8GTTz6pF5bqgwqoqMSmj3/84zrvo1qt4tOf/vSS0VNFF5xp&#xa;R0ZGEhlNS0WFCCE4fvz4ee+e5ZwjiqIzMp45ENlsVkuntJRVbTPVvFK3naR4tVrFxMSEDkyk21Aq&#xa;lTA/P79sHNdqtdBqtdoMQRWWNtva29uLbDab6Huz2cTCwkJbucViUcMXdX8YhlpVq/JNWLdUWVu3&#xa;bsWOHTtw/fXXa4GgxjeXy+HWW2/FyZMntRfC9KEreKCy6n7zN39Texd838dnPvOZM0ZELzjTXnLJ&#xa;JRgaGupofQNJ5t23b9+ycl1PR8pIAZKuNNPiJ0QkcSsYUqlU8Id/+If6IJBbbrkFQ0NDba4v9fzU&#xa;1BRc14XnecjlctqKZ4xhZmYG119/PVatWtVx4ezZswczMzPL7o/v+/B9f8m0S/O6WizmwiuVSpic&#xa;nGx71lxYilSgBBDz4rouCoWCLq/RaOgACAAdhv3Sl76EbDar+6rGVbXh4MGDGrL19vYm/OSzs7Oo&#xa;1+sYGxvD6tWrdeojAHz961/v6PtO0wVhWtOqTlvlpuGVntC5uTk0m822Mw3OhhzH0VjSrMdkXMYY&#xa;arWaHpCpqSn8/u//vi7jy1/+Mq644ooE0yqf4tzcHC699FK9+0I5ylW/fN/H1q1bl/T1ni0E6mTI&#xa;LTV+a9asQW9vb4KRl0pWHx0dTcCDxcXFBIaklMLzPG3lM8ZQr9dRKpV0GZs3b8bWrVvR39/f0X2p&#xa;/p2ZmdGLoa+vL8Hg5XIZrVYLN954I+67775E2z/72c8ua4wumKRVGGXVqlUJHJSWtEotqUE5UyLK&#xa;mSiXy+lFkq5T1ccYQ6PRWLKe9evXJyJB6r5SqYSjR4/C9/3TSoCVK1cmJJRZ9+7du88qD1VJM3My&#xa;lepNY71Vq1YlpKdKmO/kTenp6UlIvDQ0S8ODKIpQr9exuLio77n66qvx4Q9/WMMxhVNPnTql57+v&#xa;r09LU0Awreknn5mZQTabxY4dO3DTTTeBMYaDBw/i4MGD2nV5JrpgTGt2wiRTWqjPKmHifLOHAOjI&#xa;zVL+xeVkFJkY12SWer1+RviSzWaRyWQ6Gp6A0CZnEwFSkEWRuQAUJFFkMqL6PQiChEtJ9cdsIyAW&#xa;pGnUKc2h5pBzrl1jykU4NDSE8fHxhPacnp7GAw88oK/9zu/8DprNph7zfD6fwMmlUglDQ0M6xE8I&#xa;wdGjR/HEE08se4wuCNOahoJacaZKM9UH5xz1eh0zMzM6gnM+1NPTg1WrVrVdV3Uq78Lp6unp6dEu&#xa;GdPwmZ+fTwQulnq2WCy2uajUInrjjTfOythUPl+TVFlBECSYdmRkRKt8pcE6SVpCiHbxqe/Hjh1L&#xa;qP5MJpPwpyrtpNo+ODiIdevWYXx8PGEv/Omf/ik+97nPJeqamZnRhufg4GACvpXLZdx8883Yvn07&#xa;OOcol8t49tln8Q//8A/LHqMLJmlVYkp68gC0STC1dUVJ2XNlXEII+vv7sXHjxrbfVJlhGC4p6cz9&#xa;ZIpRzLbOz8+f0b+qnk1DIBOWnE1an5kRpfqoonymMUkp1UaOqjcIgra0PyUB09ogzbRDQ0MoFAra&#xa;FlBSW8G3sbExjI6O6roWFhYwPz+PL3/5y4n2/8Vf/AUGBwe1Adff369DuICAGFdddRVGR0dBCMGD&#xa;Dz6Ip59+GsePH1/2GF0wplWRjzRESDvtTVfL+UpZQggKhQKGhoaWdHlFUYQwDDv+RinVTvtOGwjT&#xa;1nMnMgMU6YXaCYeeiVzX7egbVTDHdL+l2326DKq0MCmVSoncZeUSU+1Ph9+LxWICPy8sLODQoUNt&#xa;WmRxcTGBg3O5XMK7c+WVVyb8+N///vd1rsNy6YJL2rRbxmQmdf1cd7amyXVd9PT0JCRA2lvh+/6S&#xa;CRr5fB7FYjGh3s32Li4u4ujRo6dtQ9pzkXZVpXHomUi1hzGmw8xK0pplZTKZNuNK3ZO2E5Q7y7Zt&#xa;3b7JycmEpFWBCjMUbJaTdgnu3bt3Wemkynug6v3gBz+IXC6Her2Oer2O73znO2ftObqgTGuGbtOW&#xa;tLoGQKu68yUlHYB4cTDGtAtNSZSlGE95HpSKTRuNCnufjpRUXMoQPFttojCyuXOZMaZVtcm0XV1d&#xa;ifyJ020LUlEpNS/pbKvx8XF0d3frvjebTW0LUEqxYsUKzbTKd/3SSy+dsT9pCKP2hj3++ON4/PHH&#xa;z2lHxAWFB47jaEmbxrVAUhp18jScLQ0ODiKfzyfSH9MS7/jx43jmmWc6Pp/P59u2l5gMUC6XzxjJ&#xa;Uup5qSjOUsxsknrWtm309vYmmIcQgmazicXFxUQyttpmbvZbGX1mfdlsVm91MTXQwsJCwnug3Haq&#xa;rFqtppk6l8uht7c34darVCrLwqHd3d0Jw1Lh/IcffhgPPPDAGZ/vRG/pqYnmAF+IQyjGxsb0BC9F&#xa;5XK5Y4QIEBOa3jRoeh1ardYZIzRnCjmacOVM9ylokMlkEs9Vq1WcPHkywYyd3GLKcW+S53l6jNRC&#xa;SBt1ALR3QUlyczuRiUsVBUGwLFdeOp0SQBvUOVu6YEyrMFBazSoyB9zzPBQKhWVP6FJ0++23Y8OG&#xa;DW0BDLPu48ePY9euXR2f7+vrw/r169ueAUTcXW3nOR2lPQbp/qQx/ulo9erVGB4eRjabTUz05OQk&#xa;nnrqqUQfFWObbVA41RwHte9LtUNBjTSDDw8PI5/P62er1arezKk0mjlGrVZrWa68QqGQMPA453Ac&#xa;B319fRgZGVnWuKTpgjGtimObid+K0uoxl8thcHBQbys+F8Z1XRd33HEHNmzY0LEuzjmq1SomJydx&#xa;6NChjmX09fUlnjf/VXmtZ6I0hkwbhAoynY4UFr/yyisTE6nKOnbsGHbu3Jl4RuUcmHV3YtrBwUFs&#xa;3rxZt0d5U9LBhYGBAe2aUmOnoJHKilOkBNRy8gSUBFf8wTmH53nYvHkzbrnlljM+34kuGKZVKud0&#xa;/ln1WSVmqKTmc4mKua6LiYmJ0x6zVKlUsLi4mJgck0x4kF5YKj/0THS6pGyF3Ze7KNesWYOenp62&#xa;65VKpS1/wTyfQFEneKCOPlWkFkh6h62KCioy4UFaxZ+tC8+yLA0nFL4dGBjARRddtOxyTLpgkrbV&#xa;aqFUKiX8iOnJUkzc1dWlUxhN1XE2dNNNN51WUlNKceLEiSWTVSilGBgYwMaNG3VbVTmUUrRarSWZ&#xa;3aRyuZx4Nm1sqqSW5ZDKFlPEOUetVsORI0fwyiuvJO5VznmzbpWoYo7HyMgIduzYob8reGBqQ9d1&#xa;EzkChBDtkgLQdhDe2WhHBQ9effVVPPjgg3phbdq0Ce973/t0FPVseOCCMK2JlUzJaQ6qOZnq88qV&#xa;K5HP588JkP/Kr/wKgFhydOr0gQMHcODAgY7PU0r10U1pycE5b3OSL0Xz8/M68SfdR0II3vWud2H1&#xa;6tWnLUO1Q8EDE2IsLCxgZmamTYKuXLmyrZzFxUW0Wi2tfRzHwcjICLZu3ZoIdqgghRIimUxG+1MV&#xa;mUxr7rlTbTOz605HKhJXrVYxPT2Nl19+GdPT0ygWixgfH0/kfSyXLqghFoZhYjvFmdw9t956K9at&#xa;W7fsOszzB9773vcmIkRmO1SG0pEjR3DixImOmFLtbjUd7qYxtVymPXXqlI61mzF51e+77rrrjGrw&#xa;hhtuwCc/+UnYtp1oKyEEr732Wsfsp+UcYVosFjEyMqIZXAVbzIw3FVlT4VY1FqbLS6V1muPU3d19&#xa;2sWotKmSyiq6+MQTT+Do0aN6a/873/lOTExMnLYfabogTKvcKGEYYteuXThx4kSbhAXazz34+Z//&#xa;+bPCNYwx3H777fjiF7+oIzxKvajyVT7Bd77zHbz44ouo1WpLhjXVn3rWdAuZhsiZaM+ePZidnW3r&#xa;M2MMl156KS6++OLTHri2fft2fOQjH0kwu1o8S+0vMzGtqm9kZASFQkFrussuuwyXX355AvbUajWc&#xa;OHGizZdrUhAEqFQqWtKqLTLmol69ejVuvPFG/UyhUMDw8DA++tGPJr4r1a/g40MPPYQ9e/bocXrf&#xa;+9531geRXHA/7eTkpHaFpCVPWjKMj4/r5OTl0ODgICYmJrBp06aO5Zrfd+7cuaR/FkBbECRdlloQ&#xa;y6HXXntNZ+p3atPExMSS0uSee+7Btm3bOu5enpubw/T0dEfXkhlQUXT55ZfrM8SGh4exZcsWnZWl&#xa;qNVqaQmq2pk+Ukrlhigj00ygV+O1Zs0a3HzzzVixYgWGh4dx44034td//dd1hFAZ22aZrVYLMzMz&#xa;WFxc1Eb7JZdcguHh4bPy21/w7TaPPPIIVqxYgWuvvbZNyqpVqgZrbGwMt9xyC3bu3IlHHnmkze8I&#xa;9TznKBaL+NSnPoUrrriiTTqbTKK2q3zzm988rR9RSdml3FFjY2MYHx/Hyy+/3GYopL0d3/nud9Hd&#xa;3Y0rr7yyzSDjXCSJfOhDH8L4xAR+9KMf6d0P7//5n8f999+P/v7+tgOdCSH41re+hV27di3LH8o5&#xa;x5133onBwUFcdNFFWLt2LXbs2KEXi2pPpVJNnOjDOU9IWhWBq1Qq0uVHdEZXo9HQbrENGzZgzZo1&#xa;+NSnPgVCCC655BJcfPHF+MQnPgEA+iR2RQoenDp1CocPH8apU6cwOjqKK6+8Ejt37sTg4OCyk+Uv&#xa;ONPu2rULV111Fer1ets7BswJVYy2fft2/NpHPoJVq1bh7/7+78FSCR9Dg4MYHBzEhz70IXz0ox9t&#xa;C16YbjVCCA4cOICXXnqpLYIkWyD/5SCGpE2XwznHRRddhF/7tV/TZ+uq++bn5/GXf/mX8YIC8Pzz&#xa;z+Omm25CFEUdJeaKFSvwi7/4i7jxxhtx7TXX6Eyu97///Vi5cmXH/hBC8JWvfEWEStNGJueoSS+B&#xa;2cfR0VHceeedeM973rPk+9mq1QpOnEiOTa/ctaHKqzcaMo9BSNpWq4Xjx4/j5MkprF0rduoqe+A3&#xa;fuM3EvOrdh0rTAsImFStVvU2oEOHDuHQoUMYGxuD67oYHR3FZZddhocffritvZ3ogjNtqVTSvlEV&#xa;9eoULVKfc7kc3nHddRgfH8fXv/ENhBIfAwBkNGbLli342Mc+lqgnPWGKDh8+jEcfffS8dkSokOrt&#xa;t9+Om2++OfG+h9dff10wrbgR4ByNeh2+9HummVa1U6nRrVu3atwtutienaZo3/79aJoBDlkfgMSB&#xa;HuY4qA2YpkfF/N33fdRqyay3vBQu6r4gCBCl7IBSuYxSuZS4ll7sql2qHQWjXN/3NUZOG7nd3d1n&#xa;ZYydG9PGAku1Pv6Nc+zduw979+5NnIbdicnUtfHxcUxMTOD48eM4ceIEjh8/Ds441q1fh76+PvRL&#xa;S1ntTVIutjSVSiV9WIRul9FWMbgEnDNETPylXTnmRJvvHVCkomuEUIBSECos4xd378Y3HnoIv/LL&#xa;vyzK4lyPi4lv0056NQYqOw0Anty5E0/ufBIL8/MglILatmg3IUAUgUchDh87lsDPnbSOeiuNmXJY&#xa;q9VwamYG1LLBOQNnDEMrku4z5UslhACy3D179mLPnj3Yfvnlif4ASCwQxYxmUCOKIlSrVZ2bfOTI&#xa;ERw5ckS3fePGjbjzzjtjYXAGOnumNTEbEd/lFdmBCLtf2o3dL72EG264IfFoelWaTMw5R3exiO5i&#xa;EVtk2FExpqkyTYmUllKPPfY4HnvscXHNUjiU6narNvOII/R9RGGIMLX9eakFoeiExF2CmRwQm4LY&#xa;Dh576mk8u/tl/PIv/VJbeWZbO2WkmZ+r1Sq+/e1v44EH/gTUcUCoBWI7cTkAGOd4/oUXE1rMlNxq&#xa;vJ7+6S6Ac9x+23v0tXqzidn5eVDHAQtDcMYwPJrMASiVymg1W4BFAcuG7bg4cvwNPP/Ci7juundg&#xa;9aqJhPAw50Wlcvb09OhDPwCRy6GYtlQq4dChQzhw4ICOjC512mQnWh7TJgaX6hUIQGNDyEGzCMFi&#xa;qYyf/ORJDK8cwX/6hbsSE3Y6SlvE6Qk2t4Wnmf/7P/gB/vEf/wdeevklWI4LYlkglIBod5gRxaEU&#xa;rUoJ9XoD1UoVxQ5vkFyKXj90CAABdRxYmSyo42pmKC2ewP/zzW9h6+bNuHjLZl2eSWZ/1ISbVvw/&#xa;fevb+OZ3vgvL80C9DKhlgdoOQCk4AZSIOPbGSVSqVbjyYLp4fsTvP3z0x/jRI49g7erVIITADwLY&#xa;loV6vYGZuXlQLwNOAoARjIynjLVaFa3AF4vFywK2DTCGL//N3+Irf/d3OLxvr0h5zGb1nD744IN4&#xa;8KGHtHvuhz/8IV584UX87u/+btvRVVEU4Qtf+AK++MUvto3LcujMTKslm5BShFDBCFLCCokm/kBi&#xa;Jj72xgk89pMn8Z9+4a62yUpbyer3paSw+p6WzOa/3/72t7H/tddAbQeUWqC2nWRaasmFJq5F2Tym&#xa;5ufx/EsvYeXK4UQblhpAQgjK1SqI64K6nmAsxxN9th3YmSy+96NHAEqxcf260x7Cl24/IQTff+QR&#xa;PPv8cyiVyqCOC9vLiMXnuMY8CGnrt3zs/LdnsW71KqxfvTouV9bz7X8ukJBoAAAgAElEQVT+Z5yc&#xa;msK69euxWC6jXKmAcY6p2VlUanUQKcXhuJhZWMSTu8TBcWEQ4ImnnsHRN06CuB6o54HYDsAYOIsQ&#xa;co7/9vkviBer9PYC4Dg1NYUXXngB+/bt08KsXq9jZnYmESlNj8Ppvp+OCGJkmp4hPZiCEQWjUouC&#xa;UMEQIEQwB6GgaruKZQEccD0XruvhW9/471i5YgVGhoe1GjOlZSemXaoDnaTgCy/uxgu7d+P+++8H&#xa;AwexbFDLhu26gF5gkP/KxUYogijC6olxrJqYwDf+8s/F1m1jH1XnISH48G/+Z3z9f/wj7GwOdjYL&#xa;28uCUwq5rBE0G7jx2mvwv/7Gr+PKyy5FRm567FSW6lO5WkWlWsUH7rkHJ6emcWqxDDuThdPVBWLZ&#xa;QtLJxcYh4HLgt7DjkovxczffiDtuehdGVgyhWqtj7/4D2HvgAP733/99dA8MYPuVV2P9urWoLCwg&#xa;9H3s3b8f+w8fRotQcNsBLAcXb9mMomsjbDYRtJqYnDyOaq2GehhJpnUBzsGDADwMQIMWCtkMCtkM&#xa;EAQ4NT0lzobwW+AgAGOCrRS2v8DUkWlN9U+pBSJDnQrHWbYtsBaloI4DalmwbEf+bgGEauPixuuu&#xa;xZ23vht3vufd6E4dgJZmwE5Yr5N0Vfd89/s/wL8+/H3868MP49SpU3AyGWQKXbAdB5aUTjDhi+wX&#xa;tRyBF+UIfOZ/+zi2rl+HLevX6rJFVUmpSAjBe+/9EP7tpVfhdBXhFLrgFnvEQpWTFPg+PMvCVZds&#xa;wWWbL8K9P3crcq6LnOt07DMhBAvlMhbLFVyy4ypYuTy8gSHY2Tycrm6AErHY5EQJIw/gLEKjVsWG&#xa;8VFsHB/DaF8PFqensf/113Hg4OuYm5+Hk8vBzhXACRBWq+BhKObRdeF2FWFnMrC8LPwwRFirgkcR&#xa;eBjCssV8WtmsxtVREMBvNBCFAZjfAms1wVpNRPUaEAXgjAGMgQUheBQCnAmG1V6cC8e8neGBwbRK&#xa;Wqk/atuaUQm1YDkOqGXDcl0QSmHZdizRAPzwJzuxdvUqvPPqK9Fj7OY8HW5cDhFC8L0f/BAvvPAC&#xa;jk9OotjfD8fLIFMowHJcUFuqVColGrX0YrRdD04mAw4h8X/w1DPIeF6CaQEOzmN1rFrb4gTZnl54&#xa;vX1we/qQ7RuE5TpCEnGOiHEEzQaeP/IGXjx0DLe841oMdhWQdVOuMPkv5xz5XB5eJovs4DDgZWD1&#xa;DcIqFGEVuoXhKG4EiyIQLhk3CpHN5vDa9Cx2HzgIWq+iMXUSrufCcV14PX2wMxm4+TwotRBmsmBR&#xa;BM6EB8bOZGFnMrC9DDzLQpTNaUFj2bYQRJ4nNCmAoNkEIwSs5YvfHQdMzjlr1gXDRxEIg2BgAMC5&#xa;v1fhtHMPYwnEHoEYp1LXge24ovGWBdvLwMlkBXa0bUCq1WwuB8fz4BaKcL0MMsVuWJ6HiAOMcUSM&#xa;4b//n5/ARH/syFaT1um7ojQW5lIR3/e//Db+6aGvI5vPI5vLo9DTB9vLwM7mAcsCtSwhXS2JZYn4&#xa;lwPoXbsRpWI/SBQBjKF0ago2C7FhsA9rVwxhtOCh0WxiYXYW9WoVJ+bmUW80UW80cOz4ceRXjsHp&#xa;G4DT2w+72CvqkaqQRSHAIviVCoJaFQtHD8ElQAYMlDOsHh/FL935c/jQnXe0aY5f+K3fxZGpaRyv&#xa;+3CKPbCyeenqC8GiCIiEtc8ZAw8DOGAgTPz5zQZ4GALUAqcUVqEbVi4P2t0H7njg2SzguCC5LsDN&#xa;APkucMsGt22AWqatHbvzLEvwARgoY7ArJdBaGc2XdyFcnEOwMIcg8BFVyuCBLyRwvQrWbEomDoEw&#xa;lAs6umBQIWZaw+AictIJpbBdD7aXERLVcUBdD9l8AV42CzebRd/EGiEVegcAx4WTzYEBYISCEwIS&#xa;RQgbNQTNOtBq4U//5w9htK8Xo/29HY0R3bEOTB0xhnqrhXrLxzt/8UPIORa6VqxEYWglBtdtgOt5&#xa;yGRzoBZF6PvgUYTIDxCxCFEgXFxRFKFluTjeCITPkzGEzQb8ehWlE5NoLM6jcmISPBKDTCiB43h6&#xa;PLLFHmQHV8ApdMHJF+DmxEtIkq5rIRV5FCGqVRE16mgtzCFsNhA0G/jNX/wF/MYH7sZQT7yBEQC+&#xa;9eMn8NC/fB8/eP5ldA+PwO7pBfUysHJ5EMsGzxUA2wFsB9zLoWW74ISIseYcnEAsIGqBuVlwaoFb&#xa;tpxlrqSA/MwlPBJt50xc5/HQt7MJoWJBWBZIaQ6kPI/gse+hMfUGuN8C81sIy4uI6gKKcAklwJke&#xa;zwvBuES3XhoohBBYjgNiCcnqZLJwc3ktWcc3bUFh4xbAcQHHQ4vaIJzDIirDSp4JJSeZEgHMOedo&#xa;Lc5ifmYWG0ZXYv3oCD76vvcg53nozufgWGK1K8e8eCwVLTIY+rf+6L/hmd2voG9iNfom1qBv1WpY&#xa;tgs7Iyxu27IlXHFALXlUk5okzkGUxOIcURgg8n3USwtoNWqoLpYQhQEC30fEOZpBJIMRHD5j8AFE&#xa;HAhBEAQ+OAMIGAg4CIu0lOFSlXPGEPkBeBRhYWEO779mB95/7ZW48+rLAchDNjjHXKWK/+sfHsJf&#xa;/8uPkOnuhbV5G5orJtAYHJOq15h4xkAV4+nlQvT4mMGNsyWeEhzpUggATkSwwyJA9E9fRViaR7A4&#xa;j2BhHmFlURhtgQ/WbIhxjkJhoGmmPXfmteOGKQexgV+lj5DaDnI9vch394AOjyGwhMeAcKmeCBLS&#xa;RruWVBcpBeUcTjaPXFcL1ZaPw2+cwNcf+QmynoPuXA6ubYESgjAMcPHqCVy2MZlna0aZCIBLNm3E&#xa;ky++Ap5oNwEBEeEEY3IBFbWR/l4AQcTgRxFaEcNC00crCFANCHzmoGUXwGiEyArBOEfgCnTGOBdh&#xa;ZqlFOAgYZ0IISUOMMKHG0ayDBAGsmogQUdsCtygKXUXM1Zt4/tBR3Hl1HF0iAAqZDFb096GYy6LW&#xa;rAt1GwSgUSgMGq6CLdDeCj3eiegkSVxS/GxqA8IBrngcyXuVgWo8qj/rC0pLAqBbrgA9+hos30dY&#xa;rYLajsTHkfDaGPe2RVPPgQxDTLq2qCXcRpJZbc9DttCF4sg4ihNrEHT3I5RWNeEABQPVAQdIS1cy&#xa;EhQjURACuIVu9DgOgmYTU80GvvXMcyBRCIuFoBAM1mw0cOcN74CXz2PzaJxMkiDOccc7rsHf/+DH&#xa;sGwLQaOuB4YQgBIxaQQcFBwWOJphhGbE0GIMi60Q5SBEM2JohgzlkCFgDK2QgHEPzHXlqIoZYqY8&#xa;00xBtMFKCECkVQ9wgEUgvg8SBrCriyBBC1Z5HqRZQ86ycGR+EScXFvHb77sVxawIE1NKUchmcOlF&#xa;G7F25RCefP5FFFbXwZpNkDAAkapbzRUlADczS1UTicFt6d86cEzMlCaoTV3VZSbnQhmFZMsVsDxx&#xa;ulBYXgT3s2KcOAP35flhUSQfSDfu7MkihPwfIASUEFAJCSzHFREf24GTyWFo3Xq4QyuBvkHhazUk&#xa;MiXxEZHay6C+E6qvQ0IGYbln4eW74GY82J4nJBaliEAQEgruOJhv+Lh+y8Z48CT2U4PYU8jj4PQs&#xa;OGM4NTuL7hXDGoNTaRyCEFRDhnk/xGuVBo7VWjhabeFwpYE36i3MNAPMt0I0GIPPOCKl5AkBJ9Kv&#xa;K117OlRp+GSFrDUmQqlk6QPlroeo0I2o0A3m5cAyOZBqGdV6A3PlEt6xaT1WrxjURighBBnPw57X&#xa;DuLZ3S/BHhoBL3QD3WKPmRpHaOdOiglNd6JmOEgpqzwhqp3ix9i9yeMHU4BAeWASBUtIqbWfZYEW&#xa;uxEdeEkYhNIzw4NAYGUWJ0GdL8WSVjdeSY+YCfMDQwizeYQMsKgehSRpyWNeMwZASSUJOwDAcmy4&#xa;YR4sVwCLQrAoRBSGqMPCvuMnDQjbEblh2/o1aDSbOHDkKCLfh+W4wo0FIW0ZB0p+gJPNAK8s1hEx&#xa;od49JR2JCDsnsV9nqZKURObvHaQdV1Ia4IqBewaB7n5YJ48h5IAfhDg8PYObtm1JaJOuXA49hTxc&#xa;20bYaoGGASjj4DQ5tAlZmdDvS5C6p9N9p3neHO+lCuaMgXhZkN5BEOlRArUSvvGYNy4A0yZgsS5f&#xa;RL6obcN2bdD+QVBqg0i1EfOmsCg1gIo1avxFPYNYdUO6VCwqHPykUNBYlQAIfR8LfgunqlXkXQd5&#xa;eTKhmbvAGMP/dOlWnJyawk+aTVTnZ5HnHLmuImyb4I16C69XmjhYaYEBsKlQqbZ0exFCtbUcD4Bo&#xa;c2KiePI75wDVCxFK1opumiQFAE2Fnxvbb4B97DX0Th7EN37yDO67+Z1oBQFaQYjp+UUsVKuYK5fR&#xa;VyxgtlGF1WqAsgiEOtpfG9ehRxY8wcYGppX3M86EpLYdEcFTmJ9zIAzihWsavAaw5cY1sWaFeBDw&#xa;D4DjgbkZ2LkuhLU6YIXg1AZTkUjIBhGFcc/HEIOS9EYWFbW0J4FQC1YmL/IrIy4iNAkdIfslv1It&#xa;sIVRJLI8iDZcoFWtjLYR6DCxStuzXQ8ey+P/fmIXrt+wBjdsXNNxa/pAsQvrx8dwxcVbcejEcVgE&#xa;mMoXMU8aeLYSwiJE/KmRJ9JRwgl4wvFNoF1AqavGz+IjBzhVrArt6YgHQn1XC0BhQyV5LbD+YQRe&#xa;Dq899xjG7v5lNBbmUV+YR1haAAhBJp9HJp+HO7oBsF1ZFIstJ9U2ZeCkVoz4jWlIAADEccBPnQCO&#xa;vQZarwkfe74A5LoQrd2ijbyktRULp3gIuDFWgsEJ59LVRkFzBRB7FrAtQ+LKtw+dozcjTeaBUNDw&#xa;DPF2Y89xUJehZC1hDWmvmIhCMqlKUNFgisfS22y0BvcEFGYSjsxvsICfTk5juLcHW0dWoDefSa14&#xa;QTs2b8L4yAj+8399ANNuBqfcPkxaWeQymQTTCRin9YOBBolmyNgAJx2ksGozB5iJ/zgERDCvQa/i&#xa;OIWFiPXLIrBcATzfBavYB5sDBTeDfE8vWBRqQQFCgJ5e8EIBcOw2NW3KQmHfKAmZEijqIcsG6jXg&#xa;1EmgWQPxsrAWZ0EJELgZBGNrhSsQ6LB81VSSuArjB0OXgngeYMVhfkKVJGsv8lypcxiXJ5OLQQnA&#xa;4kHQRkCaCROiCbH6WmKFKcggeTt1EbAtG9VWgMmFMvoKqTdASsOs4Lkg3V3oyudRZQz1RgNO3kNy&#xa;WtFhxtvbZEqPuE9UuLCUSrNsg/WNAg1pnMS2RP9OIL0PUrPwbA60XhGyi1JQHkGNKyEE3PXAbAec&#xa;SHWeaitPVMpT9ab7zOOxVViTis/UbxlCJNUvo7ZEn0Vn0LZYzdRVNbmKoU3NjHMnO9kv4XRnUQTQ&#xa;ECDi7CduJPpSS/I5EZJDOrjkWAs3mAkPCIkbq9d/G7OT+H7E0juby2GyXMOj+w/jsvHhNj4LwhCu&#xa;ZcHJ5zCxajVemV1EaWEejpsFMh4UpwgD13w4NdlmWyA1JQF4aR68NA+UF6VjPALyXbDWX2yo0VQZ&#xa;6iuRyMi8RbmSJOPwnn7QxTkRenUzAFEVC6zJvIxIS6QUYB22D3E1ftxoglpAoi4lBfXPCl5JDwmn&#xa;FojflHUo538H80tVobVLB7lPIBeEdHVqKBnP+/mbYVLSKsDOGQMDQKJQT2C9UsbiK8/Dcj1YXgZe&#xa;oRtuV1Fk/6g/5dZS4sRcZGqstMQjHZg3fk4NKiEUbiaDuYaP2XIVj+47hEaljMBvyR23AWqNJqJI&#xa;nLn1+smTmKv5YF0OeOCL+T9dznmC6cyLRKQCVhbAX38V/MQxoNmIJ9O2wYdXAa4L4nqxoWYwZyyA&#xa;2icegGYOXugGWCikuWWJUeKI8baS9B00VaL49JpJ8m3c15hzTzMwHcrSt6vVaOLbxC/Q/nrNCEBs&#xa;0/Al23w2ZJtWoYo66aQMxtCq11HauxtOrgA7mwcfHIY1vhrI5mDJUKnOtwU0UwKIrbKEuoC+T9Ub&#xa;d9qQtHKVBhzwI47HDhzG7BvHUa+UUatWUK01UGk0Ech4/qFKDaS7H3b3UDxbXNUr+7fkMKQUvmWD&#xa;V8vA3DRQXQScTJwt1qyD1ysgtAieyQKRMugMSGFOZkLtSlyrfnNcwcCWfIbH/CWkrTlGqbGT3MQT&#xa;nEk6rMN2iWhK3cS/qfFIYHkVPCEG5jWwPzGfe5PJ1uoIHOAMnHHwiIIBAhZIpmQhQ1CvI6hVUDsx&#xa;Cdt1YbkuMv2DcHJ5ZAeHYecLcLp6xG4GaoEQS0o7xTw05ZwXTEr1d574RgiBm/HgeC72Tp3CzGsH&#xa;4deqaFUrIOAiSJHxUCh2werPgOYLsLr7xRYRCmOhcM0sAoqpSUlLwljNkUYNCAKQbBe0ZQ2AOC5o&#xa;swZkMlraEcU4xGAeObkipKzaor7I6mwXLFJWPonhJBe5qToQAIBQkoCbhBKhFYmR8CLLJxwAJTEO&#xa;Jmp0DS0H1Ra+tGAx6jcZXHWT6++xR0cP4JtItsJAaoAIgCgKQTkDoRGilmhgZPmgloUoDMEyIQJf&#xa;5NEGvg/LcdCYmYZl2/C6umFnssgPDMLNdyHTLxzORO5z0r5WPUhKIKqdBXKwoHY2CCYu9PXD2Xop&#xa;eBiChSGoReB4GYSEIqAW7HIkws+ZjMiEAgyjIg54xlLBAGlSl2oJqBmFis19LBaPnIvztrS643JB&#xa;cIPB5H+195Sn7XHZPybyCTgn4My4w0jm0bKRM+mqU+0goCQlObULDIbhxjVGVonZqk2iGZIDmfwz&#xa;3QOKGXV+hRobpQXks0riy1yUtGK40GQnes04OBErlTEOECZzTpjYd0UpoiBA5DdBLZEoHLaysBxH&#xa;RKRcFza14LkuWo06SpUKGkePyvQ5gloQoqd/AMXubnT19KCruweW7cCVmwNDxlK4i+iBczM5eJk8&#xa;1IRTy4JrO6hEQMgATuoiw0xuSTFDo0SrzdiHyoWIhIn1zMkX7jsLsBgEQBZEqQWu86vMJCHE6lIW&#xa;K6CSqa8lA8gFyhu1+F6D6QWTtI9FoiQDGwrtwUHMDBizzgQsU2hJqR5DS2hFYTK0qkyNGQHAkOx4&#xa;LMPPA6oum1IuL7VyuRZ4Gt9CZDmBhALfSexL5NtVqN0ScoWFCABQJwNic3gOk2zGQWUic61cQrNe&#xa;Q2VhAZbtIJPLw3Vd5Lq6YNk2LDvTdmSRmXhDILKmqNzmEinntvZCdOoTSU102pRIkWFlQ+N1yL1x&#xa;qpjU0zxeAHFOgnxQSTztcqJAs27gxZhpdUZbLFdh6ghVFzcXjbnwNBZVkwhD63Tua+J3bnwwoU0C&#xa;1xp91nWJZ95sZGswrWRVDikN5IRF4lJEhaoWh1tE2nnMORNbnMFBAxdRsRscROwkJQSOMSAZwhFF&#xa;EjezCM1qBSAEjWpFBBROWbAsG9lCAa7nIV8ows148DwPrueJvWlEBCkItWBZFJxHCAmLNzAKMaJV&#xa;oBmRjA0IcwjMCZHSTfplCSUg3DIkLQEokwk1atRU4dwsEfGvadws/6UUmD8lEnPARb6soWYVpl2K&#xa;AUx2VnBEQ3TDf8rj0Ug+2KnE0yazqDLNsuLPuh0adpyxwnOmpKTtWBEH5wxgFJwwUAAsUonUFJHc&#xa;XUupBc4YquUyXGcGmWwBVi4HksuBQIaFKeB5NmxbMpy0vFkkkqxbrabI+C9HaNkW/FpN5PRaFAwU&#xa;mVxOMnAGPf0DcJ2MEIIWleFlgCvXmx5AFn+WeanEbwF+Q+SoRpFw8bEIJAyENc8YUJ4XCo8SgCt3&#xa;HgFYBGY7wrfKjeTAtLQypHrbxPktgNWB2SljcakFZuDLFMsSoyStySU+iCO5JHFjJyxt3qaUe/pb&#xa;vA554rq2ORNtSWutFCS6wLTkuQft1XJD08TqS2Tmi4RfRASNWgURAaxCUaQl5gvSyLIACEMgiiIw&#xa;zuO0RteDRSmKff1y6IQR4tcbqJcXUa/XUK41kS8UUOgqIl8sIl/sFgvCEhY6V0YctcCpBQnGpZDk&#xa;wjkfBkDgg1QWgfKCZN6WcK6zCCTwBWMHgYybp4xGyEiV48rFYfxmOjS1GiVa6MUQkIh2NOtAvSr2&#xa;aylXoxprPb7JEGnandYZ5EIbRmmFstREt+UEpO/tIGR1nemFyttAU7Kxnco5S0oyrcbdNJ4ky9Ju&#xa;LxAit5Rb2jcr3FsG2A8jhJUKKgf3omYfhNfdAyebh53NIzMyClLsFc9atmg9IdKAIgjCAATiHWPE&#xa;spHpzSLX1w9KCRzbRqPeAGdiR+m+53eh1WoitD0ETgaWVxBBgHoFVhTCCX2xB8yXjBj6MTMQIlSo&#xa;2W6NXy0gs/QZJsT1RFBAZUqR9IyaMx5LLQ1xbRs4eRR47RWxsZBJ/MU4QOU9jIlFxnl79liiMUmN&#xa;aIL2ZCvQkVk4JJLoELwAELsr1YNLBWu0Ow8GE4sKCT/zy//OlhL5tOaxQXo3ri0YjKoECFtuwdFM&#xa;K36jjjzRxZJuIipUdthogAU+gnoZQWUB2d4+2Lk8rGwebt+g3IumyjcNizhCxxkBYxx2JiOS1SlF&#xa;sX9InA4YBmBhiFa9ipbnYZE3UG/4WKyK1/8EYYgoYiIQIhmTpiVjPAjtGFCNv2SkaHgM3MvG7ioG&#xa;uRtX3qhj/MazhMTZcT/+Z/BaBbxWBrEcAb2UoaTjFML4pZrTZJawofJN1tBXtbsqXiWxUyCNR41m&#xa;cg5ROYf+CrmwAXCF6bmweTjlcX8RIzC5lSE5bm8CpSRtnF9AJNNRWwQRqLTmqeOJjY8qEia3GVN1&#xa;dpYlGJqq7cdSmikhFzRbYBEDbTZhcYYqLLQcF45to7enF47jws2od2/FFjylVIcdwDkYZ2gFLRAQ&#xa;ENuB192LLKUYWLUalm3DoRYC30e9VkXg+5ieOolKpYJKuSJeusGl+4vIrDJIZjWteKmSWSYL1t0H&#xa;1t2PaHStwMByvKD8mMrLYPp7AcCxgMAH9r8CfuSAiLRRAli2yHHVdSHOHosigEUJ74CKOCrWo4To&#xa;akEgzhrQ6jp1Eo/2gJAk33IJ9fTpO0zfLoZCGIOUWMIdCi6CFkQBRgP7qIacznK8QExsq4rifFrF&#xa;jMbhHLaUhBaF7bpwMhn5XRzWoU50YQDCIIgNGEL1AtAH1bV1hiMKIrAowmKpBNuyxTYcy0Yun4dt&#xa;WeJwCNpBN8UgUEMaLhN+Iinh3EwWjuthxQhFrx8gCHx9nqzIYWihWq2JgyhsR2y59jJi+7XjCozs&#xa;ZcG9LJiXicVKyhhRfUk0jBBgZgooL4BPHQcaNclY8h7DRZZ43nAttZdtVNHps0YrCkiTeCGabrT0&#xa;VJh1G2UR1VbtuzVhkCFZFVR5k6SrSbbuGDGSv+UJI8SykO0qIjcwJM48cFw4uTzsbE4wo+0IKSwj&#xa;XhwErFUHwgjcbwFRiCiM3+pHaHyeAiFUbIhkHGHog3Gg1fRBCJEnnIhXJjm2OOo9l88hm83Bsm3Y&#xa;6t1TiFWcStjhnINHDBEggxIZUEKR7+4GpQSUUITyQLQw8BEGAfaeWkCZcZRhg9i2yLiyLJ3lD2rH&#xa;E6S2tRuDKELEMQMK7cpjrMoBFIpi2/3CKcD3xd6pRGjWjFRxYUQCCQiT5G8D3hiROJGeHvvZY2Zq&#xa;F3UmijHLSa6P04nOZP3iM0vdZUjgNGw6RxI7F5SkNY8+kge55Xv70b1th5bAcBxxBKSUvNSyxaRR&#xa;sQXcBcSAh75IJglaQtVFIRCEwqqVC8JxbBAWgrFIQkzBdKHvgxOg1WzqU7Ndz0M2k9FHv+e7iigU&#xa;umDLIAMl8VGYCYnORZRP4GMCTjhsx4WbycC2LDiWhTdyfai3IkR+GNsa5kQYaYEcMPIJEGPjlCRU&#xa;Eor3D4H0DQDD4wImzE+Dz04Dc1Pg87P6dJoEE7IInLN4t6tZuUk8dVF/bNMB7c+nJfnpaCkGS/im&#xa;JfZu89MaBZDz4lVN7d4Dg3kJpeLwi6ERHfPn3DhEl3FQMJFZRwCAghFxYB08D4RayFAKhD54FIDU&#xa;6ggaVY2hhNQVE6TBv6F3CSHgjCNiEephHZVSCY7rihcC+yEyGXE+qq3ajNTWlzRJyMDBwRgHIwwR&#xa;EbkWPIqAiMXaeylSNpxRZNpjkKxTcAfJZMGzOZCBYSDzGsAjsJkpgMTngJllCDzZqdSkek6yjQFL&#xa;lmGxa95aaszMEGJ6baQhSXtDkeBevqwmLYts3TgDz1Lz3APHBYkiYclaVGxwlIMswroK9CuGEz2g&#xa;XCSUB+Ag1AaxHCBbRMa2oU5jKboOajOz4JWaiJRJg8uypKonpiFCYFs2OOPwWz6mpk7ixBvHYTsO&#xa;bMfGwMAgunt6MDQ8DC/jwrLt+CA0jdfjP7ELREAixriePFMA6QldCj9qSqrEpMqNPxAArFkHWTkB&#xa;OrYW0ew0sLgQ36juVcGFtP4mQFtmWltFS1s8ul9nlLByFMz1gfahiG8TDSXKvki0aLnifPlkE82w&#xa;hiFmWfp0REvuhFW7VwUujc87EBpSMLBOm1DWquHvhWSUiMvDPSjFIqfID67Axv5BhGGEWrWKZqOO&#xa;SrmMMAwQRUxHxKiRr6uGkBIId1cY4vjRozh+7CgO7NsH13UxODQkmHjliDh3zHX1G9KhIIo8t4Ep&#xa;x77RH7MqTpUxg9gtJ3mDmPahwg5GcEH/zs1j5gUMousvQbjzYbn5TwZfAH1sps6kImmG06oo6X2Q&#xa;DSbxFZgcxyE3IaYOMxTbeQz20r7rzlJdew8kPNKnC2mhyo27mfHDhWHgpJ/WsPLjY5HEyUmq/UZw&#xa;SHy3bFgkTkYR52/Fq57KJBdIvEmJsSKlNLEsG47jolDsEplkYYQwCFAuLaIpXw9Ur1QRsvhFIcSy&#xa;4o2SHLrdke+j3mrhcLkMzjm8TAaZbBaj4xPo7u1BsbcXxa5u2I4NSxqDURCI1EBuqFhozR67oiA/&#xa;SyOLg8SZVZCzzkRn1cRRg0EIEccoERYBIQddMQIehMaeaFmPsgFUFpoSuVovcw2d9NzpBsO4N54n&#xa;fV4soMc/FpU8cbv6WUM27TmQN2k/rXxG1au263TEARwX6ujPJc6LPfYAAB7gSURBVEI/RmKvznGV&#xa;v0imSxs8CiLYxq6zGPsY96ny1fNGNEXsABYTYts2Cl1FZHN5FKMIrd4mGvUagkBstWk2m/EQEAKq&#xa;GQ56gRAi37rt+5idOYVyuQR3ago9PT3o7e9HV1dRvG8BEP1UErWTHaMnn+s+KTtM1aekaUJQcSmj&#xa;tFQ0ClanfEvHqKjaxLfcqNO4Zn4kMZOZ495JpiXxfpwQbv6Z1ZpASUtyA+4obZKgtNsO5IJJWEVL&#xa;xys5JByQkS/E+FV8J/EKh4mHjXfN6mK4Lk/rOhIzrSpLcTmlBMSypT9YSEPOGfxWC0HgIwgCNGp1&#xa;eWS6jyAQvlYexa+DV4cB8yiCzyLMzTRFdhnnyOayKHb3oFAooNDVhWpIEILCZgDhEcCkGuXG66Qs&#xa;G9yyEPWvlJOlWCM+fNkcuuQVoq/G7kwi9pi5rnzNEtMCkrdJKyGl0mckJuuMZWXcMlUTEO8IMRun&#xa;vidXabucJB0/pu8ngAxLy/Zr6a4kPEkogyWg9xkpce4B5xxEZbdzeQym7wufqGxEvLVCMiohUC/k&#xa;iK/HZ3sJDCfVqYm/RC/i5xVsIIDahkx0uyIQy0IunwehXboNYRghCHyEvo9qtYLA98V7XH0fdfki&#xa;5ygMBH60LSF9KUWr2cJMcwqz02L0SC4HDsCRg024mnrVTCJ2z1ILQcQQrBiD6ZfV6tbkVoMxNBuZ&#xa;E84h9qIZL+EgRDqOmEpNTAeUU0xHCAiJmUJjWp68LZ5ijrQ/mXPI9MjOJJcaCOHJdUTalyUAfeav&#xa;EhD6BS9aaJ0/2YJRjUL1n/getpqSGaUuUrLVNODMjij4oFU/kYaXzMeVndLGjxwULX2l2orBs/oc&#xa;70rlEBg2k/OQo3kQSjFERtFqNjE/N4t6rYqTk5MIfB9+JKJtttIQhMXqXJVXq2iNAcmguk5VH+eg&#xa;nMGaeQP+yomEBDEEqf6iBQoxb4CEIPJHWU+8dUde53JzaVp5JxilAwOY7ViKP3j7bzpjrVN5utwO&#xa;hXZwramsPyiDz+CpC5U4o7fbqPcPMJlmSGU2VX1xAX3VCrjrgjuejD3HpwjCZF5CxDzA/E7jvhMC&#xa;1/PizZIy5MoieUhFYpSME2m0FCbGrwQ8isAYASgHt8QbdUbHJ0AtG5fsuBJ+o4H5UzOoVis4+vpB&#xa;tJpNNJtNobZkMERJUb1wxMhLKS+DChoOWaCLcyBBEDM3AM5SijvJsUky5o0Q8VIVcBhMCr1HLMlg&#xa;JtOQZDVm2YYwkGhL4m3jceWIUf207KSwUnvPjH4kEw5J8lZpCxDOwYJAbItnkRy/lHblqX/PgeS5&#xa;BzKFTB1AHASIpGSLwgClPS8iM74G3thqEBbBkIcJBk74a3UjuZZa6jwnwgEwLk7rth1QmcAdSgZW&#xa;m+dUlMzEzgkJnDgMQrjcGGcAC9GsR6CEYGB4GIN0BBdtuwyRDN/OzZzC4f37UFpcQGlhQTxJKWzb&#xa;0a+W4gYTE6jdCgQ0DEEadbGIPQ+UpWeBxEjAUKkJgauYRb2qgTGRJEOteMw64Np4Y6M09lQ5Rrm6&#xa;LnMWtEWooF/cYg4u3snATZ82kkwlo3NilAkAFmsQZacELSBoIWqJdz9wI2CjX9EkuAvnS7boOBFZ&#xa;PIppI5HFTwCErRYq01NghAJhgPz6LfqUveSbvKnxB51wk2Zq7d+lNMay0mea8cT5W5wL+BD5gRxs&#xa;bsAOxM8jLgsqF0EuEJr4Lo6ZJ4TA9lyMrl6D8bVr9bHx5YUFVEuLOP76QSzMzaJaKoncA0vFXgwo&#xa;EclkclsqKSmFSEcLWS5kA0pwBZ2goI78n0xzJGIChEGjPCskfXibOu/AOEMMXEu8hANELSCuFo7U&#xa;LCwCvAyY6yEaXCnYUTGz8VYf8YjYiycYWzCp6JGYE27ZsGp12HOngICgGtZBwhYQhjL/mQn3JldZ&#xa;EecHE2zVYeFzVNhDqCfGIrBQnBvrV0oAAdz+IXg9fSDSRRQfg4QkUwGaafTYm9egnjMlqRgQSi1x&#xa;LKfc0pIMaRoYWk0CTKnSCWPHi4USIt6LAKoNBOq4sAtF5EYnEHX3ozo9LXYV1KpQ+FQlfOs9XIY1&#xa;ozF/mtKXuG5uwm4wRZ/elp7Cf+Zx853Kjf+NxzIBG4iqS6RD8mwevKcfvLtfNIoxcxT1mPIlrphw&#xa;iBAC1qwhWJiCHVH0RQU0ogh1pk5oN4MN508CHnAuVCATjWLylZCcM4StBizbBgsD+JUSCKHoWrUO&#xa;TqEAu9AFkslL7U8T2DYtYdU97dKZJKJrIstL5uhSw3qWAF+5g/RBFWqhSKlm6WuxlIvCCDXOEIIj&#xa;4kCTcTQYR8jF9vOAUkQ0C39gFGEfB+saBI4fAqlVBIMy6GPradTpTC0TawqRprfZqAWn0QaX/xdC&#xa;goeBxOYcegOlwrQxX6T+5ZoJzRNr0g8oXtX6vlAExtaBOw6inn6gUATPF7WKj9mRpzg2iWcT/xIK&#xa;2mogmjuJ8Mg+hEEdng94QRY9oYXjbDHpBrsAzKtdXgK0MxHRkXu4OBMhV59asEIHLHRRPX4Efr2M&#xa;fLEfuWI/wkGxE8Ht6RPvieVKfXdi3KTxljbizJdFK8xEZTmWZcl5km4UQDAvZ2CMoxZxhATwIyaP&#xa;wRfoyWeCURsMCDlHyDiaHGhFTLz0g3FwxwUhgKWmLFsQWFsPtp59aTSaZMbQ2okv8RmAwH2+LzAg&#xa;Vwo37mPCNEiUQDpe7dQe/ZlzoH8I6B0Etx0Q1439wQqXop2pTIna3i8CUIJo908RTB5CMDuFVmsO&#xa;VquKfECRiwhWRD2oszoqPAB7syJi6uRE1TAWiXdwKWwZ2TYatRKsFoO90ABvleENDsHu7hZva9Rn&#xa;WxmMmRgCI5igjbfk/TH2MrEfZKCBaImtDKuIhagwjibjWGQELRA0OEcgGZSp51T9nIt3KUCc/dvx&#xa;jAvFOOowZzmp2mAx+2RKJSL9slxp65ROV985hESVr69X0jpWpoqRjFYRIrlQScNOsES1Ry0AQ1u5&#xa;Xly3XHzc0EgJUuohTcZt6qi04LWXEVQWEQRNhEETraiGJmthnrWwjW3EHCOoo4IIJsY5d0oGF+RH&#xa;xuQ7sThD6Ivf2P/b3pn9SJLcdfwTGZl1dlX13T19zvTOzuzttb0+AbOy1jIgJLAQsgQS4g3xxL/A&#xa;v4F48ht+AIMxwhbwYmMjWbZsr3d2dnemZ3Z6jr6768ysPCKCh8jMyurp7un1k0fqn9RHZWVkZkR8&#xa;8xe/O+KYWEqUSvhUsoLnlXG9MoPIR2w/wjzukTQn8F6+jqhUENXaiIPmCtO4MpWbnDL52BkVZ87a&#xa;OIW2BUEYIRxq9TrtgU83jPnhwEE6AlemYY/GatgyDZs8OSfZfJ/khDnP0RqT2DywQli1NZ5n10h/&#xa;2Zdw1DpjkgLzdKarESNAxSEqGOQ4zl6q3MOWKwMmvf64S92kXxWeJr9ONpsiN1+JbDll9Ls4IOZp&#xa;oKYdHCtyJ0BLF0clOEmM971/pbETIEMXGU7hBBITtawSFicEesCamWdVz7BvjviIByfv/InpRN2D&#xa;HLYYnZmnEmI0ZVWm7EiumQV+rn9p63NJSTmqIb0S5aSOe+ghn9xicnKRmZuvIRfmcCdaI2nJSQvT&#xa;kfNbBFmhaDEqnJZZFjLum1khHGcE+lTedaSkVC5TDuIsl3JsSjKj/Vg1lhwlJ4XF9JxUESWvtZUq&#xa;WwLLoWQheo3UY5c9azqxmTfrqXoEhfuboY8JfFs21CuhM49V9jYVufKYpSC9d1FYzoBlDAZNvqdE&#xa;dp2cKZ/se0bFFyK9v7EcP18NpWv3yjjYRt+9RXL3Fv2DHV7vL7ITbfMw3KY/3IUoSm21CZgEDLRo&#xa;0GKCT3OTHQ7Z4fA3Vs5OjT3INVdjMELxQrKOFgYlDL80tyjrCkIm4Dgkica4HjoOMa7DV6pf5Hg4&#xa;4HH3f9GeYGp9g/rCMvXFZeRE0xbHyJb+LHkx46ap3AoFUOcihEm5cPatfb5SuUy9XMXpt/MKW3ag&#xa;ySSadF6L61ph7igyoHGFyi7belxz1wYhZP5MmY03C4YZmXTG07hHQsKo78n2VpqOX+CNJ8WJ4kNn&#xa;EkbWvyJlL6vAAjZNdLSnWcfFU6uLScdFjJrbs9OXVKY7yjvg+APYfB/9ZIvhvduYOEan++L+eHCf&#xa;q/Esb8XXuB0G7MbbqS3ewWhbg6JjenTosc0eV1lig2Xu8xj9GwD3zICZbJmeYxLfBMQoYhKEMmiR&#xa;7RubsjZtmBQNWqrFY/GYQMWEDgjl4h/so+OEqNelPrdIdX4B6ZWQad2D3OyVjXuuhI0Am4E3m50c&#xa;5KNWJ4B42sQLRqb5p74al0sz019mFM+VMTu7QqY7rRet9CcpB9iJYxmoHBd1uJdWkxRPNyQbl7SX&#xa;J0SZjGuOy8+j78bvW3hD0/7Z7mbHC4WbjcHRGhFHmE4fEQ1xul2EPyB58jFxZ99u2BxH6DjChENk&#xa;pOgmxzyIfVqqTmyaDHVAYILxlxWDxnBElwY1lphjQMCQiIDwlEE8nU4FbY0KFVOmShmDoWP6KKFI&#xa;SJBGYnSMSlPDK4mgKWvUYkEk+zwKHyNciTus4nolVDBksLuLLJWYmJ1nde01VKMKzRrVmVmrpct0&#xa;c5GiFeGEeWwUv1D4cRyEESOQFpfUM4B78pgpLrGF5dHaqhWZQjZaIiWUy4wrRQX5cgwtYgwo2V8T&#xa;RaCHRHdu5Q6MPBds7HFPVAHPu2lXgvwZRk9Q6J4Y56oj22Buj7fbxBqM30cMfZvDFkW2CvowQHeO&#xa;IPBRx4fUQ4HXH6CSHuGwC3GEiSNUECDDIT3Vo5PELCQtltUMXdOjaxw6pp+xmfzROvTRaCaoscAM&#xa;ASFDQvY4uhDfHQNthTIVSlxjKb/RoWkzx+ToJGUHuKRLeHi0dAPpuAySiI7TYyou29TyyMWRAjcU&#xa;CNfgeAkLPsRHd9CNMqpRwlxZxG02qCxfwZuoj8IanUJmRIHTjv+MLAJnVWEx+dL3dAnK0+I/8lF1&#xa;S5BWgzRKWVtrOtHOlTWbVTu2OTEjMbRwmfEj6TEpoX2AONhF+gOS84JIChVwzBn9GFshCjJP5oYW&#xa;mBEwkwQnGFhwDvo2hiKOaPgGf3CAE8XIKIFO2ypSYQiJRkdDasqjEXrIZIqdKEAlBqUMRAIiz0YH&#xa;ao1SERXtUWOGZTNL3wwYEhESF7WKbHaoUaHFBC6SSRp8xFbh29PpBGhLtJhglQX6BPTxWWKOMV+J&#xa;ESijaJg6DWo0aXBgOihjqItpBBK0QOCm4CuD60DisGHm+Uju4KgYOXAJ2j3c+Rnc5gReYwKR1uDK&#xa;xISCnDD+OTuWDYPI1ZdR2zGOVZzZjAMVUrQLlzVg99xy7DZIJlXGsmJ1NKfT4nOAUadzu0z+EE+h&#xa;CqSHEwQ4h7t4pQpx6I9Gt8jR8+fOrnFCiC0qVylIRXG80r/CaIRQ4Pft/mFH+xAMEAd7EIaY4ZBJ&#xa;NUukDihpiaccZCwQSuJEJVAaJwStElqRy2zSQMYDYhUSqRAnsWOTxx8bTWJiJpigaeqss8ghHdr0&#xa;kch8LLLeJCgqlKhSZopmDtrzKAftEnOUcDmgzXf54dMLaWHcb5qr9PHZw+HX+i5CC7IMB6FtHIGM&#xa;7V5SUax51b3OK/I6/xT+G05sC3tI16NSb+D6D6kcbOKWysy9/BoTV5aZXNvA9WzJozFuCyOxIFWA&#xa;UMYqR5mEVjCWi/zjSNwX6Rrs5CpbUctKr5HEyLUXQMXo7YdQquJMzSCmZnFWrmGicCSLazOWgJlX&#xa;ys6mJpOP01gG7/5tkif3CHfu8WLzBTaDuxhlMEozTNTI4J/VS8j6pDW6IBYhbcZDpjTLOEIc7oDf&#xa;w/g9KkcdomGXqH0AYYROwtSMl8YDRDFGK7ROcOI2a8kMj/QOd9U2MraikU7i9NwobWtrWfxJ8jab&#xa;ZptN/TED5Y+n2RRWDgNssEyLCY7p8jHbT+Gq+LmExzt8gSfs8YQ9jumfCloxz7RZZJp92uxy9Eyv&#xa;xRd4jR4++xyzzzGZ3JarRQXjPwK+Id9hUz5m03lM7BlKpaotxuG6eNWqNZfVJ3BLZZrlBpOVKerr&#xa;qyQLDVY+9Xm7uXQa3Z9FYGX38KSLrzS+0nz38TEOVoEcH7aM4xVMRibTpEdZuONLbCovpiae7GUw&#xa;GFtR8QRI88i14nRk3C8LgwwGiH6H5L/+hSQJieMhb/jL3I03UUahTIJwJUZKEg0qSah846+Rc1eQ&#xa;U7OYJLb7fQUDzNBHHO9jOocQ+JhggG4foaPQgkwpmnGZhqnha58dfYATJ6kzI7YZHtqWNTVKEyYB&#xa;v6te59Acc6iP2Yv3rGk4jdAyysr2NgJPI3TMDXOVG2adH+gfEpnU7Z8L0eNLe4sJNlhmhhb/zU/P&#xa;xRfAMvMsMUfAkD2O2eNo7HtxgzXzLJbsINhgmQ2WucU9HrN/ztkWxC+Ja7wkrvF95//QwtYYkK7d&#xa;3dxWr3Hw0rpgTqUMruRP619jq7TPk3oH6XqUGw1aS6s0l1a48ubn8EoVMhAKR+JKh0hpQq35562j&#xa;cStDwcOUrdiZQJHncWXnFK0XjMZdFNoWWUO2MUiRw45Rxl2FAK+E6BxhfvUT9L0PiP0BOhqioiE3&#xa;gjm6cYcefXqmb9PzpS3wJ4Sg+vm30YD2ezDoMdVWhCIhJCEkGm3tpFNAqThNilT4SY8behWZwKba&#xa;sjbn1GFiTAbEVNlUmlj7vGFu8Ia5wbfVf6aRdun1VRoXm8V+oHCNxDUO3zBf5dviB2Tx2GdRhRJl&#xa;SnyZN7jLI+7y8Fy5FWCDJZpM0KHPFjuolKFK4O/PMzc4OLzKC0gc2vQ4pENIfOb5IJgXUzRFnTY9&#xa;dsVRtgiTa9OGVHa18vE0LVbNPD3hc6TbBIT5zjpGa5JwSDQY5NYDr1q1ZZnsFXGF4L22PxIhC1Aa&#xa;eZty41F6/KRpadRqTII8cb3cIJC3OQW2mUPEkYjH9zE7W6iHm+h+B+X76DCEaEg9lFRih6EKGKi+&#xa;Dd/Lltp0oxDda6N7XbTfpxwavERQTzza8THEMTqKc9OTiUK7lMcxJg7xYkM9cplMquwne5gktgqW&#xa;SizAUzndJDYUUhrBUA9pqRrGJPh6ALmsyuhvrmYaPCQLYgaAAcE5uMiEMZPKtuAzPPd8gIiEOhUW&#xa;mOGYXj43p8JdIpE4rLNIlTL7tDmgTUxy7k1usk5JeBzTY48jIpGQeYusA8Fq/giB4zrU5QTr3ioz&#xa;copflDcRrkzFBo9KbQJZsjXEyvUJptY3mJiapzE9z9TSKvXlRTzXxXNdvnN3m77S+MqkpTzTwc31&#xa;pPElXRTclic5bXoS2cHcxASpcjO6rkjNXqaoLIYB5nAH0++gbv8S3WsTH+5iooik37XgiSNmoiqv&#xa;JOt8zCPum0c4wu4AZMtOOXaXnqyWrxCUHZdVFlkxi/yP+TGOknl8hEmrnGecF53ganhRr3DNrPB9&#xa;/SOMsTIsJlUws36mpfIdY93mX9ZvckSbB+YJPfyCsyn/lbct4fEmNwkYEhByl4fn4sPBYZZJpmmi&#xa;0dxJzz+L6zo4zDHFDC36DOgwwN1geewkg6FKmRoValQo4XGfJ9SosMrCmQ+TtVlhgX1zTEDICvOj&#xa;dXlsnbZyZ0V7zIlZSkmZtnPEXFzFcSRuWLYyr+/geA6OB+5Ao/uPoDTAKbc5XNqht7FEZXqK6vQk&#xa;rzerbAUx9/2YxJDWds2wds4ydIqmOQbiUyZqRJlFw5YuJQyRh7s4nQ7y4ZY1yh91LOfzXUykMUEV&#xa;Eg+SEpXEYV1NoxgQ0UOSOhocmZcDzdKBQKBEzAyCeePygmkR6WQkimg12lIpC3oymrLRhKbHF82L&#xa;tOnS1X2rhBaVpsx5ktLADFhgmhY1djhAZZaWM4bymC4LTPMia7SY4ID2aIPvM2iCGtM0maZJQEhA&#xa;RESMc0abIWFqyTLjoLVea8M0TZrUaVLn12yyzpWxRxi3Ptp207SYZZJ9jmlQw8PFSZORxvzvWqS1&#xa;eQ2TNJgUTQIiYhExayatmQwXEonUHk7sWlenLqONx1w0wVzY4oNgm87ePtWVRaoriyy/9Qa+Mjwa&#xa;KiKlT+36adA1Y/+P9+wsqBe7Y4SD0BoR+DidNu4H7+F2B9SOA0pKUgnqiDhBBC4kMSKsIbK9HhLN&#xa;nG4QME1MhIebixYIRuBNEywTFDPUqQIvmVV6up8v36MwQ8gcBzZ00xCagE9zg20O2DOHSFNIZMzb&#xa;jA6FRMzQopTeLSYeF63GRkIQkTBJgwmqfJaX+ICP85X6rLHTaCJiPscrtOlzTI8+Pm4qOoyuPpqb&#xa;mASJHBcP6lSpU+Ul1nnADg/YPmPaxmmDZWpU2OGQA9rnn1xA/jfF17klNnnPuWuPyVQWdNPADNdD&#xa;pvuVqZLDK5WXqHhVym6VW9UnVKqTVmlxPYxXYWppBfnKZ+hMLTIo121KidZP31+n4kEqIY0BV4g8&#xa;NDNb7sesA9LFMQrRbUOvjX64Sbz5HhOxRz1y6UbH+MmAvm+1eTUcYJIYPQwgSewmISYNxlEJf6f/&#xa;ip/yLj/lXatoZHEZhfuPXKySFjWa1HjTvMq/mx/kfaBY2ecECDHwZ+ZrPGKX99mkZwbPnFOJw2d4&#xa;mTe5wT/ynWeen9F1VlhghofsssXOhdrcYI0XWeMnvMsx3Ween4N2nSssMktEzC/44MIP+ee8w2P2&#xa;eZ97tOld4IaCz/EKb/EK3+J7JEIRiySVGkYuXCvzyrxmrvQkf+v9BT+XH/Iz+SHlygROpYzwSlYG&#xa;rNTA9RCVqnUNr17HzMxhrt5ENKZRRQfDqXGKIzKAoxXO0IcoxBzugN+3m9Ud7KGPrFKj4xgdRURR&#xa;n+V4mqV4igfhx/SSLr3wCKMS9DC0yk4cWXNUHNvl3GiMiflL/pgPuM9t7uMT2BEaq0MgTvyvMCj+&#xa;hm/yD+bbkBr6xr1zJxBrjW+8wQ0whl/x0TPnCazIV6XMF3mdOzzkzgUM/wCv8QIuEhfJz7h9oTYA&#xa;b/NZtjngkM65zE8A5g/5Mm163OHhszllSjdZ5wbrvM89julydIE3BODrfIn91Pb2iL3RU6T/jLIb&#xa;QAi7DZQWij+Qb3PbfUDfCek7QzyvjCiV0xBJF1Gu2P8rNYTroaRgVs5Qq7YYeAp/pgnlCpTKiHI1&#xa;VW7S26q0dtYwgDii5UMc+fhBm0RFqGiY2yutaclySaNidBgSRQOuqUWuqkVuRx/SV316cQeTgdWk&#xa;ipLO4hlIgaX5ffMWB6LNAcfscghPCTYnP1sQ/h6f4R7b9OjTzZjFmUlkljZYZpZJOvT58BPEtf4R&#xa;v0OXAXfYYveEzfQseoEVNlhmjyN2OWKHwwu1+wqfJiRiSMSvuHPqOe6rbPCYfXr4FzJBAFxliRIe&#xa;h3Q4pnvhCJ1FZhAIQmK6nLFEZQZ/AzjGvrGmRIMqHdEm1gbjGFQqZwmlEDKxOfzSRWiDcD0iF0py&#xa;EqFDuu4xmCCvnSW8UmrBABA2G0FrdBKiVcL1aJWjJKIb91A6GYE21dKLKdI22ikAFSGVsoEkOkIn&#xa;UcEwr8e9RmQdhDa9NHikyu7pA3Lq0QOOucYSW2yPQHsOCQQd+rnClAVjn28ptXSHh0zRoEmdfdoX&#xa;Sps5pss9YJUFImI69C+EkwfsMEGVCWosM0+PwVNYcQVwl4fEJM80ZwFcZ5UZWhzRZZuDC3FYDxcX&#xa;l9e5zl0eckR3/EEKGvyYsm4UV8Q861zhgX5MR3dwhN3d3CSJ3fcr33UnsKKEVwYpmfamqckhA7dP&#xa;x9mmIitjlWOKadykjobEJCijWNUrDEwbXz/OC1CYzNCexJgkGYE4iVEqwNFTlHWMTgZo46P10AJU&#xa;aWxQfQbYAmgNPGGPOTPFCvNs8oiLwQgesM1X+TwJEU/YJWFUGOMsOqZHhwELzDDHFAOGz7StAtxh&#xa;ixUWWGOBeab5Ce8WZ+tUOkpX3xIeVSosMssT9q1T5Bn9mkwDxmeZZJIGuyd0JfcW9y40TFM0maLJ&#xa;IjPcYYsBAf0LdBjgCrOsssA+x8+041myTzRvZpgzk8zQ4j/Ej+w8C40Rxm5Wp0Y1cJ00YBl3CELw&#xa;WfdT7DsdtuQTED6xHKS2YgeTZ0Vk90vrxRqDZwTKHBKZXYZ6F1c7VhbNtHSl821ITfrZ6CGuiagY&#xa;jVFDDCEY64AxmYKUx+QWbZ7QY8AaC6yxeKGxzMhnSJsuAsEMrWcu25lh/yG7tOnxJd7gI7a4w1YK&#xa;+PNphwMa1LjGEuss0qZ/IR3mNveZZ4pl5pljkne5Q4I6955terTpMSBgmibLzDNDKw+mcS/2XlvQ&#xa;brDMfiqjfBKaZZKXuMq3+N4najfPNAC7HBKZmBxleSypAWE1bluV3AGTYIRmWU1x6BwycDoIYVAy&#xa;HnHXonYOKdMzuMalQomBbhPRx+gApR1GlVksxxR5nK3NBEbHCDQyNdobrKs0f9b0Hhl3LZJC4+HR&#xa;pP6JxgYsVxoS0mTiwnMyICBgyHVWOaLLPR5dCLQJih0OCYlYYxHDzoVAC7DPMUvM8TJX+YgHDIku&#xa;dM8D2iQobrLGGgvcSV2/Z3rELumSflvp7BqPl3RJv6V0CdpLeu7oErSX9NzRJWgv6bmjS9Be0nNH&#xa;l6C9pOeOLkF7Sc8dXYL2kp47ugTtJT139P84WGaZUimIJgAAAABJRU5ErkJggg==&#xa;" id="image3163"/>
- <rect width="282.94818" x="28.049149" y="81.03817" rx="0" height="279.91772" ry="0" style="fill:none;fill-opacity:1;stroke:none;stroke-width:5.44153594999999960;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="rect2995"/>
- </g>
- <g id="layer2"/>
-</svg>
diff --git a/demos/quick3d/quick3d.pro b/demos/quick3d/quick3d.pro
deleted file mode 100644
index 0459eb93..00000000
--- a/demos/quick3d/quick3d.pro
+++ /dev/null
@@ -1,2 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS = model_viewer robo_bounce tea_service flickr3d
diff --git a/demos/quick3d/robo_bounce/main.cpp b/demos/quick3d/robo_bounce/main.cpp
deleted file mode 100644
index 07f7f219..00000000
--- a/demos/quick3d/robo_bounce/main.cpp
+++ /dev/null
@@ -1,71 +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/QApplication>
-#include "qgltexture2d.h"
-#include "qdeclarativeview3d.h"
-
-int main(int argc, char *argv[])
-{
-#ifdef Q_OS_SYMBIAN
- QGLTexture2D::setMaxImageSize(256,256);
-#endif
-
- QApplication app(argc, argv);
-
- QDeclarativeView3D view;
- view.setSource(QUrl(QLatin1String("qrc:///qml/robobounce.qml")));
-
-#ifdef Q_OS_SYMBIAN
- view.setAttribute(Qt::WA_LockLandscapeOrientation, true);
- view.setResizeMode(QDeclarativeView::SizeRootObjectToView);
- view.showFullScreen();
-#else
- if (QApplication::arguments().contains(QLatin1String("-maximize")))
- view.showMaximized();
- else if (QApplication::arguments().contains(QLatin1String("-fullscreen")))
- view.showFullScreen();
- else
- view.show();
-#endif
-
- return app.exec();
-}
diff --git a/demos/quick3d/robo_bounce/qml/Assets/QML3DSign.png b/demos/quick3d/robo_bounce/qml/Assets/QML3DSign.png
deleted file mode 100644
index b4bfb88b..00000000
--- a/demos/quick3d/robo_bounce/qml/Assets/QML3DSign.png
+++ /dev/null
Binary files differ
diff --git a/demos/quick3d/robo_bounce/qml/Assets/button.png b/demos/quick3d/robo_bounce/qml/Assets/button.png
deleted file mode 100644
index 2943e240..00000000
--- a/demos/quick3d/robo_bounce/qml/Assets/button.png
+++ /dev/null
Binary files differ
diff --git a/demos/quick3d/robo_bounce/qml/Assets/calculatorSign.png b/demos/quick3d/robo_bounce/qml/Assets/calculatorSign.png
deleted file mode 100644
index 3a8fca72..00000000
--- a/demos/quick3d/robo_bounce/qml/Assets/calculatorSign.png
+++ /dev/null
Binary files differ
diff --git a/demos/quick3d/robo_bounce/qml/Assets/cubeButton.png b/demos/quick3d/robo_bounce/qml/Assets/cubeButton.png
deleted file mode 100644
index 2ea32a8b..00000000
--- a/demos/quick3d/robo_bounce/qml/Assets/cubeButton.png
+++ /dev/null
Binary files differ
diff --git a/demos/quick3d/robo_bounce/qml/Assets/hazard.png b/demos/quick3d/robo_bounce/qml/Assets/hazard.png
deleted file mode 100644
index a7c0b7fe..00000000
--- a/demos/quick3d/robo_bounce/qml/Assets/hazard.png
+++ /dev/null
Binary files differ
diff --git a/demos/quick3d/robo_bounce/qml/Assets/infobutton.png b/demos/quick3d/robo_bounce/qml/Assets/infobutton.png
deleted file mode 100644
index e7379f2d..00000000
--- a/demos/quick3d/robo_bounce/qml/Assets/infobutton.png
+++ /dev/null
Binary files differ
diff --git a/demos/quick3d/robo_bounce/qml/Assets/qtlogo.png b/demos/quick3d/robo_bounce/qml/Assets/qtlogo.png
deleted file mode 100644
index 3bf1a77d..00000000
--- a/demos/quick3d/robo_bounce/qml/Assets/qtlogo.png
+++ /dev/null
Binary files differ
diff --git a/demos/quick3d/robo_bounce/qml/Assets/roboInfo.png b/demos/quick3d/robo_bounce/qml/Assets/roboInfo.png
deleted file mode 100644
index b7bdda19..00000000
--- a/demos/quick3d/robo_bounce/qml/Assets/roboInfo.png
+++ /dev/null
Binary files differ
diff --git a/demos/quick3d/robo_bounce/qml/Assets/roboticArms.3ds b/demos/quick3d/robo_bounce/qml/Assets/roboticArms.3ds
deleted file mode 100644
index 478d27bf..00000000
--- a/demos/quick3d/robo_bounce/qml/Assets/roboticArms.3ds
+++ /dev/null
Binary files differ
diff --git a/demos/quick3d/robo_bounce/qml/Assets/roboticBody.3ds b/demos/quick3d/robo_bounce/qml/Assets/roboticBody.3ds
deleted file mode 100644
index ed872c82..00000000
--- a/demos/quick3d/robo_bounce/qml/Assets/roboticBody.3ds
+++ /dev/null
Binary files differ
diff --git a/demos/quick3d/robo_bounce/qml/Assets/roboticHead.3ds b/demos/quick3d/robo_bounce/qml/Assets/roboticHead.3ds
deleted file mode 100644
index 7a517c2b..00000000
--- a/demos/quick3d/robo_bounce/qml/Assets/roboticHead.3ds
+++ /dev/null
Binary files differ
diff --git a/demos/quick3d/robo_bounce/qml/Assets/rotateButton2.png b/demos/quick3d/robo_bounce/qml/Assets/rotateButton2.png
deleted file mode 100644
index 80a2d82a..00000000
--- a/demos/quick3d/robo_bounce/qml/Assets/rotateButton2.png
+++ /dev/null
Binary files differ
diff --git a/demos/quick3d/robo_bounce/qml/Assets/sQt3D_logo.png b/demos/quick3d/robo_bounce/qml/Assets/sQt3D_logo.png
deleted file mode 100644
index 92a071d3..00000000
--- a/demos/quick3d/robo_bounce/qml/Assets/sQt3D_logo.png
+++ /dev/null
Binary files differ
diff --git a/demos/quick3d/robo_bounce/qml/Assets/tronscape.png b/demos/quick3d/robo_bounce/qml/Assets/tronscape.png
deleted file mode 100644
index 325f60e3..00000000
--- a/demos/quick3d/robo_bounce/qml/Assets/tronscape.png
+++ /dev/null
Binary files differ
diff --git a/demos/quick3d/robo_bounce/qml/Calculator/Calculator.qml b/demos/quick3d/robo_bounce/qml/Calculator/Calculator.qml
deleted file mode 100644
index b31688ae..00000000
--- a/demos/quick3d/robo_bounce/qml/Calculator/Calculator.qml
+++ /dev/null
@@ -1,187 +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 "CalculatorCore"
-import "CalculatorCore/calculator.js" as CalcEngine
-
-Rectangle {
- id: window
-
- width: 640; height: 480
- color: "#282828"
-
- property string rotateLeft: "\u2939"
- property string rotateRight: "\u2935"
- property string leftArrow: "\u2190"
- property string division : "\u00f7"
- property string multiplication : "\u00d7"
- property string squareRoot : "\u221a"
- property string plusminus : "\u00b1"
-
- function doOp(operation) { CalcEngine.doOperation(operation) }
-
-
- states: [
- State {
- name: "hidden";
- },
- State {
- name: "shown";
- }
- ]
-
- transitions: [
- Transition {
- from: "*"
- to: "hidden"
- SequentialAnimation {
- NumberAnimation {target: window; property: "opacity"; to : 0.1; duration: 1000; easing.type:"OutQuad" }
- PropertyAction {target: window; property: "visible"; value: false}
- }
- },
- Transition {
- from: "*"
- to: "shown"
- SequentialAnimation {
- PropertyAction {target: window; property: "visible"; value: true}
- NumberAnimation {target: window; property: "opacity"; to : 1.0; duration: 1000; easing.type:"OutQuad" }
- }
- }
- ]
-
- Item {
- id: main
- state: "orientation " + runtime.orientation
-
- width: parent.width; height: parent.height; anchors.centerIn: parent
-
- Column {
- id: box; spacing: 8
-
- anchors { fill: parent; topMargin: 6; bottomMargin: 6; leftMargin: 6; rightMargin: 6 }
-
- Display {
- id: display
- width: box.width-3
- height: 64
- }
-
- Column {
- id: column; spacing: 6
-
- property real h: ((box.height - 72) / 6) - ((spacing * (6 - 1)) / 6)
- property real w: (box.width / 4) - ((spacing * (4 - 1)) / 4)
-
- Row {
- spacing: 6
- Button { width: column.w; height: column.h; color: 'purple'; operation: "Off" }
- Button { width: column.w; height: column.h; color: 'purple'; operation: leftArrow }
- Button { width: column.w; height: column.h; color: 'purple'; operation: "C" }
- Button { width: column.w; height: column.h; color: 'purple'; operation: "AC" }
- }
-
- Row {
- spacing: 6
- property real w: (box.width / 4) - ((spacing * (4 - 1)) / 4)
-
- Button { width: column.w; height: column.h; color: 'green'; operation: "mc" }
- Button { width: column.w; height: column.h; color: 'green'; operation: "m+" }
- Button { width: column.w; height: column.h; color: 'green'; operation: "m-" }
- Button { width: column.w; height: column.h; color: 'green'; operation: "mr" }
- }
-
- Grid {
- id: grid; rows: 5; columns: 5; spacing: 6
-
- property real w: (box.width / columns) - ((spacing * (columns - 1)) / columns)
-
- Button { width: grid.w; height: column.h; operation: "7"; color: 'blue' }
- Button { width: grid.w; height: column.h; operation: "8"; color: 'blue' }
- Button { width: grid.w; height: column.h; operation: "9"; color: 'blue' }
- Button { width: grid.w; height: column.h; operation: division }
- Button { width: grid.w; height: column.h; operation: squareRoot }
- Button { width: grid.w; height: column.h; operation: "4"; color: 'blue' }
- Button { width: grid.w; height: column.h; operation: "5"; color: 'blue' }
- Button { width: grid.w; height: column.h; operation: "6"; color: 'blue' }
- Button { width: grid.w; height: column.h; operation: multiplication }
- Button { width: grid.w; height: column.h; operation: "x^2" }
- Button { width: grid.w; height: column.h; operation: "1"; color: 'blue' }
- Button { width: grid.w; height: column.h; operation: "2"; color: 'blue' }
- Button { width: grid.w; height: column.h; operation: "3"; color: 'blue' }
- Button { width: grid.w; height: column.h; operation: "-" }
- Button { width: grid.w; height: column.h; operation: "1/x" }
- Button { width: grid.w; height: column.h; operation: "0"; color: 'blue' }
- Button { width: grid.w; height: column.h; operation: "." }
- Button { width: grid.w; height: column.h; operation: plusminus }
- Button { width: grid.w; height: column.h; operation: "+" }
- Button { width: grid.w; height: column.h; operation: "="; color: 'red' }
- }
- }
- }
-
- states: [
- State {
- name: "orientation " + Orientation.Landscape
- PropertyChanges { target: main; rotation: 90; width: window.height; height: window.width }
- PropertyChanges { target: rotateButton; operation: rotateLeft }
- },
- State {
- name: "orientation " + Orientation.PortraitInverted
- PropertyChanges { target: main; rotation: 180; }
- PropertyChanges { target: rotateButton; operation: rotateRight }
- },
- State {
- name: "orientation " + Orientation.LandscapeInverted
- PropertyChanges { target: main; rotation: 270; width: window.height; height: window.width }
- PropertyChanges { target: rotateButton; operation: rotateLeft }
- }
- ]
-
- transitions: Transition {
- SequentialAnimation {
- PropertyAction { target: rotateButton; property: "operation" }
- RotationAnimation { direction: RotationAnimation.Shortest; duration: 300; easing.type: Easing.InOutQuint }
- NumberAnimation { properties: "x,y,width,height"; duration: 300; easing.type: Easing.InOutQuint }
- }
- }
- }
-}
diff --git a/demos/quick3d/robo_bounce/qml/Calculator/CalculatorCore/Button.qml b/demos/quick3d/robo_bounce/qml/Calculator/CalculatorCore/Button.qml
deleted file mode 100644
index ab10fcae..00000000
--- a/demos/quick3d/robo_bounce/qml/Calculator/CalculatorCore/Button.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 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
-
-BorderImage {
- id: button
-
- property alias operation: buttonText.text
- property string color: ""
-
- signal clicked
-
- source: "images/button-" + color + ".png"; clip: true
- border { left: 10; top: 10; right: 10; bottom: 10 }
-
- Rectangle {
- id: shade
- anchors.fill: button; radius: 10; color: "black"; opacity: 0
- }
-
- Text {
- id: buttonText
- anchors.centerIn: parent; anchors.verticalCenterOffset: -1
- font.pixelSize: parent.width > parent.height ? parent.height * .5 : parent.width * .5
- style: Text.Sunken; color: "white"; styleColor: "black"; smooth: true
- }
-
- MouseArea {
- id: mouseArea
- anchors.fill: parent
- onClicked: {
- doOp(operation)
- button.clicked()
- }
- }
-
- states: State {
- name: "pressed"; when: mouseArea.pressed == true
- PropertyChanges { target: shade; opacity: .4 }
- }
-
- transitions: [
- Transition {
- from: "*"
- to: "pressed"
- SequentialAnimation {
- NumberAnimation {target: button; property: "scale"; to : 0.8; duration: 200; easing.type:"OutQuad" }
- }
- },
- Transition {
- from: "pressed"
- to: "*"
- SequentialAnimation {
- NumberAnimation {target: button; property: "scale"; to : 1.0; duration: 200; easing.type:"OutQuad" }
- }
- }
- ]
-}
diff --git a/demos/quick3d/robo_bounce/qml/Calculator/CalculatorCore/Display.qml b/demos/quick3d/robo_bounce/qml/Calculator/CalculatorCore/Display.qml
deleted file mode 100644
index 23da6f59..00000000
--- a/demos/quick3d/robo_bounce/qml/Calculator/CalculatorCore/Display.qml
+++ /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$
-**
-****************************************************************************/
-
-import QtQuick 1.0
-
-BorderImage {
- id: image
-
- property alias text : displayText.text
- property alias currentOperation : operationText
-
- source: "images/display.png"
- border { left: 10; top: 10; right: 10; bottom: 10 }
-
- Text {
- id: displayText
- anchors {
- right: parent.right; verticalCenter: parent.verticalCenter; verticalCenterOffset: -1
- rightMargin: 6; left: operationText.right
- }
- font.pixelSize: parent.height * .6; text: "0"; horizontalAlignment: Text.AlignRight; elide: Text.ElideRight
- color: "#343434"; smooth: true; font.bold: true
- }
- Text {
- id: operationText
- font.bold: true; font.pixelSize: parent.height * .7
- color: "#343434"; smooth: true
- anchors { left: parent.left; leftMargin: 6; verticalCenterOffset: -3; verticalCenter: parent.verticalCenter }
- }
-}
diff --git a/demos/quick3d/robo_bounce/qml/Calculator/CalculatorCore/calculator.js b/demos/quick3d/robo_bounce/qml/Calculator/CalculatorCore/calculator.js
deleted file mode 100644
index 7c363c7f..00000000
--- a/demos/quick3d/robo_bounce/qml/Calculator/CalculatorCore/calculator.js
+++ /dev/null
@@ -1,91 +0,0 @@
-
-var curVal = 0
-var memory = 0
-var lastOp = ""
-var timer = 0
-
-function disabled(op) {
- if (op == "." && display.text.toString().search(/\./) != -1) {
- return true
- } else if (op == squareRoot && display.text.toString().search(/-/) != -1) {
- return true
- } else {
- return false
- }
-}
-
-function doOperation(op) {
- if (disabled(op)) {
- return
- }
-
- if (op.toString().length==1 && ((op >= "0" && op <= "9") || op==".") ) {
- if (display.text.toString().length >= 14)
- return; // No arbitrary length numbers
- if (lastOp.toString().length == 1 && ((lastOp >= "0" && lastOp <= "9") || lastOp == ".") ) {
- display.text = display.text + op.toString()
- } else {
- display.text = op
- }
- lastOp = op
- return
- }
- lastOp = op
-
- if (display.currentOperation.text == "+") {
- display.text = Number(display.text.valueOf()) + Number(curVal.valueOf())
- } else if (display.currentOperation.text == "-") {
- display.text = Number(curVal) - Number(display.text.valueOf())
- } else if (display.currentOperation.text == multiplication) {
- display.text = Number(curVal) * Number(display.text.valueOf())
- } else if (display.currentOperation.text == division) {
- display.text = Number(Number(curVal) / Number(display.text.valueOf())).toString()
- } else if (display.currentOperation.text == "=") {
- }
-
- if (op == "+" || op == "-" || op == multiplication || op == division) {
- display.currentOperation.text = op
- curVal = display.text.valueOf()
- return
- }
-
- curVal = 0
- display.currentOperation.text = ""
-
- if (op == "1/x") {
- display.text = (1 / display.text.valueOf()).toString()
- } else if (op == "x^2") {
- display.text = (display.text.valueOf() * display.text.valueOf()).toString()
- } else if (op == "Abs") {
- display.text = (Math.abs(display.text.valueOf())).toString()
- } else if (op == "Int") {
- display.text = (Math.floor(display.text.valueOf())).toString()
- } else if (op == plusminus) {
- display.text = (display.text.valueOf() * -1).toString()
- } else if (op == squareRoot) {
- display.text = (Math.sqrt(display.text.valueOf())).toString()
- } else if (op == "mc") {
- memory = 0;
- } else if (op == "m+") {
- memory += display.text.valueOf()
- } else if (op == "mr") {
- display.text = memory.toString()
- } else if (op == "m-") {
- memory = display.text.valueOf()
- } else if (op == leftArrow) {
- display.text = display.text.toString().slice(0, -1)
- if (display.text.length == 0) {
- display.text = "0"
- }
- } else if (op == "Off") {
- Qt.quit();
- } else if (op == "C") {
- display.text = "0"
- } else if (op == "AC") {
- curVal = 0
- memory = 0
- lastOp = ""
- display.text ="0"
- }
-}
-
diff --git a/demos/quick3d/robo_bounce/qml/Calculator/CalculatorCore/images/button-.png b/demos/quick3d/robo_bounce/qml/Calculator/CalculatorCore/images/button-.png
deleted file mode 100644
index 544e5145..00000000
--- a/demos/quick3d/robo_bounce/qml/Calculator/CalculatorCore/images/button-.png
+++ /dev/null
Binary files differ
diff --git a/demos/quick3d/robo_bounce/qml/Calculator/CalculatorCore/images/button-blue.png b/demos/quick3d/robo_bounce/qml/Calculator/CalculatorCore/images/button-blue.png
deleted file mode 100644
index 5f92de32..00000000
--- a/demos/quick3d/robo_bounce/qml/Calculator/CalculatorCore/images/button-blue.png
+++ /dev/null
Binary files differ
diff --git a/demos/quick3d/robo_bounce/qml/Calculator/CalculatorCore/images/button-green.png b/demos/quick3d/robo_bounce/qml/Calculator/CalculatorCore/images/button-green.png
deleted file mode 100644
index 36c93914..00000000
--- a/demos/quick3d/robo_bounce/qml/Calculator/CalculatorCore/images/button-green.png
+++ /dev/null
Binary files differ
diff --git a/demos/quick3d/robo_bounce/qml/Calculator/CalculatorCore/images/button-purple.png b/demos/quick3d/robo_bounce/qml/Calculator/CalculatorCore/images/button-purple.png
deleted file mode 100644
index 347cbbea..00000000
--- a/demos/quick3d/robo_bounce/qml/Calculator/CalculatorCore/images/button-purple.png
+++ /dev/null
Binary files differ
diff --git a/demos/quick3d/robo_bounce/qml/Calculator/CalculatorCore/images/button-red.png b/demos/quick3d/robo_bounce/qml/Calculator/CalculatorCore/images/button-red.png
deleted file mode 100644
index 3b335891..00000000
--- a/demos/quick3d/robo_bounce/qml/Calculator/CalculatorCore/images/button-red.png
+++ /dev/null
Binary files differ
diff --git a/demos/quick3d/robo_bounce/qml/Calculator/CalculatorCore/images/display.png b/demos/quick3d/robo_bounce/qml/Calculator/CalculatorCore/images/display.png
deleted file mode 100644
index 9507f438..00000000
--- a/demos/quick3d/robo_bounce/qml/Calculator/CalculatorCore/images/display.png
+++ /dev/null
Binary files differ
diff --git a/demos/quick3d/robo_bounce/qml/Calculator/CalculatorCore/qmldir b/demos/quick3d/robo_bounce/qml/Calculator/CalculatorCore/qmldir
deleted file mode 100644
index a926b93f..00000000
--- a/demos/quick3d/robo_bounce/qml/Calculator/CalculatorCore/qmldir
+++ /dev/null
@@ -1,2 +0,0 @@
-Button Button.qml
-Display Display.qml
diff --git a/demos/quick3d/robo_bounce/qml/RobotCore/PushButton.qml b/demos/quick3d/robo_bounce/qml/RobotCore/PushButton.qml
deleted file mode 100644
index 8cc48744..00000000
--- a/demos/quick3d/robo_bounce/qml/RobotCore/PushButton.qml
+++ /dev/null
@@ -1,69 +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 Qt 4.7
-import Qt3D 1.0
-
-Image {
- id: theButton
- property bool bounce: false
- source: "../Assets/button.png"
- width: 40
- height: 40
-
- signal pressed
-
- SequentialAnimation {
- running: theButton.bounce
- NumberAnimation {target: theButton; property: "scale"; duration: 50; to: 0.8;}
- NumberAnimation {target: theButton; property: "scale"; duration: 50; to: 1;}
- onCompleted: {theButton.bounce = false}
- }
-
- MouseArea {
- anchors.fill: parent
- onClicked: {
- theButton.bounce=true
- theButton.pressed()
- }
- }
-}
-
-
diff --git a/demos/quick3d/robo_bounce/qml/RobotCore/QMLPanels.qml b/demos/quick3d/robo_bounce/qml/RobotCore/QMLPanels.qml
deleted file mode 100644
index 874436dd..00000000
--- a/demos/quick3d/robo_bounce/qml/RobotCore/QMLPanels.qml
+++ /dev/null
@@ -1,102 +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 Qt 4.7
-import Qt3D 1.0
-
-Item {
- Rectangle {
- id: buttonBox1
- x: 30
- y: 110
- width: 60
- height: 160
- opacity: 0.5
- color: "black"
- border.color: "#2D918D"
- border.width: 2
- radius: 5
- }
- PushButton {
- x: buttonBox1.x+10
- y: buttonBox1.y+10
- }
- PushButton {
- x: buttonBox1.x+10
- y: buttonBox1.y+60
- }
- PushButton {
- x: buttonBox1.x+10
- y: buttonBox1.y+110
- }
-
- Rectangle {
- id: buttonBox2
- x: 550
- y: 110
- width: 60
- height: 160
- opacity: 0.5
- color: "black"
- border.color: "#2D918D"
- border.width: 2
- radius: 5
- }
- PushButton {
- x: buttonBox2.x+10
- y: buttonBox2.y+10
- }
- PushButton {
- x: buttonBox2.x+10
- y: buttonBox2.y+60
- }
- PushButton {
- x: buttonBox2.x+10
- y: buttonBox2.y+110
- }
-
- states: [
- State {},
- State {}
-
- ]
-}
-
-
diff --git a/demos/quick3d/robo_bounce/qml/RobotCore/Robot.qml b/demos/quick3d/robo_bounce/qml/RobotCore/Robot.qml
deleted file mode 100644
index c696b794..00000000
--- a/demos/quick3d/robo_bounce/qml/RobotCore/Robot.qml
+++ /dev/null
@@ -1,51 +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 Qt 4.7
-import Qt3D 1.0
-
-Item3D {
- id: robot1
- scale: 0.3
- mesh: Mesh { id: roboMesh; source: "../Assets/roboticBody.3ds"; }
- effect: Effect {}
-}
-
-
diff --git a/demos/quick3d/robo_bounce/qml/RobotCore/TronCube.qml b/demos/quick3d/robo_bounce/qml/RobotCore/TronCube.qml
deleted file mode 100644
index 9e352602..00000000
--- a/demos/quick3d/robo_bounce/qml/RobotCore/TronCube.qml
+++ /dev/null
@@ -1,50 +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 Qt 4.7
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-
-Cube {
- effect: Effect {color: "#aaaaaa"; texture: "../Assets/qtlogo.png"; decal: true}
- position: Qt.vector3d(0,-5.01, 0)
-}
-
-
diff --git a/demos/quick3d/robo_bounce/qml/robobounce.qml b/demos/quick3d/robo_bounce/qml/robobounce.qml
deleted file mode 100644
index c9e412b0..00000000
--- a/demos/quick3d/robo_bounce/qml/robobounce.qml
+++ /dev/null
@@ -1,609 +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 Qt 4.7
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-import "Calculator"
-import "RobotCore"
-
-Image {
- property real eyeSeparation: 0.0 //Eye separation: 0.1 for 3d, 0.0 for standard
- property real repeatAnimationTimer: 30; //Auto click the 'start' button this often
-
- id: theBackground
- width: 640
- height: 480
- source: "Assets/tronscape.png"
-
- focus: true
- Keys.onSpacePressed: {
- heartbeat.restart();
- qt3dButton.bounce = true;
- console.log("Hide Calc")
- if (calc.state=="hidden") {
- calc.state="shown"
-
- } else {
- calc.state = "hidden"
- };
- }
- Keys.onLeftPressed: {
- console.log("Rotate Key Pressed");
- heartbeat.restart();
- room.spinning = true;
- }
- Keys.onRightPressed: {
- console.log("Box Drop Key pressed");
- heartbeat.restart();
- smallCube.fallingCubeAnimation=true;
- }
- Keys.onUpPressed: {
- console.log("Info Key Pressed");
- heartbeat.restart();
- roboInfo.showVisible=true
- }
- Keys.onPressed: {
- heartbeat.restart();
- if (event.key==Qt.Key_A) {
- navigator.spindir=1
- } else if (event.key==Qt.Key_D) {
- navigator.spindir=2
- } else if (event.key==Qt.Key_W) {
- navigator.tiltdir=1
- } else if (event.key==Qt.Key_S) {
- navigator.tiltdir=2
- } else if (event.key==Qt.Key_Plus) {
- navigator.zoomdir=1
- } else if (event.key==Qt.Key_Minus) {
- navigator.zoomdir=2
- }
- }
- Keys.onReleased: {
- heartbeat.restart();
- if (event.key==Qt.Key_A) {
- navigator.spindir=0
- } else if (event.key==Qt.Key_D) {
- navigator.spindir=0
- } else if (event.key==Qt.Key_W) {
- navigator.tiltdir=0
- } else if (event.key==Qt.Key_S) {
- navigator.tiltdir=0
- } else if (event.key==Qt.Key_Plus) {
- navigator.zoomdir=0
- } else if (event.key==Qt.Key_Minus) {
- navigator.zoomdir=0
- }
- }
-
- Timer {
- id: navigator;
- interval: 5;
- running: true
- repeat: true
- property int tiltdir: 0 //1 is forward, 2 is back
- property int spindir: 0 //1 is right, 2 is left
- property int zoomdir: 0 //1 is in, 2 is out
- onTriggered: {
- if (tiltdir==1) {roomTilt.angle=roomTilt.angle+0.5}
- else if (tiltdir==2) {roomTilt.angle=roomTilt.angle-0.5}
- if (spindir==1) {roomSpin.angle=roomSpin.angle+0.5}
- else if (spindir==2) {roomSpin.angle=roomSpin.angle-0.5}
- if (spindir==1) {roomSpin.angle=roomSpin.angle+0.5}
- else if (spindir==2) {roomSpin.angle=roomSpin.angle-0.5}
- if (zoomdir==1) {
- if (theCamera.fieldOfView>13) {
- theCamera.fieldOfView=theCamera.fieldOfView-0.5
- }
- } else if (zoomdir==2) {
- if (theCamera.fieldOfView<80) {
- theCamera.fieldOfView=theCamera.fieldOfView+0.5
- }
- }
- }
- }
-
-
- Timer {
- id: heartbeat;
- interval: theBackground.repeatAnimationTimer*1000;
- running: true
- repeat: true
- onTriggered: {
- qt3dButton.bounce = true;
- console.log("Hide Calc")
- if (calc.state=="hidden") {
- calc.state="shown"
- } else {
- calc.state = "hidden"
- }
- }
- }
-
- Viewport {
- id: viewport
- width: 640
- height: 480
- navigation: true
- picking: true
- //showPicking: true
-
- Item {
- visible: false
- id: buttonPanel
- state: "panelUp"
- states: [
- State { name: "panelDown";},
- State { name: "panelUp";}
- ]
-
- transitions: [
- Transition {
- from: "*"
- to: "panelDown"
- SequentialAnimation {
- PropertyAction{target: buttonPanel; property: "visible"; value: true}
- PauseAnimation{duration: 10}
- PropertyAction{target: buttonPanel; property: "visible"; value: false}
- PauseAnimation{duration: 10}
- PropertyAction{target: buttonPanel; property: "visible"; value: true}
- PauseAnimation{duration: 10}
- PropertyAction{target: buttonPanel; property: "visible"; value: true}
- PauseAnimation{duration: 10}
- PropertyAction{target: buttonPanel; property: "visible"; value: false}
- PauseAnimation{duration: 10}
- PropertyAction{target: buttonPanel; property: "visible"; value: true}
- }
- },
- Transition {
- from: "*"
- to: "panelUp"
- SequentialAnimation {
- onStarted: { console.log("Panel Up"); }
- NumberAnimation {target: buttonPanel; property: opacity; to: 0; duration: 2000;}
- PropertyAction{target: buttonPanel; property: "visible"; value: false}
- }
- }
- ]
-
- Rectangle {
- id: buttonBox1
- x: viewport.width-175
- y: 10
- width: 160
- height: 60
- opacity: 0.5
- color: "black"
- border.color: "#2D918D"
- border.width: 2
- radius: 5
- }
- PushButton {
- source: "Assets/rotateButton2.png"
- x: buttonBox1.x+10
- y: buttonBox1.y+10
- onPressed: {
- console.log("Rotate Pressed");
- room.spinning = true;
- heartbeat.restart();
- }
- }
- PushButton {
- source: "Assets/cubeButton.png"
- x: buttonBox1.x+60
- y: buttonBox1.y+10
- onPressed: {
- console.log("Box button pressed");
- smallCube.fallingCubeAnimation=true;
- heartbeat.restart();
- }
- }
- PushButton {
- source: "Assets/infobutton.png"
- x: buttonBox1.x+110
- y: buttonBox1.y+10
- onPressed: {
- console.log("Info Button Pressed");
- roboInfo.showVisible=true
- heartbeat.restart();
- }
- }
- }
-
- Rectangle {
- id: roboInfo
- x: 5
- y: 85
- width: 150
- height: 175
- opacity: 0.0
- color: "black"
- property bool showVisible: false
- border.color: "#2D918D"
- border.width: 2
- radius: 5
- Image {
- source: "Assets/roboInfo.png"
- }
-
- SequentialAnimation {
- running: roboInfo.showVisible
- NumberAnimation {target: roboInfo; property: "opacity"; to: 0.7; duration: 500}
- PauseAnimation {duration: 3000}
- NumberAnimation {target: roboInfo; property: "opacity"; to: 0.0; duration: 500}
- onCompleted: {roboInfo.showVisible=false}
- }
- }
-
- Calculator {
- id: calc
- }
-
- Image {
- id: qt3dButton
- source: "Assets/sQt3D_logo.png"
- property bool bounce: false
-
- x: 10
- y: 5
- width: 110
- height: 70
-
- SequentialAnimation {
- running: qt3dButton.bounce
- NumberAnimation {target: qt3dButton; property: "scale"; duration: 100; to: 1.2;}
- NumberAnimation {target: qt3dButton; property: "scale"; duration: 100; to: 1;}
- onCompleted: {qt3dButton.bounce = false}
- }
-
- MouseArea {
- id: qt3dActivate
- anchors.fill: parent
- onClicked: {
- heartbeat.restart();
- qt3dButton.bounce = true;
- console.log("Hide Calc")
- if (calc.state=="hidden") {
- calc.state="shown"
- } else {
- calc.state = "hidden"
- }
- }
- }
- }
-
- camera: Camera {
- id: theCamera
- eye: Qt.vector3d(0, 2, 10)
- nearPlane:2.5
- center: Qt.vector3d(0,2,0)
- fieldOfView: 12
- eyeSeparation: theBackground.eyeSeparation
- }
-
- Item3D {
- id: scene
-
- states: [
- State { name: "qmlView"; when: calc.visible},
- State { name: "threedView"; when: !calc.visible }
- ]
-
- transitions: [
- Transition {
- from: "*"
- to: "qmlView"
- SequentialAnimation {
- PropertyAction{target: roomSpin; property: "angle"; value: 0}
- PropertyAction{target: roomTilt; property: "angle"; value: 0}
- PropertyAction{target: buttonPanel; property: "visible"; value: false}
- PropertyAction{target: theCamera; property: "eye"; value: Qt.vector3d(0, 2, 10)}
- PropertyAction{target: theCamera; property: "fieldOfView"; value: 11.45}
- PropertyAction{target: spinSign; property: "angle"; value: 0}
- PropertyAction{target: robot; property: "position"; value: Qt.vector3d(0,10,4)}
- PropertyAction{target: pitch; property: "angle"; value: -15}
- PropertyAction{target: roll; property: "angle"; value: 0}
- PropertyAction{target: yaw; property: "angle"; value: 0}
- PropertyAction{target: spinSign; property: "angle"; value: 0}
- PropertyAction{target: innerCube; property: "scale"; value: 0.95}
- PropertyAction{target: signCube; property: "scale"; value: 2.375}
- PropertyAction{target: headroll; property: "angle"; value: -45}
- }
- },
- Transition {
- from: "*"
- to: "threedView"
- SequentialAnimation {
- onStarted: {console.log("start")}
- SequentialAnimation {
- NumberAnimation { target: theCamera; property: "fieldOfView"; to: 20; duration: 1000; easing.type: "InOutQuad" }
- ParallelAnimation {
- NumberAnimation { target: spinSign; property: "angle"; to: 720; duration: 500; easing.type: "InOutQuad"}
- NumberAnimation { target: innerCube; property: "scale"; to: 1.01; duration: 500}
- }
- }
- PauseAnimation {duration: 1000}
- ParallelAnimation {
- NumberAnimation {target: theCamera; property: "fieldOfView"; to: 40;
- duration: 1000; easing.type: "InOutQuad"}
- Vector3dAnimation {target: theCamera; property: "eye"; to: Qt.vector3d(0,4,10);
- duration: 2500; easing.type: "InOutQuad"
- }
- }
- PauseAnimation {duration: 1000}
- NumberAnimation {target: signCube; property: "scale"; to: 0.0; duration: 2500; easing.type: "InOutQuad"}
- Vector3dAnimation {target: robot; property: "position"; to: Qt.vector3d(0,0,4); duration: 1000; easing.type: "OutBounce"}
- PauseAnimation {duration: 500}
- NumberAnimation { target:pitch; property: "angle"; to: -90; duration: 2500; easing.type: "InOutElastic"}
- NumberAnimation { target: theCamera; property: "fieldOfView"; to: 20; duration: 1000; easing.type: "InOutQuad" }
- NumberAnimation { target: headroll; property: "angle"; to: 0; duration: 500; easing.type: "OutElastic"}
- NumberAnimation { target: headyaw; property: "angle"; to: 30; duration: 70; easing.type: "InOutQuad"}
- NumberAnimation { target: headyaw; property: "angle"; to: -30; duration: 70; easing.type: "InOutQuad"}
- NumberAnimation { target: headyaw; property: "angle"; to: 30; duration: 70; easing.type: "InOutQuad"}
- NumberAnimation { target: headyaw; property: "angle"; to: -30; duration: 70; easing.type: "InOutQuad"}
- NumberAnimation { target: headyaw; property: "angle"; to: 30; duration: 70; easing.type: "InOutQuad"}
- NumberAnimation { target: headyaw; property: "angle"; to: -30; duration: 70; easing.type: "InOutQuad"}
- NumberAnimation { target: headyaw; property: "angle"; to: 30; duration: 70; easing.type: "InOutQuad"}
- NumberAnimation { target: headyaw; property: "angle"; to: -30; duration: 70; easing.type: "InOutQuad"}
- NumberAnimation { target: headyaw; property: "angle"; to: 00; duration: 100; easing.type: "OutQuad"}
- NumberAnimation { target: theCamera; property: "fieldOfView"; to: 40; duration: 1000; easing.type: "InOutQuad" }
- PauseAnimation{duration: 1000}
- ParallelAnimation {
- SequentialAnimation {
- NumberAnimation {target: roll; property: "angle"; to: -20; duration: 500; easing.type: "InOutBack"}
- PauseAnimation{duration: 1000}
- NumberAnimation {target: roll; property: "angle"; to: 0; duration: 500; easing.type: "InOutBack"}
- }
- Vector3dAnimation {target: robot; property: "position"; to: Qt.vector3d(0,0,0); duration: 2000; easing.type: "InOutBack"}
- }
- PauseAnimation{duration: 500}
- SequentialAnimation {
- PropertyAction{target: buttonPanel; property: "visible"; value: true}
- PauseAnimation{duration: 50}
- PropertyAction{target: buttonPanel; property: "visible"; value: false}
- PauseAnimation{duration: 40}
- PropertyAction{target: buttonPanel; property: "visible"; value: true}
- PauseAnimation{duration: 100}
- PropertyAction{target: buttonPanel; property: "visible"; value: false}
- PauseAnimation{duration: 40}
- PropertyAction{target: buttonPanel; property: "visible"; value: true}
- PauseAnimation{duration: 150}
- PropertyAction{target: buttonPanel; property: "visible"; value: false}
- PauseAnimation{duration: 40}
- PropertyAction{target: buttonPanel; property: "visible"; value: true}
- PauseAnimation{duration: 300}
- PropertyAction{target: buttonPanel; property: "visible"; value: false}
- PauseAnimation{duration: 40}
- PropertyAction{target: buttonPanel; property: "visible"; value: true}
- }
- }
- }
- ]
-
- effect: Effect{}
-
- Light {position: Qt.vector3d(20,5,00)}
-
-
- Item3D {
- id: room
- property bool spinning: false
- transform: [
- Rotation3D{id: roomTilt; angle: 0; axis: Qt.vector3d(1,0,0)},
- Rotation3D{id: roomSpin; angle: 0; axis: Qt.vector3d(0,1,0)}
- ]
-
-
- NumberAnimation {
- running: room.spinning
- target: roomSpin
- property: "angle"
- to: 360
- duration: 3000
- easing.type: "InOutQuad"
- onCompleted: {
- room.spinning=false
- roomSpin.angle=0
- }
- }
-
- TronCube {
- id: smallCube
- property bool fallingCubeAnimation: false
- position: Qt.vector3d(0,5,0)
-
- onClicked: {
- heartbeat.restart();
- console.log("Small cube clicked");
- smallCube.fallingCubeAnimation=true;
- }
-
- transform: [
- Rotation3D {id: spinSmallCube; angle: 0; axis: Qt.vector3d(0,1,0)}
- ]
-
- SequentialAnimation {
- running: smallCube.fallingCubeAnimation
- onCompleted: {smallCube.fallingCubeAnimation=false;}
- ParallelAnimation {
- NumberAnimation {target: spinSmallCube; property: "angle"; to: 360; easing.type: "InOutQuad"; duration: 1750}
- SequentialAnimation {
- Vector3dAnimation {target: smallCube; property: "position"; to: Qt.vector3d(0,3.2,0); easing.type: "InQuad"; duration: 250}
- PropertyAction {target: robotHead; property: "z"; value: -9.0;}
- ParallelAnimation {
- NumberAnimation {target: smallCube; property: "x"; to: 2; easing.type: "Linear"; duration: 1500}
- SequentialAnimation {
- NumberAnimation {target: smallCube; property: "y"; to: 4.5; easing.type: "OutQuad"; duration: 250}
- NumberAnimation {target: smallCube; property: "y"; to: 0.5; easing.type: "OutBounce"; duration: 1250}
- }
- }
- }
- }
- PauseAnimation {duration: 500 }
- NumberAnimation { target: robotHead; property: "z"; to: -9.2; easing.type: "OutBounce"; duration: 250 }
- PauseAnimation {duration: 500 }
- NumberAnimation { target: headyaw; property: "angle"; to: 30; duration: 70; easing.type: "InOutQuad"}
- NumberAnimation { target: headyaw; property: "angle"; to: -30; duration: 70; easing.type: "InOutQuad"}
- NumberAnimation { target: headyaw; property: "angle"; to: 30; duration: 70; easing.type: "InOutQuad"}
- NumberAnimation { target: headyaw; property: "angle"; to: -30; duration: 70; easing.type: "InOutQuad"}
- NumberAnimation { target: headyaw; property: "angle"; to: 30; duration: 70; easing.type: "InOutQuad"}
- NumberAnimation { target: headyaw; property: "angle"; to: -30; duration: 70; easing.type: "InOutQuad"}
- NumberAnimation { target: headyaw; property: "angle"; to: 30; duration: 70; easing.type: "InOutQuad"}
- NumberAnimation { target: headyaw; property: "angle"; to: -30; duration: 70; easing.type: "InOutQuad"}
- NumberAnimation { target: headyaw; property: "angle"; to: 00; duration: 100; easing.type: "OutQuad"}
- NumberAnimation { target: yaw; property: "angle"; to: 90; duration: 250; easing.type: "InOutQuad"}
- NumberAnimation { target: armBend; property: "angle"; to: -45; duration: 500; easing.type: "InOutQuad"}
- ParallelAnimation {
- NumberAnimation { target: robot; property: "x"; to: 0.5; duration: 500; easing.type: "InQuad"}
- NumberAnimation { target: roll; property: "angle"; to: 30; duration: 500; easing.type: "InOutQuad"}
- }
- ParallelAnimation {
- NumberAnimation { target: robot; property: "x"; to: 3.5; duration: 1000; easing.type: "Linear"}
- NumberAnimation { target: smallCube; property: "x"; to: 5; duration: 1000; easing.type: "Linear"}
- }
- ParallelAnimation {
- NumberAnimation { target: smallCube; property: "x"; to: 8; duration: 1000; easing.type: "Linear"}
- SequentialAnimation {
- PauseAnimation { duration: 250}
- NumberAnimation { target: smallCube; property: "y"; to: -5; duration: 750; easing.type: "InQuad"}
- }
- ParallelAnimation {
- SequentialAnimation {
- NumberAnimation {target: roll; property: "angle"; to: -10; duration: 750; easing.type: "InOutBack"}
- PauseAnimation{duration: 1500}
- NumberAnimation {target: roll; property: "angle"; to: 0; duration: 750; easing.type: "InOutBack"}
- }
- Vector3dAnimation {target: robot; property: "position"; to: Qt.vector3d(0,0,0); duration: 3000; easing.type: "InOutBack"}
- }
- }
- NumberAnimation { target: yaw; property: "angle"; to: 0; duration: 250; easing.type: "InOutQuad"}
- NumberAnimation { target: armBend; property: "angle"; to: -90; duration: 500; easing.type: "InOutQuad"}
- PauseAnimation { duration: 1000 }
- PropertyAction {target: smallCube; property: "position"; value: Qt.vector3d(0,10,0)}
- NumberAnimation { target: smallCube; property: "y"; to: 5; duration: 1000; easing.type: "OutQuad"}
- }
- }
-
- TronCube {
- scale: 10.0
- onClicked: {
- heartbeat.restart();
- console.log("Big cube clicked");
- room.spinning = true;
- }
- }
-
- Cube {
- id: signCube
- scale: 2.375
- position: Qt.vector3d(0,2,0)
- effect: calcEffect
- transform: [
- Rotation3D{id: spinSign; angle: 180; axis:Qt.vector3d(0,1,0)}
- ]
-
- Cube {
- id: innerCube
- scale: 0.95
- effect: signEffect
- }
-
- Effect {
- id: signEffect
- color: "#aaca00"
- texture: "Assets/QML3DSign.png"
- decal: true
- }
-
- Effect {
- id: calcEffect
- color: "#aaca00"
- texture: "Assets/calculatorSign.png"
- decal: true
- }
- }
-
- Robot {
- id: robot
- position: Qt.vector3d(0,0,4)
-
- onClicked: {
- heartbeat.restart();
- console.log("robot has been clicked")
- roboInfo.showVisible=true
- }
-
- 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)}
- ]
-
- Item3D {
- id: robotArms
- mesh: Mesh { source: "Assets/roboticArms.3ds"}
- transform: Rotation3D{id: armBend; angle: -90;axis: Qt.vector3d(0,1,0)}
- position: Qt.vector3d(.18, 0,-5.4)
-
- SequentialAnimation {
- running: false
- loops: 100
- NumberAnimation {target: armBend; property: "angle"; to: 0.0; duration: 1000; easing.type: "OutQuad" }
- PauseAnimation {duration: 1000}
- NumberAnimation {target: armBend; property: "angle"; to: -90.0; duration: 1000; easing.type: "OutQuad" }
- }
- }
-
- Item3D {
- id: robotHead
- mesh: Mesh { source: "Assets/roboticHead.3ds" }
- position: Qt.vector3d(0,0,-9.1)
- transform: [
- Rotation3D {id: headyaw; angle: 0; axis: Qt.vector3d(0,0,1)},
- Rotation3D {id: headroll; angle: -45; axis: Qt.vector3d(1,0,0)},
- Rotation3D {id: headpitch; angle: 0; axis: Qt.vector3d(0,1,0)}
- ]
- }
- }
- }
- }
- }
-}
diff --git a/demos/quick3d/robo_bounce/qtquick3d.ico b/demos/quick3d/robo_bounce/qtquick3d.ico
deleted file mode 100644
index c695ac72..00000000
--- a/demos/quick3d/robo_bounce/qtquick3d.ico
+++ /dev/null
Binary files differ
diff --git a/demos/quick3d/robo_bounce/qtquick3d.png b/demos/quick3d/robo_bounce/qtquick3d.png
deleted file mode 100644
index 8351083e..00000000
--- a/demos/quick3d/robo_bounce/qtquick3d.png
+++ /dev/null
Binary files differ
diff --git a/demos/quick3d/robo_bounce/robo_bounce.desktop b/demos/quick3d/robo_bounce/robo_bounce.desktop
deleted file mode 100644
index d21ea4f0..00000000
--- a/demos/quick3d/robo_bounce/robo_bounce.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=RoboBounce
-Icon=/usr/share/icons/hicolor/80x80/apps/qtquick3d.png
-Exec=/usr/bin/invoker --type=e -s /usr/bin/robo_bounce -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_robo_bounce
diff --git a/demos/quick3d/robo_bounce/robo_bounce.pro b/demos/quick3d/robo_bounce/robo_bounce.pro
deleted file mode 100644
index 5232a715..00000000
--- a/demos/quick3d/robo_bounce/robo_bounce.pro
+++ /dev/null
@@ -1,22 +0,0 @@
-TEMPLATE = app
-TARGET = robo_bounce
-CONFIG += qt warn_on
-
-CONFIG += qt3dquick_deploy_pkg
-include(../../../pkg.pri)
-
-SOURCES += main.cpp
-
-OTHER_FILES += \
- robo_bounce.rc \
- robo_bounce.desktop
-
-RC_FILE = robo_bounce.rc
-
-RESOURCES += \
- robo_bounce.qrc
-
-
-symbian {
- TARGET.EPOCHEAPSIZE = 0x40000 0x4000000
-}
diff --git a/demos/quick3d/robo_bounce/robo_bounce.qrc b/demos/quick3d/robo_bounce/robo_bounce.qrc
deleted file mode 100644
index 69a83785..00000000
--- a/demos/quick3d/robo_bounce/robo_bounce.qrc
+++ /dev/null
@@ -1,34 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>qml/robobounce.qml</file>
- <file>qml/Assets/button.png</file>
- <file>qml/Assets/calculatorSign.png</file>
- <file>qml/Assets/cubeButton.png</file>
- <file>qml/Assets/hazard.png</file>
- <file>qml/Assets/infobutton.png</file>
- <file>qml/Assets/QML3DSign.png</file>
- <file>qml/Assets/qtlogo.png</file>
- <file>qml/Assets/roboInfo.png</file>
- <file>qml/Assets/roboticArms.3ds</file>
- <file>qml/Assets/roboticBody.3ds</file>
- <file>qml/Assets/roboticHead.3ds</file>
- <file>qml/Assets/rotateButton2.png</file>
- <file>qml/Assets/sQt3D_logo.png</file>
- <file>qml/Assets/tronscape.png</file>
- <file>qml/Calculator/Calculator.qml</file>
- <file>qml/Calculator/CalculatorCore/Button.qml</file>
- <file>qml/Calculator/CalculatorCore/calculator.js</file>
- <file>qml/Calculator/CalculatorCore/Display.qml</file>
- <file>qml/Calculator/CalculatorCore/qmldir</file>
- <file>qml/Calculator/CalculatorCore/images/button-.png</file>
- <file>qml/Calculator/CalculatorCore/images/button-blue.png</file>
- <file>qml/Calculator/CalculatorCore/images/button-green.png</file>
- <file>qml/Calculator/CalculatorCore/images/button-purple.png</file>
- <file>qml/Calculator/CalculatorCore/images/button-red.png</file>
- <file>qml/Calculator/CalculatorCore/images/display.png</file>
- <file>qml/RobotCore/PushButton.qml</file>
- <file>qml/RobotCore/QMLPanels.qml</file>
- <file>qml/RobotCore/Robot.qml</file>
- <file>qml/RobotCore/TronCube.qml</file>
- </qresource>
-</RCC>
diff --git a/demos/quick3d/robo_bounce/robo_bounce.rc b/demos/quick3d/robo_bounce/robo_bounce.rc
deleted file mode 100644
index 1b6228c9..00000000
--- a/demos/quick3d/robo_bounce/robo_bounce.rc
+++ /dev/null
@@ -1 +0,0 @@
-IDI_ICON1 ICON DISCARDABLE "qtquick3d.ico"
diff --git a/demos/quick3d/tea_service/main.cpp b/demos/quick3d/tea_service/main.cpp
deleted file mode 100644
index ed22e4b9..00000000
--- a/demos/quick3d/tea_service/main.cpp
+++ /dev/null
@@ -1,69 +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/QApplication>
-#include "qdeclarativeview3d.h"
-
-#include "../qmlres.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
-
- QDeclarativeView3D view;
- QString qml = q_get_qmldir(QLatin1String("qml/teaservice.qml"));
- view.setSource(QUrl::fromLocalFile(qml));
-
-#ifdef Q_OS_SYMBIAN
- view.setAttribute(Qt::WA_LockLandscapeOrientation, true);
- view.setResizeMode(QDeclarativeView::SizeRootObjectToView);
- view.showFullScreen();
-#else
- if (QApplication::arguments().contains(QLatin1String("-maximize")))
- view.showMaximized();
- else if (QApplication::arguments().contains(QLatin1String("-fullscreen")))
- view.showFullScreen();
- else
- view.show();
-#endif
-
- return app.exec();
-}
diff --git a/demos/quick3d/tea_service/qml/Teacup.qml b/demos/quick3d/tea_service/qml/Teacup.qml
deleted file mode 100644
index 9c34b0da..00000000
--- a/demos/quick3d/tea_service/qml/Teacup.qml
+++ /dev/null
@@ -1,68 +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 1.0
-import Qt3D 1.0
-
-Item3D {
- id: top
- property real spoonY
- property bool bounce: false
-
- Item3D {
- mesh: teacup_mesh
- effect: Effect {
- material: china
- }
-
- onHoverEnter: { effect.material = china_highlight }
- onHoverLeave: { effect.material = china }
- onClicked: { top.bounce = true }
-
- y: top.spoonY
- }
-
- SequentialAnimation on spoonY {
- running: top.bounce
- NumberAnimation { to : 1; duration: 300; easing.type:"OutQuad" }
- NumberAnimation { to : 0; duration: 300; easing.type:"OutBounce" }
- onCompleted: top.bounce = false
- }
-}
diff --git a/demos/quick3d/tea_service/qml/Teaspoon.qml b/demos/quick3d/tea_service/qml/Teaspoon.qml
deleted file mode 100644
index 65712e2e..00000000
--- a/demos/quick3d/tea_service/qml/Teaspoon.qml
+++ /dev/null
@@ -1,72 +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 1.0
-import Qt3D 1.0
-
-Item3D {
- id: "top"
- property real saucerY
- Item3D {
- id: teaspoon1
- property real y_lift
- y: Math.max(y_lift,top.saucerY)
- transform: Rotation3D {
- angle: 275
- axis: Qt.vector3d(1, 0, 0)
- }
- mesh: teaspoon_mesh
- effect: Effect {
- material: metal
- }
- property bool bounce: false
-
- onHoverEnter: { effect.material = metal_highlight }
- onHoverLeave: { effect.material = metal }
- onClicked: { teaspoon1.bounce = true }
-
- SequentialAnimation on y_lift {
- running: teaspoon1.bounce
- NumberAnimation { to : 1; duration: 300; easing.type:"OutQuad" }
- NumberAnimation { to : 0; duration: 300; easing.type:"OutBounce" }
- onCompleted: teaspoon1.bounce = false
- }
- }
-}
diff --git a/demos/quick3d/tea_service/qml/teacup.bez b/demos/quick3d/tea_service/qml/teacup.bez
deleted file mode 100644
index f4dde3ef..00000000
--- a/demos/quick3d/tea_service/qml/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/demos/quick3d/tea_service/qml/teapot-body.bez b/demos/quick3d/tea_service/qml/teapot-body.bez
deleted file mode 100644
index 614daf09..00000000
--- a/demos/quick3d/tea_service/qml/teapot-body.bez
+++ /dev/null
@@ -1,332 +0,0 @@
-24
-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
-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/demos/quick3d/tea_service/qml/teapot-handle.bez b/demos/quick3d/tea_service/qml/teapot-handle.bez
deleted file mode 100644
index a2a3503e..00000000
--- a/demos/quick3d/tea_service/qml/teapot-handle.bez
+++ /dev/null
@@ -1,312 +0,0 @@
-4
-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
-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/demos/quick3d/tea_service/qml/teapot-spout.bez b/demos/quick3d/tea_service/qml/teapot-spout.bez
deleted file mode 100644
index 7674812e..00000000
--- a/demos/quick3d/tea_service/qml/teapot-spout.bez
+++ /dev/null
@@ -1,312 +0,0 @@
-4
-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
-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/demos/quick3d/tea_service/qml/teaservice.qml b/demos/quick3d/tea_service/qml/teaservice.qml
deleted file mode 100644
index 0812b4ac..00000000
--- a/demos/quick3d/tea_service/qml/teaservice.qml
+++ /dev/null
@@ -1,382 +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 1.0
-import Qt3D 1.0
-
-Viewport {
- width: 850
- height: 480
- picking: true
- //showPicking: true
-
- camera: Camera {
- eye: Qt.vector3d(0, 3, 10)
- }
-
- Item3D {
- id: teapot
- transform: [
- Rotation3D {
- id: teapot_rotate1
- angle: 0
- axis: Qt.vector3d(0, 1, 0)
- },
- Rotation3D {
- id: teapot_rotate2
- angle: 0
- axis: Qt.vector3d(0, 0, 1)
- }
- ]
- property bool bounce: false
-
- Item3D {
- id: body
- mesh: Mesh { source: "teapot-body.bez" }
- effect: Effect {
- material: china
- }
-
- onHoverEnter: { effect.material = china_highlight }
- onHoverLeave: { effect.material = china }
- onClicked: { teapot.bounce = true }
- }
-
- Item3D {
- id: handle
- mesh: Mesh { source: "teapot-handle.bez" }
- effect: Effect {
- material: china
- }
-
- onHoverEnter: { effect.material = china_highlight }
- onHoverLeave: { effect.material = china }
- onClicked: {
- if (teapot.state == "facing_left" ||
- teapot.state == "pour_left") {
- teapot.state = "facing_right";
- } else if (teapot.state == "facing_right" ||
- teapot.state == "pour_right") {
- teapot_rotate1.angle = 0;
- teapot.state = "facing_left";
- } else {
- teapot.state = "facing_left";
- }
- }
- }
-
- Item3D {
- id: spout
- mesh: Mesh { source: "teapot-spout.bez" }
- effect: Effect {
- material: china
- }
-
- onHoverEnter: { effect.material = china_highlight }
- onHoverLeave: { effect.material = china }
- onClicked: {
- if (teapot.state == "facing_left") {
- teapot.state = "pour_left";
- } else if (teapot.state == "pour_left") {
- teapot.state = "facing_left";
- teapot.state = "pour_left";
- } else if (teapot.state == "pour_right" ||
- teapot.state == "facing_right") {
- teapot.state = "";
- teapot_rotate1.angle = 0;
- teapot.state = "pour_right";
- } else {
- teapot.state = "pour_right";
- }
- }
- }
-
- SequentialAnimation on y{
- running: teapot.bounce
- NumberAnimation { to : 1.0; duration: 300; easing.type: "OutQuad" }
- NumberAnimation { to : 0.0; duration: 300; easing.type: "OutBounce" }
- onCompleted: teapot.bounce = false
- }
-
- states: [
- State {
- name: "facing_left"
- PropertyChanges {
- target: teapot_rotate1
- angle: 180
- }
- },
- State {
- name: "facing_right"
- PropertyChanges {
- target: teapot_rotate1
- angle: 360
- }
- },
- State {
- name: "pour_left"
- PropertyChanges {
- target: teapot
- y: 0
- }
- PropertyChanges {
- target: teapot
- x: 0
- }
- PropertyChanges {
- target: teapot_rotate1
- angle: 180
- }
- PropertyChanges {
- target: teapot_rotate2
- angle: 0
- }
- },
- State {
- name: "pour_right"
- PropertyChanges {
- target: teapot
- y: 0
- }
- PropertyChanges {
- target: teapot
- x: 0
- }
- PropertyChanges {
- target: teapot_rotate2
- angle: 0
- }
- }
- ]
-
- transitions: [
- Transition {
- from: "*"
- to: "facing_left"
- NumberAnimation {
- targets: teapot_rotate1
- properties: "angle"
- duration: 300
- }
- },
- Transition {
- from: "*"
- to: "facing_right"
- NumberAnimation {
- targets: teapot_rotate1
- properties: "angle"
- duration: 300
- }
- },
- Transition {
- from: "*"
- to: "pour_left"
- SequentialAnimation {
- ParallelAnimation {
- NumberAnimation {
- target: teapot
- property: "y"
- duration: 500
- to: 1
- easing.type: "OutQuad"
- }
- NumberAnimation {
- target: teapot
- property: "x"
- duration: 500
- to: -0.5
- easing.type: "OutQuad"
- }
- NumberAnimation {
- target: teapot_rotate2
- property: "angle"
- duration: 500
- to: 45
- easing.type: "OutQuad"
- }
- }
- PauseAnimation { duration: 700 }
- ParallelAnimation {
- NumberAnimation {
- target: teapot
- property: "y"
- duration: 500
- to: 0
- easing.type: "OutQuad"
- }
- NumberAnimation {
- target: teapot
- property: "x"
- duration: 500
- to: 0
- easing.type: "OutQuad"
- }
- NumberAnimation {
- target: teapot_rotate2
- property: "angle"
- duration: 500
- to: 0
- easing.type: "OutQuad"
- }
- }
- }
- },
- Transition {
- from: "*"
- to: "pour_right"
- SequentialAnimation {
- ParallelAnimation {
- NumberAnimation {
- target: teapot
- property: "y"
- duration: 500
- to: 1
- easing.type: "OutQuad"
- }
- NumberAnimation {
- target: teapot
- property: "x"
- duration: 500
- to: 0.5
- easing.type: "OutQuad"
- }
- NumberAnimation {
- target: teapot_rotate2
- property: "angle"
- duration: 500
- to: -45
- easing.type: "OutQuad"
- }
- }
- PauseAnimation { duration: 700 }
- ParallelAnimation {
- NumberAnimation {
- target: teapot
- property: "y"
- duration: 500
- to: 0
- easing.type: "OutQuad"
- }
- NumberAnimation {
- target: teapot
- property: "x"
- duration: 500
- to: 0
- easing.type: "OutQuad"
- }
- NumberAnimation {
- target: teapot_rotate2
- property: "angle"
- duration: 500
- to: 0
- easing.type: "OutQuad"
- }
- }
- }
- }
- ]
- }
-
- Teacup {
- id: teacup1
- position: Qt.vector3d(-2.3, -0.75, 0.0)
- }
-
- Teacup {
- id: teacup2
- position: Qt.vector3d(2.3, -0.75, 0.0)
- transform: Rotation3D {
- angle: 180
- axis: Qt.vector3d(0, 1, 0)
- }
- }
-
- Teaspoon {
- x: -1.7
- y: -0.58
- saucerY: teacup1.spoonY
- }
-
- Teaspoon {
- x: 1.7
- y: -0.58
- saucerY: teacup2.spoonY
- }
-
- Mesh {
- id: teacup_mesh
- source: "teacup.bez"
- }
-
- Mesh {
- id: teaspoon_mesh
- source: "teaspoon.bez"
- }
-
- Material {
- id: china
- ambientColor: "#c09680"
- specularColor: "#3c3c3c"
- shininess: 128
- }
-
- Material {
- id: china_highlight
- ambientColor: "#ffc000"
- specularColor: "#3c3c00"
- shininess: 128
- }
-
- Material {
- id: metal
- ambientColor: "#ffffff"
- diffuseColor: "#969696"
- specularColor: "#ffffff"
- shininess: 128
- }
-
- Material {
- id: metal_highlight
- ambientColor: "#ffff60"
- diffuseColor: "#969660"
- specularColor: "#ffffff"
- shininess: 128
- }
-}
diff --git a/demos/quick3d/tea_service/qml/teaservice.qmlproject b/demos/quick3d/tea_service/qml/teaservice.qmlproject
deleted file mode 100644
index d4909f86..00000000
--- a/demos/quick3d/tea_service/qml/teaservice.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: [ " ../exampleplugin " ]
-}
diff --git a/demos/quick3d/tea_service/qml/teaspoon.bez b/demos/quick3d/tea_service/qml/teaspoon.bez
deleted file mode 100644
index c304fbde..00000000
--- a/demos/quick3d/tea_service/qml/teaspoon.bez
+++ /dev/null
@@ -1,275 +0,0 @@
-16
-1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16
-17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32
-33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48
-49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64
-65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80
-81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96
-97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112
-113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128
-129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144
-145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160
-161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176
-177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192
-193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208
-209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224
-225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240
-241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256
-256
--0.000107143,0.205357,0.0
-0.0,0.196429,-0.0178571
-0.0,0.196429,-0.0178571
-0.000107143,0.205357,0.0
--0.0535714,0.205357,0.0
--0.0222714,0.178571,-0.0534286
-0.0222714,0.178571,-0.0534286
-0.0535714,0.205357,0.0
--0.107143,0.0952429,-0.0178571
--0.0446429,0.0952429,-0.0892857
-0.0446429,0.0952429,-0.0892857
-0.107143,0.0952429,-0.0178571
--0.107143,0.0,-0.0178571
--0.0446429,0.0,-0.0892857
-0.0446429,0.0,-0.0892857
-0.107143,0.0,-0.0178571
-0.000107143,0.205357,0.0
-0.000135714,0.207589,0.00446429
-0.000157143,0.216518,0.00446429
-0.000125,0.214286,0.0
-0.0535714,0.205357,0.0
-0.0613964,0.212054,0.0133571
-0.0714286,0.220982,0.015625
-0.0625,0.214286,0.0
-0.107143,0.0952429,-0.0178571
-0.122768,0.0952429,0.0
-0.142857,0.0952429,0.00446429
-0.125,0.0952429,-0.0178571
-0.107143,0.0,-0.0178571
-0.122768,0.0,0.0
-0.142857,0.0,0.00446429
-0.125,0.0,-0.0178571
-0.000125,0.214286,0.0
-0.0,0.205357,-0.0178571
-0.0,0.205357,-0.0178571
--0.000125,0.214286,0.0
-0.0625,0.214286,0.0
-0.0267857,0.1875,-0.0625
--0.0267857,0.1875,-0.0625
--0.0625,0.214286,0.0
-0.125,0.0952429,-0.0178571
-0.0535714,0.0952429,-0.107143
--0.0535714,0.0952429,-0.107143
--0.125,0.0952429,-0.0178571
-0.125,0.0,-0.0178571
-0.0535714,0.0,-0.107143
--0.0535714,0.0,-0.107143
--0.125,0.0,-0.0178571
--0.000125,0.214286,0.0
--0.000157143,0.216518,0.00446429
--0.000135714,0.207589,0.00446429
--0.000107143,0.205357,0.0
--0.0625,0.214286,0.0
--0.0714286,0.220982,0.015625
--0.0613964,0.212054,0.0133571
--0.0535714,0.205357,0.0
--0.125,0.0952429,-0.0178571
--0.142857,0.0952429,0.00446429
--0.122768,0.0952429,0.0
--0.107143,0.0952429,-0.0178571
--0.125,0.0,-0.0178571
--0.142857,0.0,0.00446429
--0.122768,0.0,0.0
--0.107143,0.0,-0.0178571
--0.107143,0.0,-0.0178571
--0.0446429,0.0,-0.0892857
-0.0446429,0.0,-0.0892857
-0.107143,0.0,-0.0178571
--0.107143,-0.142857,-0.0178571
--0.0446429,-0.142857,-0.0892857
-0.0446429,-0.142857,-0.0892857
-0.107143,-0.142857,-0.0178571
--0.0133929,-0.160714,0.0386893
--0.00557857,-0.160714,0.0386893
-0.00557857,-0.160714,0.0386893
-0.0133929,-0.160714,0.0386893
--0.0133929,-0.25,0.0535714
--0.00557857,-0.25,0.0535714
-0.00557857,-0.25,0.0535714
-0.0133929,-0.25,0.0535714
-0.107143,0.0,-0.0178571
-0.122768,0.0,0.0
-0.142857,0.0,0.00446429
-0.125,0.0,-0.0178571
-0.107143,-0.142857,-0.0178571
-0.122768,-0.142857,0.0
-0.142857,-0.142857,0.00446429
-0.125,-0.142857,-0.0178571
-0.0133929,-0.160714,0.0386893
-0.0153464,-0.160714,0.0386893
-0.0178571,-0.160714,0.0314357
-0.015625,-0.160714,0.0297607
-0.0133929,-0.25,0.0535714
-0.0153464,-0.25,0.0535714
-0.0178571,-0.25,0.0463179
-0.015625,-0.25,0.0446429
-0.125,0.0,-0.0178571
-0.0535714,0.0,-0.107143
--0.0535714,0.0,-0.107143
--0.125,0.0,-0.0178571
-0.125,-0.142857,-0.0178571
-0.0535714,-0.142857,-0.107143
--0.0535714,-0.142857,-0.107143
--0.125,-0.142857,-0.0178571
-0.015625,-0.160714,0.0297607
-0.00669643,-0.160714,0.0230643
--0.00781071,-0.160714,0.0208321
--0.015625,-0.160714,0.0297607
-0.015625,-0.25,0.0446429
-0.00669643,-0.25,0.0379464
--0.00781071,-0.25,0.0357143
--0.015625,-0.25,0.0446429
--0.125,0.0,-0.0178571
--0.142857,0.0,0.00446429
--0.122768,0.0,0.0
--0.107143,0.0,-0.0178571
--0.125,-0.142857,-0.0178571
--0.142857,-0.142857,0.00446429
--0.122768,-0.142857,0.0
--0.107143,-0.142857,-0.0178571
--0.015625,-0.160714,0.0297607
--0.0175786,-0.160714,0.0319929
--0.0153464,-0.160714,0.0386893
--0.0133929,-0.160714,0.0386893
--0.015625,-0.25,0.0446429
--0.0175786,-0.25,0.046875
--0.0153464,-0.25,0.0535714
--0.0133929,-0.25,0.0535714
--0.0133929,-0.25,0.0535714
--0.00557857,-0.25,0.0535714
-0.00557857,-0.25,0.0535714
-0.0133929,-0.25,0.0535714
--0.0133929,-0.46425,0.0892857
--0.00557857,-0.46425,0.0892857
-0.00557857,-0.46425,0.0892857
-0.0133929,-0.46425,0.0892857
--0.0446429,-0.678571,0.0535714
--0.00892857,-0.678571,0.0625
-0.00892857,-0.678571,0.0625
-0.0446429,-0.678571,0.0535714
--0.0446429,-0.857143,0.0357143
--0.00892857,-0.857143,0.0446429
-0.00892857,-0.857143,0.0446429
-0.0446429,-0.857143,0.0357143
-0.0133929,-0.25,0.0535714
-0.0153464,-0.25,0.0535714
-0.0178571,-0.25,0.0463179
-0.015625,-0.25,0.0446429
-0.0133929,-0.46425,0.0892857
-0.0153464,-0.464286,0.0892857
-0.0178571,-0.46425,0.0820321
-0.015625,-0.46425,0.0803571
-0.0446429,-0.678571,0.0535714
-0.0535714,-0.678571,0.0513393
-0.0535714,-0.678571,0.0334821
-0.0446429,-0.678571,0.0357143
-0.0446429,-0.857143,0.0357143
-0.0535714,-0.857143,0.0334821
-0.0535714,-0.857143,0.015625
-0.0446429,-0.857143,0.0178571
-0.015625,-0.25,0.0446429
-0.00669643,-0.25,0.0379464
--0.00781071,-0.25,0.0357143
--0.015625,-0.25,0.0446429
-0.015625,-0.46425,0.0803571
-0.00669643,-0.464286,0.0736607
--0.00781071,-0.46425,0.0714286
--0.015625,-0.46425,0.0803571
-0.0446429,-0.678571,0.0357143
-0.00892857,-0.678571,0.0446429
--0.00892857,-0.678571,0.0446429
--0.0446429,-0.678571,0.0357143
-0.0446429,-0.857143,0.0178571
-0.00892857,-0.857143,0.0267857
--0.00892857,-0.857143,0.0267857
--0.0446429,-0.857143,0.0178571
--0.015625,-0.25,0.0446429
--0.0175786,-0.25,0.046875
--0.0153464,-0.25,0.0535714
--0.0133929,-0.25,0.0535714
--0.015625,-0.46425,0.0803571
--0.0175786,-0.464286,0.0825893
--0.0153464,-0.464286,0.0892857
--0.0133929,-0.46425,0.0892857
--0.0446429,-0.678571,0.0357143
--0.0535714,-0.678571,0.0334821
--0.0535714,-0.678571,0.0513393
--0.0446429,-0.678571,0.0535714
--0.0446429,-0.857143,0.0178571
--0.0535714,-0.857143,0.015625
--0.0535714,-0.857143,0.0334821
--0.0446429,-0.857143,0.0357143
--0.0446429,-0.857143,0.0357143
--0.00892857,-0.857143,0.0446429
-0.00892857,-0.857143,0.0446429
-0.0446429,-0.857143,0.0357143
--0.0446429,-0.928571,0.0285714
--0.00892857,-0.928571,0.0375
-0.00892857,-0.928571,0.0375
-0.0446429,-0.928571,0.0285714
--0.0539286,-0.999643,0.0178571
-0.000357143,-0.999643,0.0178571
-0.0,-0.999643,0.0178571
-0.0535714,-0.999643,0.0178571
--0.000357143,-1,0.0178571
-0.000357143,-1,0.0178571
-0.0,-1,0.0178571
-0.0,-1,0.0178571
-0.0446429,-0.857143,0.0357143
-0.0535714,-0.857143,0.0334821
-0.0535714,-0.857143,0.015625
-0.0446429,-0.857143,0.0178571
-0.0446429,-0.928571,0.0285714
-0.0535714,-0.928571,0.0263393
-0.0535714,-0.928571,0.00848214
-0.0446429,-0.928571,0.0107143
-0.0535714,-0.999643,0.0178571
-0.0669643,-0.999643,0.0178571
-0.0673214,-0.999643,0.0
-0.0539286,-0.999643,0.0
-0.0,-1,0.0178571
-0.0,-1,0.0178571
-0.000357143,-1,0.0
-0.000357143,-1,0.0
-0.0446429,-0.857143,0.0178571
-0.00892857,-0.857143,0.0267857
--0.00892857,-0.857143,0.0267857
--0.0446429,-0.857143,0.0178571
-0.0446429,-0.928571,0.0107143
-0.00892857,-0.928571,0.0196429
--0.00892857,-0.928571,0.0196429
--0.0446429,-0.928571,0.0107143
-0.0539286,-0.999643,0.0
-0.000357143,-0.999643,0.0
--0.000357143,-0.999643,0.0
--0.0539286,-0.999643,0.0
-0.000357143,-1,0.0
-0.000357143,-1,0.0
--0.000357143,-1,0.0
--0.000357143,-1,0.0
--0.0446429,-0.857143,0.0178571
--0.0535714,-0.857143,0.015625
--0.0535714,-0.857143,0.0334821
--0.0446429,-0.857143,0.0357143
--0.0446429,-0.928571,0.0107143
--0.0535714,-0.928571,0.00848214
--0.0535714,-0.928571,0.0263393
--0.0446429,-0.928571,0.0285714
--0.0539286,-0.999643,0.0
--0.0673214,-0.999643,0.0
--0.0675,-0.999643,0.0178571
--0.0539286,-0.999643,0.0178571
--0.000357143,-1,0.0
--0.000357143,-1,0.0
--0.000535714,-1,0.0178571
--0.000357143,-1,0.0178571
-# reverse-patches
diff --git a/demos/quick3d/tea_service/qtquick3d.ico b/demos/quick3d/tea_service/qtquick3d.ico
deleted file mode 100644
index c695ac72..00000000
--- a/demos/quick3d/tea_service/qtquick3d.ico
+++ /dev/null
Binary files differ
diff --git a/demos/quick3d/tea_service/qtquick3d.png b/demos/quick3d/tea_service/qtquick3d.png
deleted file mode 100644
index 8351083e..00000000
--- a/demos/quick3d/tea_service/qtquick3d.png
+++ /dev/null
Binary files differ
diff --git a/demos/quick3d/tea_service/tea_service.desktop b/demos/quick3d/tea_service/tea_service.desktop
deleted file mode 100644
index d45e0812..00000000
--- a/demos/quick3d/tea_service/tea_service.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=Tea Service
-Icon=/usr/share/icons/hicolor/80x80/apps/qtquick3d.png
-Exec=/usr/bin/invoker --type=e -s /usr/bin/tea_service -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_tea_service
diff --git a/demos/quick3d/tea_service/tea_service.pro b/demos/quick3d/tea_service/tea_service.pro
deleted file mode 100644
index af610655..00000000
--- a/demos/quick3d/tea_service/tea_service.pro
+++ /dev/null
@@ -1,16 +0,0 @@
-TEMPLATE = app
-TARGET = tea_service
-CONFIG += qt warn_on
-
-INSTALL_DIRS = qml
-CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg
-include(../../../pkg.pri)
-qtcAddDeployment()
-
-SOURCES += main.cpp
-
-OTHER_FILES += \
- tea_service.rc \
- tea_service.desktop
-
-RC_FILE = tea_service.rc
diff --git a/demos/quick3d/tea_service/tea_service.rc b/demos/quick3d/tea_service/tea_service.rc
deleted file mode 100644
index 1b6228c9..00000000
--- a/demos/quick3d/tea_service/tea_service.rc
+++ /dev/null
@@ -1 +0,0 @@
-IDI_ICON1 ICON DISCARDABLE "qtquick3d.ico"
diff --git a/devices/README b/devices/README
deleted file mode 100644
index a07f54de..00000000
--- a/devices/README
+++ /dev/null
@@ -1,5 +0,0 @@
-This directory contains useful scripts and resources for use when
-using Qt3D on devices.
-
-In the case of the N900 and other maemo devices, use the packaging system
-by following the instructions in the debian/rules file.
diff --git a/devices/maemo5/debian/changelog b/devices/maemo5/debian/changelog
deleted file mode 100644
index 3a4ac83d..00000000
--- a/devices/maemo5/debian/changelog
+++ /dev/null
@@ -1,5 +0,0 @@
-libqt4-3d (1.0-tp1) unstable; urgency=low
-
- * Technology Preview 1 Release.
-
- -- Sarah Smith <sarah.j.smith@nokia.com> Wed, 06 Apr 2011 16:30:00 +1000
diff --git a/devices/maemo5/debian/compat b/devices/maemo5/debian/compat
deleted file mode 100644
index 7ed6ff82..00000000
--- a/devices/maemo5/debian/compat
+++ /dev/null
@@ -1 +0,0 @@
-5
diff --git a/devices/maemo5/debian/control b/devices/maemo5/debian/control
deleted file mode 100644
index 4aef0362..00000000
--- a/devices/maemo5/debian/control
+++ /dev/null
@@ -1,33 +0,0 @@
-Source: libqt4-3d
-Section: libdevel
-Priority: extra
-Maintainer: Sarah Smith <sarah.j.smith@nokia.com>
-Build-Depends: debhelper (>= 5), libqt4-dev (>= 4.7.0~git20100909-0maemo1+0m5), cdbs (>= 0.4.48-0osso2)
-Standards-Version: 3.8.4
-
-Package: libqt4-3d
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: Qt4 3D module
- Qt is a cross-platform C++ application framework. Qt's primary feature
- is its rich set of widgets that provide standard GUI functionality.
- .
- The Qt3d module contains functionality for 3D scenes and UIs.
-
-Package: libqt4-3d-examples
-Architecture: any
-Depends: libqt4-3d (= ${binary:Version})
-Description: Qt 4 3d module examples
- Qt is a cross-platform C++ application framework. Qt's primary feature
- is its rich set of widgets that provide standard GUI functionality.
- .
- This package contains examples and demos for the Qt3d module
-
-Package: libqt4-3d-dev
-Architecture: any
-Depends: libqt4-3d (= ${binary:Version})
-Description: Qt 4 3d module development files
- Qt is a cross-platform C++ application framework. Qt's primary feature
- is its rich set of widgets that provide standard GUI functionality.
- .
- This package contains the development headers for the Qt3d module
diff --git a/devices/maemo5/debian/copyright b/devices/maemo5/debian/copyright
deleted file mode 100644
index 2d247d5b..00000000
--- a/devices/maemo5/debian/copyright
+++ /dev/null
@@ -1,106 +0,0 @@
-This work was packaged for Debian by:
-
- Sarah Smith <sarah.j.smith@nokia.com> on Wed, 09 Feb 2011 20:59:27 +1000
-
-Copyright:
-
- The Qt GUI Toolkit is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
- Contact: Nokia Corporation (qt-info@nokia.com)
-
-
-License:
-
- You may use, distribute and copy the Qt GUI Toolkit under the terms of
- GNU Lesser General Public License version 2.1, which is displayed below.
-
- GNU LESSER GENERAL PUBLIC LICENSE
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This package is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-The Debian packaging is:
-
- The Qt GUI Toolkit is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
- Contact: Nokia Corporation (qt-info@nokia.com)
-
-and is licensed under the GNU Lesser General Public License version
-2.1, which is displayed above.
-
-
-Third party libraries code includes the Asset Importer library:
-
-Open Asset Import Library (Assimp)
-
-Copyright (c) 2006-2010, Assimp Development Team
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the
-following conditions are met:
-
-* Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the
- following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-* Neither the name of the ASSIMP team, nor the names of its
- contributors may be used to endorse or promote products
- derived from this software without specific prior
- written permission of the ASSIMP Development Team.
-
-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.
-
-
-
-AN EXCEPTION applies to all files in the ./test/models-nonbsd subfolder.
-These are 3d models for testing purposes, from various free sources
-on the internet. They are - unless otherwise stated - copyright of
-their respective creators, which may impose additional requirements
-on the use of their work. For any of these models, see
-<model-name>.source.txt for more legal information. Contact us if you
-are a copyright holder and believe that we credited you inproperly or
-if you don't want your files to appear in the repository.
-
-
-
-...and the lib3ds library:
-
-
-Lib3ds is a free toolkit for handling the "3DS" format for 3D model files.
-Its main goal is to simplify the creation of 3DS import and export filters.
-
-This project is not related in any form to Autodesk Inc. The library is
-based on unofficial information about the 3DS format found on the web.
-
-This program is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
-License for more details.
-
-The official Lib3ds Homepage can be found under:
- http://lib3ds.sourceforge.net
-
diff --git a/devices/maemo5/debian/docs b/devices/maemo5/debian/docs
deleted file mode 100644
index 4a1f4770..00000000
--- a/devices/maemo5/debian/docs
+++ /dev/null
@@ -1,2 +0,0 @@
-LGPL_EXCEPTION.txt
-README
diff --git a/devices/maemo5/debian/libqt4-3d-dev.install b/devices/maemo5/debian/libqt4-3d-dev.install
deleted file mode 100644
index 5e060349..00000000
--- a/devices/maemo5/debian/libqt4-3d-dev.install
+++ /dev/null
@@ -1,3 +0,0 @@
-usr/share/qt4/mkspecs/features/
-usr/include/Qt3D/
-usr/include/Qt3DQuick/
diff --git a/devices/maemo5/debian/libqt4-3d-examples.install b/devices/maemo5/debian/libqt4-3d-examples.install
deleted file mode 100644
index 40594eaf..00000000
--- a/devices/maemo5/debian/libqt4-3d-examples.install
+++ /dev/null
@@ -1,4 +0,0 @@
-usr/bin/*
-usr/share/qt4/quick3d
-usr/share/pixmaps
-usr/share/applications/hildon
diff --git a/devices/maemo5/debian/libqt4-3d-tests.install b/devices/maemo5/debian/libqt4-3d-tests.install
deleted file mode 100644
index 971781fb..00000000
--- a/devices/maemo5/debian/libqt4-3d-tests.install
+++ /dev/null
@@ -1,4 +0,0 @@
-usr/bin/tests/*
-usr/share/qt4/quick3d
-usr/share/pixmaps
-usr/share/applications/hildon
diff --git a/devices/maemo5/debian/libqt4-3d.install b/devices/maemo5/debian/libqt4-3d.install
deleted file mode 100644
index d650a0c8..00000000
--- a/devices/maemo5/debian/libqt4-3d.install
+++ /dev/null
@@ -1,4 +0,0 @@
-usr/lib/libQt3D.so.*
-usr/lib/libQt3DQuick.so.*
-usr/lib/qt4/plugins/
-usr/lib/qt4/imports/
diff --git a/devices/maemo5/debian/rules b/devices/maemo5/debian/rules
deleted file mode 100755
index 5aabd23c..00000000
--- a/devices/maemo5/debian/rules
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/usr/bin/make -f
-# -*- makefile -*-
-
-# To build using this rules file:
-# #
-# ### install debian packaging stuff if not already present:
-# sudo apt-get install dpkg-dev debhelper cdbs
-#
-# ### set up the build directory with version number - DO NOT CD INTO IT YET!
-# mkdir quick3d-tp1
-#
-# ### copy all the stuff across - cannot shadow build (probably don't want git)
-# (cd ~/depot/qt/quick3d && tar cf - --exclude-vcs .)|(cd quick3d-tp1 && tar xf -)
-# cp -f ~/depot/qt/quick3d/devices/maemo5/debian/* quick3d-tp1/debian/.
-#
-# cd quick3d-tp1
-# export DEB_BUILD_OPTIONS="parallel=4"
-# fakeroot dpkg-buildpackage -b
-
-# Uncomment this to turn on verbose mode.
-export DH_OPTIONS=-v
-export DH_VERBOSE=1
-
-include /usr/share/cdbs/1/rules/debhelper.mk
-include /usr/share/cdbs/1/class/makefile.mk
-
-# Find out how many parallel threads to run
-TMP_BUILD_OPTS = $(subst $(comma),$(space),$(DEB_BUILD_OPTIONS))
-ifneq (,$(filter parallel=%,$(TMP_BUILD_OPTS)))
- NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(TMP_BUILD_OPTS)))
- PARALLEL_MAKEFLAGS += -j$(NUMJOBS)
-endif
-
-DEB_MAKE_INVOKE := $(MAKE) $(PARALLEL_MAKEFLAGS)
-DEB_MAKE_INSTALL_TARGET := INSTALL_ROOT=$(DEB_DESTDIR) install
-DEB_DH_INSTALL_SOURCEDIR := debian/tmp
-
-common-configure-arch::
- qmake -spec linux-g++-maemo5 quick3d.pro CONFIG+=maemo CONFIG+=package
-
-common-install-arch:: install-desktop-items
-
-install-desktop-items:
- mkdir -p $(DEB_DESTDIR)/usr/share/pixmaps
- find examples -name "icon-l*.png" -exec cp {} $(DEB_DESTDIR)/usr/share/pixmaps \;
- mkdir -p $(DEB_DESTDIR)/usr/share/applications/hildon
- find examples -name "m5-*.desktop" -exec cp {} $(DEB_DESTDIR)/usr/share/applications/hildon \;
diff --git a/devices/symbian/examples/examples.pro b/devices/symbian/examples/examples.pro
deleted file mode 100644
index 846e49c3..00000000
--- a/devices/symbian/examples/examples.pro
+++ /dev/null
@@ -1,2 +0,0 @@
-TEMPLATE=subdirs
-symbian: system(perl generate_examples_pkg.pl) \ No newline at end of file
diff --git a/devices/symbian/examples/generate_examples_pkg.pl b/devices/symbian/examples/generate_examples_pkg.pl
deleted file mode 100644
index 2ede3551..00000000
--- a/devices/symbian/examples/generate_examples_pkg.pl
+++ /dev/null
@@ -1,145 +0,0 @@
-#!/usr/bin/perl
-#############################################################################
-##
-## 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$
-##
-#############################################################################
-
-use File::Find;
-
-sub system_example_dirs {
- print "Setting example directories\n";
- return ( '../../../examples/qt3d', '../../../examples/quick3d', '../../../demos/qt3d', '../../../demos/quick3d');
-}
-
-sub pkg_template_files
-{
- print "Recording pkg files of QtQuick3D\n";
- my @out;
-
- #get all of the pkg files we might want.
- my $wanted = sub {
- # If the file has _template.pkg in the name, store the file and path to it
- my $file = lc $File::Find::name;
- if ($file =~ /_template\.pkg/) {
- print "Found .pkg file: $file \n";
- push(@out, $file);
- }
- };
-
- # Iterate through the example and demo directories to find pkg files
- foreach my $dir (system_example_dirs) {
- find($wanted, "${dir}");
- }
-
- return @out;
-}
-
-sub parse_pkg
-{
- my $filename = shift;
- open FILE, $filename or die "Could not read from $filename, program halting.";
- print "Parsing package file: $filename\n";
- my $lines ="";
- my $line;
- # Iterate through each line of the file.
- while (defined ($line = <FILE>))
- {
- # If we find a ;DEPLOYMENT line, get the lines below it up to (and including) a blank line
- if ($line =~ /; DEPLOYMENT/ ) {
- my $recorded = 0;
- $lines .= $line;
- while ($recorded == 0) {
- #get lines until we find a blank line
- my $record_line = <FILE>;
- if ($record_line =~ /^$/) {
- $recorded = 1;
- $lines .= $record_line;
- }
- else {
- $lines .= $record_line;
- }
- }
- }
- }
-
- close FILE;
- return $lines;
-}
-
-open(OUTPUTPKG, ">QtQuick3D_apps_template.pkg") or die "cannot open file for reading: $!";
-
-# Print the pkg file heading for our collective pkg file
-print OUTPUTPKG <<PKGHEADER;
-
-; Language
-&EN
-
-#{"Qt Quick3D Examples"},(0xA89FAE20),1,0,0
-; SIS header: name, uid, version
-
-; Localised Vendor name
-%{"Nokia"}
-
-; Unique Vendor name
-:"Nokia"
-
-; Default dependency to Qt libraries
-(0x2001E61C), 4, 7, 3, {"Qt"}
-
-; Default dependency to QtQuick3D libraries
-(0x2002AC89), 1, 0, 0, {"Qt Quick 3D"}
-
-; Default HW/platform dependencies
-[0x20022E6D],0,0,0,{"S60ProductID"}
-
-PKGHEADER
-
-# Collect the pkg file path for each test application and library needed for system testing
-my @files = pkg_template_files;
-
-my $pkgcontent;
-
-# Parse the collected pkg files and append the parsed result to the content of the collective one
-foreach (@files) {
- $pkgcontent .= "; $_\n";
- $pkgcontent .= parse_pkg $_;
- $pkgcontent .= "\n";
-}
-
-print OUTPUTPKG $pkgcontent;
diff --git a/devices/symbian/symbian.pro b/devices/symbian/symbian.pro
deleted file mode 100644
index 096d780e..00000000
--- a/devices/symbian/symbian.pro
+++ /dev/null
@@ -1,62 +0,0 @@
-# Use subdirs template to suppress generation of unnecessary files
-TEMPLATE = subdirs
-
-symbian {
- load(data_caging_paths)
-
- SUBDIRS=
- # WARNING: Changing TARGET name will break Symbian SISX upgrade functionality
- # DO NOT TOUCH TARGET VARIABLE IF YOU ARE NOT SURE WHAT YOU ARE DOING
- TARGET = "Qt Quick 3D"
-
- # This is the UID for the overall .SIS file package
- TARGET.UID3 = 0x20031E9A
-
- VERSION = 1.0.0
-
- vendorinfo = \
- "; Localised Vendor name" \
- "%{\"Nokia\"}" \
- " " \
- "; Unique Vendor name" \
- ":\"Nokia\"" \
- " "
- qt3dlibraries.pkg_prerules += vendorinfo
-
- qt3dlibraries.sources = Qt3D$${QT_LIBINFIX}.dll
- qt3dlibraries.path = /sys/bin
- DEPLOYMENT += qt3dlibraries
-
- contains(CONFIG, old_importer): {
- qt3dsceneformats_plugins.sources = \
- qscene3ds$${QT_LIBINFIX}.dll \
- qsceneobj$${QT_LIBINFIX}.dll \
- qscenebezier$${QT_LIBINFIX}.dll
- qt3dsceneformats_plugins.path = $$QT_PLUGINS_BASE_DIR/sceneformats
- DEPLOYMENT += qt3dsceneformats_plugins
- } else {
- qt3dsceneformats_plugins.sources = \
- qsceneai$${QT_LIBINFIX}.dll \
- qscenebezier$${QT_LIBINFIX}.dll
- qt3dsceneformats_plugins.path = $$QT_PLUGINS_BASE_DIR/sceneformats
- DEPLOYMENT += qt3dsceneformats_plugins
- }
-
- qt3dquick.sources = Qt3DQuick$${QT_LIBINFIX}.dll
- qt3dquick.path = /sys/bin
- qt3dthreedImports.sources = \
- qthreedqmlplugin.dll \
- $$PWD/../../src/imports/threed/qmldir
- qt3dthreedImports.path = $$QT_IMPORTS_BASE_DIR/Qt3D
- qt3dshapesImports.sources = \
- qshapesqmlplugin.dll \
- $$PWD/../../src/imports/shapes/Cube.qml \
- $$PWD/../../src/imports/shapes/cube.obj \
- $$PWD/../../src/imports/shapes/Quad.qml \
- $$PWD/../../src/imports/shapes/quad.obj \
- $$PWD/../../src/imports/shapes/Teapot.qml \
- $$PWD/../../src/imports/shapes/teapot.bez \
- $$PWD/../../src/imports/shapes/qmldir
- qt3dshapesImports.path = $$QT_IMPORTS_BASE_DIR/Qt3D/Shapes
- DEPLOYMENT += qt3dquick qt3dthreedImports qt3dshapesImports
-}
diff --git a/devices/ubuntu/debian/libqt4-3d-examples.install b/devices/ubuntu/debian/libqt4-3d-examples.install
deleted file mode 100644
index 96fd4db6..00000000
--- a/devices/ubuntu/debian/libqt4-3d-examples.install
+++ /dev/null
@@ -1,4 +0,0 @@
-usr/bin/*
-usr/share/qt4/quick3d
-usr/share/pixmaps
-usr/share/applications
diff --git a/devices/ubuntu/debian/rules b/devices/ubuntu/debian/rules
deleted file mode 100755
index a0f6b925..00000000
--- a/devices/ubuntu/debian/rules
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/usr/bin/make -f
-# -*- makefile -*-
-
-# To build using this rules file:
-# #
-# ### install debian packaging stuff if not already present:
-# sudo apt-get install dpkg-dev debhelper cdbs
-#
-# ### set up the build directory with version number - DO NOT CD INTO IT YET!
-# mkdir quick3d-tp1
-#
-# ### copy all the stuff across - cannot shadow build (probably don't want git)
-# (cd ~/depot/qt/quick3d && tar cf - --exclude-vcs .)|(cd quick3d-tp1 && tar xf -)
-# cp -f ~/depot/qt/quick3d/devices/ubuntu/debian/* quick3d-tp1/debian/.
-#
-# cd quick3d-tp1
-# export DEB_BUILD_OPTIONS="parallel=4"
-# fakeroot dpkg-buildpackage -b
-
-# Uncomment this to turn on verbose mode.
-export DH_OPTIONS=-v
-export DH_VERBOSE=1
-
-include /usr/share/cdbs/1/rules/debhelper.mk
-include /usr/share/cdbs/1/class/makefile.mk
-
-# Find out how many parallel threads to run
-TMP_BUILD_OPTS = $(subst $(comma),$(space),$(DEB_BUILD_OPTIONS))
-ifneq (,$(filter parallel=%,$(TMP_BUILD_OPTS)))
- NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(TMP_BUILD_OPTS)))
- PARALLEL_MAKEFLAGS += -j$(NUMJOBS)
-endif
-
-ifeq (arm,$(findstring arm,$(shell g++ -v 2>&1 | sed -n '/Target: arm/p')))
- QMAKE_CONF_MKSPEC = -spec linux-g++-maemo
- QMAKE_CONF_OPTS = CONFIG+=maemo
-endif
-
-DEB_MAKE_INVOKE := $(MAKE) $(PARALLEL_MAKEFLAGS)
-DEB_MAKE_INSTALL_TARGET := INSTALL_ROOT=$(DEB_DESTDIR) install
-DEB_DH_INSTALL_SOURCEDIR := debian/tmp
-
-common-configure-arch::
- qmake $(QMAKE_CONF_MKSPEC) quick3d.pro $(QMAKE_CONF_OPTS) CONFIG+=package
-
-common-install-arch:: install-desktops
-
-install-desktops:
- mkdir -p $(DEB_DESTDIR)/usr/share/applications
- find . -name *.desktop -exec cp {} $(DEB_DESTDIR)/usr/share/applications \;
- mkdir -p $(DEB_DESTDIR)/usr/share/pixmaps
- find . -name icon-*.png -exec cp {} $(DEB_DESTDIR)/usr/share/pixmaps \;
diff --git a/doc/config/compat.qdocconf b/doc/config/compat.qdocconf
deleted file mode 100644
index 2d881a9a..00000000
--- a/doc/config/compat.qdocconf
+++ /dev/null
@@ -1,31 +0,0 @@
-#alias.i = e
-alias.include = input
-
-macro.0 = "\\\\0"
-macro.b = "\\\\b"
-macro.n = "\\\\n"
-macro.r = "\\\\r"
-macro.i = "\\o"
-macro.i11 = "\\o{1,1}"
-macro.i12 = "\\o{1,2}"
-macro.i13 = "\\o{1,3}"
-macro.i14 = "\\o{1,4}"
-macro.i15 = "\\o{1,5}"
-macro.i16 = "\\o{1,6}"
-macro.i17 = "\\o{1,7}"
-macro.i18 = "\\o{1,8}"
-macro.i19 = "\\o{1,9}"
-macro.i21 = "\\o{2,1}"
-macro.i31 = "\\o{3,1}"
-macro.i41 = "\\o{4,1}"
-macro.i51 = "\\o{5,1}"
-macro.i61 = "\\o{6,1}"
-macro.i71 = "\\o{7,1}"
-macro.i81 = "\\o{8,1}"
-macro.i91 = "\\o{9,1}"
-macro.img = "\\image"
-macro.endquote = "\\endquotation"
-macro.relatesto = "\\relates"
-
-spurious = "Missing comma in .*" \
- "Missing pattern .*"
diff --git a/doc/config/images/arrow_down.png b/doc/config/images/arrow_down.png
deleted file mode 100644
index 9d01e97f..00000000
--- a/doc/config/images/arrow_down.png
+++ /dev/null
Binary files differ
diff --git a/doc/config/images/bg_l.png b/doc/config/images/bg_l.png
deleted file mode 100755
index 90b1da10..00000000
--- a/doc/config/images/bg_l.png
+++ /dev/null
Binary files differ
diff --git a/doc/config/images/bg_l_blank.png b/doc/config/images/bg_l_blank.png
deleted file mode 100755
index 5a9673d8..00000000
--- a/doc/config/images/bg_l_blank.png
+++ /dev/null
Binary files differ
diff --git a/doc/config/images/bg_ll_blank.png b/doc/config/images/bg_ll_blank.png
deleted file mode 100644
index 95a1c45e..00000000
--- a/doc/config/images/bg_ll_blank.png
+++ /dev/null
Binary files differ
diff --git a/doc/config/images/bg_r.png b/doc/config/images/bg_r.png
deleted file mode 100755
index f0fb121d..00000000
--- a/doc/config/images/bg_r.png
+++ /dev/null
Binary files differ
diff --git a/doc/config/images/bg_ul_blank.png b/doc/config/images/bg_ul_blank.png
deleted file mode 100644
index 70512614..00000000
--- a/doc/config/images/bg_ul_blank.png
+++ /dev/null
Binary files differ
diff --git a/doc/config/images/box_bg.png b/doc/config/images/box_bg.png
deleted file mode 100755
index 3322f923..00000000
--- a/doc/config/images/box_bg.png
+++ /dev/null
Binary files differ
diff --git a/doc/config/images/breadcrumb.png b/doc/config/images/breadcrumb.png
deleted file mode 100755
index 0ded5514..00000000
--- a/doc/config/images/breadcrumb.png
+++ /dev/null
Binary files differ
diff --git a/doc/config/images/bullet_dn.png b/doc/config/images/bullet_dn.png
deleted file mode 100644
index f7762472..00000000
--- a/doc/config/images/bullet_dn.png
+++ /dev/null
Binary files differ
diff --git a/doc/config/images/bullet_gt.png b/doc/config/images/bullet_gt.png
deleted file mode 100755
index 7561b4ed..00000000
--- a/doc/config/images/bullet_gt.png
+++ /dev/null
Binary files differ
diff --git a/doc/config/images/bullet_sq.png b/doc/config/images/bullet_sq.png
deleted file mode 100755
index a84845e3..00000000
--- a/doc/config/images/bullet_sq.png
+++ /dev/null
Binary files differ
diff --git a/doc/config/images/bullet_up.png b/doc/config/images/bullet_up.png
deleted file mode 100644
index 7de2f069..00000000
--- a/doc/config/images/bullet_up.png
+++ /dev/null
Binary files differ
diff --git a/doc/config/images/feedbackground.png b/doc/config/images/feedbackground.png
deleted file mode 100755
index 3a38d995..00000000
--- a/doc/config/images/feedbackground.png
+++ /dev/null
Binary files differ
diff --git a/doc/config/images/header_bg.png b/doc/config/images/header_bg.png
deleted file mode 100644
index a436aa61..00000000
--- a/doc/config/images/header_bg.png
+++ /dev/null
Binary files differ
diff --git a/doc/config/images/horBar.png b/doc/config/images/horBar.png
deleted file mode 100755
index 100fe91c..00000000
--- a/doc/config/images/horBar.png
+++ /dev/null
Binary files differ
diff --git a/doc/config/images/page.png b/doc/config/images/page.png
deleted file mode 100644
index 1db151bd..00000000
--- a/doc/config/images/page.png
+++ /dev/null
Binary files differ
diff --git a/doc/config/images/page_bg.png b/doc/config/images/page_bg.png
deleted file mode 100755
index 9b3bd999..00000000
--- a/doc/config/images/page_bg.png
+++ /dev/null
Binary files differ
diff --git a/doc/config/images/qt-logo.png b/doc/config/images/qt-logo.png
deleted file mode 100644
index 14ddf2a0..00000000
--- a/doc/config/images/qt-logo.png
+++ /dev/null
Binary files differ
diff --git a/doc/config/images/spinner.gif b/doc/config/images/spinner.gif
deleted file mode 100644
index 1ed786f2..00000000
--- a/doc/config/images/spinner.gif
+++ /dev/null
Binary files differ
diff --git a/doc/config/images/sprites-combined.png b/doc/config/images/sprites-combined.png
deleted file mode 100755
index 3a48b21f..00000000
--- a/doc/config/images/sprites-combined.png
+++ /dev/null
Binary files differ
diff --git a/doc/config/macros.qdocconf b/doc/config/macros.qdocconf
deleted file mode 100644
index 48826fc6..00000000
--- a/doc/config/macros.qdocconf
+++ /dev/null
@@ -1,37 +0,0 @@
-macro.aacute.HTML = "&aacute;"
-macro.Aring.HTML = "&Aring;"
-macro.aring.HTML = "&aring;"
-macro.Auml.HTML = "&Auml;"
-macro.author = "\\bold{Author:}"
-macro.br.HTML = "<br />"
-macro.BR.HTML = "<br />"
-macro.copyright.HTML = "&copy;"
-macro.eacute.HTML = "&eacute;"
-macro.gui = "\\bold"
-macro.hr.HTML = "<hr />"
-macro.iacute.HTML = "&iacute;"
-macro.key = "\\bold"
-macro.menu = "\\bold"
-macro.note = "\\bold{Note:}"
-macro.oslash.HTML = "&oslash;"
-macro.ouml.HTML = "&ouml;"
-macro.QA = "\\e{Qt Assistant}"
-macro.QD = "\\e{Qt Designer}"
-macro.QL = "\\e{Qt Linguist}"
-macro.QQV = "\\e{Qt QML Viewer}"
-macro.param = "\\e"
-macro.raisedaster.HTML = "<sup>*</sup>"
-macro.rarrow.HTML = "&rarr;"
-macro.reg.HTML = "<sup>&reg;</sup>"
-macro.return = "Returns"
-macro.starslash = "\\c{*/}"
-macro.begincomment = "\\c{/*}"
-macro.endcomment = "\\c{*/}"
-macro.uuml.HTML = "&uuml;"
-macro.mdash.HTML = "&mdash;"
-
-macro.beginfloatleft.HTML = "<div style=\"float: left; margin-right: 2em\">"
-macro.beginfloatright.HTML = "<div style=\"float: right; margin-left: 2em\">"
-macro.endfloat.HTML = "</div>"
-macro.clearfloat.HTML = "<br style=\"clear: both\" />"
-macro.emptyspan.HTML = "<span></span>"
diff --git a/doc/config/qt-cpp-ignore.qdocconf b/doc/config/qt-cpp-ignore.qdocconf
deleted file mode 100644
index ccb5d8e3..00000000
--- a/doc/config/qt-cpp-ignore.qdocconf
+++ /dev/null
@@ -1,99 +0,0 @@
-Cpp.ignoretokens = QAXFACTORY_EXPORT \
- QDESIGNER_COMPONENTS_LIBRARY \
- QDESIGNER_EXTENSION_LIBRARY \
- QDESIGNER_SDK_LIBRARY \
- QDESIGNER_SHARED_LIBRARY \
- QDESIGNER_UILIB_LIBRARY \
- QM_EXPORT_CANVAS \
- QM_EXPORT_DNS \
- QM_EXPORT_DOM \
- QM_EXPORT_FTP \
- QM_EXPORT_HTTP \
- QM_EXPORT_ICONVIEW \
- QM_EXPORT_NETWORK \
- QM_EXPORT_OPENGL \
- QM_EXPORT_OPENVG \
- QM_EXPORT_SQL \
- QM_EXPORT_TABLE \
- QM_EXPORT_WORKSPACE \
- QM_EXPORT_XML \
- QT_ASCII_CAST_WARN \
- QT_ASCII_CAST_WARN_CONSTRUCTOR \
- QT_BEGIN_HEADER \
- QT_DESIGNER_STATIC \
- QT_END_HEADER \
- QT_FASTCALL \
- QT_WIDGET_PLUGIN_EXPORT \
- Q_COMPAT_EXPORT \
- Q_CORE_EXPORT \
- Q_CORE_EXPORT_INLINE \
- Q_EXPLICIT \
- Q_EXPORT \
- Q_EXPORT_CODECS_CN \
- Q_EXPORT_CODECS_JP \
- Q_EXPORT_CODECS_KR \
- Q_EXPORT_PLUGIN \
- Q_GFX_INLINE \
- Q_AUTOTEST_EXPORT \
- Q_QT3D_EXPORT \
- Q_GUI_EXPORT \
- Q_GUI_EXPORT_INLINE \
- Q_GUI_EXPORT_STYLE_CDE \
- Q_GUI_EXPORT_STYLE_COMPACT \
- Q_GUI_EXPORT_STYLE_MAC \
- Q_GUI_EXPORT_STYLE_MOTIF \
- Q_GUI_EXPORT_STYLE_MOTIFPLUS \
- Q_GUI_EXPORT_STYLE_PLATINUM \
- Q_GUI_EXPORT_STYLE_POCKETPC \
- Q_GUI_EXPORT_STYLE_SGI \
- Q_GUI_EXPORT_STYLE_WINDOWS \
- Q_GUI_EXPORT_STYLE_WINDOWSXP \
- QHELP_EXPORT \
- Q_INLINE_TEMPLATE \
- Q_INTERNAL_WIN_NO_THROW \
- Q_NETWORK_EXPORT \
- Q_OPENGL_EXPORT \
- Q_OPENVG_EXPORT \
- Q_OUTOFLINE_TEMPLATE \
- Q_SQL_EXPORT \
- Q_SVG_EXPORT \
- Q_SCRIPT_EXPORT \
- Q_SCRIPTTOOLS_EXPORT \
- Q_TESTLIB_EXPORT \
- Q_TYPENAME \
- Q_XML_EXPORT \
- Q_XMLSTREAM_EXPORT \
- Q_XMLPATTERNS_EXPORT \
- QDBUS_EXPORT \
- Q_DBUS_EXPORT \
- QT_BEGIN_NAMESPACE \
- QT_BEGIN_INCLUDE_NAMESPACE \
- QT_END_NAMESPACE \
- QT_END_INCLUDE_NAMESPACE \
- PHONON_EXPORT \
- Q_DECLARATIVE_EXPORT \
- Q_GADGET \
- QWEBKIT_EXPORT \
- Q_INVOKABLE
-Cpp.ignoredirectives = Q_DECLARE_HANDLE \
- Q_DECLARE_INTERFACE \
- Q_DECLARE_METATYPE \
- Q_DECLARE_OPERATORS_FOR_FLAGS \
- Q_DECLARE_PRIVATE \
- Q_DECLARE_PUBLIC \
- Q_DECLARE_SHARED \
- Q_DECLARE_TR_FUNCTIONS \
- Q_DECLARE_TYPEINFO \
- Q_DISABLE_COPY \
- QT_FORWARD_DECLARE_CLASS \
- Q_DUMMY_COMPARISON_OPERATOR \
- Q_ENUMS \
- Q_FLAGS \
- Q_INTERFACES \
- __attribute__ \
- K_DECLARE_PRIVATE \
- PHONON_OBJECT \
- PHONON_HEIR \
- Q_PRIVATE_PROPERTY \
- Q_DECLARE_PRIVATE_D \
- Q_CLASSINFO
diff --git a/doc/config/qt-defines.qdocconf b/doc/config/qt-defines.qdocconf
deleted file mode 100644
index 50a355f0..00000000
--- a/doc/config/qt-defines.qdocconf
+++ /dev/null
@@ -1,17 +0,0 @@
-defines = Q_QDOC \
- QT_.*_SUPPORT \
- QT_.*_LIB \
- QT_COMPAT \
- QT_KEYPAD_NAVIGATION \
- QT_NO_EGL \
- QT3_SUPPORT \
- Q_WS_.* \
- Q_OS_.* \
- Q_BYTE_ORDER \
- QT_DEPRECATED \
- Q_NO_USING_KEYWORD \
- __cplusplus
-
-versionsym = QT_VERSION_STR
-
-codeindent = 1
diff --git a/doc/config/qt-html-default-styles.qdocconf b/doc/config/qt-html-default-styles.qdocconf
deleted file mode 100644
index 61be7f10..00000000
--- a/doc/config/qt-html-default-styles.qdocconf
+++ /dev/null
@@ -1,35 +0,0 @@
-# Define the location of the templates to use. Style sheets and scripts are
-# specified relative to the template directory and will be copied into
-# subdirectories of the output directory.
-
-HTML.templatedir = .
-
-HTML.stylesheets = style/offline.css
-
-HTML.scripts =
-
-# Files not referenced in any qdoc file (last four needed by qtdemo)
-# See also qhp.Qt.extraFiles
-extraimages.HTML = qt-logo.png \
- arrow_down.png \
- breadcrumb.png \
- bullet_gt.png \
- bullet_dn.png \
- bullet_sq.png \
- bullet_up.png \
- horBar.png \
- sprites-combined.png \
- teapot-logo.png \
- qt3d-logo.png \
- gradient.png
-
-# Include the style sheets and scripts used.
-
-HTML.headerstyles = \
- " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/offline.css\" />\n"
-
-HTML.headerscripts =
-
-HTML.endheader = \
- "</head>\n" \
- "<body>\n"
diff --git a/doc/config/qt-html-online-styles.qdocconf b/doc/config/qt-html-online-styles.qdocconf
deleted file mode 100644
index da94e2ec..00000000
--- a/doc/config/qt-html-online-styles.qdocconf
+++ /dev/null
@@ -1,75 +0,0 @@
-# Define the location of the templates to use. Style sheets and scripts are
-# specified relative to the template directory and will be copied into
-# subdirectories of the output directory.
-
-HTML.templatedir = .
-
-HTML.stylesheets = style/narrow.css \
- style/style.css \
- style/style_ie6.css \
- style/style_ie7.css \
- style/style_ie8.css \
- style/superfish.css
-
-# Adding jquery and functions - providing online tools and search features
-HTML.scripts = scripts/functions.js \
- scripts/narrow.js \
- scripts/superfish.js \
- scripts/jquery.js
-
-
-# Files not referenced in any qdoc file.
-# See also qhp.Qt.extraFiles
-extraimages.HTML = qt-logo.png \
- bg_l.png \
- bg_l_blank.png \
- bg_ll_blank.png \
- bg_ul_blank.png \
- header_bg.png \
- bg_r.png \
- box_bg.png \
- breadcrumb.png \
- bullet_gt.png \
- bullet_dn.png \
- bullet_sq.png \
- bullet_up.png \
- arrow_down.png \
- feedbackground.png \
- horBar.png \
- page.png \
- page_bg.png \
- sprites-combined.png \
- spinner.gif \
- teapot-logo.png \
- qt3d-logo.png \
- gradient.png
-
-# Include the style sheets and scripts used.
-
-HTML.headerstyles = \
- " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/style.css\" />\n" \
- " <script src=\"scripts/jquery.js\" type=\"text/javascript\"></script>\n" \
- " <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n" \
- " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/superfish.css\" />\n" \
- " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/narrow.css\" />\n" \
- " <!--[if IE]>\n" \
- "<meta name=\"MSSmartTagsPreventParsing\" content=\"true\">\n" \
- "<meta http-equiv=\"imagetoolbar\" content=\"no\">\n" \
- "<![endif]-->\n" \
- "<!--[if lt IE 7]>\n" \
- "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie6.css\">\n" \
- "<![endif]-->\n" \
- "<!--[if IE 7]>\n" \
- "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie7.css\">\n" \
- "<![endif]-->\n" \
- "<!--[if IE 8]>\n" \
- "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie8.css\">\n" \
- "<![endif]-->\n\n"
-
-HTML.headerscripts = \
- "<script src=\"scripts/superfish.js\" type=\"text/javascript\"></script>\n" \
- "<script src=\"scripts/narrow.js\" type=\"text/javascript\"></script>\n\n"
-
-HTML.endheader = \
- "</head>\n" \
- "<body class=\"\" onload=\"CheckEmptyAndLoadList();\">\n"
diff --git a/doc/config/qt-html-templates-online.qdocconf b/doc/config/qt-html-templates-online.qdocconf
deleted file mode 100644
index 9230e592..00000000
--- a/doc/config/qt-html-templates-online.qdocconf
+++ /dev/null
@@ -1,205 +0,0 @@
-include(qt-html-online-styles.qdocconf)
-
-HTML.postheader = \
- " <div class=\"header\" id=\"qtdocheader\">\n" \
- " <div class=\"content\"> \n" \
- " <div id=\"nav-logo\">\n" \
- " <a href=\"index.html\">Home</a></div>\n" \
- " <a href=\"index.html\" class=\"qtref\"><span>QtQuick3D Reference Documentation</span></a>\n" \
- " <div id=\"narrowsearch\"></div>\n" \
- " <div id=\"nav-topright\">\n" \
- " <ul>\n" \
- " <li class=\"nav-topright-home\"><a href=\"http://qt.nokia.com/\">Qt HOME</a></li>\n" \
- " <li class=\"nav-topright-dev\"><a href=\"http://developer.qt.nokia.com/\">DEV</a></li>\n" \
- " <li class=\"nav-topright-labs\"><a href=\"http://labs.qt.nokia.com/blogs/\">LABS</a></li>\n" \
- " <li class=\"nav-topright-doc nav-topright-doc-active\"><a href=\"http://doc.qt.nokia.com/\">\n" \
- " DOC</a></li>\n" \
- " <li class=\"nav-topright-blog\"><a href=\"http://blog.qt.nokia.com/\">BLOG</a></li>\n" \
- " </ul>\n" \
- " </div>\n" \
- " <div id=\"shortCut\">\n" \
- " <ul>\n" \
- " <li class=\"shortCut-topleft-inactive\"><span><a href=\"index.html\">QtQuick3D</a></span></li>\n" \
- " </a></li>\n" \
- " </ul>\n" \
- " </div>\n" \
- " <ul class=\"sf-menu\" id=\"narrowmenu\"> \n" \
- " <li><a href=\"#\">API Lookup</a> \n" \
- " <ul> \n" \
- " <li><a href=\"classes.html\">Class index</a></li> \n" \
- " <li><a href=\"functions.html\">Function index</a></li> \n" \
- " <li><a href=\"modules.html\">Modules</a></li> \n" \
- " <li><a href=\"namespaces.html\">Namespaces</a></li> \n" \
- " <li><a href=\"qtglobal.html\">Global Declarations</a></li> \n" \
- " <li><a href=\"qdeclarativeelements.html\">QML elements</a></li> \n" \
- " </ul> \n" \
- " </li> \n" \
- " <li><a href=\"#\">Qt Topics</a> \n" \
- " <ul> \n" \
- " <li><a href=\"qt-basic-concepts.html\">Programming with Qt</a></li> \n" \
- " <li><a href=\"qtquick.html\">Device UIs &amp; Qt Quick</a></li> \n" \
- " <li><a href=\"qt-gui-concepts.html\">UI Design with Qt</a></li> \n" \
- " <li><a href=\"developing-with-qt.html\">Cross-platform and Platform-specific</a></li> \n" \
- " <li><a href=\"platform-specific.html\">Platform-specific info</a></li> \n" \
- " <li><a href=\"technology-apis.html\">Qt and Key Technologies</a></li> \n" \
- " <li><a href=\"best-practices.html\">How-To's and Best Practices</a></li> \n" \
- " </ul> \n" \
- " </li> \n" \
- " <li><a href=\"#\">Examples</a> \n" \
- " <ul> \n" \
- " <li><a href=\"all-examples.html\">Examples</a></li> \n" \
- " <li><a href=\"tutorials.html\">Tutorials</a></li> \n" \
- " <li><a href=\"demos.html\">Demos</a></li> \n" \
- " <li><a href=\"qdeclarativeexamples.html\">QML Examples</a></li> \n" \
- " </ul> \n" \
- " </li> \n" \
- " </ul> \n" \
- " </div>\n" \
- " </div>\n" \
- " <div class=\"wrapper\">\n" \
- " <div class=\"hd\">\n" \
- " <span></span>\n" \
- " </div>\n" \
- " <div class=\"bd group\">\n" \
- " <div class=\"sidebar\">\n" \
- " <div class=\"searchlabel\">\n" \
- " Search index:</div>\n" \
- " <div class=\"search\" id=\"sidebarsearch\">\n" \
- " <form id=\"qtdocsearch\" action=\"\" onsubmit=\"return false;\">\n" \
- " <fieldset>\n" \
- " <input type=\"text\" name=\"searchstring\" id=\"pageType\" value=\"\" />\n" \
- " <div id=\"resultdialog\"> \n" \
- " <a href=\"#\" id=\"resultclose\">Close</a> \n" \
- " <p id=\"resultlinks\" class=\"all\"><a href=\"#\" id=\"showallresults\">All</a> | <a href=\"#\" id=\"showapiresults\">API</a> | <a href=\"#\" id=\"showarticleresults\">Articles</a> | <a href=\"#\" id=\"showexampleresults\">Examples</a></p> \n" \
- " <p id=\"searchcount\" class=\"all\"><span id=\"resultcount\"></span><span id=\"apicount\"></span><span id=\"articlecount\"></span><span id=\"examplecount\"></span>&nbsp;results:</p> \n" \
- " <ul id=\"resultlist\" class=\"all\"> \n" \
- " </ul> \n" \
- " </div> \n" \
- " </fieldset>\n" \
- " </form>\n" \
- " </div>\n" \
- " <div class=\"box first bottombar\" id=\"lookup\">\n" \
- " <h2 title=\"API Lookup\"><span></span>\n" \
- " API Lookup</h2>\n" \
- " <div id=\"list001\" class=\"list\">\n" \
- " <ul id=\"ul001\" >\n" \
- " <li class=\"defaultLink\"><a href=\"classes.html\">Class index</a></li>\n" \
- " <li class=\"defaultLink\"><a href=\"functions.html\">Function index</a></li>\n" \
- " <li class=\"defaultLink\"><a href=\"modules.html\">Modules</a></li>\n" \
- " <li class=\"defaultLink\"><a href=\"namespaces.html\">Namespaces</a></li>\n" \
- " <li class=\"defaultLink\"><a href=\"qtglobal.html\">Global Declarations</a></li>\n" \
- " <li class=\"defaultLink\"><a href=\"qdeclarativeelements.html\">QML elements</a></li>\n" \
- " </ul> \n" \
- " </div>\n" \
- " </div>\n" \
- " <div class=\"box bottombar\" id=\"topics\">\n" \
- " <h2 title=\"Qt Topics\"><span></span>\n" \
- " Qt Topics</h2>\n" \
- " <div id=\"list002\" class=\"list\">\n" \
- " <ul id=\"ul002\" >\n" \
- " <li class=\"defaultLink\"><a href=\"qt-basic-concepts.html\">Programming with Qt</a></li> \n" \
- " <li class=\"defaultLink\"><a href=\"qtquick.html\">Device UIs &amp; Qt Quick</a></li> \n" \
- " <li class=\"defaultLink\"><a href=\"qt-gui-concepts.html\">UI Design with Qt</a></li> \n" \
- " <li class=\"defaultLink\"><a href=\"developing-with-qt.html\">Cross-platform and Platform-specific</a></li> \n" \
- " <li class=\"defaultLink\"><a href=\"platform-specific.html\">Platform-specific info</a></li> \n" \
- " <li class=\"defaultLink\"><a href=\"technology-apis.html\">Qt and Key Technologies</a></li> \n" \
- " <li class=\"defaultLink\"><a href=\"best-practices.html\">How-To's and Best Practices</a></li> \n" \
- " </ul> \n" \
- " </div>\n" \
- " </div>\n" \
- " <div class=\"box\" id=\"examples\">\n" \
- " <h2 title=\"Examples\"><span></span>\n" \
- " Examples</h2>\n" \
- " <div id=\"list003\" class=\"list\">\n" \
- " <ul id=\"ul003\">\n" \
- " <li class=\"defaultLink\"><a href=\"all-examples.html\">Examples</a></li>\n" \
- " <li class=\"defaultLink\"><a href=\"tutorials.html\">Tutorials</a></li>\n" \
- " <li class=\"defaultLink\"><a href=\"demos.html\">Demos</a></li>\n" \
- " <li class=\"defaultLink\"><a href=\"qdeclarativeexamples.html\">QML Examples</a></li>\n" \
- " </ul> \n" \
- " </div>\n" \
- " </div>\n" \
- " </div>\n" \
- " <div class=\"wrap\">\n" \
- " <div class=\"toolbar\">\n" \
- " <div class=\"breadcrumb toolblock\">\n" \
- " <ul>\n" \
- " <li class=\"first\"><a href=\"index.html\">Home</a></li>\n" \
- " <!-- Breadcrumbs go here -->\n"
-
-HTML.postpostheader = \
- " </ul>\n" \
- " </div>\n" \
- " <div class=\"toolbuttons toolblock\">\n" \
- " <ul>\n" \
- " <li id=\"smallA\" class=\"t_button\">A</li>\n" \
- " <li id=\"medA\" class=\"t_button active\">A</li>\n" \
- " <li id=\"bigA\" class=\"t_button\">A</li>\n" \
- " <li id=\"print\" class=\"t_button\"><a href=\"javascript:this.print();\">\n" \
- " <span>Print</span></a></li>\n" \
- " </ul>\n" \
- " </div>\n" \
- " </div>\n" \
- " <div class=\"content mainContent\">\n"
-
-HTML.footer = \
- " </div>\n" \
- " </div> \n" \
- " <div class=\"ft\">\n" \
- " <span></span>\n" \
- " </div>\n" \
- " </div> \n" \
- " <div class=\"footer\">\n" \
- " <p>\n" \
- " <acronym title=\"Copyright\">&copy;</acronym> 2008-2011 Nokia Corporation and/or its\n" \
- " subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation \n" \
- " in Finland and/or other countries worldwide.</p>\n" \
- " <p>\n" \
- " All other trademarks are property of their respective owners. <a title=\"Privacy Policy\"\n" \
- " href=\"http://qt.nokia.com/about/privacy-policy\">Privacy Policy</a></p>\n" \
- " <br />\n" \
- " <p>\n" \
- " Licensees holding valid Qt Commercial licenses may use this document in accordance with the" \
- " Qt Commercial License Agreement provided with the Software or, alternatively, in accordance" \
- " with the terms contained in a written agreement between you and Nokia.</p>\n" \
- " <p>\n" \
- " Alternatively, this document may be used under the terms of the <a href=\"http://www.gnu.org/licenses/fdl.html\">GNU\n" \
- " Free Documentation License version 1.3</a>\n" \
- " as published by the Free Software Foundation.</p>\n" \
- " </div>\n"
-
-
-# Files not referenced in any qdoc file.
-# See also extraimages.HTML
-qhp.Qt3D.extraFiles = index.html \
- images/bg_l.png \
- images/bg_l_blank.png \
- images/bg_ll_blank.png \
- images/bg_ul_blank.png \
- images/header_bg.png \
- images/bg_r.png \
- images/box_bg.png \
- images/breadcrumb.png \
- images/bullet_gt.png \
- images/bullet_dn.png \
- images/bullet_sq.png \
- images/bullet_up.png \
- images/arrow_down.png \
- images/feedbackground.png \
- images/horBar.png \
- images/page.png \
- images/page_bg.png \
- images/sprites-combined.png \
- images/spinner.gif \
- images/teapot-logo.png \
- images/qt3d-logo.png \
- scripts/functions.js \
- scripts/jquery.js \
- scripts/narrow.js \
- scripts/superfish.js \
- style/narrow.css \
- style/superfish.css \
- style/style_ie6.css \
- style/style_ie7.css \
- style/style_ie8.css \
- style/style.css
diff --git a/doc/config/qt-html-templates.qdocconf b/doc/config/qt-html-templates.qdocconf
deleted file mode 100644
index 7a78a0a0..00000000
--- a/doc/config/qt-html-templates.qdocconf
+++ /dev/null
@@ -1,57 +0,0 @@
-include(qt-html-default-styles.qdocconf)
-
-HTML.postheader = \
- "<div class=\"header\" id=\"qtdocheader\">\n" \
- " <div class=\"content\"> \n" \
- " <a href=\"index.html\" class=\"qtref\"><span>QtQuick3D Reference Documentation</span></a>\n" \
- " </div>\n" \
- " <div class=\"breadcrumb toolblock\">\n" \
- " <ul>\n" \
- " <li class=\"first\"><a href=\"index.html\">Home</a></li>\n" \
- " <!-- Breadcrumbs go here -->\n"
-
-HTML.postpostheader = \
- " </ul>\n" \
- " </div>\n" \
- "</div>\n" \
- "<img src=\"images/qt3d-logo.png\" border=\"0\" />\n" \
- "<div class=\"content mainContent\">\n"
-
-HTML.footer = \
- " <div class=\"ft\">\n" \
- " <span></span>\n" \
- " </div>\n" \
- "</div> \n" \
- "<div class=\"footer\">\n" \
- " <p>\n" \
- " <acronym title=\"Copyright\">&copy;</acronym> 2008-2011 Nokia Corporation and/or its\n" \
- " subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation \n" \
- " in Finland and/or other countries worldwide.</p>\n" \
- " <p>\n" \
- " All other trademarks are property of their respective owners. <a title=\"Privacy Policy\"\n" \
- " href=\"http://qt.nokia.com/about/privacy-policy\">Privacy Policy</a></p>\n" \
- " <br />\n" \
- " <p>\n" \
- " Licensees holding valid Qt Commercial licenses may use this document in accordance with the" \
- " Qt Commercial License Agreement provided with the Software or, alternatively, in accordance" \
- " with the terms contained in a written agreement between you and Nokia.</p>\n" \
- " <p>\n" \
- " Alternatively, this document may be used under the terms of the <a href=\"http://www.gnu.org/licenses/fdl.html\">GNU\n" \
- " Free Documentation License version 1.3</a>\n" \
- " as published by the Free Software Foundation.</p>\n" \
- "</div>\n" \
-
-# Files not referenced in any qdoc file.
-# See also extraimages.HTML
-qhp.Qt3D.extraFiles = index.html \
- images/arrow_down.png \
- images/breadcrumb.png \
- images/bullet_gt.png \
- images/bullet_dn.png \
- images/bullet_sq.png \
- images/bullet_up.png \
- images/horBar.png \
- images/sprites-combined.png \
- images/teapot-logo.png \
- images/qt3d-logo.png \
- style/offline.css
diff --git a/doc/config/qt3d-online.qdocconf b/doc/config/qt3d-online.qdocconf
deleted file mode 100644
index 0f3d3e09..00000000
--- a/doc/config/qt3d-online.qdocconf
+++ /dev/null
@@ -1,2 +0,0 @@
-include(qt3d-project.qdocconf)
-include(qt-html-templates-online.qdocconf)
diff --git a/doc/config/qt3d-project.qdocconf b/doc/config/qt3d-project.qdocconf
deleted file mode 100644
index 78f8fab1..00000000
--- a/doc/config/qt3d-project.qdocconf
+++ /dev/null
@@ -1,39 +0,0 @@
-include(compat.qdocconf)
-include(macros.qdocconf)
-include(qt-cpp-ignore.qdocconf)
-include(qt-defines.qdocconf)
-
-sourceencoding = UTF-8
-outputencoding = UTF-8
-naturallanguage = en_US
-
-project = QtQuick3D
-description = QtQuick3D Documentation
-url = http://doc.qt.nokia.com/qtquick3d
-language = Cpp
-
-sources.fileextensions = "*.cpp *.qdoc *.mm *.qml"
-headers.fileextensions = "*.h *.ch *.h++ *.hh *.hpp *.hxx"
-examples.fileextensions = "*.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp *.qml"
-examples.imageextensions = "*.png *.jpeg *.jpg *.gif *.mng"
-
-headerdirs = $TOPSRC/src/imports \
- $TOPSRC/src/quick3d \
- $TOPSRC/src/threed
-
-sourcedirs = $TOPSRC/src/imports \
- $TOPSRC/src/quick3d \
- $TOPSRC/src/threed \
- $TOPSRC/doc/src
-
-exampledirs = $TOPSRC/examples \
- $TOPSRC/demos \
- $TOPSRC/tutorials \
- $TOPSRC/src/plugins
-
-imagedirs = $TOPSRC/doc/src/images \
- $TOPSRC/doc/src/images/tutorials \
- $TOPSRC/doc/config/images
-
-outputdir = $DESTDIR/html
-base = file:$DESTDIR
diff --git a/doc/config/qt3d.qdocconf b/doc/config/qt3d.qdocconf
deleted file mode 100644
index f452ed90..00000000
--- a/doc/config/qt3d.qdocconf
+++ /dev/null
@@ -1,2 +0,0 @@
-include(qt3d-project.qdocconf)
-include(qt-html-templates.qdocconf)
diff --git a/doc/config/scripts/functions.js b/doc/config/scripts/functions.js
deleted file mode 100644
index e0e39657..00000000
--- a/doc/config/scripts/functions.js
+++ /dev/null
@@ -1,258 +0,0 @@
-// Removing search results
-function hideSearchResults() {
-/* hiding search results as the user clicks on the different categories */
- $('#resultdialog').removeClass('active');
- $("#resultlist").removeClass().addClass('all');
- $("#resultlinks").removeClass().addClass('all');
- $("#searchcount").removeClass().addClass('all');
-}
-/* closing the searhc result dialog */
-$('#resultclose').click(function(e) {
- e.preventDefault();
- hideSearchResults();
-});
-
-$(document.body).click(function() {
-});
-
-/* START non link areas where cursor should change to pointing hand */
-$('.t_button').mouseover(function() {
- $('.t_button').css('cursor','pointer');
-});
-/* END non link areas */
-/* Changing font size to smaller */
-$('#smallA').click(function() {
- $('.mainContent .heading,.mainContent h1, .mainContent h2, .mainContent h3, .mainContent p, .mainContent li, .mainContent table').css('font-size','smaller');
- $('.t_button').removeClass('active')
- $(this).addClass('active')
-});
-
-/* Reset font size */
-$('#medA').click(function() {
- $('.mainContent .heading').css('font','600 16px/1 Arial');
- $('.mainContent h1').css('font','600 18px/1.2 Arial');
- $('.mainContent h2').css('font','600 16px/1.2 Arial');
- $('.mainContent h3').css('font','600 14px/1.2 Arial');
- $('.mainContent p').css('font','13px/20px Verdana');
- $('.mainContent li').css('font','400 13px/1 Verdana');
- $('.mainContent li').css('line-height','14px');
- $('.mainContent .toc li').css('font', 'normal 10px/1.2 Verdana');
- $('.mainContent table').css('font','13px/1.2 Verdana');
- $('.mainContent .heading').css('font','600 16px/1 Arial');
- $('.mainContent .indexboxcont li').css('font','600 13px/1 Verdana');
- $('.t_button').removeClass('active')
- $(this).addClass('active')
-});
-/* Changing font size to bigger */
-$('#bigA').click(function() {
- $('.mainContent .heading,.mainContent h1, .mainContent h2, .mainContent h3, .mainContent p, .mainContent li, .mainContent table').css('font-size','large');
- $('.mainContent .heading,.mainContent h1, .mainContent h2, .mainContent h3, .mainContent p, .mainContent li, .mainContent table').css('line-height','25px');
- $('.t_button').removeClass('active')
- $(this).addClass('active')
-});
-
-/* Show page content after closing feedback box */
-$('.feedclose').click(function() {
- $('.bd').show();
- $('.hd').show();
- $('.footer').show();
- $('#feedbackBox').hide();
- $('#blurpage').hide();
-});
-
-/* Hide page content and show feedback box */
-$('.feedback').click(function() {
- $('.bd').hide();
- $('.hd').hide();
- $('.footer').hide();
- $('#feedbackBox').show();
- $('#blurpage').show();
-});
-/* Default search URL */
-var qturl = "";
-
-/* The next function handles the response data (in xml) returned by the search engine */
-
-// Process data sent back from the server. The data is structured as a XML.
-/*
-XML structure handled by function processNokiaData()
-<page> - container for each page returned
-<pageWords/> - contains keywords
-<pageTitle/> - contains page title/header content
-<pageUrl/> - contains page URL - URL relative to root
-<pageType> - contains page type - APIPage/Article/Example
-</page>
-*/
-
-
-function processNokiaData(response){
-/* fetch the responce from the server using page as the root element */
- var propertyTags = response.getElementsByTagName('page');
- /* reset counters */
- var apiCount = 0;
- var articleCount = 0;
- var exampleCount = 0;
- var full_li_element;
-
-/* remove any old results */
- $('#resultlist li').remove();
-
-
- /* running through the elements in the xml structure */
- for (var i=0; i<propertyTags.length; i++) {
- /* for every element named pageWords*/
- for (var j=0; j< propertyTags[i].getElementsByTagName('pageWords').length; j++) {
- /* start a new list element */
- full_li_element = '<li';
- /* if the pageType element reads APIPage, add class name api */
- if (propertyTags[i].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'APIPage') {
- full_li_element += ' class="api"';
- apiCount++;
- }
- /* if the pageType element reads Article, add class name article */
- else if (propertyTags[i].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'Article') {
- full_li_element += ' class="article"';
- articleCount++;
- }
- /* if the pageType element reads Example, add class name example */
- else if (propertyTags[i].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'Example') {
- full_li_element += ' class="example"';
- exampleCount++;
- }
- /* adding the link element*/
- full_li_element += '><a href="'+qturl;
- /* adding the URL attribute*/
- full_li_element += propertyTags[i].getElementsByTagName('pageUrl')[j].firstChild.nodeValue;
- /* adding the link title and closing the link and list elements */
- full_li_element += '">' + propertyTags[i].getElementsByTagName('pageWords')[0].firstChild.nodeValue + '</a></li>';
- /* appending the list element to the #resultlist div*/
- $('#resultlist').append(full_li_element);
- }
- }
-
- /* if the result is not empty */
- if (propertyTags.length > 0) {
- /* add class name active to show the dialog */
- $('#resultdialog').addClass('active');
- /* setting number of hits*/
- $('#resultcount').html(propertyTags.length);
- $('#apicount').html(apiCount);
- $('#articlecount').html(articleCount);
- $('#examplecount').html(exampleCount);
-
- }
- else {
- $('#pageType').addClass('red');
- }
-
-
-
- // Filtering results in display
- $('p#resultlinks a').click(function(e) {
- e.preventDefault();
- // Displays API ref pages
- if (this.id == "showapiresults") {
- $("#resultlist").removeClass().addClass('api');
- $("#resultlinks").removeClass().addClass('api');
- $("#searchcount").removeClass().addClass('api');
- }
- // Displays Articles
- else if (this.id == "showarticleresults") {
- $("#resultlist").removeClass().addClass('article');
- $("#resultlinks").removeClass().addClass('article');
- $("#searchcount").removeClass().addClass('article');
- }
- // Displays Examples
- if (this.id == "showexampleresults") {
- $("#resultlist").removeClass().addClass('example');
- $("#resultlinks").removeClass().addClass('example');
- $("#searchcount").removeClass().addClass('example');
- }
- // Displays All
- if (this.id == "showallresults") {
- $("#resultlist").removeClass().addClass('all');
- $("#resultlinks").removeClass().addClass('all');
- $("#searchcount").removeClass().addClass('all');
- }
- });
-}
-
-//build regular expression object to find empty string or any number of blank
-var blankRE=/^\s*$/;
-
-
-function CheckEmptyAndLoadList()
-{
- /* Start Extracting information for feedback and adding this to the feedback form */
- var pageUrl = window.location.href;
- var pageVal = $('title').html();
- $('#pageType').removeClass('red');
- $('#feedUrl').remove();
- $('#pageVal').remove();
- $('.menuAlert').remove();
- $('#feedform').append('<input id="feedUrl" name="feedUrl" value="'+pageUrl+'" style="display:none;">');
- $('#feedform').append('<input id="pageVal" name="pageVal" value="'+pageVal+'" style="display:none;">');
- /* End Extracting information for feedback and adding this to the feedback form */
-
- /* extracts search query */
- var value = document.getElementById('pageType').value;
- /* if the search is less than three chars long remove class names and remove elements from old search*/
- if ((blankRE.test(value)) || (value.length < 3))
- {
- $('#resultdialog').removeClass('active');
- $('#resultlist li').remove();
- }
-}
-
-// Loads on doc ready - prepares search
- $(document).ready(function () {
- /* fetch page title*/
- var pageTitle = $('title').html();
- /* getting content from search box */
- var currentString = $('#pageType').val() ;
- /* if the search box is not empty run CheckEmptyAndLoadList*/
- if (currentString.length < 1){
- CheckEmptyAndLoadList();
- }
-
- /* on key-up in the search box execute the following */
- $('#pageType').keyup(function () {
- /* extract the search box content */
- var searchString = $('#pageType').val() ;
- /* if the string is less than three characters */
- if ((searchString == null) || (searchString.length < 3)) {
- /* remove classes and elements*/
- $('#pageType').removeClass('loading');
- $('.searching').remove();
- /* run CheckEmptyAndLoadList */
- CheckEmptyAndLoadList();
-
- $('.report').remove();
- return;
- }
- /* if timer checks out */
- if (this.timer) clearTimeout(this.timer);
- this.timer = setTimeout(function () {
- /* add loading image by adding loading class */
- $('#pageType').addClass('loading');
- $('.searching').remove();
-
- /* run the actual search */
- $.ajax({
- contentType: "application/x-www-form-urlencoded",
- url: 'http://' + location.host + '/nokiasearch/GetDataServlet',
- data: 'searchString='+searchString,
- dataType:'xml',
- type: 'post',
- success: function (response, textStatus) {
- /* on success remove loading img */
- $('.searching').remove();
- $('#pageType').removeClass('loading');
-
- processNokiaData(response);
-
- }
- });
- }, 500); /* timer set to 500 ms */
- });
- });
diff --git a/doc/config/scripts/jquery.js b/doc/config/scripts/jquery.js
deleted file mode 100644
index 7d9c2626..00000000
--- a/doc/config/scripts/jquery.js
+++ /dev/null
@@ -1,152 +0,0 @@
-/*!
- * jQuery JavaScript Library v1.4.1
- * http://jquery.com/
- *
- * Copyright 2010, John Resig
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * Includes Sizzle.js
- * http://sizzlejs.com/
- * Copyright 2010, The Dojo Foundation
- * Released under the MIT, BSD, and GPL Licenses.
- *
- * Date: Mon Jan 25 19:43:33 2010 -0500
- */
-(function(z,v){function la(){if (!c.isReady){try{r.documentElement.doScroll("left")}catch(a){setTimeout(la,1);return}c.ready()}}function Ma(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,i){var j=a.length;if(typeof b==="object"){for (var n in b)X(a,n,b[n],f,e,d);return a}if(d!==v){f=!i&&f&&c.isFunction(d);for(n=0;n<j;n++)e(a[n],b,f?d.call(a[n],n,e(a[n],b)):d,i);return a}return j?
-e(a[0],b):null}function J(){return(new Date).getTime()}function Y(){return false}function Z(){return true}function ma(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function na(a){var b,d=[],f=[],e=arguments,i,j,n,o,m,s,x=c.extend({},c.data(this,"events").live);if (!(a.button&&a.type==="click")){for (o in x){j=x[o];if(j.live===a.type||j.altLive&&c.inArray(a.type,j.altLive)>-1){i=j.data;i.beforeFilter&&i.beforeFilter[a.type]&&!i.beforeFilter[a.type](a)||f.push(j.selector)}else delete x[o]}i=c(a.target).closest(f,
-a.currentTarget);m=0;for (s=i.length;m<s;m++)for(o in x){j=x[o];n=i[m].elem;f=null;if (i[m].selector===j.selector){if(j.live==="mouseenter"||j.live==="mouseleave")f=c(a.relatedTarget).closest(j.selector)[0];if(!f||f!==n)d.push({elem:n,fn:j})}}m=0;for(s=d.length;m<s;m++){i=d[m];a.currentTarget=i.elem;a.data=i.fn.data;if(i.fn.apply(i.elem,e)===false){b=false;break}}return b}}function oa(a,b){return"live."+(a?a+".":"")+b.replace(/\./g,"`").replace(/ /g,"&")}function pa(a){return!a||!a.parentNode||a.parentNode.nodeType===
-11}function qa(a,b){var d=0;b.each(function(){if (this.nodeName===(a[d]&&a[d].nodeName)){var f=c.data(a[d++]),e=c.data(this,f);if(f=f&&f.events){delete e.handle;e.events={};for (var i in f)for(var j in f[i])c.event.add(this,i,f[i][j],f[i][j].data)}}})}function ra(a,b,d){var f,e,i;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&a[0].indexOf("<option")<0&&(c.support.checkClone||!sa.test(a[0]))){e=true;if(i=c.fragments[a[0]])if(i!==1)f=i}if(!f){b=b&&b[0]?b[0].ownerDocument||b[0]:r;f=b.createDocumentFragment();
-c.clean(a,b,f,d)}if (e)c.fragments[a[0]]=i?f:1;return{fragment:f,cacheable:e}}function K(a,b){var d={};c.each(ta.concat.apply([],ta.slice(0,b)),function(){d[this]=a});return d}function ua(a){return"scrollTo"in a&&a.document?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var c=function(a,b){return new c.fn.init(a,b)},Na=z.jQuery,Oa=z.$,r=z.document,S,Pa=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,Qa=/^.[^:#\[\.,]*$/,Ra=/\S/,Sa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Ta=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,O=navigator.userAgent,
-va=false,P=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,Q=Array.prototype.slice,wa=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if (!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(typeof a==="string")if((d=Pa.exec(a))&&(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:r;if(a=Ta.exec(a))if(c.isPlainObject(b)){a=[r.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=ra([d[1]],
-[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}}else{if (b=r.getElementById(d[2])){if(b.id!==d[2])return S.find(a);this.length=1;this[0]=b}this.context=r;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=r;a=r.getElementsByTagName(a)}else return!b||b.jquery?(b||S).find(a):c(b).find(a);else if(c.isFunction(a))return S.ready(a);if(a.selector!==v){this.selector=a.selector;this.context=a.context}return c.isArray(a)?this.setArray(a):c.makeArray(a,
-this)},selector:"",jquery:"1.4.1",length:0,size:function(){return this.length},toArray:function(){return Q.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){a=c(a||null);a.prevObject=this;a.context=this.context;if (b==="find")a.selector=this.selector+(this.selector?" ":"")+d;else if(b)a.selector=this.selector+"."+b+"("+d+")";return a},setArray:function(a){this.length=0;ba.apply(this,a);return this},each:function(a,b){return c.each(this,
-a,b)},ready:function(a){c.bindReady();if (c.isReady)a.call(r,c);else P&&P.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(Q.apply(this,arguments),"slice",Q.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this,function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};
-c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,i,j,n;if (typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for (;b<d;b++)if((e=arguments[b])!=null)for(i in e){j=a[i];n=e[i];if(a!==n)if(f&&n&&(c.isPlainObject(n)||c.isArray(n))){j=j&&(c.isPlainObject(j)||c.isArray(j))?j:c.isArray(n)?[]:{};a[i]=c.extend(f,j,n)}else if(n!==v)a[i]=n}return a};c.extend({noConflict:function(a){z.$=
-Oa;if (a)z.jQuery=Na;return c},isReady:false,ready:function(){if(!c.isReady){if(!r.body)return setTimeout(c.ready,13);c.isReady=true;if(P){for (var a,b=0;a=P[b++];)a.call(r,c);P=null}c.fn.triggerHandler&&c(r).triggerHandler("ready")}},bindReady:function(){if(!va){va=true;if(r.readyState==="complete")return c.ready();if(r.addEventListener){r.addEventListener("DOMContentLoaded",L,false);z.addEventListener("load",c.ready,false)}else if(r.attachEvent){r.attachEvent("onreadystatechange",L);z.attachEvent("onload",
-c.ready);var a=false;try{a=z.frameElement==null}catch(b){}r.documentElement.doScroll&&a&&la()}}},isFunction:function(a){return $.call(a)==="[object Function]"},isArray:function(a){return $.call(a)==="[object Array]"},isPlainObject:function(a){if (!a||$.call(a)!=="[object Object]"||a.nodeType||a.setInterval)return false;if(a.constructor&&!aa.call(a,"constructor")&&!aa.call(a.constructor.prototype,"isPrototypeOf"))return false;var b;for (b in a);return b===v||aa.call(a,b)},isEmptyObject:function(a){for(var b in a)return false;
-return true},error:function(a){throw a;},parseJSON:function(a){if (typeof a!=="string"||!a)return null;if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return z.JSON&&z.JSON.parse?z.JSON.parse(a):(new Function("return "+a))();else c.error("Invalid JSON: "+a)},noop:function(){},globalEval:function(a){if(a&&Ra.test(a)){var b=r.getElementsByTagName("head")[0]||
-r.documentElement,d=r.createElement("script");d.type="text/javascript";if (c.support.scriptEval)d.appendChild(r.createTextNode(a));else d.text=a;b.insertBefore(d,b.firstChild);b.removeChild(d)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,b,d){var f,e=0,i=a.length,j=i===v||c.isFunction(a);if(d)if(j)for (f in a){if(b.apply(a[f],d)===false)break}else for(;e<i;){if(b.apply(a[e++],d)===false)break}else if(j)for(f in a){if(b.call(a[f],f,a[f])===false)break}else for(d=
-a[0];e<i&&b.call(d,e,d)!==false;d=a[++e]);return a},trim:function(a){return(a||"").replace(Sa,"")},makeArray:function(a,b){b=b||[];if (a!=null)a.length==null||typeof a==="string"||c.isFunction(a)||typeof a!=="function"&&a.setInterval?ba.call(b,a):c.merge(b,a);return b},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for (var d=0,f=b.length;d<f;d++)if(b[d]===a)return d;return-1},merge:function(a,b){var d=a.length,f=0;if(typeof b.length==="number")for(var e=b.length;f<e;f++)a[d++]=b[f];else for(;b[f]!==
-v;)a[d++]=b[f++];a.length=d;return a},grep:function(a,b,d){for (var f=[],e=0,i=a.length;e<i;e++)!d!==!b(a[e],e)&&f.push(a[e]);return f},map:function(a,b,d){for(var f=[],e,i=0,j=a.length;i<j;i++){e=b(a[i],i,d);if (e!=null)f[f.length]=e}return f.concat.apply([],f)},guid:1,proxy:function(a,b,d){if(arguments.length===2)if(typeof b==="string"){d=a;a=d[b];b=v}else if(b&&!c.isFunction(b)){d=b;b=v}if(!b&&a)b=function(){return a.apply(d||this,arguments)};if(a)b.guid=a.guid=a.guid||b.guid||c.guid++;return b},
-uaMatch:function(a){a=a.toLowerCase();a=/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||!/compatible/.test(a)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},browser:{}});O=c.uaMatch(O);if (O.browser){c.browser[O.browser]=true;c.browser.version=O.version}if(c.browser.webkit)c.browser.safari=true;if(wa)c.inArray=function(a,b){return wa.call(b,a)};S=c(r);if(r.addEventListener)L=function(){r.removeEventListener("DOMContentLoaded",
-L,false);c.ready()};else if (r.attachEvent)L=function(){if(r.readyState==="complete"){r.detachEvent("onreadystatechange",L);c.ready()}};(function(){c.support={};var a=r.documentElement,b=r.createElement("script"),d=r.createElement("div"),f="script"+J();d.style.display="none";d.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var e=d.getElementsByTagName("*"),i=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!i)){c.support=
-{leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(i.getAttribute("style")),hrefNormalized:i.getAttribute("href")==="/a",opacity:/^0.55$/.test(i.style.opacity),cssFloat:!!i.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:r.createElement("select").appendChild(r.createElement("option")).selected,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};
-b.type="text/javascript";try{b.appendChild(r.createTextNode("window."+f+"=1;"))}catch(j){}a.insertBefore(b,a.firstChild);if (z[f]){c.support.scriptEval=true;delete z[f]}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function n(){c.support.noCloneEvent=false;d.detachEvent("onclick",n)});d.cloneNode(true).fireEvent("onclick")}d=r.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=r.createDocumentFragment();a.appendChild(d.firstChild);
-c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var n=r.createElement("div");n.style.width=n.style.paddingLeft="1px";r.body.appendChild(n);c.boxModel=c.support.boxModel=n.offsetWidth===2;r.body.removeChild(n).style.display="none"});a=function(n){var o=r.createElement("div");n="on"+n;var m=n in o;if (!m){o.setAttribute(n,"return;");m=typeof o[n]==="function"}return m};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=i=null}})();c.props=
-{"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ua=0,xa={},Va={};c.extend({cache:{},expando:G,noData:{embed:true,object:true,applet:true},data:function(a,b,d){if (!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==z?xa:a;var f=a[G],e=c.cache;if(!b&&!f)return null;f||(f=++Ua);if(typeof b==="object"){a[G]=f;e=e[f]=c.extend(true,
-{},b)}else e=e[f]?e[f]:typeof d==="undefined"?Va:(e[f]={});if (d!==v){a[G]=f;e[b]=d}return typeof b==="string"?e[b]:e}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==z?xa:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{try{delete a[G]}catch(i){a.removeAttribute&&a.removeAttribute(G)}delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,
-a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if (b===v){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===v&&this.length)f=c.data(this[0],a);return f===v&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this,a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);
-return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if (f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===v)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||
-a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var ya=/[\n\t]/g,ca=/\s+/,Wa=/\r/g,Xa=/href|src|style/,Ya=/(button|input)/i,Za=/(button|input|object|select|textarea)/i,$a=/^(a|area)$/i,za=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if (c.isFunction(a))return this.each(function(o){var m=
-c(this);m.addClass(a.call(this,o,m.attr("class")))});if (a&&typeof a==="string")for (var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1)if(e.className)for(var i=" "+e.className+" ",j=0,n=b.length;j<n;j++){if(i.indexOf(" "+b[j]+" ")<0)e.className+=" "+b[j]}else e.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(o){var m=c(this);m.removeClass(a.call(this,o,m.attr("class")))});if(a&&typeof a==="string"||a===v)for(var b=(a||"").split(ca),
-d=0,f=this.length;d<f;d++){var e=this[d];if (e.nodeType===1&&e.className)if(a){for (var i=(" "+e.className+" ").replace(ya," "),j=0,n=b.length;j<n;j++)i=i.replace(" "+b[j]+" "," ");e.className=i.substring(1,i.length-1)}else e.className=""}return this},toggleClass:function(a,b){var d=typeof a,f=typeof b==="boolean";if(c.isFunction(a))return this.each(function(e){var i=c(this);i.toggleClass(a.call(this,e,i.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var e,i=0,j=c(this),n=b,o=
-a.split(ca);e=o[i++];){n=f?n:!j.hasClass(e);j[n?"addClass":"removeClass"](e)}else if (d==="undefined"||d==="boolean"){this.className&&c.data(this,"__className__",this.className);this.className=this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for (var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(ya," ").indexOf(a)>-1)return true;return false},val:function(a){if(a===v){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||
-{}).specified?b.value:b.text;if (c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var i=b?d:0;for (d=b?d+1:e.length;i<d;i++){var j=e[i];if(j.selected){a=c(j).val();if(b)return a;f.push(a)}}return f}if(za.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Wa,"")}return v}var n=c.isFunction(a);return this.each(function(o){var m=c(this),s=a;if(this.nodeType===1){if(n)s=a.call(this,o,m.val());
-if (typeof s==="number")s+="";if(c.isArray(s)&&za.test(this.type))this.checked=c.inArray(m.val(),s)>=0;else if(c.nodeName(this,"select")){var x=c.makeArray(s);c("option",this).each(function(){this.selected=c.inArray(c(this).val(),x)>=0});if(!x.length)this.selectedIndex=-1}else this.value=s}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return v;if(f&&b in c.attrFn)return c(a)[b](d);
-f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==v;b=f&&c.props[b]||b;if (a.nodeType===1){var i=Xa.test(b);if(b in a&&f&&!i){if(e){b==="type"&&Ya.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:Za.test(a.nodeName)||$a.test(a.nodeName)&&a.href?0:v;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=
-""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&i?a.getAttribute(b,2):a.getAttribute(b);return a===null?v:a}return c.style(a,b,d)}});var ab=function(a){return a.replace(/[^\w\s\.\|`]/g,function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if (!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==z&&!a.frameElement)a=z;if(!d.guid)d.guid=c.guid++;if(f!==v){d=c.proxy(d);d.data=f}var e=c.data(a,"events")||c.data(a,"events",{}),i=c.data(a,"handle"),j;if(!i){j=
-function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(j.elem,arguments):v};i=c.data(a,"handle",j)}if (i){i.elem=a;b=b.split(/\s+/);for (var n,o=0;n=b[o++];){var m=n.split(".");n=m.shift();if(o>1){d=c.proxy(d);if(f!==v)d.data=f}d.type=m.slice(0).sort().join(".");var s=e[n],x=this.special[n]||{};if(!s){s=e[n]={};if(!x.setup||x.setup.call(a,f,m,d)===false)if(a.addEventListener)a.addEventListener(n,i,false);else a.attachEvent&&a.attachEvent("on"+n,i)}if(x.add)if((m=x.add.call(a,
-d,f,m,s))&&c.isFunction(m)){m.guid=m.guid||d.guid;m.data=m.data||d.data;m.type=m.type||d.type;d=m}s[d.guid]=d;this.global[n]=true}a=null}}},global:{},remove:function(a,b,d){if (!(a.nodeType===3||a.nodeType===8)){var f=c.data(a,"events"),e,i,j;if(f){if(b===v||typeof b==="string"&&b.charAt(0)===".")for (i in f)this.remove(a,i+(b||""));else{if(b.type){d=b.handler;b=b.type}b=b.split(/\s+/);for(var n=0;i=b[n++];){var o=i.split(".");i=o.shift();var m=!o.length,s=c.map(o.slice(0).sort(),ab);s=new RegExp("(^|\\.)"+
-s.join("\\.(?:.*\\.)?")+"(\\.|$)");var x=this.special[i]||{};if (f[i]){if(d){j=f[i][d.guid];delete f[i][d.guid]}else for (var A in f[i])if(m||s.test(f[i][A].type))delete f[i][A];x.remove&&x.remove.call(a,o,j);for(e in f[i])break;if(!e){if(!x.teardown||x.teardown.call(a,o)===false)if(a.removeEventListener)a.removeEventListener(i,c.data(a,"handle"),false);else a.detachEvent&&a.detachEvent("on"+i,c.data(a,"handle"));e=null;delete f[i]}}}}for(e in f)break;if(!e){if(A=c.data(a,"handle"))A.elem=null;c.removeData(a,
-"events");c.removeData(a,"handle")}}}},trigger:function(a,b,d,f){var e=a.type||a;if (!f){a=typeof a==="object"?a[G]?a:c.extend(c.Event(e),a):c.Event(e);if(e.indexOf("!")>=0){a.type=e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();this.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return v;a.result=v;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,
-b);f=d.parentNode||d.ownerDocument;try{if (!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(i){}if(!a.isPropagationStopped()&&f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){d=a.target;var j;if(!(c.nodeName(d,"a")&&e==="click")&&!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()])){try{if(d[e]){if(j=d["on"+e])d["on"+e]=null;this.triggered=true;d[e]()}}catch(n){}if(j)d["on"+e]=j;this.triggered=false}}},handle:function(a){var b,
-d;a=arguments[0]=c.event.fix(a||z.event);a.currentTarget=this;d=a.type.split(".");a.type=d.shift();b=!d.length&&!a.exclusive;var f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)");d=(c.data(this,"events")||{})[a.type];for (var e in d){var i=d[e];if (b||f.test(i.type)){a.handler=i;a.data=i.data;i=i.apply(this,arguments);if(i!==v){a.result=i;if(i===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
-fix:function(a){if (a[G])return a;var b=a;a=c.Event(b);for (var d=this.props.length,f;d;){f=this.props[--d];a[f]=b[f]}if(!a.target)a.target=a.srcElement||r;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=r.documentElement;d=r.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop||
-d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if (!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==v)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a,b){c.extend(a,b||{});a.guid+=b.selector+b.live;b.liveProxy=a;c.event.add(this,b.live,na,b)},remove:function(a){if(a.length){var b=
-0,d=new RegExp("(^|\\.)"+a[0]+"(\\.|$)");c.each(c.data(this,"events").live||{},function(){d.test(this.type)&&b++});b<1&&c.event.remove(this,a[0],na)}},special:{}},beforeunload:{setup:function(a,b,d){if (this.setInterval)this.onbeforeunload=d;return false},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=a;this.type=a.type}else this.type=a;this.timeStamp=J();this[G]=true};
-c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=Z;var a=this.originalEvent;if (a){a.preventDefault&&a.preventDefault();a.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=Z;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Z;this.stopPropagation()},isDefaultPrevented:Y,isPropagationStopped:Y,isImmediatePropagationStopped:Y};var Aa=function(a){for (var b=
-a.relatedTarget;b&&b!==this;)try{b=b.parentNode}catch(d){break}if (b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}},Ba=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?Ba:Aa,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ba:Aa)}}});if(!c.support.submitBubbles)c.event.special.submit={setup:function(a,b,d){if(this.nodeName.toLowerCase()!==
-"form"){c.event.add(this,"click.specialSubmit."+d.guid,function(f){var e=f.target,i=e.type;if ((i==="submit"||i==="image")&&c(e).closest("form").length)return ma("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit."+d.guid,function(f){var e=f.target,i=e.type;if((i==="text"||i==="password")&&c(e).closest("form").length&&f.keyCode===13)return ma("submit",this,arguments)})}else return false},remove:function(a,b){c.event.remove(this,"click.specialSubmit"+(b?"."+b.guid:""));c.event.remove(this,
-"keypress.specialSubmit"+(b?"."+b.guid:""))}};if (!c.support.changeBubbles){var da=/textarea|input|select/i;function Ca(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d}function ea(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Ca(d);if(a.type!=="focusout"||
-d.type!=="radio")c.data(d,"_change_data",e);if (!(f===v||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}}c.event.special.change={filters:{focusout:ea,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return ea.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return ea.call(this,a)},beforeactivate:function(a){a=
-a.target;a.nodeName.toLowerCase()==="input"&&a.type==="radio"&&c.data(a,"_change_data",Ca(a))}},setup:function(a,b,d){for (var f in T)c.event.add(this,f+".specialChange."+d.guid,T[f]);return da.test(this.nodeName)},remove:function(a,b){for(var d in T)c.event.remove(this,d+".specialChange"+(b?"."+b.guid:""),T[d]);return da.test(this.nodeName)}};var T=c.event.special.change.filters}r.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,
-f)}c.event.special[b]={setup:function(){this.addEventListener(a,d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if (typeof d==="object"){for (var i in d)this[b](i,f,d[i],e);return this}if(c.isFunction(f)){e=f;f=v}var j=b==="one"?c.proxy(e,function(n){c(this).unbind(n,j);return e.apply(this,arguments)}):e;return d==="unload"&&b!=="one"?this.one(d,f,e):this.each(function(){c.event.add(this,d,j,f)})}});c.fn.extend({unbind:function(a,
-b){if (typeof a==="object"&&!a.preventDefault){for (var d in a)this.unbind(d,a[d]);return this}return this.each(function(){c.event.remove(this,a,b)})},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){a=c.Event(a);a.preventDefault();a.stopPropagation();c.event.trigger(a,b,this[0]);return a.result}},toggle:function(a){for(var b=arguments,d=1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(f){var e=(c.data(this,"lastToggle"+
-a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,e+1);f.preventDefault();return b[e].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});c.each(["live","die"],function(a,b){c.fn[b]=function(d,f,e){var i,j=0;if (c.isFunction(f)){e=f;f=v}for (d=(d||"").split(/\s+/);(i=d[j++])!=null;){i=i==="focus"?"focusin":i==="blur"?"focusout":i==="hover"?d.push("mouseleave")&&"mouseenter":i;b==="live"?c(this.context).bind(oa(i,this.selector),{data:f,selector:this.selector,
-live:i},e):c(this.context).unbind(oa(i,this.selector),e?{guid:e.guid+this.selector+i}:null)}return this}});c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){c.fn[b]=function(d){return d?this.bind(b,d):this.trigger(b)};if (c.attrFn)c.attrFn[b]=true});z.attachEvent&&!z.addEventListener&&z.attachEvent("onunload",function(){for (var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});
-(function(){function a(g){for (var h="",k,l=0;g[l];l++){k=g[l];if (k.nodeType===3||k.nodeType===4)h+=k.nodeValue;else if(k.nodeType!==8)h+=a(k.childNodes)}return h}function b(g,h,k,l,q,p){q=0;for(var u=l.length;q<u;q++){var t=l[q];if(t){t=t[g];for(var y=false;t;){if(t.sizcache===k){y=l[t.sizset];break}if(t.nodeType===1&&!p){t.sizcache=k;t.sizset=q}if(t.nodeName.toLowerCase()===h){y=t;break}t=t[g]}l[q]=y}}}function d(g,h,k,l,q,p){q=0;for(var u=l.length;q<u;q++){var t=l[q];if(t){t=t[g];for(var y=false;t;){if(t.sizcache===
-k){y=l[t.sizset];break}if (t.nodeType===1){if(!p){t.sizcache=k;t.sizset=q}if(typeof h!=="string"){if(t===h){y=true;break}}else if(o.filter(h,[t]).length>0){y=t;break}}t=t[g]}l[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,i=Object.prototype.toString,j=false,n=true;[0,0].sort(function(){n=false;return 0});var o=function(g,h,k,l){k=k||[];var q=h=h||r;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||
-typeof g!=="string")return k;for (var p=[],u,t,y,R,H=true,M=w(h),I=g;(f.exec(""),u=f.exec(I))!==null;){I=u[3];p.push(u[1]);if (u[2]){R=u[3];break}}if(p.length>1&&s.exec(g))if(p.length===2&&m.relative[p[0]])t=fa(p[0]+p[1],h);else for(t=m.relative[p[0]]?[h]:o(p.shift(),h);p.length;){g=p.shift();if(m.relative[g])g+=p.shift();t=fa(g,t)}else{if(!l&&p.length>1&&h.nodeType===9&&!M&&m.match.ID.test(p[0])&&!m.match.ID.test(p[p.length-1])){u=o.find(p.shift(),h,M);h=u.expr?o.filter(u.expr,u.set)[0]:u.set[0]}if(h){u=
-l?{expr:p.pop(),set:A(l)}:o.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=u.expr?o.filter(u.expr,u.set):u.set;if (p.length>0)y=A(t);else H=false;for (;p.length;){var D=p.pop();u=D;if(m.relative[D])u=p.pop();else D="";if(u==null)u=h;m.relative[D](y,u,M)}}else y=[]}y||(y=t);y||o.error(D||g);if(i.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))k.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&
-y[g].nodeType===1&&k.push(t[g]);else k.push.apply(k,y);else A(y,k);if (R){o(R,q,k,l);o.uniqueSort(k)}return k};o.uniqueSort=function(g){if(C){j=n;g.sort(C);if(j)for (var h=1;h<g.length;h++)g[h]===g[h-1]&&g.splice(h--,1)}return g};o.matches=function(g,h){return o(g,null,null,h)};o.find=function(g,h,k){var l,q;if(!g)return[];for(var p=0,u=m.order.length;p<u;p++){var t=m.order[p];if(q=m.leftMatch[t].exec(g)){var y=q[1];q.splice(1,1);if(y.substr(y.length-1)!=="\\"){q[1]=(q[1]||"").replace(/\\/g,"");l=m.find[t](q,
-h,k);if (l!=null){g=g.replace(m.match[t],"");break}}}}l||(l=h.getElementsByTagName("*"));return{set:l,expr:g}};o.filter=function(g,h,k,l){for (var q=g,p=[],u=h,t,y,R=h&&h[0]&&w(h[0]);g&&h.length;){for(var H in m.filter)if((t=m.leftMatch[H].exec(g))!=null&&t[2]){var M=m.filter[H],I,D;D=t[1];y=false;t.splice(1,1);if(D.substr(D.length-1)!=="\\"){if(u===p)p=[];if(m.preFilter[H])if(t=m.preFilter[H](t,u,k,p,l,R)){if(t===true)continue}else y=I=true;if(t)for(var U=0;(D=u[U])!=null;U++)if(D){I=M(D,t,U,u);var Da=
-l^!!I;if (k&&I!=null)if(Da)y=true;else u[U]=false;else if(Da){p.push(D);y=true}}if(I!==v){k||(u=p);g=g.replace(m.match[H],"");if(!y)return[];break}}}if(g===q)if(y==null)o.error(g);else break;q=g}return u};o.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var m=o.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
-TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},relative:{"+":function(g,h){var k=typeof h==="string",l=k&&!/\W/.test(h);k=k&&!l;if (l)h=h.toLowerCase();l=0;for (var q=g.length,
-p;l<q;l++)if (p=g[l]){for (;(p=p.previousSibling)&&p.nodeType!==1;);g[l]=k||p&&p.nodeName.toLowerCase()===h?p||false:p===h}k&&o.filter(h,g,true)},">":function(g,h){var k=typeof h==="string";if(k&&!/\W/.test(h)){h=h.toLowerCase();for(var l=0,q=g.length;l<q;l++){var p=g[l];if(p){k=p.parentNode;g[l]=k.nodeName.toLowerCase()===h?k:false}}}else{l=0;for(q=g.length;l<q;l++)if(p=g[l])g[l]=k?p.parentNode:p.parentNode===h;k&&o.filter(h,g,true)}},"":function(g,h,k){var l=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=
-h=h.toLowerCase();q=b}q("parentNode",h,l,g,p,k)},"~":function(g,h,k){var l=e++,q=d;if (typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("previousSibling",h,l,g,p,k)}},find:{ID:function(g,h,k){if(typeof h.getElementById!=="undefined"&&!k)return(g=h.getElementById(g[1]))?[g]:[]},NAME:function(g,h){if(typeof h.getElementsByName!=="undefined"){var k=[];h=h.getElementsByName(g[1]);for (var l=0,q=h.length;l<q;l++)h[l].getAttribute("name")===g[1]&&k.push(h[l]);return k.length===0?null:k}},
-TAG:function(g,h){return h.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,h,k,l,q,p){g=" "+g[1].replace(/\\/g,"")+" ";if (p)return g;p=0;for (var u;(u=h[p])!=null;p++)if(u)if(q^(u.className&&(" "+u.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))k||l.push(u);else if(k)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&
-"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,k,l,q,p){h=g[1].replace(/\\/g,"");if (!p&&m.attrMap[h])g[1]=m.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,k,l,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=o(g[3],null,null,h);else{g=o.filter(g[3],h,k,true^q);k||l.push.apply(l,g);return false}else if(m.match.POS.test(g[0])||m.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);
-return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,k){return!!o(k[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===
-g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},setFilters:{first:function(g,h){return h===0},last:function(g,h,k,l){return h===l.length-1},even:function(g,h){return h%2===
-0},odd:function(g,h){return h%2===1},lt:function(g,h,k){return h<k[3]-0},gt:function(g,h,k){return h>k[3]-0},nth:function(g,h,k){return k[3]-0===h},eq:function(g,h,k){return k[3]-0===h}},filter:{PSEUDO:function(g,h,k,l){var q=h[1],p=m.filters[q];if (p)return p(g,k,h,l);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h=h[3];k=0;for (l=h.length;k<l;k++)if(h[k]===g)return false;return true}else o.error("Syntax error, unrecognized expression: "+
-q)},CHILD:function(g,h){var k=h[1],l=g;switch(k){case "only":case "first":for (;l=l.previousSibling;)if (l.nodeType===1)return false;if(k==="first")return true;l=g;case "last":for(;l=l.nextSibling;)if(l.nodeType===1)return false;return true;case "nth":k=h[2];var q=h[3];if(k===1&&q===0)return true;h=h[0];var p=g.parentNode;if(p&&(p.sizcache!==h||!g.nodeIndex)){var u=0;for(l=p.firstChild;l;l=l.nextSibling)if(l.nodeType===1)l.nodeIndex=++u;p.sizcache=h}g=g.nodeIndex-q;return k===0?g===0:g%k===0&&g/k>=
-0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var k=h[1];g=m.attrHandle[k]?m.attrHandle[k](g):g[k]!=null?g[k]:g.getAttribute(k);k=g+"";var l=h[2];h=h[4];return g==null?l==="!=":l==="="?k===h:l==="*="?k.indexOf(h)>=0:l==="~="?(" "+k+" ").indexOf(h)>=0:!h?k&&g!==false:l==="!="?k!==h:l==="^="?
-k.indexOf(h)===0:l==="$="?k.substr(k.length-h.length)===h:l==="|="?k===h||k.substr(0,h.length+1)===h+"-":false},POS:function(g,h,k,l){var q=m.setFilters[h[2]];if (q)return q(g,k,h,l)}}},s=m.match.POS;for (var x in m.match){m.match[x]=new RegExp(m.match[x].source+/(?![^\[]*\])(?![^\(]*\))/.source);m.leftMatch[x]=new RegExp(/(^(?:.|\r|\n)*?)/.source+m.match[x].source.replace(/\\(\d+)/g,function(g,h){return"\\"+(h-0+1)}))}var A=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};
-try{Array.prototype.slice.call(r.documentElement.childNodes,0)}catch(B){A=function(g,h){h=h||[];if (i.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for (var k=0,l=g.length;k<l;k++)h.push(g[k]);else for(k=0;g[k];k++)h.push(g[k]);return h}}var C;if(r.documentElement.compareDocumentPosition)C=function(g,h){if(!g.compareDocumentPosition||!h.compareDocumentPosition){if(g==h)j=true;return g.compareDocumentPosition?-1:1}g=g.compareDocumentPosition(h)&4?-1:g===
-h?0:1;if (g===0)j=true;return g};else if("sourceIndex"in r.documentElement)C=function(g,h){if(!g.sourceIndex||!h.sourceIndex){if(g==h)j=true;return g.sourceIndex?-1:1}g=g.sourceIndex-h.sourceIndex;if(g===0)j=true;return g};else if(r.createRange)C=function(g,h){if(!g.ownerDocument||!h.ownerDocument){if(g==h)j=true;return g.ownerDocument?-1:1}var k=g.ownerDocument.createRange(),l=h.ownerDocument.createRange();k.setStart(g,0);k.setEnd(g,0);l.setStart(h,0);l.setEnd(h,0);g=k.compareBoundaryPoints(Range.START_TO_END,
-l);if (g===0)j=true;return g};(function(){var g=r.createElement("div"),h="script"+(new Date).getTime();g.innerHTML="<a name='"+h+"'/>";var k=r.documentElement;k.insertBefore(g,k.firstChild);if(r.getElementById(h)){m.find.ID=function(l,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(l[1]))?q.id===l[1]||typeof q.getAttributeNode!=="undefined"&&q.getAttributeNode("id").nodeValue===l[1]?[q]:v:[]};m.filter.ID=function(l,q){var p=typeof l.getAttributeNode!=="undefined"&&l.getAttributeNode("id");
-return l.nodeType===1&&p&&p.nodeValue===q}}k.removeChild(g);k=g=null})();(function(){var g=r.createElement("div");g.appendChild(r.createComment(""));if (g.getElementsByTagName("*").length>0)m.find.TAG=function(h,k){k=k.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for (var l=0;k[l];l++)k[l].nodeType===1&&h.push(k[l]);k=h}return k};g.innerHTML="<a href='#'></a>";if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")m.attrHandle.href=function(h){return h.getAttribute("href",
-2)};g=null})();r.querySelectorAll&&function(){var g=o,h=r.createElement("div");h.innerHTML="<p class='TEST'></p>";if (!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){o=function(l,q,p,u){q=q||r;if(!u&&q.nodeType===9&&!w(q))try{return A(q.querySelectorAll(l),p)}catch(t){}return g(l,q,p,u)};for (var k in g)o[k]=g[k];h=null}}();(function(){var g=r.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===
-0)){g.lastChild.className="e";if (g.getElementsByClassName("e").length!==1){m.order.splice(1,0,"CLASS");m.find.CLASS=function(h,k,l){if(typeof k.getElementsByClassName!=="undefined"&&!l)return k.getElementsByClassName(h[1])};g=null}}})();var E=r.compareDocumentPosition?function(g,h){return g.compareDocumentPosition(h)&16}:function(g,h){return g!==h&&(g.contains?g.contains(h):true)},w=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},fa=function(g,h){var k=[],
-l="",q;for (h=h.nodeType?[h]:h;q=m.match.PSEUDO.exec(g);){l+=q[0];g=g.replace(m.match.PSEUDO,"")}g=m.relative[g]?g+"*":g;q=0;for(var p=h.length;q<p;q++)o(g,h[q],k);return o.filter(l,k)};c.find=o;c.expr=o.selectors;c.expr[":"]=c.expr.filters;c.unique=o.uniqueSort;c.getText=a;c.isXMLDoc=w;c.contains=E})();var bb=/Until$/,cb=/^(?:parents|prevUntil|prevAll)/,db=/,/;Q=Array.prototype.slice;var Ea=function(a,b,d){if (c.isFunction(b))return c.grep(a,function(e,i){return!!b.call(e,i,e)===d});else if(b.nodeType)return c.grep(a,
-function(e){return e===b===d});else if (typeof b==="string"){var f=c.grep(a,function(e){return e.nodeType===1});if(Qa.test(b))return c.filter(b,f,!d);else b=c.filter(b,f)}return c.grep(a,function(e){return c.inArray(e,b)>=0===d})};c.fn.extend({find:function(a){for (var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f<e;f++){d=b.length;c.find(a,this[f],b);if(f>0)for(var i=d;i<b.length;i++)for(var j=0;j<d;j++)if(b[j]===b[i]){b.splice(i--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=
-0,f=b.length;d<f;d++)if (c.contains(this,b[d]))return true})},not:function(a){return this.pushStack(Ea(this,a,false),"not",a)},filter:function(a){return this.pushStack(Ea(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,i={},j;if(f&&a.length){e=0;for (var n=a.length;e<n;e++){j=a[e];i[j]||(i[j]=c.expr.match.POS.test(j)?c(j,b||this.context):j)}for(;f&&f.ownerDocument&&f!==b;){for(j in i){e=i[j];if(e.jquery?e.index(f)>
--1:c(f).is(e)){d.push({selector:j,elem:f});delete i[j]}}f=f.parentNode}}return d}var o=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(m,s){for (;s&&s.ownerDocument&&s!==b;){if (o?o.index(s)>-1:c(s).is(a))return s;s=s.parentNode}return null})},index:function(a){if(!a||typeof a==="string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),
-a);return this.pushStack(pa(a[0])||pa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},
-nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);bb.test(a)||(f=d);if (f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):
-e;if ((this.length>1||db.test(f))&&cb.test(a))e=e.reverse();return this.pushStack(e,a,Q.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for (a=a[b];a&&a.nodeType!==9&&(d===v||a.nodeType!==1||!c(a).is(d));){a.nodeType===1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==
-b&&d.push(a);return d}});var Fa=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ga=/(<([\w:]+)[^>]*?)\/>/g,eb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,Ha=/<([\w:]+)/,fb=/<tbody/i,gb=/<|&\w+;/,sa=/checked\s*(?:[^=]|=\s*.checked.)/i,Ia=function(a,b,d){return eb.test(d)?a:b+"></"+d+">"},F={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],
-col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if (!c.support.htmlSerialize)F._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==v)return this.empty().append((this[0]&&this[0].ownerDocument||r).createTextNode(a));return c.getText(this)},
-wrapAll:function(a){if (c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for (var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?
-d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if (this[0]&&this[0].parentNode)return this.domManip(arguments,
-false,function(b){this.parentNode.insertBefore(b,this)});else if (arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&
-!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if (!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Fa,"").replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){qa(this,b);qa(this.find("*"),b.find("*"))}return b},html:function(a){if(a===v)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Fa,""):null;else if(typeof a==="string"&&!/<script/i.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(Ha.exec(a)||
-["",""])[1].toLowerCase()]){a=a.replace(Ga,Ia);try{for (var b=0,d=this.length;b<d;b++)if (this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(f){this.empty().append(a)}}else c.isFunction(a)?this.each(function(e){var i=c(this),j=i.html();i.empty().append(function(){return a.call(this,e,j)})}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=c(this),f=d.html();d.replaceWith(a.call(this,
-b,f))});else a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){function f(s){return c.nodeName(s,"table")?s.getElementsByTagName("tbody")[0]||s.appendChild(s.ownerDocument.createElement("tbody")):s}var e,i,j=a[0],n=[];if (!c.support.checkClone&&arguments.length===3&&typeof j===
-"string"&&sa.test(j))return this.each(function(){c(this).domManip(a,b,d,true)});if (c.isFunction(j))return this.each(function(s){var x=c(this);a[0]=j.call(this,s,b?x.html():v);x.domManip(a,b,d)});if(this[0]){e=a[0]&&a[0].parentNode&&a[0].parentNode.nodeType===11?{fragment:a[0].parentNode}:ra(a,this,n);if(i=e.fragment.firstChild){b=b&&c.nodeName(i,"tr");for (var o=0,m=this.length;o<m;o++)d.call(b?f(this[o],i):this[o],e.cacheable||this.length>1||o>0?e.fragment.cloneNode(true):e.fragment)}n&&c.each(n,
-Ma)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);for (var e=0,i=d.length;e<i;e++){var j=(e>0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),j);f=f.concat(j)}return this.pushStack(f,a,d.selector)}});c.each({remove:function(a,b){if (!a||c.filter(a,[this]).length){if(!b&&this.nodeType===1){c.cleanData(this.getElementsByTagName("*"));c.cleanData([this])}this.parentNode&&
-this.parentNode.removeChild(this)}},empty:function(){for (this.nodeType===1&&c.cleanData(this.getElementsByTagName("*"));this.firstChild;)this.removeChild(this.firstChild)}},function(a,b){c.fn[a]=function(){return this.each(b,arguments)}});c.extend({clean:function(a,b,d,f){b=b||r;if (typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||r;var e=[];c.each(a,function(i,j){if(typeof j==="number")j+="";if(j){if(typeof j==="string"&&!gb.test(j))j=b.createTextNode(j);else if(typeof j===
-"string"){j=j.replace(Ga,Ia);var n=(Ha.exec(j)||["",""])[1].toLowerCase(),o=F[n]||F._default,m=o[0];i=b.createElement("div");for (i.innerHTML=o[1]+j+o[2];m--;)i=i.lastChild;if (!c.support.tbody){m=fb.test(j);n=n==="table"&&!m?i.firstChild&&i.firstChild.childNodes:o[1]==="<table>"&&!m?i.childNodes:[];for(o=n.length-1;o>=0;--o)c.nodeName(n[o],"tbody")&&!n[o].childNodes.length&&n[o].parentNode.removeChild(n[o])}!c.support.leadingWhitespace&&V.test(j)&&i.insertBefore(b.createTextNode(V.exec(j)[0]),i.firstChild);
-j=c.makeArray(i.childNodes)}if (j.nodeType)e.push(j);else e=c.merge(e,j)}});if(d)for (a=0;e[a];a++)if(f&&c.nodeName(e[a],"script")&&(!e[a].type||e[a].type.toLowerCase()==="text/javascript"))f.push(e[a].parentNode?e[a].parentNode.removeChild(e[a]):e[a]);else{e[a].nodeType===1&&e.splice.apply(e,[a+1,0].concat(c.makeArray(e[a].getElementsByTagName("script"))));d.appendChild(e[a])}return e},cleanData:function(a){for(var b=0,d;(d=a[b])!=null;b++){c.event.remove(d);c.removeData(d)}}});var hb=/z-?index|font-?weight|opacity|zoom|line-?height/i,
-Ja=/alpha\([^)]*\)/,Ka=/opacity=([^)]*)/,ga=/float/i,ha=/-([a-z])/ig,ib=/([A-Z])/g,jb=/^-?\d+(?:px)?$/i,kb=/^-?\d/,lb={position:"absolute",visibility:"hidden",display:"block"},mb=["Left","Right"],nb=["Top","Bottom"],ob=r.defaultView&&r.defaultView.getComputedStyle,La=c.support.cssFloat?"cssFloat":"styleFloat",ia=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if (e===v)return c.curCSS(d,f);if(typeof e==="number"&&!hb.test(f))e+="px";c.style(d,f,e)})};
-c.extend({style:function(a,b,d){if (!a||a.nodeType===3||a.nodeType===8)return v;if((b==="width"||b==="height")&&parseFloat(d)<0)d=v;var f=a.style||a,e=d!==v;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter=Ja.test(a)?a.replace(Ja,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Ka.exec(f.filter)[1])/100+"":""}if(ga.test(b))b=La;b=b.replace(ha,ia);if(e)f[b]=d;return f[b]},css:function(a,
-b,d,f){if (b==="width"||b==="height"){var e,i=b==="width"?mb:nb;function j(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(i,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a,"border"+this+"Width",true))||0})}a.offsetWidth!==0?j():c.swap(a,lb,j);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&
-a.currentStyle){f=Ka.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if (ga.test(b))b=La;if(!d&&e&&e[b])f=e[b];else if(ob){if(ga.test(b))b="float";b=b.replace(ib,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f=a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ha,ia);f=a.currentStyle[b]||a.currentStyle[d];if(!jb.test(f)&&kb.test(f)){b=e.left;var i=a.runtimeStyle.left;a.runtimeStyle.left=
-a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=i}}return f},swap:function(a,b,d){var f={};for (var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if (c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var pb=
-J(),qb=/<script(.|\s)*?\/script>/gi,rb=/select|textarea/i,sb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ja=/\?/,tb=/(\?|&)_=.*?(&|$)/,ub=/^(\w+:)?\/\/([^\/?#]+)/,vb=/%20/g;c.fn.extend({_load:c.fn.load,load:function(a,b,d){if (typeof a!=="string")return this._load(a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=
-c.param(b,c.ajaxSettings.traditional);f="POST"}var i=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(j,n){if (n==="success"||n==="notmodified")i.html(e?c("<div />").append(j.responseText.replace(qb,"")).find(e):j.responseText);d&&i.each(d,[j.responseText,n,j])}});return this},serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&
-(this.checked||rb.test(this.nodeName)||sb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if (c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,
-b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if (c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:z.XMLHttpRequest&&(z.location.protocol!=="file:"||!z.ActiveXObject)?function(){return new z.XMLHttpRequest}:
-function(){try{return new z.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&&e.success.call(o,n,j,w);e.global&&f("ajaxSuccess",[w,e])}function d(){e.complete&&e.complete.call(o,w,j);e.global&&f("ajaxComplete",[w,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}
-function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),i,j,n,o=a&&a.context||e,m=e.type.toUpperCase();if (e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(m==="GET")N.test(e.url)||(e.url+=(ja.test(e.url)?"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||
-N.test(e.url))){i=e.jsonpCallback||"jsonp"+pb++;if (e.data)e.data=(e.data+"").replace(N,"="+i+"$1");e.url=e.url.replace(N,"="+i+"$1");e.dataType="script";z[i]=z[i]||function(q){n=q;b();d();z[i]=v;try{delete z[i]}catch(p){}A&&A.removeChild(B)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache===false&&m==="GET"){var s=J(),x=e.url.replace(tb,"$1_="+s+"$2");e.url=x+(x===e.url?(ja.test(e.url)?"&":"?")+"_="+s:"")}if(e.data&&m==="GET")e.url+=(ja.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&
-c.event.trigger("ajaxStart");s=(s=ub.exec(e.url))&&(s[1]&&s[1]!==location.protocol||s[2]!==location.host);if (e.dataType==="script"&&m==="GET"&&s){var A=r.getElementsByTagName("head")[0]||r.documentElement,B=r.createElement("script");B.src=e.url;if(e.scriptCharset)B.charset=e.scriptCharset;if(!i){var C=false;B.onload=B.onreadystatechange=function(){if(!C&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){C=true;b();d();B.onload=B.onreadystatechange=null;A&&B.parentNode&&
-A.removeChild(B)}}}A.insertBefore(B,A.firstChild);return v}var E=false,w=e.xhr();if (w){e.username?w.open(m,e.url,e.async,e.username,e.password):w.open(m,e.url,e.async);try{if(e.data||a&&a.contentType)w.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&w.setRequestHeader("If-Modified-Since",c.lastModified[e.url]);c.etag[e.url]&&w.setRequestHeader("If-None-Match",c.etag[e.url])}s||w.setRequestHeader("X-Requested-With","XMLHttpRequest");w.setRequestHeader("Accept",
-e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(fa){}if (e.beforeSend&&e.beforeSend.call(o,w,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");w.abort();return false}e.global&&f("ajaxSend",[w,e]);var g=w.onreadystatechange=function(q){if(!w||w.readyState===0||q==="abort"){E||d();E=true;if(w)w.onreadystatechange=c.noop}else if(!E&&w&&(w.readyState===4||q==="timeout")){E=true;w.onreadystatechange=c.noop;j=q==="timeout"?"timeout":!c.httpSuccess(w)?
-"error":e.ifModified&&c.httpNotModified(w,e.url)?"notmodified":"success";var p;if (j==="success")try{n=c.httpData(w,e.dataType,e)}catch(u){j="parsererror";p=u}if(j==="success"||j==="notmodified")i||b();else c.handleError(e,w,j,p);d();q==="timeout"&&w.abort();if(e.async)w=null}};try{var h=w.abort;w.abort=function(){w&&h.call(w);g("abort")}}catch(k){}e.async&&e.timeout>0&&setTimeout(function(){w&&!E&&g("timeout")},e.timeout);try{w.send(m==="POST"||m==="PUT"||m==="DELETE"?e.data:null)}catch(l){c.handleError(e,
-w,null,l);d()}e.async||g();return w}},handleError:function(a,b,d,f){if (a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=
-f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if (d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b==="json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(j,n){if(c.isArray(n))c.each(n,
-function(o,m){b?f(j,m):d(j+"["+(typeof m==="object"||c.isArray(m)?o:"")+"]",m)});else!b&&n!=null&&typeof n==="object"?c.each(n,function(o,m){d(j+"["+o+"]",m)}):f(j,n)}function f(j,n){n=c.isFunction(n)?n():n;e[e.length]=encodeURIComponent(j)+"="+encodeURIComponent(n)}var e=[];if (b===v)b=c.ajaxSettings.traditional;if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for (var i in a)d(i,a[i]);return e.join("&").replace(vb,"+")}});var ka={},wb=/toggle|show|hide/,xb=/^([+-]=)?([\d+-.]+)(.*)$/,
-W,ta=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if (a||a===0)return this.animate(K("show",3),a,b);else{a=0;for (b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");this[a].style.display=d||"";if(c.css(this[a],"display")==="none"){d=this[a].nodeName;var f;if(ka[d])f=ka[d];else{var e=c("<"+d+" />").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();
-ka[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for (b=this.length;a<b;a++)this[a].style.display=c.data(this[a],"olddisplay")||"";return this}},hide:function(a,b){if (a||a===0)return this.animate(K("hide",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");!d&&d!=="none"&&c.data(this[a],"olddisplay",c.css(this[a],"display"))}a=0;for(b=this.length;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b){var d=typeof a==="boolean";if(c.isFunction(a)&&
-c.isFunction(b))this._toggle.apply(this,arguments);else a==null||d?this.each(function(){var f=d?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(K("toggle",3),a,b);return this},fadeTo:function(a,b,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d)},animate:function(a,b,d,f){var e=c.speed(b,d,f);if (c.isEmptyObject(a))return this.each(e.complete);return this[e.queue===false?"each":"queue"](function(){var i=c.extend({},e),j,n=this.nodeType===1&&c(this).is(":hidden"),
-o=this;for (j in a){var m=j.replace(ha,ia);if (j!==m){a[m]=a[j];delete a[j];j=m}if(a[j]==="hide"&&n||a[j]==="show"&&!n)return i.complete.call(this);if((j==="height"||j==="width")&&this.style){i.display=c.css(this,"display");i.overflow=this.style.overflow}if(c.isArray(a[j])){(i.specialEasing=i.specialEasing||{})[j]=a[j][1];a[j]=a[j][0]}}if(i.overflow!=null)this.style.overflow="hidden";i.curAnim=c.extend({},a);c.each(a,function(s,x){var A=new c.fx(o,i,s);if(wb.test(x))A[x==="toggle"?n?"show":"hide":x](a);
-else{var B=xb.exec(x),C=A.cur(true)||0;if (B){x=parseFloat(B[2]);var E=B[3]||"px";if(E!=="px"){o.style[s]=(x||1)+E;C=(x||1)/A.cur(true)*C;o.style[s]=C+E}if(B[1])x=(B[1]==="-="?-1:1)*x+C;A.custom(C,x,E)}else A.custom(C,x,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);this.each(function(){for (var f=d.length-1;f>=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",
-1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration==="number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,
-b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if (!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==
-null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(i){return e.step(i)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;var e=this;f.elem=this.elem;if (f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop===
-"width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if (a||b>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for (var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=
-this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if (c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for (var e in this.options.curAnim)c.style(this.elem,e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=
-c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for (var a=c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||c.fx.stop()},stop:function(){clearInterval(W);W=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if (a.elem.style&&a.elem.style[a.prop]!=
-null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if (c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===b.elem}).length};c.fn.offset="getBoundingClientRect"in r.documentElement?function(a){var b=this[0];if(a)return this.each(function(e){c.offset.setOffset(this,a,e)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);var d=b.getBoundingClientRect(),
-f=b.ownerDocument;b=f.body;f=f.documentElement;return{top:d.top+(self.pageYOffset||c.support.boxModel&&f.scrollTop||b.scrollTop)-(f.clientTop||b.clientTop||0),left:d.left+(self.pageXOffset||c.support.boxModel&&f.scrollLeft||b.scrollLeft)-(f.clientLeft||b.clientLeft||0)}}:function(a){var b=this[0];if (a)return this.each(function(s){c.offset.setOffset(this,a,s)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d=b.offsetParent,f=
-b,e=b.ownerDocument,i,j=e.documentElement,n=e.body;f=(e=e.defaultView)?e.getComputedStyle(b,null):b.currentStyle;for (var o=b.offsetTop,m=b.offsetLeft;(b=b.parentNode)&&b!==n&&b!==j;){if (c.offset.supportsFixedPosition&&f.position==="fixed")break;i=e?e.getComputedStyle(b,null):b.currentStyle;o-=b.scrollTop;m-=b.scrollLeft;if(b===d){o+=b.offsetTop;m+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(b.nodeName))){o+=parseFloat(i.borderTopWidth)||
-0;m+=parseFloat(i.borderLeftWidth)||0}f=d;d=b.offsetParent}if (c.offset.subtractsBorderForOverflowNotVisible&&i.overflow!=="visible"){o+=parseFloat(i.borderTopWidth)||0;m+=parseFloat(i.borderLeftWidth)||0}f=i}if(f.position==="relative"||f.position==="static"){o+=n.offsetTop;m+=n.offsetLeft}if(c.offset.supportsFixedPosition&&f.position==="fixed"){o+=Math.max(j.scrollTop,n.scrollTop);m+=Math.max(j.scrollLeft,n.scrollLeft)}return{top:o,left:m}};c.offset={initialize:function(){var a=r.body,b=r.createElement("div"),
-d,f,e,i=parseFloat(c.curCSS(a,"marginTop",true))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";a.insertBefore(b,a.firstChild);
-d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i;a.removeChild(b);c.offset.initialize=c.noop},
-bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if (c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),i=parseInt(c.curCSS(a,"top",true),10)||0,j=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a,d,e);d={top:b.top-e.top+i,left:b.left-
-e.left+j};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if (!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top-f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for (var a=
-this.offsetParent||r.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],i;if (!e)return null;if(f!==v)return this.each(function(){if(i=ua(this))i.scrollTo(!a?f:c(i).scrollLeft(),a?f:c(i).scrollTop());else this[d]=f});else return(i=ua(e))?"pageXOffset"in i?i[a?"pageYOffset":"pageXOffset"]:c.support.boxModel&&i.document.documentElement[d]||i.document.body[d]:e[d]}});
-c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if (!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(i){var j=c(this);j[d](f.call(this,i,j[d]()))});return"scrollTo"in e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||
-e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===v?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});z.jQuery=z.$=c})(window);
diff --git a/doc/config/scripts/narrow.js b/doc/config/scripts/narrow.js
deleted file mode 100644
index c64516eb..00000000
--- a/doc/config/scripts/narrow.js
+++ /dev/null
@@ -1,133 +0,0 @@
-/* This function generates menus and search box in narrow/slim fit mode */
-var narrowInit = function() {
- /* 1: Create search form */
- var narrowSearch = $('<div id="narrowsearch"></div>');
- var searchform = $("#qtdocsearch");
- narrowSearch.append(searchform);
- $("#qtdocheader .content .qtref").after(narrowSearch);
-
- /* 2: Create dropdowns */
- var narrowmenu = $('<ul id="narrowmenu" class="sf-menu"></ul>');
-
- /* Lookup */
- var lookuptext = $("#lookup h2").attr("title");
- $("#lookup ul").removeAttr("id");
- $("#lookup ul li").removeAttr("class");
- $("#lookup ul li").removeAttr("style");
- var lookupul = $("#lookup ul");
- var lookuplist = $('<li></li>');
- var lookuplink = $('<a href="#"></a>');
- lookuplink.append(lookuptext);
- lookuplist.append(lookuplink);
- lookuplist.append(lookupul);
- narrowmenu.append(lookuplist);
-
- /* Topics */
- var topicstext = $("#topics h2").attr("title");
- $("#topics ul").removeAttr("id");
- $("#topics ul li").removeAttr("class");
- $("#topics ul li").removeAttr("style");
- var topicsul = $("#topics ul");
- var topicslist = $('<li></li>');
- var topicslink = $('<a href="#"></a>');
- topicslink.append(topicstext);
- topicslist.append(topicslink);
- topicslist.append(topicsul);
- narrowmenu.append(topicslist);
-
- /* Examples */
- var examplestext = $("#examples h2").attr("title");
- $("#examples ul").removeAttr("id");
- $("#examples ul li").removeAttr("class");
- $("#examples ul li").removeAttr("style");
- var examplesul = $("#examples ul");
- var exampleslist = $('<li></li>');
- var exampleslink = $('<a href="#"></a>');
- exampleslink.append(examplestext);
- exampleslist.append(exampleslink);
- exampleslist.append(examplesul);
- narrowmenu.append(exampleslist);
-
- $("#shortCut").after(narrowmenu);
- $('ul#narrowmenu').superfish({
- delay: 100,
- autoArrows: false,
- disableHI: true
- });
-}
-
-/* Executes on doc ready */
-$(document).ready(function(){
- /* check if body has the narrow class */
- if ($('body').hasClass('narrow')) {
- /* run narrowInit */
- narrowInit();
- }
-
- /* messure window width and add class if it is smaller than 600 px */
- if ($(window).width()<600) {
- $('body').addClass('narrow');
- /* if the search box contains */
- if ($("#narrowsearch").length == 0) {
- /* run narrowInit */
- narrowInit();
- }
- }
- else { /* if the window is wider than 600 px, narrow is removed */
- $('body').removeClass('narrow');
- if ($("#narrowsearch").length == 0) {
- }
- }
-});
-/* binding resize event to this funciton */
-$(window).bind('resize', function () {
- /* if the window is wider than 600 px, narrow class is added */
- if ($(window).width()<600) {
- $('body').addClass('narrow');
- if ($("#narrowsearch").length == 0) {
- narrowInit();
- }
- }
- else {
- /* else we remove the narrow class */
- $('body').removeClass('narrow');
- }
-});
-
- $('#narrowsearch').keyup(function () {
- /* extract the search box content */
- var searchString = $('#narrowsearch').val();
- /* if the string is less than three characters */
- if ((searchString == null) || (searchString.length < 3)) {
- /* remove classes and elements*/
- $('#narrowsearch').removeClass('loading');
- $('.searching').remove();
- /* run CheckEmptyAndLoadList */
- CheckEmptyAndLoadList();
-
- $('.report').remove();
- return;
- }
- /* if timer checks out */
- if (this.timer) clearTimeout(this.timer);
- this.timer = setTimeout(function () {
- /* add loading image by adding loading class */
- $('#narrowsearch').addClass('loading');
- $('.searching').remove();
-
- /* run the actual search */
- $.ajax({
- contentType: "application/x-www-form-urlencoded",
- url: 'http://' + location.host + '/nokiasearch/GetDataServlet',
- data: 'searchString='+searchString,
- dataType:'xml',
- type: 'post',
- success: function (response, textStatus) {
- /* on success remove loading img */
- $('.searching').remove();
- $('#narrowsearch').removeClass('loading');
- processNokiaData(response);
- }
- });
- }, 500); /* timer set to 500 ms */
- });
diff --git a/doc/config/scripts/superfish.js b/doc/config/scripts/superfish.js
deleted file mode 100644
index d1d33d0c..00000000
--- a/doc/config/scripts/superfish.js
+++ /dev/null
@@ -1,121 +0,0 @@
-
-/*
- * Superfish v1.4.8 - jQuery menu widget
- * Copyright (c) 2008 Joel Birch
- *
- * Dual licensed under the MIT and GPL licenses:
- * http://www.opensource.org/licenses/mit-license.php
- * http://www.gnu.org/licenses/gpl.html
- *
- * CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt
- */
-
-;(function($){
- $.fn.superfish = function(op){
-
- var sf = $.fn.superfish,
- c = sf.c,
- $arrow = $(['<span class="',c.arrowClass,'"> &#187;</span>'].join('')),
- over = function(){
- var $$ = $(this), menu = getMenu($$);
- clearTimeout(menu.sfTimer);
- $$.showSuperfishUl().siblings().hideSuperfishUl();
- },
- out = function(){
- var $$ = $(this), menu = getMenu($$), o = sf.op;
- clearTimeout(menu.sfTimer);
- menu.sfTimer=setTimeout(function(){
- o.retainPath=($.inArray($$[0],o.$path)>-1);
- $$.hideSuperfishUl();
- if (o.$path.length && $$.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path);}
- },o.delay);
- },
- getMenu = function($menu){
- var menu = $menu.parents(['ul.',c.menuClass,':first'].join(''))[0];
- sf.op = sf.o[menu.serial];
- return menu;
- },
- addArrow = function($a){ $a.addClass(c.anchorClass).append($arrow.clone()); };
-
- return this.each(function() {
- var s = this.serial = sf.o.length;
- var o = $.extend({},sf.defaults,op);
- o.$path = $('li.'+o.pathClass,this).slice(0,o.pathLevels).each(function(){
- $(this).addClass([o.hoverClass,c.bcClass].join(' '))
- .filter('li:has(ul)').removeClass(o.pathClass);
- });
- sf.o[s] = sf.op = o;
-
- $('li:has(ul)',this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over,out).each(function() {
- if (o.autoArrows) addArrow( $('>a:first-child',this) );
- })
- .not('.'+c.bcClass)
- .hideSuperfishUl();
-
- var $a = $('a',this);
- $a.each(function(i){
- var $li = $a.eq(i).parents('li');
- $a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);});
- });
- o.onInit.call(this);
-
- }).each(function() {
- var menuClasses = [c.menuClass];
- if (sf.op.dropShadows && !($.browser.msie && $.browser.version < 7)) menuClasses.push(c.shadowClass);
- $(this).addClass(menuClasses.join(' '));
- });
- };
-
- var sf = $.fn.superfish;
- sf.o = [];
- sf.op = {};
- sf.IE7fix = function(){
- var o = sf.op;
- if ($.browser.msie && $.browser.version > 6 && o.dropShadows && o.animation.opacity!=undefined)
- this.toggleClass(sf.c.shadowClass+'-off');
- };
- sf.c = {
- bcClass : 'sf-breadcrumb',
- menuClass : 'sf-js-enabled',
- anchorClass : 'sf-with-ul',
- arrowClass : 'sf-sub-indicator',
- shadowClass : 'sf-shadow'
- };
- sf.defaults = {
- hoverClass : 'sfHover',
- pathClass : 'overideThisToUse',
- pathLevels : 1,
- delay : 800,
- animation : {opacity:'show'},
- speed : 'normal',
- autoArrows : true,
- dropShadows : true,
- disableHI : false, // true disables hoverIntent detection
- onInit : function(){}, // callback functions
- onBeforeShow: function(){},
- onShow : function(){},
- onHide : function(){}
- };
- $.fn.extend({
- hideSuperfishUl : function(){
- var o = sf.op,
- not = (o.retainPath===true) ? o.$path : '';
- o.retainPath = false;
- var $ul = $(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass)
- .find('>ul').hide().css('visibility','hidden');
- o.onHide.call($ul);
- return this;
- },
- showSuperfishUl : function(){
- var o = sf.op,
- sh = sf.c.shadowClass+'-off',
- $ul = this.addClass(o.hoverClass)
- .find('>ul:hidden').css('visibility','visible');
- sf.IE7fix.call($ul);
- o.onBeforeShow.call($ul);
- $ul.animate(o.animation,o.speed,function(){ sf.IE7fix.call($ul); o.onShow.call($ul); });
- return this;
- }
- });
-
-})(jQuery);
diff --git a/doc/config/style/narrow.css b/doc/config/style/narrow.css
deleted file mode 100644
index 39b47400..00000000
--- a/doc/config/style/narrow.css
+++ /dev/null
@@ -1,271 +0,0 @@
- /* start narrow mode */
-
- body.narrow
- {
- background-image: none;
- }
-
- .narrow a {
- color: #00732f;
- }
-
- .narrow .header, .narrow .header .content, .narrow .footer, .narrow .wrapper {
- margin: 0 7px;
- min-width: 300px;
- }
-
- .narrow .footer {
- margin: 0px;
- }
-
- .creator .header, .creator .header .content, .creator .footer, .creator .wrapper {
- margin: 0px;
- min-width: 300px;
- }
- .narrow .header
- {
- width: 100%;
- margin: 0;
- height: auto;
- background: #fff url(../images/header_bg.png) repeat-x 0 100%;
- padding: 10px 0 5px 0;
- overflow: visible;
- }
-
- .narrow .header .content
- {
- }
-
- .narrow .header #nav-logo
- {
- display: none;
- }
-
- .narrow .header .qtref
- {
- width: auto;
- height: auto;
- color: #00732f;
- position: static;
- float: left;
- margin-left: 25px;
- font: bold 18px/1 Arial;
- }
-
- .narrow .header .qtref a
- {
- color: #00732F;
- }
-
- .narrow .header .qtref span
- {
- background-image: none;
- text-indent: 0;
- width: 260px;
- }
-
- .narrow .header #nav-topright
- {
- display: none;
- }
-
- .narrow .header #shortCut
- {
- clear: both;
- font-weight: normal;
- position: static;
- float: left;
- margin: 15px 0 0 25px;
- overflow: hidden;
- padding: 0;
- height: auto;
- }
-
- .narrow .header #shortCut ul
- {
- float: none;
- margin: 0;
- width: auto;
- font-size: 11px;
- }
-
- .narrow .header #shortCut ul li
- {
- background-image: none;
- }
-
- .narrow .header #shortCut ul .shortCut-topleft-active,
- .narrow .header #shortCut ul .shortCut-topleft-inactive
- {
- background-image: none;
- height: auto;
- padding: 0;
- width: auto;
- }
- .narrow .header #shortCut ul li a
- {
- color: #00732F;
- }
-
- .narrow .wrapper .hd
- {
- background: url(../images/bg_ul_blank.png) no-repeat 0 0;
- }
-
- .narrow .wrapper .bd
- {
- background: url(../images/bg_l_blank.png) repeat-y 0 0;
- }
-
- .narrow .wrapper .ft
- {
- background: url(../images/bg_ll_blank.png) no-repeat 0 0;
- }
-
- .narrow .sidebar
- {
- display: none;
- }
-
- .narrow .wrap
- {
- margin: 0 5px 0 5px;
- }
-
- .creator .wrap
- {
- margin: 0px;
- background:#FFFFFF;
- }
- .narrow .wrap .toolbar
- {
- border-bottom: none;
- }
-
- .narrow .wrap .content
- {
- padding-top: 15px;
- }
- .creator .wrap .content
- {
- padding-top: 10px;
- }
- .creator .wrap .content .guide
- {
- padding-top: 15px;
- }
- .narrow .wrap .feedback
- {
- display: none;
- }
-
- .narrow .wrap .breadcrumb ul li {
- font-weight: normal;
- }
-
- .narrow .wrap .breadcrumb ul li a {
- color: #00732f;
- }
-
- .narrow .wrap .breadcrumb ul li.last a {
- color: #363534;
- }
-
- #narrowsearch {
- display: none;
- }
-
- .narrow #narrowsearch {
- display: block;
- float: right;
- margin-right: 25px;
- _position: relative;
- }
-
- .narrow #narrowsearch fieldset {
- _position: absolute;
- _margin-top: -1px;
- }
-
- .narrow #narrowsearch {
- background: url("http://doc.qt.nokia.com/prototype/html/images/sprites-combined.png") no-repeat scroll -6px -348px transparent;
- height: 21px;
- padding: 2px 0 0 5px;
- width: 167px;
- }
-
- .narrow #narrowsearch input {
- border: none;
- font: 13px/1.2 Verdana;
- height: 19px;
- outline: none;
- padding: 0;
- width: 158px;
- *border: 1px solid #fff;
- *height: 17px;
- _height: 18px;
- }
- .narrow .indexbox .indexIcon {
- display: none;
- }
-
- .narrow .indexboxcont .section {
- width: 64%;
- padding-left: 0;
- }
-
- .narrow .indexboxcont .sectionlist {
- width: 32.5%;
- }
-
- #narrowmenu {
- display: none;
- float: right;
- margin: 15px 40px 0 0;
- font-size: 11px;
- position: relative;
- }
-
- .narrow #narrowmenu {
- display: block;
- }
-
- #narrowmenu a {
- line-height: 1.1;
- background: url(../images/arrow_down.png) no-repeat 100% 50%;
- white-space: nowrap;
- padding: 0 16px 0 5px;
- }
-
- #narrowmenu li {
- margin-left: 20px;
- }
-
- #narrowmenu li li {
- margin: 0 0 5px 0;
- }
-
- #narrowmenu li li a {
- padding: 0;
- background-image: none;
- }
-
- #narrowmenu li,
- #narrowmenu li ul {
- background-color: #fff;
- margin-top:-1px;
- }
-
- #narrowmenu li ul {
- width: auto;
- padding: 5px;
- }
-
- .sf-menu li:hover ul, .sf-menu li.sfHover ul {
- top: 1.2em;
- }
-
- /* end narrow mode */
- .creator #narrowsearch, .creator #narrowmenu{
- display:none;
- }
diff --git a/doc/config/style/offline.css b/doc/config/style/offline.css
deleted file mode 100644
index 3689ee8d..00000000
--- a/doc/config/style/offline.css
+++ /dev/null
@@ -1,673 +0,0 @@
-@media screen
-{
-
-/* basic elements */
- html
- {
- color: #000000;
- background: #FFFFFF;
- }
- table
- {
- border-collapse: collapse;
- border-spacing: 0;
- }
- fieldset, img
- {
- border: 0;
- max-width:100%;
- }
- address, caption, cite, code, dfn, em, strong, th, var, optgroup
- {
- font-style: inherit;
- font-weight: inherit;
- }
- del, ins
- {
- text-decoration: none;
- }
- li
- {
- list-style: none;
- }
- ol li
- {
- list-style: decimal;
- }
- caption, th
- {
- text-align: left;
- }
- h1, h2, h3, h4, h5, h6
- {
- font-size: 100%;
- }
- q:before, q:after
- {
- content: '';
- }
- abbr, acronym
- {
- border: 0;
- font-variant: normal;
- }
- sup, sub
- {
- vertical-align: baseline;
- }
- tt, .qmlreadonly span, .qmldefault span
- {
- word-spacing:0.5em;
- }
- legend
- {
- color: #000000;
- }
- strong
- {
- font-weight: bold;
- }
- em
- {
- font-style: italic;
- }
-
- body
- {
- margin-left: 0.5em;
- margin-right: 0.5em;
- }
- a
- {
- color: #00732F;
- text-decoration: none;
- }
- hr
- {
- background-color: #E6E6E6;
- border: 1px solid #E6E6E6;
- height: 1px;
- width: 100%;
- text-align: left;
- margin: 1.5em 0 1.5em 0;
- }
-
- pre
- {
- border: 1px solid #DDDDDD;
- -moz-border-radius: 0.7em 0.7em 0.7em 0.7em;
- -webkit-border-radius: 0.7em 0.7em 0.7em 0.7em;
- border-radius: 0.7em 0.7em 0.7em 0.7em;
- margin: 0 1.5em 1em 1em;
- padding: 1em 1em 1em 1em;
- overflow-x: auto;
- }
- table, pre
- {
- -moz-border-radius: 0.7em 0.7em 0.7em 0.7em;
- -webkit-border-radius: 0.7em 0.7em 0.7em 0.7em;
- border-radius: 0.7em 0.7em 0.7em 0.7em;
- background-color: #F6F6F6;
- border: 1px solid #E6E6E6;
- border-collapse: separate;
- margin-bottom: 2.5em;
- }
- pre {
- font-size: 90%;
- display: block;
- overflow:hidden;
- }
- thead
- {
- margin-top: 0.5em;
- font-weight: bold
- }
- th
- {
- padding: 0.5em 1.5em 0.5em 1.5em;
- background-color: #E1E1E1;
- border-left: 1px solid #E6E6E6;
- }
- td
- {
- padding: 0.25em 1.5em 0.25em 2em;
- }
-
- td.rightAlign
- {
- padding: 0.25em 0.5em 0.25em 1em;
- }
- table tr.odd
- {
- border-left: 1px solid #E6E6E6;
- background-color: #F6F6F6;
- color: #66666E;
- }
- table tr.even
- {
- border-left: 1px solid #E6E6E6;
- background-color: #ffffff;
- color: #66666E;
- }
-
- div.float-left
- {
- float: left; margin-right: 2em
- }
- div.float-right
- {
- float: right; margin-left: 2em
- }
-
- span.comment
- {
- color: #008B00;
- font-style: italic
- }
- span.string, span.char
- {
- color: #000084;
- }
- span.number
- {
- color: #a46200;
- }
- span.operator
- {
- color: #202020;
- }
- span.keyword
- {
- color: #840000;
- }
- span.name
- {
- color: black
- }
- span.type
- {
- font-weight: bold
- }
- span.type a:visited
- {
- color: #0F5300;
- }
- span.preprocessor
- {
- color: #404040
- }
-/* end basic elements */
-
-/* font style elements */
- .heading
- {
- font-weight: bold;
- font-size: 125%;
- }
- .subtitle
- {
- font-size: 110%
- }
- .small-subtitle
- {
- font-size: 100%
- }
- .red
- {
- color:red;
- }
-/* end font style elements */
-
-/* global settings*/
- .header, .footer
- {
- display: block;
- clear: both;
- overflow: hidden;
- }
-/* end global settings*/
-
-/* header elements */
- .header .qtref
- {
- color: #00732F;
- font-weight: bold;
- font-size: 130%;
- }
-
- .header .content
- {
- margin-bottom: 0.5em
- }
-
- .naviNextPrevious
- {
- display: none
- }
- .header .breadcrumb
- {
- font-size: 90%;
- padding: 0.5em 0 0.5em 1em;
- margin: 0;
- background-color: #fafafa;
- height: 1.35em;
- border-bottom: 1px solid #d1d1d1;
- }
-
- .header .breadcrumb ul
- {
- margin: 0;
- padding: 0;
- }
-
- .header .content
- {
- word-wrap: break-word;
- }
-
- .header .breadcrumb ul li
- {
- float: left;
- background: url(../images/breadcrumb.png) no-repeat 0 3px;
- padding-left: 1.5em;
- margin-left: 1.5em;
- }
-
- .header .breadcrumb ul li.last
- {
- font-weight: normal;
- }
-
- .header .breadcrumb ul li a
- {
- color: #00732F;
- }
-
- .header .breadcrumb ul li.first
- {
- background-image: none;
- padding-left: 0;
- margin-left: 0;
- }
-
- .header .content ol li {
- background: none;
- margin-bottom: 1.0em;
- margin-left: 1.2em;
- padding-left: 0
- }
-
- .header .content li
- {
- background: url(../images/bullet_sq.png) no-repeat 0 5px;
- margin-bottom: 1em;
- padding-left: 1.2em;
- }
-
-/* end header elements */
-
-/* content elements */
- .content h1
- {
- font-weight: bold;
- font-size: 150%
- }
-
- .content h2
- {
- font-weight: bold;
- font-size: 135%;
- width: 100%;
- }
- .content h3
- {
- font-weight: bold;
- font-size: 120%;
- width: 100%;
- }
- .content table p
- {
- margin: 0
- }
- .content ul
- {
- padding-left: 2.5em;
- }
- .content li
- {
- padding-top: 0.25em;
- padding-bottom: 0.25em;
- }
- .content ul img {
- vertical-align: middle;
- }
-
- .content a:visited
- {
- color: #4c0033;
- text-decoration: none;
- }
-
- .content a:visited:hover
- {
- color: #4c0033;
- text-decoration: underline;
- }
-
- a:hover
- {
- color: #4c0033;
- text-decoration: underline;
- }
- descr p a
- {
- text-decoration: underline;
- }
-
- .descr p a:visited
- {
- text-decoration: underline;
- }
-
- .alphaChar{
- width:95%;
- background-color:#F6F6F6;
- border:1px solid #E6E6E6;
- -moz-border-radius: 7px 7px 7px 7px;
- border-radius: 7px 7px 7px 7px;
- -webkit-border-radius: 7px 7px 7px 7px;
- font-size:12pt;
- padding-left:10px;
- margin-top:10px;
- margin-bottom:10px;
- }
- .flowList{
- /*vertical-align:top;*/
- /*margin:20px auto;*/
-
- column-count:3;
- -webkit-column-count:3;
- -moz-column-count:3;
-/*
- column-width:100%;
- -webkit-column-width:200px;
- -col-column-width:200px;
-*/
- column-gap:41px;
- -webkit-column-gap:41px;
- -moz-column-gap:41px;
-
- column-rule: 1px dashed #ccc;
- -webkit-column-rule: 1px dashed #ccc;
- -moz-column-rule: 1px dashed #ccc;
- }
-
- .flowList dl{
- }
- .flowList dd{
- /*display:inline-block;*/
- margin-left:10px;
- min-width:250px;
- line-height: 1.5;
- min-width:100%;
- min-height:15px;
- }
-
- .flowList dd a{
- }
-
- .content .flowList p{
- padding:0px;
- }
-
- .content .alignedsummary
- {
- margin: 15px;
- }
-
-
- .qmltype
- {
- text-align: center;
- font-size: 120%;
- }
- .qmlreadonly
- {
- padding-left: 5px;
- float: right;
- color: #254117;
- }
-
- .qmldefault
- {
- padding-left: 5px;
- float: right;
- color: red;
- }
-
- .qmldoc
- {
- }
-
- .generic .alphaChar{
- margin-top:5px;
- }
-
- .generic .odd .alphaChar{
- background-color: #F6F6F6;
- }
-
- .generic .even .alphaChar{
- background-color: #FFFFFF;
- }
-
- .memItemRight{
- padding: 0.25em 1.5em 0.25em 0;
- }
- .highlightedCode
- {
- margin: 1.0em;
- }
- .annotated td {
- padding: 0.25em 0.5em 0.25em 0.5em;
- }
-
- .header .content .toc ul
- {
- padding-left: 0px;
- }
-
- .content .toc h3 {
- border-bottom: 0px;
- margin-top: 0px;
- }
-
- .content .toc h3 a:hover {
- color: #00732F;
- text-decoration: none;
- }
-
- .content .toc .level2
- {
- margin-left: 1.5em;
- }
-
- .content .toc .level3
- {
- margin-left: 3.0em;
- }
-
- .content ul li
- {
- background: url(../images/bullet_sq.png) no-repeat 0 0.7em;
- padding-left: 1em
- }
-
- .content .toc li
- {
- background: url(../images/bullet_dn.png) no-repeat 0 5px;
- padding-left: 1em
- }
-
- .relpage
- {
- -moz-border-radius: 7px 7px 7px 7px;
- -webkit-border-radius: 7px 7px 7px 7px;
- border-radius: 7px 7px 7px 7px;
- border: 1px solid #DDDDDD;
- padding: 25px 25px;
- clear: both;
- }
- .relpage ul
- {
- float: none;
- padding: 1.5em;
- }
-
- h3.fn, span.fn
- {
- -moz-border-radius:7px 7px 7px 7px;
- -webkit-border-radius:7px 7px 7px 7px;
- border-radius:7px 7px 7px 7px;
- background-color: #F6F6F6;
- border-width: 1px;
- border-style: solid;
- border-color: #E6E6E6;
- font-weight: bold;
- word-spacing:3px;
- padding:3px 5px;
- }
-
- .functionIndex {
- font-size:12pt;
- word-spacing:10px;
- margin-bottom:10px;
- background-color: #F6F6F6;
- border-width: 1px;
- border-style: solid;
- border-color: #E6E6E6;
- -moz-border-radius: 7px 7px 7px 7px;
- -webkit-border-radius: 7px 7px 7px 7px;
- border-radius: 7px 7px 7px 7px;
- width:100%;
- }
-
- .centerAlign
- {
- text-align:center;
- }
-
- .rightAlign
- {
- text-align:right;
- }
-
- .leftAlign
- {
- text-align:left;
- }
-
- .topAlign{
- vertical-align:top
- }
-
- .functionIndex a{
- display:inline-block;
- }
-
-/* end content elements */
-/* footer elements */
-
- .footer
- {
- color: #393735;
- font-size: 0.75em;
- text-align: center;
- padding-top: 1.5em;
- padding-bottom: 1em;
- background-color: #E6E7E8;
- margin: 0;
- }
- .footer p
- {
- margin: 0.25em
- }
- .small
- {
- font-size: 0.5em;
- }
-/* end footer elements */
-
- .item {
- float: left;
- position: relative;
- width: 100%;
- overflow: hidden;
- }
-
-
- .item .primary {
- margin-right: 220px;
- position: relative;
- }
-
- .item hr {
- margin-left: -220px;
- }
-
- .item .secondary {
- float: right;
- width: 200px;
- position: relative;
- }
-
- .item .cols {
- clear: both;
- display: block;
- }
-
- .item .cols .col {
- float: left;
- margin-left: 1.5%;
- }
-
- .item .cols .col.first {
- margin-left: 0;
- }
-
- .item .cols.two .col {
- width: 45%;
- }
-
- .item .box {
- margin: 0 0 10px 0;
- }
-
- .item .box h3 {
- margin: 0 0 10px 0;
- }
-
- .cols.unclear {
- clear:none;
- }
-}
-
-/* end of screen media */
-
-/* start of print media */
-
-@media print
-{
- input, textarea, .header, .footer, .toolbar, .feedback, .wrapper .hd, .wrapper .bd .sidebar, .wrapper .ft, #feedbackBox, #blurpage, .toc, .breadcrumb, .toolbar, .floatingResult
- {
- display: none;
- background: none;
- }
- .content
- {
- background: none;
- display: block;
- width: 100%; margin: 0; float: none;
- }
-}
-/* end of print media */
diff --git a/doc/config/style/style.css b/doc/config/style/style.css
deleted file mode 100644
index 6c633604..00000000
--- a/doc/config/style/style.css
+++ /dev/null
@@ -1,1731 +0,0 @@
-@media screen
-{
-
-/* basic elements */
- html
- {
- color: #000000;
- background: #FFFFFF;
- }
- body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, code, form, fieldset, legend, input, button, textarea, p, blockquote, th, td
- {
- margin: 0;
- padding: 0;
- }
- table
- {
- border-collapse: collapse;
- border-spacing: 0;
- }
- fieldset, img
- {
- border: 0;
- max-width:100%;
- }
- address, caption, cite, code, dfn, em, strong, th, var, optgroup
- {
- font-style: inherit;
- font-weight: inherit;
- }
- del, ins
- {
- text-decoration: none;
- }
- li
- {
- list-style: none;
- }
- ol li
- {
- list-style: decimal;
- }
- caption, th
- {
- text-align: left;
- }
- h1, h2, h3, h4, h5, h6
- {
- font-size: 100%;
- }
- q:before, q:after
- {
- content: '';
- }
- abbr, acronym
- {
- border: 0;
- font-variant: normal;
- }
- sup, sub
- {
- vertical-align: baseline;
- }
- tt, .qmlreadonly span, .qmldefault span
- {
- word-spacing:5px;
- }
- legend
- {
- color: #000000;
- }
- input, button, textarea, select, optgroup, option
- {
- font-family: inherit;
- font-size: inherit;
- font-style: inherit;
- font-weight: inherit;
- }
- input, button, textarea, select
- {
- font-size: 100%;
- }
- strong
- {
- font-weight: bold;
- }
- em
- {
- font-style: italic;
- }
-
- /* adding Qt theme */
- html
- {
- /* background-color: #e5e5e5;*/
- }
- body
- {
- background: #e6e7e8 url(../images/page_bg.png) repeat-x 0 0;
- font: normal 13px/1.2 Verdana;
- color: #363534;
- }
- a
- {
- color: #00732F;
- text-decoration: none;
- }
- hr
- {
- background-color: #E6E6E6;
- border: 1px solid #E6E6E6;
- height: 1px;
- width: 100%;
- text-align: left;
- margin: 15px 0px 15px 0px;
- }
-
- pre
- {
- border: 1px solid #DDDDDD;
- -moz-border-radius: 7px 7px 7px 7px;
- -webkit-border-radius: 7px 7px 7px 7px;
- border-radius: 7px 7px 7px 7px;
- margin: 0 20px 10px 10px;
- padding: 20px 15px 20px 20px;
- overflow-x: auto;
- }
- table, pre
- {
- -moz-border-radius: 7px 7px 7px 7px;
- -webkit-border-radius: 7px 7px 7px 7px;
- border-radius: 7px 7px 7px 7px;
- background-color: #F6F6F6;
- border: 1px solid #E6E6E6;
- border-collapse: separate;
- font-size: 11px;
- margin-bottom: 25px;
- }
- pre.highlightedCode {
- display: block;
- overflow:hidden;
- }
- thead
- {
- margin-top: 5px;
- font:600 12px/1.2 Arial;
- }
- th
- {
- padding: 5px 15px 5px 15px;
- background-color: #E1E1E1;
- border-left: 1px solid #E6E6E6;
- }
- td
- {
- padding: 3px 15px 3px 20px;
- }
- tr.odd td:hover, tr.even td:hover {}
-
- td.rightAlign
- {
- padding: 3px 5px 3px 10px;
- }
- table tr.odd
- {
- border-left: 1px solid #E6E6E6;
- background-color: #F6F6F6;
- color: #66666E;
- }
- table tr.even
- {
- border-left: 1px solid #E6E6E6;
- background-color: #ffffff;
- color: #66666E;
- }
- table tr.odd td:hover, table tr.even td:hover
- {
- /* background-color: #E6E6E6;*/ /* disabled until further notice */
- }
-
- div.float-left
- {
- float: left; margin-right: 2em
- }
- div.float-right
- {
- float: right; margin-left: 2em
- }
-
- span.comment
- {
- color: #008B00;
- font-style: italic
- }
- span.string, span.char
- {
- color: #000084;
- }
- span.number
- {
- color: #a46200;
- }
- span.operator
- {
- color: #202020;
- }
- span.keyword
- {
- color: #840000;
- }
- span.name
- {
- color: black
- }
- span.type
- {
- font-weight: bold
- }
- span.type a:visited
- {
- color: #0F5300;
- }
- span.preprocessor
- {
- color: #404040
- }
-/* end basic elements */
-
-/* font style elements */
- .heading
- {
- font: normal bold 16px/1.2 Arial;
- padding-bottom: 15px;
- }
- .subtitle
- {
- font-size: 13px;
- }
- .small-subtitle
- {
- font-size: 13px;
- }
- .red
- {
- color:red;
- }
- .figCaption{
- color:#363534;
- font:italic 11px/1.2 Verdana;
- padding-top:0;
- }
-/* end font style elements */
-
-/* global settings*/
- .header, .footer, .wrapper
- {
- min-width: 600px;
- max-width: 1500px;
- margin: 0 30px;
- }
- .header, .footer
- {
- display: block;
- clear: both;
- overflow: hidden;
- }
- .header:after, .footer:after, .breadcrumb:after, .wrap .content:after, .group:after
- {
- content: ".";
- display: block;
- height: 0;
- clear: both;
- visibility: hidden;
- }
-/* end global settings*/
-
-/* header elements */
- .header
- {
- height: 115px;
- position: relative;
- }
- .header .icon
- {
- position: absolute;
- top: 13px;
- left: 0;
- }
- .header .qtref
- {
- position: absolute;
- top: 28px;
- left: 88px;
- width: 302px;
- height: 22px;
- }
- .header .qtref span
- {
- display: block;
- width: 302px;
- height: 22px;
- text-indent: -999em;
- background: url(../images/sprites-combined.png) no-repeat -78px -235px;
- }
- .content a:visited
- {
- color: #4c0033;
- text-decoration: none;
- }
- .content a:visited:hover
- {
- color: #4c0033;
- text-decoration: underline;
- }
-
- #nav-topright
- {
- height: 70px;
- }
-
- #nav-topright ul
- {
- list-style-type: none;
- float: right;
- width: 370px;
- margin-top: 11px;
- }
-
- #nav-topright li
- {
- display: inline-block;
- margin-right: 20px;
- float: left;
- }
-
- #nav-topright li.nav-topright-last
- {
- margin-right: 0;
- }
-
- #nav-topright li a
- {
- background: transparent url(../images/sprites-combined.png) no-repeat;
- height: 18px;
- display: block;
- overflow: hidden;
- text-indent: -9999px;
- }
-
- #nav-topright li.nav-topright-home a
- {
- width: 65px;
- background-position: -2px -91px;
- }
-
- #nav-topright li.nav-topright-home a:hover
- {
- background-position: -2px -117px;
- }
-
- #nav-topright li.nav-topright-dev a
- {
- width: 30px;
- background-position: -76px -91px;
- }
-
- #nav-topright li.nav-topright-dev a:hover
- {
- background-position: -76px -117px;
- }
-
-
- #nav-topright li.nav-topright-labs a
- {
- width: 40px;
- background-position: -114px -91px;
- }
-
- #nav-topright li.nav-topright-labs a:hover
- {
- background-position: -114px -117px;
- }
-
- #nav-topright li.nav-topright-doc a
- {
- width: 32px;
- background-position: -162px -91px;
- }
-
- #nav-topright li.nav-topright-doc a:hover, #nav-topright li.nav-topright-doc-active a
- {
- background-position: -162px -117px;
- }
-
- #nav-topright li.nav-topright-blog a
- {
- width: 40px;
- background-position: -203px -91px;
- }
-
- #nav-topright li.nav-topright-blog a:hover, #nav-topright li.nav-topright-blog-active a
- {
- background-position: -203px -117px;
- }
-
- #nav-topright li.nav-topright-shop a
- {
- width: 40px;
- background-position: -252px -91px;
- }
-
- #nav-topright li.nav-topright-shop a:hover, #nav-topright li.nav-topright-shop-active a
- {
- background-position: -252px -117px;
- }
-
- #nav-logo
- {
- background: transparent url(../images/sprites-combined.png ) no-repeat 0 -225px;
- left: -3px;
- position: absolute;
- width: 75px;
- height: 75px;
- top: 13px;
- }
- #nav-logo a
- {
- width: 75px;
- height: 75px;
- display: block;
- text-indent: -9999px;
- overflow: hidden;
- }
-
- .shortCut-topleft-inactive
- {
- padding-left: 3px;
- padding-right: 3px;
- background: transparent url( ../images/sprites-combined.png) no-repeat 0px -58px;
- height: 20px;
- }
- .shortCut-topleft-inactive span
- {
- font-variant: normal;
- }
- .shortCut-topleft-inactive span a:hover, .shortCut-topleft-active a:hover
- {
- text-decoration:none;
- }
- #shortCut
- {
- padding-top: 10px;
- font-weight: bolder;
- color: #b0adab;
- }
- #shortCut ul
- {
- list-style-type: none;
- float: left;
- width: 347px;
- margin-left: 100px;
- }
- #shortCut li
- {
- display: inline-block;
- margin-right: 25px;
- float: left;
- white-space: nowrap;
- }
- #shortCut li a
- {
- color: #b0adab;
- }
- #shortCut li a:hover
- {
- color: #44a51c;
- }
-/* end header elements */
-
-/* content and sidebar elements */
- .wrapper
- {
- background: url(../images/bg_r.png) repeat-y 100% 0;
- }
- .wrapper .hd
- {
- padding-left: 216px;
- height: 15px;
- background: url(../images/page.png) no-repeat 0 0;
- overflow: hidden;
- }
-
- .wrapper .hd span
- {
- height: 15px;
- display: block;
- overflow: hidden;
- background: url(../images/page.png) no-repeat 100% -30px;
- }
- .wrapper .bd
- {
- background: url(../images/bg_l.png) repeat-y 0 0;
- position: relative;
- }
-
- .wrapper .ft
- {
- padding-left: 216px;
- height: 15px;
- background: url(../images/page.png) no-repeat 0 -75px;
- overflow: hidden;
- }
-
- .wrapper .ft span
- {
- height: 15px;
- display: block;
- background: url(../images/page.png) no-repeat 100% -60px;
- overflow: hidden;
- }
- .navTop{
- float:right;
- display:block;
- padding-right:15px;
- }
-/* end content and sidebar elements */
-
-/* sidebar elements */
- .sidebar
- {
- float: left;
- margin-left: 5px;
- width: 200px;
- font-size: 11px;
- }
-
- .sidebar .searchlabel
- {
- padding: 0 0 2px 17px;
- font: normal bold 11px/1.2 Verdana;
- }
-
- .sidebar .search
- {
- padding: 0 15px 0 16px;
- }
-
- .sidebar .search form
- {
- background: url(../images/sprites-combined.png) no-repeat -6px -348px;
- height:21px;
- padding:2px 0 0 5px;
- width:167px;
- }
-
- .sidebar .search form input#pageType
- {
- width: 158px;
- height: 19px;
- padding: 0;
- border: 0px;
- outline: none;
- font: 13px/1.2 Verdana;
- }
-
- .sidebar .box
- {
- padding: 17px 15px 5px 16px;
- }
-
- .sidebar .box .first
- {
- background-image: none;
- }
-
- .sidebar .box h2
- {
- font: bold 16px/1.2 Arial;
- padding: 0;
- }
- .sidebar .box h2 span
- {
- overflow: hidden;
- display: inline-block;
- }
- .sidebar .box#lookup h2
- {
- background-image: none;
- }
- .sidebar #lookup.box h2 span
- {
- }
- .sidebar .box#topics h2
- {
- background-image: none;
- }
- .sidebar #topics.box h2 span
- {
- }
- .sidebar .box#examples h2
- {
- background-image: none;
- }
- .sidebar #examples.box h2 span
- {
- }
-
- .sidebar .box .list
- {
- display: block;
- max-height:200px;
- min-height:120px;
- overflow-y:auto;
- overflow-x:none;
- }
- .list li a:hover
- {
- text-decoration: underline;
- }
- .sidebar .box ul
- {
- padding-bottom:5px;
- padding-left:10px;
- padding-top:5px;
- }
- .sidebar .box ul li
- {
- padding-left: 12px;
- background: url(../images/bullet_gt.png) no-repeat 0 5px;
- margin-bottom: 5px;
- }
- .sidebar .bottombar
- {
- background: url(../images/box_bg.png) repeat-x 0 bottom;
- }
- .sidebar .box ul li.noMatch
- {
- background: none;
- color:#FF2A00;
- font-style:italic;
- }
- .sidebar .box ul li.hit
- {
- background: none;
- color:#AAD2F0;
- font-style:italic;
- }
- .sidebar .search form input.loading
- {
- background:url("../images/spinner.gif") no-repeat scroll right center transparent;
- }
-
- .sidebar .search form {
- _height: 23px;
- _width: 169px;
- }
-
- #resultdialog {
- display: none;
- position: absolute;
- *left: 30px;
- _left: 0;
- *top: 35px;
- _top: 30px;
- _zoom: 1;
- background-color: #fff;
- border: 1px solid #666;
- z-index: 4;
- margin-top: 5px;
- _margin: 0 0 0 -20px;
- padding: 10px;
- width: 30%;
- _width: 196px;
- height: 250px;
- overflow: auto;
- -webkit-border-radius: .5em;
- -moz-border-radius: .5em;
- border-radius: .5em;
- -webkit-box-shadow: 0 4px 6px 0 rgba(0,0,0,.2);
- -moz-box-shadow: 0 4px 6px 0 rgba(0,0,0,.2);
- box-shadow: 0 4px 6px 0 rgba(0,0,0,.2);
- font-size: 11px;
- }
-
- #resultdialog a
- {
- color: #00732f;
- }
-
- #resultdialog.active {
- display: block;
- }
-
- .narrow #resultdialog {
- width: 60%;
- _width: 360px;
- }
-
- .narrow #resultdialog.active {
- right: 10px;
- *left: auto;
- _left: auto;
- _right: -20px;
- }
-
-
- #resultdialog #resultclose {
- float: right;
- }
-
- #resultdialog p,
- #resultdialog ul {
- clear: both;
- margin: 3px 0;
- }
-
- p#searchcount span {
- display: none;
- }
-
- p#searchcount.all span#resultcount,
- p#searchcount.api span#apicount,
- p#searchcount.article span#articlecount,
- p#searchcount.example span#examplecount {
- display: inline;
- }
-
- #resultlist li {
- display: none;
- }
-
- #resultlist.api li.api,
- #resultlist.article li.article,
- #resultlist.example li.example,
- #resultlist.all li {
- display: block;
- }
-
- #resultlinks.api a#showapiresults,
- #resultlinks.api a#showapiresults:hover,
- #resultlinks.article a#showarticleresults,
- #resultlinks.article a#showarticleresults:hover,
- #resultlinks.example a#showexampleresults,
- #resultlinks.example a#showexampleresults:hover,
- #resultlinks.all a#showallresults,
- #resultlinks.all a#showallresults:hover {
- color: #B0ADAB;
- }
- .floatingResult{
- z-index:1;
- position:relative;
- padding-top:0px;
- background-color:white;
- border:solid 1px black;
- height:250px;
- width:600px;
- overflow-x:hidden;
- overflow-y:auto;
- }
-
- .floatingResult:hover{
- display:block;
- }
- .floatingResult:hover{
- }
-/* end sidebar elements */
-
-/* content elements */
- .wrap
- {
- margin: 0 5px 0 208px;
- overflow: visible;
- }
-
- .wrap .toolbar
- {
- background-color: #fafafa;
- border-bottom: 1px solid #d1d1d1;
- height: 20px;
- position: relative;
- }
- .wrap .toolbar .toolblock
- {
- position: absolute;
- }
- .wrap .toolbar .breadcrumb
- {
- font-size: 11px;
- line-height: 1.2;
- padding: 0 0 10px 21px;
- height: 10px;
- }
- .wrap .toolbar .toolbuttons
- {
- padding: 0 0 10px 21px;
- right: 5px;
- vertical-align: middle;
- overflow: hidden;
- }
- .wrap .toolbar .toolbuttons .active
- {
- color: #00732F;
- }
- .wrap .toolbar .toolbuttons ul
- {
- float: right;
- }
- .wrap .toolbar .toolbuttons li
- {
- float: left;
- text-indent: -10px;
- margin-top: -5px;
- margin-right: 15px;
- font-weight: bold;
- color: #B0ADAB;
- font: bold 10px/1.2 Verdana;
- }
-
- .toolbuttons #print
- {
- border-left: 1px solid #c5c4c4;
- margin-top: 0;
- padding-left: 7px;
- text-indent: 0;
- }
- .toolbuttons #print a
- {
- width: 16px;
- height: 16px;
- }
-
- .toolbuttons #print a span
- {
- width: 16px;
- height: 16px;
- text-indent: -999em;
- display: block;
- overflow: hidden;
- background: url(../images/sprites-combined.png) no-repeat -137px -311px;
- }
-
- .toolbuttons #smallA
- {
- font-size: 10pt;
- }
- .toolbuttons #medA
- {
- font-size: 12pt;
- }
- .toolbuttons #bigA
- {
- font-size: 14pt;
- margin-right: 7px;
- }
-
- #smallA:hover, #medA:hover, #bigA:hover
- {
- color: #00732F;
- }
-
- .wrap .content
- {
- padding: 30px;
- word-wrap:break-word;
- }
-
- .wrap .breadcrumb ul
- {
- }
- .wrap .breadcrumb ul li
- {
- float: left;
- background: url(../images/breadcrumb.png) no-repeat 0 3px;
- padding-left: 15px;
- margin-left: 15px;
- font-weight: bold;
- }
- .wrap .breadcrumb ul li.last
- {
- font-weight: normal;
- }
- .wrap .breadcrumb ul li a
- {
- color: #363534;
- }
- .wrap .breadcrumb ul li.first
- {
- background-image: none;
- padding-left: 0;
- margin-left: 0;
- }
-
- .wrap .content ol li {
- background:none;
- font:normal 10pt/1.2 Verdana;
-
- margin-bottom:10px;
- margin-left:12px;
- /*list-style-type:disc;*/
- }
-
- .wrap .content ol li
- {
- background:none;
- margin-bottom: 10px;
- padding-left:0px;
- margin-left:52px;
- }
-
- .wrap .content li
- {
- background: url(../images/bullet_sq.png) no-repeat 0 5px;
- font: normal 400 10pt/1.2 Verdana;
- margin-bottom: 10px;
- padding-left:12px;
- }
-
- .content li:hover {}
-
- .wrap .content h1
- {
- font: bold 18px/1.2 Arial;
- }
- .wrap .content h2
- {
- font:600 16px/1.2 Arial;
- margin-top:15px;
- width:100%;
- }
- .wrap .content h3
- {
- font: bold 14px/1.2 Arial;
- font:600 16px/1.2 Arial;
- margin-top:15px;
- width:100%;
- }
- .wrap .content p
- {
- line-height: 20px;
- padding: 5px;
- }
- .wrap .content table p
- {
- line-height: 20px;
- }
- .wrap .content ul
- {
- padding-left: 25px;
- padding-top: 10px;
- }
- .wrap .content ul img {
- vertical-align:middle;
- }
- a:hover
- {
- color: #4c0033;
- text-decoration: underline;
- }
- descr p a
- {
- text-decoration: underline;
- }
-
- .descr p a:visited
- {
- text-decoration: underline;
- }
- .feedback
- {
- float: none;
- position: absolute;
- right: 15px;
- bottom: 10px;
- font: normal 8px/1 Verdana;
- color: #B0ADAB;
- }
- .feedback:hover
- {
- float: right;
- font: normal 8px/1 Verdana;
- color: #00732F;
- text-decoration: underline;
- }
- .alphaChar{
- width:95%;
- background-color:#F6F6F6;
- border:1px solid #E6E6E6;
- -moz-border-radius: 7px 7px 7px 7px;
- border-radius: 7px 7px 7px 7px;
- -webkit-border-radius: 7px 7px 7px 7px;
- font-size:12pt;
- padding-left:10px;
- margin-top:10px;
- margin-bottom:10px;
- }
- .flowList{
- /*vertical-align:top;*/
- /*margin:20px auto;*/
-
- column-count:3;
- -webkit-column-count:3;
- -moz-column-count:3;
-/*
- column-width:100%;
- -webkit-column-width:200px;
- -col-column-width:200px;
-*/
- column-gap:41px;
- -webkit-column-gap:41px;
- -moz-column-gap:41px;
-
- column-rule: 1px dashed #ccc;
- -webkit-column-rule: 1px dashed #ccc;
- -moz-column-rule: 1px dashed #ccc;
- }
-
- .flowList dl{
- }
- .flowList dd{
- /*display:inline-block;*/
- margin-left:10px;
- min-width:250px;
- line-height: 1.5;
- min-width:100%;
- min-height:15px;
- }
-
- .flowList dd a{
- }
-
- .wrap .content .flowList p{
- padding:0px;
- }
-
- .content .alignedsummary
- {
- margin: 15px;
- }
-
-
- .qmltype
- {
- text-align: center;
- font-size: 160%;
- }
- .qmlreadonly
- {
- padding-left: 5px;
- float: right;
- color: #254117;
- }
-
- .qmldefault
- {
- padding-left: 5px;
- float: right;
- color: red;
- }
-
- .qmldoc
- {
- }
-
- *.qmlitem p
- {
- }
- #feedbackBox
- {
- display: none;
- -moz-border-radius: 7px 7px 7px 7px;
- -webkit-border-radius: 7px 7px 7px 7px;
- border-radius: 7px 7px 7px 7px;
- border: 1px solid #DDDDDD;
- position: fixed;
- top: 100px;
- left: 33%;
- height: 230px;
- width: 400px;
- padding: 5px;
- background-color: #e6e7e8;
- z-index: 4;
- }
- #feedcloseX
- {
- display: inline;
- padding: 5px 5px 0 0;
- margin-bottom: 3px;
- color: #363534;
- font-weight:bold;
- float: right;
- text-decoration: none;
- }
-
- #feedbox
- {
- display: inline;
- width: 370px;
- height: 120px;
- margin: 0px 25px 10px 15px;
- }
- #noteHead
- {
- font-weight:bold;
- padding:10px 10px 10px 20px;
- }
- #feedsubmit
- {
- display: inline;
- float: right;
- margin: 4px 32px 0 0;
- }
-
- .note
- {
- font-size:7pt;
- padding-bottom:3px;
- padding-left:20px;
- }
-
- #blurpage
- {
- display: none;
- position: fixed;
- float: none;
- top: 0px;
- left: 0px;
- right: 0px;
- bottom: 0px;
- background: transparent url(../images/feedbackground.png) 0 0;
- z-index: 3;
- }
- .toc
- {
- float: right;
- -moz-border-radius: 7px 7px 7px 7px;
- -webkit-border-radius: 7px 7px 7px 7px;
- border-radius: 7px 7px 7px 7px;
- background-color: #F6F6F6;
- border: 1px solid #DDDDDD;
- margin: 0 20px 10px 10px;
- padding: 20px 15px 20px 20px;
- height: auto;
- width: 200px;
- }
-
- .toc h3, .generic a
- {
- font: bold 12px/1.2 Arial;
- }
-
- .generic{
- }
- .generic td{
- /* padding:5px;*/
- }
- .generic .alphaChar{
- margin-top:5px;
- }
-
- .generic .odd .alphaChar{
- background-color: #F6F6F6;
- }
-
- .generic .even .alphaChar{
- background-color: #FFFFFF;
- }
-
- .alignedsummary{}
- .propsummary{}
- .memItemLeft{}
- .memItemRight{
- padding:3px 15px 3px 0;
- }
- .bottomAlign{}
- .highlightedCode
- {
- margin:10px;
- }
- .LegaleseLeft{}
- .valuelist{}
- .annotated td{
- padding: 3px 5px 3px 5px;
- }
- .obsolete{}
- .compat{}
- .flags{}
- .qmlsummary{}
- .qmlitem{}
- .qmlproto{}
- .qmlname{}
- .qmlreadonly{}
- .qmldefault{}
- .qmldoc{}
- .qt-style{}
- .redFont{}
- code{}
-
- .wrap .content .toc ul
- {
- padding-left: 0px;
- }
-
- .wrap .content .toc h3{
- border-bottom:0px;
- margin-top:0px;
- }
-
- .wrap .content .toc h3 a:hover{
- color:#00732F;
- text-decoration:none;
- }
-
-
- .wrap .content .toc .level2
- {
- margin-left: 15px;
- }
-
- .wrap .content .toc .level3
- {
- margin-left: 30px;
- }
-
- .content .toc li
- {
- font: normal 10px/1.2 Verdana;
- background: url(../images/bullet_dn.png) no-repeat 0 5px;
- }
- .relpage
- {
- -moz-border-radius: 7px 7px 7px 7px;
- -webkit-border-radius: 7px 7px 7px 7px;
- border-radius: 7px 7px 7px 7px;
- border: 1px solid #DDDDDD;
- padding: 25px 25px;
- clear: both;
- }
- .relpage ul
- {
- float: none;
- padding: 15px;
- }
- .content .relpage li
- {
- font: normal 11px/1.2 Verdana;
- }
- h3.fn, span.fn
- {
- -moz-border-radius:7px 7px 7px 7px;
- -webkit-border-radius:7px 7px 7px 7px;
- border-radius:7px 7px 7px 7px;
- background-color: #F6F6F6;
- border-width: 1px;
- border-style: solid;
- border-color: #E6E6E6;
- font-weight: bold;
- word-spacing:3px;
- padding:3px 5px;
- }
-
- .functionIndex {
- font-size:12pt;
- word-spacing:10px;
- margin-bottom:10px;
- background-color: #F6F6F6;
- border-width: 1px;
- border-style: solid;
- border-color: #E6E6E6;
- -moz-border-radius: 7px 7px 7px 7px;
- -webkit-border-radius: 7px 7px 7px 7px;
- border-radius: 7px 7px 7px 7px;
- width:100%;
- }
-
- .centerAlign
- {
- text-align:center;
- }
-
- .rightAlign
- {
- text-align:right;
- }
-
- .leftAlign
- {
- text-align:left;
- }
-
- .topAlign{
- vertical-align:top
- }
-
- .functionIndex a{
- display:inline-block;
- }
-/* end content elements */
-
-/* footer elements */
- .footer
- {
- min-height: 100px;
- color: #797775;
- font: normal 9px/1 Verdana;
- text-align: center;
- padding-top: 40px;
- background-color: #E6E7E8;
- margin: 0;
- }
- .small
- {
- font: normal 9px/1 Verdana;
- }
-/* end footer elements */
-
- /* start index box */
- .indexbox
- {
- width: 100%;
- display:inline-block;
- }
-
- .indexboxcont
- {
- display: block;
-
- }
-
- .indexboxbar
- {
- background: transparent url(../images/horBar.png ) repeat-x left bottom;
- margin-bottom: 25px;
-
-
- }
-
- .indexboxcont .section
- {
- display: inline-block;
- width: 49%;
- *width:42%;
- _width:42%;
- padding:0 2% 0 1%;
- vertical-align:top;
- }
-
- .indexboxcont .indexIcon
- {
- width: 11%;
- *width:18%;
- _width:18%;
- overflow:hidden;
- }
-
- .indexboxcont .section {
- float: left;
- }
-
- .indexboxcont .section p
- {
- padding-top: 20px;
- padding-bottom: 20px;
- }
- .indexboxcont .sectionlist
- {
- display: inline-block;
- vertical-align:top;
- width: 32.5%;
- padding: 0;
- }
- .indexboxcont .sectionlist ul
- {
- margin-bottom: 20px;
- }
-
- .indexboxcont .sectionlist ul li
- {
- line-height: 12px;
- }
-
- .content .indexboxcont li
- {
- font: normal bold 13px/1 Verdana;
- }
-
- .indexbox a:hover, .indexbox a:visited:hover
- {
- color: #4c0033;
- text-decoration: underline;
- }
-
- .indexbox a:visited
- {
- color: #00732f;
- text-decoration: none;
- }
-
- .indexbox .indexIcon {
- width: 11%;
- }
-
- .indexbox .indexIcon span
- {
- display: block;
- }
-
- .indexbox.guide .indexIcon span
- {
- width: 96px;
- height: 137px;
- background: url(../images/sprites-combined.png) no-repeat -5px -376px;
- padding: 0;
- }
-
- .indexbox.tools .indexIcon span
- {
- width: 115px;
- height: 137px;
- background: url(../images/sprites-combined.png) no-repeat -111px -376px;
- padding: 0;
- }
- .indexboxcont:after
- {
- content: ".";
- display: block;
- height: 0;
- clear: both;
- visibility: hidden;
- }
-
-
-
-/* start of creator spec*/
- .creator
- {
- margin-left:0px;
- margin-right:0px;
- padding-left:0px;
- padding-right:0px;
- }
- .creator .wrap .content ol li {
- list-style-type:decimal;
- }
- .creator .header .icon,
- .creator .feedback,
- .creator .t_button,
- .creator .feedback,
- .creator #feedbackBox,
- .creator #feedback,
- .creator #blurpage,
- /* .creator .indexbox .indexIcon span,*/
- .creator .wrapper .hd,
- /* .creator .indexbox .indexIcon,*/
- .creator .header #nav-logo,
- .creator #offlinemenu,
- .creator #offlinesearch,
- .creator .header #nav-topright,
- .creator .header #shortCut ,
- .creator .wrapper .hd,
- .creator .wrapper .ft,
- .creator .sidebar,
- .creator .wrap .feedback
- {
- display:none;
- }
-
- body.creator
- {
- background: none;
-
- font: normal 13px/1.2 Verdana;
- color: #363534;
- background-color: #FAFAFA;
- }
-
- .wrap .content ol li {
-
- }
-
-
- .creator .header, .creator .footer, .creator .wrapper
- {
- max-width: 1500px;
- margin: 0px;
- }
-
- .creator .wrapper
- {
- position:relative;
- top:5px;
- }
- .creator .wrapper .bd
- {
- background:#FFFFFF;
- }
-
-
- .creator .header, .footer
- {
- display: block;
- clear: both;
- overflow: hidden;
- }
- .creator .wrap .content p
-
- {
- line-height: 20px;
- padding: 5px;
- }
-
- .creator .header .qtref span
- {
- background:none;
- }
-
- .creator .footer
- {
- border-top:1px solid #E5E5E5;
- height: 50px;
- margin:0px;
- padding:10px;
- }
-
- .creator .footer p
- {
- text-align:justify;
- max-width:900px;
- }
-
- .creator .wrap
- {
- padding:0 5px 0 5px;
- margin: 0px;
- }
- .creator .wrap .toolbar
- {
- border-bottom:1px solid #E5E5E5;
- /*width:100%;*/
- margin-left:-5px;
- margin-right:-5px;
- }
- .creator .wrap .breadcrumb ul li a
- {
- /* color: #363534;*/
- color: #00732F;
- }
-
- .creator .wrap .content
- {
- padding: 0px;
- word-wrap:break-word;
- }
-
- .creator .wrap .content ol li {
- background:none;
- font: inherit;
- padding-left: 0px;
- }
-
- .creator .wrap .content .descr ol li {
- margin-left: 45px;
- }
-
- .creator .content .alignedsummary
- {
- margin: 5px;
- width:100%;
- }
- .creator .generic{
- max-width:75%;
- }
- .creator .generic td{
- /*padding:0;*/
- }
- .creator .indexboxbar
- {
- border-bottom:1px solid #E5E5E5;
- margin-bottom: 25px;
- background: none;
- }
-
- .creator .header
- {
- width: 100%;
- margin: 0;
- height: auto;
- background-color: #ffffff;
- padding: 10px 0 5px 0;
- overflow: visible;
- border-bottom: solid #E5E5E5 1px;
- z-index:1;
- /* position:fixed;*/
- }
-
- .creator .header .content
- {
- }
- .creator .header .qtref
- {
- color: #00732F;
- position: static;
- float: left;
- margin-left: 5px;
- font: bold 18px/1 Arial;
- }
-
- .creator .header .qtref:visited
- {
- color: #00732F;
- }
- .creator .header .qtref:hover
- {
- color: #00732F;
- text-decoration:none;
- }
- .creator .header .qtref span
- {
- background-image: none;
- text-indent: 0;
- text-decoration:none;
- }
-
- .creator .wrap .toolbar
- {
- display:block;
- padding-top:0px;
- }
-
- .creator .wrap .breadcrumb ul li {
- font-weight: normal;
- }
-
- .creator .wrap .breadcrumb ul li a {
- /*color: #44a51c;*/
- }
-
- .creator .wrap .breadcrumb ul li.last a {
- /*color: #363534;*/
- }
-
- .creator #narrowmenu ul
- {
- border-bottom:solid 1px #E5E5E5;
- border-left:solid 1px #E5E5E5;
- border-right:solid 1px #E5E5E5;
- }
-
- .creator #narrowmenu li ul {
- margin-top:-15px;
- }
-
- .creator .toc {
- margin:10px 20px 10px 10px;
- }
-
- .creator #narrowsearch, .creator #narrowmenu{
- display:none;
- }
-/* end of creator spec*/
-
- .item {
- float: left;
- position: relative;
- width: 100%;
- overflow: hidden;
- }
-
- .item .primary {
- margin-right: 220px;
- position: relative;
- }
-
- .item hr {
- margin-left: -220px;
- }
-
- .item .secondary {
- float: right;
- width: 200px;
- position: relative;
- }
-
- .item .cols {
- clear: both;
- display: block;
- }
-
- .item .cols .col {
- float: left;
- margin-left: 1.5%;
- }
-
- .item .cols .col.first {
- margin-left: 0;
- }
-
- .item .cols.two .col {
- width: 45%;
- }
-
- .item .box {
- margin: 0 0 10px 0;
- }
-
- .item .box h3 {
- margin: 0 0 10px 0;
- }
-
- .cols.unclear {
- clear:none;
- }
-}
-
-/* end of screen media */
-
-/* start of print media */
-
-@media print
-{
- input, textarea, .header, .footer, .toolbar, .feedback, .wrapper .hd, .wrapper .bd .sidebar, .wrapper .ft, #feedbackBox, #blurpage, .toc, .breadcrumb, .toolbar, .floatingResult
- {
- display: none;
- background: none;
- }
- .content
- {
- background: none;
- display: block;
- width: 100%; margin: 0; float: none;
- }
-}
-/* end of print media */
diff --git a/doc/config/style/style_ie6.css b/doc/config/style/style_ie6.css
deleted file mode 100644
index 16fb8505..00000000
--- a/doc/config/style/style_ie6.css
+++ /dev/null
@@ -1,54 +0,0 @@
-.indexbox, .indexboxcont, .group {
- zoom: 1;
- height: 1%;
-}
-
-.sidebar {
- margin-left: 3px;
- width: 199px;
- overflow: hidden;
-}
-
-.sidebar .search form {
- position: relative;
-}
-
-.sidebar .search form fieldset {
- position: absolute;
- margin-top: -1px;
-}
-
-.sidebar .search form input#searchstring {
- border: 1px solid #fff;
- height: 18px;
-}
-
-.wrap {
- zoom: 1;
-}
-
-.content,
-.toolbar {
- zoom: 1;
- margin-left: -3px;
- position: relative;
-}
-
-.indexbox {
- clear: both;
-}
-
-.indexboxcont .section {
- zoom: 1;
- float: left;
-}
-
-.indexboxcont .sectionlist {
- zoom: 1;
- float: left;
-}
-
-.wrap .toolbar .toolbuttons li {
- text-indent: 0;
- margin-right: 8px;
-} \ No newline at end of file
diff --git a/doc/config/style/style_ie7.css b/doc/config/style/style_ie7.css
deleted file mode 100644
index afbff5f8..00000000
--- a/doc/config/style/style_ie7.css
+++ /dev/null
@@ -1,19 +0,0 @@
-.indexbox, .indexboxcont, .group {
- min-height: 1px;
-}
-
-.sidebar .search form input#searchstring {
- border: 1px solid #fff;
- height: 17px;
-}
-
-
-.indexboxcont .section {
- zoom: 1;
- float: left;
-}
-
-.indexboxcont .sectionlist {
- zoom: 1;
- float: left;
-}
diff --git a/doc/config/style/style_ie8.css b/doc/config/style/style_ie8.css
deleted file mode 100644
index e69de29b..00000000
--- a/doc/config/style/style_ie8.css
+++ /dev/null
diff --git a/doc/config/style/superfish.css b/doc/config/style/superfish.css
deleted file mode 100644
index 2bdaef4d..00000000
--- a/doc/config/style/superfish.css
+++ /dev/null
@@ -1,51 +0,0 @@
-.sf-menu, .sf-menu * {
- margin: 0;
- padding: 0;
- list-style: none;
-}
-.sf-menu {
- line-height: 1.0;
-}
-.sf-menu ul {
- position: absolute;
- top: -999em;
- width: 10em; /* left offset of submenus need to match (see below) */
-}
-.sf-menu ul li {
- width: 100%;
-}
-.sf-menu li:hover {
- visibility: inherit; /* fixes IE7 'sticky bug' */
-}
-.sf-menu li {
- float: left;
- position: relative;
-}
-.sf-menu a {
- display: block;
- position: relative;
-}
-.sf-menu li:hover ul,
-.sf-menu li.sfHover ul {
- left: 0;
- top: 2.5em; /* match top ul list item height */
- z-index: 99;
-}
-ul.sf-menu li:hover li ul,
-ul.sf-menu li.sfHover li ul {
- top: -999em;
-}
-ul.sf-menu li li:hover ul,
-ul.sf-menu li li.sfHover ul {
- left: 10em; /* match ul width */
- top: 0;
-}
-ul.sf-menu li li:hover li ul,
-ul.sf-menu li li.sfHover li ul {
- top: -999em;
-}
-ul.sf-menu li li li:hover ul,
-ul.sf-menu li li li.sfHover ul {
- left: 10em; /* match ul width */
- top: 0;
-}
diff --git a/doc/doc.pri b/doc/doc.pri
deleted file mode 100644
index 9853a537..00000000
--- a/doc/doc.pri
+++ /dev/null
@@ -1,32 +0,0 @@
-
-# Determine which qdoc3 binary we should be using. We try to use the
-# one from the Qt we built against. Otherwise use "qdoc3" on the PATH.
-TOPSRC = $$PWD/..
-QDOCCONF_FILE = $$PWD/config/qt3d-online.qdocconf
-DESTDIR = $$OUT_PWD/doc
-
-win32:!win32-g++ {
- unixstyle = false
-} else :win32-g++:isEmpty(QMAKE_SH) {
- unixstyle = false
-} else {
- unixstyle = true
-}
-
-$$unixstyle {
- exists($$[QT_INSTALL_BINS]/qdoc3) {
- QDOC = $$[QT_INSTALL_BINS]/qdoc3
- } else {
- QDOC = qdoc3
- }
- docs.commands = (TOPSRC=$$TOPSRC DESTDIR=$$DESTDIR $$QDOC $$QDOCCONF_FILE)
-} else {
- exists($$[QT_INSTALL_BINS]\\qdoc3.exe) {
- QDOC = $$[QT_INSTALL_BINS]\\qdoc3
- } else {
- QDOC = qdoc3
- }
- docs.commands = (set TOPSRC=$$TOPSRC&set DESTDIR=$$DESTDIR&$$QDOC $$QDOCCONF_FILE)
-}
-
-QMAKE_EXTRA_TARGETS += docs
diff --git a/doc/src/acceptance/qt3d-acceptance.qdoc b/doc/src/acceptance/qt3d-acceptance.qdoc
deleted file mode 100644
index a60c6dfa..00000000
--- a/doc/src/acceptance/qt3d-acceptance.qdoc
+++ /dev/null
@@ -1,239 +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 documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** GNU Free Documentation License
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file.
-**
-** 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$
-**
-****************************************************************************/
-
-/*!
- \page qt3d-acceptance.html
- \title Acceptance tests for Qt3D
- \keyword Acceptance
-
- As described in the \l{index.html}{Introduction} Qt3D is the C++ framework
- that underlies QtQuick3D.
-
- This section of the documentation contains some recommended
- acceptance tests for use when verifying that Qt3D has been
- successfully ported to a new platform or device, and to
- determine if the major features of Qt3D work correctly prior
- to a release. The list of tests is not intended to be exhaustive.
-
- When \l{Contributing to Qt3D}{reporting bugs}, please include
- as much information as possible about your platform and particularly
- its OpenGL implementation. The \c{qglinfo} program in the Qt3D
- source tree can be used to collect up information about the OpenGL
- version, features, and extensions. On X11 systems, usually
- \c{glxinfo} can be run to obtain similar information.
-
- \section1 Packaging Verification
-
- Where Qt Quick 3D has been packaged into a new packaging format, follow
- these steps to confirm that the newly installed package has validly set
- up a correct Qt Quick 3D environment.
-
- 1) Launch Qt Creator
-
- 2) Choose "File" > "New File or Project..."
-
- 3) Choose "Qt Quick Project" > "Qt Quick UI", press "Choose..."
-
- 4) Name the project "acceptance" and leave the default location
-
- 5) A template with QML code is generated. Edit the code so that it
- appears as follows:
-
- \code
- import QtQuick 1.0
- import Qt3D 1.0
-
- Viewport { width: 400; height: 400 }
- \endcode
-
- 6) Choose "File" > "Save"
-
- 7) Select the "Projects" tab, and set the "Qt Version:" to be the
- path of the qmake binary for the Qt where the newly installed
- Qt Quick 3D is located. Use the "Manage" button to add this Qt
- to the list if necessary.
-
- 8) If the package is correctly installed the code above should be
- clear of any error-underlining (a red wavy line indicating a problem).
-
- 9) Choose "Build" > "Run", ensuring the "acceptance" project is
- selected.
-
- 10) A 400 x 400 black viewport should be displayed.
-
-
- \section1 Basic bring-up
-
- A pre-requisite for the acceptance tests is that Qt and Qt3D have
- been built and installed in accordance with the
- \l{Building QtQuick3D}{build instructions}. In particular, Qt must
- be configured with OpenGL support and QGLWidget must be working.
-
- First, run all unit tests on the platform or device and verify that
- they all pass (\l{Contributing to Qt3D}{report bugs} for those that
- do not pass). The "make check" rule can be used to run the
- unit tests if you are not cross-compiling. For cross-compile
- environments, copy all of the \c{tst_*} binaries under \c{tests/auto}
- to the device and run them.
-
- Next, run the \l{Teapot Example} and verify that it looks similar
- to the following picture:
-
- \image teapot-screenshot.png
-
- Verify that there is no horizontal or vertical distortion,
- as shown in the following pictures:
-
- \raw HTML
- <center><table><tr><td>
- \endraw
- \image teapot-distortion.png
- \raw HTML
- </td><td>
- \endraw
- \image teapot-distortion2.png
- \raw HTML
- </td></tr></table></center>
- \endraw
-
- Resize the window if possible. The teapot should change scale but
- keep its relative horizontal and vertical size without distortion.
- Next, verify that the teapot can be rotated using either the mouse
- or the cursor keys:
-
- \image teapot-rotated.png
-
- If the teapot does not appear at all, then check stdout for any
- error and warning messages from the GLSL shader compiler.
-
- \section1 Animations
-
- Run the \l{Basket Example} and verify that the basket spins on
- its vertical axis, and continues to do so as the window is
- resized or the orientiation is changed with the mouse or keyboard.
- The model should also be textured with a basket weave pattern:
-
- \image basket-screenshot.png
-
- Running the basket example with the environment variable
- \c{QT3D_LOG_EVENTS} set to 1 should produce some qDebug()
- output that indicates the number of milliseconds per frame,
- and hence the frame rate:
-
- \code
- $ QT3D_LOG_EVENTS=1 ./basket
- ...
- LOG[0:00:01.681]: ENTER: QGLView::paintGL (16 ms since last enter)
- LOG[0:00:01.681]: LEAVE: QGLView::paintGL (0 ms elapsed)
- LOG[0:00:01.696]: ENTER: QGLView::paintGL (15 ms since last enter)
- LOG[0:00:01.696]: LEAVE: QGLView::paintGL (0 ms elapsed)
- LOG[0:00:01.713]: ENTER: QGLView::paintGL (17 ms since last enter)
- ...
- \endcode
-
- If the basket does not spin, then try to determine if
- \c{BasketView::paintGL()} is being called every frame or not.
- If it is being called over and over, then the problem
- may be in Qt3D. But if it is not being called repeatedly, then
- it could be a problem in Qt's animation framework or QGLWidget
- update processing.
-
- \section1 Rendering into a framebuffer object
-
- Run the \l{qt3d/nesting}{Nesting} example to test if rendering into a
- framebuffer object works:
-
- \image nesting-screenshot.png
-
- The teapot on the side of the blue cube is the part of the scene
- that uses a framebuffer object. The teapot should be spinning.
-
- This test also checks that alpha blending works in the underlying
- OpenGL implementation.
-
- \section1 Model loading
-
- Run the \l{Loading a 3DS model with Qt3D}{Penguin} example
- to check that 3DS model loading basically works:
-
- \image penguin-screenshot.png
-
- If the model fails to appear, it is possible that the 3DS
- plug-in has not been installed correctly or it could not
- be located at runtime. It is recommended that you set the
- \c{QT_DEBUG_PLUGINS} environment variable to 1 to get extra
- information about why the plug-in could not be loaded.
-
- \section1 QtQuick3D Verification
-
- Run the QtQuick3D version of the bouncing
- \l{Teapot Example in QtQuick3D}{Teapot Example} using
- "qmlviewer -opengl teapot-bounce.qml". The teapot should have a
- shiny appearence (compared to the grey teapot above) and bounce
- up and down:
-
- \image teapot-china-screenshot.png
-
- It should be possible to rotate the teapot using the mouse
- and keyboard.
-
- Note that when running QtQuick3D examples on a device that both the
- QML files and the model files must be copied to the device (the model
- file is "teapot.bez" in the case of the bouncing teapot example).
-
- \section1 Object picking
-
- Run the QtQuick3D \l{Tea Service Demo in QML}{Tea Service} demo
- with "qmlviewer -opengl teaservice.qml". Click on the teapot, teacups,
- and teaspoons to make them jump up, and click on the teapot
- spout and handle for other effects. This example tests object
- picking and QML animations.
-
- \image teaservice-qml-screenshot.png
-
- Note: It may be necessary to adjust the width and height properties
- in teaservice.qml to match the device's screen size.
-
- \section1 Build tests
-
- The Qt3D code base contains a number of \c{#ifdef} statements
- that may cause the build to fail in non-default Qt configurations
- or when strict API options are enabled. It is recommended that
- these configurations be verified periodically, particularly
- prior to a release.
-
- \code
- qmake opengl.pro \
- DEFINES+=QT_NO_DEBUG_STREAM \
- DEFINES+=QT_NO_DATASTREAM \
- DEFINES+=QT_NO_CAST_FROM_BYTEARRAY \
- DEFINES+=QT_NO_CAST_TO_ASCII \
- DEFINES+=QT_NO_CAST_FROM_ASCII
- \endcode
-
- \l{index.html}{Return to the main Qt3D page}.
-*/
diff --git a/doc/src/camera-frustum.qdoc b/doc/src/camera-frustum.qdoc
deleted file mode 100644
index 789f9ad9..00000000
--- a/doc/src/camera-frustum.qdoc
+++ /dev/null
@@ -1,240 +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 documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** GNU Free Documentation License
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file.
-**
-** 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$
-**
-****************************************************************************/
-
-/*!
- \ingroup qt3d
- \ingroup qt3d::math
- \since 4.8
- \title Camera and View Frustum
- \page qt3d-camera-frustum.html
- \keyword Camera View Frustum
- \brief Basis for the vamera and view frustum culling test.
-
- The QGLCamera class provides useful viewing functionality, such as being able
- to position and orient view point within a scene. In combination with the
- QGLPainter::isCullable() function, basic view frustum culling is available.
- To understand in more depth these concepts, or to verify the implementation
- more details of these are presented here. To simply use the functionality
- read the documentation.
-
- \list
- \o QGLCamera
- \o QGLPainter::isCullable()
- \endlist
-
- \section1 The Default Camera
-
- Qt3D uses the OpenGL co-ordinate system, that is a right-handed system. In
- this system you can think of X as pointing to the right, Y as pointing up and
- Z as pointing toward you. If you hold your right-hand so that the thumb,
- index and middle fingers are all at right angles to each other, then
-
- \list
- \o Thumb - X axis - points to the right
- \o Index - Y axis - points upward
- \o Middle - Z axis - points toward you
- \endlist
-
- When you first create a QGLCamera object, by default it has
- \code
- QGLCamera camera;
- qDebug() camera;
- --
- // displays:
- QGLCamera
- projection: Perspective -- viewsize: 2 x 2
- near-plane: 5 -- far-plane: 1000 -- field-of-view: 0
- rotation: 0 -- motion adjust: QVector3D(0, 0, 1) -- aspect adjust: true
- eye: QVector3D(0, 0, 10) -- center: QVector3D(0, 0, 0) -- up: QVector3D(0, 1, 0)
- \endcode
-
- In the visualisation just mentioned, with positive Z pointing toward you the
- camera is sitting at the tip of your middle finger, looking in the same
- direction you are, that is down toward the negative end of the Z axis.
-
- \section1 Positioning a Custom Camera.
-
- In this image we have a camera positioned with the following settings:
- \code
- camera.setNearPlane(2.2f);
- camera.setFarPlane(14.0f);
- camera.setViewSize(QSizeF(1.257f, 1.257f));
- camera.setEye(QVector3D(0, 0, -8.0f));
- \endcode
-
- This screen capture from a 3D modelling program shows how this camera is
- set up in a scene, where its viewing a cube. The image shows a purple area
- which indicates the \i{view frustum}, which you can think of for
- now as the area captured by the camera. Actually its more correct to think
- of the volume captured by the camera, and imagine that the purple indication
- in the image is the shadow cast by this volume.
-
- \image view-frustum-angle-shot.png
-
- The odd value for view size comes from the far plane size which was set at
- 8 x 8 when creating the diagram: by similar triangles (8 / 14) x 2.2 = 1.257.
- There is no API call for setting the size of the far-plane, same as in OpenGL.
- So to get this 8 x 8 far plane we had to work out the near plane size.
-
- \image view-frustum-origin.png
-
- This plan view shows the parameters of the camera by reference to a grid.
- You can see that the camera is situated - by QGLCamera::setEye() - to a point
- 8 units back along the negative z axis. The far plane is 14 units away from
- the eye - set by QGLCamera::setFarPlane().
-
- Note that here also the camera is sitting down the negative z axis, looking
- back toward us - the opposite of the default. Its near plane and far plane
- are also much closer. The camera is still pointing to the origin - where a
- 3D cube is situated, ready to be viewed by the camera.
-
- \section1 The View Frustum
-
- The camera can only see a \bold part of the scene - not all of it. Anything
- too far to the camera's right or left is out of the range of its view, and
- even though that part of the scene may contain geometry that is sent to the GPU
- for processing, those triangles will not be visible on the screen. The GPU
- will clip them away - but it still has to do work to do this.
-
- The part of the scene which the camera can see, and which will get displayed
- is called the \bold{View Frustum}. A Frustum is a geometric shape, like a
- pyramid with its top cut off. It has sloping sides due to the perspective
- transformation performed by OpenGL, when simulating the effect of the camera
- in the 3D scene.
-
- The cube in this scene has 6 sides, just like the view frustum, so we can
- compare the names of these:
-
- \table
- \header
- \o Cube
- \o View Frustum
- \row
- \o Front
- \o Near Plane
- \row
- \o Back
- \o Far Plane
- \row
- \o Left side
- \o Left side
- \row
- \o Right side
- \o Right side
- \row
- \o Top
- \o Top
- \row
- \o Bottom
- \o Bottom
- \endtable
-
- Like the cube, the frustum is a solid, and can contain things. You can think of
- it as having a set of bounds. Anything inside these bounds is rendered by OpenGL.
-
- \image view-frustum-10-degrees-angle-shot.png
-
- In this image, we see the camera as a black-line wire-frame. The rectangle of the
- front of the camera represents the \bold{aperture}.
-
- The triangular purple colored area on the floor corresponds to the camera's eye
- and spreads out, as determined by the size of the camera's aperture. If you extended
- the lines from the camera's eye to the four corners of its aperture, those lines would
- define the view frustum. That view frustum would be the same size as the purple
- view triangle, except the part behind the camera aperture is sliced off.
-
- Anything that falls inside the black wire-frame of the camera itself \bold{does not
- get displayed}.
-
- Because the scene needs to be projected onto a camera aperture of a non-zero size,
- this means there is this area between the eye of the camera and its aperture which
- cannot be displayed. Notice that the camera aperture and the Near Plane of the view
- frustum are the same thing.
-
- We can also say that anything which falls outside the fiew frustum \bold{does not get
- displayed} including anything in front of the near plane. Poor camera positioning
- in a scene can often result in this near plane culling which can produce odd visual
- effects as geometry appears and disappears when it passes in front and behind of
- the near plane.
-
- \section1 View Frustum Culling
-
- Carefully examine the next 3 screenshots, which show the same plan view of the
- camera, cube and view - except the cube is rotated arount the eye of the camera
- by 10 degrees each time.
-
- \image view-frustum-10-degrees.png
-
- In this image the cube is slightly out of the view frustum. It still must be sent
- to the GPU, but some of its pixels will be clipped off during rendering.
-
- \image view-frustum-20-degrees.png
-
- In this image the cube is mostly out of the view frustum. It still must be sent
- to the GPU, but most of its pixels will be clipped off during rendering.
-
- \image view-frustum-30-degrees.png
-
- In this image the cube is completey out of the view frustum. Performance could be
- improved by not sending the cubes geometry to the GPU at all. This test must
- be made on the CPU side, so therefore it must be very cheap to do in order to beat
- the cost of just sending it anyway and allowing the GPU to clip away all of it.
-
- The optimisation technique where you detect this case is called \bold{View Frustum
- Culling} and it can a simple and valuable performance enhancement. Qt3D implements
- view frustum culling via the QGLPainter::isCullable() function.
-
- \section1 Aspect-Ratio Correction
-
- The default camera has a viewport which is 2 x 2 in size, as discussed above. However
- when the camera is used to display a scene on a QGLAbstractSurface, for example a
- QGLWidgetSurface, the \bold{aspect ratio} of that surface is taken into account in
- the View Frustum. Specifically code in the QGLCamera::projectionMatrix() function
- takes the aspect ratio and expands the default viewport to match. If the surface is
- wider than it is high, the aspect ratio is greater than 1 and the viewport width is
- multiplied by the aspect ratio to make it larger. If the surface is higher than it
- is wide, the aspect ratio is less than 1 and the viewport height is divided by the
- aspect ratio to make it larger. The result is the viewport aspect ratio matches that
- of the surface it is to be displayed on.
-
- \code
- QGLWidget widget; // creates a 640 x 480 widget by default
- QGLPainter painter(&widget) // internally makes a 640 x 480 QGLWidgetSurface
- qreal asp = painter.currentSurface()->aspectRatio();
- // asp == 1.3333 which is (640 / 480)
- QGLCamera camera; // default camera as above
- painter.setCamera(&camera); // applies the aspect ratio to the perspective projection
- QMatrix4x4 p = painter.projectionMatrix().top();
- QMatrix4x4 q;
- q.frustum(-asp, asp, -1, 1, camera.nearPlane(), camera.farPlane());
- qDebug() << q == p; // prints "true"
- \endcode
-
- One result of this is that clipping to the view frustum can only be done with the
- knowledge of the surface because more of the scene is visible to the left and right
- than would be suggested by the default camera settings.
-*/
diff --git a/doc/src/classes.qdoc b/doc/src/classes.qdoc
deleted file mode 100644
index a81d9e5c..00000000
--- a/doc/src/classes.qdoc
+++ /dev/null
@@ -1,100 +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 documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** GNU Free Documentation License
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file.
-**
-** 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$
-**
-****************************************************************************/
-
-/*!
- \group classlists
- \title Class and Function Documentation
- \brief Lists and Indexes of classes, functions, and types.
-
- Links to indexes and lists for finding class and function
- reference documentation.
-
- \section2 Class Lists
-
- \annotatedlist classlists
-
- \section2 Function Lists
-
- \annotatedlist funclists
-
-*/
-
-/*!
- \page classes.html
- \title All Qt3D Classes
- \ingroup classlists
-
- \brief If you know the name of the class you want, find it here.
-
- This is a list of all Qt3D classes.
-
- \generatelist classes
-
-*/
-
-/*!
- \page annotated.html
- \title Annotated Class List
- \ingroup classlists
-
- \brief If you don't know the name of the class you want, but you
- know what the class should do, you might try looking here.
-
- Qt3D API classes with brief descriptions:
-
- \generatelist annotatedclasses
-*/
-
-
-/*!
- \page hierarchy.html
-
- \title Inheritance Hierarchy
- \ingroup classlists
-
- \brief The C++ class inheritance hierarchy for all classes in the
- Qt3D API.
-
- \generatelist classhierarchy
-*/
-
-
-
-/*!
- \page functions.html
- \title All Functions
- \ingroup funclists
-
- \brief All documented Qt3D functions listed alphabetically with a
- link to where each one is declared.
-
- This is the list of all documented member functions and global
- functions in the Qt3D API. Each function has a link to the class or
- header file where it is declared and documented.
-
- \generatelist functionindex
-*/
diff --git a/doc/src/classic.css b/doc/src/classic.css
deleted file mode 100644
index 59fa9dc3..00000000
--- a/doc/src/classic.css
+++ /dev/null
@@ -1,284 +0,0 @@
-BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV {
- font-family: Arial, Geneva, Helvetica, sans-serif;
-}
-H1 {
- text-align: center;
- font-size: 160%;
-}
-H2 {
- font-size: 120%;
-}
-H3 {
- font-size: 100%;
-}
-
-h3.fn,span.fn
-{
- background-color: #eee;
- border-width: 1px;
- border-style: solid;
- border-color: #ddd;
- font-weight: bold;
- padding: 6px 0px 6px 10px;
- margin: 42px 0px 0px 0px;
-}
-
-hr {
- border: 0;
- color: #a0a0a0;
- background-color: #ccc;
- height: 1px;
- width: 100%;
- text-align: left;
- margin: 34px 0px 34px 0px;
-}
-
-table.valuelist {
- border-width: 1px 1px 1px 1px;
- border-style: solid;
- border-color: #dddddd;
- border-collapse: collapse;
- background-color: #f0f0f0;
-}
-
-table.indextable {
- border-width: 1px 1px 1px 1px;
- border-style: solid;
- border-collapse: collapse;
- background-color: #f0f0f0;
- border-color:#555;
- font-size: 100%;
-}
-
-table td.largeindex {
- border-width: 1px 1px 1px 1px;
- border-collapse: collapse;
- background-color: #f0f0f0;
- border-color:#555;
- font-size: 120%;
-}
-
-table.valuelist th {
- border-width: 1px 1px 1px 2px;
- padding: 4px;
- border-style: solid;
- border-color: #666;
- color:white;
- background-color:#666;
-}
-
-th.titleheader {
- border-width: 1px 0px 1px 0px;
- padding: 2px;
- border-style: solid;
- border-color: #666;
- color:white;
- background-color:#555;
- background-image:url('images/gradient.png')};
- background-repeat: repeat-x;
- font-size: 100%;
-}
-
-
-th.largeheader {
- border-width: 1px 0px 1px 0px;
- padding: 4px;
- border-style: solid;
- border-color: #444;
- color:white;
- background-color:#555555;
- font-size: 120%;
-}
-
-p {
-
- margin-left: 4px;
- margin-top: 8px;
- margin-bottom: 8px;
-}
-
-a:link
-{
- color: #0046ad;
- text-decoration: none
-}
-
-a:visited
-{
- color: #672967;
- text-decoration: none
-}
-
-a.obsolete
-{
- color: #661100;
- text-decoration: none
-}
-
-a.compat
-{
- color: #661100;
- text-decoration: none
-}
-
-a.obsolete:visited
-{
- color: #995500;
- text-decoration: none
-}
-
-a.compat:visited
-{
- color: #995500;
- text-decoration: none
-}
-
-body
-{
- background: #ffffff;
- color: black
-}
-
-table.generic, table.annotated
-{
- border-width: 1px;
- border-color:#bbb;
- border-style:solid;
- border-collapse:collapse;
-}
-
-table td.memItemLeft {
- width: 180px;
- padding: 2px 0px 0px 8px;
- margin: 4px;
- border-width: 1px;
- border-color: #E0E0E0;
- border-style: none;
- font-size: 100%;
- white-space: nowrap
-}
-
-table td.memItemRight {
- padding: 2px 8px 0px 8px;
- margin: 4px;
- border-width: 1px;
- border-color: #E0E0E0;
- border-style: none;
- font-size: 100%;
-}
-
-table tr.odd {
- background: #f0f0f0;
- color: black;
-}
-
-table tr.even {
- background: #e4e4e4;
- color: black;
-}
-
-table.annotated th {
- padding: 3px;
- text-align: left
-}
-
-table.annotated td {
- padding: 3px;
-}
-
-table tr pre
-{
- padding-top: 0px;
- padding-bottom: 0px;
- padding-left: 0px;
- padding-right: 0px;
- border: none;
- background: none
-}
-
-tr.qt-style
-{
- background: #96E066;
- color: black
-}
-
-body pre
-{
- padding: 0.2em;
- border: #e7e7e7 1px solid;
- background: #f1f1f1;
- color: black
-}
-
-table tr.qt-code pre
-{
- padding: 0.2em;
- border: #e7e7e7 1px solid;
- background: #f1f1f1;
- color: black
-}
-
-span.preprocessor, span.preprocessor a
-{
- color: darkblue;
-}
-
-span.comment
-{
- color: darkred;
- font-style: italic
-}
-
-span.string,span.char
-{
- color: darkgreen;
-}
-
-.title
-{
- text-align: center
-}
-
-.subtitle
-{
- font-size: 0.8em
-}
-
-.small-subtitle
-{
- font-size: 0.65em
-}
-
-.qmlitem {
- padding: 0;
-}
-
-.qmlname {
- white-space: nowrap;
-}
-
-.qmltype {
- text-align: center;
- font-size: 160%;
-}
-
-.qmlproto {
- background-color: #eee;
- border-width: 1px;
- border-style: solid;
- border-color: #ddd;
- font-weight: bold;
- padding: 6px 10px 6px 10px;
- margin: 42px 0px 0px 0px;
-}
-
-.qmlreadonly {
- float: right;
- color: red
-}
-
-.qmldoc {
-}
-
-*.qmlitem p {
-}
diff --git a/doc/src/demos/monkeygod.qdoc b/doc/src/demos/monkeygod.qdoc
deleted file mode 100644
index 86973fcb..00000000
--- a/doc/src/demos/monkeygod.qdoc
+++ /dev/null
@@ -1,38 +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 documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** GNU Free Documentation License
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file.
-**
-** 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$
-**
-****************************************************************************/
-
-/*!
- \example quick3d/monkeygod
- \title Monkey God in QML
-
- The Monkey God demo in QML shows how QML/3D can be used to build
- up complex 3D scenes including materials and animations.
-
- \image monkeygod-screenshot.png
-
- \l{qt3d-examples.html}{Return to Examples}.
-*/
diff --git a/doc/src/demos/pageflip.qdoc b/doc/src/demos/pageflip.qdoc
deleted file mode 100644
index 486ab2f0..00000000
--- a/doc/src/demos/pageflip.qdoc
+++ /dev/null
@@ -1,39 +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 documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** GNU Free Documentation License
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file.
-**
-** 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$
-**
-****************************************************************************/
-
-/*!
- \example qt3d/pageflip
- \title Page Flip Demo
-
- The Page Flip demo shows how Qt3D can be used to animate
- flipping pages in a book. A shader program is used to combine a
- gradient texture with the page textures to create a curl effect.
-
- \image pageflip-screenshot.png
-
- \l{qt3d-examples.html}{Return to Examples}.
-*/
diff --git a/doc/src/demos/shapes.qdoc b/doc/src/demos/shapes.qdoc
deleted file mode 100644
index 3bba9d93..00000000
--- a/doc/src/demos/shapes.qdoc
+++ /dev/null
@@ -1,38 +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 documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** GNU Free Documentation License
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file.
-**
-** 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$
-**
-****************************************************************************/
-
-/*!
- \example qt3d/shapes
- \title Shapes Demo
-
- The Shapes demo shows many of the basic shapes that can be
- drawn using Qt3D.
-
- \image shapes-screenshot.png
-
- \l{qt3d-examples.html}{Return to Examples}.
-*/
diff --git a/doc/src/demos/teaservice-qml.qdoc b/doc/src/demos/teaservice-qml.qdoc
deleted file mode 100644
index 77cdf064..00000000
--- a/doc/src/demos/teaservice-qml.qdoc
+++ /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 documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** GNU Free Documentation License
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file.
-**
-** 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$
-**
-****************************************************************************/
-
-/*!
- \example quick3d/tea_service
- \title Tea Service Demo in QML
-
- The Tea Service demo in QML shows how QML/3D can be used to draw a complex
- scene made up of several objects. It also demonstrates object picking,
- animations, states and transitions.
-
- \image teaservice-qml-screenshot.png
-
- There is also a \l{Tea Service Demo}{C++ version} of this demo,
- which is not as visually interesting as the QML/3D version.
- It is much easier to implement interaction models and
- animations in QML than in C++.
-
- \l{qt3d-examples.html}{Return to Examples}.
-*/
diff --git a/doc/src/demos/teaservice.qdoc b/doc/src/demos/teaservice.qdoc
deleted file mode 100644
index 2a067227..00000000
--- a/doc/src/demos/teaservice.qdoc
+++ /dev/null
@@ -1,43 +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 documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** GNU Free Documentation License
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file.
-**
-** 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$
-**
-****************************************************************************/
-
-/*!
- \example qt3d/teaservice
- \title Tea Service Demo
-
- The Tea Service demo shows how Qt3D can be used to draw a complex
- scene made up of several objects. It also demonstrates object picking.
-
- \image teaservice-screenshot.png
-
- There is also a \l{Tea Service Demo in QML}{QML version} of the
- Tea Service demo which has more advanced object picking, animations,
- states, and transitions. It is much easier to add complex
- interaction models and animations in QML than in C++.
-
- \l{qt3d-examples.html}{Return to Examples}.
-*/
diff --git a/doc/src/examples/basket.qdoc b/doc/src/examples/basket.qdoc
deleted file mode 100644
index 92a429a3..00000000
--- a/doc/src/examples/basket.qdoc
+++ /dev/null
@@ -1,80 +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 documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** GNU Free Documentation License
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file.
-**
-** 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$
-**
-****************************************************************************/
-
-/*!
- \example quick3d/basket
- \title Basket Example
-
- \section2 Basket in QtQuick3D
-
- The QtQuick3D version of the basket example is very similar in
- structure to the C++ version above, but much simpler.
- We start by defining a viewport with a specific camera position:
-
- \snippet quick3d/basket/qml/basket.qml 1
-
- We then add an \l Item3D object to load the basket model and
- apply the desired texture to it:
-
- \snippet quick3d/basket/qml/basket.qml 2
-
- And then we apply an animation to the rotation component of
- the item's transform property:
-
- \snippet quick3d/basket/qml/basket.qml 3
-
- \section2 Basket in Qt3D
-
- The Basket example shows how Qt3D can be used to draw an animated
- object covered in a texture. The basic application shell is similar
- to the \l{qt3d/teapot}{Hello Teapot} example. In this case, we create
- the basket object and add a texture to it as follows:
-
- \snippet qt3d/basket/basketview.cpp 1
-
- For this animation, we want to spin the basket around its Y axis,
- once every 2 seconds. We first declare an \c angle property in the
- class declaration (calling \c{update()} will force the view to
- redraw whenever the angle changes):
-
- \snippet qt3d/basket/basketview.h 1
-
- Then we create a QPropertyAnimation object that will update
- \c angle every time through the event loop with a new value
- between 0 and 360 degrees:
-
- \snippet qt3d/basket/basketview.cpp 2
-
- Now all we have to do is draw the basket using the \c angle
- property every time \c{paintGL()} is called:
-
- \snippet qt3d/basket/basketview.cpp 3
-
- \image basket-screenshot.png
-
- \l{qt3d-examples.html}{Return to Examples}.
-*/
diff --git a/doc/src/examples/nesting.qdoc b/doc/src/examples/nesting.qdoc
deleted file mode 100644
index b4438bb8..00000000
--- a/doc/src/examples/nesting.qdoc
+++ /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 documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** GNU Free Documentation License
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file.
-**
-** 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$
-**
-****************************************************************************/
-
-/*!
- \example qt3d/nesting
- \title Drawing into framebuffer objects
-
- The Nesting example shows how Qt3D can be used to draw into a
- framebuffer object and then use the associated texture in
- subsequent drawing operations. It is assumed that the reader
- is already familar with the following examples:
-
- \list
- \o \l{Teapot Example}{Hello Teapot} - drawing a basic object in 3D.
- \o \l{Object Effects}{Cube} - applying transformations and materials to objects.
- \endlist
-
- In this example we are going to draw two rotating and transparent
- cubes. One cube will display a simple texture as in the
- \l{Object Effects}{Cube} example,
- and the other cube will display a nested scene containing a
- rotating teapot.
-
- \image nesting-screenshot.png
-
- As with the other examples, we start by creating the geometric objects
- we need in the constructor (we will share the cube geometry between
- the two cubes we will be drawing):
-
- \snippet qt3d/nesting/cubeview.cpp 1
-
- We also need three QPropertyAnimation objects to drive our
- animations; rotation angle for the teapot, rotation angle for
- the cube; orbit angle of the two cubes around each other:
-
- \snippet qt3d/nesting/cubeview.cpp 2
-
- The final step in the constructor is to create a camera for
- the nested scene we will be drawing into the framebuffer object.
- This is in addition to the default QGLView::camera() object that
- provides the camera for the main scene.
-
- \snippet qt3d/nesting/cubeview.cpp 3
-
- To draw the nested scene, we of course need a framebuffer object,
- which we create in the \c{initializeGL()} method:
-
- \snippet qt3d/nesting/cubeview.cpp 4
-
- Note that we also set the framebuffer object on an instance of
- QGLFramebufferObjectSurface. We will use this fact later when
- we render the nested scene.
-
- For the other cube, we need a regular texture. And we'll also
- turn on blending to make our cubes transparent:
-
- \snippet qt3d/nesting/cubeview.cpp 5
-
- Now it is time to paint the scene in \c{paintGL()}. The first
- thing we want to do is draw the teapot into the framebuffer object.
- To do that, we need to establish a nested drawing state:
-
- \snippet qt3d/nesting/cubeview.cpp 6
-
- In the code above, we first push the main scene's modelview and
- projection matrices. And then we push a new drawing surface onto
- the painter's surface stack. Everything we draw from now on will
- be written to \c{fboSurface} and thus the framebuffer object.
- To do that, we set the inner camera position, adjust the painter
- state, clear the framebuffer object, and draw the teapot:
-
- \snippet qt3d/nesting/cubeview.cpp 7
-
- Now that the nested scene has been drawn to the framebuffer object,
- we pop the surface and matrix stacks to return to the main scene:
-
- \snippet qt3d/nesting/cubeview.cpp 8
-
- Because our cubes are transparent, we need to make sure we draw
- the objects in the scene from back to front. Otherwise the result
- will not look correct. To do this, we check which of the cube
- mid-points is furtherest away from the camera and draw that cube first
- (the more negative the z value, the further away it is):
-
- \snippet qt3d/nesting/cubeview.cpp 9
-
- Drawing the first cube with the simple texture is very similar to
- the \l{Object Effects}{Cube} example:
-
- \snippet qt3d/nesting/cubeview.cpp 10
-
- The main interesting wrinkle is that we draw the cube twice,
- once with front faces culled, and the second time with back
- faces culled. This effectively causes the cube to be drawn
- back to front for proper blending.
-
- The second cube is drawn in a similar way except that we bind
- the framebuffer object's texture to the state instead of a static
- texture:
-
- \snippet qt3d/nesting/cubeview.cpp 11
-
- Face culling is a simple way to draw transparent objects, but it
- really only works on non-intersecting convex objects like our cubes.
- For concave objects (like the teapot) or objects that intersect,
- we would need to break the objects up into smaller convex pieces
- and then order the pieces from back to front.
-
- \l{qt3d-examples.html}{Return to Examples}.
-*/
diff --git a/doc/src/examples/teapot-qml.qdoc b/doc/src/examples/teapot-qml.qdoc
deleted file mode 100644
index 5374edb7..00000000
--- a/doc/src/examples/teapot-qml.qdoc
+++ /dev/null
@@ -1,73 +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 documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** GNU Free Documentation License
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file.
-**
-** 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$
-**
-****************************************************************************/
-
-/*!
- \example quick3d/teapot_qml
- \title Teapot Example in QtQuick3D
-
- This example shows to use QtQuick3D to display a teapot on
- the screen. The QML is fairly simple:
-
- \snippet quick3d/teapot_qml/qml/teapot.qml 1
-
- \image teapot-qml-screenshot.png
-
- The example starts by importing the Qt and Qt3D QML modules:
-
- \snippet quick3d/teapot_qml/qml/teapot.qml 2
-
- Then we create a viewport of size 640x480 to display the teapot:
-
- \snippet quick3d/teapot_qml/qml/teapot.qml 3
-
- And now we create a \l Item3D to display the teapot with a
- default lit material effect:
-
- \snippet quick3d/teapot_qml/qml/teapot.qml 4
-
- The teapot data itself is loaded from \c{teapot.bez}, which contains
- Bezier patch data that describes the geometry of the teapot.
-
- Let's make the teapot a little more interesting by adding a
- material to simulate bone china:
-
- \snippet quick3d/teapot_bounce_qml/qml/teapot-bounce.qml 1
- \snippet quick3d/teapot_bounce_qml/qml/teapot-bounce.qml 2
-
- \image teapot-china-screenshot.png
-
- To make the teapot even more interesting, we can cause it to
- bounce up and down using a QML animation item:
-
- \snippet quick3d/teapot_bounce_qml/qml/teapot-bounce.qml 3
-
- This QML teapot example can be compared with the \l{qt3d/teapot}{C++ version}.
- Using QML is briefer than C++, and easier to modify to adjust
- materials and add new features like animations.
-
- \l{qt3d-examples.html}{Return to Examples}.
-*/
diff --git a/doc/src/examples/teapot.qdoc b/doc/src/examples/teapot.qdoc
deleted file mode 100644
index d85fca48..00000000
--- a/doc/src/examples/teapot.qdoc
+++ /dev/null
@@ -1,101 +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 documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** GNU Free Documentation License
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file.
-**
-** 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$
-**
-****************************************************************************/
-
-/*!
- \example qt3d/teapot
- \title Teapot Example
-
- The Teapot example shows how Qt3D can be used to draw a simple
- teapot object with a perspective camera view in C++. There is
- also a \l{Teapot Example in QtQuick3D}{QtQuick3D version} of the teapot
- example.
-
- We start by defining a class that inherits from QGLView, which
- provides some basic scene setup logic and 3D camera navigation:
-
- \snippet qt3d/teapot/teapotview.h class-defn
- \dots
- \quotefromfile qt3d/teapot/main.cpp
- \skipuntil [main]
- \printto [main-args]
- \skipuntil [main-args-end]
- \printto [main]
-
- When the application starts up, we set up some scene parameters
- in the \c{initializeGL()} function:
-
- \quotefromfile qt3d/teapot/teapotview.cpp
- \skipuntil [initialize]
- \printto [build-geometry]
-
- The first line of the function selects a standard rendering
- effect that lights material colors with the default OpenGL
- two-sided lighting algorithm and the default light.
-
- The \c{teapot} member variable is an instance of QGLSceneNode,
- which we create using QGLBuilder during \c{initializeGL()}:
-
- \quotefromfile qt3d/teapot/teapotview.cpp
- \skipuntil [build-geometry]
- \printto [initialize]
-
- The QGLTeapot class represents the geometry for the teapot,
- which is added to the builder with the \c{<<} operator.
-
- We then call QGLBuilder::finalizedSceneNode() to finalize the
- object, prepare it to be uploaded to the GL server as a
- vertex buffer, and hand over ownership of the scene node.
-
- We have to take care to clean up our scene after we're done with it
- and here that is done in the destructor:
-
- \snippet qt3d/teapot/teapotview.cpp destructor
-
- Finally, we paint the teapot every time the window is refreshed:
-
- \snippet qt3d/teapot/teapotview.cpp paint
-
- The QGLView class has in-built support for camera navigation
- using the mouse and keyboard. By clicking and dragging the mouse,
- the teapot can be rotated into any position. The image on the
- left shows the view in its startup default position, and the
- image on the right shows the view after rotation using the mouse:
-
- \raw HTML
- <center><table><tr><td>
- \endraw
- \image teapot-screenshot.png
- \raw HTML
- </td><td>
- \endraw
- \image teapot-rotated.png
- \raw HTML
- </td></tr></table></center>
- \endraw
-
- \l{qt3d-examples.html}{Return to Examples}.
-*/
diff --git a/doc/src/images/REAME-ODF b/doc/src/images/REAME-ODF
deleted file mode 100644
index 6d1a820b..00000000
--- a/doc/src/images/REAME-ODF
+++ /dev/null
@@ -1,5 +0,0 @@
-The *.odf files here are OpenOffice formula files.
-
-To edit the formulas shown here as png's, open the corresponding odf file
-with OpenOffices formula editor, edit, save, then export as PDF. The
-PDF can be opened with gimp to create a PNG.
diff --git a/doc/src/images/affine-transform.odf b/doc/src/images/affine-transform.odf
deleted file mode 100644
index 4ead5cca..00000000
--- a/doc/src/images/affine-transform.odf
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/affine-transform.png b/doc/src/images/affine-transform.png
deleted file mode 100644
index c520623f..00000000
--- a/doc/src/images/affine-transform.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/attenuation.odf b/doc/src/images/attenuation.odf
deleted file mode 100644
index a3c35333..00000000
--- a/doc/src/images/attenuation.odf
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/attenuation.png b/doc/src/images/attenuation.png
deleted file mode 100644
index fa64ebed..00000000
--- a/doc/src/images/attenuation.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/basket-screenshot.png b/doc/src/images/basket-screenshot.png
deleted file mode 100644
index 21d72a28..00000000
--- a/doc/src/images/basket-screenshot.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/build-qt3d-qtcreator-1.png b/doc/src/images/build-qt3d-qtcreator-1.png
deleted file mode 100644
index 1e044c5b..00000000
--- a/doc/src/images/build-qt3d-qtcreator-1.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/build-qt3d-qtcreator-2.png b/doc/src/images/build-qt3d-qtcreator-2.png
deleted file mode 100644
index 962e1387..00000000
--- a/doc/src/images/build-qt3d-qtcreator-2.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/build-qt3d-qtcreator-3.png b/doc/src/images/build-qt3d-qtcreator-3.png
deleted file mode 100644
index 02b077c0..00000000
--- a/doc/src/images/build-qt3d-qtcreator-3.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/build-qt3d-qtcreator-4.png b/doc/src/images/build-qt3d-qtcreator-4.png
deleted file mode 100644
index 171f9837..00000000
--- a/doc/src/images/build-qt3d-qtcreator-4.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/build-qt3d-qtcreator-5.png b/doc/src/images/build-qt3d-qtcreator-5.png
deleted file mode 100644
index 89956c83..00000000
--- a/doc/src/images/build-qt3d-qtcreator-5.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/build-qt3d-qtcreator-6.png b/doc/src/images/build-qt3d-qtcreator-6.png
deleted file mode 100644
index 23eca778..00000000
--- a/doc/src/images/build-qt3d-qtcreator-6.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/build-qt3d-qtcreator-7.png b/doc/src/images/build-qt3d-qtcreator-7.png
deleted file mode 100644
index aa88c4de..00000000
--- a/doc/src/images/build-qt3d-qtcreator-7.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/build-qt3d-qtcreator-8.png b/doc/src/images/build-qt3d-qtcreator-8.png
deleted file mode 100644
index c6e6db9f..00000000
--- a/doc/src/images/build-qt3d-qtcreator-8.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/build-qt3d-qtcreator-9.png b/doc/src/images/build-qt3d-qtcreator-9.png
deleted file mode 100644
index 8fce56eb..00000000
--- a/doc/src/images/build-qt3d-qtcreator-9.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/build-qt3d-qtcreator-set-to-release.png b/doc/src/images/build-qt3d-qtcreator-set-to-release.png
deleted file mode 100644
index 882a80d8..00000000
--- a/doc/src/images/build-qt3d-qtcreator-set-to-release.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/cube-screenshot.png b/doc/src/images/cube-screenshot.png
deleted file mode 100644
index 56464675..00000000
--- a/doc/src/images/cube-screenshot.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/cylinder-texture-coords.png b/doc/src/images/cylinder-texture-coords.png
deleted file mode 100644
index 8ad69b43..00000000
--- a/doc/src/images/cylinder-texture-coords.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/faceted-q.png b/doc/src/images/faceted-q.png
deleted file mode 100644
index a809976b..00000000
--- a/doc/src/images/faceted-q.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/forest-screenshot.png b/doc/src/images/forest-screenshot.png
deleted file mode 100644
index 9984d0be..00000000
--- a/doc/src/images/forest-screenshot.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/forest-screenshot2.png b/doc/src/images/forest-screenshot2.png
deleted file mode 100644
index 3de77cfa..00000000
--- a/doc/src/images/forest-screenshot2.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/forest-screenshot3.png b/doc/src/images/forest-screenshot3.png
deleted file mode 100644
index 5589e2ad..00000000
--- a/doc/src/images/forest-screenshot3.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/gradient.png b/doc/src/images/gradient.png
deleted file mode 100644
index 2ef36edd..00000000
--- a/doc/src/images/gradient.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/imports-dir.png b/doc/src/images/imports-dir.png
deleted file mode 100644
index 69528e1a..00000000
--- a/doc/src/images/imports-dir.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/line-int-1.png b/doc/src/images/line-int-1.png
deleted file mode 100644
index 74e9be24..00000000
--- a/doc/src/images/line-int-1.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/line-int-2.png b/doc/src/images/line-int-2.png
deleted file mode 100644
index 9ca44374..00000000
--- a/doc/src/images/line-int-2.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/line-intersection.odf b/doc/src/images/line-intersection.odf
deleted file mode 100644
index 4e0fe2d4..00000000
--- a/doc/src/images/line-intersection.odf
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/line-intersection.pdf b/doc/src/images/line-intersection.pdf
deleted file mode 100644
index cf9ef0b4..00000000
--- a/doc/src/images/line-intersection.pdf
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/line-intersection2.odf b/doc/src/images/line-intersection2.odf
deleted file mode 100644
index 4e959aff..00000000
--- a/doc/src/images/line-intersection2.odf
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/line-intersection2.pdf b/doc/src/images/line-intersection2.pdf
deleted file mode 100644
index bd624790..00000000
--- a/doc/src/images/line-intersection2.pdf
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/monkeygod-screenshot.png b/doc/src/images/monkeygod-screenshot.png
deleted file mode 100644
index de8a73d0..00000000
--- a/doc/src/images/monkeygod-screenshot.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/moon-screenshot.png b/doc/src/images/moon-screenshot.png
deleted file mode 100644
index cafeffff..00000000
--- a/doc/src/images/moon-screenshot.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/mouse3dtest-screenshot.png b/doc/src/images/mouse3dtest-screenshot.png
deleted file mode 100644
index 518a915e..00000000
--- a/doc/src/images/mouse3dtest-screenshot.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/nesting-screenshot.png b/doc/src/images/nesting-screenshot.png
deleted file mode 100644
index 9e60ddf1..00000000
--- a/doc/src/images/nesting-screenshot.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/normalized.odf b/doc/src/images/normalized.odf
deleted file mode 100644
index d75e7044..00000000
--- a/doc/src/images/normalized.odf
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/pageflip-screenshot.png b/doc/src/images/pageflip-screenshot.png
deleted file mode 100644
index 2a081a21..00000000
--- a/doc/src/images/pageflip-screenshot.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/painter-screenshot.png b/doc/src/images/painter-screenshot.png
deleted file mode 100644
index e11a5a34..00000000
--- a/doc/src/images/painter-screenshot.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/penguin-0-screenshot.png b/doc/src/images/penguin-0-screenshot.png
deleted file mode 100644
index d65d590f..00000000
--- a/doc/src/images/penguin-0-screenshot.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/penguin-screenshot.png b/doc/src/images/penguin-screenshot.png
deleted file mode 100644
index eb334980..00000000
--- a/doc/src/images/penguin-screenshot.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/pvcolor.png b/doc/src/images/pvcolor.png
deleted file mode 100644
index 380a19a3..00000000
--- a/doc/src/images/pvcolor.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/pyramid-screenshot.png b/doc/src/images/pyramid-screenshot.png
deleted file mode 100644
index 6a585a6c..00000000
--- a/doc/src/images/pyramid-screenshot.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/qray3d-project.png b/doc/src/images/qray3d-project.png
deleted file mode 100644
index 1288f204..00000000
--- a/doc/src/images/qray3d-project.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/qt-creator-config-3ds.png b/doc/src/images/qt-creator-config-3ds.png
deleted file mode 100644
index 87ac89fd..00000000
--- a/doc/src/images/qt-creator-config-3ds.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/qt-creator-lib-path.png b/doc/src/images/qt-creator-lib-path.png
deleted file mode 100644
index 5f988437..00000000
--- a/doc/src/images/qt-creator-lib-path.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/qt-creator-plugins.png b/doc/src/images/qt-creator-plugins.png
deleted file mode 100644
index 8b469ab0..00000000
--- a/doc/src/images/qt-creator-plugins.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/qt-creator-shadow-build.png b/doc/src/images/qt-creator-shadow-build.png
deleted file mode 100644
index 9b231d5f..00000000
--- a/doc/src/images/qt-creator-shadow-build.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/qt-logo.png b/doc/src/images/qt-logo.png
deleted file mode 100644
index 14ddf2a0..00000000
--- a/doc/src/images/qt-logo.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/qt3d-logo.png b/doc/src/images/qt3d-logo.png
deleted file mode 100644
index 1196826b..00000000
--- a/doc/src/images/qt3d-logo.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/quad-extrude.png b/doc/src/images/quad-extrude.png
deleted file mode 100644
index c4b6ee44..00000000
--- a/doc/src/images/quad-extrude.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/quad-extrude.xcf b/doc/src/images/quad-extrude.xcf
deleted file mode 100644
index 0d1650ac..00000000
--- a/doc/src/images/quad-extrude.xcf
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/quads.png b/doc/src/images/quads.png
deleted file mode 100644
index 28a03099..00000000
--- a/doc/src/images/quads.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/shapes-screenshot.png b/doc/src/images/shapes-screenshot.png
deleted file mode 100644
index ad0a0f43..00000000
--- a/doc/src/images/shapes-screenshot.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/soup.png b/doc/src/images/soup.png
deleted file mode 100644
index c84c0729..00000000
--- a/doc/src/images/soup.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/sphere-detail.png b/doc/src/images/sphere-detail.png
deleted file mode 100644
index 90e40fb4..00000000
--- a/doc/src/images/sphere-detail.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/spiky-teapot.png b/doc/src/images/spiky-teapot.png
deleted file mode 100644
index 2871d83e..00000000
--- a/doc/src/images/spiky-teapot.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/stereo-nhd-screenshot.png b/doc/src/images/stereo-nhd-screenshot.png
deleted file mode 100644
index 74df719e..00000000
--- a/doc/src/images/stereo-nhd-screenshot.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/stereo-screenshot-qml.png b/doc/src/images/stereo-screenshot-qml.png
deleted file mode 100644
index d7e8f7a3..00000000
--- a/doc/src/images/stereo-screenshot-qml.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/stereo-screenshot-qml2.png b/doc/src/images/stereo-screenshot-qml2.png
deleted file mode 100644
index d91f959f..00000000
--- a/doc/src/images/stereo-screenshot-qml2.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/stereo-screenshot.png b/doc/src/images/stereo-screenshot.png
deleted file mode 100644
index 020fcb68..00000000
--- a/doc/src/images/stereo-screenshot.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/stereo-wide-screenshot.png b/doc/src/images/stereo-wide-screenshot.png
deleted file mode 100644
index f9e165a6..00000000
--- a/doc/src/images/stereo-wide-screenshot.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/teapot-china-screenshot.png b/doc/src/images/teapot-china-screenshot.png
deleted file mode 100644
index d38602fc..00000000
--- a/doc/src/images/teapot-china-screenshot.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/teapot-distortion.png b/doc/src/images/teapot-distortion.png
deleted file mode 100644
index 76b4a3db..00000000
--- a/doc/src/images/teapot-distortion.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/teapot-distortion2.png b/doc/src/images/teapot-distortion2.png
deleted file mode 100644
index 573503bd..00000000
--- a/doc/src/images/teapot-distortion2.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/teapot-logo.png b/doc/src/images/teapot-logo.png
deleted file mode 100644
index a82c33c1..00000000
--- a/doc/src/images/teapot-logo.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/teapot-qml-screenshot.png b/doc/src/images/teapot-qml-screenshot.png
deleted file mode 100644
index cb9dea91..00000000
--- a/doc/src/images/teapot-qml-screenshot.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/teapot-qt-screenshot.png b/doc/src/images/teapot-qt-screenshot.png
deleted file mode 100644
index 2a5c2ead..00000000
--- a/doc/src/images/teapot-qt-screenshot.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/teapot-rotated.png b/doc/src/images/teapot-rotated.png
deleted file mode 100644
index f66a93ef..00000000
--- a/doc/src/images/teapot-rotated.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/teapot-screenshot.png b/doc/src/images/teapot-screenshot.png
deleted file mode 100644
index 07922e9e..00000000
--- a/doc/src/images/teapot-screenshot.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/teaservice-qml-screenshot.png b/doc/src/images/teaservice-qml-screenshot.png
deleted file mode 100644
index ee2b935a..00000000
--- a/doc/src/images/teaservice-qml-screenshot.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/teaservice-screenshot.png b/doc/src/images/teaservice-screenshot.png
deleted file mode 100644
index 35e6fc8e..00000000
--- a/doc/src/images/teaservice-screenshot.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/texture-coords-gen.png b/doc/src/images/texture-coords-gen.png
deleted file mode 100644
index 5f155b1a..00000000
--- a/doc/src/images/texture-coords-gen.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/texture-coords-gen.xcf b/doc/src/images/texture-coords-gen.xcf
deleted file mode 100644
index b6540bb4..00000000
--- a/doc/src/images/texture-coords-gen.xcf
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/texture-seam.png b/doc/src/images/texture-seam.png
deleted file mode 100644
index 2cd97233..00000000
--- a/doc/src/images/texture-seam.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/triangle3d-center.png b/doc/src/images/triangle3d-center.png
deleted file mode 100644
index da6fabb0..00000000
--- a/doc/src/images/triangle3d-center.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/triangle3d-dimensions.png b/doc/src/images/triangle3d-dimensions.png
deleted file mode 100644
index 5efe28ec..00000000
--- a/doc/src/images/triangle3d-dimensions.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/triangle3d.xcf b/doc/src/images/triangle3d.xcf
deleted file mode 100644
index 798fafd2..00000000
--- a/doc/src/images/triangle3d.xcf
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/triangulated-face.png b/doc/src/images/triangulated-face.png
deleted file mode 100644
index fab48126..00000000
--- a/doc/src/images/triangulated-face.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/triangulated-face.xcf b/doc/src/images/triangulated-face.xcf
deleted file mode 100644
index 74b08edf..00000000
--- a/doc/src/images/triangulated-face.xcf
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/tutorials/converting-screenshot.png b/doc/src/images/tutorials/converting-screenshot.png
deleted file mode 100644
index 9fb738ff..00000000
--- a/doc/src/images/tutorials/converting-screenshot.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/tutorials/cube1-screenshot.png b/doc/src/images/tutorials/cube1-screenshot.png
deleted file mode 100644
index a0da12f0..00000000
--- a/doc/src/images/tutorials/cube1-screenshot.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/tutorials/cube2-screenshot.png b/doc/src/images/tutorials/cube2-screenshot.png
deleted file mode 100644
index 20e05d1b..00000000
--- a/doc/src/images/tutorials/cube2-screenshot.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/tutorials/cube3-screenshot.png b/doc/src/images/tutorials/cube3-screenshot.png
deleted file mode 100644
index 49cf8cbc..00000000
--- a/doc/src/images/tutorials/cube3-screenshot.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/tutorials/cube4-screenshot.png b/doc/src/images/tutorials/cube4-screenshot.png
deleted file mode 100644
index 4f71452d..00000000
--- a/doc/src/images/tutorials/cube4-screenshot.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/tutorials/shader-tutorial-varying.png b/doc/src/images/tutorials/shader-tutorial-varying.png
deleted file mode 100644
index 6e0c78e9..00000000
--- a/doc/src/images/tutorials/shader-tutorial-varying.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/tutorials/shader-tutorial.png b/doc/src/images/tutorials/shader-tutorial.png
deleted file mode 100644
index 97db13d3..00000000
--- a/doc/src/images/tutorials/shader-tutorial.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/vector-mag.odf b/doc/src/images/vector-mag.odf
deleted file mode 100644
index 96222af0..00000000
--- a/doc/src/images/vector-mag.odf
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/vector-mag.png b/doc/src/images/vector-mag.png
deleted file mode 100644
index 0d913ee6..00000000
--- a/doc/src/images/vector-mag.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/vector-normalized.png b/doc/src/images/vector-normalized.png
deleted file mode 100644
index c1c4b968..00000000
--- a/doc/src/images/vector-normalized.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/vector-point.odf b/doc/src/images/vector-point.odf
deleted file mode 100644
index 6b73097c..00000000
--- a/doc/src/images/vector-point.odf
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/vector-point.png b/doc/src/images/vector-point.png
deleted file mode 100644
index c78410fd..00000000
--- a/doc/src/images/vector-point.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/view-frustum-10-degrees-angle-shot.png b/doc/src/images/view-frustum-10-degrees-angle-shot.png
deleted file mode 100644
index aab9764f..00000000
--- a/doc/src/images/view-frustum-10-degrees-angle-shot.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/view-frustum-10-degrees.png b/doc/src/images/view-frustum-10-degrees.png
deleted file mode 100644
index 130a4464..00000000
--- a/doc/src/images/view-frustum-10-degrees.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/view-frustum-20-degrees.png b/doc/src/images/view-frustum-20-degrees.png
deleted file mode 100644
index 079c2550..00000000
--- a/doc/src/images/view-frustum-20-degrees.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/view-frustum-30-degrees.png b/doc/src/images/view-frustum-30-degrees.png
deleted file mode 100644
index 9d0a2e59..00000000
--- a/doc/src/images/view-frustum-30-degrees.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/view-frustum-angle-shot-annotated.png b/doc/src/images/view-frustum-angle-shot-annotated.png
deleted file mode 100644
index a2949db7..00000000
--- a/doc/src/images/view-frustum-angle-shot-annotated.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/view-frustum-angle-shot.png b/doc/src/images/view-frustum-angle-shot.png
deleted file mode 100644
index 8991a442..00000000
--- a/doc/src/images/view-frustum-angle-shot.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/view-frustum-angle-shot.xcf b/doc/src/images/view-frustum-angle-shot.xcf
deleted file mode 100644
index 0583b0d8..00000000
--- a/doc/src/images/view-frustum-angle-shot.xcf
+++ /dev/null
Binary files differ
diff --git a/doc/src/images/view-frustum-origin.png b/doc/src/images/view-frustum-origin.png
deleted file mode 100644
index 8c008df8..00000000
--- a/doc/src/images/view-frustum-origin.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc
deleted file mode 100644
index e70eff2b..00000000
--- a/doc/src/index.qdoc
+++ /dev/null
@@ -1,103 +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 documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** GNU Free Documentation License
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file.
-**
-** 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$
-**
-****************************************************************************/
-
-/*!
- \page index.html
- \title QtQuick3D Reference Documentation
- \keyword QtQuick3D Reference Documentation
-
- \image qt3d-logo.png
-
- QtQuick3D adds 3D content to \l{http://qt.nokia.com/qtquick/}{Qt Quick's} cross-platform ability and coding power.
- Developers of fluid user interfaces can now enhance their applications with 3D
- content in the same way icons and pixmaps would be used in a 2D application.
-
- QtQuick3D is a product resulting from the \l{http://doc.qt.nokia.com/qt3d-snapshot}{Qt3D project}. Qt3D is a set of powerful
- cross-platform C++ API's for 3D programming using OpenGL.
-
- QtQuick3D is made up of the QML bindings for Qt3D (called QML3D) plus
- Qt Creator integration, and other supporting tools. Qt3D may be used to
- extend QtQuick3D by creating new user-defined QML3D items using C++.
-
- OpenGL hardware was designed for 3D acceleration and QtQuick3D allows applications
- to utilise that 3D hardware fully.
-
- QtQuick3D is the Qt Quick product for scripting 3D applications in QML. Apps can be
- 2D QML applications with a small amount of simple 3D content; through to complex
- 3D scenes, containing 3D assets - such as complex 3D models, and shader effects.
-
- In QtQuick3D scripts are written in QML, and rendered with the power of Qt & C++.
-
- Qt3D research continues and if the features you're looking for are not in QtQuick3D
- yet you may find them in the \l{http://doc.qt.nokia.com/qt3d-snapshot/index.html}{Qt3D research project}.
-
- Check the Qt3D research project for upcoming features like \bold{stereoscopic support},
- which will enable your programs to take advantage of special hardware that displays a different image to each eye.
- We are readying QtQuick3D for stereo support and in some places you may see references to it,
- however it is \bold{not supported yet}.
-
- QtQuick3D displays \bold{3D content} that is \bold{ready to be enhanced} by stereoscopic
- hardware, but out-of-the-box QtQuick3D works just fine on regular non-stereo displays
- and does not require special glasses or displays to use it.
-
- See the \l{Tutorials and Examples} for an introduction to using QtQuick3D and Qt3D.
-
- \table 100%
- \header
- \o Getting Started
- \o Functionality Areas
- \o API Reference
- \row
- \o \list
- \o \l{qt3d-building.html}{Building}
- \o \l{qt3d-examples.html}{Tutorials and Examples}
- \o \l{Writing a scene format plug-in for Qt3D}{Scene format plug-ins}
- \o \l{qt3d-contrib.html}{Contributing}
- \o \l{qt3d-acceptance.html}{Acceptance tests}
- \o \l{qt3d-troubleshooting.html}{Troubleshooting Quick3D}
- \endlist
-
- \o \list
- \o \l{Qt3D Arrays and Vertex Buffers}{Arrays and Vertex Buffers}
- \o \l{Qt3D Geometry}{Geometry Building}
- \o \l{Qt3D Graphics View Integration}{Graphics View Integration}
- \o \l{Qt3D Materials}{Materials}
- \o \l{Qt3D Math}{Mathematical Primitives}
- \o \l{Qt3D Painting}{Painting in 3D}
- \o \l{Qt3D Scene Management}{Scene Management}
- \o \l{Qt3D Texture Handling}{Texture Management}
- \o \l{Qt3D Viewing}{Viewing Widgets}
- \endlist
-
- \o \list
- \o \l{qt3d-all-classes.html}{All Classes}
- \o \l{All Namespaces}{QGL Namespace}
- \o \l{QtQuick3D for Scripting 3D Apps in QML}{QtQuick3D Elements}
- \o \l{Stock Shapes for QtQuick3D}{QML/3D Stock Shapes}
- \endlist
- \endtable
-*/
diff --git a/doc/src/qline3d-math.qdoc b/doc/src/qline3d-math.qdoc
deleted file mode 100644
index beacf1b2..00000000
--- a/doc/src/qline3d-math.qdoc
+++ /dev/null
@@ -1,211 +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 documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** GNU Free Documentation License
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file.
-**
-** 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$
-**
-****************************************************************************/
-
-/*!
- \ingroup qt3d
- \ingroup qt3d::math
- \since 4.8
- \title 3D Math Basis
- \page qt3d-math-basis.html
- \keyword 3D Math Basis
- \brief Math foundations for the Qt3D math classes.
-
- The math classes provide basic operations in 3-space useful for graphics:
- \list
- \o QLine3D
- \o QLineSegment3D
- \o QPlane3D
- \o QTriangle3D
- \o QBox3D
- \endlist
-
- This is a basic discussion of the mathematics behind these classes.
-
- \section1 Vectors and Points
-
- There are two important building blocks in 3D: the \bold vector and the
- \bold point in cartesian 3-space.
-
- Both are comprised by 3 values in \bold R, the real numbers.
-
- So programatically in Qt both vectors and points are stored in a QVector3D instance,
- since that class can store 3 qreal values.
-
- But there are important differences between points and vectors:
- \list
- \o a point \bold P is a 3D \i location, and makes sense in terms of a 3D cartesian
- coordinate system. A real-world example is a map-location given in terms
- of a map cross-reference. The location has no inherent magnitude, unless you
- provide another location and find the distance between the two.
- \o a vector \bold v is a 3D \i direction and magnitude. It makes no sense to talk
- about a vector being located somewhere. A vector can represent for example
- some directions like "go 3 north-west 3 kilometers", but this can be done from
- \bold {anywhere on the map} - it is not anchored like the point is.
- \endlist
-
- In 3D math points and vectors are represented by column vectors:
-
- \image vector-point.png
-
- In normal text where the over-arrow symbol is not available the vector is just a
- bolded lower-case letter. A point is a capital letter, non-bolded.
-
- The fourth element in the column vectors above, w = 1 for points and w = 0 for vectors
- means that vectors are not altered by certain affine transformations such
- as \c{translate()}.
-
- \image affine-transform.png
-
- This affine transform T comprises a rotation and a translation. Remember that applying
- the transform is done by the
- \l{http://www.intmath.com/Matrices-determinants/4_Multiplying-matrices.php}{matrix multiplication}
- \c{P * T = P'}.
-
- Notice how the 1 in the column for the translation multiplies out to zero against
- the vectors last 0 value, so the vector is "immune" to the translation.
-
- In the case of the point the w = 1 "triggers" the translation values in the matrix.
-
- So the take away principle is that points and vectors, while represented by the same
- data structure are different and behave differently in 3D math.
-
- \section2 Vector Magnitude and Normal Vectors
-
- Another important difference between points and vectors is that a vector has a magnitude,
- whereas a point does not.
-
- Consider the vector v = (v0, v1, v2) to be rooted at
- the origin O = (0, 0, 0) and pointing to the point P = (v0, v1, v2), then
- its magnitude is the length of the line O to P. Magnitude is represented by
- vertical bars and is found by this formula:
-
- \image vector-mag.png
-
- Unit vectors are those with a magnitude of exactly 1. The math notation is a "hat"
- (or circumflex) over the bolded vector symbol.
-
- A unit vector parallel to one of the axes is easy to form without any division:
- \raw HTML
- <center><b>&#238;</b> = (1, 0, 0)</center>
- \endraw
-
- More typically such a vector is found by dividing by its own length:
-
- \image vector-normalized.png
-
- Vectors used for 3D normals are usually normalized to unit length. Confusingly
- enough, since that is two different uses of the word "normal".
-
- A \i normal is simply a vector perpendicular to something. For example a plane normal is
- perpendicular to the plane.
-
- Typically a normal vector is unit length, for convenience in 3D applications (but
- there is nothing mathematically to say a normal vector has to be unit length).
-
- A vertex normal is perpendicular to the surface modelled by the vertex, and is used
- in lighting calculations.
-
- \section1 Reviewing Operations on Vectors
-
- The QVector3D class provides two very useful functions - the vector dot-product and the
- vector cross-product. Here's a quick review of their uses:
- \list
- \o QVector3D::crossProduct(const QVector3D &, const QVector3D &)
- \list
- \o The cross-product of two vectors produces a \i vector as a result and is
- written \bold w = \bold u x \bold v. The result \bold w is perpendicular to both
- \bold u and \bold v. Consider a plane N containing point P, with the tails of \bold u
- and \bold v at P, and both lying in N, then \bold u x \bold v is a normal to N.
- \endlist
- \o QVector3D::dotProduct(const QVector3D &, const QVector3D &)
- \list
- \o The dot-product of two vectors produces a \i scalar as a result and is written
- \c{t = \bold u . \bold v}. The result t = |u| |v| cos(A), where A is the angle
- between u and v. When \bold u and \bold v have magnitude 1, they are called
- unit vectors, and \bold u . \bold v = cos(A).
- \endlist
- \endlist
-
- A vector has the following operations defined on it in 3-space
- \list
- \o multiplication by a scalar, eg v' = s * \bold v
- \o addition with another vector, eg \bold u = \bold v + \bold w
- \endlist
-
- Multiplying and dividing by vectors is not defined - these operations make no sense in
- 3-D space.
-
- Although you cannot add a vector to a point as such, you can consider the vector from the
- origin to the point, and add the vector to that. Thus rather than out-lawing adding a
- vector to a point it is simply defined as such. This allows the convenient notation for
- lines and planes introduced in the next section.
-
- \section1 Representing Lines and Planes
-
- The QLine3D is represented by a point and a vector: the point anchors the line in
- cartesian 3-space; and the vector is the direction the line is oriented in through that
- point. The line is infinite.
-
- The QPlane3D is represented also by a point and a vector. Again the point anchors the line
- in cartesian 3-space; but the vector this time is a normal to the plane. The plane is
- infinite.
-
- This representation turns out to make many types of calculations required for 3D graphics
- very straight forward.
-
- For example to find if a point P lies on a plane take the vector \bold p from the point to
- the planes origin, and find the dot-product with the planes normal \bold n.
-
- If \bold {p . n} is zero, then \bold p is perpendicular to \bold n, and P is on the plane.
-
- \target vector-and-point-arithmetic
- \section1 Vector and Point Arithmetic
-
- Slightly more complex arithmetic with the components of QLine3D and QPlane3D is possible,
- with some care about what operations can be performed.
-
- As an example look at the implementation for QLine3D::intersection(const QLine3D &) : the
- two lines are defined as:
-
- \image line-int-1.png
-
- If the two lines intersect then P(t) == Q(s) and for some ordered pair \bold s, \bold t
- is a solution to the equations for both lines.
-
- The aim is to solve for \bold s and \bold t.
-
- The equations can be rearranged algebraically as shown in the last line above.
-
- But since dividing by a vector is not defined, tempting options such as dividing by \bold v
- to solve for t are not possible. In the implementation the next step is breaking the points
- and vectors down into their x, y and z components giving 3 simultaneous equations:
-
- \image line-int-2.png
-
- This can be readily solved using gaussian elimination to get a solution for s, and
- substituting back gives t.
-*/
diff --git a/doc/src/qt3d-all-classes.qdoc b/doc/src/qt3d-all-classes.qdoc
deleted file mode 100644
index 3ba8aae7..00000000
--- a/doc/src/qt3d-all-classes.qdoc
+++ /dev/null
@@ -1,49 +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 documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** GNU Free Documentation License
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file.
-**
-** 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$
-**
-****************************************************************************/
-
-/*!
- \page qt3d-all-classes.html
- \title Qt3D Classes
- \keyword Qt3D Classes
-
- \generatelist classes
-*/
-
-/*!
- \group qt3d
- \title Qt3D Classes
-
- \generatelist{related}
-*/
-
-/*!
- \page qt3d-all-namespaces.html
- \title All Namespaces
- \keyword All Namespaces
-
- \l{QGL}{QGL Namespace}
-*/
diff --git a/doc/src/qt3d-all-modules.qdoc b/doc/src/qt3d-all-modules.qdoc
deleted file mode 100644
index bf22a1f8..00000000
--- a/doc/src/qt3d-all-modules.qdoc
+++ /dev/null
@@ -1,57 +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 documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** GNU Free Documentation License
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file.
-**
-** 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$
-**
-****************************************************************************/
-
-/*!
- \page qt3d-modules.html
- \title All Modules
- \keyword All Modules
-
- \raw HTML
- <table cellpadding="2" cellspacing="1" border="0" width="100%" class="indextable">
- <tr>
- <th class="titleheader" width="33%">
- Functionality Areas
- </th>
- </tr>
- <tr>
- <td valign="top">
- <ul>
- <li><a href="qt3d-arrays.html">Arrays and Vertex Buffers</a></li>
- <li><a href="qt3d-geometry.html">Geometry Building</a></li>
- <li><a href="qt3d-graphicsview.html">Graphics View Integration</a></li>
- <li><a href="qt3d-materials.html">Materials</a></li>
- <li><a href="qt3d-math.html">Mathematical Primitives</a></li>
- <li><a href="qt3d-painting.html">Painting in 3D</a></li>
- <li><a href="qt3d-scene.html">Scene Management</a></li>
- <li><a href="qt3d-textures.html">Texture Management</a></li>
- <li><a href="qt3d-viewing.html">Viewing Widgets</a></li>
- </ul>
- </td>
- </tr>
- </table>
- \endraw
-*/
diff --git a/doc/src/qt3d-arrays.qdoc b/doc/src/qt3d-arrays.qdoc
deleted file mode 100644
index 387d3d03..00000000
--- a/doc/src/qt3d-arrays.qdoc
+++ /dev/null
@@ -1,34 +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 documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** GNU Free Documentation License
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file.
-**
-** 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$
-**
-****************************************************************************/
-
-/*!
- \group qt3d::arrays
- \title Qt3D Arrays and Vertex Buffers
- \keyword Vertex Buffer
-
- \generatelist{related}
-*/
diff --git a/doc/src/qt3d-building.qdoc b/doc/src/qt3d-building.qdoc
deleted file mode 100644
index 176c2d32..00000000
--- a/doc/src/qt3d-building.qdoc
+++ /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 documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** GNU Free Documentation License
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file.
-**
-** 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$
-**
-****************************************************************************/
-
-/*!
- \page qt3d-building.html
- \title Building QtQuick3D
- \keyword Building QtQuick3D
-
- \section1 QtQuick3D Binary Packages
-
- Do you have to build QtQuick3D? Check if binary packages are available
- for your platform on the \l{http://qt.nokia.com/downloads}{Qt downloads page}.
-
- This page gives guidelines on how to build Qt3D either from a source package
- or from a repository snapshot.
-
- \section1 Obtaining QtQuick3D sources
-
- If you want to work with the latest bleeding edge QtQuick3D features, or if
- you would like to modify or contribute to QtQuick3D you can build it from
- our source repository.
-
- The source for QtQuick3D is hosted on Gitorious as the git repository
- \l{http://qt.gitorious.org/qt-quick3d/qt-quick3d}{\c{qt-quick3d/qt-quick3d.git}}.
- It can be cloned as follows:
-
- \code
- $ mkdir -p $HOME/depot/qt
- $ cd $HOME/depot/qt
- $ git clone git://gitorious.org/qt-quick3d/qt-quick3d.git
- \endcode
-
- More stable versions of the QtQuick3D source code is available as source
- packages from \l{ftp://ftp.qt.nokia.com/qt3d/noarch}{Qt3D downloads page}.
- Just unzip or untar it into your \c{depot} directory.
-
- \section1 Building QtQuick3D
-
- QtQuick3D requires Qt 4.7. The QtSDK currently ships with Qt 4.7 so if
- you're using the SDK you should be fine. Alternatively you can build
- against a Qt that you have compiled from source. Just make sure that
- when you build Qt, that you use the -developer-build option, and do not
- do a \c{make install} as root. The reason for this is when Qt3D builds in
- it will place the libraries, headers and plugins into the correct position
- in the hosted Qt library, so that will need to be writable.
-
- Here's an example configure line you can use:
- \code
- mkdir -p $HOME/build/qt/4.7 && cd $HOME/build/qt/4.7
- /path/to/qt/configure -developer-build -no-qt3support -no-webkit -no-xmlpatterns \
- -no-phonon -opengl -declarative -nomake demos -nomake examples
- make
- \endcode
- ...this line turns off many features that aren't needed for QtQuick3D, and
- it also explicitly asks for declarative and opengl (even though those are
- on by default) so that an error will be generated if OpenGL is not available.
-
- \section1 Building QtQuick3D Using QtCreator / QtSDK
-
- Here is a step-by-step guide to building QtQuick3D using the
- \l{http://qt.nokia.com/products/appdev/developer-tools/developer-tools}{QtCreator IDE}.
- QtCreator is the development environment for the QtSDK. Here we're using
- version 2.0 on Mac OSX, but other operating systems and versions should
- look similar. Always use the latest release of QtCreator if possible.
-
- \bold{Special note: Harmattan SDK.} When using the Harmattan support in the Qt SDK:
- \list
- \o in Step 2 below ensure you choose the appropriate Qt Build eg \c{Meego 1.2 Harmattan API}; and
- \o in Step 3 under \c{Build Steps > QMake > Additional arguments} add in \c{CONFIG+=qtc_harmattan}
- \endlist
-
- \image build-qt3d-qtcreator-1.png
-
- \bold{Step 1} - Open the QtQuick3D project.
-
- Choose \c{Open} from the \c{File} menu and navigate to the quick3d.pro project
- file \c {$HOME/depot/qt/quick3d/quick3d.pro}. Click \c{Open}.
-
- \image build-qt3d-qtcreator-2.png
-
- \bold{Step 2} - Select the Qt and load Qt3D.
-
- \image build-qt3d-qtcreator-4.png
-
- Set the Qt build to use, making sure it has OpenGL and QtDeclarative. In this
- situation where I have a large number of Qt versions to choose from it is
- easiest to use the "Uncheck All" button, then check the one I want - which is the
- Qt that ships with the QtSDK.
-
- If you can't tell from the screen above which is the right Qt to use, just
- choose a safe looking one, perhaps the default, as you can change it easily
- below.
-
- \image build-qt3d-qtcreator-3.png
-
- After a short time QtCreator will have loaded up the Qt3D project, read all its
- project files and display the source tree as shown just above.
-
- \bold{Step 2a} - Useful Options
-
- Use \c{QtCreator} -> \c{Preferences...} to bring up QtCreators options and settings.
- On Windows its \c{Tools} -> \c{Options...}.
-
- Make sure you have QtCreator set to display the compile process, so you can check
- what any errors may be. The other options are set how I like them, and may suit
- your use too. Give them a try, as shown in this screenshot just below.
-
- \image build-qt3d-qtcreator-7.png
-
- \bold{Step 3} - Set up for Building.
-
- \image build-qt3d-qtcreator-5.png
-
- Click the projects tab at the left to display the QtQuick3D target's \c{Build Settings}
- pane. Here you can specify a Shadow Build directory. It is always a good idea to
- build in a shadow directory, instead of inside the source tree.
-
- In the screenshot just above I use the Finder (Mac's equivalent to the Windows File
- Manager) to create the shadow build directory as a "new folder".
-
- \image build-qt3d-qtcreator-6.png
-
- In this screenshot, I have renamed the "new folder" to match the shadow build directory
- name that I gave QtCreator. Now I'm ready to click the "Build" button - circled in
- red in the bottom left hand corner of Qt Creators main screen.
-
- \image build-qt3d-qtcreator-8.png
-
- Before you do that here's a handy trick - set QtCreator to use multiple cores
- when it builds, if its supported on your platform. On Mac and other platforms that
- use GCC I can set the \c{-j 4} argument to \c{make}. For Windows check for the
- \c{jom} tool which you will already be using automatically, to see how many
- parallel jobs your build will use.
-
- \image build-qt3d-qtcreator-set-to-release.png
-
- \bold{Special note for Windows} - make sure that the type of build matches the
- Qt that you are building against. In the case of binary packages, and the Qt
- that ships with the SDK these are binary release builds - so in those cases set
- your Qt3D to a release build also. One way to tell that this has gone wrong is
- that your Qt3D library will be called \c{Qt3Dd.dll} (note the lower case "d"
- for debug) when your QtGui library is called \c{QtGui4.dll} (no lower case "d").
-
- By default the Qt build system used by QtCreator will build Qt3D in debug mode.
-
- Ok, \bold{now} hit the build button.
-
- \bold{Step 4} - Build QtQuick3D and run a test App.
-
- Qt3D will go ahead and compile all its libraries, plugins and QML imports.
-
- The build is set up so that these will be placed into the directories as specified
- by the host qmake - inside the Qt build tree. To find what these directories are run
- \c{qmake -query}. If you like after the build you can check those directories to be sure
- that Qt3D's files got placed there correctly.
-
- As explained above for this reason you will need to have the privileges on your
- computer to write to the directories given by \c{qmake -query}. On Windows this is
- generally not a problem. On Mac and Linux it should work fine when building with the
- SDK which is by default installed in your home directory. It will also be fine
- with builds from a source package.
-
- Qt3D will also place its \c{qt3d.prf} and \c{qt3dquick.prf} files into the
- host Qt's QMAKE_MKSPECS/features directory. Again see \c{qmake -query} for what
- that directory is on your system. This means that you can write Qt3D applications
- in C++ that use the libraries by simply adding \c{CONFIG += qt3d} to your
- .pro file.
-
- If you get early errors about not being able to copy the .prf files then check
- that you have set up QtCreator to use a Qt that you can write to.
-
- The build will then continue on and compile all of Qt3D's examples and demos,
- using the libraries as installed. When finished a message like "The process /usr/bin/make
- exited normally" should be displayed.
-
- There is no need to run a make install step.
-
- \image build-qt3d-qtcreator-9.png
-
- Now you can use QtCreator to run one of the examples. Click the button for the
- project switcher (circled in red) and then choose one of the apps. Here we
- have chosen the QML "Moon" app from the menu (indicated by the red arrow).
-
- Click the green arrow bottom left to actually launch the "Moon" app.
-
- Congratulations on building Qt3D!
-
- \section1 Building from the Command Line
-
- On Linux assuming that you have built Qt 4.7 in
- \c{$HOME/build/qt/4.7}, you would configure and build QtQuick3D as follows:
-
- \code
- $ mkdir -p $HOME/build/qt/quick3d
- $ cd $HOME/build/qt/quick3d
- $ $HOME/build/qt/4.7/bin/qmake $HOME/depot/qt/quick3d/quick3d.pro
- $ make -j 4
- $ bin/moon
- \endcode
-
- Note that the \c{$} above means the shell prompt (don't type the \{$}).
-
- The last line runs the example QML application \c{moon} to check that
- the build went OK.
-
- On Windows (with Visual Studio) those commands look like this:
-
- \code
- mkdir \build\qt\quick3d
- cd \build\qt\quick3d
- qmake \depot\qt\quick3d\quick3d.pro
- nmake
- bin\moon
- \endcode
-
- These commands for Windows assume that your Qt build for Qt 4.7 is in
- the current PATH - so that the qmake invoked above is actually going to
- be the Qt 4.7 qmake.
-
- On Symbian (with RVCT) those commands look like this:
-
- \code
- mkdir C:\depot\qt\quick3d
- cd C:\depot\qt\quick3d
- qmake CONFIG+=old_importer
- sbs -c armv5_urel
- cd devices\symbian
- createpackage QtQuick3D_template.pkg release-armv5
- runonphone --sis QtQuick3D.sis
- \endcode
-
- Once you have built QtQuick3D, you can run the "teapot" example:
-
- \code
- $ cd $HOME/build/qt/quick3d
- $ bin/teapot
- \endcode
-
- If all goes well, you should see something like the following
- on the screen:
-
- \image teapot-screenshot.png
-
- QtQuick3D has been tested with Qt/X11 and Qt/Embedded under Linux, on MacOSX
- and Windows XP. It also runs on Symbian^3 and MeeGo/Maemo.
-
- Patches for other platforms are welcome.
-
- \l{index.html}{Return to the main QtQuick3D page} or
- \l{qt3d-examples.html}{Continue to the Tutorials and Examples}.
-*/
diff --git a/doc/src/qt3d-contrib.qdoc b/doc/src/qt3d-contrib.qdoc
deleted file mode 100644
index 53e44f8b..00000000
--- a/doc/src/qt3d-contrib.qdoc
+++ /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 documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** GNU Free Documentation License
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file.
-**
-** 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$
-**
-****************************************************************************/
-
-/*!
- \page qt3d-contrib.html
- \title Contributing to QtQuick3D and Qt3D
- \keyword Contributing to Qt3D
-
- QtQuick3D and Qt3D are developed primarily in the Brisbane office of Qt
- Development Frameworks, but anyone is welcome to join the effort with
- patches, new examples, and major feature development.
-
- Qt3D research may be a better place to contribute as the QtQuick3D has a strong
- product focus. Check the Qt3D \l{http://doc.qt.nokia.com/qt3d-snapshot/qt3d-contrib.html}{contributions page}.
-
- Jump on the IRC channel at #qt-3d on irc.freenode.net, or join our qt3d
- mailing list at \l{http://lists.trolltech.com/mailman/listinfo/qt-3d}.
-
- All contributions need to conform with the
- \l{http://qt.gitorious.org/qt/pages/QtContributionGuidelines}{Qt Contribution Model Guidelines}.
-
- The source for QtQuick3D is hosted on Gitorious at
- \l{http://qt.gitorious.org/qt-labs/quick3d}.
-
- Bugs can be reported against the "Qt3D" component of the "Qt" project
- at \l{http://bugreports.qt.nokia.com/}.
-
-
- \l{index.html}{Return to the main QtQuick3D page}.
-*/
diff --git a/doc/src/qt3d-examples.qdoc b/doc/src/qt3d-examples.qdoc
deleted file mode 100644
index 01c8c758..00000000
--- a/doc/src/qt3d-examples.qdoc
+++ /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 QtQuick3D documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** GNU Free Documentation License
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file.
-**
-** 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$
-**
-****************************************************************************/
-
-/*!
- \page qt3d-examples.html
- \title Tutorials and Examples
- \keyword Tutorials and Examples
-
- Building 3D applications in QML with QtQuick3D:
-
- \list
- \o \l{Teapot Example in QtQuick3D}{Hello Teapot} in QtQuick3D
- \o \l{quick3d/basket#Basket in QtQuick3D}{Basket} in QtQuick3D
- \o \l{Object Effects}{Cube} in QtQuick3D
- \o \l{Monkey God in QML}{Monkey God} in QtQuick3D
- \o \l{Tea Service Demo in QML}{Tea Service} in QtQuick3D
- \o \l{Using GLSL shaders in QtQuick3D}
- \endlist
-
- Using C++ to extend QtQuick3D and to build applications with Qt3D:
-
- \list
- \o \l{Teapot Example}{Hello Teapot} - drawing a basic object in 3D.
- \o \l{Object Effects#Cube in Qt3D}{Cube in C++} - applying transformations and materials to objects.
- \o \l{qt3d/nesting}{Nesting} - drawing into framebuffer objects.
- \o \l{Loading a 3DS model with Qt3D}{Penguin} - loading a 3DS model with Qt3D.
- \o \l{qt3d/pageflip}{Page Flip} - using shaders to combine textures.
- \o \l{qt3d/shapes}{Shapes} - paints all of the basic OpenGL shapes.
- \endlist
-
- Other topics:
-
- \list
- \o \l{Scene Format Plugin}{Writing a scene format plug-in for Qt3D}
- \endlist
-
- \l{index.html}{Return to the main Qt3D page}.
-*/
-
-/*!
- \page qt-examples-placeholder.html
- \title Qt Examples
- \keyword Qt Examples
-
- Check the \l{http://doc.qt.nokia.com/4.7/all-examples.html}{Qt Examples for sample code specific to Qt itself.}
-
- For examples specific to Qt3D check our \l{qt3d-examples.html}{examples page}.
-*/
diff --git a/doc/src/qt3d-geometry.qdoc b/doc/src/qt3d-geometry.qdoc
deleted file mode 100644
index 9ab6e7c4..00000000
--- a/doc/src/qt3d-geometry.qdoc
+++ /dev/null
@@ -1,34 +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 documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** GNU Free Documentation License
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file.
-**
-** 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$
-**
-****************************************************************************/
-
-/*!
-\group qt3d::geometry
-\title Qt3D Geometry
-\keyword Qt3D Geometry
-
-\generatelist{related}
-*/
diff --git a/doc/src/qt3d-graphicsview.qdoc b/doc/src/qt3d-graphicsview.qdoc
deleted file mode 100644
index 3391ace5..00000000
--- a/doc/src/qt3d-graphicsview.qdoc
+++ /dev/null
@@ -1,34 +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 documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** GNU Free Documentation License
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file.
-**
-** 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$
-**
-****************************************************************************/
-
-/*!
- \group qt3d::graphicsview
- \title Qt3D Graphics View Integration
- \keyword Qt3D Graphics View Integration
-
- \generatelist{related}
-*/
diff --git a/doc/src/qt3d-materials.qdoc b/doc/src/qt3d-materials.qdoc
deleted file mode 100644
index 38909cfc..00000000
--- a/doc/src/qt3d-materials.qdoc
+++ /dev/null
@@ -1,34 +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 documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** GNU Free Documentation License
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file.
-**
-** 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$
-**
-****************************************************************************/
-
-/*!
-\group qt3d::materials
-\title Qt3D Materials
-\keyword Qt3D Materials
-
-\generatelist{related}
-*/
diff --git a/doc/src/qt3d-math.qdoc b/doc/src/qt3d-math.qdoc
deleted file mode 100644
index 5b663405..00000000
--- a/doc/src/qt3d-math.qdoc
+++ /dev/null
@@ -1,34 +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 documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** GNU Free Documentation License
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file.
-**
-** 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$
-**
-****************************************************************************/
-
-/*!
-\group qt3d::math
-\title Qt3D Math
-\keyword Qt3D Math
-
-\generatelist{related}
-*/
diff --git a/doc/src/qt3d-painting.qdoc b/doc/src/qt3d-painting.qdoc
deleted file mode 100644
index b94e03d5..00000000
--- a/doc/src/qt3d-painting.qdoc
+++ /dev/null
@@ -1,60 +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 documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** GNU Free Documentation License
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file.
-**
-** 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$
-**
-****************************************************************************/
-
-/*!
-\group qt3d::painting
-\title Qt3D Painting
-\keyword Qt3D Painting
-
-Porting between desktop OpenGL and embedded OpenGL/ES has traditionally
-been difficult. The usual sequence of operations for a drawing request
-in OpenGL consists of:
-
-\list
- \o Select an appropriate shader program, or fixed-function pipeline
- rendering options.
- \o Set or adjust the current projection and modelview matrices.
- \o Specify vertex, normal, texture co-ordinate, and other attribute arrays.
- \o Specify textures, variables, and other rendering objects needed
- by the shader program.
- \o Draw fragments: triangles, triangle fans, quads, etc.
- \o Disable the arrays, textures, and modes that were selected.
-\endlist
-
-Desktop OpenGL, OpenGL/ES 1.1, and OpenGL/ES 2.0 all posses functionality
-for the above, but they are all different. OpenGL/ES 2.0 in particular
-presents unique problems because it lacks a fixed-function pipeline mode
-to perform common painting operations.
-
-In Qt3D the QGLPainter class wraps OpenGL to present a consistent
-OpenGL painting API across all platforms. Shaders and fixed-function
-options are supplied as an instance of QGLAbstractEffect. Several
-built-in standard effects are provided for drawing with flat colors,
-material-based lighting, and simple texturing.
-
-\generatelist{related}
-*/
diff --git a/doc/src/qt3d-qml3d.qdoc b/doc/src/qt3d-qml3d.qdoc
deleted file mode 100644
index e6a7c812..00000000
--- a/doc/src/qt3d-qml3d.qdoc
+++ /dev/null
@@ -1,55 +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 documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** GNU Free Documentation License
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file.
-**
-** 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$
-**
-****************************************************************************/
-
-/*!
-\group qt3d::qml3d
-\title QtQuick3D for Scripting 3D Apps in QML
-\keyword QtQuick3D QML
-
-The following QML elements are provided by the \c{Qt3D} namespace
-for importing 3D elements into QML applications:
-
-\generatelist{related}
-
-See the \l{Teapot Example in QtQuick3D}{Teapot} example for an introduction
-to using these elements.
-
-QtQuick3D also provides some \l{Stock Shapes for QtQuick3D}{stock shapes}
-in the \c{Qt3D.Shapes} namespace as convenience elements.
-*/
-
-/*!
-\group qt3d::qml3d::shapes
-\title Stock Shapes for QtQuick3D
-
-The following QML elements are provided by the \c{Qt3D.Shapes} namespace
-as convenience elements:
-
-\generatelist{related}
-
-See the \l{Object Effects}{Cube} example for an introduction to using these convenience shapes in QML.
-*/
diff --git a/doc/src/qt3d-scene.qdoc b/doc/src/qt3d-scene.qdoc
deleted file mode 100644
index c7b137b3..00000000
--- a/doc/src/qt3d-scene.qdoc
+++ /dev/null
@@ -1,34 +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 documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** GNU Free Documentation License
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file.
-**
-** 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$
-**
-****************************************************************************/
-
-/*!
-\group qt3d::scene
-\title Qt3D Scene Management
-\keyword Qt3D Scene Management
-
-\generatelist{related}
-*/
diff --git a/doc/src/qt3d-textures.qdoc b/doc/src/qt3d-textures.qdoc
deleted file mode 100644
index fefa5946..00000000
--- a/doc/src/qt3d-textures.qdoc
+++ /dev/null
@@ -1,34 +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 documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** GNU Free Documentation License
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file.
-**
-** 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$
-**
-****************************************************************************/
-
-/*!
- \group qt3d::textures
- \title Qt3D Texture Handling
- \keyword Qt3D Texture Handling
-
- \generatelist{related}
-*/
diff --git a/doc/src/qt3d-troubleshooting.qdoc b/doc/src/qt3d-troubleshooting.qdoc
deleted file mode 100644
index 9fc2cb22..00000000
--- a/doc/src/qt3d-troubleshooting.qdoc
+++ /dev/null
@@ -1,295 +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 documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** GNU Free Documentation License
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file.
-**
-** 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$
-**
-****************************************************************************/
-
-/*!
- \page qt3d-troubleshooting.html
- \title QtQuick3D Troubleshooting Guide
- \keyword Building QML QtQuick3D
-
- Quick3D has been developed with the intention of supporting a variety
- of platforms and systems, and in doing so leverages the plugin and
- import architecture used by Qt.
-
- This architecture occasionally causes confusion for newcomers to
- the Qt plugin architecture, however, which can cause runtime problems to
- occasionally arise.
-
- \section1 Common Quick3D Problems
-
- \section2 PROBLEM 1: I Can't See Warnings from my QML/3D Application
-
- Many problems with QML (both 2D and 3D) can only be diagnosed through
- warning and status messages.
-
- In the QMLViewer application these can be viewed by selecting the "Show
- Warnings" item in the "Debugging" menu.
-
- For QML applications which do not use the QMLViewer, however, no such
- option exists.
-
- For Linux & Mac:
- \list
- \o Run the application within QtCreator - the warning messages will be
- visible in the Application Output pane.
- \o Run the application from the command line - the warning messages
- will now be displayed directly in the terminal window.
- \endlist
-
- For Windows
- \list
- \o Run the application within QtCreator - the warning messages will be
- visible in the Application Output pane.
- \o Run the application from within Visual Studio - the warning messages
- will be visible in the Output window.
- \o Use an application such as Windows Sysinternals' "DebugView.exe" to
- capture warning and error messages from your QML application.
- \endlist
-
- \section2 PROBLEM 2: Qt3D Plugin File Not Found
-
- By far the most prevalant problems encountered by Quick3D newcomers are
- those relating to inability for an application to find the correct plugins
- at runtime.
-
- This problem is characterised by a blank screen being displayed, and the
- following warning message:
-
- \code
- file:///C:/path/to/qml/app/my_app.qml:42:1: module "Qt3D" plugin "qthreedqmlplugin" not found
- import Qt3D 1.0
-
- ^
- \endcode
-
- To resolve this problem try each of the Resolution Actions listed, one at
- a time, retrying your application after each step.
-
- \section2 PROBLEM 3: Qt3D Not Installed
-
- This is related to the Problem 2, though is characterised by error messages
- containing the following:
-
- \code
- module "Qt3D" is not installed
- \endcode
-
- To resolve this problem try each of the Resolution Actions listed, one at
- a time, retrying your application after each step.
-
- \section2 PROBLEM 4: The Specified Module Could Not Be Found
-
- This is related to Problem 2, though in this case it is characterised by error
- messages similar to the following:
-
- \code
- file:///path/to/quick3d/app.qml:10:1: plugin cannot be loaded for module "Qt3D": Cannot load library C:/path/to/Qt/imports/qthreedqmlplugin.dll: The specified module could not be found.
- \endcode
-
- To resolve this problem try each of the Resolution Actions listed, one at
- a time, retrying your application after each step.
-
- \section2 PROBLEM 5: 3D Models Fail to Load
-
- Usually this problem will be accompanied by a message similar to this one:
-
- \code
- Could not create handler for format - check plugins are installed correctly in /path/to/Qt/plugins
- Could not load file:///path/to/model/my_model.obj (possibly plugin could not be found)
- \endcode
-
- In this case the problem is that the plugins for various scene formats are
- missing.
-
- Follow the instructions in Resolution Action 4 onward.
-
- \section2 PROBLEM 6: Build Keys Do Not Match
-
- Sometimes users may encounter an error similar to the one shown below:
-
- \code
- plugin: my_plugin.dll: failed to load: The plugin 'C:/path/to/qt/plugins/my_plugin.dll' uses incompatible Qt library. Expected build key "Windows mingw debug full-config", got "Windows mingw release full-config"
- \endcode
-
- This error is caused by a mismatch between the Qt library against which the plugin
- was compiled, and the Qt library being used at runtime.
-
- To resolve this problem follow Resolution Action 5 onward, below.
-
- \section2 PROBLEM 7: Case mis-match on loading QML plugins
-
- You get a blank screen when the Qt Quick 3D application runs. The debug output
- (see Problem 1 above) reveals a message similar to
- \code
- Starting C:\Qt\4.7.3\bin\qmlviewer.exe -I C:/Qt/4.7.3/imports C:/Qt/4.7.3/quick3d/bin/resources/examples/basket_qml/qml/basket.qml
- C:/Qt/4.7.3/quick3d/bin/resources/examples/basket_qml/qml/basket.qml: File name case mismatch
- \endcode
-
- This issue can occur when a custom install directory for Qt is used, which does not
- match the expected directory used by the Qt3D binary installer, but still installs
- without apparent error due to Windows tolerance for case error.
-
- For example you install Qt applications into \bold{C:\\qt} such as Qt Creator
- but then when you install Qt 4.7.3 you accept the default install location
- of "C:\\Qt" - this succeeds, even though the case preserved name of the
- directory is "C:\\qt". When Qt Declarative's case checking code parses the
- import statement it refuses to load the qml file.
-
- This error is very difficult to diagnose and the best way to fix it is to
- uninstall everything from the directory in question, using the package uninstallers
- in the start menu, then remove the directory itself, the finally reinstall everything.
-
- \section1 Resolution Actions
-
- \section2 ACTION 1: Ensure that Quick3D is Building Correctly
-
- As obvious as this sounds, it is sometimes the case that a problem is
- caused simply by one of the runtime libraries or plugins for Quick3D
- failing to build, even while the user's application itself builds without
- error.
-
- Ensure that all of the components of Quick3D have built without error
- before attempting further resolution actions.
-
- \section2 ACTION 2: Ensure Import Files Are Correctly Located
-
- Ensure that the Quick3D import libraries are in the directory specified by
- the QtQuick import path.
-
- The core Quick3D import directory is: \c{imports\Qt3D} in the directory
- where Qt is installed.
-
- This directory should contain the files as shown in the following diagram:
-
- \image imports-dir.png
-
- Here for the sake of illustration it is assumed Qt 4.7.3 is intalled under
- \c{C:\Qt\4.7.3}.
-
- If these files are not in the correct locations copy them manually into the
- specified locations and retry your Quick3D application before moving on to
- other fixes. The dll's should have been built as part of your build process
- and the other files are shipped in the source tree, and can be simply copied
- over if somehow the build process has failed to do this.
-
- \section2 ACTION 3: Ensure Qt3D Libraries Are Correctly Located
-
- Ensure that the Quick3D libraries can be found by the application. The
- files that should be found are:
-
- \list
- \o Qt3D.dll
- \o Qt3DQuick.dll
- \endlist
-
- There are three ways to make these files available to your application:
-
- \list
- \o 1. Copy these files into the same directory as your application executable.
- \o 2. Add the current location of these files to your PATH environment variable.
- \o 3. Copy these files into the Qt binaries directory.
- \endlist
-
- The Qt binaries directory is:
- \code
- \path\to\qt\bin
- \endcode
-
- Having executed one of these fixes, retry your application before trying any
- other troubleshooting tips.
-
- \section2 ACTION 4: Ensure Additional Plugin Libraries Are Correctly Located
-
- Ensure that the Quick3D plugin libraries are in the directory specified by
- the QtQuick plugins path.
-
- The Quick3D scene format plugins (which are responsible for loading model files)
- should be found in:
-
- \code
- \path\to\qt\plugins\sceneformats
- \endcode
-
- This should contain the following files:
-
- \list
- \o qsceneai4.dll
- \o qscenebezier4.dll
- \endlist
-
- Additional Quick3D image format plugins (which are responsible for loading some
- image files) should be found in:
-
- \code
- \path\to\qt\plugins\imageformats
- \endcode
-
- This should contain the following files:
-
- \list
- \o qtga4.dll
- \endlist
-
- If these files are not in the correct locations copy them manually into the
- specified locations and retry your Quick3D application before moving on to
- other fixes.
-
- \section2 ACTION 5: Check Your Build Configuration
-
- It is possible that Quick3D libraries which have been built against a given
- set of Qt libraries have problems when used with another build of Qt.
-
- This may be resolved by trying each of the following:
-
- \list
- \o Ensure that the Qt and Quick3D libraries use the same toolchain/compiler.
- \o Ensure that the Qt Configuration used to build Quick3D matches that used in
- your runtime Qt libraries.
- \o Ensure that the Qt used to build Quick3D and the Qt runtimes are both either
- Debug or Release, not a mixture of both.
- \endlist
-
- After making this change, retry your Quick3D application before implementing
- other troubleshooting tips.
-
- \section2 ACTION 6: Clear the Plugin Cache
-
- Qt stores certain information about plugins in the plugin cache. The plugin
- cache is stored through QSettings, and so is platform independent.
-
- It is possible that obselete plugin data for an older version of your Qt3D
- plugins could be causing your Quick3D applications to fail.
-
- On Windows the entries in the plugin cache are stored in the registry, and
- typically begin with one of the following strings:
-
- \code
- HKEY_CURRENT_USER\Software\Trolltech\OrganizationDefaults\Qt Plugin Cache 4.2.debug
- HKEY_CURRENT_USER\Software\Trolltech\OrganizationDefaults\Qt Plugin Cache 4.2.false
- \endcode
-
- Delete these entries and retry your Quick3D application.
-*/
diff --git a/doc/src/qt3d-viewing.qdoc b/doc/src/qt3d-viewing.qdoc
deleted file mode 100644
index c682c363..00000000
--- a/doc/src/qt3d-viewing.qdoc
+++ /dev/null
@@ -1,34 +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 documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** GNU Free Documentation License
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file.
-**
-** 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$
-**
-****************************************************************************/
-
-/*!
-\group qt3d::viewing
-\title Qt3D Viewing
-\keyword Qt3D Viewing
-
-\generatelist{related}
-*/
diff --git a/doc/src/style/OfflineStyle.css b/doc/src/style/OfflineStyle.css
deleted file mode 100644
index 2fb357ce..00000000
--- a/doc/src/style/OfflineStyle.css
+++ /dev/null
@@ -1,251 +0,0 @@
-@media screen
-{
-
- .wrapper
- {
- top:50px;
- background: none;
-
- }
- .wrapper .bd
- {
- background: none;
- position: relative;
- }
-
-
-
-
- body.offline
- {
- background-image: none;
- background-color: #FFFFFF;
-
- }
-
- .offline .footer {
- margin: 0;
- }
- .offline .header
- {
- width: 100%;
- margin: 0;
- height: auto;
- background-color: #ffffff;
- padding: 10px 0 5px 0;
- overflow: visible;
- border-bottom: solid #E5E5E5 1px;
- z-index:1;
- position:fixed;
- }
-
- .offline .header .content
- {
- }
- .offline .header .qtref
- {
- color: #00732F;
- position: static;
- float: left;
- margin-left: 5px;
- font: bold 18px/1 Arial;
- }
-
- .offline .header .qtref:visited
- {
- color: #00732F;
- }
- .offline .header .qtref:hover
- {
- color: #00732F;
- text-decoration:none;
- }
- .offline .header .qtref span
- {
- background-image: none;
- text-indent: 0;
- text-decoration:none;
- }
-
- .offline .wrap
- {
- margin: 0 5px 0 5px;
- }
-
- .offline .wrap .toolbar
- {
- display:block;
- padding-top:5px;
- }
-
- .offline .wrap .breadcrumb ul li {
- font-weight: normal;
- }
-
- .offline .wrap .breadcrumb ul li a {
- /*color: #44a51c;*/
- }
-
- .offline .wrap .breadcrumb ul li.last a {
- /*color: #363534;*/
- }
-
-
-
- .narrow .indexboxcont .section {
- width: 64%;
- padding-left: 0;
- }
-
- .narrow .indexboxcont .sectionlist {
- width: 32.5%;
- }
-
- .header .icon,
- .sidebar,
- .feedback,
- .t_button,
- .feedback,
- #feedbackBox,
- #feedback,
- #blurpage,
- .indexbox .indexIcon span,
- .wrapper .hd,
- .offline .indexbox .indexIcon,
- .offline .header #nav-logo,
- #offlinemenu,
- #offlinesearch,
- .offline .header #nav-topright,
- .offline .header #shortCut ,
- .offline .wrapper .hd,
- .offline .wrapper .ft,
- .offline .sidebar,
- .offline .wrap .feedback
- {
- display:none;
- }
-
- /* end offline mode */
-#narrowmenu {
- display: none;
- float: right;
- margin: 15px 40px 0 0;
- font-size: 11px;
- }
-
- .narrow #narrowmenu {
- display: block;
- }
-
- #narrowsearch{
- display:none;
- }
-
- #narrowmenu ul
- {
- border-bottom:solid 1px #E5E5E5;
- border-left:solid 1px #E5E5E5;
- border-right:solid 1px #E5E5E5;
- }
-
- #narrowmenu a {
- line-height: 1.1;
- background: url(../images/arrow_down.png) no-repeat 100% 50%;
- white-space: nowrap;
- padding: 0 16px 0 5px;
- }
-
- #narrowmenu li {
- margin-left: 20px;
- }
-
- #narrowmenu li li {
- margin: 0 0 5px 0;
- }
-
- #narrowmenu li li a {
- padding: 0;
- background-image: none;
- }
-
- #narrowmenu li,
- #narrowmenu li ul {
- background-color: #fff;
- }
-
- #narrowmenu li ul {
- width: auto;
- padding: 5px;
- margin-top:-15px;
- }
-
- .sf-menu li:hover ul, .sf-menu li.sfHover ul {
- top: 1.2em;
- }
-.sf-menu, .sf-menu * {
- margin: 0;
- padding: 0;
- list-style: none;
-}
-.sf-menu {
- line-height: 1.0;
-}
-.sf-menu ul {
- position: absolute;
- top: -999em;
- width: 10em; /* left offset of submenus need to match (see below) */
-}
-.sf-menu ul li {
- width: 100%;
-}
-.sf-menu li:hover {
- visibility: inherit; /* fixes IE7 'sticky bug' */
-}
-.sf-menu li {
- float: left;
- position: relative;
-}
-.sf-menu a {
- display: block;
- position: relative;
-}
-.sf-menu li:hover ul,
-.sf-menu li.sfHover ul {
- left: 0;
- top: 2.5em; /* match top ul list item height */
- z-index: 99;
-}
-ul.sf-menu li:hover li ul,
-ul.sf-menu li.sfHover li ul {
- top: -999em;
-}
-ul.sf-menu li li:hover ul,
-ul.sf-menu li li.sfHover ul {
- left: 10em; /* match ul width */
- top: 0;
-}
-ul.sf-menu li li:hover li ul,
-ul.sf-menu li li.sfHover li ul {
- top: -999em;
-}
-ul.sf-menu li li li:hover ul,
-ul.sf-menu li li li.sfHover ul {
- left: 10em; /* match ul width */
- top: 0;
-}
- .wrap .content ol li {
- background:none;
- font:400 10pt/1 Verdana;
- margin-bottom:10px;
- margin-left:12px;
- }
- .wrap .content ol li {
- list-style-type:decimal;
-
- }
-
-
-
-}
-/* end of screen media */
-
diff --git a/doc/src/style/narrow.css b/doc/src/style/narrow.css
deleted file mode 100644
index 7544c4ae..00000000
--- a/doc/src/style/narrow.css
+++ /dev/null
@@ -1,250 +0,0 @@
- /* start narrow mode */
-
- body.narrow
- {
- background-image: none;
- }
-
- .narrow a {
- color: #44a51c;
- }
-
- .narrow .header, .narrow .header .content, .narrow .footer, .narrow .wrapper {
- margin: 0 7px;
- min-width: 300px;
- }
-
- .narrow .footer {
- margin: 0;
- }
- .narrow .header
- {
- width: 100%;
- margin: 0;
- height: auto;
- background: #fff url(../images/header_bg.png) repeat-x 0 100%;
- padding: 10px 0 5px 0;
- overflow: visible;
- }
-
- .narrow .header .content
- {
- }
-
- .narrow .header #nav-logo
- {
- display: none;
- }
-
- .narrow .header .qtref
- {
- width: auto;
- height: auto;
- color: #363534;
- position: static;
- float: left;
- margin-left: 25px;
- font: bold 18px/1 Arial;
- }
-
- .narrow .header .qtref a
- {
- color: #363534;
- }
-
- .narrow .header .qtref span
- {
- background-image: none;
- text-indent: 0;
- }
-
- .narrow .header #nav-topright
- {
- display: none;
- }
-
- .narrow .header #shortCut
- {
- clear: both;
- font-weight: normal;
- position: static;
- float: left;
- margin: 15px 0 0 25px;
- overflow: hidden;
- padding: 0;
- height: auto;
- }
-
- .narrow .header #shortCut ul
- {
- float: none;
- margin: 0;
- width: auto;
- font-size: 11px;
- }
-
- .narrow .header #shortCut ul li
- {
- background-image: none;
- }
-
- .narrow .header #shortCut ul .shortCut-topleft-active,
- .narrow .header #shortCut ul .shortCut-topleft-inactive
- {
- background-image: none;
- height: auto;
- padding: 0;
- width: auto;
- }
- .narrow .header #shortCut ul li a
- {
- color: #44a51c;
- }
-
- .narrow .wrapper .hd
- {
- background: url(../images/bg_ul_blank.png) no-repeat 0 0;
- }
-
- .narrow .wrapper .bd
- {
- background: url(../images/bg_l_blank.png) repeat-y 0 0;
- }
-
- .narrow .wrapper .ft
- {
- background: url(../images/bg_ll_blank.png) no-repeat 0 0;
- }
-
- .narrow .sidebar
- {
- display: none;
- }
-
- .narrow .wrap
- {
- margin: 0 5px 0 5px;
- }
-
- .narrow .wrap .toolbar
- {
- border-bottom: none;
- }
-
- .narrow .wrap .content
- {
- padding-top: 15px;
- }
-
- .narrow .wrap .feedback
- {
- display: none;
- }
-
- .narrow .wrap .breadcrumb ul li {
- font-weight: normal;
- }
-
- .narrow .wrap .breadcrumb ul li a {
- color: #44a51c;
- }
-
- .narrow .wrap .breadcrumb ul li.last a {
- color: #363534;
- }
-
- #narrowsearch {
- display: none;
- }
-
- .narrow #narrowsearch {
- display: block;
- float: right;
- margin-right: 25px;
- _position: relative;
- }
-
- .narrow #narrowsearch fieldset {
- _position: absolute;
- _margin-top: -1px;
- }
-
- .narrow #narrowsearch {
- background: url("http://doc.qt.nokia.com/prototype/html/images/sprites-combined.png") no-repeat scroll -6px -348px transparent;
- height: 21px;
- padding: 2px 0 0 5px;
- width: 167px;
- }
-
- .narrow #narrowsearch input {
- border: none;
- font: 13px/1.2 Verdana;
- height: 19px;
- outline: none;
- padding: 0;
- width: 158px;
- *border: 1px solid #fff;
- *height: 17px;
- _height: 18px;
- }
-
- .narrow .indexbox .indexIcon {
- display: none;
- }
-
- .narrow .indexboxcont .section {
- width: 64%;
- padding-left: 0;
- }
-
- .narrow .indexboxcont .sectionlist {
- width: 32.5%;
- }
-
- #narrowmenu {
- display: none;
- float: right;
- margin: 15px 40px 0 0;
- font-size: 11px;
- }
-
- .narrow #narrowmenu {
- display: block;
- }
-
- #narrowmenu a {
- line-height: 1.1;
- background: url(../images/arrow_down.png) no-repeat 100% 50%;
- white-space: nowrap;
- padding: 0 16px 0 5px;
- }
-
- #narrowmenu li {
- margin-left: 20px;
- }
-
- #narrowmenu li li {
- margin: 0 0 5px 0;
- }
-
- #narrowmenu li li a {
- padding: 0;
- background-image: none;
- }
-
- #narrowmenu li,
- #narrowmenu li ul {
- background-color: #fff;
- margin-top:-1px;
- }
-
- #narrowmenu li ul {
- width: auto;
- padding: 5px;
- }
-
- .sf-menu li:hover ul, .sf-menu li.sfHover ul {
- top: 1.2em;
- }
-
- /* end narrow mode */
diff --git a/doc/src/style/style.css b/doc/src/style/style.css
deleted file mode 100644
index f520e6ad..00000000
--- a/doc/src/style/style.css
+++ /dev/null
@@ -1,1567 +0,0 @@
-@media screen
-{
-
-/* basic elements */
- html
- {
- color: #000000;
- background: #FFFFFF;
- }
- body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, code, form, fieldset, legend, input, button, textarea, p, blockquote, th, td
- {
- margin: 0;
- padding: 0;
- }
- table
- {
- border-collapse: collapse;
- border-spacing: 0;
- }
- fieldset, img
- {
- border: 0;
- max-width:100%;
- }
- address, caption, cite, code, dfn, em, strong, th, var, optgroup
- {
- font-style: inherit;
- font-weight: inherit;
- }
- del, ins
- {
- text-decoration: none;
- }
- li
- {
- list-style: none;
- }
- caption, th
- {
- text-align: left;
- }
- h1, h2, h3, h4, h5, h6
- {
- font-size: 100%;
- }
- q:before, q:after
- {
- content: '';
- }
- abbr, acronym
- {
- border: 0;
- font-variant: normal;
- }
- sup, sub
- {
- vertical-align: baseline;
- }
- tt, .qmlreadonly span, .qmldefault span
- {
- word-spacing:5px;
- }
- legend
- {
- color: #000000;
- }
- input, button, textarea, select, optgroup, option
- {
- font-family: inherit;
- font-size: inherit;
- font-style: inherit;
- font-weight: inherit;
- }
- input, button, textarea, select
- {
- font-size: 100%;
- }
- strong
- {
- font-weight: bold;
- }
- em
- {
- font-style: italic;
- }
-
- /* adding Qt theme */
- html
- {
- /* background-color: #e5e5e5;*/
- }
- body
- {
- background: #e6e7e8 url(../images/page_bg.png) repeat-x 0 0;
- font: normal 13px/1.2 Verdana;
- color: #363534;
- }
- a
- {
- color: #00732f;
- text-decoration: none;
- }
- hr
- {
- background-color: #E6E6E6;
- border: 1px solid #E6E6E6;
- height: 1px;
- width: 100%;
- text-align: left;
- margin: 15px 0px 15px 0px;
- }
-
- pre
- {
- border: 1px solid #DDDDDD;
- -moz-border-radius: 7px 7px 7px 7px;
- margin: 0 20px 10px 10px;
- padding: 20px 15px 20px 20px;
- overflow-x: auto;
- }
- table, pre
- {
- -moz-border-radius: 7px 7px 7px 7px;
- background-color: #F6F6F6;
- border: 1px solid #E6E6E6;
- border-collapse: separate;
- font-size: 11px;
- margin-bottom: 25px;
- }
- pre.highlightedCode {
- display: block;
- overflow:hidden;
- }
- thead
- {
- margin-top: 5px;
- font:600 12px/1.2 Arial;
- }
- th
- {
- padding: 5px 15px 5px 15px;
- background-color: #E1E1E1;
- border-left: 1px solid #E6E6E6;
- }
- td
- {
- padding: 3px 15px 3px 20px;
- }
- tr.odd td:hover, tr.even td:hover {}
-
- td.rightAlign
- {
- padding: 3px 5px 3px 10px;
- }
- table tr.odd
- {
- border-left: 1px solid #E6E6E6;
- background-color: #F6F6F6;
- color: #66666E;
- }
- table tr.even
- {
- border-left: 1px solid #E6E6E6;
- background-color: #ffffff;
- color: #66666E;
- }
- table tr.odd td:hover, table tr.even td:hover
- {
- /* background-color: #E6E6E6;*/ /* disabled until further notice */
- }
-
- span.comment
- {
- color: #8B0000;
- font-style: italic;
- }
- span.string, span.char
- {
- color: #254117;
- }
-
-
-/* end basic elements */
-
-/* font style elements */
- .heading
- {
- font: normal bold 16px/1.0 Arial;
- padding-bottom: 15px;
- }
- .subtitle
- {
- font-size: 13px;
- }
- .small-subtitle
- {
- font-size: 13px;
- }
-/* end font style elements */
-
-/* global settings*/
- .header, .footer, .wrapper
- {
- min-width: 600px;
- max-width: 1500px;
- margin: 0 30px;
- }
- .header, .footer
- {
- display: block;
- clear: both;
- overflow: hidden;
- }
- .header:after, .footer:after, .breadcrumb:after, .wrap .content:after, .group:after
- {
- content: ".";
- display: block;
- height: 0;
- clear: both;
- visibility: hidden;
- }
-
-/* end global settings*/
-/* header elements */
- .header
- {
- height: 115px;
- position: relative;
- }
- .header .icon
- {
- position: absolute;
- top: 13px;
- left: 0;
- }
- .header .qtref
- {
- position: absolute;
- top: 28px;
- left: 88px;
- width: 302px;
- height: 22px;
- }
- .header .qtref span
- {
- display: block;
- width: 302px;
- height: 22px;
- text-indent: -999em;
- background: url(../images/sprites-combined.png) no-repeat -78px -235px;
- }
- .content a:visited
- {
- color: #4c0033;
- text-decoration: none;
- }
- .content a:visited:hover
- {
- color: #4c0033;
- text-decoration: underline;
- }
-
- #nav-topright
- {
- height: 70px;
- }
-
- #nav-topright ul
- {
- list-style-type: none;
- float: right;
- width: 370px;
- margin-top: 11px;
- }
-
- #nav-topright li
- {
- display: inline-block;
- margin-right: 20px;
- float: left;
- }
-
- #nav-topright li.nav-topright-last
- {
- margin-right: 0;
- }
-
- #nav-topright li a
- {
- background: transparent url(../images/sprites-combined.png) no-repeat;
- height: 18px;
- display: block;
- overflow: hidden;
- text-indent: -9999px;
- }
-
- #nav-topright li.nav-topright-home a
- {
- width: 65px;
- background-position: -2px -91px;
- }
-
- #nav-topright li.nav-topright-home a:hover
- {
- background-position: -2px -117px;
- }
-
-
- #nav-topright li.nav-topright-dev a
- {
- width: 30px;
- background-position: -76px -91px;
- }
-
- #nav-topright li.nav-topright-dev a:hover
- {
- background-position: -76px -117px;
- }
-
-
- #nav-topright li.nav-topright-labs a
- {
- width: 40px;
- background-position: -114px -91px;
- }
-
- #nav-topright li.nav-topright-labs a:hover
- {
- background-position: -114px -117px;
- }
-
- #nav-topright li.nav-topright-doc a
- {
- width: 32px;
- background-position: -162px -91px;
- }
-
- #nav-topright li.nav-topright-doc a:hover, #nav-topright li.nav-topright-doc-active a
- {
- background-position: -162px -117px;
- }
-
- #nav-topright li.nav-topright-blog a
- {
- width: 40px;
- background-position: -203px -91px;
- }
-
- #nav-topright li.nav-topright-blog a:hover, #nav-topright li.nav-topright-blog-active a
- {
- background-position: -203px -117px;
- }
-
- #nav-topright li.nav-topright-shop a
- {
- width: 40px;
- background-position: -252px -91px;
- }
-
- #nav-topright li.nav-topright-shop a:hover, #nav-topright li.nav-topright-shop-active a
- {
- background-position: -252px -117px;
- }
-
- #nav-logo
- {
- background: transparent url(../images/sprites-combined.png ) no-repeat 0 -225px;
- left: -3px;
- position: absolute;
- width: 75px;
- height: 75px;
- top: 13px;
- }
- #nav-logo a
- {
- width: 75px;
- height: 75px;
- display: block;
- text-indent: -9999px;
- overflow: hidden;
- }
-
-
- .shortCut-topleft-inactive
- {
- padding-left: 3px;
- background: transparent url( ../images/sprites-combined.png) no-repeat 0px -58px;
- height: 20px;
- width: 47px;
- }
- .shortCut-topleft-inactive span
- {
- font-variant: normal;
- }
- .shortCut-topleft-inactive span a:hover, .shortCut-topleft-active a:hover
- {
- text-decoration:none;
- }
- #shortCut
- {
- padding-top: 10px;
- font-weight: bolder;
- color: #b0adab;
- }
- #shortCut ul
- {
- list-style-type: none;
- float: left;
- width: 347px;
- margin-left: 100px;
- }
- #shortCut li
- {
- display: inline-block;
- margin-right: 25px;
- float: left;
- white-space: nowrap;
- }
- #shortCut li a
- {
- color: #b0adab;
- }
- #shortCut li a:hover
- {
- color: #44a51c;
- }
-
-
-
-/* end header elements */
-/* content and sidebar elements */
- .wrapper
- {
- background: url(../images/bg_r.png) repeat-y 100% 0;
- }
- .wrapper .hd
- {
- padding-left: 216px;
- height: 15px;
- background: url(../images/page.png) no-repeat 0 0;
- overflow: hidden;
- }
-
-
-
-
- .wrapper .hd span
- {
- height: 15px;
- display: block;
- overflow: hidden;
- background: url(../images/page.png) no-repeat 100% -30px;
- }
- .wrapper .bd
- {
- background: url(../images/bg_l.png) repeat-y 0 0;
- position: relative;
- }
-
-
-
-
- .wrapper .ft
- {
- padding-left: 216px;
- height: 15px;
- background: url(../images/page.png) no-repeat 0 -75px;
- overflow: hidden;
- }
-
-
-
-
- .wrapper .ft span
- {
- height: 15px;
- display: block;
- background: url(../images/page.png) no-repeat 100% -60px;
- overflow: hidden;
- }
- .navTop{
- float:right;
- display:block;
- padding-right:15px;
-
-
- }
-
-
-
-/* end content and sidebar elements */
-/* sidebar elements */
- .sidebar
- {
- float: left;
- margin-left: 5px;
- width: 200px;
- font-size: 11px;
- }
-
-
-
-
-
-
- .sidebar .searchlabel
- {
- padding: 0 0 2px 17px;
- font: normal bold 11px/1.2 Verdana;
- }
-
- .sidebar .search
- {
- padding: 0 15px 0 16px;
- }
-
- .sidebar .search form
- {
- background: url(../images/sprites-combined.png) no-repeat -6px -348px;
- height:21px;
- padding:2px 0 0 5px;
- width:167px;
- }
-
- .sidebar .search form input#pageType
- {
- width: 158px;
- height: 19px;
- padding: 0;
- border: 0px;
- outline: none;
- font: 13px/1.2 Verdana;
- }
-
- .sidebar .box
- {
- padding: 17px 15px 5px 16px;
- }
-
- .sidebar .box .first
- {
- background-image: none;
- }
-
- .sidebar .box h2
- {
- font: bold 16px/1.2 Arial;
- padding: 0;
- }
- .sidebar .box h2 span
- {
- overflow: hidden;
- display: inline-block;
- }
- .sidebar .box#lookup h2
- {
- background-image: none;
- }
- .sidebar #lookup.box h2 span
- {
- }
- .sidebar .box#topics h2
- {
- background-image: none;
- }
- .sidebar #topics.box h2 span
- {
- }
- .sidebar .box#examples h2
- {
- background-image: none;
- }
- .sidebar #examples.box h2 span
- {
- }
-
- .sidebar .box .list
- {
- display: block;
- max-height:200px;
- min-height:120px;
- overflow-y:auto;
- overflow-x:none;
- }
- .list li a:hover
- {
- text-decoration: underline;
- }
- .sidebar .box ul
- {
- padding-bottom:5px;
- padding-left:10px;
- padding-top:5px;
- }
- .sidebar .box ul li
- {
- padding-left: 12px;
- background: url(../images/bullet_gt.png) no-repeat 0 5px;
- margin-bottom: 5px;
- }
- .sidebar .bottombar
- {
- background: url(../images/box_bg.png) repeat-x 0 bottom;
- }
- .sidebar .box ul li.noMatch
- {
- background: none;
- color:#FF2A00;
- font-style:italic;
- }
- .sidebar .box ul li.hit
- {
- background: none;
- color:#AAD2F0;
- font-style:italic;
- }
- .sidebar .search form input.loading
- {
- background:url("../images/spinner.gif") no-repeat scroll right center transparent;
- }
-
-.floatingResult{
- z-index:1;
- position:relative;
- padding-top:0px;
- background-color:white;
- border:solid 1px black;
- height:250px;
- width:600px;
- overflow-x:hidden;
- overflow-y:auto;
-}
-
- .floatingResult:hover{
- display:block;
- }
- .floatingResult:hover{
- }
-
-/* end sidebar elements */
-/* content elements */
- .wrap
- {
- margin: 0 5px 0 208px;
- overflow: visible;
- }
-
-
-
-
- .wrap .toolbar
- {
- background-color: #fafafa;
- border-bottom: 1px solid #d1d1d1;
- height: 20px;
- position: relative;
- }
- .wrap .toolbar .toolblock
- {
- position: absolute;
- }
- .wrap .toolbar .breadcrumb
- {
- font-size: 11px;
- line-height: 1;
- padding: 0 0 10px 21px;
- height: 10px;
- }
- .wrap .toolbar .toolbuttons
- {
- padding: 0 0 10px 21px;
- right: 5px;
- vertical-align: middle;
- overflow: hidden;
- }
- .wrap .toolbar .toolbuttons .active
- {
- color: #00732F;
- }
- .wrap .toolbar .toolbuttons ul
- {
- float: right;
- }
- .wrap .toolbar .toolbuttons li
- {
- float: left;
- text-indent: -10px;
- margin-top: -5px;
- margin-right: 15px;
- font-weight: bold;
- color: #B0ADAB;
- }
-
- .toolbuttons #print
- {
- border-left: 1px solid #c5c4c4;
- margin-top: 0;
- padding-left: 7px;
- text-indent: 0;
- }
- .toolbuttons #print a
- {
- width: 16px;
- height: 16px;
- }
-
- .toolbuttons #print a span
- {
- width: 16px;
- height: 16px;
- text-indent: -999em;
- display: block;
- overflow: hidden;
- background: url(../images/sprites-combined.png) no-repeat -137px -311px;
- }
-
- .toolbuttons #smallA
- {
- font-size: 10pt;
- }
- .toolbuttons #medA
- {
- font-size: 12pt;
- }
- .toolbuttons #bigA
- {
- font-size: 14pt;
- margin-right: 7px;
- }
-
- #smallA:hover, #medA:hover, #bigA:hover
- {
- color: #00732F;
- }
-
-
- .wrap .content
- {
- padding: 30px;
- word-wrap:break-word;
- }
-
- .wrap .breadcrumb ul
- {
- }
- .wrap .breadcrumb ul li
- {
- float: left;
- background: url(../images/breadcrumb.png) no-repeat 0 3px;
- padding-left: 15px;
- margin-left: 15px;
- font-weight: bold;
- }
- .wrap .breadcrumb ul li.last
- {
- font-weight: normal;
- }
- .wrap .breadcrumb ul li a
- {
- color: #363534;
- }
- .wrap .breadcrumb ul li.first
- {
- background-image: none;
- padding-left: 0;
- margin-left: 0;
- }
-
-
-
-
- .wrap .content ol li {
- background:none;
- font:normal 10pt/1 Verdana;
-
- margin-bottom:10px;
- margin-left:12px;
- /*list-style-type:disc;*/
- }
-
- .wrap .content li
- {
- background: url(../images/bullet_sq.png) no-repeat 0 5px;
- font: normal 400 10pt/1 Verdana;
- margin-bottom: 10px;
- padding-left:12px;
- }
-
-
-
-
-
-
-
-
-
- .content li:hover {}
-
- .wrap .content h1
- {
- font: bold 18px/1.2 Arial;
- }
- .wrap .content h2
- {
- border-bottom:1px solid #DDDDDD;
- font:600 16px/1.2 Arial;
- margin-top:15px;
- width:100%;
- }
- .wrap .content h3
- {
- font: bold 14px/1.2 Arial;
- font:600 16px/1.2 Arial;
- margin-top:15px;
- width:100%;
- }
- .wrap .content p
- {
- line-height: 20px;
- padding: 5px;
- }
- .wrap .content table p
- {
- line-height: 20px;
- padding: 0px;
- }
- .wrap .content ul
- {
- padding-left: 25px;
- padding-top: 10px;
- }
- a:hover
- {
- color: #4c0033;
- text-decoration: underline;
- }
- .feedback
- {
- float: none;
- position: absolute;
- right: 15px;
- bottom: 10px;
- font: normal 8px/1 Verdana;
- color: #B0ADAB;
- }
- .feedback:hover
- {
- float: right;
- font: normal 8px/1 Verdana;
- color: #00732F;
- text-decoration: underline;
- }
- .alphaChar{
- width:100%;
- background-color:#F6F6F6;
- border:1px solid #E6E6E6;
- -moz-border-radius: 7px 7px 7px 7px;
- font-size:12pt;
- padding-left:10px;
- margin-top:10px;
- margin-bottom:10px;
- }
- .flowList{
- vertical-align:top;
- }
-
- .flowList dl{
- }
- .flowList dd{
- display:inline-block;
- margin-left:10px;
- width:250px;
- }
- .wrap .content .flowList p{
- padding:0px;
- }
-
- .content .alignedsummary
- {
- margin: 15px;
- }
-
-
- .qmltype
- {
- text-align: center;
- font-size: 160%;
- }
- .qmlreadonly
- {
- padding-left: 5px;
- float: right;
- color: #254117;
- }
-
- .qmldefault
- {
- padding-left: 5px;
- float: right;
- color: red;
- }
-
- .qmldoc
- {
- }
-
- *.qmlitem p
- {
- }
- #feedbackBox
- {
- display: none;
- -moz-border-radius: 7px 7px 7px 7px;
- border: 1px solid #DDDDDD;
- position: fixed;
- top: 100px;
- left: 33%;
- height: 230px;
- width: 400px;
- padding: 5px;
- background-color: #e6e7e8;
- z-index: 4;
- }
- #feedcloseX
- {
- display: inline;
- padding: 5px 5px 0 0;
- margin-bottom: 3px;
- color: #363534;
- font-weight: 600;
- float: right;
- text-decoration: none;
- }
-
- #feedbox
- {
- display: inline;
- width: 370px;
- height: 120px;
- margin: 0px 25px 10px 15px;
- }
- #noteHead
- {
- font-weight:bold;
- padding:10px 10px 10px 20px;
- }
- #feedsubmit
- {
- display: inline;
- float: right;
- margin: 4px 32px 0 0;
- }
-
- .note
- {
- font-size:7pt;
- padding-bottom:3px;
- padding-left:20px;
- }
-
- #blurpage
- {
- display: none;
- position: fixed;
- float: none;
- top: 0px;
- left: 0px;
- right: 0px;
- bottom: 0px;
- background: transparent url(../images/feedbackground.png) 0 0;
- z-index: 3;
- }
- .toc
- {
- float: right;
- -moz-border-radius: 7px 7px 7px 7px;
- background-color: #F6F6F6;
- border: 1px solid #DDDDDD;
- margin: 0 20px 10px 10px;
- padding: 20px 15px 20px 20px;
- height: auto;
- width: 200px;
- }
-
- .toc h3, .generic a
- {
- font: bold 12px/1.2 Arial;
- }
-
- .generic{
- }
- .generic td{
- padding:5px;
- }
- .generic .alphaChar{
- margin-top:5px;
- }
-
- .generic .odd .alphaChar{
- background-color: #F6F6F6;
- }
-
- .generic .even .alphaChar{
- background-color: #FFFFFF;
- }
-
- .alignedsummary{}
- .propsummary{}
- .memItemLeft{}
- .memItemRight{
- padding:3px 15px 3px 0;
- }
- .bottomAlign{}
- .highlightedCode
- {
- margin:10px;
- }
- .LegaleseLeft{}
- .valuelist{}
- .annotated td{
- padding: 3px 5px 3px 5px;
- }
- .obsolete{}
- .compat{}
- .flags{}
- .qmlsummary{}
- .qmlitem{}
- .qmlproto{}
- .qmlname{}
- .qmlreadonly{}
- .qmldefault{}
- .qmldoc{}
- .qt-style{}
- .redFont{}
- code{}
-
- .wrap .content .toc ul
- {
- padding-left: 0px;
- }
-
- .wrap .content .toc h3{
- border-bottom:0px;
- margin-top:0px;
- }
-
- .wrap .content .toc h3 a:hover{
- color:#00732F;
- text-decoration:none;
- }
-
-
- .wrap .content .toc .level2
- {
- margin-left: 15px;
- }
-
- .wrap .content .toc .level3
- {
- margin-left: 30px;
- }
-
- .content .toc li
- {
- font: normal 10px/1.2 Verdana;
- background: url(../images/bullet_dn.png) no-repeat 0 5px;
- }
- .relpage
- {
- -moz-border-radius: 7px 7px 7px 7px;
- border: 1px solid #DDDDDD;
- padding: 25px 25px;
- clear: both;
- }
- .relpage ul
- {
- float: none;
- padding: 15px;
- }
- .content .relpage li
- {
- font: normal 11px/1.2 Verdana;
- }
- h3.fn, span.fn
- {
- -moz-border-radius:7px 7px 7px 7px;
- background-color: #F6F6F6;
- border-width: 1px;
- border-style: solid;
- border-color: #E6E6E6;
- font-weight: bold;
- word-spacing:3px;
- padding:3px 5px;
- }
-
- .functionIndex {
- font-size:12pt;
- word-spacing:10px;
- margin-bottom:10px;
- background-color: #F6F6F6;
- border-width: 1px;
- border-style: solid;
- border-color: #E6E6E6;
- -moz-border-radius: 7px 7px 7px 7px;
- width:100%;
- }
-
- .centerAlign
- {
- text-align:center;
- }
-
- .rightAlign
- {
- text-align:right;
- }
-
-
- .leftAlign
- {
- text-align:left;
- }
-
- .topAlign{
- vertical-align:top
- }
-
- .functionIndex a{
- display:inline-block;
- }
-
-/* end content elements */
-/* footer elements */
-
- .footer
- {
- min-height: 100px;
- color: #797775;
- font: normal 9px/1 Verdana;
- text-align: center;
- padding-top: 40px;
- background-color: #E6E7E8;
- margin: 0;
- }
-/* end footer elements */
-
-
-
-
- /* start index box */
- .indexbox
- {
- width: 100%;
- display:inline-block;
- }
-
- .indexboxcont
- {
- display: block;
-
- }
-
- .indexboxbar
- {
- background: transparent url(../images/horBar.png ) repeat-x left bottom;
- margin-bottom: 25px;
-
-
- }
-
- .indexboxcont .section
- {
- display: inline-block;
- width: 49%;
- *width:42%;
- _width:42%;
- padding:0 2% 0 1%;
- vertical-align:top;
-
-}
-
- .indexboxcont .indexIcon
- {
- width: 11%;
- *width:18%;
- _width:18%;
- overflow:hidden;
-
-}
-
-.indexboxcont .section {
- float: left;
-}
-
- .indexboxcont .section p
- {
- padding-top: 20px;
- padding-bottom: 20px;
- }
- .indexboxcont .sectionlist
- {
- display: inline-block;
- vertical-align:top;
- width: 32.5%;
- padding: 0;
- }
- .indexboxcont .sectionlist ul
- {
- margin-bottom: 20px;
- }
-
- .indexboxcont .sectionlist ul li
- {
- line-height: 12px;
- }
-
- .content .indexboxcont li
- {
- font: normal bold 13px/1 Verdana;
- }
-
- .indexbox a:hover, .indexbox a:visited:hover
- {
- color: #4c0033;
- text-decoration: underline;
- }
-
- .indexbox a:visited
- {
- color: #00732f;
- text-decoration: none;
- }
-
- .indexbox .indexIcon {
- width: 11%;
- }
-
-
- .indexbox .indexIcon span
- {
- display: block;
- }
-
- .indexbox.guide .indexIcon span
- {
- width: 96px;
- height: 137px;
- background: url(../images/sprites-combined.png) no-repeat -5px -376px;
- padding: 0;
- }
-
- .indexbox.tools .indexIcon span
- {
- width: 115px;
- height: 137px;
- background: url(../images/sprites-combined.png) no-repeat -111px -376px;
- padding: 0;
- }
- .indexboxcont:after
- {
- content: ".";
- display: block;
- height: 0;
- clear: both;
- visibility: hidden;
- }
-
-
-
-/* start of offline spec*/
- .offline .wrapper .hd
- {
- background: url(../images/page.png) no-repeat 0 -15px;
- }
- .offline .wrapper .bd
- {
- background: url(../images/bg_l_blank.png) repeat-y 0 0;
- }
- .offline .wrapper .ft
- {
- background: url(../images/page.png) no-repeat 0 -90px;
- }
- .offline .sidebar,
- .offline .feedback,
- .offline .t_button,
- .offline #narrowsearch,
- .offline #narrowmenu
- {
- display: none;
- }
- .offline .wrap
- {
- margin: 0 5px 0 5px;
- }
- .offline .wrap .breadcrumb
- {
- }
-
- .offline .wrap .content
- {
- padding-top: 15px;
- }
-
-
-/* end of offline spec*/
-
-/* start of creator spec*/
- .creator
- {
- margin-left:0px;
- margin-right:0px;
- padding-left:0px;
- padding-right:0px;
- }
- .creator .wrap .content ol li {
- list-style-type:decimal;
-
- }
- .creator .header .icon,
- .creator .feedback,
- .creator .t_button,
- .creator .feedback,
- .creator #feedbackBox,
- .creator #feedback,
- .creator #blurpage,
- .creator .indexbox .indexIcon span,
- .creator .wrapper .hd,
- .creator .indexbox .indexIcon,
- .creator .header #nav-logo,
- .creator #offlinemenu,
- .creator #offlinesearch,
- .creator .header #nav-topright,
- .creator .header #shortCut ,
- .creator .wrapper .hd,
- .creator .wrapper .ft,
- .creator .sidebar,
- .creator .wrap .feedback
- {
- display:none;
- }
-
- body.creator
- {
- background: none;
-
- font: normal 13px/1.2 Verdana;
- color: #363534;
- background-color: #FFFFFF;
- }
-
-
-
- .creator .header, .footer, .wrapper
- {
- max-width: 1500px;
- margin: 0px;
- }
-
- .creator .wrapper
- {
- position:relative;
- top:50px;
- }
- .creator .wrapper .bd
- {
-
- background:#FFFFFF;
- }
-
-
- .creator .header, .footer
- {
- display: block;
- clear: both;
- overflow: hidden;
- }
- .creator .wrap .content p
-
- {
- line-height: 20px;
- padding: 5px;
- }
-
- .creator .header .qtref span
- {
- background:none;
- }
-
-
-
- .creator .footer
- {
- border-top:1px solid #E5E5E5;
- min-height: 100px;
- margin:0px;
- }
-
- .creator .wrap
- {
-
- padding:0 5px 0 5px;
- margin: 0px;
- }
- .creator .wrap .toolbar
- {
-
-
- border-bottom:1px solid #E5E5E5;
- width:100%,
- }
- .creator .wrap .breadcrumb ul li a
- {
- /* color: #363534;*/
- color: #00732F;
- }
-
- .creator .wrap .content
- {
- padding: 0px;
- word-wrap:break-word;
- }
-
- .creator .wrap .content ol li {
- background:none;
- font: inherit;
- padding-left: 0px;
- }
-
- .creator .wrap .content .descr ol li {
- margin-left: 45px;
-
- }
- .creator .content .alignedsummary
- {
- margin: 5px;
- width:100%;
- }
- .creator .generic{
- max-width:75%;
- }
- .creator .generic td{
- padding:0;
- }
- .creator .indexboxbar
- {
- border-bottom:1px solid #E5E5E5;
- margin-bottom: 25px;
- background: none;
- }
-
-
-
- .creator .header
- {
- width: 100%;
- margin: 0;
- height: auto;
- background-color: #ffffff;
- padding: 10px 0 5px 0;
- overflow: visible;
- border-bottom: solid #E5E5E5 1px;
- z-index:1;
-
-
-
-
-
-
-
-
- position:fixed;
- }
-
-
- .creator .header .content
- {
- }
- .creator .header .qtref
- {
- color: #00732F;
- position: static;
- float: left;
- margin-left: 5px;
- font: bold 18px/1 Arial;
- }
-
- .creator .header .qtref:visited
- {
- color: #00732F;
- }
- .creator .header .qtref:hover
- {
- color: #00732F;
- text-decoration:none;
- }
- .creator .header .qtref span
- {
- background-image: none;
- text-indent: 0;
- text-decoration:none;
- }
-
-
-
-
-
-
- .creator .wrap .toolbar
- {
- display:block;
- padding-top:0px;
- }
-
-
-
- .creator .wrap .breadcrumb ul li {
- font-weight: normal;
- }
-
- .creator .wrap .breadcrumb ul li a {
- /*color: #44a51c;*/
- }
-
- .creator .wrap .breadcrumb ul li.last a {
- /*color: #363534;*/
- }
-
- .creator #narrowmenu ul
- {
- border-bottom:solid 1px #E5E5E5;
- border-left:solid 1px #E5E5E5;
- border-right:solid 1px #E5E5E5;
- }
-
- .creator #narrowmenu li ul {
- margin-top:-15px;
- }
-
-
- .creator .toc {
- margin:10px 20px 10px 10px;
- }
-/* end of creator spec*/
-
-}
-
-/* end of screen media */
-
-/* start of print media */
-
-@media print
-{
- input, textarea, .header, .footer, .toolbar, .feedback, .wrapper .hd, .wrapper .bd .sidebar, .wrapper .ft
- {
- display: none;
- background: none;
- }
- .content
- {
- position: absolute;
- top: 0px;
- left: 0px;
- background: none;
- display: block;
- }
-}
-/* end of print media */
diff --git a/doc/src/style/style_ie6.css b/doc/src/style/style_ie6.css
deleted file mode 100644
index 16fb8505..00000000
--- a/doc/src/style/style_ie6.css
+++ /dev/null
@@ -1,54 +0,0 @@
-.indexbox, .indexboxcont, .group {
- zoom: 1;
- height: 1%;
-}
-
-.sidebar {
- margin-left: 3px;
- width: 199px;
- overflow: hidden;
-}
-
-.sidebar .search form {
- position: relative;
-}
-
-.sidebar .search form fieldset {
- position: absolute;
- margin-top: -1px;
-}
-
-.sidebar .search form input#searchstring {
- border: 1px solid #fff;
- height: 18px;
-}
-
-.wrap {
- zoom: 1;
-}
-
-.content,
-.toolbar {
- zoom: 1;
- margin-left: -3px;
- position: relative;
-}
-
-.indexbox {
- clear: both;
-}
-
-.indexboxcont .section {
- zoom: 1;
- float: left;
-}
-
-.indexboxcont .sectionlist {
- zoom: 1;
- float: left;
-}
-
-.wrap .toolbar .toolbuttons li {
- text-indent: 0;
- margin-right: 8px;
-} \ No newline at end of file
diff --git a/doc/src/style/style_ie7.css b/doc/src/style/style_ie7.css
deleted file mode 100644
index afbff5f8..00000000
--- a/doc/src/style/style_ie7.css
+++ /dev/null
@@ -1,19 +0,0 @@
-.indexbox, .indexboxcont, .group {
- min-height: 1px;
-}
-
-.sidebar .search form input#searchstring {
- border: 1px solid #fff;
- height: 17px;
-}
-
-
-.indexboxcont .section {
- zoom: 1;
- float: left;
-}
-
-.indexboxcont .sectionlist {
- zoom: 1;
- float: left;
-}
diff --git a/doc/src/style/style_ie8.css b/doc/src/style/style_ie8.css
deleted file mode 100644
index e69de29b..00000000
--- a/doc/src/style/style_ie8.css
+++ /dev/null
diff --git a/doc/src/style/superfish.css b/doc/src/style/superfish.css
deleted file mode 100644
index a9939090..00000000
--- a/doc/src/style/superfish.css
+++ /dev/null
@@ -1,51 +0,0 @@
-.sf-menu, .sf-menu * {
- margin: 0;
- padding: 0;
- list-style: none;
-}
-.sf-menu {
- line-height: 1.0;
-}
-.sf-menu ul {
- position: absolute;
- top: -999em;
- width: 10em; /* left offset of submenus need to match (see below) */
-}
-.sf-menu ul li {
- width: 100%;
-}
-.sf-menu li:hover {
- visibility: inherit; /* fixes IE7 'sticky bug' */
-}
-.sf-menu li {
- float: left;
- position: relative;
-}
-.sf-menu a {
- display: block;
- position: relative;
-}
-.sf-menu li:hover ul,
-.sf-menu li.sfHover ul {
- left: 0;
- top: 2.5em; /* match top ul list item height */
- z-index: 99;
-}
-ul.sf-menu li:hover li ul,
-ul.sf-menu li.sfHover li ul {
- top: -999em;
-}
-ul.sf-menu li li:hover ul,
-ul.sf-menu li li.sfHover ul {
- left: 10em; /* match ul width */
- top: 0;
-}
-ul.sf-menu li li:hover li ul,
-ul.sf-menu li li.sfHover li ul {
- top: -999em;
-}
-ul.sf-menu li li li:hover ul,
-ul.sf-menu li li li.sfHover ul {
- left: 10em; /* match ul width */
- top: 0;
-}
diff --git a/doc/src/style/superfish_skin.css b/doc/src/style/superfish_skin.css
deleted file mode 100644
index 112b26ae..00000000
--- a/doc/src/style/superfish_skin.css
+++ /dev/null
@@ -1,83 +0,0 @@
-
-/*** DEMO SKIN ***/
-.sf-menu {
- float: left;
- margin-bottom: 1em;
-}
-.sf-menu a {
- border-left: 1px solid #fff;
- border-top: 1px solid #CFDEFF;
- padding: .75em 1em;
- text-decoration:none;
-}
-.sf-menu a, .sf-menu a:visited { /* visited pseudo selector so IE6 applies text colour*/
- color: #13a;
-}
-.sf-menu li {
- background: #BDD2FF;
-}
-.sf-menu li li {
- background: #AABDE6;
-}
-.sf-menu li li li {
- background: #9AAEDB;
-}
-.sf-menu li:hover, .sf-menu li.sfHover,
-.sf-menu a:focus, .sf-menu a:hover, .sf-menu a:active {
- background: #CFDEFF;
- outline: 0;
-}
-
-/*** arrows **/
-.sf-menu a.sf-with-ul {
- padding-right: 2.25em;
- min-width: 1px; /* trigger IE7 hasLayout so spans position accurately */
-}
-.sf-sub-indicator {
- position: absolute;
- display: block;
- right: .75em;
- top: 1.05em; /* IE6 only */
- width: 10px;
- height: 10px;
- text-indent: -999em;
- overflow: hidden;
- background: url('../images/arrows-ffffff.png') no-repeat -10px -100px; /* 8-bit indexed alpha png. IE6 gets solid image only */
-}
-a > .sf-sub-indicator { /* give all except IE6 the correct values */
- top: .8em;
- background-position: 0 -100px; /* use translucent arrow for modern browsers*/
-}
-/* apply hovers to modern browsers */
-a:focus > .sf-sub-indicator,
-a:hover > .sf-sub-indicator,
-a:active > .sf-sub-indicator,
-li:hover > a > .sf-sub-indicator,
-li.sfHover > a > .sf-sub-indicator {
- background-position: -10px -100px; /* arrow hovers for modern browsers*/
-}
-
-/* point right for anchors in subs */
-.sf-menu ul .sf-sub-indicator { background-position: -10px 0; }
-.sf-menu ul a > .sf-sub-indicator { background-position: 0 0; }
-/* apply hovers to modern browsers */
-.sf-menu ul a:focus > .sf-sub-indicator,
-.sf-menu ul a:hover > .sf-sub-indicator,
-.sf-menu ul a:active > .sf-sub-indicator,
-.sf-menu ul li:hover > a > .sf-sub-indicator,
-.sf-menu ul li.sfHover > a > .sf-sub-indicator {
- background-position: -10px 0; /* arrow hovers for modern browsers*/
-}
-
-/*** shadows for all but IE6 ***/
-.sf-shadow ul {
- background: url('../images/shadow.png') no-repeat bottom right;
- padding: 0 8px 9px 0;
- -moz-border-radius-bottomleft: 17px;
- -moz-border-radius-topright: 17px;
- -webkit-border-top-right-radius: 17px;
- -webkit-border-bottom-left-radius: 17px;
-}
-.sf-shadow ul.sf-shadow-off {
- background: transparent;
-}
diff --git a/doc/src/tutorials/penguin.qdoc b/doc/src/tutorials/penguin.qdoc
deleted file mode 100644
index e973090d..00000000
--- a/doc/src/tutorials/penguin.qdoc
+++ /dev/null
@@ -1,106 +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 documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** GNU Free Documentation License
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file.
-**
-** 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$
-**
-****************************************************************************/
-
-/*!
- \example qt3d/penguin
- \title Loading a 3DS model with Qt3D
-
- This tutorial shows how Qt3D can be used to load a simple
- model object in 3D Studio Max (3DS) format with a perspective
- camera view.
-
- We start by defining a class that inherits from QGLView, which
- provides some basic scene setup logic and 3D camera navigation:
-
- \snippet qt3d/penguin/modelview.h class-defn
-
- Refer first to the \l{Teapot Example} for the basics of using
- the QGLView class, lighting and so on.
-
- When the application starts up, we load the scene from its
- resource file, and store the result in a member variable, so
- we can refer to it in the paint function:
-
- \snippet qt3d/penguin/modelview.cpp initialize
-
- In the teapot example we had to specify appropriate effects but
- the model loader sets appropriate effects on the scene for us.
-
- \snippet qt3d/penguin/modelview.cpp paint
-
- Here in the paint function we call the \c{draw()} function of
- the scene's main object, in order to display the fully
- loaded model.
-
- This was really just two lines of code: one to load the model
- (once off, when the application initialized) and another line to
- display the model (every time the paint function is called).
-
- \image penguin-0-screenshot.png
-
- The result is pretty good for two lines of code, but it could
- stand some improvements.
-
- Here we are looking down onto the top of our penguin's head, and
- even when we stand him on his feet, he is too close to the camera
- to all fit in the frame.
-
- Let's make a few changes to have our penguin display nicely
- when the application opens.
-
- \snippet qt3d/penguin_advanced/modelview.cpp initialize
-
- First of all, let move the camera away from the penguin and up
- so he fits in the frame and we can get a better angle on him,
- when the application loads.
-
- If use dragging and so on in the QGLView this will change the
- camera from these intial settings, but this setup means the camera
- will be well positioned at the moment the application opens.
-
- We don't want to position the camera in the paintGL function,
- because that would defeat QGLViews camera dragging features and
- we would not be able to interact with the view properly.
-
- We'll also save the main object away in a member variable so that
- the overhead of searching the scene is not incurred every paint.
-
- Finally a pose for our penguin is calculated - its a turn around the
- x axis, so he is standing up on his feet; and a turn around the y
- axis, so he shows a bit more of his profile. The pose is
- calculated and stored as a quaternion - we want the x twist first
- so that goes last in the product of the two quaternions.
-
- \snippet qt3d/penguin_advanced/modelview.cpp paint
-
- Now all that remains in the updated paint function is to apply the
- new pose, and then paint the penguin.
-
- \image penguin-screenshot.png
-
- \l{qt3d-examples.html}{Return to Tutorials}.
-*/
diff --git a/doc/src/tutorials/sceneformat.qdoc b/doc/src/tutorials/sceneformat.qdoc
deleted file mode 100644
index 3774b6a1..00000000
--- a/doc/src/tutorials/sceneformat.qdoc
+++ /dev/null
@@ -1,116 +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 documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** GNU Free Documentation License
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file.
-**
-** 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$
-**
-****************************************************************************/
-
-/*!
- \title Writing a scene format plug-in for Qt3D
- \keyword Scene Format Plugin
- \example sceneformats/obj
-
- Scene format plugins are used to load external 3D model file
- formats like \bold 3DS, \bold obj, and so on. In this tutorial we will
- do a walk-through of the \bold obj scene format plugin to
- demonstrate what is required to add a new format to Qt3D.
-
- Models are loaded by QGLAbstractScene::loadScene(), which locates
- a suitable plug-in for the format, and then asks the plug-in to
- parse the data and create a QGLAbstractScene object that describes
- the 3D objects in the scene.
-
- We start by declaring an instance of QGLSceneFormatPlugin and
- arranging for it to be registered with the Qt plug-in system:
-
- \snippet sceneformats/obj/main.cpp 1
- \snippet sceneformats/obj/main.cpp 4
-
- The two functions we need to implement are
- \l{QGLSceneFormatPlugin::keys()}{keys()} and
- \l{QGLSceneFormatPlugin::create()}{create()}. The first of these
- returns a lower-case list of the file extensions and MIME types
- that are supported by the plug-in:
-
- \snippet sceneformats/obj/main.cpp 2
-
- The create function is called to create the QGLSceneFormatHandler
- which is used to load the model data:
-
- \snippet sceneformats/obj/main.cpp 3
-
- The create function is passed the QIODevice for the data,
- the URL of where the data was found, and the chosen format.
- These parameters can be used by the plug-in to decide which
- handler to return if multiple formats are supported by
- the plug-in. In the case of obj, we always return the same
- handler so we don't need to inspect the passed parameters.
-
- QGLAbstractScene::loadScene() will set the parameters on
- the QGLSceneFormatHandler object and then call
- \l{QGLSceneFormatHandler::read()}{read()}:
-
- \snippet sceneformats/obj/qglobjscenehandler.h 1
- \dots
- \snippet sceneformats/obj/qglobjscenehandler.h 2
-
- The read function will typically construct a QGLBuilder
- for the geometry in the scene and then parse all of the objects,
- materials, textures, and so on. Ultimately, it needs to produce a
- QGLAbstractScene object, populated with QGLSceneNode instances
- for each of the objects in the model file. In our case, we create
- an instance of \c QGLObjScene:
-
- \snippet sceneformats/obj/qglobjscene.h 1
- \dots
- \snippet sceneformats/obj/qglobjscene.h 2
- \dots
- \snippet sceneformats/obj/qglobjscene.h 3
-
- The most important function is the override for
- QGLAbstractScene::objects(), which allows the rest of Qt3D
- to query the full list of objects in the model file.
- The scene object can also override QGLAbstractScene::object()
- if it has an efficient method to quickly look up an object by name.
-
- The scene should also override QGLAbstractScene::mainNode()
- to return the main mesh node in the scene. Usually this is
- the first element in the list returned by QGLAbstractScene::objects()
- but doesn't have to be.
-
- Note: the plug-in does not need to use QGLBuilder and the
- other Qt3D classes to load the model if it doesn't want to.
- It can instantiate subclasses of QGLSceneNode that override
- the draw() method and draws the object using whatever technique
- the plug-in chooses. It just needs to leave the OpenGL state
- in the condition that it found it so that other parts of Qt3D
- will not be confused.
-
- Once you have written a plug-in for your new format, you should
- install it into \c{$QTDIR/plugins/sceneformats}. You can test it
- by running the \c{modelviewer} program and trying to load models
- in your new format. When debugging, it can be useful to set the
- \c{QT_DEBUG_PLUGINS} environment variable to 1.
-
- \l{qt3d-examples.html}{Return to the main Tutorials page}.
-*/
diff --git a/doc/src/tutorials/shaders.qdoc b/doc/src/tutorials/shaders.qdoc
deleted file mode 100644
index dc20099b..00000000
--- a/doc/src/tutorials/shaders.qdoc
+++ /dev/null
@@ -1,388 +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 documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** GNU Free Documentation License
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file.
-**
-** 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$
-**
-****************************************************************************/
-
-/*!
- \title Using GLSL shaders in QtQuick3D
- \example quick3d/shaders
-
-
- In this tutorial, we will show how to apply QML property animations to
- GLSL shaders in a QtQuick3D application.
-
- Starting with a relatively simple shader program, we are going to
- manipulate various parameters to explain how both the shader and the QML
- integration work (This is quite a lot to start a tutorial with, but we'll
- focus on each small piece of it in turn):
-
- \raw HTML
- <table align="left" width="100%">
- <tr class="qt-code"><td>
- \endraw
- \snippet quick3d/shaders/shader-tutorial.qml 1
- \raw HTML
- </td><td align="right">
- \endraw
- \inlineimage tutorials/shader-tutorial.png
- \raw HTML
- </td></tr>
- </table>
- \endraw
-
- At the highest level, shaders in QtQuick3D are created using the ShaderProgram
- element. The ShaderProgram element in this example has the id \a program,
- and applying it to the teapot is as simple as assigning it to the \c effect
- property of an Item3D derived element.
-
- The two most important properties of the ShaderProgram element are the
- \c vertexShader and \c fragmentShader properties, which are strings
- containing the code for the respective shader programs. Broadly speaking,
- the vertex shader is run on each vertex in a model (for example, the 8
- corners of a cube) to calculate the final position of each point, while the
- fragment shader is run on each pixel visible onscreen to calculate it's
- color.
-
- The other attribute we use in this tutorial is the \c texture property.
- This property is connected to the \c qt_Texture0 attribute in our shader
- programs, and we'll cover how it's used shortly.
-
- \section1 Texture Coordinates and Textures (shader-tutorial-1-textures.qml)
-
- To start with, there are a couple of obvious problems with our starting
- point - the Qt is upside down and back to front, and it's also boring
- (before you ask, the reasons for the image being the wrong way around are
- also boring).
-
- First, let's get the logo the right way up. The key here is the texture
- coordinates. Let's look at it's declaration in the vertex shader for a
- moment: \code attribute highp vec4 qt_MultiTexCoord0; \endcode
-
- The \c attribute declaration indicates that this is a per-vertex value
- that we get from our model. Our teapot has a position, a normal, and
- texture coordinates for each vertex, and qt3d automatically provides
- these to us through the \c qt_Vertex, \c qt_MultiTexCoord0, and \c
- qt_Normal attributes. (we don't care about normals until we get to
- lighting).
-
- The \c mediump tag indicates that we want pretty good accuracy on this
- attribute, but it doesn't need double precision. It's a hint for
- embedded systems to save bandwidth (highp is usually used for positions,
- and lowp is generally only suitable for colors, and the rule of thumb is
- to use as little memory as you can get away with).
-
- \c vec4 indicates that the value is a 4-element vector. Our texture is
- 2D, so we only care about the first two elements, but there are 3D
- textures and cube maps out there.
-
- To fix the image's orientation we can simply reverse the sign when we
- pass the texture coordinate to our fragment shader because the default
- behaviour is for texture coordinates wrap around if they are higher than
- 1.0 or lower than 0.0:
- \code texCoord = -qt_MultiTexCoord0; \endcode
-
- In order to fix the boring, we're going to have to add a bit more QML
- first. We need to add a property to our ShaderProgram element, and a
- matching variable to the shader program. The types match up exactly
- between QML and GLSL, but if the variables have the same name they
- should automatically be hooked up, so we just add this to the
- ShaderProgram element:
- \code property real textureOffsetX : 1.0
- NumberAnimation on textureOffsetX
- {
- running: true; loops: Animation.Infinite
- from: 0.0; to: 1.0;
- duration: 1000
- }
- \endcode
- and we add this to the vertex shader:
- \code uniform mediump float textureOffsetX; \endcode
-
- The final step is to work our new variable into the program, by changing
- the texCoord assignment. We'll add our animated variable to our horizontal
- texture coordinate, which will effectively scroll our texture around our
- teapot:
- \code
- texCoord = vec4(-qt_MultiTexCoord0.s - textureOffsetX,
- -qt_MultiTexCoord0.t,
- 0,0);
- \endcode
-
- Adding an additional texture is done by adding another uniform. The
- ShaderProgram element interprets string properties as URIs for texture
- resources, so adding a second texture is as easy as:
- \code
- property string texture2: "textures/basket.jpg"
- \endcode
- In order to have a smooth transition back and forth, we'll add and animate
- a second property to use to blend the two textures:
- \code
- property real interpolationFactor : 1.0
- SequentialAnimation on interpolationFactor
- {
- running: true; loops: Animation.Infinite
- NumberAnimation {
- from: 0.0; to: 1.0;
- duration: 2000
- }
- PauseAnimation { duration: 500 }
- NumberAnimation {
- from: 1.0; to: 0.0;
- duration: 2000
- }
- PauseAnimation { duration: 500 }
- }
- \endcode
-
- Next we need to use all of that information in the fragment shader:
- \code
- varying highp vec4 texCoord;
- uniform sampler2D qt_Texture0;
- uniform sampler2D texture2;
- uniform mediump float interpolationFactor;
-
- void main(void)
- {
- mediump vec4 texture1Color = texture2D(qt_Texture0, texCoord.st);
- mediump vec4 texture2Color = texture2D(texture2, texCoord.st);
- mediump vec4 textureColor = mix(texture1Color, texture2Color,
- interpolationFactor);
- gl_FragColor = textureColor;
- }
- \endcode
-
- In general, textures needs to have the same name in the shaders as in the
- ShaderProgram element in order to be automatically connected, but \c
- qt_Texture0 is special cased and very slightly faster, so it's good to use
- it first.
-
- \c mix() is another handy built in GLSL function that interpolates linearly
- between two values or vectors. (You can find details of all the built in
- functions in the official OpenGL Shader Language specification available at
- http://www.khronos.org/opengl/ )
-
- Finally, let's make one more change to make this example pop. If you're
- a performance fanatic, it just might have rankled that we padded out our
- texture coordinates with two zeros, and passed them in for processing
- on every single pixel of our teapot.
-
- Let's make use of that space by putting a second set of co-ordinates in
- there to use with our second texture. Let's change our texture assignment
- to this:
- \code
- texCoord.st = vec2(-qt_MultiTexCoord0.s - textureOffsetX,
- -qt_MultiTexCoord0.t);
- texCoord.pq = vec2(-qt_MultiTexCoord0.s + textureOffsetX,
- -qt_MultiTexCoord0.t);
- \endcode
- Now the top half of our vector contains co-ordianates spinning in the
- opposite direction. Back in the fragment shader, we just need use these
- instead for our second texture color, so let's change the \c texture2Color
- assignment to this, and really fix that boring:
- \code
- mediump vec4 texture2Color = texture2D(texture2, texCoord.pq);
- \endcode
-
- \section1 Varying values (shader-tutorial-varying.qml)
-
- The left hand side value is our \c varying attribute \c texCoord.
- \c varying values are how the vertex shader communicates with the
- fragment shader, and the declaration has to be identical in both shaders.
- \c varying values are calculated once for each
- vertex, but the values are interpolated across the shapes. The
- shader-tutorial-varying.qml shows this visually using the Pane
- class and a neat debugging trick - using the texture coordinates as
- a color. Even with only 4 vertexes the texture coordinates are smeared
- smoothly across the shape:
- \table
- \row
- \o \code gl_FragColor = vec4(mod(texCoord.x, 1.0),
- mod(texCoord.y, 1.0), 0.0, 1.0); \endcode
- \o
- \o \image tutorials/shader-tutorial-varying.png
- \endtable
-
-
- \section1 Vertexes and Matrices (shader-tutorial-2-vertex-shader.qml)
-
- Let's go back to the vertex shader. As already mentioned, the
- vertex shader's primary function is to generate the final position of a
- vertex.
-
- First, let's look at \c qt_Vertex. This is the value we're getting out
- of our model, the actual points on our shape. Manipulating this value
- will lets us change the position of the points somewhat independantly.
-
- For this tutorial, we'll create a squashing effect that might work for
- something rising out of water, or something rubbery being squashed down.
-
- What we need to do is create a floor, where vertexes above the floor
- retain their position, and vertexes below it are clamped to (nearly) that
- value. Then we move the model relative to this floor to create a nice
- effect.
-
- We need to use some knowledge that we have about the model for this to
- work - most notably it's height, and it's bottom. A bit of experimenting
- suggests that 2.0 for height and -1.0 for bottom are close enough.
-
- We need to introduce a couple more GLSL things here. \c max() is one of
- the GL SL built in functions, selecting the higher of the two arguments as
- you might expect.
-
- The \c foo.xyzw are called \i twiddles, and are
- convenient and efficient ways to pull out specific elements of vector
- areguments. You can see in this example, that we use twiddles to get out
- the x, z, and w values from our original vector and substitute in our own
- y value. For convenience, there are 3 different sets of twiddles that are
- all equivalent: foo.xyzw (co-ordinates), foo.rgba (colors), and
- foo.stpq (texture coordinates). As far as GLSL is concerned, though,
- they're just vectors, and effectively just commenting your code.
-
- The \c vec4() function will accept whatever combination of values and
- twiddles you throw at it, and mold them back into a 4 element vector.
-
- What this function is doing is moving the model down the screen (which for
- us, here, is along the y axis in the negative direction).
- We draw an imaginary line where the bottom of the model used to be, and if
- the vertex ends up below that line, we move it back to just past the line.
-
- "Just past" is important. Graphics cards get confused if vertexes are too
- close together, and the result is ugly. Try taking out the
- "\c {qt_Vertex.y * 0.01}" if you'd like to see what it looks like.
-
- \code
- float newY = max(qt_Vertex.y - squashFactor * modelSize,
- qt_Vertex.y * 0.01 + modelBottom);
- \endcode
-
-
- \code
- const float modelSize = 2.0;
- const float modelBottom = -1.0;
- float newY = max(qt_Vertex.y - squashFactor * modelSize,
- qt_Vertex.y * 0.01 + modelBottom);
-
- gl_Position = qt_ModelViewProjectionMatrix *
- vec4(qt_Vertex.x, newY, qt_Vertex.zw);
- \endcode
-
- Hopefully, that makes the function of the \c qt_Vertex attribute clear, so
- next we'll look at the Model/View/Projection matrices.
-
- The model matrix is generally used to place an object in a scene. In the
- simplest case, this might just be "up and to the left a bit", but it's
- often inherited from a parent. It's very easy mathematically to combine
- the matrices in such a way that one object is always in the same relative
- position to another ("The hip bones connected to the thigh bone").
-
- The view matrix is generally used much like a camera is in a movie, for
- panning around a whole scene at once. Manipulating the view matrix is also
- commonly used for effects like mirrors.
-
- The projection matrix (\c qt_ProjectionMatrix) functions much like a
- camera does when you take a
- picture, converting all the 3d points in a scene into the 2d points on the
- screen.
-
- We won't be exploring the matrices individually, but let's explore what
- happens if we use the same effect that we just used on the vertex after
- the transformation matrices are applied.
-
- Firstly, we're going to need multiple teapots to see the difference, so
- let's add those in. We want to move them all together, so we'll wrap
- them in an Item3D, and apply our animations to that item instead of
- the teapots directly.
- \code
-
- Item3D {
- z: -8.0
- transform: [
- Rotation3D {
- NumberAnimation on angle {
- running: true; loops: Animation.Infinite
- from: 0; to: 360; duration: 5000
- }
- axis: Qt.vector3d(0, 0, 1.0)
- }
- ]
-
- TutorialTeapot {id: teapot1; effect: program; y:2.0; x:0.0}
- TutorialTeapot {id: teapot2; effect: program; y:-1.0; x:-1.732}
- TutorialTeapot {id: teapot3; effect: program; y:-1.0; x:1.732}
- }
- \endcode
-
- In order to show the difference, what we want to do now is the same sort
- of effect as the previous example, only applied to the positions after
- the matrices have been applied, so our new vertex shader looks like this:
- \code
- attribute highp vec4 qt_Vertex;
- uniform mediump mat4 qt_ModelViewProjectionMatrix;
-
- attribute mediump vec4 qt_MultiTexCoord0;
- varying mediump vec4 texCoord;
-
- void main(void)
- {
- const float modelBottom = -4.0;
-
- vec4 workingPosition = qt_ModelViewProjectionMatrix * qt_Vertex;
- float newY = max(workingPosition.y,
- workingPosition.y * 0.15 + modelBottom);
- workingPosition.y = newY;
- gl_Position = workingPosition;
-
- texCoord = -qt_MultiTexCoord0;
- }
- \endcode
-
- There's nothing new here, we're just tweaking a few numbers for the new
- effect and manipulating the vertexes after the matrices have been applied.
- The result is an imaginary line across the whole scene, and when any part
- of any teapot dips below that line we deform it as though it's being
- squished or refracted.
-
- The obvious difference is that when you're manipulating \c qt_Vertex,
- the inputs, outputs, and changes are relative to the model. After the
- matrices are applied,
-
- We'll leave adding a pretty watery surface as an exercise for the reader.
-
-
-
- \section1 Lighting
-
- Finally, we'll add lighting. We've left lighting till last because it
- requires a lot of additional variables, and it is not within the scope of
- this tutorial to explore them all individually. There are many better
- resources readily available, and the techniques already covered can be
- used to explore each element.
-
-
- For further reading, the full specification for the OpenGL Shader Language
- is available from the Khronos website at http://www.khronos.org/opengl/
-
- \l{qt3d-examples.html}{Return to the main Tutorials page}.
-*/
diff --git a/doc/src/tutorials/simpleobject.qdoc b/doc/src/tutorials/simpleobject.qdoc
deleted file mode 100644
index db6c3be3..00000000
--- a/doc/src/tutorials/simpleobject.qdoc
+++ /dev/null
@@ -1,106 +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 documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** GNU Free Documentation License
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file.
-**
-** 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$
-**
-****************************************************************************/
-
-/*!
- \title Applying Transformations and Materials
- \keyword Object Effects
- \example qt3d/cube4
-
- In this tutorial we will apply transformations and materials to a
- simple cube object to demonstrate how to modify the QGLPainter
- state to achieve different effects.
-
- \section2 Cube in QtQuick3D
-
- It is quite simple to achieve these effects in QtQuick3D:
-
- \snippet quick3d/cube/qml/cube.qml 1
-
- \section2 Cube in Qt3D
-
- In the C++ world we start by declaring a view class to show our cube
- on the screen:
-
- \snippet qt3d/cube1/cubeview.h 1
-
- QGLView provides most of the logic for initializing the view,
- setting the camera position, and handling navigation via
- keyboard and mouse events. In the constructor we use
- QGLBuilder to create the geometry for the cube object that
- we will be using in later steps:
-
- \snippet qt3d/cube1/cubeview.cpp 1
-
- Then it is a simple matter to draw the object in our \c{paintGL()}
- method:
-
- \snippet qt3d/cube1/cubeview.cpp 2
-
- If we run the program now, we get the following output, which isn't
- very cube-like:
-
- \image tutorials/cube1-screenshot.png
-
- The problem is that we are looking at the cube straight onto its
- front face. So the rest of the cube is hidden from our view and
- it looks like a square. Let's modify the modelview transformation
- matrix a little bit to apply a 45 degree rotation around the
- axis (1, 1, 1):
-
- \snippet qt3d/cube2/cubeview.cpp 2
-
- Now the results are a little better:
-
- \image tutorials/cube2-screenshot.png
-
- The cube is still a little odd-looking however. This is because
- up until now we have been using the default flat color effect
- in QGLPainter that colors the faces with a uniform color
- (white in this case). So let's change to a lit material effect
- with a nice green color:
-
- \snippet qt3d/cube3/cubeview.cpp 2
-
- That's much better; now it looks like a cube:
-
- \image tutorials/cube3-screenshot.png
-
- To complete this tutorial, let's make the cube a little more
- interesting by adding a texture to the side:
-
- \snippet qt3d/cube4/cubeview.h 1
- \dots
- \snippet qt3d/cube4/cubeview.h 2
- \snippet qt3d/cube4/cubeview.cpp 1
- \dots
- \snippet qt3d/cube4/cubeview.cpp 2
- \snippet qt3d/cube4/cubeview.cpp 3
-
- \image tutorials/cube4-screenshot.png
-
- \l{qt3d-examples.html}{Return to the main Tutorials page}.
-*/
diff --git a/examples/examples.pro b/examples/examples.pro
deleted file mode 100644
index b008b37d..00000000
--- a/examples/examples.pro
+++ /dev/null
@@ -1,2 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS += quick3d qt3d
diff --git a/examples/qt3d/README b/examples/qt3d/README
deleted file mode 100644
index 2a45154d..00000000
--- a/examples/qt3d/README
+++ /dev/null
@@ -1,14 +0,0 @@
-This directory contains examples for the Qt3D C++ API.
-
-Qt3D can be used to extend Qt Quick3D with custom 3D items. Qt3D is also
-a general 3D toolkit, featuring a scenegraph API, support for OpenGL VBO's
-and other utilities for general 3D programming.
-
-Research work on Qt3D also continues in the labs repository:
-
- http://qt.gitorious.org/qt-labs/qt3d
-
-...and is from time to time ported into Qt Quick3D.
-
-Check the labs version of Qt3D for additional cutting edge features such as
-support for stereoscopic hardware.
diff --git a/examples/qt3d/basket/README b/examples/qt3d/basket/README
deleted file mode 100644
index 560fd74c..00000000
--- a/examples/qt3d/basket/README
+++ /dev/null
@@ -1,15 +0,0 @@
-
-This example draws a rotating basket, textured with a basket weave,
-to demonstrte how to use textures and how to create simple animated
-effects. The basket model is based on the standard teapot model,
-with the handle and spout removed.
-
-The texture came from www.cgtextures.com:
-
-http://www.cgtextures.com/texview.php?id=25208&s=S&PHPSESSID=2fd7273841dfba0001d8fb6e8c832cba
-
-The license details on the textures from the site is basically
-royalty-free for the example use we are making of it. Consult the
-license agreement for the full details:
-
-http://www.cgtextures.com/content.php?action=license
diff --git a/examples/qt3d/basket/basket.desktop b/examples/qt3d/basket/basket.desktop
deleted file mode 100644
index 3d16c486..00000000
--- a/examples/qt3d/basket/basket.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=Basket
-Icon=/usr/share/icons/hicolor/80x80/apps/qt3d.png
-Exec=/usr/bin/invoker --type=e -s /usr/bin/basket -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_basket
diff --git a/examples/qt3d/basket/basket.jpg b/examples/qt3d/basket/basket.jpg
deleted file mode 100644
index c292a83d..00000000
--- a/examples/qt3d/basket/basket.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/qt3d/basket/basket.pro b/examples/qt3d/basket/basket.pro
deleted file mode 100644
index f3659e8c..00000000
--- a/examples/qt3d/basket/basket.pro
+++ /dev/null
@@ -1,16 +0,0 @@
-TEMPLATE = app
-TARGET = basket
-CONFIG += qt warn_on
-
-CONFIG += qt3d_deploy_pkg
-include(../../../pkg.pri)
-
-SOURCES = basketview.cpp main.cpp
-HEADERS = basketview.h basket_data.h
-RESOURCES = basket.qrc
-
-OTHER_FILES += \
- basket.rc \
- basket.desktop
-
-RC_FILE = basket.rc
diff --git a/examples/qt3d/basket/basket.qrc b/examples/qt3d/basket/basket.qrc
deleted file mode 100644
index 590b65c7..00000000
--- a/examples/qt3d/basket/basket.qrc
+++ /dev/null
@@ -1,5 +0,0 @@
-<!DOCTYPE RCC><RCC version="1.0">
-<qresource>
- <file>basket.jpg</file>
-</qresource>
-</RCC>
diff --git a/examples/qt3d/basket/basket.rc b/examples/qt3d/basket/basket.rc
deleted file mode 100644
index b40ecdc1..00000000
--- a/examples/qt3d/basket/basket.rc
+++ /dev/null
@@ -1 +0,0 @@
-IDI_ICON1 ICON DISCARDABLE "qt3d.ico"
diff --git a/examples/qt3d/basket/basket_data.h b/examples/qt3d/basket/basket_data.h
deleted file mode 100644
index d456a692..00000000
--- a/examples/qt3d/basket/basket_data.h
+++ /dev/null
@@ -1,404 +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$
-**
-****************************************************************************/
-
-#ifndef BASKET_DATA_H
-#define BASKET_DATA_H
-
-#include "qglbezierpatches.h"
-
-// Generated from basket_data.txt by meshcvt, depth = 4
-
-#define BasketBezierVertexCount 306
-#define BasketPatchCount 24
-#define BasketDepth 4
-static float const BasketBezierVertexData[] = {
- 0.700000f, 0.450000f, -0.000000f,
- 0.700000f, 0.450000f, 0.392000f,
- 0.392000f, 0.450000f, 0.700000f,
- 0.000000f, 0.450000f, 0.700000f,
- 0.668750f, 0.515625f, -0.000000f,
- 0.668750f, 0.515625f, 0.374500f,
- 0.374500f, 0.515625f, 0.668750f,
- 0.000000f, 0.515625f, 0.668750f,
- 0.718750f, 0.515625f, -0.000000f,
- 0.718750f, 0.515625f, 0.402500f,
- 0.402500f, 0.515625f, 0.718750f,
- 0.000000f, 0.515625f, 0.718750f,
- 0.750000f, 0.450000f, -0.000000f,
- 0.750000f, 0.450000f, 0.420000f,
- 0.420000f, 0.450000f, 0.750000f,
- 0.000000f, 0.450000f, 0.750000f,
- -0.392000f, 0.450000f, 0.700000f,
- -0.700000f, 0.450000f, 0.392000f,
- -0.700000f, 0.450000f, -0.000000f,
- -0.374500f, 0.515625f, 0.668750f,
- -0.668750f, 0.515625f, 0.374500f,
- -0.668750f, 0.515625f, -0.000000f,
- -0.402500f, 0.515625f, 0.718750f,
- -0.718750f, 0.515625f, 0.402500f,
- -0.718750f, 0.515625f, -0.000000f,
- -0.420000f, 0.450000f, 0.750000f,
- -0.750000f, 0.450000f, 0.420000f,
- -0.750000f, 0.450000f, -0.000000f,
- -0.700000f, 0.450000f, -0.392000f,
- -0.392000f, 0.450000f, -0.700000f,
- 0.000000f, 0.450000f, -0.700000f,
- -0.668750f, 0.515625f, -0.374500f,
- -0.374500f, 0.515625f, -0.668750f,
- 0.000000f, 0.515625f, -0.668750f,
- -0.718750f, 0.515625f, -0.402500f,
- -0.402500f, 0.515625f, -0.718750f,
- 0.000000f, 0.515625f, -0.718750f,
- -0.750000f, 0.450000f, -0.420000f,
- -0.420000f, 0.450000f, -0.750000f,
- 0.000000f, 0.450000f, -0.750000f,
- 0.392000f, 0.450000f, -0.700000f,
- 0.700000f, 0.450000f, -0.392000f,
- 0.374500f, 0.515625f, -0.668750f,
- 0.668750f, 0.515625f, -0.374500f,
- 0.402500f, 0.515625f, -0.718750f,
- 0.718750f, 0.515625f, -0.402500f,
- 0.420000f, 0.450000f, -0.750000f,
- 0.750000f, 0.450000f, -0.420000f,
- 0.875000f, 0.187500f, -0.000000f,
- 0.875000f, 0.187500f, 0.490000f,
- 0.490000f, 0.187500f, 0.875000f,
- 0.000000f, 0.187500f, 0.875000f,
- 1.000000f, -0.075000f, -0.000000f,
- 1.000000f, -0.075000f, 0.560000f,
- 0.560000f, -0.075000f, 1.000000f,
- 0.000000f, -0.075000f, 1.000000f,
- 1.000000f, -0.300000f, -0.000000f,
- 1.000000f, -0.300000f, 0.560000f,
- 0.560000f, -0.300000f, 1.000000f,
- 0.000000f, -0.300000f, 1.000000f,
- -0.490000f, 0.187500f, 0.875000f,
- -0.875000f, 0.187500f, 0.490000f,
- -0.875000f, 0.187500f, -0.000000f,
- -0.560000f, -0.075000f, 1.000000f,
- -1.000000f, -0.075000f, 0.560000f,
- -1.000000f, -0.075000f, -0.000000f,
- -0.560000f, -0.300000f, 1.000000f,
- -1.000000f, -0.300000f, 0.560000f,
- -1.000000f, -0.300000f, -0.000000f,
- -0.875000f, 0.187500f, -0.490000f,
- -0.490000f, 0.187500f, -0.875000f,
- 0.000000f, 0.187500f, -0.875000f,
- -1.000000f, -0.075000f, -0.560000f,
- -0.560000f, -0.075000f, -1.000000f,
- 0.000000f, -0.075000f, -1.000000f,
- -1.000000f, -0.300000f, -0.560000f,
- -0.560000f, -0.300000f, -1.000000f,
- 0.000000f, -0.300000f, -1.000000f,
- 0.490000f, 0.187500f, -0.875000f,
- 0.875000f, 0.187500f, -0.490000f,
- 0.560000f, -0.075000f, -1.000000f,
- 1.000000f, -0.075000f, -0.560000f,
- 0.560000f, -0.300000f, -1.000000f,
- 1.000000f, -0.300000f, -0.560000f,
- 1.000000f, -0.525000f, -0.000000f,
- 1.000000f, -0.525000f, 0.560000f,
- 0.560000f, -0.525000f, 1.000000f,
- 0.000000f, -0.525000f, 1.000000f,
- 0.750000f, -0.637500f, -0.000000f,
- 0.750000f, -0.637500f, 0.420000f,
- 0.420000f, -0.637500f, 0.750000f,
- 0.000000f, -0.637500f, 0.750000f,
- 0.750000f, -0.675000f, -0.000000f,
- 0.750000f, -0.675000f, 0.420000f,
- 0.420000f, -0.675000f, 0.750000f,
- 0.000000f, -0.675000f, 0.750000f,
- -0.560000f, -0.525000f, 1.000000f,
- -1.000000f, -0.525000f, 0.560000f,
- -1.000000f, -0.525000f, -0.000000f,
- -0.420000f, -0.637500f, 0.750000f,
- -0.750000f, -0.637500f, 0.420000f,
- -0.750000f, -0.637500f, -0.000000f,
- -0.420000f, -0.675000f, 0.750000f,
- -0.750000f, -0.675000f, 0.420000f,
- -0.750000f, -0.675000f, -0.000000f,
- -1.000000f, -0.525000f, -0.560000f,
- -0.560000f, -0.525000f, -1.000000f,
- 0.000000f, -0.525000f, -1.000000f,
- -0.750000f, -0.637500f, -0.420000f,
- -0.420000f, -0.637500f, -0.750000f,
- 0.000000f, -0.637500f, -0.750000f,
- -0.750000f, -0.675000f, -0.420000f,
- -0.420000f, -0.675000f, -0.750000f,
- 0.000000f, -0.675000f, -0.750000f,
- 0.560000f, -0.525000f, -1.000000f,
- 1.000000f, -0.525000f, -0.560000f,
- 0.420000f, -0.637500f, -0.750000f,
- 0.750000f, -0.637500f, -0.420000f,
- 0.420000f, -0.675000f, -0.750000f,
- 0.750000f, -0.675000f, -0.420000f,
- -0.800000f, 0.262500f, -0.000000f,
- -0.800000f, 0.262500f, 0.150000f,
- -0.750000f, 0.375000f, 0.150000f,
- -0.750000f, 0.375000f, -0.000000f,
- -1.150000f, 0.262500f, -0.000000f,
- -1.150000f, 0.262500f, 0.150000f,
- -1.250000f, 0.375000f, 0.150000f,
- -1.250000f, 0.375000f, -0.000000f,
- -1.350000f, 0.262500f, -0.000000f,
- -1.350000f, 0.262500f, 0.150000f,
- -1.500000f, 0.375000f, 0.150000f,
- -1.500000f, 0.375000f, -0.000000f,
- -1.350000f, 0.150000f, -0.000000f,
- -1.350000f, 0.150000f, 0.150000f,
- -1.500000f, 0.150000f, 0.150000f,
- -1.500000f, 0.150000f, -0.000000f,
- -0.750000f, 0.375000f, -0.150000f,
- -0.800000f, 0.262500f, -0.150000f,
- -1.250000f, 0.375000f, -0.150000f,
- -1.150000f, 0.262500f, -0.150000f,
- -1.500000f, 0.375000f, -0.150000f,
- -1.350000f, 0.262500f, -0.150000f,
- -1.500000f, 0.150000f, -0.150000f,
- -1.350000f, 0.150000f, -0.150000f,
- -1.350000f, 0.037500f, -0.000000f,
- -1.350000f, 0.037500f, 0.150000f,
- -1.500000f, -0.075000f, 0.150000f,
- -1.500000f, -0.075000f, -0.000000f,
- -1.250000f, -0.187500f, -0.000000f,
- -1.250000f, -0.187500f, 0.150000f,
- -1.325000f, -0.281250f, 0.150000f,
- -1.325000f, -0.281250f, -0.000000f,
- -1.000000f, -0.300000f, 0.150000f,
- -0.950000f, -0.450000f, 0.150000f,
- -0.950000f, -0.450000f, -0.000000f,
- -1.500000f, -0.075000f, -0.150000f,
- -1.350000f, 0.037500f, -0.150000f,
- -1.325000f, -0.281250f, -0.150000f,
- -1.250000f, -0.187500f, -0.150000f,
- -0.950000f, -0.450000f, -0.150000f,
- -1.000000f, -0.300000f, -0.150000f,
- 0.850000f, -0.037500f, -0.000000f,
- 0.850000f, -0.037500f, 0.330000f,
- 0.850000f, -0.450000f, 0.330000f,
- 0.850000f, -0.450000f, -0.000000f,
- 1.300000f, -0.037500f, -0.000000f,
- 1.300000f, -0.037500f, 0.330000f,
- 1.550000f, -0.337500f, 0.330000f,
- 1.550000f, -0.337500f, -0.000000f,
- 1.150000f, 0.300000f, -0.000000f,
- 1.150000f, 0.300000f, 0.125000f,
- 1.200000f, 0.262500f, 0.125000f,
- 1.200000f, 0.262500f, -0.000000f,
- 1.350000f, 0.450000f, -0.000000f,
- 1.350000f, 0.450000f, 0.125000f,
- 1.650000f, 0.450000f, 0.125000f,
- 1.650000f, 0.450000f, -0.000000f,
- 0.850000f, -0.450000f, -0.330000f,
- 0.850000f, -0.037500f, -0.330000f,
- 1.550000f, -0.337500f, -0.330000f,
- 1.300000f, -0.037500f, -0.330000f,
- 1.200000f, 0.262500f, -0.125000f,
- 1.150000f, 0.300000f, -0.125000f,
- 1.650000f, 0.450000f, -0.125000f,
- 1.350000f, 0.450000f, -0.125000f,
- 1.400000f, 0.487500f, -0.000000f,
- 1.400000f, 0.487500f, 0.125000f,
- 1.762500f, 0.496875f, 0.125000f,
- 1.762500f, 0.496875f, -0.000000f,
- 1.450000f, 0.487500f, -0.000000f,
- 1.450000f, 0.487500f, 0.075000f,
- 1.725000f, 0.506250f, 0.075000f,
- 1.725000f, 0.506250f, -0.000000f,
- 1.400000f, 0.450000f, -0.000000f,
- 1.400000f, 0.450000f, 0.075000f,
- 1.600000f, 0.450000f, 0.075000f,
- 1.600000f, 0.450000f, -0.000000f,
- 1.762500f, 0.496875f, -0.125000f,
- 1.400000f, 0.487500f, -0.125000f,
- 1.725000f, 0.506250f, -0.075000f,
- 1.450000f, 0.487500f, -0.075000f,
- 1.600000f, 0.450000f, -0.075000f,
- 1.400000f, 0.450000f, -0.075000f,
- 0.000000f, 0.825000f, -0.000000f,
- 0.000000f, 0.825000f, 0.001000f,
- 0.001000f, 0.825000f, -0.000000f,
- 0.400000f, 0.825000f, -0.000000f,
- 0.400000f, 0.825000f, 0.225000f,
- 0.225000f, 0.825000f, 0.400000f,
- 0.000000f, 0.825000f, 0.400000f,
- 0.000000f, 0.675000f, -0.000000f,
- 0.100000f, 0.600000f, -0.000000f,
- 0.100000f, 0.600000f, 0.056000f,
- 0.056000f, 0.600000f, 0.100000f,
- 0.000000f, 0.600000f, 0.100000f,
- -0.001000f, 0.825000f, -0.000000f,
- -0.225000f, 0.825000f, 0.400000f,
- -0.400000f, 0.825000f, 0.225000f,
- -0.400000f, 0.825000f, -0.000000f,
- -0.056000f, 0.600000f, 0.100000f,
- -0.100000f, 0.600000f, 0.056000f,
- -0.100000f, 0.600000f, -0.000000f,
- 0.000000f, 0.825000f, -0.001000f,
- -0.400000f, 0.825000f, -0.225000f,
- -0.225000f, 0.825000f, -0.400000f,
- 0.000000f, 0.825000f, -0.400000f,
- -0.100000f, 0.600000f, -0.056000f,
- -0.056000f, 0.600000f, -0.100000f,
- 0.000000f, 0.600000f, -0.100000f,
- 0.225000f, 0.825000f, -0.400000f,
- 0.400000f, 0.825000f, -0.225000f,
- 0.056000f, 0.600000f, -0.100000f,
- 0.100000f, 0.600000f, -0.056000f,
- 0.200000f, 0.525000f, -0.000000f,
- 0.200000f, 0.525000f, 0.112000f,
- 0.112000f, 0.525000f, 0.200000f,
- 0.000000f, 0.525000f, 0.200000f,
- 0.650000f, 0.525000f, -0.000000f,
- 0.650000f, 0.525000f, 0.364000f,
- 0.364000f, 0.525000f, 0.650000f,
- 0.000000f, 0.525000f, 0.650000f,
- 0.650000f, 0.450000f, -0.000000f,
- 0.650000f, 0.450000f, 0.364000f,
- 0.364000f, 0.450000f, 0.650000f,
- 0.000000f, 0.450000f, 0.650000f,
- -0.112000f, 0.525000f, 0.200000f,
- -0.200000f, 0.525000f, 0.112000f,
- -0.200000f, 0.525000f, -0.000000f,
- -0.364000f, 0.525000f, 0.650000f,
- -0.650000f, 0.525000f, 0.364000f,
- -0.650000f, 0.525000f, -0.000000f,
- -0.364000f, 0.450000f, 0.650000f,
- -0.650000f, 0.450000f, 0.364000f,
- -0.650000f, 0.450000f, -0.000000f,
- -0.200000f, 0.525000f, -0.112000f,
- -0.112000f, 0.525000f, -0.200000f,
- 0.000000f, 0.525000f, -0.200000f,
- -0.650000f, 0.525000f, -0.364000f,
- -0.364000f, 0.525000f, -0.650000f,
- 0.000000f, 0.525000f, -0.650000f,
- -0.650000f, 0.450000f, -0.364000f,
- -0.364000f, 0.450000f, -0.650000f,
- 0.000000f, 0.450000f, -0.650000f,
- 0.112000f, 0.525000f, -0.200000f,
- 0.200000f, 0.525000f, -0.112000f,
- 0.364000f, 0.525000f, -0.650000f,
- 0.650000f, 0.525000f, -0.364000f,
- 0.364000f, 0.450000f, -0.650000f,
- 0.650000f, 0.450000f, -0.364000f,
- 0.000000f, -0.750000f, -0.000000f,
- 0.750000f, -0.675000f, -0.000000f,
- 0.750000f, -0.675000f, -0.420000f,
- 0.420000f, -0.675000f, -0.750000f,
- 0.000000f, -0.675000f, -0.750000f,
- 0.750000f, -0.712500f, -0.000000f,
- 0.750000f, -0.712500f, -0.420000f,
- 0.420000f, -0.712500f, -0.750000f,
- 0.000000f, -0.712500f, -0.750000f,
- 0.712500f, -0.750000f, -0.000000f,
- 0.712500f, -0.750000f, -0.399000f,
- 0.399000f, -0.750000f, -0.712500f,
- 0.000000f, -0.750000f, -0.712500f,
- -0.420000f, -0.675000f, -0.750000f,
- -0.750000f, -0.675000f, -0.420000f,
- -0.750000f, -0.675000f, -0.000000f,
- -0.420000f, -0.712500f, -0.750000f,
- -0.750000f, -0.712500f, -0.420000f,
- -0.750000f, -0.712500f, -0.000000f,
- -0.399000f, -0.750000f, -0.712500f,
- -0.712500f, -0.750000f, -0.399000f,
- -0.712500f, -0.750000f, -0.000000f,
- -0.750000f, -0.675000f, 0.420000f,
- -0.420000f, -0.675000f, 0.750000f,
- 0.000000f, -0.675000f, 0.750000f,
- -0.750000f, -0.712500f, 0.420000f,
- -0.420000f, -0.712500f, 0.750000f,
- 0.000000f, -0.712500f, 0.750000f,
- -0.712500f, -0.750000f, 0.399000f,
- -0.399000f, -0.750000f, 0.712500f,
- 0.000000f, -0.750000f, 0.712500f,
- 0.420000f, -0.675000f, 0.750000f,
- 0.750000f, -0.675000f, 0.420000f,
- 0.420000f, -0.712500f, 0.750000f,
- 0.750000f, -0.712500f, 0.420000f,
- 0.399000f, -0.750000f, 0.712500f,
- 0.712500f, -0.750000f, 0.399000f
-};
-
-static ushort const BasketPatchData[] = {
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
- 3, 16, 17, 18, 7, 19, 20, 21, 11, 22, 23, 24, 15, 25, 26, 27,
- 18, 28, 29, 30, 21, 31, 32, 33, 24, 34, 35, 36, 27, 37, 38, 39,
- 30, 40, 41, 0, 33, 42, 43, 4, 36, 44, 45, 8, 39, 46, 47, 12,
- 12, 13, 14, 15, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
- 15, 25, 26, 27, 51, 60, 61, 62, 55, 63, 64, 65, 59, 66, 67, 68,
- 27, 37, 38, 39, 62, 69, 70, 71, 65, 72, 73, 74, 68, 75, 76, 77,
- 39, 46, 47, 12, 71, 78, 79, 48, 74, 80, 81, 52, 77, 82, 83, 56,
- 56, 57, 58, 59, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
- 59, 66, 67, 68, 87, 96, 97, 98, 91, 99, 100, 101, 95, 102, 103, 104,
- 68, 75, 76, 77, 98, 105, 106, 107, 101, 108, 109, 110, 104, 111, 112, 113,
- 77, 82, 83, 56, 107, 114, 115, 84, 110, 116, 117, 88, 113, 118, 119, 92,
- 203, 203, 203, 203, 206, 207, 208, 209, 210, 210, 210, 210, 211, 212, 213, 214,
- 203, 203, 203, 203, 209, 216, 217, 218, 210, 210, 210, 210, 214, 219, 220, 221,
- 203, 203, 203, 203, 218, 223, 224, 225, 210, 210, 210, 210, 221, 226, 227, 228,
- 203, 203, 203, 203, 225, 229, 230, 206, 210, 210, 210, 210, 228, 231, 232, 211,
- 211, 212, 213, 214, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244,
- 214, 219, 220, 221, 236, 245, 246, 247, 240, 248, 249, 250, 244, 251, 252, 253,
- 221, 226, 227, 228, 247, 254, 255, 256, 250, 257, 258, 259, 253, 260, 261, 262,
- 228, 231, 232, 211, 256, 263, 264, 233, 259, 265, 266, 237, 262, 267, 268, 241,
- 269, 269, 269, 269, 278, 279, 280, 281, 274, 275, 276, 277, 270, 271, 272, 273,
- 269, 269, 269, 269, 281, 288, 289, 290, 277, 285, 286, 287, 273, 282, 283, 284,
- 269, 269, 269, 269, 290, 297, 298, 299, 287, 294, 295, 296, 284, 291, 292, 293,
- 269, 269, 269, 269, 299, 304, 305, 278, 296, 302, 303, 274, 293, 300, 301, 270
-};
-
-class BasketPatches : public QGLBezierPatches
-{
-public:
- BasketPatches()
- {
- QVector3DArray positions;
- for (int pindex = 0; pindex < BasketPatchCount * 16; ++pindex) {
- int vindex = BasketPatchData[pindex];
- positions.append(BasketBezierVertexData[vindex * 3],
- BasketBezierVertexData[vindex * 3 + 1],
- BasketBezierVertexData[vindex * 3 + 2]);
- }
- setPositions(positions);
- setSubdivisionDepth(BasketDepth);
- }
-};
-
-#endif
diff --git a/examples/qt3d/basket/basket_data.txt b/examples/qt3d/basket/basket_data.txt
deleted file mode 100644
index 6b693b5a..00000000
--- a/examples/qt3d/basket/basket_data.txt
+++ /dev/null
@@ -1,332 +0,0 @@
-24
-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
-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
-1.4,0.0,2.4
-1.4,-0.784,2.4
-0.784,-1.4,2.4
-0.0,-1.4,2.4
-1.3375,0.0,2.53125
-1.3375,-0.749,2.53125
-0.749,-1.3375,2.53125
-0.0,-1.3375,2.53125
-1.4375,0.0,2.53125
-1.4375,-0.805,2.53125
-0.805,-1.4375,2.53125
-0.0,-1.4375,2.53125
-1.5,0.0,2.4
-1.5,-0.84,2.4
-0.84,-1.5,2.4
-0.0,-1.5,2.4
--0.784,-1.4,2.4
--1.4,-0.784,2.4
--1.4,0.0,2.4
--0.749,-1.3375,2.53125
--1.3375,-0.749,2.53125
--1.3375,0.0,2.53125
--0.805,-1.4375,2.53125
--1.4375,-0.805,2.53125
--1.4375,0.0,2.53125
--0.84,-1.5,2.4
--1.5,-0.84,2.4
--1.5,0.0,2.4
--1.4,0.784,2.4
--0.784,1.4,2.4
-0.0,1.4,2.4
--1.3375,0.749,2.53125
--0.749,1.3375,2.53125
-0.0,1.3375,2.53125
--1.4375,0.805,2.53125
--0.805,1.4375,2.53125
-0.0,1.4375,2.53125
--1.5,0.84,2.4
--0.84,1.5,2.4
-0.0,1.5,2.4
-0.784,1.4,2.4
-1.4,0.784,2.4
-0.749,1.3375,2.53125
-1.3375,0.749,2.53125
-0.805,1.4375,2.53125
-1.4375,0.805,2.53125
-0.84,1.5,2.4
-1.5,0.84,2.4
-1.75,0.0,1.875
-1.75,-0.98,1.875
-0.98,-1.75,1.875
-0.0,-1.75,1.875
-2.0,0.0,1.35
-2.0,-1.12,1.35
-1.12,-2.0,1.35
-0.0,-2.0,1.35
-2.0,0.0,0.9
-2.0,-1.12,0.9
-1.12,-2.0,0.9
-0.0,-2.0,0.9
--0.98,-1.75,1.875
--1.75,-0.98,1.875
--1.75,0.0,1.875
--1.12,-2.0,1.35
--2.0,-1.12,1.35
--2.0,0.0,1.35
--1.12,-2.0,0.9
--2.0,-1.12,0.9
--2.0,0.0,0.9
--1.75,0.98,1.875
--0.98,1.75,1.875
-0.0,1.75,1.875
--2.0,1.12,1.35
--1.12,2.0,1.35
-0.0,2.0,1.35
--2.0,1.12,0.9
--1.12,2.0,0.9
-0.0,2.0,0.9
-0.98,1.75,1.875
-1.75,0.98,1.875
-1.12,2.0,1.35
-2.0,1.12,1.35
-1.12,2.0,0.9
-2.0,1.12,0.9
-2.0,0.0,0.45
-2.0,-1.12,0.45
-1.12,-2.0,0.45
-0.0,-2.0,0.45
-1.5,0.0,0.225
-1.5,-0.84,0.225
-0.84,-1.5,0.225
-0.0,-1.5,0.225
-1.5,0.0,0.15
-1.5,-0.84,0.15
-0.84,-1.5,0.15
-0.0,-1.5,0.15
--1.12,-2.0,0.45
--2.0,-1.12,0.45
--2.0,0.0,0.45
--0.84,-1.5,0.225
--1.5,-0.84,0.225
--1.5,0.0,0.225
--0.84,-1.5,0.15
--1.5,-0.84,0.15
--1.5,0.0,0.15
--2.0,1.12,0.45
--1.12,2.0,0.45
-0.0,2.0,0.45
--1.5,0.84,0.225
--0.84,1.5,0.225
-0.0,1.5,0.225
--1.5,0.84,0.15
--0.84,1.5,0.15
-0.0,1.5,0.15
-1.12,2.0,0.45
-2.0,1.12,0.45
-0.84,1.5,0.225
-1.5,0.84,0.225
-0.84,1.5,0.15
-1.5,0.84,0.15
--1.6,0.0,2.025
--1.6,-0.3,2.025
--1.5,-0.3,2.25
--1.5,0.0,2.25
--2.3,0.0,2.025
--2.3,-0.3,2.025
--2.5,-0.3,2.25
--2.5,0.0,2.25
--2.7,0.0,2.025
--2.7,-0.3,2.025
--3.0,-0.3,2.25
--3.0,0.0,2.25
--2.7,0.0,1.8
--2.7,-0.3,1.8
--3.0,-0.3,1.8
--3.0,0.0,1.8
--1.5,0.3,2.25
--1.6,0.3,2.025
--2.5,0.3,2.25
--2.3,0.3,2.025
--3.0,0.3,2.25
--2.7,0.3,2.025
--3.0,0.3,1.8
--2.7,0.3,1.8
--2.7,0.0,1.575
--2.7,-0.3,1.575
--3.0,-0.3,1.35
--3.0,0.0,1.35
--2.5,0.0,1.125
--2.5,-0.3,1.125
--2.65,-0.3,0.9375
--2.65,0.0,0.9375
--2.0,-0.3,0.9
--1.9,-0.3,0.6
--1.9,0.0,0.6
--3.0,0.3,1.35
--2.7,0.3,1.575
--2.65,0.3,0.9375
--2.5,0.3,1.125
--1.9,0.3,0.6
--2.0,0.3,0.9
-1.7,0.0,1.425
-1.7,-0.66,1.425
-1.7,-0.66,0.6
-1.7,0.0,0.6
-2.6,0.0,1.425
-2.6,-0.66,1.425
-3.1,-0.66,0.825
-3.1,0.0,0.825
-2.3,0.0,2.1
-2.3,-0.25,2.1
-2.4,-0.25,2.025
-2.4,0.0,2.025
-2.7,0.0,2.4
-2.7,-0.25,2.4
-3.3,-0.25,2.4
-3.3,0.0,2.4
-1.7,0.66,0.6
-1.7,0.66,1.425
-3.1,0.66,0.825
-2.6,0.66,1.425
-2.4,0.25,2.025
-2.3,0.25,2.1
-3.3,0.25,2.4
-2.7,0.25,2.4
-2.8,0.0,2.475
-2.8,-0.25,2.475
-3.525,-0.25,2.49375
-3.525,0.0,2.49375
-2.9,0.0,2.475
-2.9,-0.15,2.475
-3.45,-0.15,2.5125
-3.45,0.0,2.5125
-2.8,0.0,2.4
-2.8,-0.15,2.4
-3.2,-0.15,2.4
-3.2,0.0,2.4
-3.525,0.25,2.49375
-2.8,0.25,2.475
-3.45,0.15,2.5125
-2.9,0.15,2.475
-3.2,0.15,2.4
-2.8,0.15,2.4
-0.0,0.0,3.15
-0.0,-0.002,3.15
-0.002,0.0,3.15
-0.8,0.0,3.15
-0.8,-0.45,3.15
-0.45,-0.8,3.15
-0.0,-0.8,3.15
-0.0,0.0,2.85,0.0,0.0,1.0
-0.2,0.0,2.7
-0.2,-0.112,2.7
-0.112,-0.2,2.7
-0.0,-0.2,2.7
--0.002,0.0,3.15
--0.45,-0.8,3.15
--0.8,-0.45,3.15
--0.8,0.0,3.15
--0.112,-0.2,2.7
--0.2,-0.112,2.7
--0.2,0.0,2.7
-0.0,0.002,3.15
--0.8,0.45,3.15
--0.45,0.8,3.15
-0.0,0.8,3.15
--0.2,0.112,2.7
--0.112,0.2,2.7
-0.0,0.2,2.7
-0.45,0.8,3.15
-0.8,0.45,3.15
-0.112,0.2,2.7
-0.2,0.112,2.7
-0.4,0.0,2.55
-0.4,-0.224,2.55
-0.224,-0.4,2.55
-0.0,-0.4,2.55
-1.3,0.0,2.55
-1.3,-0.728,2.55
-0.728,-1.3,2.55
-0.0,-1.3,2.55
-1.3,0.0,2.4
-1.3,-0.728,2.4
-0.728,-1.3,2.4
-0.0,-1.3,2.4
--0.224,-0.4,2.55
--0.4,-0.224,2.55
--0.4,0.0,2.55
--0.728,-1.3,2.55
--1.3,-0.728,2.55
--1.3,0.0,2.55
--0.728,-1.3,2.4
--1.3,-0.728,2.4
--1.3,0.0,2.4
--0.4,0.224,2.55
--0.224,0.4,2.55
-0.0,0.4,2.55
--1.3,0.728,2.55
--0.728,1.3,2.55
-0.0,1.3,2.55
--1.3,0.728,2.4
--0.728,1.3,2.4
-0.0,1.3,2.4
-0.224,0.4,2.55
-0.4,0.224,2.55
-0.728,1.3,2.55
-1.3,0.728,2.55
-0.728,1.3,2.4
-1.3,0.728,2.4
-0.0,0.0,0.0,0.0,0.0,-1.0
-1.5,0.0,0.15
-1.5,0.84,0.15
-0.84,1.5,0.15
-0.0,1.5,0.15
-1.5,0.0,0.075
-1.5,0.84,0.075
-0.84,1.5,0.075
-0.0,1.5,0.075
-1.425,0.0,0.0
-1.425,0.798,0.0
-0.798,1.425,0.0
-0.0,1.425,0.0
--0.84,1.5,0.15
--1.5,0.84,0.15
--1.5,0.0,0.15
--0.84,1.5,0.075
--1.5,0.84,0.075
--1.5,0.0,0.075
--0.798,1.425,0.0
--1.425,0.798,0.0
--1.425,0.0,0.0
--1.5,-0.84,0.15
--0.84,-1.5,0.15
-0.0,-1.5,0.15
--1.5,-0.84,0.075
--0.84,-1.5,0.075
-0.0,-1.5,0.075
--1.425,-0.798,0.0
--0.798,-1.425,0.0
-0.0,-1.425,0.0
-0.84,-1.5,0.15
-1.5,-0.84,0.15
-0.84,-1.5,0.075
-1.5,-0.84,0.075
-0.798,-1.425,0.0
-1.425,-0.798,0.0
diff --git a/examples/qt3d/basket/basketview.cpp b/examples/qt3d/basket/basketview.cpp
deleted file mode 100644
index 41b20dfb..00000000
--- a/examples/qt3d/basket/basketview.cpp
+++ /dev/null
@@ -1,93 +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$
-**
-****************************************************************************/
-
-#include <QPropertyAnimation>
-
-#include "basketview.h"
-#include "basket_data.h"
-#include "qglbuilder.h"
-#include "qglscenenode.h"
-
-BasketView::BasketView(QWidget *parent)
- : QGLView(parent)
- , m_angle(0)
-{
- setWindowTitle(tr("Basket"));
-
-//! [1]
- QGLBuilder builder;
- builder << BasketPatches();
- basket = builder.finalizedSceneNode();
-
- QGLMaterial *mat = new QGLMaterial;
- QUrl url;
- url.setPath(QLatin1String(":/basket.jpg"));
- url.setScheme(QLatin1String("file"));
- mat->setTextureUrl(url);
- basket->setMaterial(mat);
- basket->setEffect(QGL::LitModulateTexture2D);
-//! [1]
-
-//! [2]
- QPropertyAnimation *animation;
- animation = new QPropertyAnimation(this, "angle", this);
- animation->setStartValue(0.0f);
- animation->setEndValue(360.0f);
- animation->setDuration(2000);
- animation->setLoopCount(-1);
- animation->start();
-//! [2]
-
- camera()->setEye(QVector3D(0, 4, 10));
-}
-
-BasketView::~BasketView()
-{
- delete basket;
-}
-
-//! [3]
-void BasketView::paintGL(QGLPainter *painter)
-{
- painter->modelViewMatrix().rotate(angle(), 0, 1, 0);
- painter->modelViewMatrix().scale(1.5f);
- basket->draw(painter);
-}
-//! [3]
diff --git a/examples/qt3d/basket/basketview.h b/examples/qt3d/basket/basketview.h
deleted file mode 100644
index 305b18c4..00000000
--- a/examples/qt3d/basket/basketview.h
+++ /dev/null
@@ -1,71 +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$
-**
-****************************************************************************/
-
-#ifndef BASKETVIEW_H
-#define BASKETVIEW_H
-
-#include "qglview.h"
-
-QT_BEGIN_NAMESPACE
-class QGLSceneNode;
-QT_END_NAMESPACE
-
-//! [1]
-class BasketView : public QGLView
-{
- Q_OBJECT
- Q_PROPERTY(qreal angle READ angle WRITE setAngle)
-public:
- qreal angle() const { return m_angle; }
- void setAngle(qreal angle) { m_angle = angle; update(); }
-//! [1]
-
- BasketView(QWidget *parent = 0);
- ~BasketView();
-
-protected:
- void paintGL(QGLPainter *painter);
-
-private:
- QGLSceneNode *basket;
- qreal m_angle;
-};
-
-#endif
diff --git a/examples/qt3d/basket/main.cpp b/examples/qt3d/basket/main.cpp
deleted file mode 100644
index 3963408c..00000000
--- a/examples/qt3d/basket/main.cpp
+++ /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$
-**
-****************************************************************************/
-
-#include <QApplication>
-#include "basketview.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
- BasketView view;
-
-#ifdef Q_OS_SYMBIAN
- view.setAttribute(Qt::WA_LockLandscapeOrientation, true);
- view.showFullScreen();
-#else
- if (view.stereoType() != QGLView::RedCyanAnaglyph)
- view.camera()->setEyeSeparation(0.3f);
- if (QApplication::arguments().contains(QLatin1String("-maximize")))
- view.showMaximized();
- else if (QApplication::arguments().contains(QLatin1String("-fullscreen")))
- view.showFullScreen();
- else
- view.show();
-#endif
- return app.exec();
-}
diff --git a/examples/qt3d/basket/qt3d.ico b/examples/qt3d/basket/qt3d.ico
deleted file mode 100644
index e6442baf..00000000
--- a/examples/qt3d/basket/qt3d.ico
+++ /dev/null
Binary files differ
diff --git a/examples/qt3d/basket/qt3d.png b/examples/qt3d/basket/qt3d.png
deleted file mode 100644
index 21ec0176..00000000
--- a/examples/qt3d/basket/qt3d.png
+++ /dev/null
Binary files differ
diff --git a/examples/qt3d/basket/teapot-logo.png b/examples/qt3d/basket/teapot-logo.png
deleted file mode 100644
index 3532b520..00000000
--- a/examples/qt3d/basket/teapot-logo.png
+++ /dev/null
Binary files differ
diff --git a/examples/qt3d/builder/builder.cpp b/examples/qt3d/builder/builder.cpp
deleted file mode 100644
index 3628b4d4..00000000
--- a/examples/qt3d/builder/builder.cpp
+++ /dev/null
@@ -1,192 +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$
-**
-****************************************************************************/
-
-#include "builder.h"
-#include "qglbuilder.h"
-#include "qglmaterialcollection.h"
-#include "qgltexture2d.h"
-#include "qglmaterial.h"
-#include "qglscenenode.h"
-#include "qgllightmodel.h"
-
-#include <QtGui/qmatrix4x4.h>
-
-#include <QtCore/qmath.h>
-
-BuilderView::BuilderView(QWidget *parent)
- : QGLView(parent)
- , canScene(new QGLSceneNode(this))
-{
- //! [0]
- QGLSceneNode *can = buildGeometry();
- canScene->addNode(can);
- {
- // rotate the can around so its label shows; and down
- // so the base is facing down
- QMatrix4x4 mat;
- QQuaternion q1 = QQuaternion::fromAxisAndAngle(1.0f, 0.0f, 0.0f, 270.0f);
- QQuaternion q2 = QQuaternion::fromAxisAndAngle(0.0f, 1.0f, 0.0f, 100.0f);
- mat.rotate(q2 * q1);
- can->setLocalTransform(mat);
- }
-
- // display a copy of the can to the left
- QGLSceneNode *node = new QGLSceneNode(canScene);
- node->addNode(can);
- {
- QMatrix4x4 mat;
- mat.translate(-2.0f, 0.0f, -2.0f);
- node->setLocalTransform(mat);
- }
-
- // display a copy of the can to the right
- node = new QGLSceneNode(canScene);
- node->addNode(can);
- {
- QMatrix4x4 mat;
- mat.translate(2.0f, 0.0f, -2.0f);
- node->setLocalTransform(mat);
- }
- //! [0]
-
- // rotate the whole scene about x-axis so that
- // can tops are visible when scene is first displayed
- {
- QMatrix4x4 mat;
- mat.rotate(1.0f, 0.0f, 0.0f, -30.0f);
- canScene->setLocalTransform(mat);
- }
-}
-
-BuilderView::~BuilderView()
-{
- delete canScene;
-}
-
-void BuilderView::initializeGL(QGLPainter *painter)
-{
- QGLLightParameters *light0 = new QGLLightParameters(this);
- light0->setAmbientColor(Qt::white);
- light0->setDiffuseColor(Qt::white);
- light0->setDirection(QVector3D(0.0f, 0.2f, 2.0f));
- painter->setMainLight(light0);
- QGLLightModel *model = new QGLLightModel(this);
- model->setAmbientSceneColor(Qt::white);
- painter->setLightModel(model);
-}
-
-//! [1]
-void BuilderView::paintGL(QGLPainter *painter)
-{
- canScene->draw(painter);
-}
-//! [1]
-
-QGLSceneNode *BuilderView::buildGeometry()
-{
- //! [2]
- QGLBuilder builder;
- QGLSceneNode *root = builder.sceneNode();
-
- QGLMaterial *mat = new QGLMaterial;
- mat->setAmbientColor(Qt::lightGray);
- mat->setDiffuseColor(Qt::lightGray);
- QUrl url;
- url.setPath(QLatin1String(":/images/qt-soup.png"));
- url.setScheme(QLatin1String("file"));
- mat->setTextureUrl(url);
- int canMat = root->palette()->addMaterial(mat);
- root->setMaterialIndex(canMat);
- root->setEffect(QGL::LitMaterial);
- //! [2]
-
- // size data for can
- const qreal canRadius = 1.0f;
- const qreal canHeight = 2.5f;
- const int numSlices = 32;
-
- QGeometryData canRim;
- QVector3D canExtrudeVec(0.0f, 0.0f, -canHeight);
-
- // do the math for the defining points
- for (int i = 0; i < numSlices; ++i)
- {
- qreal angle = (qreal(i) * 2.0 * M_PI) / numSlices;
- canRim.appendVertex(QVector3D(canRadius * qCos(angle),
- canRadius * qSin(angle),
- canHeight / 2.0f));
- }
-
- //! [3]
- // create the flat top lid of the can
- builder.newSection();
- builder.currentNode()->setObjectName(QLatin1String("CanTop"));
- QGeometryData top;
- top.appendVertex(canRim.center());
- top.appendVertexArray(canRim.vertices());
- builder.addTriangulatedFace(top);
-
- // create the sides of the can
- builder.newSection();
- builder.currentNode()->setObjectName(QLatin1String("CanSides"));
- builder.currentNode()->setMaterialIndex(canMat);
- builder.currentNode()->setEffect(QGL::LitModulateTexture2D);
- QGeometryData canTop = canRim;
- canTop.detach();
- canTop.appendVertex(canTop.vertex(0)); // doubled vert for texture seam
- canTop.generateTextureCoordinates(); // generate x texture coords
- QGeometryData canBase = canTop.translated(canExtrudeVec); // base has tex.y == 0
- for (int i = 0; i < canTop.count(); ++i)
- canTop.texCoord(i).setY(1.0); // top has tex.y == 1
- builder.addQuadsInterleaved(canTop, canBase);
-
- // create the flat bottom lid of the can
- builder.newSection();
- builder.currentNode()->setObjectName(QLatin1String("CanBottom"));
- builder.currentNode()->setEffect(QGL::LitMaterial);
- QGeometryData rimReversed = canRim.translated(canExtrudeVec).reversed();
- QGeometryData canBottom;
- canBottom.appendVertex(rimReversed.center());
- canBottom.appendVertexArray(rimReversed.vertices());
- builder.addTriangulatedFace(canBottom);
-
- return builder.finalizedSceneNode();
- //! [3]
-}
diff --git a/examples/qt3d/builder/builder.desktop b/examples/qt3d/builder/builder.desktop
deleted file mode 100644
index da231ad1..00000000
--- a/examples/qt3d/builder/builder.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=Builder
-Icon=/usr/share/icons/hicolor/80x80/apps/qt3d.png
-Exec=/usr/bin/invoker --type=e -s /usr/bin/builder -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_builder
diff --git a/examples/qt3d/builder/builder.h b/examples/qt3d/builder/builder.h
deleted file mode 100644
index 01df7d87..00000000
--- a/examples/qt3d/builder/builder.h
+++ /dev/null
@@ -1,68 +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$
-**
-****************************************************************************/
-
-#ifndef BUILDER_H
-#define BUILDER_H
-
-#include "qglview.h"
-
-QT_BEGIN_NAMESPACE
-class QGLSceneNode;
-class QGLBuilder;
-QT_END_NAMESPACE
-
-class BuilderView : public QGLView
-{
- Q_OBJECT
-public:
- BuilderView(QWidget *parent = 0);
- ~BuilderView();
-
-protected:
- void initializeGL(QGLPainter *painter);
- void paintGL(QGLPainter *painter);
-
-private:
- QGLSceneNode *buildGeometry();
-
- QGLSceneNode *canScene;
-};
-
-#endif
diff --git a/examples/qt3d/builder/builder.pro b/examples/qt3d/builder/builder.pro
deleted file mode 100644
index aaa1e5d8..00000000
--- a/examples/qt3d/builder/builder.pro
+++ /dev/null
@@ -1,17 +0,0 @@
-TEMPLATE = app
-TARGET = builder
-CONFIG += qt warn_on
-
-CONFIG += qt3d_deploy_pkg
-include(../../../pkg.pri)
-
-SOURCES = builder.cpp \
- main.cpp
-HEADERS = builder.h
-RESOURCES += builder.qrc
-
-OTHER_FILES += \
- builder.rc \
- builder.desktop
-
-RC_FILE = builder.rc
diff --git a/examples/qt3d/builder/builder.qrc b/examples/qt3d/builder/builder.qrc
deleted file mode 100644
index 8eefbaf1..00000000
--- a/examples/qt3d/builder/builder.qrc
+++ /dev/null
@@ -1,5 +0,0 @@
-<RCC>
- <qresource prefix="/images" >
- <file>qt-soup.png</file>
- </qresource>
-</RCC>
diff --git a/examples/qt3d/builder/builder.rc b/examples/qt3d/builder/builder.rc
deleted file mode 100644
index b40ecdc1..00000000
--- a/examples/qt3d/builder/builder.rc
+++ /dev/null
@@ -1 +0,0 @@
-IDI_ICON1 ICON DISCARDABLE "qt3d.ico"
diff --git a/examples/qt3d/builder/main.cpp b/examples/qt3d/builder/main.cpp
deleted file mode 100644
index 29e9f1e6..00000000
--- a/examples/qt3d/builder/main.cpp
+++ /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$
-**
-****************************************************************************/
-
-#include <QApplication>
-
-#include "builder.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
- BuilderView view;
-#ifdef Q_OS_SYMBIAN
- view.setAttribute(Qt::WA_LockLandscapeOrientation, true);
- view.showFullScreen();
-#else
- if (view.stereoType() != QGLView::RedCyanAnaglyph)
- view.camera()->setEyeSeparation(0.3f);
- if (QApplication::arguments().contains(QLatin1String("-maximize")))
- view.showMaximized();
- else if (QApplication::arguments().contains(QLatin1String("-fullscreen")))
- view.showFullScreen();
- else
- view.show();
-#endif
- return app.exec();
-}
diff --git a/examples/qt3d/builder/qt-soup.png b/examples/qt3d/builder/qt-soup.png
deleted file mode 100644
index 5b264fff..00000000
--- a/examples/qt3d/builder/qt-soup.png
+++ /dev/null
Binary files differ
diff --git a/examples/qt3d/builder/qt3d.ico b/examples/qt3d/builder/qt3d.ico
deleted file mode 100644
index e6442baf..00000000
--- a/examples/qt3d/builder/qt3d.ico
+++ /dev/null
Binary files differ
diff --git a/examples/qt3d/builder/qt3d.png b/examples/qt3d/builder/qt3d.png
deleted file mode 100644
index 21ec0176..00000000
--- a/examples/qt3d/builder/qt3d.png
+++ /dev/null
Binary files differ
diff --git a/examples/qt3d/cube/cube.desktop b/examples/qt3d/cube/cube.desktop
deleted file mode 100644
index 8610bf06..00000000
--- a/examples/qt3d/cube/cube.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=cube Qt3D
-Icon=/usr/share/icons/hicolor/80x80/apps/qt3d.png
-Exec=/usr/bin/invoker --type=e -s /usr/bin/cube -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_cube
diff --git a/examples/qt3d/cube/cube.pro b/examples/qt3d/cube/cube.pro
deleted file mode 100644
index a91ed947..00000000
--- a/examples/qt3d/cube/cube.pro
+++ /dev/null
@@ -1,17 +0,0 @@
-TEMPLATE = app
-TARGET = cube
-CONFIG += qt warn_on
-
-CONFIG += qt3d_deploy_pkg
-include(../../../pkg.pri)
-
-SOURCES = cubeview.cpp main.cpp
-HEADERS = cubeview.h
-RESOURCES = cube.qrc
-
-OTHER_FILES += \
- cube.rc \
- cube.desktop
-
-RC_FILE = cube.rc
-
diff --git a/examples/qt3d/cube/cube.qrc b/examples/qt3d/cube/cube.qrc
deleted file mode 100644
index 70f5024d..00000000
--- a/examples/qt3d/cube/cube.qrc
+++ /dev/null
@@ -1,5 +0,0 @@
-<!DOCTYPE RCC><RCC version="1.0">
-<qresource>
- <file>qtlogo.png</file>
-</qresource>
-</RCC>
diff --git a/examples/qt3d/cube/cube.rc b/examples/qt3d/cube/cube.rc
deleted file mode 100644
index b40ecdc1..00000000
--- a/examples/qt3d/cube/cube.rc
+++ /dev/null
@@ -1 +0,0 @@
-IDI_ICON1 ICON DISCARDABLE "qt3d.ico"
diff --git a/examples/qt3d/cube/cubeview.cpp b/examples/qt3d/cube/cubeview.cpp
deleted file mode 100644
index e8de7516..00000000
--- a/examples/qt3d/cube/cubeview.cpp
+++ /dev/null
@@ -1,74 +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$
-**
-****************************************************************************/
-
-#include "cubeview.h"
-#include "qglbuilder.h"
-#include "qglcube.h"
-
-#include <QtCore/qurl.h>
-
-CubeView::CubeView(QWidget *parent)
- : QGLView(parent)
-{
- QGLBuilder builder;
- builder << QGL::Faceted << QGLCube(1.5f);
- cube = builder.finalizedSceneNode();
-
- QGLMaterial *mat = new QGLMaterial;
- mat->setColor(QColor(170, 202, 0));
- QUrl url;
- url.setPath(QLatin1String(":/qtlogo.png"));
- url.setScheme(QLatin1String("file"));
- mat->setTextureUrl(url);
- cube->setMaterial(mat);
-
- cube->setEffect(QGL::LitDecalTexture2D);
-}
-
-CubeView::~CubeView()
-{
- delete cube;
-}
-
-void CubeView::paintGL(QGLPainter *painter)
-{
- painter->modelViewMatrix().rotate(45.0f, 1.0f, 1.0f, 1.0f);
- cube->draw(painter);
-}
diff --git a/examples/qt3d/cube/cubeview.h b/examples/qt3d/cube/cubeview.h
deleted file mode 100644
index 7398bdf5..00000000
--- a/examples/qt3d/cube/cubeview.h
+++ /dev/null
@@ -1,64 +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$
-**
-****************************************************************************/
-
-#ifndef CUBEVIEW_H
-#define CUBEVIEW_H
-
-#include "qglview.h"
-
-QT_BEGIN_NAMESPACE
-class QGLSceneNode;
-QT_END_NAMESPACE
-
-class CubeView : public QGLView
-{
- Q_OBJECT
-public:
- CubeView(QWidget *parent = 0);
- ~CubeView();
-
-protected:
- void paintGL(QGLPainter *painter);
-
-private:
- QGLSceneNode *cube;
-};
-
-#endif
diff --git a/examples/qt3d/cube/main.cpp b/examples/qt3d/cube/main.cpp
deleted file mode 100644
index 79c75655..00000000
--- a/examples/qt3d/cube/main.cpp
+++ /dev/null
@@ -1,62 +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$
-**
-****************************************************************************/
-
-#include <QApplication>
-#include "cubeview.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
- CubeView view;
-#ifdef Q_OS_SYMBIAN
- view.setAttribute(Qt::WA_LockLandscapeOrientation, true);
- view.showFullScreen();
-#else
- if (view.stereoType() != QGLView::RedCyanAnaglyph)
- view.camera()->setEyeSeparation(0.3f);
- if (QApplication::arguments().contains(QLatin1String("-maximize")))
- view.showMaximized();
- else if (QApplication::arguments().contains(QLatin1String("-fullscreen")))
- view.showFullScreen();
- else
- view.show();
-#endif
- return app.exec();
-}
diff --git a/examples/qt3d/cube/qt3d.ico b/examples/qt3d/cube/qt3d.ico
deleted file mode 100644
index e6442baf..00000000
--- a/examples/qt3d/cube/qt3d.ico
+++ /dev/null
Binary files differ
diff --git a/examples/qt3d/cube/qt3d.png b/examples/qt3d/cube/qt3d.png
deleted file mode 100644
index 21ec0176..00000000
--- a/examples/qt3d/cube/qt3d.png
+++ /dev/null
Binary files differ
diff --git a/examples/qt3d/cube/qtlogo.png b/examples/qt3d/cube/qtlogo.png
deleted file mode 100644
index 7d3e97eb..00000000
--- a/examples/qt3d/cube/qtlogo.png
+++ /dev/null
Binary files differ
diff --git a/examples/qt3d/cylinder/cubeview.cpp b/examples/qt3d/cylinder/cubeview.cpp
deleted file mode 100644
index 4569caeb..00000000
--- a/examples/qt3d/cylinder/cubeview.cpp
+++ /dev/null
@@ -1,77 +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$
-**
-****************************************************************************/
-
-
-#include "cubeview.h"
-#include "qglbuilder.h"
-#include "qglcube.h"
-#include "qglcylinder.h"
-
-#include <QtCore/qurl.h>
-
-CubeView::CubeView(QWidget *parent)
- : QGLView(parent)
-{
- QGLBuilder builder;
- builder << QGL::Smooth << QGLCylinder(2.0, 1.5, 2.0, 36, 3);
- cube = builder.finalizedSceneNode();
-
- QGLMaterial *mat = new QGLMaterial;
- mat->setColor(QColor(170, 202, 0));
- QUrl url;
- url.setPath(QLatin1String(":/cupTexture.png"));
- url.setScheme(QLatin1String("file"));
- mat->setTextureUrl(url);
- cube->setMaterial(mat);
-
- cube->setEffect(QGL::LitDecalTexture2D);
-}
-
-CubeView::~CubeView()
-{
- delete cube;
-}
-
-void CubeView::paintGL(QGLPainter *painter)
-{
- painter->modelViewMatrix().translate(0.0f, -1.0f, 0.0f);
- painter->modelViewMatrix().rotate(-75.0f, 1.0f, 0.0f, 0.0f);
- cube->draw(painter);
-}
diff --git a/examples/qt3d/cylinder/cubeview.h b/examples/qt3d/cylinder/cubeview.h
deleted file mode 100644
index 8996fd34..00000000
--- a/examples/qt3d/cylinder/cubeview.h
+++ /dev/null
@@ -1,62 +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$
-**
-****************************************************************************/
-
-#ifndef CUBEVIEW_H
-#define CUBEVIEW_H
-
-#include "qglview.h"
-
-class QGLSceneNode;
-
-class CubeView : public QGLView
-{
- Q_OBJECT
-public:
- CubeView(QWidget *parent = 0);
- ~CubeView();
-
-protected:
- void paintGL(QGLPainter *painter);
-
-private:
- QGLSceneNode *cube;
-};
-
-#endif
diff --git a/examples/qt3d/cylinder/cupTexture.png b/examples/qt3d/cylinder/cupTexture.png
deleted file mode 100644
index e099dea2..00000000
--- a/examples/qt3d/cylinder/cupTexture.png
+++ /dev/null
Binary files differ
diff --git a/examples/qt3d/cylinder/cylinder.desktop b/examples/qt3d/cylinder/cylinder.desktop
deleted file mode 100644
index da9d8102..00000000
--- a/examples/qt3d/cylinder/cylinder.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=Cappucino
-Icon=/usr/share/icons/hicolor/80x80/apps/qt3d.png
-Exec=/usr/bin/invoker --type=e -s /usr/bin/cylinder -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_cylinder
diff --git a/examples/qt3d/cylinder/cylinder.pro b/examples/qt3d/cylinder/cylinder.pro
deleted file mode 100644
index 229ae5b0..00000000
--- a/examples/qt3d/cylinder/cylinder.pro
+++ /dev/null
@@ -1,17 +0,0 @@
-TEMPLATE = app
-TARGET = cylinder
-CONFIG += qt warn_on
-
-CONFIG += qt3d_deploy_pkg
-include(../../../pkg.pri)
-
-SOURCES = cylinderview.cpp main.cpp
-HEADERS = cylinderview.h
-RESOURCES = cylinder.qrc
-
-OTHER_FILES += \
- cylinder.rc \
- cylinder.desktop
-
-RC_FILE = cylinder.rc
-
diff --git a/examples/qt3d/cylinder/cylinder.qrc b/examples/qt3d/cylinder/cylinder.qrc
deleted file mode 100644
index 20fa400f..00000000
--- a/examples/qt3d/cylinder/cylinder.qrc
+++ /dev/null
@@ -1,6 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>latte.png</file>
- <file>cupTexture.png</file>
- </qresource>
-</RCC>
diff --git a/examples/qt3d/cylinder/cylinder.rc b/examples/qt3d/cylinder/cylinder.rc
deleted file mode 100644
index b40ecdc1..00000000
--- a/examples/qt3d/cylinder/cylinder.rc
+++ /dev/null
@@ -1 +0,0 @@
-IDI_ICON1 ICON DISCARDABLE "qt3d.ico"
diff --git a/examples/qt3d/cylinder/cylinderview.cpp b/examples/qt3d/cylinder/cylinderview.cpp
deleted file mode 100644
index 2b347ab6..00000000
--- a/examples/qt3d/cylinder/cylinderview.cpp
+++ /dev/null
@@ -1,101 +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$
-**
-****************************************************************************/
-
-
-#include "cylinderview.h"
-#include "qglbuilder.h"
-#include "qglcylinder.h"
-#include <QtCore/qurl.h>
-
-CylinderView::CylinderView(QWidget *parent)
- : QGLView(parent)
-{
- QGLBuilder builder;
- builder << QGL::Smooth << QGLCylinder(2.0, 1.5, 2.0, 36, 3, true, true);
-
- QGLMaterial *matLid = new QGLMaterial;
- matLid->setAmbientColor(Qt::gray);
- matLid->setDiffuseColor(Qt::gray);
- QUrl urlLid;
- urlLid.setPath(QLatin1String(":/latte.png"));
- urlLid.setScheme(QLatin1String("file"));
- matLid->setTextureUrl(urlLid);
-
- QGLMaterial *matSides = new QGLMaterial;
- matSides->setColor(QColor(170, 202, 0));
- QUrl urlSides;
- urlSides.setPath(QLatin1String(":/cupTexture.png"));
- urlSides.setScheme(QLatin1String("file"));
- matSides->setTextureUrl(urlSides);
-
- QGLSceneNode *root = builder.sceneNode();
-
- QGLSceneNode *lid = root->findChild<QGLSceneNode *>("Cylinder Top");
- int lidMat = root->palette()->addMaterial(matLid);
- lid->setMaterialIndex(lidMat);
- lid->setEffect(QGL::LitDecalTexture2D);
-
- QGLSceneNode *sides = root->findChild<QGLSceneNode *>("Cylinder Sides");
- int sideMat = root->palette()->addMaterial(matSides);
- sides->setMaterialIndex(sideMat);
- sides->setEffect(QGL::LitDecalTexture2D);
-
-
- cylinder = builder.finalizedSceneNode();
-
- QGLMaterial *mat = new QGLMaterial;
- mat->setAmbientColor(Qt::gray);
- mat->setDiffuseColor(Qt::gray);
- cylinder->setMaterial(mat);
- cylinder->setEffect(QGL::LitMaterial);
-}
-
-CylinderView::~CylinderView()
-{
- delete cylinder;
-}
-
-void CylinderView::paintGL(QGLPainter *painter)
-{
- painter->modelViewMatrix().translate(0.0f, -1.0f, 0.0f);
- painter->modelViewMatrix().rotate(-75.0f, 1.0f, 0.0f, 0.0f);
- cylinder->draw(painter);
-}
-
diff --git a/examples/qt3d/cylinder/cylinderview.h b/examples/qt3d/cylinder/cylinderview.h
deleted file mode 100644
index 0a4ac8bc..00000000
--- a/examples/qt3d/cylinder/cylinderview.h
+++ /dev/null
@@ -1,64 +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$
-**
-****************************************************************************/
-
-#ifndef CYLINDERVIEW_H
-#define CYLINDERVIEW_H
-
-#include "qglview.h"
-
-QT_BEGIN_NAMESPACE
-class QGLSceneNode;
-QT_END_NAMESPACE
-
-class CylinderView : public QGLView
-{
- Q_OBJECT
-public:
- CylinderView(QWidget *parent = 0);
- ~CylinderView();
-
-protected:
- void paintGL(QGLPainter *painter);
-
-private:
- QGLSceneNode *cylinder;
-};
-
-#endif
diff --git a/examples/qt3d/cylinder/latte.png b/examples/qt3d/cylinder/latte.png
deleted file mode 100644
index 6902b96c..00000000
--- a/examples/qt3d/cylinder/latte.png
+++ /dev/null
Binary files differ
diff --git a/examples/qt3d/cylinder/main.cpp b/examples/qt3d/cylinder/main.cpp
deleted file mode 100644
index 8101853d..00000000
--- a/examples/qt3d/cylinder/main.cpp
+++ /dev/null
@@ -1,62 +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$
-**
-****************************************************************************/
-
-#include <QApplication>
-#include "cylinderview.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
- CylinderView view;
-#ifdef Q_OS_SYMBIAN
- view.setAttribute(Qt::WA_LockLandscapeOrientation, true);
- view.showFullScreen();
-#else
- if (view.stereoType() != QGLView::RedCyanAnaglyph)
- view.camera()->setEyeSeparation(0.3f);
- if (QApplication::arguments().contains(QLatin1String("-maximize")))
- view.showMaximized();
- else if (QApplication::arguments().contains(QLatin1String("-fullscreen")))
- view.showFullScreen();
- else
- view.show();
-#endif
- return app.exec();
-}
diff --git a/examples/qt3d/cylinder/qt3d.ico b/examples/qt3d/cylinder/qt3d.ico
deleted file mode 100644
index e6442baf..00000000
--- a/examples/qt3d/cylinder/qt3d.ico
+++ /dev/null
Binary files differ
diff --git a/examples/qt3d/cylinder/qt3d.png b/examples/qt3d/cylinder/qt3d.png
deleted file mode 100644
index 21ec0176..00000000
--- a/examples/qt3d/cylinder/qt3d.png
+++ /dev/null
Binary files differ
diff --git a/examples/qt3d/geometry/EarthFlat_512x512.jpg b/examples/qt3d/geometry/EarthFlat_512x512.jpg
deleted file mode 100644
index 28864977..00000000
--- a/examples/qt3d/geometry/EarthFlat_512x512.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/qt3d/geometry/bullseye.png b/examples/qt3d/geometry/bullseye.png
deleted file mode 100644
index e67cf703..00000000
--- a/examples/qt3d/geometry/bullseye.png
+++ /dev/null
Binary files differ
diff --git a/examples/qt3d/geometry/geometry.cpp b/examples/qt3d/geometry/geometry.cpp
deleted file mode 100644
index 870d68d5..00000000
--- a/examples/qt3d/geometry/geometry.cpp
+++ /dev/null
@@ -1,210 +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$
-**
-****************************************************************************/
-
-#include "geometry.h"
-#include "qgltexture2d.h"
-#include "qglmaterialcollection.h"
-#include "qtriangle3d.h"
-
-#include <QImage>
-#include <QPainter>
-
-// icosahedron is defined by phi, derived from the golden section
-// http://en.wikipedia.org/wiki/Icosahedron#Cartesian_coordinates
-const qreal phi = 1.618033988749894848f;
-
-Geometry::Geometry(QObject *parent, QGLMaterialCollection *materials)
- : QGLSceneNode(parent)
-{
- setPalette(materials);
-
- float ico[12][3] = {
- { 0.0f, 1.0f, phi }, // A - 0
- { 0.0f, 1.0f, -phi }, // B - 1
- { 0.0f, -1.0f, phi }, // C - 2
- { 0.0f, -1.0f, -phi }, // D - 3
- { 1.0f, phi, 0.0f }, // E - 4
- { 1.0f, -phi, 0.0f }, // F - 5
- { -1.0f, phi, 0.0f }, // G - 6
- { -1.0f, -phi, 0.0f }, // H - 7
- { phi, 0.0f, 1.0f }, // I - 8
- { phi, 0.0f, -1.0f }, // J - 9
- { -phi, 0.0f, 1.0f }, // K - 10
- { -phi, 0.0f, -1.0f } // L - 11
- };
-
- int face[20][3] = {
- { 4, 0, 8 }, // E-A-I
- { 6, 0, 4 }, // G-A-E
- { 6, 10, 0 }, // G-K-A
- { 11, 10, 6 }, // L-K-G
- { 0, 2, 8 }, // A-C-I
- { 10, 2, 0 }, // K-C-A
- { 10, 7, 2 }, // K-H-C
- { 11, 7, 10 }, // L-H-K
- { 2, 5, 8 }, // C-F-I
- { 7, 5, 2 }, // H-F-C
- { 7, 3, 5 }, // H-D-F
- { 11, 3, 7 }, // L-D-H
- { 5, 9, 8 }, // F-J-I
- { 3, 9, 5 }, // D-J-F
- { 3, 1, 9 }, // D-B-J
- { 11, 1, 3 }, // L-B-D
- { 9, 4, 8 }, // J-E-I
- { 1, 4, 9 }, // B-E-J
- { 1, 6, 4 }, // B-G-E
- { 11, 6, 1 } // L-G-B
- };
-
- const float u0 = 0.0f;
- const float u1 = 0.173205081f;
- const float u2 = 0.346410162f;
- const float u3 = 0.519615242f;
- const float u4 = 0.692820323f;
- const float u5 = 0.866025402f;
- const float v0 = 0.0f;
- const float v1 = 0.111111111f;
- const float v2 = 0.222222222f;
- const float v3 = 0.333333333f;
- const float v4 = 0.444444444f;
- const float v5 = 0.555555555f;
- const float v6 = 0.666666666f;
- const float v7 = 0.777777777f;
- const float v8 = 0.888888888f;
- const float v9 = 1.0f;
-
- float tex[20][3][2] = {
- { { u0, v1 }, { u1, v2 }, { u1, v0 } }, // E-A-I
- { { u0, v3 }, { u1, v2 }, { u0, v1 } }, // G-A-E
- { { u0, v3 }, { u1, v4 }, { u1, v2 } }, // G-K-A
- { { u0, v5 }, { u1, v4 }, { u0, v3 } }, // L-K-G
- { { u1, v2 }, { u2, v3 }, { u2, v1 } }, // A-C-I
- { { u1, v4 }, { u2, v3 }, { u1, v2 } }, // K-C-A
- { { u1, v4 }, { u2, v5 }, { u2, v3 } }, // K-H-C
- { { u1, v6 }, { u2, v5 }, { u1, v4 } }, // L-H-K
- { { u2, v3 }, { u3, v4 }, { u3, v2 } }, // C-F-I
- { { u2, v5 }, { u3, v4 }, { u2, v3 } }, // H-F-C
- { { u2, v5 }, { u3, v6 }, { u3, v4 } }, // H-D-F
- { { u2, v7 }, { u3, v6 }, { u2, v5 } }, // L-D-H
- { { u3, v4 }, { u4, v5 }, { u4, v3 } }, // F-J-I
- { { u3, v6 }, { u4, v5 }, { u3, v4 } }, // D-J-F
- { { u3, v6 }, { u4, v7 }, { u4, v5 } }, // D-B-J
- { { u3, v8 }, { u4, v7 }, { u3, v6 } }, // L-B-D
- { { u4, v5 }, { u5, v6 }, { u5, v4 } }, // J-E-I
- { { u4, v7 }, { u5, v6 }, { u4, v5 } }, // B-E-J
- { { u4, v7 }, { u5, v8 }, { u5, v6 } }, // B-G-E
- { { u4, v9 }, { u5, v8 }, { u4, v7 } } // L-G-B
- };
-
-#ifdef Q_OS_SYMBIAN
- const int imgSize = 256;
- const int txtSize = 6;
-#else
- const int imgSize = 1024;
- const int txtSize = 36;
-#endif
-
- QImage uv(imgSize, imgSize, QImage::Format_ARGB32);
- uv.fill(qRgba(196, 196, 196, 196));
- QPainter painter;
- painter.begin(&uv);
- painter.setRenderHint(QPainter::Antialiasing);
- QPen pen = painter.pen();
- pen.setWidth(2.0);
- painter.setPen(pen);
- QFont font = painter.font();
- font.setPointSize(txtSize);
- painter.setFont(font);
- QFontMetrics metrics = painter.fontMetrics();
-
- QGLBuilder b;
- b.newSection();
- b.currentNode()->setEffect(QGL::LitDecalTexture2D);
- for (int ix = 0; ix < 20; ++ix)
- {
- QVector3D v0(ico[face[ix][0]][0], ico[face[ix][0]][1], ico[face[ix][0]][2]);
- QVector3D v1(ico[face[ix][1]][0], ico[face[ix][1]][1], ico[face[ix][1]][2]);
- QVector3D v2(ico[face[ix][2]][0], ico[face[ix][2]][1], ico[face[ix][2]][2]);
-
- QVector2D t0(tex[ix][0][0], tex[ix][0][1]);
- QVector2D t1(tex[ix][1][0], tex[ix][1][1]);
- QVector2D t2(tex[ix][2][0], tex[ix][2][1]);
-
- // scale up and flip to draw the texture
- QVector2D tv0 = t0 * static_cast<float>(imgSize);
- QVector2D tv1 = t1 * static_cast<float>(imgSize);
- QVector2D tv2 = t2 * static_cast<float>(imgSize);
-
- painter.setPen(QColor("darkblue"));
- painter.drawLine(tv0.toPointF(), tv1.toPointF());
- painter.drawLine(tv1.toPointF(), tv2.toPointF());
- painter.drawLine(tv2.toPointF(), tv0.toPointF());
- QTriangle3D tri(tv0, tv1, tv2);
- QVector3D cen = tri.center();
- QString n = QString::number(ix+1);
-
- painter.setPen(QColor("darkgreen"));
- painter.drawText(QPointF(cen.x() - metrics.width(n) / 2.0, cen.y() + 3.0), n);
-
- // Qt's coordinate system is upside down. I'm ok with that.
- t0.setY(1.0f - t0.y());
- t1.setY(1.0f - t1.y());
- t2.setY(1.0f - t2.y());
-
- QGeometryData op;
- op.appendVertex(v0, v1, v2);
- op.appendTexCoord(t0, t1, t2);
- b.addTriangles(op);
- }
-
- painter.end();
-
- QGLMaterial *mat = new QGLMaterial;
- mat->setAmbientColor(QColor(32, 64, 196));
- mat->setDiffuseColor(QColor(32, 32, 32));
-
- QGLTexture2D *texture = new QGLTexture2D(mat);
- texture->setImage(uv);
- mat->setTexture(texture);
-
- setMaterial(mat);
- QGLSceneNode *n = b.finalizedSceneNode();
- addNode(n);
-}
diff --git a/examples/qt3d/geometry/geometry.desktop b/examples/qt3d/geometry/geometry.desktop
deleted file mode 100644
index 62c79a41..00000000
--- a/examples/qt3d/geometry/geometry.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=D20 Qt3D
-Icon=/usr/share/icons/hicolor/80x80/apps/qt3d.png
-Exec=/usr/bin/invoker --type=e -s /usr/bin/geometry -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_geometry
diff --git a/examples/qt3d/geometry/geometry.h b/examples/qt3d/geometry/geometry.h
deleted file mode 100644
index ff100449..00000000
--- a/examples/qt3d/geometry/geometry.h
+++ /dev/null
@@ -1,58 +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$
-**
-****************************************************************************/
-
-#ifndef GEOMETRY_H
-#define GEOMETRY_H
-
-#include "qglbuilder.h"
-
-#include <QImage>
-
-QT_BEGIN_NAMESPACE
-class QGLTexture2D;
-QT_END_NAMESPACE
-
-class Geometry : public QGLSceneNode
-{
-public:
- Geometry(QObject *parent = 0, QGLMaterialCollection *materials = 0);
-};
-
-#endif // GEOMETRY_H
diff --git a/examples/qt3d/geometry/geometry.pro b/examples/qt3d/geometry/geometry.pro
deleted file mode 100644
index f2a8fbde..00000000
--- a/examples/qt3d/geometry/geometry.pro
+++ /dev/null
@@ -1,22 +0,0 @@
-TEMPLATE = app
-TARGET = geometry
-CONFIG += qt warn_on
-
-CONFIG += qt3d_deploy_pkg
-include(../../../pkg.pri)
-
-SOURCES = geometryview.cpp \
- main.cpp \
- geometry.cpp \
- quadplane.cpp
-HEADERS = geometryview.h \
- geometry.h \
- quadplane.h
-RESOURCES = geometry.qrc
-
-OTHER_FILES += \
- geometry.rc \
- geometry.desktop
-
-RC_FILE = geometry.rc
-
diff --git a/examples/qt3d/geometry/geometry.qrc b/examples/qt3d/geometry/geometry.qrc
deleted file mode 100644
index 4599a46a..00000000
--- a/examples/qt3d/geometry/geometry.qrc
+++ /dev/null
@@ -1,6 +0,0 @@
-<RCC>
- <qresource prefix="/" >
- <file>bullseye.png</file>
- <file>EarthFlat_512x512.jpg</file>
- </qresource>
-</RCC>
diff --git a/examples/qt3d/geometry/geometry.rc b/examples/qt3d/geometry/geometry.rc
deleted file mode 100644
index b40ecdc1..00000000
--- a/examples/qt3d/geometry/geometry.rc
+++ /dev/null
@@ -1 +0,0 @@
-IDI_ICON1 ICON DISCARDABLE "qt3d.ico"
diff --git a/examples/qt3d/geometry/geometryview.cpp b/examples/qt3d/geometry/geometryview.cpp
deleted file mode 100644
index 762e56fc..00000000
--- a/examples/qt3d/geometry/geometryview.cpp
+++ /dev/null
@@ -1,122 +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$
-**
-****************************************************************************/
-
-#include "geometryview.h"
-#include "qray3d.h"
-
-#include <QImage>
-#include <QPainter>
-#include <QDir>
-#include <QTimer>
-#include <QWheelEvent>
-
-#include <math.h>
-
-#include "geometry.h"
-#include "quadplane.h"
-#include "qplane3d.h"
-#include "qglmaterialcollection.h"
-#include "qgraphicsscale3d.h"
-
-GeometryView::GeometryView(QWidget *parent)
- : QGLView(parent)
- , timer(new QTimer(this))
-{
- lp = new QGLLightParameters(this);
- lp->setPosition(QVector3D(-3.0, 1.0, 15.0));
- lp->setSpotAngle(15.0);
- lp->setSpotExponent(24);
- lp->setSpotDirection(QVector3D(0.0, -1.0, -2.0));
-
- palette = new QGLMaterialCollection(this);
-
- // first set up the geometry - an icosahedron
- // this one handles all its own colors and textures
- icosahedron = new Geometry(this, palette);
-
- // now a generic flat floor plane which will be painted grey
- // and textured the same as the icosahedron
- floor = new QuadPlane(this);
- floor->setPalette(palette);
- QGLMaterial *parms = new QGLMaterial;
- parms->setAmbientColor(Qt::darkGray);
- parms->setDiffuseColor(Qt::gray);
- int m = palette->addMaterial(parms);
- QGLTexture2D *tex = icosahedron->material()->texture();
- parms->setTexture(tex);
- floor->setMaterialIndex(m);
- floor->setPosition(QVector3D(0, 0, -5));
- QGraphicsScale3D *scale = new QGraphicsScale3D(floor);
- scale->setScale(QVector3D(0.2, 0.2, 0.1));
- floor->addTransform(scale);
-
- mdl = new QGLLightModel(this);
- mdl->setAmbientSceneColor(QColor(196,196,196));
-}
-
-GeometryView::~GeometryView()
-{
- delete icosahedron;
- delete floor;
- delete timer;
-}
-
-void GeometryView::initializeGL(QGLPainter *painter)
-{
- painter->setLightModel(mdl);
-
- painter->setMainLight(lp);
-
- connect(timer, SIGNAL(timeout()), this, SLOT(rotate()));
- timer->start(25);
-}
-
-void GeometryView::paintGL(QGLPainter *painter)
-{
- floor->draw(painter);
- painter->modelViewMatrix().rotate(angle, 0.10f, 1.0f, 0.0f);
- icosahedron->draw(painter);
-}
-
-void GeometryView::rotate()
-{
- angle = (angle + 2) % 360;
- updateGL();
-}
diff --git a/examples/qt3d/geometry/geometryview.h b/examples/qt3d/geometry/geometryview.h
deleted file mode 100644
index e6cc33e4..00000000
--- a/examples/qt3d/geometry/geometryview.h
+++ /dev/null
@@ -1,88 +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$
-**
-****************************************************************************/
-
-#ifndef GEOMETRYVIEW_H
-#define GEOMETRYVIEW_H
-
-#include "qglview.h"
-#include "qgltexture2d.h"
-
-QT_BEGIN_NAMESPACE
-class QTimer;
-class QGLLightParameters;
-class QGLMaterial;
-class QGLLightModel;
-class QGLMaterialCollection;
-class QWheelEvent;
-QT_END_NAMESPACE
-
-class QuadPlane;
-class Geometry;
-
-class GeometryView : public QGLView
-{
- Q_OBJECT
-public:
- GeometryView(QWidget *parent = 0);
- ~GeometryView();
-
-protected:
- void initializeGL(QGLPainter *painter);
- void paintGL(QGLPainter *painter);
-
-private slots:
- void rotate();
-
-private:
- void makeTexture();
-
- QGLTexture2D texture;
- Geometry *icosahedron;
- QuadPlane *floor;
- QTimer *timer;
- int angle;
- QGLLightParameters *lp;
- QGLMaterialCollection *palette;
- QGLMaterial *mat1;
- QGLMaterial *mat2;
- QGLLightModel *mdl;
-};
-
-#endif // GEOMETRYVIEW_H
diff --git a/examples/qt3d/geometry/main.cpp b/examples/qt3d/geometry/main.cpp
deleted file mode 100644
index b2f2025f..00000000
--- a/examples/qt3d/geometry/main.cpp
+++ /dev/null
@@ -1,62 +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$
-**
-****************************************************************************/
-
-#include <QApplication>
-#include "geometryview.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
- GeometryView view;
-#ifdef Q_OS_SYMBIAN
- view.setAttribute(Qt::WA_LockLandscapeOrientation, true);
- view.showFullScreen();
-#else
- if (view.stereoType() != QGLView::RedCyanAnaglyph)
- view.camera()->setEyeSeparation(0.3f);
- if (QApplication::arguments().contains(QLatin1String("-maximize")))
- view.showMaximized();
- else if (QApplication::arguments().contains(QLatin1String("-fullscreen")))
- view.showFullScreen();
- else
- view.show();
-#endif
- return app.exec();
-}
diff --git a/examples/qt3d/geometry/qt3d.ico b/examples/qt3d/geometry/qt3d.ico
deleted file mode 100644
index e6442baf..00000000
--- a/examples/qt3d/geometry/qt3d.ico
+++ /dev/null
Binary files differ
diff --git a/examples/qt3d/geometry/qt3d.png b/examples/qt3d/geometry/qt3d.png
deleted file mode 100644
index 21ec0176..00000000
--- a/examples/qt3d/geometry/qt3d.png
+++ /dev/null
Binary files differ
diff --git a/examples/qt3d/geometry/quadplane.cpp b/examples/qt3d/geometry/quadplane.cpp
deleted file mode 100644
index 3387002b..00000000
--- a/examples/qt3d/geometry/quadplane.cpp
+++ /dev/null
@@ -1,92 +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$
-**
-****************************************************************************/
-
-#include "quadplane.h"
-
-/*!
- \class QuadPlane
- \brief The QuadPlane class holds a 3D model of a large flat plane.
- When drawing a large flat plane, such as a wall or a floor, it is desirable
- to decompose it into smaller units to make the shading effects look correct.
- This class composes a plane out of a configurable number of quads.
-*/
-
-/*!
- Construct a new QuadPlane with \a size, subdivided \a level times. By default
- the plane is 100.0f x 100.0f, and is subdivided 3 times - that is into an
- 8 x 8 grid.
-
- It is centered on the origin, and lies in the z = 0 plane.
-*/
-QuadPlane::QuadPlane(QObject *parent, QSizeF size, int level)
- : QGLSceneNode(parent)
-{
- setObjectName(QLatin1String("QuadPlane"));
- if (level > 8)
- level = 8;
- if (level < 1)
- level = 1;
- int divisions = 1;
- for ( ; level--; divisions *= 2) {} // integer 2**n
- QSizeF div = size / float(divisions);
- QSizeF half = size / 2.0f;
- QGLBuilder builder;
- QGeometryData zip;
- QGeometryData zip2;
- for (int yy = 0; yy <= divisions; ++yy)
- {
- qreal y = half.height() - float(yy) * div.height();
- qreal texY = float(yy) / divisions;
- for (int xx = 0; xx <= divisions; ++xx)
- {
- qreal x = half.width() - float(xx) * div.width();
- qreal texX = float(xx) / divisions;
- zip.appendVertex(QVector3D(x, y, 0));
- zip.appendTexCoord(QVector2D(1.0f - texX, 1.0f - texY));
- }
- if (yy > 0)
- builder.addQuadsInterleaved(zip, zip2);
- zip2 = zip;
- zip2.detach();
- zip.clear();
- }
- QGLSceneNode *n = builder.finalizedSceneNode();
- addNode(n);
-}
diff --git a/examples/qt3d/geometry/quadplane.h b/examples/qt3d/geometry/quadplane.h
deleted file mode 100644
index e95d1907..00000000
--- a/examples/qt3d/geometry/quadplane.h
+++ /dev/null
@@ -1,57 +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$
-**
-****************************************************************************/
-
-#ifndef QUADPLANE_H
-#define QUADPLANE_H
-
-#include "qglbuilder.h"
-
-#include <QSizeF>
-
-class QPlane3D;
-
-class QuadPlane : public QGLSceneNode
-{
-public:
- QuadPlane(QObject *parent = 0,
- QSizeF size = QSizeF(100.0f, 100.0f), int level = 3);
-};
-
-#endif // QUADPLANE_H
diff --git a/examples/qt3d/graphicsview/cubeicon.png b/examples/qt3d/graphicsview/cubeicon.png
deleted file mode 100644
index 9979fb58..00000000
--- a/examples/qt3d/graphicsview/cubeicon.png
+++ /dev/null
Binary files differ
diff --git a/examples/qt3d/graphicsview/cubeitem.cpp b/examples/qt3d/graphicsview/cubeitem.cpp
deleted file mode 100644
index 10c7609f..00000000
--- a/examples/qt3d/graphicsview/cubeitem.cpp
+++ /dev/null
@@ -1,193 +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$
-**
-****************************************************************************/
-
-#include "cubeitem.h"
-#include "qglpainter.h"
-#include "qglcube.h"
-#include "qray3d.h"
-#include "qplane3d.h"
-#include "qtriangle3d.h"
-#include "qgraphicsembedscene.h"
-
-const qreal CubeSize = 2.0f;
-
-CubeItem::CubeItem(QGraphicsItem *parent)
- : ModelItem(parent)
-{
- QGLBuilder builder;
- builder.newSection(QGL::Faceted);
- builder << QGLCube(CubeSize);
- cube = builder.finalizedSceneNode();
-}
-
-CubeItem::~CubeItem()
-{
- delete cube;
-}
-
-void CubeItem::paintGL(QGLPainter *painter)
-{
- GLuint textureId = this->textureId();
- if (textureId) {
- glDisable(GL_DEPTH_TEST);
- glEnable(GL_BLEND);
- painter->setFaceColor(QGL::AllFaces, QColor(0, 0, 0, 200));
- painter->setStandardEffect(QGL::LitDecalTexture2D);
- glBindTexture(GL_TEXTURE_2D, textureId);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- if (painter->isFixedFunction())
- glEnable(GL_TEXTURE_2D);
- glCullFace(GL_FRONT);
- glEnable(GL_CULL_FACE);
- cube->draw(painter);
- glCullFace(GL_BACK);
- cube->draw(painter);
- glDisable(GL_CULL_FACE);
- glBindTexture(GL_TEXTURE_2D, 0);
- if (painter->isFixedFunction())
- glDisable(GL_TEXTURE_2D);
- } else {
- painter->setStandardEffect(QGL::LitMaterial);
- cube->draw(painter);
- }
-}
-
-static const int vertexDataLen = 6 * 4 * 3;
-
-static const float vertexData[vertexDataLen] = {
- -0.5f * CubeSize, -0.5f * CubeSize, -0.5f * CubeSize,
- -0.5f * CubeSize, -0.5f * CubeSize, 0.5f * CubeSize,
- -0.5f * CubeSize, 0.5f * CubeSize, 0.5f * CubeSize,
- -0.5f * CubeSize, 0.5f * CubeSize, -0.5f * CubeSize,
-
- -0.5f * CubeSize, 0.5f * CubeSize, -0.5f * CubeSize,
- -0.5f * CubeSize, 0.5f * CubeSize, 0.5f * CubeSize,
- 0.5f * CubeSize, 0.5f * CubeSize, 0.5f * CubeSize,
- 0.5f * CubeSize, 0.5f * CubeSize, -0.5f * CubeSize,
-
- 0.5f * CubeSize, 0.5f * CubeSize, -0.5f * CubeSize,
- 0.5f * CubeSize, 0.5f * CubeSize, 0.5f * CubeSize,
- 0.5f * CubeSize, -0.5f * CubeSize, 0.5f * CubeSize,
- 0.5f * CubeSize, -0.5f * CubeSize, -0.5f * CubeSize,
-
- 0.5f * CubeSize, -0.5f * CubeSize, -0.5f * CubeSize,
- 0.5f * CubeSize, -0.5f * CubeSize, 0.5f * CubeSize,
- -0.5f * CubeSize, -0.5f * CubeSize, 0.5f * CubeSize,
- -0.5f * CubeSize, -0.5f * CubeSize, -0.5f * CubeSize,
-
- 0.5f * CubeSize, -0.5f * CubeSize, 0.5f * CubeSize,
- 0.5f * CubeSize, 0.5f * CubeSize, 0.5f * CubeSize,
- -0.5f * CubeSize, 0.5f * CubeSize, 0.5f * CubeSize,
- -0.5f * CubeSize, -0.5f * CubeSize, 0.5f * CubeSize,
-
- 0.5f * CubeSize, 0.5f * CubeSize, -0.5f * CubeSize,
- 0.5f * CubeSize, -0.5f * CubeSize, -0.5f * CubeSize,
- -0.5f * CubeSize, -0.5f * CubeSize, -0.5f * CubeSize,
- -0.5f * CubeSize, 0.5f * CubeSize, -0.5f * CubeSize
-};
-
-QPointF CubeItem::intersection(const QRay3D &ray, int *actualFace) const
-{
- // Determine which face of the cube contains the point.
- QMatrix4x4 mv = camera()->modelViewMatrix();
- QVector3D pt1, pt2, pt3, pt4;
- QVector2D tc1, tc2, tc3;
- bool singleFace = (pressedFace() != -1);
- for (int face = 0; face < 6; ++face) {
- if (singleFace && face != pressedFace())
- continue;
-
- // Test the two triangles on the face for an intersection.
- pt1 = QVector3D(vertexData[face * 4 * 3],
- vertexData[face * 4 * 3 + 1],
- vertexData[face * 4 * 3 + 2]);
- pt2 = QVector3D(vertexData[face * 4 * 3 + 3],
- vertexData[face * 4 * 3 + 4],
- vertexData[face * 4 * 3 + 5]);
- pt3 = QVector3D(vertexData[face * 4 * 3 + 6],
- vertexData[face * 4 * 3 + 7],
- vertexData[face * 4 * 3 + 8]);
- pt4 = QVector3D(vertexData[face * 4 * 3 + 9],
- vertexData[face * 4 * 3 + 10],
- vertexData[face * 4 * 3 + 11]);
- pt1 = mv.map(pt1);
- pt2 = mv.map(pt2);
- pt3 = mv.map(pt3);
- pt4 = mv.map(pt4);
- QTriangle3D triangle(pt1, pt2, pt3);
- qreal t = triangle.intersection(ray);
- if (qIsNaN(t)) {
- triangle.setQ(pt3);
- triangle.setR(pt4);
- t = triangle.intersection(ray);
- if (qIsNaN(t)) {
- if (!singleFace)
- continue;
- // The mouse probably moved outside the face while the
- // mouse button was held down. Use the triangle's plane
- // to compute a virtual texture co-ordinate.
- t = triangle.plane().intersection(ray);
- }
- tc1 = QVector2D(1.0f, 0.0f);
- tc2 = QVector2D(0.0f, 1.0f);
- tc3 = QVector2D(0.0f, 0.0f);
- } else {
- tc1 = QVector2D(1.0f, 0.0f);
- tc2 = QVector2D(1.0f, 1.0f);
- tc3 = QVector2D(0.0f, 1.0f);
- }
-
- // We want the face that is pointing towards the user.
- QVector3D v = QVector3D::crossProduct(pt2 - pt1, pt3 - pt1);
- if (!singleFace && v.z() <= 0.0f)
- continue;
-
- // Get the texture co-ordinate corresponding to the intersection.
- QVector2D uv = triangle.uv(ray.point(t));
- QVector2D tc =
- uv.x() * tc1 + uv.y() * tc2 + (1 - uv.x() - uv.y()) * tc3;
- *actualFace = face;
- return QPointF(tc.x(), tc.y());
- }
-
- *actualFace = -1;
- return QPointF();
-}
diff --git a/examples/qt3d/graphicsview/cubeitem.h b/examples/qt3d/graphicsview/cubeitem.h
deleted file mode 100644
index 67b4aa25..00000000
--- a/examples/qt3d/graphicsview/cubeitem.h
+++ /dev/null
@@ -1,61 +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$
-**
-****************************************************************************/
-
-#ifndef CUBEITEM_H
-#define CUBEITEM_H
-
-#include "modelitem.h"
-
-class CubeItem : public ModelItem
-{
- Q_OBJECT
-public:
- CubeItem(QGraphicsItem *parent = 0);
- ~CubeItem();
-
-protected:
- void paintGL(QGLPainter *painter);
- QPointF intersection(const QRay3D &ray, int *actualFace) const;
-
-private:
- QGLSceneNode *cube;
-};
-
-#endif
diff --git a/examples/qt3d/graphicsview/edge.cpp b/examples/qt3d/graphicsview/edge.cpp
deleted file mode 100644
index bf480ec4..00000000
--- a/examples/qt3d/graphicsview/edge.cpp
+++ /dev/null
@@ -1,151 +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$
-**
-****************************************************************************/
-
-#include <QPainter>
-
-#include "edge.h"
-#include "node.h"
-
-#include <math.h>
-
-static const double Pi = 3.14159265358979323846264338327950288419717;
-static double TwoPi = 2.0 * Pi;
-
-Edge::Edge(Node *sourceNode, Node *destNode)
- : arrowSize(10)
-{
- setAcceptedMouseButtons(0);
- source = sourceNode;
- dest = destNode;
- source->addEdge(this);
- dest->addEdge(this);
- adjust();
-}
-
-Edge::~Edge()
-{
-}
-
-Node *Edge::sourceNode() const
-{
- return source;
-}
-
-void Edge::setSourceNode(Node *node)
-{
- source = node;
- adjust();
-}
-
-Node *Edge::destNode() const
-{
- return dest;
-}
-
-void Edge::setDestNode(Node *node)
-{
- dest = node;
- adjust();
-}
-
-void Edge::adjust()
-{
- if (!source || !dest)
- return;
-
- QLineF line(mapFromItem(source, 0, 0), mapFromItem(dest, 0, 0));
- qreal length = line.length();
-
- prepareGeometryChange();
-
- if (length > qreal(20.)) {
- QPointF edgeOffset((line.dx() * 10) / length, (line.dy() * 10) / length);
- sourcePoint = line.p1() + edgeOffset;
- destPoint = line.p2() - edgeOffset;
- } else {
- sourcePoint = destPoint = line.p1();
- }
-}
-
-QRectF Edge::boundingRect() const
-{
- if (!source || !dest)
- return QRectF();
-
- qreal penWidth = 1;
- qreal extra = (penWidth + arrowSize) / 2.0;
-
- return QRectF(sourcePoint, QSizeF(destPoint.x() - sourcePoint.x(),
- destPoint.y() - sourcePoint.y()))
- .normalized()
- .adjusted(-extra, -extra, extra, extra);
-}
-
-void Edge::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
-{
- if (!source || !dest)
- return;
-
- QLineF line(sourcePoint, destPoint);
- if (qFuzzyCompare(line.length(), qreal(0.)))
- return;
-
- // Draw the line itself
- painter->setPen(QPen(Qt::black, 2, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
- painter->drawLine(line);
-
- // Draw the arrows
- double angle = ::acos(line.dx() / line.length());
- if (line.dy() >= 0)
- angle = TwoPi - angle;
-
- QPointF sourceArrowP1 = sourcePoint + QPointF(sin(angle + Pi / 3) * arrowSize,
- cos(angle + Pi / 3) * arrowSize);
- QPointF sourceArrowP2 = sourcePoint + QPointF(sin(angle + Pi - Pi / 3) * arrowSize,
- cos(angle + Pi - Pi / 3) * arrowSize);
- QPointF destArrowP1 = destPoint + QPointF(sin(angle - Pi / 3) * arrowSize,
- cos(angle - Pi / 3) * arrowSize);
- QPointF destArrowP2 = destPoint + QPointF(sin(angle - Pi + Pi / 3) * arrowSize,
- cos(angle - Pi + Pi / 3) * arrowSize);
-
- painter->setBrush(Qt::black);
- painter->drawPolygon(QPolygonF() << line.p1() << sourceArrowP1 << sourceArrowP2);
- painter->drawPolygon(QPolygonF() << line.p2() << destArrowP1 << destArrowP2);
-}
diff --git a/examples/qt3d/graphicsview/edge.h b/examples/qt3d/graphicsview/edge.h
deleted file mode 100644
index d50c403a..00000000
--- a/examples/qt3d/graphicsview/edge.h
+++ /dev/null
@@ -1,77 +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$
-**
-****************************************************************************/
-
-#ifndef EDGE_H
-#define EDGE_H
-
-#include <QGraphicsItem>
-
-class Node;
-
-class Edge : public QGraphicsItem
-{
-public:
- Edge(Node *sourceNode, Node *destNode);
- ~Edge();
-
- Node *sourceNode() const;
- void setSourceNode(Node *node);
-
- Node *destNode() const;
- void setDestNode(Node *node);
-
- void adjust();
-
- enum { Type = UserType + 2 };
- int type() const { return Type; }
-
-protected:
- QRectF boundingRect() const;
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
-
-private:
- Node *source, *dest;
-
- QPointF sourcePoint;
- QPointF destPoint;
- qreal arrowSize;
-};
-
-#endif
diff --git a/examples/qt3d/graphicsview/graph.cpp b/examples/qt3d/graphicsview/graph.cpp
deleted file mode 100644
index 2aa28b10..00000000
--- a/examples/qt3d/graphicsview/graph.cpp
+++ /dev/null
@@ -1,130 +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$
-**
-****************************************************************************/
-
-#include "graph.h"
-#include "edge.h"
-#include "node.h"
-#include "scene.h"
-
-#include <QDebug>
-#include <QGraphicsScene>
-
-#include <math.h>
-
-Graph::Graph(QObject *parent)
- : QObject(parent), timerId(0)
-{
- QGraphicsEmbedScene *scene = new Scene(this);
- sceneObject = scene;
- scene->setItemIndexMethod(QGraphicsScene::NoIndex);
- scene->setSceneRect(-128, -128, 256, 256);
-
- Node *node1 = new Node(this);
- Node *node2 = new Node(this);
- Node *node3 = new Node(this);
- Node *node4 = new Node(this);
- centerNode = new Node(this);
- Node *node6 = new Node(this);
- Node *node7 = new Node(this);
- Node *node8 = new Node(this);
- Node *node9 = new Node(this);
- scene->addItem(node1);
- scene->addItem(node2);
- scene->addItem(node3);
- scene->addItem(node4);
- scene->addItem(centerNode);
- scene->addItem(node6);
- scene->addItem(node7);
- scene->addItem(node8);
- scene->addItem(node9);
- scene->addItem(new Edge(node1, node2));
- scene->addItem(new Edge(node2, node3));
- scene->addItem(new Edge(node2, centerNode));
- scene->addItem(new Edge(node3, node6));
- scene->addItem(new Edge(node4, node1));
- scene->addItem(new Edge(node4, centerNode));
- scene->addItem(new Edge(centerNode, node6));
- scene->addItem(new Edge(centerNode, node8));
- scene->addItem(new Edge(node6, node9));
- scene->addItem(new Edge(node7, node4));
- scene->addItem(new Edge(node8, node7));
- scene->addItem(new Edge(node9, node8));
-
- node1->setPos(-50, -50);
- node2->setPos(0, -50);
- node3->setPos(50, -50);
- node4->setPos(-50, 0);
- centerNode->setPos(0, 0);
- node6->setPos(50, 0);
- node7->setPos(-50, 50);
- node8->setPos(0, 50);
- node9->setPos(50, 50);
-}
-
-void Graph::itemMoved()
-{
- if (!timerId)
- timerId = startTimer(1000 / 25);
-}
-
-void Graph::timerEvent(QTimerEvent *event)
-{
- Q_UNUSED(event);
-
- QList<Node *> nodes;
- foreach (QGraphicsItem *item, scene()->items()) {
- if (Node *node = qgraphicsitem_cast<Node *>(item))
- nodes << node;
- }
-
- foreach (Node *node, nodes)
- node->calculateForces();
-
- bool itemsMoved = false;
- foreach (Node *node, nodes) {
- if (node->advance())
- itemsMoved = true;
- }
-
- if (!itemsMoved) {
- killTimer(timerId);
- timerId = 0;
- }
-}
diff --git a/examples/qt3d/graphicsview/graph.h b/examples/qt3d/graphicsview/graph.h
deleted file mode 100644
index 0fa897ce..00000000
--- a/examples/qt3d/graphicsview/graph.h
+++ /dev/null
@@ -1,67 +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$
-**
-****************************************************************************/
-
-#ifndef GRAPHWIDGET_H
-#define GRAPHWIDGET_H
-
-#include "qgraphicsembedscene.h"
-
-class Node;
-
-class Graph : public QObject
-{
- Q_OBJECT
-public:
- Graph(QObject *parent = 0);
-
- QGraphicsEmbedScene *scene() const { return sceneObject; }
-
- void itemMoved();
-
-protected:
- void timerEvent(QTimerEvent *event);
-
-private:
- QGraphicsEmbedScene *sceneObject;
- int timerId;
- Node *centerNode;
-};
-
-#endif
diff --git a/examples/qt3d/graphicsview/graphicsview.desktop b/examples/qt3d/graphicsview/graphicsview.desktop
deleted file mode 100644
index 3a38c3a6..00000000
--- a/examples/qt3d/graphicsview/graphicsview.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=GraphicsView
-Icon=/usr/share/icons/hicolor/80x80/apps/qt3d.png
-Exec=/usr/bin/invoker --type=e -s /usr/bin/graphicsview -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_graphicsview
diff --git a/examples/qt3d/graphicsview/graphicsview.pro b/examples/qt3d/graphicsview/graphicsview.pro
deleted file mode 100644
index 48523320..00000000
--- a/examples/qt3d/graphicsview/graphicsview.pro
+++ /dev/null
@@ -1,36 +0,0 @@
-TEMPLATE = app
-TARGET = graphicsview
-CONFIG += qt warn_on
-
-CONFIG += qt3d_deploy_pkg
-include(../../../pkg.pri)
-
-VPATH += $$PWD/../../src/threed/geometry
-SOURCES = \
- cubeitem.cpp \
- modelitem.cpp \
- teapotitem.cpp \
- main.cpp \
- edge.cpp \
- node.cpp \
- graph.cpp \
- scene.cpp \
- view.cpp
-HEADERS = \
- cubeitem.h \
- modelitem.h \
- teapotitem.h \
- edge.h \
- node.h \
- graph.h \
- scene.h \
- view.h
-RESOURCES = \
- graphicsview.qrc
-
-OTHER_FILES += \
- graphicsview.rc \
- graphicsview.desktop
-
-RC_FILE = graphicsview.rc
-
diff --git a/examples/qt3d/graphicsview/graphicsview.qrc b/examples/qt3d/graphicsview/graphicsview.qrc
deleted file mode 100644
index 37a99a11..00000000
--- a/examples/qt3d/graphicsview/graphicsview.qrc
+++ /dev/null
@@ -1,6 +0,0 @@
-<!DOCTYPE RCC><RCC version="1.0">
-<qresource>
- <file>cubeicon.png</file>
- <file>teapoticon.png</file>
-</qresource>
-</RCC>
diff --git a/examples/qt3d/graphicsview/graphicsview.rc b/examples/qt3d/graphicsview/graphicsview.rc
deleted file mode 100644
index b40ecdc1..00000000
--- a/examples/qt3d/graphicsview/graphicsview.rc
+++ /dev/null
@@ -1 +0,0 @@
-IDI_ICON1 ICON DISCARDABLE "qt3d.ico"
diff --git a/examples/qt3d/graphicsview/main.cpp b/examples/qt3d/graphicsview/main.cpp
deleted file mode 100644
index d9eae41c..00000000
--- a/examples/qt3d/graphicsview/main.cpp
+++ /dev/null
@@ -1,62 +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$
-**
-****************************************************************************/
-
-#include <QApplication>
-#include <QtOpenGL/qgl.h>
-#include <QtCore/qmath.h>
-#include <QtCore/qdatetime.h>
-#include "view.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
-
- QGLFormat format(QGLFormat::defaultFormat());
- format.setSampleBuffers(true);
- View view;
- view.setViewport(new QGLWidget(format));
- view.show();
-
-#ifdef Q_OS_SYMBIAN
- view.setAttribute(Qt::WA_LockLandscapeOrientation, true);
- view.showFullScreen();
-#endif
- return app.exec();
-}
diff --git a/examples/qt3d/graphicsview/modelitem.cpp b/examples/qt3d/graphicsview/modelitem.cpp
deleted file mode 100644
index 41ba1383..00000000
--- a/examples/qt3d/graphicsview/modelitem.cpp
+++ /dev/null
@@ -1,220 +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$
-**
-****************************************************************************/
-
-#include "modelitem.h"
-#include "qglpainter.h"
-#include "qgraphicsembedscene.h"
-#include <QtGui/qgraphicssceneevent.h>
-#include <QtGui/qapplication.h>
-
-const qreal CubeSize = 2.0f;
-
-ModelItem::ModelItem(QGraphicsItem *parent)
- : QGLGraphicsViewportItem(parent)
- , mScene(0)
- , mTextureId(0)
- , navigating(false)
- , mPressedFace(-1)
- , pressedButton(Qt::NoButton)
-{
- startNavCamera = new QGLCamera();
-
- setFlag(ItemIsFocusable, true);
-}
-
-ModelItem::~ModelItem()
-{
- delete startNavCamera;
-}
-
-void ModelItem::setScene(QGraphicsEmbedScene *scene)
-{
- mScene = scene;
- connect(scene, SIGNAL(changed(QList<QRectF>)), this, SLOT(updateScene()));
-}
-
-void ModelItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
-{
- // Render the inner scene into a framebuffer object.
- // We do this while the ordinary Qt paint engine has
- // control of the GL context rather than later when the
- // QGLPainter has control of the GL context.
- if (mScene)
- mTextureId = mScene->renderToTexture();
-
- // Now render the GL parts of the item using QGLPainter.
- QGLGraphicsViewportItem::paint(painter, option, widget);
-}
-
-void ModelItem::updateScene()
-{
- update();
-}
-
-void ModelItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
-{
- int face;
- QPointF tc = intersection
- (event->widget(), event->pos().toPoint(), &face);
- if (!navigating && mPressedFace == -1 && face != -1) {
- mPressedFace = face;
- pressedButton = event->button();
- mScene->deliverEvent(event, tc);
- return;
- } else if (!navigating && face == -1) {
- navigating = true;
- pressedButton = event->button();
- pressedPos = event->pos().toPoint();
- startNavCamera->setEye(camera()->eye());
- startNavCamera->setCenter(camera()->center());
- startNavCamera->setUpVector(camera()->upVector());
-#ifndef QT_NO_CURSOR
- setCursor(Qt::ClosedHandCursor);
-#endif
- return;
- }
- QGraphicsItem::mousePressEvent(event);
-}
-
-void ModelItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
-{
- if (navigating) {
- QPoint delta = event->pos().toPoint() - pressedPos;
- int deltax = delta.x();
- int deltay = delta.y();
- QGLCamera *camera = this->camera();
- int rotation = camera->screenRotation();
- if (rotation == 90 || rotation == 270) {
- qSwap(deltax, deltay);
- }
- if (rotation == 90 || rotation == 180) {
- deltax = -deltax;
- }
- if (rotation == 180 || rotation == 270) {
- deltay = -deltay;
- }
- qreal anglex = deltax * 90.0f / rect().width();
- qreal angley = deltay * 90.0f / rect().height();
- QQuaternion q = startNavCamera->pan(-anglex);
- q *= startNavCamera->tilt(-angley);
- camera->setEye(startNavCamera->eye());
- camera->setCenter(startNavCamera->center());
- camera->setUpVector(startNavCamera->upVector());
- camera->rotateCenter(q);
- } else if (mPressedFace != -1) {
- int face;
- QPointF tc = intersection
- (event->widget(), event->pos().toPoint(), &face);
- if (face != mPressedFace)
- tc = QPointF(-1, -1);
- mScene->deliverEvent(event, tc);
- return;
- }
- QGraphicsItem::mouseMoveEvent(event);
-}
-
-void ModelItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
-{
- if (navigating && pressedButton == event->button()) {
- navigating = false;
- pressedButton = Qt::NoButton;
-#ifndef QT_NO_CURSOR
- unsetCursor();
-#endif
- return;
- } else if (mPressedFace != -1) {
- int face;
- QPointF tc = intersection
- (event->widget(), event->pos().toPoint(), &face);
- if (face != mPressedFace)
- tc = QPoint(-1, -1);
- if (pressedButton == event->button()) {
- mPressedFace = -1;
- pressedButton = Qt::NoButton;
- }
- mScene->deliverEvent(event, tc);
- return;
- }
- QGraphicsItem::mouseReleaseEvent(event);
-}
-
-void ModelItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
-{
- int face;
- QPointF tc = intersection
- (event->widget(), event->pos().toPoint(), &face);
- if (mPressedFace == -1 && face != -1) {
- mPressedFace = face;
- pressedButton = event->button();
- mScene->deliverEvent(event, tc);
- return;
- }
- QGraphicsItem::mouseDoubleClickEvent(event);
-}
-
-QPointF ModelItem::intersection
- (QWidget *widget, const QPoint &point, int *actualFace) const
-{
- // Bail out if no scene.
- if (!mScene) {
- *actualFace = -1;
- return QPointF();
- }
-
- // Get the combined matrix for the projection.
- int dpiX = widget->logicalDpiX();
- int dpiY = widget->logicalDpiY();
- QRectF bounds = boundingRect();
- qreal aspectRatio = (bounds.width() * dpiY) / (bounds.height() * dpiX);
- QMatrix4x4 proj = camera()->projectionMatrix(aspectRatio);
-
- // Find the relative position of the point within (-1, -1) to (1, 1).
- QPointF relativePoint =
- QPointF((point.x() - bounds.center().x()) * 2 / bounds.width(),
- -(point.y() - bounds.center().y()) * 2 / bounds.height());
-
- // Get the ray extending from the eye through the point the user selected.
- QVector3D eyept = proj.inverted().map
- (QVector3D(relativePoint.x(), relativePoint.y(), -1.0f));
- QRay3D ray(QVector3D(0, 0, 0), eyept);
-
- // Intersect with the ray using a model-specific intersection method.
- return intersection(ray, actualFace);
-}
diff --git a/examples/qt3d/graphicsview/modelitem.h b/examples/qt3d/graphicsview/modelitem.h
deleted file mode 100644
index 7ab55219..00000000
--- a/examples/qt3d/graphicsview/modelitem.h
+++ /dev/null
@@ -1,91 +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$
-**
-****************************************************************************/
-
-#ifndef MODELITEM_H
-#define MODELITEM_H
-
-#include "qglgraphicsviewportitem.h"
-#include "qglbuilder.h"
-#include "qray3d.h"
-
-QT_BEGIN_NAMESPACE
-class QGraphicsEmbedScene;
-QT_END_NAMESPACE
-
-class ModelItem : public QObject, public QGLGraphicsViewportItem
-{
- Q_OBJECT
-public:
- ModelItem(QGraphicsItem *parent = 0);
- ~ModelItem();
-
- QGraphicsEmbedScene *scene() const { return mScene; }
- void setScene(QGraphicsEmbedScene *scene);
-
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
-
-protected:
- void mousePressEvent(QGraphicsSceneMouseEvent *event);
- void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
- void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
- void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
-
-private Q_SLOTS:
- void updateScene();
-
-protected:
- virtual QPointF intersection(const QRay3D &ray, int *actualFace) const = 0;
- GLuint textureId() const { return mTextureId; }
- int pressedFace() const { return mPressedFace; }
-
-private:
- QGraphicsEmbedScene *mScene;
- GLuint mTextureId;
- bool navigating;
- int mPressedFace;
- Qt::MouseButton pressedButton;
- QPoint pressedPos;
- QGLCamera *startNavCamera;
-
- QPointF intersection
- (QWidget *widget, const QPoint &point, int *actualFace) const;
-};
-
-#endif
diff --git a/examples/qt3d/graphicsview/node.cpp b/examples/qt3d/graphicsview/node.cpp
deleted file mode 100644
index 4723b0ab..00000000
--- a/examples/qt3d/graphicsview/node.cpp
+++ /dev/null
@@ -1,185 +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$
-**
-****************************************************************************/
-
-#include <QGraphicsScene>
-#include <QGraphicsSceneMouseEvent>
-#include <QPainter>
-#include <QStyleOption>
-
-#include "edge.h"
-#include "node.h"
-#include "graph.h"
-
-Node::Node(Graph *graphWidget)
- : graph(graphWidget)
-{
- setFlag(ItemIsMovable);
- setFlag(ItemSendsGeometryChanges);
- //setCacheMode(DeviceCoordinateCache);
- setZValue(-1);
-}
-
-void Node::addEdge(Edge *edge)
-{
- edgeList << edge;
- edge->adjust();
-}
-
-QList<Edge *> Node::edges() const
-{
- return edgeList;
-}
-
-void Node::calculateForces()
-{
- if (!scene() || scene()->mouseGrabberItem() == this) {
- newPos = pos();
- return;
- }
-
- // Sum up all forces pushing this item away
- qreal xvel = 0;
- qreal yvel = 0;
- foreach (QGraphicsItem *item, scene()->items()) {
- Node *node = qgraphicsitem_cast<Node *>(item);
- if (!node)
- continue;
-
- QLineF line(mapFromItem(node, 0, 0), QPointF(0, 0));
- qreal dx = line.dx();
- qreal dy = line.dy();
- double l = 2.0 * (dx * dx + dy * dy);
- if (l > 0) {
- xvel += (dx * 150.0) / l;
- yvel += (dy * 150.0) / l;
- }
- }
-
- // Now subtract all forces pulling items together
- double weight = (edgeList.size() + 1) * 10;
- foreach (Edge *edge, edgeList) {
- QPointF pos;
- if (edge->sourceNode() == this)
- pos = mapFromItem(edge->destNode(), 0, 0);
- else
- pos = mapFromItem(edge->sourceNode(), 0, 0);
- xvel += pos.x() / weight;
- yvel += pos.y() / weight;
- }
-
- if (qAbs(xvel) < 0.1 && qAbs(yvel) < 0.1)
- xvel = yvel = 0;
-
- QRectF sceneRect = scene()->sceneRect();
- newPos = pos() + QPointF(xvel, yvel);
- newPos.setX(qMin(qMax(newPos.x(), sceneRect.left() + 10), sceneRect.right() - 10));
- newPos.setY(qMin(qMax(newPos.y(), sceneRect.top() + 10), sceneRect.bottom() - 10));
-}
-
-bool Node::advance()
-{
- if (newPos == pos())
- return false;
-
- setPos(newPos);
- return true;
-}
-
-QRectF Node::boundingRect() const
-{
- qreal adjust = 42;
- return QRectF(-10 - adjust, -10 - adjust,
- 23 + adjust * 2, 23 + adjust * 2);
-}
-
-QPainterPath Node::shape() const
-{
- QPainterPath path;
- path.addEllipse(-20, -20, 40, 40);
- return path;
-}
-
-void Node::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *)
-{
- painter->setPen(Qt::NoPen);
- painter->setBrush(Qt::darkGray);
- painter->drawEllipse(-7, -7, 20, 20);
-
- QRadialGradient gradient(-3, -3, 10);
- if (option->state & QStyle::State_Sunken) {
- gradient.setCenter(3, 3);
- gradient.setFocalPoint(3, 3);
- gradient.setColorAt(1, QColor(Qt::yellow).light(120));
- gradient.setColorAt(0, QColor(Qt::darkYellow).light(120));
- } else {
- gradient.setColorAt(0, Qt::yellow);
- gradient.setColorAt(1, Qt::darkYellow);
- }
- painter->setBrush(gradient);
- painter->setPen(QPen(Qt::black, 0));
- painter->drawEllipse(-10, -10, 20, 20);
-}
-
-QVariant Node::itemChange(GraphicsItemChange change, const QVariant &value)
-{
- switch (change) {
- case ItemPositionHasChanged:
- foreach (Edge *edge, edgeList)
- edge->adjust();
- graph->itemMoved();
- break;
- default:
- break;
- };
-
- return QGraphicsItem::itemChange(change, value);
-}
-
-void Node::mousePressEvent(QGraphicsSceneMouseEvent *event)
-{
- update();
- QGraphicsItem::mousePressEvent(event);
-}
-
-void Node::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
-{
- update();
- QGraphicsItem::mouseReleaseEvent(event);
-}
diff --git a/examples/qt3d/graphicsview/node.h b/examples/qt3d/graphicsview/node.h
deleted file mode 100644
index 45208610..00000000
--- a/examples/qt3d/graphicsview/node.h
+++ /dev/null
@@ -1,83 +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$
-**
-****************************************************************************/
-
-#ifndef NODE_H
-#define NODE_H
-
-#include <QGraphicsItem>
-#include <QList>
-
-class Edge;
-class Graph;
-QT_BEGIN_NAMESPACE
-class QGraphicsSceneMouseEvent;
-QT_END_NAMESPACE
-
-class Node : public QGraphicsItem
-{
-public:
- Node(Graph *graphWidget);
-
- void addEdge(Edge *edge);
- QList<Edge *> edges() const;
-
- enum { Type = UserType + 1 };
- int type() const { return Type; }
-
- void calculateForces();
- bool advance();
-
- QRectF boundingRect() const;
- QPainterPath shape() const;
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
-
-protected:
- QVariant itemChange(GraphicsItemChange change, const QVariant &value);
-
- void mousePressEvent(QGraphicsSceneMouseEvent *event);
- void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
-
-private:
- QList<Edge *> edgeList;
- QPointF newPos;
- Graph *graph;
-};
-
-#endif
diff --git a/examples/qt3d/graphicsview/qt3d.ico b/examples/qt3d/graphicsview/qt3d.ico
deleted file mode 100644
index e6442baf..00000000
--- a/examples/qt3d/graphicsview/qt3d.ico
+++ /dev/null
Binary files differ
diff --git a/examples/qt3d/graphicsview/qt3d.png b/examples/qt3d/graphicsview/qt3d.png
deleted file mode 100644
index 21ec0176..00000000
--- a/examples/qt3d/graphicsview/qt3d.png
+++ /dev/null
Binary files differ
diff --git a/examples/qt3d/graphicsview/scene.cpp b/examples/qt3d/graphicsview/scene.cpp
deleted file mode 100644
index 5fe55105..00000000
--- a/examples/qt3d/graphicsview/scene.cpp
+++ /dev/null
@@ -1,54 +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$
-**
-****************************************************************************/
-
-#include "scene.h"
-#include <QtGui/qpainter.h>
-
-void Scene::drawBackground(QPainter *painter, const QRectF &rect)
-{
- painter->save();
- QLinearGradient gradient(rect.topLeft(), rect.bottomRight());
- gradient.setColorAt(0, QColor(0, 128, 192, 255));
- gradient.setColorAt(1, QColor(0, 0, 128, 255));
- painter->setPen(QPen(Qt::black, 3));
- painter->setBrush(gradient);
- painter->drawRect(rect);
- painter->restore();
-}
diff --git a/examples/qt3d/graphicsview/scene.h b/examples/qt3d/graphicsview/scene.h
deleted file mode 100644
index 73be795a..00000000
--- a/examples/qt3d/graphicsview/scene.h
+++ /dev/null
@@ -1,56 +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$
-**
-****************************************************************************/
-
-#ifndef SCENE_H
-#define SCENE_H
-
-#include "qgraphicsembedscene.h"
-
-class Scene : public QGraphicsEmbedScene
-{
- Q_OBJECT
-public:
- Scene(QObject *parent = 0) : QGraphicsEmbedScene(parent) {}
-
-protected:
- void drawBackground(QPainter *painter, const QRectF &rect);
-};
-
-#endif
diff --git a/examples/qt3d/graphicsview/teapoticon.png b/examples/qt3d/graphicsview/teapoticon.png
deleted file mode 100644
index 17392361..00000000
--- a/examples/qt3d/graphicsview/teapoticon.png
+++ /dev/null
Binary files differ
diff --git a/examples/qt3d/graphicsview/teapotitem.cpp b/examples/qt3d/graphicsview/teapotitem.cpp
deleted file mode 100644
index 72161a5a..00000000
--- a/examples/qt3d/graphicsview/teapotitem.cpp
+++ /dev/null
@@ -1,129 +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$
-**
-****************************************************************************/
-
-#include "teapotitem.h"
-#include "qglpainter.h"
-#include "qplane3d.h"
-#include "qtriangle3d.h"
-#include <QtCore/qnumeric.h>
-
-TeapotItem::TeapotItem(QGraphicsItem *parent)
- : ModelItem(parent)
-{
- QGLBuilder builder;
- builder.newSection(QGL::Faceted);
- builder << teapot;
- teapotNode = builder.finalizedSceneNode();
-}
-
-TeapotItem::~TeapotItem()
-{
- delete teapotNode;
-}
-
-void TeapotItem::paintGL(QGLPainter *painter)
-{
- GLuint textureId = this->textureId();
- if (textureId) {
- glDisable(GL_DEPTH_TEST);
- glEnable(GL_BLEND);
- painter->setFaceColor(QGL::AllFaces, QColor(0, 0, 0, 200));
- painter->setStandardEffect(QGL::LitDecalTexture2D);
- glBindTexture(GL_TEXTURE_2D, textureId);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- if (painter->isFixedFunction())
- glEnable(GL_TEXTURE_2D);
- glCullFace(GL_FRONT);
- glEnable(GL_CULL_FACE);
- teapotNode->draw(painter);
- glCullFace(GL_BACK);
- teapotNode->draw(painter);
- glDisable(GL_CULL_FACE);
- glBindTexture(GL_TEXTURE_2D, 0);
- if (painter->isFixedFunction())
- glDisable(GL_TEXTURE_2D);
- } else {
- painter->setStandardEffect(QGL::LitMaterial);
- teapotNode->draw(painter);
- }
-}
-
-QPointF TeapotItem::intersection(const QRay3D &ray, int *actualFace) const
-{
- QVector2D tc;
- QGLBezierPatches patches = teapot.transformed(camera()->modelViewMatrix());
- if (pressedFace() == -1) {
- // Intersect with the whole teapot.
- qreal t = patches.intersection(ray, &tc, actualFace);
- if (!qIsNaN(t))
- return QPointF(tc.x(), tc.y());
- } else {
- // Only intersect with the patch that was pressed previously.
- QGLBezierPatches subpatches;
- subpatches.setPositions
- (patches.positions().mid(pressedFace() * 16, 16));
- qreal t = subpatches.intersection(ray, &tc);
- if (!qIsNaN(t)) {
- *actualFace = pressedFace();
- return QPointF(tc.x(), tc.y());
- }
-
- // The mouse has moved outside the boundary of the patch.
- // Use the plane containing the patch to extend the hit
- // area out to infinity.
- QTriangle3D triangle(subpatches.positions()[0],
- subpatches.positions()[3],
- subpatches.positions()[12]);
- t = triangle.plane().intersection(ray);
- if (!qIsNaN(t)) {
- *actualFace = pressedFace();
- QVector2D uv = triangle.uv(ray.point(t));
- QVector2D tc1(0, 0);
- QVector2D tc2(1, 0);
- QVector2D tc3(0, 1);
- QVector2D tc =
- uv.x() * tc1 + uv.y() * tc2 + (1 - uv.x() - uv.y()) * tc3;
- return QPointF(tc.x(), tc.y());
- }
- }
- *actualFace = -1;
- return QPointF();
-}
diff --git a/examples/qt3d/graphicsview/teapotitem.h b/examples/qt3d/graphicsview/teapotitem.h
deleted file mode 100644
index f2706eeb..00000000
--- a/examples/qt3d/graphicsview/teapotitem.h
+++ /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$
-**
-****************************************************************************/
-
-#ifndef TEAPOTITEM_H
-#define TEAPOTITEM_H
-
-#include "modelitem.h"
-#include "qglteapot.h"
-
-class TeapotItem : public ModelItem
-{
- Q_OBJECT
-public:
- TeapotItem(QGraphicsItem *parent = 0);
- ~TeapotItem();
-
-protected:
- void paintGL(QGLPainter *painter);
- QPointF intersection(const QRay3D &ray, int *actualFace) const;
-
-private:
- QGLTeapot teapot;
- QGLSceneNode *teapotNode;
-};
-
-#endif
diff --git a/examples/qt3d/graphicsview/view.cpp b/examples/qt3d/graphicsview/view.cpp
deleted file mode 100644
index 73f4bb6c..00000000
--- a/examples/qt3d/graphicsview/view.cpp
+++ /dev/null
@@ -1,121 +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$
-**
-****************************************************************************/
-
-#include "view.h"
-#include "cubeitem.h"
-#include "teapotitem.h"
-#include "graph.h"
-#include "qglcamera.h"
-#include <QtGui/qgraphicssceneevent.h>
-
-View::View(QWidget *parent)
- : QGraphicsView(parent)
-{
- setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
- setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
- setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
-
- scene.setBackgroundBrush(Qt::black);
- setScene(&scene);
-
- cube = new CubeItem();
- cube->setRect(0, 0, 600, 480);
- cube->camera()->setEye(QVector3D(-5.0f, 3.0f, 6.0f));
- cube->setVisible(false);
-
- teapot = new TeapotItem();
- teapot->setRect(0, 0, 600, 480);
- teapot->camera()->setEye(QVector3D(-5.0f, 3.0f, 6.0f));
-
- Button *cubeButton = new Button
- (QPixmap(QLatin1String(":/cubeicon.png")), teapot);
- Button *teapotButton = new Button
- (QPixmap(QLatin1String(":/teapoticon.png")), cube);
-
- connect(cubeButton, SIGNAL(clicked()), this, SLOT(switchToCube()));
- connect(teapotButton, SIGNAL(clicked()), this, SLOT(switchToTeapot()));
-
- scene.addItem(cube);
- scene.addItem(teapot);
-
- Graph *graph = new Graph(this);
- cube->setScene(graph->scene());
- teapot->setScene(graph->scene());
-}
-
-void View::resizeEvent(QResizeEvent *e)
-{
- QGraphicsView::resizeEvent(e);
- cube->setRect(0, 0, width(), height());
- teapot->setRect(0, 0, width(), height());
-}
-
-void View::switchToCube()
-{
- teapot->setVisible(false);
- cube->setVisible(true);
-}
-
-void View::switchToTeapot()
-{
- cube->setVisible(false);
- teapot->setVisible(true);
-}
-
-Button::Button(const QPixmap &pixmap, QGraphicsItem *parent)
- : QGraphicsPixmapItem(pixmap, parent)
- , pressed(false)
-{
- setFlag(ItemIsSelectable, true);
-}
-
-void Button::mousePressEvent(QGraphicsSceneMouseEvent *event)
-{
- pressed = true;
- QGraphicsItem::mousePressEvent(event);
-}
-
-void Button::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
-{
- if (pressed && boundingRect().contains(event->scenePos()))
- emit clicked();
- pressed = false;
- QGraphicsItem::mouseReleaseEvent(event);
-}
diff --git a/examples/qt3d/graphicsview/view.h b/examples/qt3d/graphicsview/view.h
deleted file mode 100644
index f47a7249..00000000
--- a/examples/qt3d/graphicsview/view.h
+++ /dev/null
@@ -1,87 +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$
-**
-****************************************************************************/
-
-#ifndef VIEW_H
-#define VIEW_H
-
-#include <QtGui/qgraphicsview.h>
-#include <QtGui/qgraphicsscene.h>
-#include <QtGui/qgraphicsitem.h>
-
-class CubeItem;
-class TeapotItem;
-
-class View : public QGraphicsView
-{
- Q_OBJECT
-public:
- View(QWidget *parent = 0);
-
-protected:
- void resizeEvent(QResizeEvent *e);
-
-private Q_SLOTS:
- void switchToCube();
- void switchToTeapot();
-
-private:
- QGraphicsScene scene;
- CubeItem *cube;
- TeapotItem *teapot;
-};
-
-class Button : public QObject, public QGraphicsPixmapItem
-{
- Q_OBJECT
-public:
- Button(const QPixmap &pixmap, QGraphicsItem *parent);
-
-Q_SIGNALS:
- void clicked();
-
-protected:
- void mousePressEvent(QGraphicsSceneMouseEvent *event);
- void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
-
-private:
- bool pressed;
-};
-
-#endif
diff --git a/examples/qt3d/nesting/cubeview.cpp b/examples/qt3d/nesting/cubeview.cpp
deleted file mode 100644
index d14b5048..00000000
--- a/examples/qt3d/nesting/cubeview.cpp
+++ /dev/null
@@ -1,209 +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$
-**
-****************************************************************************/
-
-#include "cubeview.h"
-#include "qglcube.h"
-#include "qglteapot.h"
-#include <QtOpenGL/qglframebufferobject.h>
-#include <QtCore/qpropertyanimation.h>
-
-//! [1]
-CubeView::CubeView(QWidget *parent)
- : QGLView(parent)
- , fbo(0)
- , tangle(0.0f)
- , cangle(0.0f)
- , oangle(0.0f)
-{
- QGLBuilder builder;
- builder.newSection(QGL::Faceted);
- builder << QGLCube(1.5f);
- cube = builder.currentNode();
- cube->setObjectName(QLatin1String("Cube"));
-
- builder.newSection();
- builder << QGLTeapot();
- teapot = builder.currentNode();
- teapot->setObjectName(QLatin1String("Teapot"));
-
- scene = builder.finalizedSceneNode();
- scene->setParent(this);
-//! [1]
-
-//! [2]
- QPropertyAnimation *animation;
-
- animation = new QPropertyAnimation(this, "teapotAngle", this);
- animation->setStartValue(0.0f);
- animation->setEndValue(360.0f);
- animation->setDuration(1000);
- animation->setLoopCount(-1);
- animation->start();
-
- animation = new QPropertyAnimation(this, "cubeAngle", this);
- animation->setStartValue(0.0f);
- animation->setEndValue(360.0f);
- animation->setDuration(5000);
- animation->setLoopCount(-1);
- animation->start();
-
- animation = new QPropertyAnimation(this, "orbitAngle", this);
- animation->setStartValue(0.0f);
- animation->setEndValue(360.0f);
- animation->setDuration(5000);
- animation->setLoopCount(-1);
- animation->start();
-//! [2]
-
-//! [3]
- innerCamera = new QGLCamera(this);
-}
-//! [3]
-
-CubeView::~CubeView()
-{
- delete fbo;
-}
-
-//! [4]
-void CubeView::initializeGL(QGLPainter *)
-{
- fbo = new QGLFramebufferObject(512, 512, QGLFramebufferObject::Depth);
- fboSurface.setFramebufferObject(fbo);
-//! [4]
-
-//! [5]
- QImage textureImage(QLatin1String(":/qtlogo.png"));
- qtlogo.setImage(textureImage);
-
- glEnable(GL_BLEND);
-}
-//! [5]
-
-//! [6]
-void CubeView::paintGL(QGLPainter *painter)
-{
- painter->modelViewMatrix().push();
- painter->projectionMatrix().push();
- painter->pushSurface(&fboSurface);
-//! [6]
-
-//! [7]
- painter->setCamera(innerCamera);
- painter->modelViewMatrix().rotate(tangle, 0.0f, 1.0f, 0.0f);
-
- painter->setFaceColor(QGL::AllFaces, QColor(170, 202, 0));
- painter->setStandardEffect(QGL::LitMaterial);
-
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- teapot->draw(painter);
-//! [7]
-
-//! [8]
- painter->popSurface();
- painter->projectionMatrix().pop();
- painter->modelViewMatrix().pop();
-//! [8]
-
-//! [9]
- painter->modelViewMatrix().rotate(oangle, 0.0f, 1.0f, 0.0f);
- QMatrix4x4 m = painter->modelViewMatrix();
- QVector3D cube1pos(-1.5f, 0.0f, 0.0f);
- QVector3D cube2pos(1.5f, 0.0f, 0.0f);
-
- if (m.map(cube1pos).z() < m.map(cube2pos).z()) {
- drawCube1(painter, cube1pos);
- drawCube2(painter, cube2pos);
- } else {
- drawCube2(painter, cube2pos);
- drawCube1(painter, cube1pos);
- }
-}
-//! [9]
-
-//! [10]
-void CubeView::drawCube1(QGLPainter *painter, const QVector3D &posn)
-{
- painter->modelViewMatrix().push();
-
- qtlogo.bind();
- painter->setFaceColor(QGL::AllFaces, QColor(202, 100, 0, 150));
- painter->setStandardEffect(QGL::LitDecalTexture2D);
-
- painter->modelViewMatrix().translate(posn);
- painter->modelViewMatrix().rotate(cangle, 1.0f, -1.0f, 1.0f);
-
- glCullFace(GL_FRONT);
- glEnable(GL_CULL_FACE);
- cube->draw(painter);
- glCullFace(GL_BACK);
- cube->draw(painter);
- glDisable(GL_CULL_FACE);
-
- painter->modelViewMatrix().pop();
-}
-//! [10]
-
-//! [11]
-void CubeView::drawCube2(QGLPainter *painter, const QVector3D &posn)
-{
- painter->modelViewMatrix().push();
-
- painter->setFaceColor(QGL::AllFaces, QColor(0, 160, 202, 125));
- painter->setStandardEffect(QGL::LitDecalTexture2D);
- glBindTexture(GL_TEXTURE_2D, fbo->texture());
- glEnable(GL_TEXTURE_2D);
-
- painter->modelViewMatrix().translate(posn);
- painter->modelViewMatrix().rotate(cangle, 1.0f, 1.0f, 1.0f);
-
- glCullFace(GL_FRONT);
- glEnable(GL_CULL_FACE);
- cube->draw(painter);
- glCullFace(GL_BACK);
- cube->draw(painter);
- glDisable(GL_CULL_FACE);
-
- glBindTexture(GL_TEXTURE_2D, 0);
- glDisable(GL_TEXTURE_2D);
-
- painter->modelViewMatrix().pop();
-}
-//! [11]
diff --git a/examples/qt3d/nesting/cubeview.h b/examples/qt3d/nesting/cubeview.h
deleted file mode 100644
index 5bcce12a..00000000
--- a/examples/qt3d/nesting/cubeview.h
+++ /dev/null
@@ -1,92 +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$
-**
-****************************************************************************/
-
-#ifndef CUBEVIEW_H
-#define CUBEVIEW_H
-
-#include "qglview.h"
-#include "qglbuilder.h"
-#include "qglframebufferobjectsurface.h"
-
-QT_BEGIN_NAMESPACE
-class QGLFramebufferObject;
-class QGLCamera;
-QT_END_NAMESPACE
-
-class CubeView : public QGLView
-{
- Q_OBJECT
- Q_PROPERTY(qreal teapotAngle READ teapotAngle WRITE setTeapotAngle)
- Q_PROPERTY(qreal cubeAngle READ cubeAngle WRITE setCubeAngle)
- Q_PROPERTY(qreal orbitAngle READ orbitAngle WRITE setOrbitAngle)
-public:
- CubeView(QWidget *parent = 0);
- ~CubeView();
-
- qreal teapotAngle() const { return tangle; }
- void setTeapotAngle(qreal angle) { tangle = angle; update(); }
-
- qreal cubeAngle() const { return cangle; }
- void setCubeAngle(qreal angle) { cangle = angle; update(); }
-
- qreal orbitAngle() const { return oangle; }
- void setOrbitAngle(qreal angle) { oangle = angle; update(); }
-
-protected:
- void initializeGL(QGLPainter *painter);
- void paintGL(QGLPainter *painter);
-
-private:
- QGLSceneNode *scene;
- QGLSceneNode *cube;
- QGLSceneNode *teapot;
- QGLTexture2D qtlogo;
- QGLFramebufferObject *fbo;
- QGLFramebufferObjectSurface fboSurface;
- QGLCamera *innerCamera;
- qreal tangle;
- qreal cangle;
- qreal oangle;
-
- void drawCube1(QGLPainter *painter, const QVector3D &posn);
- void drawCube2(QGLPainter *painter, const QVector3D &posn);
-};
-
-#endif
diff --git a/examples/qt3d/nesting/main.cpp b/examples/qt3d/nesting/main.cpp
deleted file mode 100644
index f0c849d2..00000000
--- a/examples/qt3d/nesting/main.cpp
+++ /dev/null
@@ -1,64 +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$
-**
-****************************************************************************/
-
-#include <QApplication>
-#include "cubeview.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
- CubeView view;
-
-#ifdef Q_OS_SYMBIAN
- view.setAttribute(Qt::WA_LockLandscapeOrientation, true);
- view.showFullScreen();
-#else
- if (view.stereoType() != QGLView::RedCyanAnaglyph)
- view.camera()->setEyeSeparation(0.3f);
- if (QApplication::arguments().contains(QLatin1String("-maximize")))
- view.showMaximized();
- else if (QApplication::arguments().contains(QLatin1String("-fullscreen")))
- view.showFullScreen();
- else
- view.show();
-#endif
-
- return app.exec();
-}
diff --git a/examples/qt3d/nesting/nesting.desktop b/examples/qt3d/nesting/nesting.desktop
deleted file mode 100644
index 85668cc3..00000000
--- a/examples/qt3d/nesting/nesting.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=Nesting
-Icon=/usr/share/icons/hicolor/80x80/apps/qt3d.png
-Exec=/usr/bin/invoker --type=e -s /usr/bin/nesting -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_nesting
diff --git a/examples/qt3d/nesting/nesting.pro b/examples/qt3d/nesting/nesting.pro
deleted file mode 100644
index 7725c2f3..00000000
--- a/examples/qt3d/nesting/nesting.pro
+++ /dev/null
@@ -1,17 +0,0 @@
-TEMPLATE = app
-TARGET = nesting
-CONFIG += qt warn_on
-
-CONFIG += qt3d_deploy_pkg
-include(../../../pkg.pri)
-
-SOURCES = cubeview.cpp main.cpp
-HEADERS = cubeview.h
-RESOURCES = nesting.qrc
-
-OTHER_FILES += \
- nesting.rc \
- nesting.desktop
-
-RC_FILE = nesting.rc
-
diff --git a/examples/qt3d/nesting/nesting.qrc b/examples/qt3d/nesting/nesting.qrc
deleted file mode 100644
index 70f5024d..00000000
--- a/examples/qt3d/nesting/nesting.qrc
+++ /dev/null
@@ -1,5 +0,0 @@
-<!DOCTYPE RCC><RCC version="1.0">
-<qresource>
- <file>qtlogo.png</file>
-</qresource>
-</RCC>
diff --git a/examples/qt3d/nesting/nesting.rc b/examples/qt3d/nesting/nesting.rc
deleted file mode 100644
index b40ecdc1..00000000
--- a/examples/qt3d/nesting/nesting.rc
+++ /dev/null
@@ -1 +0,0 @@
-IDI_ICON1 ICON DISCARDABLE "qt3d.ico"
diff --git a/examples/qt3d/nesting/qt3d.ico b/examples/qt3d/nesting/qt3d.ico
deleted file mode 100644
index e6442baf..00000000
--- a/examples/qt3d/nesting/qt3d.ico
+++ /dev/null
Binary files differ
diff --git a/examples/qt3d/nesting/qt3d.png b/examples/qt3d/nesting/qt3d.png
deleted file mode 100644
index 21ec0176..00000000
--- a/examples/qt3d/nesting/qt3d.png
+++ /dev/null
Binary files differ
diff --git a/examples/qt3d/nesting/qtlogo.png b/examples/qt3d/nesting/qtlogo.png
deleted file mode 100644
index 7d3e97eb..00000000
--- a/examples/qt3d/nesting/qtlogo.png
+++ /dev/null
Binary files differ
diff --git a/examples/qt3d/qt3d.pro b/examples/qt3d/qt3d.pro
deleted file mode 100644
index 07b7c8dc..00000000
--- a/examples/qt3d/qt3d.pro
+++ /dev/null
@@ -1,2 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS += basket builder cube cylinder geometry graphicsview nesting solarsystem tank teapot
diff --git a/examples/qt3d/qt3d.svg b/examples/qt3d/qt3d.svg
deleted file mode 100644
index 4b25ec50..00000000
--- a/examples/qt3d/qt3d.svg
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<!-- Converted with SVG Converter - Version 0.9.5 (Compiled Mon May 30 09:08:51 2011) - Copyright (C) 2011 Nokia -->
-<svg xmlns="http://www.w3.org/2000/svg" width="287" version="1.1" height="286" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="tiny" id="svg2">
- <defs id="defs4">
- <linearGradient id="linearGradient4309">
- <stop offset="0" style="stop-color:#d4f301;stop-opacity:1;" id="stop4311"/>
- <stop offset="1" style="stop-color:#d4f301;stop-opacity:0;" id="stop4313"/>
- </linearGradient>
- <linearGradient gradientTransform="matrix(1.0104795,0,0,1.004441,23.387309,76.758859)" id="linearGradient3730-2" y1="131.35715" y2="156.39526" x1="23.626827" gradientUnits="userSpaceOnUse" x2="303.57144">
- <stop offset="0" style="stop-color:#038d30;stop-opacity:1;" id="stop3726-7"/>
- <stop offset="1" style="stop-color:#038d30;stop-opacity:0;" id="stop3728-1"/>
- </linearGradient>
- <linearGradient id="linearGradient3724-7">
- <stop offset="0" style="stop-color:#038d30;stop-opacity:1;" id="stop3726-7"/>
- <stop offset="1" style="stop-color:#038d30;stop-opacity:0;" id="stop3728-1"/>
- </linearGradient>
- <linearGradient id="linearGradient4315" y1="62.920685" y2="62.920685" x1="72.492188" gradientUnits="userSpaceOnUse" x2="165.83203">
- <stop offset="0" style="stop-color:#d4f301;stop-opacity:1;" id="stop4311"/>
- <stop offset="1" style="stop-color:#d4f301;stop-opacity:0;" id="stop4313"/>
- </linearGradient>
- </defs>
- <metadata id="metadata7"/>
- <g id="layer1" transform="translate(-25.071424,-77.933617)">
- <path style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#d4f301;stroke-width:8.85648727;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="path3722" d="M 149.39285,339.37194 C 118.29002,338.06386 93.410274,329.21846 78.267585,314.08502 66.239667,302.06444 58.159936,285.11057 54.818135,264.88047 c -1.962614,-11.881 -2.442596,-20.11519 -2.455216,-42.1199 -0.01051,-18.36712 0.160997,-23.0644 1.239861,-33.95521 2.529982,-25.53941 11.482605,-46.43472 25.677112,-59.93007 16.042727,-15.25252 39.462148,-23.21337 72.203768,-24.54383 6.77105,-0.27512 31.97542,0.38686 41.46813,1.08915 17.85829,1.32123 29.86273,4.01251 41.92069,9.39824 16.71724,7.46685 28.60768,18.52238 36.44553,33.88638 5.7477,11.26691 9.34961,23.29707 11.69339,39.05536 2.22754,14.97664 2.81073,44.00559 1.22086,60.77114 -2.76934,29.20404 -10.704,50.36949 -24.19378,64.53629 -8.65346,9.08774 -21.29946,16.39504 -35.37578,20.44137 -13.11053,3.76868 -25.14568,5.0858 -52.44498,5.73944 -13.81368,0.33078 -17.4242,0.35023 -22.82487,0.12311 l 0,0 z"/>
- <rect width="236.93414" x="49.282932" y="102.78797" rx="95.84404" ry="92.255867" height="239.43414" style="opacity:0;fill:none;stroke:#008000;stroke-width:3.29858350999999980;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="rect2852"/>
- <rect width="175" x="28.571428" y="19.214285" rx="95.84404" ry="92.255867" height="206.07143" style="opacity:0;fill:#b94b4b;fill-opacity:1;stroke:#05d105;stroke-width:4.147;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="rect3704" transform="translate(25.071424,77.933617)"/>
- <image width="172.71428" x="86.571419" y="214.50505" height="93.14286" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIkAAABMCAYAAABZAZTOAAAABHNCSVQICAgIfAhkiAAAF+NJREFU eJztXVlzHMeR/qq6e06ABE9QomTJlu0IKdaxftmH/Xf783Zf1l7FWpbWFiXSFA+QIIDBYDBXd+1D ZlZlVdcMTpLYBTKi0T19d9fXmV8eVTAAHG7kRtaI/dg3cCNXX25AciMnSvmxb+CDiwEMAGPW7+Zc PL/Ocu1A0ukAvT5QdQFjAWsUYBzQOKBeAssFMD0GFvMboFwLkBgDdHtApwfc3wbubQMbt4CiBMoK sJa0S+OA5RyYToHpBNh9Dbx9DRwfAYsFri3FvxYgAYBuH9jcAh4+Bh59Bty+QwCpukBR0D5NA8yn wPGEgFFWwGxKWmWx+Lj3/zHleoDEUIN3e8CdB8CDT4BbW0BVkXaxBWmbpiZQTI6AyRiYHQM7L0jj XGe5Ho/vgMkhcY3Xz4mT1EsGSZdBYGjdfAYcHQLjEfD6BXDwjsByXU0NcE1A4hybkAnw0/fEPyrW LDBA6UiTLBekRXbfAO92gJ//h+Y3xPWayeyYTMliAVQdIq1lSZ6Oc4BraPtkTJ7NjVxDkBxPSFMc vCPCWnWA/pDAcmyA+Rx4+xLY3yXyet21CHANQeIccY53O2RuXEOmxhjaNjkERnvESZbX2KPRcu1A AhBBPT4id3fJgTNb0Hw2JVNU1zdaROTagaTTBe7cBwYbpFF++JY5iSFgTI6ArXtkhgRM110M/j86 d5yfcY6JaUWNLhyk6pCpMYYIq4TlHcj81EvSMHMOpDVNCNHLuYHro2mupCaRRut0QxzDWjIJlvPW Pu9iQ2PLfmVF6wrev6jI5bWW1jmoBs40tFH5HPF4plMCScNmyKkcT63WOUfndI7A1TR0TF3zvks+ T/OeX+IFxFh6ZpErBRJp7LKixhxuAP0NBkrB68sAgKII0VIBg4DEWs7JMLgKtd+Z9Cc3+HJJDdzU 1MACksWC1zGYBDBNTdsFHIs5ud/zOXA8prkA6H2LB70Cv/F/wnZ5l84Bi1kA+tUBiQFsScC4fZfM wa3bwGAT6A2okTtdjm0UxCPKkoAhD1iWQVsYGwBhlUnRLwxh5kWbEOf/MDAaNXcEgHoZGrupCUxN HfI9TU2AmB0zWZ4BhwfAaJ/WHR68X6BYS6mHwRAoO6RRiwoo1DuRj6jqUYHRaJ/SEYs50MyvEEgs Z2rv3KfcSn9ID9br00NqPiHaoigDIESrCCBEi5gMSPQXBSiOgXhBmyWnQSLmhsEhPEbMigcJr1vM CRyzTQLOcJOeazImrjM7fj/vtOoQQd9+TInNwQa9006PPijnQklEvQCOjoDxfvoyrhBIjAGqklP6 rDEKBQRtXsSUWAuYggCmzYsnpDYUGEUaRJFPveytUI6vGAB8PjDvsLzsjAIT72sdUDguQWAtt+S3 3elSVrppQgb6fUhZUUnE9mPgs18Dw1sE0G6frtvUpN3evSFP781r0iCjPQK18KYrA5Jun0zLcJNe YlkG4pkCAMpciERawCTLLr9JrxRvSPb3WiTRKn7u0AaRCbfmgerC/RcFHVNWpEkMqHxhPrv8wF1/ CPzun4D7j4Cvviag9AZ03aKkeNDxGHjzCvjHE2DvLfDLTwSY1Gs7F0iM/vQQiKT/itU2v7imXLAo AkB6A9YiZWJCeBJT4af4VmJyZlZf1rQWkuUcsV1DeD1uDWJN5kjbGX4W5+jZqg6d6+4DzjofrH4/ Z5VuD3j8JfCHfyEQ3t+m91uWpB3G74BXzwkY3/8JePI93cMqj+tsIDFAr8cVXZ3gMfT6wK07ZPOq iolQGbiA9ypsu1GNBQ73gd0dQr8HSKkAIgBEMC1GN4bWLhktk65vgbilXuJjDaixW8emgEy8CNEo 1hBRtBYAm56qousNNqi2ZT4NRPi8Ivdy/xHw+z8QOPpDoD+g68MR/3n6d+Db/6DKu5fPSJOti/mc CBJ58P6Q0Hj7DpkD+eJtQSAZbhKCS/EsVMNmPQpeNxnTC6o6wTvJmZhUe/hzIOEdrQc4+eVGPEQf 5+Kf6emymDLEUVIuJN6Wc0HLiEfW6QbQXMTRES9lsKHMdhU0mFTe7b6mj/Lw4HSgXAkSY+gim7eJ Lzx8DDz8BLj7kIuJB6RNrA3aQ9v1ls120cy/vNc1ub79AYFMIqOeoKa8JNEgOfBIA4WHQb6VVz58 sqvmNmqug24pICJzo0DhwDEfRWKHt4CjUShhOG8kVz7e+4/IjIlmNpbiHvMZ8OIZ8ONfgJdPQ2T5 JMmCxBg6+fZnwG++plzG9uNQ8tc0RLTm88CQ5zN6QAljiyvolMuoo3jglznap+O7/aBNVvERkwML nwspWBLVn4KkxUl4LlrFgDRCxHa1meHtWZBwEZNlFd+o+4YD6iKURJYdig0NNsmlnh7TuzuPdHuk 6R88AjY2qX63ZC/m8ICmv/wn8PxnIq6nlZWapKwIHJ99Sdrj3jY14mJOKutoTOn0xRyYcdXXfBZC zgsOQUtsAS4mRkJC6yVHVzdVBNW2Gzl1YdMG02BJt/lrrtEmEmmMwKH3zWgTMS1+PwXAVMshXaeA L7kl0cjnBYl4Tf2B4oyWYiDTCZdk/kIk9Uznza3sDwmNv/0G+OJ3pA6XS+DtK+DNSyKaL55Sd4Pp hIDhw9N1sH86zwEETeJcCIY9+pyupTWIkDxjedmE/jHpi86SVQ0utSpaUECITBNIE6TerTOZfV0C PDXp+7RQGhEh5uMcfellRQ3b1NSAy3OYnKpDMZHNLU5ldOjaDZdu7rwkj+bNy7O721mQbD8GfvUV 8PlXBBg4Asj3fwZ++C+66PiA7JyOQJ7lwaouTRI8KysVGylUviU1NRlOYtWEXGOyrAKM079V3CQi rupgp8Bl1Pas9hPvzNEzAYFrFS54Or0hNWi3T+b3LNrEGKDbJROzeZvAUnZoW72kj/rlM4qHHE9O f16RFkiKki60dZ/mAHGP3dfAs78Dz39SJuSckrrNHiBlTFRNMq36UrONg2CCUrWfmqGc+UnicJ6n yP37fRSovHbj9alpsQaASjjCBXe/0yVN0h8A44r4yWmTkMYC3QGweYc0SZcDZjWnBEb7ZGZePD2f i21bFzSxNyEZzcWcyI5zp773tQ8lNR1RxnYdAIAAEMRT2sgJLYnP0bqZNatTMCXb9PH+OgjPcSow q2hsWZKZEA/vtGItl1X0QsbcmACS6XGojTmPZM2NqHshc00TCKvkLc4r1nJc5RYxenkoq7wZvexN inATGzdGLlejGyj1blJTA8QAih5NtETGfZdzCNk1FrBNzF2sod8N37ezdA7/AdrAT6oScB3Or4zp nU/Gp3ifnB3f3CLPZvM2/QaIDowPgN1XF6vZbWkSIJiTxoWHLbjxWiTxjGIs+fL9IdlRT1hVIs9r MhNrGZ/V1eBITYwGhdIgGhyt7RpEa85p2Fx4DaPWCx+KMs/KzPjaFj2pj0L6JQ84+y0NfZJ0e8RB 7tyjEMWQzbcEzkb7oT/zeaUFEteQWZlOCInG0AN02bUqOOt6XikKerBeN46L5AJnOU2SU9+Riwm1 vAYQkVkQSc3WCrMh+6agjDhI5ncE/ISgF1wbU3WATj8k4tZJWREw7j4A7j0ksPSGdL6a41dSuzKf nbvJ2uamaeiE82noJG25lqPTZTV5AdJqC2Lzvje/IqVrbXem0VMiC7SP0XKS2QHa5iY1RaJBnCKy Lr0fledx6ppyD61JaxnJ7XAOax3RLCtOl2zQXLxEYwG3JIdDx67OKy2QOAeMDoC9XbJnW/fowptb 1Nm6NyBNc54uB12ukNq4RZpJyhRT7dHSJNrLWQOeVFPkTAigtqt9WuLibf6nWu84gmqA4M3IaeW+ HXxo3qacxAVgFAV9fEVJ78iAu5wmkVF5xm6PirM+/YK8xC3uASBdV+dz4GAvRLQvUv2WVWiTMfVw Gx1wYUwJbNymrOKtLSJB8xngznjh4SarxEGc6S2U+jUFgAKAtu0G4UPVQFhBVr0bKiCxiEChG1PW +UWT9+C01vDLvN4n7RxaILZ8jLM8V/doQc9r6hA3kTKCpiF+MT7gELoJprqqCCCffEGpk8GQCStn 6F1D2d69N8D+W2rP80ZxgRUgkWqlnV+AX/2G3LLBkBJHn35JUbujMTA/44WlIkvGBFlVbeYjrClR TQhsRDiR0SbatJhkLpKYJZeaGBWeN0BUSS6WJdIeBpCSCIncmgQYjTyLow+ksUCtvJ2youv2+qx1 B2SCBpvA1l36yG5vUbrkzgPebzP0CJhPCRij/RDBvYhkQeIaIq2SmZRsYn9IbtbxEedxTqhDSMVm ABE1vvrKV5FT31h60iYmlVXblCnKHmYCYHLP6I9TWici0XKvLr5Xl3muyKSa8G46XQIJLAFnuAHc uhtAMdig+h5fEsCorbnP0PiAHJCLdt/IgkQ6I736BfjlKf1+9CtC8eMv6WHe7TC5PWXP+6LkUDxH V6NYiG3PtWu5jtBa9Vt8NYN4fY6wZvmJLnPQ+8SbY8TJuZtwPQe6F+uYuEpQ0gKmUfetNKOPm6h3 I2O7CS/sD7lOpEfbxF2WEZvAgc/phOpUd17QR36acoB1stLJqpfUu/7JX0lzDDaIHD38hLa/2yFV Nto/OdRrjKp87yalABnNos1OzsxkiaoNjeo5xxqQrCKvEQgUWCJtokHC5FV7OFq7yXZ9zwIIIH52 pyr/Gx4Oo7BETqtOiKiWFcWYpPOaZM6Xc/poj5hTSpb+It4osAYkzhE4dnfoBscj4O42+eFDzjZ2 B0AxPl0+QKqvfFlj0uCrYhGnmpSk54M6lcx9HYhyVVuu8KptibbR19XurlwnfY6cG58zPdaGuhwx 974XQRm/TyFHNff7mfG4b3V9OT0F14Zr6pqyv+MReTdb98hG3r1PFdjLBZHYH787OVhji5DI00Gk KNxu4xflzY+sQ0a7aO2hAZJoltw8dZU9EwWywPFASESbMGNBpoeJqVPrxQXWw11Y8W7YJBWJO2wL 6qzW6XL6X7nM0pvRcf3O9IjLAl5QIvasnHGVnFjjenxE09/+mzjJ13/kqrXHhNqt+2T3XjxdzU8K 7k8TdZNQDZ8lr3p7zryo7VEjp5pIFlPNohtbmRdn4DO7QMxPUs9HjoHaJvfjeO7vHyvuXwG69YGw GRlucnS64nuxIeot2mY2BQ5HYay3N68u5vZqOXW1/OvnwJ//nR7i3jYNc/nJZwScxZwa/uUzIryt i1RcE1vFZHWlqUkAsA44KWDSCXpfZLSJlmSda68KG5JjxHzpub8WE1Z/SAYsonly+R0BoM8M83ll IMDlgvjh21dED14+O11y8LRyapA0NQ0R9exHQu1gg0xPfwBsfwqMeJTCN69DhZqItTEXQdLQuoFb Lm6qDdQ26PkpNciZRZmgaLVRqzP8JL1HWaezxC0Srvc1wdROJ8ElFq3lu5IyWT2ekBOx94Y8m8sc UKQA8G+n2dE5AoEEaKwN+YI797lGlXMNUgsr6q7ToyTUYCPUTEgNps8AC5vnCKwspyUDkXuccpbU C0rJ8YrGyWmwXKPJexAwpw2hf0Ydz13gIv63C8v+o3KIRiZYcmf0kjtyDTbIzPg6kQlpjKND8kSf /g149Q/SJpcpZ+qc5RwF2KTn/HhEAPnqawLB1/9MYfu9t0Sc3u2QOkw9mtQmpBoFutGgGu2kSR+r j0H4vU6rpO0uPATpOkDF5ONz68CaFFTrZ/Che3XMKr5lLTsHL+g8W3fpg5Nhu45G7OoeAs+fUA3r aB+XLmfu5ukcBdHe7VDjj/aoluHTL4jENo40zGJBX8XRIS1LPiXiG6cR1dBnshpm9XL0Mz2pEFFe 9hoEaBVI63NEATi9X+aDkNW5/FAKbIC8lOU8jO0mVYJTHrpitEftITm1y5Zz9QUWLTIe0e/FjDon f/l74OGnpF3uPgRefU5If/ksVIdrF7PV6Ep7ZOUs4JLzyeIqoCQnlMYzGiz8u+X+Jtpk5c2l15CH zxyXey8yRIQMVTGfETCkbvXwgNze9zW+26WMKvDDt9Th57ffAH/8V+InW3eBzVuE+Nt3gCc/UP+P plA2Wk7g4imy7VjjZeidTkJP0iD62kbvkmqC5D5OukZ2PxdmDupjcfGy/NaT1PdMxlS+0TTERXZe AE++o9TJ+x4x6VJAUteE7O/+RP07tu4BX31DHbv6A2DrAeD+GiKATUPV4EaVSTYOAP+2QvB44Biw ffeA4cCTa1TDcgALoHMYw+dMuY5TxyCsB58bDSIAybJb0YhCRmUEJMdV7nrAG7/Nhed3yTrH76Bu 4v3rZci2i3k5PKCQxOH+xfMyp5FLHZ9kuaAbbxqg/zMAR9lKZxAVVusXlJsax8kx2ZcbX48LYtT+ XolkNIDXEhkSIACJBqDR59AaYBVIZB+X7OMPVOvUMzcunDf3/H40Je6iOZ2QyT46pGKk6fGHG5zv 0kEy2uPxNvYJ7YMNCr4tmbxKfqFckjvXcD1Fw/1QahV4Ehc6jYEYfvHWhWJtqc/wmoOjkrq/rpwr t+wlNXcuXpYvHwiNHmmOjMaQwfiaRJNKtLSugWUdhtOSjtxL7p75+he6hsRGlssP+0+aLn2kIyFZ o31CfFFSfqeoCCx1P+RwAOUCcnSRTqLyHAj7WQaGjpFYDs61+u1Y6sqQur0rCax/gLOBRGuJRpuO ug2Sekn7CABcw8vLMLqjdJldLihAdnhAdSEX7RB3EXmvw2Et+WFnx9x7fjNUctd10Cy2BgrWGtKw cPBxldogqtD37jTgE2iyfxoQS93KlvZIgbLK9EBpCW1GmMOk/EP3hfbjuer1Ah498bp6GULu3qx8 IK2Rkw82ZtpyDhzuAa6miKtlgGhtYYvQEMYCtQPKBr7OwloClK4sj7pdJJokDf8DaMdcMiYnCqBp XiKjIyT8BIhBEGkSF5sRPeJ0U5PWWCwojFDXFIOasZs7PiCOd9F6kIvKBx1Yb7TPyUBu9G6P24hf uqTIGxcA4ZZAw90EJINsEMyTjEfqM6MJUFogAdbGSYD1IIkIqvzGCk3Cy37YziXvw+amqYH5gj6g +ZzAM5tS/OnokOqMp+fo4H3Z8kFBMuevRcr2BhtB7bqGGr2qidRJ/9i6JFNkLWDLABKdJdXJsCjM L/smWsRHPl2yHsh6N7KoPZQsSBK3V4OkpUl4uPEFg2TGpaACjvGI+MjHNDMiH3yITin3nxzBdxz3 ZYxNaGjpdS/SWOpy4BgMToJyTGSdZJjRBkmT0ySrgm+pG524wanrLmYn0iAOMScRDyYxN96TWYRO VPJfu+ZnGInofcsHB0nDINnf5RK7Zfj6ZADauiYzUlSkRYqatEE0lrwuotagMIlmQQwekWiZ5y0r k/FsUqDkQOKBkdEkjXg0MiIU95YccSxk721Iol4FLQJ8pMF+pexgPouZvfzzxIo7K5U19/JbJiDR pkaZn1aVvYDDhsCZSA4wKRdJXeGWuVFTFiSsSWqlSXysg0spZseUxd3f5dT/YeAuV0U+2ojQTQOg CX14un2gUZXfEpqnneG7VIrn42xYNoY5jXKBG61ZGpyOuCYNk4uReJAg/p31biQ+okHShH9OoP/F 7NEhmZurBhDgCgwbvpjTV+QcdbsAmLQ61X4SXHO83gZOIkBolIlpEdgUFGlsJLE3KXHV7q9f5g06 79I0gBPtoThJrYJlTUOJTuEge7uU5r/McsPLlo8OEoBe3miPvrbegLSKRF99dFWq2ETTpAXVmUJq DYg0TiKiNYyvCdE7SBxEeUNSMuAcIB2vDGuyxvD6Omg42S7nq5vwnyvkv4ZeZbkSIAFCctDVZK97 gzACtVSKd/thZKSyopELbZkQ2RQoUIBRyz4xuMrcrOAkIS0cPBkdPKszJmU2BdwYOOYBd0f7gbhP Dq+eeUnlyoAEoJc1nxORk7E1pNimKLkHWydolS4P+CIxlZbHk9S/AiHg5qBAlNxDdi6AELOjEnXi wYh2kP+WJbGQ+YzGuhXeMRmHcW+vOkAAZKvoPqpIg0uEteyq/58nBdPc8L0+daKOttn4HD4amxZF a4CkwTTxXhCWI2Kq4h9LxTumkzB2i/xrNdEuNY+gLUk97fpfdblyIGmJJp5JEExGBIqCZxle4jmJ Njnq/JHkPBwFGOcAKUzy3g248WUUbO0e8zl1nuf/mlx9kNzIRxd78i43ct3lBiQ3cqLcgORGTpQb kNzIiXIDkhs5Uf4XvCkz5B6wzDwAAAAASUVORK5CYII= " id="image3149"/>
- <image width="156.57143" x="89.857132" y="140.67836" height="65.897751" id="image3075" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPMAAABoCAIAAACrNVHoAAAAA3NCSVQICAjb4U/gAAAgAElEQVR4 nO29ebR9SVXn+Yk4w73vvvd+7zfkPJFJAmKiKS0qMpQMIlQJBYhoaQMKWpZFid2WrdCuokpKWykX WtqKJbZDtraKUoWKE6JLUFBAlDlBSCAHciCH3/SGe+8ZYug/dkTcc+f3ywGl+7fXXW+de96558SJ 2LHju8eA83SeztN5Ok9fKKQe3NsVRfGox1xx9aOOHL/MXXlNfuWJ8qKNo+3Gme2eHtbu5vF9e/vu 4Iz77Cfb2z/Z3PGZ4d4pOx6aB7cNX4i0ublx5TUnLr92MDiito/mR47nWb/dOZLtbGa9QtetOzU+ qCvfDNVdt47vunW4e8oenHGn76mr8fneW0z5A7/FxmDjWc/88mc96zGPf/zFX/IllxdFBqfgPtiF IRyH2+K1TfeHlpMtnDzwv/nes+/5vfyDb2/uuKlyzj/wJv3Tp6uvvfQF3/RFT/yKK6691lx77eb2 9gBKAE7GS05P/+IMAMfgDNwLPaBlb2z48G363Tf6t/+P3Y+9Z3T3ba017vP2Fv+U6f7L7LIsXvCC p73sZc946lOvL8scdjuDIZydwx7oDmff0b2DcDawz/4228Dt1fCG37V/9N/sx987tvb/ayOUZfqZ z33sC77++n/xL7708suPxdOfhFFka5Zz9gHUAFgYAfK1pgZ6bNYMK6rM9n/93fVv/eTw7942amr7 ABv8p3/6dU996hWQgdyqAKCNxzKaV8FnZ37oPd7f4RzO4Zx3Du9xzreOg9bfMjp1duTPjPw9J4f7 p/3eKfZPqXtus6fudGfv9fun7fiAauj8AxNx94ezd3aO/OAP/q/f/d3fesEFwrtngWnOPgs3gwbA wal4/o44KoB17BnQsMd+n4GCs+x72GZ7d+xf+WOn/+D1zXD3gQ7PPwXK8/wlL33iq3/o2Q9/+IVz /zwLQ7gXBnAx3BTPn4QCDqCB7Xh8Jv5333KQsdVyABRstRyMGA0YAAeMenbwY79z+pdeObzvzmbu iYelt7/9WU972pcAsAsZHAUDu5HFT8WTpxb9ujvWXbI1ewos7LPvsIAHCxbXYjwodIv9+Of8+9/p P/JO+5F3uDtv8u4cGeHcODvP81e84jte/eofOnHiOAxhP95hD26LnK3hNNwaf3Q6znhgHz4Xj/cM 1kEOYxpPpmCffQ9bbAP77AO/+PvmdS8ZjQ++gCHKS1/6nNe85rse9jDhiWX0YQC+LB70oyA8AGCr c3wQQd0ZwNICGduW/cTZIshbbEH2X/9g/NoXnRkd3B843uHsRCLL6Ejus53x7VJ3rCfk2KuxGXgY 04wZCQNVuBajICevMQ1WoTze4Szeo97x1/6NP+o//HZnD/cq+rBvCQ9/+DXvetdf/vRPv+7EieMA ZGDgs3Aa0tM0ODgOV8bPZucefdiKn1yTOazFajJAmFf+pgn33c/PP7RXvuiHc509yMru54HKsnzj G7/7hhte9rCHXQoXwEWwc7ifXgw7i9h6C9qEuSNbF2Bl5Y/gpCds3aN4xXPzj997waO/cnPRU+4H HYOHwQCIkttCBqPpzz704Vi8knSlJgcUaMjINJkmy8jAe8jIAYsVnvZ4i2/wFv+UJ6s3vE3/ea1e +l9Uf3M9MxyWs5/3vOd+6EPv/+qvfjwA+7APLWzC0c5VZ0HAcRcjnpi+ING2ZhNw4CIr+9imqWYp /uNrsrfevn38kgdB3/28UZbpN7/55d/yLY+HXbgd9uEiuGTd7/oRT/eAObYm8tMZIKOfUcQzAC2t MLewtZzc2VDved+Rf/7SQ06qw1DewdxHpnlAaBfOwtHuTPZhkd9Og1tRAR485Oic3IPBOLpLtFLg 8XJSa176Kt66p575nUqtZO9Dcfa3fdu3vPnNv769vQ0NGNiOnx24Aq6Gq+FL4Wo4Dsenl6djsBE/ bTxZQA5ln0FBSZim5BQ5mcN6KChAGbxCZ+jrLvXvv3Nw/VPuD3MrpbRWSiulldYLjrVWep6y2c+a vpym173um5/znEeBhUF88Q0oYLDocwIKsPAIuAjOQgGXwRHIIYeteNyHI1BEruqDg15BnpH16Fls TdtnQ5ErcsggK+n99g1bz3rJ8XPsuTJybTMtxURyS8MeBg+DSzrvUkAPaqii5O5BpsgtBhqL1eSa 3OBErlnIyHMKAagG7UGBxcsFLd7gTfzqtf/3v+x//O0UvaVNX88o3/7tL7zhhp9VysNB7GJR5A2Y KGCAI/CweJwAZQ/OwEb8uglDIK6qFWxoKDkYMgJbUBCUCVtQGJzFFGThJbV/y18OXvKN9V//bnro errsmo07b74m4iXpiXrJcRmbug/A9sytXv7jd73hP9x8mId+1ZO/+Pu+73lwd9T/5G4t3AtboOIj gCFYuAQU3A0XwxVwD2SQwz4ciQKo6qxnx+Ly6CCDPuy2mC22Ndkuw37s8z69fYZH2NZkf/LrW4/8 QHPzxw4O1XGBNmETboEzcM20eD4TdcQSroNbYA8acHBJXGdMd6wzgNbi5S1ychNxbIs1KIsHcrTD 2jhmwmd9lHA28bWvezK/eiv/5pGMF73QGpn9tKc98Zd+6VVKmQiYEp420EAZRfJC6kHZUeeBxTJj dSNETrpwx/xNb968/muKVT9YQIdh67rzdg+UfvYnXzQn4A/gLgAui7hCaA/uAeBioHPsZO2evjjR JmxHVfIIIL3ocJFdHLiGpgxiyJXkwF/+zaW9/uHXvRxuAeAaAG6ZxpMXx+UlXSPLctExYs5SS530 gU366XxN28YlPQvSLZDDC4cYZi2Bxy/h5z68WHKvYqpLLrvozW/+xaIQA2rXeJTYWl5+4Wv04vm2 c1LWpvujzSjIALDwpr/YOHphdvjfNtSHYGvAwS6M4+8M+C5mKMulA9alJzzlMY9//CM6J4awF3WP y4CopbRRV2ERc28uZ+tE/cjWe9DbnOvYfYbAduf85Tv6e3923vK4jC4FljP3UbgcLu9cs7OarYly KuoDOn08ygXxhcGZKMsSicBWTGFwa7ngCv7D7y140CrO/rUbvvfYsT2ooY4OxSGMIn7S0RJSwg7s RPB9AezAUbgMjsHF0IufCrbgMuhBAZlgRIGDJT2FbnElvZKixXpURiY6suBIWZi28vyN798+JOr1 oS/K+LIyFbXFwgbsTB9baGALNmAvWrgCtW274AFz9N0ve1LkWmnv6QjP+rAPN8Kn4GT8DKPWuBvF hxxvQj/eQUTYRnybLrrbhj1LDcdyeoKqbZADmUXF18/S5ye+69iJiwaLGj5PBTwMjkEFvc5xl47C paChgh24CI7C0Y4RbAsGiQdycrGHWFzTWSRzMh9fz3a41+BNEKVegI4XxONwlqbCGq5/Kk/4htmm L+Xsl7zk6c985pfDWTiYXoOGnTFoII/HaY4N4BrYAgMFnIA+9OEEHImz4sKo+ghGpMX02ejRN9g+ vT4bBqdQBYUP8EsrMheWKnvdlfzz7+hzCFIoTR6RhuhwY8gyetCCh63OsY3a0pF4LFRBY9r13oIs y573vMfBLtwNpzufk/Bx+Cu4NS4/QmfgTjiAfbgTRmDjT3ZhF1ScEgJqRSia9BkxtjgoG6x8PJno WxsMapqaxuG7n+/7ucsP03VgIIuAs4EMrpwzXI7BwAnYkV6Kw112PkVHPGcO7dE5vYKemahr1nTe qo0MXeHbqGXm4GDc0jTeGpoxtiXLMS3/9vVk0yBrMWdrrX/4h5/TObEHd3SUHqCCEeRxBvcj62yC WoS8N2EQdam7O48+0jkOWHCGCooiGrAy0GCxFvPzv7BRlOdgj09kJ2o7yTbsaWckdIcq2JuTVYvp mkdedPRoC7fOuccBC9tw7bQltIWNKA7nHlxt3XDDZ178v/z9k571ge/5sfd/6lN7EZdNZnU+N4qD aEXeYbulVaimAyZzej/0jcd7/XPVVYS24cS0VUfuLG80goPl3TihnEIUAIWST/e/Hu+j2Pbx7RS0 +HYurMhZrKHs85XPnnnEInr+tz7u2mu7ckUCcWzHXCAmDpmF0stj2IywdYpGo/Iv/uLWD9342auv 6D/hCUce8Ygx3A0uYURNb3s5+M7nGpmRgy8Kvu7b+n/yywtduGvIUmcAfajgDBxT9D0VAQgOibZ2 DbDraDT9w6CRr3jaJXB3XJp3u8bmSKfg7DTfH1l4q5Mne096yv+46eMh2Obdf8YvvuYTP/lb13/f N30plHC7nJ+f3H2KktLQQL+gaKNyVlLm9KCfZXzF04//zZ/cs/Z1DkHJVibO9q1oFVlGpbTEw6jj fi8p2yg7PF4ckOm/glLaBsS+3SETx+T5/573vmVyfjFn/+sXPbqDDj08HGyU3DvT5jDXWSWBYcQn Ym0df+ITd33ds37xjs/eK1drrd/ylmc95zlboGEb7jTUOZeUUahkFKArGkXh8WIVmvHdFLHZr/4v G2s5W2tVMIAsSkcUFeCwGiuNjP9qfBASB1DAhqeGxtGCgqpp1htPvuQrMvgMEHvvKJwF3VFM5ykB +q4diR/95RsTWwtZY3/o2z/2vS/48iwj3XBMC2wzHtECm/QdLeQaB06TG2rAUA/Ygj6MoffiV1x0 CM7uxxfZhJ1pEJVoG4ZxmgkMFtvuAQxgC0ZR6xuLXUGRC6oTyCFkOpYpizJRbJsIiRIQ9N6LnPYe 7wMKti0XXU1vQB3ZYQFn9/u9Zzwjg9shg+Oxu8VgNyO5gSqiFB2tWlfEK2vgNa/974mtAefcN/+r dwwPXqzUHuDwOT3AiIcJNhmMaUY0GwwsrcUS2Xoe5F55Ql1wWXnyrrVBP8dg12MUfdjtTJOmi50U mQo+0VZzFvoZwNkDqpICxv4QEbY7D9uNcAvYgTulpXAGduc0/hnq4j3e9POfmr+iGje//rYbX/b1 Fzt25TU8vqCAoShkffCoFgPaUo9oxxhggxLymj2gx/a3PEG/fO3L0Mb2XxB7aX7V2o0xQlfHWJEr oYx2emlj7dl7+gvvKfJ+OTCDHff0b26/4St7Rd6v4iuPqZPiqEDsJIJSrMUpdEe2mRYJkJK/1gSG PnYJd0d/wwKc+ugvu7AodGw0cKwTx+Fi8JN8JORFGF0mgLC1TJyRte6Pf/cjM/cfj6qbbrLx8Ucj 1Amt6VGOaErKTXqHAdFf/ow1eNF7oG+pFA5wHcTpwQfMHb66iXreCBY31AeLY9YW0xdflUUbkY+S +EoAbl8ZEbWg2ffcub/wX+985x6dkdtia4PtPfaBAf0+xdacnrNBuUGvZgz0OA5sHt3b3F5rxJQp enU8Prnoc2fnmmRIFS2ziq/cAu/9k/0//507//iGe/77z9z38ifefln/5u9/9V6Dk4+Ztoe0YFBt tJN4j3OYNnwkSMqa8BG27g24KLkKF3L2k77+onh4Bm6B0+A7Tq+uorPfcdcdi2x9B5wVz84HP/ix g4Ph/CPe/bdJqokS7RPecCBsTbQnr7btPfH5s8tO0cu2doqd4/0TF23tHO9dek3BZB3d7d4t3lzG o0qcLSTMPaIGcnRDe/HV2c7x3s7x3tET/SPHescuGOwc72s91YdXnQjtceyB77A1cBUcO2REw96e 8UsilE/f08RH0IJFt5iadkB/nqf79Av0Bj0HLa2wdc1pB5dceRjHwtXAEoVY6HjnGrF6dUmYu1Bz Tjpn3W/82Omf/IkmtnMioQxepLXHqwisZ0L8nMU0ALYF6A0ALrxycsECNPKML+s24kz8nOoMSXKx 1nArbHX0pDtiKIyG5tSpW+bvD9x496mudg8bDSNgQN/R5OQ11kErkevxooUmtyc9eZZRvuNHTrz6 lf4yLtRc44IHoYDMgafNUDP8YiGjGrKnO50rE2CXs2cZbrFRYU6y/wPfU77qey5OvyrJaurHXnrq 1N0Tb3/b3z/gMx4/ZLxFvcHuPiON3mbg+Og+I2BjkZ4NjCehCnzi7FJP4Z237MHdB7QFfUFrGWyx ZbGn2MvINthosGPGGdkWGwpVYV0YJL3H3RXVhVx46dX9z3x82UOE+tDCTXAWHrnkmnz6mrNRTie9 Qg60W5RK8tuvrX7gVSWQkyU0YkFFx431AXKYdjJuIqqVxjRYg1LYFms40rE5Lei+h18z7/fynYj4 e6NspuMhs50rT8BxuBk+s7fXNYRP6PTJUYyjEGplUDOKBl9HXaLB1DigR56j7SLv98Mv1Fqrbo6Z VtqDwZccNFgNJcbEOe/nfOgOcsb7DPscSRK9pm6xYxqHa7H3sX+WsaYedJhyFwPKuakBM/3hbQwl MO0+9kpyO4et+wsMJgAVLTCgt83g9rNLlYezJ+uzHHiUpRLzwhYDgzvJmQyOszOiPsMusMOORhv8 mAokLHD3DAfAGLN5bG3W0hBugwMCaEx0Zs60J5hkD4JO1bLbzcABFi5Boz07ipfUsaMaQSDy81p5 7733bSdWqImzpqkAlArcv3Px5JoFnH311WfnDDeXwolFwYrztAFbcFrsA3t7i+1Zwz0Lx6MbmTH7 hHWz0BT1tCKVQUlmwaE1et5a0h8Uo4MpPogG3bN0QM4ykgsazAANNNQtTgzABRlkQ6o2YHQnoaEV jQgVj54Zr0zLPVWIukSBnmfuhdSjN2AgiOLMeCm4t9YD22yOO8MkEaE77Fg4w66GHXY22FgBfTa2 DukNODFnl2yZBCw8IPKeW+7111y0AHIGQOL9MlTWvQmgFDsdKDTL2XmeHTkyz+5iBTsMZ1fw2ZjM d+3e3k0LLxrtGxgl7b6l7dPfmMOIGfTIC7THN7gNNjRacm2iywZgsJ2NOjNRad0LML3Jg0pdsRLe urAC4mHE2OAyMkKYjqvnDAJjmowMdDuFzKdIo8TxpFEDNkbUa/nb4VpaR0+jV7RWKTJQOIfqMdik r8HgMkpgl10Nx9kpl0aqBeoNDh+UOxtoADxYzH3nLYs5u0tKqWX9LCTMffSiyZlZJi57ckbBzvRM PQPtIsk9hM+Bg81OOJGCAXzyE6c/urAdZ0/XonrGQMzM4GqGhPS4ShS+lqakVGQjRi1skgMOp0EF Hywl+cbmFBuY1jZRrgsV3DfucOdCvF7jznCQkVUYh9M44ekG21XbSyrggCZ5zmaS7XcZp+9bceCH 1BXtNv0WO6LJlmvFA0oxP58ZLkUj3rPPqMUNqSyNoeei2XTEfku7yeaYZkgjnbBP5aCgaHGG3Qor cKgerZGFdqnPRSyYPjLDLhzANpxJFs9ddsUIXTBwuIrKL2FNWZxm+nmqGQZnZ/9lDc5GCN6gNEC/ g6PnZHap4ADUdLiIKNEycQdwXzy/0TFd7HcmcQW3wV333bdYoR4NR/ucTC6oEZWFPv2ScsyophXO VmiPbvAj2hZyKqCiLWO0YUHRoyz6UwNQ16ahngbT9TJpOabRaGBEW7EvonpE3U4wnwXKaFypaBvs OM4OD34aZzfYonNx3ckQUVTRtLxUO2xwDSOHGR4sjVFpmuaAsUjohsbhDEq8jC2mR5HTa8ITGVGP MIBDAS0VqApzmt3T966xZu4xhFsXQbn9ySXdy/ncaU726cvjWrwYtEdUw+WxCQdnzAjdYCdhq562 Dp3WVN7EOZ7MI209cT2KNpmXAGUn0Gt20Sv7aqW37JC0J16b7e3Z4P3V1NA0tD16EitSzsVD6ujJ FbY+ygDIe1Ndr9XsW60AAaOOOcLhxNTQ4prFkp0aM6Qdt7bFs8gi2ZUtLbY9HMLukryjXh6lm+Xq ODtZYFP69HtxcehTbFJmney7hkZBQZFTiPEnRf2tzZsehui3c6A+fVnKRNXJYkjnCrRRP3B2i9TF cPNoJHH2IQMdZ2gX7uvEIp9Zc/kcbbDRozzggGmfKnHIq2m2Psson+H/Q6PHMQ3QIx+TLMQOKNA5 irjEA23HlTBurWnIi8W29gZbd1pdoPvkDdathIkz72jALPerHruwB+yyS8ipC5SFHLJ2RCvzyUOL ETHh4zVp9O/97GEyLa4CDuE9nZBEfYwYNTQ9em4J/EvUHirSbA2J+Q9QKmDuuWCjQsy9Y4XtzNcB HIFB9K6neIMebMDFILlk/RgxgphC9/cWe9Ha1tzHWUOTRe2toHDRG1vTxNzPosYZzBgDmaGtMAf4 jKyHOqCuaD0+y6cYzLR2vDI7Jg3RkCZD7TLaZTwvpEcYgxf91URnb9s605CXFCgP7Zwtyzif6Ul7 PH6IaXEaDI3F9xZHX8SfY0Ly3/KJ0Nu093EmQ/foNTQ1lQ3PCnHcLv7VMVKyojGYHkVJUdHUmBpz 7x1rku4sXqDzHge9qSmU5RyB0QEHG/QzjsBoj4MRI48aMBgxGlG7EKBXVTRj2mUmjmrkxniHM/GC ejxBIGLXy3Lq0QSNpJOmDZ6agEk61tRZzlbaCSTamvqXpNovNOGN4dbOtExLSwOnqmqx5DHGjGmK YJEoM6hoRrTJ4tFiC3KDGlKJAa5E71GNsRmZwh3Q2IlncYop66rd76C6gsLhDCYEIcQyAkBDY7EV DhC7r/xEch2q1gFFQdU6ayhK3VQx6aNh7B1g2lmb1HOytYLwUOkLK6jcbA/QfcqGscVKzLrHtFgf 2K6Ufo9JTa2MaY+iot2jAmxTVKM14eb77NfcdobdDDbZsRFrWazlTFo0DGdOsUsIT/B7DGXJdbHy SY3Zp169aHl8Ytz59cqaWR+knJwYtsfASs4uSpXF2Am/0lL2oFBJucWxIcOaWgcFF9WRNJGtS0DY epOiiWwtcGWmFMkn/tb+6i8H7snz/KovUl/7BLGoaGHursys8Qo1ILeQsk2Fs+XYRsXFNHz8b/iH 96Tx8c6Cp10j+B58+poXbmwxABra1A/SdOmIEY2DLcoVq8ObfqM9ZHmxrNNjq21vqnNlzNpQHi8q 7DKU6L1z0/9TSq21Ya+leZkNka0f6tI1JeUxjrUg7OvxFgWosIq1gknKYAQIbE0UutKJBYVWU1Lw I++sPvLOicy+8IryqbdvabQwd/e1bGgGIrmTvVnYWrLRkku4bdwfvd7/7R8+0B5/gKSUev4Lcx1D XGSVk1BPTdajBBxNQdGnaJevD3/yS+tnZFJDTWdZXGNYBiIciterHnlG3ilzMP2UKD611jMO3ftD sX2znG2tG1J7yMl7MbTD4/YZ5VSDkNPWpVFMkuvDqGa/xwYUjtFZ9qtq8ctYYwELd3N6TANG5GVO XlCYiBF9QCbOYCzkqBG1CNcMxEJnqc3K2pbOulG8PzEmQWZFjXG4JkIUC9aRaRyY1kcrqfXem4am 6tQE+MejL35i7svqDJWHHK1xQEmRh1KWDTCgLCgampbWoaSYmBguK9oae+dd+hPvW8/ZDsaMK6o+ /ZRym0HNeMSopd1g44DxPqOadosNMTKOaSraAWXiLQ81y6zV4LRDgW+bxf1rmtlsAzo2bMC0WBNg d6JZznbWVTQa9rFDhg40eoutnLymrqlzzoqNqaBQXAA4Kqg04wOGHnpsA0OamnZZQLO1bkQjw5DJ CWwWu14WrxIabBMsccphJQhEgUNZrPg7HHZ1YWLvqbENrdzfhRpc6T6B5S1+PHRKqd4A03qxp5pa Os43438StdeOnMj+2zt6gIc+eY6OfegM3qMI41Ic0DbRwm2xJVmPvKLdpwZ++NnmMNWcq7q+jxbo U+4yHjFSuAxaWgs9elAe0FS0DrfLsMWmpN0RTVLK25XWEWudR7e1S/DatF7inyS1UdBglk9B7XSc 0HZWBG1SaAGQjqMejlvaMXUymrqYlr1PZTgNaHaAPXYVbHMcOMU9pzhVL1l9upSwsuTHDzH71BYr qk+3P0Q36pGJuM2hRyYJz6uT2JVCYbvXp/tYrMN5nMM1tSMGQ0ocWQr/Fbbu3T8r6AMmpVTR08cu yl/8nwZvvXdD0hdL8i0GGp3DFsUGpZj/RD9paMaMbaf/PFSixsFPf6/6zIcOVaB1f3doYYcdYJdd GVAB0BYc7oCDMWOF0g+5RhbisOXTZXGZD+VGuCbRnDNMTdAV6E02ALF59elnZB6lyUuOAC0Hjl3N jmbnCKU4IEecrg+RDJt1/nY5WKQLIJI7izpJFnnaYgk1DsMPV1dnEF2ke326T1ITFeQlZU8D46GT TKSkOBLZ+qGrWp8X6uU/2+tt0Buo/hb9LXp9+lvqsouLK46rCtMnB6qI2QYMDIxpSwrJE5Ukf+Hv ZfC6JPuZH3R/8PpzcI1cyA5wml3gGMcyGDHKOiKpoBC70wYbhgWx+GtJKa1QWuuuyTzLpwQ2LLCN COUlWQGdAMBwfunzoKU9HRfxGOxme/RaTEWVkYFSaMe9onuZ6MZrogK6TMG11o1pc3KPMpgam7KX Rbq0WNvx1ERYbIUdFXisw1nIWVNZ2TlvoniW69N9mhbnfBT5yuLTOjjpTeXLDUBVwwesri8nnfE/ /9us63ZJZKY1NmFrYMTI4z1ZDQZjcD6adLrSuiTLyfsU45bvfMb+R955Dqac3kaxz2hErdEDeoZR FYKNsZNWhbjIMfWQKifXqBpTR/+rRuuo2Cwk733beGtCBHZeBE4Ia2Y0V8+TNXQd76ZdafXDT3rF 4iRiuCBvY5dZlEZXjIEBmw59lqFcUwVM1s9iwb8VvJAHwSw9lSXOlooZhFD0ELahJbevdToXRjSt 986orKCB1bsjeO9rjOle3xq5T9e0NMPTpvUpBwmohh5WBuA9UJqtTNCl9NiS/AgDBSNGPdDkJrhR sxw9CuFWYtuZkhS//Wv1z728qcfnpgKPh80IDzjcuBNzYTutamgqGnlej9zCXqh0nMk6k5E12DHN soiotnGm7fi2vKfDtUpNjkVNDG0wk2Te5H1ciUY6VFKUFBbrUaKJb1AodEGvT89iW5yw9VE2FTlU FVVFlZPLcriCFTw+lQpQqKRkKMjJdFgorEJpfAaGwNZivxM2jUJ9lTBVSnm0My5dn+6TFXahE7ub WgdTxw8RKaUK8pnXmA+3yNEeK1kaIrkFT1tsjUvGUE+WKom96y/df3xPHo4AACAASURBVH1Zffet D9VGTbI+qFjbaUgLbFFqVNMZ02KlDbm/qauhA7JcZLY3LXlJltOMEacv08gkDUryqwO2M5rrixfa EAdcpBA2QikGIxL3KJvAPkNF1qdfUe0zcrC9MnjXhhi6EhhRV3EkhLNVtKlnkMXSE8KOclnWaY06 hI116vp4H9NIOI733nfBuhhG+pvK+ynJ7R4q9oBOEfFE6WtJ3o+dOaZtYMCghorKA2QW2+KzuOgL OMnI3vYH9sf/1Ti5Ts+ZViowDY04cYleCGHlLUpgj9oGh2iKYV88TFIOybQ+svWEAsYoJ4aRmZRe VuDvme/OhUB7jzGR2wryHA0MqS2uIPMB/6mCvKYZ07YYTSaZJi6YWrN2eYEO8ZuI5O4GxHkwUsJL NviQNGYXXiAvnW1RmVNKWaW8922lVuNf771xpnu9zsJ9rPHE5c/7qeVMVj1Rw8t+OH4IgXaY0lOU 1Iy8Y3lQZAP6wIiRwWh0RiZwzsRA0BoUpUU95bnmn42Lt/6G/X/+o7vn1nPm73rcenKFajAGV1Ao lME43AaFQqn43PQTYesDmhaXh1KMxmLt8hQNQAR2XijTemtoa99M2yC6gMQ0E/1yxk6SdWLj5jk7 pCHqKONydI4e06TmC9LokW2z5VB7sdJFE7bmkHpcbp9R0yxW0r2XkuBKdtzRFCkYX9ZWMbnrgsa7 qQS4Cmcp+hIxI+lxazyx3kmnyBqAaVWhfVP5ppqKZhLYncKCgbb2EcAp0/hlsuHBIt1xTQtPqGhr 78Y8ZhTAiJGGLUqLAZuRWXTiMAG4DXUOkD33xfnzX8w7/8y99lvr/dPnwN9KBXt5QVaiiZjeMjmf oROSFKPWAQ2wRSFs7TE+mtcWUts4UMLWos8kmjePCDKRACmR3DN27kRrdKIcXZIV5DMxzzlZn15B 4eYcc6lC69oujIqIzlihOs+1OINYQuVcScwg8zNhRaDCgxLDcBjSU8dSDHsBWayw9VEGm/SjNdN2 U9oUPsXbpNpxX/NM/fv3lY975jlsGqEzyQQNrpb0LJicrzrP9fjI1mWPXOxRxHCJFdTf1Mzhiiyn N5g16SZkkgBJt1BlF2ev4mxha8DgehSb9DbjrhElvRbuZfcke8ntlKSOiZXvV5BH5+R98pzMYAS0 Rdy2gLKcvAwfWZhEq8iLiZd1MSnS/hyJTeV40pjIu2qOPj9srZQq4jYA4hGzWBU1wu7gtrTC1sAu VQ2GrIa2s9aLTiU6TE3d0IxpDmhabV/3tvwF33/Y5EWpo1CElFCbnlV3mNtNP5cOzj6gHePqENOy dJASzgaKnip6isjWMOUwF7qfOLtLBufwEsxdTsSqFkbUczslHVJUx5v7AmOCQ2vqRx5vrdNag0oL EEwZL5Wa1JpYE87h6apQ4oIxbsFGmilLusv0MqOSBeohIqUoyTRFRiZSVuDppBnxYIOsT9/DWUbN HM6WayxsUGoY00RHBNajFTX2u36Ku2/O3v3761e9trUtFpyPrnuJglShepNz+IIsDV+Lk3D24Zzu tMKmScTZiZJ1rx5NneySsETC2SKtV+HsqRcL7pJMdawCedDExc7d68aE+nXZE5MrvdQBspKl231t h4sqnQclqENnmNbbaPVUWpnWm0aB4hylapZjWq81OpvqrJm7BNGeTQRDlpPlhwl0uz+klNpgIyOz WIPJyXPyhZxdUFjYC2VGluJsYesGMoqQvqUmfqDXvplnDEZdpWIhaa2ABqMhJxe2LikzsoamCk5i VU32mnHydT5HbsWTrHFSZDW1J4Q3RXPesvSibtB2iC3pcPaqhTyhCxePJWZSIvKAimomPuGcKAkb h7PeykfiGJVSqarYjMCGIKRDwO05avxyvcA1YjmLZZOjKzkOswfhAyeR2QazLOrGYseMCji2EmdX NLaDs7Ppkc40z/qO9YBb6eC4S0FEMmSi5d//l7xflJ2DggBr7dkpOmrOZZADHvPA369bBpyIdGeK 5XX1Re+9syKtURp9jvzmvV/WR6moRV5ODHwyo4StxUr4UFBd2Re9cHdrJxscVVtH1GCHctM84n/K vvq67Oh0VZA21JEaWDgIeWLBnq07fty6g7PdIoT4nT/JH/3CmlZ55xWqJHeQwKbUV1CoPFRTechj oe4fzQ6y977BATkKvMMpnEanDPsCL9uw5uQZRROnb0ZWYypMSZahDcazvLqPh07sgUZ3p451AVu3 xs2sRHJDpZMtb9WOgMso/ZZpSG3bhDqmkv5lJswYpB5cssb91ZsXZ4mXvfzCy8vv+okj//qFG4DH ZlBjFtqz5Sdtx1ewkK2B/oDt42r/9KqXstY3GDGX5miNDqZTvI1AIHvAnB2Acrs4SDVhkoRPZDi6 jGHj+UPZRnxMr5LCdhW2xfpOGtXkvtiGZkQ9pLE4HatoWuwKCKxTIur0Ja1x4wNrrfVY07ouWhAz vuiUkoDovbeGBcrg1Iv4LpFCbQy2VWIWNQ22pRp578kL5T2mCR/pVoGAM6nEnx9qanPnzaPXfNPd 11/yudtPO8FHllEPtil7kGN7UKLtpL56JjBd4fLlFrdrrl/zOtZ6i63D3jeemFwjcW82BpY9wBd0 Fu+mClKKXc80eDeFpGWk0tekO6aE3+7cWMrZDW6IqfB13ImkRCnUCHOGkXzOMq7BU9Yx6HQzuKDa tuPrWUhRWgO0LXXFeORGQzs+cN5LeN2s6iDA+pw20mXRuKb7dDm+bTzQH6hsST3uc8V5Dzqdvqf6 l4+5p2p8RjZgcIQj/Wmc3fHmZMLWZTQaLuyyr3z2GnHrnJMFIZuEDVuxzM6cf0CkALwPq2XyL84Y c7uWvimBbYDgJz4UZ3ftFTqydRPrEwi5GMFYUvbIha2HNDXGS/7Lci60PuolKljTRKDmhepvaqXU TLitNXgXknnPyRoyc2n3PkS7aV6SF4vZOsuDkVXsrP+4dPLu6t99255kaexRd+3ZlWgIoS6ccbS5 VOkFljD3l/yz9U9cuDfS/J5JD5CUpijVTNCInO8KlBSgNuVRzwNbzzjkFwii6BoUhyrgPK7BOcjQ WzF9AzC4MY2j0ugBpcFLLblNcos1y9Vn571SOJxxTmmvc1TmQ1N81lTOtB58N/9HsPWMoaqtg5t+ FXm8n+igAsjaOoRlK6XkEd1yPF3M948uqmfo3X94sNfpWIl89GHPFpv8AzqEywe8J2/d1bYd7srr 1gkIr2tosD0yiyTd2R5ZSS4Fg3pkM5WD2uADmaXWrCkllBVICMOKDk/RI13gkZVTgCTRnAbpggap cCmWQ8Vq6hY3pPHRwJRSlHPw2CoCEoUagVmZoZijrCBgi9ISbaeUUm3jxAShlLatT+YIa5Br5Ktp EPyQl+ttzDPVKqT8SlZ4pSYLRbezupgvL5RMp0PK7MuuzWVR0ZnOtC6KHGhbUxT5JNZNURST1UGO 27aVqCyhg7PujpsXbD9XjeyNHxs87TE5IBv6mFC2D9vxD1iQl/A+JJvoDKdcWu68973NIC+WkbMh iMigRMGR0MsGGzOeVHdXUvlqnQe65YRa49ZWxzSNlzJo8/mOws2i8yTvejdyVdi67K/LFtOLzHwr SKM1mXhWN0NhEPHjpDIYC8jirHdK451q6+BNBG+NV0ppvSCCbwrbKF/0gra3FprMuK9sS1aQFxOl W/TuejyZRSk7IyuCneSQwvt3Pp0XoENpQo6xBZzh4BhbabvVPCYXCvU4AozZAzZCGt7ol9973797 wuKNFf/shuZpP5kTEt663pwQCiFSXCvtfIxE6DlrfTsKwcDEpJCiN5tk1SXnPNG6ZwIr5y00GAUD cqKnPVxP4GnrfF27JJVM67Veil9M46thGIveBkA9mkCLmbETu9a8FWUeZy8YLhVLWKg5C/8MaXSE +yh0TgYMaVqcRhVkerm12VgRbOgMNQWblHcKyApvmsVMG2x/SpnmUJjbuyl1RNgayHKUVmI6n4Fu EnomX88VYffC3tvnRt00QENjlgeD3/7p0X0YwOOzaG820UzRhcJa+RCzb30zxvuAZVOn9TdVM17V gV22TsdZDCccTUsuE6V1ppVVU+ve2j7M8jAo9XjaN7zOE5c0zjU423vS1jCyeLbgURlKoVu86VSD VaiSTEesUmNkG2kxOY1oV+RxZZkWYKgUSk8h8mDRqydvKBkAosyZxkt9CcES5SG2qM5yZiq0iBiW AS5K5b1PBuy8UEohmXnS12KT8u5QWpMm0xTNJHezXruoWEYmFO3WLaNd9lvagV5a1333ZJSF+DFW hZJxzkLrvbPkeTDXOu+snQTYFD3l7JSTYXXvee+CXwIvkdkqHo8xFm+tzzJl7WSty3Lq2itFWeoy qi6tce3KbshylAplQ+yiwOfFeZBNF0CGpTjRXCUdE3YJKUK5ZQi1GbzFarSkcBLMSc7gxAusYuXS HK9xBm+X50F675t6gvmsmbCRaX27yDuTF+Sl6sakizcxL9fAbNGtBCsnPCO/FUEueL0r19uoyuSF Ejs30zXjVlBOLs2Pxe3bFIywjBqaOuQO9hxNS2ux+83S4tbD04mzXUNgK49KRQbbVjnrnfPeT3QG 72kqscp3WrvypZzz1ltCxp133mmFQhnv21qSu5Qxk/xR4U7xss2gkVWPCddMxT91SSzZM2jQNpPy xGkydGfFHGe3k7MyH4ogrQEXHVqZFLS1qDZMAxRKoX0szis5efcjOG4WV0XgkZfMhP+nQMf7lxMw I8jzUs07z9v4xBV27hmqMWBKaCAjKyj79BfmX9hJAJlW9GrqPXZNqCK0CtRXQ7Er2zrW8PadjvLe O+fs9CYBywLTV79Ulqlk9Rf9XgSFUirLlTXeTu/s5z22FROquh+DkgoEd++ZYlbzctprMwbobUyJ +VU429ogrRNbAy1OoQt0rJ0uhYKoUaDiFlKesPNQyl88N5KCY9ZMZGcaLZjNIEpsPWPdXEYzgalK hyCRiZyuJ+tGl7KcojwsWwMWuxFLo0hdm2VXusm+7mh0j15La5br3Il8cPFONifPofbee7ox5cs0 kODe8/J2a9y3EsiTmNt5sRT5LA/MPaPDCFuvfYWpp3SaIMxtO3npouCm9GrJjJT1TNTN+QDu0JKZ 7y6gEeVBhY3MlGdSrMGHUiRSUjYAcRf0YuexHhQelEPPby8SbuJoKpcSkqNhJFjmkyiNrqbgEp+h 6iCcXJtfY9rJnmtZEQIGQm7OdHyIAJ70LJkPsm/s4Q3b4uLOyBSFwUt96zLGlmUwoN/E45rxPqOZ 6I4R9e6ZpVVpnHUV1pNlqMq13vvGM9oL2EwY15rJjluACFeZt9bgnBf+my2qP/MgQ1sL2FBZjlLh WGc0lbcmVC43004GwTzWTMZFqVUPSgEhiUdnfM9ZHlYD007GC6ZweTJzJZqX2b5Bgc9RDp9qHkQ7 bBB90bPlbVwQhXx0g1XOe7fKni3KcpiaKlQCVxqlMTFDcR5dTd6q6XTEuoLU1TD0cpbj3cRPO6+v dFcGqcySF0QNWR0mYrZqKOIoNjQ1oXKs6ViZauxB3GWhDUVaCmI2uHC580vnq/dUzoOR+oOynoih d0YPkWY3Fbal3KBtJqn4UXte9S625eCsB8q+dzaZjSfHSnnnFut8XUGeIP5C0jpAi/n9aLotMS2j s6HxMPvQecvsLOOYJuSTWshQGd5G6ZJNQp28Rkm5x3SLVF1FSrs7u7Yo2WShkfntHd7hHNYEgSp1 1oh8PG95lUE9ZE6kmIeC3TT2TlYsaKesvykPb+3M6dK4IW1nbs8RmClULKu5Zg4lyFH0BCrM+i+m LyYrvPezRVS8X/NqpmMqTt6QmeOFfWhNQHdFb32YT7ZydiVq5jLEQv7vzCvEGTTH2TVA2mRDmFuF HTvpFsLL4vI6c9sWjFVaqyJDqcW5+EpjGu+9CI/Qv9OxqSomnIc3WQGm19ZmV2oBW6fMZ5kYaQTE mJhwfDUElKzjaxIuAdg7ZTe3fBbFR3k4th5PKtNmkFmwdtV8VQqtMqts9Mv6+UoGMySQr4yuEJkM K3bDkaesZms51nrWCCbjJX2+Vu4c0ujEzMCt+9V8VQYqR67ReFANyFYELd4Hb4IyDu99lvkM1Y3a 6AZZW+O8X6qg5IW3RnmPeB+dxbTeWXSWjHSTTCGBU3mxIBTbO0y7Zgsf76mGlP0QPaKzyUPlOC4v HibPIrhzvTWUfXQerlxL1TD4SlpaR1vFyZlKPHoo0Bk6HUshPIfX+JpaEirMkmLSAMrXlbXGtnVA z0pN2SJEF09+9O7Mlxqz8u5Au5KzrfFtrZrKm5ayz8yxtT72oerGBUiwcdFTs+hoyVPyguoAOq6W 7hS1bdhfnY6nPS8nEa3C6OJ4N5085wUw9s6b/RWPkO0DPRGZGBdqzaRsbu9pnE/4VetJGrP3yrTe VUv1BlF0vE8tDu+fYhRlMJTCxgjdtNfOPK0eHmlUKGCisS7cfOZYRU9kcrZ3UfXhK8Pvn/atweVS u3oy21PNkBIUqo7HqV74gNzg6xhRVC13DeaFb6rQ8miq985OtMbuYp06U0j+pWMi4GqZ3daMD3wa i7b2zgb5Ijb+2IfhWFhQ+rCpvIBjWIPoto7R1hP2nad6SD2aRENAKDaSqpFMCm83kwm0YH397I0L kJHWwSIzv92CsLVpqUbhI+qCziiWuLiKnmgwHuWT/68beisCQKz3yxg60Wqrn0g1caFL4xcetzVt PfHxQqgAca508nbnPd6HPsyjSi250hshjzADMmxDMwzZXxLhZO26NG+mDRpKhYhc0y7mnu460+0H maXnuslOVqAzlF7ah9HEBBKb2gtBwkVv6Vtd+oipvXeZVgTtEg9O6gR53EzhERZy9ifeu7hzhblF BiTpFaR1lKzRnh9yzpdVeUxRBEqhNHkxgVCmnTJXHYZWl9vzbhVDp2Nk4LPQgMU2mUM06Z7byAqf KbJOELP0lgxu2vXL42u8Rg86MRgScZKTFcutwkleRDMzOlN5QX+TotdBBQ3VcIrdpWPlfVsxNy6O uVpKPooAFvWhdxO2TmTb2QWwS1pPpamnltcH8bO8XOhqtWfBAH7mA97GfUDyHI9AzODE8k5mrRIt QWe0ErLQiYAR5JAsG/OUFb6K5toQM9Bg2omAmcEe3cStGTo4u6bcnutEh+XFpOS78HGbch8LdBas S7I6CU8049Aqa5YuQV2669N+uGuzAqWUs8EW6yy9DTXK2rp1zqpe39b4eKz3aaXgRrlBC80Y723R X/pWWT4BCUBagBNkEmOF5FjQWdPST6QfTDMbRTTbdSYYTGfGsa3D+CZLc0oRSHzv7Ox4LXyfwY7o 6NOBqXMDLSMoVloZwU44Rpg8TNcnWcDZd30aDWWJB2OihTz6XETKCoqaaYc1zHhVlgXcbO5M4jSk oc044niNaSYO1eDBUUsn6J03LT6fyDvSLJoZ2uTr0tmUNFJqcqWzKbssOL1W0+m7aGvBY15nypoA QK3xsSKPl8oT6VgYpegx3p9YHjaPLX1EXlINF9hAmwrRd1MHBpv9dOicjzv9jffWaA5pKW7rqZtM lKuMhO8TQwslT43E5yyDlJc9Mhwsk1zyL0mIlBUmWWyFhdKds2IKXC3g7DN3hwMvKGeMd+Tlqp3A l9E1X7b4/CMeF8wgiZQGh/eYemLn7rZbqdCPkxduMQ23fHBNGxZK9GR+UWoBROtSsi5lOf3NNc8C ztzj81KBMq131oMKoDOWfJin5KLrGtS2jy99xGB7sZVGqRgIurw4WOpn4NYb17/OCpI+DBLKLV05 vZ8Kypuhp3874wMAbydgz3Z8F2GBLWOgSEcZCz5s8dEU9DYYdbaMXjCkzZhbbuTSawFMnBnnFNsk AAN47NctvuAxXxOwR15M7L3SQV2Tc/KfC0kw90QqtDjDzR9a0xhZChb2e15MSuos/XmUat6zsbXq SqGTt4fcH2eVVKI6JDkngaYATcVgZykaufaxq2waEniTKiMzh0cFZJqGf/ibw7ZtBYmEUppMz7Jv wtzWLLDYln2e/T1cfHW8Tz41st2bJN5bZs8WtgbO3jM5uXhU3/oGvuN1YUERSCAsLpJb8ElYC8xk UUgezjScwjozw5CXHDkRWu8cXvaDmJ6jyeScyLTYCFEEIzpDVnDvbQvfYEKCRsr+pLWJlUXqdJcw ObYmHMhKGqycjvIQ2x7sn+bgTFBIyin04vOYnpMXOKvqsResn8CuXJDYcb7rhL74yRN81aUp614b hFzXWDZpige45SNr3sW0YSBEuUoUZmC0G0r7Z/R+QfzCMKJHXXot3tHb5MKreNRX8civmCmQtDhk j2j28Q5rqcchUsA2oZC2UD3GNBO4wTLOfv+f8u2vnYyu93iHswENJ/nnTRC9glOFBHilTMwX/Qi/ 9r93bq142U8ELS0xkOlk1HbPd220KRTGdMbv5g8uHuMu+a49O0PpMGALKWwA2QQJKiBbBqCtecTj 1jxL2nznpzh+6VSdeaGiF55b9CSiiKI3pWmlr0UPbzhxGffcOnv/vGQQE81E7U493+0Z0SKKPvVw MRLQGWc+t+5dDAdnYM404T1NhWwg19aT6VduTBojql7oZ08z5tv+D8oBLuL+ehh6OFGa4TOjM/Hg jINHhghIUqQUkOXsn5r8ajFnf+4z3PpRLn9UWESSy2oe3s3D30RicHjyC7n04bz3Ldx5E1ddx+Of y6WPCG0ietS7ekywTGXimMS16OV+1Lf9ytJ/TW7oQl84G15EZ7h1aUiy8swAle0T9DfXz6W//2O+ /uVrrkmYWCwzIurygtZNsPLXfSe/+Z9mgzxf9JrOV730Xbr3X0h3fnJ99G/XdFsNF/eY9xNT44y7 PvGGcGo5IMvxdtIwcesmO8FhqBslIVl/IkHkvMxDoaUY81d+gB99G8QJJAwhZcFmlRKFzoJ1LMFW YWspb3D19Tz8seFlJlXFYqyI0mRFzMyJc1Eelxeo3uTkDH3ib7n7M+v7wnvGe2wcCb18SOb2Dtfx TSZ62U/wrjfx2Y+F3RecxbnZif13f7Kes4VSpdmZlojkvv5pHH0Df/VG7rkFnXPlo/nq53HldWFJ TKvQindZYel/528fon1qKnxq4X5a0oBlPSm8UfRAzSXFRCf/YWJLupSS2FMya/q7d3Jy2VLO/uR7 ufkjXPrwkCUh3CzxYoK6dDbluRXvhpTuFTu3GU1hjIAKIo82lfjqZ8/Xo4DMkrOzHWNatKbohbmh NaM9fu+nDtsXt97I1V+CUmQl3mHbcNwdKmswUYSEN3K09ZTPNcu57FF846vCsWgRwI8+b2odvOcW Rrvoua410eyaDsKjW5oqSJ1ODCpKcdVjePGPTrnGxvuTJnXfRdSJQ6Q7T/pkLYk11jm8Xbqjo3eM 9zE1WY7KJogoWUsTiUxLDBOAmSZFCqR/zRg05XzXT5mFSovhWCZGU02Z55dytvf86HP5qfcGF2PX TulduIWzk64UNm06icczzt5UNYKo2IpiKq8hPaLj+a7dJ9nC2jo+1/B/fd+amIcufe5TXPEoYFZZ 7GpFExttHrg84Pt4Pu9hmhBLWQ6m7N8z1jzv+N3X8exXzDaju1vDVNFkj2koN3C2U0pTz4I02wT0 PC/hBOzK9DgMvfcPDyUmRbNCovkcZn7rFiDa0Wd0hmX2qK6jQLTbpIPKs2ZdmHGdrw4m5XKUDheX Ma3GtNz4V1M/XOWgPDjN6//NgvPJ4SRyWsLzz6mWktZTPvlECUWtgIB3fJLXv3w92O3SyTsOe6X3 tNUCrSudJ+LF1fSetwQz7WEoGfu67G4aqoPJpx7OSorZm2iK3qHibOsR7/uDQzVMZ7Mu9IX3X4jp TUMzXoX3unh19qEdidON7ureHCg3piJgP/m+6fssfTIAH/1LbnjVAoAlzN21NR6SsriCtzXVwcTQ o4sQgW5qmiVRUE3FW/5P3vTac5DWQje9b/01U43M6W1S9GffLssPxdaAs/zqD57bQ2eE6PKUmlW0 wlmb6Pd/5tC4thNnspq5mWu/aHXz5vyuKDTNVHURCZxCeGMYPqazR16WijCWU2yd5XzmgyEUNtH6 UXr3mzk4zct/fnImeJv1xM6d3jYZ7MKVanJewqDFmjavTCS8OEMCSUcHvPO3+PQH7ueWYtWQj76T L/2akNkaLPTNlAWzm6snEroZh/THmfPzk27hsnvnJ3njf+Yb/rfJmVSmsFuvsEsp0oNFOJVu+ISZ UzrdlJ95Gb3n9/jcp5f+d4bahtHegvgQgU/prWXEZ7bCKnpBExPPke0Euk00qHoCz4h5WDO8kRVB u0ua3iTxLwaF24a/+6PZxh8KQ3zkHbzm6/n+X2Pz2HTvu9BiUYG7YRghDjgLRhmZwSnsDvB2CnKl V01zIy+oK/72Ldz0PnbvO0wzV9Ff/N88/MvobQSeJioGRL5c5rWR7IQV0Z4rRPhH/4qNIzzj28NX UcjoGLZFqiWbtIQpCy3Dqd2YENfpw26cRhqXGfqHd/P+P13a2oXPEgg03y3E7QtTNJLwZWp/VwbZ ZmI47mb9iZiDEBaS/AYznrLUaXQMIyQzWs7v/cwC+HpYdHzPrfzQ0/mG7+drvnXqvJjSumwhCWAy tyS70blJOP9h6LYbef+fct/ts+vLA6F6xA2v5Dt/iqIMTBMTKWCJ0D0MpaSyZfS+P+SuT/HiH0Ev igrKiuACS6n7CbDKEHahczfgMe0oN6NoCnhlOj5E6IN/xgf+/H6+5gpKOHhma/TV1wsdxt4nPNMb UI/CYpvACTDa461vWKzSnEOUk/f8w7t53x9w7LLg7g/JAxri8jSVPaCD8zI1pWtLoVP5tzsA3vGB t3HT+84ZTK+ltubjf82jv5qyA6ATc89TEoHLKLH1e9+yKmNt7yTv/1OuvI6dC6NyooHgZWij5Scl sxFTtRObCokEzfJOTEicnHKrpNnbdqqUijH80ev5zAfWddAc58+0mQAABI9JREFUXfUYLnvE0v+K 5cTaifWT6TCbREHSuWA6U53IJ9NOLOIT37YLKZiy5ouTRGwpE0jjef9befebly6n5xy/Nz7gg3/G 37wZrbjk4cEgKIZVaUdThSUsCGyLM9g2BDA5SzvG1LRVuDL558WsKybkc9X5DknNmPe/jf1TXP5F YeyTg3pG1xFTvdarMKsi4IG/f+uaXEzT8OG/4OYPc/WXTrxdzhJSJt2UZ6CtMC1FT0pKh4Q/04RI VzkZAFsZOCn0sJkslSk++8Pv4M9/Zco5d3i6/NFc9oiA30I4bvdYh1iovAhjF1xXFinbEDQZFyx3 MrJZPjGSinYotj/bhqIfITRfBeaR0Bok8NjRNijNje/ir36T+25ftdg+oMr1WnPJtXzVv+Rxz8La KfRDdIB1bZzOBowoAQYzZqyJ08fxq69kvM9DR0WPa7+cx34tRy4AgsadqItlVySM+Wjm/5UfZHj2 UM8V58tTvoXjl01yFpetyCn8JuURdlNm0jXpQBiOaAu/8V189B1rcgtW0xNewGOfDtM7gi88TjMt jX5bT7S9FEBS9sPETtek8I0UZiOWCRt3uE3nqyGfeA9338xwXa6J0IO2J0Nvg6OXcPkjOXEFRy7k 6EXsXMBWJ3xeDPLiksgL2nopZwN7J3nnb3PPrdEHdo6bPh6e8oKjFzM4wuAIW8fYvoDNHXROkbOx E/T9rCCfwyRZPhmVX/kBhos3BltKW8e4/mlc/zTycilnJ+5JQQEsMq51L/aeWz/Kx97FyTsehE57 0gt57NeuYmgi0kj7RnQ5m2jKEC4XtoYpzhYFXVak8UHI1mlrhrsMdxnvMdqnGdM2a3IC5+mh3Xvl G1/JY54cjgPGikrSas6e/+qWlObRGX/8C9z+8QetzZ9nKvscv5Qrr+Oqx3DhVVOug8Q63XSsec42 Dbd9jFs/ysnbGe4+hFLgC4se2l1YJJoi5TgmzDRPgh1FRiZ8NlVBy4WSRTAVHWbN8koWXwjUVNx9 C3ffwt/9MRDihza2KPrB4JAXFCW6CPY1weimDsKsa1c+T116yDl7vB+NDAXeT6J2kpW+a7OUBA1Z fJEdhDs+oCTjU9zsOQVAfkGQqCLLKkmfp8PTQ8vZw5j0nxVkeTDCz4htifUh2miTf0TwWRdHpoyj vJzMBK0fakh1nr4g6aHl7HtvCxpSqECppgzeSQmTFBtiMWzxaOpsNoK0m+KQpPV8ZZ/zdJ54qDn7 vttC3ZJE3eR7STpKlRhSlrJox6JrzmSGJses2PbDnDkPNM/THD3Q7eBXkzV87K8heobn83GI0cmT qO54vDbxu5uBd57O0ww9tJwNvPUNfPbjh4ob7pI4lmcqrZ2n83R4esDbwR+CPvYu7voUV15HUU7F BkyOO9GkIqpTmc0Z/3ZK7ewef+rvpxLgztN54qHG2ULec8uHecMr2DrG0Yu56GFcdR0nLqfoL04a 9S7MOLF/J9u24JnDFxI/T/9/pn8CBjMVAtaWWqZ9+hN/oeJ5MY/Y896K83SeztN5Ok/n6Tydp/N0 ns7TeTpP5+k83T/6fwEfb2KSI/kgFgAAAABJRU5ErkJggg== "/>
- <rect width="285.97864" x="26.028843" y="78.512794" rx="0" height="284.96848" ry="0" style="fill:#000000;fill-opacity:1;stroke:none;opacity:0" id="rect2995"/>
- </g>
- <g id="layer2"/>
-</svg>
diff --git a/examples/qt3d/solarsystem/main.cpp b/examples/qt3d/solarsystem/main.cpp
deleted file mode 100644
index a4d44d3d..00000000
--- a/examples/qt3d/solarsystem/main.cpp
+++ /dev/null
@@ -1,65 +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$
-**
-****************************************************************************/
-
-#include <QApplication>
-
-#include "solarsystem.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
- SolarSystemView view;
-
-#ifdef Q_OS_SYMBIAN
- view.setAttribute(Qt::WA_LockLandscapeOrientation, true);
- view.showFullScreen();
-#else
- if (view.stereoType() != QGLView::RedCyanAnaglyph)
- view.camera()->setEyeSeparation(0.3f);
- if (QApplication::arguments().contains(QLatin1String("-maximize")))
- view.showMaximized();
- else if (QApplication::arguments().contains(QLatin1String("-fullscreen")))
- view.showFullScreen();
- else
- view.show();
-#endif
-
- return app.exec();
-}
diff --git a/examples/qt3d/solarsystem/qt3d.ico b/examples/qt3d/solarsystem/qt3d.ico
deleted file mode 100644
index e6442baf..00000000
--- a/examples/qt3d/solarsystem/qt3d.ico
+++ /dev/null
Binary files differ
diff --git a/examples/qt3d/solarsystem/qt3d.png b/examples/qt3d/solarsystem/qt3d.png
deleted file mode 100644
index 21ec0176..00000000
--- a/examples/qt3d/solarsystem/qt3d.png
+++ /dev/null
Binary files differ
diff --git a/examples/qt3d/solarsystem/resources/attribution.txt b/examples/qt3d/solarsystem/resources/attribution.txt
deleted file mode 100644
index 28fe61c3..00000000
--- a/examples/qt3d/solarsystem/resources/attribution.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-Image files based on textures courtesy of:
-qzma.deviantart.com
-sirius-sdz.deviantart.com
-
diff --git a/examples/qt3d/solarsystem/resources/moon-texture.jpg b/examples/qt3d/solarsystem/resources/moon-texture.jpg
deleted file mode 100644
index b6955e38..00000000
--- a/examples/qt3d/solarsystem/resources/moon-texture.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/qt3d/solarsystem/resources/planet.jpg b/examples/qt3d/solarsystem/resources/planet.jpg
deleted file mode 100644
index c6d92c43..00000000
--- a/examples/qt3d/solarsystem/resources/planet.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/qt3d/solarsystem/resources/solar.fsh b/examples/qt3d/solarsystem/resources/solar.fsh
deleted file mode 100644
index b85bd708..00000000
--- a/examples/qt3d/solarsystem/resources/solar.fsh
+++ /dev/null
@@ -1,70 +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: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$
-**
-****************************************************************************/
-
-uniform sampler2D qt_Texture0;
-uniform sampler2D qt_Texture1;
-varying mediump vec4 lightingColor;
-varying highp vec4 texCoord0;
-uniform mediump float glowFactor;
-
-void main(void)
-{
- vec4 unlitColor0 = texture2D(qt_Texture0, texCoord0.st);
- vec4 unlitColor1 = texture2D(qt_Texture1, texCoord0.st);
-
- // interpolate between the two textures
- vec4 unlitColor = mix(unlitColor0, unlitColor1, glowFactor);
-
- // Apply lighting
- vec4 litColor = lightingColor * unlitColor;
- // Normally, we'd just paint this lit colour like so:
-// gl_FragColor = litColor;
-
- // However, we want a cool glow effect, because the sun is generating
- // it's own light.
-
- // Multiplying the color by itself will washing out the darker colours,
- // leaving the brighter colours brighter by comparison
- vec4 powerColor = unlitColor * unlitColor;
- powerColor = powerColor * powerColor ;
-
- // Then combine the higher contrast color and the lit color
- gl_FragColor= mix(litColor, powerColor, glowFactor);
-}
diff --git a/examples/qt3d/solarsystem/resources/solar.jpg b/examples/qt3d/solarsystem/resources/solar.jpg
deleted file mode 100644
index 86f5921a..00000000
--- a/examples/qt3d/solarsystem/resources/solar.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/qt3d/solarsystem/resources/solar.vsh b/examples/qt3d/solarsystem/resources/solar.vsh
deleted file mode 100644
index 420bc701..00000000
--- a/examples/qt3d/solarsystem/resources/solar.vsh
+++ /dev/null
@@ -1,175 +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: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$
-**
-****************************************************************************/
-
-attribute highp vec4 qt_Vertex;
-attribute highp vec3 qt_Normal;
-attribute highp vec4 qt_MultiTexCoord0;
-uniform highp mat4 qt_ModelViewProjectionMatrix;
-uniform highp mat4 qt_ModelViewMatrix;
-uniform highp mat3 qt_NormalMatrix;
-varying highp vec4 texCoord0;
-
-// varying values for per-pixel lighting
-varying mediump vec4 lightingColor;
-varying highp vec3 normal;
-varying highp vec3 lightDirection;
-varying highp vec3 halfVector;
-varying highp vec3 vertexToLight;
-
-// Varying values for per-vertex lighting
-varying mediump vec4 litCombinedColor;
-
-// These structs are copied from the QGLShaderProgramEffect documentation
-struct qt_MaterialParameters {
- mediump vec4 emission;
- mediump vec4 ambient;
- mediump vec4 diffuse;
- mediump vec4 specular;
- mediump float shininess;
-};
-uniform qt_MaterialParameters qt_Material;
-
-struct qt_SingleLightParameters {
- mediump vec4 position;
- mediump vec3 spotDirection;
- mediump float spotExponent;
- mediump float spotCutoff;
- mediump float spotCosCutoff;
- mediump float constantAttenuation;
- mediump float linearAttenuation;
- mediump float quadraticAttenuation;
-};
-uniform qt_SingleLightParameters qt_Light;
-
-// This is a pretty standard lighting function, adapted from QGLLitMaterial.
-// The changes are mostly just renaming to improve readablity, but some
-// unecessary features are removed too (e.g. support for two-sided materials)
-
-void qLightVertex(vec4 vertex, vec3 normal)
-{
- // Start with the material's emissive color and the ambient scene color,
- // which have been combined into the emission parameter.
- vec4 color = qt_Material.emission;
- vec4 scolor = qt_Material.specular;
-
- // Viewer is at infinity.
- vec3 toEye = vec3(0, 0, 1);
-
- // Determine the angle between the normal and the light direction.
- vec4 lightPosition = qt_Light.position;
- vec3 lightDirection;
- if (lightPosition.w == 0.0)
- lightDirection = normalize(lightPosition.xyz);
- else
- lightDirection = normalize(lightPosition.xyz - vertex.xyz);
- // Clean up negative values
- float angle = max(dot(normal, lightDirection), 0.0);
-
- // Calculate the ambient and diffuse light components.
- vec4 adcomponent = qt_Material.ambient + angle * qt_Material.diffuse;
-
- // Calculate the specular light components, in case they're needed for
- // per-vertex lighting.
- vec4 scomponent;
- if (angle != 0.0) {
- halfVector = normalize(lightDirection + toEye);
- angle = max(dot(normal, halfVector), 0.0);
- float srm = qt_Material.shininess;
- vec4 scm = qt_Material.specular;
- if (srm != 0.0)
- scomponent = pow(angle, srm) * scm;
- else
- scomponent = scm;
- } else {
- scomponent = vec4(0, 0, 0, 0);
- }
-
- // Apply the spotlight angle and exponent.
- if (qt_Light.spotCutoff != 180.0) {
- vertexToLight = vertex.xyz - lightPosition.xyz;
- float spot = max(dot(normalize(vertexToLight),
- qt_Light.spotDirection), 0.0);
- if (spot < qt_Light.spotCosCutoff) {
- adcomponent = vec4(0, 0, 0, 0);
- scomponent = vec4(0, 0, 0, 0);
- } else {
- spot = pow(spot, qt_Light.spotExponent);
- adcomponent *= spot;
- scomponent *= spot;
- }
- }
-
- // Apply attenuation to the colors.
- if (lightPosition.w != 0.0) {
- float attenuation = qt_Light.constantAttenuation;
- float k1 = qt_Light.linearAttenuation;
- float k2 = qt_Light.quadraticAttenuation;
- if (k1 != 0.0 || k2 != 0.0) {
- float len = length(lightPosition.xyz - vertex.xyz);
- attenuation += k1 * len + k2 * len * len;
- }
- color += adcomponent / attenuation;
- scolor += scomponent / attenuation;
- } else {
- color += adcomponent;
- scolor += scomponent;
- }
-
- // Generate the final output colors to pass to the fragment shader.
- float alpha = qt_Material.diffuse.a;
- // This is the combined diffuse and ambient lighting color
- lightingColor = vec4(clamp(color.rgb, 0.0, 1.0), alpha);
- // Specular lighting and combined color is used for per vertex lighting if
- // per-pixel is too expensive or not required.
- vec4 specularLightingColor = vec4(clamp(scolor.rgb, 0.0, 1.0), 0.0);
- litCombinedColor = clamp(lightingColor + vec4(specularLightingColor.xyz, 0.0), 0.0, 1.0);
-}
-
- void main(void)
- {
- gl_Position = qt_ModelViewProjectionMatrix * qt_Vertex;
- texCoord0 = qt_MultiTexCoord0;
-
- // Calculate the vertex and normal to use for lighting calculations.
- highp vec4 vertex = qt_ModelViewMatrix * qt_Vertex;
- normal = normalize(qt_NormalMatrix * qt_Normal);
- qLightVertex(vertex,normal);
-}
-
diff --git a/examples/qt3d/solarsystem/resources/solar2.jpg b/examples/qt3d/solarsystem/resources/solar2.jpg
deleted file mode 100755
index 1aa0f02d..00000000
--- a/examples/qt3d/solarsystem/resources/solar2.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/qt3d/solarsystem/solarsystem.cpp b/examples/qt3d/solarsystem/solarsystem.cpp
deleted file mode 100644
index 25b0f769..00000000
--- a/examples/qt3d/solarsystem/solarsystem.cpp
+++ /dev/null
@@ -1,232 +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$
-**
-****************************************************************************/
-
-#include <QPropertyAnimation>
-#include "solarsystem.h"
-#include "qglbuilder.h"
-#include "qglmaterialcollection.h"
-#include "qgltexture2d.h"
-#include "qglmaterial.h"
-#include "qglscenenode.h"
-#include "qgllightmodel.h"
-#include "qglsphere.h"
-#include "qgraphicsrotation3d.h"
-#include "qgraphicstranslation3d.h"
-#include "qglshaderprogrameffect.h"
-#include "qglshaderprogram.h"
-
-#include <QtGui/qmatrix4x4.h>
-
-#include <QtCore/qmath.h>
-
-SolarSystemView::SolarSystemView(QWidget *parent)
- : QGLView(parent)
- , spaceScene(new QGLSceneNode(this))
- , sunEffect(0)
-{
- //Generate geometry for the scene
- spaceScene = createScene();
-
- //Set up the camera
- camera()->setEye(QVector3D(0, 0, 15));
-
- //Create the animation for the rotation of the Sun
- QPropertyAnimation *animation;
- animation = new QPropertyAnimation(this, "angle1", this);
- animation->setStartValue(0.0f);
- animation->setEndValue(360.0f);
- animation->setDuration(7000);
- animation->setLoopCount(-1);
- animation->start();
-
- //Create the animation for the rotation of the Planet
- QPropertyAnimation *animation2;
- animation2 = new QPropertyAnimation(this, "angle2", this);
- animation2->setStartValue(0.0f);
- animation2->setEndValue(360.0f);
- animation2->setDuration(3000);
- animation2->setLoopCount(-1);
- animation2->start();
-
- //Create the animation for the rotation of the Solar-System
- QPropertyAnimation *animation3;
- animation3 = new QPropertyAnimation(this, "angle3", this);
- animation3->setStartValue(0.0f);
- animation3->setEndValue(360.0f);
- animation3->setDuration(30000);
- animation3->setLoopCount(-1);
- animation3->start();
-
- //Create the animation for the glow effect
- QPropertyAnimation *glowAnimation;
- glowAnimation = new QPropertyAnimation(this, "glowFactor", this);
- glowAnimation->setStartValue(0.0f);
- glowAnimation->setEndValue(0.0f);
- glowAnimation->setKeyValueAt(0.5, 1.0f);
- glowAnimation->setDuration(3000);
- glowAnimation->setLoopCount(-1);
- glowAnimation->start();
-}
-
-SolarSystemView::~SolarSystemView()
-{
- delete spaceScene;
- delete sunEffect;
-}
-
-void SolarSystemView::initializeGL(QGLPainter *painter)
-{
- Q_UNUSED(painter);
- //nothing for now
-}
-
-
-void SolarSystemView::paintGL(QGLPainter *painter)
-{
- sunRotation->setAngle(-m_angle1);
- planetRotation->setAngle(m_angle2);
- systemRotation->setAngle(m_angle3);
- // Set the effect active to make sure that the program is created
- // and bound so that we can update our uniform
- sunEffect->setActive(painter,true);
- sunEffect->program()->setUniformValue("glowFactor", m_glowFactor);
- spaceScene->draw(painter);
-}
-
-QGLSceneNode *SolarSystemView::createScene()
-{
- QGLBuilder builder;
- QGLSceneNode *root = builder.sceneNode();
- QUrl url;
-
- //set up our materials palette - this describes all
- //of the materials we will use for this scene.
-
- //solar surface
- QGLMaterial *mat1 = new QGLMaterial;
- url.setPath(QLatin1String(":/solar.jpg"));
- url.setScheme(QLatin1String("file"));
- mat1->setTextureUrl(url,0);
- url.setPath(QLatin1String(":/solar2.jpg"));
- url.setScheme(QLatin1String("file"));
- mat1->setTextureUrl(url, 1);
- //mat1->setEmittedLight(Qt::white);
- int sunMat = root->palette()->addMaterial(mat1);
-
- //planetary surface
- QGLMaterial *mat2 = new QGLMaterial;
- url.setPath(QLatin1String(":/planet.jpg"));
- url.setScheme(QLatin1String("file"));
- mat2->setTextureUrl(url);
- int planetMat = root->palette()->addMaterial(mat2);
-
- //moon surface
- QGLMaterial *mat3 = new QGLMaterial;
- url.setPath(QLatin1String(":/moon-texture.jpg"));
- url.setScheme(QLatin1String("file"));
- mat3->setTextureUrl(url);
- int moonMat = root->palette()->addMaterial(mat3);
-
- //Set the rotation of the solar-system
- systemRotation = new QGraphicsRotation3D();
- systemRotation->setAxis(QVector3D(0,1,0));
- root->addTransform(systemRotation);
-
- // create the sun for our solar system
- builder.pushNode()->setObjectName(QLatin1String("Solar"));
- builder<<QGLSphere(1.5);
- builder.currentNode()->setMaterialIndex(sunMat);
- sunEffect = new QGLShaderProgramEffect();
- sunEffect->setVertexShaderFromFile(":/solar.vsh");
- sunEffect->setFragmentShaderFromFile(":/solar.fsh");
-// builder.currentNode()->setEffect(QGL::LitModulateTexture2D);
- builder.currentNode()->setUserEffect(sunEffect);
-
- //create and add rotations for axial tilt and rotation
- sunRotation = new QGraphicsRotation3D();
- QGraphicsRotation3D *axialTilt1 = new QGraphicsRotation3D();
- axialTilt1->setAngle(90.0f);
- axialTilt1->setAxis(QVector3D(1,0,0));
- builder.currentNode()->addTransform(sunRotation);
- builder.currentNode()->addTransform(axialTilt1);
-
- // create the planet
- builder.newNode()->setObjectName(QLatin1String("Planet"));
- builder<<QGLSphere(0.4);
- builder.currentNode()->setMaterialIndex(planetMat);
- builder.currentNode()->setEffect(QGL::LitModulateTexture2D);
-
- //position our planet - positioning occurs only AFTER transformations
- //have taken place.
- builder.currentNode()->setPosition(QVector3D(4.5,0,0));
-
- //create and add rotations for axial tilt and rotation
- planetRotation = new QGraphicsRotation3D();
- QGraphicsRotation3D *axialTilt2 = new QGraphicsRotation3D();
- axialTilt2->setAngle(75.0f);
- axialTilt2->setAxis(QVector3D(1,0,0));
-
- builder.currentNode()->addTransform(planetRotation);
- builder.currentNode()->addTransform(axialTilt2);
-
- //create the moon
- builder.pushNode()->setObjectName("Moon");
- builder<<QGLSphere(0.1);
- builder.currentNode()->setMaterialIndex(moonMat);
- builder.currentNode()->setEffect(QGL::LitModulateTexture2D);
-
- //as our moon is tidally locked to the planet (ie. they
- //always face the same side to one another), we are just
- //correcting the axial tilt of the moon here.
- QGraphicsRotation3D *axialTilt3 = new QGraphicsRotation3D();
- axialTilt3->setAngle(90.0f);
- axialTilt3->setAxis(QVector3D(1,0,0));
- builder.currentNode()->addTransform(axialTilt3);
-
- //The position is set relative to the parent node...
- builder.currentNode()->setPosition(QVector3D(0.7,0,0));
-
-
-
-
-
- //completed building, so finalise
- return builder.finalizedSceneNode();
-}
diff --git a/examples/qt3d/solarsystem/solarsystem.desktop b/examples/qt3d/solarsystem/solarsystem.desktop
deleted file mode 100644
index 3d16c486..00000000
--- a/examples/qt3d/solarsystem/solarsystem.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=Basket
-Icon=/usr/share/icons/hicolor/80x80/apps/qt3d.png
-Exec=/usr/bin/invoker --type=e -s /usr/bin/basket -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_basket
diff --git a/examples/qt3d/solarsystem/solarsystem.h b/examples/qt3d/solarsystem/solarsystem.h
deleted file mode 100644
index 9b8bcc1a..00000000
--- a/examples/qt3d/solarsystem/solarsystem.h
+++ /dev/null
@@ -1,96 +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$
-**
-****************************************************************************/
-
-#ifndef BUILDER_H
-#define BUILDER_H
-
-#include "qglview.h"
-#include "qgraphicsrotation3d.h"
-
-QT_BEGIN_NAMESPACE
-class QGLSceneNode;
-class QGLBuilder;
-class QGLShaderProgramEffect;
-QT_END_NAMESPACE
-
-class SolarSystemView : public QGLView
-{
- Q_OBJECT
- Q_PROPERTY(qreal angle1 READ angle1 WRITE setAngle1)
- Q_PROPERTY(qreal angle2 READ angle2 WRITE setAngle2)
- Q_PROPERTY(qreal angle3 READ angle3 WRITE setAngle3)
- Q_PROPERTY(qreal glowFactor READ glowFactor WRITE setGlowFactor)
-public:
- SolarSystemView(QWidget *parent = 0);
- ~SolarSystemView();
-
- qreal angle1() const { return m_angle1; }
- void setAngle1(qreal angle) { m_angle1 = angle; update(); }
-
- qreal angle2() const { return m_angle2; }
- void setAngle2(qreal angle) { m_angle2 = angle; update(); }
-
- qreal angle3() const { return m_angle3; }
- void setAngle3(qreal angle) { m_angle3 = angle; update(); }
-
- qreal glowFactor() const { return m_glowFactor; }
- void setGlowFactor(qreal arg) { m_glowFactor = arg; update(); }
-
-protected:
- void initializeGL(QGLPainter *painter);
- void paintGL(QGLPainter *painter);
-
-private:
- qreal m_angle1;
- qreal m_angle2;
- qreal m_angle3;
- float m_glowFactor;
- QGraphicsRotation3D *sunRotation;
- QGraphicsRotation3D *planetRotation;
- QGraphicsRotation3D *moonRotation;
- QGraphicsRotation3D *systemRotation;
- QGLSceneNode *spaceScene;
-
- QGLShaderProgramEffect* sunEffect;
-
- QGLSceneNode *createScene();
-};
-
-#endif
diff --git a/examples/qt3d/solarsystem/solarsystem.pro b/examples/qt3d/solarsystem/solarsystem.pro
deleted file mode 100644
index 757d3753..00000000
--- a/examples/qt3d/solarsystem/solarsystem.pro
+++ /dev/null
@@ -1,29 +0,0 @@
-TEMPLATE = app
-TARGET = solarsystem
-CONFIG += qt warn_on
-
-CONFIG += qt3d_deploy_pkg
-include(../../../pkg.pri)
-
-SOURCES = solarsystem.cpp \
- main.cpp
-HEADERS = solarsystem.h
-RESOURCES += solarsystem.qrc
-DEPENDPATH += resources
-
-OTHER_FILES += \
- resources/moon-texture.jpg \
- resources/planet.jpg \
- resources/solar.jpg \
- resources/solar.fsh \
- resources/solar.vsh
-
-OTHER_FILES += \
- solarsystem.rc \
- solarsystem.desktop
-
-RC_FILE = solarsystem.rc
-
-symbian {
- TARGET.EPOCHEAPSIZE = 0x40000 0x4000000
-}
diff --git a/examples/qt3d/solarsystem/solarsystem.qrc b/examples/qt3d/solarsystem/solarsystem.qrc
deleted file mode 100644
index 8a90a5eb..00000000
--- a/examples/qt3d/solarsystem/solarsystem.qrc
+++ /dev/null
@@ -1,10 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file alias="moon-texture.jpg">resources/moon-texture.jpg</file>
- <file alias="planet.jpg">resources/planet.jpg</file>
- <file alias="solar.fsh">resources/solar.fsh</file>
- <file alias="solar.jpg">resources/solar.jpg</file>
- <file alias="solar.vsh">resources/solar.vsh</file>
- <file alias="solar2.jpg">resources/solar2.jpg</file>
- </qresource>
-</RCC>
diff --git a/examples/qt3d/solarsystem/solarsystem.rc b/examples/qt3d/solarsystem/solarsystem.rc
deleted file mode 100644
index b40ecdc1..00000000
--- a/examples/qt3d/solarsystem/solarsystem.rc
+++ /dev/null
@@ -1 +0,0 @@
-IDI_ICON1 ICON DISCARDABLE "qt3d.ico"
diff --git a/examples/qt3d/tank/main.cpp b/examples/qt3d/tank/main.cpp
deleted file mode 100644
index 14e1ef43..00000000
--- a/examples/qt3d/tank/main.cpp
+++ /dev/null
@@ -1,69 +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$
-**
-****************************************************************************/
-
-#include <QtGui/QApplication>
-
-#include <time.h>
-
-#include "tankview.h"
-
-int main(int argc, char *argv[])
-{
- qsrand(time(0));
-
- QApplication a(argc, argv);
- TankView view;
-
-#ifdef Q_OS_SYMBIAN
- view.setAttribute(Qt::WA_LockLandscapeOrientation, true);
- view.showFullScreen();
-#else
- if (view.stereoType() != QGLView::RedCyanAnaglyph)
- view.camera()->setEyeSeparation(0.3f);
- if (QApplication::arguments().contains(QLatin1String("-maximize")))
- view.showMaximized();
- else if (QApplication::arguments().contains(QLatin1String("-fullscreen")))
- view.showFullScreen();
- else
- view.show();
-#endif
-
- return a.exec();
-}
diff --git a/examples/qt3d/tank/qt3d.ico b/examples/qt3d/tank/qt3d.ico
deleted file mode 100644
index e6442baf..00000000
--- a/examples/qt3d/tank/qt3d.ico
+++ /dev/null
Binary files differ
diff --git a/examples/qt3d/tank/qt3d.png b/examples/qt3d/tank/qt3d.png
deleted file mode 100644
index 21ec0176..00000000
--- a/examples/qt3d/tank/qt3d.png
+++ /dev/null
Binary files differ
diff --git a/examples/qt3d/tank/quadplane.cpp b/examples/qt3d/tank/quadplane.cpp
deleted file mode 100644
index fb3cf16b..00000000
--- a/examples/qt3d/tank/quadplane.cpp
+++ /dev/null
@@ -1,107 +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$
-**
-****************************************************************************/
-
-#include "quadplane.h"
-#include "qgraphicsrotation3d.h"
-
-QGLMaterial *qCreateFloor()
-{
- quint32 sz = 512;
- QImage image(QSize(sz, sz), QImage::Format_ARGB32);
- QRgb col = qRgba(196, 196, 200, 255);
- image.fill(col);
- QPainter painter(&image);
- QPen pen = painter.pen();
- pen.setColor(QColor(col).darker());
- pen.setWidth(2);
- painter.setPen(pen);
- for (quint32 i = 0; i < sz; i += (sz / 8))
- {
- painter.drawLine(0, i, sz-1, i);
- painter.drawLine(i, 0, i, sz-1);
- }
- painter.end();
- QGLMaterial *mat = new QGLMaterial;
- QGLTexture2D *tex = new QGLTexture2D(mat);
- tex->setImage(image);
- mat->setTexture(tex);
- return mat;
-}
-
-QuadPlane::QuadPlane(QObject *parent, QSizeF size, int level)
- : QGLSceneNode(parent)
-{
- setObjectName("QuadPlane");
- if (level > 8)
- level = 8;
- if (level < 1)
- level = 1;
- int divisions = 1;
- for ( ; level--; divisions *= 2) {} // integer 2**n
- QSizeF div = size / float(divisions);
- QSizeF half = size / 2.0f;
- QGLBuilder builder;
- QGeometryData zip;
- QGeometryData zip2;
- for (int yy = 0; yy <= divisions; ++yy)
- {
- qreal y = half.height() - float(yy) * div.height();
- qreal texY = float(yy) / divisions;
- for (int xx = 0; xx <= divisions; ++xx)
- {
- qreal x = half.width() - float(xx) * div.width();
- qreal texX = float(xx) / divisions;
- zip.appendVertex(QVector3D(x, y, 0));
- zip.appendTexCoord(QVector2D(1.0f - texX, 1.0f - texY));
- }
- if (yy > 0)
- builder.addQuadsInterleaved(zip, zip2);
- zip2 = zip;
- zip2.detach();
- zip.clear();
- }
- QGLSceneNode *n = builder.finalizedSceneNode();
- addNode(n);
- n->setMaterial(qCreateFloor());
- QGraphicsRotation3D *rot = new QGraphicsRotation3D(n);
- rot->setAxis(QVector3D(1, 0, 0));
- rot->setAngle(90.0f);
- n->addTransform(rot);
-}
diff --git a/examples/qt3d/tank/quadplane.h b/examples/qt3d/tank/quadplane.h
deleted file mode 100644
index 2ffc1963..00000000
--- a/examples/qt3d/tank/quadplane.h
+++ /dev/null
@@ -1,55 +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$
-**
-****************************************************************************/
-
-#ifndef QUADPLANE_H
-#define QUADPLANE_H
-
-#include "qglbuilder.h"
-
-#include <QSizeF>
-
-class QuadPlane : public QGLSceneNode
-{
-public:
- QuadPlane(QObject *parent = 0,
- QSizeF size = QSizeF(100.0f, 100.0f), int level = 3);
-};
-
-#endif // QUADPLANE_H
diff --git a/examples/qt3d/tank/tank.cpp b/examples/qt3d/tank/tank.cpp
deleted file mode 100644
index fe4fa8e8..00000000
--- a/examples/qt3d/tank/tank.cpp
+++ /dev/null
@@ -1,136 +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$
-**
-****************************************************************************/
-
-#include "tank.h"
-
-#include <QSequentialAnimationGroup>
-#include <QPropertyAnimation>
-#include <QImage>
-#include <QPainter>
-#include <QSize>
-
-#ifndef QT_NO_DEBUG
-#include <QThread>
-#include <QCoreApplication>
-#endif
-
-#include "qglbuilder.h"
-#include "qglcylinder.h"
-#include "qglmaterial.h"
-#include "qgltexture2d.h"
-#include "qgraphicsscale3d.h"
-#include "qgraphicsrotation3d.h"
-
-static inline int rval()
-{
- // return an int 64 <--> 192 inclusive
- return (qreal(qrand()) / qreal(RAND_MAX)) * 128 + 64;
-}
-
-static QGLMaterial *qCreateFluid()
-{
- QImage image(QSize(128,128), QImage::Format_ARGB32);
- QRgb col = qRgba(rval(), rval(), rval(), 196);
- image.fill(col);
- QPainter painter(&image);
- QLinearGradient linearGrad(QPointF(56, 56), QPointF(72, 72));
- linearGrad.setColorAt(0, col);
- linearGrad.setColorAt(1, QColor(col).lighter());
- linearGrad.setSpread(QGradient::ReflectSpread);
- painter.fillRect(image.rect(), linearGrad);
- painter.end();
- QGLMaterial *mat = new QGLMaterial;
- QColor white(Qt::white);
- white.setAlpha(128);
- mat->setAmbientColor(white);
- mat->setDiffuseColor(white);
- QGLTexture2D *tex = new QGLTexture2D(mat);
- tex->setImage(image);
- mat->setTexture(tex);
- return mat;
-}
-
-Tank::Tank(QObject *parent) :
- QGLSceneNode(parent)
-{
- QSequentialAnimationGroup *seq = new QSequentialAnimationGroup(this);
- QGraphicsScale3D *scale = new QGraphicsScale3D(this);
- addTransform(scale);
- QPropertyAnimation *anim = new QPropertyAnimation(scale, "scale");
- anim->setDuration(10000);
- anim->setStartValue(QVector3D(1.0f, 0.1f, 1.0f));
- anim->setEndValue(QVector3D(1.0f, 1.2f, 1.0f));
- anim->setEasingCurve(QEasingCurve(QEasingCurve::InOutQuad));
- seq->addAnimation(anim);
- seq->addPause(2000);
- anim = new QPropertyAnimation(scale, "scale");
- anim->setDuration(10000);
- anim->setStartValue(QVector3D(1.0f, 1.2f, 1.0f));
- anim->setEndValue(QVector3D(1.0f, 0.1f, 1.0f));
- anim->setEasingCurve(QEasingCurve(QEasingCurve::InOutQuad));
- seq->addAnimation(anim);
- seq->setLoopCount(-1);
- seq->start();
-
- addNode(tankObject());
- setMaterial(qCreateFluid());
-}
-
-QGLSceneNode *Tank::tankObject()
-{
-#ifndef QT_NO_DEBUG
- // NOT THREADSAFE, NOT RE-ENTRANT
- Q_ASSERT(QThread::currentThread() == qApp->thread());
-#endif
- static QGLSceneNode *theTank = 0;
- if (!theTank)
- {
- QGLBuilder build;
- build << QGLCylinder(1.0f, 1.0f, 1.0f, 32);
- theTank = build.finalizedSceneNode();
- theTank->setObjectName("Tank Component");
- QGraphicsRotation3D *rot = new QGraphicsRotation3D(theTank);
- rot->setAxis(QVector3D(1, 0, 0));
- rot->setAngle(-90.0f);
- theTank->addTransform(rot);
- theTank->setY(-theTank->boundingBox().minimum().y());
- }
- return theTank;
-}
diff --git a/examples/qt3d/tank/tank.desktop b/examples/qt3d/tank/tank.desktop
deleted file mode 100644
index 17ebe2c6..00000000
--- a/examples/qt3d/tank/tank.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=Tank
-Icon=/usr/share/icons/hicolor/80x80/apps/qt3d.png
-Exec=/usr/bin/invoker --type=e -s /usr/bin/invoker --type=d -s /usr/bin/tank -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_tank
diff --git a/examples/qt3d/tank/tank.h b/examples/qt3d/tank/tank.h
deleted file mode 100644
index 89449640..00000000
--- a/examples/qt3d/tank/tank.h
+++ /dev/null
@@ -1,59 +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$
-**
-****************************************************************************/
-
-#ifndef TANK_H
-#define TANK_H
-
-#include "qglscenenode.h"
-
-class Tank : public QGLSceneNode
-{
- Q_OBJECT
-public:
- explicit Tank(QObject *parent = 0);
-
-signals:
-
-public slots:
-private:
- static QGLSceneNode *tankObject();
-};
-
-#endif // TANK_H
diff --git a/examples/qt3d/tank/tank.pro b/examples/qt3d/tank/tank.pro
deleted file mode 100644
index fa622cdf..00000000
--- a/examples/qt3d/tank/tank.pro
+++ /dev/null
@@ -1,21 +0,0 @@
-TARGET = tank
-TEMPLATE = app
-CONFIG += qt warn_on
-
-CONFIG += qt3d_deploy_pkg
-include(../../../pkg.pri)
-
-SOURCES += main.cpp\
- tankview.cpp \
- tank.cpp \
- quadplane.cpp
-
-HEADERS += tankview.h \
- tank.h \
- quadplane.h
-
-OTHER_FILES += \
- tank.rc \
- tank.desktop
-
-RC_FILE = tank.rc
diff --git a/examples/qt3d/tank/tank.rc b/examples/qt3d/tank/tank.rc
deleted file mode 100644
index b40ecdc1..00000000
--- a/examples/qt3d/tank/tank.rc
+++ /dev/null
@@ -1 +0,0 @@
-IDI_ICON1 ICON DISCARDABLE "qt3d.ico"
diff --git a/examples/qt3d/tank/tankview.cpp b/examples/qt3d/tank/tankview.cpp
deleted file mode 100644
index 1c2e706d..00000000
--- a/examples/qt3d/tank/tankview.cpp
+++ /dev/null
@@ -1,114 +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$
-**
-****************************************************************************/
-
-#include "tankview.h"
-#include "tank.h"
-#include "quadplane.h"
-
-#include "qglscenenode.h"
-#include "qray3d.h"
-#include "qplane3d.h"
-
-#include <QMouseEvent>
-
-TankView::TankView(QWidget *parent)
- : QGLView(parent)
- , m_tankScene(new QGLSceneNode)
- , m_count(0)
-{
- m_tankScene->setParent(this);
- m_tankScene->setPalette(new QGLMaterialCollection(this));
- m_tankScene->setEffect(QGL::LitDecalTexture2D);
- m_tankScene->addNode(new QuadPlane(0, QSizeF(25, 25)));
- Tank *tank = addTank();
- connect(tank, SIGNAL(updated()), this, SLOT(update()));
-
- setToolTip(tr("Double-click to add more tanks"));
- setWindowTitle(tr("Double-click Me!"));
-}
-
-TankView::~TankView()
-{
-}
-
-Tank *TankView::addTank()
-{
- Tank *tank = new Tank(m_tankScene);
- tank->setObjectName(QString(QLatin1String("Tank %1")).arg(m_count));
- ++m_count;
- connect(tank, SIGNAL(updated()), this, SLOT(update()));
- return tank;
-}
-
-void TankView::paintGL(QGLPainter *painter)
-{
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- m_tankScene->draw(painter);
-}
-
-void TankView::initializeGL(QGLPainter *painter)
-{
- painter->setClearColor(Qt::gray);
- camera()->setEye(camera()->eye() + QVector3D(0.0f, 4.0f, 0.0f));
- glEnable(GL_BLEND);
-}
-
-void TankView::mouseDoubleClickEvent(QMouseEvent *e)
-{
- Tank *t = addTank();
- QVector3D pick = mapPoint(e->pos());
-
- // find the origin of the near plane
- QRay3D eyeline(camera()->eye(), (camera()->center() - camera()->eye()).normalized());
- QVector3D nearPlaneOrigin = eyeline.point(camera()->nearPlane());
-
- // from the near plane origin move up and across by the pick's XY to find the point
- // on the near plane
- QRay3D up(nearPlaneOrigin, camera()->upVector());
- QVector3D sideDir = QVector3D::crossProduct(camera()->upVector(), -eyeline.direction());
- QRay3D side(up.point(pick.y()), sideDir.normalized());
- QVector3D v = side.point(pick.x());
-
- // intersect the ray thru the picked point on the near plane with the floor
- QRay3D ray(camera()->eye(), v - camera()->eye());
- QPlane3D floorPlane(QVector3D(), QVector3D(0, 1, 0));
- QVector3D pointOnFloor = ray.point(floorPlane.intersection(ray));
- t->setPosition(pointOnFloor);
-}
diff --git a/examples/qt3d/tank/tankview.h b/examples/qt3d/tank/tankview.h
deleted file mode 100644
index 74f26438..00000000
--- a/examples/qt3d/tank/tankview.h
+++ /dev/null
@@ -1,70 +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$
-**
-****************************************************************************/
-
-#ifndef TANKVIEW_H
-#define TANKVIEW_H
-
-#include "qglview.h"
-
-QT_BEGIN_NAMESPACE
-class QGLSceneNode;
-QT_END_NAMESPACE
-
-class Tank;
-
-class TankView : public QGLView
-{
-public:
- TankView(QWidget *parent = 0);
- ~TankView();
-protected:
- void initializeGL(QGLPainter *painter);
- void paintGL(QGLPainter *painter);
- void mouseDoubleClickEvent(QMouseEvent *e);
-private:
- Tank *addTank();
-
- QGLSceneNode *m_tankScene;
- int m_count;
-};
-
-
-
-#endif // TANKVIEW_H
diff --git a/examples/qt3d/teapot/main.cpp b/examples/qt3d/teapot/main.cpp
deleted file mode 100644
index 8bf02f47..00000000
--- a/examples/qt3d/teapot/main.cpp
+++ /dev/null
@@ -1,68 +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$
-**
-****************************************************************************/
-
-#include <QApplication>
-#include "teapotview.h"
-
-//! [main]
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
- TeapotView view;
-//! [main-args]
-
-#ifdef Q_OS_SYMBIAN
- view.setAttribute(Qt::WA_LockLandscapeOrientation, true);
- view.showFullScreen();
-#else
- if (view.stereoType() != QGLView::RedCyanAnaglyph)
- view.camera()->setEyeSeparation(0.3f);
- if (QApplication::arguments().contains(QLatin1String("-maximize")))
- view.showMaximized();
- else if (QApplication::arguments().contains(QLatin1String("-fullscreen")))
- view.showFullScreen();
- else
- view.show();
-#endif
-
-//! [main-args-end]
- return app.exec();
-}
-//! [main]
diff --git a/examples/qt3d/teapot/qt3d.ico b/examples/qt3d/teapot/qt3d.ico
deleted file mode 100644
index e6442baf..00000000
--- a/examples/qt3d/teapot/qt3d.ico
+++ /dev/null
Binary files differ
diff --git a/examples/qt3d/teapot/qt3d.png b/examples/qt3d/teapot/qt3d.png
deleted file mode 100644
index 21ec0176..00000000
--- a/examples/qt3d/teapot/qt3d.png
+++ /dev/null
Binary files differ
diff --git a/examples/qt3d/teapot/teapot.desktop b/examples/qt3d/teapot/teapot.desktop
deleted file mode 100644
index b28a3dac..00000000
--- a/examples/qt3d/teapot/teapot.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=teapot Qt3D
-Icon=/usr/share/icons/hicolor/80x80/apps/qt3d.png
-Exec=/usr/bin/invoker --type=e -s /usr/bin/teapot -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_teapot
diff --git a/examples/qt3d/teapot/teapot.pro b/examples/qt3d/teapot/teapot.pro
deleted file mode 100644
index 907db547..00000000
--- a/examples/qt3d/teapot/teapot.pro
+++ /dev/null
@@ -1,15 +0,0 @@
-TEMPLATE = app
-TARGET = teapot
-CONFIG += qt warn_on
-
-CONFIG += qt3d_deploy_pkg
-include(../../../pkg.pri)
-
-SOURCES = teapotview.cpp main.cpp
-HEADERS = teapotview.h
-
-OTHER_FILES += \
- teapot.rc \
- teapot.desktop
-
-RC_FILE = teapot.rc
diff --git a/examples/qt3d/teapot/teapot.rc b/examples/qt3d/teapot/teapot.rc
deleted file mode 100644
index b40ecdc1..00000000
--- a/examples/qt3d/teapot/teapot.rc
+++ /dev/null
@@ -1 +0,0 @@
-IDI_ICON1 ICON DISCARDABLE "qt3d.ico"
diff --git a/examples/qt3d/teapot/teapotview.cpp b/examples/qt3d/teapot/teapotview.cpp
deleted file mode 100644
index 2c58e19a..00000000
--- a/examples/qt3d/teapot/teapotview.cpp
+++ /dev/null
@@ -1,68 +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$
-**
-****************************************************************************/
-
-#include "teapotview.h"
-#include "qglbuilder.h"
-#include "qglscenenode.h"
-
-//! [initialize]
-void TeapotView::initializeGL(QGLPainter *painter)
-{
- painter->setStandardEffect(QGL::LitMaterial);
-//! [build-geometry]
- QGLBuilder builder;
- builder << QGLTeapot();
- teapot = builder.finalizedSceneNode();
-}
-//! [initialize]
-
-//! [destructor]
-TeapotView::~TeapotView()
-{
- delete teapot;
-}
-//! [destructor]
-
-//! [paint]
-void TeapotView::paintGL(QGLPainter *painter)
-{
- teapot->draw(painter);
-}
-//! [paint]
diff --git a/examples/qt3d/teapot/teapotview.h b/examples/qt3d/teapot/teapotview.h
deleted file mode 100644
index f0dd0428..00000000
--- a/examples/qt3d/teapot/teapotview.h
+++ /dev/null
@@ -1,68 +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$
-**
-****************************************************************************/
-
-#ifndef TEAPOTVIEW_H
-#define TEAPOTVIEW_H
-
-//! [class-defn]
-#include "qglview.h"
-#include "qglteapot.h"
-
-QT_BEGIN_NAMESPACE
-class QGLSceneNode;
-QT_END_NAMESPACE
-
-class TeapotView : public QGLView
-{
- Q_OBJECT
-public:
- TeapotView(QWidget *parent = 0) : QGLView(parent), teapot(0) {}
- ~TeapotView();
-
-protected:
- void initializeGL(QGLPainter *painter);
- void paintGL(QGLPainter *painter);
-
-private:
- QGLSceneNode *teapot;
-};
-//! [class-defn]
-
-#endif
diff --git a/examples/quick3d/animations/animations.pro b/examples/quick3d/animations/animations.pro
deleted file mode 100644
index fe6aa634..00000000
--- a/examples/quick3d/animations/animations.pro
+++ /dev/null
@@ -1,19 +0,0 @@
-TEMPLATE = app
-TARGET = animations_qml
-CONFIG += qt warn_on
-
-CONFIG += qt3dquick_deploy_pkg
-include(../../../pkg.pri)
-
-SOURCES += main.cpp
-
-OTHER_FILES += \
- animations_qml.rc \
- animations_qml.desktop \
- qml/animations.qml
-
-RC_FILE = animations_qml.rc
-
-RESOURCES += \
- animations.qrc
-
diff --git a/examples/quick3d/animations/animations.qrc b/examples/quick3d/animations/animations.qrc
deleted file mode 100644
index 0336aaa9..00000000
--- a/examples/quick3d/animations/animations.qrc
+++ /dev/null
@@ -1,7 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>qml/cube_rotated.dae</file>
- <file>qml/animations.qml</file>
- <file>qml/stonewal.jpg</file>
- </qresource>
-</RCC>
diff --git a/examples/quick3d/animations/animations_qml.desktop b/examples/quick3d/animations/animations_qml.desktop
deleted file mode 100644
index b300b920..00000000
--- a/examples/quick3d/animations/animations_qml.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=Animations
-Icon=/usr/share/icons/hicolor/80x80/apps/qtquick3d.png
-Exec=/usr/bin/invoker --type=e -s /usr/bin/animations_qml -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_animations_qml
diff --git a/examples/quick3d/animations/animations_qml.rc b/examples/quick3d/animations/animations_qml.rc
deleted file mode 100644
index 1b6228c9..00000000
--- a/examples/quick3d/animations/animations_qml.rc
+++ /dev/null
@@ -1 +0,0 @@
-IDI_ICON1 ICON DISCARDABLE "qtquick3d.ico"
diff --git a/examples/quick3d/animations/main.cpp b/examples/quick3d/animations/main.cpp
deleted file mode 100644
index 4fed90fa..00000000
--- a/examples/quick3d/animations/main.cpp
+++ /dev/null
@@ -1,66 +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: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$
-**
-****************************************************************************/
-
-#include <QtGui/QApplication>
-#include "qdeclarativeview3d.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
-
- QDeclarativeView3D view;
-
- view.setSource(QUrl(QLatin1String("qrc:///qml/animations.qml")));
-
-#ifdef Q_OS_SYMBIAN
- view.setAttribute(Qt::WA_LockLandscapeOrientation, true);
- view.setResizeMode(QDeclarativeView::SizeRootObjectToView);
- view.showMaximized();
-#else
- if (QApplication::arguments().contains(QLatin1String("-maximize")))
- view.showMaximized();
- else if (QApplication::arguments().contains(QLatin1String("-fullscreen")))
- view.showFullScreen();
- else
- view.show();
-#endif
-
- return app.exec();
-}
diff --git a/examples/quick3d/animations/qml/animations.qml b/examples/quick3d/animations/qml/animations.qml
deleted file mode 100644
index 6f4b8846..00000000
--- a/examples/quick3d/animations/qml/animations.qml
+++ /dev/null
@@ -1,57 +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
-
-Viewport {
- width: 640; height: 480
-
- camera: Camera {
- eye: Qt.vector3d(0, 80, 200)
- }
-
- Item3D {
- mesh: Mesh { source: ":/qml/cube_rotated.dae" }
- effect: Effect { texture: ":/qml/stonewal.jpg" }
- }
-}
-//! [3]
diff --git a/examples/quick3d/animations/qml/cube_rotated.dae b/examples/quick3d/animations/qml/cube_rotated.dae
deleted file mode 100755
index 0bb2f031..00000000
--- a/examples/quick3d/animations/qml/cube_rotated.dae
+++ /dev/null
@@ -1,561 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.0">
- <asset>
- <contributor>
- <author></author>
- <authoring_tool>FBX COLLADA exporter</authoring_tool>
- <comments></comments>
- </contributor>
- <created>2012-01-09T10:08:02Z</created>
- <modified>2012-01-09T10:08:02Z</modified>
- <revision></revision>
- <title></title>
- <subject></subject>
- <keywords></keywords>
- <unit meter="0.025400"/>
- <up_axis>Y_UP</up_axis>
- </asset>
- <library_images>
- <image id="Map__2-image" name="Map__2">
- <init_from>file://stonewal.png</init_from>
- </image>
- <image id="Map__1-image" name="Map__1">
- <init_from>file://waves.bmp</init_from>
- </image>
- </library_images>
- <library_materials>
- <material id="_02___Default" name="_02___Default">
- <instance_effect url="#_02___Default-fx"/>
- </material>
- <material id="_01___Default" name="_01___Default">
- <instance_effect url="#_01___Default-fx"/>
- </material>
- </library_materials>
- <library_effects>
- <effect id="_02___Default-fx" name="_02___Default">
- <profile_COMMON>
- <technique sid="standard">
- <phong>
- <emission>
- <color sid="emission">0.000000 0.000000 0.000000 1.000000</color>
- </emission>
- <ambient>
- <color sid="ambient">0.588235 0.588235 0.588235 1.000000</color>
- </ambient>
- <diffuse>
- <texture texture="Map__2-image" texcoord="CHANNEL0">
- <extra>
- <technique profile="MAYA">
- <wrapU sid="wrapU0">TRUE</wrapU>
- <wrapV sid="wrapV0">TRUE</wrapV>
- <blend_mode>ADD</blend_mode>
- </technique>
- </extra>
- </texture>
- </diffuse>
- <specular>
- <color sid="specular">0.000000 0.000000 0.000000 1.000000</color>
- </specular>
- <shininess>
- <float sid="shininess">2.000000</float>
- </shininess>
- <reflective>
- <color sid="reflective">0.000000 0.000000 0.000000 1.000000</color>
- </reflective>
- <reflectivity>
- <float sid="reflectivity">1.000000</float>
- </reflectivity>
- <transparent>
- <color sid="transparent">1.000000 1.000000 1.000000 1.000000</color>
- </transparent>
- <transparency>
- <float sid="transparency">0.000000</float>
- </transparency>
- </phong>
- </technique>
- </profile_COMMON>
- </effect>
- <effect id="_01___Default-fx" name="_01___Default">
- <profile_COMMON>
- <technique sid="standard">
- <phong>
- <emission>
- <color sid="emission">0.000000 0.000000 0.000000 1.000000</color>
- </emission>
- <ambient>
- <color sid="ambient">0.588235 0.588235 0.588235 1.000000</color>
- </ambient>
- <diffuse>
- <texture texture="Map__1-image" texcoord="CHANNEL0">
- <extra>
- <technique profile="MAYA">
- <wrapU sid="wrapU0">TRUE</wrapU>
- <wrapV sid="wrapV0">TRUE</wrapV>
- <blend_mode>ADD</blend_mode>
- </technique>
- </extra>
- </texture>
- </diffuse>
- <specular>
- <color sid="specular">0.000000 0.000000 0.000000 1.000000</color>
- </specular>
- <shininess>
- <float sid="shininess">2.000000</float>
- </shininess>
- <reflective>
- <color sid="reflective">0.000000 0.000000 0.000000 1.000000</color>
- </reflective>
- <reflectivity>
- <float sid="reflectivity">1.000000</float>
- </reflectivity>
- <transparent>
- <color sid="transparent">1.000000 1.000000 1.000000 1.000000</color>
- </transparent>
- <transparency>
- <float sid="transparency">0.000000</float>
- </transparency>
- </phong>
- </technique>
- </profile_COMMON>
- </effect>
- </library_effects>
- <library_geometries>
- <geometry id="Box01-lib" name="Box01Mesh">
- <mesh>
- <source id="Box01-lib-Position">
- <float_array id="Box01-lib-Position-array" count="24">
--50.000000 -50.000000 0.000000
-50.000000 -50.000000 0.000000
--50.000000 50.000000 0.000000
-50.000000 50.000000 0.000000
--50.000000 -50.000000 1.000000
-50.000000 -50.000000 1.000000
--50.000000 50.000000 1.000000
-50.000000 50.000000 1.000000
-</float_array>
- <technique_common>
- <accessor source="#Box01-lib-Position-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="Box01-lib-Normal0">
- <float_array id="Box01-lib-Normal0-array" count="108">
-0.000000 0.000000 -1.000000
-0.000000 0.000000 -1.000000
-0.000000 0.000000 -1.000000
-0.000000 0.000000 -1.000000
-0.000000 0.000000 -1.000000
-0.000000 0.000000 -1.000000
-0.000000 0.000000 1.000000
-0.000000 0.000000 1.000000
-0.000000 0.000000 1.000000
-0.000000 0.000000 1.000000
-0.000000 0.000000 1.000000
-0.000000 0.000000 1.000000
-0.000000 -1.000000 0.000000
-0.000000 -1.000000 0.000000
-0.000000 -1.000000 0.000000
-0.000000 -1.000000 0.000000
-0.000000 -1.000000 0.000000
-0.000000 -1.000000 0.000000
-1.000000 0.000000 0.000000
-1.000000 0.000000 0.000000
-1.000000 0.000000 0.000000
-1.000000 0.000000 0.000000
-1.000000 0.000000 0.000000
-1.000000 0.000000 0.000000
-0.000000 1.000000 0.000000
-0.000000 1.000000 0.000000
-0.000000 1.000000 0.000000
-0.000000 1.000000 0.000000
-0.000000 1.000000 0.000000
-0.000000 1.000000 0.000000
--1.000000 0.000000 0.000000
--1.000000 0.000000 0.000000
--1.000000 0.000000 0.000000
--1.000000 0.000000 0.000000
--1.000000 0.000000 0.000000
--1.000000 0.000000 0.000000
-</float_array>
- <technique_common>
- <accessor source="#Box01-lib-Normal0-array" count="36" stride="3">
- <param name="X" type="float"/>
- <param name="Y" type="float"/>
- <param name="Z" type="float"/>
- </accessor>
- </technique_common>
- </source>
- <source id="Box01-lib-UV0">
- <float_array id="Box01-lib-UV0-array" count="24">
-0.000000 0.000000
-1.000000 0.000000
-0.000000 1.000000
-1.000000 1.000000
-0.000000 0.000000
-1.000000 0.000000
-0.000000 1.000000
-1.000000 1.000000
-0.000000 0.000000
-1.000000 0.000000
-0.000000 1.000000
-1.000000 1.000000
-</float_array>
- <technique_common>
- <accessor source="#Box01-lib-UV0-array" count="12" stride="2">
- <param name="S" type="float"/>
- <param name="T" type="float"/>
- </accessor>
- </technique_common>
- </source>
- <vertices id="Box01-lib-Vertex">
- <input semantic="POSITION" source="#Box01-lib-Position"/>
- </vertices>
- <polygons material="_02___Default" count="12">
- <input semantic="VERTEX" offset="0" source="#Box01-lib-Vertex"/>
- <input semantic="NORMAL" offset="1" source="#Box01-lib-Normal0"/>
- <input semantic="TEXCOORD" offset="2" set="0" source="#Box01-lib-UV0"/>
- <p>0 0 9 2 1 11 3 2 10</p>
- <p>3 3 10 1 4 8 0 5 9</p>
- <p>4 6 8 5 7 9 7 8 11</p>
- <p>7 9 11 6 10 10 4 11 8</p>
- <p>0 12 4 1 13 5 5 14 7</p>
- <p>5 15 7 4 16 6 0 17 4</p>
- <p>1 18 0 3 19 1 7 20 3</p>
- <p>7 21 3 5 22 2 1 23 0</p>
- <p>3 24 4 2 25 5 6 26 7</p>
- <p>6 27 7 7 28 6 3 29 4</p>
- <p>2 30 0 0 31 1 4 32 3</p>
- <p>4 33 3 6 34 2 2 35 0</p>
- </polygons>
- </mesh>
- </geometry>
- <geometry id="Box02-lib" name="Box02Mesh">
- <mesh>
- <source id="Box02-lib-Position">
- <float_array id="Box02-lib-Position-array" count="24">
--20.000000 -20.000000 0.000000
-20.000000 -20.000000 0.000000
--20.000000 20.000000 0.000000
-20.000000 20.000000 0.000000
--20.000000 -20.000000 20.000000
-20.000000 -20.000000 20.000000
--20.000000 20.000000 20.000000
-20.000000 20.000000 20.000000
-</float_array>
- <technique_common>
- <accessor source="#Box02-lib-Position-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="Box02-lib-Normal0">
- <float_array id="Box02-lib-Normal0-array" count="108">
-0.000000 0.000000 -1.000000
-0.000000 0.000000 -1.000000
-0.000000 0.000000 -1.000000
-0.000000 0.000000 -1.000000
-0.000000 0.000000 -1.000000
-0.000000 0.000000 -1.000000
-0.000000 0.000000 1.000000
-0.000000 0.000000 1.000000
-0.000000 0.000000 1.000000
-0.000000 0.000000 1.000000
-0.000000 0.000000 1.000000
-0.000000 0.000000 1.000000
-0.000000 -1.000000 0.000000
-0.000000 -1.000000 0.000000
-0.000000 -1.000000 0.000000
-0.000000 -1.000000 0.000000
-0.000000 -1.000000 0.000000
-0.000000 -1.000000 0.000000
-1.000000 0.000000 0.000000
-1.000000 0.000000 0.000000
-1.000000 0.000000 0.000000
-1.000000 0.000000 0.000000
-1.000000 0.000000 0.000000
-1.000000 0.000000 0.000000
-0.000000 1.000000 0.000000
-0.000000 1.000000 0.000000
-0.000000 1.000000 0.000000
-0.000000 1.000000 0.000000
-0.000000 1.000000 0.000000
-0.000000 1.000000 0.000000
--1.000000 0.000000 0.000000
--1.000000 0.000000 0.000000
--1.000000 0.000000 0.000000
--1.000000 0.000000 0.000000
--1.000000 0.000000 0.000000
--1.000000 0.000000 0.000000
-</float_array>
- <technique_common>
- <accessor source="#Box02-lib-Normal0-array" count="36" stride="3">
- <param name="X" type="float"/>
- <param name="Y" type="float"/>
- <param name="Z" type="float"/>
- </accessor>
- </technique_common>
- </source>
- <source id="Box02-lib-UV0">
- <float_array id="Box02-lib-UV0-array" count="24">
-0.000000 0.000000
-1.000000 0.000000
-0.000000 1.000000
-1.000000 1.000000
-0.000000 0.000000
-1.000000 0.000000
-0.000000 1.000000
-1.000000 1.000000
-0.000000 0.000000
-1.000000 0.000000
-0.000000 1.000000
-1.000000 1.000000
-</float_array>
- <technique_common>
- <accessor source="#Box02-lib-UV0-array" count="12" stride="2">
- <param name="S" type="float"/>
- <param name="T" type="float"/>
- </accessor>
- </technique_common>
- </source>
- <vertices id="Box02-lib-Vertex">
- <input semantic="POSITION" source="#Box02-lib-Position"/>
- </vertices>
- <polygons material="_01___Default" count="12">
- <input semantic="VERTEX" offset="0" source="#Box02-lib-Vertex"/>
- <input semantic="NORMAL" offset="1" source="#Box02-lib-Normal0"/>
- <input semantic="TEXCOORD" offset="2" set="0" source="#Box02-lib-UV0"/>
- <p>0 0 9 2 1 11 3 2 10</p>
- <p>3 3 10 1 4 8 0 5 9</p>
- <p>4 6 8 5 7 9 7 8 11</p>
- <p>7 9 11 6 10 10 4 11 8</p>
- <p>0 12 4 1 13 5 5 14 7</p>
- <p>5 15 7 4 16 6 0 17 4</p>
- <p>1 18 0 3 19 1 7 20 3</p>
- <p>7 21 3 5 22 2 1 23 0</p>
- <p>3 24 4 2 25 5 6 26 7</p>
- <p>6 27 7 7 28 6 3 29 4</p>
- <p>2 30 0 0 31 1 4 32 3</p>
- <p>4 33 3 6 34 2 2 35 0</p>
- </polygons>
- </mesh>
- </geometry>
- </library_geometries>
- <library_animations>
- <animation id="Box02-anim" name="Box02">
- <animation>
- <source id="Box02-rotateX-animation-inputANGLE">
- <float_array id="Box02-rotateX-animation-inputANGLE-array" count="2">
-
-0.000000 0.800000</float_array>
- <technique_common>
- <accessor source="#Box02-rotateX-animation-inputANGLE-array" count="2">
- <param name="TIME" type="float"/>
- </accessor>
- </technique_common>
- </source>
- <source id="Box02-rotateX-animation-outputANGLE">
- <float_array id="Box02-rotateX-animation-outputANGLE-array" count="2">
-
-0.000000 0.000000</float_array>
- <technique_common>
- <accessor source="#Box02-rotateX-animation-outputANGLE-array" count="2">
- <param name="ANGLE" type="float"/>
- </accessor>
- </technique_common>
- </source>
- <source id="Box02-rotateX-animation-intanANGLE">
- <float_array id="Box02-rotateX-animation-intanANGLE-array" count="2">
-
-0.000000 -0.000000</float_array>
- <technique_common>
- <accessor source="#Box02-rotateX-animation-intanANGLE-array" count="2">
- <param name="ANGLE" type="float"/>
- </accessor>
- </technique_common>
- </source>
- <source id="Box02-rotateX-animation-outtanANGLE">
- <float_array id="Box02-rotateX-animation-outtanANGLE-array" count="2">
-
-0.000000 0.000000</float_array>
- <technique_common>
- <accessor source="#Box02-rotateX-animation-outtanANGLE-array" count="2">
- <param name="ANGLE" type="float"/>
- </accessor>
- </technique_common>
- </source>
- <source id="Box02-rotateX-animation-interpolationANGLE">
- <Name_array id="Box02-rotateX-animation-interpolationANGLE-array" count="2">
- BEZIER BEZIER</Name_array>
- <technique_common>
- <accessor source="#Box02-rotateX-animation-interpolationANGLE-array" count="2">
- <param type="name"/>
- </accessor>
- </technique_common>
- </source>
- <sampler id="Box02-rotateX-animationANGLE">
- <input semantic="INPUT" source="#Box02-rotateX-animation-inputANGLE"/>
- <input semantic="OUTPUT" source="#Box02-rotateX-animation-outputANGLE"/>
- <input semantic="IN_TANGENT" source="#Box02-rotateX-animation-intanANGLE"/>
- <input semantic="OUT_TANGENT" source="#Box02-rotateX-animation-outtanANGLE"/>
- <input semantic="INTERPOLATION" source="#Box02-rotateX-animation-interpolationANGLE"/>
- </sampler>
- <channel source="#Box02-rotateX-animationANGLE" target="Box02/rotateX.ANGLE"/>
- </animation>
- <animation>
- <source id="Box02-rotateY-animation-inputANGLE">
- <float_array id="Box02-rotateY-animation-inputANGLE-array" count="2">
-
-0.000000 0.800000</float_array>
- <technique_common>
- <accessor source="#Box02-rotateY-animation-inputANGLE-array" count="2">
- <param name="TIME" type="float"/>
- </accessor>
- </technique_common>
- </source>
- <source id="Box02-rotateY-animation-outputANGLE">
- <float_array id="Box02-rotateY-animation-outputANGLE-array" count="2">
-
--0.000000 -0.000000</float_array>
- <technique_common>
- <accessor source="#Box02-rotateY-animation-outputANGLE-array" count="2">
- <param name="ANGLE" type="float"/>
- </accessor>
- </technique_common>
- </source>
- <source id="Box02-rotateY-animation-intanANGLE">
- <float_array id="Box02-rotateY-animation-intanANGLE-array" count="2">
-
-0.000000 -0.000000</float_array>
- <technique_common>
- <accessor source="#Box02-rotateY-animation-intanANGLE-array" count="2">
- <param name="ANGLE" type="float"/>
- </accessor>
- </technique_common>
- </source>
- <source id="Box02-rotateY-animation-outtanANGLE">
- <float_array id="Box02-rotateY-animation-outtanANGLE-array" count="2">
-
-0.000000 0.000000</float_array>
- <technique_common>
- <accessor source="#Box02-rotateY-animation-outtanANGLE-array" count="2">
- <param name="ANGLE" type="float"/>
- </accessor>
- </technique_common>
- </source>
- <source id="Box02-rotateY-animation-interpolationANGLE">
- <Name_array id="Box02-rotateY-animation-interpolationANGLE-array" count="2">
- BEZIER BEZIER</Name_array>
- <technique_common>
- <accessor source="#Box02-rotateY-animation-interpolationANGLE-array" count="2">
- <param type="name"/>
- </accessor>
- </technique_common>
- </source>
- <sampler id="Box02-rotateY-animationANGLE">
- <input semantic="INPUT" source="#Box02-rotateY-animation-inputANGLE"/>
- <input semantic="OUTPUT" source="#Box02-rotateY-animation-outputANGLE"/>
- <input semantic="IN_TANGENT" source="#Box02-rotateY-animation-intanANGLE"/>
- <input semantic="OUT_TANGENT" source="#Box02-rotateY-animation-outtanANGLE"/>
- <input semantic="INTERPOLATION" source="#Box02-rotateY-animation-interpolationANGLE"/>
- </sampler>
- <channel source="#Box02-rotateY-animationANGLE" target="Box02/rotateY.ANGLE"/>
- </animation>
- <animation>
- <source id="Box02-rotateZ-animation-inputANGLE">
- <float_array id="Box02-rotateZ-animation-inputANGLE-array" count="2">
-
-0.000000 0.800000</float_array>
- <technique_common>
- <accessor source="#Box02-rotateZ-animation-inputANGLE-array" count="2">
- <param name="TIME" type="float"/>
- </accessor>
- </technique_common>
- </source>
- <source id="Box02-rotateZ-animation-outputANGLE">
- <float_array id="Box02-rotateZ-animation-outputANGLE-array" count="2">
-
-0.000000 90.000008</float_array>
- <technique_common>
- <accessor source="#Box02-rotateZ-animation-outputANGLE-array" count="2">
- <param name="ANGLE" type="float"/>
- </accessor>
- </technique_common>
- </source>
- <source id="Box02-rotateZ-animation-intanANGLE">
- <float_array id="Box02-rotateZ-animation-intanANGLE-array" count="2">
-
-0.000000 -0.000000</float_array>
- <technique_common>
- <accessor source="#Box02-rotateZ-animation-intanANGLE-array" count="2">
- <param name="ANGLE" type="float"/>
- </accessor>
- </technique_common>
- </source>
- <source id="Box02-rotateZ-animation-outtanANGLE">
- <float_array id="Box02-rotateZ-animation-outtanANGLE-array" count="2">
-
-0.000000 0.000000</float_array>
- <technique_common>
- <accessor source="#Box02-rotateZ-animation-outtanANGLE-array" count="2">
- <param name="ANGLE" type="float"/>
- </accessor>
- </technique_common>
- </source>
- <source id="Box02-rotateZ-animation-interpolationANGLE">
- <Name_array id="Box02-rotateZ-animation-interpolationANGLE-array" count="2">
- BEZIER BEZIER</Name_array>
- <technique_common>
- <accessor source="#Box02-rotateZ-animation-interpolationANGLE-array" count="2">
- <param type="name"/>
- </accessor>
- </technique_common>
- </source>
- <sampler id="Box02-rotateZ-animationANGLE">
- <input semantic="INPUT" source="#Box02-rotateZ-animation-inputANGLE"/>
- <input semantic="OUTPUT" source="#Box02-rotateZ-animation-outputANGLE"/>
- <input semantic="IN_TANGENT" source="#Box02-rotateZ-animation-intanANGLE"/>
- <input semantic="OUT_TANGENT" source="#Box02-rotateZ-animation-outtanANGLE"/>
- <input semantic="INTERPOLATION" source="#Box02-rotateZ-animation-interpolationANGLE"/>
- </sampler>
- <channel source="#Box02-rotateZ-animationANGLE" target="Box02/rotateZ.ANGLE"/>
- </animation>
- </animation>
- </library_animations>
- <library_visual_scenes>
- <visual_scene id="RootNode" name="RootNode">
- <node id="Box01" name="Box01">
- <rotate sid="jointOrientX">1 0 0 -90.000000</rotate>
- <instance_geometry url="#Box01-lib">
- <bind_material>
- <technique_common>
- <instance_material symbol="_02___Default" target="#_02___Default"/>
- </technique_common>
- </bind_material>
- </instance_geometry>
- </node>
- <node id="Box02" name="Box02">
- <translate sid="translate">0.000000 5.000000 -0.000000</translate>
- <rotate sid="jointOrientX">1 0 0 -90.000000</rotate>
- <rotate sid="rotateZ">0 0 1 0.000000</rotate>
- <rotate sid="rotateY">0 1 0 0.000000</rotate>
- <rotate sid="rotateX">1 0 0 0.000000</rotate>
- <instance_geometry url="#Box02-lib">
- <bind_material>
- <technique_common>
- <instance_material symbol="_01___Default" target="#_01___Default"/>
- </technique_common>
- </bind_material>
- </instance_geometry>
- </node>
- </visual_scene>
- </library_visual_scenes>
- <scene>
- <instance_visual_scene url="#RootNode"/>
- </scene>
-</COLLADA>
-
diff --git a/examples/quick3d/animations/qml/stonewal.jpg b/examples/quick3d/animations/qml/stonewal.jpg
deleted file mode 100644
index 226672a2..00000000
--- a/examples/quick3d/animations/qml/stonewal.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/animations/qtquick3d.ico b/examples/quick3d/animations/qtquick3d.ico
deleted file mode 100644
index c695ac72..00000000
--- a/examples/quick3d/animations/qtquick3d.ico
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/animations/qtquick3d.png b/examples/quick3d/animations/qtquick3d.png
deleted file mode 100644
index 8351083e..00000000
--- a/examples/quick3d/animations/qtquick3d.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/basket/basket.pro b/examples/quick3d/basket/basket.pro
deleted file mode 100644
index 15db3ed5..00000000
--- a/examples/quick3d/basket/basket.pro
+++ /dev/null
@@ -1,18 +0,0 @@
-TEMPLATE = app
-TARGET = basket_qml
-CONFIG += qt warn_on
-
-CONFIG += qt3dquick_deploy_pkg
-include(../../../pkg.pri)
-
-SOURCES += main.cpp
-
-OTHER_FILES += \
- basket_qml.rc \
- basket_qml.desktop
-
-RC_FILE = basket_qml.rc
-
-RESOURCES += \
- basket.qrc
-
diff --git a/examples/quick3d/basket/basket.qrc b/examples/quick3d/basket/basket.qrc
deleted file mode 100644
index 91e4f129..00000000
--- a/examples/quick3d/basket/basket.qrc
+++ /dev/null
@@ -1,7 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>qml/basket.bez</file>
- <file>qml/basket.jpg</file>
- <file>qml/basket.qml</file>
- </qresource>
-</RCC>
diff --git a/examples/quick3d/basket/basket_qml.desktop b/examples/quick3d/basket/basket_qml.desktop
deleted file mode 100644
index 76b06cd6..00000000
--- a/examples/quick3d/basket/basket_qml.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=Basket
-Icon=/usr/share/icons/hicolor/80x80/apps/qtquick3d.png
-Exec=/usr/bin/invoker --type=e -s /usr/bin/basket_qml -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_basket_qml
diff --git a/examples/quick3d/basket/basket_qml.rc b/examples/quick3d/basket/basket_qml.rc
deleted file mode 100644
index 1b6228c9..00000000
--- a/examples/quick3d/basket/basket_qml.rc
+++ /dev/null
@@ -1 +0,0 @@
-IDI_ICON1 ICON DISCARDABLE "qtquick3d.ico"
diff --git a/examples/quick3d/basket/main.cpp b/examples/quick3d/basket/main.cpp
deleted file mode 100644
index 3907160b..00000000
--- a/examples/quick3d/basket/main.cpp
+++ /dev/null
@@ -1,66 +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: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$
-**
-****************************************************************************/
-
-#include <QtGui/QApplication>
-#include "qdeclarativeview3d.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
-
- QDeclarativeView3D view;
-
- view.setSource(QUrl(QLatin1String("qrc:///qml/basket.qml")));
-
-#ifdef Q_OS_SYMBIAN
- view.setAttribute(Qt::WA_LockLandscapeOrientation, true);
- view.setResizeMode(QDeclarativeView::SizeRootObjectToView);
- view.showMaximized();
-#else
- if (QApplication::arguments().contains(QLatin1String("-maximize")))
- view.showMaximized();
- else if (QApplication::arguments().contains(QLatin1String("-fullscreen")))
- view.showFullScreen();
- else
- view.show();
-#endif
-
- return app.exec();
-}
diff --git a/examples/quick3d/basket/qml/basket.bez b/examples/quick3d/basket/qml/basket.bez
deleted file mode 100644
index 614daf09..00000000
--- a/examples/quick3d/basket/qml/basket.bez
+++ /dev/null
@@ -1,332 +0,0 @@
-24
-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
-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/examples/quick3d/basket/qml/basket.jpg b/examples/quick3d/basket/qml/basket.jpg
deleted file mode 100644
index c292a83d..00000000
--- a/examples/quick3d/basket/qml/basket.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/basket/qml/basket.qml b/examples/quick3d/basket/qml/basket.qml
deleted file mode 100644
index c9a41de7..00000000
--- a/examples/quick3d/basket/qml/basket.qml
+++ /dev/null
@@ -1,74 +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
-
-Viewport {
- width: 640; height: 480
-
- camera: Camera {
- eye: Qt.vector3d(0, 4, 10)
- }
-//! [1]
-
-//! [2]
- Item3D {
- mesh: Mesh { source: ":/qml/basket.bez" }
- effect: Effect { texture: ":/qml/basket.jpg" }
-//! [2]
-//! [3]
- transform: [
- Scale3D { scale: 1.5 },
- Rotation3D {
- axis: Qt.vector3d(0, 1, 0)
- NumberAnimation on angle {
- running: true
- loops: Animation.Infinite
- from: 0
- to: 360
- duration: 2000
- }
- }
- ]
- }
-}
-//! [3]
diff --git a/examples/quick3d/basket/qtquick3d.ico b/examples/quick3d/basket/qtquick3d.ico
deleted file mode 100644
index c695ac72..00000000
--- a/examples/quick3d/basket/qtquick3d.ico
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/basket/qtquick3d.png b/examples/quick3d/basket/qtquick3d.png
deleted file mode 100644
index 8351083e..00000000
--- a/examples/quick3d/basket/qtquick3d.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/cube/cube.pro b/examples/quick3d/cube/cube.pro
deleted file mode 100644
index 82101573..00000000
--- a/examples/quick3d/cube/cube.pro
+++ /dev/null
@@ -1,16 +0,0 @@
-TEMPLATE = app
-TARGET = cube_qml
-CONFIG += qt warn_on
-
-INSTALL_DIRS = qml
-CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg
-include(../../../pkg.pri)
-qtcAddDeployment()
-
-SOURCES += main.cpp
-
-OTHER_FILES += \
- cube_qml.rc \
- cube_qml.desktop
-
-RC_FILE = cube_qml.rc
diff --git a/examples/quick3d/cube/cube_qml.desktop b/examples/quick3d/cube/cube_qml.desktop
deleted file mode 100644
index 2872740c..00000000
--- a/examples/quick3d/cube/cube_qml.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=Cube
-Icon=/usr/share/icons/hicolor/80x80/apps/qtquick3d.png
-Exec=/usr/bin/invoker --type=e -s /usr/bin/cube_qml -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_cube_qml
diff --git a/examples/quick3d/cube/cube_qml.rc b/examples/quick3d/cube/cube_qml.rc
deleted file mode 100644
index 1b6228c9..00000000
--- a/examples/quick3d/cube/cube_qml.rc
+++ /dev/null
@@ -1 +0,0 @@
-IDI_ICON1 ICON DISCARDABLE "qtquick3d.ico"
diff --git a/examples/quick3d/cube/main.cpp b/examples/quick3d/cube/main.cpp
deleted file mode 100644
index 44dd0a0c..00000000
--- a/examples/quick3d/cube/main.cpp
+++ /dev/null
@@ -1,69 +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: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$
-**
-****************************************************************************/
-
-#include <QtGui/QApplication>
-#include "qdeclarativeview3d.h"
-
-#include "../qmlres.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
-
- QDeclarativeView3D view;
- QString qml = q_get_qmldir(QLatin1String("qml/cube.qml"));
-
- view.setSource(QUrl::fromLocalFile(qml));
-
-#ifdef Q_OS_SYMBIAN
- view.setAttribute(Qt::WA_LockLandscapeOrientation, true);
- view.setResizeMode(QDeclarativeView::SizeRootObjectToView);
- view.showFullScreen();
-#else
- if (QApplication::arguments().contains(QLatin1String("-maximize")))
- view.showMaximized();
- else if (QApplication::arguments().contains(QLatin1String("-fullscreen")))
- view.showFullScreen();
- else
- view.show();
-#endif
-
- return app.exec();
-}
diff --git a/examples/quick3d/cube/qml/cube.qml b/examples/quick3d/cube/qml/cube.qml
deleted file mode 100644
index 89a7e669..00000000
--- a/examples/quick3d/cube/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/examples/quick3d/cube/qml/qtlogo.png b/examples/quick3d/cube/qml/qtlogo.png
deleted file mode 100644
index 7d3e97eb..00000000
--- a/examples/quick3d/cube/qml/qtlogo.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/cube/qtquick3d.ico b/examples/quick3d/cube/qtquick3d.ico
deleted file mode 100644
index c695ac72..00000000
--- a/examples/quick3d/cube/qtquick3d.ico
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/cube/qtquick3d.png b/examples/quick3d/cube/qtquick3d.png
deleted file mode 100644
index 8351083e..00000000
--- a/examples/quick3d/cube/qtquick3d.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/forest/forest.pro b/examples/quick3d/forest/forest.pro
deleted file mode 100644
index 6c60025a..00000000
--- a/examples/quick3d/forest/forest.pro
+++ /dev/null
@@ -1,17 +0,0 @@
-TEMPLATE = app
-TARGET = forest_qml
-CONFIG += qt warn_on
-
-CONFIG += qt3dquick_deploy_pkg
-include(../../../pkg.pri)
-
-SOURCES += main.cpp
-
-OTHER_FILES += \
- forest.rc \
- forest_qml.desktop
-
-RC_FILE = forest.rc
-
-RESOURCES += \
- forest.qrc
diff --git a/examples/quick3d/forest/forest.qrc b/examples/quick3d/forest/forest.qrc
deleted file mode 100644
index d0d391a5..00000000
--- a/examples/quick3d/forest/forest.qrc
+++ /dev/null
@@ -1,9 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>qml/forest.qml</file>
- <file>qml/ground.obj</file>
- <file>qml/tree.obj</file>
- <file>qml/tree.png</file>
- <file>qml/Tree.qml</file>
- </qresource>
-</RCC>
diff --git a/examples/quick3d/forest/forest.rc b/examples/quick3d/forest/forest.rc
deleted file mode 100644
index 1b6228c9..00000000
--- a/examples/quick3d/forest/forest.rc
+++ /dev/null
@@ -1 +0,0 @@
-IDI_ICON1 ICON DISCARDABLE "qtquick3d.ico"
diff --git a/examples/quick3d/forest/forest_qml.desktop b/examples/quick3d/forest/forest_qml.desktop
deleted file mode 100644
index 0c27d6ed..00000000
--- a/examples/quick3d/forest/forest_qml.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=Forest
-Icon=/usr/share/icons/hicolor/80x80/apps/qtquick3d.png
-Exec=/usr/bin/invoker --type=e -s /usr/bin/forest_qml -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_forest
diff --git a/examples/quick3d/forest/main.cpp b/examples/quick3d/forest/main.cpp
deleted file mode 100644
index f20698db..00000000
--- a/examples/quick3d/forest/main.cpp
+++ /dev/null
@@ -1,65 +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: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$
-**
-****************************************************************************/
-
-#include <QtGui/QApplication>
-#include "qdeclarativeview3d.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
- QDeclarativeView3D view;
-
- view.setSource(QUrl(QLatin1String("qrc:///qml/forest.qml")));
-
-#ifdef Q_OS_SYMBIAN
- view.setAttribute(Qt::WA_LockLandscapeOrientation, true);
- view.setResizeMode(QDeclarativeView::SizeRootObjectToView);
- view.showFullScreen();
-#else
- if (QApplication::arguments().contains(QLatin1String("-maximize")))
- view.showMaximized();
- else if (QApplication::arguments().contains(QLatin1String("-fullscreen")))
- view.showFullScreen();
- else
- view.show();
-#endif
-
- return app.exec();
-}
diff --git a/examples/quick3d/forest/qml/Tree.qml b/examples/quick3d/forest/qml/Tree.qml
deleted file mode 100644
index a1af5cc7..00000000
--- a/examples/quick3d/forest/qml/Tree.qml
+++ /dev/null
@@ -1,54 +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
-
-BillboardItem3D {
- id: tree
- mesh: Mesh { source: "tree.obj" }
- effect: Effect {
- blending: true
- texture: "tree.png"
- }
-//![2]
-}
-//![3]
diff --git a/examples/quick3d/forest/qml/forest.qml b/examples/quick3d/forest/qml/forest.qml
deleted file mode 100644
index a492ff6a..00000000
--- a/examples/quick3d/forest/qml/forest.qml
+++ /dev/null
@@ -1,81 +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
-
-Viewport {
- id: viewport
- width: 640; height: 480
- picking: false
-
- camera: Camera {
- eye: Qt.vector3d(0, 4, 12)
- }
-
- Item3D {
- id: ground
- mesh: Mesh { source: "ground.obj" }
- effect: Effect {
- color: "#604000"
- useLighting: false
- }
- }
-
- Item3D {
- sortChildren: Item3D.BackToFront
-
- Tree { position: Qt.vector3d(-1.5, 0, -1) }
- Tree { position: Qt.vector3d(-0.5, 0, -1) }
- Tree { position: Qt.vector3d(0.5, 0, -1) }
- Tree { position: Qt.vector3d(1.5, 0, -1) }
-
- Tree { position: Qt.vector3d(0, 0, 0) }
- Tree { position: Qt.vector3d(-1, 0, 0) }
- Tree { position: Qt.vector3d(1, 0, 0) }
-
- Tree { position: Qt.vector3d(-1.5, 0, 1) }
- Tree { position: Qt.vector3d(-0.5, 0, 1) }
- Tree { position: Qt.vector3d(0.5, 0, 1) }
- Tree { position: Qt.vector3d(1.5, 0, 1) }
- }
-}
-//![1]
diff --git a/examples/quick3d/forest/qml/ground.obj b/examples/quick3d/forest/qml/ground.obj
deleted file mode 100644
index d13a931a..00000000
--- a/examples/quick3d/forest/qml/ground.obj
+++ /dev/null
@@ -1,11 +0,0 @@
-s 0
-v -3.0 0.0 3.0
-v 3.0 0.0 3.0
-v 3.0 0.0 -3.0
-v -3.0 0.0 -3.0
-vt 0.0 0.0
-vt 1.0 0.0
-vt 1.0 1.0
-vt 0.0 1.0
-vn 0.0 1.0 0.0
-f 1/1/1 2/2/1 3/3/1 4/4/1
diff --git a/examples/quick3d/forest/qml/tree.obj b/examples/quick3d/forest/qml/tree.obj
deleted file mode 100644
index 6dd72d7b..00000000
--- a/examples/quick3d/forest/qml/tree.obj
+++ /dev/null
@@ -1,11 +0,0 @@
-s 0
-v -0.5 0.0 0.0
-v 0.5 0.0 0.0
-v 0.5 1.0 0.0
-v -0.5 1.0 0.0
-vt 0.0 0.0
-vt 1.0 0.0
-vt 1.0 1.0
-vt 0.0 1.0
-vn 0.0 0.0 1.0
-f 1/1/1 2/2/1 3/3/1 4/4/1
diff --git a/examples/quick3d/forest/qml/tree.png b/examples/quick3d/forest/qml/tree.png
deleted file mode 100644
index c6a27748..00000000
--- a/examples/quick3d/forest/qml/tree.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/forest/qtquick3d.ico b/examples/quick3d/forest/qtquick3d.ico
deleted file mode 100644
index c695ac72..00000000
--- a/examples/quick3d/forest/qtquick3d.ico
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/forest/qtquick3d.png b/examples/quick3d/forest/qtquick3d.png
deleted file mode 100644
index 8351083e..00000000
--- a/examples/quick3d/forest/qtquick3d.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/lander/lander.desktop b/examples/quick3d/lander/lander.desktop
deleted file mode 100644
index 9020fea1..00000000
--- a/examples/quick3d/lander/lander.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=Lunar Lander
-Icon=/usr/share/icons/hicolor/80x80/apps/qtquick3d.png
-Exec=/usr/bin/invoker --type=e -s /usr/bin/lander -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_lander
diff --git a/examples/quick3d/lander/lander.pro b/examples/quick3d/lander/lander.pro
deleted file mode 100644
index 6594bf05..00000000
--- a/examples/quick3d/lander/lander.pro
+++ /dev/null
@@ -1,22 +0,0 @@
-TEMPLATE = app
-TARGET = lander
-CONFIG += qt warn_on
-
-INSTALL_DIRS = qml
-CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg
-include(../../../pkg.pri)
-qtcAddDeployment()
-
-SOURCES += main.cpp
-
-symbian {
- qmlDeployment2.sources = qml\meshes\*
- qmlDeployment2.path = qml\meshes
- DEPLOYMENT += qmlDeployment2
-}
-
-OTHER_FILES += \
- lander.rc \
- lander.desktop
-
-RC_FILE = lander.rc
diff --git a/examples/quick3d/lander/lander.rc b/examples/quick3d/lander/lander.rc
deleted file mode 100644
index 1b6228c9..00000000
--- a/examples/quick3d/lander/lander.rc
+++ /dev/null
@@ -1 +0,0 @@
-IDI_ICON1 ICON DISCARDABLE "qtquick3d.ico"
diff --git a/examples/quick3d/lander/main.cpp b/examples/quick3d/lander/main.cpp
deleted file mode 100644
index f546e0e0..00000000
--- a/examples/quick3d/lander/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: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$
-**
-****************************************************************************/
-
-#include <QtGui/QApplication>
-#include "qdeclarativeview3d.h"
-
-#include "../qmlres.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
-
- QDeclarativeView3D view;
- QString qml = q_get_qmldir(QLatin1String("qml/lander.qml"));
- view.setSource(QUrl::fromLocalFile(qml));
-
-#ifdef Q_OS_SYMBIAN
- view.setAttribute(Qt::WA_LockLandscapeOrientation, true);
- view.setResizeMode(QDeclarativeView::SizeRootObjectToView);
- view.showFullScreen();
-#else
- if (QApplication::arguments().contains(QLatin1String("-maximize")))
- view.showMaximized();
- else if (QApplication::arguments().contains(QLatin1String("-fullscreen")))
- view.showFullScreen();
- else
- view.show();
-#endif
-
- return app.exec();
-}
diff --git a/examples/quick3d/lander/qml/Jet.qml b/examples/quick3d/lander/qml/Jet.qml
deleted file mode 100644
index e90be73d..00000000
--- a/examples/quick3d/lander/qml/Jet.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 QtQuick3D module 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 1.0
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-
-Item3D {
- // We want to scale the flame, but keep the top constant so it
- // looks like it's attached to the lander's foot, so we use a
- // container Item3D to translate the flame's origin
-
- // This magic number lines up the jet with the bottom of the lander model
- y: -0.97 - 0.25 + 0.5
- id: jet
-
- property real scaleFactor: 1.0
- property real internalScaleFactor: 1.0
-
- Behavior on scaleFactor { NumberAnimation { duration: 200 }}
-
- transform: Scale3D { scale: jet.scaleFactor * internalScaleFactor * 0.5 }
-
- SequentialAnimation {
- running: true
- loops: Animation.Infinite
- NumberAnimation { target: jet;property: "internalScaleFactor";
- from: 1.0; to: 0.8; duration: 100 }
- PauseAnimation { duration: 100 }
- NumberAnimation { target: jet; property: "internalScaleFactor";
- from: 0.8; to: 1.0; duration: 100 }
- PauseAnimation { duration: 100 }
- }
-
- Quad {
- y: -1.0
- pretransform: Rotation3D { axis: Qt.vector3d(1, 0, 0); angle: 90 }
- effect: flame
- }
-
- ShaderProgram {
- id: flame
- blending: true
- texture: "flame.png"
- property real interpolationFactor : 1.0
-
- SequentialAnimation on interpolationFactor {
- running: true
- loops: Animation.Infinite
- NumberAnimation { to : 1.0; duration: 150; }
- NumberAnimation { to : 0.0; duration: 150; }
- }
-
- vertexShader: "
- attribute highp vec4 qt_Vertex;
- attribute highp vec4 qt_MultiTexCoord0;
- uniform mediump mat4 qt_ModelViewProjectionMatrix;
- varying highp vec4 texCoord;
-
- void main(void)
- {
- gl_Position = qt_ModelViewProjectionMatrix * qt_Vertex;
- texCoord = qt_MultiTexCoord0;
- }
- "
- fragmentShader: "
- varying highp vec4 texCoord;
- uniform sampler2D qt_Texture0;
- uniform sampler2D texture2;
- uniform mediump float interpolationFactor;
-
- void main(void)
- {
- mediump vec4 col1 = texture2D(qt_Texture0, texCoord.st);
- mediump vec4 col2 = texture2D(texture2, texCoord.st);
- gl_FragColor = mix(col1, col2, interpolationFactor);
- }
- "
- }
-}
diff --git a/examples/quick3d/lander/qml/README b/examples/quick3d/lander/qml/README
deleted file mode 100644
index b089fd32..00000000
--- a/examples/quick3d/lander/qml/README
+++ /dev/null
@@ -1,5 +0,0 @@
-Lander is intended to use the Joystix font available for free from Ray Larabie via:
-http://typodermicfonts.com/the-larabie-fonts-collection
-
-Licencing does not allow distribution in ttf form as part of the source package, so please download and place the "JOYSTIX.TTF" file in this directory.
-
diff --git a/examples/quick3d/lander/qml/dropshadow.png b/examples/quick3d/lander/qml/dropshadow.png
deleted file mode 100644
index 105d34e4..00000000
--- a/examples/quick3d/lander/qml/dropshadow.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/lander/qml/flame.png b/examples/quick3d/lander/qml/flame.png
deleted file mode 100644
index 8b80c0c2..00000000
--- a/examples/quick3d/lander/qml/flame.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/lander/qml/flame.xcf b/examples/quick3d/lander/qml/flame.xcf
deleted file mode 100644
index bc6a423a..00000000
--- a/examples/quick3d/lander/qml/flame.xcf
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/lander/qml/flame2.png b/examples/quick3d/lander/qml/flame2.png
deleted file mode 100644
index a3913623..00000000
--- a/examples/quick3d/lander/qml/flame2.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/lander/qml/flame2.xcf b/examples/quick3d/lander/qml/flame2.xcf
deleted file mode 100644
index 2cdf4367..00000000
--- a/examples/quick3d/lander/qml/flame2.xcf
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/lander/qml/lander.qml b/examples/quick3d/lander/qml/lander.qml
deleted file mode 100644
index 359ebae6..00000000
--- a/examples/quick3d/lander/qml/lander.qml
+++ /dev/null
@@ -1,465 +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 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 1.0
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-
-Image {
- id: screen
- source: "nebula.jpg"
- width: 720
- height: 480
-
- // Joystix font available for free from Ray Larabie via
- // http://typodermicfonts.com/the-larabie-fonts-collection
- // Licence does *NOT* allow distribution in ttf form as part of the
- // source package.
- // Install the font file into the same directory as this qml file, and
- // uncomment the following line, and remove the susequent one:
-// FontLoader { id: customFont; source: "JOYSTIX.TTF"
- FontLoader { id: customFont; name: "Sans Serif" }
-
- Viewport {
- id: viewport
- y: 30
- anchors.fill: parent
- visible: false
-
- camera: Camera {
- eye.x: cameraTarget.x
- // Keep the lander and pad in view for reasonable values
- eye.y: (Math.abs(lander.x) * 2.0) + (lander.y * 2.0)
- + (Math.abs(lander.z) * 2.0) + 5.0
- eye.z: lander.z + 20.0
- center: lander.position
- }
-
- Item3D {
- id:cameraTarget
- x: ((lander.x + landingPad.x) / 2.0)
- y: 0
- z: 0
- }
-
- Item3D {
- // Landing pad must come before lander so that transparency on
- // the flames is in the correct order
- id: landingPad
-
- // The landing crater isn't quite centered, and we use the lander's
- // position for scoring, so we're going to adjust the landscape's
- // position and scale to get it to the right size and place.
- scale: 1.4
- x: -0.28
- z: -0.0
-
- mesh: Mesh { source: "meshes/lunar-landscape.obj" }
-
- // This is the top of the model, where we want the lander to land.
- // It would be nice if there was API for this
- property real yMax : y + 3.6;
- }
-
- Quad {
- // Simple drop shadow
- x: lander.x
- y: landingPad.yMax
- z: lander.z
- scale: 2.0
- effect: Effect { texture: "dropshadow.png"; blending: true }
- }
-
- Item3D {
- id: lander
- scale: 0.5
- mesh: Mesh {
- id: landerMesh;
- source: "meshes/lunar-lander.3ds"
- // dumpInfo lets us see the names the 3d artist has assigned
- // to the various nodes in the model for use with the meshNode
- // syntax
- // dumpInfo: true
- }
- effect: Effect {
- color: "#aaca00"
- texture: "rusty.png"
- decal: true
- }
- Item3D {
- // This mesh/meshNode combination serves to pull these
- // elements off the parent mesh, meaning that they are not
- // drawn as part of the lander Item3D, and are instead drawn
- // by these three Item3Ds, where we can control their position
- // and characteristics
-
- Item3D { mesh: landerMesh; meshNode: "Rod.001" }
- Item3D { mesh: landerMesh; meshNode: "Receiver.001" }
- Item3D { mesh: landerMesh; meshNode: "Dish.001" }
-
- transform: [
- // Correct context loss from "pulling off" of graph
- Rotation3D { axis: Qt.vector3d(1.0, 0.0, 0.0) ; angle: -90},
- // Rotate the radar dish around the lander's aerial
- Rotation3D {
- id: radarSpin2 ; axis: Qt.vector3d(0.0, 1.0, 0.0);
- angle: 0
- // Move the origin so the dish rotates relative to
- // lander's aerial
- origin: Qt.vector3d(0.55,0.0,0.0)
- NumberAnimation on angle {
- running: gameLogic.gameRunning
- loops: Animation.Infinite
- from: 360; to: 0; duration: 3000;
- }
- }
- ]
- }
-
- transform: [
- Rotation3D {
- Behavior on angle { NumberAnimation { duration: 200}}
- axis: Qt.vector3d(-1.0,0,0)
- angle: gameLogic.fuel > 0 ? gameLogic.zBoostInput * 50 : 0
- },
- Rotation3D {
- Behavior on angle { NumberAnimation { duration: 200}}
- axis: Qt.vector3d(0,0,1.0)
- angle: gameLogic.fuel > 0 ? gameLogic.xBoostInput * 50 : 0
- }
- ]
-
- // HACK. There should be API for this
- property real yMin: -0.37;
- property bool jetsVisible: gameLogic.gameRunning &&
- gameLogic.fuel > 0.0
- property real yBoostScaleFactor: (gameLogic.yboosting ? 1.3 : 0.8)
- property real activeScaleFactor: 1.3
-
- // Draw back to front to avoid depth vs transparancy issues
-
- // Back
- Jet {
- z: -2.7
- scaleFactor: lander.yBoostScaleFactor -
- gameLogic.zBoostInput * lander.activeScaleFactor
- enabled: lander.jetsVisible
- }
-
- // Left
- Jet {
- x: -2.7
- scaleFactor: lander.yBoostScaleFactor -
- gameLogic.xBoostInput * lander.activeScaleFactor
- enabled: lander.jetsVisible
- }
-
- // Right
- Jet {
- x: 2.7
- scaleFactor: lander.yBoostScaleFactor +
- gameLogic.xBoostInput * lander.activeScaleFactor
- enabled: lander.jetsVisible
- }
-
- // Front
- Jet {
- z: 2.7
- scaleFactor: lander.yBoostScaleFactor +
- gameLogic.zBoostInput * lander.activeScaleFactor
- enabled: lander.jetsVisible
- }
- }
-
- Rectangle {
- id: fuelGauge
- color: "#333333"
- anchors.left: parent.left
- anchors.bottom: parent.bottom
- anchors.top: parent.top
- width: 15
- visible: true
-
- Rectangle {
- id: gauge
- anchors.bottom: fuelGauge.bottom
- anchors.horizontalCenter: parent.horizontalCenter
- height: fuelGauge.height * gameLogic.fuel;
- width: fuelGauge.width * 0.8
- color: Qt.rgba(1.0 -gameLogic.fuel,0.2,gameLogic.fuel)
- }
- }
-
- MouseArea {
- id: gameInputPad
- anchors.fill: parent
- enabled: false
-
- onMousePositionChanged: {
- gameLogic.yboosting = true;
- gameLogic.xBoostInput = (mouseX / viewport.width) - 0.5;
- gameLogic.zBoostInput = (mouseY / viewport.height) - 0.5;
- }
- onPressed: {
- gameLogic.yboosting = true;
- gameLogic.xBoostInput = (mouseX / viewport.width) - 0.5;
- gameLogic.zBoostInput = (mouseY / viewport.height) - 0.5;
- }
- onReleased: {
- gameLogic.yboosting = false;
- gameLogic.xBoostInput = 0.0;
- gameLogic.zBoostInput = 0.0;
- }
- }
-
- // TODO : Key input
-
- Item {
- id: gameLogic
- visible: false
- property string state: "titleScreen"
-
- // Game State
- property int score : 0
- property int hiScore : 0
- property bool gameRunning: false
- property real fuel : 1.0;
-
- property real xBoostInput: 0.0
- property real xVelocity : 0
- property real xBoostFactor: gravity
-
- property bool yboosting: false
- property real yVelocity : 0
- property real yBoostFactor: gravity * 2.0
-
- property real zBoostInput: 0.0
- property real zVelocity : 0
- property real zBoostFactor: gravity
-
- // Constants
- property real gravity: 0.1 / 60.0;
- // Should be about 5 seconds of fuel
- property real fuelConsuptionRate: 1.0 / 60.0 / 5.0
-
- Timer {
- id: simulationTickTimer
- running: false
- interval: 1000.0 / 60.0
- repeat: true
- onTriggered: {
- gameLogic.tick()
- }
- }
-
- function tick() {
- // apply gravity and user inputs to velocities
- yVelocity -= gravity;
- if (fuel > 0.0)
- {
- if (yboosting)
- {
- yVelocity += yBoostFactor;
- fuel -= fuelConsuptionRate;
- }
- xVelocity -= xBoostInput * xBoostFactor;
- zVelocity -= zBoostInput * zBoostFactor;
- }
-
- // update lander position
- lander.x += xVelocity;
- lander.y += yVelocity;
- lander.z += zVelocity;
-
- // Check win condition
- if (lander.y + lander.yMin <= landingPad.yMax)
- {
- // Correct very fast landings
- lander.y = landingPad.yMax - lander.yMin;
- win();
- }
- }
-
- function win() {
- // Theoretical max score is 2 * 100^5, or 20,000,000,000
- score = Math.floor(sanitize(xVelocity) / sanitize(yVelocity) /
- sanitize(zVelocity) / sanitize(lander.x)
- / sanitize(lander.z) * (fuel + 1) );
- if (score > hiScore) hiScore = score;
- simulationTickTimer.running = false;
- endGame();
- }
-
- // When calculating scores, don't divide by zero and ignore sign.
- // Can't have infinite scores, and don't want negative ones!
- function sanitize(value) {
- return Math.max(0.01, Math.abs(value));
- }
-
- function newGame() {
- titleBar.visible = false;
- viewport.visible = true;
- simulationTickTimer.running = true;
- gameInputPad.enabled = true;
- gameLogic.gameRunning = true;
-
- // reset state
- score = 0;
- xBoostInput = 0.0
- xVelocity = 0
- zBoostInput = 0.0
- zVelocity = 0
- yboosting = false
- fuel = 1.0;
-
- // Random starting position
- lander.position = Qt.vector3d(Math.random() * 10.0 - 5.0,
- 5.0,
- Math.random() * 10.0 - 5.0);
-
- // add a small positive yVelocity to give the player a chance
- // to get their bearings
- yVelocity = 0.1
- }
-
- function endGame() {
- simulationTickTimer.running = false;
- // Tidy up visuals
- titleBar.visible = true;
- gameInputPad.enabled = false;
- gameLogic.gameRunning = false;
- gameLogic.zBoostInput = 0.0;
- gameLogic.xBoostInput = 0.0;
- gameLogic.yboosting = false;
- }
- }
- }
-
- Column {
- anchors.left: parent.left
- anchors.right: parent.right
- Row {
- id: scoreBar
- anchors.left: parent.left
- anchors.right: parent.right
- Column {
- // Player 1 Score
- width: parent.width / 3.0
- Text {
- text: "Player 1"
- anchors.horizontalCenter: parent.horizontalCenter
- font.family: customFont.name;
- color: "red"
- }
- Text {
- id: scoreBoardText
- text: "Score: " + gameLogic.score
- anchors.horizontalCenter: parent.horizontalCenter
- font.family: customFont.name;
- color: "white"
- }
- }
- Column {
- // Hi Score
- width: parent.width / 3.0
- Text {
- text: "Hi Score"
- anchors.horizontalCenter: parent.horizontalCenter
- font.family: customFont.name;
- color: "red"
- }
- Text {
- text: "Score: " + gameLogic.hiScore
- anchors.horizontalCenter: parent.horizontalCenter
- font.family: customFont.name;
- color: "white"
- }
- }
- Column {
- // Player 2 Score (Not used)
- width: screen.width / 3.0
- Text {
- text: "Player 2"
- anchors.horizontalCenter: parent.horizontalCenter
- font.family: customFont.name;
- color: "red"
- }
- }
- }
-
- Text {
- id: titleBar
- anchors.horizontalCenter: parent.horizontalCenter
- y: screen.height / 5.0
- text: "Qt-Lander"
- font.family: customFont.name
- font.pointSize: 48
- color: "white"
- SequentialAnimation on color {
- loops: Animation.Infinite
- ColorAnimation { to: "#ff0000"; duration: 100 }
- ColorAnimation { to: "#ffff00"; duration: 100 }
- ColorAnimation { to: "#00ff00"; duration: 100 }
- ColorAnimation { to: "#00ffff"; duration: 100 }
- ColorAnimation { to: "#0000ff"; duration: 100 }
- ColorAnimation { to: "#ff00ff"; duration: 100 }
- }
- }
- }
-
- Item {
- id: tapToStart
- visible: titleBar.visible
- anchors.fill: parent
- Text {
- text: "Tap to Play"
- anchors.centerIn: parent
- font.family: customFont.name
- font.pointSize: 20
- color: "white"
- }
- MouseArea {
- // Note - this mousearea will be obscured by the game's mousearea
- // during play
- anchors.fill: parent
- onClicked: gameLogic.newGame();
- }
- }
-}
diff --git a/examples/quick3d/lander/qml/lander.qmlproject b/examples/quick3d/lander/qml/lander.qmlproject
deleted file mode 100644
index 29d37590..00000000
--- a/examples/quick3d/lander/qml/lander.qmlproject
+++ /dev/null
@@ -1,56 +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: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 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: [ " ../exampleplugin " ]
-}
diff --git a/examples/quick3d/lander/qml/lunar-lander.3ds b/examples/quick3d/lander/qml/lunar-lander.3ds
deleted file mode 100644
index eab75bc5..00000000
--- a/examples/quick3d/lander/qml/lunar-lander.3ds
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/lander/qml/meshes/lunar-lander.3ds b/examples/quick3d/lander/qml/meshes/lunar-lander.3ds
deleted file mode 100644
index 7403fdef..00000000
--- a/examples/quick3d/lander/qml/meshes/lunar-lander.3ds
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/lander/qml/meshes/lunar-lander.obj b/examples/quick3d/lander/qml/meshes/lunar-lander.obj
deleted file mode 100644
index f8873069..00000000
--- a/examples/quick3d/lander/qml/meshes/lunar-lander.obj
+++ /dev/null
@@ -1,1784 +0,0 @@
-# Blender3D v249 OBJ File:
-# www.blender3d.org
-mtllib lunar-lander.mtl
-v 0.552023 6.009904 -0.036599
-v 0.552023 5.994745 -0.000000
-v 0.552023 6.009904 0.036598
-v 0.552023 6.046502 0.051757
-v 0.552023 6.083100 0.036598
-v 0.552023 6.098259 -0.000000
-v 0.552023 6.083100 -0.036599
-v 0.552023 6.046502 -0.051758
-v 1.426268 6.009904 -0.036599
-v 1.426268 5.994745 -0.000000
-v 1.426268 6.009904 0.036598
-v 1.426268 6.046502 0.051757
-v 1.426268 6.083100 0.036598
-v 1.426268 6.098259 -0.000000
-v 1.426268 6.083100 -0.036599
-v 1.426268 6.046502 -0.051758
-v 0.552023 6.046502 -0.000000
-v 1.426268 6.046502 -0.000000
-usemtl (null)
-s off
-f 17 1 2
-f 18 10 9
-f 17 2 3
-f 18 11 10
-f 17 3 4
-f 18 12 11
-f 17 4 5
-f 18 13 12
-f 17 5 6
-f 18 14 13
-f 17 6 7
-f 18 15 14
-f 17 7 8
-f 18 16 15
-f 8 1 17
-f 18 9 16
-f 1 9 10
-f 1 10 2
-f 2 10 11
-f 2 11 3
-f 3 11 12
-f 3 12 4
-f 4 12 13
-f 4 13 5
-f 5 13 14
-f 5 14 6
-f 6 14 15
-f 6 15 7
-f 7 15 16
-f 7 16 8
-f 9 1 8
-f 9 8 16
-v 1.339483 5.927386 -0.000000
-v 1.425675 5.993232 0.062621
-v 1.306561 5.993232 0.101324
-v 1.232943 5.993232 -0.000000
-v 1.306561 5.993232 -0.101325
-v 1.425675 5.993232 -0.062622
-v 1.372405 6.099772 0.101324
-v 1.253291 6.099772 0.062621
-v 1.253291 6.099772 -0.062622
-v 1.372405 6.099772 -0.101325
-v 1.446023 6.099772 -0.000000
-v 1.339483 6.165618 -0.000000
-v 1.390145 5.945176 0.036808
-v 1.320132 5.945176 0.059557
-v 1.370795 5.983879 0.096366
-v 1.390145 5.945176 -0.036809
-v 1.440808 5.983879 -0.000000
-v 1.276860 5.945176 -0.000000
-v 1.257509 5.983879 0.059557
-v 1.320132 5.945176 -0.059558
-v 1.257509 5.983879 -0.059558
-v 1.370795 5.983879 -0.096367
-v 1.452769 6.046502 -0.036809
-v 1.452769 6.046502 0.036808
-v 1.409497 6.046502 0.096366
-v 1.339483 6.046502 0.119115
-v 1.269468 6.046502 0.096366
-v 1.226197 6.046502 0.036808
-v 1.226197 6.046502 -0.036809
-v 1.269468 6.046502 -0.096367
-v 1.339483 6.046502 -0.119116
-v 1.409497 6.046502 -0.096367
-v 1.421457 6.109126 0.059557
-v 1.308171 6.109126 0.096366
-v 1.238157 6.109126 -0.000000
-v 1.308171 6.109126 -0.096367
-v 1.421457 6.109126 -0.059558
-v 1.402106 6.147828 -0.000000
-v 1.358834 6.147829 0.059557
-v 1.288820 6.147829 0.036808
-v 1.288820 6.147829 -0.036809
-v 1.358834 6.147829 -0.059558
-usemtl (null)
-s off
-f 33 31 20
-f 31 33 32
-f 21 32 33
-f 32 19 31
-f 35 20 31
-f 31 34 35
-f 24 35 34
-f 31 19 34
-f 37 32 21
-f 32 37 36
-f 22 36 37
-f 36 19 32
-f 39 36 22
-f 36 39 38
-f 23 38 39
-f 38 19 36
-f 40 38 23
-f 38 40 34
-f 24 34 40
-f 34 19 38
-f 42 20 35
-f 35 41 42
-f 29 42 41
-f 41 35 24
-f 44 21 33
-f 33 43 44
-f 25 44 43
-f 43 33 20
-f 46 22 37
-f 37 45 46
-f 26 46 45
-f 45 37 21
-f 48 23 39
-f 39 47 48
-f 27 48 47
-f 47 39 22
-f 50 24 40
-f 40 49 50
-f 28 50 49
-f 49 40 23
-f 51 42 29
-f 42 51 43
-f 25 43 51
-f 43 20 42
-f 52 44 25
-f 44 52 45
-f 26 45 52
-f 45 21 44
-f 53 46 26
-f 46 53 47
-f 27 47 53
-f 47 22 46
-f 54 48 27
-f 48 54 49
-f 28 49 54
-f 49 23 48
-f 55 50 28
-f 50 55 41
-f 29 41 55
-f 41 24 50
-f 57 25 51
-f 51 56 57
-f 30 57 56
-f 56 51 29
-f 58 26 52
-f 52 57 58
-f 30 58 57
-f 57 52 25
-f 59 27 53
-f 53 58 59
-f 30 59 58
-f 58 53 26
-f 60 28 54
-f 54 59 60
-f 30 60 59
-f 59 54 27
-f 56 29 55
-f 55 60 56
-f 30 56 60
-f 60 55 28
-v 0.997706 6.704086 -0.000000
-v 0.997706 5.411325 -0.170196
-v 0.997706 5.477018 -0.328792
-v 0.997706 5.581521 -0.464982
-v 0.997706 5.717710 -0.569484
-v 0.997706 5.876307 -0.635177
-v 0.997706 6.046502 -0.657584
-v 0.997706 6.216697 -0.635177
-v 0.997706 6.375294 -0.569484
-v 0.997706 6.511484 -0.464982
-v 0.997706 6.615986 -0.328792
-v 0.997706 6.681679 -0.170196
-v 0.925269 6.681679 -0.147394
-v 0.857769 6.615986 -0.284743
-v 0.799805 6.511484 -0.402686
-v 0.755328 6.375294 -0.493188
-v 0.727369 6.216697 -0.550080
-v 0.717832 6.046502 -0.569484
-v 0.727369 5.876307 -0.550080
-v 0.755328 5.717710 -0.493188
-v 0.799805 5.581521 -0.402687
-v 0.857769 5.477018 -0.284743
-v 0.925269 5.411325 -0.147394
-v 0.872242 5.411325 -0.085098
-v 0.755328 5.477018 -0.164396
-v 0.654932 5.581521 -0.232491
-v 0.577895 5.717710 -0.284742
-v 0.529468 5.876307 -0.317589
-v 0.512951 6.046502 -0.328792
-v 0.529468 6.216697 -0.317589
-v 0.577895 6.375294 -0.284742
-v 0.654932 6.511484 -0.232491
-v 0.755328 6.615986 -0.164396
-v 0.872242 6.681679 -0.085098
-v 0.852833 6.681679 -0.000000
-v 0.717832 6.615986 -0.000000
-v 0.601905 6.511484 -0.000000
-v 0.512951 6.375294 -0.000000
-v 0.457032 6.216697 -0.000000
-v 0.437959 6.046502 -0.000000
-v 0.457032 5.876307 -0.000000
-v 0.512951 5.717710 -0.000000
-v 0.601905 5.581521 -0.000000
-v 0.717832 5.477018 -0.000000
-v 0.852832 5.411325 -0.000000
-v 0.997706 5.388918 -0.000000
-v 0.872242 5.411325 0.085097
-v 0.755328 5.477018 0.164396
-v 0.654932 5.581521 0.232491
-v 0.577896 5.717710 0.284742
-v 0.529468 5.876307 0.317588
-v 0.512951 6.046502 0.328791
-v 0.529468 6.216697 0.317588
-v 0.577896 6.375294 0.284742
-v 0.654932 6.511484 0.232490
-v 0.755328 6.615986 0.164395
-v 0.872242 6.681679 0.085097
-v 0.925269 6.681679 0.147393
-v 0.857769 6.615986 0.284742
-v 0.799805 6.511484 0.402686
-v 0.755328 6.375294 0.493187
-v 0.727369 6.216697 0.550079
-v 0.717832 6.046502 0.569484
-v 0.727369 5.876307 0.550079
-v 0.755328 5.717710 0.493187
-v 0.799805 5.581521 0.402686
-v 0.857769 5.477018 0.284742
-v 0.925269 5.411325 0.147393
-v 0.997706 5.411325 0.170195
-v 0.997706 5.477018 0.328791
-v 0.997706 5.581521 0.464981
-v 0.997706 5.717710 0.569484
-v 0.997706 5.876307 0.635176
-v 0.997706 6.046502 0.657583
-v 0.997706 6.216697 0.635176
-v 0.997706 6.375294 0.569484
-v 0.997706 6.511484 0.464981
-v 0.997706 6.615986 0.328791
-v 0.997706 6.681679 0.170195
-v 0.997942 6.621034 0.153945
-v 0.997942 6.561613 0.297399
-v 0.997942 6.467088 0.420586
-v 0.997942 6.343902 0.515110
-v 0.997942 6.200448 0.574531
-v 0.997942 6.046502 0.594798
-v 0.997942 5.892557 0.574531
-v 0.997942 5.749103 0.515110
-v 0.997942 5.625916 0.420586
-v 0.997942 5.531392 0.297399
-v 0.997942 5.471971 0.153945
-v 0.932422 5.471971 0.133320
-v 0.871366 5.531392 0.257555
-v 0.818937 5.625916 0.364238
-v 0.778706 5.749103 0.446099
-v 0.753416 5.892557 0.497558
-v 0.744790 6.046502 0.515110
-v 0.753417 6.200448 0.497558
-v 0.778706 6.343902 0.446099
-v 0.818937 6.467088 0.364238
-v 0.871366 6.561613 0.257555
-v 0.932422 6.621034 0.133320
-v 0.884457 6.621034 0.076972
-v 0.778706 6.561613 0.148699
-v 0.687896 6.467088 0.210293
-v 0.618215 6.343902 0.257555
-v 0.574411 6.200448 0.287265
-v 0.559471 6.046502 0.297399
-v 0.574411 5.892557 0.287265
-v 0.618215 5.749103 0.257555
-v 0.687896 5.625916 0.210293
-v 0.778706 5.531392 0.148699
-v 0.884457 5.471971 0.076972
-v 0.997942 5.451703 -0.000000
-v 0.866901 5.471971 -0.000000
-v 0.744790 5.531392 -0.000000
-v 0.639932 5.625916 -0.000000
-v 0.559471 5.749103 -0.000000
-v 0.508891 5.892557 -0.000000
-v 0.491639 6.046502 -0.000000
-v 0.508891 6.200448 -0.000000
-v 0.559471 6.343902 -0.000000
-v 0.639932 6.467088 -0.000000
-v 0.744790 6.561613 -0.000000
-v 0.866901 6.621034 -0.000000
-v 0.884457 6.621034 -0.076973
-v 0.778706 6.561613 -0.148700
-v 0.687896 6.467088 -0.210294
-v 0.618215 6.343902 -0.257556
-v 0.574411 6.200448 -0.287266
-v 0.559471 6.046502 -0.297400
-v 0.574411 5.892557 -0.287266
-v 0.618215 5.749103 -0.257556
-v 0.687896 5.625916 -0.210294
-v 0.778706 5.531392 -0.148700
-v 0.884457 5.471971 -0.076973
-v 0.932422 5.471971 -0.133321
-v 0.871366 5.531392 -0.257556
-v 0.818937 5.625916 -0.364239
-v 0.778706 5.749103 -0.446099
-v 0.753416 5.892557 -0.497559
-v 0.744790 6.046502 -0.515111
-v 0.753416 6.200448 -0.497559
-v 0.778706 6.343902 -0.446099
-v 0.818937 6.467088 -0.364239
-v 0.871366 6.561613 -0.257556
-v 0.932422 6.621034 -0.133321
-v 0.997942 6.621034 -0.153946
-v 0.997942 6.561613 -0.297400
-v 0.997942 6.467088 -0.420587
-v 0.997942 6.343902 -0.515111
-v 0.997942 6.200448 -0.574532
-v 0.997942 6.046502 -0.594799
-v 0.997942 5.892557 -0.574532
-v 0.997942 5.749103 -0.515111
-v 0.997942 5.625916 -0.420587
-v 0.997942 5.531392 -0.297400
-v 0.997942 5.471971 -0.153946
-v 0.997942 6.641301 -0.000000
-usemtl (null)
-s off
-f 73 61 72
-f 71 74 73
-f 71 73 72
-f 70 75 74
-f 70 74 71
-f 69 76 75
-f 69 75 70
-f 68 77 76
-f 68 76 69
-f 67 78 77
-f 67 77 68
-f 66 79 78
-f 66 78 67
-f 65 80 79
-f 65 79 66
-f 64 81 80
-f 64 80 65
-f 63 82 81
-f 63 81 64
-f 62 83 82
-f 62 82 63
-f 106 83 62
-f 106 84 83
-f 83 84 85
-f 83 85 82
-f 82 85 86
-f 82 86 81
-f 81 86 87
-f 81 87 80
-f 80 87 88
-f 80 88 79
-f 79 88 89
-f 79 89 78
-f 78 89 90
-f 78 90 77
-f 77 90 91
-f 77 91 76
-f 76 91 92
-f 76 92 75
-f 75 92 93
-f 75 93 74
-f 74 93 94
-f 74 94 73
-f 94 61 73
-f 95 61 94
-f 93 96 95
-f 93 95 94
-f 92 97 96
-f 92 96 93
-f 91 98 97
-f 91 97 92
-f 90 99 98
-f 90 98 91
-f 89 100 99
-f 89 99 90
-f 88 101 100
-f 88 100 89
-f 87 102 101
-f 87 101 88
-f 86 103 102
-f 86 102 87
-f 85 104 103
-f 85 103 86
-f 84 105 104
-f 84 104 85
-f 106 105 84
-f 106 107 105
-f 105 107 108
-f 105 108 104
-f 104 108 109
-f 104 109 103
-f 103 109 110
-f 103 110 102
-f 102 110 111
-f 102 111 101
-f 101 111 112
-f 101 112 100
-f 100 112 113
-f 100 113 99
-f 99 113 114
-f 99 114 98
-f 98 114 115
-f 98 115 97
-f 97 115 116
-f 97 116 96
-f 96 116 117
-f 96 117 95
-f 117 61 95
-f 118 61 117
-f 116 119 118
-f 116 118 117
-f 115 120 119
-f 115 119 116
-f 114 121 120
-f 114 120 115
-f 113 122 121
-f 113 121 114
-f 112 123 122
-f 112 122 113
-f 111 124 123
-f 111 123 112
-f 110 125 124
-f 110 124 111
-f 109 126 125
-f 109 125 110
-f 108 127 126
-f 108 126 109
-f 107 128 127
-f 107 127 108
-f 106 128 107
-f 106 129 128
-f 128 129 130
-f 128 130 127
-f 127 130 131
-f 127 131 126
-f 126 131 132
-f 126 132 125
-f 125 132 133
-f 125 133 124
-f 124 133 134
-f 124 134 123
-f 123 134 135
-f 123 135 122
-f 122 135 136
-f 122 136 121
-f 121 136 137
-f 121 137 120
-f 120 137 138
-f 120 138 119
-f 119 138 139
-f 119 139 118
-f 139 61 118
-f 161 140 218
-f 160 141 140
-f 160 140 161
-f 159 142 141
-f 159 141 160
-f 158 143 142
-f 158 142 159
-f 157 144 143
-f 157 143 158
-f 156 145 144
-f 156 144 157
-f 155 146 145
-f 155 145 156
-f 154 147 146
-f 154 146 155
-f 153 148 147
-f 153 147 154
-f 152 149 148
-f 152 148 153
-f 151 150 149
-f 151 149 152
-f 173 150 151
-f 173 151 172
-f 172 151 152
-f 172 152 171
-f 171 152 153
-f 171 153 170
-f 170 153 154
-f 170 154 169
-f 169 154 155
-f 169 155 168
-f 168 155 156
-f 168 156 167
-f 167 156 157
-f 167 157 166
-f 166 157 158
-f 166 158 165
-f 165 158 159
-f 165 159 164
-f 164 159 160
-f 164 160 163
-f 163 160 161
-f 163 161 162
-f 162 161 218
-f 184 162 218
-f 183 163 162
-f 183 162 184
-f 182 164 163
-f 182 163 183
-f 181 165 164
-f 181 164 182
-f 180 166 165
-f 180 165 181
-f 179 167 166
-f 179 166 180
-f 178 168 167
-f 178 167 179
-f 177 169 168
-f 177 168 178
-f 176 170 169
-f 176 169 177
-f 175 171 170
-f 175 170 176
-f 174 172 171
-f 174 171 175
-f 173 172 174
-f 173 174 195
-f 195 174 175
-f 195 175 194
-f 194 175 176
-f 194 176 193
-f 193 176 177
-f 193 177 192
-f 192 177 178
-f 192 178 191
-f 191 178 179
-f 191 179 190
-f 190 179 180
-f 190 180 189
-f 189 180 181
-f 189 181 188
-f 188 181 182
-f 188 182 187
-f 187 182 183
-f 187 183 186
-f 186 183 184
-f 186 184 185
-f 185 184 218
-f 206 185 218
-f 205 186 185
-f 205 185 206
-f 204 187 186
-f 204 186 205
-f 203 188 187
-f 203 187 204
-f 202 189 188
-f 202 188 203
-f 201 190 189
-f 201 189 202
-f 200 191 190
-f 200 190 201
-f 199 192 191
-f 199 191 200
-f 198 193 192
-f 198 192 199
-f 197 194 193
-f 197 193 198
-f 196 195 194
-f 196 194 197
-f 173 195 196
-f 173 196 217
-f 217 196 197
-f 217 197 216
-f 216 197 198
-f 216 198 215
-f 215 198 199
-f 215 199 214
-f 214 199 200
-f 214 200 213
-f 213 200 201
-f 213 201 212
-f 212 201 202
-f 212 202 211
-f 211 202 203
-f 211 203 210
-f 210 203 204
-f 210 204 209
-f 209 204 205
-f 209 205 208
-f 208 205 206
-f 208 206 207
-f 207 206 218
-f 64 65 214
-f 64 214 215
-f 65 66 213
-f 65 213 214
-f 66 67 212
-f 66 212 213
-f 67 68 211
-f 67 211 212
-f 68 69 210
-f 68 210 211
-f 69 70 209
-f 69 209 210
-f 70 71 208
-f 70 208 209
-f 71 72 207
-f 71 207 208
-f 61 218 207
-f 61 207 72
-f 61 139 140
-f 61 140 218
-f 138 141 140
-f 138 140 139
-f 137 142 141
-f 137 141 138
-f 136 143 142
-f 136 142 137
-f 135 144 143
-f 135 143 136
-f 134 145 144
-f 134 144 135
-f 133 146 145
-f 133 145 134
-f 132 147 146
-f 132 146 133
-f 131 148 147
-f 131 147 132
-f 130 149 148
-f 130 148 131
-f 129 150 149
-f 129 149 130
-f 106 173 150
-f 106 150 129
-f 62 217 173
-f 62 173 106
-f 62 63 216
-f 62 216 217
-f 63 64 215
-f 63 215 216
-v 0.803657 3.845104 -0.200341
-v 0.803657 3.845104 0.200341
-v 0.402975 3.845104 0.200341
-v 0.402975 3.845104 -0.200341
-v 0.603316 5.811587 -0.000000
-v 0.603316 3.845104 -0.000000
-usemtl (null)
-s off
-f 220 219 223
-f 223 221 220
-f 223 222 221
-f 223 219 222
-f 224 219 220
-f 224 220 221
-f 224 221 222
-f 222 219 224
-v 1.414214 -0.000000 -1.414214
-v 2.000000 0.000000 0.000000
-v 2.000000 0.000000 0.000000
-v 2.000000 0.000000 0.000000
-v 1.414214 0.000000 1.414214
-v 1.414214 0.000000 1.414214
-v 1.414214 0.000000 1.414214
-v -0.000000 0.000000 2.000000
-v -0.000000 0.000000 2.000000
-v -0.000000 0.000000 2.000000
-v -1.414214 0.000000 1.414213
-v -1.414214 0.000000 1.414213
-v -1.414214 0.000000 1.414213
-v -2.000000 -0.000000 -0.000000
-v -2.000000 -0.000000 -0.000000
-v -2.000000 -0.000000 -0.000000
-v -1.414214 -0.000000 -1.414213
-v -1.414214 -0.000000 -1.414213
-v -1.414214 -0.000000 -1.414213
-v -0.000001 -0.000000 -2.000000
-v -0.000001 -0.000000 -2.000000
-v -0.000001 -0.000000 -2.000000
-v -0.765367 1.483010 -1.847759
-v -0.765367 1.483010 -1.847759
-v -0.765367 1.483010 -1.847759
-v -1.847759 1.483010 -0.765366
-v -1.847759 1.483010 -0.765366
-v -1.847759 1.483010 -0.765366
-v -1.847759 1.483010 0.765367
-v -1.847759 1.483010 0.765367
-v -1.847759 1.483010 0.765367
-v -0.765367 1.483010 1.847759
-v -0.765367 1.483010 1.847759
-v -0.765367 1.483010 1.847759
-v 0.765367 1.483010 1.847759
-v 0.765367 1.483010 1.847759
-v 0.765367 1.483010 1.847759
-v 1.847759 1.483010 0.765367
-v 1.847759 1.483010 0.765367
-v 1.847759 1.483010 0.765367
-v 1.847759 1.483010 -0.765367
-v 1.847759 1.483010 -0.765367
-v 1.847759 1.483010 -0.765367
-v 0.765367 1.483010 -1.847759
-v 0.765367 1.483010 -1.847759
-v -0.000000 1.483010 -0.000000
-v -0.000000 1.483010 -0.000000
-v -0.000000 -0.000000 -0.000000
-v -0.000000 -0.000000 -0.000000
-v 0.039342 -0.614886 -2.708646
-v 0.039342 -0.614886 -2.708646
-v 0.039342 -0.614886 -2.708646
-v 0.039342 -0.614886 -2.708646
-v 0.053987 -0.619693 -2.655628
-v 0.053987 -0.619693 -2.655628
-v 0.053987 -0.619693 -2.655628
-v 0.053987 -0.619693 -2.655628
-v 0.039342 -0.624500 -2.602610
-v 0.039342 -0.624500 -2.602610
-v 0.039342 -0.624500 -2.602610
-v 0.039342 -0.624500 -2.602610
-v 0.003987 -0.626491 -2.580649
-v 0.003987 -0.626491 -2.580649
-v 0.003987 -0.626491 -2.580649
-v 0.003987 -0.626491 -2.580649
-v -0.031368 -0.624500 -2.602610
-v -0.031368 -0.624500 -2.602610
-v -0.031368 -0.624500 -2.602610
-v -0.031368 -0.624500 -2.602610
-v -0.046013 -0.619693 -2.655628
-v -0.046013 -0.619693 -2.655628
-v -0.046013 -0.619693 -2.655628
-v -0.046013 -0.619693 -2.655628
-v -0.031368 -0.614886 -2.708646
-v -0.031368 -0.614886 -2.708646
-v -0.031368 -0.614886 -2.708646
-v -0.031368 -0.614886 -2.708646
-v 0.003987 -0.612895 -2.730607
-v 0.003987 -0.612895 -2.730607
-v 0.003987 -0.612895 -2.730607
-v 0.003987 -0.612895 -2.730607
-v 0.039342 1.206135 -1.869200
-v 0.039342 1.206135 -1.869200
-v 0.053987 1.182634 -1.816778
-v 0.053987 1.182634 -1.816778
-v 0.039342 1.159133 -1.764356
-v 0.039342 1.159133 -1.764356
-v 0.003987 1.149398 -1.742642
-v 0.003987 1.149398 -1.742642
-v -0.031368 1.159133 -1.764356
-v -0.031368 1.159133 -1.764356
-v -0.046013 1.182634 -1.816778
-v -0.046013 1.182634 -1.816778
-v -0.031368 1.206136 -1.869200
-v -0.031368 1.206136 -1.869200
-v 0.003987 1.215870 -1.890914
-v 0.003987 1.215870 -1.890914
-v 0.003987 -0.619693 -2.655628
-v 0.003987 1.182634 -1.816778
-v 1.815641 1.182634 -0.004957
-v 2.654491 -0.619693 -0.005292
-v 1.889777 1.215870 -0.004986
-v 1.889777 1.215870 -0.004986
-v 1.868049 1.206136 -0.040333
-v 1.868049 1.206136 -0.040333
-v 1.815621 1.182634 -0.054957
-v 1.815621 1.182634 -0.054957
-v 1.763205 1.159133 -0.040291
-v 1.763205 1.159133 -0.040291
-v 1.741505 1.149398 -0.004927
-v 1.741505 1.149398 -0.004927
-v 1.763234 1.159133 0.030420
-v 1.763234 1.159133 0.030420
-v 1.815661 1.182634 0.045043
-v 1.815661 1.182634 0.045043
-v 1.868077 1.206136 0.030378
-v 1.868077 1.206136 0.030378
-v 2.729470 -0.612894 -0.005322
-v 2.729470 -0.612894 -0.005322
-v 2.729470 -0.612894 -0.005322
-v 2.729470 -0.612894 -0.005322
-v 2.707495 -0.614886 -0.040669
-v 2.707495 -0.614886 -0.040669
-v 2.707495 -0.614886 -0.040669
-v 2.707495 -0.614886 -0.040669
-v 2.654471 -0.619693 -0.055292
-v 2.654471 -0.619693 -0.055292
-v 2.654471 -0.619693 -0.055292
-v 2.654471 -0.619693 -0.055292
-v 2.601459 -0.624500 -0.040626
-v 2.601459 -0.624500 -0.040626
-v 2.601459 -0.624500 -0.040626
-v 2.601459 -0.624500 -0.040626
-v 2.579512 -0.626491 -0.005262
-v 2.579512 -0.626491 -0.005262
-v 2.579512 -0.626491 -0.005262
-v 2.579512 -0.626491 -0.005262
-v 2.601487 -0.624500 0.030084
-v 2.601487 -0.624500 0.030084
-v 2.601487 -0.624500 0.030084
-v 2.601487 -0.624500 0.030084
-v 2.654511 -0.619693 0.044708
-v 2.654511 -0.619693 0.044708
-v 2.654511 -0.619693 0.044708
-v 2.654511 -0.619693 0.044708
-v 2.707523 -0.614886 0.030042
-v 2.707523 -0.614886 0.030042
-v 2.707523 -0.614886 0.030042
-v 2.707523 -0.614886 0.030042
-v -0.048773 -0.614886 2.724306
-v -0.048773 -0.614886 2.724306
-v -0.048773 -0.614886 2.724306
-v -0.048773 -0.614886 2.724306
-v -0.062936 -0.619693 2.671157
-v -0.062936 -0.619693 2.671157
-v -0.062936 -0.619693 2.671157
-v -0.062936 -0.619693 2.671157
-v -0.047811 -0.624500 2.618274
-v -0.047811 -0.624500 2.618274
-v -0.047811 -0.624500 2.618274
-v -0.047811 -0.624500 2.618274
-v -0.012258 -0.626491 2.596635
-v -0.012258 -0.626491 2.596635
-v -0.012258 -0.626491 2.596635
-v -0.012258 -0.626491 2.596635
-v 0.022896 -0.624500 2.618915
-v 0.022896 -0.624500 2.618915
-v 0.022896 -0.624500 2.618915
-v 0.022896 -0.624500 2.618915
-v 0.037060 -0.619693 2.672064
-v 0.037060 -0.619693 2.672064
-v 0.037060 -0.619693 2.672064
-v 0.037060 -0.619693 2.672064
-v 0.021935 -0.614886 2.724946
-v 0.021935 -0.614886 2.724946
-v 0.021935 -0.614886 2.724946
-v 0.021935 -0.614886 2.724946
-v -0.013618 -0.612894 2.746586
-v -0.013618 -0.612894 2.746586
-v -0.013618 -0.612894 2.746586
-v -0.013618 -0.612894 2.746586
-v -0.041163 1.206136 1.884894
-v -0.041163 1.206136 1.884894
-v -0.055332 1.182634 1.832342
-v -0.055332 1.182634 1.832342
-v -0.040213 1.159133 1.780055
-v -0.040213 1.159133 1.780055
-v -0.004662 1.149398 1.758662
-v -0.004662 1.149398 1.758662
-v 0.030495 1.159133 1.780696
-v 0.030495 1.159133 1.780696
-v 0.044664 1.182634 1.833248
-v 0.044664 1.182634 1.833248
-v 0.029545 1.206136 1.885535
-v 0.029545 1.206136 1.885535
-v -0.006006 1.215870 1.906928
-v -0.006006 1.215870 1.906928
-v -0.012938 -0.619693 2.671610
-v -0.005334 1.182634 1.832795
-v -1.820801 1.182634 -0.021234
-v -2.659629 -0.619693 -0.015261
-v -1.894934 1.215870 -0.020707
-v -1.894934 1.215870 -0.020707
-v -1.872969 1.206136 0.014493
-v -1.872969 1.206136 0.014493
-v -1.820445 1.182634 0.028764
-v -1.820445 1.182634 0.028764
-v -1.768129 1.159133 0.013747
-v -1.768129 1.159133 0.013747
-v -1.746666 1.149398 -0.021762
-v -1.746666 1.149398 -0.021762
-v -1.768632 1.159133 -0.056962
-v -1.768632 1.159133 -0.056962
-v -1.821157 1.182634 -0.071233
-v -1.821157 1.182634 -0.071233
-v -1.873473 1.206136 -0.056216
-v -1.873473 1.206136 -0.056216
-v -2.734606 -0.612894 -0.014728
-v -2.734606 -0.612894 -0.014728
-v -2.734606 -0.612894 -0.014728
-v -2.734606 -0.612894 -0.014728
-v -2.712394 -0.614886 0.020471
-v -2.712394 -0.614886 0.020471
-v -2.712394 -0.614886 0.020471
-v -2.712394 -0.614886 0.020471
-v -2.659273 -0.619693 0.034737
-v -2.659273 -0.619693 0.034737
-v -2.659273 -0.619693 0.034737
-v -2.659273 -0.619693 0.034737
-v -2.606360 -0.624500 0.019715
-v -2.606360 -0.624500 0.019715
-v -2.606360 -0.624500 0.019715
-v -2.606360 -0.624500 0.019715
-v -2.584652 -0.626491 -0.015795
-v -2.584652 -0.626491 -0.015795
-v -2.584652 -0.626491 -0.015795
-v -2.584652 -0.626491 -0.015795
-v -2.606864 -0.624500 -0.050993
-v -2.606864 -0.624500 -0.050993
-v -2.606864 -0.624500 -0.050993
-v -2.606864 -0.624500 -0.050993
-v -2.659985 -0.619693 -0.065260
-v -2.659985 -0.619693 -0.065260
-v -2.659985 -0.619693 -0.065260
-v -2.659985 -0.619693 -0.065260
-v -2.712898 -0.614886 -0.050238
-v -2.712898 -0.614886 -0.050238
-v -2.712898 -0.614886 -0.050238
-v -2.712898 -0.614886 -0.050238
-vt 0.000000 0.000000
-vt 1.000000 1.000000
-vt 1.000000 0.000000
-vt 0.000000 1.000000
-usemtl Nonerusty.pn
-s off
-f 229/1 259/2 232/3
-f 233/1 259/2 256/3
-f 233/1 257/2 235/3
-f 236/1 257/2 253/3
-f 236/1 254/2 238/3
-f 239/1 254/2 250/3
-f 239/1 251/2 241/3
-f 242/1 251/2 247/3
-f 242/1 248/2 244/3
-f 245/1 248/2 268/3
-f 225/1 246/2 268/3
-f 225/1 269/2 265/3
-f 225/1 266/2 226/3
-f 227/1 266/2 262/3
-f 227/1 263/2 230/3
-f 229/1 263/2 260/3
-f 258/1 259/2 270/3
-f 261/1 263/2 270/3
-f 264/1 266/2 270/3
-f 267/1 269/2 270/3
-f 249/1 271/2 268/3
-f 249/1 251/2 270/3
-f 252/1 254/2 270/3
-f 255/1 257/2 270/3
-f 236/1 240/2 272/3
-f 239/1 243/2 272/3
-f 242/1 246/2 272/3
-f 225/1 273/2 244/3
-f 225/1 228/2 272/3
-f 227/1 231/2 272/3
-f 229/1 234/2 272/3
-f 233/1 237/2 272/3
-f 322/1 274/3 278/2
-f 323/1 308/3 306/2
-f 322/1 279/3 282/2
-f 323/1 310/3 309/2
-f 322/1 283/3 286/2
-f 323/1 312/3 311/2
-f 322/1 287/3 290/2
-f 323/1 314/3 313/2
-f 322/1 291/3 294/2
-f 323/1 316/3 315/2
-f 322/1 295/3 298/2
-f 323/1 318/3 317/2
-f 322/1 299/3 302/2
-f 323/1 320/3 319/2
-f 322/1 303/3 275/2
-f 323/1 307/3 321/2
-f 276/1 307/3 309/2
-f 276/1 309/2 280/4
-f 281/1 308/3 311/2
-f 281/1 311/2 284/4
-f 285/1 310/3 313/2
-f 285/1 313/2 288/4
-f 289/1 312/3 315/2
-f 289/1 315/2 292/4
-f 293/1 314/3 317/2
-f 293/1 317/2 296/4
-f 297/1 316/3 319/2
-f 297/1 319/2 300/4
-f 301/1 318/3 321/2
-f 301/1 321/2 304/4
-f 305/1 320/3 306/2
-f 305/1 306/2 277/4
-f 342/1 326/3 340/2
-f 342/1 340/2 370/4
-f 346/1 328/3 327/2
-f 346/1 327/2 343/4
-f 350/1 330/3 329/2
-f 350/1 329/2 347/4
-f 354/1 332/3 331/2
-f 354/1 331/2 351/4
-f 358/1 334/3 333/2
-f 358/1 333/2 355/4
-f 362/1 336/3 335/2
-f 362/1 335/2 359/4
-f 366/1 338/3 337/2
-f 366/1 337/2 363/4
-f 371/1 341/3 339/2
-f 371/1 339/2 367/4
-f 324/1 341/3 327/2
-f 325/1 344/3 372/2
-f 324/1 326/3 329/2
-f 325/1 348/3 345/2
-f 324/1 328/3 331/2
-f 325/1 352/3 349/2
-f 324/1 330/3 333/2
-f 325/1 356/3 353/2
-f 324/1 332/3 335/2
-f 325/1 360/3 357/2
-f 324/1 334/3 337/2
-f 325/1 364/3 361/2
-f 324/1 336/3 339/2
-f 325/1 368/3 365/2
-f 324/1 338/3 340/2
-f 325/1 373/3 369/2
-f 422/1 374/3 378/2
-f 423/1 408/3 406/2
-f 422/1 379/3 382/2
-f 423/1 410/3 409/2
-f 422/1 383/3 386/2
-f 423/1 412/3 411/2
-f 422/1 387/3 390/2
-f 423/1 414/3 413/2
-f 422/1 391/3 394/2
-f 423/1 416/3 415/2
-f 422/1 395/3 398/2
-f 423/1 418/3 417/2
-f 422/1 399/3 402/2
-f 423/1 420/3 419/2
-f 422/1 403/3 375/2
-f 423/1 407/3 421/2
-f 376/1 407/3 409/2
-f 376/1 409/2 380/4
-f 381/1 408/3 411/2
-f 381/1 411/2 384/4
-f 385/1 410/3 413/2
-f 385/1 413/2 388/4
-f 389/1 412/3 415/2
-f 389/1 415/2 392/4
-f 393/1 414/3 417/2
-f 393/1 417/2 396/4
-f 397/1 416/3 419/2
-f 397/1 419/2 400/4
-f 401/1 418/3 421/2
-f 401/1 421/2 404/4
-f 405/1 420/3 406/2
-f 405/1 406/2 377/4
-f 442/1 426/3 440/2
-f 442/1 440/2 470/4
-f 446/1 428/3 427/2
-f 446/1 427/2 443/4
-f 450/1 430/3 429/2
-f 450/1 429/2 447/4
-f 454/1 432/3 431/2
-f 454/1 431/2 451/4
-f 458/1 434/3 433/2
-f 458/1 433/2 455/4
-f 462/1 436/3 435/2
-f 462/1 435/2 459/4
-f 466/1 438/3 437/2
-f 466/1 437/2 463/4
-f 471/1 441/3 439/2
-f 471/1 439/2 467/4
-f 424/1 441/3 427/2
-f 425/1 444/3 472/2
-f 424/1 426/3 429/2
-f 425/1 448/3 445/2
-f 424/1 428/3 431/2
-f 425/1 452/3 449/2
-f 424/1 430/3 433/2
-f 425/1 456/3 453/2
-f 424/1 432/3 435/2
-f 425/1 460/3 457/2
-f 424/1 434/3 437/2
-f 425/1 464/3 461/2
-f 424/1 436/3 439/2
-f 425/1 468/3 465/2
-f 424/1 438/3 440/2
-f 425/1 473/3 469/2
-v 0.353553 -0.651305 -3.028615
-v 0.353553 -0.651305 -3.028615
-v 0.500000 -0.651305 -2.675062
-v 0.500000 -0.651305 -2.675062
-v 0.500000 -0.651305 -2.675062
-v 0.500000 -0.651305 -2.675062
-v 0.353553 -0.651305 -2.321509
-v 0.353553 -0.651305 -2.321509
-v 0.353553 -0.651305 -2.321509
-v 0.353553 -0.651305 -2.321509
-v -0.000000 -0.651305 -2.175062
-v -0.000000 -0.651305 -2.175062
-v -0.000000 -0.651305 -2.175062
-v -0.000000 -0.651305 -2.175062
-v -0.353553 -0.651305 -2.321509
-v -0.353553 -0.651305 -2.321509
-v -0.353553 -0.651305 -2.321509
-v -0.353553 -0.651305 -2.321509
-v -0.500000 -0.651305 -2.675062
-v -0.500000 -0.651305 -2.675062
-v -0.500000 -0.651305 -2.675062
-v -0.500000 -0.651305 -2.675062
-v -0.353553 -0.651305 -3.028615
-v -0.353553 -0.651305 -3.028615
-v -0.353553 -0.651305 -3.028615
-v -0.353553 -0.651305 -3.028615
-v -0.000000 -0.651305 -3.175062
-v -0.000000 -0.651305 -3.175062
-v -0.000000 -0.651305 -3.175062
-v 0.353553 -0.591305 -3.028615
-v 0.353553 -0.591305 -3.028615
-v 0.353553 -0.591305 -3.028615
-v 0.500000 -0.591305 -2.675062
-v 0.500000 -0.591305 -2.675062
-v 0.353554 -0.591305 -2.321509
-v 0.353554 -0.591305 -2.321509
-v -0.000000 -0.591305 -2.175062
-v -0.000000 -0.591305 -2.175062
-v -0.353554 -0.591305 -2.321509
-v -0.353554 -0.591305 -2.321509
-v -0.500000 -0.591305 -2.675062
-v -0.500000 -0.591305 -2.675062
-v -0.353553 -0.591305 -3.028616
-v -0.353553 -0.591305 -3.028616
-v 0.000001 -0.591305 -3.175062
-v 0.000001 -0.591305 -3.175062
-v 0.000001 -0.591305 -3.175062
-v 0.000000 -0.651305 -2.675062
-v 0.000000 -0.651305 -2.675062
-v 0.000000 -0.591305 -2.675062
-vt 0.000000 0.000000
-vt 1.000000 0.000000
-vt 1.000000 1.000000
-vt 0.000000 1.000000
-usemtl Nonerusty.pn
-s off
-f 521/5 474/6 476/7
-f 523/5 506/6 503/7
-f 521/5 477/6 480/7
-f 523/5 508/6 507/7
-f 521/5 481/6 484/7
-f 523/5 510/6 509/7
-f 521/5 485/6 488/7
-f 523/5 512/6 511/7
-f 521/5 489/6 492/7
-f 523/5 514/6 513/7
-f 521/5 493/6 496/7
-f 523/5 516/6 515/7
-f 521/5 497/6 500/7
-f 523/5 518/6 517/7
-f 501/5 474/6 522/7
-f 523/5 504/6 519/7
-f 475/5 504/6 507/7
-f 475/5 507/7 478/8
-f 479/5 506/6 509/7
-f 479/5 509/7 482/8
-f 483/5 508/6 511/7
-f 483/5 511/7 486/8
-f 487/5 510/6 513/7
-f 487/5 513/7 490/8
-f 491/5 512/6 515/7
-f 491/5 515/7 494/8
-f 495/5 514/6 517/7
-f 495/5 517/7 498/8
-f 499/5 516/6 519/7
-f 499/5 519/7 502/8
-f 505/5 474/6 500/7
-f 505/5 500/7 520/8
-v -2.330138 -0.651305 -0.353553
-v -2.330138 -0.651305 -0.353553
-v -2.183692 -0.651305 0.000000
-v -2.183692 -0.651305 0.000000
-v -2.183692 -0.651305 0.000000
-v -2.183692 -0.651305 0.000000
-v -2.330138 -0.651305 0.353553
-v -2.330138 -0.651305 0.353553
-v -2.330138 -0.651305 0.353553
-v -2.330138 -0.651305 0.353553
-v -2.683692 -0.651305 0.500000
-v -2.683692 -0.651305 0.500000
-v -2.683692 -0.651305 0.500000
-v -2.683692 -0.651305 0.500000
-v -3.037245 -0.651305 0.353553
-v -3.037245 -0.651305 0.353553
-v -3.037245 -0.651305 0.353553
-v -3.037245 -0.651305 0.353553
-v -3.183692 -0.651305 0.000000
-v -3.183692 -0.651305 0.000000
-v -3.183692 -0.651305 0.000000
-v -3.183692 -0.651305 0.000000
-v -3.037245 -0.651305 -0.353553
-v -3.037245 -0.651305 -0.353553
-v -3.037245 -0.651305 -0.353553
-v -3.037245 -0.651305 -0.353553
-v -2.683692 -0.651305 -0.500000
-v -2.683692 -0.651305 -0.500000
-v -2.683692 -0.651305 -0.500000
-v -2.330138 -0.591305 -0.353554
-v -2.330138 -0.591305 -0.353554
-v -2.330138 -0.591305 -0.353554
-v -2.183692 -0.591305 -0.000000
-v -2.183692 -0.591305 -0.000000
-v -2.330138 -0.591305 0.353553
-v -2.330138 -0.591305 0.353553
-v -2.683692 -0.591305 0.500000
-v -2.683692 -0.591305 0.500000
-v -3.037245 -0.591305 0.353553
-v -3.037245 -0.591305 0.353553
-v -3.183692 -0.591305 -0.000000
-v -3.183692 -0.591305 -0.000000
-v -3.037245 -0.591305 -0.353554
-v -3.037245 -0.591305 -0.353554
-v -2.683691 -0.591305 -0.500000
-v -2.683691 -0.591305 -0.500000
-v -2.683691 -0.591305 -0.500000
-v -2.683692 -0.651305 0.000000
-v -2.683692 -0.651305 0.000000
-v -2.683692 -0.591305 0.000000
-vt 0.000000 0.000000
-vt 1.000000 0.000000
-vt 1.000000 1.000000
-vt 0.000000 1.000000
-usemtl Nonerusty.pn
-s off
-f 571/9 524/10 526/11
-f 573/9 556/10 553/11
-f 571/9 527/10 530/11
-f 573/9 558/10 557/11
-f 571/9 531/10 534/11
-f 573/9 560/10 559/11
-f 571/9 535/10 538/11
-f 573/9 562/10 561/11
-f 571/9 539/10 542/11
-f 573/9 564/10 563/11
-f 571/9 543/10 546/11
-f 573/9 566/10 565/11
-f 571/9 547/10 550/11
-f 573/9 568/10 567/11
-f 551/9 524/10 572/11
-f 573/9 554/10 569/11
-f 525/9 554/10 557/11
-f 525/9 557/11 528/12
-f 529/9 556/10 559/11
-f 529/9 559/11 532/12
-f 533/9 558/10 561/11
-f 533/9 561/11 536/12
-f 537/9 560/10 563/11
-f 537/9 563/11 540/12
-f 541/9 562/10 565/11
-f 541/9 565/11 544/12
-f 545/9 564/10 567/11
-f 545/9 567/11 548/12
-f 549/9 566/10 569/11
-f 549/9 569/11 552/12
-f 555/9 524/10 550/11
-f 555/9 550/11 570/12
-v 3.028616 -0.651305 -0.353553
-v 3.028616 -0.651305 -0.353553
-v 3.175062 -0.651305 0.000000
-v 3.175062 -0.651305 0.000000
-v 3.175062 -0.651305 0.000000
-v 3.175062 -0.651305 0.000000
-v 3.028616 -0.651305 0.353553
-v 3.028616 -0.651305 0.353553
-v 3.028616 -0.651305 0.353553
-v 3.028616 -0.651305 0.353553
-v 2.675062 -0.651305 0.500000
-v 2.675062 -0.651305 0.500000
-v 2.675062 -0.651305 0.500000
-v 2.675062 -0.651305 0.500000
-v 2.321509 -0.651305 0.353553
-v 2.321509 -0.651305 0.353553
-v 2.321509 -0.651305 0.353553
-v 2.321509 -0.651305 0.353553
-v 2.175062 -0.651305 0.000000
-v 2.175062 -0.651305 0.000000
-v 2.175062 -0.651305 0.000000
-v 2.175062 -0.651305 0.000000
-v 2.321509 -0.651305 -0.353553
-v 2.321509 -0.651305 -0.353553
-v 2.321509 -0.651305 -0.353553
-v 2.321509 -0.651305 -0.353553
-v 2.675062 -0.651305 -0.500000
-v 2.675062 -0.651305 -0.500000
-v 2.675062 -0.651305 -0.500000
-v 3.028616 -0.591305 -0.353554
-v 3.028616 -0.591305 -0.353554
-v 3.028616 -0.591305 -0.353554
-v 3.175062 -0.591305 -0.000000
-v 3.175062 -0.591305 -0.000000
-v 3.028616 -0.591305 0.353553
-v 3.028616 -0.591305 0.353553
-v 2.675062 -0.591305 0.500000
-v 2.675062 -0.591305 0.500000
-v 2.321509 -0.591305 0.353553
-v 2.321509 -0.591305 0.353553
-v 2.175062 -0.591305 -0.000000
-v 2.175062 -0.591305 -0.000000
-v 2.321509 -0.591305 -0.353554
-v 2.321509 -0.591305 -0.353554
-v 2.675063 -0.591305 -0.500000
-v 2.675063 -0.591305 -0.500000
-v 2.675063 -0.591305 -0.500000
-v 2.675062 -0.651305 0.000000
-v 2.675062 -0.651305 0.000000
-v 2.675062 -0.591305 0.000000
-vt 0.000000 0.000000
-vt 1.000000 0.000000
-vt 1.000000 1.000000
-vt 0.000000 1.000000
-usemtl Nonerusty.pn
-s off
-f 621/13 574/14 576/15
-f 623/13 606/14 603/15
-f 621/13 577/14 580/15
-f 623/13 608/14 607/15
-f 621/13 581/14 584/15
-f 623/13 610/14 609/15
-f 621/13 585/14 588/15
-f 623/13 612/14 611/15
-f 621/13 589/14 592/15
-f 623/13 614/14 613/15
-f 621/13 593/14 596/15
-f 623/13 616/14 615/15
-f 621/13 597/14 600/15
-f 623/13 618/14 617/15
-f 601/13 574/14 622/15
-f 623/13 604/14 619/15
-f 575/13 604/14 607/15
-f 575/13 607/15 578/16
-f 579/13 606/14 609/15
-f 579/13 609/15 582/16
-f 583/13 608/14 611/15
-f 583/13 611/15 586/16
-f 587/13 610/14 613/15
-f 587/13 613/15 590/16
-f 591/13 612/14 615/15
-f 591/13 615/15 594/16
-f 595/13 614/14 617/15
-f 595/13 617/15 598/16
-f 599/13 616/14 619/15
-f 599/13 619/15 602/16
-f 605/13 574/14 600/15
-f 605/13 600/15 620/16
-v 0.353553 -0.651305 2.330138
-v 0.353553 -0.651305 2.330138
-v 0.500000 -0.651305 2.683691
-v 0.500000 -0.651305 2.683691
-v 0.500000 -0.651305 2.683691
-v 0.500000 -0.651305 2.683691
-v 0.353553 -0.651305 3.037245
-v 0.353553 -0.651305 3.037245
-v 0.353553 -0.651305 3.037245
-v 0.353553 -0.651305 3.037245
-v -0.000000 -0.651305 3.183691
-v -0.000000 -0.651305 3.183691
-v -0.000000 -0.651305 3.183691
-v -0.000000 -0.651305 3.183691
-v -0.353553 -0.651305 3.037245
-v -0.353553 -0.651305 3.037245
-v -0.353553 -0.651305 3.037245
-v -0.353553 -0.651305 3.037245
-v -0.500000 -0.651305 2.683691
-v -0.500000 -0.651305 2.683691
-v -0.500000 -0.651305 2.683691
-v -0.500000 -0.651305 2.683691
-v -0.353553 -0.651305 2.330138
-v -0.353553 -0.651305 2.330138
-v -0.353553 -0.651305 2.330138
-v -0.353553 -0.651305 2.330138
-v -0.000000 -0.651305 2.183691
-v -0.000000 -0.651305 2.183691
-v -0.000000 -0.651305 2.183691
-v 0.353553 -0.591305 2.330138
-v 0.353553 -0.591305 2.330138
-v 0.353553 -0.591305 2.330138
-v 0.500000 -0.591305 2.683691
-v 0.500000 -0.591305 2.683691
-v 0.353554 -0.591305 3.037245
-v 0.353554 -0.591305 3.037245
-v -0.000000 -0.591305 3.183691
-v -0.000000 -0.591305 3.183691
-v -0.353554 -0.591305 3.037245
-v -0.353554 -0.591305 3.037245
-v -0.500000 -0.591305 2.683691
-v -0.500000 -0.591305 2.683691
-v -0.353553 -0.591305 2.330137
-v -0.353553 -0.591305 2.330137
-v 0.000001 -0.591305 2.183691
-v 0.000001 -0.591305 2.183691
-v 0.000001 -0.591305 2.183691
-v 0.000000 -0.651305 2.683691
-v 0.000000 -0.651305 2.683691
-v 0.000000 -0.591305 2.683691
-vt 0.000000 0.000000
-vt 1.000000 0.000000
-vt 1.000000 1.000000
-vt 0.000000 1.000000
-usemtl Nonerusty.pn
-s off
-f 671/17 624/18 626/19
-f 673/17 656/18 653/19
-f 671/17 627/18 630/19
-f 673/17 658/18 657/19
-f 671/17 631/18 634/19
-f 673/17 660/18 659/19
-f 671/17 635/18 638/19
-f 673/17 662/18 661/19
-f 671/17 639/18 642/19
-f 673/17 664/18 663/19
-f 671/17 643/18 646/19
-f 673/17 666/18 665/19
-f 671/17 647/18 650/19
-f 673/17 668/18 667/19
-f 651/17 624/18 672/19
-f 673/17 654/18 669/19
-f 625/17 654/18 657/19
-f 625/17 657/19 628/20
-f 629/17 656/18 659/19
-f 629/17 659/19 632/20
-f 633/17 658/18 661/19
-f 633/17 661/19 636/20
-f 637/17 660/18 663/19
-f 637/17 663/19 640/20
-f 641/17 662/18 665/19
-f 641/17 665/19 644/20
-f 645/17 664/18 667/19
-f 645/17 667/19 648/20
-f 649/17 666/18 669/19
-f 649/17 669/19 652/20
-f 655/17 624/18 650/19
-f 655/17 650/19 670/20
-v 0.709899 1.489080 -0.703753
-v 1.002792 1.489080 0.003354
-v 0.709899 1.489080 0.710461
-v 0.002792 1.489080 1.003354
-v -0.704315 1.489080 0.710461
-v -0.997208 1.489080 0.003354
-v -0.704315 1.489080 -0.703752
-v 0.002792 1.489080 -0.996646
-v 0.709899 1.765484 -0.703753
-v 1.002792 1.765484 0.003354
-v 0.709899 1.765484 0.710461
-v 0.002792 1.765484 1.003354
-v -0.704315 1.765484 0.710461
-v -0.997208 1.765484 0.003354
-v -0.704314 1.765484 -0.703753
-v 0.002794 1.765484 -0.996646
-v 0.002792 1.489080 0.003354
-v 0.002792 1.765484 0.003354
-usemtl (null)
-s off
-f 690 674 675
-f 691 683 682
-f 690 675 676
-f 691 684 683
-f 690 676 677
-f 691 685 684
-f 690 677 678
-f 691 686 685
-f 690 678 679
-f 691 687 686
-f 690 679 680
-f 691 688 687
-f 690 680 681
-f 691 689 688
-f 681 674 690
-f 691 682 689
-f 674 682 683
-f 674 683 675
-f 675 683 684
-f 675 684 676
-f 676 684 685
-f 676 685 677
-f 677 685 686
-f 677 686 678
-f 678 686 687
-f 678 687 679
-f 679 687 688
-f 679 688 680
-f 680 688 689
-f 680 689 681
-f 682 674 681
-f 682 681 689
-v 1.049999 1.763321 -1.048155
-v 1.049999 1.763321 -1.048155
-v 1.049999 1.763321 1.053526
-v 1.049999 1.763321 1.053526
-v 1.049999 1.763321 1.053526
-v 1.049999 1.763321 1.053526
-v -1.051682 1.763321 1.053525
-v -1.051682 1.763321 1.053525
-v -1.051682 1.763321 1.053525
-v -1.051682 1.763321 -1.048155
-v -1.051682 1.763321 -1.048155
-v -1.051682 1.763321 -1.048155
-v -1.051682 1.763321 -1.048155
-v 1.049999 3.846746 -1.048154
-v 1.049999 3.846746 -1.048154
-v 1.049999 3.846746 -1.048154
-v -1.051682 3.846746 -1.048155
-v -1.051682 3.846746 -1.048155
-v -1.051682 3.846746 -1.048155
-v -1.051682 3.846746 1.053525
-v -1.051682 3.846746 1.053525
-v 1.049998 3.846746 1.053526
-v 1.049998 3.846746 1.053526
-v 1.049998 3.846746 1.053526
-v 1.469491 2.060526 -1.048155
-v 1.469491 2.060526 -1.048155
-v 1.469491 3.549541 -1.048154
-v 1.469491 3.549541 -1.048154
-v 1.469491 3.549541 -1.048154
-v 1.469490 3.549541 1.053526
-v 1.469490 3.549541 1.053526
-v 1.469490 3.549541 1.053526
-v 1.469490 2.060526 1.053526
-v 1.469490 2.060526 1.053526
-v 1.469490 2.060526 1.053526
-v 1.049998 2.060526 1.473017
-v 1.049998 2.060526 1.473017
-v 1.049998 3.549541 1.473018
-v 1.049998 3.549541 1.473018
-v 1.049998 3.549541 1.473018
-v -1.051682 3.549541 1.473017
-v -1.051682 3.549541 1.473017
-v -1.051682 3.549541 1.473017
-v -1.051682 2.060526 1.473017
-v -1.051682 2.060526 1.473017
-v -1.051682 2.060526 1.473017
-v -1.471174 2.060526 1.053525
-v -1.471174 2.060526 1.053525
-v -1.471174 3.549541 1.053525
-v -1.471174 3.549541 1.053525
-v -1.471174 3.549541 1.053525
-v -1.471174 3.549541 -1.048155
-v -1.471174 3.549541 -1.048155
-v -1.471174 3.549541 -1.048155
-v -1.471174 2.060526 -1.048155
-v -1.471174 2.060526 -1.048155
-v -1.471174 2.060526 -1.048155
-v 1.049999 3.549541 -1.467646
-v 1.049999 3.549541 -1.467646
-v 1.049999 3.549541 -1.467646
-v 1.049999 2.060526 -1.467647
-v 1.049999 2.060526 -1.467647
-v 1.049999 2.060526 -1.467647
-v -1.051682 2.060526 -1.467647
-v -1.051682 2.060526 -1.467647
-v -1.051682 2.060526 -1.467647
-v -1.051682 3.549541 -1.467647
-v -1.051682 3.549541 -1.467647
-v 2.029957 2.556905 -0.887185
-v 1.296532 2.556905 -0.887185
-v 1.296532 2.556905 -0.887185
-v 1.296532 3.284032 -0.887185
-v 1.296532 3.284032 -0.887185
-v 2.029957 3.284031 -0.887185
-v 2.029957 3.284031 -0.887185
-v 2.029957 3.284031 0.315386
-v 2.029957 3.284031 0.315386
-v 1.296532 3.284031 0.315386
-v 1.296532 3.284031 0.315386
-v 1.296532 3.284031 0.315386
-v 1.296532 2.556906 0.315387
-v 1.296532 2.556906 0.315387
-v 2.029957 2.556905 0.315387
-v 2.029957 2.556905 0.315387
-v 2.029957 2.556905 0.315387
-v 2.029957 3.587937 -0.458234
-v 2.029957 3.587937 -0.458234
-v 2.029957 3.587937 -0.458234
-v 2.029957 3.587937 -0.113564
-v 2.029957 3.587937 -0.113564
-v 2.029957 3.587937 -0.113564
-v 2.029957 2.252998 -0.113564
-v 2.029957 2.252998 -0.113564
-v 2.029957 2.252998 -0.458234
-v 2.029957 2.252998 -0.458234
-v 1.296532 2.252999 -0.458234
-v 1.296532 2.252999 -0.458234
-v 1.296532 2.252999 -0.458234
-v 1.296532 2.252999 -0.113564
-v 1.296532 2.252999 -0.113564
-v 1.296532 3.587938 -0.113564
-v 1.296532 3.587938 -0.113564
-v 1.296532 3.587938 -0.458234
-v 1.296532 3.587938 -0.458234
-v 0.340492 2.743868 1.395637
-v 0.340492 2.743868 1.395637
-v -0.209410 2.743867 1.395637
-v -0.209410 2.743867 1.395637
-v -0.209410 1.906234 1.395637
-v -0.209410 1.906234 1.395637
-v 0.340492 1.906234 1.395637
-v 0.340492 1.906234 1.395637
-v 0.340492 1.906234 1.395637
-v 0.340491 1.906234 1.823388
-v 0.340491 1.906234 1.823388
-v -0.209410 1.906234 1.823388
-v -0.209410 1.906234 1.823388
-v -0.209410 2.743867 1.823388
-v -0.209410 2.743867 1.823388
-v -0.209410 2.743867 1.823388
-v 0.340491 2.743867 1.823388
-v 0.340491 2.743867 1.823388
-v 0.340491 2.743867 1.823388
-v -0.893777 2.096926 1.823388
-v -0.893777 2.096926 1.823388
-v -0.893777 2.096926 1.823388
-v -0.893777 2.096926 1.395637
-v -0.893777 2.096926 1.395637
-v -0.893777 2.553175 1.395637
-v -0.893777 2.553175 1.395637
-v -0.893777 2.553175 1.395637
-v -0.893777 2.553175 1.823388
-v -0.893777 2.553175 1.823388
-v 1.024858 2.553175 1.823388
-v 1.024858 2.553175 1.823388
-v 1.024858 2.553176 1.395637
-v 1.024858 2.553176 1.395637
-v 1.024858 2.096926 1.395637
-v 1.024858 2.096926 1.395637
-v 1.024858 2.096926 1.823388
-vt 0.000000 0.000000
-vt 1.000000 0.000000
-vt 1.000000 1.000000
-vt 0.000000 1.000000
-usemtl Nonerusty.pn
-s off
-f 692/21 694/22 698/23
-f 692/21 698/23 701/24
-f 711/21 713/22 705/23
-f 711/21 705/23 708/24
-f 721/21 724/22 716/23
-f 721/21 716/23 718/24
-f 732/21 735/22 727/23
-f 732/21 727/23 729/24
-f 743/21 746/22 738/23
-f 743/21 738/23 740/24
-f 755/21 758/22 749/23
-f 755/21 749/23 752/24
-f 692/21 717/22 725/23
-f 692/21 725/23 695/24
-f 736/21 699/22 696/23
-f 736/21 696/23 728/24
-f 753/21 693/22 702/23
-f 753/21 702/23 756/24
-f 747/21 703/22 698/23
-f 747/21 698/23 739/24
-f 759/21 709/22 705/23
-f 759/21 705/23 750/24
-f 710/21 744/22 741/23
-f 710/21 741/23 712/24
-f 714/21 722/22 719/23
-f 714/21 719/23 706/24
-f 711/21 733/22 730/23
-f 711/21 730/23 715/24
-f 751/21 720/22 716/23
-f 751/21 716/23 752/24
-f 721/21 731/22 727/23
-f 721/21 727/23 726/24
-f 732/21 742/22 738/23
-f 732/21 738/23 737/24
-f 743/21 758/22 757/23
-f 743/21 757/23 748/24
-f 692/21 754/22 716/23
-f 697/21 724/22 727/23
-f 700/21 735/22 738/23
-f 704/21 746/22 757/23
-f 707/21 720/22 749/23
-f 714/21 731/22 723/23
-f 711/21 742/22 734/23
-f 710/21 758/22 745/23
-f 763/21 765/22 760/23
-f 763/21 760/23 761/24
-f 772/21 774/22 767/23
-f 772/21 767/23 769/24
-f 777/21 785/22 760/23
-f 777/21 760/23 766/24
-f 783/21 790/22 787/23
-f 783/21 787/23 786/24
-f 788/21 794/22 764/23
-f 788/21 764/23 761/24
-f 792/21 780/22 778/23
-f 792/21 778/23 795/24
-f 788/21 762/22 760/23
-f 788/21 760/23 786/24
-f 763/21 794/22 778/23
-f 763/21 778/23 766/24
-f 792/21 770/22 767/23
-f 792/21 767/23 781/24
-f 772/21 790/22 784/23
-f 772/21 784/23 775/24
-f 776/21 779/22 782/23
-f 776/21 782/23 768/24
-f 777/21 774/22 784/23
-f 777/21 784/23 786/24
-f 771/21 789/22 791/23
-f 771/21 791/23 773/24
-f 788/21 770/22 793/23
-f 788/21 793/23 795/24
-f 802/21 820/22 798/23
-f 802/21 798/23 796/24
-f 821/21 803/22 800/23
-f 821/21 800/23 818/24
-f 812/21 815/22 807/23
-f 812/21 807/23 805/24
-f 816/21 813/22 809/23
-f 816/21 809/23 823/24
-f 819/21 801/22 807/23
-f 819/21 807/23 817/24
-f 799/21 820/22 824/23
-f 799/21 824/23 810/24
-f 827/21 797/22 814/23
-f 827/21 814/23 825/24
-f 802/21 829/22 831/23
-f 802/21 831/23 805/24
-f 799/21 811/22 814/23
-f 799/21 814/23 796/24
-f 802/21 797/22 828/23
-f 802/21 828/23 830/24
-f 808/21 801/22 804/23
-f 808/21 804/23 805/24
-f 812/21 806/22 831/23
-f 812/21 831/23 825/24
-f 819/21 815/22 824/23
-f 819/21 824/23 822/24
-f 827/21 826/22 831/23
-f 827/21 831/23 830/24
-v -0.714283 3.818236 -0.544765
-v -0.701072 3.818236 -0.517479
-v -0.714283 3.818236 -0.490193
-v -0.746178 3.818236 -0.478891
-v -0.778073 3.818236 -0.490193
-v -0.791284 3.818236 -0.517479
-v -0.778073 3.818236 -0.544765
-v -0.746178 3.818236 -0.556067
-v -0.714283 5.818236 -0.544765
-v -0.701072 5.818236 -0.517479
-v -0.714283 5.818236 -0.490193
-v -0.746178 5.818236 -0.478891
-v -0.778073 5.818236 -0.490193
-v -0.791284 5.818236 -0.517479
-v -0.778073 5.818236 -0.544765
-v -0.746178 5.818236 -0.556067
-v -0.746178 3.818236 -0.517479
-v -0.746178 5.818236 -0.517479
-usemtl (null)
-s off
-f 848 832 833
-f 849 841 840
-f 848 833 834
-f 849 842 841
-f 848 834 835
-f 849 843 842
-f 848 835 836
-f 849 844 843
-f 848 836 837
-f 849 845 844
-f 848 837 838
-f 849 846 845
-f 848 838 839
-f 849 847 846
-f 839 832 848
-f 849 840 847
-f 832 840 841
-f 832 841 833
-f 833 841 842
-f 833 842 834
-f 834 842 843
-f 834 843 835
-f 835 843 844
-f 835 844 836
-f 836 844 845
-f 836 845 837
-f 837 845 846
-f 837 846 838
-f 838 846 847
-f 838 847 839
-f 840 832 839
-f 840 839 847
diff --git a/examples/quick3d/lander/qml/meshes/lunar-landscape.3ds b/examples/quick3d/lander/qml/meshes/lunar-landscape.3ds
deleted file mode 100644
index 4fc9f707..00000000
--- a/examples/quick3d/lander/qml/meshes/lunar-landscape.3ds
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/lander/qml/meshes/lunar-landscape.obj b/examples/quick3d/lander/qml/meshes/lunar-landscape.obj
deleted file mode 100644
index b115a189..00000000
--- a/examples/quick3d/lander/qml/meshes/lunar-landscape.obj
+++ /dev/null
@@ -1,3207 +0,0 @@
-# Blender3D v249 OBJ File: lunar-landscape.blend
-# www.blender3d.org
-mtllib lunar-landscape.mtl
-v 6.987587 3.832309 -6.987586
-v 6.987587 0.000000 6.987587
-v -6.987588 0.001511 6.987586
-v -6.987585 -0.000000 -6.987589
-v 0.000000 0.000000 6.987586
-v 6.987587 0.000227 0.000000
-v 0.000001 2.874231 -6.987588
-v -6.987586 1.399991 -0.000002
-v -0.157373 2.432356 0.018808
-v 3.493793 0.006147 6.987586
-v -3.493794 0.000227 6.987586
-v 6.987587 -0.000000 -3.493793
-v 6.987587 0.000000 3.493793
-v 3.493794 0.000908 -6.987587
-v -3.493792 -0.000000 -6.987588
-v -6.987587 0.000000 3.493792
-v -6.987586 1.708463 -3.493796
-v -3.493793 0.045664 -0.000001
-v 0.000001 0.578838 -3.493794
-v 3.493793 0.006147 -0.000000
-v 0.000000 0.024587 3.493793
-v -3.493792 3.832309 -3.493795
-v 3.493794 0.005577 -3.493793
-v -3.493793 0.045664 3.493792
-v 3.493793 0.000000 3.493793
-v 1.746897 0.045664 6.987586
-v 5.240690 0.045664 6.987587
-v -1.746897 0.000000 6.987586
-v -5.245850 2.489622 6.987579
-v 6.987587 0.126444 -5.240690
-v 6.987587 3.832309 -1.746897
-v 6.987587 0.000000 5.240690
-v 6.987587 0.000000 1.746897
-v 5.240691 0.000908 -6.987587
-v 1.746898 0.126444 -6.987587
-v -5.240688 0.126444 -6.987588
-v -1.746895 0.126444 -6.987588
-v -6.811378 2.775703 1.650681
-v -6.987587 2.355273 5.240689
-v -6.987586 1.708463 -1.746899
-v -6.987585 0.045663 -5.240693
-v -1.780814 1.512713 -0.000001
-v -5.240689 3.053871 -0.000002
-v -0.011412 2.544912 -1.689837
-v 0.000001 0.578838 -5.240691
-v 1.667012 2.544912 0.011411
-v 5.240690 0.139720 0.000000
-v -0.033917 1.512714 1.746896
-v 0.000000 0.000908 5.240689
-v -5.240689 -0.000000 -3.493795
-v -3.493792 0.126444 -5.240692
-v -1.746896 0.579065 -3.493795
-v -3.493793 0.344065 -1.746898
-v 1.746897 0.000908 -3.493794
-v 3.493794 0.939364 -5.240690
-v 5.240690 0.004669 -3.493793
-v 3.493793 0.403728 -1.746897
-v -5.240690 1.463332 3.493792
-v -3.493793 0.208845 1.746895
-v -1.746897 0.024587 3.493793
-v -3.493793 0.000227 5.240689
-v 1.746897 0.208845 3.493793
-v 3.493793 0.000908 1.746896
-v 5.240690 0.208845 3.493793
-v 3.493793 0.006147 5.240690
-v -5.240689 2.874231 -5.240692
-v -1.746895 2.874231 -5.240692
-v -5.240689 0.045663 -1.746899
-v -1.746896 0.579065 -1.746898
-v 1.746898 3.832309 -5.240691
-v 5.240691 0.939364 -5.240690
-v 1.728248 0.831735 -1.746897
-v 5.240690 -0.000000 -1.746897
-v -5.240690 1.444047 1.746895
-v -1.746896 0.000227 1.746896
-v -5.240690 0.970727 5.240689
-v -1.746897 0.208845 5.240689
-v 1.746804 0.004135 1.746896
-v 5.240690 0.208845 1.746897
-v 1.746897 0.001135 5.240689
-v 5.240690 0.045664 5.240690
-v 2.620345 0.045664 6.987586
-v 0.873448 0.000000 6.987586
-v 4.367242 0.000227 6.987587
-v 6.114139 0.045664 6.987587
-v -2.620346 0.000227 6.987586
-v -0.873448 0.000000 6.987586
-v -4.367243 0.103614 6.987586
-v -6.114140 1.477486 6.987586
-v 6.987587 -0.000000 -4.367241
-v 6.987587 3.832309 -6.114138
-v 6.987587 1.708463 -2.620345
-v 6.987587 1.708463 -0.873448
-v 6.987587 0.000000 6.114139
-v 6.987587 0.000000 4.367242
-v 6.987587 0.000000 2.620345
-v 6.987587 0.000227 0.873449
-v 6.114139 1.708463 -6.987587
-v 4.367243 0.403727 -6.987587
-v 0.873450 1.708463 -6.987587
-v 2.620346 -0.000000 -6.987587
-v -6.114136 -0.000000 -6.987588
-v -4.367240 0.126444 -6.987588
-v -2.620343 0.004669 -6.987588
-v -0.873447 1.708464 -6.987588
-v -6.930481 2.505252 0.936312
-v -6.987587 0.103614 2.620343
-v -6.987587 0.769984 6.114137
-v -6.987587 0.769757 4.367240
-v -6.987586 0.769756 -0.873451
-v -6.987586 3.832309 -2.620347
-v -6.987585 0.045663 -6.114141
-v -6.987586 -0.000000 -4.367244
-v -1.284286 2.544912 0.251066
-v -2.620344 0.045664 -0.000001
-v -6.118347 2.379504 0.021046
-v -4.367241 0.928443 -0.000002
-v -0.265250 2.437868 -1.224662
-v -0.002510 0.690795 -2.620346
-v 0.000001 0.578838 -4.367243
-v 0.000001 1.708463 -6.114140
-v 1.257562 2.477531 0.181236
-v 2.617835 0.111957 -0.000000
-v 4.367242 0.139720 -0.000000
-v 6.114139 0.083050 0.000000
-v -0.157373 2.432356 1.130498
-v 0.000000 0.000000 2.620344
-v 0.000000 0.000908 6.114138
-v 0.000000 0.000000 4.367241
-v -4.367240 0.939364 -3.493795
-v -6.114137 0.939364 -3.493795
-v -3.493792 3.832309 -4.367243
-v -3.493792 0.126444 -6.114140
-v -2.620344 1.518202 -3.493795
-v -0.873447 0.578838 -3.493794
-v -3.493793 0.456221 -2.620347
-v -3.493793 0.000940 -0.873450
-v 0.873449 0.025464 -3.493794
-v 2.620346 0.403727 -3.493793
-v 3.493794 0.000908 -6.114139
-v 3.493794 1.708463 -4.367242
-v 6.114139 -0.000000 -3.493793
-v 4.367242 1.708463 -3.493793
-v 3.493793 0.000908 -0.873448
-v 3.493793 0.000908 -2.620345
-v -6.114139 1.463332 3.493792
-v -4.367242 0.045664 3.493792
-v -3.493793 0.083050 0.873447
-v -3.493793 0.208845 2.620344
-v -0.873448 0.698598 3.493793
-v -2.620345 0.024586 3.493792
-v -3.493793 0.083051 6.114138
-v -3.493793 0.070153 4.367241
-v 0.873448 0.000000 3.493793
-v 2.620345 0.208845 3.493793
-v 3.493793 0.000908 0.873448
-v 3.493793 0.000000 2.620345
-v 6.114139 0.000000 3.493793
-v 4.367242 0.208845 3.493793
-v 3.493793 0.139720 6.114138
-v 3.493793 0.000000 4.367241
-v -6.114137 0.169588 -5.240693
-v -5.240689 2.874231 -6.114140
-v -4.367240 2.874231 -5.240692
-v -5.240689 0.126443 -4.367243
-v -2.620344 1.733928 -5.240692
-v -1.746895 2.874231 -6.114140
-v -0.873447 0.705283 -5.240691
-v -1.746896 0.705283 -4.367243
-v -6.114138 0.939366 -1.746899
-v -5.240689 -0.000000 -2.620347
-v -4.367241 0.045663 -1.746898
-v -5.240689 1.073324 -0.873450
-v -2.620344 0.579065 -1.746898
-v -1.746896 0.661888 -2.620346
-v -0.892096 1.020912 -1.746898
-v -1.765545 0.838555 -0.873450
-v 0.873449 1.708464 -5.240691
-v 1.746898 3.832309 -6.114139
-v 2.620346 1.708463 -5.240690
-v 1.746898 0.126444 -4.367242
-v 4.367243 1.708463 -5.240690
-v 5.240691 0.000908 -6.114139
-v 6.114139 -0.000000 -5.240690
-v 5.240690 1.708463 -4.367242
-v 0.839532 1.512714 -1.746897
-v 1.746897 0.000908 -2.620346
-v 2.620345 -0.000000 -1.746897
-v 1.609951 2.544912 -0.713679
-v 4.367242 0.403728 -1.746897
-v 5.240690 -0.000000 -2.620345
-v 6.114139 1.708463 -1.746897
-v 5.240690 0.006147 -0.873448
-v -6.226498 2.775703 1.650681
-v -5.257568 2.380566 0.881865
-v -4.367241 0.208901 1.746895
-v -5.240690 0.208862 2.620343
-v -2.620345 0.083050 1.746896
-v -1.749407 0.111957 0.873447
-v -0.892097 0.831735 1.746896
-v -1.746897 0.000227 2.620344
-v -6.114139 2.379860 5.240689
-v -5.240690 2.564118 4.367240
-v -4.367242 0.024587 5.240689
-v -5.245913 2.515856 6.114130
-v -2.620345 0.024808 5.240689
-v -1.746897 0.024587 4.367241
-v -0.873448 0.208845 5.240689
-v -1.746897 0.208845 6.114138
-v 0.839531 1.512714 1.746896
-v 1.712980 1.512713 0.873448
-v 2.620345 0.000000 1.746896
-v 1.746897 0.000000 2.620344
-v 4.367242 0.403728 1.746897
-v 5.240690 0.007055 0.873448
-v 6.114139 0.208845 1.746897
-v 5.240690 0.208845 2.620345
-v 0.873448 0.403728 5.240689
-v 1.746897 0.208845 4.367241
-v 2.620345 0.083051 5.240689
-v 1.746897 0.046572 6.114138
-v 4.367242 0.000227 5.240690
-v 5.240690 0.208845 4.367242
-v 6.114139 0.045664 5.240690
-v 5.240690 0.045664 6.114139
-v -6.114137 0.169589 -6.114141
-v -4.367240 2.874231 -6.114140
-v -6.114137 -0.000000 -4.367244
-v -4.367240 1.708463 -4.367243
-v -2.620343 1.708463 -6.114140
-v -0.873447 0.949180 -6.114140
-v -2.620344 2.287302 -4.367243
-v -0.873447 0.578838 -4.367243
-v -6.114137 1.708463 -2.620347
-v -4.367240 -0.000000 -2.620347
-v -6.114138 1.399988 -0.873450
-v -4.367241 0.045663 -0.873450
-v -2.620344 0.661888 -2.620347
-v -0.873448 0.578838 -2.620346
-v -2.620344 0.344065 -0.873450
-v -1.010394 2.544912 -0.919098
-v 0.873449 1.708464 -6.114139
-v 2.620346 0.939364 -6.114139
-v 0.873449 0.348714 -4.367243
-v 2.620346 0.004669 -4.367242
-v 4.367243 0.403727 -6.114139
-v 6.114139 0.939364 -6.114139
-v 4.367242 2.874231 -4.367242
-v 6.114139 -0.000000 -4.367242
-v 0.873356 0.026239 -2.620346
-v 2.620345 0.403728 -2.620345
-v 0.954318 2.432356 -1.092883
-v 2.617835 0.111957 -0.873449
-v 4.367242 0.000908 -2.620345
-v 6.114139 0.939364 -2.620345
-v 4.367242 0.007054 -0.873448
-v 6.114139 0.939364 -0.873448
-v -6.226498 2.775703 1.065802
-v -4.367241 1.460189 0.873447
-v -6.114139 0.103614 2.620343
-v -4.367242 0.208845 2.620344
-v -2.620345 0.045664 0.873447
-v -0.930509 2.544912 0.873447
-v -2.620345 0.083050 2.620344
-v -0.873448 0.024587 2.620344
-v -6.114139 2.564118 4.367240
-v -4.367242 0.126893 4.367241
-v -6.119423 2.575730 6.114130
-v -4.367242 0.103064 6.114138
-v -2.620345 0.698598 4.367241
-v -0.873448 0.024587 4.367241
-v -2.620345 0.083051 6.114138
-v -0.873448 0.208845 6.114138
-v 1.021807 2.544912 1.078866
-v 2.620252 0.004135 0.873448
-v 0.873448 0.000000 2.620344
-v 2.620345 0.000000 2.620345
-v 4.367242 0.403728 0.873448
-v 6.114139 0.083050 0.873449
-v 4.367242 0.000000 2.620345
-v 6.114139 0.208845 2.620345
-v 0.873448 0.000000 4.367241
-v 2.620345 0.208845 4.367241
-v 0.873448 0.403728 6.114138
-v 2.620345 0.083051 6.114138
-v 4.367242 0.208845 4.367242
-v 6.114139 0.000000 4.367242
-v 4.367242 0.083051 6.114139
-v 6.114139 0.045664 6.114139
-v 2.183621 0.083051 6.987586
-v 3.057069 0.000227 6.987586
-v 1.310173 0.000227 6.987586
-v 0.436724 0.000000 6.987586
-v 4.803966 0.000227 6.987587
-v 3.930518 0.006147 6.987587
-v 5.677414 0.083051 6.987587
-v 6.550863 0.000227 6.987587
-v -2.183621 0.000000 6.987586
-v -3.057070 0.006147 6.987586
-v -1.310173 0.000000 6.987586
-v -0.436724 0.000000 6.987586
-v -4.803967 1.399991 6.987586
-v -3.930518 0.000000 6.987586
-v -5.686989 2.649852 6.987572
-v -6.550864 0.791741 6.987586
-v 6.987587 -0.000000 -4.803966
-v 6.987587 -0.000000 -3.930517
-v 6.987587 1.708463 -5.677414
-v 6.987587 3.832309 -6.550862
-v 6.987587 3.832309 -2.183621
-v 6.987587 0.126444 -3.057069
-v 6.987587 3.832309 -1.310172
-v 6.987587 0.126444 -0.436724
-v 6.987587 0.000000 5.677414
-v 6.987587 0.000000 6.550863
-v 6.987587 0.000000 4.803966
-v 6.987587 0.000000 3.930518
-v 6.987587 0.000000 2.183621
-v 6.987587 0.000000 3.057069
-v 6.987587 0.000000 1.310173
-v 6.987587 0.006147 0.436725
-v 5.677414 0.126444 -6.987587
-v 6.550863 3.832309 -6.987587
-v 4.803967 0.208845 -6.987587
-v 3.930518 0.208845 -6.987587
-v 1.310174 0.126444 -6.987587
-v 0.436725 2.874231 -6.987587
-v 2.183622 0.004669 -6.987587
-v 3.057070 -0.000000 -6.987587
-v -5.677412 0.004669 -6.987588
-v -6.550860 -0.000000 -6.987588
-v -4.803964 0.126444 -6.987588
-v -3.930516 0.004669 -6.987588
-v -2.183619 0.126444 -6.987588
-v -3.057068 -0.000000 -6.987588
-v -1.310171 0.126444 -6.987588
-v -0.436723 2.874231 -6.987588
-v -6.885465 2.673244 1.338740
-v -6.987586 1.399991 0.436722
-v -6.987587 1.399990 2.183619
-v -6.987587 0.000000 3.057068
-v -6.987587 1.399991 5.677413
-v -6.987587 0.094449 6.550861
-v -6.987587 1.399991 4.803965
-v -6.987587 0.009821 3.930516
-v -6.987586 0.128082 -1.310175
-v -6.987586 1.399991 -0.436726
-v -6.987586 3.832309 -2.183623
-v -6.987586 3.832309 -3.057072
-v -6.987585 0.083050 -5.677417
-v -6.987585 0.000227 -6.550865
-v -6.987586 0.000227 -4.803968
-v -6.987586 0.126443 -3.930520
-v -1.378645 2.544912 -0.159772
-v -0.930745 2.426263 -0.026189
-v -2.186131 0.112111 -0.000001
-v -3.057069 0.083050 -0.000001
-v -5.677413 2.759001 -0.000002
-v -6.550784 2.355273 0.000779
-v -4.803965 2.759001 -0.000002
-v -3.930517 0.017326 -0.000002
-v -0.342364 2.544912 -1.469944
-v -0.464730 2.415156 -0.889547
-v -0.033917 1.701891 -2.183622
-v 0.000001 0.578838 -3.057070
-v 0.000001 0.578838 -4.803967
-v 0.000001 0.578838 -3.930518
-v 0.000001 0.705282 -5.677415
-v 0.000001 2.874231 -6.550864
-v 1.510163 2.544912 0.018808
-v 0.398472 2.432356 0.018808
-v 2.149704 1.512715 -0.000001
-v 3.057069 -0.000000 -0.000000
-v 4.803966 0.083050 0.000000
-v 3.930518 0.083050 -0.000000
-v 5.677414 0.083050 0.000000
-v 6.550863 0.045664 0.000000
-v -0.057060 2.544912 1.447117
-v -0.480137 2.433997 0.867175
-v -0.002510 0.111957 2.183620
-v 0.000000 0.000908 3.057069
-v 0.000000 0.024587 5.677413
-v 0.000000 0.000000 6.550862
-v 0.000000 0.000000 4.803965
-v 0.000000 0.000908 3.930517
-v -4.803965 0.004669 -3.493795
-v -3.930516 1.708465 -3.493795
-v -5.677413 0.004669 -3.493795
-v -6.550861 1.708465 -3.493795
-v -3.493792 1.709404 -4.803967
-v -3.493792 3.832309 -3.930520
-v -3.493792 0.126444 -5.677416
-v -3.493792 0.004669 -6.550864
-v -2.183620 0.589653 -3.493795
-v -3.057068 1.897641 -3.493795
-v -1.310171 0.578838 -3.493794
-v -0.436723 0.578838 -3.493794
-v -3.493793 0.344065 -2.183623
-v -3.493792 1.708463 -3.057071
-v -3.493793 0.189177 -1.310174
-v -3.493793 0.000227 -0.436726
-v 1.310173 -0.000000 -3.493794
-v 0.436725 0.344065 -3.493794
-v 2.183621 0.208845 -3.493793
-v 3.057070 0.208845 -3.493793
-v 3.493794 0.004669 -5.677414
-v 3.493794 0.024586 -6.550863
-v 3.493794 1.708463 -4.803966
-v 3.493794 0.939364 -3.930518
-v 5.677414 -0.000000 -3.493793
-v 6.550863 -0.000000 -3.493793
-v 4.803966 0.939364 -3.493793
-v 3.930518 0.939364 -3.493793
-v 3.493793 0.208845 -1.310173
-v 3.493793 0.000227 -0.436724
-v 3.493793 0.208845 -2.183621
-v 3.493793 0.024586 -3.057069
-v -5.677414 1.486244 3.493792
-v -6.550863 0.402930 3.493792
-v -4.803966 0.403496 3.493792
-v -3.930518 0.083050 3.493792
-v -3.493793 0.046571 1.310171
-v -3.493793 0.083050 0.436723
-v -3.493793 0.403727 2.183620
-v -3.493793 0.001135 3.057068
-v -1.310172 0.403728 3.493793
-v -0.436724 0.403728 3.493793
-v -2.183621 0.000908 3.493792
-v -3.057069 0.001135 3.493792
-v -3.493793 0.045664 5.677413
-v -3.493793 0.045664 6.550862
-v -3.493793 0.001135 4.803965
-v -3.493793 0.083958 3.930517
-v 1.310173 0.000908 3.493793
-v 0.436724 0.000000 3.493793
-v 2.183621 0.403728 3.493793
-v 3.057069 0.000908 3.493793
-v 3.493793 0.024586 1.310172
-v 3.493793 0.000227 0.436724
-v 3.493793 0.000000 2.183620
-v 3.493793 0.000000 3.057069
-v 5.677414 0.000908 3.493793
-v 6.550863 0.000000 3.493793
-v 4.803966 0.403727 3.493793
-v 3.930518 0.000908 3.493793
-v 3.493793 0.083051 5.677414
-v 3.493793 0.083051 6.550862
-v 3.493793 0.000000 4.803966
-v 3.493793 0.000000 3.930517
-v -6.550861 0.083050 -5.240693
-v -5.677413 1.708463 -5.240693
-v -5.240689 1.708463 -6.550864
-v -5.240689 2.874231 -5.677416
-v -3.930516 1.708463 -5.240692
-v -4.803965 2.874231 -5.240692
-v -5.240689 -0.000000 -3.930519
-v -5.240689 1.708462 -4.803967
-v -3.057068 0.939364 -5.240692
-v -2.183619 2.874231 -5.240692
-v -1.746895 1.708463 -6.550864
-v -1.746895 2.874231 -5.677416
-v -0.436723 0.578838 -5.240691
-v -1.310171 1.729865 -5.240691
-v -1.746896 0.578838 -3.930519
-v -1.746896 1.729864 -4.803967
-v -6.550862 1.708463 -1.746899
-v -5.677413 0.004896 -1.746899
-v -5.240689 -0.000000 -3.057071
-v -5.240689 0.000227 -2.183623
-v -3.930517 0.025685 -1.746898
-v -4.803965 0.083050 -1.746898
-v -5.240689 2.759001 -0.436726
-v -5.240689 0.115640 -1.310174
-v -3.057069 0.578838 -1.746898
-v -2.183620 0.584985 -1.746898
-v -1.746896 0.624502 -3.057070
-v -1.746896 0.624502 -2.183622
-v -0.470641 2.091552 -1.746898
-v -1.310264 0.582973 -1.746898
-v -1.780813 1.512713 -0.436725
-v -1.746989 0.582973 -1.310174
-v 0.436725 0.705283 -5.240691
-v 1.310173 3.832309 -5.240691
-v 1.746898 1.708463 -6.550863
-v 1.746898 3.832309 -5.677414
-v 3.057070 0.126444 -5.240690
-v 2.183622 3.832309 -5.240690
-v 1.746898 -0.000000 -3.930518
-v 1.746898 1.708463 -4.803967
-v 3.930518 1.708463 -5.240690
-v 4.803967 1.708463 -5.240690
-v 5.240691 0.024586 -6.550863
-v 5.240691 0.004669 -5.677414
-v 6.550863 0.004669 -5.240690
-v 5.677414 0.004669 -5.240690
-v 5.240690 0.939364 -3.930518
-v 5.240690 1.708465 -4.803966
-v 0.379664 2.544912 -1.655600
-v 1.276256 1.512714 -1.746897
-v 1.746897 0.024586 -3.057070
-v 1.746804 0.004134 -2.183621
-v 3.057069 0.024586 -1.746897
-v 2.183529 0.004134 -1.746897
-v 1.689836 2.544912 -0.436725
-v 1.712980 1.512713 -1.310173
-v 3.930518 0.698598 -1.746897
-v 4.803966 0.024586 -1.746897
-v 5.240690 -0.000000 -3.057069
-v 5.240690 -0.000000 -2.183621
-v 6.550863 3.832309 -1.746897
-v 5.677414 0.126444 -1.746897
-v 5.240690 0.083050 -0.436724
-v 5.240690 -0.000000 -1.310172
-v -6.518938 2.775703 1.650681
-v -5.831019 2.633315 1.689703
-v -5.240689 2.759001 0.436722
-v -5.257716 2.358775 1.312286
-v -3.930517 0.403728 1.746895
-v -4.803966 0.805750 1.746895
-v -5.240690 0.010925 3.057068
-v -5.240690 0.805750 2.183619
-v -3.057069 0.046571 1.746895
-v -2.183620 0.045664 1.746896
-v -1.765545 0.831735 0.436723
-v -1.746989 0.004135 1.310171
-v -0.470641 1.512714 1.746896
-v -1.310265 0.004135 1.746896
-v -1.746897 0.000908 3.057068
-v -1.746897 0.006147 2.183620
-v -6.550863 2.355273 5.240689
-v -5.677414 1.658214 5.240689
-v -5.240690 2.759001 3.930516
-v -5.240690 1.658214 4.803965
-v -3.930518 0.000000 5.240689
-v -4.803966 0.403852 5.240689
-v -5.250143 2.607150 6.550848
-v -5.240690 1.307364 5.677413
-v -3.057069 0.007055 5.240689
-v -2.183621 0.000908 5.240689
-v -1.746897 0.000908 3.930517
-v -1.746897 0.000908 4.803965
-v -0.436724 0.000908 5.240689
-v -1.310172 0.403728 5.240689
-v -1.746897 0.000908 6.550862
-v -1.746897 0.403728 5.677413
-v 0.402807 1.512714 1.746896
-v 1.291524 0.831735 1.746896
-v 1.564302 2.544912 0.413899
-v 1.728248 0.831735 1.310172
-v 3.057069 0.000000 1.746896
-v 2.183621 0.000000 1.746896
-v 1.746897 0.000908 3.057069
-v 1.746897 0.000000 2.183620
-v 3.930518 0.208845 1.746897
-v 4.803966 0.208845 1.746897
-v 5.240690 0.083050 0.436724
-v 5.240690 0.024586 1.310173
-v 6.550863 0.000908 1.746897
-v 5.677414 0.403728 1.746897
-v 5.240690 0.000908 3.057069
-v 5.240690 0.403728 2.183621
-v 0.436724 0.208845 5.240689
-v 1.310173 0.208845 5.240689
-v 1.746897 0.403728 3.930517
-v 1.746897 0.000908 4.803965
-v 3.057069 0.045664 5.240689
-v 2.183621 0.045664 5.240689
-v 1.746897 0.083051 6.550862
-v 1.746897 0.030701 5.677413
-v 3.930518 0.006147 5.240690
-v 4.803966 0.000227 5.240690
-v 5.240690 0.403728 3.930518
-v 5.240690 0.001135 4.803966
-v 6.550863 0.000227 5.240690
-v 5.677414 0.083051 5.240690
-v 5.240690 0.083051 6.550863
-v 5.240690 0.083051 5.677414
-v -6.550860 0.083050 -6.114141
-v -6.114136 0.004896 -6.550864
-v -5.677413 1.708463 -6.114140
-v -6.114137 0.205780 -5.677417
-v -4.803965 2.874231 -6.114140
-v -4.367240 1.708463 -6.550864
-v -3.930516 1.708463 -6.114140
-v -4.367240 2.874231 -5.677416
-v -6.550861 -0.000000 -4.367244
-v -6.114137 0.004896 -4.803968
-v -5.677413 0.004669 -4.367243
-v -6.114137 0.004669 -3.930519
-v -4.803965 0.126444 -4.367243
-v -4.367240 1.708463 -4.803967
-v -3.930516 3.832309 -4.367243
-v -4.367240 1.708463 -3.930519
-v -3.057068 0.939364 -6.114140
-v -2.620343 0.939364 -6.550864
-v -2.183619 2.874231 -6.114140
-v -2.620343 2.874231 -5.677416
-v -1.310171 1.708464 -6.114140
-v -0.873447 1.708464 -6.550864
-v -0.436723 1.708462 -6.114140
-v -0.873447 0.705283 -5.677415
-v -3.057068 3.832309 -4.367243
-v -2.620344 0.960765 -4.803967
-v -2.183620 0.705283 -4.367243
-v -2.620344 2.287302 -3.930519
-v -1.310171 0.583508 -4.367243
-v -0.873447 0.583508 -4.803967
-v -0.436723 0.578838 -4.367243
-v -0.873447 0.578838 -3.930518
-v -6.550861 3.832309 -2.620347
-v -6.114137 1.708463 -3.057071
-v -5.677413 0.126444 -2.620347
-v -6.114137 1.708465 -2.183623
-v -4.803965 -0.000000 -2.620347
-v -4.367240 0.004670 -3.057071
-v -3.930516 0.030134 -2.620347
-v -4.367241 0.000227 -2.183623
-v -6.550862 1.399991 -0.873450
-v -6.114138 0.108271 -1.310175
-v -5.677413 1.236681 -0.873450
-v -6.114138 2.356181 -0.436726
-v -4.803965 0.606133 -0.873450
-v -4.367241 0.083050 -1.310174
-v -3.930517 0.000227 -0.873450
-v -4.367241 0.403496 -0.436726
-v -3.057069 0.589653 -2.620347
-v -2.620344 0.629168 -3.057071
-v -2.183620 0.718558 -2.620346
-v -2.620344 0.624502 -2.183622
-v -1.310172 0.584985 -2.620346
-v -0.873448 0.578838 -3.057070
-v -0.436816 0.582973 -2.620346
-v -0.873540 0.582973 -2.183622
-v -3.057069 0.189177 -0.873450
-v -2.620344 0.578838 -1.310174
-v -2.183713 0.348183 -0.873450
-v -2.620344 0.025685 -0.436725
-v -1.344089 1.512714 -0.873449
-v -0.907365 1.701891 -1.310174
-v -0.756264 2.544912 -1.147341
-v -1.181576 2.544912 -0.642144
-v 0.436725 1.708465 -6.114140
-v 0.873449 1.708464 -6.550863
-v 1.310174 3.832309 -6.114139
-v 0.873449 1.708464 -5.677415
-v 2.183622 1.708463 -6.114139
-v 2.620346 0.004669 -6.550863
-v 3.057070 0.004669 -6.114139
-v 2.620346 1.708463 -5.677414
-v 0.436725 0.578838 -4.367243
-v 0.873449 0.939364 -4.803967
-v 1.310173 0.148522 -4.367243
-v 0.873449 0.189177 -3.930518
-v 2.183622 0.126444 -4.367242
-v 2.620346 0.939364 -4.803966
-v 3.057070 0.126444 -4.367242
-v 2.620346 0.024586 -3.930518
-v 3.930518 0.208845 -6.114139
-v 4.367243 0.698598 -6.550863
-v 4.803967 0.208845 -6.114139
-v 4.367243 0.148252 -5.677414
-v 5.677414 0.004669 -6.114139
-v 6.114139 1.708463 -6.550863
-v 6.550863 1.708463 -6.114139
-v 6.114139 0.004669 -5.677414
-v 3.930518 2.874231 -4.367242
-v 4.367243 2.874231 -4.803966
-v 4.803966 2.874231 -4.367242
-v 4.367242 2.874231 -3.930518
-v 5.677414 0.126444 -4.367242
-v 6.114139 -0.000000 -4.803966
-v 6.550863 -0.000000 -4.367242
-v 6.114139 -0.000000 -3.930518
-v 0.434215 0.456022 -2.620346
-v 0.873449 0.025464 -3.057070
-v 1.310173 -0.000000 -2.620346
-v 0.854800 0.831735 -2.183622
-v 2.183621 0.208845 -2.620346
-v 2.620346 0.698598 -3.057069
-v 3.057069 0.208845 -2.620345
-v 2.620345 0.024586 -2.183621
-v 0.478570 2.451154 -1.287513
-v 0.868934 2.544499 -1.362677
-v 1.355822 2.544912 -0.964746
-v 1.171653 2.474583 -0.761451
-v 2.149704 1.512713 -0.873449
-v 2.620253 0.004135 -1.310173
-v 3.057069 -0.000000 -0.873449
-v 2.617835 0.111957 -0.436724
-v 3.930518 0.024586 -2.620345
-v 4.367242 0.126444 -3.057069
-v 4.803966 -0.000000 -2.620345
-v 4.367242 0.208845 -2.183621
-v 5.677414 0.004669 -2.620345
-v 6.114139 0.004669 -3.057069
-v 6.550863 1.708463 -2.620345
-v 6.114139 1.708463 -2.183620
-v 3.930518 0.024807 -0.873448
-v 4.367242 0.208845 -1.310173
-v 4.803966 0.000227 -0.873448
-v 4.367242 0.083050 -0.436724
-v 5.677414 0.004896 -0.873448
-v 6.114139 1.708463 -1.310172
-v 6.550863 1.708464 -0.873448
-v 6.114139 0.010815 -0.436724
-v -6.534504 2.673244 0.987780
-v -6.181068 2.609604 0.636822
-v -5.830884 2.629829 0.987782
-v -6.226498 2.775703 1.358241
-v -4.803965 2.362328 0.873447
-v -4.367241 1.344501 0.436723
-v -3.930517 0.228220 0.873447
-v -4.367241 0.812116 1.310171
-v -6.550863 0.103614 2.620343
-v -6.114139 1.399990 2.183619
-v -5.677414 0.104522 2.620343
-v -6.114139 0.010925 3.057068
-v -4.803966 0.403728 2.620343
-v -4.367242 0.403728 2.183619
-v -3.930518 0.403728 2.620344
-v -4.367242 0.001135 3.057068
-v -3.057069 0.083050 0.873447
-v -2.620345 0.083050 0.436723
-v -2.183620 0.000227 0.873447
-v -2.620345 0.006147 1.310171
-v -1.344090 1.512714 0.873447
-v -1.113103 2.544912 0.516608
-v -0.756264 2.544912 1.090278
-v -0.907365 1.512714 1.310171
-v -3.057069 0.046571 2.620344
-v -2.620345 0.139720 2.183620
-v -2.183620 0.045664 2.620344
-v -2.620345 0.006147 3.057068
-v -1.310172 0.000908 2.620344
-v -0.873541 0.004135 2.183620
-v -0.436724 0.000908 2.620344
-v -0.873448 0.403728 3.057069
-v -6.550863 1.400896 4.367240
-v -6.114139 2.759001 3.930516
-v -5.677414 2.759001 4.367240
-v -6.114139 2.356181 4.803965
-v -4.803966 1.236682 4.367241
-v -4.367242 0.115640 3.930517
-v -3.930518 0.083050 4.367241
-v -4.367242 0.001153 4.803965
-v -6.550863 1.440099 6.114137
-v -6.114159 2.362851 5.677413
-v -5.686990 2.650807 6.114124
-v -6.123663 2.742625 6.550848
-v -4.803966 1.398626 6.114138
-v -4.367242 0.004640 5.677413
-v -3.930518 0.006147 6.114138
-v -4.367242 0.103580 6.550862
-v -3.057069 0.403728 4.367241
-v -2.620345 0.403728 3.930517
-v -2.183621 0.403728 4.367241
-v -2.620345 0.403728 4.803965
-v -1.310172 0.000908 4.367241
-v -0.873448 0.403728 3.930517
-v -0.436724 0.000908 4.367241
-v -0.873448 0.000908 4.803965
-v -3.057069 0.139720 6.114138
-v -2.620345 0.045664 5.677413
-v -2.183621 0.007055 6.114138
-v -2.620345 0.045664 6.550862
-v -1.310173 0.403728 6.114138
-v -0.873448 0.403728 5.677413
-v -0.436724 0.000908 6.114138
-v -0.873448 0.000908 6.550862
-v 0.398472 2.432356 1.130498
-v 0.954318 2.432356 0.574653
-v 1.253112 2.544912 0.873448
-v 0.816388 2.544912 1.310172
-v 2.164972 0.831735 0.873448
-v 2.617835 0.111957 0.436724
-v 3.057069 0.000000 0.873448
-v 2.620345 0.000000 1.310172
-v 0.436724 0.000000 2.620344
-v 0.870938 0.111957 2.183620
-v 1.310173 0.000000 2.620344
-v 0.873448 0.000000 3.057069
-v 2.183621 0.000000 2.620345
-v 2.620345 0.000000 2.183620
-v 3.057069 0.000000 2.620345
-v 2.620345 0.000908 3.057069
-v 3.930518 0.208845 0.873448
-v 4.367242 0.107494 0.436724
-v 4.803966 0.208845 0.873448
-v 4.367242 0.698598 1.310172
-v 5.677414 0.045664 0.873448
-v 6.114139 0.139720 0.436724
-v 6.550863 0.045664 0.873449
-v 6.114139 0.007055 1.310173
-v 3.930518 0.000000 2.620345
-v 4.367242 0.024587 2.183621
-v 4.803966 0.000908 2.620345
-v 4.367242 0.000908 3.057069
-v 5.677414 0.403728 2.620345
-v 6.114139 0.403728 2.183621
-v 6.550863 0.000908 2.620345
-v 6.114139 0.000908 3.057069
-v 0.436724 0.000000 4.367241
-v 0.873448 0.000000 3.930517
-v 1.310173 0.000908 4.367241
-v 0.873448 0.024587 4.803965
-v 2.183621 0.403728 4.367241
-v 2.620345 0.403728 3.930517
-v 3.057069 0.000908 4.367241
-v 2.620345 0.007055 4.803965
-v 0.436724 0.208845 6.114138
-v 0.873448 0.698598 5.677413
-v 1.310173 0.208845 6.114138
-v 0.873448 0.024587 6.550862
-v 2.183621 0.083051 6.114138
-v 2.620345 0.139720 5.677413
-v 3.057069 0.083051 6.114138
-v 2.620345 0.083051 6.550862
-v 3.930518 0.000908 4.367242
-v 4.367242 0.403728 3.930518
-v 4.803966 0.403728 4.367242
-v 4.367242 0.000908 4.803966
-v 5.677414 0.000908 4.367242
-v 6.114139 0.000000 3.930518
-v 6.550863 0.000000 4.367242
-v 6.114139 0.000227 4.803966
-v 3.930518 0.139720 6.114139
-v 4.367242 0.045664 5.677414
-v 4.803966 0.006147 6.114139
-v 4.367242 0.045664 6.550863
-v 5.677414 0.083051 6.114139
-v 6.114139 0.083051 5.677414
-v 6.550863 0.000227 6.114139
-v 6.114139 0.083051 6.550863
-v -6.550860 0.006146 -6.550865
-v -5.677413 0.939365 -6.550864
-v -6.550861 0.139719 -5.677417
-v -5.677413 1.708463 -5.677416
-v -4.803965 1.708463 -6.550864
-v -3.930516 0.939364 -6.550864
-v -4.803965 2.874231 -5.677416
-v -3.930516 1.708463 -5.677416
-v -6.550861 0.006146 -4.803968
-v -5.677413 0.939364 -4.803968
-v -6.550861 0.126444 -3.930520
-v -5.677413 -0.000000 -3.930519
-v -4.803965 1.708463 -4.803967
-v -3.930516 1.708463 -4.803967
-v -4.803965 0.126444 -3.930519
-v -3.930516 3.832309 -3.930520
-v -3.057068 0.004669 -6.550864
-v -2.183619 1.708463 -6.550864
-v -3.057068 1.708463 -5.677416
-v -2.183619 2.874231 -5.677416
-v -1.310171 0.939364 -6.550864
-v -0.436723 2.874231 -6.550864
-v -1.310171 1.708464 -5.677416
-v -0.436723 0.705282 -5.677415
-v -3.057068 1.897641 -4.803967
-v -2.183620 1.897641 -4.803967
-v -3.057068 3.832309 -3.930520
-v -2.183620 0.705283 -3.930519
-v -1.310171 1.518201 -4.803967
-v -0.436723 0.578838 -4.803967
-v -1.310171 0.578838 -3.930518
-v -0.436723 0.578838 -3.930518
-v -6.550861 3.832309 -3.057071
-v -5.677413 0.126444 -3.057071
-v -6.550861 3.832309 -2.183623
-v -5.677413 0.126446 -2.183623
-v -4.803965 -0.000000 -3.057071
-v -3.930516 0.939365 -3.057071
-v -4.803965 0.006147 -2.183623
-v -3.930517 0.025464 -2.183623
-v -6.550862 0.216277 -1.310175
-v -5.677413 0.076405 -1.310174
-v -6.550862 2.355273 -0.436726
-v -5.677413 2.564118 -0.436726
-v -4.803965 0.139720 -1.310174
-v -3.930517 0.007087 -1.310174
-v -4.803965 1.463332 -0.436726
-v -3.930517 -0.000000 -0.436726
-v -3.057068 1.128541 -3.057071
-v -2.183620 0.661888 -3.057071
-v -3.057069 0.579065 -2.183623
-v -2.183620 0.661888 -2.183622
-v -1.310172 0.579065 -3.057070
-v -0.436723 0.578838 -3.057070
-v -1.310172 0.579065 -2.183622
-v -0.455372 1.410573 -2.183622
-v -3.057069 0.344065 -1.310174
-v -2.183620 0.578838 -1.310174
-v -3.057069 0.007087 -0.436726
-v -2.186130 0.134744 -0.436725
-v -1.328821 0.840480 -1.310174
-v -0.493784 2.544912 -1.310174
-v -1.367233 2.544912 -0.436725
-v -0.773215 2.430153 -0.567038
-v 0.436725 2.874231 -6.550863
-v 1.310174 1.708463 -6.550863
-v 0.436725 0.705283 -5.677415
-v 1.310174 3.832309 -5.677415
-v 2.183622 0.939364 -6.550863
-v 3.057070 -0.000000 -6.550863
-v 2.183622 3.832309 -5.677414
-v 3.057070 0.126444 -5.677414
-v 0.436725 0.583508 -4.803967
-v 1.310173 1.708463 -4.803967
-v 0.436725 0.344065 -3.930518
-v 1.310173 0.000940 -3.930518
-v 2.183622 1.708463 -4.803966
-v 3.057070 0.126444 -4.803966
-v 2.183622 0.000908 -3.930518
-v 3.057070 0.005576 -3.930518
-v 3.930518 0.403727 -6.550863
-v 4.803967 0.403727 -6.550863
-v 3.930518 0.126833 -5.677414
-v 4.803967 0.126833 -5.677414
-v 5.677414 0.126444 -6.550863
-v 6.550863 3.832309 -6.550863
-v 5.677414 -0.000000 -5.677414
-v 6.550863 0.939365 -5.677414
-v 3.930518 2.874231 -4.803966
-v 4.803967 2.874231 -4.803966
-v 3.930518 1.708465 -3.930518
-v 4.803966 1.708463 -3.930518
-v 5.677414 0.126445 -4.803966
-v 6.550863 -0.000000 -4.803966
-v 5.677414 0.004669 -3.930518
-v 6.550863 -0.000000 -3.930518
-v 0.436725 0.344065 -3.057070
-v 1.310173 -0.000000 -3.057070
-v 0.402807 1.512713 -2.183622
-v 1.307663 0.111957 -2.183621
-v 2.183621 0.403727 -3.057070
-v 3.057070 0.403728 -3.057069
-v 2.183621 0.000908 -2.183621
-v 3.057069 0.000908 -2.183621
-v 0.630731 2.544912 -1.515592
-v 1.218876 2.544912 -1.150403
-v 0.499279 2.458198 -0.857565
-v 1.510163 2.544912 -0.537037
-v 2.164973 0.831735 -1.310173
-v 3.057069 0.000908 -1.310173
-v 2.149704 1.512715 -0.436725
-v 3.057069 -0.000000 -0.436724
-v 3.930518 0.004669 -3.057069
-v 4.803966 0.004669 -3.057069
-v 3.930518 0.403728 -2.183621
-v 4.803966 0.000908 -2.183621
-v 5.677414 -0.000000 -3.057069
-v 6.550863 0.126444 -3.057069
-v 5.677414 0.126444 -2.183620
-v 6.550863 3.832309 -2.183621
-v 3.930518 0.403728 -1.310173
-v 4.803966 0.000908 -1.310172
-v 3.930518 0.045663 -0.436724
-v 4.803966 0.045664 -0.436724
-v 5.677414 0.126444 -1.310172
-v 6.550863 3.832309 -1.310172
-v 5.677414 0.045664 -0.436724
-v 6.550863 0.126542 -0.436724
-v -6.540550 2.495842 0.546743
-v -5.747336 2.618095 0.530666
-v -6.518938 2.775703 1.358241
-v -5.831053 2.633462 1.338743
-v -4.803965 2.564118 0.436722
-v -3.930517 0.173019 0.436723
-v -4.803965 1.423544 1.310171
-v -3.930517 0.109832 1.310171
-v -6.550863 1.399990 2.183619
-v -5.677414 1.422347 2.183619
-v -6.550863 0.000000 3.057068
-v -5.677414 0.024587 3.057068
-v -4.803966 0.698598 2.183619
-v -3.930518 0.698598 2.183620
-v -4.803966 0.024586 3.057068
-v -3.930518 0.030701 3.057068
-v -3.057069 0.139720 0.436723
-v -2.183713 0.010289 0.436723
-v -3.057069 0.006147 1.310171
-v -2.183620 0.000227 1.310171
-v -1.344089 1.512713 0.436723
-v -0.713218 2.432356 0.574653
-v -1.328821 0.831735 1.310171
-v -0.493785 2.544912 1.310171
-v -3.057069 0.107494 2.183620
-v -2.183620 0.083050 2.183620
-v -3.057069 0.000227 3.057068
-v -2.183620 0.000227 3.057068
-v -1.310172 0.000000 2.183620
-v -0.439234 0.111957 2.183620
-v -1.310172 0.208845 3.057069
-v -0.436724 0.208845 3.057069
-v -6.550863 0.927723 3.930516
-v -5.677414 3.053871 3.930516
-v -6.550863 2.355273 4.803965
-v -5.677414 2.564118 4.803965
-v -4.803966 0.947605 3.930517
-v -3.930518 0.139720 3.930517
-v -4.803966 0.978601 4.803965
-v -3.930518 0.006147 4.803965
-v -6.550863 2.355500 5.677413
-v -5.677414 1.506774 5.677413
-v -6.550863 1.470303 6.550861
-v -5.693586 2.858753 6.550838
-v -4.803966 0.890325 5.677413
-v -3.930518 0.000227 5.677413
-v -4.803967 1.399841 6.550862
-v -3.930518 0.000227 6.550862
-v -3.057069 0.208845 3.930517
-v -2.183621 0.208845 3.930517
-v -3.057069 0.208845 4.803965
-v -2.183621 0.208845 4.803965
-v -1.310172 0.208845 3.930517
-v -0.436724 0.208845 3.930517
-v -1.310172 0.024587 4.803965
-v -0.436724 0.000000 4.803965
-v -3.057069 0.083051 5.677413
-v -2.183621 0.024808 5.677413
-v -3.057069 0.083051 6.550862
-v -2.183621 0.000227 6.550862
-v -1.310173 0.698598 5.677413
-v -0.436724 0.024587 5.677413
-v -1.310173 0.024587 6.550862
-v -0.436724 0.000000 6.550862
-v 0.623388 2.443964 0.799658
-v 1.412882 2.544912 0.630730
-v 0.379664 2.544912 1.447117
-v 1.276255 1.512713 1.310172
-v 2.149704 1.512715 0.436724
-v 3.057069 0.000000 0.436724
-v 2.183528 0.004135 1.310172
-v 3.057069 0.000000 1.310172
-v 0.434214 0.111957 2.183620
-v 1.310080 0.004135 2.183620
-v 0.436724 0.000000 3.057069
-v 1.310173 0.000000 3.057069
-v 2.183621 0.000000 2.183620
-v 3.057069 0.000000 2.183620
-v 2.183621 0.024587 3.057069
-v 3.057069 0.000000 3.057069
-v 3.930518 0.046571 0.436724
-v 4.803966 0.046571 0.436724
-v 3.930518 0.403728 1.310172
-v 4.803966 0.403728 1.310172
-v 5.677414 0.083050 0.436724
-v 6.550863 0.083050 0.436724
-v 5.677414 0.024808 1.310173
-v 6.550863 0.000227 1.310173
-v 3.930518 0.000908 2.183620
-v 4.803966 0.024587 2.183621
-v 3.930518 0.000000 3.057069
-v 4.803966 0.024586 3.057069
-v 5.677414 0.698598 2.183621
-v 6.550863 0.024587 2.183621
-v 5.677414 0.024587 3.057069
-v 6.550863 0.000000 3.057069
-v 0.436724 0.000000 3.930517
-v 1.310173 0.024587 3.930517
-v 0.436724 0.000908 4.803965
-v 1.310173 0.000908 4.803965
-v 2.183621 0.698598 3.930517
-v 3.057069 0.024587 3.930517
-v 2.183621 0.024808 4.803965
-v 3.057069 0.000227 4.803965
-v 0.436724 0.403728 5.677413
-v 1.310173 0.403728 5.677413
-v 0.436724 0.000908 6.550862
-v 1.310173 0.007055 6.550862
-v 2.183621 0.083051 5.677413
-v 3.057069 0.083051 5.677413
-v 2.183621 0.139720 6.550862
-v 3.057069 0.045664 6.550862
-v 3.930518 0.024587 3.930518
-v 4.803966 0.698598 3.930518
-v 3.930518 0.000000 4.803966
-v 4.803966 0.024587 4.803966
-v 5.677414 0.024587 3.930518
-v 6.550863 0.000000 3.930518
-v 5.677414 0.006147 4.803966
-v 6.550863 0.000000 4.803966
-v 3.930518 0.083051 5.677414
-v 4.803966 0.006147 5.677414
-v 3.930518 0.083051 6.550863
-v 4.803966 0.006147 6.550863
-v 5.677414 0.139720 5.677414
-v 6.550863 0.006147 5.677414
-v 5.677414 0.139720 6.550863
-v 6.550863 0.006147 6.550863
-vt 0.768135 0.151324
-vt 0.783578 0.148244
-vt 0.786659 0.163685
-vt 0.771198 0.167011
-vt 0.752526 0.153969
-vt 0.755118 0.170347
-vt 0.790009 0.178902
-vt 0.774841 0.182990
-vt 0.758981 0.187852
-vt 0.736332 0.156032
-vt 0.725357 0.187537
-vt 0.719772 0.155087
-vt 0.708329 0.198465
-vt 0.716635 0.206241
-vt 0.703224 0.211572
-vt 0.794012 0.193435
-vt 0.779274 0.198341
-vt 0.763826 0.203218
-vt 0.799460 0.207349
-vt 0.784804 0.213538
-vt 0.768415 0.219160
-vt 0.718900 0.214115
-vt 0.703275 0.214998
-vt 0.719414 0.222385
-vt 0.702918 0.218320
-vt 0.705564 0.152963
-vt 0.700738 0.196569
-vt 0.691435 0.152598
-vt 0.693181 0.196561
-vt 0.699904 0.211375
-vt 0.696790 0.211468
-vt 0.675662 0.149588
-vt 0.678894 0.182395
-vt 0.660606 0.143996
-vt 0.654927 0.159286
-vt 0.682270 0.203449
-vt 0.648463 0.174212
-vt 0.699708 0.214889
-vt 0.696074 0.214626
-vt 0.699554 0.218534
-vt 0.695816 0.218318
-vt 0.677857 0.211179
-vt 0.645800 0.187778
-vt 0.674162 0.222564
-vt 0.644990 0.196843
-vt 0.806486 0.221034
-vt 0.792095 0.229092
-vt 0.775815 0.237235
-vt 0.815294 0.234143
-vt 0.801091 0.244771
-vt 0.784770 0.254434
-vt 0.737139 0.237037
-vt 0.711791 0.235185
-vt 0.766965 0.263360
-vt 0.749516 0.271171
-vt 0.826515 0.246999
-vt 0.813564 0.260577
-vt 0.795380 0.273266
-vt 0.884726 0.281908
-vt 0.877797 0.297551
-vt 0.838017 0.302293
-vt 0.775331 0.282307
-vt 0.755925 0.289015
-vt 0.783112 0.303959
-vt 0.760532 0.309465
-vt 0.700567 0.242849
-vt 0.686182 0.241770
-vt 0.735583 0.276931
-vt 0.684296 0.258305
-vt 0.670404 0.239039
-vt 0.655811 0.237002
-vt 0.653726 0.269001
-vt 0.653773 0.268977
-vt 0.736856 0.292247
-vt 0.682507 0.271537
-vt 0.738898 0.312656
-vt 0.697752 0.296784
-vt 0.653689 0.268938
-vt 0.653751 0.268921
-vt 0.672089 0.285599
-vt 0.653733 0.268856
-vt 0.645087 0.138549
-vt 0.640674 0.153560
-vt 0.628762 0.134354
-vt 0.608159 0.162873
-vt 0.618172 0.178233
-vt 0.595463 0.182431
-vt 0.612772 0.128539
-vt 0.585246 0.172281
-vt 0.599869 0.120779
-vt 0.574371 0.168746
-vt 0.580436 0.190823
-vt 0.577099 0.190725
-vt 0.600892 0.195570
-vt 0.583231 0.194448
-vt 0.625819 0.211822
-vt 0.594433 0.207943
-vt 0.580026 0.194254
-vt 0.576350 0.193996
-vt 0.580007 0.197651
-vt 0.576580 0.197743
-vt 0.588177 0.112571
-vt 0.568467 0.140096
-vt 0.530178 0.131816
-vt 0.527669 0.151209
-vt 0.548929 0.175075
-vt 0.517851 0.187597
-vt 0.496356 0.110648
-vt 0.492169 0.121882
-vt 0.481635 0.107604
-vt 0.481053 0.121311
-vt 0.498667 0.161107
-vt 0.480643 0.162646
-vt 0.551110 0.192058
-vt 0.516647 0.203900
-vt 0.554721 0.204405
-vt 0.519141 0.219780
-vt 0.500655 0.203942
-vt 0.484425 0.204285
-vt 0.500891 0.221860
-vt 0.483339 0.221402
-vt 0.645351 0.245730
-vt 0.607457 0.235882
-vt 0.653815 0.268953
-vt 0.642211 0.264626
-vt 0.581028 0.213199
-vt 0.569403 0.216444
-vt 0.586471 0.259125
-vt 0.566498 0.258984
-vt 0.653809 0.268912
-vt 0.642275 0.271232
-vt 0.644219 0.284444
-vt 0.629461 0.287227
-vt 0.587842 0.278459
-vt 0.566157 0.280583
-vt 0.589190 0.301253
-vt 0.567008 0.302299
-vt 0.555127 0.219729
-vt 0.521415 0.239484
-vt 0.544141 0.259530
-vt 0.522550 0.260276
-vt 0.501377 0.240352
-vt 0.481829 0.239885
-vt 0.501508 0.260594
-vt 0.480870 0.260149
-vt 0.544684 0.281197
-vt 0.522937 0.281636
-vt 0.545122 0.302938
-vt 0.523193 0.303384
-vt 0.501400 0.281750
-vt 0.479844 0.281412
-vt 0.501259 0.303526
-vt 0.479391 0.303137
-vt 0.959946 0.305952
-vt 0.947511 0.317477
-vt 0.873383 0.324766
-vt 0.969956 0.326569
-vt 0.950628 0.330188
-vt 0.875246 0.342662
-vt 0.789199 0.329052
-vt 0.764090 0.332216
-vt 0.791545 0.353696
-vt 0.766090 0.355981
-vt 0.969753 0.350177
-vt 0.950772 0.344100
-vt 0.878660 0.360450
-vt 0.903246 0.397894
-vt 0.891437 0.385202
-vt 0.850104 0.392994
-vt 0.794080 0.378752
-vt 0.767581 0.380782
-vt 0.793615 0.405614
-vt 0.767995 0.406296
-vt 0.741106 0.334539
-vt 0.719527 0.335629
-vt 0.742305 0.357421
-vt 0.719263 0.357612
-vt 0.679911 0.313284
-vt 0.657620 0.293450
-vt 0.696835 0.356378
-vt 0.665247 0.349253
-vt 0.742580 0.381379
-vt 0.718280 0.380757
-vt 0.742278 0.406984
-vt 0.716686 0.405531
-vt 0.694473 0.379007
-vt 0.664818 0.374568
-vt 0.691701 0.403109
-vt 0.661636 0.398499
-vt 0.859433 0.453738
-vt 0.838887 0.443000
-vt 0.816957 0.432696
-vt 0.848911 0.482675
-vt 0.825737 0.500044
-vt 0.809003 0.497792
-vt 0.792983 0.430610
-vt 0.768647 0.432311
-vt 0.792210 0.491518
-vt 0.773793 0.486911
-vt 0.846503 0.511890
-vt 0.820798 0.530981
-vt 0.808908 0.532244
-vt 0.856142 0.526280
-vt 0.824277 0.543278
-vt 0.811387 0.545451
-vt 0.796635 0.535804
-vt 0.787139 0.539030
-vt 0.796326 0.546984
-vt 0.786857 0.546588
-vt 0.741910 0.434036
-vt 0.714591 0.431097
-vt 0.746224 0.471752
-vt 0.710717 0.455814
-vt 0.688807 0.428105
-vt 0.662134 0.424063
-vt 0.686112 0.453014
-vt 0.661819 0.450382
-vt 0.759980 0.513790
-vt 0.714732 0.486282
-vt 0.779350 0.545507
-vt 0.725986 0.518727
-vt 0.683030 0.477649
-vt 0.658964 0.474214
-vt 0.678511 0.500985
-vt 0.655518 0.497783
-vt 0.640018 0.311409
-vt 0.612320 0.323624
-vt 0.639509 0.345875
-vt 0.613565 0.346513
-vt 0.589956 0.324203
-vt 0.567740 0.324544
-vt 0.590442 0.346640
-vt 0.568259 0.346699
-vt 0.637300 0.371200
-vt 0.613357 0.369975
-vt 0.635245 0.394766
-vt 0.612236 0.393343
-vt 0.590318 0.369189
-vt 0.567981 0.368697
-vt 0.589464 0.392328
-vt 0.566932 0.390491
-vt 0.545595 0.324925
-vt 0.523489 0.325428
-vt 0.546073 0.346845
-vt 0.524139 0.347512
-vt 0.501096 0.325778
-vt 0.478307 0.325493
-vt 0.501236 0.348876
-vt 0.477452 0.349402
-vt 0.546366 0.368394
-vt 0.525411 0.368683
-vt 0.546114 0.389120
-vt 0.520749 0.395497
-vt 0.493203 0.390441
-vt 0.476470 0.396780
-vt 0.487760 0.416015
-vt 0.473285 0.422740
-vt 0.636991 0.421033
-vt 0.611150 0.416181
-vt 0.636351 0.445890
-vt 0.612148 0.442078
-vt 0.587222 0.416368
-vt 0.564680 0.411778
-vt 0.589521 0.443144
-vt 0.557764 0.436185
-vt 0.635485 0.471281
-vt 0.612981 0.469337
-vt 0.632400 0.494583
-vt 0.609988 0.491005
-vt 0.591523 0.466398
-vt 0.530300 0.455761
-vt 0.587845 0.487424
-vt 0.528240 0.470048
-vt 0.542323 0.411371
-vt 0.508497 0.422028
-vt 0.524125 0.436095
-vt 0.494594 0.442492
-vt 0.484345 0.432425
-vt 0.480559 0.428052
-vt 0.488738 0.437964
-vt 0.478014 0.433977
-vt 0.499978 0.454605
-vt 0.496826 0.449604
-vt 0.499040 0.460978
-vt 0.494966 0.467616
-vt 0.487468 0.450091
-vt 0.481504 0.442415
-vt 0.488612 0.462255
-vt 0.472851 0.461234
-vt 0.466267 0.108550
-vt 0.469787 0.121687
-vt 0.432136 0.131229
-vt 0.437675 0.146927
-vt 0.461887 0.163866
-vt 0.441532 0.165751
-vt 0.380660 0.103455
-vt 0.419632 0.150869
-vt 0.368598 0.113595
-vt 0.405725 0.155399
-vt 0.409648 0.181997
-vt 0.409788 0.181925
-vt 0.470013 0.202994
-vt 0.442760 0.181671
-vt 0.465403 0.218022
-vt 0.436479 0.193593
-vt 0.409579 0.181792
-vt 0.409761 0.181777
-vt 0.409581 0.181606
-vt 0.409764 0.181597
-vt 0.353329 0.121440
-vt 0.377837 0.148397
-vt 0.337201 0.125758
-vt 0.341181 0.142010
-vt 0.393621 0.167749
-vt 0.368488 0.166960
-vt 0.321274 0.129451
-vt 0.324459 0.146081
-vt 0.305543 0.132088
-vt 0.307272 0.148416
-vt 0.327685 0.164588
-vt 0.308826 0.166177
-vt 0.409910 0.181790
-vt 0.388729 0.181248
-vt 0.409962 0.181650
-vt 0.390652 0.190330
-vt 0.329637 0.185787
-vt 0.308988 0.184874
-vt 0.330411 0.206780
-vt 0.294962 0.220680
-vt 0.461323 0.238084
-vt 0.439046 0.226328
-vt 0.460297 0.258864
-vt 0.436407 0.258992
-vt 0.419902 0.204400
-vt 0.410196 0.204381
-vt 0.415780 0.262028
-vt 0.397641 0.259825
-vt 0.455746 0.281451
-vt 0.434479 0.280881
-vt 0.455211 0.302075
-vt 0.430592 0.301120
-vt 0.413541 0.281006
-vt 0.394913 0.278920
-vt 0.411833 0.299692
-vt 0.392858 0.297999
-vt 0.400836 0.201429
-vt 0.376624 0.213045
-vt 0.379491 0.255677
-vt 0.358170 0.252585
-vt 0.338217 0.228507
-vt 0.283545 0.237181
-vt 0.336817 0.248823
-vt 0.283784 0.243404
-vt 0.375564 0.276181
-vt 0.355417 0.273331
-vt 0.372037 0.297283
-vt 0.352981 0.298297
-vt 0.334441 0.271356
-vt 0.296030 0.258009
-vt 0.333935 0.294145
-vt 0.312751 0.291760
-vt 0.288716 0.133639
-vt 0.286576 0.149492
-vt 0.272274 0.134674
-vt 0.272398 0.149583
-vt 0.289565 0.166184
-vt 0.272499 0.164431
-vt 0.255927 0.134023
-vt 0.258263 0.149700
-vt 0.239401 0.132598
-vt 0.237430 0.148952
-vt 0.255512 0.166256
-vt 0.236264 0.166375
-vt 0.289393 0.183886
-vt 0.272573 0.182858
-vt 0.277646 0.230134
-vt 0.271757 0.228862
-vt 0.255881 0.183775
-vt 0.236482 0.184806
-vt 0.265819 0.229619
-vt 0.249942 0.219434
-vt 0.223817 0.129985
-vt 0.219655 0.146117
-vt 0.169811 0.105387
-vt 0.162780 0.118632
-vt 0.217428 0.165283
-vt 0.178942 0.147173
-vt 0.107989 0.069189
-vt 0.102538 0.082276
-vt 0.092876 0.064387
-vt 0.088712 0.079692
-vt 0.148319 0.135451
-vt 0.087176 0.095350
-vt 0.217101 0.184419
-vt 0.198610 0.183888
-vt 0.216155 0.203781
-vt 0.197436 0.202023
-vt 0.162508 0.164372
-vt 0.133904 0.150686
-vt 0.179617 0.200765
-vt 0.162605 0.201496
-vt 0.273019 0.239849
-vt 0.271199 0.239577
-vt 0.272881 0.241709
-vt 0.271031 0.241474
-vt 0.269341 0.239490
-vt 0.259272 0.235961
-vt 0.269160 0.241373
-vt 0.258411 0.241709
-vt 0.278629 0.250683
-vt 0.270887 0.243240
-vt 0.282367 0.269178
-vt 0.270139 0.254199
-vt 0.262353 0.249448
-vt 0.244773 0.253891
-vt 0.255976 0.266821
-vt 0.222718 0.283288
-vt 0.213609 0.223126
-vt 0.195477 0.219956
-vt 0.211419 0.239757
-vt 0.192961 0.237221
-vt 0.178500 0.217839
-vt 0.163217 0.216472
-vt 0.176082 0.234020
-vt 0.160844 0.230802
-vt 0.207796 0.259302
-vt 0.189115 0.255026
-vt 0.203178 0.279208
-vt 0.183614 0.273703
-vt 0.171970 0.250215
-vt 0.156784 0.245097
-vt 0.165836 0.266761
-vt 0.150781 0.259064
-vt 0.453635 0.322850
-vt 0.429155 0.319899
-vt 0.453260 0.344427
-vt 0.427336 0.337836
-vt 0.410422 0.318461
-vt 0.391573 0.317300
-vt 0.409331 0.336898
-vt 0.390537 0.336606
-vt 0.462283 0.391184
-vt 0.438599 0.372732
-vt 0.464404 0.423276
-vt 0.445000 0.400256
-vt 0.409797 0.355363
-vt 0.390375 0.356344
-vt 0.432306 0.403841
-vt 0.406347 0.391889
-vt 0.368010 0.315822
-vt 0.351782 0.314770
-vt 0.369604 0.334734
-vt 0.350772 0.331292
-vt 0.335147 0.313676
-vt 0.310152 0.311839
-vt 0.331159 0.333065
-vt 0.308524 0.333007
-vt 0.370246 0.356224
-vt 0.349857 0.356099
-vt 0.370121 0.376280
-vt 0.349693 0.376847
-vt 0.328933 0.355436
-vt 0.306046 0.355889
-vt 0.328503 0.376744
-vt 0.302600 0.376213
-vt 0.458951 0.426386
-vt 0.452541 0.428157
-vt 0.461480 0.431781
-vt 0.450491 0.435083
-vt 0.444026 0.433277
-vt 0.418314 0.417094
-vt 0.440883 0.438057
-vt 0.435496 0.442877
-vt 0.460251 0.441169
-vt 0.445135 0.442486
-vt 0.461130 0.460370
-vt 0.442766 0.462750
-vt 0.437543 0.446909
-vt 0.433560 0.448998
-vt 0.437088 0.459031
-vt 0.433634 0.458790
-vt 0.390714 0.409987
-vt 0.350007 0.398576
-vt 0.407179 0.432286
-vt 0.349644 0.420982
-vt 0.328097 0.398368
-vt 0.305139 0.396674
-vt 0.327670 0.419791
-vt 0.306346 0.419557
-vt 0.405164 0.445586
-vt 0.347895 0.441044
-vt 0.404362 0.458985
-vt 0.347741 0.460426
-vt 0.327094 0.440497
-vt 0.306436 0.440514
-vt 0.327196 0.460766
-vt 0.306868 0.461139
-vt 0.288547 0.309515
-vt 0.265968 0.306672
-vt 0.286593 0.331403
-vt 0.264243 0.330078
-vt 0.242931 0.305950
-vt 0.220334 0.304079
-vt 0.241303 0.328812
-vt 0.217757 0.327080
-vt 0.285351 0.357973
-vt 0.264368 0.354269
-vt 0.284916 0.375856
-vt 0.266812 0.375533
-vt 0.239932 0.351983
-vt 0.215925 0.351115
-vt 0.239176 0.375212
-vt 0.215515 0.375079
-vt 0.198233 0.300374
-vt 0.176457 0.294163
-vt 0.193312 0.323950
-vt 0.137669 0.329756
-vt 0.156303 0.284348
-vt 0.141767 0.272551
-vt 0.097467 0.330963
-vt 0.087167 0.315149
-vt 0.189937 0.350310
-vt 0.105913 0.356428
-vt 0.190321 0.375095
-vt 0.106855 0.376185
-vt 0.034466 0.363050
-vt 0.018196 0.355965
-vt 0.032732 0.376160
-vt 0.014591 0.376911
-vt 0.284678 0.393651
-vt 0.263805 0.396563
-vt 0.284837 0.419769
-vt 0.263035 0.419980
-vt 0.239607 0.398327
-vt 0.215898 0.399097
-vt 0.240755 0.421100
-vt 0.217731 0.422818
-vt 0.285378 0.441026
-vt 0.264093 0.442048
-vt 0.286064 0.461887
-vt 0.265412 0.463132
-vt 0.242487 0.443333
-vt 0.220671 0.445925
-vt 0.244552 0.464631
-vt 0.223868 0.467296
-vt 0.190329 0.399745
-vt 0.106211 0.393618
-vt 0.193529 0.425918
-vt 0.137865 0.420280
-vt 0.033832 0.388665
-vt 0.020448 0.397574
-vt 0.097953 0.419226
-vt 0.088775 0.433284
-vt 0.198412 0.449522
-vt 0.176337 0.455448
-vt 0.203375 0.470948
-vt 0.183658 0.476200
-vt 0.156125 0.465524
-vt 0.140935 0.476827
-vt 0.165550 0.483097
-vt 0.149645 0.491475
-vt 0.863642 0.540274
-vt 0.825987 0.563137
-vt 0.812562 0.566494
-vt 0.839146 0.579420
-vt 0.823160 0.580249
-vt 0.812022 0.581740
-vt 0.798803 0.561775
-vt 0.785547 0.555912
-vt 0.799437 0.576373
-vt 0.781163 0.570128
-vt 0.833357 0.595570
-vt 0.819467 0.593293
-vt 0.809966 0.590815
-vt 0.826451 0.606790
-vt 0.816442 0.602997
-vt 0.807387 0.599577
-vt 0.797206 0.587111
-vt 0.777351 0.582833
-vt 0.794793 0.597332
-vt 0.750133 0.608561
-vt 0.774581 0.554127
-vt 0.734815 0.542607
-vt 0.769025 0.565498
-vt 0.735552 0.560657
-vt 0.676387 0.526053
-vt 0.652077 0.521495
-vt 0.672522 0.550080
-vt 0.647407 0.544920
-vt 0.739607 0.585566
-vt 0.706637 0.579514
-vt 0.714521 0.609966
-vt 0.679696 0.601228
-vt 0.664732 0.573988
-vt 0.641715 0.567940
-vt 0.658256 0.600179
-vt 0.636832 0.591689
-vt 0.806836 0.656651
-vt 0.792224 0.649122
-vt 0.777502 0.640628
-vt 0.784126 0.704383
-vt 0.767716 0.698618
-vt 0.750293 0.691783
-vt 0.763123 0.630001
-vt 0.729513 0.638489
-vt 0.731985 0.683977
-vt 0.713913 0.673199
-vt 0.779382 0.720370
-vt 0.762010 0.716752
-vt 0.742992 0.710586
-vt 0.777512 0.736089
-vt 0.754662 0.741755
-vt 0.720117 0.765978
-vt 0.724187 0.703099
-vt 0.704184 0.695832
-vt 0.707897 0.762205
-vt 0.695033 0.759974
-vt 0.706733 0.631625
-vt 0.677548 0.626307
-vt 0.694762 0.657250
-vt 0.668741 0.652647
-vt 0.653686 0.620078
-vt 0.633735 0.614560
-vt 0.647389 0.640135
-vt 0.624345 0.635732
-vt 0.681669 0.687587
-vt 0.658326 0.677571
-vt 0.672806 0.718582
-vt 0.647909 0.699887
-vt 0.636424 0.667533
-vt 0.614650 0.658589
-vt 0.626540 0.689162
-vt 0.605866 0.679431
-vt 0.628729 0.517350
-vt 0.606260 0.513357
-vt 0.624487 0.540027
-vt 0.602102 0.535663
-vt 0.584015 0.509817
-vt 0.544441 0.494973
-vt 0.580320 0.531618
-vt 0.559674 0.527310
-vt 0.619233 0.562660
-vt 0.597307 0.557641
-vt 0.613999 0.584836
-vt 0.592094 0.579676
-vt 0.575655 0.552722
-vt 0.554373 0.547877
-vt 0.570675 0.574232
-vt 0.549491 0.569045
-vt 0.517987 0.485491
-vt 0.493205 0.474442
-vt 0.512353 0.497261
-vt 0.487259 0.481996
-vt 0.483545 0.474304
-vt 0.477591 0.479631
-vt 0.482221 0.484720
-vt 0.470705 0.484452
-vt 0.520450 0.524927
-vt 0.497352 0.509155
-vt 0.529129 0.564345
-vt 0.499478 0.537408
-vt 0.477650 0.488971
-vt 0.468244 0.491138
-vt 0.480488 0.517464
-vt 0.467171 0.517875
-vt 0.608431 0.607351
-vt 0.586519 0.601189
-vt 0.601355 0.629369
-vt 0.580225 0.622280
-vt 0.565409 0.595397
-vt 0.544311 0.589830
-vt 0.559396 0.616130
-vt 0.538790 0.610354
-vt 0.593752 0.650474
-vt 0.573389 0.643092
-vt 0.585973 0.670561
-vt 0.566306 0.662984
-vt 0.553103 0.636532
-vt 0.533128 0.630456
-vt 0.546719 0.656282
-vt 0.527456 0.650043
-vt 0.523673 0.584489
-vt 0.502615 0.578959
-vt 0.518483 0.604902
-vt 0.498268 0.599821
-vt 0.481038 0.575304
-vt 0.461607 0.573225
-vt 0.478160 0.596099
-vt 0.458539 0.592912
-vt 0.511796 0.625806
-vt 0.492804 0.623756
-vt 0.504354 0.643299
-vt 0.488966 0.639303
-vt 0.475242 0.617167
-vt 0.455170 0.612006
-vt 0.473783 0.635603
-vt 0.451344 0.630756
-vt 0.781894 0.751294
-vt 0.748154 0.768270
-vt 0.706202 0.791022
-vt 0.767345 0.781136
-vt 0.741683 0.788993
-vt 0.708524 0.799718
-vt 0.701025 0.790101
-vt 0.696660 0.788152
-vt 0.698890 0.796411
-vt 0.691706 0.792626
-vt 0.754676 0.806035
-vt 0.718626 0.816104
-vt 0.704870 0.812208
-vt 0.729861 0.835917
-vt 0.713693 0.832114
-vt 0.696669 0.826046
-vt 0.694152 0.805109
-vt 0.669249 0.794119
-vt 0.667265 0.813980
-vt 0.642675 0.799794
-vt 0.668292 0.751066
-vt 0.635777 0.720978
-vt 0.664117 0.769694
-vt 0.623430 0.739393
-vt 0.616110 0.709469
-vt 0.596483 0.699356
-vt 0.605383 0.728085
-vt 0.587352 0.718301
-vt 0.647411 0.777786
-vt 0.610599 0.755582
-vt 0.620401 0.784425
-vt 0.600828 0.771304
-vt 0.594789 0.745515
-vt 0.578120 0.736195
-vt 0.585231 0.761647
-vt 0.569236 0.752671
-vt 0.745399 0.872423
-vt 0.708757 0.849743
-vt 0.689380 0.844190
-vt 0.754665 0.900114
-vt 0.727403 0.886807
-vt 0.684582 0.865143
-vt 0.658926 0.825398
-vt 0.642759 0.819875
-vt 0.668939 0.862068
-vt 0.654242 0.858897
-vt 0.767603 0.928885
-vt 0.719026 0.900933
-vt 0.677036 0.879392
-vt 0.763076 0.945294
-vt 0.732120 0.930249
-vt 0.701267 0.919302
-vt 0.665190 0.876495
-vt 0.650876 0.871961
-vt 0.659985 0.892812
-vt 0.641974 0.885313
-vt 0.621898 0.810056
-vt 0.591143 0.786164
-vt 0.624892 0.835169
-vt 0.582691 0.802178
-vt 0.576105 0.777238
-vt 0.560567 0.768563
-vt 0.567365 0.792505
-vt 0.552116 0.783791
-vt 0.614825 0.848292
-vt 0.572969 0.816512
-vt 0.605529 0.861532
-vt 0.563608 0.830289
-vt 0.558370 0.807141
-vt 0.543969 0.798545
-vt 0.549592 0.821167
-vt 0.535840 0.812772
-vt 0.576638 0.691107
-vt 0.557433 0.686297
-vt 0.566278 0.708025
-vt 0.551153 0.701542
-vt 0.540630 0.677018
-vt 0.521196 0.668861
-vt 0.536230 0.695434
-vt 0.514782 0.686941
-vt 0.560536 0.725879
-vt 0.544950 0.716206
-vt 0.553006 0.744194
-vt 0.536499 0.736856
-vt 0.526754 0.711718
-vt 0.508421 0.703612
-vt 0.520409 0.730466
-vt 0.502975 0.722358
-vt 0.501797 0.661546
-vt 0.485126 0.654327
-vt 0.497063 0.681037
-vt 0.479275 0.676023
-vt 0.467310 0.652397
-vt 0.447703 0.649148
-vt 0.461539 0.671281
-vt 0.443786 0.667104
-vt 0.491763 0.698538
-vt 0.474489 0.693592
-vt 0.485626 0.719174
-vt 0.470331 0.712096
-vt 0.457124 0.688925
-vt 0.439768 0.684682
-vt 0.452690 0.706029
-vt 0.435754 0.701811
-vt 0.544912 0.760510
-vt 0.529244 0.752853
-vt 0.537118 0.775862
-vt 0.522073 0.768407
-vt 0.513570 0.745894
-vt 0.494417 0.737669
-vt 0.506560 0.761323
-vt 0.490525 0.753522
-vt 0.529531 0.790563
-vt 0.514835 0.783338
-vt 0.521941 0.805003
-vt 0.507771 0.797891
-vt 0.499909 0.776532
-vt 0.484914 0.770222
-vt 0.493380 0.791263
-vt 0.478897 0.785035
-vt 0.480991 0.732869
-vt 0.467737 0.728457
-vt 0.476443 0.745892
-vt 0.460808 0.742939
-vt 0.448045 0.722593
-vt 0.431762 0.718434
-vt 0.443547 0.738814
-vt 0.427566 0.734526
-vt 0.469740 0.764574
-vt 0.454505 0.759218
-vt 0.464360 0.779398
-vt 0.449632 0.774369
-vt 0.439081 0.754509
-vt 0.423539 0.750306
-vt 0.434641 0.769825
-vt 0.419553 0.765644
-vt 0.455353 0.476460
-vt 0.448803 0.471378
-vt 0.459464 0.483576
-vt 0.446759 0.481768
-vt 0.439341 0.472086
-vt 0.435932 0.467710
-vt 0.441719 0.477604
-vt 0.414907 0.488037
-vt 0.459202 0.490514
-vt 0.450385 0.486859
-vt 0.454064 0.516373
-vt 0.441192 0.513374
-vt 0.426802 0.501840
-vt 0.401696 0.511198
-vt 0.417931 0.527294
-vt 0.384015 0.543627
-vt 0.405347 0.472335
-vt 0.348951 0.480093
-vt 0.387953 0.492883
-vt 0.348578 0.501565
-vt 0.327812 0.480896
-vt 0.307522 0.481420
-vt 0.328022 0.501180
-vt 0.308054 0.501367
-vt 0.366411 0.523629
-vt 0.347317 0.521997
-vt 0.365212 0.542502
-vt 0.346263 0.541355
-vt 0.327693 0.521186
-vt 0.308262 0.521017
-vt 0.327147 0.540572
-vt 0.308056 0.540259
-vt 0.442940 0.570352
-vt 0.424218 0.566377
-vt 0.439478 0.589703
-vt 0.420522 0.586373
-vt 0.403309 0.563786
-vt 0.383284 0.562533
-vt 0.401164 0.583684
-vt 0.381820 0.581723
-vt 0.436266 0.608617
-vt 0.417528 0.605464
-vt 0.432961 0.627211
-vt 0.414575 0.624071
-vt 0.398706 0.602769
-vt 0.379969 0.600554
-vt 0.396205 0.621314
-vt 0.376665 0.619964
-vt 0.364196 0.561367
-vt 0.345344 0.560307
-vt 0.362973 0.580159
-vt 0.344363 0.578981
-vt 0.326559 0.559526
-vt 0.307893 0.559051
-vt 0.325877 0.578097
-vt 0.307559 0.577514
-vt 0.361492 0.598612
-vt 0.343198 0.597376
-vt 0.359446 0.620508
-vt 0.342862 0.616647
-vt 0.325070 0.596310
-vt 0.307057 0.595567
-vt 0.324046 0.614203
-vt 0.306376 0.613284
-vt 0.287274 0.482217
-vt 0.266831 0.483507
-vt 0.287018 0.502776
-vt 0.268266 0.505840
-vt 0.246507 0.485063
-vt 0.226820 0.487157
-vt 0.249513 0.505059
-vt 0.229486 0.506366
-vt 0.284864 0.521342
-vt 0.269141 0.522012
-vt 0.287870 0.539278
-vt 0.269937 0.537568
-vt 0.253527 0.522963
-vt 0.231512 0.524378
-vt 0.251998 0.541350
-vt 0.234222 0.543317
-vt 0.207664 0.490530
-vt 0.189154 0.494989
-vt 0.211211 0.509049
-vt 0.193475 0.512460
-vt 0.172038 0.500115
-vt 0.156248 0.505833
-vt 0.176687 0.516636
-vt 0.160815 0.520939
-vt 0.214089 0.526728
-vt 0.196964 0.529841
-vt 0.217235 0.547710
-vt 0.200808 0.547611
-vt 0.180310 0.533042
-vt 0.164393 0.536367
-vt 0.183149 0.549232
-vt 0.167342 0.551814
-vt 0.289425 0.559038
-vt 0.271306 0.559585
-vt 0.289457 0.577254
-vt 0.271644 0.577346
-vt 0.253826 0.560392
-vt 0.232815 0.560863
-vt 0.254199 0.577650
-vt 0.235802 0.577144
-vt 0.289269 0.595105
-vt 0.271736 0.594911
-vt 0.288883 0.612622
-vt 0.270519 0.613276
-vt 0.254465 0.594809
-vt 0.237418 0.595273
-vt 0.254510 0.615360
-vt 0.238730 0.613199
-vt 0.218564 0.561936
-vt 0.204874 0.563179
-vt 0.219600 0.575723
-vt 0.204061 0.578983
-vt 0.185173 0.565335
-vt 0.169549 0.567197
-vt 0.186875 0.581348
-vt 0.171083 0.582645
-vt 0.220609 0.595969
-vt 0.204091 0.596520
-vt 0.221107 0.612457
-vt 0.204703 0.612833
-vt 0.187941 0.597339
-vt 0.172132 0.598223
-vt 0.188610 0.613320
-vt 0.172808 0.613861
-vt 0.429593 0.645452
-vt 0.411597 0.642229
-vt 0.426061 0.663350
-vt 0.408487 0.659961
-vt 0.393768 0.639433
-vt 0.372283 0.636562
-vt 0.390915 0.657091
-vt 0.372464 0.653358
-vt 0.422482 0.680841
-vt 0.405306 0.677273
-vt 0.417597 0.698739
-vt 0.401401 0.697721
-vt 0.388108 0.674435
-vt 0.370972 0.671886
-vt 0.386113 0.692635
-vt 0.368553 0.688736
-vt 0.357934 0.634946
-vt 0.343721 0.633491
-vt 0.356383 0.649066
-vt 0.339891 0.649585
-vt 0.322710 0.631737
-vt 0.305522 0.630620
-vt 0.321537 0.648977
-vt 0.304478 0.647723
-vt 0.353945 0.669691
-vt 0.337044 0.667525
-vt 0.351841 0.686448
-vt 0.335187 0.684577
-vt 0.320133 0.665946
-vt 0.303312 0.664616
-vt 0.318619 0.682743
-vt 0.302067 0.681174
-vt 0.412031 0.713878
-vt 0.398749 0.711165
-vt 0.410798 0.729526
-vt 0.396146 0.724280
-vt 0.385471 0.708610
-vt 0.365964 0.705185
-vt 0.380561 0.723555
-vt 0.363805 0.721471
-vt 0.407985 0.746521
-vt 0.392391 0.743307
-vt 0.404411 0.761896
-vt 0.389270 0.758604
-vt 0.376871 0.740209
-vt 0.361066 0.737427
-vt 0.374038 0.755680
-vt 0.358663 0.752986
-vt 0.349631 0.702943
-vt 0.333325 0.700998
-vt 0.347557 0.719126
-vt 0.331473 0.717159
-vt 0.317029 0.699228
-vt 0.300802 0.697740
-vt 0.315412 0.715391
-vt 0.299327 0.713858
-vt 0.345358 0.735100
-vt 0.329608 0.733064
-vt 0.343222 0.750630
-vt 0.327716 0.748747
-vt 0.313758 0.731398
-vt 0.297980 0.729736
-vt 0.312091 0.747159
-vt 0.296560 0.745588
-vt 0.288448 0.629840
-vt 0.267982 0.629217
-vt 0.287532 0.646789
-vt 0.269722 0.645034
-vt 0.254366 0.628987
-vt 0.240926 0.628845
-vt 0.254142 0.642431
-vt 0.238630 0.644299
-vt 0.286629 0.663519
-vt 0.270056 0.662722
-vt 0.285649 0.680054
-vt 0.269278 0.679169
-vt 0.253600 0.662265
-vt 0.237284 0.661654
-vt 0.253014 0.678481
-vt 0.236780 0.677938
-vt 0.221146 0.628852
-vt 0.205002 0.628998
-vt 0.221296 0.645116
-vt 0.205111 0.645087
-vt 0.188987 0.629242
-vt 0.173199 0.629523
-vt 0.189135 0.645126
-vt 0.173365 0.645199
-vt 0.221080 0.661303
-vt 0.205012 0.661103
-vt 0.220723 0.677589
-vt 0.204802 0.677112
-vt 0.189111 0.660963
-vt 0.173350 0.660871
-vt 0.188908 0.676760
-vt 0.173200 0.676515
-vt 0.284645 0.696554
-vt 0.268487 0.695480
-vt 0.283592 0.712635
-vt 0.267670 0.711538
-vt 0.252335 0.694624
-vt 0.236102 0.693970
-vt 0.251534 0.710625
-vt 0.235599 0.709879
-vt 0.282288 0.728425
-vt 0.266524 0.727383
-vt 0.280992 0.744273
-vt 0.265419 0.743130
-vt 0.250697 0.726471
-vt 0.234737 0.725672
-vt 0.249818 0.742185
-vt 0.234127 0.741358
-vt 0.220252 0.693442
-vt 0.204510 0.692948
-vt 0.219709 0.709247
-vt 0.203876 0.708702
-vt 0.188557 0.692510
-vt 0.172893 0.692129
-vt 0.188101 0.708210
-vt 0.172453 0.707749
-vt 0.219089 0.725003
-vt 0.203475 0.724412
-vt 0.218447 0.740641
-vt 0.202763 0.740058
-vt 0.187611 0.723873
-vt 0.171973 0.723368
-vt 0.187071 0.739513
-vt 0.171449 0.738989
-usemtl None_moon-texture.png
-s 1
-f 331/1 4/2 351/3 834/4
-f 102/5 331/1 834/4 579/6
-f 834/4 351/3 112/7 578/8
-f 579/6 834/4 578/8 226/9
-f 330/10 102/5 579/6 835/11
-f 36/12 330/10 835/11 452/13
-f 835/11 579/6 226/9 580/14
-f 452/13 835/11 580/14 163/15
-f 578/8 112/7 350/16 836/17
-f 226/9 578/8 836/17 581/18
-f 836/17 350/16 41/19 450/20
-f 581/18 836/17 450/20 162/21
-f 580/14 226/9 581/18 837/22
-f 163/15 580/14 837/22 453/23
-f 837/22 581/18 162/21 451/24
-f 453/23 837/22 451/24 66/25
-f 332/26 36/12 452/13 838/27
-f 103/28 332/26 838/27 583/29
-f 838/27 452/13 163/15 582/30
-f 583/29 838/27 582/30 227/31
-f 333/32 103/28 583/29 839/33
-f 15/34 333/32 839/33 393/35
-f 839/33 583/29 227/31 584/36
-f 393/35 839/33 584/36 133/37
-f 582/30 163/15 453/23 840/38
-f 227/31 582/30 840/38 585/39
-f 840/38 453/23 66/25 455/40
-f 585/39 840/38 455/40 164/41
-f 584/36 227/31 585/39 841/42
-f 133/37 584/36 841/42 392/43
-f 841/42 585/39 164/41 454/44
-f 392/43 841/42 454/44 51/45
-f 450/20 41/19 352/46 842/47
-f 162/21 450/20 842/47 587/48
-f 842/47 352/46 113/49 586/50
-f 587/48 842/47 586/50 228/51
-f 451/24 162/21 587/48 843/52
-f 66/25 451/24 843/52 457/53
-f 843/52 587/48 228/51 588/54
-f 457/53 843/52 588/54 165/55
-f 586/50 113/49 353/56 844/57
-f 228/51 586/50 844/57 589/58
-f 844/57 353/56 17/59 389/60
-f 589/58 844/57 389/60 131/61
-f 588/54 228/51 589/58 845/62
-f 165/55 588/54 845/62 456/63
-f 845/62 589/58 131/61 388/64
-f 456/63 845/62 388/64 50/65
-f 455/40 66/25 457/53 846/66
-f 164/41 455/40 846/66 591/67
-f 846/66 457/53 165/55 590/68
-f 591/67 846/66 590/68 229/69
-f 454/44 164/41 591/67 847/70
-f 51/45 454/44 847/70 390/71
-f 847/70 591/67 229/69 592/72
-f 390/71 847/70 592/72 132/73
-f 590/68 165/55 456/63 848/74
-f 229/69 590/68 848/74 593/75
-f 848/74 456/63 50/65 386/76
-f 593/75 848/74 386/76 130/77
-f 592/72 229/69 593/75 849/78
-f 132/73 592/72 849/78 391/79
-f 849/78 593/75 130/77 387/80
-f 391/79 849/78 387/80 22/81
-f 335/82 15/34 393/35 850/83
-f 104/84 335/82 850/83 595/85
-f 850/83 393/35 133/37 594/86
-f 595/85 850/83 594/86 230/87
-f 334/88 104/84 595/85 851/89
-f 37/90 334/88 851/89 460/91
-f 851/89 595/85 230/87 596/92
-f 460/91 851/89 596/92 167/93
-f 594/86 133/37 392/43 852/94
-f 230/87 594/86 852/94 597/95
-f 852/94 392/43 51/45 458/96
-f 597/95 852/94 458/96 166/97
-f 596/92 230/87 597/95 853/98
-f 167/93 596/92 853/98 461/99
-f 853/98 597/95 166/97 459/100
-f 461/99 853/98 459/100 67/101
-f 336/102 37/90 460/91 854/103
-f 105/104 336/102 854/103 599/105
-f 854/103 460/91 167/93 598/106
-f 599/105 854/103 598/106 231/107
-f 337/108 105/104 599/105 855/109
-f 7/110 337/108 855/109 369/111
-f 855/109 599/105 231/107 600/112
-f 369/111 855/109 600/112 121/113
-f 598/106 167/93 461/99 856/114
-f 231/107 598/106 856/114 601/115
-f 856/114 461/99 67/101 463/116
-f 601/115 856/114 463/116 168/117
-f 600/112 231/107 601/115 857/118
-f 121/113 600/112 857/118 368/119
-f 857/118 601/115 168/117 462/120
-f 368/119 857/118 462/120 45/121
-f 458/96 51/45 390/71 858/122
-f 166/97 458/96 858/122 603/123
-f 858/122 390/71 132/73 602/124
-f 603/123 858/122 602/124 232/125
-f 459/100 166/97 603/123 859/126
-f 67/101 459/100 859/126 465/127
-f 859/126 603/123 232/125 604/128
-f 465/127 859/126 604/128 169/129
-f 602/124 132/73 391/79 860/130
-f 232/125 602/124 860/130 605/131
-f 860/130 391/79 22/81 395/132
-f 605/131 860/130 395/132 134/133
-f 604/128 232/125 605/131 861/134
-f 169/129 604/128 861/134 464/135
-f 861/134 605/131 134/133 394/136
-f 464/135 861/134 394/136 52/137
-f 463/116 67/101 465/127 862/138
-f 168/117 463/116 862/138 607/139
-f 862/138 465/127 169/129 606/140
-f 607/139 862/138 606/140 233/141
-f 462/120 168/117 607/139 863/142
-f 45/121 462/120 863/142 366/143
-f 863/142 607/139 233/141 608/144
-f 366/143 863/142 608/144 120/145
-f 606/140 169/129 464/135 864/146
-f 233/141 606/140 864/146 609/147
-f 864/146 464/135 52/137 396/148
-f 609/147 864/146 396/148 135/149
-f 608/144 233/141 609/147 865/150
-f 120/145 608/144 865/150 367/151
-f 865/150 609/147 135/149 397/152
-f 367/151 865/150 397/152 19/153
-f 389/60 17/59 349/154 866/155
-f 131/61 389/60 866/155 611/156
-f 866/155 349/154 111/157 610/158
-f 611/156 866/155 610/158 234/159
-f 388/64 131/61 611/156 867/160
-f 50/65 388/64 867/160 468/161
-f 867/160 611/156 234/159 612/162
-f 468/161 867/160 612/162 171/163
-f 610/158 111/157 348/164 868/165
-f 234/159 610/158 868/165 613/166
-f 868/165 348/164 40/167 466/168
-f 613/166 868/165 466/168 170/169
-f 612/162 234/159 613/166 869/170
-f 171/163 612/162 869/170 469/171
-f 869/170 613/166 170/169 467/172
-f 469/171 869/170 467/172 68/173
-f 386/76 50/65 468/161 870/174
-f 130/77 386/76 870/174 615/175
-f 870/174 468/161 171/163 614/176
-f 615/175 870/174 614/176 235/177
-f 387/80 130/77 615/175 871/178
-f 22/81 387/80 871/178 399/179
-f 871/178 615/175 235/177 616/180
-f 399/179 871/178 616/180 136/181
-f 614/176 171/163 469/171 872/182
-f 235/177 614/176 872/182 617/183
-f 872/182 469/171 68/173 471/184
-f 617/183 872/182 471/184 172/185
-f 616/180 235/177 617/183 873/186
-f 136/181 616/180 873/186 398/187
-f 873/186 617/183 172/185 470/188
-f 398/187 873/186 470/188 53/189
-f 466/168 40/167 346/190 874/191
-f 170/169 466/168 874/191 619/192
-f 874/191 346/190 110/193 618/194
-f 619/192 874/191 618/194 236/195
-f 467/172 170/169 619/192 875/196
-f 68/173 467/172 875/196 473/197
-f 875/196 619/192 236/195 620/198
-f 473/197 875/196 620/198 173/199
-f 618/194 110/193 347/200 876/201
-f 236/195 618/194 876/201 621/202
-f 876/201 347/200 8/203 359/204
-f 621/202 876/201 359/204 116/205
-f 620/198 236/195 621/202 877/206
-f 173/199 620/198 877/206 472/207
-f 877/206 621/202 116/205 358/208
-f 472/207 877/206 358/208 43/209
-f 471/184 68/173 473/197 878/210
-f 172/185 471/184 878/210 623/211
-f 878/210 473/197 173/199 622/212
-f 623/211 878/210 622/212 237/213
-f 470/188 172/185 623/211 879/214
-f 53/189 470/188 879/214 400/215
-f 879/214 623/211 237/213 624/216
-f 400/215 879/214 624/216 137/217
-f 622/212 173/199 472/207 880/218
-f 237/213 622/212 880/218 625/219
-f 880/218 472/207 43/209 360/220
-f 625/219 880/218 360/220 117/221
-f 624/216 237/213 625/219 881/222
-f 137/217 624/216 881/222 401/223
-f 881/222 625/219 117/221 361/224
-f 401/223 881/222 361/224 18/225
-f 395/132 22/81 399/179 882/226
-f 134/133 395/132 882/226 627/227
-f 882/226 399/179 136/181 626/228
-f 627/227 882/226 626/228 238/229
-f 394/136 134/133 627/227 883/230
-f 52/137 394/136 883/230 476/231
-f 883/230 627/227 238/229 628/232
-f 476/231 883/230 628/232 175/233
-f 626/228 136/181 398/187 884/234
-f 238/229 626/228 884/234 629/235
-f 884/234 398/187 53/189 474/236
-f 629/235 884/234 474/236 174/237
-f 628/232 238/229 629/235 885/238
-f 175/233 628/232 885/238 477/239
-f 885/238 629/235 174/237 475/240
-f 477/239 885/238 475/240 69/241
-f 396/148 52/137 476/231 886/242
-f 135/149 396/148 886/242 631/243
-f 886/242 476/231 175/233 630/244
-f 631/243 886/242 630/244 239/245
-f 397/152 135/149 631/243 887/246
-f 19/153 397/152 887/246 365/247
-f 887/246 631/243 239/245 632/248
-f 365/247 887/246 632/248 119/249
-f 630/244 175/233 477/239 888/250
-f 239/245 630/244 888/250 633/251
-f 888/250 477/239 69/241 479/252
-f 633/251 888/250 479/252 176/253
-f 632/248 239/245 633/251 889/254
-f 119/249 632/248 889/254 364/255
-f 889/254 633/251 176/253 478/256
-f 364/255 889/254 478/256 44/257
-f 474/236 53/189 400/215 890/258
-f 174/237 474/236 890/258 635/259
-f 890/258 400/215 137/217 634/260
-f 635/259 890/258 634/260 240/261
-f 475/240 174/237 635/259 891/262
-f 69/241 475/240 891/262 481/263
-f 891/262 635/259 240/261 636/264
-f 481/263 891/262 636/264 177/265
-f 634/260 137/217 401/223 892/266
-f 240/261 634/260 892/266 637/267
-f 892/266 401/223 18/225 357/268
-f 637/267 892/266 357/268 115/269
-f 636/264 240/261 637/267 893/270
-f 177/265 636/264 893/270 480/271
-f 893/270 637/267 115/269 356/272
-f 480/271 893/270 356/272 42/273
-f 479/252 69/241 481/263 894/274
-f 176/253 479/252 894/274 639/275
-f 894/274 481/263 177/265 638/276
-f 639/275 894/274 638/276 241/277
-f 478/256 176/253 639/275 895/278
-f 44/257 478/256 895/278 362/279
-f 895/278 639/275 241/277 640/280
-f 362/279 895/278 640/280 118/281
-f 638/276 177/265 480/271 896/282
-f 241/277 638/276 896/282 641/283
-f 896/282 480/271 42/273 354/284
-f 641/283 896/282 354/284 114/285
-f 640/280 241/277 641/283 897/286
-f 118/281 640/280 897/286 363/287
-f 897/286 641/283 114/285 355/288
-f 363/287 897/286 355/288 9/289
-f 327/290 7/110 369/111 898/291
-f 100/292 327/290 898/291 643/293
-f 898/291 369/111 121/113 642/294
-f 643/293 898/291 642/294 242/295
-f 326/296 100/292 643/293 899/297
-f 35/298 326/296 899/297 484/299
-f 899/297 643/293 242/295 644/300
-f 484/299 899/297 644/300 179/301
-f 642/294 121/113 368/119 900/302
-f 242/295 642/294 900/302 645/303
-f 900/302 368/119 45/121 482/304
-f 645/303 900/302 482/304 178/305
-f 644/300 242/295 645/303 901/306
-f 179/301 644/300 901/306 485/307
-f 901/306 645/303 178/305 483/308
-f 485/307 901/306 483/308 70/309
-f 328/310 35/298 484/299 902/311
-f 101/312 328/310 902/311 647/313
-f 902/311 484/299 179/301 646/314
-f 647/313 902/311 646/314 243/315
-f 329/316 101/312 647/313 903/317
-f 14/318 329/316 903/317 407/319
-f 903/317 647/313 243/315 648/320
-f 407/319 903/317 648/320 140/321
-f 646/314 179/301 485/307 904/322
-f 243/315 646/314 904/322 649/323
-f 904/322 485/307 70/309 487/324
-f 649/323 904/322 487/324 180/325
-f 648/320 243/315 649/323 905/326
-f 140/321 648/320 905/326 406/327
-f 905/326 649/323 180/325 486/328
-f 406/327 905/326 486/328 55/329
-f 482/304 45/121 366/143 906/330
-f 178/305 482/304 906/330 651/331
-f 906/330 366/143 120/145 650/332
-f 651/331 906/330 650/332 244/333
-f 483/308 178/305 651/331 907/334
-f 70/309 483/308 907/334 489/335
-f 907/334 651/331 244/333 652/336
-f 489/335 907/334 652/336 181/337
-f 650/332 120/145 367/151 908/338
-f 244/333 650/332 908/338 653/339
-f 908/338 367/151 19/153 403/340
-f 653/339 908/338 403/340 138/341
-f 652/336 244/333 653/339 909/342
-f 181/337 652/336 909/342 488/343
-f 909/342 653/339 138/341 402/344
-f 488/343 909/342 402/344 54/345
-f 487/324 70/309 489/335 910/346
-f 180/325 487/324 910/346 655/347
-f 910/346 489/335 181/337 654/348
-f 655/347 910/346 654/348 245/349
-f 486/328 180/325 655/347 911/350
-f 55/329 486/328 911/350 408/351
-f 911/350 655/347 245/349 656/352
-f 408/351 911/350 656/352 141/353
-f 654/348 181/337 488/343 912/354
-f 245/349 654/348 912/354 657/355
-f 912/354 488/343 54/345 404/356
-f 657/355 912/354 404/356 139/357
-f 656/352 245/349 657/355 913/358
-f 141/353 656/352 913/358 409/359
-f 913/358 657/355 139/357 405/360
-f 409/359 913/358 405/360 23/361
-f 325/362 14/318 407/319 914/363
-f 99/364 325/362 914/363 659/365
-f 914/363 407/319 140/321 658/366
-f 659/365 914/363 658/366 246/367
-f 324/368 99/364 659/365 915/369
-f 34/370 324/368 915/369 492/371
-f 915/369 659/365 246/367 660/372
-f 492/371 915/369 660/372 183/373
-f 658/366 140/321 406/327 916/374
-f 246/367 658/366 916/374 661/375
-f 916/374 406/327 55/329 490/376
-f 661/375 916/374 490/376 182/377
-f 660/372 246/367 661/375 917/378
-f 183/373 660/372 917/378 493/379
-f 917/378 661/375 182/377 491/380
-f 493/379 917/378 491/380 71/381
-f 322/382 34/370 492/371 918/383
-f 98/384 322/382 918/383 663/385
-f 918/383 492/371 183/373 662/386
-f 663/385 918/383 662/386 247/387
-f 323/388 98/384 663/385 919/389
-f 1/390 323/388 919/389 309/391
-f 919/389 663/385 247/387 664/392
-f 309/391 919/389 664/392 91/393
-f 662/386 183/373 493/379 920/394
-f 247/387 662/386 920/394 665/395
-f 920/394 493/379 71/381 495/396
-f 665/395 920/394 495/396 184/397
-f 664/392 247/387 665/395 921/398
-f 91/393 664/392 921/398 308/399
-f 921/398 665/395 184/397 494/400
-f 308/399 921/398 494/400 30/401
-f 490/376 55/329 408/351 922/402
-f 182/377 490/376 922/402 667/403
-f 922/402 408/351 141/353 666/404
-f 667/403 922/402 666/404 248/405
-f 491/380 182/377 667/403 923/406
-f 71/381 491/380 923/406 497/407
-f 923/406 667/403 248/405 668/408
-f 497/407 923/406 668/408 185/409
-f 666/404 141/353 409/359 924/410
-f 248/405 666/404 924/410 669/411
-f 924/410 409/359 23/361 413/412
-f 669/411 924/410 413/412 143/413
-f 668/408 248/405 669/411 925/414
-f 185/409 668/408 925/414 496/415
-f 925/414 669/411 143/413 412/416
-f 496/415 925/414 412/416 56/417
-f 495/396 71/381 497/407 926/418
-f 184/397 495/396 926/418 671/419
-f 926/418 497/407 185/409 670/420
-f 671/419 926/418 670/420 249/421
-f 494/400 184/397 671/419 927/422
-f 30/401 494/400 927/422 306/423
-f 927/422 671/419 249/421 672/424
-f 306/423 927/422 672/424 90/425
-f 670/420 185/409 496/415 928/426
-f 249/421 670/420 928/426 673/427
-f 928/426 496/415 56/417 410/428
-f 673/427 928/426 410/428 142/429
-f 672/424 249/421 673/427 929/430
-f 90/425 672/424 929/430 307/431
-f 929/430 673/427 142/429 411/432
-f 307/431 929/430 411/432 12/433
-f 403/340 19/153 365/247 930/434
-f 138/341 403/340 930/434 675/435
-f 930/434 365/247 119/249 674/436
-f 675/435 930/434 674/436 250/437
-f 402/344 138/341 675/435 931/438
-f 54/345 402/344 931/438 500/439
-f 931/438 675/435 250/437 676/440
-f 500/439 931/438 676/440 187/441
-f 674/436 119/249 364/255 932/442
-f 250/437 674/436 932/442 677/443
-f 932/442 364/255 44/257 498/444
-f 677/443 932/442 498/444 186/445
-f 676/440 250/437 677/443 933/446
-f 187/441 676/440 933/446 501/447
-f 933/446 677/443 186/445 499/448
-f 501/447 933/446 499/448 72/449
-f 404/356 54/345 500/439 934/450
-f 139/357 404/356 934/450 679/451
-f 934/450 500/439 187/441 678/452
-f 679/451 934/450 678/452 251/453
-f 405/360 139/357 679/451 935/454
-f 23/361 405/360 935/454 417/455
-f 935/454 679/451 251/453 680/456
-f 417/455 935/454 680/456 145/457
-f 678/452 187/441 501/447 936/458
-f 251/453 678/452 936/458 681/459
-f 936/458 501/447 72/449 503/460
-f 681/459 936/458 503/460 188/461
-f 680/456 251/453 681/459 937/462
-f 145/457 680/456 937/462 416/463
-f 937/462 681/459 188/461 502/464
-f 416/463 937/462 502/464 57/465
-f 498/444 44/257 362/279 938/466
-f 186/445 498/444 938/466 683/467
-f 938/466 362/279 118/281 682/468
-f 683/467 938/466 682/468 252/469
-f 499/448 186/445 683/467 939/470
-f 72/449 499/448 939/470 505/471
-f 939/470 683/467 252/469 684/472
-f 505/471 939/470 684/472 189/473
-f 682/468 118/281 363/287 940/474
-f 252/469 682/468 940/474 685/475
-f 940/474 363/287 9/289 371/476
-f 685/475 940/474 371/476 122/477
-f 684/472 252/469 685/475 941/478
-f 189/473 684/472 941/478 504/479
-f 941/478 685/475 122/477 370/480
-f 504/479 941/478 370/480 46/481
-f 503/460 72/449 505/471 942/482
-f 188/461 503/460 942/482 687/483
-f 942/482 505/471 189/473 686/484
-f 687/483 942/482 686/484 253/485
-f 502/464 188/461 687/483 943/486
-f 57/465 502/464 943/486 414/487
-f 943/486 687/483 253/485 688/488
-f 414/487 943/486 688/488 144/489
-f 686/484 189/473 504/479 944/490
-f 253/485 686/484 944/490 689/491
-f 944/490 504/479 46/481 372/492
-f 689/491 944/490 372/492 123/493
-f 688/488 253/485 689/491 945/494
-f 144/489 688/488 945/494 415/495
-f 945/494 689/491 123/493 373/496
-f 415/495 945/494 373/496 20/497
-f 413/412 23/361 417/455 946/498
-f 143/413 413/412 946/498 691/499
-f 946/498 417/455 145/457 690/500
-f 691/499 946/498 690/500 254/501
-f 412/416 143/413 691/499 947/502
-f 56/417 412/416 947/502 508/503
-f 947/502 691/499 254/501 692/504
-f 508/503 947/502 692/504 191/505
-f 690/500 145/457 416/463 948/506
-f 254/501 690/500 948/506 693/507
-f 948/506 416/463 57/465 506/508
-f 693/507 948/506 506/508 190/509
-f 692/504 254/501 693/507 949/510
-f 191/505 692/504 949/510 509/511
-f 949/510 693/507 190/509 507/512
-f 509/511 949/510 507/512 73/513
-f 410/428 56/417 508/503 950/514
-f 142/429 410/428 950/514 695/515
-f 950/514 508/503 191/505 694/516
-f 695/515 950/514 694/516 255/517
-f 411/432 142/429 695/515 951/518
-f 12/433 411/432 951/518 311/519
-f 951/518 695/515 255/517 696/520
-f 311/519 951/518 696/520 92/521
-f 694/516 191/505 509/511 952/522
-f 255/517 694/516 952/522 697/523
-f 952/522 509/511 73/513 511/524
-f 697/523 952/522 511/524 192/525
-f 696/520 255/517 697/523 953/526
-f 92/521 696/520 953/526 310/527
-f 953/526 697/523 192/525 510/528
-f 310/527 953/526 510/528 31/529
-f 506/508 57/465 414/487 954/530
-f 190/509 506/508 954/530 699/531
-f 954/530 414/487 144/489 698/532
-f 699/531 954/530 698/532 256/533
-f 507/512 190/509 699/531 955/534
-f 73/513 507/512 955/534 513/535
-f 955/534 699/531 256/533 700/536
-f 513/535 955/534 700/536 193/537
-f 698/532 144/489 415/495 956/538
-f 256/533 698/532 956/538 701/539
-f 956/538 415/495 20/497 375/540
-f 701/539 956/538 375/540 124/541
-f 700/536 256/533 701/539 957/542
-f 193/537 700/536 957/542 512/543
-f 957/542 701/539 124/541 374/544
-f 512/543 957/542 374/544 47/545
-f 511/524 73/513 513/535 958/546
-f 192/525 511/524 958/546 703/547
-f 958/546 513/535 193/537 702/548
-f 703/547 958/546 702/548 257/549
-f 510/528 192/525 703/547 959/550
-f 31/529 510/528 959/550 312/551
-f 959/550 703/547 257/549 704/552
-f 312/551 959/550 704/552 93/553
-f 702/548 193/537 512/543 960/554
-f 257/549 702/548 960/554 705/555
-f 960/554 512/543 47/545 376/556
-f 705/555 960/554 376/556 125/557
-f 704/552 257/549 705/555 961/558
-f 93/553 704/552 961/558 313/559
-f 961/558 705/555 125/557 377/560
-f 313/559 961/558 377/560 6/561
-f 359/204 8/203 339/562 962/563
-f 116/205 359/204 962/563 707/564
-f 962/563 339/562 106/565 706/566
-f 707/564 962/563 706/566 258/567
-f 358/208 116/205 707/564 963/568
-f 43/209 358/208 963/568 516/569
-f 963/568 707/564 258/567 708/570
-f 516/569 963/568 708/570 195/571
-f 706/566 106/565 338/572 964/573
-f 258/567 706/566 964/573 709/574
-f 964/573 338/572 38/575 514/576
-f 709/574 964/573 514/576 194/577
-f 708/570 258/567 709/574 965/578
-f 195/571 708/570 965/578 517/579
-f 965/578 709/574 194/577 515/580
-f 517/579 965/578 515/580 74/581
-f 360/220 43/209 516/569 966/582
-f 117/221 360/220 966/582 711/583
-f 966/582 516/569 195/571 710/584
-f 711/583 966/582 710/584 259/585
-f 361/224 117/221 711/583 967/586
-f 18/225 361/224 967/586 423/587
-f 967/586 711/583 259/585 712/588
-f 423/587 967/586 712/588 148/589
-f 710/584 195/571 517/579 968/590
-f 259/585 710/584 968/590 713/591
-f 968/590 517/579 74/581 519/592
-f 713/591 968/590 519/592 196/593
-f 712/588 259/585 713/591 969/594
-f 148/589 712/588 969/594 422/595
-f 969/594 713/591 196/593 518/596
-f 422/595 969/594 518/596 59/597
-f 514/576 38/575 340/598 970/599
-f 194/577 514/576 970/599 715/600
-f 970/599 340/598 107/601 714/602
-f 715/600 970/599 714/602 260/603
-f 515/580 194/577 715/600 971/604
-f 74/581 515/580 971/604 521/605
-f 971/604 715/600 260/603 716/606
-f 521/605 971/604 716/606 197/607
-f 714/602 107/601 341/608 972/609
-f 260/603 714/602 972/609 717/610
-f 972/609 341/608 16/611 419/612
-f 717/610 972/609 419/612 146/613
-f 716/606 260/603 717/610 973/614
-f 197/607 716/606 973/614 520/615
-f 973/614 717/610 146/613 418/616
-f 520/615 973/614 418/616 58/617
-f 519/592 74/581 521/605 974/618
-f 196/593 519/592 974/618 719/619
-f 974/618 521/605 197/607 718/620
-f 719/619 974/618 718/620 261/621
-f 518/596 196/593 719/619 975/622
-f 59/597 518/596 975/622 424/623
-f 975/622 719/619 261/621 720/624
-f 424/623 975/622 720/624 149/625
-f 718/620 197/607 520/615 976/626
-f 261/621 718/620 976/626 721/627
-f 976/626 520/615 58/617 420/628
-f 721/627 976/626 420/628 147/629
-f 720/624 261/621 721/627 977/630
-f 149/625 720/624 977/630 425/631
-f 977/630 721/627 147/629 421/632
-f 425/631 977/630 421/632 24/633
-f 357/268 18/225 423/587 978/634
-f 115/269 357/268 978/634 723/635
-f 978/634 423/587 148/589 722/636
-f 723/635 978/634 722/636 262/637
-f 356/272 115/269 723/635 979/638
-f 42/273 356/272 979/638 524/639
-f 979/638 723/635 262/637 724/640
-f 524/639 979/638 724/640 199/641
-f 722/636 148/589 422/595 980/642
-f 262/637 722/636 980/642 725/643
-f 980/642 422/595 59/597 522/644
-f 725/643 980/642 522/644 198/645
-f 724/640 262/637 725/643 981/646
-f 199/641 724/640 981/646 525/647
-f 981/646 725/643 198/645 523/648
-f 525/647 981/646 523/648 75/649
-f 354/284 42/273 524/639 982/650
-f 114/285 354/284 982/650 727/651
-f 982/650 524/639 199/641 726/652
-f 727/651 982/650 726/652 263/653
-f 355/288 114/285 727/651 983/654
-f 9/289 355/288 983/654 379/655
-f 983/654 727/651 263/653 728/656
-f 379/655 983/654 728/656 126/657
-f 726/652 199/641 525/647 984/658
-f 263/653 726/652 984/658 729/659
-f 984/658 525/647 75/649 527/660
-f 729/659 984/658 527/660 200/661
-f 728/656 263/653 729/659 985/662
-f 126/657 728/656 985/662 378/663
-f 985/662 729/659 200/661 526/664
-f 378/663 985/662 526/664 48/665
-f 522/644 59/597 424/623 986/666
-f 198/645 522/644 986/666 731/667
-f 986/666 424/623 149/625 730/668
-f 731/667 986/666 730/668 264/669
-f 523/648 198/645 731/667 987/670
-f 75/649 523/648 987/670 529/671
-f 987/670 731/667 264/669 732/672
-f 529/671 987/670 732/672 201/673
-f 730/668 149/625 425/631 988/674
-f 264/669 730/668 988/674 733/675
-f 988/674 425/631 24/633 429/676
-f 733/675 988/674 429/676 151/677
-f 732/672 264/669 733/675 989/678
-f 201/673 732/672 989/678 528/679
-f 989/678 733/675 151/677 428/680
-f 528/679 989/678 428/680 60/681
-f 527/660 75/649 529/671 990/682
-f 200/661 527/660 990/682 735/683
-f 990/682 529/671 201/673 734/684
-f 735/683 990/682 734/684 265/685
-f 526/664 200/661 735/683 991/686
-f 48/665 526/664 991/686 380/687
-f 991/686 735/683 265/685 736/688
-f 380/687 991/686 736/688 127/689
-f 734/684 201/673 528/679 992/690
-f 265/685 734/684 992/690 737/691
-f 992/690 528/679 60/681 426/692
-f 737/691 992/690 426/692 150/693
-f 736/688 265/685 737/691 993/694
-f 127/689 736/688 993/694 381/695
-f 993/694 737/691 150/693 427/696
-f 381/695 993/694 427/696 21/697
-f 419/612 16/611 345/698 994/699
-f 146/613 419/612 994/699 739/700
-f 994/699 345/698 109/701 738/702
-f 739/700 994/699 738/702 266/703
-f 418/616 146/613 739/700 995/704
-f 58/617 418/616 995/704 532/705
-f 995/704 739/700 266/703 740/706
-f 532/705 995/704 740/706 203/707
-f 738/702 109/701 344/708 996/709
-f 266/703 738/702 996/709 741/710
-f 996/709 344/708 39/711 530/712
-f 741/710 996/709 530/712 202/713
-f 740/706 266/703 741/710 997/714
-f 203/707 740/706 997/714 533/715
-f 997/714 741/710 202/713 531/716
-f 533/715 997/714 531/716 76/717
-f 420/628 58/617 532/705 998/718
-f 147/629 420/628 998/718 743/719
-f 998/718 532/705 203/707 742/720
-f 743/719 998/718 742/720 267/721
-f 421/632 147/629 743/719 999/722
-f 24/633 421/632 999/722 433/723
-f 999/722 743/719 267/721 744/724
-f 433/723 999/722 744/724 153/725
-f 742/720 203/707 533/715 1000/726
-f 267/721 742/720 1000/726 745/727
-f 1000/726 533/715 76/717 535/728
-f 745/727 1000/726 535/728 204/729
-f 744/724 267/721 745/727 1001/730
-f 153/725 744/724 1001/730 432/731
-f 1001/730 745/727 204/729 534/732
-f 432/731 1001/730 534/732 61/733
-f 530/712 39/711 342/734 1002/735
-f 202/713 530/712 1002/735 747/736
-f 1002/735 342/734 108/737 746/738
-f 747/736 1002/735 746/738 268/739
-f 531/716 202/713 747/736 1003/740
-f 76/717 531/716 1003/740 537/741
-f 1003/740 747/736 268/739 748/742
-f 537/741 1003/740 748/742 205/743
-f 746/738 108/737 343/744 1004/745
-f 268/739 746/738 1004/745 749/746
-f 1004/745 343/744 3/747 305/748
-f 749/746 1004/745 305/748 89/749
-f 748/742 268/739 749/746 1005/750
-f 205/743 748/742 1005/750 536/751
-f 1005/750 749/746 89/749 304/752
-f 536/751 1005/750 304/752 29/753
-f 535/728 76/717 537/741 1006/754
-f 204/729 535/728 1006/754 751/755
-f 1006/754 537/741 205/743 750/756
-f 751/755 1006/754 750/756 269/757
-f 534/732 204/729 751/755 1007/758
-f 61/733 534/732 1007/758 430/759
-f 1007/758 751/755 269/757 752/760
-f 430/759 1007/758 752/760 152/761
-f 750/756 205/743 536/751 1008/762
-f 269/757 750/756 1008/762 753/763
-f 1008/762 536/751 29/753 302/764
-f 753/763 1008/762 302/764 88/765
-f 752/760 269/757 753/763 1009/766
-f 152/761 752/760 1009/766 431/767
-f 1009/766 753/763 88/765 303/768
-f 431/767 1009/766 303/768 11/769
-f 429/676 24/633 433/723 1010/770
-f 151/677 429/676 1010/770 755/771
-f 1010/770 433/723 153/725 754/772
-f 755/771 1010/770 754/772 270/773
-f 428/680 151/677 755/771 1011/774
-f 60/681 428/680 1011/774 540/775
-f 1011/774 755/771 270/773 756/776
-f 540/775 1011/774 756/776 207/777
-f 754/772 153/725 432/731 1012/778
-f 270/773 754/772 1012/778 757/779
-f 1012/778 432/731 61/733 538/780
-f 757/779 1012/778 538/780 206/781
-f 756/776 270/773 757/779 1013/782
-f 207/777 756/776 1013/782 541/783
-f 1013/782 757/779 206/781 539/784
-f 541/783 1013/782 539/784 77/785
-f 426/692 60/681 540/775 1014/786
-f 150/693 426/692 1014/786 759/787
-f 1014/786 540/775 207/777 758/788
-f 759/787 1014/786 758/788 271/789
-f 427/696 150/693 759/787 1015/790
-f 21/697 427/696 1015/790 385/791
-f 1015/790 759/787 271/789 760/792
-f 385/791 1015/790 760/792 129/793
-f 758/788 207/777 541/783 1016/794
-f 271/789 758/788 1016/794 761/795
-f 1016/794 541/783 77/785 543/796
-f 761/795 1016/794 543/796 208/797
-f 760/792 271/789 761/795 1017/798
-f 129/793 760/792 1017/798 384/799
-f 1017/798 761/795 208/797 542/800
-f 384/799 1017/798 542/800 49/801
-f 538/780 61/733 430/759 1018/802
-f 206/781 538/780 1018/802 763/803
-f 1018/802 430/759 152/761 762/804
-f 763/803 1018/802 762/804 272/805
-f 539/784 206/781 763/803 1019/806
-f 77/785 539/784 1019/806 545/807
-f 1019/806 763/803 272/805 764/808
-f 545/807 1019/806 764/808 209/809
-f 762/804 152/761 431/767 1020/810
-f 272/805 762/804 1020/810 765/811
-f 1020/810 431/767 11/769 299/812
-f 765/811 1020/810 299/812 86/813
-f 764/808 272/805 765/811 1021/814
-f 209/809 764/808 1021/814 544/815
-f 1021/814 765/811 86/813 298/816
-f 544/815 1021/814 298/816 28/817
-f 543/796 77/785 545/807 1022/818
-f 208/797 543/796 1022/818 767/819
-f 1022/818 545/807 209/809 766/820
-f 767/819 1022/818 766/820 273/821
-f 542/800 208/797 767/819 1023/822
-f 49/801 542/800 1023/822 382/823
-f 1023/822 767/819 273/821 768/824
-f 382/823 1023/822 768/824 128/825
-f 766/820 209/809 544/815 1024/826
-f 273/821 766/820 1024/826 769/827
-f 1024/826 544/815 28/817 300/828
-f 769/827 1024/826 300/828 87/829
-f 768/824 273/821 769/827 1025/830
-f 128/825 768/824 1025/830 383/831
-f 1025/830 769/827 87/829 301/832
-f 383/831 1025/830 301/832 5/833
-f 371/476 9/289 379/655 1026/834
-f 122/477 371/476 1026/834 771/835
-f 1026/834 379/655 126/657 770/836
-f 771/835 1026/834 770/836 274/837
-f 370/480 122/477 771/835 1027/838
-f 46/481 370/480 1027/838 548/839
-f 1027/838 771/835 274/837 772/840
-f 548/839 1027/838 772/840 211/841
-f 770/836 126/657 378/663 1028/842
-f 274/837 770/836 1028/842 773/843
-f 1028/842 378/663 48/665 546/844
-f 773/843 1028/842 546/844 210/845
-f 772/840 274/837 773/843 1029/846
-f 211/841 772/840 1029/846 549/847
-f 1029/846 773/843 210/845 547/848
-f 549/847 1029/846 547/848 78/849
-f 372/492 46/481 548/839 1030/850
-f 123/493 372/492 1030/850 775/851
-f 1030/850 548/839 211/841 774/852
-f 775/851 1030/850 774/852 275/853
-f 373/496 123/493 775/851 1031/854
-f 20/497 373/496 1031/854 439/855
-f 1031/854 775/851 275/853 776/856
-f 439/855 1031/854 776/856 156/857
-f 774/852 211/841 549/847 1032/858
-f 275/853 774/852 1032/858 777/859
-f 1032/858 549/847 78/849 551/860
-f 777/859 1032/858 551/860 212/861
-f 776/856 275/853 777/859 1033/862
-f 156/857 776/856 1033/862 438/863
-f 1033/862 777/859 212/861 550/864
-f 438/863 1033/862 550/864 63/865
-f 546/844 48/665 380/687 1034/866
-f 210/845 546/844 1034/866 779/867
-f 1034/866 380/687 127/689 778/868
-f 779/867 1034/866 778/868 276/869
-f 547/848 210/845 779/867 1035/870
-f 78/849 547/848 1035/870 553/871
-f 1035/870 779/867 276/869 780/872
-f 553/871 1035/870 780/872 213/873
-f 778/868 127/689 381/695 1036/874
-f 276/869 778/868 1036/874 781/875
-f 1036/874 381/695 21/697 435/876
-f 781/875 1036/874 435/876 154/877
-f 780/872 276/869 781/875 1037/878
-f 213/873 780/872 1037/878 552/879
-f 1037/878 781/875 154/877 434/880
-f 552/879 1037/878 434/880 62/881
-f 551/860 78/849 553/871 1038/882
-f 212/861 551/860 1038/882 783/883
-f 1038/882 553/871 213/873 782/884
-f 783/883 1038/882 782/884 277/885
-f 550/864 212/861 783/883 1039/886
-f 63/865 550/864 1039/886 440/887
-f 1039/886 783/883 277/885 784/888
-f 440/887 1039/886 784/888 157/889
-f 782/884 213/873 552/879 1040/890
-f 277/885 782/884 1040/890 785/891
-f 1040/890 552/879 62/881 436/892
-f 785/891 1040/890 436/892 155/893
-f 784/888 277/885 785/891 1041/894
-f 157/889 784/888 1041/894 441/895
-f 1041/894 785/891 155/893 437/896
-f 441/895 1041/894 437/896 25/897
-f 375/540 20/497 439/855 1042/898
-f 124/541 375/540 1042/898 787/899
-f 1042/898 439/855 156/857 786/900
-f 787/899 1042/898 786/900 278/901
-f 374/544 124/541 787/899 1043/902
-f 47/545 374/544 1043/902 556/903
-f 1043/902 787/899 278/901 788/904
-f 556/903 1043/902 788/904 215/905
-f 786/900 156/857 438/863 1044/906
-f 278/901 786/900 1044/906 789/907
-f 1044/906 438/863 63/865 554/908
-f 789/907 1044/906 554/908 214/909
-f 788/904 278/901 789/907 1045/910
-f 215/905 788/904 1045/910 557/911
-f 1045/910 789/907 214/909 555/912
-f 557/911 1045/910 555/912 79/913
-f 376/556 47/545 556/903 1046/914
-f 125/557 376/556 1046/914 791/915
-f 1046/914 556/903 215/905 790/916
-f 791/915 1046/914 790/916 279/917
-f 377/560 125/557 791/915 1047/918
-f 6/561 377/560 1047/918 321/919
-f 1047/918 791/915 279/917 792/920
-f 321/919 1047/918 792/920 97/921
-f 790/916 215/905 557/911 1048/922
-f 279/917 790/916 1048/922 793/923
-f 1048/922 557/911 79/913 559/924
-f 793/923 1048/922 559/924 216/925
-f 792/920 279/917 793/923 1049/926
-f 97/921 792/920 1049/926 320/927
-f 1049/926 793/923 216/925 558/928
-f 320/927 1049/926 558/928 33/929
-f 554/908 63/865 440/887 1050/930
-f 214/909 554/908 1050/930 795/931
-f 1050/930 440/887 157/889 794/932
-f 795/931 1050/930 794/932 280/933
-f 555/912 214/909 795/931 1051/934
-f 79/913 555/912 1051/934 561/935
-f 1051/934 795/931 280/933 796/936
-f 561/935 1051/934 796/936 217/937
-f 794/932 157/889 441/895 1052/938
-f 280/933 794/932 1052/938 797/939
-f 1052/938 441/895 25/897 445/940
-f 797/939 1052/938 445/940 159/941
-f 796/936 280/933 797/939 1053/942
-f 217/937 796/936 1053/942 560/943
-f 1053/942 797/939 159/941 444/944
-f 560/943 1053/942 444/944 64/945
-f 559/924 79/913 561/935 1054/946
-f 216/925 559/924 1054/946 799/947
-f 1054/946 561/935 217/937 798/948
-f 799/947 1054/946 798/948 281/949
-f 558/928 216/925 799/947 1055/950
-f 33/929 558/928 1055/950 318/951
-f 1055/950 799/947 281/949 800/952
-f 318/951 1055/950 800/952 96/953
-f 798/948 217/937 560/943 1056/954
-f 281/949 798/948 1056/954 801/955
-f 1056/954 560/943 64/945 442/956
-f 801/955 1056/954 442/956 158/957
-f 800/952 281/949 801/955 1057/958
-f 96/953 800/952 1057/958 319/959
-f 1057/958 801/955 158/957 443/960
-f 319/959 1057/958 443/960 13/961
-f 435/876 21/697 385/791 1058/962
-f 154/877 435/876 1058/962 803/963
-f 1058/962 385/791 129/793 802/964
-f 803/963 1058/962 802/964 282/965
-f 434/880 154/877 803/963 1059/966
-f 62/881 434/880 1059/966 564/967
-f 1059/966 803/963 282/965 804/968
-f 564/967 1059/966 804/968 219/969
-f 802/964 129/793 384/799 1060/970
-f 282/965 802/964 1060/970 805/971
-f 1060/970 384/799 49/801 562/972
-f 805/971 1060/970 562/972 218/973
-f 804/968 282/965 805/971 1061/974
-f 219/969 804/968 1061/974 565/975
-f 1061/974 805/971 218/973 563/976
-f 565/975 1061/974 563/976 80/977
-f 436/892 62/881 564/967 1062/978
-f 155/893 436/892 1062/978 807/979
-f 1062/978 564/967 219/969 806/980
-f 807/979 1062/978 806/980 283/981
-f 437/896 155/893 807/979 1063/982
-f 25/897 437/896 1063/982 449/983
-f 1063/982 807/979 283/981 808/984
-f 449/983 1063/982 808/984 161/985
-f 806/980 219/969 565/975 1064/986
-f 283/981 806/980 1064/986 809/987
-f 1064/986 565/975 80/977 567/988
-f 809/987 1064/986 567/988 220/989
-f 808/984 283/981 809/987 1065/990
-f 161/985 808/984 1065/990 448/991
-f 1065/990 809/987 220/989 566/992
-f 448/991 1065/990 566/992 65/993
-f 562/972 49/801 382/823 1066/994
-f 218/973 562/972 1066/994 811/995
-f 1066/994 382/823 128/825 810/996
-f 811/995 1066/994 810/996 284/997
-f 563/976 218/973 811/995 1067/998
-f 80/977 563/976 1067/998 569/999
-f 1067/998 811/995 284/997 812/1000
-f 569/999 1067/998 812/1000 221/1001
-f 810/996 128/825 383/831 1068/1002
-f 284/997 810/996 1068/1002 813/1003
-f 1068/1002 383/831 5/833 293/1004
-f 813/1003 1068/1002 293/1004 83/1005
-f 812/1000 284/997 813/1003 1069/1006
-f 221/1001 812/1000 1069/1006 568/1007
-f 1069/1006 813/1003 83/1005 292/1008
-f 568/1007 1069/1006 292/1008 26/1009
-f 567/988 80/977 569/999 1070/1010
-f 220/989 567/988 1070/1010 815/1011
-f 1070/1010 569/999 221/1001 814/1012
-f 815/1011 1070/1010 814/1012 285/1013
-f 566/992 220/989 815/1011 1071/1014
-f 65/993 566/992 1071/1014 446/1015
-f 1071/1014 815/1011 285/1013 816/1016
-f 446/1015 1071/1014 816/1016 160/1017
-f 814/1012 221/1001 568/1007 1072/1018
-f 285/1013 814/1012 1072/1018 817/1019
-f 1072/1018 568/1007 26/1009 290/1020
-f 817/1019 1072/1018 290/1020 82/1021
-f 816/1016 285/1013 817/1019 1073/1022
-f 160/1017 816/1016 1073/1022 447/1023
-f 1073/1022 817/1019 82/1021 291/1024
-f 447/1023 1073/1022 291/1024 10/1025
-f 445/940 25/897 449/983 1074/1026
-f 159/941 445/940 1074/1026 819/1027
-f 1074/1026 449/983 161/985 818/1028
-f 819/1027 1074/1026 818/1028 286/1029
-f 444/944 159/941 819/1027 1075/1030
-f 64/945 444/944 1075/1030 572/1031
-f 1075/1030 819/1027 286/1029 820/1032
-f 572/1031 1075/1030 820/1032 223/1033
-f 818/1028 161/985 448/991 1076/1034
-f 286/1029 818/1028 1076/1034 821/1035
-f 1076/1034 448/991 65/993 570/1036
-f 821/1035 1076/1034 570/1036 222/1037
-f 820/1032 286/1029 821/1035 1077/1038
-f 223/1033 820/1032 1077/1038 573/1039
-f 1077/1038 821/1035 222/1037 571/1040
-f 573/1039 1077/1038 571/1040 81/1041
-f 442/956 64/945 572/1031 1078/1042
-f 158/957 442/956 1078/1042 823/1043
-f 1078/1042 572/1031 223/1033 822/1044
-f 823/1043 1078/1042 822/1044 287/1045
-f 443/960 158/957 823/1043 1079/1046
-f 13/961 443/960 1079/1046 317/1047
-f 1079/1046 823/1043 287/1045 824/1048
-f 317/1047 1079/1046 824/1048 95/1049
-f 822/1044 223/1033 573/1039 1080/1050
-f 287/1045 822/1044 1080/1050 825/1051
-f 1080/1050 573/1039 81/1041 575/1052
-f 825/1051 1080/1050 575/1052 224/1053
-f 824/1048 287/1045 825/1051 1081/1054
-f 95/1049 824/1048 1081/1054 316/1055
-f 1081/1054 825/1051 224/1053 574/1056
-f 316/1055 1081/1054 574/1056 32/1057
-f 570/1036 65/993 446/1015 1082/1058
-f 222/1037 570/1036 1082/1058 827/1059
-f 1082/1058 446/1015 160/1017 826/1060
-f 827/1059 1082/1058 826/1060 288/1061
-f 571/1040 222/1037 827/1059 1083/1062
-f 81/1041 571/1040 1083/1062 577/1063
-f 1083/1062 827/1059 288/1061 828/1064
-f 577/1063 1083/1062 828/1064 225/1065
-f 826/1060 160/1017 447/1023 1084/1066
-f 288/1061 826/1060 1084/1066 829/1067
-f 1084/1066 447/1023 10/1025 295/1068
-f 829/1067 1084/1066 295/1068 84/1069
-f 828/1064 288/1061 829/1067 1085/1070
-f 225/1065 828/1064 1085/1070 576/1071
-f 1085/1070 829/1067 84/1069 294/1072
-f 576/1071 1085/1070 294/1072 27/1073
-f 575/1052 81/1041 577/1063 1086/1074
-f 224/1053 575/1052 1086/1074 831/1075
-f 1086/1074 577/1063 225/1065 830/1076
-f 831/1075 1086/1074 830/1076 289/1077
-f 574/1056 224/1053 831/1075 1087/1078
-f 32/1057 574/1056 1087/1078 314/1079
-f 1087/1078 831/1075 289/1077 832/1080
-f 314/1079 1087/1078 832/1080 94/1081
-f 830/1076 225/1065 576/1071 1088/1082
-f 289/1077 830/1076 1088/1082 833/1083
-f 1088/1082 576/1071 27/1073 296/1084
-f 833/1083 1088/1082 296/1084 85/1085
-f 832/1080 289/1077 833/1083 1089/1086
-f 94/1081 832/1080 1089/1086 315/1087
-f 1089/1086 833/1083 85/1085 297/1088
-f 315/1087 1089/1086 297/1088 2/1089
diff --git a/examples/quick3d/lander/qml/nebula.jpg b/examples/quick3d/lander/qml/nebula.jpg
deleted file mode 100644
index fb278cd7..00000000
--- a/examples/quick3d/lander/qml/nebula.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/lander/qml/rusty.png b/examples/quick3d/lander/qml/rusty.png
deleted file mode 100644
index b85ad7c9..00000000
--- a/examples/quick3d/lander/qml/rusty.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/lander/qtquick3d.ico b/examples/quick3d/lander/qtquick3d.ico
deleted file mode 100644
index c695ac72..00000000
--- a/examples/quick3d/lander/qtquick3d.ico
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/lander/qtquick3d.png b/examples/quick3d/lander/qtquick3d.png
deleted file mode 100644
index 8351083e..00000000
--- a/examples/quick3d/lander/qtquick3d.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/matrix_animation/main.cpp b/examples/quick3d/matrix_animation/main.cpp
deleted file mode 100644
index 6a667de6..00000000
--- a/examples/quick3d/matrix_animation/main.cpp
+++ /dev/null
@@ -1,67 +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: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$
-**
-****************************************************************************/
-
-#include <QtGui/QApplication>
-#include "qdeclarativeview3d.h"
-#include "../qmlres.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
-
- QDeclarativeView3D view;
- QString qml = q_get_qmldir(QLatin1String("qml/matrix-animation.qml"));
- view.setSource(QUrl::fromLocalFile(qml));
-
-#ifdef Q_OS_SYMBIAN
- view.setAttribute(Qt::WA_LockLandscapeOrientation, true);
- view.setResizeMode(QDeclarativeView::SizeRootObjectToView);
- view.showFullScreen();
-#else
- if (QApplication::arguments().contains(QLatin1String("-maximize")))
- view.showMaximized();
- else if (QApplication::arguments().contains(QLatin1String("-fullscreen")))
- view.showFullScreen();
- else
- view.show();
-#endif
-
- return app.exec();
-}
diff --git a/examples/quick3d/matrix_animation/matrix_animation.desktop b/examples/quick3d/matrix_animation/matrix_animation.desktop
deleted file mode 100644
index 9a940637..00000000
--- a/examples/quick3d/matrix_animation/matrix_animation.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=Matrix
-Icon=/usr/share/icons/hicolor/80x80/apps/qtquick3d.png
-Exec=/usr/bin/invoker --type=e -s /usr/bin/matrix_animation -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_matrix_animation
diff --git a/examples/quick3d/matrix_animation/matrix_animation.pro b/examples/quick3d/matrix_animation/matrix_animation.pro
deleted file mode 100644
index 48f21182..00000000
--- a/examples/quick3d/matrix_animation/matrix_animation.pro
+++ /dev/null
@@ -1,17 +0,0 @@
-TEMPLATE = app
-TARGET = matrix_animation
-CONFIG += qt warn_on
-
-INSTALL_DIRS = qml
-CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg
-include(../../../pkg.pri)
-qtcAddDeployment()
-
-SOURCES += main.cpp
-
-OTHER_FILES += \
- matrix_animation.rc \
- matrix_animation.desktop
-
-RC_FILE = matrix_animation.rc
-
diff --git a/examples/quick3d/matrix_animation/matrix_animation.rc b/examples/quick3d/matrix_animation/matrix_animation.rc
deleted file mode 100644
index 1b6228c9..00000000
--- a/examples/quick3d/matrix_animation/matrix_animation.rc
+++ /dev/null
@@ -1 +0,0 @@
-IDI_ICON1 ICON DISCARDABLE "qtquick3d.ico"
diff --git a/examples/quick3d/matrix_animation/qml/matrix-animation.qml b/examples/quick3d/matrix_animation/qml/matrix-animation.qml
deleted file mode 100644
index eaade63a..00000000
--- a/examples/quick3d/matrix_animation/qml/matrix-animation.qml
+++ /dev/null
@@ -1,112 +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 1.0
-import Qt3D 1.0
-
-Viewport {
- width: 640; height: 480
- id: viewPort
-
- MouseArea {
- anchors.fill: parent
- onClicked: program.scalex = 2.5 - program.scalex
- }
-
- Item3D {
- mesh: Mesh { source: "teapot.bez" }
- effect: program
-
-
- transform: Rotation3D {
- NumberAnimation on angle{
- running: true
- loops: Animation.Infinite
- from: 0
- to: 360
- duration: 18000
- }
- axis: Qt.vector3d(1, -0.3, 0)
- }
-
- ShaderProgram {
- id: program
- property real qt_Custom : 1.0
- property int customInt : 1
- property color customColor : "#3333ff"
- property real scalex : 1.0
- property real scaley : 1.0
- property real scalez : 1.0
- property real translationX : 0.0
- property real translationY : 0.0
- property real translationZ : 0.0
-
- property variant matrix4x4 :[
- 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 ]
-
- SequentialAnimation on translationY {
- running: true
- loops: Animation.Infinite
- PauseAnimation { duration: 2000 }
- NumberAnimation { from: 1.0; to: 0.001; duration: 1500; easing.type:"OutBounce" }
- PauseAnimation { duration: 2000 }
- NumberAnimation { from: 0.001; to: 1.0; duration: 1500; easing.type:"OutBounce" }
- }
-
- SequentialAnimation on customInt {
- running: true
- loops: Animation.Infinite
- PauseAnimation { duration: 2500 }
- NumberAnimation { from: 1.0; to: 0.001; duration: 1500; easing.type:"OutBounce" }
- PauseAnimation { duration: 2500 }
- NumberAnimation { from: 0.001; to: 1.0; duration: 1500; easing.type:"OutBounce" }
- }
-
- texture: "qtlogo.png"
-
- vertexShaderSource: "matrix_animation.vsh"
- fragmentShaderSource: "matrix_animation.fsh"
- }
- }
-
-}
diff --git a/examples/quick3d/matrix_animation/qml/matrix_animation.fsh b/examples/quick3d/matrix_animation/qml/matrix_animation.fsh
deleted file mode 100644
index 84f279f9..00000000
--- a/examples/quick3d/matrix_animation/qml/matrix_animation.fsh
+++ /dev/null
@@ -1,13 +0,0 @@
-varying highp vec4 texCoord;
-uniform sampler2D qt_Texture0;
-uniform lowp vec4 customColor;
-uniform bool customBoolean;
-
-void main(void)
-{
- mediump vec4 textureColor =
- texture2D(qt_Texture0, texCoord.st);
- gl_FragColor = clamp(vec4(
- customColor.rgb * (1.0 - textureColor.a) +
- textureColor.rgb, 1.0), 0.0, 1.0);
-}
diff --git a/examples/quick3d/matrix_animation/qml/matrix_animation.vsh b/examples/quick3d/matrix_animation/qml/matrix_animation.vsh
deleted file mode 100644
index dd5bf813..00000000
--- a/examples/quick3d/matrix_animation/qml/matrix_animation.vsh
+++ /dev/null
@@ -1,16 +0,0 @@
-attribute highp vec4 qt_Vertex;
-attribute highp vec4 qt_MultiTexCoord0;
-uniform mediump mat4 qt_ModelViewProjectionMatrix;
-varying highp vec4 texCoord;
-// uniform highp float qt_Custom;
-uniform int customInt;
-uniform vec2 vector;
-
-uniform mat3 matrix3x3;
-uniform mat4 matrix4x4;
-
-void main(void)
-{
- gl_Position = qt_ModelViewProjectionMatrix * (matrix4x4 * qt_Vertex);
- texCoord = -qt_MultiTexCoord0;
-}
diff --git a/examples/quick3d/matrix_animation/qml/qtlogo.png b/examples/quick3d/matrix_animation/qml/qtlogo.png
deleted file mode 100644
index 7d3e97eb..00000000
--- a/examples/quick3d/matrix_animation/qml/qtlogo.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/matrix_animation/qml/teapot.bez b/examples/quick3d/matrix_animation/qml/teapot.bez
deleted file mode 100644
index 02b2ac44..00000000
--- a/examples/quick3d/matrix_animation/qml/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/examples/quick3d/matrix_animation/qtquick3d.ico b/examples/quick3d/matrix_animation/qtquick3d.ico
deleted file mode 100644
index c695ac72..00000000
--- a/examples/quick3d/matrix_animation/qtquick3d.ico
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/matrix_animation/qtquick3d.png b/examples/quick3d/matrix_animation/qtquick3d.png
deleted file mode 100644
index 8351083e..00000000
--- a/examples/quick3d/matrix_animation/qtquick3d.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/modelview3d/main.cpp b/examples/quick3d/modelview3d/main.cpp
deleted file mode 100644
index c8bb3cca..00000000
--- a/examples/quick3d/modelview3d/main.cpp
+++ /dev/null
@@ -1,69 +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: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$
-**
-****************************************************************************/
-
-#include <QtGui/QApplication>
-#include "qdeclarativeview3d.h"
-
-#include "../qmlres.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
-
- QDeclarativeView3D view;
- QString qml = q_get_qmldir(QLatin1String("qml/modelview3d.qml"));
-
- view.setSource(QUrl::fromLocalFile(qml));
-
-#ifdef Q_OS_SYMBIAN
- view.setAttribute(Qt::WA_LockLandscapeOrientation, true);
- view.setResizeMode(QDeclarativeView::SizeRootObjectToView);
- view.showFullScreen();
-#else
- if (QApplication::arguments().contains(QLatin1String("-maximize")))
- view.showMaximized();
- else if (QApplication::arguments().contains(QLatin1String("-fullscreen")))
- view.showFullScreen();
- else
- view.show();
-#endif
-
- return app.exec();
-}
diff --git a/examples/quick3d/modelview3d/modelview3d.pro b/examples/quick3d/modelview3d/modelview3d.pro
deleted file mode 100644
index 578244df..00000000
--- a/examples/quick3d/modelview3d/modelview3d.pro
+++ /dev/null
@@ -1,16 +0,0 @@
-TEMPLATE = app
-TARGET = modelview3d_qml
-CONFIG += qt warn_on
-
-INSTALL_DIRS = qml
-CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg
-include(../../../pkg.pri)
-qtcAddDeployment()
-
-SOURCES += main.cpp
-
-OTHER_FILES += \
- modelview3d_qml.rc \
- modelview3d_qml.desktop
-
-RC_FILE = modelview3d_qml.rc
diff --git a/examples/quick3d/modelview3d/modelview3d_qml.desktop b/examples/quick3d/modelview3d/modelview3d_qml.desktop
deleted file mode 100644
index 2a47edef..00000000
--- a/examples/quick3d/modelview3d/modelview3d_qml.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=ModelView3D
-Icon=/usr/share/icons/hicolor/80x80/apps/qtquick3d.png
-Exec=/usr/bin/invoker --type=e -s /usr/bin/modelview3d_qml -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_modelview3d
diff --git a/examples/quick3d/modelview3d/modelview3d_qml.rc b/examples/quick3d/modelview3d/modelview3d_qml.rc
deleted file mode 100644
index 1b6228c9..00000000
--- a/examples/quick3d/modelview3d/modelview3d_qml.rc
+++ /dev/null
@@ -1 +0,0 @@
-IDI_ICON1 ICON DISCARDABLE "qtquick3d.ico"
diff --git a/examples/quick3d/modelview3d/qml/Button.qml b/examples/quick3d/modelview3d/qml/Button.qml
deleted file mode 100644
index 7ed88d3c..00000000
--- a/examples/quick3d/modelview3d/qml/Button.qml
+++ /dev/null
@@ -1,63 +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 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 1.0
-
-Rectangle {
- id: button
- color: mouseArea.pressed ? "#000000" : "#ffffff"
- border.width: 1
- anchors.margins: 5
- radius: 5
- property alias text : text.text
- signal clicked;
- Text {
- id: text
- color: mouseArea.pressed ? "#ffffff" : "#000000";
- anchors.centerIn: parent
- text: qsTr("A Button")
- }
- MouseArea {
- id: mouseArea
- anchors.fill: parent
- onClicked: button.clicked()
-
- }
-}
diff --git a/examples/quick3d/modelview3d/qml/axes.png b/examples/quick3d/modelview3d/qml/axes.png
deleted file mode 100644
index bc2272a5..00000000
--- a/examples/quick3d/modelview3d/qml/axes.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/modelview3d/qml/modelview3d.qml b/examples/quick3d/modelview3d/qml/modelview3d.qml
deleted file mode 100644
index 6eedcffb..00000000
--- a/examples/quick3d/modelview3d/qml/modelview3d.qml
+++ /dev/null
@@ -1,589 +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 1.0
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-
-Rectangle {
- id: topLevel
- width: 800; height: 480
-
- // The ModelView architecture has 3 main parts.
- // The Model (in this case "dynamicModel", a ListModel) contains the data
- // (elements) used to construct items.
- // The delegate ("cubeDelegate") describes how to use the data elements
- // to construct items.
- // The the view (in this case an anonymous Repeater) combines the Model
- // and delegate and manages the resulting Items.
-
- // See the "QML Data Models" documentation for more details on Qt Quick's
- // ModelView Architecture.
-
-
- // This ListModel is the primary source of data used to construct the
- // items.
- // In this example, the initial ListElement specifies a white cube at
- // the origin. You can add as many ListElements as you wish, or you can
- // add more elements dynamically using ListModel.append(), as shown below.
-
- // ListModel is the simplest data model, but there are several others
- // available. See the "QML Data Models" documentation for more details.
- ListModel {
- id: dynamicModel
- ListElement { x:0; y:0; z:0; color:"#ffffff"}
- }
-
- // This function shows how to build new elements and add them to the model.
- // In this example, the data required is pulled directly from the gui
- // items.
- function addItem() {
- // To add new elements, simply create a new object with the
- // desired properties, and append() them to the model.
- var newModelData = {
- "x": navigator.currentX/5,
- "y": navigator.currentY/5,
- "z": navigator.currentZ/5,
- "color": colorPicker.currentColor
- }
- dynamicModel.append( newModelData );
- // It is currently necessary to explicitly call update after changing
- // models.
- viewport.update3d();
- }
-
- // This component is the delegate (or blueprint) used to create actual
- // items out of model elements.
- Component {
- id: cubeDelegate
- Cube {
- id: item
-
- // "model" is a special variable that contains the element data for
- // each item drawn from your model.
- x: model.x
- y: model.y
- z: model.z
- effect: Effect {
- id: itemEffect
- // Note that model is still available inside child items, but
- // you should consider using an alias if it makes your code
- // more readable.
- color: model.color
- blending: true
- }
-
- // Common properties across all items
- scale: 1 / 5
-
- // If you intend on removing elements from the model,
- // make sure you include this logic.
- // "index" is another special variable in the resulting item that
- // indicates the source element's position in the data model.
- // Note that index can change over the lifetime of the item. In
- // particular, the -1 index implies that the data used to create
- // this item has been removed from the model, and that this item
- // should be disabled and will most likely be destroyed shortly.
- enabled: index != -1
-
- // You can have your own functions, signals, animations etc.
- onClicked: {
-// onClicked: console.log("Cube("+index+") color: " + itemEffect.color);
- removeAnimation.start();
- }
-
- SequentialAnimation {
- id: removeAnimation
- ColorAnimation { target: itemEffect; property: "color" ;from: model.color; to: Qt.rgba(0,0,0,0); duration: 500 }
- ScriptAction { script: {
- dynamicModel.remove(index);
- viewport.update3d();
- }
- }
- }
- // Component.onCompleted can be a useful place to do
- // initialization, like hooking up signals and slots.
- Component.onCompleted: {
- console.log("Cube Completed");
- }
- }
- }
-
- Viewport {
- id: viewport
- // Picking and/or blending will need to be enabled on the viewport
- // if any of the generated items need it.
- picking: true
- blending: true
-
- // This repeater actually instantiates the items. The Repeater must
- // be the child of an Item3D or a Viewport for the Item3Ds it creates
- // to be visible in the scene.
- Repeater {
- delegate: cubeDelegate
- model: dynamicModel
- }
-
- anchors.left: controlPanel.right
- anchors.right: parent.right
- anchors.top: parent.top
- anchors.bottom: parent.bottom
-
- camera: Camera {
- id: main_camera
- eye: Qt.vector3d(0, 4, 12)
- }
- }
-
- // This control panel contains all the gui elements to drive the example.
- // The controls provide the data for constructing building new
- // ListElements (position and color), but there is nothing below this
- // comment that is directly related to the modelview behaviours.
- Rectangle {
- id: controlPanel
- color: "#ffffff"
- width: 210
- anchors.top: parent.top
- anchors.bottom: parent.bottom
- anchors.left: parent.left
-
- Rectangle {
- id: colorPicker
- color: "white"
- height: sliderContainter.height + titleText.height + 5
- anchors.margins: 5
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.top: parent.top
-
- Text {
- id: titleText
- text: qsTr("Color Picker")
- font.bold: true
-
- anchors.top: parent.top
- anchors.left:parent.left
- anchors.margins: 5
- }
-
- property color currentColor: "white"
- property real currentRed: 1.0
- property real currentGreen: 1.0
- property real currentBlue: 1.0
- property real currentAlpha: 1.0
-
- // We use Qt.rgba() to build the colour, which breaks the bindings,
- // so we update manually when the color components change.
- onCurrentRedChanged: updateColor();
- onCurrentGreenChanged: updateColor();
- onCurrentBlueChanged: updateColor();
- onCurrentAlphaChanged: updateColor();
-
- function updateColor() {
- currentColor = Qt.rgba(colorPicker.currentRed,
- colorPicker.currentGreen,
- colorPicker.currentBlue,
- colorPicker.currentAlpha);
- redSlider.updateColors();
- greenSlider.updateColors();
- blueSlider.updateColors();
- swatch.color = currentColor;
- }
-
- Rectangle {
- id: swatch
- anchors.margins: 5
- height: 90
- y: 5
- border.width: 2
- border.color: "black"
- color: Qt.rgba(colorPicker.currentRed,
- colorPicker.currentGreen,
- colorPicker.currentBlue,
- colorPicker.currentAlpha);
- anchors.top: parent.top
- anchors.bottom: parent.bottom
- anchors.right: parent.right
- anchors.left: sliderContainter.right
- }
-
- Rectangle {
- id: sliderContainter
- anchors.bottom: parent.bottom
- width: 125
- height: 110
-
- Rectangle {
- id: redSlider
- property real currentValue: 1.0
- rotation: -90
- x: 30
- y: -20
- height: 80
- width: 30
- border.width: 2
- border.color: "black"
- radius: 5
-
- property color zeroColor: Qt.rgba(0,
- colorPicker.currentGreen,
- colorPicker.currentBlue,
- colorPicker.currentAlpha)
- property color fullColor: Qt.rgba(1.0,
- colorPicker.currentGreen,
- colorPicker.currentBlue,
- colorPicker.currentAlpha)
-
- function updateColors()
- {
- zeroColor = Qt.rgba(0,
- colorPicker.currentGreen,
- colorPicker.currentBlue,
- colorPicker.currentAlpha);
- fullColor = Qt.rgba(1.0,
- colorPicker.currentGreen,
- colorPicker.currentBlue,
- colorPicker.currentAlpha);
- }
-
- gradient: Gradient {
- GradientStop {
- position: 0.0
- color: redSlider.zeroColor}
- GradientStop {
- position: 1.0
- color: redSlider.fullColor
- }
- }
- MouseArea {
- anchors.fill: parent
- onMousePositionChanged: {
- redSlider.currentValue = mouseY / redSlider.height;
- colorPicker.currentRed = redSlider.currentValue;
- }
- }
- }
-
- Rectangle {
- id: redSwatch
- width: redSlider.width
- height: redSlider.width
- color: Qt.rgba(1.0, 0, 0);
- border.width: 2
- border.color: "black"
-
- x: redSlider.height + 10
- y: 5
- radius: 5
- MouseArea {
- anchors.fill: parent
- onClicked: {colorPicker.currentRed = 1.0;
- colorPicker.currentGreen = 0;
- colorPicker.currentBlue = 0}
- }
- }
-
- Rectangle {
- id: greenSlider
- rotation: -90
- x: 30
- y: 15
- height: 80
- width: 30
-
- property color zeroColor: Qt.rgba(colorPicker.currentRed,
- 0.0,
- colorPicker.currentBlue,
- colorPicker.currentAlpha)
- property color fullColor: Qt.rgba(colorPicker.currentRed,
- 1.0,
- colorPicker.currentBlue,
- colorPicker.currentAlpha)
-
- function updateColors()
- {
- zeroColor = Qt.rgba(colorPicker.currentRed,
- 0.0,
- colorPicker.currentBlue,
- colorPicker.currentAlpha);
- fullColor = Qt.rgba(colorPicker.currentRed,
- 1.0,
- colorPicker.currentBlue,
- colorPicker.currentAlpha);
- }
-
- gradient: Gradient {
- GradientStop {
- position: 0.0
- color: greenSlider.zeroColor
- }
- GradientStop {
- position: 1.0
- color: greenSlider.fullColor
- }
- }
- border.width: 2
- border.color: "black"
- radius: 5
- MouseArea {
- anchors.fill: parent
- onMousePositionChanged: {
- colorPicker.currentGreen = mouseY / greenSlider.height;
- }
- }
- }
-
- Rectangle {
- id: greenSwatch
- width: greenSlider.width
- height: greenSlider.width
- color: Qt.rgba(0, 1, 0);
- border.width: 2
- border.color: "black"
-
- x: greenSlider.height + 10
- y: 40
- radius: 5
- MouseArea {
- anchors.fill: parent
- onClicked: {
- colorPicker.currentRed = 0;
- colorPicker.currentGreen = 1;
- colorPicker.currentBlue = 0
- }
- }
- }
-
- Rectangle {
- id: blueSlider
- rotation: -90
- x: 30
- y: 50
- height: 80
- width: 30
- property color zeroColor: Qt.rgba(colorPicker.currentRed,
- colorPicker.currentGreen,
- 0.0,
- colorPicker.currentAlpha)
- property color fullColor: Qt.rgba(colorPicker.currentRed,
- colorPicker.currentGreen,
- 1.0,
- colorPicker.currentAlpha)
-
- function updateColors()
- {
- zeroColor = Qt.rgba(colorPicker.currentRed,
- colorPicker.currentGreen,
- 0.0,
- colorPicker.currentAlpha);
- fullColor = Qt.rgba(colorPicker.currentRed,
- colorPicker.currentGreen,
- 1.0,
- colorPicker.currentAlpha);
- }
-
- gradient: Gradient {
- GradientStop {
- position: 0.0
- color: blueSlider.zeroColor
- }
- GradientStop {
- position: 1.0
- color: blueSlider.fullColor
- }
- }
- border.width: 2
- border.color: "black"
- radius: 5
- MouseArea {
- anchors.fill: parent
- onClicked: {
- colorPicker.currentBlue =
- mouseY / blueSlider.height;
- }
- onMousePositionChanged: {
- colorPicker.currentBlue =
- mouseY / blueSlider.height;
- }
- }
- }
-
- Rectangle {
- id: blueSwatch
- width: blueSlider.width
- height: blueSlider.width
- color: Qt.rgba(0, 0, 1);
- border.width: 2
- border.color: "black"
-
- x: blueSlider.height + 10
- y: 75
- radius: 5
- MouseArea {
- anchors.fill: parent
- onClicked: {
- colorPicker.currentRed = 0;
- colorPicker.currentGreen = 0;
- colorPicker.currentBlue = 1
- }
- }
- }
- }
- }
-
- Rectangle {
- id: navigator
- height: 200
- anchors.margins: 5
- anchors.top: colorPicker.bottom
- anchors.left: parent.left
- anchors.right: parent.right
-
- // These properties contain are used by the modelview to populate
- // new elements
- property int currentX:0;
- property int currentY:0;
- property int currentZ:0;
-
- property int buttonWidth: 45
- property int buttonHeight: 30
-
- Button {
- width: navigator.buttonWidth
- height: navigator.buttonHeight
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.top: parent.top
- text: qsTr("Up")
- onClicked: {
- navigator.currentY += 1;
- topLevel.addItem();
- }
- }
-
- Button {
- width: navigator.buttonWidth
- height: navigator.buttonHeight
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.bottom: parent.bottom
- text: qsTr("Down")
- onClicked: {
- navigator.currentY -= 1;
- topLevel.addItem();
- }
- }
-
- Button {
- width: navigator.buttonWidth
- height: navigator.buttonHeight
- anchors.left: parent.left
- anchors.verticalCenter: parent.verticalCenter
- text: qsTr("Left")
- onClicked: {
- navigator.currentX -= 1;
- topLevel.addItem();
- }
- }
-
- Button {
- width: navigator.buttonWidth
- height: navigator.buttonHeight
- anchors.right: parent.right
- anchors.verticalCenter: parent.verticalCenter
- text: qsTr("Right")
- onClicked: {
- navigator.currentX += 1;
- topLevel.addItem();
- }
- }
-
- Button {
- width: navigator.buttonWidth
- height: navigator.buttonHeight
- anchors.right: parent.right
- anchors.top: parent.top
- text: qsTr("In")
- onClicked: {
- navigator.currentZ -= 1;
- topLevel.addItem();
- }
- }
-
- Button {
- width: navigator.buttonWidth
- height: navigator.buttonHeight
- anchors.left: parent.left
- anchors.bottom: parent.bottom
- text: qsTr("Out")
- onClicked: {
- navigator.currentZ += 1;
- topLevel.addItem();
- }
- }
-
- Image {
- id: axesImage
- anchors.centerIn: parent
- source: "axes.png"
-
- property color buttonColor: "#448888"
- }
- }
-
- Rectangle {
- id: instructions
- anchors.margins: 5
- anchors.top: navigator.bottom
- anchors.left: parent.left
- anchors.bottom: parent.bottom
- anchors.right: navigator.right
- Text {
- anchors.fill: parent
- id: instructionsText
- wrapMode: Text.WordWrap
- text: qsTr("Use this navigator to create new boxes and move around"
- + " 3d space.\n"
- + "Use the color picker to change the color of "
- + "generated cubes."
- // + "\n Click on cubes to remove them from the scene."
- )
- }
- }
- }
-}
diff --git a/examples/quick3d/modelview3d/qtquick3d.ico b/examples/quick3d/modelview3d/qtquick3d.ico
deleted file mode 100644
index c695ac72..00000000
--- a/examples/quick3d/modelview3d/qtquick3d.ico
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/modelview3d/qtquick3d.png b/examples/quick3d/modelview3d/qtquick3d.png
deleted file mode 100644
index 8351083e..00000000
--- a/examples/quick3d/modelview3d/qtquick3d.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/monkeygod/main.cpp b/examples/quick3d/monkeygod/main.cpp
deleted file mode 100644
index cd303558..00000000
--- a/examples/quick3d/monkeygod/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: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$
-**
-****************************************************************************/
-
-#include <QtGui/QApplication>
-#include "qdeclarativeview3d.h"
-
-#include "../qmlres.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
-
- QDeclarativeView3D view;
- QString qml = q_get_qmldir(QLatin1String("qml/monkeygod.qml"));
- view.setSource(QUrl::fromLocalFile(qml));
-
-#ifdef Q_OS_SYMBIAN
- view.setAttribute(Qt::WA_LockLandscapeOrientation, true);
- view.setResizeMode(QDeclarativeView::SizeRootObjectToView);
- view.showFullScreen();
-#else
- if (QApplication::arguments().contains(QLatin1String("-maximize")))
- view.showMaximized();
- else if (QApplication::arguments().contains(QLatin1String("-fullscreen")))
- view.showFullScreen();
- else
- view.show();
-#endif
-
- return app.exec();
-}
diff --git a/examples/quick3d/monkeygod/monkeygod.desktop b/examples/quick3d/monkeygod/monkeygod.desktop
deleted file mode 100644
index c5a8e49f..00000000
--- a/examples/quick3d/monkeygod/monkeygod.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=monkeygod
-Icon=/usr/share/icons/hicolor/80x80/apps/qtquick3d.png
-Exec=/usr/bin/invoker --type=e -s /usr/bin/monkeygod -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_monkeygod
diff --git a/examples/quick3d/monkeygod/monkeygod.pro b/examples/quick3d/monkeygod/monkeygod.pro
deleted file mode 100644
index 8437ae93..00000000
--- a/examples/quick3d/monkeygod/monkeygod.pro
+++ /dev/null
@@ -1,22 +0,0 @@
-TEMPLATE = app
-TARGET = monkeygod
-CONFIG += qt warn_on
-
-INSTALL_DIRS = qml
-CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg
-include(../../../pkg.pri)
-qtcAddDeployment()
-
-SOURCES += main.cpp
-
-symbian {
- qmlDeployment2.sources = qml\meshes\*
- qmlDeployment2.path = qml\meshes
- DEPLOYMENT += qmlDeployment2
-}
-
-OTHER_FILES += \
- monkeygod.rc \
- monkeygod.desktop
-
-RC_FILE = monkeygod.rc
diff --git a/examples/quick3d/monkeygod/monkeygod.rc b/examples/quick3d/monkeygod/monkeygod.rc
deleted file mode 100644
index 1b6228c9..00000000
--- a/examples/quick3d/monkeygod/monkeygod.rc
+++ /dev/null
@@ -1 +0,0 @@
-IDI_ICON1 ICON DISCARDABLE "qtquick3d.ico"
diff --git a/examples/quick3d/monkeygod/qml/Penguin.qml b/examples/quick3d/monkeygod/qml/Penguin.qml
deleted file mode 100644
index 78b6d5d1..00000000
--- a/examples/quick3d/monkeygod/qml/Penguin.qml
+++ /dev/null
@@ -1,77 +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 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 1.0
-import Qt3D 1.0
-
-Item3D {
- id: penguin
- scale: 0.2
- transform: [
- Rotation3D {
- id: penguinTilt
- angle: 10
- axis: Qt.vector3d(1,0,0)
- },
- Rotation3D {
- id: penguinFacing
- angle: 180
- axis: Qt.vector3d(0,1,0)
- }
- ]
-
- light: Light {}
-
- mesh: Mesh { source: "meshes/penguin.3ds" }
-
- SequentialAnimation {
- running: true
- loops: Animation.Infinite
- NumberAnimation {target: penguinTilt; property: "angle"; to: -30; duration: 600; easing.type: "OutQuad"}
- NumberAnimation {target: penguinTilt; property: "angle"; to: 10; duration: 600; easing.type: "OutQuad"}
- }
-
- SequentialAnimation on y {
- running: true
- loops: Animation.Infinite
- NumberAnimation {to: 0.5; duration: 200; easing.type: "OutQuad"}
- NumberAnimation {to: 0.0; duration: 200; easing.type: "OutQuad"}
- }
-}
diff --git a/examples/quick3d/monkeygod/qml/marble.png b/examples/quick3d/monkeygod/qml/marble.png
deleted file mode 100644
index ed9ec689..00000000
--- a/examples/quick3d/monkeygod/qml/marble.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/monkeygod/qml/meshes/monkey.3ds b/examples/quick3d/monkeygod/qml/meshes/monkey.3ds
deleted file mode 100644
index e9a007b2..00000000
--- a/examples/quick3d/monkeygod/qml/meshes/monkey.3ds
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/monkeygod/qml/meshes/penguin.3ds b/examples/quick3d/monkeygod/qml/meshes/penguin.3ds
deleted file mode 100644
index 26c09ac0..00000000
--- a/examples/quick3d/monkeygod/qml/meshes/penguin.3ds
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/monkeygod/qml/monkeygod.qml b/examples/quick3d/monkeygod/qml/monkeygod.qml
deleted file mode 100644
index cecdea5e..00000000
--- a/examples/quick3d/monkeygod/qml/monkeygod.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 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 1.0
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-
- Viewport {
- width: 1000
- height: 800
-
- camera: Camera { eye: Qt.vector3d(21,7,19)}
-
- Item3D {
- transform: LookAt { subject: focalPenguin}
- position: Qt.vector3d(0, 1.7, -6)
-
- Item3D {
- id: monkey
- scale: 2
- mesh: Mesh { source: "meshes/monkey.3ds"; options: "ForceSmooth"}
- effect: Effect { material: gold}
- transform: Rotation3D {angle: 90; axis: Qt.vector3d(1,0,0);}
- }
- }
-
- Item3D
- {
- Penguin {position: Qt.vector3d(-1.5,0,1)}
- Penguin {position: Qt.vector3d(1.5,0,1)}
- Penguin {id: focalPenguin; position: Qt.vector3d(-0.5,0,2)}
- Penguin {position: Qt.vector3d(0.5,0,2)}
-
- transform: [
- Rotation3D {id: swivel1; angle: -20; axis: Qt.vector3d(0,1,0)}
- ]
-
- SequentialAnimation {
- running: true
- loops: Animation.Infinite
- NumberAnimation {target: swivel1; property: "angle"; to: 20; duration: 1200; easing.type: "OutQuad"}
- NumberAnimation {target: swivel1; property: "angle"; to: -20; duration: 1200; easing.type: "OutQuad"}
- }
- }
-
- Cube {
- scale: 12.0
- y: -6.5
- z: -2
-
- effect: Effect {
- color: "#aaca00"
- texture: "marble.png"
- decal: true
- }
- }
-
- Item3D
- {
- Penguin {position: Qt.vector3d(-2.5,0,2)}
- Penguin {position: Qt.vector3d(2.5,0,2)}
- Penguin {position: Qt.vector3d(-1.5,0,3)}
- Penguin {position: Qt.vector3d(1.5,0,3)}
- Penguin {position: Qt.vector3d(-0.5,0,3.5)}
- Penguin {position: Qt.vector3d(0.5,0,3.5)}
-
- transform: [
- Rotation3D {id: swivel2; angle: 20; axis: Qt.vector3d(0,1,0)}
- ]
-
- SequentialAnimation {
- running: true
- loops: Animation.Infinite
- NumberAnimation {target: swivel2; property: "angle"; to: -20; duration: 1200; easing.type: "OutQuad"}
- NumberAnimation {target: swivel2; property: "angle"; to: 20; duration: 1200; easing.type: "OutQuad"}
- }
- }
-
- Material {
- id: gold
- ambientColor: "#EEDD00"
- specularColor: "#FFFFFF"
- shininess: 200
- }
- }
diff --git a/examples/quick3d/monkeygod/qtquick3d.ico b/examples/quick3d/monkeygod/qtquick3d.ico
deleted file mode 100644
index c695ac72..00000000
--- a/examples/quick3d/monkeygod/qtquick3d.ico
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/monkeygod/qtquick3d.png b/examples/quick3d/monkeygod/qtquick3d.png
deleted file mode 100644
index 8351083e..00000000
--- a/examples/quick3d/monkeygod/qtquick3d.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/moon/main.cpp b/examples/quick3d/moon/main.cpp
deleted file mode 100644
index 18e0bf50..00000000
--- a/examples/quick3d/moon/main.cpp
+++ /dev/null
@@ -1,70 +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: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$
-**
-****************************************************************************/
-
-#include <QtGui/QApplication>
-#include "qdeclarativeview3d.h"
-#include "qgltexture2d.h"
-#include "../qmlres.h"
-
-int main(int argc, char *argv[])
-{
-#ifdef Q_OS_SYMBIAN
- QGLTexture2D::setMaxImageSize(256,256);
-#endif
- QApplication app(argc, argv);
-
- QDeclarativeView3D view;
- QString qml = q_get_qmldir(QLatin1String("qml/moon.qml"));
- view.setSource(QUrl::fromLocalFile(qml));
-
-#ifdef Q_OS_SYMBIAN
- view.setAttribute(Qt::WA_LockLandscapeOrientation, true);
- view.setResizeMode(QDeclarativeView::SizeRootObjectToView);
- view.showFullScreen();
-#else
- if (QApplication::arguments().contains(QLatin1String("-maximize")))
- view.showMaximized();
- else if (QApplication::arguments().contains(QLatin1String("-fullscreen")))
- view.showFullScreen();
- else
- view.show();
-#endif
- return app.exec();
-}
diff --git a/examples/quick3d/moon/moon.desktop b/examples/quick3d/moon/moon.desktop
deleted file mode 100644
index 6eae4393..00000000
--- a/examples/quick3d/moon/moon.desktop
+++ /dev/null
@@ -1,8 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=Moon
-Icon=/usr/share/icons/hicolor/80x80/apps/qtquick3d.png
-Exec=/usr/bin/invoker --type=e -s /usr/bin/moon -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_moon
-X-MeeGo-Translation-Catalog=essentials
diff --git a/examples/quick3d/moon/moon.pro b/examples/quick3d/moon/moon.pro
deleted file mode 100644
index 18ecaa4a..00000000
--- a/examples/quick3d/moon/moon.pro
+++ /dev/null
@@ -1,20 +0,0 @@
-TEMPLATE = app
-TARGET = moon
-CONFIG += qt warn_on
-
-INSTALL_DIRS = qml
-CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg
-include(../../../pkg.pri)
-qtcAddDeployment()
-
-SOURCES += main.cpp
-
-OTHER_FILES += \
- moon.rc \
- moon.desktop
-
-RC_FILE = moon.rc
-
-symbian {
- TARGET.EPOCHEAPSIZE = 40000 40000000
-}
diff --git a/examples/quick3d/moon/moon.rc b/examples/quick3d/moon/moon.rc
deleted file mode 100644
index 1b6228c9..00000000
--- a/examples/quick3d/moon/moon.rc
+++ /dev/null
@@ -1 +0,0 @@
-IDI_ICON1 ICON DISCARDABLE "qtquick3d.ico"
diff --git a/examples/quick3d/moon/qml/moon-texture.jpg b/examples/quick3d/moon/qml/moon-texture.jpg
deleted file mode 100644
index b6955e38..00000000
--- a/examples/quick3d/moon/qml/moon-texture.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/moon/qml/moon.qml b/examples/quick3d/moon/qml/moon.qml
deleted file mode 100644
index 02a70979..00000000
--- a/examples/quick3d/moon/qml/moon.qml
+++ /dev/null
@@ -1,65 +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 1.0
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-
-Viewport {
- width: 640; height: 480
-
- light: Light {
- direction: Qt.vector3d(1, 0, 2)
- }
-
- Sphere {
- scale: 1.5
- levelOfDetail: 6
- axis: Qt.YAxis
-
- effect: Effect {
- // Moon texture sourced from:
- // http://www.lns.cornell.edu/~seb/celestia/moon-4k-18.jpg
- // The source texture was scaled down to a more reasonable size,
- // and the brightness and contrast were increased.
- texture: "moon-texture.jpg"
- }
- }
-}
diff --git a/examples/quick3d/moon/qtquick3d.ico b/examples/quick3d/moon/qtquick3d.ico
deleted file mode 100644
index c695ac72..00000000
--- a/examples/quick3d/moon/qtquick3d.ico
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/moon/qtquick3d.png b/examples/quick3d/moon/qtquick3d.png
deleted file mode 100644
index 8351083e..00000000
--- a/examples/quick3d/moon/qtquick3d.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/photoroom/main.cpp b/examples/quick3d/photoroom/main.cpp
deleted file mode 100644
index ff850faf..00000000
--- a/examples/quick3d/photoroom/main.cpp
+++ /dev/null
@@ -1,70 +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: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$
-**
-****************************************************************************/
-
-#include <QtGui/QApplication>
-#include "qdeclarativeview3d.h"
-#include "qgltexture2d.h"
-#include "../qmlres.h"
-
-int main(int argc, char *argv[])
-{
-#ifdef Q_OS_SYMBIAN
- QGLTexture2D::setMaxImageSize(256,256);
-#endif
-
- QApplication app(argc, argv);
- QDeclarativeView3D view;
- QString qml = q_get_qmldir(QLatin1String("qml/photoroom.qml"));
- view.setSource(QUrl::fromLocalFile(qml));
-
-#ifdef Q_OS_SYMBIAN
- view.setAttribute(Qt::WA_LockLandscapeOrientation, true);
- view.setResizeMode(QDeclarativeView::SizeRootObjectToView);
- view.showFullScreen();
-#else
- if (QApplication::arguments().contains(QLatin1String("-maximize")))
- view.showMaximized();
- else if (QApplication::arguments().contains(QLatin1String("-fullscreen")))
- view.showFullScreen();
- else
- view.show();
-#endif
- return app.exec();
-}
diff --git a/examples/quick3d/photoroom/photoroom.desktop b/examples/quick3d/photoroom/photoroom.desktop
deleted file mode 100644
index c3b8c11f..00000000
--- a/examples/quick3d/photoroom/photoroom.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=PhotoRoom
-Icon=/usr/share/icons/hicolor/80x80/apps/qtquick3d.png
-Exec=/usr/bin/invoker --type=e -s /usr/bin/photoroom -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_photoroom
diff --git a/examples/quick3d/photoroom/photoroom.pro b/examples/quick3d/photoroom/photoroom.pro
deleted file mode 100644
index fc54f9a0..00000000
--- a/examples/quick3d/photoroom/photoroom.pro
+++ /dev/null
@@ -1,23 +0,0 @@
-TEMPLATE = app
-TARGET = photoroom
-CONFIG += qt warn_on
-
-INSTALL_DIRS = qml
-CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg
-include(../../../pkg.pri)
-qtcAddDeployment()
-
-SOURCES += main.cpp
-
-symbian {
- TARGET.EPOCHEAPSIZE = 40000 40000000
- qmlDeployment2.sources = qml\textures\*
- qmlDeployment2.path = qml\textures
- DEPLOYMENT += qmlDeployment2
-}
-
-OTHER_FILES += \
- photoroom.rc \
- photoroom.desktop
-
-RC_FILE = photoroom.rc
diff --git a/examples/quick3d/photoroom/photoroom.rc b/examples/quick3d/photoroom/photoroom.rc
deleted file mode 100644
index 1b6228c9..00000000
--- a/examples/quick3d/photoroom/photoroom.rc
+++ /dev/null
@@ -1 +0,0 @@
-IDI_ICON1 ICON DISCARDABLE "qtquick3d.ico"
diff --git a/examples/quick3d/photoroom/qml/PhotoPane.qml b/examples/quick3d/photoroom/qml/PhotoPane.qml
deleted file mode 100644
index 1217727c..00000000
--- a/examples/quick3d/photoroom/qml/PhotoPane.qml
+++ /dev/null
@@ -1,128 +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 1.0
-import Qt3D 1.0
-
-Item3D {
- id: photo
-
- property real layer
- property variant image
- property bool bounce: false
- property string color: "#ffffff"
-
- mesh: Mesh { source: "photopane.obj" }
-
- position: Qt.vector3d(0, 0, -layer)
- effect: Effect { decal: true; texture: image; color: photo.color }
-
- onClicked: {
- if (photo.state == "pulled_out")
- photo.state = "returned";
- else
- photo.state = "pulled_out";
- }
-
- onHoverEnter: { photo.state = "pop_up" }
- onHoverLeave: { photo.state = "returned" }
-
- states: [
- State {
- name: "pop_up"
- PropertyChanges {
- target: photo
- y: 1.0
- }
- },
- State {
- name: "pulled_out"
- PropertyChanges {
- target: photo
- // Center item in the X axis
- x: -parent.x
- }
- PropertyChanges {
- target: photo
- scale: 1.75
- }
- PropertyChanges {
- target: photo
- z: 2
- }
- PropertyChanges {
- target: viewport
- state: "show_photo"
- }
- },
- State {
- name: "returned"
- PropertyChanges {
- target: photo
- x: 0
- }
- PropertyChanges {
- target: photo
- scale: 1
- }
- PropertyChanges {
- target: photo
- z: -layer
- }
- PropertyChanges {
- target: viewport
- state: "show_group"
- }
- }
- ]
-
- transitions: [
- Transition {
- from: "*"
- to: "*"
- NumberAnimation {
- targets: photo
- properties: "x,scale,z,y"
- easing.type: "OutBounce"
- duration: 700
- }
- }
- ]
-}
diff --git a/examples/quick3d/photoroom/qml/photopane.obj b/examples/quick3d/photoroom/qml/photopane.obj
deleted file mode 100644
index 1f5e91df..00000000
--- a/examples/quick3d/photoroom/qml/photopane.obj
+++ /dev/null
@@ -1,11 +0,0 @@
-s 0
-v -2 -1.5 0.0
-v 2 -1.5 0.0
-v 2 1.5 0.0
-v -2 1.5 0.0
-vt 0.0 0.0
-vt 1.0 0.0
-vt 1.0 1.0
-vt 0.0 1.0
-vn 0.0 0.0 1.0
-f 1/1/1 2/2/1 3/3/1 4/4/1
diff --git a/examples/quick3d/photoroom/qml/photoroom.qml b/examples/quick3d/photoroom/qml/photoroom.qml
deleted file mode 100644
index 2489026c..00000000
--- a/examples/quick3d/photoroom/qml/photoroom.qml
+++ /dev/null
@@ -1,164 +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 1.0
-import Qt3D 1.0
-
-Viewport {
- id: viewport
- width: 800; height: 480
- picking: true
- //navigation: false
- //showPicking: true
-
- camera: Camera {
- id: main_camera
- eye: Qt.vector3d(0, 4, 12)
- center: Qt.vector3d(0, 0, -2.5)
- }
-
- ListModel {
- id: imagesModelLeft
- ListElement { image: "textures/woman.jpg"; }
- ListElement { image: "textures/niagara_falls.jpg"; }
- ListElement { image: "textures/place.jpg"; }
- ListElement { image: "textures/basket.jpg"; }
- ListElement { image: "textures/qtlogo.png"; color: "#006090" }
- }
-
- Component {
- id: paneComponent
- PhotoPane {
- layer: index
- image: model.image
- // Items end up with the default value defined in PhotoPane if you
- // try and assign an undefined value, but this logic avoids a
- // string of warnings
- color: (model.color == undefined) ? "#ffffff" : model.color
- }
- }
-
- Item3D {
- // Left stack of images
- x: -2.1
- Repeater {
- delegate: paneComponent
- model: imagesModelLeft
- }
- }
-
- //! [0]
- ListModel {
- id: exampleModel
- ListElement { image: "textures/niagara_falls.jpg" }
- ListElement { image: "textures/place.jpg" }
- ListElement { image: "textures/background.jpg" }
- ListElement { image: "textures/basket.jpg" }
- ListElement { image: "textures/woman.jpg" }
- }
- //! [0]
-
- //! [1]
- Component {
- id: exampleDelegate
- PhotoPane {
- layer: index
- image: model.image
- // If you intend on removing elements from the model,
- // include this line:
- enabled: index != -1
- }
- }
- //! [1]
-
- Item3D {
- // Right stack of images
- x: 2.1
- //! [2]
- Repeater {
- id: exampleRepeater
- delegate: exampleDelegate
- model: exampleModel
- }
- //! [2]
- }
-
- states: [
- State {
- name: "show_photo"
- PropertyChanges {
- target: main_camera
- eye.y: 0
- }
- PropertyChanges {
- target: main_camera
- eye.x: 0
- }
- PropertyChanges {
- target: main_camera
- eye.z: 12
- }
- PropertyChanges {
- target: main_camera
- upVector: Qt.vector3d(0, 1, 0)
- }
- },
- State {
- name: "show_group"
- PropertyChanges {
- target: main_camera
- eye.y: 4
- }
- }
- ]
-
- transitions: [
- Transition {
- from: "*"
- to: "*"
- NumberAnimation {
- targets: main_camera
- properties: "eye.y"
- easing.type: "OutBounce"
- duration: 700
- }
- }
- ]
-}
diff --git a/examples/quick3d/photoroom/qml/textures/background.jpg b/examples/quick3d/photoroom/qml/textures/background.jpg
deleted file mode 100644
index 2c1af3c6..00000000
--- a/examples/quick3d/photoroom/qml/textures/background.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/photoroom/qml/textures/basket.jpg b/examples/quick3d/photoroom/qml/textures/basket.jpg
deleted file mode 100644
index c292a83d..00000000
--- a/examples/quick3d/photoroom/qml/textures/basket.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/photoroom/qml/textures/niagara_falls.jpg b/examples/quick3d/photoroom/qml/textures/niagara_falls.jpg
deleted file mode 100644
index 69b51371..00000000
--- a/examples/quick3d/photoroom/qml/textures/niagara_falls.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/photoroom/qml/textures/place.jpg b/examples/quick3d/photoroom/qml/textures/place.jpg
deleted file mode 100644
index 03e53443..00000000
--- a/examples/quick3d/photoroom/qml/textures/place.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/photoroom/qml/textures/qtlogo.png b/examples/quick3d/photoroom/qml/textures/qtlogo.png
deleted file mode 100644
index 7d3e97eb..00000000
--- a/examples/quick3d/photoroom/qml/textures/qtlogo.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/photoroom/qml/textures/woman-photo-credit.txt b/examples/quick3d/photoroom/qml/textures/woman-photo-credit.txt
deleted file mode 100644
index c7f04c1c..00000000
--- a/examples/quick3d/photoroom/qml/textures/woman-photo-credit.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-http://www.flickr.com/photos/fromthefrontend/
-
-Attribution:
-
-<div xmlns:cc="http://creativecommons.org/ns#" about="http://www.flickr.com/photos/fromthefrontend/4527587863/"><a rel="cc:attributionURL" href="http://www.flickr.com/photos/fromthefrontend/">http://www.flickr.com/photos/fromthefrontend/</a> / <a rel="license" href="http://creativecommons.org/licenses/by/2.0/">CC BY 2.0</a></div>
diff --git a/examples/quick3d/photoroom/qml/textures/woman.jpg b/examples/quick3d/photoroom/qml/textures/woman.jpg
deleted file mode 100644
index f3a6abc2..00000000
--- a/examples/quick3d/photoroom/qml/textures/woman.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/photoroom/qtquick3d.ico b/examples/quick3d/photoroom/qtquick3d.ico
deleted file mode 100644
index c695ac72..00000000
--- a/examples/quick3d/photoroom/qtquick3d.ico
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/photoroom/qtquick3d.png b/examples/quick3d/photoroom/qtquick3d.png
deleted file mode 100644
index 8351083e..00000000
--- a/examples/quick3d/photoroom/qtquick3d.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/qmlres.h b/examples/quick3d/qmlres.h
deleted file mode 100644
index 186451c3..00000000
--- a/examples/quick3d/qmlres.h
+++ /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: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$
-**
-****************************************************************************/
-
-#ifndef QMLRES_H
-#define QMLRES_H
-
-#include <QtCore/qdir.h>
-#include <QtCore/qcoreapplication.h>
-
-#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;
-}
-
-#endif // QMLRES_H
diff --git a/examples/quick3d/qtquick3d.svg b/examples/quick3d/qtquick3d.svg
deleted file mode 100644
index 3b8a5c7a..00000000
--- a/examples/quick3d/qtquick3d.svg
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0"?>
-<!-- Converted with SVG Converter - Version 0.9.5 (Compiled Mon May 30 09:08:51 2011) - Copyright (C) 2011 Nokia -->
-<svg xmlns="http://www.w3.org/2000/svg" width="287" version="1.1" height="286" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="tiny" id="svg2">
- <defs id="defs4">
- <linearGradient gradientTransform="matrix(1.0104795,0,0,1.004441,23.387309,76.758859)" id="linearGradient3730-2" y1="131.35715" y2="156.39526" x1="23.626827" gradientUnits="userSpaceOnUse" x2="303.57144">
- <stop offset="0" style="stop-color:#038d30;stop-opacity:1;" id="stop3726-7"/>
- <stop offset="1" style="stop-color:#038d30;stop-opacity:0;" id="stop3728-1"/>
- </linearGradient>
- <linearGradient id="linearGradient3724-7">
- <stop offset="0" style="stop-color:#038d30;stop-opacity:1;" id="stop3726-7"/>
- <stop offset="1" style="stop-color:#038d30;stop-opacity:0;" id="stop3728-1"/>
- </linearGradient>
- </defs>
- <metadata id="metadata7"/>
- <g id="layer1" transform="translate(-25.071424,-77.933617)">
- <path style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#00ffff;stroke-width:8.85648727000000060;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="path3722" d="M 149.39285,339.37194 C 118.29002,338.06386 93.410274,329.21846 78.267585,314.08502 66.239667,302.06444 58.159936,285.11057 54.818135,264.88047 c -1.962614,-11.881 -2.442596,-20.11519 -2.455216,-42.1199 -0.01051,-18.36712 0.160997,-23.0644 1.239861,-33.95521 2.529982,-25.53941 11.482605,-46.43472 25.677112,-59.93007 16.042727,-15.25252 39.462148,-23.21337 72.203768,-24.54383 6.77105,-0.27512 31.97542,0.38686 41.46813,1.08915 17.85829,1.32123 29.86273,4.01251 41.92069,9.39824 16.71724,7.46685 28.60768,18.52238 36.44553,33.88638 5.7477,11.26691 9.34961,23.29707 11.69339,39.05536 2.22754,14.97664 2.81073,44.00559 1.22086,60.77114 -2.76934,29.20404 -10.704,50.36949 -24.19378,64.53629 -8.65346,9.08774 -21.29946,16.39504 -35.37578,20.44137 -13.11053,3.76868 -25.14568,5.0858 -52.44498,5.73944 -13.81368,0.33078 -17.4242,0.35023 -22.82487,0.12311 l 0,0 z"/>
- <rect width="236.93414" x="49.282932" y="102.78797" rx="95.84404" ry="92.255867" height="239.43414" style="opacity:0;fill:none;stroke:#008000;stroke-width:3.29858350999999980;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="rect2852"/>
- <rect width="175" x="28.571428" y="19.214285" rx="95.84404" ry="92.255867" height="206.07143" style="opacity:0;fill:#b94b4b;fill-opacity:1;stroke:#05d105;stroke-width:4.147;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="rect3704" transform="translate(25.071424,77.933617)"/>
- <image width="191.18274" x="73.931854" y="148.93103" height="144.13199" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAK0AAACDCAYAAAD/CZsFAAAABHNCSVQICAgIfAhkiAAAIABJREFU&#xa;eJzsvXmUXdV5L/jb+0x3qltzqVSTZglJIECI0QYMjTEE45jwVszCcUgcp1fil3ZC2unl9PJb7tXL&#xa;dl4Sk7x46DhJ20mcvNjQL7Ed2wkewIARYIVJDJoQmkpIVarxzveeYe/+Yw9nn3NvSaUBnO7w2YXu&#xa;PfecPX77+37fsPchADjeprfp/0NEf9YNeJveprMl+2fdgNMRIUR/5vxthfA2Cfp3LWkVoxJCEgz8&#xa;Nv3Hpn93kra7uxvr1q3DwMAABgYGYFkWbNtGFEWYnZ1FqVRCqVTC3r17EUXRz7q5b9PPgP5dMO3Y&#xa;2BjGxsZwzTXXYGhoCFu3btVMSymFZVngnGNmZgblchmlUgkvvPAC9uzZg/3792Pfvn1vw4f/QETw&#xa;M/QeZLNZbNu2DR/4wAewefNmXH311chkMshkMvoexYyUUjDG9PVWq4V9+/Zhz5492LNnD772ta+h&#xa;XC6jXC6/5f14m9564j+rv76+Pv6xj32MT05OcsYYZ4zxKIp4FEVt3znnPAxD/ad+bzabvFwu86uv&#xa;vpqPjY39zPry9t9b+vfWVkgI4ZlMhheLRT43N8er1SoPw1Azp/mnGFR9Nhk6fQ/nnH/1q1/lq1at&#xa;+lkP6Nt/b/LfW+49cBwH999/P15//XX09vYil8t19AwQQkApBSEEnHNQGjfV9CpQSkEpBecc9957&#xa;L+677z7kcrm3rD9v01tPbzmmffrpp7XhZRpPijnTZDJo+n71u2Jqzjmmp6dx6tQpXH755Ynnz0SE&#xa;EHz4wx/Gr/7qr2J6ehpzc3M4dOgQFhcXceLECUxOTuLYsWOYm5s7574DgOu6GBkZwcjICIaGhlCv&#xa;1zE1NYWpqSmcOnXqvMr+j0Jvqffg6quvxujoKLq6ujQzcc4TDLkUk6WvL3VfPp/H0NAQNmzYgLm5&#xa;uWUzmWVZ6O3txfj4OPr6+lCv17FmzRo0m01UKhU89dRTIIScNdOqxTU6OorR0VHccccd6OrqQldX&#xa;F/L5PIIgQLVaRbVaxbPPPov9+/fj1VdfRRiGZ1XPfyR6S5jWcRzYto1PfvKTGB0dBRAz61K01O+m&#xa;5FWkgg+cc+TzeeRyOdx///34l3/5F3zve9/T0vhMbRwYGMD4+HjHunzfx969e5ffaYOuuOIK3Hvv&#xa;vdi0aRNuv/32JbXHvn378Oqrr+Kv/uqv8NRTT6FWq51Tff9/p7eEabds2YJLL70Ut912WxvTLcW4&#xa;CsMGQYAwDEEpheu6p2V0xQSEEHzwgx9EvV7HM888g9nZ2TO20XVdOI6jv6eZvNFonBM0+MhHPoJ3&#xa;vetdeO9734tCodD2u7k4N2/ejA0bNqCvrw87d+7EZz7zGURR9JYHUbZv3w7f91EqlVCv17GwsLCs&#xa;hf9W0VtiiG3atAl33nknLMtaVkhW3UMIQRRFaDabaLVaietLlaMMs66uLqxcuRJ9fX3LGmwVxEiX&#xa;abaj1WqdXcchmPbGG29EV1dXW5nqs/mvbdu47rrr8Fu/9VtwHAeWZZ11nedLl19+OS6++GKMjY2h&#xa;r6/v310Y/U2TtKqTfX192LZtG+644w5EUaQl6OlU/+HDh3H48GH89m//NmZnZzEzMwPOOa699lrc&#xa;dtttuO2227Bjx46Oq9/Extu3b8cVV1yB/fv3n7G9StIuZQy2Wi1UKpVl9/+6667DddddhyuvvLKt&#xa;nemcCvW7GhMVYPnsZz+Lhx9+GP/6r/+67HovBD3wwAPwPE8HeS6//HJtLP57oTfVp/bVr36VP//8&#xa;823BAtPPqnyvnHO+a9cufscdd5yx3EcffbQt+GCWF4Yh932ff/rTn+bd3d1nLG/16tX8r//6rzsG&#xa;OGZnZ/l/+S//hReLxWX1ua+vj//Zn/2ZLssMipj97eSPNr8zxviXvvQlPjQ09Jb6QZvNJg+CgCta&#xa;v3497+vrO+fy8vk8Hx8f5+vXr+ee53Hbts+rfW8aPMjlcujv78d9992Hbdu2gTHWUYqZEvfHP/4x&#xa;vvSlL+F73/veGcu/55579GclqdIuMcuysGbNGlx//fVnLK+vrw99fX2Ja6q8crmMSqWCarV6xnIA&#xa;4IYbbsD111+fCDub7TLL7kSmOr7mmmtwzTXXLKve8yXHcZDNZuG6bgKWNBqN8/JmbNu2DX/+53+O&#xa;V155BaVSCZ/73OcwODh4zuW9aUzb29uLdevWnRUe+uY3v4l9+/Yt6/5arYannnoKk5OTpzXqBgYG&#xa;sHnz5jOWl81mkc1mE9dUeY1GA0EQLIvRuru7sWrVKqxYsaKjp8O8f3p6GtVqFUEQtPmd1eeenh70&#xa;9vaesf0XghzHQT6f199VW4IgOC9j0LIsjc8tywJj7LwWwZuGabdt24bbbrsNQLt7Kj35J0+exIkT&#xa;J/C3f/u3yzZ2arUaPv/5z+Puu+9OuKlMnAgAa9euxS233II//uM/TjyvjC5KKXzfR09PD7q7uzvW&#xa;deLECVQqlTY3XCcmvu222/COd7wDw8PDievqOd/38dxzz+G5557D3r17kc/ncfHFF+Piiy/G9u3b&#xa;2xh85cqV2LRpEyYmJnDs2LFljc25UldXF1asWNF2/XwlbSaTQS6X09K71Wqh0Wicc3lvCtO6rotL&#xa;L70Ud99995I+SXUtiiI8+uijeOihh846Q+uxxx7D9u3bEUURbLtzV3p7e7F27dq261dddRXWr1+P&#xa;9evXo1KpaGs5HewAgFKpBMdxsHLlSgRBgHq9jiAIEASBvkfdf99992H9+vVtMIBzDsYY/uiP/gg/&#xa;/elP8cwzz2B+fh6A8K5s3LgRX/jCF9Dd3Y1isajLzWQy2LJlC9797nfjK1/5ylmNz9lSp7EihKDV&#xa;ap2XpM3lcjq0roxa3/fPubw3jWn7+/sxMjJyxkgWYwz79+/Hd7/73bOup1arwff906pt27YTqY6K&#xa;duzYgXe/+9249dZbsbi4CNd1kc/nO7q8lAtteHgY9Xpd43OTaRVt3LgRPT09mvlVecrf+vnPfx6N&#xa;RgP1el0/s3//fuzfvx+/93u/h4mJCc206tmBgQFs2rTprMfnbCmbzSZwvdn28/HROo6jfeCMMf13&#xa;rvSmMK2SYMvJF1DQ4FyoXq9jbm4Ok5OTWLt2bcJ9pCjNjOq3DRs2YGhoCJ7nYWhoqK1ss6y77roL&#xa;d911FwBoKRGGIcIwxNe+9jV8/OMf10nrnaQ6ALz66qvYvXt3xwCFatsf/MEf4IMf/CDuvffexO8b&#xa;N25EX18fPvGJT7ypTv5XXnkF+/fvx5NPPgnP81AsFpHJZM47uKEkLSEECwsL5wUNgDeJadesWYM1&#xa;a9YAgE5kAdCRgV988UW8+OKL51QP5xyTk5N4+umnsW7duoR0U5Nr27YeMLN+FXlK50Ck/abmd1We&#xa;GSRRSS47duzAe97zno4LBwB+9KMf4U/+5E+W7AshBDt37sRVV12FZrMJ13W1T7tQKMC2bb3tyGQi&#xa;Fbau1WpoNpvnxdRhGCKKIhw8ePCCLg7VRs45pqamlu2FWYreFO/B+Pg4xsbGtBroNACKaV999VW8&#xa;+uqr51zX3NwcXnvtNQAxboyiSNerLNdCoQDXdfVzmzZtwsDAgH5OPWuqLXUtHQwwIcSxY8dAKcW2&#xa;bdvaJKS67/XXX8fu3btx8uTJjn1Q9ZTLZRw5cgRvvPGGVslKIzmO0+aKIoTg/vvvx9GjR1GtVtFo&#xa;NPDiiy/iwQcfbKujt7cXl19+OW655RZcffXVuOiii7BixYpE6NociwtFlFLk83ntlZienj7vnIoL&#xa;LmkzmQyy2WzbYABJaQaICZ+fnz8v9eP7/mkjVapOx3G0BUwIged5eu/Z+VC9Xkcmk4HnefA8r81l&#xa;BYiJmp6eXnZ5jUajY0KQbdsJKz6Nv5Vk7oQXx8fHce211+Kqq66C7/toNpt44okn8MQTT2htsX79&#xa;emzYsAGDg4NoNps4evQopqencfjw4SXbOzo6ik2bNmm49G//9m8JrG9ZFlzX1YZytVo9LyMMeBOY&#xa;dv369RgdHW3zeSoyB/rpp5/G0aNHz4tpFa5N+0TT37PZrB7MbDaLrq4unYCzHFfWUn2Ym5tDb28v&#xa;urq62pLPlZQ8dOgQXn/99WX1Z25uDvPz8xqCqLbZtg3P8xJMm8/n4XkebNvWWqXZbHbEzZs3b8a7&#xa;3vUu3H333fpaFEV47rnndJ+uuOIKfOADH8C2bdvQbDbx4x//GE899VRHplUQ8J577kkw7eOPP46/&#xa;+Zu/QaVSQaVS0QELz/MAAKdOnUpIWpWTQQhJuNZOa1wvayTPgq6++mpMTEzolZXGsSaD7Nq1C2+8&#xa;8cZ51ReGIZrNZqJ8sz51Te2CAET0K5PJJPIgTjdIp+vD7OwsNm3ahMHBwbbkFkIIyuUyjh07tmxJ&#xa;22lzpmqn67q6r4CQct3d3Yl6FxYWOjLZ2NgYisViYsGZWooQgr6+Pqxdu1bbIwcOHEhAKkVbt27F&#xa;HXfcgTvuuCMRbeSc47rrrgMA/OQnP8GTTz6pF5bqgwqoqMSmj3/84zrvo1qt4tOf/vSS0VNFF5xp&#xa;R0ZGEhlNS0WFCCE4fvz4ee+e5ZwjiqIzMp45ENlsVkuntJRVbTPVvFK3naR4tVrFxMSEDkyk21Aq&#xa;lTA/P79sHNdqtdBqtdoMQRWWNtva29uLbDab6Huz2cTCwkJbucViUcMXdX8YhlpVq/JNWLdUWVu3&#xa;bsWOHTtw/fXXa4GgxjeXy+HWW2/FyZMntRfC9KEreKCy6n7zN39Texd838dnPvOZM0ZELzjTXnLJ&#xa;JRgaGupofQNJ5t23b9+ycl1PR8pIAZKuNNPiJ0QkcSsYUqlU8Id/+If6IJBbbrkFQ0NDba4v9fzU&#xa;1BRc14XnecjlctqKZ4xhZmYG119/PVatWtVx4ezZswczMzPL7o/v+/B9f8m0S/O6WizmwiuVSpic&#xa;nGx71lxYilSgBBDz4rouCoWCLq/RaOgACAAdhv3Sl76EbDar+6rGVbXh4MGDGrL19vYm/OSzs7Oo&#xa;1+sYGxvD6tWrdeojAHz961/v6PtO0wVhWtOqTlvlpuGVntC5uTk0m822Mw3OhhzH0VjSrMdkXMYY&#xa;arWaHpCpqSn8/u//vi7jy1/+Mq644ooE0yqf4tzcHC699FK9+0I5ylW/fN/H1q1bl/T1ni0E6mTI&#xa;LTV+a9asQW9vb4KRl0pWHx0dTcCDxcXFBIaklMLzPG3lM8ZQr9dRKpV0GZs3b8bWrVvR39/f0X2p&#xa;/p2ZmdGLoa+vL8Hg5XIZrVYLN954I+67775E2z/72c8ua4wumKRVGGXVqlUJHJSWtEotqUE5UyLK&#xa;mSiXy+lFkq5T1ccYQ6PRWLKe9evXJyJB6r5SqYSjR4/C9/3TSoCVK1cmJJRZ9+7du88qD1VJM3My&#xa;lepNY71Vq1YlpKdKmO/kTenp6UlIvDQ0S8ODKIpQr9exuLio77n66qvx4Q9/WMMxhVNPnTql57+v&#xa;r09LU0Awreknn5mZQTabxY4dO3DTTTeBMYaDBw/i4MGD2nV5JrpgTGt2wiRTWqjPKmHifLOHAOjI&#xa;zVL+xeVkFJkY12SWer1+RviSzWaRyWQ6Gp6A0CZnEwFSkEWRuQAUJFFkMqL6PQiChEtJ9cdsIyAW&#xa;pGnUKc2h5pBzrl1jykU4NDSE8fHxhPacnp7GAw88oK/9zu/8DprNph7zfD6fwMmlUglDQ0M6xE8I&#xa;wdGjR/HEE08se4wuCNOahoJacaZKM9UH5xz1eh0zMzM6gnM+1NPTg1WrVrVdV3Uq78Lp6unp6dEu&#xa;GdPwmZ+fTwQulnq2WCy2uajUInrjjTfOythUPl+TVFlBECSYdmRkRKt8pcE6SVpCiHbxqe/Hjh1L&#xa;qP5MJpPwpyrtpNo+ODiIdevWYXx8PGEv/Omf/ik+97nPJeqamZnRhufg4GACvpXLZdx8883Yvn07&#xa;OOcol8t49tln8Q//8A/LHqMLJmlVYkp68gC0STC1dUVJ2XNlXEII+vv7sXHjxrbfVJlhGC4p6cz9&#xa;ZIpRzLbOz8+f0b+qnk1DIBOWnE1an5kRpfqoonymMUkp1UaOqjcIgra0PyUB09ogzbRDQ0MoFAra&#xa;FlBSW8G3sbExjI6O6roWFhYwPz+PL3/5y4n2/8Vf/AUGBwe1Adff369DuICAGFdddRVGR0dBCMGD&#xa;Dz6Ip59+GsePH1/2GF0wplWRjzRESDvtTVfL+UpZQggKhQKGhoaWdHlFUYQwDDv+RinVTvtOGwjT&#xa;1nMnMgMU6YXaCYeeiVzX7egbVTDHdL+l2326DKq0MCmVSoncZeUSU+1Ph9+LxWICPy8sLODQoUNt&#xa;WmRxcTGBg3O5XMK7c+WVVyb8+N///vd1rsNy6YJL2rRbxmQmdf1cd7amyXVd9PT0JCRA2lvh+/6S&#xa;CRr5fB7FYjGh3s32Li4u4ujRo6dtQ9pzkXZVpXHomUi1hzGmw8xK0pplZTKZNuNK3ZO2E5Q7y7Zt&#xa;3b7JycmEpFWBCjMUbJaTdgnu3bt3Wemkynug6v3gBz+IXC6Her2Oer2O73znO2ftObqgTGuGbtOW&#xa;tLoGQKu68yUlHYB4cTDGtAtNSZSlGE95HpSKTRuNCnufjpRUXMoQPFttojCyuXOZMaZVtcm0XV1d&#xa;ifyJ020LUlEpNS/pbKvx8XF0d3frvjebTW0LUEqxYsUKzbTKd/3SSy+dsT9pCKP2hj3++ON4/PHH&#xa;z2lHxAWFB47jaEmbxrVAUhp18jScLQ0ODiKfzyfSH9MS7/jx43jmmWc6Pp/P59u2l5gMUC6XzxjJ&#xa;Uup5qSjOUsxsknrWtm309vYmmIcQgmazicXFxUQyttpmbvZbGX1mfdlsVm91MTXQwsJCwnug3Haq&#xa;rFqtppk6l8uht7c34darVCrLwqHd3d0Jw1Lh/IcffhgPPPDAGZ/vRG/pqYnmAF+IQyjGxsb0BC9F&#xa;5XK5Y4QIEBOa3jRoeh1ardYZIzRnCjmacOVM9ylokMlkEs9Vq1WcPHkywYyd3GLKcW+S53l6jNRC&#xa;SBt1ALR3QUlyczuRiUsVBUGwLFdeOp0SQBvUOVu6YEyrMFBazSoyB9zzPBQKhWVP6FJ0++23Y8OG&#xa;DW0BDLPu48ePY9euXR2f7+vrw/r169ueAUTcXW3nOR2lPQbp/qQx/ulo9erVGB4eRjabTUz05OQk&#xa;nnrqqUQfFWObbVA41RwHte9LtUNBjTSDDw8PI5/P62er1arezKk0mjlGrVZrWa68QqGQMPA453Ac&#xa;B319fRgZGVnWuKTpgjGtimObid+K0uoxl8thcHBQbys+F8Z1XRd33HEHNmzY0LEuzjmq1SomJydx&#xa;6NChjmX09fUlnjf/VXmtZ6I0hkwbhAoynY4UFr/yyisTE6nKOnbsGHbu3Jl4RuUcmHV3YtrBwUFs&#xa;3rxZt0d5U9LBhYGBAe2aUmOnoJHKilOkBNRy8gSUBFf8wTmH53nYvHkzbrnlljM+34kuGKZVKud0&#xa;/ln1WSVmqKTmc4mKua6LiYmJ0x6zVKlUsLi4mJgck0x4kF5YKj/0THS6pGyF3Ze7KNesWYOenp62&#xa;65VKpS1/wTyfQFEneKCOPlWkFkh6h62KCioy4UFaxZ+tC8+yLA0nFL4dGBjARRddtOxyTLpgkrbV&#xa;aqFUKiX8iOnJUkzc1dWlUxhN1XE2dNNNN51WUlNKceLEiSWTVSilGBgYwMaNG3VbVTmUUrRarSWZ&#xa;3aRyuZx4Nm1sqqSW5ZDKFlPEOUetVsORI0fwyiuvJO5VznmzbpWoYo7HyMgIduzYob8reGBqQ9d1&#xa;EzkChBDtkgLQdhDe2WhHBQ9effVVPPjgg3phbdq0Ce973/t0FPVseOCCMK2JlUzJaQ6qOZnq88qV&#xa;K5HP588JkP/Kr/wKgFhydOr0gQMHcODAgY7PU0r10U1pycE5b3OSL0Xz8/M68SfdR0II3vWud2H1&#xa;6tWnLUO1Q8EDE2IsLCxgZmamTYKuXLmyrZzFxUW0Wi2tfRzHwcjICLZu3ZoIdqgghRIimUxG+1MV&#xa;mUxr7rlTbTOz605HKhJXrVYxPT2Nl19+GdPT0ygWixgfH0/kfSyXLqghFoZhYjvFmdw9t956K9at&#xa;W7fsOszzB9773vcmIkRmO1SG0pEjR3DixImOmFLtbjUd7qYxtVymPXXqlI61mzF51e+77rrrjGrw&#xa;hhtuwCc/+UnYtp1oKyEEr732Wsfsp+UcYVosFjEyMqIZXAVbzIw3FVlT4VY1FqbLS6V1muPU3d19&#xa;2sWotKmSyiq6+MQTT+Do0aN6a/873/lOTExMnLYfabogTKvcKGEYYteuXThx4kSbhAXazz34+Z//&#xa;+bPCNYwx3H777fjiF7+oIzxKvajyVT7Bd77zHbz44ouo1WpLhjXVn3rWdAuZhsiZaM+ePZidnW3r&#xa;M2MMl156KS6++OLTHri2fft2fOQjH0kwu1o8S+0vMzGtqm9kZASFQkFrussuuwyXX355AvbUajWc&#xa;OHGizZdrUhAEqFQqWtKqLTLmol69ejVuvPFG/UyhUMDw8DA++tGPJr4r1a/g40MPPYQ9e/bocXrf&#xa;+9531geRXHA/7eTkpHaFpCVPWjKMj4/r5OTl0ODgICYmJrBp06aO5Zrfd+7cuaR/FkBbECRdlloQ&#xa;y6HXXntNZ+p3atPExMSS0uSee+7Btm3bOu5enpubw/T0dEfXkhlQUXT55ZfrM8SGh4exZcsWnZWl&#xa;qNVqaQmq2pk+Ukrlhigj00ygV+O1Zs0a3HzzzVixYgWGh4dx44034td//dd1hFAZ22aZrVYLMzMz&#xa;WFxc1Eb7JZdcguHh4bPy21/w7TaPPPIIVqxYgWuvvbZNyqpVqgZrbGwMt9xyC3bu3IlHHnmkze8I&#xa;9TznKBaL+NSnPoUrrriiTTqbTKK2q3zzm988rR9RSdml3FFjY2MYHx/Hyy+/3GYopL0d3/nud9Hd&#xa;3Y0rr7yyzSDjXCSJfOhDH8L4xAR+9KMf6d0P7//5n8f999+P/v7+tgOdCSH41re+hV27di3LH8o5&#xa;x5133onBwUFcdNFFWLt2LXbs2KEXi2pPpVJNnOjDOU9IWhWBq1Qq0uVHdEZXo9HQbrENGzZgzZo1&#xa;+NSnPgVCCC655BJcfPHF+MQnPgEA+iR2RQoenDp1CocPH8apU6cwOjqKK6+8Ejt37sTg4OCyk+Uv&#xa;ONPu2rULV111Fer1ets7BswJVYy2fft2/NpHPoJVq1bh7/7+78FSCR9Dg4MYHBzEhz70IXz0ox9t&#xa;C16YbjVCCA4cOICXXnqpLYIkWyD/5SCGpE2XwznHRRddhF/7tV/TZ+uq++bn5/GXf/mX8YIC8Pzz&#xa;z+Omm25CFEUdJeaKFSvwi7/4i7jxxhtx7TXX6Eyu97///Vi5cmXH/hBC8JWvfEWEStNGJueoSS+B&#xa;2cfR0VHceeedeM973rPk+9mq1QpOnEiOTa/ctaHKqzcaMo9BSNpWq4Xjx4/j5MkprF0rduoqe+A3&#xa;fuM3EvOrdh0rTAsImFStVvU2oEOHDuHQoUMYGxuD67oYHR3FZZddhocffritvZ3ogjNtqVTSvlEV&#xa;9eoULVKfc7kc3nHddRgfH8fXv/ENhBIfAwBkNGbLli342Mc+lqgnPWGKDh8+jEcfffS8dkSokOrt&#xa;t9+Om2++OfG+h9dff10wrbgR4ByNeh2+9HummVa1U6nRrVu3atwtutienaZo3/79aJoBDlkfgMSB&#xa;HuY4qA2YpkfF/N33fdRqyay3vBQu6r4gCBCl7IBSuYxSuZS4ll7sql2qHQWjXN/3NUZOG7nd3d1n&#xa;ZYydG9PGAku1Pv6Nc+zduw979+5NnIbdicnUtfHxcUxMTOD48eM4ceIEjh8/Ds441q1fh76+PvRL&#xa;S1ntTVIutjSVSiV9WIRul9FWMbgEnDNETPylXTnmRJvvHVCkomuEUIBSECos4xd378Y3HnoIv/LL&#xa;vyzK4lyPi4lv0056NQYqOw0Anty5E0/ufBIL8/MglILatmg3IUAUgUchDh87lsDPnbSOeiuNmXJY&#xa;q9VwamYG1LLBOQNnDEMrku4z5UslhACy3D179mLPnj3Yfvnlif4ASCwQxYxmUCOKIlSrVZ2bfOTI&#xa;ERw5ckS3fePGjbjzzjtjYXAGOnumNTEbEd/lFdmBCLtf2o3dL72EG264IfFoelWaTMw5R3exiO5i&#xa;EVtk2FExpqkyTYmUllKPPfY4HnvscXHNUjiU6narNvOII/R9RGGIMLX9eakFoeiExF2CmRwQm4LY&#xa;Dh576mk8u/tl/PIv/VJbeWZbO2WkmZ+r1Sq+/e1v44EH/gTUcUCoBWI7cTkAGOd4/oUXE1rMlNxq&#xa;vJ7+6S6Ac9x+23v0tXqzidn5eVDHAQtDcMYwPJrMASiVymg1W4BFAcuG7bg4cvwNPP/Ci7juundg&#xa;9aqJhPAw50Wlcvb09OhDPwCRy6GYtlQq4dChQzhw4ICOjC512mQnWh7TJgaX6hUIQGNDyEGzCMFi&#xa;qYyf/ORJDK8cwX/6hbsSE3Y6SlvE6Qk2t4Wnmf/7P/gB/vEf/wdeevklWI4LYlkglIBod5gRxaEU&#xa;rUoJ9XoD1UoVxQ5vkFyKXj90CAABdRxYmSyo42pmKC2ewP/zzW9h6+bNuHjLZl2eSWZ/1ISbVvw/&#xa;fevb+OZ3vgvL80C9DKhlgdoOQCk4AZSIOPbGSVSqVbjyYLp4fsTvP3z0x/jRI49g7erVIITADwLY&#xa;loV6vYGZuXlQLwNOAoARjIynjLVaFa3AF4vFywK2DTCGL//N3+Irf/d3OLxvr0h5zGb1nD744IN4&#xa;8KGHtHvuhz/8IV584UX87u/+btvRVVEU4Qtf+AK++MUvto3LcujMTKslm5BShFDBCFLCCokm/kBi&#xa;Jj72xgk89pMn8Z9+4a62yUpbyer3paSw+p6WzOa/3/72t7H/tddAbQeUWqC2nWRaasmFJq5F2Tym&#xa;5ufx/EsvYeXK4UQblhpAQgjK1SqI64K6nmAsxxN9th3YmSy+96NHAEqxcf260x7Cl24/IQTff+QR&#xa;PPv8cyiVyqCOC9vLiMXnuMY8CGnrt3zs/LdnsW71KqxfvTouV9bz7X8ukJBoAAAgAElEQVT+Z5yc&#xa;msK69euxWC6jXKmAcY6p2VlUanUQKcXhuJhZWMSTu8TBcWEQ4ImnnsHRN06CuB6o54HYDsAYOIsQ&#xa;co7/9vkviBer9PYC4Dg1NYUXXngB+/bt08KsXq9jZnYmESlNj8Ppvp+OCGJkmp4hPZiCEQWjUouC&#xa;UMEQIEQwB6GgaruKZQEccD0XruvhW9/471i5YgVGhoe1GjOlZSemXaoDnaTgCy/uxgu7d+P+++8H&#xa;AwexbFDLhu26gF5gkP/KxUYogijC6olxrJqYwDf+8s/F1m1jH1XnISH48G/+Z3z9f/wj7GwOdjYL&#xa;28uCUwq5rBE0G7jx2mvwv/7Gr+PKyy5FRm567FSW6lO5WkWlWsUH7rkHJ6emcWqxDDuThdPVBWLZ&#xa;QtLJxcYh4HLgt7DjkovxczffiDtuehdGVgyhWqtj7/4D2HvgAP733/99dA8MYPuVV2P9urWoLCwg&#xa;9H3s3b8f+w8fRotQcNsBLAcXb9mMomsjbDYRtJqYnDyOaq2GehhJpnUBzsGDADwMQIMWCtkMCtkM&#xa;EAQ4NT0lzobwW+AgAGOCrRS2v8DUkWlN9U+pBSJDnQrHWbYtsBaloI4DalmwbEf+bgGEauPixuuu&#xa;xZ23vht3vufd6E4dgJZmwE5Yr5N0Vfd89/s/wL8+/H3868MP49SpU3AyGWQKXbAdB5aUTjDhi+wX&#xa;tRyBF+UIfOZ/+zi2rl+HLevX6rJFVUmpSAjBe+/9EP7tpVfhdBXhFLrgFnvEQpWTFPg+PMvCVZds&#xa;wWWbL8K9P3crcq6LnOt07DMhBAvlMhbLFVyy4ypYuTy8gSHY2Tycrm6AErHY5EQJIw/gLEKjVsWG&#xa;8VFsHB/DaF8PFqensf/113Hg4OuYm5+Hk8vBzhXACRBWq+BhKObRdeF2FWFnMrC8LPwwRFirgkcR&#xa;eBjCssV8WtmsxtVREMBvNBCFAZjfAms1wVpNRPUaEAXgjAGMgQUheBQCnAmG1V6cC8e8neGBwbRK&#xa;Wqk/atuaUQm1YDkOqGXDcl0QSmHZdizRAPzwJzuxdvUqvPPqK9Fj7OY8HW5cDhFC8L0f/BAvvPAC&#xa;jk9OotjfD8fLIFMowHJcUFuqVColGrX0YrRdD04mAw4h8X/w1DPIeF6CaQEOzmN1rFrb4gTZnl54&#xa;vX1we/qQ7RuE5TpCEnGOiHEEzQaeP/IGXjx0DLe841oMdhWQdVOuMPkv5xz5XB5eJovs4DDgZWD1&#xa;DcIqFGEVuoXhKG4EiyIQLhk3CpHN5vDa9Cx2HzgIWq+iMXUSrufCcV14PX2wMxm4+TwotRBmsmBR&#xa;BM6EB8bOZGFnMrC9DDzLQpTNaUFj2bYQRJ4nNCmAoNkEIwSs5YvfHQdMzjlr1gXDRxEIg2BgAMC5&#xa;v1fhtHMPYwnEHoEYp1LXge24ovGWBdvLwMlkBXa0bUCq1WwuB8fz4BaKcL0MMsVuWJ6HiAOMcUSM&#xa;4b//n5/ARH/syFaT1um7ojQW5lIR3/e//Db+6aGvI5vPI5vLo9DTB9vLwM7mAcsCtSwhXS2JZYn4&#xa;lwPoXbsRpWI/SBQBjKF0ago2C7FhsA9rVwxhtOCh0WxiYXYW9WoVJ+bmUW80UW80cOz4ceRXjsHp&#xa;G4DT2w+72CvqkaqQRSHAIviVCoJaFQtHD8ElQAYMlDOsHh/FL935c/jQnXe0aY5f+K3fxZGpaRyv&#xa;+3CKPbCyeenqC8GiCIiEtc8ZAw8DOGAgTPz5zQZ4GALUAqcUVqEbVi4P2t0H7njg2SzguCC5LsDN&#xa;APkucMsGt22AWqatHbvzLEvwARgoY7ArJdBaGc2XdyFcnEOwMIcg8BFVyuCBLyRwvQrWbEomDoEw&#xa;lAs6umBQIWZaw+AictIJpbBdD7aXERLVcUBdD9l8AV42CzebRd/EGiEVegcAx4WTzYEBYISCEwIS&#xa;RQgbNQTNOtBq4U//5w9htK8Xo/29HY0R3bEOTB0xhnqrhXrLxzt/8UPIORa6VqxEYWglBtdtgOt5&#xa;yGRzoBZF6PvgUYTIDxCxCFEgXFxRFKFluTjeCITPkzGEzQb8ehWlE5NoLM6jcmISPBKDTCiB43h6&#xa;PLLFHmQHV8ApdMHJF+DmxEtIkq5rIRV5FCGqVRE16mgtzCFsNhA0G/jNX/wF/MYH7sZQT7yBEQC+&#xa;9eMn8NC/fB8/eP5ldA+PwO7pBfUysHJ5EMsGzxUA2wFsB9zLoWW74ISIseYcnEAsIGqBuVlwaoFb&#xa;tpxlrqSA/MwlPBJt50xc5/HQt7MJoWJBWBZIaQ6kPI/gse+hMfUGuN8C81sIy4uI6gKKcAklwJke&#xa;zwvBuES3XhoohBBYjgNiCcnqZLJwc3ktWcc3bUFh4xbAcQHHQ4vaIJzDIirDSp4JJSeZEgHMOedo&#xa;Lc5ifmYWG0ZXYv3oCD76vvcg53nozufgWGK1K8e8eCwVLTIY+rf+6L/hmd2voG9iNfom1qBv1WpY&#xa;tgs7Iyxu27IlXHFALXlUk5okzkGUxOIcURgg8n3USwtoNWqoLpYQhQEC30fEOZpBJIMRHD5j8AFE&#xa;HAhBEAQ+OAMIGAg4CIu0lOFSlXPGEPkBeBRhYWEO779mB95/7ZW48+rLAchDNjjHXKWK/+sfHsJf&#xa;/8uPkOnuhbV5G5orJtAYHJOq15h4xkAV4+nlQvT4mMGNsyWeEhzpUggATkSwwyJA9E9fRViaR7A4&#xa;j2BhHmFlURhtgQ/WbIhxjkJhoGmmPXfmteOGKQexgV+lj5DaDnI9vch394AOjyGwhMeAcKmeCBLS&#xa;RruWVBcpBeUcTjaPXFcL1ZaPw2+cwNcf+QmynoPuXA6ubYESgjAMcPHqCVy2MZlna0aZCIBLNm3E&#xa;ky++Ap5oNwEBEeEEY3IBFbWR/l4AQcTgRxFaEcNC00crCFANCHzmoGUXwGiEyArBOEfgCnTGOBdh&#xa;ZqlFOAgYZ0IISUOMMKHG0ayDBAGsmogQUdsCtygKXUXM1Zt4/tBR3Hl1HF0iAAqZDFb096GYy6LW&#xa;rAt1GwSgUSgMGq6CLdDeCj3eiegkSVxS/GxqA8IBrngcyXuVgWo8qj/rC0pLAqBbrgA9+hos30dY&#xa;rYLajsTHkfDaGPe2RVPPgQxDTLq2qCXcRpJZbc9DttCF4sg4ihNrEHT3I5RWNeEABQPVAQdIS1cy&#xa;EhQjURACuIVu9DgOgmYTU80GvvXMcyBRCIuFoBAM1mw0cOcN74CXz2PzaJxMkiDOccc7rsHf/+DH&#xa;sGwLQaOuB4YQgBIxaQQcFBwWOJphhGbE0GIMi60Q5SBEM2JohgzlkCFgDK2QgHEPzHXlqIoZYqY8&#xa;00xBtMFKCECkVQ9wgEUgvg8SBrCriyBBC1Z5HqRZQ86ycGR+EScXFvHb77sVxawIE1NKUchmcOlF&#xa;G7F25RCefP5FFFbXwZpNkDAAkapbzRUlADczS1UTicFt6d86cEzMlCaoTV3VZSbnQhmFZMsVsDxx&#xa;ulBYXgT3s2KcOAP35flhUSQfSDfu7MkihPwfIASUEFAJCSzHFREf24GTyWFo3Xq4QyuBvkHhazUk&#xa;MiXxEZHay6C+E6qvQ0IGYbln4eW74GY82J4nJBaliEAQEgruOJhv+Lh+y8Z48CT2U4PYU8jj4PQs&#xa;OGM4NTuL7hXDGoNTaRyCEFRDhnk/xGuVBo7VWjhabeFwpYE36i3MNAPMt0I0GIPPOCKl5AkBJ9Kv&#xa;K117OlRp+GSFrDUmQqlk6QPlroeo0I2o0A3m5cAyOZBqGdV6A3PlEt6xaT1WrxjURighBBnPw57X&#xa;DuLZ3S/BHhoBL3QD3WKPmRpHaOdOiglNd6JmOEgpqzwhqp3ix9i9yeMHU4BAeWASBUtIqbWfZYEW&#xa;uxEdeEkYhNIzw4NAYGUWJ0GdL8WSVjdeSY+YCfMDQwizeYQMsKgehSRpyWNeMwZASSUJOwDAcmy4&#xa;YR4sVwCLQrAoRBSGqMPCvuMnDQjbEblh2/o1aDSbOHDkKCLfh+W4wo0FIW0ZB0p+gJPNAK8s1hEx&#xa;od49JR2JCDsnsV9nqZKURObvHaQdV1Ia4IqBewaB7n5YJ48h5IAfhDg8PYObtm1JaJOuXA49hTxc&#xa;20bYaoGGASjj4DQ5tAlZmdDvS5C6p9N9p3neHO+lCuaMgXhZkN5BEOlRArUSvvGYNy4A0yZgsS5f&#xa;RL6obcN2bdD+QVBqg0i1EfOmsCg1gIo1avxFPYNYdUO6VCwqHPykUNBYlQAIfR8LfgunqlXkXQd5&#xa;eTKhmbvAGMP/dOlWnJyawk+aTVTnZ5HnHLmuImyb4I16C69XmjhYaYEBsKlQqbZ0exFCtbUcD4Bo&#xa;c2KiePI75wDVCxFK1opumiQFAE2Fnxvbb4B97DX0Th7EN37yDO67+Z1oBQFaQYjp+UUsVKuYK5fR&#xa;VyxgtlGF1WqAsgiEOtpfG9ehRxY8wcYGppX3M86EpLYdEcFTmJ9zIAzihWsavAaw5cY1sWaFeBDw&#xa;D4DjgbkZ2LkuhLU6YIXg1AZTkUjIBhGFcc/HEIOS9EYWFbW0J4FQC1YmL/IrIy4iNAkdIfslv1It&#xa;sIVRJLI8iDZcoFWtjLYR6DCxStuzXQ8ey+P/fmIXrt+wBjdsXNNxa/pAsQvrx8dwxcVbcejEcVgE&#xa;mMoXMU8aeLYSwiJE/KmRJ9JRwgl4wvFNoF1AqavGz+IjBzhVrArt6YgHQn1XC0BhQyV5LbD+YQRe&#xa;Dq899xjG7v5lNBbmUV+YR1haAAhBJp9HJp+HO7oBsF1ZFIstJ9U2ZeCkVoz4jWlIAADEccBPnQCO&#xa;vQZarwkfe74A5LoQrd2ijbyktRULp3gIuDFWgsEJ59LVRkFzBRB7FrAtQ+LKtw+dozcjTeaBUNDw&#xa;DPF2Y89xUJehZC1hDWmvmIhCMqlKUNFgisfS22y0BvcEFGYSjsxvsICfTk5juLcHW0dWoDefSa14&#xa;QTs2b8L4yAj+8399ANNuBqfcPkxaWeQymQTTCRin9YOBBolmyNgAJx2ksGozB5iJ/zgERDCvQa/i&#xa;OIWFiPXLIrBcATzfBavYB5sDBTeDfE8vWBRqQQFCgJ5e8EIBcOw2NW3KQmHfKAmZEijqIcsG6jXg&#xa;1EmgWQPxsrAWZ0EJELgZBGNrhSsQ6LB81VSSuArjB0OXgngeYMVhfkKVJGsv8lypcxiXJ5OLQQnA&#xa;4kHQRkCaCROiCbH6WmKFKcggeTt1EbAtG9VWgMmFMvoKqTdASsOs4Lkg3V3oyudRZQz1RgNO3kNy&#xa;WtFhxtvbZEqPuE9UuLCUSrNsg/WNAg1pnMS2RP9OIL0PUrPwbA60XhGyi1JQHkGNKyEE3PXAbAec&#xa;SHWeaitPVMpT9ab7zOOxVViTis/UbxlCJNUvo7ZEn0Vn0LZYzdRVNbmKoU3NjHMnO9kv4XRnUQTQ&#xa;ECDi7CduJPpSS/I5EZJDOrjkWAs3mAkPCIkbq9d/G7OT+H7E0juby2GyXMOj+w/jsvHhNj4LwhCu&#xa;ZcHJ5zCxajVemV1EaWEejpsFMh4UpwgD13w4NdlmWyA1JQF4aR68NA+UF6VjPALyXbDWX2yo0VQZ&#xa;6iuRyMi8RbmSJOPwnn7QxTkRenUzAFEVC6zJvIxIS6QUYB22D3E1ftxoglpAoi4lBfXPCl5JDwmn&#xa;FojflHUo538H80tVobVLB7lPIBeEdHVqKBnP+/mbYVLSKsDOGQMDQKJQT2C9UsbiK8/Dcj1YXgZe&#xa;oRtuV1Fk/6g/5dZS4sRcZGqstMQjHZg3fk4NKiEUbiaDuYaP2XIVj+47hEaljMBvyR23AWqNJqJI&#xa;nLn1+smTmKv5YF0OeOCL+T9dznmC6cyLRKQCVhbAX38V/MQxoNmIJ9O2wYdXAa4L4nqxoWYwZyyA&#xa;2icegGYOXugGWCikuWWJUeKI8baS9B00VaL49JpJ8m3c15hzTzMwHcrSt6vVaOLbxC/Q/nrNCEBs&#xa;0/Al23w2ZJtWoYo66aQMxtCq11HauxtOrgA7mwcfHIY1vhrI5mDJUKnOtwU0UwKIrbKEuoC+T9Ub&#xa;d9qQtHKVBhzwI47HDhzG7BvHUa+UUatWUK01UGk0Ech4/qFKDaS7H3b3UDxbXNUr+7fkMKQUvmWD&#xa;V8vA3DRQXQScTJwt1qyD1ysgtAieyQKRMugMSGFOZkLtSlyrfnNcwcCWfIbH/CWkrTlGqbGT3MQT&#xa;nEk6rMN2iWhK3cS/qfFIYHkVPCEG5jWwPzGfe5PJ1uoIHOAMnHHwiIIBAhZIpmQhQ1CvI6hVUDsx&#xa;Cdt1YbkuMv2DcHJ5ZAeHYecLcLp6xG4GaoEQS0o7xTw05ZwXTEr1d574RgiBm/HgeC72Tp3CzGsH&#xa;4deqaFUrIOAiSJHxUCh2werPgOYLsLr7xRYRCmOhcM0sAoqpSUlLwljNkUYNCAKQbBe0ZQ2AOC5o&#xa;swZkMlraEcU4xGAeObkipKzaor7I6mwXLFJWPonhJBe5qToQAIBQkoCbhBKhFYmR8CLLJxwAJTEO&#xa;Jmp0DS0H1Ra+tGAx6jcZXHWT6++xR0cP4JtItsJAaoAIgCgKQTkDoRGilmhgZPmgloUoDMEyIQJf&#xa;5NEGvg/LcdCYmYZl2/C6umFnssgPDMLNdyHTLxzORO5z0r5WPUhKIKqdBXKwoHY2CCYu9PXD2Xop&#xa;eBiChSGoReB4GYSEIqAW7HIkws+ZjMiEAgyjIg54xlLBAGlSl2oJqBmFis19LBaPnIvztrS643JB&#xa;cIPB5H+195Sn7XHZPybyCTgn4My4w0jm0bKRM+mqU+0goCQlObULDIbhxjVGVonZqk2iGZIDmfwz&#xa;3QOKGXV+hRobpQXks0riy1yUtGK40GQnes04OBErlTEOECZzTpjYd0UpoiBA5DdBLZEoHLaysBxH&#xa;RKRcFza14LkuWo06SpUKGkePyvQ5gloQoqd/AMXubnT19KCruweW7cCVmwNDxlK4i+iBczM5eJk8&#xa;1IRTy4JrO6hEQMgATuoiw0xuSTFDo0SrzdiHyoWIhIn1zMkX7jsLsBgEQBZEqQWu86vMJCHE6lIW&#xa;K6CSqa8lA8gFyhu1+F6D6QWTtI9FoiQDGwrtwUHMDBizzgQsU2hJqR5DS2hFYTK0qkyNGQHAkOx4&#xa;LMPPA6oum1IuL7VyuRZ4Gt9CZDmBhALfSexL5NtVqN0ScoWFCABQJwNic3gOk2zGQWUic61cQrNe&#xa;Q2VhAZbtIJPLw3Vd5Lq6YNk2LDvTdmSRmXhDILKmqNzmEinntvZCdOoTSU102pRIkWFlQ+N1yL1x&#xa;qpjU0zxeAHFOgnxQSTztcqJAs27gxZhpdUZbLFdh6ghVFzcXjbnwNBZVkwhD63Tua+J3bnwwoU0C&#xa;1xp91nWJZ95sZGswrWRVDikN5IRF4lJEhaoWh1tE2nnMORNbnMFBAxdRsRscROwkJQSOMSAZwhFF&#xa;EjezCM1qBSAEjWpFBBROWbAsG9lCAa7nIV8ows148DwPrueJvWlEBCkItWBZFJxHCAmLNzAKMaJV&#xa;oBmRjA0IcwjMCZHSTfplCSUg3DIkLQEokwk1atRU4dwsEfGvadws/6UUmD8lEnPARb6soWYVpl2K&#xa;AUx2VnBEQ3TDf8rj0Ug+2KnE0yazqDLNsuLPuh0adpyxwnOmpKTtWBEH5wxgFJwwUAAsUonUFJHc&#xa;XUupBc4YquUyXGcGmWwBVi4HksuBQIaFKeB5NmxbMpy0vFkkkqxbrabI+C9HaNkW/FpN5PRaFAwU&#xa;mVxOMnAGPf0DcJ2MEIIWleFlgCvXmx5AFn+WeanEbwF+Q+SoRpFw8bEIJAyENc8YUJ4XCo8SgCt3&#xa;HgFYBGY7wrfKjeTAtLQypHrbxPktgNWB2SljcakFZuDLFMsSoyStySU+iCO5JHFjJyxt3qaUe/pb&#xa;vA554rq2ORNtSWutFCS6wLTkuQft1XJD08TqS2Tmi4RfRASNWgURAaxCUaQl5gvSyLIACEMgiiIw&#xa;zuO0RteDRSmKff1y6IQR4tcbqJcXUa/XUK41kS8UUOgqIl8sIl/sFgvCEhY6V0YctcCpBQnGpZDk&#xa;wjkfBkDgg1QWgfKCZN6WcK6zCCTwBWMHgYybp4xGyEiV48rFYfxmOjS1GiVa6MUQkIh2NOtAvSr2&#xa;aylXoxprPb7JEGnandYZ5EIbRmmFstREt+UEpO/tIGR1nemFyttAU7Kxnco5S0oyrcbdNJ4ky9Ju&#xa;LxAit5Rb2jcr3FsG2A8jhJUKKgf3omYfhNfdAyebh53NIzMyClLsFc9atmg9IdKAIgjCAATiHWPE&#xa;spHpzSLX1w9KCRzbRqPeAGdiR+m+53eh1WoitD0ETgaWVxBBgHoFVhTCCX2xB8yXjBj6MTMQIlSo&#xa;2W6NXy0gs/QZJsT1RFBAZUqR9IyaMx5LLQ1xbRs4eRR47RWxsZBJ/MU4QOU9jIlFxnl79liiMUmN&#xa;aIL2ZCvQkVk4JJLoELwAELsr1YNLBWu0Ow8GE4sKCT/zy//OlhL5tOaxQXo3ri0YjKoECFtuwdFM&#xa;K36jjjzRxZJuIipUdthogAU+gnoZQWUB2d4+2Lk8rGwebt+g3IumyjcNizhCxxkBYxx2JiOS1SlF&#xa;sX9InA4YBmBhiFa9ipbnYZE3UG/4WKyK1/8EYYgoYiIQIhmTpiVjPAjtGFCNv2SkaHgM3MvG7ioG&#xa;uRtX3qhj/MazhMTZcT/+Z/BaBbxWBrEcAb2UoaTjFML4pZrTZJawofJN1tBXtbsqXiWxUyCNR41m&#xa;cg5ROYf+CrmwAXCF6bmweTjlcX8RIzC5lSE5bm8CpSRtnF9AJNNRWwQRqLTmqeOJjY8qEia3GVN1&#xa;dpYlGJqq7cdSmikhFzRbYBEDbTZhcYYqLLQcF45to7enF47jws2od2/FFjylVIcdwDkYZ2gFLRAQ&#xa;ENuB192LLKUYWLUalm3DoRYC30e9VkXg+5ieOolKpYJKuSJeusGl+4vIrDJIZjWteKmSWSYL1t0H&#xa;1t2PaHStwMByvKD8mMrLYPp7AcCxgMAH9r8CfuSAiLRRAli2yHHVdSHOHosigEUJ74CKOCrWo4To&#xa;akEgzhrQ6jp1Eo/2gJAk33IJ9fTpO0zfLoZCGIOUWMIdCi6CFkQBRgP7qIacznK8QExsq4rifFrF&#xa;jMbhHLaUhBaF7bpwMhn5XRzWoU50YQDCIIgNGEL1AtAH1bV1hiMKIrAowmKpBNuyxTYcy0Yun4dt&#xa;WeJwCNpBN8UgUEMaLhN+Iinh3EwWjuthxQhFrx8gCHx9nqzIYWihWq2JgyhsR2y59jJi+7XjCozs&#xa;ZcG9LJiXicVKyhhRfUk0jBBgZgooL4BPHQcaNclY8h7DRZZ43nAttZdtVNHps0YrCkiTeCGabrT0&#xa;VJh1G2UR1VbtuzVhkCFZFVR5k6SrSbbuGDGSv+UJI8SykO0qIjcwJM48cFw4uTzsbE4wo+0IKSwj&#xa;XhwErFUHwgjcbwFRiCiM3+pHaHyeAiFUbIhkHGHog3Gg1fRBCJEnnIhXJjm2OOo9l88hm83Bsm3Y&#xa;6t1TiFWcStjhnINHDBEggxIZUEKR7+4GpQSUUITyQLQw8BEGAfaeWkCZcZRhg9i2yLiyLJ3lD2rH&#xa;E6S2tRuDKELEMQMK7cpjrMoBFIpi2/3CKcD3xd6pRGjWjFRxYUQCCQiT5G8D3hiROJGeHvvZY2Zq&#xa;F3UmijHLSa6P04nOZP3iM0vdZUjgNGw6RxI7F5SkNY8+kge55Xv70b1th5bAcBxxBKSUvNSyxaRR&#xa;sQXcBcSAh75IJglaQtVFIRCEwqqVC8JxbBAWgrFIQkzBdKHvgxOg1WzqU7Ndz0M2k9FHv+e7iigU&#xa;umDLIAMl8VGYCYnORZRP4GMCTjhsx4WbycC2LDiWhTdyfai3IkR+GNsa5kQYaYEcMPIJEGPjlCRU&#xa;Eor3D4H0DQDD4wImzE+Dz04Dc1Pg87P6dJoEE7IInLN4t6tZuUk8dVF/bNMB7c+nJfnpaCkGS/im&#xa;JfZu89MaBZDz4lVN7d4Dg3kJpeLwi6ERHfPn3DhEl3FQMJFZRwCAghFxYB08D4RayFAKhD54FIDU&#xa;6ggaVY2hhNQVE6TBv6F3CSHgjCNiEephHZVSCY7rihcC+yEyGXE+qq3ajNTWlzRJyMDBwRgHIwwR&#xa;EbkWPIqAiMXaeylSNpxRZNpjkKxTcAfJZMGzOZCBYSDzGsAjsJkpgMTngJllCDzZqdSkek6yjQFL&#xa;lmGxa95aaszMEGJ6baQhSXtDkeBevqwmLYts3TgDz1Lz3APHBYkiYclaVGxwlIMswroK9CuGEz2g&#xa;XCSUB+Ag1AaxHCBbRMa2oU5jKboOajOz4JWaiJRJg8uypKonpiFCYFs2OOPwWz6mpk7ixBvHYTsO&#xa;bMfGwMAgunt6MDQ8DC/jwrLt+CA0jdfjP7ELREAixriePFMA6QldCj9qSqrEpMqNPxAArFkHWTkB&#xa;OrYW0ew0sLgQ36juVcGFtP4mQFtmWltFS1s8ul9nlLByFMz1gfahiG8TDSXKvki0aLnifPlkE82w&#xa;hiFmWfp0REvuhFW7VwUujc87EBpSMLBOm1DWquHvhWSUiMvDPSjFIqfID67Axv5BhGGEWrWKZqOO&#xa;SrmMMAwQRUxHxKiRr6uGkBIId1cY4vjRozh+7CgO7NsH13UxODQkmHjliDh3zHX1G9KhIIo8t4Ep&#xa;x77RH7MqTpUxg9gtJ3mDmPahwg5GcEH/zs1j5gUMousvQbjzYbn5TwZfAH1sps6kImmG06oo6X2Q&#xa;DSbxFZgcxyE3IaYOMxTbeQz20r7rzlJdew8kPNKnC2mhyo27mfHDhWHgpJ/WsPLjY5HEyUmq/UZw&#xa;SHy3bFgkTkYR52/Fq57KJBdIvEmJsSKlNLEsG47jolDsEplkYYQwCFAuLaIpXw9Ur1QRsvhFIcSy&#xa;4o2SHLrdke+j3mrhcLkMzjm8TAaZbBaj4xPo7u1BsbcXxa5u2I4NSxqDURCI1EBuqFhozR67oiA/&#xa;SyOLg8SZVZCzzkRn1cRRg0EIEccoERYBIQddMQIehMaeaFmPsgFUFpoSuVovcw2d9NzpBsO4N54n&#xa;fV4soMc/FpU8cbv6WUM27TmQN2k/rXxG1au263TEARwX6ujPJc6LPfYAAB7gSURBVEI/RmKvznGV&#xa;v0imSxs8CiLYxq6zGPsY96ny1fNGNEXsABYTYts2Cl1FZHN5FKMIrd4mGvUagkBstWk2m/EQEAKq&#xa;GQ56gRAi37rt+5idOYVyuQR3ago9PT3o7e9HV1dRvG8BEP1UErWTHaMnn+s+KTtM1aekaUJQcSmj&#xa;tFQ0ClanfEvHqKjaxLfcqNO4Zn4kMZOZ495JpiXxfpwQbv6Z1ZpASUtyA+4obZKgtNsO5IJJWEVL&#xa;xys5JByQkS/E+FV8J/EKh4mHjXfN6mK4Lk/rOhIzrSpLcTmlBMSypT9YSEPOGfxWC0HgIwgCNGp1&#xa;eWS6jyAQvlYexa+DV4cB8yiCzyLMzTRFdhnnyOayKHb3oFAooNDVhWpIEILCZgDhEcCkGuXG66Qs&#xa;G9yyEPWvlJOlWCM+fNkcuuQVoq/G7kwi9pi5rnzNEtMCkrdJKyGl0mckJuuMZWXcMlUTEO8IMRun&#xa;vidXabucJB0/pu8ngAxLy/Zr6a4kPEkogyWg9xkpce4B5xxEZbdzeQym7wufqGxEvLVCMiohUC/k&#xa;iK/HZ3sJDCfVqYm/RC/i5xVsIIDahkx0uyIQy0IunwehXboNYRghCHyEvo9qtYLA98V7XH0fdfki&#xa;5ygMBH60LSF9KUWr2cJMcwqz02L0SC4HDsCRg024mnrVTCJ2z1ILQcQQrBiD6ZfV6tbkVoMxNBuZ&#xa;E84h9qIZL+EgRDqOmEpNTAeUU0xHCAiJmUJjWp68LZ5ijrQ/mXPI9MjOJJcaCOHJdUTalyUAfeav&#xa;EhD6BS9aaJ0/2YJRjUL1n/getpqSGaUuUrLVNODMjij4oFU/kYaXzMeVndLGjxwULX2l2orBs/oc&#xa;70rlEBg2k/OQo3kQSjFERtFqNjE/N4t6rYqTk5MIfB9+JKJtttIQhMXqXJVXq2iNAcmguk5VH+eg&#xa;nMGaeQP+yomEBDEEqf6iBQoxb4CEIPJHWU+8dUde53JzaVp5JxilAwOY7ViKP3j7bzpjrVN5utwO&#xa;hXZwramsPyiDz+CpC5U4o7fbqPcPMJlmSGU2VX1xAX3VCrjrgjuejD3HpwjCZF5CxDzA/E7jvhMC&#xa;1/PizZIy5MoieUhFYpSME2m0FCbGrwQ8isAYASgHt8QbdUbHJ0AtG5fsuBJ+o4H5UzOoVis4+vpB&#xa;tJpNNJtNobZkMERJUb1wxMhLKS+DChoOWaCLcyBBEDM3AM5SijvJsUky5o0Q8VIVcBhMCr1HLMlg&#xa;JtOQZDVm2YYwkGhL4m3jceWIUf207KSwUnvPjH4kEw5J8lZpCxDOwYJAbItnkRy/lHblqX/PgeS5&#xa;BzKFTB1AHASIpGSLwgClPS8iM74G3thqEBbBkIcJBk74a3UjuZZa6jwnwgEwLk7rth1QmcAdSgZW&#xa;m+dUlMzEzgkJnDgMQrjcGGcAC9GsR6CEYGB4GIN0BBdtuwyRDN/OzZzC4f37UFpcQGlhQTxJKWzb&#xa;0a+W4gYTE6jdCgQ0DEEadbGIPQ+UpWeBxEjAUKkJgauYRb2qgTGRJEOteMw64Np4Y6M09lQ5Rrm6&#xa;LnMWtEWooF/cYg4u3snATZ82kkwlo3NilAkAFmsQZacELSBoIWqJdz9wI2CjX9EkuAvnS7boOBFZ&#xa;PIppI5HFTwCErRYq01NghAJhgPz6LfqUveSbvKnxB51wk2Zq7d+lNMay0mea8cT5W5wL+BD5gRxs&#xa;bsAOxM8jLgsqF0EuEJr4Lo6ZJ4TA9lyMrl6D8bVr9bHx5YUFVEuLOP76QSzMzaJaKoncA0vFXgwo&#xa;EclkclsqKSmFSEcLWS5kA0pwBZ2goI78n0xzJGIChEGjPCskfXibOu/AOEMMXEu8hANELSCuFo7U&#xa;LCwCvAyY6yEaXCnYUTGz8VYf8YjYiycYWzCp6JGYE27ZsGp12HOngICgGtZBwhYQhjL/mQn3JldZ&#xa;EecHE2zVYeFzVNhDqCfGIrBQnBvrV0oAAdz+IXg9fSDSRRQfg4QkUwGaafTYm9egnjMlqRgQSi1x&#xa;LKfc0pIMaRoYWk0CTKnSCWPHi4USIt6LAKoNBOq4sAtF5EYnEHX3ozo9LXYV1KpQ+FQlfOs9XIY1&#xa;ozF/mtKXuG5uwm4wRZ/elp7Cf+Zx853Kjf+NxzIBG4iqS6RD8mwevKcfvLtfNIoxcxT1mPIlrphw&#xa;iBAC1qwhWJiCHVH0RQU0ogh1pk5oN4MN508CHnAuVCATjWLylZCcM4StBizbBgsD+JUSCKHoWrUO&#xa;TqEAu9AFkslL7U8T2DYtYdU97dKZJKJrIstL5uhSw3qWAF+5g/RBFWqhSKlm6WuxlIvCCDXOEIIj&#xa;4kCTcTQYR8jF9vOAUkQ0C39gFGEfB+saBI4fAqlVBIMy6GPradTpTC0TawqRprfZqAWn0QaX/xdC&#xa;goeBxOYcegOlwrQxX6T+5ZoJzRNr0g8oXtX6vlAExtaBOw6inn6gUATPF7WKj9mRpzg2iWcT/xIK&#xa;2mogmjuJ8Mg+hEEdng94QRY9oYXjbDHpBrsAzKtdXgK0MxHRkXu4OBMhV59asEIHLHRRPX4Efr2M&#xa;fLEfuWI/wkGxE8Ht6RPvieVKfXdi3KTxljbizJdFK8xEZTmWZcl5km4UQDAvZ2CMoxZxhATwIyaP&#xa;wRfoyWeCURsMCDlHyDiaHGhFTLz0g3FwxwUhgKWmLFsQWFsPtp59aTSaZMbQ2okv8RmAwH2+LzAg&#xa;Vwo37mPCNEiUQDpe7dQe/ZlzoH8I6B0Etx0Q1439wQqXop2pTIna3i8CUIJo908RTB5CMDuFVmsO&#xa;VquKfECRiwhWRD2oszoqPAB7syJi6uRE1TAWiXdwKWwZ2TYatRKsFoO90ABvleENDsHu7hZva9Rn&#xa;WxmMmRgCI5igjbfk/TH2MrEfZKCBaImtDKuIhagwjibjWGQELRA0OEcgGZSp51T9nIt3KUCc/dvx&#xa;jAvFOOowZzmp2mAx+2RKJSL9slxp65ROV985hESVr69X0jpWpoqRjFYRIrlQScNOsES1Ry0AQ1u5&#xa;Xly3XHzc0EgJUuohTcZt6qi04LWXEVQWEQRNhEETraiGJmthnrWwjW3EHCOoo4IIJsY5d0oGF+RH&#xa;xuQ7sThD6Ivf2P/b3pn9SJLcdfwTGZl1dlX13T19zvTOzuzttb0+AbOy1jIgJLAQsgQS4g3xxL/A&#xa;v4F48ht+AIMxwhbwYmMjWbZsr3d2dnemZ3Z6jr6768ysPCKCh8jMyurp7un1k0fqn9RHZWVkZkR8&#xa;8xe/O+KYWEqUSvhUsoLnlXG9MoPIR2w/wjzukTQn8F6+jqhUENXaiIPmCtO4MpWbnDL52BkVZ87a&#xa;OIW2BUEYIRxq9TrtgU83jPnhwEE6AlemYY/GatgyDZs8OSfZfJ/khDnP0RqT2DywQli1NZ5n10h/&#xa;2Zdw1DpjkgLzdKarESNAxSEqGOQ4zl6q3MOWKwMmvf64S92kXxWeJr9ONpsiN1+JbDll9Ls4IOZp&#xa;oKYdHCtyJ0BLF0clOEmM971/pbETIEMXGU7hBBITtawSFicEesCamWdVz7BvjviIByfv/InpRN2D&#xa;HLYYnZmnEmI0ZVWm7EiumQV+rn9p63NJSTmqIb0S5aSOe+ghn9xicnKRmZuvIRfmcCdaI2nJSQvT&#xa;kfNbBFmhaDEqnJZZFjLum1khHGcE+lTedaSkVC5TDuIsl3JsSjKj/Vg1lhwlJ4XF9JxUESWvtZUq&#xa;WwLLoWQheo3UY5c9azqxmTfrqXoEhfuboY8JfFs21CuhM49V9jYVufKYpSC9d1FYzoBlDAZNvqdE&#xa;dp2cKZ/se0bFFyK9v7EcP18NpWv3yjjYRt+9RXL3Fv2DHV7vL7ITbfMw3KY/3IUoSm21CZgEDLRo&#xa;0GKCT3OTHQ7Z4fA3Vs5OjT3INVdjMELxQrKOFgYlDL80tyjrCkIm4Dgkica4HjoOMa7DV6pf5Hg4&#xa;4HH3f9GeYGp9g/rCMvXFZeRE0xbHyJb+LHkx46ap3AoFUOcihEm5cPatfb5SuUy9XMXpt/MKW3ag&#xa;ySSadF6L61ph7igyoHGFyi7belxz1wYhZP5MmY03C4YZmXTG07hHQsKo78n2VpqOX+CNJ8WJ4kNn&#xa;EkbWvyJlL6vAAjZNdLSnWcfFU6uLScdFjJrbs9OXVKY7yjvg+APYfB/9ZIvhvduYOEan++L+eHCf&#xa;q/Esb8XXuB0G7MbbqS3ewWhbg6JjenTosc0eV1lig2Xu8xj9GwD3zICZbJmeYxLfBMQoYhKEMmiR&#xa;7RubsjZtmBQNWqrFY/GYQMWEDgjl4h/so+OEqNelPrdIdX4B6ZWQad2D3OyVjXuuhI0Am4E3m50c&#xa;5KNWJ4B42sQLRqb5p74al0sz019mFM+VMTu7QqY7rRet9CcpB9iJYxmoHBd1uJdWkxRPNyQbl7SX&#xa;J0SZjGuOy8+j78bvW3hD0/7Z7mbHC4WbjcHRGhFHmE4fEQ1xul2EPyB58jFxZ99u2BxH6DjChENk&#xa;pOgmxzyIfVqqTmyaDHVAYILxlxWDxnBElwY1lphjQMCQiIDwlEE8nU4FbY0KFVOmShmDoWP6KKFI&#xa;SJBGYnSMSlPDK4mgKWvUYkEk+zwKHyNciTus4nolVDBksLuLLJWYmJ1nde01VKMKzRrVmVmrpct0&#xa;c5GiFeGEeWwUv1D4cRyEESOQFpfUM4B78pgpLrGF5dHaqhWZQjZaIiWUy4wrRQX5cgwtYgwo2V8T&#xa;RaCHRHdu5Q6MPBds7HFPVAHPu2lXgvwZRk9Q6J4Y56oj22Buj7fbxBqM30cMfZvDFkW2CvowQHeO&#xa;IPBRx4fUQ4HXH6CSHuGwC3GEiSNUECDDIT3Vo5PELCQtltUMXdOjaxw6pp+xmfzROvTRaCaoscAM&#xa;ASFDQvY4uhDfHQNthTIVSlxjKb/RoWkzx+ToJGUHuKRLeHi0dAPpuAySiI7TYyou29TyyMWRAjcU&#xa;CNfgeAkLPsRHd9CNMqpRwlxZxG02qCxfwZuoj8IanUJmRIHTjv+MLAJnVWEx+dL3dAnK0+I/8lF1&#xa;S5BWgzRKWVtrOtHOlTWbVTu2OTEjMbRwmfEj6TEpoX2AONhF+gOS84JIChVwzBn9GFshCjJP5oYW&#xa;mBEwkwQnGFhwDvo2hiKOaPgGf3CAE8XIKIFO2ypSYQiJRkdDasqjEXrIZIqdKEAlBqUMRAIiz0YH&#xa;ao1SERXtUWOGZTNL3wwYEhESF7WKbHaoUaHFBC6SSRp8xFbh29PpBGhLtJhglQX6BPTxWWKOMV+J&#xa;ESijaJg6DWo0aXBgOihjqItpBBK0QOCm4CuD60DisGHm+Uju4KgYOXAJ2j3c+Rnc5gReYwKR1uDK&#xa;xISCnDD+OTuWDYPI1ZdR2zGOVZzZjAMVUrQLlzVg99xy7DZIJlXGsmJ1NKfT4nOAUadzu0z+EE+h&#xa;CqSHEwQ4h7t4pQpx6I9Gt8jR8+fOrnFCiC0qVylIRXG80r/CaIRQ4Pft/mFH+xAMEAd7EIaY4ZBJ&#xa;NUukDihpiaccZCwQSuJEJVAaJwStElqRy2zSQMYDYhUSqRAnsWOTxx8bTWJiJpigaeqss8ghHdr0&#xa;kch8LLLeJCgqlKhSZopmDtrzKAftEnOUcDmgzXf54dMLaWHcb5qr9PHZw+HX+i5CC7IMB6FtHIGM&#xa;7V5SUax51b3OK/I6/xT+G05sC3tI16NSb+D6D6kcbOKWysy9/BoTV5aZXNvA9WzJozFuCyOxIFWA&#xa;UMYqR5mEVjCWi/zjSNwX6Rrs5CpbUctKr5HEyLUXQMXo7YdQquJMzSCmZnFWrmGicCSLazOWgJlX&#xa;ys6mJpOP01gG7/5tkif3CHfu8WLzBTaDuxhlMEozTNTI4J/VS8j6pDW6IBYhbcZDpjTLOEIc7oDf&#xa;w/g9KkcdomGXqH0AYYROwtSMl8YDRDFGK7ROcOI2a8kMj/QOd9U2MraikU7i9NwobWtrWfxJ8jab&#xa;ZptN/TED5Y+n2RRWDgNssEyLCY7p8jHbT+Gq+LmExzt8gSfs8YQ9jumfCloxz7RZZJp92uxy9Eyv&#xa;xRd4jR4++xyzzzGZ3JarRQXjPwK+Id9hUz5m03lM7BlKpaotxuG6eNWqNZfVJ3BLZZrlBpOVKerr&#xa;qyQLDVY+9Xm7uXQa3Z9FYGX38KSLrzS+0nz38TEOVoEcH7aM4xVMRibTpEdZuONLbCovpiae7GUw&#xa;GFtR8QRI88i14nRk3C8LgwwGiH6H5L/+hSQJieMhb/jL3I03UUahTIJwJUZKEg0qSah846+Rc1eQ&#xa;U7OYJLb7fQUDzNBHHO9jOocQ+JhggG4foaPQgkwpmnGZhqnha58dfYATJ6kzI7YZHtqWNTVKEyYB&#xa;v6te59Acc6iP2Yv3rGk4jdAyysr2NgJPI3TMDXOVG2adH+gfEpnU7Z8L0eNLe4sJNlhmhhb/zU/P&#xa;xRfAMvMsMUfAkD2O2eNo7HtxgzXzLJbsINhgmQ2WucU9HrN/ztkWxC+Ja7wkrvF95//QwtYYkK7d&#xa;3dxWr3Hw0rpgTqUMruRP619jq7TPk3oH6XqUGw1aS6s0l1a48ubn8EoVMhAKR+JKh0hpQq35562j&#xa;cStDwcOUrdiZQJHncWXnFK0XjMZdFNoWWUO2MUiRw45Rxl2FAK+E6BxhfvUT9L0PiP0BOhqioiE3&#xa;gjm6cYcefXqmb9PzpS3wJ4Sg+vm30YD2ezDoMdVWhCIhJCEkGm3tpFNAqThNilT4SY8behWZwKba&#xa;sjbn1GFiTAbEVNlUmlj7vGFu8Ia5wbfVf6aRdun1VRoXm8V+oHCNxDUO3zBf5dviB2Tx2GdRhRJl&#xa;SnyZN7jLI+7y8Fy5FWCDJZpM0KHPFjuolKFK4O/PMzc4OLzKC0gc2vQ4pENIfOb5IJgXUzRFnTY9&#xa;dsVRtgiTa9OGVHa18vE0LVbNPD3hc6TbBIT5zjpGa5JwSDQY5NYDr1q1ZZnsFXGF4L22PxIhC1Aa&#xa;eZty41F6/KRpadRqTII8cb3cIJC3OQW2mUPEkYjH9zE7W6iHm+h+B+X76DCEaEg9lFRih6EKGKi+&#xa;Dd/Lltp0oxDda6N7XbTfpxwavERQTzza8THEMTqKc9OTiUK7lMcxJg7xYkM9cplMquwne5gktgqW&#xa;SizAUzndJDYUUhrBUA9pqRrGJPh6ALmsyuhvrmYaPCQLYgaAAcE5uMiEMZPKtuAzPPd8gIiEOhUW&#xa;mOGYXj43p8JdIpE4rLNIlTL7tDmgTUxy7k1usk5JeBzTY48jIpGQeYusA8Fq/giB4zrU5QTr3ioz&#xa;copflDcRrkzFBo9KbQJZsjXEyvUJptY3mJiapzE9z9TSKvXlRTzXxXNdvnN3m77S+MqkpTzTwc31&#xa;pPElXRTclic5bXoS2cHcxASpcjO6rkjNXqaoLIYB5nAH0++gbv8S3WsTH+5iooik37XgiSNmoiqv&#xa;JOt8zCPum0c4wu4AZMtOOXaXnqyWrxCUHZdVFlkxi/yP+TGOknl8hEmrnGecF53ganhRr3DNrPB9&#xa;/SOMsTIsJlUws36mpfIdY93mX9ZvckSbB+YJPfyCsyn/lbct4fEmNwkYEhByl4fn4sPBYZZJpmmi&#xa;0dxJzz+L6zo4zDHFDC36DOgwwN1geewkg6FKmRoValQo4XGfJ9SosMrCmQ+TtVlhgX1zTEDICvOj&#xa;dXlsnbZyZ0V7zIlZSkmZtnPEXFzFcSRuWLYyr+/geA6OB+5Ao/uPoDTAKbc5XNqht7FEZXqK6vQk&#xa;rzerbAUx9/2YxJDWds2wds4ydIqmOQbiUyZqRJlFw5YuJQyRh7s4nQ7y4ZY1yh91LOfzXUykMUEV&#xa;Eg+SEpXEYV1NoxgQ0UOSOhocmZcDzdKBQKBEzAyCeePygmkR6WQkimg12lIpC3oymrLRhKbHF82L&#xa;tOnS1X2rhBaVpsx5ktLADFhgmhY1djhAZZaWM4bymC4LTPMia7SY4ID2aIPvM2iCGtM0maZJQEhA&#xa;RESMc0abIWFqyTLjoLVea8M0TZrUaVLn12yyzpWxRxi3Ptp207SYZZJ9jmlQw8PFSZORxvzvWqS1&#xa;eQ2TNJgUTQIiYhExayatmQwXEonUHk7sWlenLqONx1w0wVzY4oNgm87ePtWVRaoriyy/9Qa+Mjwa&#xa;KiKlT+36adA1Y/+P9+wsqBe7Y4SD0BoR+DidNu4H7+F2B9SOA0pKUgnqiDhBBC4kMSKsIbK9HhLN&#xa;nG4QME1MhIebixYIRuBNEywTFDPUqQIvmVV6up8v36MwQ8gcBzZ00xCagE9zg20O2DOHSFNIZMzb&#xa;jA6FRMzQopTeLSYeF63GRkIQkTBJgwmqfJaX+ICP85X6rLHTaCJiPscrtOlzTI8+Pm4qOoyuPpqb&#xa;mASJHBcP6lSpU+Ul1nnADg/YPmPaxmmDZWpU2OGQA9rnn1xA/jfF17klNnnPuWuPyVQWdNPADNdD&#xa;pvuVqZLDK5WXqHhVym6VW9UnVKqTVmlxPYxXYWppBfnKZ+hMLTIo121KidZP31+n4kEqIY0BV4g8&#xa;NDNb7sesA9LFMQrRbUOvjX64Sbz5HhOxRz1y6UbH+MmAvm+1eTUcYJIYPQwgSewmISYNxlEJf6f/&#xa;ip/yLj/lXatoZHEZhfuPXKySFjWa1HjTvMq/mx/kfaBY2ecECDHwZ+ZrPGKX99mkZwbPnFOJw2d4&#xa;mTe5wT/ynWeen9F1VlhghofsssXOhdrcYI0XWeMnvMsx3Ween4N2nSssMktEzC/44MIP+ee8w2P2&#xa;eZ97tOld4IaCz/EKb/EK3+J7JEIRiySVGkYuXCvzyrxmrvQkf+v9BT+XH/Iz+SHlygROpYzwSlYG&#xa;rNTA9RCVqnUNr17HzMxhrt5ENKZRRQfDqXGKIzKAoxXO0IcoxBzugN+3m9Ud7KGPrFKj4xgdRURR&#xa;n+V4mqV4igfhx/SSLr3wCKMS9DC0yk4cWXNUHNvl3GiMiflL/pgPuM9t7uMT2BEaq0MgTvyvMCj+&#xa;hm/yD+bbkBr6xr1zJxBrjW+8wQ0whl/x0TPnCazIV6XMF3mdOzzkzgUM/wCv8QIuEhfJz7h9oTYA&#xa;b/NZtjngkM65zE8A5g/5Mm163OHhszllSjdZ5wbrvM89julydIE3BODrfIn91Pb2iL3RU6T/jLIb&#xa;QAi7DZQWij+Qb3PbfUDfCek7QzyvjCiV0xBJF1Gu2P8rNYTroaRgVs5Qq7YYeAp/pgnlCpTKiHI1&#xa;VW7S26q0dtYwgDii5UMc+fhBm0RFqGiY2yutaclySaNidBgSRQOuqUWuqkVuRx/SV316cQeTgdWk&#xa;ipLO4hlIgaX5ffMWB6LNAcfscghPCTYnP1sQ/h6f4R7b9OjTzZjFmUlkljZYZpZJOvT58BPEtf4R&#xa;v0OXAXfYYveEzfQseoEVNlhmjyN2OWKHwwu1+wqfJiRiSMSvuHPqOe6rbPCYfXr4FzJBAFxliRIe&#xa;h3Q4pnvhCJ1FZhAIQmK6nLFEZQZ/AzjGvrGmRIMqHdEm1gbjGFQqZwmlEDKxOfzSRWiDcD0iF0py&#xa;EqFDuu4xmCCvnSW8UmrBABA2G0FrdBKiVcL1aJWjJKIb91A6GYE21dKLKdI22ikAFSGVsoEkOkIn&#xa;UcEwr8e9RmQdhDa9NHikyu7pA3Lq0QOOucYSW2yPQHsOCQQd+rnClAVjn28ptXSHh0zRoEmdfdoX&#xa;Sps5pss9YJUFImI69C+EkwfsMEGVCWosM0+PwVNYcQVwl4fEJM80ZwFcZ5UZWhzRZZuDC3FYDxcX&#xa;l9e5zl0eckR3/EEKGvyYsm4UV8Q861zhgX5MR3dwhN3d3CSJ3fcr33UnsKKEVwYpmfamqckhA7dP&#xa;x9mmIitjlWOKadykjobEJCijWNUrDEwbXz/OC1CYzNCexJgkGYE4iVEqwNFTlHWMTgZo46P10AJU&#xa;aWxQfQbYAmgNPGGPOTPFCvNs8oiLwQgesM1X+TwJEU/YJWFUGOMsOqZHhwELzDDHFAOGz7StAtxh&#xa;ixUWWGOBeab5Ce8WZ+tUOkpX3xIeVSosMssT9q1T5Bn9mkwDxmeZZJIGuyd0JfcW9y40TFM0maLJ&#xa;IjPcYYsBAf0LdBjgCrOsssA+x8+041myTzRvZpgzk8zQ4j/Ej+w8C40Rxm5Wp0Y1cJ00YBl3CELw&#xa;WfdT7DsdtuQTED6xHKS2YgeTZ0Vk90vrxRqDZwTKHBKZXYZ6F1c7VhbNtHSl821ITfrZ6CGuiagY&#xa;jVFDDCEY64AxmYKUx+QWbZ7QY8AaC6yxeKGxzMhnSJsuAsEMrWcu25lh/yG7tOnxJd7gI7a4w1YK&#xa;+PNphwMa1LjGEuss0qZ/IR3mNveZZ4pl5pljkne5Q4I6955terTpMSBgmibLzDNDKw+mcS/2XlvQ&#xa;brDMfiqjfBKaZZKXuMq3+N4najfPNAC7HBKZmBxleSypAWE1bluV3AGTYIRmWU1x6BwycDoIYVAy&#xa;HnHXonYOKdMzuMalQomBbhPRx+gApR1GlVksxxR5nK3NBEbHCDQyNdobrKs0f9b0Hhl3LZJC4+HR&#xa;pP6JxgYsVxoS0mTiwnMyICBgyHVWOaLLPR5dCLQJih0OCYlYYxHDzoVAC7DPMUvM8TJX+YgHDIku&#xa;dM8D2iQobrLGGgvcSV2/Z3rELumSflvp7BqPl3RJv6V0CdpLeu7oErSX9NzRJWgv6bmjS9Be0nNH&#xa;l6C9pOeOLkF7Sc8dXYL2kp47ugTtJT139P84WGaZUimIJgAAAABJRU5ErkJggg==&#xa;" id="image3163"/>
- <rect width="282.94818" x="28.049149" y="81.03817" rx="0" height="279.91772" ry="0" style="fill:none;fill-opacity:1;stroke:none;stroke-width:5.44153594999999960;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="rect2995"/>
- </g>
- <g id="layer2"/>
-</svg>
diff --git a/examples/quick3d/quick3d.pro b/examples/quick3d/quick3d.pro
deleted file mode 100644
index af523da8..00000000
--- a/examples/quick3d/quick3d.pro
+++ /dev/null
@@ -1,15 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS += \
- animations \
- basket \
- cube \
- forest \
- lander \
- matrix_animation \
- monkeygod \
- modelview3d \
- moon \
- photoroom \
- shaders \
- sphere \
- solarsystem_qml
diff --git a/examples/quick3d/shaders/main.cpp b/examples/quick3d/shaders/main.cpp
deleted file mode 100644
index ab63fff4..00000000
--- a/examples/quick3d/shaders/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: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$
-**
-****************************************************************************/
-
-#include <QtGui/QApplication>
-#include "qdeclarativeview3d.h"
-
-#include "../qmlres.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
-
- QDeclarativeView3D view;
- QString qml = q_get_qmldir(QLatin1String("qml/shaders.qml"));
- view.setSource(QUrl::fromLocalFile(qml));
-
-#ifdef Q_OS_SYMBIAN
- view.setAttribute(Qt::WA_LockPortraitOrientation, true);
- view.setResizeMode(QDeclarativeView::SizeRootObjectToView);
- view.showFullScreen();
-#else
- if (QApplication::arguments().contains(QLatin1String("-maximize")))
- view.showMaximized();
- else if (QApplication::arguments().contains(QLatin1String("-fullscreen")))
- view.showFullScreen();
- else
- view.show();
-#endif
-
- return app.exec();
-}
diff --git a/examples/quick3d/shaders/qml/Bouncing.qml b/examples/quick3d/shaders/qml/Bouncing.qml
deleted file mode 100644
index 68c817f8..00000000
--- a/examples/quick3d/shaders/qml/Bouncing.qml
+++ /dev/null
@@ -1,124 +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 1.0
-import Qt3D 1.0
-
-Viewport {
- width: 640; height: 480
-
- property string name: "Animation Shader"
- property string icon: "images/teapot-logo.png"
- property bool run: true
-
- Item3D {
- mesh: Mesh { source: "meshes/teapot.bez" }
- effect: program
-
- transform: Rotation3D {
- NumberAnimation on angle{
- running: run
- loops: Animation.Infinite
- from: 0
- to: 360
- duration: 18000
- }
- axis: Qt.vector3d(1, -0.3, 0)
- }
-
- ShaderProgram {
- id: program
- property real qt_Custom : 1.0
- SequentialAnimation on qt_Custom {
- running: run
- loops: Animation.Infinite
- PauseAnimation { duration: 700 }
- NumberAnimation { from: 1.0; to: 0.001; duration: 1500; easing.type:"OutBounce" }
- PauseAnimation { duration: 700 }
- NumberAnimation { from: 0.001; to: 1.0; duration: 1500; easing.type:"OutBounce" }
- }
-
- texture: "images/qtlogo.png"
-
- SequentialAnimation on color {
- running: run
- loops: Animation.Infinite
- ColorAnimation {
- from: "#00008a"
- to: "#003333"
- duration: 5000
- }
- ColorAnimation {
- from: "#003333"
- to: "#00008a"
- duration: 5000
- }
- }
-
- vertexShader: "
- attribute highp vec4 qt_Vertex;
- attribute highp vec4 qt_MultiTexCoord0;
- uniform mediump mat4 qt_ModelViewProjectionMatrix;
- varying highp vec4 texCoord;
- uniform highp float qt_Custom;
-
- void main(void)
- {
- gl_Position = qt_ModelViewProjectionMatrix * (qt_Vertex *
- vec4(1.0, qt_Custom, 1.0, 1.0));
- texCoord = -qt_MultiTexCoord0 + vec4(qt_Custom, 0.0, 0.0, 0.0);
-
- }
- "
- fragmentShader: "
- varying highp vec4 texCoord;
- uniform sampler2D qt_Texture0;
- uniform mediump vec4 qt_Color;
-
- void main(void)
- {
- mediump vec4 col = texture2D(qt_Texture0, texCoord.st);
- gl_FragColor = vec4(clamp(qt_Color.rgb * (1.0 - col.a) +
- col.rgb, 0.0, 1.0), 1.0);
- }
- "
- }
- }
-}
diff --git a/examples/quick3d/shaders/qml/Collapsing.qml b/examples/quick3d/shaders/qml/Collapsing.qml
deleted file mode 100644
index 63b1e0ef..00000000
--- a/examples/quick3d/shaders/qml/Collapsing.qml
+++ /dev/null
@@ -1,125 +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 1.0
-import Qt3D 1.0
-
-Viewport {
- property string name: "Collapsing Shader"
- property string icon: "images/teapot-logo.png"
-
- width: 640; height: 480
-
- Item3D {
- mesh: Mesh { source: "meshes/teapot.bez" }
- effect: program
-
- transform: Rotation3D {
- NumberAnimation on angle{
- running: true
- loops: Animation.Infinite
- from: 0
- to: 360
- duration: 8000
- }
- axis: Qt.vector3d(1, -0.3, 0)
- }
-
- ShaderProgram {
- id: program
- property real collapseFactor : 0.0
-
- SequentialAnimation on collapseFactor {
- running: true
- loops: Animation.Infinite
- PauseAnimation { duration: 700 }
- NumberAnimation { from: 0.0; to: 1.0; duration: 1500; easing.type:"OutBounce" }
- PauseAnimation { duration: 700 }
- NumberAnimation { from: 1.0; to: 0.0; duration: 1500; easing.type:"OutBounce" }
- }
- texture: "images/qtlogo.png"
-
- SequentialAnimation on color{
- running: true
- loops: Animation.Infinite
- ColorAnimation {
- from: "#00008a"
- to: "#003333"
- duration: 5000
- }
- ColorAnimation {
- from: "#003333"
- to: "#00008a"
- duration: 5000
- }
- }
-
- vertexShader: "
- attribute highp vec4 qt_Vertex;
- attribute highp vec4 qt_MultiTexCoord0;
- uniform mediump mat4 qt_ModelViewProjectionMatrix;
- varying highp vec4 texCoord;
- uniform highp float collapseFactor;
-
- void main(void)
- {
- // Interpolate between the actual position of the input vertex
- // and treating the tex-coordinates as vertex positions to
- // create a neat collapsing effect.
- vec4 workingPosition = mix( qt_Vertex, vec4(-qt_MultiTexCoord0.xyz, 1.0) , collapseFactor);
- gl_Position = qt_ModelViewProjectionMatrix * workingPosition;
- texCoord = -qt_MultiTexCoord0;
- }
- "
- fragmentShader: "
- varying highp vec4 texCoord;
- uniform sampler2D qt_Texture0;
- uniform mediump vec4 qt_Color;
-
- void main(void)
- {
- mediump vec4 col = texture2D(qt_Texture0, texCoord.st);
- gl_FragColor = vec4(clamp(qt_Color.rgb * (1.0 - col.a) +
- col.rgb, 0.0, 1.0), 1.0);
- }
- "
- }
- }
-}
diff --git a/examples/quick3d/shaders/qml/Images.qml b/examples/quick3d/shaders/qml/Images.qml
deleted file mode 100644
index 0cd157ce..00000000
--- a/examples/quick3d/shaders/qml/Images.qml
+++ /dev/null
@@ -1,144 +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 1.0
-import Qt3D 1.0
-
-Rectangle {
- property string name: "Images Shader"
- property string icon: "images/teapot-logo.png"
-
- width: 640; height: 480
- id: top
- color: "black"
-
- property bool flag : true
-
- property string imageUrl: flag ?
- "images/qtlogo.png" :
- "images/basket.jpg"
-
- Image {
- id: myChangingImage
- source: imageUrl
- }
-
- Viewport {
- anchors.fill: parent
-
- MouseArea
- {
- anchors.fill: parent
- onClicked: top.flag = !top.flag
- }
-
- Item3D {
- mesh: Mesh { source: "meshes/teapot.bez" }
- effect: shaderEffect
-
- transform: Rotation3D {
- NumberAnimation on angle{
- running: true
- loops: Animation.Infinite
- from: 0
- to: 360
- duration: 18000
- }
- axis: Qt.vector3d(1, -0.3, 0)
- }
- }
-
- ShaderProgram {
- id: shaderEffect
- property alias myBoolean : top.flag
- property variant textureOffset : Qt.size(textureOffsetX * 5, 0.0)
- property real textureOffsetX : 0.0
-
-
- // Default texture that the shaderprogram will get until something else
- // is bound:
- texture: "images/qtlogo.png"
-
- // This property is automatically hooked up to the image uniform
- // in the shader program below.
- property string image : imageUrl
-
- SequentialAnimation on textureOffsetX {
- running: true
- loops: Animation.Infinite
- PauseAnimation { duration: 2500 }
- NumberAnimation { from: 0.0; to: 1.0; duration: 1500; easing.type:"OutBounce" }
- PauseAnimation { duration: 2500 }
- NumberAnimation { from: 1.0; to: 0.0; duration: 1500; easing.type:"OutBounce" }
- }
-
- vertexShader: "
- attribute highp vec4 qt_Vertex;
- attribute highp vec4 qt_MultiTexCoord0;
- uniform mediump mat4 qt_ModelViewProjectionMatrix;
- varying highp vec4 texCoord;
-
- uniform mediump vec2 textureOffset;
-
- void main(void)
- {
- gl_Position = qt_ModelViewProjectionMatrix * qt_Vertex;
- texCoord = -qt_MultiTexCoord0 + vec4(textureOffset.x, textureOffset.y, 0.0, 0.0);
- }
- "
-
- fragmentShader: "
- varying highp vec4 texCoord;
- uniform sampler2D qt_Texture0;
- uniform bool myBoolean;
-
- // This image uniform is automatically associated with the image
- // property of the shader program.
- uniform sampler2D image;
-
- void main(void)
- {
- mediump vec4 imageColor = texture2D(image, texCoord.st);
- gl_FragColor = imageColor;
- }
- "
- }
- }
-}
diff --git a/examples/quick3d/shaders/qml/Interpolate.qml b/examples/quick3d/shaders/qml/Interpolate.qml
deleted file mode 100644
index 182a3bed..00000000
--- a/examples/quick3d/shaders/qml/Interpolate.qml
+++ /dev/null
@@ -1,124 +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 1.0
-import Qt3D 1.0
-
-Viewport {
- property string name: "Interpolate Shader"
- property string icon: "images/teapot-logo.png"
-
- width: 640; height: 480
-
- Item3D {
- mesh: Mesh { source: "meshes/teapot.bez" }
- effect: program
-
- transform: Rotation3D {
- NumberAnimation on angle{
- running: true
- loops: Animation.Infinite
- from: 0
- to: 360
- duration: 5000
- }
- axis: Qt.vector3d(1, -0.3, 0)
- }
-
- ShaderProgram {
- id: program
- texture: "images/basket.jpg"
- property variant texture2 : "images/qtlogo.png"
- property real interpolationFactor : 0.0
-
- SequentialAnimation on interpolationFactor {
- running: true
- loops: Animation.Infinite
- NumberAnimation { to : 1.0; duration: 750; }
- PauseAnimation { duration: 550 }
- NumberAnimation { to : 0.0; duration: 750; }
- PauseAnimation { duration: 550 }
- }
-
- SequentialAnimation on color{
- running: true
- loops: Animation.Infinite
- ColorAnimation {
- from: "#aaca00"
- to: "#0033ca"
- duration: 500
- }
- ColorAnimation {
- from: "#0033ca"
- to: "#aaca00"
- duration: 500
- }
- }
-
- vertexShader: "
- attribute highp vec4 qt_Vertex;
- attribute highp vec4 qt_MultiTexCoord0;
- uniform mediump mat4 qt_ModelViewProjectionMatrix;
- varying highp vec4 texCoord;
-
- void main(void)
- {
- gl_Position = qt_ModelViewProjectionMatrix * qt_Vertex;
- texCoord = qt_MultiTexCoord0;
- }
- "
-
- fragmentShader: "
- varying highp vec4 texCoord;
- uniform sampler2D qt_Texture0;
- uniform sampler2D texture2;
- uniform mediump vec4 qt_Color;
- uniform mediump float interpolationFactor;
-
- void main(void)
- {
- mediump vec4 col1 = texture2D(qt_Texture0, texCoord.st);
- mediump vec4 col2 = texture2D(texture2, texCoord.st);
- gl_FragColor = mix(col1, col2, interpolationFactor);
- }
- "
- }
- }
-}
diff --git a/examples/quick3d/shaders/qml/images/basket.jpg b/examples/quick3d/shaders/qml/images/basket.jpg
deleted file mode 100644
index 438e7a0c..00000000
--- a/examples/quick3d/shaders/qml/images/basket.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/shaders/qml/images/qtlogo.png b/examples/quick3d/shaders/qml/images/qtlogo.png
deleted file mode 100644
index 7d3e97eb..00000000
--- a/examples/quick3d/shaders/qml/images/qtlogo.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/shaders/qml/images/teapot-logo.png b/examples/quick3d/shaders/qml/images/teapot-logo.png
deleted file mode 100644
index 39f02e51..00000000
--- a/examples/quick3d/shaders/qml/images/teapot-logo.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/shaders/qml/meshes/teapot.bez b/examples/quick3d/shaders/qml/meshes/teapot.bez
deleted file mode 100644
index 02b2ac44..00000000
--- a/examples/quick3d/shaders/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/examples/quick3d/shaders/qml/shaders.qml b/examples/quick3d/shaders/qml/shaders.qml
deleted file mode 100644
index ebddd3de..00000000
--- a/examples/quick3d/shaders/qml/shaders.qml
+++ /dev/null
@@ -1,143 +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: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 1.0
-
-Rectangle {
- property int current : 0
- width: 640
- height: 480
-
- Rectangle {
- id: tabContentArea
- width: parent.width
-
- anchors.top: parent.top
- anchors.bottom: tabButtonArea.top
- Repeater {
- model: tabsModel
- }
- }
-
- VisualItemModel {
- id: tabsModel
- Collapsing { }
- //Images { }
- //Interpolate { }
- Bouncing { }
- }
-
- Rectangle {
- id: tabButtonArea
- height: 64
- width: parent.width
-
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.bottom: parent.bottom
-
- gradient: Gradient {
- GradientStop {position: 0.0; color: "#CCCCCC"}
- GradientStop {position: 1.0; color: "#000000"}
- }
-
- Component {
- id: tabButton
-
- Rectangle {
- height: tabButtonArea.height
- width: tabs.width / tabsModel.count
-
- color: "transparent"
-
- Image {
- source: tabsModel.children[index].icon
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.top: parent.top
- anchors.topMargin: 4
- }
-
- Text {
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.bottom: parent.bottom
- anchors.bottomMargin: 4
- color: "white"
- text: tabsModel.children[index].name
- }
-
- MouseArea {
- anchors.fill: parent
- onClicked: {
- tabClicked(index);
- }
- }
- }
- }
-
- Row {
- id: tabs
- anchors.fill: parent
- Repeater {
- model: tabsModel.count
- delegate: tabButton
- }
- }
- }
-
- function tabClicked(index)
- {
- tabs.children[current].color = "transparent";
- tabsModel.children[current].visible = false;
- current = index;
- tabs.children[current].color = "#30ffffff";
- tabsModel.children[current].visible = true;
- }
-
- Component.onCompleted:
- {
- // hide all the tab views
- for(var i = 0; i < tabsModel.children.length; i++)
- {
- tabsModel.children[i].visible = false;
- }
- // select the default tab index
- tabClicked(current);
- }
-}
diff --git a/examples/quick3d/shaders/qml/shaders.qmlproject b/examples/quick3d/shaders/qml/shaders.qmlproject
deleted file mode 100644
index 2065b89e..00000000
--- a/examples/quick3d/shaders/qml/shaders.qmlproject
+++ /dev/null
@@ -1,56 +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: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 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: [ "../exampleplugin" ]
-}
diff --git a/examples/quick3d/shaders/qtquick3d.ico b/examples/quick3d/shaders/qtquick3d.ico
deleted file mode 100644
index c695ac72..00000000
--- a/examples/quick3d/shaders/qtquick3d.ico
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/shaders/qtquick3d.png b/examples/quick3d/shaders/qtquick3d.png
deleted file mode 100644
index 8351083e..00000000
--- a/examples/quick3d/shaders/qtquick3d.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/shaders/shaders.desktop b/examples/quick3d/shaders/shaders.desktop
deleted file mode 100644
index a9b22425..00000000
--- a/examples/quick3d/shaders/shaders.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=Shaders
-Icon=/usr/share/icons/hicolor/80x80/apps/qtquick3d.png
-Exec=/usr/bin/invoker --type=e -s /usr/bin/shaders -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_shaders
diff --git a/examples/quick3d/shaders/shaders.pro b/examples/quick3d/shaders/shaders.pro
deleted file mode 100644
index f3076572..00000000
--- a/examples/quick3d/shaders/shaders.pro
+++ /dev/null
@@ -1,25 +0,0 @@
-TEMPLATE = app
-TARGET = shaders
-CONFIG += qt warn_on
-
-INSTALL_DIRS = qml
-CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg
-include(../../../pkg.pri)
-qtcAddDeployment()
-
-SOURCES += main.cpp
-
-symbian {
- qmlDeployment2.sources = qml\images\*
- qmlDeployment2.path = qml\images
- DEPLOYMENT += qmlDeployment2
- qmlDeployment3.sources = qml\meshes\*
- qmlDeployment3.path = qml\meshes
- DEPLOYMENT += qmlDeployment3
-}
-
-OTHER_FILES += \
- shaders.rc \
- shaders.desktop
-
-RC_FILE = shaders.rc
diff --git a/examples/quick3d/shaders/shaders.rc b/examples/quick3d/shaders/shaders.rc
deleted file mode 100644
index 1b6228c9..00000000
--- a/examples/quick3d/shaders/shaders.rc
+++ /dev/null
@@ -1 +0,0 @@
-IDI_ICON1 ICON DISCARDABLE "qtquick3d.ico"
diff --git a/examples/quick3d/solarsystem_qml/main.cpp b/examples/quick3d/solarsystem_qml/main.cpp
deleted file mode 100644
index 443ec11b..00000000
--- a/examples/quick3d/solarsystem_qml/main.cpp
+++ /dev/null
@@ -1,73 +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: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$
-**
-****************************************************************************/
-
-#include <QtGui/QApplication>
-#include <QtDeclarative/QDeclarativeEngine>
-
-#include "qdeclarativeview3d.h"
-
-#include "../qmlres.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
-
- QDeclarativeView3D view;
- QString qml = q_get_qmldir(QLatin1String("qml/solarsystem_qml.qml"));
-
- view.setSource(QUrl::fromLocalFile(qml));
-
- QObject::connect(view.engine(), SIGNAL(quit()), &app, SLOT(quit()));
-
-#ifdef Q_OS_SYMBIAN
- view.setAttribute(Qt::WA_LockLandscapeOrientation, true);
- view.setResizeMode(QDeclarativeView::SizeRootObjectToView);
- view.showFullScreen();
-#else
- if (QApplication::arguments().contains(QLatin1String("-maximize")))
- view.showMaximized();
- else if (QApplication::arguments().contains(QLatin1String("-fullscreen")))
- view.showFullScreen();
- else
- view.show();
-#endif
-
- return app.exec();
-}
diff --git a/examples/quick3d/solarsystem_qml/qml/attribution.txt b/examples/quick3d/solarsystem_qml/qml/attribution.txt
deleted file mode 100644
index 28fe61c3..00000000
--- a/examples/quick3d/solarsystem_qml/qml/attribution.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-Image files based on textures courtesy of:
-qzma.deviantart.com
-sirius-sdz.deviantart.com
-
diff --git a/examples/quick3d/solarsystem_qml/qml/moon-texture.jpg b/examples/quick3d/solarsystem_qml/qml/moon-texture.jpg
deleted file mode 100644
index b6955e38..00000000
--- a/examples/quick3d/solarsystem_qml/qml/moon-texture.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/solarsystem_qml/qml/planet.jpg b/examples/quick3d/solarsystem_qml/qml/planet.jpg
deleted file mode 100644
index aab7f7b1..00000000
--- a/examples/quick3d/solarsystem_qml/qml/planet.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/solarsystem_qml/qml/solar.fsh b/examples/quick3d/solarsystem_qml/qml/solar.fsh
deleted file mode 100644
index b85bd708..00000000
--- a/examples/quick3d/solarsystem_qml/qml/solar.fsh
+++ /dev/null
@@ -1,70 +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: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$
-**
-****************************************************************************/
-
-uniform sampler2D qt_Texture0;
-uniform sampler2D qt_Texture1;
-varying mediump vec4 lightingColor;
-varying highp vec4 texCoord0;
-uniform mediump float glowFactor;
-
-void main(void)
-{
- vec4 unlitColor0 = texture2D(qt_Texture0, texCoord0.st);
- vec4 unlitColor1 = texture2D(qt_Texture1, texCoord0.st);
-
- // interpolate between the two textures
- vec4 unlitColor = mix(unlitColor0, unlitColor1, glowFactor);
-
- // Apply lighting
- vec4 litColor = lightingColor * unlitColor;
- // Normally, we'd just paint this lit colour like so:
-// gl_FragColor = litColor;
-
- // However, we want a cool glow effect, because the sun is generating
- // it's own light.
-
- // Multiplying the color by itself will washing out the darker colours,
- // leaving the brighter colours brighter by comparison
- vec4 powerColor = unlitColor * unlitColor;
- powerColor = powerColor * powerColor ;
-
- // Then combine the higher contrast color and the lit color
- gl_FragColor= mix(litColor, powerColor, glowFactor);
-}
diff --git a/examples/quick3d/solarsystem_qml/qml/solar.jpg b/examples/quick3d/solarsystem_qml/qml/solar.jpg
deleted file mode 100644
index 86f5921a..00000000
--- a/examples/quick3d/solarsystem_qml/qml/solar.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/solarsystem_qml/qml/solar.vsh b/examples/quick3d/solarsystem_qml/qml/solar.vsh
deleted file mode 100644
index 420bc701..00000000
--- a/examples/quick3d/solarsystem_qml/qml/solar.vsh
+++ /dev/null
@@ -1,175 +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: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$
-**
-****************************************************************************/
-
-attribute highp vec4 qt_Vertex;
-attribute highp vec3 qt_Normal;
-attribute highp vec4 qt_MultiTexCoord0;
-uniform highp mat4 qt_ModelViewProjectionMatrix;
-uniform highp mat4 qt_ModelViewMatrix;
-uniform highp mat3 qt_NormalMatrix;
-varying highp vec4 texCoord0;
-
-// varying values for per-pixel lighting
-varying mediump vec4 lightingColor;
-varying highp vec3 normal;
-varying highp vec3 lightDirection;
-varying highp vec3 halfVector;
-varying highp vec3 vertexToLight;
-
-// Varying values for per-vertex lighting
-varying mediump vec4 litCombinedColor;
-
-// These structs are copied from the QGLShaderProgramEffect documentation
-struct qt_MaterialParameters {
- mediump vec4 emission;
- mediump vec4 ambient;
- mediump vec4 diffuse;
- mediump vec4 specular;
- mediump float shininess;
-};
-uniform qt_MaterialParameters qt_Material;
-
-struct qt_SingleLightParameters {
- mediump vec4 position;
- mediump vec3 spotDirection;
- mediump float spotExponent;
- mediump float spotCutoff;
- mediump float spotCosCutoff;
- mediump float constantAttenuation;
- mediump float linearAttenuation;
- mediump float quadraticAttenuation;
-};
-uniform qt_SingleLightParameters qt_Light;
-
-// This is a pretty standard lighting function, adapted from QGLLitMaterial.
-// The changes are mostly just renaming to improve readablity, but some
-// unecessary features are removed too (e.g. support for two-sided materials)
-
-void qLightVertex(vec4 vertex, vec3 normal)
-{
- // Start with the material's emissive color and the ambient scene color,
- // which have been combined into the emission parameter.
- vec4 color = qt_Material.emission;
- vec4 scolor = qt_Material.specular;
-
- // Viewer is at infinity.
- vec3 toEye = vec3(0, 0, 1);
-
- // Determine the angle between the normal and the light direction.
- vec4 lightPosition = qt_Light.position;
- vec3 lightDirection;
- if (lightPosition.w == 0.0)
- lightDirection = normalize(lightPosition.xyz);
- else
- lightDirection = normalize(lightPosition.xyz - vertex.xyz);
- // Clean up negative values
- float angle = max(dot(normal, lightDirection), 0.0);
-
- // Calculate the ambient and diffuse light components.
- vec4 adcomponent = qt_Material.ambient + angle * qt_Material.diffuse;
-
- // Calculate the specular light components, in case they're needed for
- // per-vertex lighting.
- vec4 scomponent;
- if (angle != 0.0) {
- halfVector = normalize(lightDirection + toEye);
- angle = max(dot(normal, halfVector), 0.0);
- float srm = qt_Material.shininess;
- vec4 scm = qt_Material.specular;
- if (srm != 0.0)
- scomponent = pow(angle, srm) * scm;
- else
- scomponent = scm;
- } else {
- scomponent = vec4(0, 0, 0, 0);
- }
-
- // Apply the spotlight angle and exponent.
- if (qt_Light.spotCutoff != 180.0) {
- vertexToLight = vertex.xyz - lightPosition.xyz;
- float spot = max(dot(normalize(vertexToLight),
- qt_Light.spotDirection), 0.0);
- if (spot < qt_Light.spotCosCutoff) {
- adcomponent = vec4(0, 0, 0, 0);
- scomponent = vec4(0, 0, 0, 0);
- } else {
- spot = pow(spot, qt_Light.spotExponent);
- adcomponent *= spot;
- scomponent *= spot;
- }
- }
-
- // Apply attenuation to the colors.
- if (lightPosition.w != 0.0) {
- float attenuation = qt_Light.constantAttenuation;
- float k1 = qt_Light.linearAttenuation;
- float k2 = qt_Light.quadraticAttenuation;
- if (k1 != 0.0 || k2 != 0.0) {
- float len = length(lightPosition.xyz - vertex.xyz);
- attenuation += k1 * len + k2 * len * len;
- }
- color += adcomponent / attenuation;
- scolor += scomponent / attenuation;
- } else {
- color += adcomponent;
- scolor += scomponent;
- }
-
- // Generate the final output colors to pass to the fragment shader.
- float alpha = qt_Material.diffuse.a;
- // This is the combined diffuse and ambient lighting color
- lightingColor = vec4(clamp(color.rgb, 0.0, 1.0), alpha);
- // Specular lighting and combined color is used for per vertex lighting if
- // per-pixel is too expensive or not required.
- vec4 specularLightingColor = vec4(clamp(scolor.rgb, 0.0, 1.0), 0.0);
- litCombinedColor = clamp(lightingColor + vec4(specularLightingColor.xyz, 0.0), 0.0, 1.0);
-}
-
- void main(void)
- {
- gl_Position = qt_ModelViewProjectionMatrix * qt_Vertex;
- texCoord0 = qt_MultiTexCoord0;
-
- // Calculate the vertex and normal to use for lighting calculations.
- highp vec4 vertex = qt_ModelViewMatrix * qt_Vertex;
- normal = normalize(qt_NormalMatrix * qt_Normal);
- qLightVertex(vertex,normal);
-}
-
diff --git a/examples/quick3d/solarsystem_qml/qml/solar2.jpg b/examples/quick3d/solarsystem_qml/qml/solar2.jpg
deleted file mode 100755
index 1aa0f02d..00000000
--- a/examples/quick3d/solarsystem_qml/qml/solar2.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/solarsystem_qml/qml/solarsystem_qml.qml b/examples/quick3d/solarsystem_qml/qml/solarsystem_qml.qml
deleted file mode 100644
index 1b98f89c..00000000
--- a/examples/quick3d/solarsystem_qml/qml/solarsystem_qml.qml
+++ /dev/null
@@ -1,130 +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: 800; height: 600
- showSceneGraph: true
-
- //! [0]
- SphereMesh {
- id: planetoid
- levelOfDetail: 6
- axis: Qt.YAxis
- }
- //! [0]
-
- //! [1]
- Item3D {
- id: sun
- Item3D {
- transform: [ Scale3D { scale: "0.3, 0.3, 0.3" } ]
- mesh: planetoid
- }
- effect: Effect { texture: "solar.jpg" }
- transform: [
- Rotation3D { id: spin; axis: "0,1,0"; angle: 0 }
- ]
- NumberAnimation { target: spin; property: "angle"; to: 360; duration: 10000; running: true; loops: Animation.Infinite }
- }
- //! [1]
- Item3D {
- id: earth_system
- transform: [
- Translation3D { id: earth_orbit_distance; translate: "2,0,0" },
- Rotation3D { id: earth_orbit; axis: "0,1,0"; angle: 0 },
- Rotation3D { id: orbit_tilt; axis: "0,0,1"; angle: 20 }
- ]
- NumberAnimation { target: earth_orbit; property: "angle"; to: 360; duration: 20000;
- running: true; loops: Animation.Infinite }
- Item3D {
- Item3D {
- id: earth
- Item3D {
- transform: [ Scale3D { scale: "0.15, 0.15, 0.15" } ]
- mesh: planetoid
- }
- transform: [
- Rotation3D { id: earth_spin; axis: "0,1,0"; angle: 0 }
- ]
- NumberAnimation { target: earth_spin; property: "angle"; to: 360; duration: 2000;
- running: true; loops: Animation.Infinite }
- effect: Effect { texture: "planet.jpg" }
- }
- Item3D {
- id: moon
- Item3D {
- transform: [ Scale3D { scale: "0.09, 0.09, 0.09" } ]
- mesh: planetoid
- }
- transform: [
- Translation3D { id: moon_orbit_distance; translate: "0.5,0,0" },
- Rotation3D { id: moon_orbit; angle: 0; axis: "0,1,0" },
- Rotation3D { id: moon_orbit_tilt; angle: 90; axis: "1,0,0" }
- ]
- NumberAnimation { target: moon_orbit; property: "angle"; to: 360; duration: 8000;
- running: true; loops: Animation.Infinite }
- effect: Effect { texture: "moon-texture.jpg" }
- }
- }
- }
- Rectangle {
- id: quit
- width: parent.width
- height: parent.height / 8
- color: "blue"
- opacity: 0.5
- Text {
- id: quit_button
- anchors.centerIn: parent
- text: qsTr("Quit")
- font.bold: true
- font.pointSize: 24
- color: "white"
- }
- MouseArea {
- onClicked: Qt.quit()
- anchors.fill: parent
- }
- }
-}
diff --git a/examples/quick3d/solarsystem_qml/qtquick3d.ico b/examples/quick3d/solarsystem_qml/qtquick3d.ico
deleted file mode 100644
index c695ac72..00000000
--- a/examples/quick3d/solarsystem_qml/qtquick3d.ico
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/solarsystem_qml/qtquick3d.png b/examples/quick3d/solarsystem_qml/qtquick3d.png
deleted file mode 100644
index 8351083e..00000000
--- a/examples/quick3d/solarsystem_qml/qtquick3d.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/solarsystem_qml/solarsystem_qml.desktop b/examples/quick3d/solarsystem_qml/solarsystem_qml.desktop
deleted file mode 100644
index 8fecffe2..00000000
--- a/examples/quick3d/solarsystem_qml/solarsystem_qml.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=Solar System
-Icon=/usr/share/icons/hicolor/80x80/apps/qtquick3d.png
-Exec=/usr/bin/invoker --type=e -s /usr/bin/solarsystem_qml -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_solarsystem_qml
diff --git a/examples/quick3d/solarsystem_qml/solarsystem_qml.pro b/examples/quick3d/solarsystem_qml/solarsystem_qml.pro
deleted file mode 100644
index 0baedc0c..00000000
--- a/examples/quick3d/solarsystem_qml/solarsystem_qml.pro
+++ /dev/null
@@ -1,17 +0,0 @@
-TEMPLATE = app
-TARGET = solarsystem_qml
-CONFIG += qt warn_on
-
-INSTALL_DIRS = qml
-CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg
-include(../../../pkg.pri)
-qtcAddDeployment()
-
-SOURCES += main.cpp
-
-OTHER_FILES += \
- solarsystem_qml.rc \
- solarsystem_qml.desktop
-
-RC_FILE = solarsystem_qml.rc
-
diff --git a/examples/quick3d/solarsystem_qml/solarsystem_qml.rc b/examples/quick3d/solarsystem_qml/solarsystem_qml.rc
deleted file mode 100644
index 1b6228c9..00000000
--- a/examples/quick3d/solarsystem_qml/solarsystem_qml.rc
+++ /dev/null
@@ -1 +0,0 @@
-IDI_ICON1 ICON DISCARDABLE "qtquick3d.ico"
diff --git a/examples/quick3d/sphere/main.cpp b/examples/quick3d/sphere/main.cpp
deleted file mode 100644
index 311aefbf..00000000
--- a/examples/quick3d/sphere/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: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$
-**
-****************************************************************************/
-
-#include <QtGui/QApplication>
-#include "qdeclarativeview3d.h"
-
-#include "../qmlres.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
-
- QDeclarativeView3D view;
- QString qml = q_get_qmldir(QLatin1String("qml/sphere.qml"));
- view.setSource(QUrl::fromLocalFile(qml));
-
-#ifdef Q_OS_SYMBIAN
- view.setAttribute(Qt::WA_LockLandscapeOrientation, true);
- view.setResizeMode(QDeclarativeView::SizeRootObjectToView);
- view.showFullScreen();
-#else
- if (QApplication::arguments().contains(QLatin1String("-maximize")))
- view.showMaximized();
- else if (QApplication::arguments().contains(QLatin1String("-fullscreen")))
- view.showFullScreen();
- else
- view.show();
-#endif
-
- return app.exec();
-}
diff --git a/examples/quick3d/sphere/qml/sphere.qml b/examples/quick3d/sphere/qml/sphere.qml
deleted file mode 100644
index 21056688..00000000
--- a/examples/quick3d/sphere/qml/sphere.qml
+++ /dev/null
@@ -1,171 +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 1.0
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-
-Viewport {
- width: 800; height: 480
-
- Item3D {
- effect: Effect { color: "#aaca00" }
-
- Sphere {
- radius: 0.5
- x: -2.5
- y: 0.6
- levelOfDetail: 1
-
- transform: Rotation3D {
- angle: 45
- axis: Qt.vector3d(1, -1, 1)
- }
- }
-
- Sphere {
- radius: 0.5
- x: -1.25
- y: 0.6
- levelOfDetail: 2
-
- transform: Rotation3D {
- angle: 45
- axis: Qt.vector3d(1, -1, 1)
- }
- }
-
- Sphere {
- radius: 0.5
- x: 0
- y: 0.6
- levelOfDetail: 3
-
- transform: Rotation3D {
- angle: 45
- axis: Qt.vector3d(1, -1, 1)
- }
- }
-
- Sphere {
- radius: 0.5
- x: 1.25
- y: 0.6
- levelOfDetail: 4
-
- transform: Rotation3D {
- angle: 45
- axis: Qt.vector3d(1, -1, 1)
- }
- }
-
- Sphere {
- radius: 0.5
- x: 2.5
- y: 0.6
- levelOfDetail: 5
-
- transform: Rotation3D {
- angle: 45
- axis: Qt.vector3d(1, -1, 1)
- }
- }
-
- Sphere {
- radius: 0.5
- x: -2.5
- y: -0.6
- levelOfDetail: 6
-
- transform: Rotation3D {
- angle: 45
- axis: Qt.vector3d(1, -1, 1)
- }
- }
-
- Sphere {
- radius: 0.5
- x: -1.25
- y: -0.6
- levelOfDetail: 7
-
- transform: Rotation3D {
- angle: 45
- axis: Qt.vector3d(1, -1, 1)
- }
- }
-
- Sphere {
- radius: 0.5
- x: 0
- y: -0.6
- levelOfDetail: 8
-
- transform: Rotation3D {
- angle: 45
- axis: Qt.vector3d(1, -1, 1)
- }
- }
-
- Sphere {
- radius: 0.5
- x: 1.25
- y: -0.6
- levelOfDetail: 9
-
- transform: Rotation3D {
- angle: 45
- axis: Qt.vector3d(1, -1, 1)
- }
- }
-
- Sphere {
- radius: 0.5
- x: 2.5
- y: -0.6
- levelOfDetail: 10
-
- transform: Rotation3D {
- angle: 45
- axis: Qt.vector3d(1, -1, 1)
- }
- }
- }
-}
diff --git a/examples/quick3d/sphere/qtquick3d.ico b/examples/quick3d/sphere/qtquick3d.ico
deleted file mode 100644
index c695ac72..00000000
--- a/examples/quick3d/sphere/qtquick3d.ico
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/sphere/qtquick3d.png b/examples/quick3d/sphere/qtquick3d.png
deleted file mode 100644
index 8351083e..00000000
--- a/examples/quick3d/sphere/qtquick3d.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick3d/sphere/sphere.desktop b/examples/quick3d/sphere/sphere.desktop
deleted file mode 100644
index 030ee54e..00000000
--- a/examples/quick3d/sphere/sphere.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=Sphere
-Icon=/usr/share/icons/hicolor/80x80/apps/qtquick3d.png
-Exec=/usr/bin/invoker --type=e -s /usr/bin/sphere -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_sphere
diff --git a/examples/quick3d/sphere/sphere.pro b/examples/quick3d/sphere/sphere.pro
deleted file mode 100644
index 74604c30..00000000
--- a/examples/quick3d/sphere/sphere.pro
+++ /dev/null
@@ -1,16 +0,0 @@
-TEMPLATE = app
-TARGET = sphere
-CONFIG += qt warn_on
-
-INSTALL_DIRS = qml
-CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg
-include(../../../pkg.pri)
-qtcAddDeployment()
-
-SOURCES += main.cpp
-
-OTHER_FILES += \
- sphere.rc \
- sphere.desktop
-
-RC_FILE = sphere.rc
diff --git a/examples/quick3d/sphere/sphere.rc b/examples/quick3d/sphere/sphere.rc
deleted file mode 100644
index 1b6228c9..00000000
--- a/examples/quick3d/sphere/sphere.rc
+++ /dev/null
@@ -1 +0,0 @@
-IDI_ICON1 ICON DISCARDABLE "qtquick3d.ico"
diff --git a/features/qt3d.prf b/features/qt3d.prf
deleted file mode 100644
index 676d662d..00000000
--- a/features/qt3d.prf
+++ /dev/null
@@ -1,23 +0,0 @@
-!symbian {
- macx:CONFIG(qt_framework, qt_framework|qt_no_framework) {
- LIBS += -framework Qt3D
- # Makes includes like "#include <Qt3D/foo.h>" work in case of frameworks
- QMAKE_CXXFLAGS += -FQt3D
- # Makes includes like "#include <foo.h>" work in case of frameworks
- INCLUDEPATH += $$[QT_INSTALL_LIBS]/Qt3D.framework/Versions/1/Headers
- } else {
- win32:CONFIG(debug, debug|release) {
- LIBS += -lQt3D$${QT_LIBINFIX}d
- } else {
- LIBS += -lQt3D$${QT_LIBINFIX}
- }
- }
- INCLUDEPATH += $$[QT_INSTALL_HEADERS]/Qt3D
-} else {
- load(data_caging_paths)
-
- INCLUDEPATH+=$$MW_LAYER_PUBLIC_EXPORT_PATH(Qt3D)
- LIBS += -lQt3D$${QT_LIBINFIX}
-}
-
-QT += opengl network
diff --git a/features/qt3dquick.prf b/features/qt3dquick.prf
deleted file mode 100644
index c9fa169f..00000000
--- a/features/qt3dquick.prf
+++ /dev/null
@@ -1,26 +0,0 @@
-CONFIG += qt3d
-
-!symbian {
- macx:CONFIG(qt_framework, qt_framework|qt_no_framework) {
- LIBS += -framework Qt3DQuick
- # Makes includes like "#include <Qt3DQuick/foo.h>" work in case of frameworks
- QMAKE_CXXFLAGS += -FQt3DQuick
- # Makes includes like "#include <foo.h>" work in case of frameworks
- INCLUDEPATH += $$[QT_INSTALL_LIBS]/Qt3DQuick.framework/Versions/1/Headers
- } else {
- win32:CONFIG(debug, debug|release) {
- LIBS += -lQt3DQuick$${QT_LIBINFIX}d
- } else {
- LIBS += -lQt3DQuick$${QT_LIBINFIX}
- }
- }
- INCLUDEPATH += $$[QT_INSTALL_HEADERS]/Qt3DQuick
-
-} else {
- load(data_caging_paths)
-
- INCLUDEPATH+=$$MW_LAYER_PUBLIC_EXPORT_PATH(Qt3DQuick)
- LIBS += -lQt3DQuick$${QT_LIBINFIX}
-}
-
-QT += opengl network declarative
diff --git a/header.BSD b/header.BSD
deleted file mode 100644
index 0fed0930..00000000
--- a/header.BSD
+++ /dev/null
@@ -1,40 +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$
-**
-****************************************************************************/
-
diff --git a/header.FDL b/header.FDL
deleted file mode 100644
index 59f60c88..00000000
--- a/header.FDL
+++ /dev/null
@@ -1,27 +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 documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Free Documentation License
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of this
-** file.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
diff --git a/header.LGPL b/header.LGPL
deleted file mode 100644
index 46be8614..00000000
--- a/header.LGPL
+++ /dev/null
@@ -1,41 +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 module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
diff --git a/header.LGPL-ONLY b/header.LGPL-ONLY
deleted file mode 100644
index d32f4ee5..00000000
--- a/header.LGPL-ONLY
+++ /dev/null
@@ -1,22 +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 module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL-ONLY$
-** 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
diff --git a/pkg.pri b/pkg.pri
deleted file mode 100644
index 0f8f50f1..00000000
--- a/pkg.pri
+++ /dev/null
@@ -1,285 +0,0 @@
-# Config for making example and demo apps packageable
-
-# Note that the paths here all assumed the including .pro file
-# is exactly 3 levels of directory tree below the root
-
-qtc_harmattan {
- CONFIG += maemo
- CONFIG += package
- QMAKE_CXXFLAGS += -Wno-psabi
- # The Qt SDK / Qt Creator harmattan integration needs some special treatment
- QT3D_INSTALL_BINS = /usr/bin
- QT3D_INSTALL_LIBS = /usr/lib
- QT3D_INSTALL_PLUGINS = /usr/lib/qt4/plugins
- QT3D_INSTALL_IMPORTS = /usr/lib/qt4/imports
- QT3D_INSTALL_DATA = /usr/share/qt4
- QT3D_INSTALL_HEADERS = /usr/include/qt4
-} else {
- QT3D_INSTALL_BINS = $$[QT_INSTALL_BINS]
- QT3D_INSTALL_LIBS = $$[QT_INSTALL_LIBS]
- QT3D_INSTALL_PLUGINS = $$[QT_INSTALL_PLUGINS]
- QT3D_INSTALL_IMPORTS = $$[QT_INSTALL_IMPORTS]
- QT3D_INSTALL_DATA = $$[QT_INSTALL_DATA]
- QT3D_INSTALL_HEADERS = $$[QT_INSTALL_HEADERS]
-}
-
-qt3dquick_deploy_pkg {
- CONFIG += qt3d_deploy_pkg
-
- package {
- macx:CONFIG(qt_framework, qt_framework|qt_no_framework) {
- LIBS += -framework Qt3DQuick -F../../../src/quick3d
- INCLUDEPATH += ../../../src/quick3d/Qt3DQuick.framework/Versions/1/Headers
- } else {
- win32 {
- CONFIG(debug, debug|release) {
- TARGET = $$member(TARGET, 0)d
- LIBS += ..\\..\\..\\src\\quick3d\\debug\\Qt3DQuickd.lib
- } else {
- LIBS += ..\\..\\..\\src\\quick3d\\release\\Qt3DQuick.lib
- }
- } else {
- LIBS += -L../../../src/quick3d -lQt3DQuick
- }
- INCLUDEPATH += ../../../include/Qt3DQuick
- }
- QT += declarative opengl
-
- maemo: icons.files = qtquick3d.png
- } else {
- CONFIG += qt3dquick
- }
-}
-
-qt3d_deploy_pkg {
- package {
- macx:CONFIG(qt_framework, qt_framework|qt_no_framework) {
- LIBS += -framework Qt3D -F../../../src/threed
- INCLUDEPATH += ../../../src/threed/Qt3D.framework/Versions/1/Headers
- } else {
- win32 {
- CONFIG(debug, debug|release) {
- TARGET = $$member(TARGET, 0)d
- LIBS += ..\\..\\..\\src\\threed\\debug\\Qt3Dd.lib
- } else {
- LIBS += ..\\..\\..\\src\\threed\\release\\Qt3D.lib
- }
- } else {
- LIBS += -L../../../src/threed -lQt3D
- }
- INCLUDEPATH += ../../../include/Qt3D
- }
- QT += opengl
-
- !qt3dquick_deploy_pkg: maemo: icons.files = qt3d.png
- } else {
- CONFIG += qt3d
- }
-}
-
-contains(TEMPLATE, app) {
- package {
- maemo {
- applnk.files = $${TARGET}.desktop
- applnk.path = /usr/share/applications
-
- # icons.files is set by qt3dquick_pkg_dep.pri or qt3d_pkg_dep.pri
- icons.path = /usr/share/icons/hicolor/80x80/apps
- INSTALLS += icons applnk
-
- target.path += $$QT3D_INSTALL_BINS
- INSTALLS += target
- } else {
- mt {
- applnk.files = info.json
- applnk.path = /opt/mt/applications/$${TARGET}
-
- # icons.files is set by qt3dquick_pkg_dep.pri or qt3d_pkg_dep.pri
- icons.path = /opt/mt/applications/$${TARGET}
- INSTALLS += icons applnk
- target.path += /opt/mt/applications/$${TARGET}
- INSTALLS += target
-
- DEFINES += QT3D_USE_OPT=$${TARGET}
- } else {
- target.path += $$QT3D_INSTALL_BINS
- INSTALLS += target
- }
- }
- } else {
- DESTDIR = ../../../bin
- }
- symbian {
- vendorinfo = \
- "%{\"Nokia\"}" \
- ":\"Nokia\""
-
- my_deployment.pkg_prerules = vendorinfo
- DEPLOYMENT += my_deployment
-
- qt3dquick_deploy_pkg {
- ICON = ../qtquick3d.svg
- } else {
- ICON = ../qt3d.svg
- }
- }
-}
-
-qt3d_deploy_qml {
- # The final TARGET_DIR must match one of the cases that qmlres.h checks
- # in q_get_qmldir() for a given platform in order for our examples to find
- # their qml files and other assets
- mt {
- TARGET_DIR = /opt/mt/applications/$$TARGET
- } else: maemo {
- TARGET_DIR = $$QT3D_INSTALL_DATA/quick3d/examples/$$TARGET
- } else {
- TARGET_DIR = $$QT3D_INSTALL_DATA/quick3d/resources/examples/$$TARGET
- }
- symbian {
- TARGET_DIR = .
- } else: macx {
- TARGET_DIR = .
- } else {
- !package {
- TARGET_DIR = ../../../bin/resources/examples/$$TARGET
- }
- }
- for(dir, INSTALL_DIRS) {
- di.source = $${dir}
- di.target = $$TARGET_DIR
- DEPLOYMENTFOLDERS += di
- }
-}
-
-# The following code was generated by the Qt Quick Application wizard of Qt Creator.
-# The file it was contained in was qmlapplicationviewer.pri, if necessary it should
-# be possible to simply cut & paste the code straight out of the latest version to
-# update it.
-#
-# The only changes has been to comment out the installPrexfix line below, this
-# will probably be necessary to replicate when replacing.
-#
-defineTest(qtcAddDeployment) {
- for(deploymentfolder, DEPLOYMENTFOLDERS) {
- item = item$${deploymentfolder}
- itemsources = $${item}.sources
- $$itemsources = $$eval($${deploymentfolder}.source)
- itempath = $${item}.path
- $$itempath= $$eval($${deploymentfolder}.target)
- export($$itemsources)
- export($$itempath)
- DEPLOYMENT += $$item
- }
-
- MAINPROFILEPWD = $$PWD
-
- symbian {
- isEmpty(ICON):exists($${TARGET}.svg):ICON = $${TARGET}.svg
- isEmpty(TARGET.EPOCHEAPSIZE):TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
- } else:win32 {
- copyCommand =
- !package {
- for(deploymentfolder, DEPLOYMENTFOLDERS) {
- source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source)
- source = $$replace(source, /, \\)
- sourcePathSegments = $$split(source, \\)
- target = $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(sourcePathSegments)
- target = $$replace(target, /, \\)
- !isEqual(source,$$target) {
- !isEmpty(copyCommand):copyCommand += &&
- isEqual(QMAKE_DIR_SEP, \\) {
- copyCommand += $$QMAKE_COPY_DIR \"$$source\" \"$$target\"
- } else {
- source = $$replace(source, \\\\, /)
- target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
- target = $$replace(target, \\\\, /)
- copyCommand += test -d \"$$target\" || mkdir -p \"$$target\" && cp -r \"$$source\" \"$$target\"
- }
- }
- }
- !isEmpty(copyCommand) {
- copyCommand = @echo Copying application data... && $$copyCommand
- copydeploymentfolders.commands = $$copyCommand
- first.depends = $(first) copydeploymentfolders
- export(first.depends)
- export(copydeploymentfolders.commands)
- QMAKE_EXTRA_TARGETS += first copydeploymentfolders
- }
- }
- for(deploymentfolder, DEPLOYMENTFOLDERS) {
- item = item$${deploymentfolder}
- itemfiles = $${item}.files
- $$itemfiles = $$eval($${deploymentfolder}.source)
- itempath = $${item}.path
- $$itempath = $$eval($${deploymentfolder}.target)
- export($$itemfiles)
- export($$itempath)
- INSTALLS += $$item
- }
- } else:unix {
- maemo5 {
- desktopfile.files = $${TARGET}.desktop
- desktopfile.path = /usr/share/applications/hildon
- icon.files = $${TARGET}64.png
- icon.path = /usr/share/icons/hicolor/64x64/apps
- } else {
- desktopfile.files = $${TARGET}_harmattan.desktop
- desktopfile.path = /usr/share/applications
- icon.files = $${TARGET}80.png
- icon.path = /usr/share/icons/hicolor/80x80/apps
- copyCommand =
- for(deploymentfolder, DEPLOYMENTFOLDERS) {
- source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source)
- source = $$replace(source, \\\\, /)
- macx {
- target = $$DESTDIR/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
- } else {
- target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
- }
- target = $$replace(target, \\\\, /)
- sourcePathSegments = $$split(source, /)
- targetFullPath = $$target/$$last(sourcePathSegments)
- !isEqual(source,$$targetFullPath) {
- !isEmpty(copyCommand):copyCommand += &&
- copyCommand += $(MKDIR) \"$$target\"
- copyCommand += && $(COPY_DIR) -v \"$$source\" \"$$target\"
- }
- }
- !isEmpty(copyCommand) {
- copyCommand = @echo Copying application data... && $$copyCommand
- copydeploymentfolders.commands = $$copyCommand
- first.depends = $(first) copydeploymentfolders
- export(first.depends)
- export(copydeploymentfolders.commands)
- QMAKE_EXTRA_TARGETS += first copydeploymentfolders
- }
- }
- for(deploymentfolder, DEPLOYMENTFOLDERS) {
- item = item$${deploymentfolder}
- itemfiles = $${item}.files
- $$itemfiles = $$eval($${deploymentfolder}.source)
- itempath = $${item}.path
- $$itempath = $${installPrefix}/$$eval($${deploymentfolder}.target)
- export($$itemfiles)
- export($$itempath)
- INSTALLS += $$item
- }
- package {
- export(icon.files)
- export(icon.path)
- export(desktopfile.files)
- export(desktopfile.path)
- export(target.path)
- INSTALLS += desktopfile icon target
- }
- }
-
- export (ICON)
- export (INSTALLS)
- export (DEPLOYMENT)
- export (TARGET.EPOCHEAPSIZE)
- export (TARGET.CAPABILITY)
- export (LIBS)
- export (QMAKE_EXTRA_TARGETS)
-}
diff --git a/qtc_packaging/debian_harmattan/README b/qtc_packaging/debian_harmattan/README
deleted file mode 100644
index b21b46df..00000000
--- a/qtc_packaging/debian_harmattan/README
+++ /dev/null
@@ -1,95 +0,0 @@
-This is the Qt Quick 3D project:
- * QtQuick3D QML bindings and
- * Qt3D C++ APIs
-
-
-Building QtQuick3D
-==================
-
-Check the building instructions in doc/src/qt3d-building.qdoc also available
-online at: http://doc.qt.nokia.com/qt-quick3d-snapshot/qt3d-building.html
-
-
-Whats in QtQuick3D
-==================
-
-Directory structure:
-
-src/threed/
- This is the main library of the Qt3D project, containing abstractions
- for cross-platform GL, shaders, lighting models, and so on.
-src/plugins/
- Scene format loading plugins.
-src/imports/
- QML import plugins.
-util/
- Various utilities that are useful when working with Qt3D.
-examples/
- Some examples of using QtQuick3D (QML bindings) and Qt3D (C++ API).
-demos/
- Some more complex demos of using QtQuiick3D (QML bindings) and Qt3D (C++ API).
-tests/auto/qml3d/
- Unit tests for the QtQuick3D bindings.
-tests/auto/threed/
- Unit tests for the Qt3D C++ API
-doc/
- Documentation.
-devices/symbian/
- Symbian deployment file
-
-
-Documentation
-=============
-
-The documentation can be generated with "make docs". It will be placed
-into "doc/html" in the build directory.
-
-
-Packages
-========
-
-This section is only for those developing QtQuick3D. Read on to discover how
-the building of packages works. This section is also important if you want to
-change how the structure of the QtQuick3D pro files work.
-
-QtQuick3D is intended to be built in one of two ways:
-
-1) Normal developer way:
- qmake && make
-2) Package creation way:
- qmake CONFIG+=package && INSTALL_ROOT=tmp make install
-
-In 1) the .pro files will cause the toolchain to place the libraries, plugins
-header files and other components of QtQuick3D directly into place, as part of
-the compile process. What does "in place" mean? Run "qmake -query" to see
-the paths where the files are placed - QML plugins go in $$[QT_INSTALL_IMPORTS]
-for example. In this mode, there is no need to run "make install" because the
-files are already in their target destination. Here the "target destination"
-means the Qt which is being built against.
-
-First note that QtQuick3D has to be installed into the target Qt. This is because
-QtQuick3D has QML plugins and resources, as well as shared libraries, all of which
-must be resolved by the QMLViewer of the target Qt at runtime. Here where "qmake"
-is referred to it means the qmake inside the target Qt. Since QtDeclarative
-recommends using QMLViewer when developing and debugging QML Apps, in the developer
-case - which is what Qt3D is for - it has to install directly into the target Qt.
-
-In this mode 1) after the main library is compiled subsequent targets can simply
-resolve includes and link time dependencies by use of qt3d.prf and qtquick3d.prf.
-These two files are installed into the target Qt's makespecs/features directory
-during the processing of the quick3d.pro file.
-
-In 2) the libraries, plugins and so on are sitting inside the build tree after
-the compile step. As a result in order to resolve includes and dependencies
-the build system has to navigate the build tree with paths like "-L../../../threed"
-to locate the Qt3D libraries.
-
-Actually there is one build artifact that is not just left where it lands in the
-build tree - the header files. These are actually copied into an "include"
-directory inside the build root directory. This is because at present the header
-files all live inside their own seperate subdirectories under "threed" and would
-be too cumbersome to path in explicitly.
-
-After building the tree the install step is invoked using the INSTALL_ROOT environment
-export to cause the installation rules to place all the files into a sandboxed
-install tree, ready for packaging.
diff --git a/qtc_packaging/debian_harmattan/changelog b/qtc_packaging/debian_harmattan/changelog
deleted file mode 100644
index 15030940..00000000
--- a/qtc_packaging/debian_harmattan/changelog
+++ /dev/null
@@ -1,5 +0,0 @@
-libqt4-3d (1.0-rc) unstable; urgency=low
-
- * Candidate for 1.0 Release.
-
- -- Sarah Smith <sarah.j.smith@nokia.com> Thu, 24 Nov 2011 16:00:00 +1000
diff --git a/qtc_packaging/debian_harmattan/compat b/qtc_packaging/debian_harmattan/compat
deleted file mode 100644
index 7f8f011e..00000000
--- a/qtc_packaging/debian_harmattan/compat
+++ /dev/null
@@ -1 +0,0 @@
-7
diff --git a/qtc_packaging/debian_harmattan/control b/qtc_packaging/debian_harmattan/control
deleted file mode 100644
index d4f57b71..00000000
--- a/qtc_packaging/debian_harmattan/control
+++ /dev/null
@@ -1,35 +0,0 @@
-Source: libqt4-3d
-Section: libdevel
-Priority: extra
-Maintainer: Sarah Smith <sarah.j.smith@nokia.com>
-Build-Depends: debhelper (>= 5), libqt4-dev
-Standards-Version: 3.7.3
-Homepage: http://doc.qt.nokia.com/qt-quick3d-snapshot/
-
-Package: libqt4-3d
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: Qt4 3D module
- Qt is a cross-platform C++ application framework. Qt's primary feature
- is its rich set of widgets that provide standard GUI functionality.
- .
- The Qt3d module contains functionality for 3D scenes and UIs.
-
-Package: libqt4-3d-examples
-Architecture: any
-Depends: libqt4-3d (= ${binary:Version})
-Description: Qt 4 3d module examples
- Qt is a cross-platform C++ application framework. Qt's primary feature
- is its rich set of widgets that provide standard GUI functionality.
- .
- This package contains examples and demos for the Qt3d module
-
-Package: libqt4-3d-dev
-Architecture: any
-Depends: libqt4-3d (= ${binary:Version})
-Description: Qt 4 3d module development files
- Qt is a cross-platform C++ application framework. Qt's primary feature
- is its rich set of widgets that provide standard GUI functionality.
- .
- This package contains the development headers for the Qt3d moduleescription: <insert up to 60 chars description>
- Qt Quick 3D lets you use QML to write 3D (OpenGL) apps.
diff --git a/qtc_packaging/debian_harmattan/copyright b/qtc_packaging/debian_harmattan/copyright
deleted file mode 100644
index a54c00e4..00000000
--- a/qtc_packaging/debian_harmattan/copyright
+++ /dev/null
@@ -1,22 +0,0 @@
-Nokia Qt LGPL Exception version 1.1
-
-As an additional permission to the GNU Lesser General Public License version
-2.1, the object code form of a "work that uses the Library" may incorporate
-material from a header file that is part of the Library. You may distribute
-such object code under terms of your choice, provided that:
- (i) the header files of the Library have not been modified; and
- (ii) the incorporated material is limited to numerical parameters, data
- structure layouts, accessors, macros, inline functions and
- templates; and
- (iii) you comply with the terms of Section 6 of the GNU Lesser General
- Public License version 2.1.
-
-Moreover, you may apply this exception to a modified version of the Library,
-provided that such modification does not involve copying material from the
-Library into the modified Library's header files unless such material is
-limited to (i) numerical parameters; (ii) data structure layouts;
-(iii) accessors; and (iv) small macros, templates and inline functions of
-five lines or less in length.
-
-Furthermore, you are not required to apply this additional permission to a
-modified version of the Library.
diff --git a/qtc_packaging/debian_harmattan/libqt4-3d-dev.install b/qtc_packaging/debian_harmattan/libqt4-3d-dev.install
deleted file mode 100644
index aef1dfd0..00000000
--- a/qtc_packaging/debian_harmattan/libqt4-3d-dev.install
+++ /dev/null
@@ -1,2 +0,0 @@
-usr/share/qt4/mkspecs/features/
-usr/include/qt4/Qt3D/
diff --git a/qtc_packaging/debian_harmattan/libqt4-3d-examples.install b/qtc_packaging/debian_harmattan/libqt4-3d-examples.install
deleted file mode 100644
index 47d99cab..00000000
--- a/qtc_packaging/debian_harmattan/libqt4-3d-examples.install
+++ /dev/null
@@ -1,4 +0,0 @@
-usr/bin/*
-usr/share/qt4/quick3d
-usr/share/icons/hicolor/80x80/apps
-usr/share/applications
diff --git a/qtc_packaging/debian_harmattan/libqt4-3d.install b/qtc_packaging/debian_harmattan/libqt4-3d.install
deleted file mode 100644
index d650a0c8..00000000
--- a/qtc_packaging/debian_harmattan/libqt4-3d.install
+++ /dev/null
@@ -1,4 +0,0 @@
-usr/lib/libQt3D.so.*
-usr/lib/libQt3DQuick.so.*
-usr/lib/qt4/plugins/
-usr/lib/qt4/imports/
diff --git a/qtc_packaging/debian_harmattan/rules b/qtc_packaging/debian_harmattan/rules
deleted file mode 100755
index 72f257ef..00000000
--- a/qtc_packaging/debian_harmattan/rules
+++ /dev/null
@@ -1,126 +0,0 @@
-#!/usr/bin/make -f
-# -*- makefile -*-
-
-# This rules file is for new Nokia devices using maemo6/meego.
-# For fremantle / N900 see the file devices/maemo5/debian/rules.
-# For ubuntu desktop see the file devices/ubuntu/debian/rules.
-
-# To build using this rules file, the Madde environment is needed. This ships
-# (for example) with the QtSDK.
-#
-# This file ships ready to use with Qt Creator. To use it from the command line
-# uncomment the lines below which say # Uncomment for use without Qt Creator
-# and then follow these steps:
-#
-# ### Step 1: set up the build directory - DO NOT CD INTO IT YET!
-# mkdir -p ~/build/harmattan/pkg
-# cd ~/build/harmattan
-#
-# ### Step 2: set up to use the Madde build environment - eg if Madde is in your home under QtSDK:
-# export MADDE=$HOME/QtSDK/Madde
-# export PATH=$MADDE/targets/harmattan-platform-api/bin:$MADDE/bin:$MADDE/madlib:$MADDE/madbin:$PATH
-# export PERL5LIB=$MADDE/madlib/perl5
-# export SYSROOT_DIR=$MADDE/sysroots/harmattan-meego-arm-sysroot-1122-slim
-#
-# ### Step 3: copy all the stuff across - cannot shadow build (probably don't want git)
-# (cd ~/depot/qt/quick3d && tar cf - --exclude-vcs .)|(cd pkg && tar xf -)
-# cd pkg
-# cp -f -v qtc_packaging/debian_harmattan/* debian/.
-#
-# ### Step 4: actually do the build, using lots of cores if available
-# export DEB_BUILD_OPTIONS="parallel=4"
-# dpkg-buildpackage -b
-#
-#
-# This rules file should use the control and *.install files (driven by the dh_install cmd below)
-# to actually build 3 seperate debian packages:
-# libqt4-3d -- Qt3D "run time" with C++ libs and QML imports
-# libqt4-3d-dev -- Qt3D development files - eg headers and .prf files
-# libqt4-3d-examples -- installed Qt3D examples incl desktop files to run on device
-
-
-# Uncomment this to turn on verbose mode.
-export DH_VERBOSE=1
-
-# Find out how many parallel threads to run
-TMP_BUILD_OPTS = $(subst $(comma),$(space),$(DEB_BUILD_OPTIONS))
-ifneq (,$(filter parallel=%,$(TMP_BUILD_OPTS)))
- NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(TMP_BUILD_OPTS)))
- PARALLEL_MAKEFLAGS += -j$(NUMJOBS)
-endif
-
-DEB_MAKE_INVOKE := $(MAKE) $(PARALLEL_MAKEFLAGS)
-
-configure: configure-stamp
-configure-stamp:
- dh_testdir
- qmake -spec linux-g++-maemo quick3d.pro CONFIG+=qtc_harmattan # Uncomment this line for use without Qt Creator
- touch configure-stamp
-
-build: build-stamp
-
-build-stamp: configure-stamp
- dh_testdir
-
- # Add here commands to compile the package.
- $(DEB_MAKE_INVOKE) # Uncomment this line for use without Qt Creator
- #docbook-to-man debian/quick3d.sgml > quick3d.1
-
- touch $@
-
-clean: configure-stamp
- dh_testdir
- dh_testroot
- rm -f build-stamp configure-stamp
-
- # Add here commands to clean up after the build process.
- $(MAKE) clean
-
- dh_clean
-
-install: build
- dh_testdir
- dh_testroot
- dh_clean -k
- dh_installdirs
-
- # Add here commands to install the package into debian/tmp.
- $(MAKE) INSTALL_ROOT="$(CURDIR)"/debian/tmp install
-
-
-# Build architecture-independent files here.
-binary-indep: build install
-# We have nothing to do by default.
-
-# Build architecture-dependent files here.
-binary-arch: build install
- dh_testdir
- dh_testroot
- dh_installchangelogs
- dh_installdocs
- dh_installexamples
- dh_install --sourcedir=debian/tmp
-# dh_installmenu
-# dh_installdebconf
-# dh_installlogrotate
-# dh_installemacsen
-# dh_installpam
-# dh_installmime
-# dh_python
-# dh_installinit
-# dh_installcron
-# dh_installinfo
- dh_installman
- dh_link
- dh_strip
- dh_compress
- dh_fixperms
-# dh_perl
-# dh_makeshlibs
- dh_installdeb
- dh_gencontrol
- dh_md5sums
- dh_builddeb
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install configure
diff --git a/quick3d.pro b/quick3d.pro
deleted file mode 100644
index cda69359..00000000
--- a/quick3d.pro
+++ /dev/null
@@ -1,70 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS += src
-!gcov: SUBDIRS += util examples demos
-
-include(pkg.pri)
-
-!package: SUBDIRS += tutorials
-
-SUBDIRS += tests
-CONFIG += ordered
-
-include(doc/doc.pri)
-
-# We need opengl, minimum es2 or desktop
-!contains(QT_CONFIG, opengl) {
- error(QtQuick3D requires OpenGL!)
-}
-contains(QT_CONFIG, opengles1) {
- error(QtQuick3D does not support OpenGL ES 1!)
-}
-# We need qt declarative
-!contains(QT_CONFIG, declarative) {
- error(QtQuick3D requires Qt Declarative!)
-}
-
-# Install qt3d.prf into the Qt mkspecs so that "CONFIG += qt3d"
-# can be used in applications to build against Qt3D.
-package {
- distInstalls.files = features/qt3d.prf features/qt3dquick.prf
- distInstalls.path = $$QT3D_INSTALL_DATA/mkspecs/features
- !qtc_hmtn: INSTALLS += distInstalls
-} else {
- symbian|win32 {
- Qt3DFile=$$PWD\\features\\qt3d.prf
- Qt3DFile=$$replace(Qt3DFile,/,\\)
- featuresDir=$$QT3D_INSTALL_DATA\\mkspecs\\features
- featuresDir=$$replace(featuresDir,/,\\)
- system(copy "$$Qt3DFile $$featuresDir")
-
- Qt3DQuickFile=$$PWD\\features\\qt3dquick.prf
- Qt3DQuickFile=$$replace(Qt3DQuickFile,/,\\)
- system(copy "$$Qt3DQuickFile $$featuresDir")
- } else {
- Qt3DFile=$$PWD/features/qt3d.prf
- featuresDir=$$QT3D_INSTALL_DATA/mkspecs/features
- system(cp "$$Qt3DFile $$featuresDir")
-
- Qt3DQuickFile=$$PWD/features/qt3dquick.prf
- system(cp "$$Qt3DQuickFile $$featuresDir")
- }
-}
-
-symbian {
- # symbian needs to be at the end, because qt3d.pro does an ordered build,
- # and symbian depends on all the others.
- SUBDIRS += symbianinstall
-
- symbianinstall.subdir = devices/symbian
- symbianinstall.target = sub-symbianinstall
- symbianinstall.depends = $$SUBDIRS
- symbianinstall.depends -= symbianinstall
-}
-
-OTHER_FILES += \
- qtc_packaging/debian_harmattan/rules \
- qtc_packaging/debian_harmattan/README \
- qtc_packaging/debian_harmattan/copyright \
- qtc_packaging/debian_harmattan/control \
- qtc_packaging/debian_harmattan/compat \
- qtc_packaging/debian_harmattan/changelog
diff --git a/src/imports/imports.pro b/src/imports/imports.pro
deleted file mode 100644
index 31886ee4..00000000
--- a/src/imports/imports.pro
+++ /dev/null
@@ -1,3 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS += threed shapes
-CONFIG += ordered
diff --git a/src/imports/shapes/Capsule.qml b/src/imports/shapes/Capsule.qml
deleted file mode 100644
index 6997e76d..00000000
--- a/src/imports/shapes/Capsule.qml
+++ /dev/null
@@ -1,55 +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
-
-Item3D {
- id: capsule
- property alias name: capsuleMesh.objectName
- property alias radius: capsuleMesh.radius
- property alias length: capsuleMesh.length
- property alias levelOfDetail: capsuleMesh.levelOfDetail
- mesh: CapsuleMesh {
- id: capsuleMesh
- }
-}
diff --git a/src/imports/shapes/Cube.qml b/src/imports/shapes/Cube.qml
deleted file mode 100644
index e60395a3..00000000
--- a/src/imports/shapes/Cube.qml
+++ /dev/null
@@ -1,48 +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
-
-Item3D {
- id: cube
- mesh: Mesh { source: "cube.obj" }
-}
diff --git a/src/imports/shapes/Cylinder.qml b/src/imports/shapes/Cylinder.qml
deleted file mode 100644
index 0323f425..00000000
--- a/src/imports/shapes/Cylinder.qml
+++ /dev/null
@@ -1,55 +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
-
-Item3D {
- id: cylinder
- property alias name: cylinderMesh.objectName
- property alias radius: cylinderMesh.radius
- property alias length: cylinderMesh.length
- property alias levelOfDetail: cylinderMesh.levelOfDetail
- mesh: CylinderMesh {
- id: cylinderMesh
- }
-}
diff --git a/src/imports/shapes/Quad.qml b/src/imports/shapes/Quad.qml
deleted file mode 100644
index 5c636704..00000000
--- a/src/imports/shapes/Quad.qml
+++ /dev/null
@@ -1,48 +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
-
-Item3D {
- id: quad
- mesh: Mesh { source: "quad.obj" }
-}
diff --git a/src/imports/shapes/README.library_xml b/src/imports/shapes/README.library_xml
deleted file mode 100644
index 2f46d66d..00000000
--- a/src/imports/shapes/README.library_xml
+++ /dev/null
@@ -1,15 +0,0 @@
-The library.xml file is required to get syntax highlighting of Qt3D.Shapes
-plugin items in Qt Creator < version 2.2.
-
-The library.xml file is installed into the imports/Qt3D.Shapes tree along with
-the plugin and the qmldir file.
-
-When any of the elements - property names, class names or other exports
-- in the Qt3D.Shapes plugin are changed this file will need to be regenerated.
-
-To generate the library.xml file see the scripts/README file for a
-description of how to use the filter-qmldump.pl script.
-
-This is a less-than-optimal solution but as syntax discovery improves
-in Qt Creator better solutions should become available at which time
-this temporary script and syntax file may be deprecated.
diff --git a/src/imports/shapes/README.plugins_types b/src/imports/shapes/README.plugins_types
deleted file mode 100755
index ff41ea12..00000000
--- a/src/imports/shapes/README.plugins_types
+++ /dev/null
@@ -1,34 +0,0 @@
-The plugins.qmltypes file is required to get syntax highlighting of Qt3D.Shapes
-plugin items inside Qt Creator 2.2 and later.
-
-To support earlier versions of Qt Creator the library.xml file is used.
-
-The plugins.qmltypes file is installed into the imports/Qt3D.Shapes tree along
-with the plugin and the qmldir file.
-
-When any of the elements - property names, class names or other exports
-- in the Qt3D.Shapes plugin are changed this file will need to be regenerated.
-
-To generate the plugins.qmltypes, you first need a qmldump binary generated from
-sources shipped with Qt Creator 2.2 or greater. On Mac these are inside the app
-bundle, other platforms vary. If all else fails get the sources from the Qt
-Creator repo.
-
-To build qmldump you need access to private headers, so therefore it must be
-built against a source build of Qt. On Mac it is helpful to build qmldump with
-"qmake CONFIG-=app_bundle" so that you get a regular command-line binary.
-
-Once you finally have a viable qmldump binary:
-
-./qmldump Qt3D.Shapes 1.0 $QTDIR/imports > plugins.qmltypes
-
-...where $QTDIR points to the root of the Qt where Qt3D is installed.
-
-If you get a usage error like:
-
-Usage: qmldump [plugin/import/path plugin.uri]
-
-...then the version of qmldump source you used was not for Qt Creator > 2.2 -
-you somehow have the earlier version qmldump sources.
-
-You do not need to use the filter-qmldump.pl script.
diff --git a/src/imports/shapes/Sphere.qml b/src/imports/shapes/Sphere.qml
deleted file mode 100644
index 15a9f020..00000000
--- a/src/imports/shapes/Sphere.qml
+++ /dev/null
@@ -1,55 +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
-
-Item3D {
- id: sphere
- property alias name: sphereMesh.objectName
- property alias radius: sphereMesh.radius
- property alias levelOfDetail: sphereMesh.levelOfDetail
- property alias axis: sphereMesh.axis
- mesh: SphereMesh {
- id: sphereMesh
- }
-}
diff --git a/src/imports/shapes/Teapot.qml b/src/imports/shapes/Teapot.qml
deleted file mode 100644
index 3c4df17a..00000000
--- a/src/imports/shapes/Teapot.qml
+++ /dev/null
@@ -1,48 +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
-
-Item3D {
- id: teapot
- mesh: Mesh { source: "teapot.bez" }
-}
diff --git a/src/imports/shapes/capsulemesh.cpp b/src/imports/shapes/capsulemesh.cpp
deleted file mode 100644
index 5b0c068d..00000000
--- a/src/imports/shapes/capsulemesh.cpp
+++ /dev/null
@@ -1,352 +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 "capsulemesh.h"
-#include "qglbuilder.h"
-#include "qglcylinder.h"
-#include "qgldome.h"
-#include "qglabstractscene.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \qmlclass CapsuleMesh CapsuleMesh
- \brief The CapsuleMesh item represents a simple capsule in 3D space.
- \since 4.8
- \ingroup qt3d::qml3d::shapes
- \inherits Item3D
-
- The CapsuleMesh element in QML provides a simple way to create a capsule
- object, usually for testing material effects. For example,
- the following QML code displays a green capsule of with a uniform
- diameter of 0.5, and a length of 3.0, centered vertically on the
- origin:
-
- \code
- Item3D {
- mesh: CapsuleMesh {
- radius: 0.5
- length: 3.0
- }
- effect: Effect {
- color: "#aaca00"
- }
- }
- \endcode
-
- The CapsuleMesh element is part of the \c{Qt3D.Shapes} namespace,
- so the following must appear at the top of any QML file that
- references it:
-
- \code
- import Qt3D.Shapes 1.0
- \endcode
-
- The capsule shape can have differing levels of detail, allowing
- for additional slices and layers to be drawn if more detailed meshes
- are required.
-
- Note that the length of the capsule should always exceed its
- diameter to be considered valid.
-
- To display the capsule mesh you can create your own Item3D as shown
- above, or use the convenience Capsule QML Component.
-
- \code
- Capsule {
- radius: 0.5
- length: 3.0
- effect: Effect {
- color: "#aaca00"
- }
- }
- \endcode
-
- \section1 Performance Hints for Larger Scenes
-
- The convenience Capsule QML component will create a new mesh each
- time is instantiated.
-
- If you have a scene with a number of similar capsules use your own
- Item3D elements to all refer to the same mesh. See the Performance
- Hints section of the SphereMesh documentation for more details on
- this important technique.
-
- \section1 Performance Hints for Animation
-
- Because of the need to maintain the relative proportions of the
- cylinders components, the length and radius are implemented directly
- in the construction of the mesh. This differs from the approach
- used in the SphereMesh where a scale is used.
-
- For this reason avoid animating the length and radius properties
- of a CapsuleMesh, as it will give poor results due to the mesh
- being recreated every frame.
-
- Since the capules components are created with named sections in
- the mesh, one approach would be to individually apply scales to
- these sections using the meshNode property. This is an
- advanced topic, and future tutorials may cover it in more depth.
-
- \sa Item3D, SphereMesh
-*/
-
-CapsuleMeshPrivate::CapsuleMeshPrivate()
- : topNode(new QGLSceneNode)
- , currentCapsule(0)
- , radius(1.0f)
- , length(1.0f)
- , lod(5)
- , sceneSet(false)
-{
- topNode->setObjectName("CapsuleMesh");
-}
-
-CapsuleMeshPrivate::~CapsuleMeshPrivate()
-{
- topNode->removeNode(currentCapsule);
- delete topNode;
- QList<QGLSceneNode*> lods = lodGeometry.values();
- qDeleteAll(lods);
-}
-
-class CapsuleScene : public QGLAbstractScene
-{
-public:
- explicit CapsuleScene(QGLSceneNode *s) : m_s(s) {}
- ~CapsuleScene() {}
- QList<QObject *> objects() const
- {
- QList<QObject *> s;
- s.append(m_s);
- return s;
- }
- QGLSceneNode *mainNode() const
- {
- return m_s;
- }
-private:
- QGLSceneNode *m_s;
-};
-
-/*!
- \internal
-*/
-CapsuleMesh::CapsuleMesh(QObject *parent)
- : QDeclarativeMesh(parent)
- , d_ptr(new CapsuleMeshPrivate)
-{
-}
-
-/*!
- \qmlproperty real CapsuleMesh::radius
-
- This property defines the radius of the capsule.
- The default value is 1.
-*/
-qreal CapsuleMesh::radius() const
-{
- Q_D(const CapsuleMesh);
- return d->radius;
-}
-
-void CapsuleMesh::setRadius(qreal radius)
-{
- Q_D(CapsuleMesh);
- if (qFuzzyCompare(radius, 1))
- radius = 1.0f;
- if (d->radius != radius) {
- d->radius = radius;
- createGeometry();
- emit radiusChanged();
- emit dataChanged();
- }
-}
-
-/*!
- \qmlproperty real CapsuleMesh::length
-
- This property defines the length of the capsule.
- The default value is 1.
-*/
-qreal CapsuleMesh::length() const
-{
- Q_D(const CapsuleMesh);
- return d->length;
-}
-
-void CapsuleMesh::setLength(qreal length)
-{
- Q_D(CapsuleMesh);
- if (qFuzzyCompare(length, 1))
- length = 1.0f;
- if (d->length != length) {
- d->length = length;
- createGeometry();
- emit lengthChanged();
- emit dataChanged();
- }
-}
-
-/*!
- \qmlproperty int CapsuleMesh::levelOfDetail
-
- This property defines the level of detail, between 1 and 10,
- which controls the number of slices and layers that are used
- to generate the capsule's mesh.
-
- Values outside the range 1 to 10 will be clamped to the range
- when the capsule is generated.
-
- The exact number of facets generated is consistent with the
- level of detail as specified in the Cylinder and Sphere
- objects.
-
- \sa Sphere, Cylinder
-*/
-int CapsuleMesh::levelOfDetail() const
-{
- Q_D(const CapsuleMesh);
- return d->lod;
-}
-
-void CapsuleMesh::setLevelOfDetail(int lod)
-{
- Q_D(CapsuleMesh);
- lod = qBound(1, lod, 10);
- if (d->lod != lod) {
- d->lod = lod;
- createGeometry();
- emit levelOfDetailChanged();
- emit dataChanged();
- }
-}
-
-/*!
- \internal
-*/
-void CapsuleMesh::draw(QGLPainter *painter, int branchId)
-{
- Q_D(CapsuleMesh);
- if (!d->currentCapsule)
- createGeometry();
- QDeclarativeMesh::draw(painter, branchId);
-}
-
-/*!
- \internal
-*/
-void CapsuleMesh::createGeometry()
-{
- Q_D(CapsuleMesh);
-
- // Create a new geometry node for this level of detail if necessary.
- QGLSceneNode *geometry = d->lodGeometry.value(d->lod, 0);
- if (!geometry) {
- QGLBuilder builder;
-
- // For the cylinder
- int facets = 4 * 1 << d->lod;
- int layers = 1 << d->lod;
-
- // For the spheres
- int divisions = d->lod;
-
- // Sanity check - the height of the capsule must not be less than its
- // diameter. A minimal capsule is a sphere - where diameter == height.
- if (d->length < 2.0 * d->radius)
- {
- qWarning() << "Length of capsule must exceed its diameter"
- << " - correcting height.";
- d->length = 2 * d->radius;
- }
-
- qreal diameter = d->radius+d->radius;
- qreal cylinderHeight = d->length - diameter;
- qreal offset = cylinderHeight/2.0;
-
- builder << QGL::Faceted;
- QGLSceneNode *s = 0;
- s = builder.newNode();
- s->setObjectName("Cylinder");
- builder << QGLCylinder(diameter, diameter, cylinderHeight,
- facets, layers, false, false);
- QMatrix4x4 translateMatrix;
- translateMatrix.translate(0, 0, -offset);
- builder.currentNode()->setLocalTransform(translateMatrix);
-
- s = builder.newNode();
- s->setObjectName("LeftEndCap");
- builder << QGLDome(diameter, divisions, false);
- translateMatrix.setToIdentity();
- translateMatrix.rotate(180, 0, 1,0);
- translateMatrix.translate(0, 0, offset);
- builder.currentNode()->setLocalTransform(translateMatrix);
-
- s = builder.newNode();
- s->setObjectName("RightEndCap");
- builder << QGLDome(diameter, divisions, false);
- translateMatrix.setToIdentity();
- translateMatrix.translate(0, 0, offset);
- builder.currentNode()->setLocalTransform(translateMatrix);
-
- geometry = builder.finalizedSceneNode();
-
- d->lodGeometry.insert(d->lod, geometry);
- }
- Q_ASSERT_X(geometry != 0, Q_FUNC_INFO, "Could not create/find geometry!");
- if (d->currentCapsule != geometry)
- {
- if (d->currentCapsule)
- d->topNode->removeNode(d->currentCapsule);
- d->topNode->addNode(geometry);
- d->currentCapsule = geometry;
- }
-
- if (!d->sceneSet)
- {
- setScene(new CapsuleScene(d->topNode));
- d->sceneSet = true;
- }
-}
-
-QT_END_NAMESPACE
-
diff --git a/src/imports/shapes/capsulemesh.h b/src/imports/shapes/capsulemesh.h
deleted file mode 100644
index 3076f6ab..00000000
--- a/src/imports/shapes/capsulemesh.h
+++ /dev/null
@@ -1,94 +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 CAPSULE_H
-#define CAPSULE_H
-
-#include "qdeclarativemesh.h"
-#include "capsulemesh_p.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-class CapsuleMesh : public QDeclarativeMesh
-{
- Q_OBJECT
- Q_PROPERTY(qreal radius READ radius WRITE setRadius NOTIFY radiusChanged)
- Q_PROPERTY(qreal length READ length WRITE setLength NOTIFY lengthChanged)
- Q_PROPERTY(int levelOfDetail READ levelOfDetail WRITE setLevelOfDetail NOTIFY levelOfDetailChanged)
-
-public:
- explicit CapsuleMesh(QObject *parent = 0);
- ~CapsuleMesh() {}
-
- qreal radius() const;
- void setRadius(qreal radius);
-
- qreal length() const;
- void setLength(qreal length);
-
- int levelOfDetail() const;
- void setLevelOfDetail(int lod);
-
- void draw(QGLPainter *painter, int branchId);
-
-Q_SIGNALS:
- void radiusChanged();
- void lengthChanged();
- void levelOfDetailChanged();
-
-private:
- void createGeometry();
-
- Q_DISABLE_COPY(CapsuleMesh)
- Q_DECLARE_PRIVATE(CapsuleMesh)
-
- QScopedPointer<CapsuleMeshPrivate> d_ptr;
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(CapsuleMesh)
-
-QT_END_HEADER
-
-#endif // CAPSULE_H
diff --git a/src/imports/shapes/capsulemesh_p.h b/src/imports/shapes/capsulemesh_p.h
deleted file mode 100644
index 2cff15fd..00000000
--- a/src/imports/shapes/capsulemesh_p.h
+++ /dev/null
@@ -1,83 +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 CAPSULEMESH_P_H
-#define CAPSULEMESH_P_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 <QtCore/QMap>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-class QGLSceneNode;
-
-class CapsuleMeshPrivate
-{
-public:
- CapsuleMeshPrivate();
- ~CapsuleMeshPrivate();
-
- QMap<int, QGLSceneNode *> lodGeometry;
- QGLSceneNode *topNode;
- QGLSceneNode *currentCapsule;
- qreal radius;
- qreal length;
- int lod;
- bool sceneSet;
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // CAPSULEMESH_P_H
diff --git a/src/imports/shapes/cube.h b/src/imports/shapes/cube.h
deleted file mode 100644
index 73d72127..00000000
--- a/src/imports/shapes/cube.h
+++ /dev/null
@@ -1,67 +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 CUBE_H
-#define CUBE_H
-
-// This is a dummy header for defining the interface of "Cube.qml" to qdoc.
-
-#include "item3d.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-class Cube : public Item3D
-{
- Q_OBJECT
-public:
- Cube(QObject *parent = 0) : Item3D(parent) {}
- ~Cube() {}
-};
-
-QML_DECLARE_TYPE(Cube)
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/imports/shapes/cube.obj b/src/imports/shapes/cube.obj
deleted file mode 100644
index 7e0c3e0a..00000000
--- a/src/imports/shapes/cube.obj
+++ /dev/null
@@ -1,25 +0,0 @@
-s 0
-v -0.5 -0.5 -0.5
-v -0.5 -0.5 0.5
-v -0.5 0.5 0.5
-v -0.5 0.5 -0.5
-v 0.5 -0.5 -0.5
-v 0.5 -0.5 0.5
-v 0.5 0.5 0.5
-v 0.5 0.5 -0.5
-vn -1.0 0.0 0.0
-vn 0.0 1.0 0.0
-vn 1.0 0.0 0.0
-vn 0.0 -1.0 0.0
-vn 0.0 0.0 1.0
-vn 0.0 0.0 -1.0
-vt 1.0 0.0
-vt 1.0 1.0
-vt 0.0 1.0
-vt 0.0 0.0
-f 1/4/1 2/1/1 3/2/1 4/3/1
-f 4/3/2 3/4/2 7/1/2 8/2/2
-f 8/2/3 7/3/3 6/4/3 5/1/3
-f 5/1/4 6/2/4 2/3/4 1/4/4
-f 6/1/5 7/2/5 3/3/5 2/4/5
-f 8/3/6 5/4/6 1/1/6 4/2/6
diff --git a/src/imports/shapes/cube.qdoc b/src/imports/shapes/cube.qdoc
deleted file mode 100644
index db6782b5..00000000
--- a/src/imports/shapes/cube.qdoc
+++ /dev/null
@@ -1,87 +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$
-**
-****************************************************************************/
-
-/*!
- \qmlclass Cube Cube
- \brief The Cube item represents a simple cube in 3D space.
- \since 4.8
- \ingroup qt3d::qml3d::shapes
- \inherits Item3D
-
- The Cube element in QML provides a simple way to create a cube
- object, usually for testing material effects. For example,
- the following QML code displays a cube of size 1.5, centered
- on the origin and covered in the Qt logo texture:
-
- \code
- Cube {
- scale: 1.5
- effect: Effect {
- color: "#aaca00"
- texture: "qtlogo.png"
- }
- }
- \endcode
-
- The Cube element is part of the \c{Qt3D.Shapes} namespace,
- so the following must appear at the top of any QML file that
- references it:
-
- \code
- import Qt3D.Shapes 1.0
- \endcode
-
- The cube can be moved from the origin by specifying the
- Item3D::position property:
-
- \code
- Cube {
- scale: 1.5
- position: Qt.vector3d(1, 0, 5)
- effect: Effect {
- color: "#aaca00"
- texture: "qtlogo.png"
- }
- }
- \endcode
-
- \sa Item3D
-*/
diff --git a/src/imports/shapes/cylindermesh.cpp b/src/imports/shapes/cylindermesh.cpp
deleted file mode 100644
index ee814009..00000000
--- a/src/imports/shapes/cylindermesh.cpp
+++ /dev/null
@@ -1,348 +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 "cylindermesh.h"
-#include "qglbuilder.h"
-#include "qglcylinder.h"
-#include "qgraphicsscale3d.h"
-#include "qglabstractscene.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \qmlclass CylinderMesh CylinderMesh
- \brief The CylinderMesh item represents a simple cylinder in 3D space.
- \since 4.8
- \ingroup qt3d::qml3d::shapes
- \inherits Item3D
-
- The CylinderMesh element in QML provides a way to create a simple cylinder
- object, usually for testing material effects. For example, the
- following QML code displays a green cylinder of with a uniform
- diameter of 0.5, and a length of 3.0, centered with its base on the
- origin:
-
- \code
- Item3D {
- mesh: CylinderMesh {
- radius: 0.5
- length: 3.0
- }
- effect: Effect {
- color: "#aaca00"
- }
- }
- \endcode
-
- The CylinderMesh element is part of the \c{Qt3D.Shapes} namespace,
- so the following must appear at the top of any QML file that
- references it:
-
- \code
- import Qt3D.Shapes 1.0
- \endcode
-
- The cylinder shape can have differing levels of detail, allowing
- for additional slices and layers to be drawn if more detailed meshes
- are required.
-
- To display the cylinder mesh you can create your own Item3D as shown
- above, or use the convenience Cylinder QML Component.
-
- \code
- Cylinder {
- radius: 0.5
- length: 3.0
- effect: Effect {
- color: "#aaca00"
- }
- }
- \endcode
-
- \section1 Performance Hints for Larger Scenes
-
- The convenience Cylinder QML component will create a new mesh each
- time is instantiated.
-
- If you have a scene with a number of similar capsules use your own
- Item3D elements to all refer to the same mesh. See the Performance
- Hints section of the SphereMesh documentation for more details on
- this important technique.
-
- \section1 Performance Hints for Animation
-
- Some support for animation of the CylinderMesh properties is provided
- by utilizing a QGraphicsScale3D to implement the length & radius
- properties, and by caching levels of detail.
-
- So within limits animation of these items should provide reasonable
- results. Be aware that on constrained devices animation of the
- level of detail for many cylinders could cause problems with memory
- usage due to the caching.
-
- \sa Item3D, SphereMesh
-*/
-
-CylinderMeshPrivate::CylinderMeshPrivate()
- : topNode(new QGLSceneNode)
- , currentCylinder(0)
- , scale(0)
- , radius(1.0f)
- , length(1.0f)
- , lod(5)
- , sceneSet(false)
-{
- topNode->setObjectName("CylinderMesh");
-}
-
-CylinderMeshPrivate::~CylinderMeshPrivate()
-{
- topNode->removeNode(currentCylinder);
- delete topNode;
- QList<QGLSceneNode*> lods = lodGeometry.values();
- qDeleteAll(lods);
-}
-
-class CylinderScene : public QGLAbstractScene
-{
-public:
- explicit CylinderScene(QGLSceneNode *s) : m_s(s) {}
- ~CylinderScene() {}
- QList<QObject *> objects() const
- {
- QList<QObject *> s;
- s.append(m_s);
- return s;
- }
- QGLSceneNode *mainNode() const
- {
- return m_s;
- }
-private:
- QGLSceneNode *m_s;
-};
-
-/*!
- \internal
-*/
-CylinderMesh::CylinderMesh(QObject *parent)
- : QDeclarativeMesh(parent)
- , d_ptr(new CylinderMeshPrivate)
-{
-}
-
-/*!
- \qmlproperty real CylinderMesh::radius
-
- This property defines the radius of the cylinder.
- The default value is 1.
-*/
-qreal CylinderMesh::radius() const
-{
- Q_D(const CylinderMesh);
- return d->radius;
-}
-
-void CylinderMesh::setRadius(qreal radius)
-{
- Q_D(CylinderMesh);
- if (qFuzzyCompare(radius, 1))
- radius = 1.0f;
- if (d->radius != radius) {
- d->radius = radius;
- createGeometry();
- emit radiusChanged();
- emit dataChanged();
- }
-}
-
-/*!
- \qmlproperty real CylinderMesh::length
-
- This property defines the length of the cylinder.
- The default value is 1.
-*/
-qreal CylinderMesh::length() const
-{
- Q_D(const CylinderMesh);
- return d->length;
-}
-
-void CylinderMesh::setLength(qreal length)
-{
- Q_D(CylinderMesh);
- if (qFuzzyCompare(length, 1))
- length = 1.0f;
- if (d->length != length) {
- d->length = length;
- createGeometry();
- emit lengthChanged();
- emit dataChanged();
- }
-}
-
-/*!
- \qmlproperty int CylinderMesh::levelOfDetail
-
- This property defines the level of detail, between 1 and 10,
- which controls the number of slices and layers that are used
- to generate the cylinder's mesh.
-
- Values outside the range 1 to 10 will be clamped to the range
- when the cylinder is generated.
-
- The default value is 1, which produces a cylinder with 8
- slices/facets and 2 layers. Each successive increase in this
- level of detail doubles the number of facets and layers. The
- following table provides information for these level of detail
- values
-
- \table
- \header \o Level of Detail \o Facets \o Layers
- \row \o 1 \o 8 \o 2
- \row \o 2 \o 16 \o 4
- \row \o 3 \o 32 \o 8
- \row \o 4 \o 64 \o 16
- \row \o 5 \o 128 \o 32
- \row \o 6 \o 256 \o 64
- \row \o 7 \o 512 \o 128
- \row \o 8 \o 1024 \o 256
- \row \o 9 \o 2048 \o 512
- \row \o 10 \o 4096 \o 1024
- \endtable
-*/
-int CylinderMesh::levelOfDetail() const
-{
- Q_D(const CylinderMesh);
- return d->lod;
-}
-
-void CylinderMesh::setLevelOfDetail(int lod)
-{
- Q_D(CylinderMesh);
- lod = qBound(1, lod, 10);
- if (d->lod != lod) {
- d->lod = lod;
- createGeometry();
- emit levelOfDetailChanged();
- emit dataChanged();
- }
-}
-
-/*!
- \internal
-*/
-void CylinderMesh::draw(QGLPainter *painter, int branchId)
-{
- Q_D(CylinderMesh);
- if (!d->currentCylinder)
- createGeometry();
- QDeclarativeMesh::draw(painter, branchId);
-}
-
-/*!
- \internal
-*/
-void CylinderMesh::createGeometry()
-{
- Q_D(CylinderMesh);
-
- int facets = 4 * 1 << d->lod;
- int layers = 1 << d->lod;
-
- // Create a new geometry node for this level of detail if necessary.
- QGLSceneNode *geometry = d->lodGeometry.value(d->lod, 0);
- if (!geometry) {
- QGLBuilder builder;
- builder << QGL::Faceted << QGLCylinder(2.0, 2.0, 1.0, facets,
- layers, true, true);
- geometry = builder.finalizedSceneNode();
- geometry->setParent(this);
- d->lodGeometry.insert(d->lod, geometry);
- }
- Q_ASSERT_X(geometry != 0, Q_FUNC_INFO, "Could not create/find geometry!");
- if (d->currentCylinder != geometry)
- {
- if (d->currentCylinder)
- d->topNode->removeNode(d->currentCylinder);
- d->topNode->addNode(geometry);
- d->currentCylinder = geometry;
- }
-
- // Set the length as a scale on the modelview transformation.
- // This way, we don't have to regenerate the geometry every
- // frame if the height is being animated.
- //
- // We could do the scales separately if either height or radius
- // were != 1.0f, but the same amount of maths is required, so
- // we can just scale appropriately on the axes.
- if (d->radius != 1.0f || d->length != 1.0)
- {
- if (!d->scale)
- {
- d->scale = new QGraphicsScale3D(d->topNode);
- d->topNode->addTransform(d->scale);
- }
- if (d->scale->scale().x() != d->radius ||
- d->scale->scale().z() != d->length)
- {
- d->scale->setScale(QVector3D(d->radius, d->radius, d->length));
- }
- }
- else
- {
- // If there is already a scale set it to be the identity scale.
- // This case is optimised for in QGraphicsScale. Removing it from
- // the transform list is too expensive, especially if the size is
- // being animated, and the next frame will recreate it.
- if (d->scale)
- d->scale->setScale(QVector3D(1, 1, 1));
- }
-
- if (!d->sceneSet)
- {
- setScene(new CylinderScene(d->topNode));
- d->sceneSet = true;
- }
-}
-
-QT_END_NAMESPACE
-
diff --git a/src/imports/shapes/cylindermesh.h b/src/imports/shapes/cylindermesh.h
deleted file mode 100644
index bfdc46f3..00000000
--- a/src/imports/shapes/cylindermesh.h
+++ /dev/null
@@ -1,94 +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 CYLINDER_H
-#define CYLINDER_H
-
-#include "qdeclarativemesh.h"
-#include "cylindermesh_p.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-class CylinderMesh : public QDeclarativeMesh
-{
- Q_OBJECT
- Q_PROPERTY(qreal radius READ radius WRITE setRadius NOTIFY radiusChanged)
- Q_PROPERTY(qreal length READ length WRITE setLength NOTIFY lengthChanged)
- Q_PROPERTY(int levelOfDetail READ levelOfDetail WRITE setLevelOfDetail NOTIFY levelOfDetailChanged)
-
-public:
- explicit CylinderMesh(QObject *parent = 0);
- ~CylinderMesh() {}
-
- qreal radius() const;
- void setRadius(qreal radius);
-
- qreal length() const;
- void setLength(qreal length);
-
- int levelOfDetail() const;
- void setLevelOfDetail(int lod);
-
- void draw(QGLPainter *painter, int branchId);
-
-Q_SIGNALS:
- void radiusChanged();
- void lengthChanged();
- void levelOfDetailChanged();
-
-private:
- void createGeometry();
-
- Q_DISABLE_COPY(CylinderMesh)
- Q_DECLARE_PRIVATE(CylinderMesh)
-
- QScopedPointer<CylinderMeshPrivate> d_ptr;
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(CylinderMesh)
-
-QT_END_HEADER
-
-#endif // CYLINDER_H
diff --git a/src/imports/shapes/cylindermesh_p.h b/src/imports/shapes/cylindermesh_p.h
deleted file mode 100644
index a5ad562f..00000000
--- a/src/imports/shapes/cylindermesh_p.h
+++ /dev/null
@@ -1,85 +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 CYLINDERMESH_P_H
-#define CYLINDERMESH_P_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 <QtCore/QMap>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-class QGraphicsScale3D;
-class QGLSceneNode;
-
-class CylinderMeshPrivate
-{
-public:
- CylinderMeshPrivate();
- ~CylinderMeshPrivate();
-
- QMap<int, QGLSceneNode *> lodGeometry;
- QGLSceneNode *topNode;
- QGLSceneNode *currentCylinder;
- QGraphicsScale3D *scale;
- qreal radius;
- qreal length;
- int lod;
- bool sceneSet;
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // CYLINDERMESH_P_H
diff --git a/src/imports/shapes/library.xml b/src/imports/shapes/library.xml
deleted file mode 100644
index d03e3f64..00000000
--- a/src/imports/shapes/library.xml
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<module>
- <type name="Capsule" defaultProperty="data" extends="QDeclarativeItem3D">
- <exports>
- <export module="Qt3D.Shapes" version="1.0" type="Capsule" />
- </exports>
- <property name="radius" type="qreal" />
- <property name="length" type="qreal" />
- <property name="levelOfDetail" type="int" />
- <signal name="radiusChanged" />
- <signal name="lengthChanged" />
- <signal name="levelOfDetailChanged" />
- </type>
- <type name="Cylinder" defaultProperty="data" extends="QDeclarativeItem3D">
- <exports>
- <export module="Qt3D.Shapes" version="1.0" type="Cylinder" />
- </exports>
- <property name="radius" type="qreal" />
- <property name="length" type="qreal" />
- <property name="levelOfDetail" type="int" />
- <signal name="radiusChanged" />
- <signal name="lengthChanged" />
- <signal name="levelOfDetailChanged" />
- </type>
- <type name="Line" defaultProperty="data" extends="QDeclarativeItem3D">
- <exports>
- <export module="Qt3D.Shapes" version="1.0" type="Line" />
- </exports>
- <property name="width" type="qreal" />
- <property name="vertices" type="QVariant" />
- <signal name="verticesChanged" />
- <signal name="widthChanged" />
- </type>
- <type name="Point" defaultProperty="data" extends="QDeclarativeItem3D">
- <exports>
- <export module="Qt3D.Shapes" version="1.0" type="Point" />
- </exports>
- <property name="pointSize" type="qreal" />
- <property name="vertices" type="QVariant" />
- <signal name="verticesChanged" />
- <signal name="pointSizeChanged" />
- </type>
- <type name="Sphere" defaultProperty="data" extends="QDeclarativeItem3D">
- <exports>
- <export module="Qt3D.Shapes" version="1.0" type="Sphere" />
- </exports>
- <property name="radius" type="qreal" />
- <property name="levelOfDetail" type="int" />
- <property name="axis" type="Qt.Axis" />
- <signal name="radiusChanged" />
- <signal name="levelOfDetailChanged" />
- <signal name="axisChanged" />
- </type>
-</module>
diff --git a/src/imports/shapes/line.cpp b/src/imports/shapes/line.cpp
deleted file mode 100644
index f93a2b00..00000000
--- a/src/imports/shapes/line.cpp
+++ /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$
-**
-****************************************************************************/
-
-#include "line.h"
-#include "qglbuilder.h"
-
-/*!
- \qmlclass Line Line
- \brief The Line item represents a geometric line drawn in 3D space.
- \since 4.8
- \ingroup qt3d::qml3d::shapes
- \inherits Item3D
-
- The Line element in QML provides a means of drawing lines in a 3D
- environment. For example, the following QML code draws a line between
- point (0,0,0), (1,1,1), then to (-1,-1,-1).
-
- \code
-
- Line {
- vertices: [
- 0, 0, 0,
- 0, 0, 1,
- 0, 1, 1
-
- ]
- effect: Effect {
- color: "#aaca00"
- }
- }
- \endcode
-
- The Line element is part of the \c{Qt3D.Shapes} namespace,
- so the following must appear at the top of any QML file that
- references it:
-
- \code
- import Qt3D.Shapes 1.0
- \endcode
-
- \sa Item3D
-*/
-/*!
- \internal
-*/
-Line::Line(QObject *parent) :
- QDeclarativeItem3D(parent)
- ,m_width(3.0)
- ,m_geometry(0)
- ,m_changeFlag(false)
-{
- //meh
-}
-
-/*!
- \qmlproperty list<real> Line::vertices
-
- This property defines the positions for all of the vertices in the
- line strip. Each vertex is given by three real values, defining
- the x, y, and z co-ordinates of the vertex.
-*/
-
-QVariant Line::vertices() const
-{
- return m_vertices;
-}
-
-void Line::setVertices(const QVariant &value)
-{
- m_vertices = value;
-
- //Update the actual QVector3DArray containing the line points.
- m_vertexArray.clear();
- QVariantList vertlist = m_vertices.toList();
- for (int index = 0; (index + 2) < vertlist.size(); index += 3) {
- m_vertexArray.append(qreal(vertlist.at(index).toDouble()), qreal(vertlist.at(index + 1).toDouble()), qreal(vertlist.at(index + 2).toDouble()));
- }
- m_changeFlag=true;
- emit verticesChanged();
- update();
-}
-
-
-/*!
- \qmlproperty real Line::width
-
- This property defines the width of the line. The
- default is 1.0
-*/
-void Line::setWidth(qreal width)
-{
- if (m_width != width) {
- m_width = width;
- m_changeFlag=true;
- emit widthChanged();
- update();
- }
-}
-
-/*!
- \internal
-*/
-void Line::drawItem(QGLPainter *painter)
-{
- if (m_changeFlag || !m_geometry) {
- if (m_geometry) delete m_geometry;
-
- QGeometryData lineCollection;
- lineCollection.appendVertexArray(m_vertexArray);
-
- QGLBuilder builder;
- builder.newSection();
- builder.addTriangles(lineCollection);
- builder.currentNode()->setDrawingMode(QGL::LineStrip);
- builder.currentNode()->setDrawingWidth(m_width);
- m_geometry = builder.finalizedSceneNode();
-
- m_changeFlag = false;
- }
-
- // Draw the geometry.
- m_geometry->draw(painter);
-}
-
-QT_END_NAMESPACE
-
diff --git a/src/imports/shapes/line.h b/src/imports/shapes/line.h
deleted file mode 100644
index 4f788dd9..00000000
--- a/src/imports/shapes/line.h
+++ /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 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 LINE_H
-#define LINE_H
-
-#include "qdeclarativeitem3d.h"
-#include "qglscenenode.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-class Line : public QDeclarativeItem3D
-{
- Q_OBJECT
- Q_PROPERTY(qreal width READ width WRITE setWidth NOTIFY widthChanged)
- Q_PROPERTY(QVariant vertices READ vertices WRITE setVertices NOTIFY verticesChanged)
-
-public:
- explicit Line(QObject *parent = 0);
- ~Line() {}
-
- QVariant vertices() const;
- void setVertices(const QVariant &value);
-
- qreal width() const {return m_width;}
- void setWidth(qreal width);
-
-Q_SIGNALS:
- void verticesChanged();
- void widthChanged();
-
-protected:
- void drawItem(QGLPainter *painter);
-
-private:
- qreal m_width;
- QVariant m_vertices;
- QVector3DArray m_vertexArray;
- QGLSceneNode * m_geometry;
- bool m_changeFlag;
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(Line)
-
-QT_END_HEADER
-
-#endif // LINE_H
diff --git a/src/imports/shapes/plugins.qmltypes b/src/imports/shapes/plugins.qmltypes
deleted file mode 100755
index 435d7d3f..00000000
--- a/src/imports/shapes/plugins.qmltypes
+++ /dev/null
@@ -1,159 +0,0 @@
-import QtQuick.tooling 1.0
-
-// This file describes the plugin-supplied types contained in the library.
-// It is used for QML tooling purposes only.
-
-Module {
- Component {
- name: "Capsule"
- defaultProperty: "data"
- prototype: "QDeclarativeItem3D"
- exports: [
- "Capsule 1.0"
- ]
- Property { name: "radius"; type: "qreal" }
- Property { name: "length"; type: "qreal" }
- Property { name: "levelOfDetail"; type: "int" }
- Signal { name: "radiusChanged" }
- Signal { name: "lengthChanged" }
- Signal { name: "levelOfDetailChanged" }
- }
- Component {
- name: "Cylinder"
- defaultProperty: "data"
- prototype: "QDeclarativeItem3D"
- exports: [
- "Cylinder 1.0"
- ]
- Property { name: "radius"; type: "qreal" }
- Property { name: "length"; type: "qreal" }
- Property { name: "levelOfDetail"; type: "int" }
- Signal { name: "radiusChanged" }
- Signal { name: "lengthChanged" }
- Signal { name: "levelOfDetailChanged" }
- }
- Component {
- name: "Line"
- defaultProperty: "data"
- prototype: "QDeclarativeItem3D"
- exports: [
- "Line 1.0"
- ]
- Property { name: "width"; type: "qreal" }
- Property { name: "vertices"; type: "QVariant" }
- Signal { name: "verticesChanged" }
- Signal { name: "widthChanged" }
- }
- Component {
- name: "Point"
- defaultProperty: "data"
- prototype: "QDeclarativeItem3D"
- exports: [
- "Point 1.0"
- ]
- Property { name: "pointSize"; type: "qreal" }
- Property { name: "vertices"; type: "QVariant" }
- Signal { name: "verticesChanged" }
- Signal { name: "pointSizeChanged" }
- }
- Component {
- name: "QDeclarativeItem3D"
- defaultProperty: "data"
- prototype: "QDeclarativeItem"
- Enum {
- name: "CullFace"
- values: {
- "CullDisabled": 0,
- "CullFrontFaces": 1028,
- "CullBackFaces": 1029,
- "CullAllFaces": 1032,
- "CullClockwise": 65536
- }
- }
- Enum {
- name: "CullFaces"
- values: {
- "CullDisabled": 0,
- "CullFrontFaces": 1028,
- "CullBackFaces": 1029,
- "CullAllFaces": 1032,
- "CullClockwise": 65536
- }
- }
- Enum {
- name: "SortMode"
- values: {
- "DefaultSorting": 0,
- "BackToFront": 1
- }
- }
- Property { name: "position"; type: "QVector3D" }
- Property { name: "x"; type: "qreal" }
- Property { name: "y"; type: "qreal" }
- Property { name: "z"; type: "qreal" }
- Property { name: "scale"; type: "qreal" }
- Property { name: "transform"; type: "QGraphicsTransform3D"; isList: true; isReadonly: true }
- Property { name: "pretransform"; type: "QGraphicsTransform3D"; isList: true; isReadonly: true }
- Property { name: "mesh"; type: "QDeclarativeMesh"; isPointer: true }
- Property { name: "effect"; type: "QDeclarativeEffect"; isPointer: true }
- Property { name: "light"; type: "QGLLightParameters"; isPointer: true }
- Property { name: "resources"; type: "QObject"; isList: true; isReadonly: true }
- Property { name: "data"; type: "QObject"; isList: true; isReadonly: true }
- Property { name: "children"; type: "QDeclarativeItem3D"; isList: true; isReadonly: true }
- Property { name: "cullFaces"; type: "CullFaces" }
- Property { name: "sortChildren"; type: "SortMode" }
- Property { name: "meshNode"; type: "string" }
- Property { name: "inheritEvents"; type: "bool" }
- Property { name: "enabled"; type: "bool" }
- Property { name: "parent"; type: "QDeclarativeItem3D"; isPointer: true }
- Signal { name: "positionChanged" }
- Signal { name: "scaleChanged" }
- Signal { name: "rotationChanged" }
- Signal { name: "meshChanged" }
- Signal { name: "meshNodeChanged" }
- Signal { name: "effectChanged" }
- Signal { name: "lightChanged" }
- Signal {
- name: "stateChanged"
- Parameter { type: "string" }
- }
- Signal { name: "clicked" }
- Signal { name: "doubleClicked" }
- Signal { name: "pressed" }
- Signal { name: "released" }
- Signal { name: "hoverEnter" }
- Signal { name: "hoverLeave" }
- Signal { name: "inheritEventsChanged" }
- Signal { name: "enabledChanged" }
- Signal { name: "childrenChanged" }
- Signal { name: "parentChanged" }
- Signal { name: "sortChildrenChanged" }
- Method { name: "update" }
- Method {
- name: "localToWorld"
- type: "QVector3D"
- Parameter { name: "point"; type: "QVector3D" }
- }
- Method { name: "localToWorld"; type: "QVector3D" }
- Method {
- name: "worldToLocal"
- type: "QVector3D"
- Parameter { name: "point"; type: "QVector3D" }
- }
- Method { name: "worldToLocal"; type: "QVector3D" }
- }
- Component {
- name: "Sphere"
- defaultProperty: "data"
- prototype: "QDeclarativeItem3D"
- exports: [
- "Sphere 1.0"
- ]
- Property { name: "radius"; type: "qreal" }
- Property { name: "levelOfDetail"; type: "int" }
- Property { name: "axis"; type: "Qt::Axis" }
- Signal { name: "radiusChanged" }
- Signal { name: "levelOfDetailChanged" }
- Signal { name: "axisChanged" }
- }
-}
diff --git a/src/imports/shapes/point.cpp b/src/imports/shapes/point.cpp
deleted file mode 100644
index 8f270975..00000000
--- a/src/imports/shapes/point.cpp
+++ /dev/null
@@ -1,169 +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 "point.h"
-#include "qglbuilder.h"
-
-/*!
- \qmlclass Point Point
- \brief The Point item represents a geometric point drawn in 3D space.
- \since 4.8
- \ingroup qt3d::qml3d::shapes
- \inherits Item3D
-
- The Point element in QML provides a means of drawing points in a 3D
- environment. For example, the following QML code draws points (0,0,0),
- (1,1,1), and (-1,-1,-1).
-
- \code
- Point {
- vertices: [
- 0, 0, 0,
- 1, 1, 1,
- -1, -1, -1
- ]
- effect: Effect {
- useLighting: false
- color: "#aaca00"
- }
- }
- \endcode
-
- The Point element is part of the \c{Qt3D.Shapes} namespace,
- so the following must appear at the top of any QML file that
- references it:
-
- \code
- import Qt3D.Shapes 1.0
- \endcode
-
- The Point element is intended only for drawing simple points, and does not
- support point sprites or effect attributes other than color.
-
- \sa Item3D
-*/
-/*!
- \internal
-*/
-Point::Point(QObject *parent) :
- QDeclarativeItem3D(parent)
- , m_pointSize(1.0f)
- , m_changeFlag(false)
-{
- //meh
-}
-
-
-/*!
- \qmlproperty list<real> Point::vertices
-
- This property defines the positions for all of the points to be drawn
- Each vertex is given by three real values, defining
- the x, y, and z co-ordinates of the vertex.
-*/
-
-QVariant Point::vertices() const
-{
- return m_vertices;
-}
-
-void Point::setVertices(const QVariant &value)
-{
- m_vertices = value;
-
- //Update the actual QVector3DArray containing the points.
- m_vertexArray.clear();
- QVariantList vertlist = m_vertices.toList();
- for (int index = 0; (index + 2) < vertlist.size(); index += 3) {
- m_vertexArray.append(qreal(vertlist.at(index).toDouble()), qreal(vertlist.at(index + 1).toDouble()), qreal(vertlist.at(index + 2).toDouble()));
- }
- m_changeFlag=true;
- emit verticesChanged();
- update();
-}
-
-
-/*!
- \qmlproperty qreal Point::pointSize
-
- This property defines the size of the point. The
- default is 1.0
-*/
-void Point::setPointSize(qreal pointSize)
-{
- if (m_pointSize != pointSize) {
- m_pointSize = pointSize;
- m_changeFlag=true;
- emit pointSizeChanged();
- update();
- }
-}
-
-/*!
- \internal
-*/
-void Point::drawItem(QGLPainter *painter)
-{
- if (m_changeFlag || !m_geometry) {
- if (m_geometry) delete m_geometry;
-
- QGLBuilder builder;
-
- QGeometryData pointCollection;
- builder.newSection();
-
- pointCollection.appendVertexArray(m_vertexArray);
-
- builder.addTriangles(pointCollection);
- builder.currentNode()->setDrawingMode(QGL::Points);
- builder.currentNode()->setDrawingWidth(m_pointSize);
- m_geometry = builder.finalizedSceneNode();
-
- m_changeFlag = false;
- }
-
- // Draw the geometry.
- m_geometry->draw(painter);
-}
-
-QT_END_NAMESPACE
-
-
diff --git a/src/imports/shapes/point.h b/src/imports/shapes/point.h
deleted file mode 100644
index 591f4d8a..00000000
--- a/src/imports/shapes/point.h
+++ /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 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 POINT_H
-#define POINT_H
-
-#include "qdeclarativeitem3d.h"
-#include "qglscenenode.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-class Point : public QDeclarativeItem3D
-{
- Q_OBJECT
- Q_PROPERTY(qreal pointSize READ pointSize WRITE setPointSize NOTIFY pointSizeChanged)
- Q_PROPERTY(QVariant vertices READ vertices WRITE setVertices NOTIFY verticesChanged)
-
-public:
- explicit Point(QObject *parent = 0);
- ~Point() {}
-
- QVariant vertices() const;
- void setVertices(const QVariant &value);
-
- qreal pointSize() const {return m_pointSize;}
- void setPointSize(qreal pointSize);
-
-Q_SIGNALS:
- void verticesChanged();
- void pointSizeChanged();
-
-protected:
- void drawItem(QGLPainter *painter);
-
-private:
- qreal m_pointSize;
- QVariant m_vertices;
- QVector3DArray m_vertexArray;
- QGLSceneNode * m_geometry;
- bool m_changeFlag;
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(Point)
-
-QT_END_HEADER
-
-#endif // POINT_H
diff --git a/src/imports/shapes/qmldir b/src/imports/shapes/qmldir
deleted file mode 100644
index dd4f575d..00000000
--- a/src/imports/shapes/qmldir
+++ /dev/null
@@ -1,7 +0,0 @@
-plugin qshapesqmlplugin
-Cube 1.0 Cube.qml
-Teapot 1.0 Teapot.qml
-Quad 1.0 Quad.qml
-Sphere 1.0 Sphere.qml
-Capsule 1.0 Capsule.qml
-Cylinder 1.0 Cylinder.qml
diff --git a/src/imports/shapes/quad.obj b/src/imports/shapes/quad.obj
deleted file mode 100644
index a28dee25..00000000
--- a/src/imports/shapes/quad.obj
+++ /dev/null
@@ -1,12 +0,0 @@
-o Plane
-v 0.500000 0.000000 -0.500000
-v 0.500000 0.000000 0.500000
-v -0.500000 0.000000 0.500000
-v -0.500000 0.000000 -0.500000
-vt 1.000000 0.000000
-vt 1.000000 1.000000
-vt 0.000000 1.000000
-vt 0.000000 0.000000
-usemtl (null)
-s off
-f 1/2 4/3 3/4 2/1
diff --git a/src/imports/shapes/quad.qdoc b/src/imports/shapes/quad.qdoc
deleted file mode 100644
index b13a40a6..00000000
--- a/src/imports/shapes/quad.qdoc
+++ /dev/null
@@ -1,87 +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$
-**
-****************************************************************************/
-
-/*!
- \qmlclass Quad Quad
- \brief The Quad item represents a simple quad in 3D space.
- \since 4.8
- \ingroup qt3d::qml3d::shapes
- \inherits Item3D
-
- The Quad element in QML provides a simple way to create a regular
- quad object, usually for testing material effects. For example,
- the following QML code displays a quad of size 1.5, centered
- on the origin and covered in the Qt logo texture:
-
- \code
- Quad {
- scale: 1.5
- effect: Effect {
- color: "#aaca00"
- texture: "qtlogo.png"
- }
- }
- \endcode
-
- The Quad element is part of the \c{Qt3D.Shapes} namespace,
- so the following must appear at the top of any QML file that
- references it:
-
- \code
- import Qt3D.Shapes 1.0
- \endcode
-
- The quad can be moved from the origin by specifying the
- Item3D::position property:
-
- \code
- Quad {
- scale: 1.5
- position: Qt.vector3d(1, 0, 5)
- effect: Effect {
- color: "#aaca00"
- texture: "qtlogo.png"
- }
- }
- \endcode
-
- \sa Item3D
-*/
diff --git a/src/imports/shapes/shapes.cpp b/src/imports/shapes/shapes.cpp
deleted file mode 100644
index 7c1958c6..00000000
--- a/src/imports/shapes/shapes.cpp
+++ /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 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 <QtDeclarative/qdeclarativeextensionplugin.h>
-
-#include "spheremesh.h"
-#include "cylindermesh.h"
-#include "capsulemesh.h"
-#include "line.h"
-#include "point.h"
-
-QT_BEGIN_NAMESPACE
-
-class QShapesQmlModule : public QDeclarativeExtensionPlugin
-{
- Q_OBJECT
-public:
- virtual void registerTypes(const char *uri)
- {
- Q_ASSERT(QLatin1String(uri) == QLatin1String("Qt3D.Shapes"));
- qmlRegisterType<SphereMesh>(uri,1,0,"SphereMesh");
- qmlRegisterType<CylinderMesh>(uri,1,0,"CylinderMesh");
- qmlRegisterType<CapsuleMesh>(uri,1,0,"CapsuleMesh");
- qmlRegisterType<Line>(uri,1,0,"Line");
- qmlRegisterType<Point>(uri,1,0,"Point");
-
- }
-};
-
-QT_END_NAMESPACE
-
-#include "shapes.moc"
-
-Q_EXPORT_PLUGIN2(qshapesqmlplugin, QT_PREPEND_NAMESPACE(QShapesQmlModule));
diff --git a/src/imports/shapes/shapes.pro b/src/imports/shapes/shapes.pro
deleted file mode 100644
index 002446d4..00000000
--- a/src/imports/shapes/shapes.pro
+++ /dev/null
@@ -1,101 +0,0 @@
-TEMPLATE = lib
-TARGET = qshapesqmlplugin
-CONFIG += qt plugin
-
-CONFIG += qt3dquick_deploy_pkg
-include(../../../pkg.pri)
-
-# See the README in the root dir re this code
-package {
- target.path += $$QT3D_INSTALL_IMPORTS/Qt3D/Shapes
- INSTALLS += target
- QT += declarative
-} else {
- CONFIG += qt3dquick qt3d
- DESTDIR = $$QT3D_INSTALL_IMPORTS/Qt3D/Shapes
-}
-
-win32 {
- CONFIG(debug, debug|release) {
- TARGET = $$member(TARGET, 0)d
- }
-}
-
-symbian {
- CONFIG += epocallowdlldata
- MMP_RULES += EXPORTUNFROZEN
- LIBS += -lQt3D$${QT_LIBINFIX} -lQt3DQuick$${QT_LIBINFIX}
- TARGET.EPOCALLOWDLLDATA = 1
- TARGET.CAPABILITY = All -Tcb
- TARGET.UID3 = 0x20031E9C
-}
-
-SOURCES += \
- shapes.cpp \
- line.cpp \
- point.cpp \
- spheremesh.cpp \
- capsulemesh.cpp \
- cylindermesh.cpp
-HEADERS += \
- line.h \
- point.h \
- spheremesh.h \
- spheremesh_p.h \
- capsulemesh.h \
- cylindermesh.h \
- capsulemesh_p.h \
- cylindermesh_p.h
-
-QML_FILES = \
- Cube.qml \
- Sphere.qml \
- Quad.qml \
- Teapot.qml \
- Capsule.qml \
- Cylinder.qml
-
-QML_INFRA_FILES += \
- $$QML_FILES \
- qmldir \
- library.xml \
- plugins.qmltypes \
- cube.obj \
- quad.obj \
- teapot.bez
-# see the file README.library_xml for more on library.xml
-
-package {
- copyqmlinfra_install.files = $$QML_INFRA_FILES
- copyqmlinfra_install.path = $$QT3D_INSTALL_IMPORTS/Qt3D/Shapes
- INSTALLS += copyqmlinfra_install
-} else {
- copyqmlinfra.input = QML_INFRA_FILES
- copyqmlinfra.output = $$[QT_INSTALL_IMPORTS]/Qt3D/Shapes/${QMAKE_FILE_IN_BASE}${QMAKE_FILE_EXT}
- copyqmlinfra.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
- copyqmlinfra.CONFIG += no_link_no_clean
- copyqmlinfra.variable_out = PRE_TARGETDEPS
- QMAKE_EXTRA_COMPILERS += copyqmlinfra
-}
-
-OTHER_FILES += \
- README.plugins_types \
- README.library_xml
-
-OTHER_FILES += $$QML_FILES
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/imports/shapes/spheremesh.cpp b/src/imports/shapes/spheremesh.cpp
deleted file mode 100644
index 72bf1dee..00000000
--- a/src/imports/shapes/spheremesh.cpp
+++ /dev/null
@@ -1,393 +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 "spheremesh.h"
-#include "qglbuilder.h"
-#include "qglsphere.h"
-#include "qgraphicsrotation3d.h"
-#include "qgraphicsscale3d.h"
-#include "qglabstractscene.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \qmlclass SphereMesh SphereMesh
- \brief The SphereMesh item represents a simple UV-sphere in 3D space.
- \since 4.8
- \ingroup qt3d::qml3d::shapes
- \inherits Item3D
-
- The SphereMesh element in QML provides a simple way to create a sphere
- object, usually for testing material effects. For example,
- the following QML code displays a green sphere mesh of radius 1.5,
- centered on the origin:
-
- \code
- Item3D {
- mesh: SphereMesh { radius: 1.5 }
- effect: Effect { color: "#aaca00" }
- }
- \endcode
-
- As shown, the mesh is only displayed when it is set as the target of
- a mesh property on an Item3D.
-
- The SphereMesh element is part of the \c{Qt3D.Shapes} namespace,
- so the following must appear at the top of any QML file that
- references it:
-
- \code
- import Qt3D.Shapes 1.0
- \endcode
-
- By default, the sphere is aligned to lie along the Z axis.
- The \l axis property can change this to either the X or the Y
- axis, as shown in the following example:
-
- \code
- SphereMesh {
- radius: 1.5
- axis: Qt.YAxis
- }
- \endcode
-
- To display the sphere mesh you can create your own Item3D as shown
- above, or use the convenience Sphere QML component:
-
- \code
- Sphere {
- radius: 1.5
- levelOfDetail: 6
- axis: Qt.YAxis
- effect: Effect { texture: "moon-texture.jpg" }
- }
- \endcode
-
- \image moon-screenshot.png
-
- \section1 Performance Hints for Larger Scenes
-
- The convenience Sphere QML component will create a new mesh each
- time it is instantiated.
-
- If you have a scene with a number of similar spheres use your own
- Item3D elements to all refer to the same mesh - this will save on
- graphics memory and improve the performance of your application since
- there is no need to recreate many copies of the same geometry. This
- is true even if you want to apply different materials, effects or
- transformations to each sphere.
-
- To do this, first declare the SphereMesh object, outside of any Item3D
- so that it won't get drawn, and give it an id so you can refer to it.
-
- \snippet quick3d/solarsystem_qml/qml/solarsystem_qml.qml 0
-
- Then set the various effects and so on you need for each instance of
- the sphere. If you need different sized spheres you can use a scale,
- and of course you can specify materials and effects.
-
- \snippet quick3d/solarsystem_qml/qml/solarsystem_qml.qml 1
-
- In this case since only one copy of the triangle data for the mesh is
- sent to the GPU performance will generally be better.
-
- \section1 Performance Hints for Animation
-
- Some support for animation of the SphereMesh properties is provided
- by utilizing a QGraphicsScale3D to implement the radius property,
- and by caching levels of detail.
-
- So within limits animation of these items should provide reasonable
- results. Be aware that on constrained devices animation of the
- level of detail for many spheres could cause problems with memory
- usage due to the caching.
-
- The other shapes primitives are implemented differently with respect
- to radius, length and so on, so read the performance notes there, as
- they will differ from the sphere case.
-
- \sa Item3D
-*/
-
-SphereMeshPrivate::SphereMeshPrivate()
- : topNode(new QGLSceneNode)
- , currentSphere(0)
- , rot(0)
- , scale(0)
- , radius(1.0f)
- , lod(5)
- , axis(Qt::ZAxis)
- , sceneSet(false)
-{
- topNode->setObjectName("SphereMesh");
-}
-
-SphereMeshPrivate::~SphereMeshPrivate()
-{
- topNode->removeNode(currentSphere);
- delete topNode;
- QList<QGLSceneNode*> lods = lodGeometry.values();
- qDeleteAll(lods);
-}
-
-class SphereScene : public QGLAbstractScene
-{
-public:
- explicit SphereScene(QGLSceneNode *s) : m_s(s) {}
- ~SphereScene() {}
- QList<QObject *> objects() const
- {
- QList<QObject *> s;
- s.append(m_s);
- return s;
- }
- QGLSceneNode *mainNode() const
- {
- return m_s;
- }
-private:
- QGLSceneNode *m_s;
-};
-
-/*!
- \internal
-*/
-SphereMesh::SphereMesh(QObject *parent)
- : QDeclarativeMesh(parent)
- , d_ptr(new SphereMeshPrivate)
-{
-}
-
-/*!
- \qmlproperty real SphereMesh::radius
-
- This property defines the radius of the sphere. The default
- value is 1.
-*/
-qreal SphereMesh::radius() const
-{
- Q_D(const SphereMesh);
- return d->radius;
-}
-
-void SphereMesh::setRadius(qreal radius)
-{
- Q_D(SphereMesh);
- if (qFuzzyCompare(radius, 1))
- radius = 1.0f;
- if (d->radius != radius)
- {
- d->radius = radius;
- createGeometry();
- emit radiusChanged();
- emit dataChanged();
- }
-}
-
-/*!
- \qmlproperty int SphereMesh::levelOfDetail
-
- This property defines the level of detail, between 1 and 10,
- which controls the number of triangles that are generated to
- render the surface of the sphere. Values outside the range
- 1 to 10 will be clamped to the range when the sphere is drawn.
-
- The default value is 5. An increase in 1 in level of detail
- doubles the number of triangles. The following picture shows
- the effect of level of detail values between 1 and 10:
-
- \image sphere-detail.png
-
- \table
- \header \o Level of Detail \o Number of Triangles
- \row \o 1 \o 64
- \row \o 2 \o 128
- \row \o 3 \o 256
- \row \o 4 \o 512
- \row \o 5 \o 1024
- \row \o 6 \o 2048
- \row \o 7 \o 4096
- \row \o 8 \o 8192
- \row \o 9 \o 16384
- \row \o 10 \o 32768
- \endtable
-*/
-int SphereMesh::levelOfDetail() const
-{
- Q_D(const SphereMesh);
- return d->lod;
-}
-
-void SphereMesh::setLevelOfDetail(int lod)
-{
- Q_D(SphereMesh);
- lod = qBound(1, lod, 10);
- if (d->lod != lod)
- {
- d->lod = lod;
- createGeometry();
- emit levelOfDetailChanged();
- emit dataChanged();
- }
-}
-
-/*!
- \qmlproperty enumeration SphereMesh::axis
-
- This property defines the axis that the sphere lies along.
- The default is Qt.ZAxis. The other supported values are
- Qt.XAxis and Qt.YAxis. This provides a simple method to
- orient the sphere in the desired direction.
-*/
-Qt::Axis SphereMesh::axis() const
-{
- Q_D(const SphereMesh);
- return d->axis;
-}
-
-void SphereMesh::setAxis(Qt::Axis axis)
-{
- Q_D(SphereMesh);
- if (d->axis != axis)
- {
- d->axis = axis;
- createGeometry();
- emit axisChanged();
- emit dataChanged();
- }
-}
-
-/*!
- \internal
-*/
-void SphereMesh::draw(QGLPainter *painter, int branchId)
-{
- Q_D(SphereMesh);
- if (!d->currentSphere)
- createGeometry();
- QDeclarativeMesh::draw(painter, branchId);
-}
-
-/*!
- \internal
-*/
-void SphereMesh::createGeometry()
-{
- Q_D(SphereMesh);
-
- // We cache a maximum of 10 levels of detail for lod animations.
- // Create a new geometry node for this level of detail if necessary.
- QGLSceneNode *geometry = d->lodGeometry.value(d->lod, 0);
- if (!geometry) {
- QGLBuilder builder;
- builder.newSection(QGL::Faceted);
- builder << QGLSphere(2.0f, d->lod);
- geometry = builder.finalizedSceneNode();
- geometry->setParent(this);
- d->lodGeometry.insert(d->lod, geometry);
- }
- Q_ASSERT_X(geometry != 0, Q_FUNC_INFO, "Could not create/find geometry!");
- if (d->currentSphere != geometry)
- {
- if (d->currentSphere)
- d->topNode->removeNode(d->currentSphere);
- d->topNode->addNode(geometry);
- d->currentSphere = geometry;
- }
-
- // Set the radius as a scale on the modelview transformation.
- // This way, we don't have to regenerate the geometry every
- // frame if the radius is being animated.
- if (d->radius != 1.0f)
- {
- if (!d->scale)
- {
- d->scale = new QGraphicsScale3D(d->topNode);
- d->topNode->addTransform(d->scale);
- }
- if (d->scale->scale().x() != d->radius)
- {
- d->scale->setScale(QVector3D(d->radius, d->radius, d->radius));
- }
- }
- else
- {
- // If there is already a scale set it to be the identity scale.
- // This case is optimised for in QGraphicsScale. Removing it from
- // the transform list is too expensive, especially if the size is
- // being animated, and the next frame will recreate it.
- if (d->scale)
- d->scale->setScale(QVector3D(1, 1, 1));
- }
-
- // Also rotate the geometry into the correct axis orientation.
- const QVector3D Y_AXIS = QVector3D(0, 1, 0); // for Qt::XAxis we rotate around Y
- const QVector3D X_AXIS = QVector3D(1, 0, 0); // for Qt::YAxis we rotate around X
- if (d->axis != Qt::ZAxis && !d->rot)
- {
- d->rot = new QGraphicsRotation3D(d->topNode);
- d->topNode->addTransform(d->rot);
- }
- if (d->axis == Qt::XAxis && d->rot->axis().y() != Y_AXIS.y())
- {
- d->rot->setAxis(Y_AXIS);
- d->rot->setAngle(90.0f);
- }
- else if (d->axis == Qt::YAxis && d->rot->axis().x() != X_AXIS.x())
- {
- d->rot->setAxis(X_AXIS);
- d->rot->setAngle(-90.0f);
- }
- else if (d->axis == Qt::ZAxis && d->rot && d->rot->angle() != 0.0f)
- {
- d->rot->setAngle(0.0f);
- d->rot->setAxis(QVector3D(0, 0, 0));
- }
-
- if (!d->sceneSet)
- {
- setScene(new SphereScene(d->topNode));
- d->sceneSet = true;
- }
-}
-
-QT_END_NAMESPACE
-
diff --git a/src/imports/shapes/spheremesh.h b/src/imports/shapes/spheremesh.h
deleted file mode 100644
index b4e2b4f0..00000000
--- a/src/imports/shapes/spheremesh.h
+++ /dev/null
@@ -1,99 +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 SPHEREMESH_H
-#define SPHEREMESH_H
-
-#include "qglscenenode.h"
-#include "qdeclarativemesh.h"
-#include "spheremesh_p.h"
-
-#include <QtCore/qmap.h>
-#include <QtCore/qscopedpointer.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-class SpherePrivate;
-
-class SphereMesh : public QDeclarativeMesh
-{
- Q_OBJECT
- Q_PROPERTY(qreal radius READ radius WRITE setRadius NOTIFY radiusChanged)
- Q_PROPERTY(int levelOfDetail READ levelOfDetail WRITE setLevelOfDetail NOTIFY levelOfDetailChanged)
- Q_PROPERTY(Qt::Axis axis READ axis WRITE setAxis NOTIFY axisChanged)
-public:
- SphereMesh(QObject *parent = 0);
- ~SphereMesh() {}
-
- qreal radius() const;
- void setRadius(qreal radius);
-
- int levelOfDetail() const;
- void setLevelOfDetail(int lod);
-
- Qt::Axis axis() const;
- void setAxis(Qt::Axis axis);
-
- void draw(QGLPainter *painter, int branchId);
-
-Q_SIGNALS:
- void radiusChanged();
- void levelOfDetailChanged();
- void axisChanged();
-
-private:
- void createGeometry();
-
- Q_DISABLE_COPY(SphereMesh)
- Q_DECLARE_PRIVATE(SphereMesh)
-
- QScopedPointer<SphereMeshPrivate> d_ptr;
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(SphereMesh)
-
-QT_END_HEADER
-
-#endif // SPHEREMESH_H
diff --git a/src/imports/shapes/spheremesh_p.h b/src/imports/shapes/spheremesh_p.h
deleted file mode 100644
index 3d407421..00000000
--- a/src/imports/shapes/spheremesh_p.h
+++ /dev/null
@@ -1,87 +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 SPHEREMESH_P_H
-#define SPHEREMESH_P_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 <QtCore/QMap>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-class QGraphicsRotation3D;
-class QGraphicsScale3D;
-class QGLSceneNode;
-
-class SphereMeshPrivate
-{
-public:
- SphereMeshPrivate();
- ~SphereMeshPrivate();
-
- QMap<int, QGLSceneNode *> lodGeometry;
- QGLSceneNode *topNode;
- QGLSceneNode *currentSphere;
- QGraphicsRotation3D *rot;
- QGraphicsScale3D *scale;
- qreal radius;
- int lod;
- Qt::Axis axis;
- bool sceneSet;
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // SPHEREMESH_P_H
diff --git a/src/imports/shapes/teapot.bez b/src/imports/shapes/teapot.bez
deleted file mode 100644
index 02b2ac44..00000000
--- a/src/imports/shapes/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/src/imports/shapes/teapot.h b/src/imports/shapes/teapot.h
deleted file mode 100644
index 90f7a95b..00000000
--- a/src/imports/shapes/teapot.h
+++ /dev/null
@@ -1,67 +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 CUBE_H
-#define CUBE_H
-
-// This is a dummy header for defining the interface of "Teapot.qml" to qdoc.
-
-#include "qdeclarativeitem3d.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-class Teapot : public QDeclarativeItem3D
-{
- Q_OBJECT
-public:
- Teapot(QObject *parent = 0) : QDeclarativeItem3D(parent) {}
- ~Teapot() {}
-};
-
-QML_DECLARE_TYPE(Cube)
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/imports/shapes/teapot.qdoc b/src/imports/shapes/teapot.qdoc
deleted file mode 100644
index 8c6470f0..00000000
--- a/src/imports/shapes/teapot.qdoc
+++ /dev/null
@@ -1,92 +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$
-**
-****************************************************************************/
-
-/*!
- \qmlclass Teapot Teapot
- \brief The Teapot item represents a stock teapot object.
- \since 4.8
- \ingroup qt3d::qml3d::shapes
- \inherits Item3D
-
- The Teapot element in QML provides a simple way to create a teapot
- object, usually for testing material effects and complex
- geometry. For example, the following QML code displays a teapot
- of size 1.5, centered on the origin and covered in the Qt logo
- texture:
-
- \code
- Teapot {
- scale: 1.5
- effect: Effect {
- color: "#aaca00"
- texture: "qtlogo.png"
- decal: true
- }
- }
- \endcode
-
- \image teapot-qt-screenshot.png
-
- The Teapot element is part of the \c{Qt3D.Shapes} namespace,
- so the following must appear at the top of any QML file that
- references it:
-
- \code
- import Qt3D.Shapes 1.0
- \endcode
-
- The teapot can be moved from the origin by specifying the
- Item3D::position property:
-
- \code
- Teapot {
- scale: 1.5
- position: Qt.vector3d(1, 0, 5)
- effect: Effect {
- color: "#aaca00"
- texture: "qtlogo.png"
- decal: true
- }
- }
- \endcode
-
- \sa Item3D
-*/
diff --git a/src/imports/threed/DefaultNavigator.qml b/src/imports/threed/DefaultNavigator.qml
deleted file mode 100644
index 70b0ac6b..00000000
--- a/src/imports/threed/DefaultNavigator.qml
+++ /dev/null
@@ -1,181 +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 Qt 4.7
-import Qt3D 1.0
-
-// This is an example of how to implement a custom navigation strategy
-// to replace the default strategy implemented by "Viewport".
-
-MouseArea {
- // Set this property to the "Viewport" item to be controlled
- // by this navigator. By default we assume that it is our parent.
- property variant viewport: parent
-
- // The navigator fills the entire viewport.
- anchors.fill: viewport
-
- // Private variables.
- QtObject {
- id: d_ptr
- property bool panning: false
- property int startX: 0
- property int startY: 0
- property variant startEye
- property variant startCenter
- property variant startUpVector
- property variant pressedObject: null
- property variant enteredObject: null
- property bool sawDoubleClick: false
- }
-
- // Handle mouse press events.
- onPressed: {
- // Determine which object was pressed in the viewport.
- var objectUnderMouse;
- if (!d_ptr.panning && viewport.picking)
- objectUnderMouse = viewport.objectForPoint(mouse.x, mouse.y);
- else
- objectUnderMouse = null;
- if (d_ptr.pressedObject) {
- // We already have a pressed object, so nothing to do.
- mouse.accepted = true;
- } else if (Qt.isQtObject(objectUnderMouse)) {
- // Mouse press on a new object.
- d_ptr.pressedObject = objectUnderMouse;
- d_ptr.enteredObject = null;
- d_ptr.sawDoubleClick = false;
- objectUnderMouse.pressed();
- mouse.accepted = true;
- } else if (viewport.navigation && mouse.button == Qt.LeftButton) {
- // Start panning the view.
- d_ptr.panning = true;
- d_ptr.startX = mouse.x;
- d_ptr.startY = mouse.y;
- d_ptr.startEye = viewport.camera.eye;
- d_ptr.startCenter = viewport.camera.center;
- d_ptr.startUpVector = viewport.camera.upVector;
- mouse.accepted = true;
- }
- }
-
- // Handle mouse release events.
- onReleased: {
- if (d_ptr.panning && mouse.button == Qt.LeftButton) {
- d_ptr.panning = false;
- mouse.accepted = true;
- }
- if (d_ptr.pressedObject && mouse.button == Qt.LeftButton) {
- // Deliver the release event to the pressed object.
- var objectUnderMouse = viewport.objectForPoint(mouse.x, mouse.y);
- if (objectUnderMouse == d_ptr.pressedObject && !d_ptr.sawDoubleClick) {
- d_ptr.pressedObject.released();
- d_ptr.pressedObject.clicked();
- } else {
- d_ptr.pressedObject.released();
- }
- if (hoverEnabled) {
- if (Qt.isQtObject(objectUnderMouse))
- d_ptr.enteredObject = objectUnderMouse;
- else
- d_ptr.enteredObject = null;
- if (d_ptr.enteredObject != d_ptr.pressedObject) {
- d_ptr.pressedObject.hoverLeave();
- if (d_ptr.enteredObject)
- d_ptr.enteredObject.hoverEnter();
- }
- }
- d_ptr.pressedObject = null;
- mouse.accepted = true;
- }
- }
-
- // Handle mouse double click events.
- onDoubleClicked: {
- if (d_ptr.pressedObject) {
- var objectUnderMouse = viewport.objectForPoint(mouse.x, mouse.y);
- if (objectUnderMouse == d_ptr.pressedObject) {
- d_ptr.pressedObject.doubleClicked();
- d_ptr.sawDoubleClick = true;
- mouse.accepted = true;
- }
- }
- }
-
- // Handle mouse move events.
- onPositionChanged: {
- if (d_ptr.panning) {
- var deltaX = mouse.x - d_ptr.startX;
- var deltaY = mouse.y - d_ptr.startY;
- var angleAroundY = deltaX * 90 / width;
- var angleAroundX = deltaY * 90 / height;
-
- viewport.camera.eye = d_ptr.startEye;
- viewport.camera.center = d_ptr.startCenter;
- viewport.camera.upVector = d_ptr.startUpVector;
- viewport.camera.tiltPanRollCenter
- (-angleAroundX, -angleAroundY, 0, "TiltPanRoll");
- } else if (viewport.picking && hoverEnabled) {
- // Handle object enter/leave events when mouse hover is enabled.
- var objectUnderMouse = viewport.objectForPoint(mouse.x, mouse.y);
- if (!d_ptr.pressedObject) {
- if (Qt.isQtObject(objectUnderMouse)) {
- if (d_ptr.enteredObject != objectUnderMouse) {
- if (d_ptr.enteredObject)
- d_ptr.enteredObject.hoverLeave();
- d_ptr.enteredObject = objectUnderMouse;
- d_ptr.enteredObject.hoverEnter();
- }
- } else if (d_ptr.enteredObject) {
- d_ptr.enteredObject.hoverLeave();
- d_ptr.enteredObject = null;
- }
- }
- }
- }
-
- // Handle leave events.
- onExited: {
- if (hoverEnabled && !d_ptr.pressedObject && d_ptr.enteredObject) {
- d_ptr.enteredObject.hoverLeave();
- d_ptr.enteredObject = null;
- }
- }
-}
diff --git a/src/imports/threed/README.library_xml b/src/imports/threed/README.library_xml
deleted file mode 100644
index 0399d4ab..00000000
--- a/src/imports/threed/README.library_xml
+++ /dev/null
@@ -1,15 +0,0 @@
-The library.xml file is required to get syntax highlighting of Qt3D
-plugin items in Qt Creator < version 2.2.
-
-The library.xml file is installed into the imports/Qt3D tree along with
-the plugin and the qmldir file.
-
-When any of the elements - property names, class names or other exports
-- in the Qt3D plugin are changed this file will need to be regenerated.
-
-To generate the library.xml file see the scripts/README file for a
-description of how to use the filter-qmldump.pl script.
-
-This is a less-than-optimal solution but as syntax discovery improves
-in Qt Creator better solutions should become available at which time
-this temporary script and syntax file may be deprecated.
diff --git a/src/imports/threed/README.plugins_types b/src/imports/threed/README.plugins_types
deleted file mode 100755
index e78cd67e..00000000
--- a/src/imports/threed/README.plugins_types
+++ /dev/null
@@ -1,34 +0,0 @@
-The plugins.qmltypes file is required to get syntax highlighting of Qt3D
-plugin items inside Qt Creator 2.2 and later.
-
-To support earlier versions of Qt Creator the library.xml file is used.
-
-The plugins.qmltypes file is installed into the imports/Qt3D tree along
-with the plugin and the qmldir file.
-
-When any of the elements - property names, class names or other exports
-- in the Qt3D plugin are changed this file will need to be regenerated.
-
-To generate the plugins.qmltypes, you first need a qmldump binary generated from
-sources shipped with Qt Creator 2.2 or greater. On Mac these are inside the app
-bundle, other platforms vary. If all else fails get the sources from the Qt
-Creator repo.
-
-To build qmldump you need access to private headers, so therefore it must be
-built against a source build of Qt. On Mac it is helpful to build qmldump with
-"qmake CONFIG-=app_bundle" so that you get a regular command-line binary.
-
-Once you finally have a viable qmldump binary:
-
-./qmldump Qt3D 1.0 $QTDIR/imports > plugins.qmltypes
-
-...where $QTDIR points to the root of the Qt where Qt3D is installed.
-
-If you get a usage error like:
-
-Usage: qmldump [plugin/import/path plugin.uri]
-
-...then the version of qmldump source you used was not for Qt Creator > 2.2 -
-you somehow have the earlier version qmldump sources.
-
-You do not need to use the filter-qmldump.pl script.
diff --git a/src/imports/threed/billboarditem3d.cpp b/src/imports/threed/billboarditem3d.cpp
deleted file mode 100644
index eb94d26f..00000000
--- a/src/imports/threed/billboarditem3d.cpp
+++ /dev/null
@@ -1,170 +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 "billboarditem3d.h"
-#include "qgraphicsbillboardtransform.h"
-
-/*!
- \qmlclass BillboardItem3D BillboardItem3D
- \brief The BillboardItem3D will always face toward the viewer.
- \since 4.8
- \ingroup qt3d::qml3d
-
- Sometimes it is desirable to have objects which always face toward the
- camera. For example, a quad with text on it may always face the camera
- so as to be readable at all times.
-
- While this can be achieved with a QGraphicsLookAtTransform on a normal
- Item3D, the BillboardItem3D class provides a more efficient "cheat" which
- takes advantage of the underlying 3D mathematics.
-
- To use a BillboardItem3D declare it exactly like a regular Item3D. When
- the item is drawn a QGraphicsBillboardTransform will be applied to the item
- after all other transforms have been performed.
-
- For example:
-
- \code
- Viewport {
- BillboardItem3D {
- mesh: Mesh { source: "model.obj" }
- effect: Effect {
- blending: true
- texture: "texture.png"
- }
- }
- }
- \endcode
-
- For a practical illustration of its use see the forest example.
-*/
-BillboardItem3D::BillboardItem3D(QObject *parent)
- : QDeclarativeItem3D(parent)
-{
- m_preserveUpVector = false;
-}
-
-/*!
- \qmlproperty bool BillboardItem3D::preserveUpVector
-
- This property specifies whether the billboard transform should
- preserve the "up vector" so that objects stay at right angles
- to the ground plane in the scene.
-
- The default value for this property is false, which indicates that
- the object being transformed should always face directly to the camera
- This is also known as a "spherical billboard".
-
- If the value for this property is true, then the object will have
- its up orientation preserved. This is also known as a "cylindrical
- billboard".
-*/
-bool BillboardItem3D::preserveUpVector() const
-{
- return m_preserveUpVector;
-}
-
-void BillboardItem3D::setPreserveUpVector(bool value)
-{
- m_preserveUpVector = value;
- update();
-}
-
-/*!
- \internal
- This replaces the standard draw() as used in Item3D. In this instance all drawing
- carried out using \a painter follows the standard sequence. However, after the
- transforms for the item have been applied, a QGraphicsBillboardTransform is applied
- to the model-view matrix.
-
- After the current item is drawn the model-view matrix from immediately before the
- billboard transform being applied will be restored so child items are not affected by it.
-*/
-void BillboardItem3D::draw(QGLPainter *painter)
-{
- // Bail out if this item and its children have been disabled.
- if (!isEnabled())
- return;
- if (!isInitialized())
- initialize(painter);
-
- //Setup picking
- int prevId = painter->objectPickId();
- painter->setObjectPickId(objectPickId());
-
- //Setup effect (lighting, culling, effects etc)
- const QGLLightParameters *currentLight = 0;
- QMatrix4x4 currentLightTransform;
- drawLightingSetup(painter, currentLight, currentLightTransform);
- bool viewportBlend, effectBlend;
- drawEffectSetup(painter, viewportBlend, effectBlend);
- drawCullSetup();
-
- //Local and Global transforms
- drawTransformSetup(painter);
-
- //After all of the other transforms, apply the billboard transform to
- //ensure forward facing.
- painter->modelViewMatrix().push();
- QGraphicsBillboardTransform bill;
- bill.setPreserveUpVector(m_preserveUpVector);
- bill.applyTo(const_cast<QMatrix4x4 *>(&painter->modelViewMatrix().top()));
-
- //Drawing
- drawItem(painter);
-
- //Pop the billboard transform from the model-view matrix stack so that it
- //is not applied to child items.
- painter->modelViewMatrix().pop();
-
- //Draw children
- drawChildren(painter);
-
- //Cleanup
- drawTransformCleanup(painter);
- drawLightingCleanup(painter, currentLight, currentLightTransform);
- drawEffectCleanup(painter, viewportBlend, effectBlend);
- drawCullCleanup();
-
- //Reset pick id.
- painter->setObjectPickId(prevId);
-}
-
diff --git a/src/imports/threed/billboarditem3d.h b/src/imports/threed/billboarditem3d.h
deleted file mode 100644
index d60b75fa..00000000
--- a/src/imports/threed/billboarditem3d.h
+++ /dev/null
@@ -1,73 +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 BILLBOARDITEM3D_H
-#define BILLBOARDITEM3D_H
-
-#include "qdeclarativeitem3d.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-class BillboardItem3D : public QDeclarativeItem3D
-{
- Q_OBJECT
- Q_PROPERTY(bool preserveUpVector READ preserveUpVector WRITE setPreserveUpVector)
-public:
- BillboardItem3D(QObject *parent = 0);
-
- bool preserveUpVector() const;
- void setPreserveUpVector(bool value);
-
- void draw(QGLPainter *painter);
-
-private:
- bool m_preserveUpVector;
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(BillboardItem3D)
-
-QT_END_HEADER
-
-#endif // BILLBOARDITEM3D_H
diff --git a/src/imports/threed/library.xml b/src/imports/threed/library.xml
deleted file mode 100644
index 8ed2c343..00000000
--- a/src/imports/threed/library.xml
+++ /dev/null
@@ -1,379 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<module>
- <type name="QDeclarativeEffect" extends="QObject">
- <exports>
- <export module="Qt3D" version="1.0" type="Effect" />
- </exports>
- <property name="color" type="QColor" />
- <property name="useLighting" type="bool" />
- <property name="decal" type="bool" />
- <property name="blending" type="bool" />
- <property name="texture" type="QUrl" />
- <property name="textureImage" type="QImage" />
- <property name="material" type="QGLMaterial" />
- <property name="progress" type="qreal" />
- <signal name="effectChanged" />
- <signal name="progressChanged">
- <param name="progress" type="qreal" />
- </signal>
- </type>
- <type name="QDeclarativeItem3D" defaultProperty="data" extends="QDeclarativeItem">
- <exports>
- <export module="Qt3D" version="1.0" type="Item3D" />
- </exports>
- <enum name="CullFace">
- <enumerator name="CullDisabled" value="0" />
- <enumerator name="CullFrontFaces" value="1028" />
- <enumerator name="CullBackFaces" value="1029" />
- <enumerator name="CullAllFaces" value="1032" />
- <enumerator name="CullClockwise" value="65536" />
- </enum>
- <enum name="CullFaces">
- <enumerator name="CullDisabled" value="0" />
- <enumerator name="CullFrontFaces" value="1028" />
- <enumerator name="CullBackFaces" value="1029" />
- <enumerator name="CullAllFaces" value="1032" />
- <enumerator name="CullClockwise" value="65536" />
- </enum>
- <enum name="SortMode">
- <enumerator name="DefaultSorting" value="0" />
- <enumerator name="BackToFront" value="1" />
- </enum>
- <property name="position" type="QVector3D" />
- <property name="x" type="qreal" />
- <property name="y" type="qreal" />
- <property name="z" type="qreal" />
- <property name="scale" type="qreal" />
- <property name="transform" type="QGraphicsTransform3D" isList="true" />
- <property name="pretransform" type="QGraphicsTransform3D" isList="true" />
- <property name="mesh" type="QDeclarativeMesh" />
- <property name="effect" type="QDeclarativeEffect" />
- <property name="light" type="QGLLightParameters" />
- <property name="resources" type="QObject" isList="true" />
- <property name="data" type="QObject" isList="true" />
- <property name="children" type="QDeclarativeItem3D" isList="true" />
- <property name="cullFaces" type="CullFaces" />
- <property name="sortChildren" type="SortMode" />
- <property name="meshNode" type="string" />
- <property name="inheritEvents" type="bool" />
- <property name="enabled" type="bool" />
- <property name="parent" type="QDeclarativeItem3D" />
- <signal name="positionChanged" />
- <signal name="scaleChanged" />
- <signal name="rotationChanged" />
- <signal name="meshChanged" />
- <signal name="meshNodeChanged" />
- <signal name="effectChanged" />
- <signal name="lightChanged" />
- <signal name="stateChanged">
- <param type="string" />
- </signal>
- <signal name="clicked" />
- <signal name="doubleClicked" />
- <signal name="pressed" />
- <signal name="released" />
- <signal name="hoverEnter" />
- <signal name="hoverLeave" />
- <signal name="inheritEventsChanged" />
- <signal name="enabledChanged" />
- <signal name="childrenChanged" />
- <signal name="parentChanged" />
- <signal name="sortChildrenChanged" />
- <method name="update" />
- <method name="localToWorld" type="QVector3D">
- <param name="point" type="QVector3D" />
- </method>
- <method name="localToWorld" type="QVector3D" />
- <method name="worldToLocal" type="QVector3D">
- <param name="point" type="QVector3D" />
- </method>
- <method name="worldToLocal" type="QVector3D" />
- </type>
- <type name="QDeclarativeMesh" extends="QObject">
- <exports>
- <export module="Qt3D" version="1.0" type="Mesh" />
- </exports>
- <property name="source" type="QUrl" />
- <property name="meshName" type="string" />
- <property name="options" type="string" />
- <property name="dumpInfo" type="bool" />
- <signal name="dataChanged" />
- <signal name="loaded" />
- <signal name="optionsChanged" />
- <signal name="dumpInfoChanged" />
- <method name="material" type="QObject*">
- <param name="nodeName" type="string" />
- <param name="materialName" type="string" />
- </method>
- </type>
- <type name="QGLCamera" extends="QObject">
- <exports>
- <export module="Qt3D" version="1.0" type="Camera" />
- </exports>
- <enum name="ProjectionType">
- <enumerator name="Perspective" value="0" />
- <enumerator name="Orthographic" value="1" />
- </enum>
- <enum name="RotateOrder">
- <enumerator name="TiltPanRoll" value="0" />
- <enumerator name="TiltRollPan" value="1" />
- <enumerator name="PanTiltRoll" value="2" />
- <enumerator name="PanRollTilt" value="3" />
- <enumerator name="RollTiltPan" value="4" />
- <enumerator name="RollPanTilt" value="5" />
- </enum>
- <property name="projectionType" type="ProjectionType" />
- <property name="fieldOfView" type="qreal" />
- <property name="nearPlane" type="qreal" />
- <property name="farPlane" type="qreal" />
- <property name="viewSize" type="QSizeF" />
- <property name="minViewSize" type="QSizeF" />
- <property name="screenRotation" type="int" />
- <property name="eye" type="QVector3D" />
- <property name="upVector" type="QVector3D" />
- <property name="center" type="QVector3D" />
- <property name="eyeSeparation" type="qreal" />
- <property name="motionAdjustment" type="QVector3D" />
- <property name="adjustForAspectRatio" type="bool" />
- <signal name="projectionChanged" />
- <signal name="viewChanged" />
- <method name="translateEye">
- <param name="x" type="qreal" />
- <param name="y" type="qreal" />
- <param name="z" type="qreal" />
- </method>
- <method name="translateCenter">
- <param name="x" type="qreal" />
- <param name="y" type="qreal" />
- <param name="z" type="qreal" />
- </method>
- <method name="tiltPanRollCenter">
- <param name="tiltAngle" type="qreal" />
- <param name="panAngle" type="qreal" />
- <param name="rollAngle" type="qreal" />
- <param name="order" type="QGLCamera.RotateOrder" />
- </method>
- <method name="tiltPanRollCenter">
- <param name="tiltAngle" type="qreal" />
- <param name="panAngle" type="qreal" />
- <param name="rollAngle" type="qreal" />
- </method>
- <method name="tiltPanRollEye">
- <param name="tiltAngle" type="qreal" />
- <param name="panAngle" type="qreal" />
- <param name="rollAngle" type="qreal" />
- <param name="order" type="QGLCamera.RotateOrder" />
- </method>
- <method name="tiltPanRollEye">
- <param name="tiltAngle" type="qreal" />
- <param name="panAngle" type="qreal" />
- <param name="rollAngle" type="qreal" />
- </method>
- </type>
- <type name="QGLLightModel" extends="QObject">
- <exports>
- <export module="Qt3D" version="1.0" type="LightModel" />
- </exports>
- <enum name="Model">
- <enumerator name="OneSided" value="0" />
- <enumerator name="TwoSided" value="1" />
- </enum>
- <enum name="ColorControl">
- <enumerator name="SingleColor" value="0" />
- <enumerator name="SeparateSpecularColor" value="1" />
- </enum>
- <enum name="ViewerPosition">
- <enumerator name="ViewerAtInfinity" value="0" />
- <enumerator name="LocalViewer" value="1" />
- </enum>
- <property name="model" type="Model" />
- <property name="colorControl" type="ColorControl" />
- <property name="viewerPosition" type="ViewerPosition" />
- <property name="ambientSceneColor" type="QColor" />
- <signal name="modelChanged" />
- <signal name="colorControlChanged" />
- <signal name="viewerPositionChanged" />
- <signal name="ambientSceneColorChanged" />
- <signal name="lightModelChanged" />
- </type>
- <type name="QGLLightParameters" extends="QObject">
- <exports>
- <export module="Qt3D" version="1.0" type="Light" />
- </exports>
- <enum name="LightType">
- <enumerator name="Directional" value="0" />
- <enumerator name="Positional" value="1" />
- </enum>
- <property name="type" type="LightType" />
- <property name="position" type="QVector3D" />
- <property name="direction" type="QVector3D" />
- <property name="ambientColor" type="QColor" />
- <property name="diffuseColor" type="QColor" />
- <property name="specularColor" type="QColor" />
- <property name="spotDirection" type="QVector3D" />
- <property name="spotExponent" type="qreal" />
- <property name="spotAngle" type="qreal" />
- <property name="constantAttenuation" type="qreal" />
- <property name="linearAttenuation" type="qreal" />
- <property name="quadraticAttenuation" type="qreal" />
- <signal name="positionChanged" />
- <signal name="directionChanged" />
- <signal name="ambientColorChanged" />
- <signal name="diffuseColorChanged" />
- <signal name="specularColorChanged" />
- <signal name="spotDirectionChanged" />
- <signal name="spotExponentChanged" />
- <signal name="spotAngleChanged" />
- <signal name="constantAttenuationChanged" />
- <signal name="linearAttenuationChanged" />
- <signal name="quadraticAttenuationChanged" />
- <signal name="lightChanged" />
- </type>
- <type name="QGLMaterial" extends="QGLAbstractMaterial">
- <exports>
- <export module="Qt3D" version="1.0" type="Material" />
- </exports>
- <enum name="TextureCombineMode">
- <enumerator name="Modulate" value="0" />
- <enumerator name="Decal" value="1" />
- <enumerator name="Replace" value="2" />
- </enum>
- <property name="ambientColor" type="QColor" />
- <property name="diffuseColor" type="QColor" />
- <property name="specularColor" type="QColor" />
- <property name="emittedLight" type="QColor" />
- <property name="shininess" type="qreal" />
- <property name="texture" type="QGLTexture2D" />
- <property name="textureCombineMode" type="QGLMaterial.TextureCombineMode" />
- <property name="textureUrl" type="QUrl" />
- <signal name="ambientColorChanged" />
- <signal name="diffuseColorChanged" />
- <signal name="specularColorChanged" />
- <signal name="emittedLightChanged" />
- <signal name="shininessChanged" />
- <signal name="texturesChanged" />
- </type>
- <type name="QGLSceneNode" extends="QObject">
- <exports>
- <export module="Qt3D" version="1.0" type="SceneNode" />
- </exports>
- <property name="position" type="QVector3D" />
- <property name="x" type="qreal" />
- <property name="y" type="qreal" />
- <property name="z" type="qreal" />
- <property name="material" type="QGLMaterial" />
- <property name="backMaterial" type="QGLMaterial" />
- <signal name="updated" />
- <method name="clone" type="QGLSceneNode*">
- <param name="parent" type="QObject" />
- </method>
- <method name="clone" type="QGLSceneNode*" />
- <method name="cloneNoChildren" type="QGLSceneNode*">
- <param name="parent" type="QObject" />
- </method>
- <method name="cloneNoChildren" type="QGLSceneNode*" />
- <method name="allExcept" type="QGLSceneNode*">
- <param name="name" type="string" />
- <param name="parent" type="QObject" />
- </method>
- <method name="allExcept" type="QGLSceneNode*">
- <param name="name" type="string" />
- </method>
- <method name="only" type="QGLSceneNode*">
- <param name="name" type="string" />
- <param name="parent" type="QObject" />
- </method>
- <method name="only" type="QGLSceneNode*">
- <param name="name" type="string" />
- </method>
- <method name="allExcept" type="QGLSceneNode*">
- <param name="names" type="QStringList" />
- <param name="parent" type="QObject" />
- </method>
- <method name="allExcept" type="QGLSceneNode*">
- <param name="names" type="QStringList" />
- </method>
- <method name="only" type="QGLSceneNode*">
- <param name="names" type="QStringList" />
- <param name="parent" type="QObject" />
- </method>
- <method name="only" type="QGLSceneNode*">
- <param name="names" type="QStringList" />
- </method>
- </type>
- <type name="QGraphicsBillboardTransform" extends="QGraphicsTransform3D">
- <exports>
- <export module="Qt3D" version="1.0" type="BillboardTransform" />
- </exports>
- <property name="preserveUpVector" type="bool" />
- <signal name="preserveUpVectorChanged" />
- </type>
- <type name="QGraphicsLookAtTransform" extends="QGraphicsTransform3D">
- <exports>
- <export module="Qt3D" version="1.0" type="LookAt" />
- </exports>
- <property name="preserveUpVector" type="bool" />
- <property name="subject" type="QDeclarativeItem3D" />
- <signal name="preserveUpVectorChanged" />
- <signal name="subjectChanged" />
- </type>
- <type name="QGraphicsRotation3D" extends="QGraphicsTransform3D">
- <exports>
- <export module="Qt3D" version="1.0" type="Rotation3D" />
- </exports>
- <property name="origin" type="QVector3D" />
- <property name="angle" type="qreal" />
- <property name="axis" type="QVector3D" />
- <signal name="originChanged" />
- <signal name="angleChanged" />
- <signal name="axisChanged" />
- </type>
- <type name="QGraphicsTranslation3D" extends="QGraphicsTransform3D">
- <exports>
- <export module="Qt3D" version="1.0" type="Translation3D" />
- </exports>
- <property name="translate" type="QVector3D" />
- <property name="progress" type="qreal" />
- <signal name="translateChanged" />
- <signal name="progressChanged" />
- </type>
- <type name="Scale3D" extends="QGraphicsScale3D">
- <exports>
- <export module="Qt3D" version="1.0" type="Scale3D" />
- </exports>
- <property name="scale" type="QVariant" />
- <signal name="variantScaleChanged" />
- </type>
- <type name="ShaderProgram" extends="QDeclarativeEffect">
- <exports>
- <export module="Qt3D" version="1.0" type="ShaderProgram" />
- </exports>
- <property name="vertexShader" type="string" />
- <property name="fragmentShader" type="string" />
- <signal name="finishedLoading" />
- <signal name="shaderChanged" />
- <method name="markAllPropertiesDirty" />
- <method name="markPropertyDirty">
- <param name="property" type="int" />
- </method>
- </type>
- <type name="Viewport" defaultProperty="data" extends="QDeclarativeItem">
- <exports>
- <export module="Qt3D" version="1.0" type="Viewport" />
- </exports>
- <property name="picking" type="bool" />
- <property name="showPicking" type="bool" />
- <property name="navigation" type="bool" />
- <property name="fovzoom" type="bool" />
- <property name="blending" type="bool" />
- <property name="camera" type="QGLCamera" />
- <property name="light" type="QGLLightParameters" />
- <property name="lightModel" type="QGLLightModel" />
- <signal name="viewportChanged" />
- <method name="update3d" />
- <method name="objectForPoint" type="QObject*">
- <param name="x" type="qreal" />
- <param name="y" type="qreal" />
- </method>
- </type>
-</module>
diff --git a/src/imports/threed/plugins.qmltypes b/src/imports/threed/plugins.qmltypes
deleted file mode 100755
index 477bb4a9..00000000
--- a/src/imports/threed/plugins.qmltypes
+++ /dev/null
@@ -1,499 +0,0 @@
-import QtQuick.tooling 1.0
-
-// This file describes the plugin-supplied types contained in the library.
-// It is used for QML tooling purposes only.
-
-Module {
- Component {
- name: "QDeclarativeEffect"
- prototype: "QObject"
- exports: [
- "Effect 1.0"
- ]
- Property { name: "color"; type: "QColor" }
- Property { name: "useLighting"; type: "bool" }
- Property { name: "decal"; type: "bool" }
- Property { name: "blending"; type: "bool" }
- Property { name: "texture"; type: "QUrl" }
- Property { name: "textureImage"; type: "QImage" }
- Property { name: "material"; type: "QGLMaterial"; isPointer: true }
- Property { name: "progress"; type: "qreal"; isReadonly: true }
- Signal { name: "effectChanged" }
- Signal {
- name: "progressChanged"
- Parameter { name: "progress"; type: "qreal" }
- }
- }
- Component {
- name: "QDeclarativeItem3D"
- defaultProperty: "data"
- prototype: "QDeclarativeItem"
- exports: [
- "Item3D 1.0"
- ]
- Enum {
- name: "CullFace"
- values: {
- "CullDisabled": 0,
- "CullFrontFaces": 1028,
- "CullBackFaces": 1029,
- "CullAllFaces": 1032,
- "CullClockwise": 65536
- }
- }
- Enum {
- name: "CullFaces"
- values: {
- "CullDisabled": 0,
- "CullFrontFaces": 1028,
- "CullBackFaces": 1029,
- "CullAllFaces": 1032,
- "CullClockwise": 65536
- }
- }
- Enum {
- name: "SortMode"
- values: {
- "DefaultSorting": 0,
- "BackToFront": 1
- }
- }
- Property { name: "position"; type: "QVector3D" }
- Property { name: "x"; type: "qreal" }
- Property { name: "y"; type: "qreal" }
- Property { name: "z"; type: "qreal" }
- Property { name: "scale"; type: "qreal" }
- Property { name: "transform"; type: "QGraphicsTransform3D"; isList: true; isReadonly: true }
- Property { name: "pretransform"; type: "QGraphicsTransform3D"; isList: true; isReadonly: true }
- Property { name: "mesh"; type: "QDeclarativeMesh"; isPointer: true }
- Property { name: "effect"; type: "QDeclarativeEffect"; isPointer: true }
- Property { name: "light"; type: "QGLLightParameters"; isPointer: true }
- Property { name: "resources"; type: "QObject"; isList: true; isReadonly: true }
- Property { name: "data"; type: "QObject"; isList: true; isReadonly: true }
- Property { name: "children"; type: "QDeclarativeItem3D"; isList: true; isReadonly: true }
- Property { name: "cullFaces"; type: "CullFaces" }
- Property { name: "sortChildren"; type: "SortMode" }
- Property { name: "meshNode"; type: "string" }
- Property { name: "inheritEvents"; type: "bool" }
- Property { name: "enabled"; type: "bool" }
- Property { name: "parent"; type: "QDeclarativeItem3D"; isPointer: true }
- Signal { name: "positionChanged" }
- Signal { name: "scaleChanged" }
- Signal { name: "rotationChanged" }
- Signal { name: "meshChanged" }
- Signal { name: "meshNodeChanged" }
- Signal { name: "effectChanged" }
- Signal { name: "lightChanged" }
- Signal {
- name: "stateChanged"
- Parameter { type: "string" }
- }
- Signal { name: "clicked" }
- Signal { name: "doubleClicked" }
- Signal { name: "pressed" }
- Signal { name: "released" }
- Signal { name: "hoverEnter" }
- Signal { name: "hoverLeave" }
- Signal { name: "inheritEventsChanged" }
- Signal { name: "enabledChanged" }
- Signal { name: "childrenChanged" }
- Signal { name: "parentChanged" }
- Signal { name: "sortChildrenChanged" }
- Method { name: "update" }
- Method {
- name: "localToWorld"
- type: "QVector3D"
- Parameter { name: "point"; type: "QVector3D" }
- }
- Method { name: "localToWorld"; type: "QVector3D" }
- Method {
- name: "worldToLocal"
- type: "QVector3D"
- Parameter { name: "point"; type: "QVector3D" }
- }
- Method { name: "worldToLocal"; type: "QVector3D" }
- }
- Component {
- name: "QDeclarativeMesh"
- prototype: "QObject"
- exports: [
- "Mesh 1.0"
- ]
- Property { name: "source"; type: "QUrl" }
- Property { name: "meshName"; type: "string" }
- Property { name: "options"; type: "string" }
- Property { name: "dumpInfo"; type: "bool" }
- Signal { name: "dataChanged" }
- Signal { name: "loaded" }
- Signal { name: "optionsChanged" }
- Signal { name: "dumpInfoChanged" }
- Method {
- name: "material"
- type: "QObject*"
- Parameter { name: "nodeName"; type: "string" }
- Parameter { name: "materialName"; type: "string" }
- }
- }
- Component {
- name: "QGLAbstractMaterial"
- prototype: "QObject"
- Signal { name: "materialChanged" }
- }
- Component {
- name: "QGLCamera"
- prototype: "QObject"
- exports: [
- "Camera 1.0"
- ]
- Enum {
- name: "ProjectionType"
- values: {
- "Perspective": 0,
- "Orthographic": 1
- }
- }
- Enum {
- name: "RotateOrder"
- values: {
- "TiltPanRoll": 0,
- "TiltRollPan": 1,
- "PanTiltRoll": 2,
- "PanRollTilt": 3,
- "RollTiltPan": 4,
- "RollPanTilt": 5
- }
- }
- Property { name: "projectionType"; type: "ProjectionType" }
- Property { name: "fieldOfView"; type: "qreal" }
- Property { name: "nearPlane"; type: "qreal" }
- Property { name: "farPlane"; type: "qreal" }
- Property { name: "viewSize"; type: "QSizeF" }
- Property { name: "minViewSize"; type: "QSizeF" }
- Property { name: "screenRotation"; type: "int" }
- Property { name: "eye"; type: "QVector3D" }
- Property { name: "upVector"; type: "QVector3D" }
- Property { name: "center"; type: "QVector3D" }
- Property { name: "eyeSeparation"; type: "qreal" }
- Property { name: "motionAdjustment"; type: "QVector3D" }
- Property { name: "adjustForAspectRatio"; type: "bool" }
- Signal { name: "projectionChanged" }
- Signal { name: "viewChanged" }
- Method {
- name: "translateEye"
- Parameter { name: "x"; type: "qreal" }
- Parameter { name: "y"; type: "qreal" }
- Parameter { name: "z"; type: "qreal" }
- }
- Method {
- name: "translateCenter"
- Parameter { name: "x"; type: "qreal" }
- Parameter { name: "y"; type: "qreal" }
- Parameter { name: "z"; type: "qreal" }
- }
- Method {
- name: "tiltPanRollCenter"
- Parameter { name: "tiltAngle"; type: "qreal" }
- Parameter { name: "panAngle"; type: "qreal" }
- Parameter { name: "rollAngle"; type: "qreal" }
- Parameter { name: "order"; type: "QGLCamera::RotateOrder" }
- }
- Method {
- name: "tiltPanRollCenter"
- Parameter { name: "tiltAngle"; type: "qreal" }
- Parameter { name: "panAngle"; type: "qreal" }
- Parameter { name: "rollAngle"; type: "qreal" }
- }
- Method {
- name: "tiltPanRollEye"
- Parameter { name: "tiltAngle"; type: "qreal" }
- Parameter { name: "panAngle"; type: "qreal" }
- Parameter { name: "rollAngle"; type: "qreal" }
- Parameter { name: "order"; type: "QGLCamera::RotateOrder" }
- }
- Method {
- name: "tiltPanRollEye"
- Parameter { name: "tiltAngle"; type: "qreal" }
- Parameter { name: "panAngle"; type: "qreal" }
- Parameter { name: "rollAngle"; type: "qreal" }
- }
- }
- Component {
- name: "QGLLightModel"
- prototype: "QObject"
- exports: [
- "LightModel 1.0"
- ]
- Enum {
- name: "Model"
- values: {
- "OneSided": 0,
- "TwoSided": 1
- }
- }
- Enum {
- name: "ColorControl"
- values: {
- "SingleColor": 0,
- "SeparateSpecularColor": 1
- }
- }
- Enum {
- name: "ViewerPosition"
- values: {
- "ViewerAtInfinity": 0,
- "LocalViewer": 1
- }
- }
- Property { name: "model"; type: "Model" }
- Property { name: "colorControl"; type: "ColorControl" }
- Property { name: "viewerPosition"; type: "ViewerPosition" }
- Property { name: "ambientSceneColor"; type: "QColor" }
- Signal { name: "modelChanged" }
- Signal { name: "colorControlChanged" }
- Signal { name: "viewerPositionChanged" }
- Signal { name: "ambientSceneColorChanged" }
- Signal { name: "lightModelChanged" }
- }
- Component {
- name: "QGLLightParameters"
- prototype: "QObject"
- exports: [
- "Light 1.0"
- ]
- Enum {
- name: "LightType"
- values: {
- "Directional": 0,
- "Positional": 1
- }
- }
- Property { name: "type"; type: "LightType"; isReadonly: true }
- Property { name: "position"; type: "QVector3D" }
- Property { name: "direction"; type: "QVector3D" }
- Property { name: "ambientColor"; type: "QColor" }
- Property { name: "diffuseColor"; type: "QColor" }
- Property { name: "specularColor"; type: "QColor" }
- Property { name: "spotDirection"; type: "QVector3D" }
- Property { name: "spotExponent"; type: "qreal" }
- Property { name: "spotAngle"; type: "qreal" }
- Property { name: "constantAttenuation"; type: "qreal" }
- Property { name: "linearAttenuation"; type: "qreal" }
- Property { name: "quadraticAttenuation"; type: "qreal" }
- Signal { name: "positionChanged" }
- Signal { name: "directionChanged" }
- Signal { name: "ambientColorChanged" }
- Signal { name: "diffuseColorChanged" }
- Signal { name: "specularColorChanged" }
- Signal { name: "spotDirectionChanged" }
- Signal { name: "spotExponentChanged" }
- Signal { name: "spotAngleChanged" }
- Signal { name: "constantAttenuationChanged" }
- Signal { name: "linearAttenuationChanged" }
- Signal { name: "quadraticAttenuationChanged" }
- Signal { name: "lightChanged" }
- }
- Component {
- name: "QGLMaterial"
- prototype: "QGLAbstractMaterial"
- exports: [
- "Material 1.0"
- ]
- Enum {
- name: "TextureCombineMode"
- values: {
- "Modulate": 0,
- "Decal": 1,
- "Replace": 2
- }
- }
- Property { name: "ambientColor"; type: "QColor" }
- Property { name: "diffuseColor"; type: "QColor" }
- Property { name: "specularColor"; type: "QColor" }
- Property { name: "emittedLight"; type: "QColor" }
- Property { name: "shininess"; type: "qreal" }
- Property { name: "texture"; type: "QGLTexture2D"; isPointer: true }
- Property { name: "textureCombineMode"; type: "QGLMaterial::TextureCombineMode" }
- Property { name: "textureUrl"; type: "QUrl" }
- Signal { name: "ambientColorChanged" }
- Signal { name: "diffuseColorChanged" }
- Signal { name: "specularColorChanged" }
- Signal { name: "emittedLightChanged" }
- Signal { name: "shininessChanged" }
- Signal { name: "texturesChanged" }
- }
- Component {
- name: "QGLSceneNode"
- prototype: "QObject"
- exports: [
- "SceneNode 1.0"
- ]
- Property { name: "position"; type: "QVector3D" }
- Property { name: "x"; type: "qreal" }
- Property { name: "y"; type: "qreal" }
- Property { name: "z"; type: "qreal" }
- Property { name: "material"; type: "QGLMaterial"; isPointer: true }
- Property { name: "backMaterial"; type: "QGLMaterial"; isPointer: true }
- Signal { name: "updated" }
- Method {
- name: "clone"
- type: "QGLSceneNode*"
- Parameter { name: "parent"; type: "QObject"; isPointer: true }
- }
- Method { name: "clone"; type: "QGLSceneNode*" }
- Method {
- name: "cloneNoChildren"
- type: "QGLSceneNode*"
- Parameter { name: "parent"; type: "QObject"; isPointer: true }
- }
- Method { name: "cloneNoChildren"; type: "QGLSceneNode*" }
- Method {
- name: "allExcept"
- type: "QGLSceneNode*"
- Parameter { name: "name"; type: "string" }
- Parameter { name: "parent"; type: "QObject"; isPointer: true }
- }
- Method {
- name: "allExcept"
- type: "QGLSceneNode*"
- Parameter { name: "name"; type: "string" }
- }
- Method {
- name: "only"
- type: "QGLSceneNode*"
- Parameter { name: "name"; type: "string" }
- Parameter { name: "parent"; type: "QObject"; isPointer: true }
- }
- Method {
- name: "only"
- type: "QGLSceneNode*"
- Parameter { name: "name"; type: "string" }
- }
- Method {
- name: "allExcept"
- type: "QGLSceneNode*"
- Parameter { name: "names"; type: "QStringList" }
- Parameter { name: "parent"; type: "QObject"; isPointer: true }
- }
- Method {
- name: "allExcept"
- type: "QGLSceneNode*"
- Parameter { name: "names"; type: "QStringList" }
- }
- Method {
- name: "only"
- type: "QGLSceneNode*"
- Parameter { name: "names"; type: "QStringList" }
- Parameter { name: "parent"; type: "QObject"; isPointer: true }
- }
- Method {
- name: "only"
- type: "QGLSceneNode*"
- Parameter { name: "names"; type: "QStringList" }
- }
- }
- Component {
- name: "QGraphicsBillboardTransform"
- prototype: "QGraphicsTransform3D"
- exports: [
- "BillboardTransform 1.0"
- ]
- Property { name: "preserveUpVector"; type: "bool" }
- Signal { name: "preserveUpVectorChanged" }
- }
- Component {
- name: "QGraphicsLookAtTransform"
- prototype: "QGraphicsTransform3D"
- exports: [
- "LookAt 1.0"
- ]
- Property { name: "preserveUpVector"; type: "bool" }
- Property { name: "subject"; type: "QDeclarativeItem3D"; isPointer: true }
- Signal { name: "preserveUpVectorChanged" }
- Signal { name: "subjectChanged" }
- }
- Component {
- name: "QGraphicsRotation3D"
- prototype: "QGraphicsTransform3D"
- exports: [
- "Rotation3D 1.0"
- ]
- Property { name: "origin"; type: "QVector3D" }
- Property { name: "angle"; type: "qreal" }
- Property { name: "axis"; type: "QVector3D" }
- Signal { name: "originChanged" }
- Signal { name: "angleChanged" }
- Signal { name: "axisChanged" }
- }
- Component {
- name: "QGraphicsScale3D"
- prototype: "QGraphicsTransform3D"
- Property { name: "origin"; type: "QVector3D" }
- Property { name: "scale"; type: "QVector3D" }
- Signal { name: "originChanged" }
- Signal { name: "scaleChanged" }
- }
- Component {
- name: "QGraphicsTransform3D"
- prototype: "QObject"
- Signal { name: "transformChanged" }
- }
- Component {
- name: "QGraphicsTranslation3D"
- prototype: "QGraphicsTransform3D"
- exports: [
- "Translation3D 1.0"
- ]
- Property { name: "translate"; type: "QVector3D" }
- Property { name: "progress"; type: "qreal" }
- Signal { name: "translateChanged" }
- Signal { name: "progressChanged" }
- }
- Component {
- name: "Scale3D"
- prototype: "QGraphicsScale3D"
- exports: [
- "Scale3D 1.0"
- ]
- Property { name: "scale"; type: "QVariant" }
- Signal { name: "variantScaleChanged" }
- }
- Component {
- name: "ShaderProgram"
- prototype: "QDeclarativeEffect"
- exports: [
- "ShaderProgram 1.0"
- ]
- Property { name: "vertexShader"; type: "string" }
- Property { name: "fragmentShader"; type: "string" }
- Signal { name: "finishedLoading" }
- Signal { name: "shaderChanged" }
- Method { name: "markAllPropertiesDirty" }
- Method {
- name: "markPropertyDirty"
- Parameter { name: "property"; type: "int" }
- }
- }
- Component {
- name: "Viewport"
- defaultProperty: "data"
- prototype: "QDeclarativeItem"
- exports: [
- "Viewport 1.0"
- ]
- Property { name: "picking"; type: "bool" }
- Property { name: "showPicking"; type: "bool" }
- Property { name: "navigation"; type: "bool" }
- Property { name: "blending"; type: "bool" }
- Property { name: "camera"; type: "QGLCamera"; isPointer: true }
- Property { name: "light"; type: "QGLLightParameters"; isPointer: true }
- Property { name: "lightModel"; type: "QGLLightModel"; isPointer: true }
- Signal { name: "viewportChanged" }
- Method { name: "update3d" }
- Method {
- name: "objectForPoint"
- type: "QObject*"
- Parameter { name: "x"; type: "qreal" }
- Parameter { name: "y"; type: "qreal" }
- }
- }
-}
diff --git a/src/imports/threed/qgraphicslookattransform.cpp b/src/imports/threed/qgraphicslookattransform.cpp
deleted file mode 100644
index e3772b94..00000000
--- a/src/imports/threed/qgraphicslookattransform.cpp
+++ /dev/null
@@ -1,517 +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 "qgraphicslookattransform.h"
-#include "qgraphicsrotation3d.h"
-#include <QtCore/qmath.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGraphicsLookAtTransform
- \brief The QGraphicsLookAtTransform class implements a transformation
- that causes an Item3D to orient to face another Item3D.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::graphicsview
-
- Sometimes it can be useful to make an object face towards another object,
- wherever it might be located. This is useful for objects like cameras,
- lights, arrows, faces etc.
-
- Another common use is called "billboarding", where a quad is always
- oriented to face the camera.
-*/
-
-/*!
- \qmlclass LookAtTransform QGraphicsLookAtTransform
- \brief The LookAtTransform item implements a transformation that causes objects to face the camera.
- \since 4.8
- \ingroup qt3d::qml3d
-
- Sometimes it can be useful to make an object face towards another object,
- wherever it might be located. This is useful for objects like cameras,
- lights, arrows, faces etc.
-
- Another common use is called "billboarding", where a quad is always
- oriented to face the camera. In QML, this can be achieved as follows:
-
- \code
- Camera3D camera
- Item3D {
- mesh: Mesh { source: "pane.obj" }
- position: Qt.vector3d(2, 0, -20)
- transform: LookAtTransform { worldPosition - camera.worldPosition }
- effect: Effect { texture: "picture.jpg" }
- }
- \endcode
-
- Because the lookAt transformation will override many other transformations
- ont the matrix, it will usually be the last element in the \c transform
- list (transformations are applied to the matrix in reverse order of their
- appearance in \c transform):
-
- \code
- Item3D {
- mesh: Mesh { source: "pane.obj" }
- position: Qt.vector3d(2, 0, -20)
- transform: [
- Scale3D { scale: 0.5 },
- Rotation3D { angle: 30 },
- LookAtTransform { worldPosition - camera.worldPosition }
- ]
- effect: Effect { texture: "picture.jpg" }
- }
- \endcode
-
- Typically, orientation as well as facing is important. For example, a face
- that does not remain basically upright will look very odd indeed as it
- tracks a subject. The lookAt transform will always rotate first around the
- local y axis, and secondarily around the local x axis, around an origin of
- (0,0,0).
-
- If rotation around a different axis or origin is desired, place the
- Item3D to be rotated inside a new parent Item3D. Apply rotations the
- and translations to the original Item3D such that the desired "front"
- matches the new parent Item3d's positive z direction and the left to right
- matches the parent's x-axis, and then apply the LookAt transform to the
- new parent item.
-
- \code
- Item3D {
- position: Qt.vector3d(0,0,4)
- transform: LookAt { subject: subjectPenguin }
-
- Item3D {
- id: lookAwayMonkey
- mesh: Mesh { source: "meshes/monkey.3ds" }
- transform: Rotation3D { axis: Qt.vector3d(0,1,0); angle: 180 }
- }
- }
- \endcode
-
- By default the LookAt transform will cause the object to
- face directly at the subject no matter how the world co-ordinate
- system is rotated. Sometimes it is useful to limit the lookAt to only
- one axis of rotation - for example, a tank with a turret and barrel that
- each have only one degree of freedom.
- This is achieved by using the preserveUpVector property:
-
- \code
- Pane {
- position: Qt.vector3d(2, 0, -20)
- transform: LookAtTransform { preserveUpVector: true }
- effect: Effect { texture: "picture.jpg" }
- }
- \endcode
-*/
-
-/*!
- \internal
-*/
-static QMatrix4x4* cheatingSphericalBillboard(QMatrix4x4 *matrix)
-{
- // Replace the top-left 3x3 of the matrix with the identity.
- // The technique is "Cheating Spherical Billboards", described here:
- // http://www.lighthouse3d.com/opengl/billboarding/index.php?billCheat
- (*matrix)(0, 0) = 1.0f;
- (*matrix)(0, 1) = 0.0f;
- (*matrix)(0, 2) = 0.0f;
- (*matrix)(1, 0) = 0.0f;
- (*matrix)(1, 1) = 1.0f;
- (*matrix)(1, 2) = 0.0f;
- (*matrix)(2, 0) = 0.0f;
- (*matrix)(2, 1) = 0.0f;
- (*matrix)(2, 2) = 1.0f;
-
- return matrix;
-};
-
-/*!
- \internal
-*/
-static QMatrix4x4* cheatingCylindricalBillboard(QMatrix4x4 *matrix)
-{
- // Replace some of the top-left 3x3 of the matrix with the identity,
- // but leave the up vector component in the second column as-is.
- // The technique is "Cheating Cylindrical Billboards", described here:
- // http://www.lighthouse3d.com/opengl/billboarding/index.php?billCheat1
- (*matrix)(0, 0) = 1.0f;
- (*matrix)(0, 2) = 0.0f;
- (*matrix)(1, 0) = 0.0f;
- (*matrix)(1, 2) = 0.0f;
- (*matrix)(2, 0) = 0.0f;
- (*matrix)(2, 2) = 1.0f;
-
- return matrix;
-};
-
-#define RADS_TO_DEGREES (180.0 / M_PI)
-
-struct LookAtRotationCache {
- QGraphicsRotation3D primaryRotation;
- QGraphicsRotation3D secondaryRotation;
-};
-
-class QGraphicsLookAtTransformPrivate
-{
-public:
- QGraphicsLookAtTransformPrivate(QGraphicsLookAtTransform* _lookAt);
- QGraphicsLookAtTransform* lookAt;
- void determineOriginItem();
- void calculateRotationValues() const;
- QVector3D relativePosition(QDeclarativeItem3D* originItem, QDeclarativeItem3D* subject) const;
-
- bool preserveUpVector;
- QDeclarativeItem3D* originItem;
- QDeclarativeItem3D* subject;
- mutable LookAtRotationCache rotationCache;
- mutable bool rotationCacheDirty;
-
-};
-
-QGraphicsLookAtTransformPrivate::QGraphicsLookAtTransformPrivate(QGraphicsLookAtTransform* _lookAt) :
- lookAt(_lookAt), preserveUpVector(false), originItem(0), subject(0)
-{
-}
-
-void QGraphicsLookAtTransformPrivate::determineOriginItem()
-{
- QObject* workingObject = lookAt->parent();
- while (qobject_cast<QDeclarativeItem3D*>(workingObject) == 0 &&
- workingObject != 0)
- {
- workingObject = workingObject->parent();
- }
-
- originItem = qobject_cast<QDeclarativeItem3D*>(workingObject);
- if (!originItem)
- qWarning() << "LookAt transform requires an Item3D ancestor";
-}
-
-QVector3D QGraphicsLookAtTransformPrivate::relativePosition(QDeclarativeItem3D* originItem, QDeclarativeItem3D* subject) const
-{
- QVector3D result = originItem->worldToLocal(subject->localToWorld());
- return result;
-
-}
-
-/*! \internal
- Calculate the actual rotation values for the transform.
-
- Note this function has to be const to be called within applyTo(), but
- modifies the mutable rotationCache and rotationCacheDirty values.
-*/
-void QGraphicsLookAtTransformPrivate::calculateRotationValues() const
-{
- QVector3D forwards(0, 0, 1);
- rotationCache.primaryRotation.setAngle(0);
- rotationCache.secondaryRotation.setAngle(0);
- rotationCacheDirty = false;
-
- if (subject == 0 || originItem == 0)
- {
- if (subject == 0)
- qWarning() << "LookAt transform got null subject";
- if (originItem == 0)
- qWarning() << "LookAt transform got null originItem";
- rotationCache.primaryRotation.setAxis(QVector3D(0,1,0));
- rotationCache.primaryRotation.setAngle(0);
- rotationCache.secondaryRotation.setAxis(QVector3D(1,0,0));
- rotationCache.secondaryRotation.setAngle(0);
- return;
- }
-
- // Calculate the lookat vector in the local frame:
- QVector3D relativePositionVector = relativePosition(originItem, subject);
-
- // Project the relative position into the xz plane:
- QVector3D subjectProjection = relativePositionVector;
- subjectProjection.setY(0);
- subjectProjection.normalize();
- QVector3D primaryRotationAxis;
-
- if (!subjectProjection.isNull())
- {
- primaryRotationAxis = QVector3D::crossProduct(forwards, subjectProjection);
- // Fix rotational axis for positions along z axis
- if (primaryRotationAxis.length() == 0)
- {
- primaryRotationAxis = QVector3D(0,1,0);
- }
-
- qreal angleCosine =
- QVector3D::dotProduct(forwards, subjectProjection);
- qreal angle = qAcos(angleCosine);
-
- rotationCache.primaryRotation.setAxis(primaryRotationAxis);
- rotationCache.primaryRotation.setAngle(angle * RADS_TO_DEGREES );
- } else {
- // Target is directly above or below, so zero primary rotation
- rotationCache.primaryRotation.setAxis(QVector3D(0,1,0));
- rotationCache.primaryRotation.setAngle(0);
- }
-
- relativePositionVector.normalize();
-
- qreal secondaryAngleCosine = QVector3D::dotProduct( subjectProjection,
- relativePositionVector);
- // Sanity check in case of rounding errors
- if (secondaryAngleCosine <= 1.0 && secondaryAngleCosine >= -1.0)
- {
- if (relativePositionVector.y() < 0)
- rotationCache.secondaryRotation.setAxis(QVector3D(1,0,0));
- else
- rotationCache.secondaryRotation.setAxis(QVector3D(-1,0,0));
- rotationCache.secondaryRotation.setAngle(qAcos(secondaryAngleCosine)*RADS_TO_DEGREES);
- } else {
- rotationCache.secondaryRotation.setAxis(QVector3D(1,0,0));
- rotationCache.secondaryRotation.setAngle(0.0);
- }
-}
-
-/*!
- Construct a lookAt transform and attach it to \a parent.
-*/
-QGraphicsLookAtTransform::QGraphicsLookAtTransform(QObject *parent)
- : QGraphicsTransform3D(parent), d_ptr(new QGraphicsLookAtTransformPrivate(this))
-{
-}
-
-/*!
- Destroy this lookAt transform.
-*/
-QGraphicsLookAtTransform::~QGraphicsLookAtTransform()
-{
-}
-
-/*!
- \property QGraphicsLookAtTransform::preserveUpVector
- \brief true to preserve the up orientation.
-
- This property indicates whether the transform should rotate around a second
- axis to face directly at the subject (when the subject is the camera, this
- is known as "spherical billboarding").
-
- If the value for this property is true, then the object will have
- its up vector's orientation preserved, rotating around only the y-axis and
- not directly facing the subject unless it happens to fall on the correct
- plane (when the subject is the camera, this is known as known as
- "cylindrical billboarding").
-
- The default value for this property is false.
-*/
-
-/*!
- \qmlproperty bool LookatTransform::preserveUpVector
-
- This property indicates whether the transform should rotate around a second
- axis to face directly at the subject (known as a "spherical look-at").
-
- If the value for this property is true, then the object will have
- its y-axis' orientation preserved, rotating around only this axis and
- not directly facing the subject unless it happens to fall on the correct
- plane (known as a "cylindrical look-at").
-
- The default value for this property is false.
-*/
-
-bool QGraphicsLookAtTransform::preserveUpVector() const
-{
- Q_D(const QGraphicsLookAtTransform);
- return d->preserveUpVector;
-}
-
-void QGraphicsLookAtTransform::setPreserveUpVector(bool value)
-{
- Q_D(QGraphicsLookAtTransform);
- if (d->preserveUpVector != value) {
- d->preserveUpVector = value;
- d->rotationCacheDirty = true;
- emit preserveUpVectorChanged();
- emit transformChanged();
- }
-}
-
-/*!
- \property QGraphicsLookAtTransform::subject
- \brief The local-relative coordinates that are being looked at
-
- This property indicates what this transform is trying to look at. After
- applying the transformation.
-
- Forwards is always considered to be in the direction of the positive z axis
- in local space, and up is always considered to be the positive y axis, and
- rotation is always around the position (0,0,0) in local space (although
- any values can be emulated by applying the LookAt transformation to a
- parent Item3D, and then applying transformations relative to that parent).
-
- If no subject is set, no transformation is applied.
-*/
-
-/*!
- \qmlproperty bool LookatTransform::preserveUpVector
-
- This property indicates whether the transform should rotate around a second
- axis to face directly at the subject (known as a "spherical look-at").
-
- If the value for this property is true, then the object will have
- its y-axis' orientation preserved, rotating around only this axis and
- not directly facing the subject unless it happens to fall on the correct
- plane (when the subject is the camera, this is known as a
- "cylindrical look-at").
-
- The default value for this property is false.
-*/
-
-/*!
- \fn void QGraphicsLookAtTransform::subjectChanged()
-
- Signal that is emitted when subject() changes.
-*/
-
-
-QDeclarativeItem3D* QGraphicsLookAtTransform::subject() const
-{
- Q_D(const QGraphicsLookAtTransform);
- return d->subject;
-}
-
-void QGraphicsLookAtTransform::setSubject(QDeclarativeItem3D* value)
-{
- Q_D(QGraphicsLookAtTransform);
- if (d->subject != value)
- {
- // Listen for changes on the subject and it's ancestors that mean the
- // lookAt transform needs to be recalculated
- disconnect(this, SLOT(subjectPositionChanged()));
- d->subject = value;
- QDeclarativeItem3D* ancestorItem = d->subject;
- while (ancestorItem != 0)
- {
- // listen for changes directly on the item, changes on it's
- // transforms property, or through reparenting
- connect(ancestorItem, SIGNAL(positionChanged()), this, SLOT(subjectPositionChanged()));
- connect(ancestorItem, SIGNAL(rotationChanged()), this, SLOT(subjectPositionChanged()));
- connect(ancestorItem, SIGNAL(scaleChanged()), this, SLOT(subjectPositionChanged()));
- connect(ancestorItem, SIGNAL(parentChanged()), this, SLOT(ancestryChanged()));
- QDeclarativeListProperty<QGraphicsTransform3D> transforms =
- ancestorItem->transform();
-
- for (int i=0; i < transforms.count(&transforms) ; i++)
- {
- QGraphicsTransform3D* transform = transforms.at(&transforms, i);
- connect(transform, SIGNAL(transformChanged()),
- this, SLOT(subjectPositionChanged()));
- }
-
- ancestorItem = qobject_cast<QDeclarativeItem3D*> (ancestorItem->parent());
- };
-
- d->rotationCacheDirty = true;
- d->determineOriginItem();
- emit subjectChanged();
- emit transformChanged();
- }
-};
-
-void QGraphicsLookAtTransform::subjectPositionChanged()
-{
- Q_D(QGraphicsLookAtTransform);
- d->rotationCacheDirty = true;
-}
-
-void QGraphicsLookAtTransform::ancestryChanged()
-{
- Q_D(QGraphicsLookAtTransform);
- d->determineOriginItem();
- d->rotationCacheDirty = true;
-}
-
-/*!
- \internal
-*/
-void QGraphicsLookAtTransform::applyTo(QMatrix4x4 *matrix) const
-{
- Q_D(const QGraphicsLookAtTransform);
- bool cameraTest = false;
- bool animationTest = false;
- // If we're looking at the camera, and not animating,
- // we can use a cheap cheat
- if (cameraTest && !animationTest)
- {
- if (!d->preserveUpVector)
- cheatingSphericalBillboard(matrix);
- else
- cheatingCylindricalBillboard(matrix);
- matrix->optimize();
- return;
- }
-
- if (d->rotationCacheDirty)
- d->calculateRotationValues();
-
- d->rotationCache.primaryRotation.applyTo(matrix);
- // then, if preserveVector is not set, perform a second rotation
- // around the x-axis
- if (!preserveUpVector())
- d->rotationCache.secondaryRotation.applyTo(matrix);
-}
-
-/*!
- \internal
-*/
-QGraphicsTransform3D *QGraphicsLookAtTransform::clone(QObject *parent) const
-{
- Q_D(const QGraphicsLookAtTransform);
- QGraphicsLookAtTransform *copy = new QGraphicsLookAtTransform(parent);
- copy->setPreserveUpVector(d->preserveUpVector);
- copy->setSubject(d->subject);
- return copy;
-}
-
-/*!
- \fn void QGraphicsLookAtTransform::preserveUpVectorChanged()
-
- Signal that is emitted when preserveUpVector() changes.
-*/
-
-QT_END_NAMESPACE
diff --git a/src/imports/threed/qgraphicslookattransform.h b/src/imports/threed/qgraphicslookattransform.h
deleted file mode 100644
index b578dff5..00000000
--- a/src/imports/threed/qgraphicslookattransform.h
+++ /dev/null
@@ -1,94 +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 QGRAPHICSLOOKATTRANSFORM_H
-#define QGRAPHICSLOOKATTRANSFORM_H
-
-#include "qgraphicstransform3d.h"
-#include "qdeclarativeitem3d.h"
-
-#include <QtCore/qscopedpointer.h>
-#include <QtCore/qpointer.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-class QGraphicsLookAtTransformPrivate;
-
-class QGraphicsLookAtTransform : public QGraphicsTransform3D
-{
- Q_OBJECT
- Q_PROPERTY(bool preserveUpVector READ preserveUpVector WRITE setPreserveUpVector NOTIFY preserveUpVectorChanged)
- Q_PROPERTY(QDeclarativeItem3D* subject READ subject WRITE setSubject NOTIFY subjectChanged )
-public:
- QGraphicsLookAtTransform(QObject *parent = 0);
- ~QGraphicsLookAtTransform();
-
- bool preserveUpVector() const;
- void setPreserveUpVector(bool value);
-
- QDeclarativeItem3D* subject() const;
- void setSubject(QDeclarativeItem3D* value);
-
- void applyTo(QMatrix4x4 *matrix) const;
- QGraphicsTransform3D *clone(QObject *parent) const;
-
-private Q_SLOTS:
- void subjectPositionChanged();
- void ancestryChanged();
-
-Q_SIGNALS:
- void preserveUpVectorChanged();
- void subjectChanged();
-
-private:
- QScopedPointer<QGraphicsLookAtTransformPrivate> d_ptr;
-
- Q_DISABLE_COPY(QGraphicsLookAtTransform)
- Q_DECLARE_PRIVATE(QGraphicsLookAtTransform)
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/imports/threed/qmldir b/src/imports/threed/qmldir
deleted file mode 100644
index 773d9a63..00000000
--- a/src/imports/threed/qmldir
+++ /dev/null
@@ -1 +0,0 @@
-plugin qthreedqmlplugin
diff --git a/src/imports/threed/qt3dnamespace.cpp b/src/imports/threed/qt3dnamespace.cpp
deleted file mode 100644
index 34878cd2..00000000
--- a/src/imports/threed/qt3dnamespace.cpp
+++ /dev/null
@@ -1,100 +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 "qt3dnamespace.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \qmlclass Qt3D Qt3DNamespace
- \brief The QML global object Qt3D provides useful functions for 3D applications.
- \ingroup qt3d::qml3d
-*/
-
-/*!
- \qmlmethod Qt3D::vector2d(real x, real y)
- Returns a Vector2D with the specified \c x and \c y.
-*/
-
-QVector2D Qt3DNamespace::vector2d(qreal x, qreal y)
-{
- return QVector2D(x, y);
-}
-
-/*!
- \qmlmethod Qt3D::vector4d(real x, real y, real z, real w)
- Returns a Vector4D with the specified \c x, \c y, \c z, and \c w.
-*/
-
-QVector4D Qt3DNamespace::vector4d(qreal x, qreal y, qreal z, qreal w)
-{
- return QVector4D(x, y, z, w);
-}
-
-/*!
- \qmlmethod Qt3D::quaternion(real scalar, real x, real y, real z)
- Returns a Quaternion with the specified \c scalar, \c x, \c y, and \c z.
-*/
-
-QQuaternion Qt3DNamespace::quaternion(qreal scalar, qreal x, qreal y, qreal z)
-{
- return QQuaternion(scalar, x, y, z);
-}
-
-/*!
- \qmlmethod Qt3D::matrix4x4(real m11, real m12, real m13, real m14, real m21, real m22, real m23, real m24, real m31, real m32, real m33, real m34, real m41, real m42, real m43, real m44)
- Returns a Matrix4x4 with the specified 16 components, which are specified
- in row-major order.
-*/
-
-QMatrix4x4 Qt3DNamespace::matrix4x4
- (qreal m11, qreal m12, qreal m13, qreal m14,
- qreal m21, qreal m22, qreal m23, qreal m24,
- qreal m31, qreal m32, qreal m33, qreal m34,
- qreal m41, qreal m42, qreal m43, qreal m44)
-{
- return QMatrix4x4(m11, m12, m13, m14,
- m21, m22, m23, m24,
- m31, m32, m33, m34,
- m41, m42, m43, m44);
-}
-
-QT_END_NAMESPACE
diff --git a/src/imports/threed/qt3dnamespace.h b/src/imports/threed/qt3dnamespace.h
deleted file mode 100644
index de65a070..00000000
--- a/src/imports/threed/qt3dnamespace.h
+++ /dev/null
@@ -1,78 +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 QT3DNAMESPACE_H
-#define QT3DNAMESPACE_H
-
-#include <QtCore/qobject.h>
-#include <QtCore/qvariant.h>
-#include <QtGui/qvector2d.h>
-#include <QtGui/qvector3d.h>
-#include <QtGui/qvector4d.h>
-#include <QtGui/qmatrix4x4.h>
-#include <QtGui/qquaternion.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-class Qt3DNamespace : public QObject
-{
- Q_OBJECT
-public:
- Qt3DNamespace(QObject *parent = 0) : QObject(parent) {}
- ~Qt3DNamespace() {}
-
-public Q_SLOTS:
- QVector2D vector2d(qreal x, qreal y);
- QVector4D vector4d(qreal x, qreal y, qreal z, qreal w);
- QQuaternion quaternion(qreal scalar, qreal x, qreal y, qreal z);
- QMatrix4x4 matrix4x4(qreal m11, qreal m12, qreal m13, qreal m14,
- qreal m21, qreal m22, qreal m23, qreal m24,
- qreal m31, qreal m32, qreal m33, qreal m34,
- qreal m41, qreal m42, qreal m43, qreal m44);
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // QT3DNAMESPACE_H
diff --git a/src/imports/threed/scale3d.cpp b/src/imports/threed/scale3d.cpp
deleted file mode 100644
index 7b2ede95..00000000
--- a/src/imports/threed/scale3d.cpp
+++ /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 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 "scale3d.h"
-
-QT_BEGIN_NAMESPACE
-
-void Scale3D::setScale(const QVariant &value)
-{
- QVector3D newScale;
- if (value.type() == QVariant::Vector3D) {
- newScale = value.value<QVector3D>();
- } else {
- bool ok = false;
- double val = value.toDouble(&ok);
- if (!ok) {
- qWarning("Scale3D: scale value is not a vector3D or single floating-point value");
- return;
- }
- newScale = QVector3D(qreal(val), qreal(val), qreal(val));
- }
- if (newScale != QGraphicsScale3D::scale()) {
- QGraphicsScale3D::setScale(newScale);
- emit variantScaleChanged();
- }
-}
-
-QGraphicsTransform3D *Scale3D::clone(QObject *parent) const
-{
- Scale3D *copy = new Scale3D(parent);
- copy->setOrigin(origin());
- copy->setScale(scale());
- return copy;
-}
-
-QT_END_NAMESPACE
diff --git a/src/imports/threed/scale3d.h b/src/imports/threed/scale3d.h
deleted file mode 100644
index a648bae2..00000000
--- a/src/imports/threed/scale3d.h
+++ /dev/null
@@ -1,80 +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 SCALE3D_H
-#define SCALE3D_H
-
-#include "qgraphicsscale3d.h"
-
-#include <QtCore/qvariant.h>
-#include <QtDeclarative/qdeclarative.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-class Scale3D : public QGraphicsScale3D
-{
- Q_OBJECT
- Q_PROPERTY(QVariant scale READ scale WRITE setScale NOTIFY variantScaleChanged)
-public:
- Scale3D(QObject *parent = 0) : QGraphicsScale3D(parent) {}
- ~Scale3D() {}
-
- QVariant scale() const { return QGraphicsScale3D::scale(); }
- void setScale(const QVariant &value);
-
- QGraphicsTransform3D *clone(QObject *parent) const;
-
-Q_SIGNALS:
- void variantScaleChanged();
-
-private:
- Q_DISABLE_COPY(Scale3D)
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(Scale3D)
-
-QT_END_HEADER
-
-#endif
diff --git a/src/imports/threed/shaderprogram.cpp b/src/imports/threed/shaderprogram.cpp
deleted file mode 100644
index 7b775b5b..00000000
--- a/src/imports/threed/shaderprogram.cpp
+++ /dev/null
@@ -1,979 +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 "shaderprogram.h"
-#include "shaderprogram_p.h"
-#include "qglabstracteffect.h"
-#include <QtOpenGL/qglshaderprogram.h>
-#include <QWeakPointer>
-
-#include <QDeclarativeEngine>
-#include <QDeclarativeContext>
-#include <QFile>
-
-#include "qglscenenode.h"
-/*!
- \qmlclass ShaderProgram ShaderProgram
- \brief The ShaderProgram item is derivative class of the more general Effect class in QML/3d.
- Whereas the Effect class provides support for standard effects under OpenGL, the ShaderProgramEffect supports effects based on custom shader programs for the GPU.
- \since 4.8
- \ingroup qt3d::qml3d
- \inherits Effect
-
- The ShaderProgram class provides Qml/3d users with the ability to use a QGLShaderProgram within the
- logical context of the normal \l Effect class provided by Qml/3d.
-
- If the system does not support shaders, then ShaderProgram will
- behave the same as \l Effect, with support for simple lit
- materials only.
-
- \section1 Attributes
-
- ShaderProgram provides a standard set of 8 vertex attributes that
- can be provided via the geometry \l Mesh:
-
- \table
- \header \o Shader Variable \o Mesh Attribute \o Purpose
- \row \o \c qt_Vertex \o QGL::Position
- \o The primary position of the vertex.
- \row \o \c qt_Normal \o QGL::Normal
- \o The normal at each vertex, for lit material effects.
- \row \o \c qt_Color \o QGL::Color
- \o The color at each vertex, for per-vertex color effects.
- \row \o \c qt_MultiTexCoord0 \o QGL::TextureCoord0
- \o The texture co-ordinate at each vertex for texture unit 0.
- \row \o \c qt_MultiTexCoord1 \o QGL::TextureCoord1
- \o Secondary texture co-ordinate at each vertex.
- \row \o \c qt_MultiTexCoord2 \o QGL::TextureCoord2
- \o Tertiary texture co-ordinate at each vertex.
- \row \o \c qt_Custom0 \o QGL::CustomVertex0
- \o First custom vertex attribute that can be used for any
- user-defined purpose.
- \row \o \c qt_Custom1 \o QGL::CustomVertex1
- \o Second custom vertex attribute that can be used for any
- user-defined purpose.
- \endtable
-
- These attributes are used in the vertexShader, as in the following
- example of a simple texture shader:
-
- \code
- attribute highp vec4 qt_Vertex;
- attribute highp vec4 qt_MultiTexCoord0;
- uniform mediump mat4 qt_ModelViewProjectionMatrix;
- varying highp vec4 texCoord;
-
- void main(void)
- {
- gl_Position = qt_ModelViewProjectionMatrix * qt_Vertex;
- texCoord = qt_MultiTexCoord0;
- }
- \endcode
-
- \section1 Standard uniform variables
-
- ShaderProgram provides a standard set of uniform variables for
- common values from the environment:
-
- \table
- \header \o Shader Variable \o Purpose
- \row \o \c qt_ModelViewProjectionMatrix
- \o Combination of the modelview and projection matrices into a
- single 4x4 matrix.
- \row \o \c qt_ModelViewMatrix
- \o Modelview matrix without the projection. This is typically
- used for performing calculations in eye co-ordinates.
- \row \o \c qt_ProjectionMatrix
- \o Projection matrix without the modelview.
- \row \o \c qt_NormalMatrix
- \o Normal matrix, which is the transpose of the inverse of the
- top-left 3x3 part of the modelview matrix. This is typically
- used in lighting calcuations to transform \c qt_Normal.
- \row \o \c qt_WorldMatrix
- \o Modelview matrix without the eye position and orientation
- component. See QGLPainter::worldMatrix() for further
- information.
- \row \o \c qt_Texture0
- \o Sampler holding the texture from the Effect::texture property.
- \row \o \c qt_Color
- \o Set to the value of the Effect::color property.
- \endtable
-
- The above variables are usually declared in the shaders as follows
- (where \c highp may be replaced with \c mediump or \c lowp depending
- upon the shader's precision requirements):
-
- \code
- uniform highp mat4 qt_ModelViewProjectionMatrix;
- uniform highp mat4 qt_ModelViewMatrix;
- uniform highp mat3 qt_NormalMatrix;
- uniform sampler2D qt_Texture0;
- uniform highp vec4 qt_Color;
- \endcode
-
- Other lighting and material values, such as the ambient, diffuse,
- and specular colors, can be passed to the shader program using
- custom uniform variables, or the standard variable names described
- in the QGLShaderProgramEffect documentation.
-
- \section1 Custom uniform variables
-
- Many properties defined on the ShaderProgram are automatically exposed as
- uniforms for the fragment and vertex shaders under the same name.
-
- QML and shader types do not match exactly, so the following table shows
- how QML properties should be declared in qml compared to shader programs:
-
- \table
- \header \o QML Property \o Shader Program Variable
-\row \o \code property double myDouble : 1.0 \endcode \o uniform highp float myDouble;
- \row \o \code property real myReal : 1.0 \endcode \o uniform mediump float myReal;
- \row \o \code property bool myBoolean : true \endcode \o uniform bool myBoolean;
- \row \o \code property int myInt : 1 \endcode \o uniform int myInt;
- \row \o \code property variant myPoint : Qt.point(1, 1) \endcode \o uniform mediump vec2 myPoint;
- \row \o \code property variant myPointF : Qt.point(1.0, 1.0) \endcode \o uniform mediump vec2 myPointF;
- \row \o \code property variant mySize : Qt.size(1.0, 1.0) \endcode \o uniform mediump vec2 mySize;
- \row \o \code property color myColor : "#80c342" \endcode \o uniform lowp vec4 myColor;
- \row \o \code property variant myMatrix3x3 :
- [1.0, 0.0, 0.0,
- 0.0, 1.0, 0.0,
- 0.0, 0.0, 1.0] \endcode \o uniform mat3 myMatrix3x3;
- \row \o \code property variant myMatrix4x4 :
- [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 ]\endcode \o uniform mat4 myMatrix4x4;
- \row \o \code property string imageExample :
- "http://example.com/image.png" \endcode \o uniform sampler2D imageExample;
- \endtable
-
- Note: The precision hints in this table are just examples. highp,
- mediump, and lowp do not map directly onto floats, doubles, colors etc.
- Choose the most appropriate variable type for your qml or javascript, and
- the most appropriate precision for your shader program.
-
- Be aware that variant properties in general and matrices in particular
- can have significant performance implications. Conversion from variants
- can be slow, and matrices can consume multiple slots for uniforms, which
- are usually limited by hardware.
-
- String properties are assumed to be urls to images for use in textures.
- Where these images are remote, they are loaded in the background and bound
- to the effect when they are ready.
- \sa QGLGraphicsViewportItem
-*/
-
-class ShaderProgramEffect;
-QT_BEGIN_NAMESPACE
-
-class ShaderProgramPrivate
-{
-public:
- ShaderProgramPrivate()
- : regenerate(false)
- , shadersSupported(true) // Assume supported until known otherwise.
- , effect(0)
- {
- }
-
- QString vertexShader;
- QString fragmentShader;
- QUrl vertexShaderSource;
- QUrl fragmentShaderSource;
- bool regenerate;
- bool shadersSupported;
- ShaderProgramEffect *effect;
-};
-
-
-/*
- \internal
- Construction for the ShaderProgramEffect class consists of setting the key parameter values of the
- class to undefined. As such, a shader program effect with no further initialisation will do nothing at all
- until further creation of shader programs for it has been carried out.
-*/
-ShaderProgramEffect::ShaderProgramEffect(ShaderProgram* parent)
-{
- this->parent = parent;
- nextTextureUnit = 1;
- propertyListener = new ShaderProgramPropertyListenerEx(parent, this);
-}
-
-/*
- \internal
- Destruction entails deletion of the underlying \l QGLShaderProgram which forms the functional core of the
- class.
-*/
-ShaderProgramEffect::~ShaderProgramEffect()
-{
- QList<QGLTexture2D*> textures = texture2Ds.values();
- QGLTexture2D* texture;
- foreach (texture, textures)
- delete texture;
-}
-
-/*
- \internal
- The act of shader programe creation can be undertakn in the manner defined for the QGLShaderProgram class.
- Failure to successfully carry out creation will result in a warning message. Success will auto-populate the
- parameter fields of the ShaderProgramEffect with the necessary values based on the shader program.
-
- The vertex shader source is defined as a QString in the \a vertexShader parameter, while the fragment shader
- is provided in the \a fragmentShader parameter.
-*/
-bool ShaderProgramEffect::create
- (const QString& vertexShader, const QString& fragmentShader)
-{
- if (!QGLShaderProgram::hasOpenGLShaderPrograms())
- return false;
-
- setVertexShader(vertexShader.toLatin1());
- setFragmentShader(fragmentShader.toLatin1());
-
- return true;
-}
-
-/*!
- \internal
- Convenience function to setup the relationship between object properties
- and shader uniforms for later use.
- */
-void ShaderProgramEffect::afterLink()
-{
- propertyIdsToUniformLocations.clear();
- uniformLocationsToTextureUnits.clear();
- nextTextureUnit = 1;
- propertyListener->disconnect();
- if (parent.data() == 0)
- {
- return;
- }
- QObject::connect(propertyListener, SIGNAL(propertyChanged()), parent.data(), SIGNAL(effectChanged()));
-
- const QMetaObject* parentMetaObject = parent.data()->metaObject();
- int parentMethodCount = parentMetaObject->methodCount();
-
- for (int i = parentMetaObject->propertyOffset();
- i < parentMetaObject->propertyCount(); i++)
- {
- QMetaProperty metaProperty = parentMetaObject->property(i);
- QByteArray propertyName = metaProperty.name();
- int location = program()->uniformLocation(propertyName);
- // -1 indicates that the program does not use the variable,
- // so ignore those variables.
- if (location != -1)
- {
- dirtyProperties.append(i);
- propertyIdsToUniformLocations[i] = location;
- if (metaProperty.hasNotifySignal())
- {
- QMetaMethod notifySignal = metaProperty.notifySignal();
-
- int signalIndex = notifySignal.methodIndex();
-
- // Connect the myFooChanged() signal from the ShaderProgram
- // to the corresponding imaginary slot on the listener
- // Use the method count to make sure that we don't stomp on
- // real methods and add the property index to tell the
- // properties apart.
- // Warning: Subclasses of ShaderProgramPropertyListener will
- // generate spurious property updates and lots of warnings
- // and might even crash
- QMetaObject::connect(parent.data(), signalIndex,
- propertyListener, parentMethodCount + i);
- } else {
- qWarning() << "Warning: No notification signal found for property: " << propertyName;
- propertiesWithoutNotificationSignal.append(i);
- }
- }
- }
-
- // Refresh everything
- this->setPropertiesDirty();
-}
-
-/*!
- \internal
- Precondition: list is a list of floats
- */
-static inline void setUniformFromFloatList(QGLShaderProgram *program, int uniformLocation, QList<QVariant> list)
-{
- switch(list.length())
- {
- case 1:
- program->setUniformValue(uniformLocation, list.at(0).toFloat());
- break;
- case 2:
- program->setUniformValue(uniformLocation,
- list.at(0).toFloat(),
- list.at(1).toFloat());
- break;
- case 3:
- program->setUniformValue(uniformLocation,
- list.at(0).toFloat(),
- list.at(1).toFloat(),
- list.at(2).toFloat());
- break;
- case 4:
- program->setUniformValue(uniformLocation,
- list.at(0).toFloat(),
- list.at(1).toFloat(),
- list.at(2).toFloat(),
- list.at(3).toFloat());
- break;
- case 9:
- {
- QMatrix3x3 matrix;
- for (int i = 0; i < 9; i++)
- {
- matrix(i / 3, i % 3) = list.at(i).toFloat();
- }
- program->setUniformValue(uniformLocation, matrix);
- }
- break;
- case 16:
- {
- QMatrix4x4 matrix;
- for (int i = 0; i < 16; i++)
- {
- matrix( i / 4, i % 4) = list.at(i).toFloat();
- }
- program->setUniformValue(uniformLocation, matrix);
- }
- break;
- default:
- // Very little information available to make this warning any more helpful
- qWarning() << "Warning: unexpected list size: " << list.size() << ", only 1-4, 9 and 16 supported";
- }
-}
-
-/*!
- \internal
- This performs all updates for the shader program given a QGLPainter \a painter, and the type of update
- being carried out based on the \a updates field, which is an enumeration of the possible painter updates.
-*/
-void ShaderProgramEffect::update
- (QGLPainter *painter, QGLPainter::Updates updates)
-{
- if (changedTextures.count() > 0)
- {
- foreach (int i, changedTextures)
- {
- if (!images.contains(i))
- {
- changedTextures.remove(i);
- continue;
- }
-
- if (!images[i].isNull())
- {
- setUniform(i, images[i], painter);
- } else
- {
- qWarning() << "Warning: ShaderProgramEffect failed to apply texture for uniform" << i << (urls.contains(i) ? QLatin1String(" url: ") + urls[i] : QString());
- }
- changedTextures.remove(i);
- }
- }
-
- // Update the standard uniform variables.
- QGLShaderProgramEffect::update(painter, updates);
-
- // Assign custom properties if they exist
- if (!parent.data() || !(propertyIdsToUniformLocations.count() > 0))
- return;
-
- // update dirty properties and remove them from the list
- int propertyIndex;
- QList<int> propertiesNotUpdated;
- foreach (propertyIndex, dirtyProperties)
- {
- if (!setUniformForPropertyIndex(propertyIndex, painter))
- {
- propertiesNotUpdated.append(propertyIndex);
- };
- }
- dirtyProperties.clear();
- dirtyProperties.append(propertiesNotUpdated);
-
- // always update the properties we can't track
- foreach (propertyIndex, propertiesWithoutNotificationSignal)
- {
- setUniformForPropertyIndex(propertyIndex, painter);
- }
-}
-
-inline QGLTexture2D* ShaderProgramEffect::textureForUniformValue(int uniformLocation)
-{
- QGLTexture2D* result = texture2Ds.value(uniformLocation);
- if (result == 0)
- {
- result = new QGLTexture2D();
- texture2Ds[uniformLocation] = result;
- }
- return result;
-}
-
-inline bool ShaderProgramEffect::setUniformForPropertyIndex(int propertyIndex, QGLPainter *painter)
-{
- QGLShaderProgram *program = this->program();
- int uniformLocation = propertyIdsToUniformLocations[propertyIndex];
-
- QVariant value =
- parent.data()->metaObject()->property(propertyIndex).read(parent.data());
-
- switch(value.type())
- {
- case QVariant::Double:
- // Convert double to float to pass to shader program
- case QMetaType::Float:
- program->setUniformValue(uniformLocation, value.toFloat());
- break;
- case QVariant::Int:
- program->setUniformValue(uniformLocation, value.toInt());
- break;
- case QVariant::UInt:
- program->setUniformValue(uniformLocation, value.toUInt());
- break;
- case QVariant::Bool:
- program->setUniformValue(uniformLocation, value.toBool());
- break;
- case QVariant::Color:
- program->setUniformValue(uniformLocation, value.value<QColor>());
- break;
- case QVariant::List:
- setUniformFromFloatList(program, uniformLocation, value.toList());
- break;
- case QVariant::Point:
- program->setUniformValue(uniformLocation, value.toPoint());
- break;
- case QVariant::PointF:
- program->setUniformValue(uniformLocation, value.toPointF());
- break;
- case QVariant::Size:
- program->setUniformValue(uniformLocation, value.toSize());
- break;
- case QVariant::SizeF:
- program->setUniformValue(uniformLocation, value.toSizeF());
- break;
- case QVariant::Matrix4x4:
- program->setUniformValue(uniformLocation, value.value<QMatrix4x4>());
- break;
- case QVariant::Vector2D:
- program->setUniformValue(uniformLocation, value.value<QVector2D>());
- break;
- case QVariant::Vector3D:
- program->setUniformValue(uniformLocation, value.value<QVector3D>());
- break;
- case QVariant::Vector4D:
- program->setUniformValue(uniformLocation, value.value<QVector4D>());
- break;
- case QVariant::String:
- {
- // We assume strings are URLs to images for textures
- QString urlString = value.toString();
- processTextureUrl(uniformLocation, urlString);
- }
- break;
- case QVariant::Image:
- {
- QImage image(value.toString());
- setUniform(uniformLocation, image, painter);
- }
- break;
- default:
- qWarning() << "Unrecognized variant for property " << parent.data()->metaObject()->property(propertyIndex).name() << " of type " << value.typeName() << ", could not set corresponding shader variable";
- }
- return true;
-}
-
-/*!
- \internal Helper function for applying a \a pixmap to a texture for a shader program. This function should be called from within update() in order to have access to the right GL context through the \a painter.
- */
-void ShaderProgramEffect::setUniform
- (int uniformLocation, const QPixmap pixmap, QGLPainter* painter)
-{
- // TODO: Perspective correction
- QGLTexture2D* texture = textureForUniformValue(uniformLocation);
- int unit = textureUnitForUniformValue(uniformLocation);
- if (texture != 0)
- {
- texture->setPixmap(pixmap);
- painter->glActiveTexture(GL_TEXTURE0 + unit);
- texture->bind();
- program()->setUniformValue(uniformLocation, unit);
- }
-}
-
-/*!
- \internal Helper function for applying an \a images to a texture for a shader program. This function should be called from within update() in order to have access to the right GL context through the \a painter.
- */
-void ShaderProgramEffect::setUniform
- (int uniformLocation, const QImage& image, QGLPainter* painter)
-{
- // TODO: Perspective correction
- QGLTexture2D* texture = textureForUniformValue(uniformLocation);
- int unit = textureUnitForUniformValue(uniformLocation);
- if (texture != 0)
- {
- texture->setImage(image);
- painter->glActiveTexture(GL_TEXTURE0 + unit);
- texture->bind();
- program()->setUniformValue(uniformLocation, unit);
- }
-}
-
-/*!
- \internal Find the texture unit to associate with \a uniformLocation.
-*/
-int ShaderProgramEffect::textureUnitForUniformValue(int uniformLocation)
-{
- int unit = uniformLocationsToTextureUnits.value(uniformLocation, -1);
- if (unit == -1) {
- unit = nextTextureUnit++;
- uniformLocationsToTextureUnits[uniformLocation] = unit;
- }
- return unit;
-}
-
-/*!
- \internal set all properties dirty so they are reuploaded
- next update()
- */
-void ShaderProgramEffect::setPropertiesDirty()
-{
- dirtyProperties = this->propertyIdsToUniformLocations.keys();
-}
-
-/*!
- \internal Set a specific property as dirty so that it is reuploaded
- next update()
- */
-void ShaderProgramEffect::setPropertyDirty(int property)
-{
- if (dirtyProperties.indexOf(property) == -1)
- {
- dirtyProperties.append(property);
- }
-}
-
-/*!
- \internal Update the image for the texture bound at \a uniform location with
- the the image at \a urlString. If \a urlString is a remote resource, this
- starts an asycnrounous loading process.
-
- Note: Consecutive calls with the same url for a given uniform are ignored.
-*/
-void ShaderProgramEffect::processTextureUrl(int uniformLocation, QString urlString)
-{
- QUrl url(urlString);
- if (urlString.isEmpty() &&
- urls.contains(uniformLocation) &&
- !urls[uniformLocation].isNull())
- {
- if (images.contains(uniformLocation) && !images[uniformLocation].isNull())
- {
- images[uniformLocation] = QImage();
- urls.remove(uniformLocation);
- changedTextures.insert(uniformLocation);
- return;
- }
- };
-
- bool async = true;
- // Try to make path absolute:
- if (url.isRelative())
- {
- async = false;
- // Get the baseUrl from the declarative engine
- QDeclarativeContext *context =
- QDeclarativeEngine::contextForObject(parent.data());
-
- if (context)
- {
- QUrl baseurl = context->baseUrl();
- QUrl absolute = baseurl.resolved(urlString);
-
- if (absolute.isValid())
- {
- url = absolute;
- urlString = absolute.toString();
- } else {
- qWarning() << "Warning: failed to resolve relative path " <<
- urlString;
- }
- }
- };
-
- if (urlString != urls[uniformLocation])
- {
- if (url.scheme() != QLatin1String("file"))
- {
- // TODO - support network URL's for loading - note that this feature is for
- // the Qt3D 1.1 release and there is no point in implementing it until for example
- // model loading and all other parts of Qt3D support it. Also when it is implemented
- // it has to be done with a facility that does not depend on private headers in
- // QtDeclarative which can change within minor dot-point releases.
- qWarning("Network URL's not yet supported - %s", qPrintable(urlString));
- }
- else
- {
- QString localFile = url.toLocalFile();
- if (localFile.endsWith(QLatin1String(".dds")))
- {
- qWarning("Shader effects with compressed textures not supported: %s",
- qPrintable(urlString));
- }
- else
- {
- QImage im(localFile);
- if (im.isNull())
- {
- qWarning("Could not load image from local file path - %s", qPrintable(localFile));
- }
- else
- {
- images[uniformLocation] = im;
- changedTextures.insert(uniformLocation);
- }
- }
- }
- }
-}
-
-/*!
- \internal
- Construction of the shader program and assignment of its \a parent object.
-*/
-ShaderProgram::ShaderProgram(QObject *parent)
- : QDeclarativeEffect(parent)
-{
- d = new ShaderProgramPrivate();
-}
-
-/*!
- \internal
- Destruction of the ShaderProgram entails deletion of private data, and explicit deletion of the
- underlying ShaderProgramEffect defined by the class.
-*/
-ShaderProgram::~ShaderProgram()
-{
- delete d->effect;
- delete d;
-}
-
-/*!
- \qmlproperty string ShaderProgram::vertexShader
-
- This property defines the source for the vertex shader to be implemented by this
- instance of the ShaderProgram. This property and the vertexShaderSource()
- property both effect the same underlying object, so setting one will override
- the other.
-
- \sa fragmentShader, vertexShaderSource
-*/
-QString ShaderProgram::vertexShader() const
-{
- return d->vertexShader;
-}
-
-void ShaderProgram::setVertexShader(const QString& value)
-{
- if (!d->vertexShaderSource.isEmpty() || value != d->vertexShader)
- {
- d->vertexShader = value;
- d->regenerate = true;
- d->vertexShaderSource = QUrl();
- emit shaderChanged();
- emit effectChanged();
- }
-}
-
-/*!
- \qmlproperty string ShaderProgram::fragmentShader
- This property defines the source for the fragment shader (ie. pixel shader) to be
- implemented by this instance of the ShaderProgram. This property and the
- fragmentShaderSource() property both effect the same underlying object, so
- setting one will override the other.
-
- \sa vertexShader, fragmentShaderSource
-*/
-QString ShaderProgram::fragmentShader() const
-{
- return d->fragmentShader;
-}
-
-void ShaderProgram::setFragmentShader(const QString& value)
-{
- if (!d->fragmentShaderSource.isEmpty() || value != d->fragmentShader)
- {
- d->fragmentShader = value;
- d->regenerate = true;
- d->fragmentShaderSource = QUrl();
- emit shaderChanged();
- emit effectChanged();
- }
-}
-
-/*!
- \qmlproperty QUrl ShaderProgram::vertexShaderSource
- This property allows the source for the vertex shader to be set to the contents
- of a file containing shader source code. This property and the vertexShader()
- property both effect the same underlying object, so setting one will override
- the other.
-
- Note that at present networked URLs are not supported, only local files. If a
- URL has not been set for the vertex shader, for example because it was
- specified via the vertexShader() in-line shader code property, then this property
- will return a null (empty) QUrl.
-
- \sa vertexShader, fragmentShaderSource
-*/
-QUrl ShaderProgram::vertexShaderSource() const
-{
- return d->vertexShaderSource;
-}
-
-void ShaderProgram::setVertexShaderSource(const QUrl &url)
-{
- if (!url.isEmpty() && url.isValid() && url != d->vertexShaderSource)
- {
- if (url.scheme() == QLatin1String("file"))
- {
- QString fn = url.toLocalFile();
- QFile vs(fn);
- if (vs.open(QIODevice::ReadOnly))
- {
- d->vertexShader = vs.readAll();
- d->vertexShaderSource = url;
- emit shaderChanged();
- emit effectChanged();
- d->regenerate = true;
- }
- else
- {
- qWarning() << "Unable to read" << url;
- }
- }
- else
- {
- qWarning() << "vertexShaderSource property does not (yet) support non-file URLs";
- }
- }
-}
-
-/*!
- \qmlproperty QUrl ShaderProgram::fragmentShaderSource
- This property allows the source for the fragment shader to be set to the contents
- of a file containing shader source code. This property and the vertexShader()
- property both effect the same underlying object, so setting one will override
- the other.
-
- Note that at present networked URLs are not supported, only local files. If a
- URL has not been set for the fragment shader, for example because it was
- specified via the fragmentShader() in-line shader code property, then this property
- will return a null (empty) QUrl.
-
- \sa fragmentShader, vertexShaderSource
-*/
-QUrl ShaderProgram::fragmentShaderSource() const
-{
- return d->fragmentShaderSource;
-}
-
-void ShaderProgram::setFragmentShaderSource(const QUrl &url)
-{
- if (!url.isEmpty() && url.isValid() && url != d->fragmentShaderSource)
- {
- if (url.scheme() == QLatin1String("file"))
- {
- QString fn = url.toLocalFile();
- QFile fs(fn);
- if (fs.open(QIODevice::ReadOnly))
- {
- d->fragmentShader = fs.readAll();
- d->fragmentShaderSource = url;
- emit shaderChanged();
- emit effectChanged();
- d->regenerate = true;
- }
- else
- {
- qWarning() << "Unable to read fragment shader" << url;
- }
- }
- else
- {
- qWarning() << "fragmentShaderSource property does not (yet) support non-file URLs";
- }
- }
-}
-
-/*!
- \internal
- Enables the effect for a given \a painter. If the effect has not been created yet, this function will
- attempt to do so.
-*/
-void ShaderProgram::enableEffect(QGLPainter *painter)
-{
- if (!d->shadersSupported && !d->regenerate) {
- // Use a simple fallback effect.
- QDeclarativeEffect::enableEffect(painter);
- return;
- }
- if (!d->effect) {
- // note that the ShaderProgramEffect can also be created when this
- // effect is applied to a QGLSceneNode if that happens first
- d->effect = new ShaderProgramEffect(this);
- if (!d->effect->create(d->vertexShader, d->fragmentShader)) {
- delete d->effect;
- d->effect = 0;
- QDeclarativeEffect::enableEffect(painter);
- d->regenerate = false;
- d->shadersSupported = false;
- return;
- }
- d->shadersSupported = true;
- } else if (d->regenerate) {
- if (!d->effect->create(d->vertexShader, d->fragmentShader)) {
- delete d->effect;
- d->effect = 0;
- QDeclarativeEffect::enableEffect(painter);
- d->regenerate = false;
- d->shadersSupported = false;
- return;
- }
- d->shadersSupported = true;
- }
- d->regenerate = false;
- painter->setUserEffect(d->effect);
- painter->setColor(color());
- QGLTexture2D *tex = texture2D();
- painter->glActiveTexture(GL_TEXTURE0);
- if (tex)
- tex->bind();
- else
- glBindTexture(GL_TEXTURE_2D, 0);
-}
-
-/*!
- \internal
- Set a scenenode's material and effect properties to enact this effect.
-
- This can happen before glInitialize, so setup is delayed until the effect is
- used or explicitly initialized.
-*/
-void ShaderProgram::applyTo(QGLSceneNode *node)
-{
- if (!d->effect) {
- // This function is often called during setup, before glInitilization,
- // so create the effect now, and then initializion it later.
- d->effect = new ShaderProgramEffect(this);
- d->regenerate = true;
- }
- node->setUserEffect(d->effect);
-}
-
-/*!
- \internal
- Mark all properties as dirty to be re-uploaded in the next update
-*/
-void ShaderProgram::markAllPropertiesDirty()
-{
- d->effect->setPropertiesDirty();
-}
-
-/*!
- \internal
- Mark a \a property as dirty to be re-uploaded in the next update
- */
-void ShaderProgram::markPropertyDirty(int property)
-{
- d->effect->setPropertyDirty(property);
-}
-
-/*!
- \qmlsignal ShaderProgram::onFinishedLoading()
- Emitted when the last remote resource request is resolved, and implies that
- the effect is ready to be displayed.
-*/
-
-/*!
- \internal
- A subclass without the Q_OBJECT macro in order to use the qt_metacall trick to track property changes.
-
- It is also conveniently placed to connect appropriate properties to
- Effect::effectChanged() to trigger timely updates.
- */
-ShaderProgramPropertyListenerEx::ShaderProgramPropertyListenerEx(ShaderProgram *parent, ShaderProgramEffect* effect)
- : ShaderProgramPropertyListener(parent), effect(effect)
-{
- shaderProgramMethodCount = parent->metaObject()->methodCount();
-}
-
-/*!
- \internal
-*/
-ShaderProgramPropertyListenerEx::~ShaderProgramPropertyListenerEx()
-{
-}
-
-/*!
- \internal
- Find calls to the "imaginary" slots, and mark the appropriate property
- as dirty.
-*/
-int ShaderProgramPropertyListenerEx::qt_metacall(QMetaObject::Call c, int id, void **a)
-{
- if (c == QMetaObject::InvokeMetaMethod )
- {
- if (id >= shaderProgramMethodCount) {
- effect->setPropertyDirty(id - shaderProgramMethodCount);
- emit propertyChanged();
- }
- // Consume the metacall
- return -1;
- }
-
- return ShaderProgramPropertyListener::qt_metacall(c, id, a);
-}
-
-QT_END_NAMESPACE
diff --git a/src/imports/threed/shaderprogram.h b/src/imports/threed/shaderprogram.h
deleted file mode 100644
index d1986614..00000000
--- a/src/imports/threed/shaderprogram.h
+++ /dev/null
@@ -1,95 +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 SHADERPROGRAM_H
-#define SHADERPROGRAM_H
-
-#include "qdeclarativeeffect.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-class ShaderProgramPrivate;
-class QGLSceneNode;
-
-class ShaderProgram : public QDeclarativeEffect
-{
- Q_OBJECT
- Q_PROPERTY(QString vertexShader READ vertexShader WRITE setVertexShader NOTIFY shaderChanged)
- Q_PROPERTY(QString fragmentShader READ fragmentShader WRITE setFragmentShader NOTIFY shaderChanged)
- Q_PROPERTY(QUrl vertexShaderSource READ vertexShaderSource WRITE setVertexShaderSource NOTIFY shaderChanged)
- Q_PROPERTY(QUrl fragmentShaderSource READ fragmentShaderSource WRITE setFragmentShaderSource NOTIFY shaderChanged)
-public:
- ShaderProgram(QObject *parent = 0);
- virtual ~ShaderProgram();
-
- QString vertexShader() const;
- void setVertexShader(const QString& value);
-
- QString fragmentShader() const;
- void setFragmentShader(const QString& value);
-
- QUrl vertexShaderSource() const;
- void setVertexShaderSource(const QUrl &url);
-
- QUrl fragmentShaderSource() const;
- void setFragmentShaderSource(const QUrl &url);
-
- virtual void enableEffect(QGLPainter *painter);
- virtual void applyTo(QGLSceneNode *node);
-public Q_SLOTS:
- void markAllPropertiesDirty();
- void markPropertyDirty(int property);
-Q_SIGNALS:
- void finishedLoading();
- void shaderChanged();
-private:
- ShaderProgramPrivate *d;
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(ShaderProgram)
-
-QT_END_HEADER
-
-#endif
diff --git a/src/imports/threed/shaderprogram_p.h b/src/imports/threed/shaderprogram_p.h
deleted file mode 100644
index 6b67c4ce..00000000
--- a/src/imports/threed/shaderprogram_p.h
+++ /dev/null
@@ -1,152 +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 SHADERPROGRAM_P_H
-#define SHADERPROGRAM_P_H
-
-#include <QtCore/qsharedpointer.h>
-#include <QtOpenGL/qglshaderprogram.h>
-
-#include "qdeclarativeeffect.h"
-#include "qglshaderprogrameffect.h"
-
-QT_BEGIN_NAMESPACE
-
-class ShaderProgram;
-class ShaderProgramEffect;
-
-/*!
- \internal
- This class's purpose is to be a proxy for signals for the main shader
- program.
-
- This is necessary so the qt_metacall trick can be used to tell apart
- the update signals from QML generated properties. (In short, each update
- signal is connected to an imaginary slot, but calling the slot is
- intercepted and replaced by a call to the appropriate update function).
-*/
-class ShaderProgramPropertyListener : public QObject
-{
- Q_OBJECT
-public:
- ShaderProgramPropertyListener(QObject* parent = 0)
- : QObject(parent)
- {
- }
- virtual ~ShaderProgramPropertyListener()
- {
- }
-Q_SIGNALS:
- void propertyChanged();
-};
-
-/*!
- \internal
- \sa ShaderProgramPropertyListener
-*/
-class ShaderProgramPropertyListenerEx : public ShaderProgramPropertyListener
-{
-public:
- ShaderProgramPropertyListenerEx(ShaderProgram* parent, ShaderProgramEffect* effect);
- ~ShaderProgramPropertyListenerEx();
-
-protected:
- virtual int qt_metacall(QMetaObject::Call c, int id, void **a);
- ShaderProgramEffect* effect;
-private:
- int shaderProgramMethodCount;
-};
-
-
-/*!
- \internal
- The ShaderProgramEffect class underlies the ShaderProgram class in Qml/3d.
- It contains the actual QGLShaderProgram along with all of the necessary
- parameters to use that program.
-*/
-class ShaderProgramEffect : public QGLShaderProgramEffect
-{
-public:
- ShaderProgramEffect(ShaderProgram* parent);
- virtual ~ShaderProgramEffect();
-
- bool create(const QString& vertexShader, const QString& fragmentShader);
-
- void update(QGLPainter *painter, QGLPainter::Updates updates);
- bool setUniformForPropertyIndex(int propertyIndex, QGLPainter *painter);
-
- void setPropertiesDirty();
- void setPropertyDirty(int property);
-
- void setAttributeFields(QGL::VertexAttribute fields);
-protected:
- void processTextureUrl(int uniformLocation, QString urlString);
- void afterLink();
-
-private:
- void setUniform(int uniformValue, const QImage& image,
- QGLPainter* painter);
- void setUniform(int uniformValue, const QPixmap pixmap,
- QGLPainter* painter);
- QGLTexture2D* textureForUniformValue(int uniformLocation);
- int textureUnitForUniformValue(int uniformLocation);
-
- QWeakPointer<ShaderProgram> parent;
- int nextTextureUnit;
- QMap<int, int> propertyIdsToUniformLocations;
- QMap<int, int> uniformLocationsToTextureUnits;
- QList<int> dirtyProperties;
- QArray<int> propertiesWithoutNotificationSignal;
- ShaderProgramPropertyListener* propertyListener;
-
- // Thes maps are all referenced by uniform location
- QMap<int, QGLTexture2D*> texture2Ds;
- QMap<int, QImage> images;
- QMap<int, QString> urls;
-
- // These are sets of uniform locations
- QSet<int> loadingTextures;
- QSet<int> changedTextures;
-};
-
-QT_END_NAMESPACE
-
-#endif // SHADERPROGRAM_P_H
diff --git a/src/imports/threed/skybox.cpp b/src/imports/threed/skybox.cpp
deleted file mode 100644
index aa0edbbc..00000000
--- a/src/imports/threed/skybox.cpp
+++ /dev/null
@@ -1,339 +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 "skybox.h"
-#include "qglbuilder.h"
-#include "qglcube.h"
-#include "qglpainter.h"
-#include "qglview.h"
-#include "viewport.h"
-
-#include <QDir>
-#include <QFileInfo>
-#include <QEvent>
-
-/*!
- \qmlclass Skybox Skybox
- \brief The Skybox item provides a simple 6-texture environment.
- \since 4.8
- \ingroup qt3d::qml3d
-
- The six textures of the Skybox completely encloses the camera,
- giving the illusion of a full 3D environment. Although the illusion
- is far from perfect it is adequate for many simple purposes. It is
- most suited to sky, clouds, remote landscapes (such as mountains) or
- possibly city skylines - anything where the textures represent an
- environment that is effectively infinitely distant from the camera.
-
- To use a skybox create a directory with six appropriately named images
- and place this alongside the main qml file, then specify the directory
- name for the \l{source} property:
-
- \code
- Viewport {
-
- Skybox {
- source: "skybox"
- }
-
- Cube { }
- }
- \endcode
-
- For an illustration of its use see the flickr3d example.
-*/
-const char * Skybox::EXPECTED_NAMES[] = {
- "_west", "_up", "_east", "_down", "_south", "_north", 0 };
-
-Skybox::Skybox(QObject *parent)
- : m_ready(false)
- , m_scene(0)
- , m_view(0)
- , m_camera(new QGLCamera(this))
-{
- m_view = qobject_cast<Viewport*>(parent);
-
- //Set the eye to to 0,0,0 and the near plane/view size such that
- //a wide variety of aspect ratios will display without undue
- //cropping against the near plane.
- m_camera->setEye(QVector3D());
- m_camera->setNearPlane(0.1f);
- m_camera->setViewSize(QSizeF(0.17f, 0.17f));
-
- QGLBuilder builder;
- builder.newSection(QGL::Faceted);
- QVector3D blb(-1.0, -1.0, -1.0);
- QVector3D blf(-1.0, -1.0, 1.0);
- QVector3D tlf(-1.0, 1.0, 1.0);
- QVector3D tlb(-1.0, 1.0, -1.0);
- QVector3D brb(1.0, -1.0, -1.0);
- QVector3D brf(1.0, -1.0, 1.0);
- QVector3D trf(1.0, 1.0, 1.0);
- QVector3D trb(1.0, 1.0, -1.0);
- QVector2D bl(0.0f, 0.0f);
- QVector2D br(1.0f, 0.0f);
- QVector2D tr(1.0f, 1.0f);
- QVector2D tl(0.0f, 1.0f);
- {
- QGeometryData q; // left
- builder.currentNode()->setObjectName("left");
- q.appendVertex(blf, blb, tlb, tlf);
- q.appendTexCoord(bl, br, tr, tl);
- builder.addQuads(q);
- m_faces[0] = builder.currentNode();
- m_faces[0]->setMaterial(new QGLMaterial);
- }
- {
- builder.newNode(); // top
- builder.currentNode()->setObjectName("top");
- QGeometryData q;
- q.appendVertex(trf, tlf, tlb, trb);
- q.appendTexCoord(bl, br, tr, tl);
- builder.addQuads(q);
- m_faces[1] = builder.currentNode();
- m_faces[1]->setMaterial(new QGLMaterial);
- }
- {
- builder.newNode(); // right
- builder.currentNode()->setObjectName("right");
- QGeometryData q;
- q.appendVertex(brb, brf, trf, trb);
- q.appendTexCoord(bl, br, tr, tl);
- builder.addQuads(q);
- m_faces[2] = builder.currentNode();
- m_faces[2]->setMaterial(new QGLMaterial);
- }
- {
- builder.newNode(); // bottom
- builder.currentNode()->setObjectName("bottom");
- QGeometryData q;
- q.appendVertex(brb, blb, blf, brf);
- q.appendTexCoord(bl, br, tr, tl);
- builder.addQuads(q);
- m_faces[3] = builder.currentNode();
- m_faces[3]->setMaterial(new QGLMaterial);
- }
- {
- builder.newNode(); // front
- builder.currentNode()->setObjectName("front");
- QGeometryData q;
- q.appendVertex(brf, blf, tlf, trf);
- q.appendTexCoord(bl, br, tr, tl);
- builder.addQuads(q);
- m_faces[4] = builder.currentNode();
- m_faces[4]->setMaterial(new QGLMaterial);
- }
- {
- builder.newNode(); // back
- builder.currentNode()->setObjectName("back");
- QGeometryData q;
- q.appendVertex(blb, brb, trb, tlb);
- q.appendTexCoord(bl, br, tr, tl);
- builder.addQuads(q);
- m_faces[5] = builder.currentNode();
- m_faces[5]->setMaterial(new QGLMaterial);
- }
- m_scene = builder.finalizedSceneNode();
- m_scene->setObjectName("SkyboxList");
- m_scene->setEffect(QGL::FlatReplaceTexture2D);
- m_scene->setEffectEnabled(true);
- m_scene->setParent(this);
-}
-
-/*!
- \internal
- Destroy this skybox returning all resources
-*/
-Skybox::~Skybox()
-{
-
-}
-/*!
- \internal
-
- Implement the event property to catch when the skybox is placed into a
- viewport parent.
-*/
-bool Skybox::event(QEvent *event)
-{
- if (event->type() == QEvent::ParentChange && !m_view)
- {
- setViewport(qobject_cast<Viewport*>(parent()));
- }
- return QObject::event(event);
-}
-
-/*!
- \qmlproperty Viewport Mesh::viewport
-
- This property holds the viewport which this Skybox will be displayed
- inside. The skybox will completely fill the viewport, but since it is
- drawn first, and with depth buffering off, all other content in the
- given viewport will overlay the skybox making it appear infinitely
- distant.
-
- Generally this property should not need to be set as the skybox can be
- simply placed inside the viewport element in which it should display.
-*/
-void Skybox::setViewport(Viewport *view)
-{
- if (m_view != view)
- {
- m_view = view;
- emit viewportChanged();
- }
-}
-
-void Skybox::scanLocalDir(const QString &imagePath)
-{
- m_imagePath = imagePath;
- QStringList notFound;
- const char **exp = EXPECTED_NAMES;
- for ( ; *exp; ++exp)
- notFound << QLatin1String(*exp);
- QFileInfo info(m_imagePath);
- if (info.exists() && info.isDir())
- {
- QDir imDir(imagePath);
- QFileInfoList files = imDir.entryInfoList(QDir::Files);
- QFileInfoList::const_iterator it = files.constBegin();
- for ( ; it != files.constEnd() && notFound.size() > 0; ++it)
- {
- QFileInfo ent = *it;
- QString tok = ent.baseName().toLower();
- for (int ix = 0; EXPECTED_NAMES[ix]; ++ix)
- {
- if (tok.contains(EXPECTED_NAMES[ix]))
- {
- QUrl url;
- url.setScheme("file");
- url.setPath(ent.absoluteFilePath());
- m_faces[ix]->material()->setTextureUrl(url);
- m_faces[ix]->material()->texture()->setHorizontalWrap(QGL::ClampToEdge);
- m_faces[ix]->material()->texture()->setVerticalWrap(QGL::ClampToEdge);
- notFound.removeOne(QLatin1String(EXPECTED_NAMES[ix]));
- break;
- }
- }
- }
- if (notFound.size() > 0)
- {
- qWarning() << imagePath << "did not contain a skybox image for" << notFound;
- }
- }
- else
- {
- qWarning() << imagePath << "was not a directory of skybox images";
- }
-}
-
-/*!
- \qmlproperty url Skybox::source
-
- The location where the 6 textures for the skybox are stored. The textures are
- in any image format that Qt can load, but must have names that contain the following
- strings:
- \list
- \o "_up"
- \o "_down"
- \o "_west"
- \o "_east"
- \o "_north"
- \o "_south"
- \endlist
- These textures are then attached to the appropriate faces of the skybox.
-*/
-void Skybox::setSource(const QUrl &source)
-{
- if (source != m_source)
- {
- m_source = source;
- if (m_source.scheme() == QLatin1String("file"))
- {
- scanLocalDir(m_source.toLocalFile());
- }
- else
- {
- // TODO - handle network case
- qWarning() << "Network support for skybox images not yet implemented";
- }
- emit sourceChanged();
- }
-}
-
-void Skybox::draw(QGLPainter *painter) const
-{
- if (!m_view)
- return;
- painter->modelViewMatrix().push();
- painter->modelViewMatrix().setToIdentity();
-
- QGLCamera *cam = m_view->camera();
- m_camera->setCenter(-cam->eye());
- painter->setCamera(m_camera);
-
- glDisable(GL_DEPTH_TEST);
-
- m_scene->draw(painter);
-
- glEnable(GL_DEPTH_TEST);
-
- painter->setCamera(cam);
- painter->modelViewMatrix().pop();
-}
-
-/*!
- \internal
-*/
-void Skybox::classBegin()
-{
-}
-
-/*!
- \internal
- Checks that all loading and initialisation has been finished, and emits the loaded() signal if
- the component is complete.
-
- \sa loaded()
-*/
-void Skybox::componentComplete()
-{
-}
diff --git a/src/imports/threed/skybox.h b/src/imports/threed/skybox.h
deleted file mode 100644
index b9baef85..00000000
--- a/src/imports/threed/skybox.h
+++ /dev/null
@@ -1,111 +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 SKYBOX_H
-#define SKYBOX_H
-
-#include <QString>
-#include <QObject>
-#include <QtCore/qobject.h>
-#include <QtCore/qurl.h>
-#include <QtDeclarative/qdeclarative.h>
-#include <QtDeclarative/qdeclarativeengine.h>
-#include <QtDeclarative/qdeclarativeparserstatus.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-class QGLSceneNode;
-class QGLPainter;
-class QGLView;
-class QGLCamera;
-class Viewport;
-
-class Skybox : public QObject, public QDeclarativeParserStatus
-{
- Q_OBJECT
- Q_INTERFACES(QDeclarativeParserStatus)
- Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged)
- Q_PROPERTY(Viewport *viewport READ viewport WRITE setViewport NOTIFY viewportChanged)
-public:
- Skybox(QObject *parent = 0);
- ~Skybox();
- QUrl source() const { return m_source; }
- void setSource(const QUrl &url);
- void draw(QGLPainter *painter) const;
- Viewport *viewport() const
- {
- return m_view;
- }
- void setViewport(Viewport *view);
-
- void classBegin();
- void componentComplete();
-
-Q_SIGNALS:
- void sourceChanged();
- void viewportChanged();
-
-protected:
- bool event(QEvent *event);
-
-private:
- void scanLocalDir(const QString &imagePath);
-
- static const char *EXPECTED_NAMES[];
-
- bool m_ready;
- QGLSceneNode *m_scene;
- QString m_imagePath;
- QUrl m_source;
- QGLSceneNode *m_faces[6];
- Viewport *m_view;
- QGLCamera *m_camera;
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(Skybox)
-
-QT_END_HEADER
-
-#endif // SKYBOX_H
diff --git a/src/imports/threed/threed.cpp b/src/imports/threed/threed.cpp
deleted file mode 100644
index 3effca86..00000000
--- a/src/imports/threed/threed.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 <QtDeclarative/qdeclarativeextensionplugin.h>
-#include <QtDeclarative/qdeclarativeengine.h>
-#include <QtDeclarative/qdeclarativecontext.h>
-#include <QtDeclarative/qdeclarative.h>
-
-#include "qdeclarativeitem3d.h"
-#include "qdeclarativemesh.h"
-#include "viewport.h"
-#include "qdeclarativeeffect.h"
-#include "scale3d.h"
-#include "skybox.h"
-
-#include "qgraphicsrotation3d.h"
-#include "qgraphicstranslation3d.h"
-#include "qgraphicsscale3d.h"
-#include "qgraphicsbillboardtransform.h"
-#include "qglscenenode.h"
-
-#include "qgraphicslookattransform.h"
-#include "shaderprogram.h"
-#include "qt3dnamespace.h"
-
-#include "billboarditem3d.h"
-
-QML_DECLARE_TYPE(QGraphicsTransform3D)
-QML_DECLARE_TYPE(QGraphicsRotation3D)
-QML_DECLARE_TYPE(QGraphicsTranslation3D)
-QML_DECLARE_TYPE(QGraphicsScale3D)
-QML_DECLARE_TYPE(QGraphicsBillboardTransform)
-QML_DECLARE_TYPE(QGraphicsLookAtTransform)
-QML_DECLARE_TYPE(QGLMaterial)
-QML_DECLARE_TYPE(QGLLightModel)
-QML_DECLARE_TYPE(QGLLightParameters)
-QML_DECLARE_TYPE(QGLCamera)
-
-QT_BEGIN_NAMESPACE
-
-class QThreedQmlModule : public QDeclarativeExtensionPlugin
-{
- Q_OBJECT
-public:
- virtual void registerTypes(const char *uri)
- {
- Q_ASSERT(QLatin1String(uri) == QLatin1String("Qt3D"));
- qmlRegisterType<QGLSceneNode>(uri,1,0,"SceneNode");
- qmlRegisterType<QDeclarativeEffect>(uri,1,0,"Effect");
- qmlRegisterType<QDeclarativeMesh>(uri,1,0,"Mesh");
- qmlRegisterType<QDeclarativeItem3D>(uri,1,0,"Item3D");
- qmlRegisterType<QGLLightModel>(uri,1,0,"LightModel");
- qmlRegisterType<QGLLightParameters>(uri,1,0,"Light");
- qmlRegisterType<QGLCamera>(uri,1,0,"Camera");
- qmlRegisterType<QGraphicsRotation3D>(uri,1,0,"Rotation3D");
- qmlRegisterType<QGraphicsTranslation3D>(uri,1,0,"Translation3D");
- qmlRegisterType<Scale3D>(uri,1,0,"Scale3D");
- qmlRegisterType<QGraphicsBillboardTransform>(uri,1,0,"BillboardTransform");
- qmlRegisterType<QGraphicsLookAtTransform>(uri,1,0,"LookAt");
- qmlRegisterType<QGLMaterial>(uri,1,0,"Material");
- qmlRegisterType<ShaderProgram>(uri,1,0,"ShaderProgram");
- qmlRegisterType<Skybox>(uri, 1, 0, "Skybox");
- qmlRegisterType<BillboardItem3D>(uri, 1, 0, "BillboardItem3D");
-
- qmlRegisterType<Viewport>(uri,1,0,"Viewport");
-
- // Needed to make QDeclarativeListProperty<QGraphicsTransform3D> work.
- qmlRegisterType<QGraphicsTransform3D>();
- qmlRegisterType<QGraphicsScale3D>();
-
-#ifdef QT_USE_SCENEGRAPH
- qmlRegisterType<ViewportSG>(uri,2,0,"Viewport");
-#endif
- }
- void initializeEngine(QDeclarativeEngine *engine, const char *uri)
- {
- Q_UNUSED(uri);
- QDeclarativeContext *context = engine->rootContext();
- context->setContextProperty(QLatin1String("Qt3D"), new Qt3DNamespace);
- }
-};
-
-QT_END_NAMESPACE
-
-#include "threed.moc"
-
-Q_EXPORT_PLUGIN2(qthreedqmlplugin, QT_PREPEND_NAMESPACE(QThreedQmlModule));
diff --git a/src/imports/threed/threed.pro b/src/imports/threed/threed.pro
deleted file mode 100644
index c674d22e..00000000
--- a/src/imports/threed/threed.pro
+++ /dev/null
@@ -1,74 +0,0 @@
-TEMPLATE = lib
-TARGET = qthreedqmlplugin
-CONFIG += qt plugin
-
-CONFIG += qt3dquick_deploy_pkg
-include(../../../pkg.pri)
-
-# See the README in the root dir re this code
-package {
- target.path += $$QT3D_INSTALL_IMPORTS/Qt3D
- INSTALLS += target
-} else {
- CONFIG += qt3dquick qt3d
- DESTDIR = $$QT3D_INSTALL_IMPORTS/Qt3D
-}
-
-win32 {
- CONFIG(debug, debug|release) {
- TARGET = $$member(TARGET, 0)d
- }
-}
-
-symbian {
- CONFIG += epocallowdlldata
- MMP_RULES += EXPORTUNFROZEN
- LIBS += -lQt3D$${QT_LIBINFIX} -lQt3DQuick$${QT_LIBINFIX}
- TARGET.CAPABILITY = All -Tcb
- TARGET.UID3 = 0x20031E9B
-}
-
-SOURCES += \
- threed.cpp \
- qt3dnamespace.cpp \
- scale3d.cpp \
- viewport.cpp \
- qgraphicslookattransform.cpp \
- shaderprogram.cpp \
- skybox.cpp \
- billboarditem3d.cpp
-
-HEADERS += \
- qt3dnamespace.h \
- scale3d.h \
- viewport.h \
- qgraphicslookattransform.h \
- shaderprogram.h \
- shaderprogram_p.h \
- skybox.h \
- billboarditem3d.h
-
-# See the file README.library_xml for more on this
-QML_INFRA_FILES += \
- qmldir \
- library.xml \
- plugins.qmltypes
-
-package {
- copyqmlinfra_install.files = $$QML_INFRA_FILES
- copyqmlinfra_install.path = $$QT3D_INSTALL_IMPORTS/Qt3D
- INSTALLS += copyqmlinfra_install
-} else {
- copyqmlinfra.input = QML_INFRA_FILES
- copyqmlinfra.output = $$[QT_INSTALL_IMPORTS]/Qt3D/${QMAKE_FILE_IN_BASE}${QMAKE_FILE_EXT}
- copyqmlinfra.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
- copyqmlinfra.CONFIG += no_link_no_clean
- copyqmlinfra.variable_out = PRE_TARGETDEPS
- QMAKE_EXTRA_COMPILERS += copyqmlinfra
-}
-
-OTHER_FILES += \
- README.plugins_types \
- README.library_xml
-
-
diff --git a/src/imports/threed/viewport.cpp b/src/imports/threed/viewport.cpp
deleted file mode 100644
index 5f4169e3..00000000
--- a/src/imports/threed/viewport.cpp
+++ /dev/null
@@ -1,1289 +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 "viewport.h"
-#include "qdeclarativeeffect.h"
-
-#include "qgllightmodel.h"
-#include "qgllightparameters.h"
-#include "qglcamera.h"
-#include "qglview.h"
-#include "qglsubsurface.h"
-#include "qray3d.h"
-#include "qglframebufferobjectsurface.h"
-#include "skybox.h"
-
-#include <QtGui/qpainter.h>
-#include <QtGui/qgraphicsview.h>
-#include <QtGui/qgraphicsscene.h>
-#include <QtGui/qgraphicssceneevent.h>
-#include <QtGui/qevent.h>
-#include <QtOpenGL/qglframebufferobject.h>
-#include <QtCore/qtimer.h>
-#include <QtCore/qcoreapplication.h>
-#include <QtCore/qpointer.h>
-
-/*!
- \qmlclass Viewport Viewport
- \brief The Viewport item defines the logical viewport for a 3D scene. It includes all necessary
- references and parameters for the contents of the scene, as well as drawing and painting functions
- \since 4.8
- \ingroup qt3d::qml3d
-
- The Viewport item is usually the outermost in a 3D scene, specifying
- the size of the view, the camera position, lights, and the main 3D object:
-
- \code
- import QtQuick 1.0
- import Qt3D 1.0
-
- Viewport {
- width: 640; height: 480
- camera: Camera {}
- light: Light {}
- Item3D {
- mesh: Mesh { source: "meshes/teapot.bez" }
- effect: Effect {}
- }
- }
- \endcode
-
- \sa Camera
-*/
-
-QT_BEGIN_NAMESPACE
-
-class ViewportPrivate
-{
-public:
- ViewportPrivate();
- ~ViewportPrivate();
-
- bool picking;
- bool showPicking;
- bool showSceneGraph;
- int dumpCount;
- bool navigation;
- bool fovzoom;
- bool blending;
- bool itemsInitialized;
- bool needsPick;
- QGLCamera *camera;
- QGLLightParameters *light;
- QGLLightModel *lightModel;
- QWidget *viewWidget;
- int pickId;
- QGLFramebufferObject *pickFbo;
- QMap<int, QObject *> objects;
- QPointer<QObject> pressedObject;
- Qt::MouseButton pressedButton;
- QPointer<QObject> enteredObject;
- bool panning;
- QPointF startPan;
- QPointF lastPan;
- QVector3D startEye;
- QVector3D startCenter;
- QVector3D startUpVector;
- Qt::KeyboardModifiers panModifiers;
- QMap<int, QObject*> earlyDrawList;
-
- void setDefaults(QGLPainter *painter);
-};
-
-ViewportPrivate::ViewportPrivate()
- : picking(false)
- , showPicking(false)
- , showSceneGraph(false)
- , dumpCount(10) // maybe this needs to be higher?
- , navigation(true)
- , fovzoom(false)
- , blending(false)
- , itemsInitialized(false)
- , needsPick(true)
- , camera(0)
- , light(0)
- , lightModel(0)
- , viewWidget(0)
- , pickId(1)
- , pickFbo(0)
- , pressedObject(0)
- , pressedButton(Qt::NoButton)
- , enteredObject(0)
- , panning(false)
- , startPan(-1, -1)
- , lastPan(-1, -1)
- , panModifiers(Qt::NoModifier)
-{
-}
-
-ViewportPrivate::~ViewportPrivate()
-{
- delete pickFbo;
-}
-
-void ViewportPrivate::setDefaults(QGLPainter *painter)
-{
- // Set the default depth buffer options.
- glDepthFunc(GL_LESS);
- glDepthMask(GL_TRUE);
-#if defined(QT_OPENGL_ES)
- glDepthRangef(0.0f, 1.0f);
-#else
- glDepthRange(0.0f, 1.0f);
-#endif
-
- // Set the default blend options.
- glDisable(GL_BLEND);
- 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);
-}
-
-/*!
- \internal
- Construct the class and assign it a \a parent QDeclarativeItem.
-*/
-Viewport::Viewport(QDeclarativeItem *parent)
- : QDeclarativeItem(parent)
-{
- d = new ViewportPrivate();
- setFlag(QGraphicsItem::ItemHasNoContents, false);
-
- connect(this, SIGNAL(viewportChanged()), this, SLOT(update3d()));
-
- setCamera(new QGLCamera(this));
- setLight(new QGLLightParameters(this));
-
- setAcceptedMouseButtons(Qt::LeftButton);
- setAcceptHoverEvents(true);
-}
-
-/*!
- \internal
- Class destruction and cleanup.
-*/
-Viewport::~Viewport()
-{
- delete d;
-}
-
-/*!
- \qmlproperty bool Viewport::picking
-
- User interaction in QML/3d is handled through the concept of object picking. Each
- item has a unique picking id which is queried for a given screen click position when the
- mouse is clicked.
-
- If this property is set to true, picking will be supported for this
- viewport, while if the property is false, no picking will be applied.
-
- The default value for this property is false.
-
- \sa showPicking
-*/
-bool Viewport::picking() const
-{
- return d->picking;
-}
-
-void Viewport::setPicking(bool value)
-{
- d->picking = value;
- emit viewportChanged();
-}
-
-/*!
- \qmlproperty bool Viewport::showPicking
- The underlying mechanism for picking is based on painting an off-screen buffer with a flat
- coloured image containing all of the objects with a unique color value.
-
- Setting this property to true will display this flat-colour picking
- representation in the viewport, which can be useful for debugging
- problems with object selection.
-
- The default value for this property is false.
-
- \sa picking
-*/
-
-bool Viewport::showPicking() const
-{
- return d->showPicking;
-}
-
-void Viewport::setShowPicking(bool value)
-{
- d->showPicking = value;
- emit viewportChanged();
-}
-
-/*!
- \qmlproperty bool Viewport::showSceneGraph
-
- This property controls whether or not the 3D scenegraph structure is dumped
- to the console when the viewport is first rendered. Studying the output can be very
- useful for optimising the scene, and for detecting issues with rendering, such
- as misplaced textures, materials, geometry and so on.
-
- By default the value is set to false.
-*/
-bool Viewport::showSceneGraph() const
-{
- return d->showSceneGraph;
-}
-
-void Viewport::setShowSceneGraph(bool show)
-{
- if (show != d->showSceneGraph)
- {
- d->showSceneGraph = show;
- emit showSceneGraphChanged();
- }
-}
-
-/*!
- \qmlproperty bool Viewport::navigation
-
- This property is used to set or unset camera navigation in for the viewport.
- Camera navigation allows the user to move the camera position around using the mouse.
-
- By default, camera navigation is set to true.
-*/
-bool Viewport::navigation() const
-{
- return d->navigation;
-}
-
-void Viewport::setNavigation(bool value)
-{
- d->navigation = value;
- emit viewportChanged();
-}
-
-/*!
- \qmlproperty bool Viewport::fovzoom
-
- This property is used to set or unset zooming based on field-of-view (fov). Normally
- zooming is achieved by moving the camera physically closer to the target object. This
- options achieves zooming by narrowing or broadening the fov.
-
- By default, fov zooming is set to false.
-*/
-bool Viewport::fovzoom() const
-{
- return d->fovzoom;
-}
-
-void Viewport::setFovzoom(bool value)
-{
- d->fovzoom = value;
- emit viewportChanged();
-}
-
-
-/*!
- \qmlproperty bool Viewport::blending
-
- The blending property is used to enable or disable GL_BLEND
- on the viewport, for alpha blending of drawn objects.
-
- By default, blending is set to false.
-
- \sa Effect::blending
-*/
-bool Viewport::blending() const
-{
- return d->blending;
-}
-
-void Viewport::setBlending(bool value)
-{
- d->blending = value;
- emit viewportChanged();
-}
-
-/*!
- \qmlproperty Camera Viewport::camera
-
- This property sets the camera parameters which will be used for
- the appropriate viewing transforms in OpenGL. The default is
- a perspective camera with its eye located at (0, 0, 10) looking
- at the center (0, 0, 0), with the y axis as up.
-*/
-QGLCamera *Viewport::camera() const
-{
- return d->camera;
-}
-
-void Viewport::setCamera(QGLCamera *value)
-{
- if (d->camera != value) {
- if (d->camera) {
- disconnect(d->camera, SIGNAL(projectionChanged()),
- this, SLOT(cameraChanged()));
- disconnect(d->camera, SIGNAL(viewChanged()),
- this, SLOT(cameraChanged()));
- }
- d->camera = value;
- if (d->camera) {
- connect(d->camera, SIGNAL(projectionChanged()),
- this, SLOT(cameraChanged()));
- connect(d->camera, SIGNAL(viewChanged()),
- this, SLOT(cameraChanged()));
- }
- cameraChanged();
- }
-}
-
-/*!
- \qmlproperty Light Viewport::light
-
- This property defines the main scene light to use for 3D items
- that are drawn in this viewport.
-
- \sa lightModel
-*/
-
-QGLLightParameters *Viewport::light() const
-{
- return d->light;
-}
-
-void Viewport::setLight(QGLLightParameters *value)
-{
- if (d->light != value) {
- if (d->light) {
- disconnect(d->light, SIGNAL(lightChanged()),
- this, SLOT(update3d()));
- }
- d->light = value;
- if (d->light) {
- connect(d->light, SIGNAL(lightChanged()),
- this, SLOT(update3d()));
- }
- emit viewportChanged();
- }
-}
-
-/*!
- \qmlproperty LightModel Viewport::lightModel
- The user is able to set a lighting model for the 3d environment through the use of the
- lightModel property. By default the light model is undefined.
-
- \sa light
-*/
-QGLLightModel *Viewport::lightModel() const
-{
- return d->lightModel;
-}
-
-void Viewport::setLightModel(QGLLightModel *value)
-{
- if (d->lightModel != value) {
- if (d->lightModel) {
- disconnect(d->lightModel, SIGNAL(lightModelChanged()),
- this, SLOT(update3d()));
- }
- d->lightModel = value;
- if (d->lightModel) {
- connect(d->lightModel, SIGNAL(lightModelChanged()),
- this, SLOT(update3d()));
- }
- emit viewportChanged();
- }
-}
-
-class ViewportSubsurface : public QGLSubsurface
-{
-public:
- ViewportSubsurface(QGLAbstractSurface *surface, const QRect &region,
- qreal adjust)
- : QGLSubsurface(surface, region), m_adjust(adjust) {}
-
- qreal aspectRatio() const;
-
-private:
- qreal m_adjust;
-};
-
-qreal ViewportSubsurface::aspectRatio() const
-{
- return QGLSubsurface::aspectRatio() * m_adjust;
-}
-
-/*!
- \internal
- The main paint function for the Viewport class. It takes a QPainter \a p, which performs the
- painting of objects in the 3d environment.
-
- The paint function is responsible for setting up the viewing transform, as well as other display
- options, before calling the draw function to perform the actual drawing of the scene.
-
- Note, currently \a style and \a widget are unused, but are reserved for later development.
-*/
-void Viewport::paint(QPainter *p, const QStyleOptionGraphicsItem * style, QWidget *widget)
-{
- Q_UNUSED(style);
-
- if (!d->viewWidget)
- d->viewWidget = widget;
- d->needsPick = true;
-
- QGLPainter painter;
- if (!painter.begin(p)) {
- if (widget) {
- // Probably running with a plain QDeclarativeView (e.g. qmlviewer).
- // We need to have switched the surrounding QGraphicsView to use a
- // QGLWidget as its viewport.
- QGraphicsView *view =
- qobject_cast<QGraphicsView *>(widget->parentWidget());
- if (!view) {
- return;
- } else {
- QGLWidget *glw = qobject_cast<QGLWidget *>(view->viewport());
- if (!glw) {
- qWarning("GL graphics system is not active; cannot use 3D items");
- return;
- }
- }
- }
- }
-
- // Initialize the objects in the scene if this is the first paint.
- if (!d->itemsInitialized)
- initializeGL(&painter);
-
- painter.setEye(QGL::NoEye);
- qreal adjust = 1.0f;
-
- // Modify the GL viewport to only cover the extent of this QDeclarativeItem.
- QTransform transform = p->combinedTransform();
- QRect viewport = transform.mapRect(boundingRect()).toRect();
- ViewportSubsurface surface(painter.currentSurface(), viewport, adjust);
- painter.pushSurface(&surface);
-
- // Perform early drawing operations.
- earlyDraw(&painter);
-
- // Set up the camera the way QGLView would if we were using it.
- if (d->camera) {
- painter.setCamera(d->camera);
- } else {
- QGLCamera defCamera;
- painter.setCamera(&defCamera);
- }
-
- // Draw the Item3D children.
- painter.setPicking(d->showPicking);
- draw(&painter);
- painter.setPicking(false);
- painter.popSurface();
-
- // Disable the effect to return control to the GL paint engine.
- painter.disableEffect();
-
- // Try to restore the GL state to something paint-engine compatible.
- glDisable(GL_CULL_FACE);
- d->setDefaults(&painter);
- glDisable(GL_DEPTH_TEST);
-
-}
-
-/*!
- \internal
-*/
-void Viewport::earlyDraw(QGLPainter *painter)
-{
- // If we have a parent, then assume that the parent has painted
- // the background and overpaint over the top of it. If we don't
- // have a parent, then clear to black.
- if (parentItem()) {
- glClear(GL_DEPTH_BUFFER_BIT);
- } else {
- painter->setClearColor(Qt::black);
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- }
-
- // Force the effect to be updated. The GL paint engine
- // has left the GL state in an unknown condition.
- painter->disableEffect();
-
-#ifdef GL_RESCALE_NORMAL
- glEnable(GL_RESCALE_NORMAL);
-#endif
-
- // Set the default effect for the scene.
- painter->setStandardEffect(QGL::LitMaterial);
- painter->setFaceColor(QGL::AllFaces, Qt::white);
-}
-
-/*!
- \internal
- The draw function for the viewport sets up all of the lighting parameters for the scene before
- iterating through the top level items in the scene and drawing them using \a painter.
-
- As a matter of course each item will draw its child items, and so on, until the entire image has
- been populated.
-*/
-void Viewport::draw(QGLPainter *painter)
-{
- // Set up the initial depth, blend, and other options.
- glEnable(GL_DEPTH_TEST);
- glDepthFunc(GL_LESS);
- glDepthMask(GL_TRUE);
-#if defined(QT_OPENGL_ES)
- glDepthRangef(0.0f, 1.0f);
-#else
- glDepthRange(0.0f, 1.0f);
-#endif
-
- // At present only skyboxes work, with early draw and they are drawn
- // without blending and without a lighting model - just flat texture rendering
- int cnt = d->earlyDrawList.size();
- int order = 0;
- while (cnt)
- {
- QMap<int, QObject *>::const_iterator it = d->earlyDrawList.constFind(order);
- while (it != d->earlyDrawList.constEnd())
- {
- // TODO: make more than just skybox work with early draw
- Skybox *sb = qobject_cast<Skybox *>(*it);
- if (sb)
- sb->draw(painter);
- ++it;
- --cnt;
- }
- ++order;
- }
-
- if (d->blending)
- glEnable(GL_BLEND);
- else
- glDisable(GL_BLEND);
- 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);
- glDisable(GL_CULL_FACE);
-
- painter->setObjectPickId(-1);
- QObjectList list = QObject::children();
- painter->setMainLight(d->light, QMatrix4x4());
- painter->setLightModel(d->lightModel);
- foreach (QObject *child, list) {
- QDeclarativeItem3D *item = qobject_cast<QDeclarativeItem3D *>(child);
- if (item)
- {
- if (d->showSceneGraph && (d->dumpCount == 0))
- qDumpItem(item);
- item->draw(painter);
- }
- }
- if (d->dumpCount >= 0)
- --d->dumpCount;
-}
-
-/*!
- \internal
- Initialize the GL viewport for the first time on \a painter.
-*/
-
-void Viewport::initializeGL(QGLPainter *painter)
-{
- // Initialize the Item3D objects attached to this scene.
- QObjectList list = QObject::children();
- foreach (QObject *child, list) {
- QDeclarativeItem3D *item = qobject_cast<QDeclarativeItem3D *>(child);
- if (item) {
- setItemViewport(item);
- item->initialize(painter);
- }
- // TODO: make this more generic with some sort of abstract interface
- // so that more than just skybox works with early draw
- Skybox *sb = qobject_cast<Skybox *>(child);
- if (sb)
- {
- sb->setViewport(this);
- registerEarlyDrawObject(sb, 0);
- }
- }
- d->itemsInitialized = true;
-}
-
-/*!
- \internal
- Registers \a obj with this viewport as a pickable object and
- return its pick identifier.
-*/
-int Viewport::registerPickableObject(QObject *obj)
-{
- int id = (d->pickId)++;
- d->objects[id] = obj;
- return id;
-}
-
-void Viewport::registerEarlyDrawObject(QObject *obj, int order)
-{
- d->earlyDrawList.insertMulti(order, obj);
-}
-
-/*!
- \internal
- Returns the registered object that is under the mouse position
- specified by (\a x, \a y). This function may need to regenerate
- the contents of the pick buffer by repainting the scene.
-*/
-QObject *Viewport::objectForPoint(qreal x, qreal y)
-{
- if (!d->viewWidget)
- return 0;
-
- // Check the viewport boundaries in case a mouse move has
- // moved the pointer outside the window.
- QRectF rect = boundingRect();
- if (!rect.contains(QPointF(x, y)))
- return 0;
-
- QPainter qpainter;
- QGLPainter painter;
- QGLWidget *glw = qobject_cast<QGLWidget *>(d->viewWidget);
- bool painterValid = false;
- bool doubleBuffer = false;
- if (glw && painter.begin(glw)) {
- doubleBuffer = glw->doubleBuffer();
- painterValid = true;
- } else if (qpainter.begin(d->viewWidget) && painter.begin(&qpainter)) {
- painterValid = true;
- }
-
- if (!painterValid && !QGLContext::currentContext()) {
- // Won't be able to read or generate a pick buffer, so bail out.
- return 0;
- }
-
- int objectId = -1;
-
- QSize size(qRound(width()), qRound(height()));
- QSize fbosize(QGL::nextPowerOfTwo(size));
- if (!d->needsPick && d->pickFbo && d->pickFbo->size() == fbosize
- && painterValid) {
- // The previous pick fbo contents should still be valid.
- d->pickFbo->bind();
- objectId = painter.pickObject(qRound(x), fbosize.height() - 1 - qRound(y));
- d->pickFbo->release();
- } else {
- // Regenerate the pick fbo contents.
- QGLAbstractSurface *mainSurface = 0;
- QGLAbstractSurface *fboSurface = 0;
- int height;
- if (!doubleBuffer) {
- if (d->pickFbo && d->pickFbo->size() != fbosize) {
- delete d->pickFbo;
- d->pickFbo = 0;
- }
- if (!d->pickFbo) {
- d->pickFbo = new QGLFramebufferObject
- (fbosize, QGLFramebufferObject::CombinedDepthStencil);
- }
- height = fbosize.height();
- fboSurface = new QGLFramebufferObjectSurface(d->pickFbo);
- mainSurface = fboSurface;
- } else if (painterValid) {
- // Use the QGLWidget's back buffer for picking to avoid the
- // need to create a separate fbo in GPU memory.
- mainSurface = painter.currentSurface();
- height = mainSurface->viewportGL().height();
- }
- QGLSubsurface surface(mainSurface, QRect(QPoint(0, 0), size));
- // If our view is a hijacked QWidget, we're going to have failed
- // to find a QGLWidget, but we'll still have a QGLContext and be able
- // to draw the pick buffer into the pickFbo.
- if (painterValid || painter.begin(&surface)) {
- if (painterValid)
- painter.pushSurface(&surface);
- painter.setPicking(true);
- painter.clearPickObjects();
- painter.setClearColor(Qt::black);
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- painter.setEye(QGL::NoEye);
- glEnable(GL_DEPTH_TEST);
- glDepthFunc(GL_LESS);
- glDepthMask(GL_TRUE);
-#if defined(QT_OPENGL_ES)
- glDepthRangef(0.0f, 1.0f);
-#else
- glDepthRange(0.0f, 1.0f);
-#endif
- glDisable(GL_BLEND);
- 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);
- glDisable(GL_CULL_FACE);
- if (d->camera) {
- painter.setCamera(d->camera);
- } else {
- QGLCamera defCamera;
- painter.setCamera(&defCamera);
- }
- draw(&painter);
- painter.setPicking(false);
- objectId = painter.pickObject(qRound(x), height - 1 - qRound(y));
- painter.popSurface();
- painter.end();
- }
- delete fboSurface;
- }
-
- d->needsPick = doubleBuffer;
- return d->objects.value(objectId, 0);
-}
-
-/*!
- \internal
-*/
-void Viewport::update3d()
-{
- update();
-}
-
-/*!
- \internal
-*/
-void Viewport::cameraChanged()
-{
- update();
-}
-
-static inline void sendEnterEvent(QObject *object)
-{
- QEvent event(QEvent::Enter);
- QCoreApplication::sendEvent(object, &event);
-}
-
-static inline void sendLeaveEvent(QObject *object)
-{
- QEvent event(QEvent::Leave);
- QCoreApplication::sendEvent(object, &event);
-}
-
-/*!
- \internal
-*/
-void Viewport::mousePressEvent(QGraphicsSceneMouseEvent *e)
-{
- QObject *object;
- if (!d->panning && d->picking)
- object = objectForPoint(e->pos());
- else
- object = 0;
- if (d->pressedObject) {
- // Send the press event to the pressed object. Use a position
- // of (0, 0) if the mouse is still within the pressed object,
- // or (-1, -1) if the mouse is no longer within the pressed object.
- QMouseEvent event
- (QEvent::MouseButtonPress,
- (d->pressedObject == object) ? QPoint(0, 0) : QPoint(-1, -1),
- e->screenPos(), e->button(), e->buttons(), e->modifiers());
- QCoreApplication::sendEvent(d->pressedObject, &event);
- } else if (object) {
- // Record the object that was pressed and forward the event.
- d->pressedObject = object;
- d->enteredObject = 0;
- d->pressedButton = e->button();
-
- // Send a mouse press event for (0, 0).
- QMouseEvent event(QEvent::MouseButtonPress, QPoint(0, 0),
- e->screenPos(), e->button(), e->buttons(),
- e->modifiers());
- QCoreApplication::sendEvent(object, &event);
- } else if (d->navigation && e->button() == Qt::LeftButton) {
- d->panning = true;
- d->lastPan = d->startPan = e->pos();
- d->startEye = d->camera->eye();
- d->startCenter = d->camera->center();
- d->startUpVector = d->camera->upVector();
- d->panModifiers = e->modifiers();
-#ifndef QT_NO_CURSOR
- setCursor(Qt::ClosedHandCursor);
-#endif
- } else {
- QDeclarativeItem::mousePressEvent(e);
- return;
- }
- e->setAccepted(true);
-}
-
-/*!
- \internal
-*/
-void Viewport::mouseReleaseEvent(QGraphicsSceneMouseEvent *e)
-{
- if (d->panning && e->button() == Qt::LeftButton) {
- d->panning = false;
-#ifndef QT_NO_CURSOR
- unsetCursor();
-#endif
- }
- if (d->pressedObject) {
- // Notify the previously pressed object about the release.
- QObject *object = objectForPoint(e->pos());
- QObject *pressed = d->pressedObject;
- if (e->button() == d->pressedButton) {
- d->pressedObject = 0;
- d->pressedButton = Qt::NoButton;
- d->enteredObject = object;
-
- // Send the release event to the pressed object. Use a position
- // of (0, 0) if the mouse is still within the pressed object,
- // or (-1, -1) if the mouse is no longer within the pressed object.
- QMouseEvent event
- (QEvent::MouseButtonRelease,
- (pressed == object) ? QPoint(0, 0) : QPoint(-1, -1),
- e->screenPos(), e->button(), e->buttons(), e->modifiers());
- QCoreApplication::sendEvent(pressed, &event);
-
- // Send leave and enter events if necessary.
- if (object != pressed) {
- sendLeaveEvent(pressed);
- if (object)
- sendEnterEvent(object);
- }
- } else {
- // Some other button than the original was released.
- // Forward the event to the pressed object.
- QMouseEvent event
- (QEvent::MouseButtonRelease,
- (pressed == object) ? QPoint(0, 0) : QPoint(-1, -1),
- e->screenPos(), e->button(), e->buttons(), e->modifiers());
- QCoreApplication::sendEvent(pressed, &event);
- }
- e->setAccepted(true);
- } else {
- QDeclarativeItem::mouseReleaseEvent(e);
- }
-}
-
-/*!
- \internal
-*/
-void Viewport::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *e)
-{
- if (d->picking) {
- QObject *object = objectForPoint(e->pos());
- if (object) {
- // Simulate a double click event for (0, 0).
- QMouseEvent event
- (QEvent::MouseButtonDblClick, QPoint(0, 0),
- e->screenPos(), e->button(), e->buttons(), e->modifiers());
- QCoreApplication::sendEvent(object, &event);
- e->setAccepted(true);
- return;
- }
- }
- QDeclarativeItem::mouseDoubleClickEvent(e);
-}
-
-/*!
- \internal
-*/
-void Viewport::mouseMoveEvent(QGraphicsSceneMouseEvent *e)
-{
- if (d->panning) {
- QPointF delta = e->pos() - d->startPan;
- if (e->modifiers() == d->panModifiers) {
- d->camera->setEye(d->startEye);
- d->camera->setCenter(d->startCenter);
- d->camera->setUpVector(d->startUpVector);
- } else {
- d->startPan = d->lastPan;
- delta = e->pos() - d->startPan;
- d->startEye = d->camera->eye();
- d->startCenter = d->camera->center();
- d->startUpVector = d->camera->upVector();
- d->panModifiers = e->modifiers();
- }
- d->lastPan = e->pos();
- if ((e->modifiers() & Qt::ControlModifier) != 0)
- wheel(delta.y() * -60);
- else if ((e->modifiers() & Qt::ShiftModifier) != 0)
- pan(delta.x(), delta.y());
- else
- rotate(delta.x(), delta.y());
- } else if (d->picking) {
- QObject *object = objectForPoint(e->pos());
- if (d->pressedObject) {
- // Send the move event to the pressed object. Use a position
- // of (0, 0) if the mouse is still within the pressed object,
- // or (-1, -1) if the mouse is no longer within the pressed object.
- QMouseEvent event
- (QEvent::MouseMove,
- (d->pressedObject == object) ? QPoint(0, 0) : QPoint(-1, -1),
- e->screenPos(), e->button(), e->buttons(), e->modifiers());
- QCoreApplication::sendEvent(d->pressedObject, &event);
- } else if (object) {
- if (object != d->enteredObject) {
- if (d->enteredObject)
- sendLeaveEvent(d->enteredObject);
- d->enteredObject = object;
- sendEnterEvent(d->enteredObject);
- }
- QMouseEvent event
- (QEvent::MouseMove, QPoint(0, 0),
- e->screenPos(), e->button(), e->buttons(), e->modifiers());
- QCoreApplication::sendEvent(object, &event);
- } else if (d->enteredObject) {
- sendLeaveEvent(d->enteredObject);
- d->enteredObject = 0;
- } else {
- QDeclarativeItem::mouseMoveEvent(e);
- return;
- }
- } else {
- QDeclarativeItem::mouseMoveEvent(e);
- return;
- }
- e->setAccepted(true);
-}
-
-/*!
- \internal
-*/
-void Viewport::hoverEnterEvent(QGraphicsSceneHoverEvent *e)
-{
- if (hoverEvent(e))
- e->setAccepted(true);
- else
- QDeclarativeItem::hoverEnterEvent(e);
-}
-
-/*!
- \internal
-*/
-void Viewport::hoverMoveEvent(QGraphicsSceneHoverEvent *e)
-{
- if (hoverEvent(e))
- e->setAccepted(true);
- else
- QDeclarativeItem::hoverMoveEvent(e);
-}
-
-/*!
- \internal
-*/
-void Viewport::hoverLeaveEvent(QGraphicsSceneHoverEvent *e)
-{
- if (!d->pressedObject && d->enteredObject) {
- sendLeaveEvent(d->enteredObject);
- d->enteredObject = 0;
- e->setAccepted(true);
- } else {
- QDeclarativeItem::hoverLeaveEvent(e);
- }
-}
-
-/*!
- \internal
-*/
-void Viewport::wheelEvent(QGraphicsSceneWheelEvent *e)
-{
- if (d->navigation) {
- wheel(e->delta());
- e->setAccepted(true);
- } else {
- QDeclarativeItem::wheelEvent(e);
- }
-}
-
-/*!
- \internal
-*/
-void Viewport::keyPressEvent(QKeyEvent *e)
-{
- // Process the "Keys" property on the item first.
- keyPressPreHandler(e);
- if (e->isAccepted())
- return;
-
- qreal sep;
-
- if (!d->navigation) {
- QDeclarativeItem::keyPressEvent(e);
- return;
- }
-
- switch (e->key()) {
-
- case Qt::Key_Left:
- {
- if ((e->modifiers() & Qt::ShiftModifier) != 0) {
- pan(-10, 0);
- } else if ((e->modifiers() & Qt::ControlModifier) != 0) {
- sep = d->camera->eyeSeparation();
- sep -= (sep / 10.0f);
- if (sep < 0.0f)
- sep = 0.0f;
- d->camera->setEyeSeparation(sep);
- } else {
- rotate(-10, 0);
- }
- }
- break;
-
- case Qt::Key_Right:
- {
- if ((e->modifiers() & Qt::ShiftModifier) != 0) {
- pan(10, 0);
- } else if ((e->modifiers() & Qt::ControlModifier) != 0) {
- sep = d->camera->eyeSeparation();
- sep += (sep / 10.0f);
- d->camera->setEyeSeparation(sep);
- } else {
- rotate(10, 0);
- }
- }
- break;
-
- case Qt::Key_Up:
- {
- if ((e->modifiers() & Qt::ControlModifier) != 0)
- wheel(120);
- else if ((e->modifiers() & Qt::ShiftModifier) != 0)
- pan(0, -10);
- else
- rotate(0, -10);
- }
- break;
-
- case Qt::Key_Down:
- {
- if ((e->modifiers() & Qt::ControlModifier) != 0)
- wheel(-120);
- else if ((e->modifiers() & Qt::ShiftModifier) != 0)
- pan(0, 10);
- else
- rotate(0, 10);
- }
- break;
-
- default:
- QDeclarativeItem::keyPressEvent(e);
- return;
- }
-
- e->setAccepted(true);
-}
-
-/*!
- \internal
-*/
-bool Viewport::hoverEvent(QGraphicsSceneHoverEvent *e)
-{
- if (!d->panning && d->picking) {
- QObject *object = objectForPoint(e->pos());
- if (d->pressedObject) {
- // Send the move event to the pressed object. Use a position
- // of (0, 0) if the mouse is still within the pressed object,
- // or (-1, -1) if the mouse is no longer within the pressed object.
- QMouseEvent event
- (QEvent::MouseMove,
- (d->pressedObject == object) ? QPoint(0, 0) : QPoint(-1, -1),
- e->screenPos(), Qt::NoButton, Qt::NoButton, e->modifiers());
- QCoreApplication::sendEvent(d->pressedObject, &event);
- } else if (object) {
- if (object != d->enteredObject) {
- if (d->enteredObject)
- sendLeaveEvent(d->enteredObject);
- d->enteredObject = object;
- sendEnterEvent(d->enteredObject);
- }
- QMouseEvent event
- (QEvent::MouseMove, QPoint(0, 0),
- e->screenPos(), Qt::NoButton, Qt::NoButton, e->modifiers());
- QCoreApplication::sendEvent(object, &event);
- } else if (d->enteredObject) {
- sendLeaveEvent(d->enteredObject);
- d->enteredObject = 0;
- }
- return true;
- }
- return false;
-}
-
-// Zoom in and out according to the change in wheel delta.
-void Viewport::wheel(qreal delta)
-{
- if (d->fovzoom) {
- //Use field-of view as zoom (much like a traditional camera)
- qreal scale = qAbs(viewDelta(delta, delta).x());
- if (delta < 0)
- scale = -scale;
- if (scale >= 0.0f)
- scale += 1.0f;
- else
- scale = 1.0f / (1.0f - scale);
- qreal fov = d->camera->fieldOfView();
- if (fov != 0.0f)
- d->camera->setFieldOfView(d->camera->fieldOfView() / scale);
- else
- d->camera->setViewSize(d->camera->viewSize() / scale);
- } else {
- // enable this to get wheel navigation that actually zooms by moving the
- // camera back, as opposed to making the angle of view wider.
- QVector3D viewVector= camera()->eye() - camera()->center();
- qreal zoomMag = viewVector.length();
- qreal zoomIncrement = -float(delta) / 100.0f;
- if (!qFuzzyIsNull(zoomIncrement))
- {
- zoomMag += zoomIncrement;
- if (zoomMag < 1.0f)
- zoomMag = 1.0f;
-
- QRay3D viewLine(camera()->center(), viewVector.normalized());
- camera()->setEye(viewLine.point(zoomMag));
- }
- }
-}
-
-// Pan left/right/up/down without rotating about the object.
-void Viewport::pan(qreal deltax, qreal deltay)
-{
- QPointF delta = viewDelta(deltax, deltay);
- QVector3D t = d->camera->translation(delta.x(), -delta.y(), 0.0f);
-
- // Technically panning the eye left should make the object appear to
- // move off to the right, but this looks weird on-screen where the user
- // actually thinks they are picking up the object and dragging it rather
- // than moving the eye. We therefore apply the inverse of the translation
- // to make it "look right".
- d->camera->setEye(d->camera->eye() - t);
- d->camera->setCenter(d->camera->center() - t);
-}
-
-// Rotate about the object being viewed.
-void Viewport::rotate(qreal deltax, qreal deltay)
-{
- QRectF rect = boundingRect();
- int rotation = d->camera->screenRotation();
- if (rotation == 90 || rotation == 270) {
- qSwap(deltax, deltay);
- }
- if (rotation == 90 || rotation == 180) {
- deltax = -deltax;
- }
- if (rotation == 180 || rotation == 270) {
- deltay = -deltay;
- }
- qreal anglex = deltax * 90.0f / rect.width();
- qreal angley = deltay * 90.0f / rect.height();
- QQuaternion q = d->camera->pan(-anglex);
- q *= d->camera->tilt(-angley);
- d->camera->rotateCenter(q);
-}
-
-// Convert deltas in the X and Y directions into percentages of
-// the view width and height.
-QPointF Viewport::viewDelta(qreal deltax, qreal deltay)
-{
- QRectF rect = boundingRect();
- qreal w = rect.width();
- qreal h = rect.height();
- bool scaleToWidth;
- qreal scaleFactor, scaleX, scaleY;
- QSizeF viewSize = d->camera->viewSize();
- if (w >= h) {
- if (viewSize.width() >= viewSize.height())
- scaleToWidth = true;
- else
- scaleToWidth = false;
- } else {
- if (viewSize.width() >= viewSize.height())
- scaleToWidth = false;
- else
- scaleToWidth = true;
- }
- int rotation = d->camera->screenRotation();
- if (rotation == 90 || rotation == 270) {
- scaleToWidth = !scaleToWidth;
- qSwap(deltax, deltay);
- }
- if (rotation == 90 || rotation == 180) {
- deltax = -deltax;
- }
- if (rotation == 180 || rotation == 270) {
- deltay = -deltay;
- }
- if (scaleToWidth) {
- scaleFactor = 2.0f / viewSize.width();
- scaleX = scaleFactor * h / w;
- scaleY = scaleFactor;
- } else {
- scaleFactor = 2.0f / viewSize.height();
- scaleX = scaleFactor;
- scaleY = scaleFactor * w / h;
- }
- return QPointF(deltax * scaleX / w, deltay * scaleY / h);
-}
-
-QVariant Viewport::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value)
-{
- if (change == QGraphicsItem::ItemChildAddedChange)
- {
- QGraphicsItem *newItem = value.value<QGraphicsItem*>();
- if (QDeclarativeItem3D* item3d =
- qobject_cast<QDeclarativeItem3D*>(newItem))
- {
- setItemViewport(item3d);
- }
- };
- return QGraphicsItem::itemChange(change, value);
-}
-QT_END_NAMESPACE
diff --git a/src/imports/threed/viewport.h b/src/imports/threed/viewport.h
deleted file mode 100644
index c0c9c055..00000000
--- a/src/imports/threed/viewport.h
+++ /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 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 VIEWPORT_H
-#define VIEWPORT_H
-
-#include <QtDeclarative/qdeclarativeitem.h>
-
-#include "qdeclarativeitem3d.h"
-#include "qdeclarativeviewport.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-class ViewportPrivate;
-class QGLCamera;
-class QGLLightModel;
-class QGLLightParameters;
-class QDeclarativeEffect;
-
-class Viewport : public QDeclarativeItem, public QDeclarativeViewport
-{
- Q_OBJECT
- Q_PROPERTY(bool picking READ picking WRITE setPicking NOTIFY viewportChanged)
- Q_PROPERTY(bool showPicking READ showPicking WRITE setShowPicking NOTIFY viewportChanged)
- Q_PROPERTY(bool showSceneGraph READ showSceneGraph WRITE setShowSceneGraph NOTIFY showSceneGraphChanged)
- Q_PROPERTY(bool navigation READ navigation WRITE setNavigation NOTIFY viewportChanged)
- Q_PROPERTY(bool fovzoom READ fovzoom WRITE setFovzoom NOTIFY viewportChanged)
- Q_PROPERTY(bool blending READ blending WRITE setBlending NOTIFY viewportChanged)
- Q_PROPERTY(QGLCamera *camera READ camera WRITE setCamera)
- Q_PROPERTY(QGLLightParameters *light READ light WRITE setLight NOTIFY viewportChanged)
- Q_PROPERTY(QGLLightModel *lightModel READ lightModel WRITE setLightModel NOTIFY viewportChanged)
-public:
- Viewport(QDeclarativeItem *parent = 0);
- ~Viewport();
-
- bool picking() const;
- void setPicking(bool value);
-
- bool showPicking() const;
- void setShowPicking(bool value);
-
- bool showSceneGraph() const;
- void setShowSceneGraph(bool show);
-
- bool navigation() const;
- void setNavigation(bool value);
-
- bool fovzoom() const;
- void setFovzoom(bool value);
-
- bool blending() const;
- void setBlending(bool value);
-
- QGLCamera *camera() const;
- void setCamera(QGLCamera *value);
-
- QGLLightParameters *light() const;
- void setLight(QGLLightParameters *value);
-
- QGLLightModel *lightModel() const;
- void setLightModel(QGLLightModel *value);
-
- void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *);
-
- int registerPickableObject(QObject *obj);
- virtual void registerEarlyDrawObject(QObject *obj, int order);
-
- Q_INVOKABLE QObject *objectForPoint(qreal x, qreal y);
-
-Q_SIGNALS:
- void viewportChanged();
- void showSceneGraphChanged();
-
-public Q_SLOTS:
- void update3d();
-
-private Q_SLOTS:
- void cameraChanged();
-
-protected:
- void mousePressEvent(QGraphicsSceneMouseEvent *event);
- void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
- void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
- void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
- void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
- void hoverMoveEvent(QGraphicsSceneHoverEvent *event);
- void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
- void wheelEvent(QGraphicsSceneWheelEvent *event);
- void keyPressEvent(QKeyEvent *event);
- virtual QVariant itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value);
-
-private:
- ViewportPrivate *d;
-
- void earlyDraw(QGLPainter *painter);
- void draw(QGLPainter *painter);
- void initializeGL(QGLPainter *painter);
-
- bool hoverEvent(QGraphicsSceneHoverEvent *event);
-
- QObject *objectForPoint(const QPointF &pos)
- {
- return objectForPoint(pos.x(), pos.y());
- }
-
- void wheel(qreal delta);
- void pan(qreal deltax, qreal deltay);
- void rotate(qreal deltax, qreal deltay);
- QPointF viewDelta(qreal deltax, qreal deltay);
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(Viewport)
-
-QT_END_HEADER
-
-#endif
diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro
deleted file mode 100644
index 19979051..00000000
--- a/src/plugins/plugins.pro
+++ /dev/null
@@ -1,2 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS = sceneformats
diff --git a/src/plugins/qpluginbase.pri b/src/plugins/qpluginbase.pri
deleted file mode 100644
index b1aa081c..00000000
--- a/src/plugins/qpluginbase.pri
+++ /dev/null
@@ -1,21 +0,0 @@
-TEMPLATE = lib
-isEmpty(QT_MAJOR_VERSION) {
- VERSION=4.7.0
-} else {
- VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION}
-}
-CONFIG += qt plugin
-
-win32|mac:!wince*:!win32-msvc:!macx-xcode:CONFIG += debug_and_release
-TARGET = $$qtLibraryTarget($$TARGET)
-contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols
-
-include(qt_targets.pri)
-
-wince*:LIBS += $$QMAKE_LIBS_GUI
-
-symbian: {
- TARGET.EPOCALLOWDLLDATA=1
- TARGET.CAPABILITY = All -Tcb
- TARGET = $${TARGET}$${QT_LIBINFIX}
-}
diff --git a/src/plugins/qt_targets.pri b/src/plugins/qt_targets.pri
deleted file mode 100644
index 8c9a8dd0..00000000
--- a/src/plugins/qt_targets.pri
+++ /dev/null
@@ -1,4 +0,0 @@
-QMAKE_TARGET_COMPANY = Nokia Corporation and/or its subsidiary(-ies)
-QMAKE_TARGET_PRODUCT = Qt4
-QMAKE_TARGET_DESCRIPTION = C++ application development framework.
-QMAKE_TARGET_COPYRIGHT = Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
diff --git a/src/plugins/sceneformats/3ds/3ds.pro b/src/plugins/sceneformats/3ds/3ds.pro
deleted file mode 100644
index 0dabe5fc..00000000
--- a/src/plugins/sceneformats/3ds/3ds.pro
+++ /dev/null
@@ -1,50 +0,0 @@
-TARGET = qscene3ds
-include(../../qpluginbase.pri)
-include(../../../../pkg.pri)
-HEADERS += qgl3dsloader.h \
- qgl3dsscene.h \
- qgl3dsscenehandler.h \
- qgl3dsmesh.h
-SOURCES += main.cpp \
- qgl3dsloader.cpp \
- qgl3dsscene.cpp \
- qgl3dsscenehandler.cpp \
- qgl3dsmesh.cpp
-
-# See the README in the root dir re this code
-package {
- macx:CONFIG(qt_framework, qt_framework|qt_no_framework) {
- LIBS += -framework Qt3D -F../../../threed
- INCLUDEPATH += ../../../threed/Qt3D.framework/Versions/1/Headers
- } else {
- win32 {
- CONFIG(debug, debug|release) {
- TARGET = $$member(TARGET, 0)d
- LIBS += ..\\..\\..\\threed\\debug\\Qt3Dd.lib
- } else {
- LIBS += ..\\..\\..\\threed\\release\\Qt3D.lib
- }
- } else {
- LIBS += -L../../../threed -lQt3D
- }
- INCLUDEPATH += ../../../../include/Qt3D
- }
- target.path = $$QT3D_INSTALL_PLUGINS/sceneformats]
- INSTALLS += target
-} else {
- CONFIG += qt3d
- DESTDIR = $$QT3D_INSTALL_PLUGINS/sceneformats
-}
-
-system_3ds {
- !isEmpty(QMAKE_INCDIR_3DS):INCLUDEPATH += $$QMAKE_INCDIR_3DS
- !isEmpty(QMAKE_LIBDIR_3DS):LIBS += -L$$QMAKE_LIBDIR_3DS
-
- !isEmpty(QMAKE_LIBS_3DS):LIBS += -l$$QMAKE_LIBS_3DS
- else {
- win32:LIBS += -llib3ds-1_3
- else:LIBS += -l3ds
- }
-} else {
- include(../../../../3rdparty/lib3ds/lib3ds.pri)
-}
diff --git a/src/plugins/sceneformats/3ds/README.txt b/src/plugins/sceneformats/3ds/README.txt
deleted file mode 100644
index 1fa00084..00000000
--- a/src/plugins/sceneformats/3ds/README.txt
+++ /dev/null
@@ -1,55 +0,0 @@
-This implementation of 3D studio max file import relies on the library
-lib3ds available from http://lib3ds.org/. A copy of this library is
-included with Qt/3D, or you can download and build your own version
-as described below.
-
-To enable building and use of the plugin, pass CONFIG+=system_3ds to qmake
-
-Currently version 1.3 is required. Do not use version 2.0 or later as it is incompatible.
-
-For Linux systems typically 1.3 can be obtained by installing a binary package, eg lib3ds-dev
-
-When compiling from source on Unix a simple ./configure, make, make install seems to work fine
-on both linux and mac osx.
-
-On windows with Visual Studio the lib3ds library can be compiled as follows.
-
-1) Download the zipped source of 1.3 and expand it, cd into the directory created.
-
-2) Edit the file msvc8\lib3ds.rc
- -#include "winres.h"
- +#include "WinResrc.h"
-
-3) Locate the vcbuild.exe on the windows system:
-
- // this is needed for VS9
- C:\path\to\vcbuild.exe /upgrade msvc8\lib3ds.vcproj
- C:\path\to\vcbuild.exe msvc8\lib3ds.vcproj
-
-4) Release and debug versions of the library files will be created. Install by:
-
- xcopy msvc8\release\* C:\path\to\bin
- xcopy msvc8\debug\* C:\path\to\bin
-
-To avoid having to install the lib3ds.org library/dll/headers in a path where the compiler
-will locate them, pass the following arguments to qmake:
- QMAKE_LIBDIR_3DS=C:\build\lib3ds\msvc8\release
- QMAKE_INCDIR_3DS=C:\build\lib3ds
-
-If the library is called something different to lib3ds-1_3 on windows or lib3ds.1.3.so on
-Unix, for example to use the debug library on windows pass this argument to qmake:
- QMAKE_LIBS_3DS=lib3ds-1_3d
-
-There is a handy 3dsplay utility in the lib3ds distribution - its not needed for Qt3D but is
-convenient for debugging models.
-
-To build the 3dsplay utility - a command line 3ds viewer that uses GLUT and OpenGL - after
-building and installing lib3ds as above, from the build directory use:
-Linux: gcc -o 3dsplay -lGL -lglut -l3ds examples/3dsplay.c
-MacOSX: gcc -FOpenGL -FGLUT -framework OpenGL -framework GLUT -l3ds -o 3dsplay examples/3dsplay.c
-
-To get image loading support to enable textures, this works on MacSOX:
-First install SDL: http://www.libsdl.org/download-1.2.php
-And SDL_image: http://www.libsdl.org/projects/SDL_image/
- gcc -c -DUSE_SDL -o examples/3dsplay.o -I/Library/Frameworks/SDL.framework/Headers -I/Library/Frameworks/SDL_image.framework/Headers examples/3dsplay.c
- gcc -framework SDL_image -framework SDL -framework OpenGL -framework GLUT -l3ds -o 3dsplay examples/3dsplay.o
diff --git a/src/plugins/sceneformats/3ds/main.cpp b/src/plugins/sceneformats/3ds/main.cpp
deleted file mode 100644
index bc2b322d..00000000
--- a/src/plugins/sceneformats/3ds/main.cpp
+++ /dev/null
@@ -1,70 +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 "qglsceneformatplugin.h"
-#include "qgl3dsscenehandler.h"
-
-QT_BEGIN_NAMESPACE
-
-class QGL3dsScenePlugin : public QGLSceneFormatPlugin
-{
-public:
- QStringList keys() const;
- virtual QGLSceneFormatHandler *create(QIODevice *device, const QUrl& url, const QString &format) const;
-};
-
-QStringList QGL3dsScenePlugin::keys() const
-{
- return QStringList() << QLatin1String("3ds") << QLatin1String("application/x-3ds") << QLatin1String("image/x-3ds");
-}
-
-QGLSceneFormatHandler *QGL3dsScenePlugin::create(QIODevice *device, const QUrl& url, const QString &format) const
-{
- Q_UNUSED(device);
- Q_UNUSED(url);
- Q_UNUSED(format);
- return new QGL3dsSceneHandler;
-}
-
-Q_EXPORT_STATIC_PLUGIN(QGL3dsScenePlugin)
-Q_EXPORT_PLUGIN2(qscene3ds, QGL3dsScenePlugin)
-
-QT_END_NAMESPACE
diff --git a/src/plugins/sceneformats/3ds/qgl3dsloader.cpp b/src/plugins/sceneformats/3ds/qgl3dsloader.cpp
deleted file mode 100644
index 07690d6d..00000000
--- a/src/plugins/sceneformats/3ds/qgl3dsloader.cpp
+++ /dev/null
@@ -1,333 +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 "qgl3dsloader.h"
-#include "qglmaterial.h"
-#include "qglmaterialcollection.h"
-#include "qglpainter.h"
-#include "qgltexture2d.h"
-#include "qgl3dsscene.h"
-#include "qglscenenode.h"
-#include "qgl3dsmesh.h"
-
-#include <lib3ds/mesh.h>
-#include <lib3ds/file.h>
-#include <lib3ds/node.h>
-#include <lib3ds/material.h>
-#include <lib3ds/matrix.h>
-
-#include <QtCore/qvarlengtharray.h>
-#include <QtCore/qdir.h>
-#include <QtCore/qobject.h>
-#include <QtCore/qfileinfo.h>
-
-QGL3dsLoader::QGL3dsLoader(Lib3dsFile *file, QGL3dsSceneHandler* sh)
- : m_file(file)
- , m_rootNode(new QGLSceneNode())
- , m_scene(sh)
- , m_hasTextures(false)
-{
- m_rootNode->setPalette(new QGLMaterialCollection(m_rootNode));
- m_rootNode->setObjectName(QString::fromLocal8Bit(file->name));
- setUrl(sh->url());
-}
-
-QGL3dsLoader::~QGL3dsLoader()
-{
- // nothing to do here - m_rootNode is taken ownership of by caller of
- // rootNode() method
-}
-
-/*!
- Sets the location for resolving resource paths to \a url.
-
- Only URL's with a "file" scheme are supported.
-*/
-void QGL3dsLoader::setUrl(const QUrl &url)
-{
- // TODO - handling of network URLs
- if (url.scheme() == QLatin1String("file"))
- m_url = url;
- else
- qWarning("QGL3dsLoader::setUrl(%s): ignored, only file urls supported",
- url.encodedPath().constData());
-}
-
-void QGL3dsLoader::loadMesh(Lib3dsMesh *mesh)
-{
-#ifndef QT_NO_DEBUG_STREAM
- if (mesh->points == 0 && (m_scene->options() & QGL::ShowWarnings))
- qDebug() << "Mesh" << mesh->name << "has zero vertex count";
- else if (mesh->faces == 0 && (m_scene->options() & QGL::ShowWarnings))
- qDebug() << "Mesh" << mesh->name << "has zero face count";
-#endif
- QGL3dsMesh m(mesh, m_rootNode->palette());
- QString name = QString::fromLatin1(mesh->name);
- QGL::ModelOptions o = m_scene->meshOptions(name);
- if (o == 0)
- o = m_scene->options();
- m.setOptions(o);
- QGLSceneNode *node;
- if (mesh->faces == 0 || mesh->points == 0)
- {
- node = new QGLSceneNode(m_rootNode);
- node->setObjectName(name);
- m_meshes.insert(name, node);
- return;
- }
- m.initialize();
- if (!m_hasTextures)
- m_hasTextures = m.hasTexture();
- if (!m_hasLitMaterials)
- m_hasLitMaterials = !m.hasTexture();
- node = m.finalizedSceneNode();
- m_meshes.insert(name, node);
- m_rootNode->addNode(node);
-}
-
-#ifndef QT_NO_DEBUG_STREAM
-static const char *node_type_names[] = {
- "LIB3DS_UNKNOWN_NODE",
- "LIB3DS_AMBIENT_NODE",
- "LIB3DS_OBJECT_NODE",
- "LIB3DS_CAMERA_NODE",
- "LIB3DS_TARGET_NODE",
- "LIB3DS_LIGHT_NODE",
- "LIB3DS_SPOT_NODE"
-};
-#endif
-
-inline static QMatrix4x4 getNodeMatrix(Lib3dsNode *node)
-{
- QMatrix4x4 nodeMatrix;
- for (int col = 0; col < 4; ++col)
- for (int row = 0; row < 4; ++row)
- nodeMatrix(row, col) = node->matrix[col][row];
- nodeMatrix.optimize();
- Lib3dsObjectData *d = &node->data.object;
- if (!qFuzzyIsNull(d->pivot[0]) || !qFuzzyIsNull(d->pivot[1]) || !qFuzzyIsNull(d->pivot[2]))
- nodeMatrix.translate(-d->pivot[0], -d->pivot[1], -d->pivot[2]);
- return nodeMatrix;
-}
-
-void QGL3dsLoader::loadNodes(Lib3dsNode *nodeList, QGLSceneNode *parentNode)
-{
- Lib3dsNode *node;
- for (node = nodeList; node != NULL; node = node->next)
- {
- if (node->type == LIB3DS_OBJECT_NODE)
- {
- Lib3dsObjectData *d = &node->data.object;
- QString meshName = QString::fromLatin1(d->morph);
- if (meshName.isEmpty())
- meshName = QString::fromLatin1(d->instance);
- if (meshName.isEmpty())
- meshName = QString::fromLatin1(node->name);
- if (!meshName.isEmpty() && m_meshes.contains(meshName))
- {
- QGLSceneNode *mesh = m_meshes[meshName];
- QMatrix4x4 mat = getNodeMatrix(node);
- mat = mat * mesh->localTransform();
- mesh->setLocalTransform(mat);
- }
- else
- {
- QGLSceneNode *sceneNode = new QGLSceneNode(parentNode);
- sceneNode->setPalette(parentNode->palette());
- sceneNode->setLocalTransform(getNodeMatrix(node));
- //sceneNode->userTransform().setToIdentity(); //DP: set matrix to identity so it is initialised in a useful way at least.
- QString nodeName(QString::fromLatin1(node->name));
- if (nodeName == QLatin1String("$$$DUMMY"))
- {
- nodeName = QString::fromLatin1(node->data.object.instance);
- sceneNode->setObjectName(nodeName);
- loadNodes(node->childs, sceneNode);
- }
- }
- }
-#ifndef QT_NO_DEBUG_STREAM
- else
- {
- qDebug() << "Node" << node->name << "of type" << node_type_names[node->type] << "not currently supported";
- }
-#endif
- }
-}
-
-/*!
- \internal
- Loads all the geometry, materials, and texture associations from the assigned
- file, and returns the root node of the resulting scene graph.
-
- The caller must take ownership of the root node returned, and delete it
- when its no longer required.
-*/
-QGLSceneNode *QGL3dsLoader::loadMeshes()
-{
- Q_CHECK_PTR(m_file);
- Lib3dsMaterial *mat;
- for (mat = m_file->materials; mat != NULL; mat = mat->next)
- loadMaterial(mat);
- Lib3dsMesh * mesh;
- for (mesh = m_file->meshes; mesh != NULL; mesh = mesh->next)
- loadMesh(mesh);
- QGL::MeshOptionMap optList = m_scene->meshOptions();
- QStringList optionedMeshes = optList.keys();
- QStringList gotMeshes = m_meshes.keys();
- for (int i = 0; i < gotMeshes.size(); ++i)
- optionedMeshes.removeAll(gotMeshes.at(i));
- for (int i = 0; i < optionedMeshes.size(); ++i)
- qWarning("Option specified, but mesh %s not found",
- qPrintable(optionedMeshes.at(i)));
- m_rootNode->palette()->removeUnusedMaterials();
- loadNodes(m_file->nodes, m_rootNode);
- m_rootNode->setEffect(m_hasTextures ? QGL::LitModulateTexture2D : QGL::LitMaterial);
- return m_rootNode;
-}
-
-/*!
- \internal
- Search for a resource based on the given \a path.
-
- If the URL for the currently loading mesh has a scheme other than
- "file" then a URL with the path relative to that URL is returned.
-
- If the URL for the currently loading mesh has a "file" scheme, then
- first a case-sensitive search is done of all of the current directory,
- and the :/ resource directory, and the directory of the current mesh
- file.
-
- If the file is not found in any of those locations then they are
- searched again case-insensitively. If the file is found, then a
- URL based on the absolute file path of the matching file is returned.
-
- Otherwise an empty string is returned.
-*/
-QUrl QGL3dsLoader::ensureResource(const QString &path)
-{
- QUrl res;
- if (m_url.scheme() == QLatin1String("file"))
- {
- res = m_url.resolved(path);
- if (QFile::exists(res.path())) // shortcut common case
- return res;
- QStringList paths;
- paths << QLatin1String(".") << QLatin1String(":/"); // current directory and aliased/root resource file
- if (!m_url.isEmpty())
- {
- QFileInfo fi(m_url.path());
- paths.prepend(fi.absoluteDir().absolutePath());
- }
- bool caseInsensitive = false;
- do {
- QStringList::const_iterator it(paths.begin());
- for ( ; it != paths.end(); ++it)
- {
- QDir resDir(*it);
- QStringList fileList = resDir.entryList(QDir::Files);
- if (caseInsensitive)
- {
- QStringList::const_iterator fit(fileList.begin());
- for ( ; fit != fileList.end(); ++fit)
- {
- if (fit->toLower() == path.toLower())
- {
- res.setScheme(QLatin1String("file"));
- res.setPath(resDir.absoluteFilePath(*fit));
- break;
- }
- }
- }
- else
- {
- if (fileList.contains(path))
- {
- //return resDir.absoluteFilePath(path);
- res.setScheme(QLatin1String("file"));
- res.setPath(resDir.absoluteFilePath(path));
- break;
- }
- }
- }
- if (caseInsensitive)
- break;
- caseInsensitive = true;
- } while (true);
- }
- else
- {
- // non-file url
- res = m_url.resolved(path);
- }
- return res;
-}
-
-/*!
- Load a material
-*/
-void QGL3dsLoader::loadMaterial(Lib3dsMaterial *mat3ds)
-{
- QGLMaterialCollection *palette = m_rootNode->palette();
- QGLMaterial *mat = new QGLMaterial();
- Lib3dsRgba &amb = mat3ds->ambient;
- Lib3dsRgba &dif = mat3ds->diffuse;
- Lib3dsRgba &spc = mat3ds->specular;
- mat->setAmbientColor(QColor::fromRgbF(amb[0], amb[1], amb[2], amb[3]));
- mat->setDiffuseColor(QColor::fromRgbF(dif[0], dif[1], dif[2], dif[3]));
- mat->setSpecularColor(QColor::fromRgbF(spc[0], spc[1], spc[2], spc[3]));
- mat->setShininess(128 * mat3ds->shininess);
- mat->setObjectName(QString::fromLatin1(mat3ds->name));
- palette->addMaterial(mat);
- if (mat3ds->texture1_map.name[0])
- {
- QString txName(QString::fromLatin1(mat3ds->texture1_map.name));
- QUrl url = ensureResource(txName);
- if (url.isEmpty())
- {
- if (m_scene->options() & QGL::ShowWarnings)
- qWarning("Could not load texture: %s", mat3ds->texture1_map.name);
- }
- else
- {
- mat->setTextureUrl(url);
- }
- }
-}
diff --git a/src/plugins/sceneformats/3ds/qgl3dsloader.h b/src/plugins/sceneformats/3ds/qgl3dsloader.h
deleted file mode 100644
index 696e31b7..00000000
--- a/src/plugins/sceneformats/3ds/qgl3dsloader.h
+++ /dev/null
@@ -1,81 +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 QGL3DSLOADER_H
-#define QGL3DSLOADER_H
-
-#include <QtCore/qurl.h>
-#include <QtCore/qstring.h>
-#include <QtCore/qmap.h>
-
-class Lib3dsFile;
-class Lib3dsMesh;
-class Lib3dsMaterial;
-class Lib3dsNode;
-class QGL3dsMesh;
-class QGLSceneNode;
-class QGL3dsSceneHandler;
-
-class QGL3dsLoader
-{
-public:
- QGL3dsLoader(Lib3dsFile *file, QGL3dsSceneHandler* sh);
- ~QGL3dsLoader();
- QGLSceneNode *loadMeshes();
-
-private:
- void loadMesh(Lib3dsMesh *);
- void loadNodes(Lib3dsNode *, QGLSceneNode *);
- void loadMaterial(Lib3dsMaterial *);
- QUrl ensureResource(const QString &);
- void setUrl(const QUrl &url);
-
- Lib3dsFile *m_file;
- QGLSceneNode *m_rootNode;
- QGL3dsSceneHandler *m_scene;
- QList<QGLSceneNode *> m_nodes;
- QMap<QString, QGLSceneNode *> m_meshes;
- QUrl m_url;
- bool m_hasTextures;
- bool m_hasLitMaterials;
-};
-
-#endif // QGL3DSLOADER_H
diff --git a/src/plugins/sceneformats/3ds/qgl3dsmesh.cpp b/src/plugins/sceneformats/3ds/qgl3dsmesh.cpp
deleted file mode 100644
index 97b72f71..00000000
--- a/src/plugins/sceneformats/3ds/qgl3dsmesh.cpp
+++ /dev/null
@@ -1,755 +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 "qgl3dsmesh.h"
-#include "qglmaterialcollection.h"
-#include "qglsection_p.h"
-#include "qarray.h"
-#include "qvector_utils_p.h"
-
-#include <lib3ds/mesh.h>
-#include <lib3ds/material.h>
-#include <lib3ds/vector.h>
-#include <lib3ds/types.h>
-
-#include <QtGui/qmatrix4x4.h>
-#include <QtCore/qmath.h>
-
-// Faceted meshes look terrible when they have more than a small number
-// of faces. Usually if large meshes are faceted its some kind of error
-// in the model, or in importing of the model by lib3ds. Force on
-// smoothing when greater than this many faces are detected.
-#define FACETED_THRESHOLD 1000
-
-// Two faces that have an angle between their plane vectors with a cosine
-// less than this are judged to form a sharp (acute) angle.
-// -ve cosine (less than 0.0f) means 90 degrees or sharper like the sides
-// of a rectangular prism so this is a good value.
-#define ACUTE -0.0001f
-
-// Two vectors that have an angle between them with a cosine less than this
-// value are judged to be approximately the inverse of each other, for the
-// purposes of determining whether a normal has been inverted or not
-#define INVERSE -0.20f
-
-// Only try to correct normals if this many neighbour faces contribute to
-// the assessment. 2 or 3 are good values. 4 or greater is the same as
-// defining DO_NORMAL_CORRECT false
-#define AVG_CNT 2
-
-// make a QVector3D from a Lib3dsVector - by a hard cast. Its required
-// that QVector3D behave like a POD type - float[3] - for all of the
-// OpenGL stuff
-static inline QVector3D &l2v(Lib3dsVector &vec)
-{
- return reinterpret_cast<QVector3D&>(vec);
-}
-
-// is this a null 3ds vector - same as QVector3D::isNull()
-static inline bool qIsNull(const Lib3dsVector &vec)
-{
- return (qIsNull(vec[0]) && qIsNull(vec[1]) && qIsNull(vec[2]));
-}
-
-static inline bool qFskCompare(const Lib3dsVector &a, const Lib3dsVector &b)
-{
- return (qFskCompare(a[0], b[0]) && qFskCompare(a[1], b[1]) && qFskCompare(a[2], b[2]));
-}
-
-// find the normalized plane vector, that is a unit vector perpendicular
-// to the plane of the face. this is the same thing as the default normal
-static inline void planeVec(Lib3dsFace *face, Lib3dsPoint *pointList, Lib3dsVector result)
-{
- Lib3dsVector &l3a = pointList[face->points[0]].pos;
- Lib3dsVector &l3b = pointList[face->points[1]].pos;
- Lib3dsVector &l3c = pointList[face->points[2]].pos;
- lib3ds_vector_normal(result, l3a, l3b, l3c);
-}
-
-struct ModulateRecord
-{
- bool disabled;
- bool keyFresh;
- int facesProcessed;
- int numModulated;
- Lib3dsDword altKey;
- Lib3dsDword key;
-};
-
-QGL3dsMesh::QGL3dsMesh(Lib3dsMesh *mesh, QGLMaterialCollection *materials)
- : QGLBuilder(materials)
- , m_mesh(mesh)
- , m_texFlip(false)
- , m_hasZeroSmoothing(false)
- , m_faceMap(0)
-{
-}
-
-QGL3dsMesh::~QGL3dsMesh()
-{
- delete[] m_faceMap;
-}
-
-void QGL3dsMesh::processNodeForMaterial(int matIx, QGLSceneNode *node)
-{
- QGLSceneNode *s = sceneNode();
- QString baseName = s->objectName();
- node->setMaterialIndex(matIx);
- node->setObjectName(baseName + QLatin1String("::") +
- ((matIx == -1)
- ? QLatin1String("No_Material")
- : s->palette()->materialName(matIx)));
- checkTextures(matIx);
- generateVertices();
- s->palette()->markMaterialAsUsed(matIx);
-}
-
-void QGL3dsMesh::initAdjacencyMap()
-{
- Lib3dsFace *face;
- m_faceMap = new FacePtr[m_mesh->faces * 3];
- qMemSet(m_faceMap, 0, sizeof(m_faceMap));
- for (Lib3dsDword f = 0; f < m_mesh->faces; ++f)
- {
- face = &m_mesh->faceL[f];
- planeVec(face, m_mesh->pointL, face->normal);
- m_mesh->faceL[f].user.p = &m_faceMap[f*3];
- }
-}
-
-void QGL3dsMesh::initialize()
-{
- QGLSceneNode *s = sceneNode();
- s->setObjectName(QString::fromLatin1(m_mesh->name));
- if ((m_options & QGL::ForceSmooth) && (m_options & QGL::ForceFaceted))
- {
- if (m_options & QGL::ShowWarnings)
- qWarning("Both smooth and faceted forced on for %s: forcing smooth\n",
- m_mesh->name);
- m_options &= ~QGL::ForceFaceted;
- }
- initAdjacencyMap();
- if (m_options & (QGL::CorrectNormals | QGL::CorrectAcute))
- modulateMesh();
- analyzeMesh();
-
- if (m_smoothingGroups == 0)
- {
- bool forceSmooth = (m_options & QGL::ForceSmooth);
- if (!forceSmooth && m_mesh->faces > FACETED_THRESHOLD)
- {
- if (m_options & QGL::ShowWarnings)
- qWarning("Mesh %s has %d faces (threshold is %d):"
- "forcing smooth render", m_mesh->name, m_mesh->faces,
- FACETED_THRESHOLD);
- forceSmooth = true;
- }
- if (forceSmooth)
- {
- for (Lib3dsDword f = 0; f < m_mesh->faces; ++f)
- m_mesh->faceL[f].smoothing = 1;
- analyzeMesh();
- }
- }
-
- bool mixedTexturedAndPlain = m_plainMaterials.count() > 0 &&
- m_textureMaterials.count() > 0;
-
- s->setLocalTransform(meshMatrix());
-
- // start a new section and node
- newSection(m_smoothingGroups ? QGL::Smooth : QGL::Faceted);
- QGLSceneNode *node = currentNode();
-
- // process all the plain materials first, then textured to avoid effect swapping
- QList<int> matList = m_plainMaterials.toList();
- if (mixedTexturedAndPlain)
- {
- node->setEffect(QGL::LitMaterial);
- node->setObjectName(s->objectName() + QLatin1String("::Materials"));
- //qDebug() << ">>> mixed:" << node;
- pushNode();
- //qDebug() << " pushed - current now:" << currentNode();
- }
- else
- {
- s->setEffect(m_textureMaterials.count() > 0 ? QGL::LitModulateTexture2D : QGL::LitMaterial);
- }
- //qDebug() << "processing:" << matList.count() << "materials";
- while (matList.count() > 0)
- {
- int matIx = matList.takeFirst();
- processNodeForMaterial(matIx, node);
- if (matList.count() > 0)
- node = newNode();
- }
- matList = m_textureMaterials.toList();
- if (mixedTexturedAndPlain)
- {
- //qDebug() << "<<< mixed:" << currentNode();
- popNode();
- //qDebug() << " popped - current now:" << currentNode();
- node = currentNode();
- node->setEffect(QGL::LitModulateTexture2D);
- node->setObjectName(s->objectName() + QLatin1String("::Textures"));
- }
- while (matList.count() > 0)
- {
- int matIx = matList.takeFirst();
- processNodeForMaterial(matIx, node);
- if (matList.count() > 0)
- node = newNode();
- }
-}
-
-// Build a linked list, in a QArray: the first N*2 entries correspond
-// to the N vertices: for each n'th vertex, n*2 is the face number,
-// n*2+1is the index of the next entry for that vertex, or -1 if there
-// is no next entry.
-//
-// While on the job find the smoothing keys and store in allKeys.
-//
-// And zero out the user data pointer for each face, and calculate the
-// smoothing group count.
-QArray<int> QGL3dsMesh::mapFacesToVerts(Lib3dsDword *allKeys)
-{
- Lib3dsFace *face;
- QArray<int> vlist(m_mesh->points * 2, -1);
- int nx = 2 * m_mesh->points;
- m_smoothingGroupCount = 0;
- for (Lib3dsDword f = 0; f < m_mesh->faces; ++f)
- {
- face = &m_mesh->faceL[f];
- if (face->smoothing)
- {
- if (!(face->smoothing & *allKeys))
- {
- *allKeys |= face->smoothing;
- m_smoothingGroupCount += 1;
- }
- }
- for (int i = 0; i < 3; ++i)
- {
- int v = face->points[i];
- int ptr = v*2;
- int prv = -1;
- if (vlist[ptr] != -1)
- {
- prv = ptr;
- while (vlist[ptr+1] != -1)
- {
- ptr = vlist[ptr+1];
- prv = ptr;
- }
- ptr = nx;
- vlist.extend(2);
- nx += 2;
- }
- vlist[ptr] = f;
- vlist[ptr+1] = -1;
- if (prv != -1)
- vlist[prv+1] = ptr;
- }
- }
- return vlist;
-}
-
-void QGL3dsMesh::addToAdjacencyMap(Lib3dsFace *face, Lib3dsFace *neighbour)
-{
- Q_ASSERT(face);
- Q_ASSERT(face->user.p);
- Q_ASSERT(neighbour);
- FacePtr *h = static_cast<FacePtr*>(face->user.p);
- while (*h != 0)
- ++h;
- *h = neighbour;
-}
-
-// add to each face a linked list of its <= 3 neighbouring faces
-// and also ensure each face knows is own normal. Rather than doing
-// lots of small allocs, just assume every face has 3 neighbours
-// and allocate the list nodes in one big lump - the m_faceMap.
-// use the user data pointer in the lib3ds face struct to point
-// to the first node in the list.
-void QGL3dsMesh::buildAdjacencyMap(const QArray<int> &vlist)
-{
- Lib3dsFace *face;
- Lib3dsFace *nbr;
- for (Lib3dsDword f = 0; f < m_mesh->faces; ++f)
- {
- // for each edge (where an edge is a pair of verts) find ones
- // adjacent, ie both verts in edge have same face (which is
- // not this face).
- face = &m_mesh->faceL[f];
- for (int i = 0; i < 3; ++i)
- {
- Q_ASSERT(face->points[i] < m_mesh->points);
- int vi = 2 * face->points[i];
- int neighbouri = -1;
- while (true)
- {
- neighbouri = vlist[vi];
- if (neighbouri != (int)f)
- {
- Q_ASSERT(face->points[(i + 1) % 3] < m_mesh->points);
- int vj = 2 * face->points[(i + 1) % 3];
- int neighbourj = -1;
- while (true)
- {
- neighbourj = vlist[vj];
- if (neighbourj == neighbouri)
- {
- nbr = &m_mesh->faceL[neighbouri];
- // only add as neighbour if at least one smoothing group
- // is shared - still have to test again below for each group
- if (nbr->smoothing & face->smoothing)
- addToAdjacencyMap(face, nbr);
- break;
- }
- if (vlist[vj+1] == -1)
- break;
- vj = vlist[vj+1];
- }
- }
- if (vlist[vi+1] == -1)
- break;
- else
- vi = vlist[vi+1];
- }
- }
- }
-}
-
-static inline void incOrWarn(ModulateRecord *mod)
-{
- if (mod->altKey != 0x80000000)
- {
- mod->altKey <<= 1;
- }
- else
- {
- qWarning("Overflowed smoothing keys - modulation disabled.");
- mod->disabled = true;
- }
-}
-
-static inline void nextUnusedKey(ModulateRecord *mod, const Lib3dsDword &allKeys)
-{
- if (!mod->disabled)
- {
- if (mod->altKey != 0)
- incOrWarn(mod);
- else
- {
- mod->altKey = 1; // initialize
- }
- while ((mod->altKey & allKeys) && !mod->disabled)
- {
- incOrWarn(mod);
- }
- mod->keyFresh = true;
- }
-}
-
-static int numCorrected = 0;
-static int numWindingCorrected = 0;
-
-static inline void doNormalCorrect(Lib3dsFace *face)
-{
- QGL3dsMesh::FacePtr *n = reinterpret_cast<QGL3dsMesh::FacePtr*>(face->user.p);
- int acnt = 0;
- Lib3dsVector avgn = { 0 };
- for (; *n; ++n)
- {
- if ((*n)->smoothing & face->smoothing)
- {
- lib3ds_vector_add(avgn, avgn, (*n)->normal);
- ++acnt;
- }
- }
- if (acnt >= AVG_CNT)
- {
- lib3ds_vector_normalize(avgn);
- float na = lib3ds_vector_dot(face->normal, avgn);
- if (na < INVERSE)
- {
- //qWarning("corrected: %p - %d, %d, %d", face,
- // face->points[0], face->points[1], face->points[2]);
- //lib3ds_vector_dump(face->normal);
- lib3ds_vector_neg(face->normal);
- numWindingCorrected++;
- qSwap(face->points[1], face->points[2]);
- }
- }
-}
-
-static inline void modFace(Lib3dsFace *face, ModulateRecord *mod)
-{
- ++mod->numModulated;
- face->smoothing &= ~mod->key; // remove old key
- face->smoothing |= mod->altKey; // add in new key
- ::strncpy(face->material, "bright-red", 60); //debug
-}
-
-static inline void doModulate(Lib3dsFace *face, ModulateRecord *mod)
-{
- QGL3dsMesh::FacePtr *n = reinterpret_cast<QGL3dsMesh::FacePtr*>(face->user.p);
- ++mod->facesProcessed;
- for ( ; *n; ++n)
- {
- QGL3dsMesh::FacePtr neighbour = *n;
- if (neighbour->smoothing & face->smoothing)
- {
- if (lib3ds_vector_dot(face->normal, neighbour->normal) < ACUTE)
- {
- qWarning("Modulated due to ACUTE\n");
- modFace(neighbour, mod);
- mod->keyFresh = false;
- }
- }
- }
-}
-
-bool operator<(const QVector3D &a, const QVector3D &b)
-{
- if (qFskCompare(a.x(), b.x()))
- {
- if (qFskCompare(a.y(), b.y()))
- {
- if (qFskCompare(a.z(), b.z()))
- {
- return false; // they're equal a is not less than b
- }
- else
- {
- return a.z() < b.z();
- }
- }
- else
- {
- return a.y() < b.y();
- }
- }
- else
- {
- return a.x() < b.x();
- }
-}
-
-// Go thru each smoothing group - we don't care about the zero group since
-// they're already faceted. In each group process all connected faces
-// starting the queue off with a seed face (the first face in the group).
-// Set the alternate group to be the first unused smoothing group key.
-//
-// To process a face: add the face to the processed set; for each adjacent
-// face if its in this same smoothing group, add it to the queue.
-//
-// Modulate smoothing mode: if an adjacent face is at an acute angle to this
-// face, move it to the alternate group. Note that the alternate groups are
-// not further iterated since they are not in "each smoothing group"
-// (the allKeys variable).
-//
-// When the queue is empty, go to the next smoothing group in the mesh.
-
-// Normal repair mode: if a face normal is flipped in error, ie a mistake
-// in model building (typically points specified in the wrong order)
-// this can be detected and repaired. The normal is flipped if the inverse
-// of the normal is at an acute angle to the average of neighbour normals.
-// If detected the normals is corrected and the winding is also checked to
-// see if it needs to be corrected also.
-void QGL3dsMesh::modulateMesh()
-{
- if (!(m_options & (QGL::CorrectNormals | QGL::CorrectAcute)))
- return;
- FacePtr face;
- Lib3dsDword allKeys = 0;
- QArray<int> vlist = mapFacesToVerts(&allKeys);
- buildAdjacencyMap(vlist);
- QSet<FacePtr> processed;
- ModulateRecord mod;
- qMemSet(&mod, 0, sizeof(struct ModulateRecord));
- mod.key = 1;
- while ((mod.key < allKeys) && !mod.disabled && mod.key)
- {
- if (!(allKeys & mod.key))
- {
- ++mod.key;
- continue;
- }
- QArray<FacePtr> queue;
- Lib3dsDword fptr = 0;
- int head = 0;
- while (true)
- {
- if (head >= queue.size()) // seed another island of faces
- {
- if (!mod.keyFresh && head > 0) // if not first time thru, did we use last key?
- allKeys = allKeys | mod.altKey;
- FacePtr qf = 0;
- for ( ; fptr < m_mesh->faces; ++fptr)
- {
- qf = &m_mesh->faceL[fptr];
- if ((mod.key & qf->smoothing) && !processed.contains(qf))
- break;
- }
- if (fptr == m_mesh->faces)
- break;
- queue.append(qf);
- if (!mod.keyFresh)
- {
- nextUnusedKey(&mod, allKeys);
- if (mod.disabled)
- break;
- }
- }
- face = queue.at(head++);
- processed.insert(face);
- doNormalCorrect(face);
- doModulate(face, &mod);
- FacePtr *n = reinterpret_cast<FacePtr*>(face->user.p);
- for ( ; *n; ++n)
- if ((mod.key & (*n)->smoothing) && !processed.contains(*n))
- queue.append(*n);
- }
- }
- if ((m_options & QGL::CorrectNormals) && (m_options & QGL::ShowWarnings))
- qDebug() << "CorrectNormals mode:" << numCorrected << "normals corrected.";
- if ((m_options & QGL::CorrectAcute) && (m_options & QGL::ShowWarnings))
- qDebug() << "CorrectAcute mode:" << mod.numModulated << "normals corrected";
-}
-
-int QGL3dsMesh::cachedMaterialLookup(const char *material)
-{
- static bool initialized = false;
- static int lastLookup = -1;
- static char lastName[512];
- if (!initialized)
- {
- ::memset(lastName, 0, 512);
- initialized = true;
- }
- if (qstrncmp(lastName, material, 510) != 0)
- {
- lastLookup = sceneNode()->palette()->indexOf(QString::fromLatin1(material));
- qstrncpy(lastName, material, 510);
- }
- return lastLookup;
-}
-
-/*!
- \internal
- Find material indexes and smoothing groups used in this mesh. If any
- face has no material assigned then a -1 index will be listed.
- Also figures out how complex the mesh is, by finding the count of
- smoothing groups for the material with the greatest number of groups.
- If the mesh is faceted (no smoothing) but has greater than FACETED_THRESHOLD
- faces then smoothing is forced on and the mesh rescanned.
-
-*/
-void QGL3dsMesh::analyzeMesh()
-{
- QGLMaterialCollection *pal = sceneNode()->palette();
- Lib3dsFace *face;
- Lib3dsDword allKeys = 0;
- m_smoothingGroupCount = 0;
- m_hasZeroSmoothing = false;
- m_plainMaterials.clear();
- m_textureMaterials.clear();
- for (Lib3dsDword f = 0; f < m_mesh->faces; ++f)
- {
- face = &m_mesh->faceL[f];
- int matIx = cachedMaterialLookup(face->material);
-#ifndef QT_NO_DEBUG_STREAM
- if (matIx == -1 && strlen(face->material) != 0 && (m_options & QGL::ShowWarnings))
- qDebug("Bad .3ds file: no material %s! (Referenced in mesh %s)\n",
- face->material, m_mesh->name);
-#endif
- if (face->smoothing)
- {
- if ((face->smoothing & allKeys) != face->smoothing)
- {
- Lib3dsDword key = 1;
- while (key)
- {
- if ((key & face->smoothing) && !(allKeys & key))
- {
- allKeys = allKeys | key;
- m_smoothingGroupCount += 1;
- }
- key <<= 1;
- }
- }
- }
- else
- {
- m_hasZeroSmoothing = true;
- }
- if (!m_plainMaterials.contains(matIx) && !m_textureMaterials.contains(matIx))
- {
- QGLMaterial *mat = pal->material(matIx);
- if (mat && mat->texture())
- m_textureMaterials.insert(matIx);
- else
- m_plainMaterials.insert(matIx);
- }
- }
- m_smoothingGroups = allKeys;
-}
-
-/*!
- \internal
- Check the meshes textures and update the record of whether this mesh
- has textures or not. In debug mode issue a warning if the textures are
- corrupt (number of texels and vertices not equal).
-*/
-void QGL3dsMesh::checkTextures(int material)
-{
- QGLMaterial *mat = sceneNode()->palette()->material(material);
- QGLTexture2D *tex = (mat ? mat->texture() : 0);
- m_hasTextures = false;
- if (tex)
- {
- m_hasTextures = true;
-#ifndef QT_NO_DEBUG_STREAM
- if (m_mesh->points != m_mesh->texels)
- qWarning("Mesh %s has unequal number of texels (%d) and vertices (%d)",
- m_mesh->name, m_mesh->texels, m_mesh->points);
-#endif
- // all texture coordinates from 3ds have to be flipped because
- // 3ds uses the correct coordinate system, whilst qt uses
- // upside-down coordinates
- m_texFlip = (tex->bindOptions() & QGLContext::InvertedYBindOption) == 0;
- }
-}
-
-/*!
- \internal
- Returns any local transformation matrix for the mesh.
-*/
-QMatrix4x4 QGL3dsMesh::meshMatrix() const
-{
- Lib3dsMatrix &m = m_mesh->matrix; // typedef for float[4][4]
- QMatrix4x4 mat;
- for (int col = 0; col < 4; ++col)
- for (int row = 0; row < 4; ++row) {
- float e = m[col][row];
- if (qFuzzyIsNull(e))
- mat(row, col) = 0.0f;
- else
- mat(row, col) = e;
- }
- mat.optimize(); // setup to use optimizations
- if (mat.isIdentity())
- return mat;
- // The reverse transform is what we apply to model-view in order
- // to draw the underlying geometry
- bool invertible = true;
- mat = mat.inverted(&invertible);
- if (invertible)
- return mat;
- if (m_options & QGL::ShowWarnings)
- qWarning("Could not invert matrix for mesh %s", m_mesh->name);
- return QMatrix4x4();
-}
-
-/*!
- \internal
- Generate the vertices for the faces based on their smoothing keys and
- the current nodes material.
-*/
-void QGL3dsMesh::generateVertices()
-{
- int matIx = currentNode()->materialIndex();
- int keyCount = m_smoothingGroupCount;
- if (m_hasZeroSmoothing)
- ++keyCount;
- QString baseName = currentNode()->objectName();
- Lib3dsDword key = 0;
- while (key <= m_smoothingGroups)
- {
- if ((key & m_smoothingGroups) || ((key == 0) && m_hasZeroSmoothing))
- {
- if (key == 0)
- currentSection()->setSmoothing(QGL::Faceted);
- keyCount -= 1;
- currentNode()->setMaterialIndex(matIx);
- currentNode()->setObjectName(baseName + QLatin1String("::") + QString::number(key));
- QGeometryData tri;
- int cur = 0;
- for (Lib3dsDword f = 0; f < m_mesh->faces; ++f)
- {
- Lib3dsFace *face = &m_mesh->faceL[f];
- int faceMat = cachedMaterialLookup(face->material);
- if (faceMat == matIx &&
- ((key & face->smoothing) || (key == 0 && face->smoothing == 0)))
- {
- QVector3D norm = l2v(face->normal);
- for (int i = 0; i < 3; ++i)
- {
- int a = face->points[i];
- Lib3dsVector &l3a = m_mesh->pointL[a].pos;
- tri.appendVertex(l2v(l3a));
- tri.appendNormal(norm);
- if (m_hasTextures)
- {
- Lib3dsTexel &t0 = m_mesh->texelL[a];
- tri.appendTexCoord(QVector2D(t0[0], m_texFlip ? 1.0f - t0[1] : t0[1]));
- }
- if (m_options & QGL::NativeIndices)
- currentSection()->appendSmooth(tri.logicalVertexAt(cur++), a);
- }
- }
- }
- if (m_options & QGL::NativeIndices)
- currentNode()->setCount(cur);
- else
- addTriangles(tri);
- if (keyCount > 0)
- newSection(QGL::Smooth);
- else
- break;
- }
- if (key == 0)
- key = 1;
- else
- key <<= 1;
- }
-}
diff --git a/src/plugins/sceneformats/3ds/qgl3dsmesh.h b/src/plugins/sceneformats/3ds/qgl3dsmesh.h
deleted file mode 100644
index 2f2985d9..00000000
--- a/src/plugins/sceneformats/3ds/qgl3dsmesh.h
+++ /dev/null
@@ -1,95 +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 QGL3DSMESH_H
-#define QGL3DSMESH_H
-
-#include "qglbuilder.h"
-#include "qgl3dsscenehandler.h"
-
-#include <lib3ds/types.h>
-#include <lib3ds/mesh.h>
-
-class QGLMaterialCollection;
-class QGL3dsLoader;
-class Lib3dsMesh;
-class ModulateRecord;
-
-class QGL3dsMesh : public QGLBuilder
-{
-public:
- explicit QGL3dsMesh(Lib3dsMesh *mesh, QGLMaterialCollection *materials);
- virtual ~QGL3dsMesh();
- void initialize();
- void setOptions(QGL::ModelOptions options) { m_options = options; }
- bool hasTexture() { return m_hasTextures; }
-
- typedef Lib3dsFace *FacePtr;
-
-protected:
- void analyzeMesh();
- void modulateMesh();
- void checkTextures(int);
- QMatrix4x4 meshMatrix() const;
- void generateVertices();
-
-private:
- void processNodeForMaterial(int matIx, QGLSceneNode *node);
- QArray<int> mapFacesToVerts(Lib3dsDword *allKeys);
- void addToAdjacencyMap(Lib3dsFace *face, Lib3dsFace *nbr);
- void buildAdjacencyMap(const QArray<int> &vlist);
- int cachedMaterialLookup(const char *material);
- void findCommonNormal(ModulateRecord *mod) const;
- void initAdjacencyMap();
-
- Lib3dsMesh *m_mesh;
- bool m_hasTextures;
- Lib3dsDword m_smoothingGroups;
- int m_smoothingGroupCount;
- QSet<int> m_plainMaterials;
- QSet<int> m_textureMaterials;
- bool m_texFlip;
- bool m_hasZeroSmoothing;
- FacePtr *m_faceMap;
- QGL::ModelOptions m_options;
-};
-
-#endif // QGL3DSMESH_H
diff --git a/src/plugins/sceneformats/3ds/qgl3dsscene.cpp b/src/plugins/sceneformats/3ds/qgl3dsscene.cpp
deleted file mode 100644
index ec1f95fc..00000000
--- a/src/plugins/sceneformats/3ds/qgl3dsscene.cpp
+++ /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 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 "qgl3dsscene.h"
-
-#include "qglscenenode.h"
-#include "qgl3dsmesh.h"
-#include "qgl3dsloader.h"
-
-#include <lib3ds/file.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \internal
- \class QGL3dsScene
- \brief The QGL3dsScene class manages and contains a 3ds scene.
- The scene consists of a QGLSceneNode object which is the top-level node
- and references the geometry in a 3D Studio Max ".3ds" file. That top
- level node references sub-nodes
-*/
-
-/*!
- \internal
- Construct a new QGL3dsScene object using the data in the \a file,
- and setting the given \a parent. Resources are searched for at the
- given \a url.
-
- The QGL3dsScene object takes ownership of the \a file.
-*/
-QGL3dsScene::QGL3dsScene(Lib3dsFile *file, QGL3dsSceneHandler *h)
- : QGLAbstractScene(0)
- , mFile(file)
-{
- Q_ASSERT(h);
- Q_ASSERT(file);
- QGL3dsLoader loader(file, h);
- mRootNode = loader.loadMeshes();
-}
-
-/*!
- \reimp
- Destroy this QGL3dsScene, recovering all resources.
-
- This method destroys the Lib3dsFile object the scene is based
- on by calling the appropriate lib3ds function.
-*/
-QGL3dsScene::~QGL3dsScene()
-{
- lib3ds_file_free(mFile);
-}
-
-/*!
- \internal
- \reimp
-*/
-QList<QObject *> QGL3dsScene::objects() const
-{
- QList<QObject *> objs;
- if (!mRootNode)
- return objs;
- objs.append(mRootNode);
- QList<QGLSceneNode*> children = mRootNode->allChildren();
- QList<QGLSceneNode*>::const_iterator it = children.constBegin();
- for ( ; it != children.constEnd(); ++it)
- objs.append(*it);
- return objs;
-}
-
-/*!
- \internal
- \reimp
-*/
-QGLSceneNode *QGL3dsScene::mainNode() const
-{
- return mRootNode;
-}
-
-QT_END_NAMESPACE
diff --git a/src/plugins/sceneformats/3ds/qgl3dsscene.h b/src/plugins/sceneformats/3ds/qgl3dsscene.h
deleted file mode 100644
index f1fbda8a..00000000
--- a/src/plugins/sceneformats/3ds/qgl3dsscene.h
+++ /dev/null
@@ -1,82 +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 QGL3DSSCENE_H
-#define QGL3DSSCENE_H
-
-#include "qglabstractscene.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-#include <QtCore/qurl.h>
-
-class QGLSceneNode;
-class QGLSceneNode;
-class QGL3dsSceneHandler;
-class Lib3dsFile;
-
-class QGL3dsScene : public QGLAbstractScene
-{
- Q_OBJECT
-public:
- explicit QGL3dsScene(Lib3dsFile *file, QGL3dsSceneHandler *h);
- virtual ~QGL3dsScene();
-
- QList<QObject *> objects() const;
- QGLSceneNode *mainNode() const;
-
- QUrl url() const { return mUrl; }
-
-private:
- Lib3dsFile *mFile;
- QUrl mUrl;
- QGLSceneNode *mRootNode;
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/plugins/sceneformats/3ds/qgl3dsscenehandler.cpp b/src/plugins/sceneformats/3ds/qgl3dsscenehandler.cpp
deleted file mode 100644
index 5358774b..00000000
--- a/src/plugins/sceneformats/3ds/qgl3dsscenehandler.cpp
+++ /dev/null
@@ -1,255 +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 "qgl3dsscenehandler.h"
-#include "qgl3dsscene.h"
-
-#include <lib3ds/file.h>
-#include <lib3ds/io.h>
-#include <lib3ds/mesh.h>
-#include <lib3ds/node.h>
-
-#include <QtCore/qdir.h>
-#include <QtCore/qdebug.h>
-
-QT_BEGIN_NAMESPACE
-
-struct IODevice3ds
-{
- QIODevice *dev;
- bool errorState;
-
-};
-
-extern "C" {
- static Lib3dsBool qgl3ds_fileio_error_func(void *self)
- {
- IODevice3ds *io3d = (IODevice3ds*)self;
- return io3d->errorState;
- }
-
- static long qgl3ds_fileio_seek_func(void *self, long offset, Lib3dsIoSeek origin)
- {
- IODevice3ds *io3d = (IODevice3ds*)self;
- // cannot deal with sockets right now
- Q_ASSERT(!io3d->dev->isSequential());
- switch (origin)
- {
- case LIB3DS_SEEK_SET:
- io3d->errorState = io3d->dev->seek(offset);
- break;
- case LIB3DS_SEEK_CUR:
- io3d->errorState = io3d->dev->seek(io3d->dev->pos() + offset);
- break;
- case LIB3DS_SEEK_END:
- io3d->errorState = io3d->dev->seek(io3d->dev->size() + offset);
- break;
- default:
- Q_ASSERT(0);
- return(0);
- }
- if (io3d->errorState)
- return -1;
- return io3d->dev->pos();
- }
-
- static long qgl3ds_fileio_tell_func(void *self)
- {
- IODevice3ds *io3d = (IODevice3ds*)self;
- return io3d->dev->pos();
- }
-
- static size_t qgl3ds_fileio_read_func(void *self, void *buffer, size_t size)
- {
- IODevice3ds *io3d = (IODevice3ds*)self;
- qint64 result = io3d->dev->read((char*)buffer, size);
- io3d->errorState = (result == -1);
- if (io3d->errorState)
- qWarning("3ds io error: %s\n", io3d->dev->errorString().toLocal8Bit().constData());
- return result;
- }
-
- static size_t qgl3ds_fileio_write_func(void *self, const void *buffer, size_t size)
- {
- IODevice3ds *io3d = (IODevice3ds*)self;
- qint64 result = io3d->dev->write((char*)buffer, size);
- io3d->errorState = (result == -1);
- if (io3d->errorState)
- qWarning("3ds io error: %s\n", io3d->dev->errorString().toLocal8Bit().constData());
- return result;
- }
-}
-
-static Lib3dsFile *qgl3ds_lib3ds_file_load(QIODevice *iod)
-{
- Lib3dsFile *file;
- Lib3dsIo *io;
- Q_ASSERT(iod->isOpen() && iod->isReadable());
- file = lib3ds_file_new();
- if (!file) {
- iod->close();
- return(0);
- }
- IODevice3ds io3d;
- io3d.dev = iod;
- io3d.errorState = false;
- io = lib3ds_io_new(
- &io3d,
- qgl3ds_fileio_error_func,
- qgl3ds_fileio_seek_func,
- qgl3ds_fileio_tell_func,
- qgl3ds_fileio_read_func,
- qgl3ds_fileio_write_func
- );
- if (!io) {
- lib3ds_file_free(file);
- iod->close();
- return(0);
- }
- if (!lib3ds_file_read(file, io)) {
- lib3ds_file_free(file);
- iod->close();
- return(0);
- }
- lib3ds_io_free(io);
- iod->close();
- return(file);
-}
-
-QGL3dsSceneHandler::QGL3dsSceneHandler()
- : m_options(0)
-{
-}
-
-QGL3dsSceneHandler::~QGL3dsSceneHandler()
-{
- // nothing to do
-}
-
-void QGL3dsSceneHandler::decodeOptions(const QString &options)
-{
- static const char *validOptions[] = {
- "NativeIndices",
- "CorrectNormals",
- "CorrectAcute",
- "ForceSmooth",
- "ForceFaceted",
- "ShowWarnings"
- };
- static int optionKeys[] = {
- QGL::NativeIndices,
- QGL::CorrectNormals,
- QGL::CorrectAcute,
- QGL::ForceSmooth,
- QGL::ForceFaceted,
- QGL::ShowWarnings,
- -1
- };
-
- // format: "mesh=option mesh=option option option"
- // mesh: string name of a mesh in the file, with no spaces
- // standalone option applies to the whole file - all meshes
- // option: NativeIndices | CorrectNormals | CorrectAcute etc
- QStringList opList = options.split(QLatin1Char(' '), QString::SkipEmptyParts);
- for (int i = 0; i < opList.count(); ++i)
- {
- QString op = opList.at(i);
- QString mdl;
- if (op.contains(QLatin1Char('=')))
- {
- QStringList sl = op.split(QLatin1Char('='), QString::SkipEmptyParts);
- mdl = sl[0];
- op = sl[1];
- }
- int k = 0;
- for ( ; optionKeys[k] != -1; ++k)
- if (op == QLatin1String(validOptions[k]))
- break;
- if (optionKeys[k] != -1) // found
- {
- QGL::ModelOptions o = static_cast<QGL::ModelOptions>(optionKeys[k]);
- if (!mdl.isEmpty())
- setMeshOptions(o, mdl);
- else
- setOptions(o);
- }
- else
- {
- qWarning("Bad option: \"%s\" in %s", qPrintable(op),
- qPrintable(options));
- }
- }
-}
-
-QGLAbstractScene *QGL3dsSceneHandler::read()
-{
- Lib3dsFile *file = qgl3ds_lib3ds_file_load(device());
- Q_CHECK_PTR(file); // wtf?
-
- if (!file->nodes)
- {
- Lib3dsMesh *mesh;
- Lib3dsNode *node;
- for (mesh = file->meshes; mesh; mesh = mesh->next)
- {
- if (mesh->faces && mesh->points)
- {
- node = lib3ds_node_new_object();
- qstrcpy(node->name, mesh->name);
- node->parent_id = LIB3DS_NO_PARENT;
- lib3ds_file_insert_node(file, node);
- }
- }
- }
-
- lib3ds_file_eval(file, 0.0f);
-
- QGL3dsScene *scene = new QGL3dsScene(file, this);
- return scene;
-}
-
-QGLAbstractScene * QGL3dsSceneHandler::download()
-{
- qWarning() << "Network loading of 3ds files using this plugin is not implemented.";
- return NULL;
-}
-
-QT_END_NAMESPACE
diff --git a/src/plugins/sceneformats/3ds/qgl3dsscenehandler.h b/src/plugins/sceneformats/3ds/qgl3dsscenehandler.h
deleted file mode 100644
index a58e80f6..00000000
--- a/src/plugins/sceneformats/3ds/qgl3dsscenehandler.h
+++ /dev/null
@@ -1,100 +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 QGL3DSSCENEHANDLER_H
-#define QGL3DSSCENEHANDLER_H
-
-#include "qglsceneformatplugin.h"
-#include <QtCore/qmap.h>
-#include <QtCore/qdebug.h>
-
-QT_BEGIN_NAMESPACE
-
-namespace QGL {
- enum ModelOption
- {
- NativeIndices = 0x01,
- CorrectNormals = 0x02,
- CorrectAcute = 0x04,
- ForceSmooth = 0x08,
- ForceFaceted = 0x10,
- ShowWarnings = 0x20
- };
- Q_DECLARE_FLAGS(ModelOptions, ModelOption);
-
- typedef QMap<QString, QGL::ModelOptions> MeshOptionMap;
-};
-
-class QGL3dsSceneHandler : public QGLSceneFormatHandler
-{
-public:
- QGL3dsSceneHandler();
- ~QGL3dsSceneHandler();
-
- QGLAbstractScene *read();
- QGLAbstractScene *download();
-
- void setOptions(QGL::ModelOptions options) { m_options |= options; }
- QGL::ModelOptions options() const { return m_options; }
-
- void setMeshOptions(QGL::ModelOptions options, const QString &meshName)
- {
- m_meshOptions[meshName] |= options;
- }
- QGL::ModelOptions meshOptions(const QString &meshName) const
- {
- if (m_meshOptions.contains(meshName))
- return m_meshOptions.value(meshName);
- return 0;
- }
- QGL::MeshOptionMap meshOptions() const { return m_meshOptions; }
- void decodeOptions(const QString &options);
-
-private:
- QGL::ModelOptions m_options;
- QGL::MeshOptionMap m_meshOptions;
-};
-
-Q_DECLARE_OPERATORS_FOR_FLAGS(QGL::ModelOptions);
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/plugins/sceneformats/assimp/README.txt b/src/plugins/sceneformats/assimp/README.txt
deleted file mode 100644
index cabf1bdd..00000000
--- a/src/plugins/sceneformats/assimp/README.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-This importer uses the Asset Importer library available from:
-
-http://assimp.sourceforge.net/
-
-Copyright (c) 2008-2010 ASSIMP Development Team
-All rights reserved.
-
-For convenience a stripped down source tree is included in this distribution. See the license
-included at $QT3D_SOURCE/3rdparty/assimp/LICENCE, or at http://assimp.sourceforge.net/main_license.html
-
-To use your own build of AssImp, modify the assimp.pro file and/or export the environment variables
-specified there.
diff --git a/src/plugins/sceneformats/assimp/ailoaderiostream.cpp b/src/plugins/sceneformats/assimp/ailoaderiostream.cpp
deleted file mode 100644
index 7c8f1f97..00000000
--- a/src/plugins/sceneformats/assimp/ailoaderiostream.cpp
+++ /dev/null
@@ -1,124 +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 "ailoaderiostream.h"
-
-#include <QtCore/qiodevice.h>
-
-#include <QtCore/qdebug.h>
-
-AiLoaderIOStream::AiLoaderIOStream(QIODevice *device)
- : m_device(device)
- , m_errorState(false)
-{
- Q_ASSERT(device);
-}
-
-AiLoaderIOStream::~AiLoaderIOStream()
-{
- // Nothing to do here
-}
-
-size_t AiLoaderIOStream::Read( void* pvBuffer, size_t pSize, size_t pCount)
-{
- qint64 result = m_device->read((char*)pvBuffer, pSize * pCount);
- size_t res = result;
- m_errorState = (result == -1);
- if (m_errorState)
- qWarning("AI read error: %s\n", qPrintable(m_device->errorString()));
- if ((pSize * pCount) != res) // AI will treat as error
- {
- long unsigned int pSizeP = pSize;
- long unsigned int pCountP = pCount;
- long unsigned int pRes = res;
- qWarning("read mismatch requested size: %lu x count: %lu = %lu != %lu actuall read\n",
- pSizeP, pCountP, (pSizeP * pCountP), pRes);
- }
- return res;
-}
-
-size_t AiLoaderIOStream::Write( const void* pvBuffer, size_t pSize, size_t pCount)
-{
- qint64 result = m_device->write((char*)pvBuffer, pSize * pCount);
- m_errorState = (result == -1);
- if (m_errorState)
- qWarning("AI write error: %s\n", qPrintable(m_device->errorString()));
- return result;
-}
-
-aiReturn AiLoaderIOStream::Seek(size_t pOffset, aiOrigin pOrigin)
-{
- // cannot deal with sockets right now
- Q_ASSERT(!m_device->isSequential());
- switch (pOrigin)
- {
- case aiOrigin_SET:
- m_errorState = m_device->seek(pOffset);
- break;
- case aiOrigin_CUR:
- m_errorState = m_device->seek(m_device->pos() + pOffset);
- break;
- case aiOrigin_END:
- m_errorState = m_device->seek(m_device->size() + pOffset);
- break;
- default:
- Q_ASSERT(0);
- return(aiReturn_FAILURE);
- }
- if (m_errorState)
- return aiReturn_FAILURE;
- return aiReturn_SUCCESS;
-}
-
-size_t AiLoaderIOStream::Tell() const
-{
- return m_device->pos();
-}
-
-size_t AiLoaderIOStream::FileSize() const
-{
- return m_device->size();
-}
-
-void AiLoaderIOStream::Flush()
-{
- // do nothing
-}
diff --git a/src/plugins/sceneformats/assimp/ailoaderiostream.h b/src/plugins/sceneformats/assimp/ailoaderiostream.h
deleted file mode 100644
index b74d8c16..00000000
--- a/src/plugins/sceneformats/assimp/ailoaderiostream.h
+++ /dev/null
@@ -1,70 +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 AILOADERIOSTREAM_H
-#define AILOADERIOSTREAM_H
-
-#include <QtGlobal>
-#include "IOStream.h"
-#include "IOSystem.h"
-
-QT_BEGIN_NAMESPACE
-class QIODevice;
-QT_END_NAMESPACE
-
-class AiLoaderIOStream : public Assimp::IOStream
-{
-public:
- AiLoaderIOStream(QIODevice *device);
- ~AiLoaderIOStream();
- size_t Read( void* pvBuffer, size_t pSize, size_t pCount);
- size_t Write( const void* pvBuffer, size_t pSize, size_t pCount);
- aiReturn Seek( size_t pOffset, aiOrigin pOrigin);
- size_t Tell() const;
- size_t FileSize() const;
- void Flush();
- QIODevice *device() const { return m_device; }
-private:
- QIODevice *m_device;
- bool m_errorState;
-};
-
-#endif // AILOADERIOSTREAM_H
diff --git a/src/plugins/sceneformats/assimp/ailoaderiosystem.cpp b/src/plugins/sceneformats/assimp/ailoaderiosystem.cpp
deleted file mode 100644
index d8978596..00000000
--- a/src/plugins/sceneformats/assimp/ailoaderiosystem.cpp
+++ /dev/null
@@ -1,160 +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 "ailoaderiosystem.h"
-#include "ailoaderiostream.h"
-#include "DefaultLogger.h"
-
-#include <QtCore/qfile.h>
-#include <QtCore/qdir.h>
-
-AiLoaderIOSystem::AiLoaderIOSystem(QIODevice *device, QUrl url)
- : m_device(device)
- , m_url(url)
-{
-}
-
-AiLoaderIOSystem::~AiLoaderIOSystem()
-{
- // we don't own m_device
- qDeleteAll(m_sub);
-}
-
-bool AiLoaderIOSystem::Exists(const char* path) const
-{
- Q_UNUSED(path);
-
- return m_device->isReadable();
-}
-
-char AiLoaderIOSystem::getOsSeparator() const
-{
- return QDir::separator().toLatin1();
-}
-
-/*!
- \internal
- Open the pFile with the pMode, where mode is given by "man fopen"
-*/
-Assimp::IOStream* AiLoaderIOSystem::Open(const char* pFile, const char* pMode)
-{
- // This is just the file already opened on the device
- if (m_url.toEncoded().endsWith(pFile))
- return new AiLoaderIOStream(m_device);
-
- // New relative file
- QUrl rel;
- rel.setScheme(m_url.scheme());
- rel.setPath(QLatin1String(pFile));
- QUrl url = m_url.resolved(rel);
-
- if (url.scheme() != QLatin1String("file"))
- {
- //network cases should already be opened by this stage - they
- //depend entirely on the download manager returning a QBuffer, so
- //cannot be handled as the simple "open file" case shown below.
- qWarning("Directly opening a network URL is not supported. Use scene handler code. (URL: %s).", qPrintable(url.scheme()));
- return 0;
- }
-
- char mode_str[4];
- qMemSet(mode_str, '\0', 4);
- int i = 0;
- for (const char *ptr = pMode; i < 4 && *ptr; ++ptr)
- {
- if (*ptr != 'b') // ignore the binary attribute
- mode_str[i++] = *ptr;
- }
- QIODevice::OpenMode mode = QIODevice::NotOpen;
- if (::strncmp("r", mode_str, 1) == 0)
- {
- mode = QIODevice::ReadOnly;
- }
- else if (::strncmp("r+", mode_str, 2) == 0)
- {
- mode = QIODevice::ReadWrite;
- }
- else if (::strncmp("w", mode_str, 1) == 0)
- {
- mode = QIODevice::WriteOnly | QIODevice::Truncate;
- }
- else if (::strncmp("w+", mode_str, 2) == 0)
- {
- mode = QIODevice::ReadWrite | QIODevice::Truncate;
- }
- else if (::strncmp("a", mode_str, 1) == 0)
- {
- mode = QIODevice::WriteOnly | QIODevice::Append;
- }
- else if (::strncmp("a+", mode_str, 2) == 0)
- {
- mode = QIODevice::ReadWrite | QIODevice::Append;
- }
- else
- {
- std::string err("Error: invalid mode flag:");
- err.append(mode_str).append(" when opening ").append(pFile);
- Assimp::DefaultLogger::get()->warn(err);
- return 0;
- }
-
- QFile *f = new QFile(url.toLocalFile());
- bool res = f->open(mode);
- if (!res)
- {
- std::string err("Error: could not open subsequent file:");
- err.append(pFile).append("--").append(f->errorString().toStdString());
- Assimp::DefaultLogger::get()->warn(err);
- delete f;
- return 0;
- }
- m_sub.append(f);
- AiLoaderIOStream *s = new AiLoaderIOStream(f);
- return s;
-}
-
-void AiLoaderIOSystem::Close(Assimp::IOStream* stream)
-{
- AiLoaderIOStream *s = static_cast<AiLoaderIOStream*>(stream);
- Q_ASSERT(s);
- s->device()->close();
- delete stream;
-}
diff --git a/src/plugins/sceneformats/assimp/ailoaderiosystem.h b/src/plugins/sceneformats/assimp/ailoaderiosystem.h
deleted file mode 100644
index 00d2da6c..00000000
--- a/src/plugins/sceneformats/assimp/ailoaderiosystem.h
+++ /dev/null
@@ -1,70 +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 AILOADERIOSYSTEM_H
-#define AILOADERIOSYSTEM_H
-
-#include "IOSystem.h"
-
-#include <QtCore/qurl.h>
-
-QT_BEGIN_NAMESPACE
-class QIODevice;
-QT_END_NAMESPACE
-
-class IOStream;
-
-class AiLoaderIOSystem : public Assimp::IOSystem
-{
-public:
- AiLoaderIOSystem(QIODevice *device, QUrl url);
- ~AiLoaderIOSystem();
- virtual bool Exists( const char* path) const;
- virtual char getOsSeparator() const;
- virtual Assimp::IOStream* Open(const char* pFile, const char* pMode = "rb");
- virtual void Close(Assimp::IOStream* pFile);
-private:
- QIODevice *m_device;
- QList<QIODevice*> m_sub;
- QUrl m_url;
-};
-
-#endif // AILOADERIOSYSTEM_H
diff --git a/src/plugins/sceneformats/assimp/assimp.pro b/src/plugins/sceneformats/assimp/assimp.pro
deleted file mode 100644
index 142a62c7..00000000
--- a/src/plugins/sceneformats/assimp/assimp.pro
+++ /dev/null
@@ -1,62 +0,0 @@
-TARGET = qsceneai
-include(../../qpluginbase.pri)
-include(../../../../pkg.pri)
-HEADERS += qailoader.h \
- qaiscene.h \
- qaiscenehandler.h \
- qaimesh.h \
- ailoaderiostream.h \
- ailoaderiosystem.h
-SOURCES += main.cpp \
- qailoader.cpp \
- qaiscene.cpp \
- qaiscenehandler.cpp \
- qaimesh.cpp \
- ailoaderiostream.cpp \
- ailoaderiosystem.cpp
-
-# See the README in the root dir re this code
-package {
- macx:CONFIG(qt_framework, qt_framework|qt_no_framework) {
- LIBS += -framework Qt3D -F../../../threed
- INCLUDEPATH += ../../../threed/Qt3D.framework/Versions/1/Headers
- } else {
- win32 {
- CONFIG(debug, debug|release) {
- TARGET = $$member(TARGET, 0)d
- LIBS += ..\\..\\..\\threed\\debug\\Qt3Dd.lib
- } else {
- LIBS += ..\\..\\..\\threed\\release\\Qt3D.lib
- }
- } else {
- LIBS += -L../../../threed -lQt3D
- }
- INCLUDEPATH += ../../../../include/Qt3D
- }
- target.path = $$QT3D_INSTALL_PLUGINS/sceneformats
- INSTALLS += target
-} else {
- CONFIG += qt3d
- DESTDIR = $$QT3D_INSTALL_PLUGINS/sceneformats
-}
-
-symbian {
- LIBS += -lQt3D$${QT_LIBINFIX}
- TARGET.UID3 = 0x20031E97
-}
-# suppress warnings about std::copy using unsafe parameters
-win32: DEFINES +=_SCL_SECURE_NO_WARNINGS
-
-system_ai {
- !isEmpty(QMAKE_INCDIR_AI):INCLUDEPATH += $$QMAKE_INCDIR_AI
- !isEmpty(QMAKE_LIBDIR_AI):LIBS += -L$$QMAKE_LIBDIR_AI
-
- !isEmpty(QMAKE_LIBS_AI):LIBS += -l$$QMAKE_LIBS_AI
- else {
- win32:LIBS += -llibai-1_3
- else:LIBS += -lai
- }
-} else {
- include(../../../../3rdparty/assimp/assimp.pri)
-}
-
diff --git a/src/plugins/sceneformats/assimp/main.cpp b/src/plugins/sceneformats/assimp/main.cpp
deleted file mode 100644
index 6191c0a4..00000000
--- a/src/plugins/sceneformats/assimp/main.cpp
+++ /dev/null
@@ -1,100 +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 "qglsceneformatplugin.h"
-#include "qaiscenehandler.h"
-
-#include "assimp.hpp"
-
-#include <QtCore/qmap.h>
-#include <QtCore/qdebug.h>
-
-QT_BEGIN_NAMESPACE
-
-class QAiScenePlugin : public QGLSceneFormatPlugin
-{
-public:
- QStringList keys() const;
- virtual QGLSceneFormatHandler *create(QIODevice *device, const QUrl& url, const QString &format) const;
-};
-
-QStringList QAiScenePlugin::keys() const
-{
- static QMultiMap<QString, QString> mimetypes;
- if (mimetypes.size() == 0)
- {
- mimetypes.insertMulti("3ds", "application/x-3ds");
- mimetypes.insertMulti("3ds", "image/x-3ds");
- mimetypes.insertMulti("dae", "model/x3d+binary");
- mimetypes.insertMulti("dxf", "application/x-dxf");
- }
- QStringList result;
- Assimp::Importer importer;
- aiString extns;
- importer.GetExtensionList(extns);
- QString qextns = QString::fromUtf8(extns.data, extns.length);
- QStringList extnList = qextns.split(';');
- for (int i = 0; i < extnList.size(); ++i)
- {
- QString xt = extnList.at(i);
- xt = xt.simplified();
- if (xt.startsWith(QLatin1String("*.")))
- xt = xt.mid(2);
- result << xt;
- QMap<QString, QString>::const_iterator it = mimetypes.constFind(xt);
- for ( ; it != mimetypes.constEnd(); ++it)
- result << it.value();
- }
- return result;
-}
-
-QGLSceneFormatHandler *QAiScenePlugin::create(QIODevice *device, const QUrl& url, const QString &format) const
-{
- Q_UNUSED(device);
- Q_UNUSED(url);
- Q_UNUSED(format);
- return new QAiSceneHandler;
-}
-
-Q_EXPORT_STATIC_PLUGIN(QAiScenePlugin)
-Q_EXPORT_PLUGIN2(qsceneai, QAiScenePlugin)
-
-QT_END_NAMESPACE
diff --git a/src/plugins/sceneformats/assimp/qailoader.cpp b/src/plugins/sceneformats/assimp/qailoader.cpp
deleted file mode 100644
index 280ca171..00000000
--- a/src/plugins/sceneformats/assimp/qailoader.cpp
+++ /dev/null
@@ -1,541 +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 "qailoader.h"
-#include "qaiscenehandler.h"
-#include "qaiscene.h"
-#include "qaimesh.h"
-
-#include "qgeometrydata.h"
-#include "qgltwosidedmaterial.h"
-#include "qglmaterial.h"
-#include "qglmaterialcollection.h"
-#include "qglpainter.h"
-#include "qgltexture2d.h"
-#include "qglscenenode.h"
-#include "qlogicalvertex.h"
-
-#include "aiScene.h"
-#include "aiMaterial.h"
-#include "aiMesh.h"
-#include "DefaultLogger.h"
-
-#include <QtCore/qdir.h>
-#include <QtCore/qobject.h>
-#include <QtCore/qfileinfo.h>
-
-QAiLoader::QAiLoader(const aiScene *scene, QAiSceneHandler* handler)
- : m_scene(scene)
- , m_root(0)
- , m_handler(handler)
- , m_hasTextures(false)
- , m_hasLitMaterials(false)
- , m_builder(new QGLMaterialCollection(m_root))
-{
- //nothing to do here
-}
-
-QAiLoader::~QAiLoader()
-{
- // nothing to do here - m_rootNode is taken ownership of by caller of
- // rootNode() method
-}
-
-static inline void assertOnePrimitiveType(aiMesh *mesh)
-{
-#ifndef QT_NO_DEBUG
- int k = 0; // count the number of bits set in the primitives
- unsigned int msk = 0x01;
- for (unsigned int p = mesh->mPrimitiveTypes; p; p >>= 1)
- if (p & msk)
- ++k;
- Q_ASSERT(k == 1); // Assimp SortByPType promises this
-#else
- Q_UNUSED(mesh);
-#endif
-}
-
-static inline bool qHasTextures(const QGLSceneNode *node)
-{
- QGLMaterial *mat = node->material();
- for (int i = 0; i < mat->textureLayerCount(); ++i)
- if (node->material()->texture(i))
- return true;
- return false;
-}
-
-void QAiLoader::loadMesh(aiMesh *mesh)
-{
- QString name = QString::fromUtf8(mesh->mName.data, mesh->mName.length);
- // qDebug() << "loadMesh" << name << "with" << mesh->mNumVertices << "vertices"
- // << "and" << mesh->mNumFaces << "faces";
-
- assertOnePrimitiveType(mesh);
-
- if (mesh->mPrimitiveTypes & aiPrimitiveType_TRIANGLE)
- {
- m_builder.newSection();
- QGLSceneNode *node = m_builder.currentNode();
- node->setObjectName(name);
- QAiMesh m(mesh);
- m.build(m_builder, m_handler->showWarnings());
- m_meshes.append(node);
- if (qHasTextures(node))
- m_hasTextures = true;
- else
- m_hasLitMaterials = true;
- }
- else
- {
- // TODO: Implement other types in qaimesh.cpp
- if (m_handler->showWarnings())
- {
- QString error = QLatin1String("Bad primitive type in mesh %1 : %2");
- error = error.arg(name).arg(mesh->mPrimitiveTypes);
- Assimp::DefaultLogger::get()->warn(error.toStdString());
- }
- }
-
- if (m_handler->showWarnings())
- {
- if (!(m_handler->removeComponentFlags() & aiComponent_COLORS))
- {
- // TODO: Implement models with per vertex colors. Ok, the
- // vertex colors were wanted but are not supported yet.
- for (int i = 0; i < AI_MAX_NUMBER_OF_COLOR_SETS; ++i)
- {
- if (mesh->HasVertexColors(i))
- {
- QString error = QLatin1String(
- "Found color information in mesh %1, channel %2"
- "- per vertex color not yet supported");
- error = error.arg(name).arg(i);
- Assimp::DefaultLogger::get()->warn(error.toStdString());
- break;
- }
- }
- }
- if (mesh->HasBones())
- {
- // TODO: Implement skeletal animation
- QString error = QLatin1String("Bones in mesh %1 not yet supported");
- error.arg(name);
- Assimp::DefaultLogger::get()->warn(error.toStdString());
- }
- if (mesh->HasTangentsAndBitangents())
- {
- // TODO: Implement normal maps - here and in the texture import
- QString error = QLatin1String("Tangents for normal map in mesh %1 not yet supported");
- error.arg(name);
- Assimp::DefaultLogger::get()->warn(error.toStdString());
- }
- }
-}
-
-inline static QMatrix4x4 getNodeMatrix(aiNode *node)
-{
- QMatrix4x4 nodeMatrix;
- if (node->mTransformation.IsIdentity())
- return nodeMatrix;
- aiQuaternion rotation;
- aiVector3D position;
- aiVector3D scale;
- node->mTransformation.Decompose(scale, rotation, position);
- QVector3D qscale(scale.x,scale.y, scale.z);
- QVector3D qposition(position.x, position.y, position.z);
- QQuaternion qrotation(rotation.w, rotation.x, rotation.y, rotation.z);
- if (!qscale.isNull())
- nodeMatrix.scale(qscale);
- if (!qposition.isNull())
- nodeMatrix.translate(qposition);
- if (!qrotation.isNull())
- nodeMatrix.rotate(qrotation);
- return nodeMatrix;
-}
-
-void QAiLoader::loadNodes(aiNode *nodeList, QGLSceneNode *parentNode)
-{
- QMap<aiNode *, QGLSceneNode *>::const_iterator it = m_nodeMap.constFind(nodeList);
- QGLSceneNode *node = 0;
- if (it == m_nodeMap.constEnd()) // not found
- {
- node = new QGLSceneNode(parentNode);
- m_nodes.append(node);
- QString name = QString::fromUtf8(nodeList->mName.data, nodeList->mName.length);
- if (name.isEmpty())
- name = QString(QLatin1String("aiNode %1")).arg(m_nodes.size());
- node->setObjectName(name);
- QMatrix4x4 mat = getNodeMatrix(nodeList);
- if (!mat.isIdentity())
- node->setLocalTransform(mat);
- for (unsigned int i = 0; i < nodeList->mNumChildren; ++i)
- loadNodes(nodeList->mChildren[i], node);
- for (unsigned int i = 0; i < nodeList->mNumMeshes; ++i)
- {
- int n = nodeList->mMeshes[i];
- if (n < m_meshes.size())
- node->addNode(m_meshes.at(n));
- }
- }
- else
- {
- node = it.value();
- parentNode->addNode(node);
- }
-}
-
-/*!
- \internal
- Loads all the geometry, materials, and texture associations from the assigned
- file, and returns the root node of the resulting scene graph.
-
- The caller must take ownership of the root node returned, and delete it
- when its no longer required.
-*/
-QGLSceneNode *QAiLoader::loadMeshes()
-{
- Q_ASSERT(m_scene);
- for (unsigned int i = 0; i < m_scene->mNumMaterials; ++i)
- loadMaterial(m_scene->mMaterials[i]);
-
- // builds a naive scene heierarchy with all meshes under the root node
- for (unsigned int i = 0; i < m_scene->mNumMeshes; ++i)
- loadMesh(m_scene->mMeshes[i]);
-
- // fetch the naive scene heierarchy from the builder
- m_root = m_builder.finalizedSceneNode();
-
- QString name = m_handler->url().path();
- int pos = name.lastIndexOf("/");
- if (pos == -1)
- pos = name.lastIndexOf("\\");
- if (pos != -1)
- name = name.mid(pos+1);
- m_root->setObjectName(name);
-
- // if scene has a node heierarchy replace the naive heierarchy with that
- if (m_scene->mRootNode->mNumChildren > 0 && m_scene->mRootNode->mChildren)
- {
- m_root->removeNodes(m_root->children());
- loadNodes(m_scene->mRootNode, m_root);
- }
-
- if (m_hasTextures) // make textures the default
- {
- m_root->setEffect(QGL::LitModulateTexture2D);
- if (m_hasLitMaterials)
- {
- for (int i = 0; i < m_meshes.size(); ++i)
- if (!qHasTextures(m_meshes.at(i)))
- m_meshes.at(i)->setEffect(QGL::LitMaterial);
- }
- }
- else
- {
- m_root->setEffect(QGL::LitMaterial);
- }
-
- if (m_handler->showWarnings())
- {
- QString message = QLatin1String("AssetImporter loader %1 -- "
- "Mesh count: %2 -- Node count: %3 -- "
- "Material count: %4");
- QUrl url = m_handler->url();
- message = message.arg(url.toString()).arg(m_meshes.size())
- .arg(m_nodes.size()).arg(m_root->palette()->size());
- Assimp::DefaultLogger::get()->warn(message.toStdString());
- }
-
-//#define DEBUG_ME
-#ifdef DEBUG_ME
- qDumpScene(m_root);
-
- QList<QGLSceneNode*> c = m_root->allChildren();
- QSet<quint64> debugged;
- for (int i = 0; i < c.size(); ++i)
- {
- if (c.at(i)->geometry().count() > 0)
- {
- QGeometryData g = c.at(i)->geometry();
- qDebug() << "geometry for:" << c.at(i) << "is:" << g.id();
- if (!debugged.contains(g.id()))
- {
- qDebug() << g;
- debugged.insert(g.id());
- }
- }
- }
-#endif
-
- return m_root;
-}
-
-/*!
- \internal
- Search for a resource based on the given \a path.
-
- If the URL for the currently loading mesh has a scheme other than
- "file" then a URL with the path relative to that URL is returned.
-
- If the URL for the currently loading mesh has a "file" scheme, then
- first a case-sensitive search is done of all of the current directory,
- and the :/ resource directory, and the directory of the current mesh
- file.
-
- If the file is not found in any of those locations then they are
- searched again case-insensitively. If the file is found, then a
- URL based on the absolute file path of the matching file is returned.
-
- Otherwise an empty string is returned.
-*/
-QUrl QAiLoader::ensureResource(const QString &path)
-{
- QUrl res;
- QUrl base = m_handler->url();
- if (base.scheme() == QLatin1String("file"))
- {
- res = base.resolved(path);
- //qDebug() << "ensureResource - base:" << base
- // << " -- path:" << path << "-- resolved:" << res;
- if (QFile::exists(res.path())) // shortcut common case
- return res;
- QStringList paths;
- paths << QLatin1String(".") << QLatin1String(":/"); // current directory and aliased/root resource file
- if (!base.isEmpty())
- {
- QFileInfo fi(base.path());
- paths.prepend(fi.absoluteDir().absolutePath());
- }
- bool caseInsensitive = false;
- do {
- QStringList::const_iterator it(paths.begin());
- for ( ; it != paths.end(); ++it)
- {
- QDir resDir(*it);
- QStringList fileList = resDir.entryList(QDir::Files);
- if (caseInsensitive)
- {
- QStringList::const_iterator fit(fileList.begin());
- for ( ; fit != fileList.end(); ++fit)
- {
- if (fit->toLower() == path.toLower())
- {
- res.setScheme(QLatin1String("file"));
- res.setPath(resDir.absoluteFilePath(*fit));
- break;
- }
- }
- }
- else
- {
- if (fileList.contains(path))
- {
- //return resDir.absoluteFilePath(path);
- res.setScheme(QLatin1String("file"));
- res.setPath(resDir.absoluteFilePath(path));
- break;
- }
- }
- }
- if (caseInsensitive)
- break;
- caseInsensitive = true;
- } while (true);
- }
- else
- {
- // non-file url
- res = base.resolved(path);
- }
- return res;
-}
-
-void QAiLoader::loadTextures(aiMaterial *ma, QGLMaterial *mq)
-{
- int texCount;
- aiTextureType texType;
- if (m_handler->showWarnings())
- {
- // TODO: AssImp has a very rich set of texture related functionality
- // but until things in this list get implemented, all are just going
- // to get ignored, tho' they will generate a warning in verbose mode.
- // So for now, its just inside this conditional - move it out once
- // implementation of these items begins.
- static const char * typeNames[] = {
- "None",
- "Diffuse",
- "Specular",
- "Ambient",
- "Emissive",
- "Height",
- "Normals",
- "Shininess",
- "Opacity",
- "Displacement",
- "Lightmap",
- "Reflection",
- "Unknown",
- 0
- };
-
- for (unsigned int i = 0; i <= aiTextureType_UNKNOWN; ++i)
- {
- texType = static_cast<aiTextureType>(i);
- texCount = ma->GetTextureCount(texType);
- if (texCount && texType != aiTextureType_DIFFUSE)
- {
- QString error = QLatin1String("Unsupported texture type \"%1\" in material \"%2\".");
- error = error.arg(typeNames[i]).arg(mq->objectName());
- Assimp::DefaultLogger::get()->warn(error.toStdString());
- }
- }
- }
- // TODO: For now assume the only texture we care about is the diffuse one
- //
- texCount = ma->GetTextureCount(aiTextureType_DIFFUSE);
- if (texCount > 0)
- {
- if (texCount > 1 && m_handler->showWarnings())
- {
- QString error = QLatin1String("Multi-textures not supported: \"%1\" has %2");
- error.arg(mq->objectName()).arg(texCount);
- Assimp::DefaultLogger::get()->warn(error.toStdString());
- }
- else
- {
- aiString path;
- ma->Get(AI_MATKEY_TEXTURE_DIFFUSE(0), path);
- QString qpath = QString::fromUtf8(path.data, path.length);
- QUrl url = ensureResource(qpath);
- if (url.isEmpty())
- {
- if (m_handler->showWarnings())
- {
- QString error = QLatin1String("Could not load texture: %1 for material %2");
- error.arg(url.toString()).arg(mq->objectName());
- Assimp::DefaultLogger::get()->warn(error.toStdString());
- }
- }
- else
- {
- mq->setTextureUrl(url);
- }
- }
- }
-}
-
-/*!
- Load a material
-*/
-void QAiLoader::loadMaterial(aiMaterial *ma)
-{
- QGLMaterialCollection *palette = m_builder.palette();
- QGLMaterial *mq = new QGLMaterial;
- mq->setObjectName("___DEFAULT_NAME___");
-
- bool isTwoSided = false;
- bool isWireframe = false;
- struct aiColor4D clr;
- float shininess;
- float amplitude;
-
- aiReturn r;
-
- // In AssImp if the material is two sided then it means cull face
- // should be turned off: http://assimp.sourceforge.net/lib_html/materials.html
- r = ma->Get(AI_MATKEY_TWOSIDED, isTwoSided);
- if (r == aiReturn_SUCCESS && isTwoSided)
- mq->setProperty("isTwoSided", isTwoSided);
-
- aiString aName;
- r = ma->Get(AI_MATKEY_NAME, aName);
- if (r == aiReturn_SUCCESS && aName.length > 0)
- mq->setObjectName(QLatin1String(aName.data));
-
- r = ma->Get(AI_MATKEY_COLOR_AMBIENT, clr);
- if (r == aiReturn_SUCCESS)
- mq->setAmbientColor(QColor::fromRgbF(clr.r, clr.g, clr.b, clr.a));
-
- r = ma->Get(AI_MATKEY_COLOR_DIFFUSE, clr);
- if (r == aiReturn_SUCCESS)
- mq->setDiffuseColor(QColor::fromRgbF(clr.r, clr.g, clr.b, clr.a));
-
- r = ma->Get(AI_MATKEY_COLOR_SPECULAR, clr);
- if (r == aiReturn_SUCCESS)
- {
- QColor spec = QColor::fromRgbF(clr.r, clr.g, clr.b, clr.a);
- mq->setSpecularColor(spec);
-
- // By default the specular color is black - very dark.
- // If the specular color is bright be careful with shininess -
- // a shininess of 0 will blow everything out to full white. So in
- // the case of bad materials with this problem, set shiness low.
- mq->setShininess(64.0);
- }
-
- r = ma->Get(AI_MATKEY_SHININESS, shininess);
- if (r == aiReturn_SUCCESS)
- mq->setShininess(shininess);
-
- r = ma->Get(AI_MATKEY_SHININESS_STRENGTH, amplitude);
- if (r == aiReturn_SUCCESS)
- mq->setShininess(shininess * amplitude);
-
- r = ma->Get(AI_MATKEY_ENABLE_WIREFRAME, isWireframe);
- if (r == aiReturn_SUCCESS && isWireframe)
- mq->setProperty("isWireFrame", isWireframe);
-
- loadTextures(ma, mq);
-
- // INVARIANT: since we create the palette newly in this class, and this
- // function is the only place we add materials to this palette, the index
- // values (the positions in the palette generated by this call to addMaterial)
- // will exactly match the index values of the materials traversed in the
- // for loop in loadMeshes() - so therefore AI's index values and the ones in
- // the palette will be the same.
- //
- // executive summary: don't muck around with the palettte outside of this call
-
- int k = palette->addMaterial(mq);
-
- Q_UNUSED(k);
- //qDebug() << "loaded material" << k << mq;
-}
diff --git a/src/plugins/sceneformats/assimp/qailoader.h b/src/plugins/sceneformats/assimp/qailoader.h
deleted file mode 100644
index e7de0098..00000000
--- a/src/plugins/sceneformats/assimp/qailoader.h
+++ /dev/null
@@ -1,95 +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 QGL3DSLOADER_H
-#define QGL3DSLOADER_H
-
-#include <QtCore/qurl.h>
-#include <QtCore/qstring.h>
-#include <QtCore/qmap.h>
-
-#include "aiScene.h"
-
-#include "qglbuilder.h"
-
-class aiMaterial;
-
-QT_BEGIN_NAMESPACE
-
-class QAiMesh;
-class QGLSceneNode;
-class QAiSceneHandler;
-class QGLMaterial;
-class QAiScene;
-class QAiLoader
-{
-public:
- QAiLoader(const aiScene *scene, QAiSceneHandler* handler);
- ~QAiLoader();
- QGLSceneNode *loadMeshes();
-private:
- friend class QAiScene;
-
- void loadMesh(aiMesh *);
- void loadNodes(aiNode *, QGLSceneNode *);
- void loadMaterial(aiMaterial *);
- void loadTextures(aiMaterial *, QGLMaterial *);
- QUrl ensureResource(const QString &);
- void optimizeData();
- void optimizeNodes(QGLSceneNode *node = 0, QGLSceneNode *parent = 0);
- void countChildNodeReferences();
-
- const aiScene *m_scene;
- QGLSceneNode *m_root;
- QAiSceneHandler *m_handler;
- QList<QGLSceneNode *> m_nodes;
- QList<QGLMaterial *> m_materials;
- QList<QGLSceneNode *> m_meshes;
- QMap<aiNode *, QGLSceneNode *> m_nodeMap;
- QMap<QGLSceneNode *, int> m_refCounts;
- bool m_hasTextures;
- bool m_hasLitMaterials;
- QGLBuilder m_builder;
-};
-
-QT_END_NAMESPACE
-
-#endif // QGL3DSLOADER_H
diff --git a/src/plugins/sceneformats/assimp/qaimesh.cpp b/src/plugins/sceneformats/assimp/qaimesh.cpp
deleted file mode 100644
index e7d4328e..00000000
--- a/src/plugins/sceneformats/assimp/qaimesh.cpp
+++ /dev/null
@@ -1,143 +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 "qaimesh.h"
-#include "qglscenenode.h"
-#include "qglmaterialcollection.h"
-#include "qglbuilder.h"
-
-#include <QtGui/qmatrix4x4.h>
-#include <QtCore/qmath.h>
-
-#include "aiMesh.h"
-#include "DefaultLogger.h"
-
-QAiMesh::QAiMesh(aiMesh *mesh)
- : m_mesh(mesh)
-{
-}
-
-QAiMesh::~QAiMesh()
-{
-}
-
-static inline QVector2D qv2d(const aiVector3D &v)
-{
- return QVector2D(v.x, v.y);
-}
-
-static inline QVector2D qv2d_inv(const aiVector3D &v)
-{
- // invert the v coord because Qt is upside-down
- return QVector2D(v.x, (1.0 - v.y));
-}
-
-static inline QVector3D qv3d(const aiVector3D &v)
-{
- return QVector3D(v.x, v.y, v.z);
-}
-
-void QAiMesh::loadTriangles(QGLBuilder &builder)
-{
- QGeometryData data;
- for (unsigned int i = 0; i < m_mesh->mNumVertices; ++i)
- data.appendVertex(qv3d(m_mesh->mVertices[i]));
- if (m_mesh->HasNormals())
- for (unsigned int i = 0; i < m_mesh->mNumVertices; ++i)
- data.appendNormal(qv3d(m_mesh->mNormals[i]));
- int k = m_mesh->GetNumUVChannels();
- for (int t = 0; t < k; ++t)
- {
- if (m_mesh->mNumUVComponents[t] != 2)
- Assimp::DefaultLogger::get()->warn("Tex co-ords only supports U & V");
- QGLMaterial *m = builder.currentNode()->material();
- if (m && m->textureUrl().path().endsWith(".dds", Qt::CaseInsensitive))
- {
- for (unsigned int i = 0; i < m_mesh->mNumVertices; ++i)
- data.appendTexCoord(qv2d_inv(m_mesh->mTextureCoords[t][i]), static_cast<QGL::VertexAttribute>(QGL::TextureCoord0 + t));
- }
- else
- {
- for (unsigned int i = 0; i < m_mesh->mNumVertices; ++i)
- data.appendTexCoord(qv2d(m_mesh->mTextureCoords[t][i]), static_cast<QGL::VertexAttribute>(QGL::TextureCoord0 + t));
- }
- }
-
- for (unsigned int i = 0; i < m_mesh->mNumFaces; ++i)
- {
- aiFace *face = &m_mesh->mFaces[i];
- data.appendIndices(face->mIndices[0], face->mIndices[1], face->mIndices[2]);
- }
-
- // raw triangle mode
- builder.addTriangles(data);
-}
-
-void QAiMesh::build(QGLBuilder &builder, bool showWarnings)
-{
- QGLSceneNode *node = builder.currentNode();
- QString name = node->objectName();
-
- if (!m_mesh->HasFaces() || !m_mesh->HasPositions())
- {
- if (showWarnings)
- {
- QString error = QLatin1String("Mesh %1 has zero vertex/face count");
- error.arg(name.isEmpty() ? QString(QLatin1String("<unnamed mesh>")) : name);
- Assimp::DefaultLogger::get()->warn(error.toStdString());
- }
- return;
- }
-
- node->setMaterialIndex(m_mesh->mMaterialIndex);
- node->palette()->markMaterialAsUsed(m_mesh->mMaterialIndex);
-
- if (m_mesh->mPrimitiveTypes & aiPrimitiveType_TRIANGLE)
- loadTriangles(builder);
- else
- return; // TODO - lines, points, quads, polygons
-
- QGLMaterial * mat = node->palette()->material(m_mesh->mMaterialIndex);
- if (mat->property("isTwoSided").isValid() && mat->property("isTwoSided").toBool())
- node->setBackMaterialIndex(m_mesh->mMaterialIndex);
- if (mat->property("isWireFrame").isValid() && mat->property("isWireFrame").toBool())
- node->setDrawingMode(QGL::Lines);
-}
diff --git a/src/plugins/sceneformats/assimp/qaimesh.h b/src/plugins/sceneformats/assimp/qaimesh.h
deleted file mode 100644
index 23d352aa..00000000
--- a/src/plugins/sceneformats/assimp/qaimesh.h
+++ /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 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 QGL3DSMESH_H
-#define QGL3DSMESH_H
-
-#include "qaiscenehandler.h"
-#include "qgeometrydata.h"
-
-class aiMesh;
-
-QT_BEGIN_NAMESPACE
-
-class QGLMaterialCollection;
-class QGLSceneNode;
-class QGLBuilder;
-class QAiLoader;
-
-class QAiMesh
-{
-public:
- QAiMesh(aiMesh *mesh);
- virtual ~QAiMesh();
-
- void build(QGLBuilder &builder, bool showWarnings = false);
-private:
- void loadTriangles(QGLBuilder &builder);
-
- aiMesh *m_mesh;
-};
-
-QT_END_NAMESPACE
-
-#endif // QGL3DSMESH_H
diff --git a/src/plugins/sceneformats/assimp/qaiscene.cpp b/src/plugins/sceneformats/assimp/qaiscene.cpp
deleted file mode 100644
index d3c48613..00000000
--- a/src/plugins/sceneformats/assimp/qaiscene.cpp
+++ /dev/null
@@ -1,182 +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 "qaiscene.h"
-#include "qaimesh.h"
-#include "qailoader.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \internal
- \class QAiScene
- \brief The QAiScene class manages and contains an asset importer scene.
- The scene consists of a QGLSceneNode object which is the top-level node
- and references the geometry imported from a file.
-*/
-
-/*!
- \internal
- Construct a new QAiScene object using the data in the \a scene,
- and setting the given \a parent.
-
- The QAiScene object takes ownership of the \a file.
-*/
-QAiScene::QAiScene(const aiScene *scene, QAiSceneHandler *handler)
- : QGLAbstractScene(0)
-{
- Q_ASSERT(handler);
- Q_ASSERT(scene);
- QAiLoader loader(scene, handler);
- m_root = loader.loadMeshes();
- m_aiLoader = 0;
-}
-/*!
- \internal
- Construct a new QAiScene object and setting the given \a handler.
-
- Note that the scene which will be used to generate the QAiScene has
- not been added yet - this is used in the network case and requires
- a later call to the loadScene function to work correctly
-
- \sa loadScene()
-*/
-QAiScene::QAiScene(QAiSceneHandler *handler)
- : QGLAbstractScene(0)
-{
- Q_ASSERT(handler);
- //create a temporary loader and get a temporary root node for the scene.
- m_aiLoader = new QAiLoader(0, handler);
- m_root=m_aiLoader->m_builder.sceneNode();
-}
-
-/*!
- \reimp
- Destroy this QAiScene, recovering all resources.
-
- This method destroys the Lib3dsFile object the scene is based
- on by calling the appropriate lib3ds function.
-*/
-QAiScene::~QAiScene()
-{
- delete m_aiLoader;
-}
-
-/*!
- \internal
- \reimp
-*/
-QList<QObject *> QAiScene::objects() const
-{
- QList<QObject *> objs;
- if (!m_root)
- return objs;
- objs.append(m_root);
- QList<QGLSceneNode*> children = m_root->allChildren();
- QList<QGLSceneNode*>::const_iterator it = children.constBegin();
- for ( ; it != children.constEnd(); ++it)
- objs.append(*it);
- return objs;
-}
-
-/*!
- \internal
- \reimp
-*/
-QGLSceneNode *QAiScene::mainNode() const
-{
- return m_root;
-}
-
-/*!
- \internal
- Returns the aiLoader associated with the scene (if any).
-*/
-QAiLoader * QAiScene::aiLoader() const
-{
- return m_aiLoader;
-}
-
-/*!
- \internal
- Load the new \a scene and swap the extant palette from the temporary roote
- node into the current root node.
-
- The QAiScene object takes ownership of the \a file.
-*/
-void QAiScene::loadScene(const aiScene *scene)
-{
- Q_ASSERT(scene);
-
- //Get the old material information
- QGLMaterialCollection *oldPalette= m_aiLoader->m_builder.palette();
- int oldIndex = m_root->materialIndex();
-
- //Reset the palette for the root node.
- QGLMaterialCollection *newPalette = new QGLMaterialCollection();
- m_aiLoader->m_builder.sceneNode()->setPalette(newPalette);
- m_aiLoader->m_scene = scene;
-
- //Commence loading of the mesh.
- m_root = m_aiLoader->loadMeshes(); //this won't actually change the root unless we've messed up.
- delete m_aiLoader;
- m_aiLoader = 0;
-
- //Swap out the materials palette
- int indexCount=0;
- int materialCount=0;
- QGLMaterial * currentMaterial = NULL;
- do {
- currentMaterial = oldPalette->removeMaterial(indexCount);
- if (currentMaterial) {
- materialCount = m_root->palette()->addMaterial(currentMaterial);
- indexCount++;
- }
- } while (currentMaterial);
- m_root->setMaterialIndex(materialCount-(indexCount-1)+oldIndex);
-
- //update picking nodes for the whole scene if needed
- if (pickable()) generatePickNodes();
-
- emit sceneUpdated();
-}
-
-QT_END_NAMESPACE
diff --git a/src/plugins/sceneformats/assimp/qaiscene.h b/src/plugins/sceneformats/assimp/qaiscene.h
deleted file mode 100644
index f0c4a2b8..00000000
--- a/src/plugins/sceneformats/assimp/qaiscene.h
+++ /dev/null
@@ -1,85 +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 QGL3DSSCENE_H
-#define QGL3DSSCENE_H
-
-#include "qglabstractscene.h"
-#include "aiScene.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class QGLSceneNode;
-class QAiSceneHandler;
-class QAiLoader;
-
-class QAiScene : public QGLAbstractScene
-{
- Q_OBJECT
-public:
- explicit QAiScene(const aiScene *scene, QAiSceneHandler *handler);
- explicit QAiScene(QAiSceneHandler *handler);
-
- virtual ~QAiScene();
-
-
- //load scene with current handler.
- void loadScene(const aiScene *scene);
-
- QList<QObject *> objects() const;
- QGLSceneNode *mainNode() const;
-
- QAiLoader * aiLoader() const;
-
-protected:
- QGLSceneNode *m_root;
- QAiLoader *m_aiLoader;
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/plugins/sceneformats/assimp/qaiscenehandler.cpp b/src/plugins/sceneformats/assimp/qaiscenehandler.cpp
deleted file mode 100644
index 5ae16c36..00000000
--- a/src/plugins/sceneformats/assimp/qaiscenehandler.cpp
+++ /dev/null
@@ -1,453 +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 "qaiscenehandler.h"
-#include "qaiscene.h"
-#include "ailoaderiosystem.h"
-
-#include "aiScene.h"
-#include "aiPostProcess.h"
-#include "DefaultLogger.h"
-
-#include "qdownloadmanager.h"
-
-#include <QtCore/qdir.h>
-#include <QtCore/qdebug.h>
-#include <QObject>
-#include <QBuffer>
-
-#define qAiPostProcessPreset ( \
- aiProcess_CalcTangentSpace | \
- aiProcess_GenSmoothNormals | \
- aiProcess_JoinIdenticalVertices | \
- aiProcess_ImproveCacheLocality | \
- aiProcess_LimitBoneWeights | \
- aiProcess_RemoveRedundantMaterials | \
- aiProcess_SplitLargeMeshes | \
- aiProcess_Triangulate | \
- aiProcess_GenUVCoords | \
- aiProcess_SortByPType | \
- aiProcess_FindDegenerates | \
- aiProcess_FindInvalidData )
-
-QT_BEGIN_NAMESPACE
-
-#ifdef _DEBUG
-void DumpScene(const aiScene* pScene);
-#endif
-
-QAiSceneHandler::QAiSceneHandler()
- : m_options(qAiPostProcessPreset)
- , m_showWarnings(false)
- , m_mayHaveLinesPoints(false)
- , m_meshSplitVertexLimit(2000)
- , m_meshSplitTriangleLimit(2000)
- , m_removeComponentFlags(0)
- , m_removeSortFlags(0)
-{
- // by default remove per vertex colors from the data - no-one uses that in
- // models - if they need it it can be turned on with UseVertexColors
- m_removeComponentFlags |= aiComponent_COLORS;
-
- // by default remove points and lines from the model, since these are usually
- // degenerate structures from bad modelling or bad import/export. if they
- // are needed it can be turned on with IncludeLinesPoints
- m_removeSortFlags |= aiPrimitiveType_POINT | aiPrimitiveType_LINE;
-}
-
-QAiSceneHandler::~QAiSceneHandler()
-{
- // nothing to do
-}
-
-void QAiSceneHandler::decodeOptions(const QString &options)
-{
- if (options.isEmpty())
- return;
-
- // See aiPostProcess.h for aiProcessPreset_TargetRealtime_Quality
- // - a useful default set of values - its exactly what we want but
- // wont compile with flags, so redefined with the above macro.
- // Also, allow the user to override some settings
- m_options = qAiPostProcessPreset;
-
- // Has to match the enum
- static const char *validOptions[] = {
- "NoOptions",
- "ShowWarnings",
- "CalculateNormals",
- "ForceFaceted",
- "ForceSmooth",
- "IncludeAllMaterials",
- "IncludeLinesPoints",
- "FixNormals",
- "DeDupMeshes",
- "Optimize",
- "FlipUVs",
- "FlipWinding",
- "UseVertexColors",
- "VertexSplitLimitx2",
- "TriangleSplitLimitx2",
- 0
- };
-
- QStringList opList = options.simplified().split(QLatin1Char(' '), QString::SkipEmptyParts);
-
- for (int i = 0; i < opList.count(); ++i)
- {
- QString op = opList.at(i);
- op = op.trimmed();
- int k = 0;
- for ( ; validOptions[k]; ++k)
- if (op == QString::fromLatin1(validOptions[k]))
- break;
- if (validOptions[k]) // found
- {
- Options o = static_cast<Options>(k);
- switch (o)
- {
- case NoOptions:
- break;
- case ShowWarnings:
- if (m_showWarnings)
- {
- m_importer.SetExtraVerbose(true);
- }
- else
- {
- m_showWarnings = true;
- m_options |= aiProcess_ValidateDataStructure;
- }
- break;
- case CalculateNormals:
- m_removeComponentFlags |= aiComponent_NORMALS;
- m_options |= aiProcess_GenSmoothNormals;
- m_options &= ~aiProcess_GenNormals;
- break;
- case ForceFaceted:
- m_removeComponentFlags |= aiComponent_NORMALS;
- m_options |= aiProcess_GenNormals;
- m_options &= ~aiProcess_GenSmoothNormals;
- m_options &= ~aiProcess_JoinIdenticalVertices;
- break;
- case ForceSmooth:
- Assimp::DefaultLogger::get()->warn("ForceSmooth is deprecated - ignoring (meshes now smooth by default)");
- break;
- case IncludeAllMaterials:
- m_options &= ~aiProcess_RemoveRedundantMaterials;
- break;
- case IncludeLinesPoints:
- m_removeSortFlags &= ~(aiPrimitiveType_LINE | aiPrimitiveType_POINT);
- m_mayHaveLinesPoints = true;
- // leave it with the FindDegenerates option turned on - we want zero
- // area triangles to display as proper GL lines or points
- break;
- case FixNormals:
- m_options |= aiProcess_FixInfacingNormals;
- break;
- case DeDupMeshes:
- m_options |= aiProcess_FindInstances;
- break;
- case Optimize:
- m_options |= aiProcess_OptimizeGraph | aiProcess_OptimizeMeshes;
- break;
- case FlipUVs:
- m_options |= aiProcess_FlipUVs;
- break;
- case FlipWinding:
- m_options |= aiProcess_FlipWindingOrder;
- break;
- case UseVertexColors:
- m_removeComponentFlags &= ~aiComponent_COLORS;
- break;
- case VertexSplitLimitx2:
- m_meshSplitVertexLimit <<= 1;
- // repeating this in the option string more than once works...
- break;
- case TriangleSplitLimitx2:
- // ....and we're OK with that, just don't overdo it
- m_meshSplitTriangleLimit <<= 1;
- break;
- }
- }
- else
- {
- qWarning("Bad option: \"%s\" in %s", qPrintable(op),
- qPrintable(options));
- }
- }
-}
-
-QGLAbstractScene *QAiSceneHandler::read()
-{
- AiLoaderIOSystem *ios = new AiLoaderIOSystem(device(), url());
- m_importer.SetIOHandler(ios);
-
- Assimp::Logger *log = 0;
- Assimp::Logger::LogSeverity severity = Assimp::Logger::NORMAL;
- if (m_showWarnings)
- {
- severity = Assimp::Logger::VERBOSE;
- int streams = aiDefaultLogStream_FILE |
-#ifdef Q_CC_MSVC
- aiDefaultLogStream_DEBUGGER
-#else
- aiDefaultLogStream_STDERR
-#endif
- ;
- log = Assimp::DefaultLogger::create("AssimpLog.txt", severity, streams);
- }
-
- QString path;
- QUrl u = url();
- if (u.scheme() != QLatin1String("file"))
- {
- path = u.toEncoded();
- } else {
- path = u.toLocalFile();
- }
-
- if (m_removeComponentFlags)
- m_options |= aiProcess_RemoveComponent;
- else
- m_options &= ~aiProcess_RemoveComponent;
-
- m_importer.SetPropertyInteger(AI_CONFIG_PP_RVC_FLAGS, m_removeComponentFlags);
- m_importer.SetPropertyInteger(AI_CONFIG_PP_SBP_REMOVE, m_removeSortFlags);
- //m_importer.SetPropertyInteger(AI_CONFIG_PP_SLM_VERTEX_LIMIT, m_meshSplitVertexLimit);
- //m_importer.SetPropertyInteger(AI_CONFIG_PP_SLM_TRIANGLE_LIMIT, m_meshSplitTriangleLimit);
-
- // force this on, and provide no way to turn it off. Its set by the
- // aiProcessPreset_TargetRealtime_Quality option in the constructor.
- // Guarantees that all meshes only have one primitive type
- Q_ASSERT(m_options & aiProcess_SortByPType);
-
- // the importer owns the scene, so when the it goes out of scope on exiting
- // this function the scene will get destroyed
- const aiScene* scene = m_importer.ReadFile(path.toStdString(), m_options);
-
- if (!scene)
- {
- // Notes on import success flags - according to assimp doco if validation
- // is requested the flags AI_SCENE_FLAGS_VALIDATION_WARNING will be set
- // if there's a warning, and AI_SCENE_FLAGS_VALIDATED is set on success.
- // This does not happen. Also AI_SCENE_FLAGS_INCOMPLETE can be set on a
- // valid model, so checking for that is no use either. Best way to proceed
- // is that if ShowWarnings is turned on above, then any pertinent warnings
- // will be shown; and if a NULL result is returned here, then its a fatal
- // error and a message is shown here. If a non-NULL result is returned
- // just go ahead and try to load it.
- QString c = QDir::current().absolutePath();
- qWarning("Asset importer error: %s\n", m_importer.GetErrorString());
- if (log)
- qWarning("For details check log: %s/AssimpLog.txt\n", qPrintable(c));
- finalize();
- return 0;
- }
-#ifdef _DEBUG
- else {
- DumpScene(scene);
- }
-#endif
-
- QAiScene *qscene = new QAiScene(scene, this);
-
- Assimp::DefaultLogger::kill();
-
- finalize();
- return qscene;
-}
-
-QGLAbstractScene * QAiSceneHandler::download()
-{
- QUrl u = url();
-
- if (u.scheme() == QLatin1String("file")) {
- qWarning() << "Cannot download urls with FILE scheme. Use the read() method.";
- } else {
- if (m_removeComponentFlags)
- m_options |= aiProcess_RemoveComponent;
- else
- m_options &= ~aiProcess_RemoveComponent;
-
- m_importer.SetPropertyInteger(AI_CONFIG_PP_RVC_FLAGS, m_removeComponentFlags);
- m_importer.SetPropertyInteger(AI_CONFIG_PP_SBP_REMOVE, m_removeSortFlags);
- m_importer.SetPropertyInteger(AI_CONFIG_PP_SLM_VERTEX_LIMIT, m_meshSplitVertexLimit);
- m_importer.SetPropertyInteger(AI_CONFIG_PP_SLM_TRIANGLE_LIMIT, m_meshSplitTriangleLimit);
-
- // force this on, and provide no way to turn it off. Its set by the
- // aiProcessPreset_TargetRealtime_Quality option in the constructor.
- // Guarantees that all meshes only have one primitive type
- Q_ASSERT(m_options & aiProcess_SortByPType);
-
- setScene(new QAiScene(this));
- //m_scene = new QAiScene(this);
-
- //m_scene->begindownLoad(url());
-
- downloadScene();
- }
- return getScene();
-}
-
-void QAiSceneHandler::downloadComplete(QByteArray sceneData)
-{
- //Create i/o device to use for file reading.
- QBuffer sceneBuffer(&sceneData);
- sceneBuffer.open(QIODevice::ReadOnly);
- setDevice(&sceneBuffer);
-
- //Set i/o system to use non-file based device.
- AiLoaderIOSystem *ios = new AiLoaderIOSystem(device(), url());
- m_importer.SetIOHandler(ios);
-
- QString path;
- path = url().toEncoded();
-
- Assimp::Logger *log = 0;
- Assimp::Logger::LogSeverity severity = Assimp::Logger::NORMAL;
- if (m_showWarnings)
- {
- severity = Assimp::Logger::VERBOSE;
- int streams = aiDefaultLogStream_FILE |
-#ifdef Q_CC_MSVC
- aiDefaultLogStream_DEBUGGER
-#else
- aiDefaultLogStream_STDERR
-#endif
- ;
- log = Assimp::DefaultLogger::create("AssimpLog.txt", severity, streams);
- }
-
- const aiScene* scene = m_importer.ReadFile(path.toStdString(), m_options);
- if (!scene)
- {
- // Notes on import success flags - according to assimp doco if validation
- // is requested the flags AI_SCENE_FLAGS_VALIDATION_WARNING will be set
- // if there's a warning, and AI_SCENE_FLAGS_VALIDATED is set on success.
- // This does not happen. Also AI_SCENE_FLAGS_INCOMPLETE can be set on a
- // valid model, so checking for that is no use either. Best way to proceed
- // is that if ShowWarnings is turned on above, then any pertinent warnings
- // will be shown; and if a NULL result is returned here, then its a fatal
- // error and a message is shown here. If a non-NULL result is returned
- // just go ahead and try to load it.
- QString c = QDir::current().absolutePath();
- qWarning("Asset importer error: %s\n", m_importer.GetErrorString());
- if (log)
- qWarning("For details check log: %s/AssimpLog.txt\n", qPrintable(c));
- }
-#ifdef _DEBUG
- else {
- DumpScene(scene);
- //If we have reached this point everything has proceeded correctly,
- //load the scene.
- QAiScene *theScene = qobject_cast<QAiScene*>(getScene());
- theScene->loadScene(scene);
- }
-#endif
-
- Assimp::DefaultLogger::kill();
-
- finalize();
-}
-
-#ifdef _DEBUG
-void LogPrint(const char* pFormat, ...)
-{
- static char buff[1024];
- buff[0] = '\0';
- va_list args;
- va_start(args, pFormat);
- vsnprintf( buff, sizeof(buff) - 1, pFormat, args);
- qDebug() << buff;
-}
-
-void DumpAnimation(int i, const aiAnimation* pAnimation, const aiScene* pScene)
-{
- Q_UNUSED(pScene);
- LogPrint(" Animation %d",i);
- LogPrint(" name = '%s'",pAnimation->mName.data);
- LogPrint(" ticks = %f",pAnimation->mDuration);
- LogPrint(" ticks per sec = %f",pAnimation->mTicksPerSecond);
- for (unsigned int i=0; i<pAnimation->mNumChannels; ++i) {
- const aiNodeAnim* pNodeAnim = pAnimation->mChannels[i];
- LogPrint(" channel %d affects: '%s'", i, pNodeAnim->mNodeName.data);
- }
-}
-
-void DumpMesh(int i, const aiMesh* pMesh, const aiScene* pScene)
-{
- Q_UNUSED(pScene);
- LogPrint(" Mesh %d",i);
- LogPrint(" name = '%s'",pMesh->mName.data);
- LogPrint(" has bones: %s (%d)",pMesh->HasBones()?"YES":"no ",pMesh->mNumBones);
-}
-void DumpNodeRecursive(int level, const aiNode* pNode, const aiScene* pScene)
-{
- if (level > 100)
- level = 100;
- char Prefix[256];
- memset(Prefix,' ',level*2);
- Prefix[level*2] = '\0';
- LogPrint(" %sNode, name='%s', nMeshes=%d",Prefix,pNode->mName.data,pNode->mNumMeshes);
- for (unsigned int i=0; i<pNode->mNumChildren; ++i) {
- DumpNodeRecursive(level+1, pNode->mChildren[i], pScene);
- }
-}
-
-void DumpScene(const aiScene* pScene)
-{
- LogPrint("DumpScene(%p)",pScene);
- if (pScene) {
- LogPrint(" has animations: %s (%d)",pScene->HasAnimations()?"YES":"no ",pScene->mNumAnimations);
- LogPrint(" has meshes: %s (%d)",pScene->HasMeshes()?"YES":"no ",pScene->mNumMeshes);
- for (unsigned int i=0; i<pScene->mNumAnimations; ++i) {
- DumpAnimation(i,pScene->mAnimations[i],pScene);
- }
- for (unsigned int i=0; i<pScene->mNumMeshes; ++i) {
- DumpMesh(i,pScene->mMeshes[i],pScene);
- }
- DumpNodeRecursive(0,pScene->mRootNode,pScene);
- }
-}
-#endif
-
-QT_END_NAMESPACE
diff --git a/src/plugins/sceneformats/assimp/qaiscenehandler.h b/src/plugins/sceneformats/assimp/qaiscenehandler.h
deleted file mode 100644
index b1738743..00000000
--- a/src/plugins/sceneformats/assimp/qaiscenehandler.h
+++ /dev/null
@@ -1,111 +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 QGL3DSSCENEHANDLER_H
-#define QGL3DSSCENEHANDLER_H
-
-#include "qglsceneformatplugin.h"
-
-#include "aiPostProcess.h"
-#include "assimp.hpp"
-
-#include <QtCore/qurl.h>
-
-Q_DECLARE_FLAGS(aiPostProcessFlags, aiPostProcessSteps);
-Q_DECLARE_OPERATORS_FOR_FLAGS(aiPostProcessFlags);
-
-QT_BEGIN_NAMESPACE
-
-class QIODevice;
-
-class QAiSceneHandler : public QGLSceneFormatHandler
-{
- Q_OBJECT
-public:
- enum Options {
- NoOptions,
- ShowWarnings, // show any warnings while loading the file
- CalculateNormals, // replace normals from the file with smooth generated ones
- ForceFaceted, // generate non-smooth normals (implies CalculateNormals)
- ForceSmooth, // deprecated - retained only for backward compatibility
- IncludeAllMaterials, // include even redundant (unused) materials
- IncludeLinesPoints, // include even collapsed triangles (lines or points)
- FixNormals, // try to fix incorrect (in facing) normals
- DeDupMeshes, // replace copied meshes with refs to a single instance
- Optimize, // collapse meshes, nodes & scene heierarchies
- FlipUVs, // flips UV's on the y-axis (for upside-down textures)
- FlipWinding, // makes faces CW instead of CCW
- UseVertexColors, // use vertex colors that are in a model
- VertexSplitLimitx2, // double the vertex count which will split a large mesh
- TriangleSplitLimitx2 // double the triangle count which will split a large mesh
- };
-
- QAiSceneHandler();
- ~QAiSceneHandler();
-
- QGLAbstractScene *read();
- QGLAbstractScene *download();
-
- void decodeOptions(const QString &options);
-
- bool showWarnings() const { return m_showWarnings; }
- bool mayHaveLinesPoints() const { return m_mayHaveLinesPoints; }
-
- aiPostProcessFlags options() const { return m_options; }
- quint32 removeComponentFlags() const { return m_removeComponentFlags; }
- quint32 removeSortFlags() const { return m_removeSortFlags; }
-
-public slots:
- void downloadComplete(QByteArray sceneData);
-private:
- aiPostProcessFlags m_options;
- bool m_showWarnings;
- bool m_mayHaveLinesPoints;
- int m_meshSplitVertexLimit;
- int m_meshSplitTriangleLimit;
- Assimp::Importer m_importer;
- quint32 m_removeComponentFlags;
- quint32 m_removeSortFlags;
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/plugins/sceneformats/bezier/bezier.pro b/src/plugins/sceneformats/bezier/bezier.pro
deleted file mode 100644
index 2b46207e..00000000
--- a/src/plugins/sceneformats/bezier/bezier.pro
+++ /dev/null
@@ -1,38 +0,0 @@
-TARGET = qscenebezier
-include(../../qpluginbase.pri)
-include(../../../../pkg.pri)
-
-HEADERS += qglbezierscene.h \
- qglbezierscenehandler.h
-SOURCES += main.cpp \
- qglbezierscene.cpp \
- qglbezierscenehandler.cpp
-
-# See the README in the root dir re this code
-package {
- macx:CONFIG(qt_framework, qt_framework|qt_no_framework) {
- LIBS += -framework Qt3D -F../../../threed
- INCLUDEPATH += ../../../threed/Qt3D.framework/Versions/1/Headers
- } else {
- win32 {
- CONFIG(debug, debug|release) {
- TARGET = $$member(TARGET, 0)d
- LIBS += ..\\..\\..\\threed\\debug\\Qt3Dd.lib
- } else {
- LIBS += ..\\..\\..\\threed\\release\\Qt3D.lib
- }
- } else {
- LIBS += -L../../../threed -lQt3D$${QT_LIBINFIX}
- }
- INCLUDEPATH += ../../../../include/Qt3D
- }
- target.path = $$QT3D_INSTALL_PLUGINS/sceneformats
- INSTALLS += target
-} else {
- CONFIG += qt3d
- DESTDIR = $$QT3D_INSTALL_PLUGINS/sceneformats
-}
-symbian {
- LIBS += -lQt3D$${QT_LIBINFIX}
- TARGET.UID3 = 0x20031E98
-}
diff --git a/src/plugins/sceneformats/bezier/main.cpp b/src/plugins/sceneformats/bezier/main.cpp
deleted file mode 100644
index 5d503669..00000000
--- a/src/plugins/sceneformats/bezier/main.cpp
+++ /dev/null
@@ -1,70 +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 "qglsceneformatplugin.h"
-#include "qglbezierscenehandler.h"
-
-QT_BEGIN_NAMESPACE
-
-class QGLBezierScenePlugin : public QGLSceneFormatPlugin
-{
-public:
- QStringList keys() const;
- virtual QGLSceneFormatHandler *create(QIODevice *device, const QUrl& url, const QString &format) const;
-};
-
-QStringList QGLBezierScenePlugin::keys() const
-{
- return QStringList() << QLatin1String("bezier") << QLatin1String("bez");
-}
-
-QGLSceneFormatHandler *QGLBezierScenePlugin::create(QIODevice *device, const QUrl& url, const QString &format) const
-{
- Q_UNUSED(device);
- Q_UNUSED(url);
- Q_UNUSED(format);
- return new QGLBezierSceneHandler();
-}
-
-Q_EXPORT_STATIC_PLUGIN(QGLBezierScenePlugin)
-Q_EXPORT_PLUGIN2(qscenebezier, QGLBezierScenePlugin)
-
-QT_END_NAMESPACE
diff --git a/src/plugins/sceneformats/bezier/qglbezierscene.cpp b/src/plugins/sceneformats/bezier/qglbezierscene.cpp
deleted file mode 100644
index 9e93745b..00000000
--- a/src/plugins/sceneformats/bezier/qglbezierscene.cpp
+++ /dev/null
@@ -1,71 +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 "qglbezierscene.h"
-#include "qglscenenode.h"
-
-QT_BEGIN_NAMESPACE
-
-QGLBezierScene::QGLBezierScene(QGLSceneNode *geometry, QObject *parent)
- : QGLAbstractScene(parent)
-{
- mainObject = geometry;
- mainObject->setObjectName(QLatin1String("mesh")); // No tr
- mainObject->setParent(this);
-}
-
-QGLBezierScene::~QGLBezierScene()
-{
-}
-
-QList<QObject *> QGLBezierScene::objects() const
-{
- QList<QObject *> objs;
- objs.append(mainObject);
- return objs;
-}
-
-QGLSceneNode *QGLBezierScene::mainNode() const
-{
- return mainObject;
-}
-
-QT_END_NAMESPACE
diff --git a/src/plugins/sceneformats/bezier/qglbezierscene.h b/src/plugins/sceneformats/bezier/qglbezierscene.h
deleted file mode 100644
index 17d64552..00000000
--- a/src/plugins/sceneformats/bezier/qglbezierscene.h
+++ /dev/null
@@ -1,66 +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 QGLBEZIERSCENE_H
-#define QGLBEZIERSCENE_H
-
-#include "qglabstractscene.h"
-#include "qglbuilder.h"
-
-QT_BEGIN_NAMESPACE
-
-class QGLBezierScene : public QGLAbstractScene
-{
- Q_OBJECT
-public:
- explicit QGLBezierScene(QGLSceneNode *geometry, QObject *parent = 0);
- virtual ~QGLBezierScene();
-
- QList<QObject *> objects() const;
- QGLSceneNode *mainNode() const;
-
-private:
- QGLSceneNode *mainObject;
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/plugins/sceneformats/bezier/qglbezierscenehandler.cpp b/src/plugins/sceneformats/bezier/qglbezierscenehandler.cpp
deleted file mode 100644
index cea212a6..00000000
--- a/src/plugins/sceneformats/bezier/qglbezierscenehandler.cpp
+++ /dev/null
@@ -1,197 +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 "qglbezierscenehandler.h"
-#include "qglbezierscene.h"
-#include "qglbezierpatches.h"
-#include "qvector3darray.h"
-#include <QtCore/qtextstream.h>
-
-QT_BEGIN_NAMESPACE
-
-QGLAbstractScene *QGLBezierSceneHandler::read()
-{
- QTextStream stream(device());
- QGLBezierPatches patches;
-
- // Read the number of patches from the first line.
- int patchCount;
- stream >> patchCount;
- stream.skipWhiteSpace();
- if (patchCount <= 0)
- return 0;
-
- // Read the patch indices.
- int depth = 0;
- QArray<int> indices;
- for (int patch = 0; patch < patchCount; ++patch) {
- bool eoln = false;
- for (int index = 0; index < 16; ++index) {
- int value;
- stream >> value;
- indices.append(value - 1);
-
- QChar sep;
- stream >> sep;
- if (sep == QLatin1Char('\n') || sep == QLatin1Char('\r')) {
- eoln = true;
- break;
- }
- if (sep != QLatin1Char(','))
- return 0;
- }
- if (!eoln) {
- // Optional sub-division depth on the end.
- int value;
- stream >> value;
- if (value > depth)
- depth = value;
- }
- stream.skipWhiteSpace();
- }
-
- // Read the number of vertices.
- int vertexCount;
- stream >> vertexCount;
- stream.skipWhiteSpace();
- if (vertexCount <= 0)
- return 0;
-
- // Read the vertex values.
- QVector3DArray vertices;
- for (int vertex = 0; vertex < vertexCount; ++vertex) {
- bool eoln = false;
- qreal coords[3] = {0.0f, 0.0f, 0.0f};
- for (int index = 0; index < 3; ++index) {
- stream >> coords[index];
-
- QChar sep;
- stream >> sep;
- if (sep == QLatin1Char('\n') || sep == QLatin1Char('\r')) {
- eoln = true;
- break;
- }
- if (sep != QLatin1Char(','))
- return 0;
- }
- vertices.append(coords[0], coords[1], coords[2]);
- if (!eoln) {
- // Optional normal on the end: read it but discard.
- for (int index = 0; index < 3; ++index) {
- stream >> coords[index];
-
- QChar sep;
- stream >> sep;
- if (sep == QLatin1Char('\n') || sep == QLatin1Char('\r'))
- break;
- if (sep != QLatin1Char(','))
- return 0;
- }
- }
- stream.skipWhiteSpace();
- }
-
- // Check for options at the end of the stream.
- if (!stream.atEnd()) {
- QChar ch;
- stream >> ch;
- if (ch == QLatin1Char('#')) {
- QString options = stream.readLine();
- if (options.contains(QLatin1String("teapot-adjust"))) {
- // Perform the "teapot adjustment" to convert the raw
- // teapot data into something more suitable for applications.
- // i.e., do the equivalent of the following transformation:
- // matrix.rotate(270.0f, 1.0f, 0.0f, 0.0f);
- // matrix.scale(0.5f, 0.5f, 0.5f);
- // matrix.translate(0.0f, 0.0f, -1.5f);
- for (int vertex = 0; vertex < vertexCount; ++vertex) {
- QVector3D vec = vertices[vertex];
- qreal x = vec.x();
- qreal y = vec.y();
- qreal z = vec.z();
- z -= 1.5f;
- x *= 0.5f;
- y *= 0.5f;
- z *= 0.5f;
- qreal y2 = z;
- qreal z2 = -y;
- y = y2;
- z = z2;
- vertices[vertex] = QVector3D(x, y, z);
- }
- }
- if (options.contains(QLatin1String("reverse-patches"))) {
- // Reverse the patch order to convert clockwise
- // patches into standard anti-clockwise patches.
- QArray<int> newIndices;
- for (int patch = 0; patch < patchCount; ++patch) {
- int temp[16];
- for (int index = 0; index < 16; ++index)
- temp[index] = indices[patch * 16 + index];
- for (int i = 0; i < 16; ++i)
- newIndices.append(temp[(i & 0x0C) + (3 - (i % 4))]);
- }
- indices = newIndices;
- }
- }
- }
-
- // Create the geometry node from the Bezier patch data.
- if (depth != 0)
- patches.setSubdivisionDepth(depth);
- QVector3DArray positions;
- for (int pindex = 0; pindex < indices.size(); ++pindex)
- positions += vertices[indices[pindex]];
- patches.setPositions(positions);
- QGLBuilder geometry;
- geometry << patches;
-
- // Create a scene with a single object containing the geometry.
- return new QGLBezierScene(geometry.finalizedSceneNode());
-}
-
-QGLAbstractScene *QGLBezierSceneHandler::download()
-{
- qWarning() << "Network loading is not supported for .bez files.";
- return NULL;
-}
-
-QT_END_NAMESPACE
diff --git a/src/plugins/sceneformats/bezier/qglbezierscenehandler.h b/src/plugins/sceneformats/bezier/qglbezierscenehandler.h
deleted file mode 100644
index ce093252..00000000
--- a/src/plugins/sceneformats/bezier/qglbezierscenehandler.h
+++ /dev/null
@@ -1,58 +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 QGLBEZIERSCENEHANDLER_H
-#define QGLBEZIERSCENEHANDLER_H
-
-#include "qglsceneformatplugin.h"
-
-QT_BEGIN_NAMESPACE
-
-class QGLBezierSceneHandler : public QGLSceneFormatHandler
-{
-public:
- QGLAbstractScene *read();
- QGLAbstractScene *download();
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/plugins/sceneformats/obj/main.cpp b/src/plugins/sceneformats/obj/main.cpp
deleted file mode 100644
index 41f5645c..00000000
--- a/src/plugins/sceneformats/obj/main.cpp
+++ /dev/null
@@ -1,78 +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 "qglsceneformatplugin.h"
-#include "qglobjscenehandler.h"
-
-QT_BEGIN_NAMESPACE
-
-//! [1]
-class QGLObjScenePlugin : public QGLSceneFormatPlugin
-{
-public:
- QStringList keys() const;
- virtual QGLSceneFormatHandler *create(QIODevice *device, const QUrl& url, const QString &format) const;
-};
-//! [1]
-
-//! [2]
-QStringList QGLObjScenePlugin::keys() const
-{
- return QStringList() << QLatin1String("obj") << QLatin1String("model/obj");
-}
-//! [2]
-
-//! [3]
-QGLSceneFormatHandler *QGLObjScenePlugin::create(QIODevice *device, const QUrl& url, const QString &format) const
-{
- Q_UNUSED(device);
- Q_UNUSED(url);
- Q_UNUSED(format);
- return new QGLObjSceneHandler;
-}
-//! [3]
-
-//! [4]
-Q_EXPORT_STATIC_PLUGIN(QGLObjScenePlugin)
-Q_EXPORT_PLUGIN2(qsceneobj, QGLObjScenePlugin)
-//! [4]
-
-QT_END_NAMESPACE
diff --git a/src/plugins/sceneformats/obj/obj.pro b/src/plugins/sceneformats/obj/obj.pro
deleted file mode 100644
index a14a1ce7..00000000
--- a/src/plugins/sceneformats/obj/obj.pro
+++ /dev/null
@@ -1,37 +0,0 @@
-TARGET = qsceneobj
-include(../../qpluginbase.pri)
-include(../../../../pkg.pri)
-
-HEADERS += qglobjscene.h \
- qglobjscenehandler.h
-SOURCES += main.cpp \
- qglobjscene.cpp \
- qglobjscenehandler.cpp
-
-# See the README in the root dir re this code
-package {
- macx:CONFIG(qt_framework, qt_framework|qt_no_framework) {
- LIBS += -framework Qt3D -F../../../threed
- INCLUDEPATH += ../../../threed/Qt3D.framework/Versions/1/Headers
- } else {
- win32 {
- CONFIG(debug, debug|release) {
- TARGET = $$member(TARGET, 0)d
- LIBS += ..\\..\\..\\threed\\debug\\Qt3Dd.lib
- } else {
- LIBS += ..\\..\\..\\threed\\release\\Qt3D.lib
- }
- } else {
- LIBS += -L../../../threed -lQt3D
- }
- INCLUDEPATH += ../../../../include/Qt3D
- }
- target.path = $$QT3D_INSTALL_PLUGINS/sceneformats
- INSTALLS += target
-} else {
- CONFIG += qt3d
- DESTDIR = $$QT3D_INSTALL_PLUGINS/sceneformats
-}
-
-target.path += $$QT3D_INSTALL_PLUGINS/sceneformats
-INSTALLS += target
diff --git a/src/plugins/sceneformats/obj/qglobjscene.cpp b/src/plugins/sceneformats/obj/qglobjscene.cpp
deleted file mode 100644
index ab5fb26e..00000000
--- a/src/plugins/sceneformats/obj/qglobjscene.cpp
+++ /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 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 "qglobjscene.h"
-#include "qglbuilder.h"
-#include "qglscenenode.h"
-
-QT_BEGIN_NAMESPACE
-
-QGLObjScene::QGLObjScene(QGLSceneNode *defaultNode, QObject *parent)
- : QGLAbstractScene(parent)
- , mainObject(defaultNode)
-{
- defaultNode->setParent(this);
-}
-
-QGLObjScene::~QGLObjScene()
-{
-}
-
-QList<QObject *> QGLObjScene::objects() const
-{
- QList<QObject *> objs;
- objs.append(mainObject);
- QList<QGLSceneNode *> children = mainObject->allChildren();
- for (int index = 0; index < children.count(); ++index)
- objs.append(children.at(index));
- return objs;
-}
-
-QGLSceneNode *QGLObjScene::mainNode() const
-{
- return mainObject;
-}
-
-QT_END_NAMESPACE
diff --git a/src/plugins/sceneformats/obj/qglobjscene.h b/src/plugins/sceneformats/obj/qglobjscene.h
deleted file mode 100644
index 832aac7e..00000000
--- a/src/plugins/sceneformats/obj/qglobjscene.h
+++ /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 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 QGLOBJSCENE_H
-#define QGLOBJSCENE_H
-
-#include "qglabstractscene.h"
-
-QT_BEGIN_NAMESPACE
-
-class QGLBuilder;
-class QGLSceneNode;
-
-//! [1]
-class QGLObjScene : public QGLAbstractScene
-{
- Q_OBJECT
-public:
-//! [1]
- explicit QGLObjScene(QGLSceneNode *defaultNode, QObject *parent = 0);
- virtual ~QGLObjScene();
-
-//! [2]
- QList<QObject *> objects() const;
- QGLSceneNode *mainNode() const;
-//! [2]
-
-private:
- QGLSceneNode *mainObject;
-//! [3]
-};
-//! [3]
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/plugins/sceneformats/obj/qglobjscenehandler.cpp b/src/plugins/sceneformats/obj/qglobjscenehandler.cpp
deleted file mode 100644
index 04140f29..00000000
--- a/src/plugins/sceneformats/obj/qglobjscenehandler.cpp
+++ /dev/null
@@ -1,470 +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 "qglobjscenehandler.h"
-#include "qglobjscene.h"
-#include "qvector2darray.h"
-#include "qvector3darray.h"
-#include "qglbuilder.h"
-
-#include <QtCore/qiodevice.h>
-#include <QtCore/qfile.h>
-#include <QtGui/qimage.h>
-
-QT_BEGIN_NAMESPACE
-
-QGLObjSceneHandler::QGLObjSceneHandler()
- : QGLSceneFormatHandler()
- , palette(0)
- , smoothing(QGL::Faceted)
- , smoothingForced(false)
-{
-}
-
-// Documentation for OBJ and MTL files from:
-// http://www.fileformat.info/format/wavefrontobj/egff.htm
-// http://www.fileformat.info/format/material/
-
-static int objSkipWS(const QByteArray& line, int posn)
-{
- while (posn < line.size() && (line[posn] == ' ' || line[posn] == '\t'))
- ++posn;
- return posn;
-}
-
-static int objSkipNonWS(const QByteArray& line, int posn, int stopch)
-{
- while (posn < line.size() &&
- line[posn] != ' ' && line[posn] != '\t' && line[posn] != stopch)
- ++posn;
- return posn;
-}
-
-static qreal objReadFloat(const QByteArray& line, int *posn)
-{
- *posn = objSkipWS(line, *posn);
- int end = objSkipNonWS(line, *posn, 0);
- qreal value;
- if (end > *posn)
- value = qreal(line.mid(*posn, end - *posn).toDouble());
- else
- value = 0.0f;
- *posn = end;
- return value;
-}
-
-static int objReadInteger(const QByteArray& line, int *posn)
-{
- *posn = objSkipWS(line, *posn);
- int end = objSkipNonWS(line, *posn, '/');
- int value;
- if (end > *posn)
- value = line.mid(*posn, end - *posn).toInt();
- else
- value = 0;
- //*posn = objSkipNonWS(line, end, 0);
- *posn = end;
- return value;
-}
-
-static int objReadSlashInteger(const QByteArray& line, int *posn)
-{
- if (*posn >= line.size() || line[*posn] != '/')
- return 0;
- ++(*posn);
- int end = objSkipNonWS(line, *posn, '/');
- int value;
- if (end > *posn)
- value = line.mid(*posn, end - *posn).toInt();
- else
- value = 0;
- //*posn = objSkipNonWS(line, end, 0);
- *posn = end;
- return value;
-}
-
-static QColor objReadColor(const QByteArray& line, int posn)
-{
- qreal red = objReadFloat(line, &posn);
- qreal green = objReadFloat(line, &posn);
- qreal blue = objReadFloat(line, &posn);
- qreal alpha = 1.0f;
- posn = objSkipWS(line, posn);
- if (posn < line.size())
- alpha = objReadFloat(line, &posn);
- return QColor::fromRgbF(red, green, blue, alpha);
-}
-
-void QGLObjSceneHandler::decodeOptions(const QString &options)
-{
- if (options.contains(QLatin1String("ForceSmooth")))
- {
- smoothingForced = true;
- smoothing = QGL::Smooth;
- }
- else
- {
- smoothingForced = true;
- smoothing = QGL::Faceted;
- }
-}
-
-QGLAbstractScene *QGLObjSceneHandler::read()
-{
- QByteArray line;
- QByteArray keyword;
- int posn, index, count;
- int tindex, nindex;
- QVector3DArray positions;
- QVector2DArray texCoords;
- QVector3DArray normals;
- qreal x, y, z;
- quint32 fields = 0;
- QGLMaterial *material = 0;
- QGLSceneNode *defaultNode;
-
- // Create the geometry builder and start an initial Faceted section.
- QGLBuilder builder;
- builder.newSection(smoothing);
- QGLSceneNode *root = builder.sceneNode();
- palette = root->palette();
- defaultNode = root;
- defaultNode->setObjectName(QLatin1String("__main"));
- builder.pushNode();
-
- QGeometryData op;
-
- while (!device()->atEnd()) {
- // Read the next line, including any backslash continuations.
- line = device()->readLine().trimmed();
- while (line.endsWith('\\')) {
- line.truncate(line.size() - 1);
- if (device()->atEnd())
- break;
- line += device()->readLine().trimmed();
- }
- if (line.startsWith('#') || line.isEmpty())
- continue; // Skip comments and blank lines.
-
- // Extract the keyword at the start of the line.
- posn = 0;
- while (posn < line.size() &&
- line[posn] != ' ' && line[posn] != '\t')
- ++posn;
- keyword = line.left(posn);
-
- // Determine how to process this line from the keyword.
- if (keyword == "v") {
- x = objReadFloat(line, &posn);
- y = objReadFloat(line, &posn);
- z = objReadFloat(line, &posn);
- positions.append(x, y, z);
- } else if (keyword == "vt") {
- x = objReadFloat(line, &posn);
- y = objReadFloat(line, &posn);
- texCoords.append(x, y);
- } else if (keyword == "vn") {
- x = objReadFloat(line, &posn);
- y = objReadFloat(line, &posn);
- z = objReadFloat(line, &posn);
- normals.append(x, y, z);
- } else if (keyword == "f") {
- posn = objSkipWS(line, posn);
- count = 0;
- //QGeometryData op; //(dlist, QGL::TRIANGLE_FAN);
- op = QGeometryData(); // clear leaves field definitions
- while (posn < line.size()) {
- // Note: we currently only read the initial vertex
- // index and also use it for texture co-ordinates
- // and normals. e.g. "2/2", "3/3", etc. This will
- // need to be fixed to handle "2/1", "3/7", etc.
- index = objReadInteger(line, &posn);
- tindex = objReadSlashInteger(line, &posn);
- nindex = objReadSlashInteger(line, &posn);
- if (index < 0)
- index = positions.count() + index;
- else if (index > 0)
- --index; // Indices in obj are 1-based.
- if (index >= 0 && index < positions.count())
- op.appendVertex(positions[index]);
- if (tindex < 0)
- tindex = texCoords.count() + tindex;
- else if (tindex > 0)
- --tindex; // Indices in obj are 1-based.
- else
- tindex = -1;
- if (tindex >= 0 && tindex < texCoords.count())
- op.appendTexCoord(texCoords[tindex]);
- if (nindex < 0)
- nindex = normals.count() + nindex;
- else if (nindex > 0)
- --nindex; // Indices in obj are 1-based.
- else
- nindex = -1;
- if (nindex >= 0 && nindex < normals.count())
- op.appendNormal(normals[nindex]);
- ++count;
- posn = objSkipNonWS(line, posn, 0);
- posn = objSkipWS(line, posn);
- }
- // if geometry has already been added with a different combination
- // of fields start a new section
- // the primitive doesn't get posted to the section until op.end()
- if (op.fields() != fields)
- {
- if (fields && builder.currentNode()->count() > 0)
- builder.newSection(smoothing);
- fields = op.fields();
- }
- builder.addTriangleFan(op);
- } else if (keyword == "usemtl") {
- // Specify a material for the faces that follow.
- posn = objSkipWS(line, posn);
- QByteArray rest = line.mid(posn);
- QString materialName = QString::fromLocal8Bit(rest.constData(), rest.size());
- if (!materialName.isEmpty() &&
- materialName != QLatin1String("(null)")) {
- index = palette->indexOf(materialName);
- if (index != -1) {
- QGLSceneNode *node = builder.newNode();
- node->setMaterialIndex(index);
- QGLMaterial *material = palette->material(index);
- if (material->texture())
- node->setEffect(QGL::LitDecalTexture2D);
- else
- node->setEffect(QGL::LitMaterial);
- } else {
- qWarning() << "obj material" << materialName << "not found";
- material = 0;
- }
- }
- } else if (keyword == "mtllib") {
- // Load a material library.
- posn = objSkipWS(line, posn);
- QByteArray filename = line.mid(posn);
- loadMaterialLibrary(QString::fromLocal8Bit(filename.constData(), filename.size()));
- } else if (keyword == "s") {
- if (!smoothingForced)
- {
- // Set smoothing on or off.
- posn = objSkipWS(line, posn);
- index = objSkipNonWS(line, posn, 0);
- QByteArray arg = line.mid(posn, index - posn);
- QGL::Smoothing smooth;
- if (arg == "on" || arg == "1")
- smooth = QGL::Smooth;
- else
- smooth = QGL::Faceted;
- if (smoothing != smooth) {
- smoothing = smooth;
- builder.newSection(smooth);
- }
- }
- } else if (keyword == "g" || keyword == "o") {
- // Label the faces that follow as part of a named group or object.
- posn = objSkipWS(line, posn);
- QByteArray rest = line.mid(posn);
- QString objectName = QString::fromLocal8Bit(rest.constData(), rest.size());
- QGLSceneNode *node = builder.currentNode();
- // if content has already been added to a current group, then
- // create a new node in the scene graph for the group, otherwise
- // just label the existing group with this name
- QGLSceneNode *p = qobject_cast<QGLSceneNode*>(node->parent());
- if (node->count() > 0 && p && p->objectName().isEmpty())
- {
- node = p;
- }
- else
- {
- builder.popNode();
- node = builder.currentNode();
- builder.pushNode();
- }
- node->setObjectName(objectName);
- } else {
- qWarning() << "unsupported obj command: " << keyword.constData();
- }
- }
-
- // Create a scene from the geometry
- return new QGLObjScene(builder.finalizedSceneNode());
-}
-
-QGLAbstractScene *QGLObjSceneHandler::download()
-{
- qWarning() << "Network loading of obj files using this plugin is not implemented.";
- return NULL;
-}
-
-void QGLObjSceneHandler::loadMaterialLibrary(const QString& name)
-{
- QUrl materialUrl = url().resolved(name);
- if (materialUrl.scheme() == QLatin1String("file")) {
- QFile file(materialUrl.toLocalFile());
- if (!file.open(QIODevice::ReadOnly))
- qWarning() << "QGLObjSceneHandler::loadMaterialLibrary: could not open:" << materialUrl.toLocalFile();
- else
- loadMaterials(&file);
- } else {
- // TODO
- qWarning("QGLObjSceneHandler::loadMaterialLibrary: non-file urls not supported");
- }
-}
-
-void QGLObjSceneHandler::loadMaterials(QIODevice *device)
-{
- QByteArray line;
- QByteArray keyword;
- int posn, index;
- QGLMaterial *material = 0;
- QString materialName;
- QString textureName;
-
- while (!device->atEnd()) {
- // Read the next line, including any backslash continuations.
- line = device->readLine().trimmed();
- while (line.endsWith('\\')) {
- line.truncate(line.size() - 1);
- if (device->atEnd())
- break;
- line += device->readLine().trimmed();
- }
- if (line.startsWith('#') || line.isEmpty())
- continue; // Skip comments and blank lines.
-
- // Extract the keyword at the start of the line.
- posn = 0;
- while (posn < line.size() &&
- line[posn] != ' ' && line[posn] != '\t')
- ++posn;
- keyword = line.left(posn);
-
- // Determine how to process this line from the keyword.
- if (keyword == "newmtl") {
- // Start a new material definition.
- posn = objSkipWS(line, posn);
- QByteArray rest = line.mid(posn);
- materialName = QString::fromLocal8Bit(rest.constData(), rest.size());
- index = palette->indexOf(materialName);
- if (index != -1) {
- qWarning() << "redefining obj material:" << materialName;
- material = palette->material(index);
- } else {
- material = new QGLMaterial();
- material->setObjectName(materialName);
- palette->addMaterial(material);
- }
- } else if (keyword == "Ka") {
- // Ambient color of the material.
- if (material)
- material->setAmbientColor(objReadColor(line, posn));
- } else if (keyword == "Kd") {
- // Diffuse color of the material.
- if (material)
- material->setDiffuseColor(objReadColor(line, posn));
- } else if (keyword == "Ks") {
- // Specular color of the material.
- if (material)
- material->setSpecularColor(objReadColor(line, posn));
- } else if (keyword == "map_Kd") {
- // Texture associated with the material.
- posn = objSkipWS(line, posn);
- QByteArray rest = line.mid(posn);
- textureName = QString::fromLocal8Bit(rest.constData(), rest.size());
- QGLTexture2D *texture = loadTexture(textureName);
- if (texture) {
- index = palette->indexOf(materialName);
- if (index >= 0) {
- QGLMaterial *material = palette->material(index);
- texture->setParent(material);
- material->setTexture(texture);
- } else {
- delete texture;
- }
- }
- } else if (keyword == "d") {
- // "Dissolve factor" of the material, which is its opacity.
- if (material) {
- qreal alpha = objReadFloat(line, &posn);
- QColor ambient = material->ambientColor();
- QColor diffuse = material->diffuseColor();
- ambient.setAlphaF(alpha);
- diffuse.setAlphaF(alpha);
- material->setAmbientColor(ambient);
- material->setDiffuseColor(diffuse);
- }
- } else if (keyword == "Ns") {
- // Specular exponent of the material.
- if (material)
- material->setShininess(qRound(objReadFloat(line, &posn)));
- } else if (keyword == "illum") {
- // Illumination model - ignored at present.
- } else if (keyword == "Ni") {
- // Optical density - ignored at present.
- } else {
- qWarning() << "unsupported obj material command: " << keyword.constData();
- }
- }
-}
-
-QGLTexture2D *QGLObjSceneHandler::loadTexture(const QString& name)
-{
- QUrl textureUrl = url().resolved(name);
- if (textureUrl.scheme() == QLatin1String("file")) {
- QFile file(textureUrl.toLocalFile());
- if (!file.open(QIODevice::ReadOnly)) {
- qWarning() << "QGLObjSceneHandler::loadTexture: could not open:" << textureUrl.toLocalFile();
- return 0;
- } else {
- file.close();
- QImage image(textureUrl.toLocalFile());
- QGLTexture2D *tex = new QGLTexture2D();
- tex->setImage(image);
- return tex;
- }
- } else {
- // TODO
- qWarning("QGLObjSceneHandler::loadTexture: non-file urls not supported");
- return 0;
- }
-}
-
-QT_END_NAMESPACE
diff --git a/src/plugins/sceneformats/obj/qglobjscenehandler.h b/src/plugins/sceneformats/obj/qglobjscenehandler.h
deleted file mode 100644
index 3c0d6a34..00000000
--- a/src/plugins/sceneformats/obj/qglobjscenehandler.h
+++ /dev/null
@@ -1,76 +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 QGLOBJSCENEHANDLER_H
-#define QGLOBJSCENEHANDLER_H
-
-#include "qglsceneformatplugin.h"
-#include "qglmaterialcollection.h"
-#include <QtCore/qmap.h>
-#include <QtCore/qset.h>
-
-QT_BEGIN_NAMESPACE
-
-//! [1]
-class QGLObjSceneHandler : public QGLSceneFormatHandler
-{
-public:
- QGLObjSceneHandler();
- QGLAbstractScene *read();
- QGLAbstractScene *download();
-//! [1]
- void decodeOptions(const QString &options);
-
-private:
- void loadMaterialLibrary(const QString& name);
- void loadMaterials(QIODevice *device);
- QGLTexture2D *loadTexture(const QString& name);
-
- QGLMaterialCollection *palette;
- QGL::Smoothing smoothing;
- bool smoothingForced;
-//! [2]
-};
-//! [2]
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/plugins/sceneformats/sceneformats.pro b/src/plugins/sceneformats/sceneformats.pro
deleted file mode 100644
index 97ec09a6..00000000
--- a/src/plugins/sceneformats/sceneformats.pro
+++ /dev/null
@@ -1,7 +0,0 @@
-TEMPLATE = subdirs
-
-old_importer {
- SUBDIRS = bezier 3ds obj
-} else {
- SUBDIRS = bezier assimp
-}
diff --git a/src/private/private.pri b/src/private/private.pri
deleted file mode 100644
index b80e28a5..00000000
--- a/src/private/private.pri
+++ /dev/null
@@ -1,3 +0,0 @@
-INCLUDEPATH += $$PWD
-VPATH += $$PWD
-
diff --git a/src/private/qfactoryloader_p.h b/src/private/qfactoryloader_p.h
deleted file mode 100644
index 34546ff0..00000000
--- a/src/private/qfactoryloader_p.h
+++ /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 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 QFACTORYLOADER_P_H
-#define QFACTORYLOADER_P_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 "QtCore/qobject.h"
-#include "QtCore/qstringlist.h"
-//#include "private/qlibrary_p.h"
-
-#ifndef QT_NO_LIBRARY
-
-QT_BEGIN_NAMESPACE
-
-class QFactoryLoaderPrivate;
-
-#ifdef Q_WS_X11
-class QLibraryPrivate;
-#endif
-
-class Q_CORE_EXPORT QFactoryLoader : public QObject
-{
- Q_OBJECT
- Q_DECLARE_PRIVATE(QFactoryLoader)
-
-public:
- QFactoryLoader(const char *iid,
- const QString &suffix = QString(),
- Qt::CaseSensitivity = Qt::CaseSensitive);
- ~QFactoryLoader();
-
- QStringList keys() const;
- QObject *instance(const QString &key) const;
-
-#ifdef Q_WS_X11
- QLibraryPrivate *library(const QString &key) const;
-#endif
-
- void update();
-
- static void refreshAll();
-};
-
-QT_END_NAMESPACE
-
-#endif // QT_NO_LIBRARY
-
-#endif // QFACTORYLOADER_P_H
diff --git a/src/private/qglextensions_p.h b/src/private/qglextensions_p.h
deleted file mode 100644
index 5a040035..00000000
--- a/src/private/qglextensions_p.h
+++ /dev/null
@@ -1,884 +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 QGL_EXTENSIONS_P_H
-#define QGL_EXTENSIONS_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists for the convenience
-// of the Qt OpenGL classes. This header file may change from
-// version to version without notice, or even be removed.
-//
-// We mean it.
-//
-
-// extension prototypes
-#ifndef Q_WS_MAC
-# ifndef APIENTRYP
-# ifdef APIENTRY
-# define APIENTRYP APIENTRY *
-# else
-# define APIENTRY
-# define APIENTRYP *
-# endif
-# endif
-#else
-# define APIENTRY
-# define APIENTRYP *
-#endif
-
-#include <QtCore/qglobal.h>
-
-#ifndef GL_ARB_vertex_buffer_object
-typedef ptrdiff_t GLintptrARB;
-typedef ptrdiff_t GLsizeiptrARB;
-#endif
-
-#ifndef GL_VERSION_2_0
-typedef char GLchar;
-#endif
-
-// ARB_vertex_buffer_object
-typedef void (APIENTRY *_glBindBuffer) (GLenum, GLuint);
-typedef void (APIENTRY *_glDeleteBuffers) (GLsizei, const GLuint *);
-typedef void (APIENTRY *_glGenBuffers) (GLsizei, GLuint *);
-typedef void (APIENTRY *_glBufferData) (GLenum, GLsizeiptrARB, const GLvoid *, GLenum);
-typedef void (APIENTRY *_glBufferSubData) (GLenum, GLintptrARB, GLsizeiptrARB, const GLvoid *);
-typedef void (APIENTRY *_glGetBufferSubData) (GLenum, GLintptrARB, GLsizeiptrARB, GLvoid *);
-typedef void (APIENTRY *_glGetBufferParameteriv) (GLenum, GLenum, GLint *);
-typedef GLvoid* (APIENTRY *_glMapBufferARB) (GLenum, GLenum);
-typedef GLboolean (APIENTRY *_glUnmapBufferARB) (GLenum);
-// We can call the buffer functions directly in OpenGL/ES 1.1 or higher,
-// but all other platforms need to resolve the extensions.
-#if defined(QT_OPENGL_ES)
-#if defined(GL_OES_VERSION_1_0) && !defined(GL_OES_VERSION_1_1)
-#define QGL_RESOLVE_BUFFER_FUNCS 1
-#endif
-#else
-#define QGL_RESOLVE_BUFFER_FUNCS 1
-#endif
-
-// ARB_fragment_program
-typedef void (APIENTRY *_glProgramStringARB) (GLenum, GLenum, GLsizei, const GLvoid *);
-typedef void (APIENTRY *_glBindProgramARB) (GLenum, GLuint);
-typedef void (APIENTRY *_glDeleteProgramsARB) (GLsizei, const GLuint *);
-typedef void (APIENTRY *_glGenProgramsARB) (GLsizei, GLuint *);
-typedef void (APIENTRY *_glProgramLocalParameter4fvARB) (GLenum, GLuint, const GLfloat *);
-
-// GLSL
-typedef GLuint (APIENTRY *_glCreateShader) (GLenum);
-typedef void (APIENTRY *_glShaderSource) (GLuint, GLsizei, const char **, const GLint *);
-typedef void (APIENTRY *_glShaderBinary) (GLint, const GLuint*, GLenum, const void*, GLint);
-typedef void (APIENTRY *_glCompileShader) (GLuint);
-typedef void (APIENTRY *_glDeleteShader) (GLuint);
-typedef GLboolean (APIENTRY *_glIsShader) (GLuint);
-
-typedef GLuint (APIENTRY *_glCreateProgram) ();
-typedef void (APIENTRY *_glAttachShader) (GLuint, GLuint);
-typedef void (APIENTRY *_glDetachShader) (GLuint, GLuint);
-typedef void (APIENTRY *_glLinkProgram) (GLuint);
-typedef void (APIENTRY *_glUseProgram) (GLuint);
-typedef void (APIENTRY *_glDeleteProgram) (GLuint);
-typedef GLboolean (APIENTRY *_glIsProgram) (GLuint);
-
-typedef void (APIENTRY *_glGetShaderInfoLog) (GLuint, GLsizei, GLsizei *, char *);
-typedef void (APIENTRY *_glGetShaderiv) (GLuint, GLenum, GLint *);
-typedef void (APIENTRY *_glGetShaderSource) (GLuint, GLsizei, GLsizei *, char *);
-typedef void (APIENTRY *_glGetProgramiv) (GLuint, GLenum, GLint *);
-typedef void (APIENTRY *_glGetProgramInfoLog) (GLuint, GLsizei, GLsizei *, char *);
-
-typedef GLuint (APIENTRY *_glGetUniformLocation) (GLuint, const char*);
-typedef void (APIENTRY *_glUniform4fv) (GLint, GLsizei, const GLfloat *);
-typedef void (APIENTRY *_glUniform3fv) (GLint, GLsizei, const GLfloat *);
-typedef void (APIENTRY *_glUniform2fv) (GLint, GLsizei, const GLfloat *);
-typedef void (APIENTRY *_glUniform1fv) (GLint, GLsizei, const GLfloat *);
-typedef void (APIENTRY *_glUniform1i) (GLint, GLint);
-typedef void (APIENTRY *_glUniform1iv) (GLint, GLsizei, const GLint *);
-typedef void (APIENTRY *_glUniformMatrix2fv) (GLint, GLsizei, GLboolean, const GLfloat *);
-typedef void (APIENTRY *_glUniformMatrix3fv) (GLint, GLsizei, GLboolean, const GLfloat *);
-typedef void (APIENTRY *_glUniformMatrix4fv) (GLint, GLsizei, GLboolean, const GLfloat *);
-typedef void (APIENTRY *_glUniformMatrix2x3fv) (GLint, GLsizei, GLboolean, const GLfloat *);
-typedef void (APIENTRY *_glUniformMatrix2x4fv) (GLint, GLsizei, GLboolean, const GLfloat *);
-typedef void (APIENTRY *_glUniformMatrix3x2fv) (GLint, GLsizei, GLboolean, const GLfloat *);
-typedef void (APIENTRY *_glUniformMatrix3x4fv) (GLint, GLsizei, GLboolean, const GLfloat *);
-typedef void (APIENTRY *_glUniformMatrix4x2fv) (GLint, GLsizei, GLboolean, const GLfloat *);
-typedef void (APIENTRY *_glUniformMatrix4x3fv) (GLint, GLsizei, GLboolean, const GLfloat *);
-
-typedef void (APIENTRY *_glBindAttribLocation) (GLuint, GLuint, const char *);
-typedef GLint (APIENTRY *_glGetAttribLocation) (GLuint, const char *);
-typedef void (APIENTRY *_glVertexAttrib1fv) (GLuint, const GLfloat *);
-typedef void (APIENTRY *_glVertexAttrib2fv) (GLuint, const GLfloat *);
-typedef void (APIENTRY *_glVertexAttrib3fv) (GLuint, const GLfloat *);
-typedef void (APIENTRY *_glVertexAttrib4fv) (GLuint, const GLfloat *);
-typedef void (APIENTRY *_glVertexAttribPointer) (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *);
-typedef void (APIENTRY *_glDisableVertexAttribArray) (GLuint);
-typedef void (APIENTRY *_glEnableVertexAttribArray) (GLuint);
-
-typedef void (APIENTRY *_glGetProgramBinaryOES) (GLuint, GLsizei, GLsizei *, GLenum *, void *);
-typedef void (APIENTRY *_glProgramBinaryOES) (GLuint, GLenum, const void *, GLint);
-
-
-typedef void (APIENTRY *_glMultiTexCoord4f) (GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
-typedef void (APIENTRY *_glActiveStencilFaceEXT) (GLenum );
-
-// Needed for GL2 engine:
-typedef void (APIENTRY *_glStencilOpSeparate) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
-typedef void (APIENTRY *_glActiveTexture) (GLenum);
-typedef void (APIENTRY *_glBlendColor) (GLclampf, GLclampf, GLclampf, GLclampf);
-
-
-// EXT_GL_framebuffer_object
-typedef GLboolean (APIENTRY *_glIsRenderbuffer) (GLuint renderbuffer);
-typedef void (APIENTRY *_glBindRenderbuffer) (GLenum target, GLuint renderbuffer);
-typedef void (APIENTRY *_glDeleteRenderbuffers) (GLsizei n, const GLuint *renderbuffers);
-typedef void (APIENTRY *_glGenRenderbuffers) (GLsizei n, GLuint *renderbuffers);
-typedef void (APIENTRY *_glRenderbufferStorage) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (APIENTRY *_glGetRenderbufferParameteriv) (GLenum target, GLenum pname, GLint *params);
-typedef GLboolean (APIENTRY *_glIsFramebuffer) (GLuint framebuffer);
-typedef void (APIENTRY *_glBindFramebuffer) (GLenum target, GLuint framebuffer);
-typedef void (APIENTRY *_glDeleteFramebuffers) (GLsizei n, const GLuint *framebuffers);
-typedef void (APIENTRY *_glGenFramebuffers) (GLsizei n, GLuint *framebuffers);
-typedef GLenum (APIENTRY *_glCheckFramebufferStatus) (GLenum target);
-typedef void (APIENTRY *_glFramebufferTexture2D) (GLenum target, GLenum attachment, GLenum textarget,
- GLuint texture, GLint level);
-typedef void (APIENTRY *_glFramebufferRenderbuffer) (GLenum target, GLenum attachment, GLenum renderbuffertarget,
- GLuint renderbuffer);
-typedef void (APIENTRY *_glGetFramebufferAttachmentParameteriv) (GLenum target, GLenum attachment, GLenum pname,
- GLint *params);
-typedef void (APIENTRY *_glGenerateMipmap) (GLenum target);
-
-// EXT_GL_framebuffer_blit
-typedef void (APIENTRY *_glBlitFramebufferEXT) (int srcX0, int srcY0, int srcX1, int srcY1,
- int dstX0, int dstY0, int dstX1, int dstY1,
- GLbitfield mask, GLenum filter);
-
-// EXT_GL_framebuffer_multisample
-typedef void (APIENTRY *_glRenderbufferStorageMultisampleEXT) (GLenum target, GLsizei samples,
- GLenum internalformat, GLsizei width, GLsizei height);
-
-// GL_EXT_geometry_shader4
-typedef void (APIENTRY *_glProgramParameteriEXT)(GLuint program, GLenum pname, GLint value);
-typedef void (APIENTRY *_glFramebufferTextureEXT)(GLenum target, GLenum attachment,
- GLuint texture, GLint level);
-typedef void (APIENTRY *_glFramebufferTextureLayerEXT)(GLenum target, GLenum attachment,
- GLuint texture, GLint level, GLint layer);
-typedef void (APIENTRY *_glFramebufferTextureFaceEXT)(GLenum target, GLenum attachment,
- GLuint texture, GLint level, GLenum face);
-
-// ARB_texture_compression
-typedef void (APIENTRY *_glCompressedTexImage2DARB) (GLenum, GLint, GLenum, GLsizei,
- GLsizei, GLint, GLsizei, const GLvoid *);
-
-QT_BEGIN_NAMESPACE
-
-struct QGLExtensionFuncs
-{
- QGLExtensionFuncs() {
-#if !defined(QT_OPENGL_ES_2)
- qt_glProgramStringARB = 0;
- qt_glBindProgramARB = 0;
- qt_glDeleteProgramsARB = 0;
- qt_glGenProgramsARB = 0;
- qt_glProgramLocalParameter4fvARB = 0;
-
- // GLSL
- qt_glCreateShader = 0;
- qt_glShaderSource = 0;
- qt_glShaderBinary = 0;
- qt_glCompileShader = 0;
- qt_glDeleteShader = 0;
- qt_glIsShader = 0;
-
- qt_glCreateProgram = 0;
- qt_glAttachShader = 0;
- qt_glDetachShader = 0;
- qt_glLinkProgram = 0;
- qt_glUseProgram = 0;
- qt_glDeleteProgram = 0;
- qt_glIsProgram = 0;
-
- qt_glGetShaderInfoLog = 0;
- qt_glGetShaderiv = 0;
- qt_glGetShaderSource = 0;
- qt_glGetProgramiv = 0;
- qt_glGetProgramInfoLog = 0;
-
- qt_glGetUniformLocation = 0;
- qt_glUniform4fv = 0;
- qt_glUniform3fv = 0;
- qt_glUniform2fv = 0;
- qt_glUniform1fv = 0;
- qt_glUniform1i = 0;
- qt_glUniform1iv = 0;
- qt_glUniformMatrix2fv = 0;
- qt_glUniformMatrix3fv = 0;
- qt_glUniformMatrix4fv = 0;
- qt_glUniformMatrix2x3fv = 0;
- qt_glUniformMatrix2x4fv = 0;
- qt_glUniformMatrix3x2fv = 0;
- qt_glUniformMatrix3x4fv = 0;
- qt_glUniformMatrix4x2fv = 0;
- qt_glUniformMatrix4x3fv = 0;
-
- qt_glBindAttribLocation = 0;
- qt_glGetAttribLocation = 0;
- qt_glVertexAttrib1fv = 0;
- qt_glVertexAttrib2fv = 0;
- qt_glVertexAttrib3fv = 0;
- qt_glVertexAttrib4fv = 0;
- qt_glVertexAttribPointer = 0;
- qt_glDisableVertexAttribArray = 0;
- qt_glEnableVertexAttribArray = 0;
-
- // Extras for GL2 engine:
- qt_glActiveTexture = 0;
- qt_glStencilOpSeparate = 0;
- qt_glBlendColor = 0;
-
- qt_glActiveStencilFaceEXT = 0;
- qt_glMultiTexCoord4f = 0;
-#else
- qt_glslResolved = false;
-
- qt_glGetProgramBinaryOES = 0;
- qt_glProgramBinaryOES = 0;
-#endif
-
- // FBOs
-#if !defined(QT_OPENGL_ES_2)
- qt_glIsRenderbuffer = 0;
- qt_glBindRenderbuffer = 0;
- qt_glDeleteRenderbuffers = 0;
- qt_glGenRenderbuffers = 0;
- qt_glRenderbufferStorage = 0;
- qt_glGetRenderbufferParameteriv = 0;
- qt_glIsFramebuffer = 0;
- qt_glBindFramebuffer = 0;
- qt_glDeleteFramebuffers = 0;
- qt_glGenFramebuffers = 0;
- qt_glCheckFramebufferStatus = 0;
- qt_glFramebufferTexture2D = 0;
- qt_glFramebufferRenderbuffer = 0;
- qt_glGetFramebufferAttachmentParameteriv = 0;
- qt_glGenerateMipmap = 0;
-#endif
- qt_glBlitFramebufferEXT = 0;
- qt_glRenderbufferStorageMultisampleEXT = 0;
-
- // Buffer objects:
-#if defined(QGL_RESOLVE_BUFFER_FUNCS)
- qt_glBindBuffer = 0;
- qt_glDeleteBuffers = 0;
- qt_glGenBuffers = 0;
- qt_glBufferData = 0;
- qt_glBufferSubData = 0;
- qt_glGetBufferSubData = 0;
- qt_glGetBufferParameteriv = 0;
-#endif
- qt_glMapBufferARB = 0;
- qt_glUnmapBufferARB = 0;
-
- qt_glProgramParameteriEXT = 0;
- qt_glFramebufferTextureEXT = 0;
- qt_glFramebufferTextureLayerEXT = 0;
- qt_glFramebufferTextureFaceEXT = 0;
-#if !defined(QT_OPENGL_ES)
- // Texture compression
- qt_glCompressedTexImage2DARB = 0;
-#endif
-
-#ifndef QT_NO_EGL
- // OES_EGL_image
- //qt_glEGLImageTargetTexture2DOES = 0;
- //qt_glEGLImageTargetRenderbufferStorageOES = 0;
-#endif
- }
-
-
-#if !defined(QT_OPENGL_ES_2)
- _glProgramStringARB qt_glProgramStringARB;
- _glBindProgramARB qt_glBindProgramARB;
- _glDeleteProgramsARB qt_glDeleteProgramsARB;
- _glGenProgramsARB qt_glGenProgramsARB;
- _glProgramLocalParameter4fvARB qt_glProgramLocalParameter4fvARB;
-
- // GLSL definitions
- _glCreateShader qt_glCreateShader;
- _glShaderSource qt_glShaderSource;
- _glShaderBinary qt_glShaderBinary;
- _glCompileShader qt_glCompileShader;
- _glDeleteShader qt_glDeleteShader;
- _glIsShader qt_glIsShader;
-
- _glCreateProgram qt_glCreateProgram;
- _glAttachShader qt_glAttachShader;
- _glDetachShader qt_glDetachShader;
- _glLinkProgram qt_glLinkProgram;
- _glUseProgram qt_glUseProgram;
- _glDeleteProgram qt_glDeleteProgram;
- _glIsProgram qt_glIsProgram;
-
- _glGetShaderInfoLog qt_glGetShaderInfoLog;
- _glGetShaderiv qt_glGetShaderiv;
- _glGetShaderSource qt_glGetShaderSource;
- _glGetProgramiv qt_glGetProgramiv;
- _glGetProgramInfoLog qt_glGetProgramInfoLog;
-
- _glGetUniformLocation qt_glGetUniformLocation;
- _glUniform4fv qt_glUniform4fv;
- _glUniform3fv qt_glUniform3fv;
- _glUniform2fv qt_glUniform2fv;
- _glUniform1fv qt_glUniform1fv;
- _glUniform1i qt_glUniform1i;
- _glUniform1iv qt_glUniform1iv;
- _glUniformMatrix2fv qt_glUniformMatrix2fv;
- _glUniformMatrix3fv qt_glUniformMatrix3fv;
- _glUniformMatrix4fv qt_glUniformMatrix4fv;
- _glUniformMatrix2x3fv qt_glUniformMatrix2x3fv;
- _glUniformMatrix2x4fv qt_glUniformMatrix2x4fv;
- _glUniformMatrix3x2fv qt_glUniformMatrix3x2fv;
- _glUniformMatrix3x4fv qt_glUniformMatrix3x4fv;
- _glUniformMatrix4x2fv qt_glUniformMatrix4x2fv;
- _glUniformMatrix4x3fv qt_glUniformMatrix4x3fv;
-
- _glBindAttribLocation qt_glBindAttribLocation;
- _glGetAttribLocation qt_glGetAttribLocation;
- _glVertexAttrib1fv qt_glVertexAttrib1fv;
- _glVertexAttrib2fv qt_glVertexAttrib2fv;
- _glVertexAttrib3fv qt_glVertexAttrib3fv;
- _glVertexAttrib4fv qt_glVertexAttrib4fv;
- _glVertexAttribPointer qt_glVertexAttribPointer;
- _glDisableVertexAttribArray qt_glDisableVertexAttribArray;
- _glEnableVertexAttribArray qt_glEnableVertexAttribArray;
-
-#else
- bool qt_glslResolved;
-
- _glGetProgramBinaryOES qt_glGetProgramBinaryOES;
- _glProgramBinaryOES qt_glProgramBinaryOES;
-#endif
-
- _glActiveStencilFaceEXT qt_glActiveStencilFaceEXT;
- _glMultiTexCoord4f qt_glMultiTexCoord4f;
-
-#if !defined(QT_OPENGL_ES_2)
- // Extras needed for GL2 engine:
- _glActiveTexture qt_glActiveTexture;
- _glStencilOpSeparate qt_glStencilOpSeparate;
- _glBlendColor qt_glBlendColor;
-
-#endif
-
- // FBOs
-#if !defined(QT_OPENGL_ES_2)
- _glIsRenderbuffer qt_glIsRenderbuffer;
- _glBindRenderbuffer qt_glBindRenderbuffer;
- _glDeleteRenderbuffers qt_glDeleteRenderbuffers;
- _glGenRenderbuffers qt_glGenRenderbuffers;
- _glRenderbufferStorage qt_glRenderbufferStorage;
- _glGetRenderbufferParameteriv qt_glGetRenderbufferParameteriv;
- _glIsFramebuffer qt_glIsFramebuffer;
- _glBindFramebuffer qt_glBindFramebuffer;
- _glDeleteFramebuffers qt_glDeleteFramebuffers;
- _glGenFramebuffers qt_glGenFramebuffers;
- _glCheckFramebufferStatus qt_glCheckFramebufferStatus;
- _glFramebufferTexture2D qt_glFramebufferTexture2D;
- _glFramebufferRenderbuffer qt_glFramebufferRenderbuffer;
- _glGetFramebufferAttachmentParameteriv qt_glGetFramebufferAttachmentParameteriv;
- _glGenerateMipmap qt_glGenerateMipmap;
-#endif
- _glBlitFramebufferEXT qt_glBlitFramebufferEXT;
- _glRenderbufferStorageMultisampleEXT qt_glRenderbufferStorageMultisampleEXT;
-
- // Buffer objects
-#if defined(QGL_RESOLVE_BUFFER_FUNCS)
- _glBindBuffer qt_glBindBuffer;
- _glDeleteBuffers qt_glDeleteBuffers;
- _glGenBuffers qt_glGenBuffers;
- _glBufferData qt_glBufferData;
- _glBufferSubData qt_glBufferSubData;
- _glGetBufferSubData qt_glGetBufferSubData;
- _glGetBufferParameteriv qt_glGetBufferParameteriv;
-#endif
- _glMapBufferARB qt_glMapBufferARB;
- _glUnmapBufferARB qt_glUnmapBufferARB;
-
- // Geometry shaders...
- _glProgramParameteriEXT qt_glProgramParameteriEXT;
- _glFramebufferTextureEXT qt_glFramebufferTextureEXT;
- _glFramebufferTextureLayerEXT qt_glFramebufferTextureLayerEXT;
- _glFramebufferTextureFaceEXT qt_glFramebufferTextureFaceEXT;
-#if !defined(QT_OPENGL_ES)
- // Texture compression
- _glCompressedTexImage2DARB qt_glCompressedTexImage2DARB;
-#endif
-
-#ifndef QT_NO_EGL
- // OES_EGL_image
- //_glEGLImageTargetTexture2DOES qt_glEGLImageTargetTexture2DOES;
- //_glEGLImageTargetRenderbufferStorageOES qt_glEGLImageTargetRenderbufferStorageOES;
-#endif
-};
-
-
-// OpenGL constants
-
-#ifndef GL_ARRAY_BUFFER
-#define GL_ARRAY_BUFFER 0x8892
-#endif
-
-#ifndef GL_STATIC_DRAW
-#define GL_STATIC_DRAW 0x88E4
-#endif
-
-/* NV_texture_rectangle */
-#ifndef GL_NV_texture_rectangle
-#define GL_TEXTURE_RECTANGLE_NV 0x84F5
-#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6
-#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7
-#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8
-#endif
-
-#ifndef GL_BGRA
-#define GL_BGRA 0x80E1
-#endif
-
-#ifndef GL_RGB16
-#define GL_RGB16 0x8054
-#endif
-
-#ifndef GL_UNSIGNED_SHORT_5_6_5
-#define GL_UNSIGNED_SHORT_5_6_5 0x8363
-#endif
-
-#ifndef GL_UNSIGNED_INT_8_8_8_8_REV
-#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367
-#endif
-
-#ifndef GL_MULTISAMPLE
-#define GL_MULTISAMPLE 0x809D
-#endif
-
-#ifndef GL_CLAMP_TO_EDGE
-#define GL_CLAMP_TO_EDGE 0x812F
-#endif
-
-#ifndef GL_IBM_texture_mirrored_repeat
-#define GL_MIRRORED_REPEAT_IBM 0x8370
-#endif
-
-#ifndef GL_SGIS_generate_mipmap
-#define GL_GENERATE_MIPMAP_SGIS 0x8191
-#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192
-#endif
-
-// ARB_fragment_program extension protos
-#ifndef GL_FRAGMENT_PROGRAM_ARB
-#define GL_FRAGMENT_PROGRAM_ARB 0x8804
-#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875
-#endif
-
-#ifndef GL_PIXEL_UNPACK_BUFFER_ARB
-#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC
-#endif
-
-#ifndef GL_WRITE_ONLY_ARB
-#define GL_WRITE_ONLY_ARB 0x88B9
-#endif
-
-#ifndef GL_STREAM_DRAW_ARB
-#define GL_STREAM_DRAW_ARB 0x88E0
-#endif
-
-// Stencil wrap and two-side defines
-#ifndef GL_STENCIL_TEST_TWO_SIDE_EXT
-#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910
-#endif
-#ifndef GL_INCR_WRAP_EXT
-#define GL_INCR_WRAP_EXT 0x8507
-#endif
-#ifndef GL_DECR_WRAP_EXT
-#define GL_DECR_WRAP_EXT 0x8508
-#endif
-
-#ifndef GL_TEXTURE0
-#define GL_TEXTURE0 0x84C0
-#endif
-
-#ifndef GL_TEXTURE1
-#define GL_TEXTURE1 0x84C1
-#endif
-
-#ifndef GL_DEPTH_COMPONENT16
-#define GL_DEPTH_COMPONENT16 0x81A5
-#endif
-
-#ifndef GL_DEPTH_COMPONENT24_OES
-#define GL_DEPTH_COMPONENT24_OES 0x81A6
-#endif
-
-#ifndef GL_EXT_framebuffer_object
-#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506
-#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8
-#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6
-#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4
-#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5
-#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6
-#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7
-#define GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT 0x8CD8
-#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9
-#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA
-#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB
-#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC
-#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD
-#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF
-#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0
-#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1
-#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2
-#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3
-#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4
-#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5
-#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6
-#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7
-#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8
-#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9
-#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA
-#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB
-#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC
-#define GL_COLOR_ATTACHMENT13_EXT 0x8CED
-#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE
-#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF
-#define GL_DEPTH_ATTACHMENT_EXT 0x8D00
-#define GL_STENCIL_ATTACHMENT_EXT 0x8D20
-#define GL_FRAMEBUFFER_EXT 0x8D40
-#define GL_RENDERBUFFER_EXT 0x8D41
-#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42
-#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43
-#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44
-#define GL_STENCIL_INDEX_EXT 0x8D45
-#define GL_STENCIL_INDEX1_EXT 0x8D46
-#define GL_STENCIL_INDEX4_EXT 0x8D47
-#define GL_STENCIL_INDEX8_EXT 0x8D48
-#define GL_STENCIL_INDEX16_EXT 0x8D49
-#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50
-#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51
-#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52
-#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53
-#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54
-#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55
-#endif
-
-// GL_EXT_framebuffer_blit
-#ifndef GL_READ_FRAMEBUFFER_EXT
-#define GL_READ_FRAMEBUFFER_EXT 0x8CA8
-#endif
-
-// GL_EXT_framebuffer_multisample
-#ifndef GL_RENDERBUFFER_SAMPLES_EXT
-#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB
-#endif
-
-#ifndef GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT
-#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56
-#endif
-
-#ifndef GL_MAX_SAMPLES_EXT
-#define GL_MAX_SAMPLES_EXT 0x8D57
-#endif
-
-#ifndef GL_DRAW_FRAMEBUFFER_EXT
-#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9
-#endif
-
-#ifndef GL_EXT_packed_depth_stencil
-#define GL_DEPTH_STENCIL_EXT 0x84F9
-#define GL_UNSIGNED_INT_24_8_EXT 0x84FA
-#define GL_DEPTH24_STENCIL8_EXT 0x88F0
-#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1
-#endif
-
-// ### hm. should be part of the GL 1.2 spec..
-#ifndef GL_CLAMP_TO_EDGE
-#define GL_CLAMP_TO_EDGE 0x812F
-#endif
-
-#ifndef GL_VERSION_1_2
-#define GL_PACK_SKIP_IMAGES 0x806B
-#define GL_PACK_IMAGE_HEIGHT 0x806C
-#define GL_UNPACK_SKIP_IMAGES 0x806D
-#define GL_UNPACK_IMAGE_HEIGHT 0x806E
-#endif
-
-#ifndef GL_VERSION_1_4
-#define GL_CONSTANT_COLOR 0x8001
-#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
-#define GL_CONSTANT_ALPHA 0x8003
-#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
-#define GL_INCR_WRAP 0x8507
-#define GL_DECR_WRAP 0x8508
-#endif
-
-#ifndef GL_VERSION_1_5
-#define GL_ARRAY_BUFFER 0x8892
-#define GL_ELEMENT_ARRAY_BUFFER 0x8893
-#define GL_STREAM_DRAW 0x88E0
-#define GL_STREAM_READ 0x88E1
-#define GL_STREAM_COPY 0x88E2
-#define GL_STATIC_DRAW 0x88E4
-#define GL_STATIC_READ 0x88E5
-#define GL_STATIC_COPY 0x88E6
-#define GL_DYNAMIC_DRAW 0x88E8
-#define GL_DYNAMIC_READ 0x88E9
-#define GL_DYNAMIC_COPY 0x88EA
-#endif
-
-#ifndef GL_VERSION_2_0
-#define GL_FRAGMENT_SHADER 0x8B30
-#define GL_VERTEX_SHADER 0x8B31
-#define GL_FLOAT_VEC2 0x8B50
-#define GL_FLOAT_VEC3 0x8B51
-#define GL_FLOAT_VEC4 0x8B52
-#define GL_INT_VEC2 0x8B53
-#define GL_INT_VEC3 0x8B54
-#define GL_INT_VEC4 0x8B55
-#define GL_BOOL 0x8B56
-#define GL_BOOL_VEC2 0x8B57
-#define GL_BOOL_VEC3 0x8B58
-#define GL_BOOL_VEC4 0x8B59
-#define GL_FLOAT_MAT2 0x8B5A
-#define GL_FLOAT_MAT3 0x8B5B
-#define GL_FLOAT_MAT4 0x8B5C
-#define GL_SAMPLER_1D 0x8B5D
-#define GL_SAMPLER_2D 0x8B5E
-#define GL_SAMPLER_3D 0x8B5F
-#define GL_SAMPLER_CUBE 0x8B60
-#define GL_COMPILE_STATUS 0x8B81
-#define GL_LINK_STATUS 0x8B82
-#define GL_INFO_LOG_LENGTH 0x8B84
-#define GL_ACTIVE_UNIFORMS 0x8B86
-#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
-#define GL_ACTIVE_ATTRIBUTES 0x8B89
-#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
-#endif
-
-// Geometry shader defines
-#ifndef GL_GEOMETRY_SHADER_EXT
-# define GL_GEOMETRY_SHADER_EXT 0x8DD9
-# define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA
-# define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB
-# define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC
-# define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29
-# define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD
-# define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE
-# define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B
-# define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF
-# define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0
-# define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1
-# define GL_LINES_ADJACENCY_EXT 0xA
-# define GL_LINE_STRIP_ADJACENCY_EXT 0xB
-# define GL_TRIANGLES_ADJACENCY_EXT 0xC
-# define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0xD
-# define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8
-# define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9
-# define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7
-# define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4
-# define GL_PROGRAM_POINT_SIZE_EXT 0x8642
-#endif
-
-#if !defined(QT_OPENGL_ES_2)
-#define glProgramStringARB QGLContextPrivate::extensionFuncs(ctx).qt_glProgramStringARB
-#define glBindProgramARB QGLContextPrivate::extensionFuncs(ctx).qt_glBindProgramARB
-#define glDeleteProgramsARB QGLContextPrivate::extensionFuncs(ctx).qt_glDeleteProgramsARB
-#define glGenProgramsARB QGLContextPrivate::extensionFuncs(ctx).qt_glGenProgramsARB
-#define glProgramLocalParameter4fvARB QGLContextPrivate::extensionFuncs(ctx).qt_glProgramLocalParameter4fvARB
-
-#define glActiveStencilFaceEXT QGLContextPrivate::extensionFuncs(ctx).qt_glActiveStencilFaceEXT
-
-#define glMultiTexCoord4f QGLContextPrivate::extensionFuncs(ctx).qt_glMultiTexCoord4f
-
-#define glActiveTexture QGLContextPrivate::extensionFuncs(ctx).qt_glActiveTexture
-#endif // !defined(QT_OPENGL_ES_2)
-
-
-// FBOs
-#if !defined(QT_OPENGL_ES_2)
-#define glIsRenderbuffer QGLContextPrivate::extensionFuncs(ctx).qt_glIsRenderbuffer
-#define glBindRenderbuffer QGLContextPrivate::extensionFuncs(ctx).qt_glBindRenderbuffer
-#define glDeleteRenderbuffers QGLContextPrivate::extensionFuncs(ctx).qt_glDeleteRenderbuffers
-#define glGenRenderbuffers QGLContextPrivate::extensionFuncs(ctx).qt_glGenRenderbuffers
-#define glRenderbufferStorage QGLContextPrivate::extensionFuncs(ctx).qt_glRenderbufferStorage
-#define glGetRenderbufferParameteriv QGLContextPrivate::extensionFuncs(ctx).qt_glGetRenderbufferParameteriv
-#define glIsFramebuffer QGLContextPrivate::extensionFuncs(ctx).qt_glIsFramebuffer
-#define glBindFramebuffer QGLContextPrivate::extensionFuncs(ctx).qt_glBindFramebuffer
-#define glDeleteFramebuffers QGLContextPrivate::extensionFuncs(ctx).qt_glDeleteFramebuffers
-#define glGenFramebuffers QGLContextPrivate::extensionFuncs(ctx).qt_glGenFramebuffers
-#define glCheckFramebufferStatus QGLContextPrivate::extensionFuncs(ctx).qt_glCheckFramebufferStatus
-#define glFramebufferTexture2D QGLContextPrivate::extensionFuncs(ctx).qt_glFramebufferTexture2D
-#define glFramebufferRenderbuffer QGLContextPrivate::extensionFuncs(ctx).qt_glFramebufferRenderbuffer
-#define glGetFramebufferAttachmentParameteriv QGLContextPrivate::extensionFuncs(ctx).qt_glGetFramebufferAttachmentParameteriv
-#define glGenerateMipmap QGLContextPrivate::extensionFuncs(ctx).qt_glGenerateMipmap
-#endif // QT_OPENGL_ES_2
-#define glBlitFramebufferEXT QGLContextPrivate::extensionFuncs(ctx).qt_glBlitFramebufferEXT
-#define glRenderbufferStorageMultisampleEXT QGLContextPrivate::extensionFuncs(ctx).qt_glRenderbufferStorageMultisampleEXT
-
-
-// Buffer objects
-#if defined(QGL_RESOLVE_BUFFER_FUNCS)
-#define glBindBuffer QGLContextPrivate::extensionFuncs(ctx).qt_glBindBuffer
-#define glDeleteBuffers QGLContextPrivate::extensionFuncs(ctx).qt_glDeleteBuffers
-#define glGenBuffers QGLContextPrivate::extensionFuncs(ctx).qt_glGenBuffers
-#define glBufferData QGLContextPrivate::extensionFuncs(ctx).qt_glBufferData
-#define glBufferSubData QGLContextPrivate::extensionFuncs(ctx).qt_glBufferSubData
-#define glGetBufferSubData QGLContextPrivate::extensionFuncs(ctx).qt_glGetBufferSubData
-#define glGetBufferParameteriv QGLContextPrivate::extensionFuncs(ctx).qt_glGetBufferParameteriv
-#endif
-#define glMapBufferARB QGLContextPrivate::extensionFuncs(ctx).qt_glMapBufferARB
-#define glUnmapBufferARB QGLContextPrivate::extensionFuncs(ctx).qt_glUnmapBufferARB
-
-
-// GLSL
-#if !defined(QT_OPENGL_ES_2)
-
-#define glCreateShader QGLContextPrivate::extensionFuncs(ctx).qt_glCreateShader
-#define glShaderSource QGLContextPrivate::extensionFuncs(ctx).qt_glShaderSource
-#define glShaderBinary QGLContextPrivate::extensionFuncs(ctx).qt_glShaderBinary
-#define glCompileShader QGLContextPrivate::extensionFuncs(ctx).qt_glCompileShader
-#define glDeleteShader QGLContextPrivate::extensionFuncs(ctx).qt_glDeleteShader
-#define glIsShader QGLContextPrivate::extensionFuncs(ctx).qt_glIsShader
-
-#define glCreateProgram QGLContextPrivate::extensionFuncs(ctx).qt_glCreateProgram
-#define glAttachShader QGLContextPrivate::extensionFuncs(ctx).qt_glAttachShader
-#define glDetachShader QGLContextPrivate::extensionFuncs(ctx).qt_glDetachShader
-#define glLinkProgram QGLContextPrivate::extensionFuncs(ctx).qt_glLinkProgram
-#define glUseProgram QGLContextPrivate::extensionFuncs(ctx).qt_glUseProgram
-#define glDeleteProgram QGLContextPrivate::extensionFuncs(ctx).qt_glDeleteProgram
-#define glIsProgram QGLContextPrivate::extensionFuncs(ctx).qt_glIsProgram
-
-#define glGetShaderInfoLog QGLContextPrivate::extensionFuncs(ctx).qt_glGetShaderInfoLog
-#define glGetShaderiv QGLContextPrivate::extensionFuncs(ctx).qt_glGetShaderiv
-#define glGetShaderSource QGLContextPrivate::extensionFuncs(ctx).qt_glGetShaderSource
-#define glGetProgramiv QGLContextPrivate::extensionFuncs(ctx).qt_glGetProgramiv
-#define glGetProgramInfoLog QGLContextPrivate::extensionFuncs(ctx).qt_glGetProgramInfoLog
-
-#define glGetUniformLocation QGLContextPrivate::extensionFuncs(ctx).qt_glGetUniformLocation
-#define glUniform4fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniform4fv
-#define glUniform3fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniform3fv
-#define glUniform2fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniform2fv
-#define glUniform1fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniform1fv
-#define glUniform1i QGLContextPrivate::extensionFuncs(ctx).qt_glUniform1i
-#define glUniform1iv QGLContextPrivate::extensionFuncs(ctx).qt_glUniform1iv
-#define glUniformMatrix2fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniformMatrix2fv
-#define glUniformMatrix3fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniformMatrix3fv
-#define glUniformMatrix4fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniformMatrix4fv
-#define glUniformMatrix2x3fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniformMatrix2x3fv
-#define glUniformMatrix2x4fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniformMatrix2x4fv
-#define glUniformMatrix3x2fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniformMatrix3x2fv
-#define glUniformMatrix3x4fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniformMatrix3x4fv
-#define glUniformMatrix4x2fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniformMatrix4x2fv
-#define glUniformMatrix4x3fv QGLContextPrivate::extensionFuncs(ctx).qt_glUniformMatrix4x3fv
-
-#define glBindAttribLocation QGLContextPrivate::extensionFuncs(ctx).qt_glBindAttribLocation
-#define glGetAttribLocation QGLContextPrivate::extensionFuncs(ctx).qt_glGetAttribLocation
-#define glVertexAttrib1fv QGLContextPrivate::extensionFuncs(ctx).qt_glVertexAttrib1fv
-#define glVertexAttrib2fv QGLContextPrivate::extensionFuncs(ctx).qt_glVertexAttrib2fv
-#define glVertexAttrib3fv QGLContextPrivate::extensionFuncs(ctx).qt_glVertexAttrib3fv
-#define glVertexAttrib4fv QGLContextPrivate::extensionFuncs(ctx).qt_glVertexAttrib4fv
-#define glVertexAttribPointer QGLContextPrivate::extensionFuncs(ctx).qt_glVertexAttribPointer
-#define glDisableVertexAttribArray QGLContextPrivate::extensionFuncs(ctx).qt_glDisableVertexAttribArray
-#define glEnableVertexAttribArray QGLContextPrivate::extensionFuncs(ctx).qt_glEnableVertexAttribArray
-
-#else // QT_OPENGL_ES_2
-
-#define glGetProgramBinaryOES QGLContextPrivate::extensionFuncs(ctx).qt_glGetProgramBinaryOES
-#define glProgramBinaryOES QGLContextPrivate::extensionFuncs(ctx).qt_glProgramBinaryOES
-
-#endif // QT_OPENGL_ES_2
-
-
-#if !defined(QT_OPENGL_ES_2)
-#define glStencilOpSeparate QGLContextPrivate::extensionFuncs(ctx).qt_glStencilOpSeparate
-#define glBlendColor QGLContextPrivate::extensionFuncs(ctx).qt_glBlendColor
-#endif
-
-#if defined(QT_OPENGL_ES_2)
-#define glClearDepth glClearDepthf
-#endif
-
-#define glProgramParameteriEXT QGLContextPrivate::extensionFuncs(ctx).qt_glProgramParameteriEXT
-#define glFramebufferTextureEXT QGLContextPrivate::extensionFuncs(ctx).qt_glFramebufferTextureEXT
-#define glFramebufferTextureLayerEXT QGLContextPrivate::extensionFuncs(ctx).qt_glFramebufferTextureLayerEXT
-#define glFramebufferTextureFaceEXT QGLContextPrivate::extensionFuncs(ctx).qt_glFramebufferTextureFaceEXT
-
-#if !defined(QT_OPENGL_ES)
-#define glCompressedTexImage2D QGLContextPrivate::extensionFuncs(ctx).qt_glCompressedTexImage2DARB
-#endif
-
-#ifndef QT_NO_EGL
-// OES_EGL_image
-#define glEGLImageTargetTexture2DOES QGLContextPrivate::extensionFuncs(ctx).qt_glEGLImageTargetTexture2DOES
-#define glEGLImageTargetRenderbufferStorageOES QGLContextPrivate::extensionFuncs(ctx).qt_glEGLImageTargetRenderbufferStorageOES
-#endif
-
-extern bool qt_resolve_framebufferobject_extensions(QGLContext *ctx);
-bool qt_resolve_buffer_extensions(QGLContext *ctx);
-
-bool qt_resolve_version_1_3_functions(QGLContext *ctx);
-bool qt_resolve_version_2_0_functions(QGLContext *ctx);
-bool qt_resolve_stencil_face_extension(QGLContext *ctx);
-bool qt_resolve_frag_program_extensions(QGLContext *ctx);
-
-bool qt_resolve_glsl_extensions(QGLContext *ctx);
-
-#ifndef QT_NO_EGL
-Q_OPENGL_EXPORT bool qt_resolve_eglimage_gl_extensions(QGLContext *ctx);
-#endif
-
-QT_END_NAMESPACE
-
-#endif // QGL_EXTENSIONS_P_H
diff --git a/src/quick3d/qdeclarativeeffect.cpp b/src/quick3d/qdeclarativeeffect.cpp
deleted file mode 100644
index 77992958..00000000
--- a/src/quick3d/qdeclarativeeffect.cpp
+++ /dev/null
@@ -1,479 +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 "qdeclarativeeffect.h"
-
-#include "qglpainter.h"
-#include "qglmaterial.h"
-
-#include <QNetworkRequest>
-#include <QNetworkReply>
-
-#include <QtDeclarative/qdeclarativeengine.h>
-
-#include <qdeclarativeinfo.h>
-#include "qglscenenode.h"
-
-/*!
- \qmlclass Effect QDeclarativeEffect
- \brief The Effect item defines simple effects within the QML/3D environment. Examples
- of such effects include textures, simple material and lighting effects, and so on.
- \since 4.8
- \ingroup qt3d::qml3d
-
- \section1 Defining an Effect
-
- Effects can be defined within QML using the normal syntax for creating any QML/3d object. To create a
- default effect with no extra information, for example, we can simply using the following:
-
- \code
- Effect {}
- \endcode
-
- More complex effects use the usual QML syntax for accessing and updating properties. In order to specify
- a texture, for example, the following could be used:
-
- \code
- Effect {
- id: myTextureEffect
- texture: "texture.png"
- }
- \endcode
-*/
-
-QT_BEGIN_NAMESPACE
-
-class QDeclarativeEffectPrivate
-{
-public:
- QDeclarativeEffectPrivate()
- : color(255, 255, 255, 255),
- useLighting(true),
- decal(false),
- blending(false),
- palette(0),
- materialIndex(-1),
- progress(0.0)
- {
- }
-
- ~QDeclarativeEffectPrivate()
- {
- delete palette;
- }
-
- QColor color;
- bool useLighting;
- bool decal;
- bool blending;
- QGLMaterialCollection *palette;
- int materialIndex;
- qreal progress;
- inline void ensureMaterial() {
- if (!palette)
- {
- palette = new QGLMaterialCollection();
- }
- if (materialIndex == -1)
- {
- materialIndex = palette->addMaterial(new QGLMaterial(palette));
- palette->material(materialIndex)->setColor(color);
- }
- // TODO: decal & blending
- }
-};
-
-/*!
- \internal
- Constructs the Effect object with \a parent as its parent.
-*/
-QDeclarativeEffect::QDeclarativeEffect(QObject *parent)
- : QObject(parent)
-{
- d = new QDeclarativeEffectPrivate;
-}
-
-/*!
- \internal
- Destroy the \l Effect object and delete any unneeded data.
-*/
-QDeclarativeEffect::~QDeclarativeEffect()
-{
- delete d;
-}
-
-/*!
- \qmlproperty color Effect::color
-
- The color of the object for simple non-texture effects.
- The default value for this property is white.
-*/
-
-QColor QDeclarativeEffect::color() const
-{
- return d->color;
-}
-
-void QDeclarativeEffect::setColor(const QColor& value)
-{
- d->color = value;
- d->ensureMaterial();
- material()->setColor(value);
- emit effectChanged();
-}
-
-/*!
- \qmlproperty bool Effect::useLighting
-
- The lighting control parameter; true if this effect should
- use lighting or false if this effect should use flat colors and
- textures.
-
- The default value for this property is true.
-*/
-bool QDeclarativeEffect::useLighting() const
-{
- return d->useLighting;
-}
-
-void QDeclarativeEffect::setUseLighting(bool value)
-{
- d->useLighting = value;
- emit effectChanged();
-}
-
-/*!
- \qmlproperty bool Effect::decal
-
- This property should be set to true if the \l texture should be
- combined with \l color to decal the texture onto the object.
- This property should be set to false to use the texture
- directly, combined with the \l material parameters.
-
- The default value for this property is false.
-*/
-bool QDeclarativeEffect::decal() const
-{
- return d->decal;
-}
-
-void QDeclarativeEffect::setDecal(bool value)
-{
- if (d->decal != value) {
- d->decal = value;
- emit effectChanged();
- }
-}
-
-/*!
- \qmlproperty bool Effect::blending
-
- This property should be set to true if alpha blending should be
- enabled when this effect is active, or false otherwise. The
- default is false.
-
- This property overrides the viewport-specific blending setting
- that is specified by Viewport::blending.
-*/
-bool QDeclarativeEffect::blending() const
-{
- return d->blending;
-}
-
-void QDeclarativeEffect::setBlending(bool value)
-{
- if (d->blending != value) {
- d->blending = value;
- emit effectChanged();
- }
-}
-
-/*!
- \qmlproperty url Effect::texture
-
- Texture effects are defined by this property. A texture is
- provided by means of a QUrl which is then used for texturing.
-
- Textures can also be defined directly as images using the textureImage
- property.
-
- If the value is non-empty, and the texture could not be loaded from
- the QUrl for any reason, then the property will not be changed.
-
- \sa textureImage
-*/
-QUrl QDeclarativeEffect::texture() const
-{
- if (!material())
- return QUrl();
- return material()->textureUrl();
-}
-
-void QDeclarativeEffect::setTexture(const QUrl& value)
-{
- if (material() && material()->textureUrl() == value)
- return;
-
- if (d->progress != 0.0)
- {
- d->progress = 0.0;
- emit progressChanged(d->progress);
- }
-
- if (value.isEmpty())
- {
- if (material())
- {
- material()->setTextureUrl(value);
- emit effectChanged();
- }
- }
- else
- {
- d->ensureMaterial();
- // Warning: This will trigger the deletion of the old texure.
- material()->setTextureUrl(value);
- emit effectChanged();
- }
-}
-
-/*!
- \qmlproperty image Effect::textureImage
-
- This property directly defines a texture using an existing QImage.
-
- Textures can also be defined based on a URL using the texture property.
-
- \sa texture
-*/
-QImage QDeclarativeEffect::textureImage() const
-{
- return (material() && material()->texture()) ?
- material()->texture()->image() : QImage();
-}
-
-/*!
- \internal
- Sets this effect to use \value as the image for it's texture.
-
- OpenGL defaults have been overridden to clamp the texture both horizontally and vertically as per QGL::Clamp.
-*/
-void QDeclarativeEffect::setTextureImage(const QImage& value)
-{
- QGLTexture2D * tex;
- d->ensureMaterial();
- if (!material()->texture())
- {
- // Should this texture be parented?
- tex = new QGLTexture2D();
- material()->setTexture(tex);
- } else
- {
- tex = material()->texture();
- }
-
- // Equality test of images can be very expensive, so always assign the
- // value and emit effect changed
- tex->setImage(value);
-
- // prevents artifacts due to texture smoothing wrapping around edges of texture
- tex->setHorizontalWrap(QGL::Clamp);
- tex->setVerticalWrap(QGL::Clamp);
-
- emit effectChanged();
-}
-
-/*!
- \qmlproperty Material Effect::material
-
- Defines the material to apply to items that use this effect.
-*/
-QGLMaterial *QDeclarativeEffect::material() const
-{
- if (!d->palette)
- return 0;
- return d->palette->material(d->materialIndex);
-}
-
-/*!
- \internal
- Sets the material for use with this effect. Creates a QGLMaterialCollection
- to contain it if necessary.
-*/
-void QDeclarativeEffect::setMaterial(QGLMaterial *value)
-{
- d->ensureMaterial();
- if (d->materialIndex != -1)
- d->palette->material(d->materialIndex)->disconnect(this);
- int newIndex = -1;
- if (value)
- newIndex = d->palette->addMaterial(value);
- if (newIndex != d->materialIndex)
- {
- d->materialIndex = newIndex;
- emit effectChanged();
- // TODO: deleting old materials
- if (value)
- connect(value, SIGNAL(materialChanged()), this, SIGNAL(effectChanged()));
- }
-}
-
-/*!
- \qmlproperty real Effect::progress
-
- Tracks how much of a remote resource has been downloaded, where 0.0
- is no progress, and 1.0 is completion.
-*/
-
-/*!
- \internal
- Enable the effect on for a given \a painter.
-*/
-void QDeclarativeEffect::enableEffect(QGLPainter *painter)
-{
- painter->setColor(d->color);
- if (d->materialIndex != -1 && d->palette->material(d->materialIndex))
- {
- painter->setFaceMaterial(QGL::FrontFaces, material()->front());
- painter->setFaceMaterial(QGL::BackFaces, material()->back());
- } else
- painter->setFaceColor(QGL::AllFaces, d->color);
-
- QGLTexture2D *tex = 0;
- if (material())
- tex = material()->texture();
- if (d->useLighting) {
- if (tex && !tex->isNull()) {
- if (d->decal)
- painter->setStandardEffect(QGL::LitDecalTexture2D);
- else
- painter->setStandardEffect(QGL::LitModulateTexture2D);
- tex->bind();
- } else {
- painter->setStandardEffect(QGL::LitMaterial);
- }
- } else {
- if (tex && !tex->isNull()) {
- if (d->decal)
- painter->setStandardEffect(QGL::FlatDecalTexture2D);
- else
- painter->setStandardEffect(QGL::FlatReplaceTexture2D);
-// painter->glActiveTexture(GL_TEXTURE0);
- tex->bind();
- } else {
- painter->setStandardEffect(QGL::FlatColor);
- }
- }
-}
-
-/*!
- \internal
- Disable the effect for a given \a painter.
-*/
-void QDeclarativeEffect::disableEffect(QGLPainter *painter)
-{
- painter->setStandardEffect(QGL::FlatColor);
- painter->setColor(Qt::white);
- painter->glActiveTexture(GL_TEXTURE0);
- glBindTexture(GL_TEXTURE_2D, 0);
-}
-
-/*!
- \internal
- Set a scenenode's material and effect properties to enact this effect.
-
- The desired functionality should mirror the Mesh::draw(QGLPainter*)
- functionality as closely as possible.
-
- Subclasses can reimplement this function to set desired effects (e.g. user
- effects);
-*/
-void QDeclarativeEffect::applyTo(QGLSceneNode *node)
-{
- d->ensureMaterial();
-
- node->setPalette(d->palette);
- node->setMaterialIndex(d->materialIndex);
-
- Q_ASSERT(node->material());
-
- QGLTexture2D *tex = material()->texture();
- if (tex && !tex->isNull())
- node->material()->setTexture(tex);
-
- // Determine which standard effect to use
- if (d->useLighting) {
- if (tex && !tex->isNull()) {
- if (d->decal)
- node->setEffect(QGL::LitDecalTexture2D);
- else
- node->setEffect(QGL::LitModulateTexture2D);
- } else {
- node->setEffect(QGL::LitMaterial);
- }
- } else {
- if (tex && !tex->isNull()) {
- if (d->decal)
- node->setEffect(QGL::FlatDecalTexture2D);
- else
- node->setEffect(QGL::FlatReplaceTexture2D);
- } else {
- node->setEffect(QGL::FlatColor);
- }
- }
-}
-
-QGLTexture2D *QDeclarativeEffect::texture2D()
-{
- if (!material())
- return 0;
- return material()->texture();
-}
-
-/*!
- Returns the progress of remote resource loading.
- */
-qreal QDeclarativeEffect::progress()
-{
- return d->progress;
-}
-
-QT_END_NAMESPACE
diff --git a/src/quick3d/qdeclarativeeffect.h b/src/quick3d/qdeclarativeeffect.h
deleted file mode 100644
index d187952c..00000000
--- a/src/quick3d/qdeclarativeeffect.h
+++ /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$
-**
-****************************************************************************/
-
-#ifndef QDECLARATIVEEFFECT_P_H
-#define QDECLARATIVEEFFECT_P_H
-
-#include "qt3dquickglobal.h"
-
-#include <QtCore/qobject.h>
-#include <QtCore/qurl.h>
-#include <QtGui/qcolor.h>
-#include <QtGui/qimage.h>
-#include <QtDeclarative/qdeclarative.h>
-
-#include "qgltexture2d.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(QtQuick3D)
-
-class QDeclarativeEffectPrivate;
-class QGLPainter;
-class QGLMaterial;
-class QGLSceneNode;
-
-class Q_QT3D_QUICK_EXPORT QDeclarativeEffect : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY effectChanged)
- Q_PROPERTY(bool useLighting READ useLighting WRITE setUseLighting NOTIFY effectChanged)
- Q_PROPERTY(bool decal READ decal WRITE setDecal NOTIFY effectChanged)
- Q_PROPERTY(bool blending READ blending WRITE setBlending NOTIFY effectChanged)
- Q_PROPERTY(QUrl texture READ texture WRITE setTexture NOTIFY effectChanged)
- Q_PROPERTY(QImage textureImage READ textureImage WRITE setTextureImage NOTIFY effectChanged)
- Q_PROPERTY(QGLMaterial *material READ material WRITE setMaterial NOTIFY effectChanged)
- Q_PROPERTY(qreal progress READ progress NOTIFY progressChanged)
-public:
- QDeclarativeEffect(QObject *parent = 0);
- ~QDeclarativeEffect();
-
- virtual QColor color() const;
- virtual void setColor(const QColor& value);
-
- virtual bool useLighting() const;
- virtual void setUseLighting(bool value);
-
- virtual bool decal() const;
- virtual void setDecal(bool value);
-
- virtual bool blending() const;
- virtual void setBlending(bool value);
-
- virtual QUrl texture() const;
- virtual void setTexture(const QUrl& value);
-
- virtual QImage textureImage() const;
- virtual void setTextureImage(const QImage& value);
-
- virtual QGLMaterial *material() const;
- virtual void setMaterial(QGLMaterial *value);
-
- virtual void enableEffect(QGLPainter *painter);
- virtual void disableEffect(QGLPainter *painter);
- virtual void applyTo(QGLSceneNode *node);
-
- virtual qreal progress();
-
-Q_SIGNALS:
- void effectChanged();
- void progressChanged(qreal progress);
-
-protected:
- QGLTexture2D *texture2D();
-
-private:
- QDeclarativeEffectPrivate *d;
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(QDeclarativeEffect)
-
-QT_END_HEADER
-
-#endif
diff --git a/src/quick3d/qdeclarativeitem3d.cpp b/src/quick3d/qdeclarativeitem3d.cpp
deleted file mode 100644
index 3e1af640..00000000
--- a/src/quick3d/qdeclarativeitem3d.cpp
+++ /dev/null
@@ -1,1674 +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 "qdeclarativeitem3d.h"
-#include "qdeclarativeviewport.h"
-#include "qdeclarativemesh.h"
-#include "qdeclarativeeffect.h"
-
-#include "qgllightparameters.h"
-#include "qglabstractscene.h"
-#include "qglscenenode.h"
-#include "qglview.h"
-#include "qgraphicstransform3d.h"
-
-#include <QtGui/qevent.h>
-#include <QtDeclarative/qdeclarativecontext.h>
-
-/*!
- \qmlclass Item3D QDeclarativeItem3D
- \brief The Item3D item encapsulates 3D objects and contains all of the properties and methods needed for simple 3D operations.
- part of a QML/3d script.
- \since 4.8
- \ingroup qt3d::qml3d
-
- \section1 Simple 3D Object Definition
-
- The most basic use case for the Item3D class is the creation and display of a
- single simple item in the 3D environment.
-
- Many such items within a 3D environment are defined as a single logical component
- mesh which is treated as a stand-alone object for the purposes of rotation,
- scaling, and user interaction via "picking".
-
- Such an object can easily be defined in QML using the following code:
-
- \code
- Item3D {
- id: teapot
- mesh: Mesh { source: "teapot.bez" }
- effect: Effect {}
- cullFaces: "CullBackFaces"
- }
- \endcode
-
- This simple code will create a 3D item based on the \i teapot.bez mesh using
- back-face culling.
-
- Notice that in this case the effect and mesh are defined within the body of
- the item definition. Where there is little complexity, this method of
- defining items simplifies the resultant code and makes modification of
- the QML easier.
-
- \section1 Embedding Item3D Objects
-
- Consider the following:
-
- \code
- Item3D {
- id: cup
- mesh: Mesh { source: "teacup.bez" }
- effect: Effect {}
- cullFaces: "CullBackFaces"
-
- Item3D {
- id: saucer
- mesh: Mesh { source: "saucer.bez" }
- cullFaces: "CullBackFaces"
- }
-
- position: Qt.vector3d(10, -10, -10)
- }
- \endcode
-
- This demonstrates the capability of embedding one Item3D within another. In
- this case the \i saucer item is a child of the \i cup item.
-
- All transformations applied to the parent item are also applied to the child,
- so in this case both the cup and saucer will be translated based on the
- position vector defined in the cup item's definition.
-
- In this case any additional transformations applied to the child item will not
- affect the parent, and are local only to that item (and to its children if any
- exist).
-
- This allows a user to group together items logically so that transformations and
- user interactions can be applied to groups of objects as if they were a whole.
-
- \section1 Using Sub-nodes of 3D Objects
-
- In more complex applications the user may wish to load a complex mesh
- which is made up of a number of components or nodes which may be organised
- into a tree like structure. In this case they may wish to interact with,
- animate, or otherwise modify individual sub-nodes of a mesh.
-
- Item3D leverages the existing \bold {Qt Object Model} in order to allow QML/3d users
- this type of control over their 3D items.
-
- Consider the following QML script:
-
- \code
- Item3D {
- id: helicoptor
- mesh: helicoptorMesh
- effect: Effect {}
- cullFaces: "CullBackFaces"
-
- transform: [
- Rotation3D {
- id: rotate1
- angle: 5
- axis: Qt.vector3d(1, 0, 0)
- },
- Rotation3D {
- id: rotate2
- angle: 5
- axis: Qt.vector3d(0, 1, 0)
- },
- Rotation3D {
- id: rotate3
- angle: 45
- axis: Qt.vector3d(0, 0, 1)
- }
- ]
-
- Item3D {
- id: rotor
- property bool spin: false
- meshNode: "rotorBladesNode"
- Item3D {meshNode: "rotorHubNode"}
-
- transform: [
- Rotation3D {
- id: rotateBlades
- angle: 0
- axis: Qt.vector3d(0, 0, 1)
- }
- ]
-
- onClicked: { rotor.spin=true }
-
- SequentialAnimation {
- running: rotor.spin
- NumberAnimation {
- target: rotateBlades
- property: "angle"
- to: 360.0
- duration: 750
- easing.type:"OutQuad"
- }
- onCompleted: rotor.spin = false
- }
- }
- }
-
- Mesh {
- id: helicoptorMesh
- source: "bellUH1.3ds"
- }
- \endcode
-
- Obviously this example is much more complex both in structure and behaviour. In
- this case the mesh describes a \i .3ds file of a helicoptor, which is broken down
- discrete sub-components (engine nacelles, rotor, rotor hub, etc), which the user
- may wish to modify or animate individually.
-
- Each child item in this case does not have a mesh explicitly defined, but rather
- inherits the mesh from the parent. However each child item does define a mesh node
- which is part of the parent mesh.
-
- All transformations carried out on the parent item will also be applied to the child.
-
- Child items can, as shown here, have their own \i local transformations and user
- interactions applied. These will be applied only to the node of the mesh which
- is defined for that item. In cases where the mesh is defined heirarchically as a
- tree of nodes, this transformation will therefore be applied to all items in that
- tree which are children of the defined node.
-
- Likewise if the user explicitly declares a child item, such as has been done here with
- the \i rotorHubNode, then the transformations will apply to this item as well (and
- its children, and so on).
-
- It should be noted that no support is currently provided for skeleton animation or
- kinematic control of items. This is left to the user to implement as required.
-
- \section1 Using QML Data Models With Item3D
-
- QDeclarativeItem3D supports standard \l
- {http://doc.qt.nokia.com/4.7/qdeclarativemodels.html#qml-data-models}
- {QML Data Models} with a few caveats.
-
- QDeclarativeItem3D derives from QtDeclarativeItem, and interacts with
- the \l{http://doc.qt.nokia.com/4.7/qml-component.html}{Component} element
- normally. However, there is a delay between between removing an item from
- a model and the cleaning up the corresponding Item3D, so it is recommended
- that Item3D based delegates hide themselves when their index is
- -1 as shown in the photoroom example:
-
- \snippet quick3d/photoroom/qml/photoroom.qml 1
-
- However Item3D does not use the width or height properties, so most
- positioners and views will not work. Use a
- \l{http://doc.qt.nokia.com/4.7/qml-repeater.html}{Repeater} element to
- generate Item3Ds from model data. For example:
-
- \snippet quick3d/photoroom/qml/photoroom.qml 2
-
- Models can be used normally, so
-\l{http://doc.qt.nokia.com/4.7/qdeclarativemodels.html#listmodel}{ListModel},
-\l{http://doc.qt.nokia.com/4.7/qdeclarativemodels.html#qstringlist}{QStringList}
- etc. work just like they would with two dimensional Items. For example:
-
- \snippet quick3d/photoroom/qml/photoroom.qml 0
-
- \sa{http://doc.qt.nokia.com/4.7/qdeclarativemodels.html#qml-data-models}{QML Data Models}
-*/
-
-
-
-QT_BEGIN_NAMESPACE
-
-class QDeclarativeItem3DPrivate
-{
-public:
- QDeclarativeItem3DPrivate(QDeclarativeItem3D *_item)
- : item(_item)
- , viewport(0)
- , position(0.0f, 0.0f, 0.0f)
- , pivot(0.0f,0.0f,0.0f)
- , usePivot(false)
- , scale(1.0f)
- , mesh(0)
- , effect(0)
- , requireBlockingEffectsCheck(false)
- , light(0)
- , objectPickId(-1)
- , cullFaces(QDeclarativeItem3D::CullDisabled)
- , sortChildren(QDeclarativeItem3D::DefaultSorting)
- , inheritEvents(false)
- , isEnabled(true)
- , isInitialized(false)
- , mainBranchId(0)
- , componentComplete(false)
- {
- }
- ~QDeclarativeItem3DPrivate();
-
- QDeclarativeItem3D *item;
- QDeclarativeViewport *viewport;
- QVector3D position;
- QVector3D pivot;
- bool usePivot;
- qreal scale;
- QDeclarativeMesh *mesh;
- QDeclarativeEffect *effect;
- bool requireBlockingEffectsCheck;
- QGLLightParameters *light;
- int objectPickId;
- QDeclarativeItem3D::CullFaces cullFaces;
- QDeclarativeItem3D::SortMode sortChildren;
-
- bool inheritEvents;
- bool isEnabled;
- bool isInitialized;
- int mainBranchId;
- QString meshNode;
-
- // data property
- static void data_append(QDeclarativeListProperty<QObject> *, QObject *);
-
- // resources property
- static QObject *resources_at(QDeclarativeListProperty<QObject> *, int);
- static void resources_append(QDeclarativeListProperty<QObject> *, QObject *);
- static int resources_count(QDeclarativeListProperty<QObject> *);
-
- // transform property
- static int transform_count(QDeclarativeListProperty<QGraphicsTransform3D> *list);
- static void transform_append(QDeclarativeListProperty<QGraphicsTransform3D> *list, QGraphicsTransform3D *);
- static QGraphicsTransform3D *transform_at(QDeclarativeListProperty<QGraphicsTransform3D> *list, int);
- static void transform_clear(QDeclarativeListProperty<QGraphicsTransform3D> *list);
- QList<QGraphicsTransform3D *> transforms;
-
-
- // pretransform property
- static int pretransform_count(QDeclarativeListProperty<QGraphicsTransform3D> *list);
- static void pretransform_append(QDeclarativeListProperty<QGraphicsTransform3D> *list, QGraphicsTransform3D *);
- static QGraphicsTransform3D *pretransform_at(QDeclarativeListProperty<QGraphicsTransform3D> *list, int);
- static void pretransform_clear(QDeclarativeListProperty<QGraphicsTransform3D> *list);
- QList<QGraphicsTransform3D *> pretransforms;
-
- // transform convenience functions
- QMatrix4x4 localTransforms() const;
- QMatrix4x4 localToWorldMatrix() const;
- QMatrix4x4 worldToLocalMatrix() const;
- bool componentComplete;
-};
-
-QDeclarativeItem3DPrivate::~QDeclarativeItem3DPrivate()
-{
-}
-
-int QDeclarativeItem3DPrivate::transform_count(QDeclarativeListProperty<QGraphicsTransform3D> *list)
-{
- QDeclarativeItem3D *object = qobject_cast<QDeclarativeItem3D *>(list->object);
- if (object) {
- return object->d->transforms.count();
- } else {
- qWarning()<<"Warning: could not find Item3D to query for transformation count.";
- return 0;
- }
-}
-
-void QDeclarativeItem3DPrivate::transform_append(QDeclarativeListProperty<QGraphicsTransform3D> *list, QGraphicsTransform3D *item)
-{
- QDeclarativeItem3D *object = qobject_cast<QDeclarativeItem3D *>(list->object);
- QList<QGraphicsTransform3D *> *ptrans;
- if (object)
- {
- ptrans = &object->d->transforms;
-
- //We now need to connect the underlying transform so that any change will update the graphical item.
- if (!ptrans->contains(item)) {
- ptrans->append(item);
- QObject::connect(item, SIGNAL(transformChanged()),
- object, SLOT(update()));
- }
- }
- else
- qWarning()<<"Warning: could not find Item3D to add transformation to.";
-}
-
-QGraphicsTransform3D *QDeclarativeItem3DPrivate::transform_at(QDeclarativeListProperty<QGraphicsTransform3D> *list, int idx)
-{
- QDeclarativeItem3D *object = qobject_cast<QDeclarativeItem3D *>(list->object);
- if (object) {
- return object->d->transforms.at(idx);
- } else {
- qWarning()<<"Warning: could not find Item3D to query for transformations";
- return 0;
- }
- return 0;
-}
-
-void QDeclarativeItem3DPrivate::transform_clear(QDeclarativeListProperty<QGraphicsTransform3D> *list)
-{
-
- QDeclarativeItem3D *object = qobject_cast<QDeclarativeItem3D *>(list->object);
- if (object) {
- object->d->transforms.clear();
- object->update();
- }
- else
- qWarning()<<"Warning: could not find Item3D to clear of transformations";
-}
-
-int QDeclarativeItem3DPrivate::pretransform_count(QDeclarativeListProperty<QGraphicsTransform3D> *list)
-{
- QDeclarativeItem3D *object = qobject_cast<QDeclarativeItem3D *>(list->object);
- if (object) {
- return object->d->pretransforms.count();
- } else {
- qWarning()<<"Warning: could not find Item3D to query for transformation count.";
- return 0;
- }
-}
-
-void QDeclarativeItem3DPrivate::pretransform_append(QDeclarativeListProperty<QGraphicsTransform3D> *list, QGraphicsTransform3D *item)
-{
- QDeclarativeItem3D *object = qobject_cast<QDeclarativeItem3D *>(list->object);
- QList<QGraphicsTransform3D *> *ptrans;
- if (object)
- {
- ptrans = &object->d->pretransforms;
-
- //We now need to connect the underlying transform so that any change will update the graphical item.
- if (!ptrans->contains(item)) {
- ptrans->append(item);
- QObject::connect(item, SIGNAL(transformChanged()),
- object, SLOT(update()));
- }
- }
- else
- qWarning()<<"Warning: could not find Item3D to add transformation to.";
-}
-
-QGraphicsTransform3D *QDeclarativeItem3DPrivate::pretransform_at(QDeclarativeListProperty<QGraphicsTransform3D> *list, int idx)
-{
- QDeclarativeItem3D *object = qobject_cast<QDeclarativeItem3D *>(list->object);
- if (object) {
- return object->d->pretransforms.at(idx);
- } else {
- qWarning()<<"Warning: could not find Item3D to query for transformations";
- return 0;
- }
- return 0;
-}
-
-void QDeclarativeItem3DPrivate::pretransform_clear(QDeclarativeListProperty<QGraphicsTransform3D> *list)
-{
-
- QDeclarativeItem3D *object = qobject_cast<QDeclarativeItem3D *>(list->object);
- if (object) {
- object->d->pretransforms.clear();
- object->update();
- }
- else
- qWarning()<<"Warning: could not find Item3D to clear of transformations";
-}
-
-
-
-void QDeclarativeItem3DPrivate::data_append(QDeclarativeListProperty<QObject> *prop, QObject *o)
-{
- // This function is called by the QML runtime to assign children to
- // an item3d. The object 'o' is the new child, and prop->object is the
- // Item3d that is to be the parent.
-
- // Either way we're going to call something like setParent(prop->object)
- // we're just determining whether to use the QDeclarativeItem or QObject
- // version.
-
- // The primary purpose of this function is to divide new children into
- // renderable qml Items and non-renderable QObject derived resources.
- // We want to accept all Items, and and simply ignore non-3d items
- // during drawing.
-
- // It is important that we imitate this behaviour of non-3d
- // QDeclarativeItems so view items will assign dynamically created objects
- // to the Item3d and make them available for drawing.
-
- QDeclarativeItem *i = qobject_cast<QDeclarativeItem *>(o);
- if (i)
- i->setParentItem(static_cast<QDeclarativeItem3D *>(prop->object));
- else
- o->setParent(static_cast<QDeclarativeItem3D *>(prop->object));
-}
-
-
-QObject *QDeclarativeItem3DPrivate::resources_at(QDeclarativeListProperty<QObject> *prop, int index)
-{
- QObjectList children = prop->object->children();
- if (index < children.count())
- return children.at(index);
- else
- return 0;
-}
-
-void QDeclarativeItem3DPrivate::resources_append(QDeclarativeListProperty<QObject> *prop, QObject *o)
-{
- o->setParent(prop->object);
-}
-
-int QDeclarativeItem3DPrivate::resources_count(QDeclarativeListProperty<QObject> *prop)
-{
- return prop->object->children().count();
-}
-
-/*!
- \internal
- Applies position, scale and rotation transforms for this item3d to matrix
- \a m
-*/
-QMatrix4x4 QDeclarativeItem3DPrivate::localTransforms() const
-{
- QMatrix4x4 m;
- m.translate(position);
- int transformCount = transforms.count();
- if (transformCount>0) {
- // The transformations are applied in reverse order of their
- // lexical appearance in the QML file.
- for (int index = transformCount - 1; index >= 0; --index) {
- transforms.at(index)->applyTo(&m);
- }
- }
- if (scale != 1.0f)
- m.scale(scale);
- return m;
-}
-
-
-/*!
- \internal
-*/
-QDeclarativeItem3D::QDeclarativeItem3D(QObject *parent)
- : QDeclarativeItem(0)
-{
- d = new QDeclarativeItem3DPrivate(this);
-
- QDeclarativeItem *itemParent = qobject_cast<QDeclarativeItem *>(parent);
- if (itemParent) {
- setParentItem(itemParent);
- } else {
- setParent(parent);
- }
-
- // TODO: Handle QDeclarativeItem3D case
-}
-
-/*!
- \internal
-*/
-QDeclarativeItem3D::~QDeclarativeItem3D()
-{
- delete d;
-}
-
-
-
-/*!
- \qmlproperty vector3D Item3D::position
-
- The position in 3D space of this item. The default value for this
- property is (0, 0, 0).
-
- \sa x, y, z
-*/
-
-QVector3D QDeclarativeItem3D::position() const
-{
- return d->position;
-}
-
-void QDeclarativeItem3D::setPosition(const QVector3D& value)
-{
- d->position = value;
- emit positionChanged();
- update();
-}
-
-/*!
- \qmlproperty real Item3D::x
-
- The x position of this item in 3D space. The default value for this
- property is 0.
-
- \sa position, y, z
-*/
-
-qreal QDeclarativeItem3D::x() const
-{
- return d->position.x();
-}
-
-void QDeclarativeItem3D::setX(qreal value)
-{
- d->position.setX(value);
- emit positionChanged();
- update();
-}
-
-/*!
- \qmlproperty real Item3D::y
-
- The y position of this item in 3D space. The default value for this
- property is 0.
-
- \sa position, x, z
-*/
-
-qreal QDeclarativeItem3D::y() const
-{
- return d->position.y();
-}
-
-void QDeclarativeItem3D::setY(qreal value)
-{
- d->position.setY(value);
- emit positionChanged();
- update();
-}
-
-/*!
- \qmlproperty real Item3D::z
-
- The z position of this item in 3D space. The default value for
- this property is 0.
-
- \sa position, x, y
-*/
-
-qreal QDeclarativeItem3D::z() const
-{
- return d->position.z();
-}
-
-void QDeclarativeItem3D::setZ(qreal value)
-{
- d->position.setZ(value);
- emit positionChanged();
- update();
-}
-
-/*!
- \qmlproperty real Item3D::scale
-
- The scaling factor to apply to the item after the transformations
- from the Item3D::transform property. The default value for this
- property is 1.
-
- \sa transform
-*/
-
-qreal QDeclarativeItem3D::scale() const
-{
- return d->scale;
-}
-
-void QDeclarativeItem3D::setScale(qreal value)
-{
- d->scale = value;
- emit scaleChanged();
- update();
-}
-
-/*!
- \qmlproperty list<Transform> Item3D::transform
-
- Generally objects in 3D space will have undergone some number
- of 3D transformation prior to display. Examples of such transformations
- include rotations about the x, y, and z axes, translation, and so on.
-
- Each Item3D maintains a list of transforms to apply to it through this
- property. In scripting terms a transform can be applied as follows:
-
- \code
- Item3D {
- id: teapot
- mesh: Mesh { source: "teapot.bez" }
- transform: [
- Rotation3D {
- id: teapot_rotate1
- angle: 0
- axis: Qt.vector3d(0, 1, 0)
- },
- Rotation3D {
- id: teapot_rotate2
- angle: 0
- axis: Qt.vector3d(0, 0, 1)
- }
- ]
- }
- \endcode
-
- In this example we have two transformations in our list - a rotation around
- the y axis (\c {teapot_rotate1}), and a rotation about the z axis (\c {teapot_rotate2}).
-
- These transformations can be accessed via standard QML scripting methods to achieve
- animations and other effects.
-
- By default this list of transformations is empty.
-
- \sa Rotation3D, Scale3D, Translation3D, scale, position, pretransform
-*/
-
-
-QDeclarativeListProperty<QGraphicsTransform3D> QDeclarativeItem3D::transform()
-{
- return QDeclarativeListProperty<QGraphicsTransform3D>(this, 0, d->transform_append, d->transform_count,
- d->transform_at, d->transform_clear);
-}
-
-/*!
- \qmlproperty list<Transform> Item3D::pretransform
-
- The transformations to apply before all others.
-
- When a model is loaded from an external source such as a 3D
- modeling package, it is usually in an unconventional orientation
- and position. The first step is to rotate, scale, and translate
- it to make it suitable for use as a QML object.
-
- The purpose of the \c pretransform property is to perform such
- "model correction" transformations before \c scale, \c transform,
- and \c position are applied to place the model in its final
- orientation and position in the QML application.
-
- By default this list of transformations is empty.
-
- \sa transform, scale, position
-*/
-
-QDeclarativeListProperty<QGraphicsTransform3D> QDeclarativeItem3D::pretransform()
-{
- return QDeclarativeListProperty<QGraphicsTransform3D>(this, 0, d->pretransform_append, d->pretransform_count,
- d->pretransform_at, d->pretransform_clear);
-}
-
-/*!
- \qmlproperty bool Item3D::inheritEvents
-
- Users are able to interact with 3d items in a scene through (for example) the
- use of the mouse. These, and other, Qt events can be captured by an \l Item3D using the
- same underlying QObject architecture shared by all of Qt.
-
- Often a user will only want an item to capture mouse events for itself, leaving
- child items to handle their mouse events locally. Under many circumstances, however, it
- is necessary for a parent object to collect all mouse events for itself and its child
- items. Usually this inheritance of events is only defined at initialisation for an \l Item3D
-
- The inheritEvents property, however, is a simple boolean property which provides a mechanism
- for both initialisation time and programmatic modification of this.
-
- Setting the property to true connects the signals for all child items to the appropriate
- signals for the item itself. Conversely setting the property to false disconnects the
- events.
-
- The default value for this property is false.
-*/
-bool QDeclarativeItem3D::inheritEvents() const
-{
- return d->inheritEvents;
-}
-
-void QDeclarativeItem3D::setInheritEvents(bool inherit)
-{
- d->inheritEvents = inherit;
-
- //Generally we would only want to
- if (inherit)
- {
- for (int index = 0; index < children().size(); ++index) {
- QDeclarativeItem3D *subItem = qobject_cast<QDeclarativeItem3D *>(children().at(index));
- if (subItem)
- {
- // Proxy the mouse event signals to the parent so that
- // the parent can trap the signal for a group of children.
- QObject::connect(subItem, SIGNAL(clicked()), this, SIGNAL(clicked()));
- QObject::connect(subItem, SIGNAL(doubleClicked()), this, SIGNAL(doubleClicked()));
- QObject::connect(subItem, SIGNAL(pressed()), this, SIGNAL(pressed()));
- QObject::connect(subItem, SIGNAL(released()), this, SIGNAL(released()));
- QObject::connect(subItem, SIGNAL(hoverEnter()), this, SIGNAL(hoverEnter()));
- QObject::connect(subItem, SIGNAL(hoverLeave()), this, SIGNAL(hoverLeave()));
- }
- }
- }
- else
- {
- for (int index = 0; index < children().size(); ++index) {
- QDeclarativeItem *subItem = qobject_cast<QDeclarativeItem *>(children().at(index));
- if (subItem)
- {
- // Proxy the mouse event signals to the parent so that
- // the parent can trap the signal for a group of children.
- QObject::disconnect(subItem, SIGNAL(clicked()), this, SIGNAL(clicked()));
- QObject::disconnect(subItem, SIGNAL(doubleClicked()), this, SIGNAL(doubleClicked()));
- QObject::disconnect(subItem, SIGNAL(pressed()), this, SIGNAL(pressed()));
- QObject::disconnect(subItem, SIGNAL(released()), this, SIGNAL(released()));
- QObject::disconnect(subItem, SIGNAL(hoverEnter()), this, SIGNAL(hoverEnter()));
- QObject::disconnect(subItem, SIGNAL(hoverLeave()), this, SIGNAL(hoverLeave()));
- }
- }
- }
-}
-
-/*!
- \qmlproperty Mesh Item3D::mesh
-
- Objects in most 3D environments are almost invariably defined as meshes - sets of
- vertices which when linked as polygons form a recognisable 3D object. QtQuick3D currently
- supports a number of these \i {scene formats}, including \i {.obj} file, bezier patches
- \i {(.bez)}, and \i {.3ds} files.
-
- These meshes are abstracted into the \l Mesh class, which is defined for
- an \l Item3D through this property.
-
- The default value for this property is null, so a mesh must be defined in
- order for the item to be displayed
-
- \sa effect
-*/
-
-QDeclarativeMesh *QDeclarativeItem3D::mesh() const
-{
- return d->mesh;
-}
-
-void QDeclarativeItem3D::setMesh(QDeclarativeMesh *value)
-{
- if (d->mesh != value)
- {
- if (d->mesh) {
- if (!d->mesh->deref())
- delete d->mesh;
- }
-
- d->mesh = value;
- //always start off pointing to the default scene mesh object.
- d->mainBranchId = 0;
-
- if (value) {
- d->mesh->ref();
- connect(value, SIGNAL(dataChanged()), this, SIGNAL(meshChanged()));
- connect(value, SIGNAL(dataChanged()), this, SLOT(update()));
- d->requireBlockingEffectsCheck = true;
- }
-
- emit meshChanged();
-
- update();
- }
-}
-
-/*!
- \qmlproperty Effect Item3D::effect
-
- QML 3D items support the use of effects for modifying the display
- of items - texture effects, fog effects, material effects, and so on.
-
- The exact effects correlated with an item are set using this property.
-
- The default value for this propertly is null, and so an effect - even an
- empty one - must be defined if the mesh does not contain its own effects.
-
- \sa Effect, mesh
-*/
-QDeclarativeEffect *QDeclarativeItem3D::effect() const
-{
- return d->effect;
-}
-
-void QDeclarativeItem3D::setEffect(QDeclarativeEffect *value)
-{
- if (d->effect == value)
- return;
- if (d->effect)
- disconnect(d->effect, SIGNAL(effectChanged()), this, SLOT(handleEffectChanged()));
- d->effect = value;
- if (d->effect)
- {
- connect(d->effect, SIGNAL(effectChanged()), this, SLOT(handleEffectChanged()));
- d->requireBlockingEffectsCheck = true;
- }
- emit effectChanged();
- update();
-}
-
-/*!
- \qmlproperty Light Item3D::light
-
- This property defines an item-specific light that will be used
- intead of Viewport::light for rendering this item and its children
- if the value is not null.
-
- \sa Viewport::light
-*/
-
-QGLLightParameters *QDeclarativeItem3D::light() const
-{
- return d->light;
-}
-
-void QDeclarativeItem3D::setLight(QGLLightParameters *value)
-{
- if (d->light != value) {
- if (d->light) {
- disconnect(d->light, SIGNAL(lightChanged()),
- this, SLOT(update()));
- }
- d->light = value;
- if (d->light) {
- connect(d->light, SIGNAL(lightChanged()),
- this, SLOT(update()));
- }
- emit lightChanged();
- update();
- }
-}
-
-/*!
- \qmlproperty list<Item3D> Item3D::children
- \qmlproperty list<Object> Item3D::resources
-
- The children property contains a list of all QDeclarativeItem derived
- child items for this item. This provides logical grouping of items in a
- scene. Transformations that are applied to this item will also affect
- child items. Note that children that are not derived from
- QDeclarativeItem3D will not be rendered at draw time, but will interact
- normally otherwise (e.g. parenting, signal passing etc). Use a
- qobject_cast if you need to check whether a child is an Item3D.
-
- The resources property holds all other children that do not
- directly inherit from QDeclarativeItem, such as effects, meshes, and
- other supporting objects.
-
- Normally it isn't necessary to assign to the children or resources
- properties directly as the QML syntax will take care of the
- assignment depending upon the object's type.
-
- \sa transform
-*/
-
-QDeclarativeListProperty<QObject> QDeclarativeItem3D::resources()
-{
- return QDeclarativeListProperty<QObject>(this, 0, QDeclarativeItem3DPrivate::resources_append,
- QDeclarativeItem3DPrivate::resources_count,
- QDeclarativeItem3DPrivate::resources_at);
-}
-
-
-
-/*!
- \qmlproperty list<Object> Item3D::data
-
- This property exists to allow future expansion of the Item3D class to
- include additional data and resources. Currently there is no underlying
- implementation for this.
-*/
-QDeclarativeListProperty<QObject> QDeclarativeItem3D::data()
-{
- return QDeclarativeListProperty<QObject>(this, 0, QDeclarativeItem3DPrivate::data_append);
-}
-
-/*!
- \qmlproperty enumeration Item3D::cullFaces
-
- This property defines the culling method to be use on fragments
- within the item's mesh. Culling of an item in 3D space can be
- carried out in a number of ways:
-
- \list
- \o CullDisabled Do not use culling. This is the default value.
- \o CullFrontFaces Cull the front faces of the object.
- \o CullBackFaces Cull the back faces of the object.
- \o CullAllFaces Cull all faces of the object.
- \o CullClockwise Cull faces based on clockwise winding of vertices.
- \endlist
-*/
-QDeclarativeItem3D::CullFaces QDeclarativeItem3D::cullFaces() const
-{
- return d->cullFaces;
-}
-
-void QDeclarativeItem3D::setCullFaces(QDeclarativeItem3D::CullFaces value)
-{
- if (d->cullFaces != value) {
- d->cullFaces = value;
- emit meshChanged();
- }
-}
-
-/*!
- \qmlproperty enumeration Item3D::sortChildren
-
- This property defines the sorting mode to apply to child \l Item3D
- elements when they are drawn.
-
- \list
- \o DefaultSorting No explicit sorting of the children - draw them in
- whatever order is convenient for the system. The system may apply
- its own sorting, grouping similar materials to improve performance.
- This is the default.
- \o BackToFront Sort the children to draw them in back-to-front
- order of their \l position, overriding any system-supplied sorting.
- BackToFront is useful when the children are partially transparent
- and must be drawn in back-to-front order for correct rendering.
- \endlist
-*/
-QDeclarativeItem3D::SortMode QDeclarativeItem3D::sortChildren() const
-{
- return d->sortChildren;
-}
-
-void QDeclarativeItem3D::setSortChildren(QDeclarativeItem3D::SortMode mode)
-{
- if (d->sortChildren != mode) {
- d->sortChildren = mode;
- emit sortChildrenChanged();
- }
-}
-
-/*!
- \internal
- Sets the lighting conditions for this item on the \a painter. The parameters \a currentLight and \a currentLightTransform
- are used to store the current lighting parameters and transforms so that they can be reset on cleanup.
-
- After drawing has finished the drawLightingCleanup() function should be called to restore previous settings.
-
- \sa drawLightingCleanup(), draw()
-*/
-void QDeclarativeItem3D::drawLightingSetup(QGLPainter *painter, const QGLLightParameters *currentLight, QMatrix4x4 &currentLightTransform)
-{
- //Lighting
- if (d->light) {
- currentLight = painter->mainLight();
- currentLightTransform = painter->mainLightTransform();
- painter->setMainLight(d->light);
- }
-}
-
-/*!
- \internal
- Restores the lighting conditions for \a painter to the \a currentLight and \a currentLightTransform. These values are usually
- provided by an earlier call to drawLightingSetup().
-
- \sa drawLightingSetup(), draw()
-*/
-void QDeclarativeItem3D::drawLightingCleanup(QGLPainter *painter, const QGLLightParameters *currentLight, QMatrix4x4 &currentLightTransform)
-{
- if (d->light)
- painter->setMainLight(currentLight, currentLightTransform);
-}
-
-/*!
- \internal
- Sets the effects for this item on the \a painter. The parameters \a viewportBlend and \a effectBlend
- are used to store the current blending parameters so that they can be reset on cleanup.
-
- After drawing has finished the drawEffectCleanup() function should be called to restore previous settings.
-
- \sa drawLightingCleanup(), draw()
-*/
-void QDeclarativeItem3D::drawEffectSetup(QGLPainter *painter, bool &viewportBlend, bool &effectBlend)
-{
- // Blending change for the effect.
- viewportBlend = d->viewport ? d->viewport->blending() : false;
- effectBlend = d->effect ? d->effect->blending() : viewportBlend;
- if (viewportBlend != effectBlend) {
- if (effectBlend)
- glEnable(GL_BLEND);
- else
- glDisable(GL_BLEND);
- }
-
- //Effects
- if (d->effect)
- d->effect->enableEffect(painter);
-}
-
-/*!
- \internal
- Restores the blending settings for \a painter to the \a viewportBlend and \a effectBlend. These values are usually
- provided by an earlier call to drawEffectSetup().
-
- \sa drawEffectSetup(), draw()
-*/
-void QDeclarativeItem3D::drawEffectCleanup(QGLPainter *painter, bool &viewportBlend, bool &effectBlend)
-{
- if (d->effect)
- d->effect->disableEffect(painter);
- if (viewportBlend != effectBlend) {
- if (effectBlend)
- glDisable(GL_BLEND);
- else
- glEnable(GL_BLEND);
- }
-}
-
-/*!
- \internal
- Sets the culling settings for this item.
-
- After drawing has finished the drawCullCleanup() function should be called to restore previous settings.
-
- \sa drawCullCleanup(), draw()
-*/
-void QDeclarativeItem3D::drawCullSetup()
-{
- //Culling
- if ((d->cullFaces & ~CullClockwise) == CullDisabled) {
- glDisable(GL_CULL_FACE);
- } else if (d->cullFaces & CullClockwise) {
- glFrontFace(GL_CW);
- glCullFace(GLenum(d->cullFaces & ~CullClockwise));
- glEnable(GL_CULL_FACE);
- } else {
- glFrontFace(GL_CCW);
- glCullFace(GLenum(d->cullFaces));
- glEnable(GL_CULL_FACE);
- }
-}
-
-/*!
- \internal
- Restores the culling settings after an earlier call to drawCullSetup().
-
- \sa drawCullSetup(), draw()
-*/
-void QDeclarativeItem3D::drawCullCleanup()
-{
- if (d->cullFaces != CullDisabled)
- glDisable(GL_CULL_FACE);
-}
-
-/*!
- \internal
- Applies the transforms for this item on the \a painter.
-
- After drawing has finished the drawTransformCleanup() function should be called to restore previous settings.
-
- \sa drawTransformCleanup(), draw()
-*/
-void QDeclarativeItem3D::drawTransformSetup(QGLPainter *painter)
-{
- //Local and Global transforms
- painter->modelViewMatrix().push();
- painter->modelViewMatrix() *= d->localTransforms();
-}
-
-/*!
- \internal
- Restores the previous model-view matrix settings for \a painter after an earlier call to drawTransformSetup().
-
- \sa drawTransformSetup(), draw()
-*/
-void QDeclarativeItem3D::drawTransformCleanup(QGLPainter *painter)
-{
- //Unset parameters for transforms, effects etc.
- painter->modelViewMatrix().pop();
-}
-
-/*!
- \internal
- Iterate through all of the child items for the current item and call their drawing functions. Children will
- be drawn in the order specified unless specified by sortChildren(), in which case they will be drawn in the
- order specified (usually this will be back-to-front, to allow for transparency of objects).
-
- \sa sortMode(), draw()
-*/
-void QDeclarativeItem3D::drawChildren(QGLPainter *painter)
-{
- // Find all 3d children for drawing
- QList<QDeclarativeItem3D *> list;;
- foreach (QObject* o, children())
- {
- if (QDeclarativeItem3D *item3d = qobject_cast<QDeclarativeItem3D*>(o))
- {
- list.append(item3d);
- }
- }
-
- if (d->sortChildren == QDeclarativeItem3D::BackToFront) {
- // Collect up the transformed z positions of all children.
- QList<qreal> zlist;
- QMatrix4x4 mv = painter->modelViewMatrix();
- for (int index = 0; index < list.size(); ++index) {
- QVector3D position = list.at(index)->position();
- zlist.append(mv.map(position).z());
- }
-
- // Sort the item list (Caution: really dumb sort algorithm).
- for (int i = 0; i < list.size() - 1; ++i) {
- for (int j = i + 1; j < list.size(); ++j) {
- if (zlist.at(i) > zlist.at(j)) {
- qSwap(list[i], list[j]);
- qSwap(zlist[i], zlist[j]);
- }
- }
- }
- }
- for (int index = 0; index < list.size(); ++index)
- list.at(index)->draw(painter);
-}
-
-/*!
- \internal
- Performs the actual drawing of the Item3D using \a painter.
-
- If the item is set to object picking mode this includes all of the infrastructure needed
- to support picking of objects.
-
- The basic premise of the draw function should be familiar to users of OpenGL or similar
- graphics libraries. Essentially it is a stepwise progress through the following stages:
-
- \list
- \i 1. Iterate through the child objects of the item and set all lighting parameters found.
- \i 2. Set up culling mode in the painter.
- \i 3. Set effects if they exist.
- \i 4. Set all local model view transformations for this item.
- \i 5. Draw this item.
- \i 6. Iterate through the child objects of the item and draw all child items.
- \i 7. Unset the appropriate parameters and states.
- \endlist
-
-
-
- \sa drawItem(), drawLightingSetup(), drawCullSetup(), drawEffectSetup(), drawChildren(), drawTransformSetup()
-*/
-void QDeclarativeItem3D::draw(QGLPainter *painter)
-{
- // Bail out if this item and its children have been disabled.
- if (!d->isEnabled)
- return;
- if (!d->isInitialized)
- initialize(painter);
-
- //Setup picking
- int prevId = painter->objectPickId();
- painter->setObjectPickId(d->objectPickId);
-
- //Setup effect (lighting, culling, effects etc)
- const QGLLightParameters *currentLight = 0;
- QMatrix4x4 currentLightTransform;
- drawLightingSetup(painter, currentLight, currentLightTransform);
- bool viewportBlend, effectBlend;
- drawEffectSetup(painter, viewportBlend, effectBlend);
- drawCullSetup();
-
- //Local and Global transforms
- drawTransformSetup(painter);
-
- //Drawing
- drawItem(painter);
- drawChildren(painter);
-
- //Cleanup
- drawTransformCleanup(painter);
- drawLightingCleanup(painter, currentLight, currentLightTransform);
- drawEffectCleanup(painter, viewportBlend, effectBlend);
- drawCullCleanup();
-
- //Reset pick id.
- painter->setObjectPickId(prevId);
-}
-
-/*!
- \internal
-*/
-void QDeclarativeViewport::setItemViewport(QDeclarativeItem3D *item)
-{
- item->d->viewport = this;
-}
-
-/*!
- \internal
- The process of initialising an /l Object3d is a critical step, particularly in
- complex scenes. This function initialises the item in \a viewport, and using \a painter.
-
- During the initialisation process objects are registered as being \i pickable (ie. able
- to be clicked on with the mouse.
-
- Additionally, in the case of \l Item3D objects which refer to sub-nodes of a mesh, this
- function performs all of the splitting of meshes into sub-branches ready for local
- control by the item.
-*/
-void QDeclarativeItem3D::initialize(QGLPainter *painter)
-{
- if (d->isInitialized) return;
-
- if (!d->viewport)
- {
- if (QDeclarativeItem3D* parentItem =
- qobject_cast<QDeclarativeItem3D*>(parent()))
- {
- d->viewport = parentItem->d->viewport;
- Q_ASSERT(d->viewport);
- }
- }
-
- d->objectPickId = d->viewport->registerPickableObject(this);
-
- //Setup mesh sub-nodes if possible.
- if (mesh() && !meshNode().isEmpty()) {
- int branchNumber = mesh()->createSceneBranch(meshNode());
- if (branchNumber>=0) {
- d->mainBranchId = branchNumber;
- }
- else {
- qWarning()<< "3D item initialization failed: unable to find the specified mesh-node. Defaulting to default node.";
- d->mainBranchId = 0;
- }
- }
-
- for (int index = 0; index < children().size(); ++index) {
- QDeclarativeItem3D *item = qobject_cast<QDeclarativeItem3D *>(children().at(index));
- if (item) {
- //Event inheritance is generally only declared at initialization, but can also be done at runtime
- //if the user wishes (though not recommended).
- if (inheritEvents()) {
- // Proxy the mouse event signals to the parent so that
- // the parent can trap the signal for its children.
- QObject::connect(item, SIGNAL(clicked()), this, SIGNAL(clicked()));
- QObject::connect(item, SIGNAL(doubleClicked()), this, SIGNAL(doubleClicked()));
- QObject::connect(item, SIGNAL(pressed()), this, SIGNAL(pressed()));
- QObject::connect(item, SIGNAL(released()), this, SIGNAL(released()));
- QObject::connect(item, SIGNAL(hoverEnter()), this, SIGNAL(hoverEnter()));
- QObject::connect(item, SIGNAL(hoverLeave()), this, SIGNAL(hoverLeave()));
- }
- //if the item has no mesh of its own and no meshnode is declared we give it the mesh from the current item.
- if (!item->mesh() && !item->meshNode().isEmpty()) {
- item->setMesh(mesh());
- }
-
- d->viewport->setItemViewport(item);
- item->initialize(painter);
- }
- }
- d->isInitialized = true;
-}
-
-/*!
- Returns true if the initialize() has been called, returns false otherwise.
-
- \sa initialize()
-*/
-bool QDeclarativeItem3D::isInitialized() const
-{
- return d->isInitialized;
-}
-
-
-void QDeclarativeItem3D::componentComplete()
-{
- QDeclarativeItem::componentComplete();
- d->componentComplete = true;
- // Now that we have all the mesh and subnode information we need, if we haven't already, then it's time to setup the mesh scene objects.
- if (mesh() && !meshNode().isEmpty() && d->mainBranchId==0) {
- int branchNumber = mesh()->createSceneBranch(meshNode());
- if (branchNumber>=0) {
- d->mainBranchId = branchNumber;
- }
- else {
- qWarning()<< "3D item initialization failed: unable to find the specified mesh-node. Defaulting to default node.";
- d->mainBranchId = 0;
- }
- }
- update();
-}
-
-/*!
- \internal
- The \c drawItem function performs the actual drawing of the mesh branch which corresponds
- to the section of the mesh being drawn by the \l Item3D to a specific \a painter.
-
- This function does perform one transform - the pretransform, which is usually used to
- rotate the item to give it the correct initial spatial orientation.
-
- \sa pretransform()
-*/
-void QDeclarativeItem3D::drawItem(QGLPainter *painter)
-{
- int transformCount = d->pretransforms.count();
- if (transformCount>0) {
- painter->modelViewMatrix().push();
-
- QMatrix4x4 *m = const_cast<QMatrix4x4 *>(&painter->modelViewMatrix().top());
-
- // Pre-transforms for orienting the model.
- for (int index = transformCount - 1; index >= 0; --index) {
- d->pretransforms.at(index)->applyTo(m);
- }
- }
-
- if (d->mesh)
- {
- d->mesh->draw(painter, d->mainBranchId);
- }
-
- if (transformCount>0) {
- painter->modelViewMatrix().pop();
- }
-}
-
-/*!
- \relates QDeclarativeItem3D
- Print a description of \a item to the console.
-
- If \a detailed is true (which it is by default) then all the properties
- of each node are printed.
-
- If \a detailed is false, then just one line is printed with the name and
- some identifying information including a unique id for the node.
-
- The \a indent argument is used internally.
-*/
-void qDumpItem(QDeclarativeItem3D *item, bool detailed, int indent)
-{
- if (item)
- {
- QDeclarativeMesh *mesh = item->mesh();
- QString ind;
- ind.fill(QLatin1Char(' '), indent * 4);
- if (mesh)
- {
- QGLSceneNode *node = mesh->getSceneObject();
- if (node)
- qDumpScene(node, detailed, indent + 1);
- else
- qDebug("%sMesh %p - %s (no node)", qPrintable(ind), mesh, qPrintable(mesh->objectName()));
- }
- else
- {
- qDebug("%sItem %p - %s (no mesh)", qPrintable(ind), item, qPrintable(item->objectName()));
- }
- QObjectList kids = item->children();
- for (int i = 0; i < kids.size(); ++i)
- {
- QDeclarativeItem3D *it = qobject_cast<QDeclarativeItem3D*>(kids.at(i));
- qDumpItem(it, detailed, indent + 1);
- }
- }
-}
-
-/*!
- Calculates and returns a matrix that transforms local coordinates into
- world coordinates (i.e. coordinates untransformed by any item3d's
- transforms).
-*/
-QMatrix4x4 QDeclarativeItem3DPrivate::localToWorldMatrix() const
-{
- QMatrix4x4 result;
-
- result = localTransforms() * result;
- QDeclarativeItem3D *anscestor = qobject_cast<QDeclarativeItem3D *>(item->parent());
- while (anscestor)
- {
- result = anscestor->d->localTransforms() * result;
- anscestor = qobject_cast<QDeclarativeItem3D *>(anscestor->parent());
- }
- return result;
-}
-
-/*!
- Calculates and returns a matrix that transforms world coordinates into
- coordinates relative to this Item3D.
-*/
-QMatrix4x4 QDeclarativeItem3DPrivate::worldToLocalMatrix() const
-{
- bool inversionSuccessful;
- QMatrix4x4 result = localToWorldMatrix().inverted(&inversionSuccessful);
- if (inversionSuccessful)
- return result;
- qWarning() << "QDeclarativeItem3D - matrix inversion failed trying to generate worldToLocal Matrix";
- return QMatrix4x4();
-}
-
-/*!
- Returns the position of a local \a point in world space (i.e. not
- transformed by this item, it's parents, the camera etc).
-*/
-QVector3D QDeclarativeItem3D::localToWorld(const QVector3D &point) const
-{
- return d->localToWorldMatrix() * point;
-}
-
-/*!
- Returns the position of a point in world space in local coordinates.
-*/
-QVector3D QDeclarativeItem3D::worldToLocal(const QVector3D &point) const
-{
- return d->worldToLocalMatrix() * point;
-}
-
-/*!
- \internal
- This function handles the standard mouse events for the item as contained in \a e.
-
- Returns the boolean value of the regular QObject::event() function.oo
-*/
-
-bool QDeclarativeItem3D::event(QEvent *e)
-{
- // Convert the raw event into a signal representing the user's action.
- if (e->type() == QEvent::MouseButtonPress) {
- QMouseEvent *me = (QMouseEvent *)e;
- if (me->button() == Qt::LeftButton)
- emit pressed();
- } else if (e->type() == QEvent::MouseButtonRelease) {
- QMouseEvent *me = (QMouseEvent *)e;
- if (me->button() == Qt::LeftButton) {
- emit released();
- if (me->x() >= 0) // Positive: inside object, Negative: outside.
- emit clicked();
- }
- } else if (e->type() == QEvent::MouseButtonDblClick) {
- emit doubleClicked();
- } else if (e->type() == QEvent::Enter) {
- emit hoverEnter();
- } else if (e->type() == QEvent::Leave) {
- emit hoverLeave();
- }
- return QObject::event(e);
-}
-
-void QDeclarativeItem3D::handleEffectChanged()
-{
- d->requireBlockingEffectsCheck = true;
- update();
-}
-
-/*!
- \qmlproperty string Item3D::meshNode
-
- This property is a simple string which refers to the node in the \l Mesh object which
- is associated with this \l Item3D.
-
- \sa mesh
-*/
-QString QDeclarativeItem3D::meshNode() const
-{
- return d->meshNode;
-}
-
-void QDeclarativeItem3D::setMeshNode(const QString &node)
-{
- //the actual instantiation of the node as the mesh itself is undertaken in the initialize function.
- d->meshNode = node;
-}
-
-/*!
- \internal
- Update the \l Viewport with which this item is associated.
-*/
-void QDeclarativeItem3D::update()
-{
- if (d->requireBlockingEffectsCheck && d->effect && d->mesh && d->componentComplete)
- {
- QGLSceneNode *n = 0;
- if (!meshNode().isEmpty())
- n = d->mesh->getSceneObject(meshNode());
- if (!n)
- n = d->mesh->getSceneBranch(d->mainBranchId);
- if (!n)
- {
- n = d->mesh->getSceneObject();
- }
- if (n)
- {
- QList<QGLSceneNode*> k = n->allChildren();
- k.prepend(n);
- for (int i = 0; i < k.size(); ++i)
- {
- // If the effect has a texture, make sure the mesh does too
- bool hasTexture = (!d->effect->texture().isEmpty() ||
- (!d->effect->textureImage().isNull()));
- bool missingTextureCoordinates =
- k.at(i)->geometry().hasField(QGL::Position) &&
- !k.at(i)->geometry().hasField(QGL::TextureCoord0);
- if ( hasTexture && missingTextureCoordinates )
- {
- qWarning() << "QGLSceneNode" << k.at(i)->objectName() << "from" << d->mesh->source() << "is missing texture coordinates. Dummy coordinates are being generated, which may take some time.";
- k.at(i)->geometry().generateTextureCoordinates();
- }
-
- QGLSceneNode* sceneObject;
- if (!this->meshNode().isEmpty())
- {
- sceneObject = d->mesh->getSceneObject(meshNode());
- } else
- sceneObject = d->mesh->getSceneObject();
-
- if (sceneObject)
- {
- QList<QGLSceneNode*> k = n->allChildren();
- k.prepend(n);
- if (this->effect())
- {
- for (int i = 0; i < k.size(); ++i)
- {
- this->effect()->applyTo(k.at(i));
- }
- }
- }
- }
- }
- d->requireBlockingEffectsCheck = false;
- }
- if (d->viewport)
- d->viewport->update3d();
-}
-
-/*!
- \qmlproperty bool Item3D::enabled
-
- This property should be set to true to enable the drawing
- of this item and its children. Set this property to false
- to disable drawing. The default value is true.
-
- \sa mesh
-*/
-bool QDeclarativeItem3D::isEnabled() const
-{
- return d->isEnabled;
-}
-
-void QDeclarativeItem3D::setEnabled(bool value)
-{
- if (d->isEnabled != value) {
- d->isEnabled = value;
- emit enabledChanged();
- }
-}
-
-/*!
- Returns the unique pick ID for this item.
-*/
-int QDeclarativeItem3D::objectPickId() const
-{
- return d->objectPickId;
-}
-
-/*!
- \qmlsignal Item3D::onClicked()
-
- This signal is emitted when the item is clicked. Picking must be enabled for this to have any effect.
-*/
-
-
-/*!
- \qmlsignal Item3D::onDoubleClicked()
-
- This signal is emitted when the item is double clicked. Picking must be enabled for this to have any effect.
-
-*/
-
-
-/*!
- \qmlsignal Item3D::onPressed()
-
- This signal is emitted when the item detects a mouse-button-down event. Picking must be enabled
- for this to have any effect.
-*/
-
-
-/*!
- \qmlsignal Item3D::onReleased()
-
- This signal is emitted when the item detects a mouse-button-released event. Picking must be enabled
- for this to have any effect.
-*/
-
-
-/*!
- \qmlsignal Item3D::onHoverEnter()
-
- This signal is emitted when a mouseover of the item is detected. It relies on object picking to be
- of use.
-*/
-
-
-/*!
- \qmlsignal Item3D::onHoverLeave()
-
- This signal is emitted when the mouseover of the item ceases. It relies on object picking to be
- used.
-*/
-
-QT_END_NAMESPACE
diff --git a/src/quick3d/qdeclarativeitem3d.h b/src/quick3d/qdeclarativeitem3d.h
deleted file mode 100644
index 5645897f..00000000
--- a/src/quick3d/qdeclarativeitem3d.h
+++ /dev/null
@@ -1,226 +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 QDECLARATIVEITEM3D_H
-#define QDECLARATIVEITEM3D_H
-
-#include "qt3dquickglobal.h"
-
-#include <QtCore/qobject.h>
-#include <QtCore/qvariant.h>
-#include <QtGui/qvector3d.h>
-
-#include <QtDeclarative/qdeclarativeitem.h>
-
-#include "qglscenenode.h"
-#include "qglpainter.h"
-#include "qgraphicstransform3d.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-class QDeclarativeItem3DPrivate;
-class QDeclarativeMesh;
-class QDeclarativeEffect;
-class QDeclarativeViewport;
-class QDeclarativeState;
-class QDeclarativeTransition;
-
-class Q_QT3D_QUICK_EXPORT QDeclarativeItem3D : public QDeclarativeItem
-{
- Q_OBJECT
- Q_INTERFACES(QDeclarativeParserStatus)
- Q_ENUMS(SortMode)
- Q_ENUMS(CullFace)
- Q_FLAGS(CullFaces)
- Q_PROPERTY(QVector3D position READ position WRITE setPosition NOTIFY positionChanged)
- Q_PROPERTY(qreal x READ x WRITE setX NOTIFY positionChanged)
- Q_PROPERTY(qreal y READ y WRITE setY NOTIFY positionChanged)
- Q_PROPERTY(qreal z READ z WRITE setZ NOTIFY positionChanged)
- Q_PROPERTY(qreal scale READ scale WRITE setScale NOTIFY scaleChanged)
- Q_PROPERTY(QDeclarativeListProperty<QGraphicsTransform3D> transform READ transform DESIGNABLE false FINAL)
- Q_PROPERTY(QDeclarativeListProperty<QGraphicsTransform3D> pretransform READ pretransform DESIGNABLE false FINAL)
- Q_PROPERTY(QDeclarativeMesh *mesh READ mesh WRITE setMesh NOTIFY meshChanged)
- Q_PROPERTY(QDeclarativeEffect *effect READ effect WRITE setEffect NOTIFY effectChanged)
- Q_PROPERTY(QGLLightParameters *light READ light WRITE setLight NOTIFY lightChanged)
- Q_PROPERTY(QDeclarativeListProperty<QObject> resources READ resources DESIGNABLE false)
- Q_PROPERTY(QDeclarativeListProperty<QObject> data READ data DESIGNABLE false)
- Q_PROPERTY(CullFaces cullFaces READ cullFaces WRITE setCullFaces NOTIFY meshChanged)
- Q_PROPERTY(SortMode sortChildren READ sortChildren WRITE setSortChildren NOTIFY sortChildrenChanged)
- Q_PROPERTY(QString meshNode READ meshNode WRITE setMeshNode NOTIFY meshNodeChanged)
- Q_PROPERTY(bool inheritEvents READ inheritEvents WRITE setInheritEvents NOTIFY inheritEventsChanged)
- Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged)
- Q_CLASSINFO("DefaultProperty", "data")
-public:
- QDeclarativeItem3D(QObject *parent = 0);
- ~QDeclarativeItem3D();
-
- enum CullFace
- {
- CullDisabled = 0,
- CullFrontFaces = 0x0404, // GL_FRONT
- CullBackFaces = 0x0405, // GL_BACK
- CullAllFaces = 0x0408, // GL_FRONT_AND_BACK
- CullClockwise = 0x10000
- };
- Q_DECLARE_FLAGS(CullFaces, CullFace)
-
- enum SortMode
- {
- DefaultSorting,
- BackToFront
- };
-
- QVector3D position() const;
- void setPosition(const QVector3D& value);
-
- qreal x() const;
- void setX(qreal value);
- qreal y() const;
- void setY(qreal value);
- qreal z() const;
- void setZ(qreal value);
-
- qreal scale() const;
- void setScale(qreal value);
-
- QDeclarativeMesh *mesh() const;
- void setMesh(QDeclarativeMesh* value);
-
- bool inheritEvents() const;
- void setInheritEvents(bool inherit);
-
- QDeclarativeEffect *effect() const;
- void setEffect(QDeclarativeEffect *value);
-
- QGLLightParameters *light() const;
- void setLight(QGLLightParameters *value);
-
- QDeclarativeListProperty<QObject> data();
- QDeclarativeListProperty<QObject> resources();
-
- QDeclarativeListProperty<QGraphicsTransform3D> transform();
- QDeclarativeListProperty<QGraphicsTransform3D> pretransform();
-
- CullFaces cullFaces() const;
- void setCullFaces(CullFaces value);
-
- SortMode sortChildren() const;
- void setSortChildren(SortMode mode);
-
- QString meshNode() const;
- void setMeshNode(const QString &);
-
- bool isEnabled() const;
- void setEnabled(bool value);
-
- virtual void draw(QGLPainter *painter);
- virtual void initialize(QGLPainter *painter);
- bool isInitialized() const;
-
- Q_INVOKABLE QVector3D localToWorld(const QVector3D &point = QVector3D()) const;
- Q_INVOKABLE QVector3D worldToLocal(const QVector3D &point = QVector3D()) const;
-
- void componentComplete();
-
- int objectPickId() const;
-
-public Q_SLOTS:
- void update();
-
-protected:
- virtual void drawLightingSetup(QGLPainter *painter, const QGLLightParameters *currentLight, QMatrix4x4 &currentLightTransform);
- virtual void drawLightingCleanup(QGLPainter *painter, const QGLLightParameters *currentLight, QMatrix4x4 &currentLightTransform);
-
- virtual void drawCullSetup();
- virtual void drawCullCleanup();
-
- virtual void drawEffectSetup(QGLPainter *painter, bool &viewportBlend, bool &effectBlend);
- virtual void drawEffectCleanup(QGLPainter *painter, bool &viewportBlend, bool &effectBlend);
-
- virtual void drawChildren(QGLPainter *painter);
- virtual void drawItem(QGLPainter *painter);
-
- virtual void drawTransformSetup(QGLPainter *painter);
- virtual void drawTransformCleanup(QGLPainter *painter);
-
- bool event(QEvent *e);
-
-private Q_SLOTS:
- void handleEffectChanged();
-
-Q_SIGNALS:
- void positionChanged();
- void scaleChanged();
- void rotationChanged();
- void meshChanged();
- void meshNodeChanged();
- void effectChanged();
- void lightChanged();
- void clicked();
- void doubleClicked();
- void pressed();
- void released();
- void hoverEnter();
- void hoverLeave();
- void inheritEventsChanged();
- void enabledChanged();
- void sortChildrenChanged();
-
-private:
- QDeclarativeItem3DPrivate *d;
-
- friend class QDeclarativeItem3DPrivate;
- friend class QDeclarativeViewport;
-};
-
-Q_DECLARE_OPERATORS_FOR_FLAGS(QDeclarativeItem3D::CullFaces)
-
-Q_QT3D_QUICK_EXPORT void qDumpItem(QDeclarativeItem3D *item, bool detailed = true, int indent = 0);
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(QDeclarativeItem3D)
-
-QT_END_HEADER
-
-#endif
diff --git a/src/quick3d/qdeclarativemesh.cpp b/src/quick3d/qdeclarativemesh.cpp
deleted file mode 100644
index 25b405b2..00000000
--- a/src/quick3d/qdeclarativemesh.cpp
+++ /dev/null
@@ -1,722 +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 "qdeclarativemesh.h"
-
-#include "qglabstractscene.h"
-#include "qglscenenode.h"
-#include "qglmaterial.h"
-#include "qglmaterialcollection.h"
-
-#include <QNetworkRequest>
-#include <QNetworkReply>
-#include <QtDeclarative/qdeclarativeengine.h>
-#include <QtCore/qlist.h>
-
-/*!
- \qmlclass Mesh QDeclarativeMesh
- \brief The Mesh item provides a means of abstracting 3D mesh and geometry representations in
- a way that can be used in QML. The Mesh class contains necessary properties and methods for
- display and manipulation of 3d objects of this type.
- \since 4.8
- \ingroup qt3d::qml3d
-
- \section1 Underlying Architecture
-
- QML/3d Mesh objects are a QML enabled means of representing any scene class based
- on the \l QGLAbstractScene class.
-
- In cases where the scene is composed of multiple nodes (for example, in a \i .3ds file)
- the mesh allows users to split away branches of the tree and manipulate them in
- isolation from the original scene graph.
-
- In order to achieve this the mesh object contains a map correlating numeric identifiers
- for individual branches with specific \l QGLSceneNode objects which are taken from
- the original scene.
-
- More details on achieving this can be found in the \l Item3D class.
-
- \section1 Specifying Simple Mesh Objects
-
- Like other objects in QML/3d, Mesh objects are created by the standard QML syntax for
- objects. Meshes should always specify an appropriate file containing the data for
- the Mesh,
-
- \code
- Mesh {source: "model.obj"}
- \endcode
-
- For objects loaded from the network we can wait for an "onLoaded" signal in QML (from the
- loaded() signal in the Mesh class) before performing specific actions. For example:
-
- \code
- Item3D {
- id: theMesh
- mesh: Mesh {
- source: "http://www.example_3d_model_url.com/sample.obj"
- onLoaded:{theMesh.effect=theEffect}
- }
-
- Effect {
- id: theEffect
- texture: ":/qml/texture.jpg" }
- }
- }
- \endcode
-
- This code will wait until the mesh has been fully loaded before attempting to apply the effects.
-*/
-
-QT_BEGIN_NAMESPACE
-
-class QDeclarativeMeshPrivate
-{
-public:
- QDeclarativeMeshPrivate()
- : dataReply(0)
- , scene(0)
- , nextSceneBranchId(0)
- , mainSceneObject(NULL)
- , refCount(1)
- , completed(false)
- , loaded(false)
- , dumpInfo(false)
- {}
- ~QDeclarativeMeshPrivate()
- {
- delete scene;
- }
-
- struct branchObject {
- QObject *previousParent;
- QGLSceneNode *rootSceneObject;
- };
-
- QUrl data;
- QString meshName;
- QDeclarativeMesh *parentMesh;
- QNetworkReply *dataReply;
- QGLAbstractScene *scene;
- int nextSceneBranchId;
- QMap<int, branchObject> sceneBranches;
- QList<QGLSceneNode *>sceneObjects;
- QGLSceneNode *mainSceneObject;
- QList<QGLMaterial *> connected;
- int refCount;
- bool completed;
- bool loaded;
- QString options;
- bool dumpInfo;
-};
-
-/*!
- \internal
- Construct a \l Mesh object with \a parent as its parent.
-*/
-QDeclarativeMesh::QDeclarativeMesh(QObject *parent)
- : QObject(parent)
-{
- d = new QDeclarativeMeshPrivate();
-}
-
-/*!
- \internal
- Destroy the \l Mesh object and free any unneeded memory.
-*/
-QDeclarativeMesh::~QDeclarativeMesh()
-{
- delete d;
-}
-
-/*!
- \qmlproperty url Mesh::source
-
- Each mesh requires a set of data that describes (among other things) vertices
- transformations, textures, and so on. This data is generally stored in files and
- specified via the source property.
-
- Source files can be of any type supported by QtQuick3D. The types of file currently
- supported can be found in the \c sceneFormat plugins, with \i .3ds, \i .bez, \i. obj
- files currently being supported.
-
- Also due to limitations of 3rd party libraries, .dxf support is rather limited.
- Only 3d components (no 2d lines and such supported), and there are also issues with
- loading newer file types (everything up to the 2004-2006 file format seems to work,
- anything after we've had issues with).
-
- Meshes can also be stored within QRC files and loaded via the standard resource
- mechanisms, however there may be issues with some esoteric remote resource loading
- requirements within the different file types.
-*/
-
-QUrl QDeclarativeMesh::source() const
-{
- return d->data;
-}
-
-void QDeclarativeMesh::setSource(const QUrl& value)
-{
- if (d->data == value)
- return;
- d->data = value;
- if (d->data.scheme() == QLatin1String("file")) {
- QGLAbstractScene *s = QGLAbstractScene::loadScene(d->data.toLocalFile(),
- QString(), d->options);
- setScene(s);
- } else if (d->data.scheme().toLower() == QLatin1String("qrc")) {
- // strips off any qrc: prefix and any excess slashes and replaces it with :/
- d->data.setScheme("");
- QGLAbstractScene *s = QGLAbstractScene::loadScene(
- QLatin1String(":")+d->data.toString(),
- QString(), d->options);
- setScene(s);
- } else {
- //network loading
- QGLAbstractScene *s = QGLAbstractScene::loadScene(d->data,QString(), d->options);
- connect(s, SIGNAL(sceneUpdated()), this, SLOT(dataRequestFinished()));
- }
-}
-
-/*!
- \qmlproperty string Mesh::meshName
-
- Users can associate a name with a mesh to facilitate easy finding or
- description of a mesh.
-*/
-QString QDeclarativeMesh::meshName() const
-{
- return d->meshName;
-}
-
-void QDeclarativeMesh::setMeshName(const QString& value)
-{
- bool emitDataChanged = false;
- if (d->meshName != value)
- {
- d->meshName = value;
- emitDataChanged = true;
- }
- if (d->loaded && d->scene) {
- QGLSceneNode *insertObject;
- if (value.isEmpty())
- insertObject = getSceneObject();
- else
- insertObject = getSceneObject(value);
- if (!insertObject && !value.isEmpty()) {
- qWarning() << "could not find" << value << "available:" << getSceneObjectNames();
- } else if (!insertObject) {
- qWarning() << "could not find main object in scene!";
- }
-
- //Add the object: if null it will make the object non-drawable, but still able
- //to run.
- addSceneBranch(insertObject);
- emitDataChanged = true;
- }
- if (emitDataChanged)
- emit dataChanged();
-}
-
-/*!
- \qmlproperty string Mesh::options
-
- The behaviour of the underlying file loader can be controlled by
- string encoded options. Consult the documentation for each loader for
- the options available.
-
- Specifies the current options for loading this mesh. The default value
- is the null string, meaning no options are applied.
-*/
-QString QDeclarativeMesh::options() const
-{
- return d->options;
-}
-
-void QDeclarativeMesh::setOptions(const QString &options)
-{
- if (options != d->options)
- {
- d->options = options;
- emit optionsChanged();
- }
-}
-
-/*!
- \internal
- Once the request for data has been finished the \l Mesh class is now free to load
- the scene.
-*/
-void QDeclarativeMesh::dataRequestFinished()
-{
- //other processing may be required, but for now, simply emit a
- //change of data signal.
- QGLAbstractScene *sceneData = qobject_cast<QGLAbstractScene*>(sender());
-
- if (sceneData) {
- if (sceneData == d->scene)
- emit dataChanged();
- else
- setScene(sceneData);
- } else {
- qWarning("Data request recieved a signal from a class other than a valid scene.");
- }
-}
-
-/*!
- \internal
- Because the branches of the overall scene are essentially /i moveable, and the
- standard methods of getting objects/names from a scene rely on a single tree,
- the \l Mesh class supports its own list of mesh objects in the scene which is
- taken on startup from the normal \l QGLAbstractScene based class for the current
- mesh.
-
- This means that object lookup can be performed at any time without having to
- reconstitute the original scene or maintain logical links between split branches.
-
- As an added advantage it also eliminates the (minor) additional cost of having
- to traverse the scene-graph/tree in order to locate objects.
-
- \sa QGLAbstractScene
-*/
-void QDeclarativeMesh::initSceneObjectList()
-{
- d->sceneObjects.clear();
- if (d->scene) {
- QList<QObject *> objs = d->scene->objects();
- for (int index = 0; index < objs.count(); ++index) {
- QGLSceneNode *node = qobject_cast<QGLSceneNode *>(objs.at(index));
- if (node)
- d->sceneObjects.append(node);
- }
- QGLSceneNode *old = d->mainSceneObject;
- d->mainSceneObject = d->scene->mainNode();
- if (old != d->mainSceneObject)
- emit nodeChanged();
- }
-}
-
-/*!
- \qmlproperty QGLSceneNode Mesh::getSceneObject
-
- Get the main scene node for the \l QGLAbstractScene associated with this mesh.
-*/
-QGLSceneNode *QDeclarativeMesh::getSceneObject()
-{
- //This variant of the function gets the main scene object for the scene
- if (!d->mainSceneObject)
- initSceneObjectList();
-
- return d->mainSceneObject;
-}
-
-/*!
- \internal
- Get the scene object called \a name, specified as a QString, and retrieve the
- scene object in this mesh which corresponds to it.
-*/
-QGLSceneNode *QDeclarativeMesh::getSceneObject(const QString &name)
-{
- //This variant of the function gets the mesh scene object for a scene
- //based on the name of the object.
- if (d->sceneObjects.empty())
- initSceneObjectList();
-
- foreach (QGLSceneNode *object, d->sceneObjects) {
- if (object && object->objectName().startsWith(name))
- {
- return object;
- }
- }
-
- return NULL;
-}
-
-/*!
- \internal
- Used mainly for diagnostic purposes this function returns a QStringList containing
- all of the object names for the given mesh.
-*/
-QStringList QDeclarativeMesh::getSceneObjectNames()
-{
- //Get a string list of all mesh object names in the scene.
- if (d->sceneObjects.empty())
- initSceneObjectList();
-
- QStringList names;
- foreach (QGLSceneNode *object, d->sceneObjects) {
- if (object) {
- QString name = object->objectName();
- if (!name.isEmpty())
- names += name;
- }
- }
- return names;
-}
-
-/*!
- \qmlproperty bool Mesh::dumpInfo
-
- Flag set to true if the description of the item will be dumped to the console.
-
- When this flag is true, useful debugging and diagnostic information, for example the
- names of all the subnodes of the mesh, materials and geometry parameters, will be
- dumped to the console during the loading of the model.
-*/
-bool QDeclarativeMesh::dumpInfo() const
-{
- return d->dumpInfo;
-}
-
-void QDeclarativeMesh::setDumpInfo(bool enable)
-{
- if (enable != d->dumpInfo)
- {
- d->dumpInfo = enable;
- emit dumpInfoChanged();
- }
-}
-
-/*!
- \internal
- Set the \a scene associated with this mesh.
-
- The function attempts to load a meaningful scene if one exists, and will attempt to
- locate the section of the scene to which this mesh applies based on mesh-name.
-
- Failure to find an appropriate scene will generate the warning messages.
-
- It should be noted that for successful operation of this function, the appropriate plugin
- file reader should be built and installed. Failure to do so will result in a warning and
- failure to display the scene.
-
- \sa QGLAbstractScene
-*/
-void QDeclarativeMesh::setScene(QGLAbstractScene *scene)
-{
- delete d->scene;
- resetSceneBranches();
- d->scene = scene;
- if (!d->scene) {
- qWarning("Could not load %s (possibly plugin could not be found)",
- d->data.toString().toLatin1().constData());
- }
- else {
- QGLSceneNode *insertObject;
- initSceneObjectList();
- if (d->meshName.isEmpty())
- insertObject = getSceneObject();
- else
- insertObject = getSceneObject(d->meshName);
- //check if we found a valid/useful object to use based on the node name,
- //otherwise just output a list of valid names
- if (!insertObject && !d->meshName.isEmpty()) {
- qWarning() << "could not find" << d->meshName << "available:"
- << getSceneObjectNames();
- } else if (!insertObject) {
- qWarning() << "could not find main object in scene!";
- }
- //in either case we still need to add an object to the scene, so if we fail
- //we simply add a null value to indicate that this object is non-drawable
- addSceneBranch(insertObject);
-
-#ifndef QT_NO_DEBUG_STREAM
- if (insertObject && d->dumpInfo)
- {
- QGLSceneNode *node = qobject_cast<QGLSceneNode*>(insertObject);
- if (node)
- qDumpScene(node);
- }
-#endif
- }
- emit dataChanged();
- d->loaded = true;
- if (d->completed)
- emit loaded();
-}
-
-/*!
- \internal
- When a scene has been deconstructed into several branches, each one being a separately
- manipulated sub-branch of the whole, the branches taken are identified numerically. This
- function returns the next scene branch ID number
-*/
-int QDeclarativeMesh::nextSceneBranchId() const
-{
- //Retrieve the next unused scene branch ID
- return d->nextSceneBranchId;
-}
-
-/*!
- \internal
- This function "prunes" a specific branch away from the main scene-tree/graph and adds it to the
- list of independent branches drawn by the mesh. This facilitates animation & picking of specific
- sub-branches of the larger tree.
-
- The user specifies a sceneobject/node \a nodeName, which will form the "root" of the new branch,
- as well as a \a parent to which this branch shall be attached. Normally the branch will simply
- be given the original scene as its parent, so that all standard object hierarchy manipulation/
- destruction rules apply, however this \a parent parameter gives the user extra flexibility if
- required.
-*/
-int QDeclarativeMesh::createSceneBranch(QString nodeName, QObject *parent)
-{
- if (!d->scene) {
- qWarning() << "Unable to split mesh: no scene initialised - attempt to add scene object failed.";
- return -1;
- }
- else {
- int branchId = nextSceneBranchId();
- QGLSceneNode *sceneNode = getSceneObject(nodeName);
-#ifndef QT_NO_DEBUG_STREAM
- if (d->dumpInfo)
- qDumpScene(sceneNode);
-#endif
- if (sceneNode) {
- QGLSceneNode *parentNode = qobject_cast<QGLSceneNode *>(sceneNode->parent());
- QObject *prevParent=parentNode;
- if (parentNode)
- parentNode->removeNode(sceneNode); //this becomes irrelevant.
-
- //sceneNode->setParent(d->scene); //TODO: currently this fails as sceneNode changes make problems.
- //If no specific parent is nominated, use the scene specified by the mesh
- parent ? sceneNode->setParent(parent) : sceneNode->setParent(d->scene);
- addSceneBranch(sceneNode, prevParent);
-
- return branchId;
- }
- else {
- qWarning() << "Warning: Unable to find node " << nodeName << " in given mesh. Available nodes:"
- << getSceneObjectNames();
- return -1;
- }
- }
-}
-
-/*!
- \internal
- Given a scene object \a rootSceneObject, this function adds a pointer to the object to an internally
- maintained map of scene branches.
-
- The \a previousParent of \a rootSceneObject is also stored so that the object can be restored to its
- previous parent if necessary.
-*/
-int QDeclarativeMesh::addSceneBranch(QGLSceneNode *rootSceneObject, QObject *previousParent)
-{
- //when adding a new object to a mesh we also store the previous parent information
- //in case we wish to 'reattach' it to the parent at a later stage.
- QDeclarativeMeshPrivate::branchObject newBranch;
- newBranch.previousParent=previousParent;
- newBranch.rootSceneObject = rootSceneObject;
-
- d->sceneBranches.insert(d->nextSceneBranchId, newBranch);
-
- return ++d->nextSceneBranchId;
-}
-
-/*!
- \internal
- When an object is deleted or the user otherwise calls this function, the scene branch identified by
- \a branchId is reattached to the parent node from which it was originally pruned.
-
- If a problem occurs or the parent node is undefined (eg. null), an attempt is made to reattach it instead
- to the primary/default scene object/node, which corresponds to item 0 in the map.
-
- If the item selected is already the default item, and no parent can be found, it is deleted.
-*/
-void QDeclarativeMesh::restoreSceneBranch(int branchId)
-{
-
- if (d->sceneBranches.contains(branchId)) {
- qWarning() <<"Mesh does not contain branch " << branchId<<". Ignoring.\n";
- return;
- }
-
- QDeclarativeMeshPrivate::branchObject targetBranch = d->sceneBranches.value(branchId);
-
- if (!targetBranch.previousParent && branchId!=0) {
- targetBranch.rootSceneObject->setParent(getSceneObject());
- }
- else if (!targetBranch.previousParent){
- qWarning() << "Unable to find a parent to reattach default scene object to. Skipping.";
- targetBranch.rootSceneObject->setParent(d->scene);
- } else {
- targetBranch.rootSceneObject->setParent(targetBranch.previousParent);
- }
-
- if (!d->sceneBranches.remove(branchId)) {
- qWarning() << "Unable to remove branch "<<branchId<<" from Mesh. Ignoring.";
- }
-}
-
-/*!
- \internal
- Return a pointer to the scene branch identified by \a branchId.
-*/
-QGLSceneNode *QDeclarativeMesh::getSceneBranch(int branchId) const
-{
- if (!d->sceneBranches.contains(branchId)) return NULL;
- QDeclarativeMeshPrivate::branchObject targetBranch = d->sceneBranches.value(branchId);
- return targetBranch.rootSceneObject;
-}
-
-
-/*!
- \internal
- This function iterates through the list of scene branches in the internal map and attempts to
- restore them to their original position in the object hierarchy of the scene. It then clears the
- map ready for reuse.
-*/
-void QDeclarativeMesh::resetSceneBranches()
-{
- //Delete all "hanging" object entries in the scene branches list and return them
- //to their rightful place in their parent scene if possible.
- for (int i=1; i<d->nextSceneBranchId; i++) {
- restoreSceneBranch(i);
- }
-
- d->sceneBranches.clear();
- d->nextSceneBranchId = 0;
-}
-
-/*!
- \internal
- Core "draw" function for the mesh draws scene branch \a branchId using \a painter.
-*/
-void QDeclarativeMesh::draw(QGLPainter *painter, int branchId)
-{
- if (!d->sceneBranches.contains(branchId)) {
- qWarning() << "No scene object with ID: " << branchId << "for" << this;
- } else {
- QDeclarativeMeshPrivate::branchObject targetBranch = d->sceneBranches.value(branchId);
- targetBranch.rootSceneObject->draw(painter);
- }
-}
-
-/*!
- \internal
- Reference counting increment.
-*/
-void QDeclarativeMesh::ref()
-{
- ++(d->refCount);
-}
-
-/*!
- \internal
- Reference counting decrement; returns true if there are still outstanding references
- to the class.
-*/
-bool QDeclarativeMesh::deref()
-{
- --(d->refCount);
- return d->refCount > 0;
-}
-
-
-/*!
- Assign the mesh the material \a materialName from the \l QGLMaterialCollection class,
- and bind to the node identified by \a nodeName.
-
- Returns a pointer to the QGLMaterial material object \a materialName; or NULL if
- either there is no current scene, or if the scene does not contain such a material.
-*/
-QObject *QDeclarativeMesh::material(const QString& nodeName, const QString& materialName)
-{
- if (!d->scene)
- return 0;
-
- QGLSceneNode *sceneObject;
-
- if (nodeName.isEmpty())
- sceneObject = getSceneObject();
- else
- sceneObject = getSceneObject(nodeName);
-
- if (!sceneObject || materialName.isEmpty()) {
- qWarning() << "Attempt to get material data " <<materialName << " from scene node "
- << nodeName <<" failed.";
- return NULL;
- }
-
- QGLSceneNode *node = qobject_cast<QGLSceneNode *>(sceneObject);
-
- QGLMaterialCollection *p = node->palette();
-
- QGLMaterial *params = p->material(materialName);
- if (params && !d->connected.contains(params)) {
- d->connected.append(params);
- connect(params, SIGNAL(materialChanged()), this, SIGNAL(dataChanged()));
- }
- return params;
-}
-
-/*!
- \internal
-*/
-void QDeclarativeMesh::classBegin()
-{
-}
-
-/*!
- \internal
- Checks that all loading and initialisation has been finished, and emits the loaded() signal if
- the component is complete.
-
- \sa loaded()
-*/
-void QDeclarativeMesh::componentComplete()
-{
- d->completed = true;
- if (d->loaded)
- {
- emit loaded();
- emit nodeChanged();
- emit dataChanged();
- }
-}
-
-/*!
- \qmlsignal Mesh::onLoaded()
-
- This handler is called when mesh loading is complete.
-*/
-
-QT_END_NAMESPACE
diff --git a/src/quick3d/qdeclarativemesh.h b/src/quick3d/qdeclarativemesh.h
deleted file mode 100644
index d7eea5da..00000000
--- a/src/quick3d/qdeclarativemesh.h
+++ /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$
-**
-****************************************************************************/
-
-#ifndef QDECLARATIVEMESH_H
-#define QDECLARATIVEMESH_H
-
-#include "qt3dquickglobal.h"
-
-#include <QtCore/qobject.h>
-#include <QtCore/qurl.h>
-#include <QtDeclarative/qdeclarative.h>
-#include <QtDeclarative/qdeclarativeengine.h>
-#include <QtDeclarative/qdeclarativeparserstatus.h>
-
-#include "qglscenenode.h"
-#include "qglpainter.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(QtQuick3D)
-
-class QDeclarativeMeshPrivate;
-class QGLAbstractScene;
-class QGLMaterial;
-
-class Q_QT3D_QUICK_EXPORT QDeclarativeMesh : public QObject, public QDeclarativeParserStatus
-{
- Q_OBJECT
- Q_INTERFACES(QDeclarativeParserStatus)
- Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY dataChanged)
- Q_PROPERTY(QString meshName READ meshName WRITE setMeshName NOTIFY dataChanged)
- Q_PROPERTY(QString options READ options WRITE setOptions NOTIFY optionsChanged)
- Q_PROPERTY(QGLSceneNode *node READ getSceneObject NOTIFY nodeChanged)
- Q_PROPERTY(bool dumpInfo READ dumpInfo WRITE setDumpInfo NOTIFY dumpInfoChanged)
-
-public:
- QDeclarativeMesh(QObject *parent = 0);
- ~QDeclarativeMesh();
-
- QUrl source() const;
- void setSource(const QUrl& value);
-
- QString meshName() const;
- void setMeshName(const QString& value);
-
- QString options() const;
- void setOptions(const QString &);
-
- bool dumpInfo() const;
- void setDumpInfo(bool);
-
- virtual void draw(QGLPainter *painter, int branchId);
-
- //The following functions relate to allocating the scene and its
- //respective objects, and acessing these nodes.
- void setScene(QGLAbstractScene *scene);
- void initSceneObjectList();
- QStringList getSceneObjectNames();
- QGLSceneNode *getSceneObject();
- QGLSceneNode *getSceneObject(const QString &name);
-
- //The following functions relate to splitting the main scene into sub-branches
- int nextSceneBranchId() const;
- int createSceneBranch(QString nodeName, QObject *parent = 0);
- int addSceneBranch(QGLSceneNode *rootSceneObject, QObject *previousParent=NULL);
- void restoreSceneBranch(int branchId);
- void resetSceneBranches();
- QGLSceneNode *getSceneBranch(int branchId) const;
-
- void ref();
- bool deref();
-
- Q_INVOKABLE QObject *material(const QString& nodeName, const QString& materialName);
-
- void classBegin();
- void componentComplete();
-
-
-Q_SIGNALS:
- void dataChanged();
- void loaded();
- void optionsChanged();
- void dumpInfoChanged();
- void nodeChanged();
-
-private Q_SLOTS:
- void dataRequestFinished();
-
-private:
- QDeclarativeMeshPrivate *d;
-
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(QDeclarativeMesh)
-
-QT_END_HEADER
-
-#endif
diff --git a/src/quick3d/qdeclarativeview3d.cpp b/src/quick3d/qdeclarativeview3d.cpp
deleted file mode 100644
index 26cd31f5..00000000
--- a/src/quick3d/qdeclarativeview3d.cpp
+++ /dev/null
@@ -1,88 +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 "qdeclarativeview3d.h"
-#include <QtOpenGL/QGLWidget>
-
-/*!
- \qmlclass QDeclarativeView3D
- \brief The QDeclarativeView3D replaces the QDeclarativeView for applications
- using OpenGL.
- \since 4.8
- \ingroup qt3d::qml3d
-
- \section1 Usage
-
- This class is substituted for the QDeclarativeView class when creating
- Qt3D applications. It replaces the standard raster viewport with an OpenGL
- capable viewport suitable for rendering 3D content.
-*/
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \internal
-*/
-QDeclarativeView3D::QDeclarativeView3D(QWidget *parent) : QDeclarativeView(parent)
-{
- //Set up the GL viewport widget format in the same manner that
- //qmlviewer does when openGL is specified.
- QGLFormat format = QGLFormat::defaultFormat();
-#ifdef Q_WS_MAC
- format.setSampleBuffers(true);
-#else
- format.setSampleBuffers(false);
-#endif
-
- //Assign a GLWidget as the viewport.
- defaultViewportWidget = new QGLWidget(format);
- setViewport(defaultViewportWidget);
-}
-
-/*!
- \internal
-*/
-QDeclarativeView3D::~QDeclarativeView3D()
-{
- if (defaultViewportWidget) delete defaultViewportWidget;
-}
-
-QT_END_NAMESPACE
diff --git a/src/quick3d/qdeclarativeview3d.h b/src/quick3d/qdeclarativeview3d.h
deleted file mode 100644
index 0ab65690..00000000
--- a/src/quick3d/qdeclarativeview3d.h
+++ /dev/null
@@ -1,70 +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 QDECLARATIVEVIEW3D_H
-#define QDECLARATIVEVIEW3D_H
-
-#include <QtDeclarative/qdeclarativeview.h>
-#include "qt3dquickglobal.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(QtQuick3D)
-
-class QGLWidget;
-
-class Q_QT3D_QUICK_EXPORT QDeclarativeView3D : public QDeclarativeView
-{
-public:
- QDeclarativeView3D(QWidget *parent = 0);
- ~QDeclarativeView3D();
-
-protected:
- QGLWidget *defaultViewportWidget;
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/quick3d/qdeclarativeviewport.h b/src/quick3d/qdeclarativeviewport.h
deleted file mode 100644
index 8dc501aa..00000000
--- a/src/quick3d/qdeclarativeviewport.h
+++ /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 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 QDECLARATIVEVIEWPORT_H
-#define QDECLARATIVEVIEWPORT_H
-
-#include "qt3dquickglobal.h"
-#include <QtCore/qobject.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(QtQuick3D)
-
-class QDeclarativeItem3D;
-
-// Abstract interface for "Item3D" getting access to the "Viewport"
-// item in the QML/3D plugin.
-class Q_QT3D_QUICK_EXPORT QDeclarativeViewport
-{
-public:
- virtual int registerPickableObject(QObject *obj) = 0;
- virtual void update3d() = 0;
- virtual bool blending() const = 0;
-
- void setItemViewport(QDeclarativeItem3D *item);
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/quick3d/qt3dquickglobal.h b/src/quick3d/qt3dquickglobal.h
deleted file mode 100644
index 1e14d3e7..00000000
--- a/src/quick3d/qt3dquickglobal.h
+++ /dev/null
@@ -1,73 +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 QT3DQUICKGLOBAL_H
-#define QT3DQUICKGLOBAL_H
-
-#include <QtCore/qglobal.h>
-
-QT_LICENSED_MODULE(QtQuick3D)
-#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
-# if defined(QT_NODLL)
-# undef QT_MAKEDLL
-# undef QT_DLL
-# elif defined(QT_MAKEDLL) /* create a Qt DLL library */
-# if defined(QT_DLL)
-# undef QT_DLL
-# endif
-# if defined(QT_BUILD_QT3D_QUICK_LIB)
-# define Q_QT3D_QUICK_EXPORT Q_DECL_EXPORT
-# else
-# define Q_QT3D_QUICK_EXPORT Q_DECL_IMPORT
-# endif
-# elif defined(QT_DLL) /* use a Qt DLL library */
-# define Q_QT3D_QUICK_EXPORT Q_DECL_IMPORT
-# endif
-#endif
-#if !defined(Q_QT3D_QUICK_EXPORT)
-# if defined(QT_SHARED)
-# define Q_QT3D_QUICK_EXPORT Q_DECL_EXPORT
-# else
-# define Q_QT3D_QUICK_EXPORT
-# endif
-#endif
-
-#endif
diff --git a/src/quick3d/quick3d.pri b/src/quick3d/quick3d.pri
deleted file mode 100644
index 97a637de..00000000
--- a/src/quick3d/quick3d.pri
+++ /dev/null
@@ -1,18 +0,0 @@
-INCLUDEPATH += $$PWD
-VPATH += $$PWD
-
-HEADERS += \
- qt3dquickglobal.h \
- qdeclarativeitem3d.h \
- qdeclarativeeffect.h \
- qdeclarativemesh.h \
- qdeclarativeview3d.h \
- qdeclarativeviewport.h
-
-
-SOURCES += \
- qdeclarativeeffect.cpp \
- qdeclarativeitem3d.cpp \
- qdeclarativeview3d.cpp \
- qdeclarativemesh.cpp
-
diff --git a/src/quick3d/quick3d.pro b/src/quick3d/quick3d.pro
deleted file mode 100644
index d4b005f6..00000000
--- a/src/quick3d/quick3d.pro
+++ /dev/null
@@ -1,123 +0,0 @@
-TEMPLATE = lib
-TARGET = Qt3DQuick$${QT_LIBINFIX}
-gcov {
- CONFIG += staticlib warn_on
- QMAKE_CXXFLAGS += -fprofile-arcs -ftest-coverage
- QMAKE_LFLAGS += -fprofile-arcs -ftest-coverage
-} else {
- CONFIG += dll warn_on
-}
-
-QT += declarative
-
-include(../../pkg.pri)
-
-# See the README in the root dir re this code
-package {
- macx:CONFIG(qt_framework, qt_framework|qt_no_framework) {
- LIBS += -framework Qt3D -F../threed
- INCLUDEPATH += ../threed/Qt3D.framework/Versions/1/Headers
- } else {
- win32 {
- CONFIG(debug, debug|release) {
- LIBS += ..\\threed\\debug\\Qt3Dd.lib
- } else {
- LIBS += ..\\threed\\release\\Qt3D.lib
- }
- } else {
- LIBS += -L../threed -lQt3D
- }
- INCLUDEPATH += ../../include/Qt3D
- }
- win32 {
- target.path = $$QT3D_INSTALL_BINS
- } else {
- target.path = $$QT3D_INSTALL_LIBS
- }
- INSTALLS += target
- QT += opengl network
-} else {
- CONFIG += qt3d
- DESTDIR = $$QT3D_INSTALL_LIBS
-}
-
-win32 {
- !static:DEFINES += QT_MAKEDLL
- package {
- installDll.path = $$QT3D_INSTALL_BINS
- installDll.files = $$DESTDIR_TARGET
- INSTALLS += installDll
- } else {
- DLLDESTDIR = $$QT3D_INSTALL_BINS
- }
- CONFIG(debug, debug|release) {
- TARGET = $$member(TARGET, 0)d
- }
-}
-
-symbian {
- DEFINES += QT_MAKEDLL
- CONFIG += epocallowdlldata
- MMP_RULES += EXPORTUNFROZEN
- LIBS += -lQt3D$${QT_LIBINFIX}
- TARGET.UID3 = 0x20031E96
- TARGET.CAPABILITY = All -Tcb
-}
-
-include(quick3d.pri)
-
-PUBLIC_HEADERS = $$HEADERS
-HEADERS += $$PRIVATE_HEADERS
-DEFINES += QT_BUILD_QT3D_QUICK_LIB
-
-!contains(QT_CONFIG, egl):DEFINES += QT_NO_EGL
-
-package {
- distInstalls.files = $$PUBLIC_HEADERS
- distInstalls.path = $$QT3D_INSTALL_HEADERS/Qt3DQuick
- INSTALLS += distInstalls
-}
-
-# If Qt has been configured to build frameworks, then the build will put
-# the Qt3DQuick library into a framework bundle, so put the headers in the bundle
-# as well. Other OS's, or mac without frameworks, install the headers into
-# the Qt build tree directly.
-macx:CONFIG(qt_framework, qt_framework|qt_no_framework) {
- QMAKE_LFLAGS_SONAME = -Wl,-install_name,$$DESTDIR/
- CONFIG += lib_bundle
- FRAMEWORK_HEADERS.version = Versions
- FRAMEWORK_HEADERS.path = Headers
- FRAMEWORK_HEADERS.files = $$PUBLIC_HEADERS
- QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS
-} else {
- exportHeaders.input = PUBLIC_HEADERS
- package {
- # in the package case we need the headers for the actual build, the
- # distInstalls stanza above takes care of packaging the headers for the dev pkg
- exportHeaders.output = ../../include/Qt3DQuick/${QMAKE_FILE_IN_BASE}${QMAKE_FILE_EXT}
- } else {
- !maemo: exportHeaders.output = $$[QT_INSTALL_HEADERS]/Qt3DQuick/${QMAKE_FILE_IN_BASE}${QMAKE_FILE_EXT}
- }
- exportHeaders.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
- exportHeaders.CONFIG += no_link_no_clean
- exportHeaders.variable_out = PRE_TARGETDEPS
- QMAKE_EXTRA_COMPILERS += exportHeaders
-}
-
-symbian {
- load(data_caging_paths)
-
- qt3dMwHeaders = *.h
- for(api,qt3dMwHeaders) {
- entries=$$files($$api);
- #files() attaches a ';' at the end which needs to be removed
- entries=$$replace(entries, ;,)
- for(entry,entries) {
- exists($$entry) {
- contains(PUBLIC_HEADERS, $$basename(entry)) {
- BLD_INF_RULES.prj_exports += "$$entry $$MW_LAYER_PUBLIC_EXPORT_PATH(Qt3DQuick/$$basename(entry))"
- }
- }
- }
- }
-}
diff --git a/src/scripts/LICENSE.LGPL.txt b/src/scripts/LICENSE.LGPL.txt
deleted file mode 100644
index 2db28fb5..00000000
--- a/src/scripts/LICENSE.LGPL.txt
+++ /dev/null
@@ -1,514 +0,0 @@
- GNU LESSER GENERAL PUBLIC LICENSE
-
- The Qt GUI Toolkit is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
- Contact: Nokia Corporation (qt-info@nokia.com)
-
- You may use, distribute and copy the Qt GUI Toolkit under the terms of
- GNU Lesser General Public License version 2.1, which is displayed below.
-
--------------------------------------------------------------------------
-
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL. It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
- This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it. You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
- When we speak of free software, we are referring to freedom of use,
-not price. Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
- To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights. These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
- For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you. You must make sure that they, too, receive or can get the source
-code. If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it. And you must show them these terms so they know their rights.
-
- We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
- To protect each distributor, we want to make it very clear that
-there is no warranty for the free library. Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-
- Finally, software patents pose a constant threat to the existence of
-any free program. We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder. Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
- Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License. This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License. We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
- When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library. The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom. The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
- We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License. It also provides other free software developers Less
-of an advantage over competing non-free programs. These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries. However, the Lesser license provides advantages in certain
-special circumstances.
-
- For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard. To achieve this, non-free programs must be
-allowed to use the library. A more frequent case is that a free
-library does the same job as widely used non-free libraries. In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
- In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software. For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
- Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
- The precise terms and conditions for copying, distribution and
-modification follow. Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library". The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-
- GNU LESSER GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
- A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
- The "Library", below, refers to any such software library or work
-which has been distributed under these terms. A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language. (Hereinafter, translation is
-included without limitation in the term "modification".)
-
- "Source code" for a work means the preferred form of the work for
-making modifications to it. For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
- Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it). Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
- 1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
- You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
- 2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) The modified work must itself be a software library.
-
- b) You must cause the files modified to carry prominent notices
- stating that you changed the files and the date of any change.
-
- c) You must cause the whole of the work to be licensed at no
- charge to all third parties under the terms of this License.
-
- d) If a facility in the modified Library refers to a function or a
- table of data to be supplied by an application program that uses
- the facility, other than as an argument passed when the facility
- is invoked, then you must make a good faith effort to ensure that,
- in the event an application does not supply such function or
- table, the facility still operates, and performs whatever part of
- its purpose remains meaningful.
-
- (For example, a function in a library to compute square roots has
- a purpose that is entirely well-defined independent of the
- application. Therefore, Subsection 2d requires that any
- application-supplied function or table used by this function must
- be optional: if the application does not supply it, the square
- root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library. To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License. (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.) Do not make any other change in
-these notices.
-
- Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
- This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
- 4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
- If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library". Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
- However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library". The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
- When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library. The
-threshold for this to be true is not precisely defined by law.
-
- If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work. (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
- Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
- 6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
- You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License. You must supply a copy of this License. If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License. Also, you must do one
-of these things:
-
- a) Accompany the work with the complete corresponding
- machine-readable source code for the Library including whatever
- changes were used in the work (which must be distributed under
- Sections 1 and 2 above); and, if the work is an executable linked
- with the Library, with the complete machine-readable "work that
- uses the Library", as object code and/or source code, so that the
- user can modify the Library and then relink to produce a modified
- executable containing the modified Library. (It is understood
- that the user who changes the contents of definitions files in the
- Library will not necessarily be able to recompile the application
- to use the modified definitions.)
-
- b) Use a suitable shared library mechanism for linking with the
- Library. A suitable mechanism is one that (1) uses at run time a
- copy of the library already present on the user's computer system,
- rather than copying library functions into the executable, and (2)
- will operate properly with a modified version of the library, if
- the user installs one, as long as the modified version is
- interface-compatible with the version that the work was made with.
-
- c) Accompany the work with a written offer, valid for at
- least three years, to give the same user the materials
- specified in Subsection 6a, above, for a charge no more
- than the cost of performing this distribution.
-
- d) If distribution of the work is made by offering access to copy
- from a designated place, offer equivalent access to copy the above
- specified materials from the same place.
-
- e) Verify that the user has already received a copy of these
- materials or that you have already sent this user a copy.
-
- For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it. However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
- It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system. Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
- 7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
- a) Accompany the combined library with a copy of the same work
- based on the Library, uncombined with any other library
- facilities. This must be distributed under the terms of the
- Sections above.
-
- b) Give prominent notice with the combined library of the fact
- that part of it is a work based on the Library, and explaining
- where to find the accompanying uncombined form of the same work.
-
- 8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License. Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License. However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
- 9. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Library or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
- 10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-
- 11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all. For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded. In such case, this License incorporates the limitation as if
-written in the body of this License.
-
- 13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation. If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
- 14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission. For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this. Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
- NO WARRANTY
-
- 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Libraries
-
- If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change. You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
- To apply these terms, attach the following notices to the library. It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
- <one line to give the library's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the
- library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
- <signature of Ty Coon>, 1 April 1990
- Ty Coon, President of Vice
-
-That's all there is to it!
-
-
diff --git a/src/scripts/README b/src/scripts/README
deleted file mode 100644
index aa49d282..00000000
--- a/src/scripts/README
+++ /dev/null
@@ -1,39 +0,0 @@
-This directory contains miscellaneous utility scripts for use with Qt3D.
-
-filter-qmldump.pl
-=================
-
-Use this script to regenerate the library.xml files after making changes
-to the properties or structure of the QML bindings.
-
-It expects a file called "library.xml" to be in the current directory, and
-requires a single command line argument, which is a string matching the
-module name to filter on.
-
-Typical use:
-
-1) Build and install Qt3D into a given Qt at $QTDIR
-2) Ensure qmldump is available in your $PATH (see below)
-3) Run qmldump to generate the library.xml file:
- qmldump $QTDIR/imports Qt3D > library.xml
-4) Filter the output to just include the Qt3D module:
- filter-qmldump.pl Qt3D > library-qt3d.xml
-
-Repeat 3) & 4) for the Shapes library:
- qmldump $QTDIR/imports/Shapes Qt3D.Shapes > library.xml
- filter-qmldump.pl Qt3D > library-qt3d.xml
-
-To generate the plugins.qmltypes, you first need a qmldump binary generated from
-sources shipped with Qt Creator version less than 2.2. On Mac these are inside
-the app bundle, other platforms vary. If all else fails get the sources from the
-Qt Creator repo.
-
-To build qmldump you need access to private headers, so therefore it must be
-built against a source build of Qt. On Mac it is helpful to build qmldump with
-"qmake CONFIG-=app_bundle" so that you get a regular command-line binary.
-
-In the above note that $QTDIR points to the root of the Qt where Qt3D is installed.
-
-Check the contents of library.xml above and ensure it is XML - not yaml. If you
-see some curly braces { } - then the version of qmldump source you used was for
-Qt Creator > 2.2 - you somehow have the later version qmldump sources.
diff --git a/src/scripts/build_mac_package.sh b/src/scripts/build_mac_package.sh
deleted file mode 100755
index 39fbc387..00000000
--- a/src/scripts/build_mac_package.sh
+++ /dev/null
@@ -1,125 +0,0 @@
-#!/bin/bash
-#############################################################################
-##
-## 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$
-##
-#############################################################################
-
-set -e
-
-APP=QtQuick3D
-
-PRO=quick3d.pro
-
-if [[ -z "$1" ]]; then
- echo "Usage: build_bundle.sh 1.2.3"
- echo "(where 1.2.3 is the version number)"
- exit 1;
-fi
-
-if [[ ! -f ./quick3d.pro ]]; then
- echo "Could not find quick3d.pro in current directory."
- echo "This script should be run from the root of a Qt3D source tree."
- exit 1;
-fi
-
-VER=$1
-
-echo "Building ${APP}..."
-qmake -makefile -spec macx-g++ -r CONFIG+=release CONFIG+=package quick3d.pro
-make $(JOBS)
-
-DIST=dist
-DEV=dev
-DEV_PKG_ROOT="$DIST/$DEV/Pkg_Root"
-mkdir -p $DEV_PKG_ROOT
-INSTALL_ROOT=$PWD/dist/dev/Pkg_Root make $(JOBS) install
-
-make docs
-DOC_LOC="Developer/Documentation/QtQuick3D"
-mkdir -p "$DEV_PKG_ROOT/$DOC_LOC"
-mv doc/html "$DEV_PKG_ROOT/$DOC_LOC"
-
-DEV_PKG_RES="$DIST/$DEV/Resources"
-mkdir -p $DEV_PKG_RES
-cp src/scripts/mac_installer_background.png $DEV_PKG_RES/background.png
-
-XMPL=examples
-XMPL_PKG_ROOT="$DIST/$XMPL/Pkg_Root"
-mkdir -p "$XMPL_PKG_ROOT"
-
-XMPL_PKG_RES="$DIST/$XMPL/Resources"
-mkdir -p $XMPL_PKG_RES
-cp src/scripts/mac_installer_background.png $XMPL_PKG_RES/background.png
-
-XMPL_LOC="Applications/QtQuick3D Examples"
-mkdir -p "${XMPL_PKG_ROOT}/$XMPL_LOC"
-mv "${DEV_PKG_ROOT}/Developer/Tools/Qt" "${XMPL_PKG_ROOT}/$XMPL_LOC"
-
-RELEASE_DIR="../${APP}-${VER}"
-mkdir -p "${RELEASE_DIR}"
-
-# http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/packagemaker.1.html
-# ...or see $PKGMKR -help for options
-# some useful tips at http://homepage.mac.com/simx/technonova/tips/packagemaker_and_installer.html
-# but a bit out of date - eg options now have --switch syntax and plist files are not used
-
-PKGMGR="/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker"
-
-## TODO: create VolumeCheck script to ensure 4.7.2 is installed
-PKG="${RELEASE_DIR}/${APP}-${VER}-${DEV}.pkg"
-$PKGMGR --root "$DEV_PKG_ROOT" \
- --id "com.nokia.qtquick3d.${DEV}" \
- --resources "$DEV_PKG_RES" \
- --title "Core Developer Tools" \
- --target 10.5 --version "$VER" --verbose --out "$PKG"
-
-PKG="${RELEASE_DIR}/${APP}-${VER}-${XMPL}.pkg"
-$PKGMGR --root "$XMPL_PKG_ROOT" \
- --id "com.nokia.qtquick3d.${XMPL}" \
- --resources "$XMPL_PKG_RES" \
- --title "Example Applications" \
- --target 10.5 --version "$VER" --verbose --out "$PKG"
-
-DMG="../${APP}-${VER}.dmg"
-
-echo "Placing packages into disk image"
-hdiutil create -srcfolder ${RELEASE_DIR} ${DMG}
-hdiutil internet-enable -yes ${DMG}
-
-echo "New distributable ready in ${DMG}"
diff --git a/src/scripts/build_src_package.sh b/src/scripts/build_src_package.sh
deleted file mode 100755
index 70d51884..00000000
--- a/src/scripts/build_src_package.sh
+++ /dev/null
@@ -1,87 +0,0 @@
-#!/bin/bash
-#############################################################################
-##
-## 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$
-##
-#############################################################################
-
-
-usage() {
- cat <<USAGE
-usage:
- $0 <refspec> <version>
-
- Creates tar and zip source package from <refspec> and documentation-zip from current checkout.
- Run it from inside [a copy of] the git checkout of qt3d source.
-
- Generated package files and directories are named after <version>.
-
- Make sure the bin path for a valid Qt with qdoc3 is in the $PATH.
-
- example:
- env PATH=/path/to/Qt/bin:$PATH src/scripts/build_src_package.sh origin/tp1 1.0-tp1
-USAGE
- exit 1
-}
-
-## Command line parameters
-if [[ $# != 2 ]]; then
- usage;
-fi
-
-set -e
-
-QDOC3=$(qmake -query QT_INSTALL_BINS)/qdoc3
-
-echo "Using Qt ${QDOC3} to build doc"
-test -f quick3d.pro || usage
-
-BRANCH=$1
-VERSION=$2
-echo "Creating tar archive..."
-git archive --format=tar --prefix=qtquick3d-${VERSION}-src/ ${BRANCH} | gzip > ../qtquick3d-${VERSION}-src.tar.gz || exit 1
-echo "Creating zip archive..."
-git archive --format=zip --prefix=qtquick3d-${VERSION}-src/ ${BRANCH} > ../qtquick3d-${VERSION}-src.zip || exit 1
-echo "Creating documentation..."
-rm -r -f doc/html
-qmake quick3d.pro -spec macx-g++ CONFIG+=package >/dev/null || exit 1
-make docs || exit 1
-cd doc
-cp -r html qtquick3d-${VERSION}
-zip -r ../../qtquick3d-${VERSION}-doc.zip qtquick3d-${VERSION} >/dev/null
-rm -r qtquick3d-${VERSION}
diff --git a/src/scripts/build_win_package.bat b/src/scripts/build_win_package.bat
deleted file mode 100644
index f428d2e1..00000000
--- a/src/scripts/build_win_package.bat
+++ /dev/null
@@ -1,88 +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 FOO 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$
-::
-:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
-::
-:: Before running this script ensure that the %PATH% has the location of:
-:: - the correct qmake for the Qt to build against
-:: - the compiler and build tools, eg nmake
-:: for these first two, use the C:\Qt\<ver>\bin\qtvars.bat vsvars command
-:: - NSIS compiler, "makensis"
-:: set PATH=%PATH%;"C:\Program Files (x86)\NSIS"
-:: NSIS needs the custom license plugin - if its not installed get it
-:: from http://nsis.sourceforge.net/CustomLicense_plug-in
-:: Run this script from the root of a complete source tree of Qt3D, eg
-:: mkdir C:\build\qt
-:: cd C:\build\qt
-:: mkdir quick3d_mk_win_pkg
-:: echo .git >exclude
-:: xcopy /EXCLUDE:exclude /S C:\depot\qt\quick3d quick3d_mk_win_pkg
-:: cd quick3d_mk_win_pkg
-:: Use jom if possible - put jom in the path if you want faster compiles
-:: set PATH=%PATH%;C:\QtSDK\QtCreator\bin
-:: src\scripts\build_win_package.bat
-
-where jom.exe
-if %ERRORLEVEL% NEQ 0 (
- SET MAKE_PRG=nmake
-) else (
- SET MAKE_PRG=jom
-)
-
-mkdir tmp
-
-qmake -query QT_VERSION >tmp\qt_version
-set /P QT_VERSION= <tmp\qt_version
-
-qmake -query QT_INSTALL_PREFIX >tmp\qt_prefix
-set /P QT_PREFIX= <tmp\qt_prefix
-set QT_PREFIX_PATH=%QT_PREFIX:~2%
-
-:: On windows if the qt3d.prf and qt3dquick.prf exist in the Qt, the build will fail
-:: with impenetrable link errors. This should not happen but might if you are trying
-:: to debug the installer scripts, and do something odd.
-del %QTDIR%\mkspecs\features\qt3d*
-
-qmake.exe quick3d.pro -spec win32-msvc2008 CONFIG+=release CONFIG+=package
-
-:: This has to be the full path, but without the drive letter...
-set INSTALL_ROOT=%CD:~2%\tmp
-%MAKE_PRG% install
-%MAKE_PRG% docs
-makensis /DQT_VERSION=%QT_VERSION% /DQT_PREFIX_PATH=%QT_PREFIX_PATH% /NOCD src\scripts\build_win_package.nsi
diff --git a/src/scripts/build_win_package.nsi b/src/scripts/build_win_package.nsi
deleted file mode 100644
index b20f4add..00000000
--- a/src/scripts/build_win_package.nsi
+++ /dev/null
@@ -1,218 +0,0 @@
-!include LogicLib.nsh
-!include nsDialogs.nsh
-
-!define PRODUCT_NAME "QtQuick3D"
-!define PRODUCT_VERSION "1.0-tp1"
-!define PRODUCT_PUBLISHER "Nokia"
-!define PRODUCT_WEB_SITE "http://doc.qt.nokia.com/qt-quick3d-snapshot/"
-!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\qglinfo.exe"
-!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
-!define PRODUCT_UNINST_ROOT_KEY "HKLM"
-
-; MUI 1.67 compatible ------
-!include "MUI.nsh"
-
-; MUI Settings
-!define MUI_ABORTWARNING
-!define MUI_ICON "src\scripts\qtquick3d.ico"
-!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
-!define MUI_WELCOMEFINISHPAGE_BITMAP "src\scripts\win_installer_background.bmp"
-!define MUI_WELCOMEPAGE_TITLE "${PRODUCT_NAME} Setup"
-!define MUI_WELCOMEPAGE_TEXT "${PRODUCT_NAME} will be installed into Qt ${QT_VERSION}, found in $INSTDIR. If you do not want ${PRODUCT_NAME} installed there, click cancel below."
-
-; Welcome page
-!insertmacro MUI_PAGE_WELCOME
-; License page
-!insertmacro MUI_PAGE_LICENSE "src\scripts\LICENSE.LGPL.txt"
-; Directory page
-; Disable this since we only install where we detect the right Qt
-; !insertmacro MUI_PAGE_DIRECTORY
-; Instfiles page
-!insertmacro MUI_PAGE_INSTFILES
-!define MUI_FINISHPAGE_NOAUTOCLOSE
-; Finish page
-Page custom DisplayWelcomeMessage
-!define MUI_FINISHPAGE_RUN $INSTDIR\quick3d\bin\run_start_program.bat
-!define MUI_FINISHPAGE_RUN_TEXT "Run QtQuick3D QGLInfo program"
-!define MUI_FINISHPAGE_LINK "QtQuick3D documentation"
-!define MUI_FINISHPAGE_LINK_LOCATION $INSTDIR\quick3d\doc\html\index.html
-
-!insertmacro MUI_PAGE_FINISH
-
-; Uninstaller pages
-!insertmacro MUI_UNPAGE_INSTFILES
-
-; Language files
-!insertmacro MUI_LANGUAGE "English"
-
-; MUI end ------
-
-; Where make install puts all the files
-!define MK_INST_ROOT tmp
-
-Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
-OutFile "${PRODUCT_NAME}-${PRODUCT_VERSION}.exe"
-InstallDir "$PROGRAMFILES\Qt\${PRODUCT_VERSION}\quick3d"
-InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
-ShowInstDetails show
-ShowUnInstDetails show
-
-; HKCU\Software\Trolltech\Versions\DefaultQtVersion REG_SZ "${QT_VERSION}"
-; HKCU\Software\Trolltech\Versions\${QT_VERSION}\InstallDir REG_SZ "C:\Qt\${QT_VERSION}"
-
-Function .onInit
- LogSet on
- ReadRegStr $0 HKCU "Software\Trolltech\Versions\${QT_VERSION}" "InstallDir"
- ${If} $0 == ""
- MessageBox MB_ICONEXCLAMATION "Please install Qt v${QT_VERSION} MSVC from http:\\qt.nokia.com\downloads before installing ${PRODUCT_NAME} ${PRODUCT_VERSION}"
- Abort
- ${EndIf}
- StrCpy $INSTDIR $0
-FunctionEnd
-
-Function DisplayWelcomeMessage
- ; Create the temporary plugins directory
- InitPluginsDir
-
- ; Put the welcome message in the temporary plugins directory.
- ; The plugins directory is deleted when the installer quits.
- File "/oname=$PLUGINSDIR\windows-install.txt" "src\scripts\windows-install.txt"
-
- nsDialogs::Create 1018
- Pop $0
-
- nsDialogs::CreateControl /NOUNLOAD ${__NSD_Text_CLASS} ${DEFAULT_STYLES}|${WS_TABSTOP}|${ES_MULTILINE} ${__NSD_Text_EXSTYLE} 20 45 325 200 ''
- Pop $1
-
- CustomLicense::LoadFile "$PLUGINSDIR\windows-install.txt" $1
- nsDialogs::Show
-
-FunctionEnd
-
-Section "MainSection" SEC01
- SetOverwrite try
- CreateDirectory "$SMPROGRAMS\QtQuick3D"
- CreateDirectory "$SMPROGRAMS\QtQuick3D\Examples"
- CreateDirectory "$SMPROGRAMS\QtQuick3D\Demos"
-
- ; For the CreateShortCut command, the outpath is actually used for the working directory.
- ; By setting $INSTDIR\bin to the working directory all these lnk targets should be able
- ; to find their dependent dll's without needing to set the path
- SetOutPath "$INSTDIR\bin"
- CreateShortCut "$SMPROGRAMS\QtQuick3D\QtQuick3D.lnk" "$INSTDIR\quick3d\bin\qglinfo.exe"
- CreateShortCut "$DESKTOP\QtQuick3D.lnk" "$INSTDIR\quick3d\bin\qglinfo.exe"
- CreateShortCut "$SMPROGRAMS\QtQuick3D\Examples\Basket.lnk" "$INSTDIR\quick3d\bin\basket_qml.exe"
- CreateShortCut "$SMPROGRAMS\QtQuick3D\Examples\Cube.lnk" "$INSTDIR\quick3d\bin\cube_qml.exe"
- CreateShortCut "$SMPROGRAMS\QtQuick3D\Examples\Forest.lnk" "$INSTDIR\quick3d\bin\forest_qml.exe"
- CreateShortCut "$SMPROGRAMS\QtQuick3D\Examples\Lander.lnk" "$INSTDIR\quick3d\bin\lander.exe"
- CreateShortCut "$SMPROGRAMS\QtQuick3D\Examples\Matrix Animation.lnk" "$INSTDIR\quick3d\bin\matrix_animation.exe"
- CreateShortCut "$SMPROGRAMS\QtQuick3D\Examples\Monkey God.lnk" "$INSTDIR\quick3d\bin\monkeygod.exe"
- CreateShortCut "$SMPROGRAMS\QtQuick3D\Examples\Moon.lnk" "$INSTDIR\quick3d\bin\moon.exe"
- CreateShortCut "$SMPROGRAMS\QtQuick3D\Examples\Photo Room.lnk" "$INSTDIR\quick3d\bin\photoroom.exe"
- CreateShortCut "$SMPROGRAMS\QtQuick3D\Examples\Shaders.lnk" "$INSTDIR\quick3d\bin\shaders.exe"
- CreateShortCut "$SMPROGRAMS\QtQuick3D\Examples\Sphere.lnk" "$INSTDIR\quick3d\bin\sphere.exe"
- CreateShortCut "$SMPROGRAMS\QtQuick3D\Examples\Teapot.lnk" "$INSTDIR\quick3d\bin\teapot_qml.exe"
- CreateShortCut "$SMPROGRAMS\QtQuick3D\Examples\Teapot Bounce.lnk" "$INSTDIR\quick3d\bin\teapot_bounce_qml.exe"
- CreateShortCut "$SMPROGRAMS\QtQuick3D\Examples\Basket (C++).lnk" "$INSTDIR\quick3d\bin\basket.exe"
- CreateShortCut "$SMPROGRAMS\QtQuick3D\Examples\Builder.lnk" "$INSTDIR\quick3d\bin\builder.exe"
- CreateShortCut "$SMPROGRAMS\QtQuick3D\Examples\Cube (C++).lnk" "$INSTDIR\quick3d\bin\cube.exe"
- CreateShortCut "$SMPROGRAMS\QtQuick3D\Examples\Cylinder.lnk" "$INSTDIR\quick3d\bin\cylinder.exe"
- CreateShortCut "$SMPROGRAMS\QtQuick3D\Examples\Geometry.lnk" "$INSTDIR\quick3d\bin\geometry.exe"
- CreateShortCut "$SMPROGRAMS\QtQuick3D\Examples\Graphicsview.lnk" "$INSTDIR\quick3d\bin\graphicsview.exe"
- CreateShortCut "$SMPROGRAMS\QtQuick3D\Examples\Nesting.lnk" "$INSTDIR\quick3d\bin\nesting.exe"
- CreateShortCut "$SMPROGRAMS\QtQuick3D\Examples\Tank.lnk" "$INSTDIR\quick3d\bin\tank.exe"
- CreateShortCut "$SMPROGRAMS\QtQuick3D\Examples\Teapot (C++).lnk" "$INSTDIR\quick3d\bin\teapot.exe"
- CreateShortCut "$SMPROGRAMS\QtQuick3D\Demos\Model Viewer.lnk" "$INSTDIR\quick3d\bin\model_viewer.exe"
- CreateShortCut "$SMPROGRAMS\QtQuick3D\Demos\Robo Bounce.lnk" "$INSTDIR\quick3d\bin\robo_bounce.exe"
- CreateShortCut "$SMPROGRAMS\QtQuick3D\Demos\Tea Service.lnk" "$INSTDIR\quick3d\bin\tea_service.exe"
- CreateShortCut "$SMPROGRAMS\QtQuick3D\Demos\Cube House.lnk" "$INSTDIR\quick3d\bin\cubehouse.exe"
- CreateShortCut "$SMPROGRAMS\QtQuick3D\Demos\Page Flip.lnk" "$INSTDIR\quick3d\bin\pageflip.exe"
- CreateShortCut "$SMPROGRAMS\QtQuick3D\Demos\Photo-browser 3D.lnk" "$INSTDIR\quick3d\bin\photobrowser3d.exe"
- CreateShortCut "$SMPROGRAMS\QtQuick3D\Demos\Shapes.lnk" "$INSTDIR\quick3d\bin\shapes.exe"
- CreateShortCut "$SMPROGRAMS\QtQuick3D\Demos\Tea Service (C++).lnk" "$INSTDIR\quick3d\bin\teaservice.exe"
-
- ; bin imports include lib mkspecs plugins quick3d
- SetOutPath "$INSTDIR\quick3d\bin"
- File "${MK_INST_ROOT}${QT_PREFIX_PATH}\bin\*.exe"
- File /r "${MK_INST_ROOT}${QT_PREFIX_PATH}\quick3d\resources"
- SetOutPath "$INSTDIR\lib"
- File "${MK_INST_ROOT}${QT_PREFIX_PATH}\bin\*.lib"
- SetOutPath "$INSTDIR\quick3d\doc"
- File /r "doc\html"
- SetOutPath "$INSTDIR\bin"
- File "${MK_INST_ROOT}${QT_PREFIX_PATH}\bin\*.dll"
- SetOutPath "$INSTDIR"
- File /r "${MK_INST_ROOT}${QT_PREFIX_PATH}\imports"
- File /r "${MK_INST_ROOT}${QT_PREFIX_PATH}\include"
- File /r "${MK_INST_ROOT}${QT_PREFIX_PATH}\mkspecs"
- File /r "${MK_INST_ROOT}${QT_PREFIX_PATH}\plugins"
-
- ClearErrors
- FileOpen $0 $INSTDIR\quick3d\bin\run_start_program.bat w
- IfErrors done
- FileWrite $0 "start /D $INSTDIR\bin $INSTDIR\quick3d\bin\qglinfo.exe"
- FileClose $0
- done:
-SectionEnd
-
-Section -AdditionalIcons
- SetOutPath $INSTDIR
- WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
- CreateShortCut "$SMPROGRAMS\QtQuick3D\Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url"
- CreateShortCut "$SMPROGRAMS\QtQuick3D\Uninstall.lnk" "$INSTDIR\quick3d\uninst.exe"
-SectionEnd
-
-Section -Post
- WriteUninstaller "$INSTDIR\quick3d\uninst.exe"
- WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\quick3d\bin\qglinfo.exe"
- WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
- WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\quick3d\uninst.exe"
- WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\quick3d\bin\qglinfo.exe"
- WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
- WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
- WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
- WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "InstallRoot" "$INSTDIR"
-SectionEnd
-
-
-Function un.onUninstSuccess
- HideWindow
- MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer."
-FunctionEnd
-
-Function un.onInit
- ; LogSet on
- ReadRegStr $0 ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "InstallRoot"
- StrCpy $INSTDIR $0
- MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2
- Abort
-FunctionEnd
-
-Section Uninstall
- Delete "$INSTDIR\${PRODUCT_NAME}.url"
- Delete "$INSTDIR\quick3d\uninst.exe"
- RMDir /r "$INSTDIR\plugins\sceneformats"
- Delete "$INSTDIR\plugins\imageformats\qtga4.dll"
- Delete "$INSTDIR\mkspecs\features\qt3dquick.prf"
- Delete "$INSTDIR\mkspecs\features\qt3d.prf"
- Delete "$INSTDIR\lib\Qt3DQuick.*"
- Delete "$INSTDIR\lib\Qt3DQuickd.*"
- Delete "$INSTDIR\lib\Qt3D.*"
- Delete "$INSTDIR\lib\Qt3Dd.*"
- Delete "$INSTDIR\bin\Qt3DQuick.*"
- Delete "$INSTDIR\bin\Qt3DQuickd.*"
- Delete "$INSTDIR\bin\Qt3D.*"
- Delete "$INSTDIR\bin\Qt3Dd.*"
- RMDir /r "$INSTDIR\include\Qt3D"
- RMDir /r "$INSTDIR\include\Qt3DQuick"
- RMDir /r "$INSTDIR\imports\Qt3D"
- RMDir /r "$INSTDIR\quick3d"
-
- Delete "$DESKTOP\QtQuick3D.lnk"
- RMDir /r "$SMPROGRAMS\QtQuick3D"
- RMDir /r "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\QtQuick3D"
-
- DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
- DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
- SetAutoClose true
-SectionEnd
diff --git a/src/scripts/filter-qmldump.pl b/src/scripts/filter-qmldump.pl
deleted file mode 100755
index 84686898..00000000
--- a/src/scripts/filter-qmldump.pl
+++ /dev/null
@@ -1,65 +0,0 @@
-#!/usr/bin/perl
-#############################################################################
-##
-## 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$
-##
-#############################################################################
-
-use strict;
-use warnings;
-
-use XML::XPath;
-use XML::XPath::XMLParser;
-
-my $mod = shift or die "Usage: filter-qmldump.pl <module name>\n";
-
-warn "Filtering for modules in $mod\n";
-
-my $xp = XML::XPath->new(filename => 'library.xml');
-
-my $nodeset = $xp->find("//type/exports/export[\@module=\'$mod\']/../..");
-
-print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
-print "<module>\n";
-
-foreach my $node ($nodeset->get_nodelist)
-{
- print " " . XML::XPath::XMLParser::as_string($node) . "\n";
-}
-
-print "<\\module>\n";
diff --git a/src/scripts/mac-install.rtf b/src/scripts/mac-install.rtf
deleted file mode 100644
index f596b71c..00000000
--- a/src/scripts/mac-install.rtf
+++ /dev/null
@@ -1,13 +0,0 @@
-{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350
-{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
-{\colortbl;\red255\green255\blue255;}
-\paperw11900\paperh16840\vieww12000\viewh15840\viewkind0
-\deftab720
-\pard\pardeftab720\sl276\slmult1\sa200\ql\qnatural
-
-\f0\b\fs22 \cf0 Thanks for installing QtQuick3D! \
-
-\b0 To create applications with QtQuick3D simply open QtCreator, and ensure that your new project uses the "Qt in Path" under the "Auto-detected" section of the Qt Versions. See the Qt Creator's Preference pane and choose the "Qt 4" tab.\
-You can also compile applications from the command line by using the command "quake".\
-\
-} \ No newline at end of file
diff --git a/src/scripts/mac_installer_background.png b/src/scripts/mac_installer_background.png
deleted file mode 100644
index 0f2de686..00000000
--- a/src/scripts/mac_installer_background.png
+++ /dev/null
Binary files differ
diff --git a/src/scripts/qtquick3d.ico b/src/scripts/qtquick3d.ico
deleted file mode 100644
index b3b85e37..00000000
--- a/src/scripts/qtquick3d.ico
+++ /dev/null
Binary files differ
diff --git a/src/scripts/win_installer_background.bmp b/src/scripts/win_installer_background.bmp
deleted file mode 100644
index 785c943d..00000000
--- a/src/scripts/win_installer_background.bmp
+++ /dev/null
Binary files differ
diff --git a/src/scripts/windows-install.rtf b/src/scripts/windows-install.rtf
deleted file mode 100644
index e9c5f43d..00000000
--- a/src/scripts/windows-install.rtf
+++ /dev/null
Binary files differ
diff --git a/src/scripts/windows-install.txt b/src/scripts/windows-install.txt
deleted file mode 100644
index 909b0372..00000000
--- a/src/scripts/windows-install.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-Thanks for installing QtQuick3D!
-
-To create applications with QtQuick3D
-simply open QtCreator, and ensure that
-your new project uses the Qt installed
-at C:\Qt\4.7.3.
-
-You can also compile applications from
-the command line by using the Start Menu
-item : "Qt 4.7.3 Command Prompt".
diff --git a/src/src.pro b/src/src.pro
deleted file mode 100644
index 48385ea6..00000000
--- a/src/src.pro
+++ /dev/null
@@ -1,4 +0,0 @@
-TEMPLATE = subdirs
-CONFIG += ordered
-SUBDIRS = threed quick3d imports
-SUBDIRS += plugins
diff --git a/src/threed/api/api.pri b/src/threed/api/api.pri
deleted file mode 100644
index 6b06b650..00000000
--- a/src/threed/api/api.pri
+++ /dev/null
@@ -1,4 +0,0 @@
-INCLUDEPATH += $$PWD
-VPATH += $$PWD
-HEADERS += api/qopenglfunctions.h
-SOURCES += qopenglfunctions.cpp
diff --git a/src/threed/api/gl-funcs.txt b/src/threed/api/gl-funcs.txt
deleted file mode 100644
index 6bef6ce4..00000000
--- a/src/threed/api/gl-funcs.txt
+++ /dev/null
@@ -1,858 +0,0 @@
-void glActiveTexture(GLenum texture);
- inline es1, es2
- alt_name glActiveTextureARB
-
-void glAttachShader(GLuint program, GLuint shader);
- shader_only yes
- inline es2
- alt_name glAttachObjectARB
-
-void glBindAttribLocation(GLuint program, GLuint index, const char* name);
- shader_only yes
- inline es2
- alt_name glBindAttribLocationARB
-
-void glBindBuffer(GLenum target, GLuint buffer);
- inline es1, es2
-
-void glBindFramebuffer(GLenum target, GLuint framebuffer);
- inline es2
-
-void glBindRenderbuffer(GLenum target, GLuint renderbuffer);
- inline es2
-
-void glBindTexture(GLenum target, GLuint texture);
- inline all
-
-void glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
- inline es2
-
-void glBlendEquation( GLenum mode );
- inline es2
-
-void glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha);
- inline es2
-
-void glBlendFunc(GLenum sfactor, GLenum dfactor);
- inline all
-
-void glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
- inline es2
-
-void glBufferData(GLenum target, qgl_GLsizeiptr size, const void* data, GLenum usage);
- inline es1, es2
-
-void glBufferSubData(GLenum target, qgl_GLintptr offset, qgl_GLsizeiptr size, const void* data);
- inline es1, es2
-
-GLenum glCheckFramebufferStatus(GLenum target);
- inline es2
-
-void glClear(GLbitfield mask);
- inline all
-
-void glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
- inline all
-
-void glClearDepth(GLclampf depth);
- inline all_diff
- es_name glClearDepthf
-
-void glClearStencil(GLint s);
- inline all
-
-void glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
- inline all
-
-void glCompileShader(GLuint shader);
- shader_only yes
- inline es2
- alt_name glCompileShader
-
-void glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data);
- inline es1, es2
-
-void glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data);
- inline es1, es2
-
-void glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
- inline all
-
-void glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
- inline all
-
-GLuint glCreateProgram(void);
- shader_only yes
- inline es2
- alt_name glCreateProgramObjectARB
-
-GLuint glCreateShader(GLenum type);
- shader_only yes
- inline es2
- alt_name glCreateShaderObjectARB
-
-void glCullFace(GLenum mode);
- inline all
-
-void glDeleteBuffers(GLsizei n, const GLuint* buffers);
- inline es1, es2
-
-void glDeleteFramebuffers(GLsizei n, const GLuint* framebuffers);
- inline es2
-
-void glDeleteProgram(GLuint program);
- shader_only yes
- inline es2
- alt_name glDeleteObjectARB
-
-void glDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers);
- inline es2
-
-void glDeleteShader(GLuint shader);
- shader_only yes
- inline es2
- alt_name glDeleteObjectARB
-
-void glDeleteTextures(GLsizei n, const GLuint* textures);
- inline all
-
-void glDepthFunc(GLenum func);
- inline all
-
-void glDepthMask(GLboolean flag);
- inline all
-
-void glDepthRange(GLclampf zNear, GLclampf zFar);
- inline all_diff
- es_name glDepthRangef
-
-void glDetachShader(GLuint program, GLuint shader);
- shader_only yes
- inline es2
- alt_name glDetachObjectARB
-
-void glDisable(GLenum cap);
- inline all
-
-void glDisableVertexAttribArray(GLuint index);
- shader_only yes
- inline es2
- alt_name glDisableVertexAttribArrayARB
-
-void glDrawArrays(GLenum mode, GLint first, GLsizei count);
- inline all
-
-void glDrawElements(GLenum mode, GLsizei count, GLenum type, const void* indices);
- inline all
-
-void glEnable(GLenum cap);
- inline all
-
-void glEnableVertexAttribArray(GLuint index);
- shader_only yes
- inline es2
- alt_name glEnableVertexAttribArrayARB
-
-void glFinish(void);
- inline all
-
-void glFlush(void);
- inline all
-
-void glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
- inline es2
-
-void glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
- inline es2
-
-void glFrontFace(GLenum mode);
- inline all
-
-void glGenBuffers(GLsizei n, GLuint* buffers);
- inline es1, es2
-
-void glGenerateMipmap(GLenum target);
- inline es2
-
-void glGenFramebuffers(GLsizei n, GLuint* framebuffers);
- inline es2
-
-void glGenRenderbuffers(GLsizei n, GLuint* renderbuffers);
- inline es2
-
-void glGenTextures(GLsizei n, GLuint* textures);
- inline all
-
-void glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name);
- shader_only yes
- inline es2
- alt_name glGetActiveAttribARB
-
-void glGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name);
- shader_only yes
- inline es2
- alt_name glGetActiveUniformARB
-
-void glGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders);
- shader_only yes
- inline es2
- alt_name glGetAttachedObjectsARB
-
-int glGetAttribLocation(GLuint program, const char* name);
- shader_only yes
- inline es2
- alt_name glGetAttribLocationARB
-
-void glGetBooleanv(GLenum pname, GLboolean* params);
- inline all
-
-void glGetBufferParameteriv(GLenum target, GLenum pname, GLint* params);
- inline es2
-
-GLenum glGetError(void);
- inline all
-
-void glGetFloatv(GLenum pname, GLfloat* params);
- inline all
-
-void glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params);
- inline es2
-
-void glGetIntegerv(GLenum pname, GLint* params);
- inline all
-
-void glGetProgramiv(GLuint program, GLenum pname, GLint* params);
- shader_only yes
- inline es2
- alt_name glGetObjectParameterivARB
-
-void glGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog);
- shader_only yes
- inline es2
- alt_name glGetInfoLogARB
-
-void glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params);
- inline es2
-
-void glGetShaderiv(GLuint shader, GLenum pname, GLint* params);
- shader_only yes
- inline es2
- alt_name glGetObjectParameterivARB
-
-void glGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog);
- shader_only yes
- inline es2
- alt_name glGetInfoLogARB
-
-void glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
- shader_only yes
- inline es2
- special_handling yes
-
-void glGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, char* source);
- shader_only yes
- inline es2
- alt_name glGetShaderSourceARB
-
-const GLubyte* glGetString(GLenum name);
- inline all
-
-void glGetTexParameterfv(GLenum target, GLenum pname, GLfloat* params);
- inline all
-
-void glGetTexParameteriv(GLenum target, GLenum pname, GLint* params);
- inline all
-
-void glGetUniformfv(GLuint program, GLint location, GLfloat* params);
- shader_only yes
- inline es2
- alt_name glGetUniformfvARB
-
-void glGetUniformiv(GLuint program, GLint location, GLint* params);
- shader_only yes
- inline es2
- alt_name glGetUniformivARB
-
-int glGetUniformLocation(GLuint program, const char* name);
- shader_only yes
- inline es2
- alt_name glGetUniformLocationARB
-
-void glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params);
- shader_only yes
- inline es2
- alt_name glGetVertexAttribfvARB
-
-void glGetVertexAttribiv(GLuint index, GLenum pname, GLint* params);
- shader_only yes
- inline es2
- alt_name glGetVertexAttribivARB
-
-void glGetVertexAttribPointerv(GLuint index, GLenum pname, void** pointer);
- shader_only yes
- inline es2
- alt_name glGetVertexAttribPointervARB
-
-void glHint(GLenum target, GLenum mode);
- inline all
-
-GLboolean glIsBuffer(GLuint buffer);
- inline es1, es2
-
-GLboolean glIsEnabled(GLenum cap);
- inline all
-
-GLboolean glIsFramebuffer(GLuint framebuffer);
- inline es2
-
-GLboolean glIsProgram(GLuint program);
- shader_only yes
- inline es2
- alt_name glIsProgramARB
- special_handling yes
-
-GLboolean glIsRenderbuffer(GLuint renderbuffer);
- inline es2
-
-GLboolean glIsShader(GLuint shader);
- shader_only yes
- inline es2
- alt_name glIsShaderARB
- special_handling yes
-
-GLboolean glIsTexture(GLuint texture);
- inline all
-
-void glLineWidth(GLfloat width);
- inline all
-
-void glLinkProgram(GLuint program);
- shader_only yes
- inline es2
- alt_name glLinkProgramARB
-
-void glPixelStorei(GLenum pname, GLint param);
- inline all
-
-void glPolygonOffset(GLfloat factor, GLfloat units);
- inline all
-
-void glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels);
- inline all
-
-void glReleaseShaderCompiler(void);
- shader_only yes
- inline es2
- alt_name glReleaseShaderCompilerARB
- special_handling yes
-
-void glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
- inline es2
-
-void glSampleCoverage(GLclampf value, GLboolean invert);
- inline es1, es2
-
-void glScissor(GLint x, GLint y, GLsizei width, GLsizei height);
- inline all
-
-void glShaderBinary(GLint n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLint length);
- shader_only yes
- inline es2
- alt_name glShaderBinaryARB
-
-void glShaderSource(GLuint shader, GLsizei count, const char** string, const GLint* length);
- shader_only yes
- inline es2
- alt_name glShaderSourceARB
-
-void glStencilFunc(GLenum func, GLint ref, GLuint mask);
- inline all
-
-void glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask);
- inline es2
-
-void glStencilMask(GLuint mask);
- inline all
-
-void glStencilMaskSeparate(GLenum face, GLuint mask);
- inline es2
-
-void glStencilOp(GLenum fail, GLenum zfail, GLenum zpass);
- inline all
-
-void glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
- inline es2
-
-void glTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels);
- inline all
-
-void glTexParameterf(GLenum target, GLenum pname, GLfloat param);
- inline all
-
-void glTexParameterfv(GLenum target, GLenum pname, const GLfloat* params);
- inline all
-
-void glTexParameteri(GLenum target, GLenum pname, GLint param);
- inline all
-
-void glTexParameteriv(GLenum target, GLenum pname, const GLint* params);
- inline all
-
-void glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels);
- inline all
-
-void glUniform1f(GLint location, GLfloat x);
- shader_only yes
- inline es2
- alt_name glUniform1fARB
-
-void glUniform1fv(GLint location, GLsizei count, const GLfloat* v);
- shader_only yes
- inline es2
- alt_name glUniform1fvARB
-
-void glUniform1i(GLint location, GLint x);
- shader_only yes
- inline es2
- alt_name glUniform1iARB
-
-void glUniform1iv(GLint location, GLsizei count, const GLint* v);
- shader_only yes
- inline es2
- alt_name glUniform1ivARB
-
-void glUniform2f(GLint location, GLfloat x, GLfloat y);
- shader_only yes
- inline es2
- alt_name glUniform2fARB
-
-void glUniform2fv(GLint location, GLsizei count, const GLfloat* v);
- shader_only yes
- inline es2
- alt_name glUniform2fvARB
-
-void glUniform2i(GLint location, GLint x, GLint y);
- shader_only yes
- inline es2
- alt_name glUniform2iARB
-
-void glUniform2iv(GLint location, GLsizei count, const GLint* v);
- shader_only yes
- inline es2
- alt_name glUniform2ivARB
-
-void glUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z);
- shader_only yes
- inline es2
- alt_name glUniform3fARB
-
-void glUniform3fv(GLint location, GLsizei count, const GLfloat* v);
- shader_only yes
- inline es2
- alt_name glUniform3fvARB
-
-void glUniform3i(GLint location, GLint x, GLint y, GLint z);
- shader_only yes
- inline es2
- alt_name glUniform3iARB
-
-void glUniform3iv(GLint location, GLsizei count, const GLint* v);
- shader_only yes
- inline es2
- alt_name glUniform3ivARB
-
-void glUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
- shader_only yes
- inline es2
- alt_name glUniform4fARB
-
-void glUniform4fv(GLint location, GLsizei count, const GLfloat* v);
- shader_only yes
- inline es2
- alt_name glUniform4fvARB
-
-void glUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w);
- shader_only yes
- inline es2
- alt_name glUniform4iARB
-
-void glUniform4iv(GLint location, GLsizei count, const GLint* v);
- shader_only yes
- inline es2
- alt_name glUniform4ivARB
-
-void glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
- shader_only yes
- inline es2
- alt_name glUniformMatrix2fvARB
-
-void glUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
- shader_only yes
- inline es2
- alt_name glUniformMatrix3fvARB
-
-void glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
- shader_only yes
- inline es2
- alt_name glUniformMatrix4fvARB
-
-void glUseProgram(GLuint program);
- shader_only yes
- inline es2
- alt_name glUseProgramObjectARB
-
-void glValidateProgram(GLuint program);
- shader_only yes
- inline es2
- alt_name glValidateProgramARB
-
-void glVertexAttrib1f(GLuint indx, GLfloat x);
- shader_only yes
- inline es2
- alt_name glVertexAttrib1fARB
-
-void glVertexAttrib1fv(GLuint indx, const GLfloat* values);
- shader_only yes
- inline es2
- alt_name glVertexAttrib1fvARB
-
-void glVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y);
- shader_only yes
- inline es2
- alt_name glVertexAttrib2fARB
-
-void glVertexAttrib2fv(GLuint indx, const GLfloat* values);
- shader_only yes
- inline es2
- alt_name glVertexAttrib2fvARB
-
-void glVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z);
- shader_only yes
- inline es2
- alt_name glVertexAttrib3fARB
-
-void glVertexAttrib3fv(GLuint indx, const GLfloat* values);
- shader_only yes
- inline es2
- alt_name glVertexAttrib3fvARB
-
-void glVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
- shader_only yes
- inline es2
- alt_name glVertexAttrib4fARB
-
-void glVertexAttrib4fv(GLuint indx, const GLfloat* values);
- shader_only yes
- inline es2
- alt_name glVertexAttrib4fvARB
-
-void glVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr);
- shader_only yes
- inline es2
- alt_name glVertexAttribPointerARB
-
-void glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
- inline all
-
-#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
-#define GL_ACTIVE_ATTRIBUTES 0x8B89
-#define GL_ACTIVE_TEXTURE 0x84E0
-#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
-#define GL_ACTIVE_UNIFORMS 0x8B86
-#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
-#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
-#define GL_ALPHA 0x1906
-#define GL_ALPHA_BITS 0x0D55
-#define GL_ALWAYS 0x0207
-#define GL_ARRAY_BUFFER 0x8892
-#define GL_ARRAY_BUFFER_BINDING 0x8894
-#define GL_ATTACHED_SHADERS 0x8B85
-#define GL_BACK 0x0405
-#define GL_BLEND 0x0BE2
-#define GL_BLEND_COLOR 0x8005
-#define GL_BLEND_DST_ALPHA 0x80CA
-#define GL_BLEND_DST_RGB 0x80C8
-#define GL_BLEND_EQUATION 0x8009
-#define GL_BLEND_EQUATION_ALPHA 0x883D
-#define GL_BLEND_EQUATION_RGB 0x8009
-#define GL_BLEND_SRC_ALPHA 0x80CB
-#define GL_BLEND_SRC_RGB 0x80C9
-#define GL_BLUE_BITS 0x0D54
-#define GL_BOOL 0x8B56
-#define GL_BOOL_VEC2 0x8B57
-#define GL_BOOL_VEC3 0x8B58
-#define GL_BOOL_VEC4 0x8B59
-#define GL_BUFFER_SIZE 0x8764
-#define GL_BUFFER_USAGE 0x8765
-#define GL_BYTE 0x1400
-#define GL_CCW 0x0901
-#define GL_CLAMP_TO_EDGE 0x812F
-#define GL_COLOR_ATTACHMENT0 0x8CE0
-#define GL_COLOR_BUFFER_BIT 0x00004000
-#define GL_COLOR_CLEAR_VALUE 0x0C22
-#define GL_COLOR_WRITEMASK 0x0C23
-#define GL_COMPILE_STATUS 0x8B81
-#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
-#define GL_CONSTANT_ALPHA 0x8003
-#define GL_CONSTANT_COLOR 0x8001
-#define GL_CULL_FACE 0x0B44
-#define GL_CULL_FACE_MODE 0x0B45
-#define GL_CURRENT_PROGRAM 0x8B8D
-#define GL_CURRENT_VERTEX_ATTRIB 0x8626
-#define GL_CW 0x0900
-#define GL_DECR 0x1E03
-#define GL_DECR_WRAP 0x8508
-#define GL_DELETE_STATUS 0x8B80
-#define GL_DEPTH_ATTACHMENT 0x8D00
-#define GL_DEPTH_BITS 0x0D56
-#define GL_DEPTH_BUFFER_BIT 0x00000100
-#define GL_DEPTH_CLEAR_VALUE 0x0B73
-#define GL_DEPTH_COMPONENT 0x1902
-#define GL_DEPTH_COMPONENT16 0x81A5
-#define GL_DEPTH_FUNC 0x0B74
-#define GL_DEPTH_RANGE 0x0B70
-#define GL_DEPTH_TEST 0x0B71
-#define GL_DEPTH_WRITEMASK 0x0B72
-#define GL_DITHER 0x0BD0
-#define GL_DONT_CARE 0x1100
-#define GL_DST_ALPHA 0x0304
-#define GL_DST_COLOR 0x0306
-#define GL_DYNAMIC_DRAW 0x88E8
-#define GL_ELEMENT_ARRAY_BUFFER 0x8893
-#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
-#define GL_EQUAL 0x0202
-#define GL_EXTENSIONS 0x1F03
-#define GL_FALSE 0
-#define GL_FASTEST 0x1101
-#define GL_FIXED 0x140C
-#define GL_FLOAT 0x1406
-#define GL_FLOAT_MAT2 0x8B5A
-#define GL_FLOAT_MAT3 0x8B5B
-#define GL_FLOAT_MAT4 0x8B5C
-#define GL_FLOAT_VEC2 0x8B50
-#define GL_FLOAT_VEC3 0x8B51
-#define GL_FLOAT_VEC4 0x8B52
-#define GL_FRAGMENT_SHADER 0x8B30
-#define GL_FRAMEBUFFER 0x8D40
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
-#define GL_FRAMEBUFFER_BINDING 0x8CA6
-#define GL_FRAMEBUFFER_COMPLETE 0x8CD5
-#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
-#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9
-#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
-#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
-#define GL_FRONT 0x0404
-#define GL_FRONT_AND_BACK 0x0408
-#define GL_FRONT_FACE 0x0B46
-#define GL_FUNC_ADD 0x8006
-#define GL_FUNC_REVERSE_SUBTRACT 0x800B
-#define GL_FUNC_SUBTRACT 0x800A
-#define GL_GENERATE_MIPMAP_HINT 0x8192
-#define GL_GEQUAL 0x0206
-#define GL_GREATER 0x0204
-#define GL_GREEN_BITS 0x0D53
-#define GL_HIGH_FLOAT 0x8DF2
-#define GL_HIGH_INT 0x8DF5
-#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
-#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A
-#define GL_INCR 0x1E02
-#define GL_INCR_WRAP 0x8507
-#define GL_INFO_LOG_LENGTH 0x8B84
-#define GL_INT 0x1404
-#define GL_INT_VEC2 0x8B53
-#define GL_INT_VEC3 0x8B54
-#define GL_INT_VEC4 0x8B55
-#define GL_INVALID_ENUM 0x0500
-#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
-#define GL_INVALID_OPERATION 0x0502
-#define GL_INVALID_VALUE 0x0501
-#define GL_INVERT 0x150A
-#define GL_KEEP 0x1E00
-#define GL_LEQUAL 0x0203
-#define GL_LESS 0x0201
-#define GL_LINEAR 0x2601
-#define GL_LINEAR_MIPMAP_LINEAR 0x2703
-#define GL_LINEAR_MIPMAP_NEAREST 0x2701
-#define GL_LINE_LOOP 0x0002
-#define GL_LINES 0x0001
-#define GL_LINE_STRIP 0x0003
-#define GL_LINE_WIDTH 0x0B21
-#define GL_LINK_STATUS 0x8B82
-#define GL_LOW_FLOAT 0x8DF0
-#define GL_LOW_INT 0x8DF3
-#define GL_LUMINANCE 0x1909
-#define GL_LUMINANCE_ALPHA 0x190A
-#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
-#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
-#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD
-#define GL_MAX_RENDERBUFFER_SIZE 0x84E8
-#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
-#define GL_MAX_TEXTURE_SIZE 0x0D33
-#define GL_MAX_VARYING_VECTORS 0x8DFC
-#define GL_MAX_VERTEX_ATTRIBS 0x8869
-#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
-#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB
-#define GL_MAX_VIEWPORT_DIMS 0x0D3A
-#define GL_MEDIUM_FLOAT 0x8DF1
-#define GL_MEDIUM_INT 0x8DF4
-#define GL_MIRRORED_REPEAT 0x8370
-#define GL_NEAREST 0x2600
-#define GL_NEAREST_MIPMAP_LINEAR 0x2702
-#define GL_NEAREST_MIPMAP_NEAREST 0x2700
-#define GL_NEVER 0x0200
-#define GL_NICEST 0x1102
-#define GL_NO_ERROR 0
-#define GL_NONE 0
-#define GL_NOTEQUAL 0x0205
-#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
-#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9
-#define GL_ONE 1
-#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
-#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
-#define GL_ONE_MINUS_DST_ALPHA 0x0305
-#define GL_ONE_MINUS_DST_COLOR 0x0307
-#define GL_ONE_MINUS_SRC_ALPHA 0x0303
-#define GL_ONE_MINUS_SRC_COLOR 0x0301
-#define GL_OUT_OF_MEMORY 0x0505
-#define GL_PACK_ALIGNMENT 0x0D05
-#define GL_POINTS 0x0000
-#define GL_POLYGON_OFFSET_FACTOR 0x8038
-#define GL_POLYGON_OFFSET_FILL 0x8037
-#define GL_POLYGON_OFFSET_UNITS 0x2A00
-#define GL_RED_BITS 0x0D52
-#define GL_RENDERBUFFER 0x8D41
-#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53
-#define GL_RENDERBUFFER_BINDING 0x8CA7
-#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52
-#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54
-#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51
-#define GL_RENDERBUFFER_HEIGHT 0x8D43
-#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44
-#define GL_RENDERBUFFER_RED_SIZE 0x8D50
-#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55
-#define GL_RENDERBUFFER_WIDTH 0x8D42
-#define GL_RENDERER 0x1F01
-#define GL_REPEAT 0x2901
-#define GL_REPLACE 0x1E01
-#define GL_RGB 0x1907
-#define GL_RGB565 0x8D62
-#define GL_RGB5_A1 0x8057
-#define GL_RGBA 0x1908
-#define GL_RGBA4 0x8056
-#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
-#define GL_SAMPLE_BUFFERS 0x80A8
-#define GL_SAMPLE_COVERAGE 0x80A0
-#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
-#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
-#define GL_SAMPLER_2D 0x8B5E
-#define GL_SAMPLER_CUBE 0x8B60
-#define GL_SAMPLES 0x80A9
-#define GL_SCISSOR_BOX 0x0C10
-#define GL_SCISSOR_TEST 0x0C11
-#define GL_SHADER_BINARY_FORMATS 0x8DF8
-#define GL_SHADER_COMPILER 0x8DFA
-#define GL_SHADER_SOURCE_LENGTH 0x8B88
-#define GL_SHADER_TYPE 0x8B4F
-#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
-#define GL_SHORT 0x1402
-#define GL_SRC_ALPHA 0x0302
-#define GL_SRC_ALPHA_SATURATE 0x0308
-#define GL_SRC_COLOR 0x0300
-#define GL_STATIC_DRAW 0x88E4
-#define GL_STENCIL_ATTACHMENT 0x8D20
-#define GL_STENCIL_BACK_FAIL 0x8801
-#define GL_STENCIL_BACK_FUNC 0x8800
-#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802
-#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803
-#define GL_STENCIL_BACK_REF 0x8CA3
-#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
-#define GL_STENCIL_BACK_WRITEMASK 0x8CA5
-#define GL_STENCIL_BITS 0x0D57
-#define GL_STENCIL_BUFFER_BIT 0x00000400
-#define GL_STENCIL_CLEAR_VALUE 0x0B91
-#define GL_STENCIL_FAIL 0x0B94
-#define GL_STENCIL_FUNC 0x0B92
-#define GL_STENCIL_INDEX 0x1901
-#define GL_STENCIL_INDEX8 0x8D48
-#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
-#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
-#define GL_STENCIL_REF 0x0B97
-#define GL_STENCIL_TEST 0x0B90
-#define GL_STENCIL_VALUE_MASK 0x0B93
-#define GL_STENCIL_WRITEMASK 0x0B98
-#define GL_STREAM_DRAW 0x88E0
-#define GL_SUBPIXEL_BITS 0x0D50
-#define GL_TEXTURE0 0x84C0
-#define GL_TEXTURE 0x1702
-#define GL_TEXTURE10 0x84CA
-#define GL_TEXTURE1 0x84C1
-#define GL_TEXTURE11 0x84CB
-#define GL_TEXTURE12 0x84CC
-#define GL_TEXTURE13 0x84CD
-#define GL_TEXTURE14 0x84CE
-#define GL_TEXTURE15 0x84CF
-#define GL_TEXTURE16 0x84D0
-#define GL_TEXTURE17 0x84D1
-#define GL_TEXTURE18 0x84D2
-#define GL_TEXTURE19 0x84D3
-#define GL_TEXTURE20 0x84D4
-#define GL_TEXTURE2 0x84C2
-#define GL_TEXTURE21 0x84D5
-#define GL_TEXTURE22 0x84D6
-#define GL_TEXTURE23 0x84D7
-#define GL_TEXTURE24 0x84D8
-#define GL_TEXTURE25 0x84D9
-#define GL_TEXTURE26 0x84DA
-#define GL_TEXTURE27 0x84DB
-#define GL_TEXTURE28 0x84DC
-#define GL_TEXTURE29 0x84DD
-#define GL_TEXTURE_2D 0x0DE1
-#define GL_TEXTURE30 0x84DE
-#define GL_TEXTURE3 0x84C3
-#define GL_TEXTURE31 0x84DF
-#define GL_TEXTURE4 0x84C4
-#define GL_TEXTURE5 0x84C5
-#define GL_TEXTURE6 0x84C6
-#define GL_TEXTURE7 0x84C7
-#define GL_TEXTURE8 0x84C8
-#define GL_TEXTURE9 0x84C9
-#define GL_TEXTURE_BINDING_2D 0x8069
-#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
-#define GL_TEXTURE_CUBE_MAP 0x8513
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
-#define GL_TEXTURE_MAG_FILTER 0x2800
-#define GL_TEXTURE_MIN_FILTER 0x2801
-#define GL_TEXTURE_WRAP_S 0x2802
-#define GL_TEXTURE_WRAP_T 0x2803
-#define GL_TRIANGLE_FAN 0x0006
-#define GL_TRIANGLES 0x0004
-#define GL_TRIANGLE_STRIP 0x0005
-#define GL_TRUE 1
-#define GL_UNPACK_ALIGNMENT 0x0CF5
-#define GL_UNSIGNED_BYTE 0x1401
-#define GL_UNSIGNED_INT 0x1405
-#define GL_UNSIGNED_SHORT 0x1403
-#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
-#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
-#define GL_UNSIGNED_SHORT_5_6_5 0x8363
-#define GL_VALIDATE_STATUS 0x8B83
-#define GL_VENDOR 0x1F00
-#define GL_VERSION 0x1F02
-#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
-#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
-#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
-#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
-#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
-#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
-#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
-#define GL_VERTEX_SHADER 0x8B31
-#define GL_VIEWPORT 0x0BA2
-#define GL_ZERO 0
diff --git a/src/threed/api/gl-gen-funcs.pl b/src/threed/api/gl-gen-funcs.pl
deleted file mode 100755
index 8f495649..00000000
--- a/src/threed/api/gl-gen-funcs.pl
+++ /dev/null
@@ -1,484 +0,0 @@
-#!/usr/bin/perl
-#############################################################################
-##
-## 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$
-##
-#############################################################################
-
-
-#
-# USAGE:
-#
-# perl gl-gen-funcs.pl < gl-functs.txt > output.txt
-#
-# This will automatically generate the qopenglfunctions.h/.cpp files for Qt3D
-# based on the platform and available functions/capabilities.
-#
-# The file output.txt will contain the text for the header and implementation
-# files - it is left to the user to manually cut and paste this content into
-# their own qopenglfunctions.h and qopenglfunctions.cpp files.
-#
-# Note: this script is intended for perl version 5.10.1 or better, and has not
-# been tested on previous versions of perl.
-#
-
-use strict;
-use warnings;
-
-use Data::Dumper;
-
-# Read the function definitions from the input.
-my @functions = ();
-my @macros = ();
-my %func_info = ();
-while (<>)
-{
- my ($returnType, $name, $argstr) =
- m/^(\w+|const GLubyte\*)\s+(\w+)\s*\(([^)]*)\)/;
-
- if (!$returnType) {
- my ($macroname, $macrovalue) = m/^#define\s+(\w+)\s+(.*)$/;
- if ($macroname) {
- my %macro_info = ();
- $macro_info{'name'} = $macroname;
- $macro_info{'value'} = $macrovalue;
- push @macros, { %macro_info };
- next;
- }
- my ($tag, $value) = m/^\s+(\w+)\s+(.*)$/;
- next unless $tag;
- $func_info{$tag} = $value;
- $func_info{'funcname'} = $value if ($tag eq "es_name");
- next;
- }
-
- if ($func_info{'name'}) {
- push @functions, { %func_info };
- %func_info = ();
- }
-
- $argstr =~ s/^\s+//;
- $argstr =~ s/\s+$//;
- my @args = split /,\s*/,$argstr;
-
- my @argNames = ();
- if ($argstr ne 'void') {
- foreach (@args) {
- my ($argType, $argName) = m/^(\w+|\w+.*\*)\s+(\w+)$/;
- push @argNames, $argName;
- }
- } else {
- $argstr = "";
- }
- my $argnamestr = join(', ', @argNames);
-
- $func_info{'name'} = $name;
- $func_info{'funcname'} = $name;
- $name =~ s/^gl//;
- $func_info{'varname'} = lcfirst($name);
- $func_info{'returnType'} = $returnType;
- $func_info{'argstr'} = $argstr;
- $func_info{'argnamestr'} = $argnamestr;
-}
-if ($func_info{'name'}) {
- push @functions, { %func_info };
-}
-
-# Generate the declarations for qopenglfunctions.h.
-print "// qopenglfunctions.h\n\n";
-print "#ifdef Q_WS_WIN\n";
-print "# define QT3D_GLF_APIENTRY APIENTRY\n";
-print "#endif\n";
-print "\n";
-print "#ifndef Q_WS_MAC\n";
-print "# ifndef QT3D_GLF_APIENTRYP\n";
-print "# ifdef QT3D_GLF_APIENTRY\n";
-print "# define QT3D_GLF_APIENTRYP QT3D_GLF_APIENTRY *\n";
-print "# else\n";
-print "# define QT3D_GLF_APIENTRY\n";
-print "# define QT3D_GLF_APIENTRYP *\n";
-print "# endif\n";
-print "# endif\n";
-print "#else\n";
-print "# define QT3D_GLF_APIENTRY\n";
-print "# define QT3D_GLF_APIENTRYP *\n";
-print "#endif\n";
-print "\n";
-print "struct QOpenGLFunctionsPrivate;\n";
-print "\n";
-
-print "// Undefine any macros from GLEW, qglextensions_p.h, etc that\n";
-print "// may interfere with the definition of QOpenGLFunctions.\n";
-foreach ( @functions ) {
- my $inline = $_->{'inline'};
- next if ($inline && $inline eq 'all');
- my $name = $_->{'funcname'};
- print "#undef $name\n";
-}
-print "\n";
-
-# Output the prototypes into the QOpenGLFunctions class.
-print "class Q_QT3D_EXPORT QOpenGLFunctions\n";
-print "{\n";
-print "public:\n";
-print " QOpenGLFunctions();\n";
-print " explicit QOpenGLFunctions(const QGLContext *context);\n";
-print " ~QOpenGLFunctions() {}\n";
-print "\n";
-print " enum OpenGLFeature\n";
-print " {\n";
-print " Multitexture = 0x0001,\n";
-print " Shaders = 0x0002,\n";
-print " Buffers = 0x0004,\n";
-print " Framebuffers = 0x0008,\n";
-print " BlendColor = 0x0010,\n";
-print " BlendEquation = 0x0020,\n";
-print " BlendEquationSeparate = 0x0040,\n";
-print " BlendFuncSeparate = 0x0080,\n";
-print " BlendSubtract = 0x0100,\n";
-print " CompressedTextures = 0x0200,\n";
-print " Multisample = 0x0400,\n";
-print " StencilSeparate = 0x0800,\n";
-print " NPOTTextures = 0x1000\n";
-print " };\n";
-print " Q_DECLARE_FLAGS(OpenGLFeatures, OpenGLFeature)\n";
-print "\n";
-print " QOpenGLFunctions::OpenGLFeatures openGLFeatures() const;\n";
-print " bool hasOpenGLFeature(QOpenGLFunctions::OpenGLFeature feature) const;\n";
-print "\n";
-print " void initializeGLFunctions(const QGLContext *context = 0);\n";
-print "\n";
-my $last_shader_only = 0;
-foreach ( @functions ) {
- my $inline = $_->{'inline'};
- next if ($inline && $inline eq 'all');
- my $shader_only = ($_->{'shader_only'} && $_->{'shader_only'} eq 'yes');
- my $name = $_->{'funcname'};
- #print "#ifndef QT_OPENGL_ES_1\n" if ($shader_only && !$last_shader_only);
- #print "#endif\n" if (!$shader_only && $last_shader_only);
- print " $_->{'returnType'} $name($_->{'argstr'});\n";
- $last_shader_only = $shader_only;
-}
-#print "#endif\n" if $last_shader_only;
-
-print "\n";
-print "private:\n";
-print " QOpenGLFunctionsPrivate *d_ptr;\n";
-print " static bool isInitialized(const QOpenGLFunctionsPrivate *d) { return d != 0; }\n";
-print "};\n";
-print "\n";
-print "Q_DECLARE_OPERATORS_FOR_FLAGS(QOpenGLFunctions::OpenGLFeatures)\n";
-print "\n";
-print "struct QOpenGLFunctionsPrivate\n";
-print "{\n";
-print " QOpenGLFunctionsPrivate(const QGLContext *context = 0);\n";
-print "\n";
-print "#ifndef QT_OPENGL_ES_2";
-print "\n";
-
-# Output the function pointers into the QOpenGLFunctionsPrivate class.
-$last_shader_only = 0;
-foreach ( @functions ) {
- my $shader_only = ($_->{'shader_only'} && $_->{'shader_only'} eq 'yes');
- my $inline = $_->{'inline'};
- next if ($inline && $inline eq 'all');
- next if $inline && $inline eq 'all_diff';
- my $name = $_->{'varname'};
- #print "#ifndef QT_OPENGL_ES_1\n" if ($shader_only && !$last_shader_only);
- #print "#endif\n" if (!$shader_only && $last_shader_only);
- print " $_->{'returnType'} (QT3D_GLF_APIENTRYP $name)($_->{'argstr'});\n";
- $last_shader_only = $shader_only;
-}
-#print "#endif\n" if $last_shader_only;
-
-print "#endif\n";
-print "};\n";
-print "\n";
-
-my %platform_defines = ();
-$platform_defines{'es1'} = "defined(QT_OPENGL_ES_1)";
-$platform_defines{'es2'} = "defined(QT_OPENGL_ES_2)";
-$platform_defines{'es'} = "defined(QT_OPENGL_ES)";
-$platform_defines{'desktop'} = "!defined(QT_OPENGL_ES)";
-
-# Output the inline functions that call either the raw GL function
-# or resolve via the function pointer.
-$last_shader_only = 0;
-foreach ( @functions ) {
- my $shader_only = ($_->{'shader_only'} && $_->{'shader_only'} eq 'yes');
- my $funcname = $_->{'funcname'};
- my $varname = $_->{'varname'};
- my $is_void = ($_->{'returnType'} eq 'void');
- my $inline = $_->{'inline'};
- next if ($inline && $inline eq 'all');
- #print "#ifndef QT_OPENGL_ES_1\n\n" if ($shader_only && !$last_shader_only);
- #print "#endif\n\n" if (!$shader_only && $last_shader_only);
- print "inline $_->{'returnType'} QOpenGLFunctions::$funcname($_->{'argstr'})\n";
- print "{\n";
- if ($_->{'es_name'}) {
- # Functions like glClearDepth() that are inline, but named differently.
- print "#ifndef QT_OPENGL_ES\n";
- print " ::$_->{'name'}($_->{'argnamestr'});\n";
- print "#else\n";
- print " ::$_->{'es_name'}($_->{'argnamestr'});\n";
- print "#endif\n";
- } elsif ($inline && $inline eq 'all') {
- # Inlined on all platforms.
- if ($is_void) {
- print (" ");
- } else {
- print (" return ");
- }
- print "::$_->{'name'}($_->{'argnamestr'});\n";
- } elsif ($inline) {
- # Inlined only on certain platforms.
- my @platforms = split /,\s*/,$inline;
- my @defines = ();
- foreach (@platforms) {
- push @defines, $platform_defines{$_};
- }
- print "#if ";
- print join(' || ', @defines);
- print "\n";
- if ($is_void) {
- print (" ");
- } else {
- print (" return ");
- }
- print "::$_->{'name'}($_->{'argnamestr'});\n";
- print "#else\n";
- print " Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));\n";
- if ($is_void) {
- print (" ");
- } else {
- print (" return ");
- }
- print "d_ptr->$varname($_->{'argnamestr'});\n";
- print "#endif\n";
- } else {
- # Resolve on all platforms.
- print " Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));\n";
- if ($is_void) {
- print (" ");
- } else {
- print (" return ");
- }
- print "d_ptr->$varname($_->{'argnamestr'});\n";
- }
- print "}\n\n";
- $last_shader_only = $shader_only;
-}
-#print "#endif\n" if $last_shader_only;
-
-# Output the macro definitions.
-foreach ( @macros ) {
- my $name = $_->{'name'};
- my $value = $_->{'value'};
- print "#ifndef $name\n";
- print "#define $name $value\n";
- print "#endif\n";
-}
-print "\n";
-
-print "// qopenglfunctions.cpp\n\n";
-
-# Generate qdoc documentation for all of the functions.
-foreach ( @functions ) {
- my $inline = $_->{'inline'};
- next if $inline && $inline eq 'all';
-
- my $shader_only = ($_->{'shader_only'} && $_->{'shader_only'} eq 'yes');
-
- my $name = $_->{'funcname'};
-
- my $docargs = $_->{'argnamestr'};
- if (length($docargs) > 0) {
- $docargs =~ s/,/, \\a/g;
- $docargs =~ s/^/\\a /;
- }
-
- my $khronos_name = $_->{'es_name'};
- if (!$khronos_name) {
- $khronos_name = $_->{'name'};
- }
-
- print "/*!\n";
- print " \\fn $_->{'returnType'} QOpenGLFunctions::$name($_->{'argstr'})\n";
- print "\n";
- if ($khronos_name eq $_->{'name'}) {
- print " Convenience function that calls $khronos_name($docargs).\n";
- } else {
- print " Convenience function that calls $_->{'name'}($docargs) on\n";
- print " desktop OpenGL systems and $khronos_name($docargs) on\n";
- print " embedded OpenGL/ES systems.\n";
- }
- print "\n";
- print " For more information, see the OpenGL/ES 2.0 documentation for\n";
- print " \\l{http://www.khronos.org/opengles/sdk/docs/man/$khronos_name.xml}{$khronos_name()}.\n";
- if ($shader_only) {
- print "\n";
- print " This convenience function will do nothing on OpenGL/ES 1.x systems.\n";
- }
- print "*/\n\n";
-}
-
-# Generate the resolver functions.
-print "#ifndef QT_OPENGL_ES_2\n\n";
-$last_shader_only = 0;
-foreach ( @functions ) {
- my $inline = $_->{'inline'};
- next if $inline && $inline eq 'all';
- next if $inline && $inline eq 'all_diff';
- my $shader_only = ($_->{'shader_only'} && $_->{'shader_only'} eq 'yes');
- my $name = $_->{'varname'};
- my $resolver_name = $_->{'name'};
- $resolver_name =~ s/^gl/qglfResolve/;
- my $special_name = $_->{'name'};
- $special_name =~ s/^gl/qglfSpecial/;
- my @platforms = split /,\s*/,$inline;
- $shader_only = 1 if @platforms ~~ 'es1';
- my $is_void = ($_->{'returnType'} eq 'void');
- my $special_handling = ($_->{'special_handling'} && $_->{'special_handling'} eq 'yes');
- #print "#ifndef QT_OPENGL_ES_1\n\n" if ($shader_only && !$last_shader_only);
- #print "#endif\n\n" if (!$shader_only && $last_shader_only);
-
- if ($special_handling) {
- # Output special fallback implementations for certain functions.
- if ($name eq "getShaderPrecisionFormat") {
- print "static $_->{'returnType'} QT3D_GLF_APIENTRY $special_name($_->{'argstr'})\n";
- print "{\n";
- print " Q_UNUSED(shadertype);\n";
- print " Q_UNUSED(precisiontype);\n";
- print " range[0] = range[1] = precision[0] = 0;\n";
- print "}\n\n";
- } elsif ($name eq "isProgram" || $name eq "isShader") {
- print "static $_->{'returnType'} QT3D_GLF_APIENTRY $special_name($_->{'argstr'})\n";
- print "{\n";
- print " return $_->{'argnamestr'} != 0;\n";
- print "}\n\n";
- } elsif ($name eq "releaseShaderCompiler") {
- print "static $_->{'returnType'} QT3D_GLF_APIENTRY $special_name($_->{'argstr'})\n";
- print "{\n";
- print "}\n\n";
- }
- }
-
- print "static $_->{'returnType'} QT3D_GLF_APIENTRY $resolver_name($_->{'argstr'})\n";
- print "{\n";
- my $type_name = "type_$_->{'name'}";
- print " typedef $_->{'returnType'} (QT3D_GLF_APIENTRYP $type_name)($_->{'argstr'});\n\n";
- print " const QGLContext *context = QGLContext::currentContext();\n";
- print " QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);\n";
- print "\n";
- print " funcs->$name = ($type_name)\n";
- print " context->getProcAddress(QLatin1String(\"$_->{'name'}\"));\n";
- my @alt_names = ();
- if ($_->{'alt_name'}) {
- push @alt_names, $_->{'alt_name'};
- } else {
- push @alt_names, "$_->{'name'}OES";
- push @alt_names, "$_->{'name'}EXT";
- push @alt_names, "$_->{'name'}ARB";
- }
- foreach (@alt_names) {
- print "#ifdef QT_OPENGL_ES\n" if /OES/;
- print " if (!funcs->$name) {\n";
- print " funcs->$name = ($type_name)\n";
- print " context->getProcAddress(QLatin1String(\"$_\"));\n";
- print " }\n";
- print "#endif\n" if /OES/;
- }
- if ($special_handling) {
- print "\n";
- print " if (!funcs->$name)\n";
- print " funcs->$name = $special_name;\n\n";
- if ($is_void) {
- print (" ");
- } else {
- print (" return ");
- }
- print "funcs->$name($_->{'argnamestr'});\n";
- } else {
- print "\n";
- print " if (funcs->$name)\n";
- if ($is_void) {
- print (" ");
- } else {
- print (" return ");
- }
- print "funcs->$name($_->{'argnamestr'});\n";
- if ($is_void) {
- print " else\n";
- print " funcs->$name = $resolver_name;\n";
- } else {
- print " funcs->$name = $resolver_name;\n";
- print " return $_->{'returnType'}(0);\n";
- }
- }
- print "}\n\n";
-
- $last_shader_only = $shader_only;
-}
-#print "#endif\n" if $last_shader_only;
-print "#endif // !QT_OPENGL_ES_2\n\n";
-
-# Generate the initialization code for QOpenGLFunctionsPrivate.
-print "QOpenGLFunctionsPrivate::QOpenGLFunctionsPrivate(const QGLContext *)\n";
-print "{\n";
-print "#ifndef QT_OPENGL_ES_2\n";
-$last_shader_only = 0;
-foreach ( @functions ) {
- my $inline = $_->{'inline'};
- next if $inline && $inline eq 'all';
- next if $inline && $inline eq 'all_diff';
- my $shader_only = ($_->{'shader_only'} && $_->{'shader_only'} eq 'yes');
- my $name = $_->{'varname'};
- my $resolver_name = $_->{'name'};
- $resolver_name =~ s/^gl/qglfResolve/;
- my @platforms = split /,\s*/,$inline;
- $shader_only = 1 if @platforms ~~ 'es1';
- #print "#ifndef QT_OPENGL_ES_1\n" if ($shader_only && !$last_shader_only);
- #print "#endif\n" if (!$shader_only && $last_shader_only);
- print " $name = $resolver_name;\n";
- $last_shader_only = $shader_only;
-}
-#print "#endif\n" if $last_shader_only;
-print "#endif // !QT_OPENGL_ES_2\n";
-print "}\n\n";
-
-#print Dumper(\@functions);
diff --git a/src/threed/api/qopenglfunctions.cpp b/src/threed/api/qopenglfunctions.cpp
deleted file mode 100644
index fabf3e04..00000000
--- a/src/threed/api/qopenglfunctions.cpp
+++ /dev/null
@@ -1,3690 +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 "qopenglfunctions.h"
-#include "qglext_p.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QOpenGLFunctions
- \brief The QOpenGLFunctions class provides cross-platform access to the OpenGL/ES 2.0 API.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::enablers
-
- OpenGL/ES 2.0 defines a subset of the OpenGL specification that is
- common across many desktop and embedded OpenGL implementations.
- However, it can be difficult to use the functions from that subset
- because they need to be resolved manually on desktop systems.
-
- QOpenGLFunctions provides a guaranteed API that is available on all
- OpenGL systems and takes care of function resolution on systems
- that need it. The recommended way to use QOpenGLFunctions is by
- direct inheritance:
-
- \code
- class MyGLWidget : public QGLWidget, protected QOpenGLFunctions
- {
- Q_OBJECT
- public:
- MyGLWidget(QWidget *parent = 0) : QGLWidget(parent) {}
-
- protected:
- void initializeGL();
- void paintGL();
- };
-
- void MyGLWidget::initializeGL()
- {
- initializeGLFunctions();
- }
- \endcode
-
- The \c{paintGL()} function can then use any of the OpenGL/ES 2.0
- functions without explicit resolution, such as glActiveTexture()
- in the following example:
-
- \code
- void MyGLWidget::paintGL()
- {
- glActiveTexture(GL_TEXTURE1);
- glBindTexture(GL_TEXTURE_2D, textureId);
- ...
- }
- \endcode
-
- QOpenGLFunctions can also be used directly for ad-hoc invocation
- of OpenGL/ES 2.0 functions on all platforms:
-
- \code
- QOpenGLFunctions glFuncs(QGLContext::currentContext());
- glFuncs.glActiveTexture(GL_TEXTURE1);
- \endcode
-
- QOpenGLFunctions provides wrappers for all OpenGL/ES 2.0 functions,
- except those like \c{glDrawArrays()}, \c{glViewport()}, and
- \c{glBindTexture()} that don't have portability issues.
-
- Including the header for QOpenGLFunctions will also define all of
- the OpenGL/ES 2.0 macro constants that are not already defined by
- the system's OpenGL headers, such as \c{GL_TEXTURE1} above.
-
- The hasOpenGLFeature() and openGLFeatures() functions can be used
- to determine if the OpenGL implementation has a major OpenGL/ES 2.0
- feature. For example, the following checks if non power of two
- textures are available:
-
- \code
- QOpenGLFunctions funcs(QGLContext::currentContext());
- bool npot = funcs.hasOpenGLFeature(QOpenGLFunctions::NPOTTextures);
- \endcode
-*/
-
-/*!
- \enum QOpenGLFunctions::OpenGLFeature
- This enum defines OpenGL/ES 2.0 features that may be optional
- on other platforms.
-
- \value Multitexture glActiveTexture() function is available.
- \value Shaders Shader functions are available.
- \value Buffers Vertex and index buffer functions are available.
- \value Framebuffers Framebuffer object functions are available.
- \value BlendColor glBlendColor() is available.
- \value BlendEquation glBlendEquation() is available.
- \value BlendEquationSeparate glBlendEquationSeparate() is available.
- \value BlendFuncSeparate glBlendFuncSeparate() is available.
- \value BlendSubtract Blend subtract mode is available.
- \value CompressedTextures Compressed texture functions are available.
- \value Multisample glSampleCoverage() function is available.
- \value StencilSeparate Separate stencil functions are available.
- \value NPOTTextures Non power of two textures are available.
-*/
-
-// Hidden private fields for additional extension data.
-// Hidden private fields for additional extension data.
-struct QOpenGLFunctionsPrivateEx : public QOpenGLFunctionsPrivate
-{
- QOpenGLFunctionsPrivateEx(const QGLContext *context = 0)
- : QOpenGLFunctionsPrivate(context)
- , m_features(-1) {}
-
- int m_features;
-};
-
-Q_GLOBAL_STATIC(QGLResource<QOpenGLFunctionsPrivateEx>, qt_gl_functions_resource)
-
-static QOpenGLFunctionsPrivateEx *qt_gl_functions(const QGLContext *context = 0)
-{
- if (!context)
- context = QGLContext::currentContext();
- Q_ASSERT(context);
- return qt_gl_functions_resource()->value(context);
-}
-
-/*!
- Constructs a default function resolver. The resolver cannot
- be used until initializeGLFunctions() is called to specify
- the context.
-
- \sa initializeGLFunctions()
-*/
-QOpenGLFunctions::QOpenGLFunctions()
- : d_ptr(0)
-{
-}
-
-/*!
- Constructs a function resolver for \a context. If \a context
- is null, then the resolver will be created for the current QGLContext.
-
- An object constructed in this way can only be used with \a context
- and other contexts that share with it. Use initializeGLFunctions()
- to change the object's context association.
-
- \sa initializeGLFunctions()
-*/
-QOpenGLFunctions::QOpenGLFunctions(const QGLContext *context)
- : d_ptr(qt_gl_functions(context))
-{
-}
-
-/*!
- \fn QOpenGLFunctions::~QOpenGLFunctions()
-
- Destroys this function resolver.
-*/
-
-static int qt_gl_resolve_features()
-{
-#if defined(QT_OPENGL_ES_2)
- return QOpenGLFunctions::Multitexture |
- QOpenGLFunctions::Shaders |
- QOpenGLFunctions::Buffers |
- QOpenGLFunctions::Framebuffers |
- QOpenGLFunctions::BlendColor |
- QOpenGLFunctions::BlendEquation |
- QOpenGLFunctions::BlendEquationSeparate |
- QOpenGLFunctions::BlendFuncSeparate |
- QOpenGLFunctions::BlendSubtract |
- QOpenGLFunctions::CompressedTextures |
- QOpenGLFunctions::Multisample |
- QOpenGLFunctions::StencilSeparate |
- QOpenGLFunctions::NPOTTextures;
-#elif defined(QT_OPENGL_ES)
- int features = QOpenGLFunctions::Multitexture |
- QOpenGLFunctions::Buffers |
- QOpenGLFunctions::CompressedTextures |
- QOpenGLFunctions::Multisample;
- QGLExtensionChecker extensions(reinterpret_cast<const char *>(glGetString(GL_EXTENSIONS)));
- if (extensions.match("GL_OES_framebuffer_object"))
- features |= QOpenGLFunctions::Framebuffers;
- if (extensions.match("GL_OES_blend_equation_separate"))
- features |= QOpenGLFunctions::BlendEquationSeparate;
- if (extensions.match("GL_OES_blend_func_separate"))
- features |= QOpenGLFunctions::BlendFuncSeparate;
- if (extensions.match("GL_OES_blend_subtract"))
- features |= QOpenGLFunctions::BlendSubtract;
- if (extensions.match("GL_OES_texture_npot"))
- features |= QOpenGLFunctions::NPOTTextures;
- return features;
-#else
- int features = 0;
- QGLFormat::OpenGLVersionFlags versions = QGLFormat::openGLVersionFlags();
- QGLExtensionChecker extensions(reinterpret_cast<const char *>(glGetString(GL_EXTENSIONS)));
-
- // Recognize features by extension name.
- if (extensions.match("GL_ARB_multitexture"))
- features |= QOpenGLFunctions::Multitexture;
- if (extensions.match("GL_ARB_shader_objects"))
- features |= QOpenGLFunctions::Shaders;
- if (extensions.match("GL_EXT_framebuffer_object") ||
- extensions.match("GL_ARB_framebuffer_object"))
- features |= QOpenGLFunctions::Framebuffers;
- if (extensions.match("GL_EXT_blend_color"))
- features |= QOpenGLFunctions::BlendColor;
- if (extensions.match("GL_EXT_blend_equation_separate"))
- features |= QOpenGLFunctions::BlendEquationSeparate;
- if (extensions.match("GL_EXT_blend_func_separate"))
- features |= QOpenGLFunctions::BlendFuncSeparate;
- if (extensions.match("GL_EXT_blend_subtract"))
- features |= QOpenGLFunctions::BlendSubtract;
- if (extensions.match("GL_ARB_texture_compression"))
- features |= QOpenGLFunctions::CompressedTextures;
- if (extensions.match("GL_ARB_multisample"))
- features |= QOpenGLFunctions::Multisample;
- if (extensions.match("GL_ARB_texture_non_power_of_two"))
- features |= QOpenGLFunctions::NPOTTextures;
-
- // Recognize features by minimum OpenGL version.
- if (versions & QGLFormat::OpenGL_Version_1_2) {
- features |= QOpenGLFunctions::BlendColor |
- QOpenGLFunctions::BlendEquation;
- }
- if (versions & QGLFormat::OpenGL_Version_1_3) {
- features |= QOpenGLFunctions::Multitexture |
- QOpenGLFunctions::CompressedTextures |
- QOpenGLFunctions::Multisample;
- }
- if (versions & QGLFormat::OpenGL_Version_1_4)
- features |= QOpenGLFunctions::BlendFuncSeparate;
- if (versions & QGLFormat::OpenGL_Version_1_5)
- features |= QOpenGLFunctions::Buffers;
- if (versions & QGLFormat::OpenGL_Version_2_0) {
- features |= QOpenGLFunctions::Shaders |
- QOpenGLFunctions::StencilSeparate |
- QOpenGLFunctions::BlendEquationSeparate |
- QOpenGLFunctions::NPOTTextures;
- }
- return features;
-#endif
-}
-
-/*!
- Returns the set of features that are present on this system's
- OpenGL implementation.
-
- It is assumed that the QGLContext associated with this function
- resolver is current.
-
- \sa hasOpenGLFeature()
-*/
-QOpenGLFunctions::OpenGLFeatures QOpenGLFunctions::openGLFeatures() const
-{
- QOpenGLFunctionsPrivateEx *d = static_cast<QOpenGLFunctionsPrivateEx *>(d_ptr);
- if (!d)
- return 0;
- if (d->m_features == -1)
- d->m_features = qt_gl_resolve_features();
- return QOpenGLFunctions::OpenGLFeatures(d->m_features);
-}
-
-/*!
- Returns true if \a feature is present on this system's OpenGL
- implementation; false otherwise.
-
- It is assumed that the QGLContext associated with this function
- resolver is current.
-
- \sa openGLFeatures()
-*/
-bool QOpenGLFunctions::hasOpenGLFeature(QOpenGLFunctions::OpenGLFeature feature) const
-{
- QOpenGLFunctionsPrivateEx *d = static_cast<QOpenGLFunctionsPrivateEx *>(d_ptr);
- if (!d)
- return false;
- if (d->m_features == -1)
- d->m_features = qt_gl_resolve_features();
- return (d->m_features & int(feature)) != 0;
-}
-
-/*!
- Initializes GL function resolution for \a context. If \a context
- is null, then the current QGLContext will be used.
-
- After calling this function, the QOpenGLFunctions object can only be
- used with \a context and other contexts that share with it.
- Call initializeGLFunctions() again to change the object's context
- association.
-*/
-void QOpenGLFunctions::initializeGLFunctions(const QGLContext *context)
-{
- d_ptr = qt_gl_functions(context);
-}
-
-
-/*!
- \fn void QOpenGLFunctions::glActiveTexture(GLenum texture)
-
- Convenience function that calls glActiveTexture(\a texture).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glActiveTexture.xml}{glActiveTexture()}.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glAttachShader(GLuint program, GLuint shader)
-
- Convenience function that calls glAttachShader(\a program, \a shader).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glAttachShader.xml}{glAttachShader()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glBindAttribLocation(GLuint program, GLuint index, const char* name)
-
- Convenience function that calls glBindAttribLocation(\a program, \a index, \a name).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glBindAttribLocation.xml}{glBindAttribLocation()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glBindBuffer(GLenum target, GLuint buffer)
-
- Convenience function that calls glBindBuffer(\a target, \a buffer).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glBindBuffer.xml}{glBindBuffer()}.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glBindFramebuffer(GLenum target, GLuint framebuffer)
-
- Convenience function that calls glBindFramebuffer(\a target, \a framebuffer).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glBindFramebuffer.xml}{glBindFramebuffer()}.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glBindRenderbuffer(GLenum target, GLuint renderbuffer)
-
- Convenience function that calls glBindRenderbuffer(\a target, \a renderbuffer).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glBindRenderbuffer.xml}{glBindRenderbuffer()}.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
-
- Convenience function that calls glBlendColor(\a red, \a green, \a blue, \a alpha).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glBlendColor.xml}{glBlendColor()}.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glBlendEquation(GLenum mode)
-
- Convenience function that calls glBlendEquation(\a mode).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glBlendEquation.xml}{glBlendEquation()}.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha)
-
- Convenience function that calls glBlendEquationSeparate(\a modeRGB, \a modeAlpha).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glBlendEquationSeparate.xml}{glBlendEquationSeparate()}.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
-
- Convenience function that calls glBlendFuncSeparate(\a srcRGB, \a dstRGB, \a srcAlpha, \a dstAlpha).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glBlendFuncSeparate.xml}{glBlendFuncSeparate()}.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glBufferData(GLenum target, qgl_GLsizeiptr size, const void* data, GLenum usage)
-
- Convenience function that calls glBufferData(\a target, \a size, \a data, \a usage).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glBufferData.xml}{glBufferData()}.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glBufferSubData(GLenum target, qgl_GLintptr offset, qgl_GLsizeiptr size, const void* data)
-
- Convenience function that calls glBufferSubData(\a target, \a offset, \a size, \a data).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glBufferSubData.xml}{glBufferSubData()}.
-*/
-
-/*!
- \fn GLenum QOpenGLFunctions::glCheckFramebufferStatus(GLenum target)
-
- Convenience function that calls glCheckFramebufferStatus(\a target).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glCheckFramebufferStatus.xml}{glCheckFramebufferStatus()}.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glClearDepthf(GLclampf depth)
-
- Convenience function that calls glClearDepth(\a depth) on
- desktop OpenGL systems and glClearDepthf(\a depth) on
- embedded OpenGL/ES systems.
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glClearDepthf.xml}{glClearDepthf()}.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glCompileShader(GLuint shader)
-
- Convenience function that calls glCompileShader(\a shader).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glCompileShader.xml}{glCompileShader()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data)
-
- Convenience function that calls glCompressedTexImage2D(\a target, \a level, \a internalformat, \a width, \a height, \a border, \a imageSize, \a data).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glCompressedTexImage2D.xml}{glCompressedTexImage2D()}.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data)
-
- Convenience function that calls glCompressedTexSubImage2D(\a target, \a level, \a xoffset, \a yoffset, \a width, \a height, \a format, \a imageSize, \a data).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glCompressedTexSubImage2D.xml}{glCompressedTexSubImage2D()}.
-*/
-
-/*!
- \fn GLuint QOpenGLFunctions::glCreateProgram()
-
- Convenience function that calls glCreateProgram().
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glCreateProgram.xml}{glCreateProgram()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn GLuint QOpenGLFunctions::glCreateShader(GLenum type)
-
- Convenience function that calls glCreateShader(\a type).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glCreateShader.xml}{glCreateShader()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glDeleteBuffers(GLsizei n, const GLuint* buffers)
-
- Convenience function that calls glDeleteBuffers(\a n, \a buffers).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glDeleteBuffers.xml}{glDeleteBuffers()}.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glDeleteFramebuffers(GLsizei n, const GLuint* framebuffers)
-
- Convenience function that calls glDeleteFramebuffers(\a n, \a framebuffers).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glDeleteFramebuffers.xml}{glDeleteFramebuffers()}.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glDeleteProgram(GLuint program)
-
- Convenience function that calls glDeleteProgram(\a program).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glDeleteProgram.xml}{glDeleteProgram()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers)
-
- Convenience function that calls glDeleteRenderbuffers(\a n, \a renderbuffers).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glDeleteRenderbuffers.xml}{glDeleteRenderbuffers()}.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glDeleteShader(GLuint shader)
-
- Convenience function that calls glDeleteShader(\a shader).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glDeleteShader.xml}{glDeleteShader()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glDepthRangef(GLclampf zNear, GLclampf zFar)
-
- Convenience function that calls glDepthRange(\a zNear, \a zFar) on
- desktop OpenGL systems and glDepthRangef(\a zNear, \a zFar) on
- embedded OpenGL/ES systems.
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glDepthRangef.xml}{glDepthRangef()}.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glDetachShader(GLuint program, GLuint shader)
-
- Convenience function that calls glDetachShader(\a program, \a shader).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glDetachShader.xml}{glDetachShader()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glDisableVertexAttribArray(GLuint index)
-
- Convenience function that calls glDisableVertexAttribArray(\a index).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glDisableVertexAttribArray.xml}{glDisableVertexAttribArray()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glEnableVertexAttribArray(GLuint index)
-
- Convenience function that calls glEnableVertexAttribArray(\a index).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glEnableVertexAttribArray.xml}{glEnableVertexAttribArray()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
-
- Convenience function that calls glFramebufferRenderbuffer(\a target, \a attachment, \a renderbuffertarget, \a renderbuffer).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glFramebufferRenderbuffer.xml}{glFramebufferRenderbuffer()}.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
-
- Convenience function that calls glFramebufferTexture2D(\a target, \a attachment, \a textarget, \a texture, \a level).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glFramebufferTexture2D.xml}{glFramebufferTexture2D()}.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glGenBuffers(GLsizei n, GLuint* buffers)
-
- Convenience function that calls glGenBuffers(\a n, \a buffers).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glGenBuffers.xml}{glGenBuffers()}.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glGenerateMipmap(GLenum target)
-
- Convenience function that calls glGenerateMipmap(\a target).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glGenerateMipmap.xml}{glGenerateMipmap()}.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glGenFramebuffers(GLsizei n, GLuint* framebuffers)
-
- Convenience function that calls glGenFramebuffers(\a n, \a framebuffers).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glGenFramebuffers.xml}{glGenFramebuffers()}.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glGenRenderbuffers(GLsizei n, GLuint* renderbuffers)
-
- Convenience function that calls glGenRenderbuffers(\a n, \a renderbuffers).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glGenRenderbuffers.xml}{glGenRenderbuffers()}.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
-
- Convenience function that calls glGetActiveAttrib(\a program, \a index, \a bufsize, \a length, \a size, \a type, \a name).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glGetActiveAttrib.xml}{glGetActiveAttrib()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
-
- Convenience function that calls glGetActiveUniform(\a program, \a index, \a bufsize, \a length, \a size, \a type, \a name).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glGetActiveUniform.xml}{glGetActiveUniform()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders)
-
- Convenience function that calls glGetAttachedShaders(\a program, \a maxcount, \a count, \a shaders).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glGetAttachedShaders.xml}{glGetAttachedShaders()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn int QOpenGLFunctions::glGetAttribLocation(GLuint program, const char* name)
-
- Convenience function that calls glGetAttribLocation(\a program, \a name).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glGetAttribLocation.xml}{glGetAttribLocation()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glGetBufferParameteriv(GLenum target, GLenum pname, GLint* params)
-
- Convenience function that calls glGetBufferParameteriv(\a target, \a pname, \a params).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glGetBufferParameteriv.xml}{glGetBufferParameteriv()}.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params)
-
- Convenience function that calls glGetFramebufferAttachmentParameteriv(\a target, \a attachment, \a pname, \a params).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glGetFramebufferAttachmentParameteriv.xml}{glGetFramebufferAttachmentParameteriv()}.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glGetProgramiv(GLuint program, GLenum pname, GLint* params)
-
- Convenience function that calls glGetProgramiv(\a program, \a pname, \a params).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glGetProgramiv.xml}{glGetProgramiv()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog)
-
- Convenience function that calls glGetProgramInfoLog(\a program, \a bufsize, \a length, \a infolog).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glGetProgramInfoLog.xml}{glGetProgramInfoLog()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params)
-
- Convenience function that calls glGetRenderbufferParameteriv(\a target, \a pname, \a params).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glGetRenderbufferParameteriv.xml}{glGetRenderbufferParameteriv()}.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glGetShaderiv(GLuint shader, GLenum pname, GLint* params)
-
- Convenience function that calls glGetShaderiv(\a shader, \a pname, \a params).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glGetShaderiv.xml}{glGetShaderiv()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog)
-
- Convenience function that calls glGetShaderInfoLog(\a shader, \a bufsize, \a length, \a infolog).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glGetShaderInfoLog.xml}{glGetShaderInfoLog()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
-
- Convenience function that calls glGetShaderPrecisionFormat(\a shadertype, \a precisiontype, \a range, \a precision).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glGetShaderPrecisionFormat.xml}{glGetShaderPrecisionFormat()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, char* source)
-
- Convenience function that calls glGetShaderSource(\a shader, \a bufsize, \a length, \a source).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glGetShaderSource.xml}{glGetShaderSource()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glGetUniformfv(GLuint program, GLint location, GLfloat* params)
-
- Convenience function that calls glGetUniformfv(\a program, \a location, \a params).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glGetUniformfv.xml}{glGetUniformfv()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glGetUniformiv(GLuint program, GLint location, GLint* params)
-
- Convenience function that calls glGetUniformiv(\a program, \a location, \a params).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glGetUniformiv.xml}{glGetUniformiv()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn int QOpenGLFunctions::glGetUniformLocation(GLuint program, const char* name)
-
- Convenience function that calls glGetUniformLocation(\a program, \a name).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glGetUniformLocation.xml}{glGetUniformLocation()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params)
-
- Convenience function that calls glGetVertexAttribfv(\a index, \a pname, \a params).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glGetVertexAttribfv.xml}{glGetVertexAttribfv()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glGetVertexAttribiv(GLuint index, GLenum pname, GLint* params)
-
- Convenience function that calls glGetVertexAttribiv(\a index, \a pname, \a params).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glGetVertexAttribiv.xml}{glGetVertexAttribiv()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glGetVertexAttribPointerv(GLuint index, GLenum pname, void** pointer)
-
- Convenience function that calls glGetVertexAttribPointerv(\a index, \a pname, \a pointer).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glGetVertexAttribPointerv.xml}{glGetVertexAttribPointerv()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn GLboolean QOpenGLFunctions::glIsBuffer(GLuint buffer)
-
- Convenience function that calls glIsBuffer(\a buffer).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glIsBuffer.xml}{glIsBuffer()}.
-*/
-
-/*!
- \fn GLboolean QOpenGLFunctions::glIsFramebuffer(GLuint framebuffer)
-
- Convenience function that calls glIsFramebuffer(\a framebuffer).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glIsFramebuffer.xml}{glIsFramebuffer()}.
-*/
-
-/*!
- \fn GLboolean QOpenGLFunctions::glIsProgram(GLuint program)
-
- Convenience function that calls glIsProgram(\a program).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glIsProgram.xml}{glIsProgram()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn GLboolean QOpenGLFunctions::glIsRenderbuffer(GLuint renderbuffer)
-
- Convenience function that calls glIsRenderbuffer(\a renderbuffer).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glIsRenderbuffer.xml}{glIsRenderbuffer()}.
-*/
-
-/*!
- \fn GLboolean QOpenGLFunctions::glIsShader(GLuint shader)
-
- Convenience function that calls glIsShader(\a shader).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glIsShader.xml}{glIsShader()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glLinkProgram(GLuint program)
-
- Convenience function that calls glLinkProgram(\a program).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glLinkProgram.xml}{glLinkProgram()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glReleaseShaderCompiler()
-
- Convenience function that calls glReleaseShaderCompiler().
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glReleaseShaderCompiler.xml}{glReleaseShaderCompiler()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
-
- Convenience function that calls glRenderbufferStorage(\a target, \a internalformat, \a width, \a height).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glRenderbufferStorage.xml}{glRenderbufferStorage()}.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glSampleCoverage(GLclampf value, GLboolean invert)
-
- Convenience function that calls glSampleCoverage(\a value, \a invert).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glSampleCoverage.xml}{glSampleCoverage()}.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glShaderBinary(GLint n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLint length)
-
- Convenience function that calls glShaderBinary(\a n, \a shaders, \a binaryformat, \a binary, \a length).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glShaderBinary.xml}{glShaderBinary()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glShaderSource(GLuint shader, GLsizei count, const char** string, const GLint* length)
-
- Convenience function that calls glShaderSource(\a shader, \a count, \a string, \a length).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glShaderSource.xml}{glShaderSource()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
-
- Convenience function that calls glStencilFuncSeparate(\a face, \a func, \a ref, \a mask).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glStencilFuncSeparate.xml}{glStencilFuncSeparate()}.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glStencilMaskSeparate(GLenum face, GLuint mask)
-
- Convenience function that calls glStencilMaskSeparate(\a face, \a mask).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glStencilMaskSeparate.xml}{glStencilMaskSeparate()}.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
-
- Convenience function that calls glStencilOpSeparate(\a face, \a fail, \a zfail, \a zpass).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glStencilOpSeparate.xml}{glStencilOpSeparate()}.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glUniform1f(GLint location, GLfloat x)
-
- Convenience function that calls glUniform1f(\a location, \a x).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform1f.xml}{glUniform1f()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glUniform1fv(GLint location, GLsizei count, const GLfloat* v)
-
- Convenience function that calls glUniform1fv(\a location, \a count, \a v).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform1fv.xml}{glUniform1fv()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glUniform1i(GLint location, GLint x)
-
- Convenience function that calls glUniform1i(\a location, \a x).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform1i.xml}{glUniform1i()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glUniform1iv(GLint location, GLsizei count, const GLint* v)
-
- Convenience function that calls glUniform1iv(\a location, \a count, \a v).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform1iv.xml}{glUniform1iv()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glUniform2f(GLint location, GLfloat x, GLfloat y)
-
- Convenience function that calls glUniform2f(\a location, \a x, \a y).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform2f.xml}{glUniform2f()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glUniform2fv(GLint location, GLsizei count, const GLfloat* v)
-
- Convenience function that calls glUniform2fv(\a location, \a count, \a v).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform2fv.xml}{glUniform2fv()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glUniform2i(GLint location, GLint x, GLint y)
-
- Convenience function that calls glUniform2i(\a location, \a x, \a y).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform2i.xml}{glUniform2i()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glUniform2iv(GLint location, GLsizei count, const GLint* v)
-
- Convenience function that calls glUniform2iv(\a location, \a count, \a v).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform2iv.xml}{glUniform2iv()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z)
-
- Convenience function that calls glUniform3f(\a location, \a x, \a y, \a z).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform3f.xml}{glUniform3f()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glUniform3fv(GLint location, GLsizei count, const GLfloat* v)
-
- Convenience function that calls glUniform3fv(\a location, \a count, \a v).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform3fv.xml}{glUniform3fv()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glUniform3i(GLint location, GLint x, GLint y, GLint z)
-
- Convenience function that calls glUniform3i(\a location, \a x, \a y, \a z).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform3i.xml}{glUniform3i()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glUniform3iv(GLint location, GLsizei count, const GLint* v)
-
- Convenience function that calls glUniform3iv(\a location, \a count, \a v).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform3iv.xml}{glUniform3iv()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-
- Convenience function that calls glUniform4f(\a location, \a x, \a y, \a z, \a w).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform4f.xml}{glUniform4f()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glUniform4fv(GLint location, GLsizei count, const GLfloat* v)
-
- Convenience function that calls glUniform4fv(\a location, \a count, \a v).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform4fv.xml}{glUniform4fv()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w)
-
- Convenience function that calls glUniform4i(\a location, \a x, \a y, \a z, \a w).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform4i.xml}{glUniform4i()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glUniform4iv(GLint location, GLsizei count, const GLint* v)
-
- Convenience function that calls glUniform4iv(\a location, \a count, \a v).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glUniform4iv.xml}{glUniform4iv()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
-
- Convenience function that calls glUniformMatrix2fv(\a location, \a count, \a transpose, \a value).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glUniformMatrix2fv.xml}{glUniformMatrix2fv()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
-
- Convenience function that calls glUniformMatrix3fv(\a location, \a count, \a transpose, \a value).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glUniformMatrix3fv.xml}{glUniformMatrix3fv()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
-
- Convenience function that calls glUniformMatrix4fv(\a location, \a count, \a transpose, \a value).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glUniformMatrix4fv.xml}{glUniformMatrix4fv()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glUseProgram(GLuint program)
-
- Convenience function that calls glUseProgram(\a program).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glUseProgram.xml}{glUseProgram()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glValidateProgram(GLuint program)
-
- Convenience function that calls glValidateProgram(\a program).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glValidateProgram.xml}{glValidateProgram()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glVertexAttrib1f(GLuint indx, GLfloat x)
-
- Convenience function that calls glVertexAttrib1f(\a indx, \a x).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib1f.xml}{glVertexAttrib1f()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glVertexAttrib1fv(GLuint indx, const GLfloat* values)
-
- Convenience function that calls glVertexAttrib1fv(\a indx, \a values).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib1fv.xml}{glVertexAttrib1fv()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y)
-
- Convenience function that calls glVertexAttrib2f(\a indx, \a x, \a y).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib2f.xml}{glVertexAttrib2f()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glVertexAttrib2fv(GLuint indx, const GLfloat* values)
-
- Convenience function that calls glVertexAttrib2fv(\a indx, \a values).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib2fv.xml}{glVertexAttrib2fv()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z)
-
- Convenience function that calls glVertexAttrib3f(\a indx, \a x, \a y, \a z).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib3f.xml}{glVertexAttrib3f()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glVertexAttrib3fv(GLuint indx, const GLfloat* values)
-
- Convenience function that calls glVertexAttrib3fv(\a indx, \a values).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib3fv.xml}{glVertexAttrib3fv()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-
- Convenience function that calls glVertexAttrib4f(\a indx, \a x, \a y, \a z, \a w).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib4f.xml}{glVertexAttrib4f()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glVertexAttrib4fv(GLuint indx, const GLfloat* values)
-
- Convenience function that calls glVertexAttrib4fv(\a indx, \a values).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttrib4fv.xml}{glVertexAttrib4fv()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-/*!
- \fn void QOpenGLFunctions::glVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr)
-
- Convenience function that calls glVertexAttribPointer(\a indx, \a size, \a type, \a normalized, \a stride, \a ptr).
-
- For more information, see the OpenGL/ES 2.0 documentation for
- \l{http://www.khronos.org/opengles/sdk/docs/man/glVertexAttribPointer.xml}{glVertexAttribPointer()}.
-
- This convenience function will do nothing on OpenGL/ES 1.x systems.
-*/
-
-#ifndef QT_OPENGL_ES_2
-
-static void QT3D_GLF_APIENTRY qglfResolveActiveTexture(GLenum texture)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glActiveTexture)(GLenum texture);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->activeTexture = (type_glActiveTexture)
- context->getProcAddress(QLatin1String("glActiveTexture"));
- if (!funcs->activeTexture) {
- funcs->activeTexture = (type_glActiveTexture)
- context->getProcAddress(QLatin1String("glActiveTextureARB"));
- }
-
- if (funcs->activeTexture)
- funcs->activeTexture(texture);
- else
- funcs->activeTexture = qglfResolveActiveTexture;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveAttachShader(GLuint program, GLuint shader)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glAttachShader)(GLuint program, GLuint shader);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->attachShader = (type_glAttachShader)
- context->getProcAddress(QLatin1String("glAttachShader"));
- if (!funcs->attachShader) {
- funcs->attachShader = (type_glAttachShader)
- context->getProcAddress(QLatin1String("glAttachObjectARB"));
- }
-
- if (funcs->attachShader)
- funcs->attachShader(program, shader);
- else
- funcs->attachShader = qglfResolveAttachShader;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveBindAttribLocation(GLuint program, GLuint index, const char* name)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glBindAttribLocation)(GLuint program, GLuint index, const char* name);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->bindAttribLocation = (type_glBindAttribLocation)
- context->getProcAddress(QLatin1String("glBindAttribLocation"));
- if (!funcs->bindAttribLocation) {
- funcs->bindAttribLocation = (type_glBindAttribLocation)
- context->getProcAddress(QLatin1String("glBindAttribLocationARB"));
- }
-
- if (funcs->bindAttribLocation)
- funcs->bindAttribLocation(program, index, name);
- else
- funcs->bindAttribLocation = qglfResolveBindAttribLocation;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveBindBuffer(GLenum target, GLuint buffer)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glBindBuffer)(GLenum target, GLuint buffer);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->bindBuffer = (type_glBindBuffer)
- context->getProcAddress(QLatin1String("glBindBuffer"));
-#ifdef QT_OPENGL_ES
- if (!funcs->bindBuffer) {
- funcs->bindBuffer = (type_glBindBuffer)
- context->getProcAddress(QLatin1String("glBindBufferOES"));
- }
-#endif
- if (!funcs->bindBuffer) {
- funcs->bindBuffer = (type_glBindBuffer)
- context->getProcAddress(QLatin1String("glBindBufferEXT"));
- }
- if (!funcs->bindBuffer) {
- funcs->bindBuffer = (type_glBindBuffer)
- context->getProcAddress(QLatin1String("glBindBufferARB"));
- }
-
- if (funcs->bindBuffer)
- funcs->bindBuffer(target, buffer);
- else
- funcs->bindBuffer = qglfResolveBindBuffer;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveBindFramebuffer(GLenum target, GLuint framebuffer)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glBindFramebuffer)(GLenum target, GLuint framebuffer);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->bindFramebuffer = (type_glBindFramebuffer)
- context->getProcAddress(QLatin1String("glBindFramebuffer"));
-#ifdef QT_OPENGL_ES
- if (!funcs->bindFramebuffer) {
- funcs->bindFramebuffer = (type_glBindFramebuffer)
- context->getProcAddress(QLatin1String("glBindFramebufferOES"));
- }
-#endif
- if (!funcs->bindFramebuffer) {
- funcs->bindFramebuffer = (type_glBindFramebuffer)
- context->getProcAddress(QLatin1String("glBindFramebufferEXT"));
- }
- if (!funcs->bindFramebuffer) {
- funcs->bindFramebuffer = (type_glBindFramebuffer)
- context->getProcAddress(QLatin1String("glBindFramebufferARB"));
- }
-
- if (funcs->bindFramebuffer)
- funcs->bindFramebuffer(target, framebuffer);
- else
- funcs->bindFramebuffer = qglfResolveBindFramebuffer;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveBindRenderbuffer(GLenum target, GLuint renderbuffer)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glBindRenderbuffer)(GLenum target, GLuint renderbuffer);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->bindRenderbuffer = (type_glBindRenderbuffer)
- context->getProcAddress(QLatin1String("glBindRenderbuffer"));
-#ifdef QT_OPENGL_ES
- if (!funcs->bindRenderbuffer) {
- funcs->bindRenderbuffer = (type_glBindRenderbuffer)
- context->getProcAddress(QLatin1String("glBindRenderbufferOES"));
- }
-#endif
- if (!funcs->bindRenderbuffer) {
- funcs->bindRenderbuffer = (type_glBindRenderbuffer)
- context->getProcAddress(QLatin1String("glBindRenderbufferEXT"));
- }
- if (!funcs->bindRenderbuffer) {
- funcs->bindRenderbuffer = (type_glBindRenderbuffer)
- context->getProcAddress(QLatin1String("glBindRenderbufferARB"));
- }
-
- if (funcs->bindRenderbuffer)
- funcs->bindRenderbuffer(target, renderbuffer);
- else
- funcs->bindRenderbuffer = qglfResolveBindRenderbuffer;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glBlendColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->blendColor = (type_glBlendColor)
- context->getProcAddress(QLatin1String("glBlendColor"));
-#ifdef QT_OPENGL_ES
- if (!funcs->blendColor) {
- funcs->blendColor = (type_glBlendColor)
- context->getProcAddress(QLatin1String("glBlendColorOES"));
- }
-#endif
- if (!funcs->blendColor) {
- funcs->blendColor = (type_glBlendColor)
- context->getProcAddress(QLatin1String("glBlendColorEXT"));
- }
- if (!funcs->blendColor) {
- funcs->blendColor = (type_glBlendColor)
- context->getProcAddress(QLatin1String("glBlendColorARB"));
- }
-
- if (funcs->blendColor)
- funcs->blendColor(red, green, blue, alpha);
- else
- funcs->blendColor = qglfResolveBlendColor;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveBlendEquation(GLenum mode)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glBlendEquation)(GLenum mode);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->blendEquation = (type_glBlendEquation)
- context->getProcAddress(QLatin1String("glBlendEquation"));
-#ifdef QT_OPENGL_ES
- if (!funcs->blendEquation) {
- funcs->blendEquation = (type_glBlendEquation)
- context->getProcAddress(QLatin1String("glBlendEquationOES"));
- }
-#endif
- if (!funcs->blendEquation) {
- funcs->blendEquation = (type_glBlendEquation)
- context->getProcAddress(QLatin1String("glBlendEquationEXT"));
- }
- if (!funcs->blendEquation) {
- funcs->blendEquation = (type_glBlendEquation)
- context->getProcAddress(QLatin1String("glBlendEquationARB"));
- }
-
- if (funcs->blendEquation)
- funcs->blendEquation(mode);
- else
- funcs->blendEquation = qglfResolveBlendEquation;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glBlendEquationSeparate)(GLenum modeRGB, GLenum modeAlpha);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->blendEquationSeparate = (type_glBlendEquationSeparate)
- context->getProcAddress(QLatin1String("glBlendEquationSeparate"));
-#ifdef QT_OPENGL_ES
- if (!funcs->blendEquationSeparate) {
- funcs->blendEquationSeparate = (type_glBlendEquationSeparate)
- context->getProcAddress(QLatin1String("glBlendEquationSeparateOES"));
- }
-#endif
- if (!funcs->blendEquationSeparate) {
- funcs->blendEquationSeparate = (type_glBlendEquationSeparate)
- context->getProcAddress(QLatin1String("glBlendEquationSeparateEXT"));
- }
- if (!funcs->blendEquationSeparate) {
- funcs->blendEquationSeparate = (type_glBlendEquationSeparate)
- context->getProcAddress(QLatin1String("glBlendEquationSeparateARB"));
- }
-
- if (funcs->blendEquationSeparate)
- funcs->blendEquationSeparate(modeRGB, modeAlpha);
- else
- funcs->blendEquationSeparate = qglfResolveBlendEquationSeparate;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glBlendFuncSeparate)(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->blendFuncSeparate = (type_glBlendFuncSeparate)
- context->getProcAddress(QLatin1String("glBlendFuncSeparate"));
-#ifdef QT_OPENGL_ES
- if (!funcs->blendFuncSeparate) {
- funcs->blendFuncSeparate = (type_glBlendFuncSeparate)
- context->getProcAddress(QLatin1String("glBlendFuncSeparateOES"));
- }
-#endif
- if (!funcs->blendFuncSeparate) {
- funcs->blendFuncSeparate = (type_glBlendFuncSeparate)
- context->getProcAddress(QLatin1String("glBlendFuncSeparateEXT"));
- }
- if (!funcs->blendFuncSeparate) {
- funcs->blendFuncSeparate = (type_glBlendFuncSeparate)
- context->getProcAddress(QLatin1String("glBlendFuncSeparateARB"));
- }
-
- if (funcs->blendFuncSeparate)
- funcs->blendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
- else
- funcs->blendFuncSeparate = qglfResolveBlendFuncSeparate;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveBufferData(GLenum target, qgl_GLsizeiptr size, const void* data, GLenum usage)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glBufferData)(GLenum target, qgl_GLsizeiptr size, const void* data, GLenum usage);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->bufferData = (type_glBufferData)
- context->getProcAddress(QLatin1String("glBufferData"));
-#ifdef QT_OPENGL_ES
- if (!funcs->bufferData) {
- funcs->bufferData = (type_glBufferData)
- context->getProcAddress(QLatin1String("glBufferDataOES"));
- }
-#endif
- if (!funcs->bufferData) {
- funcs->bufferData = (type_glBufferData)
- context->getProcAddress(QLatin1String("glBufferDataEXT"));
- }
- if (!funcs->bufferData) {
- funcs->bufferData = (type_glBufferData)
- context->getProcAddress(QLatin1String("glBufferDataARB"));
- }
-
- if (funcs->bufferData)
- funcs->bufferData(target, size, data, usage);
- else
- funcs->bufferData = qglfResolveBufferData;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveBufferSubData(GLenum target, qgl_GLintptr offset, qgl_GLsizeiptr size, const void* data)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glBufferSubData)(GLenum target, qgl_GLintptr offset, qgl_GLsizeiptr size, const void* data);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->bufferSubData = (type_glBufferSubData)
- context->getProcAddress(QLatin1String("glBufferSubData"));
-#ifdef QT_OPENGL_ES
- if (!funcs->bufferSubData) {
- funcs->bufferSubData = (type_glBufferSubData)
- context->getProcAddress(QLatin1String("glBufferSubDataOES"));
- }
-#endif
- if (!funcs->bufferSubData) {
- funcs->bufferSubData = (type_glBufferSubData)
- context->getProcAddress(QLatin1String("glBufferSubDataEXT"));
- }
- if (!funcs->bufferSubData) {
- funcs->bufferSubData = (type_glBufferSubData)
- context->getProcAddress(QLatin1String("glBufferSubDataARB"));
- }
-
- if (funcs->bufferSubData)
- funcs->bufferSubData(target, offset, size, data);
- else
- funcs->bufferSubData = qglfResolveBufferSubData;
-}
-
-static GLenum QT3D_GLF_APIENTRY qglfResolveCheckFramebufferStatus(GLenum target)
-{
- typedef GLenum (QT3D_GLF_APIENTRYP type_glCheckFramebufferStatus)(GLenum target);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->checkFramebufferStatus = (type_glCheckFramebufferStatus)
- context->getProcAddress(QLatin1String("glCheckFramebufferStatus"));
-#ifdef QT_OPENGL_ES
- if (!funcs->checkFramebufferStatus) {
- funcs->checkFramebufferStatus = (type_glCheckFramebufferStatus)
- context->getProcAddress(QLatin1String("glCheckFramebufferStatusOES"));
- }
-#endif
- if (!funcs->checkFramebufferStatus) {
- funcs->checkFramebufferStatus = (type_glCheckFramebufferStatus)
- context->getProcAddress(QLatin1String("glCheckFramebufferStatusEXT"));
- }
- if (!funcs->checkFramebufferStatus) {
- funcs->checkFramebufferStatus = (type_glCheckFramebufferStatus)
- context->getProcAddress(QLatin1String("glCheckFramebufferStatusARB"));
- }
-
- if (funcs->checkFramebufferStatus)
- return funcs->checkFramebufferStatus(target);
- funcs->checkFramebufferStatus = qglfResolveCheckFramebufferStatus;
- return GLenum(0);
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveCompileShader(GLuint shader)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glCompileShader)(GLuint shader);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->compileShader = (type_glCompileShader)
- context->getProcAddress(QLatin1String("glCompileShader"));
- if (!funcs->compileShader) {
- funcs->compileShader = (type_glCompileShader)
- context->getProcAddress(QLatin1String("glCompileShader"));
- }
-
- if (funcs->compileShader)
- funcs->compileShader(shader);
- else
- funcs->compileShader = qglfResolveCompileShader;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glCompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->compressedTexImage2D = (type_glCompressedTexImage2D)
- context->getProcAddress(QLatin1String("glCompressedTexImage2D"));
-#ifdef QT_OPENGL_ES
- if (!funcs->compressedTexImage2D) {
- funcs->compressedTexImage2D = (type_glCompressedTexImage2D)
- context->getProcAddress(QLatin1String("glCompressedTexImage2DOES"));
- }
-#endif
- if (!funcs->compressedTexImage2D) {
- funcs->compressedTexImage2D = (type_glCompressedTexImage2D)
- context->getProcAddress(QLatin1String("glCompressedTexImage2DEXT"));
- }
- if (!funcs->compressedTexImage2D) {
- funcs->compressedTexImage2D = (type_glCompressedTexImage2D)
- context->getProcAddress(QLatin1String("glCompressedTexImage2DARB"));
- }
-
- if (funcs->compressedTexImage2D)
- funcs->compressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data);
- else
- funcs->compressedTexImage2D = qglfResolveCompressedTexImage2D;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glCompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->compressedTexSubImage2D = (type_glCompressedTexSubImage2D)
- context->getProcAddress(QLatin1String("glCompressedTexSubImage2D"));
-#ifdef QT_OPENGL_ES
- if (!funcs->compressedTexSubImage2D) {
- funcs->compressedTexSubImage2D = (type_glCompressedTexSubImage2D)
- context->getProcAddress(QLatin1String("glCompressedTexSubImage2DOES"));
- }
-#endif
- if (!funcs->compressedTexSubImage2D) {
- funcs->compressedTexSubImage2D = (type_glCompressedTexSubImage2D)
- context->getProcAddress(QLatin1String("glCompressedTexSubImage2DEXT"));
- }
- if (!funcs->compressedTexSubImage2D) {
- funcs->compressedTexSubImage2D = (type_glCompressedTexSubImage2D)
- context->getProcAddress(QLatin1String("glCompressedTexSubImage2DARB"));
- }
-
- if (funcs->compressedTexSubImage2D)
- funcs->compressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);
- else
- funcs->compressedTexSubImage2D = qglfResolveCompressedTexSubImage2D;
-}
-
-static GLuint QT3D_GLF_APIENTRY qglfResolveCreateProgram()
-{
- typedef GLuint (QT3D_GLF_APIENTRYP type_glCreateProgram)();
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->createProgram = (type_glCreateProgram)
- context->getProcAddress(QLatin1String("glCreateProgram"));
- if (!funcs->createProgram) {
- funcs->createProgram = (type_glCreateProgram)
- context->getProcAddress(QLatin1String("glCreateProgramObjectARB"));
- }
-
- if (funcs->createProgram)
- return funcs->createProgram();
- funcs->createProgram = qglfResolveCreateProgram;
- return GLuint(0);
-}
-
-static GLuint QT3D_GLF_APIENTRY qglfResolveCreateShader(GLenum type)
-{
- typedef GLuint (QT3D_GLF_APIENTRYP type_glCreateShader)(GLenum type);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->createShader = (type_glCreateShader)
- context->getProcAddress(QLatin1String("glCreateShader"));
- if (!funcs->createShader) {
- funcs->createShader = (type_glCreateShader)
- context->getProcAddress(QLatin1String("glCreateShaderObjectARB"));
- }
-
- if (funcs->createShader)
- return funcs->createShader(type);
- funcs->createShader = qglfResolveCreateShader;
- return GLuint(0);
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveDeleteBuffers(GLsizei n, const GLuint* buffers)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glDeleteBuffers)(GLsizei n, const GLuint* buffers);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->deleteBuffers = (type_glDeleteBuffers)
- context->getProcAddress(QLatin1String("glDeleteBuffers"));
-#ifdef QT_OPENGL_ES
- if (!funcs->deleteBuffers) {
- funcs->deleteBuffers = (type_glDeleteBuffers)
- context->getProcAddress(QLatin1String("glDeleteBuffersOES"));
- }
-#endif
- if (!funcs->deleteBuffers) {
- funcs->deleteBuffers = (type_glDeleteBuffers)
- context->getProcAddress(QLatin1String("glDeleteBuffersEXT"));
- }
- if (!funcs->deleteBuffers) {
- funcs->deleteBuffers = (type_glDeleteBuffers)
- context->getProcAddress(QLatin1String("glDeleteBuffersARB"));
- }
-
- if (funcs->deleteBuffers)
- funcs->deleteBuffers(n, buffers);
- else
- funcs->deleteBuffers = qglfResolveDeleteBuffers;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveDeleteFramebuffers(GLsizei n, const GLuint* framebuffers)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glDeleteFramebuffers)(GLsizei n, const GLuint* framebuffers);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->deleteFramebuffers = (type_glDeleteFramebuffers)
- context->getProcAddress(QLatin1String("glDeleteFramebuffers"));
-#ifdef QT_OPENGL_ES
- if (!funcs->deleteFramebuffers) {
- funcs->deleteFramebuffers = (type_glDeleteFramebuffers)
- context->getProcAddress(QLatin1String("glDeleteFramebuffersOES"));
- }
-#endif
- if (!funcs->deleteFramebuffers) {
- funcs->deleteFramebuffers = (type_glDeleteFramebuffers)
- context->getProcAddress(QLatin1String("glDeleteFramebuffersEXT"));
- }
- if (!funcs->deleteFramebuffers) {
- funcs->deleteFramebuffers = (type_glDeleteFramebuffers)
- context->getProcAddress(QLatin1String("glDeleteFramebuffersARB"));
- }
-
- if (funcs->deleteFramebuffers)
- funcs->deleteFramebuffers(n, framebuffers);
- else
- funcs->deleteFramebuffers = qglfResolveDeleteFramebuffers;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveDeleteProgram(GLuint program)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glDeleteProgram)(GLuint program);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->deleteProgram = (type_glDeleteProgram)
- context->getProcAddress(QLatin1String("glDeleteProgram"));
- if (!funcs->deleteProgram) {
- funcs->deleteProgram = (type_glDeleteProgram)
- context->getProcAddress(QLatin1String("glDeleteObjectARB"));
- }
-
- if (funcs->deleteProgram)
- funcs->deleteProgram(program);
- else
- funcs->deleteProgram = qglfResolveDeleteProgram;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glDeleteRenderbuffers)(GLsizei n, const GLuint* renderbuffers);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->deleteRenderbuffers = (type_glDeleteRenderbuffers)
- context->getProcAddress(QLatin1String("glDeleteRenderbuffers"));
-#ifdef QT_OPENGL_ES
- if (!funcs->deleteRenderbuffers) {
- funcs->deleteRenderbuffers = (type_glDeleteRenderbuffers)
- context->getProcAddress(QLatin1String("glDeleteRenderbuffersOES"));
- }
-#endif
- if (!funcs->deleteRenderbuffers) {
- funcs->deleteRenderbuffers = (type_glDeleteRenderbuffers)
- context->getProcAddress(QLatin1String("glDeleteRenderbuffersEXT"));
- }
- if (!funcs->deleteRenderbuffers) {
- funcs->deleteRenderbuffers = (type_glDeleteRenderbuffers)
- context->getProcAddress(QLatin1String("glDeleteRenderbuffersARB"));
- }
-
- if (funcs->deleteRenderbuffers)
- funcs->deleteRenderbuffers(n, renderbuffers);
- else
- funcs->deleteRenderbuffers = qglfResolveDeleteRenderbuffers;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveDeleteShader(GLuint shader)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glDeleteShader)(GLuint shader);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->deleteShader = (type_glDeleteShader)
- context->getProcAddress(QLatin1String("glDeleteShader"));
- if (!funcs->deleteShader) {
- funcs->deleteShader = (type_glDeleteShader)
- context->getProcAddress(QLatin1String("glDeleteObjectARB"));
- }
-
- if (funcs->deleteShader)
- funcs->deleteShader(shader);
- else
- funcs->deleteShader = qglfResolveDeleteShader;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveDetachShader(GLuint program, GLuint shader)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glDetachShader)(GLuint program, GLuint shader);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->detachShader = (type_glDetachShader)
- context->getProcAddress(QLatin1String("glDetachShader"));
- if (!funcs->detachShader) {
- funcs->detachShader = (type_glDetachShader)
- context->getProcAddress(QLatin1String("glDetachObjectARB"));
- }
-
- if (funcs->detachShader)
- funcs->detachShader(program, shader);
- else
- funcs->detachShader = qglfResolveDetachShader;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveDisableVertexAttribArray(GLuint index)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glDisableVertexAttribArray)(GLuint index);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->disableVertexAttribArray = (type_glDisableVertexAttribArray)
- context->getProcAddress(QLatin1String("glDisableVertexAttribArray"));
- if (!funcs->disableVertexAttribArray) {
- funcs->disableVertexAttribArray = (type_glDisableVertexAttribArray)
- context->getProcAddress(QLatin1String("glDisableVertexAttribArrayARB"));
- }
-
- if (funcs->disableVertexAttribArray)
- funcs->disableVertexAttribArray(index);
- else
- funcs->disableVertexAttribArray = qglfResolveDisableVertexAttribArray;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveEnableVertexAttribArray(GLuint index)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glEnableVertexAttribArray)(GLuint index);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->enableVertexAttribArray = (type_glEnableVertexAttribArray)
- context->getProcAddress(QLatin1String("glEnableVertexAttribArray"));
- if (!funcs->enableVertexAttribArray) {
- funcs->enableVertexAttribArray = (type_glEnableVertexAttribArray)
- context->getProcAddress(QLatin1String("glEnableVertexAttribArrayARB"));
- }
-
- if (funcs->enableVertexAttribArray)
- funcs->enableVertexAttribArray(index);
- else
- funcs->enableVertexAttribArray = qglfResolveEnableVertexAttribArray;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glFramebufferRenderbuffer)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->framebufferRenderbuffer = (type_glFramebufferRenderbuffer)
- context->getProcAddress(QLatin1String("glFramebufferRenderbuffer"));
-#ifdef QT_OPENGL_ES
- if (!funcs->framebufferRenderbuffer) {
- funcs->framebufferRenderbuffer = (type_glFramebufferRenderbuffer)
- context->getProcAddress(QLatin1String("glFramebufferRenderbufferOES"));
- }
-#endif
- if (!funcs->framebufferRenderbuffer) {
- funcs->framebufferRenderbuffer = (type_glFramebufferRenderbuffer)
- context->getProcAddress(QLatin1String("glFramebufferRenderbufferEXT"));
- }
- if (!funcs->framebufferRenderbuffer) {
- funcs->framebufferRenderbuffer = (type_glFramebufferRenderbuffer)
- context->getProcAddress(QLatin1String("glFramebufferRenderbufferARB"));
- }
-
- if (funcs->framebufferRenderbuffer)
- funcs->framebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
- else
- funcs->framebufferRenderbuffer = qglfResolveFramebufferRenderbuffer;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glFramebufferTexture2D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->framebufferTexture2D = (type_glFramebufferTexture2D)
- context->getProcAddress(QLatin1String("glFramebufferTexture2D"));
-#ifdef QT_OPENGL_ES
- if (!funcs->framebufferTexture2D) {
- funcs->framebufferTexture2D = (type_glFramebufferTexture2D)
- context->getProcAddress(QLatin1String("glFramebufferTexture2DOES"));
- }
-#endif
- if (!funcs->framebufferTexture2D) {
- funcs->framebufferTexture2D = (type_glFramebufferTexture2D)
- context->getProcAddress(QLatin1String("glFramebufferTexture2DEXT"));
- }
- if (!funcs->framebufferTexture2D) {
- funcs->framebufferTexture2D = (type_glFramebufferTexture2D)
- context->getProcAddress(QLatin1String("glFramebufferTexture2DARB"));
- }
-
- if (funcs->framebufferTexture2D)
- funcs->framebufferTexture2D(target, attachment, textarget, texture, level);
- else
- funcs->framebufferTexture2D = qglfResolveFramebufferTexture2D;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveGenBuffers(GLsizei n, GLuint* buffers)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glGenBuffers)(GLsizei n, GLuint* buffers);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->genBuffers = (type_glGenBuffers)
- context->getProcAddress(QLatin1String("glGenBuffers"));
-#ifdef QT_OPENGL_ES
- if (!funcs->genBuffers) {
- funcs->genBuffers = (type_glGenBuffers)
- context->getProcAddress(QLatin1String("glGenBuffersOES"));
- }
-#endif
- if (!funcs->genBuffers) {
- funcs->genBuffers = (type_glGenBuffers)
- context->getProcAddress(QLatin1String("glGenBuffersEXT"));
- }
- if (!funcs->genBuffers) {
- funcs->genBuffers = (type_glGenBuffers)
- context->getProcAddress(QLatin1String("glGenBuffersARB"));
- }
-
- if (funcs->genBuffers)
- funcs->genBuffers(n, buffers);
- else
- funcs->genBuffers = qglfResolveGenBuffers;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveGenerateMipmap(GLenum target)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glGenerateMipmap)(GLenum target);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->generateMipmap = (type_glGenerateMipmap)
- context->getProcAddress(QLatin1String("glGenerateMipmap"));
-#ifdef QT_OPENGL_ES
- if (!funcs->generateMipmap) {
- funcs->generateMipmap = (type_glGenerateMipmap)
- context->getProcAddress(QLatin1String("glGenerateMipmapOES"));
- }
-#endif
- if (!funcs->generateMipmap) {
- funcs->generateMipmap = (type_glGenerateMipmap)
- context->getProcAddress(QLatin1String("glGenerateMipmapEXT"));
- }
- if (!funcs->generateMipmap) {
- funcs->generateMipmap = (type_glGenerateMipmap)
- context->getProcAddress(QLatin1String("glGenerateMipmapARB"));
- }
-
- if (funcs->generateMipmap)
- funcs->generateMipmap(target);
- else
- funcs->generateMipmap = qglfResolveGenerateMipmap;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveGenFramebuffers(GLsizei n, GLuint* framebuffers)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glGenFramebuffers)(GLsizei n, GLuint* framebuffers);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->genFramebuffers = (type_glGenFramebuffers)
- context->getProcAddress(QLatin1String("glGenFramebuffers"));
-#ifdef QT_OPENGL_ES
- if (!funcs->genFramebuffers) {
- funcs->genFramebuffers = (type_glGenFramebuffers)
- context->getProcAddress(QLatin1String("glGenFramebuffersOES"));
- }
-#endif
- if (!funcs->genFramebuffers) {
- funcs->genFramebuffers = (type_glGenFramebuffers)
- context->getProcAddress(QLatin1String("glGenFramebuffersEXT"));
- }
- if (!funcs->genFramebuffers) {
- funcs->genFramebuffers = (type_glGenFramebuffers)
- context->getProcAddress(QLatin1String("glGenFramebuffersARB"));
- }
-
- if (funcs->genFramebuffers)
- funcs->genFramebuffers(n, framebuffers);
- else
- funcs->genFramebuffers = qglfResolveGenFramebuffers;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveGenRenderbuffers(GLsizei n, GLuint* renderbuffers)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glGenRenderbuffers)(GLsizei n, GLuint* renderbuffers);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->genRenderbuffers = (type_glGenRenderbuffers)
- context->getProcAddress(QLatin1String("glGenRenderbuffers"));
-#ifdef QT_OPENGL_ES
- if (!funcs->genRenderbuffers) {
- funcs->genRenderbuffers = (type_glGenRenderbuffers)
- context->getProcAddress(QLatin1String("glGenRenderbuffersOES"));
- }
-#endif
- if (!funcs->genRenderbuffers) {
- funcs->genRenderbuffers = (type_glGenRenderbuffers)
- context->getProcAddress(QLatin1String("glGenRenderbuffersEXT"));
- }
- if (!funcs->genRenderbuffers) {
- funcs->genRenderbuffers = (type_glGenRenderbuffers)
- context->getProcAddress(QLatin1String("glGenRenderbuffersARB"));
- }
-
- if (funcs->genRenderbuffers)
- funcs->genRenderbuffers(n, renderbuffers);
- else
- funcs->genRenderbuffers = qglfResolveGenRenderbuffers;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glGetActiveAttrib)(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->getActiveAttrib = (type_glGetActiveAttrib)
- context->getProcAddress(QLatin1String("glGetActiveAttrib"));
- if (!funcs->getActiveAttrib) {
- funcs->getActiveAttrib = (type_glGetActiveAttrib)
- context->getProcAddress(QLatin1String("glGetActiveAttribARB"));
- }
-
- if (funcs->getActiveAttrib)
- funcs->getActiveAttrib(program, index, bufsize, length, size, type, name);
- else
- funcs->getActiveAttrib = qglfResolveGetActiveAttrib;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glGetActiveUniform)(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->getActiveUniform = (type_glGetActiveUniform)
- context->getProcAddress(QLatin1String("glGetActiveUniform"));
- if (!funcs->getActiveUniform) {
- funcs->getActiveUniform = (type_glGetActiveUniform)
- context->getProcAddress(QLatin1String("glGetActiveUniformARB"));
- }
-
- if (funcs->getActiveUniform)
- funcs->getActiveUniform(program, index, bufsize, length, size, type, name);
- else
- funcs->getActiveUniform = qglfResolveGetActiveUniform;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glGetAttachedShaders)(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->getAttachedShaders = (type_glGetAttachedShaders)
- context->getProcAddress(QLatin1String("glGetAttachedShaders"));
- if (!funcs->getAttachedShaders) {
- funcs->getAttachedShaders = (type_glGetAttachedShaders)
- context->getProcAddress(QLatin1String("glGetAttachedObjectsARB"));
- }
-
- if (funcs->getAttachedShaders)
- funcs->getAttachedShaders(program, maxcount, count, shaders);
- else
- funcs->getAttachedShaders = qglfResolveGetAttachedShaders;
-}
-
-static int QT3D_GLF_APIENTRY qglfResolveGetAttribLocation(GLuint program, const char* name)
-{
- typedef int (QT3D_GLF_APIENTRYP type_glGetAttribLocation)(GLuint program, const char* name);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->getAttribLocation = (type_glGetAttribLocation)
- context->getProcAddress(QLatin1String("glGetAttribLocation"));
- if (!funcs->getAttribLocation) {
- funcs->getAttribLocation = (type_glGetAttribLocation)
- context->getProcAddress(QLatin1String("glGetAttribLocationARB"));
- }
-
- if (funcs->getAttribLocation)
- return funcs->getAttribLocation(program, name);
- funcs->getAttribLocation = qglfResolveGetAttribLocation;
- return int(0);
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveGetBufferParameteriv(GLenum target, GLenum pname, GLint* params)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glGetBufferParameteriv)(GLenum target, GLenum pname, GLint* params);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->getBufferParameteriv = (type_glGetBufferParameteriv)
- context->getProcAddress(QLatin1String("glGetBufferParameteriv"));
-#ifdef QT_OPENGL_ES
- if (!funcs->getBufferParameteriv) {
- funcs->getBufferParameteriv = (type_glGetBufferParameteriv)
- context->getProcAddress(QLatin1String("glGetBufferParameterivOES"));
- }
-#endif
- if (!funcs->getBufferParameteriv) {
- funcs->getBufferParameteriv = (type_glGetBufferParameteriv)
- context->getProcAddress(QLatin1String("glGetBufferParameterivEXT"));
- }
- if (!funcs->getBufferParameteriv) {
- funcs->getBufferParameteriv = (type_glGetBufferParameteriv)
- context->getProcAddress(QLatin1String("glGetBufferParameterivARB"));
- }
-
- if (funcs->getBufferParameteriv)
- funcs->getBufferParameteriv(target, pname, params);
- else
- funcs->getBufferParameteriv = qglfResolveGetBufferParameteriv;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glGetFramebufferAttachmentParameteriv)(GLenum target, GLenum attachment, GLenum pname, GLint* params);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->getFramebufferAttachmentParameteriv = (type_glGetFramebufferAttachmentParameteriv)
- context->getProcAddress(QLatin1String("glGetFramebufferAttachmentParameteriv"));
-#ifdef QT_OPENGL_ES
- if (!funcs->getFramebufferAttachmentParameteriv) {
- funcs->getFramebufferAttachmentParameteriv = (type_glGetFramebufferAttachmentParameteriv)
- context->getProcAddress(QLatin1String("glGetFramebufferAttachmentParameterivOES"));
- }
-#endif
- if (!funcs->getFramebufferAttachmentParameteriv) {
- funcs->getFramebufferAttachmentParameteriv = (type_glGetFramebufferAttachmentParameteriv)
- context->getProcAddress(QLatin1String("glGetFramebufferAttachmentParameterivEXT"));
- }
- if (!funcs->getFramebufferAttachmentParameteriv) {
- funcs->getFramebufferAttachmentParameteriv = (type_glGetFramebufferAttachmentParameteriv)
- context->getProcAddress(QLatin1String("glGetFramebufferAttachmentParameterivARB"));
- }
-
- if (funcs->getFramebufferAttachmentParameteriv)
- funcs->getFramebufferAttachmentParameteriv(target, attachment, pname, params);
- else
- funcs->getFramebufferAttachmentParameteriv = qglfResolveGetFramebufferAttachmentParameteriv;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveGetProgramiv(GLuint program, GLenum pname, GLint* params)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glGetProgramiv)(GLuint program, GLenum pname, GLint* params);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->getProgramiv = (type_glGetProgramiv)
- context->getProcAddress(QLatin1String("glGetProgramiv"));
- if (!funcs->getProgramiv) {
- funcs->getProgramiv = (type_glGetProgramiv)
- context->getProcAddress(QLatin1String("glGetObjectParameterivARB"));
- }
-
- if (funcs->getProgramiv)
- funcs->getProgramiv(program, pname, params);
- else
- funcs->getProgramiv = qglfResolveGetProgramiv;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glGetProgramInfoLog)(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->getProgramInfoLog = (type_glGetProgramInfoLog)
- context->getProcAddress(QLatin1String("glGetProgramInfoLog"));
- if (!funcs->getProgramInfoLog) {
- funcs->getProgramInfoLog = (type_glGetProgramInfoLog)
- context->getProcAddress(QLatin1String("glGetInfoLogARB"));
- }
-
- if (funcs->getProgramInfoLog)
- funcs->getProgramInfoLog(program, bufsize, length, infolog);
- else
- funcs->getProgramInfoLog = qglfResolveGetProgramInfoLog;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glGetRenderbufferParameteriv)(GLenum target, GLenum pname, GLint* params);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->getRenderbufferParameteriv = (type_glGetRenderbufferParameteriv)
- context->getProcAddress(QLatin1String("glGetRenderbufferParameteriv"));
-#ifdef QT_OPENGL_ES
- if (!funcs->getRenderbufferParameteriv) {
- funcs->getRenderbufferParameteriv = (type_glGetRenderbufferParameteriv)
- context->getProcAddress(QLatin1String("glGetRenderbufferParameterivOES"));
- }
-#endif
- if (!funcs->getRenderbufferParameteriv) {
- funcs->getRenderbufferParameteriv = (type_glGetRenderbufferParameteriv)
- context->getProcAddress(QLatin1String("glGetRenderbufferParameterivEXT"));
- }
- if (!funcs->getRenderbufferParameteriv) {
- funcs->getRenderbufferParameteriv = (type_glGetRenderbufferParameteriv)
- context->getProcAddress(QLatin1String("glGetRenderbufferParameterivARB"));
- }
-
- if (funcs->getRenderbufferParameteriv)
- funcs->getRenderbufferParameteriv(target, pname, params);
- else
- funcs->getRenderbufferParameteriv = qglfResolveGetRenderbufferParameteriv;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveGetShaderiv(GLuint shader, GLenum pname, GLint* params)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glGetShaderiv)(GLuint shader, GLenum pname, GLint* params);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->getShaderiv = (type_glGetShaderiv)
- context->getProcAddress(QLatin1String("glGetShaderiv"));
- if (!funcs->getShaderiv) {
- funcs->getShaderiv = (type_glGetShaderiv)
- context->getProcAddress(QLatin1String("glGetObjectParameterivARB"));
- }
-
- if (funcs->getShaderiv)
- funcs->getShaderiv(shader, pname, params);
- else
- funcs->getShaderiv = qglfResolveGetShaderiv;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glGetShaderInfoLog)(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->getShaderInfoLog = (type_glGetShaderInfoLog)
- context->getProcAddress(QLatin1String("glGetShaderInfoLog"));
- if (!funcs->getShaderInfoLog) {
- funcs->getShaderInfoLog = (type_glGetShaderInfoLog)
- context->getProcAddress(QLatin1String("glGetInfoLogARB"));
- }
-
- if (funcs->getShaderInfoLog)
- funcs->getShaderInfoLog(shader, bufsize, length, infolog);
- else
- funcs->getShaderInfoLog = qglfResolveGetShaderInfoLog;
-}
-
-static void QT3D_GLF_APIENTRY qglfSpecialGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
-{
- Q_UNUSED(shadertype);
- Q_UNUSED(precisiontype);
- range[0] = range[1] = precision[0] = 0;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glGetShaderPrecisionFormat)(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->getShaderPrecisionFormat = (type_glGetShaderPrecisionFormat)
- context->getProcAddress(QLatin1String("glGetShaderPrecisionFormat"));
-#ifdef QT_OPENGL_ES
- if (!funcs->getShaderPrecisionFormat) {
- funcs->getShaderPrecisionFormat = (type_glGetShaderPrecisionFormat)
- context->getProcAddress(QLatin1String("glGetShaderPrecisionFormatOES"));
- }
-#endif
- if (!funcs->getShaderPrecisionFormat) {
- funcs->getShaderPrecisionFormat = (type_glGetShaderPrecisionFormat)
- context->getProcAddress(QLatin1String("glGetShaderPrecisionFormatEXT"));
- }
- if (!funcs->getShaderPrecisionFormat) {
- funcs->getShaderPrecisionFormat = (type_glGetShaderPrecisionFormat)
- context->getProcAddress(QLatin1String("glGetShaderPrecisionFormatARB"));
- }
-
- if (!funcs->getShaderPrecisionFormat)
- funcs->getShaderPrecisionFormat = qglfSpecialGetShaderPrecisionFormat;
-
- funcs->getShaderPrecisionFormat(shadertype, precisiontype, range, precision);
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, char* source)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glGetShaderSource)(GLuint shader, GLsizei bufsize, GLsizei* length, char* source);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->getShaderSource = (type_glGetShaderSource)
- context->getProcAddress(QLatin1String("glGetShaderSource"));
- if (!funcs->getShaderSource) {
- funcs->getShaderSource = (type_glGetShaderSource)
- context->getProcAddress(QLatin1String("glGetShaderSourceARB"));
- }
-
- if (funcs->getShaderSource)
- funcs->getShaderSource(shader, bufsize, length, source);
- else
- funcs->getShaderSource = qglfResolveGetShaderSource;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveGetUniformfv(GLuint program, GLint location, GLfloat* params)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glGetUniformfv)(GLuint program, GLint location, GLfloat* params);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->getUniformfv = (type_glGetUniformfv)
- context->getProcAddress(QLatin1String("glGetUniformfv"));
- if (!funcs->getUniformfv) {
- funcs->getUniformfv = (type_glGetUniformfv)
- context->getProcAddress(QLatin1String("glGetUniformfvARB"));
- }
-
- if (funcs->getUniformfv)
- funcs->getUniformfv(program, location, params);
- else
- funcs->getUniformfv = qglfResolveGetUniformfv;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveGetUniformiv(GLuint program, GLint location, GLint* params)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glGetUniformiv)(GLuint program, GLint location, GLint* params);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->getUniformiv = (type_glGetUniformiv)
- context->getProcAddress(QLatin1String("glGetUniformiv"));
- if (!funcs->getUniformiv) {
- funcs->getUniformiv = (type_glGetUniformiv)
- context->getProcAddress(QLatin1String("glGetUniformivARB"));
- }
-
- if (funcs->getUniformiv)
- funcs->getUniformiv(program, location, params);
- else
- funcs->getUniformiv = qglfResolveGetUniformiv;
-}
-
-static int QT3D_GLF_APIENTRY qglfResolveGetUniformLocation(GLuint program, const char* name)
-{
- typedef int (QT3D_GLF_APIENTRYP type_glGetUniformLocation)(GLuint program, const char* name);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->getUniformLocation = (type_glGetUniformLocation)
- context->getProcAddress(QLatin1String("glGetUniformLocation"));
- if (!funcs->getUniformLocation) {
- funcs->getUniformLocation = (type_glGetUniformLocation)
- context->getProcAddress(QLatin1String("glGetUniformLocationARB"));
- }
-
- if (funcs->getUniformLocation)
- return funcs->getUniformLocation(program, name);
- funcs->getUniformLocation = qglfResolveGetUniformLocation;
- return int(0);
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glGetVertexAttribfv)(GLuint index, GLenum pname, GLfloat* params);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->getVertexAttribfv = (type_glGetVertexAttribfv)
- context->getProcAddress(QLatin1String("glGetVertexAttribfv"));
- if (!funcs->getVertexAttribfv) {
- funcs->getVertexAttribfv = (type_glGetVertexAttribfv)
- context->getProcAddress(QLatin1String("glGetVertexAttribfvARB"));
- }
-
- if (funcs->getVertexAttribfv)
- funcs->getVertexAttribfv(index, pname, params);
- else
- funcs->getVertexAttribfv = qglfResolveGetVertexAttribfv;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveGetVertexAttribiv(GLuint index, GLenum pname, GLint* params)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glGetVertexAttribiv)(GLuint index, GLenum pname, GLint* params);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->getVertexAttribiv = (type_glGetVertexAttribiv)
- context->getProcAddress(QLatin1String("glGetVertexAttribiv"));
- if (!funcs->getVertexAttribiv) {
- funcs->getVertexAttribiv = (type_glGetVertexAttribiv)
- context->getProcAddress(QLatin1String("glGetVertexAttribivARB"));
- }
-
- if (funcs->getVertexAttribiv)
- funcs->getVertexAttribiv(index, pname, params);
- else
- funcs->getVertexAttribiv = qglfResolveGetVertexAttribiv;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveGetVertexAttribPointerv(GLuint index, GLenum pname, void** pointer)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glGetVertexAttribPointerv)(GLuint index, GLenum pname, void** pointer);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->getVertexAttribPointerv = (type_glGetVertexAttribPointerv)
- context->getProcAddress(QLatin1String("glGetVertexAttribPointerv"));
- if (!funcs->getVertexAttribPointerv) {
- funcs->getVertexAttribPointerv = (type_glGetVertexAttribPointerv)
- context->getProcAddress(QLatin1String("glGetVertexAttribPointervARB"));
- }
-
- if (funcs->getVertexAttribPointerv)
- funcs->getVertexAttribPointerv(index, pname, pointer);
- else
- funcs->getVertexAttribPointerv = qglfResolveGetVertexAttribPointerv;
-}
-
-static GLboolean QT3D_GLF_APIENTRY qglfResolveIsBuffer(GLuint buffer)
-{
- typedef GLboolean (QT3D_GLF_APIENTRYP type_glIsBuffer)(GLuint buffer);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->isBuffer = (type_glIsBuffer)
- context->getProcAddress(QLatin1String("glIsBuffer"));
-#ifdef QT_OPENGL_ES
- if (!funcs->isBuffer) {
- funcs->isBuffer = (type_glIsBuffer)
- context->getProcAddress(QLatin1String("glIsBufferOES"));
- }
-#endif
- if (!funcs->isBuffer) {
- funcs->isBuffer = (type_glIsBuffer)
- context->getProcAddress(QLatin1String("glIsBufferEXT"));
- }
- if (!funcs->isBuffer) {
- funcs->isBuffer = (type_glIsBuffer)
- context->getProcAddress(QLatin1String("glIsBufferARB"));
- }
-
- if (funcs->isBuffer)
- return funcs->isBuffer(buffer);
- funcs->isBuffer = qglfResolveIsBuffer;
- return GLboolean(0);
-}
-
-static GLboolean QT3D_GLF_APIENTRY qglfResolveIsFramebuffer(GLuint framebuffer)
-{
- typedef GLboolean (QT3D_GLF_APIENTRYP type_glIsFramebuffer)(GLuint framebuffer);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->isFramebuffer = (type_glIsFramebuffer)
- context->getProcAddress(QLatin1String("glIsFramebuffer"));
-#ifdef QT_OPENGL_ES
- if (!funcs->isFramebuffer) {
- funcs->isFramebuffer = (type_glIsFramebuffer)
- context->getProcAddress(QLatin1String("glIsFramebufferOES"));
- }
-#endif
- if (!funcs->isFramebuffer) {
- funcs->isFramebuffer = (type_glIsFramebuffer)
- context->getProcAddress(QLatin1String("glIsFramebufferEXT"));
- }
- if (!funcs->isFramebuffer) {
- funcs->isFramebuffer = (type_glIsFramebuffer)
- context->getProcAddress(QLatin1String("glIsFramebufferARB"));
- }
-
- if (funcs->isFramebuffer)
- return funcs->isFramebuffer(framebuffer);
- funcs->isFramebuffer = qglfResolveIsFramebuffer;
- return GLboolean(0);
-}
-
-static GLboolean QT3D_GLF_APIENTRY qglfSpecialIsProgram(GLuint program)
-{
- return program != 0;
-}
-
-static GLboolean QT3D_GLF_APIENTRY qglfResolveIsProgram(GLuint program)
-{
- typedef GLboolean (QT3D_GLF_APIENTRYP type_glIsProgram)(GLuint program);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->isProgram = (type_glIsProgram)
- context->getProcAddress(QLatin1String("glIsProgram"));
- if (!funcs->isProgram) {
- funcs->isProgram = (type_glIsProgram)
- context->getProcAddress(QLatin1String("glIsProgramARB"));
- }
-
- if (!funcs->isProgram)
- funcs->isProgram = qglfSpecialIsProgram;
-
- return funcs->isProgram(program);
-}
-
-static GLboolean QT3D_GLF_APIENTRY qglfResolveIsRenderbuffer(GLuint renderbuffer)
-{
- typedef GLboolean (QT3D_GLF_APIENTRYP type_glIsRenderbuffer)(GLuint renderbuffer);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->isRenderbuffer = (type_glIsRenderbuffer)
- context->getProcAddress(QLatin1String("glIsRenderbuffer"));
-#ifdef QT_OPENGL_ES
- if (!funcs->isRenderbuffer) {
- funcs->isRenderbuffer = (type_glIsRenderbuffer)
- context->getProcAddress(QLatin1String("glIsRenderbufferOES"));
- }
-#endif
- if (!funcs->isRenderbuffer) {
- funcs->isRenderbuffer = (type_glIsRenderbuffer)
- context->getProcAddress(QLatin1String("glIsRenderbufferEXT"));
- }
- if (!funcs->isRenderbuffer) {
- funcs->isRenderbuffer = (type_glIsRenderbuffer)
- context->getProcAddress(QLatin1String("glIsRenderbufferARB"));
- }
-
- if (funcs->isRenderbuffer)
- return funcs->isRenderbuffer(renderbuffer);
- funcs->isRenderbuffer = qglfResolveIsRenderbuffer;
- return GLboolean(0);
-}
-
-static GLboolean QT3D_GLF_APIENTRY qglfSpecialIsShader(GLuint shader)
-{
- return shader != 0;
-}
-
-static GLboolean QT3D_GLF_APIENTRY qglfResolveIsShader(GLuint shader)
-{
- typedef GLboolean (QT3D_GLF_APIENTRYP type_glIsShader)(GLuint shader);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->isShader = (type_glIsShader)
- context->getProcAddress(QLatin1String("glIsShader"));
- if (!funcs->isShader) {
- funcs->isShader = (type_glIsShader)
- context->getProcAddress(QLatin1String("glIsShaderARB"));
- }
-
- if (!funcs->isShader)
- funcs->isShader = qglfSpecialIsShader;
-
- return funcs->isShader(shader);
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveLinkProgram(GLuint program)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glLinkProgram)(GLuint program);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->linkProgram = (type_glLinkProgram)
- context->getProcAddress(QLatin1String("glLinkProgram"));
- if (!funcs->linkProgram) {
- funcs->linkProgram = (type_glLinkProgram)
- context->getProcAddress(QLatin1String("glLinkProgramARB"));
- }
-
- if (funcs->linkProgram)
- funcs->linkProgram(program);
- else
- funcs->linkProgram = qglfResolveLinkProgram;
-}
-
-static void QT3D_GLF_APIENTRY qglfSpecialReleaseShaderCompiler()
-{
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveReleaseShaderCompiler()
-{
- typedef void (QT3D_GLF_APIENTRYP type_glReleaseShaderCompiler)();
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->releaseShaderCompiler = (type_glReleaseShaderCompiler)
- context->getProcAddress(QLatin1String("glReleaseShaderCompiler"));
- if (!funcs->releaseShaderCompiler) {
- funcs->releaseShaderCompiler = (type_glReleaseShaderCompiler)
- context->getProcAddress(QLatin1String("glReleaseShaderCompilerARB"));
- }
-
- if (!funcs->releaseShaderCompiler)
- funcs->releaseShaderCompiler = qglfSpecialReleaseShaderCompiler;
-
- funcs->releaseShaderCompiler();
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glRenderbufferStorage)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->renderbufferStorage = (type_glRenderbufferStorage)
- context->getProcAddress(QLatin1String("glRenderbufferStorage"));
-#ifdef QT_OPENGL_ES
- if (!funcs->renderbufferStorage) {
- funcs->renderbufferStorage = (type_glRenderbufferStorage)
- context->getProcAddress(QLatin1String("glRenderbufferStorageOES"));
- }
-#endif
- if (!funcs->renderbufferStorage) {
- funcs->renderbufferStorage = (type_glRenderbufferStorage)
- context->getProcAddress(QLatin1String("glRenderbufferStorageEXT"));
- }
- if (!funcs->renderbufferStorage) {
- funcs->renderbufferStorage = (type_glRenderbufferStorage)
- context->getProcAddress(QLatin1String("glRenderbufferStorageARB"));
- }
-
- if (funcs->renderbufferStorage)
- funcs->renderbufferStorage(target, internalformat, width, height);
- else
- funcs->renderbufferStorage = qglfResolveRenderbufferStorage;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveSampleCoverage(GLclampf value, GLboolean invert)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glSampleCoverage)(GLclampf value, GLboolean invert);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->sampleCoverage = (type_glSampleCoverage)
- context->getProcAddress(QLatin1String("glSampleCoverage"));
-#ifdef QT_OPENGL_ES
- if (!funcs->sampleCoverage) {
- funcs->sampleCoverage = (type_glSampleCoverage)
- context->getProcAddress(QLatin1String("glSampleCoverageOES"));
- }
-#endif
- if (!funcs->sampleCoverage) {
- funcs->sampleCoverage = (type_glSampleCoverage)
- context->getProcAddress(QLatin1String("glSampleCoverageEXT"));
- }
- if (!funcs->sampleCoverage) {
- funcs->sampleCoverage = (type_glSampleCoverage)
- context->getProcAddress(QLatin1String("glSampleCoverageARB"));
- }
-
- if (funcs->sampleCoverage)
- funcs->sampleCoverage(value, invert);
- else
- funcs->sampleCoverage = qglfResolveSampleCoverage;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveShaderBinary(GLint n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLint length)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glShaderBinary)(GLint n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLint length);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->shaderBinary = (type_glShaderBinary)
- context->getProcAddress(QLatin1String("glShaderBinary"));
- if (!funcs->shaderBinary) {
- funcs->shaderBinary = (type_glShaderBinary)
- context->getProcAddress(QLatin1String("glShaderBinaryARB"));
- }
-
- if (funcs->shaderBinary)
- funcs->shaderBinary(n, shaders, binaryformat, binary, length);
- else
- funcs->shaderBinary = qglfResolveShaderBinary;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveShaderSource(GLuint shader, GLsizei count, const char** string, const GLint* length)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glShaderSource)(GLuint shader, GLsizei count, const char** string, const GLint* length);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->shaderSource = (type_glShaderSource)
- context->getProcAddress(QLatin1String("glShaderSource"));
- if (!funcs->shaderSource) {
- funcs->shaderSource = (type_glShaderSource)
- context->getProcAddress(QLatin1String("glShaderSourceARB"));
- }
-
- if (funcs->shaderSource)
- funcs->shaderSource(shader, count, string, length);
- else
- funcs->shaderSource = qglfResolveShaderSource;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glStencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->stencilFuncSeparate = (type_glStencilFuncSeparate)
- context->getProcAddress(QLatin1String("glStencilFuncSeparate"));
-#ifdef QT_OPENGL_ES
- if (!funcs->stencilFuncSeparate) {
- funcs->stencilFuncSeparate = (type_glStencilFuncSeparate)
- context->getProcAddress(QLatin1String("glStencilFuncSeparateOES"));
- }
-#endif
- if (!funcs->stencilFuncSeparate) {
- funcs->stencilFuncSeparate = (type_glStencilFuncSeparate)
- context->getProcAddress(QLatin1String("glStencilFuncSeparateEXT"));
- }
- if (!funcs->stencilFuncSeparate) {
- funcs->stencilFuncSeparate = (type_glStencilFuncSeparate)
- context->getProcAddress(QLatin1String("glStencilFuncSeparateARB"));
- }
-
- if (funcs->stencilFuncSeparate)
- funcs->stencilFuncSeparate(face, func, ref, mask);
- else
- funcs->stencilFuncSeparate = qglfResolveStencilFuncSeparate;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveStencilMaskSeparate(GLenum face, GLuint mask)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glStencilMaskSeparate)(GLenum face, GLuint mask);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->stencilMaskSeparate = (type_glStencilMaskSeparate)
- context->getProcAddress(QLatin1String("glStencilMaskSeparate"));
-#ifdef QT_OPENGL_ES
- if (!funcs->stencilMaskSeparate) {
- funcs->stencilMaskSeparate = (type_glStencilMaskSeparate)
- context->getProcAddress(QLatin1String("glStencilMaskSeparateOES"));
- }
-#endif
- if (!funcs->stencilMaskSeparate) {
- funcs->stencilMaskSeparate = (type_glStencilMaskSeparate)
- context->getProcAddress(QLatin1String("glStencilMaskSeparateEXT"));
- }
- if (!funcs->stencilMaskSeparate) {
- funcs->stencilMaskSeparate = (type_glStencilMaskSeparate)
- context->getProcAddress(QLatin1String("glStencilMaskSeparateARB"));
- }
-
- if (funcs->stencilMaskSeparate)
- funcs->stencilMaskSeparate(face, mask);
- else
- funcs->stencilMaskSeparate = qglfResolveStencilMaskSeparate;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glStencilOpSeparate)(GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->stencilOpSeparate = (type_glStencilOpSeparate)
- context->getProcAddress(QLatin1String("glStencilOpSeparate"));
-#ifdef QT_OPENGL_ES
- if (!funcs->stencilOpSeparate) {
- funcs->stencilOpSeparate = (type_glStencilOpSeparate)
- context->getProcAddress(QLatin1String("glStencilOpSeparateOES"));
- }
-#endif
- if (!funcs->stencilOpSeparate) {
- funcs->stencilOpSeparate = (type_glStencilOpSeparate)
- context->getProcAddress(QLatin1String("glStencilOpSeparateEXT"));
- }
- if (!funcs->stencilOpSeparate) {
- funcs->stencilOpSeparate = (type_glStencilOpSeparate)
- context->getProcAddress(QLatin1String("glStencilOpSeparateARB"));
- }
-
- if (funcs->stencilOpSeparate)
- funcs->stencilOpSeparate(face, fail, zfail, zpass);
- else
- funcs->stencilOpSeparate = qglfResolveStencilOpSeparate;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveUniform1f(GLint location, GLfloat x)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glUniform1f)(GLint location, GLfloat x);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->uniform1f = (type_glUniform1f)
- context->getProcAddress(QLatin1String("glUniform1f"));
- if (!funcs->uniform1f) {
- funcs->uniform1f = (type_glUniform1f)
- context->getProcAddress(QLatin1String("glUniform1fARB"));
- }
-
- if (funcs->uniform1f)
- funcs->uniform1f(location, x);
- else
- funcs->uniform1f = qglfResolveUniform1f;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveUniform1fv(GLint location, GLsizei count, const GLfloat* v)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glUniform1fv)(GLint location, GLsizei count, const GLfloat* v);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->uniform1fv = (type_glUniform1fv)
- context->getProcAddress(QLatin1String("glUniform1fv"));
- if (!funcs->uniform1fv) {
- funcs->uniform1fv = (type_glUniform1fv)
- context->getProcAddress(QLatin1String("glUniform1fvARB"));
- }
-
- if (funcs->uniform1fv)
- funcs->uniform1fv(location, count, v);
- else
- funcs->uniform1fv = qglfResolveUniform1fv;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveUniform1i(GLint location, GLint x)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glUniform1i)(GLint location, GLint x);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->uniform1i = (type_glUniform1i)
- context->getProcAddress(QLatin1String("glUniform1i"));
- if (!funcs->uniform1i) {
- funcs->uniform1i = (type_glUniform1i)
- context->getProcAddress(QLatin1String("glUniform1iARB"));
- }
-
- if (funcs->uniform1i)
- funcs->uniform1i(location, x);
- else
- funcs->uniform1i = qglfResolveUniform1i;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveUniform1iv(GLint location, GLsizei count, const GLint* v)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glUniform1iv)(GLint location, GLsizei count, const GLint* v);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->uniform1iv = (type_glUniform1iv)
- context->getProcAddress(QLatin1String("glUniform1iv"));
- if (!funcs->uniform1iv) {
- funcs->uniform1iv = (type_glUniform1iv)
- context->getProcAddress(QLatin1String("glUniform1ivARB"));
- }
-
- if (funcs->uniform1iv)
- funcs->uniform1iv(location, count, v);
- else
- funcs->uniform1iv = qglfResolveUniform1iv;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveUniform2f(GLint location, GLfloat x, GLfloat y)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glUniform2f)(GLint location, GLfloat x, GLfloat y);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->uniform2f = (type_glUniform2f)
- context->getProcAddress(QLatin1String("glUniform2f"));
- if (!funcs->uniform2f) {
- funcs->uniform2f = (type_glUniform2f)
- context->getProcAddress(QLatin1String("glUniform2fARB"));
- }
-
- if (funcs->uniform2f)
- funcs->uniform2f(location, x, y);
- else
- funcs->uniform2f = qglfResolveUniform2f;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveUniform2fv(GLint location, GLsizei count, const GLfloat* v)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glUniform2fv)(GLint location, GLsizei count, const GLfloat* v);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->uniform2fv = (type_glUniform2fv)
- context->getProcAddress(QLatin1String("glUniform2fv"));
- if (!funcs->uniform2fv) {
- funcs->uniform2fv = (type_glUniform2fv)
- context->getProcAddress(QLatin1String("glUniform2fvARB"));
- }
-
- if (funcs->uniform2fv)
- funcs->uniform2fv(location, count, v);
- else
- funcs->uniform2fv = qglfResolveUniform2fv;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveUniform2i(GLint location, GLint x, GLint y)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glUniform2i)(GLint location, GLint x, GLint y);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->uniform2i = (type_glUniform2i)
- context->getProcAddress(QLatin1String("glUniform2i"));
- if (!funcs->uniform2i) {
- funcs->uniform2i = (type_glUniform2i)
- context->getProcAddress(QLatin1String("glUniform2iARB"));
- }
-
- if (funcs->uniform2i)
- funcs->uniform2i(location, x, y);
- else
- funcs->uniform2i = qglfResolveUniform2i;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveUniform2iv(GLint location, GLsizei count, const GLint* v)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glUniform2iv)(GLint location, GLsizei count, const GLint* v);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->uniform2iv = (type_glUniform2iv)
- context->getProcAddress(QLatin1String("glUniform2iv"));
- if (!funcs->uniform2iv) {
- funcs->uniform2iv = (type_glUniform2iv)
- context->getProcAddress(QLatin1String("glUniform2ivARB"));
- }
-
- if (funcs->uniform2iv)
- funcs->uniform2iv(location, count, v);
- else
- funcs->uniform2iv = qglfResolveUniform2iv;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glUniform3f)(GLint location, GLfloat x, GLfloat y, GLfloat z);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->uniform3f = (type_glUniform3f)
- context->getProcAddress(QLatin1String("glUniform3f"));
- if (!funcs->uniform3f) {
- funcs->uniform3f = (type_glUniform3f)
- context->getProcAddress(QLatin1String("glUniform3fARB"));
- }
-
- if (funcs->uniform3f)
- funcs->uniform3f(location, x, y, z);
- else
- funcs->uniform3f = qglfResolveUniform3f;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveUniform3fv(GLint location, GLsizei count, const GLfloat* v)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glUniform3fv)(GLint location, GLsizei count, const GLfloat* v);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->uniform3fv = (type_glUniform3fv)
- context->getProcAddress(QLatin1String("glUniform3fv"));
- if (!funcs->uniform3fv) {
- funcs->uniform3fv = (type_glUniform3fv)
- context->getProcAddress(QLatin1String("glUniform3fvARB"));
- }
-
- if (funcs->uniform3fv)
- funcs->uniform3fv(location, count, v);
- else
- funcs->uniform3fv = qglfResolveUniform3fv;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveUniform3i(GLint location, GLint x, GLint y, GLint z)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glUniform3i)(GLint location, GLint x, GLint y, GLint z);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->uniform3i = (type_glUniform3i)
- context->getProcAddress(QLatin1String("glUniform3i"));
- if (!funcs->uniform3i) {
- funcs->uniform3i = (type_glUniform3i)
- context->getProcAddress(QLatin1String("glUniform3iARB"));
- }
-
- if (funcs->uniform3i)
- funcs->uniform3i(location, x, y, z);
- else
- funcs->uniform3i = qglfResolveUniform3i;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveUniform3iv(GLint location, GLsizei count, const GLint* v)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glUniform3iv)(GLint location, GLsizei count, const GLint* v);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->uniform3iv = (type_glUniform3iv)
- context->getProcAddress(QLatin1String("glUniform3iv"));
- if (!funcs->uniform3iv) {
- funcs->uniform3iv = (type_glUniform3iv)
- context->getProcAddress(QLatin1String("glUniform3ivARB"));
- }
-
- if (funcs->uniform3iv)
- funcs->uniform3iv(location, count, v);
- else
- funcs->uniform3iv = qglfResolveUniform3iv;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glUniform4f)(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->uniform4f = (type_glUniform4f)
- context->getProcAddress(QLatin1String("glUniform4f"));
- if (!funcs->uniform4f) {
- funcs->uniform4f = (type_glUniform4f)
- context->getProcAddress(QLatin1String("glUniform4fARB"));
- }
-
- if (funcs->uniform4f)
- funcs->uniform4f(location, x, y, z, w);
- else
- funcs->uniform4f = qglfResolveUniform4f;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveUniform4fv(GLint location, GLsizei count, const GLfloat* v)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glUniform4fv)(GLint location, GLsizei count, const GLfloat* v);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->uniform4fv = (type_glUniform4fv)
- context->getProcAddress(QLatin1String("glUniform4fv"));
- if (!funcs->uniform4fv) {
- funcs->uniform4fv = (type_glUniform4fv)
- context->getProcAddress(QLatin1String("glUniform4fvARB"));
- }
-
- if (funcs->uniform4fv)
- funcs->uniform4fv(location, count, v);
- else
- funcs->uniform4fv = qglfResolveUniform4fv;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glUniform4i)(GLint location, GLint x, GLint y, GLint z, GLint w);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->uniform4i = (type_glUniform4i)
- context->getProcAddress(QLatin1String("glUniform4i"));
- if (!funcs->uniform4i) {
- funcs->uniform4i = (type_glUniform4i)
- context->getProcAddress(QLatin1String("glUniform4iARB"));
- }
-
- if (funcs->uniform4i)
- funcs->uniform4i(location, x, y, z, w);
- else
- funcs->uniform4i = qglfResolveUniform4i;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveUniform4iv(GLint location, GLsizei count, const GLint* v)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glUniform4iv)(GLint location, GLsizei count, const GLint* v);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->uniform4iv = (type_glUniform4iv)
- context->getProcAddress(QLatin1String("glUniform4iv"));
- if (!funcs->uniform4iv) {
- funcs->uniform4iv = (type_glUniform4iv)
- context->getProcAddress(QLatin1String("glUniform4ivARB"));
- }
-
- if (funcs->uniform4iv)
- funcs->uniform4iv(location, count, v);
- else
- funcs->uniform4iv = qglfResolveUniform4iv;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glUniformMatrix2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->uniformMatrix2fv = (type_glUniformMatrix2fv)
- context->getProcAddress(QLatin1String("glUniformMatrix2fv"));
- if (!funcs->uniformMatrix2fv) {
- funcs->uniformMatrix2fv = (type_glUniformMatrix2fv)
- context->getProcAddress(QLatin1String("glUniformMatrix2fvARB"));
- }
-
- if (funcs->uniformMatrix2fv)
- funcs->uniformMatrix2fv(location, count, transpose, value);
- else
- funcs->uniformMatrix2fv = qglfResolveUniformMatrix2fv;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glUniformMatrix3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->uniformMatrix3fv = (type_glUniformMatrix3fv)
- context->getProcAddress(QLatin1String("glUniformMatrix3fv"));
- if (!funcs->uniformMatrix3fv) {
- funcs->uniformMatrix3fv = (type_glUniformMatrix3fv)
- context->getProcAddress(QLatin1String("glUniformMatrix3fvARB"));
- }
-
- if (funcs->uniformMatrix3fv)
- funcs->uniformMatrix3fv(location, count, transpose, value);
- else
- funcs->uniformMatrix3fv = qglfResolveUniformMatrix3fv;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glUniformMatrix4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->uniformMatrix4fv = (type_glUniformMatrix4fv)
- context->getProcAddress(QLatin1String("glUniformMatrix4fv"));
- if (!funcs->uniformMatrix4fv) {
- funcs->uniformMatrix4fv = (type_glUniformMatrix4fv)
- context->getProcAddress(QLatin1String("glUniformMatrix4fvARB"));
- }
-
- if (funcs->uniformMatrix4fv)
- funcs->uniformMatrix4fv(location, count, transpose, value);
- else
- funcs->uniformMatrix4fv = qglfResolveUniformMatrix4fv;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveUseProgram(GLuint program)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glUseProgram)(GLuint program);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->useProgram = (type_glUseProgram)
- context->getProcAddress(QLatin1String("glUseProgram"));
- if (!funcs->useProgram) {
- funcs->useProgram = (type_glUseProgram)
- context->getProcAddress(QLatin1String("glUseProgramObjectARB"));
- }
-
- if (funcs->useProgram)
- funcs->useProgram(program);
- else
- funcs->useProgram = qglfResolveUseProgram;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveValidateProgram(GLuint program)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glValidateProgram)(GLuint program);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->validateProgram = (type_glValidateProgram)
- context->getProcAddress(QLatin1String("glValidateProgram"));
- if (!funcs->validateProgram) {
- funcs->validateProgram = (type_glValidateProgram)
- context->getProcAddress(QLatin1String("glValidateProgramARB"));
- }
-
- if (funcs->validateProgram)
- funcs->validateProgram(program);
- else
- funcs->validateProgram = qglfResolveValidateProgram;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveVertexAttrib1f(GLuint indx, GLfloat x)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glVertexAttrib1f)(GLuint indx, GLfloat x);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->vertexAttrib1f = (type_glVertexAttrib1f)
- context->getProcAddress(QLatin1String("glVertexAttrib1f"));
- if (!funcs->vertexAttrib1f) {
- funcs->vertexAttrib1f = (type_glVertexAttrib1f)
- context->getProcAddress(QLatin1String("glVertexAttrib1fARB"));
- }
-
- if (funcs->vertexAttrib1f)
- funcs->vertexAttrib1f(indx, x);
- else
- funcs->vertexAttrib1f = qglfResolveVertexAttrib1f;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveVertexAttrib1fv(GLuint indx, const GLfloat* values)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glVertexAttrib1fv)(GLuint indx, const GLfloat* values);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->vertexAttrib1fv = (type_glVertexAttrib1fv)
- context->getProcAddress(QLatin1String("glVertexAttrib1fv"));
- if (!funcs->vertexAttrib1fv) {
- funcs->vertexAttrib1fv = (type_glVertexAttrib1fv)
- context->getProcAddress(QLatin1String("glVertexAttrib1fvARB"));
- }
-
- if (funcs->vertexAttrib1fv)
- funcs->vertexAttrib1fv(indx, values);
- else
- funcs->vertexAttrib1fv = qglfResolveVertexAttrib1fv;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glVertexAttrib2f)(GLuint indx, GLfloat x, GLfloat y);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->vertexAttrib2f = (type_glVertexAttrib2f)
- context->getProcAddress(QLatin1String("glVertexAttrib2f"));
- if (!funcs->vertexAttrib2f) {
- funcs->vertexAttrib2f = (type_glVertexAttrib2f)
- context->getProcAddress(QLatin1String("glVertexAttrib2fARB"));
- }
-
- if (funcs->vertexAttrib2f)
- funcs->vertexAttrib2f(indx, x, y);
- else
- funcs->vertexAttrib2f = qglfResolveVertexAttrib2f;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveVertexAttrib2fv(GLuint indx, const GLfloat* values)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glVertexAttrib2fv)(GLuint indx, const GLfloat* values);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->vertexAttrib2fv = (type_glVertexAttrib2fv)
- context->getProcAddress(QLatin1String("glVertexAttrib2fv"));
- if (!funcs->vertexAttrib2fv) {
- funcs->vertexAttrib2fv = (type_glVertexAttrib2fv)
- context->getProcAddress(QLatin1String("glVertexAttrib2fvARB"));
- }
-
- if (funcs->vertexAttrib2fv)
- funcs->vertexAttrib2fv(indx, values);
- else
- funcs->vertexAttrib2fv = qglfResolveVertexAttrib2fv;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glVertexAttrib3f)(GLuint indx, GLfloat x, GLfloat y, GLfloat z);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->vertexAttrib3f = (type_glVertexAttrib3f)
- context->getProcAddress(QLatin1String("glVertexAttrib3f"));
- if (!funcs->vertexAttrib3f) {
- funcs->vertexAttrib3f = (type_glVertexAttrib3f)
- context->getProcAddress(QLatin1String("glVertexAttrib3fARB"));
- }
-
- if (funcs->vertexAttrib3f)
- funcs->vertexAttrib3f(indx, x, y, z);
- else
- funcs->vertexAttrib3f = qglfResolveVertexAttrib3f;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveVertexAttrib3fv(GLuint indx, const GLfloat* values)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glVertexAttrib3fv)(GLuint indx, const GLfloat* values);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->vertexAttrib3fv = (type_glVertexAttrib3fv)
- context->getProcAddress(QLatin1String("glVertexAttrib3fv"));
- if (!funcs->vertexAttrib3fv) {
- funcs->vertexAttrib3fv = (type_glVertexAttrib3fv)
- context->getProcAddress(QLatin1String("glVertexAttrib3fvARB"));
- }
-
- if (funcs->vertexAttrib3fv)
- funcs->vertexAttrib3fv(indx, values);
- else
- funcs->vertexAttrib3fv = qglfResolveVertexAttrib3fv;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glVertexAttrib4f)(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->vertexAttrib4f = (type_glVertexAttrib4f)
- context->getProcAddress(QLatin1String("glVertexAttrib4f"));
- if (!funcs->vertexAttrib4f) {
- funcs->vertexAttrib4f = (type_glVertexAttrib4f)
- context->getProcAddress(QLatin1String("glVertexAttrib4fARB"));
- }
-
- if (funcs->vertexAttrib4f)
- funcs->vertexAttrib4f(indx, x, y, z, w);
- else
- funcs->vertexAttrib4f = qglfResolveVertexAttrib4f;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveVertexAttrib4fv(GLuint indx, const GLfloat* values)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glVertexAttrib4fv)(GLuint indx, const GLfloat* values);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->vertexAttrib4fv = (type_glVertexAttrib4fv)
- context->getProcAddress(QLatin1String("glVertexAttrib4fv"));
- if (!funcs->vertexAttrib4fv) {
- funcs->vertexAttrib4fv = (type_glVertexAttrib4fv)
- context->getProcAddress(QLatin1String("glVertexAttrib4fvARB"));
- }
-
- if (funcs->vertexAttrib4fv)
- funcs->vertexAttrib4fv(indx, values);
- else
- funcs->vertexAttrib4fv = qglfResolveVertexAttrib4fv;
-}
-
-static void QT3D_GLF_APIENTRY qglfResolveVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr)
-{
- typedef void (QT3D_GLF_APIENTRYP type_glVertexAttribPointer)(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr);
-
- const QGLContext *context = QGLContext::currentContext();
- QOpenGLFunctionsPrivate *funcs = qt_gl_functions(context);
-
- funcs->vertexAttribPointer = (type_glVertexAttribPointer)
- context->getProcAddress(QLatin1String("glVertexAttribPointer"));
- if (!funcs->vertexAttribPointer) {
- funcs->vertexAttribPointer = (type_glVertexAttribPointer)
- context->getProcAddress(QLatin1String("glVertexAttribPointerARB"));
- }
-
- if (funcs->vertexAttribPointer)
- funcs->vertexAttribPointer(indx, size, type, normalized, stride, ptr);
- else
- funcs->vertexAttribPointer = qglfResolveVertexAttribPointer;
-}
-
-#endif // !QT_OPENGL_ES_2
-
-QOpenGLFunctionsPrivate::QOpenGLFunctionsPrivate(const QGLContext *)
-{
-#ifndef QT_OPENGL_ES_2
- activeTexture = qglfResolveActiveTexture;
- attachShader = qglfResolveAttachShader;
- bindAttribLocation = qglfResolveBindAttribLocation;
- bindBuffer = qglfResolveBindBuffer;
- bindFramebuffer = qglfResolveBindFramebuffer;
- bindRenderbuffer = qglfResolveBindRenderbuffer;
- blendColor = qglfResolveBlendColor;
- blendEquation = qglfResolveBlendEquation;
- blendEquationSeparate = qglfResolveBlendEquationSeparate;
- blendFuncSeparate = qglfResolveBlendFuncSeparate;
- bufferData = qglfResolveBufferData;
- bufferSubData = qglfResolveBufferSubData;
- checkFramebufferStatus = qglfResolveCheckFramebufferStatus;
- compileShader = qglfResolveCompileShader;
- compressedTexImage2D = qglfResolveCompressedTexImage2D;
- compressedTexSubImage2D = qglfResolveCompressedTexSubImage2D;
- createProgram = qglfResolveCreateProgram;
- createShader = qglfResolveCreateShader;
- deleteBuffers = qglfResolveDeleteBuffers;
- deleteFramebuffers = qglfResolveDeleteFramebuffers;
- deleteProgram = qglfResolveDeleteProgram;
- deleteRenderbuffers = qglfResolveDeleteRenderbuffers;
- deleteShader = qglfResolveDeleteShader;
- detachShader = qglfResolveDetachShader;
- disableVertexAttribArray = qglfResolveDisableVertexAttribArray;
- enableVertexAttribArray = qglfResolveEnableVertexAttribArray;
- framebufferRenderbuffer = qglfResolveFramebufferRenderbuffer;
- framebufferTexture2D = qglfResolveFramebufferTexture2D;
- genBuffers = qglfResolveGenBuffers;
- generateMipmap = qglfResolveGenerateMipmap;
- genFramebuffers = qglfResolveGenFramebuffers;
- genRenderbuffers = qglfResolveGenRenderbuffers;
- getActiveAttrib = qglfResolveGetActiveAttrib;
- getActiveUniform = qglfResolveGetActiveUniform;
- getAttachedShaders = qglfResolveGetAttachedShaders;
- getAttribLocation = qglfResolveGetAttribLocation;
- getBufferParameteriv = qglfResolveGetBufferParameteriv;
- getFramebufferAttachmentParameteriv = qglfResolveGetFramebufferAttachmentParameteriv;
- getProgramiv = qglfResolveGetProgramiv;
- getProgramInfoLog = qglfResolveGetProgramInfoLog;
- getRenderbufferParameteriv = qglfResolveGetRenderbufferParameteriv;
- getShaderiv = qglfResolveGetShaderiv;
- getShaderInfoLog = qglfResolveGetShaderInfoLog;
- getShaderPrecisionFormat = qglfResolveGetShaderPrecisionFormat;
- getShaderSource = qglfResolveGetShaderSource;
- getUniformfv = qglfResolveGetUniformfv;
- getUniformiv = qglfResolveGetUniformiv;
- getUniformLocation = qglfResolveGetUniformLocation;
- getVertexAttribfv = qglfResolveGetVertexAttribfv;
- getVertexAttribiv = qglfResolveGetVertexAttribiv;
- getVertexAttribPointerv = qglfResolveGetVertexAttribPointerv;
- isBuffer = qglfResolveIsBuffer;
- isFramebuffer = qglfResolveIsFramebuffer;
- isProgram = qglfResolveIsProgram;
- isRenderbuffer = qglfResolveIsRenderbuffer;
- isShader = qglfResolveIsShader;
- linkProgram = qglfResolveLinkProgram;
- releaseShaderCompiler = qglfResolveReleaseShaderCompiler;
- renderbufferStorage = qglfResolveRenderbufferStorage;
- sampleCoverage = qglfResolveSampleCoverage;
- shaderBinary = qglfResolveShaderBinary;
- shaderSource = qglfResolveShaderSource;
- stencilFuncSeparate = qglfResolveStencilFuncSeparate;
- stencilMaskSeparate = qglfResolveStencilMaskSeparate;
- stencilOpSeparate = qglfResolveStencilOpSeparate;
- uniform1f = qglfResolveUniform1f;
- uniform1fv = qglfResolveUniform1fv;
- uniform1i = qglfResolveUniform1i;
- uniform1iv = qglfResolveUniform1iv;
- uniform2f = qglfResolveUniform2f;
- uniform2fv = qglfResolveUniform2fv;
- uniform2i = qglfResolveUniform2i;
- uniform2iv = qglfResolveUniform2iv;
- uniform3f = qglfResolveUniform3f;
- uniform3fv = qglfResolveUniform3fv;
- uniform3i = qglfResolveUniform3i;
- uniform3iv = qglfResolveUniform3iv;
- uniform4f = qglfResolveUniform4f;
- uniform4fv = qglfResolveUniform4fv;
- uniform4i = qglfResolveUniform4i;
- uniform4iv = qglfResolveUniform4iv;
- uniformMatrix2fv = qglfResolveUniformMatrix2fv;
- uniformMatrix3fv = qglfResolveUniformMatrix3fv;
- uniformMatrix4fv = qglfResolveUniformMatrix4fv;
- useProgram = qglfResolveUseProgram;
- validateProgram = qglfResolveValidateProgram;
- vertexAttrib1f = qglfResolveVertexAttrib1f;
- vertexAttrib1fv = qglfResolveVertexAttrib1fv;
- vertexAttrib2f = qglfResolveVertexAttrib2f;
- vertexAttrib2fv = qglfResolveVertexAttrib2fv;
- vertexAttrib3f = qglfResolveVertexAttrib3f;
- vertexAttrib3fv = qglfResolveVertexAttrib3fv;
- vertexAttrib4f = qglfResolveVertexAttrib4f;
- vertexAttrib4fv = qglfResolveVertexAttrib4fv;
- vertexAttribPointer = qglfResolveVertexAttribPointer;
-#endif // !QT_OPENGL_ES_2
-}
-
diff --git a/src/threed/api/qopenglfunctions.h b/src/threed/api/qopenglfunctions.h
deleted file mode 100644
index 315846b1..00000000
--- a/src/threed/api/qopenglfunctions.h
+++ /dev/null
@@ -1,2292 +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 QOPENGLFUNCTIONS_H
-#define QOPENGLFUNCTIONS_H
-
-#include <QtOpenGL/qgl.h>
-#include "qt3dglobal.h"
-#include <QDebug>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-// Types that aren't defined in all system's gl.h files.
-typedef ptrdiff_t qgl_GLintptr;
-typedef ptrdiff_t qgl_GLsizeiptr;
-
-#ifdef Q_WS_WIN
-# define QT3D_GLF_APIENTRY APIENTRY
-#endif
-
-#ifndef Q_WS_MAC
-# ifndef QT3D_GLF_APIENTRYP
-# ifdef QT3D_GLF_APIENTRY
-# define QT3D_GLF_APIENTRYP QT3D_GLF_APIENTRY *
-# else
-# define QT3D_GLF_APIENTRY
-# define QT3D_GLF_APIENTRYP *
-# endif
-# endif
-#else
-# define QT3D_GLF_APIENTRY
-# define QT3D_GLF_APIENTRYP *
-#endif
-
-struct QOpenGLFunctionsPrivate;
-
-// Undefine any macros from GLEW, qglextensions_p.h, etc that
-// may interfere with the definition of QOpenGLFunctions.
-#undef glActiveTexture
-#undef glAttachShader
-#undef glBindAttribLocation
-#undef glBindBuffer
-#undef glBindFramebuffer
-#undef glBindRenderbuffer
-#undef glBlendColor
-#undef glBlendEquation
-#undef glBlendEquationSeparate
-#undef glBlendFuncSeparate
-#undef glBufferData
-#undef glBufferSubData
-#undef glCheckFramebufferStatus
-#undef glClearDepthf
-#undef glCompileShader
-#undef glCompressedTexImage2D
-#undef glCompressedTexSubImage2D
-#undef glCreateProgram
-#undef glCreateShader
-#undef glDeleteBuffers
-#undef glDeleteFramebuffers
-#undef glDeleteProgram
-#undef glDeleteRenderbuffers
-#undef glDeleteShader
-#undef glDepthRangef
-#undef glDetachShader
-#undef glDisableVertexAttribArray
-#undef glEnableVertexAttribArray
-#undef glFramebufferRenderbuffer
-#undef glFramebufferTexture2D
-#undef glGenBuffers
-#undef glGenerateMipmap
-#undef glGenFramebuffers
-#undef glGenRenderbuffers
-#undef glGetActiveAttrib
-#undef glGetActiveUniform
-#undef glGetAttachedShaders
-#undef glGetAttribLocation
-#undef glGetBufferParameteriv
-#undef glGetFramebufferAttachmentParameteriv
-#undef glGetProgramiv
-#undef glGetProgramInfoLog
-#undef glGetRenderbufferParameteriv
-#undef glGetShaderiv
-#undef glGetShaderInfoLog
-#undef glGetShaderPrecisionFormat
-#undef glGetShaderSource
-#undef glGetUniformfv
-#undef glGetUniformiv
-#undef glGetUniformLocation
-#undef glGetVertexAttribfv
-#undef glGetVertexAttribiv
-#undef glGetVertexAttribPointerv
-#undef glIsBuffer
-#undef glIsFramebuffer
-#undef glIsProgram
-#undef glIsRenderbuffer
-#undef glIsShader
-#undef glLinkProgram
-#undef glReleaseShaderCompiler
-#undef glRenderbufferStorage
-#undef glSampleCoverage
-#undef glShaderBinary
-#undef glShaderSource
-#undef glStencilFuncSeparate
-#undef glStencilMaskSeparate
-#undef glStencilOpSeparate
-#undef glUniform1f
-#undef glUniform1fv
-#undef glUniform1i
-#undef glUniform1iv
-#undef glUniform2f
-#undef glUniform2fv
-#undef glUniform2i
-#undef glUniform2iv
-#undef glUniform3f
-#undef glUniform3fv
-#undef glUniform3i
-#undef glUniform3iv
-#undef glUniform4f
-#undef glUniform4fv
-#undef glUniform4i
-#undef glUniform4iv
-#undef glUniformMatrix2fv
-#undef glUniformMatrix3fv
-#undef glUniformMatrix4fv
-#undef glUseProgram
-#undef glValidateProgram
-#undef glVertexAttrib1f
-#undef glVertexAttrib1fv
-#undef glVertexAttrib2f
-#undef glVertexAttrib2fv
-#undef glVertexAttrib3f
-#undef glVertexAttrib3fv
-#undef glVertexAttrib4f
-#undef glVertexAttrib4fv
-#undef glVertexAttribPointer
-
-class Q_QT3D_EXPORT QOpenGLFunctions
-{
-public:
- QOpenGLFunctions();
- explicit QOpenGLFunctions(const QGLContext *context);
- ~QOpenGLFunctions() {}
-
- enum OpenGLFeature
- {
- Multitexture = 0x0001,
- Shaders = 0x0002,
- Buffers = 0x0004,
- Framebuffers = 0x0008,
- BlendColor = 0x0010,
- BlendEquation = 0x0020,
- BlendEquationSeparate = 0x0040,
- BlendFuncSeparate = 0x0080,
- BlendSubtract = 0x0100,
- CompressedTextures = 0x0200,
- Multisample = 0x0400,
- StencilSeparate = 0x0800,
- NPOTTextures = 0x1000
- };
- Q_DECLARE_FLAGS(OpenGLFeatures, OpenGLFeature)
-
- QOpenGLFunctions::OpenGLFeatures openGLFeatures() const;
- bool hasOpenGLFeature(QOpenGLFunctions::OpenGLFeature feature) const;
-
- void initializeGLFunctions(const QGLContext *context = 0);
-
- void glActiveTexture(GLenum texture);
- void glAttachShader(GLuint program, GLuint shader);
- void glBindAttribLocation(GLuint program, GLuint index, const char* name);
- void glBindBuffer(GLenum target, GLuint buffer);
- void glBindFramebuffer(GLenum target, GLuint framebuffer);
- void glBindRenderbuffer(GLenum target, GLuint renderbuffer);
- void glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
- void glBlendEquation(GLenum mode);
- void glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha);
- void glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
- void glBufferData(GLenum target, qgl_GLsizeiptr size, const void* data, GLenum usage);
- void glBufferSubData(GLenum target, qgl_GLintptr offset, qgl_GLsizeiptr size, const void* data);
- GLenum glCheckFramebufferStatus(GLenum target);
- void glClearDepthf(GLclampf depth);
- void glCompileShader(GLuint shader);
- void glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data);
- void glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data);
- GLuint glCreateProgram();
- GLuint glCreateShader(GLenum type);
- void glDeleteBuffers(GLsizei n, const GLuint* buffers);
- void glDeleteFramebuffers(GLsizei n, const GLuint* framebuffers);
- void glDeleteProgram(GLuint program);
- void glDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers);
- void glDeleteShader(GLuint shader);
- void glDepthRangef(GLclampf zNear, GLclampf zFar);
- void glDetachShader(GLuint program, GLuint shader);
- void glDisableVertexAttribArray(GLuint index);
- void glEnableVertexAttribArray(GLuint index);
- void glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
- void glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
- void glGenBuffers(GLsizei n, GLuint* buffers);
- void glGenerateMipmap(GLenum target);
- void glGenFramebuffers(GLsizei n, GLuint* framebuffers);
- void glGenRenderbuffers(GLsizei n, GLuint* renderbuffers);
- void glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name);
- void glGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name);
- void glGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders);
- int glGetAttribLocation(GLuint program, const char* name);
- void glGetBufferParameteriv(GLenum target, GLenum pname, GLint* params);
- void glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params);
- void glGetProgramiv(GLuint program, GLenum pname, GLint* params);
- void glGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog);
- void glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params);
- void glGetShaderiv(GLuint shader, GLenum pname, GLint* params);
- void glGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog);
- void glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
- void glGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, char* source);
- void glGetUniformfv(GLuint program, GLint location, GLfloat* params);
- void glGetUniformiv(GLuint program, GLint location, GLint* params);
- int glGetUniformLocation(GLuint program, const char* name);
- void glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params);
- void glGetVertexAttribiv(GLuint index, GLenum pname, GLint* params);
- void glGetVertexAttribPointerv(GLuint index, GLenum pname, void** pointer);
- GLboolean glIsBuffer(GLuint buffer);
- GLboolean glIsFramebuffer(GLuint framebuffer);
- GLboolean glIsProgram(GLuint program);
- GLboolean glIsRenderbuffer(GLuint renderbuffer);
- GLboolean glIsShader(GLuint shader);
- void glLinkProgram(GLuint program);
- void glReleaseShaderCompiler();
- void glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
- void glSampleCoverage(GLclampf value, GLboolean invert);
- void glShaderBinary(GLint n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLint length);
- void glShaderSource(GLuint shader, GLsizei count, const char** string, const GLint* length);
- void glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask);
- void glStencilMaskSeparate(GLenum face, GLuint mask);
- void glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
- void glUniform1f(GLint location, GLfloat x);
- void glUniform1fv(GLint location, GLsizei count, const GLfloat* v);
- void glUniform1i(GLint location, GLint x);
- void glUniform1iv(GLint location, GLsizei count, const GLint* v);
- void glUniform2f(GLint location, GLfloat x, GLfloat y);
- void glUniform2fv(GLint location, GLsizei count, const GLfloat* v);
- void glUniform2i(GLint location, GLint x, GLint y);
- void glUniform2iv(GLint location, GLsizei count, const GLint* v);
- void glUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z);
- void glUniform3fv(GLint location, GLsizei count, const GLfloat* v);
- void glUniform3i(GLint location, GLint x, GLint y, GLint z);
- void glUniform3iv(GLint location, GLsizei count, const GLint* v);
- void glUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
- void glUniform4fv(GLint location, GLsizei count, const GLfloat* v);
- void glUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w);
- void glUniform4iv(GLint location, GLsizei count, const GLint* v);
- void glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
- void glUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
- void glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
- void glUseProgram(GLuint program);
- void glValidateProgram(GLuint program);
- void glVertexAttrib1f(GLuint indx, GLfloat x);
- void glVertexAttrib1fv(GLuint indx, const GLfloat* values);
- void glVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y);
- void glVertexAttrib2fv(GLuint indx, const GLfloat* values);
- void glVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z);
- void glVertexAttrib3fv(GLuint indx, const GLfloat* values);
- void glVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
- void glVertexAttrib4fv(GLuint indx, const GLfloat* values);
- void glVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr);
-
-private:
- QOpenGLFunctionsPrivate *d_ptr;
- static bool isInitialized(const QOpenGLFunctionsPrivate *d) { return d != 0; }
-};
-
-Q_DECLARE_OPERATORS_FOR_FLAGS(QOpenGLFunctions::OpenGLFeatures)
-
-struct QOpenGLFunctionsPrivate
-{
- QOpenGLFunctionsPrivate(const QGLContext *context = 0);
-
-#ifndef QT_OPENGL_ES_2
- void (QT3D_GLF_APIENTRYP activeTexture)(GLenum texture);
- void (QT3D_GLF_APIENTRYP attachShader)(GLuint program, GLuint shader);
- void (QT3D_GLF_APIENTRYP bindAttribLocation)(GLuint program, GLuint index, const char* name);
- void (QT3D_GLF_APIENTRYP bindBuffer)(GLenum target, GLuint buffer);
- void (QT3D_GLF_APIENTRYP bindFramebuffer)(GLenum target, GLuint framebuffer);
- void (QT3D_GLF_APIENTRYP bindRenderbuffer)(GLenum target, GLuint renderbuffer);
- void (QT3D_GLF_APIENTRYP blendColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
- void (QT3D_GLF_APIENTRYP blendEquation)(GLenum mode);
- void (QT3D_GLF_APIENTRYP blendEquationSeparate)(GLenum modeRGB, GLenum modeAlpha);
- void (QT3D_GLF_APIENTRYP blendFuncSeparate)(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
- void (QT3D_GLF_APIENTRYP bufferData)(GLenum target, qgl_GLsizeiptr size, const void* data, GLenum usage);
- void (QT3D_GLF_APIENTRYP bufferSubData)(GLenum target, qgl_GLintptr offset, qgl_GLsizeiptr size, const void* data);
- GLenum (QT3D_GLF_APIENTRYP checkFramebufferStatus)(GLenum target);
- void (QT3D_GLF_APIENTRYP compileShader)(GLuint shader);
- void (QT3D_GLF_APIENTRYP compressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data);
- void (QT3D_GLF_APIENTRYP compressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data);
- GLuint (QT3D_GLF_APIENTRYP createProgram)();
- GLuint (QT3D_GLF_APIENTRYP createShader)(GLenum type);
- void (QT3D_GLF_APIENTRYP deleteBuffers)(GLsizei n, const GLuint* buffers);
- void (QT3D_GLF_APIENTRYP deleteFramebuffers)(GLsizei n, const GLuint* framebuffers);
- void (QT3D_GLF_APIENTRYP deleteProgram)(GLuint program);
- void (QT3D_GLF_APIENTRYP deleteRenderbuffers)(GLsizei n, const GLuint* renderbuffers);
- void (QT3D_GLF_APIENTRYP deleteShader)(GLuint shader);
- void (QT3D_GLF_APIENTRYP detachShader)(GLuint program, GLuint shader);
- void (QT3D_GLF_APIENTRYP disableVertexAttribArray)(GLuint index);
- void (QT3D_GLF_APIENTRYP enableVertexAttribArray)(GLuint index);
- void (QT3D_GLF_APIENTRYP framebufferRenderbuffer)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
- void (QT3D_GLF_APIENTRYP framebufferTexture2D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
- void (QT3D_GLF_APIENTRYP genBuffers)(GLsizei n, GLuint* buffers);
- void (QT3D_GLF_APIENTRYP generateMipmap)(GLenum target);
- void (QT3D_GLF_APIENTRYP genFramebuffers)(GLsizei n, GLuint* framebuffers);
- void (QT3D_GLF_APIENTRYP genRenderbuffers)(GLsizei n, GLuint* renderbuffers);
- void (QT3D_GLF_APIENTRYP getActiveAttrib)(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name);
- void (QT3D_GLF_APIENTRYP getActiveUniform)(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name);
- void (QT3D_GLF_APIENTRYP getAttachedShaders)(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders);
- int (QT3D_GLF_APIENTRYP getAttribLocation)(GLuint program, const char* name);
- void (QT3D_GLF_APIENTRYP getBufferParameteriv)(GLenum target, GLenum pname, GLint* params);
- void (QT3D_GLF_APIENTRYP getFramebufferAttachmentParameteriv)(GLenum target, GLenum attachment, GLenum pname, GLint* params);
- void (QT3D_GLF_APIENTRYP getProgramiv)(GLuint program, GLenum pname, GLint* params);
- void (QT3D_GLF_APIENTRYP getProgramInfoLog)(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog);
- void (QT3D_GLF_APIENTRYP getRenderbufferParameteriv)(GLenum target, GLenum pname, GLint* params);
- void (QT3D_GLF_APIENTRYP getShaderiv)(GLuint shader, GLenum pname, GLint* params);
- void (QT3D_GLF_APIENTRYP getShaderInfoLog)(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog);
- void (QT3D_GLF_APIENTRYP getShaderPrecisionFormat)(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
- void (QT3D_GLF_APIENTRYP getShaderSource)(GLuint shader, GLsizei bufsize, GLsizei* length, char* source);
- void (QT3D_GLF_APIENTRYP getUniformfv)(GLuint program, GLint location, GLfloat* params);
- void (QT3D_GLF_APIENTRYP getUniformiv)(GLuint program, GLint location, GLint* params);
- int (QT3D_GLF_APIENTRYP getUniformLocation)(GLuint program, const char* name);
- void (QT3D_GLF_APIENTRYP getVertexAttribfv)(GLuint index, GLenum pname, GLfloat* params);
- void (QT3D_GLF_APIENTRYP getVertexAttribiv)(GLuint index, GLenum pname, GLint* params);
- void (QT3D_GLF_APIENTRYP getVertexAttribPointerv)(GLuint index, GLenum pname, void** pointer);
- GLboolean (QT3D_GLF_APIENTRYP isBuffer)(GLuint buffer);
- GLboolean (QT3D_GLF_APIENTRYP isFramebuffer)(GLuint framebuffer);
- GLboolean (QT3D_GLF_APIENTRYP isProgram)(GLuint program);
- GLboolean (QT3D_GLF_APIENTRYP isRenderbuffer)(GLuint renderbuffer);
- GLboolean (QT3D_GLF_APIENTRYP isShader)(GLuint shader);
- void (QT3D_GLF_APIENTRYP linkProgram)(GLuint program);
- void (QT3D_GLF_APIENTRYP releaseShaderCompiler)();
- void (QT3D_GLF_APIENTRYP renderbufferStorage)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
- void (QT3D_GLF_APIENTRYP sampleCoverage)(GLclampf value, GLboolean invert);
- void (QT3D_GLF_APIENTRYP shaderBinary)(GLint n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLint length);
- void (QT3D_GLF_APIENTRYP shaderSource)(GLuint shader, GLsizei count, const char** string, const GLint* length);
- void (QT3D_GLF_APIENTRYP stencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask);
- void (QT3D_GLF_APIENTRYP stencilMaskSeparate)(GLenum face, GLuint mask);
- void (QT3D_GLF_APIENTRYP stencilOpSeparate)(GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
- void (QT3D_GLF_APIENTRYP uniform1f)(GLint location, GLfloat x);
- void (QT3D_GLF_APIENTRYP uniform1fv)(GLint location, GLsizei count, const GLfloat* v);
- void (QT3D_GLF_APIENTRYP uniform1i)(GLint location, GLint x);
- void (QT3D_GLF_APIENTRYP uniform1iv)(GLint location, GLsizei count, const GLint* v);
- void (QT3D_GLF_APIENTRYP uniform2f)(GLint location, GLfloat x, GLfloat y);
- void (QT3D_GLF_APIENTRYP uniform2fv)(GLint location, GLsizei count, const GLfloat* v);
- void (QT3D_GLF_APIENTRYP uniform2i)(GLint location, GLint x, GLint y);
- void (QT3D_GLF_APIENTRYP uniform2iv)(GLint location, GLsizei count, const GLint* v);
- void (QT3D_GLF_APIENTRYP uniform3f)(GLint location, GLfloat x, GLfloat y, GLfloat z);
- void (QT3D_GLF_APIENTRYP uniform3fv)(GLint location, GLsizei count, const GLfloat* v);
- void (QT3D_GLF_APIENTRYP uniform3i)(GLint location, GLint x, GLint y, GLint z);
- void (QT3D_GLF_APIENTRYP uniform3iv)(GLint location, GLsizei count, const GLint* v);
- void (QT3D_GLF_APIENTRYP uniform4f)(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
- void (QT3D_GLF_APIENTRYP uniform4fv)(GLint location, GLsizei count, const GLfloat* v);
- void (QT3D_GLF_APIENTRYP uniform4i)(GLint location, GLint x, GLint y, GLint z, GLint w);
- void (QT3D_GLF_APIENTRYP uniform4iv)(GLint location, GLsizei count, const GLint* v);
- void (QT3D_GLF_APIENTRYP uniformMatrix2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
- void (QT3D_GLF_APIENTRYP uniformMatrix3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
- void (QT3D_GLF_APIENTRYP uniformMatrix4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
- void (QT3D_GLF_APIENTRYP useProgram)(GLuint program);
- void (QT3D_GLF_APIENTRYP validateProgram)(GLuint program);
- void (QT3D_GLF_APIENTRYP vertexAttrib1f)(GLuint indx, GLfloat x);
- void (QT3D_GLF_APIENTRYP vertexAttrib1fv)(GLuint indx, const GLfloat* values);
- void (QT3D_GLF_APIENTRYP vertexAttrib2f)(GLuint indx, GLfloat x, GLfloat y);
- void (QT3D_GLF_APIENTRYP vertexAttrib2fv)(GLuint indx, const GLfloat* values);
- void (QT3D_GLF_APIENTRYP vertexAttrib3f)(GLuint indx, GLfloat x, GLfloat y, GLfloat z);
- void (QT3D_GLF_APIENTRYP vertexAttrib3fv)(GLuint indx, const GLfloat* values);
- void (QT3D_GLF_APIENTRYP vertexAttrib4f)(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
- void (QT3D_GLF_APIENTRYP vertexAttrib4fv)(GLuint indx, const GLfloat* values);
- void (QT3D_GLF_APIENTRYP vertexAttribPointer)(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr);
-#endif
-};
-
-inline void QOpenGLFunctions::glActiveTexture(GLenum texture)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glActiveTexture(texture);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->activeTexture(texture);
-#endif
-}
-
-inline void QOpenGLFunctions::glAttachShader(GLuint program, GLuint shader)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glAttachShader(program, shader);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->attachShader(program, shader);
-#endif
-}
-
-inline void QOpenGLFunctions::glBindAttribLocation(GLuint program, GLuint index, const char* name)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glBindAttribLocation(program, index, name);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->bindAttribLocation(program, index, name);
-#endif
-}
-
-inline void QOpenGLFunctions::glBindBuffer(GLenum target, GLuint buffer)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glBindBuffer(target, buffer);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->bindBuffer(target, buffer);
-#endif
-}
-
-inline void QOpenGLFunctions::glBindFramebuffer(GLenum target, GLuint framebuffer)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glBindFramebuffer(target, framebuffer);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->bindFramebuffer(target, framebuffer);
-#endif
-}
-
-inline void QOpenGLFunctions::glBindRenderbuffer(GLenum target, GLuint renderbuffer)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glBindRenderbuffer(target, renderbuffer);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->bindRenderbuffer(target, renderbuffer);
-#endif
-}
-
-inline void QOpenGLFunctions::glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glBlendColor(red, green, blue, alpha);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->blendColor(red, green, blue, alpha);
-#endif
-}
-
-inline void QOpenGLFunctions::glBlendEquation(GLenum mode)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glBlendEquation(mode);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->blendEquation(mode);
-#endif
-}
-
-inline void QOpenGLFunctions::glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glBlendEquationSeparate(modeRGB, modeAlpha);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->blendEquationSeparate(modeRGB, modeAlpha);
-#endif
-}
-
-inline void QOpenGLFunctions::glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->blendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
-#endif
-}
-
-inline void QOpenGLFunctions::glBufferData(GLenum target, qgl_GLsizeiptr size, const void* data, GLenum usage)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glBufferData(target, size, data, usage);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->bufferData(target, size, data, usage);
-#endif
-}
-
-inline void QOpenGLFunctions::glBufferSubData(GLenum target, qgl_GLintptr offset, qgl_GLsizeiptr size, const void* data)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glBufferSubData(target, offset, size, data);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->bufferSubData(target, offset, size, data);
-#endif
-}
-
-inline GLenum QOpenGLFunctions::glCheckFramebufferStatus(GLenum target)
-{
-#if defined(QT_OPENGL_ES_2)
- return ::glCheckFramebufferStatus(target);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- return d_ptr->checkFramebufferStatus(target);
-#endif
-}
-
-inline void QOpenGLFunctions::glClearDepthf(GLclampf depth)
-{
-#ifndef QT_OPENGL_ES
- ::glClearDepth(depth);
-#else
- ::glClearDepthf(depth);
-#endif
-}
-
-inline void QOpenGLFunctions::glCompileShader(GLuint shader)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glCompileShader(shader);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->compileShader(shader);
-#endif
-}
-
-inline void QOpenGLFunctions::glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->compressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data);
-#endif
-}
-
-inline void QOpenGLFunctions::glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->compressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);
-#endif
-}
-
-inline GLuint QOpenGLFunctions::glCreateProgram()
-{
-#if defined(QT_OPENGL_ES_2)
- return ::glCreateProgram();
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- return d_ptr->createProgram();
-#endif
-}
-
-inline GLuint QOpenGLFunctions::glCreateShader(GLenum type)
-{
-#if defined(QT_OPENGL_ES_2)
- return ::glCreateShader(type);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- return d_ptr->createShader(type);
-#endif
-}
-
-inline void QOpenGLFunctions::glDeleteBuffers(GLsizei n, const GLuint* buffers)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glDeleteBuffers(n, buffers);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->deleteBuffers(n, buffers);
-#endif
-}
-
-inline void QOpenGLFunctions::glDeleteFramebuffers(GLsizei n, const GLuint* framebuffers)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glDeleteFramebuffers(n, framebuffers);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->deleteFramebuffers(n, framebuffers);
-#endif
-}
-
-inline void QOpenGLFunctions::glDeleteProgram(GLuint program)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glDeleteProgram(program);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->deleteProgram(program);
-#endif
-}
-
-inline void QOpenGLFunctions::glDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glDeleteRenderbuffers(n, renderbuffers);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->deleteRenderbuffers(n, renderbuffers);
-#endif
-}
-
-inline void QOpenGLFunctions::glDeleteShader(GLuint shader)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glDeleteShader(shader);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->deleteShader(shader);
-#endif
-}
-
-inline void QOpenGLFunctions::glDepthRangef(GLclampf zNear, GLclampf zFar)
-{
-#ifndef QT_OPENGL_ES
- ::glDepthRange(zNear, zFar);
-#else
- ::glDepthRangef(zNear, zFar);
-#endif
-}
-
-inline void QOpenGLFunctions::glDetachShader(GLuint program, GLuint shader)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glDetachShader(program, shader);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->detachShader(program, shader);
-#endif
-}
-
-inline void QOpenGLFunctions::glDisableVertexAttribArray(GLuint index)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glDisableVertexAttribArray(index);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->disableVertexAttribArray(index);
-#endif
-}
-
-inline void QOpenGLFunctions::glEnableVertexAttribArray(GLuint index)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glEnableVertexAttribArray(index);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->enableVertexAttribArray(index);
-#endif
-}
-
-inline void QOpenGLFunctions::glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->framebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
-#endif
-}
-
-inline void QOpenGLFunctions::glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glFramebufferTexture2D(target, attachment, textarget, texture, level);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->framebufferTexture2D(target, attachment, textarget, texture, level);
-#endif
-}
-
-inline void QOpenGLFunctions::glGenBuffers(GLsizei n, GLuint* buffers)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glGenBuffers(n, buffers);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->genBuffers(n, buffers);
-#endif
-}
-
-inline void QOpenGLFunctions::glGenerateMipmap(GLenum target)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glGenerateMipmap(target);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->generateMipmap(target);
-#endif
-}
-
-inline void QOpenGLFunctions::glGenFramebuffers(GLsizei n, GLuint* framebuffers)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glGenFramebuffers(n, framebuffers);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->genFramebuffers(n, framebuffers);
-#endif
-}
-
-inline void QOpenGLFunctions::glGenRenderbuffers(GLsizei n, GLuint* renderbuffers)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glGenRenderbuffers(n, renderbuffers);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->genRenderbuffers(n, renderbuffers);
-#endif
-}
-
-inline void QOpenGLFunctions::glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glGetActiveAttrib(program, index, bufsize, length, size, type, name);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->getActiveAttrib(program, index, bufsize, length, size, type, name);
-#endif
-}
-
-inline void QOpenGLFunctions::glGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glGetActiveUniform(program, index, bufsize, length, size, type, name);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->getActiveUniform(program, index, bufsize, length, size, type, name);
-#endif
-}
-
-inline void QOpenGLFunctions::glGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glGetAttachedShaders(program, maxcount, count, shaders);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->getAttachedShaders(program, maxcount, count, shaders);
-#endif
-}
-
-inline int QOpenGLFunctions::glGetAttribLocation(GLuint program, const char* name)
-{
-#if defined(QT_OPENGL_ES_2)
- return ::glGetAttribLocation(program, name);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- return d_ptr->getAttribLocation(program, name);
-#endif
-}
-
-inline void QOpenGLFunctions::glGetBufferParameteriv(GLenum target, GLenum pname, GLint* params)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glGetBufferParameteriv(target, pname, params);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->getBufferParameteriv(target, pname, params);
-#endif
-}
-
-inline void QOpenGLFunctions::glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glGetFramebufferAttachmentParameteriv(target, attachment, pname, params);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->getFramebufferAttachmentParameteriv(target, attachment, pname, params);
-#endif
-}
-
-inline void QOpenGLFunctions::glGetProgramiv(GLuint program, GLenum pname, GLint* params)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glGetProgramiv(program, pname, params);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->getProgramiv(program, pname, params);
-#endif
-}
-
-inline void QOpenGLFunctions::glGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glGetProgramInfoLog(program, bufsize, length, infolog);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->getProgramInfoLog(program, bufsize, length, infolog);
-#endif
-}
-
-inline void QOpenGLFunctions::glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glGetRenderbufferParameteriv(target, pname, params);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->getRenderbufferParameteriv(target, pname, params);
-#endif
-}
-
-inline void QOpenGLFunctions::glGetShaderiv(GLuint shader, GLenum pname, GLint* params)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glGetShaderiv(shader, pname, params);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->getShaderiv(shader, pname, params);
-#endif
-}
-
-inline void QOpenGLFunctions::glGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glGetShaderInfoLog(shader, bufsize, length, infolog);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->getShaderInfoLog(shader, bufsize, length, infolog);
-#endif
-}
-
-inline void QOpenGLFunctions::glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glGetShaderPrecisionFormat(shadertype, precisiontype, range, precision);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->getShaderPrecisionFormat(shadertype, precisiontype, range, precision);
-#endif
-}
-
-inline void QOpenGLFunctions::glGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, char* source)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glGetShaderSource(shader, bufsize, length, source);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->getShaderSource(shader, bufsize, length, source);
-#endif
-}
-
-inline void QOpenGLFunctions::glGetUniformfv(GLuint program, GLint location, GLfloat* params)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glGetUniformfv(program, location, params);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->getUniformfv(program, location, params);
-#endif
-}
-
-inline void QOpenGLFunctions::glGetUniformiv(GLuint program, GLint location, GLint* params)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glGetUniformiv(program, location, params);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->getUniformiv(program, location, params);
-#endif
-}
-
-inline int QOpenGLFunctions::glGetUniformLocation(GLuint program, const char* name)
-{
-#if defined(QT_OPENGL_ES_2)
- return ::glGetUniformLocation(program, name);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- return d_ptr->getUniformLocation(program, name);
-#endif
-}
-
-inline void QOpenGLFunctions::glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glGetVertexAttribfv(index, pname, params);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->getVertexAttribfv(index, pname, params);
-#endif
-}
-
-inline void QOpenGLFunctions::glGetVertexAttribiv(GLuint index, GLenum pname, GLint* params)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glGetVertexAttribiv(index, pname, params);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->getVertexAttribiv(index, pname, params);
-#endif
-}
-
-inline void QOpenGLFunctions::glGetVertexAttribPointerv(GLuint index, GLenum pname, void** pointer)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glGetVertexAttribPointerv(index, pname, pointer);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->getVertexAttribPointerv(index, pname, pointer);
-#endif
-}
-
-inline GLboolean QOpenGLFunctions::glIsBuffer(GLuint buffer)
-{
-#if defined(QT_OPENGL_ES_2)
- return ::glIsBuffer(buffer);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- return d_ptr->isBuffer(buffer);
-#endif
-}
-
-inline GLboolean QOpenGLFunctions::glIsFramebuffer(GLuint framebuffer)
-{
-#if defined(QT_OPENGL_ES_2)
- return ::glIsFramebuffer(framebuffer);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- return d_ptr->isFramebuffer(framebuffer);
-#endif
-}
-
-inline GLboolean QOpenGLFunctions::glIsProgram(GLuint program)
-{
-#if defined(QT_OPENGL_ES_2)
- return ::glIsProgram(program);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- return d_ptr->isProgram(program);
-#endif
-}
-
-inline GLboolean QOpenGLFunctions::glIsRenderbuffer(GLuint renderbuffer)
-{
-#if defined(QT_OPENGL_ES_2)
- return ::glIsRenderbuffer(renderbuffer);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- return d_ptr->isRenderbuffer(renderbuffer);
-#endif
-}
-
-inline GLboolean QOpenGLFunctions::glIsShader(GLuint shader)
-{
-#if defined(QT_OPENGL_ES_2)
- return ::glIsShader(shader);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- return d_ptr->isShader(shader);
-#endif
-}
-
-inline void QOpenGLFunctions::glLinkProgram(GLuint program)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glLinkProgram(program);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->linkProgram(program);
-#endif
-}
-
-inline void QOpenGLFunctions::glReleaseShaderCompiler()
-{
-#if defined(QT_OPENGL_ES_2)
- ::glReleaseShaderCompiler();
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->releaseShaderCompiler();
-#endif
-}
-
-inline void QOpenGLFunctions::glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glRenderbufferStorage(target, internalformat, width, height);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->renderbufferStorage(target, internalformat, width, height);
-#endif
-}
-
-inline void QOpenGLFunctions::glSampleCoverage(GLclampf value, GLboolean invert)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glSampleCoverage(value, invert);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->sampleCoverage(value, invert);
-#endif
-}
-
-inline void QOpenGLFunctions::glShaderBinary(GLint n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLint length)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glShaderBinary(n, shaders, binaryformat, binary, length);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->shaderBinary(n, shaders, binaryformat, binary, length);
-#endif
-}
-
-inline void QOpenGLFunctions::glShaderSource(GLuint shader, GLsizei count, const char** string, const GLint* length)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glShaderSource(shader, count, string, length);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->shaderSource(shader, count, string, length);
-#endif
-}
-
-inline void QOpenGLFunctions::glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glStencilFuncSeparate(face, func, ref, mask);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->stencilFuncSeparate(face, func, ref, mask);
-#endif
-}
-
-inline void QOpenGLFunctions::glStencilMaskSeparate(GLenum face, GLuint mask)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glStencilMaskSeparate(face, mask);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->stencilMaskSeparate(face, mask);
-#endif
-}
-
-inline void QOpenGLFunctions::glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glStencilOpSeparate(face, fail, zfail, zpass);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->stencilOpSeparate(face, fail, zfail, zpass);
-#endif
-}
-
-inline void QOpenGLFunctions::glUniform1f(GLint location, GLfloat x)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glUniform1f(location, x);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->uniform1f(location, x);
-#endif
-}
-
-inline void QOpenGLFunctions::glUniform1fv(GLint location, GLsizei count, const GLfloat* v)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glUniform1fv(location, count, v);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->uniform1fv(location, count, v);
-#endif
-}
-
-inline void QOpenGLFunctions::glUniform1i(GLint location, GLint x)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glUniform1i(location, x);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->uniform1i(location, x);
-#endif
-}
-
-inline void QOpenGLFunctions::glUniform1iv(GLint location, GLsizei count, const GLint* v)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glUniform1iv(location, count, v);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->uniform1iv(location, count, v);
-#endif
-}
-
-inline void QOpenGLFunctions::glUniform2f(GLint location, GLfloat x, GLfloat y)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glUniform2f(location, x, y);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->uniform2f(location, x, y);
-#endif
-}
-
-inline void QOpenGLFunctions::glUniform2fv(GLint location, GLsizei count, const GLfloat* v)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glUniform2fv(location, count, v);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->uniform2fv(location, count, v);
-#endif
-}
-
-inline void QOpenGLFunctions::glUniform2i(GLint location, GLint x, GLint y)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glUniform2i(location, x, y);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->uniform2i(location, x, y);
-#endif
-}
-
-inline void QOpenGLFunctions::glUniform2iv(GLint location, GLsizei count, const GLint* v)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glUniform2iv(location, count, v);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->uniform2iv(location, count, v);
-#endif
-}
-
-inline void QOpenGLFunctions::glUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glUniform3f(location, x, y, z);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->uniform3f(location, x, y, z);
-#endif
-}
-
-inline void QOpenGLFunctions::glUniform3fv(GLint location, GLsizei count, const GLfloat* v)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glUniform3fv(location, count, v);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->uniform3fv(location, count, v);
-#endif
-}
-
-inline void QOpenGLFunctions::glUniform3i(GLint location, GLint x, GLint y, GLint z)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glUniform3i(location, x, y, z);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->uniform3i(location, x, y, z);
-#endif
-}
-
-inline void QOpenGLFunctions::glUniform3iv(GLint location, GLsizei count, const GLint* v)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glUniform3iv(location, count, v);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->uniform3iv(location, count, v);
-#endif
-}
-
-inline void QOpenGLFunctions::glUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glUniform4f(location, x, y, z, w);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->uniform4f(location, x, y, z, w);
-#endif
-}
-
-inline void QOpenGLFunctions::glUniform4fv(GLint location, GLsizei count, const GLfloat* v)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glUniform4fv(location, count, v);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->uniform4fv(location, count, v);
-#endif
-}
-
-inline void QOpenGLFunctions::glUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glUniform4i(location, x, y, z, w);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->uniform4i(location, x, y, z, w);
-#endif
-}
-
-inline void QOpenGLFunctions::glUniform4iv(GLint location, GLsizei count, const GLint* v)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glUniform4iv(location, count, v);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->uniform4iv(location, count, v);
-#endif
-}
-
-inline void QOpenGLFunctions::glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glUniformMatrix2fv(location, count, transpose, value);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->uniformMatrix2fv(location, count, transpose, value);
-#endif
-}
-
-inline void QOpenGLFunctions::glUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glUniformMatrix3fv(location, count, transpose, value);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->uniformMatrix3fv(location, count, transpose, value);
-#endif
-}
-
-inline void QOpenGLFunctions::glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glUniformMatrix4fv(location, count, transpose, value);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->uniformMatrix4fv(location, count, transpose, value);
-#endif
-}
-
-inline void QOpenGLFunctions::glUseProgram(GLuint program)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glUseProgram(program);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->useProgram(program);
-#endif
-}
-
-inline void QOpenGLFunctions::glValidateProgram(GLuint program)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glValidateProgram(program);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->validateProgram(program);
-#endif
-}
-
-inline void QOpenGLFunctions::glVertexAttrib1f(GLuint indx, GLfloat x)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glVertexAttrib1f(indx, x);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->vertexAttrib1f(indx, x);
-#endif
-}
-
-inline void QOpenGLFunctions::glVertexAttrib1fv(GLuint indx, const GLfloat* values)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glVertexAttrib1fv(indx, values);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->vertexAttrib1fv(indx, values);
-#endif
-}
-
-inline void QOpenGLFunctions::glVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glVertexAttrib2f(indx, x, y);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->vertexAttrib2f(indx, x, y);
-#endif
-}
-
-inline void QOpenGLFunctions::glVertexAttrib2fv(GLuint indx, const GLfloat* values)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glVertexAttrib2fv(indx, values);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->vertexAttrib2fv(indx, values);
-#endif
-}
-
-inline void QOpenGLFunctions::glVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glVertexAttrib3f(indx, x, y, z);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->vertexAttrib3f(indx, x, y, z);
-#endif
-}
-
-inline void QOpenGLFunctions::glVertexAttrib3fv(GLuint indx, const GLfloat* values)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glVertexAttrib3fv(indx, values);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->vertexAttrib3fv(indx, values);
-#endif
-}
-
-inline void QOpenGLFunctions::glVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glVertexAttrib4f(indx, x, y, z, w);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->vertexAttrib4f(indx, x, y, z, w);
-#endif
-}
-
-inline void QOpenGLFunctions::glVertexAttrib4fv(GLuint indx, const GLfloat* values)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glVertexAttrib4fv(indx, values);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->vertexAttrib4fv(indx, values);
-#endif
-}
-
-inline void QOpenGLFunctions::glVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr)
-{
-#if defined(QT_OPENGL_ES_2)
- ::glVertexAttribPointer(indx, size, type, normalized, stride, ptr);
-#else
- Q_ASSERT(QOpenGLFunctions::isInitialized(d_ptr));
- d_ptr->vertexAttribPointer(indx, size, type, normalized, stride, ptr);
-#endif
-}
-
-#ifndef GL_ACTIVE_ATTRIBUTE_MAX_LENGTH
-#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
-#endif
-#ifndef GL_ACTIVE_ATTRIBUTES
-#define GL_ACTIVE_ATTRIBUTES 0x8B89
-#endif
-#ifndef GL_ACTIVE_TEXTURE
-#define GL_ACTIVE_TEXTURE 0x84E0
-#endif
-#ifndef GL_ACTIVE_UNIFORM_MAX_LENGTH
-#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
-#endif
-#ifndef GL_ACTIVE_UNIFORMS
-#define GL_ACTIVE_UNIFORMS 0x8B86
-#endif
-#ifndef GL_ALIASED_LINE_WIDTH_RANGE
-#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
-#endif
-#ifndef GL_ALIASED_POINT_SIZE_RANGE
-#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
-#endif
-#ifndef GL_ALPHA
-#define GL_ALPHA 0x1906
-#endif
-#ifndef GL_ALPHA_BITS
-#define GL_ALPHA_BITS 0x0D55
-#endif
-#ifndef GL_ALWAYS
-#define GL_ALWAYS 0x0207
-#endif
-#ifndef GL_ARRAY_BUFFER
-#define GL_ARRAY_BUFFER 0x8892
-#endif
-#ifndef GL_ARRAY_BUFFER_BINDING
-#define GL_ARRAY_BUFFER_BINDING 0x8894
-#endif
-#ifndef GL_ATTACHED_SHADERS
-#define GL_ATTACHED_SHADERS 0x8B85
-#endif
-#ifndef GL_BACK
-#define GL_BACK 0x0405
-#endif
-#ifndef GL_BLEND
-#define GL_BLEND 0x0BE2
-#endif
-#ifndef GL_BLEND_COLOR
-#define GL_BLEND_COLOR 0x8005
-#endif
-#ifndef GL_BLEND_DST_ALPHA
-#define GL_BLEND_DST_ALPHA 0x80CA
-#endif
-#ifndef GL_BLEND_DST_RGB
-#define GL_BLEND_DST_RGB 0x80C8
-#endif
-#ifndef GL_BLEND_EQUATION
-#define GL_BLEND_EQUATION 0x8009
-#endif
-#ifndef GL_BLEND_EQUATION_ALPHA
-#define GL_BLEND_EQUATION_ALPHA 0x883D
-#endif
-#ifndef GL_BLEND_EQUATION_RGB
-#define GL_BLEND_EQUATION_RGB 0x8009
-#endif
-#ifndef GL_BLEND_SRC_ALPHA
-#define GL_BLEND_SRC_ALPHA 0x80CB
-#endif
-#ifndef GL_BLEND_SRC_RGB
-#define GL_BLEND_SRC_RGB 0x80C9
-#endif
-#ifndef GL_BLUE_BITS
-#define GL_BLUE_BITS 0x0D54
-#endif
-#ifndef GL_BOOL
-#define GL_BOOL 0x8B56
-#endif
-#ifndef GL_BOOL_VEC2
-#define GL_BOOL_VEC2 0x8B57
-#endif
-#ifndef GL_BOOL_VEC3
-#define GL_BOOL_VEC3 0x8B58
-#endif
-#ifndef GL_BOOL_VEC4
-#define GL_BOOL_VEC4 0x8B59
-#endif
-#ifndef GL_BUFFER_SIZE
-#define GL_BUFFER_SIZE 0x8764
-#endif
-#ifndef GL_BUFFER_USAGE
-#define GL_BUFFER_USAGE 0x8765
-#endif
-#ifndef GL_BYTE
-#define GL_BYTE 0x1400
-#endif
-#ifndef GL_CCW
-#define GL_CCW 0x0901
-#endif
-#ifndef GL_CLAMP_TO_EDGE
-#define GL_CLAMP_TO_EDGE 0x812F
-#endif
-#ifndef GL_COLOR_ATTACHMENT0
-#define GL_COLOR_ATTACHMENT0 0x8CE0
-#endif
-#ifndef GL_COLOR_BUFFER_BIT
-#define GL_COLOR_BUFFER_BIT 0x00004000
-#endif
-#ifndef GL_COLOR_CLEAR_VALUE
-#define GL_COLOR_CLEAR_VALUE 0x0C22
-#endif
-#ifndef GL_COLOR_WRITEMASK
-#define GL_COLOR_WRITEMASK 0x0C23
-#endif
-#ifndef GL_COMPILE_STATUS
-#define GL_COMPILE_STATUS 0x8B81
-#endif
-#ifndef GL_COMPRESSED_TEXTURE_FORMATS
-#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
-#endif
-#ifndef GL_CONSTANT_ALPHA
-#define GL_CONSTANT_ALPHA 0x8003
-#endif
-#ifndef GL_CONSTANT_COLOR
-#define GL_CONSTANT_COLOR 0x8001
-#endif
-#ifndef GL_CULL_FACE
-#define GL_CULL_FACE 0x0B44
-#endif
-#ifndef GL_CULL_FACE_MODE
-#define GL_CULL_FACE_MODE 0x0B45
-#endif
-#ifndef GL_CURRENT_PROGRAM
-#define GL_CURRENT_PROGRAM 0x8B8D
-#endif
-#ifndef GL_CURRENT_VERTEX_ATTRIB
-#define GL_CURRENT_VERTEX_ATTRIB 0x8626
-#endif
-#ifndef GL_CW
-#define GL_CW 0x0900
-#endif
-#ifndef GL_DECR
-#define GL_DECR 0x1E03
-#endif
-#ifndef GL_DECR_WRAP
-#define GL_DECR_WRAP 0x8508
-#endif
-#ifndef GL_DELETE_STATUS
-#define GL_DELETE_STATUS 0x8B80
-#endif
-#ifndef GL_DEPTH_ATTACHMENT
-#define GL_DEPTH_ATTACHMENT 0x8D00
-#endif
-#ifndef GL_DEPTH_BITS
-#define GL_DEPTH_BITS 0x0D56
-#endif
-#ifndef GL_DEPTH_BUFFER_BIT
-#define GL_DEPTH_BUFFER_BIT 0x00000100
-#endif
-#ifndef GL_DEPTH_CLEAR_VALUE
-#define GL_DEPTH_CLEAR_VALUE 0x0B73
-#endif
-#ifndef GL_DEPTH_COMPONENT
-#define GL_DEPTH_COMPONENT 0x1902
-#endif
-#ifndef GL_DEPTH_COMPONENT16
-#define GL_DEPTH_COMPONENT16 0x81A5
-#endif
-#ifndef GL_DEPTH_FUNC
-#define GL_DEPTH_FUNC 0x0B74
-#endif
-#ifndef GL_DEPTH_RANGE
-#define GL_DEPTH_RANGE 0x0B70
-#endif
-#ifndef GL_DEPTH_TEST
-#define GL_DEPTH_TEST 0x0B71
-#endif
-#ifndef GL_DEPTH_WRITEMASK
-#define GL_DEPTH_WRITEMASK 0x0B72
-#endif
-#ifndef GL_DITHER
-#define GL_DITHER 0x0BD0
-#endif
-#ifndef GL_DONT_CARE
-#define GL_DONT_CARE 0x1100
-#endif
-#ifndef GL_DST_ALPHA
-#define GL_DST_ALPHA 0x0304
-#endif
-#ifndef GL_DST_COLOR
-#define GL_DST_COLOR 0x0306
-#endif
-#ifndef GL_DYNAMIC_DRAW
-#define GL_DYNAMIC_DRAW 0x88E8
-#endif
-#ifndef GL_ELEMENT_ARRAY_BUFFER
-#define GL_ELEMENT_ARRAY_BUFFER 0x8893
-#endif
-#ifndef GL_ELEMENT_ARRAY_BUFFER_BINDING
-#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
-#endif
-#ifndef GL_EQUAL
-#define GL_EQUAL 0x0202
-#endif
-#ifndef GL_EXTENSIONS
-#define GL_EXTENSIONS 0x1F03
-#endif
-#ifndef GL_FALSE
-#define GL_FALSE 0
-#endif
-#ifndef GL_FASTEST
-#define GL_FASTEST 0x1101
-#endif
-#ifndef GL_FIXED
-#define GL_FIXED 0x140C
-#endif
-#ifndef GL_FLOAT
-#define GL_FLOAT 0x1406
-#endif
-#ifndef GL_FLOAT_MAT2
-#define GL_FLOAT_MAT2 0x8B5A
-#endif
-#ifndef GL_FLOAT_MAT3
-#define GL_FLOAT_MAT3 0x8B5B
-#endif
-#ifndef GL_FLOAT_MAT4
-#define GL_FLOAT_MAT4 0x8B5C
-#endif
-#ifndef GL_FLOAT_VEC2
-#define GL_FLOAT_VEC2 0x8B50
-#endif
-#ifndef GL_FLOAT_VEC3
-#define GL_FLOAT_VEC3 0x8B51
-#endif
-#ifndef GL_FLOAT_VEC4
-#define GL_FLOAT_VEC4 0x8B52
-#endif
-#ifndef GL_FRAGMENT_SHADER
-#define GL_FRAGMENT_SHADER 0x8B30
-#endif
-#ifndef GL_FRAMEBUFFER
-#define GL_FRAMEBUFFER 0x8D40
-#endif
-#ifndef GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
-#endif
-#ifndef GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
-#endif
-#ifndef GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
-#endif
-#ifndef GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
-#endif
-#ifndef GL_FRAMEBUFFER_BINDING
-#define GL_FRAMEBUFFER_BINDING 0x8CA6
-#endif
-#ifndef GL_FRAMEBUFFER_COMPLETE
-#define GL_FRAMEBUFFER_COMPLETE 0x8CD5
-#endif
-#ifndef GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT
-#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
-#endif
-#ifndef GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS
-#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9
-#endif
-#ifndef GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT
-#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
-#endif
-#ifndef GL_FRAMEBUFFER_UNSUPPORTED
-#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
-#endif
-#ifndef GL_FRONT
-#define GL_FRONT 0x0404
-#endif
-#ifndef GL_FRONT_AND_BACK
-#define GL_FRONT_AND_BACK 0x0408
-#endif
-#ifndef GL_FRONT_FACE
-#define GL_FRONT_FACE 0x0B46
-#endif
-#ifndef GL_FUNC_ADD
-#define GL_FUNC_ADD 0x8006
-#endif
-#ifndef GL_FUNC_REVERSE_SUBTRACT
-#define GL_FUNC_REVERSE_SUBTRACT 0x800B
-#endif
-#ifndef GL_FUNC_SUBTRACT
-#define GL_FUNC_SUBTRACT 0x800A
-#endif
-#ifndef GL_GENERATE_MIPMAP_HINT
-#define GL_GENERATE_MIPMAP_HINT 0x8192
-#endif
-#ifndef GL_GEQUAL
-#define GL_GEQUAL 0x0206
-#endif
-#ifndef GL_GREATER
-#define GL_GREATER 0x0204
-#endif
-#ifndef GL_GREEN_BITS
-#define GL_GREEN_BITS 0x0D53
-#endif
-#ifndef GL_HIGH_FLOAT
-#define GL_HIGH_FLOAT 0x8DF2
-#endif
-#ifndef GL_HIGH_INT
-#define GL_HIGH_INT 0x8DF5
-#endif
-#ifndef GL_IMPLEMENTATION_COLOR_READ_FORMAT
-#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
-#endif
-#ifndef GL_IMPLEMENTATION_COLOR_READ_TYPE
-#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A
-#endif
-#ifndef GL_INCR
-#define GL_INCR 0x1E02
-#endif
-#ifndef GL_INCR_WRAP
-#define GL_INCR_WRAP 0x8507
-#endif
-#ifndef GL_INFO_LOG_LENGTH
-#define GL_INFO_LOG_LENGTH 0x8B84
-#endif
-#ifndef GL_INT
-#define GL_INT 0x1404
-#endif
-#ifndef GL_INT_VEC2
-#define GL_INT_VEC2 0x8B53
-#endif
-#ifndef GL_INT_VEC3
-#define GL_INT_VEC3 0x8B54
-#endif
-#ifndef GL_INT_VEC4
-#define GL_INT_VEC4 0x8B55
-#endif
-#ifndef GL_INVALID_ENUM
-#define GL_INVALID_ENUM 0x0500
-#endif
-#ifndef GL_INVALID_FRAMEBUFFER_OPERATION
-#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
-#endif
-#ifndef GL_INVALID_OPERATION
-#define GL_INVALID_OPERATION 0x0502
-#endif
-#ifndef GL_INVALID_VALUE
-#define GL_INVALID_VALUE 0x0501
-#endif
-#ifndef GL_INVERT
-#define GL_INVERT 0x150A
-#endif
-#ifndef GL_KEEP
-#define GL_KEEP 0x1E00
-#endif
-#ifndef GL_LEQUAL
-#define GL_LEQUAL 0x0203
-#endif
-#ifndef GL_LESS
-#define GL_LESS 0x0201
-#endif
-#ifndef GL_LINEAR
-#define GL_LINEAR 0x2601
-#endif
-#ifndef GL_LINEAR_MIPMAP_LINEAR
-#define GL_LINEAR_MIPMAP_LINEAR 0x2703
-#endif
-#ifndef GL_LINEAR_MIPMAP_NEAREST
-#define GL_LINEAR_MIPMAP_NEAREST 0x2701
-#endif
-#ifndef GL_LINE_LOOP
-#define GL_LINE_LOOP 0x0002
-#endif
-#ifndef GL_LINES
-#define GL_LINES 0x0001
-#endif
-#ifndef GL_LINE_STRIP
-#define GL_LINE_STRIP 0x0003
-#endif
-#ifndef GL_LINE_WIDTH
-#define GL_LINE_WIDTH 0x0B21
-#endif
-#ifndef GL_LINK_STATUS
-#define GL_LINK_STATUS 0x8B82
-#endif
-#ifndef GL_LOW_FLOAT
-#define GL_LOW_FLOAT 0x8DF0
-#endif
-#ifndef GL_LOW_INT
-#define GL_LOW_INT 0x8DF3
-#endif
-#ifndef GL_LUMINANCE
-#define GL_LUMINANCE 0x1909
-#endif
-#ifndef GL_LUMINANCE_ALPHA
-#define GL_LUMINANCE_ALPHA 0x190A
-#endif
-#ifndef GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS
-#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
-#endif
-#ifndef GL_MAX_CUBE_MAP_TEXTURE_SIZE
-#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
-#endif
-#ifndef GL_MAX_FRAGMENT_UNIFORM_VECTORS
-#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD
-#endif
-#ifndef GL_MAX_RENDERBUFFER_SIZE
-#define GL_MAX_RENDERBUFFER_SIZE 0x84E8
-#endif
-#ifndef GL_MAX_TEXTURE_IMAGE_UNITS
-#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
-#endif
-#ifndef GL_MAX_TEXTURE_SIZE
-#define GL_MAX_TEXTURE_SIZE 0x0D33
-#endif
-#ifndef GL_MAX_VARYING_VECTORS
-#define GL_MAX_VARYING_VECTORS 0x8DFC
-#endif
-#ifndef GL_MAX_VERTEX_ATTRIBS
-#define GL_MAX_VERTEX_ATTRIBS 0x8869
-#endif
-#ifndef GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS
-#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
-#endif
-#ifndef GL_MAX_VERTEX_UNIFORM_VECTORS
-#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB
-#endif
-#ifndef GL_MAX_VIEWPORT_DIMS
-#define GL_MAX_VIEWPORT_DIMS 0x0D3A
-#endif
-#ifndef GL_MEDIUM_FLOAT
-#define GL_MEDIUM_FLOAT 0x8DF1
-#endif
-#ifndef GL_MEDIUM_INT
-#define GL_MEDIUM_INT 0x8DF4
-#endif
-#ifndef GL_MIRRORED_REPEAT
-#define GL_MIRRORED_REPEAT 0x8370
-#endif
-#ifndef GL_NEAREST
-#define GL_NEAREST 0x2600
-#endif
-#ifndef GL_NEAREST_MIPMAP_LINEAR
-#define GL_NEAREST_MIPMAP_LINEAR 0x2702
-#endif
-#ifndef GL_NEAREST_MIPMAP_NEAREST
-#define GL_NEAREST_MIPMAP_NEAREST 0x2700
-#endif
-#ifndef GL_NEVER
-#define GL_NEVER 0x0200
-#endif
-#ifndef GL_NICEST
-#define GL_NICEST 0x1102
-#endif
-#ifndef GL_NO_ERROR
-#define GL_NO_ERROR 0
-#endif
-#ifndef GL_NONE
-#define GL_NONE 0
-#endif
-#ifndef GL_NOTEQUAL
-#define GL_NOTEQUAL 0x0205
-#endif
-#ifndef GL_NUM_COMPRESSED_TEXTURE_FORMATS
-#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
-#endif
-#ifndef GL_NUM_SHADER_BINARY_FORMATS
-#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9
-#endif
-#ifndef GL_ONE
-#define GL_ONE 1
-#endif
-#ifndef GL_ONE_MINUS_CONSTANT_ALPHA
-#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
-#endif
-#ifndef GL_ONE_MINUS_CONSTANT_COLOR
-#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
-#endif
-#ifndef GL_ONE_MINUS_DST_ALPHA
-#define GL_ONE_MINUS_DST_ALPHA 0x0305
-#endif
-#ifndef GL_ONE_MINUS_DST_COLOR
-#define GL_ONE_MINUS_DST_COLOR 0x0307
-#endif
-#ifndef GL_ONE_MINUS_SRC_ALPHA
-#define GL_ONE_MINUS_SRC_ALPHA 0x0303
-#endif
-#ifndef GL_ONE_MINUS_SRC_COLOR
-#define GL_ONE_MINUS_SRC_COLOR 0x0301
-#endif
-#ifndef GL_OUT_OF_MEMORY
-#define GL_OUT_OF_MEMORY 0x0505
-#endif
-#ifndef GL_PACK_ALIGNMENT
-#define GL_PACK_ALIGNMENT 0x0D05
-#endif
-#ifndef GL_POINTS
-#define GL_POINTS 0x0000
-#endif
-#ifndef GL_POLYGON_OFFSET_FACTOR
-#define GL_POLYGON_OFFSET_FACTOR 0x8038
-#endif
-#ifndef GL_POLYGON_OFFSET_FILL
-#define GL_POLYGON_OFFSET_FILL 0x8037
-#endif
-#ifndef GL_POLYGON_OFFSET_UNITS
-#define GL_POLYGON_OFFSET_UNITS 0x2A00
-#endif
-#ifndef GL_RED_BITS
-#define GL_RED_BITS 0x0D52
-#endif
-#ifndef GL_RENDERBUFFER
-#define GL_RENDERBUFFER 0x8D41
-#endif
-#ifndef GL_RENDERBUFFER_ALPHA_SIZE
-#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53
-#endif
-#ifndef GL_RENDERBUFFER_BINDING
-#define GL_RENDERBUFFER_BINDING 0x8CA7
-#endif
-#ifndef GL_RENDERBUFFER_BLUE_SIZE
-#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52
-#endif
-#ifndef GL_RENDERBUFFER_DEPTH_SIZE
-#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54
-#endif
-#ifndef GL_RENDERBUFFER_GREEN_SIZE
-#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51
-#endif
-#ifndef GL_RENDERBUFFER_HEIGHT
-#define GL_RENDERBUFFER_HEIGHT 0x8D43
-#endif
-#ifndef GL_RENDERBUFFER_INTERNAL_FORMAT
-#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44
-#endif
-#ifndef GL_RENDERBUFFER_RED_SIZE
-#define GL_RENDERBUFFER_RED_SIZE 0x8D50
-#endif
-#ifndef GL_RENDERBUFFER_STENCIL_SIZE
-#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55
-#endif
-#ifndef GL_RENDERBUFFER_WIDTH
-#define GL_RENDERBUFFER_WIDTH 0x8D42
-#endif
-#ifndef GL_RENDERER
-#define GL_RENDERER 0x1F01
-#endif
-#ifndef GL_REPEAT
-#define GL_REPEAT 0x2901
-#endif
-#ifndef GL_REPLACE
-#define GL_REPLACE 0x1E01
-#endif
-#ifndef GL_RGB
-#define GL_RGB 0x1907
-#endif
-#ifndef GL_RGB565
-#define GL_RGB565 0x8D62
-#endif
-#ifndef GL_RGB5_A1
-#define GL_RGB5_A1 0x8057
-#endif
-#ifndef GL_RGBA
-#define GL_RGBA 0x1908
-#endif
-#ifndef GL_RGBA4
-#define GL_RGBA4 0x8056
-#endif
-#ifndef GL_SAMPLE_ALPHA_TO_COVERAGE
-#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
-#endif
-#ifndef GL_SAMPLE_BUFFERS
-#define GL_SAMPLE_BUFFERS 0x80A8
-#endif
-#ifndef GL_SAMPLE_COVERAGE
-#define GL_SAMPLE_COVERAGE 0x80A0
-#endif
-#ifndef GL_SAMPLE_COVERAGE_INVERT
-#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
-#endif
-#ifndef GL_SAMPLE_COVERAGE_VALUE
-#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
-#endif
-#ifndef GL_SAMPLER_2D
-#define GL_SAMPLER_2D 0x8B5E
-#endif
-#ifndef GL_SAMPLER_CUBE
-#define GL_SAMPLER_CUBE 0x8B60
-#endif
-#ifndef GL_SAMPLES
-#define GL_SAMPLES 0x80A9
-#endif
-#ifndef GL_SCISSOR_BOX
-#define GL_SCISSOR_BOX 0x0C10
-#endif
-#ifndef GL_SCISSOR_TEST
-#define GL_SCISSOR_TEST 0x0C11
-#endif
-#ifndef GL_SHADER_BINARY_FORMATS
-#define GL_SHADER_BINARY_FORMATS 0x8DF8
-#endif
-#ifndef GL_SHADER_COMPILER
-#define GL_SHADER_COMPILER 0x8DFA
-#endif
-#ifndef GL_SHADER_SOURCE_LENGTH
-#define GL_SHADER_SOURCE_LENGTH 0x8B88
-#endif
-#ifndef GL_SHADER_TYPE
-#define GL_SHADER_TYPE 0x8B4F
-#endif
-#ifndef GL_SHADING_LANGUAGE_VERSION
-#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
-#endif
-#ifndef GL_SHORT
-#define GL_SHORT 0x1402
-#endif
-#ifndef GL_SRC_ALPHA
-#define GL_SRC_ALPHA 0x0302
-#endif
-#ifndef GL_SRC_ALPHA_SATURATE
-#define GL_SRC_ALPHA_SATURATE 0x0308
-#endif
-#ifndef GL_SRC_COLOR
-#define GL_SRC_COLOR 0x0300
-#endif
-#ifndef GL_STATIC_DRAW
-#define GL_STATIC_DRAW 0x88E4
-#endif
-#ifndef GL_STENCIL_ATTACHMENT
-#define GL_STENCIL_ATTACHMENT 0x8D20
-#endif
-#ifndef GL_STENCIL_BACK_FAIL
-#define GL_STENCIL_BACK_FAIL 0x8801
-#endif
-#ifndef GL_STENCIL_BACK_FUNC
-#define GL_STENCIL_BACK_FUNC 0x8800
-#endif
-#ifndef GL_STENCIL_BACK_PASS_DEPTH_FAIL
-#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802
-#endif
-#ifndef GL_STENCIL_BACK_PASS_DEPTH_PASS
-#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803
-#endif
-#ifndef GL_STENCIL_BACK_REF
-#define GL_STENCIL_BACK_REF 0x8CA3
-#endif
-#ifndef GL_STENCIL_BACK_VALUE_MASK
-#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
-#endif
-#ifndef GL_STENCIL_BACK_WRITEMASK
-#define GL_STENCIL_BACK_WRITEMASK 0x8CA5
-#endif
-#ifndef GL_STENCIL_BITS
-#define GL_STENCIL_BITS 0x0D57
-#endif
-#ifndef GL_STENCIL_BUFFER_BIT
-#define GL_STENCIL_BUFFER_BIT 0x00000400
-#endif
-#ifndef GL_STENCIL_CLEAR_VALUE
-#define GL_STENCIL_CLEAR_VALUE 0x0B91
-#endif
-#ifndef GL_STENCIL_FAIL
-#define GL_STENCIL_FAIL 0x0B94
-#endif
-#ifndef GL_STENCIL_FUNC
-#define GL_STENCIL_FUNC 0x0B92
-#endif
-#ifndef GL_STENCIL_INDEX
-#define GL_STENCIL_INDEX 0x1901
-#endif
-#ifndef GL_STENCIL_INDEX8
-#define GL_STENCIL_INDEX8 0x8D48
-#endif
-#ifndef GL_STENCIL_PASS_DEPTH_FAIL
-#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
-#endif
-#ifndef GL_STENCIL_PASS_DEPTH_PASS
-#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
-#endif
-#ifndef GL_STENCIL_REF
-#define GL_STENCIL_REF 0x0B97
-#endif
-#ifndef GL_STENCIL_TEST
-#define GL_STENCIL_TEST 0x0B90
-#endif
-#ifndef GL_STENCIL_VALUE_MASK
-#define GL_STENCIL_VALUE_MASK 0x0B93
-#endif
-#ifndef GL_STENCIL_WRITEMASK
-#define GL_STENCIL_WRITEMASK 0x0B98
-#endif
-#ifndef GL_STREAM_DRAW
-#define GL_STREAM_DRAW 0x88E0
-#endif
-#ifndef GL_SUBPIXEL_BITS
-#define GL_SUBPIXEL_BITS 0x0D50
-#endif
-#ifndef GL_TEXTURE0
-#define GL_TEXTURE0 0x84C0
-#endif
-#ifndef GL_TEXTURE
-#define GL_TEXTURE 0x1702
-#endif
-#ifndef GL_TEXTURE10
-#define GL_TEXTURE10 0x84CA
-#endif
-#ifndef GL_TEXTURE1
-#define GL_TEXTURE1 0x84C1
-#endif
-#ifndef GL_TEXTURE11
-#define GL_TEXTURE11 0x84CB
-#endif
-#ifndef GL_TEXTURE12
-#define GL_TEXTURE12 0x84CC
-#endif
-#ifndef GL_TEXTURE13
-#define GL_TEXTURE13 0x84CD
-#endif
-#ifndef GL_TEXTURE14
-#define GL_TEXTURE14 0x84CE
-#endif
-#ifndef GL_TEXTURE15
-#define GL_TEXTURE15 0x84CF
-#endif
-#ifndef GL_TEXTURE16
-#define GL_TEXTURE16 0x84D0
-#endif
-#ifndef GL_TEXTURE17
-#define GL_TEXTURE17 0x84D1
-#endif
-#ifndef GL_TEXTURE18
-#define GL_TEXTURE18 0x84D2
-#endif
-#ifndef GL_TEXTURE19
-#define GL_TEXTURE19 0x84D3
-#endif
-#ifndef GL_TEXTURE20
-#define GL_TEXTURE20 0x84D4
-#endif
-#ifndef GL_TEXTURE2
-#define GL_TEXTURE2 0x84C2
-#endif
-#ifndef GL_TEXTURE21
-#define GL_TEXTURE21 0x84D5
-#endif
-#ifndef GL_TEXTURE22
-#define GL_TEXTURE22 0x84D6
-#endif
-#ifndef GL_TEXTURE23
-#define GL_TEXTURE23 0x84D7
-#endif
-#ifndef GL_TEXTURE24
-#define GL_TEXTURE24 0x84D8
-#endif
-#ifndef GL_TEXTURE25
-#define GL_TEXTURE25 0x84D9
-#endif
-#ifndef GL_TEXTURE26
-#define GL_TEXTURE26 0x84DA
-#endif
-#ifndef GL_TEXTURE27
-#define GL_TEXTURE27 0x84DB
-#endif
-#ifndef GL_TEXTURE28
-#define GL_TEXTURE28 0x84DC
-#endif
-#ifndef GL_TEXTURE29
-#define GL_TEXTURE29 0x84DD
-#endif
-#ifndef GL_TEXTURE_2D
-#define GL_TEXTURE_2D 0x0DE1
-#endif
-#ifndef GL_TEXTURE30
-#define GL_TEXTURE30 0x84DE
-#endif
-#ifndef GL_TEXTURE3
-#define GL_TEXTURE3 0x84C3
-#endif
-#ifndef GL_TEXTURE31
-#define GL_TEXTURE31 0x84DF
-#endif
-#ifndef GL_TEXTURE4
-#define GL_TEXTURE4 0x84C4
-#endif
-#ifndef GL_TEXTURE5
-#define GL_TEXTURE5 0x84C5
-#endif
-#ifndef GL_TEXTURE6
-#define GL_TEXTURE6 0x84C6
-#endif
-#ifndef GL_TEXTURE7
-#define GL_TEXTURE7 0x84C7
-#endif
-#ifndef GL_TEXTURE8
-#define GL_TEXTURE8 0x84C8
-#endif
-#ifndef GL_TEXTURE9
-#define GL_TEXTURE9 0x84C9
-#endif
-#ifndef GL_TEXTURE_BINDING_2D
-#define GL_TEXTURE_BINDING_2D 0x8069
-#endif
-#ifndef GL_TEXTURE_BINDING_CUBE_MAP
-#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
-#endif
-#ifndef GL_TEXTURE_CUBE_MAP
-#define GL_TEXTURE_CUBE_MAP 0x8513
-#endif
-#ifndef GL_TEXTURE_CUBE_MAP_NEGATIVE_X
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
-#endif
-#ifndef GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
-#endif
-#ifndef GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
-#endif
-#ifndef GL_TEXTURE_CUBE_MAP_POSITIVE_X
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
-#endif
-#ifndef GL_TEXTURE_CUBE_MAP_POSITIVE_Y
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
-#endif
-#ifndef GL_TEXTURE_CUBE_MAP_POSITIVE_Z
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
-#endif
-#ifndef GL_TEXTURE_MAG_FILTER
-#define GL_TEXTURE_MAG_FILTER 0x2800
-#endif
-#ifndef GL_TEXTURE_MIN_FILTER
-#define GL_TEXTURE_MIN_FILTER 0x2801
-#endif
-#ifndef GL_TEXTURE_WRAP_S
-#define GL_TEXTURE_WRAP_S 0x2802
-#endif
-#ifndef GL_TEXTURE_WRAP_T
-#define GL_TEXTURE_WRAP_T 0x2803
-#endif
-#ifndef GL_TRIANGLE_FAN
-#define GL_TRIANGLE_FAN 0x0006
-#endif
-#ifndef GL_TRIANGLES
-#define GL_TRIANGLES 0x0004
-#endif
-#ifndef GL_TRIANGLE_STRIP
-#define GL_TRIANGLE_STRIP 0x0005
-#endif
-#ifndef GL_TRUE
-#define GL_TRUE 1
-#endif
-#ifndef GL_UNPACK_ALIGNMENT
-#define GL_UNPACK_ALIGNMENT 0x0CF5
-#endif
-#ifndef GL_UNSIGNED_BYTE
-#define GL_UNSIGNED_BYTE 0x1401
-#endif
-#ifndef GL_UNSIGNED_INT
-#define GL_UNSIGNED_INT 0x1405
-#endif
-#ifndef GL_UNSIGNED_SHORT
-#define GL_UNSIGNED_SHORT 0x1403
-#endif
-#ifndef GL_UNSIGNED_SHORT_4_4_4_4
-#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
-#endif
-#ifndef GL_UNSIGNED_SHORT_5_5_5_1
-#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
-#endif
-#ifndef GL_UNSIGNED_SHORT_5_6_5
-#define GL_UNSIGNED_SHORT_5_6_5 0x8363
-#endif
-#ifndef GL_VALIDATE_STATUS
-#define GL_VALIDATE_STATUS 0x8B83
-#endif
-#ifndef GL_VENDOR
-#define GL_VENDOR 0x1F00
-#endif
-#ifndef GL_VERSION
-#define GL_VERSION 0x1F02
-#endif
-#ifndef GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING
-#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
-#endif
-#ifndef GL_VERTEX_ATTRIB_ARRAY_ENABLED
-#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
-#endif
-#ifndef GL_VERTEX_ATTRIB_ARRAY_NORMALIZED
-#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
-#endif
-#ifndef GL_VERTEX_ATTRIB_ARRAY_POINTER
-#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
-#endif
-#ifndef GL_VERTEX_ATTRIB_ARRAY_SIZE
-#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
-#endif
-#ifndef GL_VERTEX_ATTRIB_ARRAY_STRIDE
-#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
-#endif
-#ifndef GL_VERTEX_ATTRIB_ARRAY_TYPE
-#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
-#endif
-#ifndef GL_VERTEX_SHADER
-#define GL_VERTEX_SHADER 0x8B31
-#endif
-#ifndef GL_VIEWPORT
-#define GL_VIEWPORT 0x0BA2
-#endif
-#ifndef GL_ZERO
-#define GL_ZERO 0
-#endif
-
-#endif
diff --git a/src/threed/arrays/arrays.pri b/src/threed/arrays/arrays.pri
deleted file mode 100644
index 978f252d..00000000
--- a/src/threed/arrays/arrays.pri
+++ /dev/null
@@ -1,28 +0,0 @@
-INCLUDEPATH += $$PWD
-VPATH += $$PWD
-HEADERS += \
- arrays/qglattributedescription.h \
- arrays/qglattributeset.h \
- arrays/qglattributevalue.h \
- arrays/qglindexbuffer.h \
- arrays/qglvertexbundle.h \
- arrays/qarray.h \
- arrays/qcolor4ub.h \
- arrays/qcustomdataarray.h \
- arrays/qvector2darray.h \
- arrays/qvector3darray.h \
- arrays/qvector4darray.h
-SOURCES += \
- qglattributedescription.cpp \
- qglattributeset.cpp \
- qglattributevalue.cpp \
- qglindexbuffer.cpp \
- qglvertexbundle.cpp \
- qarray.cpp \
- qcolor4ub.cpp \
- qcustomdataarray.cpp \
- qvector2darray.cpp \
- qvector3darray.cpp \
- qvector4darray.cpp
-PRIVATE_HEADERS += \
- qglvertexbundle_p.h
diff --git a/src/threed/arrays/qarray.cpp b/src/threed/arrays/qarray.cpp
deleted file mode 100644
index e9267ae3..00000000
--- a/src/threed/arrays/qarray.cpp
+++ /dev/null
@@ -1,1022 +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 "qarray.h"
-#include <limits.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QArray
- \brief The QArray class is a template class that provides a dynamic array of simple types.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::arrays
-
- QArray is similar to QVector except that it has much less overhead
- when constructing large arrays by appending individual elements
- one by one.
-
- QArray instances have a preallocated data area for quickly
- building small arrays on the stack without malloc overhead.
- Once the array grows beyond the preallocated size, it is copied
- to the heap. The size of the preallocated area, which defaults to 8,
- can be specified with the second template parameter:
-
- \code
- QArray<QVector3D, 32> array;
- \endcode
-
- QArray uses implicit sharing and copy-on-write semantics to support
- passing large arrays around an application with little overhead.
-
- QArray is heavily optimized for copy-on-write and the case of
- constructing an array by calling append(). It has a slight
- performance penalty for random access using the non-const
- version of operator[]().
-*/
-
-/*!
- \fn QArray::QArray()
-
- Constructs an empty array.
-
- \sa reserve()
-*/
-
-/*!
- \fn QArray::QArray(int size, const T &value)
-
- Constructs an array of \a size elements, all initialized
- to \a value.
-
- \sa fill()
-*/
-
-/*!
- \fn QArray::QArray(int size)
-
- Constructs an array of \a size elements, all initialized
- to their default-constructed values.
-*/
-
-/*!
- \fn QArray::QArray(const T *values, int size)
-
- Constructs an array of \a size elements, initialized
- from \a values.
-*/
-
-/*!
- \fn QArray::QArray(const QArray<T, PreallocSize> &other)
-
- Constructs a copy of \a other.
-
- \sa operator=()
-*/
-
-/*!
- \fn QArray::~QArray()
-
- Destroys the array.
-*/
-
-/*!
- \fn QArray<T, PreallocSize> &QArray::operator=(const QArray<T, PreallocSize> &other)
-
- Assigns \a other to this array and returns a reference
- to this array.
-*/
-
-/*!
- \fn int QArray::size() const
-
- Returns the number of elements in this array.
-
- \sa resize(), capacity(), isEmpty()
-*/
-
-/*!
- \fn int QArray::count() const
- \overload
-
- Same as size(), provided for convenience.
-*/
-
-/*!
- \fn int QArray::capacity() const
-
- Returns the number of elements that can be stored in this
- array before reallocation.
-
- \sa reserve(), size()
-*/
-
-/*!
- \fn bool QArray::isEmpty() const
-
- Returns true if this array is empty; false otherwise.
-
- \sa size(), clear()
-*/
-
-/*!
- \fn bool QArray::isDetached() const
- \internal
-
- Returns true if this array has definitely been detached from all
- other shared copies of the data; false otherwise.
-
- It is possible for this function to return false if the
- array was previously shared but no longer is. It is thus
- an indication that a detach() will probably be required.
-
- This function can be used to determine if functions that
- write to this array such as append(), replace(),
- and data(), will need to make a copy.
-
- Raw data arrays that are created with fromRawData() are
- never detached.
-
- \sa detach()
-*/
-
-/*!
- \fn void QArray::detach()
- \internal
-
- Detaches this array from all other shared copies of the data.
-
- \sa isDetached()
-*/
-
-/*!
- \fn void QArray::clear()
-
- Clears all elements from this array and sets the size to zero.
-
- This function will deallocate any memory that is used on the heap
- to store the array's elements. To reuse the same memory
- as before, call resize() with an argument of zero.
-
- \sa resize(), isEmpty()
-*/
-
-/*!
- \fn const T &QArray::at(int index) const
-
- Returns the item at position \a index in the array.
-
- \a index must be a valid index position in the array (i.e., 0 <= \a
- index < size()).
-
- \sa operator[](), constData(), value()
-*/
-
-/*!
- \fn T &QArray::operator[](int index)
-
- Returns the item at position \a index as a modifiable reference.
-
- \a index must be a valid index position in the vector (i.e., 0 <= \a index
- < size()).
-
- Note that using non-const operators can cause QArray
- to do a deep copy.
-
- \sa at(), value()
-*/
-
-/*!
- \fn const T &QArray::operator[](int index) const
-
- \overload
-
- Same as at(\a index).
-*/
-
-/*!
- \fn T QArray::value(int index) const
-
- Returns the value at position \a index in the vector.
-
- If the \a index is out of bounds, the function returns
- a default-constructed value. If you are certain that
- \a index is within bounds, you can use at() instead,
- which is slightly faster.
-
- \sa at(), operator[]()
-*/
-
-/*!
- \fn T QArray::value(int index, const T &defaultValue) const
- \overload
-
- If the \a index is out of bounds, the function returns
- \a defaultValue.
-*/
-
-/*!
- \fn T *QArray::extend(int size)
-
- Extends this array by \a size elements and returns a pointer
- to the storage, which is not initialized. The pointer is only
- valid until the array is reallocated or destroyed.
-
- The append() or resize() functions are recommended if T is a
- complex type, with extend() only used for simple types.
- Because the storage is not initialized, the caller should use
- the in-place new operator to set elements:
-
- \code
- QArray<QRegExp> array;
- QRegExp *space = array.extend(1);
- new (space) QRegExp(QLatin1String("exp"));
- \endcode
-
- \sa append(), resize()
-*/
-
-/*!
- \fn void QArray::append(const T &value)
-
- Appends \a value to this array.
-
- \sa prepend(), insert()
-*/
-
-/*!
- \fn void QArray::append(const T &value1, const T &value2)
-
- \overload
-
- Appends \a value1 and \a value2 to this array.
-*/
-
-/*!
- \fn void QArray::append(const T &value1, const T &value2, const T &value3)
-
- \overload
-
- Appends \a value1, \a value2, and \a value3 to this array.
-*/
-
-/*!
- \fn void QArray::append(const T &value1, const T &value2, const T &value3, const T &value4)
-
- \overload
-
- Appends \a value1, \a value2, \a value3, and \a value4 to this array.
-*/
-
-/*!
- \fn void QArray::append(const T *values, int count)
-
- Appends the \a count elements of \a values to this array.
-*/
-
-/*!
- \fn void QArray::append(const QArray<T, PreallocSize> &other)
-
- Appends the elements of \a other to this array.
-*/
-
-/*!
- \fn void QArray::prepend(const T &value)
-
- Prepends \a value to this array.
-
- \sa append(), insert()
-*/
-
-/*!
- \fn void QArray::insert(int index, const T &value)
-
- Inserts \a value at position \a index in this array.
- If \a index is 0, then \a value is prepended to the array.
- If \a index is size(), then \a value is appended to the array.
-
- \sa append(), prepend()
-*/
-
-/*!
- \fn void QArray::insert(int index, int count, const T &value)
- \overload
-
- Inserts \a count copies of \a value at position \a index
- in this array.
-*/
-
-/*!
- \fn QArray::iterator QArray::insert(iterator before, int count, const T &value)
-
- Inserts \a count copies of \a value in front of the item
- pointed to by the iterator \a before. Returns an iterator
- pointing at the first of the inserted items.
-*/
-
-/*!
- \fn QArray::iterator QArray::insert(iterator before, const T &value)
- \overload
-
- Inserts \a value in front of the item pointed to by the
- iterator \a before. Returns an iterator pointing at the
- inserted item.
-*/
-
-/*!
- \fn void QArray::replace(int index, const T &value)
-
- Replaces the element at \a index with \a value.
-
- \sa operator[](), remove()
-*/
-
-/*!
- \fn void QArray::replace(int index, const T *values, int count)
- \overload
-
- Replaces the \a count elements of this array with the
- contents of \a values, starting at \a index.
-
- If (\a index + \a count) is larger than the current size of this
- array, the array will be extended to that size.
-
- \sa append()
-*/
-
-/*!
- \fn void QArray::remove(int index)
-
- \overload
-
- Removes the element at position \a index in this array.
-*/
-
-/*!
- \fn void QArray::remove(int index, int count)
-
- Removes the \a count elements starting at position \a index
- in this array. If \a index or \a count is out of range,
- the set of removed elements will be truncated to those that
- are in range.
-*/
-
-/*!
- \fn QArray::iterator QArray::erase(iterator begin, iterator end)
- \overload
-
- Removes all the items from \a begin up to (but not including) \a
- end. Returns an iterator to the same item that \a end referred to
- before the call.
-*/
-
-/*!
- \fn QArray::iterator QArray::erase(iterator pos)
-
- Removes the item pointed to by the iterator \a pos from the
- vector, and returns an iterator to the next item in the vector
- (which may be end()).
-
- \sa insert(), remove()
-*/
-
-/*!
- \fn void QArray::removeFirst()
-
- Removes the first element from this array. Does nothing if
- the array is empty.
-
- \sa remove(), removeLast()
-*/
-
-/*!
- \fn void QArray::removeLast()
-
- Removes the last element from this array. Does nothing if
- the array is empty.
-
- \sa remove(), removeFirst()
-*/
-
-/*!
- \fn int QArray::indexOf(const T &value, int from) const
-
- Returns the index position of the first occurrence of
- \a value in the array, searching forward from index
- position \a from. Returns -1 if no item matched.
-
- If \a from is negative, then it indicates an index position
- relative to the end of the array, -1 being the last index
- position.
-
- This function requires the value type T to have an implementation
- of \c operator==().
-
- \sa lastIndexOf(), contains()
-*/
-
-/*!
- \fn int QArray::lastIndexOf(const T &value, int from) const
-
- Returns the index position of the last occurrence of
- \a value in the array, searching backward from index
- position \a from. Returns -1 if no item matched.
-
- If \a from is negative, then it indicates an index position
- relative to the end of the array, -1 being the last index
- position. The default for \a from is -1.
-
- This function requires the value type T to have an implementation
- of \c operator==().
-
- \sa indexOf(), contains()
-*/
-
-/*!
- \fn bool QArray::contains(const T &value) const
-
- Returns true if the array contains an occurrence of \a value;
- false otherwise.
-
- This function requires the value type T to have an implementation
- of \c operator==().
-
- \sa indexOf(), count()
-*/
-
-/*!
- \fn int QArray::count(const T &value) const
-
- Returns the number of occurrences of \a value in the array.
-
- This function requires the value type T to have an implementation
- of \c operator==().
-
- \sa contains(), indexOf()
-*/
-
-/*!
- \fn void QArray::resize(int size)
-
- Sets the size of the array to \a size. If \a size is greater
- than the current size, elements are added to the end and are
- initialized to a default-constructed value. If \a size is less
- than the current size, elements are removed from the end.
-
- \sa size(), reserve(), squeeze()
-*/
-
-/*!
- \fn void QArray::reserve(int size)
-
- Increases the capacity of this array to reserve space for
- at least \a size elements. If the capacity is already larger
- than \a size, this function does nothing; in particular, it does
- not remove elements from the array like resize() does.
-
- This function can be useful when you know how roughly many elements
- will be appended ahead of time. Reserving the space once can avoid
- unnecessary realloc operations later.
-
- \sa capacity(), resize(), squeeze()
-*/
-
-/*!
- \fn void QArray::squeeze()
-
- Releases any memory not required to store the array's elements
- by reducing its capacity() to size().
-
- This function is intended for reclaiming memory in an
- array that is being used over and over with different contents.
- As elements are added to an array, it will be constantly
- expanded in size. This function can realloc the array
- to a smaller size to reclaim unused memory.
-
- \sa reserve(), capacity()
-*/
-
-/*!
- \fn QArray<T, PreallocSize> &QArray::fill(const T &value, int size)
-
- Assigns \a value to all items in the array. If \a size is
- different from -1 (the default), the array is resized to
- \a size beforehand. Returns a reference to the array.
-
- \sa resize()
-*/
-
-/*!
- \fn void QArray::reverse()
-
- Reverses the order of this array in place.
-
- \sa reversed()
-*/
-
-/*!
- \fn QArray<T, PreallocSize> QArray::reversed() const
-
- Returns a copy of this array with elements in the reverse order.
-
- \sa reverse()
-*/
-
-/*!
- \fn QArray<T, PreallocSize> QArray::mid(int index, int length) const
-
- Returns an array containing the \a length elements of
- this array, starting at \a index. If \a length is less
- than zero, or extends further than the end of the array, then all
- elements extending from \a index to the end of the array will be
- included in the return value.
-
- \sa left(), right()
-*/
-
-/*!
- \fn QArray<T, PreallocSize> QArray::left(int length) const;
-
- Returns an array containing the first \a length
- elements of this array. If \a length is less than zero,
- or greater than size(), then all elements in this array will
- be included in the return value.
-
- \sa mid(), right()
-*/
-
-/*!
- \fn QArray<T, PreallocSize> QArray::right(int length) const;
-
- Returns an array containing the last \a length
- elements of this array. If \a length is less than zero,
- or greater than size(), then all elements in this array
- will be included in the return value.
-
- \sa mid(), left()
-*/
-
-/*!
- \fn T *QArray::data()
-
- Returns a pointer to the data stored in the array. The pointer
- can be used to access and modify the items in the array.
-
- The pointer remains valid as long as the array isn't
- reallocated.
-
- This function is mostly useful to pass an array to a function
- that accepts a plain C++ array. It may make a deep copy of the
- array's elements if the array is implicitly shared.
-
- \sa constData(), operator[]()
-*/
-
-/*!
- \fn const T *QArray::data() const
-
- \overload
-*/
-
-/*!
- \fn const T *QArray::constData() const
-
- Returns a const pointer to the data stored in the array.
- The pointer can be used to access the items in the array.
- The pointer remains valid as long as the array isn't
- reallocated.
-
- This function is mostly useful to pass an array to a function
- that accepts a plain C++ array.
-
- \sa data(), operator[]()
-*/
-
-/*!
- \fn QArray<T, PreallocSize> QArray::fromRawData(const T *data, int size)
-
- Returns an array consisting of the \a size elements from \a data.
-
- This function takes a reference to \a data, but does not copy
- the elements until the array is modified. The memory at \a data
- must remain valid until the returned array is destroyed
- or modified.
-
- Use append() instead of fromRawData() to force a copy to be made
- of the elements at \a data when the array is created:
-
- \code
- // Makes a copy of the data immediately.
- QArray<float> array;
- array.append(data, size);
-
- // Does not make a copy of the data until the array is modified.
- QArray<float> array;
- array = QArray<float>::fromRawData(data, size);
- \endcode
-
- \sa fromWritableRawData(), append()
-*/
-
-/*!
- \fn QArray<T, PreallocSize> QArray::fromWritableRawData(T *data, int size)
-
- Returns an array consisting of the \a size elements from \a data.
-
- This function takes a reference to \a data, but does not copy
- the elements until the array is reallocated to a larger size.
- The memory at \a data must remain valid until the returned
- array is destroyed or reallocated.
-
- The elements of \a data will be modified in-place. This differs
- from fromRawData() which will make a copy of the elements
- of \a data when the array is modified.
-
- If the returned array is resized to less than \a size,
- then a copy will not be made, and append() can be used to
- append new items up to \a size. Further calls to append()
- after \a size will force the array to be reallocated.
-
- If the returned array is resized to more than \a size,
- then a copy of the data will be made and further modifications
- will not affect the elements at \a data.
-
- \sa fromRawData()
-*/
-
-/*!
- \fn bool QArray::operator==(const QArray<T, PreallocSize> &other) const
-
- Returns true if \a other is equal to this array; otherwise
- returns false.
-
- Two arrays are considered equal if they contain the same values
- in the same order.
-
- This function requires the value type to have an implementation
- of \c operator==().
-
- \sa operator!=()
-*/
-
-/*!
- \fn bool QArray::operator!=(const QArray<T, PreallocSize> &other) const
-
- Returns true if \a other is not equal to this array; otherwise
- returns false.
-
- Two arrays are considered equal if they contain the same values
- in the same order.
-
- This function requires the value type to have an implementation
- of \c operator==().
-
- \sa operator==()
-*/
-
-/*!
- \fn QArray<T, PreallocSize> &QArray::operator+=(const T &value)
-
- \overload
-
- Appends \a value to this array and returns a reference to
- this array.
-
- \sa operator<<(), append()
-*/
-
-/*!
- \fn QArray<T, PreallocSize> &QArray::operator+=(const QArray<T, PreallocSize> &other)
-
- Appends the elements of the \a other array to this array
- and returns a reference to this array.
-
- \sa operator<<(), append()
-*/
-
-/*!
- \fn QArray<T, PreallocSize> &QArray::operator<<(const T &value)
-
- \overload
-
- Appends \a value to this array and returns a reference to
- this array.
-
- \sa operator+=(), append()
-*/
-
-/*!
- \fn QArray<T, PreallocSize> &QArray::operator<<(const QArray<T, PreallocSize> &other)
-
- Appends the elements of the \a other array to this array
- and returns a reference to this array.
-
- \sa operator+=(), append()
-*/
-
-/*!
- \typedef QArray::iterator
-
- The QArray::iterator typedef provides an STL-style non-const
- iterator for QArray. The iterator is simply a typedef
- for "T *" (pointer to T).
-
- \sa QArray::begin(), QArray::const_iterator
-*/
-
-/*!
- \typedef QArray::const_iterator
-
- The QArray::iterator typedef provides an STL-style const
- iterator for QArray. The iterator is simply a typedef
- for "const T *" (pointer to const T).
-
- \sa QArray::constBegin(), QArray::iterator
-*/
-
-/*!
- \typedef QArray::Iterator
-
- Qt-style synonym for QArray::iterator.
-*/
-
-/*!
- \typedef QArray::ConstIterator
-
- Qt-style synonym for QArray::const_iterator.
-*/
-
-/*!
- \typedef QArray::const_pointer
-
- Typedef for const T *. Provided for STL compatibility.
-*/
-
-/*!
- \typedef QArray::const_reference
-
- Typedef for T &. Provided for STL compatibility.
-*/
-
-/*!
- \typedef QArray::difference_type
-
- Typedef for ptrdiff_t. Provided for STL compatibility.
-*/
-
-/*!
- \typedef QArray::pointer
-
- Typedef for T *. Provided for STL compatibility.
-*/
-
-/*!
- \typedef QArray::reference
-
- Typedef for T &. Provided for STL compatibility.
-*/
-
-/*!
- \typedef QArray::size_type
-
- Typedef for int. Provided for STL compatibility.
-*/
-
-/*!
- \typedef QArray::value_type
-
- Typedef for T. Provided for STL compatibility.
-*/
-
-/*!
- \fn QArray::iterator QArray::begin()
-
- Returns an STL-style iterator pointing to the first item
- in the array.
-
- \sa end(), constBegin(), QArray::iterator
-*/
-
-/*!
- \fn QArray::const_iterator QArray::begin() const
- \overload
-*/
-
-/*!
- \fn QArray::const_iterator QArray::constBegin() const
-
- Returns a const STL-style iterator pointing to the first item
- in the array.
-
- \sa constEnd(), begin(), QArray::const_iterator
-*/
-
-/*!
- \fn QArray::iterator QArray::end()
-
- Returns an STL-style iterator pointing to the imaginary item
- after the last item in the array.
-
- \sa begin(), constEnd(), QArray::iterator
-*/
-
-/*!
- \fn QArray::const_iterator QArray::end() const
- \overload
-*/
-
-/*!
- \fn QArray::const_iterator QArray::constEnd() const
-
- Returns a const STL-style iterator pointing to the imaginary item
- after the last item in the array.
-
- \sa constBegin(), end(), QArray::const_iterator
-*/
-
-/*!
- \fn T &QArray::first()
-
- Returns a reference to the first item in the array. This
- function assumes that the array isn't empty.
-
- \sa last(), isEmpty()
-*/
-
-/*!
- \fn const T &QArray::first() const
- \overload
-*/
-
-/*!
- \fn T &QArray::last()
-
- Returns a reference to the last item in the array. This function
- assumes that the array isn't empty.
-
- \sa first(), isEmpty()
-*/
-
-/*!
- \fn const T &QArray::last() const
- \overload
-*/
-
-/*!
- \fn bool QArray::startsWith(const T &value) const
-
- Returns true if this array is not empty and its first
- item is equal to \a value; otherwise returns false.
-
- \sa isEmpty(), first()
-*/
-
-/*!
- \fn bool QArray::endsWith(const T &value) const
-
- Returns true if this array is not empty and its last
- item is equal to \a value; otherwise returns false.
-
- \sa isEmpty(), last()
-*/
-
-/*!
- \fn void QArray::push_back(const T &value)
-
- This function is provided for STL compatibility. It is equivalent
- to append(\a value).
-*/
-
-/*!
- \fn void QArray::push_front(const T &value)
-
- This function is provided for STL compatibility. It is equivalent
- to prepend(\a value).
-*/
-
-/*!
- \fn void QArray::pop_front()
-
- This function is provided for STL compatibility. It is equivalent
- to removeFirst().
-*/
-
-/*!
- \fn void QArray::pop_back()
-
- This function is provided for STL compatibility. It is equivalent
- to removeLast().
-*/
-
-/*!
- \fn QArray::reference QArray::front()
-
- This function is provided for STL compatibility. It is equivalent
- to first().
-*/
-
-/*!
- \fn QArray::const_reference QArray::front() const
- \overload
-*/
-
-/*!
- \fn QArray::reference QArray::back()
-
- This function is provided for STL compatibility. It is equivalent
- to last().
-*/
-
-/*!
- \fn QArray::const_reference QArray::back() const
- \overload
-*/
-
-/*!
- \fn bool QArray::empty() const
-
- This function is provided for STL compatibility. It is equivalent
- to isEmpty(), returning true if the array is empty; otherwise
- returns false.
-*/
-
-#ifndef QT_NO_DATASTREAM
-
-/*!
- \fn QDataStream& operator<<(QDataStream& stream, const QArray<T, PreallocSize>& array)
- \relates QArray
-
- Writes \a array to the given \a stream and returns a reference
- to the \a stream.
-*/
-
-/*!
- \fn QDataStream& operator>>(QDataStream& stream, QArray<T, PreallocSize>& array)
- \relates QArray
-
- Reads \a array from the given \a stream and returns a reference
- to the \a stream.
-*/
-
-#endif
-
-int qArrayAllocMore(int alloc, int extra, int sizeOfT)
-{
- if (alloc == 0 && extra == 0)
- return 0;
- const int page = 1 << 12;
- int nalloc;
- alloc += extra;
- alloc *= sizeOfT;
- // don't do anything if the loop will overflow signed int.
- if (alloc >= INT_MAX/2)
- return INT_MAX / sizeOfT;
- nalloc = (alloc < page) ? 64 : page;
- while (nalloc < alloc) {
- if (nalloc <= 0)
- return INT_MAX / sizeOfT;
- nalloc *= 2;
- }
- return nalloc / sizeOfT;
-}
-
-QT_END_NAMESPACE
diff --git a/src/threed/arrays/qarray.h b/src/threed/arrays/qarray.h
deleted file mode 100644
index ed6e32f5..00000000
--- a/src/threed/arrays/qarray.h
+++ /dev/null
@@ -1,1209 +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 QARRAY_H
-#define QARRAY_H
-
-#include <QtCore/qglobal.h>
-#include <QtCore/qatomic.h>
-#include <QtCore/qdatastream.h>
-#include <QtCore/qdebug.h>
-#include <string.h>
-#include <new>
-
-#include "qt3dglobal.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-#if defined(Q_DECL_ALIGN) && defined(Q_ALIGNOF)
-
-#if defined(Q_CC_GNU) && (__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3))
- typedef char __attribute__((__may_alias__)) QArrayAlignedChar;
-#else
- typedef char QArrayAlignedChar;
-#endif
-
-template <typename T, int PreallocSize, size_t AlignT>
-struct QArrayAlignedPrealloc;
-template <typename T, int PreallocSize>
-struct QArrayAlignedPrealloc<T, PreallocSize, 1>
-{
- QArrayAlignedChar Q_DECL_ALIGN(1) data[sizeof(T) * PreallocSize];
-};
-template <typename T, int PreallocSize>
-struct QArrayAlignedPrealloc<T, PreallocSize, 2>
-{
- QArrayAlignedChar Q_DECL_ALIGN(2) data[sizeof(T) * PreallocSize];
-};
-template <typename T, int PreallocSize>
-struct QArrayAlignedPrealloc<T, PreallocSize, 4>
-{
- QArrayAlignedChar Q_DECL_ALIGN(4) data[sizeof(T) * PreallocSize];
-};
-template <typename T, int PreallocSize>
-struct QArrayAlignedPrealloc<T, PreallocSize, 8>
-{
- QArrayAlignedChar Q_DECL_ALIGN(8) data[sizeof(T) * PreallocSize];
-};
-template <typename T, int PreallocSize>
-struct QArrayAlignedPrealloc<T, PreallocSize, 16>
-{
- QArrayAlignedChar Q_DECL_ALIGN(16) data[sizeof(T) * PreallocSize];
-};
-template <typename T, int PreallocSize>
-struct QArrayAlignedPrealloc<T, PreallocSize, 32>
-{
- QArrayAlignedChar Q_DECL_ALIGN(32) data[sizeof(T) * PreallocSize];
-};
-template <typename T, int PreallocSize>
-struct QArrayAlignedPrealloc<T, PreallocSize, 64>
-{
- QArrayAlignedChar Q_DECL_ALIGN(64) data[sizeof(T) * PreallocSize];
-};
-template <typename T, int PreallocSize>
-struct QArrayAlignedPrealloc<T, PreallocSize, 128>
-{
- QArrayAlignedChar Q_DECL_ALIGN(128) data[sizeof(T) * PreallocSize];
-};
-
-#else
-
-template <typename T, int PreallocSize, size_t AlignT>
-union QArrayAlignedPrealloc
-{
- char data[sizeof(T) * PreallocSize];
- qint64 q_for_alignment_1;
- double q_for_alignment_2;
-};
-
-#endif
-
-template <typename T, int PreallocSize>
-class QArrayData
-{
-public:
-#if defined(Q_ALIGNOF)
- QArrayAlignedPrealloc<T, PreallocSize, Q_ALIGNOF(T)> m_prealloc;
-#else
- QArrayAlignedPrealloc<T, PreallocSize, sizeof(T)> m_prealloc;
-#endif
-
- inline T *prealloc()
- {
- return reinterpret_cast<T *>(m_prealloc.data);
- }
-
- inline bool isPrealloc(const T *start) const
- {
- return start == reinterpret_cast<const T *>(m_prealloc.data);
- }
-};
-
-template <typename T>
-class QArrayData<T, 0>
-{
-public:
-
- inline T *prealloc() { return 0; }
-
- inline bool isPrealloc(const T *start) const
- {
- Q_UNUSED(start);
- return false;
- }
-};
-
-template <typename T, int PreallocSize = 8>
-class QArray : private QArrayData<T, PreallocSize>
-{
-public:
- QArray();
- explicit QArray(int size);
- QArray(int size, const T &value);
- QArray(const T *values, int size);
- QArray(const QArray<T, PreallocSize> &other);
- ~QArray();
-
- typedef T *iterator;
- typedef const T *const_iterator;
-
- QArray<T, PreallocSize> &operator=
- (const QArray<T, PreallocSize> &other);
-
- int size() const;
- int count() const;
- int capacity() const;
-
- bool isEmpty() const;
-
- bool isDetached() const;
- void detach();
-
- void clear();
-
- const T &at(int index) const;
- const T &operator[](int index) const;
- T &operator[](int index);
-
- T value(int index) const;
- T value(int index, const T &defaultValue) const;
-
- T *extend(int size);
-
- void append(const T &value);
- void append(const T &value1, const T &value2);
- void append(const T &value1, const T &value2, const T &value3);
- void append(const T &value1, const T &value2, const T &value3, const T &value4);
- void append(const T *values, int count);
- void append(const QArray<T, PreallocSize> &other);
-
- void prepend(const T &value);
-
- void insert(int index, const T &value);
- void insert(int index, int count, const T &value);
- iterator insert(iterator before, int count, const T &value);
- iterator insert(iterator before, const T &value);
-
- void replace(int index, const T &value);
- void replace(int index, const T *values, int count);
-
- void remove(int index);
- void remove(int index, int count);
- void removeFirst() { remove(0); }
- void removeLast() { remove(size() - 1); }
-
- iterator erase(iterator begin, iterator end);
- iterator erase(iterator pos);
-
- int indexOf(const T &value, int from = 0) const;
- int lastIndexOf(const T &value, int from = -1) const;
- bool contains(const T &value) const;
- int count(const T &value) const;
-
- void resize(int size);
- void reserve(int size);
- void squeeze();
-
- QArray<T, PreallocSize> &fill(const T &value, int size = -1);
-
- void reverse();
- QArray<T, PreallocSize> reversed() const;
-
- QArray<T, PreallocSize> mid(int index, int length = -1) const;
- QArray<T, PreallocSize> left(int length) const;
- QArray<T, PreallocSize> right(int length) const;
-
- T *data();
- const T *data() const;
- const T *constData() const;
-
- static QArray<T, PreallocSize> fromRawData(const T *data, int size);
- static QArray<T, PreallocSize> fromWritableRawData(T *data, int size);
-
- bool operator==(const QArray<T, PreallocSize> &other) const;
- bool operator!=(const QArray<T, PreallocSize> &other) const;
-
- QArray<T, PreallocSize> &operator+=(const T &value);
- QArray<T, PreallocSize> &operator+=(const QArray<T, PreallocSize> &other);
- QArray<T, PreallocSize> &operator<<(const T &value);
- QArray<T, PreallocSize> &operator<<(const QArray<T, PreallocSize> &other);
-
- typedef iterator Iterator;
- typedef const_iterator ConstIterator;
- typedef T value_type;
- typedef value_type* pointer;
- typedef const value_type* const_pointer;
- typedef value_type &reference;
- typedef const value_type &const_reference;
- typedef ptrdiff_t difference_type;
- typedef int size_type;
-
- inline iterator begin() { return data(); }
- inline const_iterator begin() const { return constData(); }
- inline const_iterator constBegin() const { return constData(); }
- inline iterator end() { return data() + size(); }
- inline const_iterator end() const { return constData() + size(); }
- inline const_iterator constEnd() const { return constData() + size(); }
-
- inline T &first() { Q_ASSERT(!isEmpty()); return *begin(); }
- inline const T &first() const { Q_ASSERT(!isEmpty()); return *begin(); }
- inline T &last() { Q_ASSERT(!isEmpty()); return *(end()-1); }
- inline const T &last() const { Q_ASSERT(!isEmpty()); return *(end()-1); }
- inline bool startsWith(const T &t) const { return !isEmpty() && first() == t; }
- inline bool endsWith(const T &t) const { return !isEmpty() && last() == t; }
-
- inline void push_back(const T &value) { append(value); }
- inline void push_front(const T &value) { prepend(value); }
- inline void pop_back() { Q_ASSERT(!isEmpty()); removeLast(); }
- inline void pop_front() { Q_ASSERT(!isEmpty()); removeFirst(); }
- inline bool empty() const { return isEmpty(); }
- inline reference front() { return first(); }
- inline const_reference front() const { return first(); }
- inline reference back() { return last(); }
- inline const_reference back() const { return last(); }
-
-private:
- struct Data
- {
- QBasicAtomicInt ref;
- int capacity;
- T array[1];
- };
-
- // Invariants:
- // 1. If the data is not shared, then the usual condition is
- // for m_limit >= m_end.
- // 2. If the data is shared, then m_limit == m_start.
- // This triggers the range check in append() to call grow(),
- // which will copy-on-write. It also triggers the detach
- // check in data() and operator[] to cause a copy-on-write.
- // 3. If the data is not shared, but previously was, then
- // m_limit == m_start. This will trigger grow() or
- // detach(), which may then notice that it doesn't have to
- // copy-on-write. In that case, m_limit is set back
- // to m_start + m_data->capacity.
- // 4. If m_data is null, then m_start is either the same as
- // m_prealloc, or it points at raw data (const or non-const).
- // 5. If the array contains const raw data, then m_limit will
- // be set to m_start to force copy-on-write.
- T *m_start;
- T *m_end;
- mutable T *m_limit;
- Data *m_data;
-
- inline void initPrealloc()
- {
- m_end = m_start = QArrayData<T, PreallocSize>::prealloc();
- m_limit = m_start + PreallocSize;
- }
-
- QArray(const T *data, int size, bool isWritable);
-
- void free(T *data, int count);
- void release();
- void copyReplace(T *dst, const T *src, int count);
- Data *copyData(const T *src, int size, int capacity);
- void reallocate(int capacity);
- void detach_helper();
- void assign(const QArray<T, PreallocSize> &other);
- void grow(int needed);
- void setSize(int size);
-};
-
-int Q_QT3D_EXPORT qArrayAllocMore(int alloc, int extra, int sizeOfT);
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE void QArray<T, PreallocSize>::free(T *data, int count)
-{
- while (count-- > 0) {
- data->~T();
- ++data;
- }
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE void QArray<T, PreallocSize>::release()
-{
- if (m_data) {
- if (!m_data->ref.deref()) {
- if (QTypeInfo<T>::isComplex)
- free(m_start, m_end - m_start);
- qFree(m_data);
- }
- } else if (this->isPrealloc(m_start)) {
- if (QTypeInfo<T>::isComplex)
- free(m_start, m_end - m_start);
- }
-}
-
-// Copy values to initialized memory, replacing previous values.
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE void QArray<T, PreallocSize>::copyReplace(T *dst, const T *src, int count)
-{
- if (!QTypeInfo<T>::isStatic) {
- ::memmove(dst, src, count * sizeof(T));
- } else {
- while (count-- > 0)
- *dst++ = *src++;
- }
-}
-
-// Make a copy of m_data, while remaining exception-safe.
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE Q_TYPENAME QArray<T, PreallocSize>::Data *QArray<T, PreallocSize>::copyData(const T *src, int size, int capacity)
-{
- Data *data = reinterpret_cast<Data *>
- (qMalloc(sizeof(Data) + sizeof(T) * (capacity - 1)));
- Q_CHECK_PTR(data);
- data->ref = 1;
- data->capacity = capacity;
- T *dst = data->array;
- int copied = 0;
- QT_TRY {
- while (copied < size) {
- new (dst) T(*src++);
- ++dst;
- ++copied;
- }
- } QT_CATCH(...) {
- while (copied-- > 0)
- (--dst)->~T();
- qFree(data);
- QT_RETHROW;
- }
- return data;
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE void QArray<T, PreallocSize>::reallocate(int capacity)
-{
- int size = m_end - m_start;
- if (!QTypeInfo<T>::isStatic) {
- Data *data = reinterpret_cast<Data *>
- (qRealloc(m_data, sizeof(Data) + sizeof(T) * (capacity - 1)));
- Q_CHECK_PTR(data);
- data->capacity = capacity;
- m_data = data;
- } else {
- Data *data = copyData(m_data->array, size, capacity);
- free(m_data->array, size);
- qFree(m_data);
- m_data = data;
- }
- m_start = m_data->array;
- m_end = m_start + size;
- m_limit = m_start + capacity;
-}
-
-template <typename T, int PreallocSize>
-Q_OUTOFLINE_TEMPLATE void QArray<T, PreallocSize>::detach_helper()
-{
- // If the reference count is 1, then the array may have been
- // copied and then the copy released. So just reset the limit.
- if (m_data && m_data->ref == 1) {
- m_limit = m_start + m_data->capacity;
- return;
- }
-
- // Allocate a new block on the heap and copy the data across.
- int size = m_end - m_start;
- int capacity = qArrayAllocMore(size, 0, sizeof(T));
- m_data = copyData(m_start, size, capacity);
-
- // Update the start/end/append pointers for faster updates.
- m_start = m_data->array;
- m_end = m_start + size;
- m_limit = m_start + capacity;
-}
-
-template <typename T, int PreallocSize>
-Q_OUTOFLINE_TEMPLATE void QArray<T, PreallocSize>::assign(const QArray<T, PreallocSize> &other)
-{
- if (other.m_data) {
- m_start = other.m_start;
- m_end = other.m_end;
- m_data = other.m_data;
- m_data->ref.ref();
-
- // We set the append limit of both objects to m_start, which forces
- // the next append() or data() in either object to copy-on-write.
- other.m_limit = m_limit = m_start;
- } else if (other.isPrealloc(other.m_start)) {
- // Make a deep copy of preallocated data.
- initPrealloc();
- m_data = 0;
- append(other.constData(), other.size());
- } else {
- // Shallow copy of raw data.
- m_start = other.m_start;
- m_end = other.m_end;
- m_limit = other.m_limit;
- m_data = 0;
- }
-}
-
-template <typename T, int PreallocSize>
-Q_OUTOFLINE_TEMPLATE void QArray<T, PreallocSize>::grow(int needed)
-{
- int size = m_end - m_start;
- int capacity = qArrayAllocMore(size, needed, sizeof(T));
- if (!m_data || m_data->ref != 1) {
- // Copy preallocated, raw, or shared data and expand the capacity.
- Data *data = copyData(m_start, size, capacity);
- if (this->isPrealloc(m_start))
- free(m_start, size);
- if (m_data)
- m_data->ref.deref();
- m_data = data;
- m_start = data->array;
- m_end = m_start + size;
- m_limit = m_start + capacity;
- } else if ((size + needed) > m_data->capacity) {
- // Reallocate to create more capacity.
- reallocate(capacity);
- } else {
- // We have enough capacity - just fix the append limit.
- // This can happen when an array is copied and then the
- // copy is removed.
- m_limit = m_start + m_data->capacity;
- }
-}
-
-template <typename T, int PreallocSize>
-Q_OUTOFLINE_TEMPLATE void QArray<T, PreallocSize>::setSize(int size)
-{
- if (size <= PreallocSize) {
- initPrealloc();
- m_data = 0;
- } else {
- int capacity = qArrayAllocMore(size, 0, sizeof(T));
- Data *data = reinterpret_cast<Data *>
- (qMalloc(sizeof(Data) + sizeof(T) * (capacity - 1)));
- Q_CHECK_PTR(data);
- m_data = data;
- m_data->ref = 1;
- m_data->capacity = capacity;
- m_start = m_data->array;
- m_end = m_start;
- m_limit = m_start + capacity;
- }
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE QArray<T, PreallocSize>::QArray()
-{
- initPrealloc();
- m_data = 0;
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE QArray<T, PreallocSize>::QArray(int size)
-{
- setSize(size);
- while (size-- > 0)
- new (m_end++) T();
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE QArray<T, PreallocSize>::QArray(int size, const T &value)
-{
- setSize(size);
- while (size-- > 0)
- new (m_end++) T(value);
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE QArray<T, PreallocSize>::QArray(const T *values, int size)
-{
- setSize(size);
- while (size-- > 0)
- new (m_end++) T(*values++);
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE QArray<T, PreallocSize>::QArray(const QArray<T, PreallocSize> &other)
-{
- assign(other);
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE QArray<T, PreallocSize>::QArray(const T *data, int size, bool isWritable)
-{
- // Constructing a raw data array.
- m_start = const_cast<T *>(data);
- m_end = m_start + size;
- if (isWritable)
- m_limit = m_end;
- else
- m_limit = m_start;
- m_data = 0;
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE QArray<T, PreallocSize>::~QArray()
-{
- release();
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE QArray<T, PreallocSize> &QArray<T, PreallocSize>::operator=(const QArray<T, PreallocSize> &other)
-{
- if (this == &other)
- return *this;
- if (other.m_data && m_data == other.m_data)
- return *this;
- release();
- assign(other);
- return *this;
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE int QArray<T, PreallocSize>::size() const
-{
- return m_end - m_start;
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE int QArray<T, PreallocSize>::count() const
-{
- return m_end - m_start;
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE int QArray<T, PreallocSize>::capacity() const
-{
- if (m_data)
- return m_data->capacity;
- else if (this->isPrealloc(m_start))
- return PreallocSize;
- else
- return m_end - m_start; // raw data, m_limit == m_start
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE bool QArray<T, PreallocSize>::isEmpty() const
-{
- return m_start == m_end;
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE bool QArray<T, PreallocSize>::isDetached() const
-{
- // If m_limit is the same as m_start, then the array
- // is either shared or contains raw data.
- return m_limit != m_start;
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE void QArray<T, PreallocSize>::detach()
-{
- if (m_limit == m_start)
- detach_helper();
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE void QArray<T, PreallocSize>::clear()
-{
- release();
- initPrealloc();
- m_data = 0;
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE const T &QArray<T, PreallocSize>::operator[](int index) const
-{
- Q_ASSERT_X(index >= 0 && index < size(),
- "QArray<T>::at", "index out of range");
- return m_start[index];
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE const T &QArray<T, PreallocSize>::at(int index) const
-{
- Q_ASSERT_X(index >= 0 && index < size(),
- "QArray<T>::operator[]", "index out of range");
- return m_start[index];
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE T &QArray<T, PreallocSize>::operator[](int index)
-{
- Q_ASSERT_X(index >= 0 && index < size(),
- "QArray<T>::operator[]", "index out of range");
- return data()[index];
-}
-
-template <typename T, int PreallocSize>
-Q_OUTOFLINE_TEMPLATE T QArray<T, PreallocSize>::value(int index) const
-{
- if (index >= 0 && index < size())
- return m_start[index];
- else
- return T();
-}
-
-template <typename T, int PreallocSize>
-Q_OUTOFLINE_TEMPLATE T QArray<T, PreallocSize>::value(int index, const T &defaultValue) const
-{
- if (index >= 0 && index < size())
- return m_start[index];
- else
- return defaultValue;
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE T *QArray<T, PreallocSize>::extend(int size)
-{
- Q_ASSERT(size > 0);
- if ((m_end + size) >= m_limit)
- grow(size);
- T *end = m_end;
- m_end += size; // Note: new elements are not initialized.
- return end;
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE void QArray<T, PreallocSize>::append(const T &value)
-{
- if (m_end >= m_limit)
- grow(1);
- new (m_end) T(value);
- ++m_end;
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE void QArray<T, PreallocSize>::append(const T &value1, const T &value2)
-{
- if ((m_end + 1) >= m_limit)
- grow(2);
- new (m_end) T(value1);
- ++m_end; // Increment one at a time in case an exception is thrown.
- new (m_end) T(value2);
- ++m_end;
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE void QArray<T, PreallocSize>::append(const T &value1, const T &value2, const T &value3)
-{
- if ((m_end + 2) >= m_limit)
- grow(3);
- new (m_end) T(value1);
- ++m_end;
- new (m_end) T(value2);
- ++m_end;
- new (m_end) T(value3);
- ++m_end;
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE void QArray<T, PreallocSize>::append(const T &value1, const T &value2, const T &value3, const T &value4)
-{
- if ((m_end + 3) >= m_limit)
- grow(4);
- new (m_end) T(value1);
- ++m_end;
- new (m_end) T(value2);
- ++m_end;
- new (m_end) T(value3);
- ++m_end;
- new (m_end) T(value4);
- ++m_end;
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE void QArray<T, PreallocSize>::append(const T *values, int count)
-{
- if (count <= 0)
- return;
- if (!m_start || (m_end + count) > m_limit)
- grow(count);
- while (count-- > 0) {
- new (m_end) T(*values++);
- ++m_end;
- }
-}
-
-template <typename T, int PreallocSize>
-Q_OUTOFLINE_TEMPLATE void QArray<T, PreallocSize>::append(const QArray<T, PreallocSize> &other)
-{
- if (isEmpty()) {
- *this = other;
- } else {
- if (&other == this || (m_data && other.m_data == m_data))
- grow(size()); // Appending to ourselves: make some room.
- append(other.constData(), other.size());
- }
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE void QArray<T, PreallocSize>::prepend(const T &value)
-{
- insert(begin(), 1, value);
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE void QArray<T, PreallocSize>::insert(int index, const T &value)
-{
- Q_ASSERT_X(index >= 0 && index <= size(),
- "QArray<T>::insert", "index out of range");
- insert(begin() + index, 1, value);
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE void QArray<T, PreallocSize>::insert(int index, int count, const T &value)
-{
- Q_ASSERT_X(index >= 0 && index <= size(),
- "QArray<T>::insert", "index out of range");
- insert(begin() + index, count, value);
-}
-
-template <typename T, int PreallocSize>
-Q_OUTOFLINE_TEMPLATE Q_TYPENAME QArray<T, PreallocSize>::iterator QArray<T, PreallocSize>::insert(iterator before, int count, const T &value)
-{
- // Check the parameters.
- int size = this->size();
- int offset = int(before - m_start);
- Q_ASSERT_X(offset >= 0 && offset <= size,
- "QArray<T>::insert", "iterator offset is out of range");
- Q_ASSERT(count >= 0);
- if (count <= 0)
- return m_start + offset;
-
- // Reserve extra space and then copy-on-write.
- reserve(size + count);
- detach();
-
- // Move items up to make room, and replace at the insert point.
- if (QTypeInfo<T>::isStatic) {
- int newcount = count;
- while (newcount > 0) {
- new (m_end++) T();
- --newcount;
- }
- int posn = size;
- while (posn > offset) {
- --posn;
- m_start[posn + count] = m_start[posn];
- }
- while (count > 0) {
- --count;
- m_start[offset + count] = value;
- }
- } else {
- ::memmove(m_start + offset + count, m_start + offset,
- (size - offset) * sizeof(T));
- m_end += count;
- while (count > 0) {
- --count;
- new (m_start + offset + count) T(value);
- }
- }
-
- // Return the new iterator at the insert position.
- return m_start + offset;
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE Q_TYPENAME QArray<T, PreallocSize>::iterator QArray<T, PreallocSize>::insert(iterator before, const T &value)
-{
- return insert(before, 1, value);
-}
-
-template <typename T, int PreallocSize>
-Q_OUTOFLINE_TEMPLATE void QArray<T, PreallocSize>::replace(int index, const T &value)
-{
- Q_ASSERT_X(index >= 0 && index < size(),
- "QArray<T>::replace", "index out of range");
- data()[index] = value;
-}
-
-template <typename T, int PreallocSize>
-Q_OUTOFLINE_TEMPLATE void QArray<T, PreallocSize>::replace(int index, const T *values, int count)
-{
- if (index < 0 || count <= 0)
- return;
- int replaceSize = index + count;
- if (replaceSize > size())
- resize(replaceSize);
- copyReplace(data() + index, values, count);
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE void QArray<T, PreallocSize>::remove(int index)
-{
- remove(index, 1);
-}
-
-template <typename T, int PreallocSize>
-Q_OUTOFLINE_TEMPLATE void QArray<T, PreallocSize>::remove(int index, int count)
-{
- // Truncate the range to be removed.
- int currentSize = size();
- if (index < 0) {
- count += index;
- index = 0;
- }
- if (count > 0 && (index + count) > currentSize)
- count = currentSize - index;
- if (count <= 0)
- return;
-
- // Perform the removal.
- if (index == 0 && count >= currentSize) {
- clear();
- return;
- }
- T *start = data();
- copyReplace(start + index, start + index + count,
- (currentSize - (index + count)));
- resize(currentSize - count);
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE Q_TYPENAME QArray<T, PreallocSize>::iterator QArray<T, PreallocSize>::erase(iterator begin, iterator end)
-{
- int index = begin - m_start;
- remove(index, end - begin);
- return m_start + index;
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE Q_TYPENAME QArray<T, PreallocSize>::iterator QArray<T, PreallocSize>::erase(iterator pos)
-{
- int index = pos - m_start;
- remove(index, 1);
- return m_start + index;
-}
-
-template <typename T, int PreallocSize>
-Q_OUTOFLINE_TEMPLATE int QArray<T, PreallocSize>::indexOf(const T &value, int from) const
-{
- if (from < 0)
- from = qMax(from + size(), 0);
- const T *ptr = m_start + from;
- while (ptr < m_end) {
- if (*ptr == value)
- return ptr - m_start;
- ++ptr;
- }
- return -1;
-}
-
-template <typename T, int PreallocSize>
-Q_OUTOFLINE_TEMPLATE int QArray<T, PreallocSize>::lastIndexOf(const T &value, int from) const
-{
- int size = count();
- if (from < 0)
- from += size;
- else if (from >= size)
- from = size - 1;
- if (from >= 0) {
- const T *ptr = m_start + from;
- while (ptr >= m_start) {
- if (*ptr == value)
- return ptr - m_start;
- --ptr;
- }
- }
- return -1;
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE bool QArray<T, PreallocSize>::contains(const T &value) const
-{
- const T *ptr = m_start;
- while (ptr < m_end) {
- if (*ptr == value)
- return true;
- ++ptr;
- }
- return false;
-}
-
-template <typename T, int PreallocSize>
-Q_OUTOFLINE_TEMPLATE int QArray<T, PreallocSize>::count(const T &value) const
-{
- const T *ptr = m_start;
- int count = 0;
- while (ptr < m_end) {
- if (*ptr == value)
- ++count;
- ++ptr;
- }
- return count;
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE void QArray<T, PreallocSize>::resize(int size)
-{
- if (size < 0)
- return;
- int currentSize = count();
- if (size < currentSize) {
- T *start = data(); // Force copy on write if necessary.
- if (QTypeInfo<T>::isComplex)
- free(start + size, currentSize - size);
- m_end = start + size;
- } else if (size > currentSize) {
- grow(size - currentSize);
- while (currentSize++ < size) {
- new (m_end) T();
- ++m_end;
- }
- }
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE void QArray<T, PreallocSize>::reserve(int size)
-{
- int cap = capacity();
- if (size > cap)
- grow(size - this->size());
-}
-
-template <typename T, int PreallocSize>
-Q_OUTOFLINE_TEMPLATE QArray<T, PreallocSize> &QArray<T, PreallocSize>::fill(const T &value, int size)
-{
- if (size >= 0)
- resize(size);
- T *ptr = m_start;
- while (ptr < m_end)
- *ptr++ = value;
- return *this;
-}
-
-template <typename T, int PreallocSize>
-Q_OUTOFLINE_TEMPLATE void QArray<T, PreallocSize>::squeeze()
-{
- int size = count();
- if (size <= 0) {
- clear();
- } else if (size < capacity() && m_data) {
- reallocate(size);
- }
-}
-
-template <typename T, int PreallocSize>
-Q_OUTOFLINE_TEMPLATE void QArray<T, PreallocSize>::reverse()
-{
- if (count() > 0) {
- T *src = m_start;
- T *dst = m_end - 1;
- while (src < dst)
- qSwap(*(dst--), *(src++));
- }
-}
-
-template <typename T, int PreallocSize>
-Q_OUTOFLINE_TEMPLATE QArray<T, PreallocSize> QArray<T, PreallocSize>::reversed() const
-{
- QArray<T, PreallocSize> result;
- int count = size();
- if (count > 0) {
- result.extend(count);
- const T *src = m_start;
- T *dst = result.m_end - 1;
- if (!QTypeInfo<T>::isComplex) {
- while (src != m_end)
- *(dst--) = *(src++);
- } else {
- while (src != m_end)
- new (dst--) T(*src++);
- }
- }
- return result;
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE QArray<T, PreallocSize> QArray<T, PreallocSize>::mid(int index, int length) const
-{
- int count = size();
- Q_ASSERT(index >= 0 && index <= count);
- if (length < 0 || (index + length) > count)
- length = count - index;
- if (index == 0 && length == count)
- return *this;
- QArray<T, PreallocSize> result;
- result.append(constData() + index, length);
- return result;
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE QArray<T, PreallocSize> QArray<T, PreallocSize>::left(int length) const
-{
- return mid(0, length);
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE QArray<T, PreallocSize> QArray<T, PreallocSize>::right(int length) const
-{
- int size = count();
- if (length < 0 || length >= size)
- length = size;
- return mid(size - length, length);
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE T *QArray<T, PreallocSize>::data()
-{
- detach();
- return m_start;
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE const T *QArray<T, PreallocSize>::data() const
-{
- return m_start;
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE const T *QArray<T, PreallocSize>::constData() const
-{
- return m_start;
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE QArray<T, PreallocSize> QArray<T, PreallocSize>::fromRawData(const T *data, int size)
-{
- Q_ASSERT(size >= 0);
- return QArray<T, PreallocSize>(data, size, false);
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE QArray<T, PreallocSize> QArray<T, PreallocSize>::fromWritableRawData(T *data, int size)
-{
- Q_ASSERT(size >= 0);
- return QArray<T, PreallocSize>(data, size, true);
-}
-
-template <typename T, int PreallocSize>
-Q_OUTOFLINE_TEMPLATE bool QArray<T, PreallocSize>::operator==
- (const QArray<T, PreallocSize> &other) const
-{
- if (this == &other)
- return true;
- const T *thisData = constData();
- const T *otherData = other.constData();
- if (thisData == otherData)
- return true;
- int thisCount = count();
- int otherCount = other.count();
- if (thisCount == 0 && otherCount == 0)
- return true;
- if (thisCount != otherCount)
- return false;
- for (int index = 0; index < thisCount; ++index, ++thisData, ++otherData)
- if (*thisData != *otherData)
- return false;
- return true;
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE bool QArray<T, PreallocSize>::operator!=
- (const QArray<T, PreallocSize> &other) const
-{
- return !(*this == other);
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE QArray<T, PreallocSize> &QArray<T, PreallocSize>::operator+=(const T &value)
-{
- append(value);
- return *this;
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE QArray<T, PreallocSize> &QArray<T, PreallocSize>::operator+=(const QArray<T, PreallocSize> &other)
-{
- append(other);
- return *this;
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE QArray<T, PreallocSize> &QArray<T, PreallocSize>::operator<<(const T &value)
-{
- append(value);
- return *this;
-}
-
-template <typename T, int PreallocSize>
-Q_INLINE_TEMPLATE QArray<T, PreallocSize> &QArray<T, PreallocSize>::operator<<(const QArray<T, PreallocSize> &other)
-{
- append(other);
- return *this;
-}
-
-#ifndef QT_NO_DATASTREAM
-
-template <typename T, int PreallocSize>
-QDataStream& operator<<(QDataStream& stream, const QArray<T, PreallocSize>& array)
-{
- int size = array.size();
- stream << quint32(size);
- for (int index = 0; index < size; ++index)
- stream << array.at(index);
- return stream;
-}
-
-template <typename T, int PreallocSize>
-QDataStream& operator>>(QDataStream& stream, QArray<T, PreallocSize>& array)
-{
- array.clear();
- quint32 size;
- stream >> size;
- array.reserve(size);
- for (int index = 0; index < int(size); ++index) {
- T t;
- stream >> t;
- array.append(t);
- if (stream.atEnd())
- break;
- }
- return stream;
-}
-
-#endif
-
-#ifndef QT_NO_DEBUG_STREAM
-
-template <typename T, int PreallocSize>
-QDebug operator<<(QDebug dbg, const QArray<T, PreallocSize>& array)
-{
- dbg.nospace() << "QArray(\n";
- int size = array.size();
- for (int index = 0; index < size; ++index) {
- dbg << " " << index << ": " << array.at(index) << "\n";
- }
- dbg << ")\n";
- return dbg.space();
-}
-
-#endif
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/arrays/qcolor4ub.cpp b/src/threed/arrays/qcolor4ub.cpp
deleted file mode 100644
index a27193cb..00000000
--- a/src/threed/arrays/qcolor4ub.cpp
+++ /dev/null
@@ -1,319 +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 "qcolor4ub.h"
-#include <QtCore/qdebug.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QColor4ub
- \brief The QColor4ub class represents a color by four unsigned byte components.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::arrays
-
- OpenGL applications commonly use four unsigned byte values to compactly
- represent a color value. QColor4ub provides a convenience
- class for manipulating such compact color values.
-
- An alternative is to represent a color value as four floating-point
- values between 0.0 and 1.0. The QVector4D class can be used for
- that purpose if required.
-*/
-
-/*!
- \fn QColor4ub::QColor4ub()
-
- Constructs a four-byte default color value of (0, 0, 0, 255).
-*/
-
-/*!
- \fn QColor4ub::QColor4ub(int red, int green, int blue, int alpha)
-
- Constructs a four-byte color value with the components \a red,
- \a green, \a blue, and \a alpha.
-*/
-
-/*!
- \fn QColor4ub::QColor4ub(const QColor& color)
-
- Constructs a four-byte color value from \a color.
-*/
-
-/*!
- \fn QColor4ub::QColor4ub(Qt::GlobalColor color)
-
- Constructs a four-byte color value from \a color.
-*/
-
-/*!
- \fn QColor4ub::QColor4ub(QRgb rgba)
-
- Constructs a four-byte color value from the red, green, blue, and
- alpha components of \a rgba.
-*/
-
-/*!
- \fn QColor4ub& QColor4ub::operator=(const QColor& color)
-
- Copies the red, green, blue, and alpha components of \a color
- into this object.
-*/
-
-/*!
- \fn QColor4ub& QColor4ub::operator=(Qt::GlobalColor color)
-
- Copies the red, green, blue, and alpha components of the
- specified global \a color name into this object.
-*/
-
-/*!
- \fn int QColor4ub::red() const
-
- Returns the red component of this color, between 0 and 255.
-
- \sa green(), blue(), alpha(), setRed(), redF()
-*/
-
-/*!
- \fn int QColor4ub::green() const
-
- Returns the green component of this color, between 0 and 255.
-
- \sa red(), blue(), alpha(), setGreen(), greenF()
-*/
-
-/*!
- \fn int QColor4ub::blue() const
-
- Returns the blue component of this color, between 0 and 255.
-
- \sa red(), green(), alpha(), setBlue(), blueF()
-*/
-
-/*!
- \fn int QColor4ub::alpha() const
-
- Returns the alpha component of this color, between 0 and 255.
-
- \sa red(), green(), blue(), setAlpha(), alphaF()
-*/
-
-/*!
- \fn void QColor4ub::setRed(int value)
-
- Sets the red component of this color to \a value, between 0 and 255.
-
- \sa setGreen(), setBlue(), setAlpha(), red(), setRedF()
-*/
-
-/*!
- \fn void QColor4ub::setGreen(int value)
-
- Sets the green component of this color to \a value, between 0 and 255.
-
- \sa setRed(), setBlue(), setAlpha(), green(), setGreenF()
-*/
-
-/*!
- \fn void QColor4ub::setBlue(int value)
-
- Sets the blue component of this color to \a value, between 0 and 255.
-
- \sa setRed(), setGreen(), setAlpha(), blue(), setBlueF()
-*/
-
-/*!
- \fn void QColor4ub::setAlpha(int value)
-
- Sets the alpha component of this color to \a value, between 0 and 255.
-
- \sa setRed(), setGreen(), setBlue(), alpha(), setAlphaF()
-*/
-
-/*!
- \fn qreal QColor4ub::redF() const { return m_red / 255.0f; }
-
- Returns the red component of this color as a floating-point
- value between 0 and 1.
-
- \sa greenF(), blueF(), alphaF(), setRedF(), red()
-*/
-
-/*!
- \fn qreal QColor4ub::greenF() const { return m_green / 255.0f; }
-
- Returns the green component of this color as a floating-point
- value between 0 and 1.
-
- \sa redF(), blueF(), alphaF(), setGreenF(), green()
-*/
-
-/*!
- \fn qreal QColor4ub::blueF() const { return m_blue / 255.0f; }
-
- Returns the blue component of this color as a floating-point
- value between 0 and 1.
-
- \sa redF(), greenF(), alphaF(), setBlueF(), blue()
-*/
-
-/*!
- \fn qreal QColor4ub::alphaF() const { return m_alpha / 255.0f; }
-
- Returns the alpha component of this color as a floating-point
- value between 0 and 1.
-
- \sa redF(), greenF(), blueF(), setAlphaF(), alpha()
-*/
-
-/*!
- \fn void QColor4ub::setRedF(qreal value)
-
- Sets the red component of this color to a floating-point \a value,
- between 0 and 1.
-
- \sa setGreenF(), setBlueF(), setAlphaF(), redF(), setRed()
-*/
-
-/*!
- \fn void QColor4ub::setGreenF(qreal value)
-
- Sets the green component of this color to a floating-point \a value,
- between 0 and 1.
-
- \sa setRedF(), setBlueF(), setAlphaF(), greenF(), setGreen()
-*/
-
-/*!
- \fn void QColor4ub::setBlueF(qreal value)
-
- Sets the blue component of this color to a floating-point \a value,
- between 0 and 1.
-
- \sa setRedF(), setGreenF(), setAlphaF(), blueF(), setBlue()
-*/
-
-/*!
- \fn void QColor4ub::setAlphaF(qreal value)
-
- Sets the alpha component of this color to a floating-point \a value,
- between 0 and 1.
-
- \sa setRedF(), setGreenF(), setBlueF(), alphaF(), setAlpha()
-*/
-
-/*!
- \fn void QColor4ub::setRgb(int red, int green, int blue, int alpha)
-
- Sets the components of this color to \a red, \a green, \a blue,
- and \a alpha. Each component is between 0 and 255.
-
- \sa setRgbF(), fromRgb()
-*/
-
-/*!
- \fn void QColor4ub::setRgbF(qreal red, qreal green, qreal blue, qreal alpha)
-
- Sets the components of this color to \a red, \a green, \a blue,
- and \a alpha. Each component is a floating-point value between 0 and 1.
-
- \sa setRgb(), fromRgbF()
-*/
-
-/*!
- \fn QColor4ub QColor4ub::fromRgb(int red, int green, int blue, int alpha)
-
- Returns a QColor4ub with the components \a red, \a green, \a blue,
- and \a alpha. Each component is between 0 and 255.
-
- \sa fromRgbF(), setRgb()
-*/
-
-/*!
- \fn QColor4ub QColor4ub::fromRgbF(qreal red, qreal green, qreal blue, qreal alpha)
-
- Returns a QColor4ub with the components \a red, \a green, \a blue,
- and \a alpha. Each component is a floating-point value between 0 and 1.
-
- \sa fromRgb(), setRgbF()
-*/
-
-/*!
- \fn QColor4ub QColor4ub::fromRaw(const uchar *data)
-
- Returns a QColor4ub with components from the first four elements
- in \a data. The \a data parameter must contain at least four
- elements and not be null.
-*/
-
-/*!
- \fn QColor QColor4ub::toColor() const
-
- Returns this color as a QColor.
-*/
-
-/*!
- \fn bool QColor4ub::operator==(const QColor4ub& other) const
-
- Returns true if this color is the same as \a other; false otherwise.
-*/
-
-/*!
- \fn bool QColor4ub::operator!=(const QColor4ub& other) const
-
- Returns true if this color is not the same as \a other; false otherwise.
-*/
-
-#ifndef QT_NO_DEBUG_STREAM
-
-QDebug operator<<(QDebug dbg, const QColor4ub &color)
-{
- dbg.nospace() << "QColor4ub("
- << color.redF() << ", " << color.greenF() << ", "
- << color.blueF() << ", " << color.alphaF() << ')';
- return dbg.space();
-}
-
-#endif
-
-QT_END_NAMESPACE
diff --git a/src/threed/arrays/qcolor4ub.h b/src/threed/arrays/qcolor4ub.h
deleted file mode 100644
index f306e6ab..00000000
--- a/src/threed/arrays/qcolor4ub.h
+++ /dev/null
@@ -1,216 +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 QCOLOR4UB_H
-#define QCOLOR4UB_H
-
-#include "qt3dglobal.h"
-#include <QtGui/qcolor.h>
-#include <QtCore/qmetatype.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class Q_QT3D_EXPORT QColor4ub
-{
-public:
- QColor4ub();
- QColor4ub(int red, int green, int blue, int alpha = 255);
- QColor4ub(const QColor& color);
- QColor4ub(Qt::GlobalColor color);
- QColor4ub(QRgb rgba);
-
- QColor4ub& operator=(const QColor& color);
- QColor4ub& operator=(Qt::GlobalColor color);
-
- int red() const { return m_red; }
- int green() const { return m_green; }
- int blue() const { return m_blue; }
- int alpha() const { return m_alpha; }
-
- void setRed(int value) { m_red = uchar(value); }
- void setGreen(int value) { m_green = uchar(value); }
- void setBlue(int value) { m_blue = uchar(value); }
- void setAlpha(int value) { m_alpha = uchar(value); }
-
- qreal redF() const { return m_red / 255.0f; }
- qreal greenF() const { return m_green / 255.0f; }
- qreal blueF() const { return m_blue / 255.0f; }
- qreal alphaF() const { return m_alpha / 255.0f; }
-
- void setRedF(qreal value) { m_red = uchar(qRound(value * 255.0f)); }
- void setGreenF(qreal value) { m_green = uchar(qRound(value * 255.0f)); }
- void setBlueF(qreal value) { m_blue = uchar(qRound(value * 255.0f)); }
- void setAlphaF(qreal value) { m_alpha = uchar(qRound(value * 255.0f)); }
-
- void setRgb(int red, int green, int blue, int alpha = 255);
- void setRgbF(qreal red, qreal green, qreal blue, qreal alpha = 1.0f);
-
- static QColor4ub fromRgb(int red, int green, int blue, int alpha = 255);
- static QColor4ub fromRgbF
- (qreal red, qreal green, qreal blue, qreal alpha = 1.0f);
- static QColor4ub fromRaw(const uchar *data);
-
- QColor toColor() const;
-
- bool operator==(const QColor4ub& other) const;
- bool operator!=(const QColor4ub& other) const;
-
-private:
- QColor4ub(const uchar *data);
-
- uchar m_red;
- uchar m_green;
- uchar m_blue;
- uchar m_alpha;
-};
-
-inline QColor4ub::QColor4ub() : m_red(0), m_green(0), m_blue(0), m_alpha(255) {}
-
-inline QColor4ub::QColor4ub(int red, int green, int blue, int alpha)
- : m_red(uchar(red)), m_green(uchar(green)),
- m_blue(uchar(blue)), m_alpha(uchar(alpha)) {}
-
-inline QColor4ub::QColor4ub(const QColor& color)
- : m_red(uchar(color.red())), m_green(uchar(color.green())),
- m_blue(uchar(color.blue())), m_alpha(uchar(color.alpha())) {}
-
-inline QColor4ub::QColor4ub(Qt::GlobalColor color)
-{
- QColor c(color);
- m_red = uchar(c.red());
- m_green = uchar(c.green());
- m_blue = uchar(c.blue());
- m_alpha = uchar(c.alpha());
-}
-
-inline QColor4ub::QColor4ub(QRgb rgba)
- : m_red(uchar(qRed(rgba))), m_green(uchar(qGreen(rgba))),
- m_blue(uchar(qBlue(rgba))), m_alpha(uchar(qAlpha(rgba))) {}
-
-inline QColor4ub::QColor4ub(const uchar *data)
- : m_red(data[0]), m_green(data[1]), m_blue(data[2]), m_alpha(data[3]) {}
-
-inline QColor4ub& QColor4ub::operator=(const QColor& color)
-{
- m_red = uchar(color.red());
- m_green = uchar(color.green());
- m_blue = uchar(color.blue());
- m_alpha = uchar(color.alpha());
- return *this;
-}
-
-inline QColor4ub& QColor4ub::operator=(Qt::GlobalColor color)
-{
- QColor c(color);
- m_red = uchar(c.red());
- m_green = uchar(c.green());
- m_blue = uchar(c.blue());
- m_alpha = uchar(c.alpha());
- return *this;
-}
-
-inline void QColor4ub::setRgb(int red, int green, int blue, int alpha)
-{
- m_red = uchar(red);
- m_green = uchar(green);
- m_blue = uchar(blue);
- m_alpha = uchar(alpha);
-}
-
-inline void QColor4ub::setRgbF(qreal red, qreal green, qreal blue, qreal alpha)
-{
- m_red = uchar(qRound(red * 255.0f));
- m_green = uchar(qRound(green * 255.0f));
- m_blue = uchar(qRound(blue * 255.0f));
- m_alpha = uchar(qRound(alpha * 255.0f));
-}
-
-inline QColor4ub QColor4ub::fromRgb(int red, int green, int blue, int alpha)
-{
- return QColor4ub(red, green, blue, alpha);
-}
-
-inline QColor4ub QColor4ub::fromRgbF
- (qreal red, qreal green, qreal blue, qreal alpha)
-{
- return QColor4ub(qRound(red * 255.0f), qRound(green * 255.0f),
- qRound(blue * 255.0f), qRound(alpha * 255.0f));
-}
-
-inline QColor4ub QColor4ub::fromRaw(const uchar *data)
-{
- return QColor4ub(data);
-}
-
-inline QColor QColor4ub::toColor() const
-{
- return QColor(m_red, m_green, m_blue, m_alpha);
-}
-
-inline bool QColor4ub::operator==(const QColor4ub& other) const
-{
- return m_red == other.m_red && m_green == other.m_green &&
- m_blue == other.m_blue && m_alpha == other.m_alpha;
-}
-
-inline bool QColor4ub::operator!=(const QColor4ub& other) const
-{
- return m_red != other.m_red || m_green != other.m_green ||
- m_blue != other.m_blue || m_alpha != other.m_alpha;
-}
-
-#ifndef QT_NO_DEBUG_STREAM
-Q_QT3D_EXPORT QDebug operator<<(QDebug dbg, const QColor4ub &color);
-#endif
-
-Q_DECLARE_TYPEINFO(QColor4ub, Q_MOVABLE_TYPE);
-
-QT_END_NAMESPACE
-
-Q_DECLARE_METATYPE(QColor4ub)
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/arrays/qcustomdataarray.cpp b/src/threed/arrays/qcustomdataarray.cpp
deleted file mode 100644
index aaacfe98..00000000
--- a/src/threed/arrays/qcustomdataarray.cpp
+++ /dev/null
@@ -1,909 +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 "qcustomdataarray.h"
-#include <QtCore/qdebug.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QCustomDataArray
- \brief The QCustomDataArray class is a polymorphic array of data values suitable for use in 3D applications.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::arrays
-
- QArray is an efficient storage mechanism for vertex attributes.
- However, there are some situations where the element type of a custom
- vertex attribute is not known until runtime. QCustomDataArray is
- intended for use in those situations. It has a small performance
- penalty compared to QArray to achieve polymorphism.
-
- The elements that may be stored in a QCustomDataArray are limited
- to a few types: float, QVector2D, QVector3D, QVector4D, and
- QColor4ub. This provides a reasonable range of efficient use
- cases without overloading the API. QArray can be used on
- any type, but is restricted to types that are known at compile time.
-
- Like QArray, QCustomDataArray uses implicit sharing and
- copy-on-write semantics to support passing large arrays around
- an application with little overhead.
-
- \sa QArray
-*/
-
-/*!
- \enum QCustomDataArray::ElementType
- This enum defines the element type within a QCustomDataArray.
-
- \value Float The elements are of type float.
- \value Vector2D The elements are of type QVector2D.
- \value Vector3D The elements are of type QVector3D.
- \value Vector4D The elements are of type QVector4D.
- \value Color The elements are of type QColor4ub, which consists of
- four unsigned bytes. To represent colors as four floating-point
- values, use Vector4D as the element type.
-*/
-
-/*!
- \fn QCustomDataArray::QCustomDataArray()
-
- Constructs an empty custom data array. The elementType() will
- initially be QCustomDataArray::Float, which can be changed with a
- call to setElementType() before the elements are appended.
-
- \sa setElementType(), append()
-*/
-
-/*!
- Constructs an empty custom data array with elements represented
- by the specified \a type.
-
- \sa setElementType()
-*/
-QCustomDataArray::QCustomDataArray(QCustomDataArray::ElementType type)
-{
- setElementType(type);
-}
-
-/*!
- Constructs an empty custom data array with elements represented
- by the specified \a type. The array is initially resized to \a size;
- filling all elements with zeroes.
-
- \sa setElementType(), resize()
-*/
-QCustomDataArray::QCustomDataArray(QCustomDataArray::ElementType type, int size)
-{
- setElementType(type);
- resize(size);
-}
-
-/*!
- \fn QCustomDataArray::QCustomDataArray(const QCustomDataArray& other)
-
- Constructs a copy of \a other.
-*/
-
-/*!
- Constructs a copy of the floating-point QArray \a other.
-
- The elementType() will be set to QCustomDataArray::Float.
-
- \sa toFloatArray()
-*/
-QCustomDataArray::QCustomDataArray(const QArray<float>& other)
- : m_array(other),
- m_elementType(QCustomDataArray::Float),
- m_elementComponents(1)
-{
-}
-
-/*!
- Constructs a copy of the 2D vector QArray \a other.
-
- The elementType() will be set to QCustomDataArray::Vector2D.
-
- This constructor needs to make a complete copy of the data
- in \a other so it may be expensive performance-wise.
-
- \sa toVector2DArray()
-*/
-QCustomDataArray::QCustomDataArray(const QArray<QVector2D>& other)
- : m_elementType(QCustomDataArray::Vector2D),
- m_elementComponents(2)
-{
- int size = other.size();
- if (size > 0) {
- const QVector2D *src = other.constData();
- float *dst = m_array.extend(size * 2);
- qMemCopy(dst, src, size * sizeof(QVector2D));
- }
-}
-
-/*!
- Constructs a copy of the 3D vector QArray \a other.
-
- The elementType() will be set to QCustomDataArray::Vector3D.
-
- This constructor needs to make a complete copy of the data
- in \a other so it may be expensive performance-wise.
-
- \sa toVector3DArray()
-*/
-QCustomDataArray::QCustomDataArray(const QArray<QVector3D>& other)
- : m_elementType(QCustomDataArray::Vector3D),
- m_elementComponents(3)
-{
- int size = other.size();
- if (size > 0) {
- const QVector3D *src = other.constData();
- float *dst = m_array.extend(size * 3);
- qMemCopy(dst, src, size * sizeof(QVector3D));
- }
-}
-
-/*!
- Constructs a copy of the 4D vector QArray \a other.
-
- The elementType() will be set to QCustomDataArray::Vector4D.
-
- This constructor needs to make a complete copy of the data
- in \a other so it may be expensive performance-wise.
-
- \sa toVector3DArray()
-*/
-QCustomDataArray::QCustomDataArray(const QArray<QVector4D>& other)
- : m_elementType(QCustomDataArray::Vector4D),
- m_elementComponents(4)
-{
- int size = other.size();
- if (size > 0) {
- const QVector4D *src = other.constData();
- float *dst = m_array.extend(size * 4);
- qMemCopy(dst, src, size * sizeof(QVector4D));
- }
-}
-
-/*!
- Constructs a copy of the color QArray \a other.
-
- The elementType() will be set to QCustomDataArray::Color.
-
- This constructor needs to make a complete copy of the data
- in \a other so it may be expensive performance-wise.
-
- \sa toColorArray()
-*/
-QCustomDataArray::QCustomDataArray(const QArray<QColor4ub>& other)
- : m_elementType(QCustomDataArray::Color),
- m_elementComponents(1)
-{
- int size = other.size();
- qMemCopy(m_array.extend(size), other.constData(), sizeof(QColor4ub) * size);
-}
-
-/*!
- \fn QCustomDataArray::~QCustomDataArray()
-
- Destroys this custom data array.
-*/
-
-/*!
- \fn QCustomDataArray& QCustomDataArray::operator=(const QCustomDataArray& other)
-
- Assigns \a other to this custom data array and returns a reference
- to this custom data array.
-
- The previous elementType() for this custom data array will be
- replaced with the type from \a other. The element data is assigned
- directly without conversion.
-*/
-
-/*!
- \fn QCustomDataArray::ElementType QCustomDataArray::elementType() const
-
- Returns the representation type of elements in this custom data array.
-
- \sa setElementType()
-*/
-
-/*!
- Sets the representation \a type of elements in this custom data array.
- The array must be empty to change the element type.
-
- \sa elementType(), append()
-*/
-void QCustomDataArray::setElementType(QCustomDataArray::ElementType type)
-{
- Q_ASSERT(m_array.isEmpty());
- m_elementType = type;
- switch (type) {
- case QCustomDataArray::Float:
- m_elementComponents = 1;
- break;
- case QCustomDataArray::Vector2D:
- m_elementComponents = 2;
- break;
- case QCustomDataArray::Vector3D:
- m_elementComponents = 3;
- break;
- case QCustomDataArray::Vector4D:
- m_elementComponents = 4;
- break;
- case QCustomDataArray::Color:
- m_elementComponents = 1; // 4 bytes packed into a float.
- break;
- default:
- Q_ASSERT_X(false, "QCustomDataArray::setElementType",
- "unknown element type");
- m_elementComponents = 1;
- break;
- }
-}
-
-/*!
- \fn int QCustomDataArray::size() const
-
- Returns the number of elements in this custom data array.
-
- \sa resize(), capacity(), isEmpty()
-*/
-
-/*!
- \fn int QCustomDataArray::count() const
-
- Same as size(); provided for convenience.
-*/
-
-/*!
- \fn int QCustomDataArray::capacity() const
-
- Returns the number of elements that can be stored in this
- custom data array before reallocation.
-
- \sa reserve(), size()
-*/
-
-/*!
- \fn bool QCustomDataArray::isEmpty() const
-
- Returns true if this data array is empty; false otherwise.
-
- \sa size(), clear()
-*/
-
-/*!
- \fn int QCustomDataArray::elementSize() const
-
- Returns the size of individual elements in this custom data
- array, in bytes. For example, the element size of an array
- containing QVector3D values will be 3 * sizeof(float),
- normally 12.
-
- \sa setElementType()
-*/
-
-/*!
- \fn void QCustomDataArray::clear()
-
- Clears all elements from this custom data array and sets the size to zero.
-
- This function will deallocate any memory that is used on the heap
- to store the custom data array's elements. To reuse the same memory
- as before, call resize() with an argument of zero.
-
- \sa resize(), isEmpty()
-*/
-
-/*!
- \fn void QCustomDataArray::resize(int size)
-
- Sets the size of the custom data array to \a size. If \a size is greater
- than the current size, elements are added to the end; the new elements
- are initialized with all-zeroes. If \a size is less than the current
- size, elements are removed from the end.
-
- \sa size(), reserve(), squeeze()
-*/
-
-/*!
- \fn void QCustomDataArray::reserve(int size)
-
- Increases the capacity of this custom data array to reserve space for
- at least \a size elements. If the capacity is already larger
- than \a size, this function does nothing; in particular, it does
- not remove elements from the array like resize() does.
-
- This function can be useful when you know how roughly many elements
- will be appended ahead of time. Reserving the space once can avoid
- unnecessary realloc operations later.
-
- \sa capacity(), resize(), squeeze()
-*/
-
-/*!
- \fn void QCustomDataArray::squeeze()
-
- Releases any memory not required to store the custom data array's
- elements by reducing its capacity() to size().
-
- This function is intended for reclaiming memory in a custom data
- array that is being used over and over with different contents.
- As elements are added to a custom data array, it will be constantly
- expanded in size. This function can realloc the custom data array
- to a smaller size to reclaim unused memory.
-
- \sa reserve(), capacity()
-*/
-
-/*!
- Returns the value of the element at \a index in this custom
- data array as a QVariant.
-
- Color elements are returned as a QVariant containing a
- QColor4ub, not a QColor.
-
- \sa setAt(), append(), floatAt(), vector2DAt(), vector3DAt()
- \sa vector4DAt(), colorAt()
-*/
-QVariant QCustomDataArray::at(int index) const
-{
- Q_ASSERT(index >= 0 && index < size());
-
- const float *data;
- switch (m_elementType) {
-
- case QCustomDataArray::Float:
- return QVariant(m_array.at(index));
-
- case QCustomDataArray::Vector2D:
- data = m_array.constData() + index * 2;
- return qVariantFromValue(QVector2D(data[0], data[1]));
-
- case QCustomDataArray::Vector3D:
- data = m_array.constData() + index * 3;
- return qVariantFromValue(QVector3D(data[0], data[1], data[2]));
-
- case QCustomDataArray::Vector4D:
- data = m_array.constData() + index * 4;
- return qVariantFromValue
- (QVector4D(data[0], data[1], data[2], data[3]));
-
- case QCustomDataArray::Color:
- data = m_array.constData() + index;
- return qVariantFromValue
- (QColor4ub::fromRaw(reinterpret_cast<const uchar *>(data)));
-
- default: break;
- }
- return QVariant();
-}
-
-/*!
- Sets the element at \a index in this custom data array to \a value.
-
- The type of \a value must be consistent with elementType().
- The two exceptions to this are that a Float value can be
- specified by either a float or double QVariant, and a Color
- value can be specified as either a QColor4ub or QColor QVariant.
-
- \sa at(), elementType()
-*/
-void QCustomDataArray::setAt(int index, const QVariant& value)
-{
- Q_ASSERT(index >= 0 && index < size());
-
- switch (value.type()) {
-
- case (QVariant::Type)QMetaType::Float:
- Q_ASSERT(m_elementType == QCustomDataArray::Float);
- m_array[index] = value.toFloat();
- break;
-
- case QVariant::Double:
- // Convert Double into Float.
- Q_ASSERT(m_elementType == QCustomDataArray::Float);
- m_array[index] = float(value.toDouble());
- break;
-
- case QVariant::Vector2D:
- Q_ASSERT(m_elementType == QCustomDataArray::Vector2D);
- *(reinterpret_cast<QVector2D *>(m_array.data() + index * 2))
- = qVariantValue<QVector2D>(value);
- break;
-
- case QVariant::Vector3D:
- Q_ASSERT(m_elementType == QCustomDataArray::Vector3D);
- *(reinterpret_cast<QVector3D *>(m_array.data() + index * 3))
- = qVariantValue<QVector3D>(value);
- break;
-
- case QVariant::Vector4D:
- Q_ASSERT(m_elementType == QCustomDataArray::Vector4D);
- *(reinterpret_cast<QVector4D *>(m_array.data() + index * 4))
- = qVariantValue<QVector4D>(value);
- break;
-
- case QVariant::Color:
- // Convert QColor into QColor4ub.
- Q_ASSERT(m_elementType == QCustomDataArray::Color);
- *(reinterpret_cast<QColor4ub *>(m_array.data() + index))
- = QColor4ub(qVariantValue<QColor>(value));
- break;
-
- case QVariant::UserType:
- if (value.userType() == qMetaTypeId<QColor4ub>()) {
- Q_ASSERT(m_elementType == QCustomDataArray::Color);
- *(reinterpret_cast<QColor4ub *>(m_array.data() + index))
- = qVariantValue<QColor4ub>(value);
- break;
- }
- // Fall through.
-
- default:
- Q_ASSERT_X(false, "QCustomDataArray::setAt",
- "QVariant type not supported for elements");
- break;
- }
-}
-
-/*!
- \fn void QCustomDataArray::setAt(int index, qreal x)
- \overload
-
- Sets the floating-point element at \a index in this custom data
- array to \a x. The elementType() must be QCustomDataArray::Float.
-
- \sa at(), elementType(), floatAt()
-*/
-
-/*!
- \fn void QCustomDataArray::setAt(int index, qreal x, qreal y)
- \overload
-
- Sets the 2D vector element at \a index in this custom
- data array to (\a x, \a y). The elementType() must be
- QCustomDataArray::Vector2D.
-
- \sa at(), elementType(), vector2DAt()
-*/
-
-/*!
- \fn void QCustomDataArray::setAt(int index, qreal x, qreal y, qreal z)
- \overload
-
- Sets the 3D vector element at \a index in this custom
- data array to (\a x, \a y, \a z). The elementType() must be
- QCustomDataArray::Vector3D.
-
- \sa at(), elementType(), vector3DAt()
-*/
-
-/*!
- \fn void QCustomDataArray::setAt(int index, qreal x, qreal y, qreal z, qreal w)
- \overload
-
- Sets the 4D vector element at \a index in this custom
- data array to (\a x, \a y, \a z, \a w). The elementType() must be
- QCustomDataArray::Vector4D.
-
- \sa at(), elementType(), vector4DAt()
-*/
-
-/*!
- \fn void QCustomDataArray::setAt(int index, const QVector2D& value)
- \overload
-
- Sets the 2D vector element at \a index in this custom
- data array to \a value. The elementType() must be
- QCustomDataArray::Vector2D.
-
- \sa at(), elementType(), vector2DAt()
-*/
-
-/*!
- \fn void QCustomDataArray::setAt(int index, const QVector3D& value)
- \overload
-
- Sets the 3D vector element at \a index in this custom
- data array to \a value. The elementType() must be
- QCustomDataArray::Vector3D.
-
- \sa at(), elementType(), vector3DAt()
-*/
-
-/*!
- \fn void QCustomDataArray::setAt(int index, const QVector4D& value)
- \overload
-
- Sets the 4D vector element at \a index in this custom
- data array to \a value. The elementType() must be
- QCustomDataArray::Vector4D.
-
- \sa at(), elementType(), vector4DAt()
-*/
-
-/*!
- \fn void QCustomDataArray::setAt(int index, const QColor4ub& value)
- \overload
-
- Sets the color element at \a index in this custom data array to \a value.
- The elementType() must be QCustomDataArray::Color.
-
- \sa at(), elementType(), colorAt()
-*/
-
-/*!
- \fn void QCustomDataArray::setAt(int index, Qt::GlobalColor value)
- \overload
-
- Sets the color element at \a index in this custom data array to \a value.
- The elementType() must be QCustomDataArray::Color.
-
- \sa at(), elementType(), colorAt()
-*/
-
-/*!
- \fn qreal QCustomDataArray::floatAt(int index) const
-
- Returns the floating-point element at \a index in this custom data array.
- The elementType() must be QCustomDataArray::Float.
-
- \sa at(), setAt(), elementType()
-*/
-
-/*!
- \fn QVector2D QCustomDataArray::vector2DAt(int index) const
-
- Returns the 2D vector element at \a index in this custom data array.
- The elementType() must be QCustomDataArray::Vector2D.
-
- \sa at(), setAt(), elementType()
-*/
-
-/*!
- \fn QVector3D QCustomDataArray::vector3DAt(int index) const
-
- Returns the 3D vector element at \a index in this custom data array.
- The elementType() must be QCustomDataArray::Vector3D.
-
- \sa at(), setAt(), elementType()
-*/
-
-/*!
- \fn QVector4D QCustomDataArray::vector4DAt(int index) const
-
- Returns the 4D vector element at \a index in this custom data array.
- The elementType() must be QCustomDataArray::Vector4D.
-
- \sa at(), setAt(), elementType()
-*/
-
-/*!
- \fn QColor4ub QCustomDataArray::colorAt(int index) const
-
- Returns the color element at \a index in this custom data array.
- The elementType() must be QCustomDataArray::Color.
-
- \sa at(), setAt(), elementType()
-*/
-
-/*!
- \fn void QCustomDataArray::append(qreal x)
- \overload
-
- Appends the floating-point value \a x to this custom data array.
- The elementType() must be QCustomDataArray::Float.
-
- \sa setAt(), floatAt()
-*/
-
-/*!
- \fn void QCustomDataArray::append(qreal x, qreal y)
- \overload
-
- Appends the 2D vector value (\a x, \a y) to this custom data array.
- The elementType() must be QCustomDataArray::Vector2D.
-
- \sa setAt(), vector2DAt()
-*/
-
-/*!
- \fn void QCustomDataArray::append(qreal x, qreal y, qreal z)
- \overload
-
- Appends the 3D vector value (\a x, \a y, \a z) to this custom
- data array. The elementType() must be QCustomDataArray::Vector3D.
-
- \sa setAt(), vector3DAt()
-*/
-
-/*!
- \fn void QCustomDataArray::append(qreal x, qreal y, qreal z, qreal w)
- \overload
-
- Appends the 4D vector value (\a x, \a y, \a z, \a w) to this custom
- data array. The elementType() must be QCustomDataArray::Vector4D.
-
- \sa setAt(), vector4DAt()
-*/
-
-/*!
- \fn void QCustomDataArray::append(const QVector2D& value)
- \overload
-
- Appends the 2D vector \a value to this custom data array.
- The elementType() must be QCustomDataArray::Vector2D.
-
- \sa setAt(), vector2DAt()
-*/
-
-/*!
- \fn void QCustomDataArray::append(const QVector3D& value)
- \overload
-
- Appends the 3D vector \a value to this custom data array.
- The elementType() must be QCustomDataArray::Vector3D.
-
- \sa setAt(), vector3DAt()
-*/
-
-/*!
- \fn void QCustomDataArray::append(const QVector4D& value)
- \overload
-
- Appends the 4D vector \a value to this custom data array.
- The elementType() must be QCustomDataArray::Vector4D.
-
- \sa setAt(), vector4DAt()
-*/
-
-/*!
- \fn void QCustomDataArray::append(const QColor4ub& value)
- \overload
-
- Appends the color \a value to this custom data array.
- The elementType() must be QCustomDataArray::Color.
-
- \sa setAt(), colorAt()
-*/
-
-/*!
- \fn void QCustomDataArray::append(Qt::GlobalColor value)
- \overload
-
- Appends the color \a value to this custom data array.
- The elementType() must be QCustomDataArray::Color.
-
- \sa setAt(), colorAt()
-*/
-
-/*!
- \fn void QCustomDataArray::append(const QCustomDataArray &array)
- \overload
-
- Appends the values in \a array to this custom data array. This
- custom data array must have the same element type as \a array,
- unless this custom data array is empty - in which case the
- element type and data of \a array will be assigned to this.
-*/
-
-/*!
- Appends \a value to this custom data array.
-
- The type of \a value must be consistent with elementType().
- The two exceptions to this are that a Float value can be
- specified by either a float or double QVariant, and a Color
- value can be specified as either a QColor4ub or QColor QVariant.
-
- \sa at(), setAt(), elementType()
-*/
-void QCustomDataArray::append(const QVariant& value)
-{
- switch (value.type()) {
-
- case (QVariant::Type)QMetaType::Float:
- Q_ASSERT(m_elementType == QCustomDataArray::Float);
- m_array.append(value.toFloat());
- break;
-
- case QVariant::Double:
- // Convert Double into Float.
- Q_ASSERT(m_elementType == QCustomDataArray::Float);
- m_array.append(float(value.toDouble()));
- break;
-
- case QVariant::Vector2D:
- append(qVariantValue<QVector2D>(value));
- break;
-
- case QVariant::Vector3D:
- append(qVariantValue<QVector3D>(value));
- break;
-
- case QVariant::Vector4D:
- append(qVariantValue<QVector4D>(value));
- break;
-
- case QVariant::Color:
- // Convert QColor into QColor4ub.
- append(QColor4ub(qVariantValue<QColor>(value)));
- break;
-
- case QVariant::UserType:
- if (value.userType() == qMetaTypeId<QColor4ub>()) {
- append(qVariantValue<QColor4ub>(value));
- break;
- }
- // Fall through.
-
- default:
- Q_ASSERT_X(false, "QCustomDataArray::append",
- "QVariant type not supported for elements");
- break;
- }
-}
-
-/*!
- Returns the contents of this custom data array as a QArray
- of float values.
-
- The elementType() must be QCustomDataArray::Float.
-*/
-QArray<float> QCustomDataArray::toFloatArray() const
-{
- Q_ASSERT(m_elementType == QCustomDataArray::Float);
- return m_array;
-}
-
-/*!
- Returns the contents of this custom data array as a QArray
- of QVector2D values.
-
- The elementType() must be QCustomDataArray::Vector2D.
-
- This function needs to make a complete copy of the data
- in this array so it may be expensive performance-wise.
-*/
-QArray<QVector2D> QCustomDataArray::toVector2DArray() const
-{
- Q_ASSERT(m_elementType == QCustomDataArray::Vector2D);
- int size = m_array.size() / 2;
- QArray<QVector2D> result;
- if (size > 0) {
- QVector2D *dst = result.extend(size);
- const float *src = m_array.constData();
- qMemCopy(dst, src, size * sizeof(QVector2D));
- }
- return result;
-}
-
-/*!
- Returns the contents of this custom data array as a QArray
- of QVector3D values.
-
- The elementType() must be QCustomDataArray::Vector3D.
-
- This function needs to make a complete copy of the data
- in this array so it may be expensive performance-wise.
-*/
-QArray<QVector3D> QCustomDataArray::toVector3DArray() const
-{
- Q_ASSERT(m_elementType == QCustomDataArray::Vector3D);
- int size = m_array.size() / 3;
- QArray<QVector3D> result;
- if (size > 0) {
- QVector3D *dst = result.extend(size);
- const float *src = m_array.constData();
- qMemCopy(dst, src, size * sizeof(QVector3D));
- }
- return result;
-}
-
-/*!
- Returns the contents of this custom data array as a QArray
- of QVector4D values.
-
- The elementType() must be QCustomDataArray::Vector4D.
-
- This function needs to make a complete copy of the data
- in this array so it may be expensive performance-wise.
-*/
-QArray<QVector4D> QCustomDataArray::toVector4DArray() const
-{
- Q_ASSERT(m_elementType == QCustomDataArray::Vector4D);
- int size = m_array.size() / 4;
- QArray<QVector4D> result;
- if (size > 0) {
- QVector4D *dst = result.extend(size);
- const float *src = m_array.constData();
- qMemCopy(dst, src, size * sizeof(QVector4D));
- }
- return result;
-}
-
-/*!
- Returns the contents of this custom data array as a QArray
- of QColor4ub values.
-
- The elementType() must be QCustomDataArray::Color.
-
- This function needs to make a complete copy of the data
- in this array so it may be expensive performance-wise.
-*/
-QArray<QColor4ub> QCustomDataArray::toColorArray() const
-{
- Q_ASSERT(m_elementType == QCustomDataArray::Color);
- int size = m_array.size();
- QArray<QColor4ub> result;
- result.reserve(size);
- const QColor4ub *data =
- reinterpret_cast<const QColor4ub *>(m_array.constData());
- for (int index = 0; index < size; ++index)
- result.append(*data++);
- return result;
-}
-
-/*!
- \fn const void *QCustomDataArray::data() const
-
- Returns a const pointer to the data stored in the custom data array.
- The pointer can be used to access the items in the custom data array.
- The pointer remains valid as long as the custom data array isn't
- reallocated.
-
- This function is mostly useful to pass a custom data array to a function
- that accepts a plain C++ array.
-*/
-
-#ifndef QT_NO_DEBUG_STREAM
-Q_QT3D_EXPORT QDebug operator<<(QDebug dbg, const QCustomDataArray &array)
-{
- dbg << "QCustomDataArray" << &array << " -- count:" << array.count();
- for (int i = 0; i < array.count(); ++i)
- dbg << array.at(i);
- return dbg;
-}
-#endif
-
-
-QT_END_NAMESPACE
diff --git a/src/threed/arrays/qcustomdataarray.h b/src/threed/arrays/qcustomdataarray.h
deleted file mode 100644
index 5a05ba15..00000000
--- a/src/threed/arrays/qcustomdataarray.h
+++ /dev/null
@@ -1,421 +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 QCUSTOMDATAARRAY_H
-#define QCUSTOMDATAARRAY_H
-
-#include "qarray.h"
-#include "qcolor4ub.h"
-#include <QtCore/qvariant.h>
-#include <QtGui/qvector2d.h>
-#include <QtGui/qvector3d.h>
-#include <QtGui/qvector4d.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class QGLVertexBundleCustomAttribute;
-class QGeometryData;
-
-class Q_QT3D_EXPORT QCustomDataArray
-{
-public:
- enum ElementType
- {
- Float,
- Vector2D,
- Vector3D,
- Vector4D,
- Color
- };
-
- QCustomDataArray();
- explicit QCustomDataArray(QCustomDataArray::ElementType type);
- QCustomDataArray(QCustomDataArray::ElementType type, int size);
- QCustomDataArray(const QCustomDataArray& other);
- QCustomDataArray(const QArray<float>& other);
- QCustomDataArray(const QArray<QVector2D>& other);
- QCustomDataArray(const QArray<QVector3D>& other);
- QCustomDataArray(const QArray<QVector4D>& other);
- QCustomDataArray(const QArray<QColor4ub>& other);
- ~QCustomDataArray();
-
- QCustomDataArray& operator=(const QCustomDataArray& other);
-
- QCustomDataArray::ElementType elementType() const;
- void setElementType(QCustomDataArray::ElementType type);
-
- int size() const;
- int count() const;
-
- int capacity() const;
- bool isEmpty() const;
-
- int elementSize() const;
-
- void clear();
- void reserve(int size);
- void resize(int size);
- void squeeze();
-
- QVariant at(int index) const;
- void setAt(int index, const QVariant& value);
-
- void setAt(int index, qreal x);
- void setAt(int index, qreal x, qreal y);
- void setAt(int index, qreal x, qreal y, qreal z);
- void setAt(int index, qreal x, qreal y, qreal z, qreal w);
- void setAt(int index, const QVector2D& value);
- void setAt(int index, const QVector3D& value);
- void setAt(int index, const QVector4D& value);
- void setAt(int index, const QColor4ub& value);
- void setAt(int index, Qt::GlobalColor value);
-
- qreal floatAt(int index) const;
- QVector2D vector2DAt(int index) const;
- QVector3D vector3DAt(int index) const;
- QVector4D vector4DAt(int index) const;
- QColor4ub colorAt(int index) const;
-
- void append(qreal x);
- void append(qreal x, qreal y);
- void append(qreal x, qreal y, qreal z);
- void append(qreal x, qreal y, qreal z, qreal w);
- void append(const QVector2D& value);
- void append(const QVector3D& value);
- void append(const QVector4D& value);
- void append(const QColor4ub& value);
- void append(const QVariant& value);
- void append(Qt::GlobalColor value);
- void append(const QCustomDataArray &array);
-
- QArray<float> toFloatArray() const;
- QArray<QVector2D> toVector2DArray() const;
- QArray<QVector3D> toVector3DArray() const;
- QArray<QVector4D> toVector4DArray() const;
- QArray<QColor4ub> toColorArray() const;
-
- const void *data() const;
-
-private:
- QArray<float> m_array;
- QCustomDataArray::ElementType m_elementType;
- int m_elementComponents;
-
- friend class QGLVertexBundleCustomAttribute;
- friend class QGeometryData;
-};
-
-inline QCustomDataArray::QCustomDataArray()
- : m_elementType(QCustomDataArray::Float),
- m_elementComponents(1)
-{
-}
-
-inline QCustomDataArray::QCustomDataArray(const QCustomDataArray& other)
- : m_array(other.m_array),
- m_elementType(other.m_elementType),
- m_elementComponents(other.m_elementComponents)
-{
-}
-
-inline QCustomDataArray::~QCustomDataArray() {}
-
-inline QCustomDataArray& QCustomDataArray::operator=(const QCustomDataArray& other)
-{
- if (this != &other) {
- m_array = other.m_array;
- m_elementType = other.m_elementType;
- m_elementComponents = other.m_elementComponents;
- }
- return *this;
-}
-
-inline QCustomDataArray::ElementType QCustomDataArray::elementType() const
-{
- return m_elementType;
-}
-
-inline int QCustomDataArray::size() const
-{
- return m_array.size() / m_elementComponents;
-}
-
-inline int QCustomDataArray::count() const
-{
- return m_array.size() / m_elementComponents;
-}
-
-inline int QCustomDataArray::capacity() const
-{
- return m_array.capacity() / m_elementComponents;
-}
-
-inline bool QCustomDataArray::isEmpty() const
-{
- return m_array.isEmpty();
-}
-
-inline int QCustomDataArray::elementSize() const
-{
- return m_elementComponents * sizeof(float);
-}
-
-inline void QCustomDataArray::clear()
-{
- m_array.clear();
-}
-
-inline void QCustomDataArray::reserve(int size)
-{
- m_array.reserve(size * m_elementComponents);
-}
-
-inline void QCustomDataArray::resize(int size)
-{
- m_array.resize(size * m_elementComponents);
-}
-
-inline void QCustomDataArray::squeeze()
-{
- m_array.squeeze();
-}
-
-inline void QCustomDataArray::setAt(int index, qreal x)
-{
- Q_ASSERT(m_elementType == QCustomDataArray::Float);
- Q_ASSERT(index >= 0 && index < size());
- m_array[index] = float(x);
-}
-
-inline void QCustomDataArray::setAt(int index, qreal x, qreal y)
-{
- Q_ASSERT(m_elementType == QCustomDataArray::Vector2D);
- Q_ASSERT(index >= 0 && index < size());
- float *data = m_array.data() + index * 2;
- data[0] = float(x);
- data[1] = float(y);
-}
-
-inline void QCustomDataArray::setAt(int index, qreal x, qreal y, qreal z)
-{
- Q_ASSERT(m_elementType == QCustomDataArray::Vector3D);
- Q_ASSERT(index >= 0 && index < size());
- float *data = m_array.data() + index * 3;
- data[0] = float(x);
- data[1] = float(y);
- data[2] = float(z);
-}
-
-inline void QCustomDataArray::setAt(int index, qreal x, qreal y, qreal z, qreal w)
-{
- Q_ASSERT(m_elementType == QCustomDataArray::Vector4D);
- Q_ASSERT(index >= 0 && index < size());
- float *data = m_array.data() + index * 4;
- data[0] = float(x);
- data[1] = float(y);
- data[2] = float(z);
- data[3] = float(w);
-}
-
-inline void QCustomDataArray::setAt(int index, const QVector2D& value)
-{
- Q_ASSERT(m_elementType == QCustomDataArray::Vector2D);
- Q_ASSERT(index >= 0 && index < size());
- float *data = m_array.data() + index * 2;
- data[0] = float(value.x());
- data[1] = float(value.y());
-}
-
-inline void QCustomDataArray::setAt(int index, const QVector3D& value)
-{
- Q_ASSERT(m_elementType == QCustomDataArray::Vector3D);
- Q_ASSERT(index >= 0 && index < size());
- float *data = m_array.data() + index * 3;
- data[0] = float(value.x());
- data[1] = float(value.y());
- data[2] = float(value.z());
-}
-
-inline void QCustomDataArray::setAt(int index, const QVector4D& value)
-{
- Q_ASSERT(m_elementType == QCustomDataArray::Vector4D);
- Q_ASSERT(index >= 0 && index < size());
- float *data = m_array.data() + index * 4;
- data[0] = float(value.x());
- data[1] = float(value.y());
- data[2] = float(value.z());
- data[3] = float(value.w());
-}
-
-inline void QCustomDataArray::setAt(int index, const QColor4ub& value)
-{
- Q_ASSERT(m_elementType == QCustomDataArray::Color);
- Q_ASSERT(index >= 0 && index < size());
- *(reinterpret_cast<QColor4ub *>(m_array.data() + index)) = value;
-}
-
-inline void QCustomDataArray::setAt(int index, Qt::GlobalColor value)
-{
- Q_ASSERT(m_elementType == QCustomDataArray::Color);
- Q_ASSERT(index >= 0 && index < size());
- *(reinterpret_cast<QColor4ub *>(m_array.data() + index)) = QColor4ub(value);
-}
-
-inline qreal QCustomDataArray::floatAt(int index) const
-{
- Q_ASSERT(m_elementType == QCustomDataArray::Float);
- Q_ASSERT(index >= 0 && index < size());
- return m_array.at(index);
-}
-
-inline QVector2D QCustomDataArray::vector2DAt(int index) const
-{
- Q_ASSERT(m_elementType == QCustomDataArray::Vector2D);
- Q_ASSERT(index >= 0 && index < size());
- const float *data = m_array.constData() + index * 2;
- return QVector2D(data[0], data[1]);
-}
-
-inline QVector3D QCustomDataArray::vector3DAt(int index) const
-{
- Q_ASSERT(m_elementType == QCustomDataArray::Vector3D);
- Q_ASSERT(index >= 0 && index < size());
- const float *data = m_array.constData() + index * 3;
- return QVector3D(data[0], data[1], data[2]);
-}
-
-inline QVector4D QCustomDataArray::vector4DAt(int index) const
-{
- Q_ASSERT(m_elementType == QCustomDataArray::Vector4D);
- Q_ASSERT(index >= 0 && index < size());
- const float *data = m_array.constData() + index * 4;
- return QVector4D(data[0], data[1], data[2], data[3]);
-}
-
-inline QColor4ub QCustomDataArray::colorAt(int index) const
-{
- Q_ASSERT(m_elementType == QCustomDataArray::Color);
- Q_ASSERT(index >= 0 && index < size());
- return *(reinterpret_cast<const QColor4ub *>(m_array.constData() + index));
-}
-
-inline void QCustomDataArray::append(qreal x)
-{
- Q_ASSERT(m_elementType == QCustomDataArray::Float);
- m_array.append(float(x));
-}
-
-inline void QCustomDataArray::append(qreal x, qreal y)
-{
- Q_ASSERT(m_elementType == QCustomDataArray::Vector2D);
- m_array.append(float(x), float(y));
-}
-
-inline void QCustomDataArray::append(qreal x, qreal y, qreal z)
-{
- Q_ASSERT(m_elementType == QCustomDataArray::Vector3D);
- m_array.append(float(x), float(y), float(z));
-}
-
-inline void QCustomDataArray::append(qreal x, qreal y, qreal z, qreal w)
-{
- Q_ASSERT(m_elementType == QCustomDataArray::Vector4D);
- m_array.append(float(x), float(y), float(z), float(w));
-}
-
-inline void QCustomDataArray::append(const QVector2D& value)
-{
- Q_ASSERT(m_elementType == QCustomDataArray::Vector2D);
- m_array.append(float(value.x()), float(value.y()));
-}
-
-inline void QCustomDataArray::append(const QVector3D& value)
-{
- Q_ASSERT(m_elementType == QCustomDataArray::Vector3D);
- m_array.append(float(value.x()), float(value.y()), float(value.z()));
-}
-
-inline void QCustomDataArray::append(const QVector4D& value)
-{
- Q_ASSERT(m_elementType == QCustomDataArray::Vector4D);
- m_array.append(float(value.x()), float(value.y()),
- float(value.z()), float(value.w()));
-}
-
-inline void QCustomDataArray::append(const QColor4ub& value)
-{
- Q_ASSERT(m_elementType == QCustomDataArray::Color);
- *(reinterpret_cast<QColor4ub *>(m_array.extend(1))) = value;
-}
-
-inline void QCustomDataArray::append(Qt::GlobalColor value)
-{
- Q_ASSERT(m_elementType == QCustomDataArray::Color);
- *(reinterpret_cast<QColor4ub *>(m_array.extend(1))) = QColor4ub(value);
-}
-
-inline void QCustomDataArray::append(const QCustomDataArray &array)
-{
- Q_ASSERT(isEmpty() || (array.elementType() == elementType()));
- if (isEmpty())
- *this = array;
- else
- m_array.append(array.m_array);
-}
-
-inline const void *QCustomDataArray::data() const
-{
- return m_array.constData();
-}
-
-#ifndef QT_NO_DEBUG_STREAM
-Q_QT3D_EXPORT QDebug operator<<(QDebug dbg, const QCustomDataArray &array);
-#endif
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/arrays/qglattributedescription.cpp b/src/threed/arrays/qglattributedescription.cpp
deleted file mode 100644
index 63ae1c34..00000000
--- a/src/threed/arrays/qglattributedescription.cpp
+++ /dev/null
@@ -1,188 +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 "qglattributedescription.h"
-#include "qopenglfunctions.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGLAttributeDescription
- \brief The QGLAttributeDescription class encapsulates information about an OpenGL attribute value's layout and type.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::arrays
-
- OpenGL has many functions that take a pointer to vertex attribute
- values: \c{glVertexPointer()}, \c{glNormalPointer()},
- \c{glVertexAttribPointer()}, etc. These functions typically
- take four arguments: tuple size (1, 2, 3, or 4), component type
- (e.g. GL_FLOAT), stride, and data pointer (\c{glNormalPointer()}
- does not use tuple size, assuming that it is 3). When used with
- vertex buffers, the data pointer may be an offset into the vertex
- buffer instead.
-
- QGLAttributeDescription encapsulates the vertex attribute() kind
- (QGL::Position, QGL::Normal, etc) with the type(), tupleSize(),
- and stride() information of an attribute. The companion
- QGLAttributeValue class adds the data pointer.
-
- \sa QGLAttributeValue
-*/
-
-/*!
- \fn QGLAttributeDescription::QGLAttributeDescription()
-
- Constructs a null attribute description with default parameters of
- tupleSize() and stride() set to zero, type() set to GL_FLOAT,
- and attribute() set to QGL::Position.
-
- \sa isNull()
-*/
-
-/*!
- \fn QGLAttributeDescription::QGLAttributeDescription(QGL::VertexAttribute attribute, int tupleSize, GLenum type, int stride)
-
- Constructs an attribute description with the fields \a attribute,
- \a tupleSize, \a type, and \a stride.
-*/
-
-/*!
- \fn bool QGLAttributeDescription::isNull() const
-
- Returns true if tupleSize() is zero, which indicates an unset
- attribute description; false otherwise.
-*/
-
-/*!
- \fn QGL::VertexAttribute QGLAttributeDescription::attribute() const
-
- Returns the vertex attribute that this description applies to.
- The default value is QGL::Position.
-
- \sa setAttribute(), type()
-*/
-
-/*!
- \fn void QGLAttributeDescription::setAttribute(QGL::VertexAttribute attribute)
-
- Sets the vertex \a attribute that this description applies to.
-
- \sa attribute()
-*/
-
-/*!
- \fn GLenum QGLAttributeDescription::type() const
-
- Returns the component type for this attribute description. The default
- value is GL_FLOAT.
-
- \sa setType(), sizeOfType(), attribute()
-*/
-
-/*!
- \fn void QGLAttributeDescription::setType(GLenum type)
-
- Sets the component \a type for this attribute description.
-
- \sa type(), sizeOfType()
-*/
-
-/*!
- Returns the size in bytes of type().
-
- \sa type(), tupleSize()
-*/
-int QGLAttributeDescription::sizeOfType() const
-{
- switch (m_type) {
- case GL_BYTE: return int(sizeof(GLbyte));
- case GL_UNSIGNED_BYTE: return int(sizeof(GLubyte));
- case GL_SHORT: return int(sizeof(GLshort));
- case GL_UNSIGNED_SHORT: return int(sizeof(GLushort));
- case GL_INT: return int(sizeof(GLint));
- case GL_UNSIGNED_INT: return int(sizeof(GLuint));
- case GL_FLOAT: return int(sizeof(GLfloat));
-#if defined(GL_DOUBLE) && !defined(QT_OPENGL_ES)
- case GL_DOUBLE: return int(sizeof(GLdouble));
-#endif
- default: return 0;
- }
-}
-
-/*!
- \fn int QGLAttributeDescription::tupleSize() const
-
- Returns the tuple size of this attribute in components. For example,
- a return value of 3 indicates a vector of 3-dimensional values.
- If tupleSize() is zero, then this attribute description is null.
-
- \sa setTupleSize(), isNull(), sizeOfType()
-*/
-
-/*!
- \fn void QGLAttributeDescription::setTupleSize(int tupleSize)
-
- Sets the tuple size of this attribute in components to \a tupleSize.
-
- \sa tupleSize()
-*/
-
-/*!
- \fn int QGLAttributeDescription::stride() const
-
- Returns the stride in bytes from one vertex element to the
- next for this attribute description. The default value of 0 indicates
- that the elements are tightly packed within the data array.
-
- \sa setStride()
-*/
-
-/*!
- \fn void QGLAttributeDescription::setStride(int stride)
-
- Sets the \a stride in bytes from one vertex element to the next
- for this attribute description.
-
- \sa stride()
-*/
-
-QT_END_NAMESPACE
diff --git a/src/threed/arrays/qglattributedescription.h b/src/threed/arrays/qglattributedescription.h
deleted file mode 100644
index 4be46cc9..00000000
--- a/src/threed/arrays/qglattributedescription.h
+++ /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 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 QGLATTRIBUTEDESCRIPTION_H
-#define QGLATTRIBUTEDESCRIPTION_H
-
-#include <QtOpenGL/qgl.h>
-#include "qt3dglobal.h"
-#include "qglnamespace.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class Q_QT3D_EXPORT QGLAttributeDescription
-{
-public:
- QGLAttributeDescription();
- QGLAttributeDescription(QGL::VertexAttribute attribute,
- int tupleSize, GLenum type, int stride);
-
- bool isNull() const;
-
- QGL::VertexAttribute attribute() const;
- void setAttribute(QGL::VertexAttribute attribute);
-
- GLenum type() const;
- void setType(GLenum type);
-
- int sizeOfType() const;
-
- int tupleSize() const;
- void setTupleSize(int tupleSize);
-
- int stride() const;
- void setStride(int stride);
-
-private:
- QGL::VertexAttribute m_attribute;
- GLenum m_type;
- int m_tupleSize;
- int m_stride;
-};
-
-inline QGLAttributeDescription::QGLAttributeDescription()
- : m_attribute(QGL::Position), m_type(GL_FLOAT),
- m_tupleSize(0), m_stride(0)
-{
-}
-
-inline QGLAttributeDescription::QGLAttributeDescription
- (QGL::VertexAttribute attribute, int tupleSize, GLenum type, int stride)
- : m_attribute(attribute), m_type(type),
- m_tupleSize(tupleSize), m_stride(stride)
-{
- Q_ASSERT(tupleSize >= 1 && tupleSize <= 4);
-}
-
-inline bool QGLAttributeDescription::isNull() const
-{
- return m_tupleSize == 0;
-}
-
-inline QGL::VertexAttribute QGLAttributeDescription::attribute() const
-{
- return m_attribute;
-}
-
-inline void QGLAttributeDescription::setAttribute(QGL::VertexAttribute attribute)
-{
- m_attribute = attribute;
-}
-
-inline GLenum QGLAttributeDescription::type() const
-{
- return m_type;
-}
-
-inline void QGLAttributeDescription::setType(GLenum type)
-{
- m_type = type;
-}
-
-inline int QGLAttributeDescription::tupleSize() const
-{
- return m_tupleSize;
-}
-
-inline void QGLAttributeDescription::setTupleSize(int tupleSize)
-{
- Q_ASSERT(tupleSize >= 1 && tupleSize <= 4);
- m_tupleSize = tupleSize;
-}
-
-inline int QGLAttributeDescription::stride() const
-{
- return m_stride;
-}
-
-inline void QGLAttributeDescription::setStride(int stride)
-{
- m_stride = stride;
-}
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/arrays/qglattributeset.cpp b/src/threed/arrays/qglattributeset.cpp
deleted file mode 100644
index 469ee8fa..00000000
--- a/src/threed/arrays/qglattributeset.cpp
+++ /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 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 "qglattributeset.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGLAttributeSet
- \brief The QGLAttributeSet class provides a set of QGL::VertexAttribute indexes.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::arrays
-
- QGLAttributeSet is intended for checking if a specific vertex
- attribute is present in a piece of geometry, or has been set on a
- QGLPainter during rendering operations. The members of the set
- are instances of QGL::VertexAttribute, with the restriction that
- the index must be between 0 and 31.
-
- The most common use for this class is to determine if specific
- attributes have been supplied on a QGLPainter so as to adjust the
- current drawing effect accordingly. The following example will
- use a lit texture effect if texture co-ordinates were provided
- in the vertex bundle, or a simple lit material effect if
- texture co-ordinates were not provided:
-
- \code
- painter.clearAttributes();
- painter.setVertexBundle(bundle);
- if (painter.attributes().contains(QGL::TextureCoord0))
- painter.setStandardEffect(QGL::LitModulateTexture2D);
- else
- painter.setStandardEffect(QGL::LitMaterial);
- \endcode
-
- It is important to clear the attributes before setting the vertex
- bundle, so that attributes from a previous bundle will not leak
- through. Multiple vertex bundles may be supplied if they contain
- different parts of the same logical piece of geometry.
-
- \sa QGLVertexBundle::attributes(), QGLPainter::attributes()
-*/
-
-/*!
- \fn QGLAttributeSet::QGLAttributeSet()
-
- Constructs an empty attribute set.
-
- \sa isEmpty()
-*/
-
-/*!
- \fn bool QGLAttributeSet::isEmpty() const
-
- Returns true if this attribute set is empty; false otherwise.
-*/
-
-/*!
- \fn void QGLAttributeSet::clear()
-
- Clears this attribute set to empty.
-*/
-
-/*!
- \fn bool QGLAttributeSet::contains(QGL::VertexAttribute attr) const
-
- Returns true if this attribute set contains \a attr; false otherwise.
-
- \sa insert(), remove()
-*/
-
-/*!
- \fn void QGLAttributeSet::insert(QGL::VertexAttribute attr)
-
- Inserts \a attr into this attribute set. Note: \a attr must be
- within the range 0 to 31. Attribute indexes outside this range
- are ignored and not added to the set.
-
- \sa remove(), contains()
-*/
-
-/*!
- \fn void QGLAttributeSet::remove(QGL::VertexAttribute attr)
-
- Removes \a attr from this attribute set.
-
- \sa insert(), contains()
-*/
-
-/*!
- Returns the members of this attribute set as a list.
-
- \sa fromList()
-*/
-QList<QGL::VertexAttribute> QGLAttributeSet::toList() const
-{
- QList<QGL::VertexAttribute> list;
- quint32 attrs = m_attrs;
- int index = 0;
- while (attrs != 0) {
- if ((attrs & 1) != 0)
- list.append(QGL::VertexAttribute(index));
- ++index;
- attrs >>= 1;
- }
- return list;
-}
-
-/*!
- Returns a new attribute set that is initialized with the members
- of \a list.
-
- \sa toList(), insert()
-*/
-QGLAttributeSet QGLAttributeSet::fromList(const QList<QGL::VertexAttribute> &list)
-{
- QGLAttributeSet set;
- for (int index = 0; index < list.size(); ++index)
- set.insert(list.at(index));
- return set;
-}
-
-/*!
- \fn void QGLAttributeSet::unite(const QGLAttributeSet &other)
-
- Unites the contents of \a other with this attribute set
- and modifies this set accordingly.
-
- \sa intersect(), subtract(), insert()
-*/
-
-/*!
- \fn void QGLAttributeSet::intersect(const QGLAttributeSet &other)
-
- Intersects the contents of \a other with this attribute set
- and modifies this set accordingly.
-
- \sa unite(), subtract()
-*/
-
-/*!
- \fn void QGLAttributeSet::subtract(const QGLAttributeSet &other)
-
- Subtracts the contents of \a other from this attribute set
- and modifies this set accordingly.
-
- \sa unite(), intersect(), remove()
-*/
-
-/*!
- \fn bool QGLAttributeSet::operator==(const QGLAttributeSet &other) const
-
- Returns true if this attribute set has the same elements as \a other;
- false otherwise.
-
- \sa operator!=()
-*/
-
-/*!
- \fn bool QGLAttributeSet::operator!=(const QGLAttributeSet &other) const
-
- Returns true if this attribute set does not have the same elements as
- \a other; false otherwise.
-
- \sa operator==()
-*/
-
-QT_END_NAMESPACE
diff --git a/src/threed/arrays/qglattributeset.h b/src/threed/arrays/qglattributeset.h
deleted file mode 100644
index c8f10e98..00000000
--- a/src/threed/arrays/qglattributeset.h
+++ /dev/null
@@ -1,138 +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 QGLATTRIBUTESET_H
-#define QGLATTRIBUTESET_H
-
-#include "qt3dglobal.h"
-#include "qglnamespace.h"
-#include <QtCore/qlist.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class Q_QT3D_EXPORT QGLAttributeSet
-{
-public:
- QGLAttributeSet() : m_attrs(0) {}
-
- bool isEmpty() const { return !m_attrs; }
- void clear() { m_attrs = 0; }
-
- bool contains(QGL::VertexAttribute attr) const;
- void insert(QGL::VertexAttribute attr);
- void remove(QGL::VertexAttribute attr);
-
- QList<QGL::VertexAttribute> toList() const;
- static QGLAttributeSet fromList(const QList<QGL::VertexAttribute> &list);
-
- void unite(const QGLAttributeSet &other);
- void intersect(const QGLAttributeSet &other);
- void subtract(const QGLAttributeSet &other);
-
- bool operator==(const QGLAttributeSet &other) const;
- bool operator!=(const QGLAttributeSet &other) const;
-
-private:
- bool isValidAttr(QGL::VertexAttribute attr) const;
-
- quint32 m_attrs;
-};
-
-inline bool QGLAttributeSet::isValidAttr(QGL::VertexAttribute attr) const
-{
- int a = int(attr);
- return (a > -1 && a < 32);
-}
-
-inline bool QGLAttributeSet::contains(QGL::VertexAttribute attr) const
-{
- quint32 flag = quint32(attr);
- return isValidAttr(attr) ? ((m_attrs & (((quint32)1) << flag)) != 0) : false;
-}
-
-inline void QGLAttributeSet::insert(QGL::VertexAttribute attr)
-{
- quint32 flag = quint32(attr);
- if (isValidAttr(attr))
- m_attrs |= (((quint32)1) << flag);
-}
-
-inline void QGLAttributeSet::remove(QGL::VertexAttribute attr)
-{
- quint32 flag = quint32(attr);
- if (isValidAttr(attr))
- m_attrs &= ~(((quint32)1) << flag);
-}
-
-inline void QGLAttributeSet::unite(const QGLAttributeSet &other)
-{
- m_attrs |= other.m_attrs;
-}
-
-inline void QGLAttributeSet::intersect(const QGLAttributeSet &other)
-{
- m_attrs &= other.m_attrs;
-}
-
-inline void QGLAttributeSet::subtract(const QGLAttributeSet &other)
-{
- m_attrs &= ~(other.m_attrs);
-}
-
-inline bool QGLAttributeSet::operator==(const QGLAttributeSet &other) const
-{
- return m_attrs == other.m_attrs;
-}
-
-inline bool QGLAttributeSet::operator!=(const QGLAttributeSet &other) const
-{
- return m_attrs != other.m_attrs;
-}
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/arrays/qglattributevalue.cpp b/src/threed/arrays/qglattributevalue.cpp
deleted file mode 100644
index b5647dbf..00000000
--- a/src/threed/arrays/qglattributevalue.cpp
+++ /dev/null
@@ -1,276 +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 "qglattributevalue.h"
-#include "qopenglfunctions.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGLAttributeValue
- \brief The QGLAttributeValue class encapsulates information about an OpenGL attribute value.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::arrays
-
- OpenGL has many functions that take a pointer to vertex attribute
- values: \c{glVertexPointer()}, \c{glNormalPointer()},
- \c{glVertexAttribPointer()}, etc. These functions typically
- take four arguments: tuple size (1, 2, 3, or 4), component type
- (e.g. GL_FLOAT), stride, and data pointer (\c{glNormalPointer()}
- does not use tuple size, assuming that it is 3). When used with
- vertex buffers, the data pointer may be an offset into the vertex
- buffer instead.
-
- QGLAttributeValue encapsulates these four values so that they can
- be easily manipulated as a set during OpenGL painting operations.
- Constructors are provided for converting QArray and
- QCustomDataArray objects into an attribute value.
-
- Because the data() value is a raw pointer to arbitrary memory,
- care should be taken that the memory remains valid until the
- QGLAttributeValue is no longer required.
-
- \sa QGLAttributeDescription, QArray, QCustomDataArray
-*/
-
-/*!
- \fn QGLAttributeValue::QGLAttributeValue()
-
- Constructs a null attribute value with default parameters of
- tupleSize(), and stride() set to zero, type() set to GL_FLOAT,
- and data() set to null.
-
- \sa isNull()
-*/
-
-/*!
- \fn QGLAttributeValue::QGLAttributeValue(const QArray<float>& array)
-
- Constructs an attribute value that refers to the contents of \a array,
- setting tupleSize() to 1, type() to GL_FLOAT, and stride() to zero.
-
- The \a array must not be destroyed or modified until the attribute
- value is no longer required.
-*/
-
-/*!
- \fn QGLAttributeValue::QGLAttributeValue(const QArray<QVector2D>& array)
-
- Constructs an attribute value that refers to the contents of \a array,
- setting tupleSize() to 2, type() to GL_FLOAT, and stride() to zero.
-
- The \a array must not be destroyed or modified until the attribute
- value is no longer required.
-*/
-
-/*!
- \fn QGLAttributeValue::QGLAttributeValue(const QArray<QVector3D>& array)
-
- Constructs an attribute value that refers to the contents of \a array,
- setting tupleSize() to 3, type() to GL_FLOAT, and stride() to zero.
-
- The \a array must not be destroyed or modified until the attribute
- value is no longer required.
-*/
-
-/*!
- \fn QGLAttributeValue::QGLAttributeValue(const QArray<QVector4D>& array)
-
- Constructs an attribute value that refers to the contents of \a array,
- setting tupleSize() to 4, type() to GL_FLOAT, and stride() to zero.
-
- The \a array must not be destroyed or modified until the attribute
- value is no longer required.
-*/
-
-/*!
- \fn QGLAttributeValue::QGLAttributeValue(const QArray<QColor4ub>& array)
-
- Constructs an attribute value that refers to the contents of \a array,
- setting tupleSize() to 4, type() to GL_UNSIGNED_BYTE, and stride() to zero.
-
- The \a array must not be destroyed or modified until the attribute
- value is no longer required.
-*/
-
-/*!
- Constructs an attribute value that refers to the contents of \a array.
- The tupleSize() and type() of the attribute value will be set according
- to the QCustomDataArray::elementType() of \a array.
-
- The \a array must not be destroyed or modified until the attribute
- value is no longer required.
-*/
-QGLAttributeValue::QGLAttributeValue(const QCustomDataArray& array)
- : m_tupleSize(0), m_type(GL_FLOAT), m_stride(0)
- , m_data(array.data()), m_count(array.count())
-{
- switch (array.elementType()) {
- case QCustomDataArray::Float:
- m_tupleSize = 1;
- break;
- case QCustomDataArray::Vector2D:
- m_tupleSize = 2;
- break;
- case QCustomDataArray::Vector3D:
- m_tupleSize = 3;
- break;
- case QCustomDataArray::Vector4D:
- m_tupleSize = 4;
- break;
- case QCustomDataArray::Color:
- m_tupleSize = 4;
- m_type = GL_UNSIGNED_BYTE;
- break;
- }
-}
-
-/*!
- \fn QGLAttributeValue::QGLAttributeValue(int tupleSize, GLenum type, int stride, const void *data, int count)
-
- Constructs an attribute value with the fields \a tupleSize, \a type,
- \a stride, \a data, and \a count.
-*/
-
-/*!
- \fn QGLAttributeValue::QGLAttributeValue(int tupleSize, GLenum type, int stride, int offset, int count)
-
- Constructs an attribute value with the fields \a tupleSize, \a type,
- \a stride, \a offset, and \a count.
-*/
-
-/*!
- \fn QGLAttributeValue::QGLAttributeValue(const QGLAttributeDescription& description, const void *data, int count)
-
- Constructs an attribute value with the supplied \a description,
- \a data, and \a count.
-*/
-
-/*!
- \fn QGLAttributeValue::QGLAttributeValue(const QGLAttributeDescription& description, int offset, int count)
-
- Constructs an attribute value with the supplied \a description,
- \a offset, and \a count.
-*/
-
-/*!
- \fn bool QGLAttributeValue::isNull() const
-
- Returns true if tupleSize() is zero, which indicates an unset
- attribute value; false otherwise.
-
- Note: it is possible for data() to be null, but isNull() returns true.
- This can happen when data() is actually a zero offset into a
- vertex buffer.
-*/
-
-/*!
- \fn QGLAttributeDescription QGLAttributeValue::description(QGL::VertexAttribute attribute) const
-
- Returns the description of this value, tagged with \a attribute.
-
- \sa type()
-*/
-
-/*!
- \fn GLenum QGLAttributeValue::type() const
-
- Returns the component type for this attribute value. The default
- value is GL_FLOAT.
-
- \sa sizeOfType(), description()
-*/
-
-/*!
- Returns the size in bytes of type().
-
- \sa type(), tupleSize()
-*/
-int QGLAttributeValue::sizeOfType() const
-{
- switch (m_type) {
- case GL_BYTE: return int(sizeof(GLbyte));
- case GL_UNSIGNED_BYTE: return int(sizeof(GLubyte));
- case GL_SHORT: return int(sizeof(GLshort));
- case GL_UNSIGNED_SHORT: return int(sizeof(GLushort));
- case GL_INT: return int(sizeof(GLint));
- case GL_UNSIGNED_INT: return int(sizeof(GLuint));
- case GL_FLOAT: return int(sizeof(GLfloat));
-#if defined(GL_DOUBLE) && !defined(QT_OPENGL_ES)
- case GL_DOUBLE: return int(sizeof(GLdouble));
-#endif
- default: return 0;
- }
-}
-
-/*!
- \fn int QGLAttributeValue::tupleSize() const
-
- Returns the tuple size of this attribute in components. For example,
- a return value of 3 indicates a vector of 3-dimensional values.
- If tupleSize() is zero, then this attribute value is null.
-
- \sa isNull(), sizeOfType()
-*/
-
-/*!
- \fn int QGLAttributeValue::stride() const
-
- Returns the stride in bytes from one vertex element to the
- next for this attribute value. The default value of 0 indicates
- that the elements are tightly packed within the data() array.
-*/
-
-/*!
- \fn const void *QGLAttributeValue::data() const
-
- Returns the data pointer for the elements in this attribute value.
-*/
-
-/*!
- \fn int QGLAttributeValue::count() const
-
- Returns the count of vertex elements in this attribute value;
- zero if the count is unknown.
-*/
-
-QT_END_NAMESPACE
diff --git a/src/threed/arrays/qglattributevalue.h b/src/threed/arrays/qglattributevalue.h
deleted file mode 100644
index 00da039a..00000000
--- a/src/threed/arrays/qglattributevalue.h
+++ /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 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 QGLATTRIBUTEVALUE_H
-#define QGLATTRIBUTEVALUE_H
-
-#include "qglattributedescription.h"
-#include "qcustomdataarray.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class QGLVertexBundle;
-
-class Q_QT3D_EXPORT QGLAttributeValue
-{
-public:
- QGLAttributeValue();
- QGLAttributeValue(const QArray<float>& array);
- QGLAttributeValue(const QArray<QVector2D>& array);
- QGLAttributeValue(const QArray<QVector3D>& array);
- QGLAttributeValue(const QArray<QVector4D>& array);
- QGLAttributeValue(const QArray<QColor4ub>& array);
- QGLAttributeValue(const QCustomDataArray& array);
- QGLAttributeValue(int tupleSize, GLenum type, int stride, const void *data, int count = 0);
- QGLAttributeValue(int tupleSize, GLenum type, int stride, int offset, int count = 0);
- QGLAttributeValue(const QGLAttributeDescription& description, const void *data, int count = 0);
- QGLAttributeValue(const QGLAttributeDescription& description, int offset, int count = 0);
-
- bool isNull() const;
-
- QGLAttributeDescription description(QGL::VertexAttribute attribute) const;
- GLenum type() const;
- int sizeOfType() const;
- int tupleSize() const;
- int stride() const;
- const void *data() const;
- int count() const;
-
-private:
- int m_tupleSize;
- GLenum m_type;
- int m_stride;
- const void *m_data;
- int m_count;
-
- void setStride(int stride) { m_stride = stride; }
- void setOffset(int offset)
- { m_data = reinterpret_cast<const void *>(offset); }
-
- friend class QGLVertexBundle;
-};
-
-inline QGLAttributeValue::QGLAttributeValue()
- : m_tupleSize(0), m_type(GL_FLOAT), m_stride(0), m_data(0), m_count(0)
-{
-}
-
-inline QGLAttributeValue::QGLAttributeValue(const QArray<float>& array)
- : m_tupleSize(1), m_type(GL_FLOAT), m_stride(0)
- , m_data(array.constData()), m_count(array.count())
-{
-}
-
-inline QGLAttributeValue::QGLAttributeValue(const QArray<QVector2D>& array)
- : m_tupleSize(2), m_type(GL_FLOAT), m_stride(0)
- , m_data(array.constData()), m_count(array.count())
-{
-}
-
-inline QGLAttributeValue::QGLAttributeValue(const QArray<QVector3D>& array)
- : m_tupleSize(3), m_type(GL_FLOAT), m_stride(0)
- , m_data(array.constData()), m_count(array.count())
-{
-}
-
-inline QGLAttributeValue::QGLAttributeValue(const QArray<QVector4D>& array)
- : m_tupleSize(4), m_type(GL_FLOAT), m_stride(0)
- , m_data(array.constData()), m_count(array.count())
-{
-}
-
-inline QGLAttributeValue::QGLAttributeValue(const QArray<QColor4ub>& array)
- : m_tupleSize(4), m_type(GL_UNSIGNED_BYTE), m_stride(0)
- , m_data(array.constData()), m_count(array.count())
-{
-}
-
-inline QGLAttributeValue::QGLAttributeValue
- (int tupleSize, GLenum type, int stride, const void *data, int count)
- : m_tupleSize(tupleSize), m_type(type), m_stride(stride)
- , m_data(data), m_count(count)
-{
- Q_ASSERT(tupleSize >= 1 && tupleSize <= 4);
-}
-
-inline QGLAttributeValue::QGLAttributeValue
- (int tupleSize, GLenum type, int stride, int offset, int count)
- : m_tupleSize(tupleSize), m_type(type), m_stride(stride)
- , m_data(reinterpret_cast<const void *>(offset)), m_count(count)
-{
- Q_ASSERT(tupleSize >= 1 && tupleSize <= 4);
-}
-
-inline QGLAttributeValue::QGLAttributeValue
- (const QGLAttributeDescription& description, const void *data, int count)
- : m_tupleSize(description.tupleSize()), m_type(description.type())
- , m_stride(description.stride()), m_data(data), m_count(count)
-{
-}
-
-inline QGLAttributeValue::QGLAttributeValue
- (const QGLAttributeDescription& description, int offset, int count)
- : m_tupleSize(description.tupleSize()), m_type(description.type())
- , m_stride(description.stride())
- , m_data(reinterpret_cast<const void *>(offset))
- , m_count(count)
-{
-}
-
-inline bool QGLAttributeValue::isNull() const
-{
- return m_tupleSize == 0;
-}
-
-inline QGLAttributeDescription QGLAttributeValue::description(QGL::VertexAttribute attribute) const
-{
- if (!isNull()) {
- return QGLAttributeDescription(attribute, m_tupleSize, m_type, m_stride);
- } else {
- QGLAttributeDescription desc;
- desc.setAttribute(attribute);
- return desc;
- }
-}
-
-inline GLenum QGLAttributeValue::type() const
-{
- return m_type;
-}
-
-inline int QGLAttributeValue::tupleSize() const
-{
- return m_tupleSize;
-}
-
-inline int QGLAttributeValue::stride() const
-{
- return m_stride;
-}
-
-inline const void *QGLAttributeValue::data() const
-{
- return m_data;
-}
-
-inline int QGLAttributeValue::count() const
-{
- return m_count;
-}
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/arrays/qglindexbuffer.cpp b/src/threed/arrays/qglindexbuffer.cpp
deleted file mode 100644
index 55802551..00000000
--- a/src/threed/arrays/qglindexbuffer.cpp
+++ /dev/null
@@ -1,777 +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 "qglindexbuffer.h"
-#include "qglpainter.h"
-#include "qglpainter_p.h"
-#include "qglext_p.h"
-#include <QtOpenGL/qgl.h>
-#include <QtCore/qatomic.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGLIndexBuffer
- \brief The QGLIndexBuffer class manages uploading of index arrays into a GL server.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::arrays
-*/
-
-#ifdef QT_OPENGL_ES
-
-static bool qt_has_uint_buffers()
-{
- static bool done = false;
- static bool answer = false;
- if (!done) {
- QGLExtensionChecker extensions(reinterpret_cast<const char *>(glGetString(GL_EXTENSIONS)));
- answer = extensions.match("GL_OES_element_index_uint");
- done = true;
- }
- return answer;
-}
-
-#endif
-
-class QGLIndexBufferPrivate
-{
-public:
- QGLIndexBufferPrivate()
- : indexCount(0)
- , elementType(GL_UNSIGNED_SHORT)
- , buffer(QGLBuffer::IndexBuffer)
-#ifdef QT_OPENGL_ES
- , hasIntBuffers(qt_has_uint_buffers())
-#else
- , hasIntBuffers(true)
-#endif
- {
- ref = 1;
- }
-
- QBasicAtomicInt ref;
- int indexCount;
- QArray<ushort> indexesShort;
- QArray<uint> indexesInt;
- GLenum elementType;
- QGLBuffer buffer;
- bool hasIntBuffers;
-
- void append(const QGLIndexBufferPrivate *other, uint offset, int start);
- uint headIndex(int posn) const;
- uint tailIndex(int posn) const;
-};
-
-/*!
- Creates a new index buffer.
-*/
-QGLIndexBuffer::QGLIndexBuffer()
- : d_ptr(new QGLIndexBufferPrivate)
-{
-}
-
-/*!
- Creates a copy of \a other. Note that this just copies a reference
- to the index buffer. Any modifications to the copy will also
- affect the original object.
-*/
-QGLIndexBuffer::QGLIndexBuffer(const QGLIndexBuffer& other)
- : d_ptr(other.d_ptr)
-{
- d_ptr->ref.ref();
-}
-
-/*!
- Destroys this index buffer if this object is the last reference to it.
-*/
-QGLIndexBuffer::~QGLIndexBuffer()
-{
- if (!d_ptr->ref.deref())
- delete d_ptr;
-}
-
-/*!
- Assigns \a other to this object. Note that this just assigns a
- reference to the \a other index buffer. Any modifications to this
- object will also affect \a other.
-*/
-QGLIndexBuffer& QGLIndexBuffer::operator=(const QGLIndexBuffer& other)
-{
- if (d_ptr != other.d_ptr) {
- if (!d_ptr->ref.deref())
- delete d_ptr;
- d_ptr = other.d_ptr;
- d_ptr->ref.ref();
- }
- return *this;
-}
-
-/*!
- Returns the indexes in this buffer as an array of ushort values.
-
- Returns an empty array if type() is not \c GL_UNSIGNED_SHORT or the
- buffer has already been uploaded.
-*/
-QArray<ushort> QGLIndexBuffer::indexesUShort() const
-{
- Q_D(const QGLIndexBuffer);
- return d->indexesShort;
-}
-
-/*!
- Returns the indexes in this buffer as an array of uint values.
-
- Returns an empty array if type() is not \c GL_UNSIGNED_INT or the
- buffer has already been uploaded.
-*/
-QArray<uint> QGLIndexBuffer::indexesUInt() const
-{
- Q_D(const QGLIndexBuffer);
- return d->indexesInt;
-}
-
-/*!
- Returns the usage pattern for this index buffer.
- The default value is QGLBuffer::StaticDraw.
-
- \sa setUsagePattern()
-*/
-QGLBuffer::UsagePattern QGLIndexBuffer::usagePattern() const
-{
- Q_D(const QGLIndexBuffer);
- return d->buffer.usagePattern();
-}
-
-/*!
- Sets the usage pattern for this index buffer to \a value.
- This function must be called before upload() for the \a value
- to take effect.
-
- \sa usagePattern(), upload()
-*/
-void QGLIndexBuffer::setUsagePattern(QGLBuffer::UsagePattern value)
-{
- Q_D(QGLIndexBuffer);
- d->buffer.setUsagePattern(value);
-}
-
-static QArray<ushort> qt_qarray_uint_to_ushort(const QArray<uint> &array)
-{
- QArray<ushort> result;
- const uint *values = array.constData();
- int size = array.size();
- bool largeValue = false;
- result.reserve(size);
- while (size-- > 0) {
- uint value = *values++;
- if (ushort(value) != value)
- largeValue = true;
- result.append(ushort(value));
- }
- if (largeValue)
- qWarning("QGLIndexBuffer::setIndexes: large 32-bit value provided to a 16-bit only buffer");
- return result;
-}
-
-/*!
- Sets the index \a values in this index buffer, replacing the
- entire current contents.
-
- If the index buffer has been uploaded to the GL server, then this
- function must be called with a current GL context that is compatible
- with the uploaded buffer.
-
- \sa replaceIndexes()
-*/
-void QGLIndexBuffer::setIndexes(const QArray<ushort>& values)
-{
- Q_D(QGLIndexBuffer);
- if (d->buffer.isCreated()) {
- d->buffer.bind();
- d->buffer.allocate(values.constData(), values.size() * sizeof(ushort));
- d->buffer.release();
- // The element type may have changed from int to ushort.
- d->elementType = GL_UNSIGNED_SHORT;
- } else {
- d->indexesShort = values;
- d->elementType = GL_UNSIGNED_SHORT;
- d->indexesInt = QArray<uint>();
- }
- d->indexCount = values.size();
-}
-
-/*!
- Sets the index \a values in this index buffer, replacing the
- entire current contents.
-
- If the index buffer has been uploaded to the GL server, then this
- function must be called with a current GL context that is compatible
- with the uploaded buffer.
-
- OpenGL/ES systems usually do not support 32-bit index values unless
- they have a special extension for that purpose. On systems without
- 32-bit index values, this function will need to convert all values
- to 16-bit which may incur a performance penalty and lose information.
-
- \sa replaceIndexes()
-*/
-void QGLIndexBuffer::setIndexes(const QArray<uint>& values)
-{
- Q_D(QGLIndexBuffer);
- if (d->buffer.isCreated()) {
- if (d->hasIntBuffers) {
- d->buffer.bind();
- d->buffer.allocate(values.constData(), values.size() * sizeof(int));
- d->buffer.release();
- // The element type may have changed from ushort to int.
- d->elementType = GL_UNSIGNED_INT;
- } else {
- QArray<ushort> svalues = qt_qarray_uint_to_ushort(values);
- d->buffer.bind();
- d->buffer.allocate(svalues.constData(), svalues.size() * sizeof(ushort));
- d->buffer.release();
- }
- } else if (d->hasIntBuffers) {
- d->indexesInt = values;
- d->elementType = GL_UNSIGNED_INT;
- d->indexesShort = QArray<ushort>();
- } else {
- d->indexesShort = qt_qarray_uint_to_ushort(values);
- d->elementType = GL_UNSIGNED_SHORT;
- d->indexesInt = QArray<uint>();
- }
- d->indexCount = values.size();
-}
-
-/*!
- Replaces the elements of this index buffer, starting at \a index,
- with the contents of \a values. All other elements keep their
- current values.
-
- If the index buffer has been uploaded to the GL server, then this
- function must be called with a current GL context that is compatible
- with the uploaded buffer.
-
- The index buffer must have been originally created with the
- ushort element type.
-
- \sa setIndexes()
-*/
-void QGLIndexBuffer::replaceIndexes(int index, const QArray<ushort>& values)
-{
- Q_D(QGLIndexBuffer);
- Q_ASSERT_X(d->elementType == GL_UNSIGNED_SHORT,
- "QGLIndexBuffer::replaceIndexes()",
- "buffer created with int element type, replacing with ushort");
- if (d->elementType != GL_UNSIGNED_SHORT)
- return;
- if (d->buffer.isCreated()) {
- d->buffer.bind();
- d->buffer.write(index * sizeof(ushort),
- values.constData(), values.size() * sizeof(ushort));
- d->buffer.release();
- } else {
- d->indexesShort.replace(index, values.constData(), values.size());
- d->indexCount = d->indexesShort.size();
- }
-}
-
-/*!
- Replaces the elements of this index buffer, starting at \a index,
- with the contents of \a values. All other elements keep their
- current values.
-
- If the index buffer has been uploaded to the GL server, then this
- function must be called with a current GL context that is compatible
- with the uploaded buffer.
-
- The index buffer must have been originally created with the
- int element type.
-
- OpenGL/ES systems usually do not support 32-bit index values unless
- they have a special extension for that purpose. On systems without
- 32-bit index values, this function will need to convert all values
- to 16-bit which may incur a performance penalty and lose information.
-
- \sa setIndexes()
-*/
-void QGLIndexBuffer::replaceIndexes(int index, const QArray<uint>& values)
-{
- Q_D(QGLIndexBuffer);
- Q_ASSERT_X(d->elementType == GL_UNSIGNED_INT || !d->hasIntBuffers,
- "QGLIndexBuffer::replaceIndexes()",
- "buffer created with ushort element type, replacing with int");
- if (d->elementType != GL_UNSIGNED_INT && d->hasIntBuffers)
- return;
- if (d->buffer.isCreated()) {
- if (d->hasIntBuffers) {
- d->buffer.bind();
- d->buffer.write(index * sizeof(int),
- values.constData(), values.size() * sizeof(int));
- d->buffer.release();
- } else {
- QArray<ushort> svalues = qt_qarray_uint_to_ushort(values);
- d->buffer.bind();
- d->buffer.write(index * sizeof(ushort),
- svalues.constData(),
- svalues.size() * sizeof(ushort));
- d->buffer.release();
- }
- } else if (d->elementType == GL_UNSIGNED_INT) {
- d->indexesInt.replace(index, values.constData(), values.size());
- d->indexCount = d->indexesInt.size();
- } else {
- QArray<ushort> svalues = qt_qarray_uint_to_ushort(values);
- d->indexesShort.replace(index, svalues.constData(), svalues.size());
- d->indexCount = d->indexesShort.size();
- }
-}
-
-/*!
- Returns the element type for this index buffer, \c{GL_UNSIGNED_SHORT}
- or \c{GL_UNSIGNED_INT}.
-*/
-GLenum QGLIndexBuffer::elementType() const
-{
- Q_D(const QGLIndexBuffer);
- return d->elementType;
-}
-
-/*!
- Returns the number of indexes in this index buffer.
-*/
-int QGLIndexBuffer::indexCount() const
-{
- Q_D(const QGLIndexBuffer);
- return d->indexCount;
-}
-
-/*!
- \fn bool QGLIndexBuffer::isEmpty() const
-
- Returns true if indexCount() is zero; false otherwise.
-*/
-
-/*!
- Uploads the index data specified by a previous setIndexes()
- call into the GL server as an index buffer object.
-
- Returns true if the data could be uploaded; false if index buffer
- objects are not supported or there is insufficient memory to complete
- the request. Returns true if the data was already uploaded.
-
- Once the index data has been uploaded, the client-side copies of
- the data arrays will be released. If the index data could not be
- uploaded, then it is retained client-side. This way, regardless of
- whether the data could be uploaded or not, QGLPainter::draw() can
- be used to support drawing of primitives using this object.
-
- \sa isUploaded(), setIndexes(), QGLPainter::draw()
-*/
-bool QGLIndexBuffer::upload()
-{
- Q_D(QGLIndexBuffer);
- if (d->buffer.isCreated())
- return true;
- if (!d->buffer.create())
- return false;
- d->buffer.bind();
- if (d->elementType == GL_UNSIGNED_SHORT) {
- d->buffer.allocate(d->indexesShort.constData(),
- d->indexesShort.size() * sizeof(ushort));
- d->indexesShort = QArray<ushort>();
- } else {
- d->buffer.allocate(d->indexesInt.constData(),
- d->indexesInt.size() * sizeof(int));
- d->indexesInt = QArray<uint>();
- }
- d->buffer.release();
- return true;
-}
-
-/*!
- Returns true if the index data specified by previous a setIndexes()
- call has been uploaded into the GL server; false otherwise.
-
- \sa upload(), setIndexes()
-*/
-bool QGLIndexBuffer::isUploaded() const
-{
- Q_D(const QGLIndexBuffer);
- return d->buffer.isCreated();
-}
-
-/*!
- Returns the QGLBuffer in use by this index buffer object,
- so that its properties or contents can be modified directly.
-
- \sa isUploaded()
-*/
-QGLBuffer QGLIndexBuffer::buffer() const
-{
- Q_D(const QGLIndexBuffer);
- return d->buffer;
-}
-
-/*!
- Binds this index buffer to the current GL context. Returns false if
- binding was not possible, usually because upload() has not been called.
-
- The buffer must be bound to the same QGLContext current when upload()
- was called, or to another QGLContext that is sharing with it.
- Otherwise, false will be returned from this function.
-
- \sa release(), upload()
-*/
-bool QGLIndexBuffer::bind()
-{
- Q_D(QGLIndexBuffer);
- return d->buffer.bind();
-}
-
-/*!
- Releases this index buffer from the current GL context.
-
- This function must be called with the same QGLContext current
- as when bind() was called on the index buffer.
-
- \sa bind()
-*/
-void QGLIndexBuffer::release()
-{
- Q_D(QGLIndexBuffer);
- d->buffer.release();
-}
-
-void QGLIndexBufferPrivate::append
- (const QGLIndexBufferPrivate *other, uint offset, int start)
-{
- if (elementType == GL_UNSIGNED_SHORT &&
- other->elementType == GL_UNSIGNED_SHORT) {
- // Both buffers are ushort.
- const ushort *data = other->indexesShort.constData() + start;
- int count = other->indexesShort.count() - start;
- indexesShort.reserve(indexesShort.count() + count);
- indexCount += count;
- while (count-- > 0)
- indexesShort.append(ushort(*data++ + offset));
- } else if (elementType == GL_UNSIGNED_SHORT) {
- // Only first buffer is ushort: convert it to int first.
- const ushort *indexes = indexesShort.constData();
- int count = indexesShort.count();
- indexesInt.reserve(count + other->indexesInt.count());
- while (count-- > 0)
- indexesInt.append(*indexes++);
- indexesShort = QArray<ushort>();
- elementType = GL_UNSIGNED_INT;
- const uint *data = other->indexesInt.constData() + start;
- count = other->indexesInt.count() - start;
- indexCount += count;
- while (count-- > 0)
- indexesInt.append(*data++ + offset);
- } else if (other->elementType == GL_UNSIGNED_SHORT) {
- // Only second buffer is ushort.
- const ushort *data = other->indexesShort.constData() + start;
- int count = other->indexesShort.count() - start;
- indexesInt.reserve(indexesInt.count() + count);
- indexCount += count;
- while (count-- > 0)
- indexesInt.append(*data++ + offset);
- } else {
- // Neither buffer is ushort.
- const uint *data = other->indexesInt.constData() + start;
- int count = other->indexesInt.count() - start;
- indexesInt.reserve(indexesInt.count() + count);
- indexCount += count;
- while (count-- > 0)
- indexesInt.append(*data++ + offset);
- }
-}
-
-uint QGLIndexBufferPrivate::headIndex(int posn) const
-{
- if (indexCount <= posn)
- return uint(-1);
- if (elementType == GL_UNSIGNED_SHORT)
- return indexesShort[posn];
- else
- return indexesInt[posn];
-}
-
-uint QGLIndexBufferPrivate::tailIndex(int posn) const
-{
- if (indexCount <= posn)
- return uint(-1);
- if (elementType == GL_UNSIGNED_SHORT)
- return indexesShort[indexCount - posn - 1];
- else
- return indexesInt[indexCount - posn - 1];
-}
-
-/*!
- Appends the contents of \a buffer to this index buffer and adds
- \a offset to all of the entries in \a buffer.
-
- This function is typically used to combine multiple geometry meshes
- into a single mesh that can be bound as a single buffer.
-
- The request is ignored if this index buffer or \a buffer have already
- been uploaded, or \a buffer is this index buffer.
-
- \sa isUploaded(), setIndexes()
-*/
-void QGLIndexBuffer::append(const QGLIndexBuffer &buffer, uint offset)
-{
- Q_D(QGLIndexBuffer);
- const QGLIndexBufferPrivate *dbuf = buffer.d_ptr;
-
- // Bail out if the buffers are uploaded or identical.
- if (d->buffer.isCreated() || dbuf->buffer.isCreated())
- return;
- if (d == dbuf)
- return;
-
- // Append the two index arrays.
- d->append(dbuf, offset, 0);
-}
-
-/*!
- Appends the contents of \a buffer to this index buffer and adds
- \a offset to all of the entries in \a buffer.
-
- The two buffers will be merged at the join point according to
- \a combineMode. For example, if \a combineMode is QGL::TriangleStrip,
- then the result will be a single triangle strip. Indexes are
- dropped from the front of \a buffer as necessary to correctly
- merge the buffers.
-
- This function is typically used to combine multiple geometry meshes
- into a single mesh that can be bound as a single buffer.
-
- The request is ignored if this index buffer or \a buffer have already
- been uploaded, or \a buffer is this index buffer.
-
- \sa isUploaded(), setIndexes()
-*/
-void QGLIndexBuffer::append
- (const QGLIndexBuffer &buffer, uint offset, QGL::DrawingMode combineMode)
-{
- Q_D(QGLIndexBuffer);
- const QGLIndexBufferPrivate *dbuf = buffer.d_ptr;
-
- // Bail out if the buffers are uploaded or identical.
- if (d->buffer.isCreated() || dbuf->buffer.isCreated())
- return;
- if (d == dbuf)
- return;
-
- // Determine how to combine the buffers.
- switch (int(combineMode)) {
- case QGL::Points:
- case QGL::Lines:
- case QGL::Triangles:
- case QGL::LinesAdjacency:
- case QGL::TrianglesAdjacency:
- case 0x0007: // GL_QUADS
- // These can be done by just appending the raw data with no changes.
- d->append(dbuf, offset, 0);
- break;
-
- case QGL::LineLoop:
- case QGL::LineStrip:
- case 0x0009: // GL_POLYGON
- // Join the last index of the first buffer to the first
- // index of the second buffer to continue the loop or strip.
- if (d->tailIndex(0) == (dbuf->headIndex(0) + offset))
- d->append(dbuf, offset, 1);
- else
- d->append(dbuf, offset, 0);
- break;
-
- case QGL::TriangleStrip:
- // Join the last two indexes of the first buffer to the first
- // two indexes of the second buffer to continue the strip.
- // It is possible that the first two indexes of the second
- // buffer may be reversed for strip continuation depending
- // upon whether the first strip is odd or even in length.
- if (d->tailIndex(1) == (dbuf->headIndex(0) + offset) &&
- d->tailIndex(0) == (dbuf->headIndex(1) + offset))
- d->append(dbuf, offset, 2);
- else if (d->tailIndex(1) == (dbuf->headIndex(1) + offset) &&
- d->tailIndex(0) == (dbuf->headIndex(0) + offset))
- d->append(dbuf, offset, 2);
- else
- d->append(dbuf, offset, 0);
- break;
-
- case 0x0008: // GL_QUAD_STRIP
- // Join the last two indexes of the first buffer to the first
- // two indexes of the second buffer to continue the strip.
- if (d->tailIndex(1) == (dbuf->headIndex(0) + offset) &&
- d->tailIndex(0) == (dbuf->headIndex(1) + offset))
- d->append(dbuf, offset, 2);
- else
- d->append(dbuf, offset, 0);
- break;
-
- case QGL::TriangleFan:
- // The first index of both buffers should be the same, and the
- // last index of the first buffer should be the same as the second
- // index of the second buffer.
- if (d->headIndex(0) == (dbuf->headIndex(0) + offset) &&
- d->tailIndex(0) == (dbuf->headIndex(1) + offset))
- d->append(dbuf, offset, 2);
- else
- d->append(dbuf, offset, 0);
- break;
-
- case QGL::LineStripAdjacency:
- // Join the last three indexes of the first buffer to the first
- // three indexes of the second buffer to continue the strip.
- if (d->tailIndex(2) == (dbuf->headIndex(0) + offset) &&
- d->tailIndex(1) == (dbuf->headIndex(1) + offset) &&
- d->tailIndex(0) == (dbuf->headIndex(2) + offset))
- d->append(dbuf, offset, 3);
- else
- d->append(dbuf, offset, 0);
- break;
-
- case QGL::TriangleStripAdjacency:
- // Fourth last and second last of first buffer need to be the
- // same as the first and third of the second buffer.
- if (d->tailIndex(3) == (dbuf->headIndex(0) + offset) &&
- d->tailIndex(1) == (dbuf->headIndex(2) + offset))
- d->append(dbuf, offset, 4);
- else
- d->append(dbuf, offset, 0);
- break;
-
- default:
- qWarning("QGLIndexBuffer::append: unknown drawing mode 0x%04x",
- int(combineMode));
- break;
- }
-}
-
-/*!
- \overload
-
- Draws primitives using vertices from the arrays specified by
- setVertexAttribute(). The type of primitive to draw is
- specified by \a mode.
-
- This operation will consume all of the elements of \a indexes,
- which are used to index into the enabled arrays.
-
- If \a indexes has not been uploaded to the GL server as an index
- buffer, then this function will draw using a client-side array.
-
- \sa update(), QGLIndexBuffer::upload()
-*/
-void QGLPainter::draw(QGL::DrawingMode mode, const QGLIndexBuffer& indexes)
-{
- QGLIndexBufferPrivate *d = const_cast<QGLIndexBufferPrivate *>(indexes.d_func());
- update();
- GLuint id = d->buffer.bufferId();
- if (id != d_ptr->boundIndexBuffer) {
- if (id)
- d->buffer.bind();
- else
- QGLBuffer::release(QGLBuffer::IndexBuffer);
- d_ptr->boundIndexBuffer = id;
- }
- if (id) {
- glDrawElements(GLenum(mode), d->indexCount, d->elementType, 0);
- } else if (d->elementType == GL_UNSIGNED_SHORT) {
- glDrawElements(GLenum(mode), d->indexCount, GL_UNSIGNED_SHORT,
- d->indexesShort.constData());
- } else {
- glDrawElements(GLenum(mode), d->indexCount, GL_UNSIGNED_INT,
- d->indexesInt.constData());
- }
-}
-
-/*!
- \overload
-
- Draws primitives using vertices from the arrays specified by
- setVertexAttribute(). The type of primitive to draw is
- specified by \a mode.
-
- This operation will consume \a count elements of \a indexes,
- starting at \a offset, which are used to index into the enabled arrays.
-
- If \a indexes has not been uploaded to the GL server as an index
- buffer, then this function will draw using a client-side array.
-
- \sa update(), QGLIndexBuffer::upload()
-*/
-void QGLPainter::draw(QGL::DrawingMode mode, const QGLIndexBuffer& indexes, int offset, int count)
-{
- QGLIndexBufferPrivate *d = const_cast<QGLIndexBufferPrivate *>(indexes.d_func());
- update();
- GLuint id = d->buffer.bufferId();
- if (id != d_ptr->boundIndexBuffer) {
- if (id)
- d->buffer.bind();
- else
- QGLBuffer::release(QGLBuffer::IndexBuffer);
- d_ptr->boundIndexBuffer = id;
- }
- if (id) {
- if (d->elementType == GL_UNSIGNED_SHORT) {
- glDrawElements(GLenum(mode), count, GL_UNSIGNED_SHORT,
- reinterpret_cast<const void *>(offset * sizeof(ushort)));
- } else {
- glDrawElements(GLenum(mode), count, GL_UNSIGNED_INT,
- reinterpret_cast<const void *>(offset * sizeof(int)));
- }
- } else if (d->elementType == GL_UNSIGNED_SHORT) {
- glDrawElements(GLenum(mode), count, GL_UNSIGNED_SHORT,
- d->indexesShort.constData() + offset);
- } else {
- glDrawElements(GLenum(mode), count, GL_UNSIGNED_INT,
- d->indexesInt.constData() + offset);
- }
-}
-
-QT_END_NAMESPACE
diff --git a/src/threed/arrays/qglindexbuffer.h b/src/threed/arrays/qglindexbuffer.h
deleted file mode 100644
index e1a54971..00000000
--- a/src/threed/arrays/qglindexbuffer.h
+++ /dev/null
@@ -1,108 +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 QGLINDEXBUFFER_H
-#define QGLINDEXBUFFER_H
-
-#include <QtOpenGL/qgl.h>
-#include <QtOpenGL/qglbuffer.h>
-#include "qglnamespace.h"
-#include "qarray.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class QGLIndexBufferPrivate;
-class QGLPainter;
-
-class Q_QT3D_EXPORT QGLIndexBuffer
-{
-public:
- QGLIndexBuffer();
- QGLIndexBuffer(const QGLIndexBuffer& other);
- ~QGLIndexBuffer();
-
- QGLIndexBuffer& operator=(const QGLIndexBuffer& other);
-
- QGLBuffer::UsagePattern usagePattern() const;
- void setUsagePattern(QGLBuffer::UsagePattern value);
-
- QArray<ushort> indexesUShort() const;
- QArray<uint> indexesUInt() const;
-
- void setIndexes(const QArray<ushort>& values);
- void setIndexes(const QArray<uint>& values);
-
- void replaceIndexes(int index, const QArray<ushort>& values);
- void replaceIndexes(int index, const QArray<uint>& values);
-
- GLenum elementType() const;
-
- int indexCount() const;
- bool isEmpty() const { return indexCount() == 0; }
-
- bool upload();
- bool isUploaded() const;
-
- QGLBuffer buffer() const;
-
- bool bind();
- void release();
-
- void append(const QGLIndexBuffer &buffer, uint offset);
- void append(const QGLIndexBuffer &buffer, uint offset, QGL::DrawingMode combineMode);
-
-private:
- QGLIndexBufferPrivate *d_ptr;
-
- Q_DECLARE_PRIVATE(QGLIndexBuffer)
-
- friend class QGLPainter;
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/arrays/qglvertexbundle.cpp b/src/threed/arrays/qglvertexbundle.cpp
deleted file mode 100644
index f2e14b9d..00000000
--- a/src/threed/arrays/qglvertexbundle.cpp
+++ /dev/null
@@ -1,495 +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 "qglvertexbundle.h"
-#include "qglvertexbundle_p.h"
-#include "qglabstracteffect.h"
-#include <QtCore/qlist.h>
-#include <QtCore/qatomic.h>
-#include <QtOpenGL/qglshaderprogram.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGLVertexBundle
- \brief The QGLVertexBundle class bundles vertex attribute arrays for efficient uploading into a GL server.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::arrays
-
- QGLVertexBundle provides an implementation of a static vertex
- buffer, where the vertex attributes are supplied once at construction
- time and then never modified until the bundle is destroyed.
- When the vertex attributes are sent ot the GL server by upload(),
- they may be repacked for greater drawing efficiency.
-
- For general-purpose vertex buffers that can be allocated and modified
- in-place, use QGLBuffer instead.
-*/
-
-/*!
- Constructs a new vertex bundle.
-*/
-QGLVertexBundle::QGLVertexBundle()
- : d_ptr(new QGLVertexBundlePrivate())
-{
-}
-
-/*!
- Creates a copy of \a other. Note that this just copies a reference
- to the vertex bundle. Any modifications to the copy will also
- affect the original object.
-*/
-QGLVertexBundle::QGLVertexBundle(const QGLVertexBundle& other)
- : d_ptr(other.d_ptr)
-{
- d_ptr->ref.ref();
-}
-
-/*!
- Destroys this vertex bundle if this object is the last reference to it.
-*/
-QGLVertexBundle::~QGLVertexBundle()
-{
- if (!d_ptr->ref.deref())
- delete d_ptr;
-}
-
-/*!
- Assigns \a other to this object. Note that this just assigns a
- reference to the \a other vertex bundle. Any modifications to this
- object will also affect \a other.
-*/
-QGLVertexBundle& QGLVertexBundle::operator=(const QGLVertexBundle& other)
-{
- if (d_ptr != other.d_ptr) {
- if (!d_ptr->ref.deref())
- delete d_ptr;
- d_ptr = other.d_ptr;
- d_ptr->ref.ref();
- }
- return *this;
-}
-
-/*!
- Adds the floating-point array \a value to this vertex bundle as the
- data for \a attribute.
-
- \sa upload()
-*/
-void QGLVertexBundle::addAttribute
- (QGL::VertexAttribute attribute, const QArray<float>& value)
-{
- Q_D(QGLVertexBundle);
- if (!d->buffer.isCreated()) {
- d->attributeSet.insert(attribute);
- d->attributes +=
- new QGLVertexBundleFloatAttribute(attribute, value);
- d->vertexCount = qMax(d->vertexCount, value.count());
- }
-}
-
-/*!
- Adds the 2D vector array \a value to this vertex bundle as the
- data for \a attribute.
-
- \sa upload()
-*/
-void QGLVertexBundle::addAttribute
- (QGL::VertexAttribute attribute, const QArray<QVector2D>& value)
-{
- Q_D(QGLVertexBundle);
- if (!d->buffer.isCreated()) {
- d->attributeSet.insert(attribute);
- d->attributes +=
- new QGLVertexBundleVector2DAttribute(attribute, value);
- d->vertexCount = qMax(d->vertexCount, value.count());
- }
-}
-
-/*!
- Adds the 3D vector array \a value to this vertex bundle as the
- data for \a attribute.
-
- \sa upload()
-*/
-void QGLVertexBundle::addAttribute
- (QGL::VertexAttribute attribute, const QArray<QVector3D>& value)
-{
- Q_D(QGLVertexBundle);
- if (!d->buffer.isCreated()) {
- d->attributeSet.insert(attribute);
- d->attributes +=
- new QGLVertexBundleVector3DAttribute(attribute, value);
- d->vertexCount = qMax(d->vertexCount, value.count());
- }
-}
-
-/*!
- Adds the 4D vector array \a value to this vertex bundle as the
- data for \a attribute.
-
- \sa upload()
-*/
-void QGLVertexBundle::addAttribute
- (QGL::VertexAttribute attribute, const QArray<QVector4D>& value)
-{
- Q_D(QGLVertexBundle);
- if (!d->buffer.isCreated()) {
- d->attributeSet.insert(attribute);
- d->attributes +=
- new QGLVertexBundleVector4DAttribute(attribute, value);
- d->vertexCount = qMax(d->vertexCount, value.count());
- }
-}
-
-/*!
- Adds the color array \a value to this vertex bundle as the
- data for \a attribute.
-
- \sa upload()
-*/
-void QGLVertexBundle::addAttribute
- (QGL::VertexAttribute attribute, const QArray<QColor4ub>& value)
-{
- Q_D(QGLVertexBundle);
- if (!d->buffer.isCreated()) {
- d->attributeSet.insert(attribute);
- d->attributes +=
- new QGLVertexBundleColorAttribute(attribute, value);
- d->vertexCount = qMax(d->vertexCount, value.count());
- }
-}
-
-/*!
- Adds the custom data array \a value to this vertex bundle as the
- data for \a attribute.
-
- \sa upload()
-*/
-void QGLVertexBundle::addAttribute
- (QGL::VertexAttribute attribute, const QCustomDataArray& value)
-{
- Q_D(QGLVertexBundle);
- if (!d->buffer.isCreated()) {
- d->attributeSet.insert(attribute);
- d->attributes +=
- new QGLVertexBundleCustomAttribute(attribute, value);
- d->vertexCount = qMax(d->vertexCount, value.count());
- }
-}
-
-// Interleave a source array into a destination array.
-static void vertexBufferInterleave
- (float *dst, int dstStride, const float *src, int srcStride, int count)
-{
- switch (srcStride) {
- case 1:
- while (count-- > 0) {
- dst[0] = src[0];
- ++src;
- dst += dstStride;
- }
- break;
- case 2:
- while (count-- > 0) {
- dst[0] = src[0];
- dst[1] = src[1];
- src += 2;
- dst += dstStride;
- }
- break;
- case 3:
- while (count-- > 0) {
- dst[0] = src[0];
- dst[1] = src[1];
- dst[2] = src[2];
- src += 3;
- dst += dstStride;
- }
- break;
- case 4:
- while (count-- > 0) {
- dst[0] = src[0];
- dst[1] = src[1];
- dst[2] = src[2];
- dst[3] = src[3];
- src += 4;
- dst += dstStride;
- }
- break;
- default:
- while (count-- > 0) {
- for (int component = 0; component < srcStride; ++component)
- dst[component] = src[component];
- src += srcStride;
- dst += dstStride;
- }
- break;
- }
-}
-
-/*!
- Returns the set of attributes that are present in this vertex bundle.
-*/
-QGLAttributeSet QGLVertexBundle::attributes() const
-{
- Q_D(const QGLVertexBundle);
- return d->attributeSet;
-}
-
-/*!
- Returns the raw attribute value associated with \a attribute in
- this vertex bundle; null if \a attribute does not exist in the
- vertex bundle.
-
- If isUploaded() is true, then the returned value will contain a
- buffer offset to the attribute. If isUploaded() is false,
- then the returned value will contain a client-side data pointer
- to the attribute.
-
- \sa addAttribute()
-*/
-QGLAttributeValue QGLVertexBundle::attributeValue(QGL::VertexAttribute attribute) const
-{
- Q_D(const QGLVertexBundle);
- QGLVertexBundleAttribute *attr = 0;
- int attrIndex;
- for (attrIndex = 0; attrIndex < d->attributes.size(); ++attrIndex) {
- attr = d->attributes[attrIndex];
- if (attr->attribute == attribute)
- return attr->value;
- }
- return QGLAttributeValue();
-}
-
-/*!
- Returns the number of vertices that were defined by previous
- called to addAttribute().
-
- \sa addAttribute()
-*/
-int QGLVertexBundle::vertexCount() const
-{
- Q_D(const QGLVertexBundle);
- return d->vertexCount;
-}
-
-/*!
- \fn bool QGLVertexBundle::isEmpty() const
-
- Returns true if vertexCount() is zero; false otherwise.
-*/
-
-/*!
- Uploads the vertex data specified by previous addAttribute()
- calls into the GL server as a vertex buffer object.
-
- Returns true if the data could be uploaded; false if vertex buffer
- objects are not supported or there is insufficient memory to complete
- the request. Returns true if the data was already uploaded.
-
- Once the vertex data has been uploaded, the client-side copies of
- the data arrays will be released. If the vertex data could not be
- uploaded, then it is retained client-side. This way, regardless of
- whether the data could be uploaded or not, QGLPainter::setVertexBundle()
- can be used to support drawing of primitives using this object.
-
- \sa isUploaded(), addAttribute(), QGLPainter::setVertexBundle()
-*/
-bool QGLVertexBundle::upload()
-{
- Q_D(QGLVertexBundle);
- QGLVertexBundleAttribute *attr;
-
- // Nothing to do if already uploaded or there are no attributes.
- if (d->buffer.isCreated())
- return true;
- if (d->attributes.isEmpty())
- return false;
-
- // Create the VBO in the GL server and bind it.
- if (!d->buffer.create())
- return false;
- d->buffer.bind();
-
- // If there is only one attribute, then realloc and write in one step.
- if (d->attributes.size() == 1) {
- attr = d->attributes[0];
- d->buffer.allocate(attr->value.data(),
- attr->count() * attr->elementSize());
- attr->value.setOffset(0);
- attr->clear();
- d->buffer.release();
- return true;
- }
-
- // Calculate the total size of the VBO that we will need,
- // the maximum number of interleaved vertices, and the
- // interleaved stride.
- int size = 0;
- int stride = 0;
- int maxCount = 0;
- for (int index = 0; index < d->attributes.size(); ++index) {
- attr = d->attributes[index];
- int count = attr->count();
- if (count > maxCount)
- maxCount = count;
- int elemSize = attr->elementSize();
- size += count * elemSize;
- stride += elemSize;
- }
- int bufferSize = size;
- d->buffer.allocate(bufferSize);
- stride /= sizeof(float);
-
- // Determine how to upload the data, using a map if possible.
- // Interleave the data into the final buffer. We do it in
- // sections so as to keep locality problems to a minimum.
- void *mapped = d->buffer.map(QGLBuffer::WriteOnly);
- int offset = 0;
- QArray<float> temp;
- float *dst;
- if (mapped)
- dst = reinterpret_cast<float *>(mapped);
- else
- dst = temp.extend(1024);
- int sectionSize = 1024 / stride;
- for (int vertex = 0; vertex < maxCount; vertex += sectionSize) {
- int attrPosn = 0;
- for (int index = 0; index < d->attributes.size(); ++index) {
- attr = d->attributes[index];
- int count = attr->count() - vertex;
- if (count <= 0)
- continue;
- count = qMin(count, sectionSize);
- int components = attr->elementSize() / sizeof(float);
- vertexBufferInterleave
- (dst + attrPosn, stride,
- reinterpret_cast<const float *>(attr->value.data()) +
- vertex * components,
- components, count);
- attrPosn += attr->elementSize() / sizeof(float);
- }
- size = sectionSize * stride;
- if (mapped) {
- dst += size;
- } else {
- size *= sizeof(float);
- if ((offset + size) > bufferSize) // buffer overflow check
- size = bufferSize-offset;
- d->buffer.write(offset, dst, size);
- offset += size;
- }
- }
- offset = 0;
- for (int index = 0; index < d->attributes.size(); ++index) {
- attr = d->attributes[index];
- attr->value.setOffset(offset);
- attr->value.setStride(stride * sizeof(float));
- offset += attr->elementSize();
- attr->clear();
- }
- if (mapped)
- d->buffer.unmap();
-
- // Buffer is uploaded and ready to go.
- d->buffer.release();
- return true;
-}
-
-/*!
- Returns true if the vertex data specified by previous addAttribute()
- calls has been uploaded into the GL server; false otherwise.
-
- \sa upload(), addAttribute()
-*/
-bool QGLVertexBundle::isUploaded() const
-{
- Q_D(const QGLVertexBundle);
- return d->buffer.isCreated();
-}
-
-/*!
- Returns the QGLBuffer in use by this vertex bundle object,
- so that its properties or contents can be modified directly.
-
- \sa isUploaded()
-*/
-QGLBuffer QGLVertexBundle::buffer() const
-{
- Q_D(const QGLVertexBundle);
- return d->buffer;
-}
-
-/*!
- Binds the vertex buffer associated with this bundle to the current GL
- context. Returns false if binding was not possible, usually because
- upload() has not been called.
-
- The buffer must be bound to the same QGLContext current when upload()
- was called, or to another QGLContext that is sharing with it.
- Otherwise, false will be returned from this function.
-
- \sa release(), upload()
-*/
-bool QGLVertexBundle::bind()
-{
- Q_D(QGLVertexBundle);
- return d->buffer.bind();
-}
-
-/*!
- Releases the vertex buffer associated with this bundle from the
- current GL context.
-
- This function must be called with the same QGLContext current
- as when bind() was called on the vertex buffer.
-
- \sa bind()
-*/
-void QGLVertexBundle::release()
-{
- Q_D(QGLVertexBundle);
- d->buffer.release();
-}
-
-QT_END_NAMESPACE
diff --git a/src/threed/arrays/qglvertexbundle.h b/src/threed/arrays/qglvertexbundle.h
deleted file mode 100644
index fb978eb4..00000000
--- a/src/threed/arrays/qglvertexbundle.h
+++ /dev/null
@@ -1,111 +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 QGLVERTEXBUNDLE_H
-#define QGLVERTEXBUNDLE_H
-
-#include <QtOpenGL/qglbuffer.h>
-#include "qcustomdataarray.h"
-#include "qglattributevalue.h"
-#include "qglattributeset.h"
-#include <QtCore/qlist.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class QGLVertexBundlePrivate;
-class QGLPainter;
-class QGLAbstractEffect;
-class QGLShaderProgram;
-
-class Q_QT3D_EXPORT QGLVertexBundle
-{
-public:
- QGLVertexBundle();
- QGLVertexBundle(const QGLVertexBundle& other);
- ~QGLVertexBundle();
-
- QGLVertexBundle& operator=(const QGLVertexBundle& other);
-
- void addAttribute(QGL::VertexAttribute attribute,
- const QArray<float>& value);
- void addAttribute(QGL::VertexAttribute attribute,
- const QArray<QVector2D>& value);
- void addAttribute(QGL::VertexAttribute attribute,
- const QArray<QVector3D>& value);
- void addAttribute(QGL::VertexAttribute attribute,
- const QArray<QVector4D>& value);
- void addAttribute(QGL::VertexAttribute attribute,
- const QArray<QColor4ub>& value);
- void addAttribute(QGL::VertexAttribute attribute,
- const QCustomDataArray& value);
-
- QGLAttributeSet attributes() const;
-
- QGLAttributeValue attributeValue(QGL::VertexAttribute attribute) const;
-
- int vertexCount() const;
- bool isEmpty() const { return vertexCount() == 0; }
-
- bool upload();
- bool isUploaded() const;
-
- QGLBuffer buffer() const;
-
- bool bind();
- void release();
-
-private:
- QGLVertexBundlePrivate *d_ptr;
-
- Q_DECLARE_PRIVATE(QGLVertexBundle)
-
- friend class QGLPainter;
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/arrays/qglvertexbundle_p.h b/src/threed/arrays/qglvertexbundle_p.h
deleted file mode 100644
index eb4672fe..00000000
--- a/src/threed/arrays/qglvertexbundle_p.h
+++ /dev/null
@@ -1,216 +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 QGLVERTEXBUNDLE_P_H
-#define QGLVERTEXBUNDLE_P_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 "qglvertexbundle.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-class QGLVertexBundleAttribute
-{
-public:
- QGLVertexBundleAttribute(QGL::VertexAttribute attr) : attribute(attr) {}
- virtual ~QGLVertexBundleAttribute() {}
-
- virtual void clear() = 0;
- virtual QGLAttributeValue uploadValue() = 0;
- virtual int count() = 0;
- virtual int elementSize() = 0;
-
- QGL::VertexAttribute attribute;
- QGLAttributeValue value;
-};
-
-class QGLVertexBundleFloatAttribute : public QGLVertexBundleAttribute
-{
-public:
- QGLVertexBundleFloatAttribute
- (QGL::VertexAttribute attr, const QArray<float>& array)
- : QGLVertexBundleAttribute(attr), floatArray(array)
- {
- value = QGLAttributeValue(floatArray);
- }
-
- void clear() { floatArray.clear(); }
- QGLAttributeValue uploadValue()
- { return QGLAttributeValue(floatArray); }
- int count() { return floatArray.count(); }
- int elementSize() { return sizeof(float); }
-
- QArray<float> floatArray;
-};
-
-class QGLVertexBundleVector2DAttribute : public QGLVertexBundleAttribute
-{
-public:
- QGLVertexBundleVector2DAttribute
- (QGL::VertexAttribute attr, const QArray<QVector2D>& array)
- : QGLVertexBundleAttribute(attr), vector2DArray(array)
- {
- value = QGLAttributeValue(vector2DArray);
- }
-
- void clear() { vector2DArray.clear(); }
- QGLAttributeValue uploadValue()
- { return QGLAttributeValue(vector2DArray); }
- int count() { return vector2DArray.count(); }
- int elementSize() { return sizeof(QVector2D); }
-
- QArray<QVector2D> vector2DArray;
-};
-
-class QGLVertexBundleVector3DAttribute : public QGLVertexBundleAttribute
-{
-public:
- QGLVertexBundleVector3DAttribute
- (QGL::VertexAttribute attr, const QArray<QVector3D>& array)
- : QGLVertexBundleAttribute(attr), vector3DArray(array)
- {
- value = QGLAttributeValue(vector3DArray);
- }
-
- void clear() { vector3DArray.clear(); }
- QGLAttributeValue uploadValue()
- { return QGLAttributeValue(vector3DArray); }
- int count() { return vector3DArray.count(); }
- int elementSize() { return sizeof(QVector3D); }
-
- QArray<QVector3D> vector3DArray;
-};
-
-class QGLVertexBundleVector4DAttribute : public QGLVertexBundleAttribute
-{
-public:
- QGLVertexBundleVector4DAttribute
- (QGL::VertexAttribute attr, const QArray<QVector4D>& array)
- : QGLVertexBundleAttribute(attr), vector4DArray(array)
- {
- value = QGLAttributeValue(vector4DArray);
- }
-
- void clear() { vector4DArray.clear(); }
- QGLAttributeValue uploadValue()
- { return QGLAttributeValue(vector4DArray); }
- int count() { return vector4DArray.count(); }
- int elementSize() { return sizeof(QVector4D); }
-
- QArray<QVector4D> vector4DArray;
-};
-
-class QGLVertexBundleColorAttribute : public QGLVertexBundleAttribute
-{
-public:
- QGLVertexBundleColorAttribute
- (QGL::VertexAttribute attr, const QArray<QColor4ub>& array)
- : QGLVertexBundleAttribute(attr), colorArray(array)
- {
- value = QGLAttributeValue(colorArray);
- }
-
- void clear() { colorArray.clear(); }
- QGLAttributeValue uploadValue()
- { return QGLAttributeValue(colorArray); }
- int count() { return colorArray.count(); }
- int elementSize() { return sizeof(QColor4ub); }
-
- QArray<QColor4ub> colorArray;
-};
-
-class QGLVertexBundleCustomAttribute : public QGLVertexBundleAttribute
-{
-public:
- QGLVertexBundleCustomAttribute
- (QGL::VertexAttribute attr, const QCustomDataArray& array)
- : QGLVertexBundleAttribute(attr), customArray(array)
- {
- value = QGLAttributeValue(customArray);
- }
-
- void clear() { customArray.clear(); }
- QGLAttributeValue uploadValue()
- { return QGLAttributeValue(customArray); }
- int count() { return customArray.count(); }
- int elementSize() { return customArray.elementSize(); }
-
- QCustomDataArray customArray;
-};
-
-class QGLVertexBundlePrivate
-{
-public:
- QGLVertexBundlePrivate()
- : buffer(QGLBuffer::VertexBuffer),
- vertexCount(0)
- {
- ref = 1;
- }
- ~QGLVertexBundlePrivate()
- {
- qDeleteAll(attributes);
- }
-
- QBasicAtomicInt ref;
- QGLBuffer buffer;
- QList<QGLVertexBundleAttribute *> attributes;
- int vertexCount;
- QGLAttributeSet attributeSet;
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/arrays/qvector2darray.cpp b/src/threed/arrays/qvector2darray.cpp
deleted file mode 100644
index 2617cb5f..00000000
--- a/src/threed/arrays/qvector2darray.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 "qvector2darray.h"
-#include <QtGui/qmatrix4x4.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QVector2DArray
- \brief The QVector2DArray class is a convenience for wrapping a QArray of QVector2D values.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::arrays
-
- QVector2DArray is used to build an array of 2D vector values
- based on floating-point x and y arguments:
-
- \code
- QVector2DArray array;
- array.append(1.0f, 2.0f);
- array.append(-1.0f, 2.0f);
- array.append(1.0f, -2.0f);
- \endcode
-
- This is more convenient and readable than the equivalent with
- QArray:
-
- \code
- QArray<QVector2D> array;
- array.append(QVector2D(1.0f, 2.0f));
- array.append(QVector2D(-1.0f, 2.0f));
- array.append(QVector2D(1.0f, -2.0f));
- \endcode
-
- QVector2DArray also has convenience functions for transforming
- the contents of the array with translate(), translated(),
- transform(), and transformed().
-
- \sa QArray, QVector3DArray, QVector4DArray
-*/
-
-/*!
- \fn QVector2DArray::QVector2DArray()
-
- Constructs an empty array of QVector2D values.
-*/
-
-/*!
- \fn QVector2DArray::QVector2DArray(int size, const QVector2D& value)
-
- Constructs an array of QVector2D values with an initial \a size.
- All elements in the array are initialized to \a value.
-*/
-
-/*!
- \fn QVector2DArray::QVector2DArray(const QArray<QVector2D>& other)
-
- Constructs a copy of \a other.
-*/
-
-/*!
- \fn void QVector2DArray::append(qreal x, qreal y)
- \overload
-
- Appends (\a x, \a y) to this array of QVector2D values.
-*/
-
-/*!
- \fn void QVector2DArray::append(const QPointF& point)
- \overload
-
- Appends \a point to this array of QVector2D values.
-*/
-
-/*!
- \fn void QVector2DArray::append(const QPoint& point);
- \overload
-
- Appends \a point to this array of QVector2D values.
-*/
-
-/*!
- Multiplies the elements in this array of QVector2D values by
- the \a scale.
-
- \sa scaled()
-*/
-void QVector2DArray::scale(qreal scale)
-{
- if (isDetached()) {
- // Modify the array in-place.
- int size = count();
- QVector2D *dst = data();
- for (int index = 0; index < size; ++index)
- *dst++ *= scale;
- } else {
- // Create a new array, translate the values, and assign.
- QArray<QVector2D> result;
- int size = count();
- const QVector2D *src = constData();
- QVector2D *dst = result.extend(size);
- for (int index = 0; index < size; ++index)
- *dst++ = *src++ * scale;
- *this = result;
- }
-}
-
-/*!
- Returns a copy of this array of QVector2D values, multiplied
- by the \a scale.
-
- \sa scale()
-*/
-QVector2DArray QVector2DArray::scaled(qreal scale) const
-{
- const qreal identity = 1.0;
- if (qFuzzyCompare(scale, identity))
- return *this;
- QArray<QVector2D> result;
- int size = count();
- const QVector2D *src = constData();
- QVector2D *dst = result.extend(size);
- for (int index = 0; index < size; ++index)
- *dst++ = *src++ * scale;
- return result;
-}
-
-/*!
- Translates the elements in this array of QVector2D values
- by the components of \a value.
-
- \sa translated()
-*/
-void QVector2DArray::translate(const QVector2D& value)
-{
- if (isDetached()) {
- // Modify the array in-place.
- int size = count();
- QVector2D *dst = data();
- for (int index = 0; index < size; ++index)
- *dst++ += value;
- } else {
- // Create a new array, translate the values, and assign.
- QArray<QVector2D> result;
- int size = count();
- const QVector2D *src = constData();
- QVector2D *dst = result.extend(size);
- for (int index = 0; index < size; ++index)
- *dst++ = *src++ + value;
- *this = result;
- }
-}
-
-/*!
- \fn void QVector2DArray::translate(qreal x, qreal y)
- \overload
-
- Translates the elements in this array of QVector2D values
- by (\a x, \a y).
-
- \sa translated()
-*/
-
-/*!
- Returns a copy of this array of QVector2D values, translated
- by the components of \a value.
-
- \sa translate()
-*/
-QArray<QVector2D> QVector2DArray::translated(const QVector2D& value) const
-{
- QArray<QVector2D> result;
- int size = count();
- QVector2D *dst = result.extend(size);
- const QVector2D *src = constData();
- for (int index = 0; index < size; ++index)
- *dst++ = *src++ + value;
- return result;
-}
-
-/*!
- \fn QArray<QVector2D> QVector2DArray::translated(qreal x, qreal y) const
- \overload
-
- Returns a copy of this array of QVector2D values, translated
- by (\a x, \a y).
-
- \sa translate()
-*/
-
-/*!
- Transforms the elements in this array of QVector2D values
- by \a matrix.
-
- \sa transformed()
-*/
-void QVector2DArray::transform(const QMatrix4x4& matrix)
-{
- if (isDetached()) {
- // Modify the array in-place.
- int size = count();
- QVector2D *dst = data();
- for (int index = 0; index < size; ++index) {
- *dst = (matrix * QVector3D(*dst, 0.0f)).toVector2D();
- ++dst;
- }
- } else {
- // Create a new array, transform the values, and assign.
- QArray<QVector2D> result;
- int size = count();
- const QVector2D *src = constData();
- QVector2D *dst = result.extend(size);
- for (int index = 0; index < size; ++index)
- *dst++ = (matrix * QVector3D(*src++, 0.0f)).toVector2D();
- *this = result;
- }
-}
-
-/*!
- Returns a copy of this array of QVector2D values,
- transformed by \a matrix.
-
- \sa transform()
-*/
-QArray<QVector2D> QVector2DArray::transformed(const QMatrix4x4& matrix) const
-{
- QArray<QVector2D> result;
- int size = count();
- const QVector2D *src = constData();
- QVector2D *dst = result.extend(size);
- for (int index = 0; index < size; ++index)
- *dst++ = (matrix * QVector3D(*src++, 0.0f)).toVector2D();
- return result;
-}
-
-QT_END_NAMESPACE
diff --git a/src/threed/arrays/qvector2darray.h b/src/threed/arrays/qvector2darray.h
deleted file mode 100644
index df6087ff..00000000
--- a/src/threed/arrays/qvector2darray.h
+++ /dev/null
@@ -1,124 +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 QVECTOR2DARRAY_H
-#define QVECTOR2DARRAY_H
-
-#include "qarray.h"
-#include <QtGui/qvector2d.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class QMatrix4x4;
-
-class Q_QT3D_EXPORT QVector2DArray : public QArray<QVector2D>
-{
-public:
- QVector2DArray();
- QVector2DArray(int size, const QVector2D& value = QVector2D());
- QVector2DArray(const QArray<QVector2D>& other);
-
- void append(qreal x, qreal y);
- void append(const QPointF& point);
- void append(const QPoint& point);
-
- void scale(qreal scale);
- QVector2DArray scaled(qreal scale) const;
-
- void translate(const QVector2D& value);
- void translate(qreal x, qreal y);
-
- QArray<QVector2D> translated(const QVector2D& value) const;
- QArray<QVector2D> translated(qreal x, qreal y) const;
-
- void transform(const QMatrix4x4& matrix);
- QArray<QVector2D> transformed(const QMatrix4x4& matrix) const;
-
-#if !defined(Q_NO_USING_KEYWORD) || defined(Q_QDOC)
- using QArray<QVector2D>::append;
-#else
- inline void append(const QVector2D& value)
- { QArray<QVector2D>::append(value); }
- inline void append(const QVector2D& value1, const QVector2D& value2)
- { QArray<QVector2D>::append(value1, value2); }
- inline void append(const QVector2D& value1, const QVector2D& value2, const QVector2D& value3)
- { QArray<QVector2D>::append(value1, value2, value3); }
- inline void append(const QVector2D& value1, const QVector2D& value2, const QVector2D& value3, const QVector2D& value4)
- { QArray<QVector2D>::append(value1, value2, value3, value4); }
- inline void append(const QVector2D *values, int count)
- { QArray<QVector2D>::append(values, count); }
- inline void append(const QArray<QVector2D>& other)
- { QArray<QVector2D>::append(other); }
-#endif
-};
-
-inline QVector2DArray::QVector2DArray() {}
-
-inline QVector2DArray::QVector2DArray(int size, const QVector2D& value)
- : QArray<QVector2D>(size, value) {}
-
-inline QVector2DArray::QVector2DArray(const QArray<QVector2D>& other)
- : QArray<QVector2D>(other) {}
-
-inline void QVector2DArray::append(qreal x, qreal y)
- { QArray<QVector2D>::append(QVector2D(x, y)); }
-
-inline void QVector2DArray::append(const QPointF& point)
- { QArray<QVector2D>::append(QVector2D(point)); }
-
-inline void QVector2DArray::append(const QPoint& point)
- { QArray<QVector2D>::append(QVector2D(point)); }
-
-inline void QVector2DArray::translate(qreal x, qreal y)
- { translate(QVector2D(x, y)); }
-
-inline QArray<QVector2D> QVector2DArray::translated(qreal x, qreal y) const
- { return translated(QVector2D(x, y)); }
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/arrays/qvector3darray.cpp b/src/threed/arrays/qvector3darray.cpp
deleted file mode 100644
index f72dda46..00000000
--- a/src/threed/arrays/qvector3darray.cpp
+++ /dev/null
@@ -1,257 +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 "qvector3darray.h"
-#include <QtGui/qmatrix4x4.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QVector3DArray
- \brief The QVector3DArray class is a convenience for wrapping a QArray of QVector3D values.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::arrays
-
- QVector3DArray is used to build an array of 3D vector values
- based on floating-point x, y, and z arguments:
-
- \code
- QVector3DArray array;
- array.append(1.0f, 2.0f, 3.0f);
- array.append(-1.0f, 2.0f, 3.0f);
- array.append(1.0f, -2.0f, 3.0f);
- \endcode
-
- This is more convenient and readable than the equivalent with
- QArray:
-
- \code
- QArray<QVector3D> array;
- array.append(QVector3D(1.0f, 2.0f, 3.0f));
- array.append(QVector3D(-1.0f, 2.0f, 3.0f));
- array.append(QVector3D(1.0f, -2.0f, 3.0f));
- \endcode
-
- QVector3DArray also has convenience functions for transforming
- the contents of the array with translate(), translated(),
- transform(), and transformed().
-
- \sa QArray, QVector2DArray, QVector4DArray
-*/
-
-/*!
- \fn QVector3DArray::QVector3DArray()
-
- Constructs an empty array of QVector3D values.
-*/
-
-/*!
- \fn QVector3DArray::QVector3DArray(int size, const QVector3D& value)
-
- Constructs an array of QVector3D values with an initial \a size.
- All elements in the array are initialized to \a value.
-*/
-
-/*!
- \fn QVector3DArray::QVector3DArray(const QArray<QVector3D>& other)
-
- Constructs a copy of \a other.
-*/
-
-/*!
- \fn void QVector3DArray::append(qreal x, qreal y, qreal z)
-
- Appends (\a x, \a y, \a z) to this array of QVector3D values.
-*/
-
-/*!
- Multiplies the elements in this array of QVector3D values by
- the \a scale.
-
- \sa scaled()
-*/
-void QVector3DArray::scale(qreal scale)
-{
- if (isDetached()) {
- // Modify the array in-place.
- int size = count();
- QVector3D *dst = data();
- for (int index = 0; index < size; ++index)
- *dst++ *= scale;
- } else {
- // Create a new array, translate the values, and assign.
- QArray<QVector3D> result;
- int size = count();
- const QVector3D *src = constData();
- QVector3D *dst = result.extend(size);
- for (int index = 0; index < size; ++index)
- *dst++ = *src++ * scale;
- *this = result;
- }
-}
-
-/*!
- Returns a copy of this array of QVector3D values, multiplied
- by the \a scale.
-
- \sa scale()
-*/
-QVector3DArray QVector3DArray::scaled(qreal scale) const
-{
- QArray<QVector3D> result;
- int size = count();
- const QVector3D *src = constData();
- QVector3D *dst = result.extend(size);
- for (int index = 0; index < size; ++index)
- *dst++ = *src++ * scale;
- return result;
-}
-
-/*!
- Translates the elements in this array of QVector3D values
- by the components of \a value.
-
- \sa translated()
-*/
-void QVector3DArray::translate(const QVector3D& value)
-{
- if (isDetached()) {
- // Modify the array in-place.
- int size = count();
- QVector3D *dst = data();
- for (int index = 0; index < size; ++index)
- *dst++ += value;
- } else {
- // Create a new array, translate the values, and assign.
- QArray<QVector3D> result;
- int size = count();
- const QVector3D *src = constData();
- QVector3D *dst = result.extend(size);
- for (int index = 0; index < size; ++index)
- *dst++ = *src++ + value;
- *this = result;
- }
-}
-
-/*!
- \fn void QVector3DArray::translate(qreal x, qreal y, qreal z)
- \overload
-
- Translates the elements in this array of QVector3D values
- by (\a x, \a y, \a z).
-
- \sa translated()
-*/
-
-/*!
- Returns a copy of this array of QVector3D values, translated
- by the components of \a value.
-
- \sa translate()
-*/
-QArray<QVector3D> QVector3DArray::translated(const QVector3D& value) const
-{
- QArray<QVector3D> result;
- int size = count();
- const QVector3D *src = constData();
- QVector3D *dst = result.extend(size);
- for (int index = 0; index < size; ++index)
- *dst++ = *src++ + value;
- return result;
-}
-
-/*!
- \fn QArray<QVector3D> QVector3DArray::translated(qreal x, qreal y, qreal z) const
- \overload
-
- Returns a copy of this array of QVector3D values, translated
- by (\a x, \a y, \a z).
-
- \sa translate()
-*/
-
-/*!
- Transforms the elements in this array of QVector3D values
- by \a matrix.
-
- \sa transformed()
-*/
-void QVector3DArray::transform(const QMatrix4x4& matrix)
-{
- if (isDetached()) {
- // Modify the array in-place.
- int size = count();
- QVector3D *dst = data();
- for (int index = 0; index < size; ++index) {
- *dst = matrix * *dst;
- ++dst;
- }
- } else {
- // Create a new array, transform the values, and assign.
- QArray<QVector3D> result;
- int size = count();
- const QVector3D *src = constData();
- QVector3D *dst = result.extend(size);
- for (int index = 0; index < size; ++index)
- *dst++ = matrix * *src++;
- *this = result;
- }
-}
-
-/*!
- Returns a copy of this array of QVector3D values, transformed
- by \a matrix.
-
- \sa transform()
-*/
-QArray<QVector3D> QVector3DArray::transformed(const QMatrix4x4& matrix) const
-{
- QArray<QVector3D> result;
- int size = count();
- const QVector3D *src = constData();
- QVector3D *dst = result.extend(size);
- for (int index = 0; index < size; ++index)
- *dst++ = matrix * *src++;
- return result;
-}
-
-QT_END_NAMESPACE
diff --git a/src/threed/arrays/qvector3darray.h b/src/threed/arrays/qvector3darray.h
deleted file mode 100644
index acab2538..00000000
--- a/src/threed/arrays/qvector3darray.h
+++ /dev/null
@@ -1,116 +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 QVECTOR3DARRAY_H
-#define QVECTOR3DARRAY_H
-
-#include "qarray.h"
-#include <QtGui/qvector3d.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class QMatrix4x4;
-
-class Q_QT3D_EXPORT QVector3DArray : public QArray<QVector3D>
-{
-public:
- QVector3DArray();
- QVector3DArray(int size, const QVector3D& value = QVector3D());
- QVector3DArray(const QArray<QVector3D>& other);
-
- void append(qreal x, qreal y, qreal z);
-
- void scale(qreal scale);
- QVector3DArray scaled(qreal scale) const;
-
- void translate(const QVector3D& value);
- void translate(qreal x, qreal y, qreal z);
-
- QArray<QVector3D> translated(const QVector3D& value) const;
- QArray<QVector3D> translated(qreal x, qreal y, qreal z) const;
-
- void transform(const QMatrix4x4& matrix);
- QArray<QVector3D> transformed(const QMatrix4x4& matrix) const;
-
-#if !defined(Q_NO_USING_KEYWORD) || defined(Q_QDOC)
- using QArray<QVector3D>::append;
-#else
- inline void append(const QVector3D& value)
- { QArray<QVector3D>::append(value); }
- inline void append(const QVector3D& value1, const QVector3D& value2)
- { QArray<QVector3D>::append(value1, value2); }
- inline void append(const QVector3D& value1, const QVector3D& value2, const QVector3D& value3)
- { QArray<QVector3D>::append(value1, value2, value3); }
- inline void append(const QVector3D& value1, const QVector3D& value2, const QVector3D& value3, const QVector3D& value4)
- { QArray<QVector3D>::append(value1, value2, value3, value4); }
- inline void append(const QVector3D *values, int count)
- { QArray<QVector3D>::append(values, count); }
- inline void append(const QArray<QVector3D>& other)
- { QArray<QVector3D>::append(other); }
-#endif
-};
-
-inline QVector3DArray::QVector3DArray() {}
-
-inline QVector3DArray::QVector3DArray(int size, const QVector3D& value)
- : QArray<QVector3D>(size, value) {}
-
-inline QVector3DArray::QVector3DArray(const QArray<QVector3D>& other)
- : QArray<QVector3D>(other) {}
-
-inline void QVector3DArray::append(qreal x, qreal y, qreal z)
- { QArray<QVector3D>::append(QVector3D(x, y, z)); }
-
-inline void QVector3DArray::translate(qreal x, qreal y, qreal z)
- { translate(QVector3D(x, y, z)); }
-
-inline QArray<QVector3D> QVector3DArray::translated(qreal x, qreal y, qreal z) const
- { return translated(QVector3D(x, y, z)); }
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/arrays/qvector4darray.cpp b/src/threed/arrays/qvector4darray.cpp
deleted file mode 100644
index df06ba97..00000000
--- a/src/threed/arrays/qvector4darray.cpp
+++ /dev/null
@@ -1,257 +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 "qvector4darray.h"
-#include <QtGui/qmatrix4x4.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QVector4DArray
- \brief The QVector4DArray class is a convenience for wrapping a QArray of QVector4D values.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::arrays
-
- QVector4DArray is used to build an array of 4D vector values
- based on floating-point x, y, and z arguments:
-
- \code
- QVector4DArray array;
- array.append(1.0f, 2.0f, 3.0f, -4.0f);
- array.append(-1.0f, 2.0f, 3.0f, -4.0f);
- array.append(1.0f, -2.0f, 3.0f, -4.0f);
- \endcode
-
- This is more convenient and readable than the equivalent with
- QArray:
-
- \code
- QArray<QVector4D> array;
- array.append(QVector4D(1.0f, 2.0f, 3.0f, -4.0f));
- array.append(QVector4D(-1.0f, 2.0f, 3.0f, -4.0f));
- array.append(QVector4D(1.0f, -2.0f, 3.0f, -4.0f));
- \endcode
-
- QVector4DArray also has convenience functions for transforming
- the contents of the array with translate(), translated(),
- transform(), and transformed().
-
- \sa QArray, QVector2DArray, QVector3DArray
-*/
-
-/*!
- \fn QVector4DArray::QVector4DArray()
-
- Constructs an empty array of QVector4D values.
-*/
-
-/*!
- \fn QVector4DArray::QVector4DArray(int size, const QVector4D& value)
-
- Constructs an array of QVector4D values with an initial \a size.
- All elements in the array are initialized to \a value.
-*/
-
-/*!
- \fn QVector4DArray::QVector4DArray(const QArray<QVector4D>& other)
-
- Constructs a copy of \a other.
-*/
-
-/*!
- \fn void QVector4DArray::append(qreal x, qreal y, qreal z, qreal w)
-
- Appends (\a x, \a y, \a z, \a w) to this array of QVector4D values.
-*/
-
-/*!
- Multiplies the elements in this array of QVector4D values by
- the \a scale.
-
- \sa scaled()
-*/
-void QVector4DArray::scale(qreal scale)
-{
- if (isDetached()) {
- // Modify the array in-place.
- int size = count();
- QVector4D *dst = data();
- for (int index = 0; index < size; ++index)
- *dst++ *= scale;
- } else {
- // Create a new array, translate the values, and assign.
- QArray<QVector4D> result;
- int size = count();
- const QVector4D *src = constData();
- QVector4D *dst = result.extend(size);
- for (int index = 0; index < size; ++index)
- *dst++ = *src++ * scale;
- *this = result;
- }
-}
-
-/*!
- Returns a copy of this array of QVector4D values, multiplied
- by the \a scale.
-
- \sa scale()
-*/
-QVector4DArray QVector4DArray::scaled(qreal scale) const
-{
- QArray<QVector4D> result;
- int size = count();
- const QVector4D *src = constData();
- QVector4D *dst = result.extend(size);
- for (int index = 0; index < size; ++index)
- *dst++ = *src++ * scale;
- return result;
-}
-
-/*!
- Translates the elements in this array of QVector4D values
- by the components of \a value.
-
- \sa translated()
-*/
-void QVector4DArray::translate(const QVector4D& value)
-{
- if (isDetached()) {
- // Modify the array in-place.
- int size = count();
- QVector4D *dst = data();
- for (int index = 0; index < size; ++index)
- *dst++ += value;
- } else {
- // Create a new array, translate the values, and assign.
- QArray<QVector4D> result;
- int size = count();
- const QVector4D *src = constData();
- QVector4D *dst = result.extend(size);
- for (int index = 0; index < size; ++index)
- *dst++ = *src++ + value;
- *this = result;
- }
-}
-
-/*!
- \fn void QVector4DArray::translate(qreal x, qreal y, qreal z, qreal w);
- \overload
-
- Translates the elements in this array of QVector4D values
- by (\a x, \a y, \a z, \a w).
-
- \sa translated()
-*/
-
-/*!
- Returns a copy of this array of QVector4D values, translated
- by the components of \a value.
-
- \sa translate()
-*/
-QArray<QVector4D> QVector4DArray::translated(const QVector4D& value) const
-{
- QArray<QVector4D> result;
- int size = count();
- const QVector4D *src = constData();
- QVector4D *dst = result.extend(size);
- for (int index = 0; index < size; ++index)
- *dst++ = *src++ + value;
- return result;
-}
-
-/*!
- \fn QArray<QVector4D> QVector4DArray::translated(qreal x, qreal y, qreal z, qreal w) const
- \overload
-
- Returns a copy of this array of QVector4D values, translated
- by (\a x, \a y, \a z, \a w).
-
- \sa translate()
-*/
-
-/*!
- Transforms the elements in this array of QVector4D values
- by \a matrix.
-
- \sa transformed()
-*/
-void QVector4DArray::transform(const QMatrix4x4& matrix)
-{
- if (isDetached()) {
- // Modify the array in-place.
- int size = count();
- QVector4D *dst = data();
- for (int index = 0; index < size; ++index) {
- *dst = matrix * *dst;
- ++dst;
- }
- } else {
- // Create a new array, transform the values, and assign.
- QArray<QVector4D> result;
- int size = count();
- const QVector4D *src = constData();
- QVector4D *dst = result.extend(size);
- for (int index = 0; index < size; ++index)
- *dst++ = matrix * *src++;
- *this = result;
- }
-}
-
-/*!
- Returns a copy of this array of QVector3D values, transformed
- by \a matrix.
-
- \sa transform()
-*/
-QArray<QVector4D> QVector4DArray::transformed(const QMatrix4x4& matrix) const
-{
- QArray<QVector4D> result;
- int size = count();
- const QVector4D *src = constData();
- QVector4D *dst = result.extend(size);
- for (int index = 0; index < size; ++index)
- *dst++ = matrix * *src++;
- return result;
-}
-
-QT_END_NAMESPACE
diff --git a/src/threed/arrays/qvector4darray.h b/src/threed/arrays/qvector4darray.h
deleted file mode 100644
index 4d215fad..00000000
--- a/src/threed/arrays/qvector4darray.h
+++ /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$
-**
-****************************************************************************/
-
-#ifndef QVECTOR4DARRAY_H
-#define QVECTOR4DARRAY_H
-
-#include "qarray.h"
-#include <QtGui/qvector4d.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class QMatrix4x4;
-
-class Q_QT3D_EXPORT QVector4DArray : public QArray<QVector4D>
-{
-public:
- QVector4DArray();
- QVector4DArray(int size, const QVector4D& value = QVector4D());
- QVector4DArray(const QArray<QVector4D>& other);
-
- void append(qreal x, qreal y, qreal z, qreal w);
-
- void scale(qreal scale);
- QVector4DArray scaled(qreal scale) const;
-
- void translate(const QVector4D& value);
- void translate(qreal x, qreal y, qreal z, qreal w);
-
- QArray<QVector4D> translated(const QVector4D& value) const;
- QArray<QVector4D> translated
- (qreal x, qreal y, qreal z, qreal w) const;
-
- void transform(const QMatrix4x4& matrix);
- QArray<QVector4D> transformed(const QMatrix4x4& matrix) const;
-
-#if !defined(Q_NO_USING_KEYWORD) || defined(Q_QDOC)
- using QArray<QVector4D>::append;
-#else
- inline void append(const QVector4D& value)
- { QArray<QVector4D>::append(value); }
- inline void append(const QVector4D& value1, const QVector4D& value2)
- { QArray<QVector4D>::append(value1, value2); }
- inline void append(const QVector4D& value1, const QVector4D& value2, const QVector4D& value3)
- { QArray<QVector4D>::append(value1, value2, value3); }
- inline void append(const QVector4D& value1, const QVector4D& value2, const QVector4D& value3, const QVector4D& value4)
- { QArray<QVector4D>::append(value1, value2, value3, value4); }
- inline void append(const QVector4D *values, int count)
- { QArray<QVector4D>::append(values, count); }
- inline void append(const QArray<QVector4D>& other)
- { QArray<QVector4D>::append(other); }
-#endif
-};
-
-inline QVector4DArray::QVector4DArray() {}
-
-inline QVector4DArray::QVector4DArray(int size, const QVector4D& value)
- : QArray<QVector4D>(size, value) {}
-
-inline QVector4DArray::QVector4DArray(const QArray<QVector4D>& other)
- : QArray<QVector4D>(other) {}
-
-inline void QVector4DArray::append(qreal x, qreal y, qreal z, qreal w)
- { QArray<QVector4D>::append(QVector4D(x, y, z, w)); }
-
-inline void QVector4DArray::translate(qreal x, qreal y, qreal z, qreal w)
- { translate(QVector4D(x, y, z, w)); }
-
-inline QArray<QVector4D> QVector4DArray::translated
- (qreal x, qreal y, qreal z, qreal w) const
- { return translated(QVector4D(x, y, z, w)); }
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/effects/effects.pri b/src/threed/effects/effects.pri
deleted file mode 100644
index 2afeca52..00000000
--- a/src/threed/effects/effects.pri
+++ /dev/null
@@ -1,26 +0,0 @@
-
-INCLUDEPATH += $$PWD
-VPATH += $$PWD
-
-HEADERS += \
- effects/qglshaderprogrameffect.h \
- effects/qglcolladafxeffectfactory.h \
- effects/qglcolladafxeffect.h \
- effects/qglcolladafxeffectloader.h
-
-SOURCES += \
- qglflatcoloreffect.cpp \
- qglflattextureeffect.cpp \
- qgllitmaterialeffect.cpp \
- qgllittextureeffect.cpp \
- qglshaderprogrameffect.cpp \
- qglcolladafxeffect.cpp \
- qglcolladafxeffectfactory.cpp \
- qglcolladafxeffectloader.cpp
-
-PRIVATE_HEADERS += \
- qglflatcoloreffect_p.h \
- qglflattextureeffect_p.h \
- qgllitmaterialeffect_p.h \
- qgllittextureeffect_p.h \
- qglcolladafxeffect_p.h
diff --git a/src/threed/effects/qglcolladafxeffect.cpp b/src/threed/effects/qglcolladafxeffect.cpp
deleted file mode 100644
index 665c0ea7..00000000
--- a/src/threed/effects/qglcolladafxeffect.cpp
+++ /dev/null
@@ -1,410 +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 <QString>
-#include <QXmlStreamReader>
-#include <QFile>
-#include <QDebug>
-#include <QImage>
-#include "qgl.h"
-#include "qgltexture2d.h"
-#include "qglcolladafxeffect.h"
-#include "qglcolladafxeffect_p.h"
-
-QT_BEGIN_NAMESPACE
-
-QGLColladaFxEffect::QGLColladaFxEffect() : QGLShaderProgramEffect()
- , d( new QGLColladaFxEffectPrivate )
-{
-}
-
-QGLColladaFxEffect::QGLColladaFxEffect(const QGLColladaFxEffect&) : QGLShaderProgramEffect()
-{
- Q_ASSERT(false);
-};
-
-
-QGLColladaFxEffect::~QGLColladaFxEffect()
-{
- delete d;
-}
-
-
-
-QGLColladaFxEffectPrivate::QGLColladaFxEffectPrivate() : id()
- , sid()
- , name()
- , emissiveTexture(0)
- , ambientTexture(0)
- , diffuseTexture(0)
- , specularTexture(0)
- , lighting(QGLColladaFxEffect::NoLighting)
- , material(0)
-{
- resetGlueSnippets();
-}
-
-
-
-QGLColladaFxEffectPrivate::~QGLColladaFxEffectPrivate()
-{
- delete emissiveTexture;
- emissiveTexture = 0;
- delete ambientTexture;
- ambientTexture = 0;
- delete diffuseTexture;
- diffuseTexture = 0;
- delete specularTexture;
- specularTexture = 0;
- delete material;
- material = 0;
-
-}
-
-
-
-inline void QGLColladaFxEffectPrivate::updateMaterialChannelSnippets(QString channelName, QGLTexture2D* texture, int* textureUnit, QColor fallbackColor)
-{
- QString qVariableName = QLatin1String("q") + channelName;
- if (texture != 0)
- {
- QString sourceVariableName = QLatin1String("texture") + channelName;
- QString texVariableName = QString(QLatin1String("texCoord%1")).arg(*textureUnit);
- // Take care of texture coordinates
- QString varyingSnippet = QString(QLatin1String("varying vec4 %1;")).arg(texVariableName);
- vertexShaderDeclarationSnippets.append(varyingSnippet);
- vertexShaderVariableNames.append(texVariableName);
- fragmentShaderDeclarationSnippets.append(varyingSnippet);
- fragmentShaderVariableNames.append(texVariableName);
-
- vertexShaderCodeSnippets.append(QString(QLatin1String("%1 = texCoords; // TODO: dynamically add tex attributes\n")).arg(texVariableName));
- vertexShaderVariableNames.append(texVariableName);
-
- // Declare the color variable in the fragment shader
- fragmentShaderDeclarationSnippets.append(QString(QLatin1String("lowp vec4 %1;")).arg(qVariableName));
- fragmentShaderVariableNames.append(qVariableName);
- fragmentShaderDeclarationSnippets.append(QString(QLatin1String("uniform sampler2D %1;")).arg(sourceVariableName));
- fragmentShaderVariableNames.append(sourceVariableName);
-
- // Assign a colour to the variable out of the appropriate sampler
- fragmentShaderCodeSnippets.append(QLatin1String(" mediump vec4 ") + qVariableName + QLatin1String(" = texture2D(") + sourceVariableName + QLatin1String(", ") + texVariableName + QLatin1String(".st);"));
- fragmentShaderVariableNames.append(qVariableName);
- // mediump? lowp?
-
- *textureUnit++;
- } else {
- fragmentShaderDeclarationSnippets.append(QString (QLatin1String("const vec4 %1 = vec4(%2, %3, %4, %5);")).arg( qVariableName).arg(fallbackColor.redF(), 0, 'f', 6).arg(fallbackColor.greenF(), 0, 'f', 6).arg(fallbackColor.blueF(), 0, 'f', 6).arg(fallbackColor.alphaF(), 0, 'f', 6 ));
- fragmentShaderVariableNames.append(qVariableName);
- }
-}
-
-
-
-inline void QGLColladaFxEffectPrivate::setTextureUniform(QGLShaderProgram *program, QGLPainter* painter, QString channelName, QGLTexture2D* texture, int* textureUnit, QColor fallbackColor)
-{
- QString qVariableName = QLatin1String("q") + channelName;
-
- if (texture != 0)
- {
- QString sourceVariableName = QLatin1String("texture") + channelName;
- QString texVariableName = QString(QLatin1String("texCoord%1")).arg(*textureUnit);
- painter->glActiveTexture(GL_TEXTURE0 + *textureUnit);
- texture->bind();
- program->setUniformValue(sourceVariableName.toAscii().data(), *textureUnit);
- }
- else
- {
- // It's just a const value, so set it that way in the fragment shader.
- program->setUniformValue(qVariableName.toAscii().data(), fallbackColor);
- }
-}
-
-
-
-void QGLColladaFxEffect::update(QGLPainter *painter, QGLPainter::Updates updates)
-{
- QGLShaderProgramEffect::update(painter, updates);
-
- if (updates && QGLPainter::UpdateMaterials)
- {
-
- if (program() == 0)
- {
- qWarning() << "no program in QGLColladaFxEffect::update()";
- return;
- }
-
- // Start from texture unit 1 so as not to stomp a texture set on the
- // painter.
- int textureUnit = 1;
- d->setTextureUniform(
- program(), painter, QLatin1String("Emissive"), d->emissiveTexture,
- &textureUnit,
- material() ? material()->emittedLight() : QColor());
-
- d->setTextureUniform(
- program(), painter, QLatin1String("Ambient"), d->ambientTexture, &textureUnit,
- material() ? material()->ambientColor() : QColor());
-
- d->setTextureUniform(
- program(), painter, QLatin1String("Diffuse"), d->diffuseTexture, &textureUnit,
- material() ? material()->diffuseColor() : QColor());
-
- d->setTextureUniform(
- program(), painter, QLatin1String("Specular"), d->specularTexture,
- &textureUnit,
- material() ? material()->specularColor() : QColor());
- }
-}
-
-
-
-void QGLColladaFxEffect::setId(QString id)
-{
- d->id = id;
-}
-
-
-
-QString QGLColladaFxEffect::id()
-{
- return d->id;
-}
-
-
-
-void QGLColladaFxEffect::setSid(QString sid)
-{
- d->sid = sid;
-}
-
-
-
-void QGLColladaFxEffectPrivate::addMaterialChannelsToShaderSnippets(const QGLMaterial *material)
-{
- int textureUnit = 1;
-
- updateMaterialChannelSnippets(QLatin1String("Emissive"), emissiveTexture, &textureUnit, material->emittedLight());
- updateMaterialChannelSnippets(QLatin1String("Ambient"), ambientTexture, &textureUnit, material->ambientColor());
- updateMaterialChannelSnippets(QLatin1String("Diffuse"), diffuseTexture, &textureUnit, material->diffuseColor());
- updateMaterialChannelSnippets(QLatin1String("Specular"), specularTexture, &textureUnit, material->specularColor());
-}
-
-
-
-void QGLColladaFxEffect::addBlinnPhongLighting()
-{
- d->addMaterialChannelsToShaderSnippets(material());
-
- // Fragment shader declarations:
- d->fragmentShaderDeclarationSnippets.append(QLatin1String("uniform mediump sampler2D texture0;"));
- d->fragmentShaderVariableNames.append(QLatin1String("texture0"));
- d->fragmentShaderDeclarationSnippets.append(QLatin1String("varying highp vec4 qt_TexCoord0;"));
- d->fragmentShaderVariableNames.append(QLatin1String("qt_TexCoord0"));
-
- // Fragment Shader code
- d->fragmentShaderCodeSnippets.append(QLatin1String(
- " vec4 specularComponent = vec4( 0.0, 0.0, 0.0, 0.0 );\n"\
- " if (intensity > 0.0)\n"\
- " {\n"\
- " float specularIntensity = max( dot(perPixelNormal, qHalfVector), 0.0 );\n"\
- " if (specularIntensity > 0.0)\n"\
- " specularComponent = qSpecular * pow(specularIntensity, shininess);\n"\
- " }\n"));
- d->fragmentShaderVariableNames.append(QLatin1String("lighting"));
-
-
- // Replace the "end glue" to set colour from lighting
- d->fragmentShaderEndGlueSnippet = QLatin1String(
- " vec4 texture0Color = texture2D(texture0, qt_TexCoord0.st);\n"\
- " vec4 diffuseColor = qDiffuse;\n"\
- " vec4 lightingColor = qAmbient + diffuseColor * intensity + specularComponent;\n"\
- " vec4 texturedColor = vec4(lightingColor.xyz * (1.0 - texture0Color.a)\n"\
- "+ (texture0Color.xyz + specularComponent.rgb) * texture0Color.a, lightingColor.a);\n"\
- " gl_FragColor = texturedColor;\n"\
- "}");
- generateShaders();
-}
-
-
-
-void QGLColladaFxEffect::generateShaders()
-{
- if (vertexShader().isEmpty())
- {
- QString shader =
- d->vertexShaderDeclarationSnippets.join(QLatin1String("\n"))
- + QLatin1String("\n") + d->vertexShaderMainGlueSnippet
- + d->vertexShaderCodeSnippets.join(QLatin1String("\n"))
- + QLatin1String("\n") + d->vertexShaderEndGlueSnippet;
- setVertexShader(shader.toLatin1());
- }
-
- if (fragmentShader().isEmpty())
- {
- QString shader =
- d->fragmentShaderDeclarationSnippets.join(QLatin1String("\n"))
- + QLatin1String("\n") + d->fragmentShaderMainGlueSnippet
- + d->fragmentShaderCodeSnippets.join(QLatin1String("\n"))
- + QLatin1String("\n") + d->fragmentShaderEndGlueSnippet;
- setFragmentShader(shader.toLatin1());
- }
-}
-
-
-
-void QGLColladaFxEffectPrivate::resetGlueSnippets()
-{
- vertexShaderMainGlueSnippet = QLatin1String(
- "attribute highp vec4 vertex;\n"\
- "attribute highp vec4 normal;\n"\
- "attribute highp vec4 texCoords;\n"\
- "uniform highp mat4 matrix;\n"\
- "uniform highp mat3 qt_NormalMatrix;\n"\
- "varying mediump vec3 qNormal;\n"\
- "varying mediump vec3 qLightDirection;\n"\
- "varying mediump vec3 qHalfVector;\n"\
- "uniform mediump vec3 pli; // Position of the light\n"\
- "varying highp vec4 qt_TexCoord0; // TEMP\n" /* Got to get rid of this*/\
- "\n"\
- "void qLightVertex(vec4 vertex, vec3 normal)\n"\
- "{\n"\
- " vec3 toEye;\n"\
- " qLightDirection = normalize(pli);\n"\
- " toEye = vec3(0, 0, 1); // assume viewer at infinity\n"\
- " qHalfVector = normalize(qLightDirection + toEye);\n"\
- "}\n"\
- "\n"\
- "void main(void)\n"\
- "{\n"\
- " qNormal = normalize(qt_NormalMatrix * vec3(normal));\n"\
- " qLightVertex(vertex, qNormal);\n"\
- " qt_TexCoord0 = texCoords;\n"\
- );
-
- vertexShaderEndGlueSnippet = QLatin1String (
- " gl_Position = matrix * vertex;\n"\
- "}\n");
-
-
- fragmentShaderEndGlueSnippet = QLatin1String(
- " gl_FragColor = color;\n"\
- "}\n"
- );
-
- fragmentShaderMainGlueSnippet = QLatin1String(
- "varying mediump vec3 qNormal;\n"\
- "varying mediump vec3 qLightDirection;\n"\
- "varying mediump vec3 qHalfVector;\n"\
- "uniform float shininess;\n"\
- "uniform vec4 color;\n"\
- "vec3 perPixelNormal;"
- "\n"\
- "void main()\n"\
- "{\n"\
- " perPixelNormal = normalize(qNormal);\n"\
- " float intensity = max(dot(perPixelNormal, qLightDirection), 0.0);\n"
- );
-}
-
-
-
-QString QGLColladaFxEffect::sid()
-{
- return d->sid;
-}
-
-
-
-QGLTexture2D* QGLColladaFxEffect::diffuseTexture()
-{
- return d->diffuseTexture;
-}
-
-
-void QGLColladaFxEffect::setLighting(int lighting)
-{
- d->lighting = lighting;
-}
-
-int QGLColladaFxEffect::lighting()
-{
- return d->lighting;
-}
-
-/*!
- Sets this effect to use \a newMaterial. If \a newMaterial is 0, sets this
- effect to have no material, and instead use whatever material is set
- on the QGLPainter.
-
- \sa QGLPainter, material()
-*/
-void QGLColladaFxEffect::setMaterial(QGLMaterial* newMaterial)
-{
- d->material = newMaterial;
-}
-
-/*!
- Returns a pointer to the material of this effect. If the effect has no material,
- this function returns 0;
-*/
-QGLMaterial* QGLColladaFxEffect::material()
-{
- return d->material;
-}
-
-/*!
- Returns true if the effect is currently active (applied to a QGLPainter)
- and false if it is not.
- */
-bool QGLColladaFxEffect::isActive()
-{
- return d->currentlyActive;
-}
-
-void QGLColladaFxEffect::setActive(QGLPainter *painter, bool flag)
-{
- d->currentlyActive = flag && !vertexShader().isEmpty() &&
- !fragmentShader().isEmpty();
- QGLShaderProgramEffect::setActive(painter, d->currentlyActive);
-}
-
-QT_END_NAMESPACE
diff --git a/src/threed/effects/qglcolladafxeffect.h b/src/threed/effects/qglcolladafxeffect.h
deleted file mode 100644
index 9486ec04..00000000
--- a/src/threed/effects/qglcolladafxeffect.h
+++ /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$
-**
-****************************************************************************/
-
-#ifndef QGLCOLLADAEFFECT_H
-#define QGLCOLLADAEFFECT_H
-
-#include <QStack>
-#include <QList>
-#include <QGLShaderProgram>
-#include "qglshaderprogrameffect.h"
-
-QT_BEGIN_NAMESPACE
-
-class QXmlStreamReader;
-class QGLColladaParam;
-class QGLColladaFxEffectPrivate;
-
-class Q_QT3D_EXPORT QGLColladaFxEffect : public QGLShaderProgramEffect
-{
- friend class QGLColladaFxEffectFactory;
-
-public:
- enum Lighting
- {
- NoLighting,
- BlinnLighting,
- PhongLighting,
- ConstantLighting,
- LambertLighting,
- CustomLighting
- };
-
- QGLColladaFxEffect();
- ~QGLColladaFxEffect();
- void update(QGLPainter *painter, QGLPainter::Updates updates);
- void generateShaders();
- void addBlinnPhongLighting();
-
- void setId(QString);
- void setSid(QString);
- QString id();
- QString sid();
-
- void setLighting(int lighting);
- int lighting();
- void setMaterial(QGLMaterial* newMaterial);
- QGLMaterial* material();
-
- QGLTexture2D* diffuseTexture();
-
- bool isActive();
- void setActive(QGLPainter *painter, bool flag);
-private:
- QGLColladaFxEffect(const QGLColladaFxEffect&);
- QGLColladaFxEffectPrivate* d;
-};
-
-QT_END_NAMESPACE
-
-#endif // QGLCOLLADAEFFECT_H
diff --git a/src/threed/effects/qglcolladafxeffect_p.h b/src/threed/effects/qglcolladafxeffect_p.h
deleted file mode 100644
index cf7dae2f..00000000
--- a/src/threed/effects/qglcolladafxeffect_p.h
+++ /dev/null
@@ -1,111 +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 QGLCOLLADAFXEFFECT_P_H
-#define QGLCOLLADAFXEFFECT_P_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 <QString>
-#include <QMap>
-#include <QColor>
-#include "qgltexture2d.h"
-#include "qglcolladafxeffect.h"
-
-QT_BEGIN_NAMESPACE
-
-class QGLPainter;
-class QGLShaderProgram;
-class QGLMaterial;
-
-class QGLColladaFxEffectPrivate
-{
- friend class QGLColladaFxEffectFactory;
-public:
- QGLColladaFxEffectPrivate();
- ~QGLColladaFxEffectPrivate();
-
- void addMaterialChannelsToShaderSnippets(const QGLMaterial *material);
- void resetGlueSnippets();
- void setTextureUniform(QGLShaderProgram *program, QGLPainter* painter, QString channelName, QGLTexture2D* texture, int* textureUnit, QColor fallbackColor);
- void updateMaterialChannelSnippets(QString channelName, QGLTexture2D* texture, int* textureUnit, QColor fallbackColor);
-
- QString id;
- QString sid;
- QString name;
-
- // The spec allows for 3D textures as well, but for now only 2D is
- // supported
- QGLTexture2D* emissiveTexture;
- QGLTexture2D* ambientTexture;
- QGLTexture2D* diffuseTexture;
- QGLTexture2D* specularTexture;
- int lighting;
- QGLMaterial* material;
-
- QStringList vertexShaderCodeSnippets;
- QStringList vertexShaderDeclarationSnippets;
- QStringList vertexShaderVariableNames;
-
- QStringList fragmentShaderCodeSnippets;
- QStringList fragmentShaderDeclarationSnippets;
- QStringList fragmentShaderVariableNames;
-
- QString vertexShaderEndGlueSnippet;
- QString vertexShaderMainGlueSnippet;
- QString fragmentShaderEndGlueSnippet;
- QString fragmentShaderMainGlueSnippet;
-
- bool currentlyActive;
-};
-
-QT_END_NAMESPACE
-
-#endif // QGLCOLLADAFXEFFECT_P_H
diff --git a/src/threed/effects/qglcolladafxeffectfactory.cpp b/src/threed/effects/qglcolladafxeffectfactory.cpp
deleted file mode 100644
index 192c2dc0..00000000
--- a/src/threed/effects/qglcolladafxeffectfactory.cpp
+++ /dev/null
@@ -1,1694 +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 <QVector>
-#include <QFile>
-#include <QFileInfo>
-#include <QTime>
-#include <QDir>
-#include "qgltexture2d.h"
-#include "qgl.h"
-
-#include "qglcolladafxeffect.h"
-#include "qglcolladafxeffectfactory.h"
-//#include "qglcolladafxeffectfactory_p.h"
-#include "qglcolladafxeffect_p.h"
-
-QT_BEGIN_NAMESPACE
-
-// The QGLColladaFxFactory class creates a list of QGLColladaFx objects from
-// COLLADA FX information according to the 1.4.1 March 2008 Release from
-// http://www.khronos.org/collada/
-
-//#define DEBUG_QGL_COLLADA_PARSING
-//#define DEBUG_MATERIALS
-
-#define INDENT_SIZE 4
-
-static int QGLColladaIndentLevel = 0;
-
-// This is a simple RAII helper class to conveniently indent across
-// various functions when building up the collada elements.
-// Instantiate an indent to increment the indent level with that scope.
-// add an indent object to the beginning of a string to indent it
-// the correct amount.
-class Indent
-{
-public:
- static int currentIndent() { return QGLColladaIndentLevel; };
- Indent()
- {
- ++QGLColladaIndentLevel;
- };
- ~Indent()
- {
- --QGLColladaIndentLevel;
- }
-};
-
-QString operator +(Indent&, QString string)
-{
- return QString(QGLColladaIndentLevel * INDENT_SIZE, QLatin1Char(' ')) + string;
-}
-
-QString operator +(char c, Indent&)
-{
- return QLatin1Char(c) + QString(QGLColladaIndentLevel * INDENT_SIZE, QLatin1Char(' '));
-}
-
-// xml convenience function - find the first end tag with the given tagname
-// Note that this is not as smart as xml.skipCurrentElement(), and does
-// not handle the case where (grand)children node share tagName
-// With this caveat, can be called from within any (grand)child node.
-static inline void findEndTag( QXmlStreamReader& xml, QString tagName )
-{
- while ( !xml.atEnd() && !( xml.tokenType() == xml.EndElement && xml.name() == tagName))
- {
- xml.readNext();
- }
-}
-
-
-
-/*!
- \internal
- Convenience function to find parameters in \a resultState that have an id,
- sid, or name that is equal to \a stringToMatch
- Note that this using this is not in line with the Collada specification,
- and that non-unique sids will always return the last parameter parsed.
- */
-static inline QVariant findParameterVariant(ResultState* resultState, QString stringToMatch)
-{
- QVariant result = resultState->paramSids.value(stringToMatch);
-
- if ( result.isNull() )
- result = resultState->paramIds.value(stringToMatch);
-
- if ( result.isNull() )
- result = resultState->paramNames.value(stringToMatch);
-
- return result;
-}
-
-/*!
- Parse a collada 1.4 or 1.5 .dae file \a fileName, find the effects in the
- library_effects element, and convert these into a list of QGLColladaFxEffect objects
- suitable for use with Qt3D. Specific effects can be identified out of
- this list using their sid.
-
- This is the only function intended to be called from outside this class, e.g.:
-
- QList<QGLColladaFxEffect*> colladaEffects = QGLColladaFxEffectFactory::loadEffectsFromFile("myColladaFile.dae");
-
- \sa QGLColladaFxEffect
-*/
-QList<QGLColladaFxEffect*> QGLColladaFxEffectFactory::loadEffectsFromFile( const QString& fileName )
-{
- QFile file( fileName );
- if ( !file.open( QIODevice::ReadOnly ))
- {
- qWarning() << "Warning: QGLColladaFxEffect failed to open file" << fileName;
- return QList<QGLColladaFxEffect*>();
- }
-
-
- QXmlStreamReader xml;
- xml.setDevice( &file );
- if (xml.tokenType() == QXmlStreamReader::Invalid)
- file.readLine();
- xml.setDevice( &file );
-
- QFileInfo fileInfo(file);
-
- return loadEffectsFromXml( xml, fileInfo.dir() );
-}
-
-
-
-QString QGLColladaFxEffectFactory::exportEffect(QGLColladaFxEffect *effect, QString effectId, QString techniqueSid)
-{
- QStringList result;
-
- result += QLatin1String("<?xml version=\"1.0\"?>");
-
- result += QLatin1String("<COLLADA "\
- "xmlns=\"http://www.collada.org/2005/11/COLLADASchema\" version=\"1.5.0\" >");
-
- {
- Indent indent;
- result += indent + QLatin1String("<asset>");
- {
- Indent indent;
- QDateTime time = QDateTime::currentDateTime();
- result += indent + QLatin1String("<created>") + time.toString(Qt::ISODate) + QLatin1String("</created>");
- result += indent + QLatin1String("<modified>") + time.toString(Qt::ISODate) + QLatin1String("</modified>");
- }
- result += indent + QLatin1String("</asset>");
-
- result += indent + QLatin1String("<library_effects>");
- {
- Indent indent;
- result += indent + QLatin1String("<effect id=\"") + effectId + QLatin1String("\">");
- result += glslProfileFromEffect(effect, techniqueSid);
- result += indent + QLatin1String("</effect>");
- }
- result += indent + QLatin1String("</library_effects>");
- result += QLatin1String("</COLLADA>");
- return result.join(QLatin1String("\n"));
- }
-}
-
-
-/*!
- \internal
- parse the top level \a xml from a .dae file and process the library_effects elements therein.
-*/
-QList<QGLColladaFxEffect*> QGLColladaFxEffectFactory::loadEffectsFromXml( QXmlStreamReader& xml, QDir homeDirectory )
-{
- ResultState resultState;
- resultState.sourceDir = homeDirectory;
- QList<QGLColladaFxEffect*> result;
-
- while ( !xml.atEnd() ) {
- xml.readNextStartElement();
- if ( xml.name() == "library_effects" ) {
- result += processLibraryEffectsElement( xml , &resultState );
- } else if (xml.name() == "library_images")
- {
- processLibraryImagesElement( xml, &resultState );
- }
- }
-
- // Try and resolve outstanding textures
- QList<QGLTexture2D*> unresolvedTexturePointers = resultState.unresolvedTexture2Ds.keys();
- for (int i = 0; i < unresolvedTexturePointers.count(); i++)
- {
- QGLTexture2D* texture = unresolvedTexturePointers[i];
- QString parameterName = resultState.unresolvedTexture2Ds.value(texture);
- resolveTexture2DImage(texture, &resultState, parameterName);
- }
- return result;
-}
-
-
-
-QGLColladaParam::~QGLColladaParam()
-{
-
-}
-
-
-
-/*!
- \internal
-*/
-int QGLColladaParam::type()
-{
- return mType;
-}
-
-
-
-/*!
- \internal
-*/
-QString QGLColladaParam::sid()
-{
- return mSid;
-}
-
-
-
-/*!
- \internal
-*/
-QVector<float> QGLColladaParam::value() {
- return mValue;
-}
-
-
-
-/*!
- \internal
-*/
-QGLColladaParam::QGLColladaParam(QString sid, int type) : mSid(sid)
- , mType(type)
-{
-}
-
-
-
-/*!
- \internal
-*/
-QString QGLColladaParam::id()
-{
- return mId;
-}
-
-
-
-/*!
- \internal
-*/
-QString QGLColladaParam::typeString(int type)
-{
- const char* typeStringArray[] = {
- "UnkownType",
- "Sampler2DType",
- "Texture2DType",
- "SurfaceType",
- "ImageType"};
-
- if (type >= UserDefinedType)
- return QLatin1String("UserDefinedType");
- else if ( type < 0 || type > ImageType)
- return QLatin1String("Unrecognized Type");
- else
- return QLatin1String(typeStringArray[type]);
-}
-
-
-
-/*!
- \internal
-*/
-QGLColladaTextureParam::QGLColladaTextureParam(QString sid, QGLTexture2D* texture) : QGLColladaParam(sid, Texture2DType)
-{
- mTexture = texture;
-}
-
-
-
-/*!
- \internal
-*/
-QGLTexture2D* QGLColladaTextureParam::texture()
-{
- Q_ASSERT( mType == Sampler2DType || mType == Texture2DType);
- return mTexture;
-}
-
-
-
-/*!
- \internal
-*/
-QString QGLColladaTextureParam::samplerSid()
-{
- return sampler2DSid;
-}
-
-
-
-/*!
- \internal
-*/
-QGLColladaFxEffectFactory::QGLColladaFxEffectFactory()
-{
-}
-
-
-
-/*!
- \internal
-*/
-QGLColladaSampler2DParam::QGLColladaSampler2DParam(QString sid, QGLTexture2D* texture)
- : QGLColladaParam(sid, QGLColladaParam::Sampler2DType)
- , mTexture(texture)
-{
-}
-
-
-
-/*!
- \internal
-*/
-QGLColladaSampler2DParam::QGLColladaSampler2DParam(QString sid, QString sourceSid)
- : QGLColladaParam(sid, QGLColladaParam::Sampler2DType)
- , mTexture(0)
- , mSourceSid(sourceSid)
-{
-}
-
-
-
-/*!
- \internal
-*/
-QString QGLColladaSampler2DParam::sourceSid()
-{
- return mSourceSid;
-}
-
-
-
-/*!
- \internal
-*/
-QGLColladaSurfaceParam::QGLColladaSurfaceParam(QString sid) : QGLColladaParam(sid, QGLColladaParam::SurfaceType)
- , mInitFrom()
- , mFormat()
- , mFormatHint()
- , mSize()
- , mSizeVector( 3, 0 )
- , mViewportRatio( 1.0, 1.0 )
- , mMipLevels( 0 )
- , mMipMapGenerate( false )
- , mExtra()
- , mGenerator()
-{
-}
-
-
-
-/*!
- \internal
-*/
-QGLColladaImageParam::QGLColladaImageParam(QString sid, QImage image)
- : QGLColladaParam(sid, QGLColladaParam::ImageType)
- , mImage(image)
-{
-}
-
-
-
-/*!
- \internal
-*/
-QImage QGLColladaImageParam::image()
-{
- return mImage;
-}
-
-
-
-/*!
- \internal
-*/
-QString QGLColladaImageParam::name()
-{
- return mName;
-}
-
-
-
-/*!
- \internal
-*/
-QGLColladaSurfaceParam* QGLColladaFxEffectFactory::processSurfaceElement( QXmlStreamReader& xml , ResultState* resultState, QString passedInSid)
-{
- Q_UNUSED(resultState);
- QXmlStreamAttributes attributes = xml.attributes();
- QString surfaceSid = attributes.value(QLatin1String("sid")).toString();
- // Surfaces are the only children of a newparam, but don't have their own
- // sids. For simplicity, use the parent's sid.
-
- if (surfaceSid.isEmpty() && !passedInSid.isEmpty())
- surfaceSid = passedInSid;
- QGLColladaSurfaceParam* result = new QGLColladaSurfaceParam( surfaceSid );
- xml.readNextStartElement();
- if ( xml.name().toString().left(4) == QLatin1String("init") )
- {
- if (xml.name().toString() != QLatin1String("init_from"))
- qWarning() << "Warning: only ""init_from"" supported in surface element ( line:" << xml.lineNumber() << ")";
- QString init_from = xml.readElementText();
- result->mInitFrom = init_from;
- resultState->paramSids[surfaceSid] = init_from;
- }
- return result;
-}
-
-
-
-/*!
- \internal
- Processes a list of floating point numbers. If the list contains only 1
- element, a QVariant<float> is returned. If the list containst 2, 3 or 4
- elements, they are converted into a QVariant containing a QVector2D,
- QVector3D, or QVector4D respectively.
- If the list containst more elements than that, they are returned as a
- QArray<float>.
-
-*/
-QVariant QGLColladaFxEffectFactory::processFloatList( QXmlStreamReader& xml )
-{
- QArray<float> floats;
- QString elementString = xml.readElementText();
- QStringList list = elementString.split( QRegExp( QLatin1String("\\s+") ), QString::SkipEmptyParts );
- bool ok;
- float f;
- foreach ( QString string, list )
- {
- f = string.toFloat( &ok );
- if ( ok )
- floats.append(string.toFloat());
- else
- {
- qWarning() << "Warning: malformed float ( line" << xml.lineNumber() << ")";
- }
- }
-
- switch(floats.count())
- {
- case 0:
- return QVariant();
- // no break necessary
- case 1:
- return QVariant(floats[0]);
- // no break necessary
- case 2:
- return QVariant(QVector2D(floats[0], floats[1]));
- // no break necessary
- case 3:
- return QVariant(QVector3D(floats[0], floats[1], floats[2]));
- // no break necessary
- case 4:
- return QVariant(QVector4D(floats[0], floats[1], floats[2], floats[3]));
- // no break necessary
- default:
- {
- QVariant result;
- result.setValue(floats);
- return result;
- }
- }
- // Function should always return out of switch statement
-}
-
-
-
-/*!
- \internal
-*/
-void QGLColladaFxEffectFactory::processSampler2DElement( QXmlStreamReader& xml, ResultState* resultState, QString passedInSid )
-{
- Q_UNUSED(resultState);
- QXmlStreamAttributes attributes = xml.attributes();
- QString sid = attributes.value(QLatin1String("sid")).toString();
- if (sid.isEmpty() && !passedInSid.isEmpty())
- {
- sid = passedInSid;
- }
-
- xml.readNextStartElement();
- if ( xml.name() == QLatin1String("source"))
- {
- // Collada 1.4 Spec
- QString sourceSurfaceSid = xml.readElementText().trimmed();
- resultState->paramSids[sid] = sourceSurfaceSid;
- }
-
- if ( xml.name() == QLatin1String("instance_image") )
- {
- // Collada 1.5 Spec
- qWarning() << "collada 1.5 sampler elements not supported ( line:" << xml.lineNumber() << ")";
- }
- // exit cleanly, just in case.
- findEndTag( xml, QLatin1String("sampler2D"));
- return;
-}
-
-
-
-/*!
- \internal
- Parses and consumes a color collada element from \a xml.
-*/
-QColor QGLColladaFxEffectFactory::processColorElement( QXmlStreamReader& xml )
-{
- QVariant floatList = processFloatList( xml );
-
- QColor result( 0, 0, 0, 255 );
- if (floatList.type() == QVariant::Vector3D)
- {
- QVector3D vector3D = floatList.value<QVector3D>();
- if ( !vector3D.isNull())
- {
- result.setRgbF( vector3D.x()
- , vector3D.y()
- , vector3D.z()
- , 1.0 );
- return result;
- }
- }
- else if (floatList.type() == QVariant::Vector4D)
- {
- QVector4D vector4D = floatList.value<QVector4D>();
- if (!vector4D.isNull())
- {
- result.setRgbF( vector4D.x()
- , vector4D.y()
- , vector4D.z()
- , vector4D.w() );
- return result;
- }
- }
- qWarning() << "Warning: Malformed color element ( line" << xml.lineNumber() << ")";
- return result;
-}
-
-
-
-/*!
- \internal
- Parses and consumes an fx_common_color_or_texture_type collada element from \a xml.
-*/
-QVariant QGLColladaFxEffectFactory::processColorOrTextureElement( QXmlStreamReader& xml )
-{
- if ( xml.name() == QLatin1String("color"))
- {
- return processColorElement( xml );
- } else if ( xml.name() == QLatin1String("texture") )
- {
- qWarning() << "Warning: texture element not supported ( line" << xml.lineNumber()<<")";
- } else
- {
- qWarning() << "Color or Texture expected ( line" << xml.lineNumber() << ")";
- }
- xml.skipCurrentElement();
- return( QColor( 0, 0, 0,255 ));
-}
-
-
-
-/*!
- \internal
- Parses an fx_common_float_or_param_type collada element from \a xml.
- Always consumes the element.
-*/
-float QGLColladaFxEffectFactory::processParamOrFloatElement( QXmlStreamReader& xml )
-{
- if ( xml.name() == QLatin1String("param") )
- {
- qWarning() << "Warning: params not supported ( line" << xml.lineNumber() << ")";
- xml.skipCurrentElement();
- return 0.0;
- } else
- {
- return xml.readElementText().toFloat();
- }
-}
-
-
-
-/*!
- Parses and consumes a library_images collada element pointed to by \a xml,
- and pushes any images found onto the \a resultState for use in resolving
- elements later.
-*/
-void QGLColladaFxEffectFactory::processLibraryImagesElement( QXmlStreamReader& xml, ResultState* resultState )
-{
- xml.readNextStartElement();
-
- if ( xml.name() == QLatin1String("asset") )
- {
- qWarning() << "Warning: effect asset handling not supported in library_images element ( line" << xml.lineNumber() << ")";
- xml.skipCurrentElement();
- xml.readNextStartElement();
- }
-
- while ( xml.name() == QLatin1String("image") && xml.tokenType() == QXmlStreamReader::StartElement )
- {
- processImageElement( xml , resultState );
- xml.skipCurrentElement();
- xml.readNextStartElement();
- }
-}
-
-
-/*!
- \internal
-*/
-QList<QGLColladaFxEffect*> QGLColladaFxEffectFactory::processLibraryEffectsElement( QXmlStreamReader& xml, ResultState* resultState )
-{
- QList<QGLColladaFxEffect*> result;
- // A collada library_effects is
- // 0 or 1 <asset>
- // 1 or more <effect>,
- // 0 or more <extra>;
- xml.readNextStartElement();
-
- if ( xml.name() == QLatin1String("asset") )
- {
- qWarning() << "Warning: effect asset handling not supported in effects library ( line" << xml.lineNumber() << ")";
- xml.skipCurrentElement();
- xml.readNextStartElement();
- }
-
- while ( xml.name() == QLatin1String("effect") && xml.tokenType() == QXmlStreamReader::StartElement )
- {
- result += processEffectElement( xml , resultState );
- xml.readNextStartElement();
- }
-
- while ( xml.name() == QLatin1String("extra") )
- {
- qWarning() << "Warning: extra element not handled in effects library ( line" << xml.lineNumber() << ")";
- xml.readNextStartElement();
- }
-
- // be sure to exit cleanly
- findEndTag(xml, QLatin1String("library_effects"));
- return result;
-}
-
-
-
-/*!
- \internal
- Parses and consumes an effect element from \a xml.
-*/
-QList<QGLColladaFxEffect*> QGLColladaFxEffectFactory::processEffectElement( QXmlStreamReader& xml, ResultState* resultState )
-{
- // An effect element is:
- // 0 or 1 <annotate>
- // 0 or more newparam
- // 1 or more profile ( either <profile_BRIDGE>, <profile_CG>, <profile_GLES>, <profile_GLES2>, <profile_GLSL>, or <profile_COMMON>
- // 0 or more <extra>
-
- QList<QGLColladaFxEffect*> result;
- xml.readNextStartElement();
-
- if ( xml.name() == QLatin1String("annotate") )
- {
- qWarning() << "effect annotation not supported ( line" << xml.lineNumber() << ")";
- xml.skipCurrentElement();
- xml.readNextStartElement();
- }
-
- while ( xml.name() == QLatin1String("newparam") && xml.tokenType() == QXmlStreamReader::StartElement )
- {
- processNewparamElement( xml , resultState );
- xml.readNextStartElement();
- }
-
- // find any of the profile_* elements defined in the spec
- QRegExp profileRegExp( QLatin1String("profile_(BRIDGE|CG|GLES2?|GLSL|COMMON)") );
- while ( profileRegExp.indexIn( xml.name().toString() ) == 0 && xml.tokenType() == QXmlStreamReader::StartElement )
- {
- result += processProfileElement( xml, resultState );
- xml.readNextStartElement();
- }
-
- findEndTag(xml, QLatin1String("effect"));
- return result;
-}
-
-
-
-/*!
- \internal
-*/
-QList<QGLColladaFxEffect*> QGLColladaFxEffectFactory::processProfileElement( QXmlStreamReader& xml, ResultState* resultState )
-{
- // A profile_GLES2 element is:
- // 0 or 1 <asset>
- // 0 or more <code> or <include>
- // 0 or more <newparam>
- // 1 or more <technique>
-
- // A profile_GLSL element is:
- // 0 or 1 <asset>
- // 0 or more <code>
- // 0 or more <include>
- // 0 or more <newparam>
- // 1 or more <technique>
- // 0 or more <extra>
-
- // A profile_COMMON element is
- // an optional id element
- // 0 or 1 <asset>
- // 0 or more <newparam>
- // 1 <technique>
- // 0 or more <extra>
-
- // Note: techniques need to be handled differently for different profiles
-
- QString rootNodeString = xml.name().toString();
- QList<QGLColladaFxEffect*> result;
-
- xml.readNextStartElement();
- if ( xml.name() == QLatin1String("asset") )
- {
- qWarning() << "Warning: asset element not supported in " << rootNodeString << "elements ( line" << xml.lineNumber() << ")";
- xml.skipCurrentElement();
- xml.readNextStartElement();
- }
-
- if (rootNodeString == QLatin1String("profile_GLSL"))
- {
- while ( xml.name() == QLatin1String("code") )
- {
- QString codeSid = xml.attributes().value(QLatin1String("sid")).toString();
- QString codeText = xml.readElementText();
- resultState->paramSids[codeSid] = codeText;
-
- findEndTag(xml, QLatin1String("code"));
- xml.readNextStartElement();
- }
-
- while ( xml.name() == QLatin1String("include") )
- {
- QString includeSid = xml.attributes().value(QLatin1String("sid")).toString();
- QString includeUrl = xml.attributes().value(QLatin1String("url")).toString();
-
- // create an include param?
- qWarning() << "Warning: include element not supported in " << rootNodeString << "elements ( line" << xml.lineNumber() << ")";
-
- findEndTag(xml, QLatin1String("include"));
- xml.readNextStartElement();
- }
-
- }
-
- while ( xml.tokenType() == QXmlStreamReader::StartElement &&
- ( xml.name() == QLatin1String("newparam") || xml.name() == QLatin1String("image") ))
- {
- if ( xml.name() == QLatin1String("newparam") )
- processNewparamElement( xml , resultState );
- else if ( xml.name() == QLatin1String("image") )
- processImageElement( xml , resultState );
-
- xml.readNextStartElement();
- }
-
-
- while ( xml.name() == QLatin1String("technique") )
- {
- result.append(
- processTechniqueElement( xml, resultState, rootNodeString ));
- xml.readNextStartElement();
- // only 1 technique in profile_COMMON
- if ( rootNodeString == QLatin1String("profile_COMMON"))
- {
- break;
- }
- };
-
- while ( xml.name() == QLatin1String("extra") )
- {
- qWarning() << "extra elements currently not supported in " << rootNodeString << "elements ( line" << xml.lineNumber() << ")";
- findEndTag( xml, QLatin1String("extra") );
- xml.readNextStartElement();
- };
-
- findEndTag( xml, rootNodeString );
- return result;
-}
-
-
-QGLColladaParam* QGLColladaFxEffectFactory::processPassElement( QXmlStreamReader& xml, ResultState* resultState, QGLColladaFxEffect* effect )
-{
- QGLColladaParam* result = 0;
- // a profile_GLSL pass is:
- // 0 or 1 <annotate>
- // 0 or 1 <states>
- // 0 or 1 <program> (CG, GLES2 or GLSL only)
- // 0 or 1 <evaluate>
- // 0 or 1 <extra>
-
- xml.readNextStartElement();
-
- if ( xml.name() == QLatin1String("annotate") )
- {
- qWarning() << "Warning: annotate element not supported ( line" << xml.lineNumber() << ")";
- findEndTag( xml, QLatin1String("annotate") );
- xml.readNextStartElement();
- }
-
- if ( xml.name() == QLatin1String("states") )
- {
- qWarning() << "Warning: states element not supported ( line" << xml.lineNumber() << ")";
- findEndTag( xml, QLatin1String("states") );
- xml.readNextStartElement();
- }
-
- // 0 or 1 <program> (CG, GLES2 or GLSL only)
- if ( xml.name() == QLatin1String("program") )
- {
- processProgramElement( xml, resultState, effect );
- findEndTag( xml, QLatin1String("program") );
- xml.readNextStartElement();
- }
-
- // 0 or 1 <evaluate>
- if ( xml.name() == QLatin1String("evaluate") )
- {
- qWarning() << "Warning: evaluate element not supported ( line" << xml.lineNumber() << ")";
- findEndTag( xml, QLatin1String("evaluate") );
- xml.readNextStartElement();
- }
-
- // 0 or more <extra>
- while ( xml.name() == QLatin1String("extra") )
- {
- qWarning() << "Warning: extra element not supported ( line" << xml.lineNumber() << ")";
- findEndTag( xml, QLatin1String("extra") );
- xml.readNextStartElement();
- }
-
- findEndTag( xml, QLatin1String("pass"));
- return result;
-}
-
-QGLColladaFxEffect* QGLColladaFxEffectFactory::processTechniqueElement( QXmlStreamReader& xml, ResultState* resultState, QString &profileName )
-{
- // A 1.4 technique is:
- // 0 or 1 <asset>
- // 0 or more <newparam> or <image> (in any order)
- // 0 or more of <constant>, <lambert>, <phong>, <blinn>
- // 0 or more <extra>
-
- // A 1.5 profile_COMMON technique is:
- // 0 or 1 <asset>
- // exactly 1 of <blinn>, <constant>, <lambert>, or <phong>
- // 0 or more <extra>
-
- // a profile_GLSL technique is:
- // 0 or 1 <asset>
- // 0 or more <annotate>
- // 1 or more <pass>
- // 0 or more <extra>
-
- QGLColladaFxEffect* effect = new QGLColladaFxEffect();
-
- QXmlStreamAttributes attributes = xml.attributes();
- effect->setSid( attributes.value( QLatin1String("sid") ).toString() );
- QStringRef id = attributes.value( QLatin1String("id") );
- Q_UNUSED( id );
-
- xml.readNextStartElement();
-
- if ( xml.name() == QLatin1String("asset") )
- {
- qWarning() << "Warning: asset element not supported ( line" << xml.lineNumber() << ")";
- xml.skipCurrentElement();
- xml.readNextStartElement();
- }
-
- while ( xml.name() == QLatin1String("annotate") && xml.tokenType() == QXmlStreamReader::StartElement )
- {
- qWarning() << "Warning: annotate element not supported ( line" << xml.lineNumber() << ")";
- xml.skipCurrentElement();
- xml.readNextStartElement();
- }
-
- // Collada specifies exactly one of blinn, lambert, constant or phong
- // If the effect is malformed, default QGLMaterial will be used.
- QGLMaterial* material = new QGLMaterial;
-
- if ( profileName == QLatin1String("profile_COMMON") &&
- (xml.name() == QLatin1String("blinn") || xml.name() == QLatin1String("phong") ||
- xml.name() == QLatin1String("constant") || xml.name() == QLatin1String("lambert")) )
- {
- if ( xml.name() == QLatin1String("blinn") )
- {
- effect->setLighting( QGLColladaFxEffect::BlinnLighting );
- } else if ( xml.name() == QLatin1String("phong") ) {
- effect->setLighting( QGLColladaFxEffect::PhongLighting );
- } else if ( xml.name() == QLatin1String("constant") ) {
- effect->setLighting( QGLColladaFxEffect::ConstantLighting );
- } else if ( xml.name() == QLatin1String("lambert") ) {
- effect->setLighting( QGLColladaFxEffect::LambertLighting );
- }
-
- // TODO: get appropriate shader fragments for the specified lighting models
- if ( xml.readNextStartElement() )
- {
- // a blinn element is 0 or 1 of each of:
- // <emission>
- // <diffuse>
- // <specular>
- // <shininess>
- // <reflectivity>
- // <transparent>
- // <transparency>
- // <index_of_refraction>
-
- if ( xml.name() == QLatin1String("emission") )
- {
- if ( xml.readNextStartElement() )
- {
- // handle color or texture element:
- if (xml.name() == QLatin1String("color"))
- {
- material->setEmittedLight( processColorElement( xml ));
-#ifdef DEBUG_MATERIALS
- qDebug() << "set emitted light to " << material->emittedLight();
-#endif
- }
- else if ( xml.name() == QLatin1String("texture"))
- {
- effect->d->emissiveTexture = processTextureElement( xml, resultState );
-#ifdef DEBUG_MATERIALS
- qDebug() << "set emissive texture to " << effect->d->emissiveTexture;
-#endif
- } else if ( xml.name() == QLatin1String("param"))
- {
- qWarning() << "params not supported in lighting elements ( line" << xml.lineNumber() << ")";
- }
- }
- xml.skipCurrentElement();
- xml.readNextStartElement();
- }
-
- if ( xml.name() == QLatin1String("ambient") )
- {
- if ( xml.readNextStartElement() )
- {
- // handle color or texture element:
- if (xml.name() == QLatin1String("color"))
- {
- material->setAmbientColor( processColorElement( xml ));
-#ifdef DEBUG_MATERIALS
- qDebug() << "set ambient color to " << material->ambientColor();
-#endif
- }
- else if ( xml.name() == QLatin1String("texture"))
- {
- effect->d->ambientTexture = processTextureElement( xml, resultState );
-#ifdef DEBUG_MATERIALS
- qDebug() << "set ambient texture to " << effect->d->ambientTexture;
-#endif
- } else if ( xml.name() == QLatin1String("param"))
- {
- qWarning() << "params not supported in lighting elements ( line" << xml.lineNumber() << ")";
- }
- }
- xml.skipCurrentElement();
- xml.readNextStartElement();
- }
-
- if ( xml.name() == QLatin1String("diffuse") )
- {
- if ( xml.readNextStartElement() )
- {
- // handle color or texture element:
- if (xml.name() == QLatin1String("color"))
- {
- material->setDiffuseColor( processColorElement( xml ));
-#ifdef DEBUG_MATERIALS
- qDebug() << "set diffuse color to " << material->diffuseColor();
-#endif
- }
- else if ( xml.name() == QLatin1String("texture"))
- {
- effect->d->diffuseTexture = processTextureElement( xml, resultState );
-#ifdef DEBUG_MATERIALS
- qDebug() << "set diffuse texture to " << effect->d->diffuseTexture;
-#endif
- } else if ( xml.name() == QLatin1String("param"))
- {
- qWarning() << "params not supported in lighting elements ( line" << xml.lineNumber() << ")";
- }
- }
- xml.skipCurrentElement();
- xml.readNextStartElement();
- }
-
- if ( xml.name() == QLatin1String("specular") )
- {
- if ( xml.readNextStartElement() )
- {
- // handle color or texture element:
- if (xml.name() == QLatin1String("color"))
- {
- material->setSpecularColor( processColorElement( xml ));
-#ifdef DEBUG_MATERIALS
- qDebug() << "set specular color to " << material->specularColor();
-#endif
- }
- else if ( xml.name() == QLatin1String("texture"))
- {
- effect->d->specularTexture = processTextureElement( xml, resultState );
-#ifdef DEBUG_MATERIALS
- qDebug() << "set specular texture to " << effect->d->specularTexture;
-#endif
- } else if ( xml.name() == QLatin1String("param"))
- {
- qWarning() << "params not supported in lighting elements ( line" << xml.lineNumber() << ")";
- }
- }
- xml.skipCurrentElement();
- xml.readNextStartElement();
- }
-
- if ( xml.name() == QLatin1String("shininess") )
- {
- if ( xml.readNextStartElement() )
- {
- float shininess = processParamOrFloatElement( xml );
- if ( 0.0 < shininess && shininess < 1.0 )
- {
- qWarning() << "Warning: Blinn-Torrance-Sparrow specular lighting not suported ( line" << xml.lineNumber()
- << "), converting to Blinn-Phong specular model";
- material->setShininess( int( shininess * 128.0 ));
- }
- else
- material->setShininess( int( shininess ) );
-#ifdef DEBUG_MATERIALS
- qDebug() << "set shininess to " << material->shininess();
-#endif
- }
- xml.skipCurrentElement();
- xml.readNextStartElement();
- }
-
- if ( xml.name() == QLatin1String("reflective") )
- {
- qWarning() << "Warning reflective not supported ( line" << xml.lineNumber() << ")";
- xml.skipCurrentElement();
- xml.readNextStartElement();
- }
-
- if ( xml.name() == QLatin1String("reflectivity") )
- {
- qWarning() << "Warning: reflectivity not supported ( line" << xml.lineNumber() << ")";
- xml.skipCurrentElement();
- xml.readNextStartElement();
- }
-
- if ( xml.name() == QLatin1String("transparent") )
- {
- if ( xml.readNextStartElement() )
- {
- if (xml.name() == QLatin1String("texture"))
- {
- QGLTexture2D* transparentTexture = processTextureElement( xml , resultState );
- Q_UNUSED(transparentTexture);
- qWarning() << "Warning: transparent not supported ( line" << xml.lineNumber() << ")";
-#ifdef DEBUG_MATERIALS
- qDebug() << "unused transparent texture" << transparentTexture;
-#endif
- }
- else if (xml.name() == QLatin1String("color"))
- {
- QColor transparent = processColorElement( xml );
- Q_UNUSED( transparent );
- qWarning() << "Warning: transparent not supported ( line" << xml.lineNumber() << ")";
-#ifdef DEBUG_MATERIALS
- qDebug() << "unused transparent color of " << transparent;
-#endif
- }
- }
- xml.skipCurrentElement();
- xml.readNextStartElement();
- }
-
- if ( xml.name() == QLatin1String("transparency") )
- {
- if ( xml.readNextStartElement() )
- {
- float transparency = processParamOrFloatElement( xml );
- if ( transparency < 1.0 )
- {
- qWarning() << "Warning: transparency not supported";
- }
- xml.skipCurrentElement();
- xml.readNextStartElement();
- }
- }
-
- if ( xml.name() == QLatin1String("index_of_refraction") )
- {
- if ( xml.readNextStartElement() )
- {
- float indexOfRefraction = processParamOrFloatElement( xml );
- Q_UNUSED( indexOfRefraction );
- qWarning() << "Warning: index_of_refraction not supported ( line" << xml.lineNumber() << ")";
- xml.skipCurrentElement();
- }
- xml.skipCurrentElement();
- xml.readNextStartElement();
- }
- }
- // end of lighting scope
-
- effect->setMaterial( material );
-
- switch(effect->lighting())
- {
- case QGLColladaFxEffect::PhongLighting:
- case QGLColladaFxEffect::LambertLighting:
- qWarning() << "Warning: requested lighting not supported, using Blinn-Phong instead";
- case QGLColladaFxEffect::BlinnLighting:
- effect->addBlinnPhongLighting();
- case QGLColladaFxEffect::ConstantLighting:
- case QGLColladaFxEffect::NoLighting:
- default:
- break;
- }
- };
-
- while ( xml.name() == QLatin1String("pass") && xml.tokenType() == QXmlStreamReader::StartElement )
- {
- processPassElement( xml, resultState, effect);
- xml.skipCurrentElement();
- xml.readNextStartElement();
- }
-
- // Make sure to exit cleanly
- findEndTag( xml, QLatin1String("technique") );
-
- return effect;
-}
-
-
-
-QGLColladaParam* QGLColladaFxEffectFactory::processNewparamElement( QXmlStreamReader& xml, ResultState* resultState)
-{
- QXmlStreamAttributes attributes = xml.attributes();
- QString sidString = attributes.value(QLatin1String("sid")).toString();
- QGLColladaParam* result = 0;
- if (xml.readNextStartElement())
- {
- if (xml.name().toString().left(5) == QLatin1String("float"))
- {
-
- QVariant floatValues = processFloatList( xml );
- resultState->paramSids[sidString] = floatValues;
-
- if ( xml.name() == QLatin1String("float")
- && ( floatValues.type() !=
- static_cast<QVariant::Type>(QMetaType::Float )))
- {
- qWarning() << "Warning: parsed type incorrectly, expected float ( line" << xml.lineNumber() << ")";
- resultState->paramSids[sidString] = floatValues.value<float>();
- }
- else if ( xml.name() == QLatin1String("float2")
- && floatValues.type() != QVariant::Vector2D )
- {
- qWarning() << "Warning: parsed type incorrectly, expected float2 ( line" << xml.lineNumber() << ")";
- }
- else if ( xml.name() == QLatin1String("float3")
- && floatValues.type() != QVariant::Vector3D )
- {
- qWarning() << "Warning: parsed type incorrectly, expected float3 ( line" << xml.lineNumber() << ")";
- }
- else if ( xml.name() == QLatin1String("float4")
- && floatValues.type() != QVariant::Vector4D)
- {
- qWarning() << "Warning: parsed type incorrectly, expected float4 ( line" << xml.lineNumber() << ")";
- }
- } else if ( xml.name() == QLatin1String("sampler2D") )
- {
- processSampler2DElement( xml , resultState, sidString );
- } else if ( xml.name() == QLatin1String("surface") )
- {
- result = processSurfaceElement( xml, resultState, sidString);
- } else {
- qWarning() << "unrecognized parameter type ( line:" << xml.lineNumber() << ")";
- findEndTag( xml, QLatin1String("newparam") );
- return 0;
- }
- }
- findEndTag(xml, QLatin1String("newparam"));
- return result;
-}
-
-
-/*!
- \internal
- the library_images can come after the library_effects, so textures referenced
- in effects might not have been defined when the effect was created. Try and
- resolve those images now. (Other properties - wrap, mipmap and filters etc
- should have been resolved when the texture was originally parsed).
- */
-bool QGLColladaFxEffectFactory::resolveTexture2DImage(QGLTexture2D *texture, ResultState *resultState, QString paramName)
-{
- if (texture == 0)
- {
- qWarning() << "Warning: Cannot resolve images for null QGLTexture2D";
- return false;
- }
- QVariant samplerParam = findParameterVariant(resultState, paramName);
- QString surfaceName = samplerParam.value<QString>();
- QImage image;
-
- if (!surfaceName.isEmpty())
- {
- QVariant surfaceParam = findParameterVariant(resultState, surfaceName);
- QString initFrom = surfaceParam.value<QString>();
- if (!initFrom.isEmpty())
- {
- image = resolveImageURI(resultState, initFrom);
- }
- }
-
- // If that's failed, try again with the passed in paramName
- if (image.isNull())
- {
- image = resolveImageURI(resultState, paramName);
- }
-
- texture->setImage(image);
- return !image.isNull();
-}
-
-
-QT_END_NAMESPACE
-
-Q_DECLARE_METATYPE(QGLTexture2D*);
-
-QT_BEGIN_NAMESPACE
-/*!
- \internal
- Parses and consumes a texture collada element from \a xml.
-*/
-QGLTexture2D* QGLColladaFxEffectFactory::processTextureElement( QXmlStreamReader& xml , ResultState* resultState )
-{
- QGLTexture2D* result = new QGLTexture2D();
- QXmlStreamAttributes attributes = xml.attributes();
-
- foreach (QXmlStreamAttribute attribute, attributes)
- {
- if ( attribute.name() == QLatin1String("texture") )
- {
- QString paramName = attribute.value().toString();
-
- // in Collada Fx Textures must reference a previously defined
- // sampler2D param.
- // However, this sampler may refer to images in the library_images,
- // which is parsed after the library_effects, so try and resolve
- // now, but save failures to try again later.
-
- if (!resolveTexture2DImage(result, resultState, paramName))
- {
- resultState->unresolvedTexture2Ds[result] = paramName;
- }
- } else if ( attribute.name() == QLatin1String("texcoord") )
- {
- // TODO: Create a repository for this sort of data, to be used in creating the shader progams later
- // I'm pretty sure the effect is going to need to be passed in.
- qWarning() << "texcoord not supported yet: " << attribute.name() << attribute.value() << " ( line" << xml.lineNumber() << ")";
- } else if (attribute.name() == QLatin1String("extra"))
- {
- qWarning() << "extra elements in texture elements not supported ( line" << xml.lineNumber() << ")";
- }
- }
- xml.skipCurrentElement();
-
- return result;
-}
-
-/*!
- \internal
- Try and get an image to attach to a texture. The URI could be a reference to
- a param in the collada document (which may in turn be a reference), or
- file referenced either absolutely or relative to the original dae file.
- (It could concievably be a web URL, but that is not handled here.)
- */
-QImage QGLColladaFxEffectFactory::resolveImageURI(ResultState *resultState, QString URI)
-{
- QImage result;
- QString imageFileName;
- QString workingURI = URI;
- if (workingURI.length() > 0 && workingURI.at(0) == QLatin1Char('#'))
- {
- workingURI = workingURI.right(workingURI.length() - 1);
- }
-
- QVariant potentialParameter = findParameterVariant(resultState, workingURI);
- // Might be parameter itself:
- if ( !potentialParameter.value<QImage>().isNull() )
- return potentialParameter.value<QImage>();
- // or might be another URI
- if (!potentialParameter.value<QString>().isNull())
- {
- imageFileName = potentialParameter.value<QString>();
- } else {
- imageFileName = workingURI;
- }
-
- // First try as a relative path.
- QString filePath = resultState->sourceDir.path() + QLatin1Char('/') + imageFileName;
- result.load(filePath);
- if (result.isNull())
- {
- // No relative file found, so try as an absolute path
- result.load(imageFileName);
- }
- return result;
-}
-
-/*!
- \internal
- Parses and consumes an image element from \a xml.
-*/
-void QGLColladaFxEffectFactory::processImageElement( QXmlStreamReader& xml, ResultState* resultState )
-{
- // 1.4 has a bunch of optional values in the attributes:
- QString sid = xml.attributes().value(QLatin1String("sid")).toString();
- QString id = xml.attributes().value(QLatin1String("id")).toString();
- QString name = xml.attributes().value(QLatin1String("name")).toString();
-
- QString height = xml.attributes().value(QLatin1String("height")).toString();
- QString width = xml.attributes().value(QLatin1String("width")).toString();
- QString depth = xml.attributes().value(QLatin1String("depth")).toString();
-
- Q_UNUSED(height);
- Q_UNUSED(width);
- Q_UNUSED(depth);
-
- QImage result;
-
- xml.readNextStartElement();
- if (xml.name() == QLatin1String("asset"))
- {
- qWarning() << "asset element not supported in image elements ( line" << xml.lineNumber() << ")";
- xml.skipCurrentElement();
- xml.readNextStartElement();
- }
-
- if (xml.name() == QLatin1String("init_from"))
- {
- QString imageFileName = xml.readElementText().trimmed();
- QDir sourceDir = resultState->sourceDir;
- // ignore path information for resources
- QString filePath = sourceDir.path() + QLatin1Char('/') + imageFileName;
- result.load(filePath);
- if (result.isNull())
- {
- // Catch resources or files with absolute paths
- result.load(imageFileName);
- }
- if (!sid.isEmpty())
- resultState->paramSids[sid] = result;
- if (!id.isEmpty())
- resultState->paramIds[id] = result;
- if (!name.isEmpty())
- resultState->paramNames[name] = result;
- }
-
- // exit cleanly
- findEndTag( xml, QLatin1String("image"));
-}
-
-QStringList QGLColladaFxEffectFactory::glslProfileFromEffect(QGLColladaFxEffect* effect, QString sid)
-{
- Q_UNUSED(effect)
- Indent indent;
- QStringList result;
- result += indent + QLatin1String("<profile_GLSL>");
- {
- result += generateCodeElements(effect, sid);
- result += indent + QLatin1String("<technique sid=\"") + sid + QLatin1String("\">");
- {
- Indent indent;
- result += indent + QLatin1String("<pass>");
- result += generateProgramElement(effect, sid);
- result += indent + QLatin1String("</pass>");
- }
- result += indent + QLatin1String("</technique>");
- }
- result += indent + QLatin1String("</profile_GLSL>");
-
- return result;
-}
-
-QStringList QGLColladaFxEffectFactory::generateProgramElement(QGLColladaFxEffect* effect, QString techniqueSid)
-{
- QStringList result;
- QString vertexShaderRefSid = QLatin1String("VertexShaderRefSidRefsCodeOrIncludeAtProfileOrEffectLevel");
- QString fragmentShaderRefSid = QLatin1String("FragmentShaderRefSidRefsCodeOrIncludeAtProfileOrEffectLevel");
- Indent indent;
- result += indent + QLatin1String("<program>");
- result += generateShaderElement(effect, techniqueSid + QLatin1String("VertexShader"), techniqueSid + QLatin1String("FragmentShader"));
- // 0 or more
- result += generateBindAttributeElement( effect );
- // 0 or more
- result += generateBindUniformElements( effect );
- result += indent + QLatin1String("</program>");
- return result;
-}
-
-QStringList QGLColladaFxEffectFactory::generateShaderElement( QGLColladaFxEffect* effect, QString vertexShaderRefSid, QString fragmentShaderRefSid )
-{
- Q_UNUSED(effect);
- QStringList result;
- Indent indent;
- result += indent + QLatin1String("<shader stage=\"VERTEX\">");
- {
- Indent indent;
- result += indent + QLatin1String("<sources>");
- {
- // 0 or more <import> elements
- Indent indent;
- result += indent + QLatin1String("<import ref=\"") + vertexShaderRefSid + QLatin1String("\"/>");
- }
- result += indent + QLatin1String("</sources>");
- // 0 or <extra> elements;
- }
- result += indent + QLatin1String("</shader>");
-
- result += indent + QLatin1String("<shader stage=\"FRAGMENT\">");
- {
- Indent indent;
- result += indent + QLatin1String("<sources>");
- {
- Indent indent;
- result += indent + QLatin1String("<import ref=\"") + fragmentShaderRefSid + QLatin1String("\"/>");
- }
- result += indent + QLatin1String("</sources>");
- // <extra> element(s) here if necessary;
- }
- result += indent + QLatin1String("</shader>");
- return result;
-}
-
-QStringList QGLColladaFxEffectFactory::generateBindAttributeElement( QGLColladaFxEffect* effect )
-{
- // Currently no need for bind_attribute elements.
- Q_UNUSED(effect);
- QStringList result;
- // Indent indent;
- // result += indent + "<bind_attribute>";
- // result += indent + "</bind_attribute>";
- return result;
-}
-
-QStringList generateBindUniformParamElement( QString symbol, QString ref)
-{
- QStringList result;
- // 0 or more <bind_uniform> elements
- Indent indent;
- result += indent + QLatin1String("<bind_uniform symbol=\"") + symbol + QLatin1String("\">");
- {
- Indent indent;
- result += indent + QLatin1String("<param ref=\"") + ref + QLatin1String("\">");
- }
- result += indent + QLatin1String("</bind_uniform>");
- return result;
-}
-
-QStringList generateBindUniformParamElement( QString symbol, const QVector3D& value)
-{
- QStringList result;
- // 0 or more <bind_uniform> elements
- Indent indent;
- result += indent + QLatin1String("<bind_uniform symbol=\"") + symbol + QLatin1String("\">");
- {
- Indent indent;
- result += indent + QString(QLatin1String("<float3> %1 %2 %3 </float3>")).arg(value.x()).arg(value.y()).arg(value.z());
- }
- result += indent + QLatin1String("</bind_uniform>");
- return result;
-}
-
-QStringList generateBindUniformParamElement( QString symbol, const QColor& value)
-{
- QStringList result;
- // 0 or more <bind_uniform> elements
- Indent indent;
- result += indent + QLatin1String("<bind_uniform symbol=\"") + symbol + QLatin1String("\">");
- {
- Indent indent;
- result += indent + QString(QLatin1String("<float3> %1 %2 %3 </float3>")).arg(value.redF()).arg(value.greenF()).arg(value.blueF());
- }
- result += indent + QLatin1String("</bind_uniform>");
- return result;
-}
-
-
-QStringList QGLColladaFxEffectFactory::generateBindUniformElements( QGLColladaFxEffect* effect )
-{
- QStringList result;
- if (effect == 0)
- return result;
- // // 0 or more <bind_uniform> elements
- // Example uniforms
- // result += generateBindUniformParamElement( "exampleRefSymbol", QString("exampleRef"));
- // result += generateBindUniformParamElement( "exampleFloat3Symbol", QVector3D(0.1, 0.2, 0.3) );
-
- if (effect->material() != 0)
- {
- QGLMaterial* material = effect->material();
-
- // Actual uniforms:
- result += generateBindUniformParamElement( QLatin1String("ambientColor"), material->ambientColor());
- result += generateBindUniformParamElement( QLatin1String("diffuseColor"), material->diffuseColor());
- result += generateBindUniformParamElement( QLatin1String("emittedLight"), material->emittedLight());
- result += generateBindUniformParamElement( QLatin1String("objectName"), material->objectName());
- result += generateBindUniformParamElement( QLatin1String("shininess"), material->shininess());
- result += generateBindUniformParamElement( QLatin1String("specularColor"), material->specularColor());
-
- effect->supportsPicking();
-
- // TODO: Find and store effect uniforms
- // effect->bindProgramUniforms();
- }
- return result;
-}
-
-QStringList QGLColladaFxEffectFactory::generateCodeElements( QGLColladaFxEffect* effect, QString baseSid )
-{
- QStringList result;
- // 0 or more <bind_uniform> elements
- Indent indent;
-
- // put all this on one line to avoid adding carriage returns to the
- // shader programs
- result += indent + QLatin1String("<code sid=\"") + baseSid + QLatin1String("VertexShader\">")
- + effect->vertexShader() + QLatin1String("</code>");
-
- result += indent + QLatin1String("<code sid=\"") + baseSid + QLatin1String("FragmentShader\">")
- + effect->fragmentShader() + QLatin1String("</code>");
-
- return result;
-}
-
-void QGLColladaFxEffectFactory::processProgramElement( QXmlStreamReader& xml, ResultState* resultState, QGLColladaFxEffect* effect )
-{
- // A profile_GLSL shader element is
- // 0 or more <shader>
- // 0 or more <bind_attribute>
- // 0 or more <bind_uniform>
-
- xml.readNextStartElement();
-
- while ( xml.name() == QLatin1String("shader") )
- {
- // in profile_GLSL a shader is
- // exactly 1 <source>
- // 0 or more <extra>
-
- QString stage = xml.attributes().value(QLatin1String("stage")).toString();
- xml.readNextStartElement();
- if ( xml.name() == QLatin1String("sources") )
- {
- // a <sources> element is
- // 1 or more <inline> elements
- // 0 or more <import> elements
- // Note: child elements can appear in any order
-
- xml.readNextStartElement();
- while ( (xml.name() == QLatin1String("inline") || xml.name() == QLatin1String("import")) && xml.tokenType() == QXmlStreamReader::StartElement)
- {
- if ( xml.name() == QLatin1String("import"))
- {
- QString ref = xml.attributes().value(QLatin1String("ref")).toString();
-
- QXmlStreamAttribute attr;
- if (xml.attributes().count())
- {
- attr = xml.attributes().first();
- }
-
- QVariant param = findParameterVariant(resultState, ref);
- if (param.isNull() || param.type() != QVariant::String)
- {
- qWarning() << "null or unexpected parameter found in import element ( line"
- << xml.lineNumber()<<")";
- }
- else
- {
- if (stage == QLatin1String("VERTEX"))
- {
- effect->setVertexShader( param.value<QString>().toLatin1() );
- }
- else if (stage == QLatin1String("FRAGMENT"))
- {
- effect->setFragmentShader( param.value<QString>().toLatin1() );
- } else
- {
- qWarning() << "unrecognized shader stage: "
- << stage << " ( line" << xml.lineNumber()<<")";
- }
- }
-
- } else if ( xml.name() == QLatin1String("inline"))
- {
-
- }
- xml.readNextStartElement();
- }
- } else {
- qWarning() << "collada parsing error. expected <sources> element ( line"
- << xml.lineNumber()<<")";
- }
-
- if (xml.name() == QLatin1String("extra"))
- qWarning() << "Warning: extra element not supported in profile_GLSL <shader> element ( line" << xml.lineNumber()<<")";
-
- findEndTag ( xml, QLatin1String("shader"));
- xml.readNextStartElement();
- }
-
- while ( xml.name() == QLatin1String("bind_attribute") )
- {
- qWarning() << "Warning: bind_attribute element not supported ( line" << xml.lineNumber()<<")";
- findEndTag ( xml, QLatin1String("bind_attribute"));
- xml.readNextStartElement();
- }
-
- while ( xml.name() == QLatin1String("bind_uniform") )
- {
- qWarning() << "Warning: bind_uniform element not supported ( line" << xml.lineNumber()<<")";
- findEndTag ( xml, QLatin1String("bind_uniform"));
- xml.readNextStartElement();
- }
-
- findEndTag(xml, QLatin1String("program"));
- return;
-}
-
-QT_END_NAMESPACE
diff --git a/src/threed/effects/qglcolladafxeffectfactory.h b/src/threed/effects/qglcolladafxeffectfactory.h
deleted file mode 100644
index 1ed5bb9e..00000000
--- a/src/threed/effects/qglcolladafxeffectfactory.h
+++ /dev/null
@@ -1,218 +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 QGLCOLLADAFXEFFECTFACTORY_H
-#define QGLCOLLADAFXEFFECTFACTORY_H
-
-#include <QVector>
-#include <QXmlStreamReader>
-#include <QDir>
-#include "qgl.h"
-#include "qgltexture2d.h"
-
-#include "qglcolladafxeffect.h"
-
-Q_DECLARE_METATYPE(QArray<float>)
-
-QT_BEGIN_NAMESPACE
-
-class QGLColladaFxEffect;
-class QGLColladaImageParam;
-class QGLColladaSurfaceParam;
-class QGLColladaSampler2DParam;
-
-typedef struct _ResultState
-{
- QMap<QString, QVariant> paramSids;
- QMap<QString, QVariant> paramIds;
- QMap<QString, QVariant> paramNames;
- QDir sourceDir;
- QMap<QGLTexture2D*, QString> unresolvedTexture2Ds;
-} ResultState;
-
-
-
-
-class Q_QT3D_EXPORT QGLColladaFxEffectFactory
-{
-public:
- // Collada parsing functions
- static QList<QGLColladaFxEffect*> loadEffectsFromFile(const QString& fileName );
-
-protected:
- static QList<QGLColladaFxEffect*> loadEffectsFromXml( QXmlStreamReader& xml, QDir homeDirectory = QDir());
- static void processLibraryImagesElement( QXmlStreamReader& xml, ResultState* stateStack );
- static QList<QGLColladaFxEffect*> processLibraryEffectsElement( QXmlStreamReader& xml, ResultState* stateStack );
- static QList<QGLColladaFxEffect*> processEffectElement( QXmlStreamReader& xml, ResultState* stateStack );
- static QList<QGLColladaFxEffect*> processProfileElement( QXmlStreamReader& xml, ResultState* stateStack );
-
- static QGLColladaParam* processPassElement( QXmlStreamReader& xml, ResultState* stateStack, QGLColladaFxEffect* effect );
- static QGLColladaFxEffect* processTechniqueElement( QXmlStreamReader& xml, ResultState* stateStack, QString &profileName );
- static QGLColladaParam* processNewparamElement( QXmlStreamReader& xml, ResultState* stateStack );
- static void processImageElement( QXmlStreamReader& xml, ResultState* stateStack );
- static QGLColladaSurfaceParam* processSurfaceElement( QXmlStreamReader& xml, ResultState* stateStack, QString passedInSid = "");
- static void processSampler2DElement( QXmlStreamReader& xml, ResultState* stateStack, QString passedInSid );
- static QGLTexture2D* processTextureElement( QXmlStreamReader& xml , ResultState* stateStack );
- static QVariant processFloatList( QXmlStreamReader& xml );
- static QColor processColorElement( QXmlStreamReader& xml );
- static float processParamOrFloatElement( QXmlStreamReader& xml );
- static QVariant processColorOrTextureElement( QXmlStreamReader& xml );
- QGLColladaFxEffectFactory();
- static void processProgramElement( QXmlStreamReader& xml, ResultState* stateStack, QGLColladaFxEffect* effect );
-
- // Collada generation functions
-public:
- static QString exportEffect(QGLColladaFxEffect *effect, QString effectId, QString techniqueSid);
-
-protected:
- static QStringList glslProfileFromEffect(QGLColladaFxEffect* effect, QString techniqueSid);
- static QStringList generateProgramElement(QGLColladaFxEffect* effect, QString techniqueSid);
- static QStringList generateShaderElement( QGLColladaFxEffect* effect, QString vertexShaderRefSid, QString fragmentShaderRefSid );
- static QStringList generateBindUniformElement( QGLColladaFxEffect* effect );
- static QStringList generateBindAttributeElement( QGLColladaFxEffect* effect );
- static QStringList generateBindUniformElements( QGLColladaFxEffect* effect );
- static QStringList generateCodeElements( QGLColladaFxEffect* effect, QString baseSid );
-
- static QImage resolveImageURI(ResultState *resultState, QString imageFileName);
- static bool resolveTexture2DImage(QGLTexture2D *result, ResultState *resultState, QString paramName);
-};
-
-
-
-class QGLColladaParam
-{
- friend class QGLColladaFxEffectFactory;
-public:
- enum {
- UnknownType = 0,
- Sampler2DType,
- Texture2DType,
- SurfaceType,
- ImageType,
- UserDefinedType = 100
- };
-
- virtual ~QGLColladaParam();
-
- int type();
- QVector<float> value();
- QString sid();
- QString id();
-
- static QString typeString(int);
-
-protected:
- QGLColladaParam(QString sid, int type);
- QString mSid;
- QString mId;
- int mType;
- QVector<float> mValue;
-};
-
-
-
-class QGLColladaTextureParam : public QGLColladaParam
-{
- friend class QGLColladaFxEffectFactory;
-public:
- QGLColladaTextureParam(QString sid, QGLTexture2D* texture);
- QGLTexture2D* texture();
- QString samplerSid();
-protected:
- QGLTexture2D* mTexture;
- QString sampler2DSid;
- QString texCoordSid;
-};
-
-
-
-class QGLColladaSurfaceParam : public QGLColladaParam
-{
- friend class QGLColladaFxEffectFactory;
-public:
- QGLColladaSurfaceParam(QString sid);
-protected:
- QString mInitFrom;
- QString mFormat;
- QString mFormatHint;
- QString mSize;
- QVector<int> mSizeVector;
- QPointF mViewportRatio;
- int mMipLevels;
- bool mMipMapGenerate;
- QString mExtra;
- QString mGenerator;
-};
-
-
-
-class QGLColladaSampler2DParam : public QGLColladaParam
-{
- friend class QGLColladaFxEffectFactory;
-public:
- QGLColladaSampler2DParam(QString sid, QGLTexture2D* sampler);
- QGLColladaSampler2DParam(QString sid, QString sourceSid);
- QGLTexture2D sampler();
- QString sourceSid();
-protected:
- QGLTexture2D* mTexture;
- QString mSourceSid;
-};
-
-
-
-// "image" isn't really a param, but it shares enough that it seems sensible
-// to re-use the QGLColladaParam base.
-class QGLColladaImageParam : public QGLColladaParam
-{
- friend class QGLColladaFxEffectFactory;
-public:
- QGLColladaImageParam(QString sid, QImage image);
- QImage image();
- QString name();
-protected:
- QImage mImage;
- QString mName;
-};
-
-QT_END_NAMESPACE
-
-#endif // QGLCOLLADAFXEFFECTFACTORY_H
diff --git a/src/threed/effects/qglcolladafxeffectloader.cpp b/src/threed/effects/qglcolladafxeffectloader.cpp
deleted file mode 100644
index cb181257..00000000
--- a/src/threed/effects/qglcolladafxeffectloader.cpp
+++ /dev/null
@@ -1,190 +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 "qglcolladafxeffectloader.h"
-
-#include <QList>
-#include "qglcolladafxeffectfactory.h"
-#include "qglcolladafxeffect.h"
-
-#include <QStringList>
-
-//Q_DECLARE_METATYPE(QGLColladaFxEffect)
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGLColladaFxEffectLoader
- \brief The QGLColladaFxEffectLoader class is a convenient way to load
- effects from collada files for use with Qt3D.
- \since 4.8
- \ingroup qt3d
-
- QGLColladaFxEffectLoader provides a simple class to create and store
- QGLColladaEffect objects from Collada Fx files. It currently supports
- a simple subset of the Collada 1.5 Fx specification.
-
- The QGLColladaEffect effects are destroyed automatically when the loader
- is destroyed. If finer control over effect lifetime is required, use
- QGLColladaFxEffectFactory::loadEffectsFromFile() directly.
-*/
-
-class QGLColladaFxEffectLoaderPrivate
-{
-public:
- QList<QGLColladaFxEffect*> effects;
- ~QGLColladaFxEffectLoaderPrivate()
- {
- deleteAndClearEffects();
- }
-
- void deleteAndClearEffects()
- {
- while (effects.count())
- {
- delete effects.back();
- effects.pop_back();
- }
- }
-
-};
-
-
-/*!
- Constructs an empty QGLColladaFxEffectLoader object.
-*/
-QGLColladaFxEffectLoader::QGLColladaFxEffectLoader() :
- d_ptr(new QGLColladaFxEffectLoaderPrivate())
-{
-}
-
-/*!
- Destroys the QGLColladaFxEffectLoader and any generated QGLColladaFxEffect
- objects.
-*/
-QGLColladaFxEffectLoader::~QGLColladaFxEffectLoader()
-{
-}
-
-/*!
- Reads the collada file indicated by \a filename and generates
- QGLColladaFxEffect objects from it.
-
- The QGLColladaFxEffectFactory owns all the effects it generates, and destroys
- them when it is destroyed, or when a new file is loaded.
-
- If effects are needed from multiple files, use one QGLColladaFxEffectLoader
- per file.
-
- Returns true if at least one effect was generated.
-
- \sa effectNames(), effect(), operator[](), QGLColladaFxEffectFactory::loadEffectsFromFile()
- */
-bool QGLColladaFxEffectLoader::load(QString filename)
-{
- Q_D(QGLColladaFxEffectLoader);
- d->deleteAndClearEffects();
- d->effects = QGLColladaFxEffectFactory::loadEffectsFromFile(filename);
- return d->effects.count() > 0;
-}
-
-/*!
- Returns a list of the sid attributes of effects that have been generated
- \sa effect()
- */
-QStringList QGLColladaFxEffectLoader::effectNames()
-{
- Q_D(QGLColladaFxEffectLoader);
- QStringList result;
- QGLColladaFxEffect *effect;
- foreach (effect, d->effects)
- {
- result.append(effect->sid());
- }
- return result;
-}
-
-/*!
- Returns a pointer to the effect with an sid matching \a effectName, or
- 0 if no such effect exists.
-
- \sa load()
- */
-QGLColladaFxEffect* QGLColladaFxEffectLoader::effect(QString effectName)
-{
- Q_D(QGLColladaFxEffectLoader);
- QGLColladaFxEffect* effect;
-
- foreach (effect, d->effects)
- {
- if (effect && effect->sid() == effectName)
- {
- return effect;
- }
- }
- return 0;
-}
-
-/*!
- Returns the number of effects the loader has generated and stored.
- */
-int QGLColladaFxEffectLoader::count()
-{
- Q_D(QGLColladaFxEffectLoader);
- return d->effects.count();
-}
-
-/*!
- Returns a pointer to the effect in position \a i. QGLColladaFxEffectLoader
- makes no guarantee about the ordering of effects relative to their position
- in a collada document, but does not reorder effects once they have been read.
-
- \sa load()
- */
-QGLColladaFxEffect *QGLColladaFxEffectLoader::operator[](int i)
-{
- Q_D(QGLColladaFxEffectLoader);
- Q_ASSERT(i < d->effects.count());
-
- return d->effects.at(i);
-}
-
-QT_END_NAMESPACE
diff --git a/src/threed/effects/qglcolladafxeffectloader.h b/src/threed/effects/qglcolladafxeffectloader.h
deleted file mode 100644
index 84dbcf84..00000000
--- a/src/threed/effects/qglcolladafxeffectloader.h
+++ /dev/null
@@ -1,73 +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 QGLCOLLADAFXEFFECTLOADER_H
-#define QGLCOLLADAFXEFFECTLOADER_H
-
-#include <qglobal.h>
-#include <QString>
-#include <QStringList>
-#include <QtCore/qscopedpointer.h>
-#include "qt3dglobal.h"
-
-QT_BEGIN_NAMESPACE
-
-class QGLColladaFxEffect;
-class QGLColladaFxEffectLoaderPrivate;
-
-class Q_QT3D_EXPORT QGLColladaFxEffectLoader
-{
-public:
- QGLColladaFxEffectLoader();
- ~QGLColladaFxEffectLoader();
- bool load(QString filename);
- QStringList effectNames();
- QGLColladaFxEffect *effect(QString effectName);
- int count();
- QGLColladaFxEffect* operator[](int);
-private:
- Q_DECLARE_PRIVATE(QGLColladaFxEffectLoader);
- QScopedPointer<QGLColladaFxEffectLoaderPrivate> d_ptr;
-};
-
-QT_END_NAMESPACE
-
-#endif // QGLCOLLADAFXEFFECTLOADER_H
diff --git a/src/threed/effects/qglflatcoloreffect.cpp b/src/threed/effects/qglflatcoloreffect.cpp
deleted file mode 100644
index e082b38e..00000000
--- a/src/threed/effects/qglflatcoloreffect.cpp
+++ /dev/null
@@ -1,350 +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 "qglflatcoloreffect_p.h"
-#include "qglabstracteffect_p.h"
-#include <QtOpenGL/qglshaderprogram.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGLFlatColorEffect
- \since 4.8
- \brief The QGLFlatColorEffect class provides a standard effect that draws fragments with a flat unlit color.
- \ingroup qt3d
- \ingroup qt3d::painting
- \internal
-*/
-
-/*!
- \class QGLPerVertexColorEffect
- \since 4.8
- \brief The QGLPerVertexColorEffect class provides a standard effect that draws fragments with a per-vertex unlit color.
- \ingroup qt3d
- \ingroup qt3d::painting
- \internal
-*/
-
-class QGLFlatColorEffectPrivate
-{
-public:
- QGLFlatColorEffectPrivate()
- : program(0)
- , matrixUniform(-1)
- , colorUniform(-1)
- , isFixedFunction(false)
- {
- }
-
- QGLShaderProgram *program;
- int matrixUniform;
- int colorUniform;
- bool isFixedFunction;
-};
-
-/*!
- Constructs a new flat color effect.
-*/
-QGLFlatColorEffect::QGLFlatColorEffect()
- : d_ptr(new QGLFlatColorEffectPrivate)
-{
-}
-
-/*!
- Destroys this flat color effect.
-*/
-QGLFlatColorEffect::~QGLFlatColorEffect()
-{
-}
-
-/*!
- \reimp
-*/
-bool QGLFlatColorEffect::supportsPicking() const
-{
- return true;
-}
-
-/*!
- \reimp
-*/
-void QGLFlatColorEffect::setActive(QGLPainter *painter, bool flag)
-{
-#if defined(QGL_FIXED_FUNCTION_ONLY)
- Q_UNUSED(painter);
- if (flag)
- glEnableClientState(GL_VERTEX_ARRAY);
- else
- glDisableClientState(GL_VERTEX_ARRAY);
-#else
- Q_UNUSED(painter);
- Q_D(QGLFlatColorEffect);
-#if !defined(QGL_SHADERS_ONLY)
- if (painter->isFixedFunction()) {
- d->isFixedFunction = true;
- if (flag)
- glEnableClientState(GL_VERTEX_ARRAY);
- else
- glDisableClientState(GL_VERTEX_ARRAY);
- return;
- }
-#endif
- static char const flatColorVertexShader[] =
- "attribute highp vec4 vertex;\n"
- "uniform highp mat4 matrix;\n"
- "void main(void)\n"
- "{\n"
- " gl_Position = matrix * vertex;\n"
- "}\n";
-
- static char const flatColorFragmentShader[] =
- "uniform mediump vec4 color;\n"
- "void main(void)\n"
- "{\n"
- " gl_FragColor = color;\n"
- "}\n";
-
- QGLShaderProgram *program =
- painter->cachedProgram(QLatin1String("qt.color.flat"));
- d->program = program;
- if (!program) {
- if (!flag)
- return;
- program = new QGLShaderProgram();
- program->addShaderFromSourceCode(QGLShader::Vertex, flatColorVertexShader);
- program->addShaderFromSourceCode(QGLShader::Fragment, flatColorFragmentShader);
- program->bindAttributeLocation("vertex", QGL::Position);
- if (!program->link()) {
- qWarning("QGLFlatColorEffect::setActive(): could not link shader program");
- delete program;
- return;
- }
- painter->setCachedProgram(QLatin1String("qt.color.flat"), program);
- d->program = program;
- d->colorUniform = program->uniformLocation("color");
- d->matrixUniform = program->uniformLocation("matrix");
- program->bind();
- program->enableAttributeArray(QGL::Position);
- } else if (flag) {
- d->colorUniform = program->uniformLocation("color");
- d->matrixUniform = program->uniformLocation("matrix");
- program->bind();
- program->enableAttributeArray(QGL::Position);
- } else {
- program->disableAttributeArray(QGL::Position);
- program->release();
- }
-#endif
-}
-
-/*!
- \reimp
-*/
-void QGLFlatColorEffect::update
- (QGLPainter *painter, QGLPainter::Updates updates)
-{
-#if defined(QGL_FIXED_FUNCTION_ONLY)
- painter->updateFixedFunction
- (updates & (QGLPainter::UpdateColor |
- QGLPainter::UpdateMatrices));
-#else
- Q_D(QGLFlatColorEffect);
-#if !defined(QGL_SHADERS_ONLY)
- if (d->isFixedFunction) {
- painter->updateFixedFunction
- (updates & (QGLPainter::UpdateColor |
- QGLPainter::UpdateMatrices));
- return;
- }
-#endif
- if ((updates & QGLPainter::UpdateColor) != 0) {
- if (painter->isPicking())
- d->program->setUniformValue(d->colorUniform, painter->pickColor());
- else
- d->program->setUniformValue(d->colorUniform, painter->color());
- }
- if ((updates & QGLPainter::UpdateMatrices) != 0) {
- QMatrix4x4 proj = painter->projectionMatrix();
- QMatrix4x4 mv = painter->modelViewMatrix();
- d->program->setUniformValue(d->matrixUniform, proj * mv);
- }
-#endif
-}
-
-class QGLPerVertexColorEffectPrivate
-{
-public:
- QGLPerVertexColorEffectPrivate()
- : program(0)
- , matrixUniform(-1)
- , isFixedFunction(false)
- {
- }
-
- QGLShaderProgram *program;
- int matrixUniform;
- bool isFixedFunction;
-};
-
-/*!
- Constructs a new per-vertex color effect.
-*/
-QGLPerVertexColorEffect::QGLPerVertexColorEffect()
- : d_ptr(new QGLPerVertexColorEffectPrivate)
-{
-}
-
-/*!
- Destroys this per-vertex color effect.
-*/
-QGLPerVertexColorEffect::~QGLPerVertexColorEffect()
-{
-}
-
-/*!
- \reimp
-*/
-void QGLPerVertexColorEffect::setActive(QGLPainter *painter, bool flag)
-{
-#if defined(QGL_FIXED_FUNCTION_ONLY)
- Q_UNUSED(painter);
- if (flag) {
- glEnableClientState(GL_VERTEX_ARRAY);
- glEnableClientState(GL_COLOR_ARRAY);
- } else {
- glDisableClientState(GL_VERTEX_ARRAY);
- glDisableClientState(GL_COLOR_ARRAY);
- }
-#else
- Q_UNUSED(painter);
- Q_D(QGLPerVertexColorEffect);
-#if !defined(QGL_SHADERS_ONLY)
- if (painter->isFixedFunction()) {
- d->isFixedFunction = true;
- if (flag) {
- glEnableClientState(GL_VERTEX_ARRAY);
- glEnableClientState(GL_COLOR_ARRAY);
- } else {
- glDisableClientState(GL_VERTEX_ARRAY);
- glDisableClientState(GL_COLOR_ARRAY);
- }
- return;
- }
-#endif
- static char const pvColorVertexShader[] =
- "attribute highp vec4 vertex;\n"
- "attribute mediump vec4 color;\n"
- "uniform highp mat4 matrix;\n"
- "varying mediump vec4 qColor;\n"
- "void main(void)\n"
- "{\n"
- " gl_Position = matrix * vertex;\n"
- " qColor = color;\n"
- "}\n";
-
- static char const pvColorFragmentShader[] =
- "varying mediump vec4 qColor;\n"
- "void main(void)\n"
- "{\n"
- " gl_FragColor = qColor;\n"
- "}\n";
-
- QGLShaderProgram *program =
- painter->cachedProgram(QLatin1String("qt.color.pervertex"));
- d->program = program;
- if (!program) {
- if (!flag)
- return;
- program = new QGLShaderProgram();
- program->addShaderFromSourceCode(QGLShader::Vertex, pvColorVertexShader);
- program->addShaderFromSourceCode(QGLShader::Fragment, pvColorFragmentShader);
- program->bindAttributeLocation("vertex", QGL::Position);
- program->bindAttributeLocation("color", QGL::Color);
- if (!program->link()) {
- qWarning("QGLPerVertexColorEffect::setActive(): could not link shader program");
- delete program;
- program = 0;
- return;
- }
- painter->setCachedProgram(QLatin1String("qt.color.pervertex"), program);
- d->program = program;
- d->matrixUniform = program->uniformLocation("matrix");
- program->bind();
- program->enableAttributeArray(QGL::Position);
- program->enableAttributeArray(QGL::Color);
- } else if (flag) {
- d->matrixUniform = program->uniformLocation("matrix");
- program->bind();
- program->enableAttributeArray(QGL::Position);
- program->enableAttributeArray(QGL::Color);
- } else {
- program->disableAttributeArray(QGL::Position);
- program->disableAttributeArray(QGL::Color);
- program->release();
- }
-#endif
-}
-
-/*!
- \reimp
-*/
-void QGLPerVertexColorEffect::update
- (QGLPainter *painter, QGLPainter::Updates updates)
-{
-#if defined(QGL_FIXED_FUNCTION_ONLY)
- painter->updateFixedFunction(updates & QGLPainter::UpdateMatrices);
-#else
- Q_UNUSED(painter);
- Q_D(QGLPerVertexColorEffect);
-#if !defined(QGL_SHADERS_ONLY)
- if (d->isFixedFunction) {
- painter->updateFixedFunction(updates & QGLPainter::UpdateMatrices);
- return;
- }
-#endif
- if ((updates & QGLPainter::UpdateMatrices) != 0) {
- d->program->setUniformValue
- (d->matrixUniform, painter->combinedMatrix());
- }
-#endif
-}
-
-QT_END_NAMESPACE
diff --git a/src/threed/effects/qglflatcoloreffect_p.h b/src/threed/effects/qglflatcoloreffect_p.h
deleted file mode 100644
index 8f713712..00000000
--- a/src/threed/effects/qglflatcoloreffect_p.h
+++ /dev/null
@@ -1,99 +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 QGLFLATCOLOREFFECT_P_H
-#define QGLFLATCOLOREFFECT_P_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 "qglabstracteffect.h"
-#include <QtCore/qscopedpointer.h>
-
-QT_BEGIN_NAMESPACE
-
-class QGLFlatColorEffectPrivate;
-class QGLPerVertexColorEffectPrivate;
-
-class QGLFlatColorEffect : public QGLAbstractEffect
-{
-public:
- QGLFlatColorEffect();
- virtual ~QGLFlatColorEffect();
-
- bool supportsPicking() const;
- void setActive(QGLPainter *painter, bool flag);
- void update(QGLPainter *painter, QGLPainter::Updates updates);
-
-private:
- QScopedPointer<QGLFlatColorEffectPrivate> d_ptr;
-
- Q_DECLARE_PRIVATE(QGLFlatColorEffect)
- Q_DISABLE_COPY(QGLFlatColorEffect)
-};
-
-class QGLPerVertexColorEffect : public QGLAbstractEffect
-{
-public:
- QGLPerVertexColorEffect();
- virtual ~QGLPerVertexColorEffect();
-
- void setActive(QGLPainter *painter, bool flag);
- void update(QGLPainter *painter, QGLPainter::Updates updates);
-
-private:
- QScopedPointer<QGLPerVertexColorEffectPrivate> d_ptr;
-
- Q_DECLARE_PRIVATE(QGLPerVertexColorEffect)
- Q_DISABLE_COPY(QGLPerVertexColorEffect)
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/threed/effects/qglflattextureeffect.cpp b/src/threed/effects/qglflattextureeffect.cpp
deleted file mode 100644
index 3e93ff48..00000000
--- a/src/threed/effects/qglflattextureeffect.cpp
+++ /dev/null
@@ -1,373 +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 "qglflattextureeffect_p.h"
-#include "qglabstracteffect_p.h"
-#include "qglext_p.h"
-#include <QtOpenGL/qglshaderprogram.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGLFlatTextureEffect
- \since 4.8
- \brief The QGLFlatTextureEffect class provides a standard effect that draws fragments with a flat unlit texture.
- \ingroup qt3d
- \ingroup qt3d::painting
- \internal
-*/
-
-/*!
- \class QGLFlatDecalTextureEffect
- \since 4.8
- \brief The QGLFlatDecalTextureEffect class provides a standard effect that decals fragments with a flat unlit texture.
- \ingroup qt3d
- \ingroup qt3d::painting
- \internal
-*/
-
-class QGLFlatTextureEffectPrivate
-{
-public:
- QGLFlatTextureEffectPrivate()
- : program(0)
- , matrixUniform(-1)
- , isFixedFunction(false)
- {
- }
-
- QGLShaderProgram *program;
- int matrixUniform;
- bool isFixedFunction;
-};
-
-/*!
- Constructs a new flat texture effect.
-*/
-QGLFlatTextureEffect::QGLFlatTextureEffect()
- : d_ptr(new QGLFlatTextureEffectPrivate)
-{
-}
-
-/*!
- Destroys this flat texture effect.
-*/
-QGLFlatTextureEffect::~QGLFlatTextureEffect()
-{
-}
-
-#if !defined(QGL_FIXED_FUNCTION_ONLY)
-
-static char const flatTexVertexShader[] =
- "attribute highp vec4 vertex;\n"
- "attribute highp vec4 texcoord;\n"
- "uniform highp mat4 matrix;\n"
- "varying highp vec4 qt_TexCoord0;\n"
- "void main(void)\n"
- "{\n"
- " gl_Position = matrix * vertex;\n"
- " qt_TexCoord0 = texcoord;\n"
- "}\n";
-
-static char const flatTexFragmentShader[] =
- "uniform sampler2D tex;\n"
- "varying highp vec4 qt_TexCoord0;\n"
- "void main(void)\n"
- "{\n"
- " gl_FragColor = texture2D(tex, qt_TexCoord0.st);\n"
- "}\n";
-
-static char const flatDecalFragmentShader[] =
- "uniform sampler2D tex;\n"
- "uniform mediump vec4 color;\n"
- "varying highp vec4 qt_TexCoord0;\n"
- "void main(void)\n"
- "{\n"
- " mediump vec4 col = texture2D(tex, qt_TexCoord0.st);\n"
- " gl_FragColor = vec4(clamp(color.rgb * (1.0 - col.a) + col.rgb, 0.0, 1.0), color.a);\n"
- "}\n";
-
-#endif
-
-/*!
- \reimp
-*/
-void QGLFlatTextureEffect::setActive(QGLPainter *painter, bool flag)
-{
-#if defined(QGL_FIXED_FUNCTION_ONLY)
- Q_UNUSED(painter);
- if (flag) {
- glEnableClientState(GL_VERTEX_ARRAY);
- qt_gl_ClientActiveTexture(GL_TEXTURE0);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
- glEnable(GL_TEXTURE_2D);
- } else {
- glDisableClientState(GL_VERTEX_ARRAY);
- qt_gl_ClientActiveTexture(GL_TEXTURE0);
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
- glDisable(GL_TEXTURE_2D);
- }
-#else
- Q_UNUSED(painter);
- Q_D(QGLFlatTextureEffect);
-#if !defined(QGL_SHADERS_ONLY)
- if (painter->isFixedFunction()) {
- d->isFixedFunction = true;
- if (flag) {
- glEnableClientState(GL_VERTEX_ARRAY);
- qt_gl_ClientActiveTexture(GL_TEXTURE0);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
- glEnable(GL_TEXTURE_2D);
- } else {
- glDisableClientState(GL_VERTEX_ARRAY);
- qt_gl_ClientActiveTexture(GL_TEXTURE0);
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
- glDisable(GL_TEXTURE_2D);
- }
- return;
- }
-#endif
- QGLShaderProgram *program =
- painter->cachedProgram(QLatin1String("qt.texture.flat.replace"));
- d->program = program;
- if (!program) {
- if (!flag)
- return;
- program = new QGLShaderProgram();
- program->addShaderFromSourceCode(QGLShader::Vertex, flatTexVertexShader);
- program->addShaderFromSourceCode(QGLShader::Fragment, flatTexFragmentShader);
- program->bindAttributeLocation("vertex", QGL::Position);
- program->bindAttributeLocation("texcoord", QGL::TextureCoord0);
- if (!program->link()) {
- qWarning("QGLFlatTextureEffect::setActive(): could not link shader program");
- delete program;
- program = 0;
- return;
- }
- painter->setCachedProgram
- (QLatin1String("qt.texture.flat.replace"), program);
- d->program = program;
- d->matrixUniform = program->uniformLocation("matrix");
- program->bind();
- program->setUniformValue("tex", 0);
- program->enableAttributeArray(QGL::Position);
- program->enableAttributeArray(QGL::TextureCoord0);
- } else if (flag) {
- d->matrixUniform = program->uniformLocation("matrix");
- program->bind();
- program->setUniformValue("tex", 0);
- program->enableAttributeArray(QGL::Position);
- program->enableAttributeArray(QGL::TextureCoord0);
- } else {
- program->disableAttributeArray(QGL::Position);
- program->disableAttributeArray(QGL::TextureCoord0);
- program->release();
- }
-#endif
-}
-
-/*!
- \reimp
-*/
-void QGLFlatTextureEffect::update
- (QGLPainter *painter, QGLPainter::Updates updates)
-{
-#if defined(QGL_FIXED_FUNCTION_ONLY)
- painter->updateFixedFunction(updates & QGLPainter::UpdateMatrices);
-#else
- Q_D(QGLFlatTextureEffect);
-#if !defined(QGL_SHADERS_ONLY)
- if (d->isFixedFunction) {
- painter->updateFixedFunction(updates & QGLPainter::UpdateMatrices);
- return;
- }
-#endif
- if ((updates & QGLPainter::UpdateMatrices) != 0) {
- d->program->setUniformValue
- (d->matrixUniform, painter->combinedMatrix());
- }
-#endif
-}
-
-class QGLFlatDecalTextureEffectPrivate
-{
-public:
- QGLFlatDecalTextureEffectPrivate()
- : program(0)
- , matrixUniform(-1)
- , colorUniform(-1)
- , isFixedFunction(false)
- {
- }
-
- QGLShaderProgram *program;
- int matrixUniform;
- int colorUniform;
- bool isFixedFunction;
-};
-
-/*!
- Constructs a new flat decal texture effect.
-*/
-QGLFlatDecalTextureEffect::QGLFlatDecalTextureEffect()
- : d_ptr(new QGLFlatDecalTextureEffectPrivate)
-{
-}
-
-/*!
- Destroys this flat decal texture effect.
-*/
-QGLFlatDecalTextureEffect::~QGLFlatDecalTextureEffect()
-{
-}
-
-/*!
- \reimp
-*/
-void QGLFlatDecalTextureEffect::setActive(QGLPainter *painter, bool flag)
-{
-#if defined(QGL_FIXED_FUNCTION_ONLY)
- Q_UNUSED(painter);
- if (flag) {
- glEnableClientState(GL_VERTEX_ARRAY);
- qt_gl_ClientActiveTexture(GL_TEXTURE0);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
- glEnable(GL_TEXTURE_2D);
- } else {
- glDisableClientState(GL_VERTEX_ARRAY);
- qt_gl_ClientActiveTexture(GL_TEXTURE0);
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
- glDisable(GL_TEXTURE_2D);
- }
-#else
- Q_UNUSED(painter);
- Q_D(QGLFlatDecalTextureEffect);
-#if !defined(QGL_SHADERS_ONLY)
- if (painter->isFixedFunction()) {
- d->isFixedFunction = true;
- if (flag) {
- glEnableClientState(GL_VERTEX_ARRAY);
- qt_gl_ClientActiveTexture(GL_TEXTURE0);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
- glEnable(GL_TEXTURE_2D);
- } else {
- glDisableClientState(GL_VERTEX_ARRAY);
- qt_gl_ClientActiveTexture(GL_TEXTURE0);
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
- glDisable(GL_TEXTURE_2D);
- }
- }
-#endif
- QGLShaderProgram *program =
- painter->cachedProgram(QLatin1String("qt.texture.flat.decal"));
- d->program = program;
- if (!program) {
- if (!flag)
- return;
- program = new QGLShaderProgram();
- program->addShaderFromSourceCode(QGLShader::Vertex, flatTexVertexShader);
- program->addShaderFromSourceCode(QGLShader::Fragment, flatDecalFragmentShader);
- program->bindAttributeLocation("vertex", QGL::Position);
- program->bindAttributeLocation("texcoord", QGL::TextureCoord0);
- if (!program->link()) {
- qWarning("QGLFlatDecalTextureEffect::setActive(): could not link shader program");
- delete program;
- program = 0;
- return;
- }
- painter->setCachedProgram
- (QLatin1String("qt.texture.flat.decal"), program);
- d->program = program;
- d->matrixUniform = program->uniformLocation("matrix");
- d->colorUniform = program->uniformLocation("color");
- program->bind();
- program->setUniformValue("tex", 0);
- program->enableAttributeArray(QGL::Position);
- program->enableAttributeArray(QGL::TextureCoord0);
- } else if (flag) {
- d->matrixUniform = program->uniformLocation("matrix");
- d->colorUniform = program->uniformLocation("color");
- program->bind();
- program->setUniformValue("tex", 0);
- program->enableAttributeArray(QGL::Position);
- program->enableAttributeArray(QGL::TextureCoord0);
- } else {
- program->disableAttributeArray(QGL::Position);
- program->disableAttributeArray(QGL::TextureCoord0);
- program->release();
- }
-#endif
-}
-
-/*!
- \reimp
-*/
-void QGLFlatDecalTextureEffect::update
- (QGLPainter *painter, QGLPainter::Updates updates)
-{
-#if defined(QGL_FIXED_FUNCTION_ONLY)
- painter->updateFixedFunction
- (updates & (QGLPainter::UpdateColor |
- QGLPainter::UpdateMatrices));
-#else
- Q_D(QGLFlatDecalTextureEffect);
-#if !defined(QGL_SHADERS_ONLY)
- if (d->isFixedFunction) {
- painter->updateFixedFunction
- (updates & (QGLPainter::UpdateColor |
- QGLPainter::UpdateMatrices));
- return;
- }
-#endif
- if ((updates & QGLPainter::UpdateColor) != 0)
- d->program->setUniformValue(d->colorUniform, painter->color());
- if ((updates & QGLPainter::UpdateMatrices) != 0) {
- d->program->setUniformValue
- (d->matrixUniform, painter->combinedMatrix());
- }
-#endif
-}
-
-QT_END_NAMESPACE
diff --git a/src/threed/effects/qglflattextureeffect_p.h b/src/threed/effects/qglflattextureeffect_p.h
deleted file mode 100644
index 1486d647..00000000
--- a/src/threed/effects/qglflattextureeffect_p.h
+++ /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$
-**
-****************************************************************************/
-
-#ifndef QGLFLATTEXTUREEFFECT_P_H
-#define QGLFLATTEXTUREEFFECT_P_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 "qglabstracteffect.h"
-#include <QtCore/qscopedpointer.h>
-
-QT_BEGIN_NAMESPACE
-
-class QGLFlatTextureEffectPrivate;
-class QGLFlatDecalTextureEffectPrivate;
-
-class QGLFlatTextureEffect : public QGLAbstractEffect
-{
-public:
- QGLFlatTextureEffect();
- virtual ~QGLFlatTextureEffect();
-
- void setActive(QGLPainter *painter, bool flag);
- void update(QGLPainter *painter, QGLPainter::Updates updates);
-
-private:
- QScopedPointer<QGLFlatTextureEffectPrivate> d_ptr;
-
- Q_DECLARE_PRIVATE(QGLFlatTextureEffect)
- Q_DISABLE_COPY(QGLFlatTextureEffect)
-};
-
-class QGLFlatDecalTextureEffect : public QGLAbstractEffect
-{
-public:
- QGLFlatDecalTextureEffect();
- virtual ~QGLFlatDecalTextureEffect();
-
- void setActive(QGLPainter *painter, bool flag);
- void update(QGLPainter *painter, QGLPainter::Updates updates);
-
-private:
- QScopedPointer<QGLFlatDecalTextureEffectPrivate> d_ptr;
-
- Q_DECLARE_PRIVATE(QGLFlatDecalTextureEffect)
- Q_DISABLE_COPY(QGLFlatDecalTextureEffect)
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/threed/effects/qgllitmaterialeffect.cpp b/src/threed/effects/qgllitmaterialeffect.cpp
deleted file mode 100644
index b8ecbd4c..00000000
--- a/src/threed/effects/qgllitmaterialeffect.cpp
+++ /dev/null
@@ -1,571 +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 "qgllitmaterialeffect_p.h"
-#include "qglabstracteffect_p.h"
-#include "qglext_p.h"
-#include <QtOpenGL/qglshaderprogram.h>
-#include <QtCore/qfile.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGLLitMaterialEffect
- \since 4.8
- \brief The QGLLitMaterialEffect class provides a standard effect that draws fragments with a lit material.
- \ingroup qt3d
- \ingroup qt3d::painting
- \internal
-*/
-
-#if !defined(QGL_FIXED_FUNCTION_ONLY)
-
-static char const litMaterialVertexShader[] =
- "attribute highp vec4 vertex;\n"
- "attribute highp vec3 normal;\n"
- "uniform highp mat4 matrix;\n"
- "uniform highp mat4 modelView;\n"
- "uniform highp mat3 normalMatrix;\n"
- "void main(void)\n"
- "{\n"
- " gl_Position = matrix * vertex;\n"
- " highp vec4 tvertex = modelView * vertex;\n"
- " highp vec3 norm = normalize(normalMatrix * normal);\n"
- " qLightVertex(tvertex, norm);\n"
- "}\n";
-
-static char const litMaterialFragmentShader[] =
-#if !defined(QT_OPENGL_ES)
- "varying mediump vec4 qColor;\n"
- "varying mediump vec4 qSecondaryColor;\n"
- "\n"
- "void main(void)\n"
- "{\n"
- " gl_FragColor = clamp(qColor + vec4(qSecondaryColor.xyz, 0.0), 0.0, 1.0);\n"
- "}\n";
-#else
- "varying mediump vec4 qCombinedColor;\n"
- "\n"
- "void main(void)\n"
- "{\n"
- " gl_FragColor = qCombinedColor;\n"
- "}\n";
-#endif
-
-// Algorithm from section 2.14.1 of OpenGL 2.1 specification.
-static char const litMaterialLightingShader[] =
-#if !defined(QT_OPENGL_ES)
-"uniform mediump vec3 sdli;\n" // Direction of the light (must be normalized).
-"uniform mediump vec3 pli;\n" // Position of the light
-"uniform mediump float pliw;\n" // 0 for directional, 1 for positional.
-"uniform mediump float srli;\n" // Spotlight exponent for the light
-"uniform mediump float crli;\n" // Spotlight cutoff for the light
-"uniform mediump float ccrli;\n" // Cosine of spotlight cutoff for the light
-"uniform mediump float k0;\n" // Constant attentuation factor for the light
-"uniform mediump float k1;\n" // Linear attentuation factor for the light
-"uniform mediump float k2;\n" // Quadratic attentuation factor for the light
-"uniform mediump vec4 acm[2];\n" // Ambient color of the material and light
-"uniform mediump vec4 dcm[2];\n" // Diffuse color of the material and light
-"uniform mediump vec4 scm[2];\n" // Specular color of the material and light
-"uniform mediump vec4 ecm[2];\n" // Emissive color and ambient scene color
-"uniform mediump float srm[2];\n"// Specular exponent of the material
-"uniform bool viewerAtInfinity;\n" // Light model indicates viewer at infinity
-"uniform bool twoSided;\n" // Light model indicates two-sided lighting
-
-"varying mediump vec4 qColor;\n"
-"varying mediump vec4 qSecondaryColor;\n"
-
-"void qLightVertex(vec4 vertex, vec3 normal)\n"
-"{\n"
-" int i, material;\n"
-" vec3 toEye, toLight, h;\n"
-" float angle, spot, attenuation;\n"
-" vec4 color, scolor;\n"
-" vec4 adcomponent, scomponent;\n"
-
- // Determine which material to use.
-" if (!twoSided || normal.z >= 0.0) {\n"
-" material = 0;\n"
-" } else {\n"
-" material = 1;\n"
-" normal = -normal;\n"
-" }\n"
-
- // Start with the material's emissive color and the ambient scene color,
- // which have been combined into the ecm parameter by the C++ code.
-" color = ecm[material];\n"
-" scolor = vec4(0, 0, 0, 0);\n"
-
- // Vector from the vertex to the eye position (i.e. the origin).
-" if (viewerAtInfinity)\n"
-" toEye = vec3(0, 0, 1);\n"
-" else\n"
-" toEye = normalize(-vertex.xyz);\n"
-
- // Determine the cosine of the angle between the normal and the
- // vector from the vertex to the light.
-" if (pliw == 0.0)\n"
-" toLight = normalize(pli);\n"
-" else\n"
-" toLight = normalize(pli - vertex.xyz);\n"
-" angle = max(dot(normal, toLight), 0.0);\n"
-
- // Calculate the ambient and diffuse light components.
-" adcomponent = acm[material] + angle * dcm[material];\n"
-
- // Calculate the specular light components.
-" if (angle != 0.0) {\n"
-" h = normalize(toLight + toEye);\n"
-" angle = max(dot(normal, h), 0.0);\n"
-" if (srm[material] != 0.0)\n"
-" scomponent = pow(angle, srm[material]) * scm[material];\n"
-" else\n"
-" scomponent = scm[material];\n"
-" } else {\n"
-" scomponent = vec4(0, 0, 0, 0);\n"
-" }\n"
-
- // Apply the spotlight angle and exponent.
-" if (crli != 180.0) {\n"
-" spot = max(dot(normalize(vertex.xyz - pli), sdli), 0.0);\n"
-" if (spot < ccrli) {\n"
-" adcomponent = vec4(0, 0, 0, 0);\n"
-" scomponent = vec4(0, 0, 0, 0);\n"
-" } else {\n"
-" spot = pow(spot, srli);\n"
-" adcomponent *= spot;\n"
-" scomponent *= spot;\n"
-" }\n"
-" }\n"
-
- // Apply attenuation to the colors.
-" if (pliw != 0.0) {\n"
-" attenuation = k0;\n"
-" if (k1 != 0.0 || k2 != 0.0) {\n"
-" float len = length(pli - vertex.xyz);\n"
-" attenuation += k1 * len + k2 * len * len;\n"
-" }\n"
-" color += adcomponent / attenuation;\n"
-" scolor += scomponent / attenuation;\n"
-" } else {\n"
-" color += adcomponent;\n"
-" scolor += scomponent;\n"
-" }\n"
-
- // Generate the final output colors.
-" float alpha = dcm[material].a;\n"
-" qColor = vec4(clamp(color.rgb, 0.0, 1.0), alpha);\n"
-" qSecondaryColor = clamp(scolor, 0.0, 1.0);\n"
-"}\n";
-#else
-"uniform mediump vec3 sdli;\n" // Direction of the light (must be normalized).
-"uniform mediump vec3 pli;\n" // Position of the light
-"uniform mediump float pliw;\n" // 0 for directional, 1 for positional.
-"uniform mediump float srli;\n" // Spotlight exponent for the light
-"uniform mediump float crli;\n" // Spotlight cutoff for the light
-"uniform mediump float ccrli;\n" // Cosine of spotlight cutoff for the light
-"uniform mediump vec4 acm;\n" // Ambient color of the material and light
-"uniform mediump vec4 dcm;\n" // Diffuse color of the material and light
-"uniform mediump vec4 scm;\n" // Specular color of the material and light
-"uniform mediump vec4 ecm;\n" // Emissive color and ambient scene color
-"uniform mediump float srm;\n" // Specular exponent of the material
-"uniform bool viewerAtInfinity;\n" // Light model indicates viewer at infinity
-
-"varying mediump vec4 qColor;\n"
-"varying mediump vec4 qSecondaryColor;\n"
-"varying mediump vec4 qCombinedColor;\n"
-
-"void qLightVertex(vec4 vertex, vec3 normal)\n"
-"{\n"
-" vec3 toEye, toLight, h;\n"
-" float angle, spot;\n"
-" vec4 color, scolor;\n"
-
- // Vector from the vertex to the eye position (i.e. the origin).
-" if (viewerAtInfinity)\n"
-" toEye = vec3(0, 0, 1);\n"
-" else\n"
-" toEye = normalize(-vertex.xyz);\n"
-
- // Determine the cosine of the angle between the normal and the
- // vector from the vertex to the light.
-" if (pliw == 0.0)\n"
-" toLight = normalize(pli);\n"
-" else\n"
-" toLight = normalize(pli - vertex.xyz);\n"
-" angle = max(dot(normal, toLight), 0.0);\n"
-
- // Calculate the ambient and diffuse light components.
-" color = acm + angle * dcm;\n"
-
- // Calculate the specular light components.
-" if (angle != 0.0) {\n"
-" h = normalize(toLight + toEye);\n"
-" angle = max(dot(normal, h), 0.0);\n"
-" if (srm != 0.0)\n"
-" scolor = pow(angle, srm) * scm;\n"
-" else\n"
-" scolor = scm;\n"
-" } else {\n"
-" scolor = vec4(0, 0, 0, 0);\n"
-" }\n"
-
- // Apply the spotlight angle and exponent.
-" if (crli != 180.0) {\n"
-" spot = max(dot(normalize(vertex.xyz - pli), sdli), 0.0);\n"
-" if (spot < ccrli) {\n"
-" color = vec4(0, 0, 0, 0);\n"
-" scolor = vec4(0, 0, 0, 0);\n"
-" } else {\n"
-" spot = pow(spot, srli);\n"
-" color *= spot;\n"
-" scolor *= spot;\n"
-" }\n"
-" }\n"
-
- // Generate the final output colors.
-" color += ecm;\n"
-" float alpha = dcm.a;\n"
- // Note: Normally, the qCombinedColor is ignored, and per-pixel
- // value is calculated.
- // If OPENGL_ES is defined, qColor and qSecondaryColor are ignored,
- // and qCombinedColor is calculated here to speed up the fragment shader.
-" qColor = vec4(clamp(color.rgb, 0.0, 1.0), alpha);\n"
-" qSecondaryColor = clamp(scolor, 0.0, 1.0);\n"
-" qCombinedColor = clamp(qColor + vec4(qSecondaryColor.xyz, 0.0), 0.0, 1.0);\n"
-"}\n";
-#endif
-
-static QByteArray createVertexSource(const char *lighting, const char *extra)
-{
- QByteArray contents(lighting);
- return contents + extra;
-}
-
-static inline QVector4D colorToVector4(const QColor& color)
-{
- return QVector4D(color.redF(), color.greenF(),
- color.blueF(), color.alphaF());
-}
-
-// Combine a material and light color into a single color.
-static inline QVector4D colorToVector4
- (const QColor &color, const QColor &lightColor)
-{
- return QVector4D(color.redF() * lightColor.redF(),
- color.greenF() * lightColor.greenF(),
- color.blueF() * lightColor.blueF(),
- color.alphaF() * lightColor.alphaF());
-}
-
-#endif
-
-class QGLLitMaterialEffectPrivate
-{
-public:
- QGLLitMaterialEffectPrivate()
- : program(0)
- , matrixUniform(-1)
- , modelViewUniform(-1)
- , normalMatrixUniform(-1)
- , textureMode(0)
-#if !defined(QGL_FIXED_FUNCTION_ONLY)
- , vertexShader(litMaterialVertexShader)
- , fragmentShader(litMaterialFragmentShader)
-#else
- , vertexShader(0)
- , fragmentShader(0)
-#endif
- , programName(QLatin1String("qt.color.material"))
- , isFixedFunction(false)
- {
- }
-
- QGLShaderProgram *program;
- int matrixUniform;
- int modelViewUniform;
- int normalMatrixUniform;
- GLenum textureMode;
- const char *vertexShader;
- const char *fragmentShader;
- QString programName;
- bool isFixedFunction;
-};
-
-/*!
- Constructs a new lit material effect.
-*/
-QGLLitMaterialEffect::QGLLitMaterialEffect()
- : d_ptr(new QGLLitMaterialEffectPrivate)
-{
-}
-
-/*!
- \internal
-*/
-QGLLitMaterialEffect::QGLLitMaterialEffect
- (GLenum mode, const char *vshader, const char *fshader,
- const QString& programName)
- : d_ptr(new QGLLitMaterialEffectPrivate)
-{
- Q_D(QGLLitMaterialEffect);
- d->textureMode = mode;
- d->vertexShader = vshader;
- d->fragmentShader = fshader;
- d->programName = programName;
-}
-
-/*!
- Destroys this lit material effect.
-*/
-QGLLitMaterialEffect::~QGLLitMaterialEffect()
-{
-}
-
-/*!
- \reimp
-*/
-void QGLLitMaterialEffect::setActive(QGLPainter *painter, bool flag)
-{
-#if defined(QGL_FIXED_FUNCTION_ONLY)
- Q_UNUSED(painter);
- Q_D(QGLLitMaterialEffect);
- if (flag) {
- glEnable(GL_LIGHTING);
- glEnable(GL_LIGHT0);
- glEnableClientState(GL_VERTEX_ARRAY);
- glEnableClientState(GL_NORMAL_ARRAY);
- if (d->textureMode) {
- qt_gl_ClientActiveTexture(GL_TEXTURE0);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, d->textureMode);
- glEnable(GL_TEXTURE_2D);
- }
- } else {
- glDisable(GL_LIGHTING);
- glDisable(GL_LIGHT0);
- glDisableClientState(GL_VERTEX_ARRAY);
- glDisableClientState(GL_NORMAL_ARRAY);
- if (d->textureMode) {
- qt_gl_ClientActiveTexture(GL_TEXTURE0);
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
- glDisable(GL_TEXTURE_2D);
- }
- }
-#else
- Q_UNUSED(painter);
- Q_D(QGLLitMaterialEffect);
-#if !defined(QGL_SHADERS_ONLY)
- if (painter->isFixedFunction()) {
- d->isFixedFunction = true;
- if (flag) {
- glEnable(GL_LIGHTING);
- glEnable(GL_LIGHT0);
- glEnableClientState(GL_VERTEX_ARRAY);
- glEnableClientState(GL_NORMAL_ARRAY);
- if (d->textureMode) {
- qt_gl_ClientActiveTexture(GL_TEXTURE0);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, d->textureMode);
- glEnable(GL_TEXTURE_2D);
- }
- } else {
- glDisable(GL_LIGHTING);
- glDisable(GL_LIGHT0);
- glDisableClientState(GL_VERTEX_ARRAY);
- glDisableClientState(GL_NORMAL_ARRAY);
- if (d->textureMode) {
- qt_gl_ClientActiveTexture(GL_TEXTURE0);
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
- glDisable(GL_TEXTURE_2D);
- }
- }
- return;
- }
-#endif
- QGLShaderProgram *program = painter->cachedProgram(d->programName);
- d->program = program;
- if (!program) {
- if (!flag)
- return;
- program = new QGLShaderProgram();
- program->addShaderFromSourceCode(QGLShader::Vertex, createVertexSource(litMaterialLightingShader, d->vertexShader));
- program->addShaderFromSourceCode(QGLShader::Fragment, d->fragmentShader);
- program->bindAttributeLocation("vertex", QGL::Position);
- program->bindAttributeLocation("normal", QGL::Normal);
- if (d->textureMode != 0)
- program->bindAttributeLocation("texcoord", QGL::TextureCoord0);
- if (!program->link()) {
- qWarning("QGLLitMaterialEffect::setActive(): could not link shader program");
- delete program;
- program = 0;
- return;
- }
- painter->setCachedProgram(d->programName, program);
- d->program = program;
- d->matrixUniform = program->uniformLocation("matrix");
- d->modelViewUniform = program->uniformLocation("modelView");
- d->normalMatrixUniform = program->uniformLocation("normalMatrix");
- program->bind();
- if (d->textureMode != 0) {
- program->setUniformValue("tex", 0);
- program->enableAttributeArray(QGL::TextureCoord0);
- }
- program->enableAttributeArray(QGL::Position);
- program->enableAttributeArray(QGL::Normal);
- } else if (flag) {
- d->matrixUniform = program->uniformLocation("matrix");
- d->modelViewUniform = program->uniformLocation("modelView");
- d->normalMatrixUniform = program->uniformLocation("normalMatrix");
- program->bind();
- if (d->textureMode != 0) {
- program->setUniformValue("tex", 0);
- program->enableAttributeArray(QGL::TextureCoord0);
- }
- program->enableAttributeArray(QGL::Position);
- program->enableAttributeArray(QGL::Normal);
- } else {
- program->disableAttributeArray(QGL::Position);
- program->disableAttributeArray(QGL::Normal);
- if (d->textureMode != 0)
- program->disableAttributeArray(QGL::TextureCoord0);
- program->release();
- }
-#endif
-}
-
-/*!
- \reimp
-*/
-void QGLLitMaterialEffect::update
- (QGLPainter *painter, QGLPainter::Updates updates)
-{
-#if defined(QGL_FIXED_FUNCTION_ONLY)
- painter->updateFixedFunction
- (updates & (QGLPainter::UpdateMatrices |
- QGLPainter::UpdateLights |
- QGLPainter::UpdateMaterials));
-#else
- Q_D(QGLLitMaterialEffect);
-#if !defined(QGL_SHADERS_ONLY)
- if (d->isFixedFunction) {
- painter->updateFixedFunction
- (updates & (QGLPainter::UpdateMatrices |
- QGLPainter::UpdateLights |
- QGLPainter::UpdateMaterials));
- return;
- }
-#endif
- QGLShaderProgram *program = d->program;
- if ((updates & QGLPainter::UpdateMatrices) != 0) {
- program->setUniformValue(d->matrixUniform, painter->combinedMatrix());
- program->setUniformValue(d->modelViewUniform, painter->modelViewMatrix());
- program->setUniformValue(d->normalMatrixUniform, painter->normalMatrix());
- }
- const QGLLightParameters *lparams = painter->mainLight();
- QMatrix4x4 ltransform = painter->mainLightTransform();
- const QGLLightModel *model = painter->lightModel();
- if ((updates & (QGLPainter::UpdateLights | QGLPainter::UpdateMaterials)) != 0) {
- // Set the uniform variables for the light.
- program->setUniformValue
- ("sdli", lparams->eyeSpotDirection(ltransform).normalized());
- QVector4D pli = lparams->eyePosition(ltransform);
- program->setUniformValue("pli", QVector3D(pli.x(), pli.y(), pli.z()));
- program->setUniformValue("pliw", GLfloat(pli.w()));
- program->setUniformValue("srli", GLfloat(lparams->spotExponent()));
- program->setUniformValue("crli", GLfloat(lparams->spotAngle()));
- program->setUniformValue("ccrli", GLfloat(lparams->spotCosAngle()));
-#if !defined(QT_OPENGL_ES)
- // Attenuation is not supported under ES, for performance.
- program->setUniformValue("k0", GLfloat(lparams->constantAttenuation()));
- program->setUniformValue("k1", GLfloat(lparams->linearAttenuation()));
- program->setUniformValue("k2", GLfloat(lparams->quadraticAttenuation()));
-#endif
-
- // Set the uniform variables for the light model.
-#if !defined(QT_OPENGL_ES)
- program->setUniformValue("twoSided", (int)(model->model() == QGLLightModel::TwoSided));
-#endif
- program->setUniformValue("viewerAtInfinity", (int)(model->viewerPosition() == QGLLightModel::ViewerAtInfinity));
-#if !defined(QT_OPENGL_ES)
- if (d->textureMode != 0)
- program->setUniformValue("separateSpecular", (int)(model->colorControl() == QGLLightModel::SeparateSpecularColor));
-#endif
-
- // Set the uniform variables for the front and back materials.
-#if defined(QT_OPENGL_ES)
- static const int MaxMaterials = 1;
-#else
- static const int MaxMaterials = 2;
-#endif
- QVector4D acm[MaxMaterials];
- QVector4D dcm[MaxMaterials];
- QVector4D scm[MaxMaterials];
- QVector4D ecm[MaxMaterials];
- float srm[MaxMaterials];
- const QGLMaterial *mparams = painter->faceMaterial(QGL::FrontFaces);
- acm[0] = colorToVector4(mparams->ambientColor(), lparams->ambientColor());
- dcm[0] = colorToVector4(mparams->diffuseColor(), lparams->diffuseColor());
- scm[0] = colorToVector4(mparams->specularColor(), lparams->specularColor());
- ecm[0] = colorToVector4(mparams->emittedLight()) +
- colorToVector4(mparams->ambientColor(),
- model->ambientSceneColor());
- srm[0] = (float)(mparams->shininess());
-#if !defined(QT_OPENGL_ES)
- mparams = painter->faceMaterial(QGL::BackFaces);
- acm[1] = colorToVector4(mparams->ambientColor(), lparams->ambientColor());
- dcm[1] = colorToVector4(mparams->diffuseColor(), lparams->diffuseColor());
- scm[1] = colorToVector4(mparams->specularColor(), lparams->specularColor());
- ecm[1] = colorToVector4(mparams->emittedLight()) +
- colorToVector4(mparams->ambientColor(),
- model->ambientSceneColor());
- srm[1] = (float)(mparams->shininess());
-#endif
- program->setUniformValueArray("acm", (const GLfloat *)acm, MaxMaterials, 4);
- program->setUniformValueArray("dcm", (const GLfloat *)dcm, MaxMaterials, 4);
- program->setUniformValueArray("scm", (const GLfloat *)scm, MaxMaterials, 4);
- program->setUniformValueArray("ecm", (const GLfloat *)ecm, MaxMaterials, 4);
- program->setUniformValueArray("srm", srm, MaxMaterials, 1);
- }
-#endif
-}
-
-QT_END_NAMESPACE
diff --git a/src/threed/effects/qgllitmaterialeffect_p.h b/src/threed/effects/qgllitmaterialeffect_p.h
deleted file mode 100644
index f2afcf4c..00000000
--- a/src/threed/effects/qgllitmaterialeffect_p.h
+++ /dev/null
@@ -1,85 +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 QGLLITMATERIALEFFECT_P_H
-#define QGLLITMATERIALEFFECT_P_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 "qglabstracteffect.h"
-
-QT_BEGIN_NAMESPACE
-
-class QGLLitMaterialEffectPrivate;
-
-class QGLLitMaterialEffect : public QGLAbstractEffect
-{
-public:
- QGLLitMaterialEffect();
- virtual ~QGLLitMaterialEffect();
-
- void setActive(QGLPainter *painter, bool flag);
- void update(QGLPainter *painter, QGLPainter::Updates updates);
-
-protected:
- QGLLitMaterialEffect
- (GLenum mode, const char *vshader, const char *fshader,
- const QString& programName);
-
-private:
- QScopedPointer<QGLLitMaterialEffectPrivate> d_ptr;
-
- Q_DECLARE_PRIVATE(QGLLitMaterialEffect)
- Q_DISABLE_COPY(QGLLitMaterialEffect)
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/threed/effects/qgllittextureeffect.cpp b/src/threed/effects/qgllittextureeffect.cpp
deleted file mode 100644
index 6d17dce8..00000000
--- a/src/threed/effects/qgllittextureeffect.cpp
+++ /dev/null
@@ -1,215 +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 "qgllittextureeffect_p.h"
-#include "qglabstracteffect_p.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGLLitTextureEffect
- \since 4.8
- \brief The QGLLitTextureEffect class provides a standard effect base class for drawing fragments with a lit texture.
- \ingroup qt3d
- \ingroup qt3d::painting
- \internal
-
- \sa QGLLitDecalTextureEffect, QGLLitModulateTextureEffect
-*/
-
-/*!
- \class QGLLitDecalTextureEffect
- \since 4.8
- \brief The QGLLitDecalTextureEffect class provides a standard effect for drawing fragments with a texture decaled over a lit material.
- \ingroup qt3d
- \ingroup qt3d::painting
- \internal
-*/
-
-/*!
- \class QGLLitModulateTextureEffect
- \since 4.8
- \brief The QGLLitModulateTextureEffect class provides a standard effect for drawing fragments with a texture modulated with a lit material.
- \ingroup qt3d
- \ingroup qt3d::painting
- \internal
-*/
-
-/*!
- \internal
-*/
-QGLLitTextureEffect::QGLLitTextureEffect
- (GLenum mode, const char *vshader, const char *fshader,
- const QString& programName)
- : QGLLitMaterialEffect(mode, vshader, fshader, programName)
-{
-}
-
-/*!
- Destroys this lit texture effect.
-*/
-QGLLitTextureEffect::~QGLLitTextureEffect()
-{
-}
-
-#if !defined(QGL_FIXED_FUNCTION_ONLY)
-
-static char const litTextureVertexShader[] =
- "attribute highp vec4 vertex;\n"
- "attribute highp vec3 normal;\n"
- "attribute highp vec4 texcoord;\n"
- "uniform highp mat4 matrix;\n"
- "uniform highp mat4 modelView;\n"
- "uniform highp mat3 normalMatrix;\n"
- "varying highp vec4 qt_TexCoord0;\n"
- "void main(void)\n"
- "{\n"
- " gl_Position = matrix * vertex;\n"
- " highp vec4 tvertex = modelView * vertex;\n"
- " highp vec3 norm = normalize(normalMatrix * normal);\n"
- " qLightVertex(tvertex, norm);\n"
- " qt_TexCoord0 = texcoord;\n"
- "}\n";
-
-static char const litDecalFragmentShader[] =
- "uniform sampler2D tex;\n"
-#if defined(QT_OPENGL_ES)
- "varying mediump vec4 qCombinedColor;\n"
-#else
- "uniform bool separateSpecular;\n"
- "varying mediump vec4 qColor;\n"
- "varying mediump vec4 qSecondaryColor;\n"
-#endif
- "varying highp vec4 qt_TexCoord0;\n"
- "\n"
- "void main(void)\n"
- "{\n"
- " mediump vec4 col = texture2D(tex, qt_TexCoord0.st);\n"
-#if defined(QT_OPENGL_ES)
- " gl_FragColor = vec4(clamp(qCombinedColor.rgb * (1.0 - col.a) + col.rgb * col.a, 0.0, 1.0), qCombinedColor.a);\n"
-#else
- " if (separateSpecular) {\n"
- " gl_FragColor = vec4(clamp(qColor.rgb * (1.0 - col.a) + col.rgb * col.a + qSecondaryColor.xyz, 0.0, 1.0), qColor.a);\n"
- " } else {\n"
- " mediump vec4 lcolor = clamp(qColor + vec4(qSecondaryColor.xyz, 0.0), 0.0, 1.0);\n"
- " gl_FragColor = vec4(clamp(lcolor.rgb * (1.0 - col.a) + col.rgb * col.a, 0.0, 1.0), lcolor.a);\n"
- " }\n"
-#endif
- "}\n";
-
-static char const litModulateFragmentShader[] =
- "uniform sampler2D tex;\n"
-#if defined(QT_OPENGL_ES)
- "varying mediump vec4 qCombinedColor;\n"
-#else
- "uniform bool separateSpecular;\n"
- "varying mediump vec4 qColor;\n"
- "varying mediump vec4 qSecondaryColor;\n"
-#endif
- "varying highp vec4 qt_TexCoord0;\n"
- "\n"
- "void main(void)\n"
- "{\n"
- " mediump vec4 col = texture2D(tex, qt_TexCoord0.st);\n"
-#if defined(QT_OPENGL_ES)
- " gl_FragColor = col * qCombinedColor;\n"
-#else
- " if (separateSpecular) {\n"
- " gl_FragColor = clamp(col * qColor + vec4(qSecondaryColor.xyz, 0.0), 0.0, 1.0);\n"
- " } else {\n"
- " mediump vec4 lcolor = clamp(qColor + vec4(qSecondaryColor.xyz, 0.0), 0.0, 1.0);\n"
- " gl_FragColor = col * lcolor;\n"
- " }\n"
-#endif
- "}\n";
-
-#endif
-
-#ifndef GL_MODULATE
-#define GL_MODULATE 0x2100
-#endif
-#ifndef GL_DECAL
-#define GL_DECAL 0x2101
-#endif
-
-/*!
- Constructs a new lit decal texture effect.
-*/
-QGLLitDecalTextureEffect::QGLLitDecalTextureEffect()
-#if defined(QGL_FIXED_FUNCTION_ONLY)
- : QGLLitTextureEffect(GL_DECAL, 0, 0, QString())
-#else
- : QGLLitTextureEffect(GL_DECAL,
- litTextureVertexShader, litDecalFragmentShader,
- QLatin1String("qt.texture.litdecal"))
-#endif
-{
-}
-
-/*!
- Destroys this lit decal texture effect.
-*/
-QGLLitDecalTextureEffect::~QGLLitDecalTextureEffect()
-{
-}
-
-/*!
- Constructs a new lit modulate texture effect.
-*/
-QGLLitModulateTextureEffect::QGLLitModulateTextureEffect()
-#if defined(QGL_FIXED_FUNCTION_ONLY)
- : QGLLitTextureEffect(GL_MODULATE, 0, 0, QString())
-#else
- : QGLLitTextureEffect(GL_MODULATE,
- litTextureVertexShader, litModulateFragmentShader,
- QLatin1String("qt.texture.litmodulate"))
-#endif
-{
-}
-
-/*!
- Destroys this lit modulate texture effect.
-*/
-QGLLitModulateTextureEffect::~QGLLitModulateTextureEffect()
-{
-}
-
-QT_END_NAMESPACE
diff --git a/src/threed/effects/qgllittextureeffect_p.h b/src/threed/effects/qgllittextureeffect_p.h
deleted file mode 100644
index 2c534ae7..00000000
--- a/src/threed/effects/qgllittextureeffect_p.h
+++ /dev/null
@@ -1,86 +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 QGLLITTEXTUREEFFECT_P_H
-#define QGLLITTEXTUREEFFECT_P_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 "qgllitmaterialeffect_p.h"
-
-QT_BEGIN_NAMESPACE
-
-class QGLLitTextureEffect : public QGLLitMaterialEffect
-{
-public:
- virtual ~QGLLitTextureEffect();
-
-protected:
- QGLLitTextureEffect(GLenum mode, const char *vshader, const char *fshader,
- const QString& programName);
-};
-
-class QGLLitDecalTextureEffect : public QGLLitTextureEffect
-{
-public:
- QGLLitDecalTextureEffect();
- virtual ~QGLLitDecalTextureEffect();
-};
-
-class QGLLitModulateTextureEffect : public QGLLitTextureEffect
-{
-public:
- QGLLitModulateTextureEffect();
- virtual ~QGLLitModulateTextureEffect();
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/threed/effects/qglshaderprogrameffect.cpp b/src/threed/effects/qglshaderprogrameffect.cpp
deleted file mode 100644
index 5c771230..00000000
--- a/src/threed/effects/qglshaderprogrameffect.cpp
+++ /dev/null
@@ -1,1131 +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 "qglshaderprogrameffect.h"
-#include "qglabstracteffect_p.h"
-#include <QtOpenGL/qglshaderprogram.h>
-#include <QtCore/qfile.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGLShaderProgramEffect
- \since 4.8
- \brief The QGLShaderProgramEffect class provides applications with the ability to use shader programs written in GLSL as effects for 3D rendering.
- \ingroup qt3d
- \ingroup qt3d::painting
-
- \section1 Writing portable shaders
-
- Shader programs can be difficult to reuse across OpenGL implementations
- because of varying levels of support for standard vertex attributes and
- uniform variables. In particular, GLSL/ES lacks all of the
- standard variables that are present on desktop OpenGL systems:
- \c{gl_Vertex}, \c{gl_Normal}, \c{gl_Color}, and so on. Desktop OpenGL
- lacks the variable qualifiers \c{highp}, \c{mediump}, and \c{lowp}.
-
- QGLShaderProgramEffect is built on top of
- \l{http://doc.qt.nokia.com/4.7/qglshaderprogram.html}{QGLShaderProgram},
- which makes the process of writing portable shaders easier by
- prefixing all shader programs with the following lines on desktop OpenGL:
-
- \code
- #define highp
- #define mediump
- #define lowp
- \endcode
-
- This makes it possible to run most GLSL/ES shader programs
- on desktop systems. The programmer should also restrict themselves
- to just features that are present in GLSL/ES, and avoid
- standard variable names that only work on the desktop.
-
- QGLShaderProgramEffect also defines some standard attribute and uniform
- variable names that all shaders are expected to use. The following
- sections define these standard names.
-
- \section1 Attributes
-
- QGLShaderProgramEffect provides a standard set of 8 named vertex
- attributes that can be provided via QGLPainter::setVertexBundle():
-
- \table
- \header \o Shader Variable \o Mesh Attribute \o Purpose
- \row \o \c qt_Vertex \o QGL::Position
- \o The primary position of the vertex.
- \row \o \c qt_Normal \o QGL::Normal
- \o The normal at each vertex, for lit material effects.
- \row \o \c qt_Color \o QGL::Color
- \o The color at each vertex, for per-vertex color effects.
- \row \o \c qt_MultiTexCoord0 \o QGL::TextureCoord0
- \o The texture co-ordinate at each vertex for texture unit 0.
- \row \o \c qt_MultiTexCoord1 \o QGL::TextureCoord1
- \o Secondary texture co-ordinate at each vertex.
- \row \o \c qt_MultiTexCoord2 \o QGL::TextureCoord2
- \o Tertiary texture co-ordinate at each vertex.
- \row \o \c qt_Custom0 \o QGL::CustomVertex0
- \o First custom vertex attribute that can be used for any
- user-defined purpose.
- \row \o \c qt_Custom1 \o QGL::CustomVertex1
- \o Second custom vertex attribute that can be used for any
- user-defined purpose.
- \endtable
-
- These attributes may be used in the vertexShader(), as in the following
- example of a simple texture shader:
-
- \code
- attribute highp vec4 qt_Vertex;
- attribute highp vec4 qt_MultiTexCoord0;
- uniform mediump mat4 qt_ModelViewProjectionMatrix;
- varying highp vec4 qt_TexCoord0;
-
- void main(void)
- {
- gl_Position = qt_ModelViewProjectionMatrix * qt_Vertex;
- qt_TexCoord0 = qt_MultiTexCoord0;
- }
- \endcode
-
- \section1 Uniform variables
-
- QGLShaderProgramEffect provides a standard set of uniform variables for
- common values from the QGLPainter environment:
-
- \table
- \header \o Shader Variable \o Purpose
- \row \o \c qt_ModelViewProjectionMatrix
- \o Combination of the modelview and projection matrices into a
- single 4x4 matrix.
- \row \o \c qt_ModelViewMatrix
- \o Modelview matrix without the projection. This is typically
- used for performing calculations in eye co-ordinates.
- \row \o \c qt_ProjectionMatrix
- \o Projection matrix without the modelview.
- \row \o \c qt_NormalMatrix
- \o Normal matrix, which is the transpose of the inverse of the
- top-left 3x3 part of the modelview matrix. This is typically
- used in lighting calcuations to transform \c qt_Normal.
- \row \o \c qt_WorldMatrix
- \o Modelview matrix without the eye position and orientation
- component. See QGLPainter::worldMatrix() for further
- information.
- \row \o \c qt_Texture0
- \o Sampler corresponding to the texture on unit 0.
- \row \o \c qt_Texture1
- \o Sampler corresponding to the texture on unit 1.
- \row \o \c qt_Texture2
- \o Sampler corresponding to the texture on unit 2.
- \row \o \c qt_Color
- \o Set to the value of the QGLPainter::color() property.
- This is typically used for flat-color shaders that do
- not involve lighting. Note that this is different from
- the \c qt_Color attribute, which provides per-vertex colors.
- \endtable
-
- The above variables are usually declared in the shaders as follows
- (where \c highp may be replaced with \c mediump or \c lowp depending
- upon the shader's precision requirements):
-
- \code
- uniform highp mat4 qt_ModelViewProjectionMatrix;
- uniform highp mat4 qt_ModelViewMatrix;
- uniform highp mat4 qt_ProjectionMatrix;
- uniform highp mat3 qt_NormalMatrix;
- uniform sampler2D qt_Texture0;
- uniform sampler2D qt_Texture1;
- uniform sampler2D qt_Texture2;
- uniform highp vec4 qt_Color;
- \endcode
-
- \section1 Material parameters
-
- QGLShaderProgramEffect will provide information about the front and
- back materials from QGLPainter::faceMaterial() if the
- \c qt_Materials array is present in the shader code.
- The array should be declared as follows:
-
- \code
- struct qt_MaterialParameters {
- mediump vec4 emission;
- mediump vec4 ambient;
- mediump vec4 diffuse;
- mediump vec4 specular;
- mediump float shininess;
- };
- uniform qt_MaterialParameters qt_Materials[2];
- \endcode
-
- The front material will be provided as index 0 and the back
- material will be provided as index 1. If the shader only
- needs a single material, then the \c qt_Material variable
- can be declared instead:
-
- \code
- uniform qt_MaterialParameters qt_Material;
- \endcode
-
- The front material will be provided as the value of \c qt_Material
- and the back material will be ignored.
-
- Note: the \c emission parameter is actually QGLMaterial::emittedLight()
- combined with the QGLLightModel::ambientSceneColor() and
- QGLMaterial::ambientColor(). This helps simplify lighting shaders.
-
- \section1 Lighting parameters
-
- QGLShaderProgramEffect will provide information about the current lights
- specified on the QGLPainter if the \c qt_Lights array is present
- in the shader code. The array should be declared as follows:
-
- \code
- struct qt_LightParameters {
- mediump vec4 ambient;
- mediump vec4 diffuse;
- mediump vec4 specular;
- mediump vec4 position;
- mediump vec3 spotDirection;
- mediump float spotExponent;
- mediump float spotCutoff;
- mediump float spotCosCutoff;
- mediump float constantAttenuation;
- mediump float linearAttenuation;
- mediump float quadraticAttenuation;
- };
- const int qt_MaxLights = 8;
- uniform qt_LightParameters qt_Lights[qt_MaxLights];
- uniform int qt_NumLights;
- \endcode
-
- As shown, up to 8 lights can be supported at once. Usually this is
- more lights than most shaders need, and so the user can change the
- \c qt_MaxLights constant to a smaller value if they wish. Be sure
- to also call setMaximumLights() to tell QGLShaderProgramEffect about
- the new light count limit.
-
- The \c qt_NumLights uniform variable will be set to the actual number
- of lights that are active on the QGLPainter when update() is called.
-
- Because most shaders will only need a single light, the shader can
- declare the \c qt_Light variable instead of the \c qt_Lights array:
-
- \code
- struct qt_SingleLightParameters {
- mediump vec4 position;
- mediump vec3 spotDirection;
- mediump float spotExponent;
- mediump float spotCutoff;
- mediump float spotCosCutoff;
- mediump float constantAttenuation;
- mediump float linearAttenuation;
- mediump float quadraticAttenuation;
- };
- uniform qt_SingleLightParameters qt_Light;
- \endcode
-
- Note that we have omitted the \c ambient, \c diffuse, and \c specular
- colors for the single light. QGLShaderProgramEffect will combine the material
- and light colors ahead of time into \c qt_Material or \c qt_Materials.
- This makes lighting shaders more efficient because they do not have
- to compute \c material_color * \c light_color; just \c material_color
- is sufficient.
-
- \section1 Varying variables
-
- The name and purpose of the varying variables is up to the
- author of the vertex and fragment shaders, but the following names
- are recommended for texture co-ordinates:
-
- \table
- \header \o Varying Variable \o Purpose
- \row \o \c qt_TexCoord0
- \o Texture coordinate for unit 0, copied from the \c qt_MultiTexCoord0
- attribute.
- \row \o \c qt_TexCoord1
- \o Texture coordinate for unit 1, copied from the \c qt_MultiTexCoord1
- attribute.
- \row \o \c qt_TexCoord2
- \o Texture coordinate for unit 2, copied from the \c qt_MultiTexCoord2
- attribute.
- \endtable
-
- \section1 Lighting shader example
-
- The following example demonstrates what a lighting shader that
- uses a single light, a single material, and a texture might look like.
- The shader is quite complex but demonstrates most of the features that
- can be found in the lighting implementation of a fixed-function
- OpenGL pipeline:
-
- \code
- attribute highp vec4 qt_Vertex;
- uniform highp mat4 qt_ModelViewProjectionMatrix;
- attribute highp vec3 qt_Normal;
- uniform highp mat4 qt_ModelViewMatrix;
- uniform highp mat3 qt_NormalMatrix;
- attribute highp vec4 qt_MultiTexCoord0;
- varying highp vec4 qt_TexCoord0;
-
- struct qt_MaterialParameters {
- mediump vec4 emission;
- mediump vec4 ambient;
- mediump vec4 diffuse;
- mediump vec4 specular;
- mediump float shininess;
- };
- uniform qt_MaterialParameters qt_Material;
-
- struct qt_SingleLightParameters {
- mediump vec4 position;
- mediump vec3 spotDirection;
- mediump float spotExponent;
- mediump float spotCutoff;
- mediump float spotCosCutoff;
- mediump float constantAttenuation;
- mediump float linearAttenuation;
- mediump float quadraticAttenuation;
- };
- uniform qt_SingleLightParameters qt_Light;
-
- varying mediump vec4 litColor;
- varying mediump vec4 litSecondaryColor;
-
- void main(void)
- {
- gl_Position = qt_ModelViewProjectionMatrix * qt_Vertex;
- gTexCoord0 = qt_MultiTexCoord0;
-
- // Calculate the vertex and normal to use for lighting calculations.
- highp vec4 vertex = qt_ModelViewMatrix * qt_Vertex;
- highp vec3 normal = normalize(qt_NormalMatrix * qt_Normal);
-
- // Start with the material's emissive color and the ambient scene color,
- // which have been combined into the emission parameter.
- vec4 color = ggl_Material.emission;
-
- // Viewer is at infinity.
- vec3 toEye = vec3(0, 0, 1);
-
- // Determine the angle between the normal and the light direction.
- vec4 pli = qt_Light.position;
- vec3 toLight;
- if (pli.w == 0.0)
- toLight = normalize(pli.xyz);
- else
- toLight = normalize(pli.xyz - vertex.xyz);
- float angle = max(dot(normal, toLight), 0.0);
-
- // Calculate the ambient and diffuse light components.
- vec4 adcomponent = qt_Material.ambient + angle * qt_Material.diffuse;
-
- // Calculate the specular light components.
- vec4 scomponent;
- if (angle != 0.0) {
- vec3 h = normalize(toLight + toEye);
- angle = max(dot(normal, h), 0.0);
- float srm = qt_Material.shininess;
- vec4 scm = qt_Material.specular;
- if (srm != 0.0)
- scomponent = pow(angle, srm) * scm;
- else
- scomponent = scm;
- } else {
- scomponent = vec4(0, 0, 0, 0);
- }
-
- // Apply the spotlight angle and exponent.
- if (qt_Light.spotCutoff != 180.0) {
- float spot = max(dot(normalize(vertex.xyz - pli.xyz),
- qt_Light.spotDirection), 0.0);
- if (spot < qt_Light.spotCosCutoff) {
- adcomponent = vec4(0, 0, 0, 0);
- scomponent = vec4(0, 0, 0, 0);
- } else {
- spot = pow(spot, qt_Light.spotExponent);
- adcomponent *= spot;
- scomponent *= spot;
- }
- }
-
- // Apply attenuation to the colors.
- if (pli.w != 0.0) {
- float attenuation = qt_Light.constantAttenuation;
- float k1 = qt_Light.linearAttenuation;
- float k2 = qt_Light.quadraticAttenuation;
- if (k1 != 0.0 || k2 != 0.0) {
- float len = length(pli.xyz - vertex.xyz);
- attenuation += k1 * len + k2 * len * len;
- }
- color += adcomponent / attenuation;
- scolor += scomponent / attenuation;
- } else {
- color += adcomponent;
- scolor += scomponent;
- }
-
- // Generate the final output colors to pass to the fragment shader.
- float alpha = qt_Material.diffuse.a;
- litColor = vec4(clamp(color.rgb, 0.0, 1.0), alpha);
- litSecondaryColor = vec4(clamp(scolor.rgb, 0.0, 1.0), 0.0);
- }
- \endcode
-
- The corresponding fragment shader is as follows:
-
- \code
- varying mediump vec4 litColor;
- varying mediump vec4 litSecondaryColor;
- varying highp vec4 qt_TexCoord0;
-
- void main(void)
- {
- vec4 color = litColor * texture2D(qt_Texture0, qt_TexCoord0.st);
- gl_FragColor = clamp(color + litSecondaryColor, 0.0, 1.0);
- }
- \endcode
-
- \section1 Fixed function operation
-
- If the OpenGL implementation does not support shaders, then
- QGLShaderProgramEffect will fall back to a flat color effect based
- on QGLPainter::color(). It is recommended that the application
- consult QGLPainter::isFixedFunction() to determine if some
- other effect should be used instead.
-*/
-
-class QGLShaderProgramEffectPrivate
-{
-public:
- QGLShaderProgramEffectPrivate()
- : geometryInputType(GL_TRIANGLE_STRIP)
- , geometryOutputType(GL_TRIANGLE_STRIP)
- , maximumLights(8)
- , attributes(0)
- , regenerate(true)
- , fixedFunction(false)
-#if !defined(QGL_FIXED_FUNCTION_ONLY)
- , program(0)
- , matrix(-1)
- , mvMatrix(-1)
- , projMatrix(-1)
- , normalMatrix(-1)
- , worldMatrix(-1)
- , texture0(-1)
- , texture1(-1)
- , texture2(-1)
- , color(-1)
- , numLights(-1)
- , haveLight(0)
- , haveLights(0)
- , haveMaterial(0)
- , haveMaterials(0)
-#endif
- {
- }
- ~QGLShaderProgramEffectPrivate()
- {
-#if !defined(QGL_FIXED_FUNCTION_ONLY)
- delete program;
-#endif
- }
-
- QByteArray vertexShader;
- QByteArray fragmentShader;
- QByteArray geometryShader;
- GLenum geometryInputType;
- GLenum geometryOutputType;
- int maximumLights;
- int attributes;
- bool regenerate;
- bool fixedFunction;
-#if !defined(QGL_FIXED_FUNCTION_ONLY)
- QGLShaderProgram *program;
- int matrix;
- int mvMatrix;
- int projMatrix;
- int normalMatrix;
- int worldMatrix;
- int texture0;
- int texture1;
- int texture2;
- int color;
- int numLights;
- int haveLight : 1;
- int haveLights : 1;
- int haveMaterial : 1;
- int haveMaterials : 1;
-
- void setUniformValue
- (const char *array, int index, const char *field, GLfloat v);
- void setUniformValue
- (const char *array, int index, const char *field, const QVector3D &v);
- void setUniformValue
- (const char *array, int index, const char *field, const QVector4D &v);
- void setUniformValue
- (const char *array, int index, const char *field, const QColor &v);
-
- void setLight
- (const QGLLightParameters *lparams, const QMatrix4x4 &ltransform,
- const char *array, int index);
- void setMaterial
- (const QGLMaterial *mparams, const QGLLightModel *model,
- const QGLLightParameters *lparams, const char *array, int index);
-#endif
-};
-
-#if !defined(QGL_FIXED_FUNCTION_ONLY)
-
-void QGLShaderProgramEffectPrivate::setUniformValue
- (const char *array, int index, const char *field, GLfloat v)
-{
- char name[128];
- if (index >= 0)
- qsnprintf(name, sizeof(name), "%s[%d].%s", array, index, field);
- else
- qsnprintf(name, sizeof(name), "%s.%s", array, field);
- program->setUniformValue(name, v);
-}
-
-void QGLShaderProgramEffectPrivate::setUniformValue
- (const char *array, int index, const char *field, const QVector3D &v)
-{
- char name[128];
- if (index >= 0)
- qsnprintf(name, sizeof(name), "%s[%d].%s", array, index, field);
- else
- qsnprintf(name, sizeof(name), "%s.%s", array, field);
- program->setUniformValue(name, v);
-}
-
-void QGLShaderProgramEffectPrivate::setUniformValue
- (const char *array, int index, const char *field, const QVector4D &v)
-{
- char name[128];
- if (index >= 0)
- qsnprintf(name, sizeof(name), "%s[%d].%s", array, index, field);
- else
- qsnprintf(name, sizeof(name), "%s.%s", array, field);
- program->setUniformValue(name, v);
-}
-
-void QGLShaderProgramEffectPrivate::setUniformValue
- (const char *array, int index, const char *field, const QColor &v)
-{
- char name[128];
- if (index >= 0)
- qsnprintf(name, sizeof(name), "%s[%d].%s", array, index, field);
- else
- qsnprintf(name, sizeof(name), "%s.%s", array, field);
- program->setUniformValue(name, v);
-}
-
-void QGLShaderProgramEffectPrivate::setLight
- (const QGLLightParameters *lparams, const QMatrix4x4 &ltransform,
- const char *array, int index)
-{
- if (index >= 0) {
- // Single lights embed the color values into the material.
- setUniformValue(array, index, "ambient", lparams->ambientColor());
- setUniformValue(array, index, "diffuse", lparams->diffuseColor());
- setUniformValue(array, index, "specular", lparams->specularColor());
- }
- setUniformValue
- (array, index, "position", lparams->eyePosition(ltransform));
- setUniformValue
- (array, index, "spotDirection",
- lparams->eyeSpotDirection(ltransform).normalized());
- setUniformValue
- (array, index, "spotExponent", GLfloat(lparams->spotExponent()));
- setUniformValue
- (array, index, "spotCutoff", GLfloat(lparams->spotAngle()));
- setUniformValue
- (array, index, "spotCosCutoff", GLfloat(lparams->spotCosAngle()));
- setUniformValue
- (array, index, "constantAttenuation",
- GLfloat(lparams->constantAttenuation()));
- setUniformValue
- (array, index, "linearAttenuation",
- GLfloat(lparams->linearAttenuation()));
- setUniformValue
- (array, index, "quadraticAttenuation",
- GLfloat(lparams->quadraticAttenuation()));
-}
-
-static inline QVector4D colorToVector4(const QColor& color)
-{
- return QVector4D(color.redF(), color.greenF(),
- color.blueF(), color.alphaF());
-}
-
-// Combine a material and light color into a single color.
-static inline QVector4D colorToVector4
- (const QColor &color, const QColor &lightColor)
-{
- return QVector4D(color.redF() * lightColor.redF(),
- color.greenF() * lightColor.greenF(),
- color.blueF() * lightColor.blueF(),
- color.alphaF() * lightColor.alphaF());
-}
-
-void QGLShaderProgramEffectPrivate::setMaterial
- (const QGLMaterial *mparams, const QGLLightModel *model,
- const QGLLightParameters *lparams, const char *array, int index)
-{
- if (lparams) {
- setUniformValue
- (array, index, "ambient",
- colorToVector4(mparams->ambientColor(), lparams->ambientColor()));
- setUniformValue
- (array, index, "diffuse",
- colorToVector4(mparams->diffuseColor(), lparams->diffuseColor()));
- setUniformValue
- (array, index, "specular",
- colorToVector4(mparams->specularColor(), lparams->specularColor()));
- } else {
- setUniformValue
- (array, index, "ambient", mparams->ambientColor());
- setUniformValue
- (array, index, "diffuse", mparams->diffuseColor());
- setUniformValue
- (array, index, "specular", mparams->specularColor());
- }
- setUniformValue
- (array, index, "emission",
- colorToVector4(mparams->emittedLight()) +
- colorToVector4(mparams->ambientColor(), model->ambientSceneColor()));
- setUniformValue
- (array, index, "shininess", GLfloat(mparams->shininess()));
-}
-
-#endif // !QGL_FIXED_FUNCTION_ONLY
-
-/*!
- Constructs a new shader program effect. This constructor is typically
- followed by calls to setVertexShader() and setFragmentShader().
-
- Note that a shader program effect will be bound to the QGLContext that
- is current when setActive() is called for the first time. After that,
- the effect can only be used with that context or any other QGLContext
- that shares with it.
-*/
-QGLShaderProgramEffect::QGLShaderProgramEffect()
- : d_ptr(new QGLShaderProgramEffectPrivate)
-{
-}
-
-/*!
- Destroys this shader program effect.
-*/
-QGLShaderProgramEffect::~QGLShaderProgramEffect()
-{
-}
-
-/*!
- \reimp
-*/
-void QGLShaderProgramEffect::setActive(QGLPainter *painter, bool flag)
-{
- Q_D(QGLShaderProgramEffect);
-
-#if !defined(QGL_SHADERS_ONLY)
- d->fixedFunction = painter->isFixedFunction();
- if (d->fixedFunction) {
- // Fixed function emulation is flat color only.
- if (flag)
- glEnableClientState(GL_VERTEX_ARRAY);
- else
- glDisableClientState(GL_VERTEX_ARRAY);
- return;
- }
-#endif
-
-#if !defined(QGL_FIXED_FUNCTION_ONLY)
- static const char *const attributes[] = {
- "qt_Vertex",
- "qt_Normal",
- "qt_Color",
- "qt_MultiTexCoord0",
- "qt_MultiTexCoord1",
- "qt_MultiTexCoord2",
- "qt_Custom0",
- "qt_Custom1"
- };
- const int numAttributes = 8;
- Q_UNUSED(painter);
- int attr;
- if (d->regenerate) {
- // The shader source has changed since the last call to setActive().
- delete d->program;
- d->program = 0;
- d->regenerate = false;
- }
- if (!d->program) {
- if (!flag)
- return;
- if (d->vertexShader.isEmpty() || d->fragmentShader.isEmpty())
- return;
-
- d->program = new QGLShaderProgram();
- d->program->addShaderFromSourceCode
- (QGLShader::Vertex, d->vertexShader);
- d->program->addShaderFromSourceCode
- (QGLShader::Fragment, d->fragmentShader);
- if (!d->geometryShader.isEmpty())
- {
- d->program->addShaderFromSourceCode
- (QGLShader::Geometry, d->geometryShader);
- d->program->setGeometryInputType(d->geometryInputType);
- d->program->setGeometryOutputType(d->geometryOutputType);
-
- }
-
- if (beforeLink()) {
- for (attr = 0; attr < numAttributes; ++attr)
- d->program->bindAttributeLocation(attributes[attr], attr);
- }
- if (!d->program->link()) {
- qWarning("QGLShaderProgramEffect::setActive(): could not link shader program");
- delete d->program;
- d->program = 0;
- return;
- }
- afterLink();
- d->attributes = 0;
- for (attr = 0; attr < numAttributes; ++attr) {
- // Determine which attributes were actually present in the program.
- if (d->program->attributeLocation(attributes[attr]) != -1)
- d->attributes |= (1 << attr);
- }
- if (d->program->attributeLocation("qgl_Vertex") != -1)
- qWarning("QGLShaderProgramEffect: qgl_Vertex no longer supported; use qt_Vertex instead");
- d->matrix = d->program->uniformLocation("qt_ModelViewProjectionMatrix");
- d->mvMatrix = d->program->uniformLocation("qt_ModelViewMatrix");
- d->projMatrix = d->program->uniformLocation("qt_ProjectionMatrix");
- d->normalMatrix = d->program->uniformLocation("qt_NormalMatrix");
- d->worldMatrix = d->program->uniformLocation("qt_WorldMatrix");
- d->texture0 = d->program->uniformLocation("qt_Texture0");
- d->texture1 = d->program->uniformLocation("qt_Texture1");
- d->texture2 = d->program->uniformLocation("qt_Texture2");
- d->color = d->program->uniformLocation("qt_Color");
- d->numLights = d->program->uniformLocation("qt_NumLights");
- d->haveLight =
- (d->program->uniformLocation("qt_Light.position") != -1);
- d->haveLights =
- (d->program->uniformLocation("qt_Lights[0].position") != -1);
- d->haveMaterial =
- (d->program->uniformLocation("qt_Material.ambient") != -1) ||
- (d->program->uniformLocation("qt_Material.diffuse") != -1) ||
- (d->program->uniformLocation("qt_Material.specular") != -1) ||
- (d->program->uniformLocation("qt_Material.emission") != -1);
- d->haveMaterials =
- (d->program->uniformLocation("qt_Material[0].ambient") != -1) ||
- (d->program->uniformLocation("qt_Material[0].diffuse") != -1) ||
- (d->program->uniformLocation("qt_Material[0].specular") != -1) ||
- (d->program->uniformLocation("qt_Material[0].emission") != -1);
- }
- if (flag) {
- d->program->bind();
- for (attr = 0; attr < numAttributes; ++attr) {
- if ((d->attributes & (1 << attr)) == 0)
- continue;
- d->program->enableAttributeArray(attr);
- }
- if (d->texture0 != -1)
- d->program->setUniformValue(d->texture0, 0);
- if (d->texture1 != -1)
- d->program->setUniformValue(d->texture1, 1);
- if (d->texture2 != -1)
- d->program->setUniformValue(d->texture2, 2);
- } else {
- for (attr = 0; attr < int(QGL::UserVertex); ++attr) {
- if ((d->attributes & (1 << attr)) != 0)
- d->program->disableAttributeArray(attr);
- }
- d->program->release();
- }
-#endif
-}
-
-/*!
- \reimp
-*/
-void QGLShaderProgramEffect::update(QGLPainter *painter, QGLPainter::Updates updates)
-{
- Q_D(QGLShaderProgramEffect);
-#if !defined(QGL_SHADERS_ONLY)
- if (d->fixedFunction) {
- // Fixed function emulation is flat color only.
- painter->updateFixedFunction
- (updates & (QGLPainter::UpdateColor | QGLPainter::UpdateMatrices));
- return;
- }
-#endif
-#if !defined(QGL_FIXED_FUNCTION_ONLY)
- if ((updates & QGLPainter::UpdateColor) != 0 && d->color != -1)
- d->program->setUniformValue(d->color, painter->color());
- if ((updates & QGLPainter::UpdateMatrices) != 0) {
- if (d->matrix != -1)
- d->program->setUniformValue(d->matrix, painter->combinedMatrix());
- }
- if ((updates & QGLPainter::UpdateModelViewMatrix) != 0) {
- if (d->mvMatrix != -1)
- d->program->setUniformValue(d->mvMatrix, painter->modelViewMatrix());
- if (d->normalMatrix != -1)
- d->program->setUniformValue(d->normalMatrix, painter->normalMatrix());
- if (d->worldMatrix != -1)
- d->program->setUniformValue(d->worldMatrix, painter->worldMatrix());
- }
- if ((updates & QGLPainter::UpdateProjectionMatrix) != 0) {
- if (d->projMatrix != -1)
- d->program->setUniformValue(d->projMatrix, painter->projectionMatrix());
- }
- if ((updates & QGLPainter::UpdateLights) != 0) {
- if (d->haveLight) {
- // Only one light needed so make it the main light.
- d->setLight(painter->mainLight(), painter->mainLightTransform(),
- "qt_Light", -1);
- } else if (d->haveLights) {
- // Shader supports multiple light sources.
- int numLights = 0;
- int maxLightId = painter->maximumLightId();
- if (maxLightId < 0) {
- // No lights - re-enable the main light so we have something.
- painter->mainLight();
- maxLightId = 0;
- }
- for (int lightId = 0; lightId <= maxLightId; ++lightId) {
- // Is this light currently enabled?
- const QGLLightParameters *lparams = painter->light(lightId);
- if (!lparams)
- continue;
-
- // Set the parameters for the next shader light number.
- d->setLight(lparams, painter->lightTransform(lightId),
- "qt_Lights", numLights);
-
- // Bail out if we've hit the maximum shader light limit.
- ++numLights;
- if (numLights >= d->maximumLights)
- break;
- }
- if (d->numLights != -1)
- d->program->setUniformValue(d->numLights, numLights);
- }
- }
- if ((updates & QGLPainter::UpdateMaterials) != 0 ||
- ((updates & QGLPainter::UpdateLights) != 0 && d->haveLight)) {
- if (d->haveLight) {
- // For a single light source, combine the light colors
- // into the material colors.
- if (d->haveMaterial) {
- d->setMaterial(painter->faceMaterial(QGL::FrontFaces),
- painter->lightModel(), painter->mainLight(),
- "qt_Material", -1);
- } else if (d->haveMaterials) {
- d->setMaterial(painter->faceMaterial(QGL::FrontFaces),
- painter->lightModel(), painter->mainLight(),
- "qt_Materials", 0);
- d->setMaterial(painter->faceMaterial(QGL::BackFaces),
- painter->lightModel(), painter->mainLight(),
- "qt_Materials", 1);
- }
- } else {
- // Multiple light sources, so light colors are separate.
- if (d->haveMaterial) {
- d->setMaterial(painter->faceMaterial(QGL::FrontFaces),
- painter->lightModel(), 0, "qt_Material", -1);
- } else if (d->haveMaterials) {
- d->setMaterial(painter->faceMaterial(QGL::FrontFaces),
- painter->lightModel(), 0, "qt_Materials", 0);
- d->setMaterial(painter->faceMaterial(QGL::BackFaces),
- painter->lightModel(), 0, "qt_Materials", 1);
- }
- }
- }
-#endif
-}
-
-/*!
- Returns the source code for the vertex shader.
-
- \sa setVertexShader(), geometryShader(), fragmentShader(), setVertexShaderFromFile()
-*/
-QByteArray QGLShaderProgramEffect::vertexShader() const
-{
- Q_D(const QGLShaderProgramEffect);
- return d->vertexShader;
-}
-
-/*!
- Sets the \a source code for the vertex shader.
-
- \sa vertexShader(), setGeometryShader(), setFragmentShader(), setVertexShaderFromFile()
-*/
-void QGLShaderProgramEffect::setVertexShader(const QByteArray &source)
-{
- Q_D(QGLShaderProgramEffect);
- d->vertexShader = source;
- d->regenerate = true;
-}
-
-/*!
- Sets the source code for the vertex shader to the contents
- of \a fileName.
-
- \sa setVertexShader(), setGeometryShaderFromFile(), setFragmentShaderFromFile()
-*/
-void QGLShaderProgramEffect::setVertexShaderFromFile(const QString &fileName)
-{
- Q_D(QGLShaderProgramEffect);
- QFile file(fileName);
- if (file.open(QIODevice::ReadOnly)) {
- d->vertexShader = file.readAll();
- d->regenerate = true;
- } else {
- qWarning() << "QGLShaderProgramEffect::setVertexShaderFromFile: could not open " << fileName;
- }
-}
-
-/*!
- Returns the source code for the geometry shader.
-
- \sa setGeometryShader(), fragmentShader(), setGeometryShaderFromFile()
-*/
-QByteArray QGLShaderProgramEffect::geometryShader() const
-{
- Q_D(const QGLShaderProgramEffect);
- return d->geometryShader;
-}
-
-/*!
- Sets the \a source code for the geometry shader.
-
- \sa geometryShader(), setFragmentShader(), setGeometryShaderFromFile()
-*/
-void QGLShaderProgramEffect::setGeometryShader(const QByteArray &source)
-{
- Q_D(QGLShaderProgramEffect);
- d->geometryShader = source;
- d->regenerate = true;
-}
-
-/*!
- Sets the source code for the geometry shader to the contents
- of \a fileName.
-
- \sa setGeometryShader(), setFragmentShaderFromFile()
-*/
-void QGLShaderProgramEffect::setGeometryShaderFromFile(const QString &fileName)
-{
- Q_D(QGLShaderProgramEffect);
- QFile file(fileName);
- if (file.open(QIODevice::ReadOnly)) {
- d->geometryShader = file.readAll();
- d->regenerate = true;
- } else {
- qWarning() << "QGLShaderProgramEffect::setGeometryShaderFromFile: could not open " << fileName;
- }
-}
-
-/*!
- Returns the source code for the fragment shader.
-
- \sa setFragmentShader(), vertexShader(), geometryShader()
-*/
-QByteArray QGLShaderProgramEffect::fragmentShader() const
-{
- Q_D(const QGLShaderProgramEffect);
- return d->fragmentShader;
-}
-
-/*!
- Sets the source code for the fragment shader to the contents
- of \a fileName.
-
- \sa setFragmentShader(), setVertexShaderFromFile(), setGeometryShaderFromFile()
-*/
-void QGLShaderProgramEffect::setFragmentShaderFromFile(const QString &fileName)
-{
- Q_D(QGLShaderProgramEffect);
- QFile file(fileName);
- if (file.open(QIODevice::ReadOnly)) {
- d->fragmentShader = file.readAll();
- d->regenerate = true;
- } else {
- qWarning() << "QGLShaderProgramEffect::setFragmentShaderFromFile: could not open " << fileName;
- }
-}
-
-/*!
- Sets the \a source code for the fragment shader.
-
- \sa fragmentShader(), setVertexShader(), setGeometryShader()
-*/
-void QGLShaderProgramEffect::setFragmentShader(const QByteArray &source)
-{
- Q_D(QGLShaderProgramEffect);
- d->fragmentShader = source;
- d->regenerate = true;
-}
-
-/*!
- Sets the type of primitive the program's geometry shader is expecting to
- recieve from the vertex shader. The default value is GL_TRIANGLE_STRIP.
-
- If the program has no geometry shader, this has no effect.
-*/
-void QGLShaderProgramEffect::setGeometryInputType(GLenum drawingMode)
-{
- Q_D(QGLShaderProgramEffect);
- d->geometryInputType = drawingMode;
-}
-
-/*!
- Sets what sort of primitives the program's geometry shader will produce.
- The default value is GL_TRIANGLE_STRIP.
-
- If the program has no geometry shader, this has no effect.
-*/
-void QGLShaderProgramEffect::setGeometryOutputType(GLenum drawingMode)
-{
- Q_D(QGLShaderProgramEffect);
- d->geometryOutputType = drawingMode;
-}
-
-/*!
- Returns the type of primitives this program's geometry shader is expecting.
-*/
-GLenum QGLShaderProgramEffect::geometryInputType()
-{
- Q_D(QGLShaderProgramEffect);
- return d->geometryInputType;
-}
-
-/*!
- Returns the type of primitive this program's geometry shader will produce.
-*/
-GLenum QGLShaderProgramEffect::geometryOutputType()
-{
- Q_D(QGLShaderProgramEffect);
- return d->geometryOutputType;
-}
-
-/*!
- Returns the maximum number of lights that are supported by this
- shader program effect. The default value is 8.
-
- The actual number of lights will be provided to the vertexShader()
- as the \c{qt_NumLights} uniform variable, which will always be
- less than or equal to maximumLights().
-
- \sa setMaximumLights()
-*/
-int QGLShaderProgramEffect::maximumLights() const
-{
- Q_D(const QGLShaderProgramEffect);
- return d->maximumLights;
-}
-
-/*!
- Sets the maximum number of lights that are supported by this
- shader program effect to \a value.
-
- \sa maximumLights()
-*/
-void QGLShaderProgramEffect::setMaximumLights(int value)
-{
- Q_D(QGLShaderProgramEffect);
- d->maximumLights = value;
-}
-
-/*!
- Returns the shader program object that was created for this effect;
- null if setActive() has not been called yet.
-
- This function can be used by the application to adjust custom
- uniform variables after the effect is activated on a QGLPainter:
-
- \code
- painter.setUserEffect(effect);
- effect->program()->setUniformValue("springiness", GLfloat(0.5f));
- \endcode
-*/
-QGLShaderProgram *QGLShaderProgramEffect::program() const
-{
-#if !defined(QGL_FIXED_FUNCTION_ONLY)
- Q_D(const QGLShaderProgramEffect);
- return d->program;
-#else
- return 0;
-#endif
-}
-
-/*!
- Called by setActive() just before the program() is linked.
- Returns true if the standard vertex attributes should be bound
- by calls to QGLShaderProgram::bindAttributeLocation(). Returns
- false if the subclass has already bound the attributes.
-
- This function can be overridden by subclasses to alter the
- vertex attribute bindings, or to add additional shader stages
- to program().
-
- \sa afterLink()
-*/
-bool QGLShaderProgramEffect::beforeLink()
-{
- return true;
-}
-
-/*!
- Called by setActive() just after the program() is linked.
- The default implementation does nothing.
-
- This function can be overridden by subclasses to resolve uniform
- variable locations and cache them for later use in update().
-
- \sa beforeLink()
-*/
-void QGLShaderProgramEffect::afterLink()
-{
-}
-
-QT_END_NAMESPACE
diff --git a/src/threed/effects/qglshaderprogrameffect.h b/src/threed/effects/qglshaderprogrameffect.h
deleted file mode 100644
index 4098a52e..00000000
--- a/src/threed/effects/qglshaderprogrameffect.h
+++ /dev/null
@@ -1,100 +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 QGLSHADERPROGRAMEFFECT_H
-#define QGLSHADERPROGRAMEFFECT_H
-
-#include "qglabstracteffect.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-class QGLShaderProgramEffectPrivate;
-class QGLShaderProgram;
-
-class Q_QT3D_EXPORT QGLShaderProgramEffect : public QGLAbstractEffect
-{
-public:
- QGLShaderProgramEffect();
- virtual ~QGLShaderProgramEffect();
-
- void setActive(QGLPainter *painter, bool flag);
- void update(QGLPainter *painter, QGLPainter::Updates updates);
-
- QByteArray vertexShader() const;
- void setVertexShader(const QByteArray &source);
- void setVertexShaderFromFile(const QString &fileName);
-
- QByteArray geometryShader() const;
- void setGeometryShader(const QByteArray &source);
- void setGeometryShaderFromFile(const QString &fileName);
-
- QByteArray fragmentShader() const;
- void setFragmentShader(const QByteArray &source);
- void setFragmentShaderFromFile(const QString &fileName);
-
- void setGeometryInputType(GLenum drawingMode);
- void setGeometryOutputType(GLenum drawingMode);
- GLenum geometryInputType();
- GLenum geometryOutputType();
-
- int maximumLights() const;
- void setMaximumLights(int value);
-
- QGLShaderProgram *program() const;
-
-protected:
- virtual bool beforeLink();
- virtual void afterLink();
-
-private:
- QScopedPointer<QGLShaderProgramEffectPrivate> d_ptr;
-
- Q_DISABLE_COPY(QGLShaderProgramEffect)
- Q_DECLARE_PRIVATE(QGLShaderProgramEffect)
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/geometry/geometry.pri b/src/threed/geometry/geometry.pri
deleted file mode 100644
index 7f6be75c..00000000
--- a/src/threed/geometry/geometry.pri
+++ /dev/null
@@ -1,28 +0,0 @@
-INCLUDEPATH += $$PWD
-VPATH += $$PWD
-HEADERS += geometry/qglcube.h \
- geometry/qglsphere.h \
- geometry/qgeometrydata.h \
- geometry/qlogicalvertex.h \
- geometry/qglbuilder.h \
- geometry/qglbezierpatches.h \
- geometry/qglmaterialcollection.h \
- geometry/qglteapot.h \
- geometry/qglcylinder.h \
- geometry/qgldome.h
-SOURCES += qglcube.cpp \
- qglsphere.cpp \
- qgeometrydata.cpp \
- qglbuilder.cpp \
- qglsection.cpp \
- qglbezierpatches.cpp \
- qglmaterialcollection.cpp \
- qglteapot.cpp \
- qlogicalvertex.cpp \
- qglcylinder.cpp \
- qgldome.cpp
-PRIVATE_HEADERS += qglteapot_data_p.h \
- qglbuilder_p.h \
- qglsection_p.h \
- qglteapot_data_p.h \
- qvector_utils_p.h
diff --git a/src/threed/geometry/qgeometrydata.cpp b/src/threed/geometry/qgeometrydata.cpp
deleted file mode 100644
index 6ee4e181..00000000
--- a/src/threed/geometry/qgeometrydata.cpp
+++ /dev/null
@@ -1,2030 +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 "qgeometrydata.h"
-#include "qlogicalvertex.h"
-#include "qglpainter.h"
-
-#include <QtOpenGL/qgl.h>
-#include <QtCore/qdebug.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGeometryData
- \brief The QGeometryData class encapsulates sets of geometry data.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::geometry
-
- The QGeometryData class encloses a number of data arrays
- that model most typical vertex data needs. The class provides a
- store for all of the data types in the QGL::VertexAttribute enumeration.
-
- \table
- \header
- \o QGL::VertexAttribute
- \o QGeometryData functions
- \row
- \o QGL::Position
- \o appendVertex(), vertex(), vertices()
- \row
- \o QGL::Normal
- \o appendNormal(), normal(), normals()
- \row
- \o QGL::Color
- \o appendColor(), colorRef(), colors()
- \row
- \o QGL::TextureCoord0 - QGL::TextureCoord3
- \o appendTexCoord(), texCoordRef(), texCoords()
- \row
- \o QGL::CustomVertex0 - QGL::CustomVertex1, QGL::UserVertex
- \o appendAttribute(), vector3DAttribute(), attributes()
- \endtable
-
- Additionally the class provides the following features:
- \list
- \o appendVertex() for adding a QLogicalVertex()
- \o logicalVertexAt() for return the data at an index as a QLogicalVertex()
- \o hasField() to find if a particular data type is present
- \o normalizeNormals() to reduce all normal vectors to unit length
- \o boundingBox() to find the bounds of the geometry
- \endlist
-
- It is up to the user of a QGeometryData instance to ensure that the
- data has an equal number of items in each field. For example, if five
- vertices are added and only two normals are added, the logical vertex at
- position 3 will be corrupt, since it does not have a normal.
-
- While data is being accumulated the counts of different fields will vary,
- since it may be convenient to add several vertices, then several normals,
- colors or attributes at a time. However when a logical vertex is
- constructed or when the data is sent to the GPU, counts of all fields
- must be equal.
-
- QGeometryData uses explicit sharing with lazy creation of internal
- data so that code like:
- \code
- QGeometryData myData;
- if (processed)
- myData = processedData();
- \endcode
- is very inexpensive, since the first declaration and initialization
- does not cause internal data to be created (only to be overwritten by the
- assignment operation).
-
- Since QGeometryData is explicitly shared, variables of type
- QGeometryData behave like references, and the underlying data is modified
- by calling a non-const function on any variable which shares that data.
-
- To force an explicit copy call the detach() function.
-*/
-
-/*!
- \typedef QGL::IndexArray
-
- This is a convenience for either QArray<ushort> (OpenGL/ES) or
- QArray<int> (desktop OpenGL).
-*/
-
-class QGeometryDataPrivate
-{
-public:
- QGeometryDataPrivate();
- ~QGeometryDataPrivate();
- QGeometryDataPrivate *clone() const;
-
- QBasicAtomicInt ref;
-
- QVector3DArray vertices;
- QVector3DArray normals;
- QArray<QColor4ub> colors;
- QList<QCustomDataArray> attributes;
- QList<QVector2DArray> textures;
- QGL::IndexArray indices;
- QGLVertexBundle vertexBundle;
- QGLIndexBuffer indexBuffer;
- bool uploadsViable;
- bool modified;
- QBox3D bb;
- static const int ATTR_CNT = 32;
- quint32 fields;
- qint8 key[ATTR_CNT];
- quint8 size[ATTR_CNT];
- int count;
- int reserved;
- bool boxValid;
- QGeometryData::BufferStrategy bufferStrategy;
-};
-
-QGeometryDataPrivate::QGeometryDataPrivate()
- : uploadsViable(true)
- , modified(false)
- , fields(0)
- , count(0)
- , reserved(-1)
- , boxValid(true)
- , bufferStrategy(QGeometryData::BufferIfPossible | QGeometryData::KeepClientData)
-{
- ref = 0;
- qMemSet(key, -1, ATTR_CNT);
- qMemSet(size, 0, ATTR_CNT);
-}
-
-QGeometryDataPrivate::~QGeometryDataPrivate()
-{
-}
-
-QGeometryDataPrivate *QGeometryDataPrivate::clone() const
-{
- QGeometryDataPrivate *temp = new QGeometryDataPrivate;
- temp->vertices = vertices;
- temp->normals = normals;
- temp->colors = colors;
- temp->attributes = attributes;
- temp->textures = textures;
- temp->indices = indices;
- temp->vertexBundle = vertexBundle;
- temp->indexBuffer = indexBuffer;
- temp->uploadsViable = uploadsViable;
- temp->modified = modified;
- temp->bb = bb;
- temp->fields = fields;
- qMemCopy(temp->key, key, ATTR_CNT);
- qMemCopy(temp->size, size, ATTR_CNT);
- temp->count = count;
- temp->reserved = reserved;
- temp->boxValid = boxValid;
- temp->bufferStrategy = bufferStrategy;
- return temp;
-}
-
-/*!
- \fn quint32 QGL::fieldMask(QGL::VertexAttribute attribute)
- \relates QGeometryData
- Returns an unsigned integer mask from the \a attribute.
-
- \sa QGeometryData::fields()
-*/
-
-/*!
- \enum QGeometryData::BufferStrategyFlags
-
- This enum serves to describe how management of the data is handled
- with respect to vertex buffer objects. The strategies are essentially a
- combination of whether the client data is kept around after it has been
- successfully uploaded to the GPU; and whether an upload is attempted at
- all.
-
- If the data set is very small it may be pointless to use up a VBO, hence
- in this case KeepClientData may be used resulting in no attempt to upload
- the data and client side arrays used instead.
-
- \value InvalidStrategy No valid strategy has been specified.
- \value KeepClientData Keep the client data, even after successful upload to the GPU.
- \value BufferIfPossible Try to upload the data to the GPU.
-*/
-
-/*!
- Construct an empty QGeometryData
-*/
-QGeometryData::QGeometryData()
- : d(0)
-{
-}
-
-/*!
- Construct QGeometryData as a copy of \a other
-*/
-QGeometryData::QGeometryData(const QGeometryData &other)
- : d(other.d)
-{
- if (d)
- d->ref.ref();
-}
-
-/*!
- Construct an empty QGeometryData with the \a fields enabled.
-*/
-QGeometryData::QGeometryData(quint32 fields)
- : d(new QGeometryDataPrivate)
-{
- d->ref.ref();
- const quint32 mask = 0x01;
- for (int field = 0; fields; ++field, fields >>= 1)
- {
- if (!(mask & fields)) continue;
- QGL::VertexAttribute attr = static_cast<QGL::VertexAttribute>(field);
- enableField(attr);
- }
-}
-
-/*!
- Destroys this QGeometryData recovering any resources.
-*/
-QGeometryData::~QGeometryData()
-{
- if (d && !d->ref.deref())
- delete d;
-}
-
-/*!
- Assigns this QGeometryData to be a copy of \a other.
-*/
-QGeometryData &QGeometryData::operator=(const QGeometryData &other)
-{
- if (d != other.d)
- {
- if (d && !d->ref.deref())
- delete d;
- d = other.d;
- if (d)
- d->ref.ref();
- }
- return *this;
-}
-
-/*!
- Appends the geometry in \a data to this. If this is empty, then all
- fields of \a data are appended; otherwise (when this has existing fields)
- only those fields that exist in both are appended.
-
- This does not change the indices - to reference the new geometry add
- indices via the appendIndices() functions.
-*/
-void QGeometryData::appendGeometry(const QGeometryData &data)
-{
- if (data.d && data.count())
- {
- detach();
- d->modified = true;
- d->boxValid = false;
- int cnt = data.d->count;
- const quint32 mask = 0x01;
- quint32 fields = d->fields | data.fields();
- d->fields = fields;
- for (int field = 0; fields; ++field, fields >>= 1)
- {
- if (mask & fields)
- {
- QGL::VertexAttribute attr = static_cast<QGL::VertexAttribute>(field);
- enableField(attr); // might not be enabled if we had NO fields
- if (attr < QGL::TextureCoord0)
- {
- if (attr == QGL::Position)
- d->vertices.append(data.d->vertices);
- else if (attr == QGL::Normal)
- d->normals.append(data.d->normals);
- else // colors
- d->colors.append(data.d->colors);
- }
- else if (attr < QGL::CustomVertex0)
- {
- d->textures[d->key[attr]].append(data.texCoords(attr));
- }
- else
- {
- d->attributes[d->key[attr]].append(data.attributes(attr));
- }
- }
- }
- d->count += cnt;
- }
-}
-
-/*!
- Appends all the data fields in QLogicalVertex \a v to this
- QGeometryData object.
-*/
-int QGeometryData::appendVertex(const QLogicalVertex &v)
-{
- create();
- d->modified = true;
- if (d->boxValid)
- d->bb.unite(v.vertex());
- quint32 fields = v.fields();
- const quint32 mask = 0x01;
- for (int field = 0; fields; ++field, fields >>= 1)
- {
- if (mask & fields)
- {
- QGL::VertexAttribute attr = static_cast<QGL::VertexAttribute>(field);
- if (attr < QGL::TextureCoord0)
- {
- if (attr == QGL::Position)
- appendVertex(v.vertex());
- else if (attr == QGL::Normal)
- appendNormal(v.normal());
- else
- appendColor(v.color());
- }
- else if (attr < QGL::CustomVertex0)
- {
- appendTexCoord(v.texCoord(attr), attr);
- }
- else
- {
- appendAttribute(v.attribute(attr), attr);
- }
- }
- }
- return d->count - 1;
-}
-
-/*!
- Returns a QLogicalVertex that references the \a{i}'th logical vertex
- of this geometry.
-*/
-QLogicalVertex QGeometryData::logicalVertexAt(int i) const
-{
- return QLogicalVertex(*this, i);
-}
-
-/*!
- Normalize all the normal vectors in this geometry to unit length.
-*/
-void QGeometryData::normalizeNormals()
-{
- check();
- if (d) // nothng to do if its null
- {
- create();
- d->modified = true;
- if (hasField(QGL::Normal))
- {
- for (int i = 0; i < d->normals.count(); ++i)
- d->normals[i].normalize();
- }
- }
-}
-
-/*!
- Calculate and return a bounding box for the vertex data in this geometry.
-*/
-QBox3D QGeometryData::boundingBox() const
-{
- QBox3D box;
- if (d)
- {
- if (d->boxValid)
- {
- box = d->bb;
- }
- else
- {
- for (int i = 0; i < d->count; ++i)
- box.unite(d->vertices.at(i));
- d->bb = box;
- }
- }
- return box;
-}
-
-/*!
- Returns the coordinates of the center of the geometry.
-
- The center is calculated as the centroid or geometric barycenter
- of the vertices (the average of the vertices). For a convex hull this
- is guaranteed to be inside the figure.
-*/
-QVector3D QGeometryData::center() const
-{
- QVector3D center;
- for (int i = 0; i < d->vertices.count(); ++i)
- center += d->vertices.at(i);
- return center / (float)d->vertices.count();
-}
-
-/*!
- Returns a copy of this geometry data with elements in reverse order.
-*/
-QGeometryData QGeometryData::reversed() const
-{
- QGeometryData r;
- for (int i = count() - 1; i >= 0; --i)
- r.appendVertex(logicalVertexAt(i));
- return r;
-}
-
-/*!
- Returns a copy of this geometry data with QGL::Position data translated by
- the vector \a t. The other fields are unchanged.
-*/
-QGeometryData QGeometryData::translated(const QVector3D &t) const
-{
- QGeometryData r(*this);
- r.detach();
- for (int i = 0; i < count(); ++i)
- {
- r.vertex(i) = r.vertexAt(i) + t;
- }
- return r;
-}
-
-/*!
- Modifies this geometry data by generating texture data based on QGL::Position
- values. If \a orientation is Qt::Horizontal (the default) then x-coordinate
- values are generated, and y-coordinate values are set to 0.0; otherwise
- y-coordinate values are generated and x-coordinate values are set to 0.0.
- The values are appended to the texture coordinate \a field.
-
- The method of calculation is based on the assumption that the vertex data
- is a list of extents which span across the texture space horizontally, from
- x = 0.0 to x = 1.0, in the case of Qt::Horizontal; or vertically in the
- case of Qt::Vertical. The texture space of 1.0 is divided up proportionately
- by the length of each extent.
-
- \image texture-coords-gen.png
-
- In this diagram the large blue numbers are the lengths of each extent, and
- the texture coordinates generated are shown as \c{t(7/16, 1)} and so on.
-
- Thus the texture coordinate t0 for vertex v0, is 0.0; t1 for vertex v1 is
- \c{(v1 - v0).length() / totalLength} and so on.
-
- The code to produce the texture coordinates for the quads in the image is:
- \code
- QGeometryData top;
-
- // add data to the primitive
- 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 over the primitive
- top.generateTextureCoordinates(); // spread over 7 + 5 + 4 = 16
-
- // make a copy translated down, the copy has y texture coordinates all 0
- QGeometryData bottom = top.translated(QVector3D(0, 0, -1));
-
- // now modify the top so its y texture coordinates are all 1
- for (int i = 0; i < top.count(); ++i)
- top.texCoordRef(QGL::TextureCoord0).setY(1.0);
-
- displayList->addQuadsZipped(top, bottom);
- \endcode
-*/
-void QGeometryData::generateTextureCoordinates(Qt::Orientation orientation, QGL::VertexAttribute field)
-{
- QArray<qreal> extents;
- extents.append(0.0);
- qreal totalExtents = 0.0;
- QArray<QVector3D> v = vertices();
- for (int i = 0; i < v.count() - 1; ++i)
- {
- int n = (i + 1) % v.count();
- QVector3D e = v[n] - v[i];
- qreal extent = e.length();
- totalExtents += extent;
- extents.append(totalExtents);
- }
- if (hasField(field))
- clear(field);
- if (orientation == Qt::Horizontal)
- {
- for (int i = 0; i < v.count(); ++i)
- appendTexCoord(QVector2D(extents[i] / totalExtents, 0.0), field);
- }
- else
- {
- for (int i = 0; i < v.count(); ++i)
- appendTexCoord(QVector2D(0.0, extents[i] / totalExtents), field);
- }
-}
-
-/*!
- Returns a QGeometryData instance containing alternating vertices from
- this geometry and \a other. The resulting geometry contains N vertices
- where \c{N == qMin(count(), other.count())}, and has only the fields
- that are in both geometries.
-*/
-QGeometryData QGeometryData::interleavedWith(const QGeometryData &other) const
-{
- QGeometryData res;
- check();
- other.check();
- if (d && other.d)
- {
- int cnt = qMax(d->count, other.d->count);
- const quint32 mask = 0x01;
- quint32 fields = d->fields & other.d->fields;
- for (int field = 0; fields; ++field, fields >>= 1)
- {
- if (mask & fields)
- {
- QGL::VertexAttribute attr = static_cast<QGL::VertexAttribute>(field);
- res.enableField(attr);
- if (attr < QGL::TextureCoord0)
- {
- if (attr == QGL::Position)
- {
- QArray<QVector3D> tmp;
- for (int i = 0; i < cnt; ++i)
- {
- tmp.append(d->vertices.at(i));
- tmp.append(other.d->vertices.at(i));
- }
- res.d->vertices = tmp;
- }
- else if (attr == QGL::Normal)
- {
- QArray<QVector3D> tmp;
- for (int i = 0; i < cnt; ++i)
- {
- tmp.append(d->normals.at(i));
- tmp.append(other.d->normals.at(i));
- }
- res.d->normals = tmp;
- }
- else // colors
- {
- QArray<QColor4ub> tmp;
- for (int i = 0; i < cnt; ++i)
- {
- tmp.append(d->colors.at(i));
- tmp.append(other.d->colors.at(i));
- }
- res.d->colors = tmp;
- }
- }
- else if (attr < QGL::CustomVertex0)
- {
- QArray<QVector2D> tmp;
- const QArray<QVector2D> txa = d->textures.at(d->key[attr]);
- const QArray<QVector2D> txb = other.d->textures.at(other.d->key[attr]);
- for (int i = 0; i < cnt; ++i)
- {
- tmp.append(txa.at(i));
- tmp.append(txb.at(i));
- }
- res.d->textures[d->key[attr]] = tmp;
- }
- else
- {
- QCustomDataArray tmp;
- const QCustomDataArray ata = d->attributes.at(d->key[attr]);
- const QCustomDataArray atb = other.d->attributes.at(other.d->key[attr]);
- for (int i = 0; i < cnt; ++i)
- {
- tmp.append(ata.at(i));
- tmp.append(atb.at(i));
- }
- res.d->attributes[d->key[attr]] = tmp;
- }
- }
- }
- res.d->count = cnt * 2;
- }
- return res;
-}
-
-/*!
- Sets this QGeometryData to contain alternating vertices from
- this geometry and \a other. The resulting geometry contains \c{N * 2} vertices
- where \c{N == qMin(count(), other.count())}, and has only the fields
- that are in both geometries.
-*/
-void QGeometryData::interleaveWith(const QGeometryData &other)
-{
- check();
- other.check();
- if (d && other.d)
- {
- create();
- d->modified = true;
- d->boxValid = false;
- int cnt = qMin(d->count, other.d->count);
- const quint32 mask = 0x01;
- quint32 fields = d->fields & other.d->fields;
- for (int field = 0; fields; ++field, fields >>= 1)
- {
- if (mask & fields)
- {
- QGL::VertexAttribute attr = static_cast<QGL::VertexAttribute>(field);
- if (attr < QGL::TextureCoord0)
- {
- if (attr == QGL::Position)
- {
- QArray<QVector3D> tmp;
- for (int i = 0; i < cnt; ++i)
- {
- tmp.append(d->vertices.at(i));
- tmp.append(other.d->vertices.at(i));
- }
- d->vertices = tmp;
- }
- else if (attr == QGL::Normal)
- {
- QArray<QVector3D> tmp;
- for (int i = 0; i < cnt; ++i)
- {
- tmp.append(d->normals.at(i));
- tmp.append(other.d->normals.at(i));
- }
- d->normals = tmp;
- }
- else // colors
- {
- QArray<QColor4ub> tmp;
- for (int i = 0; i < cnt; ++i)
- {
- tmp.append(d->colors.at(i));
- tmp.append(other.d->colors.at(i));
- }
- d->colors = tmp;
- }
- }
- else if (attr < QGL::CustomVertex0)
- {
- QArray<QVector2D> tmp;
- const QArray<QVector2D> txa = d->textures.at(d->key[attr]);
- const QArray<QVector2D> txb = other.d->textures.at(other.d->key[attr]);
- for (int i = 0; i < cnt; ++i)
- {
- tmp.append(txa.at(i));
- tmp.append(txb.at(i));
- }
- d->textures[d->key[attr]] = tmp;
- }
- else
- {
- QCustomDataArray tmp;
- const QCustomDataArray ata = d->attributes.at(d->key[attr]);
- const QCustomDataArray atb = other.d->attributes.at(other.d->key[attr]);
- for (int i = 0; i < cnt; ++i)
- {
- tmp.append(ata.at(i));
- tmp.append(atb.at(i));
- }
- d->attributes[d->key[attr]] = tmp;
- }
- }
- }
- d->count = cnt * 2;
- }
-}
-
-/*!
- Clear all data structures. The actual fields are retained, but they
- have no contents.
- \code
- QGeometryData data;
- data.appendVertex(a);
- data.appendTexCoord(t);
-
- // prints "1"
- qDebug() << data.count();
-
- // x == a
- QVector3D x = data.vertexAt(0);
-
- quint32 flds = QGL::fieldMask(QGL::Position) | QGL::fieldMask(QGL::TextureCoord0);
- qDebug() << (flds == data.fields()); // prints "true"
-
- data.clear();
- qDebug() << data.count(); // prints "0"
- QVector3D x = data.vertexAt(0); // asserts - no data in vertices
- qDebug() << (flds == data.fields()); // still prints "true"
- \endcode
-
- To clear a specific field and its data use \c{data.clear(field)} below.
-
- To clear all fields and data, simply set this to an empty geometry:
- \code
- data = QGeometryData();
- \endcode
- */
-void QGeometryData::clear()
-{
- if (d)
- {
- create();
- d->modified = true;
- d->bb = QBox3D();
- d->boxValid = true;
- const quint32 mask = 0x01;
- quint32 fields = d->fields;
- for (int field = 0; fields; ++field, fields >>= 1)
- {
- if (mask & fields)
- {
- QGL::VertexAttribute attr = static_cast<QGL::VertexAttribute>(field);
- if (attr < QGL::TextureCoord0)
- {
- if (attr == QGL::Position)
- d->vertices.clear();
- else if (attr == QGL::Normal)
- d->normals.clear();
- else
- d->colors.clear();
- }
- else if (attr < QGL::CustomVertex0)
- {
- d->textures[d->key[field]].clear();
- }
- else
- {
- d->attributes[d->key[field]].clear();
- }
- }
- }
- d->count = 0;
- }
-}
-
-/*!
- Clears the data from \a field, and removes the field. After this call
- hasField() will return false for this field.
-*/
-void QGeometryData::clear(QGL::VertexAttribute field)
-{
- if (d && (QGL::fieldMask(field) & d->fields))
- {
- create();
- d->modified = true;
- if (field == QGL::Position)
- {
- d->bb = QBox3D();
- d->boxValid = true;
- }
- QGL::VertexAttribute attr = static_cast<QGL::VertexAttribute>(field);
- if (attr < QGL::TextureCoord0)
- {
- if (attr == QGL::Position)
- d->vertices.clear();
- else if (attr == QGL::Normal)
- d->normals.clear();
- else
- d->colors.clear();
- }
- else if (attr < QGL::CustomVertex0)
- {
- d->textures[d->key[field]].clear();
- }
- else
- {
- d->attributes[d->key[field]].clear();
- }
- d->key[field] = -1;
- d->fields = d->fields & ~QGL::fieldMask(field);
- }
-}
-
-/*!
- Sets the geometry data to handle an \a amount of data. This is generally
- not required unless its anticipated that a large amount of data will be
- appended and realloc overhead is desired to be avoided. If \a amount is
- less than the amount already reserved, or if this object has
- more than the \a amount of data items, then this function exits without
- doing anything. This function will never delete data.
-*/
-void QGeometryData::reserve(int amount)
-{
- if (d && (d->reserved > amount || d->reserved < d->count))
- return;
- create();
- d->reserved = amount;
- const quint32 mask = 0x01;
- quint32 fields = d->fields;
- for (int field = 0; fields; ++field, fields >>= 1)
- {
- if (mask & fields)
- {
- QGL::VertexAttribute attr = static_cast<QGL::VertexAttribute>(field);
- if (attr < QGL::TextureCoord0)
- {
- if (attr == QGL::Position)
- d->vertices.reserve(amount);
- else if (attr == QGL::Normal)
- d->normals.reserve(amount);
- else
- d->colors.reserve(amount);
- }
- else if (attr < QGL::CustomVertex0)
- {
- d->textures[d->key[field]].reserve(amount);
- }
- else
- {
- d->attributes[d->key[field]].reserve(amount);
- }
- }
- }
-}
-
-/*!
- Draws this geometry on the \a painter, from \a start for \a count elements
- in \a mode. The drawing \a mode is by default QGL::Triangles. This function
- Also calls the upload() method to ensure that the geometry is resident on
- the graphics hardware if appropriate.
-
- If the geometry is a point or line, then the \a drawWidth value specified the
- width/size of the line/point.
-*/
-void QGeometryData::draw(QGLPainter *painter, int start, int count, GLenum mode, qreal drawWidth)
-{
- if (d && d->indices.size() && d->count)
- {
- upload();
- painter->clearAttributes();
- if (mode==QGL::Points) {
-#if !defined(QT_OPENGL_ES_2)
- ::glPointSize(drawWidth);
-#endif
- } else if (mode==QGL::LineStrip || mode == QGL::Lines) {
- ::glLineWidth(drawWidth);
- }
- painter->setVertexBundle(d->vertexBundle);
- if (count == 0)
- count = d->indexBuffer.indexCount();
- painter->draw(QGL::DrawingMode(mode), d->indexBuffer, start, count);
- }
-}
-
-/*!
- Uploads this geometry data to the graphics hardware if appropriate. If the
- data is already uploaded and has not been modified since it was last
- uploaded, then this function does nothing.
-
- If the bufferStrategy() does not specify QGL::BufferIfPossible then this
- function does nothing.
-
- If the data was successfully uploaded, and the bufferStrategy() does not
- specify QGL::KeepClientData then the data will be removed with a call to
- the clear() function.
-
- If the data was successfully uploaded, on this call or previously, then this
- function will return true. Otherwise it returns false.
-*/
-bool QGeometryData::upload()
-{
- bool vboUploaded = false;
- bool iboUploaded = false;
-
- if (!d)
- return false;
- if (!d->modified)
- return d->vertexBundle.isUploaded() && d->indexBuffer.isUploaded();
-
- check();
-
- // Need to recreate the buffers from the modified data.
- d->vertexBundle = QGLVertexBundle();
- d->indexBuffer = QGLIndexBuffer();
-
- // Copy the geometry data to the vertex buffer.
- const quint32 mask = 0x01;
- quint32 fields = d->fields;
- for (int field = 0; fields; ++field, fields >>= 1)
- {
- if (!(mask & fields))
- continue;
- QGL::VertexAttribute attr = static_cast<QGL::VertexAttribute>(field);
- if (attr == QGL::Position)
- d->vertexBundle.addAttribute(attr, d->vertices);
- else if (attr == QGL::Normal)
- d->vertexBundle.addAttribute(attr, d->normals);
- else if (attr == QGL::Color)
- d->vertexBundle.addAttribute(attr, d->colors);
- else if (attr < QGL::CustomVertex0)
- d->vertexBundle.addAttribute(attr, d->textures.at(d->key[field]));
- else
- d->vertexBundle.addAttribute(attr, d->attributes.at(d->key[field]));
- }
-
- // Upload the buffer if requested, otherwise keep it client-side.
- // Note: QGLVertexBundle will act as a client-side buffer if not uploaded.
- if ((d->bufferStrategy & BufferIfPossible) != 0)
- {
- if (d->vertexBundle.upload())
- vboUploaded = true;
- }
-
- // Copy the geometry data to the index buffer and upload if requested.
- d->indexBuffer.setIndexes(d->indices);
- if ((d->bufferStrategy & BufferIfPossible) != 0)
- {
- if (d->indexBuffer.upload())
- iboUploaded = true;
- }
-
- d->modified = false;
-
- if (!(d->bufferStrategy & KeepClientData) && vboUploaded && iboUploaded)
- clear();
-
- return vboUploaded && iboUploaded;
-}
-
-/*!
- Sets the buffer \a strategy for this geometry.
-
- \sa bufferStrategy()
-*/
-void QGeometryData::setBufferStrategy(QGeometryData::BufferStrategy strategy)
-{
- if (!d || d->bufferStrategy != strategy)
- {
- create();
- d->modified = true;
- d->bufferStrategy = strategy;
- }
-}
-
-/*!
- Returns the buffer strategy for this geometry. The default is
- \c{QGL::BufferIfPossible | QGL::KeepClientData}.
-
- \sa setBufferStrategy()
-*/
-QGeometryData::BufferStrategy QGeometryData::bufferStrategy() const
-{
- if (d)
- return d->bufferStrategy;
- return InvalidStrategy;
-}
-
-/*!
- Returns a reference to the vertex buffer for this geometry.
-
- \sa indexBuffer()
-*/
-QGLVertexBundle QGeometryData::vertexBundle() const
-{
- return d->vertexBundle;
-}
-
-/*!
- Returns a reference to the index buffer for this geometry.
-
- \sa vertexBundle()
-*/
-QGLIndexBuffer QGeometryData::indexBuffer() const
-{
- return d->indexBuffer;
-}
-
-/*!
- Appends \a index to the vertex index array.
-
- \sa appendIndices(), indices()
-*/
-void QGeometryData::appendIndex(int index)
-{
- create();
- d->modified = true;
- d->indices.append(index);
-}
-
-/*!
- Appends \a index1, \a index2, and \a index3 to the geometry's
- index array.
-
- \sa appendIndex(), indices()
-*/
-void QGeometryData::appendIndices(int index1, int index2, int index3)
-{
- create();
- d->modified = true;
- d->indices.append(index1, index2, index3);
-}
-
-/*!
- Returns the index array that was created by appendIndex().
-
- \sa appendIndex(), appendIndices()
-*/
-QGL::IndexArray QGeometryData::indices() const
-{
- if (d)
- return d->indices;
- else
- return QGL::IndexArray();
-}
-
-/*!
- Appends the \a indices to the geometry's index array.
-*/
-void QGeometryData::appendIndices(const QGL::IndexArray &indices)
-{
- create();
- d->modified = true;
- d->indices.append(indices);
-}
-
-/*!
- Append the point \a v0 to this geometry data as a position field.
-*/
-void QGeometryData::appendVertex(const QVector3D &v0)
-{
- create();
- d->modified = true;
- enableField(QGL::Position);
- d->vertices.append(v0);
- if (d->boxValid)
- d->bb.unite(v0);
- d->count = qMax(d->count, d->vertices.count());
-}
-
-/*!
- Append the points \a v0 and \a v1 to this geometry data as position fields.
-*/
-void QGeometryData::appendVertex(const QVector3D &v0, const QVector3D &v1)
-{
- create();
- d->modified = true;
- enableField(QGL::Position);
- d->vertices.append(v0, v1);
- if (d->boxValid)
- {
- d->bb.unite(v0);
- d->bb.unite(v1);
- }
- d->count = qMax(d->count, d->vertices.count());
-}
-
-/*!
- Append the points \a v0, \a v1 and \a v2 to this geometry data as position fields.
-*/
-void QGeometryData::appendVertex(const QVector3D &v0, const QVector3D &v1, const QVector3D &v2)
-{
- create();
- d->modified = true;
- enableField(QGL::Position);
- d->vertices.append(v0, v1, v2);
- if (d->boxValid)
- {
- d->bb.unite(v0);
- d->bb.unite(v1);
- d->bb.unite(v2);
- }
- d->count = qMax(d->count, d->vertices.count());
-}
-
-/*!
- Append the points \a v0, \a v1, \a v2 and \a v3 to this geometry data as position fields.
-*/
-void QGeometryData::appendVertex(const QVector3D &v0, const QVector3D &v1, const QVector3D &v2, const QVector3D &v3)
-{
- create();
- d->modified = true;
- enableField(QGL::Position);
- d->vertices.append(v0, v1, v2, v3);
- if (d->boxValid)
- {
- d->bb.unite(v0);
- d->bb.unite(v1);
- d->bb.unite(v2);
- d->bb.unite(v3);
- }
- d->count = qMax(d->count, d->vertices.count());
-}
-
-/*!
- Append the float \a a0 to this geometry data, as an attribute \a field.
-*/
-void QGeometryData::appendAttribute(float a0, QGL::VertexAttribute field)
-{
- create();
- d->modified = true;
- enableField(field);
- d->attributes[d->key[field]].append(a0);
- d->count = qMax(d->count, d->attributes[d->key[field]].count());
-}
-
-/*!
- Append the float \a a0 and \a a1 to this geometry data, as an attribute \a field.
-*/
-void QGeometryData::appendAttribute(float a0, float a1, QGL::VertexAttribute field)
-{
- create();
- d->modified = true;
- enableField(field);
- d->attributes[d->key[field]].append(a0, a1);
- d->count = qMax(d->count, d->attributes[d->key[field]].count());
-}
-
-/*!
- Append the floats \a a0, \a a1 and \a a2 to this geometry data, as attribute \a field.
-*/
-void QGeometryData::appendAttribute(float a0, float a1, float a2, QGL::VertexAttribute field)
-{
- create();
- d->modified = true;
- enableField(field);
- d->attributes[d->key[field]].append(a0, a1, a2);
- d->count = qMax(d->count, d->attributes[d->key[field]].count());
-}
-
-/*!
- Append the floats \a a0, \a a1, \a a2 and \a a3 to this geometry data, as attribute \a field.
-*/
-void QGeometryData::appendAttribute(float a0, float a1, float a2, float a3, QGL::VertexAttribute field)
-{
- create();
- d->modified = true;
- enableField(field);
- d->attributes[d->key[field]].append(a0, a1, a2, a3);
- d->count = qMax(d->count, d->attributes[d->key[field]].count());
-}
-
-/*!
- Append the 2D point \a a to this geometry data, as an attribute \a field.
-*/
-void QGeometryData::appendAttribute(const QVector2D &a, QGL::VertexAttribute field)
-{
- create();
- d->modified = true;
- enableField(field);
- if (d->attributes.at(d->key[field]).isEmpty())
- d->attributes[d->key[field]].setElementType(QCustomDataArray::Vector2D);
- d->attributes[d->key[field]].append(a);
- d->count = qMax(d->count, d->attributes[d->key[field]].count());
-}
-
-/*!
- Append the 3D point \a v to this geometry data, as an attribute \a field.
-*/
-void QGeometryData::appendAttribute(const QVector3D &v, QGL::VertexAttribute field)
-{
- create();
- d->modified = true;
- enableField(field);
- if (d->attributes.at(d->key[field]).isEmpty())
- d->attributes[d->key[field]].setElementType(QCustomDataArray::Vector3D);
- d->attributes[d->key[field]].append(v);
- d->count = qMax(d->count, d->attributes[d->key[field]].count());
-}
-
-/*!
- Append the variant value \a a to this geometry data, as an attribute \a field.
-*/
-void QGeometryData::appendAttribute(const QVariant &a, QGL::VertexAttribute field)
-{
- create();
- d->modified = true;
- enableField(field);
- if (d->attributes.at(d->key[field]).isEmpty())
- {
- // floats and doubles get handled "automatically" - float is default
- if (a.type() == QVariant::Vector2D)
- d->attributes[d->key[field]].setElementType(QCustomDataArray::Vector2D);
- else if (a.type() == QVariant::Vector3D)
- d->attributes[d->key[field]].setElementType(QCustomDataArray::Vector3D);
- else if (a.type() == QVariant::Vector4D)
- d->attributes[d->key[field]].setElementType(QCustomDataArray::Vector4D);
- else if (a.type() == QVariant::Color)
- d->attributes[d->key[field]].setElementType(QCustomDataArray::Color);
- else
- Q_ASSERT_X(false, "QGeometryData::appendAttribute", "bad type");
- }
- d->attributes[d->key[field]].append(a);
- d->count = qMax(d->count, d->attributes[d->key[field]].count());
-}
-
-/*!
- Append the vector \a n0 to this geometry data, as a lighting normal.
-*/
-void QGeometryData::appendNormal(const QVector3D &n0)
-{
- create();
- d->modified = true;
- enableField(QGL::Normal);
- d->normals.append(n0);
- d->count = qMax(d->count, d->normals.count());
-}
-
-/*!
- Append the vectors \a n0 and \a n1 to this geometry data, as lighting normals.
-*/
-void QGeometryData::appendNormal(const QVector3D &n0, const QVector3D &n1)
-{
- create();
- d->modified = true;
- enableField(QGL::Normal);
- d->normals.append(n0, n1);
- d->count = qMax(d->count, d->normals.count());
-}
-
-/*!
- Append the vectors \a n0, \a n1 and \a n2 to this geometry data, as lighting normals.
-*/
-void QGeometryData::appendNormal(const QVector3D &n0, const QVector3D &n1, const QVector3D &n2)
-{
- create();
- d->modified = true;
- enableField(QGL::Normal);
- d->normals.append(n0, n1, n2);
- d->count = qMax(d->count, d->normals.count());
-}
-
-/*!
- Append the vectors \a n0, \a n1, \a n2 and \a n3 to this geometry data, as lighting normals.
-*/
-void QGeometryData::appendNormal(const QVector3D &n0, const QVector3D &n1, const QVector3D &n2, const QVector3D &n3)
-{
- create();
- d->modified = true;
- enableField(QGL::Normal);
- d->normals.append(n0, n1, n2, n3);
- d->count = qMax(d->count, d->normals.count());
-}
-
-/*!
- Append the point \a t0 to this geometry data, as an texture \a field.
-*/
-void QGeometryData::appendTexCoord(const QVector2D &t0, QGL::VertexAttribute field)
-{
- create();
- d->modified = true;
- enableField(field);
- d->textures[d->key[field]].append(t0);
- d->count = qMax(d->count, d->textures[d->key[field]].count());
-}
-
-/*!
- Append the points \a t0 and \a t1 to this geometry data, as texture \a{field}s.
-*/
-void QGeometryData::appendTexCoord(const QVector2D &t0, const QVector2D &t1, QGL::VertexAttribute field)
-{
- create();
- d->modified = true;
- enableField(field);
- d->textures[d->key[field]].append(t0, t1);
- d->count = qMax(d->count, d->textures[d->key[field]].count());
-}
-
-/*!
- Append the points \a t0, \a t1 and \a t2 to this geometry data, as texture \a{field}s.
-*/
-void QGeometryData::appendTexCoord(const QVector2D &t0, const QVector2D &t1, const QVector2D &t2, QGL::VertexAttribute field)
-{
- create();
- d->modified = true;
- enableField(field);
- d->textures[d->key[field]].append(t0, t1, t2);
- d->count = qMax(d->count, d->textures[d->key[field]].count());
-}
-
-/*!
- Append the points \a t0, \a t1, \a t2 and \a t3 to this geometry data, as texture \a{field}s.
-*/
-void QGeometryData::appendTexCoord(const QVector2D &t0, const QVector2D &t1, const QVector2D &t2, const QVector2D &t3, QGL::VertexAttribute field)
-{
- create();
- d->modified = true;
- enableField(field);
- d->textures[d->key[field]].append(t0, t1, t2, t3);
- d->count = qMax(d->count, d->textures[d->key[field]].count());
-}
-
-/*!
- Append the color \a c0 to this geometry data, as an color field.
-*/
-void QGeometryData::appendColor(const QColor4ub &c0)
-{
- create();
- d->modified = true;
- enableField(QGL::Color);
- d->colors.append(c0);
- d->count = qMax(d->count, d->colors.count());
-}
-
-/*!
- Append the color \a c0 and \a c1 to this geometry data, as color fields.
-*/
-void QGeometryData::appendColor(const QColor4ub &c0, const QColor4ub &c1)
-{
- create();
- d->modified = true;
- enableField(QGL::Color);
- d->colors.append(c0, c1);
- d->count = qMax(d->count, d->colors.count());
-}
-
-/*!
- Append the color \a c0, \a c1 and \a c2 to this geometry data, as color fields.
-*/
-void QGeometryData::appendColor(const QColor4ub &c0, const QColor4ub &c1, const QColor4ub &c2)
-{
- create();
- d->modified = true;
- enableField(QGL::Color);
- d->colors.append(c0, c1, c2);
- d->count = qMax(d->count, d->colors.count());
-}
-
-/*!
- Append the color \a c0, \a c1, \a c2 and \a c3 to this geometry data, as color fields.
-*/
-void QGeometryData::appendColor(const QColor4ub &c0, const QColor4ub &c1, const QColor4ub &c2, const QColor4ub &c3)
-{
- create();
- d->modified = true;
- enableField(QGL::Color);
- d->colors.append(c0, c1, c2, c3);
- d->count = qMax(d->count, d->colors.count());
-}
-
-/*!
- Append the points in \a ary to this geometry data as position fields.
-*/
-void QGeometryData::appendVertexArray(const QVector3DArray &ary)
-{
- if (ary.count())
- {
- create();
- d->modified = true;
- d->boxValid = false;
- enableField(QGL::Position);
- d->vertices.append(ary);
- d->count = qMax(d->count, d->vertices.count());
- }
-}
-
-/*!
- Append the points in \a ary to this geometry data, as an attribute \a field entries.
-*/
-void QGeometryData::appendAttributeArray(const QCustomDataArray &ary, QGL::VertexAttribute field)
-{
- if (ary.count())
- {
- create();
- d->modified = true;
- enableField(field);
- d->attributes[d->key[field]].append(ary);
- d->count = qMax(d->count, d->attributes[d->key[field]].count());
- }
-}
-
-/*!
- Append the vectors in \a ary to this geometry data, as lighting normals.
-*/
-void QGeometryData::appendNormalArray(const QVector3DArray &ary)
-{
- if (ary.count())
- {
- create();
- d->modified = true;
- enableField(QGL::Normal);
- d->normals.append(ary);
- d->count = qMax(d->count, d->normals.count());
- }
-}
-
-/*!
- Append the 2D points in \a ary to this geometry data, as texture \a field entries.
-*/
-void QGeometryData::appendTexCoordArray(const QVector2DArray &ary, QGL::VertexAttribute field)
-{
- if (ary.count())
- {
- create();
- d->modified = true;
- enableField(field);
- d->textures[d->key[field]].append(ary);
- d->count = qMax(d->count, d->textures[d->key[field]].count());
- }
-}
-
-/*!
- Append the colors in \a ary to this geometry data, as color fields.
-*/
-void QGeometryData::appendColorArray(const QArray<QColor4ub> &ary)
-{
- if (ary.count())
- {
- create();
- d->modified = true;
- enableField(QGL::Color);
- d->colors.append(ary);
- d->count = qMax(d->count, d->colors.count());
- }
-}
-
-/*!
- Returns a modifiable reference to the vertex data at index \a i.
-*/
-QVector3D &QGeometryData::vertex(int i)
-{
- create();
- d->modified = true;
- d->boxValid = false;
- return d->vertices[i];
-}
-
-/*!
- Returns a copy of the vertex position data.
-*/
-QVector3DArray QGeometryData::vertices() const
-{
- if (d)
- return d->vertices;
- return QArray<QVector3D>();
-}
-
-/*!
- \internal
- Returns a pointer to the vertex data.
-*/
-const QVector3DArray *QGeometryData::vertexData() const
-{
- if (d)
- return &d->vertices;
- return 0;
-}
-
-
-/*!
- Returns a non-modifiable reference to the vertex position data at index \a i.
-*/
-const QVector3D &QGeometryData::vertexAt(int i) const
-{
- Q_ASSERT(hasField(QGL::Position));
- return d->vertices.at(i);
-}
-
-/*!
- Returns a modifiable reference to the normal data at index \a i.
-*/
-QVector3D &QGeometryData::normal(int i)
-{
- create();
- d->modified = true;
- return d->normals[i];
-}
-
-/*!
- Returns a non-modifiable reference to the normal data at index \a i.
-*/
-const QVector3D &QGeometryData::normalAt(int i) const
-{
- Q_ASSERT(hasField(QGL::Normal));
- return d->normals.at(i);
-}
-
-/*!
- Returns a copy of the lighting normal data.
-*/
-QVector3DArray QGeometryData::normals() const
-{
- if (d)
- return d->normals;
- return QArray<QVector3D>();
-}
-
-/*!
- Returns a modifiable reference to the color data at index \a i.
-*/
-QColor4ub &QGeometryData::color(int i)
-{
- create();
- d->modified = true;
- return d->colors[i];
-}
-
-/*!
- Returns a non-modifiable reference to the color data at index \a i.
-*/
-const QColor4ub &QGeometryData::colorAt(int i) const
-{
- Q_ASSERT(hasField(QGL::Color));
- return d->colors.at(i);
-}
-
-/*!
- Returns a copy of the color data.
-*/
-QArray<QColor4ub> QGeometryData::colors() const
-{
- if (d)
- return d->colors;
- return QArray<QColor4ub>();
-}
-
-/*!
- Returns a modifiable reference to the \a field texture coordinate data at index \a i.
-*/
-QVector2D &QGeometryData::texCoord(int i, QGL::VertexAttribute field)
-{
- create();
- d->modified = true;
- return d->textures[d->key[field]][i];
-}
-
-/*!
- Returns a copy of the \a field texture coordinate data.
-*/
-QVector2DArray QGeometryData::texCoords(QGL::VertexAttribute field) const
-{
- return hasField(field) ? d->textures.at(d->key[field]) : QVector2DArray();
-}
-
-/*!
- Returns a non-modifiable reference to the texture coordinate data at index \a i for \a field.
-*/
-const QVector2D &QGeometryData::texCoordAt(int i, QGL::VertexAttribute field) const
-{
- Q_ASSERT(hasField(field));
- return d->textures.at(d->key[field]).at(i);
-}
-
-/*!
- Returns a modifiable reference to the float \a field attribute data at index \a i.
-*/
-float &QGeometryData::floatAttribute(int i, QGL::VertexAttribute field)
-{
- create();
- d->modified = true;
- QCustomDataArray &ary = d->attributes[d->key[field]];
- Q_ASSERT(ary.elementType() == QCustomDataArray::Float);
- return ary.m_array[i];
-}
-
-/*!
- Returns a modifiable reference to the 2D vector \a field attribute data at index \a i.
-*/
-QVector2D &QGeometryData::vector2DAttribute(int i, QGL::VertexAttribute field)
-{
- create();
- d->modified = true;
- QCustomDataArray &ary = d->attributes[d->key[field]];
- Q_ASSERT(ary.elementType() == QCustomDataArray::Vector2D);
- float *data = ary.m_array.data();
- QVector2D *v = reinterpret_cast<QVector2D*>(data + i*2);
- return *v;
-}
-
-/*!
- Returns a modifiable reference to the 3D vector \a field attribute data at index \a i.
-*/
-QVector3D &QGeometryData::vector3DAttribute(int i, QGL::VertexAttribute field)
-{
- create();
- d->modified = true;
- QCustomDataArray &ary = d->attributes[d->key[field]];
- Q_ASSERT(ary.elementType() == QCustomDataArray::Vector3D);
- float *data = ary.m_array.data();
- QVector3D *v = reinterpret_cast<QVector3D*>(data + i*2);
- return *v;
-}
-
-/*!
- Returns a copy of the \a field attribute data.
-*/
-QCustomDataArray QGeometryData::attributes(QGL::VertexAttribute field) const
-{
- return hasField(field) ? d->attributes.at(d->key[field]) : QCustomDataArray();
-}
-
-/*!
- Returns a copy of the float \a field attribute data at index \a i.
-*/
-float QGeometryData::floatAttributeAt(int i, QGL::VertexAttribute field) const
-{
- Q_ASSERT(hasField(field));
- return d->attributes.at(d->key[field]).floatAt(i);
-}
-
-/*!
- Returns a copy of the 2D vector \a field attribute data at index \a i.
-*/
-QVector2D QGeometryData::vector2DAttributeAt(int i, QGL::VertexAttribute field) const
-{
- Q_ASSERT(hasField(field));
- return d->attributes.at(d->key[field]).vector2DAt(i);
-}
-
-/*!
- Returns a copy of the 3D vector \a field attribute data at index \a i.
-*/
-QVector3D QGeometryData::vector3DAttributeAt(int i, QGL::VertexAttribute field) const
-{
- Q_ASSERT(hasField(field));
- return d->attributes.at(d->key[field]).vector3DAt(i);
-}
-
-/*!
- Returns the attribute value for the \a field, suitable for passing
- to QGLPainter.
-
- \sa QGLPainter::setVertexAttribute()
-*/
-QGLAttributeValue QGeometryData::attributeValue(QGL::VertexAttribute field) const
-{
- if (hasField(field))
- {
- if (field < QGL::TextureCoord0)
- {
- if (field == QGL::Position)
- return QGLAttributeValue(d->vertices);
- else if (field == QGL::Normal)
- return QGLAttributeValue(d->normals);
- else if (field == QGL::Color)
- return QGLAttributeValue(d->colors);
- }
- else
- {
- if (field < QGL::CustomVertex0)
- return QGLAttributeValue(d->textures.at(d->key[field]));
- else
- return QGLAttributeValue(d->attributes.at(d->key[field]));
- }
- }
- return QGLAttributeValue();
-}
-
-/*!
- Returns true if this geometry has the field corresponding to \a attr. Note
- that it is still possible for no data to have been added for that field.
-*/
-bool QGeometryData::hasField(QGL::VertexAttribute attr) const
-{
- if (d)
- return d->key[attr] != -1;
- return false;
-}
-
-/*!
- Enables this geometry to contain data of type \a field. Generally it is
- not necessary to call this function since it is called by all the append
- functions.
-*/
-void QGeometryData::enableField(QGL::VertexAttribute field)
-{
- if (d && d->key[field] != -1)
- return;
- create();
- d->modified = true;
- Q_ASSERT(field < d->ATTR_CNT); // don't expand that enum too much
- d->fields |= (1 << field);
- switch (field)
- {
- case QGL::Position:
- d->key[QGL::Position] = 0;
- d->size[QGL::Position] = 3;
- if (d->reserved > 0)
- d->vertices.reserve(d->reserved);
- break;
- case QGL::Normal:
- d->key[QGL::Normal] = 1;
- d->size[QGL::Normal] = 3;
- if (d->reserved > 0)
- d->normals.reserve(d->reserved);
- break;
- case QGL::Color:
- d->key[QGL::Color] = 2;
- d->size[QGL::Color] = 1;
- if (d->reserved > 0)
- d->colors.reserve(d->reserved);
- break;
- case QGL::TextureCoord0:
- case QGL::TextureCoord1:
- case QGL::TextureCoord2:
- d->textures.append(QVector2DArray());
- d->key[field] = d->textures.count() - 1;
- d->size[field] = 2;
- if (d->reserved > 0)
- d->textures[d->key[field]].reserve(d->reserved);
- break;
- default:
- // Custom and User vertex attributes.
- d->attributes.append(QCustomDataArray());
- d->key[field] = d->attributes.count() - 1;
- d->size[field] = d->attributes.at(d->key[field]).elementSize();
- if (d->reserved > 0)
- d->attributes[d->key[field]].reserve(d->reserved);
- break;
- }
-}
-
-/*!
- Return a bit-mask of the supported fields in this geometry. The
- QGL::VertexAttribute enum can be recovered from this bit-mask by
- \code
- quint32 fields = fields();
- QGL::VertexAttribute attr = static_cast<QGL::VertexAttribute>(fields);
- \endcode
-*/
-quint32 QGeometryData::fields() const
-{
- if (d)
- return d->fields;
- return 0;
-}
-
-/*!
- Returns the count of logical vertices stored. This is effectively
- the max() of QArray::count() over all of the enabled data types.
-*/
-int QGeometryData::count() const
-{
- if (d)
- return d->count;
- return 0;
-}
-
-/*!
- Returns the count of data stored in \a field. This will always be at
- most count(), but could be less.
-*/
-int QGeometryData::count(QGL::VertexAttribute field) const
-{
- int result = 0;
- if (d && (QGL::fieldMask(field) & d->fields))
- {
- if (field < QGL::TextureCoord0)
- {
- if (field == QGL::Position)
- result = d->vertices.count();
- else if (field == QGL::Normal)
- result = d->normals.count();
- else
- result = d->colors.count();
- }
- else if (field < QGL::CustomVertex0)
- {
- result = d->textures[d->key[field]].count();
- }
- else
- {
- result = d->attributes[d->key[field]].count();
- }
- }
- return result;
-}
-
-/*!
- Returns true if this geometry is identical to the \a other; and false otherwise.
-*/
-bool QGeometryData::operator==(const QGeometryData &other) const
-{
- bool isEqual = false;
- if (d)
- {
- if (d == other.d)
- {
- isEqual = true;
- }
- else
- {
- if (other.d && d->fields == other.d->fields && d->count == other.d->count)
- {
- const quint32 mask = 0x01;
- quint32 fields = d->fields;
- isEqual = true;
- for (int field = 0; fields && isEqual; ++field, fields >>= 1)
- {
- if (mask & fields)
- {
- QGL::VertexAttribute attr = static_cast<QGL::VertexAttribute>(field);
- if (attr < QGL::TextureCoord0)
- {
- if (attr == QGL::Position)
- isEqual = (d->vertices == other.d->vertices);
- else if (attr == QGL::Normal)
- isEqual = (d->normals == other.d->normals);
- else // colors
- isEqual = (d->colors == other.d->colors);
- }
- else if (attr < QGL::CustomVertex0)
- {
- isEqual = (d->textures.at(d->key[attr]) == other.d->textures.at(d->key[attr]));
- }
- else
- {
- QArray<float> me = d->attributes.at(d->key[attr]).toFloatArray();
- QArray<float> him = other.d->attributes.at(d->key[attr]).toFloatArray();
- isEqual = (me == him);
- }
- }
- }
- }
- }
- }
- else
- {
- isEqual = other.isNull();
- }
- return isEqual;
-}
-
-/*!
- Returns true if this geometry is empty - that is it contains no vertices
- or other data - and returns false otherwise. If an existing geometry has
- been made empty by a call to clear() then this will be true (but isNull()
- will be false).
-
- \sa isNull()
-*/
-bool QGeometryData::isEmpty() const
-{
- bool empty = true;
- if (d)
- empty = d->count == 0;
- return empty;
-}
-
-/*!
- Returns true if this geometry is uninitialized - that is it contains no
- internal data structures. A newly constructed QGeometryData object is
- null until some data is added or changed.
-
- \sa isEmpty()
-*/
-bool QGeometryData::isNull() const
-{
- return d == NULL;
-}
-
-/*!
- Returns the number of index values stored in this geometry data.
-
- This value is exactly the same as indices().size() (but does not
- incur the copy).
-*/
-int QGeometryData::indexCount() const
-{
- if (d)
- return d->indices.size();
- return 0;
-}
-
-void QGeometryData::create()
-{
- if (!d) // lazy creation of data block
- {
- d = new QGeometryDataPrivate;
- d->ref.ref();
- }
-}
-
-/*!
- Force this geometry to ensure it has its own unshared internal data
- block, making a copy in the case that it is currently shared.
-*/
-void QGeometryData::detach()
-{
- create();
- if (d->ref > 1) // being shared, must detach
- {
- QGeometryDataPrivate *temp = d->clone();
- d->ref.deref();
- d = temp;
- d->ref.ref();
- }
-}
-
-/*!
- \fn quint64 QGeometryData::id() const
- Return an opaque value that can be used to identify which data block is
- being used by this QGeometryData instance. See the class documentation
- relating to explicit sharing.
-*/
-
-#ifndef QT_NO_DEBUG
-void QGeometryData::check() const
-{
- if (!d)
- return;
- const quint32 mask = 0x01;
- quint32 fields = d->fields;
- for (int field = 0; fields; ++field, fields >>= 1)
- {
- if (mask & fields)
- {
- QGL::VertexAttribute attr = static_cast<QGL::VertexAttribute>(field);
- if (attr < QGL::TextureCoord0)
- {
- if (attr == QGL::Position)
- {
- if (d->vertices.count() < d->count)
- qWarning("QGeometryData - expected %d vertices, only %d found!",
- d->count, d->vertices.count());
- }
- else if (attr == QGL::Normal)
- {
- if (d->normals.count() < d->count)
- qWarning("QGeometryData - expected %d normals, only %d found!",
- d->count, d->normals.count());
- }
- else
- {
- if (d->colors.count() < d->count)
- qWarning("QGeometryData - expected %d colors, only %d found!",
- d->count, d->colors.count());
- }
- }
- else if (attr < QGL::CustomVertex0)
- {
- if (d->textures.at(d->key[field]).count() < d->count)
- qWarning("QGeometryData - expected %d texture coordinates for"
- "QGL::TextureCoord%d, only %d found!",
- d->count, field - QGL::TextureCoord0, d->textures.at(d->key[field]).count());
- }
- else
- {
- if (d->attributes.at(d->key[field]).count() < d->count)
- qWarning("QGeometryData - expected %d attributes for"
- "QGL::CustomVertex%d, only %d found!",
- d->count, field - QGL::CustomVertex0, d->attributes.at(d->key[field]).count());
- }
- }
- }
-}
-#endif
-
-#ifndef QT_NO_DEBUG_STREAM
-QDebug operator<<(QDebug dbg, const QGeometryData &vertices)
-{
- dbg << "QGeometryData" << &vertices << " size:" << vertices.count()
-#ifndef QT_NO_DEBUG
- << "data block id:" << vertices.id()
-#endif
- ;
- quint32 fields = vertices.fields();
- const quint32 mask = 0x01;
- for (int field = 0; fields; ++field, fields >>= 1)
- {
- if (mask & fields)
- {
- QGL::VertexAttribute attr = static_cast<QGL::VertexAttribute>(field);
- if (attr < QGL::TextureCoord0)
- {
- if (attr == QGL::Position)
- {
- dbg << " vertices:" << vertices.count(attr);
- dbg << vertices.vertices();
- }
- else if (attr == QGL::Normal)
- {
- dbg << " normals:" << vertices.count(attr);
- dbg << vertices.normals();
- }
- else
- {
- dbg << " colors:" << vertices.count(attr);
- dbg << vertices.colors();
- }
- }
- else if (attr < QGL::CustomVertex0)
- {
- dbg << " textures:" << (attr - QGL::TextureCoord0) << vertices.count(attr);
- dbg << vertices.texCoords(attr);
- }
- else
- {
- dbg << " custom:" << (attr - QGL::CustomVertex0) << vertices.count(attr);
- dbg << vertices.texCoords(attr);
- }
- }
- }
- if (vertices.indexCount() > 0)
- {
- dbg << " indices:" << vertices.indices();
- }
- return dbg;
-}
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/threed/geometry/qgeometrydata.h b/src/threed/geometry/qgeometrydata.h
deleted file mode 100644
index bab4588e..00000000
--- a/src/threed/geometry/qgeometrydata.h
+++ /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$
-**
-****************************************************************************/
-
-#ifndef QGEOMETRYDATA_H
-#define QGEOMETRYDATA_H
-
-#include "qcolor4ub.h"
-#include "qglnamespace.h"
-#include "qglindexbuffer.h"
-#include "qglvertexbundle.h"
-#include "qglattributevalue.h"
-#include "qcustomdataarray.h"
-#include "qbox3d.h"
-#include "qarray.h"
-#include "qvector2darray.h"
-#include "qvector3darray.h"
-
-QT_BEGIN_NAMESPACE
-
-class QGeometryDataPrivate;
-class QLogicalVertex;
-class QGLPainter;
-
-namespace QGL
-{
- inline quint32 fieldMask(QGL::VertexAttribute f) { return (quint32)0x01 << f; }
-
-#if defined(QT_OPENGL_ES)
- typedef QArray<ushort> IndexArray;
-#else
- typedef QArray<uint> IndexArray;
-#endif
-};
-
-class Q_QT3D_EXPORT QGeometryData
-{
-public:
- QGeometryData();
- QGeometryData(const QGeometryData &);
- QGeometryData(quint32 fields);
- ~QGeometryData();
-
- QGeometryData &operator=(const QGeometryData &);
-
- void appendGeometry(const QGeometryData &data);
- int appendVertex(const QLogicalVertex &v);
- void normalizeNormals();
- QBox3D boundingBox() const;
- QVector3D center() const;
-
- QGeometryData reversed() const;
- QGeometryData translated(const QVector3D &) const;
- void generateTextureCoordinates(Qt::Orientation orientation = Qt::Horizontal,
- QGL::VertexAttribute attribute = QGL::TextureCoord0);
- QGeometryData interleavedWith(const QGeometryData &other) const;
- void interleaveWith(const QGeometryData &other);
- void clear();
- void clear(QGL::VertexAttribute);
- void reserve(int amount);
- void draw(QGLPainter *painter, int start, int count, GLenum mode = QGL::Triangles, qreal drawWidth=1.0);
- bool upload();
- enum BufferStrategyFlags
- {
- InvalidStrategy = 0x00,
- KeepClientData = 0x01,
- BufferIfPossible = 0x02,
- };
- Q_DECLARE_FLAGS(BufferStrategy, BufferStrategyFlags)
- void setBufferStrategy(BufferStrategy strategy);
- BufferStrategy bufferStrategy() const;
- QGLVertexBundle vertexBundle() const;
- QGLIndexBuffer indexBuffer() const;
-
- void appendIndex(int index);
- void appendIndices(int index1, int index2, int index3);
- void appendIndices(const QGL::IndexArray &indices);
- QGL::IndexArray indices() const;
-
- void appendVertex(const QVector3D &v0);
- void appendVertex(const QVector3D &v0, const QVector3D &v1);
- void appendVertex(const QVector3D &v0, const QVector3D &v1, const QVector3D &v2);
- void appendVertex(const QVector3D &v0, const QVector3D &v1, const QVector3D &v2, const QVector3D &v3);
-
- void appendAttribute(float a, QGL::VertexAttribute field = QGL::CustomVertex0);
- void appendAttribute(float a, float b, QGL::VertexAttribute field = QGL::CustomVertex0);
- void appendAttribute(float a, float b, float c, QGL::VertexAttribute field = QGL::CustomVertex0);
- void appendAttribute(float a, float b, float c, float d, QGL::VertexAttribute field = QGL::CustomVertex0);
- void appendAttribute(const QVector2D &a, QGL::VertexAttribute field = QGL::CustomVertex0);
- void appendAttribute(const QVector3D &a, QGL::VertexAttribute field = QGL::CustomVertex0);
- void appendAttribute(const QVariant &a, QGL::VertexAttribute field = QGL::CustomVertex0);
-
- void appendNormal(const QVector3D &n0);
- void appendNormal(const QVector3D &n0, const QVector3D &n1);
- void appendNormal(const QVector3D &n0, const QVector3D &n1, const QVector3D &n2);
- void appendNormal(const QVector3D &n0, const QVector3D &n1, const QVector3D &n2, const QVector3D &n3);
-
- void appendTexCoord(const QVector2D &t0, QGL::VertexAttribute field = QGL::TextureCoord0);
- void appendTexCoord(const QVector2D &t0, const QVector2D &t1, QGL::VertexAttribute field = QGL::TextureCoord0);
- void appendTexCoord(const QVector2D &t0, const QVector2D &t1, const QVector2D &t2, QGL::VertexAttribute field = QGL::TextureCoord0);
- void appendTexCoord(const QVector2D &t0, const QVector2D &t1, const QVector2D &t2, const QVector2D &t3, QGL::VertexAttribute field = QGL::TextureCoord0);
-
- void appendColor(const QColor4ub &c0);
- void appendColor(const QColor4ub &c0, const QColor4ub &c1);
- void appendColor(const QColor4ub &c0, const QColor4ub &c1, const QColor4ub &c2);
- void appendColor(const QColor4ub &c0, const QColor4ub &c1, const QColor4ub &c2, const QColor4ub &c3);
-
- void appendVertexArray(const QVector3DArray &ary);
- void appendAttributeArray(const QCustomDataArray &ary, QGL::VertexAttribute field = QGL::CustomVertex0);
- void appendNormalArray(const QVector3DArray &ary);
- void appendTexCoordArray(const QVector2DArray &ary, QGL::VertexAttribute field = QGL::TextureCoord0);
- void appendColorArray(const QArray<QColor4ub> &ary);
-
- QLogicalVertex logicalVertexAt(int i) const;
-
- QVector3DArray vertices() const;
- QVector3D &vertex(int i);
- const QVector3D &vertexAt(int i) const;
-
- QVector3DArray normals() const;
- QVector3D &normal(int i);
- const QVector3D &normalAt(int i) const;
-
- QArray<QColor4ub> colors() const;
- QColor4ub &color(int i);
- const QColor4ub &colorAt(int i) const;
-
- QVector2DArray texCoords(QGL::VertexAttribute field = QGL::TextureCoord0) const;
- QVector2D &texCoord(int i, QGL::VertexAttribute field = QGL::TextureCoord0);
- const QVector2D &texCoordAt(int i, QGL::VertexAttribute field = QGL::TextureCoord0) const;
-
- float &floatAttribute(int i, QGL::VertexAttribute field = QGL::CustomVertex0);
- QVector2D &vector2DAttribute(int i, QGL::VertexAttribute field = QGL::CustomVertex0);
- QVector3D &vector3DAttribute(int i, QGL::VertexAttribute field = QGL::CustomVertex0);
- QCustomDataArray attributes(QGL::VertexAttribute field = QGL::CustomVertex0) const;
- float floatAttributeAt(int i, QGL::VertexAttribute field = QGL::CustomVertex0) const;
- QVector2D vector2DAttributeAt(int i, QGL::VertexAttribute field = QGL::CustomVertex0) const;
- QVector3D vector3DAttributeAt(int i, QGL::VertexAttribute field = QGL::CustomVertex0) const;
-
- QGLAttributeValue attributeValue(QGL::VertexAttribute field) const;
- bool hasField(QGL::VertexAttribute field) const;
- void enableField(QGL::VertexAttribute field);
- quint32 fields() const;
- int count() const;
- int count(QGL::VertexAttribute field) const;
- int indexCount() const;
- bool operator==(const QGeometryData &other) const;
- bool isEmpty() const;
- bool isNull() const;
- void detach();
-#ifndef QT_NO_DEBUG
- quint64 id() const { return (quint64)d; }
-#endif
-protected:
- const QVector3DArray *vertexData() const;
-private:
- void create();
-#ifndef QT_NO_DEBUG
- void check() const;
-#else
- void check() const {}
-#endif
- friend class QLogicalVertex;
-
- QGeometryDataPrivate *d;
-};
-
-Q_DECLARE_OPERATORS_FOR_FLAGS(QGeometryData::BufferStrategy);
-
-#ifndef QT_NO_DEBUG_STREAM
-Q_QT3D_EXPORT QDebug operator<<(QDebug dbg, const QGeometryData &vertices);
-#endif
-
-QT_END_NAMESPACE
-
-#endif // QGEOMETRYDATA_H
diff --git a/src/threed/geometry/qglbezierpatches.cpp b/src/threed/geometry/qglbezierpatches.cpp
deleted file mode 100644
index 6d97bc88..00000000
--- a/src/threed/geometry/qglbezierpatches.cpp
+++ /dev/null
@@ -1,815 +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 "qglbezierpatches.h"
-#include "qglbuilder.h"
-#include "qray3d.h"
-#include "qtriangle3d.h"
-#include <QtCore/qnumeric.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGLBezierPatches
- \brief The QGLBezierPatches class represents 3D geometry as a set of Bezier bicubic patches.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::geometry
-
- Bezier bicubic patches represent a curved 3D surface by four fixed
- control points at indices 0, 3, 12, and 15, together with twelve
- additional floating control points that define the surface
- curvature. Bezier geometry objects are made up of one or more
- such patches to define the surface of an object.
-
- The application specifies the vertex position data to the
- constructor, and can optionally provide an index array.
- The class interprets groups of 16 vertices as the control
- points for successive patches.
-
- A mesh defined by QGLBezierPatches is subdivided into flat
- triangles for rendering when the \c{<<} operator is used
- to add the patches to a QGLBuilder.
-
- Many curved 3D objects can be defined as being made up of Bezier
- bicubic patches, stitched together into a mesh. The most famous
- Bezier bicubic object is probably the classic 3D "Utah Teapot",
- first rendered in 1975. The QGLTeapot class provides a built-in
- implementation of this object for testing purposes.
-
- If texture co-ordinates are supplied via setTextureCoords(),
- then patch texture co-ordinates will be derived from the
- specified values as the patches are subdivided. Otherwise,
- QGLBezierPatches will generate texture co-ordinates for each
- patch based on the default square from (0, 0) to (1, 1).
- The first vertex in the patch corresponds to (0, 0),
- and the opposite vertex in the patch corresponds to (1, 1).
-
- \sa QGLBuilder, QGLTeapot
-*/
-
-class QGLBezierPatchesPrivate
-{
-public:
- QGLBezierPatchesPrivate()
- : subdivisionDepth(4) {}
- QGLBezierPatchesPrivate(const QGLBezierPatchesPrivate *other)
- : positions(other->positions)
- , textureCoords(other->textureCoords)
- , subdivisionDepth(other->subdivisionDepth) {}
-
- void copy(const QGLBezierPatchesPrivate *other)
- {
- positions = other->positions;
- textureCoords = other->textureCoords;
- subdivisionDepth = other->subdivisionDepth;
- }
-
- void subdivide(QGLBuilder *list) const;
- qreal intersection
- (const QRay3D &ray, bool anyIntersection, QVector2D *texCoord, int *patch) const;
-
- QVector3DArray positions;
- QVector2DArray textureCoords;
- int subdivisionDepth;
-};
-
-// Temporary patch data for performing sub-divisions.
-class QGLBezierPatch
-{
-public:
- // Control points for this mesh.
- QVector3D points[16];
-
- // Triangle mesh indices of the control points at each corner.
- int indices[4];
-
- QVector3D normal(qreal s, qreal t) const;
- void convertToTriangles
- (QGeometryData *prim,
- qreal xtex, qreal ytex, qreal wtex, qreal htex);
- void subDivide(QGLBezierPatch &patch1, QGLBezierPatch &patch2,
- QGLBezierPatch &patch3, QGLBezierPatch &patch4);
- void createNewCorners(QGLBezierPatch &patch1, QGLBezierPatch &patch2,
- QGLBezierPatch &patch3, QGLBezierPatch &patch4,
- QGeometryData *prim,
- qreal xtex, qreal ytex, qreal wtex, qreal htex);
- void recursiveSubDivide
- (QGeometryData *prim,
- int depth, qreal xtex, qreal ytex, qreal wtex, qreal htex);
- qreal intersection
- (qreal result, int depth, const QRay3D &ray, bool anyIntersection,
- qreal xtex, qreal ytex, qreal wtex, qreal htex, QVector2D *tc);
-};
-
-static int const cornerOffsets[] = {0, 3, 12, 15};
-static qreal const cornerS[] = {0.0f, 1.0f, 0.0f, 1.0f};
-static qreal const cornerT[] = {0.0f, 0.0f, 1.0f, 1.0f};
-
-// Helper functions for calculating the components of the Bernstein
-// polynomial and its derivative that make up the surface.
-static inline qreal b0(qreal v)
-{
- return (1.0f - v) * (1.0f - v) * (1.0f - v);
-}
-static inline qreal b1(qreal v)
-{
- return 3.0f * v * (1.0f - v) * (1.0f - v);
-}
-static inline qreal b2(qreal v)
-{
- return 2.0f * v * v * (1.0f - v);
-}
-static inline qreal b3(qreal v)
-{
- return v * v * v;
-}
-static inline qreal db0(qreal v)
-{
- return -3.0f * (1.0f - v) * (1.0f - v);
-}
-static inline qreal db1(qreal v)
-{
- return -6.0f * v * (1.0f - v) + 3.0f * (1.0f - v) * (1.0f - v);
-}
-static inline qreal db2(qreal v)
-{
- return -3.0f * v * v + 6.0f * v * (1.0f - v);
-}
-static inline qreal db3(qreal v)
-{
- return 3.0f * v * v;
-}
-
-// Compute the normal at a specific point in the patch.
-// The s and t values vary between 0 and 1.
-QVector3D QGLBezierPatch::normal(qreal s, qreal t) const
-{
- qreal a[4];
- qreal b[4];
- qreal tx, ty, tz;
- qreal sx, sy, sz;
-
- // Compute the derivative of the surface in t.
- a[0] = b0(s);
- a[1] = b1(s);
- a[2] = b2(s);
- a[3] = b3(s);
- b[0] = db0(t);
- b[1] = db1(t);
- b[2] = db2(t);
- b[3] = db3(t);
- tx = 0.0f;
- ty = 0.0f;
- tz = 0.0f;
- for (int i = 0; i < 4; ++i) {
- for (int j = 0; j < 4; ++j) {
- tx += a[i] * points[j * 4 + i].x() * b[j];
- ty += a[i] * points[j * 4 + i].y() * b[j];
- tz += a[i] * points[j * 4 + i].z() * b[j];
- }
- }
-
- // Compute the derivative of the surface in s.
- a[0] = db0(s);
- a[1] = db1(s);
- a[2] = db2(s);
- a[3] = db3(s);
- b[0] = b0(t);
- b[1] = b1(t);
- b[2] = b2(t);
- b[3] = b3(t);
- sx = 0.0f;
- sy = 0.0f;
- sz = 0.0f;
- for (int i = 0; i < 4; ++i) {
- for (int j = 0; j < 4; ++j) {
- sx += a[i] * points[j * 4 + i].x() * b[j];
- sy += a[i] * points[j * 4 + i].y() * b[j];
- sz += a[i] * points[j * 4 + i].z() * b[j];
- }
- }
-
- // The normal is the cross-product of the two derivatives,
- // normalized to a unit vector.
- QVector3D n = QVector3D::normal(QVector3D(sx, sy, sz), QVector3D(tx, ty, tz));
- if (n.isNull()) {
- // A zero normal may occur if one of the patch edges is zero-length.
- // We correct for this by substituting an overall patch normal that
- // we compute from two of the sides that are not zero in length.
- QVector3D sides[4];
- QVector3D vectors[2];
- sides[0] = points[3] - points[0];
- sides[1] = points[15] - points[3];
- sides[2] = points[12] - points[15];
- sides[3] = points[0] - points[12];
- int i = 0;
- int j = 0;
- vectors[0] = QVector3D(1.0f, 0.0f, 0.0f);
- vectors[1] = QVector3D(0.0f, 1.0f, 0.0f);
- while (i < 2 && j < 4) {
- if (sides[j].isNull())
- ++j;
- else
- vectors[i++] = sides[j++];
- }
- n = QVector3D::normal(vectors[0], vectors[1]);
- }
- return n;
-}
-
-// Convert this patch into flat triangles.
-void QGLBezierPatch::convertToTriangles
- (QGeometryData *prim,
- qreal xtex, qreal ytex, qreal wtex, qreal htex)
-{
- // The edges are considered ok if they have a non-zero length.
- // Zero-length edges can occur in triangular-shaped patches.
- // There is no point generating triangles along such edges.
- bool edge1ok = (points[0] != points[3]);
- bool edge2ok = (points[0] != points[12]);
- bool edge3ok = (points[12] != points[15]);
- bool edge4ok = (points[15] != points[3]);
-
- // Find the mid-point on the patch by averaging the corners.
- QVector3D mid = (points[0] + points[3] + points[12] + points[15]) / 4.0f;
-
- // Allocate a triangle mesh vertex for the mid-point.
- int midIndex = prim->count();
- prim->appendVertex(mid);
- prim->appendNormal(normal(0.5f, 0.5f));
- prim->appendTexCoord
- (QVector2D(xtex + wtex / 2.0f, ytex + htex / 2.0f));
-
- // Divide the patch into 4 triangles pointing at the center.
- if (edge1ok)
- prim->appendIndices(indices[0], indices[1], midIndex);
- if (edge2ok)
- prim->appendIndices(indices[2], indices[0], midIndex);
- if (edge3ok)
- prim->appendIndices(indices[3], indices[2], midIndex);
- if (edge4ok)
- prim->appendIndices(indices[1], indices[3], midIndex);
-}
-
-// Sub-divide a Bezier curve (p1, p2, p3, p4) into two new
-// Bezier curves (l1, l2, l3, l4) and (r1, r2, r3, r4).
-static void subDivideBezierCurve
- (const QVector3D &p1, const QVector3D &p2,
- const QVector3D &p3, const QVector3D &p4,
- QVector3D &l1, QVector3D &l2, QVector3D &l3, QVector3D &l4,
- QVector3D &r1, QVector3D &r2, QVector3D &r3, QVector3D &r4)
-{
- l1 = p1;
- l2 = (p1 + p2) / 2.0f;
- QVector3D h = (p2 + p3) / 2.0f;
- l3 = (l2 + h) / 2.0f;
- r3 = (p3 + p4) / 2.0f;
- r2 = (h + r3) / 2.0f;
- l4 = r1 = (l3 + r2) / 2.0f;
- r4 = p4;
-}
-
-// Sub-divide this patch into four new patches. The triangle mesh
-// is used to allocate vertices for the corners of the new patches.
-void QGLBezierPatch::subDivide
- (QGLBezierPatch &patch1, QGLBezierPatch &patch2,
- QGLBezierPatch &patch3, QGLBezierPatch &patch4)
-{
- // Sub-divide the Bezier curves for the control rows to create
- // four rows of 8 control points. These define the left and
- // right halves of the patch.
- QVector3D row1[8];
- QVector3D row2[8];
- QVector3D row3[8];
- QVector3D row4[8];
- subDivideBezierCurve
- (points[0], points[1], points[2], points[3],
- row1[0], row1[1], row1[2], row1[3], row1[4], row1[5], row1[6], row1[7]);
- subDivideBezierCurve
- (points[4], points[5], points[6], points[7],
- row2[0], row2[1], row2[2], row2[3], row2[4], row2[5], row2[6], row2[7]);
- subDivideBezierCurve
- (points[8], points[9], points[10], points[11],
- row3[0], row3[1], row3[2], row3[3], row3[4], row3[5], row3[6], row3[7]);
- subDivideBezierCurve
- (points[12], points[13], points[14], points[15],
- row4[0], row4[1], row4[2], row4[3], row4[4], row4[5], row4[6], row4[7]);
-
- // Now sub-divide the 8 columns to create the four new patches.
- subDivideBezierCurve
- (row1[0], row2[0], row3[0], row4[0],
- patch1.points[0], patch1.points[4], patch1.points[8], patch1.points[12],
- patch3.points[0], patch3.points[4], patch3.points[8], patch3.points[12]);
- subDivideBezierCurve
- (row1[1], row2[1], row3[1], row4[1],
- patch1.points[1], patch1.points[5], patch1.points[9], patch1.points[13],
- patch3.points[1], patch3.points[5], patch3.points[9], patch3.points[13]);
- subDivideBezierCurve
- (row1[2], row2[2], row3[2], row4[2],
- patch1.points[2], patch1.points[6], patch1.points[10], patch1.points[14],
- patch3.points[2], patch3.points[6], patch3.points[10], patch3.points[14]);
- subDivideBezierCurve
- (row1[3], row2[3], row3[3], row4[3],
- patch1.points[3], patch1.points[7], patch1.points[11], patch1.points[15],
- patch3.points[3], patch3.points[7], patch3.points[11], patch3.points[15]);
- subDivideBezierCurve
- (row1[4], row2[4], row3[4], row4[4],
- patch2.points[0], patch2.points[4], patch2.points[8], patch2.points[12],
- patch4.points[0], patch4.points[4], patch4.points[8], patch4.points[12]);
- subDivideBezierCurve
- (row1[5], row2[5], row3[5], row4[5],
- patch2.points[1], patch2.points[5], patch2.points[9], patch2.points[13],
- patch4.points[1], patch4.points[5], patch4.points[9], patch4.points[13]);
- subDivideBezierCurve
- (row1[6], row2[6], row3[6], row4[6],
- patch2.points[2], patch2.points[6], patch2.points[10], patch2.points[14],
- patch4.points[2], patch4.points[6], patch4.points[10], patch4.points[14]);
- subDivideBezierCurve
- (row1[7], row2[7], row3[7], row4[7],
- patch2.points[3], patch2.points[7], patch2.points[11], patch2.points[15],
- patch4.points[3], patch4.points[7], patch4.points[11], patch4.points[15]);
-}
-
-void QGLBezierPatch::createNewCorners
- (QGLBezierPatch &patch1, QGLBezierPatch &patch2,
- QGLBezierPatch &patch3, QGLBezierPatch &patch4,
- QGeometryData *prim,
- qreal xtex, qreal ytex, qreal wtex, qreal htex)
-{
- // Add vertices for the new patch corners we have created.
- qreal hwtex = wtex / 2.0f;
- qreal hhtex = htex / 2.0f;
- int topPointIndex = prim->count();
- int leftPointIndex = topPointIndex + 1;
- int midPointIndex = topPointIndex + 2;
- int rightPointIndex = topPointIndex + 3;
- int bottomPointIndex = topPointIndex + 4;
-
- prim->appendVertex(patch1.points[3]);
- prim->appendNormal(normal(0.5f, 0.0f));
- prim->appendTexCoord(QVector2D(xtex + hwtex, ytex));
-
- prim->appendVertex(patch1.points[12]);
- prim->appendNormal(normal(0.0f, 0.5f));
- prim->appendTexCoord(QVector2D(xtex, ytex + hhtex));
-
- prim->appendVertex(patch1.points[15]);
- prim->appendNormal(normal(0.5f, 0.5f));
- prim->appendTexCoord(QVector2D(xtex + hwtex, ytex + hhtex));
-
- prim->appendVertex(patch2.points[15]);
- prim->appendNormal(normal(1.0f, 0.5f));
- prim->appendTexCoord(QVector2D(xtex + wtex, ytex + hhtex));
-
- prim->appendVertex(patch3.points[15]);
- prim->appendNormal(normal(0.5f, 1.0f));
- prim->appendTexCoord(QVector2D(xtex + hwtex, ytex + htex));
-
- // Copy the indices for the corners of the new patches.
- patch1.indices[0] = indices[0];
- patch1.indices[1] = topPointIndex;
- patch1.indices[2] = leftPointIndex;
- patch1.indices[3] = midPointIndex;
- patch2.indices[0] = topPointIndex;
- patch2.indices[1] = indices[1];
- patch2.indices[2] = midPointIndex;
- patch2.indices[3] = rightPointIndex;
- patch3.indices[0] = leftPointIndex;
- patch3.indices[1] = midPointIndex;
- patch3.indices[2] = indices[2];
- patch3.indices[3] = bottomPointIndex;
- patch4.indices[0] = midPointIndex;
- patch4.indices[1] = rightPointIndex;
- patch4.indices[2] = bottomPointIndex;
- patch4.indices[3] = indices[3];
-}
-
-// Recursively sub-divide a patch into triangles.
-void QGLBezierPatch::recursiveSubDivide
- (QGeometryData *prim,
- int depth, qreal xtex, qreal ytex, qreal wtex, qreal htex)
-{
- if (depth <= 1) {
- convertToTriangles(prim, xtex, ytex, wtex, htex);
- } else {
- QGLBezierPatch patch1, patch2, patch3, patch4;
- subDivide(patch1, patch2, patch3, patch4);
- createNewCorners(patch1, patch2, patch3, patch4, prim, xtex, ytex, wtex, htex);
- --depth;
- qreal hwtex = wtex / 2.0f;
- qreal hhtex = htex / 2.0f;
- patch1.recursiveSubDivide(prim, depth, xtex, ytex, hwtex, hhtex);
- patch2.recursiveSubDivide(prim, depth, xtex + hwtex, ytex, hwtex, hhtex);
- patch3.recursiveSubDivide(prim, depth, xtex, ytex + hhtex, hwtex, hhtex);
- patch4.recursiveSubDivide(prim, depth, xtex + hwtex, ytex + hhtex, hwtex, hhtex);
- }
-}
-
-void QGLBezierPatchesPrivate::subdivide(QGLBuilder *list) const
-{
- QGeometryData prim;
- int count = positions.size();
- for (int posn = 0; (posn + 15) < count; posn += 16) {
- // Construct a QGLBezierPatch object from the next high-level patch.
- QGLBezierPatch patch;
- int vertex;
- for (int vertex = 0; vertex < 16; ++vertex)
- patch.points[vertex] = positions[posn + vertex];
- QVector2D tex1, tex2;
- if (!textureCoords.isEmpty()) {
- tex1 = textureCoords[(posn / 16) * 2];
- tex2 = textureCoords[(posn / 16) * 2 + 1];
- } else {
- tex1 = QVector2D(0.0f, 0.0f);
- tex2 = QVector2D(1.0f, 1.0f);
- }
- qreal xtex = tex1.x();
- qreal ytex = tex1.y();
- qreal wtex = tex2.x() - xtex;
- qreal htex = tex2.y() - ytex;
- for (int corner = 0; corner < 4; ++corner) {
- vertex = posn + cornerOffsets[corner];
- QVector3D n = patch.normal(cornerS[corner], cornerT[corner]);
- patch.indices[corner] = prim.count();
- prim.appendVertex(patch.points[cornerOffsets[corner]]);
- prim.appendNormal(n);
- prim.appendTexCoord
- (QVector2D(xtex + wtex * cornerS[corner],
- ytex + htex * cornerT[corner]));
- }
-
- // Subdivide the patch and generate the final triangles.
- patch.recursiveSubDivide(&prim, subdivisionDepth,
- xtex, ytex, wtex, htex);
- }
- list->addTriangles(prim);
-}
-
-static inline qreal combineResults(qreal result, qreal t)
-{
- if (qIsNaN(result))
- return t;
- if (t >= 0.0f)
- return result < 0.0f ? t : qMin(result, t);
- else
- return result >= 0.0f ? result : qMax(result, t);
-}
-
-qreal QGLBezierPatch::intersection
- (qreal result, int depth, const QRay3D& ray, bool anyIntersection,
- qreal xtex, qreal ytex, qreal wtex, qreal htex, QVector2D *tc)
-{
- // Check the convex hull of the patch for an intersection.
- // If no intersection with the convex hull, then there is
- // no point subdividing this patch further.
- QBox3D box;
- for (int point = 0; point < 16; ++point)
- box.unite(points[point]);
- if (!box.intersects(ray))
- return result;
-
- // Are we at the lowest point of subdivision yet?
- if (depth <= 1) {
- // Divide the patch into two triangles and intersect with those.
- QTriangle3D triangle1(points[0], points[3], points[12]);
- qreal t = triangle1.intersection(ray);
- if (!qIsNaN(t)) {
- result = combineResults(result, t);
- if (result == t) {
- QVector2D uv = triangle1.uv(ray.point(t));
- QVector2D tp(xtex, ytex);
- QVector2D tq(xtex + wtex, ytex);
- QVector2D tr(xtex, ytex + htex);
- *tc = uv.x() * tp + uv.y() * tq + (1 - uv.x() - uv.y()) * tr;
- }
- } else {
- QTriangle3D triangle2(points[3], points[15], points[12]);
- qreal t = triangle2.intersection(ray);
- if (!qIsNaN(t)) {
- result = combineResults(result, t);
- if (result == t) {
- QVector2D uv = triangle2.uv(ray.point(t));
- QVector2D tp(xtex + wtex, ytex);
- QVector2D tq(xtex + wtex, ytex + htex);
- QVector2D tr(xtex, ytex + htex);
- *tc = uv.x() * tp + uv.y() * tq + (1 - uv.x() - uv.y()) * tr;
- }
- }
- }
- } else {
- // Subdivide the patch to find the point of intersection.
- QGLBezierPatch patch1, patch2, patch3, patch4;
- subDivide(patch1, patch2, patch3, patch4);
- --depth;
- qreal hwtex = wtex / 2.0f;
- qreal hhtex = htex / 2.0f;
- result = patch1.intersection
- (result, depth, ray, anyIntersection,
- xtex, ytex, hwtex, hhtex, tc);
- if (anyIntersection && !qIsNaN(result))
- return result;
- result = patch2.intersection
- (result, depth, ray, anyIntersection,
- xtex + hwtex, ytex, hwtex, hhtex, tc);
- if (anyIntersection && !qIsNaN(result))
- return result;
- result = patch3.intersection
- (result, depth, ray, anyIntersection,
- xtex, ytex + hhtex, hwtex, hhtex, tc);
- if (anyIntersection && !qIsNaN(result))
- return result;
- result = patch4.intersection
- (result, depth, ray, anyIntersection,
- xtex + hwtex, ytex + hhtex, hwtex, hhtex, tc);
- }
- return result;
-}
-
-qreal QGLBezierPatchesPrivate::intersection
- (const QRay3D &ray, bool anyIntersection, QVector2D *texCoord, int *bestPatch) const
-{
- int count = positions.size();
- qreal result = qSNaN();
- QVector2D tc;
- if (bestPatch)
- *bestPatch = -1;
- for (int posn = 0; (posn + 15) < count; posn += 16) {
- QGLBezierPatch patch;
- for (int vertex = 0; vertex < 16; ++vertex)
- patch.points[vertex] = positions[posn + vertex];
- QVector2D tex1, tex2;
- if (!textureCoords.isEmpty()) {
- tex1 = textureCoords[(posn / 16) * 2];
- tex2 = textureCoords[(posn / 16) * 2 + 1];
- } else {
- tex1 = QVector2D(0.0f, 0.0f);
- tex2 = QVector2D(1.0f, 1.0f);
- }
- qreal xtex = tex1.x();
- qreal ytex = tex1.y();
- qreal wtex = tex2.x() - xtex;
- qreal htex = tex2.y() - ytex;
- qreal prev = result;
- result = patch.intersection
- (result, subdivisionDepth, ray, anyIntersection,
- xtex, ytex, wtex, htex, &tc);
- if (bestPatch && result != prev)
- *bestPatch = posn / 16;
- if (anyIntersection && !qIsNaN(result))
- break;
- }
- if (texCoord && !qIsNaN(result))
- *texCoord = tc;
- return result;
-}
-
-/*!
- Constructs an empty Bezier patch list.
-
- \sa setPositions()
-*/
-QGLBezierPatches::QGLBezierPatches()
- : d_ptr(new QGLBezierPatchesPrivate())
-{
-}
-
-/*!
- Constructs a copy of \a other.
-
- \sa operator=()
-*/
-QGLBezierPatches::QGLBezierPatches(const QGLBezierPatches &other)
- : d_ptr(new QGLBezierPatchesPrivate(other.d_ptr.data()))
-{
-}
-
-/*!
- Destroys this Bezier patch list.
-*/
-QGLBezierPatches::~QGLBezierPatches()
-{
-}
-
-/*!
- Assigns \a other to this Bezier patch list.
-*/
-QGLBezierPatches &QGLBezierPatches::operator=
- (const QGLBezierPatches &other)
-{
- if (this != &other)
- d_ptr->copy(other.d_ptr.data());
- return *this;
-}
-
-/*!
- Returns the positions of the vertices in the Bezier patches.
-
- \sa setPositions(), textureCoords()
-*/
-QVector3DArray QGLBezierPatches::positions() const
-{
- Q_D(const QGLBezierPatches);
- return d->positions;
-}
-
-/*!
- Sets the \a positions of the vertices in the Bezier patches.
-
- \sa positions(), setTextureCoords()
-*/
-void QGLBezierPatches::setPositions(const QVector3DArray &positions)
-{
- Q_D(QGLBezierPatches);
- d->positions = positions;
-}
-
-/*!
- Returns the texture co-ordinates for the Bezier patches.
- Each patch consumes two elements from the texture
- co-ordinate array, defining the opposite corners.
-
- The default is an empty array, which indicates that each
- patch will generate texture co-ordinates in the range
- (0, 0) to (1, 1).
-
- \sa setTextureCoords(), positions()
-*/
-QVector2DArray QGLBezierPatches::textureCoords() const
-{
- Q_D(const QGLBezierPatches);
- return d->textureCoords;
-}
-
-/*!
- Sets the texture co-ordinates for the Bezier patches to
- the elements of \a textureCoords. Each patch consumes
- two elements from \a textureCoords, defining the opposite
- corners.
-
- If \a textureCoords is empty, then each patch will generate
- texture co-ordinates in the range (0, 0) to (1, 1).
-
- \sa textureCoords(), setPositions()
-*/
-void QGLBezierPatches::setTextureCoords(const QVector2DArray &textureCoords)
-{
- Q_D(QGLBezierPatches);
- d->textureCoords = textureCoords;
-}
-
-/*!
- Returns the depth of subdivision to use when converting the
- Bezier geometry into triangles. The default value is 4.
-
- \sa setSubdivisionDepth()
-*/
-int QGLBezierPatches::subdivisionDepth() const
-{
- Q_D(const QGLBezierPatches);
- return d->subdivisionDepth;
-}
-
-/*!
- Sets the depth of subdivision to use when converting the
- Bezier geometry into triangles to \a value.
-
- \sa subdivisionDepth()
-*/
-void QGLBezierPatches::setSubdivisionDepth(int value)
-{
- Q_D(QGLBezierPatches);
- d->subdivisionDepth = value;
-}
-
-/*!
- Transforms the positions() in this Bezier geometry object
- according to \a matrix.
-
- \sa transformed()
-*/
-void QGLBezierPatches::transform(const QMatrix4x4 &matrix)
-{
- Q_D(QGLBezierPatches);
- d->positions.transform(matrix);
-}
-
-/*!
- Returns a new Bezier geometry object that results from transforming
- this object's positions() according to \a matrix.
-
- \sa transform()
-*/
-QGLBezierPatches QGLBezierPatches::transformed(const QMatrix4x4 &matrix) const
-{
- QGLBezierPatches result(*this);
- result.d_ptr->positions.transform(matrix);
- return result;
-}
-
-/*!
- Returns true if \a ray intersects this Bezier geometry object;
- false otherwise.
-
- \sa intersection()
-*/
-bool QGLBezierPatches::intersects(const QRay3D &ray) const
-{
- Q_D(const QGLBezierPatches);
- return !qIsNaN(d->intersection(ray, true, 0, 0));
-}
-
-/*!
- Returns the t value at which \a ray intersects this Bezier
- geometry object, or not-a-number if there is no intersection.
-
- When the \a ray intersects this object, the return value is a
- parametric value that can be passed to QRay3D::point() to determine
- the actual intersection point, as shown in the following example:
-
- \code
- qreal t = patches.intersection(ray);
- QVector3D pt;
- if (qIsNaN(t)) {
- qWarning("no intersection occurred");
- else
- pt = ray.point(t);
- \endcode
-
- If \a ray intersects the object multiple times, the returned
- t will be the smallest t value, corresponding to the first
- intersection of the \a ray with the object. The t value may
- be negative if the first intersection occurs in the reverse
- direction of \a ray.
-
- The intersection is determined by subdividing the patches into
- triangles and intersecting with those triangles. A pruning
- algorithm is used to discard patches whose convex hull do not
- intersect with \a ray.
-
- If \a texCoord is not null, then it will return the texture
- co-ordinate of the intersection point.
-
- If \a patch is not null, then it will return the index of the
- patch that contains the intersection, or -1 if there is no
- intersection.
-
- \sa intersects()
-*/
-qreal QGLBezierPatches::intersection(const QRay3D &ray, QVector2D *texCoord, int *patch) const
-{
- Q_D(const QGLBezierPatches);
- return d->intersection(ray, false, texCoord, patch);
-}
-
-/*!
- \relates QGLBezierPatches
-
- Subdivides the Bezier patch data in \a patches into triangles
- and adds them to the specified display \a list.
-*/
-QGLBuilder &operator<<(QGLBuilder &list, const QGLBezierPatches &patches)
-{
- patches.d_ptr->subdivide(&list);
- return list;
-}
-
-QT_END_NAMESPACE
diff --git a/src/threed/geometry/qglbezierpatches.h b/src/threed/geometry/qglbezierpatches.h
deleted file mode 100644
index 4a4d042c..00000000
--- a/src/threed/geometry/qglbezierpatches.h
+++ /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 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 QGLBEZIERPATCHES_H
-#define QGLBEZIERPATCHES_H
-
-#include "qvector2darray.h"
-#include "qvector3darray.h"
-#include <QtCore/qscopedpointer.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class QGLBezierPatchesPrivate;
-class QGLBuilder;
-class QRay3D;
-
-class Q_QT3D_EXPORT QGLBezierPatches
-{
-public:
- QGLBezierPatches();
- QGLBezierPatches(const QGLBezierPatches &other);
- virtual ~QGLBezierPatches();
-
- QGLBezierPatches &operator=(const QGLBezierPatches &other);
-
- QVector3DArray positions() const;
- void setPositions(const QVector3DArray &positions);
-
- QVector2DArray textureCoords() const;
- void setTextureCoords(const QVector2DArray &textureCoords);
-
- int subdivisionDepth() const;
- void setSubdivisionDepth(int value);
-
- void transform(const QMatrix4x4 &matrix);
- QGLBezierPatches transformed(const QMatrix4x4 &matrix) const;
-
- bool intersects(const QRay3D &ray) const;
- qreal intersection(const QRay3D &ray, QVector2D *texCoord = 0, int *patch = 0) const;
-
-private:
- QScopedPointer<QGLBezierPatchesPrivate> d_ptr;
-
- Q_DECLARE_PRIVATE(QGLBezierPatches)
-
- friend Q_QT3D_EXPORT QGLBuilder &operator<<(QGLBuilder &list, const QGLBezierPatches &patches);
-};
-
-Q_QT3D_EXPORT QGLBuilder &operator<<(QGLBuilder &list, const QGLBezierPatches &patches);
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/geometry/qglbuilder.cpp b/src/threed/geometry/qglbuilder.cpp
deleted file mode 100644
index 1a73d9ca..00000000
--- a/src/threed/geometry/qglbuilder.cpp
+++ /dev/null
@@ -1,1382 +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 "qglbuilder.h"
-#include "qglbuilder_p.h"
-#include "qglsection_p.h"
-#include "qglmaterialcollection.h"
-#include "qglpainter.h"
-#include "qgeometrydata.h"
-#include "qvector_utils_p.h"
-
-#include <QtGui/qvector2d.h>
-
-#include <QtCore/qdebug.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGLBuilder
- \brief The QGLBuilder class constructs geometry for efficient display.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::geometry
-
- \tableofcontents
-
- Use a QGLBuilder to build up vertex, index, texture and other data
- during application initialization. The finalizedSceneNode() function
- returns an optimized scene which can be efficiently and flexibly
- displayed during frames of rendering. It is suited to writing loaders
- for 3D models, and for programatically creating geometry.
-
- \section1 Geometry Building
-
- QGLBuilder makes the job of getting triangles on the GPU simple. It
- calculates indices and normals for you, then uploads the data. While
- it has addQuads() and other functions to deal with quads, all data is
- represented as triangles for portability.
-
- The simplest way to use QGLBuilder is to send a set of geometry
- values to it using QGeometryData in the constructor:
-
- \code
- MyView::MyView() : QGLView()
- {
- // in the constructor construct a builder on the stack
- QGLBuilder builder;
- QGeometryData triangle;
- QVector3D a(2, 2, 0);
- QVector3D b(-2, 2, 0);
- QVector3D c(0, -2, 0);
- triangle.appendVertex(a, b, c);
-
- // When adding geometry, QGLBuilder automatically creates lighting normals
- builder << triangle;
-
- // obtain the scene from the builder
- m_scene = builder.finalizedSceneNode();
-
- // apply effects at app initialization time
- QGLMaterial *mat = new QGLMaterial;
- mat->setDiffuseColor(Qt::red);
- m_scene->setMaterial(mat);
- }
- \endcode
-
- Then during rendering the scene is used to display the results:
- \code
- MyView::paintGL(QGLPainter *painter)
- {
- m_scene->draw(painter);
- }
- \endcode
-
- QGLBuilder automatically generates index values and normals
- on-the-fly during geometry building. During building, simply send
- primitives to the builder as a sequence of vertices, and
- vertices that are the same will be referenced by a single index
- automatically.
-
- Primitives will have standard normals generated automatically
- based on vertex winding.
-
- Consider the following code for OpenGL to draw a quad with corner
- points A, B, C and D :
-
- \code
- float vertices[12] =
- {
- -1.0, -1.0, -1.0, // A
- 1.0, -1.0, -1.0, // B
- 1.0, 1.0, 1.0, // C
- -1.0, 1.0, 1.0 // D
- };
- float normals[12] = { 0.0f };
- for (int i = 0; i < 12; i += 3)
- {
- normals[i] = 0.0;
- normals[i+1] = -sqrt(2.0);
- normals[i+2] = sqrt(2.0);
- }
- GLuint indices[6] = {
- 0, 1, 2, // triangle A-B-C
- 0, 2, 3 // triangle A-C-D
- };
- glEnableClientState(GL_VERTEX_ARRAY);
- glEnableClientState(GL_NORMAL_ARRAY);
- glVertexPointer(3, GL_FLOAT, 0, vertices);
- glNormalPointer(3, GL_FLOAT, 0, normals);
- glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_INT, indices);
- \endcode
-
- With QGLBuilder this code becomes:
-
- \code
- float vertices[12] =
- {
- -1.0, -1.0, -1.0, // A
- 1.0, -1.0, -1.0, // B
- 1.0, 1.0, 1.0, // C
- -1.0, 1.0, 1.0 // D
- };
- QGLBuilder quad;
- QGeometryData data;
- data.appendVertexArray(QArray<QVector3D>::fromRawData(
- reinterpret_cast<const QVector3D*>(vertices), 4));
- quad.addQuads(data);
- \endcode
-
- The data primitive is added to the list, as two triangles, indexed to
- removed the redundant double storage of B & C - just the same as the
- OpenGL code.
-
- QGLBuilder will also calculate a normal for the quad and apply it
- to the vertices.
-
- In this trivial example the indices are easily calculated, however
- in more complex geometry it is easy to introduce bugs by trying
- to manually control indices. Extra work is required to generate,
- track and store the index values correctly.
-
- Bugs such as trying to index two vertices with different data -
- one with texture data and one without - into one triangle can
- easily result. The picture becomes more difficult when smoothing
- groups are introduced - see below.
-
- Using indices is always preferred since it saves space on the GPU,
- and makes the geometry perform faster during application run time.
-
- \section2 Removing Epsilon Errors
-
- Where vertices are generated by modelling packages or tools, or
- during computation in code, very frequently rounding errors will
- result in several vertices being generated that are actually
- the same vertex but are separated by tiny amounts. At best these
- duplications waste space on the GPU but at worst can introduce
- visual artifacts that mar the image displayed.
-
- Closing paths, generating solids of rotation, or moving model
- sections out and back can all introduce these types of epsilon
- errors, resulting in "cracks" or artifacts on display.
-
- QGLBuilder's index generation process uses a fuzzy match that
- coalesces all vertex values at a point - even if they are out by
- a tiny amount - and references them with a single index.
-
- \section2 Lighting Normals and Null Triangles
-
- QGLBuilder functions calculate lighting normals, when building
- geometry. This saves the application programmer from having to write
- code to calculate them. Normals for each triangle (a, b, c) are
- calculated as the QVector3D::normal(a, b, c).
-
- If lighting normals are explicitly supplied when using QGLBuilder,
- then this calculation is not done. This may save on build time.
-
- As an optimization, QGLBuilder skips null triangles, that is ones
- with zero area, where it can. Such triangles generate no fragments on
- the GPU, and thus do not display but nonetheless can take up space
- and processing power.
-
- Null triangles can easily occur when calculating vertices results
- in two vertices coinciding, or three vertices lying on the same line.
-
- This skipping is done using the lighting normals cross-product. If the
- cross-product is a null vector then the triangle is null.
-
- When lighting normals are specified explicitly the skipping
- optimization is suppressed, so if for some reason null triangles are
- required to be retained, then specify normals for each logical vertex.
-
- See the documentation below of the individual addTriangle() and other
- functions for more details.
-
- \section2 Raw Triangle Mode
-
- Where generation of indices and normals is not needed - for example if
- porting an existing application, it is possible to do a raw import of
- triangle data, without using any of QGLBuilder's processing.
-
- To do this ensure that indices are placed in the QGeometryData passed to
- the addTriangles() function, and this will trigger \bold{raw triangle} mode.
-
- When adding triangles in this way ensure that all appropriate values
- have been correctly set, and that the normals, indices and other data
- are correctly calculated, since no checking is done.
-
- When writing new applications, simply leave construction of normals and
- indices to the QGLBuilder
-
- \section1 Rendering and QGLSceneNode items.
-
- QGLSceneNodes are used to manage application of local transformations,
- materials and effects.
-
- QGLBuilder generates a root level QGLSceneNode, which can be accessed
- with the sceneNode() function. Under this a new node is created for
- each section of geometry, and also by using pushNode() and popNode().
-
- To organize geometry for painting with different materials and effects
- call the newNode() function:
-
- \code
- QGLSceneNode *box = builder.newNode();
- box->setMaterial(wood);
- \endcode
-
- Many nodes may be created this way, but they will be optimized into
- a small number of buffers under the one scene when the
- finalizedSceneNode() function is called.
-
- \image soup.png
-
- Here the front can is a set of built geometry and the other two are
- scene nodes that reference it, without copying any geometry.
-
- \snippet qt3d/builder/builder.cpp 0
-
- QGLSceneNodes can be used after the builder is created to cheaply
- copy and redisplay the whole scene. Or to reference parts of the geometry
- use the functions newNode() or pushNode() and popNode() to manage
- QGLSceneNode generation while building geometry.
-
- To draw the resulting built geometry simply call the draw method of the
- build geometry.
-
- \snippet qt3d/builder/builder.cpp 1
-
- Call the \l{QGLSceneNode::palette()}{palette()} function on the sceneNode()
- to get the QGLMaterialCollection for the node, and place textures
- and materials into it.
-
- Built geometry will typically share the one palette. Either create a
- palette, and pass it to the \l{QGLBuilder::QGLBuilder()}{constructor};
- or pass no arguments to the constructor and the QGLBuilder
- will create a palette:
-
- \snippet qt3d/builder/builder.cpp 2
-
- These may then be applied as needed throughout the building of the
- geometry using the integer reference, \c{canMat} in the above code.
-
- See the QGLSceneNode documentation for more.
-
- \section1 Using Sections
-
- During initialization of the QGLBuilder, while accumulating
- geometry, the geometry data in a QGLBuilder is placed into
- sections - there must be at least one section.
-
- Call the newSection() function to create a new section:
-
- \snippet qt3d/builder/builder.cpp 3
-
- Here separate sections for the rounded outside cylinder and flat top and
- bottom of the soup can model makes for the appearance of a sharp edge
- between them. If the sides and top and bottom were in the same section
- QGLBuilder would attempt to average the normals around the edge resulting
- in an unrealistic effect.
-
- In 3D applications this concept is referred to as
- \l{http://www.google.com/search?smoothing+groups}{smoothing groups}. Within
- a section (smoothing group) all normals are averaged making it appear
- as one smoothly shaded surface.
-
- The can has 3 smoothing groups - bottom, top and sides.
-
- This mesh of a Q is a faceted model - it has 0 smoothing groups:
-
- \image faceted-q.png
-
- To create geometry with a faceted appearance call newSection() with
- an argument of QGL::Faceted thus \c{newSection(QGL::Faceted)}.
-
- Faceted geometry is suitable for small models, where hard edges are
- desired between every face - a dice, gem or geometric solid for example.
-
- If no section has been created when geometry is added a new section is
- created automatically. This section will have its smoothing set
- to QGL::Smooth.
-
- To create a faceted appearance rather than accepting the automatically
- created section the << operator can also be used:
-
- \code
- QGLBuilder builder;
- QGeometryData triangles;
- triangles.appendVertices(a, b, c);
- builder << QGL::Faceted << triangles;
- \endcode
-
- \section2 Geometry Data in a Section
-
- Management of normals and vertices for smoothing, and other data is
- handled automatically by the QGLBuilder instance.
-
- Within a section, incoming geometry data will be coalesced and
- indices created to reference the fewest possible copies of the vertex
- data. For example, in smooth geometry all copies of a vertex are
- coalesced into one, and referenced by indices.
-
- One of the few exceptions to this is the case where texture data forms
- a \i seam and a copy of a vertex must be created to carry the two
- texture coordinates either side of the seam.
-
- \image texture-seam.png
-
- Coalescing has the effect of packing geometry data into the
- smallest space possible thus improving cache coherence and performance.
-
- Again all this is managed automatically by QGLBuilder and all
- that is required is to create smooth or faceted sections, and add
- geometry to them.
-
- Each QGLSection references a contiguous range of vertices in a
- QGLBuilder.
-
- \section1 Finalizing and Retrieving the Scene
-
- Once the geometry has been accumulated in the QGLBuilder instance, the
- finalizedSceneNode() method must be called to retrieve the optimized
- scene. This function serves to normalize the geometry and optimize
- it for display.
-
- While it may be convenient to get pointers to sub nodes in the scene
- during construction, it is important to retrieve the root of the scene
- so that the memory consumed by the scene can be recovered. The builder
- will create a QGLMaterialCollection; and there may be geometry, materials
- and other resources: these are all parented onto the root scene node.
- These can easily be recovered by deleting the root scene node:
-
- \code
- MyView::MyView() : QGLView()
- {
- // in the constructor construct a builder on the stack
- QGLBuilder builder;
-
- // add geometry as shown above
- builder << triangles;
-
- // obtain the scene from the builder & take ownership
- m_scene = builder.finalizedSceneNode();
- }
-
- MyView::~MyView()
- {
- // recover all scene resources
- delete m_scene;
- }
- \endcode
-
- Alternatively set the scene's parent to ensure resource recovery
- \c{m_scene->setParent(this)}.
-
-
-*/
-
-QGLBuilderPrivate::QGLBuilderPrivate(QGLBuilder *parent)
- : currentSection(0)
- , currentNode(0)
- , rootNode(0)
- , defThreshold(5)
- , q(parent)
-{
-}
-
-QGLBuilderPrivate::~QGLBuilderPrivate()
-{
- qDeleteAll(sections);
- if (rootNode)
- {
- qWarning("Destroying QGLBuilder but finalizedSceneNode() not called");
- delete rootNode;
- }
-}
-
-/*!
- Construct a new QGLBuilder using \a materials for the palette. If the
- \a materials argument is null, then a new palette is created.
-*/
-QGLBuilder::QGLBuilder(QGLMaterialCollection *materials)
- : dptr(new QGLBuilderPrivate(this))
-{
- dptr->rootNode = new QGLSceneNode;
- if (!materials)
- materials = new QGLMaterialCollection(dptr->rootNode);
- dptr->rootNode->setPalette(materials);
-}
-
-/*!
- Destroys this QGLBuilder recovering any resources.
-*/
-QGLBuilder::~QGLBuilder()
-{
- delete dptr;
-}
-
-/*!
- Helper function to calculate the normal for and set it on vertices
- in \a i, \a j and \a k in triangle data \a p. If the triangle in
- data \a p is a null triangle (area == 0) then the function returns
- false, otherwise it returns true.
-*/
-static inline void setNormals(int i, int j, int k, QGeometryData &p, const QVector3D &n)
-{
- p.normal(i) = n;
- p.normal(j) = n;
- p.normal(k) = n;
-}
-
-static bool qCalculateNormal(int i, int j, int k, QGeometryData &p, QVector3D *vec = 0)
-{
- QVector3D norm;
- QVector3D *n = &norm;
- if (vec)
- n = vec;
- bool nullTriangle = false;
- *n = QVector3D::crossProduct(p.vertexAt(j) - p.vertexAt(i),
- p.vertexAt(k) - p.vertexAt(j));
- if (qFskIsNull(n->x()))
- n->setX(0.0f);
- if (qFskIsNull(n->y()))
- n->setY(0.0f);
- if (qFskIsNull(n->z()))
- n->setZ(0.0f);
- if (n->isNull())
- {
- nullTriangle = true;
- }
- else
- {
- setNormals(i, j, k, p, *n);
- }
- return nullTriangle;
-}
-
-/*!
- \internal
- Helper function to actually add the vertices to geometry.
-*/
-void QGLBuilderPrivate::addTriangle(int i, int j, int k,
- const QGeometryData &p, int &count)
-{
- if (currentSection == 0)
- q->newSection();
- QLogicalVertex a(p, i);
- QLogicalVertex b(p, j);
- QLogicalVertex c(p, k);
- currentSection->append(a, b, c);
- count += 3;
-}
-
-/*!
- Add \a triangles - a series of one or more triangles - to this builder.
-
- The data is broken into groups of 3 vertices, each processed as a triangle.
-
- If \a triangles has less than 3 vertices this function exits without
- doing anything. Any vertices at the end of the list under a multiple
- of 3 are ignored.
-
- If no normals are supplied in \a triangles, a normal is calculated; as
- the cross-product \c{(b - a) x (c - a)}, for each group of 3
- logical vertices \c{a(triangle, i), b(triangle, i+1), c(triangle, i+2)}.
-
- In the case of a degenerate triangle, where the cross-product is null,
- that triangle is skipped. Supplying normals suppresses this behaviour
- (and means any degenerate triangles will be added to the geometry).
-
- \bold{Raw Triangle Mode}
-
- If \a triangles has indices specified then no processing of any kind is
- done and all the geometry is simply dumped in to the builder.
-
- This \bold{raw triangle} mode is for advanced use, and it is assumed that
- the user knows what they are doing, in particular that the indices
- supplied are correct, and normals are supplied and correct.
-
- Normals are not calculated in raw triangle mode, and skipping of null
- triangles is likewise not performed. See the section on
- \l{raw-triangle-mode}{raw triangle mode}
- in the class documentation above.
-
- \sa addQuads(), operator>>()
-*/
-void QGLBuilder::addTriangles(const QGeometryData &triangles)
-{
- if (triangles.count() < 3)
- return;
- if (triangles.indexCount() > 0)
- {
- // raw triangle mode
- if (dptr->currentSection == 0)
- newSection();
- dptr->currentSection->appendGeometry(triangles);
- dptr->currentSection->appendIndices(triangles.indices());
- dptr->currentNode->setCount(dptr->currentNode->count() + triangles.indexCount());
- }
- else
- {
- QGeometryData t = triangles;
- bool calcNormal = !t.hasField(QGL::Normal);
- if (calcNormal)
- {
- QVector3DArray nm(t.count());
- t.appendNormalArray(nm);
- }
- bool skip = false;
- int k = 0;
- for (int i = 0; i < t.count() - 2; i += 3)
- {
- if (calcNormal)
- skip = qCalculateNormal(i, i+1, i+2, t);
- if (!skip)
- dptr->addTriangle(i, i+1, i+2, t, k);
- }
- dptr->currentNode->setCount(dptr->currentNode->count() + k);
- }
-}
-
-/*!
- Add \a quads - a series of one or more quads - to this builder.
-
- If \a quads has less than four vertices this function exits without
- doing anything.
-
- One normal per quad is calculated if \a quads does not have normals.
- For this reason quads should have all four vertices in the same plane.
- If the vertices do not lie in the same plane, use addTriangleStrip()
- to add two adjacent triangles instead.
-
- Since internally \l{geometry-building}{quads are stored as two triangles},
- each quad is actually divided in half into two triangles.
-
- Degenerate triangles are skipped in the same way as addTriangles().
-
- \sa addTriangles(), addTriangleStrip()
-*/
-void QGLBuilder::addQuads(const QGeometryData &quads)
-{
- if (quads.count() < 4)
- return;
- QGeometryData q = quads;
- bool calcNormal = !q.hasField(QGL::Normal);
- if (calcNormal)
- {
- QVector3DArray nm(q.count());
- q.appendNormalArray(nm);
- }
- bool skip = false;
- int k = 0;
- QVector3D norm;
- for (int i = 0; i < q.count(); i += 4)
- {
- if (calcNormal)
- skip = qCalculateNormal(i, i+1, i+2, q, &norm);
- if (!skip)
- dptr->addTriangle(i, i+1, i+2, q, k);
- if (skip)
- skip = qCalculateNormal(i, i+2, i+3, q, &norm);
- if (!skip)
- {
- if (calcNormal)
- setNormals(i, i+2, i+3, q, norm);
- dptr->addTriangle(i, i+2, i+3, q, k);
- }
- }
- dptr->currentNode->setCount(dptr->currentNode->count() + k);
-}
-
-/*!
- Adds to this section a set of connected triangles defined by \a fan.
-
- N triangular faces are generated, where \c{N == fan.count() - 2}. Each
- face contains the 0th vertex in \a fan, followed by the i'th and i+1'th
- vertex - where i takes on the values from 1 to \c{fan.count() - 1}.
-
- If \a fan has less than three vertices this function exits without
- doing anything.
-
- This function is similar to the OpenGL mode GL_TRIANGLE_FAN. It
- generates a number of triangles all sharing one common vertex, which
- is the 0'th vertex of the \a fan.
-
- Normals are calculated as for addTriangle(), given the above ordering.
- There is no requirement or assumption that all triangles lie in the
- same plane. Degenerate triangles are skipped in the same way as
- addTriangles().
-
- \sa addTriangulatedFace()
-*/
-void QGLBuilder::addTriangleFan(const QGeometryData &fan)
-{
- if (fan.count() < 3)
- return;
- QGeometryData f = fan;
- bool calcNormal = !f.hasField(QGL::Normal);
- if (calcNormal)
- {
- QVector3DArray nm(f.count());
- f.appendNormalArray(nm);
- }
- int k = 0;
- bool skip = false;
- for (int i = 1; i < f.count() - 1; ++i)
- {
- if (calcNormal)
- skip = qCalculateNormal(0, i, i+1, f);
- if (!skip)
- dptr->addTriangle(0, i, i+1, f, k);
- }
- dptr->currentNode->setCount(dptr->currentNode->count() + k);
-}
-
-/*!
- Adds to this section a set of connected triangles defined by \a strip.
-
- N triangular faces are generated, where \c{N == strip.count() - 2}.
- The triangles are generated from vertices 0, 1, & 2, then 2, 1 & 3,
- then 2, 3 & 4, and so on. In other words every second triangle has
- the first and second vertices switched, as a new triangle is generated
- from each successive set of three vertices.
-
- If \a strip has less than three vertices this function exits without
- doing anything.
-
- Normals are calculated as for addTriangle(), given the above ordering.
-
- This function is very similar to the OpenGL mode GL_TRIANGLE_STRIP. It
- generates triangles along a strip whose two sides are the even and odd
- vertices.
-
- \sa addTriangulatedFace()
-*/
-void QGLBuilder::addTriangleStrip(const QGeometryData &strip)
-{
- if (strip.count() < 3)
- return;
- QGeometryData s = strip;
- bool calcNormal = !s.hasField(QGL::Normal);
- if (calcNormal)
- {
- QVector3DArray nm(s.count());
- s.appendNormalArray(nm);
- }
- bool skip = false;
- int k = 0;
- for (int i = 0; i < s.count() - 2; ++i)
- {
- if (i % 2)
- {
- if (calcNormal)
- skip = qCalculateNormal(i+1, i, i+2, s);
- if (!skip)
- dptr->addTriangle(i+1, i, i+2, s, k);
- }
- else
- {
- if (calcNormal)
- skip = qCalculateNormal(i, i+1, i+2, s);
- if (!skip)
- dptr->addTriangle(i, i+1, i+2, s, k);
- }
- }
- dptr->currentNode->setCount(dptr->currentNode->count() + k);
-}
-
-/*!
- Adds to this section a set of quads defined by \a strip.
-
- If \a strip has less than four vertices this function exits without
- doing anything.
-
- The first quad is formed from the 0'th, 2'nd, 3'rd and 1'st vertices.
- The second quad is formed from the 2'nd, 4'th, 5'th and 3'rd vertices,
- and so on, as shown in this diagram:
-
- \image quads.png
-
- One normal per quad is calculated if \a strip does not have normals.
- For this reason quads should have all four vertices in the same plane.
- If the vertices do not lie in the same plane, use addTriangles() instead.
-
- Since internally \l{geometry-building}{quads are stored as two triangles},
- each quad is actually divided in half into two triangles.
-
- Degenerate triangles are skipped in the same way as addTriangles().
-
- \sa addQuads(), addTriangleStrip()
-*/
-void QGLBuilder::addQuadStrip(const QGeometryData &strip)
-{
- if (strip.count() < 4)
- return;
- QGeometryData s = strip;
- bool calcNormal = !s.hasField(QGL::Normal);
- if (calcNormal)
- {
- QVector3DArray nm(s.count());
- s.appendNormalArray(nm);
- }
- bool skip = false;
- QVector3D norm;
- int k = 0;
- for (int i = 0; i < s.count() - 3; i += 2)
- {
- if (calcNormal)
- skip = qCalculateNormal(i, i+2, i+3, s, &norm);
- if (!skip)
- dptr->addTriangle(i, i+2, i+3, s, k);
- if (skip)
- skip = qCalculateNormal(i, i+3, i+1, s, &norm);
- if (!skip)
- {
- if (calcNormal)
- setNormals(i, i+3, i+1, s, norm);
- dptr->addTriangle(i, i+3, i+1, s, k);
- }
- }
- dptr->currentNode->setCount(dptr->currentNode->count() + k);
-}
-
-/*!
- Adds to this section a polygonal face made of triangular sub-faces,
- defined by \a face. The 0'th vertex is used for the center, while
- the subsequent vertices form the perimeter of the face, which must
- at minimum be a triangle.
-
- If \a face has less than four vertices this function exits without
- doing anything.
-
- This function provides functionality similar to the OpenGL mode GL_POLYGON,
- except it divides the face into sub-faces around a \bold{central point}.
- The center and perimeter vertices must lie in the same plane (unlike
- triangle fan). If they do not normals will be incorrectly calculated.
-
- \image triangulated-face.png
-
- Here the sub-faces are shown divided by green lines. Note how this
- function handles some re-entrant (non-convex) polygons, whereas
- addTriangleFan will not support such polygons.
-
- If required, the center point can be calculated using the center() function
- of QGeometryData:
-
- \code
- QGeometryData face;
- face.appendVertex(perimeter.center()); // perimeter is a QGeometryData
- face.appendVertices(perimeter);
- builder.addTriangulatedFace(face);
- \endcode
-
- N sub-faces are generated where \c{N == face.count() - 2}.
-
- Each triangular sub-face consists of the center; followed by the \c{i'th}
- and \c{((i + 1) % N)'th} vertex. The last face generated then is
- \c{(center, face[N - 1], face[0]}, the closing face. Note that the closing
- face is automatically created, unlike addTriangleFan().
-
- If no normals are supplied in the vertices of \a face, normals are
- calculated as per addTriangle(). One normal is calculated, since a
- faces vertices lie in the same plane.
-
- Degenerate triangles are skipped in the same way as addTriangles().
-
- \sa addTriangleFan(), addTriangles()
-*/
-void QGLBuilder::addTriangulatedFace(const QGeometryData &face)
-{
- if (face.count() < 4)
- return;
- QGeometryData f;
- f.appendGeometry(face);
- int cnt = f.count();
- bool calcNormal = !f.hasField(QGL::Normal);
- if (calcNormal)
- {
- QVector3DArray nm(cnt);
- f.appendNormalArray(nm);
- }
- bool skip = false;
- QVector3D norm;
- int k = 0;
- for (int i = 1; i < cnt; ++i)
- {
- int n = i + 1;
- if (n == cnt)
- n = 1;
- if (calcNormal)
- {
- skip = qCalculateNormal(0, i, n, f);
- if (norm.isNull() && !skip)
- {
- norm = f.normalAt(0);
- for (int i = 0; i < cnt; ++i)
- f.normal(i) = norm;
- }
- }
- if (!skip)
- dptr->addTriangle(0, i, n, f, k);
- }
- dptr->currentNode->setCount(dptr->currentNode->count() + k);
-}
-
-/*!
- Add a series of quads by 'interleaving' \a top and \a bottom.
-
- This function behaves like quadStrip(), where the odd-numbered vertices in
- the input primitive are from \a top and the even-numbered vertices from
- \a bottom.
-
- It is trivial to do extrusions using this function:
-
- \code
- // create a series of quads for an extruded edge along -Y
- addQuadsInterleaved(topEdge, topEdge.translated(QVector3D(0, -1, 0));
- \endcode
-
- N quad faces are generated where \c{N == min(top.count(), bottom.count() - 1}.
- If \a top or \a bottom has less than 2 elements, this functions does
- nothing.
-
- Each face is formed by the \c{i'th} and \c{(i + 1)'th}
- vertices of \a bottom, followed by the \c{(i + 1)'th} and \c{i'th}
- vertices of \a top.
-
- If the vertices in \a top and \a bottom are the perimeter vertices of
- two polygons then this function can be used to generate quads which form
- the sides of a \l{http://en.wikipedia.org/wiki/Prism_(geometry)}{prism}
- with the polygons as the prisms top and bottom end-faces.
-
- \image quad-extrude.png
-
- In the diagram above, the \a top is shown in orange, and the \a bottom in
- dark yellow. The first generated quad, (a, b, c, d) is generated in
- the order shown by the blue arrow.
-
- To create such a extruded prismatic solid, complete with top and bottom cap
- polygons, given just the top edge do this:
- \code
- QGeometryData top = buildTopEdge();
- QGeometryData bottom = top.translated(QVector3D(0, 0, -1));
- builder.addQuadsInterleaved(top, bottom);
- builder.addTriangulatedFace(top);
- builder.addTriangulatedFace(bottom.reversed());
- \endcode
- The \a bottom QGeometryData must be \bold{reversed} so that the correct
- winding for an outward facing polygon is obtained.
-*/
-void QGLBuilder::addQuadsInterleaved(const QGeometryData &top,
- const QGeometryData &bottom)
-{
- if (top.count() < 2 || bottom.count() < 2)
- return;
- QGeometryData zipped = bottom.interleavedWith(top);
- bool calcNormal = !zipped.hasField(QGL::Normal);
- if (calcNormal)
- {
- QVector3DArray nm(zipped.count());
- zipped.appendNormalArray(nm);
- }
- bool skip = false;
- QVector3D norm;
- int k = 0;
- for (int i = 0; i < zipped.count() - 2; i += 2)
- {
- if (calcNormal)
- skip = qCalculateNormal(i, i+2, i+3, zipped, &norm);
- if (!skip)
- dptr->addTriangle(i, i+2, i+3, zipped, k);
- if (skip)
- skip = qCalculateNormal(i, i+3, i+1, zipped, &norm);
- if (!skip)
- {
- if (calcNormal)
- setNormals(i, i+3, i+1, zipped, norm);
- dptr->addTriangle(i, i+3, i+1, zipped, k);
- }
- }
- dptr->currentNode->setCount(dptr->currentNode->count() + k);
-}
-
-/*!
- \fn void QGLBuilder::addPane(QSizeF size)
- Convenience function to create a quad centered on the origin,
- lying in the Z=0 plane, with width (x dimension) and height
- (y dimension) specified by \a size.
-*/
-
-/*!
- \fn void QGLBuilder::addPane(qreal size)
- Convenience method to add a single quad of dimensions \a size wide by
- \a size high in the z = 0 plane, centered on the origin. The quad has
- texture coordinates of (0, 0) at the bottom left and (1, 1) at the top
- right. The default value for \a size is 1.0, resulting in a quad
- from QVector3D(-0.5, -0.5, 0.0) to QVector3D(0.5, 0.5, 0.0).
-*/
-
-/*!
- \internal
-*/
-void QGLBuilderPrivate::adjustSectionNodes(QGLSection *sec,
- int offset, const QGeometryData &geom)
-{
- QList<QGLSceneNode*> children = sec->nodes();
- QList<QGLSceneNode*>::iterator it = children.begin();
- QList<QGLSceneNode*> deleted;
- for ( ; it != children.end(); ++it)
- adjustNodeTree(*it, offset, geom, deleted);
-}
-
-/*!
- \internal
- Adjust \a top by incrementing its start by \a offset, and setting its
- geometry to \a geom. Find the cumulative total of indexes -
- QGLSceneNode::count() - for \a top and all its children. If this total is
- equal to zero, then delete that node.
-*/
-int QGLBuilderPrivate::adjustNodeTree(QGLSceneNode *top,
- int offset, const QGeometryData &geom,
- QList<QGLSceneNode*> &deleted)
-{
- int totalItems = 0;
- if (top && !deleted.contains(top))
- {
- top->setStart(top->start() + offset);
- top->setGeometry(geom);
- totalItems = top->count();
- QList<QGLSceneNode*> children = top->children();
- QList<QGLSceneNode*>::iterator it = children.begin();
- for ( ; it != children.end(); ++it)
- {
- totalItems += adjustNodeTree(*it, offset, geom, deleted);
- }
- if (totalItems == 0 && top->objectName().isEmpty())
- {
- delete top;
- deleted.append(top);
- }
- }
- return totalItems;
-}
-
-/*!
- \internal
- Returns a count of all the items referenced by this node
- and all its children.
-*/
-static int recursiveCount(QGLSceneNode *top)
-{
- int totalItems = 0;
- if (top)
- {
- totalItems = top->count();
- QList<QGLSceneNode*> children = top->children();
- QList<QGLSceneNode*>::const_iterator it = children.constBegin();
- for ( ; it != children.constEnd(); ++it)
- totalItems += recursiveCount(*it);
- }
- return totalItems;
-}
-
-static int nodeCount(const QList<QGLSceneNode*> &list)
-{
- int total = 0;
- QList<QGLSceneNode*>::const_iterator it = list.constBegin();
- for ( ; it != list.constEnd(); ++it)
- total += recursiveCount(*it);
- return total;
-}
-
-static inline void warnIgnore(int secCount, QGLSection *s, int vertCount, int nodeCount,
- const char *msg)
-{
- qWarning("Ignoring section %d (%p) with %d vertices and"
- " %d indexes - %s", secCount, s, vertCount, nodeCount, msg);
-}
-
-/*!
- Finish the building of this geometry, optimize it for rendering, and return a
- pointer to the detached top-level scene node (root node).
-
- Since the scene is detached from the builder object, the builder itself
- may be deleted or go out of scope while the scene lives on:
-
- \code
- void MyView::MyView()
- {
- QGLBuilder builder;
- // construct geometry
- m_thing = builder.finalizedSceneNode();
- }
-
- void MyView::~MyView()
- {
- delete m_thing;
- }
-
- void MyView::paintGL()
- {
- m_thing->draw(painter);
- }
- \endcode
-
- The root node will have a child node for each section that was created
- during geometry building.
-
- This method must be called exactly once after building the scene.
-
- \bold{Calling code takes ownership of the scene.} In particular take care
- to either explicitly destroy the scene when it is no longer needed - as shown
- above.
-
- For more complex applications parent each finalized scene node onto a QObject
- so it will be implictly cleaned up by Qt. If you use QGLSceneNode::setParent()
- to do this, you can save an explicit call to addNode() since if setParent()
- detects that the new parent is a QGLSceneNode it will call addNode() for you:
-
- \code
- // here a top level node for the app is created, and parented to the view
- QGLSceneNode *topNode = new QGLSceneNode(this);
-
- QGLBuilder b1;
- // build geometry
-
- QGLSceneNode *thing = b1.finalizedSceneNode();
-
- // does a QObject::setParent() to manage memory, and also adds to the scene
- // graph, so no need to call topNode->addNode(thing)
- thing->setParent(topNode);
-
- QGLBuilder b2;
- // build more geometry
- QGLSceneNode *anotherThing = b2.finalizedSceneNode();
-
- // again parent on get addNode for free
- anotherThing->setParent(topNode);
- \endcode
-
- If this builder is destroyed without calling this method to take
- ownership of the scene, a warning will be printed on the console and the
- scene will be deleted. If this method is called more than once, on the
- second and subsequent calls a warning is printed and NULL is returned.
-
- This function does the following:
- \list
- \o packs all geometry data from sections into QGLSceneNode instances
- \o recalculates QGLSceneNode start() and count() for the scene
- \o deletes all QGLBuilder's internal data structures
- \o returns the top level scene node that references the geometry
- \o sets the internal pointer to the top level scene node to NULL
- \endlist
-
- \sa sceneNode()
-*/
-QGLSceneNode *QGLBuilder::finalizedSceneNode()
-{
- if (dptr->rootNode == 0)
- {
- qWarning("QGLBuilder::finalizedSceneNode() called twice");
- return 0;
- }
- QGeometryData g;
- QMap<quint32, QGeometryData> geos;
- QMap<QGLSection*, int> offsets;
- for (int i = 0; i < dptr->sections.count(); ++i)
- {
- // pack sections that have the same fields into one geometry
- QGLSection *s = dptr->sections.at(i);
- QGL::IndexArray indices = s->indices();
- int icnt = indices.size();
- int ncnt = nodeCount(s->nodes());
- int scnt = s->count();
- if (scnt == 0 || icnt == 0 || ncnt == 0)
- {
- if (!qgetenv("Q_WARN_EMPTY_MESH").isEmpty())
- {
- if (ncnt == 0)
- warnIgnore(scnt, s, icnt, ncnt, "nodes empty");
- else if (scnt == 0)
- warnIgnore(scnt, s, icnt, ncnt, "geometry count zero");
- else
- warnIgnore(scnt, s, icnt, ncnt, "index count zero");
- }
- continue;
- }
- s->normalizeNormals();
- int sectionOffset = 0;
- int sectionIndexOffset = 0;
- if (geos.contains(s->fields()))
- {
- QGeometryData &gd = geos[s->fields()];
- sectionOffset = gd.count();
- sectionIndexOffset = gd.indexCount();
- offsets.insert(s, sectionIndexOffset);
- gd.appendGeometry(*s);
- for (int i = 0; i < icnt; ++i)
- indices[i] += sectionOffset;
- gd.appendIndices(indices);
- }
- else
- {
- g = QGeometryData(*s);
- geos.insert(s->fields(), g);
- }
- }
- while (dptr->sections.count() > 0)
- {
- QGLSection *s = dptr->sections.takeFirst();
- dptr->adjustSectionNodes(s, offsets[s], geos[s->fields()]);
- delete s;
- }
- QGLSceneNode *tmp = dptr->rootNode;
- dptr->rootNode = 0; // indicates root node detached
- return tmp;
-}
-
-/*!
- Creates a new section with smoothing mode set to \a smooth. By default
- \a smooth is QGL::Smooth.
-
- A section must be created before any geometry or new nodes can be added
- to the builder. However one is created automatically by addTriangle()
- and the other add functions; and also by newNode(), pushNode() or popNode()
- if needed.
-
- The internal node stack - see pushNode() and popNode() - is cleared,
- and a new top-level QGLSceneNode is created for this section by calling
- newNode().
-
- \sa newNode(), pushNode()
-*/
-void QGLBuilder::newSection(QGL::Smoothing smooth)
-{
- new QGLSection(this, smooth); // calls addSection
-}
-
-void QGLBuilder::addSection(QGLSection *sec)
-{
- dptr->currentSection = sec;
- sec->setMapThreshold(dptr->defThreshold);
- dptr->sections.append(sec);
- dptr->nodeStack.clear();
- newNode();
-}
-
-/*!
- \internal
- Returns the current section, in which new geometry is being added.
-*/
-QGLSection *QGLBuilder::currentSection() const
-{
- return dptr->currentSection;
-}
-
-/*!
- \internal
- Returns a list of the sections of the geometry in this builder.
-*/
-QList<QGLSection*> QGLBuilder::sections() const
-{
- return dptr->sections;
-}
-
-/*!
- \internal
- Test function only.
-*/
-void QGLBuilder::setDefaultThreshold(int t)
-{
- dptr->defThreshold = t;
-}
-
-/*!
- Returns the root scene node of the geometry created by this builder.
-
- \sa newNode(), newSection()
-*/
-QGLSceneNode *QGLBuilder::sceneNode()
-{
- return dptr->rootNode;
-}
-
-/*!
- Creates a new QGLSceneNode and makes it current. A pointer to the new
- node is returned. The node is added into the scene at the same level
- as the currentNode().
-
- The node is set to reference the geometry starting from the next
- vertex created, such that currentNode()->start() will return the
- index of this next vertex.
-
- \sa newSection()
-*/
-QGLSceneNode *QGLBuilder::newNode()
-{
- if (dptr->currentSection == 0)
- {
- newSection(); // calls newNode()
- return dptr->currentNode;
- }
- QGLSceneNode *parentNode = dptr->rootNode;
- if (dptr->nodeStack.count() > 0)
- parentNode = dptr->nodeStack.last();
- dptr->currentNode = new QGLSceneNode(parentNode);
- dptr->currentNode->setPalette(parentNode->palette());
- dptr->currentNode->setStart(dptr->currentSection->indexCount());
- if (dptr->nodeStack.count() == 0)
- dptr->currentSection->addNode(dptr->currentNode);
- return dptr->currentNode;
-}
-
-/*!
- Returns a pointer to the current scene node, within the current section.
-
- If there is no current section then newSection() will be called to
- create one.
-
- \sa newNode(), newSection()
-*/
-QGLSceneNode *QGLBuilder::currentNode()
-{
- if (dptr->currentSection == 0)
- newSection(); // calls newNode()
- return dptr->currentNode;
-}
-
-/*!
- Creates a new scene node that is a child of the current node and,
- makes it the current node. A pointer to the new node is returned.
- The previous current node is saved on a stack and it may
- be made current again by calling popNode().
-
- \sa popNode(), newNode()
-*/
-QGLSceneNode *QGLBuilder::pushNode()
-{
- if (dptr->currentSection == 0)
- newSection(); // calls newNode()
- QGLSceneNode *parentNode = dptr->currentNode;
- dptr->nodeStack.append(parentNode);
- dptr->currentNode = new QGLSceneNode(parentNode);
- dptr->currentNode->setStart(dptr->currentSection->indexCount());
- dptr->currentNode->setPalette(parentNode->palette());
- return dptr->currentNode;
-}
-
-/*!
- Removes the node from the top of the stack, makes a copy of it, and
- makes the copy current.
-
- If the stack is empty, behaviour is undefined. In debug mode, calling
- this function when the stack is empty will cause an assert.
-
- A pointer to the new current node is returned.
-
- The node is set to reference the geometry starting from the next
- vertex created, such that QGLSceneNode::start() will return the
- index of this next vertex.
-
- \sa pushNode(), newNode()
-*/
-QGLSceneNode *QGLBuilder::popNode()
-{
- if (dptr->currentSection == 0)
- newSection(); // calls newNode()
- int cnt = dptr->currentSection->indexCount();
- QGLSceneNode *s = dptr->nodeStack.takeLast(); // assert here
- QGLSceneNode *parentNode = dptr->rootNode;
- if (dptr->nodeStack.count() > 0)
- parentNode = dptr->nodeStack.last();
- dptr->currentNode = s->cloneNoChildren(parentNode);
- dptr->currentNode->setStart(cnt);
- dptr->currentNode->setCount(0);
- dptr->currentNode->setPalette(parentNode->palette());
- if (dptr->nodeStack.count() == 0)
- dptr->currentSection->addNode(dptr->currentNode);
- return dptr->currentNode;
-}
-
-/*!
- Returns the palette for this builder. This is the QGLMaterialCollection
- pointer that was passed to the constructor; or if that was null a new
- QGLMaterialCollection. This function returns the same result as
- \c{sceneNode()->palette()}.
-
- \sa sceneNode()
-*/
-QGLMaterialCollection *QGLBuilder::palette()
-{
- return dptr->rootNode->palette();
-}
-
-/*!
- \relates QGLBuilder
- Convenience operator for creating a new section in \a builder with \a smoothing.
-
- \code
- // equivalent to builder.newSection(QGL::Faceted)
- builder << QGL::Faceted;
- \endcode
-*/
-QGLBuilder& operator<<(QGLBuilder& builder, const QGL::Smoothing& smoothing)
-{
- builder.newSection(smoothing);
- return builder;
-}
-
-/*!
- \relates QGLBuilder
- Convenience operator for adding \a triangles to the \a builder.
-
- \code
- // equivalent to builder.addTriangles(triangles);
- builder << triangles;
- \endcode
-*/
-QGLBuilder& operator<<(QGLBuilder& builder, const QGeometryData& triangles)
-{
- builder.addTriangles(triangles);
- return builder;
-}
-
-QT_END_NAMESPACE
diff --git a/src/threed/geometry/qglbuilder.h b/src/threed/geometry/qglbuilder.h
deleted file mode 100644
index 31382e36..00000000
--- a/src/threed/geometry/qglbuilder.h
+++ /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$
-**
-****************************************************************************/
-
-#ifndef QGLBuilder_H
-#define QGLBuilder_H
-
-#include <QtCore/qvector.h>
-#include <QtCore/qlist.h>
-#include <QtGui/qvector3d.h>
-#include <QtOpenGL/qgl.h>
-
-#include "qglnamespace.h"
-#include "qglscenenode.h"
-#include "qglattributevalue.h"
-#include "qgeometrydata.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class QGLSection;
-class QGLMaterialCollection;
-class QGLBuilderPrivate;
-class QGLPainter;
-
-class Q_QT3D_EXPORT QGLBuilder
-{
-public:
- explicit QGLBuilder(QGLMaterialCollection *materials = 0);
- virtual ~QGLBuilder();
-
- // section management
- void newSection(QGL::Smoothing sm = QGL::Smooth);
-
- // scene management
- QGLSceneNode *sceneNode();
- QGLSceneNode *currentNode();
- QGLSceneNode *newNode();
- QGLSceneNode *pushNode();
- QGLSceneNode *popNode();
- QGLMaterialCollection *palette();
- QGLSceneNode *finalizedSceneNode();
-
- // geometry building by primitive
- void addTriangles(const QGeometryData &triangle);
- void addQuads(const QGeometryData &quad);
- void addTriangleFan(const QGeometryData &fan);
- void addTriangleStrip(const QGeometryData &strip);
- void addTriangulatedFace(const QGeometryData &face);
- void addQuadStrip(const QGeometryData &strip);
- void addQuadsInterleaved(const QGeometryData &top,
- const QGeometryData &bottom);
- inline void addPane(qreal size = 1.0f);
- inline void addPane(QSizeF size);
-
-protected:
- // internal and test functions
- QGLSection *currentSection() const;
- QList<QGLSection*> sections() const;
- void setDefaultThreshold(int);
-
-private:
- Q_DISABLE_COPY(QGLBuilder);
- void addSection(QGLSection *section);
-
- friend class QGLSection;
-
- QGLBuilderPrivate *dptr;
-};
-
-inline void QGLBuilder::addPane(qreal size)
-{
- addPane(QSizeF(size, size));
-}
-
-inline void QGLBuilder::addPane(QSizeF size)
-{
- QSizeF f = size / 2.0f;
- QVector2D a(-f.width(), -f.height());
- QVector2D b(f.width(), -f.height());
- QVector2D c(f.width(), f.height());
- QVector2D d(-f.width(), f.height());
- 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 quad;
- quad.appendVertex(a, b, c, d);
- quad.appendTexCoord(ta, tb, tc, td);
- addQuads(quad);
-}
-
-Q_QT3D_EXPORT QGLBuilder& operator<<(QGLBuilder& builder, const QGL::Smoothing& smoothing);
-Q_QT3D_EXPORT QGLBuilder& operator<<(QGLBuilder& builder, const QGeometryData& triangles);
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // QGLBuilder_H
diff --git a/src/threed/geometry/qglbuilder_p.h b/src/threed/geometry/qglbuilder_p.h
deleted file mode 100644
index 237f7219..00000000
--- a/src/threed/geometry/qglbuilder_p.h
+++ /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 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 QGLBuilder_P_H
-#define QGLBuilder_P_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 "qglbuilder.h"
-
-#include <QtCore/qmap.h>
-#include <QPointer>
-
-QT_BEGIN_NAMESPACE
-
-class QGLBuilder;
-class QGLSection;
-class QGeometryData;
-
-class QGLBuilderPrivate
-{
-public:
- QGLBuilderPrivate(QGLBuilder *parent);
- ~QGLBuilderPrivate();
- inline void setDirty(bool dirty = true);
- void addTriangle(int a, int b, int c, const QGeometryData &p, int &count);
- void adjustSectionNodes(QGLSection *sec, int offset, const QGeometryData &geom);
- int adjustNodeTree(QGLSceneNode *top, int offset, const QGeometryData &geom,
- QList<QGLSceneNode*> &deleted);
-
- QList<QGLSection*> sections;
- QGLSection *currentSection;
- QList<QGLSceneNode*> nodeStack;
- QGLSceneNode *currentNode;
- QGLSceneNode *rootNode;
- int defThreshold;
- QGLBuilder *q;
-};
-
-QT_END_NAMESPACE
-
-#endif // QGLBuilder_P_H
diff --git a/src/threed/geometry/qglcube.cpp b/src/threed/geometry/qglcube.cpp
deleted file mode 100644
index a1932328..00000000
--- a/src/threed/geometry/qglcube.cpp
+++ /dev/null
@@ -1,198 +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 "qglcube.h"
-#include "qglbuilder.h"
-#include "qvector3darray.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGLCube
- \brief The QGLCube class represents the geometry of simple six-sided cube in 3D space.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::geometry
-
- The following example adds a cube of 2 units on a side to a
- geometry builder, and draws it at (10, 25, 0) in a QGLPainter:
-
- \code
- QGLBuilder list;
- list.newSection(QGL::Faceted);
- list << QGLCube(2);
- painter->translate(10, 25, 0);
- list.draw(painter);
- \endcode
-
- QGLCube will create a default set of texture coordinates that shows
- the same texture of all six faces.
-*/
-
-/*!
- \fn QGLCube::QGLCube(qreal size)
-
- Constructs the geometry for a regular cube of \a size
- units on a side.
-*/
-
-/*!
- \fn qreal QGLCube::size() const
-
- Returns the size of this cube.
-
- \sa setSize()
-*/
-
-/*!
- \fn void QGLCube::setSize(qreal size)
-
- Sets the \a size of this cube.
-
- \sa size()
-*/
-
-static const int vertexDataLen = 6 * 4 * 3;
-
-static const float vertexData[vertexDataLen] = {
- // +X
- 0.5f, 0.5f, -0.5f,
- 0.5f, 0.5f, 0.5f,
- 0.5f, -0.5f, 0.5f,
- 0.5f, -0.5f, -0.5f,
- // -X
- -0.5f, -0.5f, -0.5f,
- -0.5f, -0.5f, 0.5f,
- -0.5f, 0.5f, 0.5f,
- -0.5f, 0.5f, -0.5f,
-
- // +Y
- -0.5f, 0.5f, -0.5f,
- -0.5f, 0.5f, 0.5f,
- 0.5f, 0.5f, 0.5f,
- 0.5f, 0.5f, -0.5f,
- // -Y
- 0.5f, -0.5f, -0.5f,
- 0.5f, -0.5f, 0.5f,
- -0.5f, -0.5f, 0.5f,
- -0.5f, -0.5f, -0.5f,
-
- // +Z
- 0.5f, -0.5f, 0.5f,
- 0.5f, 0.5f, 0.5f,
- -0.5f, 0.5f, 0.5f,
- -0.5f, -0.5f, 0.5f,
- // -Z
- 0.5f, 0.5f, -0.5f,
- 0.5f, -0.5f, -0.5f,
- -0.5f, -0.5f, -0.5f,
- -0.5f, 0.5f, -0.5f
-};
-
-static const int texCoordDataLen = 6 * 4 * 2;
-
-static const float texCoordData[texCoordDataLen] = {
- // +X
- 1.0f, 1.0f,
- 0.0f, 1.0f,
- 0.0f, 0.0f,
- 1.0f, 0.0f,
- // -X
- 0.0f, 0.0f,
- 1.0f, 0.0f,
- 1.0f, 1.0f,
- 0.0f, 1.0f,
-
- // +Y
- 0.0f, 1.0f,
- 0.0f, 0.0f,
- 1.0f, 0.0f,
- 1.0f, 1.0f,
- // -Y
- 1.0f, 0.0f,
- 1.0f, 1.0f,
- 0.0f, 1.0f,
- 0.0f, 0.0f,
-
- // +Z
- 1.0f, 0.0f,
- 1.0f, 1.0f,
- 0.0f, 1.0f,
- 0.0f, 0.0f,
- // -Z
- 0.0f, 1.0f,
- 0.0f, 0.0f,
- 1.0f, 0.0f,
- 1.0f, 1.0f,
-};
-
-/*!
- \relates QGLCube
-
- Builds the geometry for \a cube within the specified
- geometry \a builder.
-
- This operator specifies the positions, and 2D texture
- co-ordinates for all of the vertices that make up the cube.
- Normals will be calculated by the \a builder, depending on its
- current section's smoothing setting.
-*/
-QGLBuilder& operator<<(QGLBuilder& builder, const QGLCube& cube)
-{
- QGeometryData op;
-
- QVector3DArray vrts = QVector3DArray::fromRawData(
- reinterpret_cast<const QVector3D *>(vertexData), vertexDataLen / 3);
- if (cube.size() != 1.0f)
- vrts.scale(cube.size());
-
- op.appendVertexArray(vrts);
-
- QVector2DArray texx = QVector2DArray::fromRawData(
- reinterpret_cast<const QVector2D *>(texCoordData), texCoordDataLen / 2);
-
- op.appendTexCoordArray(texx);
-
- builder.addQuads(op);
- return builder;
-}
-
-QT_END_NAMESPACE
diff --git a/src/threed/geometry/qglcube.h b/src/threed/geometry/qglcube.h
deleted file mode 100644
index f9914a04..00000000
--- a/src/threed/geometry/qglcube.h
+++ /dev/null
@@ -1,76 +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 QGLCUBE_H
-#define QGLCUBE_H
-
-#include "qt3dglobal.h"
-
-#include <QtGui/qvector2d.h>
-#include "qvector2darray.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class QGLBuilder;
-
-class Q_QT3D_EXPORT QGLCube
-{
-public:
- explicit QGLCube(qreal size = 1.0f) : m_size(size) {}
-
- qreal size() const { return m_size; }
- void setSize(qreal size) { m_size = size; }
-
-private:
- qreal m_size;
-};
-
-Q_QT3D_EXPORT QGLBuilder& operator<<(QGLBuilder& builder, const QGLCube& cube);
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/geometry/qglcylinder.cpp b/src/threed/geometry/qglcylinder.cpp
deleted file mode 100644
index 76f5fc75..00000000
--- a/src/threed/geometry/qglcylinder.cpp
+++ /dev/null
@@ -1,445 +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 "qglcylinder.h"
-#include "qglbuilder.h"
-#include "qvector2darray.h"
-#include "qvector3darray.h"
-#include <QtCore/qmath.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGLCylinder
- \brief The QGLCylinder class represents the geometry of a simple cylinder/cone in 3D space.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::geometry
-
- The following example creates a cone with a top diameter of 1 unit,
- a bottom diameter of of 2 units in diameter and height of 3 units.
-
- It then draws it at (10, 25, 0) in a QGLPainter:
-
- \code
- QGLBuilder builder;
- builder << QGLCylinder(1.0,2.0,3.0);
- QGLSceneNode *node = builder.finalizedSceneNode();
-
- // view the cylinder structure during development
- qDumpScene(node);
-
- painter.translate(10, 25, 0);
- node->draw(&painter);
- \endcode
-
- Note that the bottom circle of the cylinder will always be centred at (0,0,0)
- unless otherwise transformed after cylinder creation.
-
- The QGLCylinder class specifies positions, normals and 2D texture
- co-ordinates for all of the vertices that make up the cylinder.
-
- The texture co-ordinates are fixed at construction time. This
- is because constructing the cylinder can involve generating additional
- vertices which need to interpolate the texture co-ordinates of their
- neighboring vertices.
-
- The QGLCylinder is divided into slices and layers. The slices value
- indicate number of triangular sections into which the top and bottom
- circles of the cylinder are broken into. Consequently it also sets the
- number of facets which run the length of the cylinder. More slices
- results in a smoother circumference.
-
- The layers value indicates the number of longitudinal sections the
- cylinder is broken into. Fewer layers means that the side facets of the
- cylinder will be made up of fewer, very long, triangles, while a higher
- number of layers will produce many and smaller triangles. Often it is
- desirable to avoid large triangles as they may cause inefficiencies in
- texturing/lighting on certain platforms.
-
- The end-caps and sides of the cylinder are independent sections of the
- scene-graph, and so may be textured separately.
-
- Textures are wrapped around the sides of thecylinder in such a way that
- the texture may distort across the x axis if the top and bottom diameters
- of the cylinder differ (ie. the cylinder forms a truncated cone). Textures
- begin and end at the centre points of the top and bottom end-caps of the
- cylinder. This wrapping means that textures on either end-cap may be
- distorted.
-
- Texture coordinates are assigned as shown below.
-
- \image cylinder-texture-coords.png
-
- It is worth noting that the cylinder class can, in fact, be used to generate
- any regular solid polygonal prism. A rectangular prism can be created, for
- example, by creating a 4 sided cylinder. Likewise a hexagonal prism is
- simply a 6 sided cylinder.
-
- With this knowledge, and an understanding of the texture coordinate mapping,
- it is possible to make custom textures which will be usable with these
- three dimensional objects.
-
- \section1 Cylinder Sections and Non-Trivial Scene Structure
-
- When the cylinder is placed in the builder, by necessity separate sections are created
- so that the correct hard edge for the normals is rendered. If there were no
- sections, the smooth shading would try to make the cylinder sides and its flat bases
- all part of a smoothly shaded surface instead of having a sharp crease between them.
-
- Because of this necessary limitation when working with QGLCylinder always examine the
- generate node structure using the qDumpScene() function, as shown above. This will
- display the structure of the generated sections by their named scenenodes,and quickly
- make obvious what required code is needed to render the scene as desired.
-
- In the case of most non-trivial programatically generate geometry, for example
- compiling cubes, cylinders and domes into a single builder, the resulting scene
- will be not organised in a predictable way. Due to the section limitation it is hard
- to avoid the results all being siblings. Using pushNode() does not work because
- section boundaries cause QGLBuilder to reset it's node stack, as the section
- boundaries must be discrete.
-
- \section1 Analysing and Re-organising Scenes
-
- To deal with the structure imposed by separate sections, first use qDumpScene() to
- analyse the scene.
-
- In the simplest case disable the caps of the cylinder so that only one simple node is
- generated, and get a handle to this node via builder.currentNode(). Alternatively
- use seperate builder objects and finalizedSceneNode() calls to obtain distinct
- nodes - these will have Base and Dome sibling objects beneath them.
-
- In extreme cases the tree can have nodes cut out and transplanted onto alternative
- parents like this:
- \code
- // Here root is the builder's root node, either from the
- // sceneNode() function or from finalizedSceneNode():
- QGLSceneNode *dome = new QGLSceneNode;
- dome->setObjectName("Icecream Top");
- QList<QGLSceneNode*> c = root->allChildren();
- for (int i = 0; i < c.size(); ++i)
- {
- if (c.at(i)->objectName() == "Dome" || c.at(i)->objectName() == "Base")
- {
- root->removeNode(c.at(i));
- dome->addNode(c.at(i));
- }
- }
- dome->setPalette(root->palette());
- dome->setMaterialIndex(domeMat);
- \endcode
-
- Note that this code relies on knowledge that the nodes "Dome" and "Base" are created
- and this is obtained via qDumpScene. Using the QGLSceneNode::allChildren() function
- returns a flat list of the heierarchy enabling easy finding of nodes that might be
- deeper in the scene.
-
- Executive summary - use qDumpScene();
-
- \sa QGLBuilder
-*/
-
-
-/*!
- \fn QGLCylinder::QGLCylinder(qreal diameterTop, qreal diameterBase , qreal height, int slices, int layers, bool top, bool base)
-
- Constructs the geometry for a cylinder with top of diameter \a diameterTop,
- a base of diameter \a diameterBase, and a height of \a height.
-
- The resultant mesh will be divided around the vertical axis of the cylinder
- into \a slices individual wedges, and shall be formed of \a layers stacked
- to form the cylinder.
-
- If the values for \a top or \a base are true, then the cylinder will be
- created with solid endcaps. Otherwise, it shall form a hollow pipe.
-
- units on a side.
-*/
-
-
-/*!
- \fn qreal QGLCylinder::diameterTop() const
-
- Returns the diameter of the top of the cylinder.
-
- The default value is 1.
-
- \sa setDiameterTop()
-*/
-
-/*!
- \fn void QGLCylinder::setDiameterTop(qreal diameter)
-
- Sets the diameter of the top of this cylinder to \a diameter.
-
- \sa diameterTop()
-*/
-
-/*!
- \fn qreal QGLCylinder::diameterBottom() const
-
- Returns the diameter of the bottom of the cylinder.
-
- The default value is 1.
-
- \sa setDiameterBottom()
-*/
-
-/*!
- \fn void QGLCylinder::setDiameterBottom(qreal diameter)
-
- Sets the diameter of the bottom of this cylinder to \a diameter.
-
- \sa diameterBottom()
-*/
-
-/*!
- \fn qreal QGLCylinder::height() const
-
- Returns the height of the cylinder.
-
- The default value is 1.0
-
- \sa setDiameterBottom()
-*/
-
-/*!
- \fn void QGLCylinder::setHeight(qreal height)
-
- Sets the height of this cylinder to \a height.
-
- \sa diameterBottom()
-*/
-
-
-/*!
- \fn int QGLCylinder::slices() const
-
- Returns the number of triangular slices the cylinder is divided into
- around its polar axis.
-
- The default is 6.
-
- \sa setSlices()
-*/
-
-/*!
- \fn int QGLCylinder::setSlices(int slices)
-
- Sets the number of triangular \a slices the cylinder is divided into
- around its polar axis.
-
- \sa slices()
-*/
-
-/*!
- \fn int QGLCylinder::layers() const
-
- Returns the number of cylindrical layers the cylinder is divided into
- along its height.
-
- The default is 3.
-
- \sa setLayers()
-*/
-
-/*!
- \fn int QGLCylinder::setLayers(int layers)
-
- Sets the number of stacked \a layers the cylinder is divided into
- along its height.
-
- \sa layers()
-*/
-
-/*!
- \fn bool QGLCylinder::topEnabled() const
-
- Returns true if the top of the cyclinder will be created when
- building the mesh.
-
- The default is true.
-
- \sa setTopEnabled()
-*/
-
-/*!
- \fn void QGLCylinder::setTopEnabled(bool top)
-
- Set whether the top end-cap of the cylinder will be created when
- building the mesh. If \a top is true, the end-cap will be created.
-
- \sa topEnabled()
-*/
-
-/*!
- \fn bool QGLCylinder::baseEnabled() const
-
- Returns true if the base of the cyclinder will be created when
- building the mesh.
-
- The default is true.
-
- \sa setBaseEnabled()
-*/
-
-/*!
- \fn void QGLCylinder::setBaseEnabled(bool base)
-
- Set whether the base end-cap of the cylinder will be created when
- building the mesh. If \a base is true, the end-cap will be created.
-
- \sa baseEnabled()
-*/
-
-/*!
- \relates QGLCylinder
-
- Builds the geometry for \a cylinder within the specified
- geometry \a builder.
-*/
-
-QGLBuilder& operator<<(QGLBuilder& builder, const QGLCylinder& cylinder)
-{
- /* ASSERT(cylinder.diameterBottom()>=0 &&
- cylinder.diameterTop()>=0 &&
- cylinder.height()>0);*/
-
- qreal numSlices = qreal(cylinder.slices());
- qreal numLayers = qreal(cylinder.layers());
- qreal topRadius = cylinder.diameterTop()/2.0;
- qreal bottomRadius = cylinder.diameterBottom()/2.0;
-
- qreal angle = 0;
- qreal angleIncrement = (2.0 * M_PI) / numSlices;
- qreal radius = topRadius;
- qreal radiusIncrement = qreal(bottomRadius-topRadius)/ numLayers;
- qreal height = qreal(cylinder.height());
- qreal heightDecrement = height/numLayers;
-
- qreal textureHeight = 1.0;
- qreal textureDecrement = 1.0/numLayers;
-
- QGeometryData oldLayer;
-
- //Generate vertices for the next layer of cylinder
- for (int layerCount=0; layerCount<=cylinder.layers(); layerCount++) {
- QGeometryData newLayer;
-
- //Generate a circle of vertices for this layer.
- for (int i=0; i<cylinder.slices(); i++)
- {
- newLayer.appendVertex(QVector3D(radius * qCos(angle),
- radius * qSin(angle),
- height));
- angle+=angleIncrement;
- }
- angle = 0;
- // Generate texture coordinates (including an extra seam vertex for textures).
- newLayer.appendVertex(newLayer.vertex(0));
- newLayer.generateTextureCoordinates();
- for (int i = 0; i < newLayer.count(); i++) newLayer.texCoord(i).setY(textureHeight);
-
- //Special cases for top end-cap
- if (layerCount==0 && cylinder.topEnabled()) {
- //Draw end-cap at top
- QGeometryData top;
- builder.newSection();
- builder.currentNode()->setObjectName("Cylinder Top");
- top.appendVertex(newLayer.center());
- top.appendVertexArray(newLayer.vertices());
- //Generate a circle of texture vertices for this layer.
- top.appendTexCoord(QVector2D(0.5,0.5));
-
- for (int i=1; i<top.count(); i++)
- {
- top.appendTexCoord(QVector2D(0.5*qCos(angle)+0.5, 0.5*qSin(angle)+0.5));
- angle+=angleIncrement;
- }
- angle = 0;
- builder.addTriangulatedFace(top);
- }
-
-
- //Add a new cylinder layer to the mesh
- if (layerCount>0)
- {
- //If it's the first section, create a cylinder sides section
- if (layerCount==1) {
- builder.newSection();
- builder.currentNode()->setObjectName("Cylinder Sides");
- }
- builder.addQuadsInterleaved(oldLayer, newLayer);
- }
-
- //Special cases for bottom end-cap
- if (layerCount==cylinder.layers() && cylinder.baseEnabled()) {
- //Draw end-cap at bottom
- QGeometryData base;
- builder.newSection();
- builder.currentNode()->setObjectName("Cylinder Base");
- base.appendVertexArray(newLayer.vertices());
- base.appendVertex(newLayer.center());
- //Generate a circle of texture vertices for this layer.
- for (int i=1; i<base.count(); i++)
- {
- base.appendTexCoord(QVector2D(0.5*qCos(angle)+0.5, 0.5*qSin(angle)+0.5));
- angle+=angleIncrement;
- }
- base.appendTexCoord(QVector2D(0.5,0.5));
- angle = 0;
-
- //we need to reverse the above to draw it properly - windings!
- builder.addTriangulatedFace(base.reversed());
- }
-
- //Keep the current layer for drawing the next segment of the cylinder
- oldLayer.clear();
- oldLayer.appendGeometry(newLayer);
- radius+=radiusIncrement;
- height-=heightDecrement;
- textureHeight-=textureDecrement;
- }
-
- return builder;
-}
-
-QT_END_NAMESPACE
diff --git a/src/threed/geometry/qglcylinder.h b/src/threed/geometry/qglcylinder.h
deleted file mode 100644
index a33adba2..00000000
--- a/src/threed/geometry/qglcylinder.h
+++ /dev/null
@@ -1,105 +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 QGLCYLINDER_H
-#define QGLCYLINDER_H
-
-#include "qt3dglobal.h"
-#include "qglmaterialcollection.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class QGLBuilder;
-class QVector2D;
-
-class Q_QT3D_EXPORT QGLCylinder
-{
-public:
- explicit QGLCylinder(qreal diameterTop = 1.0f, qreal diameterBase = 1.0f, qreal height = 1.0f, int slices = 6, int layers = 3, bool top = true, bool base = true)
- : m_diameterTop(diameterTop), m_diameterBottom(diameterBase), m_height(height), m_slices(slices), m_layers(layers), m_top(top), m_base(base) {}
-
- //Cylinder dimensions
- qreal diameterTop() const {return m_diameterTop;}
- void setDiameterTop(qreal diameter) {m_diameterTop=diameter;}
-
- qreal diameterBottom() const {return m_diameterBottom;}
- void setDiameterBottom(qreal diameter) {m_diameterBottom=diameter;}
-
- qreal height() const {return m_height;}
- void setHeight(qreal height) {m_height = height;}
-
- //Cylinder geometrical subdivisions
- int slices() const {return m_slices;}
- void setSlices(int slices) {m_slices = slices;}
-
- int layers() const {return m_layers;}
- void setLayers(int layers) {m_layers = layers;}
-
- //End-caps attached?
- bool topEnabled() const {return m_top;}
- void setTopEnabled(bool top) {m_top = top;}
-
- bool baseEnabled() const {return m_base;}
- void setBaseEnabled(bool base) {m_base = base;}
-
-protected:
- qreal m_diameterTop;
- qreal m_diameterBottom;
- qreal m_height;
-
- int m_slices;
- int m_layers;
-
- bool m_top;
- bool m_base;
-};
-
-Q_QT3D_EXPORT QGLBuilder& operator<<(QGLBuilder& builder, const QGLCylinder& cylinder);
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // QGLCYLINDER_H
diff --git a/src/threed/geometry/qgldome.cpp b/src/threed/geometry/qgldome.cpp
deleted file mode 100644
index ffdd5626..00000000
--- a/src/threed/geometry/qgldome.cpp
+++ /dev/null
@@ -1,281 +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 "qgldome.h"
-#include "qglbuilder.h"
-#include <QtCore/qmath.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGLDome
- \brief The QGLDome class represents the geometry of a simple hemisphere in 3D space.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::geometry
-
- The following example creates a dome of 2 units in diameter and
- draws it at (10, 25, 0) in a QGLPainter:
-
- \code
- QGLBuilder builder;
- builder << QGLDome(2);
- QGLSceneNode *node = builder.finalizedSceneNode();
-
- // view the dome structure during development
- qDumpScene(node);
-
- painter.translate(10, 25, 0);
- node->draw(&painter);
- \endcode
-
- The QGLDome class specifies positions, normals and 2D texture
- co-ordinates for all of the vertices that make up the sphere.
-
- The texture co-ordinates are fixed at construction time. This
- is because constructing the sphere can involve generating additional
- vertices which need to interpolate the texture co-ordinates of their
- neighboring vertices.
-
- The default mode of QGLDome is half of a "UV sphere", which divides
- the object up into longitudinal and latitudinal sections. The longitudinal
- slices meet at the pole, which in a single unit dome is defined to
- be at (0, 0, +0.5) and (0, 0, -0.5). This choice is the simplest to
- texture map as the texture will only distort along the x-axis of the
- 2D texture. However the density of vertices is significantly higher at
- the poles than it is elsewhere on the sphere and is a poor choice if a
- uniform density of pixels from the texture map is required.
-
- \section1 Dome Sections and Non-Trivial Scene Structure
-
- When the dome is placed in the builder, by necessity separate sections are created
- so that the correct hard edge for the normals is rendered. If there were no
- sections, the smooth shading would try to make the dome surface and its flat base
- all part of a smoothly shaded surface instead of having a sharp crease between them.
-
- Because of this necessary limitation when working with QGLDome always examine the
- generate node structure using the qDumpScene() function, as shown above. This will
- display the structure of the generated sections by their named scenenodes,and quickly
- make obvious what required code is needed to render the scene as desired.
-
- In the simplest case disable the base of the dome so that only one simple node is
- generated, and get a handle to this node via builder.currentNode(). Alternatively
- use seperate builder objects and finalizedSceneNode() calls to obtain distinct
- nodes - these will have Base and Dome sibling objects beneath them.
-
- For other options see \l{QGLCylinder#analysing-and-re-organising-scenes}{Analysing and Re-organising Scenes} in the QGLCylinder class
- documentation.
-
- Executive summary - use qDumpScene();
-
- \sa QGLBuilder, QGLCylinder
-*/
-
-/*!
- \fn QGLDome::QGLDome(qreal diameter, int depth, bool base)
-
- Creates a dome of \a diameter across (default is 1). When the dome
- is recursively subdivided into triangles, it will be subdivided no more
- than \a depth times (between 1 and 5, default is 3).
-
- If \a base is true, the dome will be drawn with a bottom circle, creating
- an enclosed solid.
-*/
-
-/*!
- Destroys this dome object.
-*/
-QGLDome::~QGLDome()
-{
-}
-
-/*!
- \fn qreal QGLDome::diameter() const
-
- Returns the diameter of this dome. The default is 1.
-
- \sa setDiameter()
-*/
-
-/*!
- \fn void QGLDome::setDiameter(qreal diameter)
-
- Sets the diameter of this dome to \a diameter.
-
- \sa diameter()
-*/
-
-/*!
- \fn int QGLDome::subdivisionDepth() const
-
- Returns the maximum depth when this hemisphere is subdivided into
- triangles. The default is 3. The following picture shows the effect
- of depth values between 1 and 5 for a UV sphere (hemisphere subdivision
- depth shares this scheme).
-
- \image sphere-detail.png
-
- \sa setSubdivisionDepth(), QGLSphere::subdivisionDepth()
-*/
-
-/*!
- \fn void QGLDome::setSubdivisionDepth(int depth)
-
- Sets the maximum \a depth when this hemisphere is subdivided into triangles.
-
- \sa subdivisionDepth()
-*/
-
-/*!
- \fn bool QGLDome::baseEnabled() const
-
- Returns true if the base of the dome will be created when
- building the mesh.
-
- The default is true.
-
- \sa setBaseEnabled()
-*/
-
-/*!
- \fn void QGLDome::setBaseEnabled(bool base)
-
- Set whether the bottom of the dome will be created when
- building the mesh. If \a base is true, the end-cap will be
- created.
-
- \sa baseEnabled()
-*/
-
-/*!
- \relates QGLDome
-
- Builds the geometry for \a dome within the specified
- geometry \a builder.
-*/
-QGLBuilder& operator<<(QGLBuilder& builder, const QGLDome& dome)
-{
- qreal radius = dome.diameter() / 2.0f;
-
- // Determine the number of slices and stacks to generate.
- int divisions = dome.subdivisionDepth();
- if (divisions < 1)
- divisions = 1;
- else if (divisions > 5)
- divisions = 5;
- int stacks = 2 * (1 << divisions);
- int slices = 2 * stacks;
- stacks = stacks>>1;
-
- // Precompute sin/cos values for the slices and stacks.
- const int maxSlices = 4 * (1 << 5) + 1;
- const int maxStacks = 2 * (1 << 5) + 1;
- qreal sliceSin[maxSlices];
- qreal sliceCos[maxSlices];
- qreal stackSin[maxStacks];
- qreal stackCos[maxStacks];
- for (int slice = 0; slice < slices; ++slice) {
- qreal angle = 2 * M_PI * slice / slices;
- sliceSin[slice] = qFastSin(angle);
- sliceCos[slice] = qFastCos(angle);
- }
- sliceSin[slices] = sliceSin[0]; // Join first and last slice.
- sliceCos[slices] = sliceCos[0];
-
- const qreal halfPi=M_PI/2.0;
-
- for (int stack = 0; stack <= stacks; ++stack) {
- qreal angle = halfPi * stack / stacks;
- stackSin[stack] = qFastSin(angle);
- stackCos[stack] = qFastCos(angle);
- }
- stackSin[0] = 0.0f; // Come to a point at the poles.
- stackSin[stacks] = 1.0f;
-
- builder.newSection();
- builder.currentNode()->setObjectName("Dome");
- // Create the stacks for the dome part of the dome
- for (int stack = 0; stack < stacks; ++stack) {
- QGeometryData prim;
- qreal z = radius * stackCos[stack];
- qreal nextz = radius * stackCos[stack + 1];
- qreal s = stackSin[stack];
- qreal nexts = stackSin[stack + 1];
- qreal c = stackCos[stack];
- qreal nextc = stackCos[stack + 1];
- qreal r = radius * s;
- qreal nextr = radius * nexts;
- for (int slice = 0; slice <= slices; ++slice) {
- prim.appendVertex(QVector3D(nextr * sliceSin[slice], nextr * sliceCos[slice], nextz));
- prim.appendNormal(QVector3D(sliceSin[slice] * nexts, sliceCos[slice] * nexts, nextc));
- prim.appendTexCoord(QVector2D(1.0f - qreal(slice) / slices, 1.0f - qreal(stack + 1) / stacks));
-
- prim.appendVertex(QVector3D(r * sliceSin[slice], r * sliceCos[slice], z));
- prim.appendNormal(QVector3D(sliceSin[slice] * s, sliceCos[slice] * s, c));
- prim.appendTexCoord(QVector2D(1.0f - qreal(slice) / slices, 1.0f - qreal(stack) / stacks));
- }
- builder.addQuadStrip(prim);
- }
-
- if (dome.baseEnabled()) {
- //Draw end-cap at bottom
- builder.newSection();
- builder.currentNode()->setObjectName("Base");
-
- //Generate a circle of vertices for this layer.
- QGeometryData tempBase;
-
- tempBase.appendVertex(QVector3D(0,0,0));
- tempBase.appendTexCoord(QVector2D(0.5,0.5));
- for (int slice=0; slice<=slices+1; slice++)
- {
- tempBase.appendVertex(QVector3D(radius * sliceCos[slice], radius * sliceSin[slice], 0));
- tempBase.appendTexCoord(QVector2D(0.5*sliceCos[slice]+0.5, 0.5*sliceSin[slice]+0.5));
- }
-
- //we need to reverse the above to draw it properly - windings!
- builder.addTriangulatedFace(tempBase.reversed());
- }
- return builder;
-}
-
-QT_END_NAMESPACE
-
diff --git a/src/threed/geometry/qgldome.h b/src/threed/geometry/qgldome.h
deleted file mode 100644
index 3f3ea3eb..00000000
--- a/src/threed/geometry/qgldome.h
+++ /dev/null
@@ -1,83 +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 QGLDOME_H
-#define QGLDOME_H
-
-#include "qt3dglobal.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class QGLBuilder;
-
-class Q_QT3D_EXPORT QGLDome
-{
-public:
- explicit QGLDome(qreal diameter = 1.0f, int depth = 3, bool baseEnabled = true)
- : m_diameter(diameter), m_subdivisionDepth(depth), m_baseEnabled(baseEnabled) {}
- virtual ~QGLDome();
-
- qreal diameter() const { return m_diameter; }
- void setDiameter(qreal diameter) { m_diameter = diameter; }
-
- int subdivisionDepth() const { return m_subdivisionDepth; }
- void setSubdivisionDepth(int depth) { m_subdivisionDepth = depth; }
-
- bool baseEnabled() const {return m_baseEnabled; }
- void setBaseEnabled(bool baseEnabled) {m_baseEnabled = baseEnabled;}
-
-private:
- qreal m_diameter;
- int m_subdivisionDepth;
- bool m_baseEnabled;
-};
-
-Q_QT3D_EXPORT QGLBuilder& operator<<(QGLBuilder& builder, const QGLDome& dome);
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/geometry/qglmaterialcollection.cpp b/src/threed/geometry/qglmaterialcollection.cpp
deleted file mode 100644
index 0f396837..00000000
--- a/src/threed/geometry/qglmaterialcollection.cpp
+++ /dev/null
@@ -1,417 +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 "qglmaterialcollection.h"
-#include "qglmaterial_p.h"
-#include <QtCore/qlist.h>
-#include <QtCore/qhash.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGLMaterialCollection
- \brief The QGLMaterialCollection class manages groups of materials.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::enablers
-
- Managing more complex 3d graphics with several materials is easier when the
- materials can be referred to as a collection. This is the role of the
- QGLMaterialCollection class.
-
- Plug-ins implementing 3D formats may make the materials defined in
- the format available to the application via a QGLMaterialCollection.
-
- The collection is also optimised for the case where many small objects
- must refer to materials - such as faces in a mesh, or particles. In
- this case the materials can be specified as a short data type using an
- offset into the collection, rather than the material name.
-
- When building up a collection, meshes that refer to the various materials
- can check off which ones are used by calling markMaterialAsUsed(), and then
- remove spurious unused materials by calling removeUnusedMaterials(). This
- technique is suitable for models loaded from a model file where a large
- number of materials may be specified but only a few of those materials
- are used by the particular mesh selected from the scene.
-
- To make a material available from a collection, call addMaterial(). To
- retrieve a material from the collection call removeMaterial().
-
- The collection takes ownership of the QGLMaterial
- objects passed to it by the addMaterial() function. These
- objects will be destroyed when the collection is destroyed.
-*/
-
-class QGLMaterialCollectionPrivate
-{
-public:
- QGLMaterialCollectionPrivate()
- {
- }
-
- QList<QGLMaterial *> materials;
- QHash<QString, int> materialNames;
-};
-
-/*!
- Construct a new empty QGLMaterialCollection object. The \a parent
- is set as the parent of this object.
-*/
-QGLMaterialCollection::QGLMaterialCollection(QObject *parent)
- : QObject(parent)
- , d_ptr(new QGLMaterialCollectionPrivate)
-{
-}
-
-/*!
- Destroy this collection. All material objects referred to by this
- collection will be destroyed.
-*/
-QGLMaterialCollection::~QGLMaterialCollection()
-{
- // The QGLMaterial QObject's are reparented to the collection
- // when addMaterial() is called, so the QObject destructor
- // will take care of cleaning them up for us.
-}
-
-/*!
- Returns a pointer to the material corresponding to \a index; or null
- if \a index is out of range or the material has been removed.
-
- Here's an example of searching for a material with a given ambient
- \c{color} in the collection \c{materials}:
-
- \code
- for (int colorIndex; colorIndex < materials->size(); ++colorIndex) {
- if (material(colorIndex) &&
- material(colorIndex)->ambientColor() == color)
- break;
- }
- if (colorIndex < materials->size())
- myObject->setMaterial(colorIndex);
- \endcode
-*/
-QGLMaterial *QGLMaterialCollection::material(int index) const
-{
- Q_D(const QGLMaterialCollection);
- return d->materials.value(index, 0);
-}
-
-/*!
- \overload
-
- Returns the material associated with \a name in this collection;
- null if \a name is not present or the material has been removed.
-*/
-QGLMaterial *QGLMaterialCollection::material(const QString &name) const
-{
- Q_D(const QGLMaterialCollection);
- int index = d->materialNames.value(name, -1);
- if (index >= 0)
- return d->materials[index];
- else
- return 0;
-}
-
-/*!
- Returns true if this collection contains \a material; false otherwise.
-
- \sa indexOf()
-*/
-bool QGLMaterialCollection::contains(QGLMaterial *material) const
-{
- return material && material->d_func()->collection == this;
-}
-
-/*!
- \overload
-
- Returns true if this collection contains a material called \a name;
- false otherwise.
-
- \sa indexOf()
-*/
-bool QGLMaterialCollection::contains(const QString &name) const
-{
- Q_D(const QGLMaterialCollection);
- return d->materialNames.contains(name);
-}
-
-/*!
- Returns the index of \a material in this collection; -1 if
- \a material is not present in this collection.
-
- \sa contains()
-*/
-int QGLMaterialCollection::indexOf(QGLMaterial *material) const
-{
- if (material && material->d_func()->collection == this)
- return material->d_func()->index;
- else
- return -1;
-}
-
-/*!
- \overload
-
- Returns the index of the material called \a name in this collection;
- -1 if \a name is not present in this collection.
-
- \sa contains()
-*/
-int QGLMaterialCollection::indexOf(const QString &name) const
-{
- Q_D(const QGLMaterialCollection);
- return d->materialNames.value(name, -1);
-}
-
-/*!
- Returns the name of the material at \a index in this material collection;
- a null QString if \a index is out of range.
-*/
-QString QGLMaterialCollection::materialName(int index) const
-{
- Q_D(const QGLMaterialCollection);
- if (index >= 0 && index < d->materials.count()) {
- QGLMaterial *material = d->materials[index];
- if (material) {
- // Use the name in the private data block just in case the
- // application has modified objectName() since adding.
- return material->d_func()->name;
- }
- }
- return QString();
-}
-
-/*!
- Returns true if the material at \a index in this collection has been
- marked as used by markMaterialAsUsed().
-
- \sa markMaterialAsUsed()
-*/
-bool QGLMaterialCollection::isMaterialUsed(int index) const
-{
- QGLMaterial *mat = material(index);
- if (mat)
- return mat->d_func()->used;
- else
- return false;
-}
-
-/*!
- Flags the material corresponding to the \a index as used. Some model files
- may contain a range of materials, applying to various objects in the scene.
-
- When a particular object is loaded from the file, many of those
- materials may not be used in that object. This wastes space,
- with many spurious materials being stored.
-
- Use this method during model loading or construction to mark off
- materials that have been used. Materials so marked will not
- be removed by removeUnusedMaterials().
-
- \sa removeUnusedMaterials(), isMaterialUsed()
-*/
-void QGLMaterialCollection::markMaterialAsUsed(int index)
-{
- QGLMaterial *mat = material(index);
- if (mat)
- mat->d_func()->used = true;
-}
-
-/*!
- Removes and deletes materials which have not been marked as used.
-
- \sa markMaterialAsUsed(), isMaterialUsed()
-*/
-void QGLMaterialCollection::removeUnusedMaterials()
-{
- Q_D(QGLMaterialCollection);
- for (int index = 0; index < d->materials.size(); ++index) {
- QGLMaterial *material = d->materials[index];
- if (material && !material->d_func()->used)
- delete removeMaterial(index);
- }
-}
-
-/*!
- Adds \a material to this collection and returns its new index. The
- collection takes ownership of the material and will delete it when the
- collection is destroyed. Initially the \a material is marked as unused.
-
- The QObject::objectName() of \a material at the time addMaterial()
- is called will be used as the material's name within this collection.
- Changes to the object name after the material is added are ignored.
-
- If \a material is already present in this collection, then this
- function will return the index that was previously assigned.
-
- Returns -1 if \a material has been added to another collection.
-
- \sa removeMaterial(), markMaterialAsUsed()
-*/
-int QGLMaterialCollection::addMaterial(QGLMaterial *material)
-{
- Q_D(QGLMaterialCollection);
- Q_ASSERT(material);
-
- // Allocate a new index for the material.
- int index = d->materials.count();
-
- // Record the index in the private data attached to the material.
- // This allows us to find the material's index quickly later.
- QGLMaterialPrivate *dm = material->d_func();
- if (dm->collection) {
- if (dm->collection == this)
- return dm->index;
- return -1;
- }
- dm->collection = this;
- dm->index = index;
- dm->name = material->objectName();
- dm->used = false;
-
- // Add the material to this collection.
- material->setParent(this);
- d->materials.append(material);
- if (!dm->name.isEmpty())
- d->materialNames[dm->name] = index;
- connect(material, SIGNAL(destroyed()), this, SLOT(materialDeleted()));
- return index;
-}
-
-/*!
- Removes all instances of \a material from this collection.
- The \a material object is not deleted and can be reused.
-
- Does nothing if \a material is null or not a member of
- this collection.
-
- \sa addMaterial()
-*/
-void QGLMaterialCollection::removeMaterial(QGLMaterial *material)
-{
- Q_D(QGLMaterialCollection);
- if (!material)
- return;
-
- // Check the material's owning collection.
- QGLMaterialPrivate *dm = material->d_func();
- if (dm->collection != this)
- return;
-
- // Remove the material from the collection.
- d->materials[dm->index] = 0;
- if (!dm->name.isEmpty())
- d->materialNames.remove(dm->name);
- material->setParent(0);
-
- // Detach from the owning collection.
- dm->collection = 0;
- dm->index = -1;
-}
-
-/*!
- Removes the material at \a index from this collection, and returns
- a pointer to the material.
-
- Since the collection is designed for fast lookup by index, the
- the stored material pointer is set to null but the \a index
- otherwise remains valid.
-*/
-QGLMaterial *QGLMaterialCollection::removeMaterial(int index)
-{
- Q_D(QGLMaterialCollection);
-
- // Bail out if the material is invalid.
- if (index < 0 || index >= d->materials.count())
- return 0;
- QGLMaterial *material = d->materials[index];
- if (!material)
- return 0;
-
- // Remove the material from the collection.
- QGLMaterialPrivate *dm = material->d_func();
- d->materials[index] = 0;
- if (!dm->name.isEmpty())
- d->materialNames.remove(dm->name);
- material->setParent(0);
-
- // Detach from the owning collection.
- dm->collection = 0;
- dm->index = -1;
- return material;
-}
-
-/*!
- Returns true if this collection is empty, false otherwise.
-
- \sa size()
-*/
-bool QGLMaterialCollection::isEmpty() const
-{
- Q_D(const QGLMaterialCollection);
- return d->materials.isEmpty();
-}
-
-/*!
- Returns the number of (possibly null) materials in this collection.
- Null materials result from calling removeMaterial().
-
- \sa isEmpty()
-*/
-int QGLMaterialCollection::size() const
-{
- Q_D(const QGLMaterialCollection);
- return d->materials.size();
-}
-
-/*!
- \internal
- Responds to the destroyed() signal by calling removeMaterial() on the
- material about to be deleted;
-*/
-void QGLMaterialCollection::materialDeleted()
-{
- removeMaterial(qobject_cast<QGLMaterial *>(sender()));
-}
-
-QT_END_NAMESPACE
diff --git a/src/threed/geometry/qglmaterialcollection.h b/src/threed/geometry/qglmaterialcollection.h
deleted file mode 100644
index 0ef8efd1..00000000
--- a/src/threed/geometry/qglmaterialcollection.h
+++ /dev/null
@@ -1,101 +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 QGLMATERIALCOLLECTION_H
-#define QGLMATERIALCOLLECTION_H
-
-#include <QtCore/qobject.h>
-
-#include "qt3dglobal.h"
-#include "qglmaterial.h"
-#include "qgltexture2d.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class QGLMaterialCollectionPrivate;
-
-class Q_QT3D_EXPORT QGLMaterialCollection : public QObject
-{
- Q_OBJECT
- Q_DECLARE_PRIVATE(QGLMaterialCollection)
- Q_DISABLE_COPY(QGLMaterialCollection)
-public:
- QGLMaterialCollection(QObject *parent = 0);
- virtual ~QGLMaterialCollection();
-
- QGLMaterial *material(int index) const;
- QGLMaterial *material(const QString &name) const;
-
- bool contains(QGLMaterial *material) const;
- bool contains(const QString &name) const;
-
- int indexOf(QGLMaterial *material) const;
- int indexOf(const QString &name) const;
-
- QString materialName(int index) const;
-
- bool isMaterialUsed(int index) const;
- void markMaterialAsUsed(int index);
- void removeUnusedMaterials();
-
- int addMaterial(QGLMaterial *material);
- void removeMaterial(QGLMaterial *material);
- QGLMaterial *removeMaterial(int index);
-
- bool isEmpty() const;
- int size() const;
-
-private Q_SLOTS:
- void materialDeleted();
-
-private:
- QScopedPointer<QGLMaterialCollectionPrivate> d_ptr;
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // QGLMATERIALCOLLECTION_H
diff --git a/src/threed/geometry/qglsection.cpp b/src/threed/geometry/qglsection.cpp
deleted file mode 100644
index f60e9ffc..00000000
--- a/src/threed/geometry/qglsection.cpp
+++ /dev/null
@@ -1,700 +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 "qglsection_p.h"
-#include "qglbuilder_p.h"
-#include "qarray.h"
-#include "qvector_utils_p.h"
-
-#include <QtGui/qvector3d.h>
-#include <QtCore/qdebug.h>
-#include <QtCore/qpointer.h>
-#include <QtCore/qmap.h>
-#include <QtCore/qbitarray.h>
-
-#include <limits.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \internal
- \class QGLSection
- \brief The QGLSection class clusters like geometry in a QGLBuilder.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::geometry
-
- QGLSection instances partition a QGLBuilder into related sections,
- while the builder is being initialized with geometry data.
-
- Once the builder is initialized, and geometry building is complete
- the QGLSection instances are destroyed and the data is uploaded to the
- graphics hardware.
-
- The QGLSection class is a work horse for the QGLBuilder, and it
- takes care of automatically managing vertex data. As such
- for usual use cases, its functionality will not need to be referenced
- directly. For low-level access to geometry, QGLSection provides a
- range of accessors to reference geometry data during scene building.
-
- Within a section, incoming geometry data will be coalesced and
- indexes created to reference the fewest possible copies of the vertex
- data. For example, in smooth geometry all copies of a vertex are
- coalesced into one, and referenced by indices - except in the case
- where texture data forms a \i seam and a copy must be created to carry
- the two texture coordinates of the seam.
-
- This is handled automatically by QGLSection, to pack data into the
- smallest space possible thus improving cache coherence and performance.
-
- All the vertices in a QGLSection are treated with the same
- \l{QGL::Smoothing}{smoothing}, and have the same
- \l{QLogicalVertex::Type}{data types}.
-
- Each QGLSection references a contiguous range of vertices in a
- QGLBuilder.
-
- A QGLBuilder instance has the \l{QGLBuilder::newSection()}{newSection()}
- function which creates a new QGLSection to reference its data. Use this
- to construct new QGLSection instances, or alternatively construct
- a new QGLSection() and pass a non-null QGLBuilder pointer.
-
- These functions all return QVector values. QVector instances are
- implicitly shared, thus the copies are inexpensive unless a
- non-const function is called on them, triggering a copy-on-write.
-
- Generally for adding geometry, use append(). This function simply
- calls virtual protected functions appendSmooth() (for smoothed vertices)
- and appendFaceted() (for faceted vertices). See QGLBuilder for a
- discussion of smoothing.
-*/
-
-// allow QVector3D's to be stored in a QMap
-inline bool operator<(const QVector3D &a, const QVector3D &b)
-{
- if (qFskCompare(a.x(), b.x()))
- {
- if (qFskCompare(a.y(), b.y()))
- {
- if (qFskCompare(a.z(), b.z()))
- {
- return false; // equal so not less-than
- }
- else
- {
- return a.z() < b.z();
- }
- }
- else
- {
- return a.y() < b.y();
- }
- }
- else
- {
- return a.x() < b.x();
- }
-}
-
-static inline bool qSameDirection(const QVector3D &a , const QVector3D &b)
-{
- bool res = false;
- if (!a.isNull() && !b.isNull())
- {
- float dot = QVector3D::dotProduct(a, b);
- res = qFskCompare((qreal)dot, a.length() * b.length());
- }
- return res;
-}
-
-class QGLSectionPrivate
-{
-public:
- QGLSectionPrivate(const QVector3DArray *ary)
- : vec_data(ary)
- , it(vec_map.end())
- , map_threshold(5)
- , number_mapped(0)
- , start_ptr(-1)
- , end_ptr(-1)
- {
- normIndices.fill(-1, 32);
- }
-
- ~QGLSectionPrivate() {}
-
- bool normalAccumulated(int index, const QVector3D &norm) const
- {
- if (index >= normIndices.size())
- return false;
- int ptr = normIndices.at(index);
- while (ptr != -1)
- {
- int val_ptr = normPtrs.at(ptr);
- //if (normValues.at(val_ptr) == norm)
- if (qSameDirection(normValues.at(val_ptr), norm))
- return true;
- ptr = normPtrs.at(ptr+1);
- }
- return false;
- }
-
- void accumulateNormal(int index, const QVector3D &norm)
- {
- int new_norm_index = normValues.size();
- normValues.append(norm);
- if (normIndices.size() <= index)
- {
- int old_size = normIndices.size();
- normIndices.extend(32);
- for (int i = old_size; i < normIndices.size(); ++i)
- normIndices[i] = -1;
- }
- int new_norm_ptr = normPtrs.size();
- normPtrs.append(new_norm_index); // even ptrs point to vector value
- normPtrs.append(-1); // odd ptrs point to next in normPtr linked list
- if (normIndices.at(index) == -1)
- {
- normIndices[index] = new_norm_ptr;
- }
- else
- {
- int norm_ptr = normIndices.at(index);
- while (normPtrs.at(norm_ptr + 1) != -1)
- {
- norm_ptr = normPtrs.at(norm_ptr + 1);
- }
- normPtrs[norm_ptr+1] = new_norm_ptr;
- }
- }
-
- void mapVertex(const QVector3D &v, int ix)
- {
- Q_UNUSED(ix);
- Q_UNUSED(v);
- static bool seeded = false;
- if (!seeded)
- qsrand(31415);
- Q_ASSERT(vec_data->at(ix) == v);
- if ((vec_data->size() - number_mapped) > map_threshold)
- {
- int to_map = vec_data->size() - number_mapped;
- QArray<int, 100> shuffle(to_map, -1);
- for (int i = number_mapped, k = 0; i < vec_data->size(); ++i, ++k)
- shuffle[k] = i;
- for (int n = to_map; n > 1; --n)
- {
- int k = qrand() % n;
- int tmp = shuffle[k];
- shuffle[k] = shuffle[n - 1];
- shuffle[n - 1] = tmp;
- }
- for (int i = 0; i < to_map; ++i)
- vec_map.insertMulti(vec_data->at(shuffle.at(i)), shuffle.at(i));
- number_mapped += to_map;
- }
- }
-
- int nextIndex()
- {
- int result = -1;
- if (end_ptr != -1)
- {
- // first look through the unmapped items
- while (start_ptr <= end_ptr && result == -1)
- {
- // search from the end and beginning, favouring the end - most often
- // its in the last few we added, sometimes in the first ones
- if (qFskCompare(vec_data->at(end_ptr--), target))
- result = end_ptr+1;
- else if (start_ptr <= end_ptr && qFskCompare(vec_data->at(end_ptr--), target))
- result = end_ptr+1;
- else if (start_ptr <= end_ptr && qFskCompare(vec_data->at(start_ptr++), target))
- result = start_ptr-1;
- }
- // if that found nothing, have a look at the map
- if (result == -1)
- {
- start_ptr = -1;
- end_ptr = -1;
- it = vec_map.constEnd();
- if (vec_map.size() > 0)
- it = vec_map.find(target);
- }
- }
- if (it != vec_map.constEnd())
- {
- // if there was something in the map see if its still on target
- if (qFskCompare(it.key(), target))
- {
- result = it.value();
- ++it; // increment to find more insertMulti instances
- }
- else
- {
- // not on target - flag that we're done here
- it = vec_map.constEnd();
- }
- }
- return result;
- }
-
- int findVertex(const QVector3D &v)
- {
- end_ptr = vec_data->size() - 1; // last one not in QMap
- start_ptr = number_mapped; // first one not in QMap
- target = v;
- return nextIndex();
- }
-
- // mapper
- int index;
- QVector3D target;
- const QVector3DArray *vec_data;
- QMap<QVector3D, int> vec_map;
- QMap<int, int> index_map;
- QMap<QVector3D,int>::const_iterator it;
- int map_threshold; // if more than this is unmapped, do a mapping run
- int number_mapped; // how many vertices have been mapped
- int start_ptr;
- int end_ptr;
-
- QArray<int, 32> normIndices;
- QArray<int, 32> normPtrs;
- QArray<QVector3D, 32> normValues;
-
- QList<QGLSceneNode*> nodes;
-};
-
-/*!
- \internal
- Construct a new QGLSection on \a builder, and with smoothing \a s.
- By default the smoothing is QGL::Smooth.
-
- See QGLBuilder for a discussion of smoothing.
-
- The pointer \a list must be non-null, and in debug mode, unless QT_NO_DEBUG is
- defined, this function will assert if \a list is null.
-
- The following lines of code have identical effect:
- \code
- QGLSection *s = myDisplayList->newSection(QGL::Faceted);
- QGLSection *s2 = new QGLSection(myDisplayList, QGL::Faceted);
- \endcode
-*/
-QGLSection::QGLSection(QGLBuilder *builder, QGL::Smoothing s)
- : m_smoothing(s)
- , d(0)
-{
- Q_ASSERT(builder);
- enableField(QGL::Position);
- Q_ASSERT(vertexData());
- d = new QGLSectionPrivate(vertexData());
- builder->addSection(this);
-}
-
-/*!
- \internal
- Destroy this QGLSection, recovering any resources.
-*/
-QGLSection::~QGLSection()
-{
- delete d;
-}
-
-/*!
- \internal
- Reserve capacity for \a amount items. This may avoid realloc
- overhead when a large number of items will be appended.
-*/
-void QGLSection::reserve(int amount)
-{
- QGeometryData::reserve(amount);
- d->normIndices.reserve(amount);
- d->normPtrs.reserve(amount * 2);
- d->normValues.reserve(amount);
-}
-
-/*!
- \internal
- Adds the logical vertices \a a, \a b and \c to this section. All
- should have the same fields. This function is exactly equivalent to
- \code
- append(a); append(b); append(c);
- \endcode
-
- \sa appendSmooth(), appendFaceted()
-*/
-void QGLSection::append(const QLogicalVertex &a, const QLogicalVertex &b, const QLogicalVertex &c)
-{
- Q_ASSERT(a.fields() == b.fields() && b.fields() == c.fields());
- if (!a.hasField(QGL::Normal))
- {
- appendFaceted(a, b, c);
- }
- else
- {
- if (m_smoothing == QGL::Smooth)
- appendSmooth(a, b, c);
- else
- appendFaceted(a, b, c);
- }
-}
-
-/*!
- \internal
- Adds the logical vertex \a lv to this section.
-
- Otherwise, if the \a lv does have a lighting normal; then the
- vertex processing depends on the smoothing property of this section.
- If this section has smoothing QGL::Smooth, then the append will be done
- by calling appendSmooth(); or if this section has smoothing QGL::Faceted,
- then the append will be done by calling appendFaceted().
-
- \sa appendSmooth(), appendFaceted()
-*/
-void QGLSection::append(const QLogicalVertex &lv)
-{
- if (!lv.hasField(QGL::Normal))
- {
- appendFaceted(lv);
- }
- else
- {
- if (m_smoothing == QGL::Smooth)
- appendSmooth(lv);
- else
- appendFaceted(lv);
- }
-}
-
-static bool qCompareByAttributes(const QLogicalVertex &a, const QLogicalVertex &b)
-{
- static const quint32 ATTRS_AND_TEXTURES = (0xFFFFFFFF << QGL::TextureCoord0);
- quint32 af = a.fields() & ATTRS_AND_TEXTURES;
- quint32 bf = b.fields() & ATTRS_AND_TEXTURES;
- if (af != bf)
- return false;
- quint32 flds = af | bf;
- const quint32 mask = 0x01;
- flds >>= QGL::TextureCoord0;
- for (int i = QGL::TextureCoord0; flds; ++i, flds >>= 1)
- {
- if (flds & mask)
- {
- QGL::VertexAttribute attr = static_cast<QGL::VertexAttribute>(i);
- if (attr < QGL::CustomVertex0)
- {
- if (!qFskCompare(a.texCoord(attr), b.texCoord(attr)))
- return false;
- }
- else
- {
- QVariant v1 = a.attribute(attr);
- QVariant v2 = b.attribute(attr);
- if (v1.type() == (QVariant::Type)QMetaType::Float)
- return qFskCompare(v1.toFloat(), v2.toFloat());
- else if (v1.type() == QVariant::Vector2D)
- return qFskCompare(qVariantValue<QVector2D>(v1), qVariantValue<QVector2D>(v2));
- else if (v1.type() == QVariant::Vector3D)
- return qFskCompare(qVariantValue<QVector3D>(v1), qVariantValue<QVector3D>(v2));
- else
- return v1 == v2;
- }
- }
- }
- return true;
-}
-
-int QGLSection::appendOne(const QLogicalVertex &lv)
-{
-#ifndef QT_NO_DEBUG_STREAM
- if (count() && lv.fields() != fields())
- {
- qDebug() << "Warning: adding" << lv << "fields:" << lv.fields()
- << "fields do not match existing:" << fields()
- << "create new section first?";
- }
-#endif
- int index = appendVertex(lv);
- d->mapVertex(lv.vertex(), index);
- appendIndex(index);
- return index;
-}
-
-/*!
- \internal
- Adds the logical vertex \a lv to this section of a builder.
-
- Two QLogicalVertex instances a and b are treated as being duplicates for
- the purpose of smoothing, if \c{qFuzzyCompare(a.vertex(), b.vertex())} is
- true
-
- All duplicate occurrences of a vertex are coalesced, that is replaced
- by a GL index referencing the one copy.
-
- In order to draw \a lv as part of a smooth continuous surface, with
- no distinct edge, duplicates of vertex \a lv are coalesced into one
- (within this section) and the normal for that one set to the average of
- the incoming unique normals.
-
- The incoming vertex \a lv is not treated as a duplicate if \a lv has
- different texture coordinates or attributes. This occurs for example
- in the case of a texture seam, where two different texture coordinates
- are required at the same point on the geometry.
-
- In that case a new duplicate vertex is added to carry the unique
- texture coordinates or attributes. When new vertex copies are added in
- this way all copies receive the averaged normals.
-
- Call this function to add the vertices of a smooth face to the section
- of a builder, or use:
-
- \code
- myDisplayList->newSection(QGLBuilder::Smooth);
- myDisplayList->addTriangle(a, b, c);
- \endcode
-
- In smooth surfaces, the vertex and its normal is only sent to the
- graphics hardware once (not once per face), thus smooth geometry may
- consume fewer resources.
-
- \sa appendFaceted(), updateTexCoord(), QGLBuilder::newSection()
-*/
-void QGLSection::appendSmooth(const QLogicalVertex &lv)
-{
- Q_ASSERT(lv.hasField(QGL::Position));
- Q_ASSERT(lv.hasField(QGL::Normal));
-
- int found_index = d->findVertex(lv.vertex());
- bool coalesce = false;
- if (found_index == -1)
- {
- int newIndex = appendOne(lv);
- d->accumulateNormal(newIndex, lv.normal());
- }
- else
- {
- while (!coalesce && found_index != -1)
- {
- if (qCompareByAttributes(lv, logicalVertexAt(found_index)))
- coalesce = true;
- else
- found_index = d->nextIndex();
- }
- if (!coalesce) // texture or attributes prevented coalesce
- {
- // new vert to carry tex/attrib data
- d->accumulateNormal(appendOne(lv), lv.normal());
- }
- else
- {
- appendIndex(found_index);
- while (found_index != -1)
- {
- if (!d->normalAccumulated(found_index, lv.normal()))
- {
- normal(found_index) += lv.normal();
- d->accumulateNormal(found_index, lv.normal());
- }
- found_index = d->nextIndex();
- }
- }
- }
-}
-
-
-void QGLSection::appendSmooth(const QLogicalVertex &lv, int index)
-{
- Q_ASSERT(lv.hasField(QGL::Position));
- Q_ASSERT(lv.hasField(QGL::Normal));
-
- int found_index = -1;
- QMap<int, int>::const_iterator it = d->index_map.constFind(index);
- if (it != d->index_map.constEnd())
- found_index = it.value();
- if (found_index == -1)
- {
- int newIndex = appendVertex(lv);
- d->index_map.insert(index, newIndex);
- appendIndex(newIndex);
- d->accumulateNormal(newIndex, lv.normal());
- }
- else
- {
- appendIndex(found_index);
- if (!d->normalAccumulated(found_index, lv.normal()))
- {
- normal(found_index) += lv.normal();
- d->accumulateNormal(found_index, lv.normal());
- }
- }
-}
-
-/*!
- \internal
- Add the logical vertex \a lv to this section of a builder.
-
- The vertex will be drawn as a distinct edge, instead of just part of a
- continuous smooth surface. To acheive this the vertex value of \a lv
- is duplicated for each unique normal in the current section.
-
- Note that duplication is only for unique normals: if a vertex is already
- present with a given normal it is coalesced and simply referenced by index.
- As for appendSmooth() vertices are not coalesced in this way if \a lv
- has a different texture coordinate or attribute than its duplicate.
-
- In faceted surfaces, the vertex is sent to the graphics hardware once for
- each normal it has, and thus may consume more resources.
-
- \sa appendSmooth(), updateTexCoord(), QGLBuilder::newSection()
-*/
-void QGLSection::appendFaceted(const QLogicalVertex &lv)
-{
- Q_ASSERT(lv.hasField(QGL::Position));
- int found_index = d->findVertex(lv.vertex());
- bool coalesce = false;
- while (!coalesce && found_index != -1)
- {
- if (logicalVertexAt(found_index) == lv)
- coalesce = true;
- else
- found_index = d->nextIndex();
- }
- if (coalesce) // found
- {
- appendIndex(found_index);
- }
- else
- {
- appendOne(lv);
- }
-}
-
-/*!
- \internal
- Returns the current map threshold for this section. The threshold is the
- point at which the section switches from using a plain QArray - with
- linear performance ie O(n) - to using a QMap - with approx O(log n). These
- structures are used for looking up vertices during the index generation and
- normals calculation.
-
- The default value is 50.
-
- \sa setMapThreshold()
-*/
-int QGLSection::mapThreshold() const
-{
- return d->map_threshold;
-}
-
-/*!
- \internal
- Sets the current map threshold to \a t for this section.
-
- \sa mapThreshold()
-*/
-void QGLSection::setMapThreshold(int t)
-{
- d->map_threshold = t;
-}
-
-/*!
- \internal
- Returns a list of the QGLSceneNode instances associated with this section.
-*/
-QList<QGLSceneNode*> QGLSection::nodes() const
-{
- return d->nodes;
-}
-
-/*!
- \internal
- Adds the \a node to the list of QGLSceneNode instances associated with
- this section.
-*/
-void QGLSection::addNode(QGLSceneNode *node)
-{
- d->nodes.append(node);
-}
-
-/*!
- \internal
- Deletes the \a node from the list of QGLSceneNode instances associated
- with this section. Returns true if the \a node was found, false
- otherwise.
-*/
-bool QGLSection::deleteNode(QGLSceneNode *node)
-{
- int ix = d->nodes.indexOf(node);
- if (ix != -1)
- {
- d->nodes.removeAt(ix);
- return true;
- }
- return false;
-}
-
-#ifndef QT_NO_DEBUG_STREAM
-/*!
- \internal
- Output a string representation of \a section to a debug stream \a dbg.
- \relates QGLSection
-*/
-QDebug operator<<(QDebug dbg, const QGLSection &section)
-{
- dbg.space()
- << "QGLSection(" << &section
- << "- count:" << section.count()
- << "- smoothing mode:" << (section.smoothing() == QGL::Smooth ?
- "QGL::Smooth" : "QGL::Faceted") << "\n";
- QGL::IndexArray indices = section.indices();
- for (int i = 0; i < section.count(); ++i)
- {
- int ix = indices[i];
- dbg << section.logicalVertexAt(ix) << "\n";
- }
- dbg << ")\n";
- return dbg.space();
-}
-#endif
-
-QT_END_NAMESPACE
diff --git a/src/threed/geometry/qglsection_p.h b/src/threed/geometry/qglsection_p.h
deleted file mode 100644
index 8d6847ac..00000000
--- a/src/threed/geometry/qglsection_p.h
+++ /dev/null
@@ -1,131 +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 QGLSECTION_H
-#define QGLSECTION_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 "qglpainter.h"
-#include "qlogicalvertex.h"
-#include "qbox3d.h"
-#include "qglnamespace.h"
-
-#include <QtOpenGL/qgl.h>
-#include <QtGui/qmatrix4x4.h>
-
-QT_BEGIN_NAMESPACE
-
-class QGLPainter;
-class QGLBuilder;
-class QGLSectionPrivate;
-class QGeometryData;
-class QGLSceneNode;
-
-class Q_QT3D_EXPORT QGLSection : public QGeometryData
-{
-public:
- QGLSection(QGLBuilder *d, QGL::Smoothing sm = QGL::Smooth);
- ~QGLSection();
-
- void reserve(int amount);
-
- void append(const QLogicalVertex &lv);
- void append(const QLogicalVertex &a, const QLogicalVertex &b, const QLogicalVertex &c);
- void appendSmooth(const QLogicalVertex &lv);
- void appendSmooth(const QLogicalVertex &lv, int index);
- void appendSmooth(const QLogicalVertex &a, const QLogicalVertex &b, const QLogicalVertex &c)
- {
- appendSmooth(a);
- appendSmooth(b);
- appendSmooth(c);
- }
- void appendFaceted(const QLogicalVertex &lv);
- void appendFaceted(const QLogicalVertex &a, const QLogicalVertex &b, const QLogicalVertex &c)
- {
- appendFaceted(a);
- appendFaceted(b);
- appendFaceted(c);
- }
-
- inline QGL::Smoothing smoothing() const;
- inline void setSmoothing(QGL::Smoothing s);
- int mapThreshold() const;
- void setMapThreshold(int);
- QList<QGLSceneNode*> nodes() const;
- void addNode(QGLSceneNode *node);
- bool deleteNode(QGLSceneNode *node);
-private:
- Q_DISABLE_COPY(QGLSection);
- friend class QGLBuilder;
-
- int appendOne(const QLogicalVertex &vertex);
-
- QGL::Smoothing m_smoothing;
- QGLSectionPrivate *d;
-};
-
-inline QGL::Smoothing QGLSection::smoothing() const
-{
- return m_smoothing;
-}
-
-inline void QGLSection::setSmoothing(QGL::Smoothing s)
-{
- m_smoothing = s;
-}
-
-#ifndef QT_NO_DEBUG_STREAM
-QDebug operator<<(QDebug dbg, const QGLSection &section);
-#endif
-
-QT_END_NAMESPACE
-
-#endif // QGLSECTION_H
diff --git a/src/threed/geometry/qglsphere.cpp b/src/threed/geometry/qglsphere.cpp
deleted file mode 100644
index f3b3856b..00000000
--- a/src/threed/geometry/qglsphere.cpp
+++ /dev/null
@@ -1,243 +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 "qglsphere.h"
-#include "qglbuilder.h"
-#include <QtCore/qmath.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGLSphere
- \brief The QGLSphere class represents the geometry of a simple sphere in 3D space.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::geometry
-
- The following example creates a sphere of 2 units in diameter and
- draws it at (10, 25, 0) in a QGLPainter:
-
- \code
- QGLBuilder builder;
- builder << QGLSphere(2);
- QGLSceneNode *node = builder.finalizedSceneNode();
-
- painter.translate(10, 25, 0);
- node->draw(&painter);
- \endcode
-
- The QGLSphere class specifies positions, normals and 2D texture
- co-ordinates for all of the vertices that make up the sphere.
-
- The texture co-ordinates are fixed at construction time. This
- is because constructing the sphere can involve generating additional
- vertices which need to interpolate the texture co-ordinates of their
- neighboring vertices.
-
- The default mode of QGLSphere is a "UV sphere", which divides the
- sphere up into longitudinal and latitudinal sections. The longitudinal
- slices meet at the poles, which in a single unit sphere are defined to
- be at (0, 0, +0.5) and (0, 0, -0.5). This choice is the simplest to
- texture map as the texture will only distort along the x-axis of the
- 2D texture. However the density of vertices is significantly higher at
- the poles than it is elsewhere on the sphere and is a poor choice if a
- uniform density of pixels from the texture map is required.
-
- \sa QGLBuilder
-*/
-
-/*!
- \fn QGLSphere::QGLSphere(qreal diameter, int depth)
-
- Creates a sphere of \a diameter across (default is 1). When the sphere
- is recursively subdivided into triangles, it will be subdivided no more
- than \a depth times (between 1 and 10, default is 5).
-*/
-
-/*!
- Destroys this sphere object.
-*/
-QGLSphere::~QGLSphere()
-{
-}
-
-/*!
- \fn qreal QGLSphere::diameter() const
-
- Returns the diameter of this sphere. The default is 1.
-
- \sa setDiameter()
-*/
-
-/*!
- \fn void QGLSphere::setDiameter(qreal diameter)
-
- Sets the diameter of this sphere to \a diameter.
-
- \sa diameter()
-*/
-
-/*!
- \fn int QGLSphere::subdivisionDepth() const
-
- Returns the maximum depth when this sphere is subdivided into triangles.
- The default is 5. The following picture shows the effect of depth
- values between 1 and 10 for a UV sphere:
-
- \image sphere-detail.png
-
- \table
- \header \o Level of Detail \o Number of Triangles
- \row \o 1 \o 64
- \row \o 2 \o 128
- \row \o 3 \o 256
- \row \o 4 \o 512
- \row \o 5 \o 1024
- \row \o 6 \o 2048
- \row \o 7 \o 4096
- \row \o 8 \o 8192
- \row \o 9 \o 16384
- \row \o 10 \o 32768
- \endtable
-
- \sa setSubdivisionDepth()
-*/
-
-/*!
- \fn void QGLSphere::setSubdivisionDepth(int depth)
-
- Sets the maximum \a depth when this sphere is subdivided into triangles.
-
- \sa subdivisionDepth()
-*/
-
-/*!
- \relates QGLSphere
-
- Builds the geometry for \a sphere within the specified
- geometry \a builder.
-*/
-QGLBuilder& operator<<(QGLBuilder& builder, const QGLSphere& sphere)
-{
- qreal radius = sphere.diameter() / 2.0f;
-
- // Determine the number of slices and stacks to generate.
- static int const slicesAndStacks[] = {
- 8, 4,
- 8, 8,
- 16, 8,
- 16, 16,
- 32, 16,
- 32, 32,
- 64, 32,
- 64, 64,
- 128, 64,
- 128, 128
- };
- int divisions = sphere.subdivisionDepth();
- if (divisions < 1)
- divisions = 1;
- else if (divisions > 10)
- divisions = 10;
- int stacks = slicesAndStacks[divisions * 2 - 1];
- int slices = slicesAndStacks[divisions * 2 - 2];
-
- // Precompute sin/cos values for the slices and stacks.
- const int maxSlices = 128 + 1;
- const int maxStacks = 128 + 1;
- qreal sliceSin[maxSlices];
- qreal sliceCos[maxSlices];
- qreal stackSin[maxStacks];
- qreal stackCos[maxStacks];
- for (int slice = 0; slice < slices; ++slice) {
- qreal angle = 2 * M_PI * slice / slices;
- sliceSin[slice] = qFastSin(angle);
- sliceCos[slice] = qFastCos(angle);
- }
- sliceSin[slices] = sliceSin[0]; // Join first and last slice.
- sliceCos[slices] = sliceCos[0];
- for (int stack = 0; stack <= stacks; ++stack) {
- qreal angle = M_PI * stack / stacks;
- stackSin[stack] = qFastSin(angle);
- stackCos[stack] = qFastCos(angle);
- }
- stackSin[0] = 0.0f; // Come to a point at the poles.
- stackSin[stacks] = 0.0f;
-
- // Create the stacks.
- for (int stack = 0; stack < stacks; ++stack) {
- QGeometryData prim;
- qreal z = radius * stackCos[stack];
- qreal nextz = radius * stackCos[stack + 1];
- qreal s = stackSin[stack];
- qreal nexts = stackSin[stack + 1];
- qreal c = stackCos[stack];
- qreal nextc = stackCos[stack + 1];
- qreal r = radius * s;
- qreal nextr = radius * nexts;
- for (int slice = 0; slice <= slices; ++slice) {
- prim.appendVertex
- (QVector3D(nextr * sliceSin[slice],
- nextr * sliceCos[slice], nextz));
- prim.appendNormal
- (QVector3D(sliceSin[slice] * nexts,
- sliceCos[slice] * nexts, nextc));
- prim.appendTexCoord
- (QVector2D(1.0f - qreal(slice) / slices,
- 1.0f - qreal(stack + 1) / stacks));
-
- prim.appendVertex
- (QVector3D(r * sliceSin[slice],
- r * sliceCos[slice], z));
- prim.appendNormal
- (QVector3D(sliceSin[slice] * s,
- sliceCos[slice] * s, c));
- prim.appendTexCoord
- (QVector2D(1.0f - qreal(slice) / slices,
- 1.0f - qreal(stack) / stacks));
- }
- builder.addQuadStrip(prim);
- }
-
- return builder;
-}
-
-QT_END_NAMESPACE
diff --git a/src/threed/geometry/qglsphere.h b/src/threed/geometry/qglsphere.h
deleted file mode 100644
index aa4e6cd3..00000000
--- a/src/threed/geometry/qglsphere.h
+++ /dev/null
@@ -1,79 +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 QGLSPHERE_H
-#define QGLSPHERE_H
-
-#include "qt3dglobal.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class QGLBuilder;
-
-class Q_QT3D_EXPORT QGLSphere
-{
-public:
- explicit QGLSphere(qreal diameter = 1.0f, int depth = 5)
- : m_diameter(diameter), m_subdivisionDepth(depth) {}
- virtual ~QGLSphere();
-
- qreal diameter() const { return m_diameter; }
- void setDiameter(qreal diameter) { m_diameter = diameter; }
-
- int subdivisionDepth() const { return m_subdivisionDepth; }
- void setSubdivisionDepth(int depth) { m_subdivisionDepth = depth; }
-
-private:
- qreal m_diameter;
- int m_subdivisionDepth;
-};
-
-Q_QT3D_EXPORT QGLBuilder& operator<<(QGLBuilder& builder, const QGLSphere& sphere);
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/geometry/qglteapot.cpp b/src/threed/geometry/qglteapot.cpp
deleted file mode 100644
index 175c6e9b..00000000
--- a/src/threed/geometry/qglteapot.cpp
+++ /dev/null
@@ -1,104 +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 "qglteapot.h"
-#include "qglteapot_data_p.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGLTeapot
- \brief The QGLTeapot class represents a 3D teapot object.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::geometry
-
- The classic 3D "Utah Teapot" was originally drawn by Martin Newell
- in 1975. The vertex data was made publicly available by him and
- it has been a standard 3D test object ever since.
-
- For more information on the history of the "Utah Teapot", see
- Wikipedia, http://en.wikipedia.org/wiki/Utah_teapot.
-
- The following example code uses QGLTeapot to draw a teapot of size
- 0.5 at the origin:
-
- \code
- QGLBuilder builder;
- builder << QGLTeapot();
- teapot = builder.finalizedSceneNode();
-
- painter.modelViewMatrix().scale(0.5f);
- teapot->draw(painter);
- \endcode
-
- The QGLTeapot object contains a lot of vertex data once it has
- been subdivided into triangles. It is recommended that instances
- of this class be created at startup, added to a QGLBuilder,
- and then the finalized scene node can be reused over and over.
-
- \sa QGLBezierPatches
-*/
-
-/*!
- Constructs a new 3D teapot geometry object.
-*/
-QGLTeapot::QGLTeapot()
-{
- QVector3DArray positions;
- for (int pindex = 0; pindex < teapotPatchCount * 16; ++pindex) {
- int vindex = teapotPatchData[pindex];
- positions.append(teapotBezierVertexData[vindex * 3],
- teapotBezierVertexData[vindex * 3 + 1],
- teapotBezierVertexData[vindex * 3 + 2]);
- }
- setPositions(positions);
- setSubdivisionDepth(teapotDepth);
-}
-
-/*!
- Destroys this teapot geometry object.
-*/
-QGLTeapot::~QGLTeapot()
-{
-}
-
-QT_END_NAMESPACE
diff --git a/src/threed/geometry/qglteapot.h b/src/threed/geometry/qglteapot.h
deleted file mode 100644
index 904e4910..00000000
--- a/src/threed/geometry/qglteapot.h
+++ /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 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 QGLTEAPOT_H
-#define QGLTEAPOT_H
-
-#include "qglbezierpatches.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class Q_QT3D_EXPORT QGLTeapot : public QGLBezierPatches
-{
-public:
- QGLTeapot();
- ~QGLTeapot();
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/geometry/qglteapot_data_p.h b/src/threed/geometry/qglteapot_data_p.h
deleted file mode 100644
index 56554822..00000000
--- a/src/threed/geometry/qglteapot_data_p.h
+++ /dev/null
@@ -1,408 +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 QGLTEAPOT_DATA_P_H
-#define QGLTEAPOT_DATA_P_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 "qglbezierpatches.h"
-
-// Generated from teapot.txt by meshcvt, depth = 4
-
-#define teapotBezierVertexCount 306
-#define teapotBezierVertexStride 3
-#define teapotPatchCount 32
-#define teapotDepth 4
-static float const teapotBezierVertexData[] = {
- 0.700000f, 0.450000f, -0.000000f,
- 0.700000f, 0.450000f, 0.392000f,
- 0.392000f, 0.450000f, 0.700000f,
- 0.000000f, 0.450000f, 0.700000f,
- 0.668750f, 0.515625f, -0.000000f,
- 0.668750f, 0.515625f, 0.374500f,
- 0.374500f, 0.515625f, 0.668750f,
- 0.000000f, 0.515625f, 0.668750f,
- 0.718750f, 0.515625f, -0.000000f,
- 0.718750f, 0.515625f, 0.402500f,
- 0.402500f, 0.515625f, 0.718750f,
- 0.000000f, 0.515625f, 0.718750f,
- 0.750000f, 0.450000f, -0.000000f,
- 0.750000f, 0.450000f, 0.420000f,
- 0.420000f, 0.450000f, 0.750000f,
- 0.000000f, 0.450000f, 0.750000f,
- -0.392000f, 0.450000f, 0.700000f,
- -0.700000f, 0.450000f, 0.392000f,
- -0.700000f, 0.450000f, -0.000000f,
- -0.374500f, 0.515625f, 0.668750f,
- -0.668750f, 0.515625f, 0.374500f,
- -0.668750f, 0.515625f, -0.000000f,
- -0.402500f, 0.515625f, 0.718750f,
- -0.718750f, 0.515625f, 0.402500f,
- -0.718750f, 0.515625f, -0.000000f,
- -0.420000f, 0.450000f, 0.750000f,
- -0.750000f, 0.450000f, 0.420000f,
- -0.750000f, 0.450000f, -0.000000f,
- -0.700000f, 0.450000f, -0.392000f,
- -0.392000f, 0.450000f, -0.700000f,
- 0.000000f, 0.450000f, -0.700000f,
- -0.668750f, 0.515625f, -0.374500f,
- -0.374500f, 0.515625f, -0.668750f,
- 0.000000f, 0.515625f, -0.668750f,
- -0.718750f, 0.515625f, -0.402500f,
- -0.402500f, 0.515625f, -0.718750f,
- 0.000000f, 0.515625f, -0.718750f,
- -0.750000f, 0.450000f, -0.420000f,
- -0.420000f, 0.450000f, -0.750000f,
- 0.000000f, 0.450000f, -0.750000f,
- 0.392000f, 0.450000f, -0.700000f,
- 0.700000f, 0.450000f, -0.392000f,
- 0.374500f, 0.515625f, -0.668750f,
- 0.668750f, 0.515625f, -0.374500f,
- 0.402500f, 0.515625f, -0.718750f,
- 0.718750f, 0.515625f, -0.402500f,
- 0.420000f, 0.450000f, -0.750000f,
- 0.750000f, 0.450000f, -0.420000f,
- 0.875000f, 0.187500f, -0.000000f,
- 0.875000f, 0.187500f, 0.490000f,
- 0.490000f, 0.187500f, 0.875000f,
- 0.000000f, 0.187500f, 0.875000f,
- 1.000000f, -0.075000f, -0.000000f,
- 1.000000f, -0.075000f, 0.560000f,
- 0.560000f, -0.075000f, 1.000000f,
- 0.000000f, -0.075000f, 1.000000f,
- 1.000000f, -0.300000f, -0.000000f,
- 1.000000f, -0.300000f, 0.560000f,
- 0.560000f, -0.300000f, 1.000000f,
- 0.000000f, -0.300000f, 1.000000f,
- -0.490000f, 0.187500f, 0.875000f,
- -0.875000f, 0.187500f, 0.490000f,
- -0.875000f, 0.187500f, -0.000000f,
- -0.560000f, -0.075000f, 1.000000f,
- -1.000000f, -0.075000f, 0.560000f,
- -1.000000f, -0.075000f, -0.000000f,
- -0.560000f, -0.300000f, 1.000000f,
- -1.000000f, -0.300000f, 0.560000f,
- -1.000000f, -0.300000f, -0.000000f,
- -0.875000f, 0.187500f, -0.490000f,
- -0.490000f, 0.187500f, -0.875000f,
- 0.000000f, 0.187500f, -0.875000f,
- -1.000000f, -0.075000f, -0.560000f,
- -0.560000f, -0.075000f, -1.000000f,
- 0.000000f, -0.075000f, -1.000000f,
- -1.000000f, -0.300000f, -0.560000f,
- -0.560000f, -0.300000f, -1.000000f,
- 0.000000f, -0.300000f, -1.000000f,
- 0.490000f, 0.187500f, -0.875000f,
- 0.875000f, 0.187500f, -0.490000f,
- 0.560000f, -0.075000f, -1.000000f,
- 1.000000f, -0.075000f, -0.560000f,
- 0.560000f, -0.300000f, -1.000000f,
- 1.000000f, -0.300000f, -0.560000f,
- 1.000000f, -0.525000f, -0.000000f,
- 1.000000f, -0.525000f, 0.560000f,
- 0.560000f, -0.525000f, 1.000000f,
- 0.000000f, -0.525000f, 1.000000f,
- 0.750000f, -0.637500f, -0.000000f,
- 0.750000f, -0.637500f, 0.420000f,
- 0.420000f, -0.637500f, 0.750000f,
- 0.000000f, -0.637500f, 0.750000f,
- 0.750000f, -0.675000f, -0.000000f,
- 0.750000f, -0.675000f, 0.420000f,
- 0.420000f, -0.675000f, 0.750000f,
- 0.000000f, -0.675000f, 0.750000f,
- -0.560000f, -0.525000f, 1.000000f,
- -1.000000f, -0.525000f, 0.560000f,
- -1.000000f, -0.525000f, -0.000000f,
- -0.420000f, -0.637500f, 0.750000f,
- -0.750000f, -0.637500f, 0.420000f,
- -0.750000f, -0.637500f, -0.000000f,
- -0.420000f, -0.675000f, 0.750000f,
- -0.750000f, -0.675000f, 0.420000f,
- -0.750000f, -0.675000f, -0.000000f,
- -1.000000f, -0.525000f, -0.560000f,
- -0.560000f, -0.525000f, -1.000000f,
- 0.000000f, -0.525000f, -1.000000f,
- -0.750000f, -0.637500f, -0.420000f,
- -0.420000f, -0.637500f, -0.750000f,
- 0.000000f, -0.637500f, -0.750000f,
- -0.750000f, -0.675000f, -0.420000f,
- -0.420000f, -0.675000f, -0.750000f,
- 0.000000f, -0.675000f, -0.750000f,
- 0.560000f, -0.525000f, -1.000000f,
- 1.000000f, -0.525000f, -0.560000f,
- 0.420000f, -0.637500f, -0.750000f,
- 0.750000f, -0.637500f, -0.420000f,
- 0.420000f, -0.675000f, -0.750000f,
- 0.750000f, -0.675000f, -0.420000f,
- -0.800000f, 0.262500f, -0.000000f,
- -0.800000f, 0.262500f, 0.150000f,
- -0.750000f, 0.375000f, 0.150000f,
- -0.750000f, 0.375000f, -0.000000f,
- -1.150000f, 0.262500f, -0.000000f,
- -1.150000f, 0.262500f, 0.150000f,
- -1.250000f, 0.375000f, 0.150000f,
- -1.250000f, 0.375000f, -0.000000f,
- -1.350000f, 0.262500f, -0.000000f,
- -1.350000f, 0.262500f, 0.150000f,
- -1.500000f, 0.375000f, 0.150000f,
- -1.500000f, 0.375000f, -0.000000f,
- -1.350000f, 0.150000f, -0.000000f,
- -1.350000f, 0.150000f, 0.150000f,
- -1.500000f, 0.150000f, 0.150000f,
- -1.500000f, 0.150000f, -0.000000f,
- -0.750000f, 0.375000f, -0.150000f,
- -0.800000f, 0.262500f, -0.150000f,
- -1.250000f, 0.375000f, -0.150000f,
- -1.150000f, 0.262500f, -0.150000f,
- -1.500000f, 0.375000f, -0.150000f,
- -1.350000f, 0.262500f, -0.150000f,
- -1.500000f, 0.150000f, -0.150000f,
- -1.350000f, 0.150000f, -0.150000f,
- -1.350000f, 0.037500f, -0.000000f,
- -1.350000f, 0.037500f, 0.150000f,
- -1.500000f, -0.075000f, 0.150000f,
- -1.500000f, -0.075000f, -0.000000f,
- -1.250000f, -0.187500f, -0.000000f,
- -1.250000f, -0.187500f, 0.150000f,
- -1.325000f, -0.281250f, 0.150000f,
- -1.325000f, -0.281250f, -0.000000f,
- -1.000000f, -0.300000f, 0.150000f,
- -0.950000f, -0.450000f, 0.150000f,
- -0.950000f, -0.450000f, -0.000000f,
- -1.500000f, -0.075000f, -0.150000f,
- -1.350000f, 0.037500f, -0.150000f,
- -1.325000f, -0.281250f, -0.150000f,
- -1.250000f, -0.187500f, -0.150000f,
- -0.950000f, -0.450000f, -0.150000f,
- -1.000000f, -0.300000f, -0.150000f,
- 0.850000f, -0.037500f, -0.000000f,
- 0.850000f, -0.037500f, 0.330000f,
- 0.850000f, -0.450000f, 0.330000f,
- 0.850000f, -0.450000f, -0.000000f,
- 1.300000f, -0.037500f, -0.000000f,
- 1.300000f, -0.037500f, 0.330000f,
- 1.550000f, -0.337500f, 0.330000f,
- 1.550000f, -0.337500f, -0.000000f,
- 1.150000f, 0.300000f, -0.000000f,
- 1.150000f, 0.300000f, 0.125000f,
- 1.200000f, 0.262500f, 0.125000f,
- 1.200000f, 0.262500f, -0.000000f,
- 1.350000f, 0.450000f, -0.000000f,
- 1.350000f, 0.450000f, 0.125000f,
- 1.650000f, 0.450000f, 0.125000f,
- 1.650000f, 0.450000f, -0.000000f,
- 0.850000f, -0.450000f, -0.330000f,
- 0.850000f, -0.037500f, -0.330000f,
- 1.550000f, -0.337500f, -0.330000f,
- 1.300000f, -0.037500f, -0.330000f,
- 1.200000f, 0.262500f, -0.125000f,
- 1.150000f, 0.300000f, -0.125000f,
- 1.650000f, 0.450000f, -0.125000f,
- 1.350000f, 0.450000f, -0.125000f,
- 1.400000f, 0.487500f, -0.000000f,
- 1.400000f, 0.487500f, 0.125000f,
- 1.762500f, 0.496875f, 0.125000f,
- 1.762500f, 0.496875f, -0.000000f,
- 1.450000f, 0.487500f, -0.000000f,
- 1.450000f, 0.487500f, 0.075000f,
- 1.725000f, 0.506250f, 0.075000f,
- 1.725000f, 0.506250f, -0.000000f,
- 1.400000f, 0.450000f, -0.000000f,
- 1.400000f, 0.450000f, 0.075000f,
- 1.600000f, 0.450000f, 0.075000f,
- 1.600000f, 0.450000f, -0.000000f,
- 1.762500f, 0.496875f, -0.125000f,
- 1.400000f, 0.487500f, -0.125000f,
- 1.725000f, 0.506250f, -0.075000f,
- 1.450000f, 0.487500f, -0.075000f,
- 1.600000f, 0.450000f, -0.075000f,
- 1.400000f, 0.450000f, -0.075000f,
- 0.000000f, 0.825000f, -0.000000f,
- 0.000000f, 0.825000f, 0.001000f,
- 0.001000f, 0.825000f, -0.000000f,
- 0.400000f, 0.825000f, -0.000000f,
- 0.400000f, 0.825000f, 0.225000f,
- 0.225000f, 0.825000f, 0.400000f,
- 0.000000f, 0.825000f, 0.400000f,
- 0.000000f, 0.675000f, -0.000000f,
- 0.100000f, 0.600000f, -0.000000f,
- 0.100000f, 0.600000f, 0.056000f,
- 0.056000f, 0.600000f, 0.100000f,
- 0.000000f, 0.600000f, 0.100000f,
- -0.001000f, 0.825000f, -0.000000f,
- -0.225000f, 0.825000f, 0.400000f,
- -0.400000f, 0.825000f, 0.225000f,
- -0.400000f, 0.825000f, -0.000000f,
- -0.056000f, 0.600000f, 0.100000f,
- -0.100000f, 0.600000f, 0.056000f,
- -0.100000f, 0.600000f, -0.000000f,
- 0.000000f, 0.825000f, -0.001000f,
- -0.400000f, 0.825000f, -0.225000f,
- -0.225000f, 0.825000f, -0.400000f,
- 0.000000f, 0.825000f, -0.400000f,
- -0.100000f, 0.600000f, -0.056000f,
- -0.056000f, 0.600000f, -0.100000f,
- 0.000000f, 0.600000f, -0.100000f,
- 0.225000f, 0.825000f, -0.400000f,
- 0.400000f, 0.825000f, -0.225000f,
- 0.056000f, 0.600000f, -0.100000f,
- 0.100000f, 0.600000f, -0.056000f,
- 0.200000f, 0.525000f, -0.000000f,
- 0.200000f, 0.525000f, 0.112000f,
- 0.112000f, 0.525000f, 0.200000f,
- 0.000000f, 0.525000f, 0.200000f,
- 0.650000f, 0.525000f, -0.000000f,
- 0.650000f, 0.525000f, 0.364000f,
- 0.364000f, 0.525000f, 0.650000f,
- 0.000000f, 0.525000f, 0.650000f,
- 0.650000f, 0.450000f, -0.000000f,
- 0.650000f, 0.450000f, 0.364000f,
- 0.364000f, 0.450000f, 0.650000f,
- 0.000000f, 0.450000f, 0.650000f,
- -0.112000f, 0.525000f, 0.200000f,
- -0.200000f, 0.525000f, 0.112000f,
- -0.200000f, 0.525000f, -0.000000f,
- -0.364000f, 0.525000f, 0.650000f,
- -0.650000f, 0.525000f, 0.364000f,
- -0.650000f, 0.525000f, -0.000000f,
- -0.364000f, 0.450000f, 0.650000f,
- -0.650000f, 0.450000f, 0.364000f,
- -0.650000f, 0.450000f, -0.000000f,
- -0.200000f, 0.525000f, -0.112000f,
- -0.112000f, 0.525000f, -0.200000f,
- 0.000000f, 0.525000f, -0.200000f,
- -0.650000f, 0.525000f, -0.364000f,
- -0.364000f, 0.525000f, -0.650000f,
- 0.000000f, 0.525000f, -0.650000f,
- -0.650000f, 0.450000f, -0.364000f,
- -0.364000f, 0.450000f, -0.650000f,
- 0.000000f, 0.450000f, -0.650000f,
- 0.112000f, 0.525000f, -0.200000f,
- 0.200000f, 0.525000f, -0.112000f,
- 0.364000f, 0.525000f, -0.650000f,
- 0.650000f, 0.525000f, -0.364000f,
- 0.364000f, 0.450000f, -0.650000f,
- 0.650000f, 0.450000f, -0.364000f,
- 0.000000f, -0.750000f, -0.000000f,
- 0.750000f, -0.675000f, -0.000000f,
- 0.750000f, -0.675000f, -0.420000f,
- 0.420000f, -0.675000f, -0.750000f,
- 0.000000f, -0.675000f, -0.750000f,
- 0.750000f, -0.712500f, -0.000000f,
- 0.750000f, -0.712500f, -0.420000f,
- 0.420000f, -0.712500f, -0.750000f,
- 0.000000f, -0.712500f, -0.750000f,
- 0.712500f, -0.750000f, -0.000000f,
- 0.712500f, -0.750000f, -0.399000f,
- 0.399000f, -0.750000f, -0.712500f,
- 0.000000f, -0.750000f, -0.712500f,
- -0.420000f, -0.675000f, -0.750000f,
- -0.750000f, -0.675000f, -0.420000f,
- -0.750000f, -0.675000f, -0.000000f,
- -0.420000f, -0.712500f, -0.750000f,
- -0.750000f, -0.712500f, -0.420000f,
- -0.750000f, -0.712500f, -0.000000f,
- -0.399000f, -0.750000f, -0.712500f,
- -0.712500f, -0.750000f, -0.399000f,
- -0.712500f, -0.750000f, -0.000000f,
- -0.750000f, -0.675000f, 0.420000f,
- -0.420000f, -0.675000f, 0.750000f,
- 0.000000f, -0.675000f, 0.750000f,
- -0.750000f, -0.712500f, 0.420000f,
- -0.420000f, -0.712500f, 0.750000f,
- 0.000000f, -0.712500f, 0.750000f,
- -0.712500f, -0.750000f, 0.399000f,
- -0.399000f, -0.750000f, 0.712500f,
- 0.000000f, -0.750000f, 0.712500f,
- 0.420000f, -0.675000f, 0.750000f,
- 0.750000f, -0.675000f, 0.420000f,
- 0.420000f, -0.712500f, 0.750000f,
- 0.750000f, -0.712500f, 0.420000f,
- 0.399000f, -0.750000f, 0.712500f,
- 0.712500f, -0.750000f, 0.399000f
-};
-
-static ushort const teapotPatchData[] = {
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
- 3, 16, 17, 18, 7, 19, 20, 21, 11, 22, 23, 24, 15, 25, 26, 27,
- 18, 28, 29, 30, 21, 31, 32, 33, 24, 34, 35, 36, 27, 37, 38, 39,
- 30, 40, 41, 0, 33, 42, 43, 4, 36, 44, 45, 8, 39, 46, 47, 12,
- 12, 13, 14, 15, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
- 15, 25, 26, 27, 51, 60, 61, 62, 55, 63, 64, 65, 59, 66, 67, 68,
- 27, 37, 38, 39, 62, 69, 70, 71, 65, 72, 73, 74, 68, 75, 76, 77,
- 39, 46, 47, 12, 71, 78, 79, 48, 74, 80, 81, 52, 77, 82, 83, 56,
- 56, 57, 58, 59, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
- 59, 66, 67, 68, 87, 96, 97, 98, 91, 99, 100, 101, 95, 102, 103, 104,
- 68, 75, 76, 77, 98, 105, 106, 107, 101, 108, 109, 110, 104, 111, 112, 113,
- 77, 82, 83, 56, 107, 114, 115, 84, 110, 116, 117, 88, 113, 118, 119, 92,
- 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135,
- 123, 136, 137, 120, 127, 138, 139, 124, 131, 140, 141, 128, 135, 142, 143, 132,
- 132, 133, 134, 135, 144, 145, 146, 147, 148, 149, 150, 151, 68, 152, 153, 154,
- 135, 142, 143, 132, 147, 155, 156, 144, 151, 157, 158, 148, 154, 159, 160, 68,
- 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176,
- 164, 177, 178, 161, 168, 179, 180, 165, 172, 181, 182, 169, 176, 183, 184, 173,
- 173, 174, 175, 176, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196,
- 176, 183, 184, 173, 188, 197, 198, 185, 192, 199, 200, 189, 196, 201, 202, 193,
- 203, 203, 203, 203, 206, 207, 208, 209, 210, 210, 210, 210, 211, 212, 213, 214,
- 203, 203, 203, 203, 209, 216, 217, 218, 210, 210, 210, 210, 214, 219, 220, 221,
- 203, 203, 203, 203, 218, 223, 224, 225, 210, 210, 210, 210, 221, 226, 227, 228,
- 203, 203, 203, 203, 225, 229, 230, 206, 210, 210, 210, 210, 228, 231, 232, 211,
- 211, 212, 213, 214, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244,
- 214, 219, 220, 221, 236, 245, 246, 247, 240, 248, 249, 250, 244, 251, 252, 253,
- 221, 226, 227, 228, 247, 254, 255, 256, 250, 257, 258, 259, 253, 260, 261, 262,
- 228, 231, 232, 211, 256, 263, 264, 233, 259, 265, 266, 237, 262, 267, 268, 241,
- 269, 269, 269, 269, 278, 279, 280, 281, 274, 275, 276, 277, 270, 271, 272, 273,
- 269, 269, 269, 269, 281, 288, 289, 290, 277, 285, 286, 287, 273, 282, 283, 284,
- 269, 269, 269, 269, 290, 297, 298, 299, 287, 294, 295, 296, 284, 291, 292, 293,
- 269, 269, 269, 269, 299, 304, 305, 278, 296, 302, 303, 274, 293, 300, 301, 270
-};
-
-#endif
diff --git a/src/threed/geometry/qlogicalvertex.cpp b/src/threed/geometry/qlogicalvertex.cpp
deleted file mode 100644
index 84dc09ae..00000000
--- a/src/threed/geometry/qlogicalvertex.cpp
+++ /dev/null
@@ -1,420 +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 "qlogicalvertex.h"
-#include "qvector_utils_p.h"
-
-#include <QtCore/qdebug.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QLogicalVertex
- \brief The QLogicalVertex class references QGeometryData at a single vertex.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::geometry
-
- QLogicalVertex instances are a convenience class for use with
- QGeometryData. A QLogicalVertex simply references through to the data
- in a QGeometryData for a particular vertex, providing accessors to fetch
- position, texture coordinates, and other values.
-
- Create a QLogicalVertex referring to a particular QGeometryData instance:
- \code
- QGeometryData data;
- data.appendVertex(QVector3D(1, 2, 3));
-
- // construct a QLogicalVertex referring to the first vertex in data
- // the QGeometryData is implicitly shared with lv
- QLogicalVertex lv(data, 0);
- // lv.vertex() == QVector3D(1, 2, 3)
- \endcode
- This is inexpensive and no new storage is allocated for the actual data,
- just the reference and index.
-
- With logical vertices instances referencing large QGeometryData instances,
- avoid modifying the instance:
- \code
- // careful - assigning to a QLogicalVertex which refers to an external
- // QGeometryData will result in a possibly expensive copy-on-write
- lv.setVertex(3, 2, 1);
- \endcode
-
- Create a QLogicalVertex with its own QGeometryData internally:
- \code
- QLogicalVertex lv;
- // no copy on write here - internal QGeometryData is not shared
- lv.setVertex(1, 2, 3);
- \endcode
-
- Assign an instance of QLogicalVertex:
- \code
- QLogicalVertex lv2;
- lv2 = data.logicalVertexAt(0);
- \endcode
- Although lv2 gets its own internal QGeometryData which is then immediately
- thrown away by the assignment, because of lazy initialization in
- QGeometryData the cost is negligible.
-
- Use the fields() and hasField() functions to determine if a particular
- field is present in the vertex. Accessing non-existent data will cause
- an assert in debug mode (from the underlying QArray), and give
- undefined behaviour in release mode.
-
- \sa QGeometryData, QGLBuilder
-*/
-
-/*!
- \fn QLogicalVertex::QLogicalVertex()
- Constructs a new invalid QLogicalVertex which has no data.
-*/
-
-/*!
- \fn QLogicalVertex::QLogicalVertex(QGeometryData data, int index)
- Constructs a new QLogicalVertex referencing the \a data at \a index.
- Note that if this QLogicalVertex is modified, by calling vertex() or
- setNormal() for example, then a copy-on-write for \a data will be
- triggered.
-*/
-
-/*!
- \fn QLogicalVertex::QLogicalVertex(const QVector3D &a)
- Constructs a new QLogicalVertex with a vertex set to \a a.
-*/
-
-/*!
- \fn QLogicalVertex::QLogicalVertex(const QVector3D &a, const QVector3D &n);
- Constructs a new QLogicalVertex with a vertex set to \a a, and normal set to \a n.
-*/
-
-/*!
- \fn QLogicalVertex::QLogicalVertex(const QVector3D &a, const QVector3D &n, const QVector2D &t)
- Constructs a new QLogicalVertex with its vertex value set to \a a, normal set
- to \a n, and texture set to \a t. By default \a n is the null QVector3D,
- and \a t is the InvalidTexCoord. If \a n is null then hasType(QLogicalVertex::Normal)
- will return false. Likewise if \a t is the InvalidTexCoord then
- hasType(QLogicalVertex::Texture) will return false.
-*/
-
-/*!
- \fn QLogicalVertex::QLogicalVertex(const QVector3D &a, QColor4ub color)
- Constructs a new QLogicalVertex with its vertex value set to \a a,
- color value set to \a color.
-*/
-
-/*!
- \fn QLogicalVertex::~QLogicalVertex()
- Destroys this QLogicalVertex reclaiming any resources.
-*/
-
-/*!
- \fn const QVector3D &QLogicalVertex::vertex() const
- Returns a const reference to the vertex value for this vertex.
-*/
-
-/*!
- \fn void QLogicalVertex::setVertex(const QVector3D &v)
- Sets the vertex value for this vertex to \a v.
-*/
-
-/*!
- \fn QVector3D &QLogicalVertex::vertex()
- Returns a modifiable reference to the vertex value.
-*/
-
-/*!
- \fn QLogicalVertex::operator QVector3D ()
- Returns a copy of the vertex value, by casting as a QVector3D. This
- allows passing of a QLogicalVertex to functions that expect a QVector3D.
-*/
-
-/*!
- \fn QVariant QLogicalVertex::attribute(QGL::VertexAttribute field) const
- Returns the attribute value for \a field. The \a field defaults
- to QGL::CustomVertex0.
-*/
-
-/*!
- \fn void QLogicalVertex::setAttribute(float value, QGL::VertexAttribute field)
- Sets the float attribute \a value at \a field. The \a field
- defaults to QGL::CustomVertex0.
-*/
-
-/*!
- \fn void QLogicalVertex::setAttribute(const QVector2D &v, QGL::VertexAttribute field)
- Sets the QVector2D attribute \a v at \a field. The \a field
- defaults to QGL::CustomVertex0.
-*/
-
-/*!
- \fn void QLogicalVertex::setAttribute(const QVector3D &v, QGL::VertexAttribute field)
- Sets the QVector3D attribute \a v at \a field. The \a field
- defaults to QGL::CustomVertex0.
-*/
-
-/*!
- \fn float &QLogicalVertex::floatAttribute(QGL::VertexAttribute field)
- Returns a modifiable reference to the attribute at \a field, which
- must be a float. The \a field defaults to QGL::CustomVertex0.
-*/
-
-/*!
- \fn QVector2D &QLogicalVertex::vector2DAttribute(QGL::VertexAttribute field)
- Returns a modifiable reference to the attribute at \a field, which
- must be a QVector2D. The \a field defaults to QGL::CustomVertex0.
-*/
-
-/*!
- \fn QVector3D &QLogicalVertex::vector3DAttribute(QGL::VertexAttribute field = QGL::CustomVertex0);
- Returns a modifiable reference to the attribute at \a field, which
- must be a QVector3D. The \a field defaults to QGL::CustomVertex0.
-*/
-
-/*!
- \fn float QLogicalVertex::floatAttribute(QGL::VertexAttribute field) const
- Returns the attribute at \a field. The \a field defaults to QGL::CustomVertex0.
- The attribute must be a float value.
-*/
-
-/*!
- \fn QVector2D QLogicalVertex::vector2DAttribute(QGL::VertexAttribute field) const
- Returns the attribute at \a field. The \a field defaults to QGL::CustomVertex0.
- The attribute must be a QVector2D value.
-*/
-
-/*!
- \fn QVector3D QLogicalVertex::vector3DAttribute(QGL::VertexAttribute field) const
- Returns the attribute at \a field. The \a field defaults to QGL::CustomVertex0.
- The attribute must be a QVector3D value.
-*/
-
-/*!
- \fn QCustomDataArray::ElementType QLogicalVertex::attributeType(QGL::VertexAttribute field)
- Returns the element type for the attribute \a field.
-*/
-
-/*!
- \fn const QVector3D &QLogicalVertex::normal() const
- Returns a const reference to the normal value for this vertex.
-*/
-
-/*!
- \fn void QLogicalVertex::setNormal(const QVector3D &n)
- Sets the normal value for this vertex to \a n.
-*/
-
-/*!
- \fn QVector3D &QLogicalVertex::normal()
- Returns a modifiable reference to the normal value for this vertex.
-*/
-
-/*!
- \fn QVector2D QLogicalVertex::texCoord(QGL::VertexAttribute field) const
- Returns a copy of the texture coordinate value at \a field for this vertex.
- The \a field defaults to QGL::TextureCoord0.
-*/
-
-/*!
- \fn void QLogicalVertex::setTexCoord(const QVector2D &t, QGL::VertexAttribute field)
- Sets the texture coordinate at \a field for this vertex to \a t.
- The \a field defaults to QGL::TextureCoord0.
-*/
-
-/*!
- \fn QVector2D &QLogicalVertex::texCoordRef(QGL::VertexAttribute field)
- Returns a modifiable reference to the texture coordinate for this vertex.
- The \a field defaults to QGL::TextureCoord0.
-*/
-
-/*!
- \fn QColor4ub QLogicalVertex::color() const
- Returns a const reference to the color value for this vertex.
-*/
-
-/*!
- \fn void QLogicalVertex::setColor(const QColor4ub &c)
- Sets the color value for this vertex to \a c.
-*/
-
-/*!
- \fn QColor4ub &QLogicalVertex::colorRef()
- Returns a modifiable reference to the color value for this vertex.
-*/
-
-/*!
- \fn bool QLogicalVertex::hasField(QGL::VertexAttribute type) const
- Returns true if this vertex has data field \a type, and false otherwise.
-
- In general check to see if a logical vertex has a particular field
- type before attempting to access it. In debug mode accessing a
- non-existent field will cause an assert; but in release mode the
- behaviour is undefined.
-*/
-
-/*!
- \fn quint32 QLogicalVertex::fields() const
- Returns a bit-mask of the fields in this logical vertex. Test the
- fields like this:
- \code
- if (vertex.fields() & QGL::fieldMask(QGL::TextureCoord0))
- tex = vertex.texCoord();
- \endcode
-
- \sa QGeometryData::fields()
-*/
-
-/*!
- \fn int QLogicalVertex::index() const
- Returns the index at which this logical vertex's data is located in
- its associated QGeometryData; or -1 if this vertex is null.
-*/
-
-/*!
- \fn QGeometryData QLogicalVertex::data() const
- Returns a copy of the QGeometryData underlying this vertex. Note that
- the copy is not expensive in terms of performance due to implicit sharing
- unless the copy is modified (causing a copy-on-write).
-
- \sa QLogicalVertex::index()
-*/
-
-/*!
- \fn QGeometryData data() const
- Returns a copy of the QGeometryData associated with this vertex. Note
- that as long as the copy is not modified, this method is not expensive.
-*/
-
-/*!
- \fn bool QLogicalVertex::isNull() const
- Returns true if this vertex is null.
-
- \sa QLogicalVertex()
-*/
-
-/*!
- Returns true if \a rhs has exactly the same fields as this logical
- vertex, and each of those are equal to the corresponding field of the \a rhs.
-
- If either are null, then false is returned.
-*/
-bool QLogicalVertex::operator==(const QLogicalVertex &rhs) const
-{
- if (isNull() || rhs.isNull())
- return false;
- if (this == &rhs)
- return true;
- if (m_data.fields() != rhs.fields())
- return false;
- const quint32 mask = 0x01;
- quint32 fields = m_data.fields();
- for (int field = 0; fields; ++field, fields >>= 1)
- {
- if (mask & fields)
- {
- QGL::VertexAttribute attr = static_cast<QGL::VertexAttribute>(field);
- if (attr < QGL::TextureCoord0)
- {
- if (attr == QGL::Position)
- {
- if (!qFskCompare(vertex(), rhs.vertex()))
- return false;
- }
- else if (attr == QGL::Normal)
- {
- if (!qFskCompare(normal(), rhs.normal()))
- return false;
- }
- else
- {
- if (color() != rhs.color())
- return false;
- }
- }
- else if (attr < QGL::CustomVertex0)
- {
- if (!qFskCompare(texCoord(attr), rhs.texCoord(attr)))
- return false;
- }
- else
- {
- if (attribute(attr) != rhs.attribute(attr))
- return false;
- }
- }
- }
- return true;
-}
-
-#ifndef QT_NO_DEBUG_STREAM
-QDebug operator<<(QDebug dbg, const QLogicalVertex &lv)
-{
- dbg.nospace();
- dbg << "QLogicalVertex(";
- if (lv.isNull())
- {
- dbg << " NULL";
- }
- else
- {
- if (lv.hasField(QGL::Position))
- dbg << "V:" << QVector3D(lv.vertex());
- else
- dbg << " (No Vertex)";
- if (lv.hasField(QGL::Normal))
- dbg << "N:" << QVector3D(lv.normal());
- else
- dbg << " (No Normal)";
- if (lv.hasField(QGL::TextureCoord0))
- dbg << "T:" << QVector2D(lv.texCoord());
- else
- dbg << " (No Texture)";
- if (lv.hasField(QGL::Color))
- dbg << "C:" << QColor4ub(lv.color());
- else
- dbg << " (No Color)";
- }
- dbg << " )";
- return dbg.space();
-}
-#endif
-
-QT_END_NAMESPACE
diff --git a/src/threed/geometry/qlogicalvertex.h b/src/threed/geometry/qlogicalvertex.h
deleted file mode 100644
index 3a5d9b6b..00000000
--- a/src/threed/geometry/qlogicalvertex.h
+++ /dev/null
@@ -1,328 +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 QLOGICALVERTEX_H
-#define QLOGICALVERTEX_H
-
-#include "qgeometrydata.h"
-#include "qcustomdataarray.h"
-
-QT_BEGIN_NAMESPACE
-
-// uncomment this to perform heavy checking of QLogicalVertex
-// #define QT3D_DEBUG_QLOGICALVERTEX 1
-
-class QLogicalVertex
-{
-public:
- inline QLogicalVertex();
- inline QLogicalVertex(QGeometryData data, int index);
- inline QLogicalVertex(const QVector3D &a);
- inline QLogicalVertex(const QVector3D &a, const QVector3D &n);
- inline QLogicalVertex(const QVector3D &a, const QVector3D &n, const QVector2D &t);
- inline QLogicalVertex(const QVector3D &a, QColor4ub color);
- ~QLogicalVertex() {}
-
- inline const QVector3D &vertex() const;
- inline void setVertex(const QVector3D &v);
- inline QVector3D &vertex();
-
- operator QVector3D () { return vertex(); }
-
- inline QVariant attribute(QGL::VertexAttribute field = QGL::CustomVertex0) const;
- inline void setAttribute(float value, QGL::VertexAttribute attr);
- inline void setAttribute(const QVector2D &v, QGL::VertexAttribute field = QGL::CustomVertex0);
- inline void setAttribute(const QVector3D &v, QGL::VertexAttribute field = QGL::CustomVertex0);
- inline float &floatAttribute(QGL::VertexAttribute field = QGL::CustomVertex0);
- inline QVector2D &vector2DAttribute(QGL::VertexAttribute field = QGL::CustomVertex0);
- inline QVector3D &vector3DAttribute(QGL::VertexAttribute field = QGL::CustomVertex0);
- inline float floatAttribute(QGL::VertexAttribute field = QGL::CustomVertex0) const;
- inline QVector2D vector2DAttribute(QGL::VertexAttribute field = QGL::CustomVertex0) const;
- inline QVector3D vector3DAttribute(QGL::VertexAttribute field = QGL::CustomVertex0) const;
- inline QCustomDataArray::ElementType attributeType(QGL::VertexAttribute field = QGL::CustomVertex0);
-
- inline const QVector3D &normal() const;
- inline void setNormal(const QVector3D &n);
- inline QVector3D &normal();
-
- inline const QColor4ub &color() const;
- inline void setColor(const QColor4ub &c);
- inline QColor4ub &colorRef();
-
- inline const QVector2D &texCoord(QGL::VertexAttribute attr = QGL::TextureCoord0) const;
- inline void setTexCoord(const QVector2D &t, QGL::VertexAttribute attr = QGL::TextureCoord0);
- inline QVector2D &texCoordRef(QGL::VertexAttribute attr = QGL::TextureCoord0);
-
- inline bool hasField(QGL::VertexAttribute type) const;
- inline quint32 fields() const;
- inline int index() const;
- inline QGeometryData data() const;
- inline bool isNull() const;
-
- bool operator==(const QLogicalVertex &rhs) const;
-
-private:
- QGeometryData m_data;
- int m_index;
-};
-
-inline QLogicalVertex::QLogicalVertex()
- : m_index(-1)
-{
-}
-
-inline QLogicalVertex::QLogicalVertex(QGeometryData data, int index)
- : m_data(data)
- , m_index(index)
-{
- Q_ASSERT(index < data.count());
-#ifdef QT3D_DEBUG_QLOGICALVERTEX
- data.check();
-#endif
-}
-
-inline QLogicalVertex::QLogicalVertex(const QVector3D &a)
- : m_index(0)
-{
- m_data.appendVertex(a);
-}
-
-inline QLogicalVertex::QLogicalVertex(const QVector3D &a, const QVector3D &n)
- : m_index(0)
-{
- m_data.appendVertex(a);
- m_data.appendNormal(n);
-}
-
-inline QLogicalVertex::QLogicalVertex(const QVector3D &a, const QVector3D &n, const QVector2D &t)
- : m_index(0)
-{
- m_data.appendVertex(a);
- m_data.appendNormal(n);
- m_data.appendTexCoord(t);
-}
-
-inline QLogicalVertex::QLogicalVertex(const QVector3D &a, QColor4ub color)
- : m_index(0)
-{
- m_data.appendVertex(a);
- m_data.appendColor(color);
-}
-
-inline const QVector3D &QLogicalVertex::vertex() const
-{
- return m_data.vertexAt(m_index);
-}
-
-inline void QLogicalVertex::setVertex(const QVector3D &v)
-{
- if (m_index == -1)
- m_index = 0;
- if (m_index == m_data.count(QGL::Position))
- m_data.appendVertex(v);
- else
- m_data.vertex(m_index) = v;
-}
-
-inline QVector3D &QLogicalVertex::vertex()
-{
- return m_data.vertex(m_index);
-}
-
-inline QVariant QLogicalVertex::attribute(QGL::VertexAttribute attr) const
-{
- return m_data.attributes(attr).at(m_index);
-}
-
-inline void QLogicalVertex::setAttribute(float v, QGL::VertexAttribute attr)
-{
- if (m_index == -1)
- m_index = 0;
- if (m_index == m_data.count(attr))
- m_data.appendAttribute(v, attr);
- else
- m_data.floatAttribute(m_index, attr) = v;
-}
-
-inline void QLogicalVertex::setAttribute(const QVector2D &v, QGL::VertexAttribute attr)
-{
- if (m_index == -1)
- m_index = 0;
- if (m_index == m_data.count(attr))
- m_data.appendAttribute(v, attr);
- else
- m_data.vector2DAttribute(m_index, attr) = v;
-}
-
-inline void QLogicalVertex::setAttribute(const QVector3D &v, QGL::VertexAttribute attr)
-{
- if (m_index == -1)
- m_index = 0;
- if (m_index == m_data.count(attr))
- m_data.appendAttribute(v, attr);
- else
- m_data.vector3DAttribute(m_index, attr) = v;
-}
-
-inline float &QLogicalVertex::floatAttribute(QGL::VertexAttribute field)
-{
- return m_data.floatAttribute(m_index, field);
-}
-
-inline QVector2D &QLogicalVertex::vector2DAttribute(QGL::VertexAttribute field)
-{
- return m_data.vector2DAttribute(m_index, field);
-}
-
-inline QVector3D &QLogicalVertex::vector3DAttribute(QGL::VertexAttribute field)
-{
-
- return m_data.vector3DAttribute(m_index, field);
-}
-
-inline float QLogicalVertex::floatAttribute(QGL::VertexAttribute field) const
-{
- return m_data.floatAttributeAt(m_index, field);
-}
-
-inline QVector2D QLogicalVertex::vector2DAttribute(QGL::VertexAttribute field) const
-{
- return m_data.vector2DAttributeAt(m_index, field);
-}
-
-inline QVector3D QLogicalVertex::vector3DAttribute(QGL::VertexAttribute field) const
-{
- return m_data.vector3DAttributeAt(m_index, field);
-}
-
-inline QCustomDataArray::ElementType QLogicalVertex::attributeType(QGL::VertexAttribute field)
-{
- return m_data.attributes(field).elementType();
-}
-
-inline const QVector3D &QLogicalVertex::normal() const
-{
- return m_data.normalAt(m_index);
-}
-
-inline void QLogicalVertex::setNormal(const QVector3D &n)
-{
- if (m_index == -1)
- m_index = 0;
- if (m_index == m_data.count(QGL::Normal))
- m_data.appendNormal(n);
- else
- m_data.normal(m_index) = n;
-}
-
-inline QVector3D &QLogicalVertex::normal()
-{
- return m_data.normal(m_index);
-}
-
-inline const QVector2D &QLogicalVertex::texCoord(QGL::VertexAttribute attr) const
-{
- return m_data.texCoordAt(m_index, attr);
-}
-
-inline void QLogicalVertex::setTexCoord(const QVector2D &t, QGL::VertexAttribute attr)
-{
- Q_ASSERT(attr >= QGL::TextureCoord0 && attr <= QGL::TextureCoord2);
- if (m_index == -1)
- m_index = 0;
- if (m_index == m_data.count(attr))
- m_data.appendTexCoord(t, attr);
- else
- m_data.texCoord(m_index, attr) = t;
-}
-
-inline QVector2D &QLogicalVertex::texCoordRef(QGL::VertexAttribute attr)
-{
- return m_data.texCoord(m_index, attr);
-}
-
-inline const QColor4ub &QLogicalVertex::color() const
-{
- return m_data.colorAt(m_index);
-}
-
-inline void QLogicalVertex::setColor(const QColor4ub &c)
-{
- if (m_index == -1)
- m_index = 0;
- if (m_index == m_data.count(QGL::Color))
- m_data.appendColor(c);
- else
- m_data.color(m_index) = c;
-}
-
-inline QColor4ub &QLogicalVertex::colorRef()
-{
- return m_data.color(m_index);
-}
-
-inline bool QLogicalVertex::hasField(QGL::VertexAttribute attr) const
-{
- return m_data.hasField(attr);
-}
-
-inline quint32 QLogicalVertex::fields() const
-{
- return m_data.fields();
-}
-
-inline int QLogicalVertex::index() const
-{
- return m_index;
-}
-
-inline bool QLogicalVertex::isNull() const
-{
- return (m_index == -1);
-}
-
-#ifndef QT_NO_DEBUG_STREAM
-QDebug operator<<(QDebug dbg, const QLogicalVertex &section);
-#endif
-
-QT_END_NAMESPACE
-
-#endif // QLOGICALVERTEX_H
diff --git a/src/threed/geometry/qvector_utils_p.h b/src/threed/geometry/qvector_utils_p.h
deleted file mode 100644
index 3350ad6f..00000000
--- a/src/threed/geometry/qvector_utils_p.h
+++ /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 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 QVECTOR_UTILS_P_H
-#define QVECTOR_UTILS_P_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 <QtGui/qvector3d.h>
-#include <QtGui/qvector2d.h>
-
-// Replacement for qFuzzyCompare(QVector3D, QVector3D) and friends,
-// for a specific case where the results are going to be rendered
-// by the GPU onto a display.
-//
-// The accuracy of this comparison should not change. Especially it
-// should not change when you go from doubles to floats or when
-// you get close to zero. If two verts or lighting normals are
-// the same to within 5 places of floating point accuracy then they
-// will dislay as being on top of each other.
-//
-// Also this avoids doing 3 floating point multiplications every time
-// since the normal qFuzzyIsNull does a mul to scale the epsilon when
-// close to zero.
-
-inline bool qFskIsNull(double d)
-{
- return qAbs(d) <= 0.00001;
-}
-
-inline bool qFskIsNull(float f)
-{
- return qAbs(f) <= 0.00001f;
-}
-
-inline bool qFskCompare(float a, float b)
-{
- return qFskIsNull(a - b);
-}
-
-inline bool qFskCompare(double a, double b)
-{
- return qFskIsNull(a - b);
-}
-
-inline bool qFskCompare(const QVector3D &a, const QVector3D &b)
-{
- return (
- qFskIsNull(a.x() - b.x()) &&
- qFskIsNull(a.y() - b.y()) &&
- qFskIsNull(a.z() - b.z())
- );
-}
-
-inline bool qFskCompare(const QVector2D &a, const QVector2D &b)
-{
- return (
- qFskIsNull(a.x() - b.x()) &&
- qFskIsNull(a.y() - b.y())
- );
-}
-
-#endif // QVECTOR_UTILS_P_H
diff --git a/src/threed/global/global.pri b/src/threed/global/global.pri
deleted file mode 100644
index 2fac1022..00000000
--- a/src/threed/global/global.pri
+++ /dev/null
@@ -1,7 +0,0 @@
-INCLUDEPATH += $$PWD
-VPATH += $$PWD
-HEADERS += \
- global/qt3dglobal.h \
- global/qglnamespace.h
-SOURCES += \
- qglnamespace.cpp
diff --git a/src/threed/global/qglnamespace.cpp b/src/threed/global/qglnamespace.cpp
deleted file mode 100644
index 63418cf3..00000000
--- a/src/threed/global/qglnamespace.cpp
+++ /dev/null
@@ -1,290 +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 "qglnamespace.h"
-#include <QtCore/qsize.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \namespace QGL
-
- \brief The QGL namespace contains miscellaneous identifiers
- used throughout the Qt3D module.
-*/
-
-/*!
- \enum QGL::VertexAttribute
- \since 4.8
- This enum defines the type of vertex attribute to set on an effect with QGLPainter::setVertexAttribute()
-
- \value Position The primary position of the vertex.
- \value Normal The normal at each vertex.
- \value Color The color at each vertex.
- \value TextureCoord0 The texture co-ordinate at each vertex for texture unit 0.
- \value TextureCoord1 The texture co-ordinate at each vertex for texture unit 1.
- \value TextureCoord2 The texture co-ordinate at each vertex for texture unit 2.
- \value CustomVertex0 First custom vertex attribute. Custom attributes
- can be used for any purpose: texture co-ordinates, colors,
- or other values of interest to shader programs.
- \value CustomVertex1 Second custom vertex attribute.
- \value UserVertex First user-assigned vertex attribute. Additional
- attributes can be assigned as UserVertex, UserVertex + 1, etc.
- Note that on OpenGL/ES 2.0 systems, usually the maximum
- number of vertex attributes is 8, which means that user-assigned
- vertex attributes will be out of range.
-*/
-
-/*!
- \enum QGL::Face
- \since 4.8
- This enum defines the faces to apply an operation to.
-
- \value FrontFaces Apply the operation to front faces only.
- \value BackFaces Apply the operation to back faces only.
- \value AllFaces Apply the operation to both front and back faces.
-*/
-
-/*!
- \enum QGL::DrawingMode
- \since 4.8
- This enum defines the type of OpenGL primitive to render with QGLPainter::draw().
-
- \value Points Draws a point at each of the specified vertices.
- \value Lines Draws a series of unconnected line segments, using two
- vertices for each line.
- \value LineLoop series of connected line segments, from the
- first to the last vertex, and then connecting the last
- vertex back to the first vertex.
- \value LineStrip Draws a series of connected line segments, from the
- first to the last vertex.
- \value Triangles Draws a series of triangles using three vertices from
- the enabled vertex arrays for each triangle.
- \value TriangleStrip Draws a series of triangles in a strip, starting
- with the first three vertices and then one extra vertex for each
- additional triangle.
- \value TriangleFan Draws a series of triangles that fan out around the
- first vertex in the enabled vertex arrays, starting with the
- first three vertices and then one extra vertex for each additional
- triangle.
- \value LinesAdjacency Draws a series of unconnected lines, using
- two vertices for each line to define the positions, and an
- additional vertices per line to define adjacent points.
- This drawing mode is only supported on OpenGL systems that
- have geometry shaders.
- \value LineStripAdjacency Draws a series of connected line segments,
- from the second to the second last vertex. The first and last
- vertices define adjacent points. This drawing mode is only
- supported on OpenGL systems that have geometry shaders.
- \value TrianglesAdjacency Draws a series of triangles using three
- vertices from the enabled vertex arrays for each triangle.
- An additional three vertices per triangle are supplied to
- define adjacent points. This drawing mode is only supported
- on OpenGL systems that have geometry shaders.
- \value TriangleStripAdjacency Draws a series of triangles in a strip,
- with additional vertices for points adjacent to the strip.
- This drawing mode is only supported on OpenGL systems that
- have geometry shaders.
-*/
-
-/*!
- \enum QGL::StandardEffect
- \since 4.8
- This enum defines a standard drawing effect for use with QGLPainter.
-
- \value FlatColor Single flat color specified by QGLPainter::setColor()
- with no lighting.
- \value FlatPerVertexColor Per-vertex flat colors specified by a
- QGL::Color vertex array with no lighting.
- \value FlatReplaceTexture2D Map a texture across the fragments with
- no lighting. The final fragment color is replaced directly
- with the texture. The texture is sourced from texture unit 0.
- \value FlatDecalTexture2D Map a texture across the fragments, combined
- with QGLPainter::color(), and no lighting. The texture is sourced
- from texture unit 0.
- \value LitMaterial Material colors specified by
- QGLPainter::setFaceMaterial() with lighting enabled. It is
- assumed that per-vertex normals are provided. Under OpenGL/ES 2.0
- only one light is supported, with single-sided materials,
- and no attenuation.
- \value LitDecalTexture2D Map a texture across the fragments, combined
- with the material color specified by QGLPainter::setFaceMaterial(),
- and lighting using the GL_DECAL combination rule. The texture is
- sourced from texture unit 0. It is assumed that per-vertex
- normals are provided. Under OpenGL/ES 2.0 only one light is
- supported, with single-sided materials, and no attenuation.
- \value LitModulateTexture2D Map a texture across the fragments, combined
- with the material color specified by QGLPainter::setFaceMaterial(),
- and lighting using the GL_MODULATE combination rule. The texture
- is sourced from texture unit 0. It is assumed that per-vertex
- normals are provided. Under OpenGL/ES 2.0 only one light is
- supported, with single-sided materials, and no attenuation.
-*/
-
-/*!
- \enum QGL::TextureWrap
- \since 4.8
- This enum defines the wrapping mode for texture co-ordinates.
-
- \value Repeat Ignore the integer part of the texture co-ordinate and
- create a repeating pattern using the texture.
- \value Clamp Clamps the texture co-ordinate to the range 0 to 1.
- This value is not supported in OpenGL/ES, where it will be
- treated the same as ClampToEdge.
- \value ClampToBorder Clamps the texture co-ordinate to the range
- (-1 / 2N) to (1 + 1 / 2N) where N is the size of the texture in
- the direction of clamping. This value is supported in OpenGL 1.3
- and higher. In OpenGL versions less than 1.3, this value will
- be treated the same as Clamp. In OpenGL/ES, this value will be
- treated the same as ClampToEdge.
- \value ClampToEdge Clamps the texture co-ordinate to the range
- (1 / 2N) to (1 - 1 / 2N) where N is the size of the texture in
- the direction of clamping. This value is supported in OpenGL 1.2
- and higher, and in all versions of OpenGL/ES. In OpenGL versions
- less than 1.2, this value will be treated the same as Clamp.
- \value MirroredRepeat If the integer part of the texture co-ordinate
- is even, then use the fractional part. If the integer part of
- the texture co-ordinate is odd, then use 1 - the fractional part.
- This creates an alternating repeating pattern from the texture.
- This value is only supported in OpenGL 1.4 and higher, or
- OpenGL/ES 2.0 and higher. On other versions, MirroredRepeat
- will be treated the same as Repeat.
-*/
-
-/*!
- \enum QGL::Eye
- \since 4.8
- This enum defines the eye that is being rendered by a QGLPainter
- when stereo rendering is in effect.
-
- \value NoEye Do not perform an eye adjustment on the camera because
- stereo rendering is not in effect.
- \value LeftEye Render the scene from the perspective of the left eye.
- \value RightEye Render the scene from the perspective of the right eye.
-*/
-
-/*!
- \enum QGL::Smoothing
- \since 4.8
- \relates QGLBuilder
-
- This enum defines vertex smoothing treatments.
- \value NoSmoothing No smoothing processing is performed.
- \value Smooth Lighting normals averaged for each face for a smooth appearance.
- \value Faceted Lighting normals separate for each face for a faceted appearance.
-*/
-
-/*!
- \enum QGL::Mouse3DKeys
- \since 4.8
- This enum defines extra key codes for QKeyEvent related to 3D mice
- devices. See QMouse3DEventProvider for further details.
-
- \value Key_Fit Reset the transform so the model is centered to
- fit within the view.
- \value Key_TopView Switch to the top view.
- \value Key_LeftView Switch to the left view.
- \value Key_RightView Switch to the right view.
- \value Key_FrontView Switch to the front view.
- \value Key_BottomView Switch to the bottom view.
- \value Key_BackView Switch to the back view.
- \value Key_RotateCW90 Rotate clockwise by 90 degrees.
- \value Key_RotateCCW90 Rotate counter-clockwise by 90 degrees.
- \value Key_ISO1 Show an isometric view of the model with top, front,
- and right sides.
- \value Key_ISO2 Show an isometric view of the model with top, back
- and left sides.
- \value Key_Button1 Special function button 1.
- \value Key_Button2 Special function button 2.
- \value Key_Button3 Special function button 3.
- \value Key_Button4 Special function button 4.
- \value Key_Button5 Special function button 5.
- \value Key_Button6 Special function button 6.
- \value Key_Button7 Special function button 7.
- \value Key_Button8 Special function button 8.
- \value Key_Button9 Special function button 9.
- \value Key_Button10 Special function button 10.
- \value Key_Rotations Toggles whether or not the rotation axes on a
- 3D mouse will be filtered.
- \value Key_Translations Toggles whether or not the translation axes
- on a 3D mouse will be filtered.
- \value Key_DominantAxis Toggles whether or not 3D mouse movements
- should be constrained to the dominant axis.
- \value Key_IncreaseSensitivity Increase the sensitivity of the mouse
- to wrist movements.
- \value Key_DecreaseSensitivity Decrease the sensitivity of the mouse
- to wrist movements.
-*/
-
-/*!
- Returns the next power of two that is greater than or
- equal to \a value. The \a value must be positive or the
- result is undefined.
-
- This is a convenience function for use with GL texture
- handling code.
-*/
-int QGL::nextPowerOfTwo(int value)
-{
- value--;
- value |= value >> 1;
- value |= value >> 2;
- value |= value >> 4;
- value |= value >> 8;
- value |= value >> 16;
- ++value;
- return value;
-}
-
-/*!
- Returns the next power of two that is greater than or
- equal to the width and height components of \a value.
-
- This is a convenience function for use with GL texture
- handling code.
-*/
-QSize QGL::nextPowerOfTwo(const QSize& value)
-{
- return QSize(nextPowerOfTwo(value.width()),
- nextPowerOfTwo(value.height()));
-}
-
-QT_END_NAMESPACE
diff --git a/src/threed/global/qglnamespace.h b/src/threed/global/qglnamespace.h
deleted file mode 100644
index 4987e87c..00000000
--- a/src/threed/global/qglnamespace.h
+++ /dev/null
@@ -1,163 +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 QGLNAMESPACE_H
-#define QGLNAMESPACE_H
-
-#include "qt3dglobal.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class QSize;
-
-namespace QGL
-{
- enum VertexAttribute {
- Position,
- Normal,
- Color,
- TextureCoord0,
- TextureCoord1,
- TextureCoord2,
- CustomVertex0,
- CustomVertex1,
- UserVertex
- };
-
- enum Face
- {
- FrontFaces = 0x0404, // GL_FRONT
- BackFaces = 0x0405, // GL_BACK
- AllFaces = 0x0408 // GL_FRONT_AND_BACK
- };
-
- enum DrawingMode
- {
- Points = 0x0000, // GL_POINTS
- Lines = 0x0001, // GL_LINES
- LineLoop = 0x0002, // GL_LINE_LOOP
- LineStrip = 0x0003, // GL_LINE_STRIP
- Triangles = 0x0004, // GL_TRIANGLES
- TriangleStrip = 0x0005, // GL_TRIANGLE_STRIP
- TriangleFan = 0x0006, // GL_TRIANGLE_FAN
- LinesAdjacency = 0x000A, // GL_LINES_ADJACENCY
- LineStripAdjacency = 0x000B, // GL_LINE_STRIP_ADJACENCY
- TrianglesAdjacency = 0x000C, // GL_TRIANGLES_ADJACENCY
- TriangleStripAdjacency = 0x000D // GL_TRIANGLE_STRIP_ADJACENCY
- };
-
- enum StandardEffect
- {
- FlatColor,
- FlatPerVertexColor,
- FlatReplaceTexture2D,
- FlatDecalTexture2D,
- LitMaterial,
- LitDecalTexture2D,
- LitModulateTexture2D
- };
-
- enum TextureWrap
- {
- Repeat = 0x2901, // GL_REPEAT
- Clamp = 0x2900, // GL_CLAMP
- ClampToBorder = 0x812D, // GL_CLAMP_TO_BORDER
- ClampToEdge = 0x812F, // GL_CLAMP_TO_EDGE
- MirroredRepeat = 0x8370 // GL_MIRRORED_REPEAT
- };
-
- enum Eye
- {
- NoEye,
- LeftEye,
- RightEye
- };
-
- enum Smoothing
- {
- NoSmoothing,
- Smooth,
- Faceted
- };
-
- enum Mouse3DKeys
- {
- Key_Fit = 0x01200002,
- Key_TopView = 0x01200003,
- Key_LeftView = 0x01200004,
- Key_RightView = 0x01200005,
- Key_FrontView = 0x01200006,
- Key_BottomView = 0x01200007,
- Key_BackView = 0x01200008,
- Key_RotateCW90 = 0x01200009,
- Key_RotateCCW90 = 0x0120000a,
- Key_ISO1 = 0x0120000b,
- Key_ISO2 = 0x0120000c,
- Key_Button1 = 0x0120000d,
- Key_Button2 = 0x0120000e,
- Key_Button3 = 0x0120000f,
- Key_Button4 = 0x01200010,
- Key_Button5 = 0x01200011,
- Key_Button6 = 0x01200012,
- Key_Button7 = 0x01200013,
- Key_Button8 = 0x01200014,
- Key_Button9 = 0x01200015,
- Key_Button10 = 0x01200016,
- Key_Rotations = 0x0120001b,
- Key_Translations = 0x0120001c,
- Key_DominantAxis = 0x0120001d,
- Key_IncreaseSensitivity = 0x0120001e,
- Key_DecreaseSensitivity = 0x0120001f
- };
-
- Q_QT3D_EXPORT int nextPowerOfTwo(int value);
- Q_QT3D_EXPORT QSize nextPowerOfTwo(const QSize& value);
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/global/qt3dglobal.h b/src/threed/global/qt3dglobal.h
deleted file mode 100644
index 488e7e17..00000000
--- a/src/threed/global/qt3dglobal.h
+++ /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 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 QT3DGLOBAL_H
-#define QT3DGLOBAL_H
-
-#include <QtCore/qglobal.h>
-
-// XXX: Move to qglobal.h eventually.
-QT_LICENSED_MODULE(Qt3D)
-#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
-# if defined(QT_NODLL)
-# undef QT_MAKEDLL
-# undef QT_DLL
-# elif defined(QT_MAKEDLL) /* create a Qt DLL library */
-# if defined(QT_DLL)
-# undef QT_DLL
-# endif
-# if defined(QT_BUILD_QT3D_LIB)
-# define Q_QT3D_EXPORT Q_DECL_EXPORT
-# else
-# define Q_QT3D_EXPORT Q_DECL_IMPORT
-# endif
-# elif defined(QT_DLL) /* use a Qt DLL library */
-# define Q_QT3D_EXPORT Q_DECL_IMPORT
-# endif
-#endif
-#if !defined(Q_QT3D_EXPORT)
-# if defined(QT_SHARED)
-# define Q_QT3D_EXPORT Q_DECL_EXPORT
-# else
-# define Q_QT3D_EXPORT
-# endif
-#endif
-
-#endif
diff --git a/src/threed/graphicsview/graphicsview.pri b/src/threed/graphicsview/graphicsview.pri
deleted file mode 100644
index b43dbe66..00000000
--- a/src/threed/graphicsview/graphicsview.pri
+++ /dev/null
@@ -1,21 +0,0 @@
-
-INCLUDEPATH += $$PWD
-VPATH += $$PWD
-
-HEADERS += \
- graphicsview/qglgraphicsviewportitem.h \
- graphicsview/qgraphicsbillboardtransform.h \
- graphicsview/qgraphicsembedscene.h \
- graphicsview/qgraphicsrotation3d.h \
- graphicsview/qgraphicsscale3d.h \
- graphicsview/qgraphicstransform3d.h \
- graphicsview/qgraphicstranslation3d.h
-
-SOURCES += \
- qglgraphicsviewportitem.cpp \
- qgraphicsbillboardtransform.cpp \
- qgraphicsembedscene.cpp \
- qgraphicsrotation3d.cpp \
- qgraphicsscale3d.cpp \
- qgraphicstransform3d.cpp \
- qgraphicstranslation3d.cpp
diff --git a/src/threed/graphicsview/qglgraphicsviewportitem.cpp b/src/threed/graphicsview/qglgraphicsviewportitem.cpp
deleted file mode 100644
index c99b695e..00000000
--- a/src/threed/graphicsview/qglgraphicsviewportitem.cpp
+++ /dev/null
@@ -1,365 +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 "qglgraphicsviewportitem.h"
-#include "qglpainter.h"
-#include "qglsubsurface.h"
-#include <QtGui/qpainter.h>
-#include <QtGui/qgraphicsscene.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGLGraphicsViewportItem
- \brief The QGLGraphicsViewportItem class provides a rectangular viewport for arbitrary OpenGL painting.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::graphicsview
-*/
-
-class QGLGraphicsViewportItemPrivate : public QObject
-{
- Q_OBJECT
-public:
- QGLGraphicsViewportItemPrivate(QGLGraphicsViewportItem *item)
- : q(item)
- {
- defaultCamera = camera = new QGLCamera(this);
- connect(camera, SIGNAL(projectionChanged()),
- this, SLOT(cameraChanged()));
- connect(camera, SIGNAL(viewChanged()),
- this, SLOT(cameraChanged()));
- }
-
- void changeCamera(QGLCamera *c);
- void setDefaults(QGLPainter *painter);
-
- QGLGraphicsViewportItem *q;
- QRectF rect;
- QGLCamera *camera;
- QGLCamera *defaultCamera;
- QColor backgroundColor;
-
-private Q_SLOTS:
- void cameraChanged();
-};
-
-void QGLGraphicsViewportItemPrivate::changeCamera(QGLCamera *c)
-{
- disconnect(camera, SIGNAL(projectionChanged()),
- this, SLOT(cameraChanged()));
- disconnect(camera, SIGNAL(viewChanged()),
- this, SLOT(cameraChanged()));
- camera = c;
- connect(camera, SIGNAL(projectionChanged()),
- this, SLOT(cameraChanged()));
- connect(camera, SIGNAL(viewChanged()),
- this, SLOT(cameraChanged()));
-}
-
-void QGLGraphicsViewportItemPrivate::cameraChanged()
-{
- q->update();
-}
-
-void QGLGraphicsViewportItemPrivate::setDefaults(QGLPainter *painter)
-{
- // Set the default depth buffer options.
- glDepthFunc(GL_LESS);
- glDepthMask(GL_TRUE);
-#if defined(QT_OPENGL_ES)
- glDepthRangef(0.0f, 1.0f);
-#else
- glDepthRange(0.0f, 1.0f);
-#endif
-
- // Set the default blend options.
- glDisable(GL_BLEND);
- 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);
-}
-
-/*!
- Constructs a new GL graphics viewport and attaches it to \a parent.
-*/
-QGLGraphicsViewportItem::QGLGraphicsViewportItem(QGraphicsItem *parent)
- : QGraphicsItem(parent), d_ptr(new QGLGraphicsViewportItemPrivate(this))
-{
-}
-
-/*!
- Constructs a new GL graphics viewport and attaches it to \a parent.
- The boundingRect() is initially set to \a rect.
-*/
-QGLGraphicsViewportItem::QGLGraphicsViewportItem(const QRectF& rect, QGraphicsItem *parent)
- : QGraphicsItem(parent), d_ptr(new QGLGraphicsViewportItemPrivate(this))
-{
- d_ptr->rect = rect;
-}
-
-/*!
- Constructs a new GL graphics viewport and attaches it to \a parent.
- The boundingRect() is initially set to (\a x, \a y, \a w, \a h).
-*/
-QGLGraphicsViewportItem::QGLGraphicsViewportItem
- (qreal x, qreal y, qreal w, qreal h, QGraphicsItem *parent)
- : QGraphicsItem(parent), d_ptr(new QGLGraphicsViewportItemPrivate(this))
-{
- d_ptr->rect = QRectF(x, y, w, h);
-}
-
-/*!
- Destroys this GL graphics viewport.
-*/
-QGLGraphicsViewportItem::~QGLGraphicsViewportItem()
-{
-}
-
-/*!
- Returns the rectangular area of the view that is occupied by
- this GL graphics viewport.
-
- \sa setRect(), boundingRect()
-*/
-QRectF QGLGraphicsViewportItem::rect() const
-{
- Q_D(const QGLGraphicsViewportItem);
- return d->rect;
-}
-
-/*!
- Sets the rectangular area of the view that is occupied by
- this GL graphics viewport to \a rect.
-
- \sa rect(), boundingRect()
-*/
-void QGLGraphicsViewportItem::setRect(const QRectF &rect)
-{
- Q_D(QGLGraphicsViewportItem);
- if (d->rect == rect)
- return;
- prepareGeometryChange();
- d->rect = rect;
- update();
-}
-
-/*!
- \fn void QGLGraphicsViewportItem::setRect(qreal x, qreal y, qreal w, qreal h)
- \overload
-
- Sets the rectangular area of the view that is occupied by
- this GL graphics viewport to (\a x, \a y, \a w, \a h).
-
- \sa rect(), boundingRect()
-*/
-
-/*!
- Returns the bounding rectangle for this GL graphics viewport,
- which is the same as rect().
-
- \sa rect()
-*/
-QRectF QGLGraphicsViewportItem::boundingRect() const
-{
- Q_D(const QGLGraphicsViewportItem);
- return d->rect;
-}
-
-/*!
- Returns the camera parameters. The camera defines the projection
- to apply to convert eye co-ordinates into window co-ordinates,
- and the position and orientation of the viewer's eye.
-
- This item will be updated whenever the camera's parameters change.
-
- \sa setCamera()
-*/
-QGLCamera *QGLGraphicsViewportItem::camera() const
-{
- Q_D(const QGLGraphicsViewportItem);
- return d->camera;
-}
-
-/*!
- Sets the camera parameters to \a camera. The camera defines the
- projection to apply to convert eye co-ordinates into window
- co-ordinates, and the position and orientation of the viewer's eye.
-
- If \a camera is null, then the default camera object will be used.
-
- This function will call update() to force the viewport to update
- with the new camera parameters upon the next event loop. Afterwards,
- this item will be updated whenever the camera's parameters change.
-
- \sa camera()
-*/
-void QGLGraphicsViewportItem::setCamera(QGLCamera *camera)
-{
- Q_D(QGLGraphicsViewportItem);
- if (!camera)
- camera = d->defaultCamera;
- if (d->camera != camera) {
- d->changeCamera(camera);
- update();
- }
-}
-
-/*!
- Returns the background color, which is used to clear the viewport
- before calling paintGL(). The default value is an invalid QColor,
- which indicates that the viewport should not be cleared.
-
- \sa setBackgroundColor()
-*/
-QColor QGLGraphicsViewportItem::backgroundColor() const
-{
- Q_D(const QGLGraphicsViewportItem);
- return d->backgroundColor;
-}
-
-/*!
- Sets the background \a color, which is used to clear the viewport
- before calling paintGL().
-
- \sa backgroundColor()
-*/
-void QGLGraphicsViewportItem::setBackgroundColor(const QColor& color)
-{
- Q_D(QGLGraphicsViewportItem);
- d->backgroundColor = color;
-}
-
-/*!
- Paints this GL graphics viewport onto \a painter, with the specified
- \a option and \a widget parameters.
-
- This override creates a QGLPainter for \a painter and passes
- it to paintGL().
-
- \sa paintGL()
-*/
-void QGLGraphicsViewportItem::paint
- (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
-{
- Q_D(QGLGraphicsViewportItem);
-
- Q_UNUSED(option);
- Q_UNUSED(widget);
-
- if (d->rect.isEmpty())
- return;
-
- // Initialize a QGLPainter for the surface and bail out if not active.
- QGLPainter glpainter;
- if (!glpainter.begin(painter)) {
- qWarning("GL graphics system is not active; cannot use 3D items");
- return;
- }
-
- // Set up the GL viewport to limit drawing to the bounds of this item.
- QRect viewport = painter->deviceTransform().mapRect(rect()).toRect();
- QGLSubsurface surface(glpainter.currentSurface(), viewport);
- glpainter.pushSurface(&surface);
-
- // Set up the desired drawing options.
- glDisable(GL_CULL_FACE);
- d->setDefaults(&glpainter);
- if (d->backgroundColor.isValid()) {
- // We clear the background by drawing a triangle fan so
- // that the background color will blend with the underlying
- // screen content if it has an alpha component.
- glDisable(GL_DEPTH_TEST);
- if (d->backgroundColor.alpha() != 255)
- glEnable(GL_BLEND);
- else
- glDisable(GL_BLEND);
- QVector2DArray array;
- array.append(-1, -1);
- array.append(1, -1);
- array.append(1, 1);
- array.append(-1, 1);
- glpainter.projectionMatrix().setToIdentity();
- glpainter.modelViewMatrix().setToIdentity();
- glpainter.setStandardEffect(QGL::FlatColor);
- glpainter.setColor(d->backgroundColor);
- glpainter.setVertexAttribute(QGL::Position, array);
- glpainter.draw(QGL::TriangleFan, 4);
- }
- glClear(GL_DEPTH_BUFFER_BIT);
- glEnable(GL_DEPTH_TEST);
- glDisable(GL_BLEND);
-
- // Apply the camera.
- glpainter.setEye(QGL::NoEye);
- glpainter.setCamera(d->camera);
-
- // Paint the GL contents.
- paintGL(&glpainter);
-
- // Disable the current drawing effect so that QGLPainter will
- // forcibly update the GL context the next time QGLPainter is used.
- glpainter.disableEffect();
-
- // Try to restore the GL state to something paint-engine compatible.
- glDisable(GL_CULL_FACE);
- d->setDefaults(&glpainter);
- glDisable(GL_DEPTH_TEST);
-
- glpainter.popSurface();
-}
-
-/*!
- \fn void QGLGraphicsViewportItem::paintGL(QGLPainter *painter)
-
- Paints this GL graphics viewport onto \a painter. This function is called
- from paint().
-
- \sa paint()
-*/
-
-QT_END_NAMESPACE
-
-#include "qglgraphicsviewportitem.moc"
diff --git a/src/threed/graphicsview/qglgraphicsviewportitem.h b/src/threed/graphicsview/qglgraphicsviewportitem.h
deleted file mode 100644
index b7b10364..00000000
--- a/src/threed/graphicsview/qglgraphicsviewportitem.h
+++ /dev/null
@@ -1,100 +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 QGLGRAPHICSVIEWPORTITEM_H
-#define QGLGRAPHICSVIEWPORTITEM_H
-
-#include "qglnamespace.h"
-#include <QtGui/qgraphicsitem.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class QGLGraphicsViewportItemPrivate;
-class QGLPainter;
-class QGLCamera;
-
-class Q_QT3D_EXPORT QGLGraphicsViewportItem : public QGraphicsItem
-{
-public:
- QGLGraphicsViewportItem(QGraphicsItem *parent = 0);
- QGLGraphicsViewportItem(const QRectF& rect, QGraphicsItem *parent = 0);
- QGLGraphicsViewportItem(qreal x, qreal y, qreal w, qreal h,
- QGraphicsItem *parent = 0);
- ~QGLGraphicsViewportItem();
-
- QRectF rect() const;
- void setRect(const QRectF &rect);
- inline void setRect(qreal x, qreal y, qreal w, qreal h);
-
- QRectF boundingRect() const;
-
- QGLCamera *camera() const;
- void setCamera(QGLCamera *camera);
-
- QColor backgroundColor() const;
- void setBackgroundColor(const QColor& color);
-
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
-
-protected:
- virtual void paintGL(QGLPainter *painter) = 0;
-
-private:
- QScopedPointer<QGLGraphicsViewportItemPrivate> d_ptr;
-
- Q_DECLARE_PRIVATE(QGLGraphicsViewportItem)
- Q_DISABLE_COPY(QGLGraphicsViewportItem)
-};
-
-void QGLGraphicsViewportItem::setRect(qreal x, qreal y, qreal w, qreal h)
-{
- setRect(QRectF(x, y, w, h));
-}
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/graphicsview/qgraphicsbillboardtransform.cpp b/src/threed/graphicsview/qgraphicsbillboardtransform.cpp
deleted file mode 100644
index 449d9172..00000000
--- a/src/threed/graphicsview/qgraphicsbillboardtransform.cpp
+++ /dev/null
@@ -1,258 +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 "qgraphicsbillboardtransform.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGraphicsBillboardTransform
- \brief The QGraphicsBillboardTransform class implements a transformation that causes objects to face the camera.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::graphicsview
-
- Sometimes it can be useful to make an object face towards the camera
- no matter what orientation the scene is in. The common name for
- this technique is "billboarding".
-
- When applied as a transformation, this class will replace the top-left
- 3x3 part of the transformation matrix with the identity. This has the
- effect of removing the rotation and scale components from the current
- world co-ordinate orientation.
-*/
-
-/*!
- \qmlclass BillboardTransform QGraphicsBillboardTransform
- \brief The BillboardTransform item implements a transformation that causes objects to face the camera.
- \since 4.8
- \ingroup qt3d::qml3d
-
- Sometimes it can be useful to make an object face towards the camera
- no matter what orientation the scene is in. The common name for
- this technique is "billboarding".
-
- When applied as a transformation, this class will replace the top-left
- 3x3 part of the transformation matrix with the identity. This has the
- effect of removing the rotation and scale components from the current
- world co-ordinate orientation. In QML, this can be used as follows
- to orient a pane to point towards the viewer:
-
- \code
- Item3D {
- mesh: Mesh { source: "pane.obj" }
- position: Qt.vector3d(2, 0, -20)
- transform: BillboardTransform {}
- effect: Effect { texture: "picture.jpg" }
- }
- \endcode
-
- Because the billboard transformation will strip any further
- alterations to the matrix, it will usually be the last element
- in the \c transform list (transformations are applied to the matrix in
- reverse order of their appearance in \c transform):
-
- \code
- Item3D {
- mesh: Mesh { source: "pane.obj" }
- position: Qt.vector3d(2, 0, -20)
- transform: [
- Scale3D { scale: 0.5 },
- Rotation3D { angle: 30 },
- BillboardTransform {}
- ]
- effect: Effect { texture: "picture.jpg" }
- }
- \endcode
-
- The \c scale property is applied to the matrix after \c transform has
- performed the billboard transformation, so the above can also be written
- as follows:
-
- \code
- Item3D {
- mesh: Mesh { source: "pane.obj" }
- position: Qt.vector3d(2, 0, -20)
- scale: 0.5
- transform: [
- Rotation3D { angle: 30 },
- BillboardTransform {}
- ]
- effect: Effect { texture: "picture.jpg" }
- }
- \endcode
-
- By default the billboard transform will cause the object to
- face directly at the camera no matter how the world co-ordinate
- system is rotated. Sometimes the billboard needs to stay at right
- angles to the "ground plane" even if the user's viewpoint is
- elevated. This behavior can be enabled using the preserveUpVector
- property:
-
- \code
- Pane {
- position: Qt.vector3d(2, 0, -20)
- transform: BillboardTransform { preserveUpVector: true }
- effect: Effect { texture: "picture.jpg" }
- }
- \endcode
-*/
-
-class QGraphicsBillboardTransformPrivate
-{
-public:
- QGraphicsBillboardTransformPrivate() : preserveUpVector(false) {}
-
- bool preserveUpVector;
-};
-
-/*!
- Construct a billboard transform and attach it to \a parent.
-*/
-QGraphicsBillboardTransform::QGraphicsBillboardTransform(QObject *parent)
- : QGraphicsTransform3D(parent), d_ptr(new QGraphicsBillboardTransformPrivate)
-{
-}
-
-/*!
- Destroy this billboard transform.
-*/
-QGraphicsBillboardTransform::~QGraphicsBillboardTransform()
-{
-}
-
-/*!
- \property QGraphicsBillboardTransform::preserveUpVector
- \brief true to preserve the up orientation.
-
- The default value for this property is false, which indicates that
- the object being transformed should always face directly to the camera
- This is also known as a "spherical billboard".
-
- If the value for this property is true, then the object will have
- its up orientation preserved. This is also known as a "cylindrical
- billboard".
-*/
-
-/*!
- \qmlproperty bool BillboardTransform::preserveUpVector
-
- This property specifies whether the billboard transform should
- preserve the "up vector" so that objects stay at right angles
- to the ground plane in the scene.
-
- The default value for this property is false, which indicates that
- the object being transformed should always face directly to the camera
- This is also known as a "spherical billboard".
-
- If the value for this property is true, then the object will have
- its up orientation preserved. This is also known as a "cylindrical
- billboard".
-*/
-
-bool QGraphicsBillboardTransform::preserveUpVector() const
-{
- Q_D(const QGraphicsBillboardTransform);
- return d->preserveUpVector;
-}
-
-void QGraphicsBillboardTransform::setPreserveUpVector(bool value)
-{
- Q_D(QGraphicsBillboardTransform);
- if (d->preserveUpVector != value) {
- d->preserveUpVector = value;
- emit transformChanged();
- emit preserveUpVectorChanged();
- }
-}
-
-/*!
- \internal
-*/
-void QGraphicsBillboardTransform::applyTo(QMatrix4x4 *matrix) const
-{
- Q_D(const QGraphicsBillboardTransform);
- if (!d->preserveUpVector) {
- // Replace the top-left 3x3 of the matrix with the identity.
- // The technique is "Cheating Spherical Billboards", described here:
- // http://www.lighthouse3d.com/opengl/billboarding/index.php?billCheat
- (*matrix)(0, 0) = 1.0f;
- (*matrix)(0, 1) = 0.0f;
- (*matrix)(0, 2) = 0.0f;
- (*matrix)(1, 0) = 0.0f;
- (*matrix)(1, 1) = 1.0f;
- (*matrix)(1, 2) = 0.0f;
- (*matrix)(2, 0) = 0.0f;
- (*matrix)(2, 1) = 0.0f;
- (*matrix)(2, 2) = 1.0f;
- } else {
- // Replace some of the top-left 3x3 of the matrix with the identity,
- // but leave the up vector component in the second column as-is.
- // The technique is "Cheating Cylindrical Billboards", described here:
- // http://www.lighthouse3d.com/opengl/billboarding/index.php?billCheat1
- (*matrix)(0, 0) = 1.0f;
- (*matrix)(0, 2) = 0.0f;
- (*matrix)(1, 0) = 0.0f;
- (*matrix)(1, 2) = 0.0f;
- (*matrix)(2, 0) = 0.0f;
- (*matrix)(2, 2) = 1.0f;
- }
- matrix->optimize();
-}
-
-/*!
- \internal
-*/
-QGraphicsTransform3D *QGraphicsBillboardTransform::clone(QObject *parent) const
-{
- Q_D(const QGraphicsBillboardTransform);
- QGraphicsBillboardTransform *copy = new QGraphicsBillboardTransform(parent);
- copy->setPreserveUpVector(d->preserveUpVector);
- return copy;
-}
-
-/*!
- \fn void QGraphicsBillboardTransform::preserveUpVectorChanged()
-
- Signal that is emitted when preserveUpVector() changes.
-*/
-
-QT_END_NAMESPACE
diff --git a/src/threed/graphicsview/qgraphicsbillboardtransform.h b/src/threed/graphicsview/qgraphicsbillboardtransform.h
deleted file mode 100644
index 61ec4072..00000000
--- a/src/threed/graphicsview/qgraphicsbillboardtransform.h
+++ /dev/null
@@ -1,82 +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 QGRAPHICSBILLBOARDTRANSFORM_H
-#define QGRAPHICSBILLBOARDTRANSFORM_H
-
-#include "qgraphicstransform3d.h"
-#include <QtCore/qscopedpointer.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-class QGraphicsBillboardTransformPrivate;
-
-class Q_QT3D_EXPORT QGraphicsBillboardTransform : public QGraphicsTransform3D
-{
- Q_OBJECT
- Q_PROPERTY(bool preserveUpVector READ preserveUpVector WRITE setPreserveUpVector NOTIFY preserveUpVectorChanged)
-public:
- QGraphicsBillboardTransform(QObject *parent = 0);
- ~QGraphicsBillboardTransform();
-
- bool preserveUpVector() const;
- void setPreserveUpVector(bool value);
-
- void applyTo(QMatrix4x4 *matrix) const;
- QGraphicsTransform3D *clone(QObject *parent) const;
-
-Q_SIGNALS:
- void preserveUpVectorChanged();
-
-private:
- QScopedPointer<QGraphicsBillboardTransformPrivate> d_ptr;
-
- Q_DISABLE_COPY(QGraphicsBillboardTransform)
- Q_DECLARE_PRIVATE(QGraphicsBillboardTransform)
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/graphicsview/qgraphicsembedscene.cpp b/src/threed/graphicsview/qgraphicsembedscene.cpp
deleted file mode 100644
index 9e245880..00000000
--- a/src/threed/graphicsview/qgraphicsembedscene.cpp
+++ /dev/null
@@ -1,469 +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 "qgraphicsembedscene.h"
-#include "qglnamespace.h"
-#include <QtOpenGL/qglframebufferobject.h>
-#include <QtGui/qapplication.h>
-#include <QtGui/qpainter.h>
-#include <QtGui/qevent.h>
-#include <QtGui/qgraphicssceneevent.h>
-#include <QtCore/qdebug.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGraphicsEmbedScene
- \brief The QGraphicsEmbedScene class provides a method to render a QGraphicsScene into a texture.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::graphicsview
-
- \section1 Rendering the scene into a texture
-
- Embedded scenes are rendered into textures with renderToTexture()
- before the main 3D scene painting with QGLPainter starts. The following
- example shows the sequence of operations for a QGLWidget:
-
- \code
- void MyGLWidget::paintGL()
- {
- GLuint textureId = scene.renderToTexture();
-
- QGLPainter painter(this);
- painter.glActiveTexture(GL_TEXTURE0);
- glBindTexture(GL_TEXTURE_2D, textureId);
- ... // draw the 3D object
- painter.glActiveTexture(GL_TEXTURE0);
- glBindTexture(GL_TEXTURE_2D, 0);
- }
- \endcode
-
- When using QGLView, override the QGLWidget::paintGL() function
- explicitly to render scenes into textures before QGLView::paintGL()
- is called:
-
- \code
- void MyGLView::paintGL()
- {
- textureId = scene.renderToTexture();
- QGLView::paintGL();
- }
-
- void MyGLView::paintGL(QGLPainter *painter)
- {
- painter->glActiveTexture(GL_TEXTURE0);
- glBindTexture(GL_TEXTURE_2D, textureId);
- ... // draw the 3D object
- painter->glActiveTexture(GL_TEXTURE0);
- glBindTexture(GL_TEXTURE_2D, 0);
- }
- \endcode
-
- The texture is oriented so that (0, 0) corresponds to the bottom-left
- of the scene, and (1, 1) corresponds to the top-right of the scene.
- The texture may be scaled up to a power of two in size for better
- performance.
-
- \section1 Delivering mouse and keyboard events
-
- Mouse and keyboard events originate with the widget that is
- displaying the 3D scene. The application needs to intercept
- these events and decide which 3D object in the scene should
- get the event.
-
- The application then performs an intersection between the 3D
- object and a line in 3D space (usually a QRay3D) to determine
- the texture co-ordinate of where the user clicked on the object.
- How the intersection is determined is application-specific; different
- algorithms are needed based on the type of object (cube, sphere,
- parameterized mesh, etc).
-
- Once the texture co-ordinate has been determined, the application
- passes the widget event and the texture co-ordinate to deliverEvent().
- QGraphicsEmbedScene will then route the event to the appropriate
- graphics item in the embedded scene.
-
- Keyboard, focus in/out, and other non-mouse events do not need a
- texture co-ordinate. Pass (0, 0) as the texture co-ordinate for
- those event types.
-
- \section1 Updating the 3D scene
-
- The application will probably want to perform an update() whenever
- something changes in the embedded scene. The application should
- listen for the QGraphicsScene::changed() and
- QGraphicsScene::sceneRectChanged() signals.
-
- \section1 Performance notes
-
- QGraphicsEmbedScene renders the scene into a framebuffer object,
- which will involve GL state switching. The scene will be
- effectively triple-buffered: render into the fbo, then render
- the fbo into the GL window's back buffer, and finally copy to the
- GL window's front buffer.
-
- If the scene is showing a video item or something else that is
- highly animated, then it may be better to render the source into a
- texture some other way.
-
- If the embedded scene is itself a 3D scene drawn with GL, then use
- QGLPainter::pushSurface() and a QGLFramebufferObjectSurface instead
- of QGraphicsEmbedScene.
-
- \section1 Limitations
-
- When rendered into a texture, the scene does not have a QGraphicsView
- or a viewport QWidget associated with it. Graphics items that require a
- widget rendering surface will not work correctly.
-*/
-
-class QGraphicsEmbedScenePrivate : public QObject
-{
- Q_OBJECT
-public:
- QGraphicsEmbedScenePrivate(QGraphicsScene *scene, QObject *parent = 0)
- : QObject(parent)
- , dirty(true)
- , fbo(0)
- {
- format.setAttachment(QGLFramebufferObject::CombinedDepthStencil);
-
- connect(scene, SIGNAL(changed(QList<QRectF>)), this, SLOT(update()));
- connect(scene, SIGNAL(sceneRectChanged(QRectF)), this, SLOT(update()));
- }
- ~QGraphicsEmbedScenePrivate()
- {
- delete fbo;
- }
-
- bool dirty;
- QGLFramebufferObject *fbo;
- QGLFramebufferObjectFormat format;
- QPoint pressedPos;
-
-public Q_SLOTS:
- void update() { dirty = true; }
-};
-
-/*!
- Constructs an embedded graphics scene and attaches it to \a parent.
-*/
-QGraphicsEmbedScene::QGraphicsEmbedScene(QObject *parent)
- : QGraphicsScene(parent)
- , d_ptr(new QGraphicsEmbedScenePrivate(this))
-{
-}
-
-/*!
- Constructs an embedded graphics scene, using \a sceneRect for its
- scene rectangle, and attaches it to \a parent.
-*/
-QGraphicsEmbedScene::QGraphicsEmbedScene(const QRectF &sceneRect, QObject *parent)
- : QGraphicsScene(sceneRect, parent)
- , d_ptr(new QGraphicsEmbedScenePrivate(this))
-{
-}
-
-/*!
- Constructs an embedded graphics scene, using (\a x, \a y, \a width,
- \a height) for its scene rectangle, and attaches it to \a parent.
-*/
-QGraphicsEmbedScene::QGraphicsEmbedScene(qreal x, qreal y, qreal width, qreal height, QObject *parent)
- : QGraphicsScene(x, y, width, height, parent)
- , d_ptr(new QGraphicsEmbedScenePrivate(this))
-{
-}
-
-/*!
- Destroys this embedded graphics scene.
-*/
-QGraphicsEmbedScene::~QGraphicsEmbedScene()
-{
-}
-
-/*!
- Returns the framebuffer object format to use when renderToTexture()
- is called. The default is a framebuffer format with depth and
- stencil buffers, RGBA format, and no multisampling.
-
- \sa setFormat()
-*/
-QGLFramebufferObjectFormat QGraphicsEmbedScene::format() const
-{
- Q_D(const QGraphicsEmbedScene);
- return d->format;
-}
-
-/*!
- Sets the framebuffer object \a format to use when renderToTexture()
- is called.
-
- \sa format()
-*/
-void QGraphicsEmbedScene::setFormat(const QGLFramebufferObjectFormat &format)
-{
- Q_D(QGraphicsEmbedScene);
- d->format = format;
-}
-
-/*!
- Renders this scene to a GL texture and returns the texture identifier.
- If the scene has not changed since the last call, then the same
- texture identifier will be returned without repainting the scene.
-
- The \a levelOfDetail is a hint that allows some control over the
- texture size. The default value of 1 indicates that the texture size
- should be the same or similar to the size of the scene. A value of 2
- would indicate that the texture size should have twice the width and
- height. A value of 0.5 would indicate half the size.
-
- The primary use for \a levelOfDetail is to render the scene with a
- greater level of detail when the 3D object showing the texture is
- larger on-screen than the scene's natural size. The parameter can
- also be used to reduce the level of detail in the texture when the
- 3D object is very small.
-
- It is assumed that a QGLContext is bound when this function is
- called. Usually this is the QGLContext that is bound by a QPainter
- for 2D painting into a GL surface. Note however that a QGLPainter must
- not be active on the QGLContext when this function is called.
-
- \sa format()
-*/
-GLuint QGraphicsEmbedScene::renderToTexture(qreal levelOfDetail)
-{
- Q_D(QGraphicsEmbedScene);
-
- // Determine the fbo size we will need.
- QSize size = (sceneRect().size() * levelOfDetail).toSize();
- QSize fboSize = QGL::nextPowerOfTwo(size);
- if (fboSize.isEmpty())
- fboSize = QSize(16, 16);
-
- // Create or re-create the fbo.
- if (!d->fbo || d->fbo->size() != fboSize) {
- delete d->fbo;
- d->fbo = new QGLFramebufferObject(fboSize, d->format);
- if (!d->fbo->isValid()) {
- delete d->fbo;
- d->fbo = 0;
- return 0;
- }
- d->dirty = true;
- }
-
- // Return the previous texture contents if the scene hasn't changed.
- if (!d->dirty && d->fbo)
- return d->fbo->texture();
-
- // Render the scene into the fbo, scaling the QPainter's view
- // transform up to the power-of-two fbo size.
- QPainter painter(d->fbo);
- painter.setWindow(0, 0, size.width(), size.height());
- painter.setViewport(0, 0, fboSize.width(), fboSize.height());
- render(&painter);
- painter.end();
- d->dirty = false;
- return d->fbo->texture();
-}
-
-/*!
- Delivers \a event to this scene. If \a event is a mouse event, then
- \a texCoord indicates the texture co-ordinate on the side of the
- 3D object where the user clicked. This \a texCoord is used to determine
- the actual scene co-ordinate to deliver: (0, 0) corresponds to the
- bottom-left corner of the scene and (1, 1) corresponds to the
- top-right corner of the scene.
-
- The \a event normally originates from a QWidget or QGraphicsItem that
- contains the 3D object. The caller performs a ray intersection in
- 3D space on the position within \a event to determine the \a texCoord
- and then passes \a event on to deliverEvent() for further processing.
-*/
-void QGraphicsEmbedScene::deliverEvent(QEvent *event, const QPointF &texCoord)
-{
- Q_D(QGraphicsEmbedScene);
-
- // Map the texture co-ordinate into "screen" co-ordinates.
- // Mouse move and release events can extend beyond the boundaries
- // of the scene, for "click and drag off-screen" operations.
- // Mouse press and double-click events need to be constrained.
- QRectF bounds = sceneRect();
- int screenX = qRound(texCoord.x() * bounds.width());
- int screenY = qRound((1.0f - texCoord.y()) * bounds.height());
- switch (event->type()) {
- case QEvent::GraphicsSceneMousePress:
- case QEvent::GraphicsSceneMouseDoubleClick:
- case QEvent::MouseButtonPress:
- case QEvent::MouseButtonDblClick:
- if (screenX < 0)
- screenX = 0;
- else if (screenX >= bounds.width())
- screenX = qRound(bounds.width() - 1);
- if (screenY < 0)
- screenY = 0;
- else if (screenY >= bounds.height())
- screenY = qRound(bounds.height() - 1);
- d->pressedPos = QPoint(screenX, screenY);
- break;
- default: break;
- }
-
- // Convert the event and deliver it to the scene.
- switch (event->type()) {
- case QEvent::GraphicsSceneMouseMove:
- case QEvent::GraphicsSceneMousePress:
- case QEvent::GraphicsSceneMouseRelease:
- case QEvent::GraphicsSceneMouseDoubleClick: {
- QGraphicsSceneMouseEvent *ev =
- static_cast<QGraphicsSceneMouseEvent *>(event);
- QGraphicsSceneMouseEvent e(ev->type());
- e.setPos(QPointF(screenX, screenY));
- e.setScenePos(QPointF(screenX + bounds.x(), screenY + bounds.y()));
- e.setScreenPos(QPoint(screenX, screenY));
- e.setButtonDownScreenPos(ev->button(), d->pressedPos);
- e.setButtonDownScenePos
- (ev->button(), QPointF(d->pressedPos.x() + bounds.x(),
- d->pressedPos.y() + bounds.y()));
- e.setButtons(ev->buttons());
- e.setButton(ev->button());
- e.setModifiers(ev->modifiers());
- e.setAccepted(false);
- QApplication::sendEvent(this, &e);
- }
- break;
-
-#ifndef QT_NO_WHEELEVENT
- case QEvent::GraphicsSceneWheel: {
- QGraphicsSceneWheelEvent *ev =
- static_cast<QGraphicsSceneWheelEvent *>(event);
- QGraphicsSceneWheelEvent e(QEvent::GraphicsSceneWheel);
- e.setPos(QPointF(screenX, screenY));
- e.setScenePos(QPointF(screenX + bounds.x(), screenY + bounds.y()));
- e.setScreenPos(QPoint(screenX, screenY));
- e.setButtons(ev->buttons());
- e.setModifiers(ev->modifiers());
- e.setDelta(ev->delta());
- e.setOrientation(ev->orientation());
- e.setAccepted(false);
- QApplication::sendEvent(this, &e);
- }
- break;
-#endif
-
- case QEvent::MouseButtonPress:
- case QEvent::MouseButtonRelease:
- case QEvent::MouseButtonDblClick:
- case QEvent::MouseMove: {
- QMouseEvent *ev = static_cast<QMouseEvent *>(event);
- QEvent::Type type;
- if (ev->type() == QEvent::MouseButtonPress)
- type = QEvent::GraphicsSceneMousePress;
- else if (ev->type() == QEvent::MouseButtonRelease)
- type = QEvent::GraphicsSceneMouseRelease;
- else if (ev->type() == QEvent::MouseButtonDblClick)
- type = QEvent::GraphicsSceneMouseDoubleClick;
- else
- type = QEvent::GraphicsSceneMouseMove;
- QGraphicsSceneMouseEvent e(type);
- e.setPos(QPointF(screenX, screenY));
- e.setScenePos(QPointF(screenX + bounds.x(), screenY + bounds.y()));
- e.setScreenPos(QPoint(screenX, screenY));
- e.setButtonDownScreenPos(ev->button(), d->pressedPos);
- e.setButtonDownScenePos
- (ev->button(), QPointF(d->pressedPos.x() + bounds.x(),
- d->pressedPos.y() + bounds.y()));
- e.setButtons(ev->buttons());
- e.setButton(ev->button());
- e.setModifiers(ev->modifiers());
- e.setAccepted(false);
- QApplication::sendEvent(this, &e);
- }
- break;
-
-#ifndef QT_NO_WHEELEVENT
- case QEvent::Wheel: {
- QWheelEvent *ev = static_cast<QWheelEvent *>(event);
- QGraphicsSceneWheelEvent e(QEvent::GraphicsSceneWheel);
- e.setPos(QPointF(screenX, screenY));
- e.setScenePos(QPointF(screenX + bounds.x(), screenY + bounds.y()));
- e.setScreenPos(QPoint(screenX, screenY));
- e.setButtons(ev->buttons());
- e.setModifiers(ev->modifiers());
- e.setDelta(ev->delta());
- e.setOrientation(ev->orientation());
- e.setAccepted(false);
- QApplication::sendEvent(this, &e);
- }
- break;
-#endif
-
- default: {
- // Send the event directly without any conversion.
- // Typically used for keyboard, focus, and enter/leave events.
- QApplication::sendEvent(this, event);
- }
- break;
-
- }
-}
-
-/*!
- \internal
-*/
-void QGraphicsEmbedScene::drawBackground(QPainter *painter, const QRectF &rect)
-{
- if (backgroundBrush().style() == Qt::NoBrush) {
- // Fill the fbo with the transparent color as there won't
- // be a window or graphics item drawing a previous background.
- painter->save();
- painter->setCompositionMode(QPainter::CompositionMode_Source);
- painter->fillRect(rect, Qt::transparent);
- painter->restore();
- } else {
- QGraphicsScene::drawBackground(painter, rect);
- }
-}
-
-QT_END_NAMESPACE
-
-#include "qgraphicsembedscene.moc"
diff --git a/src/threed/graphicsview/qgraphicsembedscene.h b/src/threed/graphicsview/qgraphicsembedscene.h
deleted file mode 100644
index 30504aea..00000000
--- a/src/threed/graphicsview/qgraphicsembedscene.h
+++ /dev/null
@@ -1,88 +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 QGRAPHICSEMBEDSCENE_H
-#define QGRAPHICSEMBEDSCENE_H
-
-#include "qglnamespace.h"
-#include <QtGui/qgraphicsscene.h>
-#include <QtOpenGL/qgl.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class QGraphicsEmbedScenePrivate;
-class QGLFramebufferObjectFormat;
-
-class Q_QT3D_EXPORT QGraphicsEmbedScene : public QGraphicsScene
-{
- Q_OBJECT
-public:
- QGraphicsEmbedScene(QObject *parent = 0);
- QGraphicsEmbedScene(const QRectF &sceneRect, QObject *parent = 0);
- QGraphicsEmbedScene(qreal x, qreal y, qreal width, qreal height, QObject *parent = 0);
- virtual ~QGraphicsEmbedScene();
-
- QGLFramebufferObjectFormat format() const;
- void setFormat(const QGLFramebufferObjectFormat &format);
-
- GLuint renderToTexture(qreal levelOfDetail = 1.0f);
-
- void deliverEvent(QEvent *event, const QPointF &texCoord);
-
-protected:
- void drawBackground(QPainter *painter, const QRectF &rect);
-
-private:
- QScopedPointer<QGraphicsEmbedScenePrivate> d_ptr;
-
- Q_DECLARE_PRIVATE(QGraphicsEmbedScene)
- Q_DISABLE_COPY(QGraphicsEmbedScene)
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/graphicsview/qgraphicsrotation3d.cpp b/src/threed/graphicsview/qgraphicsrotation3d.cpp
deleted file mode 100644
index d23e2936..00000000
--- a/src/threed/graphicsview/qgraphicsrotation3d.cpp
+++ /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$
-**
-****************************************************************************/
-
-#include "qgraphicsrotation3d.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGraphicsRotation3D
- \brief The QGraphicsRotation3D class supports arbitrary rotation around an axis in 3D space.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::graphicsview
-
- \sa QGraphicsTranslation3D, QGraphicsScale3D
-*/
-
-/*!
- \qmlclass Rotation3D QGraphicsRotation3D
- \brief The Rotation3D item supports arbitrary rotation around an axis in 3D space.
- \since 4.8
- \ingroup qt3d::qml3d
-
- Frequently a user will create and item in the 3d world and immediately
- wish to apply a rotation to that item before it is displayed, or,
- optionally, perform an animation on that rotation parameter based on
- user inputs, or other events. Such an rotation can easily be defined
- in QML using the following code:
-
- \code
- Item3D {
- id: helicoptor
- mesh: Mesh {source: "monkey.3ds"}
- effect: Effect {}
- cullFaces: "CullBackFaces"
-
- transform: [
- Rotation3D {
- id: rotate1
- angle: 5
- axis: Qt.vector3d(1, 0, 0)
- },
- Rotation3D {
- id: rotate2
- angle: 5
- axis: Qt.vector3d(0, 1, 0)
- },
- Rotation3D {
- id: rotate3
- angle: 45
- axis: Qt.vector3d(0, 0, 1)
- }
- ]
-
- SequentialAnimation {
- NumberAnimation {target: rotate1; property: "angle"; to : 360.0; duration: 3000; easing.type:easeOutQuad }
- }
- }
- \endcode
-
- Notice here that we create a list of rotations for the \c transform
- property of the container item. By doing this we allow rotations
- around each of the axes individually in a manner which is conducive
- to animation and interaction.
-
- Each of the rotations has an \c axis property which is a QVector3D.
- This vector contains a value for each of the three components
- corresponding to x, y, and z. In the above example, we first
- rotate by 5 degrees about the x axis, then 5 degrees about the y
- axis, and finally by 45 degrees about the z axis.
-
- By giving each rotation a unique \c id users can then refer to these
- rotations in the QML source in order to perform rotational animations.
-
- \sa Translation3D, Scale3D
-*/
-
-class QGraphicsRotation3DPrivate
-{
-public:
- QGraphicsRotation3DPrivate() : axis(0, 0, 1), angle(0) {}
-
- QVector3D origin;
- QVector3D axis;
- qreal angle;
-};
-
-/*!
- Create a 3D rotation transformation and attach it to \a parent.
-*/
-QGraphicsRotation3D::QGraphicsRotation3D(QObject *parent)
- : QGraphicsTransform3D(parent)
- , d_ptr(new QGraphicsRotation3DPrivate)
-{
-}
-
-/*!
- Destroy this 3D rotation transformation.
-*/
-QGraphicsRotation3D::~QGraphicsRotation3D()
-{
-}
-
-/*!
- \property QGraphicsRotation3D::origin
- \brief the origin about which to rotate.
-
- The default value for this property is (0, 0, 0).
-*/
-
-/*!
- \qmlproperty vector3D Rotation3D::origin
-
- The origin about which to rotate. The default value for this
- property is (0, 0, 0).
-*/
-
-QVector3D QGraphicsRotation3D::origin() const
-{
- Q_D(const QGraphicsRotation3D);
- return d->origin;
-}
-
-void QGraphicsRotation3D::setOrigin(const QVector3D &value)
-{
- Q_D(QGraphicsRotation3D);
- if (d->origin != value) {
- d->origin = value;
- emit transformChanged();
- emit originChanged();
- }
-}
-
-/*!
- \property QGraphicsRotation3D::angle
- \brief the angle to rotate around the axis, in degrees anti-clockwise.
-
- The default value for this property is 0.
-*/
-
-/*!
- \qmlproperty real Rotation3D::angle
-
- The angle to rotate around the axis, in degrees anti-clockwise.
- The default value for this property is 0.
-*/
-
-qreal QGraphicsRotation3D::angle() const
-{
- Q_D(const QGraphicsRotation3D);
- return d->angle;
-}
-
-void QGraphicsRotation3D::setAngle(qreal value)
-{
- Q_D(QGraphicsRotation3D);
- if (d->angle != value) {
- d->angle = value;
- emit transformChanged();
- emit angleChanged();
- }
-}
-
-/*!
- \property QGraphicsRotation3D::axis
- \brief the axis to rotate around.
-
- The default value for this property is (0, 0, 1); i.e. the z-axis.
-*/
-
-/*!
- \qmlproperty vector3D Rotation3D::axis
-
- The axis to rotate around. The default value for this property
- is (0, 0, 1); i.e. the z-axis.
-*/
-
-QVector3D QGraphicsRotation3D::axis() const
-{
- Q_D(const QGraphicsRotation3D);
- return d->axis;
-}
-
-void QGraphicsRotation3D::setAxis(const QVector3D &value)
-{
- Q_D(QGraphicsRotation3D);
- if (d->axis != value) {
- d->axis = value;
- emit transformChanged();
- emit axisChanged();
- }
-}
-
-/*!
- \internal
-*/
-void QGraphicsRotation3D::applyTo(QMatrix4x4 *matrix) const
-{
- Q_D(const QGraphicsRotation3D);
- matrix->translate(d->origin);
- matrix->rotate(d->angle, d->axis.x(), d->axis.y(), d->axis.z());
- matrix->translate(-d->origin);
-}
-
-/*!
- \internal
-*/
-QGraphicsTransform3D *QGraphicsRotation3D::clone(QObject *parent) const
-{
- Q_D(const QGraphicsRotation3D);
- QGraphicsRotation3D *copy = new QGraphicsRotation3D(parent);
- copy->setOrigin(d->origin);
- copy->setAxis(d->axis);
- copy->setAngle(d->angle);
- return copy;
-}
-
-/*!
- \fn void QGraphicsRotation3D::originChanged()
-
- Signal that is emitted when origin() changes.
-*/
-
-/*!
- \fn void QGraphicsRotation3D::angleChanged()
-
- Signal that is emitted when angle() changes.
-*/
-
-/*!
- \fn void QGraphicsRotation3D::axisChanged()
-
- Signal that is emitted when axis() changes.
-*/
-
-QT_END_NAMESPACE
diff --git a/src/threed/graphicsview/qgraphicsrotation3d.h b/src/threed/graphicsview/qgraphicsrotation3d.h
deleted file mode 100644
index 4ba47e84..00000000
--- a/src/threed/graphicsview/qgraphicsrotation3d.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 QGRAPHICSROTATION3D_H
-#define QGRAPHICSROTATION3D_H
-
-#include "qgraphicstransform3d.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-class QGraphicsRotation3DPrivate;
-
-class Q_QT3D_EXPORT QGraphicsRotation3D : public QGraphicsTransform3D
-{
- Q_OBJECT
- Q_PROPERTY(QVector3D origin READ origin WRITE setOrigin NOTIFY originChanged)
- Q_PROPERTY(qreal angle READ angle WRITE setAngle NOTIFY angleChanged)
- Q_PROPERTY(QVector3D axis READ axis WRITE setAxis NOTIFY axisChanged)
-public:
- QGraphicsRotation3D(QObject *parent = 0);
- ~QGraphicsRotation3D();
-
- QVector3D origin() const;
- void setOrigin(const QVector3D &value);
-
- qreal angle() const;
- void setAngle(qreal value);
-
- QVector3D axis() const;
- void setAxis(const QVector3D &value);
-
- void applyTo(QMatrix4x4 *matrix) const;
- QGraphicsTransform3D *clone(QObject *parent) const;
-
-Q_SIGNALS:
- void originChanged();
- void angleChanged();
- void axisChanged();
-
-private:
- QScopedPointer<QGraphicsRotation3DPrivate> d_ptr;
-
- Q_DISABLE_COPY(QGraphicsRotation3D)
- Q_DECLARE_PRIVATE(QGraphicsRotation3D)
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/graphicsview/qgraphicsscale3d.cpp b/src/threed/graphicsview/qgraphicsscale3d.cpp
deleted file mode 100644
index cbf060bd..00000000
--- a/src/threed/graphicsview/qgraphicsscale3d.cpp
+++ /dev/null
@@ -1,339 +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 "qgraphicsscale3d.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGraphicsScale3D
- \brief The QGraphicsScale3D class supports scaling of items in 3D.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::graphicsview
-
- \sa QGraphicsRotation3D, QGraphicsTranslation3D
-*/
-
-/*!
- \qmlclass Scale3D QGraphicsScale3D
- \brief The Scale3D item supports scaling of items in 3D.
- \since 4.8
- \ingroup qt3d::qml3d
-
- 3D items in QML can have a simple scale applied directly as follows:
-
- \code
- Item3D {
- mesh: Mesh { source: "chair.3ds" }
- scale: 0.5
- }
- \endcode
-
- An alternative is to use Scale3D to apply a transform directly
- to an item as part of a sequence of transformations:
-
- \code
- Item3D {
- mesh: Mesh { source: "chair.3ds" }
- transform: [
- Translation3D { translate: Qt.vector3d(5, 0, 0) },
- Scale3D { scale: 0.5 }
- ]
- }
- \endcode
-
- This allows the application writer to control exactly when the
- scale occurs relative to other transformations. In the example
- above, the item is first translated by 5 units along the x-axis,
- and then the co-ordinates are scaled by half. This is distinct
- from the following example which scales the object to half its
- original size and then translates it by 5 units along the x-axis:
-
- \code
- Item3D {
- mesh: Mesh { source: "chair.3ds" }
- transform: [
- Scale3D { scale: 0.5 },
- Translation3D { translate: Qt.vector3d(5, 0, 0) }
- ]
- }
- \endcode
-
- The scale property on the item itself is applied before
- any of the transforms. So the previous example is equivalent to:
-
- \code
- Item3D {
- mesh: Mesh { source: "chair.3ds" }
- scale: 0.5
- transform: [
- Translation3D { translate: Qt.vector3d(5, 0, 0) }
- ]
- }
- \endcode
-
- Scale values can also affect the x, y, and z axes by different amounts
- by using a \c{vector3D} value:
-
- \code
- Item3D {
- mesh: Mesh { source: "chair.3ds" }
- transform: [
- Scale3D { scale: Qt.vector3d(0.5, 0.2, 1.0) },
- Translation3D { translate: Qt.vector3d(5, 0, 0) }
- ]
- }
- \endcode
-
- \sa Rotation3D, Translation3D
-*/
-
-class QGraphicsScale3DPrivate
-{
-public:
- QGraphicsScale3DPrivate()
- : scale(1, 1, 1)
- , isIdentityScale(true)
- , isIdentityOrigin(true)
- {}
-
- QVector3D origin;
- QVector3D scale;
- bool isIdentityScale;
- bool isIdentityOrigin;
-};
-
-/*!
- Construct a 3D scale transform and attach it to \a parent.
-*/
-QGraphicsScale3D::QGraphicsScale3D(QObject *parent)
- : QGraphicsTransform3D(parent), d_ptr(new QGraphicsScale3DPrivate)
-{
-}
-
-/*!
- Destroy this 3D scale transform.
-*/
-QGraphicsScale3D::~QGraphicsScale3D()
-{
-}
-
-/*!
- \property QGraphicsScale3D::origin
- \brief the origin about which to scale.
-
- The default value for this property is (0, 0, 0).
-*/
-
-/*!
- \qmlproperty vector3D Scale3D::origin
-
- The origin about which to scale. The default value for this
- property is (0, 0, 0).
-*/
-
-QVector3D QGraphicsScale3D::origin() const
-{
- Q_D(const QGraphicsScale3D);
- return d->origin;
-}
-
-void QGraphicsScale3D::setOrigin(const QVector3D &value)
-{
- Q_D(QGraphicsScale3D);
-
- // Optimise for the common case of setting the origin to 0, 0, 0
- // Also minimise the number of floating point compares required
- bool changed = false;
- QVector3D v = value;
-
- // Are we about to set to 0, 0, 0 ...?
- // Normalise inbound value & record in bool to save on compares
- bool isSetToZeroOrigin = false;
- if (qFuzzyIsNull(v.x()) && qFuzzyIsNull(v.y()) && qFuzzyIsNull(v.z()))
- {
- v = QVector3D(0, 0, 0);
- isSetToZeroOrigin = true;
- }
- if (!isSetToZeroOrigin)
- {
- if (d->origin != v)
- {
- d->origin = v;
- d->isIdentityOrigin = false;
- changed = true;
- }
- }
- else
- {
- if (!d->isIdentityOrigin)
- {
- d->origin = v;
- d->isIdentityOrigin = true;
- changed = true;
- }
- }
- if (changed)
- {
- emit transformChanged();
- emit originChanged();
- }
-}
-
-/*!
- \property QGraphicsScale3D::scale
- \brief the amount with which to scale each component.
-
- The default value for this property is QVector3D(1, 1, 1).
-*/
-
-/*!
- \qmlproperty vector3D Scale3D::scale
-
- The amount with which to scale each component. The default value for
- this property is (1, 1, 1).
-
- This property can be specified as either a vector3D or a single
- floating-point value. A single floating-point value will set
- the x, y, and z scale components to the same value. In other words,
- the following two transformations are equivalent:
-
- \code
- Scale3D { scale: 2 }
- Scale3D { scale: Qt.vector3d(2, 2, 2) }
- \endcode
-*/
-
-QVector3D QGraphicsScale3D::scale() const
-{
- Q_D(const QGraphicsScale3D);
- return d->scale;
-}
-
-void QGraphicsScale3D::setScale(const QVector3D &value)
-{
- Q_D(QGraphicsScale3D);
-
- // Optimise for the common case of setting the scale to 1, 1, 1
- // Also minimise the number of floating point compares required
- bool changed = false;
- QVector3D v = value;
-
- // Are we about to set to 1, 1, 1 ...?
- // Normalise inbound value & record in bool to save on compares
- bool isSetToIdentity = false;
- if (qFuzzyIsNull(v.x() - 1.0f) && qFuzzyIsNull(v.y() - 1.0f) && qFuzzyIsNull(v.z() - 1.0f))
- {
- v = QVector3D(1, 1, 1);
- isSetToIdentity = true;
- }
- if (!isSetToIdentity)
- {
- if (d->scale != v)
- {
- d->scale = v;
- d->isIdentityScale = false;
- changed = true;
- }
- }
- else
- {
- if (!d->isIdentityScale)
- {
- d->scale = v;
- d->isIdentityScale = true;
- changed = true;
- }
- }
- if (changed)
- {
- emit transformChanged();
- emit scaleChanged();
- }
-}
-
-/*!
- \internal
-*/
-void QGraphicsScale3D::applyTo(QMatrix4x4 *matrix) const
-{
- Q_D(const QGraphicsScale3D);
- if (!d->isIdentityScale)
- {
- if (d->isIdentityOrigin)
- {
- matrix->scale(d->scale);
- }
- else
- {
- matrix->translate(d->origin);
- matrix->scale(d->scale);
- matrix->translate(-d->origin);
- }
- }
-}
-
-/*!
- \internal
-*/
-QGraphicsTransform3D *QGraphicsScale3D::clone(QObject *parent) const
-{
- Q_D(const QGraphicsScale3D);
- QGraphicsScale3D *copy = new QGraphicsScale3D(parent);
- copy->setOrigin(d->origin);
- copy->setScale(d->scale);
- return copy;
-}
-
-/*!
- \fn void QGraphicsScale3D::originChanged()
-
- Signal that is emitted when origin() changes.
-*/
-
-/*!
- \fn void QGraphicsScale3D::scaleChanged()
-
- Signal that is emitted when scale() changes.
-*/
-
-QT_END_NAMESPACE
diff --git a/src/threed/graphicsview/qgraphicsscale3d.h b/src/threed/graphicsview/qgraphicsscale3d.h
deleted file mode 100644
index 36a6ede5..00000000
--- a/src/threed/graphicsview/qgraphicsscale3d.h
+++ /dev/null
@@ -1,88 +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 QGRAPHICSSCALE3D_H
-#define QGRAPHICSSCALE3D_H
-
-#include "qgraphicstransform3d.h"
-#include <QtCore/qscopedpointer.h>
-#include <QtCore/qvariant.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-class QGraphicsScale3DPrivate;
-
-class Q_QT3D_EXPORT QGraphicsScale3D : public QGraphicsTransform3D
-{
- Q_OBJECT
- Q_PROPERTY(QVector3D origin READ origin WRITE setOrigin NOTIFY originChanged)
- Q_PROPERTY(QVector3D scale READ scale WRITE setScale NOTIFY scaleChanged)
-public:
- QGraphicsScale3D(QObject *parent = 0);
- ~QGraphicsScale3D();
-
- QVector3D origin() const;
- void setOrigin(const QVector3D &value);
-
- QVector3D scale() const;
- void setScale(const QVector3D &value);
-
- void applyTo(QMatrix4x4 *matrix) const;
- QGraphicsTransform3D *clone(QObject *parent) const;
-
-Q_SIGNALS:
- void originChanged();
- void scaleChanged();
-
-private:
- QScopedPointer<QGraphicsScale3DPrivate> d_ptr;
-
- Q_DISABLE_COPY(QGraphicsScale3D)
- Q_DECLARE_PRIVATE(QGraphicsScale3D)
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/graphicsview/qgraphicstransform3d.cpp b/src/threed/graphicsview/qgraphicstransform3d.cpp
deleted file mode 100644
index 1cc34383..00000000
--- a/src/threed/graphicsview/qgraphicstransform3d.cpp
+++ /dev/null
@@ -1,112 +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 "qgraphicstransform3d.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGraphicsTransform3D
- \brief The QGraphicsTransform3D class is an abstract base class for building 3D transformations.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::graphicsview
-
- QGraphicsTransform3D lets you create and control advanced transformations
- that can be configured independently using specialized properties.
- Scene nodes have an associated list of transforms, which are applied
- in order, one at a time, to the modelview matrix. Transformations are
- computed in true 3D space using QMatrix4x4.
-
- QGraphicsTransform3D is particularly useful for animations. Whereas
- QGLPainter::modelViewMatrix() lets you assign any transform directly,
- there is no direct way to interpolate between two different
- transformations (e.g., when transitioning between two states, each for
- which the item has a different arbitrary transform assigned). Using
- QGraphicsTransform3D you can interpolate the property values of each
- independent transformation. The resulting operation is then combined into a
- single transform which is applied to the modelview matrix during drawing.
-
- If you want to create your own configurable transformation, you can create
- a subclass of QGraphicsTransform3D (or any or the existing subclasses), and
- reimplement the pure virtual applyTo() function, which takes a pointer to a
- QMatrix4x4. Each operation you would like to apply should be exposed as
- properties (e.g., customTransform->setVerticalShear(2.5)). Inside you
- reimplementation of applyTo(), you can modify the provided transform
- respectively.
-
- \sa QGraphicsScale3D, QGraphicsRotation3D, QGraphicsTranslation3D
- \sa QGraphicsBillboardTransform
-*/
-
-/*!
- \fn QGraphicsTransform3D::QGraphicsTransform3D(QObject *parent)
-
- Constructs a 3D transformation and attaches it to \a parent.
-*/
-
-/*!
- \fn QGraphicsTransform3D::~QGraphicsTransform3D()
-
- Destroys this 3D transformation.
-*/
-
-/*!
- \fn void QGraphicsTransform3D::applyTo(QMatrix4x4 *matrix) const
-
- Applies the effect of this transformation to the specified
- modelview \a matrix.
-*/
-
-/*!
- \fn QGraphicsTransform3D *QGraphicsTransform3D::clone(QObject *parent) const
-
- Clones a copy of this transformation and attaches the clone to \a parent.
-*/
-
-/*!
- \fn void QGraphicsTransform3D::transformChanged()
-
- Signal that is emitted whenever any of the transformation's
- parameters are changed.
-*/
-
-QT_END_NAMESPACE
diff --git a/src/threed/graphicsview/qgraphicstransform3d.h b/src/threed/graphicsview/qgraphicstransform3d.h
deleted file mode 100644
index 024a9786..00000000
--- a/src/threed/graphicsview/qgraphicstransform3d.h
+++ /dev/null
@@ -1,71 +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 QGRAPHICSTRANSFORM3D_H
-#define QGRAPHICSTRANSFORM3D_H
-
-#include <QtCore/qobject.h>
-#include <QtGui/qmatrix4x4.h>
-#include "qt3dglobal.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-class Q_QT3D_EXPORT QGraphicsTransform3D : public QObject
-{
- Q_OBJECT
-public:
- QGraphicsTransform3D(QObject *parent = 0) : QObject(parent) {}
- ~QGraphicsTransform3D() {}
-
- virtual void applyTo(QMatrix4x4 *matrix) const = 0;
- virtual QGraphicsTransform3D *clone(QObject *parent = 0) const = 0;
-
-Q_SIGNALS:
- void transformChanged();
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/graphicsview/qgraphicstranslation3d.cpp b/src/threed/graphicsview/qgraphicstranslation3d.cpp
deleted file mode 100644
index 1b5d1211..00000000
--- a/src/threed/graphicsview/qgraphicstranslation3d.cpp
+++ /dev/null
@@ -1,233 +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 "qgraphicstranslation3d.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGraphicsTranslation3D
- \brief The QGraphicsTranslation3D class supports translation of 3D items.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::graphicsview
-
- QGraphicsTranslation3D is derived directly from QGraphicsTransform, and
- provides a \l translate property to specify the 3D vector to
- apply to incoming co-ordinates.
-
- The \l progress property can be used to perform animation along a
- translation vector by varying the progress value between 0 and 1.
- Overshoot animations are also possible by setting the progress
- value to something outside this range. The default progress
- value is 1.
-
- \sa QGraphicsRotation3D, QGraphicsScale3D
-*/
-
-/*!
- \qmlclass Translation3D QGraphicsTranslation3D
- \brief The Translation3D item supports translation of items in 3D.
- \since 4.8
- \ingroup qt3d::qml3d
-
- 3D items in QML are typically positioned directly as follows:
-
- \code
- Item3D {
- mesh: Mesh { source: "chair.3ds" }
- position: Qt.vector3d(0, 5, 10)
- }
- \endcode
-
- However, it can sometimes be useful to translate an object along a
- vector under the control of an animation. The Translate3D
- element can be used for this purpose. The following example
- translates the object along a straight-line path 5 units to
- the right of its original position, and then back again:
-
- \code
- Item3D {
- mesh: Mesh { source: "chair.3ds" }
- position: Qt.vector3d(0, 5, 10)
- transform: [
- Translation3D {
- translate: Qt.vector3d(5, 0, 0)
- SequentialAnimation on progress {
- running: true
- loops: Animation.Infinite
- NumberAnimation { to : 1.0; duration: 300 }
- NumberAnimation { to : 0.0; duration: 300 }
- }
- }
- ]
- }
- \endcode
-
- \sa Rotation3D, Scale3D
-*/
-
-class QGraphicsTranslation3DPrivate
-{
-public:
- QGraphicsTranslation3DPrivate() : progress(1.0f) {}
-
- QVector3D translate;
- qreal progress;
-};
-
-/*!
- Constructs a new translation and attaches it to \a parent.
-*/
-QGraphicsTranslation3D::QGraphicsTranslation3D(QObject *parent)
- : QGraphicsTransform3D(parent), d_ptr(new QGraphicsTranslation3DPrivate)
-{
-}
-
-/*!
- Destroys this translation.
-*/
-QGraphicsTranslation3D::~QGraphicsTranslation3D()
-{
-}
-
-/*!
- \property QGraphicsTranslation3D::translate
- \brief the translation to apply to incoming co-ordinates.
-
- The default value for this property is (0, 0, 0).
-*/
-
-/*!
- \qmlproperty vector3D Translation3D::translate
-
- The translation to apply to incoming co-ordinates. The default value
- for this property is (0, 0, 0).
-*/
-
-QVector3D QGraphicsTranslation3D::translate() const
-{
- Q_D(const QGraphicsTranslation3D);
- return d->translate;
-}
-
-void QGraphicsTranslation3D::setTranslate(const QVector3D &value)
-{
- Q_D(QGraphicsTranslation3D);
- if (d->translate != value) {
- d->translate = value;
- emit transformChanged();
- emit translateChanged();
- }
-}
-
-/*!
- \property QGraphicsTranslation3D::progress
- \brief the progress along the translation vector, from 0 to 1.
-
- The default value for this property is 1.
-
- This property can be used to perform animation along a translation
- vector by varying the progress between 0 and 1. Overshoot animations
- are also possible by setting the value to something outside this range.
-*/
-
-/*!
- \qmlproperty real Translation3D::progress
-
- The progress along the translation vector, from 0 to 1. The default
- value for this property is 1.
-
- This property can be used to perform animation along a translation
- vector by varying the progress between 0 and 1. Overshoot animations
- are also possible by setting the value to something outside this range.
-*/
-
-qreal QGraphicsTranslation3D::progress() const
-{
- Q_D(const QGraphicsTranslation3D);
- return d->progress;
-}
-
-void QGraphicsTranslation3D::setProgress(qreal value)
-{
- Q_D(QGraphicsTranslation3D);
- if (d->progress != value) {
- d->progress = value;
- emit transformChanged();
- emit progressChanged();
- }
-}
-
-/*!
- \internal
-*/
-void QGraphicsTranslation3D::applyTo(QMatrix4x4 *matrix) const
-{
- Q_D(const QGraphicsTranslation3D);
- matrix->translate(d->translate * d->progress);
-}
-
-/*!
- \internal
-*/
-QGraphicsTransform3D *QGraphicsTranslation3D::clone(QObject *parent) const
-{
- Q_D(const QGraphicsTranslation3D);
- QGraphicsTranslation3D *copy = new QGraphicsTranslation3D(parent);
- copy->setTranslate(d->translate);
- copy->setProgress(d->progress);
- return copy;
-}
-
-/*!
- \fn void QGraphicsTranslation3D::translateChanged()
-
- Signal that is emitted when translate() changes.
-*/
-
-/*!
- \fn void QGraphicsTranslation3D::progressChanged()
-
- Signal that is emitted when progress() changes.
-*/
-
-QT_END_NAMESPACE
diff --git a/src/threed/graphicsview/qgraphicstranslation3d.h b/src/threed/graphicsview/qgraphicstranslation3d.h
deleted file mode 100644
index 0ccab5d3..00000000
--- a/src/threed/graphicsview/qgraphicstranslation3d.h
+++ /dev/null
@@ -1,87 +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 QGRAPHICSTRANSLATION3D_H
-#define QGRAPHICSTRANSLATION3D_H
-
-#include "qgraphicstransform3d.h"
-#include <QtCore/qscopedpointer.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-class QGraphicsTranslation3DPrivate;
-
-class Q_QT3D_EXPORT QGraphicsTranslation3D : public QGraphicsTransform3D
-{
- Q_OBJECT
- Q_PROPERTY(QVector3D translate READ translate WRITE setTranslate NOTIFY translateChanged)
- Q_PROPERTY(qreal progress READ progress WRITE setProgress NOTIFY progressChanged)
-public:
- QGraphicsTranslation3D(QObject *parent = 0);
- ~QGraphicsTranslation3D();
-
- QVector3D translate() const;
- void setTranslate(const QVector3D &value);
-
- qreal progress() const;
- void setProgress(qreal value);
-
- void applyTo(QMatrix4x4 *matrix) const;
- QGraphicsTransform3D *clone(QObject *parent) const;
-
-Q_SIGNALS:
- void translateChanged();
- void progressChanged();
-
-private:
- QScopedPointer<QGraphicsTranslation3DPrivate> d_ptr;
-
- Q_DISABLE_COPY(QGraphicsTranslation3D)
- Q_DECLARE_PRIVATE(QGraphicsTranslation3D)
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/materials/materials.pri b/src/threed/materials/materials.pri
deleted file mode 100644
index 27ba1ffe..00000000
--- a/src/threed/materials/materials.pri
+++ /dev/null
@@ -1,18 +0,0 @@
-
-INCLUDEPATH += $$PWD
-VPATH += $$PWD
-
-HEADERS += \
- materials/qglabstractmaterial.h \
- materials/qglcolormaterial.h \
- materials/qglmaterial.h \
- materials/qgltwosidedmaterial.h
-
-SOURCES += \
- qglabstractmaterial.cpp \
- qglcolormaterial.cpp \
- qglmaterial.cpp \
- qgltwosidedmaterial.cpp
-
-PRIVATE_HEADERS += \
- qglmaterial_p.h
diff --git a/src/threed/materials/qglabstractmaterial.cpp b/src/threed/materials/qglabstractmaterial.cpp
deleted file mode 100644
index 63406cdf..00000000
--- a/src/threed/materials/qglabstractmaterial.cpp
+++ /dev/null
@@ -1,239 +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 "qglabstractmaterial.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGLAbstractMaterial
- \since 4.8
- \brief The QGLAbstractMaterial class provides a standard interface for rendering surface materials with GL.
- \ingroup qt3d
- \ingroup qt3d::materials
-
- Materials are the primary method to specify the surface appearance of an
- object, as distinct from the geometry for the object. Materials have an
- almost endless variety of parameters:
-
- \list
- \o Properties of the material under various lighting conditions;
- i.e., the traditional parameters for ambient, diffuse, specular, etc.
- \o Textures in multiple layers, with different combination modes;
- decal, modulate, replace, etc.
- \o Environmental conditions such as fogging.
- \o Alpha values for opacity and blending.
- \o Interpolation factors for animated surface effects.
- \o etc
- \endlist
-
- QGLAbstractMaterial is the base class for all such materials.
- It provides a very simple API to bind() a material to a QGLPainter
- when the material needs to be rendered, to release() a material
- from a QGLPainter when the material is no longer needed, and to
- prepareToDraw().
-
- Subclasses of QGLAbstractMaterial implement specific materials.
- QGLMaterial provides the traditional ambient, diffuse, specular, etc
- parameters for lighting properties.
-
- Materials are distinct from \i effects, which have the base class
- QGLAbstractEffect. Effects are typically shader programs that are
- used to render a specific type of material. The material's bind()
- function will use QGLPainter::setStandardEffect() or
- QGLPainter::setUserEffect() to select the exact effect that is
- needed to render the material.
-
- It is possible that the same material may be rendered with different
- effects depending upon the material parameters. For example, a lit
- material may select a simpler and more efficient shader program effect
- if the material has the default spotlight properties, or if the
- QGLPainter only has a single light source specified.
-
- \sa QGLMaterial, QGLAbstractEffect
-*/
-
-/*!
- Constructs a new material and attaches it to \a parent.
-*/
-QGLAbstractMaterial::QGLAbstractMaterial(QObject *parent)
- : QObject(parent)
-{
-}
-
-/*!
- Destroys this material.
-*/
-QGLAbstractMaterial::~QGLAbstractMaterial()
-{
-}
-
-/*!
- Returns the material lighting parameters for rendering the front
- faces of fragments with this abstract material. The default
- implementation returns null.
-
- This function is provided as a convenience for applications that
- wish to alter the lighting parameters or textures of a material,
- without regard to any wrapping that has been performed to add
- blending or other options.
-
- \sa back(), QGLMaterial
-*/
-QGLMaterial *QGLAbstractMaterial::front() const
-{
- return 0;
-}
-
-/*!
- Returns the material lighting parameters for rendering the back
- faces of fragments with this abstract material. The default
- implementation returns null, which indicates that front()
- is also used to render back faces.
-
- \sa front(), QGLMaterial
-*/
-QGLMaterial *QGLAbstractMaterial::back() const
-{
- return 0;
-}
-
-/*!
- \fn bool QGLAbstractMaterial::isTransparent() const
-
- Returns true if this material is transparent and will therefore
- require the \c{GL_BLEND} mode to be enabled to render the material.
- Returns false if the material is fully opaque.
-*/
-
-/*!
- \fn void QGLAbstractMaterial::bind(QGLPainter *painter)
-
- Binds resources to \a painter that are needed to render this
- material; textures, shader programs, blending modes, etc.
-
- In the following example, lit material parameters and a texture
- are bound to the \a painter, for rendering with the standard
- QGL::LitModulateTexture2D effect:
-
- \code
- void TexturedLitMaterial::bind(QGLPainter *painter)
- {
- painter->setStandardEffect(QGL::LitModulateTexture2D);
- painter->setFaceMaterial(QGL::AllFaces, material);
- painter->glActiveTexture(GL_TEXTURE0);
- texture->bind();
- }
- \endcode
-
- Normally the effect is bound to \a painter during the bind()
- function. However, some materials may need to use different
- effects depending upon which attributes are present in the
- geometry. For example, a per-vertex color effect instead of a
- uniform color effect if the geometry has the QGL::Color attribute.
- The prepareToDraw() function can be overridden to alter the
- effect once the specific set of geometry attributes are known.
-
- \sa release(), prepareToDraw()
-*/
-
-/*!
- \fn void QGLAbstractMaterial::release(QGLPainter *painter, QGLAbstractMaterial *next)
-
- Releases resources from \a painter that were used to render this
- material. The QGLPainter::effect() can be left bound to \a painter,
- but other resources such as textures and blending modes
- should be disabled.
-
- If \a next is not null, then it indicates the next material that
- will be bound to \a painter. If \a next is the same type of
- material as this material, then this function can choose not to
- release resources that would be immediately re-bound to
- \a painter in the next call to bind().
-
- In the following example, texture unit 0 is unbound if \a painter
- is about to switch to another effect that is not an instance
- of \c{TexturedLitMaterial}:
-
- \code
- void TexturedLitMaterial::release(QGLPainter *painter, QGLAbstractMaterial *next)
- {
- if (!qobject_cast<TexturedLitMaterial *>(next)) {
- painter->glActiveTexture(GL_TEXTURE0);
- glBindTexture(GL_TEXTURE_2D, 0);
- }
- }
- \endcode
-
- \sa bind(), prepareToDraw()
-*/
-
-/*!
- Prepares to draw geometry to \a painter that has the specified
- set of vertex \a attributes. The default implementation
- does nothing.
-
- Multiple effects may be used to render some materials depending upon
- the available vertex attributes. For example, if QGL::Color is
- present in \a attributes, then a per-vertex color should be used
- instead of a single uniform color.
-
- This function is provided for such materials to have one last
- chance during QGLPainter::draw() to alter the QGLPainter::effect()
- to something that is tuned for the specific geometry. It can
- be assumed that bind() has already been called on this material.
-
- \sa bind(), release()
-*/
-void QGLAbstractMaterial::prepareToDraw(QGLPainter *painter, const QGLAttributeSet &attributes)
-{
- Q_UNUSED(painter);
- Q_UNUSED(attributes);
-}
-
-/*!
- \fn void QGLAbstractMaterial::materialChanged()
-
- Signal that is emitted when an object that is using this material
- should be redrawn because some property on the material has changed.
-*/
-
-QT_END_NAMESPACE
diff --git a/src/threed/materials/qglabstractmaterial.h b/src/threed/materials/qglabstractmaterial.h
deleted file mode 100644
index 8d4bd2e4..00000000
--- a/src/threed/materials/qglabstractmaterial.h
+++ /dev/null
@@ -1,82 +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 QGLABSTRACTMATERIAL_H
-#define QGLABSTRACTMATERIAL_H
-
-#include <QtCore/qobject.h>
-#include "qglattributeset.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class QGLPainter;
-class QGLMaterial;
-
-class Q_QT3D_EXPORT QGLAbstractMaterial : public QObject
-{
- Q_OBJECT
- Q_DISABLE_COPY(QGLAbstractMaterial)
-public:
- explicit QGLAbstractMaterial(QObject *parent = 0);
- ~QGLAbstractMaterial();
-
- virtual QGLMaterial *front() const;
- virtual QGLMaterial *back() const;
-
- virtual bool isTransparent() const = 0;
-
- virtual void bind(QGLPainter *painter) = 0;
- virtual void release(QGLPainter *painter, QGLAbstractMaterial *next) = 0;
- virtual void prepareToDraw(QGLPainter *painter, const QGLAttributeSet &attributes);
-
-Q_SIGNALS:
- void materialChanged();
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/materials/qglcolormaterial.cpp b/src/threed/materials/qglcolormaterial.cpp
deleted file mode 100644
index 383deb13..00000000
--- a/src/threed/materials/qglcolormaterial.cpp
+++ /dev/null
@@ -1,162 +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 "qglcolormaterial.h"
-#include "qglpainter.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGLColorMaterial
- \since 4.8
- \brief The QGLColorMaterial class implements flat or per-vertex color materials for 3D rendering.
- \ingroup qt3d
- \ingroup qt3d::materials
-
- When bound to a QGLPainter, QGLColorMaterial will select a flat
- color drawing effect, to render fragments with color(), ignoring
- any lights or textures that may be active on the QGLPainter state.
- If the geometry has the QGL::Color attribute, then a per-vertex
- color will be used instead and color() is ignored.
-
- \sa QGLMaterial
-*/
-
-class QGLColorMaterialPrivate
-{
-public:
- QGLColorMaterialPrivate() : color(255, 255, 255, 255) {}
-
- QColor color;
-};
-
-/*!
- Constructs a new flat color material and attaches it to \a parent.
-*/
-QGLColorMaterial::QGLColorMaterial(QObject *parent)
- : QGLAbstractMaterial(parent)
- , d_ptr(new QGLColorMaterialPrivate)
-{
-}
-
-/*!
- Destroys this flat color material.
-*/
-QGLColorMaterial::~QGLColorMaterial()
-{
-}
-
-/*!
- \property QGLColorMaterial::color
- \brief the flat color to use to render the material. The default
- color is white.
-
- If the geometry has per-vertex colors, then this property is ignored.
-
- \sa colorChanged()
-*/
-
-QColor QGLColorMaterial::color() const
-{
- Q_D(const QGLColorMaterial);
- return d->color;
-}
-
-void QGLColorMaterial::setColor(const QColor &color)
-{
- Q_D(QGLColorMaterial);
- if (d->color != color) {
- d->color = color;
- emit colorChanged();
- emit materialChanged();
- }
-}
-
-/*!
- \reimp
-*/
-bool QGLColorMaterial::isTransparent() const
-{
- Q_D(const QGLColorMaterial);
- return d->color.alpha() != 255;
-}
-
-/*!
- \reimp
-*/
-void QGLColorMaterial::bind(QGLPainter *painter)
-{
- Q_D(const QGLColorMaterial);
- painter->setColor(d->color);
- // Effect is set during prepareToDraw().
-}
-
-/*!
- \reimp
-*/
-void QGLColorMaterial::release(QGLPainter *painter, QGLAbstractMaterial *next)
-{
- // No textures or other modes, so nothing to do here.
- Q_UNUSED(painter);
- Q_UNUSED(next);
-}
-
-/*!
- \reimp
-*/
-void QGLColorMaterial::prepareToDraw
- (QGLPainter *painter, const QGLAttributeSet &attributes)
-{
- if (attributes.contains(QGL::Color))
- painter->setStandardEffect(QGL::FlatPerVertexColor);
- else
- painter->setStandardEffect(QGL::FlatColor);
-}
-
-/*!
- \fn void QGLColorMaterial::colorChanged()
-
- Signal that is emitted when color() changes.
-
- \sa color()
-*/
-
-QT_END_NAMESPACE
diff --git a/src/threed/materials/qglcolormaterial.h b/src/threed/materials/qglcolormaterial.h
deleted file mode 100644
index 96600875..00000000
--- a/src/threed/materials/qglcolormaterial.h
+++ /dev/null
@@ -1,85 +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 QGLCOLORMATERIAL_H
-#define QGLCOLORMATERIAL_H
-
-#include "qglabstractmaterial.h"
-#include <QtGui/qcolor.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class QGLColorMaterialPrivate;
-
-class Q_QT3D_EXPORT QGLColorMaterial : public QGLAbstractMaterial
-{
- Q_OBJECT
- Q_DECLARE_PRIVATE(QGLColorMaterial)
- Q_DISABLE_COPY(QGLColorMaterial)
- Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
-public:
- explicit QGLColorMaterial(QObject *parent = 0);
- ~QGLColorMaterial();
-
- QColor color() const;
- void setColor(const QColor &color);
-
- bool isTransparent() const;
- void bind(QGLPainter *painter);
- void release(QGLPainter *painter, QGLAbstractMaterial *next);
- void prepareToDraw(QGLPainter *painter, const QGLAttributeSet &attributes);
-
-Q_SIGNALS:
- void colorChanged();
-
-private:
- QScopedPointer<QGLColorMaterialPrivate> d_ptr;
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/materials/qglmaterial.cpp b/src/threed/materials/qglmaterial.cpp
deleted file mode 100644
index 6b672180..00000000
--- a/src/threed/materials/qglmaterial.cpp
+++ /dev/null
@@ -1,587 +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 "qglmaterial.h"
-#include "qglmaterial_p.h"
-#include "qglpainter.h"
-#include "qgltexture2d.h"
-#include "qglmaterialcollection.h"
-#include "qgllightmodel.h"
-#include "qfileinfo.h"
-
-#include <QtCore/qurl.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGLMaterial
- \brief The QGLMaterial class describes one-sided material properties for rendering fragments.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::materials
-
- \sa QGLTwoSidedMaterial
-*/
-
-/*!
- \qmlclass Material QGLMaterial
- \brief The Material item describes material properties for OpenGL drawing.
- \since 4.8
- \ingroup qt3d::qml3d
-*/
-
-QGLMaterialPrivate::QGLMaterialPrivate()
- : specularColor(0, 0, 0, 255),
- emittedLight(0, 0, 0, 255),
- shininess(0),
- collection(0),
- index(-1),
- used(false)
-{
- ambientColor.setRgbF(0.2f, 0.2f, 0.2f, 1.0f);
- diffuseColor.setRgbF(0.8f, 0.8f, 0.8f, 1.0f);
-}
-
-/*!
- Constructs a QGLMaterial object with its default values,
- and attaches it to \a parent.
-*/
-QGLMaterial::QGLMaterial(QObject *parent)
- : QGLAbstractMaterial(parent)
- , d_ptr(new QGLMaterialPrivate)
-{
-}
-
-/*!
- Destroys this QGLMaterial object.
-*/
-QGLMaterial::~QGLMaterial()
-{
-}
-
-/*!
- \property QGLMaterial::ambientColor
- \brief the ambient color of the material. The default value
- is (0.2, 0.2, 0.2, 1.0).
-
- \sa diffuseColor(), specularColor(), ambientColorChanged()
-*/
-
-/*!
- \qmlproperty color Material::ambientColor
- The ambient color of the material. The default value
- is (0.2, 0.2, 0.2, 1.0).
-
- \sa diffuseColor, specularColor
-*/
-
-QColor QGLMaterial::ambientColor() const
-{
- Q_D(const QGLMaterial);
- return d->ambientColor;
-}
-
-void QGLMaterial::setAmbientColor(const QColor& value)
-{
- Q_D(QGLMaterial);
- if (d->ambientColor != value) {
- d->ambientColor = value;
- emit ambientColorChanged();
- emit materialChanged();
- }
-}
-
-/*!
- \property QGLMaterial::diffuseColor
- \brief the diffuse color of the material. The default value
- is (0.8, 0.8, 0.8, 1.0).
-
- \sa ambientColor(), specularColor(), diffuseColorChanged()
-*/
-
-/*!
- \qmlproperty color Material::diffuseColor
- The diffuse color of the material. The default value
- is (0.8, 0.8, 0.8, 1.0).
-
- \sa ambientColor, specularColor
-*/
-
-QColor QGLMaterial::diffuseColor() const
-{
- Q_D(const QGLMaterial);
- return d->diffuseColor;
-}
-
-void QGLMaterial::setDiffuseColor(const QColor& value)
-{
- Q_D(QGLMaterial);
- if (d->diffuseColor != value) {
- d->diffuseColor = value;
- emit diffuseColorChanged();
- emit materialChanged();
- }
-}
-
-/*!
- \property QGLMaterial::specularColor
- \brief the specular color of the material. The default value
- is (0, 0, 0, 1).
-
- \sa ambientColor(), diffuseColor(), specularColorChanged()
-*/
-
-/*!
- \qmlproperty color Material::specularColor
- The specular color of the material. The default value
- is (0, 0, 0, 1).
-
- \sa ambientColor, diffuseColor
-*/
-
-QColor QGLMaterial::specularColor() const
-{
- Q_D(const QGLMaterial);
- return d->specularColor;
-}
-
-void QGLMaterial::setSpecularColor(const QColor& value)
-{
- Q_D(QGLMaterial);
- if (d->specularColor != value) {
- d->specularColor = value;
- emit specularColorChanged();
- emit materialChanged();
- }
-}
-
-/*!
- \property QGLMaterial::emittedLight
- \brief the emitted light intensity of the material.
- The default value is (0.0, 0.0, 0.0, 1.0), which indicates
- that the material does not emit any light.
-
- \sa emittedLightChanged()
-*/
-
-/*!
- \qmlproperty color Material::emittedLight
- The emitted light intensity of the material.
- The default value is (0.0, 0.0, 0.0, 1.0), which indicates
- that the material does not emit any light.
-*/
-
-QColor QGLMaterial::emittedLight() const
-{
- Q_D(const QGLMaterial);
- return d->emittedLight;
-}
-
-void QGLMaterial::setEmittedLight(const QColor& value)
-{
- Q_D(QGLMaterial);
- if (d->emittedLight != value) {
- d->emittedLight = value;
- emit emittedLightChanged();
- emit materialChanged();
- }
-}
-
-/*!
- Sets ambientColor() to 20% of \a value, and diffuseColor() to 80% of
- \a value. This is a convenience function for quickly setting ambient
- and diffuse lighting colors based on a flat color.
-
- \sa ambientColor(), diffuseColor()
-*/
-void QGLMaterial::setColor(const QColor& value)
-{
- Q_D(QGLMaterial);
- d->ambientColor.setRgbF
- (value.redF() * 0.2f, value.greenF() * 0.2f,
- value.blueF() * 0.2f, value.alphaF());
- d->diffuseColor.setRgbF
- (value.redF() * 0.8f, value.greenF() * 0.8f,
- value.blueF() * 0.8f, value.alphaF());
- emit ambientColorChanged();
- emit diffuseColorChanged();
- emit materialChanged();
-}
-
-/*!
- \property QGLMaterial::shininess
- \brief the specular exponent of the material, or how shiny it is.
- Must be between 0 and 128. The default value is 0. A value outside
- this range will be clamped to the range when the property is set.
-
- \sa shininessChanged()
-*/
-
-/*!
- \qmlproperty real Material::shininess
- The specular exponent of the material, or how shiny it is.
- Must be between 0 and 128. The default value is 0. A value outside
- this range will be clamped to the range when the property is set.
-*/
-
-qreal QGLMaterial::shininess() const
-{
- Q_D(const QGLMaterial);
- return d->shininess;
-}
-
-void QGLMaterial::setShininess(qreal value)
-{
- Q_D(QGLMaterial);
- if (value < 0)
- value = 0;
- else if (value > 128)
- value = 128;
- if (d->shininess != value) {
- d->shininess = value;
- emit shininessChanged();
- emit materialChanged();
- }
-}
-
-/*!
- \property QGLMaterial::texture
- \brief the 2D texture associated with \a layer on this material;
- null if no texture.
-
- Layer 0 is normally the primary texture associated with the material.
- Multiple texture layers may be specified for materials with special
- blending effects or to specify ambient, diffuse, or specular colors
- pixel-by-pixel.
-
- \sa texturesChanged()
-*/
-QGLTexture2D *QGLMaterial::texture(int layer) const
-{
- Q_D(const QGLMaterial);
- return d->textures.value(layer, 0);
-}
-
-void QGLMaterial::setTexture(QGLTexture2D *value, int layer)
-{
- Q_ASSERT(layer >= 0);
- Q_D(QGLMaterial);
- QGLTexture2D *prev = d->textures.value(layer, 0);
- if (prev != value) {
- delete prev;
- d->textures[layer] = value;
- emit texturesChanged();
- emit materialChanged();
- }
-}
-
-/*!
- \property QGLMaterial::textureUrl
- \brief URL of the 2D texture associated with \a layer on this material.
-
- By default \a layer is 0, the primary texture.
-
- If the URL has not been specified, then this property is a null QUrl.
-
- Setting this property to a non-empty URL will replace any existing texture
- with a new texture based on the image at the given \a url. If that
- image is not a valid texture then the new texture will be a null texture.
-
- If an empty url is set, this has the same effect as \c{setTexture(0)}.
-
- \sa texture(), setTexture()
-*/
-QUrl QGLMaterial::textureUrl(int layer) const
-{
- Q_D(const QGLMaterial);
- QGLTexture2D *tex = d->textures.value(layer, 0);
- if (tex)
- return tex->url();
- else
- return QUrl();
-}
-
-void QGLMaterial::setTextureUrl(const QUrl &url, int layer)
-{
- Q_ASSERT(layer >= 0);
- if (textureUrl(layer) != url)
- {
- QGLTexture2D *tex = 0;
- if (!url.isEmpty())
- {
- tex = new QGLTexture2D(this);
- connect(tex, SIGNAL(textureUpdated()), this, SIGNAL(texturesChanged()));
- tex->setUrl(url);
- }
- setTexture(tex, layer);
- }
-}
-
-/*!
- \enum QGLMaterial::TextureCombineMode
- This enum defines the mode to use when combining a texture with
- the material colors on a QGLMaterial object.
-
- \value Modulate Modulate the texture with the lighting
- conditions to produce a lit texture.
- \value Decal Combine the texture with the lighting conditions
- to produce a decal effect.
- \value Replace Replace with the contents of the texture,
- ignoring colors and lighting conditions.
-*/
-
-/*!
- \property QGLMaterial::textureCombineMode
- \brief the texture combine mode associated with \a layer on this material.
- The default value is \l Modulate.
-
- \sa texturesChanged()
-*/
-
-QGLMaterial::TextureCombineMode QGLMaterial::textureCombineMode(int layer) const
-{
- Q_D(const QGLMaterial);
- return d->textureModes.value(layer, Modulate);
-}
-
-void QGLMaterial::setTextureCombineMode(QGLMaterial::TextureCombineMode mode, int layer)
-{
- Q_D(QGLMaterial);
- if (d->textureModes.value(layer, Modulate) != mode) {
- d->textureModes[layer] = mode;
- emit texturesChanged();
- emit materialChanged();
- }
-}
-
-/*!
- Returns the number of texture layers associated with this material.
-
- The return value may be larger than the number of actual texture
- layers if some of the intermediate layers are null. For example,
- setting layers 0 and 2 will report textureLayerCount() as 3.
- The main use of this value is to iterate over all layers.
-
- \sa texture()
-*/
-int QGLMaterial::textureLayerCount() const
-{
- Q_D(const QGLMaterial);
- int maxLayer = -1;
- if (!d->textures.isEmpty())
- maxLayer = qMax(maxLayer, (d->textures.end() - 1).key());
- return maxLayer + 1;
-}
-
-/*!
- \reimp
- Returns this material.
-*/
-QGLMaterial *QGLMaterial::front() const
-{
- return const_cast<QGLMaterial *>(this);
-}
-
-/*!
- \reimp
-*/
-bool QGLMaterial::isTransparent() const
-{
- Q_D(const QGLMaterial);
- bool transparent = (d->diffuseColor.alpha() != 255);
- QMap<int, QGLTexture2D *>::ConstIterator it;
- for (it = d->textures.begin(); it != d->textures.end(); ++it) {
- TextureCombineMode mode = d->textureModes.value(it.key(), Modulate);
- if (mode == Modulate) {
- // Texture alpha adds to the current alpha.
- if (it.value() && it.value()->hasAlphaChannel())
- transparent = true;
- } else if (mode == Replace) {
- // Replace the current alpha with the texture's alpha.
- if (it.value())
- transparent = it.value()->hasAlphaChannel();
- }
- }
- return transparent;
-}
-
-/*!
- \reimp
-*/
-void QGLMaterial::bind(QGLPainter *painter)
-{
- painter->setFaceMaterial(QGL::AllFaces, this);
- const_cast<QGLLightModel *>(painter->lightModel())
- ->setModel(QGLLightModel::OneSided); // FIXME
- bindTextures(painter);
-}
-
-/*!
- \internal
-*/
-void QGLMaterial::bindTextures(QGLPainter *painter)
-{
- Q_D(const QGLMaterial);
- QMap<int, QGLTexture2D *>::ConstIterator it;
- for (it = d->textures.begin(); it != d->textures.end(); ++it) {
- QGLTexture2D *tex = it.value();
- painter->glActiveTexture(GL_TEXTURE0 + it.key());
- if (tex)
- tex->bind();
- else
- glBindTexture(GL_TEXTURE_2D, 0);
- }
-}
-
-/*!
- \reimp
-*/
-void QGLMaterial::release(QGLPainter *painter, QGLAbstractMaterial *next)
-{
- Q_UNUSED(next);
- Q_D(const QGLMaterial);
- QMap<int, QGLTexture2D *>::ConstIterator it;
- for (it = d->textures.begin(); it != d->textures.end(); ++it) {
- painter->glActiveTexture(GL_TEXTURE0 + it.key());
- glBindTexture(GL_TEXTURE_2D, 0);
- }
-}
-
-/*!
- \reimp
-*/
-void QGLMaterial::prepareToDraw
- (QGLPainter *painter, const QGLAttributeSet &attributes)
-{
- bindEffect(painter, attributes, false);
-}
-
-/*!
- \internal
-*/
-void QGLMaterial::bindEffect
- (QGLPainter *painter, const QGLAttributeSet &attributes, bool twoSided)
-{
- Q_D(const QGLMaterial);
- Q_UNUSED(twoSided);
- QGL::StandardEffect effect = QGL::LitMaterial;
- if (!d->textures.isEmpty() && attributes.contains(QGL::TextureCoord0)) {
- // TODO: different combine modes for each layer.
- QGLMaterial::TextureCombineMode mode =
- d->textureModes.value(0, Modulate);
- if (mode == Replace)
- effect = QGL::FlatReplaceTexture2D;
- else if (mode == Decal)
- effect = QGL::LitDecalTexture2D;
- else
- effect = QGL::LitModulateTexture2D;
- }
- painter->setStandardEffect(effect);
-}
-
-/*!
- \fn void QGLMaterial::ambientColorChanged()
-
- This signal is emitted when ambientColor() changes.
-
- \sa ambientColor(), setAmbientColor(), materialChanged()
-*/
-
-/*!
- \fn void QGLMaterial::diffuseColorChanged()
-
- This signal is emitted when diffuseColor() changes.
-
- \sa diffuseColor(), setDiffuseColor(), materialChanged()
-*/
-
-/*!
- \fn void QGLMaterial::specularColorChanged()
-
- This signal is emitted when specularColor() changes.
-
- \sa specularColor(), setSpecularColor(), materialChanged()
-*/
-
-/*!
- \fn void QGLMaterial::emittedLightChanged()
-
- This signal is emitted when emittedLight() changes.
-
- \sa emittedLight(), setEmittedLight(), materialChanged()
-*/
-
-/*!
- \fn void QGLMaterial::shininessChanged()
-
- This signal is emitted when shininess() changes.
-
- \sa shininess(), setShininess(), materialChanged()
-*/
-
-/*!
- \fn void QGLMaterial::texturesChanged()
-
- This signal is emitted when the texture layers associated with
- this material change.
-
- \sa texture(), setTexture(), materialChanged()
-*/
-
-#ifndef QT_NO_DEBUG_STREAM
-
-QDebug operator<<(QDebug dbg, const QGLMaterial &material)
-{
- dbg << &material <<
- "-- Amb:" << material.ambientColor() <<
- "-- Diff:" << material.diffuseColor() <<
- "-- Spec:" << material.specularColor() <<
- "-- Shin:" << material.shininess();
- for (int i = 0; i < material.textureLayerCount(); ++i)
- if (material.texture(i) != 0)
- dbg << "\n -- Tex" << i << ":" << material.texture(i)
- << material.texture(i)->objectName();
- dbg << "\n";
- return dbg;
-}
-#endif
-
-QT_END_NAMESPACE
diff --git a/src/threed/materials/qglmaterial.h b/src/threed/materials/qglmaterial.h
deleted file mode 100644
index 148e3510..00000000
--- a/src/threed/materials/qglmaterial.h
+++ /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 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 QGLMATERIAL_H
-#define QGLMATERIAL_H
-
-#include "qglabstractmaterial.h"
-#include <QtCore/qobject.h>
-#include <QtCore/qscopedpointer.h>
-#include <QtGui/qcolor.h>
-#include <QtCore/qurl.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class QGLMaterialPrivate;
-class QGLTexture2D;
-class QGLTextureCube;
-class QGLPainter;
-class QGLMaterialCollection;
-class QGLTwoSidedMaterial;
-
-class Q_QT3D_EXPORT QGLMaterial : public QGLAbstractMaterial
-{
- Q_OBJECT
- Q_DECLARE_PRIVATE(QGLMaterial)
- Q_DISABLE_COPY(QGLMaterial)
- Q_ENUMS(TextureCombineMode)
- Q_PROPERTY(QColor ambientColor READ ambientColor WRITE setAmbientColor NOTIFY ambientColorChanged)
- Q_PROPERTY(QColor diffuseColor READ diffuseColor WRITE setDiffuseColor NOTIFY diffuseColorChanged)
- Q_PROPERTY(QColor specularColor READ specularColor WRITE setSpecularColor NOTIFY specularColorChanged)
- Q_PROPERTY(QColor emittedLight READ emittedLight WRITE setEmittedLight NOTIFY emittedLightChanged)
- Q_PROPERTY(qreal shininess READ shininess WRITE setShininess NOTIFY shininessChanged)
- Q_PROPERTY(QGLTexture2D *texture READ texture WRITE setTexture NOTIFY texturesChanged)
- Q_PROPERTY(QGLMaterial::TextureCombineMode textureCombineMode READ textureCombineMode WRITE setTextureCombineMode NOTIFY texturesChanged)
- Q_PROPERTY(QUrl textureUrl READ textureUrl WRITE setTextureUrl NOTIFY texturesChanged)
-public:
- explicit QGLMaterial(QObject *parent = 0);
- ~QGLMaterial();
-
- QColor ambientColor() const;
- void setAmbientColor(const QColor& value);
-
- QColor diffuseColor() const;
- void setDiffuseColor(const QColor& value);
-
- QColor specularColor() const;
- void setSpecularColor(const QColor& value);
-
- QColor emittedLight() const;
- void setEmittedLight(const QColor& value);
-
- void setColor(const QColor& value);
-
- qreal shininess() const;
- void setShininess(qreal value);
-
- QGLTexture2D *texture(int layer = 0) const;
- void setTexture(QGLTexture2D *value, int layer = 0);
-
- QUrl textureUrl(int layer = 0) const;
- void setTextureUrl(const QUrl &url, int layer = 0);
-
- enum TextureCombineMode
- {
- Modulate,
- Decal,
- Replace
- };
-
- QGLMaterial::TextureCombineMode textureCombineMode(int layer = 0) const;
- void setTextureCombineMode(QGLMaterial::TextureCombineMode mode, int layer = 0);
-
- int textureLayerCount() const;
-
- QGLMaterial *front() const;
- bool isTransparent() const;
- void bind(QGLPainter *painter);
- void release(QGLPainter *painter, QGLAbstractMaterial *next);
- void prepareToDraw(QGLPainter *painter, const QGLAttributeSet &attributes);
-
-Q_SIGNALS:
- void ambientColorChanged();
- void diffuseColorChanged();
- void specularColorChanged();
- void emittedLightChanged();
- void shininessChanged();
- void texturesChanged();
-
-private:
- friend class QGLMaterialCollection;
- friend class QGLTwoSidedMaterial;
-
- void bindTextures(QGLPainter *painter);
- void bindEffect(QGLPainter *painter, const QGLAttributeSet &attributes, bool twoSided);
-
- QScopedPointer<QGLMaterialPrivate> d_ptr;
-};
-
-#ifndef QT_NO_DEBUG_STREAM
-Q_QT3D_EXPORT QDebug operator<<(QDebug dbg, const QGLMaterial &material);
-#endif
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/materials/qglmaterial_p.h b/src/threed/materials/qglmaterial_p.h
deleted file mode 100644
index d935a40a..00000000
--- a/src/threed/materials/qglmaterial_p.h
+++ /dev/null
@@ -1,85 +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 QGLMATERIAL_P_H
-#define QGLMATERIAL_P_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 "qglmaterial.h"
-#include <QtCore/qmap.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-class QGLMaterialPrivate
-{
-public:
- explicit QGLMaterialPrivate();
-
- QColor ambientColor;
- QColor diffuseColor;
- QColor specularColor;
- QColor emittedLight;
- qreal shininess;
- QMap<int, QGLTexture2D *> textures;
- QMap<int, QGLMaterial::TextureCombineMode> textureModes;
- QGLMaterialCollection *collection;
- int index;
- QString name;
- bool used;
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/materials/qgltwosidedmaterial.cpp b/src/threed/materials/qgltwosidedmaterial.cpp
deleted file mode 100644
index 0a1ee026..00000000
--- a/src/threed/materials/qgltwosidedmaterial.cpp
+++ /dev/null
@@ -1,259 +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 "qgltwosidedmaterial.h"
-#include "qglpainter.h"
-#include "qgllightmodel.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGLTwoSidedMaterial
- \since 4.8
- \brief The QGLTwoSidedMaterial class implemented two-sided materials for 3D rendering.
- \ingroup qt3d
- \ingroup qt3d::materials
-
- Two-sided materials consist of a front() material and a back()
- material. The specific material rendered is determined by the
- direction faced by a fragment when it is rendered. Fragments
- that point towards the viewer are rendered with front(),
- and fragments that point away from the viewer are rendered
- with back(). In both cases, any textures that are used to
- render the material are taken from front().
-
- If front() and back() are the same, then the same material
- will be used on both sides of the fragment. However, this
- is not exactly the same as using a one-sided QGLMaterial in
- place of the two-sided material. One-sided materials will
- render the back of the fragment as black because the normal
- is always pointing away from the viewer. Two-sided materials
- reverse the back-facing normal so that back() is lit as
- though it was on a front-facing face.
-
- \sa QGLMaterial
-*/
-
-class QGLTwoSidedMaterialPrivate
-{
-public:
- QGLTwoSidedMaterialPrivate() : front(0), back(0), defaultMaterial(0) {}
-
- QGLMaterial *front;
- QGLMaterial *back;
- QGLMaterial *defaultMaterial;
-};
-
-/*!
- Constructs a two-sided material object and attaches it to \a parent.
-
- \sa setFront(), setBack()
-*/
-QGLTwoSidedMaterial::QGLTwoSidedMaterial(QObject *parent)
- : QGLAbstractMaterial(parent)
- , d_ptr(new QGLTwoSidedMaterialPrivate)
-{
-}
-
-/*!
- Destroys this two-sided material object.
-*/
-QGLTwoSidedMaterial::~QGLTwoSidedMaterial()
-{
-}
-
-/*!
- \property QGLTwoSidedMaterial::front
- \brief the material for the front side of the object's fragments.
-
- The default value is null, which will result in a default QGLMaterial
- object being used when bind() is called.
-
- \sa back(), frontChanged(), materialChanged()
-*/
-
-QGLMaterial *QGLTwoSidedMaterial::front() const
-{
- Q_D(const QGLTwoSidedMaterial);
- return d->front;
-}
-
-void QGLTwoSidedMaterial::setFront(QGLMaterial *material)
-{
- Q_D(QGLTwoSidedMaterial);
- if (d->front != material) {
- if (d->front && d->front != d->back) {
- disconnect(d->front, SIGNAL(materialChanged()),
- this, SIGNAL(materialChanged()));
- }
- d->front = material;
- if (d->front && d->front != d->back) {
- connect(d->front, SIGNAL(materialChanged()),
- this, SIGNAL(materialChanged()));
- }
- emit frontChanged();
- emit materialChanged();
- }
-}
-
-/*!
- \property QGLTwoSidedMaterial::back
- \brief the material for the back side of the object's fragments.
-
- The default value is null, which indicates that front() should
- be used on both the front and back sides of the object's fragments.
-
- Textures are taken from the front() material. Any textures that
- appear in the back() material are ignored. Only the material
- lighting parameters from back() will be used.
-
- \sa front(), backChanged(), materialChanged()
-*/
-
-QGLMaterial *QGLTwoSidedMaterial::back() const
-{
- Q_D(const QGLTwoSidedMaterial);
- return d->back;
-}
-
-void QGLTwoSidedMaterial::setBack(QGLMaterial *material)
-{
- Q_D(QGLTwoSidedMaterial);
- if (d->back != material) {
- if (d->back && d->back != d->front) {
- disconnect(d->back, SIGNAL(materialChanged()),
- this, SIGNAL(materialChanged()));
- }
- d->back = material;
- if (d->back && d->back != d->front) {
- connect(d->back, SIGNAL(materialChanged()),
- this, SIGNAL(materialChanged()));
- }
- emit backChanged();
- emit materialChanged();
- }
-}
-
-/*!
- \reimp
-*/
-bool QGLTwoSidedMaterial::isTransparent() const
-{
- Q_D(const QGLTwoSidedMaterial);
- if (d->front && d->front->isTransparent())
- return true;
- return d->back && d->back->isTransparent();
-}
-
-/*!
- \reimp
-*/
-void QGLTwoSidedMaterial::bind(QGLPainter *painter)
-{
- Q_D(QGLTwoSidedMaterial);
- QGLMaterial *front = d->front;
- if (!front) {
- // We need to have something for the front material.
- front = d->defaultMaterial;
- if (!front) {
- d->defaultMaterial = new QGLMaterial(this);
- front = d->defaultMaterial;
- }
- }
- const_cast<QGLLightModel *>(painter->lightModel())
- ->setModel(QGLLightModel::TwoSided); // FIXME
- if (d->back && d->back != front) {
- painter->setFaceMaterial(QGL::FrontFaces, front);
- painter->setFaceMaterial(QGL::BackFaces, d->back);
- } else {
- painter->setFaceMaterial(QGL::AllFaces, front);
- }
- front->bindTextures(painter);
-}
-
-/*!
- \reimp
-*/
-void QGLTwoSidedMaterial::release(QGLPainter *painter, QGLAbstractMaterial *next)
-{
- Q_D(const QGLTwoSidedMaterial);
- if (d->front)
- d->front->release(painter, next);
- else if (d->defaultMaterial)
- d->defaultMaterial->release(painter, next);
-}
-
-/*!
- \reimp
-*/
-void QGLTwoSidedMaterial::prepareToDraw
- (QGLPainter *painter, const QGLAttributeSet &attributes)
-{
- Q_D(QGLTwoSidedMaterial);
- QGLMaterial *front = d->front;
- if (!front)
- front = d->defaultMaterial;
- front->bindEffect(painter, attributes, true);
-}
-
-/*!
- \fn void QGLTwoSidedMaterial::frontChanged()
-
- Signal that is emitted when the front() material pointer changes.
-
- This signal is not emitted when a property on front() changes.
- Use materialChanged() for that purpose instead.
-
- \sa front(), backChanged()
-*/
-
-/*!
- \fn void QGLTwoSidedMaterial::backChanged()
-
- Signal that is emitted when the back() material pointer changes.
-
- This signal is not emitted when a property on back() changes.
- Use materialChanged() for that purpose instead.
-
- \sa back(), frontChanged()
-*/
-
-QT_END_NAMESPACE
diff --git a/src/threed/materials/qgltwosidedmaterial.h b/src/threed/materials/qgltwosidedmaterial.h
deleted file mode 100644
index acba2451..00000000
--- a/src/threed/materials/qgltwosidedmaterial.h
+++ /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 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 QGLTWOSIDEDMATERIAL_H
-#define QGLTWOSIDEDMATERIAL_H
-
-#include "qglmaterial.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class QGLTwoSidedMaterialPrivate;
-
-class Q_QT3D_EXPORT QGLTwoSidedMaterial : public QGLAbstractMaterial
-{
- Q_OBJECT
- Q_DECLARE_PRIVATE(QGLTwoSidedMaterial)
- Q_DISABLE_COPY(QGLTwoSidedMaterial)
- Q_PROPERTY(QGLMaterial *front READ front WRITE setFront NOTIFY frontChanged)
- Q_PROPERTY(QGLMaterial *back READ back WRITE setBack NOTIFY backChanged)
-public:
- explicit QGLTwoSidedMaterial(QObject *parent = 0);
- ~QGLTwoSidedMaterial();
-
- QGLMaterial *front() const;
- void setFront(QGLMaterial *material);
-
- QGLMaterial *back() const;
- void setBack(QGLMaterial *material);
-
- bool isTransparent() const;
- void bind(QGLPainter *painter);
- void release(QGLPainter *painter, QGLAbstractMaterial *next);
- void prepareToDraw(QGLPainter *painter, const QGLAttributeSet &attributes);
-
-Q_SIGNALS:
- void frontChanged();
- void backChanged();
-
-private:
- QScopedPointer<QGLTwoSidedMaterialPrivate> d_ptr;
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/math3d/math3d.pri b/src/threed/math3d/math3d.pri
deleted file mode 100644
index 0d36db90..00000000
--- a/src/threed/math3d/math3d.pri
+++ /dev/null
@@ -1,12 +0,0 @@
-INCLUDEPATH += $$PWD
-VPATH += $$PWD
-HEADERS += math3d/qbox3d.h \
- math3d/qplane3d.h \
- math3d/qray3d.h \
- math3d/qsphere3d.h \
- math3d/qtriangle3d.h
-SOURCES += qbox3d.cpp \
- qplane3d.cpp \
- qray3d.cpp \
- qsphere3d.cpp \
- qtriangle3d.cpp
diff --git a/src/threed/math3d/qbox3d.cpp b/src/threed/math3d/qbox3d.cpp
deleted file mode 100644
index a1603c84..00000000
--- a/src/threed/math3d/qbox3d.cpp
+++ /dev/null
@@ -1,690 +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 "qbox3d.h"
-#include "qplane3d.h"
-#include <QtGui/qmatrix4x4.h>
-#include <QtCore/qlist.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QBox3D
- \brief The QBox3D class represents an axis-aligned box in 3D space.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::math
-
- QBox3D can be used to represent the bounding box of objects in a 3D
- scene so that they can be easily culled if they are out of view.
-
- The sides of the box are always aligned with the x, y, and z axes of
- the world co-ordinate system. Transforming a box with transformed()
- will result in the smallest axis-aligned bounding box that contains
- the transformed box.
-
- Boxes may be null, finite, or infinite. A null box does not occupy
- any space and does not intersect with any other box. A finite
- box consists of a minimum() and maximum() extent in 3D space.
- An infinite box encompasses all points in 3D space.
-
- The extents of a finite box are also included within the box.
- A box with minimum() and maximum() set to the same value
- contains a single point.
-*/
-
-/*!
- \fn QBox3D::QBox3D()
-
- Constructs a null box in 3D space.
-
- \sa isNull()
-*/
-
-/*!
- \fn QBox3D::QBox3D(const QVector3D& corner1, const QVector3D& corner2)
-
- Constructs a finite box in 3D space from \a corner1 to \a corner2.
- The minimum() and maximum() co-ordinates of the new box are set
- to the minimum and maximum x, y, and z values from \a corner1 and
- \a corner2. The \a corner1 and \a corner2 values can be any two
- opposite corners that define the box.
-
- \sa isFinite(), minimum(), maximum()
-*/
-
-/*!
- \fn bool QBox3D::isNull() const
-
- Returns true if this box is null; false otherwise.
-
- \sa isFinite(), isInfinite(), setToNull()
-*/
-
-/*!
- \fn bool QBox3D::isFinite() const
-
- Returns true if this box is finite in size; false otherwise.
-
- \sa isNull(), isInfinite(), setExtents()
-*/
-
-/*!
- \fn bool QBox3D::isInfinite() const
-
- Returns true if this box is infinite in size; false otherwise.
-
- \sa isNull(), isFinite(), setToInfinite()
-*/
-
-/*!
- \fn QVector3D QBox3D::minimum() const
-
- Returns the minimum corner of this box.
-
- \sa maximum(), setExtents()
-*/
-
-/*!
- \fn QVector3D QBox3D::maximum() const
-
- Returns the maximum corner of this box.
-
- \sa minimum(), setExtents()
-*/
-
-/*!
- \fn void QBox3D::setExtents(const QVector3D& corner1, const QVector3D& corner2)
-
- Sets the extents of this box to a finite region from \a corner1 to
- \a corner2. The minimum() and maximum() co-ordinates of the box are
- set to the minimum and maximum x, y, and z values from \a corner1 and
- \a corner2. The \a corner1 and \a corner2 values can be any two
- opposite corners that define the box.
-
- \sa minimum(), maximum()
-*/
-
-/*!
- \fn void QBox3D::setToNull()
-
- Sets this box to null.
-
- \sa isNull()
-*/
-
-/*!
- \fn void QBox3D::setToInfinite()
-
- Sets this box to be infinite in size.
-
- \sa isInfinite()
-*/
-
-/*!
- \fn QVector3D QBox3D::size() const
-
- Returns the finite size of this box. If this box is null or
- infinite, the returned value will be zero.
-
- \sa center(), isNull(), isInfinite()
-*/
-
-/*!
- \fn QVector3D QBox3D::center() const
-
- Returns the finite center of this box. If this box is null
- or infinite, the returned value will be zero.
-
- \sa size(), isNull(), isInfinite()
-*/
-
-/*!
- \fn bool QBox3D::contains(const QVector3D& point) const
-
- Returns true if this box contains \a point; false otherwise.
- Null boxes do not contain any points and infinite boxes contain
- all points.
-
- Containment is not a strict test: the point is contained if it
- lies on one of the faces of the box.
-
- \sa intersects()
-*/
-
-/*!
- \fn bool QBox3D::contains(const QBox3D& box) const
-
- Returns true if this box completely contains \a box. If this box
- is null, then it will not contain \a box. If this box is infinite,
- and \a box is not null, then \a box will be contained within this box.
- If \a box is infinite, then this box must also be infinite to contain it.
-
- \sa intersects()
-*/
-
-/*!
- Returns true if \a box intersects this box; false otherwise.
-
- \sa intersect(), intersected(), contains()
-*/
-bool QBox3D::intersects(const QBox3D& box) const
-{
- if (boxtype == Null)
- return false;
- else if (boxtype == Infinite)
- return box.boxtype != Null;
- else if (box.boxtype == Null)
- return false;
- else if (box.boxtype == Infinite)
- return true;
-
- if (maxcorner.x() < box.mincorner.x())
- return false;
- if (mincorner.x() > box.maxcorner.x())
- return false;
-
- if (maxcorner.y() < box.mincorner.y())
- return false;
- if (mincorner.y() > box.maxcorner.y())
- return false;
-
- if (maxcorner.z() < box.mincorner.z())
- return false;
- if (mincorner.z() > box.maxcorner.z())
- return false;
-
- return true;
-}
-
-/*!
- Returns true if \a ray intersects this box; false otherwise.
-
- \sa intersection()
-*/
-bool QBox3D::intersects(const QRay3D &ray) const
-{
- qreal minimum_t, maximum_t;
- return intersection(ray, &minimum_t, &maximum_t);
-}
-
-static inline void trackIntersectionX
- (const QBox3D &box, const QRay3D &ray, qreal t,
- qreal *minimum_t, qreal *maximum_t, bool *found)
-{
- QVector3D point = ray.point(t);
- if (point.y() < box.minimum().y() || point.y() > box.maximum().y())
- return;
- if (point.z() < box.minimum().z() || point.z() > box.maximum().z())
- return;
- if (!(*found)) {
- *minimum_t = *maximum_t = t;
- *found = true;
- } else {
- if (t < *minimum_t)
- *minimum_t = t;
- if (t > *maximum_t)
- *maximum_t = t;
- }
-}
-
-static inline void trackIntersectionY
- (const QBox3D &box, const QRay3D &ray, qreal t,
- qreal *minimum_t, qreal *maximum_t, bool *found)
-{
- QVector3D point = ray.point(t);
- if (point.x() < box.minimum().x() || point.x() > box.maximum().x())
- return;
- if (point.z() < box.minimum().z() || point.z() > box.maximum().z())
- return;
- if (!(*found)) {
- *minimum_t = *maximum_t = t;
- *found = true;
- } else {
- if (t < *minimum_t)
- *minimum_t = t;
- if (t > *maximum_t)
- *maximum_t = t;
- }
-}
-
-static inline void trackIntersectionZ
- (const QBox3D &box, const QRay3D &ray, qreal t,
- qreal *minimum_t, qreal *maximum_t, bool *found)
-{
- QVector3D point = ray.point(t);
- if (point.x() < box.minimum().x() || point.x() > box.maximum().x())
- return;
- if (point.y() < box.minimum().y() || point.y() > box.maximum().y())
- return;
- if (!(*found)) {
- *minimum_t = *maximum_t = t;
- *found = true;
- } else {
- if (t < *minimum_t)
- *minimum_t = t;
- if (t > *maximum_t)
- *maximum_t = t;
- }
-}
-
-/*!
- Finds the \a minimum_t and \a maximum_t values where \a ray intersects
- this box. Returns true if intersections were found; or false if there
- is no intersection.
-
- If \a minimum_t and \a maximum_t are set to the same value, then the
- intersection is at a corner or the volume of the box is zero.
- If the t values are negative, then the intersection occurs before the
- ray's origin point in the reverse direction of the ray.
-
- The \a minimum_t and \a maximum_t values can be passed to QRay3D::point()
- to determine the actual intersection points, as shown in the following
- example:
-
- \code
- qreal minimum_t, maximum_t;
- if (box.intersection(ray, &minimum_t, &maximum_t)) {
- qDebug() << "intersections at"
- << ray.point(minimum_t) << "and"
- << ray.point(maximum_t);
- }
- \endcode
-
- \sa intersects(), QRay3D::point()
-*/
-bool QBox3D::intersection(const QRay3D &ray, qreal *minimum_t, qreal *maximum_t) const
-{
- bool found = false;
- QVector3D origin = ray.origin();
- QVector3D direction = ray.direction();
- *minimum_t = *maximum_t = qSNaN();
- if (boxtype == Finite) {
- if (direction.x() != 0.0f) {
- trackIntersectionX
- (*this, ray, (mincorner.x() - origin.x()) / direction.x(),
- minimum_t, maximum_t, &found);
- trackIntersectionX
- (*this, ray, (maxcorner.x() - origin.x()) / direction.x(),
- minimum_t, maximum_t, &found);
- }
- if (direction.y() != 0.0f) {
- trackIntersectionY
- (*this, ray, (mincorner.y() - origin.y()) / direction.y(),
- minimum_t, maximum_t, &found);
- trackIntersectionY
- (*this, ray, (maxcorner.y() - origin.y()) / direction.y(),
- minimum_t, maximum_t, &found);
- }
- if (direction.z() != 0.0f) {
- trackIntersectionZ
- (*this, ray, (mincorner.z() - origin.z()) / direction.z(),
- minimum_t, maximum_t, &found);
- trackIntersectionZ
- (*this, ray, (maxcorner.z() - origin.z()) / direction.z(),
- minimum_t, maximum_t, &found);
- }
- }
- return found;
-}
-
-/*!
- Returns the t value at which \a ray first intersects the sides of
- this box, or not-a-number if there is no intersection.
-
- When the \a ray intersects this box, the return value is a
- parametric value that can be passed to QRay3D::point() to determine
- the actual intersection point, as shown in the following example:
-
- \code
- qreal t = box.intersection(ray);
- QVector3D pt;
- if (qIsNaN(t)) {
- qWarning("no intersection occurred");
- else
- pt = ray.point(t);
- \endcode
-
- The \a ray might intersect at two points - as the ray passes through
- the box - one on the near side, one on the far side; where near and far
- are relative to the origin point of the ray. This function only
- returns the near intersection point.
-
- Only positive values on the ray are considered. This means that if
- the origin point of the ray is inside the box, there is only one
- solution, not two. To get the other solution, simply change
- the sign of the ray's direction vector. If the origin point of
- the ray is outside the box, and the direction points away from
- the box, then there will be no intersection.
-
- When the ray does not intersect the box in the positive direction,
- or the box is not finite, then the return value is not-a-number.
-
- \sa intersects(), QRay3D::point()
-*/
-qreal QBox3D::intersection(const QRay3D &ray) const
-{
- qreal minimum_t, maximum_t;
- if (intersection(ray, &minimum_t, &maximum_t)) {
- if (minimum_t >= 0.0f)
- return minimum_t;
- else if (maximum_t >= 0.0f)
- return maximum_t;
- else
- return qSNaN();
- } else {
- return qSNaN();
- }
-}
-
-/*!
- Intersects this box with \a box.
-
- \sa intersected(), intersects(), unite()
-*/
-void QBox3D::intersect(const QBox3D& box)
-{
- // Handle the simple cases first.
- if (boxtype == Null) {
- // Null intersected with anything is null.
- return;
- } else if (boxtype == Infinite) {
- // Infinity intersected with a box is that box.
- *this = box;
- return;
- } else if (box.boxtype == Null) {
- // Anything intersected with null is null.
- setToNull();
- return;
- } else if (box.boxtype == Infinite) {
- // Box intersected with infinity is the box.
- return;
- }
-
- // Intersect two finite boxes.
- QVector3D min1 = mincorner;
- QVector3D max1 = maxcorner;
- QVector3D min2 = box.mincorner;
- QVector3D max2 = box.maxcorner;
- if (min2.x() > min1.x())
- min1.setX(min2.x());
- if (min2.y() > min1.y())
- min1.setY(min2.y());
- if (min2.z() > min1.z())
- min1.setZ(min2.z());
- if (max2.x() < max1.x())
- max1.setX(max2.x());
- if (max2.y() < max1.y())
- max1.setY(max2.y());
- if (max2.z() < max1.z())
- max1.setZ(max2.z());
- if (min1.x() > max1.x() || min1.y() > max1.y() || min1.z() > max1.z()) {
- setToNull();
- } else {
- mincorner = min1;
- maxcorner = max1;
- }
-}
-
-/*!
- Returns a new box which is the intersection of this box with \a box.
-
- \sa intersect(), intersects(), united()
-*/
-QBox3D QBox3D::intersected(const QBox3D& box) const
-{
- QBox3D result(*this);
- result.intersect(box);
- return result;
-}
-
-/*!
- Unites this box with \a point by expanding it to encompass \a point.
- If \a point is already contained within this box, then this box
- will be unchanged.
-
- \sa united(), intersect()
-*/
-void QBox3D::unite(const QVector3D& point)
-{
- if (boxtype == Finite) {
- if (point.x() < mincorner.x())
- mincorner.setX(point.x());
- else if (point.x() > maxcorner.x())
- maxcorner.setX(point.x());
- if (point.y() < mincorner.y())
- mincorner.setY(point.y());
- else if (point.y() > maxcorner.y())
- maxcorner.setY(point.y());
- if (point.z() < mincorner.z())
- mincorner.setZ(point.z());
- else if (point.z() > maxcorner.z())
- maxcorner.setZ(point.z());
- } else if (boxtype == Null) {
- boxtype = Finite;
- mincorner = point;
- maxcorner = point;
- }
-}
-
-/*!
- Unites this box with \a box by expanding this box to encompass the
- region defined by \a box. If \a box is already contained within
- this box, then this box will be unchanged.
-
- \sa united(), intersect()
-*/
-void QBox3D::unite(const QBox3D& box)
-{
- if (box.boxtype == Finite) {
- unite(box.minimum());
- unite(box.maximum());
- } else if (box.boxtype == Infinite) {
- setToInfinite();
- }
-}
-
-/*!
- Returns a new box which unites this box with \a point. The returned
- value will be the smallest box that contains both this box and \a point.
-
- \sa unite(), intersected()
-*/
-QBox3D QBox3D::united(const QVector3D& point) const
-{
- if (boxtype == Finite) {
- QBox3D result(*this);
- result.unite(point);
- return result;
- } else if (boxtype == Null) {
- return QBox3D(point, point);
- } else {
- return *this;
- }
-}
-
-/*!
- Returns a new box which unites this box with \a box. The returned value
- will be the smallest box that contains both this box and \a box.
-
- \sa unite(), intersected()
-*/
-QBox3D QBox3D::united(const QBox3D& box) const
-{
- if (boxtype == Finite) {
- QBox3D result(*this);
- result.unite(box);
- return result;
- } else if (boxtype == Null) {
- return box;
- } else {
- return *this;
- }
-}
-
-/*!
- Transforms this box according to \a matrix. Each of the 8 box
- corners are transformed and then a new box that encompasses all
- of the transformed corner values is created.
-
- \sa transformed()
-*/
-void QBox3D::transform(const QMatrix4x4& matrix)
-{
- *this = transformed(matrix);
-}
-
-/*!
- Returns this box transformed by \a matrix. Each of the 8 box
- corners are transformed and then a new box that encompasses all
- of the transformed corner values is returned.
-
- \sa transform()
-*/
-QBox3D QBox3D::transformed(const QMatrix4x4& matrix) const
-{
- if (boxtype != Finite)
- return *this;
- QBox3D result;
- result.unite(matrix * mincorner);
- result.unite(matrix * QVector3D(mincorner.x(), mincorner.y(), maxcorner.z()));
- result.unite(matrix * QVector3D(mincorner.x(), maxcorner.y(), maxcorner.z()));
- result.unite(matrix * QVector3D(mincorner.x(), maxcorner.y(), mincorner.z()));
- result.unite(matrix * QVector3D(maxcorner.x(), mincorner.y(), mincorner.z()));
- result.unite(matrix * QVector3D(maxcorner.x(), maxcorner.y(), mincorner.z()));
- result.unite(matrix * QVector3D(maxcorner.x(), mincorner.y(), maxcorner.z()));
- result.unite(matrix * maxcorner);
- return result;
-}
-
-/*!
- \fn bool QBox3D::operator==(const QBox3D& box) const
-
- Returns true if this box is identical to \a box.
-*/
-
-/*!
- \fn bool QBox3D::operator!=(const QBox3D& box) const
-
- Returns true if this box is not identical to \a box.
-*/
-
-/*!
- \fn bool qFuzzyCompare(const QBox3D& box1, const QBox3D& box2)
- \relates QBox3D
-
- Returns true if \a box1 and \a box2 are almost equal; false otherwise.
-*/
-
-#ifndef QT_NO_DEBUG_STREAM
-
-QDebug operator<<(QDebug dbg, const QBox3D &box)
-{
- if (box.isFinite()) {
- dbg.nospace() << "QBox3D(("
- << box.minimum().x() << ", " << box.minimum().y() << ", "
- << box.minimum().z() << ") - ("
- << box.maximum().x() << ", " << box.maximum().y() << ", "
- << box.maximum().z() << "))";
- return dbg.space();
- } else if (box.isNull()) {
- dbg << "QBox3D(null)";
- return dbg;
- } else {
- dbg << "QBox3D(infinite)";
- return dbg;
- }
-}
-
-#endif
-
-#ifndef QT_NO_DATASTREAM
-
-/*!
- \fn QDataStream &operator<<(QDataStream &stream, const QBox3D &box)
- \relates QBox3D
-
- Writes the given \a box to the given \a stream and returns a
- reference to the stream.
-*/
-
-QDataStream &operator<<(QDataStream &stream, const QBox3D &box)
-{
- if (box.isNull()) {
- stream << int(0);
- } else if (box.isInfinite()) {
- stream << int(2);
- } else {
- stream << int(1);
- stream << box.minimum();
- stream << box.maximum();
- }
- return stream;
-}
-
-/*!
- \fn QDataStream &operator>>(QDataStream &stream, QBox3D &box)
- \relates QBox3D
-
- Reads a 3D box from the given \a stream into the given \a box
- and returns a reference to the stream.
-*/
-
-QDataStream &operator>>(QDataStream &stream, QBox3D &box)
-{
- int type;
- stream >> type;
- if (type == 1) {
- QVector3D minimum, maximum;
- stream >> minimum;
- stream >> maximum;
- box = QBox3D(minimum, maximum);
- } else if (type == 2) {
- box.setToInfinite();
- } else {
- box.setToNull();
- }
- return stream;
-}
-
-#endif // QT_NO_DATASTREAM
-
-QT_END_NAMESPACE
diff --git a/src/threed/math3d/qbox3d.h b/src/threed/math3d/qbox3d.h
deleted file mode 100644
index c4e1f012..00000000
--- a/src/threed/math3d/qbox3d.h
+++ /dev/null
@@ -1,218 +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 QBOX3D_H
-#define QBOX3D_H
-
-#include "qt3dglobal.h"
-#include "qray3d.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class QMatrix4x4;
-
-class Q_QT3D_EXPORT QBox3D
-{
-public:
- QBox3D();
- QBox3D(const QVector3D& corner1, const QVector3D& corner2);
-
- bool isNull() const;
- bool isFinite() const;
- bool isInfinite() const;
-
- QVector3D minimum() const;
- QVector3D maximum() const;
- void setExtents(const QVector3D& corner1, const QVector3D& corner2);
-
- void setToNull();
- void setToInfinite();
-
- QVector3D size() const;
- QVector3D center() const;
-
- bool contains(const QVector3D& point) const;
- bool contains(const QBox3D& box) const;
-
- bool intersects(const QRay3D& ray) const;
- bool intersection(const QRay3D &ray, qreal *minimum_t, qreal *maximum_t) const;
- qreal intersection(const QRay3D& ray) const;
-
- bool intersects(const QBox3D& box) const;
- void intersect(const QBox3D& box);
- QBox3D intersected(const QBox3D& box) const;
-
- void unite(const QVector3D& point);
- void unite(const QBox3D& box);
-
- QBox3D united(const QVector3D& point) const;
- QBox3D united(const QBox3D& box) const;
-
- void transform(const QMatrix4x4& matrix);
- QBox3D transformed(const QMatrix4x4& matrix) const;
-
- bool operator==(const QBox3D& box) const;
- bool operator!=(const QBox3D& box) const;
-
- friend bool qFuzzyCompare(const QBox3D& box1, const QBox3D& box2);
-
-private:
- enum Type
- {
- Null,
- Finite,
- Infinite
- };
-
- QBox3D::Type boxtype;
- QVector3D mincorner, maxcorner;
-};
-
-inline QBox3D::QBox3D() : boxtype(Null), mincorner(0, 0, 0), maxcorner(0, 0, 0) {}
-
-inline QBox3D::QBox3D(const QVector3D& corner1, const QVector3D& corner2)
- : boxtype(Finite),
- mincorner(qMin(corner1.x(), corner2.x()),
- qMin(corner1.y(), corner2.y()),
- qMin(corner1.z(), corner2.z())),
- maxcorner(qMax(corner1.x(), corner2.x()),
- qMax(corner1.y(), corner2.y()),
- qMax(corner1.z(), corner2.z())) {}
-
-inline bool QBox3D::isNull() const { return (boxtype == Null); }
-inline bool QBox3D::isFinite() const { return (boxtype == Finite); }
-inline bool QBox3D::isInfinite() const { return (boxtype == Infinite); }
-
-inline QVector3D QBox3D::minimum() const { return mincorner; }
-inline QVector3D QBox3D::maximum() const { return maxcorner; }
-
-inline void QBox3D::setExtents(const QVector3D& corner1, const QVector3D& corner2)
-{
- boxtype = Finite;
- mincorner = QVector3D(qMin(corner1.x(), corner2.x()),
- qMin(corner1.y(), corner2.y()),
- qMin(corner1.z(), corner2.z()));
- maxcorner = QVector3D(qMax(corner1.x(), corner2.x()),
- qMax(corner1.y(), corner2.y()),
- qMax(corner1.z(), corner2.z()));
-}
-
-inline void QBox3D::setToNull()
-{
- boxtype = Null;
- mincorner = QVector3D(0, 0, 0);
- maxcorner = QVector3D(0, 0, 0);
-}
-
-inline void QBox3D::setToInfinite()
-{
- boxtype = Infinite;
- mincorner = QVector3D(0, 0, 0);
- maxcorner = QVector3D(0, 0, 0);
-}
-
-inline QVector3D QBox3D::size() const { return maxcorner - mincorner; }
-inline QVector3D QBox3D::center() const { return (mincorner + maxcorner) * 0.5f; }
-
-inline bool QBox3D::contains(const QVector3D& point) const
-{
- if (boxtype == Finite) {
- return (point.x() >= mincorner.x() && point.x() <= maxcorner.x() &&
- point.y() >= mincorner.y() && point.y() <= maxcorner.y() &&
- point.z() >= mincorner.z() && point.z() <= maxcorner.z());
- } else if (boxtype == Infinite) {
- return true;
- } else {
- return false;
- }
-}
-
-inline bool QBox3D::contains(const QBox3D& box) const
-{
- if (box.boxtype == Finite)
- return contains(box.mincorner) && contains(box.maxcorner);
- else if (box.boxtype == Infinite)
- return (boxtype == Infinite);
- else
- return false;
-}
-
-inline bool QBox3D::operator==(const QBox3D& box) const
-{
- return (boxtype == box.boxtype &&
- mincorner == box.mincorner &&
- maxcorner == box.maxcorner);
-}
-
-inline bool QBox3D::operator!=(const QBox3D& box) const
-{
- return (boxtype != box.boxtype ||
- mincorner != box.mincorner ||
- maxcorner != box.maxcorner);
-}
-
-inline bool qFuzzyCompare(const QBox3D& box1, const QBox3D& box2)
-{
- return box1.boxtype == box2.boxtype &&
- qFuzzyCompare(box1.mincorner, box2.mincorner) &&
- qFuzzyCompare(box1.maxcorner, box2.maxcorner);
-}
-
-#ifndef QT_NO_DEBUG_STREAM
-Q_QT3D_EXPORT QDebug operator<<(QDebug dbg, const QBox3D &box);
-#endif
-
-#ifndef QT_NO_DATASTREAM
-Q_QT3D_EXPORT QDataStream &operator<<(QDataStream &stream, const QBox3D &box);
-Q_QT3D_EXPORT QDataStream &operator>>(QDataStream &stream, QBox3D &box);
-#endif
-
-QT_END_NAMESPACE
-
-Q_DECLARE_METATYPE(QBox3D)
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/math3d/qplane3d.cpp b/src/threed/math3d/qplane3d.cpp
deleted file mode 100644
index ec324c0e..00000000
--- a/src/threed/math3d/qplane3d.cpp
+++ /dev/null
@@ -1,302 +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 "qplane3d.h"
-#include <QtCore/qmath.h>
-#include <QtCore/qnumeric.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QPlane3D
- \brief The QPlane3D class models the mathematics of planes in 3D space.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::math
-
- A plane is defined by an origin() point lying on the plane, and a
- normal() vector, which is perpendicular to the surface of the plane.
- The normal() vector does not need to be normalized. QPlane3D is an
- infinite surface, from which the normal() vector points out perpendicular
- from the origin() point.
-
- \sa QRay3D
-*/
-
-/*!
- \fn QPlane3D::QPlane3D()
-
- Constructs a default plane object. The defining origin() of the plane
- is set to (0, 0, 0) and the normal() vector is to (1, 0, 0).
-*/
-
-/*!
- \fn QPlane3D::QPlane3D(const QVector3D &point, const QVector3D &normal)
-
- Constructs a new plane, where \a point lies on the plane, and \a normal
- is perpendicular to it. The \a normal does not have to be normalized.
- If \a normal is zero, the behavior of the plane is undefined.
-*/
-
-/*!
- \fn QPlane3D::QPlane3D(const QVector3D &p, const QVector3D &q, const QVector3D &r)
-
- Constructs a new plane defined by the three points \a p, \a q, and \a r.
- The point \a p is used as the plane's origin() point, and a normal()
- is constructed from the cross-product of \a q - \a p and \a r - \a q.
-*/
-
-/*!
- \fn QVector3D QPlane3D::origin() const
-
- Returns this plane's defining origin point. The default value is (0, 0, 0).
-
- \sa setOrigin(), normal()
-*/
-
-/*!
- \fn void QPlane3D::setOrigin(const QVector3D& value)
-
- Set this plane's defining origin point to \a value.
-
- \sa origin(), setNormal()
-*/
-
-/*!
- \fn QVector3D QPlane3D::normal() const
-
- Returns this plane's normal vector. The default value is (1, 0, 0).
-
- \sa setNormal(), origin()
-*/
-
-/*!
- \fn void QPlane3D::setNormal(const QVector3D& value)
-
- Set this plane's normal vector to \a value. The \a value does
- not have to be normalized. If \a value is zero, the behavior
- of the plane is undefined.
-
- \sa normal(), setOrigin()
-*/
-
-/*!
- Returns true if \a point lies in this plane; false otherwise.
-*/
-bool QPlane3D::contains(const QVector3D &point) const
-{
- return qFuzzyIsNull
- (float(QVector3D::dotProduct(m_normal, m_origin - point)));
-}
-
-/*!
- Returns true if all of the points on \a ray lie in this plane;
- false otherwise.
-*/
-bool QPlane3D::contains(const QRay3D &ray) const
-{
- return qFuzzyIsNull
- (float(QVector3D::dotProduct(m_normal, ray.direction()))) &&
- contains(ray.origin());
-}
-
-/*!
- Returns true if an intersection of \a ray with this plane exists;
- false otherwise.
-
- \sa intersection()
-*/
-bool QPlane3D::intersects(const QRay3D &ray) const
-{
- return !qFuzzyIsNull
- (float(QVector3D::dotProduct(m_normal, ray.direction())));
-}
-
-/*!
- Returns the t value at which \a ray intersects this plane, or
- not-a-number if there is no intersection.
-
- When the \a ray intersects this plane, the return value is a
- parametric value that can be passed to QRay3D::point() to determine
- the actual intersection point, as shown in the following example:
-
- \code
- qreal t = plane.intersection(ray);
- QVector3D pt;
- if (qIsNaN(t)) {
- qWarning("no intersection occurred");
- else
- pt = ray.point(t);
- \endcode
-
- If the return value is positive, then the QRay3D::origin() of
- \a ray begins below the plane and then extends through it.
- If the return value is negative, then the origin begins
- above the plane.
-
- There are two failure cases where no single intersection point exists:
-
- \list
- \o when the ray is parallel to the plane (but does not lie on it)
- \o the ray lies entirely in the plane (thus every point "intersects")
- \endlist
-
- This method does not distinguish between these two failure cases and
- simply returns not-a-number for both.
-
- \sa intersects()
-*/
-qreal QPlane3D::intersection(const QRay3D& ray) const
-{
- qreal dotLineAndPlane = QVector3D::dotProduct(m_normal, ray.direction());
- if (qFuzzyIsNull(float(dotLineAndPlane))) {
- // degenerate case - ray & plane-normal vectors are at
- // 90 degrees to each other, so either plane and ray never meet
- // or the ray lies in the plane - return failure case.
- return qSNaN();
- }
- return QVector3D::dotProduct(m_origin - ray.origin(), m_normal) /
- dotLineAndPlane;
-}
-
-/*!
- Returns the distance from this plane to \a point. The value will
- be positive if \a point is above the plane in the direction
- of normal(), and negative if \a point is below the plane.
-*/
-qreal QPlane3D::distanceTo(const QVector3D &point) const
-{
- return QVector3D::dotProduct(point - m_origin, m_normal) /
- m_normal.length();
-}
-
-/*!
- \fn void QPlane3D::transform(const QMatrix4x4 &matrix)
-
- Transforms this plane using \a matrix, replacing origin() and
- normal() with the transformed versions.
-
- \sa transformed()
-*/
-
-/*!
- \fn QPlane3D QPlane3D::transformed(const QMatrix4x4 &matrix) const
-
- Returns a new plane that is formed by transforming origin()
- and normal() using \a matrix.
-
- \sa transform()
-*/
-
-/*!
- \fn bool QPlane3D::operator==(const QPlane3D &other)
-
- Returns true if this plane is the same as \a other; false otherwise.
-
- \sa operator!=()
-*/
-
-/*!
- \fn bool QPlane3D::operator!=(const QPlane3D &other)
-
- Returns true if this plane is not the same as \a other; false otherwise.
-
- \sa operator==()
-*/
-
-/*!
- \fn bool qFuzzyCompare(const QPlane3D &plane1, const QPlane3D &plane2)
- \relates QPlane3D
-
- Returns true if \a plane1 and \a plane2 are almost equal; false otherwise.
-*/
-
-#ifndef QT_NO_DEBUG_STREAM
-
-QDebug operator<<(QDebug dbg, const QPlane3D &plane)
-{
- dbg.nospace() << "QPlane3D(origin("
- << plane.origin().x() << ", " << plane.origin().y() << ", "
- << plane.origin().z() << ") - normal("
- << plane.normal().x() << ", " << plane.normal().y() << ", "
- << plane.normal().z() << "))";
- return dbg.space();
-}
-
-#endif
-
-#ifndef QT_NO_DATASTREAM
-
-/*!
- \fn QDataStream &operator<<(QDataStream &stream, const QPlane3D &plane)
- \relates QPlane3D
-
- Writes the given \a plane to the given \a stream and returns a
- reference to the stream.
-*/
-
-QDataStream &operator<<(QDataStream &stream, const QPlane3D &plane)
-{
- stream << plane.origin();
- stream << plane.normal();
- return stream;
-}
-
-/*!
- \fn QDataStream &operator>>(QDataStream &stream, QPlane3D &plane)
- \relates QPlane3D
-
- Reads a 3D plane from the given \a stream into the given \a plane
- and returns a reference to the stream.
-*/
-
-QDataStream &operator>>(QDataStream &stream, QPlane3D &plane)
-{
- QVector3D origin, normal;
- stream >> origin;
- stream >> normal;
- plane = QPlane3D(origin, normal);
- return stream;
-}
-
-#endif // QT_NO_DATASTREAM
-
-QT_END_NAMESPACE
diff --git a/src/threed/math3d/qplane3d.h b/src/threed/math3d/qplane3d.h
deleted file mode 100644
index bd8f5f6f..00000000
--- a/src/threed/math3d/qplane3d.h
+++ /dev/null
@@ -1,161 +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 QPLANE3D_H
-#define QPLANE3D_H
-
-#include <QtGui/qvector3d.h>
-#include <QtCore/qnumeric.h>
-#include "qray3d.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class Q_QT3D_EXPORT QPlane3D
-{
-public:
- QPlane3D();
- QPlane3D(const QVector3D &point, const QVector3D &normal);
- QPlane3D(const QVector3D &p, const QVector3D &q, const QVector3D &r);
-
- QVector3D origin() const;
- void setOrigin(const QVector3D& value);
-
- QVector3D normal() const;
- void setNormal(const QVector3D& value);
-
- bool contains(const QVector3D &point) const;
- bool contains(const QRay3D &ray) const;
-
- bool intersects(const QRay3D &ray) const;
- qreal intersection(const QRay3D &ray) const;
-
- qreal distanceTo(const QVector3D &point) const;
-
- void transform(const QMatrix4x4 &matrix);
- QPlane3D transformed(const QMatrix4x4 &matrix) const;
-
- bool operator==(const QPlane3D &other);
- bool operator!=(const QPlane3D &other);
-
-private:
- QVector3D m_origin;
- QVector3D m_normal;
-};
-
-inline QPlane3D::QPlane3D() : m_normal(1.0f, 0.0f, 0.0f) {}
-
-inline QPlane3D::QPlane3D(const QVector3D &point, const QVector3D &normal)
- : m_origin(point), m_normal(normal)
-{
-}
-
-inline QPlane3D::QPlane3D(const QVector3D &p, const QVector3D &q, const QVector3D &r)
- : m_origin(p), m_normal(QVector3D::crossProduct(q - p, r - q))
-{
-}
-
-inline QVector3D QPlane3D::origin() const
-{
- return m_origin;
-}
-
-inline void QPlane3D::setOrigin(const QVector3D &value)
-{
- m_origin = value;
-}
-
-inline QVector3D QPlane3D::normal() const
-{
- return m_normal;
-}
-
-inline void QPlane3D::setNormal(const QVector3D& value)
-{
- m_normal = value;
-}
-
-inline void QPlane3D::transform(const QMatrix4x4 &matrix)
-{
- m_origin = matrix * m_origin;
- m_normal = matrix.mapVector(m_normal);
-}
-
-inline QPlane3D QPlane3D::transformed(const QMatrix4x4 &matrix) const
-{
- return QPlane3D(matrix * m_origin, matrix.mapVector(m_normal));
-}
-
-inline bool QPlane3D::operator==(const QPlane3D &other)
-{
- return m_origin == other.origin() && m_normal == other.normal();
-}
-
-inline bool QPlane3D::operator!=(const QPlane3D &other)
-{
- return m_origin != other.origin() || m_normal != other.normal();
-}
-
-inline bool qFuzzyCompare(const QPlane3D &plane1, const QPlane3D &plane2)
-{
- return qFuzzyCompare(plane1.origin(), plane2.origin()) &&
- qFuzzyCompare(plane1.normal(), plane2.normal());
-}
-
-#ifndef QT_NO_DEBUG_STREAM
-Q_QT3D_EXPORT QDebug operator<<(QDebug dbg, const QPlane3D &plane);
-#endif
-
-#ifndef QT_NO_DATASTREAM
-Q_QT3D_EXPORT QDataStream &operator<<(QDataStream &stream, const QPlane3D &plane);
-Q_QT3D_EXPORT QDataStream &operator>>(QDataStream &stream, QPlane3D &plane);
-#endif
-
-QT_END_NAMESPACE
-
-Q_DECLARE_METATYPE(QPlane3D)
-
-QT_END_HEADER
-
-#endif // QPLANE3D_H
diff --git a/src/threed/math3d/qray3d.cpp b/src/threed/math3d/qray3d.cpp
deleted file mode 100644
index 9cdabd44..00000000
--- a/src/threed/math3d/qray3d.cpp
+++ /dev/null
@@ -1,301 +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 "qray3d.h"
-#include <QtCore/qdebug.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QRay3D
- \brief The QRay3D class defines a directional line in 3D space extending through an origin point.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::math
-
- A ray is defined by the origin() point and the direction() vector.
- Rays are infinite in length, extending out from origin() in
- both directions. If the direction() is zero length, then the
- behavior of the class is undefined.
-
- A ray can be thought of as a one-dimensional co-ordinate system.
- If the co-ordinate is \bold t then the origin() point is at
- \bold t = 0, the point origin() + direction() is at \bold t = 1,
- and the point origin() - direction() is at \bold t = -1.
- The point() method can be used to obtain the position of a point
- within this one-dimensional co-ordinate system. The fromPoint()
- method can be used to convert a point into a value in this
- one-dimensional co-ordinate system.
-*/
-
-/*!
- \fn QRay3D::QRay3D()
-
- Construct a default ray with an origin() of (0, 0, 0) and a
- direction() of (1, 0, 0).
-*/
-
-/*!
- \fn QRay3D::QRay3D(const QVector3D &origin, const QVector3D &direction)
-
- Construct a ray given its defining \a origin and \a direction. The
- \a direction does not need to be normalized.
-
- To construct a ray that passes through two points, use the following:
-
- \code
- QRay3D thruAB(pointA, pointB - pointA);
- \endcode
-*/
-
-/*!
- \fn QVector3D QRay3D::origin() const
-
- Returns the origin of this ray. The default value is (0, 0, 0).
-
- \sa setOrigin(), direction()
-*/
-
-/*!
- \fn void QRay3D::setOrigin(const QVector3D &value)
-
- Sets the origin point of this ray to \a value.
-
- \sa origin(), setDirection()
- */
-
-/*!
- \fn QVector3D QRay3D::direction() const
-
- Returns the direction vector of this ray. The default value is (1, 0, 0).
-
- \sa setDirection(), origin()
-*/
-
-/*!
- \fn void QRay3D::setDirection(const QVector3D &direction)
-
- Sets the direction vector of this ray to \a direction.
-
- \sa direction(), setOrigin()
-*/
-
-/*!
- Returns true if \a point lies on this ray; false otherwise.
-*/
-bool QRay3D::contains(const QVector3D &point) const
-{
- QVector3D ppVec(point - m_origin);
- if (ppVec.isNull()) // point coincides with origin
- return true;
- qreal dot = QVector3D::dotProduct(ppVec, m_direction);
- if (qFuzzyIsNull(float(dot)))
- return false;
- return qFuzzyCompare(dot*dot, ppVec.lengthSquared() * m_direction.lengthSquared());
-}
-
-/*!
- Returns true if \a ray lies on this ray; false otherwise. If true,
- this implies that the two rays are the actually the same, but with
- different origin() points or an inverted direction().
-*/
-bool QRay3D::contains(const QRay3D &ray) const
-{
- qreal dot = QVector3D::dotProduct(m_direction, ray.direction());
- if (!qFuzzyCompare(dot*dot, m_direction.lengthSquared() * ray.direction().lengthSquared()))
- return false;
- return contains(ray.origin());
-}
-
-/*!
- \fn QVector3D QRay3D::point(qreal t) const
-
- Returns the point on the ray defined by moving \a t units
- along the ray in the direction of the direction() vector.
- Note that \a t may be negative in which case the point returned
- will lie behind the origin() point with respect to the
- direction() vector.
-
- The units for \a t are defined by direction(). The return value
- is precisely origin() + t * direction().
-
- \sa fromPoint(), distanceTo()
-*/
-
-/*!
- Returns the number of direction() units along the ray from origin()
- to \a point. Essentially, this function computes the value t, where
- \a point = origin() + t * direction(). If \a point is not on the ray,
- then the closest point that is on the ray will be used instead.
-
- If the return value is positive, then \a point lies in front of
- the origin() with respect to the direction() vector. If the return
- value is negative, then \a point lies behind the origin() with
- respect to the direction() vector.
-
- \sa point(), project()
-*/
-qreal QRay3D::fromPoint(const QVector3D &point) const
-{
- return QVector3D::dotProduct(point - m_origin, m_direction) /
- m_direction.lengthSquared();
-}
-
-/*!
- Returns the projection of \a vector onto this ray. In the
- following diagram, the dotted line is the ray, and V is the
- \a vector. The return value will be the vector V':
-
- \image qray3d-project.png
-
- \sa fromPoint()
-*/
-QVector3D QRay3D::project(const QVector3D &vector) const
-{
- QVector3D norm = m_direction.normalized();
- return QVector3D::dotProduct(vector, norm) * norm;
-}
-
-/*!
- Returns the minimum distance from this ray to \a point, or equivalently
- the length of a line perpendicular to this ray which passes through
- \a point. If \a point is on the ray, then this function will return zero.
-
- \sa point()
-*/
-qreal QRay3D::distanceTo(const QVector3D &point) const
-{
- qreal t = fromPoint(point);
- return (point - (m_origin + t * m_direction)).length();
-}
-
-/*!
- \fn void QRay3D::transform(const QMatrix4x4 &matrix)
-
- Transforms this ray using \a matrix, replacing origin() and
- direction() with the transformed versions.
-
- \sa transformed()
-*/
-
-/*!
- \fn QRay3D QRay3D::transformed(const QMatrix4x4 &matrix) const
-
- Returns a new ray that is formed by transforming origin()
- and direction() using \a matrix.
-
- \sa transform()
-*/
-
-/*!
- \fn bool QRay3D::operator==(const QRay3D &other)
-
- Returns true if this ray is the same as \a other; false otherwise.
-
- \sa operator!=()
-*/
-
-/*!
- \fn bool QRay3D::operator!=(const QRay3D &other)
-
- Returns true if this ray is not the same as \a other; false otherwise.
-
- \sa operator==()
-*/
-
-/*!
- \fn bool qFuzzyCompare(const QRay3D &ray1, const QRay3D &ray2)
- \relates QRay3D
-
- Returns true if \a ray1 and \a ray2 are almost equal; false otherwise.
-*/
-
-#ifndef QT_NO_DEBUG_STREAM
-
-QDebug operator<<(QDebug dbg, const QRay3D &ray)
-{
- dbg.nospace() << "QRay3D(origin("
- << ray.origin().x() << ", " << ray.origin().y() << ", "
- << ray.origin().z() << ") - direction("
- << ray.direction().x() << ", " << ray.direction().y() << ", "
- << ray.direction().z() << "))";
- return dbg.space();
-}
-
-#endif
-
-#ifndef QT_NO_DATASTREAM
-
-/*!
- \fn QDataStream &operator<<(QDataStream &stream, const QRay3D &ray)
- \relates QRay3D
-
- Writes the given \a ray to the given \a stream and returns a
- reference to the stream.
-*/
-
-QDataStream &operator<<(QDataStream &stream, const QRay3D &ray)
-{
- stream << ray.origin();
- stream << ray.direction();
- return stream;
-}
-
-/*!
- \fn QDataStream &operator>>(QDataStream &stream, QRay3D &ray)
- \relates QRay3D
-
- Reads a 3D ray from the given \a stream into the given \a ray
- and returns a reference to the stream.
-*/
-
-QDataStream &operator>>(QDataStream &stream, QRay3D &ray)
-{
- QVector3D origin, direction;
- stream >> origin;
- stream >> direction;
- ray = QRay3D(origin, direction);
- return stream;
-}
-
-#endif // QT_NO_DATASTREAM
-
-QT_END_NAMESPACE
diff --git a/src/threed/math3d/qray3d.h b/src/threed/math3d/qray3d.h
deleted file mode 100644
index 74afe97e..00000000
--- a/src/threed/math3d/qray3d.h
+++ /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$
-**
-****************************************************************************/
-
-#ifndef QRAY3D_H
-#define QRAY3D_H
-
-#include "qt3dglobal.h"
-#include <QtGui/qvector3d.h>
-#include <QtGui/qmatrix4x4.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class Q_QT3D_EXPORT QRay3D
-{
-public:
- QRay3D();
- QRay3D(const QVector3D &origin, const QVector3D &direction);
-
- QVector3D origin() const;
- void setOrigin(const QVector3D & value);
-
- QVector3D direction() const;
- void setDirection(const QVector3D & value);
-
- bool contains(const QVector3D &point) const;
- bool contains(const QRay3D &ray) const;
-
- QVector3D point(qreal t) const;
- qreal fromPoint(const QVector3D &point) const;
-
- QVector3D project(const QVector3D &vector) const;
-
- qreal distanceTo(const QVector3D &point) const;
-
- void transform(const QMatrix4x4 &matrix);
- QRay3D transformed(const QMatrix4x4 &matrix) const;
-
- bool operator==(const QRay3D &other);
- bool operator!=(const QRay3D &other);
-
-private:
- QVector3D m_origin;
- QVector3D m_direction;
-
-};
-
-inline QRay3D::QRay3D() : m_direction(1.0f, 0.0f, 0.0f) {}
-
-inline QRay3D::QRay3D(const QVector3D &origin, const QVector3D &direction)
- : m_origin(origin)
- , m_direction(direction)
-{
-}
-
-inline QVector3D QRay3D::origin() const
-{
- return m_origin;
-}
-
-inline void QRay3D::setOrigin(const QVector3D &value)
-{
- m_origin = value;
-}
-
-inline QVector3D QRay3D::direction() const
-{
- return m_direction;
-}
-
-inline void QRay3D::setDirection(const QVector3D & value)
-{
- m_direction = value;
-}
-
-inline QVector3D QRay3D::point(qreal t) const
-{
- return m_origin + t * m_direction;
-}
-
-inline void QRay3D::transform(const QMatrix4x4 &matrix)
-{
- m_origin = matrix * m_origin;
- m_direction = matrix.mapVector(m_direction);
-}
-
-inline QRay3D QRay3D::transformed(const QMatrix4x4 &matrix) const
-{
- return QRay3D(matrix * m_origin, matrix.mapVector(m_direction));
-}
-
-inline bool QRay3D::operator==(const QRay3D &other)
-{
- return m_origin == other.origin() && m_direction == other.direction();
-}
-
-inline bool QRay3D::operator!=(const QRay3D &other)
-{
- return m_origin != other.origin() || m_direction != other.direction();
-}
-
-inline bool qFuzzyCompare(const QRay3D &ray1, const QRay3D &ray2)
-{
- return qFuzzyCompare(ray1.origin(), ray2.origin()) &&
- qFuzzyCompare(ray1.direction(), ray2.direction());
-}
-
-#ifndef QT_NO_DEBUG_STREAM
-Q_QT3D_EXPORT QDebug operator<<(QDebug dbg, const QRay3D &ray);
-#endif
-
-#ifndef QT_NO_DATASTREAM
-Q_QT3D_EXPORT QDataStream &operator<<(QDataStream &stream, const QRay3D &ray);
-Q_QT3D_EXPORT QDataStream &operator>>(QDataStream &stream, QRay3D &ray);
-#endif
-
-QT_END_NAMESPACE
-
-Q_DECLARE_METATYPE(QRay3D)
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/math3d/qsphere3d.cpp b/src/threed/math3d/qsphere3d.cpp
deleted file mode 100644
index 81e6c16c..00000000
--- a/src/threed/math3d/qsphere3d.cpp
+++ /dev/null
@@ -1,385 +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 "qsphere3d.h"
-#include "qray3d.h"
-#include "qbox3d.h"
-#include "qplane3d.h"
-#include <QtGui/qmatrix4x4.h>
-#include <QtCore/qmath.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QSphere3D
- \brief The QSphere3D class represents a mathematical sphere in 3D space.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::math
-
- QSphere3D can be used to represent the bounding regions of objects
- in a 3D scene so that they can be easily culled if they are out of view.
- It can also be used to assist with collision testing.
-
- \sa QBox3D
-*/
-
-/*!
- \fn QSphere3D::QSphere3D()
-
- Constructs a default sphere with a center() of (0, 0, 0)
- and radius() of 1.
-*/
-
-/*!
- \fn QSphere3D::QSphere3D(const QVector3D &center, qreal radius)
-
- Constructs a sphere with the specified \a center and \a radius.
-*/
-
-/*!
- \fn QVector3D QSphere3D::center() const
-
- Returns the center of this sphere.
-
- \sa setCenter(), radius()
-*/
-
-/*!
- \fn void QSphere3D::setCenter(const QVector3D &center)
-
- Sets the \a center of this sphere.
-
- \sa center(), setRadius()
-*/
-
-/*!
- \fn qreal QSphere3D::radius() const
-
- Returns the radius of this sphere.
-
- \sa setRadius(), center()
-*/
-
-/*!
- \fn void QSphere3D::setRadius(qreal radius)
-
- Sets the \a radius of this sphere.
-
- \sa radius(), setCenter()
-*/
-
-/*!
- \fn bool QSphere3D::contains(const QVector3D &point) const
-
- Returns true if \a point is contained within the bounds of
- this sphere; false otherwise.
-*/
-
-/*!
- Returns true if this sphere intersects \a ray; false otherwise.
-
- \sa intersection()
-*/
-bool QSphere3D::intersects(const QRay3D &ray) const
-{
- QVector3D centerToOrigin = ray.origin() - m_center;
- qreal term1 = ray.direction().lengthSquared();
- qreal term2 = 2.0f * QVector3D::dotProduct(centerToOrigin, ray.direction());
- qreal term3 = centerToOrigin.lengthSquared() - m_radius * m_radius;
- qreal det = term2 * term2 - (4.0f * term1 * term3);
- return term1 != 0.0f && det >= 0.0f;
-}
-
-/*!
- \fn bool QSphere3D::intersects(const QSphere3D &sphere) const
-
- Returns true if this sphere intersects \a sphere; false otherwise.
-
- \sa contains()
-*/
-
-/*!
- Returns true if this sphere intersects \a box; false otherwise.
-*/
-bool QSphere3D::intersects(const QBox3D &box) const
-{
- if (box.isFinite()) {
- // Use Arvo's Algorithm to determine if we have an intersection.
- qreal dist = 0.0f;
- qreal center = m_center.x();
- qreal minval = box.minimum().x();
- qreal maxval = box.maximum().x();
- if (center < minval)
- dist += (center - minval) * (center - minval);
- else if (center > maxval)
- dist += (center - maxval) * (center - maxval);
- center = m_center.y();
- minval = box.minimum().y();
- maxval = box.maximum().y();
- if (center < minval)
- dist += (center - minval) * (center - minval);
- else if (center > maxval)
- dist += (center - maxval) * (center - maxval);
- center = m_center.z();
- minval = box.minimum().z();
- maxval = box.maximum().z();
- if (center < minval)
- dist += (center - minval) * (center - minval);
- else if (center > maxval)
- dist += (center - maxval) * (center - maxval);
- return dist <= (m_radius * m_radius);
- } else {
- return box.isInfinite();
- }
-}
-
-/*!
- Returns true if this sphere intersects \a plane; false otherwise.
-*/
-bool QSphere3D::intersects(const QPlane3D &plane) const
-{
- return qAbs(plane.distanceTo(m_center)) <= m_radius;
-}
-
-/*!
- Finds the \a minimum_t and \a maximum_t values where \a ray intersects
- this sphere. Returns true if intersections were found; or false if there
- is no intersection.
-
- If \a minimum_t and \a maximum_t are set to the same value, then \a ray
- touches the surface of the sphere at a single point. If the t values are
- negative, then the intersection occurs before the ray's origin point
- in the reverse direction of the ray.
-
- The \a minimum_t and \a maximum_t values can be passed to QRay3D::point()
- to determine the actual intersection points, as shown in the following
- example:
-
- \code
- qreal minimum_t, maximum_t;
- if (sphere.intersection(ray, &minimum_t, &maximum_t)) {
- qDebug() << "intersections at"
- << ray.point(minimum_t) << "and"
- << ray.point(maximum_t);
- }
- \endcode
-
- \sa intersects(), QRay3D::point()
-*/
-bool QSphere3D::intersection(const QRay3D &ray, qreal *minimum_t, qreal *maximum_t) const
-{
- QVector3D centerToOrigin = ray.origin() - m_center;
- qreal term1 = ray.direction().lengthSquared();
- qreal term2 = 2.0f * QVector3D::dotProduct(centerToOrigin, ray.direction());
- qreal term3 = centerToOrigin.lengthSquared() - m_radius * m_radius;
- qreal det = term2 * term2 - (4.0f * term1 * term3);
- if (term1 == 0.0f || det < 0.0f) {
- *minimum_t = qSNaN();
- *maximum_t = qSNaN();
- return false;
- } else if (det == 0.0f) {
- *minimum_t = *maximum_t = -term2 / (2.0f * term1);
- } else {
- qreal sqrtDet = qSqrt(det);
- qreal t1 = (-term2 - sqrtDet) / (2.0f * term1);
- qreal t2 = (-term2 + sqrtDet) / (2.0f * term1);
- if (t1 < t2) {
- *minimum_t = t1;
- *maximum_t = t2;
- } else {
- *minimum_t = t2;
- *maximum_t = t1;
- }
- }
- return true;
-}
-
-/*!
- Returns the t value at which \a ray first intersects the surface of
- this sphere, or not-a-number if there is no intersection.
-
- When the \a ray intersects this sphere, the return value is a
- parametric value that can be passed to QRay3D::point() to determine
- the actual intersection point, as shown in the following example:
-
- \code
- qreal t = sphere.intersection(ray);
- QVector3D pt;
- if (qIsNaN(t)) {
- qWarning("no intersection occurred");
- else
- pt = ray.point(t);
- \endcode
-
- The \a ray might intersect at two points - as the ray passes through
- the sphere - one on the near side, one on the far side; where near and far
- are relative to the origin point of the ray. This function only
- returns the near intersection point.
-
- Only positive values on the ray are considered. This means that if
- the origin point of the ray is inside the sphere, there is only one
- solution, not two. To get the other solution, simply change
- the sign of the ray's direction vector. If the origin point of
- the ray is outside the sphere, and the direction points away from
- the sphere, then there will be no intersection.
-
- When the ray does not intersect the sphere in the positive direction,
- then the return value is not-a-number.
-
- \sa intersects(), QRay3D::point()
-*/
-qreal QSphere3D::intersection(const QRay3D &ray) const
-{
- qreal minimum_t, maximum_t;
- if (intersection(ray, &minimum_t, &maximum_t)) {
- if (minimum_t >= 0.0f)
- return minimum_t;
- else if (maximum_t >= 0.0f)
- return maximum_t;
- else
- return qSNaN();
- } else {
- return qSNaN();
- }
-}
-
-/*!
- \fn void QSphere3D::transform(const QMatrix4x4 &matrix)
-
- Transforms this sphere's center() and radius() according to \a matrix.
-
- It is assumed that \a matrix contains a uniform scale factor in the
- x, y, and z directions. Otherwise the radius() in the result is undefined.
-
- \sa transformed()
-*/
-
-/*!
- Returns the result of transforming this sphere's center() and radius()
- according to \a matrix.
-
- It is assumed that \a matrix contains a uniform scale factor in the
- x, y, and z directions. Otherwise the radius() in the result is undefined.
-
- \sa transform()
-*/
-QSphere3D QSphere3D::transformed(const QMatrix4x4 &matrix) const
-{
- return QSphere3D(matrix * m_center,
- matrix.mapVector(QVector3D(m_radius, 0, 0)).length());
-}
-
-/*!
- \fn bool QSphere3D::operator==(const QSphere3D &sphere) const
-
- Returns true if this sphere is the same as \a sphere; false otherwise.
-
- \sa operator!=()
-*/
-
-/*!
- \fn bool QSphere3D::operator!=(const QSphere3D &sphere) const
-
- Returns true if this sphere is not the same as \a sphere; false otherwise.
-
- \sa operator==()
-*/
-
-/*!
- \fn bool qFuzzyCompare(const QSphere3D &sphere1, const QSphere3D &sphere2)
- \relates QSphere3D
-
- Returns true if \a sphere1 and \a sphere2 are almost equal;
- false otherwise.
-*/
-
-#ifndef QT_NO_DEBUG_STREAM
-
-QDebug operator<<(QDebug dbg, const QSphere3D &sphere)
-{
- dbg.nospace() << "QSphere3D(center=("
- << sphere.center().x() << ", " << sphere.center().y() << ", "
- << sphere.center().z() << "), radius=" << sphere.radius() << ')';
- return dbg.space();
-}
-
-#endif
-
-#ifndef QT_NO_DATASTREAM
-
-/*!
- \fn QDataStream &operator<<(QDataStream &stream, const QSphere3D &sphere)
- \relates QSphere3D
-
- Writes the given \a sphere to the given \a stream and returns a
- reference to the stream.
-*/
-
-QDataStream &operator<<(QDataStream &stream, const QSphere3D &sphere)
-{
- stream << sphere.center();
- stream << double(sphere.radius());
- return stream;
-}
-
-/*!
- \fn QDataStream &operator>>(QDataStream &stream, QSphere3D &sphere)
- \relates QSphere3D
-
- Reads a 3D sphere from the given \a stream into the given \a sphere
- and returns a reference to the stream.
-*/
-
-QDataStream &operator>>(QDataStream &stream, QSphere3D &sphere)
-{
- QVector3D center;
- double radius;
- stream >> center;
- stream >> radius;
- sphere.setCenter(center);
- sphere.setRadius(qreal(radius));
- return stream;
-}
-
-#endif
-
-QT_END_NAMESPACE
diff --git a/src/threed/math3d/qsphere3d.h b/src/threed/math3d/qsphere3d.h
deleted file mode 100644
index 9487a9b2..00000000
--- a/src/threed/math3d/qsphere3d.h
+++ /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$
-**
-****************************************************************************/
-
-#ifndef QSPHERE3D_H
-#define QSPHERE3D_H
-
-#include "qt3dglobal.h"
-#include <QtGui/qvector3d.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class QMatrix4x4;
-class QRay3D;
-class QBox3D;
-class QPlane3D;
-
-class Q_QT3D_EXPORT QSphere3D
-{
-public:
- QSphere3D();
- QSphere3D(const QVector3D &center, qreal radius);
-
- QVector3D center() const;
- void setCenter(const QVector3D &center);
-
- qreal radius() const;
- void setRadius(qreal radius);
-
- bool contains(const QVector3D &point) const;
-
- bool intersects(const QRay3D &ray) const;
- bool intersects(const QSphere3D &sphere) const;
- bool intersects(const QBox3D &box) const;
- bool intersects(const QPlane3D &plane) const;
-
- bool intersection(const QRay3D &ray, qreal *minimum_t, qreal *maximum_t) const;
- qreal intersection(const QRay3D &ray) const;
-
- void transform(const QMatrix4x4 &matrix);
- QSphere3D transformed(const QMatrix4x4 &matrix) const;
-
- bool operator==(const QSphere3D &sphere) const;
- bool operator!=(const QSphere3D &sphere) const;
-
-private:
- QVector3D m_center;
- qreal m_radius;
-};
-
-inline QSphere3D::QSphere3D() : m_radius(1.0f) {}
-
-inline QSphere3D::QSphere3D(const QVector3D &center, qreal radius)
- : m_center(center), m_radius(radius) {}
-
-inline QVector3D QSphere3D::center() const
-{
- return m_center;
-}
-
-inline void QSphere3D::setCenter(const QVector3D &center)
-{
- m_center = center;
-}
-
-inline qreal QSphere3D::radius() const
-{
- return m_radius;
-}
-
-inline void QSphere3D::setRadius(qreal radius)
-{
- m_radius = radius;
-}
-
-inline bool QSphere3D::contains(const QVector3D &point) const
-{
- return (point - m_center).lengthSquared() <= (m_radius * m_radius);
-}
-
-inline bool QSphere3D::intersects(const QSphere3D &sphere) const
-{
- qreal radsum = sphere.radius() + m_radius;
- return (sphere.center() - m_center).lengthSquared() <= (radsum * radsum);
-}
-
-inline void QSphere3D::transform(const QMatrix4x4 &matrix)
-{
- *this = transformed(matrix);
-}
-
-inline bool QSphere3D::operator==(const QSphere3D &sphere) const
-{
- return m_center == sphere.m_center && m_radius == sphere.m_radius;
-}
-
-inline bool QSphere3D::operator!=(const QSphere3D &sphere) const
-{
- return m_center != sphere.m_center || m_radius != sphere.m_radius;
-}
-
-inline bool qFuzzyCompare(const QSphere3D &sphere1, const QSphere3D &sphere2)
-{
- return qFuzzyCompare(sphere1.center(), sphere2.center()) &&
- qFuzzyCompare(sphere1.radius(), sphere2.radius());
-}
-
-#ifndef QT_NO_DEBUG_STREAM
-Q_QT3D_EXPORT QDebug operator<<(QDebug dbg, const QSphere3D &sphere);
-#endif
-
-#ifndef QT_NO_DATASTREAM
-Q_QT3D_EXPORT QDataStream &operator<<(QDataStream &stream, const QSphere3D &sphere);
-Q_QT3D_EXPORT QDataStream &operator>>(QDataStream &stream, QSphere3D &sphere);
-#endif
-
-QT_END_NAMESPACE
-
-Q_DECLARE_METATYPE(QSphere3D)
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/math3d/qtriangle3d.cpp b/src/threed/math3d/qtriangle3d.cpp
deleted file mode 100644
index ac1f0898..00000000
--- a/src/threed/math3d/qtriangle3d.cpp
+++ /dev/null
@@ -1,379 +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 "qtriangle3d.h"
-#include <QtGui/qmatrix4x4.h>
-#include <QtCore/qnumeric.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QTriangle3D
- \brief The QTriangle3D class represents a triangle as three points in 3D space.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::math
-
- A triangle is defined by 3 points in 3D space. Since any 3 points define
- a plane, the triangle can be thought of as defining a plane, and forming a
- geometric region in that plane.
-
- If you need a simple plane, with no particular geometry, then
- QPlane3D is a more compact and mathematically sufficient class.
-
- The three points are labelled p(), q() and r() for consistency with
- textbook treatments. It is recommended that the points be supplied
- in counter-clockwise order for correct orientation of the
- triangle's plane().
-
- \sa QPlane3D
-*/
-
-/*!
- \fn QTriangle3D::QTriangle3D()
-
- Constructs a default triangle which lies in the x-z plane,
- with the three vertices (0, 0, 0), (1, 0, 0), and (0, 1, 0).
-*/
-
-/*!
- \fn QTriangle3D::QTriangle3D(const QVector3D &p, const QVector3D &q, const QVector3D &r)
-
- Constructs a triangle with the supplied \a p, \a q and \a r vertices.
-*/
-
-/*!
- \fn QVector3D QTriangle3D::p() const
-
- Returns the value of the P vertex on the triangle.
-
- \sa q(), r(), setP()
-*/
-
-/*!
- \fn void QTriangle3D::setP(const QVector3D &point)
-
- Sets the value of the P vertex on the triangle to \a point.
-
- \sa setQ(), setR(), p()
-*/
-
-/*!
- \fn QVector3D QTriangle3D::q() const
-
- Returns the value of the Q vertex on the triangle.
-
- \sa p(), r(), setQ()
-*/
-
-/*!
- \fn void QTriangle3D::setQ(const QVector3D &point)
-
- Sets the value of the Q vertex on the triangle \a point.
-
- \sa setP(), setR(), q()
-*/
-
-
-/*!
- \fn QVector3D QTriangle3D::r() const
-
- Returns the value of the R vertex on the triangle.
-
- \sa p(), q(), setR()
-*/
-
-/*!
- \fn void QTriangle3D::setR(const QVector3D &point)
-
- Sets the value of the R vertex on the triangle \a point.
-
- \sa setP(), setQ(), r()
-*/
-
-/*!
- \fn QPlane3D QTriangle3D::plane() const
-
- Returns the plane in which the triangle lies.
-
- \sa QPlane3D
-*/
-
-/*!
- \fn QVector3D QTriangle3D::center() const
-
- Returns the center of the triangle, which is the geometric average of the
- three vertices.
-*/
-
-/*!
- \fn QVector3D QTriangle3D::faceNormal() const
-
- Returns the vector normal to this triangle, computed from the
- cross-product of P-Q and Q-R. The result is not normalized.
-*/
-
-/*!
- Returns true if this triangle contains \a point; false otherwise.
- To contain the \a point means that:
- \list
- \o the point lies on the same plane as the triangle, and
- \o the point
- \list
- \o lies either wholly within the triangle, or
- \o lies on one of the sides, or
- \o coincides with one of the 3 vertices
- \endlist
- \endlist
-
- \sa intersects()
-*/
-bool QTriangle3D::contains(const QVector3D &point) const
-{
- // Check if the point is on the triangle's plane first.
- QVector3D normal = QVector3D::crossProduct(m_q - m_p, m_r - m_q);
- if (!qFuzzyIsNull(float(QVector3D::dotProduct(normal, m_p - point))))
- return false;
-
- // Compute the barycentric co-ordinates and use them to determine
- // if the point is within the triangle.
- QVector2D c = uv(point);
- if (c.x() < 0.0f || c.x() > 1.0f)
- return false;
- if (c.y() < 0.0f || c.y() > 1.0f)
- return false;
- if ((c.x() + c.y()) > 1.0f)
- return false;
- return true;
-}
-
-/*!
- Returns true if the \a ray intersects this triangle; false otherwise.
-
- This function will return false if the triangle is degenerate.
-
- \sa contains(), intersection()
-*/
-bool QTriangle3D::intersects(const QRay3D &ray) const
-{
- qreal t = plane().intersection(ray);
- if (qIsNaN(t))
- return false;
- return contains(ray.point(t));
-}
-
-/*!
- Returns the t value at which \a ray intersects this triangle, or
- not-a-number if there is no intersection.
-
- When the \a ray intersects this triangle, the return value is a
- parametric value that can be passed to QRay3D::point() to determine
- the actual intersection point, as shown in the following example:
-
- \code
- qreal t = triangle.intersection(ray);
- QVector3D pt;
- if (qIsNaN(t)) {
- qWarning("no intersection occurred");
- else
- pt = ray.point(t);
- \endcode
-
- \sa intersects(), contains(), QRay3D::point()
- */
-qreal QTriangle3D::intersection(const QRay3D &ray) const
-{
- qreal t = plane().intersection(ray);
- if (qIsNaN(t) || contains(ray.point(t)))
- return t;
- return qSNaN();
-}
-
-/*!
- Transforms the points of this triangle according to \a matrix.
-
- \sa transformed()
-*/
-void QTriangle3D::transform(const QMatrix4x4 &matrix)
-{
- m_p = matrix * m_p;
- m_q = matrix * m_q;
- m_r = matrix * m_r;
-}
-
-/*!
- Returns a new triangle that results from transforming this
- one using \a matrix.
-
- \sa transform()
-*/
-QTriangle3D QTriangle3D::transformed(const QMatrix4x4 &matrix) const
-{
- return QTriangle3D(matrix * m_p, matrix * m_q, matrix * m_r);
-}
-
-/*!
- Returns the (u, v) barycentric co-ordinates of \a point within
- this triangle.
-
- The returned barycentric co-ordinates will be (1, 0) at p(),
- (0, 1) at q(), and (0, 0) at r(). Technically, barycentric
- co-ordinates have three components with the corners at
- (1, 0, 0), (0, 1, 0), and (0, 0, 1). However, the third
- component is always equal to (1 - u - v) so we do not return it.
-
- The typical use case for this function is to convert an intersection
- point on a triangle into the texture co-ordinate corresponding to
- that point. If \c p, \c q, and \c r are the points on the triangle,
- with corresponding texture co-ordinates \c tp, \c tq, and \c tr,
- then the texture co-ordinate \c tc of \a point can be determined
- by the following code:
-
- \code
- QTriangle3D triangle(p, q, r);
- QVector2D uv = triangle.uv(point);
- QVector2D tc = uv.x() * tp + uv.y() * tq + (1 - uv.x() - uv.y()) * tr;
- \endcode
-
- \sa contains(), intersection()
-*/
-QVector2D QTriangle3D::uv(const QVector3D &point) const
-{
- // Algorithm from: http://www.blackpawn.com/texts/pointinpoly/default.html
- // More: http://en.wikipedia.org/wiki/Barycentric_coordinates_(mathematics)
- QVector3D rq = m_q - m_r;
- QVector3D rp = m_p - m_r;
- QVector3D pp = point - m_r;
- qreal dot_rq_rq = QVector3D::dotProduct(rq, rq);
- qreal dot_rq_rp = QVector3D::dotProduct(rq, rp);
- qreal dot_rq_pp = QVector3D::dotProduct(rq, pp);
- qreal dot_rp_rp = QVector3D::dotProduct(rp, rp);
- qreal dot_rp_pp = QVector3D::dotProduct(rp, pp);
- qreal det = dot_rq_rq * dot_rp_rp - dot_rq_rp * dot_rq_rp;
- if (qFuzzyIsNull(float(det))) {
- // The point is probably not in the triangle, or the triangle
- // is degenerate. Return an out of range value for (u, v) so
- // that contains() will fail when this case happens.
- return QVector2D(-1.0f, -1.0f);
- }
- return QVector2D((dot_rq_rq * dot_rp_pp - dot_rq_rp * dot_rq_pp) / det,
- (dot_rp_rp * dot_rq_pp - dot_rq_rp * dot_rp_pp) / det);
-}
-
-/*!
- \fn bool QTriangle3D::operator==(const QTriangle3D &other)
-
- Returns true if this triangle is the same as \a other; false otherwise.
-
- \sa operator!=()
-*/
-
-/*!
- \fn bool QTriangle3D::operator!=(const QTriangle3D &other)
-
- Returns true if this triangle is not the same as \a other; false otherwise.
-
- \sa operator==()
-*/
-
-/*!
- \fn bool qFuzzyCompare(const QTriangle3D &triangle1, const QTriangle3D &triangle2)
- \relates QTriangle3D
-
- Returns true if \a triangle1 and \a triangle2 are almost equal;
- false otherwise.
-*/
-
-#ifndef QT_NO_DEBUG_STREAM
-
-QDebug operator<<(QDebug dbg, const QTriangle3D &triangle)
-{
- dbg.nospace() << "QTriangle3D(("
- << triangle.p().x() << ", " << triangle.p().y() << ", "
- << triangle.p().z() << "), ("
- << triangle.q().x() << ", " << triangle.q().y() << ", "
- << triangle.q().z() << "), ("
- << triangle.r().x() << ", " << triangle.r().y() << ", "
- << triangle.r().z() << "))";
- return dbg.space();
-}
-
-#endif
-
-#ifndef QT_NO_DATASTREAM
-
-/*!
- \fn QDataStream &operator<<(QDataStream &stream, const QTriangle3D &triangle)
- \relates QTriangle3D
-
- Writes the given \a triangle to the given \a stream and returns a
- reference to the stream.
-*/
-
-QDataStream &operator<<(QDataStream &stream, const QTriangle3D &triangle)
-{
- stream << triangle.p();
- stream << triangle.q();
- stream << triangle.r();
- return stream;
-}
-
-/*!
- \fn QDataStream &operator>>(QDataStream &stream, QTriangle3D &triangle)
- \relates QTriangle3D
-
- Reads a 3D triangle from the given \a stream into the given \a triangle
- and returns a reference to the stream.
-*/
-
-QDataStream &operator>>(QDataStream &stream, QTriangle3D &triangle)
-{
- QVector3D p, q, r;
- stream >> p;
- stream >> q;
- stream >> r;
- triangle = QTriangle3D(p, q, r);
- return stream;
-}
-
-#endif // QT_NO_DATASTREAM
-
-QT_END_NAMESPACE
diff --git a/src/threed/math3d/qtriangle3d.h b/src/threed/math3d/qtriangle3d.h
deleted file mode 100644
index 8edb5512..00000000
--- a/src/threed/math3d/qtriangle3d.h
+++ /dev/null
@@ -1,182 +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 QTRIANGLE3D_H
-#define QTRIANGLE3D_H
-
-#include <QtGui/qvector3d.h>
-#include <QtGui/qvector2d.h>
-#include "qray3d.h"
-#include "qplane3d.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class QMatrix4x4;
-
-class Q_QT3D_EXPORT QTriangle3D
-{
-public:
- QTriangle3D();
- QTriangle3D(const QVector3D &p, const QVector3D &q, const QVector3D &r);
-
- QVector3D p() const;
- void setP(const QVector3D & point);
-
- QVector3D q() const;
- void setQ(const QVector3D & point);
-
- QVector3D r() const;
- void setR(const QVector3D & point);
-
- QPlane3D plane() const;
- QVector3D center() const;
- QVector3D faceNormal() const;
-
- bool contains(const QVector3D &point) const;
-
- bool intersects(const QRay3D &ray) const;
- qreal intersection(const QRay3D &ray) const;
-
- void transform(const QMatrix4x4 &matrix);
- QTriangle3D transformed(const QMatrix4x4 &matrix) const;
-
- QVector2D uv(const QVector3D &point) const;
-
- bool operator==(const QTriangle3D &other);
- bool operator!=(const QTriangle3D &other);
-
-private:
- QVector3D m_p, m_q, m_r;
-};
-
-inline QTriangle3D::QTriangle3D()
- : m_p(0.0f, 0.0f, 0.0f)
- , m_q(1.0f, 0.0f, 0.0f)
- , m_r(0.0f, 1.0f, 0.0f) {}
-
-inline QTriangle3D::QTriangle3D(const QVector3D &p, const QVector3D &q, const QVector3D &r)
- : m_p(p)
- , m_q(q)
- , m_r(r) {}
-
-inline QVector3D QTriangle3D::p() const
-{
- return m_p;
-}
-
-inline void QTriangle3D::setP(const QVector3D &point)
-{
- m_p = point;
-}
-
-inline QVector3D QTriangle3D::q() const
-{
- return m_q;
-}
-
-inline void QTriangle3D::setQ(const QVector3D &point)
-{
- m_q = point;
-}
-
-inline QVector3D QTriangle3D::r() const
-{
- return m_r;
-}
-
-inline void QTriangle3D::setR(const QVector3D &point)
-{
- m_r = point;
-}
-
-inline QPlane3D QTriangle3D::plane() const
-{
- return QPlane3D(m_p, m_q, m_r);
-}
-
-inline QVector3D QTriangle3D::center() const
-{
- return (m_p + m_q + m_r) / 3.0f;
-}
-
-inline QVector3D QTriangle3D::faceNormal() const
-{
- return QVector3D::crossProduct(m_q - m_p, m_r - m_q);
-}
-
-inline bool QTriangle3D::operator==(const QTriangle3D &other)
-{
- return m_p == other.m_p && m_q == other.m_q && m_r == other.m_r;
-}
-
-inline bool QTriangle3D::operator!=(const QTriangle3D &other)
-{
- return m_p != other.m_p || m_q != other.m_q || m_r != other.m_r;
-}
-
-inline bool qFuzzyCompare
- (const QTriangle3D &triangle1, const QTriangle3D &triangle2)
-{
- return qFuzzyCompare(triangle1.p(), triangle2.p()) &&
- qFuzzyCompare(triangle1.q(), triangle2.q()) &&
- qFuzzyCompare(triangle1.r(), triangle2.r());
-}
-
-#ifndef QT_NO_DEBUG_STREAM
-Q_QT3D_EXPORT QDebug operator<<(QDebug dbg, const QTriangle3D &triangle);
-#endif
-
-#ifndef QT_NO_DATASTREAM
-Q_QT3D_EXPORT QDataStream &operator<<(QDataStream &stream, const QTriangle3D &triangle);
-Q_QT3D_EXPORT QDataStream &operator>>(QDataStream &stream, QTriangle3D &triangle);
-#endif
-
-QT_END_NAMESPACE
-
-Q_DECLARE_METATYPE(QTriangle3D)
-
-QT_END_HEADER
-
-#endif // QTRIANGLE3D_H
diff --git a/src/threed/network/network.pri b/src/threed/network/network.pri
deleted file mode 100644
index 1aafa9db..00000000
--- a/src/threed/network/network.pri
+++ /dev/null
@@ -1,12 +0,0 @@
-INCLUDEPATH += $$PWD
-VPATH += $$PWD
-HEADERS += \
- network/qdownloadmanager.h \
- network/qabstractdownloadmanager.h \
- network/qthreadeddownloadmanager.h
-SOURCES += \
- qdownloadmanager.cpp \
- network/qthreadeddownloadmanager.cpp \
- network/qabstractdownloadmanager.cpp
-PRIVATE_HEADERS += \
- network/qthreadeddownloadmanager_p.h
diff --git a/src/threed/network/qabstractdownloadmanager.cpp b/src/threed/network/qabstractdownloadmanager.cpp
deleted file mode 100644
index a7f21380..00000000
--- a/src/threed/network/qabstractdownloadmanager.cpp
+++ /dev/null
@@ -1,86 +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$
-**
-****************************************************************************/
-
-/*!
- \class QAbstractDownloadManager
- \brief The QAbstractDownloadManager class provides a base class for asset data download capability.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::network
-
- QDownloadManager encapsulates the functions needed for the downloading
- of asset data (eg. textures) from a network URL (eg. a website).
-
- The QAbstractDownloadManager provides only the framework for this, and
- should be extended/overidden by the user to provide a specific implementation.
-
- There are two extant implementations using this base class: QDownloadManager, which
- provides for asynchronous data transfer from a single thread, and QThreadedDownloadManager,
- which spawns its own download thread.
-*/
-
-/*!
- \fn QAbstractDownloadManager::QAbstractDownloadManager(QObject *parent)
- Constructs a new instance of the QDownloadManager and attach it
- to a \a parent QObject.
-*/
-
-/*!
- \fn QAbstractDownloadManager::beginDownload(QUrl url)
- Instructs the QDownloadManager to download the content specified
- in \a url. This may be a texture, 3d model, or similar.
-
- A return value of true indicates that the network request was
- successfully queued for sending, while a return value of false
- indicates a problem with sending (possibly a poorly specified URL, or
- network failure).
-*/
-
-/*!
- \fn QAbstractDownloadManager::downloadComplete(QByteArray assetData)
- \internal
- This signal is emitted when the network request has been completed.
-
- The \a assetData transmitted by the signal contains the content which
- has been downloaded as a QByteArray.
-
- If this value is NULL then the download has failed.
-*/
diff --git a/src/threed/network/qabstractdownloadmanager.h b/src/threed/network/qabstractdownloadmanager.h
deleted file mode 100644
index 18940529..00000000
--- a/src/threed/network/qabstractdownloadmanager.h
+++ /dev/null
@@ -1,71 +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 QABSTRACTDOWNLOADMANAGER_H
-#define QABSTRACTDOWNLOADMANAGER_H
-
-#include "qglnamespace.h"
-#include <QObject>
-#include <QUrl>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class Q_QT3D_EXPORT QAbstractDownloadManager : public QObject
-{
- Q_OBJECT
-public:
- explicit QAbstractDownloadManager(QObject *parent = 0):QObject(parent){}
-
- virtual bool beginDownload(QUrl url) = 0;
-
-signals:
- void downloadComplete(QByteArray assetData);
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // QABSTRACTDOWNLOADMANAGER_H
diff --git a/src/threed/network/qdownloadmanager.cpp b/src/threed/network/qdownloadmanager.cpp
deleted file mode 100644
index edc49fce..00000000
--- a/src/threed/network/qdownloadmanager.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 "qdownloadmanager.h"
-#include <QNetworkAccessManager>
-#include <QNetworkReply>
-#include <QNetworkRequest>
-#include <QDebug>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QDownloadManager
- \brief The QDownloadManager class provides asset data download capability within the
- current thread.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::network
-
- QDownloadManager extends the QAbstractDownloadManager class for use in a
- single-threaded Qt3D application. The QDownloadManager performs its network
- activities asynchronously, and processing will continue as normal while the download
- is underway (ie. the call is non-blocking).
-
- It should be noted that this does not preclude its usage in a multi-threaded
- application, rather that it does not itself spawn any threads of its own.
-
- In circumstances where an application will benefit greatly from multithreading,
- the developer may prefer to use the QThreadedDownloadManager.
-
- At the core of QDownloadManager is a QNetworkAccessManager which is
- shared by all instances of QDownloadManager. The download manager itself
- provides all handling of network requests and replies internally, and
- allows for redirection of URLs and handling of errors without the need
- for the user to query network replies.
-
- To use the QDownloadManager simply create an instance of the class
- within your code, and connect QDownloadManager's downloadComplete() signal
- to a slot in your own code, then call the downloadAsset() function.
-
- For example
-
- \code
- QDownloadManager dlmanage;
-
- connect(this, SLOT(myReceiverSlot(QByteArray)), &dlmanage, SIGNAL(downloadComplete(QByteArray)));
-
- if (!dlmanage.downloadAsset(QUrl("www.my.image.url.net/image.jpg"))) {
- dWarning("the manager was unable to send the url request.");
- }
- \endcode
-
- The QDownloadManager will emit the downloadComplete() signal which contains
- all of the downloaded data in a QByteArray. It is the user's responsibility
- to convert this data to the format they require, and to verify that it is
- correct.
-*/
-
-Q_GLOBAL_STATIC(QNetworkAccessManager, getNetworkAccessManager)
-
-/*!
- Constructs a new instance of the QDownloadManager and attach it
- to a \a parent QObject. Internally this initialises the
- QNetworkAccessManager instance which is shared by all instances of
- this class, and manages downloading of asset data.
-*/
-QDownloadManager::QDownloadManager(QObject *parent) : QAbstractDownloadManager(parent)
-{
-}
-
-
-/*!
- Destroys the current instance of the QDownloadManager. The destructor
- checks whether other instances of the class exist, and if none are found
- it deletes the internal QNetworkAccessManager instance.
-*/
-QDownloadManager::~QDownloadManager()
-{
-}
-
-/*!
- Instructs the QDownloadManager to download the content specified
- in \a assetUrl. This may be a texture, 3d model, or similar.
-
- A return value of true indicates that the network request was
- successfully queued for sending, while a return value of false
- indicates a problem with sending (possibly a poorly specified URL, or
- network failure).
-*/
-bool QDownloadManager::beginDownload(QUrl assetUrl)
-{
- //URL Sanity check
- if ( ! assetUrl.isValid()) {
- qWarning() << "Invalid texture URL: " << assetUrl.toString();
- return false;
- }
-
- QNetworkRequest request(assetUrl);
- request.setAttribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::PreferCache);
- QNetworkReply *netReply = getNetworkAccessManager()->get(request);
-
- if (!netReply) {
- qWarning() << "Unable to send the request to the network.";
- return false;
- }
-
- connect(netReply, SIGNAL(finished()), this, SLOT(netReplyDone()));
- return true;
-}
-
-/*!
- \internal
- Internally used slot which is invoked when a download is finished.
- This handles redirection of URLs internally, as well as error checking.
-
- A successful download will emit the downloadComplete() signal which
- the user is responsible for handling in their own application.
-
- \sa downloadComplete()
-*/
-void QDownloadManager::netReplyDone()
-{
- //Ensure sanity of the sender
- QNetworkReply *reply = qobject_cast<QNetworkReply*>(sender());
-
- if (!reply) {
- qWarning("DownloadManager's signal sender was not a QNetworkReply.");
- return;
- }
-
- if (reply->error() != QNetworkReply::NoError) {
- qWarning() << "Error in network reply: " << reply->url() << "(" << reply->errorString() << ")";
- reply->deleteLater();
- QByteArray tempArray;
- tempArray.clear();
- emit downloadComplete(tempArray);
- return;
- }
-
- //In the case of a reply which is a redirect
- QVariant redirection = reply->attribute(QNetworkRequest::RedirectionTargetAttribute);
- if (redirection.isValid()) {
- QUrl url = redirection.toUrl();
- //Check if we have a relative URL
- if (url.isRelative()) {
- url.setScheme(reply->url().scheme());
- url.setEncodedHost(reply->url().encodedHost());
- }
-
- //Reissue redirected request.
- QNetworkRequest request(url);
- if (getNetworkAccessManager())
- {
- QNetworkReply * netReply = getNetworkAccessManager()->get(request);
- connect(netReply, SIGNAL(finished()), SLOT(netReplyDone()));
- reply->deleteLater();
- } else {
- QByteArray tempArray;
- tempArray.clear();
- emit downloadComplete(tempArray);
- }
-
- return;
- }
-
- //In the case of just data being returned
- //qDebug() << "ContentType:" << reply->header(QNetworkRequest::ContentTypeHeader).toString();
- QByteArray assetData;
- assetData = reply->readAll();
- reply->deleteLater();
-
- emit downloadComplete(assetData);
-
-}
-
-QT_END_NAMESPACE
diff --git a/src/threed/network/qdownloadmanager.h b/src/threed/network/qdownloadmanager.h
deleted file mode 100644
index 202726c1..00000000
--- a/src/threed/network/qdownloadmanager.h
+++ /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 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 DOWNLOADMANAGER_H
-#define DOWNLOADMANAGER_H
-
-#include "qabstractdownloadmanager.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class QNetworkAccessManager;
-class QUrl;
-
-class Q_QT3D_EXPORT QDownloadManager : public QAbstractDownloadManager {
- Q_OBJECT
-public:
- explicit QDownloadManager(QObject *parent = 0);
-
- ~QDownloadManager();
-
- bool beginDownload(QUrl assetUrl);
-public slots:
- void netReplyDone();
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // DOWNLOADMANAGER_H
diff --git a/src/threed/network/qthreadeddownloadmanager.cpp b/src/threed/network/qthreadeddownloadmanager.cpp
deleted file mode 100644
index 61c2e561..00000000
--- a/src/threed/network/qthreadeddownloadmanager.cpp
+++ /dev/null
@@ -1,386 +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 "qthreadeddownloadmanager.h"
-#include "qthreadeddownloadmanager_p.h"
-#include <QNetworkAccessManager>
-#include <QNetworkReply>
-#include <QNetworkRequest>
-#include <QDebug>
-#include <QEventLoop>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QThreadedDownloadManager
- \brief The QThreadedDownloadManager class provides asset data download capability which
- runs in its own download thread.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::network
-
- QThreadedDownloadManager extends the QAbstractDownloadManager class for use in a
- multi-threaded Qt3D application. The QThreadedDownloadManager creates a single download
- thread which is shared by all instances of the class. This thread is based on QThread,
- and it automatically queues and dispatches network requests.
-
- The downloader thread contains its own a QNetworkAccessManager. The download manager
- itself provides all handling of network requests and replies internally, and
- allows for redirection of URLs and handling of errors without the need
- for the user to query network replies.
-
- To use the QAbstractDownloadManager simply create an instance of the class
- within your code, and connect QDownloadManager's downloadComplete() signal
- to a slot in your own code, then call the downloadAsset() function.
-
- For example
-
- \code
- QAbstractDownloadManager dlmanage;
-
- connect(this, SLOT(myReceiverSlot(QByteArray)), &dlmanage, SIGNAL(downloadComplete(QByteArray)));
-
- if (!dlmanage.downloadAsset(QUrl("www.my.image.url.net/image.jpg"))) {
- dWarning("the manager was unable to send the url request.");
- }
- \endcode
-
- The QAbstractDownloadManager will emit the downloadComplete() signal which contains
- all of the downloaded data in a QByteArray. It is the user's responsibility
- to convert this data to the format they require, and to verify that it is
- correct.
-
- When no requests are queue, the QAbstractDownloadManager will halt the downloader
- thread. Multiple QAbstractDownloadManager classes can simultaneously submit
- requests, though the classes themselves are not intended to be completely thread
- safe, and developers should refrain from attempting to interact with the
- underlying classes through anything other than the specified API.
-*/
-
-Q_GLOBAL_STATIC(QDownloadThread, getDownloadThread)
-
-/*!
- Constructs a new instance of the QDownloadManager and attach it
- to a \a parent QObject.
-*/
-QThreadedDownloadManager::QThreadedDownloadManager(QObject *parent) :
- QAbstractDownloadManager(parent)
-{
-}
-
-/*!
- Destroys the current instance of the QThreadedDownloadManager. The destructor
- checks whether other instances of the class exist, and if none are found
- it sends a signal to the download thread to halt. It waits for the thread
- to end, then deletes the thread instance.
-*/
-QThreadedDownloadManager::~QThreadedDownloadManager()
-{
-}
-
-/*!
- Instructs the QThreadedDownloadManager to start the download thread. If no thread
- class currently exists this function will create one.
-
- If an existing thread is already in the process of shutting down the function will wait
- for the thread to end before re-starting it.
-
- If an existing thread is running, the function will do nothing.
-*/
-void QThreadedDownloadManager::beginThread()
-{
- //Connect the thread instance if one doesn't exist
- connect(this, SIGNAL(endThread()), getDownloadThread(), SLOT(quit()));
-
- //Signal thread completion so we can do any cleanup
- connect(getDownloadThread(), SIGNAL(finished()), this, SLOT(threadExit()));
-
- //If thread has had a quit message posted, wait until it's done before commencing
- if (getDownloadThread()->isThreadQuitting())
- {
- if (!getDownloadThread()->wait(1000))
- {
- qWarning("Download thread did not finish in timely manner - killing");
- getDownloadThread()->terminate();
- qWarning("Waiting for termination");
- while (getDownloadThread()->wait(1000)) {}
- }
- }
-
- //Spin the thread if it isn't running, otherwise, it's already going, so just carry on.
- if (!getDownloadThread()->isRunning()) {
- getDownloadThread()->start();
- }
-}
-
-/*!
- Instructs the QThreadedDownloadManager to download the content specified
- in \a assetUrl. This may be a texture, 3d model, or similar.
-
- A return value of true indicates that the network request was
- successfully queued for sending, while a return value of false
- indicates a problem with sending (possibly a poorly specified URL, or
- network failure).
-*/
-bool QThreadedDownloadManager::beginDownload(QUrl assetUrl)
-{
- //Ensure a thread is running
- beginThread();
-
- //Create the download instance - this object will be transferred to worker thread
- //control once all signals and slots to the current thread have been connected.
- QDownloadInstance * cObject = new QDownloadInstance();
-
- cObject->doSetup(*this);
- cObject->moveToThread(getDownloadThread());
-
- emit startDownload(assetUrl);
- return true;
-}
-
-/*!
- Instructs the QThreadedDownloadManager that the network replies have been received
- successfully. This currently performs no other processing, though is retained
- and can be overriden for debugging purposes.
-*/
-void QThreadedDownloadManager::netReplyDone()
-{
- //do nothing - this is kept for debugging/extension purposes
-}
-
-/*!
- Instructs the QThreadedDownloadManager that the downloader thread has exited
- successfully. This currently performs no other processing, though is retained
- and can be overriden for debugging purposes.
-*/
-void QThreadedDownloadManager::threadExit()
-{
- //do nothing - this is kept for debugging/extension purposes
-}
-
-/*!
- \fn QThreadedDownloadManager::endThread()
- Signals the download thread to exit. This will be performed gracefully, and
- remaining messages in the message loop will be processed.
-*/
-
-/*!
- \fn QThreadedDownloadManager::startDownload(QUrl assetUrl)
- Signals the download thread to begin downloading from \a assetUrl. This will
- be performed in the background until the download is complete.
-*/
-
-//Private Function Implementation for QDownloadInstance below.
-QDownloadInstance::QDownloadInstance(QObject *parent) : QObject(parent)
-{
- //do nothing
-}
-
-QDownloadInstance::~QDownloadInstance()
-{
- //do nothing
-}
-
-void QDownloadInstance::doSetup(QThreadedDownloadManager &cComm)
-{
- //Connect messages for starting the thread and alerting for completion of downloading (or error states)
- connect (&cComm, SIGNAL(startDownload(QUrl)), this, SLOT(doWork(QUrl)));
- connect (this, SIGNAL(downloadComplete(QByteArray)), &cComm, SIGNAL(downloadComplete(QByteArray)));
-}
-
-void QDownloadInstance::doWork(QUrl assetUrl)
-{
- //Get the network access manager belonging to the QDownloadThread we're in (if any)
- QNetworkAccessManager * netAccessMgr;
- if (!(netAccessMgr=getNetworkManager())) {
- emit downloadComplete(NULL);
- return;
- }
-
- //Send requests as needed.
- QNetworkRequest request(assetUrl);
- request.setAttribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::PreferCache);
- QNetworkReply *netReply = netAccessMgr->get(request);
-
- connect(netReply, SIGNAL(finished()), this, SLOT(doneWork()));
- connect (this, SIGNAL(killDownloadThread()), getDownloadThread(), SLOT(quit()));
-
- //Add one to the current request count
- incrementRequestCount();
-}
-
-void QDownloadInstance::doneWork()
-{
- //Ensure sanity of the sender as a QNetworkReply
- QNetworkReply *reply = qobject_cast<QNetworkReply*>(sender());
- if (!reply) {
- qWarning("QDownload::DoneWork signal sender was not a QNetworkReply.");
- sender()->deleteLater();
- return;
- }
-
- //Check for error states
- if (reply->error() != QNetworkReply::NoError) {
- qWarning() << "Error in network reply: " << reply->url() << "(" << reply->errorString() << ")";
- reply->deleteLater();
- emit downloadComplete(NULL);
- sender()->deleteLater();
- deleteLater();
- decrementRequestCount();
- return;
- }
-
- //In the case of a reply which is a redirect
- QVariant redirection = reply->attribute(QNetworkRequest::RedirectionTargetAttribute);
- if (redirection.isValid()) {
- QUrl url = redirection.toUrl();
- //Check if we have a relative URL
- if (url.isRelative()) {
- url.setScheme(reply->url().scheme());
- url.setEncodedHost(reply->url().encodedHost());
- }
-
- //Reissue redirected request.
- QNetworkRequest request(url);
- QNetworkAccessManager * netAccessMgr;
- if (!(netAccessMgr=getNetworkManager())) {
- emit downloadComplete(NULL);
- return;
- }
- QNetworkReply * netReply = netAccessMgr->get(request);
- connect(netReply, SIGNAL(finished()), SLOT(netReplyDone()));
- reply->deleteLater();
- return;
- }
-
- //In the case of just data being returned
- //qDebug() << "ContentType:" << reply->header(QNetworkRequest::ContentTypeHeader).toString();
- QByteArray assetData;
- assetData = reply->readAll();
- emit downloadComplete(assetData);
- reply->deleteLater();
-
- //A successful request means that we can decrement the number of requests in the current
- //thread - once this reaches zero, the thread will be halted for efficiency.
- deleteLater();
- decrementRequestCount();
-}
-
-QNetworkAccessManager * QDownloadInstance::getNetworkManager()
-{
- QDownloadThread *downloadThread = qobject_cast<QDownloadThread*>(thread());
-
- if (!downloadThread)
- {
- qWarning() << "QDownload instance is not running in a DownloadThread - cannot access network.";
- return NULL;
- }
-
- return downloadThread->m_netAccessMgr;
-}
-
-void QDownloadInstance::incrementRequestCount()
-{
- QDownloadThread *downloadThread = qobject_cast<QDownloadThread*>(thread());
-
- if (!downloadThread)
- {
- qWarning() << "QDownload instance is not running in a DownloadThread - cannot increment network request count.";
- return;
- }
-
- //We keep a count of the number of network requests currently queued by the
- //network access manager in the thread. This is used to check if we want to keep the
- //thread running - if no requests are pending we will simply kill the thread.
- downloadThread->m_requestCount++;
-}
-
-void QDownloadInstance::decrementRequestCount()
-{
- QDownloadThread *downloadThread = qobject_cast<QDownloadThread*>(thread());
-
- if (!downloadThread)
- {
- qWarning() << "QDownload instance is not running in a DownloadThread - cannot decrement network request count.";
- return;
- }
-
- //We keep a count of the number of network requests currently queued by the
- //network access manager in the thread. This is used to check if we want to keep the
- //thread running - if no requests are pending we will simply kill the thread (after
- //processing current messages, of course).
- downloadThread->m_requestCount--;
-
- if (downloadThread->m_requestCount<=0) {
- downloadThread->m_threadQuitting = true;
- emit killDownloadThread();
- }
-}
-
-//Private Function Implementation for QDownloadThread below.
-QDownloadThread::QDownloadThread(QObject *parent) : QThread(parent)
-{
- m_threadQuitting = false;
- m_requestCount = 0;
- m_netAccessMgr = 0;
-}
-
-QDownloadThread::~QDownloadThread()
-{
-}
-
-void QDownloadThread::run()
-{
- //When we run the thread we ensure a valid QNetworkAccessManager exists.
- if (!m_netAccessMgr) {
- m_netAccessMgr = new QNetworkAccessManager(this);
- }
-
- m_threadQuitting = false;
- exec();
-}
-
-bool QDownloadThread::isThreadQuitting() const
-{
- return m_threadQuitting;
-}
-
-QT_END_NAMESPACE
diff --git a/src/threed/network/qthreadeddownloadmanager.h b/src/threed/network/qthreadeddownloadmanager.h
deleted file mode 100644
index 08a9fb3a..00000000
--- a/src/threed/network/qthreadeddownloadmanager.h
+++ /dev/null
@@ -1,78 +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 QTHREADEDDOWNLOADMANAGER_H
-#define QTHREADEDDOWNLOADMANAGER_H
-
-#include "qabstractdownloadmanager.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-#define QT3D_MULTITHREAD "QT3D_MULTITHREAD"
-
-QT_MODULE(Qt3D)
-
-class QDownloadThread;
-
-class Q_QT3D_EXPORT QThreadedDownloadManager : public QAbstractDownloadManager
-{
- Q_OBJECT
-public:
- explicit QThreadedDownloadManager(QObject *parent = 0);
- ~QThreadedDownloadManager();
-
- void beginThread();
- bool beginDownload(QUrl assetUrl);
-signals:
- void endThread();
- void startDownload(QUrl assetUrl);
-public slots:
- void netReplyDone();
- void threadExit();
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // QTHREADEDDOWNLOADMANAGER_H
diff --git a/src/threed/network/qthreadeddownloadmanager_p.h b/src/threed/network/qthreadeddownloadmanager_p.h
deleted file mode 100644
index 2cf2360e..00000000
--- a/src/threed/network/qthreadeddownloadmanager_p.h
+++ /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 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 QTHREADEDDOWNLOADMANAGER_P_H
-#define QTHREADEDDOWNLOADMANAGER_P_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 "qthreadeddownloadmanager.h"
-#include <QThread>
-#include <QMutex>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class QNetworkAccessManager;
-
-//This is the main download thread where the network requests are queued and
-//processed.
-class QDownloadThread : public QThread
-{
- Q_OBJECT
- friend class QDownloadInstance;
-public:
- QDownloadThread(QObject *parent = 0);
- ~QDownloadThread();
-
- void run();
-
- bool isThreadQuitting() const;
-protected:
- QNetworkAccessManager * m_netAccessMgr;
- int m_requestCount;
- bool m_threadQuitting;
-};
-
-//This is a single instance of a download request, and acts as an intermediary
-//processing object between threads.
-class QDownloadInstance : public QObject
-{
- Q_OBJECT
-public:
- explicit QDownloadInstance(QObject *parent = 0);
- ~QDownloadInstance();
- void doSetup(QThreadedDownloadManager &cComm);
-
-signals:
- void downloadComplete(QByteArray assetData);
- void killDownloadThread();
-
-public slots:
- void doWork(QUrl assetUrl);
- void doneWork();
-
-protected:
- QNetworkAccessManager * getNetworkManager();
- void incrementRequestCount();
- void decrementRequestCount();
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // QTHREADEDDOWNLOADMANAGER_P_H
diff --git a/src/threed/painting/painting.pri b/src/threed/painting/painting.pri
deleted file mode 100644
index 27763c09..00000000
--- a/src/threed/painting/painting.pri
+++ /dev/null
@@ -1,29 +0,0 @@
-
-INCLUDEPATH += $$PWD
-VPATH += $$PWD
-
-HEADERS += \
- painting/qglabstracteffect.h \
- painting/qgllightmodel.h \
- painting/qgllightparameters.h \
- painting/qglpainter.h \
- painting/qmatrix4x4stack.h
-
-SOURCES += \
- qglabstracteffect.cpp \
- qglext.cpp \
- qgllightmodel.cpp \
- qgllightparameters.cpp \
- qglpainter.cpp \
- qglpickcolors.cpp \
- qmatrix4x4stack.cpp
-
-PRIVATE_HEADERS += \
- qglpainter_p.h \
- qglpickcolors_p.h \
- qglabstracteffect_p.h \
- qmatrix4x4stack_p.h
-
-# Don't add this file to PRIVATE_HEADERS because we don't
-# want moc to run over it:
-# qglext_p.h
diff --git a/src/threed/painting/qglabstracteffect.cpp b/src/threed/painting/qglabstracteffect.cpp
deleted file mode 100644
index 756d15bf..00000000
--- a/src/threed/painting/qglabstracteffect.cpp
+++ /dev/null
@@ -1,151 +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 "qglabstracteffect.h"
-#include "qglpainter_p.h"
-#include <QtOpenGL/qglshaderprogram.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGLAbstractEffect
- \since 4.8
- \brief The QGLAbstractEffect class provides a standard interface for rendering surface material effects with GL.
- \ingroup qt3d
- \ingroup qt3d::painting
-
- \section1 Vertex attributes
-
- Vertex attributes for the effect are specified using
- QGLPainter::setVertexAttribute() and QGLPainter::setVertexBundle(),
- and may be independent of the effect itself. Those functions
- will bind standard attributes to specific indexes within the
- GL state. For example, the QGL::Position will be bound
- to index 0, QGL::TextureCoord0 will be bound to index 3, etc.
-
- Effect subclasses that use vertex shaders should bind their attributes
- to these indexes using QGLShaderProgram::bindAttributeLocation()
- just before the program is linked. For example:
-
- \code
- QGLShaderProgram *program = new QGLShaderProgram();
- program->addShaderFromSourceCode(QGLShader::Vertex, vshaderSource);
- program->addShaderFromSourceCode(QGLShader::Fragment, fshaderSource);
- program->bindAttributeLocation("vertex", QGL::Position);
- program->bindAttributeLocation("normal", QGL::Normal);
- program->bindAttributeLocation("texcoord", QGL::TextureCoord0);
- program->link();
- \endcode
-
- The QGLShaderProgramEffect class can assist with writing
- shader-based effects. It will automatically bind special
- variable names, such as \c{qt_Vertex}, \c{qt_MultiTexCoord0}, etc,
- to the standard indexes. This alleviates the need for the
- application to bind the names itself.
-*/
-
-/*!
- Constructs a new effect object.
-*/
-QGLAbstractEffect::QGLAbstractEffect()
-{
-}
-
-/*!
- Destroys this effect object.
-*/
-QGLAbstractEffect::~QGLAbstractEffect()
-{
-}
-
-/*!
- Returns true if this effect supports object picking; false otherwise.
- The default implementation returns false, which causes QGLPainter
- to use the effect associated with QGL::FlatColor to perform
- object picking.
-
- Effects that support object picking render fragments with
- QGLPainter::pickColor() when QGLPainter::isPicking() returns true.
- By default, only the effect associated with QGL::FlatColor does this,
- rendering the entire fragment with the flat pick color.
-
- In some cases, rendering the entire fragment with the pick color
- may not be appropriate. An alpha-blended icon texture that is
- drawn to the screen as a quad may have an irregular shape smaller
- than the quad. For picking, the application may not want the
- entire quad to be "active" for object selection as it would appear
- to allow the user to click off the icon to select it.
-
- This situation can be handled by implementing an icon rendering
- effect that draws the icon normally when QGLPainter::isPicking()
- is false, and draws a mask texture defining the outline of the icon
- with QGLPainter::pickColor() when QGLPainter::isPicking() is true.
-
- \sa QGLPainter::setPicking()
-*/
-bool QGLAbstractEffect::supportsPicking() const
-{
- return false;
-}
-
-/*!
- \fn void QGLAbstractEffect::setActive(QGLPainter *painter, bool flag)
-
- Activates or deactivates this effect on \a painter,
- according to \a flag, on the current GL context by selecting
- shader programs, setting lighting and material parameters, etc.
-
- \sa update()
-*/
-
-/*!
- \fn void QGLAbstractEffect::update(QGLPainter *painter, QGLPainter::Updates updates)
-
- Updates the current GL context with information from \a painter
- just prior to the drawing of triangles, quads, etc.
-
- The \a updates parameter specifies the properties on \a painter
- that have changed since the last call to update() or setActive().
-
- \sa setActive()
-*/
-
-QT_END_NAMESPACE
diff --git a/src/threed/painting/qglabstracteffect.h b/src/threed/painting/qglabstracteffect.h
deleted file mode 100644
index ad317f69..00000000
--- a/src/threed/painting/qglabstracteffect.h
+++ /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$
-**
-****************************************************************************/
-
-#ifndef QGLABSTRACTEFFECT_H
-#define QGLABSTRACTEFFECT_H
-
-#include "qglpainter.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class Q_QT3D_EXPORT QGLAbstractEffect
-{
-public:
- QGLAbstractEffect();
- virtual ~QGLAbstractEffect();
-
- virtual bool supportsPicking() const;
- virtual void setActive(QGLPainter *painter, bool flag) = 0;
- virtual void update(QGLPainter *painter, QGLPainter::Updates updates) = 0;
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/painting/qglabstracteffect_p.h b/src/threed/painting/qglabstracteffect_p.h
deleted file mode 100644
index 57f2a338..00000000
--- a/src/threed/painting/qglabstracteffect_p.h
+++ /dev/null
@@ -1,70 +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 QGLABSTRACTEFFECT_P_H
-#define QGLABSTRACTEFFECT_P_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 "qglabstracteffect.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-#if defined(QT_OPENGL_ES_2)
-#define QGL_SHADERS_ONLY 1
-#endif
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/painting/qglext.cpp b/src/threed/painting/qglext.cpp
deleted file mode 100644
index 82ab179f..00000000
--- a/src/threed/painting/qglext.cpp
+++ /dev/null
@@ -1,99 +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 "qglext_p.h"
-#include "qopenglfunctions.h"
-
-// copied private header
-#include "qglextensions_p.h"
-
-QT_BEGIN_NAMESPACE
-
-#if !defined(QT_OPENGL_ES)
-
-typedef void (QT3D_GLF_APIENTRYP q_PFNGLCLIENTACTIVETEXTUREPROC) (GLenum);
-
-class QGLMultiTextureExtensions
-{
-public:
- QGLMultiTextureExtensions(const QGLContext * = 0)
- {
- clientActiveTexture = 0;
- multiTextureResolved = false;
- }
-
- q_PFNGLCLIENTACTIVETEXTUREPROC clientActiveTexture;
- bool multiTextureResolved;
-};
-
-Q_GLOBAL_STATIC(QGLResource<QGLMultiTextureExtensions>, qt_multitexture_funcs)
-
-static QGLMultiTextureExtensions *resolveMultiTextureExtensions
- (const QGLContext *ctx)
-{
- QGLMultiTextureExtensions *extn = qt_multitexture_funcs()->value(ctx);
- if (!(extn->multiTextureResolved)) {
- extn->multiTextureResolved = true;
- if (!extn->clientActiveTexture) {
- extn->clientActiveTexture = (q_PFNGLCLIENTACTIVETEXTUREPROC)
- ctx->getProcAddress(QLatin1String("glClientActiveTexture"));
- }
- if (!extn->clientActiveTexture) {
- extn->clientActiveTexture = (q_PFNGLCLIENTACTIVETEXTUREPROC)
- ctx->getProcAddress(QLatin1String("glClientActiveTextureARB"));
- }
- }
- return extn;
-}
-
-void qt_gl_ClientActiveTexture(GLenum texture)
-{
- const QGLContext *ctx = QGLContext::currentContext();
- if (!ctx)
- return;
- QGLMultiTextureExtensions *extn = resolveMultiTextureExtensions(ctx);
- if (extn->clientActiveTexture)
- extn->clientActiveTexture(texture);
-}
-
-#endif
-
-QT_END_NAMESPACE
diff --git a/src/threed/painting/qglext_p.h b/src/threed/painting/qglext_p.h
deleted file mode 100644
index c2999c80..00000000
--- a/src/threed/painting/qglext_p.h
+++ /dev/null
@@ -1,220 +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 QGLEXT_P_H
-#define QGLEXT_P_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 <QtOpenGL/qgl.h>
-#include "qt3dglobal.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-// Provide some useful OpenGL extension definitions.
-
-#if !defined(QT_OPENGL_ES)
-
-extern void Q_QT3D_EXPORT qt_gl_ClientActiveTexture(GLenum texture);
-
-#elif !defined(QT_OPENGL_ES_2)
-
-#define qt_gl_ClientActiveTexture glClientActiveTexture
-
-#endif
-
-class QGLExtensionChecker
-{
-public:
- QGLExtensionChecker(const char *str)
- : gl_extensions(str), gl_extensions_length(qstrlen(str))
- {}
-
- bool match(const char *str) {
- int str_length = qstrlen(str);
- const char *extensions = gl_extensions;
- int extensions_length = gl_extensions_length;
-
- while (1) {
- // the total length that needs to be matched is the str_length +
- // the space character that terminates the extension name
- if (extensions_length < str_length + 1)
- return false;
- if (qstrncmp(extensions, str, str_length) == 0 && extensions[str_length] == ' ')
- return true;
-
- int split_pos = 0;
- while (split_pos < extensions_length && extensions[split_pos] != ' ')
- ++split_pos;
- ++split_pos; // added for the terminating space character
- extensions += split_pos;
- extensions_length -= split_pos;
- }
- return false;
- }
-
-private:
- const char *gl_extensions;
- int gl_extensions_length;
-};
-
-// Copy of some definitions from <QtOpenGL/private/qgl_p.h> so that
-// we can avoid a direct dependency upon private headers in Qt.
-
-#if QT_VERSION >= 0x040800
-
-class QGLContextGroup;
-
-#if !defined(QGL_P_H)
-
-class Q_OPENGL_EXPORT QGLContextGroupResourceBase
-{
-public:
- QGLContextGroupResourceBase();
- virtual ~QGLContextGroupResourceBase();
- void insert(const QGLContext *context, void *value);
- void *value(const QGLContext *context);
- void cleanup(const QGLContext *context, void *value);
- virtual void freeResource(void *value) = 0;
-
-protected:
- QList<QGLContextGroup *> m_groups;
-
-private:
- QAtomicInt active;
-};
-
-#endif
-
-template <class T>
-class QGLResource : public QGLContextGroupResourceBase
-{
-public:
- T *value(const QGLContext *context) {
- T *resource = reinterpret_cast<T *>(QGLContextGroupResourceBase::value(context));
- if (!resource) {
- resource = new T(context);
- insert(context, resource);
- }
- return resource;
- }
-
-protected:
- void freeResource(void *resource) {
- delete reinterpret_cast<T *>(resource);
- }
-};
-
-#else
-
-#if !defined(QGL_P_H)
-
-class Q_OPENGL_EXPORT QGLContextResource
-{
-public:
- typedef void (*FreeFunc)(void *);
- QGLContextResource(FreeFunc f);
- ~QGLContextResource();
- void insert(const QGLContext *key, void *value);
- void *value(const QGLContext *key);
- void cleanup(const QGLContext *ctx, void *value);
-private:
- FreeFunc free;
- QAtomicInt active;
-};
-
-#endif
-
-template <class T>
-class QGLResource : public QGLContextResource
-{
-public:
- static void freeResource(void *resource) {
- delete reinterpret_cast<T *>(resource);
- }
-
- QGLResource() : QGLContextResource(freeResource) {}
-
- T *value(const QGLContext *context) {
- T *resource = reinterpret_cast<T *>(QGLContextResource::value(context));
- if (!resource) {
- resource = new T(context);
- insert(context, resource);
- }
- return resource;
- }
-};
-
-#endif
-
-#if !defined(QGL_P_H) && !defined(Q_MOC_RUN)
-
-class Q_OPENGL_EXPORT QGLSignalProxy : public QObject
-{
- Q_OBJECT
-public:
- QGLSignalProxy() : QObject() {}
- void emitAboutToDestroyContext(const QGLContext *context) {
- emit aboutToDestroyContext(context);
- }
- static QGLSignalProxy *instance();
-Q_SIGNALS:
- void aboutToDestroyContext(const QGLContext *context);
-};
-
-#endif
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/painting/qgllightmodel.cpp b/src/threed/painting/qgllightmodel.cpp
deleted file mode 100644
index f68c1179..00000000
--- a/src/threed/painting/qgllightmodel.cpp
+++ /dev/null
@@ -1,291 +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 "qgllightmodel.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGLLightModel
- \brief The QGLLightModel class defines the lighting model to use for the scene.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::painting
-*/
-
-/*!
- \qmlclass LightModel QGLLightModel
- \brief The LightModel item defines the lighting model to use for the scene.
- \since 4.8
- \ingroup qt3d::qml3d
-
- \sa Light
-*/
-
-/*!
- \enum QGLLightModel::Model
- This enum defines the type of lighting model to use: one-sided or two-sided.
-
- \value OneSided One-sided lighting, with the front face material used for both front and back faces.
- \value TwoSided Two-sided lighting, with separate front and back face materials.
-*/
-
-/*!
- \enum QGLLightModel::ColorControl
- This enum controls the number of colors to be generated by the lighting computation.
-
- \value SingleColor A single color is generated by the lighting computation.
- \value SeparateSpecularColor A separate specular color computation is
- performed and then summed into the pixel color after texture mapping.
-*/
-
-/*!
- \enum QGLLightModel::ViewerPosition
- This enum defines the position of the viewer for the purposes of lighting calculations.
-
- \value ViewerAtInfinity The viewer is at infinity along the -z axis.
- \value LocalViewer The viewer is at the local origin in eye coordinates.
-*/
-
-class QGLLightModelPrivate
-{
-public:
- QGLLightModelPrivate()
- : model(QGLLightModel::OneSided),
- colorControl(QGLLightModel::SingleColor),
- viewerPosition(QGLLightModel::ViewerAtInfinity)
- {
- ambientSceneColor.setRgbF(0.2, 0.2, 0.2, 1.0);
- }
-
- QGLLightModel::Model model;
- QGLLightModel::ColorControl colorControl;
- QGLLightModel::ViewerPosition viewerPosition;
- QColor ambientSceneColor;
-};
-
-/*!
- Constructs a light model object with default values and attach
- it to \a parent.
-*/
-QGLLightModel::QGLLightModel(QObject *parent)
- : QObject(parent)
- , d_ptr(new QGLLightModelPrivate)
-{
-}
-
-/*!
- Destroys this light model.
-*/
-QGLLightModel::~QGLLightModel()
-{
-}
-
-/*!
- \property QGLLightModel::model
- \brief the lighting model to use, either OneSided or TwoSided.
- The default is OneSided.
-
- \sa modelChanged()
-*/
-
-/*!
- \qmlproperty enumeration LightModel::model
- The lighting model to use, either OneSided or TwoSided.
- The default is OneSided.
-*/
-
-QGLLightModel::Model QGLLightModel::model() const
-{
- Q_D(const QGLLightModel);
- return d->model;
-}
-
-void QGLLightModel::setModel(QGLLightModel::Model value)
-{
- Q_D(QGLLightModel);
- if (d->model != value) {
- d->model = value;
- emit modelChanged();
- emit lightModelChanged();
- }
-}
-
-/*!
- \property QGLLightModel::colorControl
- \brief the color control mode, either SingleColor or
- SeparateSpecularColor. The default value is SingleColor.
-
- If SingleColor is specified, then a single color is calculated
- by the lighting computation for a vertex. If SeparateSpecularColor
- is specified, then a separate specular color computation is
- performed and then summed into the pixel color after texture mapping.
-
- \sa colorControlChanged()
-*/
-
-/*!
- \qmlproperty enumeration LightModel::colorControl
- The color control mode, either SingleColor or
- SeparateSpecularColor. The default value is SingleColor.
-
- If SingleColor is specified, then a single color is calculated
- by the lighting computation for a vertex. If SeparateSpecularColor
- is specified, then a separate specular color computation is
- performed and then summed into the pixel color after texture mapping.
-*/
-
-QGLLightModel::ColorControl QGLLightModel::colorControl() const
-{
- Q_D(const QGLLightModel);
- return d->colorControl;
-}
-
-void QGLLightModel::setColorControl(QGLLightModel::ColorControl value)
-{
- Q_D(QGLLightModel);
- if (d->colorControl != value) {
- d->colorControl = value;
- emit colorControlChanged();
- emit lightModelChanged();
- }
-}
-
-/*!
- \property QGLLightModel::viewerPosition
- \brief the viewer position, either ViewerAtInfinity or LocalViewer.
- The default value is ViewerAtInfinity.
-
- \sa viewerPositionChanged()
-*/
-
-/*!
- \qmlproperty enumeration LightModel::viewerPosition
- The viewer position, either ViewerAtInfinity or LocalViewer.
- The default value is ViewerAtInfinity.
-*/
-
-QGLLightModel::ViewerPosition QGLLightModel::viewerPosition() const
-{
- Q_D(const QGLLightModel);
- return d->viewerPosition;
-}
-
-void QGLLightModel::setViewerPosition(QGLLightModel::ViewerPosition value)
-{
- Q_D(QGLLightModel);
- if (d->viewerPosition != value) {
- d->viewerPosition = value;
- emit viewerPositionChanged();
- emit lightModelChanged();
- }
-}
-
-/*!
- \property QGLLightModel::ambientSceneColor
- \brief the ambient color of the entire scene. The default value
- is (0.2, 0.2, 0.2, 1.0).
-
- \sa ambientSceneColorChanged()
-*/
-
-/*!
- \qmlproperty color LightModel::ambientSceneColor
- The ambient color of the entire scene. The default value
- is (0.2, 0.2, 0.2, 1.0).
-*/
-
-QColor QGLLightModel::ambientSceneColor() const
-{
- Q_D(const QGLLightModel);
- return d->ambientSceneColor;
-}
-
-void QGLLightModel::setAmbientSceneColor(const QColor& value)
-{
- Q_D(QGLLightModel);
- if (d->ambientSceneColor != value) {
- d->ambientSceneColor = value;
- emit ambientSceneColorChanged();
- emit lightModelChanged();
- }
-}
-
-/*!
- \fn void QGLLightModel::modelChanged()
-
- This signal is emitted when model() changes.
-
- \sa model(), lightModelChanged()
-*/
-
-/*!
- \fn void QGLLightModel::colorControlChanged()
-
- This signal is emitted when colorControl() changes.
-
- \sa colorControl(), lightModelChanged()
-*/
-
-/*!
- \fn void QGLLightModel::viewerPositionChanged()
-
- This signal is emitted when viewerPosition() changes.
-
- \sa viewerPosition(), lightModelChanged()
-*/
-
-/*!
- \fn void QGLLightModel::ambientSceneColorChanged()
-
- This signal is emitted when ambientSceneColor() changes.
-
- \sa ambientSceneColor(), lightModelChanged()
-*/
-
-/*!
- \fn void QGLLightModel::lightModelChanged()
-
- This signal is emitted when one of model(), colorControl(),
- viewerPosition(), or ambientSceneColor() changes.
-*/
-
-QT_END_NAMESPACE
diff --git a/src/threed/painting/qgllightmodel.h b/src/threed/painting/qgllightmodel.h
deleted file mode 100644
index 1ffde57a..00000000
--- a/src/threed/painting/qgllightmodel.h
+++ /dev/null
@@ -1,119 +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 QGLLIGHTMODEL_H
-#define QGLLIGHTMODEL_H
-
-#include "qt3dglobal.h"
-#include <QtCore/qobject.h>
-#include <QtGui/qcolor.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class QGLLightModelPrivate;
-
-class Q_QT3D_EXPORT QGLLightModel : public QObject
-{
- Q_OBJECT
- Q_DECLARE_PRIVATE(QGLLightModel)
- Q_ENUMS(Model)
- Q_ENUMS(ColorControl)
- Q_ENUMS(ViewerPosition)
- Q_PROPERTY(Model model READ model WRITE setModel NOTIFY modelChanged)
- Q_PROPERTY(ColorControl colorControl READ colorControl WRITE setColorControl NOTIFY colorControlChanged)
- Q_PROPERTY(ViewerPosition viewerPosition READ viewerPosition WRITE setViewerPosition NOTIFY viewerPositionChanged)
- Q_PROPERTY(QColor ambientSceneColor READ ambientSceneColor WRITE setAmbientSceneColor NOTIFY ambientSceneColorChanged)
-public:
- explicit QGLLightModel(QObject *parent = 0);
- ~QGLLightModel();
-
- enum Model
- {
- OneSided,
- TwoSided
- };
-
- enum ColorControl
- {
- SingleColor,
- SeparateSpecularColor
- };
-
- enum ViewerPosition
- {
- ViewerAtInfinity,
- LocalViewer
- };
-
- QGLLightModel::Model model() const;
- void setModel(QGLLightModel::Model value);
-
- QGLLightModel::ColorControl colorControl() const;
- void setColorControl(QGLLightModel::ColorControl value);
-
- QGLLightModel::ViewerPosition viewerPosition() const;
- void setViewerPosition(QGLLightModel::ViewerPosition value);
-
- QColor ambientSceneColor() const;
- void setAmbientSceneColor(const QColor& value);
-
-Q_SIGNALS:
- void modelChanged();
- void colorControlChanged();
- void viewerPositionChanged();
- void ambientSceneColorChanged();
- void lightModelChanged();
-
-private:
- Q_DISABLE_COPY(QGLLightModel)
-
- QScopedPointer<QGLLightModelPrivate> d_ptr;
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/painting/qgllightparameters.cpp b/src/threed/painting/qgllightparameters.cpp
deleted file mode 100644
index d96bf162..00000000
--- a/src/threed/painting/qgllightparameters.cpp
+++ /dev/null
@@ -1,828 +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 "qgllightparameters.h"
-#include <QtCore/qmath.h>
-#include <QtGui/qmatrix4x4.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGLLightParameters
- \brief The QGLLightParameters class represents the parameters of a light in a 3D scene.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::painting
-
- The functions in this class are a convenience wrapper for the OpenGL enumerations
- which control each light source in a 3D scene. For the general ambient light in a
- scene, not from a source refer to QGLLightModel.
-
- The ambient, diffuse and specular components of the light can be controlled for by
- colour, and are set by the following functions:
- \list
- \o setAmbientColor()
- \o setDiffuseColor()
- \o setSpecularColor()
- \endlist
- Other than changing intensity by using darker color values, see below for how to
- change the intensity of the light with distance from the lit object.
-
- Light sources are of two types, directional and positional, described by the
- enumeration QGLLightParameters::LightType. By default a light source is directional.
-
- A directional light source is infinitely distant, such that its rays are all
- parallel, to a direction \bold vector. This vector is set by the setDirection()
- function. If the light source is not directional when setDirection() is called, its
- type is changed to Directional. Directional light sources model real world light
- sources like the sun. Such light sources are not located at any particular point
- and affect the scene evenly.
-
- In the OpenGL model-view, a directional light is represented by a 4d vector, with
- the 4th value, \c w, set to 0.0f. This means that the spatial data of the light
- is not changed during certain transformations, for example translation.
- See \l {3D Math Basis} for a fuller explanation of this.
-
- Calling the setPosition() function defines the light source to be located at a given
- \bold point, a finite distance from the lit object. If the light source is not
- positional when this function is called its type is changed to Positional.
-
- A positional light source models a real world lamp, such as a light-bulb or
- car headlight. Since it is a finite distance from the lit object the rays diverge
- and lighting calculations are thus more complex.
-
- In OpenGL the light has its spatial data \c w value set to 1.0f, resulting in the
- lights position being changed along with other objects in the scene by transformations
- such as translation. See \l {3D Math Basis} for more.
-
- Positional lights are by default point sources, like the light-bulb where light
- radiates in all directions. Calling the spotAngle() function sets an angle to
- restrict the light from a positional source to a cone like the car headlight. This
- makes the light behave like a spotlight, where objects outside of the cone of the
- light do not receive any light from that source.
-
- The spotlight may be further specified by its spotExponent() which dictates the
- behaviour of the cutoff at the lighting cone; and by the attenuation functions
- which are the terms in the following equation:
- \image attenuation.png
- here \c d is the distance of the light from the lit object, and A is the attenuation
- factor which is a multiplier of the light source, determining its intensity at the
- lit object. The terms in the denominator are:
- \list
- \o constantAttenuation() - default 1.0
- \raw HTML
- k<sub>c</sub>
- \endraw
- \o linearAttenuation() - default 0.0
- \raw HTML
- k<sub>l</sub>
- \endraw
- \o quadraticAttenuation() - default 0.0
- \raw HTML
- k<sub>q</sub>
- \endraw
- \endlist
- When these terms are large the light contributed by the source becomes much weaker
- with distance from the object.
-*/
-
-/*!
- \qmlclass Light QGLLightParameters
- \brief The Light item represents the parameters of a light in a 3D scene.
- \since 4.8
- \ingroup qt3d::qml3d
-
- \sa LightModel
-*/
-
-class QGLLightParametersPrivate
-{
-public:
- QGLLightParametersPrivate() :
- type(QGLLightParameters::Directional),
- position(0.0f, 0.0f, 1.0f),
- ambientColor(0, 0, 0, 255),
- diffuseColor(255, 255, 255, 255),
- specularColor(255, 255, 255, 255),
- spotDirection(0.0f, 0.0f, -1.0f),
- spotExponent(0.0f),
- spotAngle(180.0f),
- spotCosAngle(-1.0f),
- constantAttenuation(1.0f),
- linearAttenuation(0.0f),
- quadraticAttenuation(0.0f)
- {
- }
-
- QGLLightParameters::LightType type;
- QVector3D position;
- QColor ambientColor;
- QColor diffuseColor;
- QColor specularColor;
- QVector3D spotDirection;
- qreal spotExponent;
- qreal spotAngle;
- qreal spotCosAngle;
- qreal constantAttenuation;
- qreal linearAttenuation;
- qreal quadraticAttenuation;
-};
-
-
-/*!
- \enum QGLLightParameters::LightType
- This enum defines the possible types of light.
-
- \value Directional The default. Directional lights are infinitely
- distant from the lit object, and its rays are parallel to a
- direction vector. Use setDirection() to make a light Directional.
- \value Positional Positional lights are a finite distance from the
- lit object. Complex lighting with spot-lights, and attenuation
- are enabled with Positional lighting. Use setPosition() to
- make a light Positional.
-*/
-
-/*!
- Constructs a new light parameters object with default values
- and attaches it to \a parent.
-*/
-QGLLightParameters::QGLLightParameters(QObject *parent)
- : QObject(parent)
- , d_ptr(new QGLLightParametersPrivate)
-{
-}
-
-/*!
- Destroys this light parameters object.
-*/
-QGLLightParameters::~QGLLightParameters()
-{
-}
-
-/*!
- \property QGLLightParameters::type
- \brief the type of this light; Positional or Directional.
-
- \sa position(), direction()
-*/
-
-/*!
- \qmlproperty enumeration Light::type
- The type of this light; Positional or Directional. The default
- is Directional.
-
- \sa position, direction
-*/
-
-QGLLightParameters::LightType QGLLightParameters::type() const
-{
- Q_D(const QGLLightParameters);
- return d->type;
-}
-
-/*!
- \property QGLLightParameters::position
- \brief the position of this light if it is Positional; or a null
- QVector3D if it is Directional. By default, the light is Directional.
-
- For a Positional light, the return value is the location in model space
- of the light, at some finite distance from the origin. The value is
- transformed by the model-view transformation when the light
- parameters are applied.
-
- When the light is Positional OpenGL will obey other parameters relating
- to the light's position, such as attenuation and spot angle.
-
- Setting the position converts the light from Directional to Positional.
-
- \sa direction(), type(), positionChanged()
-*/
-
-/*!
- \qmlproperty vector3D Light::position
- The position of this light if it is Positional; or a zero vector
- if it is Directional. By default, the light is Directional.
-
- For a Positional light, the return value is the location in model space
- of the light, at some finite distance from the origin. The value is
- transformed by the model-view transformation when the light
- parameters are applied.
-
- When the light is Positional OpenGL will obey other parameters relating
- to the light's position, such as attenuation and spot angle.
-
- Setting the position converts the light from Directional to Positional.
-
- \sa direction, type
-*/
-
-QVector3D QGLLightParameters::position() const
-{
- Q_D(const QGLLightParameters);
- if (d->type == Positional)
- return d->position;
- else
- return QVector3D();
-}
-
-void QGLLightParameters::setPosition(const QVector3D& point)
-{
- Q_D(QGLLightParameters);
- if (d->type == Positional) {
- if (d->position != point) {
- // Only the position() has changed.
- d->position = point;
- emit positionChanged();
- emit lightChanged();
- }
- } else {
- // Both the position() and direction() are changed.
- d->type = Positional;
- d->position = point;
- emit positionChanged();
- emit directionChanged();
- emit lightChanged();
- }
-}
-
-/*!
- \property QGLLightParameters::direction
- \brief the direction of this light if it is Directional; or a null
- QVector3D if it is Positional. By default, the light is Directional.
-
- For a Directional light, the return value is the direction vector of
- an infinitely distant directional light, like the sun.
-
- The default value is (0, 0, 1), for a directional light pointing along
- the positive z-axis.
-
- OpenGL will ignore other parameters such as attenuation and spot angle
- when this value is set, since a directional light has no location.
- In order to set the direction of a spot light, use the setSpotDirection()
- function.
-
- Setting the direction converts the light from Positional to Directional.
-
- \sa position(), type(), directionChanged()
-*/
-
-/*!
- \qmlproperty vector3D Light::direction
- The direction of this light if it is Directional; or a zero vector
- if it is Positional. By default, the light is Directional.
-
- For a Directional light, the return value is the direction vector of
- an infinitely distant directional light, like the sun.
-
- The default value is (0, 0, 1), for a directional light pointing along
- the positive z-axis.
-
- OpenGL will ignore other parameters such as attenuation and spot angle
- when this value is set, since a directional light has no location.
- In order to set the direction of a spot light, use the setSpotDirection()
- function.
-
- Setting the direction converts the light from Positional to Directional.
-
- \sa position, type
-*/
-
-QVector3D QGLLightParameters::direction() const
-{
- Q_D(const QGLLightParameters);
- if (d->type == Directional)
- return d->position;
- else
- return QVector3D();
-}
-
-void QGLLightParameters::setDirection(const QVector3D& value)
-{
- Q_D(QGLLightParameters);
- if (d->type == Directional) {
- if (d->position != value) {
- // Only the direction() has changed.
- d->position = value;
- emit directionChanged();
- emit lightChanged();
- }
- } else {
- // Both the position() and direction() are changed.
- d->type = Directional;
- d->position = value;
- emit positionChanged();
- emit directionChanged();
- emit lightChanged();
- }
-}
-
-/*!
- \property QGLLightParameters::ambientColor
- \brief the ambient color of this light. The default value is black.
-
- \sa diffuseColor(), specularColor(), ambientColorChanged()
-*/
-
-/*!
- \qmlproperty color Light::ambientColor
- The ambient color of this light. The default value is black.
-
- \sa diffuseColor, specularColor
-*/
-
-QColor QGLLightParameters::ambientColor() const
-{
- Q_D(const QGLLightParameters);
- return d->ambientColor;
-}
-
-void QGLLightParameters::setAmbientColor(const QColor& value)
-{
- Q_D(QGLLightParameters);
- if (d->ambientColor != value) {
- d->ambientColor = value;
- emit ambientColorChanged();
- emit lightChanged();
- }
-}
-
-/*!
- \property QGLLightParameters::diffuseColor
- \brief the diffuse color of this light. The default value is white.
-
- \sa ambientColor(), specularColor(), diffuseColorChanged()
-*/
-
-/*!
- \qmlproperty color Light::diffuseColor
- The diffuse color of this light. The default value is white.
-
- \sa ambientColor, specularColor
-*/
-QColor QGLLightParameters::diffuseColor() const
-{
- Q_D(const QGLLightParameters);
- return d->diffuseColor;
-}
-
-void QGLLightParameters::setDiffuseColor(const QColor& value)
-{
- Q_D(QGLLightParameters);
- if (d->diffuseColor != value) {
- d->diffuseColor = value;
- emit diffuseColorChanged();
- emit lightChanged();
- }
-}
-
-/*!
- \property QGLLightParameters::specularColor
- \brief the specular color of this light. The default value is white.
-
- \sa ambientColor(), diffuseColor(), specularColorChanged()
-*/
-
-/*!
- \qmlproperty color Light::specularColor
- The specular color of this light. The default value is white.
-
- \sa ambientColor, diffuseColor
-*/
-
-QColor QGLLightParameters::specularColor() const
-{
- Q_D(const QGLLightParameters);
- return d->specularColor;
-}
-
-void QGLLightParameters::setSpecularColor(const QColor& value)
-{
- Q_D(QGLLightParameters);
- if (d->specularColor != value) {
- d->specularColor = value;
- emit specularColorChanged();
- emit lightChanged();
- }
-}
-
-/*!
- \property QGLLightParameters::spotDirection
- \brief the direction that a spot-light is shining in.
-
- A spotlight is a positional light that has a value other than the default
- for spot angle. The default value is (0, 0, -1).
-
- This parameter has no effect on a Directional light.
-
- \sa spotExponent(), spotDirectionChanged()
-*/
-
-/*!
- \qmlproperty vector3D Light::spotDirection
- The direction that a spot-light is shining in.
-
- A spotlight is a positional light that has a value other than the default
- for spot angle. The default value is (0, 0, -1).
-
- This parameter has no effect on a Directional light.
-
- \sa spotExponent
-*/
-QVector3D QGLLightParameters::spotDirection() const
-{
- Q_D(const QGLLightParameters);
- return d->spotDirection;
-}
-
-void QGLLightParameters::setSpotDirection(const QVector3D& vector)
-{
- Q_D(QGLLightParameters);
- if (d->spotDirection != vector) {
- d->spotDirection = vector;
- emit spotDirectionChanged();
- emit lightChanged();
- }
-}
-
-/*!
- \property QGLLightParameters::spotExponent
- \brief the exponent value between 0 and 128 that indicates the
- intensity distribution of a spot-light. The default value is 0,
- indicating uniform light distribution.
-
- This parameter has no effect on a Directional light.
-
- \sa spotAngle(), setPosition(), spotExponentChanged()
-*/
-
-/*!
- \qmlproperty real Light::spotExponent
- The exponent value between 0 and 128 that indicates the
- intensity distribution of a spot-light. The default value is 0,
- indicating uniform light distribution.
-
- This parameter has no effect on a Directional light.
-
- \sa spotAngle, position
-*/
-
-qreal QGLLightParameters::spotExponent() const
-{
- Q_D(const QGLLightParameters);
- return d->spotExponent;
-}
-
-void QGLLightParameters::setSpotExponent(qreal value)
-{
- Q_D(QGLLightParameters);
- if (d->spotExponent != value) {
- d->spotExponent = value;
- emit spotExponentChanged();
- emit lightChanged();
- }
-}
-
-/*!
- \property QGLLightParameters::spotAngle
- \brief the angle over which light is spread from this light.
- It should be between 0 and 90 for spot lights, and 180 for
- uniform light distribution from a remote light source.
- The default value is 180.
-
- This parameter has no effect on a Directional light.
-
- \sa spotCosAngle(), spotAngleChanged()
-*/
-
-/*!
- \qmlproperty real Light::spotAngle
- The angle over which light is spread from this light.
- It should be between 0 and 90 for spot lights, and 180 for
- uniform light distribution from a remote light source.
- The default value is 180.
-
- This parameter has no effect on a Directional light.
-*/
-
-qreal QGLLightParameters::spotAngle() const
-{
- Q_D(const QGLLightParameters);
- return d->spotAngle;
-}
-
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-
-void QGLLightParameters::setSpotAngle(qreal value)
-{
- Q_D(QGLLightParameters);
- if (d->spotAngle != value) {
- d->spotAngle = value;
- if (value != 180.0f)
- d->spotCosAngle = qCos(value * M_PI / 180.0f);
- else
- d->spotCosAngle = -1.0f;
- emit spotAngleChanged();
- emit lightChanged();
- }
-}
-
-/*!
- Returns the cosine of spotAngle(), or -1 if spotAngle() is 180.
-
- The cosine of spotAngle() is useful in lighting algorithms.
- This function returns a cached copy of the cosine so that it
- does not need to be computed every time the lighting parameters
- are read.
-
- \sa spotAngle()
-*/
-qreal QGLLightParameters::spotCosAngle() const
-{
- Q_D(const QGLLightParameters);
- return d->spotCosAngle;
-}
-
-/*!
- \property QGLLightParameters::constantAttenuation
- \brief the constant light attenuation factor. The default value is 1.
-
- This parameter has no effect on a Directional light.
-
- \sa linearAttenuation(), quadraticAttenuation()
- \sa constantAttenuationChanged()
-*/
-
-/*!
- \qmlproperty real Light::constantAttenuation
- The constant light attenuation factor. The default value is 1.
-
- This parameter has no effect on a Directional light.
-
- \sa linearAttenuation, quadraticAttenuation
-*/
-
-qreal QGLLightParameters::constantAttenuation() const
-{
- Q_D(const QGLLightParameters);
- return d->constantAttenuation;
-}
-
-void QGLLightParameters::setConstantAttenuation(qreal value)
-{
- Q_D(QGLLightParameters);
- if (d->constantAttenuation != value) {
- d->constantAttenuation = value;
- emit constantAttenuationChanged();
- emit lightChanged();
- }
-}
-
-/*!
- \property QGLLightParameters::linearAttenuation
- \brief the linear light attenuation factor. The default value is 0.
-
- This parameter has no effect on a Directional light.
-
- \sa constantAttenuation(), quadraticAttenuation()
- \sa linearAttenuationChanged()
-*/
-
-/*!
- \qmlproperty real Light::linearAttenuation
- The linear light attenuation factor. The default value is 0.
-
- This parameter has no effect on a Directional light.
-
- \sa constantAttenuation, quadraticAttenuation
-*/
-
-qreal QGLLightParameters::linearAttenuation() const
-{
- Q_D(const QGLLightParameters);
- return d->linearAttenuation;
-}
-
-void QGLLightParameters::setLinearAttenuation(qreal value)
-{
- Q_D(QGLLightParameters);
- if (d->linearAttenuation != value) {
- d->linearAttenuation = value;
- emit linearAttenuationChanged();
- emit lightChanged();
- }
-}
-
-/*!
- \property QGLLightParameters::quadraticAttenuation
- \brief the quadratic light attenuation factor. The default value is 0.
-
- This parameter has no effect on a Directional light.
-
- \sa constantAttenuation(), linearAttenuation()
- \sa quadraticAttenuationChanged()
-*/
-
-/*!
- \qmlproperty real Light::quadraticAttenuation
- The quadratic light attenuation factor. The default value is 0.
-
- This parameter has no effect on a Directional light.
-
- \sa constantAttenuation, linearAttenuation
-*/
-
-qreal QGLLightParameters::quadraticAttenuation() const
-{
- Q_D(const QGLLightParameters);
- return d->quadraticAttenuation;
-}
-
-void QGLLightParameters::setQuadraticAttenuation(qreal value)
-{
- Q_D(QGLLightParameters);
- if (d->quadraticAttenuation != value) {
- d->quadraticAttenuation = value;
- emit quadraticAttenuationChanged();
- emit lightChanged();
- }
-}
-
-/*!
- Returns the position of this light after transforming it from
- world co-ordinates to eye co-ordinates using \a transform.
-
- If the light is Directional, then direction() will be transformed,
- after setting the w co-ordinate to 0. If the light is Positional,
- then position() will be transformed after setting the w co-ordinate
- to 1.
-
- The returned result is suitable to be applied to the GL_POSITION
- property of \c{glLight()}, assuming that the modelview transformation
- in the GL context is set to the identity.
-
- \sa eyeSpotDirection()
-*/
-QVector4D QGLLightParameters::eyePosition(const QMatrix4x4& transform) const
-{
- Q_D(const QGLLightParameters);
- if (d->type == Directional)
- return transform * QVector4D(d->position, 0.0f);
- else
- return transform * QVector4D(d->position, 1.0f);
-}
-
-/*!
- Returns the spotDirection() for this light after transforming it
- from world co-ordinates to eye co-ordinates using the top-left
- 3x3 submatrix within \a transform.
-
- The returned result is suitable to be applied to the GL_SPOT_DIRECTION
- property of \c{glLight()}, assuming that the modelview transformation
- in the GL context is set to the identity.
-
- \sa eyePosition()
-*/
-QVector3D QGLLightParameters::eyeSpotDirection
- (const QMatrix4x4& transform) const
-{
- Q_D(const QGLLightParameters);
- return transform.mapVector(d->spotDirection);
-}
-
-/*!
- \fn void QGLLightParameters::positionChanged()
-
- This signal is emitted when position() changes, or when the type()
- changes between Directional and Positional.
-
- \sa position(), lightChanged()
-*/
-
-/*!
- \fn void QGLLightParameters::directionChanged()
-
- This signal is emitted when direction() changes, or when the type()
- changes between Directional and Positional.
-
- \sa direction(), lightChanged()
-*/
-
-/*!
- \fn void QGLLightParameters::ambientColorChanged()
-
- This signal is emitted when ambientColor() changes.
-
- \sa ambientColor(), lightChanged()
-*/
-
-/*!
- \fn void QGLLightParameters::diffuseColorChanged()
-
- This signal is emitted when diffuseColor() changes.
-
- \sa diffuseColor(), lightChanged()
-*/
-
-/*!
- \fn void QGLLightParameters::specularColorChanged()
-
- This signal is emitted when specularColor() changes.
-
- \sa specularColor(), lightChanged()
-*/
-
-/*!
- \fn void QGLLightParameters::spotDirectionChanged()
-
- This signal is emitted when spotDirection() changes.
-
- \sa spotDirection(), lightChanged()
-*/
-
-/*!
- \fn void QGLLightParameters::spotExponentChanged()
-
- This signal is emitted when spotExponent() changes.
-
- \sa spotExponent(), lightChanged()
-*/
-
-/*!
- \fn void QGLLightParameters::spotAngleChanged()
-
- This signal is emitted when spotAngle() changes.
-
- \sa spotAngle(), lightChanged()
-*/
-
-/*!
- \fn void QGLLightParameters::constantAttenuationChanged()
-
- This signal is emitted when constantAttenuation() changes.
-
- \sa constantAttenuation(), lightChanged()
-*/
-
-/*!
- \fn void QGLLightParameters::linearAttenuationChanged()
-
- This signal is emitted when linearAttenuation() changes.
-
- \sa linearAttenuation(), lightChanged()
-*/
-
-/*!
- \fn void QGLLightParameters::quadraticAttenuationChanged()
-
- This signal is emitted when quadraticAttenuation() changes.
-
- \sa quadraticAttenuation(), lightChanged()
-*/
-
-/*!
- \fn void QGLLightParameters::lightChanged()
-
- This signal is emitted when any of the properties on the light changes.
-*/
-
-QT_END_NAMESPACE
diff --git a/src/threed/painting/qgllightparameters.h b/src/threed/painting/qgllightparameters.h
deleted file mode 100644
index a2f3a709..00000000
--- a/src/threed/painting/qgllightparameters.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 QGLLIGHTPARAMETERS_H
-#define QGLLIGHTPARAMETERS_H
-
-#include "qt3dglobal.h"
-#include <QtCore/qobject.h>
-#include <QtGui/qcolor.h>
-#include <QtGui/qvector3d.h>
-#include <QtGui/qvector4d.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class QGLLightParametersPrivate;
-class QMatrix4x4;
-
-class Q_QT3D_EXPORT QGLLightParameters : public QObject
-{
- Q_OBJECT
- Q_DECLARE_PRIVATE(QGLLightParameters)
- Q_ENUMS(LightType)
- Q_PROPERTY(LightType type READ type)
- Q_PROPERTY(QVector3D position READ position WRITE setPosition NOTIFY positionChanged)
- Q_PROPERTY(QVector3D direction READ direction WRITE setDirection NOTIFY directionChanged)
- Q_PROPERTY(QColor ambientColor READ ambientColor WRITE setAmbientColor NOTIFY ambientColorChanged)
- Q_PROPERTY(QColor diffuseColor READ diffuseColor WRITE setDiffuseColor NOTIFY diffuseColorChanged)
- Q_PROPERTY(QColor specularColor READ specularColor WRITE setSpecularColor NOTIFY specularColorChanged)
- Q_PROPERTY(QVector3D spotDirection READ spotDirection WRITE setSpotDirection NOTIFY spotDirectionChanged)
- Q_PROPERTY(qreal spotExponent READ spotExponent WRITE setSpotExponent NOTIFY spotExponentChanged)
- Q_PROPERTY(qreal spotAngle READ spotAngle WRITE setSpotAngle NOTIFY spotAngleChanged)
- Q_PROPERTY(qreal constantAttenuation READ constantAttenuation WRITE setConstantAttenuation NOTIFY constantAttenuationChanged)
- Q_PROPERTY(qreal linearAttenuation READ linearAttenuation WRITE setLinearAttenuation NOTIFY linearAttenuationChanged)
- Q_PROPERTY(qreal quadraticAttenuation READ quadraticAttenuation WRITE setQuadraticAttenuation NOTIFY quadraticAttenuationChanged)
-public:
- enum LightType {
- Directional,
- Positional
- };
-
- QGLLightParameters(QObject *parent = 0);
- ~QGLLightParameters();
-
- QGLLightParameters::LightType type() const;
-
- QVector3D position() const;
- void setPosition(const QVector3D& value);
-
- QVector3D direction() const;
- void setDirection(const QVector3D& value);
-
- QColor ambientColor() const;
- void setAmbientColor(const QColor& value);
-
- QColor diffuseColor() const;
- void setDiffuseColor(const QColor& value);
-
- QColor specularColor() const;
- void setSpecularColor(const QColor& value);
-
- QVector3D spotDirection() const;
- void setSpotDirection(const QVector3D& value);
-
- qreal spotExponent() const;
- void setSpotExponent(qreal value);
-
- qreal spotAngle() const;
- void setSpotAngle(qreal value);
-
- qreal spotCosAngle() const;
-
- qreal constantAttenuation() const;
- void setConstantAttenuation(qreal value);
-
- qreal linearAttenuation() const;
- void setLinearAttenuation(qreal value);
-
- qreal quadraticAttenuation() const;
- void setQuadraticAttenuation(qreal value);
-
- QVector4D eyePosition(const QMatrix4x4& transform) const;
- QVector3D eyeSpotDirection(const QMatrix4x4& transform) const;
-
-Q_SIGNALS:
- void positionChanged();
- void directionChanged();
- void ambientColorChanged();
- void diffuseColorChanged();
- void specularColorChanged();
- void spotDirectionChanged();
- void spotExponentChanged();
- void spotAngleChanged();
- void constantAttenuationChanged();
- void linearAttenuationChanged();
- void quadraticAttenuationChanged();
- void lightChanged();
-
-private:
- Q_DISABLE_COPY(QGLLightParameters)
-
- QScopedPointer<QGLLightParametersPrivate> d_ptr;
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/painting/qglpainter.cpp b/src/threed/painting/qglpainter.cpp
deleted file mode 100644
index 3bf211cd..00000000
--- a/src/threed/painting/qglpainter.cpp
+++ /dev/null
@@ -1,2327 +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 "qglpainter.h"
-#include "qglpainter_p.h"
-#include "qglabstracteffect.h"
-#include "qglext_p.h"
-#include <QtOpenGL/qglpixelbuffer.h>
-#include <QtOpenGL/qglshaderprogram.h>
-#include <QtOpenGL/qglframebufferobject.h>
-#include <QtGui/qpainter.h>
-#include <QtGui/qpaintengine.h>
-#include <QtCore/qvarlengtharray.h>
-#include <QtCore/qmap.h>
-#if !defined(QT_NO_THREAD)
-#include <QtCore/qthreadstorage.h>
-#endif
-#include "qglflatcoloreffect_p.h"
-#include "qglflattextureeffect_p.h"
-#include "qgllitmaterialeffect_p.h"
-#include "qgllittextureeffect_p.h"
-#include "qglpickcolors_p.h"
-#include "qgltexture2d.h"
-#include "qgltexturecube.h"
-#include "qgeometrydata.h"
-#include "qglvertexbundle_p.h"
-#include "qmatrix4x4stack_p.h"
-#include "qglwidgetsurface.h"
-#include "qglpixelbuffersurface.h"
-#include "qglpaintersurface_p.h"
-
-#undef glActiveTexture
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGLPainter
- \brief The QGLPainter class provides portable API's for rendering into a GL context.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::painting
-
- TBD - lots of TBD
-
- All QGLPainter instances on a context share the same context state:
- matrices, effects, vertex attributes, etc. For example, calling
- ortho() on one QGLPainter instance for a context will alter the
- projectionMatrix() as seen by the other QGLPainter instances.
-*/
-
-/*!
- \enum QGLPainter::Update
- This enum defines the values that were changed since the last QGLPainter::update().
-
- \value UpdateColor The color has been updated.
- \value UpdateModelViewMatrix The modelview matrix has been updated.
- \value UpdateProjectionMatrix The projection matrix has been updated.
- \value UpdateMatrices The combination of UpdateModelViewMatrix and
- UpdateProjectionMatrix.
- \value UpdateLights The lights have been updated.
- \value UpdateMaterials The material parameters have been updated.
- \value UpdateViewport The viewport needs to be updated because the
- drawing surface has changed.
- \value UpdateAll All values have been updated. This is specified
- when an effect is activated.
-*/
-
-#define QGLPAINTER_CHECK_PRIVATE() \
- Q_ASSERT_X(d, "QGLPainter", "begin() has not been called or it failed")
-
-QGLPainterPrivate::QGLPainterPrivate()
- : ref(1),
- eye(QGL::NoEye),
- lightModel(0),
- defaultLightModel(0),
- defaultLight(0),
- frontMaterial(0),
- backMaterial(0),
- defaultMaterial(0),
- frontColorMaterial(0),
- backColorMaterial(0),
- viewingCube(QVector3D(-1, -1, -1), QVector3D(1, 1, 1)),
- color(255, 255, 255, 255),
- updates(QGLPainter::UpdateAll),
- pick(0),
- boundVertexBuffer(0),
- boundIndexBuffer(0),
- renderSequencer(0),
- isFixedFunction(true) // Updated by QGLPainter::begin()
-{
- context = 0;
- effect = 0;
- userEffect = 0;
- standardEffect = QGL::FlatColor;
- memset(stdeffects, 0, sizeof(stdeffects));
-}
-
-QGLPainterPrivate::~QGLPainterPrivate()
-{
- delete defaultLightModel;
- delete defaultLight;
- delete defaultMaterial;
- delete frontColorMaterial;
- delete backColorMaterial;
- for (int effect = 0; effect < QGL_MAX_STD_EFFECTS; ++effect)
- delete stdeffects[effect];
- delete pick;
- qDeleteAll(cachedPrograms);
- delete renderSequencer;
-}
-
-QGLPainterPickPrivate::QGLPainterPickPrivate()
-{
- isPicking = false;
- objectPickId = -1;
- pickColorIndex = -1;
- pickColor = 0;
- defaultPickEffect = new QGLFlatColorEffect();
-}
-
-QGLPainterPickPrivate::~QGLPainterPickPrivate()
-{
- delete defaultPickEffect;
-}
-
-#if !defined(QT_NO_THREAD)
-
-// QGLContext's are thread-specific, so QGLPainterPrivateCache should be too.
-
-typedef QThreadStorage<QGLPainterPrivateCache *> QGLPainterPrivateStorage;
-Q_GLOBAL_STATIC(QGLPainterPrivateStorage, painterPrivateStorage)
-static QGLPainterPrivateCache *painterPrivateCache()
-{
- QGLPainterPrivateCache *cache = painterPrivateStorage()->localData();
- if (!cache) {
- cache = new QGLPainterPrivateCache();
- painterPrivateStorage()->setLocalData(cache);
- }
- return cache;
-}
-
-#else
-
-Q_GLOBAL_STATIC(QGLPainterPrivateCache, painterPrivateCache)
-
-#endif
-
-QGLPainterPrivateCache::QGLPainterPrivateCache()
-{
- connect(QGLSignalProxy::instance(),
- SIGNAL(aboutToDestroyContext(const QGLContext *)),
- this,
- SLOT(contextDestroyed(const QGLContext *)));
-}
-
-QGLPainterPrivateCache::~QGLPainterPrivateCache()
-{
-}
-
-QGLPainterPrivate *QGLPainterPrivateCache::fromContext
- (const QGLContext *context)
-{
- QGLPainterPrivate *priv = cache.value(context, 0);
- if (priv)
- return priv;
- priv = new QGLPainterPrivate();
- priv->context = context;
- cache.insert(context, priv);
- return priv;
-}
-
-QGLPainterPrivateCache *QGLPainterPrivateCache::instance()
-{
- return painterPrivateCache();
-}
-
-void QGLPainterPrivateCache::contextDestroyed(const QGLContext *context)
-{
- QGLPainterPrivate *priv = cache.value(context, 0);
- if (priv) {
- priv->context = 0;
- cache.remove(context);
- if (!priv->ref.deref())
- delete priv;
- }
- emit destroyedContext(context);
-}
-
-/*!
- Constructs a new GL painter. Call begin() to attach the
- painter to a GL context.
-
- \sa begin()
-*/
-QGLPainter::QGLPainter()
- : d_ptr(0)
-{
-}
-
-/*!
- Constructs a new GL painter and attaches it to \a context.
- It is not necessary to call begin() after construction.
-
- \sa begin()
-*/
-QGLPainter::QGLPainter(const QGLContext *context)
- : d_ptr(0)
-{
- begin(context);
-}
-
-/*!
- Constructs a new GL painter and attaches it to the GL
- context associated with \a widget. It is not necessary to
- call begin() after construction.
-
- \sa begin(), isActive()
-*/
-QGLPainter::QGLPainter(QGLWidget *widget)
- : d_ptr(0)
-{
- begin(widget);
-}
-
-/*!
- Constructs a new GL painter and attaches it to the GL context associated
- with \a painter. It is assumed that \a painter is the currently
- active painter and that it is associated with the current GL context.
-
- If \a painter is not using an OpenGL paint engine, then isActive()
- will return false; true otherwise.
-
- This constructor is typically used when mixing regular Qt painting
- operations and GL painting operations on a widget that is being
- drawn using the OpenGL graphics system.
-
- \sa begin(), isActive()
-*/
-QGLPainter::QGLPainter(QPainter *painter)
- : d_ptr(0)
-{
- begin(painter);
-}
-
-/*!
- Constructs a new GL painter and attaches it to the GL context associated
- with \a surface.
-
- \sa begin(), isActive()
-*/
-QGLPainter::QGLPainter(QGLAbstractSurface *surface)
- : d_ptr(0)
-{
- begin(surface);
-}
-
-/*!
- Destroys this GL painter.
-*/
-QGLPainter::~QGLPainter()
-{
- end();
-}
-
-/*!
- Begins painting on QGLContext::currentContext(). Returns false
- if there is no GL context current.
-
- \sa end()
-*/
-bool QGLPainter::begin()
-{
- return begin(QGLContext::currentContext());
-}
-
-/*!
- Begins painting on \a context. If painting was already in progress,
- then this function will call end() first. The \a context will be
- made current if it is not already current.
-
- Returns true if painting can begin; false otherwise.
-
- All QGLPainter instances on a context share the same context state:
- matrices, the effect(), vertex attributes, etc. For example,
- calling ortho() on one QGLPainter instance for a context will
- alter the projectionMatrix() as seen by the other QGLPainter instances.
-
- \sa end(), isActive()
-*/
-bool QGLPainter::begin(const QGLContext *context)
-{
- if (!context)
- return false;
- end();
- return begin(context, QGLAbstractSurface::createSurfaceForContext(context));
-}
-
-/*!
- \internal
-*/
-bool QGLPainter::begin
- (const QGLContext *context, QGLAbstractSurface *surface,
- bool destroySurface)
-{
- // If we don't have a context specified, then use the one
- // that the surface just made current.
- if (!context)
- context = QGLContext::currentContext();
-
- // Find the QGLPainterPrivate for the context, or create a new one.
- d_ptr = painterPrivateCache()->fromContext(context);
- d_ptr->ref.ref();
- if (d_ptr->renderSequencer)
- {
- d_ptr->renderSequencer->reset();
- d_ptr->renderSequencer->setPainter(this);
- }
-
- // Activate the main surface for the context.
- QGLAbstractSurface *prevSurface;
- if (d_ptr->surfaceStack.isEmpty()) {
- prevSurface = 0;
- } else {
- // We are starting a nested begin()/end() scope, so switch
- // to the new main surface rather than activate from scratch.
- prevSurface = d_ptr->surfaceStack.last().surface;
- prevSurface->deactivate(surface);
- }
- if (!surface->activate(prevSurface)) {
- if (prevSurface)
- prevSurface->activate(surface);
- if (destroySurface)
- delete surface;
- if (!d_ptr->ref.deref())
- delete d_ptr;
- d_ptr = 0;
- return false;
- }
-
- // Push a main surface descriptor onto the surface stack.
- QGLPainterSurfaceInfo psurf;
- psurf.surface = surface;
- psurf.destroySurface = destroySurface;
- psurf.mainSurface = true;
- d_ptr->surfaceStack.append(psurf);
-
- // Force the matrices to be updated the first time we use them.
- d_ptr->modelViewMatrix.setDirty(true);
- d_ptr->projectionMatrix.setDirty(true);
-
- // Initialize the QOpenGLFunctions parent class.
- initializeGLFunctions(context);
-
- // Determine if the OpenGL implementation is fixed-function or not.
- d_ptr->isFixedFunction = !hasOpenGLFeature(QOpenGLFunctions::Shaders);
- return true;
-}
-
-/*!
- Begins painting on the GL context associated with \a widget.
- Returns false if \a widget is null.
-
- \sa end()
-*/
-bool QGLPainter::begin(QGLWidget *widget)
-{
- if (!widget)
- return false;
- end();
- return begin(widget->context(), new QGLWidgetSurface(widget));
-}
-
-/*!
- Begins painting on the GL context associated with \a painter.
- Returns false if \a painter is not using an OpenGL paint engine.
- It is assumed that \a painter is the currently active painter
- and that it is associated with the current GL context.
-
- This function is typically used when mixing regular Qt painting
- operations and GL painting operations on a widget that is being
- drawn using the OpenGL graphics system.
-
- \sa end()
-*/
-bool QGLPainter::begin(QPainter *painter)
-{
- // Validate that the painting is OpenGL-based.
- if (!painter)
- return false;
- QPaintEngine *engine = painter->paintEngine();
- if (!engine)
- return false;
- if (engine->type() != QPaintEngine::OpenGL &&
- engine->type() != QPaintEngine::OpenGL2)
- return false;
-
- // Begin GL painting operations.
- return begin(0, new QGLPainterSurface(painter));
-}
-
-/*!
- Begins painting to \a surface. Returns false if \a surface is
- null or could not be activated.
-
- \sa end(), QGLAbstractSurface::activate()
-*/
-bool QGLPainter::begin(QGLAbstractSurface *surface)
-{
- if (!surface)
- return false;
- end();
- return begin(0, surface, false);
-}
-
-/*!
- Ends GL painting. Returns true if painting was ended successfully;
- false if this painter was not bound to a GL context.
-
- The GL context that was bound to this painter will not have
- QGLContext::doneCurrent() called on it. It is the responsibility
- of the caller to terminate context operations.
-
- The effect() will be left active in the GL context and will be
- assumed to still be active the next time begin() is called.
- If this assumption doesn't apply, then call disableEffect()
- to disable the effect before calling end().
-
- This function will pop all surfaces from the surface stack,
- and return currentSurface() to null (the default drawing surface).
-
- \sa begin(), isActive(), disableEffect()
-*/
-bool QGLPainter::end()
-{
- Q_D(QGLPainter);
- if (!d)
- return false;
-
- // Unbind the current vertex and index buffers.
- if (d->boundVertexBuffer) {
- QGLBuffer::release(QGLBuffer::VertexBuffer);
- d->boundVertexBuffer = 0;
- }
- if (d->boundIndexBuffer) {
- QGLBuffer::release(QGLBuffer::IndexBuffer);
- d->boundIndexBuffer = 0;
- }
-
- // Pop surfaces from the surface stack until we reach a
- // main surface. Then deactivate the main surface.
- int size = d->surfaceStack.size();
- while (size > 0) {
- --size;
- QGLPainterSurfaceInfo &surf = d->surfaceStack[size];
- if (surf.mainSurface) {
- if (size > 0) {
- // There are still other surfaces on the stack, probably
- // because we are within a nested begin()/end() scope.
- // Re-activate the next surface down in the outer scope.
- QGLPainterSurfaceInfo &nextSurf = d->surfaceStack[size - 1];
- surf.surface->switchTo(nextSurf.surface);
- } else {
- // Last surface on the stack, so deactivate it permanently.
- surf.surface->deactivate();
- }
- if (surf.destroySurface)
- delete surf.surface;
- break;
- } else if (size > 0) {
- surf.surface->deactivate(d->surfaceStack[size - 1].surface);
- }
- }
- d->surfaceStack.resize(size);
-
- // Force a viewport update if we are within a nested begin()/end().
- d->updates |= UpdateViewport;
-
- // Destroy the QGLPainterPrivate if this is the last reference.
- if (!d->ref.deref())
- delete d;
- d_ptr = 0;
- return true;
-}
-
-/*!
- Returns true if this painter is currently bound to a GL context;
- false otherwise.
-
- \sa begin(), end()
-*/
-bool QGLPainter::isActive() const
-{
- return (d_ptr != 0 && d_ptr->context != 0);
-}
-
-/*!
- Returns the GL context that is bound to this painter, or null
- if it is not currently bound.
-*/
-const QGLContext *QGLPainter::context() const
-{
- if (d_ptr)
- return d_ptr->context;
- else
- return 0;
-}
-
-/*!
- Returns true if the underlying OpenGL implementation is OpenGL 1.x
- or OpenGL/ES 1.x and only supports fixed-function OpenGL operations.
- Returns false if the underlying OpenGL implementation is using
- GLSL or GLSL/ES shaders.
-
- If this function returns false, then the built-in effects will
- use shaders and QGLPainter will not update the fixed-function
- matrices in the OpenGL context when update() is called.
- User-supplied effects will need to use shaders also or update
- the fixed-function matrices themselves or call updateFixedFunction().
-
- \sa update(), updateFixedFunction()
-*/
-bool QGLPainter::isFixedFunction() const
-{
-#if defined(QT_OPENGL_ES_2)
- return false;
-#else
- Q_D(const QGLPainter);
- if (d)
- return d->isFixedFunction;
- else
- return true;
-#endif
-}
-
-/*!
- Sets the \a color to use to clear the color buffer when \c{glClear()}
- is called.
-*/
-void QGLPainter::setClearColor(const QColor& color)
-{
- glClearColor(color.redF(), color.greenF(), color.blueF(), color.alphaF());
-}
-
-/*!
- Sets the scissor \a rect for the current drawing surface
- to use when \c{GL_SCISSOR_TEST} is enabled. If \a rect is empty,
- then the scissor will be set to clip away all drawing.
-
- Note that \a rect is in Qt co-ordinates with the origin
- at the top-left of the drawing surface's viewport rectangle.
- If the currentSurface() is an instance of QGLSubsurface,
- then \a rect will be adjusted relative to the subsurface's position.
-
- \sa currentSurface(), QGLAbstractSurface::viewportGL()
-*/
-void QGLPainter::setScissor(const QRect& rect)
-{
- if (!rect.isEmpty()) {
- // Adjust the rectangle by the position of the surface viewport.
- QGLAbstractSurface *surface = currentSurface();
- QRect viewport = surface->viewportGL();
- QRect r(viewport.x() + rect.x(),
- viewport.y() + viewport.height() - (rect.y() + rect.height()),
- rect.width(), rect.height());
- if (!r.isEmpty())
- glScissor(r.x(), r.y(), r.width(), r.height());
- else
- glScissor(0, 0, 0, 0);
- } else {
- glScissor(0, 0, 0, 0);
- }
-}
-
-/*!
- Returns a reference to the projection matrix stack.
-
- It is recommended that setCamera() be used to set the projection
- matrix at the beginning of a scene rendering pass so that the
- eye position can be adjusted for stereo.
-
- \sa modelViewMatrix(), combinedMatrix(), setCamera()
-*/
-QMatrix4x4Stack& QGLPainter::projectionMatrix()
-{
- Q_D(QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- return d->projectionMatrix;
-}
-
-/*!
- Returns a reference to the modelview matrix stack.
-
- \sa projectionMatrix(), combinedMatrix(), normalMatrix(), setCamera()
- \sa worldMatrix()
-*/
-QMatrix4x4Stack& QGLPainter::modelViewMatrix()
-{
- Q_D(QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- return d->modelViewMatrix;
-}
-
-/*!
- \fn QMatrix4x4 QGLPainter::combinedMatrix() const
-
- Returns the result of multiplying the projectionMatrix()
- and the modelViewMatrix(). This combined matrix value is
- useful for setting uniform matrix values on shader programs.
-
- Calling this function is more efficient than calling
- projectionMatrix() and modelViewMatrix() separately and
- multiplying the return values.
-
- \sa projectionMatrix(), modelViewMatrix(), normalMatrix()
-*/
-QMatrix4x4 QGLPainter::combinedMatrix() const
-{
- const QGLPainterPrivate *d = d_func();
- if (!d)
- return QMatrix4x4();
- const QMatrix4x4StackPrivate *proj = d->projectionMatrix.d_func();
- const QMatrix4x4StackPrivate *mv = d->modelViewMatrix.d_func();
- return proj->matrix * mv->matrix;
-}
-
-// Inverting the eye transformation will often result in values like
-// 1.5e-15 in the world matrix. Clamp these to zero to make worldMatrix()
-// more stable when removing the eye component of the modelViewMatrix().
-static inline qreal qt_gl_stablize_value(qreal value)
-{
- return (qAbs(value) >= 0.00001f) ? value : 0.0f;
-}
-static inline QMatrix4x4 qt_gl_stablize_matrix(const QMatrix4x4 &m)
-{
- return QMatrix4x4(qt_gl_stablize_value(m(0, 0)),
- qt_gl_stablize_value(m(0, 1)),
- qt_gl_stablize_value(m(0, 2)),
- qt_gl_stablize_value(m(0, 3)),
- qt_gl_stablize_value(m(1, 0)),
- qt_gl_stablize_value(m(1, 1)),
- qt_gl_stablize_value(m(1, 2)),
- qt_gl_stablize_value(m(1, 3)),
- qt_gl_stablize_value(m(2, 0)),
- qt_gl_stablize_value(m(2, 1)),
- qt_gl_stablize_value(m(2, 2)),
- qt_gl_stablize_value(m(2, 3)),
- qt_gl_stablize_value(m(3, 0)),
- qt_gl_stablize_value(m(3, 1)),
- qt_gl_stablize_value(m(3, 2)),
- qt_gl_stablize_value(m(3, 3)));
-}
-
-/*!
- Returns the world matrix, which is the modelViewMatrix() without
- the eye transformation that was set in the previous call to
- setCamera().
-
- In the following example, the \c{world} variable will be set to the
- translation and scale component of the modelview transformation,
- without the "look at" component from the camera:
-
- \code
- painter.setCamera(camera);
- painter.modelViewMatrix().translate(0.0f, 5.0f, 0.0f);
- painter.modelViewMatrix().scale(1.5f);
- QMatrix4x4 world = painter.worldMatrix();
- \endcode
-
- Note: the world matrix is determined by multiplying the inverse of
- the camera's look at component with the current modelview matrix.
- Thus, the result may not be precisely the same as constructing a
- matrix from translate and scale operations starting with the identity.
-
- \sa modelViewMatrix(), setCamera()
-*/
-QMatrix4x4 QGLPainter::worldMatrix() const
-{
- Q_D(const QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- return qt_gl_stablize_matrix
- (d->inverseEyeMatrix * d->modelViewMatrix.top());
-}
-
-/*!
- \fn QMatrix3x3 QGLPainter::normalMatrix() const
-
- Returns the normal matrix corresponding to modelViewMatrix().
-
- The normal matrix is the transpose of the inverse of the top-left
- 3x3 part of the 4x4 modelview matrix. If the 3x3 sub-matrix is not
- invertible, this function returns the identity.
-
- \sa modelViewMatrix(), combinedMatrix()
-*/
-QMatrix3x3 QGLPainter::normalMatrix() const
-{
- const QGLPainterPrivate *d = d_func();
- if (!d)
- return QMatrix3x3();
- const QMatrix4x4StackPrivate *mv = d->modelViewMatrix.d_func();
- return mv->matrix.normalMatrix();
-}
-
-/*!
- Returns the camera eye that is currently being used for stereo
- rendering. The default is QGL::NoEye.
-
- The eye is used to adjust the camera position by a small amount
- when setCamera() is called.
-
- \sa setEye(), setCamera()
-*/
-QGL::Eye QGLPainter::eye() const
-{
- Q_D(const QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- return d->eye;
-}
-
-/*!
- Sets the camera \a eye that is currently being used for stereo
- rendering.
-
- The \a eye is used to adjust the camera position by a small amount
- when setCamera() is called.
-
- \sa eye(), setCamera()
-*/
-void QGLPainter::setEye(QGL::Eye eye)
-{
- Q_D(QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- d->eye = eye;
-}
-
-/*!
- Sets the modelViewMatrix() and projectionMatrix() to the view
- defined by \a camera. If eye() is not QGL::NoEye, then the view
- will be adjusted for the camera's eye separation.
-
- This function is typically called at the beginning of a scene rendering
- pass to initialize the modelview and projection matrices.
-
- \sa eye(), modelViewMatrix(), projectionMatrix(), worldMatrix()
-*/
-void QGLPainter::setCamera(const QGLCamera *camera)
-{
- Q_ASSERT(camera);
- Q_D(QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- QMatrix4x4 lookAt = camera->modelViewMatrix(d->eye);
- d->modelViewMatrix = lookAt;
- d->projectionMatrix = camera->projectionMatrix(aspectRatio());
- d->inverseEyeMatrix = lookAt.inverted();
-}
-
-/*!
- Returns true if \a point is outside the current viewing volume.
- This is used to perform object culling checks.
-*/
-bool QGLPainter::isCullable(const QVector3D& point) const
-{
- Q_D(const QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- QVector3D projected = d->modelViewMatrix * point;
- projected = d->projectionMatrix * projected;
- return !d->viewingCube.contains(projected);
-}
-
-static inline uint outcode(const QVector4D &v)
-{
- // For a discussion of outcodes see pg 388 Dunn & Parberry.
- // For why you can't just test if the point is in a bounding box
- // consider the case where a view frustum with view-size 1.5 x 1.5
- // is tested against a 2x2 box which encloses the near-plane, while
- // all the points in the box are outside the frustum.
- // TODO: optimise this with assembler - according to D&P this can
- // be done in one line of assembler on some platforms
- uint code = 0;
- if (v.x() < -v.w()) code |= 0x01;
- if (v.x() > v.w()) code |= 0x02;
- if (v.y() < -v.w()) code |= 0x04;
- if (v.y() > v.w()) code |= 0x08;
- if (v.z() < -v.w()) code |= 0x10;
- if (v.z() > v.w()) code |= 0x20;
- return code;
-}
-
-/*!
- Returns true if \a box is completely outside the current viewing volume.
- This is used to perform object culling checks.
-*/
-bool QGLPainter::isCullable(const QBox3D& box) const
-{
- Q_D(const QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- // This function uses the technique of view frustum culling known as
- // clip space testing. Since the normal QVector3D representation
- // of the points throws away the w value needed, we convert the box
- // into a set of 8 points represented as QVector4D's and then apply
- // the test. The test is to transform the points into clip space
- // by applying the MV and Proj matrices, then test to see if the 4D
- // points are outside the clip space by testing x, y & z against w.
- QArray<QVector4D> box4d;
- QVector3D n = box.minimum();
- QVector3D x = box.maximum();
- box4d.append(QVector4D(n.x(), n.y(), x.z(), 1), QVector4D(x.x(), n.y(), x.z(), 1),
- QVector4D(x.x(), x.y(), x.z(), 1), QVector4D(n.x(), x.y(), x.z(), 1));
- box4d.append(QVector4D(n.x(), n.y(), n.z(), 1), QVector4D(x.x(), n.y(), n.z(), 1),
- QVector4D(x.x(), x.y(), n.z(), 1), QVector4D(n.x(), x.y(), n.z(), 1));
- QMatrix4x4 mvp = d->projectionMatrix.top() * d->modelViewMatrix.top();
- for (int i = 0; i < box4d.size(); ++i)
- {
- box4d[i] = mvp * box4d.at(i);
- }
- // if the logical AND of all the outcodes is non-zero then the BB is
- // definitely outside the view frustum.
- uint out = 0xff;
- for (int i = 0; i < box4d.size(); ++i)
- {
- out = out & outcode(box4d.at(i));
- }
- return out;
-}
-
-/*!
- Returns the current render order sequencer.
-
- \sa QGLRenderSequencer
-*/
-QGLRenderSequencer *QGLPainter::renderSequencer()
-{
- Q_D(QGLPainter);
- if (!d->renderSequencer)
- d->renderSequencer = new QGLRenderSequencer(this);
- return d->renderSequencer;
-}
-
-/*!
- Returns the aspect ratio of the viewport for adjusting projection
- transformations.
-*/
-qreal QGLPainter::aspectRatio() const
-{
- return currentSurface()->aspectRatio();
-}
-
-/*!
- Returns the current effect that is in use, which is userEffect()
- if it is not null, or the effect object associated with
- standardEffect() otherwise.
-
- If isPicking() is true, then this will return the effect object
- that is being used to generate pick colors.
-
- \sa userEffect(), standardEffect(), isPicking()
-*/
-QGLAbstractEffect *QGLPainter::effect() const
-{
- Q_D(QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- d->ensureEffect(const_cast<QGLPainter *>(this));
- return d->effect;
-}
-
-/*!
- Returns the user-defined effect that is being used for drawing
- operations, or null if standardEffect() is in use.
-
- \sa setUserEffect(), standardEffect(), effect()
-*/
-QGLAbstractEffect *QGLPainter::userEffect() const
-{
- Q_D(QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- return d->userEffect;
-}
-
-/*!
- Sets a user-defined \a effect to use for drawing operations
- in the current GL context. If \a effect is null, this will
- disable user-defined effects and return to using standardEffect().
-
- \sa effect(), draw(), setStandardEffect()
-*/
-void QGLPainter::setUserEffect(QGLAbstractEffect *effect)
-{
- Q_D(QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- if (d->userEffect == effect)
- return;
- if (d->effect)
- d->effect->setActive(this, false);
- d->userEffect = effect;
- if (effect && (!d->pick || !d->pick->isPicking)) {
- d->effect = effect;
- d->effect->setActive(this, true);
- d->updates = UpdateAll;
- } else {
- // Revert to the effect associated with standardEffect().
- d->effect = 0;
- d->ensureEffect(this);
- }
-}
-
-/*!
- Returns the standard effect to use for rendering fragments in
- the current GL context when userEffect() is null.
-
- \sa setStandardEffect(), userEffect()
-*/
-QGL::StandardEffect QGLPainter::standardEffect() const
-{
- Q_D(QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- return d->standardEffect;
-}
-
-/*!
- Sets a standard \a effect to use for rendering fragments
- in the current GL context. This will also set userEffect()
- to null. If \a effect is an invalid value, then the behavior
- of QGL::FlatColor will be used instead.
-
- \sa standardEffect(), setUserEffect()
-*/
-void QGLPainter::setStandardEffect(QGL::StandardEffect effect)
-{
- Q_D(QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- if (d->standardEffect == effect && d->effect && d->userEffect == 0)
- return;
- if (d->effect)
- d->effect->setActive(this, false);
- d->standardEffect = effect;
- d->userEffect = 0;
- d->effect = 0;
- d->ensureEffect(this);
-}
-
-/*!
- Disables the current effect and sets userEffect() to null.
- Unlike setUserEffect() this not activate the standardEffect()
- until the next time effect() is called.
-
- This function can be used to disable all effect-based drawing
- operations prior to performing raw GL calls. The next time
- effect() is called on this QGLPainter, the standardEffect()
- will be reactivated. An effect can also be reactivated by
- calling setUserEffect() or setStandardEffect().
-
- \sa userEffect(), standardEffect()
-*/
-void QGLPainter::disableEffect()
-{
- Q_D(QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- if (d->effect)
- d->effect->setActive(this, false);
- d->userEffect = 0;
- d->effect = 0;
-}
-
-/*!
- Returns the cached shader program associated with \a name; or null
- if \a name is not currently associated with a shader program.
-
- \sa setCachedProgram()
-*/
-QGLShaderProgram *QGLPainter::cachedProgram(const QString& name) const
-{
- Q_D(const QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- return d->cachedPrograms.value(name, 0);
-}
-
-/*!
- Sets the cached shader \a program associated with \a name.
-
- Effect objects can use this function to store pre-compiled
- and pre-linked shader programs in the painter for future
- use by the same effect. The \a program will be destroyed
- when context() is destroyed.
-
- If \a program is null, then the program associated with \a name
- will be destroyed. If \a name is already present as a cached
- program, then it will be replaced with \a program.
-
- Names that start with "\c{qt.}" are reserved for use by Qt's
- internal effects.
-
- \sa cachedProgram()
-*/
-void QGLPainter::setCachedProgram
- (const QString& name, QGLShaderProgram *program)
-{
- Q_D(QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- QGLShaderProgram *current = d->cachedPrograms.value(name, 0);
- if (current != program) {
- if (program)
- d->cachedPrograms[name] = program;
- else
- d->cachedPrograms.remove(name);
- delete current;
- }
-}
-
-void QGLPainterPrivate::createEffect(QGLPainter *painter)
-{
- if (userEffect) {
- if (!pick || !pick->isPicking) {
- effect = userEffect;
- effect->setActive(painter, true);
- updates = QGLPainter::UpdateAll;
- return;
- }
- if (userEffect->supportsPicking()) {
- effect = userEffect;
- effect->setActive(painter, true);
- updates = QGLPainter::UpdateAll;
- return;
- }
- effect = pick->defaultPickEffect;
- effect->setActive(painter, true);
- updates = QGLPainter::UpdateAll;
- return;
- }
- if (uint(standardEffect) >= QGL_MAX_STD_EFFECTS)
- effect = stdeffects[int(QGL::FlatColor)];
- else
- effect = stdeffects[int(standardEffect)];
- if (!effect) {
- switch (standardEffect) {
- case QGL::FlatColor: default:
- effect = new QGLFlatColorEffect();
- break;
- case QGL::FlatPerVertexColor:
- effect = new QGLPerVertexColorEffect();
- break;
- case QGL::FlatReplaceTexture2D:
- effect = new QGLFlatTextureEffect();
- break;
- case QGL::FlatDecalTexture2D:
- effect = new QGLFlatDecalTextureEffect();
- break;
- case QGL::LitMaterial:
- effect = new QGLLitMaterialEffect();
- break;
- case QGL::LitDecalTexture2D:
- effect = new QGLLitDecalTextureEffect();
- break;
- case QGL::LitModulateTexture2D:
- effect = new QGLLitModulateTextureEffect();
- break;
- }
- if (uint(standardEffect) >= QGL_MAX_STD_EFFECTS)
- stdeffects[int(QGL::FlatColor)] = effect;
- else
- stdeffects[int(standardEffect)] = effect;
- }
- if (!pick || !pick->isPicking || effect->supportsPicking()) {
- effect->setActive(painter, true);
- } else {
- effect = pick->defaultPickEffect;
- effect->setActive(painter, true);
- }
- updates = QGLPainter::UpdateAll;
-}
-
-/*!
- Returns the last color that was set with setColor(). The default
- value is (1, 1, 1, 1).
-
- \sa setColor()
-*/
-QColor QGLPainter::color() const
-{
- Q_D(QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- return d->color;
-}
-
-/*!
- Sets the default fragment \a color for effects associated
- with this painter. This function does not apply the color
- to the effect until update() is called.
-
- \sa color(), update()
-*/
-void QGLPainter::setColor(const QColor& color)
-{
- Q_D(QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- d->color = color;
- d->updates |= UpdateColor;
-}
-
-static void qt_gl_setVertexAttribute(QGL::VertexAttribute attribute, const QGLAttributeValue& value)
-{
-#if !defined(QT_OPENGL_ES_2)
- switch (attribute) {
- case QGL::Position:
- glVertexPointer(value.tupleSize(), value.type(),
- value.stride(), value.data());
- break;
-
- case QGL::Normal:
- if (value.tupleSize() == 3)
- glNormalPointer(value.type(), value.stride(), value.data());
- break;
-
- case QGL::Color:
- glColorPointer(value.tupleSize(), value.type(),
- value.stride(), value.data());
- break;
-
-#ifdef GL_TEXTURE_COORD_ARRAY
- case QGL::TextureCoord0:
- case QGL::TextureCoord1:
- case QGL::TextureCoord2:
- {
- int unit = (int)(attribute - QGL::TextureCoord0);
- qt_gl_ClientActiveTexture(GL_TEXTURE0 + unit);
- glTexCoordPointer(value.tupleSize(), value.type(),
- value.stride(), value.data());
- if (unit != 0) // Stay on unit 0 between requests.
- qt_gl_ClientActiveTexture(GL_TEXTURE0);
- }
- break;
-#endif
-
- default: break;
- }
-#else
- Q_UNUSED(attribute);
- Q_UNUSED(value);
-#endif
-}
-
-/*!
- Returns the set of vertex attributes that have been set on the
- painter state by setVertexAttribute() and setVertexBundle()
- since the last call to clearAttributes().
-
- The most common use for this function is to determine if specific
- attributes have been supplied on the painter so as to adjust the
- current drawing effect accordingly. The following example will
- use a lit texture effect if texture co-ordinates were provided
- in the vertex bundle, or a simple lit material effect if
- texture co-ordinates were not provided:
-
- \code
- painter.clearAttributes();
- painter.setVertexBundle(bundle);
- if (painter.attributes().contains(QGL::TextureCoord0))
- painter.setStandardEffect(QGL::LitModulateTexture2D);
- else
- painter.setStandardEffect(QGL::LitMaterial);
- \endcode
-
- It is important to clear the attributes before setting the vertex
- bundle, so that attributes from a previous bundle will not leak
- through. Multiple vertex bundles may be supplied if they contain
- different parts of the same logical piece of geometry.
-
- \sa clearAttributes(), setVertexBundle()
-*/
-QGLAttributeSet QGLPainter::attributes() const
-{
- Q_D(const QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- return d->attributeSet;
-}
-
-/*!
- Clears the set of vertex attributes that have been set on the
- painter state by setVertexAttribute() and setVertexBundle().
- See the documentation for attributes() for more information.
-
- \sa attributes()
-*/
-void QGLPainter::clearAttributes()
-{
- Q_D(QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- d->attributeSet.clear();
-}
-
-/*!
- Sets a vertex \a attribute on the current GL context to \a value.
-
- The vertex attribute is bound to the GL state on the index
- corresponding to \a attribute. For example, QGL::Position
- will be bound to index 0, QGL::TextureCoord0 will be bound
- to index 3, etc.
-
- Vertex attributes are independent of the effect() and can be
- bound once and then used with multiple effects.
-
- If this is the first attribute in a new piece of geometry,
- it is recommended that clearAttributes() be called before this
- function. This will inform QGLPainter that a new piece of geometry
- is being provided and that the previous geometry is now invalid.
- See the documentation for attributes() for more information.
-
- \sa setVertexBundle(), draw(), clearAttributes(), attributes()
-*/
-void QGLPainter::setVertexAttribute
- (QGL::VertexAttribute attribute, const QGLAttributeValue& value)
-{
- Q_D(QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- d->ensureEffect(this);
- if (d->boundVertexBuffer) {
- QGLBuffer::release(QGLBuffer::VertexBuffer);
- d->boundVertexBuffer = 0;
- }
- if (d->isFixedFunction) {
- qt_gl_setVertexAttribute(attribute, value);
- } else {
- glVertexAttribPointer(GLuint(attribute), value.tupleSize(),
- value.type(), GL_TRUE,
- value.stride(), value.data());
- }
- d->attributeSet.insert(attribute);
-}
-
-/*!
- Sets the vertex attributes on the current GL context that are
- stored in \a buffer.
-
- The vertex attributes are bound to the GL state on the indexes
- that are specified within \a buffer; QGL::Position will be
- bound to index 0, QGL::TextureCoord0 will be bound to index 3, etc.
-
- Vertex attributes are independent of the effect() and can be
- bound once and then used with multiple effects.
-
- It is recommended that clearAttributes() be called before this
- function to inform QGLPainter that a new piece of geometry is
- being provided and that the previous geometry is now invalid.
- See the documentation for attributes() for more information.
-
- \sa setVertexAttribute(), draw(), clearAttributes(), attributes()
-*/
-void QGLPainter::setVertexBundle(const QGLVertexBundle& buffer)
-{
- Q_D(QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- d->ensureEffect(this);
- QGLVertexBundlePrivate *bd = const_cast<QGLVertexBundlePrivate *>(buffer.d_func());
- if (bd->buffer.isCreated()) {
- GLuint id = bd->buffer.bufferId();
- if (id != d->boundVertexBuffer) {
- bd->buffer.bind();
- d->boundVertexBuffer = id;
- }
- } else if (d->boundVertexBuffer) {
- QGLBuffer::release(QGLBuffer::VertexBuffer);
- d->boundVertexBuffer = 0;
- }
- for (int index = 0; index < bd->attributes.size(); ++index) {
- QGLVertexBundleAttribute *attr = bd->attributes[index];
- if (d->isFixedFunction) {
- qt_gl_setVertexAttribute(attr->attribute, attr->value);
- } else {
- glVertexAttribPointer(GLuint(attr->attribute),
- attr->value.tupleSize(),
- attr->value.type(), GL_TRUE,
- attr->value.stride(), attr->value.data());
- }
- }
- d->attributeSet.unite(buffer.attributes());
-}
-
-/*!
- Updates the projection matrix, modelview matrix, and lighting
- conditions in the currently active effect() object by calling
- QGLAbstractEffect::update(). Also updates \c{glViewport()}
- to cover the currentSurface() if necessary.
-
- Normally this function is called automatically by draw().
- However, if the user wishes to use raw GL functions to draw fragments,
- it will be necessary to explicitly call this function to ensure that
- the matrix state and lighting conditions have been set on the
- active effect().
-
- Note that this function informs the effect that an update is needed.
- It does not change the GL state itself, except for \c{glViewport()}.
- In particular, the modelview and projection matrices in the
- fixed-function pipeline are not changed unless the effect or
- application calls updateFixedFunction().
-
- \sa setUserEffect(), projectionMatrix(), modelViewMatrix()
- \sa draw(), updateFixedFunction()
-*/
-void QGLPainter::update()
-{
- Q_D(QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- d->ensureEffect(this);
- QGLPainter::Updates updates = d->updates;
- d->updates = 0;
- if (d->modelViewMatrix.isDirty()) {
- updates |= UpdateModelViewMatrix;
- d->modelViewMatrix.setDirty(false);
- }
- if (d->projectionMatrix.isDirty()) {
- updates |= UpdateProjectionMatrix;
- d->projectionMatrix.setDirty(false);
- }
- if ((updates & UpdateViewport) != 0) {
- QRect viewport = currentSurface()->viewportGL();
- glViewport(viewport.x(), viewport.y(),
- viewport.width(), viewport.height());
- }
- if (updates != 0)
- d->effect->update(this, updates);
-}
-
-#if !defined(QT_OPENGL_ES_2)
-
-static void setLight(int light, const QGLLightParameters *parameters,
- const QMatrix4x4& transform)
-{
- GLfloat params[4];
-
- QColor color = parameters->ambientColor();
- params[0] = color.redF();
- params[1] = color.greenF();
- params[2] = color.blueF();
- params[3] = color.alphaF();
- glLightfv(light, GL_AMBIENT, params);
-
- color = parameters->diffuseColor();
- params[0] = color.redF();
- params[1] = color.greenF();
- params[2] = color.blueF();
- params[3] = color.alphaF();
- glLightfv(light, GL_DIFFUSE, params);
-
- color = parameters->specularColor();
- params[0] = color.redF();
- params[1] = color.greenF();
- params[2] = color.blueF();
- params[3] = color.alphaF();
- glLightfv(light, GL_SPECULAR, params);
-
- QVector4D vector = parameters->eyePosition(transform);
- params[0] = vector.x();
- params[1] = vector.y();
- params[2] = vector.z();
- params[3] = vector.w();
- glLightfv(light, GL_POSITION, params);
-
- QVector3D spotDirection = parameters->eyeSpotDirection(transform);
- params[0] = spotDirection.x();
- params[1] = spotDirection.y();
- params[2] = spotDirection.z();
- glLightfv(light, GL_SPOT_DIRECTION, params);
-
- params[0] = parameters->spotExponent();
- glLightfv(light, GL_SPOT_EXPONENT, params);
-
- params[0] = parameters->spotAngle();
- glLightfv(light, GL_SPOT_CUTOFF, params);
-
- params[0] = parameters->constantAttenuation();
- glLightfv(light, GL_CONSTANT_ATTENUATION, params);
-
- params[0] = parameters->linearAttenuation();
- glLightfv(light, GL_LINEAR_ATTENUATION, params);
-
- params[0] = parameters->quadraticAttenuation();
- glLightfv(light, GL_QUADRATIC_ATTENUATION, params);
-}
-
-static void setMaterial(int face, const QGLMaterial *parameters)
-{
- GLfloat params[17];
-
- QColor mcolor = parameters->ambientColor();
- params[0] = mcolor.redF();
- params[1] = mcolor.greenF();
- params[2] = mcolor.blueF();
- params[3] = mcolor.alphaF();
-
- mcolor = parameters->diffuseColor();
- params[4] = mcolor.redF();
- params[5] = mcolor.greenF();
- params[6] = mcolor.blueF();
- params[7] = mcolor.alphaF();
-
- mcolor = parameters->specularColor();
- params[8] = mcolor.redF();
- params[9] = mcolor.greenF();
- params[10] = mcolor.blueF();
- params[11] = mcolor.alphaF();
-
- mcolor = parameters->emittedLight();
- params[12] = mcolor.redF();
- params[13] = mcolor.greenF();
- params[14] = mcolor.blueF();
- params[15] = mcolor.alphaF();
-
- params[16] = parameters->shininess();
-
- glMaterialfv(face, GL_AMBIENT, params);
- glMaterialfv(face, GL_DIFFUSE, params + 4);
- glMaterialfv(face, GL_SPECULAR, params + 8);
- glMaterialfv(face, GL_EMISSION, params + 12);
- glMaterialfv(face, GL_SHININESS, params + 16);
-}
-
-#endif // !QT_OPENGL_ES_2
-
-/*!
- Updates the fixed-function pipeline with the current painting
- state according to the flags in \a updates.
-
- This function is intended for use by effects in their
- QGLAbstractEffect::update() override if they are using the
- fixed-function pipeline. It can also be used by user
- applications if they need the QGLPainter state to be
- set in the fixed-function pipeline.
-
- If the OpenGL implementation does not have a fixed-function
- pipeline, e.g. OpenGL/ES 2.0, this function does nothing.
-
- \sa update()
-*/
-void QGLPainter::updateFixedFunction(QGLPainter::Updates updates)
-{
-#if defined(QT_OPENGL_ES_2)
- Q_UNUSED(updates);
-#else
- Q_D(QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- if ((updates & QGLPainter::UpdateColor) != 0) {
- QColor color;
- if (isPicking())
- color = pickColor();
- else
- color = this->color();
- glColor4f(color.redF(), color.greenF(), color.blueF(), color.alphaF());
- }
- if ((updates & QGLPainter::UpdateModelViewMatrix) != 0) {
- const QMatrix4x4 &matrix = d->modelViewMatrix.top();
- glMatrixMode(GL_MODELVIEW);
- if (sizeof(qreal) == sizeof(GLfloat)) {
- glLoadMatrixf(reinterpret_cast<const GLfloat *>
- (matrix.constData()));
- } else {
- GLfloat mat[16];
- const qreal *m = matrix.constData();
- for (int index = 0; index < 16; ++index)
- mat[index] = m[index];
- glLoadMatrixf(mat);
- }
- }
- if ((updates & QGLPainter::UpdateProjectionMatrix) != 0) {
- const QMatrix4x4 &matrix = d->projectionMatrix.top();
- glMatrixMode(GL_PROJECTION);
- if (sizeof(qreal) == sizeof(GLfloat)) {
- glLoadMatrixf(reinterpret_cast<const GLfloat *>
- (matrix.constData()));
- } else {
- GLfloat mat[16];
- const qreal *m = matrix.constData();
- for (int index = 0; index < 16; ++index)
- mat[index] = m[index];
- glLoadMatrixf(mat);
- }
- }
- if ((updates & QGLPainter::UpdateLights) != 0) {
- // Save the current modelview matrix and load the identity.
- // We need to apply the light in the modelview transformation
- // that was active when the light was specified.
- glMatrixMode(GL_MODELVIEW);
- glPushMatrix();
- glLoadIdentity();
-
- // Enable the main light.
- const QGLLightParameters *params = mainLight();
- setLight(GL_LIGHT0, params, mainLightTransform());
-
- // Restore the previous modelview transformation.
- glPopMatrix();
-
- // Set up the light model parameters if at least one light is enabled.
- const QGLLightModel *lightModel = this->lightModel();
- GLfloat values[4];
-#ifdef GL_LIGHT_MODEL_TWO_SIDE
- if (lightModel->model() == QGLLightModel::TwoSided)
- values[0] = 1.0f;
- else
- values[0] = 0.0f;
- glLightModelfv(GL_LIGHT_MODEL_TWO_SIDE, values);
-#endif
-#ifdef GL_LIGHT_MODEL_COLOR_CONTROL
- if (lightModel->colorControl() == QGLLightModel::SeparateSpecularColor)
- values[0] = GL_SEPARATE_SPECULAR_COLOR;
- else
- values[0] = GL_SINGLE_COLOR;
- glLightModelfv(GL_LIGHT_MODEL_COLOR_CONTROL, values);
-#endif
-#ifdef GL_LIGHT_MODEL_LOCAL_VIEWER
- if (lightModel->viewerPosition() == QGLLightModel::LocalViewer)
- values[0] = 1.0f;
- else
- values[0] = 0.0f;
- glLightModelfv(GL_LIGHT_MODEL_LOCAL_VIEWER, values);
-#endif
-#ifdef GL_LIGHT_MODEL_AMBIENT
- QColor color = lightModel->ambientSceneColor();
- values[0] = color.redF();
- values[1] = color.blueF();
- values[2] = color.greenF();
- values[3] = color.alphaF();
- glLightModelfv(GL_LIGHT_MODEL_AMBIENT, values);
-#endif
- }
- if ((updates & QGLPainter::UpdateMaterials) != 0) {
- const QGLMaterial *frontMaterial = faceMaterial(QGL::FrontFaces);
- const QGLMaterial *backMaterial = faceMaterial(QGL::BackFaces);
- if (frontMaterial == backMaterial) {
- setMaterial(GL_FRONT_AND_BACK, frontMaterial);
- } else {
- setMaterial(GL_FRONT, frontMaterial);
- setMaterial(GL_BACK, backMaterial);
- }
- }
-#endif
-}
-
-/*!
- Draws primitives using \a count vertices from the arrays specified
- by setVertexAttribute(). The type of primitive to draw is specified
- by \a mode.
-
- This operation will consume \a count values from the
- enabled arrays, starting at \a index.
-
- \sa update()
-*/
-void QGLPainter::draw(QGL::DrawingMode mode, int count, int index)
-{
- update();
- glDrawArrays((GLenum)mode, index, count);
-}
-
-/*!
- \overload
-
- Draws primitives using vertices from the arrays specified by
- setVertexAttribute(). The type of primitive to draw is
- specified by \a mode.
-
- This operation will consume \a count elements of \a indices,
- which are used to index into the enabled arrays.
-
- \sa update()
-*/
-void QGLPainter::draw(QGL::DrawingMode mode, const ushort *indices, int count)
-{
- Q_D(QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- update();
- if (d->boundIndexBuffer) {
- QGLBuffer::release(QGLBuffer::IndexBuffer);
- d->boundIndexBuffer = 0;
- }
- glDrawElements(GLenum(mode), count, GL_UNSIGNED_SHORT, indices);
-}
-
-/*!
- Pushes \a surface onto the surface stack and makes it the current
- drawing surface for context(). If \a surface is null, then the
- current drawing surface will be set to the main surface (e.g. the window).
-
- Note: the \a surface object must remain valid until popped from
- the stack or end() is called. All surfaces are popped from
- the stack by end().
-
- The UpdateViewport flag will be set to indicate that the
- \c{glViewport()} should be adjusted to the extents of \a surface
- when update() is next called.
-
- \sa popSurface(), currentSurface(), setSurface()
- \sa QGLAbstractSurface::activate()
-*/
-void QGLPainter::pushSurface(QGLAbstractSurface *surface)
-{
- Q_D(QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- Q_ASSERT(surface);
- if (!surface) {
- // Find the most recent main surface for this painter.
- int size = d->surfaceStack.size();
- while (size > 0 && !d->surfaceStack[size - 1].mainSurface)
- --size;
- if (!size)
- return; // Shouldn't happen, but be safe anyway.
- surface = d->surfaceStack[size - 1].surface;
- }
- Q_ASSERT(!d->surfaceStack.isEmpty()); // Should have a main surface.
- QGLAbstractSurface *current = d->surfaceStack.top().surface;
- QGLPainterSurfaceInfo psurf;
- psurf.surface = surface;
- psurf.destroySurface = false;
- psurf.mainSurface = false;
- d->surfaceStack.append(psurf);
- current->switchTo(surface);
- d->updates |= UpdateViewport;
-}
-
-/*!
- Pops the top-most drawing surface from the surface stack
- and returns it. The next object on the stack will be made
- the current drawing surface for context(). Returns null if the
- surface stack is already at the main surface (e.g. the window).
-
- The UpdateViewport flag will be set to indicate that the
- \c{glViewport()} should be adjusted to the new surface extents
- when update() is next called.
-
- \sa pushSurface(), currentSurface(), setSurface()
-*/
-QGLAbstractSurface *QGLPainter::popSurface()
-{
- Q_D(QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- Q_ASSERT(!d->surfaceStack.isEmpty()); // Should have a main surface.
- QGLPainterSurfaceInfo &surf = d->surfaceStack.top();
- if (surf.mainSurface)
- return 0;
- QGLAbstractSurface *surface = surf.surface;
- d->surfaceStack.pop();
- Q_ASSERT(!d->surfaceStack.isEmpty()); // Should have a main surface.
- QGLAbstractSurface *nextSurface = d->surfaceStack.top().surface;
- surface->switchTo(nextSurface);
- d->updates |= UpdateViewport;
- return surface;
-}
-
-/*!
- Sets the top-most drawing surface on the surface stack to \a surface
- and activate it.
-
- Note: if the top-most drawing surface is the main surface specified
- during begin(), then this function will perform a pushSurface()
- instead. Typically this function is used to replace the last
- surface that was pushed onto the stack and avoid doing popSurface()
- followed by pushSurface(). The main surface cannot be replaced
- in this manner.
-
- The UpdateViewport flag will be set to indicate that the
- \c{glViewport()} should be adjusted to the extents of \a surface
- when update() is next called.
-
- \sa pushSurface(), popSurface(), currentSurface()
-*/
-void QGLPainter::setSurface(QGLAbstractSurface *surface)
-{
- Q_D(QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- Q_ASSERT(surface);
- Q_ASSERT(!d->surfaceStack.isEmpty()); // Should have a main surface.
- QGLPainterSurfaceInfo &surf = d->surfaceStack.top();
- if (surf.mainSurface) {
- pushSurface(surface);
- return;
- }
- QGLAbstractSurface *oldSurface = surf.surface;
- surf.surface = surface;
- oldSurface->switchTo(surface);
- d->updates |= UpdateViewport;
-}
-
-/*!
- Returns the current drawing surface.
-
- \sa pushSurface(), popSurface(), setSurface()
-*/
-QGLAbstractSurface *QGLPainter::currentSurface() const
-{
- Q_D(const QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- Q_ASSERT(!d->surfaceStack.isEmpty()); // Should have a main surface.
- return d->surfaceStack.top().surface;
-}
-
-/*!
- Returns the current lighting model.
-
- \sa setLightModel()
-*/
-const QGLLightModel *QGLPainter::lightModel() const
-{
- Q_D(QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- if (!d->lightModel) {
- if (!d->defaultLightModel)
- d->defaultLightModel = new QGLLightModel();
- d->lightModel = d->defaultLightModel;
- }
- return d->lightModel;
-}
-
-/*!
- Sets the current lighting model to \a value. If \a value is
- null, then the default lighting model parameters will be used.
-
- The light settings in the GL server will not be changed until
- update() is called.
-
- \sa lightModel()
-*/
-void QGLPainter::setLightModel(const QGLLightModel *value)
-{
- Q_D(QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- d->lightModel = value;
- d->updates |= QGLPainter::UpdateLights;
-}
-
-/*!
- Returns the parameters for the main light in the scene.
-
- The light parameters are specified in world co-ordinates at
- the point when setMainLight() was called. The mainLightTransform()
- must be applied to obtain eye co-ordinates.
-
- This function is a convenience that returns the light with
- identifier 0. If light 0 is not currently enabled, then a
- default light is added to the painter with an identity
- transform and then returned as the main light.
-
- \sa setMainLight(), mainLightTransform(), addLight()
-*/
-const QGLLightParameters *QGLPainter::mainLight() const
-{
- Q_D(QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- if (d->lights.isEmpty()) {
- if (!d->defaultLight)
- d->defaultLight = new QGLLightParameters();
- d->lights.append(d->defaultLight);
- d->lightTransforms.append(QMatrix4x4());
- } else if (!d->lights[0]) {
- if (!d->defaultLight)
- d->defaultLight = new QGLLightParameters();
- d->lights[0] = d->defaultLight;
- d->lightTransforms[0] = QMatrix4x4();
- }
- return d->lights[0];
-}
-
-/*!
- Sets the \a parameters for the main light in the scene.
- The mainLightTransform() is set to the current modelViewMatrix().
-
- Light parameters are stored in world co-ordinates, not eye co-ordinates.
- The mainLightTransform() specifies the transformation to apply to
- convert the world co-ordinates into eye co-ordinates when the light
- is used.
-
- Note: the \a parameters may be ignored by effect() if it
- has some other way to determine the lighting conditions.
-
- The light settings in the GL server will not be changed until
- update() is called.
-
- This function is a convenience that sets the light with
- identifier 0. If \a parameters is null, then light 0
- will be removed.
-
- \sa mainLight(), mainLightTransform(), addLight()
-*/
-void QGLPainter::setMainLight(const QGLLightParameters *parameters)
-{
- Q_D(QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- if (d->lights.isEmpty()) {
- if (parameters) {
- d->lights.append(parameters);
- d->lightTransforms.append(modelViewMatrix());
- d->updates |= QGLPainter::UpdateLights;
- }
- } else if (parameters) {
- d->lights[0] = parameters;
- d->lightTransforms[0] = modelViewMatrix();
- d->updates |= QGLPainter::UpdateLights;
- } else {
- removeLight(0);
- }
-}
-
-/*!
- Sets the \a parameters for the main light in the scene, and set
- mainLightTransform() to \a transform.
-
- Light parameters are stored in world co-ordinates, not eye co-ordinates.
- The \a transform specifies the transformation to apply to convert the
- world co-ordinates into eye co-ordinates when the light is used.
-
- Note: the \a parameters may be ignored by effect() if it
- has some other way to determine the lighting conditions.
-
- The light settings in the GL server will not be changed until
- update() is called.
-
- This function is a convenience that sets the light with
- identifier 0. If \a parameters is null, then light 0
- will be removed.
-
- \sa mainLight(), mainLightTransform()
-*/
-void QGLPainter::setMainLight
- (const QGLLightParameters *parameters, const QMatrix4x4& transform)
-{
- Q_D(QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- if (d->lights.isEmpty()) {
- if (parameters) {
- d->lights.append(parameters);
- d->lightTransforms.append(transform);
- d->updates |= QGLPainter::UpdateLights;
- }
- } else if (parameters) {
- d->lights[0] = parameters;
- d->lightTransforms[0] = transform;
- d->updates |= QGLPainter::UpdateLights;
- } else {
- removeLight(0);
- }
-}
-
-/*!
- Returns the modelview transformation matrix for the main light that
- was set at the time setMainLight() was called.
-
- The light transform may be used by later painting operations to
- convert the light from world co-ordinates into eye co-ordinates.
- The eye transformation is set when the light is specified.
-
- This function is a convenience that returns the tranform for the
- light with identifier 0. If light 0 is not enabled, then the
- function returns the identity matrix.
-
- \sa mainLight(), setMainLight(), addLight()
-*/
-QMatrix4x4 QGLPainter::mainLightTransform() const
-{
- Q_D(const QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- if (!d->lights.isEmpty() && d->lights[0])
- return d->lightTransforms[0];
- else
- return QMatrix4x4();
-}
-
-/*!
- Adds a light to this painter, with the specified \a parameters.
- The lightTransform() for the light is set to the current
- modelViewMatrix(). Returns an identifier for the light.
-
- Light parameters are stored in world co-ordinates, not eye co-ordinates.
- The lightTransform() specifies the transformation to apply to
- convert the world co-ordinates into eye co-ordinates when the light
- is used.
-
- Note: the \a parameters may be ignored by effect() if it
- has some other way to determine the lighting conditions.
-
- The light settings in the GL server will not be changed until
- update() is called.
-
- \sa removeLight(), light(), mainLight()
-*/
-int QGLPainter::addLight(const QGLLightParameters *parameters)
-{
- return addLight(parameters, modelViewMatrix());
-}
-
-/*!
- Adds a light to this painter, with the specified \a parameters.
- The lightTransform() for the light is set to \a transform.
- Returns an identifier for the light.
-
- Light parameters are stored in world co-ordinates, not eye co-ordinates.
- The \a transform specifies the transformation to apply to
- convert the world co-ordinates into eye co-ordinates when the light
- is used.
-
- Note: the \a parameters may be ignored by effect() if it
- has some other way to determine the lighting conditions.
-
- The light settings in the GL server will not be changed until
- update() is called.
-
- \sa removeLight(), light(), mainLight()
-*/
-int QGLPainter::addLight(const QGLLightParameters *parameters, const QMatrix4x4 &transform)
-{
- Q_ASSERT(parameters);
- Q_D(QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- int lightId = 0;
- while (lightId < d->lights.size() && d->lights[lightId] != 0)
- ++lightId;
- if (lightId < d->lights.size()) {
- d->lights[lightId] = parameters;
- d->lightTransforms[lightId] = transform;
- } else {
- d->lights.append(parameters);
- d->lightTransforms.append(transform);
- }
- d->updates |= QGLPainter::UpdateLights;
- return lightId;
-}
-
-/*!
- Removes the light with the specified \a lightId.
-
- \sa addLight(), light()
-*/
-void QGLPainter::removeLight(int lightId)
-{
- Q_D(QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- if (lightId >= 0 && lightId < d->lights.size()) {
- d->lights[lightId] = 0;
- if (lightId >= (d->lights.size() - 1)) {
- do {
- d->lights.resize(lightId);
- d->lightTransforms.resize(lightId);
- --lightId;
- } while (lightId >= 0 && d->lights[lightId] == 0);
- }
- d->updates |= QGLPainter::UpdateLights;
- }
-}
-
-/*!
- Returns the maximum light identifier currently in use on this painter;
- or -1 if there are no lights.
-
- It is possible that some light identifiers less than maximumLightId()
- may be invalid because the lights have been removed. Use the following
- code to locate all enabled lights:
-
- \code
- int maxLightId = painter.maximumLightId();
- for (int lightId = 0; index <= maxLightId; ++index) {
- const QGLLightParameters *params = painter.light(lightId);
- if (params) {
- ...
- }
- }
- \endcode
-
- \sa addLight(), light()
-*/
-int QGLPainter::maximumLightId() const
-{
- Q_D(const QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- return d->lights.size() - 1;
-}
-
-/*!
- Returns the parameters for the light with the identifier \a lightId;
- or null if \a lightId is not valid or has been removed.
-
- \sa addLight(), removeLight(), lightTransform()
-*/
-const QGLLightParameters *QGLPainter::light(int lightId) const
-{
- Q_D(const QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- if (lightId >= 0 && lightId < d->lights.size())
- return d->lights[lightId];
- else
- return 0;
-}
-
-/*!
- Returns the modelview transformation for the light with the identifier
- \a lightId; or the identity matrix if \a lightId is not valid or has
- been removed.
-
- \sa addLight(), removeLight(), light()
-*/
-QMatrix4x4 QGLPainter::lightTransform(int lightId) const
-{
- Q_D(const QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- if (lightId >= 0 && lightId < d->lights.size() && d->lights[lightId])
- return d->lightTransforms[lightId];
- else
- return QMatrix4x4();
-}
-
-/*!
- Returns the material that is used for drawing \a face on polygons.
- If \a face is QGL::FrontFaces or QGL::AllFaces, then the front
- material is returned. If \a face is QGL::BackFaces, then the
- back material is returned.
-
- \sa setFaceMaterial(), setFaceColor()
-*/
-const QGLMaterial *QGLPainter::faceMaterial(QGL::Face face) const
-{
- Q_D(QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- if (face == QGL::BackFaces) {
- if (!d->backMaterial) {
- if (!d->defaultMaterial)
- d->defaultMaterial = new QGLMaterial();
- d->backMaterial = d->defaultMaterial;
- }
- return d->backMaterial;
- } else {
- if (!d->frontMaterial) {
- if (!d->defaultMaterial)
- d->defaultMaterial = new QGLMaterial();
- d->frontMaterial = d->defaultMaterial;
- }
- return d->frontMaterial;
- }
-}
-
-/*!
- Sets the material that is used for drawing \a face on polygons
- to \a value. If \a face is QGL::FrontFaces, then the front
- material is set. If \a face is QGL::BackFaces, then the
- back material is set. If \a face is QGL::AllFaces, then both
- the front and back materials are set.
-
- If \a value is null, then the \a face material will be set to
- the default material properties.
-
- The material settings in the GL server will not be changed until
- update() is called.
-
- \sa faceMaterial(), setFaceColor()
-*/
-void QGLPainter::setFaceMaterial
- (QGL::Face face, const QGLMaterial *value)
-{
- Q_D(QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- if (face == QGL::FrontFaces) {
- if (d->frontMaterial == value)
- return;
- d->frontMaterial = value;
- } else if (face == QGL::BackFaces) {
- if (d->backMaterial == value)
- return;
- d->backMaterial = value;
- } else {
- if (d->frontMaterial == value && d->backMaterial == value)
- return;
- d->frontMaterial = value;
- d->backMaterial = value;
- }
- d->updates |= QGLPainter::UpdateMaterials;
-}
-
-static QGLMaterial *createColorMaterial
- (QGLMaterial *prev, const QColor& color)
-{
- QGLMaterial *material;
- if (prev)
- material = prev;
- else
- material = new QGLMaterial();
- material->setColor(color);
- return material;
-}
-
-/*!
- Sets the material that is used for drawing \a face on polygons
- to \a color. This is a convenience function for setting materials
- to simple colors.
-
- The RGB components of the ambient color of the material will be set
- to 20% of \a color, and the RGB components of the diffuse color of the
- material will be set to 80% of \a color. The alpha components of
- the ambient and diffuse material colors will both be set to the
- alpha component of \a color.
-
- If \a face is QGL::FrontFaces, then the front material is set.
- If \a face is QGL::BackFaces, then the back material is set.
- If \a face is QGL::AllFaces, then both the front and back
- materials are set.
-
- The material settings in the GL server will not be changed until
- update() is called.
-
- \sa faceMaterial(), setFaceMaterial()
-*/
-void QGLPainter::setFaceColor(QGL::Face face, const QColor& color)
-{
- Q_D(QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- if (face == QGL::FrontFaces) {
- d->frontColorMaterial =
- createColorMaterial(d->frontColorMaterial, color);
- d->frontMaterial = d->frontColorMaterial;
- } else if (face == QGL::BackFaces) {
- d->backColorMaterial =
- createColorMaterial(d->backColorMaterial, color);
- d->backMaterial = d->backColorMaterial;
- } else {
- d->frontColorMaterial =
- createColorMaterial(d->frontColorMaterial, color);
- d->backColorMaterial =
- createColorMaterial(d->backColorMaterial, color);
- d->frontMaterial = d->frontColorMaterial;
- d->backMaterial = d->backColorMaterial;
- }
- d->updates |= QGLPainter::UpdateMaterials;
-}
-
-/*!
- Returns true if this painter is in object picking mode;
- false if this painter is in normal rendering mode.
-
- \sa setPicking(), objectPickId()
-*/
-bool QGLPainter::isPicking() const
-{
- Q_D(QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- return (d->pick ? d->pick->isPicking : false);
-}
-
-/*!
- Enables or disables object picking mode according to \a value.
-
- If \a value is true, then the effect() will be overridden with a
- simple flat color effect that renders objects with pickColor().
- These colors can be read back later with pickObject().
-
- \sa isPicking(), objectPickId(), pickObject()
-*/
-void QGLPainter::setPicking(bool value)
-{
- Q_D(QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- if (!d->pick)
- d->pick = new QGLPainterPickPrivate();
- if (d->pick->isPicking != value) {
- // Switch to/from the pick effect.
- d->pick->isPicking = value;
- if (d->effect)
- d->effect->setActive(this, false);
- d->effect = 0;
- d->ensureEffect(this);
- }
-}
-
-/*!
- Returns the current object pick identifier. The default value
- is -1 which indicates that rendered objects should not have a
- pickColor() associated with them.
-
- \sa setObjectPickId(), clearPickObjects(), pickObject()
-*/
-int QGLPainter::objectPickId() const
-{
- Q_D(QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- return (d->pick ? d->pick->objectPickId : -1);
-}
-
-/*!
- Sets the current object pick identifier to \a value. If \a value
- is -1, then subsequent objects will be rendered without a pickColor().
-
- If value is not -1, then the pickColor() is changed to a color
- that represents that object pick identifier. If \a value has been
- seen previously, then the same pickColor() as last time will
- be returned.
-
- The function call will be ignored if isPicking() is false.
-
- \sa objectPickId(), clearPickObjects(), pickObject()
-*/
-void QGLPainter::setObjectPickId(int value)
-{
- Q_D(QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- if (!d->pick || !d->pick->isPicking)
- return;
- d->pick->objectPickId = value;
- if (value != -1) {
- QRgb color = d->pick->pickObjectToColor.value(value, 0);
- if (!color) {
- color = qt_qgl_pick_color(d->pick->pickColorIndex++);
- d->pick->pickObjectToColor[value] = color;
- d->pick->pickColorToObject[color] = value;
- }
- d->pick->pickColor = color;
- d->updates |= UpdateColor;
- } else {
- d->pick->pickColor = 0;
- d->updates |= UpdateColor;
- }
-}
-
-/*!
- Clears the objectPickId() to pickColor() mappings that
- were used previously. This will also set objectPickId()
- to -1 and pickColor() to (0, 0, 0, 1).
-
- The function call will be ignored if isPicking() is false.
-
- \sa objectPickId(), pickColor()
-*/
-void QGLPainter::clearPickObjects()
-{
- Q_D(QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- if (d->pick && d->pick->isPicking) {
- d->pick->pickObjectToColor.clear();
- d->pick->pickColorToObject.clear();
- d->pick->pickColorIndex = 0;
- d->pick->objectPickId = -1;
- d->pick->pickColor = 0;
- d->updates |= UpdateColor;
- }
-}
-
-/*!
- Returns the current pick color to use to render the object
- associated with objectPickId(). The returned color will
- be (0, 0, 0, 1) if objectPickId() is -1.
-
- \sa objectPickId(), clearPickObjects()
-*/
-QColor QGLPainter::pickColor() const
-{
- Q_D(QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
- if (d->pick) {
- QColor color;
- color.setRgb(d->pick->pickColor);
- return color;
- } else {
- return Qt::black;
- }
-}
-
-/*!
- Picks the color at (\a x, \a y) in the color buffer and
- returns the objectPickId() that corresponds to that color.
- Returns -1 if (\a x, \a y) is not positioned over a
- recognized object. The origin (0, 0) is assumed to be
- the bottom-left corner of the drawing surface.
-
- \sa objectPickId()
-*/
-int QGLPainter::pickObject(int x, int y) const
-{
- Q_D(QGLPainter);
- QGLPAINTER_CHECK_PRIVATE();
-
- if (!d->pick)
- {
- return -1;
- }
-
- // Fetch the color at the specified pixel.
- unsigned char data[4] = {0, 0, 0, 0};
- glReadPixels(x, y, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, data);
- QRgb color = qRgb(data[0], data[1], data[2]);
-
- // Normalize the color to account for floating-point rounding.
- color = qt_qgl_normalize_pick_color(color); // XXX: detect RGB444 screens.
-
- // Map the color back to an object identifier.
- return d->pick->pickColorToObject.value(color, -1);
-}
-
-QT_END_NAMESPACE
diff --git a/src/threed/painting/qglpainter.h b/src/threed/painting/qglpainter.h
deleted file mode 100644
index 75146f69..00000000
--- a/src/threed/painting/qglpainter.h
+++ /dev/null
@@ -1,225 +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 QGLPAINTER_H
-#define QGLPAINTER_H
-
-#include <QtOpenGL/qgl.h>
-#include "qglnamespace.h"
-#include <QtGui/qvector2d.h>
-#include <QtGui/qvector3d.h>
-#include <QtGui/qvector4d.h>
-#include <QtGui/qmatrix4x4.h>
-#include "qbox3d.h"
-#include "qopenglfunctions.h"
-#include "qglvertexbundle.h"
-#include "qglindexbuffer.h"
-#include "qgllightmodel.h"
-#include "qgllightparameters.h"
-#include "qglmaterial.h"
-#include "qglabstractsurface.h"
-#include "qmatrix4x4stack.h"
-#include "qglcamera.h"
-#include "qvector2darray.h"
-#include "qvector3darray.h"
-#include "qvector4darray.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class QGLAbstractEffect;
-class QGLPainterPrivate;
-class QGLTexture2D;
-class QGLTextureCube;
-class QGeometryData;
-class QGLShaderProgram;
-class QGLFramebufferObject;
-class QGLSceneNode;
-class QGLRenderSequencer;
-class QGLAbstractSurface;
-
-class Q_QT3D_EXPORT QGLPainter : public QOpenGLFunctions
-{
-public:
- QGLPainter();
- explicit QGLPainter(const QGLContext *context);
- explicit QGLPainter(QGLWidget *widget);
- explicit QGLPainter(QPainter *painter);
- explicit QGLPainter(QGLAbstractSurface *surface);
- virtual ~QGLPainter();
-
- bool begin();
- bool begin(const QGLContext *context);
- bool begin(QGLWidget *widget);
- bool begin(QPainter *painter);
- bool begin(QGLAbstractSurface *surface);
- bool end();
- bool isActive() const;
-
- const QGLContext *context() const;
-
- bool isFixedFunction() const;
-
- enum Update
- {
- UpdateColor = 0x00000001,
- UpdateModelViewMatrix = 0x00000002,
- UpdateProjectionMatrix = 0x00000004,
- UpdateMatrices = 0x00000006,
- UpdateLights = 0x00000008,
- UpdateMaterials = 0x00000010,
- UpdateViewport = 0x00000020,
- UpdateAll = 0x7FFFFFFF
- };
- Q_DECLARE_FLAGS(Updates, Update);
-
- void setClearColor(const QColor& color);
-
- void setScissor(const QRect& rect);
-
- QMatrix4x4Stack& projectionMatrix();
- QMatrix4x4Stack& modelViewMatrix();
- QMatrix4x4 combinedMatrix() const;
- QMatrix3x3 normalMatrix() const;
- QMatrix4x4 worldMatrix() const;
-
- QGL::Eye eye() const;
- void setEye(QGL::Eye eye);
-
- void setCamera(const QGLCamera *camera);
-
- bool isCullable(const QVector3D& point) const;
- bool isCullable(const QBox3D& box) const;
- QGLRenderSequencer *renderSequencer();
-
- qreal aspectRatio() const;
-
- QGLAbstractEffect *effect() const;
-
- QGLAbstractEffect *userEffect() const;
- void setUserEffect(QGLAbstractEffect *effect);
-
- QGL::StandardEffect standardEffect() const;
- void setStandardEffect(QGL::StandardEffect effect);
-
- void disableEffect();
-
- QGLShaderProgram *cachedProgram(const QString& name) const;
- void setCachedProgram(const QString& name, QGLShaderProgram *program);
-
- QColor color() const;
- void setColor(const QColor& color);
-
- QGLAttributeSet attributes() const;
- void clearAttributes();
-
- void setVertexAttribute
- (QGL::VertexAttribute attribute, const QGLAttributeValue& value);
- void setVertexBundle(const QGLVertexBundle& buffer);
-
- void update();
- void updateFixedFunction(QGLPainter::Updates updates);
-
- void draw(QGL::DrawingMode mode, int count, int index = 0);
- void draw(QGL::DrawingMode mode, const ushort *indices, int count);
- void draw(QGL::DrawingMode mode, const QGLIndexBuffer& indices);
- virtual void draw(QGL::DrawingMode mode, const QGLIndexBuffer& indices, int offset, int count);
-
- void pushSurface(QGLAbstractSurface *surface);
- QGLAbstractSurface *popSurface();
- void setSurface(QGLAbstractSurface *surface);
- QGLAbstractSurface *currentSurface() const;
-
- const QGLLightModel *lightModel() const;
- void setLightModel(const QGLLightModel *value);
-
- const QGLLightParameters *mainLight() const;
- void setMainLight(const QGLLightParameters *parameters);
- void setMainLight
- (const QGLLightParameters *parameters, const QMatrix4x4& transform);
- QMatrix4x4 mainLightTransform() const;
-
- int addLight(const QGLLightParameters *parameters);
- int addLight(const QGLLightParameters *parameters, const QMatrix4x4 &transform);
- void removeLight(int lightId);
-
- int maximumLightId() const;
- const QGLLightParameters *light(int lightId) const;
- QMatrix4x4 lightTransform(int lightId) const;
-
- const QGLMaterial *faceMaterial(QGL::Face face) const;
- void setFaceMaterial(QGL::Face face, const QGLMaterial *value);
- void setFaceColor(QGL::Face face, const QColor& color);
-
- bool isPicking() const;
- void setPicking(bool value);
-
- int objectPickId() const;
- void setObjectPickId(int value);
- void clearPickObjects();
-
- QColor pickColor() const;
-
- int pickObject(int x, int y) const;
-
-private:
- Q_DISABLE_COPY(QGLPainter)
-
- QGLPainterPrivate *d_ptr;
-
- QGLPainterPrivate *d_func() const { return d_ptr; }
-
- friend class QGLAbstractEffect;
-
- bool begin(const QGLContext *context, QGLAbstractSurface *surface,
- bool destroySurface = true);
-};
-
-Q_DECLARE_OPERATORS_FOR_FLAGS(QGLPainter::Updates)
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/painting/qglpainter_p.h b/src/threed/painting/qglpainter_p.h
deleted file mode 100644
index bd1a0c6b..00000000
--- a/src/threed/painting/qglpainter_p.h
+++ /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 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 QGLPAINTER_P_H
-#define QGLPAINTER_P_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 "qglpainter.h"
-#include "qglrendersequencer.h"
-
-#include <QtCore/qatomic.h>
-#include <QtCore/qmap.h>
-#include <QtCore/qstack.h>
-
-QT_BEGIN_NAMESPACE
-
-#define QGL_MAX_LIGHTS 32
-#define QGL_MAX_STD_EFFECTS 16
-
-class QGLPainterPickPrivate
-{
-public:
- QGLPainterPickPrivate();
- ~QGLPainterPickPrivate();
-
- bool isPicking;
- int objectPickId;
- int pickColorIndex;
- QRgb pickColor;
- QMap<int, QRgb> pickObjectToColor;
- QMap<QRgb, int> pickColorToObject;
- QGLAbstractEffect *defaultPickEffect;
-};
-
-struct QGLPainterSurfaceInfo
-{
- QGLAbstractSurface *surface;
- bool destroySurface;
- bool mainSurface;
-};
-
-class QGLPainterPrivate
-{
-public:
- QGLPainterPrivate();
- ~QGLPainterPrivate();
-
- QAtomicInt ref;
- const QGLContext *context;
- QMatrix4x4Stack projectionMatrix;
- QMatrix4x4Stack modelViewMatrix;
- QMatrix4x4 inverseEyeMatrix;
- QGL::Eye eye;
- QGLAbstractEffect *effect;
- QGLAbstractEffect *userEffect;
- QGL::StandardEffect standardEffect;
- QGLAbstractEffect *stdeffects[QGL_MAX_STD_EFFECTS];
- const QGLLightModel *lightModel;
- QGLLightModel *defaultLightModel;
- QGLLightParameters *defaultLight;
- QArray<const QGLLightParameters *> lights;
- QArray<QMatrix4x4> lightTransforms;
- const QGLMaterial *frontMaterial;
- const QGLMaterial *backMaterial;
- QGLMaterial *defaultMaterial;
- QGLMaterial *frontColorMaterial;
- QGLMaterial *backColorMaterial;
- QBox3D viewingCube;
- QColor color;
- QGLPainter::Updates updates;
- QGLPainterPickPrivate *pick;
- QMap<QString, QGLShaderProgram *> cachedPrograms;
- QStack<QGLPainterSurfaceInfo> surfaceStack;
- GLuint boundVertexBuffer;
- GLuint boundIndexBuffer;
- QGLRenderSequencer *renderSequencer;
- bool isFixedFunction;
- QGLAttributeSet attributeSet;
-
- inline void ensureEffect(QGLPainter *painter)
- { if (!effect) createEffect(painter); }
- void createEffect(QGLPainter *painter);
-};
-
-class QGLPainterPrivateCache : public QObject
-{
- Q_OBJECT
-public:
- QGLPainterPrivateCache();
- ~QGLPainterPrivateCache();
-
- QMap<const QGLContext *, QGLPainterPrivate *> cache;
-
- QGLPainterPrivate *fromContext(const QGLContext *context);
-
- static QGLPainterPrivateCache *instance();
-
-public Q_SLOTS:
- void contextDestroyed(const QGLContext *context);
-
-Q_SIGNALS:
- void destroyedContext(const QGLContext *context);
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/threed/painting/qglpickcolors.cpp b/src/threed/painting/qglpickcolors.cpp
deleted file mode 100644
index e5a20958..00000000
--- a/src/threed/painting/qglpickcolors.cpp
+++ /dev/null
@@ -1,1125 +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$
-**
-****************************************************************************/
-
-#if !defined(QGL_GENERATOR_PROGRAM)
-
-#include "qglpickcolors_p.h"
-
-QT_BEGIN_NAMESPACE
-
-// The following tables are generated by the program listed at the
-// end of this source file.
-
-static int const pickColors[4096] = {
- 0xffffff, 0xff0000, 0x00ff00, 0x0000ff, 0xffff00, 0xff00ff, 0x00ffff,
- 0xff8000, 0x80ff00, 0x8000ff, 0xff0080, 0x0080ff, 0x00ff80, 0xff80ff,
- 0x80ffff, 0xffff80, 0x80ff80, 0xff8080, 0x8080ff, 0x808080, 0x800000,
- 0x008000, 0x000080, 0x808000, 0x800080, 0x008080, 0xff80c0, 0x80c0ff,
- 0xc0ff80, 0xffc080, 0x80ffc0, 0xc080ff, 0xffc000, 0xc0ff00, 0xc000ff,
- 0xff00c0, 0x00c0ff, 0x00ffc0, 0xffc0ff, 0xc0ffff, 0xffffc0, 0xc0ffc0,
- 0xffc0c0, 0xc0c0ff, 0x80c000, 0xc08000, 0xc00080, 0x8000c0, 0x00c080,
- 0x0080c0, 0x80c080, 0xc08080, 0x8080c0, 0xc080c0, 0x80c0c0, 0xc0c080,
- 0xc0c0c0, 0xc00000, 0x00c000, 0x0000c0, 0xc0c000, 0xc000c0, 0x00c0c0,
- 0xff8040, 0x8040ff, 0x40ff80, 0xff4080, 0x80ff40, 0x4080ff, 0xffc040,
- 0xc040ff, 0x40ffc0, 0xff40c0, 0xc0ff40, 0x40c0ff, 0xff4000, 0x40ff00,
- 0x4000ff, 0xff0040, 0x0040ff, 0x00ff40, 0xff40ff, 0x40ffff, 0xffff40,
- 0x40ff40, 0xff4040, 0x4040ff, 0x80c040, 0xc04080, 0x4080c0, 0x8040c0,
- 0xc08040, 0x40c080, 0x804000, 0x408000, 0x400080, 0x800040, 0x004080,
- 0x008040, 0x804080, 0x408080, 0x808040, 0x408040, 0x804040, 0x404080,
- 0xc04000, 0x40c000, 0x4000c0, 0xc00040, 0x0040c0, 0x00c040, 0xc040c0,
- 0x40c0c0, 0xc0c040, 0x40c040, 0xc04040, 0x4040c0, 0x404040, 0x400000,
- 0x004000, 0x000040, 0x404000, 0x400040, 0x004040, 0xff80e0, 0x80e0ff,
- 0xe0ff80, 0xffe080, 0x80ffe0, 0xe080ff, 0xffc0e0, 0xc0e0ff, 0xe0ffc0,
- 0xffe0c0, 0xc0ffe0, 0xe0c0ff, 0xff40e0, 0x40e0ff, 0xe0ff40, 0xffe040,
- 0x40ffe0, 0xe040ff, 0xffe000, 0xe0ff00, 0xe000ff, 0xff00e0, 0x00e0ff,
- 0x00ffe0, 0xffe0ff, 0xe0ffff, 0xffffe0, 0xe0ffe0, 0xffe0e0, 0xe0e0ff,
- 0x80c0e0, 0xc0e080, 0xe080c0, 0x80e0c0, 0xc080e0, 0xe0c080, 0x8040e0,
- 0x40e080, 0xe08040, 0x80e040, 0x4080e0, 0xe04080, 0x80e000, 0xe08000,
- 0xe00080, 0x8000e0, 0x00e080, 0x0080e0, 0x80e080, 0xe08080, 0x8080e0,
- 0xe080e0, 0x80e0e0, 0xe0e080, 0xc040e0, 0x40e0c0, 0xe0c040, 0xc0e040,
- 0x40c0e0, 0xe040c0, 0xc0e000, 0xe0c000, 0xe000c0, 0xc000e0, 0x00e0c0,
- 0x00c0e0, 0xc0e0c0, 0xe0c0c0, 0xc0c0e0, 0xe0c0e0, 0xc0e0e0, 0xe0e0c0,
- 0x40e000, 0xe04000, 0xe00040, 0x4000e0, 0x00e040, 0x0040e0, 0x40e040,
- 0xe04040, 0x4040e0, 0xe040e0, 0x40e0e0, 0xe0e040, 0xe0e0e0, 0xe00000,
- 0x00e000, 0x0000e0, 0xe0e000, 0xe000e0, 0x00e0e0, 0xff8060, 0x8060ff,
- 0x60ff80, 0xff6080, 0x80ff60, 0x6080ff, 0xffc060, 0xc060ff, 0x60ffc0,
- 0xff60c0, 0xc0ff60, 0x60c0ff, 0xff4060, 0x4060ff, 0x60ff40, 0xff6040,
- 0x40ff60, 0x6040ff, 0xffe060, 0xe060ff, 0x60ffe0, 0xff60e0, 0xe0ff60,
- 0x60e0ff, 0xff6000, 0x60ff00, 0x6000ff, 0xff0060, 0x0060ff, 0x00ff60,
- 0xff60ff, 0x60ffff, 0xffff60, 0x60ff60, 0xff6060, 0x6060ff, 0x80c060,
- 0xc06080, 0x6080c0, 0x8060c0, 0xc08060, 0x60c080, 0x804060, 0x406080,
- 0x608040, 0x806040, 0x408060, 0x604080, 0x80e060, 0xe06080, 0x6080e0,
- 0x8060e0, 0xe08060, 0x60e080, 0x806000, 0x608000, 0x600080, 0x800060,
- 0x006080, 0x008060, 0x806080, 0x608080, 0x808060, 0x608060, 0x806060,
- 0x606080, 0xc04060, 0x4060c0, 0x60c040, 0xc06040, 0x40c060, 0x6040c0,
- 0xc0e060, 0xe060c0, 0x60c0e0, 0xc060e0, 0xe0c060, 0x60e0c0, 0xc06000,
- 0x60c000, 0x6000c0, 0xc00060, 0x0060c0, 0x00c060, 0xc060c0, 0x60c0c0,
- 0xc0c060, 0x60c060, 0xc06060, 0x6060c0, 0x40e060, 0xe06040, 0x6040e0,
- 0x4060e0, 0xe04060, 0x60e040, 0x406000, 0x604000, 0x600040, 0x400060,
- 0x006040, 0x004060, 0x406040, 0x604040, 0x404060, 0x604060, 0x406060,
- 0x606040, 0xe06000, 0x60e000, 0x6000e0, 0xe00060, 0x0060e0, 0x00e060,
- 0xe060e0, 0x60e0e0, 0xe0e060, 0x60e060, 0xe06060, 0x6060e0, 0x606060,
- 0x600000, 0x006000, 0x000060, 0x606000, 0x600060, 0x006060, 0xff80a0,
- 0x80a0ff, 0xa0ff80, 0xffa080, 0x80ffa0, 0xa080ff, 0xffc0a0, 0xc0a0ff,
- 0xa0ffc0, 0xffa0c0, 0xc0ffa0, 0xa0c0ff, 0xff40a0, 0x40a0ff, 0xa0ff40,
- 0xffa040, 0x40ffa0, 0xa040ff, 0xffe0a0, 0xe0a0ff, 0xa0ffe0, 0xffa0e0,
- 0xe0ffa0, 0xa0e0ff, 0xff60a0, 0x60a0ff, 0xa0ff60, 0xffa060, 0x60ffa0,
- 0xa060ff, 0xffa000, 0xa0ff00, 0xa000ff, 0xff00a0, 0x00a0ff, 0x00ffa0,
- 0xffa0ff, 0xa0ffff, 0xffffa0, 0xa0ffa0, 0xffa0a0, 0xa0a0ff, 0x80c0a0,
- 0xc0a080, 0xa080c0, 0x80a0c0, 0xc080a0, 0xa0c080, 0x8040a0, 0x40a080,
- 0xa08040, 0x80a040, 0x4080a0, 0xa04080, 0x80e0a0, 0xe0a080, 0xa080e0,
- 0x80a0e0, 0xe080a0, 0xa0e080, 0x8060a0, 0x60a080, 0xa08060, 0x80a060,
- 0x6080a0, 0xa06080, 0x80a000, 0xa08000, 0xa00080, 0x8000a0, 0x00a080,
- 0x0080a0, 0x80a080, 0xa08080, 0x8080a0, 0xa080a0, 0x80a0a0, 0xa0a080,
- 0xc040a0, 0x40a0c0, 0xa0c040, 0xc0a040, 0x40c0a0, 0xa040c0, 0xc0e0a0,
- 0xe0a0c0, 0xa0c0e0, 0xc0a0e0, 0xe0c0a0, 0xa0e0c0, 0xc060a0, 0x60a0c0,
- 0xa0c060, 0xc0a060, 0x60c0a0, 0xa060c0, 0xc0a000, 0xa0c000, 0xa000c0,
- 0xc000a0, 0x00a0c0, 0x00c0a0, 0xc0a0c0, 0xa0c0c0, 0xc0c0a0, 0xa0c0a0,
- 0xc0a0a0, 0xa0a0c0, 0x40e0a0, 0xe0a040, 0xa040e0, 0x40a0e0, 0xe040a0,
- 0xa0e040, 0x4060a0, 0x60a040, 0xa04060, 0x40a060, 0x6040a0, 0xa06040,
- 0x40a000, 0xa04000, 0xa00040, 0x4000a0, 0x00a040, 0x0040a0, 0x40a040,
- 0xa04040, 0x4040a0, 0xa040a0, 0x40a0a0, 0xa0a040, 0xe060a0, 0x60a0e0,
- 0xa0e060, 0xe0a060, 0x60e0a0, 0xa060e0, 0xe0a000, 0xa0e000, 0xa000e0,
- 0xe000a0, 0x00a0e0, 0x00e0a0, 0xe0a0e0, 0xa0e0e0, 0xe0e0a0, 0xa0e0a0,
- 0xe0a0a0, 0xa0a0e0, 0x60a000, 0xa06000, 0xa00060, 0x6000a0, 0x00a060,
- 0x0060a0, 0x60a060, 0xa06060, 0x6060a0, 0xa060a0, 0x60a0a0, 0xa0a060,
- 0xa0a0a0, 0xa00000, 0x00a000, 0x0000a0, 0xa0a000, 0xa000a0, 0x00a0a0,
- 0xff8020, 0x8020ff, 0x20ff80, 0xff2080, 0x80ff20, 0x2080ff, 0xffc020,
- 0xc020ff, 0x20ffc0, 0xff20c0, 0xc0ff20, 0x20c0ff, 0xff4020, 0x4020ff,
- 0x20ff40, 0xff2040, 0x40ff20, 0x2040ff, 0xffe020, 0xe020ff, 0x20ffe0,
- 0xff20e0, 0xe0ff20, 0x20e0ff, 0xff6020, 0x6020ff, 0x20ff60, 0xff2060,
- 0x60ff20, 0x2060ff, 0xffa020, 0xa020ff, 0x20ffa0, 0xff20a0, 0xa0ff20,
- 0x20a0ff, 0xff2000, 0x20ff00, 0x2000ff, 0xff0020, 0x0020ff, 0x00ff20,
- 0xff20ff, 0x20ffff, 0xffff20, 0x20ff20, 0xff2020, 0x2020ff, 0x80c020,
- 0xc02080, 0x2080c0, 0x8020c0, 0xc08020, 0x20c080, 0x804020, 0x402080,
- 0x208040, 0x802040, 0x408020, 0x204080, 0x80e020, 0xe02080, 0x2080e0,
- 0x8020e0, 0xe08020, 0x20e080, 0x806020, 0x602080, 0x208060, 0x802060,
- 0x608020, 0x206080, 0x80a020, 0xa02080, 0x2080a0, 0x8020a0, 0xa08020,
- 0x20a080, 0x802000, 0x208000, 0x200080, 0x800020, 0x002080, 0x008020,
- 0x802080, 0x208080, 0x808020, 0x208020, 0x802020, 0x202080, 0xc04020,
- 0x4020c0, 0x20c040, 0xc02040, 0x40c020, 0x2040c0, 0xc0e020, 0xe020c0,
- 0x20c0e0, 0xc020e0, 0xe0c020, 0x20e0c0, 0xc06020, 0x6020c0, 0x20c060,
- 0xc02060, 0x60c020, 0x2060c0, 0xc0a020, 0xa020c0, 0x20c0a0, 0xc020a0,
- 0xa0c020, 0x20a0c0, 0xc02000, 0x20c000, 0x2000c0, 0xc00020, 0x0020c0,
- 0x00c020, 0xc020c0, 0x20c0c0, 0xc0c020, 0x20c020, 0xc02020, 0x2020c0,
- 0x40e020, 0xe02040, 0x2040e0, 0x4020e0, 0xe04020, 0x20e040, 0x406020,
- 0x602040, 0x204060, 0x402060, 0x604020, 0x206040, 0x40a020, 0xa02040,
- 0x2040a0, 0x4020a0, 0xa04020, 0x20a040, 0x402000, 0x204000, 0x200040,
- 0x400020, 0x002040, 0x004020, 0x402040, 0x204040, 0x404020, 0x204020,
- 0x402020, 0x202040, 0xe06020, 0x6020e0, 0x20e060, 0xe02060, 0x60e020,
- 0x2060e0, 0xe0a020, 0xa020e0, 0x20e0a0, 0xe020a0, 0xa0e020, 0x20a0e0,
- 0xe02000, 0x20e000, 0x2000e0, 0xe00020, 0x0020e0, 0x00e020, 0xe020e0,
- 0x20e0e0, 0xe0e020, 0x20e020, 0xe02020, 0x2020e0, 0x60a020, 0xa02060,
- 0x2060a0, 0x6020a0, 0xa06020, 0x20a060, 0x602000, 0x206000, 0x200060,
- 0x600020, 0x002060, 0x006020, 0x602060, 0x206060, 0x606020, 0x206020,
- 0x602020, 0x202060, 0xa02000, 0x20a000, 0x2000a0, 0xa00020, 0x0020a0,
- 0x00a020, 0xa020a0, 0x20a0a0, 0xa0a020, 0x20a020, 0xa02020, 0x2020a0,
- 0x202020, 0x200000, 0x002000, 0x000020, 0x202000, 0x200020, 0x002020,
- 0xff80f0, 0x80f0ff, 0xf0ff80, 0xfff080, 0x80fff0, 0xf080ff, 0xffc0f0,
- 0xc0f0ff, 0xf0ffc0, 0xfff0c0, 0xc0fff0, 0xf0c0ff, 0xff40f0, 0x40f0ff,
- 0xf0ff40, 0xfff040, 0x40fff0, 0xf040ff, 0xffe0f0, 0xe0f0ff, 0xf0ffe0,
- 0xfff0e0, 0xe0fff0, 0xf0e0ff, 0xff60f0, 0x60f0ff, 0xf0ff60, 0xfff060,
- 0x60fff0, 0xf060ff, 0xffa0f0, 0xa0f0ff, 0xf0ffa0, 0xfff0a0, 0xa0fff0,
- 0xf0a0ff, 0xff20f0, 0x20f0ff, 0xf0ff20, 0xfff020, 0x20fff0, 0xf020ff,
- 0xfff000, 0xf0ff00, 0xf000ff, 0xff00f0, 0x00f0ff, 0x00fff0, 0xfff0ff,
- 0xf0ffff, 0xfffff0, 0xf0fff0, 0xfff0f0, 0xf0f0ff, 0x80c0f0, 0xc0f080,
- 0xf080c0, 0x80f0c0, 0xc080f0, 0xf0c080, 0x8040f0, 0x40f080, 0xf08040,
- 0x80f040, 0x4080f0, 0xf04080, 0x80e0f0, 0xe0f080, 0xf080e0, 0x80f0e0,
- 0xe080f0, 0xf0e080, 0x8060f0, 0x60f080, 0xf08060, 0x80f060, 0x6080f0,
- 0xf06080, 0x80a0f0, 0xa0f080, 0xf080a0, 0x80f0a0, 0xa080f0, 0xf0a080,
- 0x8020f0, 0x20f080, 0xf08020, 0x80f020, 0x2080f0, 0xf02080, 0x80f000,
- 0xf08000, 0xf00080, 0x8000f0, 0x00f080, 0x0080f0, 0x80f080, 0xf08080,
- 0x8080f0, 0xf080f0, 0x80f0f0, 0xf0f080, 0xc040f0, 0x40f0c0, 0xf0c040,
- 0xc0f040, 0x40c0f0, 0xf040c0, 0xc0e0f0, 0xe0f0c0, 0xf0c0e0, 0xc0f0e0,
- 0xe0c0f0, 0xf0e0c0, 0xc060f0, 0x60f0c0, 0xf0c060, 0xc0f060, 0x60c0f0,
- 0xf060c0, 0xc0a0f0, 0xa0f0c0, 0xf0c0a0, 0xc0f0a0, 0xa0c0f0, 0xf0a0c0,
- 0xc020f0, 0x20f0c0, 0xf0c020, 0xc0f020, 0x20c0f0, 0xf020c0, 0xc0f000,
- 0xf0c000, 0xf000c0, 0xc000f0, 0x00f0c0, 0x00c0f0, 0xc0f0c0, 0xf0c0c0,
- 0xc0c0f0, 0xf0c0f0, 0xc0f0f0, 0xf0f0c0, 0x40e0f0, 0xe0f040, 0xf040e0,
- 0x40f0e0, 0xe040f0, 0xf0e040, 0x4060f0, 0x60f040, 0xf04060, 0x40f060,
- 0x6040f0, 0xf06040, 0x40a0f0, 0xa0f040, 0xf040a0, 0x40f0a0, 0xa040f0,
- 0xf0a040, 0x4020f0, 0x20f040, 0xf04020, 0x40f020, 0x2040f0, 0xf02040,
- 0x40f000, 0xf04000, 0xf00040, 0x4000f0, 0x00f040, 0x0040f0, 0x40f040,
- 0xf04040, 0x4040f0, 0xf040f0, 0x40f0f0, 0xf0f040, 0xe060f0, 0x60f0e0,
- 0xf0e060, 0xe0f060, 0x60e0f0, 0xf060e0, 0xe0a0f0, 0xa0f0e0, 0xf0e0a0,
- 0xe0f0a0, 0xa0e0f0, 0xf0a0e0, 0xe020f0, 0x20f0e0, 0xf0e020, 0xe0f020,
- 0x20e0f0, 0xf020e0, 0xe0f000, 0xf0e000, 0xf000e0, 0xe000f0, 0x00f0e0,
- 0x00e0f0, 0xe0f0e0, 0xf0e0e0, 0xe0e0f0, 0xf0e0f0, 0xe0f0f0, 0xf0f0e0,
- 0x60a0f0, 0xa0f060, 0xf060a0, 0x60f0a0, 0xa060f0, 0xf0a060, 0x6020f0,
- 0x20f060, 0xf06020, 0x60f020, 0x2060f0, 0xf02060, 0x60f000, 0xf06000,
- 0xf00060, 0x6000f0, 0x00f060, 0x0060f0, 0x60f060, 0xf06060, 0x6060f0,
- 0xf060f0, 0x60f0f0, 0xf0f060, 0xa020f0, 0x20f0a0, 0xf0a020, 0xa0f020,
- 0x20a0f0, 0xf020a0, 0xa0f000, 0xf0a000, 0xf000a0, 0xa000f0, 0x00f0a0,
- 0x00a0f0, 0xa0f0a0, 0xf0a0a0, 0xa0a0f0, 0xf0a0f0, 0xa0f0f0, 0xf0f0a0,
- 0x20f000, 0xf02000, 0xf00020, 0x2000f0, 0x00f020, 0x0020f0, 0x20f020,
- 0xf02020, 0x2020f0, 0xf020f0, 0x20f0f0, 0xf0f020, 0xf0f0f0, 0xf00000,
- 0x00f000, 0x0000f0, 0xf0f000, 0xf000f0, 0x00f0f0, 0xff80b0, 0x80b0ff,
- 0xb0ff80, 0xffb080, 0x80ffb0, 0xb080ff, 0xffc0b0, 0xc0b0ff, 0xb0ffc0,
- 0xffb0c0, 0xc0ffb0, 0xb0c0ff, 0xff40b0, 0x40b0ff, 0xb0ff40, 0xffb040,
- 0x40ffb0, 0xb040ff, 0xffe0b0, 0xe0b0ff, 0xb0ffe0, 0xffb0e0, 0xe0ffb0,
- 0xb0e0ff, 0xff60b0, 0x60b0ff, 0xb0ff60, 0xffb060, 0x60ffb0, 0xb060ff,
- 0xffa0b0, 0xa0b0ff, 0xb0ffa0, 0xffb0a0, 0xa0ffb0, 0xb0a0ff, 0xff20b0,
- 0x20b0ff, 0xb0ff20, 0xffb020, 0x20ffb0, 0xb020ff, 0xfff0b0, 0xf0b0ff,
- 0xb0fff0, 0xffb0f0, 0xf0ffb0, 0xb0f0ff, 0xffb000, 0xb0ff00, 0xb000ff,
- 0xff00b0, 0x00b0ff, 0x00ffb0, 0xffb0ff, 0xb0ffff, 0xffffb0, 0xb0ffb0,
- 0xffb0b0, 0xb0b0ff, 0x80c0b0, 0xc0b080, 0xb080c0, 0x80b0c0, 0xc080b0,
- 0xb0c080, 0x8040b0, 0x40b080, 0xb08040, 0x80b040, 0x4080b0, 0xb04080,
- 0x80e0b0, 0xe0b080, 0xb080e0, 0x80b0e0, 0xe080b0, 0xb0e080, 0x8060b0,
- 0x60b080, 0xb08060, 0x80b060, 0x6080b0, 0xb06080, 0x80a0b0, 0xa0b080,
- 0xb080a0, 0x80b0a0, 0xa080b0, 0xb0a080, 0x8020b0, 0x20b080, 0xb08020,
- 0x80b020, 0x2080b0, 0xb02080, 0x80f0b0, 0xf0b080, 0xb080f0, 0x80b0f0,
- 0xf080b0, 0xb0f080, 0x80b000, 0xb08000, 0xb00080, 0x8000b0, 0x00b080,
- 0x0080b0, 0x80b080, 0xb08080, 0x8080b0, 0xb080b0, 0x80b0b0, 0xb0b080,
- 0xc040b0, 0x40b0c0, 0xb0c040, 0xc0b040, 0x40c0b0, 0xb040c0, 0xc0e0b0,
- 0xe0b0c0, 0xb0c0e0, 0xc0b0e0, 0xe0c0b0, 0xb0e0c0, 0xc060b0, 0x60b0c0,
- 0xb0c060, 0xc0b060, 0x60c0b0, 0xb060c0, 0xc0a0b0, 0xa0b0c0, 0xb0c0a0,
- 0xc0b0a0, 0xa0c0b0, 0xb0a0c0, 0xc020b0, 0x20b0c0, 0xb0c020, 0xc0b020,
- 0x20c0b0, 0xb020c0, 0xc0f0b0, 0xf0b0c0, 0xb0c0f0, 0xc0b0f0, 0xf0c0b0,
- 0xb0f0c0, 0xc0b000, 0xb0c000, 0xb000c0, 0xc000b0, 0x00b0c0, 0x00c0b0,
- 0xc0b0c0, 0xb0c0c0, 0xc0c0b0, 0xb0c0b0, 0xc0b0b0, 0xb0b0c0, 0x40e0b0,
- 0xe0b040, 0xb040e0, 0x40b0e0, 0xe040b0, 0xb0e040, 0x4060b0, 0x60b040,
- 0xb04060, 0x40b060, 0x6040b0, 0xb06040, 0x40a0b0, 0xa0b040, 0xb040a0,
- 0x40b0a0, 0xa040b0, 0xb0a040, 0x4020b0, 0x20b040, 0xb04020, 0x40b020,
- 0x2040b0, 0xb02040, 0x40f0b0, 0xf0b040, 0xb040f0, 0x40b0f0, 0xf040b0,
- 0xb0f040, 0x40b000, 0xb04000, 0xb00040, 0x4000b0, 0x00b040, 0x0040b0,
- 0x40b040, 0xb04040, 0x4040b0, 0xb040b0, 0x40b0b0, 0xb0b040, 0xe060b0,
- 0x60b0e0, 0xb0e060, 0xe0b060, 0x60e0b0, 0xb060e0, 0xe0a0b0, 0xa0b0e0,
- 0xb0e0a0, 0xe0b0a0, 0xa0e0b0, 0xb0a0e0, 0xe020b0, 0x20b0e0, 0xb0e020,
- 0xe0b020, 0x20e0b0, 0xb020e0, 0xe0f0b0, 0xf0b0e0, 0xb0e0f0, 0xe0b0f0,
- 0xf0e0b0, 0xb0f0e0, 0xe0b000, 0xb0e000, 0xb000e0, 0xe000b0, 0x00b0e0,
- 0x00e0b0, 0xe0b0e0, 0xb0e0e0, 0xe0e0b0, 0xb0e0b0, 0xe0b0b0, 0xb0b0e0,
- 0x60a0b0, 0xa0b060, 0xb060a0, 0x60b0a0, 0xa060b0, 0xb0a060, 0x6020b0,
- 0x20b060, 0xb06020, 0x60b020, 0x2060b0, 0xb02060, 0x60f0b0, 0xf0b060,
- 0xb060f0, 0x60b0f0, 0xf060b0, 0xb0f060, 0x60b000, 0xb06000, 0xb00060,
- 0x6000b0, 0x00b060, 0x0060b0, 0x60b060, 0xb06060, 0x6060b0, 0xb060b0,
- 0x60b0b0, 0xb0b060, 0xa020b0, 0x20b0a0, 0xb0a020, 0xa0b020, 0x20a0b0,
- 0xb020a0, 0xa0f0b0, 0xf0b0a0, 0xb0a0f0, 0xa0b0f0, 0xf0a0b0, 0xb0f0a0,
- 0xa0b000, 0xb0a000, 0xb000a0, 0xa000b0, 0x00b0a0, 0x00a0b0, 0xa0b0a0,
- 0xb0a0a0, 0xa0a0b0, 0xb0a0b0, 0xa0b0b0, 0xb0b0a0, 0x20f0b0, 0xf0b020,
- 0xb020f0, 0x20b0f0, 0xf020b0, 0xb0f020, 0x20b000, 0xb02000, 0xb00020,
- 0x2000b0, 0x00b020, 0x0020b0, 0x20b020, 0xb02020, 0x2020b0, 0xb020b0,
- 0x20b0b0, 0xb0b020, 0xf0b000, 0xb0f000, 0xb000f0, 0xf000b0, 0x00b0f0,
- 0x00f0b0, 0xf0b0f0, 0xb0f0f0, 0xf0f0b0, 0xb0f0b0, 0xf0b0b0, 0xb0b0f0,
- 0xb0b0b0, 0xb00000, 0x00b000, 0x0000b0, 0xb0b000, 0xb000b0, 0x00b0b0,
- 0xff8050, 0x8050ff, 0x50ff80, 0xff5080, 0x80ff50, 0x5080ff, 0xffc050,
- 0xc050ff, 0x50ffc0, 0xff50c0, 0xc0ff50, 0x50c0ff, 0xff4050, 0x4050ff,
- 0x50ff40, 0xff5040, 0x40ff50, 0x5040ff, 0xffe050, 0xe050ff, 0x50ffe0,
- 0xff50e0, 0xe0ff50, 0x50e0ff, 0xff6050, 0x6050ff, 0x50ff60, 0xff5060,
- 0x60ff50, 0x5060ff, 0xffa050, 0xa050ff, 0x50ffa0, 0xff50a0, 0xa0ff50,
- 0x50a0ff, 0xff2050, 0x2050ff, 0x50ff20, 0xff5020, 0x20ff50, 0x5020ff,
- 0xfff050, 0xf050ff, 0x50fff0, 0xff50f0, 0xf0ff50, 0x50f0ff, 0xffb050,
- 0xb050ff, 0x50ffb0, 0xff50b0, 0xb0ff50, 0x50b0ff, 0xff5000, 0x50ff00,
- 0x5000ff, 0xff0050, 0x0050ff, 0x00ff50, 0xff50ff, 0x50ffff, 0xffff50,
- 0x50ff50, 0xff5050, 0x5050ff, 0x80c050, 0xc05080, 0x5080c0, 0x8050c0,
- 0xc08050, 0x50c080, 0x804050, 0x405080, 0x508040, 0x805040, 0x408050,
- 0x504080, 0x80e050, 0xe05080, 0x5080e0, 0x8050e0, 0xe08050, 0x50e080,
- 0x806050, 0x605080, 0x508060, 0x805060, 0x608050, 0x506080, 0x80a050,
- 0xa05080, 0x5080a0, 0x8050a0, 0xa08050, 0x50a080, 0x802050, 0x205080,
- 0x508020, 0x805020, 0x208050, 0x502080, 0x80f050, 0xf05080, 0x5080f0,
- 0x8050f0, 0xf08050, 0x50f080, 0x80b050, 0xb05080, 0x5080b0, 0x8050b0,
- 0xb08050, 0x50b080, 0x805000, 0x508000, 0x500080, 0x800050, 0x005080,
- 0x008050, 0x805080, 0x508080, 0x808050, 0x508050, 0x805050, 0x505080,
- 0xc04050, 0x4050c0, 0x50c040, 0xc05040, 0x40c050, 0x5040c0, 0xc0e050,
- 0xe050c0, 0x50c0e0, 0xc050e0, 0xe0c050, 0x50e0c0, 0xc06050, 0x6050c0,
- 0x50c060, 0xc05060, 0x60c050, 0x5060c0, 0xc0a050, 0xa050c0, 0x50c0a0,
- 0xc050a0, 0xa0c050, 0x50a0c0, 0xc02050, 0x2050c0, 0x50c020, 0xc05020,
- 0x20c050, 0x5020c0, 0xc0f050, 0xf050c0, 0x50c0f0, 0xc050f0, 0xf0c050,
- 0x50f0c0, 0xc0b050, 0xb050c0, 0x50c0b0, 0xc050b0, 0xb0c050, 0x50b0c0,
- 0xc05000, 0x50c000, 0x5000c0, 0xc00050, 0x0050c0, 0x00c050, 0xc050c0,
- 0x50c0c0, 0xc0c050, 0x50c050, 0xc05050, 0x5050c0, 0x40e050, 0xe05040,
- 0x5040e0, 0x4050e0, 0xe04050, 0x50e040, 0x406050, 0x605040, 0x504060,
- 0x405060, 0x604050, 0x506040, 0x40a050, 0xa05040, 0x5040a0, 0x4050a0,
- 0xa04050, 0x50a040, 0x402050, 0x205040, 0x504020, 0x405020, 0x204050,
- 0x502040, 0x40f050, 0xf05040, 0x5040f0, 0x4050f0, 0xf04050, 0x50f040,
- 0x40b050, 0xb05040, 0x5040b0, 0x4050b0, 0xb04050, 0x50b040, 0x405000,
- 0x504000, 0x500040, 0x400050, 0x005040, 0x004050, 0x405040, 0x504040,
- 0x404050, 0x504050, 0x405050, 0x505040, 0xe06050, 0x6050e0, 0x50e060,
- 0xe05060, 0x60e050, 0x5060e0, 0xe0a050, 0xa050e0, 0x50e0a0, 0xe050a0,
- 0xa0e050, 0x50a0e0, 0xe02050, 0x2050e0, 0x50e020, 0xe05020, 0x20e050,
- 0x5020e0, 0xe0f050, 0xf050e0, 0x50e0f0, 0xe050f0, 0xf0e050, 0x50f0e0,
- 0xe0b050, 0xb050e0, 0x50e0b0, 0xe050b0, 0xb0e050, 0x50b0e0, 0xe05000,
- 0x50e000, 0x5000e0, 0xe00050, 0x0050e0, 0x00e050, 0xe050e0, 0x50e0e0,
- 0xe0e050, 0x50e050, 0xe05050, 0x5050e0, 0x60a050, 0xa05060, 0x5060a0,
- 0x6050a0, 0xa06050, 0x50a060, 0x602050, 0x205060, 0x506020, 0x605020,
- 0x206050, 0x502060, 0x60f050, 0xf05060, 0x5060f0, 0x6050f0, 0xf06050,
- 0x50f060, 0x60b050, 0xb05060, 0x5060b0, 0x6050b0, 0xb06050, 0x50b060,
- 0x605000, 0x506000, 0x500060, 0x600050, 0x005060, 0x006050, 0x605060,
- 0x506060, 0x606050, 0x506050, 0x605050, 0x505060, 0xa02050, 0x2050a0,
- 0x50a020, 0xa05020, 0x20a050, 0x5020a0, 0xa0f050, 0xf050a0, 0x50a0f0,
- 0xa050f0, 0xf0a050, 0x50f0a0, 0xa0b050, 0xb050a0, 0x50a0b0, 0xa050b0,
- 0xb0a050, 0x50b0a0, 0xa05000, 0x50a000, 0x5000a0, 0xa00050, 0x0050a0,
- 0x00a050, 0xa050a0, 0x50a0a0, 0xa0a050, 0x50a050, 0xa05050, 0x5050a0,
- 0x20f050, 0xf05020, 0x5020f0, 0x2050f0, 0xf02050, 0x50f020, 0x20b050,
- 0xb05020, 0x5020b0, 0x2050b0, 0xb02050, 0x50b020, 0x205000, 0x502000,
- 0x500020, 0x200050, 0x005020, 0x002050, 0x205020, 0x502020, 0x202050,
- 0x502050, 0x205050, 0x505020, 0xf0b050, 0xb050f0, 0x50f0b0, 0xf050b0,
- 0xb0f050, 0x50b0f0, 0xf05000, 0x50f000, 0x5000f0, 0xf00050, 0x0050f0,
- 0x00f050, 0xf050f0, 0x50f0f0, 0xf0f050, 0x50f050, 0xf05050, 0x5050f0,
- 0xb05000, 0x50b000, 0x5000b0, 0xb00050, 0x0050b0, 0x00b050, 0xb050b0,
- 0x50b0b0, 0xb0b050, 0x50b050, 0xb05050, 0x5050b0, 0x505050, 0x500000,
- 0x005000, 0x000050, 0x505000, 0x500050, 0x005050, 0xff80d0, 0x80d0ff,
- 0xd0ff80, 0xffd080, 0x80ffd0, 0xd080ff, 0xffc0d0, 0xc0d0ff, 0xd0ffc0,
- 0xffd0c0, 0xc0ffd0, 0xd0c0ff, 0xff40d0, 0x40d0ff, 0xd0ff40, 0xffd040,
- 0x40ffd0, 0xd040ff, 0xffe0d0, 0xe0d0ff, 0xd0ffe0, 0xffd0e0, 0xe0ffd0,
- 0xd0e0ff, 0xff60d0, 0x60d0ff, 0xd0ff60, 0xffd060, 0x60ffd0, 0xd060ff,
- 0xffa0d0, 0xa0d0ff, 0xd0ffa0, 0xffd0a0, 0xa0ffd0, 0xd0a0ff, 0xff20d0,
- 0x20d0ff, 0xd0ff20, 0xffd020, 0x20ffd0, 0xd020ff, 0xfff0d0, 0xf0d0ff,
- 0xd0fff0, 0xffd0f0, 0xf0ffd0, 0xd0f0ff, 0xffb0d0, 0xb0d0ff, 0xd0ffb0,
- 0xffd0b0, 0xb0ffd0, 0xd0b0ff, 0xff50d0, 0x50d0ff, 0xd0ff50, 0xffd050,
- 0x50ffd0, 0xd050ff, 0xffd000, 0xd0ff00, 0xd000ff, 0xff00d0, 0x00d0ff,
- 0x00ffd0, 0xffd0ff, 0xd0ffff, 0xffffd0, 0xd0ffd0, 0xffd0d0, 0xd0d0ff,
- 0x80c0d0, 0xc0d080, 0xd080c0, 0x80d0c0, 0xc080d0, 0xd0c080, 0x8040d0,
- 0x40d080, 0xd08040, 0x80d040, 0x4080d0, 0xd04080, 0x80e0d0, 0xe0d080,
- 0xd080e0, 0x80d0e0, 0xe080d0, 0xd0e080, 0x8060d0, 0x60d080, 0xd08060,
- 0x80d060, 0x6080d0, 0xd06080, 0x80a0d0, 0xa0d080, 0xd080a0, 0x80d0a0,
- 0xa080d0, 0xd0a080, 0x8020d0, 0x20d080, 0xd08020, 0x80d020, 0x2080d0,
- 0xd02080, 0x80f0d0, 0xf0d080, 0xd080f0, 0x80d0f0, 0xf080d0, 0xd0f080,
- 0x80b0d0, 0xb0d080, 0xd080b0, 0x80d0b0, 0xb080d0, 0xd0b080, 0x8050d0,
- 0x50d080, 0xd08050, 0x80d050, 0x5080d0, 0xd05080, 0x80d000, 0xd08000,
- 0xd00080, 0x8000d0, 0x00d080, 0x0080d0, 0x80d080, 0xd08080, 0x8080d0,
- 0xd080d0, 0x80d0d0, 0xd0d080, 0xc040d0, 0x40d0c0, 0xd0c040, 0xc0d040,
- 0x40c0d0, 0xd040c0, 0xc0e0d0, 0xe0d0c0, 0xd0c0e0, 0xc0d0e0, 0xe0c0d0,
- 0xd0e0c0, 0xc060d0, 0x60d0c0, 0xd0c060, 0xc0d060, 0x60c0d0, 0xd060c0,
- 0xc0a0d0, 0xa0d0c0, 0xd0c0a0, 0xc0d0a0, 0xa0c0d0, 0xd0a0c0, 0xc020d0,
- 0x20d0c0, 0xd0c020, 0xc0d020, 0x20c0d0, 0xd020c0, 0xc0f0d0, 0xf0d0c0,
- 0xd0c0f0, 0xc0d0f0, 0xf0c0d0, 0xd0f0c0, 0xc0b0d0, 0xb0d0c0, 0xd0c0b0,
- 0xc0d0b0, 0xb0c0d0, 0xd0b0c0, 0xc050d0, 0x50d0c0, 0xd0c050, 0xc0d050,
- 0x50c0d0, 0xd050c0, 0xc0d000, 0xd0c000, 0xd000c0, 0xc000d0, 0x00d0c0,
- 0x00c0d0, 0xc0d0c0, 0xd0c0c0, 0xc0c0d0, 0xd0c0d0, 0xc0d0d0, 0xd0d0c0,
- 0x40e0d0, 0xe0d040, 0xd040e0, 0x40d0e0, 0xe040d0, 0xd0e040, 0x4060d0,
- 0x60d040, 0xd04060, 0x40d060, 0x6040d0, 0xd06040, 0x40a0d0, 0xa0d040,
- 0xd040a0, 0x40d0a0, 0xa040d0, 0xd0a040, 0x4020d0, 0x20d040, 0xd04020,
- 0x40d020, 0x2040d0, 0xd02040, 0x40f0d0, 0xf0d040, 0xd040f0, 0x40d0f0,
- 0xf040d0, 0xd0f040, 0x40b0d0, 0xb0d040, 0xd040b0, 0x40d0b0, 0xb040d0,
- 0xd0b040, 0x4050d0, 0x50d040, 0xd04050, 0x40d050, 0x5040d0, 0xd05040,
- 0x40d000, 0xd04000, 0xd00040, 0x4000d0, 0x00d040, 0x0040d0, 0x40d040,
- 0xd04040, 0x4040d0, 0xd040d0, 0x40d0d0, 0xd0d040, 0xe060d0, 0x60d0e0,
- 0xd0e060, 0xe0d060, 0x60e0d0, 0xd060e0, 0xe0a0d0, 0xa0d0e0, 0xd0e0a0,
- 0xe0d0a0, 0xa0e0d0, 0xd0a0e0, 0xe020d0, 0x20d0e0, 0xd0e020, 0xe0d020,
- 0x20e0d0, 0xd020e0, 0xe0f0d0, 0xf0d0e0, 0xd0e0f0, 0xe0d0f0, 0xf0e0d0,
- 0xd0f0e0, 0xe0b0d0, 0xb0d0e0, 0xd0e0b0, 0xe0d0b0, 0xb0e0d0, 0xd0b0e0,
- 0xe050d0, 0x50d0e0, 0xd0e050, 0xe0d050, 0x50e0d0, 0xd050e0, 0xe0d000,
- 0xd0e000, 0xd000e0, 0xe000d0, 0x00d0e0, 0x00e0d0, 0xe0d0e0, 0xd0e0e0,
- 0xe0e0d0, 0xd0e0d0, 0xe0d0d0, 0xd0d0e0, 0x60a0d0, 0xa0d060, 0xd060a0,
- 0x60d0a0, 0xa060d0, 0xd0a060, 0x6020d0, 0x20d060, 0xd06020, 0x60d020,
- 0x2060d0, 0xd02060, 0x60f0d0, 0xf0d060, 0xd060f0, 0x60d0f0, 0xf060d0,
- 0xd0f060, 0x60b0d0, 0xb0d060, 0xd060b0, 0x60d0b0, 0xb060d0, 0xd0b060,
- 0x6050d0, 0x50d060, 0xd06050, 0x60d050, 0x5060d0, 0xd05060, 0x60d000,
- 0xd06000, 0xd00060, 0x6000d0, 0x00d060, 0x0060d0, 0x60d060, 0xd06060,
- 0x6060d0, 0xd060d0, 0x60d0d0, 0xd0d060, 0xa020d0, 0x20d0a0, 0xd0a020,
- 0xa0d020, 0x20a0d0, 0xd020a0, 0xa0f0d0, 0xf0d0a0, 0xd0a0f0, 0xa0d0f0,
- 0xf0a0d0, 0xd0f0a0, 0xa0b0d0, 0xb0d0a0, 0xd0a0b0, 0xa0d0b0, 0xb0a0d0,
- 0xd0b0a0, 0xa050d0, 0x50d0a0, 0xd0a050, 0xa0d050, 0x50a0d0, 0xd050a0,
- 0xa0d000, 0xd0a000, 0xd000a0, 0xa000d0, 0x00d0a0, 0x00a0d0, 0xa0d0a0,
- 0xd0a0a0, 0xa0a0d0, 0xd0a0d0, 0xa0d0d0, 0xd0d0a0, 0x20f0d0, 0xf0d020,
- 0xd020f0, 0x20d0f0, 0xf020d0, 0xd0f020, 0x20b0d0, 0xb0d020, 0xd020b0,
- 0x20d0b0, 0xb020d0, 0xd0b020, 0x2050d0, 0x50d020, 0xd02050, 0x20d050,
- 0x5020d0, 0xd05020, 0x20d000, 0xd02000, 0xd00020, 0x2000d0, 0x00d020,
- 0x0020d0, 0x20d020, 0xd02020, 0x2020d0, 0xd020d0, 0x20d0d0, 0xd0d020,
- 0xf0b0d0, 0xb0d0f0, 0xd0f0b0, 0xf0d0b0, 0xb0f0d0, 0xd0b0f0, 0xf050d0,
- 0x50d0f0, 0xd0f050, 0xf0d050, 0x50f0d0, 0xd050f0, 0xf0d000, 0xd0f000,
- 0xd000f0, 0xf000d0, 0x00d0f0, 0x00f0d0, 0xf0d0f0, 0xd0f0f0, 0xf0f0d0,
- 0xd0f0d0, 0xf0d0d0, 0xd0d0f0, 0xb050d0, 0x50d0b0, 0xd0b050, 0xb0d050,
- 0x50b0d0, 0xd050b0, 0xb0d000, 0xd0b000, 0xd000b0, 0xb000d0, 0x00d0b0,
- 0x00b0d0, 0xb0d0b0, 0xd0b0b0, 0xb0b0d0, 0xd0b0d0, 0xb0d0d0, 0xd0d0b0,
- 0x50d000, 0xd05000, 0xd00050, 0x5000d0, 0x00d050, 0x0050d0, 0x50d050,
- 0xd05050, 0x5050d0, 0xd050d0, 0x50d0d0, 0xd0d050, 0xd0d0d0, 0xd00000,
- 0x00d000, 0x0000d0, 0xd0d000, 0xd000d0, 0x00d0d0, 0xff8070, 0x8070ff,
- 0x70ff80, 0xff7080, 0x80ff70, 0x7080ff, 0xffc070, 0xc070ff, 0x70ffc0,
- 0xff70c0, 0xc0ff70, 0x70c0ff, 0xff4070, 0x4070ff, 0x70ff40, 0xff7040,
- 0x40ff70, 0x7040ff, 0xffe070, 0xe070ff, 0x70ffe0, 0xff70e0, 0xe0ff70,
- 0x70e0ff, 0xff6070, 0x6070ff, 0x70ff60, 0xff7060, 0x60ff70, 0x7060ff,
- 0xffa070, 0xa070ff, 0x70ffa0, 0xff70a0, 0xa0ff70, 0x70a0ff, 0xff2070,
- 0x2070ff, 0x70ff20, 0xff7020, 0x20ff70, 0x7020ff, 0xfff070, 0xf070ff,
- 0x70fff0, 0xff70f0, 0xf0ff70, 0x70f0ff, 0xffb070, 0xb070ff, 0x70ffb0,
- 0xff70b0, 0xb0ff70, 0x70b0ff, 0xff5070, 0x5070ff, 0x70ff50, 0xff7050,
- 0x50ff70, 0x7050ff, 0xffd070, 0xd070ff, 0x70ffd0, 0xff70d0, 0xd0ff70,
- 0x70d0ff, 0xff7000, 0x70ff00, 0x7000ff, 0xff0070, 0x0070ff, 0x00ff70,
- 0xff70ff, 0x70ffff, 0xffff70, 0x70ff70, 0xff7070, 0x7070ff, 0x80c070,
- 0xc07080, 0x7080c0, 0x8070c0, 0xc08070, 0x70c080, 0x804070, 0x407080,
- 0x708040, 0x807040, 0x408070, 0x704080, 0x80e070, 0xe07080, 0x7080e0,
- 0x8070e0, 0xe08070, 0x70e080, 0x806070, 0x607080, 0x708060, 0x807060,
- 0x608070, 0x706080, 0x80a070, 0xa07080, 0x7080a0, 0x8070a0, 0xa08070,
- 0x70a080, 0x802070, 0x207080, 0x708020, 0x807020, 0x208070, 0x702080,
- 0x80f070, 0xf07080, 0x7080f0, 0x8070f0, 0xf08070, 0x70f080, 0x80b070,
- 0xb07080, 0x7080b0, 0x8070b0, 0xb08070, 0x70b080, 0x805070, 0x507080,
- 0x708050, 0x807050, 0x508070, 0x705080, 0x80d070, 0xd07080, 0x7080d0,
- 0x8070d0, 0xd08070, 0x70d080, 0x807000, 0x708000, 0x700080, 0x800070,
- 0x007080, 0x008070, 0x807080, 0x708080, 0x808070, 0x708070, 0x807070,
- 0x707080, 0xc04070, 0x4070c0, 0x70c040, 0xc07040, 0x40c070, 0x7040c0,
- 0xc0e070, 0xe070c0, 0x70c0e0, 0xc070e0, 0xe0c070, 0x70e0c0, 0xc06070,
- 0x6070c0, 0x70c060, 0xc07060, 0x60c070, 0x7060c0, 0xc0a070, 0xa070c0,
- 0x70c0a0, 0xc070a0, 0xa0c070, 0x70a0c0, 0xc02070, 0x2070c0, 0x70c020,
- 0xc07020, 0x20c070, 0x7020c0, 0xc0f070, 0xf070c0, 0x70c0f0, 0xc070f0,
- 0xf0c070, 0x70f0c0, 0xc0b070, 0xb070c0, 0x70c0b0, 0xc070b0, 0xb0c070,
- 0x70b0c0, 0xc05070, 0x5070c0, 0x70c050, 0xc07050, 0x50c070, 0x7050c0,
- 0xc0d070, 0xd070c0, 0x70c0d0, 0xc070d0, 0xd0c070, 0x70d0c0, 0xc07000,
- 0x70c000, 0x7000c0, 0xc00070, 0x0070c0, 0x00c070, 0xc070c0, 0x70c0c0,
- 0xc0c070, 0x70c070, 0xc07070, 0x7070c0, 0x40e070, 0xe07040, 0x7040e0,
- 0x4070e0, 0xe04070, 0x70e040, 0x406070, 0x607040, 0x704060, 0x407060,
- 0x604070, 0x706040, 0x40a070, 0xa07040, 0x7040a0, 0x4070a0, 0xa04070,
- 0x70a040, 0x402070, 0x207040, 0x704020, 0x407020, 0x204070, 0x702040,
- 0x40f070, 0xf07040, 0x7040f0, 0x4070f0, 0xf04070, 0x70f040, 0x40b070,
- 0xb07040, 0x7040b0, 0x4070b0, 0xb04070, 0x70b040, 0x405070, 0x507040,
- 0x704050, 0x407050, 0x504070, 0x705040, 0x40d070, 0xd07040, 0x7040d0,
- 0x4070d0, 0xd04070, 0x70d040, 0x407000, 0x704000, 0x700040, 0x400070,
- 0x007040, 0x004070, 0x407040, 0x704040, 0x404070, 0x704070, 0x407070,
- 0x707040, 0xe06070, 0x6070e0, 0x70e060, 0xe07060, 0x60e070, 0x7060e0,
- 0xe0a070, 0xa070e0, 0x70e0a0, 0xe070a0, 0xa0e070, 0x70a0e0, 0xe02070,
- 0x2070e0, 0x70e020, 0xe07020, 0x20e070, 0x7020e0, 0xe0f070, 0xf070e0,
- 0x70e0f0, 0xe070f0, 0xf0e070, 0x70f0e0, 0xe0b070, 0xb070e0, 0x70e0b0,
- 0xe070b0, 0xb0e070, 0x70b0e0, 0xe05070, 0x5070e0, 0x70e050, 0xe07050,
- 0x50e070, 0x7050e0, 0xe0d070, 0xd070e0, 0x70e0d0, 0xe070d0, 0xd0e070,
- 0x70d0e0, 0xe07000, 0x70e000, 0x7000e0, 0xe00070, 0x0070e0, 0x00e070,
- 0xe070e0, 0x70e0e0, 0xe0e070, 0x70e070, 0xe07070, 0x7070e0, 0x60a070,
- 0xa07060, 0x7060a0, 0x6070a0, 0xa06070, 0x70a060, 0x602070, 0x207060,
- 0x706020, 0x607020, 0x206070, 0x702060, 0x60f070, 0xf07060, 0x7060f0,
- 0x6070f0, 0xf06070, 0x70f060, 0x60b070, 0xb07060, 0x7060b0, 0x6070b0,
- 0xb06070, 0x70b060, 0x605070, 0x507060, 0x706050, 0x607050, 0x506070,
- 0x705060, 0x60d070, 0xd07060, 0x7060d0, 0x6070d0, 0xd06070, 0x70d060,
- 0x607000, 0x706000, 0x700060, 0x600070, 0x007060, 0x006070, 0x607060,
- 0x706060, 0x606070, 0x706070, 0x607070, 0x707060, 0xa02070, 0x2070a0,
- 0x70a020, 0xa07020, 0x20a070, 0x7020a0, 0xa0f070, 0xf070a0, 0x70a0f0,
- 0xa070f0, 0xf0a070, 0x70f0a0, 0xa0b070, 0xb070a0, 0x70a0b0, 0xa070b0,
- 0xb0a070, 0x70b0a0, 0xa05070, 0x5070a0, 0x70a050, 0xa07050, 0x50a070,
- 0x7050a0, 0xa0d070, 0xd070a0, 0x70a0d0, 0xa070d0, 0xd0a070, 0x70d0a0,
- 0xa07000, 0x70a000, 0x7000a0, 0xa00070, 0x0070a0, 0x00a070, 0xa070a0,
- 0x70a0a0, 0xa0a070, 0x70a070, 0xa07070, 0x7070a0, 0x20f070, 0xf07020,
- 0x7020f0, 0x2070f0, 0xf02070, 0x70f020, 0x20b070, 0xb07020, 0x7020b0,
- 0x2070b0, 0xb02070, 0x70b020, 0x205070, 0x507020, 0x702050, 0x207050,
- 0x502070, 0x705020, 0x20d070, 0xd07020, 0x7020d0, 0x2070d0, 0xd02070,
- 0x70d020, 0x207000, 0x702000, 0x700020, 0x200070, 0x007020, 0x002070,
- 0x207020, 0x702020, 0x202070, 0x702070, 0x207070, 0x707020, 0xf0b070,
- 0xb070f0, 0x70f0b0, 0xf070b0, 0xb0f070, 0x70b0f0, 0xf05070, 0x5070f0,
- 0x70f050, 0xf07050, 0x50f070, 0x7050f0, 0xf0d070, 0xd070f0, 0x70f0d0,
- 0xf070d0, 0xd0f070, 0x70d0f0, 0xf07000, 0x70f000, 0x7000f0, 0xf00070,
- 0x0070f0, 0x00f070, 0xf070f0, 0x70f0f0, 0xf0f070, 0x70f070, 0xf07070,
- 0x7070f0, 0xb05070, 0x5070b0, 0x70b050, 0xb07050, 0x50b070, 0x7050b0,
- 0xb0d070, 0xd070b0, 0x70b0d0, 0xb070d0, 0xd0b070, 0x70d0b0, 0xb07000,
- 0x70b000, 0x7000b0, 0xb00070, 0x0070b0, 0x00b070, 0xb070b0, 0x70b0b0,
- 0xb0b070, 0x70b070, 0xb07070, 0x7070b0, 0x50d070, 0xd07050, 0x7050d0,
- 0x5070d0, 0xd05070, 0x70d050, 0x507000, 0x705000, 0x700050, 0x500070,
- 0x007050, 0x005070, 0x507050, 0x705050, 0x505070, 0x705070, 0x507070,
- 0x707050, 0xd07000, 0x70d000, 0x7000d0, 0xd00070, 0x0070d0, 0x00d070,
- 0xd070d0, 0x70d0d0, 0xd0d070, 0x70d070, 0xd07070, 0x7070d0, 0x707070,
- 0x700000, 0x007000, 0x000070, 0x707000, 0x700070, 0x007070, 0xff8030,
- 0x8030ff, 0x30ff80, 0xff3080, 0x80ff30, 0x3080ff, 0xffc030, 0xc030ff,
- 0x30ffc0, 0xff30c0, 0xc0ff30, 0x30c0ff, 0xff4030, 0x4030ff, 0x30ff40,
- 0xff3040, 0x40ff30, 0x3040ff, 0xffe030, 0xe030ff, 0x30ffe0, 0xff30e0,
- 0xe0ff30, 0x30e0ff, 0xff6030, 0x6030ff, 0x30ff60, 0xff3060, 0x60ff30,
- 0x3060ff, 0xffa030, 0xa030ff, 0x30ffa0, 0xff30a0, 0xa0ff30, 0x30a0ff,
- 0xff2030, 0x2030ff, 0x30ff20, 0xff3020, 0x20ff30, 0x3020ff, 0xfff030,
- 0xf030ff, 0x30fff0, 0xff30f0, 0xf0ff30, 0x30f0ff, 0xffb030, 0xb030ff,
- 0x30ffb0, 0xff30b0, 0xb0ff30, 0x30b0ff, 0xff5030, 0x5030ff, 0x30ff50,
- 0xff3050, 0x50ff30, 0x3050ff, 0xffd030, 0xd030ff, 0x30ffd0, 0xff30d0,
- 0xd0ff30, 0x30d0ff, 0xff7030, 0x7030ff, 0x30ff70, 0xff3070, 0x70ff30,
- 0x3070ff, 0xff3000, 0x30ff00, 0x3000ff, 0xff0030, 0x0030ff, 0x00ff30,
- 0xff30ff, 0x30ffff, 0xffff30, 0x30ff30, 0xff3030, 0x3030ff, 0x80c030,
- 0xc03080, 0x3080c0, 0x8030c0, 0xc08030, 0x30c080, 0x804030, 0x403080,
- 0x308040, 0x803040, 0x408030, 0x304080, 0x80e030, 0xe03080, 0x3080e0,
- 0x8030e0, 0xe08030, 0x30e080, 0x806030, 0x603080, 0x308060, 0x803060,
- 0x608030, 0x306080, 0x80a030, 0xa03080, 0x3080a0, 0x8030a0, 0xa08030,
- 0x30a080, 0x802030, 0x203080, 0x308020, 0x803020, 0x208030, 0x302080,
- 0x80f030, 0xf03080, 0x3080f0, 0x8030f0, 0xf08030, 0x30f080, 0x80b030,
- 0xb03080, 0x3080b0, 0x8030b0, 0xb08030, 0x30b080, 0x805030, 0x503080,
- 0x308050, 0x803050, 0x508030, 0x305080, 0x80d030, 0xd03080, 0x3080d0,
- 0x8030d0, 0xd08030, 0x30d080, 0x807030, 0x703080, 0x308070, 0x803070,
- 0x708030, 0x307080, 0x803000, 0x308000, 0x300080, 0x800030, 0x003080,
- 0x008030, 0x803080, 0x308080, 0x808030, 0x308030, 0x803030, 0x303080,
- 0xc04030, 0x4030c0, 0x30c040, 0xc03040, 0x40c030, 0x3040c0, 0xc0e030,
- 0xe030c0, 0x30c0e0, 0xc030e0, 0xe0c030, 0x30e0c0, 0xc06030, 0x6030c0,
- 0x30c060, 0xc03060, 0x60c030, 0x3060c0, 0xc0a030, 0xa030c0, 0x30c0a0,
- 0xc030a0, 0xa0c030, 0x30a0c0, 0xc02030, 0x2030c0, 0x30c020, 0xc03020,
- 0x20c030, 0x3020c0, 0xc0f030, 0xf030c0, 0x30c0f0, 0xc030f0, 0xf0c030,
- 0x30f0c0, 0xc0b030, 0xb030c0, 0x30c0b0, 0xc030b0, 0xb0c030, 0x30b0c0,
- 0xc05030, 0x5030c0, 0x30c050, 0xc03050, 0x50c030, 0x3050c0, 0xc0d030,
- 0xd030c0, 0x30c0d0, 0xc030d0, 0xd0c030, 0x30d0c0, 0xc07030, 0x7030c0,
- 0x30c070, 0xc03070, 0x70c030, 0x3070c0, 0xc03000, 0x30c000, 0x3000c0,
- 0xc00030, 0x0030c0, 0x00c030, 0xc030c0, 0x30c0c0, 0xc0c030, 0x30c030,
- 0xc03030, 0x3030c0, 0x40e030, 0xe03040, 0x3040e0, 0x4030e0, 0xe04030,
- 0x30e040, 0x406030, 0x603040, 0x304060, 0x403060, 0x604030, 0x306040,
- 0x40a030, 0xa03040, 0x3040a0, 0x4030a0, 0xa04030, 0x30a040, 0x402030,
- 0x203040, 0x304020, 0x403020, 0x204030, 0x302040, 0x40f030, 0xf03040,
- 0x3040f0, 0x4030f0, 0xf04030, 0x30f040, 0x40b030, 0xb03040, 0x3040b0,
- 0x4030b0, 0xb04030, 0x30b040, 0x405030, 0x503040, 0x304050, 0x403050,
- 0x504030, 0x305040, 0x40d030, 0xd03040, 0x3040d0, 0x4030d0, 0xd04030,
- 0x30d040, 0x407030, 0x703040, 0x304070, 0x403070, 0x704030, 0x307040,
- 0x403000, 0x304000, 0x300040, 0x400030, 0x003040, 0x004030, 0x403040,
- 0x304040, 0x404030, 0x304030, 0x403030, 0x303040, 0xe06030, 0x6030e0,
- 0x30e060, 0xe03060, 0x60e030, 0x3060e0, 0xe0a030, 0xa030e0, 0x30e0a0,
- 0xe030a0, 0xa0e030, 0x30a0e0, 0xe02030, 0x2030e0, 0x30e020, 0xe03020,
- 0x20e030, 0x3020e0, 0xe0f030, 0xf030e0, 0x30e0f0, 0xe030f0, 0xf0e030,
- 0x30f0e0, 0xe0b030, 0xb030e0, 0x30e0b0, 0xe030b0, 0xb0e030, 0x30b0e0,
- 0xe05030, 0x5030e0, 0x30e050, 0xe03050, 0x50e030, 0x3050e0, 0xe0d030,
- 0xd030e0, 0x30e0d0, 0xe030d0, 0xd0e030, 0x30d0e0, 0xe07030, 0x7030e0,
- 0x30e070, 0xe03070, 0x70e030, 0x3070e0, 0xe03000, 0x30e000, 0x3000e0,
- 0xe00030, 0x0030e0, 0x00e030, 0xe030e0, 0x30e0e0, 0xe0e030, 0x30e030,
- 0xe03030, 0x3030e0, 0x60a030, 0xa03060, 0x3060a0, 0x6030a0, 0xa06030,
- 0x30a060, 0x602030, 0x203060, 0x306020, 0x603020, 0x206030, 0x302060,
- 0x60f030, 0xf03060, 0x3060f0, 0x6030f0, 0xf06030, 0x30f060, 0x60b030,
- 0xb03060, 0x3060b0, 0x6030b0, 0xb06030, 0x30b060, 0x605030, 0x503060,
- 0x306050, 0x603050, 0x506030, 0x305060, 0x60d030, 0xd03060, 0x3060d0,
- 0x6030d0, 0xd06030, 0x30d060, 0x607030, 0x703060, 0x306070, 0x603070,
- 0x706030, 0x307060, 0x603000, 0x306000, 0x300060, 0x600030, 0x003060,
- 0x006030, 0x603060, 0x306060, 0x606030, 0x306030, 0x603030, 0x303060,
- 0xa02030, 0x2030a0, 0x30a020, 0xa03020, 0x20a030, 0x3020a0, 0xa0f030,
- 0xf030a0, 0x30a0f0, 0xa030f0, 0xf0a030, 0x30f0a0, 0xa0b030, 0xb030a0,
- 0x30a0b0, 0xa030b0, 0xb0a030, 0x30b0a0, 0xa05030, 0x5030a0, 0x30a050,
- 0xa03050, 0x50a030, 0x3050a0, 0xa0d030, 0xd030a0, 0x30a0d0, 0xa030d0,
- 0xd0a030, 0x30d0a0, 0xa07030, 0x7030a0, 0x30a070, 0xa03070, 0x70a030,
- 0x3070a0, 0xa03000, 0x30a000, 0x3000a0, 0xa00030, 0x0030a0, 0x00a030,
- 0xa030a0, 0x30a0a0, 0xa0a030, 0x30a030, 0xa03030, 0x3030a0, 0x20f030,
- 0xf03020, 0x3020f0, 0x2030f0, 0xf02030, 0x30f020, 0x20b030, 0xb03020,
- 0x3020b0, 0x2030b0, 0xb02030, 0x30b020, 0x205030, 0x503020, 0x302050,
- 0x203050, 0x502030, 0x305020, 0x20d030, 0xd03020, 0x3020d0, 0x2030d0,
- 0xd02030, 0x30d020, 0x207030, 0x703020, 0x302070, 0x203070, 0x702030,
- 0x307020, 0x203000, 0x302000, 0x300020, 0x200030, 0x003020, 0x002030,
- 0x203020, 0x302020, 0x202030, 0x302030, 0x203030, 0x303020, 0xf0b030,
- 0xb030f0, 0x30f0b0, 0xf030b0, 0xb0f030, 0x30b0f0, 0xf05030, 0x5030f0,
- 0x30f050, 0xf03050, 0x50f030, 0x3050f0, 0xf0d030, 0xd030f0, 0x30f0d0,
- 0xf030d0, 0xd0f030, 0x30d0f0, 0xf07030, 0x7030f0, 0x30f070, 0xf03070,
- 0x70f030, 0x3070f0, 0xf03000, 0x30f000, 0x3000f0, 0xf00030, 0x0030f0,
- 0x00f030, 0xf030f0, 0x30f0f0, 0xf0f030, 0x30f030, 0xf03030, 0x3030f0,
- 0xb05030, 0x5030b0, 0x30b050, 0xb03050, 0x50b030, 0x3050b0, 0xb0d030,
- 0xd030b0, 0x30b0d0, 0xb030d0, 0xd0b030, 0x30d0b0, 0xb07030, 0x7030b0,
- 0x30b070, 0xb03070, 0x70b030, 0x3070b0, 0xb03000, 0x30b000, 0x3000b0,
- 0xb00030, 0x0030b0, 0x00b030, 0xb030b0, 0x30b0b0, 0xb0b030, 0x30b030,
- 0xb03030, 0x3030b0, 0x50d030, 0xd03050, 0x3050d0, 0x5030d0, 0xd05030,
- 0x30d050, 0x507030, 0x703050, 0x305070, 0x503070, 0x705030, 0x307050,
- 0x503000, 0x305000, 0x300050, 0x500030, 0x003050, 0x005030, 0x503050,
- 0x305050, 0x505030, 0x305030, 0x503030, 0x303050, 0xd07030, 0x7030d0,
- 0x30d070, 0xd03070, 0x70d030, 0x3070d0, 0xd03000, 0x30d000, 0x3000d0,
- 0xd00030, 0x0030d0, 0x00d030, 0xd030d0, 0x30d0d0, 0xd0d030, 0x30d030,
- 0xd03030, 0x3030d0, 0x703000, 0x307000, 0x300070, 0x700030, 0x003070,
- 0x007030, 0x703070, 0x307070, 0x707030, 0x307030, 0x703030, 0x303070,
- 0x303030, 0x300000, 0x003000, 0x000030, 0x303000, 0x300030, 0x003030,
- 0xff8090, 0x8090ff, 0x90ff80, 0xff9080, 0x80ff90, 0x9080ff, 0xffc090,
- 0xc090ff, 0x90ffc0, 0xff90c0, 0xc0ff90, 0x90c0ff, 0xff4090, 0x4090ff,
- 0x90ff40, 0xff9040, 0x40ff90, 0x9040ff, 0xffe090, 0xe090ff, 0x90ffe0,
- 0xff90e0, 0xe0ff90, 0x90e0ff, 0xff6090, 0x6090ff, 0x90ff60, 0xff9060,
- 0x60ff90, 0x9060ff, 0xffa090, 0xa090ff, 0x90ffa0, 0xff90a0, 0xa0ff90,
- 0x90a0ff, 0xff2090, 0x2090ff, 0x90ff20, 0xff9020, 0x20ff90, 0x9020ff,
- 0xfff090, 0xf090ff, 0x90fff0, 0xff90f0, 0xf0ff90, 0x90f0ff, 0xffb090,
- 0xb090ff, 0x90ffb0, 0xff90b0, 0xb0ff90, 0x90b0ff, 0xff5090, 0x5090ff,
- 0x90ff50, 0xff9050, 0x50ff90, 0x9050ff, 0xffd090, 0xd090ff, 0x90ffd0,
- 0xff90d0, 0xd0ff90, 0x90d0ff, 0xff7090, 0x7090ff, 0x90ff70, 0xff9070,
- 0x70ff90, 0x9070ff, 0xff3090, 0x3090ff, 0x90ff30, 0xff9030, 0x30ff90,
- 0x9030ff, 0xff9000, 0x90ff00, 0x9000ff, 0xff0090, 0x0090ff, 0x00ff90,
- 0xff90ff, 0x90ffff, 0xffff90, 0x90ff90, 0xff9090, 0x9090ff, 0x80c090,
- 0xc09080, 0x9080c0, 0x8090c0, 0xc08090, 0x90c080, 0x804090, 0x409080,
- 0x908040, 0x809040, 0x408090, 0x904080, 0x80e090, 0xe09080, 0x9080e0,
- 0x8090e0, 0xe08090, 0x90e080, 0x806090, 0x609080, 0x908060, 0x809060,
- 0x608090, 0x906080, 0x80a090, 0xa09080, 0x9080a0, 0x8090a0, 0xa08090,
- 0x90a080, 0x802090, 0x209080, 0x908020, 0x809020, 0x208090, 0x902080,
- 0x80f090, 0xf09080, 0x9080f0, 0x8090f0, 0xf08090, 0x90f080, 0x80b090,
- 0xb09080, 0x9080b0, 0x8090b0, 0xb08090, 0x90b080, 0x805090, 0x509080,
- 0x908050, 0x809050, 0x508090, 0x905080, 0x80d090, 0xd09080, 0x9080d0,
- 0x8090d0, 0xd08090, 0x90d080, 0x807090, 0x709080, 0x908070, 0x809070,
- 0x708090, 0x907080, 0x803090, 0x309080, 0x908030, 0x809030, 0x308090,
- 0x903080, 0x809000, 0x908000, 0x900080, 0x800090, 0x009080, 0x008090,
- 0x809080, 0x908080, 0x808090, 0x908090, 0x809090, 0x909080, 0xc04090,
- 0x4090c0, 0x90c040, 0xc09040, 0x40c090, 0x9040c0, 0xc0e090, 0xe090c0,
- 0x90c0e0, 0xc090e0, 0xe0c090, 0x90e0c0, 0xc06090, 0x6090c0, 0x90c060,
- 0xc09060, 0x60c090, 0x9060c0, 0xc0a090, 0xa090c0, 0x90c0a0, 0xc090a0,
- 0xa0c090, 0x90a0c0, 0xc02090, 0x2090c0, 0x90c020, 0xc09020, 0x20c090,
- 0x9020c0, 0xc0f090, 0xf090c0, 0x90c0f0, 0xc090f0, 0xf0c090, 0x90f0c0,
- 0xc0b090, 0xb090c0, 0x90c0b0, 0xc090b0, 0xb0c090, 0x90b0c0, 0xc05090,
- 0x5090c0, 0x90c050, 0xc09050, 0x50c090, 0x9050c0, 0xc0d090, 0xd090c0,
- 0x90c0d0, 0xc090d0, 0xd0c090, 0x90d0c0, 0xc07090, 0x7090c0, 0x90c070,
- 0xc09070, 0x70c090, 0x9070c0, 0xc03090, 0x3090c0, 0x90c030, 0xc09030,
- 0x30c090, 0x9030c0, 0xc09000, 0x90c000, 0x9000c0, 0xc00090, 0x0090c0,
- 0x00c090, 0xc090c0, 0x90c0c0, 0xc0c090, 0x90c090, 0xc09090, 0x9090c0,
- 0x40e090, 0xe09040, 0x9040e0, 0x4090e0, 0xe04090, 0x90e040, 0x406090,
- 0x609040, 0x904060, 0x409060, 0x604090, 0x906040, 0x40a090, 0xa09040,
- 0x9040a0, 0x4090a0, 0xa04090, 0x90a040, 0x402090, 0x209040, 0x904020,
- 0x409020, 0x204090, 0x902040, 0x40f090, 0xf09040, 0x9040f0, 0x4090f0,
- 0xf04090, 0x90f040, 0x40b090, 0xb09040, 0x9040b0, 0x4090b0, 0xb04090,
- 0x90b040, 0x405090, 0x509040, 0x904050, 0x409050, 0x504090, 0x905040,
- 0x40d090, 0xd09040, 0x9040d0, 0x4090d0, 0xd04090, 0x90d040, 0x407090,
- 0x709040, 0x904070, 0x409070, 0x704090, 0x907040, 0x403090, 0x309040,
- 0x904030, 0x409030, 0x304090, 0x903040, 0x409000, 0x904000, 0x900040,
- 0x400090, 0x009040, 0x004090, 0x409040, 0x904040, 0x404090, 0x904090,
- 0x409090, 0x909040, 0xe06090, 0x6090e0, 0x90e060, 0xe09060, 0x60e090,
- 0x9060e0, 0xe0a090, 0xa090e0, 0x90e0a0, 0xe090a0, 0xa0e090, 0x90a0e0,
- 0xe02090, 0x2090e0, 0x90e020, 0xe09020, 0x20e090, 0x9020e0, 0xe0f090,
- 0xf090e0, 0x90e0f0, 0xe090f0, 0xf0e090, 0x90f0e0, 0xe0b090, 0xb090e0,
- 0x90e0b0, 0xe090b0, 0xb0e090, 0x90b0e0, 0xe05090, 0x5090e0, 0x90e050,
- 0xe09050, 0x50e090, 0x9050e0, 0xe0d090, 0xd090e0, 0x90e0d0, 0xe090d0,
- 0xd0e090, 0x90d0e0, 0xe07090, 0x7090e0, 0x90e070, 0xe09070, 0x70e090,
- 0x9070e0, 0xe03090, 0x3090e0, 0x90e030, 0xe09030, 0x30e090, 0x9030e0,
- 0xe09000, 0x90e000, 0x9000e0, 0xe00090, 0x0090e0, 0x00e090, 0xe090e0,
- 0x90e0e0, 0xe0e090, 0x90e090, 0xe09090, 0x9090e0, 0x60a090, 0xa09060,
- 0x9060a0, 0x6090a0, 0xa06090, 0x90a060, 0x602090, 0x209060, 0x906020,
- 0x609020, 0x206090, 0x902060, 0x60f090, 0xf09060, 0x9060f0, 0x6090f0,
- 0xf06090, 0x90f060, 0x60b090, 0xb09060, 0x9060b0, 0x6090b0, 0xb06090,
- 0x90b060, 0x605090, 0x509060, 0x906050, 0x609050, 0x506090, 0x905060,
- 0x60d090, 0xd09060, 0x9060d0, 0x6090d0, 0xd06090, 0x90d060, 0x607090,
- 0x709060, 0x906070, 0x609070, 0x706090, 0x907060, 0x603090, 0x309060,
- 0x906030, 0x609030, 0x306090, 0x903060, 0x609000, 0x906000, 0x900060,
- 0x600090, 0x009060, 0x006090, 0x609060, 0x906060, 0x606090, 0x906090,
- 0x609090, 0x909060, 0xa02090, 0x2090a0, 0x90a020, 0xa09020, 0x20a090,
- 0x9020a0, 0xa0f090, 0xf090a0, 0x90a0f0, 0xa090f0, 0xf0a090, 0x90f0a0,
- 0xa0b090, 0xb090a0, 0x90a0b0, 0xa090b0, 0xb0a090, 0x90b0a0, 0xa05090,
- 0x5090a0, 0x90a050, 0xa09050, 0x50a090, 0x9050a0, 0xa0d090, 0xd090a0,
- 0x90a0d0, 0xa090d0, 0xd0a090, 0x90d0a0, 0xa07090, 0x7090a0, 0x90a070,
- 0xa09070, 0x70a090, 0x9070a0, 0xa03090, 0x3090a0, 0x90a030, 0xa09030,
- 0x30a090, 0x9030a0, 0xa09000, 0x90a000, 0x9000a0, 0xa00090, 0x0090a0,
- 0x00a090, 0xa090a0, 0x90a0a0, 0xa0a090, 0x90a090, 0xa09090, 0x9090a0,
- 0x20f090, 0xf09020, 0x9020f0, 0x2090f0, 0xf02090, 0x90f020, 0x20b090,
- 0xb09020, 0x9020b0, 0x2090b0, 0xb02090, 0x90b020, 0x205090, 0x509020,
- 0x902050, 0x209050, 0x502090, 0x905020, 0x20d090, 0xd09020, 0x9020d0,
- 0x2090d0, 0xd02090, 0x90d020, 0x207090, 0x709020, 0x902070, 0x209070,
- 0x702090, 0x907020, 0x203090, 0x309020, 0x902030, 0x209030, 0x302090,
- 0x903020, 0x209000, 0x902000, 0x900020, 0x200090, 0x009020, 0x002090,
- 0x209020, 0x902020, 0x202090, 0x902090, 0x209090, 0x909020, 0xf0b090,
- 0xb090f0, 0x90f0b0, 0xf090b0, 0xb0f090, 0x90b0f0, 0xf05090, 0x5090f0,
- 0x90f050, 0xf09050, 0x50f090, 0x9050f0, 0xf0d090, 0xd090f0, 0x90f0d0,
- 0xf090d0, 0xd0f090, 0x90d0f0, 0xf07090, 0x7090f0, 0x90f070, 0xf09070,
- 0x70f090, 0x9070f0, 0xf03090, 0x3090f0, 0x90f030, 0xf09030, 0x30f090,
- 0x9030f0, 0xf09000, 0x90f000, 0x9000f0, 0xf00090, 0x0090f0, 0x00f090,
- 0xf090f0, 0x90f0f0, 0xf0f090, 0x90f090, 0xf09090, 0x9090f0, 0xb05090,
- 0x5090b0, 0x90b050, 0xb09050, 0x50b090, 0x9050b0, 0xb0d090, 0xd090b0,
- 0x90b0d0, 0xb090d0, 0xd0b090, 0x90d0b0, 0xb07090, 0x7090b0, 0x90b070,
- 0xb09070, 0x70b090, 0x9070b0, 0xb03090, 0x3090b0, 0x90b030, 0xb09030,
- 0x30b090, 0x9030b0, 0xb09000, 0x90b000, 0x9000b0, 0xb00090, 0x0090b0,
- 0x00b090, 0xb090b0, 0x90b0b0, 0xb0b090, 0x90b090, 0xb09090, 0x9090b0,
- 0x50d090, 0xd09050, 0x9050d0, 0x5090d0, 0xd05090, 0x90d050, 0x507090,
- 0x709050, 0x905070, 0x509070, 0x705090, 0x907050, 0x503090, 0x309050,
- 0x905030, 0x509030, 0x305090, 0x903050, 0x509000, 0x905000, 0x900050,
- 0x500090, 0x009050, 0x005090, 0x509050, 0x905050, 0x505090, 0x905090,
- 0x509090, 0x909050, 0xd07090, 0x7090d0, 0x90d070, 0xd09070, 0x70d090,
- 0x9070d0, 0xd03090, 0x3090d0, 0x90d030, 0xd09030, 0x30d090, 0x9030d0,
- 0xd09000, 0x90d000, 0x9000d0, 0xd00090, 0x0090d0, 0x00d090, 0xd090d0,
- 0x90d0d0, 0xd0d090, 0x90d090, 0xd09090, 0x9090d0, 0x703090, 0x309070,
- 0x907030, 0x709030, 0x307090, 0x903070, 0x709000, 0x907000, 0x900070,
- 0x700090, 0x009070, 0x007090, 0x709070, 0x907070, 0x707090, 0x907090,
- 0x709090, 0x909070, 0x309000, 0x903000, 0x900030, 0x300090, 0x009030,
- 0x003090, 0x309030, 0x903030, 0x303090, 0x903090, 0x309090, 0x909030,
- 0x909090, 0x900000, 0x009000, 0x000090, 0x909000, 0x900090, 0x009090,
- 0xff8010
-};
-
-static unsigned char const pickMapComponent[256] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
- 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
- 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
- 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
- 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
- 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
- 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50,
- 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50,
- 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60,
- 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60,
- 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70,
- 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70,
- 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
- 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
- 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
- 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
- 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0,
- 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0,
- 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0,
- 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0,
- 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0,
- 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0,
- 0xd0, 0xd0, 0xd0, 0xd0, 0xd0, 0xd0, 0xd0, 0xd0,
- 0xd0, 0xd0, 0xd0, 0xd0, 0xd0, 0xd0, 0xd0, 0xd0,
- 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0,
- 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0,
- 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0,
- 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
-};
-
-static unsigned char const pickMapComponent444[256] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
- 0x00, 0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
- 0x20, 0x00, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40,
- 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
- 0x40, 0x40, 0x00, 0x00, 0x40, 0x40, 0x40, 0x40,
- 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
- 0x40, 0x40, 0x40, 0x00, 0x00, 0x60, 0x60, 0x60,
- 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60,
- 0x60, 0x60, 0x60, 0x60, 0x00, 0x00, 0x60, 0x60,
- 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60,
- 0x60, 0x60, 0x60, 0x60, 0x60, 0x00, 0x00, 0x80,
- 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
- 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00,
- 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
- 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00,
- 0x00, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0,
- 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0,
- 0x00, 0x00, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0,
- 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0,
- 0xb0, 0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0,
- 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0,
- 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xe0, 0xe0,
- 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0,
- 0xe0, 0xe0, 0xe0, 0xe0, 0x00, 0x00, 0xf0, 0xf0,
- 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0,
- 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
-};
-
-#define MAX_PICK_COLORS 4096
-
-// Get the value at "index" to use for color picking. Returns a zero
-// QRgb when the table has been exhausted.
-QRgb qt_qgl_pick_color(int index)
-{
- if (index >= 0 && index < MAX_PICK_COLORS)
- return QRgb(pickColors[index] | 0xff000000);
- else
- return 0;
-}
-
-// Normalize a color that was picked out of a screen color buffer
-// so that it is a better match for something that was generated
-// by qt_qgl_pick_color(). Rounding discrepancies in the
-// low bits due to floating-point conversions are factored out.
-QRgb qt_qgl_normalize_pick_color(QRgb color, bool is444)
-{
- int red, green, blue;
- if (!is444) {
- // RGB565, RGB555, and RGB888 screens (alpha is ignored).
- red = pickMapComponent[qRed(color)];
- green = pickMapComponent[qGreen(color)];
- blue = pickMapComponent[qBlue(color)];
- } else {
- // RGB444 screens need a little more care when normalizing.
- red = pickMapComponent444[qRed(color)];
- green = pickMapComponent444[qGreen(color)];
- blue = pickMapComponent444[qBlue(color)];
- }
- return qRgb(red, green, blue);
-}
-
-QT_END_NAMESPACE
-
-#else // QGL_GENERATOR_PROGRAM
-
-#include <stdio.h>
-
-static unsigned char singlePatterns[] = {
- 1, 1, 1,
-
- 1, 0, 0,
- 0, 1, 0,
- 0, 0, 1,
- 1, 1, 0,
- 1, 0, 1,
- 0, 1, 1
-};
-#define NUM_SINGLE_PATTERNS 7
-
-static unsigned char doublePatterns[] = {
- 1, 2, 0,
- 2, 1, 0,
- 2, 0, 1,
- 1, 0, 2,
- 0, 2, 1,
- 0, 1, 2,
-
- 1, 2, 1,
- 2, 1, 1,
- 1, 1, 2,
- 2, 1, 2,
- 1, 2, 2,
- 2, 2, 1
-};
-#define NUM_DOUBLE_PATTERNS 12
-
-static unsigned char triplePatterns[] = {
- 1, 2, 3,
- 2, 3, 1,
- 3, 1, 2,
- 1, 3, 2,
- 2, 1, 3,
- 3, 2, 1
-};
-#define NUM_TRIPLE_PATTERNS 6
-
-static unsigned char values[] = {
- 0x00,
- 0xff, 0x80, 0xc0, 0x40, 0xe0, 0x60, 0xa0, 0x20,
- 0xf0, 0xb0, 0x50, 0xd0, 0x70, 0x30, 0x90, 0x10
-};
-#define NUM_VALUES 16
-#define NUM_VALUES_444 10
-
-#define MAX_GENERATE 4096
-
-static unsigned char used[17][17][17];
-static int generated = 0;
-
-static void genPattern(int red, int green, int blue)
-{
- ++red;
- ++green;
- ++blue;
- if (used[red][green][blue] || generated >= MAX_GENERATE)
- return;
- used[red][green][blue] = 1;
- if ((generated % 7) == 0)
- printf("\n ");
- printf("0x%02x%02x%02x", values[red], values[green], values[blue]);
- ++generated;
- if (generated < MAX_GENERATE && (generated % 7) != 0)
- printf(", ");
- else if (generated < MAX_GENERATE)
- printf(",");
-}
-
-static void genSinglePatterns(int value)
-{
- int index, red, green, blue;
- for (index = 0; index < NUM_SINGLE_PATTERNS; ++index) {
- if (singlePatterns[index * 3] == 0)
- red = -1;
- else
- red = value;
- if (singlePatterns[index * 3 + 1] == 0)
- green = -1;
- else
- green = value;
- if (singlePatterns[index * 3 + 2] == 0)
- blue = -1;
- else
- blue = value;
- genPattern(red, green, blue);
- }
-}
-
-static void genDoublePatterns(int value1, int value2)
-{
- int index, red, green, blue;
- for (index = 0; index < NUM_DOUBLE_PATTERNS; ++index) {
- if (doublePatterns[index * 3] == 0)
- red = -1;
- else if (doublePatterns[index * 3] == 1)
- red = value1;
- else
- red = value2;
- if (doublePatterns[index * 3 + 1] == 0)
- green = -1;
- else if (doublePatterns[index * 3 + 1] == 1)
- green = value1;
- else
- green = value2;
- if (doublePatterns[index * 3 + 2] == 0)
- blue = -1;
- else if (doublePatterns[index * 3 + 2] == 1)
- blue = value1;
- else
- blue = value2;
- genPattern(red, green, blue);
- }
-}
-
-static void genTriplePatterns(int value1, int value2, int value3)
-{
- int index, red, green, blue;
- for (index = 0; index < NUM_TRIPLE_PATTERNS; ++index) {
- if (triplePatterns[index * 3] == 0)
- red = -1;
- else if (triplePatterns[index * 3] == 1)
- red = value1;
- else if (triplePatterns[index * 3] == 2)
- red = value2;
- else
- red = value3;
- if (triplePatterns[index * 3 + 1] == 0)
- green = -1;
- else if (triplePatterns[index * 3 + 1] == 1)
- green = value1;
- else if (triplePatterns[index * 3 + 1] == 2)
- green = value2;
- else
- green = value3;
- if (triplePatterns[index * 3 + 2] == 0)
- blue = -1;
- else if (triplePatterns[index * 3 + 2] == 1)
- blue = value1;
- else if (triplePatterns[index * 3 + 2] == 2)
- blue = value2;
- else
- blue = value3;
- genPattern(red, green, blue);
- }
-}
-
-static void genPatternRange(int limit)
-{
- // This will generate 4912 unique color values which are
- // reasonably well-spaced in the RGB color cube.
- int first, second, third;
- for (first = 0; first < limit; ++first) {
- genSinglePatterns(first);
- for (second = first + 1; second < limit; ++second) {
- genDoublePatterns(first, second);
- for (third = second + 1; third < limit; ++third) {
- genTriplePatterns(first, second, third);
- }
- }
- }
-}
-
-static void generateComponentMap(void)
-{
- int map[256];
- int index, value, index2;
-
- for (index = 0; index < 256; ++index)
- map[index] = 0;
-
- for (index = 0; index < NUM_VALUES; ++index) {
- value = values[index + 1];
- for (index2 = value - 8; index2 < (value + 8); ++index2) {
- if (index2 >= 0 && index2 < 256)
- map[index2] = value;
- }
- }
-
- for (index = 0; index < 256; ++index) {
- if ((index % 8) == 0)
- printf(" ");
- printf("0x%02x", map[index]);
- if (index < 255)
- printf(",");
- if ((index % 8) == 7)
- printf("\n");
- else if (index < 255)
- printf(" ");
- }
-
- // Validate the reversibility of RGB565 and RGB555 mappings.
- for (index = 0; index < 17; ++index) {
- // Integer truncation test - 5-bit for red and blue (and green RGB555).
- value = values[index] * 31 / 255;
- index2 = value * 255 / 31;
- if (values[index] != map[index2]) {
- qWarning("RGB565 (i5) failure: 0x%02X -> 0x%02X -> 0x%02X\n",
- values[index], index2, map[index2]);
- }
-
- // Integer truncation test - 6-bit for green.
- value = values[index] * 63 / 255;
- index2 = value * 255 / 63;
- if (values[index] != map[index2]) {
- qWarning("RGB565 (i6) failure: 0x%02X -> 0x%02X -> 0x%02X\n",
- values[index], index2, map[index2]);
- }
-
- // Floating point rounding test - 5-bit for red and blue.
- value = (int)((values[index] * 31.0 / 255.0) + 0.5);
- index2 = (int)((value * 255.0 / 31.0) + 0.5);
- if (values[index] != map[index2]) {
- qWarning("RGB565 (f5) failure: 0x%02X -> 0x%02X -> 0x%02X\n",
- values[index], index2, map[index2]);
- }
-
- // Floating point rounding test - 6-bit for green.
- value = (int)((values[index] * 63.0 / 255.0) + 0.5);
- index2 = (int)((value * 255.0 / 63.0) + 0.5);
- if (values[index] != map[index2]) {
- qWarning("RGB565 (f6) failure: 0x%02X -> 0x%02X -> 0x%02X\n",
- values[index], index2, map[index2]);
- }
-
- // Test 5-bit to 8-bit conversion using doubling (ABCDE -> ABCDEABC).
- value = values[index] * 31 / 255;
- index2 = (value << 3) | (value >> 2);
- if (values[index] != map[index2]) {
- qWarning("RGB565 (di5) failure: 0x%02X -> 0x%02X -> 0x%02X\n",
- values[index], index2, map[index2]);
- }
- value = (int)((values[index] * 31.0 / 255.0) + 0.5);
- index2 = (value << 3) | (value >> 2);
- if (values[index] != map[index2]) {
- qWarning("RGB565 (df5) failure: 0x%02X -> 0x%02X -> 0x%02X\n",
- values[index], index2, map[index2]);
- }
-
- // Test 6-bit to 8-bit conversion using doubling (ABCDEF -> ABCDEFAB).
- value = values[index] * 63 / 255;
- index2 = (value << 2) | (value >> 4);
- if (values[index] != map[index2]) {
- qWarning("RGB565 (di6) failure: 0x%02X -> 0x%02X -> 0x%02X\n",
- values[index], index2, map[index2]);
- }
- value = (int)((values[index] * 63.0 / 255.0) + 0.5);
- index2 = (value << 2) | (value >> 4);
- if (values[index] != map[index2]) {
- qWarning("RGB565 (df6) failure: 0x%02X -> 0x%02X -> 0x%02X\n",
- values[index], index2, map[index2]);
- }
- }
-}
-
-static void generateComponentMap444(void)
-{
- int map[256];
- int index, value, index2;
-
- for (index = 0; index < 256; ++index)
- map[index] = 0;
-
- // Populate mappings for integer conversion with truncation.
- for (index = 0; index < NUM_VALUES_444; ++index) {
- value = values[index + 1] * 15 / 255;
- value = value * 255 / 15;
- if (value > 255)
- value = 255;
- else if (value < 0)
- value = 0;
- for (index2 = value - 8; index2 < (value + 7); ++index2) {
- if (index2 >= 0 && index2 < 256)
- map[index2] = values[index + 1];
- }
- }
-
- // Add some extra mappings for floating-point conversion with rounding.
- for (index = 0; index < NUM_VALUES_444; ++index) {
- value = (int)((values[index + 1] * 15.0 / 255.0) + 0.5);
- value = (int)((value * 255.0 / 15.0) + 0.5);
- if (value > 255)
- value = 255;
- else if (value < 0)
- value = 0;
- for (index2 = value - 8; index2 < (value + 7); ++index2) {
- if (index2 >= 0 && index2 < 256 && map[index2] == 0)
- map[index2] = values[index + 1];
- }
- }
-
- for (index = 0; index < 256; ++index) {
- if ((index % 8) == 0)
- printf(" ");
- printf("0x%02x", map[index]);
- if (index < 255)
- printf(",");
- if ((index % 8) == 7)
- printf("\n");
- else if (index < 255)
- printf(" ");
- }
-
- // Validate the reversibility of RGB444 mappings.
- for (index = 0; index <= NUM_VALUES_444; ++index) {
- // Integer truncation test.
- value = values[index] * 15 / 255;
- index2 = value * 255 / 15;
- if (values[index] != map[index2]) {
- qWarning("RGB444 (i) failure: 0x%02X -> 0x%02X -> 0x%02X\n",
- values[index], index2, map[index2]);
- }
-
- // Floating point rounding test.
- value = (int)((values[index] * 15.0 / 255.0) + 0.5);
- index2 = (int)((value * 255.0 / 15.0) + 0.5);
- if (values[index] != map[index2]) {
- qWarning("RGB444 (f) failure: 0x%02X -> 0x%02X -> 0x%02X\n",
- values[index], index2, map[index2]);
- }
-
- // Test 4-bit to 8-bit conversion using doubling (ABCD -> ABCDABCD).
- value = values[index] * 15 / 255;
- index2 = value | (value << 4);
- if (values[index] != map[index2]) {
- qWarning("RGB444 (di) failure: 0x%02X -> 0x%02X -> 0x%02X\n",
- values[index], index2, map[index2]);
- }
- value = (int)((values[index] * 15.0 / 255.0) + 0.5);
- index2 = value | (value << 4);
- if (values[index] != map[index2]) {
- qWarning("RGB444 (df) failure: 0x%02X -> 0x%02X -> 0x%02X\n",
- values[index], index2, map[index2]);
- }
- }
-}
-
-int main(int argc, char *argv[])
-{
- int limit;
-
- // Run the generator multiple times using more and more of
- // the elements in the "values" table, and limit to a maximum
- // of 1024 colors.
- //
- // This will sort the output so that colors that involve elements
- // early in the table will be generated first. All combinations
- // of early elements are exhausted before moving onto later values.
- //
- // The result of this sorting should be to maximize the spacing
- // between colors that appear early in the generated output.
- // This should produce better results for color picking on
- // low-end devices with RGB565, RGB555, and RGB444 displays.
- printf("static int const pickColors[%d] = {", MAX_GENERATE);
- for (limit = 1; limit <= NUM_VALUES; ++limit)
- genPatternRange(limit);
- printf("\n};\n\n");
-
- // Generate a component mapping table for mapping 8-bit RGB
- // components to the nearest normalized value.
- printf("static unsigned char const pickMapComponent[256] = {\n");
- generateComponentMap();
- printf("};\n\n");
-
- // Generate a separate mapping table for RGB444, which needs a
- // little more care to deal with truncation errors.
- printf("static unsigned char const pickMapComponent444[256] = {\n");
- generateComponentMap444();
- printf("};\n\n");
-
- printf("#define MAX_PICK_COLORS %d\n\n", MAX_GENERATE);
-
- return 0;
-}
-
-#endif // QGL_GENERATOR_PROGRAM
diff --git a/src/threed/painting/qglpickcolors_p.h b/src/threed/painting/qglpickcolors_p.h
deleted file mode 100644
index 0249fb14..00000000
--- a/src/threed/painting/qglpickcolors_p.h
+++ /dev/null
@@ -1,66 +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 QGLPICKCOLORS_P_H
-#define QGLPICKCOLORS_P_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 <QtCore/qglobal.h>
-#include <QtGui/qrgb.h>
-
-QT_BEGIN_NAMESPACE
-
-QRgb qt_qgl_pick_color(int index);
-QRgb qt_qgl_normalize_pick_color(QRgb color, bool is444 = false);
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/threed/painting/qmatrix4x4stack.cpp b/src/threed/painting/qmatrix4x4stack.cpp
deleted file mode 100644
index c723cd4d..00000000
--- a/src/threed/painting/qmatrix4x4stack.cpp
+++ /dev/null
@@ -1,380 +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 "qmatrix4x4stack.h"
-#include "qmatrix4x4stack_p.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QMatrix4x4Stack
- \brief The QMatrix4x4Stack class manages stacks of transformation matrices in GL applications.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::painting
-
- Transformation matrices are one of the basic building blocks of
- 3D applications, allowing object models to be positioned, scaled,
- rotated, and projected onto the screen.
-
- GL systems support several standard kinds of matrices, particularly
- modelview and projection matrices. These matrices are typically
- organized into stacks, which allow the current matrix state to be
- saved with push() and restored later with pop().
-
- QMatrix4x4Stack assists QGLPainter with the management of matrix
- stacks, providing operations to set and modify transformation
- matrices in each of the standard matrix stacks.
-
- In the following example, a standard orthographic projection matrix for a
- view is set via the QGLPainter::projectionMatrix() stack, and
- then a modelview matrix is set via the QGLPainter::modelViewMatrix()
- stack to scale and translate an object prior to drawing:
-
- \code
- QGLPainter painter(this);
-
- QMatrix4x4 projm;
- projm.ortho(window->rect());
- painter.projectionMatrix() = projm;
-
- painter.modelViewMatrix().setToIdentity();
- painter.modelViewMatrix().translate(-1.0f, 2.0f, 0.0f);
- painter.modelViewMatrix().scale(0.5f);
- \endcode
-
- Later, the application can save the current modelview matrix state
- and draw a different object with a different modelview matrix:
-
- \code
- painter.modelViewMatrix().push();
- painter.modelViewMatrix().setToIdentity();
- painter.modelViewMatrix().scale(2.0f);
- \endcode
-
- For efficiency, the matrix values are kept client-side until they
- are needed by a QGLPainter::draw() operation. Until then, changes
- to the matrix will not be reflected in the GL server. The application
- can force the GL server to update the server with a call to
- QGLPainter::update().
-
- QMatrix4x4Stack is supported on all GL platforms, including OpenGL/ES 2.0
- which doesn't support matrix stacks natively. On that platform, the
- matrix stack is simulated in client memory. When the application
- selects a shader program to draw under OpenGL/ES 2.0, it calls
- top() to obtain the actual value to be set on the shader program.
-
- \sa QGLPainter
-*/
-
-/*!
- Creates a matrix stack.
-*/
-QMatrix4x4Stack::QMatrix4x4Stack()
- : d_ptr(new QMatrix4x4StackPrivate)
-{
-}
-
-/*!
- Destroy this matrix stack.
-*/
-QMatrix4x4Stack::~QMatrix4x4Stack()
-{
-}
-
-/*!
- Pushes the current matrix onto the matrix stack. The matrix can
- be restored with pop(). The new top of stack will have the
- same value as the previous top of stack.
-
- The depths of the traditional \c{GL_MODELVIEW} and \c{GL_PROJECTION}
- matrix stacks in the GL server are system-dependent and easy to
- overflow in nested rendering code using \c{glPushMatrix()}.
- By contrast, the push() function provides an arbitrary-sized stack
- in client memory.
-
- \sa pop(), top()
-*/
-void QMatrix4x4Stack::push()
-{
- Q_D(QMatrix4x4Stack);
- d->stack.push(d->matrix);
-}
-
-/*!
- Pops the top-most matrix from this matrix stack and sets the
- current matrix to the next value down. Does nothing if the
- matrix stack contains a single entry.
-
- \sa push()
-*/
-void QMatrix4x4Stack::pop()
-{
- Q_D(QMatrix4x4Stack);
- if (!d->stack.isEmpty())
- d->matrix = d->stack.pop();
- d->isDirty = true;
-}
-
-/*!
- Set the matrix at the top of this matrix stack to the identity matrix.
-
- \sa operator=()
-*/
-void QMatrix4x4Stack::setToIdentity()
-{
- Q_D(QMatrix4x4Stack);
- d->matrix.setToIdentity();
- d->isDirty = true;
-}
-
-/*!
- Returns a const reference to the current matrix at the top of this
- matrix stack. This is typically used to fetch the matrix so it can
- be set on user-defined shader programs.
-
- \sa operator=()
-*/
-const QMatrix4x4 &QMatrix4x4Stack::top() const
-{
- Q_D(const QMatrix4x4Stack);
- return d->matrix;
-}
-
-/*!
- \fn QMatrix4x4Stack::operator const QMatrix4x4 &() const
-
- Returns a const reference to the current matrix at the top of
- this matrix stack.
-
- \sa top()
-*/
-
-/*!
- Assigns \a matrix to the matrix at the top of this matrix stack.
-
- \sa top()
-*/
-QMatrix4x4Stack& QMatrix4x4Stack::operator=(const QMatrix4x4& matrix)
-{
- Q_D(QMatrix4x4Stack);
- d->matrix = matrix;
- d->isDirty = true;
- return *this;
-}
-
-/*!
- Multiplies the matrix at the top of this matrix stack by \a matrix.
-
- \sa top()
-*/
-QMatrix4x4Stack& QMatrix4x4Stack::operator*=(const QMatrix4x4& matrix)
-{
- Q_D(QMatrix4x4Stack);
- d->matrix *= matrix;
- d->isDirty = true;
- return *this;
-}
-
-/*!
- Multiplies the current matrix at the top of this matrix stack by another
- that translates coordinates by (\a x, \a y, \a z). The following example
- translates the modelview matrix by (1, -3, 0):
-
- \code
- QGLPainter painter(this);
- painter.modelViewMatrix().translate(1.0f, -3.0f, 0.0f);
- \endcode
-
- \sa scale(), rotate()
-*/
-void QMatrix4x4Stack::translate(qreal x, qreal y, qreal z)
-{
- Q_D(QMatrix4x4Stack);
- d->matrix.translate(x, y, z);
- d->isDirty = true;
-}
-
-/*!
- Multiplies the current matrix at the top of this matrix statck by another
- that translates coordinates by the components of \a vector.
-
- \sa scale(), rotate()
-*/
-void QMatrix4x4Stack::translate(const QVector3D& vector)
-{
- Q_D(QMatrix4x4Stack);
- d->matrix.translate(vector);
- d->isDirty = true;
-}
-
-/*!
- Multiplies the current matrix at the top of this matrix stack by another
- that scales coordinates by the components \a x, \a y, and \a z.
- The following example scales the modelview matrix by (1, 2, 1):
-
- \code
- QGLPainter painter(this);
- painter.modelViewMatrix().scale(1.0f, 2.0f, 1.0f);
- \endcode
-
- \sa translate(), rotate()
-*/
-void QMatrix4x4Stack::scale(qreal x, qreal y, qreal z)
-{
- Q_D(QMatrix4x4Stack);
- d->matrix.scale(x, y, z);
- d->isDirty = true;
-}
-
-/*!
- Multiplies the current matrix at the top of this matrix stack by another
- that scales coordinates by the given \a factor. The following example
- scales the modelview matrix by a factor of 2:
-
- \code
- QGLPainter painter(this);
- painter.modelViewMatrix().scale(2.0f);
- \endcode
-
- \sa translate(), rotate()
-*/
-void QMatrix4x4Stack::scale(qreal factor)
-{
- Q_D(QMatrix4x4Stack);
- d->matrix.scale(factor);
- d->isDirty = true;
-}
-
-/*!
- Multiplies the current matrix at the top of this matrix stack by another
- that scales coordinates by the components of \a vector.
-
- \sa translate(), rotate()
-*/
-void QMatrix4x4Stack::scale(const QVector3D& vector)
-{
- Q_D(QMatrix4x4Stack);
- d->matrix.scale(vector);
- d->isDirty = true;
-}
-
-/*!
- Multiplies the current matrix at the top of this matrix stack by another
- that rotates coordinates through \a angle degrees about the vector
- (\a x, \a y, \a z). The following example rotates the modelview
- matrix by 45 degress about the vector (1, -3, 0):
-
- \code
- QGLPainter painter(this);
- painter.modelViewMatrix().rotate(45.0f, 1.0f, -3.0f, 0.0f);
- \endcode
-
- \sa scale(), translate()
-*/
-void QMatrix4x4Stack::rotate(qreal angle, qreal x, qreal y, qreal z)
-{
- Q_D(QMatrix4x4Stack);
- d->matrix.rotate(angle, x, y, z);
- d->isDirty = true;
-}
-
-/*!
- Multiplies the current matrix at the top of this matrix stack by another
- that rotates coordinates through \a angle degrees about \a vector.
-
- \sa scale(), translate()
-*/
-void QMatrix4x4Stack::rotate(qreal angle, const QVector3D& vector)
-{
- Q_D(QMatrix4x4Stack);
- d->matrix.rotate(angle, vector);
- d->isDirty = true;
-}
-
-/*!
- Multiplies the current matrix at the top of this matrix stack by the
- \a quaternion. Thus \c {painter->modelViewMatrix().rotate(quaternion)}
- is equivalent to the following code:
- \code
- QMatrix4x4 mat;
- mat.rotate(quaternion);
- painter->modelViewMatrix() *= mat;
- \endcode
- which rotates coordinates according to the given \a quaternion.
-
- \sa scale(), translate()
-*/
-void QMatrix4x4Stack::rotate(const QQuaternion &quaternion)
-{
- Q_D(QMatrix4x4Stack);
- d->matrix.rotate(quaternion);
- d->isDirty = true;
-}
-
-/*!
- Returns true if the top of this matrix stack has been modified;
- false otherwise.
-
- \sa setDirty()
-*/
-bool QMatrix4x4Stack::isDirty() const
-{
- Q_D(const QMatrix4x4Stack);
- return d->isDirty;
-}
-
-/*!
- Sets the \a dirty flag on this matrix stack, which indicates
- if it has been modified.
-
- A matrix stack may also be set to dirty by translate(),
- scale(), operator*(), etc.
-
- \sa isDirty()
-*/
-void QMatrix4x4Stack::setDirty(bool dirty)
-{
- Q_D(QMatrix4x4Stack);
- d->isDirty = dirty;
-}
-
-QT_END_NAMESPACE
diff --git a/src/threed/painting/qmatrix4x4stack.h b/src/threed/painting/qmatrix4x4stack.h
deleted file mode 100644
index efb8d85b..00000000
--- a/src/threed/painting/qmatrix4x4stack.h
+++ /dev/null
@@ -1,105 +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 QMATRIX4X4STACK_H
-#define QMATRIX4X4STACK_H
-
-#include "qt3dglobal.h"
-#include <QtGui/qmatrix4x4.h>
-#include <QtCore/qscopedpointer.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class QMatrix4x4StackPrivate;
-
-class Q_QT3D_EXPORT QMatrix4x4Stack
-{
-public:
- QMatrix4x4Stack();
- ~QMatrix4x4Stack();
-
- const QMatrix4x4 &top() const;
-
- void push();
- void pop();
-
- void setToIdentity();
-
- void translate(qreal x, qreal y, qreal z);
- void translate(const QVector3D& vector);
- void scale(qreal x, qreal y, qreal z);
- void scale(qreal factor);
- void scale(const QVector3D& vector);
- void rotate(qreal angle, qreal x, qreal y, qreal z);
- void rotate(qreal angle, const QVector3D& vector);
- void rotate(const QQuaternion &quaternion);
-
- QMatrix4x4Stack& operator=(const QMatrix4x4& matrix);
- QMatrix4x4Stack& operator*=(const QMatrix4x4& matrix);
-
- operator const QMatrix4x4 &() const;
-
- bool isDirty() const;
- void setDirty(bool dirty);
-
-private:
- Q_DISABLE_COPY(QMatrix4x4Stack)
- Q_DECLARE_PRIVATE(QMatrix4x4Stack)
-
- QScopedPointer<QMatrix4x4StackPrivate> d_ptr;
-
- friend class QGLPainter;
-};
-
-inline QMatrix4x4Stack::operator const QMatrix4x4 &() const
-{
- return top();
-}
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/painting/qmatrix4x4stack_p.h b/src/threed/painting/qmatrix4x4stack_p.h
deleted file mode 100644
index ac6620ef..00000000
--- a/src/threed/painting/qmatrix4x4stack_p.h
+++ /dev/null
@@ -1,77 +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 QMATRIX4X4STACK_P_H
-#define QMATRIX4X4STACK_P_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 <QtGui/qmatrix4x4.h>
-#include <QtCore/qstack.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-class QMatrix4x4StackPrivate
-{
-public:
- QMatrix4x4StackPrivate() : isDirty(true) {}
-
- QMatrix4x4 matrix;
- QStack<QMatrix4x4> stack;
- bool isDirty;
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/scene/qglabstractscene.cpp b/src/threed/scene/qglabstractscene.cpp
deleted file mode 100644
index ee685e76..00000000
--- a/src/threed/scene/qglabstractscene.cpp
+++ /dev/null
@@ -1,605 +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 "qglabstractscene.h"
-#include "qglsceneformatplugin.h"
-#include "qglpicknode.h"
-
-// copied private header
-#include "qfactoryloader_p.h"
-
-#include <QtCore/qfile.h>
-#include <QtCore/qfileinfo.h>
-#include <QtCore/qlibraryinfo.h>
-#include <QtNetwork/qnetworkreply.h>
-#include <QtCore/qcoreevent.h>
-#include <QtCore/qdebug.h>
-#include <QtCore/qcoreapplication.h>
-#include <QtCore/qdir.h>
-#include <QtCore/qpluginloader.h>
-#include <QBuffer>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGLAbstractScene
- \brief The QGLAbstractScene class represents a 3D scene consisting of zero or more QGLSceneNode instances.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::scene
-
- Scenes are typically created by 3D modelling packages and then loaded
- into the application via a QGLSceneFormatPlugin; but they can also be
- constructed programatically. The functions in this
- class provide access to major scene objects so that they can be
- applied or drawn whenever the application decides.
-
- QGLAbstractScene presents a very simple model of a 3D scene. Subclasses
- implement the specific scene graph and object representations in a
- manner specific to the package's format. Subclasses may also provide
- functionality to create new objects at runtime, but this is not required.
-
- The scene is defined to consist of a number of important objects
- of the following types:
-
- \list
- \o Camera objects define a viewing position in world-coordinates and a
- projection that maps 3D world co-ordinates to 2D screen co-ordinates.
- Camera objects should inherit from QGLCamera.
- \o Main objects designate the major elements of the scene besides
- cameras, lights, and effects. Usually they inherit from QGLSceneNode.
- \o Light objects define positions and parameters for lighting the scene.
- Light objects should inherit from QGLLightParameters.
- \o Effect objects define materials, shaders, and textures for use in
- rendering the surface of objects. Normally effects are activated
- automatically when main objects are drawn. But effects can be used
- independently if the 3D format is acting as a library of effects.
- \o Mesh objects define geometry information independently of effects.
- Normally meshes are drawn automatically with an appropriate effect
- when main objects are drawn. But meshes can be used independently
- if the 3D format is acting as a library of meshes. Mesh objects
- should inherit from QGLSceneNode.
- \endlist
-
- Typically, the full scene represented by an external model format
- is not interesting to the application. 3D modelling packages
- regularly insert cameras, lights, effects, and other library
- objects that are useful to the modelling package, but not the
- application. The mainNode() is usually the most interesting
- to applications.
-
- QGLAbstractScene makes it easy to access the major scene elements
- with object(), objects(), and mainNode().
-
- There are many other kinds of objects in the scene that may not
- be accessible via QGLAbstractScene because they are not considered
- "important" enough. For example, a file that contains the data
- for a skateboard object would contain many objects for the board,
- wheels, texturing effects, animations, and so on. The application
- may only be interested in the skateboard as a whole, and not its
- sub-components. The skateboard would be considered an important
- main object in this case, which can be easily accessed and
- incorporated into the application's logic.
-
- Each Subclass needs to provide its own policy for deciding which
- objects are considered "important".
-
- \sa QGLSceneNode, QGLSceneFormatPlugin
-*/
-
-class QGLAbstractScenePrivate
-{
-public:
- QGLAbstractScenePrivate()
- : picking(false), nextPickId(-1), pickNodesDirty(true) {}
- bool picking;
- int nextPickId;
- QList<QGLPickNode*> pickNodes;
- QSet<QGLSceneNode*> pickable;
- bool pickNodesDirty;
-};
-
-/*!
- Constructs a 3D scene and attaches it to \a parent.
-*/
-QGLAbstractScene::QGLAbstractScene(QObject *parent)
- : QObject(parent)
- , d_ptr(new QGLAbstractScenePrivate)
-{
-}
-
-/*!
- Destroys this 3D scene.
-*/
-QGLAbstractScene::~QGLAbstractScene()
-{
-}
-
-/*!
- \internal
-*/
-void QGLAbstractScene::childEvent(QChildEvent *event)
-{
- Q_D(QGLAbstractScene);
- if (event->type() == QEvent::ChildAdded)
- d->pickNodesDirty = true;
-}
-
-/*!
- Sets this scene to be pickable if \a enable is true, otherwise picking
- is disabled. If the scene is set to be pickable, pick nodes are
- generated by calling generatePickNodes().
-
- \sa generatePickNodes(), pickable()
-*/
-void QGLAbstractScene::setPickable(bool enable)
-{
- Q_D(QGLAbstractScene);
- if (enable != d->picking)
- {
- d->picking = enable;
- if (d->picking)
- generatePickNodes();
- }
-}
-
-/*!
- Returns true if this scene is pickable.
-
- \sa setPickable()
-*/
-bool QGLAbstractScene::pickable() const
-{
- Q_D(const QGLAbstractScene);
- return d->picking;
-}
-
-/*!
- Generates QGLPickNode instances for important QGLSceneNode instances that are
- pickable. Objects that are either not important or not pickable can
- be omitted. The default implementation simply generates pick nodes
- for every top level object of type QGLSceneNode.
-
- Sub-classes may implement different schemes for picking. When doing
- so parent the QGLPickNode objects onto the scene, so that they will
- appear in the list returned by pickNodes()
-
- \sa pickNodes(), setPickable()
-*/
-void QGLAbstractScene::generatePickNodes()
-{
- Q_D(QGLAbstractScene);
- QList<QObject *> objs = objects();
- QList<QObject *>::iterator it = objs.begin();
- d->pickNodes.clear();
- for ( ; it != objs.end(); ++it)
- {
- QGLSceneNode *n = qobject_cast<QGLSceneNode *>(*it);
- if (d) {
- if (!d->pickable.contains(n)) {
- n->setPickNode(new QGLPickNode(this));
- d->pickable.insert(n);
- }
- d->pickNodes.append(n->pickNode());
- }
- }
-}
-
-/*!
- Increments and returns the next available pick id for this scene.
-*/
-int QGLAbstractScene::nextPickId()
-{
- return ++d_ptr->nextPickId;
-}
-
-/*!
- Returns a list of the pick nodes that have been parented onto this
- scene.
-
- \sa generatePickNodes()
-*/
-QList<QGLPickNode *> QGLAbstractScene::pickNodes() const
-{
- if (d_ptr->pickNodesDirty)
- {
- const_cast<QGLAbstractScene*>(this)->generatePickNodes();
- d_ptr->pickNodesDirty = false;
- }
- return d_ptr->pickNodes;
-}
-
-/*!
- \fn QList<QObject *> QGLAbstractScene::objects() const
-
- Returns a list of all objects in the scene which are considered
- important.
-
- Important objects will typically be the main mesh object, cameras,
- lights, and other top-level objects. Sub-meshes and effects
- are normally not considered important unless the scene is
- acting as a library of meshes and effects.
-
- \sa objectNames(), object(), mainNode()
-*/
-
-/*!
- Returns a list of the names of all objects in the scene which
- are considered important, and which have non-empty names
- associated with them.
-
- The default implementation calls objects() and then compiles a list
- of all non-empty object names.
-
- \sa objects()
-*/
-QStringList QGLAbstractScene::objectNames() const
-{
- QList<QObject *> objs = objects();
- QStringList names;
- for (int index = 0; index < objs.count(); ++index) {
- QObject *object = objs.at(index);
- if (object) {
- QString name = object->objectName();
- if (!name.isEmpty())
- names += name;
- }
- }
- return names;
-}
-
-/*!
- Returns the scene object that has the specified \a name;
- or null if the object was not found.
-
- The default implementation searches objects() for an object that
- matches \a name.
-
- \sa objects()
-*/
-QObject *QGLAbstractScene::object(const QString& name) const
-{
- if (name.isEmpty())
- return 0;
- QList<QObject *> objs = objects();
- for (int index = 0; index < objs.count(); ++index) {
- QObject *object = objs.at(index);
- if (object && object->objectName() == name)
- return object;
- }
- return 0;
-}
-
-
-/*!
- \fn QGLSceneNode *QGLAbstractScene::mainNode() const
-
- Returns the main mesh node in the scene, or null if the scene
- does not contain a main mesh node.
-
- \sa objects()
-*/
-
-#if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
-Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
- (QGLSceneFormatFactoryInterface_iid, QLatin1String("/sceneformats")))
-#endif
-
-/*!
- Loads a scene from \a device in the specified \a format using
- the registered scene format plugins. If \a format is an empty
- string, then the format will be autodetected from the filename
- extension of \a device. The \a url specifies the location of
- the data in \a device so that relative resources can be located.
-
- The \a options string is passed to the underlying format loader
- and its meaning and format depend on the loader. For example the
- format string for the .3ds loader accepts the following options:
- \list
- \o ForceSmooth - average normals for a smooth appearance
- \o ForceFaceted - per face normals for a faceted appearance
- \o NativeIndices - map native indices for poorly smoothed models
- \o CorrectNormals - fix inverted normals on models with bad windings
- \o CorrectAcute - fix normals on models that smooth acute angles
- \endlist
-
- The options may be specified globally for the whole model, or just
- for a particular mesh.
-
- In this example smoothing is forced on globally, and native indices
- are used on just the mesh called "BattCoverMesh".
-
- \code
- QString op = "ForceSmooth BattCoverMesh=NativeIndices";
- QString file = "music-player.3ds";
- QGLAbstractScene *scene = QGLAbstractScene::loadScene(file, QString(), op);
- \endcode
-
- Returns the scene object, or null if the scene could not be loaded
- or the \a format was not supported by any of the plugins.
-
- \sa QGLSceneFormatPlugin
-*/
-QGLAbstractScene *QGLAbstractScene::loadScene
- (QIODevice *device, const QUrl& url, const QString& format, const QString &options)
-{
-#if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
-
- QFactoryLoader *l = loader();
- QStringList keys = l->keys();
-
- // If the format is not specified, then use the filename/url extension.
- QString fmt = format;
- if (fmt.isEmpty()) {
- //First try to resolve a file io device
- QFile *file = qobject_cast<QFile *>(device);
- QString name;
- if (file) {
- name = file->fileName();
- } else {
- //Next try to resolve a network io device
- QNetworkReply *reply = qobject_cast<QNetworkReply *>(device);
- if (reply)
- name = reply->url().path();
- else {
- //otherwise just use the url pathname.
- name = url.path();
- }
- }
- int dot = name.lastIndexOf(QLatin1Char('.'));
- QString suffix = name.mid(dot+1).toLower();
- int index = keys.indexOf(suffix);
- if (index >= 0)
- fmt = suffix;
- }
-
- // Find the plugin that handles the format and ask it to create a handler.
- if (QGLSceneFormatFactoryInterface *factory
- = qobject_cast<QGLSceneFormatFactoryInterface*>
- (l->instance(fmt))) {
- QGLSceneFormatHandler *handler = factory->create(device, url, fmt);
- if (handler) {
- handler->setDevice(device);
- handler->setUrl(url);
- handler->setFormat(format);
-
-
- if (!options.isEmpty())
- handler->decodeOptions(options);
-
- QGLAbstractScene *scene = 0;
- if (!device) {
- scene = handler->download();
- } else {
- scene = handler->read();
- }
- return scene;
- }
- }
-
- // If we get here, then the format is not supported by any of the plugins.
-#ifndef QT_NO_DEBUG
- qWarning("Could not create handler for format %s"
- "- check plugins are installed correctly in %s",
- qPrintable(fmt),
- qPrintable(QLibraryInfo::location(QLibraryInfo::PluginsPath)));
-#endif
- return 0;
-#else // QT_NO_LIBRARY || QT_NO_SETTINGS
- Q_UNUSED(device);
- Q_UNUSED(url);
- Q_UNUSED(format);
- return 0;
-#endif // QT_NO_LIBRARY || QT_NO_SETTINGS
-}
-
-/*!
- Loads a scene from the internet in the specified \a format using
- the registered scene format plugins. If \a format is an empty
- string, then the format will be autodetected from the filename
- extension of the \a url, which specifies the location of
- the data online.
-
- The \a options string is passed to the underlying format loader
- and its meaning and format depend on the loader. For example the
- format string for the .3ds loader accepts the following options:
- \list
- \o ForceSmooth - average normals for a smooth appearance
- \o ForceFaceted - per face normals for a faceted appearance
- \o NativeIndices - map native indices for poorly smoothed models
- \o CorrectNormals - fix inverted normals on models with bad windings
- \o CorrectAcute - fix normals on models that smooth acute angles
- \endlist
-
- The options may be specified globally for the whole model, or just
- for a particular mesh.
-
- In this example smoothing is forced on globally, and native indices
- are used on just the mesh called "BattCoverMesh".
-
- \code
- QString op = "ForceSmooth BattCoverMesh=NativeIndices";
- QString url = "http://www.example.url.com/music-player.3ds";
- QGLAbstractScene *scene = QGLAbstractScene::loadScene(url, QString(), op);
- \endcode
-
- Returns the scene object, or null if the scene could not be loaded
- or the \a format was not supported by any of the plugins.
-
- The scene object returned by this will contain only a single stub
- node at the root of the scenegraph, which will be filled out later
- once the asynchronous download of the scene data is complete.
-
- \sa QGLSceneFormatPlugin
-*/
-QGLAbstractScene *QGLAbstractScene::loadScene
- (const QUrl& url, const QString& format, const QString &options)
-{
- return QGLAbstractScene::loadScene(0, url, format, options);
-}
-
-/*!
- Loads a scene from \a fileName in the specified \a format, with the
- supplied \a options, and using the registered scene format plugins.
-
- If \a format is an empty string, then the format will be autodetected
- from the extension of \a fileName.
-
- The \a options string is passed to the underlying format loader
- and its meaning and format depend on the loader. See the doc above
- for loadScene() for details on the 3ds format options.
-
- Returns the scene object, or null if the scene could not be loaded
- or the \a format was not supported by any of the plugins.
-
- \sa QGLSceneFormatPlugin
-*/
-QGLAbstractScene *QGLAbstractScene::loadScene
- (const QString& fileName, const QString& format, const QString &options)
-{
- QUrl fileUrl(fileName);
-
- if (fileUrl.scheme()!="http" && fileUrl.scheme()!="ftp") {
- QFile file(fileName);
- if (!file.open(QIODevice::ReadOnly))
- {
- if (options.contains(QLatin1String("ShowWarnings")))
- qWarning("Could not read %s", qPrintable(fileName));
- return 0;
- }
- QFileInfo fi(fileName);
- QUrl url = QUrl::fromLocalFile(fi.absoluteFilePath());
- return loadScene(&file, url, format, options);
- } else {
- //the following call should initiate network loading on the correct
- //downloader class.
- return loadScene(QUrl(fileName), format, options);
- }
-}
-
-/*!
- \enum QGLAbstractScene::FormatListType
- This enum specifies the format of the list returned by the supportedFormats() function.
-
- \value AsFilter Return a format list that may be used as a filter.
- \value AsSuffix Return a format list that is simply the filename suffixes.
-*/
-
-/*!
- Returns a list of all supported formats known by currently available
- sceneformat plugins, in the format type \a t.
-
- If \a t is QGLAbstractScene::AsFilter then the result may be passed
- to QDir::setNameFilters(), or used in other filters. This is the default.
-
- For example to create a file dialog to load model files use this:
- \code
- QString modelsDir = QDir::toNativeSeperators(QDir::homePath());
- QString filter = tr("Models (%1)").arg(QAbstractScene::supportedFormats().join(" "));
- QString fileName = QFileDialog::getOpenFileName(this,
- tr("Open File"), modelsDir, filter));
- \endcode
-
- Otherwise (when \a t is QGLAbstractScene::AsSuffix) it is simply a list
- of file name suffixes.
-
- Note that this function may be expensive to
- call since it scans for available plugins, and loads each one it
- finds to get an accurate report of formats supported at run-time.
-*/
-QStringList QGLAbstractScene::supportedFormats(QGLAbstractScene::FormatListType t)
-{
- QStringList formats;
- QSet<QString> formatSet;
- QSet<QString> dirSet;
- QStringList pluginPaths = QCoreApplication::libraryPaths();
- QStringList::const_iterator it = pluginPaths.constBegin();
- for ( ; it != pluginPaths.constEnd(); ++it)
- {
- QString path = *it;
- QDir sceneformatDir(path + QLatin1String("/sceneformats"));
- path = sceneformatDir.absolutePath();
- if (!sceneformatDir.exists() || dirSet.contains(path))
- continue;
- dirSet.insert(path);
- sceneformatDir.setFilter(QDir::Files);
- QStringList entries = sceneformatDir.entryList();
- QStringList::const_iterator fit = entries.constBegin();
- for ( ; fit != entries.constEnd(); ++fit)
- {
- QString fi = *fit;
- QPluginLoader loader(sceneformatDir.absoluteFilePath(fi));
- QObject *inst = loader.instance();
- QGLSceneFormatFactoryInterface *iface = qobject_cast<QGLSceneFormatFactoryInterface*>(inst);
- if (iface)
- {
- QStringList formatKeys = iface->keys();
- QStringList::const_iterator kit = formatKeys.constBegin();
- for ( ; kit != formatKeys.constEnd(); ++kit)
- {
- QString k = *kit;
- if (!formatSet.contains(k) && !k.contains("/")) // dont add mime-type keys
- {
- if (t == AsFilter)
- k.prepend("*.");
- formatSet.insert(k);
- formats.append(k);
- }
- }
- }
- }
- }
- return formats;
-}
-
-/*!
- \fn QGLAbstractScene::sceneUpdated()
- \internal
- This signal should be emitted when a network download of a scene has
- been completed.
-
- The user is left to implement the exact mechanism behind the scenes which
- causes this signal to be emitted, and is responsible for the handling
- of the signal.
-*/
-
-
-QT_END_NAMESPACE
diff --git a/src/threed/scene/qglabstractscene.h b/src/threed/scene/qglabstractscene.h
deleted file mode 100644
index 8fc7a5fa..00000000
--- a/src/threed/scene/qglabstractscene.h
+++ /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$
-**
-****************************************************************************/
-
-#ifndef QGLABSTRACTSCENE_H
-#define QGLABSTRACTSCENE_H
-
-#include "qt3dglobal.h"
-#include "qglscenenode.h"
-
-#include <QtCore/qstringlist.h>
-#include <QtCore/qurl.h>
-#include <QtCore/qscopedpointer.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class QGLAbstractScenePrivate;
-class QIODevice;
-class QGLPickNode;
-
-class Q_QT3D_EXPORT QGLAbstractScene : public QObject
-{
- Q_OBJECT
-public:
- explicit QGLAbstractScene(QObject *parent = 0);
- virtual ~QGLAbstractScene();
-
- virtual void setPickable(bool enable);
- virtual bool pickable() const;
- virtual void generatePickNodes();
- QList<QGLPickNode *> pickNodes() const;
- int nextPickId();
-
- virtual QList<QObject *> objects() const = 0;
- virtual QStringList objectNames() const;
- virtual QObject *object(const QString& name) const;
- virtual QGLSceneNode *mainNode() const = 0;
-
- static QGLAbstractScene *loadScene
- (const QUrl& url, const QString& format = QString(),
- const QString& options = QString());
- static QGLAbstractScene *loadScene
- (QIODevice *device, const QUrl& url, const QString& format = QString(),
- const QString& options = QString());
- static QGLAbstractScene *loadScene
- (const QString& fileName, const QString& format = QString(),
- const QString& options = QString());
-
- enum FormatListType {
- AsFilter, AsSuffix
- };
-
- static QStringList supportedFormats(FormatListType t = AsFilter);
-
-signals:
- void sceneUpdated();
-
-protected:
- void childEvent(QChildEvent * event);
-
-private:
- QScopedPointer<QGLAbstractScenePrivate> d_ptr;
-
- Q_DISABLE_COPY(QGLAbstractScene)
- Q_DECLARE_PRIVATE(QGLAbstractScene)
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/scene/qglpicknode.cpp b/src/threed/scene/qglpicknode.cpp
deleted file mode 100644
index 8275aacd..00000000
--- a/src/threed/scene/qglpicknode.cpp
+++ /dev/null
@@ -1,215 +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 "qglpicknode.h"
-#include "qglabstractscene.h"
-
-#include <QtGui/qevent.h>
-
-/*!
- \class QGLPickNode
- \brief The QGLPickNode class enables picking for objects in a 3D scene.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::scene
-
- QGLPickNode is a QObject sub-class, relatively light-weight, that can
- shadow QSceneObject instances and provide picking capability. The
- QGLPickNode instance receives events sent to it by picking views, such
- as the QGLView class, and emits relevant signals in response.
-
- QGLSceneObjects wanting to support picking, should implement the methods
- \list
- \o QGLSceneNode::pickNode()
- \o QGLSceneNode::setPickNode()
- \endlist
- and also implement rendering such that the QGLPainter has the relevant
- \l{QGLPainter::setObjectPickId()}{pick id function} called.
-
- These functions are already implemented for the QGLSceneNode object type.
-
- Picking can then be simply enabled by calling the QGLAbstractScene function
- setPickable() to turn on picking and generate pick nodes for the relevant
- scene objects.
-
- In order to respond to picking, the view class should simply register the
- picknodes, and connect a relevant slot to the pick nodes signal.
-
- For the QGLView class that code is simply:
- \code
- QList<QGLPickNode *>nodes = manager->pickNodes();
- foreach (QGLPickNode *node, nodes)
- {
- registerObject(node->id(), node);
- connect(node, SIGNAL(clicked()),
- this, SLOT(objectPicked()));
- }
- \endcode
-
- The pick nodes should be unregistered with similar code for the QGLView if
- switching to a different scene.
-
- To be able to recover the relevant QGLSceneNode inside the called slot,
- the object may be set onto the QGLPickNode with the setTarget() function,
- and recovered with target() inside the slot, since the QGLPickNode will
- be the sender() for the slot.
-
- QGLSceneNode already sets itself as the target during the pick enable step.
-
- \sa QGLSceneNode, QGLView
-*/
-
-/*!
- Construct a new QGLPickNode object managed by and parented onto
- the \a parent scene. The nextPickId() function will be called on
- \a parent to assign a pick id to this new node.
-*/
-QGLPickNode::QGLPickNode(QGLAbstractScene *parent) :
- QObject(parent), m_id(-1), m_target(0)
-{
- if (parent)
- m_id = parent->nextPickId();
-}
-
-/*!
- \fn int QGLPickNode::id() const
- Returns the unique id for this node. This value is assigned by
- the parent scene for this node and should be different for every
- node in the scene. Returns -1 if the id has not been set yet.
-
- \sa setId()
-*/
-
-/*!
- \fn void QGLPickNode::setId(int id)
- Sets the unique \a id for this node. Generally this function should not
- be needed, since the constructor causes a unique id to be obtained
- from the parent scene. This function exists mainly for testing
- purposes.
-
- \sa id()
-*/
-
-/*!
- \fn QGLSceneNode *QGLPickNode::target() const
- Returns the QGLSceneNode which is the target of this pick node;
- null if the target has not been set yet.
-
- \sa setTarget()
-*/
-
-/*!
- \fn void QGLPickNode::setTarget(QGLSceneNode *target)
- Sets the \a target for this pick node.
-
- \sa target()
-*/
-
-/*!
- \fn void QGLPickNode::pressed()
- Signal emitted when the scene object for this node has the mouse pressed
- while the cursor is on the object in the scene.
-*/
-
-/*!
- \fn void QGLPickNode::released()
- Signal emitted when the scene object for this node has the mouse released
- while the cursor is on the object in the scene.
-*/
-
-/*!
- \fn void QGLPickNode::clicked()
- Signal emitted when the scene object for this node has the mouse pressed
- and then released while the cursor is on the object in the scene.
-*/
-
-/*!
- \fn void QGLPickNode::doubleClicked()
- Signal emitted when the scene object for this node has the mouse clicked
- twice in succession while the cursor is on the object in the scene.
-*/
-
-/*!
- \fn void QGLPickNode::hoverChanged()
- Signal emitted when the scene object for this node has the mouse moved
- into or out of this object in the scene.
-*/
-
-/*!
- \internal
-*/
-bool QGLPickNode::event(QEvent *e)
-{
- // ripped off from teaservice demo, but not before the same code
- // was ripped off and put in item3d.cpp - those should probably all
- // use this implementation here
- if (e->type() == QEvent::MouseButtonPress)
- {
- QMouseEvent *me = (QMouseEvent *)e;
- if (me->button() == Qt::LeftButton)
- emit pressed();
- }
- else if (e->type() == QEvent::MouseButtonRelease)
- {
- QMouseEvent *me = (QMouseEvent *)e;
- if (me->button() == Qt::LeftButton)
- {
- emit released();
- if (me->x() >= 0) // Positive: inside object, Negative: outside.
- emit clicked();
- }
- }
- else if (e->type() == QEvent::MouseButtonDblClick)
- {
- emit doubleClicked();
- }
- else if (e->type() == QEvent::Enter)
- {
- //m_hovering = true;
- emit hoverChanged();
- }
- else if (e->type() == QEvent::Leave)
- {
- //m_hovering = false;
- emit hoverChanged();
- }
- return QObject::event(e);
-}
diff --git a/src/threed/scene/qglpicknode.h b/src/threed/scene/qglpicknode.h
deleted file mode 100644
index 5b53d5ff..00000000
--- a/src/threed/scene/qglpicknode.h
+++ /dev/null
@@ -1,82 +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 QGLPICKNODE_H
-#define QGLPICKNODE_H
-
-#include <QtCore/qobject.h>
-#include "qt3dglobal.h"
-
-QT_BEGIN_NAMESPACE
-
-class QGLAbstractScene;
-class QGLSceneNode;
-class QEvent;
-
-class Q_QT3D_EXPORT QGLPickNode : public QObject
-{
- Q_OBJECT
-public:
- explicit QGLPickNode(QGLAbstractScene *parent = 0);
- int id() const { return m_id; }
- void setId(int id) { m_id = id; }
-
- QGLSceneNode *target() const { return m_target; }
- void setTarget(QGLSceneNode *target) { m_target = target; }
-
-Q_SIGNALS:
- void pressed();
- void released();
- void clicked();
- void doubleClicked();
- void hoverChanged();
-
-public Q_SLOTS:
-
-protected:
- bool event(QEvent *e);
- int m_id;
- QGLSceneNode *m_target;
-};
-
-QT_END_NAMESPACE
-
-#endif // QGLPICKNODE_H
diff --git a/src/threed/scene/qglrenderorder.cpp b/src/threed/scene/qglrenderorder.cpp
deleted file mode 100644
index adaa5883..00000000
--- a/src/threed/scene/qglrenderorder.cpp
+++ /dev/null
@@ -1,318 +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 "qglrenderorder.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGLRenderOrder
- \brief The QGLRenderOrder class represents an order of a scene node during rendering.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::scene
-
- The QGLRenderOrder class works with the QGLRenderSequencer to optimize
- the rendering order of scene nodes.
-
- The class encapsulates the ordering with which QGLSceneNodes appear in the
- rendering of a scene. Every scene node that has the same rendering properties
- maps to the same QGLRenderOrder.
-
- QGLRenderOrder instances are based on a scene node, and the path through
- the scene graph by which the node was reached. This is necessary since the
- same node may appear with different rendering properties in multiple
- different places in the rendering graph.
-
- For example a node holding a model of a pawn chess piece may appear in
- several different places on a board, some with a white material and some
- with a black material.
-
- To capture this concept QGLRenderOrder instances are constructed from a
- pointer to a QGLSceneNode, and a QGLRenderState instance.
-
- A render order then calculates the effective values of its various attributes
- based on both the node, and the state.
-
- Custom render orders may be created by sub-classing QGLRenderOrderComparator
- and reimplementing the following methods:
- \list
- \i isEqualTo()
- \i isLessThan()
- \endlist
-
- By default all nodes which have the same effect type are rendered together,
- and then within that, those nodes which have the same material are
- rendered together.
-
- \sa QGLRenderOrderComparator
-*/
-
-/*!
- \fn QGLRenderOrder::QGLRenderOrder(const QGLSceneNode *node, const QGLRenderState &state)
- Creates a new QGLRenderOrder instance that encapsulates the order in this
- render pass represented by the given \a node and \a state. The \a node
- defaults to NULL, and the \a state defaults to a default constructed
- invalid QGLRenderState.
-*/
-
-/*!
- \fn QGLRenderOrder::~QGLRenderOrder()
- Destroys this QGLRenderOrder and recovers any resources.
-*/
-
-/*!
- Returns a hash value representing the effect set onto the node for
- this render order.
-*/
-uint QGLRenderOrder::effectHash() const
-{
- quint64 result = 0;
- if (effectiveHasEffect())
- {
- QGLAbstractEffect *eff = effectiveUserEffect();
- if (eff)
- result = reinterpret_cast<quint64>(eff);
- else
- result = effectiveStandardEffect() + 1;
- Q_ASSERT(result);
- }
- return qHash(result);
-}
-
-/*!
- Returns true if this QGLRenderOrder is equal to the \a rhs, otherwise
- returns false. Reimplement this function when creating a sub-class of
- QGLRenderOrder.
-
- \sa isLessThan()
-*/
-bool QGLRenderOrder::isEqual(const QGLRenderOrder &rhs) const
-{
- if (this == &rhs)
- return true;
- bool result = false;
- bool thisHasEffect = effectiveHasEffect();
- bool thatHasEffect = rhs.effectiveHasEffect();
- if (thisHasEffect && thatHasEffect)
- {
- QGLAbstractEffect *eff = effectiveUserEffect();
- if (eff)
- result = (eff == rhs.effectiveUserEffect());
- else
- result = (effectiveStandardEffect() == rhs.effectiveStandardEffect());
- }
- else
- {
- result = (thisHasEffect == thatHasEffect);
- }
- if (result)
- {
- result = (effectiveMaterial() == rhs.effectiveMaterial());
- }
- if (result)
- {
- result = (effectiveBackMaterial() == rhs.effectiveBackMaterial());
- }
- return result;
-}
-
-/*!
- Returns true if this QGLRenderOrder is less than the \a rhs, otherwise
- returns false. Reimplement this function when creating a sub-class of
- QGLRenderOrder.
-
- The default implementation sorts first by effect, second by material (front
- then back).
-
- Sorting by material is ordered by pointer comparison.
-
- Sorting by effect is based on the following order, from lowest to
- highest:
- \list
- \o No effect - hasEffect() == true
- \o Standard effect - ordered by numerical value, eg QGL::FlatColor < QGL::LitMaterial
- \o User effect - ordered by pointer comparison
- \endlist
- So a node with \c{hasEffect() == false} node is \i{less than} a node with
- a custom user effect, for example.
-
- \sa isEqual()
-*/
-bool QGLRenderOrder::isLessThan(const QGLRenderOrder &rhs) const
-{
- bool result = false;
- bool thisHasEffect = effectiveHasEffect();
- bool thatHasEffect = rhs.effectiveHasEffect();
- if (thisHasEffect && thatHasEffect)
- {
- QGLAbstractEffect *eff = effectiveUserEffect();
- if (eff)
- result = (eff < rhs.effectiveUserEffect());
- else
- result = !rhs.effectiveUserEffect() &&
- (effectiveStandardEffect() < rhs.effectiveStandardEffect());
- }
- else
- {
- result = !thisHasEffect;
- }
- if (!result)
- {
- result = (effectiveMaterial() < rhs.effectiveMaterial());
- }
- if (!result)
- {
- result = (effectiveBackMaterial() < rhs.effectiveBackMaterial());
- }
- return result;
-}
-
-/*!
- \fn bool QGLRenderOrder::isValid() const
- Returns true if this is a valid QGLRenderOrder, that is it was
- initialized with a non-null QGLSceneNode.
-*/
-
-/*!
- \fn bool QGLRenderOrder::operator!=(const QGLRenderOrder &rhs) const
- Returns true if this QGLRenderOrder is not equal to the \a rhs, otherwise
- returns false. This function simply returns \c{!isEqual(rhs)}.
-*/
-
-/*!
- \fn bool QGLRenderOrder::bool operator==(const QGLRenderOrder &rhs) const
- Returns true if this QGLRenderOrder is equal to the \a rhs, otherwise
- returns false. This function simply returns \c{isEqual(rhs)}.
-*/
-
-/*!
- \fn bool QGLRenderOrder::operator<(const QGLRenderOrder &rhs) const
- Returns true if this QGLRenderOrder is less than to the \a rhs, otherwise
- returns false. This function simply returns \c{isLessThan(rhs)}.
-*/
-
-/*!
- \fn const QGLSceneNode *QGLRenderOrder::node() const
- Returns a pointer to the scene node for which the render order is held by
- this QGLRenderOrder instance. This is simply the value passed to the
- constructor.
-*/
-
-/*!
- \fn QGLRenderState QGLRenderOrder::state() const
- Returns a pointer to the render state for this order. This is simply the
- value passed to the constructor.
-*/
-
-/*!
- \fn void QGLRenderOrder::setState(const QGLRenderState &state)
- Sets the \a state for this order.
-*/
-
-/*!
- \fn QGLAbstractEffect *QGLRenderOrder::effectiveUserEffect() const
- Returns the effective user effect of the node set for this render
- order, taking into account any effect inherited from parent nodes
- as specified by the render state().
-
- \sa state(), effectiveHasEffect()
-*/
-
-/*!
- \fn QGL::StandardEffect QGLRenderOrder::effectiveStandardEffect() const
- Returns the effective standard effect of the node set for this render
- order, taking into account any effect inherited from parent nodes
- as specified by the render state().
-
- \sa state(), effectiveHasEffect()
-*/
-
-/*!
- \fn QGLMaterial *QGLRenderOrder::effectiveMaterial() const
- Returns the effective material of the node set for this render
- order, taking into account any effect inherited from parent nodes
- as specified by the render state().
-
- \sa state(), effectiveBackMaterial()
-*/
-
-/*!
- \fn QGLMaterial *QGLRenderOrder::effectiveBackMaterial() const
- Returns the effective back material of the node set for this render
- order, taking into account any effect inherited from parent nodes
- as specified by the render state().
-
- \sa state(), effectiveMaterial()
-*/
-
-/*!
- \fn bool QGLRenderOrder::effectiveHasEffect() const
- Returns the effective value of whether an effect is set on the node
- set for this render order, taking into account any effect inherited
- from parent nodes as specified by the render state().
-
- \sa state()
-*/
-
-/*!
- \fn uint qHash(const QGLRenderOrder &order)
- \relates QGLRenderOrder
- Returns a hash value representation of the \a order.
-*/
-
-#ifndef QT_NO_DEBUG_STREAM
-QDebug operator<<(QDebug dbg, const QGLRenderOrder &order)
-{
- if (order.isValid())
- dbg << "QGLRenderOrder for node:" << order.node()
- << "-- effect hash:" << order.effectHash()
- << "-- material:" << order.node()->material()
- << "-- back material:" << order.node()->backMaterial();
- else
- dbg << "QGLRenderOrder -- invalid";
- return dbg;
-}
-
-#endif
-
-
-QT_END_NAMESPACE
diff --git a/src/threed/scene/qglrenderorder.h b/src/threed/scene/qglrenderorder.h
deleted file mode 100644
index 272f62f8..00000000
--- a/src/threed/scene/qglrenderorder.h
+++ /dev/null
@@ -1,203 +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 QGLRENDERORDER_H
-#define QGLRENDERORDER_H
-
-#include "qglscenenode.h"
-#include "qglrenderstate.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class Q_QT3D_EXPORT QGLRenderOrder
-{
-public:
- explicit QGLRenderOrder(const QGLSceneNode *node = 0, const QGLRenderState &state = QGLRenderState())
- : m_node(node)
- , m_state(state)
- {
- }
- ~QGLRenderOrder() {}
-
- uint effectHash() const;
- bool isEqual(const QGLRenderOrder &rhs) const;
- bool isLessThan(const QGLRenderOrder &rhs) const;
- inline bool isValid() const;
-
- inline bool operator!=(const QGLRenderOrder &rhs) const;
- inline bool operator==(const QGLRenderOrder &rhs) const;
- inline bool operator<(const QGLRenderOrder &rhs) const;
-
- inline const QGLSceneNode *node() const;
- inline void setState(const QGLRenderState &state);
- inline QGLRenderState state() const;
- inline QGLAbstractEffect *effectiveUserEffect() const;
- inline QGL::StandardEffect effectiveStandardEffect() const;
- inline QGLMaterial *effectiveMaterial() const;
- inline QGLMaterial *effectiveBackMaterial() const;
- inline bool effectiveHasEffect() const;
-private:
- const QGLSceneNode *m_node;
- QGLRenderState m_state;
-};
-
-
-inline bool QGLRenderOrder::isValid() const
-{
- return m_node;
-}
-
-inline bool QGLRenderOrder::operator!=(const QGLRenderOrder &rhs) const
-{
- return !isEqual(rhs);
-}
-
-inline bool QGLRenderOrder::operator==(const QGLRenderOrder &rhs) const
-{
- return isEqual(rhs);
-}
-
-inline bool QGLRenderOrder::operator<(const QGLRenderOrder &rhs) const
-{
- return isLessThan(rhs);
-}
-
-inline const QGLSceneNode *QGLRenderOrder::node() const
-{
- return m_node;
-}
-
-inline QGLRenderState QGLRenderOrder::state() const
-{
- return m_state;
-}
-
-inline void QGLRenderOrder::setState(const QGLRenderState &state)
-{
- m_state = state;
-}
-
-inline QGLAbstractEffect *QGLRenderOrder::effectiveUserEffect() const
-{
- QGLAbstractEffect *result = 0;
- if (m_node)
- {
- if (m_node->userEffect())
- result = m_node->userEffect();
- else if (m_state.userEffect())
- result = m_state.userEffect();
- }
- return result;
-}
-
-inline QGL::StandardEffect QGLRenderOrder::effectiveStandardEffect() const
-{
- QGL::StandardEffect result = QGL::FlatColor;
- if (m_node)
- {
- if (m_node->hasEffect())
- result = m_node->effect();
- else if (m_state.hasEffect())
- result = m_state.standardEffect();
- }
- return result;
-}
-
-inline QGLMaterial *QGLRenderOrder::effectiveMaterial() const
-{
- QGLMaterial *result = 0;
- if (m_node)
- {
- if (m_node->material())
- result = m_node->material();
- else if (m_state.material())
- result = m_state.material();
- }
- return result;
-}
-
-inline QGLMaterial *QGLRenderOrder::effectiveBackMaterial() const
-{
- QGLMaterial *result = 0;
- if (m_node)
- {
- if (m_node->backMaterial())
- result = m_node->backMaterial();
- else if (m_state.backMaterial())
- result = m_state.backMaterial();
- }
- return result;
-}
-
-inline bool QGLRenderOrder::effectiveHasEffect() const
-{
- bool result = false;
- if (m_node)
- {
- if (m_node->hasEffect())
- result = true;
- else
- result = m_state.hasEffect();
- }
- return result;
-}
-
-inline uint qHash(const QGLRenderOrder &order)
-{
- quint64 result = order.effectHash();
- return result ^ reinterpret_cast<quint64>(order.effectiveMaterial());
-}
-
-#ifndef QT_NO_DEBUG_STREAM
-#include <QtCore/qdebug.h>
-Q_QT3D_EXPORT QDebug operator<<(QDebug dbg, const QGLRenderOrder &order);
-#endif
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // QGLRENDERORDER_H
diff --git a/src/threed/scene/qglrenderordercomparator.cpp b/src/threed/scene/qglrenderordercomparator.cpp
deleted file mode 100644
index 8d41e0a4..00000000
--- a/src/threed/scene/qglrenderordercomparator.cpp
+++ /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$
-**
-****************************************************************************/
-
-#include "qglrenderordercomparator.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGLRenderOrderComparator
- \brief The QGLRenderOrderComparator class compares QGLRenderOrder instances.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::scene
-
- The QGLRenderOrderComparator class works with the QGLRenderSequencer and
- QGLRenderOrder classes to optimize the rendering order of scene nodes.
-
- This class is responsible for comparing QGLRenderOrder instances for
- the QGLRenderSequencer.
-
- Custom render orders may be created by sub-classing QGLRenderOrderComparator
- and reimplementing the following method:
- \list
- \i bool operator()(const QGLRenderOrder &lhs, const QGLRenderOrder &rhs)
- \endlist
-
- Then set an instance of your class onto QGLPainter:
-
- \code
- void MyView::initializeGL(QGLPainter *painter)
- {
- painter->renderSequencer()->setRenderOrderComparator(new MyRenderOrderComparator);
- }
-
- void MyView::paintGL(QGLPainter *painter)
- {
- // draw uses QGLRenderOrder sub-class instances from m_renderOrderFactory
- complexScene->draw(painter);
- }
- \endcode
-
- See the QGLRenderOrder class documentation for more details.
-
- \sa QGLRenderOrder
-*/
-
-/*!
- \fn QGLRenderOrderComparator::QGLRenderOrderComparator()
- Construct a new QGLRenderOrderComparator.
-*/
-
-/*!
- \fn QGLRenderOrderComparator::~QGLRenderOrderComparator()
- Destroys this QGLRenderOrderComparator, recovering any resources.
-*/
-
-/*!
- Returns true if the \a lhs render order is less than the \a rhs;
- otherwise returns false.
-
- Reimplement this function when creating custom render orders.
-*/
-bool QGLRenderOrderComparator::isLessThan(const QGLRenderOrder &lhs, const QGLRenderOrder &rhs)
-{
- bool result = false;
- bool lhsHasEffect = lhs.effectiveHasEffect();
- bool rhsHasEffect = rhs.effectiveHasEffect();
- if (lhsHasEffect && rhsHasEffect)
- {
- QGLAbstractEffect *eff = lhs.effectiveUserEffect();
- if (eff)
- result = (eff < rhs.effectiveUserEffect());
- else
- result = !rhs.effectiveUserEffect() &&
- (lhs.effectiveStandardEffect() < rhs.effectiveStandardEffect());
- }
- else
- {
- result = !lhsHasEffect;
- }
- if (!result)
- {
- result = (lhs.effectiveMaterial() < rhs.effectiveMaterial());
- }
- if (!result)
- {
- result = (lhs.effectiveBackMaterial() < rhs.effectiveBackMaterial());
- }
- return result;
-}
-
-/*!
- Returns true if the \a lhs render order is equal to the \a rhs;
- otherwise returns false.
-
- Reimplement this function when creating custom render orders.
-*/
-bool QGLRenderOrderComparator::isEqualTo(const QGLRenderOrder &lhs, const QGLRenderOrder &rhs)
-{
- bool result = false;
- bool lhsHasEffect = lhs.effectiveHasEffect();
- bool rhsHasEffect = rhs.effectiveHasEffect();
- if (lhsHasEffect && rhsHasEffect)
- {
- QGLAbstractEffect *eff = lhs.effectiveUserEffect();
- if (eff)
- result = (eff == rhs.effectiveUserEffect());
- else
- result = (lhs.effectiveStandardEffect() == rhs.effectiveStandardEffect());
- }
- else
- {
- result = (lhsHasEffect == rhsHasEffect);
- }
- if (result)
- {
- result = (lhs.effectiveMaterial() == rhs.effectiveMaterial());
- }
- if (result)
- {
- result = (lhs.effectiveBackMaterial() == rhs.effectiveBackMaterial());
- }
- return result;
-}
-
-QT_END_NAMESPACE
diff --git a/src/threed/scene/qglrenderordercomparator.h b/src/threed/scene/qglrenderordercomparator.h
deleted file mode 100644
index 4ede60e9..00000000
--- a/src/threed/scene/qglrenderordercomparator.h
+++ /dev/null
@@ -1,69 +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 QGLRenderOrderComparator_H
-#define QGLRenderOrderComparator_H
-
-#include "qglrenderorder.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class QGLSceneNode;
-
-class Q_QT3D_EXPORT QGLRenderOrderComparator
-{
-public:
- QGLRenderOrderComparator() {}
- virtual ~QGLRenderOrderComparator() {}
-
- virtual bool isLessThan(const QGLRenderOrder &lhs, const QGLRenderOrder &rhs);
- virtual bool isEqualTo(const QGLRenderOrder &lhs, const QGLRenderOrder &rhs);
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // QGLRenderOrderComparator_H
diff --git a/src/threed/scene/qglrendersequencer.cpp b/src/threed/scene/qglrendersequencer.cpp
deleted file mode 100644
index 0a739ed0..00000000
--- a/src/threed/scene/qglrendersequencer.cpp
+++ /dev/null
@@ -1,369 +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 "qglrendersequencer.h"
-#include "qglrenderorder.h"
-#include "qglpainter.h"
-#include "qglrenderordercomparator.h"
-#include "qglrenderstate.h"
-
-#include <QtCore/qstack.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGLRenderSequencer
- \brief The QGLRenderSequencer class orders the rendering of QGLSceneNode instances.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::scene
-
- The QGLRenderSequencer class works with the QGLRenderOrderComparator and
- QGLRenderOrder classes to optimize the rendering order of scene nodes.
-
- In general instances of this class are managed by QGLPainter and it should
- not be necessary to explicitly create or manipulate them.
-
- The render sequencer works by tracking instances of QGLRenderOrder objects
- in a queue. As the scene graph is traversed during a call to a top-level
- node's QGLSceneNode::draw() function, the sequencer adds one QGLRenderOrder
- to the queue for each unique combination of rendering attributes.
-
- The top level scene graph node loops once for each unique combination - it
- does this in QGLSceneNode::draw() by calling nextInSequence(). At
- each iteration, a current QGLRenderOrder is maintained, and only nodes
- matching that order - as determined by \l{QGLRenderOrder::operator==()} -
- are rendered in that pass. Non-matching nodes are added to a queue in the
- order specified by \l{QGLRenderOrder::operator<()}.
-
-
- Once an iteration/pass of
- the scene graph is done, the next order is pulled from the front of the queue
- and the current QGLRenderOrder is set to it.
-
- Since the rendering attributes at a node are a function both of that node,
- and attributes inherited from its parents, and since a given node may appear
- multiple times at different places in the scene, it can thus have different
- attributes and orders in each place. So there is no one-to-one mapping
- between nodes and attributes.
-
- To deal with this, QGLRenderOrder mappings are discovered during rendering.
- There is no discovery pass. First, the initial QGLRenderOrder is lazily set
- when the first geometry is actually drawn to the GPU - latching in that order
- as the first current order. From that point, orders discovered that are
- distinct from the current one are skipped in this rendering pass - by returning
- false from renderInSequence() - and are instead added to the queue for rendering
- on a subsequent pass.
-
- When the final pass has been made, renderInSequence() returns false to the
- top level QGLSceneNode, indicating that looping over passes is complete.
-
- \sa QGLRenderOrder
-*/
-
-class QGLRenderSequencerPrivate
-{
-public:
- QGLRenderSequencerPrivate(QGLPainter *painter);
- ~QGLRenderSequencerPrivate();
- QGLSceneNode *top;
- QLinkedList<QGLRenderOrder> queue;
- QStack<QGLRenderState> stack;
- QSet<QGLRenderOrder> exclude;
- QGLRenderOrder current;
- QGLPainter *painter;
- QGLRenderOrderComparator *compare;
- bool latched;
-};
-
-QGLRenderSequencerPrivate::QGLRenderSequencerPrivate(QGLPainter *painter)
- : top(0)
- , current(QGLRenderOrder())
- , painter(painter)
- , compare(new QGLRenderOrderComparator)
- , latched(false)
-{
-}
-
-QGLRenderSequencerPrivate::~QGLRenderSequencerPrivate()
-{
- delete compare;
-}
-
-/*!
- Construct a new QGLRenderSequencer for the \a painter.
-*/
-QGLRenderSequencer::QGLRenderSequencer(QGLPainter *painter)
- : d(new QGLRenderSequencerPrivate(painter))
-{
-}
-
-/*!
- Sets the render sequencer to operate on \a painter.
-*/
-void QGLRenderSequencer::setPainter(QGLPainter *painter)
-{
- d->painter = painter;
-}
-
-/*!
- Returns the current top node of the rendering tree, or NULL if the
- sequencer has been reset.
-*/
-QGLSceneNode *QGLRenderSequencer::top() const
-{
- return d->top;
-}
-
-/*!
- Sets the current top node of the rendering tree to \a top.
-*/
-void QGLRenderSequencer::setTop(QGLSceneNode *top)
-{
- d->top = top;
-}
-
-/*!
- Reset this sequencer to start from the top of the scene graph again.
- After this call the top() function will return NULL, and any scene
- node passed to the renderInSequence() function will be treated as the
- top of the scene graph. Also effects and materials will be ignored
- until latched in - QGLPainter::draw() will call latch() to achieve this.
-
- \sa top()
-*/
-void QGLRenderSequencer::reset()
-{
- d->top = 0;
- d->latched = false;
- d->exclude.clear();
- d->stack.clear();
- d->current = QGLRenderOrder();
-}
-
-/*!
- Returns true if there is a next rendering state in the queue; and if there
- is a new order will be pulled from the queue, and its rendering attributes
- - materials, effects and so on - will be applied to the painter for this
- sequencer. Returns false when no more rendering states are queued and
- scene is completely rendered.
-*/
-bool QGLRenderSequencer::nextInSequence()
-{
- bool nextAvailable = true;
- if (d->queue.size() > 0)
- {
- // process thru next render order
- d->current = d->queue.takeFirst();
- }
- else
- {
- // end top level loop
- nextAvailable = false;
- }
- return nextAvailable;
-}
-
-/*!
- Returns true, when this \a node should be rendered, in the order dictated
- by QGLRenderOrder objects generated by the current render order Comparator.
- The \a node must be non-NULL.
-
- When this function returns false, indicating that rendering should be
- skipped for the current pass, a check is made to ensure that a state object
- for this nodes rendering attributes is queued up for a later pass.
-
- To customize the ordering, reimplement QGLRenderOrder and
- QGLRenderOrderComparator; then set the custom Comparator onto the current
- painter using setcompare().
-
- \sa reset(), top(), nextInSequence()
-*/
-bool QGLRenderSequencer::renderInSequence(QGLSceneNode *node)
-{
- Q_ASSERT(node);
- Q_ASSERT(d->top);
- bool doRender = true;
- QGLRenderState state;
- if (!d->stack.empty())
- state = d->stack.top();
- QGLRenderOrder o(node, state);
- if (!d->current.isValid())
- d->current = o;
- if (d->latched && !d->compare->isEqualTo(o, d->current))
- {
- if (!d->exclude.contains(o))
- insertNew(o);
- doRender = false;
- }
- else
- {
- if (!d->latched)
- d->exclude.insert(o);
- }
- return doRender;
-}
-
-/*!
- Marks the render state for the \a node as started for this rendering pass. Call
- this before rendering \a node, or any child nodes of \a node.
-
- Once the rendering state is no longer valid, call endState().
-
- To actually apply the effective state, as inherited from previous calls to
- beginState() call the applyState() function.
-
- \sa endState(), applyState()
-*/
-void QGLRenderSequencer::beginState(QGLSceneNode *node)
-{
- QGLRenderState state;
- if (!d->stack.empty())
- state = d->stack.top();
- state.updateFrom(node);
- d->stack.push(state);
-}
-
-/*!
- Marks the render state for the \a node as done for this rendering pass.
-
- If a node has called beginState(), then this function must be called to maintain
- the rendering stack. If this function call is not matched by a previous
- beginState() call undefined behaviour may result. In debug mode it may assert.
-
- \sa beginState(), applyState()
-*/
-void QGLRenderSequencer::endState(QGLSceneNode *node)
-{
-#ifndef QT_NO_DEBUG_STREAM
- const QGLSceneNode *n = d->stack.top().node();
- Q_UNUSED(n);
- Q_UNUSED(node);
- Q_ASSERT(n == node);
-#endif
- d->stack.pop();
-}
-
-/*!
- Applies the current rendering state to the painter for this sequencer.
-
- \sa beginState(), endState()
-*/
-void QGLRenderSequencer::applyState()
-{
- d->latched = true;
- QGLRenderState s = d->stack.top();
- if (s.hasEffect() && !d->painter->isPicking())
- {
- if (s.userEffect())
- {
- if (d->painter->userEffect() != s.userEffect())
- d->painter->setUserEffect(s.userEffect());
- }
- else
- {
- if (d->painter->userEffect() ||
- d->painter->standardEffect() != s.standardEffect())
- d->painter->setStandardEffect(s.standardEffect());
- }
- }
- if (s.material() && !d->painter->isPicking())
- {
- QGLMaterial *mat = s.material();
- if (1) //FIXME: d->painter->faceMaterial(QGL::FrontFaces) != mat)
- {
- d->painter->setFaceMaterial(QGL::FrontFaces, mat);
- int texUnit = 0;
- for (int i = 0; i < mat->textureLayerCount(); ++i)
- {
- QGLTexture2D *tex = mat->texture(i);
- if (tex)
- {
- d->painter->glActiveTexture(GL_TEXTURE0 + texUnit);
- tex->bind();
- ++texUnit;
- }
- }
- }
- }
-}
-
-void QGLRenderSequencer::insertNew(const QGLRenderOrder &order)
-{
- QLinkedList<QGLRenderOrder>::iterator it = d->queue.begin();
- for ( ; it != d->queue.end(); ++it)
- {
- const QGLRenderOrder o = *it;
- if (d->compare->isLessThan(order, o))
- break;
- }
- d->queue.insert(it, order);
- d->exclude.insert(order);
-}
-
-/*!
- Returns the current render order comparator. By default this is an
- instance of the base class QGLRenderOrderComparator.
-
- \sa setComparator()
-*/
-QGLRenderOrderComparator *QGLRenderSequencer::comparator() const
-{
- return d->compare;
-}
-
-/*!
- Sets the current render order \a comparator. This is only needed if a
- custom rendering order is to be created. The argument \a comparator
- must be non-null, or undefined behaviour will result.
-
- Any existing current comparator is destroyed.
-
- \sa renderInSequence(), comparator()
-*/
-void QGLRenderSequencer::setComparator(QGLRenderOrderComparator *comparator)
-{
- Q_ASSERT(comparator);
- delete d->compare;
- d->compare = comparator;
-}
-
-QT_END_NAMESPACE
diff --git a/src/threed/scene/qglrendersequencer.h b/src/threed/scene/qglrendersequencer.h
deleted file mode 100644
index 55e7f1d7..00000000
--- a/src/threed/scene/qglrendersequencer.h
+++ /dev/null
@@ -1,87 +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 QGLRENDERSEQUENCER_H
-#define QGLRENDERSEQUENCER_H
-
-#include <QtCore/qlinkedlist.h>
-#include <QtCore/qset.h>
-
-#include "qglrenderorder.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class QGLSceneNode;
-class QGLPainter;
-class QGLRenderOrderComparator;
-class QGLRenderSequencerPrivate;
-
-class Q_QT3D_EXPORT QGLRenderSequencer
-{
-public:
- explicit QGLRenderSequencer(QGLPainter *painter);
- void setPainter(QGLPainter *painter);
- bool renderInSequence(QGLSceneNode *node);
- bool nextInSequence();
- void beginState(QGLSceneNode *node);
- void endState(QGLSceneNode *node);
- void reset();
- QGLSceneNode *top() const;
- void setTop(QGLSceneNode *top);
- QGLRenderOrderComparator *comparator() const;
- void setComparator(QGLRenderOrderComparator *comparator);
- void applyState();
-private:
- void insertNew(const QGLRenderOrder &order);
-
- QGLRenderSequencerPrivate *d;
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // QGLRENDERSEQUENCER_H
diff --git a/src/threed/scene/qglrenderstate.cpp b/src/threed/scene/qglrenderstate.cpp
deleted file mode 100644
index 4414dbce..00000000
--- a/src/threed/scene/qglrenderstate.cpp
+++ /dev/null
@@ -1,320 +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 "qglrenderstate.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGLRenderState
- \brief The QGLRenderState class encapsulates the states of a rendering pass.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::scene
-
- The QGLRenderState class works with the QGLRenderOrder class to optimize
- the rendering order of scene nodes.
-
- In general instances of this class are managed by the render sequencer
- and it should not be necessary to explicitly create or manipulate them.
-
- A QGLRenderState instance encapsulates rendering properties for a given
- path through the rendering process. The state includes properties such as
- effects, and materials; which may either be directly set on a scene node,
- or inherited from its parents.
-
- QGLRenderState may be subclassed in advanced applications to provide a
- different inheritance pattern for rendering properties - reimplement the
- updateFrom() function to do this. The default implementation simply sets
- an effect on the state if the argument node has an effect (found by
- calling the QGLSceneNode::hasEffect() function), and sets a material on
- the state if the node has a non-null material; otherwise the existing
- state is left as it is.
-
- The render sequencer will ensure that the relevant render state is set
- onto the painter at the beginning of the pass which renders all nodes
- with that state.
-
- \sa QGLRenderOrder
-*/
-
-class QGLRenderStatePrivate : public QSharedData
-{
-public:
- QGLRenderStatePrivate();
- ~QGLRenderStatePrivate();
- QGLRenderStatePrivate *clone() const;
-
- QBasicAtomicInt ref;
-
- bool hasEffect;
- QGLMaterial *material;
- QGLMaterial *backMaterial;
- QGL::StandardEffect standardEffect;
- QGLAbstractEffect *userEffect;
- const QGLSceneNode *node;
-};
-
-QGLRenderStatePrivate::QGLRenderStatePrivate()
- : hasEffect(false)
- , material(0)
- , backMaterial(0)
- , standardEffect(QGL::FlatColor)
- , userEffect(0)
- , node(0)
-{
- ref = 0;
-}
-
-QGLRenderStatePrivate::~QGLRenderStatePrivate()
-{
-}
-
-QGLRenderStatePrivate *QGLRenderStatePrivate::clone() const
-{
- QGLRenderStatePrivate *r = new QGLRenderStatePrivate;
- r->hasEffect = hasEffect;
- r->material = material;
- r->backMaterial = backMaterial;
- r->standardEffect = standardEffect;
- r->userEffect = userEffect;
- r->node = node;
- return r;
-}
-
-/*!
- Creates a new QGLRenderState empty of any values.
-*/
-QGLRenderState::QGLRenderState()
- : d(0)
-{
-}
-
-/*!
- Creates a new QGLRenderState as a copy of \a other
-*/
-QGLRenderState::QGLRenderState(const QGLRenderState &other)
- : d(other.d)
-{
- if (d)
- d->ref.ref();
-}
-
-/*!
- Destroys this QGLRenderState recovering and resources.
-*/
-QGLRenderState::~QGLRenderState()
-{
- if (d && !d->ref.deref())
- delete d;
-}
-
-/*!
- Assigns this QGLRenderState to be a copy of \a rhs.
-*/
-QGLRenderState &QGLRenderState::operator=(const QGLRenderState &rhs)
-{
- if (d != rhs.d)
- {
- if (d && !d->ref.deref())
- delete d;
- d = rhs.d;
- if (d)
- d->ref.ref();
- }
- return *this;
-}
-
-/*!
- Sets the values of this QGLRenderState from the \a node, where
- the node has a value. For example if the \a node has an effect
- but no material, then this state will have its effect changed to
- that of the node, but this state's material will be unchanged.
-*/
-void QGLRenderState::updateFrom(const QGLSceneNode *node)
-{
- detach();
- if (node->hasEffect())
- {
- d->hasEffect = true;
- if (node->userEffect())
- d->userEffect = node->userEffect();
- else
- d->standardEffect = node->effect();
- }
- if (node->material())
- d->material = node->material();
- if (node->backMaterial())
- d->backMaterial = node->backMaterial();
- d->node = node;
-}
-
-/*!
- Returns the user effect stored on this QGLRenderState, or null if no
- user effect has been set. The default value is null.
-*/
-QGLAbstractEffect *QGLRenderState::userEffect() const
-{
- QGLAbstractEffect *e = 0;
- if (d)
- e = d->userEffect;
- return e;
-}
-
-/*!
- Returns the standard effect stored on this QGLRenderState. The
- default value is QGL::FlatColor. To determine if an effect has
- been specifically set call hasEffect().
-*/
-QGL::StandardEffect QGLRenderState::standardEffect() const
-{
- QGL::StandardEffect e = QGL::FlatColor;
- if (d)
- e = d->standardEffect;
- return e;
-}
-
-/*!
- Returns true is there is a valid effect on this QGLRenderState. The
- default value is false.
-*/
-bool QGLRenderState::hasEffect() const
-{
- bool r = false;
- if (d)
- r = d->hasEffect;
- return r;
-}
-
-/*!
- Returns the material stored on this QGLRenderState, or null if no
- material has been set. The default value is null.
-*/
-QGLMaterial *QGLRenderState::material() const
-{
- QGLMaterial *m = 0;
- if (d)
- m = d->material;
- return m;
-}
-
-/*!
- Returns the back material stored on this QGLRenderState, or null if no
- back material has been set. The default value is null.
-*/
-QGLMaterial *QGLRenderState::backMaterial() const
-{
- QGLMaterial *m = 0;
- if (d)
- m = d->backMaterial;
- return m;
-}
-
-/*!
- Returns the node used to populate this QGLRenderState.
-*/
-const QGLSceneNode *QGLRenderState::node() const
-{
- const QGLSceneNode *s = 0;
- if (d)
- s = d->node;
- return s;
-}
-
-/*!
- Returns true if this is a valid representation of a render state, that
- is if it has ever been updated from a node; and false otherwise.
-*/
-bool QGLRenderState::isValid() const
-{
- if (d && d->node)
- return true;
- return false;
-}
-
-/*!
- \fn bool QGLRenderState::operator==(const QGLRenderState &rhs) const
- Returns true if this state is equal to \a rhs, that is if each of the
- materials, effects and values are equal to those of \a rhs.
-*/
-void QGLRenderState::detach()
-{
- if (!d) // lazy creation of data block
- {
- d = new QGLRenderStatePrivate;
- d->ref.ref();
- }
- else
- {
- if (d->ref > 1) // being shared, must detach
- {
- QGLRenderStatePrivate *temp = d->clone();
- d->ref.deref();
- d = temp;
- d->ref.ref();
- }
- }
-}
-
-/*!
- Returns a hash value representing this state.
-*/
-uint QGLRenderState::hash() const
-{
- const QByteArray bytes((const char *)d, sizeof(d));
- return qHash(bytes);
-}
-
-#ifndef QT_NO_DEBUG_STREAM
-Q_QT3D_EXPORT QDebug operator<<(QDebug dbg, const QGLRenderState &order)
-{
- dbg << "QGLRenderState" << &order << "-- user effect:" << order.userEffect()
- << "-- standardEffect:" << order.standardEffect()
- << "-- hasEffect:" << order.hasEffect()
- << "-- material:" << order.material()
- << "-- back material:" << order.backMaterial()
- << "-- node:" << order.node();
- return dbg;
-}
-
-#endif
-
-QT_END_NAMESPACE
diff --git a/src/threed/scene/qglrenderstate.h b/src/threed/scene/qglrenderstate.h
deleted file mode 100644
index 2007f19b..00000000
--- a/src/threed/scene/qglrenderstate.h
+++ /dev/null
@@ -1,105 +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 QGLRENDERSTATE_H
-#define QGLRENDERSTATE_H
-
-#include "qglnamespace.h"
-#include "qglscenenode.h"
-
-#include <QtCore/qshareddata.h>
-
-QT_BEGIN_NAMESPACE
-
-class QGLAbstractEffect;
-class QGLMaterial;
-
-class QGLRenderStatePrivate;
-
-class Q_QT3D_EXPORT QGLRenderState
-{
-public:
- QGLRenderState();
- QGLRenderState(const QGLRenderState &other);
- virtual ~QGLRenderState();
- QGLRenderState &operator=(const QGLRenderState &rhs);
- virtual void updateFrom(const QGLSceneNode *node);
- QGLAbstractEffect *userEffect() const;
- QGL::StandardEffect standardEffect() const;
- bool hasEffect() const;
- QGLMaterial *material() const;
- QGLMaterial *backMaterial() const;
- const QGLSceneNode *node() const;
- uint hash() const;
- bool operator==(const QGLRenderState &rhs) const
- {
- if (userEffect() != rhs.userEffect())
- return false;
- if (standardEffect() != rhs.standardEffect())
- return false;
- if (hasEffect() != rhs.hasEffect())
- return false;
- if (material() != rhs.material())
- return false;
- if (backMaterial() != rhs.backMaterial())
- return false;
- return true;
- }
- bool isValid() const;
-private:
- void detach();
- QGLRenderStatePrivate *d;
-};
-
-inline uint qHash(const QGLRenderState &s)
-{
- return s.hash();
-}
-
-#ifndef QT_NO_DEBUG_STREAM
-#include <QtCore/qdebug.h>
-Q_QT3D_EXPORT QDebug operator<<(QDebug dbg, const QGLRenderState &order);
-#endif
-
-QT_END_NAMESPACE
-
-#endif // QGLRENDERSTATE_H
diff --git a/src/threed/scene/qglsceneformatplugin.cpp b/src/threed/scene/qglsceneformatplugin.cpp
deleted file mode 100644
index 787d3e45..00000000
--- a/src/threed/scene/qglsceneformatplugin.cpp
+++ /dev/null
@@ -1,316 +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 "qglsceneformatplugin.h"
-#include "qdownloadmanager.h"
-#include "qabstractdownloadmanager.h"
-#include "qthreadeddownloadmanager.h"
-#include <QDebug>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGLSceneFormatHandler
- \brief The QGLSceneFormatHandler class defines the common format I/O interface for loading 3D scene formats.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::scene
-
- \sa QGLSceneFormatPlugin
-*/
-
-class QGLSceneFormatHandlerPrivate
-{
-public:
- QGLSceneFormatHandlerPrivate()
- {
- device = 0;
- m_scene = 0;
- }
-
- QIODevice *device;
- QString format;
- QUrl url;
- QGLAbstractScene *m_scene;
-};
-
-/*!
- Constructs a 3D scene format handler.
-*/
-QGLSceneFormatHandler::QGLSceneFormatHandler()
-{
- d_ptr = new QGLSceneFormatHandlerPrivate();
- m_downloadManager = 0;
-}
-
-/*!
- Destroys this 3D scene format handler.
-*/
-QGLSceneFormatHandler::~QGLSceneFormatHandler()
-{
- delete d_ptr;
-}
-
-/*!
- Returns the device currently assigned to the 3D scene format handler.
- Returns null if no device has been assigned.
-
- \sa setDevice()
-*/
-QIODevice *QGLSceneFormatHandler::device() const
-{
- return d_ptr->device;
-}
-
-/*!
- Sets the device for this 3D scene format handler to \a device.
- The handler will use this device when reading 3D scenes.
-
- The device can only be set once and must be set before calling
- read(). If you need to read multiple files, construct multiple
- instances of the appropriate QGLSceneFormatHandler subclass.
-
- \sa device()
-*/
-void QGLSceneFormatHandler::setDevice(QIODevice *device)
-{
- d_ptr->device = device;
-}
-
-/*!
- Returns the format that is currently assigned to this 3D scene
- format handler. Returns an empty string if no format has been assigned.
-
- \sa setFormat()
-*/
-QString QGLSceneFormatHandler::format() const
-{
- return d_ptr->format;
-}
-
-/*!
- Sets the format of this 3D scene format handler to \a format.
-
- \sa format()
-*/
-void QGLSceneFormatHandler::setFormat(const QString& format)
-{
- d_ptr->format = format;
-}
-
-/*!
- Returns the url of the data provided by device(). This is
- typically used when the data in device() refers to additional
- files that need to be located relative to the original
- directory.
-
- \sa setUrl()
-*/
-QUrl QGLSceneFormatHandler::url() const
-{
- return d_ptr->url;
-}
-
-/*!
- Sets the \a url of the data provided by device().
-
- \sa url()
-*/
-void QGLSceneFormatHandler::setUrl(const QUrl& url)
-{
- d_ptr->url = url;
-}
-
-/*!
- Decodes and applies \a options to this handler. Generally this will be
- called by the QGLAbstractScene::loadScene() method prior to reading
- the model data with read() or download(). Exactly what the string value may contain
- and the meaning of the encoded options depends on each individual plugin.
-
- This default implementation simply does nothing.
-*/
-void QGLSceneFormatHandler::decodeOptions(const QString &options)
-{
- Q_UNUSED(options);
-}
-
-/*!
- \fn QGLAbstractScene *QGLSceneFormatHandler::read()
-
- Reads a 3D scene from device() and returns it. Returns null if
- the format of device() is invalid and a scene could not be read.
-*/
-
-/*!
- \fn QGLAbstractScene *QGLSceneFormatHandler::download()
-
- Reads a 3D scene from a url and returns a stub to it which can be used
- the application, and will be updated with the full scene later.
-
- Returns NULL if the scene could not be created.
-*/
-
-/*!
- \class QGLSceneFormatFactoryInterface
- \brief The QGLSceneFormatFactoryInterface class provides the factory interface for QGLSceneFormatPlugin.
- \internal
-*/
-
-/*!
- \class QGLSceneFormatPlugin
- \brief The QGLSceneFormatPlugin class defines an interface for loading 3D object and scene formats.
- \ingroup qt3d
- \ingroup qt3d::scene
-
- \sa QGLSceneFormatHandler
-*/
-
-/*!
- Constructs a 3D scene format plugin with the given \a parent. This is
- invoked automatically by the Q_EXPORT_PLUGIN2() macro.
-*/
-QGLSceneFormatPlugin::QGLSceneFormatPlugin(QObject *parent)
- : QObject(parent)
-{
- //do nothing
-}
-
-/*!
- Destroys this 3D scene format plugin. This is invoked automatically
- when the plugin is unloaded.
-*/
-QGLSceneFormatPlugin::~QGLSceneFormatPlugin()
-{
- //do nothing
-}
-
-/*!
- Initiates download of the specified scene. The scene must have been
- previously specified with URL, options, format, and so on. This
- function will then create a QGLAbstractDownloadManager instance and
- submit the network request for the scene.
-
- The resultant data will be handled by the downloadComplete() slot.
-*/
-void QGLSceneFormatHandler::downloadScene()
-{
- if (!m_downloadManager) {
- if (getenv(QT3D_MULTITHREAD)) {
- //Download in a multithreaded environment
- m_downloadManager = new QThreadedDownloadManager();
- } else {
- //Download in a single threaded environment
- m_downloadManager = new QDownloadManager();
- }
- connect(m_downloadManager,SIGNAL(downloadComplete(QByteArray)), this, SLOT(downloadComplete(QByteArray)));
- }
-
- if (!m_downloadManager->beginDownload(QUrl(url().toString()))) {
- qWarning("Unable to issue asset download request.");
- }
-}
-
-/*!
- Set the pointer for the scene \a theScene currently being processed.
- This is specifically used during network loading.
-*/
-void QGLSceneFormatHandler::setScene(QGLAbstractScene *theScene)
-{
- d_ptr->m_scene = theScene;
-}
-
-/*!
- Get the pointer for the scene currently being processed. This is
- specifically used during network loading.
-*/
-QGLAbstractScene * QGLSceneFormatHandler::getScene() const
-{
- return d_ptr->m_scene;
-}
-
-/*!
- This function should be called when the download of a remotely hosted
- scene is complete. The \a sceneData will contain the relevant data for
- the scene.
-
- The user is required to reimplement this if they intend to support network
- loading of scenes in their plugin.
-*/
-void QGLSceneFormatHandler::downloadComplete(QByteArray sceneData)
-{
- Q_UNUSED(sceneData);
- //unused - re-implement if you intend to support network
- //loading of model files.
-}
-
-/*!
- Called at the end of the read() and download() functions, this function
- completes any extra cleanup required, and sets the QGLSceneFormatHandler
- it belongs to as being ready for deletion when the main event loop is next
- processed.
-*/
-void QGLSceneFormatHandler::finalize()
- {
- deleteLater();
- }
-
-/*!
- \fn QStringList QGLSceneFormatPlugin::keys() const
-
- Returns the list of format keys this plugin supports. These keys
- are usually the names of the 3D scene formats that are implemented in
- the plugin (e.g., "3ds", "obj", etc). The returned elements must
- be in lower case.
-
- \sa create()
-*/
-
-/*!
- \fn QGLSceneFormatHandler *QGLSceneFormatPlugin::create(QIODevice *device, const QUrl& url, const QString &format) const
-
- Creates and returns a QGLSceneFormatHandler for handling the data in
- \a device according to \a format. The \a url specifies the original
- location of the data for resolving relative resource references.
-
- \sa keys()
-*/
-
-QT_END_NAMESPACE
diff --git a/src/threed/scene/qglsceneformatplugin.h b/src/threed/scene/qglsceneformatplugin.h
deleted file mode 100644
index 13ac067d..00000000
--- a/src/threed/scene/qglsceneformatplugin.h
+++ /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$
-**
-****************************************************************************/
-
-#ifndef QGLSCENEFORMATPLUGIN_H
-#define QGLSCENEFORMATPLUGIN_H
-
-#include "qt3dglobal.h"
-#include <QObject>
-#include <QtCore/qplugin.h>
-#include <QtCore/qfactoryinterface.h>
-#include <QtCore/qurl.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class QGLAbstractScene;
-class QGLSceneFormatHandlerPrivate;
-class QAbstractDownloadManager;
-
-class Q_QT3D_EXPORT QGLSceneFormatHandler : public QObject
-{
- Q_OBJECT
-public:
- QGLSceneFormatHandler();
- virtual ~QGLSceneFormatHandler();
-
- QIODevice *device() const;
- void setDevice(QIODevice *device);
-
- QString format() const;
- void setFormat(const QString& format);
-
- QUrl url() const;
- void setUrl(const QUrl& url);
-
- virtual QGLAbstractScene *read() = 0;
- virtual QGLAbstractScene *download() = 0;
-
- virtual void decodeOptions(const QString &options);
-
- void finalize();
-
- void downloadScene();
-
-public slots:
- virtual void downloadComplete(QByteArray sceneData);
-protected:
- void setScene(QGLAbstractScene *theScene);
- QGLAbstractScene * getScene() const;
-
- QAbstractDownloadManager *m_downloadManager;
-private:
- QGLSceneFormatHandlerPrivate *d_ptr;
-};
-
-struct Q_QT3D_EXPORT QGLSceneFormatFactoryInterface : public QFactoryInterface
-{
- virtual QGLSceneFormatHandler *create(QIODevice *device, const QUrl& url, const QString &format = QString()) const = 0;
-};
-
-#define QGLSceneFormatFactoryInterface_iid \
- "com.trolltech.Qt.QGLSceneFormatFactoryInterface"
-Q_DECLARE_INTERFACE(QGLSceneFormatFactoryInterface, QGLSceneFormatFactoryInterface_iid)
-
-class Q_QT3D_EXPORT QGLSceneFormatPlugin : public QObject, public QGLSceneFormatFactoryInterface
-{
- Q_OBJECT
- Q_INTERFACES(QGLSceneFormatFactoryInterface:QFactoryInterface)
-public:
- explicit QGLSceneFormatPlugin(QObject *parent = 0);
- virtual ~QGLSceneFormatPlugin();
-
- virtual QStringList keys() const = 0;
- virtual QGLSceneFormatHandler *create(QIODevice *device, const QUrl& url, const QString &format = QString()) const = 0;
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/scene/qglscenenode.cpp b/src/threed/scene/qglscenenode.cpp
deleted file mode 100644
index 545793fb..00000000
--- a/src/threed/scene/qglscenenode.cpp
+++ /dev/null
@@ -1,1884 +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 "qglabstractscene.h"
-#include "qglscenenode.h"
-#include "qglscenenode_p.h"
-#include "qglpicknode.h"
-#include "qglpainter.h"
-#include "qgeometrydata.h"
-#include "qglmaterialcollection.h"
-#include "qglrendersequencer.h"
-#include "qglabstracteffect.h"
-#include "qgraphicstransform3d.h"
-
-#ifndef QT_NO_DEBUG_STREAM
-#include "qglmaterialcollection.h"
-#include "qgltexture2d.h"
-#endif
-
-#include <QtGui/qmatrix4x4.h>
-#if !defined(QT_NO_THREAD)
-#include <QtCore/qthread.h>
-#include <QtGui/qapplication.h>
-#endif
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGLSceneNode
- \brief The QGLSceneNode class defines a node in a 3D scene.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::scene
-
- QGLSceneNode represents one component of a scene. The QGLSceneNode
- class manages materials, effects and transformations for itself and
- for its child nodes.
-
- As a general approach to 3D applications, a tree of QGLSceneNodes may
- be constructed, geometry added to them, materials and transformations
- applied, all during application initialization; and then by simply
- calling the draw() function the scene is easily rendered for each frame.
-
- \section1 Geometry
-
- Multiple QGLSceneNodes can reference the same geometry, whilst
- applying different transformations and treatments to it. Since
- QGLSceneNode is a QObject sub class it cannot be copied directly, so
- instead use the clone() function for this purpose.
-
- A scene node allows referencing into sub-parts of geometry, via the start
- and count properties.
-
- The start index is an offset into the geometry at which drawing will start.
- The default start index is 0, so that drawing will start from the beginning
- of the geometry. The count dictates how many vertices will be drawn. The
- default count is 0, which instructs the underlying geometry to draw all
- vertices.
-
- A node may have no geometry, that is \c{geometry().count() == 0}. This is
- useful for example to have one node controlling or collecting together
- several child nodes to be manipulated as a unit.
-
- \section1 Materials
-
- Also a node may have a local material. This allows drawing the same geometry
- with different materials (which includes different textures).
-
- When accessing a QGLSceneNode via QML, or for simple applications, the
- pointer based material functions are convenient and intuitive, saving the
- trouble of adding the material pointer to the correct palette:
- \list
- \i material()
- \i setMaterial()
- \i backMaterial()
- \i setBackMaterial()
- \endlist
-
- For more complex applications; for example building model loaders, or for
- larger scenes; where you need to explicitly manage materials via a palette,
- use the index based functions:
- \list
- \i materialIndex()
- \i setMaterialIndex()
- \i backMaterialIndex()
- \i setBackMaterialIndex()
- \endlist
-
- The behaviour of both with respect to faces is the same - if a material()
- is specified but no backMaterial() is specified, then the material() is
- applied to both faces; if both material() and backMaterial() are non-null
- then they are applied to their specific faces.
-
- \section1 Transformations
-
- Typically the local transformation matrix is set by the process that
- constructed the node: in the case of an imported model, it is likely
- to have been specified by the model file. To make individual changes
- to the location or orientation of this node, use the position() and
- transforms() properties.
-
- \section1 Scene Graph
-
- Use childNodes() to obtain the list of child nodes, and add and remove
- child nodes by the addNode() and removeNode() methods. If a QGLSceneNode
- is constructed with a QGLSceneNode parent, then addNode() will be
- called implicitly on the parent.
-
- A child may be a child multiple times, a child may be under more than one
- parent, and several parents may reference the same child. There is however
- no protection against cycles, so a child must not be a parent of itself,
- even if indirectly.
-
- A child node for the purposes of rendering means a child added via the
- addNode() method. The default QGLSceneNode constructor will check to
- see if its parent is a QGLSceneNode and add itself via the addNode()
- function if it is.
-
- To help debug a scene, use the qDumpScene() function to get a printout
- on stderr of the entire structure of the scene below the argument node.
-
- \section1 Debugging Lighting Normals
-
- The ViewNormals option is an advanced feature for use when inspecting
- and debugging models or geometry in a scene. The lighting normals
- are displayed as a straight line from the vertex pointing in
- the direction of the lighting normal. This is useful for
- example to show where normals are inverted or wrongly
- calculated.
-
- The setting of the ViewNormals flag is not propagated to child nodes,
- instead set the flag to true for the node or nodes where its
- needed. To set the flag on all child nodes use code like:
-
- \code
- foreach (QGLSceneNode *node, scene.allChildren())
- node->setNormalViewEnabled(true);
- \endcode
-
- \image spiky-teapot.png
-
- \sa QGLAbstractScene
-*/
-
-/*!
- \enum QGLSceneNode::Option
- This enum defines option flags for QGLSceneNode. By default the none of the flags
- are set, so the options() function returns QGLSceneNode::NoOptions
-
- \value NoOptions Do not enable any QGLSceneNode options.
- \value CullBoundingBox Perform a cull using boundingBox() before
- attempting to draw the geometry().
- \value ViewNormals Enables the display of lighting normals for
- debugging purposes.
- \value ReportCulling Send a signal when an object is displayed or culled.
- \value HideNode Hide this node so it, and all its children, are excluded from rendering.
- \sa setOptions()
-*/
-
-/*!
- Constructs a new scene node and attaches it to \a parent. If parent is
- a QGLSceneNode then this node is added to it as a child.
-*/
-QGLSceneNode::QGLSceneNode(QObject *parent)
- : QObject(parent)
- , d_ptr(new QGLSceneNodePrivate())
-{
- QGLSceneNode *sceneParent = qobject_cast<QGLSceneNode*>(parent);
- if (sceneParent)
- sceneParent->addNode(this);
-}
-
-/*!
- \internal
- Used by clone().
-*/
-QGLSceneNode::QGLSceneNode(QGLSceneNodePrivate *d, QObject *parent)
- : QObject(parent)
- , d_ptr(d)
-{
- QGLSceneNode *sceneParent = qobject_cast<QGLSceneNode*>(parent);
- if (sceneParent)
- sceneParent->addNode(this);
-}
-
-/*!
- Constructs a new scene node referencing \a geometry and attaches it to
- \a parent. If parent is a QGLSceneNode then this node is added to it
- as a child.
-*/
-QGLSceneNode::QGLSceneNode(const QGeometryData &geometry, QObject *parent)
- : QObject(parent)
- , d_ptr(new QGLSceneNodePrivate())
-{
- Q_D(QGLSceneNode);
- d->geometry = geometry;
- QGLSceneNode *sceneParent = qobject_cast<QGLSceneNode*>(parent);
- if (sceneParent)
- sceneParent->addNode(this);
-}
-
-/*!
- Destroys this scene node.
-*/
-QGLSceneNode::~QGLSceneNode()
-{
- Q_D(QGLSceneNode);
-
- // Detach ourselves from our children. The children will be
- // deleted separately when their QObject::parent() deletes them.
- for (int index = 0; index < d->childNodes.count(); ++index)
- d->childNodes.at(index)->d_ptr->parentNodes.removeOne(this);
-
- // Detach ourselves from our remaining parents, and notify them
- // to update their bounding boxes. This won't be needed if we
- // are recursively destroying a tree of nodes because the parent
- // already detached from this node above.
- for (int index = 0; index < d->parentNodes.count(); ++index) {
- QGLSceneNode *parent = d->parentNodes.at(index);
- parent->d_ptr->childNodes.removeOne(this);
- parent->invalidateBoundingBox();
- }
-}
-
-/*!
- Returns the drawing options associated with this node.
- The default is 0 (no options set).
-
- \sa setOptions(), setOption()
-*/
-QGLSceneNode::Options QGLSceneNode::options() const
-{
- Q_D(const QGLSceneNode);
- return d->options;
-}
-
-/*!
- \qmlproperty enumeration QGLSceneNode::options
-
- Defines the settings of various options configurabled on
- nodes in the mesh.
-
- \list
- \o NoOptions Use no options. This is the default.
- \o CullBoundingBox Use the camera position to cull the whole node if possible.
- \o ViewNormals Turn on normals debugging mode visually depict lighting normals.
- \o ReportCulling Send a signal when an object is displayed or culled.
- \endlist
-*/
-
-/*!
- Sets the drawing \a options associated with this node.
-
- \sa options(), setOption()
-*/
-void QGLSceneNode::setOptions(QGLSceneNode::Options options)
-{
- Q_D(QGLSceneNode);
- if (d->options != options) {
- d->options = options;
- emit updated();
- }
-}
-
-/*!
- Enables or disables \a option according to \a value.
-
- \sa options(), setOptions()
-*/
-void QGLSceneNode::setOption(QGLSceneNode::Option option, bool value)
-{
- Q_D(QGLSceneNode);
- QGLSceneNode::Options opts = d->options;
- if (value)
- opts |= option;
- else
- opts &= ~option;
- if (d->options != opts) {
- d->options = opts;
- emit updated();
- }
-}
-
-/*!
- Returns the geometry associated with this node, or a null QGeometryData
- if no geometry has been associated with it.
-
- \sa setGeometry()
-*/
-QGeometryData QGLSceneNode::geometry() const
-{
- Q_D(const QGLSceneNode);
- return d->geometry;
-}
-
-/*!
- Sets the geometry associated with this node to be \a geometry.
- Typically the \a geometry will be some type of mesh object. The
- default implementation of the QGLSceneNode::draw() method will call
- the geometry's draw() method.
-
- \sa geometry()
-*/
-void QGLSceneNode::setGeometry(QGeometryData geometry)
-{
- Q_D(QGLSceneNode);
- d->geometry = geometry;
- emit updated();
-}
-
-/*!
- Returns a bounding box for the portion of the geometry referenced by
- this scene node. If the value of start() is 0, and count() is the same
- as geometry()->size() then the bounding box will be the same as
- geometry()->boundingBox(). However if the scene node only references
- some part of the geometry, a bounding box for this section is calculated.
-
- If this scene node has child nodes then the bounding box will be the
- calculated union of the bounding box for this nodes geometry (if any) and
- the bounding boxes of the children.
-
- The calculated value is cached and returned on subsequent calls, but
- could be expensive to calculate initially.
-*/
-QBox3D QGLSceneNode::boundingBox() const
-{
- Q_D(const QGLSceneNode);
- if (d->boxValid)
- return d->bb;
- d->bb = QBox3D();
- if (d->geometry.count() > 0)
- {
- if (d->start == 0 && (d->count == d->geometry.count() || d->count == 0))
- {
- d->bb = d->geometry.boundingBox();
- }
- else
- {
- QGL::IndexArray indices = d->geometry.indices();
- for (int i = d->start; i < (d->start + d->count); ++i)
- {
- int ix = indices.at(i);
- d->bb.unite(d->geometry.vertexAt(ix));
- }
- }
- }
- QList<QGLSceneNode*>::const_iterator it = d->childNodes.constBegin();
- for ( ; it != d->childNodes.constEnd(); ++it)
- {
- QGLSceneNode *n = *it;
- QBox3D b = n->boundingBox();
- d->bb.unite(b);
- }
- d->bb.transform(transform());
- d->boxValid = true;
- return d->bb;
-}
-
-// Calculate the resulting matrix from the position, local transform,
-// and list of transforms.
-QMatrix4x4 QGLSceneNode::transform() const
-{
- Q_D(const QGLSceneNode);
- QMatrix4x4 m;
- if (!d->translate.isNull())
- m.translate(d->translate);
- if (!d->localTransform.isIdentity())
- m *= d->localTransform;
- for (int index = d->transforms.size() - 1; index >= 0; --index)
- d->transforms.at(index)->applyTo(&m);
- return m;
-}
-
-/*!
- Returns the local transform associated with this node. If no
- local transform has been explicitly set, this method returns a
- QMatrix4x4 set to the identity matrix.
-
- The local transform is typically set during model loading or
- geometry construction, and is a feature of the geometry.
-
- In general to change the location or orientation of the node
- use the position() or transforms() properties instead.
-
- \sa setLocalTransform(), position(), transforms()
-*/
-QMatrix4x4 QGLSceneNode::localTransform() const
-{
- Q_D(const QGLSceneNode);
- return d->localTransform;
-}
-
-/*!
- Sets the local transform associated with this node to be \a transform.
- The default implementation of the QGLSceneNode::draw() method will
- apply this transform to the QGLPainter before drawing any geometry.
-
- \sa localTransform()
-*/
-void QGLSceneNode::setLocalTransform(const QMatrix4x4 &transform)
-{
- Q_D(QGLSceneNode);
- if (d->localTransform != transform)
- {
- d->localTransform = transform;
- emit updated();
- invalidateTransform();
- }
-}
-
-/*!
- \property QGLSceneNode::position
- \brief The amounts of x, y and z axis translation for this node.
-
- Since most nodes are situated relative to \c{(0, 0, 0)} when imported as
- part of a model or constructed programatically, the translation is
- effectively the position of the model in the scene.
-
- The x, y and z axis translations can also be specified individually as
- separate properties \l x, \l y, and \l z
-
- \sa x(), y(), z()
-*/
-QVector3D QGLSceneNode::position() const
-{
- Q_D(const QGLSceneNode);
- return d->translate;
-}
-
-void QGLSceneNode::setPosition(const QVector3D &p)
-{
- Q_D(QGLSceneNode);
- if (p != d->translate)
- {
- d->translate = p;
- emit updated();
- invalidateTransform();
- }
-}
-
-/*!
- \property QGLSceneNode::x
- \brief The amount of x axis translation for this node.
-
- \sa position()
-*/
-qreal QGLSceneNode::x() const
-{
- Q_D(const QGLSceneNode);
- return d->translate.x();
-}
-
-void QGLSceneNode::setX(qreal x)
-{
- Q_D(QGLSceneNode);
- if (x != d->translate.x())
- {
- d->translate.setX(x);
- emit updated();
- invalidateTransform();
- }
-}
-
-/*!
- \property QGLSceneNode::y
- \brief The amount of y axis translation for this node.
-
- \sa position()
-*/
-qreal QGLSceneNode::y() const
-{
- Q_D(const QGLSceneNode);
- return d->translate.y();
-}
-
-void QGLSceneNode::setY(qreal y)
-{
- Q_D(QGLSceneNode);
- if (y != d->translate.y())
- {
- d->translate.setY(y);
- emit updated();
- invalidateTransform();
- }
-}
-
-/*!
- \property QGLSceneNode::z
- \brief The amount of z axis translation for this node.
-
- \sa position()
-*/
-qreal QGLSceneNode::z() const
-{
- Q_D(const QGLSceneNode);
- return d->translate.z();
-}
-
-void QGLSceneNode::setZ(qreal z)
-{
- Q_D(QGLSceneNode);
- if (z != d->translate.z())
- {
- d->translate.setZ(z);
- emit updated();
- invalidateTransform();
- }
-}
-
-/*!
- Returns the list of transformations to apply to this node.
- The default is the empty list.
-
- The transformations are applied to the node itself, so a
- QGraphicsScale3D followed by a QGraphicsTranslation3D will
- first scale the node in its local co-ordinate system,
- and then translate the node a new location.
-
- In the mathematical sense, the transformations are applied to
- the modelview matrix in the reverse order in which they appear
- in this list.
-
- The position() is applied after all other transformations
- have been applied.
-
- \sa setTransforms(), addTransform(), position()
-*/
-QList<QGraphicsTransform3D *> QGLSceneNode::transforms() const
-{
- Q_D(const QGLSceneNode);
- return d->transforms;
-}
-
-/*!
- Sets the list of transformations to apply to this node to \a transforms.
-
- The transformations are applied to the node itself, so a
- QGraphicsScale3D followed by a QGraphicsTranslation3D will
- first scale the node in its local co-ordinate system,
- and then translate the node a new location.
-
- In the mathematical sense, the transformations are applied to
- the modelview matrix in the reverse order in which they appear
- in \a transforms.
-
- The position() is applied after all other transformations
- have been applied.
-
- \sa transforms(), addTransform(), position()
-*/
-void QGLSceneNode::setTransforms(const QList<QGraphicsTransform3D *> &transforms)
-{
- Q_D(QGLSceneNode);
- for (int index = 0; index < d->transforms.size(); ++index) {
- QGraphicsTransform3D *transform = d->transforms.at(index);
- disconnect(transform, SIGNAL(transformChanged()), this, SLOT(transformChanged()));
- }
- d->transforms.clear();
- for (int index = 0; index < transforms.size(); ++index) {
- QGraphicsTransform3D *transform = transforms.at(index);
- if (transform) {
- connect(transform, SIGNAL(transformChanged()), this, SLOT(transformChanged()));
- d->transforms.append(transform);
- }
- }
- emit updated();
- invalidateTransform();
-}
-
-/*!
- Adds a single \a transform to this node, to be applied to the
- node after all current members of transformations() have been applied.
-
- In the mathematical sense, \a transform is applied to the modelview
- matrix before the current members of transformations() are applied
- in reverse order.
-
- \sa transforms(), setTransforms()
-*/
-void QGLSceneNode::addTransform(QGraphicsTransform3D *transform)
-{
- Q_D(QGLSceneNode);
- if (!transform)
- return; // Avoid nulls getting into the transform list.
- connect(transform, SIGNAL(transformChanged()), this, SLOT(transformChanged()));
- d->transforms.append(transform);
- emit updated();
- invalidateTransform();
-}
-
-/*!
- \internal
-*/
-void QGLSceneNode::transformChanged()
-{
- invalidateTransform();
- emit updated();
-}
-
-/*!
- Returns the drawing mode to use to render geometry(). The default
- is QGL::Triangles.
-
- \sa setDrawingMode()
-*/
-QGL::DrawingMode QGLSceneNode::drawingMode() const
-{
- Q_D(const QGLSceneNode);
- return d->drawingMode;
-}
-
-/*!
- Sets the drawing \a mode to use to render geometry().
-
- Note: this function changes the drawing mode, but the underlying
- geometry() still consists of the triangles that were added.
- Thus, this function is only useful for converting the drawing mode
- into QGL::Points to display the geometry() as a point cloud
- instead of a triangle mesh. The other enums from QGL::DrawingMode
- will give unpredictable results.
-
- \sa drawingMode()
-*/
-void QGLSceneNode::setDrawingMode(QGL::DrawingMode mode)
-{
- Q_D(QGLSceneNode);
- if (d->drawingMode != mode)
- {
- d->drawingMode = mode;
- emit updated();
- }
-}
-
-/*!
- Returns the drawing width for this node.
-
- Drawing width is used only when drawing lines or points (ie. when
- the drawing mode is points, lines, line-strips, etc).
-
- \sa drawingMode()
-*/
-qreal QGLSceneNode::drawingWidth() const
-{
- Q_D(const QGLSceneNode);
- return d->drawingWidth;
-}
-
-/*!
- Sets the drawing \a width to the given value.
-
- Drawing width is used only when drawing lines or points (ie. when
- the drawing mode is points, lines, line-strips, etc).
-
- \sa drawingMode()
-*/
-void QGLSceneNode::setDrawingWidth(qreal width)
-{
- Q_D(QGLSceneNode);
- d->drawingWidth = width;
-}
-
-
-/*!
- Returns the local effect associated with this node. The default value
- is QGL::FlatColor. If the value of hasEffect() is false, then this
- the value of effect() is ignored.
-
- \sa setEffect(), hasEffect()
-*/
-QGL::StandardEffect QGLSceneNode::effect() const
-{
- Q_D(const QGLSceneNode);
- return d->localEffect;
-}
-
-/*!
- Sets the local effect associated with this node to be \a effect. hasEffect()
- will return true after calling this method.
-
- The QGLSceneNode::draw() function will ensure that \a effect is applied to the
- QGLPainter before drawing any geometry.
-
- \sa effect(), hasEffect()
-*/
-void QGLSceneNode::setEffect(QGL::StandardEffect effect)
-{
- Q_D(QGLSceneNode);
- if (d->localEffect != effect || !d->hasEffect) {
- d->localEffect = effect;
- d->hasEffect = true;
- emit updated();
- }
-}
-
-/*!
- Returns the user effect associated with this node, or NULL if one is not
- set. The default value is NULL. If the value of hasEffect() is false,
- then this effect is ignored.
-
- \sa setUserEffect(), hasEffect()
-*/
-QGLAbstractEffect *QGLSceneNode::userEffect() const
-{
- Q_D(const QGLSceneNode);
- return d->customEffect;
-}
-
-/*!
- Sets the local effect associated with this node to be the custom
- \a effect. hasEffect() will return true after calling this method.
-
- This custom effect will supersede any standard effect.
-
- The default implementation of QGLSceneNode::apply() will set this effect
- during initialization of the model.
-
- The default implementation of the QGLSceneNode::draw() method will
- ensure that \a effect is applied to the QGLPainter before drawing
- any geometry.
-
- \sa userEffect(), hasEffect()
-*/
-void QGLSceneNode::setUserEffect(QGLAbstractEffect *effect)
-{
- Q_D(QGLSceneNode);
- if (d->customEffect != effect || !d->hasEffect) {
- d->customEffect = effect;
- d->hasEffect = true;
- emit updated();
- }
-}
-
-
- /*!
- Returns true if the local effect on this node is enabled, otherwise
- returns false.
-
- \sa setEffectEnabled(), setEffect()
- */
-bool QGLSceneNode::hasEffect() const
-{
- Q_D(const QGLSceneNode);
- return d->hasEffect;
-}
-
-/*!
- Sets whether the current value of effect() or userEffect() will be
- applied to the QGLPainter prior to drawing. If \a enabled is true,
- then the effect is applied, otherwise it is not.
-
- \sa setEffect(), effect(), hasEffect()
-*/
-void QGLSceneNode::setEffectEnabled(bool enabled)
-{
- Q_D(QGLSceneNode);
- if (d->hasEffect != enabled) {
- d->hasEffect = enabled;
- emit updated();
- }
-}
-
-/*!
- Returns the starting index within geometry() that should be used
- to render fragments for this scene node. The default value is 0,
- indicating that the 0'th logical vertex in geometry() is the start.
-
- \sa setStart(), count()
-*/
-int QGLSceneNode::start() const
-{
- Q_D(const QGLSceneNode);
- return d->start;
-}
-
-/*!
- Sets the \a start index within geometry() that should be used
- to render fragments for this scene node.
-
- \sa start(), setCount()
-*/
-void QGLSceneNode::setStart(int start)
-{
- Q_D(QGLSceneNode);
- if (start != d->start)
- {
- d->start = start;
- emit updated();
- invalidateBoundingBox();
- }
-}
-
-/*!
- Returns the count of the vertices to render from geometry()
- for this scene node. The default is zero, meaning that this node
- uses all vertices from start() up to the last logical vertex
- in the underlying geometry().
-
- \sa setCount(), start()
-*/
-int QGLSceneNode::count() const
-{
- Q_D(const QGLSceneNode);
- return d->count;
-}
-
-/*!
- Sets the \a count of the vertices to render from geometry()
- for this scene node.
-
- \sa count(), setStart()
-*/
-void QGLSceneNode::setCount(int count)
-{
- Q_D(QGLSceneNode);
- if (count != d->count)
- {
- d->count = count;
- emit updated();
- invalidateBoundingBox();
- }
-}
-
-/*!
- Returns the material index for this scene node.
-
- \sa setMaterialIndex()
-*/
-int QGLSceneNode::materialIndex() const
-{
- Q_D(const QGLSceneNode);
- return d->material;
-}
-
-/*!
- Sets the material index for this scene node to \a material.
-
- \sa materialIndex()
-*/
-void QGLSceneNode::setMaterialIndex(int material)
-{
- Q_D(QGLSceneNode);
- if (d->material != material) {
- d->material = material;
- emit updated();
- }
-}
-
-/*!
- Returns the back material index for this scene node.
-
- \sa setBackMaterialIndex()
-*/
-int QGLSceneNode::backMaterialIndex() const
-{
- Q_D(const QGLSceneNode);
- return d->backMaterial;
-}
-
-/*!
- Sets the back material index for this scene node to \a material.
-
- \sa materialIndex()
-*/
-void QGLSceneNode::setBackMaterialIndex(int material)
-{
- Q_D(QGLSceneNode);
- if (d->backMaterial != material) {
- d->backMaterial = material;
- emit updated();
- }
-}
-
-/*!
- \property QGLSceneNode::material
- \brief This property is a pointer to a QGLMaterial instance for this node.
-
- This material is applied to all faces if the backMaterial() property
- is set to null, which is the default. If the backMaterial() property is non-null
- then this material is only applied to the front faces.
-
- To apply a material to the back faces use the backMaterial() property.
-
- Getting this property is exactly equivalent to
- \c{palette()->material(materialIndex())}.
-
- Setting this property causes the material if not already in this nodes palette to be
- added, and then the corresponding index to be set for this scene node.
-
- Setting this property is equivalent to:
- \code
- int index = d->palette->indexOf(material);
- if (index == -1)
- index = d->palette->addMaterial(material);
- setMaterialIndex(index);
- \endcode
-
- If setting this property, when no palette exists one is created, as a
- convenience - but this is suitable only for experimental code and for
- \bold{very small numbers of nodes}. In debug mode a warning is
- printed in this case.
-
- Generally one common palette should be created, and set on each node. This
- also allows nodes to share materials and their textures.
-
- \sa materialIndex(), setMaterialIndex()
-*/
-QGLMaterial *QGLSceneNode::material() const
-{
- Q_D(const QGLSceneNode);
- if (d->palette)
- return d->palette->material(d->material);
- return 0;
-}
-
-void QGLSceneNode::setMaterial(QGLMaterial *material)
-{
- Q_D(QGLSceneNode);
- if (!d->palette)
- d->palette = new QGLMaterialCollection(this);
- int ix = d->palette->indexOf(material);
- if (ix == -1)
- ix = d->palette->addMaterial(material);
- setMaterialIndex(ix);
-}
-
-/*!
- \property QGLSceneNode::backMaterial
- \brief This property is a pointer to any QGLMaterial instance for this node's back faces.
-
- This material is applied to the back faces, if non-null. The default value
- of this property is null. When this property is null, any non-null material
- set on the material() property will be applied to front and back faces.
-
- To apply a material to the front faces use the material() property.
-
- Getting this property is exactly equivalent to
- \c{palette()->material(backMaterialIndex())}.
-
- Setting this property causes the material if not already in this nodes palette to be
- added, and then the corresponding index to be set for this scene node.
-
- Setting this property is exactly equivalent to:
- \code
- int index = d->palette->indexOf(material);
- if (index == -1)
- index = d->palette->addMaterial(material);
- setBackMaterialIndex(index);
- \endcode
-*/
-QGLMaterial *QGLSceneNode::backMaterial() const
-{
- Q_D(const QGLSceneNode);
- if (d->palette)
- return d->palette->material(d->backMaterial);
- return 0;
-}
-
-void QGLSceneNode::setBackMaterial(QGLMaterial *material)
-{
- Q_D(QGLSceneNode);
- if (!d->palette)
- d->palette = new QGLMaterialCollection(this);
- int ix = d->palette->indexOf(material);
- if (ix == -1)
- ix = d->palette->addMaterial(material);
- setBackMaterialIndex(ix);
-}
-/*!
- Returns the palette of materials used by this scene node, or NULL
- if no palette has been set.
-
- \sa setPalette()
-*/
-QGLMaterialCollection *QGLSceneNode::palette() const
-{
- Q_D(const QGLSceneNode);
- return d->palette;
-}
-
-/*!
- Sets the palette of materials for this scene node to \a palette.
-
- \sa palette()
-*/
-void QGLSceneNode::setPalette(QGLMaterialCollection *palette)
-{
- Q_D(QGLSceneNode);
- if (d->palette != palette) {
- d->palette = palette;
- emit updated();
- }
-}
-
-/*!
- Returns a list of the child nodes for this node. This list is not
- recursively generated, it includes only the nodes which are
- immediate children of this node.
-
- \sa allChildren()
-*/
-QList<QGLSceneNode*> QGLSceneNode::children() const
-{
- Q_D(const QGLSceneNode);
- return d->childNodes;
-}
-
-/*!
- Returns a list including recursively all child nodes under
- this node. Each child node only appears once, even if it is included
- multiple times in the scene graph.
-
- \sa children()
-*/
-QList<QGLSceneNode*> QGLSceneNode::allChildren() const
-{
- Q_D(const QGLSceneNode);
- QList<QGLSceneNode*> allSceneNodes;
- QList<QGLSceneNode*> gather;
- QList<QGLSceneNode*>::const_iterator it = d->childNodes.constBegin();
- for ( ; it != d->childNodes.constEnd(); ++it)
- if (!gather.contains(*it))
- gather.append(*it);
- while (gather.count() > 0)
- {
- QGLSceneNode *node = gather.takeFirst();
- if (!allSceneNodes.contains(node))
- {
- allSceneNodes.append(node);
- gather.append(node->children());
- }
- }
- return allSceneNodes;
-}
-
-/*!
- Adds the \a node to the list of child nodes for this node.
-
- This function does nothing if \a node is null or is already a child
- of this node. If the \a node is the node itself, a warning about an
- attempt to add a node to itself is printed, and no add takes place.
-
- If the aim is to have the same geometry displayed several times under a
- given node, each time with different transformations, use the clone()
- call to create copies of the node and then apply the transformations to
- the copies.
-
- Alternatively, create modifier nodes with the transformations and add the
- geometry bearing node to each with addNode():
- \code
- QGLBuilder builder;
- builder << CarWheel(5.0f); // some car wheel geometry
- QGLSceneNode wheel = builder.finalizedSceneNode();
- QGLSceneNode frontLeft = new QGLSceneNode(m_sceneRoot);
- frontLeft->addNode(wheel);
- frontLeft->setPosition(QVector3D(1.0f, 2.0f, 0.0f));
- QGLSceneNode frontRight = new QGLSceneNode(m_sceneRoot);
- frontRight->addNode(wheel);
- frontRight->setPosition(QVector3D(-1.0f, 2.0f, 0.0f));
- QGLSceneNode backLeft = new QGLSceneNode(m_sceneRoot);
- backLeft->addNode(wheel);
- backLeft->setPosition(QVector3D(1.0f, -2.0f, 0.0f));
- QGLSceneNode backRight = new QGLSceneNode(m_sceneRoot);
- backRight->addNode(wheel);
- backRight->setPosition(QVector3D(-1.0f, -2.0f, 0.0f));
- \endcode
-
- Because a child node can be validly added to many different nodes,
- calling addNode() does not normally affect the QObject::parent()
- ownership. However, if \a node does not currently have a
- QObject::parent(), the parent will be set to this node.
-
- \sa removeNode(), clone(), addNodes()
-*/
-void QGLSceneNode::addNode(QGLSceneNode *node)
-{
- Q_D(QGLSceneNode);
- bool alreadyAdded = node && node->d_ptr->parentNodes.contains(this);
- if (!node || node == this || alreadyAdded)
- return; // Invalid node, or already under this parent.
- invalidateBoundingBox();
- d->childNodes.append(node);
- node->d_ptr->parentNodes.append(this);
- if (!node->parent())
- node->setParent(this);
- connect(node, SIGNAL(updated()), this, SIGNAL(updated()));
- emit updated();
-}
-
-/*!
- Adds the members of \a nodes to the list of child nodes
- for this node.
-
- \sa addNode(), removeNodes()
-*/
-void QGLSceneNode::addNodes(const QList<QGLSceneNode *> &nodes)
-{
- Q_D(QGLSceneNode);
- for (int index = 0; index < nodes.count(); ++index) {
- QGLSceneNode *node = nodes.at(index);
- if (!node || node->d_ptr->parentNodes.contains(this))
- continue; // Invalid node, or already under this parent.
- d->childNodes.append(node);
- node->d_ptr->parentNodes.append(this);
- if (!node->parent())
- node->setParent(this);
- connect(node, SIGNAL(updated()), this, SIGNAL(updated()));
- }
- invalidateBoundingBox();
- emit updated();
-}
-
-/*!
- Removes the child node matching \a node from this node.
-
- If the QObject::parent() ownership of \a node was set to this
- node, then its parent will be changed to another parent node if it
- had multiple parents.
-
- If \a node had only a single parent, then its parent will be set to null,
- effectively detaching it from the QObject ownership rules of the scene
- graph. The caller is then responsible for deleting \a node.
-
- If the QObject::parent() of \a node was not a scene node parent,
- then it will be left unmodified.
-
- \sa addNode(), removeNodes()
-*/
-void QGLSceneNode::removeNode(QGLSceneNode *node)
-{
- Q_D(QGLSceneNode);
- if (!node || !node->d_ptr->parentNodes.contains(this))
- return; // Invalid node or not attached to this parent.
- d->childNodes.removeOne(node);
- node->d_ptr->parentNodes.removeOne(this);
- if (node->parent() == this) {
- // Transfer QObject ownership to another parent, or null.
- if (!node->d_ptr->parentNodes.isEmpty())
- node->setParent(node->d_ptr->parentNodes[0]);
- else
- node->setParent(0);
- }
- disconnect(node, SIGNAL(updated()), this, SIGNAL(updated()));
- invalidateBoundingBox();
- emit updated();
-}
-
-/*!
- Removes the members of \a nodes from the list of child nodes
- for this node.
-
- \sa removeNode(), addNodes()
-*/
-void QGLSceneNode::removeNodes(const QList<QGLSceneNode *> &nodes)
-{
- Q_D(QGLSceneNode);
- for (int index = 0; index < nodes.count(); ++index) {
- QGLSceneNode *node = nodes.at(index);
- if (!node || !node->d_ptr->parentNodes.contains(this))
- continue; // Invalid node or not attached to this parent.
- d->childNodes.removeOne(node);
- node->d_ptr->parentNodes.removeOne(this);
- if (node->parent() == this) {
- // Transfer QObject ownership to another parent, or null.
- if (!node->d_ptr->parentNodes.isEmpty())
- node->setParent(node->d_ptr->parentNodes[0]);
- else
- node->setParent(0);
- }
- disconnect(node, SIGNAL(updated()), this, SIGNAL(updated()));
- }
- invalidateBoundingBox();
- emit updated();
-}
-
-void QGLSceneNode::invalidateBoundingBox() const
-{
- Q_D(const QGLSceneNode);
- d->boxValid = false;
- d->invalidateParentBoundingBox();
-}
-
-void QGLSceneNode::invalidateTransform() const
-{
- invalidateBoundingBox();
-}
-
-void QGLSceneNode::drawNormalIndicators(QGLPainter *painter)
-{
- Q_D(QGLSceneNode);
- QVector3DArray verts;
- QGL::IndexArray indices = d->geometry.indices();
- for (int i = d->start; i < (d->start + d->count); ++i)
- {
- int ix = indices[i];
- QVector3D a = d->geometry.vertexAt(ix);
- QVector3D b = a + d->geometry.normalAt(ix);
- verts.append(a, b);
- }
- painter->setVertexAttribute(QGL::Position, QGLAttributeValue(verts));
- glLineWidth(2.0f);
- painter->draw(QGL::Lines, verts.size());
-}
-
-const QGLMaterial *QGLSceneNode::setPainterMaterial(int material, QGLPainter *painter,
- QGL::Face faces, bool &changedTex)
-{
- Q_D(QGLSceneNode);
- QGLMaterial *mat = d->palette->material(material);
- const QGLMaterial *saveMat = 0;
- if (painter->faceMaterial(faces) != mat)
- {
- saveMat = painter->faceMaterial(faces);
- painter->setFaceMaterial(faces, mat);
- int texUnit = 0;
- for (int i = 0; i < mat->textureLayerCount(); ++i)
- {
- QGLTexture2D *tex = mat->texture(i);
- if (tex)
- {
- painter->glActiveTexture(GL_TEXTURE0 + texUnit);
- tex->bind();
- changedTex = true;
- ++texUnit;
- }
- }
- }
- return saveMat;
-}
-
-/*!
- Draws the geometry of the node onto the \a painter.
-
- This is the function which performs the actual drawing step in the
- draw function below.
-
- \list
- \o calls draw(start, count) on this nodes geometry object (if any)
- \endlist
-
- Override this function to perform special processing on this node,
- after transformation & culling are applied and before sequencing of
- materials & effects are done; but just before (or after) the
- actual draw step.
-
- This default implementation simply draws the nodes geometry onto
- the painter.
-
- Example:
- \code
- void MySpecialNode::geometryDraw(QGLPainter *painter)
- {
- // at this point the node has survived culling, the model-view
- // matrix is transformed into this nodes frame of reference,
- // materials & effects have been applied as this node appears
- // in its place in the render sequence
-
- doMySpecialProcessing();
-
- // call parent implementation to do actual draw
- QGLSceneNode::geometryDraw(painter);
- }
- \endcode
-*/
-void QGLSceneNode::drawGeometry(QGLPainter *painter)
-{
- Q_D(QGLSceneNode);
- if (d->count && d->geometry.count() > 0)
- d->geometry.draw(painter, d->start, d->count, d->drawingMode, d->drawingWidth);
-}
-
-/*!
- Draws this scene node and its children on the \a painter.
-
- In detail this function:
- \list
- \o ensures the effect specified by effect() is current on the painter
- \o sets the nodes materials onto the painter, if valid materials are present
- \o moves the model-view to the x, y, z position
- \o applies any local transforms() that may be set for this node
- \o calls draw() for all the child nodes
- \o calls draw(start, count) on this nodes geometry object (if any)
- \o restores the geometry's original materials if they were changed
- \o restores the model-view matrix if any local transform was applied
- \endlist
-
- Note that the draw() method does \bold not restore the effect. If the first
- step above results in a change to the current QGL::Standard effect then it
- will remain set to that effect. In general any painting method should
- ensure the effect it requires is current.
-
- The way draw is implemented ensures that this nodes effects, materials and
- transformations will apply by default to its child nodes. Transformations
- are cumulative, but effects and materials override those of any parent node.
-
- Note that if the HideNode option is set for this node, neither it nor its
- children will be drawn.
-*/
-void QGLSceneNode::draw(QGLPainter *painter)
-{
- Q_D(QGLSceneNode);
- if (d->options & HideNode)
- return;
- bool wasTransformed = false;
-
- QGLRenderSequencer *seq = painter->renderSequencer();
-
- if (seq->top() != this)
- {
- QMatrix4x4 m = transform();
-
- if (!m.isIdentity())
- {
- painter->modelViewMatrix().push();
- painter->modelViewMatrix() *= m;
- wasTransformed = true;
- }
-
- if (d->options & CullBoundingBox)
- {
- QBox3D bb = boundingBox();
- if (bb.isFinite() && !bb.isNull() && painter->isCullable(bb))
- {
- if (!d->culled && d->options & ReportCulling)
- {
- d->culled = true;
- emit culled();
- }
- if (wasTransformed)
- painter->modelViewMatrix().pop();
- return;
- }
- else
- {
- if (d->culled && d->options & ReportCulling)
- {
- d->culled = false;
- emit displayed();
- }
- }
- }
- }
-
- if (seq->top() == NULL)
- {
- seq->setTop(this);
- while (true)
- {
- draw(painter); // recursively draw myself for each state
- if (!seq->nextInSequence())
- break;
- }
- seq->reset();
- }
- else
- {
- bool stateEntered = false;
- if (d->childNodes.size() > 0)
- {
- seq->beginState(this);
- stateEntered = true;
- QList<QGLSceneNode*>::iterator cit = d->childNodes.begin();
- for ( ; cit != d->childNodes.end(); ++cit)
- (*cit)->draw(painter);
- }
-
- if (d->count && (d->geometry.count() > 0) && seq->renderInSequence(this))
- {
- bool idSaved = false;
- int id = -1;
- if (d->pickNode && painter->isPicking())
- {
- idSaved = true;
- id = painter->objectPickId();
- painter->setObjectPickId(d->pickNode->id());
- }
-
- if (!stateEntered)
- {
- stateEntered = true;
- seq->beginState(this);
- }
- seq->applyState();
-
- drawGeometry(painter);
-
- if (idSaved)
- painter->setObjectPickId(id);
-
- if (d->options & ViewNormals)
- drawNormalIndicators(painter);
- }
- if (stateEntered)
- seq->endState(this);
- }
- if (wasTransformed)
- painter->modelViewMatrix().pop();
-}
-
-/*!
- Returns the pick node for this scene node, if one was set; otherwise
- NULL (0) is returned.
-
- \sa setPickNode()
-*/
-QGLPickNode *QGLSceneNode::pickNode() const
-{
- Q_D(const QGLSceneNode);
- return d->pickNode;
-}
-
-/*!
- Sets the pick node for this scene node to \a node.
-
- \sa pickNode()
-*/
-void QGLSceneNode::setPickNode(QGLPickNode *node)
-{
- Q_D(QGLSceneNode);
- // TODO - resolve recursive picking - not supported by
- // color based pick AFAICT
- d->pickNode = node;
- if (node)
- node->setTarget(this);
-}
-
-/*!
- Creates a new QGLSceneNode that is a copy of this scene node, with
- \a parent as the parent of the new copy. If parent is NULL then parent
- is set to this nodes parent.
-
- The copy will reference the same underlying geometry, child nodes, and
- have all effects, transforms and other properties copied from this node.
- The only property that is not copied is pickNode().
-
- \sa cloneNoChildren()
-*/
-QGLSceneNode *QGLSceneNode::clone(QObject *parent) const
-{
- Q_D(const QGLSceneNode);
- QGLSceneNode *node = new QGLSceneNode
- (new QGLSceneNodePrivate(d), parent ? parent : this->parent());
- for (int index = 0; index < d->transforms.size(); ++index)
- node->addTransform(d->transforms.at(index)->clone(node));
- node->addNodes(d->childNodes);
- return node;
-}
-
-/*!
- Creates a new QGLSceneNode that is a copy of this scene node, with
- \a parent as the parent of the new copy. If parent is NULL then parent
- is set to this nodes parent.
-
- The copy will reference the same underlying geometry, and
- have all effects, transforms and other properties copied from this node.
- The children() and pickNodes() are not cloned.
-
- \sa clone()
-*/
-QGLSceneNode *QGLSceneNode::cloneNoChildren(QObject *parent) const
-{
- Q_D(const QGLSceneNode);
- QGLSceneNode *node = new QGLSceneNode
- (new QGLSceneNodePrivate(d), parent ? parent : this->parent());
- for (int index = 0; index < d->transforms.size(); ++index)
- node->addTransform(d->transforms.at(index)->clone(node));
- return node;
-}
-
-/*!
- Creates a new QGLSceneNode that is a copy of this scene node, with
- \a parent as the parent of the new copy. If parent is NULL then parent
- is set to this nodes parent.
-
- The copy will reference the same underlying geometry and
- have all effects, transforms and other properties copied from this node.
-
- The copy returned will have the same child nodes, except all child nodes
- whose objectName() is equal to \a name.
-
- \sa clone(), only()
-*/
-QGLSceneNode *QGLSceneNode::allExcept(const QString &name, QObject *parent) const
-{
- Q_D(const QGLSceneNode);
- QGLSceneNode *node = cloneNoChildren(parent);
- for (int index = 0; index < d->childNodes.count(); ++index) {
- QGLSceneNode *child = d->childNodes.at(index);
- if (child->objectName() != name)
- node->addNode(child);
- }
- return node;
-}
-
-/*!
- Creates a new QGLSceneNode that is a copy of this scene node, with
- \a parent as the parent of the new copy. If parent is NULL then parent
- is set to this nodes parent.
-
- The copy will reference the same underlying geometry and
- have all effects, transforms and other properties copied from this node.
-
- The copy returned will have only one child node. This child node will be
- the first child node of this one which has its objectName() equal to \a name.
-
- \sa clone(), allExcept()
-*/
-QGLSceneNode *QGLSceneNode::only(const QString &name, QObject *parent) const
-{
- Q_D(const QGLSceneNode);
- QGLSceneNode *node = cloneNoChildren(parent);
- for (int index = 0; index < d->childNodes.count(); ++index) {
- QGLSceneNode *child = d->childNodes.at(index);
- if (child->objectName() == name) {
- node->addNode(child);
- break;
- }
- }
- return node;
-}
-
-/*!
- Creates a new QGLSceneNode that is a copy of this scene node, with
- \a parent as the parent of the new copy. If parent is NULL then parent
- is set to this nodes parent.
-
- The copy will reference the same underlying geometry and
- have all effects, transforms and other properties copied from this node.
-
- The copy returned will have the same child nodes, except all child nodes
- whose objectName() is in the list of \a names.
-
- \sa clone(), only()
-*/
-QGLSceneNode *QGLSceneNode::allExcept(const QStringList &names, QObject *parent) const
-{
- Q_D(const QGLSceneNode);
- QGLSceneNode *node = cloneNoChildren(parent);
- QSet<QString> chk = QSet<QString>::fromList(names);
- for (int index = 0; index < d->childNodes.count(); ++index) {
- QGLSceneNode *child = d->childNodes.at(index);
- if (!chk.contains(child->objectName()))
- node->addNode(child);
- }
- return node;
-}
-
-/*!
- Creates a new QGLSceneNode that is a copy of this scene node, with
- \a parent as the parent of the new copy. If parent is NULL then parent
- is set to this nodes parent.
-
- The copy will reference the same underlying geometry and
- have all effects, transforms and other properties copied from this node.
-
- The copy returned will have only the child nodes from this
- whose objectName() is in the list of \a names.
-
- \sa clone(), allExcept()
-*/
-QGLSceneNode *QGLSceneNode::only(const QStringList &names, QObject *parent) const
-{
- Q_D(const QGLSceneNode);
- QGLSceneNode *node = cloneNoChildren(parent);
- QSet<QString> chk = QSet<QString>::fromList(names);
- for (int index = 0; index < d->childNodes.count(); ++index) {
- QGLSceneNode *child = d->childNodes.at(index);
- if (chk.contains(child->objectName()))
- node->addNode(child);
- }
- return node;
-}
-
-/*!
- \fn QGLSceneNode::updated()
- Signals that some property of this scene node, or one of its children,
- has changed in a manner that will require that the node be redrawn.
-*/
-
-/*!
- \fn QGLSceneNode::culled()
- Signals that the node was culled due to falling wholly outside the view
- frustum. This signal can only fire if both QGLSceneNode::CullBoundingBox
- and QGLSceneNode::ReportCulling options are both set.
-*/
-
-/*!
- \fn QGLSceneNode::displayed()
- Signals that the node was displayed - or at least its geometry was sent
- to the GPU for rendering, since the GPU might still clip or occlude the
- node. This signal can only fire if both QGLSceneNode::CullBoundingBox
- and QGLSceneNode::ReportCulling options are both set.
-*/
-
-/*!
- \relates QGLSceneNode
- Print a description of \a node, and all its descendants, to the console.
- This function uses qDebug for its output, so in the case of Windows the
- output will go to the debug window. If QT_NO_DEBUG_OUTPUT or QT_NO_DEBUG
- has been defined, (as in release mode) this function will exit without
- doing anything.
-
- If \a detailed is true (which it is by default) then all the properties
- of each node are printed, including materials, geometry and transforms.
-
- If \a detailed is false, then just one line is printed with the name and
- some identifying information including a unique id for the node.
-
- The \a indent and \a loop parameters are used internally.
-*/
-void qDumpScene(QGLSceneNode *node, bool detailed, int indent, const QSet<QGLSceneNode *> &loop)
-{
-#if defined(QT_NO_DEBUG_STREAM) || defined(QT_NO_DEBUG) || defined(QT_NO_DEBUG_OUTPUT)
- Q_UNUSED(node);
- Q_UNUSED(detailed);
- Q_UNUSED(indent);
- Q_UNUSED(loop);
-#else
-#if !defined(QT_NO_THREAD)
- QCoreApplication *app = QApplication::instance();
- QThread *appThread = 0;
- if (app)
- appThread = QApplication::instance()->thread();
-#endif
- QSet<QGLSceneNode *> lp = loop;
- lp.insert(node);
- QString ind;
- ind.fill(QLatin1Char(' '), indent * 4);
- if (detailed)
- {
- qDebug("\n%s ======== Node: %p - %s =========", qPrintable(ind), node,
- qPrintable(node->objectName()));
- }
- else
- {
- qDebug("\n%s Node: %p - %s", qPrintable(ind), node,
- qPrintable(node->objectName()));
- return;
- }
-#if !defined(QT_NO_THREAD)
- if (appThread && appThread != node->thread())
- qDebug("\n%s from thread: %p", qPrintable(ind), node->thread());
-#endif
- qDebug("%s start: %d count: %d children:", qPrintable(ind), node->start(), node->count());
- {
- QList<QGLSceneNode*> children = node->children();
- QList<QGLSceneNode*>::const_iterator it = children.constBegin();
- for (int i = 0; it != children.constEnd(); ++it, ++i)
- qDebug("%s %d: %p ", qPrintable(ind), i, *it);
- }
- if (!node->position().isNull())
- {
- QVector3D p = node->position();
- qDebug("%s position: (%0.4f, %0.4f, %0.4f)", qPrintable(ind),
- p.x(), p.y(), p.z());
- }
- if (node->localTransform().isIdentity())
- {
- qDebug("%s local transform: identity", qPrintable(ind));
- }
- else
- {
- qDebug("%s local transform:", qPrintable(ind));
- QMatrix4x4 m = node->localTransform();
- for (int i = 0; i < 4; ++i)
- qDebug("%s %0.4f %0.4f %0.4f %0.4f",
- qPrintable(ind), m(i, 0), m(i, 1), m(i, 2), m(i, 3));
- }
- QList<QGraphicsTransform3D*> tx = node->transforms();
- if (tx.size() > 0)
- qDebug("%s transforms list:", qPrintable(ind));
- for (int i = 0; i < tx.size(); ++i)
- {
- const QMetaObject *obj = tx.at(i)->metaObject();
- qDebug("%s %s", qPrintable(ind), obj->className());
- }
- if (!node->geometry().isEmpty())
- {
- qDebug("%s geometry: %d indexes, %d vertices",
- qPrintable(ind), node->geometry().count(), node->geometry().count(QGL::Position));
- }
- else
- {
- qDebug("%s geometry: NULL", qPrintable(ind));
- }
- if (node->materialIndex() != -1)
- {
- qDebug("%s material: %d", qPrintable(ind), node->materialIndex());
- QGLMaterial *mat = node->material();
- QGLMaterialCollection *pal = node->palette();
- if (pal)
- qDebug("%s palette: %p", qPrintable(ind), pal);
- else
- qDebug("%s no palette", qPrintable(ind));
- if (pal)
- {
- mat = pal->material(node->materialIndex());
- if (mat)
- qDebug("%s mat name from pal: %s ", qPrintable(ind),
- qPrintable(pal->material(node->materialIndex())->objectName()));
- else
- qDebug("%s indexed material %d does not exist in palette!",
- qPrintable(ind), node->materialIndex());
- }
- if (mat)
- {
- QString mat_spx = QString(QLatin1String(" Amb: %1 - Diff: %2 - Spec: %3 - Shin: %4"))
- .arg((mat->ambientColor().name()))
- .arg(mat->diffuseColor().name())
- .arg(mat->specularColor().name())
- .arg(mat->shininess());
- if (mat->objectName().isEmpty())
- qDebug("%s material pointer %p: %s", qPrintable(ind), mat, qPrintable(mat_spx));
- else
- qDebug("%s \"%s\": %s", qPrintable(ind),
- qPrintable(mat->objectName()), qPrintable(mat_spx));
- for (int i = 0; i < mat->textureLayerCount(); ++i)
- {
- if (mat->texture(i) != 0)
- {
- QGLTexture2D *tex = mat->texture(i);
- if (tex->objectName().isEmpty())
- qDebug("%s texture %p", qPrintable(ind), tex);
- else
- qDebug("%s texture %s", qPrintable(ind),
- qPrintable(tex->objectName()));
- QSize sz = tex->size();
- qDebug(" - size: %d (w) x %d (h)", sz.width(), sz.height());
- }
- }
- }
- else
- {
- qDebug("%s - could not find indexed material!!", qPrintable(ind));
- }
- }
- else
- {
- qDebug("%s material: NONE", qPrintable(ind));
- }
-
- if (node->hasEffect())
- {
- if (node->userEffect())
- {
- qDebug("%s user effect %p", qPrintable(ind),
- node->userEffect());
- }
- else
- {
- switch (node->effect())
- {
- case QGL::FlatColor:
- qDebug("%s flat color effect", qPrintable(ind)); break;
- case QGL::FlatPerVertexColor:
- qDebug("%s flat per vertex color effect", qPrintable(ind)); break;
- case QGL::FlatReplaceTexture2D:
- qDebug("%s flat replace texture 2D effect", qPrintable(ind)); break;
- case QGL::FlatDecalTexture2D:
- qDebug("%s flat decal texture 2D effect", qPrintable(ind)); break;
- case QGL::LitMaterial:
- qDebug("%s lit material effect", qPrintable(ind)); break;
- case QGL::LitDecalTexture2D:
- qDebug("%s lit decal texture 2D effect", qPrintable(ind)); break;
- case QGL::LitModulateTexture2D:
- qDebug("%s lit modulate texture 2D effect", qPrintable(ind)); break;
- }
- }
- }
- else
- {
- qDebug("%s no effect set", qPrintable(ind));
- }
- QList<QGLSceneNode*> children = node->children();
- QList<QGLSceneNode*>::const_iterator it = children.constBegin();
- for ( ; it != children.constEnd(); ++it)
- if (!lp.contains(*it))
- qDumpScene(*it, indent + 1);
-#endif
-}
-
-#ifndef QT_NO_DEBUG_STREAM
-QDebug operator<<(QDebug dbg, const QGLSceneNode &node)
-{
- dbg << &node << "\n start:" << node.start() << " count:" << node.count();
- QList<QGLSceneNode*> children = node.children();
- QList<QGLSceneNode*>::const_iterator it = children.constBegin();
- for ( ; it != children.constEnd(); ++it)
- dbg << "\n child:" << *it;
-
- if (node.localTransform().isIdentity())
- dbg << "\n local transform: identity";
- else
- dbg << "\n local transform:\n" << node.localTransform();
-
- if (node.geometry().count() > 0)
- {
- QGLMaterial *mat = node.material();
- QString mdesc;
- if (mat)
- mdesc = mat->objectName();
- dbg << "\n geometry:" << node.geometry();
- dbg << "\n material" << node.material() << ": " << mat << mdesc;
- }
- else
- {
- dbg << "\n geometry: NULL";
- dbg << "\n material" << node.material();
- }
-
- if (node.hasEffect())
- {
- if (node.userEffect())
- {
- dbg << "\n user effect";
- }
- else
- {
- switch (node.effect())
- {
- case QGL::FlatColor:
- dbg << "\n flat color effect"; break;
- case QGL::FlatPerVertexColor:
- dbg << "\n flat per vertex color effect"; break;
- case QGL::FlatReplaceTexture2D:
- dbg << "\n flat replace texture 2D effect"; break;
- case QGL::FlatDecalTexture2D:
- dbg << "\n flat decal texture 2D effect"; break;
- case QGL::LitMaterial:
- dbg << "\n lit material effect"; break;
- case QGL::LitDecalTexture2D:
- dbg << "\n lit decal texture 2D effect"; break;
- case QGL::LitModulateTexture2D:
- dbg << "\n lit modulate texture 2D effect"; break;
- }
- }
- }
- else
- {
- dbg << "\n no effect set";
- }
- return dbg;
-}
-
-#endif // QT_NO_DEBUG_STREAM
-
-QT_END_NAMESPACE
diff --git a/src/threed/scene/qglscenenode.h b/src/threed/scene/qglscenenode.h
deleted file mode 100644
index edf08874..00000000
--- a/src/threed/scene/qglscenenode.h
+++ /dev/null
@@ -1,205 +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 QGLSCENENODE_H
-#define QGLSCENENODE_H
-
-#include <QtCore/qobject.h>
-
-#include "qgeometrydata.h"
-#include "qglmaterialcollection.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class QGLSceneNodePrivate;
-class QGLAbstractEffect;
-class QGLPickNode;
-class QGraphicsTransform3D;
-
-class Q_QT3D_EXPORT QGLSceneNode : public QObject
-{
- Q_OBJECT
- Q_DECLARE_PRIVATE(QGLSceneNode)
- Q_ENUMS(Option)
- Q_FLAGS(Options)
- Q_PROPERTY(QVector3D position READ position WRITE setPosition NOTIFY updated)
- Q_PROPERTY(qreal x READ x WRITE setX NOTIFY updated)
- Q_PROPERTY(qreal y READ y WRITE setY NOTIFY updated)
- Q_PROPERTY(qreal z READ z WRITE setZ NOTIFY updated)
- Q_PROPERTY(QGLMaterial *material READ material WRITE setMaterial NOTIFY updated)
- Q_PROPERTY(QGLMaterial *backMaterial READ backMaterial WRITE setBackMaterial NOTIFY updated)
- Q_PROPERTY(Options options READ options WRITE setOptions NOTIFY updated)
-public:
- explicit QGLSceneNode(QObject *parent = 0);
- explicit QGLSceneNode(const QGeometryData &geometry, QObject *parent = 0);
- virtual ~QGLSceneNode();
-
- enum Option
- {
- NoOptions = 0x0000,
- CullBoundingBox = 0x0001,
- ViewNormals = 0x0002,
- ReportCulling = 0x0004,
- HideNode = 0x0008
- };
- Q_DECLARE_FLAGS(Options, Option)
-
- QGLSceneNode::Options options() const;
- void setOptions(QGLSceneNode::Options options);
- void setOption(QGLSceneNode::Option option, bool value);
-
- QGeometryData geometry() const;
- void setGeometry(QGeometryData);
-
- QBox3D boundingBox() const;
-
- QMatrix4x4 localTransform() const;
- void setLocalTransform(const QMatrix4x4 &);
- QVector3D position() const;
- void setPosition(const QVector3D &p);
- qreal x() const;
- void setX(qreal x);
- qreal y() const;
- void setY(qreal y);
- qreal z() const;
- void setZ(qreal z);
-
- QList<QGraphicsTransform3D *> transforms() const;
- void setTransforms(const QList<QGraphicsTransform3D *> &transforms);
- void addTransform(QGraphicsTransform3D *transform);
-
- QGL::DrawingMode drawingMode() const;
- void setDrawingMode(QGL::DrawingMode mode);
-
- qreal drawingWidth() const;
- void setDrawingWidth(qreal width);
-
- QGL::StandardEffect effect() const;
- void setEffect(QGL::StandardEffect);
-
- QGLAbstractEffect *userEffect() const;
- void setUserEffect(QGLAbstractEffect *effect);
-
- bool hasEffect() const;
- void setEffectEnabled(bool);
-
- int start() const;
- void setStart(int start);
-
- int count() const;
- void setCount(int count);
-
- int materialIndex() const;
- void setMaterialIndex(int material);
- int backMaterialIndex() const;
- void setBackMaterialIndex(int material);
-
- QGLMaterial *material() const;
- void setMaterial(QGLMaterial *material);
- QGLMaterial *backMaterial() const;
- void setBackMaterial(QGLMaterial *material);
-
- QGLMaterialCollection *palette() const;
- void setPalette(QGLMaterialCollection *palette);
-
- QList<QGLSceneNode*> allChildren() const;
- QList<QGLSceneNode *> children() const;
-
- void addNode(QGLSceneNode *node);
- void addNodes(const QList<QGLSceneNode *> &nodes);
- void removeNode(QGLSceneNode *node);
- void removeNodes(const QList<QGLSceneNode *> &nodes);
-
- virtual void draw(QGLPainter *painter);
-
- QGLPickNode *pickNode() const;
- void setPickNode(QGLPickNode *node);
-
- Q_INVOKABLE QGLSceneNode *clone(QObject *parent = 0) const;
- Q_INVOKABLE QGLSceneNode *cloneNoChildren(QObject *parent = 0) const;
- Q_INVOKABLE QGLSceneNode *allExcept(const QString &name, QObject *parent = 0) const;
- Q_INVOKABLE QGLSceneNode *only(const QString &name, QObject *parent = 0) const;
- Q_INVOKABLE QGLSceneNode *allExcept(const QStringList &names, QObject *parent = 0) const;
- Q_INVOKABLE QGLSceneNode *only(const QStringList &names, QObject *parent = 0) const;
-
-Q_SIGNALS:
- void updated();
- void culled();
- void displayed();
-
-protected:
- virtual void drawGeometry(QGLPainter *painter);
-
-private Q_SLOTS:
- void transformChanged();
-
-private:
- QMatrix4x4 transform() const;
- void invalidateBoundingBox() const;
- void invalidateTransform() const;
- void drawNormalIndicators(QGLPainter *painter);
- const QGLMaterial *setPainterMaterial(int material, QGLPainter *painter,
- QGL::Face faces, bool &changedTex);
-
- Q_DISABLE_COPY(QGLSceneNode)
-
- QScopedPointer<QGLSceneNodePrivate> d_ptr;
-
- QGLSceneNode(QGLSceneNodePrivate *d, QObject *parent);
-};
-
-Q_DECLARE_OPERATORS_FOR_FLAGS(QGLSceneNode::Options)
-
-Q_QT3D_EXPORT void qDumpScene(QGLSceneNode *, bool detailed = true, int indent = 0, const QSet<QGLSceneNode*> &loop = QSet<QGLSceneNode*>());
-
-#ifndef QT_NO_DEBUG_STREAM
-Q_QT3D_EXPORT QDebug operator<<(QDebug dbg, const QGLSceneNode &node);
-#endif
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/scene/qglscenenode_p.h b/src/threed/scene/qglscenenode_p.h
deleted file mode 100644
index 21028ddb..00000000
--- a/src/threed/scene/qglscenenode_p.h
+++ /dev/null
@@ -1,145 +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 QGLSCENENODE_P_H
-#define QGLSCENENODE_P_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 "qglnamespace.h"
-#include "qglscenenode.h"
-#include "qgraphicstransform3d.h"
-
-#include <QtGui/qmatrix4x4.h>
-#include <QtCore/qlist.h>
-#include <QtCore/qstringlist.h>
-#include <QtCore/qset.h>
-
-QT_BEGIN_NAMESPACE
-
-class QGLAbstractEffect;
-class QGLPickNode;
-
-class QGLSceneNodePrivate
-{
-public:
- QGLSceneNodePrivate()
- : palette(0)
- , localEffect(QGL::FlatColor) // 0 - zero
- , customEffect(0)
- , hasEffect(false)
- , material(-1)
- , backMaterial(-1)
- , start(0)
- , count(0)
- , options(0)
- , pickNode(0)
- , boxValid(false)
- , drawingMode(QGL::Triangles)
- , culled(false)
- {
- }
-
- // This constructor is used by QGLSceneNode::clone().
- QGLSceneNodePrivate(const QGLSceneNodePrivate *other)
- : geometry(other->geometry)
- , palette(other->palette)
- , localTransform(other->localTransform)
- , translate(other->translate)
- , localEffect(other->localEffect)
- , customEffect(other->customEffect)
- , hasEffect(other->hasEffect)
- , material(other->material)
- , backMaterial(other->backMaterial)
- , start(other->start)
- , count(other->count)
- , options(other->options)
- , pickNode(0) // Explicitly not cloned.
- , bb(other->bb)
- , boxValid(other->boxValid)
- , drawingMode(other->drawingMode)
- , drawingWidth(1.0)
- , culled(other->culled)
- {
- }
-
- inline void invalidateParentBoundingBox() const
- {
- QList<QGLSceneNode*>::const_iterator it = parentNodes.constBegin();
- for ( ; it != parentNodes.constEnd(); ++it)
- (*it)->invalidateBoundingBox();
- }
-
- QGeometryData geometry;
- QGLMaterialCollection *palette;
- QMatrix4x4 localTransform;
- QVector3D translate;
- QList<QGraphicsTransform3D *> transforms;
- QGL::StandardEffect localEffect;
- QGLAbstractEffect *customEffect;
- QList<QGLSceneNode*> childNodes;
- QList<QGLSceneNode*> parentNodes;
- bool hasEffect;
- int material;
- int backMaterial;
- int start;
- int count;
- QGLSceneNode::Options options;
- QGLPickNode *pickNode;
- mutable QBox3D bb;
- mutable bool boxValid;
- QGL::DrawingMode drawingMode;
- qreal drawingWidth;
- bool culled;
-};
-
-QT_END_NAMESPACE
-
-#endif // QGLSCENENODE_P_H
diff --git a/src/threed/scene/scene.pri b/src/threed/scene/scene.pri
deleted file mode 100644
index 289f6b9c..00000000
--- a/src/threed/scene/scene.pri
+++ /dev/null
@@ -1,19 +0,0 @@
-INCLUDEPATH += $$PWD
-VPATH += $$PWD
-HEADERS += scene/qglabstractscene.h \
- scene/qglsceneformatplugin.h \
- scene/qglscenenode.h \
- scene/qglpicknode.h \
- scene/qglrendersequencer.h \
- scene/qglrenderorder.h \
- scene/qglrenderordercomparator.h \
- scene/qglrenderstate.h
-SOURCES += qglabstractscene.cpp \
- qglsceneformatplugin.cpp \
- qglscenenode.cpp \
- qglpicknode.cpp \
- qglrendersequencer.cpp \
- qglrenderorder.cpp \
- qglrenderordercomparator.cpp \
- qglrenderstate.cpp
-PRIVATE_HEADERS += qglscenenode_p.h
diff --git a/src/threed/surfaces/qglabstractsurface.cpp b/src/threed/surfaces/qglabstractsurface.cpp
deleted file mode 100644
index 9e2bf216..00000000
--- a/src/threed/surfaces/qglabstractsurface.cpp
+++ /dev/null
@@ -1,318 +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 "qglabstractsurface.h"
-#include "qglcontextsurface_p.h"
-#include "qglframebufferobjectsurface.h"
-#include "qglpixelbuffersurface.h"
-#include "qglsubsurface.h"
-#include "qglwidgetsurface.h"
-#include <QtGui/qpaintdevice.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGLAbstractSurface
- \brief The QGLAbstractSurface class represents an OpenGL drawing surface.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::painting
-
- OpenGL can be used to draw into a number of different surface types:
- windows, pixel buffers (pbuffers), framebuffer objects, and so on.
- It is also possible to use only part of a surface by setting
- the \c{glViewport()} to restrict drawing to that part. An example
- of a subsurface may be the left or right eye image of a stereoscopic
- pair that is rendered into the two halves of a window.
-
- Activating a surface for OpenGL drawing, and deactivating it afterwards
- can be quite varied across surface types. Sometimes it is enough
- to just make a QGLContext current and set the \c{glViewport()}.
- Other times a context must be made current, followed by binding a
- framebuffer object, and finally setting the \c{glViewport()}.
-
- QGLAbstractSurface and its subclasses simplify the activation and
- deactivation of surfaces by encapsulating the logic needed to
- use a particular kind of surface into activate() and deactivate()
- respectively.
-
- Normally surfaces are activated by calling QGLPainter::pushSurface()
- as in the following example of switching drawing to a framebuffer
- object:
-
- \code
- QGLPainter painter;
- painter.begin(widget);
- QGLFramebufferObjectSurface surface(fbo);
- painter.pushSurface(&surface);
- ... // draw into the fbo
- painter.popSurface();
- ... // draw into the widget
- \endcode
-
- QGLPainter maintains a stack of surfaces, starting with the paint
- device specified to QGLPainter::begin() (usually a widget).
- The QGLPainter::pushSurface() function calls deactivate() on the
- current surface, activate() on the new surface, and then adjusts the
- \c{glViewport()} to match the value of viewportGL() for the new surface.
- When QGLPainter::popSurface() is called, the previous surface
- is re-activated and the \c{glViewport()} changed accordingly.
-
- \sa QGLFramebufferObjectSurface, QGLWidgetSurface, QGLSubsurface
- \sa QGLPixelBufferSurface, QGLPainter::pushSurface()
-*/
-
-/*!
- \enum QGLAbstractSurface::SurfaceType
- This enum defines the type of a QGLAbstractSurface.
-
- \value Widget Instance of QGLWidgetSurface.
- \value FramebufferObject Instance of QGLFramebufferObjectSurface.
- \value PixelBuffer Instance of QGLPixelBufferSurface.
- \value Subsurface Instance of QGLSubsurface.
- \value User First user-defined surface type for use by applications.
-*/
-
-/*!
- \fn QGLAbstractSurface::QGLAbstractSurface(int surfaceType)
-
- Constructs an OpenGL drawing surface of the specified \a surfaceType.
-*/
-
-/*!
- Destroys this OpenGL drawing surface.
-*/
-QGLAbstractSurface::~QGLAbstractSurface()
-{
-}
-
-/*!
- \fn int QGLAbstractSurface::surfaceType() const
-
- Returns the type of this surface.
-*/
-
-/*!
- \fn QPaintDevice *QGLAbstractSurface::device() const
-
- Returns the raw device that this surface will draw on.
-
- If the surface is an instance of QGLSubsurface, then this will
- return the device of the surface that underlies the subsurface.
- The viewportRect() defines the region to render into.
-
- \sa viewportRect()
-*/
-
-/*!
- \fn bool QGLAbstractSurface::activate(QGLAbstractSurface *prevSurface)
-
- Activate this surface by making its context current, and binding
- the associated framebuffer object, if any.
-
- If \a prevSurface is null, then that surface has just been deactivated
- in the process of switching to this surface. This may allow activate()
- to optimize the transition to avoid unnecessary state changes.
-
- Returns true if the surface was activated; false otherwise.
-
- \sa deactivate(), switchTo()
-*/
-
-/*!
- \fn void QGLAbstractSurface::deactivate(QGLAbstractSurface *nextSurface)
-
- Deactivate this surface from the current context, but leave the
- context current. Typically this will release the framebuffer
- object associated with the surface.
-
- If \a nextSurface is null, then that surface will be activated next
- in the process of switching away from this surface. This may allow
- deactivate() to optimize the transition to avoid unnecessary state
- changes.
-
- \sa activate(), switchTo()
-*/
-
-/*!
- Returns the rectangle of the surface device() that is occupied by
- the viewport for this surface. The origin is at the top-left.
-
- This function calls viewportGL() and then flips the rectangle
- upside down using the height of device() so that the origin
- is at the top-left instead of the bottom-right.
-
- \sa viewportGL(), device()
-*/
-QRect QGLAbstractSurface::viewportRect() const
-{
- QRect view = viewportGL();
- QPaintDevice *dev = device();
- int height;
- if (dev->devType() == QInternal::Widget)
- height = static_cast<QWidget *>(dev)->height();
- else
- height = dev->height();
- return QRect(view.x(), height - (view.y() + view.height()),
- view.width(), view.height());
-}
-
-/*!
- \fn QRect QGLAbstractSurface::viewportGL() const
-
- Returns the rectangle of the surface device() that is occupied by
- the viewport for this surface. The origin is at the bottom-left,
- which makes the value suitable for passing to \c{glViewport()}:
-
- \code
- QRect viewport = surface->viewportGL();
- glViewport(viewport.x(), viewport.y(), viewport.width(), viewport.height());
- \endcode
-
- Normally the viewport rectangle is the full extent of the device(),
- but it could be smaller if the application only wishes to draw
- into a subpart of the device(). An example would be rendering left
- and right stereo eye images into the two halves of a QGLWidget.
- The eye surfaces would typically be instances of QGLSubsurface.
-
- \sa viewportRect(), device()
-*/
-
-/*!
- Returns the aspect ratio of viewportGL() after correcting for the
- DPI of device().
-
- The return value is used to correct perspective and orthographic
- projections for the aspect ratio of the drawing surface. Subclasses
- may override this function to adjust the return value if the DPI of
- device() is not sufficient to determine the aspect ratio.
-*/
-qreal QGLAbstractSurface::aspectRatio() const
-{
- // Get the size of the current viewport.
- QSize size = viewportGL().size();
- if (size.width() == 0 || size.height() == 0 ||
- size.width() == size.height())
- return 1.0f;
-
- // Use the device's DPI setting to determine the pixel aspect ratio.
- QPaintDevice *device = this->device();
- int dpiX = device->logicalDpiX();
- int dpiY = device->logicalDpiY();
- if (dpiX <= 0 || dpiY <= 0)
- dpiX = dpiY = 1;
-
- // Return the final aspect ratio based on viewport and pixel size.
- return ((qreal)(size.width() * dpiY)) / ((qreal)(size.height() * dpiX));
-}
-
-/*!
- Switches from this surface to \a nextSurface by calling deactivate()
- on this surface and activate() on \a nextSurface.
-
- Returns true if \a nextSurface was activated, or false otherwise.
- If \a nextSurface could not be activated, then this surface will
- remain activated.
-
- \sa activate(), deactivate()
-*/
-bool QGLAbstractSurface::switchTo(QGLAbstractSurface *nextSurface)
-{
- if (nextSurface) {
- deactivate(nextSurface);
- if (nextSurface->activate(this))
- return true;
- activate();
- return false;
- } else {
- deactivate();
- return true;
- }
-}
-
-/*!
- Creates an OpenGL drawing surface for the specified paint \a device.
- Returns null if it is not possible to create a surface for \a device.
-
- \sa createSurfaceForContext()
-*/
-QGLAbstractSurface *QGLAbstractSurface::createSurfaceForDevice
- (QPaintDevice *device)
-{
- Q_ASSERT(device);
- switch (device->devType()) {
- case QInternal::Widget: {
- QGLWidget *glw = qobject_cast<QGLWidget *>
- (static_cast<QWidget *>(device));
- if (glw)
- return new QGLWidgetSurface(glw);
- else
- return 0;
- }
- case QInternal::Pbuffer:
- return new QGLPixelBufferSurface(static_cast<QGLPixelBuffer *>(device));
- case QInternal::FramebufferObject:
- return new QGLFramebufferObjectSurface
- (static_cast<QGLFramebufferObject *>(device));
- default:
- return 0;
- }
-}
-
-/*!
- Creates an OpenGL drawing surface for the paint device
- underlying \a context. If the paint device is not recognized,
- then a generic surface will be created that makes \a context
- current when the surface is activated.
-
- \sa createSurfaceForDevice()
-*/
-QGLAbstractSurface *QGLAbstractSurface::createSurfaceForContext
- (const QGLContext *context)
-{
- Q_ASSERT(context);
- QGLAbstractSurface *surface = createSurfaceForDevice(context->device());
- if (!surface)
- surface = new QGLContextSurface(context);
- return surface;
-}
-
-QT_END_NAMESPACE
diff --git a/src/threed/surfaces/qglabstractsurface.h b/src/threed/surfaces/qglabstractsurface.h
deleted file mode 100644
index 715abb47..00000000
--- a/src/threed/surfaces/qglabstractsurface.h
+++ /dev/null
@@ -1,95 +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 QGLABSTRACTSURFACE_H
-#define QGLABSTRACTSURFACE_H
-
-#include "qt3dglobal.h"
-#include <QtOpenGL/qgl.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class Q_QT3D_EXPORT QGLAbstractSurface
-{
-public:
- virtual ~QGLAbstractSurface();
-
- enum SurfaceType
- {
- Widget,
- FramebufferObject,
- PixelBuffer,
- Subsurface,
- User = 1000
- };
-
- int surfaceType() const { return m_type; }
-
- virtual QPaintDevice *device() const = 0;
- virtual bool activate(QGLAbstractSurface *prevSurface = 0) = 0;
- virtual void deactivate(QGLAbstractSurface *nextSurface = 0) = 0;
- virtual QRect viewportGL() const = 0;
- QRect viewportRect() const;
- virtual qreal aspectRatio() const;
-
- bool switchTo(QGLAbstractSurface *nextSurface);
-
- static QGLAbstractSurface *createSurfaceForDevice(QPaintDevice *device);
- static QGLAbstractSurface *createSurfaceForContext(const QGLContext *context);
-
-protected:
- QGLAbstractSurface(int surfaceType) : m_type(surfaceType) {}
-
-private:
- int m_type;
-
- Q_DISABLE_COPY(QGLAbstractSurface)
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/surfaces/qglcontextsurface.cpp b/src/threed/surfaces/qglcontextsurface.cpp
deleted file mode 100644
index 98a96f36..00000000
--- a/src/threed/surfaces/qglcontextsurface.cpp
+++ /dev/null
@@ -1,70 +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 "qglcontextsurface_p.h"
-
-QT_BEGIN_NAMESPACE
-
-QPaintDevice *QGLContextSurface::device() const
-{
- return m_context->device();
-}
-
-bool QGLContextSurface::activate(QGLAbstractSurface *prevSurface)
-{
- Q_UNUSED(prevSurface);
- if (QGLContext::currentContext() != m_context)
- const_cast<QGLContext *>(m_context)->makeCurrent();
- return true;
-}
-
-void QGLContextSurface::deactivate(QGLAbstractSurface *nextSurface)
-{
- Q_UNUSED(nextSurface);
-}
-
-QRect QGLContextSurface::viewportGL() const
-{
- QPaintDevice *device = m_context->device();
- return QRect(0, 0, device->width(), device->height());
-}
-
-QT_END_NAMESPACE
diff --git a/src/threed/surfaces/qglcontextsurface_p.h b/src/threed/surfaces/qglcontextsurface_p.h
deleted file mode 100644
index 6c1a8beb..00000000
--- a/src/threed/surfaces/qglcontextsurface_p.h
+++ /dev/null
@@ -1,85 +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 QGLCONTEXTSURFACE_P_H
-#define QGLCONTEXTSURFACE_P_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 "qglabstractsurface.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-class QGLContextSurface : public QGLAbstractSurface
-{
-public:
- explicit QGLContextSurface(const QGLContext *context)
- : QGLAbstractSurface(502)
- , m_context(context) {}
- ~QGLContextSurface() {}
-
- QPaintDevice *device() const;
- bool activate(QGLAbstractSurface *prevSurface);
- void deactivate(QGLAbstractSurface *nextSurface);
- QRect viewportGL() const;
-
-private:
- const QGLContext *m_context;
-
- Q_DISABLE_COPY(QGLContextSurface)
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/surfaces/qgldrawbuffersurface.cpp b/src/threed/surfaces/qgldrawbuffersurface.cpp
deleted file mode 100644
index 11aaa610..00000000
--- a/src/threed/surfaces/qgldrawbuffersurface.cpp
+++ /dev/null
@@ -1,71 +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 "qgldrawbuffersurface_p.h"
-
-QT_BEGIN_NAMESPACE
-
-QPaintDevice *QGLDrawBufferSurface::device() const
-{
- return m_surface->device();
-}
-
-bool QGLDrawBufferSurface::activate(QGLAbstractSurface *prevSurface)
-{
- if (!m_surface->activate(prevSurface))
- return false;
-#if defined(GL_BACK_LEFT) && defined(GL_BACK_RIGHT)
- glDrawBuffer(m_buffer);
-#endif
- return true;
-}
-
-void QGLDrawBufferSurface::deactivate(QGLAbstractSurface *nextSurface)
-{
- m_surface->deactivate(nextSurface);
-}
-
-QRect QGLDrawBufferSurface::viewportGL() const
-{
- return m_surface->viewportGL();
-}
-
-QT_END_NAMESPACE
diff --git a/src/threed/surfaces/qgldrawbuffersurface_p.h b/src/threed/surfaces/qgldrawbuffersurface_p.h
deleted file mode 100644
index 9fe6c2cc..00000000
--- a/src/threed/surfaces/qgldrawbuffersurface_p.h
+++ /dev/null
@@ -1,86 +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 QGLDRAWBUFFERSURFACE_P_H
-#define QGLDRAWBUFFERSURFACE_P_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 "qglabstractsurface.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-class QGLDrawBufferSurface : public QGLAbstractSurface
-{
-public:
- QGLDrawBufferSurface(QGLAbstractSurface *surface, GLenum buffer)
- : QGLAbstractSurface(500)
- , m_surface(surface), m_buffer(buffer) {}
- ~QGLDrawBufferSurface() {}
-
- QPaintDevice *device() const;
- bool activate(QGLAbstractSurface *prevSurface);
- void deactivate(QGLAbstractSurface *nextSurface);
- QRect viewportGL() const;
-
-private:
- QGLAbstractSurface *m_surface;
- GLenum m_buffer;
-
- Q_DISABLE_COPY(QGLDrawBufferSurface)
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/surfaces/qglframebufferobjectsurface.cpp b/src/threed/surfaces/qglframebufferobjectsurface.cpp
deleted file mode 100644
index 99551c26..00000000
--- a/src/threed/surfaces/qglframebufferobjectsurface.cpp
+++ /dev/null
@@ -1,209 +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 "qglframebufferobjectsurface.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGLFramebufferObjectSurface
- \brief The QGLFramebufferObjectSurface class represents a framebuffer object that is being used as an OpenGL drawing surface.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::painting
-*/
-
-class QGLFramebufferObjectSurfacePrivate
-{
-public:
- QGLFramebufferObjectSurfacePrivate
- (QGLFramebufferObject *fbo, const QGLContext *ctx)
- : framebufferObject(fbo), context(ctx) {}
-
- QGLFramebufferObject *framebufferObject;
- const QGLContext *context;
-};
-
-/*!
- Constructs a default framebuffer object surface. This constructor
- should be followed by a call to setFramebufferObject().
-*/
-QGLFramebufferObjectSurface::QGLFramebufferObjectSurface()
- : QGLAbstractSurface(QGLAbstractSurface::FramebufferObject)
- , d_ptr(new QGLFramebufferObjectSurfacePrivate(0, 0))
-{
-}
-
-/*!
- Constructs a framebuffer object surface for \a fbo and \a context.
- If \a context is null, then the framebuffer will be bound to the
- current context when activate() is called.
-*/
-QGLFramebufferObjectSurface::QGLFramebufferObjectSurface
- (QGLFramebufferObject *fbo, const QGLContext *context)
- : QGLAbstractSurface(QGLAbstractSurface::FramebufferObject)
- , d_ptr(new QGLFramebufferObjectSurfacePrivate(fbo, context))
-{
-}
-
-/*!
- Destroys this framebuffer object surface.
-*/
-QGLFramebufferObjectSurface::~QGLFramebufferObjectSurface()
-{
-}
-
-/*!
- Returns the context that owns framebufferObject(); or null
- if the framebufferObject() should be assumed to be owned by
- the current context when activate() is called.
-
- \sa setContext(), framebufferObject()
-*/
-const QGLContext *QGLFramebufferObjectSurface::context() const
-{
- Q_D(const QGLFramebufferObjectSurface);
- return d->context;
-}
-
-/*!
- Sets the \a context that owns framebufferObject().
-
- When activate() is called, it checks to see if \a context is sharing
- with the current context. If it is, then the framebufferObject()
- is directly bound to the current context. Otherwise, \a context
- is made current and then framebufferObject() is bound.
-
- If \a context is null, then framebufferObject() will be bound
- to whatever the current context is when activate() is called.
-
- \sa context()
-*/
-void QGLFramebufferObjectSurface::setContext(const QGLContext *context)
-{
- Q_D(QGLFramebufferObjectSurface);
- d->context = context;
-}
-
-/*!
- Returns the framebuffer object for this surface, or null if
- it has not been set yet.
-
- \sa setFramebufferObject(), context()
-*/
-QGLFramebufferObject *QGLFramebufferObjectSurface::framebufferObject() const
-{
- Q_D(const QGLFramebufferObjectSurface);
- return d->framebufferObject;
-}
-
-/*!
- Sets the framebuffer object for this surface to \a fbo.
-
- \sa framebufferObject()
-*/
-void QGLFramebufferObjectSurface::setFramebufferObject
- (QGLFramebufferObject *fbo)
-{
- Q_D(QGLFramebufferObjectSurface);
- d->framebufferObject = fbo;
-}
-
-/*!
- \reimp
-*/
-QPaintDevice *QGLFramebufferObjectSurface::device() const
-{
- Q_D(const QGLFramebufferObjectSurface);
- return d->framebufferObject;
-}
-
-/*!
- \reimp
-*/
-bool QGLFramebufferObjectSurface::activate(QGLAbstractSurface *prevSurface)
-{
- Q_UNUSED(prevSurface);
- Q_D(QGLFramebufferObjectSurface);
- if (d->context) {
- if (!QGLContext::areSharing(QGLContext::currentContext(), d->context))
- const_cast<QGLContext *>(d->context)->makeCurrent();
- } else {
- // If we don't have a current context, then something is wrong.
- Q_ASSERT(QGLContext::currentContext());
- }
- if (d->framebufferObject)
- return d->framebufferObject->bind();
- return false;
-}
-
-/*!
- \reimp
-*/
-void QGLFramebufferObjectSurface::deactivate(QGLAbstractSurface *nextSurface)
-{
- Q_D(QGLFramebufferObjectSurface);
- if (d->framebufferObject) {
- if (nextSurface && nextSurface->surfaceType() == FramebufferObject) {
- // If we are about to switch to another fbo that is on the
- // same context, then don't bother doing the release().
- // This saves an unnecessary glBindFramebuffer(0) call.
- if (static_cast<QGLFramebufferObjectSurface *>(nextSurface)
- ->context() == d->context)
- return;
- }
- d->framebufferObject->release();
- }
-}
-
-/*!
- \reimp
-*/
-QRect QGLFramebufferObjectSurface::viewportGL() const
-{
- Q_D(const QGLFramebufferObjectSurface);
- if (d->framebufferObject)
- return QRect(QPoint(0, 0), d->framebufferObject->size());
- else
- return QRect();
-}
-
-QT_END_NAMESPACE
diff --git a/src/threed/surfaces/qglframebufferobjectsurface.h b/src/threed/surfaces/qglframebufferobjectsurface.h
deleted file mode 100644
index 3135e81f..00000000
--- a/src/threed/surfaces/qglframebufferobjectsurface.h
+++ /dev/null
@@ -1,86 +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 QGLFRAMEBUFFEROBJECTSURFACE_H
-#define QGLFRAMEBUFFEROBJECTSURFACE_H
-
-#include "qglabstractsurface.h"
-#include <QtOpenGL/qglframebufferobject.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class QGLFramebufferObjectSurfacePrivate;
-
-class Q_QT3D_EXPORT QGLFramebufferObjectSurface : public QGLAbstractSurface
-{
-public:
- QGLFramebufferObjectSurface();
- explicit QGLFramebufferObjectSurface
- (QGLFramebufferObject *fbo, const QGLContext *context = 0);
- ~QGLFramebufferObjectSurface();
-
- const QGLContext *context() const;
- void setContext(const QGLContext *context);
-
- QGLFramebufferObject *framebufferObject() const;
- void setFramebufferObject(QGLFramebufferObject *fbo);
-
- QPaintDevice *device() const;
- bool activate(QGLAbstractSurface *prevSurface = 0);
- void deactivate(QGLAbstractSurface *nextSurface = 0);
- QRect viewportGL() const;
-
-private:
- QScopedPointer<QGLFramebufferObjectSurfacePrivate> d_ptr;
-
- Q_DECLARE_PRIVATE(QGLFramebufferObjectSurface)
- Q_DISABLE_COPY(QGLFramebufferObjectSurface)
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/surfaces/qglmaskedsurface.cpp b/src/threed/surfaces/qglmaskedsurface.cpp
deleted file mode 100644
index d2d46237..00000000
--- a/src/threed/surfaces/qglmaskedsurface.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 "qglmaskedsurface_p.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGLMaskedSurface
- \brief The QGLMaskedSurface class represents a masked copy of another OpenGL drawing surface.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::painting
- \internal
-
- Masked surfaces are typically used to render red-cyan anaglyph images
- into an underlying surface(). For the left eye image, the mask()
- is set to RedMask | AlphaMask. Then for the right eye image, the mask()
- is set to GreenMask | BlueMask.
-*/
-
-/*!
- \enum QGLMaskedSurface::BufferMaskBit
- This enum defines the channels to mask with QGLMaskedSurface.
-
- \value RedMask Allow the red channel to be written to the color buffer.
- \value GreenMask Allow the green channel to be written to the color buffer.
- \value BlueMask Allow the blue channel to be written to the color buffer.
- \value AlphaMask Allow the alpha channel to be written to the color buffer.
-*/
-
-class QGLMaskedSurfacePrivate
-{
-public:
- QGLMaskedSurfacePrivate
- (QGLAbstractSurface *surf = 0,
- QGLMaskedSurface::BufferMask msk = QGLMaskedSurface::RedMask |
- QGLMaskedSurface::GreenMask |
- QGLMaskedSurface::BlueMask |
- QGLMaskedSurface::AlphaMask)
- : surface(surf), mask(msk) {}
-
- QGLAbstractSurface *surface;
- QGLMaskedSurface::BufferMask mask;
-};
-
-#define MaskedSurfaceType 501
-
-/*!
- Constructs a masked OpenGL drawing surface with surface() initially
- set to null and mask() initially set to allow all channels to be
- written to the color buffer.
-*/
-QGLMaskedSurface::QGLMaskedSurface()
- : QGLAbstractSurface(MaskedSurfaceType)
- , d_ptr(new QGLMaskedSurfacePrivate)
-{
-}
-
-/*!
- Constructs a masked OpenGL drawing surface that applies \a mask
- to \a surface when activate() is called.
-*/
-QGLMaskedSurface::QGLMaskedSurface
- (QGLAbstractSurface *surface, QGLMaskedSurface::BufferMask mask)
- : QGLAbstractSurface(MaskedSurfaceType)
- , d_ptr(new QGLMaskedSurfacePrivate(surface, mask))
-{
-}
-
-/*!
- Destroys this masked OpenGL drawing surface.
-*/
-QGLMaskedSurface::~QGLMaskedSurface()
-{
-}
-
-/*!
- Returns the underlying surface that mask() will be applied to
- when activate() is called.
-
- \sa setSurface(), mask()
-*/
-QGLAbstractSurface *QGLMaskedSurface::surface() const
-{
- Q_D(const QGLMaskedSurface);
- return d->surface;
-}
-
-/*!
- Sets the underlying \a surface that mask() will be applied to
- when activate() is called.
-
- \sa surface(), setMask()
-*/
-void QGLMaskedSurface::setSurface(QGLAbstractSurface *surface)
-{
- Q_D(QGLMaskedSurface);
- d->surface = surface;
-}
-
-/*!
- Returns the color mask to apply to surface() when activate()
- is called.
-
- \sa setMask(), surface()
-*/
-QGLMaskedSurface::BufferMask QGLMaskedSurface::mask() const
-{
- Q_D(const QGLMaskedSurface);
- return d->mask;
-}
-
-/*!
- Sets the color \a mask to apply to surface() when activate()
- is called.
-
- \sa mask(), setSurface()
-*/
-void QGLMaskedSurface::setMask(QGLMaskedSurface::BufferMask mask)
-{
- Q_D(QGLMaskedSurface);
- d->mask = mask;
-}
-
-/*!
- \reimp
-*/
-QPaintDevice *QGLMaskedSurface::device() const
-{
- Q_D(const QGLMaskedSurface);
- return d->surface ? d->surface->device() : 0;
-}
-
-/*!
- \reimp
-*/
-bool QGLMaskedSurface::activate(QGLAbstractSurface *prevSurface)
-{
- Q_D(const QGLMaskedSurface);
- if (!d->surface || !d->surface->activate(prevSurface))
- return false;
- glColorMask((d->mask & RedMask) != 0, (d->mask & GreenMask) != 0,
- (d->mask & BlueMask) != 0, (d->mask & AlphaMask) != 0);
- return true;
-}
-
-/*!
- \reimp
-*/
-void QGLMaskedSurface::deactivate(QGLAbstractSurface *nextSurface)
-{
- Q_D(QGLMaskedSurface);
- if (d->surface)
- d->surface->deactivate(nextSurface);
- if (nextSurface && nextSurface->surfaceType() == MaskedSurfaceType) {
- // If we are about to switch to another masked surface for
- // the same underlying surface, then don't bother calling
- // glColorMask() for this one.
- QGLMaskedSurface *next = static_cast<QGLMaskedSurface *>(nextSurface);
- if (d->surface == next->surface())
- return;
- }
- glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
-}
-
-/*!
- \reimp
-*/
-QRect QGLMaskedSurface::viewportGL() const
-{
- Q_D(const QGLMaskedSurface);
- return d->surface ? d->surface->viewportGL() : QRect();
-}
-
-QT_END_NAMESPACE
diff --git a/src/threed/surfaces/qglmaskedsurface_p.h b/src/threed/surfaces/qglmaskedsurface_p.h
deleted file mode 100644
index b2b0c61d..00000000
--- a/src/threed/surfaces/qglmaskedsurface_p.h
+++ /dev/null
@@ -1,105 +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 QGLMASKEDSURFACE_H
-#define QGLMASKEDSURFACE_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 "qglabstractsurface.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-class QGLMaskedSurfacePrivate;
-
-class QGLMaskedSurface : public QGLAbstractSurface
-{
-public:
- enum BufferMaskBit
- {
- RedMask = 0x0001,
- GreenMask = 0x0002,
- BlueMask = 0x0004,
- AlphaMask = 0x0008
- };
- Q_DECLARE_FLAGS(BufferMask, BufferMaskBit)
-
- QGLMaskedSurface();
- QGLMaskedSurface
- (QGLAbstractSurface *surface, QGLMaskedSurface::BufferMask mask);
- ~QGLMaskedSurface();
-
- QGLAbstractSurface *surface() const;
- void setSurface(QGLAbstractSurface *surface);
-
- QGLMaskedSurface::BufferMask mask() const;
- void setMask(QGLMaskedSurface::BufferMask mask);
-
- QPaintDevice *device() const;
- bool activate(QGLAbstractSurface *prevSurface = 0);
- void deactivate(QGLAbstractSurface *nextSurface = 0);
- QRect viewportGL() const;
-
-private:
- QScopedPointer<QGLMaskedSurfacePrivate> d_ptr;
-
- Q_DECLARE_PRIVATE(QGLMaskedSurface)
- Q_DISABLE_COPY(QGLMaskedSurface)
-};
-
-Q_DECLARE_OPERATORS_FOR_FLAGS(QGLMaskedSurface::BufferMask)
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/surfaces/qglpaintersurface.cpp b/src/threed/surfaces/qglpaintersurface.cpp
deleted file mode 100644
index 98e9d436..00000000
--- a/src/threed/surfaces/qglpaintersurface.cpp
+++ /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 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 "qglpaintersurface_p.h"
-
-QT_BEGIN_NAMESPACE
-
-QPaintDevice *QGLPainterSurface::device() const
-{
- return m_painter->device();
-}
-
-bool QGLPainterSurface::activate(QGLAbstractSurface *prevSurface)
-{
- if (m_painterContext != QGLContext::currentContext())
- const_cast<QGLContext *>(m_painterContext)->makeCurrent();
- if (!prevSurface)
- m_painter->beginNativePainting();
- return true;
-}
-
-void QGLPainterSurface::deactivate(QGLAbstractSurface *nextSurface)
-{
- if (!nextSurface)
- m_painter->endNativePainting();
-}
-
-QRect QGLPainterSurface::viewportGL() const
-{
- QPaintDevice *device = m_painter->device();
- return QRect(0, 0, device->width(), device->height());
-}
-
-QT_END_NAMESPACE
diff --git a/src/threed/surfaces/qglpaintersurface_p.h b/src/threed/surfaces/qglpaintersurface_p.h
deleted file mode 100644
index 0dc49161..00000000
--- a/src/threed/surfaces/qglpaintersurface_p.h
+++ /dev/null
@@ -1,86 +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 QGLPAINTERSURFACE_P_H
-#define QGLPAINTERSURFACE_P_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 "qglabstractsurface.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-class QGLPainterSurface : public QGLAbstractSurface
-{
-public:
- explicit QGLPainterSurface(QPainter *painter)
- : QGLAbstractSurface(503)
- , m_painter(painter), m_painterContext(QGLContext::currentContext()) {}
- ~QGLPainterSurface() {}
-
- QPaintDevice *device() const;
- bool activate(QGLAbstractSurface *prevSurface);
- void deactivate(QGLAbstractSurface *nextSurface);
- QRect viewportGL() const;
-
-private:
- QPainter *m_painter;
- const QGLContext *m_painterContext;
-
- Q_DISABLE_COPY(QGLPainterSurface)
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/surfaces/qglpixelbuffersurface.cpp b/src/threed/surfaces/qglpixelbuffersurface.cpp
deleted file mode 100644
index 45735cc3..00000000
--- a/src/threed/surfaces/qglpixelbuffersurface.cpp
+++ /dev/null
@@ -1,142 +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 "qglpixelbuffersurface.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGLPixelBufferSurface
- \brief The QGLPixelBufferSurface class represents a pixel buffer that is being used as an OpenGL drawing surface.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::painting
-*/
-
-/*!
- Constructs a default pixel buffer surface. This constructor
- should be followed by a call to setPixelBuffer().
-*/
-QGLPixelBufferSurface::QGLPixelBufferSurface()
- : QGLAbstractSurface(QGLAbstractSurface::PixelBuffer)
- , m_pbuffer(0)
-{
-}
-
-/*!
- Constructs a pixel buffer surface for \a pbuffer.
-*/
-QGLPixelBufferSurface::QGLPixelBufferSurface(QGLPixelBuffer *pbuffer)
- : QGLAbstractSurface(QGLAbstractSurface::PixelBuffer)
- , m_pbuffer(pbuffer)
-{
-}
-
-/*!
- Destroys this pixel buffer surface.
-*/
-QGLPixelBufferSurface::~QGLPixelBufferSurface()
-{
-}
-
-/*!
- Returns the pixel buffer for this surface, or null if
- it has not been set yet.
-
- \sa setPixelBuffer()
-*/
-QGLPixelBuffer *QGLPixelBufferSurface::pixelBuffer() const
-{
- return m_pbuffer;
-}
-
-/*!
- Sets the framebuffer object for this surface to \a pbuffer.
-
- \sa pixelBuffer()
-*/
-void QGLPixelBufferSurface::setPixelBuffer
- (QGLPixelBuffer *pbuffer)
-{
- m_pbuffer = pbuffer;
-}
-
-/*!
- \reimp
-*/
-QPaintDevice *QGLPixelBufferSurface::device() const
-{
- return m_pbuffer;
-}
-
-/*!
- \reimp
-*/
-bool QGLPixelBufferSurface::activate(QGLAbstractSurface *prevSurface)
-{
- Q_UNUSED(prevSurface);
- if (m_pbuffer)
- return m_pbuffer->makeCurrent();
- else
- return false;
-}
-
-/*!
- \reimp
-*/
-void QGLPixelBufferSurface::deactivate(QGLAbstractSurface *nextSurface)
-{
- // Nothing to do here - leave the context current.
- Q_UNUSED(nextSurface);
-}
-
-/*!
- \reimp
-*/
-QRect QGLPixelBufferSurface::viewportGL() const
-{
- if (m_pbuffer)
- return QRect(0, 0, m_pbuffer->width(), m_pbuffer->height());
- else
- return QRect();
-}
-
-QT_END_NAMESPACE
diff --git a/src/threed/surfaces/qglpixelbuffersurface.h b/src/threed/surfaces/qglpixelbuffersurface.h
deleted file mode 100644
index 22dac86c..00000000
--- a/src/threed/surfaces/qglpixelbuffersurface.h
+++ /dev/null
@@ -1,79 +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 QGLPIXELBUFFERSURFACE_H
-#define QGLPIXELBUFFERSURFACE_H
-
-#include "qglabstractsurface.h"
-#include <QtOpenGL/qglpixelbuffer.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class Q_QT3D_EXPORT QGLPixelBufferSurface : public QGLAbstractSurface
-{
-public:
- QGLPixelBufferSurface();
- explicit QGLPixelBufferSurface(QGLPixelBuffer *pbuffer);
- ~QGLPixelBufferSurface();
-
- QGLPixelBuffer *pixelBuffer() const;
- void setPixelBuffer(QGLPixelBuffer *pbuffer);
-
- QPaintDevice *device() const;
- bool activate(QGLAbstractSurface *prevSurface = 0);
- void deactivate(QGLAbstractSurface *nextSurface = 0);
- QRect viewportGL() const;
-
-private:
- QGLPixelBuffer *m_pbuffer;
-
- Q_DISABLE_COPY(QGLPixelBufferSurface)
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/surfaces/qglsubsurface.cpp b/src/threed/surfaces/qglsubsurface.cpp
deleted file mode 100644
index 367dd621..00000000
--- a/src/threed/surfaces/qglsubsurface.cpp
+++ /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 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 "qglsubsurface.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGLSubsurface
- \brief The QGLSubsurface class represents a sub-surface of another OpenGL drawing surface.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::painting
-*/
-
-class QGLSubsurfacePrivate
-{
-public:
- QGLSubsurfacePrivate() : surface(0) {}
- QGLSubsurfacePrivate(QGLAbstractSurface *surf, const QRect &rgn)
- : surface(surf), region(rgn) {}
-
- QGLAbstractSurface *surface;
- QRect region;
-};
-
-/*!
- Constructs a new subsurface. This constructor should be followed
- by calls to setSurface() and setRegion().
-*/
-QGLSubsurface::QGLSubsurface()
- : QGLAbstractSurface(QGLAbstractSurface::Subsurface)
- , d_ptr(new QGLSubsurfacePrivate)
-{
-}
-
-/*!
- Constructs a new subsurface that occupies \a region within
- \a surface. The \a region has its origin at the top-left
- of \a surface.
-*/
-QGLSubsurface::QGLSubsurface
- (QGLAbstractSurface *surface, const QRect &region)
- : QGLAbstractSurface(QGLAbstractSurface::Subsurface)
- , d_ptr(new QGLSubsurfacePrivate(surface, region))
-{
-}
-
-/*!
- Destroys this subsurface.
-*/
-QGLSubsurface::~QGLSubsurface()
-{
-}
-
-/*!
- Returns the surface behind this subsurface, or null if the
- surface has not been set.
-
- \sa setSurface(), region()
-*/
-QGLAbstractSurface *QGLSubsurface::surface() const
-{
- Q_D(const QGLSubsurface);
- return d->surface;
-}
-
-/*!
- Sets the \a surface behind this subsurface.
-
- \sa surface(), setRegion()
-*/
-void QGLSubsurface::setSurface(QGLAbstractSurface *surface)
-{
- Q_D(QGLSubsurface);
- d->surface = surface;
-}
-
-/*!
- Returns the region within surface() that is occupied by this
- subsurface, relative to the viewportRect() of surface().
- The origin is at the top-left of surface().
-
- \sa setRegion(), surface()
-*/
-QRect QGLSubsurface::region() const
-{
- Q_D(const QGLSubsurface);
- return d->region;
-}
-
-/*!
- Sets the \a region within surface() that is occupied by this
- subsurface, relative to the viewportRect() of surface().
- The origin is at the top-left of surface().
-
- \sa region(), setSurface()
-*/
-void QGLSubsurface::setRegion(const QRect &region)
-{
- Q_D(QGLSubsurface);
- d->region = region;
-}
-
-/*!
- \reimp
-*/
-QPaintDevice *QGLSubsurface::device() const
-{
- Q_D(const QGLSubsurface);
- if (d->surface)
- return d->surface->device();
- else
- return 0;
-}
-
-/*!
- \reimp
-*/
-bool QGLSubsurface::activate(QGLAbstractSurface *prevSurface)
-{
- Q_D(QGLSubsurface);
- if (d->surface)
- return d->surface->activate(prevSurface);
- else
- return false;
-}
-
-/*!
- \reimp
-*/
-void QGLSubsurface::deactivate(QGLAbstractSurface *nextSurface)
-{
- Q_D(QGLSubsurface);
- if (d->surface)
- d->surface->deactivate(nextSurface);
-}
-
-/*!
- \reimp
-*/
-QRect QGLSubsurface::viewportGL() const
-{
- Q_D(const QGLSubsurface);
- if (d->surface) {
- // The underlying surface's viewportGL() has its origin
- // at the bottom-left, whereas d->region has its origin
- // at the top-left. Flip the sub-region and adjust.
- QRect rect = d->surface->viewportGL();
- return QRect(rect.x() + d->region.x(),
- rect.y() + rect.height() -
- (d->region.y() + d->region.height()),
- d->region.width(), d->region.height());
- } else {
- // Don't know the actual height of the surrounding surface,
- // so the best we can do is assume the region is bottom-aligned.
- return QRect(d->region.x(), 0, d->region.width(), d->region.height());
- }
-}
-
-QT_END_NAMESPACE
diff --git a/src/threed/surfaces/qglsubsurface.h b/src/threed/surfaces/qglsubsurface.h
deleted file mode 100644
index 69904a19..00000000
--- a/src/threed/surfaces/qglsubsurface.h
+++ /dev/null
@@ -1,84 +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 QGLSUBSURFACE_H
-#define QGLSUBSURFACE_H
-
-#include "qglabstractsurface.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class QGLSubsurfacePrivate;
-
-class Q_QT3D_EXPORT QGLSubsurface : public QGLAbstractSurface
-{
-public:
- QGLSubsurface();
- QGLSubsurface(QGLAbstractSurface *surface, const QRect &region);
- ~QGLSubsurface();
-
- QGLAbstractSurface *surface() const;
- void setSurface(QGLAbstractSurface *subSurface);
-
- QRect region() const;
- void setRegion(const QRect &region);
-
- QPaintDevice *device() const;
- bool activate(QGLAbstractSurface *prevSurface = 0);
- void deactivate(QGLAbstractSurface *nextSurface = 0);
- QRect viewportGL() const;
-
-private:
- QScopedPointer<QGLSubsurfacePrivate> d_ptr;
-
- Q_DECLARE_PRIVATE(QGLSubsurface)
- Q_DISABLE_COPY(QGLSubsurface)
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/surfaces/qglwidgetsurface.cpp b/src/threed/surfaces/qglwidgetsurface.cpp
deleted file mode 100644
index 7d137eb6..00000000
--- a/src/threed/surfaces/qglwidgetsurface.cpp
+++ /dev/null
@@ -1,146 +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 "qglwidgetsurface.h"
-#include <QtGui/qpainter.h>
-#include <QtGui/qpaintengine.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGLWidgetSurface
- \brief The QGLWidgetSurface class represents a QGLWidget that is begin used as an OpenGL drawing surface.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::painting
-*/
-
-/*!
- Constructs a widget surface. This constructor should be followed
- by a call to setWidget().
-*/
-QGLWidgetSurface::QGLWidgetSurface()
- : QGLAbstractSurface(QGLAbstractSurface::Widget)
- , m_widget(0)
-{
-}
-
-/*!
- Constructs a widget surface for \a widget.
-*/
-QGLWidgetSurface::QGLWidgetSurface(QGLWidget *widget)
- : QGLAbstractSurface(QGLAbstractSurface::Widget)
- , m_widget(widget)
-{
-}
-
-/*!
- Destroys this widget surface.
-*/
-QGLWidgetSurface::~QGLWidgetSurface()
-{
-}
-
-/*!
- Returns the widget that is underlying this surface.
-
- \sa setWidget()
-*/
-QGLWidget *QGLWidgetSurface::widget() const
-{
- return m_widget;
-}
-
-/*!
- Sets the \a widget that is underlying this surface.
-
- \sa widget()
-*/
-void QGLWidgetSurface::setWidget(QGLWidget *widget)
-{
- m_widget = widget;
-}
-
-/*!
- \reimp
-*/
-QPaintDevice *QGLWidgetSurface::device() const
-{
- return m_widget;
-}
-
-/*!
- \reimp
-*/
-bool QGLWidgetSurface::activate(QGLAbstractSurface *prevSurface)
-{
- Q_UNUSED(prevSurface);
- if (m_widget) {
- const QGLContext *context = m_widget->context();
- if (QGLContext::currentContext() != context)
- const_cast<QGLContext *>(context)->makeCurrent();
- return true;
- } else {
- return false;
- }
-}
-
-/*!
- \reimp
-*/
-void QGLWidgetSurface::deactivate(QGLAbstractSurface *nextSurface)
-{
- // Nothing to do here - leave the context current.
- Q_UNUSED(nextSurface);
-}
-
-/*!
- \reimp
-*/
-QRect QGLWidgetSurface::viewportGL() const
-{
- if (m_widget)
- return m_widget->rect(); // Origin assumed to be (0, 0).
- else
- return QRect();
-}
-
-QT_END_NAMESPACE
diff --git a/src/threed/surfaces/qglwidgetsurface.h b/src/threed/surfaces/qglwidgetsurface.h
deleted file mode 100644
index e0ce8e27..00000000
--- a/src/threed/surfaces/qglwidgetsurface.h
+++ /dev/null
@@ -1,80 +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 QGLWIDGETSURFACE_H
-#define QGLWIDGETSURFACE_H
-
-#include "qglabstractsurface.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class QGLWidgetSurfacePrivate;
-
-class Q_QT3D_EXPORT QGLWidgetSurface : public QGLAbstractSurface
-{
-public:
- QGLWidgetSurface();
- explicit QGLWidgetSurface(QGLWidget *widget);
- ~QGLWidgetSurface();
-
- QGLWidget *widget() const;
- void setWidget(QGLWidget *widget);
-
- QPaintDevice *device() const;
- bool activate(QGLAbstractSurface *prevSurface = 0);
- void deactivate(QGLAbstractSurface *nextSurface = 0);
- QRect viewportGL() const;
-
-private:
- QGLWidget *m_widget;
-
- Q_DISABLE_COPY(QGLWidgetSurface)
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/surfaces/surfaces.pri b/src/threed/surfaces/surfaces.pri
deleted file mode 100644
index 8ce35fb6..00000000
--- a/src/threed/surfaces/surfaces.pri
+++ /dev/null
@@ -1,23 +0,0 @@
-INCLUDEPATH += $$PWD
-VPATH += $$PWD
-HEADERS += \
- surfaces/qglabstractsurface.h \
- surfaces/qglframebufferobjectsurface.h \
- surfaces/qglpixelbuffersurface.h \
- surfaces/qglsubsurface.h \
- surfaces/qglwidgetsurface.h
-SOURCES += \
- qglabstractsurface.cpp \
- qglcontextsurface.cpp \
- qgldrawbuffersurface.cpp \
- qglframebufferobjectsurface.cpp \
- qglmaskedsurface.cpp \
- qglpaintersurface.cpp \
- qglpixelbuffersurface.cpp \
- qglsubsurface.cpp \
- qglwidgetsurface.cpp
-PRIVATE_HEADERS += \
- qglcontextsurface_p.h \
- qgldrawbuffersurface_p.h \
- qglmaskedsurface_p.h \
- qglpaintersurface_p.h
diff --git a/src/threed/textures/qareaallocator.cpp b/src/threed/textures/qareaallocator.cpp
deleted file mode 100644
index 79340c1a..00000000
--- a/src/threed/textures/qareaallocator.cpp
+++ /dev/null
@@ -1,877 +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 "qareaallocator.h"
-#include "qglnamespace.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QAreaAllocator
- \brief The QAreaAllocator class provides facilities for allocating sub-regions from a rectangular image.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::textures
- \internal
-
- Performance on a system can sometimes be improved by storing
- multiple small images in a single large image. This reduces
- memory allocation overhead and GPU state switching costs.
-
- QAreaAllocator and its subclasses implement standard strategies
- for sub-region allocation in images without tying those strategies
- to specific technologies such as raster, OpenGL, etc.
-
- Allocations are managed in a virtual two-dimensional space.
- The caller performs the actual texture upload based on the sub-region
- that allocate() returns.
-
- The caller can return a sub-region to the allocation pool with
- release(). Note that not all strategies support release().
-
- \sa QSimpleAreaAllocator, QGeneralAreaAllocator, QUniformAreaAllocator
-*/
-
-/*!
- \class QSimpleAreaAllocator
- \brief The QSimpleAreaAllocator class provides a simple allocation policy for simple-sized sub-allocations.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::textures
- \internal
-
- QSimpleAreaAllocator uses a trivial allocation strategy whereby
- sub-regions are allocated in rows, with a new row started each
- time the previous row fills up. Space is never reclaimed by
- release().
-
- This allocator is suitable for use when the allocations will all
- be of a similar size and all regions will be discarded at
- the same time when the allocator is destroyed. An example would
- be a font glyph manager.
-
- \sa QAreaAllocator, QGeneralAreaAllocator
-*/
-
-/*!
- \class QGeneralAreaAllocator
- \brief The QGeneralAreaAllocator class provides a general allocation policy for sub-regions in an image.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::textures
- \internal
-
- QGeneralAreaAllocator can handle arbitrary-sized allocations up to
- size(), in any order, and can release() previously allocated regions.
- It uses a binary subdivision algorithm on the image, which may result
- in fragmentation under heavy load.
-
- While technically any size sub-region up to size() can be allocated,
- once subdivision begins, the sizes that can be allocated will reduce
- substantially. It is recommended that incoming requests be size() / 4
- or less for best performance.
-
- If the sub-region sizes to be allocated are very similar, and release()
- is not necessary, then QSimpleAreaAllocator may work better than
- QGeneralAreaAllocator. If the sizes are very similar, and
- release() is necessary, then QUniformAreaAllocator may work better
- than QGeneralAreaAllocator.
-
- \sa QAreaAllocator, QSimpleAreaAllocator, QUniformAreaAllocator
-*/
-
-/*!
- \class QUniformAreaAllocator
- \brief The QUniformAreaAllocator class provides an allocation policy for uniform-sized areas.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::textures
- \internal
-
- QUniformAreaAllocator allocates any size up to uniformSize()
- by dividing size() up into a grid of uniformSize() areas.
- Areas can be deallocated with release() and returned to the pool.
-
- This allocator is suitable for use when the allocations will all
- be of a similar size. Unlike QSimpleAreaAllocator, this class
- can release allocations.
-
- \sa QAreaAllocator, QSimpleAreaAllocator, QGeneralAreaAllocator
-*/
-
-/*!
- \internal
-
- Constructs a new area allocator that is initially \a size pixels
- in size.
-
- \sa expand()
-*/
-QAreaAllocator::QAreaAllocator(const QSize &size)
- : m_size(size)
- , m_minAlloc(1, 1)
- , m_margin(0, 0)
-{
-}
-
-/*!
- \internal
-
- Destroys this area allocator.
-*/
-QAreaAllocator::~QAreaAllocator()
-{
-}
-
-/*!
- \fn QSize QAreaAllocator::size() const
- \internal
-
- Returns the current size of the area being used by this allocator.
-*/
-
-/*!
- \fn QSize QAreaAllocator::minimumAllocation() const
- \internal
-
- Returns the minimum allocation size in the x and y directions
- for areas returned by allocate(). The default is (1, 1).
-
- \sa setMinimumAllocation()
-*/
-
-/*!
- \fn void QAreaAllocator::setMinimumAllocation(const QSize &size)
- \internal
-
- Sets the minimum allocation \a size in the x and y directions
- for areas returned by allocate().
-
- For example, setting the minimum allocation to (8, 8) will force
- all allocations to be aligned on an 8-pixel boundary.
-
- \sa minimumAllocation()
-*/
-
-/*!
- \fn QSize QAreaAllocator::margin() const
- \internal
-
- Returns the margin that should be left between allocated items
- in the x and y directions. The default is (0, 0).
-
- This may be needed when using OpenGL textures because of
- rounding errors in the floating-point representation of
- texture co-ordinates. Leaving a small margin between allocations
- can help avoid adjacent images from bleeding into each other.
-
- \sa setMargin()
-*/
-
-/*!
- \fn void QAreaAllocator::setMargin(const QSize &margin)
- \internal
-
- Sets the \a margin that should be left between allocated items
- in the x and y directions.
-
- \sa margin()
-*/
-
-/*!
- \internal
-
- Expands this allocator to encompass the width and height of \a size.
- If the area is already larger, this function does nothing.
-
- The rectangles that were returned for previous allocations will
- remain valid.
-
- \sa expandBy()
-*/
-void QAreaAllocator::expand(const QSize &size)
-{
- int newWidth = qMax(m_size.width(), size.width());
- int newHeight = qMax(m_size.height(), size.height());
- m_size = QSize(newWidth, newHeight);
-}
-
-/*!
- \internal
-
- Expands this allocator by \a size pixels in the x and y directions.
-
- For example, expanding by (0, 128) will add 128 additional pixels
- of height but will leave the width unchanged.
-
- \sa expand()
-*/
-void QAreaAllocator::expandBy(const QSize &size)
-{
- expand(m_size + size);
-}
-
-/*!
- \fn QRect QAreaAllocator::allocate(const QSize &size)
- \internal
-
- Allocates \a size pixels from this allocator and returns the rectangle
- that should be used by the caller. Returns a null rectangle if
- this allocator does not have sufficient space to accommodate \a size.
-
- \sa release()
-*/
-
-/*!
- \internal
-
- Allocates and returns a list of rectangles corresponding to the
- elements of \a sizes. The returned list will have less elements
- than \a sizes if there is insufficient space to accommodate
- all of the allocation requests. The values that are in the returned
- list will be allocated and need to be passed to release() to
- deallocate them.
-
- The default implementation will call the subclass allocate() once
- for each size until all \a sizes have been allocated or an
- allocation fails. Subclasses may override this method to
- reorder the allocations for best-fit.
-
- \sa release()
-*/
-QList<QRect> QAreaAllocator::allocate(const QList<QSize> &sizes)
-{
- QList<QRect> rects;
- QRect rect;
- for (int index = 0; index < sizes.count(); ++index) {
- rect = allocate(sizes[index]);
- if (rect.isNull())
- break;
- rects.append(rect);
- }
- return rects;
-}
-
-/*!
- \internal
-
- Releases the space occupied by \a rect back to the allocator.
- The default implementation does nothing.
-
- The \a rect must have been returned by a previous call to allocate().
- Otherwise the behaviour is undefined.
-
- \sa allocate()
-*/
-void QAreaAllocator::release(const QRect &rect)
-{
- Q_UNUSED(rect);
-}
-
-/*!
- \internal
-
- Releases the space occupied by the members of \a rects back to
- the allocator. The default implementation calls release() for
- each rectangle in the list.
-
- The members of \a rects must have been returned by previous calls
- to allocate(). Otherwise the behaviour is undefined.
-
- \sa allocate()
-*/
-void QAreaAllocator::release(const QList<QRect> &rects)
-{
- for (int index = 0; index < rects.count(); ++index)
- release(rects[index]);
-}
-
-/*!
- \internal
-
- Returns a rough estimate of the number of bytes of overhead that
- are currently in use to store the house-keeping data structures
- for this area allocator. The default implementation returns zero.
-*/
-int QAreaAllocator::overhead() const
-{
- return 0;
-}
-
-/*!
- \internal
-
- Returns \a size, after rounding it up to account for
- minimumAllocation() and margin().
-
- This is a convenience function, provided for subclass overrides
- of allocate().
-
- \sa allocate()
-*/
-QSize QAreaAllocator::roundAllocation(const QSize &size) const
-{
- int width = size.width() + m_margin.width();
- int height = size.height() + m_margin.height();
- int extra = width % m_minAlloc.width();
- if (extra)
- width += m_minAlloc.width() - extra;
- extra = height % m_minAlloc.height();
- if (extra)
- height += m_minAlloc.height() - extra;
- return QSize(width, height);
-}
-
-/*!
- \internal
-
- Constructs a simple area allocator that is initially \a size pixels
- in size.
-*/
-QSimpleAreaAllocator::QSimpleAreaAllocator(const QSize &size)
- : QAreaAllocator(size)
- , m_row(0)
- , m_column(0)
- , m_rowHeight(0)
-{
-}
-
-/*!
- \internal
-
- Destroys this simple area allocator.
-*/
-QSimpleAreaAllocator::~QSimpleAreaAllocator()
-{
-}
-
-/*!
- \internal
-*/
-QRect QSimpleAreaAllocator::allocate(const QSize &size)
-{
- // Round up the allocation size to account for the margin and
- // minimum allocation parameters.
- QSize rounded = roundAllocation(size);
- int width = rounded.width();
- int height = rounded.height();
-
- // Bail out if the size is obviously too small or too big.
- if (width <= 0 || width > m_size.width())
- return QRect();
- if (height <= 0 || height > (m_size.height() - m_row))
- return QRect();
-
- // Do we need to place this allocation on a new row?
- int row = m_row;
- int column = m_column;
- int rowHeight = m_rowHeight;
- if ((column + width) > m_size.width()) {
- row += m_rowHeight;
- column = 0;
- rowHeight = 0;
- if (height > (m_size.height() - row))
- return QRect();
- }
-
- // Update the current allocation position.
- m_row = row;
- m_column = column + width;
- m_rowHeight = qMax(rowHeight, height);
-
- // Return the allocation, using the original size without rounding.
- return QRect(column, row, size.width(), size.height());
-}
-
-/*!
- \internal
-
- Constructs a general area allocator that is initially \a size pixels
- in size. The \a size will be rounded up to the next power of two,
- to simplify the internal allocation policy.
-
- This constructor sets minimumAllocation() to (8, 8) to reduce the
- housekeeping overhead of the internal data structures.
-*/
-QGeneralAreaAllocator::QGeneralAreaAllocator(const QSize &size)
- : QAreaAllocator(QGL::nextPowerOfTwo(size))
-{
- m_root = new Node();
- m_root->rect = QRect(0, 0, m_size.width(), m_size.height());
- m_root->largestFree = m_size;
- m_root->parent = 0;
- m_root->left = 0;
- m_root->right = 0;
- m_nodeCount = 1;
- setMinimumAllocation(QSize(8, 8));
-}
-
-/*!
- \internal
-
- Destroys this general area allocator.
-*/
-QGeneralAreaAllocator::~QGeneralAreaAllocator()
-{
- freeNode(m_root);
-}
-
-/*!
- \internal
-*/
-void QGeneralAreaAllocator::freeNode(Node *node)
-{
- if (node) {
- freeNode(node->left);
- freeNode(node->right);
- }
- delete node;
-}
-
-/*!
- \internal
-
- The \a size will be rounded up to the next power of two.
- Use size() to determine the actual size after expansion.
-*/
-void QGeneralAreaAllocator::expand(const QSize &size)
-{
- QAreaAllocator::expand(QGL::nextPowerOfTwo(size));
-
- if (m_root->rect.size() == m_size)
- return; // No change.
- if (!m_root->left && m_root->largestFree.width() > 0) {
- // No allocations have occurred, so just adjust the root size.
- m_root->rect = QRect(0, 0, m_size.width(), m_size.height());
- m_root->largestFree = m_size;
- return;
- }
-
- // Add extra nodes above the current root to expand the tree.
- Node *oldRoot = m_root;
- Split split;
- if (m_size.width() >= m_size.height())
- split = SplitOnX;
- else
- split = SplitOnY;
- while (m_root->rect.size() != m_size) {
- if (m_root->rect.width() == m_size.width())
- split = SplitOnY;
- else if (m_root->rect.height() == m_size.height())
- split = SplitOnX;
- Node *parent = new Node();
- Node *right = new Node();
- m_nodeCount += 2;
- m_root->parent = parent;
- parent->parent = 0;
- parent->left = m_root;
- parent->right = right;
- parent->largestFree = m_root->rect.size();
- right->parent = parent;
- right->left = 0;
- right->right = 0;
- right->largestFree = m_root->rect.size();
- if (split == SplitOnX) {
- parent->rect = QRect(m_root->rect.x(), m_root->rect.y(),
- m_root->rect.width() * 2,
- m_root->rect.height());
- right->rect = QRect(m_root->rect.x() + m_root->rect.width(),
- m_root->rect.y(),
- m_root->rect.width(), m_root->rect.height());
- } else {
- parent->rect = QRect(m_root->rect.x(), m_root->rect.y(),
- m_root->rect.width(),
- m_root->rect.height() * 2);
- right->rect = QRect(m_root->rect.x(),
- m_root->rect.y() + m_root->rect.width(),
- m_root->rect.width(), m_root->rect.height());
- }
- split = (split == SplitOnX ? SplitOnY : SplitOnX);
- m_root = parent;
- }
- updateLargestFree(oldRoot);
-}
-
-static inline bool fitsWithin(const QSize &size1, const QSize &size2)
-{
- return size1.width() <= size2.width() && size1.height() <= size2.height();
-}
-
-/*!
- \internal
-*/
-QRect QGeneralAreaAllocator::allocate(const QSize &size)
-{
- QSize rounded = roundAllocation(size);
- rounded = QGL::nextPowerOfTwo(rounded);
- if (rounded.width() <= 0 || rounded.width() > m_size.width() ||
- rounded.height() <= 0 || rounded.height() > m_size.height())
- return QRect();
- QPoint point = allocateFromNode(rounded, m_root);
- if (point.x() >= 0)
- return QRect(point, size);
- else
- return QRect();
-}
-
-/*!
- \internal
-*/
-QPoint QGeneralAreaAllocator::allocateFromNode(const QSize &size, Node *node)
-{
- // Find the best node to insert into, which should be
- // a node with the least amount of unused space that is
- // big enough to contain the requested size.
- while (node != 0) {
- // Go down a level and determine if the left or right
- // sub-tree contains the best chance of allocation.
- Node *left = node->left;
- Node *right = node->right;
- if (left && fitsWithin(size, left->largestFree)) {
- if (right && fitsWithin(size, right->largestFree)) {
- if (left->largestFree.width() < right->largestFree.width() ||
- left->largestFree.height() < right->largestFree.height()) {
- // The largestFree values may be a little oversized,
- // so try the left sub-tree and then the right sub-tree.
- QPoint point = allocateFromNode(size, left);
- if (point.x() >= 0)
- return point;
- else
- return allocateFromNode(size, right);
- } else {
- node = right;
- }
- } else {
- node = left;
- }
- } else if (right && fitsWithin(size, right->largestFree)) {
- node = right;
- } else if (left || right) {
- // Neither sub-node has enough space to allocate from.
- return QPoint(-1, -1);
- } else if (fitsWithin(size, node->largestFree)) {
- // Do we need to split this node into smaller pieces?
- Split split;
- if (fitsWithin(QSize(size.width() * 2, size.height() * 2),
- node->largestFree)) {
- // Split in either direction: choose the inverse of
- // the parent node's split direction to try to balance
- // out the wasted space as further subdivisions happen.
- if (node->parent &&
- node->parent->left->rect.x() ==
- node->parent->right->rect.x())
- split = SplitOnX;
- else if (node->parent)
- split = SplitOnY;
- else if (node->rect.width() >= node->rect.height())
- split = SplitOnX;
- else
- split = SplitOnY;
- } else if (fitsWithin(QSize(size.width() * 2, size.height()),
- node->largestFree)) {
- // Split along the X direction.
- split = SplitOnX;
- } else if (fitsWithin(QSize(size.width(), size.height() * 2),
- node->largestFree)) {
- // Split along the Y direction.
- split = SplitOnY;
- } else {
- // Cannot split further - allocate this node.
- node->largestFree = QSize(0, 0);
- updateLargestFree(node);
- return node->rect.topLeft();
- }
-
- // Split the node, then go around again using the left sub-tree.
- node = splitNode(node, split);
- } else {
- // Cannot possibly fit into this node.
- break;
- }
- }
- return QPoint(-1, -1);
-}
-
-/*!
- \internal
-*/
-QGeneralAreaAllocator::Node *QGeneralAreaAllocator::splitNode
- (Node *node, Split split)
-{
- Node *left = new Node();
- Node *right = new Node();
- m_nodeCount += 2;
- left->parent = node;
- left->left = 0;
- left->right = 0;
- right->parent = node;
- right->left = 0;
- right->right = 0;
- node->left = left;
- node->right = right;
- if (split == SplitOnX) {
- left->rect = QRect(node->rect.x(), node->rect.y(),
- node->rect.width() / 2,
- node->rect.height());
- right->rect = QRect(left->rect.right() + 1, node->rect.y(),
- node->rect.width() / 2,
- node->rect.height());
- } else {
- left->rect = QRect(node->rect.x(), node->rect.y(),
- node->rect.width(),
- node->rect.height() / 2);
- right->rect = QRect(node->rect.x(), left->rect.bottom() + 1,
- node->rect.width(),
- node->rect.height() / 2);
- }
- left->largestFree = left->rect.size();
- right->largestFree = right->rect.size();
- node->largestFree = right->largestFree;
- return left;
-}
-
-/*!
- \internal
-*/
-void QGeneralAreaAllocator::updateLargestFree(Node *node)
-{
- while ((node = node->parent) != 0) {
- node->largestFree =
- QSize(qMax(node->left->largestFree.width(),
- node->right->largestFree.width()),
- qMax(node->left->largestFree.height(),
- node->right->largestFree.height()));
- }
-}
-
-/*!
- \internal
-*/
-void QGeneralAreaAllocator::release(const QRect &rect)
-{
- // Locate the node that contains the allocated region.
- Node *node = m_root;
- QPoint point = rect.topLeft();
- while (node != 0) {
- if (node->left && node->left->rect.contains(point))
- node = node->left;
- else if (node->right && node->right->rect.contains(point))
- node = node->right;
- else if (node->rect.contains(point))
- break;
- else
- return; // Point is completely outside the tree.
- }
- if (!node)
- return;
-
- // Mark the node as free and then work upwards through the tree
- // recombining and deleting nodes until we reach a sibling
- // that is still allocated.
- node->largestFree = node->rect.size();
- while (node->parent) {
- if (node->parent->left == node) {
- if (node->parent->right->largestFree !=
- node->parent->right->rect.size())
- break;
- } else {
- if (node->parent->left->largestFree !=
- node->parent->left->rect.size())
- break;
- }
- node = node->parent;
- freeNode(node->left);
- freeNode(node->right);
- m_nodeCount -= 2;
- node->left = 0;
- node->right = 0;
- node->largestFree = node->rect.size();
- }
-
- // Make the rest of our ancestors have the correct "largest free size".
- updateLargestFree(node);
-}
-
-/*!
- \internal
-*/
-int QGeneralAreaAllocator::overhead() const
-{
- return m_nodeCount * sizeof(Node);
-}
-
-/*!
- \internal
-
- Constructs a uniform area allocator that is initially \a size pixels
- in size. The \a uniformSize specifies the single allocation size
- that is supported. All allocate() requests must be \a uniformSize
- or less.
-*/
-QUniformAreaAllocator::QUniformAreaAllocator
- (const QSize &size, const QSize &uniformSize)
- : QAreaAllocator(size), m_uniformSize(uniformSize), m_firstFree(0)
-{
- Q_ASSERT(uniformSize.width() > 0 && uniformSize.height() > 0);
- Q_ASSERT(size.width() >= uniformSize.width() &&
- size.height() >= uniformSize.height());
- m_gridSize = QSize(size.width() / uniformSize.width(),
- size.height() / uniformSize.height());
- int count = m_gridSize.width() * m_gridSize.height();
- m_grid = new int [count];
- for (int index = 0; index < (count - 1); ++index)
- m_grid[index] = index + 1;
- m_grid[count - 1] = -1;
-}
-
-/*!
- \internal
-
- Destroys this uniform area allocator.
-*/
-QUniformAreaAllocator::~QUniformAreaAllocator()
-{
- delete [] m_grid;
-}
-
-/*!
- \fn QSize QUniformAreaAllocator::uniformSize() const
- \internal
-
- Returns the uniform size of all allocations.
-
- \sa allocate()
-*/
-
-/*!
- \internal
-*/
-void QUniformAreaAllocator::expand(const QSize &size)
-{
- QAreaAllocator::expand(size);
-
- QSize newGridSize = QSize(m_size.width() / m_uniformSize.width(),
- m_size.height() / m_uniformSize.height());
- if (m_gridSize == newGridSize)
- return;
-
- // Create a new grid.
- int newCount = newGridSize.width() * newGridSize.height();
- int *newGrid = new int [newCount];
-
- // Copy across the free blocks from the old grid.
- int posn = m_firstFree;
- int newFirstFree = -1;
- while (posn != -1) {
- int x = posn % m_gridSize.width();
- int y = posn / m_gridSize.width();
- int newPosn = x + y * newGridSize.width();
- newGrid[newPosn] = newFirstFree;
- newFirstFree = newPosn;
- posn = m_grid[posn];
- }
-
- // Add free blocks within the expanded area of the new grid.
- for (int y = 0; y < m_gridSize.height(); ++y) {
- int newPosn = y * newGridSize.width() + m_gridSize.width();
- for (int x = m_gridSize.width(); x < newGridSize.width(); ++x) {
- newGrid[newPosn] = newFirstFree;
- newFirstFree = newPosn;
- ++newPosn;
- }
- }
- for (int y = m_gridSize.height(); y < newGridSize.height(); ++y) {
- int newPosn = y * newGridSize.width();
- for (int x = 0; x < newGridSize.width(); ++x) {
- newGrid[newPosn] = newFirstFree;
- newFirstFree = newPosn;
- ++newPosn;
- }
- }
-
- // Replace the old grid.
- delete [] m_grid;
- m_grid = newGrid;
- m_gridSize = newGridSize;
- m_firstFree = newFirstFree;
-}
-
-/*!
- \internal
-*/
-QRect QUniformAreaAllocator::allocate(const QSize &size)
-{
- QSize rounded = roundAllocation(size);
- if (rounded.width() > m_uniformSize.width() ||
- rounded.height() > m_uniformSize.height())
- return QRect();
- int posn = m_firstFree;
- if (posn == -1)
- return QRect();
- m_firstFree = m_grid[posn];
- int x = posn % m_gridSize.width();
- int y = posn / m_gridSize.width();
- return QRect(x * m_uniformSize.width(), y * m_uniformSize.height(),
- size.width(), size.height());
-}
-
-/*!
- \internal
-*/
-void QUniformAreaAllocator::release(const QRect &rect)
-{
- int x = rect.x() / m_uniformSize.width();
- int y = rect.y() / m_uniformSize.height();
- int posn = x + y * m_gridSize.width();
- Q_ASSERT(posn >= 0 && posn < m_gridSize.width() * m_gridSize.height());
- m_grid[posn] = m_firstFree;
- m_firstFree = posn;
-}
-
-/*!
- \internal
-*/
-int QUniformAreaAllocator::overhead() const
-{
- return sizeof(int) * m_gridSize.width() * m_gridSize.height();
-}
-
-QT_END_NAMESPACE
diff --git a/src/threed/textures/qareaallocator.h b/src/threed/textures/qareaallocator.h
deleted file mode 100644
index f861b500..00000000
--- a/src/threed/textures/qareaallocator.h
+++ /dev/null
@@ -1,169 +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 QAREAALLOCATOR_P_H
-#define QAREAALLOCATOR_P_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 "qt3dglobal.h"
-#include <QtCore/qsize.h>
-#include <QtCore/qrect.h>
-#include <QtCore/qlist.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class Q_QT3D_EXPORT QAreaAllocator
-{
-public:
- QAreaAllocator(const QSize &size);
- virtual ~QAreaAllocator();
-
- QSize size() const { return m_size; }
-
- QSize minimumAllocation() const { return m_minAlloc; }
- void setMinimumAllocation(const QSize &size) { m_minAlloc = size; }
-
- QSize margin() const { return m_margin; }
- void setMargin(const QSize &margin) { m_margin = margin; }
-
- virtual void expand(const QSize &size);
- void expandBy(const QSize &size);
-
- virtual QRect allocate(const QSize &size) = 0;
- virtual QList<QRect> allocate(const QList<QSize> &sizes);
- virtual void release(const QRect &rect);
- virtual void release(const QList<QRect> &rects);
-
- virtual int overhead() const;
-
-protected:
- QSize m_size;
- QSize m_minAlloc;
- QSize m_margin;
-
- QSize roundAllocation(const QSize &size) const;
-};
-
-class Q_QT3D_EXPORT QSimpleAreaAllocator : public QAreaAllocator
-{
-public:
- QSimpleAreaAllocator(const QSize &size);
- virtual ~QSimpleAreaAllocator();
-
- QRect allocate(const QSize &size);
-
-private:
- int m_row;
- int m_column;
- int m_rowHeight;
-};
-
-class Q_QT3D_EXPORT QGeneralAreaAllocator : public QAreaAllocator
-{
-public:
- QGeneralAreaAllocator(const QSize &size);
- virtual ~QGeneralAreaAllocator();
-
- void expand(const QSize &size);
- QRect allocate(const QSize &size);
- void release(const QRect &rect);
- int overhead() const;
-
-private:
- enum Split { SplitOnX, SplitOnY };
-
- struct Node
- {
- QRect rect;
- QSize largestFree;
- Node *parent;
- Node *left;
- Node *right;
- };
-
- Node *m_root;
- int m_nodeCount;
-
- static void freeNode(Node *node);
- QPoint allocateFromNode(const QSize &size, Node *node);
- Node *splitNode(Node *node, Split split);
- static void updateLargestFree(Node *node);
-};
-
-class Q_QT3D_EXPORT QUniformAreaAllocator : public QAreaAllocator
-{
-public:
- QUniformAreaAllocator(const QSize &size, const QSize &uniformSize);
- virtual ~QUniformAreaAllocator();
-
- QSize uniformSize() const { return m_uniformSize; }
-
- void expand(const QSize &size);
- QRect allocate(const QSize &size);
- void release(const QRect &rect);
- int overhead() const;
-
-private:
- QSize m_uniformSize;
- QSize m_gridSize;
- int *m_grid;
- int m_firstFree;
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/textures/qglsharedresource.cpp b/src/threed/textures/qglsharedresource.cpp
deleted file mode 100644
index ab6d0101..00000000
--- a/src/threed/textures/qglsharedresource.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 "qglsharedresource_p.h"
-#include <QtCore/qmutex.h>
-#include <QtCore/qcoreapplication.h>
-
-QT_BEGIN_NAMESPACE
-
-#if !defined(Q_MOC_RUN)
-
-class Q_OPENGL_EXPORT QGLSignalProxy : public QObject
-{
- Q_OBJECT
-public:
- QGLSignalProxy() : QObject() {}
- void emitAboutToDestroyContext(const QGLContext *context) {
- emit aboutToDestroyContext(context);
- }
- static QGLSignalProxy *instance();
-Q_SIGNALS:
- void aboutToDestroyContext(const QGLContext *context);
-};
-
-#endif
-
-class QGLContextInfo
-{
-public:
- QGLContextInfo(const QGLContext *ctx) : m_context(ctx), m_resources(0) {}
- ~QGLContextInfo();
-
- const QGLContext *m_context;
- QGLSharedResource *m_resources;
-};
-
-QGLContextInfo::~QGLContextInfo()
-{
- // Detach this information block from all of the shared resources
- // that used to be owned by it.
- QGLSharedResource *resource = m_resources;
- while (resource != 0) {
- resource->m_contextInfo = 0;
- resource->m_id = 0;
- resource = resource->m_next;
- }
-}
-
-class QGLContextManager : public QObject
-{
- Q_OBJECT
-public:
- QGLContextManager(QObject *parent = 0);
- ~QGLContextManager();
-
- QMutex managerLock;
-
- QGLContextInfo *contextInfo(const QGLContext *ctx);
-
-private Q_SLOTS:
- void aboutToDestroyContext(const QGLContext *ctx);
-
-private:
- QList<QGLContextInfo *> m_contexts;
-};
-
-Q_GLOBAL_STATIC(QGLContextManager, qt_gl_context_manager)
-
-QGLContextManager::QGLContextManager(QObject *parent)
- : QObject(parent)
-{
- QGLSignalProxy *proxy = QGLSignalProxy::instance();
- QThread *mainThread = qApp->thread();
- if (thread() != mainThread) {
- // The manager and signal proxy have been created for the first
- // time in a background thread. For safety, move both objects
- // to the main thread.
- moveToThread(mainThread);
- proxy->moveToThread(mainThread);
- }
- connect(proxy, SIGNAL(aboutToDestroyContext(const QGLContext *)),
- this, SLOT(aboutToDestroyContext(const QGLContext *)));
-}
-
-QGLContextManager::~QGLContextManager()
-{
- QMutexLocker locker(&managerLock);
- qDeleteAll(m_contexts);
-}
-
-QGLContextInfo *QGLContextManager::contextInfo(const QGLContext *ctx)
-{
- QGLContextInfo *info;
- for (int index = 0; index < m_contexts.size(); ++index) {
- info = m_contexts[index];
- if (info->m_context == ctx)
- return info;
- }
- info = new QGLContextInfo(ctx);
- m_contexts.append(info);
- return info;
-}
-
-Q_OPENGL_EXPORT const QGLContext *qt_gl_transfer_context(const QGLContext *);
-
-void QGLContextManager::aboutToDestroyContext(const QGLContext *ctx)
-{
- QMutexLocker locker(&managerLock);
- int index = 0;
- while (index < m_contexts.size()) {
- QGLContextInfo *info = m_contexts[index];
- if (info->m_context == ctx) {
- const QGLContext *transfer = qt_gl_transfer_context(ctx);
- if (transfer) {
- // Transfer ownership to another context in the same sharing
- // group. This may result in multiple QGLContextInfo objects
- // for the same context, which is ok.
- info->m_context = transfer;
- } else {
- // All contexts in the sharing group have been deleted,
- // so detach all of the shared resources.
- m_contexts.removeAt(index);
- delete info;
- continue;
- }
- }
- ++index;
- }
-}
-
-const QGLContext *QGLSharedResource::context() const
-{
- // Hope that the context will not be destroyed in another thread
- // while we are doing this so we don't have to acquire the lock.
- return m_contextInfo ? m_contextInfo->m_context : 0;
-}
-
-void QGLSharedResource::attach(const QGLContext *context, GLuint id)
-{
- Q_ASSERT(!m_contextInfo);
- QGLContextManager *manager = qt_gl_context_manager();
- QMutexLocker locker(&(manager->managerLock));
- m_contextInfo = manager->contextInfo(context);
- m_id = id;
- m_next = m_contextInfo->m_resources;
- m_prev = 0;
- if (m_contextInfo->m_resources)
- m_contextInfo->m_resources->m_prev = this;
- m_contextInfo->m_resources = this;
-}
-
-void QGLSharedResource::destroy()
-{
- // Detach this resource from the context information block.
- QGLContextManager *manager = qt_gl_context_manager();
- const QGLContext *owner = 0;
- GLuint id = 0;
- manager->managerLock.lock();
- if (m_contextInfo) {
- if (m_next)
- m_next->m_prev = m_prev;
- if (m_prev)
- m_prev->m_next = m_next;
- else
- m_contextInfo->m_resources = m_next;
- owner = m_contextInfo->m_context;
- id = m_id;
- }
- m_contextInfo = 0;
- m_id = 0;
- m_next = 0;
- m_prev = 0;
- manager->managerLock.unlock();
-
- // Switch back to the owning context temporarily and delete the id.
- if (owner && id) {
- QGLContext *currentContext = const_cast<QGLContext *>(QGLContext::currentContext());
- QGLContext *oldContext;
- QGLContext *doneContext;
- if (currentContext != owner && !QGLContext::areSharing(owner, currentContext)) {
- oldContext = currentContext;
- doneContext = const_cast<QGLContext *>(owner);
- doneContext->makeCurrent();
- } else {
- oldContext = 0;
- doneContext = 0;
- }
- m_destroyFunc(id);
- if (oldContext)
- oldContext->makeCurrent();
- else if (!currentContext && doneContext)
- doneContext->doneCurrent();
- }
-}
-
-QT_END_NAMESPACE
-
-#include "qglsharedresource.moc"
diff --git a/src/threed/textures/qglsharedresource_p.h b/src/threed/textures/qglsharedresource_p.h
deleted file mode 100644
index 2e03c9fa..00000000
--- a/src/threed/textures/qglsharedresource_p.h
+++ /dev/null
@@ -1,96 +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 QGLSHAREDRESOURCE_P_H
-#define QGLSHAREDRESOURCE_P_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 <QtOpenGL/qgl.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-class QGLContextManager;
-class QGLContextInfo;
-
-class QGLSharedResource
-{
-public:
- typedef void (*DestroyResourceFunc)(GLuint id);
- QGLSharedResource(DestroyResourceFunc destroyFunc)
- : m_destroyFunc(destroyFunc), m_contextInfo(0), m_id(0)
- , m_next(0), m_prev(0) {}
- ~QGLSharedResource() { destroy(); }
-
- const QGLContext *context() const;
- GLuint id() const { return m_id; }
- void clearId() { m_id = 0; }
-
- void attach(const QGLContext *context, GLuint id);
- void destroy();
-
-private:
- DestroyResourceFunc m_destroyFunc;
- QGLContextInfo *m_contextInfo;
- GLuint m_id;
- QGLSharedResource *m_next;
- QGLSharedResource *m_prev;
-
- friend class QGLContextManager;
- friend class QGLContextInfo;
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/textures/qgltexture2d.cpp b/src/threed/textures/qgltexture2d.cpp
deleted file mode 100644
index 07fe9891..00000000
--- a/src/threed/textures/qgltexture2d.cpp
+++ /dev/null
@@ -1,805 +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 "qgltexture2d.h"
-#include "qgltexture2d_p.h"
-#include "qgltextureutils_p.h"
-#include "qglpainter_p.h"
-#include "qglext_p.h"
-#include "qabstractdownloadmanager.h"
-#include "qdownloadmanager.h"
-#include "qthreadeddownloadmanager.h"
-#include "qopenglfunctions.h"
-
-#include <QtCore/qfile.h>
-#include <QtCore/qfileinfo.h>
-#include <QImageReader>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGLTexture2D
- \brief The QGLTexture2D class represents a 2D texture object for GL painting operations.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::textures
-
- QGLTexture2D contains a QImage and settings for texture filters,
- wrap modes, and mipmap generation. When bind() is called, this
- information is uploaded to the GL server if it has changed since
- the last time bind() was called.
-
- Once a QGLTexture2D object is created, it can be bound to multiple
- GL contexts. Internally, a separate texture identifier is created
- for each context. This makes QGLTexture2D easier to use than
- raw GL texture identifiers because the application does not need
- to be as concerned with whether the texture identifier is valid
- in the current context. The application merely calls bind() and
- QGLTexture2D will create a new texture identifier for the context
- if necessary.
-
- QGLTexture2D internally points to a reference-counted object that
- represents the current texture state. If the QGLTexture2D is copied,
- the internal pointer is the same. Modifications to one QGLTexture2D
- copy will affect all of the other copies in the system.
-
- The texture identifiers will be destroyed when the last QGLTexture2D
- reference is destroyed, or when a context is destroyed that contained a
- texture identifier that was created by QGLTexture2D.
-
- QGLTexture2D can also be used for uploading 1D textures into the
- GL server by specifying an image() with a height of 1.
-
- \sa QGLTextureCube
-*/
-
-Q_GLOBAL_STATIC(QSize, getMaxImageSize)
-
-QGLTexture2DPrivate::ForcePowerOfTwo QGLTexture2DPrivate::forcePowerOfTwo = QGLTexture2DPrivate::ForcePowerOfTwoUndefined;
-
-QGLTexture2DPrivate::QGLTexture2DPrivate()
-{
- horizontalWrap = QGL::Repeat;
- verticalWrap = QGL::Repeat;
- bindOptions = QGLContext::DefaultBindOption;
-#if !defined(QT_OPENGL_ES)
- mipmapSupported = false;
- mipmapSupportedKnown = false;
-#endif
- imageGeneration = 0;
- parameterGeneration = 0;
- infos = 0;
- downloadManager = 0;
-
- if (forcePowerOfTwo == ForcePowerOfTwoUndefined) {
- if (qgetenv("NPOT_MIPMAP_UNSUPPORTED").toInt() == 1)
- forcePowerOfTwo = ForcePowerOfTwoTrue;
- else
- forcePowerOfTwo = ForcePowerOfTwoFalse;
- }
-}
-
-QGLTexture2DPrivate::~QGLTexture2DPrivate()
-{
- // Destroy the texture id's in the GL server in their original contexts.
- QGLTexture2DTextureInfo *current = infos;
- QGLTexture2DTextureInfo *next;
- const QGLContext *currentContext =
- const_cast<QGLContext *>(QGLContext::currentContext());
- const QGLContext *firstContext = currentContext;
- while (current != 0) {
- next = current->next;
- if (current->isLiteral)
- current->tex.clearId(); // Don't delete literal id's.
- delete current;
- current = next;
- }
- if (firstContext != currentContext) {
- if (firstContext)
- const_cast<QGLContext *>(firstContext)->makeCurrent();
- else if (currentContext)
- const_cast<QGLContext *>(currentContext)->doneCurrent();
- }
-}
-
-/*!
- Constructs a null texture object and attaches it to \a parent.
-
- \sa isNull()
-*/
-QGLTexture2D::QGLTexture2D(QObject *parent)
- : QObject(parent), d_ptr(new QGLTexture2DPrivate())
-{
-}
-
-/*!
- Destroys this texture object. If this object is the last
- reference to the underlying GL texture, then the underlying
- GL texture will also be deleted.
-*/
-QGLTexture2D::~QGLTexture2D()
-{
-}
-
-/*!
- Returns true if this texture object is null; that is, image()
- is null and textureId() is zero.
-*/
-bool QGLTexture2D::isNull() const
-{
- Q_D(const QGLTexture2D);
- return d->image.isNull() && !d->infos;
-}
-
-/*!
- Returns true if this texture has an alpha channel; false if the
- texture is fully opaque.
-*/
-bool QGLTexture2D::hasAlphaChannel() const
-{
- Q_D(const QGLTexture2D);
- if (!d->image.isNull())
- return d->image.hasAlphaChannel();
- QGLTexture2DTextureInfo *info = d->infos;
- if (info)
- return info->tex.hasAlpha();
- return false;
-}
-
-/*!
- Returns the size of this texture. If the underlying OpenGL
- implementation requires texture sizes to be a power of two,
- then this function will return the next power of two equal
- to or greater than requestedSize()
-
- \sa setSize(), requestedSize()
-*/
-QSize QGLTexture2D::size() const
-{
- Q_D(const QGLTexture2D);
- return d->size;
-}
-
-/*!
- Sets the size of this texture to \a value. If the underlying
- OpenGL implementation requires texture sizes to be a power of
- two, then requestedSize() will be set to \a value, and the
- actual size will be set to the next power of two equal
- to or greater than \a value. Otherwise both size() and
- requestedSize() will be set to \a value.
-
- \sa size(), requestedSize()
-*/
-void QGLTexture2D::setSize(const QSize& value)
-{
- Q_D(QGLTexture2D);
- if (d->requestedSize == value)
- return;
- if (!(QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_Version_2_0)
- && !(QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_ES_Version_2_0))
- d->size = QGL::nextPowerOfTwo(value);
- else
- d->size = value;
- d->requestedSize = value;
- ++(d->imageGeneration);
-}
-
-/*!
- Returns the size that was previously set with setSize() before
- it was rounded to a power of two.
-
- \sa size(), setSize()
-*/
-QSize QGLTexture2D::requestedSize() const
-{
- Q_D(const QGLTexture2D);
- return d->requestedSize;
-}
-
-/*!
- Returns the image that is currently associated with this texture.
- The image may not have been uploaded into the GL server yet.
- Uploads occur upon the next call to bind().
-
- \sa setImage()
-*/
-QImage QGLTexture2D::image() const
-{
- Q_D(const QGLTexture2D);
- return d->image;
-}
-
-/*!
- Sets the \a image that is associated with this texture. The image
- will be uploaded into the GL server the next time bind() is called.
-
- If setSize() or setImage() has been called previously, then \a image
- will be scaled to size() when it is uploaded.
-
- If \a image is null, then this function is equivalent to clearImage().
-
- \sa image(), setSize(), copyImage(), setPixmap()
-*/
-void QGLTexture2D::setImage(const QImage& image)
-{
- Q_D(QGLTexture2D);
- d->compressedData = QByteArray(); // Clear compressed file data.
- if (image.isNull()) {
- // Don't change the imageGeneration, because we aren't actually
- // changing the image in the GL server, only the client copy.
- d->image = image;
- } else {
- if (image.size().isValid())
- setSize(image.size());
- d->image = image;
- ++(d->imageGeneration);
- }
-}
-
-/*!
- Sets the image that is associated with this texture to \a pixmap.
-
- This is a convenience that calls setImage() after converting
- \a pixmap into a QImage. It may be more efficient on some
- platforms than the application calling QPixmap::toImage().
-
- \sa setImage()
-*/
-void QGLTexture2D::setPixmap(const QPixmap& pixmap)
-{
- QImage image = pixmap.toImage();
- if (pixmap.depth() == 16 && !image.hasAlphaChannel()) {
- // If the system depth is 16 and the pixmap doesn't have an alpha channel
- // then we convert it to RGB16 in the hope that it gets uploaded as a 16
- // bit texture which is much faster to access than a 32-bit one.
- image = image.convertToFormat(QImage::Format_RGB16);
- }
- setImage(image);
-}
-
-/*!
- Clears the image() that is associated with this texture, but the
- GL texture will retain its current value. This can be used to
- release client-side memory that is no longer required once the
- image has been uploaded into the GL server.
-
- The following code will queue \c image to be uploaded, immediately
- force it to be uploaded into the current GL context, and then
- clear the client copy:
-
- \code
- texture.setImage(image);
- texture.bind();
- texture.clearImage()
- \endcode
-
- \sa image(), setImage()
-*/
-void QGLTexture2D::clearImage()
-{
- Q_D(QGLTexture2D);
- d->image = QImage();
-}
-
-#ifndef GL_GENERATE_MIPMAP_SGIS
-#define GL_GENERATE_MIPMAP_SGIS 0x8191
-#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192
-#endif
-
-/*!
- Sets this texture to the contents of a compressed image file
- at \a path. Returns true if the file exists and has a supported
- compressed format; false otherwise.
-
- The DDS, ETC1, PVRTC2, and PVRTC4 compression formats are
- supported, assuming that the GL implementation has the
- appropriate extension.
-
- \sa setImage(), setSize()
-*/
-bool QGLTexture2D::setCompressedFile(const QString &path)
-{
- Q_D(QGLTexture2D);
- d->image = QImage();
- QFile f(path);
- if (!f.open(QIODevice::ReadOnly))
- {
- qWarning("QGLTexture2D::setCompressedFile(%s): File could not be read",
- qPrintable(path));
- return false;
- }
- QByteArray data = f.readAll();
- f.close();
-
- bool hasAlpha, isFlipped;
- if (!QGLBoundTexture::canBindCompressedTexture
- (data.constData(), data.size(), 0, &hasAlpha, &isFlipped)) {
- qWarning("QGLTexture2D::setCompressedFile(%s): Format is not supported",
- path.toLocal8Bit().constData());
- return false;
- }
-
- QFileInfo fi(path);
- d->url = QUrl::fromLocalFile(fi.absoluteFilePath());
-
- // The 3DS loader expects the flip state to be set before bind().
- if (isFlipped)
- d->bindOptions &= ~QGLContext::InvertedYBindOption;
- else
- d->bindOptions |= QGLContext::InvertedYBindOption;
-
- d->compressedData = data;
- ++(d->imageGeneration);
- return true;
-}
-
-/*!
- Returns the url that was last set with setUrl.
-*/
-QUrl QGLTexture2D::url() const
-{
- Q_D(const QGLTexture2D);
- return d->url;
-}
-
-/*!
- Sets this texture to have the contents of the image stored at \a url.
-
- If the environment variable QT3D_MULTITHREAD is defined, network urls
- (http, etc) are downloaded in a separate download thread, otherwise they are
- downloaded asynchronously in the current thread.
-*/
-void QGLTexture2D::setUrl(const QUrl &url)
-{
- Q_D(QGLTexture2D);
- if (d->url == url)
- return;
- d->url = url;
-
- if (url.isEmpty())
- {
- d->image = QImage();
- }
- else
- {
- if (url.scheme() == QLatin1String("file") || url.scheme().toLower() == QLatin1String("qrc"))
- {
- QString fileName = url.toLocalFile();
-
- // slight hack since there doesn't appear to be a QUrl::toResourcePath() function
- // to convert qrc:///foo into :/foo
- if (url.scheme().toLower() == QLatin1String("qrc")) {
- // strips off any qrc: prefix and any excess slashes and replaces it with :/
- QUrl tempUrl(url);
- tempUrl.setScheme("");
- fileName = QLatin1String(":")+tempUrl.toString();
- }
-
- if (fileName.endsWith(QLatin1String(".dds"), Qt::CaseInsensitive))
- {
- setCompressedFile(fileName);
- }
- else
- {
- QImageReader imgReader;
- imgReader.setFileName(fileName);
-
- if (!getMaxImageSize()->isValid()) {
- imgReader.setScaledSize(imgReader.size().boundedTo(*getMaxImageSize()));
- }
-
- QImage im = imgReader.read();
- if (im.isNull())
- qWarning("Could not load texture: %s", qPrintable(fileName));
- setImage(im);
- }
- }
- else
- {
- if (!d->downloadManager) {
- if (getenv(QT3D_MULTITHREAD)) {
- //Download in a multithreaded environment
- d->downloadManager = new QThreadedDownloadManager();
- } else {
- //Download in a single threaded environment
- d->downloadManager = new QDownloadManager();
- }
- connect (d->downloadManager,SIGNAL(downloadComplete(QByteArray)),this, SLOT(textureRequestFinished(QByteArray)));
- }
-
- //Create a temporary image that will be used until the Url is loaded.
- static QImage tempImg(128,128, QImage::Format_RGB32);
- QColor fillcolor(Qt::gray);
- tempImg.fill(fillcolor.rgba());
- setImage(tempImg);
-
- if (!d->downloadManager->beginDownload(QUrl(url.toString()))) {
- qWarning("Unable to issue texture download request.");
- }
- }
- }
-}
-
-/*!
- Copies the contents of \a image to \a offset in this texture
- within the current GL context.
-
- Unlike setImage(), this function copies the image data to the
- GL server immediately using \c{glTexSubImage2D()}. This is typically
- used to update the contents of a texture after it has been created.
-
- It is assumed that the application has already called bind() on
- this texture to bind it to the current GL context.
-
- If the texture has been created in multiple contexts, only the
- texture identifier for the current context will be updated.
-
- \sa setImage(), bind()
-*/
-void QGLTexture2D::copyImage(const QImage& image, const QPoint& offset)
-{
- QImage img = QGLWidget::convertToGLFormat(image);
- glTexSubImage2D(GL_TEXTURE_2D, 0, offset.x(), offset.y(),
- img.width(), img.height(), GL_RGBA,
- GL_UNSIGNED_BYTE, img.bits());
-#if defined(QT_OPENGL_ES_2)
- Q_D(QGLTexture2D);
- if (d->bindOptions & QGLContext::MipmapBindOption)
- glGenerateMipmap(GL_TEXTURE_2D);
-#endif
-}
-
-/*!
- Returns the options to use when binding the image() to an OpenGL
- context for the first time. The default options are
- QGLContext::LinearFilteringBindOption |
- QGLContext::InvertedYBindOption | QGLContext::MipmapBindOption.
-
- \sa setBindOptions()
-*/
-QGLContext::BindOptions QGLTexture2D::bindOptions() const
-{
- Q_D(const QGLTexture2D);
- return d->bindOptions;
-}
-
-/*!
- Sets the \a options to use when binding the image() to an
- OpenGL context. If the image() has already been bound,
- then changing the options will cause it to be recreated
- from image() the next time bind() is called.
-
- \sa bindOptions(), bind()
-*/
-void QGLTexture2D::setBindOptions(QGLContext::BindOptions options)
-{
- Q_D(QGLTexture2D);
- if (d->bindOptions != options) {
- d->bindOptions = options;
- ++(d->imageGeneration);
- }
-}
-
-/*!
- Returns the wrapping mode for horizontal texture co-ordinates.
- The default value is QGL::Repeat.
-
- \sa setHorizontalWrap(), verticalWrap()
-*/
-QGL::TextureWrap QGLTexture2D::horizontalWrap() const
-{
- Q_D(const QGLTexture2D);
- return d->horizontalWrap;
-}
-
-/*!
- Sets the wrapping mode for horizontal texture co-ordinates to \a value.
-
- If \a value is not supported by the OpenGL implementation, it will be
- replaced with a value that is supported. If the application desires a
- very specific \a value, it can call horizontalWrap() to check that
- the specific value was actually set.
-
- The \a value will not be applied to the texture in the GL
- server until the next call to bind().
-
- \sa horizontalWrap(), setVerticalWrap()
-*/
-void QGLTexture2D::setHorizontalWrap(QGL::TextureWrap value)
-{
- Q_D(QGLTexture2D);
- value = qt_gl_modify_texture_wrap(value);
- if (d->horizontalWrap != value) {
- d->horizontalWrap = value;
- ++(d->parameterGeneration);
- }
-}
-
-/*!
- Returns the wrapping mode for vertical texture co-ordinates.
- The default value is QGL::Repeat.
-
- \sa setVerticalWrap(), horizontalWrap()
-*/
-QGL::TextureWrap QGLTexture2D::verticalWrap() const
-{
- Q_D(const QGLTexture2D);
- return d->verticalWrap;
-}
-
-/*!
- Sets the wrapping mode for vertical texture co-ordinates to \a value.
-
- If \a value is not supported by the OpenGL implementation, it will be
- replaced with a value that is supported. If the application desires a
- very specific \a value, it can call verticalWrap() to check that
- the specific value was actually set.
-
- The \a value will not be applied to the texture in the GL
- server until the next call to bind().
-
- \sa verticalWrap(), setHorizontalWrap()
-*/
-void QGLTexture2D::setVerticalWrap(QGL::TextureWrap value)
-{
- Q_D(QGLTexture2D);
- value = qt_gl_modify_texture_wrap(value);
- if (d->verticalWrap != value) {
- d->verticalWrap = value;
- ++(d->parameterGeneration);
- }
-}
-
-/*!
- Binds this texture to the 2D texture target.
-
- If this texture object is not associated with an identifier in
- the current context, then a new identifier will be created,
- and image() uploaded into the GL server.
-
- If setImage() or setSize() was called since the last upload,
- then image() will be re-uploaded to the GL server.
-
- Returns false if the texture could not be bound for some reason.
-
- \sa release(), textureId(), setImage()
-*/
-bool QGLTexture2D::bind() const
-{
- Q_D(const QGLTexture2D);
- return const_cast<QGLTexture2DPrivate *>(d)->bind(GL_TEXTURE_2D);
-}
-
-bool QGLTexture2DPrivate::bind(GLenum target)
-{
- // Get the current context. If we don't have one, then we
- // cannot bind the texture.
- const QGLContext *ctx = QGLContext::currentContext();
- if (!ctx)
- return false;
-
- QOpenGLFunctions glFuncs(ctx);
- if (!glFuncs.hasOpenGLFeature(QOpenGLFunctions::NPOTTextures))
- {
- QSize oldSize = size;
- size = QGL::nextPowerOfTwo(size);
- if (size != oldSize)
- ++imageGeneration;
- }
-
- // Find the information block for the context, or create one.
- QGLTexture2DTextureInfo *info = infos;
- QGLTexture2DTextureInfo *prev = 0;
- while (info != 0 && !QGLContext::areSharing(info->tex.context(), ctx)) {
- if (info->isLiteral)
- return false; // Cannot create extra texture id's for literals.
- prev = info;
- info = info->next;
- }
- if (!info) {
- info = new QGLTexture2DTextureInfo
- (ctx, 0, imageGeneration - 1, parameterGeneration - 1);
- if (prev)
- prev->next = info;
- else
- infos = info;
- }
-
- if (!info->tex.textureId() || imageGeneration != info->imageGeneration) {
- // Create the texture contents and upload a new image.
- info->tex.setOptions(bindOptions);
- if (!compressedData.isEmpty()) {
- info->tex.bindCompressedTexture
- (compressedData.constData(), compressedData.size());
- } else {
- info->tex.startUpload(ctx, target, image.size());
- bindImages(info);
- info->tex.finishUpload(target);
- }
- info->imageGeneration = imageGeneration;
- } else {
- // Bind the existing texture to the texture target.
- glBindTexture(target, info->tex.textureId());
- }
-
- // If the parameter generation has changed, then alter the parameters.
- if (parameterGeneration != info->parameterGeneration) {
- info->parameterGeneration = parameterGeneration;
- q_glTexParameteri(target, GL_TEXTURE_WRAP_S, horizontalWrap);
- q_glTexParameteri(target, GL_TEXTURE_WRAP_T, verticalWrap);
- }
-
- // Texture is ready to be used.
- return true;
-}
-
-void QGLTexture2DPrivate::bindImages(QGLTexture2DTextureInfo *info)
-{
- QSize scaledSize(size);
-#if defined(QT_OPENGL_ES_2)
- if ((bindOptions & QGLContext::MipmapBindOption) ||
- horizontalWrap != QGL::ClampToEdge ||
- verticalWrap != QGL::ClampToEdge) {
- // ES 2.0 does not support NPOT textures when mipmaps are in use,
- // or if the wrap mode isn't ClampToEdge.
- scaledSize = QGL::nextPowerOfTwo(scaledSize);
- }
-#endif
-
- if (forcePowerOfTwo == ForcePowerOfTwoTrue)
- scaledSize = QGL::nextPowerOfTwo(scaledSize);
-
- if (!image.isNull())
- info->tex.uploadFace(GL_TEXTURE_2D, image, scaledSize);
- else if (size.isValid())
- info->tex.createFace(GL_TEXTURE_2D, scaledSize);
-}
-
-/*!
- Releases the texture associated with the 2D texture target.
- This is equivalent to \c{glBindTexture(GL_TEXTURE_2D, 0)}.
-
- \sa bind()
-*/
-void QGLTexture2D::release() const
-{
- glBindTexture(GL_TEXTURE_2D, 0);
-}
-
-/*!
- Returns the identifier associated with this texture object in
- the current context.
-
- Returns zero if the texture has not previously been bound to
- the 2D texture target in the current context with bind().
-
- \sa bind()
-*/
-GLuint QGLTexture2D::textureId() const
-{
- Q_D(const QGLTexture2D);
- const QGLContext *ctx = QGLContext::currentContext();
- if (!ctx)
- return 0;
- QGLTexture2DTextureInfo *info = d->infos;
- while (info != 0 && !QGLContext::areSharing(info->tex.context(), ctx))
- info = info->next;
- return info ? info->tex.textureId() : 0;
-}
-
-/*!
- Constructs a QGLTexture2D object that wraps the supplied literal
- texture identifier \a id, with the dimensions specified by \a size.
-
- The \a id is assumed to have been created by the application in
- the current GL context, and it will be destroyed by the application
- after the returned QGLTexture2D object is destroyed.
-
- This function is intended for interfacing to existing code that
- uses raw GL texture identifiers. The returned QGLTexture2D can
- only be used with the current GL context.
-
- \sa textureId()
-*/
-QGLTexture2D *QGLTexture2D::fromTextureId(GLuint id, const QSize& size)
-{
- const QGLContext *ctx = QGLContext::currentContext();
- if (!id || !ctx)
- return 0;
-
- QGLTexture2D *texture = new QGLTexture2D();
- if (!size.isNull())
- texture->setSize(size);
- QGLTexture2DTextureInfo *info = new QGLTexture2DTextureInfo
- (ctx, id, texture->d_ptr->imageGeneration,
- texture->d_ptr->parameterGeneration, true);
- texture->d_ptr->infos = info;
- return texture;
-}
-
-/*!
- This slot is used to recieve signals from the QDownloadManager class
- which provides Url download capability across the network.
-
- A successful download will have a valid QByteArray stored in \a assetData,
- while a failed download (due to network error, etc), will result in
- a NULL value.
-
- Successful downloads use the image data downloaded into \a assetData,
- which is converted to an image/texture, and emit a textureUpdated()
- signal.
-
- \sa QDownloadManager
-*/
-void QGLTexture2D::textureRequestFinished(QByteArray assetData)
-{
- //Ensure valid asset data exists.
- if (assetData.isEmpty()) {
- qWarning("Network request failed. Texture not loaded.");
- } else {
- //Convert asset data to an image.
- QImage texImage;
- texImage.loadFromData(assetData);
- setImage(texImage.mirrored());
-
- emit textureUpdated();
- }
-}
-
-/*!
- Sets the maximum size of an image file loaded in a texture as being
- of \a width x \a height in size.
-
- \sa setUrl()
-*/
-void QGLTexture2D::setMaxImageSize(int width, int height)
-{
- Q_ASSERT(width>0 && height>0);
- (*getMaxImageSize()) = QSize(width, height);
-}
-
-/*!
- \fn QGLTexture2D::textureUpdated()
- Signals that some property of this texture has changed in a manner
- that may require that the parent material class be updated.
-*/
-
-QT_END_NAMESPACE
diff --git a/src/threed/textures/qgltexture2d.h b/src/threed/textures/qgltexture2d.h
deleted file mode 100644
index 0513848a..00000000
--- a/src/threed/textures/qgltexture2d.h
+++ /dev/null
@@ -1,115 +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 QGLTEXTURE2D_H
-#define QGLTEXTURE2D_H
-
-#include "qglnamespace.h"
-#include <QtOpenGL/qgl.h>
-#include <QtCore/qscopedpointer.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class QGLTexture2DPrivate;
-
-class Q_QT3D_EXPORT QGLTexture2D : public QObject
-{
- Q_OBJECT
-public:
- QGLTexture2D(QObject *parent = 0);
- ~QGLTexture2D();
-
- bool isNull() const;
- bool hasAlphaChannel() const;
-
- QSize size() const;
- void setSize(const QSize& value);
- QSize requestedSize() const;
-
- QImage image() const;
- void setImage(const QImage& image);
- bool setCompressedFile(const QString &path);
- QUrl url() const;
- void setUrl(const QUrl &url);
-
- void setPixmap(const QPixmap& pixmap);
-
- void clearImage();
-
- void copyImage(const QImage& image, const QPoint& offset = QPoint(0, 0));
-
- QGLContext::BindOptions bindOptions() const;
- void setBindOptions(QGLContext::BindOptions options);
-
- QGL::TextureWrap horizontalWrap() const;
- void setHorizontalWrap(QGL::TextureWrap value);
-
- QGL::TextureWrap verticalWrap() const;
- void setVerticalWrap(QGL::TextureWrap value);
-
- bool bind() const;
- void release() const;
-
- GLuint textureId() const;
-
- static void setMaxImageSize(int width, int height);
-
- static QGLTexture2D *fromTextureId(GLuint id, const QSize& size);
-signals:
- void textureUpdated();
-public slots:
- void textureRequestFinished(QByteArray);
-private:
- QScopedPointer<QGLTexture2DPrivate> d_ptr;
-
- Q_DISABLE_COPY(QGLTexture2D)
- Q_DECLARE_PRIVATE(QGLTexture2D)
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/textures/qgltexture2d_p.h b/src/threed/textures/qgltexture2d_p.h
deleted file mode 100644
index 0e9ac634..00000000
--- a/src/threed/textures/qgltexture2d_p.h
+++ /dev/null
@@ -1,126 +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 QGLTEXTURE2D_P_H
-#define QGLTEXTURE2D_P_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 "qgltexture2d.h"
-#include "qgltextureutils_p.h"
-#include "qurl.h"
-#include <QtCore/qatomic.h>
-
-QT_BEGIN_NAMESPACE
-
-class QAbstractDownloadManager;
-
-class QGLTexture2DTextureInfo
-{
-public:
- QGLTexture2DTextureInfo
- (const QGLContext *context, GLuint textureId, uint imageGeneration,
- uint parameterGeneration, bool isLiteral = false)
- {
- if (textureId)
- tex.setTextureId(context, textureId);
- this->imageGeneration = imageGeneration;
- this->parameterGeneration = parameterGeneration;
- this->isLiteral = isLiteral;
- this->next = 0;
- }
-
- QGLBoundTexture tex;
- uint imageGeneration;
- uint parameterGeneration;
- bool isLiteral;
- QGLTexture2DTextureInfo *next;
-};
-
-class DDSFormat;
-
-class QGLTexture2DPrivate
-{
-public:
- QGLTexture2DPrivate();
- ~QGLTexture2DPrivate();
-
- QSize size;
- QSize requestedSize;
- QImage image;
- QUrl url;
- QByteArray compressedData;
- QGLContext::BindOptions bindOptions;
- QGL::TextureWrap horizontalWrap;
- QGL::TextureWrap verticalWrap;
-#if !defined(QT_OPENGL_ES)
- bool mipmapSupported;
- bool mipmapSupportedKnown;
-#endif
- uint imageGeneration;
- uint parameterGeneration;
- QGLTexture2DTextureInfo *infos;
- QAbstractDownloadManager *downloadManager;
-
- enum ForcePowerOfTwo {
- ForcePowerOfTwoUndefined = -1,
- ForcePowerOfTwoFalse = 0,
- ForcePowerOfTwoTrue = 1
- };
-
- static ForcePowerOfTwo forcePowerOfTwo;
-
- bool bind(GLenum target);
- virtual void bindImages(QGLTexture2DTextureInfo *info);
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/threed/textures/qgltexturecube.cpp b/src/threed/textures/qgltexturecube.cpp
deleted file mode 100644
index f9587462..00000000
--- a/src/threed/textures/qgltexturecube.cpp
+++ /dev/null
@@ -1,549 +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 "qgltexturecube.h"
-#include "qgltexture2d_p.h"
-#include "qgltextureutils_p.h"
-#include "qglpainter_p.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGLTextureCube
- \brief The QGLTextureCube class represents a cube map texture object for GL painting operations.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::textures
-
- QGLTextureCube contains six QImage objects for each of the cube
- map faces and settings for texture filters, wrap modes, and mipmap
- generation. When bind() is called, this information is uploaded to
- the GL server if it has changed since the last time bind() was called.
-
- Once a QGLTextureCube object is created, it can be bound to multiple
- GL contexts. Internally, a separate texture identifier is created
- for each context. This makes QGLTextureCube easier to use than
- raw GL texture identifiers because the application does not need
- to be as concerned with whether the texture identifier is valid
- in the current context. The application merely calls bind() and
- QGLTextureCube will create a new texture identifier for the context
- if necessary.
-
- QGLTextureCube internally points to a reference-counted object that
- represents the current texture state. If the QGLTextureCube is copied,
- the internal pointer is the same. Modifications to one QGLTextureCube
- copy will affect all of the other copies in the system.
-
- The texture identifiers will be destroyed when the last QGLTextureCube
- reference is destroyed, or when a context is destroyed that contained a
- texture identifier that was created by QGLTextureCube.
-
- \sa QGLTexture2D
-*/
-
-/*!
- \enum QGLTextureCube::Face
- This enum defines the face of a cube map texture that is affected
- by a texture operation on QGLTextureCube instances.
-
- \value PositiveX The positive X face of the cube map.
- \value NegativeX The negative X face of the cube map.
- \value PositiveY The positive Y face of the cube map.
- \value NegativeY The negative Y face of the cube map.
- \value PositiveZ The positive Z face of the cube map.
- \value NegativeZ The negative Z face of the cube map.
-*/
-
-class QGLTextureCubePrivate : public QGLTexture2DPrivate
-{
-public:
- QGLTextureCubePrivate();
- ~QGLTextureCubePrivate();
-
- void bindImages(QGLTexture2DTextureInfo *info);
-
- QImage otherImages[5];
- uint changedFaces;
-};
-
-QGLTextureCubePrivate::QGLTextureCubePrivate()
-{
- changedFaces = 0;
-}
-
-QGLTextureCubePrivate::~QGLTextureCubePrivate()
-{
-}
-
-void QGLTextureCubePrivate::bindImages(QGLTexture2DTextureInfo *info)
-{
- QSize scaledSize(size);
-#if defined(QT_OPENGL_ES_2)
- if ((bindOptions & QGLContext::MipmapBindOption) ||
- horizontalWrap != QGL::ClampToEdge ||
- verticalWrap != QGL::ClampToEdge) {
- // ES 2.0 does not support NPOT textures when mipmaps are in use,
- // or if the wrap mode isn't ClampToEdge.
- scaledSize = QGL::nextPowerOfTwo(scaledSize);
- }
-#endif
-
- // Handle the first face.
- if (!image.isNull())
- info->tex.uploadFace(GL_TEXTURE_CUBE_MAP_POSITIVE_X, image, scaledSize);
- else if (size.isValid())
- info->tex.createFace(GL_TEXTURE_CUBE_MAP_POSITIVE_X, scaledSize);
-
- // Handle the other faces.
- for (int face = 1; face < 6; ++face) {
- if (!otherImages[face - 1].isNull()) {
- info->tex.uploadFace(GL_TEXTURE_CUBE_MAP_POSITIVE_X + face,
- otherImages[face - 1], scaledSize);
- } else {
- info->tex.createFace(GL_TEXTURE_CUBE_MAP_POSITIVE_X + face, scaledSize);
- }
- }
-}
-
-/*!
- Constructs a null texture object.
-
- \sa isNull()
-*/
-QGLTextureCube::QGLTextureCube()
- : d_ptr(new QGLTextureCubePrivate())
-{
-}
-
-/*!
- Destroys this texture object. If this object is the last
- reference to the underlying GL texture, then the underlying
- GL texture will also be deleted.
-*/
-QGLTextureCube::~QGLTextureCube()
-{
-}
-
-/*!
- Returns true if this texture object is null; that is, all image()
- values are null and textureId() is zero.
-*/
-bool QGLTextureCube::isNull() const
-{
- // TODO
- Q_D(const QGLTextureCube);
- return !d->infos;
-}
-
-/*!
- Returns true if this texture has an alpha channel; false if the
- texture is fully opaque.
-*/
-bool QGLTextureCube::hasAlphaChannel() const
-{
- Q_D(const QGLTextureCube);
- if (!d->image.isNull() && d->image.hasAlphaChannel())
- return true;
- for (int face = 0; face < 5; ++face) {
- if (!d->otherImages[face].isNull()) {
- if (d->otherImages[face].hasAlphaChannel())
- return true;
- }
- }
- QGLTexture2DTextureInfo *info = d->infos;
- if (info)
- return info->tex.hasAlpha();
- return false;
-}
-
-/*!
- Returns the size of this texture. If the underlying OpenGL
- implementation requires texture sizes to be a power of two,
- then this function will return the next power of two equal
- to or greater than requestedSize()
-
- \sa setSize(), requestedSize()
-*/
-QSize QGLTextureCube::size() const
-{
- Q_D(const QGLTextureCube);
- return d->size;
-}
-
-/*!
- Sets the size of this texture to \a value. If the underlying
- OpenGL implementation requires texture sizes to be a power of
- two, then requestedSize() will be set to \a value, and the
- actual size will be set to the next power of two equal
- to or greater than \a value. Otherwise both size() and
- requestedSize() will be set to \a value.
-
- \sa size(), requestedSize()
-*/
-void QGLTextureCube::setSize(const QSize& value)
-{
- Q_D(QGLTextureCube);
- if (d->requestedSize == value)
- return;
- if (!(QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_Version_2_0) &&
- !(QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_ES_Version_2_0))
- d->size = QGL::nextPowerOfTwo(value);
- else
- d->size = value;
- d->requestedSize = value;
- ++(d->imageGeneration);
-}
-
-/*!
- Returns the size that was previously set with setSize() before
- it was rounded to a power of two.
-
- \sa size(), setSize()
-*/
-QSize QGLTextureCube::requestedSize() const
-{
- Q_D(const QGLTextureCube);
- return d->requestedSize;
-}
-
-/*!
- Returns the image that is currently associated with the specified
- \a face of this cube map texture. The image may not have been
- uploaded into the GL server yet. Uploads occur upon the next
- call to bind().
-
- \sa setImage()
-*/
-QImage QGLTextureCube::image(QGLTextureCube::Face face) const
-{
- Q_D(const QGLTextureCube);
- if (uint(face) >= 6)
- return QImage();
- if (face == 0)
- return d->image;
- else
- return d->otherImages[face - 1];
-}
-
-/*!
- Sets the \a image that is associated with this texture on the
- specified \a face of the cube map. The image will be uploaded
- into the GL server the next time bind() is called.
-
- If setSize() or setImage() has been called previously, then \a image
- will be scaled to size() when it is uploaded.
-
- If \a image is null, then this function is equivalent to clearImage().
-
- \sa image(), setSize(), copyImage()
-*/
-void QGLTextureCube::setImage
- (QGLTextureCube::Face face, const QImage& image)
-{
- Q_D(QGLTextureCube);
- if (uint(face) >= 6)
- return;
- if (image.isNull()) {
- // Don't change the imageGeneration, because we aren't actually
- // changing the image in the GL server, only the client copy.
- if (face == 0)
- d->image = image;
- else
- d->otherImages[face - 1] = image;
- } else {
- if (!d->size.isValid())
- setSize(image.size());
- if (face == 0)
- d->image = image;
- else
- d->otherImages[face - 1] = image;
- ++(d->imageGeneration);
- d->changedFaces |= (1 << face);
- }
-}
-
-/*!
- Clears the image() that is associated with this texture on the
- specified \a face of the cube map. The GL texture will retain
- its current value. This can be used to release client-side memory
- that is no longer required once the image has been uploaded into
- the GL server.
-
- The following code will queue \c image to be uploaded as the
- positive X face of the cube map, immediately force it to
- be uploaded into the current GL context, and then clear the
- client copy:
-
- \code
- texture.setImage(QGLTextureCube::PositiveX, image);
- texture.bind();
- texture.clearImage(QGLTextureCube::PositiveX);
- \endcode
-
- \sa image(), setImage()
-*/
-void QGLTextureCube::clearImage(QGLTextureCube::Face face)
-{
- Q_D(QGLTextureCube);
- if (face == 0)
- d->image = QImage();
- else
- d->otherImages[face - 1] = QImage();
-}
-
-/*!
- Copies the contents of \a image to \a offset in this texture
- within the current GL context. The \a face parameter indicates
- which face of the cube map should be altered.
-
- Unlike setImage(), this function copies the image data to the
- GL server immediately using \c{glTexSubImage2D()}. This is typically
- used to update the contents of a texture after it has been created.
-
- It is assumed that the application has already called bind() on
- this texture to bind it to the current GL context.
-
- If the texture has been created in multiple contexts, only the
- texture identifier for the current context will be updated.
-
- \sa setImage(), bind()
-*/
-void QGLTextureCube::copyImage
- (QGLTextureCube::Face face, const QImage& image, const QPoint& offset)
-{
- if (uint(face) >= 6)
- return; // Invalid face number.
- QImage img = QGLWidget::convertToGLFormat(image);
- glTexSubImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + int(face),
- 0, offset.x(), offset.y(),
- img.width(), img.height(), GL_RGBA,
- GL_UNSIGNED_BYTE, img.bits());
-#if defined(QT_OPENGL_ES_2)
- Q_D(QGLTextureCube);
- if (d->bindOptions & QGLContext::MipmapBindOption)
- glGenerateMipmap(GL_TEXTURE_CUBE_MAP);
-#endif
-}
-
-/*!
- Returns the options to use when binding the image() to an OpenGL
- context for the first time. The default options are
- QGLContext::LinearFilteringBindOption |
- QGLContext::InvertedYBindOption | QGLContext::MipmapBindOption.
-
- \sa setBindOptions()
-*/
-QGLContext::BindOptions QGLTextureCube::bindOptions() const
-{
- Q_D(const QGLTextureCube);
- return d->bindOptions;
-}
-
-/*!
- Sets the \a options to use when binding the image() to an
- OpenGL context. If the image() has already been bound,
- then changing the options will cause it to be recreated
- from image() the next time bind() is called.
-
- \sa bindOptions(), bind()
-*/
-void QGLTextureCube::setBindOptions(QGLContext::BindOptions options)
-{
- Q_D(QGLTextureCube);
- if (d->bindOptions != options) {
- d->bindOptions = options;
- ++(d->imageGeneration);
- }
-}
-
-/*!
- Returns the wrapping mode for horizontal texture co-ordinates.
- The default value is QGL::Repeat.
-
- \sa setHorizontalWrap(), verticalWrap()
-*/
-QGL::TextureWrap QGLTextureCube::horizontalWrap() const
-{
- Q_D(const QGLTextureCube);
- return d->horizontalWrap;
-}
-
-/*!
- Sets the wrapping mode for horizontal texture co-ordinates to \a value.
-
- If \a value is not supported by the OpenGL implementation, it will be
- replaced with a value that is supported. If the application desires a
- very specific \a value, it can call horizontalWrap() to check that
- the specific value was actually set.
-
- The \a value will not be applied to the texture in the GL
- server until the next call to bind().
-
- \sa horizontalWrap(), setVerticalWrap()
-*/
-void QGLTextureCube::setHorizontalWrap(QGL::TextureWrap value)
-{
- Q_D(QGLTextureCube);
- value = qt_gl_modify_texture_wrap(value);
- if (d->horizontalWrap != value) {
- d->horizontalWrap = value;
- ++(d->parameterGeneration);
- }
-}
-
-/*!
- Returns the wrapping mode for vertical texture co-ordinates.
- The default value is QGL::Repeat.
-
- \sa setVerticalWrap(), horizontalWrap()
-*/
-QGL::TextureWrap QGLTextureCube::verticalWrap() const
-{
- Q_D(const QGLTextureCube);
- return d->verticalWrap;
-}
-
-/*!
- Sets the wrapping mode for vertical texture co-ordinates to \a value.
-
- If \a value is not supported by the OpenGL implementation, it will be
- replaced with a value that is supported. If the application desires a
- very specific \a value, it can call verticalWrap() to check that
- the specific value was actually set.
-
- The \a value will not be applied to the texture in the GL
- server until the next call to bind().
-
- \sa verticalWrap(), setHorizontalWrap()
-*/
-void QGLTextureCube::setVerticalWrap(QGL::TextureWrap value)
-{
- Q_D(QGLTextureCube);
- value = qt_gl_modify_texture_wrap(value);
- if (d->verticalWrap != value) {
- d->verticalWrap = value;
- ++(d->parameterGeneration);
- }
-}
-
-/*!
- Binds this texture to the cube map texture target.
-
- If this texture object is not associated with an identifier in
- the current context, then a new identifier will be created,
- and the face images will be uploaded into the GL server.
-
- If setImage() or setSize() was called since the last upload,
- then the face images will be re-uploaded to the GL server.
-
- Returns false if the texture could not be bound for some reason.
-
- \sa release(), textureId(), setImage()
-*/
-bool QGLTextureCube::bind() const
-{
- Q_D(const QGLTextureCube);
- return const_cast<QGLTextureCubePrivate *>(d)->bind(GL_TEXTURE_CUBE_MAP);
-}
-
-/*!
- Releases the texture associated with the cube map texture target.
- This is equivalent to \c{glBindTexture(GL_TEXTURE_CUBE_MAP, 0)}.
-
- \sa bind()
-*/
-void QGLTextureCube::release()
-{
- glBindTexture(GL_TEXTURE_CUBE_MAP, 0);
-}
-
-/*!
- Returns the identifier associated with this texture object in
- the current context.
-
- Returns zero if the texture has not previously been bound to
- the 2D texture target in the current context with bind().
-
- \sa bind()
-*/
-GLuint QGLTextureCube::textureId() const
-{
- Q_D(const QGLTextureCube);
- const QGLContext *ctx = QGLContext::currentContext();
- if (!ctx)
- return 0;
- QGLTexture2DTextureInfo *info = d->infos;
- while (info != 0 && info->tex.context() != ctx)
- info = info->next;
- return info ? info->tex.textureId() : 0;
-}
-
-/*!
- Constructs a QGLTextureCube object that wraps the supplied literal
- texture identifier \a id, with the dimensions specified by \a size.
-
- The \a id is assumed to have been created by the application in
- the current GL context, and it will be destroyed by the application
- after the returned QGLTextureCube object is destroyed.
-
- This function is intended for interfacing to existing code that
- uses raw GL texture identifiers. The returned QGLTextureCube can
- only be used with the current GL context.
-
- \sa textureId()
-*/
-QGLTextureCube *QGLTextureCube::fromTextureId(GLuint id, const QSize& size)
-{
- const QGLContext *ctx = QGLContext::currentContext();
- if (!id || !ctx)
- return 0;
-
- QGLTextureCube *texture = new QGLTextureCube();
- if (!size.isNull())
- texture->setSize(size);
- QGLTexture2DTextureInfo *info = new QGLTexture2DTextureInfo
- (ctx, id, texture->d_ptr->imageGeneration,
- texture->d_ptr->parameterGeneration, true);
- texture->d_ptr->infos = info;
- return texture;
-}
-
-QT_END_NAMESPACE
diff --git a/src/threed/textures/qgltexturecube.h b/src/threed/textures/qgltexturecube.h
deleted file mode 100644
index 24f397b4..00000000
--- a/src/threed/textures/qgltexturecube.h
+++ /dev/null
@@ -1,112 +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 QGLTEXTURECUBEMAP_H
-#define QGLTEXTURECUBEMAP_H
-
-#include "qglnamespace.h"
-#include <QtOpenGL/qgl.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class QGLTextureCubePrivate;
-
-class Q_QT3D_EXPORT QGLTextureCube
-{
-public:
- QGLTextureCube();
- ~QGLTextureCube();
-
- enum Face
- {
- PositiveX,
- NegativeX,
- PositiveY,
- NegativeY,
- PositiveZ,
- NegativeZ
- };
-
- bool isNull() const;
- bool hasAlphaChannel() const;
-
- QSize size() const;
- void setSize(const QSize& value);
- QSize requestedSize() const;
-
- QImage image(QGLTextureCube::Face face) const;
- void setImage(QGLTextureCube::Face face, const QImage& image);
- void clearImage(QGLTextureCube::Face face);
-
- void copyImage(QGLTextureCube::Face face, const QImage& image, const QPoint& offset = QPoint(0, 0));
-
- QGLContext::BindOptions bindOptions() const;
- void setBindOptions(QGLContext::BindOptions options);
-
- QGL::TextureWrap horizontalWrap() const;
- void setHorizontalWrap(QGL::TextureWrap value);
-
- QGL::TextureWrap verticalWrap() const;
- void setVerticalWrap(QGL::TextureWrap value);
-
- bool bind() const;
- static void release();
-
- GLuint textureId() const;
-
- static QGLTextureCube *fromTextureId(GLuint id, const QSize& size);
-
-private:
- QScopedPointer<QGLTextureCubePrivate> d_ptr;
-
- Q_DISABLE_COPY(QGLTextureCube)
- Q_DECLARE_PRIVATE(QGLTextureCube)
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/textures/qgltextureutils.cpp b/src/threed/textures/qgltextureutils.cpp
deleted file mode 100644
index acdf7a9d..00000000
--- a/src/threed/textures/qgltextureutils.cpp
+++ /dev/null
@@ -1,785 +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 "qgltextureutils_p.h"
-#include "qglext_p.h"
-#include <QtCore/qfile.h>
-
-QT_BEGIN_NAMESPACE
-
-QGL::TextureWrap qt_gl_modify_texture_wrap(QGL::TextureWrap value)
-{
- switch (value) {
-#if defined(QT_OPENGL_ES)
- case QGL::Clamp:
- value = QGL::ClampToEdge;
- break;
-#endif
-#if !defined(QT_OPENGL_ES)
- case QGL::ClampToBorder:
- if ((QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_Version_1_3)
- == 0)
- value = QGL::Clamp;
- break;
-#else
- case QGL::ClampToBorder:
- value = QGL::ClampToEdge;
- break;
-#endif
-#if !defined(QT_OPENGL_ES)
- case QGL::ClampToEdge:
- if ((QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_Version_1_2)
- == 0)
- value = QGL::Clamp;
- break;
-#endif
-#if !defined(QT_OPENGL_ES)
- case QGL::MirroredRepeat:
- if ((QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_Version_1_4)
- == 0)
- value = QGL::Repeat;
- break;
-#elif !defined(QT_OPENGL_ES_2)
- case QGL::MirroredRepeat:
- value = QGL::Repeat;
- break;
-#endif
- default: break;
- }
- return value;
-}
-
-QGLTextureExtensions::QGLTextureExtensions(const QGLContext *ctx)
- : npotTextures(false)
- , generateMipmap(false)
- , bgraTextureFormat(false)
- , ddsTextureCompression(false)
- , etc1TextureCompression(false)
- , pvrtcTextureCompression(false)
- , compressedTexImage2D(0)
-{
- Q_UNUSED(ctx);
- QGLExtensionChecker extensions(reinterpret_cast<const char *>(glGetString(GL_EXTENSIONS)));
- if (extensions.match("GL_ARB_texture_non_power_of_two"))
- npotTextures = true;
- if (extensions.match("GL_SGIS_generate_mipmap"))
- generateMipmap = true;
- if (extensions.match("GL_EXT_bgra"))
- bgraTextureFormat = true;
- if (extensions.match("GL_EXT_texture_compression_s3tc"))
- ddsTextureCompression = true;
- if (extensions.match("GL_OES_compressed_ETC1_RGB8_texture"))
- etc1TextureCompression = true;
- if (extensions.match("GL_IMG_texture_compression_pvrtc"))
- pvrtcTextureCompression = true;
-#if defined(QT_OPENGL_ES_2)
- npotTextures = true;
- generateMipmap = true;
-#endif
-#if !defined(QT_OPENGL_ES)
- if (extensions.match("GL_ARB_texture_compression")) {
- compressedTexImage2D = (q_glCompressedTexImage2DARB)
- ctx->getProcAddress(QLatin1String("glCompressedTexImage2DARB"));
- }
-#else
- compressedTexImage2D = glCompressedTexImage2D;
-#endif
-}
-
-QGLTextureExtensions::~QGLTextureExtensions()
-{
-}
-
-Q_GLOBAL_STATIC(QGLResource<QGLTextureExtensions>, qt_gl_texture_extensions)
-
-QGLTextureExtensions *QGLTextureExtensions::extensions()
-{
- const QGLContext *ctx = QGLContext::currentContext();
- if (!ctx)
- return 0;
- return qt_gl_texture_extensions()->value(ctx);
-}
-
-static void qt_gl_destroyTextureId(GLuint id)
-{
- glDeleteTextures(1, &id);
-}
-
-QGLBoundTexture::QGLBoundTexture()
- : m_resource(qt_gl_destroyTextureId)
- , m_options(QGLContext::DefaultBindOption)
- , m_hasAlpha(false)
-{
-}
-
-QGLBoundTexture::~QGLBoundTexture()
-{
-}
-
-// #define QGL_BIND_TEXTURE_DEBUG
-
-void QGLBoundTexture::startUpload(const QGLContext *ctx, GLenum target, const QSize &imageSize)
-{
- Q_UNUSED(imageSize);
-
- QGLTextureExtensions *extensions = QGLTextureExtensions::extensions();
- if (!extensions)
- return;
-
-#ifdef QGL_BIND_TEXTURE_DEBUG
- printf("QGLBoundTexture::startUpload(), imageSize=(%d,%d), options=%x\n",
- imageSize.width(), imageSize.height(), int(m_options));
- time.start();
-#endif
-
-#ifndef QT_NO_DEBUG
- // Reset the gl error stack...
- while (glGetError() != GL_NO_ERROR) ;
-#endif
-
- // Create the texture id for the target, which should be one of
- // GL_TEXTURE_2D or GL_TEXTURE_CUBE_MAP.
- GLuint id = m_resource.id();
- if (id) {
- glBindTexture(target, 0); // Just in case texture is bound.
- m_resource.destroy();
- }
- id = 0;
- glGenTextures(1, &id);
- glBindTexture(target, id);
- m_resource.attach(ctx, id);
-
- GLuint filtering = m_options & QGLContext::LinearFilteringBindOption ? GL_LINEAR : GL_NEAREST;
-
-#ifdef QGL_BIND_TEXTURE_DEBUG
- printf(" - setting options (%d ms)\n", time.elapsed());
-#endif
- q_glTexParameteri(target, GL_TEXTURE_MAG_FILTER, filtering);
-
- if (QGLContext::currentContext()->format().directRendering()
- && extensions->generateMipmap
- && (m_options & QGLContext::MipmapBindOption))
- {
-#if !defined(QT_OPENGL_ES_2)
- glHint(GL_GENERATE_MIPMAP_HINT_SGIS, GL_NICEST);
- q_glTexParameteri(target, GL_GENERATE_MIPMAP_SGIS, GL_TRUE);
-#else
- glHint(GL_GENERATE_MIPMAP_HINT, GL_NICEST);
-#endif
- q_glTexParameteri(target, GL_TEXTURE_MIN_FILTER,
- m_options & QGLContext::LinearFilteringBindOption
- ? GL_LINEAR_MIPMAP_LINEAR : GL_NEAREST_MIPMAP_NEAREST);
- } else {
- q_glTexParameteri(target, GL_TEXTURE_MIN_FILTER, filtering);
- m_options &= ~QGLContext::MipmapBindOption;
- }
-}
-
-// map from Qt's ARGB endianness-dependent format to GL's big-endian RGBA layout
-static inline void qt_gl_byteSwapImage(QImage &img, GLenum pixel_type)
-{
- const int width = img.width();
- const int height = img.height();
-
- if (pixel_type == GL_UNSIGNED_INT_8_8_8_8_REV
- || (pixel_type == GL_UNSIGNED_BYTE && QSysInfo::ByteOrder == QSysInfo::LittleEndian))
- {
- for (int i = 0; i < height; ++i) {
- uint *p = (uint *) img.scanLine(i);
- for (int x = 0; x < width; ++x)
- p[x] = ((p[x] << 16) & 0xff0000) | ((p[x] >> 16) & 0xff) | (p[x] & 0xff00ff00);
- }
- } else {
- for (int i = 0; i < height; ++i) {
- uint *p = (uint *) img.scanLine(i);
- for (int x = 0; x < width; ++x)
- p[x] = (p[x] << 8) | ((p[x] >> 24) & 0xff);
- }
- }
-}
-
-// #define QGL_BIND_TEXTURE_DEBUG
-
-void QGLBoundTexture::uploadFace
- (GLenum target, const QImage &image, const QSize &scaleSize, GLenum format)
-{
- GLenum internalFormat(format);
-
- // Resolve the texture-related extensions for the current context.
- QGLTextureExtensions *extensions = QGLTextureExtensions::extensions();
- if (!extensions)
- return;
-
- // Adjust the image size for scaling and power of two.
- QSize size = (!scaleSize.isEmpty() ? scaleSize : image.size());
- if (!extensions->npotTextures)
- size = QGL::nextPowerOfTwo(size);
- QImage img(image);
- if (size != image.size()) {
-#ifdef QGL_BIND_TEXTURE_DEBUG
- printf(" - scaling up to %dx%d (%d ms) \n", size.width(), size.height(), time.elapsed());
-#endif
- img = img.scaled(size);
- }
- m_size = size;
-
- QImage::Format target_format = img.format();
- bool premul = m_options & QGLContext::PremultipliedAlphaBindOption;
- GLenum externalFormat;
- GLuint pixel_type;
- if (extensions->bgraTextureFormat) {
- externalFormat = GL_BGRA;
- if (QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_Version_1_2)
- pixel_type = GL_UNSIGNED_INT_8_8_8_8_REV;
- else
- pixel_type = GL_UNSIGNED_BYTE;
- } else {
- externalFormat = GL_RGBA;
- pixel_type = GL_UNSIGNED_BYTE;
- }
-
- switch (target_format) {
- case QImage::Format_ARGB32:
- if (premul) {
- img = img.convertToFormat(target_format = QImage::Format_ARGB32_Premultiplied);
-#ifdef QGL_BIND_TEXTURE_DEBUG
- printf(" - converting ARGB32 -> ARGB32_Premultiplied (%d ms) \n", time.elapsed());
-#endif
- }
- break;
- case QImage::Format_ARGB32_Premultiplied:
- if (!premul) {
- img = img.convertToFormat(target_format = QImage::Format_ARGB32);
-#ifdef QGL_BIND_TEXTURE_DEBUG
- printf(" - converting ARGB32_Premultiplied -> ARGB32 (%d ms)\n", time.elapsed());
-#endif
- }
- break;
- case QImage::Format_RGB16:
- pixel_type = GL_UNSIGNED_SHORT_5_6_5;
- externalFormat = GL_RGB;
- internalFormat = GL_RGB;
- break;
- case QImage::Format_RGB32:
- break;
- default:
- if (img.hasAlphaChannel()) {
- img = img.convertToFormat(premul
- ? QImage::Format_ARGB32_Premultiplied
- : QImage::Format_ARGB32);
-#ifdef QGL_BIND_TEXTURE_DEBUG
- printf(" - converting to 32-bit alpha format (%d ms)\n", time.elapsed());
-#endif
- } else {
- img = img.convertToFormat(QImage::Format_RGB32);
-#ifdef QGL_BIND_TEXTURE_DEBUG
- printf(" - converting to 32-bit (%d ms)\n", time.elapsed());
-#endif
- }
- }
-
- if (m_options & QGLContext::InvertedYBindOption) {
-#ifdef QGL_BIND_TEXTURE_DEBUG
- printf(" - flipping bits over y (%d ms)\n", time.elapsed());
-#endif
- if (img.isDetached()) {
- int ipl = img.bytesPerLine() / 4;
- int h = img.height();
- for (int y=0; y<h/2; ++y) {
- int *a = (int *) img.scanLine(y);
- int *b = (int *) img.scanLine(h - y - 1);
- for (int x=0; x<ipl; ++x)
- qSwap(a[x], b[x]);
- }
- } else {
- // Create a new image and copy across. If we use the
- // above in-place code then a full copy of the image is
- // made before the lines are swapped, which processes the
- // data twice. This version should only do it once.
- img = img.mirrored();
- }
- }
-
- if (externalFormat == GL_RGBA) {
-#ifdef QGL_BIND_TEXTURE_DEBUG
- printf(" - doing byte swapping (%d ms)\n", time.elapsed());
-#endif
- // The only case where we end up with a depth different from
- // 32 in the switch above is for the RGB16 case, where we set
- // the format to GL_RGB
- Q_ASSERT(img.depth() == 32);
- qt_gl_byteSwapImage(img, pixel_type);
- }
-#ifdef QT_OPENGL_ES
- // OpenGL/ES requires that the internal and external formats be
- // identical.
- internalFormat = externalFormat;
-#endif
-#ifdef QGL_BIND_TEXTURE_DEBUG
- printf(" - uploading, image.format=%d, externalFormat=0x%x, internalFormat=0x%x, pixel_type=0x%x\n",
- img.format(), externalFormat, internalFormat, pixel_type);
-#endif
-
- const QImage &constRef = img; // to avoid detach in bits()...
- glTexImage2D(target, 0, internalFormat, img.width(), img.height(), 0, externalFormat,
- pixel_type, constRef.bits());
-
- m_hasAlpha = (internalFormat != GL_RGB);
-}
-
-void QGLBoundTexture::createFace
- (GLenum target, const QSize &size, GLenum format)
-{
- glTexImage2D(target, 0, format, size.width(),
- size.height(), 0, format, GL_UNSIGNED_BYTE, 0);
- m_hasAlpha = (format != GL_RGB);
-}
-
-void QGLBoundTexture::finishUpload(GLenum target)
-{
- Q_UNUSED(target);
-
-#if defined(QT_OPENGL_ES_2)
- // OpenGL/ES 2.0 needs to generate mipmaps after all cubemap faces
- // have been uploaded.
- if (m_options & QGLContext::MipmapBindOption) {
-#ifdef QGL_BIND_TEXTURE_DEBUG
- printf(" - generating mipmaps (%d ms)\n", time.elapsed());
-#endif
- glGenerateMipmap(target);
- }
-#endif
-
-#ifndef QT_NO_DEBUG
- GLenum error = glGetError();
- if (error != GL_NO_ERROR) {
- qWarning(" - texture upload failed, error code 0x%x, enum: %d (%x)\n", error, target, target);
- }
-#endif
-
-#ifdef QGL_BIND_TEXTURE_DEBUG
- static int totalUploadTime = 0;
- totalUploadTime += time.elapsed();
- printf(" - upload done in (%d ms) time=%d\n", time.elapsed(), totalUploadTime);
-#endif
-}
-
-// DDS format structure
-struct DDSFormat {
- quint32 dwSize;
- quint32 dwFlags;
- quint32 dwHeight;
- quint32 dwWidth;
- quint32 dwLinearSize;
- quint32 dummy1;
- quint32 dwMipMapCount;
- quint32 dummy2[11];
- struct {
- quint32 dummy3[2];
- quint32 dwFourCC;
- quint32 dummy4[5];
- } ddsPixelFormat;
-};
-
-// compressed texture pixel formats
-#define FOURCC_DXT1 0x31545844
-#define FOURCC_DXT2 0x32545844
-#define FOURCC_DXT3 0x33545844
-#define FOURCC_DXT4 0x34545844
-#define FOURCC_DXT5 0x35545844
-
-#ifndef GL_COMPRESSED_RGB_S3TC_DXT1_EXT
-#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
-#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
-#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2
-#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3
-#endif
-
-// PVR header format for container files that store textures compressed
-// with the ETC1, PVRTC2, and PVRTC4 encodings. Format information from the
-// PowerVR SDK at http://www.imgtec.com/powervr/insider/powervr-sdk.asp
-// "PVRTexTool Reference Manual, version 1.11f".
-struct PvrHeader
-{
- quint32 headerSize;
- quint32 height;
- quint32 width;
- quint32 mipMapCount;
- quint32 flags;
- quint32 dataSize;
- quint32 bitsPerPixel;
- quint32 redMask;
- quint32 greenMask;
- quint32 blueMask;
- quint32 alphaMask;
- quint32 magic;
- quint32 surfaceCount;
-};
-
-#define PVR_MAGIC 0x21525650 // "PVR!" in little-endian
-
-#define PVR_FORMAT_MASK 0x000000FF
-#define PVR_FORMAT_PVRTC2 0x00000018
-#define PVR_FORMAT_PVRTC4 0x00000019
-#define PVR_FORMAT_ETC1 0x00000036
-
-#define PVR_HAS_MIPMAPS 0x00000100
-#define PVR_TWIDDLED 0x00000200
-#define PVR_NORMAL_MAP 0x00000400
-#define PVR_BORDER_ADDED 0x00000800
-#define PVR_CUBE_MAP 0x00001000
-#define PVR_FALSE_COLOR_MIPMAPS 0x00002000
-#define PVR_VOLUME_TEXTURE 0x00004000
-#define PVR_ALPHA_IN_TEXTURE 0x00008000
-#define PVR_VERTICAL_FLIP 0x00010000
-
-#ifndef GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG
-#define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00
-#define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG 0x8C01
-#define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02
-#define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03
-#endif
-
-#ifndef GL_ETC1_RGB8_OES
-#define GL_ETC1_RGB8_OES 0x8D64
-#endif
-
-bool QGLBoundTexture::canBindCompressedTexture
- (const char *buf, int len, const char *format, bool *hasAlpha,
- bool *isFlipped)
-{
- if (QSysInfo::ByteOrder != QSysInfo::LittleEndian) {
- // Compressed texture loading only supported on little-endian
- // systems such as x86 and ARM at the moment.
- return false;
- }
- if (!format) {
- // Auto-detect the format from the header.
- if (len >= 4 && !qstrncmp(buf, "DDS ", 4)) {
- *hasAlpha = true;
- *isFlipped = true;
- return true;
- } else if (len >= 52 && !qstrncmp(buf + 44, "PVR!", 4)) {
- const PvrHeader *pvrHeader =
- reinterpret_cast<const PvrHeader *>(buf);
- *hasAlpha = (pvrHeader->alphaMask != 0);
- *isFlipped = ((pvrHeader->flags & PVR_VERTICAL_FLIP) != 0);
- return true;
- }
- } else {
- // Validate the format against the header.
- if (!qstricmp(format, "DDS")) {
- if (len >= 4 && !qstrncmp(buf, "DDS ", 4)) {
- *hasAlpha = true;
- *isFlipped = true;
- return true;
- }
- } else if (!qstricmp(format, "PVR") || !qstricmp(format, "ETC1")) {
- if (len >= 52 && !qstrncmp(buf + 44, "PVR!", 4)) {
- const PvrHeader *pvrHeader =
- reinterpret_cast<const PvrHeader *>(buf);
- *hasAlpha = (pvrHeader->alphaMask != 0);
- *isFlipped = ((pvrHeader->flags & PVR_VERTICAL_FLIP) != 0);
- return true;
- }
- }
- }
- return false;
-}
-
-bool QGLBoundTexture::bindCompressedTexture
- (const char *buf, int len, const char *format)
-{
- if (QSysInfo::ByteOrder != QSysInfo::LittleEndian) {
- // Compressed texture loading only supported on little-endian
- // systems such as x86 and ARM at the moment.
- return false;
- }
-#if !defined(QT_OPENGL_ES)
- QGLTextureExtensions *extensions = QGLTextureExtensions::extensions();
- if (!extensions)
- return false;
- if (!extensions->compressedTexImage2D) {
- qWarning("QGLContext::bindTexture(): The GL implementation does "
- "not support texture compression extensions.");
- return false;
- }
-#endif
- if (!format) {
- // Auto-detect the format from the header.
- if (len >= 4 && !qstrncmp(buf, "DDS ", 4))
- return bindCompressedTextureDDS(buf, len);
- else if (len >= 52 && !qstrncmp(buf + 44, "PVR!", 4))
- return bindCompressedTexturePVR(buf, len);
- } else {
- // Validate the format against the header.
- if (!qstricmp(format, "DDS")) {
- if (len >= 4 && !qstrncmp(buf, "DDS ", 4))
- return bindCompressedTextureDDS(buf, len);
- } else if (!qstricmp(format, "PVR") || !qstricmp(format, "ETC1")) {
- if (len >= 52 && !qstrncmp(buf + 44, "PVR!", 4))
- return bindCompressedTexturePVR(buf, len);
- }
- }
- return false;
-}
-
-bool QGLBoundTexture::bindCompressedTexture
- (const QString& fileName, const char *format)
-{
- QFile file(fileName);
- if (!file.open(QIODevice::ReadOnly))
- return false;
- QByteArray contents = file.readAll();
- file.close();
- return bindCompressedTexture
- (contents.constData(), contents.size(), format);
-}
-
-bool QGLBoundTexture::bindCompressedTextureDDS(const char *buf, int len)
-{
- QGLTextureExtensions *extensions = QGLTextureExtensions::extensions();
- if (!extensions)
- return false;
-
- // Bail out if the necessary extension is not present.
- if (!extensions->ddsTextureCompression) {
- qWarning("QGLBoundTexture::bindCompressedTextureDDS(): DDS texture compression is not supported.");
- return false;
- }
-
- const DDSFormat *ddsHeader = reinterpret_cast<const DDSFormat *>(buf + 4);
- if (!ddsHeader->dwLinearSize) {
- qWarning("QGLBoundTexture::bindCompressedTextureDDS(): DDS image size is not valid.");
- return false;
- }
-
- int blockSize = 16;
- GLenum format;
-
- switch(ddsHeader->ddsPixelFormat.dwFourCC) {
- case FOURCC_DXT1:
- format = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT;
- blockSize = 8;
- break;
- case FOURCC_DXT3:
- format = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT;
- break;
- case FOURCC_DXT5:
- format = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT;
- break;
- default:
- qWarning("QGLBoundTexture::bindCompressedTextureDDS(): DDS image format not supported.");
- return false;
- }
-
- const GLubyte *pixels =
- reinterpret_cast<const GLubyte *>(buf + ddsHeader->dwSize + 4);
-
- GLuint id = m_resource.id();
- if (id) {
- glBindTexture(GL_TEXTURE_2D, 0); // Just in case it is bound.
- m_resource.destroy();
- }
- id = 0;
- glGenTextures(1, &id);
- glBindTexture(GL_TEXTURE_2D, id);
- q_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- q_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- m_resource.attach(QGLContext::currentContext(), id);
-
- int size;
- int offset = 0;
- int available = len - int(ddsHeader->dwSize + 4);
- int w = ddsHeader->dwWidth;
- int h = ddsHeader->dwHeight;
-
- // load mip-maps
- for (int i = 0; i < (int) ddsHeader->dwMipMapCount; ++i) {
- if (w == 0) w = 1;
- if (h == 0) h = 1;
-
- size = ((w+3)/4) * ((h+3)/4) * blockSize;
- if (size > available)
- break;
- extensions->compressedTexImage2D
- (GL_TEXTURE_2D, i, format, w, h, 0, size, pixels + offset);
- offset += size;
- available -= size;
-
- // half size for each mip-map level
- w = w/2;
- h = h/2;
- }
-
- // DDS images are not inverted.
- m_options &= ~QGLContext::InvertedYBindOption;
-
- m_size = QSize(ddsHeader->dwWidth, ddsHeader->dwHeight);
- m_hasAlpha = false;
- return true;
-}
-
-bool QGLBoundTexture::bindCompressedTexturePVR(const char *buf, int len)
-{
- QGLTextureExtensions *extensions = QGLTextureExtensions::extensions();
- if (!extensions)
- return false;
-
- // Determine which texture format we will be loading.
- const PvrHeader *pvrHeader = reinterpret_cast<const PvrHeader *>(buf);
- GLenum textureFormat;
- quint32 minWidth, minHeight;
- switch (pvrHeader->flags & PVR_FORMAT_MASK) {
- case PVR_FORMAT_PVRTC2:
- if (pvrHeader->alphaMask)
- textureFormat = GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;
- else
- textureFormat = GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
- minWidth = 16;
- minHeight = 8;
- break;
-
- case PVR_FORMAT_PVRTC4:
- if (pvrHeader->alphaMask)
- textureFormat = GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
- else
- textureFormat = GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
- minWidth = 8;
- minHeight = 8;
- break;
-
- case PVR_FORMAT_ETC1:
- textureFormat = GL_ETC1_RGB8_OES;
- minWidth = 4;
- minHeight = 4;
- break;
-
- default:
- qWarning("QGLBoundTexture::bindCompressedTexturePVR(): PVR image format 0x%x not supported.", int(pvrHeader->flags & PVR_FORMAT_MASK));
- return false;
- }
-
- // Bail out if the necessary extension is not present.
- if (textureFormat == GL_ETC1_RGB8_OES) {
- if (!extensions->etc1TextureCompression) {
- qWarning("QGLBoundTexture::bindCompressedTexturePVR(): ETC1 texture compression is not supported.");
- return false;
- }
- } else {
- if (!extensions->pvrtcTextureCompression) {
- qWarning("QGLBoundTexture::bindCompressedTexturePVR(): PVRTC texture compression is not supported.");
- return false;
- }
- }
-
- // Boundary check on the buffer size.
- quint32 bufferSize = pvrHeader->headerSize + pvrHeader->dataSize;
- if (bufferSize > quint32(len)) {
- qWarning("QGLBoundTexture::bindCompressedTexturePVR(): PVR image size is not valid.");
- return false;
- }
-
- // Create the texture.
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
- GLuint id = m_resource.id();
- if (id) {
- glBindTexture(GL_TEXTURE_2D, 0); // Just in case it is bound.
- m_resource.destroy();
- }
- id = 0;
- glGenTextures(1, &id);
- glBindTexture(GL_TEXTURE_2D, id);
- m_resource.attach(QGLContext::currentContext(), id);
- if (pvrHeader->mipMapCount) {
- if ((m_options & QGLContext::LinearFilteringBindOption) != 0) {
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
- } else {
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST);
- }
- } else if ((m_options & QGLContext::LinearFilteringBindOption) != 0) {
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- } else {
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- }
-
- // Load the compressed mipmap levels.
- const GLubyte *buffer =
- reinterpret_cast<const GLubyte *>(buf + pvrHeader->headerSize);
- bufferSize = pvrHeader->dataSize;
- quint32 level = 0;
- quint32 width = pvrHeader->width;
- quint32 height = pvrHeader->height;
- while (bufferSize > 0 && level <= pvrHeader->mipMapCount) {
- quint32 size =
- (qMax(width, minWidth) * qMax(height, minHeight) *
- pvrHeader->bitsPerPixel) / 8;
- if (size > bufferSize)
- break;
- extensions->compressedTexImage2D
- (GL_TEXTURE_2D, GLint(level), textureFormat,
- GLsizei(width), GLsizei(height), 0, GLsizei(size), buffer);
- width /= 2;
- height /= 2;
- buffer += size;
- ++level;
- }
-
- // Restore the default pixel alignment for later texture uploads.
- glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
-
- // Set the invert flag for the texture. The "vertical flip"
- // flag in PVR is the opposite sense to our sense of inversion.
- if ((pvrHeader->flags & PVR_VERTICAL_FLIP) != 0)
- m_options &= ~QGLContext::InvertedYBindOption;
- else
- m_options |= QGLContext::InvertedYBindOption;
-
- m_size = QSize(pvrHeader->width, pvrHeader->height);
- m_hasAlpha = (pvrHeader->alphaMask != 0);
- return true;
-}
-
-QT_END_NAMESPACE
diff --git a/src/threed/textures/qgltextureutils_p.h b/src/threed/textures/qgltextureutils_p.h
deleted file mode 100644
index 2cff59d3..00000000
--- a/src/threed/textures/qgltextureutils_p.h
+++ /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$
-**
-****************************************************************************/
-
-#ifndef QGLTEXTUREUTILS_P_H
-#define QGLTEXTUREUTILS_P_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 <QtOpenGL/qgl.h>
-#include <QtCore/qdatetime.h>
-#include "qglnamespace.h"
-#include "qopenglfunctions.h"
-#include "qglsharedresource_p.h"
-
-QT_BEGIN_NAMESPACE
-
-#ifndef GL_BGRA
-#define GL_BGRA 0x80E1
-#endif
-#ifndef GL_UNSIGNED_SHORT_5_6_5
-#define GL_UNSIGNED_SHORT_5_6_5 0x8363
-#endif
-#ifndef GL_UNSIGNED_INT_8_8_8_8_REV
-#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367
-#endif
-#ifndef GL_TEXTURE_CUBE_MAP
-#define GL_TEXTURE_CUBE_MAP 0x8513
-#endif
-#ifndef GL_TEXTURE_CUBE_MAP_POSITIVE_X
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
-#endif
-#ifndef GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
-#endif
-
-#ifndef GL_GENERATE_MIPMAP_SGIS
-#define GL_GENERATE_MIPMAP_SGIS 0x8191
-#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192
-#endif
-
-#if !defined(QT_OPENGL_ES)
-#define q_glTexParameteri(target,name,value) \
- glTexParameteri((target), (name), int(value))
-#else
-#define q_glTexParameteri(target,name,value) \
- glTexParameterf((target), (name), GLfloat(int(value)))
-#endif
-
-// Modify a wrapping mode to account for platform differences.
-QGL::TextureWrap qt_gl_modify_texture_wrap(QGL::TextureWrap value);
-
-typedef void (QT3D_GLF_APIENTRYP q_glCompressedTexImage2DARB)
- (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
-
-class QGLTextureExtensions
-{
-public:
- QGLTextureExtensions(const QGLContext *ctx);
- ~QGLTextureExtensions();
-
- int npotTextures : 1;
- int generateMipmap : 1;
- int bgraTextureFormat : 1;
- int ddsTextureCompression : 1;
- int etc1TextureCompression : 1;
- int pvrtcTextureCompression : 1;
- q_glCompressedTexImage2DARB compressedTexImage2D;
-
- static QGLTextureExtensions *extensions();
-};
-
-class QGLBoundTexture
-{
-public:
- QGLBoundTexture();
- ~QGLBoundTexture();
-
- const QGLContext *context() const { return m_resource.context(); }
-
- GLuint textureId() const { return m_resource.id(); }
- void setTextureId(const QGLContext *ctx, GLuint id)
- { m_resource.attach(ctx, id); }
- void clearId() { m_resource.clearId(); }
-
- QGLContext::BindOptions options() const { return m_options; }
- void setOptions(QGLContext::BindOptions options) { m_options = options; }
-
- QSize size() const { return m_size; }
- bool hasAlpha() const { return m_hasAlpha; }
-
- void startUpload(const QGLContext *ctx, GLenum target, const QSize &imageSize);
- void uploadFace(GLenum target, const QImage &image, const QSize &scaleSize,
- GLenum format = GL_RGBA);
- void createFace(GLenum target, const QSize &size, GLenum format = GL_RGBA);
- void finishUpload(GLenum target);
-
- static bool canBindCompressedTexture
- (const char *buf, int len, const char *format, bool *hasAlpha,
- bool *isFlipped);
- bool bindCompressedTexture
- (const QString& fileName, const char *format = 0);
- bool bindCompressedTexture
- (const char *buf, int len, const char *format = 0);
- bool bindCompressedTextureDDS(const char *buf, int len);
- bool bindCompressedTexturePVR(const char *buf, int len);
-
-private:
- QGLSharedResource m_resource;
- QGLContext::BindOptions m_options;
- QSize m_size;
- bool m_hasAlpha;
- QTime time;
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/threed/textures/textures.pri b/src/threed/textures/textures.pri
deleted file mode 100644
index ce60c58e..00000000
--- a/src/threed/textures/textures.pri
+++ /dev/null
@@ -1,15 +0,0 @@
-INCLUDEPATH += $$PWD
-VPATH += $$PWD
-HEADERS += \
- textures/qgltexture2d.h \
- textures/qgltexturecube.h \
- textures/qareaallocator.h
-SOURCES += \
- qareaallocator.cpp \
- qglsharedresource.cpp \
- qgltexture2d.cpp \
- qgltexturecube.cpp \
- qgltextureutils.cpp
-PRIVATE_HEADERS += \
- qglsharedresource_p.h \
- qgltexture2d_p.h
diff --git a/src/threed/threed.pri b/src/threed/threed.pri
deleted file mode 100644
index 0c3e68cb..00000000
--- a/src/threed/threed.pri
+++ /dev/null
@@ -1,15 +0,0 @@
-include(global/global.pri)
-include(painting/painting.pri)
-include(arrays/arrays.pri)
-include(effects/effects.pri)
-include(materials/materials.pri)
-include(geometry/geometry.pri)
-include(viewing/viewing.pri)
-include(math3d/math3d.pri)
-include(scene/scene.pri)
-include(network/network.pri)
-include(graphicsview/graphicsview.pri)
-include(textures/textures.pri)
-include(surfaces/surfaces.pri)
-include(api/api.pri)
-
diff --git a/src/threed/threed.pro b/src/threed/threed.pro
deleted file mode 100644
index 9070b38d..00000000
--- a/src/threed/threed.pro
+++ /dev/null
@@ -1,95 +0,0 @@
-TEMPLATE = lib
-TARGET = Qt3D$${QT_LIBINFIX}
-gcov {
- CONFIG += staticlib warn_on
- QMAKE_CXXFLAGS += -fprofile-arcs -ftest-coverage
- QMAKE_LFLAGS += -fprofile-arcs -ftest-coverage
-} else {
- CONFIG += dll warn_on
-}
-QT += opengl \
- network
-
-include(../../pkg.pri)
-
-package {
- win32 {
- target.path = $$QT3D_INSTALL_BINS
- } else {
- target.path = $$QT3D_INSTALL_LIBS
- }
- INSTALLS += target
-} else {
- DESTDIR = $$QT3D_INSTALL_LIBS
-}
-
-win32 {
- !static:DEFINES += QT_MAKEDLL
- package {
- installDll.path = $$QT3D_INSTALL_BINS
- installDll.files = $$DESTDIR_TARGET
- INSTALLS += installDll
- } else {
- DLLDESTDIR = $$QT3D_INSTALL_BINS
- }
- CONFIG(debug, debug|release) {
- TARGET = $$member(TARGET, 0)d
- }
-}
-
-symbian {
- DEFINES += QT_MAKEDLL
- CONFIG += epocallowdlldata
- MMP_RULES += EXPORTUNFROZEN
- TARGET.CAPABILITY = All -Tcb
- TARGET.UID3 = 0x20031E95
-}
-
-include(../private/private.pri)
-include(threed.pri)
-PUBLIC_HEADERS = $$HEADERS
-HEADERS += $$PRIVATE_HEADERS
-DEFINES += QT_BUILD_QT3D_LIB
-
-!contains(QT_CONFIG, egl):DEFINES += QT_NO_EGL
-
-package {
- distInstalls.files = $$PUBLIC_HEADERS
- distInstalls.path = $$QT3D_INSTALL_HEADERS/Qt3D
- INSTALLS += distInstalls
-}
-
-# If Qt has been configured to build frameworks, then the build will put
-# the Qt3D library into a framework bundle, so put the headers in the bundle
-# as well. Other OS's, or mac without frameworks, install the headers into
-# the Qt build tree directly.
-macx:CONFIG(qt_framework, qt_framework|qt_no_framework) {
- QMAKE_LFLAGS_SONAME = -Wl,-install_name,$$DESTDIR/
- CONFIG += lib_bundle
- FRAMEWORK_HEADERS.version = Versions
- FRAMEWORK_HEADERS.path = Headers
- FRAMEWORK_HEADERS.files = $$PUBLIC_HEADERS
- QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS
-} else {
- !symbian {
- exportHeaders.input = PUBLIC_HEADERS
- # in the package case we need the headers for the actual build, the
- # distInstalls stanza above takes care of packaging the headers for the dev pkg
- package {
- exportHeaders.output = ../../include/Qt3D/${QMAKE_FILE_IN_BASE}${QMAKE_FILE_EXT}
- } else {
- !maemo: exportHeaders.output = $$[QT_INSTALL_HEADERS]/Qt3D/${QMAKE_FILE_IN_BASE}${QMAKE_FILE_EXT}
- }
- exportHeaders.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
- exportHeaders.CONFIG += no_link_no_clean
- exportHeaders.variable_out = PRE_TARGETDEPS
- QMAKE_EXTRA_COMPILERS += exportHeaders
- }
-}
-
-symbian {
- export_headers.files = $$PUBLIC_HEADERS
- for(export_header, export_headers.files) {
- BLD_INF_RULES.prj_exports += "$$export_header $$MW_LAYER_PUBLIC_EXPORT_PATH(Qt3D/$$basename(export_header))"
- }
-}
diff --git a/src/threed/viewing/qglcamera.cpp b/src/threed/viewing/qglcamera.cpp
deleted file mode 100644
index 4f236507..00000000
--- a/src/threed/viewing/qglcamera.cpp
+++ /dev/null
@@ -1,1328 +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 "qglcamera.h"
-#include "qglpainter.h"
-#include <QtGui/qquaternion.h>
-#include <QtCore/qmath.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGLCamera
- \brief The QGLCamera class defines the projection to apply to simulate a camera's position, orientation, and optics.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::viewing
-
- \section1 Modelview and projection transformations
-
- A QGLCamera instance is applied to the scene in two phases:
- modelview transformation and projection transformation.
-
- During the modelview transformation, the eye(), center(), and
- upVector() are used to generate a 4x4 transformation matrix that
- reflects the viewer's current position and orientation.
-
- During the projection transformation, the projectionType(),
- nearPlane(), farPlane(), fieldOfView(), and viewSize() are used
- to define a viewing volume as a 4x4 transformation matrix.
-
- The modelview transformation matrix is returned by modelViewMatrix().
- The projection transformation matrix is returned by projectionMatrix().
-
- \section1 Positioning and orienting the view
-
- The viewer position and orientation are defined by eye(), center(),
- and upVector(). The location of the viewer in world co-ordinates is
- given by eye(), the viewer is looking at the object of interest located
- at center(), and the upVector() specifies the direction that should
- be considered "up" with respect to the viewer.
-
- The vector from the eye() to the center() is called the "view vector",
- and the cross-product of the view vector and upVector() is called
- the "side vector". The view vector specifies the direction the
- viewer is looking, and the side vector points off to the right of
- the viewer.
-
- It is recommended that the view vector and upVector() be at right angles
- to each other, but this is not required as long as the angle between
- them is close to 90 degrees.
-
- The most common use of view and up vectors that are not at right angles
- is to simulate a human eye at a specific height above the ground looking
- down at a lower object or up at a higher object. In this case, the
- the view vector will not be true horizontal, but the upVector() indicating
- the human's upright stance will be true vertical.
-
- \section1 Zooming the camera image
-
- There are two ways to zoom the image seen through the camera: either
- the camera eye() position can be moved closer to the object of interest,
- or the field of view of the camera lens can be changed to make it appear
- as though the object is moving closer.
-
- Changing the eye() position changes the lighting calculation in the
- scene because the viewer is in a different position, changing the
- angle of light reflection on the object's surface.
-
- The setFieldOfView() function can be used to simulate the effect of a
- camera lens. The smaller the fieldOfView(), the closer the object
- will appear. The lighting calculation will be the same as for the
- unzoomed scene.
-
- If fieldOfView() is zero, then a standard perspective frustum of
- viewSize() is used to define the viewing volume. The viewSize()
- can be adjusted with setViewSize() to zoom the view. A smaller
- viewSize() will make the the object appear closer.
-
- The fieldOfView() or viewSize() is applied as part of the
- projectionMatrix().
-
- \section1 Rotating the viewer or object of interest
-
- Rotating a viewer in 3D space is a very delicate process. It is very
- easy to construct the rotation incorrectly and end up in a "gimbal lock"
- state where further rotations are impossible in certain directions.
-
- To help alleviate this problem, QGLCamera uses a quaternion-based
- approach to generate rotations. A quaternion is a compact representation
- of a rotation in 3D space. Rotations can be combined through quaternion
- multiplication. More information on quaternions can be found in the
- documentation for QQuaternion.
-
- Before rotating the view, you should first decide the type
- of rotation you want to perform:
-
- \list
- \i Tilting or panning a fixed eye to reveal the scene in different
- directions and orientations. This is equivalent to mounting a camera
- on a fixed tripod and then adjusting the direction of view and
- orientation with the tripod controls.
- \i Rotating a moving viewer about the object of interest. This is
- equivalent to moving the viewer around the object at a fixed distance,
- but with the viewer always pointing at the object.
- \endlist
-
- In the QGLCamera class, the first type of rotation is performed with
- rotateEye() and the second with rotateCenter(). Each of these functions
- take a quaternion argument that defines the type of rotation to perform.
-
- The tilt(), pan(), and roll() functions return values that can help with
- constructing the rotation quaternions to pass to rotateEye() and
- rotateCenter(). Tilt and pan are also known as "pitch" and "yaw" in
- flight dynamics.
-
- Three axes of rotation are used to compute the quaternions. The tilt()
- quaternion is computed with respect to the side vector, the pan()
- quaterion is computed with respect to the upVector(), and the roll()
- quaternion is computed with respect to the view vector.
-
- The following example tilts the direction the eye() is pointing
- by 5 degrees, and then pans by 45 degrees:
-
- \code
- camera.rotateEye(camera.tilt(5));
- camera.rotateEye(camera.pan(45));
- \endcode
-
- The next example performs the two rotations in a single fluid step
- (note that the rotation to be performed first is multiplied last):
-
- \code
- camera.rotateEye(camera.pan(45) * camera.tilt(5));
- \endcode
-
- These two examples will not produce the same visual result, even though
- it looks like they might. In the first example, the upVector() is tilted
- before the pan() quaternion is computed. In the second example, the pan()
- quaternion is computed using the original upVector().
-
- This difference in behavior is useful in different situations. Some
- applications may wish to perform all rotations relative to the original
- viewer orientation, and other applications may wish to perform rotations
- relative to the current viewer orientation. These application types
- correspond to the second and first examples above.
-
- \section1 Moving the viewer or object of interest
-
- The simplest way to move the viewer or object of interest is to call
- setEye() or setCenter() respectively and supply a new position in
- world co-ordinates. However, this can lead to non-intuitive movements
- if the viewer orientation is not aligned with the world co-ordinate axes.
-
- For example, subtracting 3 from the eye() x co-ordinate will appear to
- move the eye left 3 units if the viewer orientation is aligned with the
- world co-ordinate axes. But it will not appear to move the eye left 3
- units in any other orientation.
-
- The translation() function can be used to construct a translation
- vector that is aligned with the viewer's current orientation.
- Movement in the x direction will move along the side vector, movement in
- the y direction will move along upVector(), and movement in the z
- direction will move along the view vector.
-
- The translation() function is useful when implementing operations such
- as "step left", "jump up", and so on where the movement should be
- interpreted relative to the viewer's current orientation, not the
- world co-ordinate axes,
-
- In other words, the following two lines of code are not equivalent
- unless the view is oriented with the world co-ordinate axes:
-
- \code
- camera.translateEye(camera.translation(x, y, z));
-
- camera.translateEye(QVector3D(x, y, z));
- \endcode
-
- The following example translates the eye() position while
- keeping the object of interest at the original center():
-
- \code
- camera.translateEye(camera.translation(x, y, z));
- \endcode
-
- The following example translates the object of interest at
- center() while keeping the eye() position fixed:
-
- \code
- camera.translateCenter(camera.translation(x, y, z));
- \endcode
-
- The following example translates both the eye() and the center()
- by the same amount, which will maintain the original view vector.
-
- \code
- QVector3D vector = camera.translation(x, y, z);
- camera.translateEye(vector);
- camera.translateCenter(vector);
- \endcode
-
- It is important that the translation vector for center() be computed
- before eye() is translated if both eye() and center() must move by the
- same amount. The following code translates center() in the viewer
- orientation after the eye() is translated:
-
- \code
- camera.translateEye(camera.translation(x, y, z));
- camera.translateCenter(camera.translation(x, y, z));
- \endcode
-
- Translating both eye() and center() by the same amount can be used
- to simulate sliding a viewer past a scene while always looking in the
- same direction (for example, filming a scene from a moving vehicle).
- An alternative is to fix the viewer and move the scene itself:
- the negation of the translation() vector can be applied to the
- scene's modelview transformation.
-
- \section1 Motion tracking
-
- Viewing of 3D scenes can be enhanced if there is some way to track
- the motion of the viewer or the orientation of the display device.
-
- Applications can use setMotionAdjustment() to alter the position
- of the camera to account for the viewer's motion. This indicates
- the viewer's position relative to the center of the screen.
- The motionAdjustment() vector is used to determine by how much
- the camera position should be adjusted. The distance of the viewer
- from the screen is ignored.
-
- On handheld devices that use accelerometers to determine the
- orientation of the device, the down vector due to gravity
- can be adjusted to serve as a motion tracking vector.
-
- The output of motion tracking hardware can be very noisy,
- with minor fluctuations due to viewer twitch movements or
- environmental factors. The application is responsible for
- cleaning up the signal and removing these fluctuations before
- setMotionAdjustment() is called.
-
- \section1 Stereo projections
-
- QGLCamera can adjust the camera position for rendering separate left
- and right eye images by setting eyeSeparation() to a non-zero value.
- The eyeSeparation() is in world co-ordinates.
-
- Objects that are placed at center() will coincide in the left and
- right eye images, establishing the logical center of the stereo
- effect. Objects that are closer to the eye() will be rendered
- to appear closer in the stereo effect, and objects that are further
- away from eye() than center() will be rendered to appear further away.
-
- Perspective and Orthographic projections incorporate the
- eyeSeparation() into the modelViewMatrix() by altering the
- eye() position.
-
- \sa QGLView, QGLPainter
-*/
-
-/*!
- \qmlclass Camera QGLCamera
- \brief The Camera item defines the viewing position and projection for a 3D scene.
- \since 4.8
- \ingroup qt3d::qml3d
-
- Camera instances are defined on a \l Viewport item using the
- Viewport::camera property:
-
- \code
- import QtQuick 1.0
- import Qt3D 1.0
-
- Viewport {
- width: 640; height: 480
- camera: Camera {
- eye: Qt.vector3d(-1, 2, 10)
- }
- light: Light {}
- Item3D {
- mesh: Mesh { source: "meshes/teapot.bez" }
- effect: Effect {}
- }
- }
- \endcode
-
- \section1 Positioning and orienting the view
-
- The viewer position and orientation are defined by \l eye, \l center,
- and \l upVector. The location of the viewer in world co-ordinates is
- given by \l eye, the viewer is looking at the object of interest located
- at \l center, and the \l upVector specifies the direction that should
- be considered "up" with respect to the viewer.
-
- The vector from the \l eye to the \l center is called the "view vector",
- and the cross-product of the view vector and \l upVector is called
- the "side vector". The view vector specifies the direction the
- viewer is looking, and the side vector points off to the right of
- the viewer.
-
- It is recommended that the view vector and \l upVector be at right angles
- to each other, but this is not required as long as the angle between
- them is close to 90 degrees.
-
- The most common use of view and up vectors that are not at right angles
- is to simulate a human eye at a specific height above the ground looking
- down at a lower object or up at a higher object. In this case, the
- the view vector will not be true horizontal, but the \l upVector
- indicating the human's upright stance will be true vertical.
-
- \section1 Zooming the camera image
-
- There are two ways to zoom the image seen through the camera: either
- the camera \l eye position can be moved closer to the object of interest,
- or the field of view of the camera lens can be changed to make it appear
- as though the object is moving closer.
-
- Changing the \l eye position changes the lighting calculation in the
- scene because the viewer is in a different position, changing the
- angle of light reflection on the object's surface.
-
- The \l fieldOfView property function can be used to simulate the effect
- of a camera lens. The smaller the \l fieldOfView, the closer the object
- will appear. The lighting calculation will be the same as for the
- unzoomed scene.
-
- If \l fieldOfView is zero, then a standard perspective frustum of
- is used to define the viewing volume based on the width and height
- of the \l Viewport.
-
- \section1 Stereo projections
-
- Camera can adjust the camera position for rendering separate left
- and right eye images by setting the \l eyeSeparation property
- to a non-zero value. The \l eyeSeparation is in world co-ordinates.
-
- Objects that are placed at \l center will coincide in the left and
- right eye images, establishing the logical center of the stereo
- effect. Objects that are closer to the \l eye will be rendered
- to appear closer in the stereo effect, and objects that are further
- away from \l eye than \l center will be rendered to appear further away.
-
- \sa Viewport
-*/
-
-class QGLCameraPrivate
-{
-public:
- QGLCameraPrivate();
-
- QGLCamera::ProjectionType projectionType;
- qreal fieldOfView;
- qreal nearPlane;
- qreal farPlane;
- QSizeF viewSize;
- QSizeF minViewSize;
- int screenRotation;
- QVector3D eye;
- QVector3D upVector;
- QVector3D center;
- QVector3D viewVector;
- qreal eyeSeparation;
- QVector3D motionAdjustment;
- QQuaternion motionQuaternion;
- bool adjustForAspectRatio;
-};
-
-QGLCameraPrivate::QGLCameraPrivate()
- : projectionType(QGLCamera::Perspective),
- fieldOfView(0.0f),
- nearPlane(5.0f),
- farPlane(1000.0f),
- viewSize(2.0f, 2.0f),
- minViewSize(0.0001f, 0.0001f),
- screenRotation(0),
- eye(0.0f, 0.0f, 10.0f),
- upVector(0.0f, 1.0f, 0.0f),
- center(0.0f, 0.0f, 0.0f),
- viewVector(0.0f, 0.0f, -10.0f),
- eyeSeparation(0.0f),
- motionAdjustment(0.0f, 0.0f, 1.0f),
- adjustForAspectRatio(true)
-{
-}
-
-/*!
- Constructs a QGLCamera with the default properties and
- attaches it to \a parent.
-*/
-QGLCamera::QGLCamera(QObject *parent)
- : QObject(parent), d_ptr(new QGLCameraPrivate)
-{
-}
-
-/*!
- Destroys this QGLCamera object.
-*/
-QGLCamera::~QGLCamera()
-{
- delete d_ptr;
-}
-
-/*!
- \enum QGLCamera::ProjectionType
- This enum defines the type of view projection to use for a QGLCamera.
-
- \value Perspective Use a perspective view.
- \value Orthographic Use an orthographic view.
-*/
-
-/*!
- \property QGLCamera::projectionType
- \brief the projection type for this camera. The default is Perspective.
-*/
-
-/*!
- \qmlproperty enumeration Camera::projectionType
-
- The projection type for this camera, which is one of:
-
- \list
- \o Perspective Use a perspective view. This is the default.
- \o Orthographic Use an orthographic view.
- \endlist
-*/
-
-QGLCamera::ProjectionType QGLCamera::projectionType() const
-{
- Q_D(const QGLCamera);
- return d->projectionType;
-}
-
-void QGLCamera::setProjectionType(QGLCamera::ProjectionType value)
-{
- Q_D(QGLCamera);
- if (d->projectionType != value) {
- d->projectionType = value;
- emit projectionChanged();
- }
-}
-
-/*!
- \property QGLCamera::fieldOfView
- \brief the field of view in degrees for a perspective projection.
-
- The default value is zero, which indicates a standard perspective
- frustum view volume of viewSize() in size. If the value is not
- zero, then viewSize() is ignored.
-
- This value is ignored if projectionType() is not Perspective.
-
- \sa viewSize()
-*/
-
-/*!
- \qmlproperty real Camera::fieldOfView
- The field of view in degrees for a perspective projection.
-
- The default value is zero, which indicates a standard perspective
- frustum view volume.
-
- This value is ignored if projectionType is not Perspective.
-
- \sa projectionType
-*/
-
-qreal QGLCamera::fieldOfView() const
-{
- Q_D(const QGLCamera);
- return d->fieldOfView;
-}
-
-void QGLCamera::setFieldOfView(qreal angle)
-{
- Q_D(QGLCamera);
- if (d->fieldOfView != angle) {
- d->fieldOfView = angle;
- emit projectionChanged();
- }
-}
-
-/*!
- \property QGLCamera::nearPlane
- \brief the distance from the eye to the near clipping plane.
- The default value is 5.
-
- \sa farPlane()
-*/
-
-/*!
- \qmlproperty real Camera::nearPlane
- The distance from the eye to the near clipping plane.
- The default value is 5.
-
- \sa farPlane
-*/
-
-qreal QGLCamera::nearPlane() const
-{
- Q_D(const QGLCamera);
- return d->nearPlane;
-}
-
-void QGLCamera::setNearPlane(qreal value)
-{
- Q_D(QGLCamera);
- if (d->nearPlane != value) {
- d->nearPlane = value;
- emit projectionChanged();
- }
-}
-
-/*!
- \property QGLCamera::farPlane
- \brief the distance from the eye to the far clipping plane.
- The default value is 1000.
-
- \sa nearPlane()
-*/
-
-/*!
- \qmlproperty real Camera::farPlane
- The distance from the eye to the far clipping plane.
- The default value is 1000.
-
- \sa nearPlane
-*/
-
-qreal QGLCamera::farPlane() const
-{
- Q_D(const QGLCamera);
- return d->farPlane;
-}
-
-void QGLCamera::setFarPlane(qreal value)
-{
- Q_D(QGLCamera);
- if (d->farPlane != value) {
- d->farPlane = value;
- emit projectionChanged();
- }
-}
-
-/*!
- \property QGLCamera::viewSize
- \brief the size of the front of the projection viewing volume.
- The viewing volume is assumed to be centered on the origin.
-
- The default value is (2, 2), which indicates a viewing volume front
- from (-1, -1) to (1, 1).
-
- If the width or height of the viewing volume is negative, then the
- co-ordinates will be swapped. For example, a size of (2, -2) will
- flip the vertical axis upside down for a viewing volume from
- (-1, 1) to (1, -1).
-
- The view size will be further adjusted by the window's aspect ratio
- when projectionMatrix() is called. For best results, the width and
- height of the view size should be the same to define an ideal square
- viewing volume, which is then extended to the final viewing volume
- width and height based on the window's aspect ratio.
-
- \sa projectionMatrix(), minViewSize()
-*/
-QSizeF QGLCamera::viewSize() const
-{
- Q_D(const QGLCamera);
- return d->viewSize;
-}
-
-void QGLCamera::setViewSize(const QSizeF& size)
-{
- Q_D(QGLCamera);
- QSizeF sz(size);
- if (qAbs(sz.width()) < d->minViewSize.width()) {
- if (sz.width() >= 0.0f)
- sz.setWidth(d->minViewSize.width());
- else
- sz.setWidth(-d->minViewSize.width());
- }
- if (qAbs(sz.height()) < d->minViewSize.height()) {
- if (sz.height() >= 0.0f)
- sz.setHeight(d->minViewSize.height());
- else
- sz.setHeight(-d->minViewSize.height());
- }
- if (d->viewSize != sz) {
- d->viewSize = sz;
- emit projectionChanged();
- }
-}
-
-/*!
- \property QGLCamera::minViewSize
- \brief the minimum size of the front of the projection viewing volume.
-
- The minimum view size is used to clamp viewSize() when zooming
- the camera closer to an object to prevent it "passing through"
- the object and causing the scale factor to become infinite.
-
- The default value is (0.0001, 0.0001).
-
- \sa projectionMatrix(), viewSize()
-*/
-QSizeF QGLCamera::minViewSize() const
-{
- Q_D(const QGLCamera);
- return d->minViewSize;
-}
-
-void QGLCamera::setMinViewSize(const QSizeF& size)
-{
- Q_D(QGLCamera);
- if (d->minViewSize != size) {
- d->minViewSize = size;
- emit projectionChanged();
- }
-}
-
-/*!
- \property QGLCamera::screenRotation
- \brief the screen rotation angle in degrees. The default
- value is 0. If this value is 90 or 270, then the view
- will be flipped width for height. The only supported values
- are 0, 90, 180, and 270. The screen is rotated around the
- positive z axis.
-
- This setting is intended for simple screen rotations on handheld
- devices that can be held in either portrait or landscape orientations.
- The entire screen image is rotated so that it can be viewed in a
- different device orientation.
-
- Use rotateEye() or rotateCenter() for more complex rotations
- that are not aligned with 0, 90, 180, or 270 degrees.
-*/
-
-int QGLCamera::screenRotation() const
-{
- Q_D(const QGLCamera);
- return d->screenRotation;
-}
-
-void QGLCamera::setScreenRotation(int angle)
-{
- Q_D(QGLCamera);
- if (d->screenRotation != angle) {
- d->screenRotation = angle;
- emit projectionChanged();
- }
-}
-
-/*!
- \property QGLCamera::eye
- \brief the position of the viewer's eye. The default value is (0, 0, 10).
-
- \sa translateEye(), upVector(), center(), eyeSeparation()
- \sa motionAdjustment()
-*/
-
-/*!
- \qmlproperty vector3D Camera::eye
- The position of the viewer's eye. The default value is (0, 0, 10).
-
- \sa upVector, center, eyeSeparation
-*/
-QVector3D QGLCamera::eye() const
-{
- Q_D(const QGLCamera);
- return d->eye;
-}
-
-void QGLCamera::setEye(const QVector3D& vertex)
-{
- Q_D(QGLCamera);
- if (d->eye != vertex) {
- d->eye = vertex;
- d->viewVector = d->center - d->eye;
- emit viewChanged();
- }
-}
-
-/*!
- Adjusts the position of the viewer's eye by the components
- (\a x, \a y, \a z), where the components are interpreted relative
- to the viewer's current orientation. See translation() for more
- information.
-
- This function is accessible to QML on the Camera item.
-
- \sa eye(), setEye(), translateCenter()
-*/
-void QGLCamera::translateEye(qreal x, qreal y, qreal z)
-{
- Q_D(QGLCamera);
- d->eye += translation(x, y, z);
- d->viewVector = d->center - d->eye;
- emit viewChanged();
-}
-
-/*!
- \property QGLCamera::upVector
- \brief the up vector for the viewer. The default value is (0, 1, 0).
-
- \sa eye(), center()
-*/
-
-/*!
- \qmlproperty vector3D Camera::upVector
- The up vector for the viewer. The default value is (0, 1, 0).
-
- \sa eye, center
-*/
-
-QVector3D QGLCamera::upVector() const
-{
- Q_D(const QGLCamera);
- return d->upVector;
-}
-
-void QGLCamera::setUpVector(const QVector3D& vector)
-{
- Q_D(QGLCamera);
- if (d->upVector != vector) {
- d->upVector = vector;
- emit viewChanged();
- }
-}
-
-/*!
- \property QGLCamera::center
- \brief the center of the view visible from the viewer's position.
- The default value is (0, 0, 0).
-
- \sa translateCenter(), eye(), upVector()
-*/
-
-/*!
- \qmlproperty vector3D Camera::center
- The center of the view visible from the viewer's position.
- The default value is (0, 0, 0).
-
- \sa eye, upVector
-*/
-
-QVector3D QGLCamera::center() const
-{
- Q_D(const QGLCamera);
- return d->center;
-}
-
-void QGLCamera::setCenter(const QVector3D& vertex)
-{
- Q_D(QGLCamera);
- if (d->center != vertex) {
- d->center = vertex;
- d->viewVector = d->center - d->eye;
- emit viewChanged();
- }
-}
-
-/*!
- Adjusts the center of the view by the components (\a x, \a y, \a z),
- where the components are interpreted relative to the viewer's current
- orientation. See translation() for more information.
-
- This function is accessible to QML on the Camera item.
-
- \sa center(), setCenter(), translateEye()
-*/
-void QGLCamera::translateCenter(qreal x, qreal y, qreal z)
-{
- Q_D(QGLCamera);
- d->center += translation(x, y, z);
- d->viewVector = d->center - d->eye;
- emit viewChanged();
-}
-
-/*!
- \property QGLCamera::eyeSeparation
- \brief the separation between the eyes when stereo viewing is in use,
- with eye() specifying the mid-point between the eyes. The default
- value is 0.
-
- \sa eye()
-*/
-
-/*!
- \qmlproperty real Camera::eyeSeparation
- The separation between the eyes when stereo viewing is in use,
- with \l eye property specifying the mid-point between the eyes.
- The default value is 0.
-
- \sa eye
-*/
-
-qreal QGLCamera::eyeSeparation() const
-{
- Q_D(const QGLCamera);
- return d->eyeSeparation;
-}
-
-void QGLCamera::setEyeSeparation(qreal value)
-{
- Q_D(QGLCamera);
- if (d->eyeSeparation != value) {
- d->eyeSeparation = value;
- emit viewChanged();
- }
-}
-
-/*!
- \property QGLCamera::motionAdjustment
- \brief the adjustment vector to apply to the eye() for user motion.
-
- This property is typically used to implement motion tracking.
- It is interpreted as a vector from the center of the screen to the
- current position of the viewer. The angle between the motion
- adjustment vector and the screen center is used to adjust the
- position of the eye() when modelViewMatrix() is called.
-
- The default value is (0, 0, 1), which indicates a viewer
- directly in front of the center of the screen.
-
- The units for the vector are unspecified. They could be
- meters, centimeters, or the force due to gravity in various
- directions from an accelerometer. The angle defined
- by the vector is used to perform the adjustment, not its
- magnitude.
-
- The output of motion tracking hardware can be very noisy,
- with minor fluctuations due to viewer twitch movements or
- environmental factors. The application is responsible for
- cleaning up the signal and removing these fluctuations before
- altering this property.
-
- \sa eye(), modelViewMatrix()
-*/
-
-QVector3D QGLCamera::motionAdjustment() const
-{
- Q_D(const QGLCamera);
- return d->motionAdjustment;
-}
-
-void QGLCamera::setMotionAdjustment(const QVector3D& vector)
-{
- Q_D(QGLCamera);
- if (d->motionAdjustment != vector) {
- d->motionAdjustment = vector;
- if (vector.x() == 0.0f && vector.y() == 0.0f) {
- // If the vector is centered, then don't perform any rotations.
- d->motionQuaternion = QQuaternion();
- } else {
- // Determine the pan and tilt angles from the vector.
- QVector3D view = -vector.normalized();
- if (view.z() < 0.0f)
- view = -view;
- qreal xangle = asin(view.x()) * 180.0f / M_PI;
- qreal yangle = asin(-view.y()) * 180.0f / M_PI;
-
- // Construct the pan and tilt quaternions.
- if (qFuzzyIsNull(xangle))
- d->motionQuaternion = tilt(yangle);
- else if (qFuzzyIsNull(yangle))
- d->motionQuaternion = pan(xangle);
- else
- d->motionQuaternion = tilt(yangle) * pan(xangle);
- }
- emit viewChanged();
- }
-}
-
-/*!
- \property QGLCamera::adjustForAspectRatio
- \brief the adjustment state of the aspect ratio in the viewing volume.
-
- By default, QGLCamera adjusts the viewing volume for the aspect
- ratio of the window so that pixels appear square without the
- application needing to adjust viewSize() manually.
-
- If this property is false, then the aspect ratio adjustment is
- not performed.
-*/
-
-/*!
- \qmlproperty bool Camera::adjustForAspectRatio
- The adjustment state of the aspect ratio in the viewing volume.
-
- By default, the camera adjusts the viewing volume for the aspect
- ratio of the window so that pixels appear square without the
- application needing to adjust the view size manually.
-
- If this property is false, then the aspect ratio adjustment is
- not performed.
-
- \sa projectionType
-*/
-
-bool QGLCamera::adjustForAspectRatio() const
-{
- Q_D(const QGLCamera);
- return d->adjustForAspectRatio;
-}
-
-void QGLCamera::setAdjustForAspectRatio(bool value)
-{
- Q_D(QGLCamera);
- if (d->adjustForAspectRatio != value) {
- d->adjustForAspectRatio = value;
- emit viewChanged();
- }
-}
-
-/*!
- Returns the quaternion corresponding to tilting the view up or
- down by \a angle degrees. The returned quaternion can be applied to
- the eye() position with rotateEye() or to the center() position with
- rotateCenter().
-
- \sa pan(), roll(), rotateEye(), rotateCenter()
-*/
-QQuaternion QGLCamera::tilt(qreal angle) const
-{
- Q_D(const QGLCamera);
- QVector3D side = QVector3D::crossProduct(d->viewVector, d->upVector);
- return QQuaternion::fromAxisAndAngle(side, angle);
-}
-
-/*!
- Returns the quaternion corresponding to panning the view left or
- right by \a angle degrees. The returned quaternion can be applied to
- the eye() position with rotateEye() or to the center() position with
- rotateCenter().
-
- \sa tilt(), roll(), rotateEye(), rotateCenter()
-*/
-QQuaternion QGLCamera::pan(qreal angle) const
-{
- Q_D(const QGLCamera);
- return QQuaternion::fromAxisAndAngle(d->upVector, angle);
-}
-
-/*!
- Returns the quaternion corresponding to rolling the view left or
- right by \a angle degrees. The returned quaternion can be applied to
- the eye() position with rotateEye() or to the center() position with
- rotateCenter().
-
- \sa tilt(), pan(), rotateEye(), rotateCenter()
-*/
-QQuaternion QGLCamera::roll(qreal angle) const
-{
- Q_D(const QGLCamera);
- return QQuaternion::fromAxisAndAngle(d->viewVector, angle);
-}
-
-/*!
- Rotates the orientation of the eye() according to the quaternion \a q.
- The eye() will remain in the same position, but the upVector() and
- center() may be altered by the rotation.
-
- \sa rotateCenter(), tilt(), pan(), roll()
-*/
-void QGLCamera::rotateEye(const QQuaternion& q)
-{
- Q_D(QGLCamera);
- d->upVector = q.rotatedVector(d->upVector);
- d->viewVector = q.rotatedVector(d->viewVector);
- d->center = d->eye + d->viewVector;
- emit viewChanged();
-}
-
-/*!
- Rotates the position and orientation of the eye() around center()
- according to the quaternion \a q. The center() will remain in the
- same position, but the upVector() and eye() may be altered by
- the rotation.
-
- \sa rotateEye(), tilt(), pan(), roll()
-*/
-void QGLCamera::rotateCenter(const QQuaternion& q)
-{
- Q_D(QGLCamera);
- d->upVector = q.rotatedVector(d->upVector);
- d->viewVector = q.rotatedVector(d->viewVector);
- d->eye = d->center - d->viewVector;
- emit viewChanged();
-}
-
-/*!
- Returns a translation vector that can be used to adjust the eye()
- or center() by \a x units side-ways, \a y units up,
- and \a z units forwards.
-
- This function is useful when implementing operations such as
- "step left", "jump up", and so on where the movement should be
- interpreted relative to the viewer's current orientation, not the
- world co-ordinate axes.
-
- The following example moves the eye() 2 units to the right of the
- current eye position while keeping the same center() of interest:
-
- \code
- camera.setEye(camera.eye() + camera.translation(2, 0, 0));
- \endcode
-
- \sa translateEye(), translateCenter()
-*/
-QVector3D QGLCamera::translation(qreal x, qreal y, qreal z) const
-{
- Q_D(const QGLCamera);
- QVector3D vector(0.0f, 0.0f, 0.0f);
- if (x != 0.0f)
- vector += QVector3D::normal(d->viewVector, d->upVector) * x;
- if (y != 0.0f)
- vector += d->upVector.normalized() * y;
- if (z != 0.0f)
- vector += d->viewVector.normalized() * z;
- return vector;
-}
-
-/*!
- Returns the transformation matrix to apply to the projection matrix
- to present the scene as viewed from the camera position.
-
- The \a aspectRatio specifies the aspect ratio of the window the
- camera view is being displayed in. An \a aspectRatio of 1 indicates that
- the window is square. An \a aspectRatio greater than 1 indicates that
- the window is wider than it is high. An \a aspectRatio less than 1
- indicates that the window is higher than it is wide.
-
- \sa modelViewMatrix()
-*/
-QMatrix4x4 QGLCamera::projectionMatrix(qreal aspectRatio) const
-{
- Q_D(const QGLCamera);
- QMatrix4x4 m;
- if (!d->adjustForAspectRatio)
- aspectRatio = 1.0f;
- if (d->screenRotation != 0) {
- m.rotate((qreal)(d->screenRotation), 0.0f, 0.0f, 1.0f);
- if (d->screenRotation == 90 || d->screenRotation == 270) {
- if (aspectRatio != 0.0f)
- aspectRatio = 1.0f / aspectRatio;
- }
- }
- if (d->projectionType == Perspective && d->fieldOfView != 0.0f) {
- m.perspective(d->fieldOfView, aspectRatio,
- d->nearPlane, d->farPlane);
- } else {
- qreal halfWidth = d->viewSize.width() / 2.0f;
- qreal halfHeight = d->viewSize.height() / 2.0f;
- if (aspectRatio > 1.0f) {
- halfWidth *= aspectRatio;
- } else if (aspectRatio > 0.0f && aspectRatio < 1.0f) {
- halfHeight /= aspectRatio;
- }
- if (d->projectionType == Perspective) {
- m.frustum(-halfWidth, halfWidth, -halfHeight, halfHeight,
- d->nearPlane, d->farPlane);
- } else {
- m.ortho(-halfWidth, halfWidth, -halfHeight, halfHeight,
- d->nearPlane, d->farPlane);
- }
- }
- return m;
-}
-
-/*!
- Returns the transformation to apply to the modelview matrix
- to present the scene as viewed from the eye position.
-
- The \a eye parameter is used to adjust the camera's position
- horizontally by half of eyeSeparation() if \a eye is QGL::LeftEye
- or QGL::RightEye.
-
- \sa projectionMatrix()
-*/
-QMatrix4x4 QGLCamera::modelViewMatrix(QGL::Eye eye) const
-{
- Q_D(const QGLCamera);
- QMatrix4x4 m;
- QVector3D adjust;
- if (eye == QGL::LeftEye)
- adjust = translation(-d->eyeSeparation / 2.0f, 0.0f, 0.0f);
- else if (eye == QGL::RightEye)
- adjust = translation(d->eyeSeparation / 2.0f, 0.0f, 0.0f);
- if (d->motionQuaternion.isIdentity()) {
- m.lookAt(d->eye + adjust, d->center, d->upVector);
- } else {
- QVector3D up = d->motionQuaternion.rotatedVector(d->upVector);
- QVector3D view = d->motionQuaternion.rotatedVector(d->viewVector);
- m.lookAt(d->center - view + adjust, d->center, up);
- }
- return m;
-}
-
-/*!
- Maps \a point from viewport co-ordinates to eye co-ordinates.
- The size of the viewport is given by \a viewportSize, and its
- aspect ratio by \a aspectRatio.
-
- The returned vector will have its x and y components set to the
- position of the point on the near plane, and the z component
- set to -nearPlane().
-
- This function is used for converting a mouse event's position
- into eye co-ordinates within the current camera view.
-*/
-QVector3D QGLCamera::mapPoint
- (const QPoint& point, qreal aspectRatio, const QSize& viewportSize) const
-{
- Q_D(const QGLCamera);
-
- // Rotate the co-ordinate system to account for the screen rotation.
- int x = point.x();
- int y = point.y();
- int width = viewportSize.width();
- int height = viewportSize.height();
- if (!d->adjustForAspectRatio)
- aspectRatio = 1.0f;
- if (d->screenRotation == 90) {
- if (aspectRatio != 0.0f)
- aspectRatio = 1.0f / aspectRatio;
- qSwap(x, y);
- qSwap(width, height);
- y = height - 1 - y;
- } else if (d->screenRotation == 180) {
- x = width - 1 - x;
- y = height - 1 - y;
- } else if (d->screenRotation == 270) {
- if (aspectRatio != 0.0f)
- aspectRatio = 1.0f / aspectRatio;
- qSwap(x, y);
- qSwap(width, height);
- }
-
- // Determine the relative distance from the middle of the screen.
- // After this xrel and yrel are typically between -1.0 and +1.0
- // (unless the point was outside the viewport). The yrel is
- // flipped upside down to account for the incoming co-ordinate
- // being left-handed, but the world being right-handed.
- qreal xrel, yrel;
- if (width)
- xrel = (((qreal)(x * 2)) - (qreal)width) / (qreal)width;
- else
- xrel = 0.0f;
- if (height)
- yrel = -(((qreal)(y * 2)) - (qreal)height) / (qreal)height;
- else
- yrel = 0.0f;
-
- // Reverse the projection and return the point in world co-ordinates.
- QMatrix4x4 m = projectionMatrix(aspectRatio);
- QMatrix4x4 invm = m.inverted();
- return invm.map(QVector3D(xrel, yrel, -1.0f));
-}
-
-/*!
- \fn void QGLCamera::projectionChanged()
-
- This signal is emitted when one of projectionType(), fieldOfView(),
- nearPlane(), farPlane(), viewSize(), or screenRotation() changes,
- indicating a modification to the optical properties of the camera
- looking at the scene.
-
- \sa viewChanged()
-*/
-
-/*!
- \fn void QGLCamera::viewChanged()
-
- This signal is emitted when one of eye(), upVector(), or center()
- changes, indicating a modification to the viewer's position or
- orientation.
-
- \sa projectionChanged()
-*/
-
-/*!
- \enum QGLCamera::RotateOrder
- This enum defines the order to perform a tilt, pan, and roll
- of a QGLCamera eye or center.
-
- \value TiltPanRoll Tilt, then pan, then roll.
- \value TiltRollPan Tilt, then roll, then pan.
- \value PanTiltRoll Pan, then tilt, then roll.
- \value PanRollTilt Pan, then roll, then tilt.
- \value RollTiltPan Roll, then tilt, then pan.
- \value RollPanTilt Roll, then pan, then tilt.
-*/
-
-/*!
- Tilts the center() up or down by \a tiltAngle degrees,
- pans the center() left or right by \a panAngle degrees,
- and rolls the center() left or right by \a rollAngle degrees,
- all in a single fluid movement. The \a order parameter
- indicates the order in which to perform the rotations.
-
- This function is accessible to QML on the Camera item.
- It is provided as a convenience for navigation items that
- rotate the center in multiple directions at the same time
- based on mouse movements.
-
- \sa tiltPanRollEye()
-*/
-void QGLCamera::tiltPanRollCenter
- (qreal tiltAngle, qreal panAngle, qreal rollAngle,
- QGLCamera::RotateOrder order)
-{
- switch (order) {
- case QGLCamera::TiltPanRoll:
- rotateCenter(roll(rollAngle) * pan(panAngle) * tilt(tiltAngle));
- break;
- case QGLCamera::TiltRollPan:
- rotateCenter(pan(panAngle) * roll(rollAngle) * tilt(tiltAngle));
- break;
- case QGLCamera::PanTiltRoll:
- rotateCenter(roll(rollAngle) * tilt(tiltAngle) * pan(panAngle));
- break;
- case QGLCamera::PanRollTilt:
- rotateCenter(tilt(tiltAngle) * roll(rollAngle) * pan(panAngle));
- break;
- case QGLCamera::RollTiltPan:
- rotateCenter(pan(panAngle) * tilt(tiltAngle) * roll(rollAngle));
- break;
- case QGLCamera::RollPanTilt:
- rotateCenter(tilt(tiltAngle) * pan(panAngle) * roll(rollAngle));
- break;
- }
-}
-
-/*!
- Tilts the eye() up or down by \a tiltAngle degrees,
- pans the eye() left or right by \a panAngle degrees,
- and rolls the eye() left or right by \a rollAngle degrees,
- all in a single fluid movement. The \a order parameter
- indicates the order in which to perform the rotations.
-
- This function is accessible to QML on the Camera item.
- It is provided as a convenience for navigation items that
- rotate the eye in multiple directions at the same time
- based on mouse movements.
-
- \sa tiltPanRollCenter()
-*/
-void QGLCamera::tiltPanRollEye
- (qreal tiltAngle, qreal panAngle, qreal rollAngle,
- QGLCamera::RotateOrder order)
-{
- switch (order) {
- case QGLCamera::TiltPanRoll:
- rotateEye(roll(rollAngle) * pan(panAngle) * tilt(tiltAngle));
- break;
- case QGLCamera::TiltRollPan:
- rotateEye(pan(panAngle) * roll(rollAngle) * tilt(tiltAngle));
- break;
- case QGLCamera::PanTiltRoll:
- rotateEye(roll(rollAngle) * tilt(tiltAngle) * pan(panAngle));
- break;
- case QGLCamera::PanRollTilt:
- rotateEye(tilt(tiltAngle) * roll(rollAngle) * pan(panAngle));
- break;
- case QGLCamera::RollTiltPan:
- rotateEye(pan(panAngle) * tilt(tiltAngle) * roll(rollAngle));
- break;
- case QGLCamera::RollPanTilt:
- rotateEye(tilt(tiltAngle) * pan(panAngle) * roll(rollAngle));
- break;
- }
-}
-
-QDebug operator<<(QDebug dbg, const QGLCamera &cam)
-{
- dbg << "QGLCamera";
- if (!cam.objectName().isEmpty())
- dbg << cam.objectName();
- dbg << "\n";
- dbg << " projection:" << ( cam.projectionType() == QGLCamera::Perspective ?
- "Perspective" : "Orthographic" );
- dbg << "-- viewsize:" << cam.viewSize().width() << "x" << cam.viewSize().height() << "\n";
- dbg << " near-plane:" << cam.nearPlane() << "-- far-plane:" << cam.farPlane();
- dbg << "-- field-of-view:" << cam.fieldOfView() << "\n";
- dbg << " rotation:" << cam.screenRotation() << " -- motion adjust:" <<
- cam.motionAdjustment() << " -- aspect adjust:" << cam.adjustForAspectRatio() << "\n";
- dbg << " eye:" << cam.eye() << "-- center:" << cam.center();
- dbg << "-- up:" << cam.upVector() << "\n";
- return dbg;
-}
-
-QT_END_NAMESPACE
diff --git a/src/threed/viewing/qglcamera.h b/src/threed/viewing/qglcamera.h
deleted file mode 100644
index d943d283..00000000
--- a/src/threed/viewing/qglcamera.h
+++ /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$
-**
-****************************************************************************/
-
-#ifndef QGLCAMERA_H
-#define QGLCAMERA_H
-
-#include "qt3dglobal.h"
-#include "qglnamespace.h"
-#include <QtCore/qobject.h>
-#include <QtCore/qsize.h>
-#include <QtGui/qvector3d.h>
-#include <QtGui/qmatrix4x4.h>
-#include <QtGui/qquaternion.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class QGLCameraPrivate;
-class QGLPainter;
-
-class Q_QT3D_EXPORT QGLCamera : public QObject
-{
- Q_OBJECT
- Q_ENUMS(ProjectionType RotateOrder)
- Q_PROPERTY(ProjectionType projectionType READ projectionType WRITE setProjectionType NOTIFY projectionChanged)
- Q_PROPERTY(qreal fieldOfView READ fieldOfView WRITE setFieldOfView NOTIFY projectionChanged)
- Q_PROPERTY(qreal nearPlane READ nearPlane WRITE setNearPlane NOTIFY projectionChanged)
- Q_PROPERTY(qreal farPlane READ farPlane WRITE setFarPlane NOTIFY projectionChanged)
- Q_PROPERTY(QSizeF viewSize READ viewSize WRITE setViewSize NOTIFY projectionChanged)
- Q_PROPERTY(QSizeF minViewSize READ minViewSize WRITE setMinViewSize NOTIFY projectionChanged SCRIPTABLE false)
- Q_PROPERTY(int screenRotation READ screenRotation WRITE setScreenRotation NOTIFY projectionChanged SCRIPTABLE false)
- Q_PROPERTY(QVector3D eye READ eye WRITE setEye NOTIFY viewChanged)
- Q_PROPERTY(QVector3D upVector READ upVector WRITE setUpVector NOTIFY viewChanged)
- Q_PROPERTY(QVector3D center READ center WRITE setCenter NOTIFY viewChanged)
- Q_PROPERTY(qreal eyeSeparation READ eyeSeparation WRITE setEyeSeparation NOTIFY viewChanged)
- Q_PROPERTY(QVector3D motionAdjustment READ motionAdjustment WRITE setMotionAdjustment DESIGNABLE false NOTIFY viewChanged SCRIPTABLE false)
- Q_PROPERTY(bool adjustForAspectRatio READ adjustForAspectRatio WRITE setAdjustForAspectRatio NOTIFY viewChanged)
-public:
- explicit QGLCamera(QObject *parent = 0);
- ~QGLCamera();
-
- enum ProjectionType
- {
- Perspective,
- Orthographic
- };
-
- QGLCamera::ProjectionType projectionType() const;
- void setProjectionType(QGLCamera::ProjectionType value);
-
- qreal fieldOfView() const;
- void setFieldOfView(qreal angle);
-
- qreal nearPlane() const;
- void setNearPlane(qreal value);
-
- qreal farPlane() const;
- void setFarPlane(qreal value);
-
- QSizeF viewSize() const;
- void setViewSize(const QSizeF& size);
-
- QSizeF minViewSize() const;
- void setMinViewSize(const QSizeF& size);
-
- int screenRotation() const;
- void setScreenRotation(int angle);
-
- QVector3D eye() const;
- void setEye(const QVector3D& vertex);
-
- QVector3D upVector() const;
- void setUpVector(const QVector3D& vector);
-
- QVector3D center() const;
- void setCenter(const QVector3D& vertex);
-
- qreal eyeSeparation() const;
- void setEyeSeparation(qreal value);
-
- QVector3D motionAdjustment() const;
- void setMotionAdjustment(const QVector3D& vector);
-
- bool adjustForAspectRatio() const;
- void setAdjustForAspectRatio(bool value);
-
- QQuaternion tilt(qreal angle) const;
- QQuaternion pan(qreal angle) const;
- QQuaternion roll(qreal angle) const;
-
- void rotateEye(const QQuaternion& q);
- void rotateCenter(const QQuaternion& q);
-
- QVector3D translation(qreal x, qreal y, qreal z) const;
-
- QMatrix4x4 projectionMatrix(qreal aspectRatio) const;
- QMatrix4x4 modelViewMatrix(QGL::Eye eye = QGL::NoEye) const;
-
- QVector3D mapPoint
- (const QPoint& point, qreal aspectRatio,
- const QSize& viewportSize) const;
-
- enum RotateOrder
- {
- TiltPanRoll,
- TiltRollPan,
- PanTiltRoll,
- PanRollTilt,
- RollTiltPan,
- RollPanTilt
- };
-
-public Q_SLOTS:
- void translateEye(qreal x, qreal y, qreal z);
- void translateCenter(qreal x, qreal y, qreal z);
-
- void tiltPanRollCenter(qreal tiltAngle, qreal panAngle, qreal rollAngle,
- QGLCamera::RotateOrder order = TiltPanRoll);
- void tiltPanRollEye(qreal tiltAngle, qreal panAngle, qreal rollAngle,
- QGLCamera::RotateOrder order = TiltPanRoll);
-
-Q_SIGNALS:
- void projectionChanged();
- void viewChanged();
-
-private:
- QGLCameraPrivate *d_ptr;
-
- QGLCameraPrivate *d_func() const { return d_ptr; }
-
- Q_DISABLE_COPY(QGLCamera)
-};
-
-#ifndef QT_NO_DEBUG_STREAM
-#include <QtCore/qdebug.h>
-Q_QT3D_EXPORT QDebug operator<<(QDebug dbg, const QGLCamera &order);
-#endif
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/viewing/qglcameraanimation.cpp b/src/threed/viewing/qglcameraanimation.cpp
deleted file mode 100644
index 7c19e96e..00000000
--- a/src/threed/viewing/qglcameraanimation.cpp
+++ /dev/null
@@ -1,543 +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 "qglcameraanimation.h"
-#include "qglcamera.h"
-#include <QtCore/qmath.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGLCameraAnimation
- \brief The QGLCameraAnimation class implements smooth animations between two camera positions.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::viewing
-
- QGLCameraAnimation modifies the camera() object to fall on a smooth
- path between startEye(), startUpVector(), startCenter() and
- endEye(), endUpVector(), endCenter. The animation will attempt to
- keep the eye and center at the same relative distance from each other
- throughout the animation, as though one object is flying around another.
-
- \sa QGLCamera
-*/
-
-class QGLCameraAnimationPrivate
-{
-public:
- enum PointOfRotation
- {
- Center,
- CenterDual,
- Eye,
- EyeDual,
- Both
- };
-
- QGLCameraAnimationPrivate()
- : camera(0)
- , startEye(0.0f, 0.0f, 10.f)
- , startUpVector(0.0f, 1.0f, 0.0f)
- , startCenter(0.0f, 0.0f, 0.0f)
- , endEye(0.0f, 0.0f, 10.f)
- , endUpVector(0.0f, 1.0f, 0.0f)
- , endCenter(0.0f, 0.0f, 0.0f)
- , duration(250)
- , dirty(true)
- , pointOfRotation(Both)
- , lengthStart(1.0f)
- , lengthEnd(1.0f)
- {
- }
-
- QGLCamera *camera;
- QVector3D startEye;
- QVector3D startUpVector;
- QVector3D startCenter;
- QVector3D endEye;
- QVector3D endUpVector;
- QVector3D endCenter;
- int duration;
- bool dirty;
- QEasingCurve easingCurve;
-
- // Derived values for use during the animation.
- PointOfRotation pointOfRotation;
- QVector3D upVectorAxis;
- qreal upVectorAngle;
- QVector3D pointAxis;
- qreal pointAngle;
- QVector3D centerTranslate;
- QVector3D eyeTranslate;
- qreal lengthStart;
- qreal lengthEnd;
-
- static void rotateBetween(const QVector3D &start, const QVector3D &end,
- const QVector3D &defaultAxis,
- QVector3D *rotationAxis, qreal *rotationAngle);
- void deriveRotations();
-};
-
-static inline bool fuzzyCompareVectors(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;
-}
-
-// Determine how to rotate between the "start" and "end" vectors.
-// We use the cross-product of the two vectors as the axis of rotation
-// or "defaultAxis" if the cross-product is zero (180 degree rotation).
-void QGLCameraAnimationPrivate::rotateBetween
- (const QVector3D &start, const QVector3D &end, const QVector3D &defaultAxis,
- QVector3D *rotationAxis, qreal *rotationAngle)
-{
- QVector3D nstart = start.normalized();
- QVector3D nend = end.normalized();
- if (qFuzzyCompare(nstart, nend)) {
- // Vectors are the same, so no rotation to perform.
- *rotationAxis = QVector3D(0, 1, 0);
- *rotationAngle = 0.0f;
- } else {
- QVector3D axis = QVector3D::crossProduct(nstart, nend);
- if (qFuzzyIsNull(axis.x()) && qFuzzyIsNull(axis.y()) &&
- qFuzzyIsNull(axis.z())) {
- // Vectors are probably at 180 degrees to each other.
- // We can pick either direction; arbitrarily pick anti-clockwise.
- *rotationAxis = defaultAxis;
- *rotationAngle = 180.0f;
- } else {
- // Compute the smallest angle between the two vectors
- // from the cosine of the angle (i.e. the dot product).
- *rotationAxis = axis;
- *rotationAngle =
- qAcos(QVector3D::dotProduct(nstart, nend)) * 180.0f / M_PI;
- }
- }
-}
-
-void QGLCameraAnimationPrivate::deriveRotations()
-{
- // If the center points are the same, rotate the eye around the center.
- // If the eye points are the same, rotate the center around the eye.
- // If both are different, then interpolate along linear vectors.
- if (qFuzzyCompare(startCenter, endCenter)) {
- if (qFuzzyCompare(startEye, endEye)) {
- // Center and eye both stay the same: nothing to do.
- pointOfRotation = Both;
- centerTranslate = QVector3D();
- eyeTranslate = QVector3D();
- } else {
- // Centers are the same, rotate the eye position.
- pointOfRotation = Center;
- rotateBetween(startEye - startCenter, endEye - startCenter,
- startUpVector, &pointAxis, &pointAngle);
- lengthStart = (startEye - startCenter).length();
- lengthEnd = (endEye - startCenter).length();
-
- // Rotate the start up vector to the final position. If it is
- // different than the end up vector, we need to perform the
- // animation in two steps: rotate eye, then rotate up.
- QQuaternion q =
- QQuaternion::fromAxisAndAngle(pointAxis, pointAngle);
- QVector3D up = q.rotatedVector(startUpVector);
- if (!fuzzyCompareVectors(startUpVector, endUpVector) &&
- !fuzzyCompareVectors(up, endUpVector)) {
- pointOfRotation = CenterDual;
- rotateBetween(up, endUpVector, endEye - endCenter,
- &upVectorAxis, &upVectorAngle);
- }
- }
- } else if (qFuzzyCompare(startEye, endEye)) {
- // Eyes are the same, rotate the center position.
- pointOfRotation = Eye;
- rotateBetween(startCenter - startEye, endCenter - startEye,
- startUpVector, &pointAxis, &pointAngle);
- lengthStart = (startCenter - startEye).length();
- lengthEnd = (startCenter - endEye).length();
-
- // Rotate the start up vector to the final position. If it is
- // different than the end up vector, we need to perform the
- // animation in two steps: rotate eye, then rotate up.
- QQuaternion q =
- QQuaternion::fromAxisAndAngle(pointAxis, pointAngle);
- QVector3D up = q.rotatedVector(startUpVector);
- if (!fuzzyCompareVectors(startUpVector, endUpVector) &&
- !fuzzyCompareVectors(up, endUpVector)) {
- pointOfRotation = EyeDual;
- rotateBetween(up, endUpVector, endCenter - endEye,
- &upVectorAxis, &upVectorAngle);
- }
- } else {
- // Both center and eye are changing, so perform a linear translation.
- pointOfRotation = Both;
- centerTranslate = endCenter - startCenter;
- eyeTranslate = endEye - startEye;
- }
-
- // If we are doing a single movement, then determine how to
- // rotate the up vector during the movement.
- if (pointOfRotation != CenterDual) {
- rotateBetween(startUpVector, endUpVector, startCenter - startEye,
- &upVectorAxis, &upVectorAngle);
- }
-}
-
-/*!
- Constructs a new camera animation object and attaches it to \a parent.
-*/
-QGLCameraAnimation::QGLCameraAnimation(QObject *parent)
- : QAbstractAnimation(parent)
- , d_ptr(new QGLCameraAnimationPrivate)
-{
-}
-
-/*!
- Destroys this camera animation object.
-*/
-QGLCameraAnimation::~QGLCameraAnimation()
-{
-}
-
-/*!
- \property QGLCameraAnimation::camera
- \brief the camera that will be animated by this animation object;
- null if the camera has not yet been set.
-*/
-
-QGLCamera *QGLCameraAnimation::camera() const
-{
- Q_D(const QGLCameraAnimation);
- return d->camera;
-}
-
-void QGLCameraAnimation::setCamera(QGLCamera *camera)
-{
- Q_D(QGLCameraAnimation);
- d->camera = camera;
-}
-
-/*!
- \property QGLCameraAnimation::startEye
- \brief the position of the viewer's eye at the start of the animation.
- The default value is (0, 0, 10).
-
- \sa startUpVector(), startCenter(), endEye()
-*/
-
-QVector3D QGLCameraAnimation::startEye() const
-{
- Q_D(const QGLCameraAnimation);
- return d->startEye;
-}
-
-void QGLCameraAnimation::setStartEye(const QVector3D &eye)
-{
- Q_D(QGLCameraAnimation);
- d->startEye = eye;
- d->dirty = true;
-}
-
-/*!
- \property QGLCameraAnimation::startUpVector
- \brief the up vector for the viewer at the start of the animation.
- The default value is (0, 1, 0).
-
- \sa startEye(), startCenter(), endUpVector()
-*/
-
-QVector3D QGLCameraAnimation::startUpVector() const
-{
- Q_D(const QGLCameraAnimation);
- return d->startUpVector;
-}
-
-void QGLCameraAnimation::setStartUpVector(const QVector3D &upVector)
-{
- Q_D(QGLCameraAnimation);
- d->startUpVector = upVector;
- d->dirty = true;
-}
-
-/*!
- \property QGLCameraAnimation::startCenter
- \brief the center of the view visible from the viewer's position
- at the start of the animation. The default value is (0, 0, 0).
-
- \sa startEye(), startUpVector(), endCenter()
-*/
-
-QVector3D QGLCameraAnimation::startCenter() const
-{
- Q_D(const QGLCameraAnimation);
- return d->startCenter;
-}
-
-void QGLCameraAnimation::setStartCenter(const QVector3D &center)
-{
- Q_D(QGLCameraAnimation);
- d->startCenter = center;
- d->dirty = true;
-}
-
-/*!
- \property QGLCameraAnimation::endEye
- \brief the position of the viewer's eye at the end of the animation.
- The default value is (0, 0, 10).
-
- \sa endUpVector(), endCenter(), startEye()
-*/
-
-QVector3D QGLCameraAnimation::endEye() const
-{
- Q_D(const QGLCameraAnimation);
- return d->endEye;
-}
-
-void QGLCameraAnimation::setEndEye(const QVector3D &eye)
-{
- Q_D(QGLCameraAnimation);
- d->endEye = eye;
- d->dirty = true;
-}
-
-/*!
- \property QGLCameraAnimation::endUpVector
- \brief the up vector for the viewer at the end of the animation.
- The default value is (0, 1, 0).
-
- \sa endEye(), endCenter(), startUpVector()
-*/
-
-QVector3D QGLCameraAnimation::endUpVector() const
-{
- Q_D(const QGLCameraAnimation);
- return d->endUpVector;
-}
-
-void QGLCameraAnimation::setEndUpVector(const QVector3D &upVector)
-{
- Q_D(QGLCameraAnimation);
- d->endUpVector = upVector;
- d->dirty = true;
-}
-
-/*!
- \property QGLCameraAnimation::endCenter
- \brief the center of the view visible from the viewer's position
- at the end of the animation. The default value is (0, 0, 0).
-
- \sa endEye(), endUpVector(), startCenter()
-*/
-
-QVector3D QGLCameraAnimation::endCenter() const
-{
- Q_D(const QGLCameraAnimation);
- return d->endCenter;
-}
-
-void QGLCameraAnimation::setEndCenter(const QVector3D &center)
-{
- Q_D(QGLCameraAnimation);
- d->endCenter = center;
- d->dirty = true;
-}
-
-/*!
- \property QGLCameraAnimation::duration
- \brief the duration of the animation in milliseconds. The default
- value is 250 milliseconds.
-
- \sa easingCurve()
-*/
-
-int QGLCameraAnimation::duration() const
-{
- Q_D(const QGLCameraAnimation);
- return d->duration;
-}
-
-void QGLCameraAnimation::setDuration(int duration)
-{
- Q_D(QGLCameraAnimation);
- d->duration = duration;
-}
-
-/*!
- \property QGLCameraAnimation::easingCurve
- \brief the easing curve to use for the animation. The default
- value is a linear easing curve.
-
- \sa duration()
-*/
-
-QEasingCurve QGLCameraAnimation::easingCurve() const
-{
- Q_D(const QGLCameraAnimation);
- return d->easingCurve;
-}
-
-void QGLCameraAnimation::setEasingCurve(const QEasingCurve &easing)
-{
- Q_D(QGLCameraAnimation);
- d->easingCurve = easing;
-}
-
-/*!
- \internal
-*/
-void QGLCameraAnimation::updateCurrentTime(int currentTime)
-{
- Q_D(QGLCameraAnimation);
- if (!d->camera)
- return; // Nothing to do if no camera to modify.
- if (currentTime >= d->duration) {
- d->camera->setEye(d->endEye);
- d->camera->setUpVector(d->endUpVector);
- d->camera->setCenter(d->endCenter);
- } else if (currentTime <= 0) {
- d->camera->setEye(d->startEye);
- d->camera->setUpVector(d->startUpVector);
- d->camera->setCenter(d->startCenter);
- } else {
- // Derive the rotation parameters we need if arguments have changed.
- if (d->dirty) {
- d->dirty = false;
- d->deriveRotations();
- }
-
- // Calculate the progress and modify it with the easing curve.
- qreal progress = d->easingCurve.valueForProgress
- (qreal(currentTime) / qreal(d->duration));
-
- // Calculate the new eye and center locations.
- QVector3D eye = d->startEye;
- QVector3D center = d->startCenter;
- QVector3D upVector = d->startUpVector;
- if (d->pointOfRotation == QGLCameraAnimationPrivate::Center) {
- QQuaternion q = QQuaternion::fromAxisAndAngle
- (d->pointAxis, d->pointAngle * progress);
- eye = q.rotatedVector(eye - d->startCenter);
- if (d->lengthStart != d->lengthEnd) {
- qreal length = (1.0f - progress) * d->lengthStart +
- progress * d->lengthEnd;
- eye = eye.normalized() * length;
- }
- eye += d->startCenter;
- } else if (d->pointOfRotation == QGLCameraAnimationPrivate::CenterDual) {
- if (progress < 0.5f) {
- // First half of the animation - rotate the eye position.
- QQuaternion q = QQuaternion::fromAxisAndAngle
- (d->pointAxis, d->pointAngle * progress * 2.0f);
- eye = q.rotatedVector(eye - d->startCenter);
- if (d->lengthStart != d->lengthEnd) {
- qreal length = (1.0f - progress) * d->lengthStart +
- progress * d->lengthEnd;
- eye = eye.normalized() * length;
- }
- eye += d->startCenter;
- upVector = q.rotatedVector(upVector);
- } else {
- // Second half of the animation - rotate the up vector.
- QQuaternion q = QQuaternion::fromAxisAndAngle
- (d->upVectorAxis,
- d->upVectorAngle * (progress - 0.5f) * 2.0f) *
- QQuaternion::fromAxisAndAngle
- (d->pointAxis, d->pointAngle);
- eye = d->endEye;
- upVector = q.rotatedVector(upVector);
- }
- } else if (d->pointOfRotation == QGLCameraAnimationPrivate::Eye) {
- QQuaternion q = QQuaternion::fromAxisAndAngle
- (d->pointAxis, d->pointAngle * progress);
- center = q.rotatedVector(center - d->startEye);
- if (d->lengthStart != d->lengthEnd) {
- qreal length = (1.0f - progress) * d->lengthStart +
- progress * d->lengthEnd;
- center = center.normalized() * length;
- }
- center += d->startEye;
- } else if (d->pointOfRotation == QGLCameraAnimationPrivate::EyeDual) {
- if (progress < 0.5f) {
- // First half of the animation - rotate the center position.
- QQuaternion q = QQuaternion::fromAxisAndAngle
- (d->pointAxis, d->pointAngle * progress * 2.0f);
- center = q.rotatedVector(center - d->startEye);
- if (d->lengthStart != d->lengthEnd) {
- qreal length = (1.0f - progress) * d->lengthStart +
- progress * d->lengthEnd;
- center = center.normalized() * length;
- }
- center += d->startEye;
- upVector = q.rotatedVector(upVector);
- } else {
- // Second half of the animation - rotate the up vector.
- QQuaternion q = QQuaternion::fromAxisAndAngle
- (d->upVectorAxis,
- d->upVectorAngle * (progress - 0.5f) * 2.0f) *
- QQuaternion::fromAxisAndAngle
- (d->pointAxis, d->pointAngle);
- center = d->endCenter;
- upVector = q.rotatedVector(upVector);
- }
- } else {
- eye += d->eyeTranslate * progress;
- center += d->centerTranslate * progress;
- }
-
- // Calculate the new up vector for single-step animations.
- if (d->pointOfRotation != QGLCameraAnimationPrivate::CenterDual &&
- d->pointOfRotation != QGLCameraAnimationPrivate::EyeDual) {
- if (d->upVectorAngle != 0.0f) {
- QQuaternion q = QQuaternion::fromAxisAndAngle
- (d->upVectorAxis, d->upVectorAngle * progress);
- upVector = q.rotatedVector(upVector);
- }
- }
-
- d->camera->setEye(eye);
- d->camera->setUpVector(upVector);
- d->camera->setCenter(center);
- }
-}
-
-QT_END_NAMESPACE
diff --git a/src/threed/viewing/qglcameraanimation.h b/src/threed/viewing/qglcameraanimation.h
deleted file mode 100644
index e77e6a61..00000000
--- a/src/threed/viewing/qglcameraanimation.h
+++ /dev/null
@@ -1,116 +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 QGLCAMERAANIMATION_H
-#define QGLCAMERAANIMATION_H
-
-#include <QtCore/qabstractanimation.h>
-#include <QtCore/qeasingcurve.h>
-#include <QtGui/qvector3d.h>
-#include "qt3dglobal.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class QGLCamera;
-class QGLCameraAnimationPrivate;
-
-class Q_QT3D_EXPORT QGLCameraAnimation : public QAbstractAnimation
-{
- Q_OBJECT
- Q_PROPERTY(QGLCamera *camera READ camera WRITE setCamera)
- Q_PROPERTY(QVector3D startEye READ startEye WRITE setStartEye)
- Q_PROPERTY(QVector3D startUpVector READ startUpVector WRITE setStartUpVector)
- Q_PROPERTY(QVector3D startCenter READ startCenter WRITE setStartCenter)
- Q_PROPERTY(QVector3D endEye READ endEye WRITE setEndEye)
- Q_PROPERTY(QVector3D endUpVector READ endUpVector WRITE setEndUpVector)
- Q_PROPERTY(QVector3D endCenter READ endCenter WRITE setEndCenter)
- Q_PROPERTY(int duration READ duration WRITE setDuration)
- Q_PROPERTY(QEasingCurve easingCurve READ easingCurve WRITE setEasingCurve)
-public:
- explicit QGLCameraAnimation(QObject *parent = 0);
- ~QGLCameraAnimation();
-
- QGLCamera *camera() const;
- void setCamera(QGLCamera *camera);
-
- QVector3D startEye() const;
- void setStartEye(const QVector3D &eye);
-
- QVector3D startUpVector() const;
- void setStartUpVector(const QVector3D &upVector);
-
- QVector3D startCenter() const;
- void setStartCenter(const QVector3D &center);
-
- QVector3D endEye() const;
- void setEndEye(const QVector3D &eye);
-
- QVector3D endUpVector() const;
- void setEndUpVector(const QVector3D &upVector);
-
- QVector3D endCenter() const;
- void setEndCenter(const QVector3D &center);
-
- int duration() const;
- void setDuration(int duration);
-
- QEasingCurve easingCurve() const;
- void setEasingCurve(const QEasingCurve &easing);
-
-protected:
- void updateCurrentTime(int currentTime);
-
-private:
- QScopedPointer<QGLCameraAnimationPrivate> d_ptr;
-
- Q_DISABLE_COPY(QGLCameraAnimation)
- Q_DECLARE_PRIVATE(QGLCameraAnimation)
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/viewing/qglview.cpp b/src/threed/viewing/qglview.cpp
deleted file mode 100644
index f22314f1..00000000
--- a/src/threed/viewing/qglview.cpp
+++ /dev/null
@@ -1,1496 +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 "qglview.h"
-#include "qglframebufferobject.h"
-#include "qglsubsurface.h"
-#include "qglmaskedsurface_p.h"
-#include "qglwidgetsurface.h"
-#include "qgldrawbuffersurface_p.h"
-#include "qray3d.h"
-#include <QtGui/qevent.h>
-#include <QtCore/qmap.h>
-#include <QtGui/qapplication.h>
-#include <QtCore/qtimer.h>
-#include <QtCore/qdatetime.h>
-#include <QtCore/qdebug.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGLView
- \brief The QGLView class extends QGLWidget with support for 3D viewing.
- \since 4.8
- \ingroup qt3d
- \ingroup qt3d::viewing
-
- \section1 Navigating
-
- Navigation in 3D space is possible under keyboard and mouse control.
-
- Holding down the left mouse button and dragging it will rotate the
- camera() position around the object being viewed. Holding down the
- left mouse button and the Shift key pans the view in a plane without
- rotating the viewed object.
-
- Using the mouse wheel, the view can be zoomed in or out. If the
- system does not have a mouse wheel, then holding down the left mouse
- button and the Control key and moving the mouse up and down will
- also zoom in and out.
-
- On the keyboard, the left, right, up, and down keys can also be used
- to shift the camera() position around the object being viewed. Shift
- and Control modify keys the same way they modify the left mouse
- button above. Hitting the Home key will cause the camera position
- to be reset to its original position.
-
- \section1 Stereo viewing support
-
- Note - Stereo viewing is experimental and unsupported.
-
- If the hardware supports stereo buffers, then each time the scene needs
- to be painted, QGLView renders it twice: first from the perspective of
- the left eye, and then from the perspective of the right eye.
- The separation between the eye positions is specified by
- QGLCamera::eyeSeparation(). If the eye separation is zero,
- then stereo viewing is disabled and only a single image will
- be rendered per frame.
-
- Three kinds of stereo viewing are possible: hardware stereo,
- anaglyph stereo, and double image stereo.
-
- Hardware stereo relies upon specialized hardware that can render
- the left and right eye images into separate buffers and then show
- them independently to each eye through the use of polarized glasses
- or similar technology. Hardware stereo is used if the \c{-stereo-hw}
- command-line option is supplied or if the user explicitly requests
- stereo buffers when the QGLView is constructed:
-
- \code
- QGLFormat format(QGLFormat::defaultFormat());
- format.setOption(QGL::StereoBuffers);
- QGLView view(format);
- \endcode
-
- Anaglyph stereo is used when the hardware doesn't have specialized
- stereo buffer support. The left eye image is masked by a red
- filter and the right eye image is masked by a cyan filter. This makes
- the resulting images suitable for viewing with standard red-cyan
- anaglyph glasses.
-
- When using red-cyan anaglyphs, it is recommended that the
- scene use non-primary object colors. Pure primary colors such
- as red, green, and blue will only appear to one of the viewer's
- eyes and will inhibit the 3D effect. Non-primary colors or
- grayscale should be used to get the best effects.
-
- Red-cyan anaglyphs can be disorienting to some viewers. If hardware
- stereo is not available and stereo viewing is not critical to
- the application, then stereo can be disabled by setting
- QGLCamera::eyeSeparation() to zero.
-
- Double image stereo involves drawing the left and right eye
- images in a double-wide or double-high window, with the hardware
- combining the images. Four different configurations are available:
- LeftRight, RightLeft, TopBottom,
- and BottomTop, according to the layout of the eye images.
- Double image stereo is selected by calling setStereoType(). It is
- the responsibility of the application to resize the window to
- twice its normal size to accommodate the images.
-
- Ctrl-Left and Ctrl-Right can be used to make the eye separation
- smaller or larger under keyboard control.
-
- A number of command-line options are available to select the
- stereo mode of the QGLView so that the application does not
- need to select the mode itself:
-
- \table
- \row \o \c{-stereo-hw} \o \l Hardware.
- \row \o \c{-stereo-lr} \o LeftRight.
- \row \o \c{-stereo-rl} \o RightLeft.
- \row \o \c{-stereo-tb} \o TopBottom.
- \row \o \c{-stereo-bt} \o BottomTop.
- \row \o \c{-stereo-stretched-lr} \o StretchedLeftRight.
- \row \o \c{-stereo-stretched-rl} \o StretchedRightLeft.
- \row \o \c{-stereo-stretched-tb} \o StretchedTopBottom.
- \row \o \c{-stereo-stretched-bt} \o StretchedBottomTop.
- \endtable
-
- The option can also be supplied in the \c{Quick3D_OPTIONS} environment
- variable:
-
- \code
- $ Quick3D_OPTIONS="-stereo-lr" ./cubehouse
- \endcode
-
- If the application sets the stereo type with setStereoType(),
- that will be used. Next is the command-line setting, and finally
- the contents of the environment variable.
-*/
-
-/*!
- \enum QGLView::Option
- This enum defines an option for QGLView.
-
- \value ObjectPicking Object picking is enabled. Disabled by default.
- \value ShowPicking Objects are rendered with their pick colors instead
- of their normal colors and materials. This can help debug
- problems with object picking. Disabled by default.
- \value CameraNavigation Camera navigation using the keyboard and mouse
- is enabled. Enabled by default.
- \omitvalue PaintingLog
- \value FOVZoom Enables zooming by changing field of view instead of
- physically moving the camera.
-*/
-
-/*!
- \enum QGLView::StereoType
- This enum defines the type of stereo viewing technology being used by QGLView.
-
- \value Hardware Specialized stereo hardware is being used.
- \value RedCyanAnaglyph Stereo is being simulated for viewing by
- red-cyan anaglyph classes.
- \value LeftRight The view is double-wide with the left eye
- image on the left of the window.
- \value RightLeft The view is double-wide with the left eye
- image on the right of the window.
- \value TopBottom The view is double-high with the left eye
- image on the top of the window.
- \value BottomTop The view is double-high with the left eye
- image on the bottom of the window.
- \value StretchedLeftRight Same as LeftRight, but with the
- left and right eye images stretched to double their width.
- \value StretchedRightLeft Same as RightLeft, but with the
- left and right eye images stretched to double their width.
- \value StretchedTopBottom Same as TopBottom, but with the
- left and right eye images stretched to double their height.
- \value StretchedBottomTop Same as BottomTop, but with the
- left and right eye images stretched to double their height.
-*/
-
-class QGLViewPrivate
-{
-public:
- QGLViewPrivate(QGLView *parent)
- : view(parent), mainSurface(parent)
- {
- options = QGLView::CameraNavigation;
- fbo = 0;
- leftSurface = 0;
- rightSurface = 0;
-
- if (parent->format().stereo())
- stereoType = QGLView::Hardware;
- else
- stereoType = QGLView::RedCyanAnaglyph;
-
- pickBufferForceUpdate = true;
- pickBufferMaybeInvalid = true;
- updateQueued = false;
-
- pressedObject = 0;
- pressedButton = Qt::NoButton;
- enteredObject = 0;
-
- defaultCamera = new QGLCamera(parent);
- camera = defaultCamera;
-
- panning = false;
- startPan = QPoint(-1, -1);
- lastPan = QPoint(-1, -1);
- panModifiers = Qt::NoModifier;
- QObject::connect(defaultCamera, SIGNAL(projectionChanged()),
- parent, SLOT(cameraChanged()));
- QObject::connect(defaultCamera, SIGNAL(viewChanged()),
- parent, SLOT(cameraChanged()));
-
- logTime.start();
- lastFrameTime.start();
- QByteArray env = qgetenv("Quick3D_LOG_EVENTS");
- if (env == "1")
- options |= QGLView::PaintingLog;
- }
- ~QGLViewPrivate()
- {
- delete fbo;
- delete leftSurface;
- delete rightSurface;
- }
-
- QGLView *view;
- QGLView::Options options;
- QGLView::StereoType stereoType;
- QGLFramebufferObject *fbo;
- QGLWidgetSurface mainSurface;
- QGLAbstractSurface *leftSurface;
- QGLAbstractSurface *rightSurface;
- bool pickBufferForceUpdate;
- bool pickBufferMaybeInvalid;
- bool updateQueued;
- QMap<int, QObject *> objects;
- QObject *pressedObject;
- Qt::MouseButton pressedButton;
- QObject *enteredObject;
- QGLCamera *defaultCamera;
- QGLCamera *camera;
- bool panning;
- QPoint startPan;
- QPoint lastPan;
- QVector3D startEye;
- QVector3D startCenter;
- QVector3D startUpVector;
- Qt::KeyboardModifiers panModifiers;
- QTime logTime;
- QTime enterTime;
- QTime lastFrameTime;
-
- inline void logEnter(const char *message);
- inline void logLeave(const char *message);
-
- void processStereoOptions(QGLView *view);
- void processStereoOptions(QGLView *view, const QString &arg);
-
- QGLAbstractSurface *leftEyeSurface(const QSize &size);
- QGLAbstractSurface *rightEyeSurface(const QSize &size);
- QGLAbstractSurface *bothEyesSurface();
-};
-
-inline void QGLViewPrivate::logEnter(const char *message)
-{
- if ((options & QGLView::PaintingLog) == 0)
- return;
- int ms = logTime.elapsed();
- enterTime.start();
- int sinceLast = lastFrameTime.restart();
- qDebug("LOG[%d:%02d:%02d.%03d]: ENTER: %s (%d ms since last enter)",
- ms / 3600000, (ms / 60000) % 60,
- (ms / 1000) % 60, ms % 1000, message, sinceLast);
-}
-
-inline void QGLViewPrivate::logLeave(const char *message)
-{
- if ((options & QGLView::PaintingLog) == 0)
- return;
- int ms = logTime.elapsed();
- int duration = enterTime.elapsed();
- qDebug("LOG[%d:%02d:%02d.%03d]: LEAVE: %s (%d ms elapsed)",
- ms / 3600000, (ms / 60000) % 60,
- (ms / 1000) % 60, ms % 1000, message, duration);
-}
-
-static QString qt_gl_stereo_arg()
-{
- QStringList args = QApplication::arguments();
- foreach (QString arg, args) {
- if (arg.startsWith(QLatin1String("-stereo-")))
- return arg;
- }
- QByteArray options(qgetenv("Quick3D_OPTIONS"));
- args = QString::fromLocal8Bit
- (options.constData(), options.size()).split(QLatin1Char(' '));
- foreach (QString arg, args) {
- if (arg.startsWith(QLatin1String("-stereo-")))
- return arg;
- }
- return QString();
-}
-
-void QGLViewPrivate::processStereoOptions(QGLView *view)
-{
- if (stereoType == QGLView::Hardware)
- return;
- QString arg = qt_gl_stereo_arg();
- if (!arg.isEmpty())
- processStereoOptions(view, arg);
-}
-
-void QGLViewPrivate::processStereoOptions(QGLView *view, const QString &arg)
-{
- // If the command-line contains an option that starts with "-stereo-",
- // then convert it into options that define the size and type of
- // stereo window to use for a top-level QGLView. Possible options:
- //
- // hw - use hardware stereo
- // lr, rl, tb, bt - specify the eye order (default is left-right)
- // stretched - used stretched versions of double wide/high modes.
- //
- QStringList opts = arg.mid(8).split(QLatin1Char('-'));
- QGLView::StereoType stereoType;
- bool stretched = opts.contains(QLatin1String("stretched"));
- if (opts.contains(QLatin1String("rl"))) {
- stereoType = stretched ? QGLView::StretchedRightLeft : QGLView::RightLeft;
- } else if (opts.contains(QLatin1String("tb"))) {
- stereoType = stretched ? QGLView::StretchedTopBottom : QGLView::TopBottom;
- } else if (opts.contains(QLatin1String("bt"))) {
- stereoType = stretched ? QGLView::StretchedBottomTop : QGLView::BottomTop;
- } else {
- stereoType = stretched ? QGLView::StretchedLeftRight : QGLView::LeftRight;
- }
- view->setStereoType(stereoType);
-}
-
-class QGLViewSubsurface : public QGLSubsurface
-{
-public:
- QGLViewSubsurface(QGLAbstractSurface *surface, const QRect &region,
- qreal adjust)
- : QGLSubsurface(surface, region), m_adjust(adjust) {}
-
- qreal aspectRatio() const;
-
-private:
- qreal m_adjust;
-};
-
-qreal QGLViewSubsurface::aspectRatio() const
-{
- return QGLSubsurface::aspectRatio() * m_adjust;
-}
-
-// Returns the surface to use to render the left eye image.
-QGLAbstractSurface *QGLViewPrivate::leftEyeSurface(const QSize &size)
-{
- QRect viewport;
- qreal adjust = 1.0f;
- switch (stereoType) {
- case QGLView::Hardware:
-#if defined(GL_BACK_LEFT) && defined(GL_BACK_RIGHT)
- if (!leftSurface) {
- leftSurface = new QGLDrawBufferSurface
- (&mainSurface,
- view->doubleBuffer() ? GL_BACK_LEFT : GL_FRONT_LEFT);
- }
- return leftSurface;
-#endif
- case QGLView::RedCyanAnaglyph:
- if (!leftSurface) {
- leftSurface = new QGLMaskedSurface
- (&mainSurface,
- QGLMaskedSurface::RedMask | QGLMaskedSurface::AlphaMask);
- }
- return leftSurface;
- case QGLView::LeftRight:
- viewport = QRect(0, 0, size.width() / 2, size.height());
- break;
- case QGLView::RightLeft:
- viewport = QRect(size.width() / 2, 0, size.width() / 2, size.height());
- break;
- case QGLView::TopBottom:
- viewport = QRect(0, 0, size.width(), size.height() / 2);
- break;
- case QGLView::BottomTop:
- viewport = QRect(0, size.height() / 2, size.width(), size.height() / 2);
- break;
- case QGLView::StretchedLeftRight:
- viewport = QRect(0, 0, size.width() / 2, size.height());
- adjust = 2.0f;
- break;
- case QGLView::StretchedRightLeft:
- viewport = QRect(size.width() / 2, 0, size.width() / 2, size.height());
- adjust = 2.0f;
- break;
- case QGLView::StretchedTopBottom:
- viewport = QRect(0, 0, size.width(), size.height() / 2);
- adjust = 0.5f;
- break;
- case QGLView::StretchedBottomTop:
- viewport = QRect(0, size.height() / 2, size.width(), size.height() / 2);
- adjust = 0.5f;
- break;
- }
- if (!leftSurface) {
- if (adjust == 1.0f)
- leftSurface = new QGLSubsurface(&mainSurface, viewport);
- else
- leftSurface = new QGLViewSubsurface(&mainSurface, viewport, adjust);
- } else {
- static_cast<QGLSubsurface *>(leftSurface)->setRegion(viewport);
- }
- return leftSurface;
-}
-
-// Returns the surface to use to render the right eye image.
-QGLAbstractSurface *QGLViewPrivate::rightEyeSurface(const QSize &size)
-{
- QRect viewport;
- qreal adjust = 1.0f;
- switch (stereoType) {
- case QGLView::Hardware:
-#if defined(GL_BACK_LEFT) && defined(GL_BACK_RIGHT)
- if (!rightSurface) {
- rightSurface = new QGLDrawBufferSurface
- (&mainSurface,
- view->doubleBuffer() ? GL_BACK_RIGHT : GL_FRONT_RIGHT);
- }
- return rightSurface;
-#endif
- case QGLView::RedCyanAnaglyph:
- if (!rightSurface) {
- rightSurface = new QGLMaskedSurface
- (&mainSurface,
- QGLMaskedSurface::GreenMask | QGLMaskedSurface::BlueMask);
- }
- return rightSurface;
- case QGLView::LeftRight:
- viewport = QRect(size.width() / 2, 0, size.width() / 2, size.height());
- break;
- case QGLView::RightLeft:
- viewport = QRect(0, 0, size.width() / 2, size.height());
- break;
- case QGLView::TopBottom:
- viewport = QRect(0, size.height() / 2, size.width(), size.height() / 2);
- break;
- case QGLView::BottomTop:
- viewport = QRect(0, 0, size.width(), size.height() / 2);
- break;
- case QGLView::StretchedLeftRight:
- viewport = QRect(size.width() / 2, 0, size.width() / 2, size.height());
- adjust = 2.0f;
- break;
- case QGLView::StretchedRightLeft:
- viewport = QRect(0, 0, size.width() / 2, size.height());
- adjust = 2.0f;
- break;
- case QGLView::StretchedTopBottom:
- viewport = QRect(0, size.height() / 2, size.width(), size.height() / 2);
- adjust = 0.5f;
- break;
- case QGLView::StretchedBottomTop:
- viewport = QRect(0, 0, size.width(), size.height() / 2);
- adjust = 0.5f;
- break;
- }
- if (!rightSurface) {
- if (adjust == 1.0f)
- rightSurface = new QGLSubsurface(&mainSurface, viewport);
- else
- rightSurface = new QGLViewSubsurface(&mainSurface, viewport, adjust);
- } else {
- static_cast<QGLSubsurface *>(rightSurface)->setRegion(viewport);
- }
- return rightSurface;
-}
-
-// Returns a surface that can be used to render a non-stereoscopic
-// image into both eyes at the same time. Returns null if the eyes
-// must be rendered one at a time.
-QGLAbstractSurface *QGLViewPrivate::bothEyesSurface()
-{
- switch (stereoType) {
- case QGLView::Hardware:
-#if defined(GL_BACK_LEFT) && defined(GL_BACK_RIGHT)
- return 0;
-#endif
- case QGLView::RedCyanAnaglyph:
- return &mainSurface;
- default:
- return 0;
- }
-}
-
-static QGLFormat makeStereoGLFormat(const QGLFormat& format)
-{
-#if defined(GL_BACK_LEFT) && defined(GL_BACK_RIGHT)
- QGLFormat fmt(format);
- if (qt_gl_stereo_arg() == QLatin1String("-stereo-hw"))
- fmt.setOption(QGL::StereoBuffers);
- return fmt;
-#else
- QGLFormat fmt(format);
- fmt.setOption(QGL::NoStereoBuffers);
- return fmt;
-#endif
-}
-
-/*!
- Constructs a new view widget and attaches it to \a parent.
-
- This constructor will request a stereo rendering context if
- the hardware supports it.
-*/
-QGLView::QGLView(QWidget *parent)
- : QGLWidget(makeStereoGLFormat(QGLFormat::defaultFormat()), parent)
-{
- d = new QGLViewPrivate(this);
- setMouseTracking(true);
- if (!parent)
- d->processStereoOptions(this);
-}
-
-/*!
- Constructs a new view widget and attaches it to \a parent.
- The \a format argument specifies the desired QGLFormat
- rendering options.
-
- If \a format does not include the stereo option, then a stereo
- viewing context will not be requested.
-*/
-QGLView::QGLView(const QGLFormat& format, QWidget *parent)
- : QGLWidget(format, parent)
-{
- d = new QGLViewPrivate(this);
- setMouseTracking(true);
- if (!parent)
- d->processStereoOptions(this);
-}
-
-/*!
- Destroys this view widget.
-*/
-QGLView::~QGLView()
-{
- delete d;
-}
-
-/*!
- Returns the options for this view. The default value is
- CameraNavigation.
-
- \sa setOptions(), setOption()
-*/
-QGLView::Options QGLView::options() const
-{
- return d->options;
-}
-
-/*!
- Sets the options for this view to \a value.
-
- \sa options(), setOption()
-*/
-void QGLView::setOptions(QGLView::Options value)
-{
- d->options = value;
-}
-
-/*!
- Enables or disables \a option according to \a value.
-
- \sa options(), setOptions()
-*/
-void QGLView::setOption(QGLView::Option option, bool value)
-{
- if (value)
- d->options |= option;
- else
- d->options &= ~option;
-}
-
-/*!
- Returns the type of stereo viewing technology that is in use.
-
- \sa setStereoType()
-*/
-QGLView::StereoType QGLView::stereoType() const
-{
- return d->stereoType;
-}
-
-/*!
- Sets the \a type of stereo viewing technology that is in use.
- The request takes effect at the next repaint.
-
- The request is ignored stereoType() or \a type is Hardware,
- because hardware stereo can only be enabled if the hardware
- supports it, and then it can never be disabled.
-
- \sa stereoType()
-*/
-void QGLView::setStereoType(QGLView::StereoType type)
-{
- if (d->stereoType == Hardware || type == Hardware)
- return;
- if (d->stereoType == type)
- return;
- d->stereoType = type;
-
- // Destroy the current surface objects so that they will
- // be re-generated the next time we paint the widget.
- delete d->leftSurface;
- delete d->rightSurface;
- d->leftSurface = 0;
- d->rightSurface = 0;
-}
-
-/*!
- Registers an \a object with this view to be notified when
- \a objectId is selected with the mouse. The \a object must
- persist for the lifetime of the QGLView, or until
- deregisterObject() is called for \a objectId.
-
- \sa deregisterObject(), objectForPoint()
-*/
-void QGLView::registerObject(int objectId, QObject *object)
-{
- d->objects[objectId] = object;
-}
-
-/*!
- Deregisters the object associated with \a objectId.
-
- \sa registerObject()
-*/
-void QGLView::deregisterObject(int objectId)
-{
- d->objects.remove(objectId);
-}
-
-/*!
- Returns the camera parameters. The camera defines the projection
- to apply to convert eye co-ordinates into window co-ordinates,
- and the position and orientation of the viewer's eye.
-
- \sa setCamera()
-*/
-QGLCamera *QGLView::camera() const
-{
- return d->camera;
-}
-
-/*!
- Sets the camera parameters to \a value. The camera defines the
- projection to apply to convert eye co-ordinates into window
- co-ordinates, and the position and orientation of the viewer's eye.
-
- If \a value is null, then the default camera object will be used.
-
- This function will call update() to force the view to
- update with the new camera parameters upon the next event loop.
-
- \sa camera()
-*/
-void QGLView::setCamera(QGLCamera *value)
-{
- if (!value)
- value = d->defaultCamera;
-
- if (d->camera == value)
- return;
-
- disconnect(d->camera, SIGNAL(projectionChanged()),
- this, SLOT(cameraChanged()));
- disconnect(d->camera, SIGNAL(viewChanged()),
- this, SLOT(cameraChanged()));
-
- d->camera = value;
-
- connect(d->camera, SIGNAL(projectionChanged()),
- this, SLOT(cameraChanged()));
- connect(d->camera, SIGNAL(viewChanged()),
- this, SLOT(cameraChanged()));
-
- cameraChanged();
-}
-
-/*!
- Maps \a point from viewport co-ordinates to eye co-ordinates.
-
- The returned vector will have its x and y components set to the
- position of the point on the near plane, and the z component
- set to the inverse of the camera's near plane.
-
- This function is used for converting a mouse event's position
- into eye co-ordinates within the current camera view.
-
- \sa QGLCamera::mapPoint()
-*/
-QVector3D QGLView::mapPoint(const QPoint &point) const
-{
- QSize viewportSize(size());
- qreal aspectRatio;
-
- // Get the size of the underlying paint device.
- int width = viewportSize.width();
- int height = viewportSize.height();
-
- // Use the device's DPI setting to determine the pixel aspect ratio.
- int dpiX = logicalDpiX();
- int dpiY = logicalDpiY();
- if (dpiX <= 0 || dpiY <= 0)
- dpiX = dpiY = 1;
-
- // Derive the aspect ratio based on window and pixel size.
- if (width <= 0 || height <= 0)
- aspectRatio = 1.0f;
- else
- aspectRatio = ((qreal)(width * dpiY)) / ((qreal)(height * dpiX));
-
- // Map the point into eye co-ordinates.
- return d->camera->mapPoint(point, aspectRatio, viewportSize);
-}
-
-void QGLView::cameraChanged()
-{
- // The pick buffer will need to be refreshed at the new camera position.
- d->pickBufferForceUpdate = true;
-
- // Queue an update for the next event loop.
- update();
-}
-
-/*!
- \internal
-*/
-void QGLView::initializeGL()
-{
- d->logEnter("QGLView::initializeGL");
- QGLPainter painter;
- painter.begin();
-
- // Set the default depth buffer options.
- glEnable(GL_DEPTH_TEST);
- glDepthFunc(GL_LESS);
- glDepthMask(GL_TRUE);
-#if defined(QT_OPENGL_ES)
- glDepthRangef(0.0f, 1.0f);
-#else
- glDepthRange(0.0f, 1.0f);
-#endif
-
- // Set the default blend options.
- 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);
-
- glDisable(GL_CULL_FACE);
- initializeGL(&painter);
- d->logLeave("QGLView::initializeGL");
-}
-
-/*!
- \internal
-*/
-void QGLView::resizeGL(int w, int h)
-{
- // Set up the standard viewport for the new window size.
- glViewport(0, 0, w, h);
-
- // We will need to regenerate the pick buffer.
- d->pickBufferForceUpdate = true;
-}
-
-/*!
- \internal
-*/
-void QGLView::paintGL()
-{
- d->logEnter("QGLView::paintGL");
- // We may need to regenerate the pick buffer on the next mouse event.
- d->pickBufferMaybeInvalid = true;
-
- // Paint the scene contents.
- QGLPainter painter;
- QGLAbstractSurface *surface;
- painter.begin();
- if (d->options & QGLView::ShowPicking &&
- d->stereoType == QGLView::RedCyanAnaglyph) {
- // If showing picking, then render normally. This really
- // only works if we aren't using hardware or double stereo.
- painter.setPicking(true);
- painter.clearPickObjects();
- painter.setEye(QGL::NoEye);
- earlyPaintGL(&painter);
- painter.setCamera(d->camera);
- paintGL(&painter);
- painter.setPicking(false);
- } else if (d->camera->eyeSeparation() == 0.0f &&
- (surface = d->bothEyesSurface()) != 0) {
- // No camera separation, so render the same image into both buffers.
- painter.pushSurface(surface);
- painter.setEye(QGL::NoEye);
- earlyPaintGL(&painter);
- painter.setCamera(d->camera);
- paintGL(&painter);
- painter.popSurface();
- } else {
- // Paint the scene twice, from the perspective of each camera.
- QSize size(this->size());
- painter.setEye(QGL::LeftEye);
- if (d->stereoType != QGLView::Hardware)
- earlyPaintGL(&painter); // Clear both eyes at the same time.
- painter.pushSurface(d->leftEyeSurface(size));
- if (d->stereoType == QGLView::Hardware)
- earlyPaintGL(&painter); // Clear the left eye only.
- earlyPaintGL(&painter);
- painter.setCamera(d->camera);
- paintGL(&painter);
- if (d->stereoType == QGLView::RedCyanAnaglyph)
- glClear(GL_DEPTH_BUFFER_BIT);
- painter.setEye(QGL::RightEye);
- painter.setSurface(d->rightEyeSurface(size));
- if (d->stereoType == QGLView::Hardware)
- earlyPaintGL(&painter); // Clear the right eye only.
- painter.setCamera(d->camera);
- paintGL(&painter);
- painter.popSurface();
- }
- d->logLeave("QGLView::paintGL");
-}
-
-/*!
- Initializes the current GL context represented by \a painter.
-
- \sa paintGL()
-*/
-void QGLView::initializeGL(QGLPainter *painter)
-{
- Q_UNUSED(painter);
-}
-
-/*!
- Performs early painting operations just after \a painter
- is initialized but before the camera is set up. The default
- implementation clears the color buffer and depth buffer.
-
- This function is typically overridden to draw scene backdrops
- on the color buffer before the rest of the scene is drawn
- by paintGL().
-
- \sa paintGL()
-*/
-void QGLView::earlyPaintGL(QGLPainter *painter)
-{
- Q_UNUSED(painter);
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-}
-
-/*!
- \fn void QGLView::paintGL(QGLPainter *painter)
-
- Paints the scene onto \a painter. The color and depth buffers
- will have already been cleared, and the camera() position set.
-
- If QGLPainter::isPicking() is set for \a painter, then the
- function should paint the scene onto \a painter in
- "object picking mode". The scene will be rendered into a
- background buffer using flat colors so that mouse events
- can determine which object lies under the mouse pointer.
-
- The default implementation of picking will typically just
- render the scene normally. However, some applications
- may wish to render a simpler scene that omits unselectable
- objects and uses simpler meshes for the selectable objects.
-
- \sa earlyPaintGL()
-*/
-
-/*!
- Processes the mouse press event \a e.
-*/
-void QGLView::mousePressEvent(QMouseEvent *e)
-{
- QObject *object;
- if (!d->panning && (d->options & QGLView::ObjectPicking) != 0)
- object = objectForPoint(e->pos());
- else
- object = 0;
- if (d->pressedObject) {
- // Send the press event to the pressed object. Use a position
- // of (0, 0) if the mouse is still within the pressed object,
- // or (-1, -1) if the mouse is no longer within the pressed object.
- QMouseEvent event
- (QEvent::MouseButtonPress,
- (d->pressedObject == object) ? QPoint(0, 0) : QPoint(-1, -1),
- e->globalPos(), e->button(), e->buttons(), e->modifiers());
- QCoreApplication::sendEvent(d->pressedObject, &event);
- } else if (object) {
- // Record the object that was pressed and forward the event.
- d->pressedObject = object;
- d->enteredObject = 0;
- d->pressedButton = e->button();
-
- // Send a mouse press event for (0, 0).
- QMouseEvent event(QEvent::MouseButtonPress, QPoint(0, 0),
- e->globalPos(), e->button(), e->buttons(),
- e->modifiers());
- QCoreApplication::sendEvent(object, &event);
- } else if ((d->options & QGLView::CameraNavigation) != 0 &&
- e->button() == Qt::LeftButton) {
- d->panning = true;
- d->lastPan = d->startPan = e->pos();
- d->startEye = d->camera->eye();
- d->startCenter = d->camera->center();
- d->startUpVector = d->camera->upVector();
- d->panModifiers = e->modifiers();
-#ifndef QT_NO_CURSOR
- setCursor(Qt::ClosedHandCursor);
-#endif
- }
- QGLWidget::mousePressEvent(e);
-}
-
-/*!
- Processes the mouse release event \a e.
-*/
-void QGLView::mouseReleaseEvent(QMouseEvent *e)
-{
- if (d->panning && e->button() == Qt::LeftButton) {
- d->panning = false;
-#ifndef QT_NO_CURSOR
- unsetCursor();
-#endif
- }
- if (d->pressedObject) {
- // Notify the previously pressed object about the release.
- QObject *object = objectForPoint(e->pos());
- QObject *pressed = d->pressedObject;
- if (e->button() == d->pressedButton) {
- d->pressedObject = 0;
- d->pressedButton = Qt::NoButton;
- d->enteredObject = object;
-
- // Send the release event to the pressed object. Use a position
- // of (0, 0) if the mouse is still within the pressed object,
- // or (-1, -1) if the mouse is no longer within the pressed object.
- QMouseEvent event
- (QEvent::MouseButtonRelease,
- (pressed == object) ? QPoint(0, 0) : QPoint(-1, -1),
- e->globalPos(), e->button(), e->buttons(), e->modifiers());
- QCoreApplication::sendEvent(pressed, &event);
-
- // Send leave and enter events if necessary.
- if (object != pressed) {
- sendLeaveEvent(pressed);
- if (object)
- sendEnterEvent(object);
- }
- } else {
- // Some other button than the original was released.
- // Forward the event to the pressed object.
- QMouseEvent event
- (QEvent::MouseButtonRelease,
- (pressed == object) ? QPoint(0, 0) : QPoint(-1, -1),
- e->globalPos(), e->button(), e->buttons(), e->modifiers());
- QCoreApplication::sendEvent(pressed, &event);
- }
- }
- QGLWidget::mouseReleaseEvent(e);
-}
-
-/*!
- Processes the mouse double click event \a e.
-*/
-void QGLView::mouseDoubleClickEvent(QMouseEvent *e)
-{
- if ((d->options & QGLView::ObjectPicking) != 0) {
- QObject *object = objectForPoint(e->pos());
- if (object) {
- // Simulate a double click event for (0, 0).
- QMouseEvent event
- (QEvent::MouseButtonDblClick, QPoint(0, 0),
- e->globalPos(), e->button(), e->buttons(), e->modifiers());
- QCoreApplication::sendEvent(object, &event);
- }
- }
- QGLWidget::mouseDoubleClickEvent(e);
-}
-
-/*!
- Processes the mouse move event \a e.
-*/
-void QGLView::mouseMoveEvent(QMouseEvent *e)
-{
- if (d->panning) {
- QPoint delta = e->pos() - d->startPan;
- if (e->modifiers() == d->panModifiers) {
- d->camera->setEye(d->startEye);
- d->camera->setCenter(d->startCenter);
- d->camera->setUpVector(d->startUpVector);
- } else {
- d->startPan = d->lastPan;
- delta = e->pos() - d->startPan;
- d->startEye = d->camera->eye();
- d->startCenter = d->camera->center();
- d->startUpVector = d->camera->upVector();
- d->panModifiers = e->modifiers();
- }
- d->lastPan = e->pos();
- if ((e->modifiers() & Qt::ControlModifier) != 0)
- wheel(delta.y() * -60);
- else if ((e->modifiers() & Qt::ShiftModifier) != 0)
- pan(delta.x(), delta.y());
- else
- rotate(delta.x(), delta.y());
- } else if ((d->options & QGLView::ObjectPicking) != 0) {
- QObject *object = objectForPoint(e->pos());
- if (d->pressedObject) {
- // Send the move event to the pressed object. Use a position
- // of (0, 0) if the mouse is still within the pressed object,
- // or (-1, -1) if the mouse is no longer within the pressed object.
- QMouseEvent event
- (QEvent::MouseMove,
- (d->pressedObject == object) ? QPoint(0, 0) : QPoint(-1, -1),
- e->globalPos(), e->button(), e->buttons(), e->modifiers());
- QCoreApplication::sendEvent(d->pressedObject, &event);
- } else if (object) {
- if (object != d->enteredObject) {
- if (d->enteredObject)
- sendLeaveEvent(d->enteredObject);
- d->enteredObject = object;
- sendEnterEvent(d->enteredObject);
- }
- QMouseEvent event
- (QEvent::MouseMove, QPoint(0, 0),
- e->globalPos(), e->button(), e->buttons(), e->modifiers());
- QCoreApplication::sendEvent(object, &event);
- } else if (d->enteredObject) {
- sendLeaveEvent(d->enteredObject);
- d->enteredObject = 0;
- }
- }
- QGLWidget::mouseMoveEvent(e);
-}
-
-/*!
- Processes the leave event \a e.
-*/
-void QGLView::leaveEvent(QEvent *e)
-{
- if (!d->pressedObject && d->enteredObject) {
- sendLeaveEvent(d->enteredObject);
- d->enteredObject = 0;
- }
- QGLWidget::leaveEvent(e);
-}
-
-#ifndef QT_NO_WHEELEVENT
-
-/*!
- Processes the wheel event \a e.
-*/
-void QGLView::wheelEvent(QWheelEvent *e)
-{
- if ((d->options & QGLView::CameraNavigation) != 0)
- wheel(e->delta());
- QGLWidget::wheelEvent(e);
-}
-
-#endif
-
-/*!
- Processes the key press event \a e.
-*/
-void QGLView::keyPressEvent(QKeyEvent *e)
-{
- QGLCamera *camera;
- qreal sep;
-
- if ((d->options & QGLView::CameraNavigation) == 0) {
- QGLWidget::keyPressEvent(e);
- return;
- }
- switch (e->key()) {
-
- case Qt::Key_Escape:
- case Qt::Key_Q:
- {
- if (parentWidget() == 0)
- close();
- }
-
- case Qt::Key_Left:
- {
- if ((e->modifiers() & Qt::ShiftModifier) != 0) {
- pan(-10, 0);
- } else if ((e->modifiers() & Qt::ControlModifier) != 0) {
- camera = this->camera();
- sep = camera->eyeSeparation();
- sep -= (sep / 10.0f);
- if (sep < 0.0f)
- sep = 0.0f;
- camera->setEyeSeparation(sep);
- e->accept();
- return;
- } else {
- rotate(-10, 0);
- }
- }
- break;
-
- case Qt::Key_Right:
- {
- if ((e->modifiers() & Qt::ShiftModifier) != 0) {
- pan(10, 0);
- } else if ((e->modifiers() & Qt::ControlModifier) != 0) {
- camera = this->camera();
- sep = camera->eyeSeparation();
- sep += (sep / 10.0f);
- camera->setEyeSeparation(sep);
- e->accept();
- return;
- } else {
- rotate(10, 0);
- }
- }
- break;
-
- case Qt::Key_Up:
- {
- if ((e->modifiers() & Qt::ControlModifier) != 0)
- wheel(120);
- else if ((e->modifiers() & Qt::ShiftModifier) != 0)
- pan(0, -10);
- else
- rotate(0, -10);
- }
- break;
-
- case Qt::Key_Down:
- {
- if ((e->modifiers() & Qt::ControlModifier) != 0)
- wheel(-120);
- else if ((e->modifiers() & Qt::ShiftModifier) != 0)
- pan(0, 10);
- else
- rotate(0, 10);
- }
- break;
- }
- QGLWidget::keyPressEvent(e);
-}
-
-class QGLViewPickSurface : public QGLAbstractSurface
-{
-public:
- QGLViewPickSurface(QGLView *view, QGLFramebufferObject *fbo,
- const QSize &areaSize);
-
- QPaintDevice *device() const;
- bool activate(QGLAbstractSurface *prevSurface);
- void deactivate(QGLAbstractSurface *nextSurface);
- QRect viewportGL() const;
-
-private:
- QGLView *m_view;
- QGLFramebufferObject *m_fbo;
- QRect m_viewportGL;
-};
-
-QGLViewPickSurface::QGLViewPickSurface
- (QGLView *view, QGLFramebufferObject *fbo, const QSize &areaSize)
- : QGLAbstractSurface(504)
- , m_view(view)
- , m_fbo(fbo)
- , m_viewportGL(QPoint(0, 0), areaSize)
-{
-}
-
-QPaintDevice *QGLViewPickSurface::device() const
-{
- return m_view;
-}
-
-bool QGLViewPickSurface::activate(QGLAbstractSurface *prevSurface)
-{
- Q_UNUSED(prevSurface);
- if (m_fbo)
- m_fbo->bind();
- return true;
-}
-
-void QGLViewPickSurface::deactivate(QGLAbstractSurface *nextSurface)
-{
- Q_UNUSED(nextSurface);
- if (m_fbo)
- m_fbo->release();
-}
-
-QRect QGLViewPickSurface::viewportGL() const
-{
- return m_viewportGL;
-}
-
-/*!
- Returns the registered object that is under the mouse position
- specified by \a point. This function may need to regenerate
- the contents of the pick buffer by repainting the scene
- with paintGL().
-
- \sa registerObject()
-*/
-QObject *QGLView::objectForPoint(const QPoint &point)
-{
- QPoint pt(point);
-
- // What is the size of the drawing area after correcting for stereo?
- // Also adjust the mouse position to always be in the left half.
- QSize areaSize = size();
- switch (d->stereoType) {
- case QGLView::LeftRight:
- case QGLView::RightLeft:
- areaSize = QSize(areaSize.width() / 2, areaSize.height());
- if (pt.x() >= areaSize.width())
- pt.setX(pt.x() - areaSize.width());
- break;
- case QGLView::TopBottom:
- case QGLView::BottomTop:
- areaSize = QSize(areaSize.width(), areaSize.height() / 2);
- if (pt.y() >= areaSize.height())
- pt.setY(pt.y() - areaSize.height());
- break;
- case QGLView::StretchedLeftRight:
- case QGLView::StretchedRightLeft: {
- int halfwid = areaSize.width() / 2;
- if (pt.x() >= halfwid)
- pt.setX((pt.x() - halfwid) * 2);
- else
- pt.setX(pt.x() * 2);
- break; }
- case QGLView::StretchedTopBottom:
- case QGLView::StretchedBottomTop: {
- int halfht = areaSize.height() / 2;
- if (pt.y() >= halfht)
- pt.setY((pt.y() - halfht) * 2);
- else
- pt.setY(pt.y() * 2);
- break; }
- default: break;
- }
-
- // Check the area boundaries in case a mouse move has
- // moved the pointer outside the window.
- if (pt.x() < 0 || pt.x() >= areaSize.width() ||
- pt.y() < 0 || pt.y() >= areaSize.height())
- return 0;
-
- // Do we need to refresh the pick buffer contents?
- QGLPainter painter(this);
- if (d->pickBufferForceUpdate) {
- // Initialize the painter, which will make the window context current.
- painter.setPicking(true);
- painter.clearPickObjects();
-
- // Create a framebuffer object as big as the window to act
- // as the pick buffer if we are single buffered. If we are
- // double-buffered, then use the window back buffer.
- bool useBackBuffer = doubleBuffer();
- if (!useBackBuffer) {
- QSize fbosize = QGL::nextPowerOfTwo(areaSize);
- if (!d->fbo) {
- d->fbo = new QGLFramebufferObject(fbosize, QGLFramebufferObject::CombinedDepthStencil);
- } else if (d->fbo->size() != fbosize) {
- delete d->fbo;
- d->fbo = new QGLFramebufferObject(fbosize, QGLFramebufferObject::CombinedDepthStencil);
- }
- }
-
- // Render the pick version of the scene.
- QGLViewPickSurface surface(this, d->fbo, areaSize);
- painter.pushSurface(&surface);
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- painter.setEye(QGL::NoEye);
- painter.setCamera(d->camera);
- paintGL(&painter);
- painter.setPicking(false);
- painter.popSurface();
-
- // The pick buffer contents are now valid, unless we are using
- // the back buffer - we cannot rely upon it being valid next time.
- d->pickBufferForceUpdate = useBackBuffer;
- d->pickBufferMaybeInvalid = false;
- }
-
- // Pick the object under the mouse.
- if (d->fbo)
- d->fbo->bind();
- int objectId = painter.pickObject(pt.x(), areaSize.height() - 1 - pt.y());
- QObject *object = d->objects.value(objectId, 0);
- if (d->fbo)
- d->fbo->release();
-
- // Release the framebuffer object and return.
- painter.end();
- doneCurrent();
- return object;
-}
-
-void QGLView::sendEnterEvent(QObject *object)
-{
- QEvent event(QEvent::Enter);
- QCoreApplication::sendEvent(object, &event);
-}
-
-void QGLView::sendLeaveEvent(QObject *object)
-{
- QEvent event(QEvent::Leave);
- QCoreApplication::sendEvent(object, &event);
-}
-
-// Zoom in and out according to the change in wheel delta.
-void QGLView::wheel(int delta)
-{
- if (d->options & QGLView::FOVZoom) {
- //Use field-of view as zoom (much like a traditional camera)
- qreal scale = qAbs(viewDelta(delta, delta).x());
- if (delta < 0)
- scale = -scale;
- if (scale >= 0.0f)
- scale += 1.0f;
- else
- scale = 1.0f / (1.0f - scale);
- qreal fov = d->camera->fieldOfView();
- if (fov != 0.0f)
- d->camera->setFieldOfView(d->camera->fieldOfView() / scale);
- else
- d->camera->setViewSize(d->camera->viewSize() / scale);
- } else {
- // enable this to get wheel navigation that actually zooms by moving the
- // camera back, as opposed to making the angle of view wider.
- QVector3D viewVector= camera()->eye() - camera()->center();
- qreal zoomMag = viewVector.length();
- qreal zoomIncrement = -float(delta) / 100.0f;
- if (!qFuzzyIsNull(zoomIncrement))
- {
- zoomMag += zoomIncrement;
- if (zoomMag < 1.0f)
- zoomMag = 1.0f;
-
- QRay3D viewLine(camera()->center(), viewVector.normalized());
- camera()->setEye(viewLine.point(zoomMag));
- }
- }
-
-}
-
-// Pan left/right/up/down without rotating about the object.
-void QGLView::pan(int deltax, int deltay)
-{
- QPointF delta = viewDelta(deltax, deltay);
- QVector3D t = d->camera->translation(delta.x(), -delta.y(), 0.0f);
-
- // Technically panning the eye left should make the object appear to
- // move off to the right, but this looks weird on-screen where the user
- // actually thinks they are picking up the object and dragging it rather
- // than moving the eye. We therefore apply the inverse of the translation
- // to make it "look right".
- d->camera->setEye(d->camera->eye() - t);
- d->camera->setCenter(d->camera->center() - t);
-}
-
-// Rotate about the object being viewed.
-void QGLView::rotate(int deltax, int deltay)
-{
- int rotation = d->camera->screenRotation();
- if (rotation == 90 || rotation == 270) {
- qSwap(deltax, deltay);
- }
- if (rotation == 90 || rotation == 180) {
- deltax = -deltax;
- }
- if (rotation == 180 || rotation == 270) {
- deltay = -deltay;
- }
- qreal anglex = deltax * 90.0f / width();
- qreal angley = deltay * 90.0f / height();
- QQuaternion q = d->camera->pan(-anglex);
- q *= d->camera->tilt(-angley);
- d->camera->rotateCenter(q);
-}
-
-/*!
- Converts \a deltax and \a deltay into percentages of the
- view width and height. Returns a QPointF containing the
- percentage values, typically between -1 and 1.
-
- This function is typically used by subclasses to convert a
- change in mouse position into a relative distance travelled
- across the field of view.
-
- The returned value is corrected for the camera() screen
- rotation and view size.
-*/
-QPointF QGLView::viewDelta(int deltax, int deltay) const
-{
- int w = width();
- int h = height();
- bool scaleToWidth;
- qreal scaleFactor, scaleX, scaleY;
- QSizeF viewSize = d->camera->viewSize();
- if (w >= h) {
- if (viewSize.width() >= viewSize.height())
- scaleToWidth = true;
- else
- scaleToWidth = false;
- } else {
- if (viewSize.width() >= viewSize.height())
- scaleToWidth = false;
- else
- scaleToWidth = true;
- }
- int rotation = d->camera->screenRotation();
- if (rotation == 90 || rotation == 270) {
- scaleToWidth = !scaleToWidth;
- qSwap(deltax, deltay);
- }
- if (rotation == 90 || rotation == 180) {
- deltax = -deltax;
- }
- if (rotation == 180 || rotation == 270) {
- deltay = -deltay;
- }
- if (scaleToWidth) {
- scaleFactor = 2.0f / viewSize.width();
- scaleX = scaleFactor * ((qreal)h) / ((qreal)w);
- scaleY = scaleFactor;
- } else {
- scaleFactor = 2.0f / viewSize.height();
- scaleX = scaleFactor;
- scaleY = scaleFactor * ((qreal)w) / ((qreal)h);
- }
- return QPointF(deltax * scaleX / w, deltay * scaleY / h);
-}
-
-/*!
- \fn QPointF QGLView::viewDelta(const QPoint &delta) const
- \overload
-
- Converts the x and y components of \a delta into percentages
- of the view width and height. Returns a QPointF containing
- the percentage values, typically between -1 and 1.
-*/
-
-
-QT_END_NAMESPACE
diff --git a/src/threed/viewing/qglview.h b/src/threed/viewing/qglview.h
deleted file mode 100644
index 444854d9..00000000
--- a/src/threed/viewing/qglview.h
+++ /dev/null
@@ -1,146 +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 QGLVIEW_H
-#define QGLVIEW_H
-
-#include "qglpainter.h"
-#include "qglcamera.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Qt3D)
-
-class QGLViewPrivate;
-
-class Q_QT3D_EXPORT QGLView : public QGLWidget
-{
- Q_OBJECT
-public:
- explicit QGLView(QWidget *parent=0);
- explicit QGLView(const QGLFormat& format, QWidget *parent=0);
- ~QGLView();
-
- enum Option
- {
- ObjectPicking = 0x0001,
- ShowPicking = 0x0002,
- CameraNavigation = 0x0004,
- PaintingLog = 0x0008,
- FOVZoom = 0x0010
- };
- Q_DECLARE_FLAGS(Options, Option)
-
- QGLView::Options options() const;
- void setOptions(QGLView::Options value);
- void setOption(QGLView::Option option, bool value);
-
- enum StereoType
- {
- Hardware,
- RedCyanAnaglyph,
- LeftRight,
- RightLeft,
- TopBottom,
- BottomTop,
- StretchedLeftRight,
- StretchedRightLeft,
- StretchedTopBottom,
- StretchedBottomTop
- };
-
- QGLView::StereoType stereoType() const;
- void setStereoType(QGLView::StereoType type);
-
- void registerObject(int objectId, QObject *object);
- void deregisterObject(int objectId);
- QObject *objectForPoint(const QPoint &point);
-
- QGLCamera *camera() const;
- void setCamera(QGLCamera *camera);
-
- QVector3D mapPoint(const QPoint &point) const;
-
-protected:
- void initializeGL();
- void resizeGL(int w, int h);
- void paintGL();
- virtual void initializeGL(QGLPainter *painter);
- virtual void earlyPaintGL(QGLPainter *painter);
- virtual void paintGL(QGLPainter *painter) = 0;
-
- void mousePressEvent(QMouseEvent *e);
- void mouseReleaseEvent(QMouseEvent *e);
- void mouseDoubleClickEvent(QMouseEvent *e);
- void mouseMoveEvent(QMouseEvent *e);
- void leaveEvent(QEvent *e);
-#ifndef QT_NO_WHEELEVENT
- void wheelEvent(QWheelEvent *e);
-#endif
- void keyPressEvent(QKeyEvent *e);
-
- QPointF viewDelta(int deltax, int deltay) const;
- QPointF viewDelta(const QPoint &delta) const
- { return viewDelta(delta.x(), delta.y()); }
-
-private Q_SLOTS:
- void cameraChanged();
-
-private:
- QGLViewPrivate *d;
-
- static void sendEnterEvent(QObject *object);
- static void sendLeaveEvent(QObject *object);
-
- void wheel(int delta);
- void pan(int deltax, int deltay);
- void rotate(int deltax, int deltay);
-};
-
-Q_DECLARE_OPERATORS_FOR_FLAGS(QGLView::Options)
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/src/threed/viewing/viewing.pri b/src/threed/viewing/viewing.pri
deleted file mode 100644
index a6d7f7fd..00000000
--- a/src/threed/viewing/viewing.pri
+++ /dev/null
@@ -1,12 +0,0 @@
-INCLUDEPATH += $$PWD
-VPATH += $$PWD
-
-HEADERS += \
- viewing/qglcamera.h \
- viewing/qglcameraanimation.h \
- viewing/qglview.h
-
-SOURCES += \
- qglcamera.cpp \
- qglcameraanimation.cpp \
- qglview.cpp
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro
deleted file mode 100644
index 876fd153..00000000
--- a/tests/auto/auto.pro
+++ /dev/null
@@ -1,2 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS = threed qml3d
diff --git a/tests/auto/qml3d/QtQuickTest/TestCase.qml b/tests/auto/qml3d/QtQuickTest/TestCase.qml
deleted file mode 100644
index 49cb73c4..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 Qt 4.7
-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 bdfa7f1b..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 Qt 4.7
-import Qt3D 1.0
-import QtQuickTest 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 8689fd6a..00000000
--- a/tests/auto/qml3d/item3d/tst_item3d.qml
+++ /dev/null
@@ -1,400 +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
-import QtQuickTest 1.0
-
-Viewport {
- id: viewport
-
- Item3DClicker {
- id: mouseClicker
- }
-
- 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()
- {
- verify(item.position.x == 0, "Default position x");
- verify(item.position.y == 0, "Default position y");
- verify(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");
- }
-
- function test_x()
- {
- 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()
- {
- 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()
- {
- 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");
-
- 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");
-
- mouseClicker.click(inheritEventTestChild);
- compare(item.onClickedSignalTriggered, false,
- "no parent event when inheritEvents is false");
-
- item.inheritEvents = true;
- verify(item.inheritEvents, "setInheritEvents()");
- mouseClicker.click(inheritEventTestChild);
- 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_states()
- {
-
- }
-
- 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 66982035..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 Qt 4.7
-import Qt3D 1.0
-import QtQuickTest 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 55fc2e45..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 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
-
-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 574a1def..00000000
--- a/tests/auto/qml3d/lookat/tst_lookat.qml
+++ /dev/null
@@ -1,194 +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
-import QtQuickTest 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();
-
- // 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 bab75140..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 Qt 4.7
-import Qt3D 1.0
-import QtQuickTest 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 2b7fa0e1..00000000
--- a/tests/auto/qml3d/modelview/tst_modelview.qml
+++ /dev/null
@@ -1,270 +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
-import Qt3D.Shapes 1.0
-import QtQuickTest 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;
-
- 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() {
- 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;
-
- 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");
-
- 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 94ee6553..00000000
--- a/tests/auto/qml3d/picking/tst_picking.qml
+++ /dev/null
@@ -1,193 +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
-import Qt3D.Shapes 1.0
-import QtQuickTest 1.0
-
-Rectangle
-{
- id: topLevel
- width: 480; height: 480
-
- Viewport {
- id: viewport
- width: 480; height: 480
- picking: true
-
- // Result of manual click
- property color clickedColor: "#000000"
-
- Quad {
- id: fullScreenQuad
-
- transform: [
- Rotation3D {
- axis: Qt.vector3d(1,0,0);
- angle: 90
- },
- Scale3D {
- // a scale 4 quad will fill a square viewport
- scale: 4
- }
- ]
- position: Qt.vector3d(0, 0, 0)
- property color color: "#ff0000"
-
- effect: Effect {
- color: fullScreenQuad.color
- }
-
- onClicked: {
- viewport.clickedColor = 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
- }
-
- onClicked: {
- viewport.clickedColor = 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() {
- verify(!timedOut, "timed out");
- 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 4da6138c..00000000
--- a/tests/auto/qml3d/qml3d.pro
+++ /dev/null
@@ -1,23 +0,0 @@
-load(qttest_p4.prf)
-TEMPLATE=app
-CONFIG += unittest warn_on
-QT += declarative opengl
-SOURCES += tst_qml3d.cpp
-DEFINES += QML3D_TEST_SOURCE_DIR=\"\\\"$$PWD\\\"\"
-win32:DEFINES+=_CRT_SECURE_NO_WARNINGS
-
-OTHER_FILES += \
- lookat/tst_lookat.qml \
- QtQuickTest/TestCase.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
-
-
diff --git a/tests/auto/qml3d/scale3d/tst_scale3d.qml b/tests/auto/qml3d/scale3d/tst_scale3d.qml
deleted file mode 100644
index 2759e578..00000000
--- a/tests/auto/qml3d/scale3d/tst_scale3d.qml
+++ /dev/null
@@ -1,109 +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
-import QtQuickTest 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() {
- 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() {
- 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() {
- 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() {
- 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/shaders/test.png b/tests/auto/qml3d/shaders/test.png
deleted file mode 100644
index 80a4868f..00000000
--- a/tests/auto/qml3d/shaders/test.png
+++ /dev/null
Binary files differ
diff --git a/tests/auto/qml3d/shaders/tst_shaders.qml b/tests/auto/qml3d/shaders/tst_shaders.qml
deleted file mode 100644
index 2a4258af..00000000
--- a/tests/auto/qml3d/shaders/tst_shaders.qml
+++ /dev/null
@@ -1,136 +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
-import Qt3D.Shapes 1.0
-import QtQuickTest 1.0
-
-Viewport {
- id: viewport
-
- width: 480
- height: 320
-
- property string fragmentShader: "\
-\
- void main(void)\
- {\
- gl_FragColor = vec4(1,0,1,1);\
- }\
- "
-
- property string vertexShader: "\
- attribute highp vec4 qt_Vertex;\
- uniform mediump mat4 qt_ModelViewProjectionMatrix;\
-\
- void main(void)\
- {\
- gl_Position = qt_ModelViewProjectionMatrix * qt_Vertex;\
- }\
- "
-
- Effect {
- id: testEffect
- material: china
- }
-
- Cube {
- id: testItemWithNullFragmentShader
- effect: testShaderProgramWithNullFragmentShader
- x: -1.5;
- }
-
- Cube {
- id: testItem
- effect: testShaderProgram
- }
-
- Cube {
- id: testItemWithNullVertexShader
- effect: testShaderProgramWithNullVertexShader
- x: 1.5
- }
-
-
- // Simple
- Timer {
- running: true
- interval: 1
- onTriggered: {
- shadersTest.when = true;
- viewport.update3d();
- }
- }
-
- TestCase {
- id: shadersTest
-
- // Delay test until after first paint
- when: false
- //
- function test_null_fragment_shader() {
- // a test failure is an assert during shader program linking
- // so if execution reaches this point, the test has passed
- verify(true, "shader program didn't crash with null shaders");
- }
- }
-
- ShaderProgram {
- id: testShaderProgram
- fragmentShader: viewport.fragmentShader
- vertexShader: viewport.vertexShader
- }
-
- ShaderProgram {
- id: testShaderProgramWithNullFragmentShader
-
- fragmentShader: ""
- vertexShader: viewport.vertexShader
- }
-
- ShaderProgram {
- id: testShaderProgramWithNullVertexShader
- fragmentShader: viewport.fragmentShader
- vertexShader: ""
- }
-
-}
diff --git a/tests/auto/qml3d/sphere/tst_sphere.qml b/tests/auto/qml3d/sphere/tst_sphere.qml
deleted file mode 100644
index 1d211a49..00000000
--- a/tests/auto/qml3d/sphere/tst_sphere.qml
+++ /dev/null
@@ -1,126 +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
-import Qt3D.Shapes 1.0
-import QtQuickTest 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
- onLevelOfDetailChanged: ++lodChanged
- onAxisChanged: ++axChanged
- }
-
- 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() {
- 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() {
- 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() {
- 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 d8757a39..00000000
--- a/tests/auto/qml3d/tst_qml3d.cpp
+++ /dev/null
@@ -1,414 +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 <QApplication>
-#include <QtDeclarative/qdeclarative.h>
-#include <QtDeclarative/qdeclarativeview.h>
-#include <QtDeclarative/qdeclarativeengine.h>
-#include <QtDeclarative/qdeclarativecontext.h>
-#include <QtOpenGL/qgl.h>
-#include <QtCore/qurl.h>
-#include <QtCore/qfileinfo.h>
-#include <QtCore/qdir.h>
-#include <QtCore/qdebug.h>
-#include <QtCore/qeventloop.h>
-#include <QtGui/qtextdocument.h>
-#include <QtTest/qtestcase.h>
-#include <stdio.h>
-
-class QuitObject : public QObject
-{
- Q_OBJECT
-public:
- QuitObject(QObject *parent = 0) : QObject(parent), hasQuit(false) {}
-
- bool hasQuit;
-
-private Q_SLOTS:
- void quit() { hasQuit = true; }
-};
-
-static bool xmlOutput = false;
-static int passed = 0;
-static int failed = 0;
-static int skipped = 0;
-static FILE *stream = 0;
-
-// A utility object to trigger the "clicked()" signal on a DeclarativeItem3d.
-class Item3DClicker : public QObject
-{
- Q_OBJECT
-public:
- Item3DClicker(QObject *parent = 0) : QObject(parent) {}
-
-public Q_SLOTS:
- Q_INVOKABLE bool click(QObject *target);
-};
-
-QML_DECLARE_TYPE(Item3DClicker)
-
-bool Item3DClicker::click(QObject *target)
-{
- if (target == 0)
- return false;
- const QMetaObject* metaTarget = target->metaObject();
- int clickedIndex = metaTarget->indexOfSignal("clicked()");
- if (clickedIndex == -1)
- return false;
-
- metaTarget->activate(target, clickedIndex, 0);
- return true;
-}
-
-class TestReport : public QObject
-{
- Q_OBJECT
-public:
- TestReport(QObject *parent = 0) : QObject(parent) {}
-
-public Q_SLOTS:
- void report(int pass, int fail, int skip);
- void log_fail(const QString &testCase, const QString &message);
- void log_expect_fail
- (const QString &testCase, const QString &message);
- void log_expect_fail_pass(const QString &testCase);
- void log_skip(const QString &testCase, const QString &message);
- void log_pass(const QString &testCase);
- void log_message(const QString &message);
-
-private:
- void log_incident(const char *type, const QString &testCase,
- const QString &message);
-};
-
-QML_DECLARE_TYPE(TestReport)
-
-void TestReport::report(int pass, int fail, int skip)
-{
- passed += pass;
- failed += fail;
- skipped += skip;
-}
-
-void TestReport::log_fail(const QString &testCase, const QString &message)
-{
- if (xmlOutput) {
- log_incident("fail", testCase, message);
- } else if (!message.isEmpty()) {
- fprintf(stream, "FAIL! : %s %s\n",
- testCase.toLatin1().constData(),
- message.toLatin1().constData());
- } else {
- fprintf(stream, "FAIL! : %s\n", testCase.toLatin1().constData());
- }
-}
-
-void TestReport::log_expect_fail
- (const QString &testCase, const QString &message)
-{
- if (xmlOutput) {
- log_incident("xfail", testCase, message);
- } else if (!message.isEmpty()) {
- fprintf(stream, "XFAIL : %s %s\n",
- testCase.toLatin1().constData(),
- message.toLatin1().constData());
- } else {
- fprintf(stream, "XFAIL : %s\n", testCase.toLatin1().constData());
- }
-}
-
-void TestReport::log_expect_fail_pass(const QString &testCase)
-{
- if (xmlOutput)
- log_incident("xpass", testCase, QString());
- else
- fprintf(stream, "XPASS : %s\n", testCase.toLatin1().constData());
-}
-
-void TestReport::log_skip(const QString &testCase, const QString &message)
-{
- if (xmlOutput) {
- log_incident("skip", testCase, message);
- } else if (!message.isEmpty()) {
- fprintf(stream, "SKIP : %s %s\n",
- testCase.toLatin1().constData(),
- message.toLatin1().constData());
- } else {
- fprintf(stream, "SKIP : %s\n", testCase.toLatin1().constData());
- }
-}
-
-void TestReport::log_pass(const QString &testCase)
-{
- if (xmlOutput)
- log_incident("pass", testCase, QString());
- else
- fprintf(stream, "PASS : %s\n", testCase.toLatin1().constData());
-}
-
-void TestReport::log_message(const QString &message)
-{
- if (!xmlOutput)
- fprintf(stream, "%s\n", message.toLatin1().constData());
-}
-
-void TestReport::log_incident
- (const char *type, const QString &testCase, const QString &message)
-{
- QString name(testCase);
- QString tag;
- name.replace(QLatin1String("()"), QLatin1String(""));
- name.replace(QLatin1String("::"), QLatin1String("__"));
- int tagIndex = name.indexOf(QLatin1String(" ["));
- if (tagIndex >= 0) {
- tag = name.mid(tagIndex + 2);
- if (tag.endsWith(QLatin1String("]")))
- tag = tag.left(tag.length() - 1);
- name = name.left(tagIndex);
- }
- fprintf(stream, "<TestFunction name=\"%s\">\n",
- Qt::escape(name).toLatin1().constData());
- if (message.isEmpty() && tag.isEmpty()) {
- fprintf(stream, "<Incident type=\"%s\" file=\"\" line=\"0\" />\n", type);
- } else {
- fprintf(stream, "<Incident type=\"%s\" file=\"\" line=\"0\">\n", type);
- if (!tag.isEmpty()) {
- fprintf(stream, " <DataTag>%s</DataTag>\n",
- Qt::escape(tag).toLatin1().constData());
- }
- if (!message.isEmpty()) {
- fprintf(stream, " <Description>%s</Description>\n",
- Qt::escape(message).toLatin1().constData());
- }
- fprintf(stream, "</Incident>\n");
- }
- fprintf(stream, "</TestFunction>\n");
-}
-
-class tst_qml3d : public QObject
-{
- Q_OBJECT
-public:
-private slots:
- void initTestCase()
- {
- QSKIP("Disabling qml tests due to invalid GL context!", SkipSingle);
- }
-};
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
-
- {
- QGLWidget checkWidget;
- if (!checkWidget.isValid())
- {
- tst_qml3d xf;
- return QTest::qExec(&xf, argc, argv);
- }
- }
-
- // Just display the functions available and then exit
- bool displayFunctions = false;
-
- QStringList restrictFunctions;
-
- // Parse the command-line arguments.
- const char *filename = 0;
- for (int index = 1; index < argc; ++index) {
- QString arg = QString::fromLocal8Bit(argv[index]);
- if (arg == QLatin1String("-xml"))
- xmlOutput = true;
- else if (arg == QLatin1String("-o") && (index + 1) < argc)
- filename = argv[++index];
- else if (arg == QLatin1String("-functions"))
- displayFunctions = true;
- else
- {
- // assume it is the names of test functions - run only those
- restrictFunctions += arg;
- }
- }
-
- // Determine where to look for the test data. On a device it will
- // typically be necessary to set QML3D_TEST_SOURCE_DIR.
- QString testPath = QString::fromLocal8Bit(qgetenv("QML3D_TEST_SOURCE_DIR"));
-#ifdef QML3D_TEST_SOURCE_DIR
- if (testPath.isEmpty())
- testPath = QString::fromLocal8Bit(QML3D_TEST_SOURCE_DIR);
-#endif
- if (testPath.isEmpty())
- testPath = QLatin1String(".");
-
- // Find the subdirectories that look like they may contain test cases.
- // The "QtQuickTest" directory contains the common QML and JS test logic.
- QDir dir(testPath);
- QStringList entries = dir.entryList(QDir::Dirs);
- entries.removeAll(QLatin1String("."));
- entries.removeAll(QLatin1String(".."));
- entries.removeAll(QLatin1String("QtQuickTest"));
-
- if (filename) {
- stream = fopen(filename, "w");
- if (!stream) {
- perror(filename);
- return 1;
- }
- } else {
- stream = stdout;
- }
-
- if (xmlOutput) {
- fprintf(stream, "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n"
- "<TestCase name=\"tst_qml3d\">\n");
- fprintf(stream, "<Environment>\n"
- " <QtVersion>%s</QtVersion>\n"
- " <QTestVersion>%s</QTestVersion>\n"
- "</Environment>\n", qVersion(), qVersion());
- } else {
- if (!displayFunctions)
- fprintf(stream, "********* Start testing of tst_qml3d *********\n");
- }
-
- qmlRegisterType<TestReport>("QtQuickTest", 1, 0, "TestReport");
- qmlRegisterType<Item3DClicker>("QtQuickTest", 1, 0, "Item3DClicker");
-
- // Scan through all of the "*.qml" files in the subdirectories
- // and run each of them in turn with a QDeclarativeView.
- QStringList filters;
- filters += QLatin1String("tst_*.qml");
- bool atLeastOne = false;
- if (displayFunctions)
- restrictFunctions.clear();
- foreach (QString name, entries) {
- QDir subdir(testPath + QDir::separator() + name);
- QStringList files = subdir.entryList(filters, QDir::Files);
- foreach (QString file, files) {
- QString source = subdir.path() + QDir::separator() + file;
- QFileInfo fi(source);
- if (fi.exists()) {
- bool hasFunc = true;
- if (restrictFunctions.size() > 0 || displayFunctions)
- {
- hasFunc = false;
- QFile qmlFile(fi.absoluteFilePath());
- if (!qmlFile.open(QIODevice::ReadOnly))
- continue;
- {
- QTextStream is(&qmlFile);
- while (!is.atEnd())
- {
- QString line = is.readLine();
- for (int i = 0; i < restrictFunctions.size() && !hasFunc; ++i)
- {
- QString funcName("function ");
- funcName += restrictFunctions.at(i);
- if (line.contains(funcName))
- hasFunc = true;
- }
- if (displayFunctions)
- {
- int pos = line.indexOf(QLatin1String("function test_"));
- if (pos >= 0)
- {
- QString fname = line.mid(pos + 9); // "function".length
- pos = fname.indexOf("()");
- fname.truncate(pos + 2);
- qWarning(" %s\n", qPrintable(fname));
- }
- }
- }
- }
- qmlFile.close();
- }
- if (!hasFunc)
- continue;
- atLeastOne = true;
- QDeclarativeView view;
- QuitObject quitobj;
- QEventLoop eventLoop;
- QObject::connect(view.engine(), SIGNAL(quit()),
- &quitobj, SLOT(quit()));
- QObject::connect(view.engine(), SIGNAL(quit()),
- &eventLoop, SLOT(quit()));
- view.setViewport(new QGLWidget());
- view.engine()->addImportPath(testPath);
- view.rootContext()->setContextProperty(QLatin1String("filterTestCases"), restrictFunctions);
- view.setSource(QUrl::fromLocalFile(fi.absoluteFilePath()));
- if (view.status() == QDeclarativeView::Error) {
- // Error compiling the test - flag failure and continue.
- ++failed;
- continue;
- }
- if (!quitobj.hasQuit) {
- // If the test already quit, then it was performed
- // synchronously during setSource(). Otherwise it is
- // an asynchronous test and we need to show the window
- // and wait for the quit indication.
- view.show();
- eventLoop.exec();
- }
- }
- }
- }
-
- if (!atLeastOne && !xmlOutput && restrictFunctions.size() > 1)
- fprintf(stream, "No test functions matched specified name: %s\n", qPrintable(restrictFunctions.at(0)));
-
- if (xmlOutput) {
- fprintf(stream, "</TestCase>\n");
- } else {
- if (!displayFunctions)
- {
- fprintf(stream, "Totals: %d passed, %d failed, %d skipped\n",
- passed, failed, skipped);
- fprintf(stream, "********* Finished testing of tst_qml3d *********\n");
- }
- }
-
- if (filename)
- fclose(stream);
-
- return failed != 0;
-}
-
-#include "tst_qml3d.moc"
diff --git a/tests/auto/qml3d/viewport/tst_viewport.qml b/tests/auto/qml3d/viewport/tst_viewport.qml
deleted file mode 100644
index 29a7914b..00000000
--- a/tests/auto/qml3d/viewport/tst_viewport.qml
+++ /dev/null
@@ -1,138 +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
-import QtQuickTest 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() {
- 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() {
- 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 88a26c5f..00000000
--- a/tests/auto/threed/load_model/load_model.pro
+++ /dev/null
@@ -1,9 +0,0 @@
-load(qttest_p4.prf)
-TEMPLATE=app
-QT += testlib
-CONFIG += unittest warn_on qt3d
-
-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 824ba5d5..00000000
--- a/tests/auto/threed/load_model/tst_load_model.cpp
+++ /dev/null
@@ -1,232 +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, QString(), QString());
- 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);
-
- 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 b41e5d7f..00000000
--- a/tests/auto/threed/qareaallocator/qareaallocator.pro
+++ /dev/null
@@ -1,6 +0,0 @@
-load(qttest_p4.prf)
-TEMPLATE=app
-QT += testlib
-CONFIG += unittest warn_on qt3d
-
-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 9c5f37e0..00000000
--- a/tests/auto/threed/qarray/qarray.pro
+++ /dev/null
@@ -1,6 +0,0 @@
-load(qttest_p4.prf)
-TEMPLATE=app
-QT += testlib
-CONFIG += unittest warn_on qt3d
-
-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 f62181ec..00000000
--- a/tests/auto/threed/qbox3d/qbox3d.pro
+++ /dev/null
@@ -1,6 +0,0 @@
-load(qttest_p4.prf)
-TEMPLATE=app
-QT += testlib
-CONFIG += unittest warn_on qt3d
-
-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 e5643b5c..00000000
--- a/tests/auto/threed/qcolor4ub/qcolor4ub.pro
+++ /dev/null
@@ -1,6 +0,0 @@
-load(qttest_p4.prf)
-TEMPLATE=app
-QT += testlib
-CONFIG += unittest warn_on qt3d
-
-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 7b5d0495..00000000
--- a/tests/auto/threed/qcustomdataarray/qcustomdataarray.pro
+++ /dev/null
@@ -1,6 +0,0 @@
-load(qttest_p4.prf)
-TEMPLATE=app
-QT += testlib
-CONFIG += unittest warn_on qt3d
-
-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 a03425bb..00000000
--- a/tests/auto/threed/qgeometrydata/qgeometrydata.pro
+++ /dev/null
@@ -1,9 +0,0 @@
-load(qttest_p4.prf)
-TEMPLATE=app
-QT += testlib
-CONFIG += unittest warn_on qt3d
-
-INCLUDEPATH += ../../../shared
-INCLUDEPATH += ../../../../src/threed/geometry
-
-SOURCES += tst_qgeometrydata.cpp
diff --git a/tests/auto/threed/qgeometrydata/tst_qgeometrydata.cpp b/tests/auto/threed/qgeometrydata/tst_qgeometrydata.cpp
deleted file mode 100644
index 7dd77956..00000000
--- a/tests/auto/threed/qgeometrydata/tst_qgeometrydata.cpp
+++ /dev/null
@@ -1,629 +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 <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();
- QVector3D n = data.normalAt(1);
- 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()
-{
- 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()
-{
- 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);
-
- QGLWidget 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 8cd363ea..00000000
--- a/tests/auto/threed/qglabstractsurface/qglabstractsurface.pro
+++ /dev/null
@@ -1,6 +0,0 @@
-load(qttest_p4.prf)
-TEMPLATE=app
-QT += testlib
-CONFIG += unittest warn_on qt3d
-
-SOURCES += tst_qglabstractsurface.cpp
diff --git a/tests/auto/threed/qglabstractsurface/tst_qglabstractsurface.cpp b/tests/auto/threed/qglabstractsurface/tst_qglabstractsurface.cpp
deleted file mode 100644
index 66a6dafc..00000000
--- a/tests/auto/threed/qglabstractsurface/tst_qglabstractsurface.cpp
+++ /dev/null
@@ -1,333 +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 "qglwidgetsurface.h"
-#include "qglframebufferobjectsurface.h"
-#include "qglpixelbuffersurface.h"
-#include "qglsubsurface.h"
-#include "qopenglfunctions.h"
-
-class tst_QGLAbstractSurface : public QObject
-{
- Q_OBJECT
-public:
- tst_QGLAbstractSurface() {}
- ~tst_QGLAbstractSurface() {}
-
-private slots:
- void glWidgetSurface();
- void fboSurface();
- void pbufferSurface();
- void subSurface();
-
-private:
- bool isFboCurrent(QGLFramebufferObject *fbo);
-};
-
-bool tst_QGLAbstractSurface::isFboCurrent(QGLFramebufferObject *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;
-}
-
-void tst_QGLAbstractSurface::glWidgetSurface()
-{
- QGLWidget glw;
- if (!glw.isValid())
- QSKIP("GL Implementation not valid", SkipSingle);
-
-
- QGLWidgetSurface surface1;
- QVERIFY(surface1.surfaceType() == QGLAbstractSurface::Widget);
- QVERIFY(surface1.widget() == 0);
- surface1.setWidget(&glw);
- QVERIFY(surface1.widget() == &glw);
- QVERIFY(surface1.device() == &glw);
- QCOMPARE(surface1.viewportRect(), glw.rect());
-
- QVERIFY(surface1.activate());
- QVERIFY(QGLContext::currentContext() == glw.context());
- QCOMPARE(surface1.viewportGL(), QRect(0, 0, glw.width(), glw.height()));
-
- surface1.deactivate();
- QVERIFY(QGLContext::currentContext() == glw.context()); // Left current.
-
- QGLWidget glw2;
-
- QGLWidgetSurface surface2(&glw2);
- QVERIFY(surface2.surfaceType() == QGLAbstractSurface::Widget);
- QVERIFY(surface2.widget() == &glw2);
- QVERIFY(surface2.device() == &glw2);
-
- QVERIFY(surface1.activate());
- QVERIFY(surface1.switchTo(&surface2));
-
- QVERIFY(QGLContext::currentContext() == glw2.context());
-
- QVERIFY(surface2.switchTo(&surface1));
- QVERIFY(QGLContext::currentContext() == glw.context());
-}
-
-void tst_QGLAbstractSurface::fboSurface()
-{
- if (!QGLFramebufferObject::hasOpenGLFramebufferObjects())
- QSKIP("fbo's are not supported", SkipSingle);
-
- QGLWidget glw;
- if (!glw.isValid())
- QSKIP("GL Implementation not valid", SkipSingle);
-
- QGLWidgetSurface surface1(&glw);
- QVERIFY(surface1.activate());
- QCOMPARE(surface1.viewportGL(), QRect(0, 0, glw.width(), glw.height()));
-
- QGLFramebufferObject fbo1(128, 128);
- QVERIFY(fbo1.handle() != 0);
-
- QGLFramebufferObjectSurface surface2(&fbo1);
- QVERIFY(surface2.surfaceType() == QGLAbstractSurface::FramebufferObject);
- QVERIFY(surface2.framebufferObject() == &fbo1);
- QVERIFY(surface2.device() == &fbo1);
-
- QVERIFY(isFboCurrent(0));
-
- QVERIFY(surface2.activate());
- QVERIFY(QGLContext::currentContext() == glw.context());
- QVERIFY(isFboCurrent(&fbo1));
- QCOMPARE(surface2.viewportGL(), QRect(QPoint(0, 0), fbo1.size()));
-
- surface2.deactivate();
- QVERIFY(isFboCurrent(0));
- QVERIFY(QGLContext::currentContext() == glw.context());
-
- surface2.setContext(glw.context());
-
- QGLWidget glw2;
- QGLWidgetSurface 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(isFboCurrent(&fbo1));
- QVERIFY(QGLContext::currentContext() == glw.context());
- QCOMPARE(surface2.viewportGL(), QRect(QPoint(0, 0), fbo1.size()));
-
- QVERIFY(surface2.switchTo(&surface3));
- QVERIFY(isFboCurrent(0));
- 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()));
-
- QGLFramebufferObject fbo2(256, 256);
- QVERIFY(fbo2.handle() != 0);
-
- QGLFramebufferObjectSurface surface4;
- QVERIFY(surface4.surfaceType() == QGLAbstractSurface::FramebufferObject);
- QVERIFY(surface4.framebufferObject() == 0);
- QVERIFY(surface4.device() == 0);
- QVERIFY(!surface4.activate(0));
- QVERIFY(surface4.viewportGL().isNull());
- surface4.setFramebufferObject(&fbo2);
- QVERIFY(surface4.framebufferObject() == &fbo2);
- QVERIFY(surface4.device() == &fbo2);
- surface4.setContext(glw.context());
-
- QVERIFY(surface1.switchTo(&surface2));
- QVERIFY(QGLContext::currentContext() == glw.context());
- QVERIFY(isFboCurrent(&fbo1));
- QCOMPARE(surface2.viewportGL(), QRect(QPoint(0, 0), fbo1.size()));
-
- QVERIFY(surface2.switchTo(&surface4));
- QVERIFY(QGLContext::currentContext() == glw.context());
- QVERIFY(isFboCurrent(&fbo2));
- QCOMPARE(surface4.viewportGL(), QRect(QPoint(0, 0), fbo2.size()));
-
- QVERIFY(surface3.switchTo(&surface2));
- QVERIFY(QGLContext::currentContext() == glw.context());
- QVERIFY(isFboCurrent(&fbo1));
- QCOMPARE(surface2.viewportGL(), QRect(QPoint(0, 0), fbo1.size()));
-
- QVERIFY(surface2.switchTo(&surface1));
- QVERIFY(QGLContext::currentContext() == glw.context());
- 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", SkipSingle);
-
- QGLWidget glw;
- if (!glw.isValid())
- QSKIP("GL Implementation not valid", SkipSingle);
-
- QGLWidgetSurface 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;
- QGLWidgetSurface 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()
-{
- QGLWidget glw;
- if (!glw.isValid())
- QSKIP("GL Implementation not valid", SkipSingle);
-
- QGLWidgetSurface surface1(&glw);
-
- QGLSubsurface surface2(&surface1, QRect(0, 0, 32, 16));
- QVERIFY(surface2.surfaceType() == QGLAbstractSurface::Subsurface);
- QVERIFY(surface2.surface() == &surface1);
- QVERIFY(surface2.device() == &glw);
- QCOMPARE(surface2.region(), QRect(0, 0, 32, 16));
-
- QVERIFY(surface2.activate());
- QVERIFY(QGLContext::currentContext() == glw.context());
- 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(QGLContext::currentContext() == glw.context());
- QCOMPARE(surface3.viewportGL(), QRect(16, glw.height() - (8 + 16), 32, 16));
-
- QGLSubsurface surface4;
- QVERIFY(surface4.surfaceType() == QGLAbstractSurface::Subsurface);
- QVERIFY(surface4.surface() == 0);
- QVERIFY(surface4.device() == 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(QGLContext::currentContext() == glw.context());
- 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 92cb86f3..00000000
--- a/tests/auto/threed/qglattributedescription/qglattributedescription.pro
+++ /dev/null
@@ -1,9 +0,0 @@
-load(qttest_p4.prf)
-TEMPLATE=app
-QT += testlib
-CONFIG += unittest warn_on qt3d
-
-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 64b4619c..00000000
--- a/tests/auto/threed/qglattributeset/qglattributeset.pro
+++ /dev/null
@@ -1,6 +0,0 @@
-load(qttest_p4.prf)
-TEMPLATE=app
-QT += testlib
-CONFIG += unittest warn_on qt3d
-
-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 77cfb1fc..00000000
--- a/tests/auto/threed/qglattributeset/tst_qglattributeset.cpp
+++ /dev/null
@@ -1,211 +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()
-{
- 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 d8e98255..00000000
--- a/tests/auto/threed/qglattributevalue/qglattributevalue.pro
+++ /dev/null
@@ -1,9 +0,0 @@
-load(qttest_p4.prf)
-TEMPLATE=app
-QT += testlib
-CONFIG += unittest warn_on qt3d
-
-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 d85b77d0..00000000
--- a/tests/auto/threed/qglbezierpatches/qglbezierpatches.pro
+++ /dev/null
@@ -1,6 +0,0 @@
-load(qttest_p4.prf)
-TEMPLATE=app
-QT += testlib
-CONFIG += unittest warn_on qt3d
-
-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 0853f935..00000000
--- a/tests/auto/threed/qglbuilder/qglbuilder.pro
+++ /dev/null
@@ -1,8 +0,0 @@
-load(qttest_p4.prf)
-TEMPLATE=app
-QT += testlib
-CONFIG += unittest warn_on qt3d
-
-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 dfe16b82..00000000
--- a/tests/auto/threed/qglcamera/qglcamera.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-load(qttest_p4.prf)
-TEMPLATE=app
-QT += testlib
-CONFIG += unittest warn_on qt3d
-
-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 b197daca..00000000
--- a/tests/auto/threed/qglcameraanimation/qglcameraanimation.pro
+++ /dev/null
@@ -1,9 +0,0 @@
-load(qttest_p4.prf)
-TEMPLATE=app
-QT += testlib
-CONFIG += unittest warn_on qt3d
-
-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 6a589755..00000000
--- a/tests/auto/threed/qglcameraanimation/tst_qglcameraanimation.cpp
+++ /dev/null
@@ -1,162 +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();
-};
-
-// Will try to wait for the condition while allowing event processing
-#define QTRY_VERIFY(__expr) \
- do { \
- const int __step = 50; \
- const int __timeout = 5000; \
- if (!(__expr)) { \
- QTest::qWait(0); \
- } \
- for (int __i = 0; __i < __timeout && !(__expr); __i+=__step) { \
- QTest::qWait(__step); \
- } \
- QVERIFY(__expr); \
- } while (0)
-
-// Will try to wait for the condition while allowing event processing
-#define QTRY_COMPARE(__expr, __expected) \
- do { \
- const int __step = 50; \
- const int __timeout = 5000; \
- if ((__expr) != (__expected)) { \
- QTest::qWait(0); \
- } \
- for (int __i = 0; __i < __timeout && ((__expr) != (__expected)); __i+=__step) { \
- QTest::qWait(__step); \
- } \
- QCOMPARE(__expr, __expected); \
- } while (0)
-
-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 05540601..00000000
--- a/tests/auto/threed/qglcolladafxeffectfactory/qglcolladafxeffectfactory.pro
+++ /dev/null
@@ -1,13 +0,0 @@
-load(qttest_p4.prf)
-TEMPLATE = app
-QT += testlib
-CONFIG += unittest warn_on qt3d
-
-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 4153abf2..00000000
--- a/tests/auto/threed/qglcube/qglcube.pro
+++ /dev/null
@@ -1,7 +0,0 @@
-load(qttest_p4.prf)
-TEMPLATE=app
-QT += testlib
-CONFIG += unittest warn_on qt3d
-
-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 d43fb44c..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, 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, 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, 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, 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, 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, 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, 0.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, 0.0f,
- 0.5f, -0.5f, -0.5f, 1.0f, 0.0f, 0.0f, 1.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, 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, 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, 1.0f, 1.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 c8f6e42f..00000000
--- a/tests/auto/threed/qglcylinder/qglcylinder.pro
+++ /dev/null
@@ -1,7 +0,0 @@
-load(qttest_p4.prf)
-TEMPLATE=app
-QT += testlib
-CONFIG += unittest warn_on qt3d
-
-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 ede0e40c..00000000
--- a/tests/auto/threed/qglindexbuffer/qglindexbuffer.pro
+++ /dev/null
@@ -1,6 +0,0 @@
-load(qttest_p4.prf)
-TEMPLATE=app
-QT += testlib
-CONFIG += unittest warn_on qt3d
-
-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 a7083762..00000000
--- a/tests/auto/threed/qglindexbuffer/tst_qglindexbuffer.cpp
+++ /dev/null
@@ -1,478 +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 <QtOpenGL/qgl.h>
-#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 19f78ca0..00000000
--- a/tests/auto/threed/qgllightmodel/qgllightmodel.pro
+++ /dev/null
@@ -1,6 +0,0 @@
-load(qttest_p4.prf)
-TEMPLATE=app
-QT += testlib
-CONFIG += unittest warn_on qt3d
-
-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 0cd20a44..00000000
--- a/tests/auto/threed/qgllightparameters/qgllightparameters.pro
+++ /dev/null
@@ -1,6 +0,0 @@
-load(qttest_p4.prf)
-TEMPLATE=app
-QT += testlib
-CONFIG += unittest warn_on qt3d
-
-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 2ed58123..00000000
--- a/tests/auto/threed/qglmaterial/qglmaterial.pro
+++ /dev/null
@@ -1,6 +0,0 @@
-load(qttest_p4.prf)
-TEMPLATE=app
-QT += testlib
-CONFIG += unittest warn_on qt3d
-
-SOURCES += tst_qglmaterial.cpp
diff --git a/tests/auto/threed/qglmaterial/tst_qglmaterial.cpp b/tests/auto/threed/qglmaterial/tst_qglmaterial.cpp
deleted file mode 100644
index ea6c50b0..00000000
--- a/tests/auto/threed/qglmaterial/tst_qglmaterial.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 "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>
-
-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 QGLWidget
-{
- Q_OBJECT
-public:
- TestWidget(QWidget *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(QWidget *parent)
- : QGLWidget(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 {
- updateGL();
- }
- 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);
- 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);
- }
-
- QImage capture = grabFrameBuffer();
- 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()
-{
- 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.
- // This texture is not intended to actually "load" as such, but rather
- // to simply test the setting of notional textures.
- 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->isValid())
- QSKIP("GL Implementation not valid", SkipSingle);
-
- QGLMaterial mat1;
- QVERIFY(widget->runTest(&mat1));
- QVERIFY(widget->sameColor(litColor(mat1)));
-}
-
-void tst_QGLMaterial::colorMaterialDraw()
-{
- if (!widget->isValid())
- QSKIP("GL Implementation not valid", SkipSingle);
-
- 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 dddbfca3..00000000
--- a/tests/auto/threed/qglmaterialcollection/qglmaterialcollection.pro
+++ /dev/null
@@ -1,6 +0,0 @@
-load(qttest_p4.prf)
-TEMPLATE=app
-QT += testlib
-CONFIG += unittest warn_on qt3d
-
-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 0f195dcf..00000000
--- a/tests/auto/threed/qglpainter/qglpainter.pro
+++ /dev/null
@@ -1,15 +0,0 @@
-load(qttest_p4.prf)
-TEMPLATE=app
-QT += testlib
-CONFIG += unittest warn_on qt3d
-
-INCLUDEPATH += ../../../shared
-VPATH += ../../../shared
-
-SOURCES += tst_qglpainter.cpp \
- qgltestwidget.cpp \
- compareimage.cpp \
- qglsimulator.cpp
-HEADERS += qgltestwidget.h \
- compareimage.h \
- qglsimulator.h
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 b54976df..00000000
--- a/tests/auto/threed/qglpainter/qgltestwidget.cpp
+++ /dev/null
@@ -1,121 +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 <QtCore/qeventloop.h>
-#include <QtCore/qtimer.h>
-#include <QtGui/qpainter.h>
-
-QGLTestWidget::QGLTestWidget(QWidget *parent)
- : QGLWidget(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 {
- updateGL();
- }
- 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);
- capture = grabFrameBuffer();
- 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 7fb17e6a..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 <QtOpenGL/qgl.h>
-
-QT_BEGIN_NAMESPACE
-class QEventLoop;
-QT_END_NAMESPACE
-
-class QGLTestWidget : public QGLWidget
-{
- Q_OBJECT
-public:
- QGLTestWidget(QWidget *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 82ee6521..00000000
--- a/tests/auto/threed/qglpainter/tst_qglpainter.cpp
+++ /dev/null
@@ -1,874 +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 <QtOpenGL/qgl.h>
-#include <QtGui/qpainter.h>
-#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()
-{
- widget = new QGLTestWidget();
-}
-
-void tst_QGLPainter::cleanupTestCase()
-{
- delete widget;
-}
-
-void tst_QGLPainter::clear()
-{
- if (!widget->isValid())
- QSKIP("GL Implementation not valid", SkipSingle);
-
- 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()
-{
- if (!widget->isValid())
- QSKIP("GL Implementation not valid", SkipSingle);
-
- 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->rect());
- 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->rect());
- 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()
-{
- if (!widget->isValid())
- QSKIP("GL Implementation not valid", SkipSingle);
-
- // 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->rect();
-
- 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->rect());
- 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->rect());
- 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->isValid())
- QSKIP("GL Implementation not valid", SkipSingle);
-
- 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->isValid())
- QSKIP("GL Implementation not valid", SkipSingle);
-
- 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));
-}
-
-void tst_QGLPainter::basicCullable()
-{
- QGLWidget w;
- QGLPainter painter(&w);
- 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()
-{
- QGLWidget w;
- QGLPainter painter(&w);
- 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", SkipAll);
- // 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.
- QGLWidget w;
- QGLPainter painter(&w);
- 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 1394e282..00000000
--- a/tests/auto/threed/qglpickcolors/qglpickcolors.pro
+++ /dev/null
@@ -1,14 +0,0 @@
-load(qttest_p4.prf)
-TEMPLATE=app
-QT += testlib
-CONFIG += unittest 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 547eff30..00000000
--- a/tests/auto/threed/qglrender/qglrender.pro
+++ /dev/null
@@ -1,6 +0,0 @@
-load(qttest_p4.prf)
-TEMPLATE=app
-QT += testlib
-CONFIG += unittest warn_on qt3d
-
-SOURCES += tst_qglrender.cpp
diff --git a/tests/auto/threed/qglrender/tst_qglrender.cpp b/tests/auto/threed/qglrender/tst_qglrender.cpp
deleted file mode 100644
index 150396d5..00000000
--- a/tests/auto/threed/qglrender/tst_qglrender.cpp
+++ /dev/null
@@ -1,259 +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 "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(QGLWidget *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()
-{
- 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.isValid())
- QSKIP("GL Implementation not valid", SkipSingle);
-
- 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 511f83c0..00000000
--- a/tests/auto/threed/qglscenenode/qglscenenode.pro
+++ /dev/null
@@ -1,7 +0,0 @@
-load(qttest_p4.prf)
-TEMPLATE=app
-QT += testlib
-CONFIG += unittest warn_on qt3d
-
-INCLUDEPATH += ../../../shared
-SOURCES += tst_qglscenenode.cpp
diff --git a/tests/auto/threed/qglscenenode/tst_qglscenenode.cpp b/tests/auto/threed/qglscenenode/tst_qglscenenode.cpp
deleted file mode 100644
index f87f77b5..00000000
--- a/tests/auto/threed/qglscenenode/tst_qglscenenode.cpp
+++ /dev/null
@@ -1,751 +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 "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;
- }
-
-};
-
-void tst_QGLSceneNode::position_QTBUG_17279()
-{
- 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);
-
- QGLWidget w;
- QGLPainter p(&w);
- 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 37f1a3c1..00000000
--- a/tests/auto/threed/qglsection/qglsection.pro
+++ /dev/null
@@ -1,8 +0,0 @@
-load(qttest_p4.prf)
-TEMPLATE=app
-QT += testlib
-CONFIG += unittest warn_on qt3d
-
-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 e551288c..00000000
--- a/tests/auto/threed/qglsharedresource/qglsharedresource.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-load(qttest_p4.prf)
-TEMPLATE=app
-QT += testlib
-CONFIG += unittest warn_on qt3d
-
-INCLUDEPATH += ../../../../src/threed/textures
-VPATH += ../../../../src/threed/textures
-
-HEADERS += qglsharedresource_p.h
-SOURCES += tst_qglsharedresource.cpp qglsharedresource.cpp
diff --git a/tests/auto/threed/qglsharedresource/tst_qglsharedresource.cpp b/tests/auto/threed/qglsharedresource/tst_qglsharedresource.cpp
deleted file mode 100644
index b889d550..00000000
--- a/tests/auto/threed/qglsharedresource/tst_qglsharedresource.cpp
+++ /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 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()
-{
- 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", SkipSingle);
- }
- 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 d30ed784..00000000
--- a/tests/auto/threed/qglsphere/qglsphere.pro
+++ /dev/null
@@ -1,7 +0,0 @@
-load(qttest_p4.prf)
-TEMPLATE=app
-QT += testlib
-CONFIG += unittest warn_on qt3d
-
-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 89cf0f17..00000000
--- a/tests/auto/threed/qglvertexbundle/qglvertexbundle.pro
+++ /dev/null
@@ -1,6 +0,0 @@
-load(qttest_p4.prf)
-TEMPLATE=app
-QT += testlib
-CONFIG += unittest warn_on qt3d
-
-SOURCES += tst_qglvertexbundle.cpp
diff --git a/tests/auto/threed/qglvertexbundle/tst_qglvertexbundle.cpp b/tests/auto/threed/qglvertexbundle/tst_qglvertexbundle.cpp
deleted file mode 100644
index 07965914..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 <QtOpenGL/qgl.h>
-#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()
-{
- // 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 4cc0791c..00000000
--- a/tests/auto/threed/qgraphicstransform3d/qgraphicstransform3d.pro
+++ /dev/null
@@ -1,6 +0,0 @@
-load(qttest_p4.prf)
-TEMPLATE=app
-QT += testlib
-CONFIG += unittest warn_on qt3d
-
-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/qopenglfunctions/qopenglfunctions.pro b/tests/auto/threed/qopenglfunctions/qopenglfunctions.pro
deleted file mode 100644
index c830ff37..00000000
--- a/tests/auto/threed/qopenglfunctions/qopenglfunctions.pro
+++ /dev/null
@@ -1,6 +0,0 @@
-load(qttest_p4.prf)
-TEMPLATE=app
-QT += testlib
-CONFIG += unittest warn_on qt3d
-
-SOURCES += tst_qopenglfunctions.cpp
diff --git a/tests/auto/threed/qopenglfunctions/tst_qopenglfunctions.cpp b/tests/auto/threed/qopenglfunctions/tst_qopenglfunctions.cpp
deleted file mode 100644
index 0ef53909..00000000
--- a/tests/auto/threed/qopenglfunctions/tst_qopenglfunctions.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 <QtTest/QtTest>
-#include "qopenglfunctions.h"
-
-class tst_QOpenGLFunctions : public QObject
-{
- Q_OBJECT
-public:
- tst_QOpenGLFunctions() {}
- ~tst_QOpenGLFunctions() {}
-
-private slots:
- void features();
- void multitexture();
- void blendColor();
-
-private:
- static bool hasExtension(const char *name);
-};
-
-bool tst_QOpenGLFunctions::hasExtension(const char *name)
-{
- QString extensions =
- QString::fromLatin1
- (reinterpret_cast<const char *>(glGetString(GL_EXTENSIONS)));
- return extensions.split(QLatin1Char(' ')).contains
- (QString::fromLatin1(name));
-}
-
-// Check that the reported features are consistent with the platform.
-void tst_QOpenGLFunctions::features()
-{
- // Before being associated with a context, there should be
- // no features enabled.
- QOpenGLFunctions funcs;
- QVERIFY(!funcs.openGLFeatures());
- QVERIFY(!funcs.hasOpenGLFeature(QOpenGLFunctions::Multitexture));
- QVERIFY(!funcs.hasOpenGLFeature(QOpenGLFunctions::Shaders));
- QVERIFY(!funcs.hasOpenGLFeature(QOpenGLFunctions::Buffers));
- QVERIFY(!funcs.hasOpenGLFeature(QOpenGLFunctions::Framebuffers));
- QVERIFY(!funcs.hasOpenGLFeature(QOpenGLFunctions::BlendColor));
- QVERIFY(!funcs.hasOpenGLFeature(QOpenGLFunctions::BlendEquation));
- QVERIFY(!funcs.hasOpenGLFeature(QOpenGLFunctions::BlendEquationSeparate));
- QVERIFY(!funcs.hasOpenGLFeature(QOpenGLFunctions::BlendFuncSeparate));
- QVERIFY(!funcs.hasOpenGLFeature(QOpenGLFunctions::BlendSubtract));
- QVERIFY(!funcs.hasOpenGLFeature(QOpenGLFunctions::CompressedTextures));
- QVERIFY(!funcs.hasOpenGLFeature(QOpenGLFunctions::Multisample));
- QVERIFY(!funcs.hasOpenGLFeature(QOpenGLFunctions::StencilSeparate));
- QVERIFY(!funcs.hasOpenGLFeature(QOpenGLFunctions::NPOTTextures));
-
- // Make a context current.
- QGLWidget glw;
- if (!glw.isValid())
- QSKIP("GL Implementation not valid", SkipSingle);
-
- glw.makeCurrent();
- funcs.initializeGLFunctions();
-
- // Validate the features against what we expect for this platform.
-#if defined(QT_OPENGL_ES_2)
- QOpenGLFunctions::OpenGLFeatures allFeatures =
- (QOpenGLFunctions::Multitexture |
- QOpenGLFunctions::Shaders |
- QOpenGLFunctions::Buffers |
- QOpenGLFunctions::Framebuffers |
- QOpenGLFunctions::BlendColor |
- QOpenGLFunctions::BlendEquation |
- QOpenGLFunctions::BlendEquationSeparate |
- QOpenGLFunctions::BlendFuncSeparate |
- QOpenGLFunctions::BlendSubtract |
- QOpenGLFunctions::CompressedTextures |
- QOpenGLFunctions::Multisample |
- QOpenGLFunctions::StencilSeparate |
- QOpenGLFunctions::NPOTTextures);
- QVERIFY((funcs.openGLFeatures() & allFeatures) == allFeatures);
- QVERIFY(funcs.hasOpenGLFeature(QOpenGLFunctions::Multitexture));
- QVERIFY(funcs.hasOpenGLFeature(QOpenGLFunctions::Shaders));
- QVERIFY(funcs.hasOpenGLFeature(QOpenGLFunctions::Buffers));
- QVERIFY(funcs.hasOpenGLFeature(QOpenGLFunctions::Framebuffers));
- QVERIFY(funcs.hasOpenGLFeature(QOpenGLFunctions::BlendColor));
- QVERIFY(funcs.hasOpenGLFeature(QOpenGLFunctions::BlendEquation));
- QVERIFY(funcs.hasOpenGLFeature(QOpenGLFunctions::BlendEquationSeparate));
- QVERIFY(funcs.hasOpenGLFeature(QOpenGLFunctions::BlendFuncSeparate));
- QVERIFY(funcs.hasOpenGLFeature(QOpenGLFunctions::BlendSubtract));
- QVERIFY(funcs.hasOpenGLFeature(QOpenGLFunctions::CompressedTextures));
- QVERIFY(funcs.hasOpenGLFeature(QOpenGLFunctions::Multisample));
- QVERIFY(funcs.hasOpenGLFeature(QOpenGLFunctions::StencilSeparate));
- QVERIFY(funcs.hasOpenGLFeature(QOpenGLFunctions::NPOTTextures));
-#elif defined(QT_OPENGL_ES)
- QVERIFY(funcs.hasOpenGLFeature(QOpenGLFunctions::Multitexture));
- QVERIFY(funcs.hasOpenGLFeature(QOpenGLFunctions::Buffers));
- QVERIFY(funcs.hasOpenGLFeature(QOpenGLFunctions::CompressedTextures));
- QVERIFY(funcs.hasOpenGLFeature(QOpenGLFunctions::Multisample));
-
- QVERIFY(!funcs.hasOpenGLFeature(QOpenGLFunctions::Shaders));
- QVERIFY(!funcs.hasOpenGLFeature(QOpenGLFunctions::BlendColor));
- QVERIFY(!funcs.hasOpenGLFeature(QOpenGLFunctions::StencilSeparate));
-
- QCOMPARE(funcs.hasOpenGLFeature(QOpenGLFunctions::Framebuffers),
- hasExtension("GL_OES_framebuffer_object"));
- QCOMPARE(funcs.hasOpenGLFeature(QOpenGLFunctions::BlendEquationSeparate),
- hasExtension("GL_OES_blend_equation_separate"));
- QCOMPARE(funcs.hasOpenGLFeature(QOpenGLFunctions::BlendFuncSeparate),
- hasExtension("GL_OES_blend_func_separate"));
- QCOMPARE(funcs.hasOpenGLFeature(QOpenGLFunctions::BlendSubtract),
- hasExtension("GL_OES_blend_subtract"));
- QCOMPARE(funcs.hasOpenGLFeature(QOpenGLFunctions::NPOTTextures),
- hasExtension("GL_OES_texture_npot"));
-#else
- // We check for both the extension name and the minimum OpenGL version
- // for the feature. This will help us catch situations where a platform
- // doesn't list an extension by name but does have the feature by virtue
- // of its version number.
- QGLFormat::OpenGLVersionFlags versions = QGLFormat::openGLVersionFlags();
- QCOMPARE(funcs.hasOpenGLFeature(QOpenGLFunctions::Multitexture),
- hasExtension("GL_ARB_multitexture") ||
- (versions & QGLFormat::OpenGL_Version_1_3) != 0);
- QCOMPARE(funcs.hasOpenGLFeature(QOpenGLFunctions::Shaders),
- hasExtension("GL_ARB_shader_objects") ||
- (versions & QGLFormat::OpenGL_Version_2_0) != 0);
- QCOMPARE(funcs.hasOpenGLFeature(QOpenGLFunctions::Buffers),
- (versions & QGLFormat::OpenGL_Version_1_5) != 0);
- QCOMPARE(funcs.hasOpenGLFeature(QOpenGLFunctions::Framebuffers),
- hasExtension("GL_EXT_framebuffer_object") ||
- hasExtension("GL_ARB_framebuffer_object"));
- QCOMPARE(funcs.hasOpenGLFeature(QOpenGLFunctions::BlendColor),
- hasExtension("GL_EXT_blend_color") ||
- (versions & QGLFormat::OpenGL_Version_1_2) != 0);
- QCOMPARE(funcs.hasOpenGLFeature(QOpenGLFunctions::BlendEquation),
- (versions & QGLFormat::OpenGL_Version_1_2) != 0);
- QCOMPARE(funcs.hasOpenGLFeature(QOpenGLFunctions::BlendEquationSeparate),
- hasExtension("GL_EXT_blend_equation_separate") ||
- (versions & QGLFormat::OpenGL_Version_2_0) != 0);
- QCOMPARE(funcs.hasOpenGLFeature(QOpenGLFunctions::BlendFuncSeparate),
- hasExtension("GL_EXT_blend_func_separate") ||
- (versions & QGLFormat::OpenGL_Version_1_4) != 0);
- QCOMPARE(funcs.hasOpenGLFeature(QOpenGLFunctions::BlendSubtract),
- hasExtension("GL_EXT_blend_subtract"));
- QCOMPARE(funcs.hasOpenGLFeature(QOpenGLFunctions::CompressedTextures),
- hasExtension("GL_ARB_texture_compression") ||
- (versions & QGLFormat::OpenGL_Version_1_3) != 0);
- QCOMPARE(funcs.hasOpenGLFeature(QOpenGLFunctions::Multisample),
- hasExtension("GL_ARB_multisample") ||
- (versions & QGLFormat::OpenGL_Version_1_3) != 0);
- QCOMPARE(funcs.hasOpenGLFeature(QOpenGLFunctions::StencilSeparate),
- (versions & QGLFormat::OpenGL_Version_2_0) != 0);
- QCOMPARE(funcs.hasOpenGLFeature(QOpenGLFunctions::NPOTTextures),
- hasExtension("GL_ARB_texture_non_power_of_two") ||
- (versions & QGLFormat::OpenGL_Version_2_0) != 0);
-#endif
-}
-
-// Verify that the multitexture functions appear to resolve and work.
-void tst_QOpenGLFunctions::multitexture()
-{
- QOpenGLFunctions funcs;
- QGLWidget glw;
- if (!glw.isValid())
- QSKIP("GL Implementation not valid", SkipSingle);
- glw.makeCurrent();
- funcs.initializeGLFunctions();
-
- if (!funcs.hasOpenGLFeature(QOpenGLFunctions::Multitexture))
- QSKIP("Multitexture functions are not supported", SkipSingle);
-
- funcs.glActiveTexture(GL_TEXTURE1);
-
- GLint active = 0;
- glGetIntegerv(GL_ACTIVE_TEXTURE, &active);
- QVERIFY(active == GL_TEXTURE1);
-
- funcs.glActiveTexture(GL_TEXTURE0);
-
- active = 0;
- glGetIntegerv(GL_ACTIVE_TEXTURE, &active);
- QVERIFY(active == GL_TEXTURE0);
-}
-
-// Verify that the glBlendColor() function appears to resolve and work.
-void tst_QOpenGLFunctions::blendColor()
-{
- QOpenGLFunctions funcs;
- QGLWidget glw;
- if (!glw.isValid())
- QSKIP("GL Implementation not valid", SkipSingle);
- glw.makeCurrent();
- funcs.initializeGLFunctions();
-
- if (!funcs.hasOpenGLFeature(QOpenGLFunctions::BlendColor))
- QSKIP("glBlendColor() is not supported", SkipSingle);
-
- funcs.glBlendColor(0.0f, 1.0f, 0.0f, 1.0f);
-
- GLfloat colors[4] = {0.5f, 0.5f, 0.5f, 0.5f};
- glGetFloatv(GL_BLEND_COLOR, colors);
-
- QCOMPARE(colors[0], 0.0f);
- QCOMPARE(colors[1], 1.0f);
- QCOMPARE(colors[2], 0.0f);
- QCOMPARE(colors[3], 1.0f);
-}
-
-QTEST_MAIN(tst_QOpenGLFunctions)
-
-#include "tst_qopenglfunctions.moc"
diff --git a/tests/auto/threed/qplane3d/qplane3d.pro b/tests/auto/threed/qplane3d/qplane3d.pro
deleted file mode 100644
index 008251ec..00000000
--- a/tests/auto/threed/qplane3d/qplane3d.pro
+++ /dev/null
@@ -1,6 +0,0 @@
-load(qttest_p4.prf)
-TEMPLATE=app
-QT += testlib
-CONFIG += unittest warn_on qt3d
-
-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 ba7deee4..00000000
--- a/tests/auto/threed/qray3d/qray3d.pro
+++ /dev/null
@@ -1,5 +0,0 @@
-load(qttest_p4.prf)
-TEMPLATE = app
-QT += testlib
-CONFIG += unittest warn_on qt3d
-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 d758dcf1..00000000
--- a/tests/auto/threed/qsphere3d/qsphere3d.pro
+++ /dev/null
@@ -1,5 +0,0 @@
-load(qttest_p4.prf)
-TEMPLATE=app
-QT += testlib
-CONFIG += unittest warn_on qt3d
-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 6691805d..00000000
--- a/tests/auto/threed/qstereoimage/qstereoimage.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-load(qttest_p4.prf)
-TEMPLATE=app
-QT += testlib
-CONFIG += unittest 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 06997373..00000000
--- a/tests/auto/threed/qtriangle3d/qtriangle3d.pro
+++ /dev/null
@@ -1,6 +0,0 @@
-load(qttest_p4.prf)
-TEMPLATE=app
-QT += testlib
-CONFIG += unittest warn_on qt3d
-
-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 07677159..00000000
--- a/tests/auto/threed/qvectorarray/qvectorarray.pro
+++ /dev/null
@@ -1,7 +0,0 @@
-load(qttest_p4.prf)
-TEMPLATE=app
-QT += testlib
-CONFIG += unittest warn_on qt3d
-
-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 7e029ae1..00000000
--- a/tests/auto/threed/threed.pro
+++ /dev/null
@@ -1,40 +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 \
- qopenglfunctions \
- 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 ac490f37..00000000
--- a/tests/benchmarks/matrix_properties/matrix_properties.pro
+++ /dev/null
@@ -1,18 +0,0 @@
-TEMPLATE = app
-TARGET = tst_matrix_properties
-QT += declarative script testlib
-macx:CONFIG -= app_bundle
-
-SOURCES += tst_matrix_properties.cpp
-
-symbian* {
- data.sources = data/*
- data.path = data
- DEPLOYMENT += data
-} else {
- 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 98f4983b..00000000
--- a/tests/benchmarks/matrix_properties/tst_matrix_properties.cpp
+++ /dev/null
@@ -1,183 +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>
-
-#ifdef Q_OS_SYMBIAN
-// In Symbian OS test data is located in applications private dir
-// Application private dir is default search path for files, so SRCDIR can be set to empty
-#define SRCDIR "."
-#endif
-
-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 c237dde4..00000000
--- a/tests/benchmarks/qarray/qarray.pro
+++ /dev/null
@@ -1,5 +0,0 @@
-TEMPLATE=app
-QT += testlib
-CONFIG += unittest warn_on qt3d
-
-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 6f13bc09..00000000
--- a/tests/benchmarks/qglbuilder_perf/qglbuilder_perf.pro
+++ /dev/null
@@ -1,6 +0,0 @@
-TEMPLATE=app
-QT += testlib
-CONFIG += unittest warn_on qt3d
-
-SOURCES += tst_qglbuilder_perf.cpp
-INCLUDEPATH += ../../../src/threed/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 dcbc3fd7..00000000
--- a/tests/manual/animations/animations.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-TEMPLATE = app
-TARGET = tst_animations
-CONFIG += qt warn_on
-
-INSTALL_DIRS = qml
-CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg
-include(../../../pkg.pri)
-qtcAddDeployment()
-
-SOURCES += main.cpp
diff --git a/tests/manual/animations/main.cpp b/tests/manual/animations/main.cpp
deleted file mode 100644
index bc89a00f..00000000
--- a/tests/manual/animations/main.cpp
+++ /dev/null
@@ -1,63 +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/QApplication>
-#include "qdeclarativeview3d.h"
-
-#include "../../shared/qmlres.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
-
- QDeclarativeView3D view;
- QString qml = q_get_qmldir(QLatin1String("qml/tst_animations.qml"));
- view.setSource(QUrl::fromLocalFile(qml));
-
- if (QApplication::arguments().contains(QLatin1String("-maximize")))
- view.showMaximized();
- else if (QApplication::arguments().contains(QLatin1String("-fullscreen")))
- view.showFullScreen();
- else
- view.show();
-
- return app.exec();
-}
diff --git a/tests/manual/animations/qml/TestCase.qml b/tests/manual/animations/qml/TestCase.qml
deleted file mode 100644
index 6d979387..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 QtQuick3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 1.0
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-
-Rectangle {
- id: container
- 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/tst_animations.qml b/tests/manual/animations/qml/tst_animations.qml
deleted file mode 100644
index a6bdc4c0..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 QtQuick3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 1.0
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-
-// QTBUG-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/qtquick3d.png b/tests/manual/animations/qtquick3d.png
deleted file mode 100644
index 69deef3f..00000000
--- a/tests/manual/animations/qtquick3d.png
+++ /dev/null
Binary files differ
diff --git a/tests/manual/animations/tst_animations_qml.desktop b/tests/manual/animations/tst_animations_qml.desktop
deleted file mode 100644
index 3fc4e012..00000000
--- a/tests/manual/animations/tst_animations_qml.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=tst_animations
-Icon=/usr/share/icons/hicolor/80x80/apps/qtquick3d.png
-Exec=/usr/bin/invoker --type=e -s /usr/bin/tst_animations -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_tst_animations_qml
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 667ab092..00000000
--- a/tests/manual/displaymodel/displaymodel.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-TEMPLATE = app
-TARGET = tst_displaymodel
-CONFIG += qt warn_on
-
-INSTALL_DIRS = qml
-CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg
-include(../../../pkg.pri)
-qtcAddDeployment()
-
-SOURCES += main.cpp
diff --git a/tests/manual/displaymodel/main.cpp b/tests/manual/displaymodel/main.cpp
deleted file mode 100644
index b26d4eda..00000000
--- a/tests/manual/displaymodel/main.cpp
+++ /dev/null
@@ -1,63 +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/QApplication>
-#include "qdeclarativeview3d.h"
-
-#include "../../shared/qmlres.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
-
- QDeclarativeView3D view;
- QString qml = q_get_qmldir(QLatin1String("qml/tst_displaymodel.qml"));
- view.setSource(QUrl::fromLocalFile(qml));
-
- if (QApplication::arguments().contains(QLatin1String("-maximize")))
- view.showMaximized();
- else if (QApplication::arguments().contains(QLatin1String("-fullscreen")))
- view.showFullScreen();
- else
- view.show();
-
- return app.exec();
-}
diff --git a/tests/manual/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 855a8799..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 QtQuick3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 1.0
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-
-// QTBUG-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/displaymodel/qtquick3d.png b/tests/manual/displaymodel/qtquick3d.png
deleted file mode 100644
index 8351083e..00000000
--- a/tests/manual/displaymodel/qtquick3d.png
+++ /dev/null
Binary files differ
diff --git a/tests/manual/lighting/lighting.pro b/tests/manual/lighting/lighting.pro
deleted file mode 100644
index 2f62efdd..00000000
--- a/tests/manual/lighting/lighting.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-TEMPLATE = app
-TARGET = tst_lighting
-CONFIG += qt warn_on
-
-INSTALL_DIRS = qml
-CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg
-include(../../../pkg.pri)
-qtcAddDeployment()
-
-SOURCES += main.cpp
diff --git a/tests/manual/lighting/main.cpp b/tests/manual/lighting/main.cpp
deleted file mode 100644
index 8aa66508..00000000
--- a/tests/manual/lighting/main.cpp
+++ /dev/null
@@ -1,63 +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/QApplication>
-#include "qdeclarativeview3d.h"
-
-#include "../../shared/qmlres.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
-
- QDeclarativeView3D view;
- QString qml = q_get_qmldir(QLatin1String("qml/tst_lighting.qml"));
- view.setSource(QUrl::fromLocalFile(qml));
-
- if (QApplication::arguments().contains(QLatin1String("-maximize")))
- view.showMaximized();
- else if (QApplication::arguments().contains(QLatin1String("-fullscreen")))
- view.showFullScreen();
- else
- view.show();
-
- return app.exec();
-}
diff --git a/tests/manual/lighting/qml/LightingTestCase.qml b/tests/manual/lighting/qml/LightingTestCase.qml
deleted file mode 100644
index 35a3ead4..00000000
--- a/tests/manual/lighting/qml/LightingTestCase.qml
+++ /dev/null
@@ -1,132 +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
-
-Rectangle {
- id: container
- // Parameters for editting and access
- property string text;
- property variant camera: defaultCamera
- property variant light: defaultLight // The actual Light
- // lightItem contains the defaultLight and a small white sphere at the same
- // position.
- property alias lightItem: lightItem
- // lightSphere is the sphere in lightItem. It's intended use is to be a
- // visible object at the source of the light, to make it easier to see
- // where the light should be coming from.
- property alias lightSphere: lightSphere
- // The teapotContainer is an item containing the 5 teapots, to make it
- // easier to move them around if necessary
- property alias teapotContainer: teapotContainer
- // view is the viewport that displays the test
- property alias view: view
-
- // Default values:
- property variant defaultCamera: Camera { eye: Qt.vector3d(0,0,15)}
- property variant defaultLight: Light {}
- property real defaultWidth: 440
- property real defaultHeight: 300
-
- // Utility values
- property real theta: 0.0
- SequentialAnimation on theta {
- running: true
- loops: Animation.Infinite
- PropertyAnimation {
- from: 0.0
- to: 2.0 * Math.PI
- 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
- light: container.light
- Item3D {
- id:lightItem
- // This sphere is small enough to be obscured by the center
- // teapot if it's not manipulated
- Sphere { id: lightSphere; scale: 0.3;
- }
- Light{ id: testLight; }
- }
- Item3D {
- id: teapotContainer
- Teapot { id: centerTeapot }
- Teapot { id: topRightTeapot; x:2; y:2 }
- Teapot { id: topLeftTeapot; x:-2; y:2 }
- Teapot { id: bottomRightTeapot; x:2; y:-2 }
- Teapot { id: bottomLeftTeapot; x:-2; y:-2 }
- }
- }
- }
-}
diff --git a/tests/manual/lighting/qml/tst_lighting.qml b/tests/manual/lighting/qml/tst_lighting.qml
deleted file mode 100644
index d5c9c4ee..00000000
--- a/tests/manual/lighting/qml/tst_lighting.qml
+++ /dev/null
@@ -1,76 +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
-
-// QTBUG-17408
-Item {
- id: screen
-
- width: aTestCase.defaultWidth * 2
- height: aTestCase.defaultHeight * 1
-
- Flow {
- anchors.fill: parent
-
- LightingTestCase {
- id: aTestCase
- text: "Positional Lighting Direct Position Test. The light should appear to be emanating from the sphere, rotating around the middle teapot and lighting the insides of the other 4 teapots dynamically."
-
- onThetaChanged: {
- light.position = Qt.vector3d(1.5 * Math.sin(theta),
- 1.5 * Math.cos(theta), 0);
- lightSphere.position = light.position;
- }
- }
-
- LightingTestCase {
- text: "Directional Lighting Test.
- Lighting should look the same on all teapots"
- onThetaChanged: {
- light.direction = Qt.vector3d(1.5 * Math.sin(theta),
- 1.5 * Math.cos(theta),0);
- }
- }
- }
-}
diff --git a/tests/manual/lighting/qtquick3d.png b/tests/manual/lighting/qtquick3d.png
deleted file mode 100644
index 8351083e..00000000
--- a/tests/manual/lighting/qtquick3d.png
+++ /dev/null
Binary files differ
diff --git a/tests/manual/lighting/tst_lighting_qml.desktop b/tests/manual/lighting/tst_lighting_qml.desktop
deleted file mode 100644
index 6cb79035..00000000
--- a/tests/manual/lighting/tst_lighting_qml.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=tst_lighting
-Icon=/usr/share/icons/hicolor/80x80/apps/qtquick3d.png
-Exec=/usr/bin/invoker --type=e -s /usr/bin/tst_lighting -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_tst_lighting_qml
diff --git a/tests/manual/manual.pro b/tests/manual/manual.pro
deleted file mode 100644
index 8200a5da..00000000
--- a/tests/manual/manual.pro
+++ /dev/null
@@ -1,13 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS += displaymodel \
- lighting \
- model3ds \
- navigation1 \
- rotation \
- scaling \
- submesh \
- translation \
- transformations \
- animations \
- qrc \
- 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/main.cpp b/tests/manual/model3ds/main.cpp
deleted file mode 100644
index 2b2276c1..00000000
--- a/tests/manual/model3ds/main.cpp
+++ /dev/null
@@ -1,63 +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/QApplication>
-#include "qdeclarativeview3d.h"
-
-#include "../../shared/qmlres.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
-
- QDeclarativeView3D view;
- QString qml = q_get_qmldir(QLatin1String("qml/tst_model3ds.qml"));
- view.setSource(QUrl::fromLocalFile(qml));
-
- if (QApplication::arguments().contains(QLatin1String("-maximize")))
- view.showMaximized();
- else if (QApplication::arguments().contains(QLatin1String("-fullscreen")))
- view.showFullScreen();
- else
- view.show();
-
- return app.exec();
-}
diff --git a/tests/manual/model3ds/model3ds.pro b/tests/manual/model3ds/model3ds.pro
deleted file mode 100644
index bc19365e..00000000
--- a/tests/manual/model3ds/model3ds.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-TEMPLATE = app
-TARGET = tst_model3ds
-CONFIG += qt warn_on
-
-INSTALL_DIRS = qml
-CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg
-include(../../../pkg.pri)
-qtcAddDeployment()
-
-SOURCES += main.cpp
diff --git a/tests/manual/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/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 7a24ae67..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 QtQuick3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 1.0
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-
-// QTBUG-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/qtquick3d.png b/tests/manual/model3ds/qtquick3d.png
deleted file mode 100644
index 8351083e..00000000
--- a/tests/manual/model3ds/qtquick3d.png
+++ /dev/null
Binary files differ
diff --git a/tests/manual/model3ds/tst_submesh_qml.desktop b/tests/manual/model3ds/tst_submesh_qml.desktop
deleted file mode 100644
index 7bd7fd92..00000000
--- a/tests/manual/model3ds/tst_submesh_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/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/main.cpp b/tests/manual/navigation1/main.cpp
deleted file mode 100644
index f3d6a8b9..00000000
--- a/tests/manual/navigation1/main.cpp
+++ /dev/null
@@ -1,63 +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/QApplication>
-#include "qdeclarativeview3d.h"
-
-#include "../../shared/qmlres.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
-
- QDeclarativeView3D view;
- QString qml = q_get_qmldir(QLatin1String("qml/tst_navigation1.qml"));
- view.setSource(QUrl::fromLocalFile(qml));
-
- if (QApplication::arguments().contains(QLatin1String("-maximize")))
- view.showMaximized();
- else if (QApplication::arguments().contains(QLatin1String("-fullscreen")))
- view.showFullScreen();
- else
- view.show();
-
- return app.exec();
-}
diff --git a/tests/manual/navigation1/navigation1.pro b/tests/manual/navigation1/navigation1.pro
deleted file mode 100644
index a1d3bfad..00000000
--- a/tests/manual/navigation1/navigation1.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-TEMPLATE = app
-TARGET = tst_navigation1
-CONFIG += qt warn_on
-
-INSTALL_DIRS = qml
-CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg
-include(../../../pkg.pri)
-qtcAddDeployment()
-
-SOURCES += main.cpp
diff --git a/tests/manual/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 14f16429..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 QtQuick3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 1.0
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-
-// QTBUG-17408 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/navigation1/qtquick3d.png b/tests/manual/navigation1/qtquick3d.png
deleted file mode 100644
index 8351083e..00000000
--- a/tests/manual/navigation1/qtquick3d.png
+++ /dev/null
Binary files differ
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/main.cpp b/tests/manual/qrc/main.cpp
deleted file mode 100644
index e56a21ed..00000000
--- a/tests/manual/qrc/main.cpp
+++ /dev/null
@@ -1,67 +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/QApplication>
-#include "qdeclarativeview3d.h"
-#include <QWidget>
-#include <QHBoxLayout>
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
-
- QWidget widget;
- QHBoxLayout layout;
-
- QDeclarativeView3D viewL;
- viewL.setSource(QUrl("qrc:///qml/cube.qml"));
- layout.addWidget(&viewL);
-
- QDeclarativeView3D viewR;
- viewR.setSource(QUrl("Qrc:/qml/cube.qml"));
-
- layout.addWidget(&viewR);
-
- widget.setLayout(&layout);
- widget.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 a17882d7..00000000
--- a/tests/manual/qrc/qrc.pro
+++ /dev/null
@@ -1,17 +0,0 @@
-TEMPLATE = app
-TARGET = tst_qrc
-CONFIG += qt warn_on
-
-INSTALL_DIRS = qml
-CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg
-include(../../../pkg.pri)
-qtcAddDeployment()
-
-SOURCES += main.cpp
-
-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/qtquick3d.png b/tests/manual/qrc/qtquick3d.png
deleted file mode 100644
index 8351083e..00000000
--- a/tests/manual/qrc/qtquick3d.png
+++ /dev/null
Binary files differ
diff --git a/tests/manual/qrc/tst_qrc_qml.desktop b/tests/manual/qrc/tst_qrc_qml.desktop
deleted file mode 100644
index 02f18027..00000000
--- a/tests/manual/qrc/tst_qrc_qml.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=tst_qrc
-Icon=/usr/share/icons/hicolor/80x80/apps/qtquick3d.png
-Exec=/usr/bin/invoker --type=e -s /usr/bin/tst_qrc -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_tst_qrc_qml
diff --git a/tests/manual/qt3d.svg b/tests/manual/qt3d.svg
deleted file mode 100644
index 4b25ec50..00000000
--- a/tests/manual/qt3d.svg
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<!-- Converted with SVG Converter - Version 0.9.5 (Compiled Mon May 30 09:08:51 2011) - Copyright (C) 2011 Nokia -->
-<svg xmlns="http://www.w3.org/2000/svg" width="287" version="1.1" height="286" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="tiny" id="svg2">
- <defs id="defs4">
- <linearGradient id="linearGradient4309">
- <stop offset="0" style="stop-color:#d4f301;stop-opacity:1;" id="stop4311"/>
- <stop offset="1" style="stop-color:#d4f301;stop-opacity:0;" id="stop4313"/>
- </linearGradient>
- <linearGradient gradientTransform="matrix(1.0104795,0,0,1.004441,23.387309,76.758859)" id="linearGradient3730-2" y1="131.35715" y2="156.39526" x1="23.626827" gradientUnits="userSpaceOnUse" x2="303.57144">
- <stop offset="0" style="stop-color:#038d30;stop-opacity:1;" id="stop3726-7"/>
- <stop offset="1" style="stop-color:#038d30;stop-opacity:0;" id="stop3728-1"/>
- </linearGradient>
- <linearGradient id="linearGradient3724-7">
- <stop offset="0" style="stop-color:#038d30;stop-opacity:1;" id="stop3726-7"/>
- <stop offset="1" style="stop-color:#038d30;stop-opacity:0;" id="stop3728-1"/>
- </linearGradient>
- <linearGradient id="linearGradient4315" y1="62.920685" y2="62.920685" x1="72.492188" gradientUnits="userSpaceOnUse" x2="165.83203">
- <stop offset="0" style="stop-color:#d4f301;stop-opacity:1;" id="stop4311"/>
- <stop offset="1" style="stop-color:#d4f301;stop-opacity:0;" id="stop4313"/>
- </linearGradient>
- </defs>
- <metadata id="metadata7"/>
- <g id="layer1" transform="translate(-25.071424,-77.933617)">
- <path style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#d4f301;stroke-width:8.85648727;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="path3722" d="M 149.39285,339.37194 C 118.29002,338.06386 93.410274,329.21846 78.267585,314.08502 66.239667,302.06444 58.159936,285.11057 54.818135,264.88047 c -1.962614,-11.881 -2.442596,-20.11519 -2.455216,-42.1199 -0.01051,-18.36712 0.160997,-23.0644 1.239861,-33.95521 2.529982,-25.53941 11.482605,-46.43472 25.677112,-59.93007 16.042727,-15.25252 39.462148,-23.21337 72.203768,-24.54383 6.77105,-0.27512 31.97542,0.38686 41.46813,1.08915 17.85829,1.32123 29.86273,4.01251 41.92069,9.39824 16.71724,7.46685 28.60768,18.52238 36.44553,33.88638 5.7477,11.26691 9.34961,23.29707 11.69339,39.05536 2.22754,14.97664 2.81073,44.00559 1.22086,60.77114 -2.76934,29.20404 -10.704,50.36949 -24.19378,64.53629 -8.65346,9.08774 -21.29946,16.39504 -35.37578,20.44137 -13.11053,3.76868 -25.14568,5.0858 -52.44498,5.73944 -13.81368,0.33078 -17.4242,0.35023 -22.82487,0.12311 l 0,0 z"/>
- <rect width="236.93414" x="49.282932" y="102.78797" rx="95.84404" ry="92.255867" height="239.43414" style="opacity:0;fill:none;stroke:#008000;stroke-width:3.29858350999999980;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="rect2852"/>
- <rect width="175" x="28.571428" y="19.214285" rx="95.84404" ry="92.255867" height="206.07143" style="opacity:0;fill:#b94b4b;fill-opacity:1;stroke:#05d105;stroke-width:4.147;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="rect3704" transform="translate(25.071424,77.933617)"/>
- <image width="172.71428" x="86.571419" y="214.50505" height="93.14286" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIkAAABMCAYAAABZAZTOAAAABHNCSVQICAgIfAhkiAAAF+NJREFU eJztXVlzHMeR/qq6e06ABE9QomTJlu0IKdaxftmH/Xf783Zf1l7FWpbWFiXSFA+QIIDBYDBXd+1D ZlZlVdcMTpLYBTKi0T19d9fXmV8eVTAAHG7kRtaI/dg3cCNXX25AciMnSvmxb+CDiwEMAGPW7+Zc PL/Ocu1A0ukAvT5QdQFjAWsUYBzQOKBeAssFMD0GFvMboFwLkBgDdHtApwfc3wbubQMbt4CiBMoK sJa0S+OA5RyYToHpBNh9Dbx9DRwfAYsFri3FvxYgAYBuH9jcAh4+Bh59Bty+QwCpukBR0D5NA8yn wPGEgFFWwGxKWmWx+Lj3/zHleoDEUIN3e8CdB8CDT4BbW0BVkXaxBWmbpiZQTI6AyRiYHQM7L0jj XGe5Ho/vgMkhcY3Xz4mT1EsGSZdBYGjdfAYcHQLjEfD6BXDwjsByXU0NcE1A4hybkAnw0/fEPyrW LDBA6UiTLBekRXbfAO92gJ//h+Y3xPWayeyYTMliAVQdIq1lSZ6Oc4BraPtkTJ7NjVxDkBxPSFMc vCPCWnWA/pDAcmyA+Rx4+xLY3yXyet21CHANQeIccY53O2RuXEOmxhjaNjkERnvESZbX2KPRcu1A AhBBPT4id3fJgTNb0Hw2JVNU1zdaROTagaTTBe7cBwYbpFF++JY5iSFgTI6ArXtkhgRM110M/j86 d5yfcY6JaUWNLhyk6pCpMYYIq4TlHcj81EvSMHMOpDVNCNHLuYHro2mupCaRRut0QxzDWjIJlvPW Pu9iQ2PLfmVF6wrev6jI5bWW1jmoBs40tFH5HPF4plMCScNmyKkcT63WOUfndI7A1TR0TF3zvks+ T/OeX+IFxFh6ZpErBRJp7LKixhxuAP0NBkrB68sAgKII0VIBg4DEWs7JMLgKtd+Z9Cc3+HJJDdzU 1MACksWC1zGYBDBNTdsFHIs5ud/zOXA8prkA6H2LB70Cv/F/wnZ5l84Bi1kA+tUBiQFsScC4fZfM wa3bwGAT6A2okTtdjm0UxCPKkoAhD1iWQVsYGwBhlUnRLwxh5kWbEOf/MDAaNXcEgHoZGrupCUxN HfI9TU2AmB0zWZ4BhwfAaJ/WHR68X6BYS6mHwRAoO6RRiwoo1DuRj6jqUYHRaJ/SEYs50MyvEEgs Z2rv3KfcSn9ID9br00NqPiHaoigDIESrCCBEi5gMSPQXBSiOgXhBmyWnQSLmhsEhPEbMigcJr1vM CRyzTQLOcJOeazImrjM7fj/vtOoQQd9+TInNwQa9006PPijnQklEvQCOjoDxfvoyrhBIjAGqklP6 rDEKBQRtXsSUWAuYggCmzYsnpDYUGEUaRJFPveytUI6vGAB8PjDvsLzsjAIT72sdUDguQWAtt+S3 3elSVrppQgb6fUhZUUnE9mPgs18Dw1sE0G6frtvUpN3evSFP781r0iCjPQK18KYrA5Jun0zLcJNe YlkG4pkCAMpciERawCTLLr9JrxRvSPb3WiTRKn7u0AaRCbfmgerC/RcFHVNWpEkMqHxhPrv8wF1/ CPzun4D7j4Cvviag9AZ03aKkeNDxGHjzCvjHE2DvLfDLTwSY1Gs7F0iM/vQQiKT/itU2v7imXLAo AkB6A9YiZWJCeBJT4af4VmJyZlZf1rQWkuUcsV1DeD1uDWJN5kjbGX4W5+jZqg6d6+4DzjofrH4/ Z5VuD3j8JfCHfyEQ3t+m91uWpB3G74BXzwkY3/8JePI93cMqj+tsIDFAr8cVXZ3gMfT6wK07ZPOq iolQGbiA9ypsu1GNBQ73gd0dQr8HSKkAIgBEMC1GN4bWLhktk65vgbilXuJjDaixW8emgEy8CNEo 1hBRtBYAm56qousNNqi2ZT4NRPi8Ivdy/xHw+z8QOPpDoD+g68MR/3n6d+Db/6DKu5fPSJOti/mc CBJ58P6Q0Hj7DpkD+eJtQSAZbhKCS/EsVMNmPQpeNxnTC6o6wTvJmZhUe/hzIOEdrQc4+eVGPEQf 5+Kf6emymDLEUVIuJN6Wc0HLiEfW6QbQXMTRES9lsKHMdhU0mFTe7b6mj/Lw4HSgXAkSY+gim7eJ Lzx8DDz8BLj7kIuJB6RNrA3aQ9v1ls120cy/vNc1ub79AYFMIqOeoKa8JNEgOfBIA4WHQb6VVz58 sqvmNmqug24pICJzo0DhwDEfRWKHt4CjUShhOG8kVz7e+4/IjIlmNpbiHvMZ8OIZ8ONfgJdPQ2T5 JMmCxBg6+fZnwG++plzG9uNQ8tc0RLTm88CQ5zN6QAljiyvolMuoo3jglznap+O7/aBNVvERkwML nwspWBLVn4KkxUl4LlrFgDRCxHa1meHtWZBwEZNlFd+o+4YD6iKURJYdig0NNsmlnh7TuzuPdHuk 6R88AjY2qX63ZC/m8ICmv/wn8PxnIq6nlZWapKwIHJ99Sdrj3jY14mJOKutoTOn0xRyYcdXXfBZC zgsOQUtsAS4mRkJC6yVHVzdVBNW2Gzl1YdMG02BJt/lrrtEmEmmMwKH3zWgTMS1+PwXAVMshXaeA L7kl0cjnBYl4Tf2B4oyWYiDTCZdk/kIk9Uznza3sDwmNv/0G+OJ3pA6XS+DtK+DNSyKaL55Sd4Pp hIDhw9N1sH86zwEETeJcCIY9+pyupTWIkDxjedmE/jHpi86SVQ0utSpaUECITBNIE6TerTOZfV0C PDXp+7RQGhEh5uMcfellRQ3b1NSAy3OYnKpDMZHNLU5ldOjaDZdu7rwkj+bNy7O721mQbD8GfvUV 8PlXBBg4Asj3fwZ++C+66PiA7JyOQJ7lwaouTRI8KysVGylUviU1NRlOYtWEXGOyrAKM079V3CQi rupgp8Bl1Pas9hPvzNEzAYFrFS54Or0hNWi3T+b3LNrEGKDbJROzeZvAUnZoW72kj/rlM4qHHE9O f16RFkiKki60dZ/mAHGP3dfAs78Dz39SJuSckrrNHiBlTFRNMq36UrONg2CCUrWfmqGc+UnicJ6n yP37fRSovHbj9alpsQaASjjCBXe/0yVN0h8A44r4yWmTkMYC3QGweYc0SZcDZjWnBEb7ZGZePD2f i21bFzSxNyEZzcWcyI5zp773tQ8lNR1RxnYdAIAAEMRT2sgJLYnP0bqZNatTMCXb9PH+OgjPcSow q2hsWZKZEA/vtGItl1X0QsbcmACS6XGojTmPZM2NqHshc00TCKvkLc4r1nJc5RYxenkoq7wZvexN inATGzdGLlejGyj1blJTA8QAih5NtETGfZdzCNk1FrBNzF2sod8N37ezdA7/AdrAT6oScB3Or4zp nU/Gp3ifnB3f3CLPZvM2/QaIDowPgN1XF6vZbWkSIJiTxoWHLbjxWiTxjGIs+fL9IdlRT1hVIs9r MhNrGZ/V1eBITYwGhdIgGhyt7RpEa85p2Fx4DaPWCx+KMs/KzPjaFj2pj0L6JQ84+y0NfZJ0e8RB 7tyjEMWQzbcEzkb7oT/zeaUFEteQWZlOCInG0AN02bUqOOt6XikKerBeN46L5AJnOU2SU9+Riwm1 vAYQkVkQSc3WCrMh+6agjDhI5ncE/ISgF1wbU3WATj8k4tZJWREw7j4A7j0ksPSGdL6a41dSuzKf nbvJ2uamaeiE82noJG25lqPTZTV5AdJqC2Lzvje/IqVrbXem0VMiC7SP0XKS2QHa5iY1RaJBnCKy Lr0fledx6ppyD61JaxnJ7XAOax3RLCtOl2zQXLxEYwG3JIdDx67OKy2QOAeMDoC9XbJnW/fowptb 1Nm6NyBNc54uB12ukNq4RZpJyhRT7dHSJNrLWQOeVFPkTAigtqt9WuLibf6nWu84gmqA4M3IaeW+ HXxo3qacxAVgFAV9fEVJ78iAu5wmkVF5xm6PirM+/YK8xC3uASBdV+dz4GAvRLQvUv2WVWiTMfVw Gx1wYUwJbNymrOKtLSJB8xngznjh4SarxEGc6S2U+jUFgAKAtu0G4UPVQFhBVr0bKiCxiEChG1PW +UWT9+C01vDLvN4n7RxaILZ8jLM8V/doQc9r6hA3kTKCpiF+MT7gELoJprqqCCCffEGpk8GQCStn 6F1D2d69N8D+W2rP80ZxgRUgkWqlnV+AX/2G3LLBkBJHn35JUbujMTA/44WlIkvGBFlVbeYjrClR TQhsRDiR0SbatJhkLpKYJZeaGBWeN0BUSS6WJdIeBpCSCIncmgQYjTyLow+ksUCtvJ2youv2+qx1 B2SCBpvA1l36yG5vUbrkzgPebzP0CJhPCRij/RDBvYhkQeIaIq2SmZRsYn9IbtbxEedxTqhDSMVm ABE1vvrKV5FT31h60iYmlVXblCnKHmYCYHLP6I9TWici0XKvLr5Xl3muyKSa8G46XQIJLAFnuAHc uhtAMdig+h5fEsCorbnP0PiAHJCLdt/IgkQ6I736BfjlKf1+9CtC8eMv6WHe7TC5PWXP+6LkUDxH V6NYiG3PtWu5jtBa9Vt8NYN4fY6wZvmJLnPQ+8SbY8TJuZtwPQe6F+uYuEpQ0gKmUfetNKOPm6h3 I2O7CS/sD7lOpEfbxF2WEZvAgc/phOpUd17QR36acoB1stLJqpfUu/7JX0lzDDaIHD38hLa/2yFV Nto/OdRrjKp87yalABnNos1OzsxkiaoNjeo5xxqQrCKvEQgUWCJtokHC5FV7OFq7yXZ9zwIIIH52 pyr/Gx4Oo7BETqtOiKiWFcWYpPOaZM6Xc/poj5hTSpb+It4osAYkzhE4dnfoBscj4O42+eFDzjZ2 B0AxPl0+QKqvfFlj0uCrYhGnmpSk54M6lcx9HYhyVVuu8KptibbR19XurlwnfY6cG58zPdaGuhwx 974XQRm/TyFHNff7mfG4b3V9OT0F14Zr6pqyv+MReTdb98hG3r1PFdjLBZHYH787OVhji5DI00Gk KNxu4xflzY+sQ0a7aO2hAZJoltw8dZU9EwWywPFASESbMGNBpoeJqVPrxQXWw11Y8W7YJBWJO2wL 6qzW6XL6X7nM0pvRcf3O9IjLAl5QIvasnHGVnFjjenxE09/+mzjJ13/kqrXHhNqt+2T3XjxdzU8K 7k8TdZNQDZ8lr3p7zryo7VEjp5pIFlPNohtbmRdn4DO7QMxPUs9HjoHaJvfjeO7vHyvuXwG69YGw GRlucnS64nuxIeot2mY2BQ5HYay3N68u5vZqOXW1/OvnwJ//nR7i3jYNc/nJZwScxZwa/uUzIryt i1RcE1vFZHWlqUkAsA44KWDSCXpfZLSJlmSda68KG5JjxHzpub8WE1Z/SAYsonly+R0BoM8M83ll IMDlgvjh21dED14+O11y8LRyapA0NQ0R9exHQu1gg0xPfwBsfwqMeJTCN69DhZqItTEXQdLQuoFb Lm6qDdQ26PkpNciZRZmgaLVRqzP8JL1HWaezxC0Srvc1wdROJ8ElFq3lu5IyWT2ekBOx94Y8m8sc UKQA8G+n2dE5AoEEaKwN+YI797lGlXMNUgsr6q7ToyTUYCPUTEgNps8AC5vnCKwspyUDkXuccpbU C0rJ8YrGyWmwXKPJexAwpw2hf0Ydz13gIv63C8v+o3KIRiZYcmf0kjtyDTbIzPg6kQlpjKND8kSf /g149Q/SJpcpZ+qc5RwF2KTn/HhEAPnqawLB1/9MYfu9t0Sc3u2QOkw9mtQmpBoFutGgGu2kSR+r j0H4vU6rpO0uPATpOkDF5ONz68CaFFTrZ/Che3XMKr5lLTsHL+g8W3fpg5Nhu45G7OoeAs+fUA3r aB+XLmfu5ukcBdHe7VDjj/aoluHTL4jENo40zGJBX8XRIS1LPiXiG6cR1dBnshpm9XL0Mz2pEFFe 9hoEaBVI63NEATi9X+aDkNW5/FAKbIC8lOU8jO0mVYJTHrpitEftITm1y5Zz9QUWLTIe0e/FjDon f/l74OGnpF3uPgRefU5If/ksVIdrF7PV6Ep7ZOUs4JLzyeIqoCQnlMYzGiz8u+X+Jtpk5c2l15CH zxyXey8yRIQMVTGfETCkbvXwgNze9zW+26WMKvDDt9Th57ffAH/8V+InW3eBzVuE+Nt3gCc/UP+P plA2Wk7g4imy7VjjZeidTkJP0iD62kbvkmqC5D5OukZ2PxdmDupjcfGy/NaT1PdMxlS+0TTERXZe AE++o9TJ+x4x6VJAUteE7O/+RP07tu4BX31DHbv6A2DrAeD+GiKATUPV4EaVSTYOAP+2QvB44Biw ffeA4cCTa1TDcgALoHMYw+dMuY5TxyCsB58bDSIAybJb0YhCRmUEJMdV7nrAG7/Nhed3yTrH76Bu 4v3rZci2i3k5PKCQxOH+xfMyp5FLHZ9kuaAbbxqg/zMAR9lKZxAVVusXlJsax8kx2ZcbX48LYtT+ XolkNIDXEhkSIACJBqDR59AaYBVIZB+X7OMPVOvUMzcunDf3/H40Je6iOZ2QyT46pGKk6fGHG5zv 0kEy2uPxNvYJ7YMNCr4tmbxKfqFckjvXcD1Fw/1QahV4Ehc6jYEYfvHWhWJtqc/wmoOjkrq/rpwr t+wlNXcuXpYvHwiNHmmOjMaQwfiaRJNKtLSugWUdhtOSjtxL7p75+he6hsRGlssP+0+aLn2kIyFZ o31CfFFSfqeoCCx1P+RwAOUCcnSRTqLyHAj7WQaGjpFYDs61+u1Y6sqQur0rCax/gLOBRGuJRpuO ug2Sekn7CABcw8vLMLqjdJldLihAdnhAdSEX7RB3EXmvw2Et+WFnx9x7fjNUctd10Cy2BgrWGtKw cPBxldogqtD37jTgE2iyfxoQS93KlvZIgbLK9EBpCW1GmMOk/EP3hfbjuer1Ah498bp6GULu3qx8 IK2Rkw82ZtpyDhzuAa6miKtlgGhtYYvQEMYCtQPKBr7OwloClK4sj7pdJJokDf8DaMdcMiYnCqBp XiKjIyT8BIhBEGkSF5sRPeJ0U5PWWCwojFDXFIOasZs7PiCOd9F6kIvKBx1Yb7TPyUBu9G6P24hf uqTIGxcA4ZZAw90EJINsEMyTjEfqM6MJUFogAdbGSYD1IIkIqvzGCk3Cy37YziXvw+amqYH5gj6g +ZzAM5tS/OnokOqMp+fo4H3Z8kFBMuevRcr2BhtB7bqGGr2qidRJ/9i6JFNkLWDLABKdJdXJsCjM L/smWsRHPl2yHsh6N7KoPZQsSBK3V4OkpUl4uPEFg2TGpaACjvGI+MjHNDMiH3yITin3nxzBdxz3 ZYxNaGjpdS/SWOpy4BgMToJyTGSdZJjRBkmT0ySrgm+pG524wanrLmYn0iAOMScRDyYxN96TWYRO VPJfu+ZnGInofcsHB0nDINnf5RK7Zfj6ZADauiYzUlSkRYqatEE0lrwuotagMIlmQQwekWiZ5y0r k/FsUqDkQOKBkdEkjXg0MiIU95YccSxk721Iol4FLQJ8pMF+pexgPouZvfzzxIo7K5U19/JbJiDR pkaZn1aVvYDDhsCZSA4wKRdJXeGWuVFTFiSsSWqlSXysg0spZseUxd3f5dT/YeAuV0U+2ojQTQOg CX14un2gUZXfEpqnneG7VIrn42xYNoY5jXKBG61ZGpyOuCYNk4uReJAg/p31biQ+okHShH9OoP/F 7NEhmZurBhDgCgwbvpjTV+QcdbsAmLQ61X4SXHO83gZOIkBolIlpEdgUFGlsJLE3KXHV7q9f5g06 79I0gBPtoThJrYJlTUOJTuEge7uU5r/McsPLlo8OEoBe3miPvrbegLSKRF99dFWq2ETTpAXVmUJq DYg0TiKiNYyvCdE7SBxEeUNSMuAcIB2vDGuyxvD6Omg42S7nq5vwnyvkv4ZeZbkSIAFCctDVZK97 gzACtVSKd/thZKSyopELbZkQ2RQoUIBRyz4xuMrcrOAkIS0cPBkdPKszJmU2BdwYOOYBd0f7gbhP Dq+eeUnlyoAEoJc1nxORk7E1pNimKLkHWydolS4P+CIxlZbHk9S/AiHg5qBAlNxDdi6AELOjEnXi wYh2kP+WJbGQ+YzGuhXeMRmHcW+vOkAAZKvoPqpIg0uEteyq/58nBdPc8L0+daKOttn4HD4amxZF a4CkwTTxXhCWI2Kq4h9LxTumkzB2i/xrNdEuNY+gLUk97fpfdblyIGmJJp5JEExGBIqCZxle4jmJ Njnq/JHkPBwFGOcAKUzy3g248WUUbO0e8zl1nuf/mlx9kNzIRxd78i43ct3lBiQ3cqLcgORGTpQb kNzIiXIDkhs5Uf4XvCkz5B6wzDwAAAAASUVORK5CYII= " id="image3149"/>
- <image width="156.57143" x="89.857132" y="140.67836" height="65.897751" id="image3075" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPMAAABoCAIAAACrNVHoAAAAA3NCSVQICAjb4U/gAAAgAElEQVR4 nO29ebR9SVXn+Yk4w73vvvd+7zfkPJFJAmKiKS0qMpQMIlQJBYhoaQMKWpZFid2WrdCuokpKWykX WtqKJbZDtraKUoWKE6JLUFBAlDlBSCAHciCH3/SGe+8ZYug/dkTcc+f3ywGl+7fXXW+de96558SJ 2LHju8eA83SeztN5Ok9fKKQe3NsVRfGox1xx9aOOHL/MXXlNfuWJ8qKNo+3Gme2eHtbu5vF9e/vu 4Iz77Cfb2z/Z3PGZ4d4pOx6aB7cNX4i0ublx5TUnLr92MDiito/mR47nWb/dOZLtbGa9QtetOzU+ qCvfDNVdt47vunW4e8oenHGn76mr8fneW0z5A7/FxmDjWc/88mc96zGPf/zFX/IllxdFBqfgPtiF IRyH2+K1TfeHlpMtnDzwv/nes+/5vfyDb2/uuKlyzj/wJv3Tp6uvvfQF3/RFT/yKK6691lx77eb2 9gBKAE7GS05P/+IMAMfgDNwLPaBlb2z48G363Tf6t/+P3Y+9Z3T3ba017vP2Fv+U6f7L7LIsXvCC p73sZc946lOvL8scdjuDIZydwx7oDmff0b2DcDawz/4228Dt1fCG37V/9N/sx987tvb/ayOUZfqZ z33sC77++n/xL7708suPxdOfhFFka5Zz9gHUAFgYAfK1pgZ6bNYMK6rM9n/93fVv/eTw7942amr7 ABv8p3/6dU996hWQgdyqAKCNxzKaV8FnZ37oPd7f4RzO4Zx3Du9xzreOg9bfMjp1duTPjPw9J4f7 p/3eKfZPqXtus6fudGfv9fun7fiAauj8AxNx94ezd3aO/OAP/q/f/d3fesEFwrtngWnOPgs3gwbA wal4/o44KoB17BnQsMd+n4GCs+x72GZ7d+xf+WOn/+D1zXD3gQ7PPwXK8/wlL33iq3/o2Q9/+IVz /zwLQ7gXBnAx3BTPn4QCDqCB7Xh8Jv5333KQsdVyABRstRyMGA0YAAeMenbwY79z+pdeObzvzmbu iYelt7/9WU972pcAsAsZHAUDu5HFT8WTpxb9ujvWXbI1ewos7LPvsIAHCxbXYjwodIv9+Of8+9/p P/JO+5F3uDtv8u4cGeHcODvP81e84jte/eofOnHiOAxhP95hD26LnK3hNNwaf3Q6znhgHz4Xj/cM 1kEOYxpPpmCffQ9bbAP77AO/+PvmdS8ZjQ++gCHKS1/6nNe85rse9jDhiWX0YQC+LB70oyA8AGCr c3wQQd0ZwNICGduW/cTZIshbbEH2X/9g/NoXnRkd3B843uHsRCLL6Ejus53x7VJ3rCfk2KuxGXgY 04wZCQNVuBajICevMQ1WoTze4Szeo97x1/6NP+o//HZnD/cq+rBvCQ9/+DXvetdf/vRPv+7EieMA ZGDgs3Aa0tM0ODgOV8bPZucefdiKn1yTOazFajJAmFf+pgn33c/PP7RXvuiHc509yMru54HKsnzj G7/7hhte9rCHXQoXwEWwc7ifXgw7i9h6C9qEuSNbF2Bl5Y/gpCds3aN4xXPzj997waO/cnPRU+4H HYOHwQCIkttCBqPpzz704Vi8knSlJgcUaMjINJkmy8jAe8jIAYsVnvZ4i2/wFv+UJ6s3vE3/ea1e +l9Uf3M9MxyWs5/3vOd+6EPv/+qvfjwA+7APLWzC0c5VZ0HAcRcjnpi+ING2ZhNw4CIr+9imqWYp /uNrsrfevn38kgdB3/28UZbpN7/55d/yLY+HXbgd9uEiuGTd7/oRT/eAObYm8tMZIKOfUcQzAC2t MLewtZzc2VDved+Rf/7SQ06qw1DewdxHpnlAaBfOwtHuTPZhkd9Og1tRAR485Oic3IPBOLpLtFLg 8XJSa176Kt66p575nUqtZO9Dcfa3fdu3vPnNv769vQ0NGNiOnx24Aq6Gq+FL4Wo4Dsenl6djsBE/ bTxZQA5ln0FBSZim5BQ5mcN6KChAGbxCZ+jrLvXvv3Nw/VPuD3MrpbRWSiulldYLjrVWep6y2c+a vpym173um5/znEeBhUF88Q0oYLDocwIKsPAIuAjOQgGXwRHIIYeteNyHI1BEruqDg15BnpH16Fls TdtnQ5ErcsggK+n99g1bz3rJ8XPsuTJybTMtxURyS8MeBg+DSzrvUkAPaqii5O5BpsgtBhqL1eSa 3OBErlnIyHMKAagG7UGBxcsFLd7gTfzqtf/3v+x//O0UvaVNX88o3/7tL7zhhp9VysNB7GJR5A2Y KGCAI/CweJwAZQ/OwEb8uglDIK6qFWxoKDkYMgJbUBCUCVtQGJzFFGThJbV/y18OXvKN9V//bnro errsmo07b74m4iXpiXrJcRmbug/A9sytXv7jd73hP9x8mId+1ZO/+Pu+73lwd9T/5G4t3AtboOIj gCFYuAQU3A0XwxVwD2SQwz4ciQKo6qxnx+Ly6CCDPuy2mC22Ndkuw37s8z69fYZH2NZkf/LrW4/8 QHPzxw4O1XGBNmETboEzcM20eD4TdcQSroNbYA8acHBJXGdMd6wzgNbi5S1ychNxbIs1KIsHcrTD 2jhmwmd9lHA28bWvezK/eiv/5pGMF73QGpn9tKc98Zd+6VVKmQiYEp420EAZRfJC6kHZUeeBxTJj dSNETrpwx/xNb968/muKVT9YQIdh67rzdg+UfvYnXzQn4A/gLgAui7hCaA/uAeBioHPsZO2evjjR JmxHVfIIIL3ocJFdHLiGpgxiyJXkwF/+zaW9/uHXvRxuAeAaAG6ZxpMXx+UlXSPLctExYs5SS530 gU366XxN28YlPQvSLZDDC4cYZi2Bxy/h5z68WHKvYqpLLrvozW/+xaIQA2rXeJTYWl5+4Wv04vm2 c1LWpvujzSjIALDwpr/YOHphdvjfNtSHYGvAwS6M4+8M+C5mKMulA9alJzzlMY9//CM6J4awF3WP y4CopbRRV2ERc28uZ+tE/cjWe9DbnOvYfYbAduf85Tv6e3923vK4jC4FljP3UbgcLu9cs7OarYly KuoDOn08ygXxhcGZKMsSicBWTGFwa7ngCv7D7y140CrO/rUbvvfYsT2ooY4OxSGMIn7S0RJSwg7s RPB9AezAUbgMjsHF0IufCrbgMuhBAZlgRIGDJT2FbnElvZKixXpURiY6suBIWZi28vyN798+JOr1 oS/K+LIyFbXFwgbsTB9baGALNmAvWrgCtW274AFz9N0ve1LkWmnv6QjP+rAPN8Kn4GT8DKPWuBvF hxxvQj/eQUTYRnybLrrbhj1LDcdyeoKqbZADmUXF18/S5ye+69iJiwaLGj5PBTwMjkEFvc5xl47C paChgh24CI7C0Y4RbAsGiQdycrGHWFzTWSRzMh9fz3a41+BNEKVegI4XxONwlqbCGq5/Kk/4htmm L+Xsl7zk6c985pfDWTiYXoOGnTFoII/HaY4N4BrYAgMFnIA+9OEEHImz4sKo+ghGpMX02ejRN9g+ vT4bBqdQBYUP8EsrMheWKnvdlfzz7+hzCFIoTR6RhuhwY8gyetCCh63OsY3a0pF4LFRBY9r13oIs y573vMfBLtwNpzufk/Bx+Cu4NS4/QmfgTjiAfbgTRmDjT3ZhF1ScEgJqRSia9BkxtjgoG6x8PJno WxsMapqaxuG7n+/7ucsP03VgIIuAs4EMrpwzXI7BwAnYkV6Kw112PkVHPGcO7dE5vYKemahr1nTe qo0MXeHbqGXm4GDc0jTeGpoxtiXLMS3/9vVk0yBrMWdrrX/4h5/TObEHd3SUHqCCEeRxBvcj62yC WoS8N2EQdam7O48+0jkOWHCGCooiGrAy0GCxFvPzv7BRlOdgj09kJ2o7yTbsaWckdIcq2JuTVYvp mkdedPRoC7fOuccBC9tw7bQltIWNKA7nHlxt3XDDZ178v/z9k571ge/5sfd/6lN7EZdNZnU+N4qD aEXeYbulVaimAyZzej/0jcd7/XPVVYS24cS0VUfuLG80goPl3TihnEIUAIWST/e/Hu+j2Pbx7RS0 +HYurMhZrKHs85XPnnnEInr+tz7u2mu7ckUCcWzHXCAmDpmF0stj2IywdYpGo/Iv/uLWD9342auv 6D/hCUce8Ygx3A0uYURNb3s5+M7nGpmRgy8Kvu7b+n/yywtduGvIUmcAfajgDBxT9D0VAQgOibZ2 DbDraDT9w6CRr3jaJXB3XJp3u8bmSKfg7DTfH1l4q5Mne096yv+46eMh2Obdf8YvvuYTP/lb13/f N30plHC7nJ+f3H2KktLQQL+gaKNyVlLm9KCfZXzF04//zZ/cs/Z1DkHJVibO9q1oFVlGpbTEw6jj fi8p2yg7PF4ckOm/glLaBsS+3SETx+T5/573vmVyfjFn/+sXPbqDDj08HGyU3DvT5jDXWSWBYcQn Ym0df+ITd33ds37xjs/eK1drrd/ylmc95zlboGEb7jTUOZeUUahkFKArGkXh8WIVmvHdFLHZr/4v G2s5W2tVMIAsSkcUFeCwGiuNjP9qfBASB1DAhqeGxtGCgqpp1htPvuQrMvgMEHvvKJwF3VFM5ykB +q4diR/95RsTWwtZY3/o2z/2vS/48iwj3XBMC2wzHtECm/QdLeQaB06TG2rAUA/Ygj6MoffiV1x0 CM7uxxfZhJ1pEJVoG4ZxmgkMFtvuAQxgC0ZR6xuLXUGRC6oTyCFkOpYpizJRbJsIiRIQ9N6LnPYe 7wMKti0XXU1vQB3ZYQFn9/u9Zzwjg9shg+Oxu8VgNyO5gSqiFB2tWlfEK2vgNa/974mtAefcN/+r dwwPXqzUHuDwOT3AiIcJNhmMaUY0GwwsrcUS2Xoe5F55Ql1wWXnyrrVBP8dg12MUfdjtTJOmi50U mQo+0VZzFvoZwNkDqpICxv4QEbY7D9uNcAvYgTulpXAGduc0/hnq4j3e9POfmr+iGje//rYbX/b1 Fzt25TU8vqCAoShkffCoFgPaUo9oxxhggxLymj2gx/a3PEG/fO3L0Mb2XxB7aX7V2o0xQlfHWJEr oYx2emlj7dl7+gvvKfJ+OTCDHff0b26/4St7Rd6v4iuPqZPiqEDsJIJSrMUpdEe2mRYJkJK/1gSG PnYJd0d/wwKc+ugvu7AodGw0cKwTx+Fi8JN8JORFGF0mgLC1TJyRte6Pf/cjM/cfj6qbbrLx8Ucj 1Amt6VGOaErKTXqHAdFf/ow1eNF7oG+pFA5wHcTpwQfMHb66iXreCBY31AeLY9YW0xdflUUbkY+S +EoAbl8ZEbWg2ffcub/wX+985x6dkdtia4PtPfaBAf0+xdacnrNBuUGvZgz0OA5sHt3b3F5rxJQp enU8Prnoc2fnmmRIFS2ziq/cAu/9k/0//507//iGe/77z9z38ifefln/5u9/9V6Dk4+Ztoe0YFBt tJN4j3OYNnwkSMqa8BG27g24KLkKF3L2k77+onh4Bm6B0+A7Tq+uorPfcdcdi2x9B5wVz84HP/ix g4Ph/CPe/bdJqokS7RPecCBsTbQnr7btPfH5s8tO0cu2doqd4/0TF23tHO9dek3BZB3d7d4t3lzG o0qcLSTMPaIGcnRDe/HV2c7x3s7x3tET/SPHescuGOwc72s91YdXnQjtceyB77A1cBUcO2REw96e 8UsilE/f08RH0IJFt5iadkB/nqf79Av0Bj0HLa2wdc1pB5dceRjHwtXAEoVY6HjnGrF6dUmYu1Bz Tjpn3W/82Omf/IkmtnMioQxepLXHqwisZ0L8nMU0ALYF6A0ALrxycsECNPKML+s24kz8nOoMSXKx 1nArbHX0pDtiKIyG5tSpW+bvD9x496mudg8bDSNgQN/R5OQ11kErkevxooUmtyc9eZZRvuNHTrz6 lf4yLtRc44IHoYDMgafNUDP8YiGjGrKnO50rE2CXs2cZbrFRYU6y/wPfU77qey5OvyrJaurHXnrq 1N0Tb3/b3z/gMx4/ZLxFvcHuPiON3mbg+Og+I2BjkZ4NjCehCnzi7FJP4Z237MHdB7QFfUFrGWyx ZbGn2MvINthosGPGGdkWGwpVYV0YJL3H3RXVhVx46dX9z3x82UOE+tDCTXAWHrnkmnz6mrNRTie9 Qg60W5RK8tuvrX7gVSWQkyU0YkFFx431AXKYdjJuIqqVxjRYg1LYFms40rE5Lei+h18z7/fynYj4 e6NspuMhs50rT8BxuBk+s7fXNYRP6PTJUYyjEGplUDOKBl9HXaLB1DigR56j7SLv98Mv1Fqrbo6Z VtqDwZccNFgNJcbEOe/nfOgOcsb7DPscSRK9pm6xYxqHa7H3sX+WsaYedJhyFwPKuakBM/3hbQwl MO0+9kpyO4et+wsMJgAVLTCgt83g9rNLlYezJ+uzHHiUpRLzwhYDgzvJmQyOszOiPsMusMOORhv8 mAokLHD3DAfAGLN5bG3W0hBugwMCaEx0Zs60J5hkD4JO1bLbzcABFi5Boz07ipfUsaMaQSDy81p5 7733bSdWqImzpqkAlArcv3Px5JoFnH311WfnDDeXwolFwYrztAFbcFrsA3t7i+1Zwz0Lx6MbmTH7 hHWz0BT1tCKVQUlmwaE1et5a0h8Uo4MpPogG3bN0QM4ykgsazAANNNQtTgzABRlkQ6o2YHQnoaEV jQgVj54Zr0zLPVWIukSBnmfuhdSjN2AgiOLMeCm4t9YD22yOO8MkEaE77Fg4w66GHXY22FgBfTa2 DukNODFnl2yZBCw8IPKeW+7111y0AHIGQOL9MlTWvQmgFDsdKDTL2XmeHTkyz+5iBTsMZ1fw2ZjM d+3e3k0LLxrtGxgl7b6l7dPfmMOIGfTIC7THN7gNNjRacm2iywZgsJ2NOjNRad0LML3Jg0pdsRLe urAC4mHE2OAyMkKYjqvnDAJjmowMdDuFzKdIo8TxpFEDNkbUa/nb4VpaR0+jV7RWKTJQOIfqMdik r8HgMkpgl10Nx9kpl0aqBeoNDh+UOxtoADxYzH3nLYs5u0tKqWX9LCTMffSiyZlZJi57ckbBzvRM PQPtIsk9hM+Bg81OOJGCAXzyE6c/urAdZ0/XonrGQMzM4GqGhPS4ShS+lqakVGQjRi1skgMOp0EF Hywl+cbmFBuY1jZRrgsV3DfucOdCvF7jznCQkVUYh9M44ekG21XbSyrggCZ5zmaS7XcZp+9bceCH 1BXtNv0WO6LJlmvFA0oxP58ZLkUj3rPPqMUNqSyNoeei2XTEfku7yeaYZkgjnbBP5aCgaHGG3Qor cKgerZGFdqnPRSyYPjLDLhzANpxJFs9ddsUIXTBwuIrKL2FNWZxm+nmqGQZnZ/9lDc5GCN6gNEC/ g6PnZHap4ADUdLiIKNEycQdwXzy/0TFd7HcmcQW3wV333bdYoR4NR/ucTC6oEZWFPv2ScsyophXO VmiPbvAj2hZyKqCiLWO0YUHRoyz6UwNQ16ahngbT9TJpOabRaGBEW7EvonpE3U4wnwXKaFypaBvs OM4OD34aZzfYonNx3ckQUVTRtLxUO2xwDSOHGR4sjVFpmuaAsUjohsbhDEq8jC2mR5HTa8ITGVGP MIBDAS0VqApzmt3T966xZu4xhFsXQbn9ySXdy/ncaU726cvjWrwYtEdUw+WxCQdnzAjdYCdhq562 Dp3WVN7EOZ7MI209cT2KNpmXAGUn0Gt20Sv7aqW37JC0J16b7e3Z4P3V1NA0tD16EitSzsVD6ujJ FbY+ygDIe1Ndr9XsW60AAaOOOcLhxNTQ4prFkp0aM6Qdt7bFs8gi2ZUtLbY9HMLukryjXh6lm+Xq ODtZYFP69HtxcehTbFJmney7hkZBQZFTiPEnRf2tzZsehui3c6A+fVnKRNXJYkjnCrRRP3B2i9TF cPNoJHH2IQMdZ2gX7uvEIp9Zc/kcbbDRozzggGmfKnHIq2m2Psson+H/Q6PHMQ3QIx+TLMQOKNA5 irjEA23HlTBurWnIi8W29gZbd1pdoPvkDdathIkz72jALPerHruwB+yyS8ipC5SFHLJ2RCvzyUOL ETHh4zVp9O/97GEyLa4CDuE9nZBEfYwYNTQ9em4J/EvUHirSbA2J+Q9QKmDuuWCjQsy9Y4XtzNcB HIFB9K6neIMebMDFILlk/RgxgphC9/cWe9Ha1tzHWUOTRe2toHDRG1vTxNzPosYZzBgDmaGtMAf4 jKyHOqCuaD0+y6cYzLR2vDI7Jg3RkCZD7TLaZTwvpEcYgxf91URnb9s605CXFCgP7Zwtyzif6Ul7 PH6IaXEaDI3F9xZHX8SfY0Ly3/KJ0Nu093EmQ/foNTQ1lQ3PCnHcLv7VMVKyojGYHkVJUdHUmBpz 7x1rku4sXqDzHge9qSmU5RyB0QEHG/QzjsBoj4MRI48aMBgxGlG7EKBXVTRj2mUmjmrkxniHM/GC ejxBIGLXy3Lq0QSNpJOmDZ6agEk61tRZzlbaCSTamvqXpNovNOGN4dbOtExLSwOnqmqx5DHGjGmK YJEoM6hoRrTJ4tFiC3KDGlKJAa5E71GNsRmZwh3Q2IlncYop66rd76C6gsLhDCYEIcQyAkBDY7EV DhC7r/xEch2q1gFFQdU6ayhK3VQx6aNh7B1g2lmb1HOytYLwUOkLK6jcbA/QfcqGscVKzLrHtFgf 2K6Ufo9JTa2MaY+iot2jAmxTVKM14eb77NfcdobdDDbZsRFrWazlTFo0DGdOsUsIT/B7DGXJdbHy SY3Zp169aHl8Ytz59cqaWR+knJwYtsfASs4uSpXF2Am/0lL2oFBJucWxIcOaWgcFF9WRNJGtS0DY epOiiWwtcGWmFMkn/tb+6i8H7snz/KovUl/7BLGoaGHursys8Qo1ILeQsk2Fs+XYRsXFNHz8b/iH 96Tx8c6Cp10j+B58+poXbmwxABra1A/SdOmIEY2DLcoVq8ObfqM9ZHmxrNNjq21vqnNlzNpQHi8q 7DKU6L1z0/9TSq21Ya+leZkNka0f6tI1JeUxjrUg7OvxFgWosIq1gknKYAQIbE0UutKJBYVWU1Lw I++sPvLOicy+8IryqbdvabQwd/e1bGgGIrmTvVnYWrLRkku4bdwfvd7/7R8+0B5/gKSUev4Lcx1D XGSVk1BPTdajBBxNQdGnaJevD3/yS+tnZFJDTWdZXGNYBiIciterHnlG3ilzMP2UKD611jMO3ftD sX2znG2tG1J7yMl7MbTD4/YZ5VSDkNPWpVFMkuvDqGa/xwYUjtFZ9qtq8ctYYwELd3N6TANG5GVO XlCYiBF9QCbOYCzkqBG1CNcMxEJnqc3K2pbOulG8PzEmQWZFjXG4JkIUC9aRaRyY1kcrqfXem4am 6tQE+MejL35i7svqDJWHHK1xQEmRh1KWDTCgLCgampbWoaSYmBguK9oae+dd+hPvW8/ZDsaMK6o+ /ZRym0HNeMSopd1g44DxPqOadosNMTKOaSraAWXiLQ81y6zV4LRDgW+bxf1rmtlsAzo2bMC0WBNg d6JZznbWVTQa9rFDhg40eoutnLymrqlzzoqNqaBQXAA4Kqg04wOGHnpsA0OamnZZQLO1bkQjw5DJ CWwWu14WrxIabBMsccphJQhEgUNZrPg7HHZ1YWLvqbENrdzfhRpc6T6B5S1+PHRKqd4A03qxp5pa Os43438StdeOnMj+2zt6gIc+eY6OfegM3qMI41Ic0DbRwm2xJVmPvKLdpwZ++NnmMNWcq7q+jxbo U+4yHjFSuAxaWgs9elAe0FS0DrfLsMWmpN0RTVLK25XWEWudR7e1S/DatF7inyS1UdBglk9B7XSc 0HZWBG1SaAGQjqMejlvaMXUymrqYlr1PZTgNaHaAPXYVbHMcOMU9pzhVL1l9upSwsuTHDzH71BYr qk+3P0Q36pGJuM2hRyYJz6uT2JVCYbvXp/tYrMN5nMM1tSMGQ0ocWQr/Fbbu3T8r6AMmpVTR08cu yl/8nwZvvXdD0hdL8i0GGp3DFsUGpZj/RD9paMaMbaf/PFSixsFPf6/6zIcOVaB1f3doYYcdYJdd GVAB0BYc7oCDMWOF0g+5RhbisOXTZXGZD+VGuCbRnDNMTdAV6E02ALF59elnZB6lyUuOAC0Hjl3N jmbnCKU4IEecrg+RDJt1/nY5WKQLIJI7izpJFnnaYgk1DsMPV1dnEF2ke326T1ITFeQlZU8D46GT TKSkOBLZ+qGrWp8X6uU/2+tt0Buo/hb9LXp9+lvqsouLK46rCtMnB6qI2QYMDIxpSwrJE5Ukf+Hv ZfC6JPuZH3R/8PpzcI1cyA5wml3gGMcyGDHKOiKpoBC70wYbhgWx+GtJKa1QWuuuyTzLpwQ2LLCN COUlWQGdAMBwfunzoKU9HRfxGOxme/RaTEWVkYFSaMe9onuZ6MZrogK6TMG11o1pc3KPMpgam7KX Rbq0WNvx1ERYbIUdFXisw1nIWVNZ2TlvoniW69N9mhbnfBT5yuLTOjjpTeXLDUBVwwesri8nnfE/ /9us63ZJZKY1NmFrYMTI4z1ZDQZjcD6adLrSuiTLyfsU45bvfMb+R955Dqac3kaxz2hErdEDeoZR FYKNsZNWhbjIMfWQKifXqBpTR/+rRuuo2Cwk733beGtCBHZeBE4Ia2Y0V8+TNXQd76ZdafXDT3rF 4iRiuCBvY5dZlEZXjIEBmw59lqFcUwVM1s9iwb8VvJAHwSw9lSXOlooZhFD0ELahJbevdToXRjSt 986orKCB1bsjeO9rjOle3xq5T9e0NMPTpvUpBwmohh5WBuA9UJqtTNCl9NiS/AgDBSNGPdDkJrhR sxw9CuFWYtuZkhS//Wv1z728qcfnpgKPh80IDzjcuBNzYTutamgqGnlej9zCXqh0nMk6k5E12DHN soiotnGm7fi2vKfDtUpNjkVNDG0wk2Te5H1ciUY6VFKUFBbrUaKJb1AodEGvT89iW5yw9VE2FTlU FVVFlZPLcriCFTw+lQpQqKRkKMjJdFgorEJpfAaGwNZivxM2jUJ9lTBVSnm0My5dn+6TFXahE7ub WgdTxw8RKaUK8pnXmA+3yNEeK1kaIrkFT1tsjUvGUE+WKom96y/df3xPHo4AACAASURBVH1Zffet D9VGTbI+qFjbaUgLbFFqVNMZ02KlDbm/qauhA7JcZLY3LXlJltOMEacv08gkDUryqwO2M5rrixfa EAdcpBA2QikGIxL3KJvAPkNF1qdfUe0zcrC9MnjXhhi6EhhRV3EkhLNVtKlnkMXSE8KOclnWaY06 hI116vp4H9NIOI733nfBuhhG+pvK+ynJ7R4q9oBOEfFE6WtJ3o+dOaZtYMCghorKA2QW2+KzuOgL OMnI3vYH9sf/1Ti5Ts+ZViowDY04cYleCGHlLUpgj9oGh2iKYV88TFIOybQ+svWEAsYoJ4aRmZRe VuDvme/OhUB7jzGR2wryHA0MqS2uIPMB/6mCvKYZ07YYTSaZJi6YWrN2eYEO8ZuI5O4GxHkwUsJL NviQNGYXXiAvnW1RmVNKWaW8922lVuNf771xpnu9zsJ9rPHE5c/7qeVMVj1Rw8t+OH4IgXaY0lOU 1Iy8Y3lQZAP6wIiRwWh0RiZwzsRA0BoUpUU95bnmn42Lt/6G/X/+o7vn1nPm73rcenKFajAGV1Ao lME43AaFQqn43PQTYesDmhaXh1KMxmLt8hQNQAR2XijTemtoa99M2yC6gMQ0E/1yxk6SdWLj5jk7 pCHqKONydI4e06TmC9LokW2z5VB7sdJFE7bmkHpcbp9R0yxW0r2XkuBKdtzRFCkYX9ZWMbnrgsa7 qQS4Cmcp+hIxI+lxazyx3kmnyBqAaVWhfVP5ppqKZhLYncKCgbb2EcAp0/hlsuHBIt1xTQtPqGhr 78Y8ZhTAiJGGLUqLAZuRWXTiMAG4DXUOkD33xfnzX8w7/8y99lvr/dPnwN9KBXt5QVaiiZjeMjmf oROSFKPWAQ2wRSFs7TE+mtcWUts4UMLWos8kmjePCDKRACmR3DN27kRrdKIcXZIV5DMxzzlZn15B 4eYcc6lC69oujIqIzlihOs+1OINYQuVcScwg8zNhRaDCgxLDcBjSU8dSDHsBWayw9VEGm/SjNdN2 U9oUPsXbpNpxX/NM/fv3lY975jlsGqEzyQQNrpb0LJicrzrP9fjI1mWPXOxRxHCJFdTf1Mzhiiyn N5g16SZkkgBJt1BlF2ev4mxha8DgehSb9DbjrhElvRbuZfcke8ntlKSOiZXvV5BH5+R98pzMYAS0 Rdy2gLKcvAwfWZhEq8iLiZd1MSnS/hyJTeV40pjIu2qOPj9srZQq4jYA4hGzWBU1wu7gtrTC1sAu VQ2GrIa2s9aLTiU6TE3d0IxpDmhabV/3tvwF33/Y5EWpo1CElFCbnlV3mNtNP5cOzj6gHePqENOy dJASzgaKnip6isjWMOUwF7qfOLtLBufwEsxdTsSqFkbUczslHVJUx5v7AmOCQ2vqRx5vrdNag0oL EEwZL5Wa1JpYE87h6apQ4oIxbsFGmilLusv0MqOSBeohIqUoyTRFRiZSVuDppBnxYIOsT9/DWUbN HM6WayxsUGoY00RHBNajFTX2u36Ku2/O3v3761e9trUtFpyPrnuJglShepNz+IIsDV+Lk3D24Zzu tMKmScTZiZJ1rx5NneySsETC2SKtV+HsqRcL7pJMdawCedDExc7d68aE+nXZE5MrvdQBspKl231t h4sqnQclqENnmNbbaPVUWpnWm0aB4hylapZjWq81OpvqrJm7BNGeTQRDlpPlhwl0uz+klNpgIyOz WIPJyXPyhZxdUFjYC2VGluJsYesGMoqQvqUmfqDXvplnDEZdpWIhaa2ABqMhJxe2LikzsoamCk5i VU32mnHydT5HbsWTrHFSZDW1J4Q3RXPesvSibtB2iC3pcPaqhTyhCxePJWZSIvKAimomPuGcKAkb h7PeykfiGJVSqarYjMCGIKRDwO05avxyvcA1YjmLZZOjKzkOswfhAyeR2QazLOrGYseMCji2EmdX NLaDs7Ppkc40z/qO9YBb6eC4S0FEMmSi5d//l7xflJ2DggBr7dkpOmrOZZADHvPA369bBpyIdGeK 5XX1Re+9syKtURp9jvzmvV/WR6moRV5ODHwyo4StxUr4UFBd2Re9cHdrJxscVVtH1GCHctM84n/K vvq67Oh0VZA21JEaWDgIeWLBnq07fty6g7PdIoT4nT/JH/3CmlZ55xWqJHeQwKbUV1CoPFRTechj oe4fzQ6y977BATkKvMMpnEanDPsCL9uw5uQZRROnb0ZWYypMSZahDcazvLqPh07sgUZ3p451AVu3 xs2sRHJDpZMtb9WOgMso/ZZpSG3bhDqmkv5lJswYpB5cssb91ZsXZ4mXvfzCy8vv+okj//qFG4DH ZlBjFtqz5Sdtx1ewkK2B/oDt42r/9KqXstY3GDGX5miNDqZTvI1AIHvAnB2Acrs4SDVhkoRPZDi6 jGHj+UPZRnxMr5LCdhW2xfpOGtXkvtiGZkQ9pLE4HatoWuwKCKxTIur0Ja1x4wNrrfVY07ouWhAz vuiUkoDovbeGBcrg1Iv4LpFCbQy2VWIWNQ22pRp578kL5T2mCR/pVoGAM6nEnx9qanPnzaPXfNPd 11/yudtPO8FHllEPtil7kGN7UKLtpL56JjBd4fLlFrdrrl/zOtZ6i63D3jeemFwjcW82BpY9wBd0 Fu+mClKKXc80eDeFpGWk0tekO6aE3+7cWMrZDW6IqfB13ImkRCnUCHOGkXzOMq7BU9Yx6HQzuKDa tuPrWUhRWgO0LXXFeORGQzs+cN5LeN2s6iDA+pw20mXRuKb7dDm+bTzQH6hsST3uc8V5Dzqdvqf6 l4+5p2p8RjZgcIQj/Wmc3fHmZMLWZTQaLuyyr3z2GnHrnJMFIZuEDVuxzM6cf0CkALwPq2XyL84Y c7uWvimBbYDgJz4UZ3ftFTqydRPrEwi5GMFYUvbIha2HNDXGS/7Lci60PuolKljTRKDmhepvaqXU TLitNXgXknnPyRoyc2n3PkS7aV6SF4vZOsuDkVXsrP+4dPLu6t99255kaexRd+3ZlWgIoS6ccbS5 VOkFljD3l/yz9U9cuDfS/J5JD5CUpijVTNCInO8KlBSgNuVRzwNbzzjkFwii6BoUhyrgPK7BOcjQ WzF9AzC4MY2j0ugBpcFLLblNcos1y9Vn571SOJxxTmmvc1TmQ1N81lTOtB58N/9HsPWMoaqtg5t+ FXm8n+igAsjaOoRlK6XkEd1yPF3M948uqmfo3X94sNfpWIl89GHPFpv8AzqEywe8J2/d1bYd7srr 1gkIr2tosD0yiyTd2R5ZSS4Fg3pkM5WD2uADmaXWrCkllBVICMOKDk/RI13gkZVTgCTRnAbpggap cCmWQ8Vq6hY3pPHRwJRSlHPw2CoCEoUagVmZoZijrCBgi9ISbaeUUm3jxAShlLatT+YIa5Br5Ktp EPyQl+ttzDPVKqT8SlZ4pSYLRbezupgvL5RMp0PK7MuuzWVR0ZnOtC6KHGhbUxT5JNZNURST1UGO 27aVqCyhg7PujpsXbD9XjeyNHxs87TE5IBv6mFC2D9vxD1iQl/A+JJvoDKdcWu68973NIC+WkbMh iMigRMGR0MsGGzOeVHdXUvlqnQe65YRa49ZWxzSNlzJo8/mOws2i8yTvejdyVdi67K/LFtOLzHwr SKM1mXhWN0NhEPHjpDIYC8jirHdK451q6+BNBG+NV0ppvSCCbwrbKF/0gra3FprMuK9sS1aQFxOl W/TuejyZRSk7IyuCneSQwvt3Pp0XoENpQo6xBZzh4BhbabvVPCYXCvU4AozZAzZCGt7ol9973797 wuKNFf/shuZpP5kTEt663pwQCiFSXCvtfIxE6DlrfTsKwcDEpJCiN5tk1SXnPNG6ZwIr5y00GAUD cqKnPVxP4GnrfF27JJVM67Veil9M46thGIveBkA9mkCLmbETu9a8FWUeZy8YLhVLWKg5C/8MaXSE +yh0TgYMaVqcRhVkerm12VgRbOgMNQWblHcKyApvmsVMG2x/SpnmUJjbuyl1RNgayHKUVmI6n4Fu EnomX88VYffC3tvnRt00QENjlgeD3/7p0X0YwOOzaG820UzRhcJa+RCzb30zxvuAZVOn9TdVM17V gV22TsdZDCccTUsuE6V1ppVVU+ve2j7M8jAo9XjaN7zOE5c0zjU423vS1jCyeLbgURlKoVu86VSD VaiSTEesUmNkG2kxOY1oV+RxZZkWYKgUSk8h8mDRqydvKBkAosyZxkt9CcES5SG2qM5yZiq0iBiW AS5K5b1PBuy8UEohmXnS12KT8u5QWpMm0xTNJHezXruoWEYmFO3WLaNd9lvagV5a1333ZJSF+DFW hZJxzkLrvbPkeTDXOu+snQTYFD3l7JSTYXXvee+CXwIvkdkqHo8xFm+tzzJl7WSty3Lq2itFWeoy qi6tce3KbshylAplQ+yiwOfFeZBNF0CGpTjRXCUdE3YJKUK5ZQi1GbzFarSkcBLMSc7gxAusYuXS HK9xBm+X50F675t6gvmsmbCRaX27yDuTF+Sl6sakizcxL9fAbNGtBCsnPCO/FUEueL0r19uoyuSF Ejs30zXjVlBOLs2Pxe3bFIywjBqaOuQO9hxNS2ux+83S4tbD04mzXUNgK49KRQbbVjnrnfPeT3QG 72kqscp3WrvypZzz1ltCxp133mmFQhnv21qSu5Qxk/xR4U7xss2gkVWPCddMxT91SSzZM2jQNpPy xGkydGfFHGe3k7MyH4ogrQEXHVqZFLS1qDZMAxRKoX0szis5efcjOG4WV0XgkZfMhP+nQMf7lxMw I8jzUs07z9v4xBV27hmqMWBKaCAjKyj79BfmX9hJAJlW9GrqPXZNqCK0CtRXQ7Er2zrW8PadjvLe O+fs9CYBywLTV79Ulqlk9Rf9XgSFUirLlTXeTu/s5z22FROquh+DkgoEd++ZYlbzctprMwbobUyJ +VU429ogrRNbAy1OoQt0rJ0uhYKoUaDiFlKesPNQyl88N5KCY9ZMZGcaLZjNIEpsPWPdXEYzgalK hyCRiZyuJ+tGl7KcojwsWwMWuxFLo0hdm2VXusm+7mh0j15La5br3Il8cPFONifPofbee7ox5cs0 kODe8/J2a9y3EsiTmNt5sRT5LA/MPaPDCFuvfYWpp3SaIMxtO3npouCm9GrJjJT1TNTN+QDu0JKZ 7y6gEeVBhY3MlGdSrMGHUiRSUjYAcRf0YuexHhQelEPPby8SbuJoKpcSkqNhJFjmkyiNrqbgEp+h 6iCcXJtfY9rJnmtZEQIGQm7OdHyIAJ70LJkPsm/s4Q3b4uLOyBSFwUt96zLGlmUwoN/E45rxPqOZ 6I4R9e6ZpVVpnHUV1pNlqMq13vvGM9oL2EwY15rJjluACFeZt9bgnBf+my2qP/MgQ1sL2FBZjlLh WGc0lbcmVC43004GwTzWTMZFqVUPSgEhiUdnfM9ZHlYD007GC6ZweTJzJZqX2b5Bgc9RDp9qHkQ7 bBB90bPlbVwQhXx0g1XOe7fKni3KcpiaKlQCVxqlMTFDcR5dTd6q6XTEuoLU1TD0cpbj3cRPO6+v dFcGqcySF0QNWR0mYrZqKOIoNjQ1oXKs6ViZauxB3GWhDUVaCmI2uHC580vnq/dUzoOR+oOynoih d0YPkWY3Fbal3KBtJqn4UXte9S625eCsB8q+dzaZjSfHSnnnFut8XUGeIP5C0jpAi/n9aLotMS2j s6HxMPvQecvsLOOYJuSTWshQGd5G6ZJNQp28Rkm5x3SLVF1FSrs7u7Yo2WShkfntHd7hHNYEgSp1 1oh8PG95lUE9ZE6kmIeC3TT2TlYsaKesvykPb+3M6dK4IW1nbs8RmClULKu5Zg4lyFH0BCrM+i+m LyYrvPezRVS8X/NqpmMqTt6QmeOFfWhNQHdFb32YT7ZydiVq5jLEQv7vzCvEGTTH2TVA2mRDmFuF HTvpFsLL4vI6c9sWjFVaqyJDqcW5+EpjGu+9CI/Qv9OxqSomnIc3WQGm19ZmV2oBW6fMZ5kYaQTE mJhwfDUElKzjaxIuAdg7ZTe3fBbFR3k4th5PKtNmkFmwdtV8VQqtMqts9Mv6+UoGMySQr4yuEJkM K3bDkaesZms51nrWCCbjJX2+Vu4c0ujEzMCt+9V8VQYqR67ReFANyFYELd4Hb4IyDu99lvkM1Y3a 6AZZW+O8X6qg5IW3RnmPeB+dxbTeWXSWjHSTTCGBU3mxIBTbO0y7Zgsf76mGlP0QPaKzyUPlOC4v HibPIrhzvTWUfXQerlxL1TD4SlpaR1vFyZlKPHoo0Bk6HUshPIfX+JpaEirMkmLSAMrXlbXGtnVA z0pN2SJEF09+9O7Mlxqz8u5Au5KzrfFtrZrKm5ayz8yxtT72oerGBUiwcdFTs+hoyVPyguoAOq6W 7hS1bdhfnY6nPS8nEa3C6OJ4N5085wUw9s6b/RWPkO0DPRGZGBdqzaRsbu9pnE/4VetJGrP3yrTe VUv1BlF0vE8tDu+fYhRlMJTCxgjdtNfOPK0eHmlUKGCisS7cfOZYRU9kcrZ3UfXhK8Pvn/atweVS u3oy21PNkBIUqo7HqV74gNzg6xhRVC13DeaFb6rQ8miq985OtMbuYp06U0j+pWMi4GqZ3daMD3wa i7b2zgb5Ijb+2IfhWFhQ+rCpvIBjWIPoto7R1hP2nad6SD2aRENAKDaSqpFMCm83kwm0YH397I0L kJHWwSIzv92CsLVpqUbhI+qCziiWuLiKnmgwHuWT/68beisCQKz3yxg60Wqrn0g1caFL4xcetzVt PfHxQqgAca508nbnPd6HPsyjSi250hshjzADMmxDMwzZXxLhZO26NG+mDRpKhYhc0y7mnu460+0H maXnuslOVqAzlF7ah9HEBBKb2gtBwkVv6Vtd+oipvXeZVgTtEg9O6gR53EzhERZy9ifeu7hzhblF BiTpFaR1lKzRnh9yzpdVeUxRBEqhNHkxgVCmnTJXHYZWl9vzbhVDp2Nk4LPQgMU2mUM06Z7byAqf KbJOELP0lgxu2vXL42u8Rg86MRgScZKTFcutwkleRDMzOlN5QX+TotdBBQ3VcIrdpWPlfVsxNy6O uVpKPooAFvWhdxO2TmTb2QWwS1pPpamnltcH8bO8XOhqtWfBAH7mA97GfUDyHI9AzODE8k5mrRIt QWe0ErLQiYAR5JAsG/OUFb6K5toQM9Bg2omAmcEe3cStGTo4u6bcnutEh+XFpOS78HGbch8LdBas S7I6CU8049Aqa5YuQV2669N+uGuzAqWUs8EW6yy9DTXK2rp1zqpe39b4eKz3aaXgRrlBC80Y723R X/pWWT4BCUBagBNkEmOF5FjQWdPST6QfTDMbRTTbdSYYTGfGsa3D+CZLc0oRSHzv7Ox4LXyfwY7o 6NOBqXMDLSMoVloZwU44Rpg8TNcnWcDZd30aDWWJB2OihTz6XETKCoqaaYc1zHhVlgXcbO5M4jSk oc044niNaSYO1eDBUUsn6J03LT6fyDvSLJoZ2uTr0tmUNFJqcqWzKbssOL1W0+m7aGvBY15nypoA QK3xsSKPl8oT6VgYpegx3p9YHjaPLX1EXlINF9hAmwrRd1MHBpv9dOicjzv9jffWaA5pKW7rqZtM lKuMhO8TQwslT43E5yyDlJc9Mhwsk1zyL0mIlBUmWWyFhdKds2IKXC3g7DN3hwMvKGeMd+Tlqp3A l9E1X7b4/CMeF8wgiZQGh/eYemLn7rZbqdCPkxduMQ23fHBNGxZK9GR+UWoBROtSsi5lOf3NNc8C ztzj81KBMq131oMKoDOWfJin5KLrGtS2jy99xGB7sZVGqRgIurw4WOpn4NYb17/OCpI+DBLKLV05 vZ8Kypuhp3874wMAbydgz3Z8F2GBLWOgSEcZCz5s8dEU9DYYdbaMXjCkzZhbbuTSawFMnBnnFNsk AAN47NctvuAxXxOwR15M7L3SQV2Tc/KfC0kw90QqtDjDzR9a0xhZChb2e15MSuos/XmUat6zsbXq SqGTt4fcH2eVVKI6JDkngaYATcVgZykaufaxq2waEniTKiMzh0cFZJqGf/ibw7ZtBYmEUppMz7Jv wtzWLLDYln2e/T1cfHW8Tz41st2bJN5bZs8WtgbO3jM5uXhU3/oGvuN1YUERSCAsLpJb8ElYC8xk UUgezjScwjozw5CXHDkRWu8cXvaDmJ6jyeScyLTYCFEEIzpDVnDvbQvfYEKCRsr+pLWJlUXqdJcw ObYmHMhKGqycjvIQ2x7sn+bgTFBIyin04vOYnpMXOKvqsResn8CuXJDYcb7rhL74yRN81aUp614b hFzXWDZpige45SNr3sW0YSBEuUoUZmC0G0r7Z/R+QfzCMKJHXXot3tHb5MKreNRX8civmCmQtDhk j2j28Q5rqcchUsA2oZC2UD3GNBO4wTLOfv+f8u2vnYyu93iHswENJ/nnTRC9glOFBHilTMwX/Qi/ 9r93bq142U8ELS0xkOlk1HbPd220KRTGdMbv5g8uHuMu+a49O0PpMGALKWwA2QQJKiBbBqCtecTj 1jxL2nznpzh+6VSdeaGiF55b9CSiiKI3pWmlr0UPbzhxGffcOnv/vGQQE81E7U493+0Z0SKKPvVw MRLQGWc+t+5dDAdnYM404T1NhWwg19aT6VduTBojql7oZ08z5tv+D8oBLuL+ehh6OFGa4TOjM/Hg jINHhghIUqQUkOXsn5r8ajFnf+4z3PpRLn9UWESSy2oe3s3D30RicHjyC7n04bz3Ldx5E1ddx+Of y6WPCG0ietS7ekywTGXimMS16OV+1Lf9ytJ/TW7oQl84G15EZ7h1aUiy8swAle0T9DfXz6W//2O+ /uVrrkmYWCwzIurygtZNsPLXfSe/+Z9mgzxf9JrOV730Xbr3X0h3fnJ99G/XdFsNF/eY9xNT44y7 PvGGcGo5IMvxdtIwcesmO8FhqBslIVl/IkHkvMxDoaUY81d+gB99G8QJJAwhZcFmlRKFzoJ1LMFW YWspb3D19Tz8seFlJlXFYqyI0mRFzMyJc1Eelxeo3uTkDH3ib7n7M+v7wnvGe2wcCb18SOb2Dtfx TSZ62U/wrjfx2Y+F3RecxbnZif13f7Kes4VSpdmZlojkvv5pHH0Df/VG7rkFnXPlo/nq53HldWFJ TKvQindZYel/528fon1qKnxq4X5a0oBlPSm8UfRAzSXFRCf/YWJLupSS2FMya/q7d3Jy2VLO/uR7 ufkjXPrwkCUh3CzxYoK6dDbluRXvhpTuFTu3GU1hjIAKIo82lfjqZ8/Xo4DMkrOzHWNatKbohbmh NaM9fu+nDtsXt97I1V+CUmQl3mHbcNwdKmswUYSEN3K09ZTPNcu57FF846vCsWgRwI8+b2odvOcW Rrvoua410eyaDsKjW5oqSJ1ODCpKcdVjePGPTrnGxvuTJnXfRdSJQ6Q7T/pkLYk11jm8Xbqjo3eM 9zE1WY7KJogoWUsTiUxLDBOAmSZFCqR/zRg05XzXT5mFSovhWCZGU02Z55dytvf86HP5qfcGF2PX TulduIWzk64UNm06icczzt5UNYKo2IpiKq8hPaLj+a7dJ9nC2jo+1/B/fd+amIcufe5TXPEoYFZZ 7GpFExttHrg84Pt4Pu9hmhBLWQ6m7N8z1jzv+N3X8exXzDaju1vDVNFkj2koN3C2U0pTz4I02wT0 PC/hBOzK9DgMvfcPDyUmRbNCovkcZn7rFiDa0Wd0hmX2qK6jQLTbpIPKs2ZdmHGdrw4m5XKUDheX Ma3GtNz4V1M/XOWgPDjN6//NgvPJ4SRyWsLzz6mWktZTPvlECUWtgIB3fJLXv3w92O3SyTsOe6X3 tNUCrSudJ+LF1fSetwQz7WEoGfu67G4aqoPJpx7OSorZm2iK3qHibOsR7/uDQzVMZ7Mu9IX3X4jp TUMzXoX3unh19qEdidON7ureHCg3piJgP/m+6fssfTIAH/1LbnjVAoAlzN21NR6SsriCtzXVwcTQ o4sQgW5qmiVRUE3FW/5P3vTac5DWQje9b/01U43M6W1S9GffLssPxdaAs/zqD57bQ2eE6PKUmlW0 wlmb6Pd/5tC4thNnspq5mWu/aHXz5vyuKDTNVHURCZxCeGMYPqazR16WijCWU2yd5XzmgyEUNtH6 UXr3mzk4zct/fnImeJv1xM6d3jYZ7MKVanJewqDFmjavTCS8OEMCSUcHvPO3+PQH7ueWYtWQj76T L/2akNkaLPTNlAWzm6snEroZh/THmfPzk27hsnvnJ3njf+Yb/rfJmVSmsFuvsEsp0oNFOJVu+ISZ UzrdlJ95Gb3n9/jcp5f+d4bahtHegvgQgU/prWXEZ7bCKnpBExPPke0Euk00qHoCz4h5WDO8kRVB u0ua3iTxLwaF24a/+6PZxh8KQ3zkHbzm6/n+X2Pz2HTvu9BiUYG7YRghDjgLRhmZwSnsDvB2CnKl V01zIy+oK/72Ldz0PnbvO0wzV9Ff/N88/MvobQSeJioGRL5c5rWR7IQV0Z4rRPhH/4qNIzzj28NX UcjoGLZFqiWbtIQpCy3Dqd2YENfpw26cRhqXGfqHd/P+P13a2oXPEgg03y3E7QtTNJLwZWp/VwbZ ZmI47mb9iZiDEBaS/AYznrLUaXQMIyQzWs7v/cwC+HpYdHzPrfzQ0/mG7+drvnXqvJjSumwhCWAy tyS70blJOP9h6LYbef+fct/ts+vLA6F6xA2v5Dt/iqIMTBMTKWCJ0D0MpaSyZfS+P+SuT/HiH0Ev igrKiuACS6n7CbDKEHahczfgMe0oN6NoCnhlOj5E6IN/xgf+/H6+5gpKOHhma/TV1wsdxt4nPNMb UI/CYpvACTDa461vWKzSnEOUk/f8w7t53x9w7LLg7g/JAxri8jSVPaCD8zI1pWtLoVP5tzsA3vGB t3HT+84ZTK+ltubjf82jv5qyA6ATc89TEoHLKLH1e9+yKmNt7yTv/1OuvI6dC6NyooHgZWij5Scl sxFTtRObCokEzfJOTEicnHKrpNnbdqqUijH80ev5zAfWddAc58+0mQAABI9JREFUXfUYLnvE0v+K 5cTaifWT6TCbREHSuWA6U53IJ9NOLOIT37YLKZiy5ouTRGwpE0jjef9befebly6n5xy/Nz7gg3/G 37wZrbjk4cEgKIZVaUdThSUsCGyLM9g2BDA5SzvG1LRVuDL558WsKybkc9X5DknNmPe/jf1TXP5F YeyTg3pG1xFTvdarMKsi4IG/f+uaXEzT8OG/4OYPc/WXTrxdzhJSJt2UZ6CtMC1FT0pKh4Q/04RI VzkZAFsZOCn0sJkslSk++8Pv4M9/Zco5d3i6/NFc9oiA30I4bvdYh1iovAhjF1xXFinbEDQZFyx3 MrJZPjGSinYotj/bhqIfITRfBeaR0Bok8NjRNijNje/ir36T+25ftdg+oMr1WnPJtXzVv+Rxz8La KfRDdIB1bZzOBowoAQYzZqyJ08fxq69kvM9DR0WPa7+cx34tRy4AgsadqItlVySM+Wjm/5UfZHj2 UM8V58tTvoXjl01yFpetyCn8JuURdlNm0jXpQBiOaAu/8V189B1rcgtW0xNewGOfDtM7gi88TjMt jX5bT7S9FEBS9sPETtek8I0UZiOWCRt3uE3nqyGfeA9338xwXa6J0IO2J0Nvg6OXcPkjOXEFRy7k 6EXsXMBWJ3xeDPLiksgL2nopZwN7J3nnb3PPrdEHdo6bPh6e8oKjFzM4wuAIW8fYvoDNHXROkbOx E/T9rCCfwyRZPhmVX/kBhos3BltKW8e4/mlc/zTycilnJ+5JQQEsMq51L/aeWz/Kx97FyTsehE57 0gt57NeuYmgi0kj7RnQ5m2jKEC4XtoYpzhYFXVak8UHI1mlrhrsMdxnvMdqnGdM2a3IC5+mh3Xvl G1/JY54cjgPGikrSas6e/+qWlObRGX/8C9z+8QetzZ9nKvscv5Qrr+Oqx3DhVVOug8Q63XSsec42 Dbd9jFs/ysnbGe4+hFLgC4se2l1YJJoi5TgmzDRPgh1FRiZ8NlVBy4WSRTAVHWbN8koWXwjUVNx9 C3ffwt/9MRDihza2KPrB4JAXFCW6CPY1weimDsKsa1c+T116yDl7vB+NDAXeT6J2kpW+a7OUBA1Z fJEdhDs+oCTjU9zsOQVAfkGQqCLLKkmfp8PTQ8vZw5j0nxVkeTDCz4htifUh2miTf0TwWRdHpoyj vJzMBK0fakh1nr4g6aHl7HtvCxpSqECppgzeSQmTFBtiMWzxaOpsNoK0m+KQpPV8ZZ/zdJ54qDn7 vttC3ZJE3eR7STpKlRhSlrJox6JrzmSGJses2PbDnDkPNM/THD3Q7eBXkzV87K8heobn83GI0cmT qO54vDbxu5uBd57O0ww9tJwNvPUNfPbjh4ob7pI4lmcqrZ2n83R4esDbwR+CPvYu7voUV15HUU7F BkyOO9GkIqpTmc0Z/3ZK7ewef+rvpxLgztN54qHG2ULec8uHecMr2DrG0Yu56GFcdR0nLqfoL04a 9S7MOLF/J9u24JnDFxI/T/9/pn8CBjMVAtaWWqZ9+hN/oeJ5MY/Y896K83SeztN5Ok/n6Tydp/N0 ns7TeTpP5+k83T/6fwEfb2KSI/kgFgAAAABJRU5ErkJggg== "/>
- <rect width="285.97864" x="26.028843" y="78.512794" rx="0" height="284.96848" ry="0" style="fill:#000000;fill-opacity:1;stroke:none;opacity:0" id="rect2995"/>
- </g>
- <g id="layer2"/>
-</svg>
diff --git a/tests/manual/qtquick3d.svg b/tests/manual/qtquick3d.svg
deleted file mode 100644
index 3b8a5c7a..00000000
--- a/tests/manual/qtquick3d.svg
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0"?>
-<!-- Converted with SVG Converter - Version 0.9.5 (Compiled Mon May 30 09:08:51 2011) - Copyright (C) 2011 Nokia -->
-<svg xmlns="http://www.w3.org/2000/svg" width="287" version="1.1" height="286" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="tiny" id="svg2">
- <defs id="defs4">
- <linearGradient gradientTransform="matrix(1.0104795,0,0,1.004441,23.387309,76.758859)" id="linearGradient3730-2" y1="131.35715" y2="156.39526" x1="23.626827" gradientUnits="userSpaceOnUse" x2="303.57144">
- <stop offset="0" style="stop-color:#038d30;stop-opacity:1;" id="stop3726-7"/>
- <stop offset="1" style="stop-color:#038d30;stop-opacity:0;" id="stop3728-1"/>
- </linearGradient>
- <linearGradient id="linearGradient3724-7">
- <stop offset="0" style="stop-color:#038d30;stop-opacity:1;" id="stop3726-7"/>
- <stop offset="1" style="stop-color:#038d30;stop-opacity:0;" id="stop3728-1"/>
- </linearGradient>
- </defs>
- <metadata id="metadata7"/>
- <g id="layer1" transform="translate(-25.071424,-77.933617)">
- <path style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#00ffff;stroke-width:8.85648727000000060;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="path3722" d="M 149.39285,339.37194 C 118.29002,338.06386 93.410274,329.21846 78.267585,314.08502 66.239667,302.06444 58.159936,285.11057 54.818135,264.88047 c -1.962614,-11.881 -2.442596,-20.11519 -2.455216,-42.1199 -0.01051,-18.36712 0.160997,-23.0644 1.239861,-33.95521 2.529982,-25.53941 11.482605,-46.43472 25.677112,-59.93007 16.042727,-15.25252 39.462148,-23.21337 72.203768,-24.54383 6.77105,-0.27512 31.97542,0.38686 41.46813,1.08915 17.85829,1.32123 29.86273,4.01251 41.92069,9.39824 16.71724,7.46685 28.60768,18.52238 36.44553,33.88638 5.7477,11.26691 9.34961,23.29707 11.69339,39.05536 2.22754,14.97664 2.81073,44.00559 1.22086,60.77114 -2.76934,29.20404 -10.704,50.36949 -24.19378,64.53629 -8.65346,9.08774 -21.29946,16.39504 -35.37578,20.44137 -13.11053,3.76868 -25.14568,5.0858 -52.44498,5.73944 -13.81368,0.33078 -17.4242,0.35023 -22.82487,0.12311 l 0,0 z"/>
- <rect width="236.93414" x="49.282932" y="102.78797" rx="95.84404" ry="92.255867" height="239.43414" style="opacity:0;fill:none;stroke:#008000;stroke-width:3.29858350999999980;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="rect2852"/>
- <rect width="175" x="28.571428" y="19.214285" rx="95.84404" ry="92.255867" height="206.07143" style="opacity:0;fill:#b94b4b;fill-opacity:1;stroke:#05d105;stroke-width:4.147;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="rect3704" transform="translate(25.071424,77.933617)"/>
- <image width="191.18274" x="73.931854" y="148.93103" height="144.13199" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAK0AAACDCAYAAAD/CZsFAAAABHNCSVQICAgIfAhkiAAAIABJREFU&#xa;eJzsvXmUXdV5L/jb+0x3qltzqVSTZglJIECI0QYMjTEE45jwVszCcUgcp1fil3ZC2unl9PJb7tXL&#xa;dl4Sk7x46DhJ20mcvNjQL7Ed2wkewIARYIVJDJoQmkpIVarxzveeYe/+Yw9nn3NvSaUBnO7w2YXu&#xa;PfecPX77+37fsPchADjeprfp/0NEf9YNeJveprMl+2fdgNMRIUR/5vxthfA2Cfp3LWkVoxJCEgz8&#xa;Nv3Hpn93kra7uxvr1q3DwMAABgYGYFkWbNtGFEWYnZ1FqVRCqVTC3r17EUXRz7q5b9PPgP5dMO3Y&#xa;2BjGxsZwzTXXYGhoCFu3btVMSymFZVngnGNmZgblchmlUgkvvPAC9uzZg/3792Pfvn1vw4f/QETw&#xa;M/QeZLNZbNu2DR/4wAewefNmXH311chkMshkMvoexYyUUjDG9PVWq4V9+/Zhz5492LNnD772ta+h&#xa;XC6jXC6/5f14m9564j+rv76+Pv6xj32MT05OcsYYZ4zxKIp4FEVt3znnPAxD/ad+bzabvFwu86uv&#xa;vpqPjY39zPry9t9b+vfWVkgI4ZlMhheLRT43N8er1SoPw1Azp/mnGFR9Nhk6fQ/nnH/1q1/lq1at&#xa;+lkP6Nt/b/LfW+49cBwH999/P15//XX09vYil8t19AwQQkApBSEEnHNQGjfV9CpQSkEpBecc9957&#xa;L+677z7kcrm3rD9v01tPbzmmffrpp7XhZRpPijnTZDJo+n71u2Jqzjmmp6dx6tQpXH755Ynnz0SE&#xa;EHz4wx/Gr/7qr2J6ehpzc3M4dOgQFhcXceLECUxOTuLYsWOYm5s7574DgOu6GBkZwcjICIaGhlCv&#xa;1zE1NYWpqSmcOnXqvMr+j0Jvqffg6quvxujoKLq6ujQzcc4TDLkUk6WvL3VfPp/H0NAQNmzYgLm5&#xa;uWUzmWVZ6O3txfj4OPr6+lCv17FmzRo0m01UKhU89dRTIIScNdOqxTU6OorR0VHccccd6OrqQldX&#xa;F/L5PIIgQLVaRbVaxbPPPov9+/fj1VdfRRiGZ1XPfyR6S5jWcRzYto1PfvKTGB0dBRAz61K01O+m&#xa;5FWkgg+cc+TzeeRyOdx///34l3/5F3zve9/T0vhMbRwYGMD4+HjHunzfx969e5ffaYOuuOIK3Hvv&#xa;vdi0aRNuv/32JbXHvn378Oqrr+Kv/uqv8NRTT6FWq51Tff9/p7eEabds2YJLL70Ut912WxvTLcW4&#xa;CsMGQYAwDEEpheu6p2V0xQSEEHzwgx9EvV7HM888g9nZ2TO20XVdOI6jv6eZvNFonBM0+MhHPoJ3&#xa;vetdeO9734tCodD2u7k4N2/ejA0bNqCvrw87d+7EZz7zGURR9JYHUbZv3w7f91EqlVCv17GwsLCs&#xa;hf9W0VtiiG3atAl33nknLMtaVkhW3UMIQRRFaDabaLVaietLlaMMs66uLqxcuRJ9fX3LGmwVxEiX&#xa;abaj1WqdXcchmPbGG29EV1dXW5nqs/mvbdu47rrr8Fu/9VtwHAeWZZ11nedLl19+OS6++GKMjY2h&#xa;r6/v310Y/U2TtKqTfX192LZtG+644w5EUaQl6OlU/+HDh3H48GH89m//NmZnZzEzMwPOOa699lrc&#xa;dtttuO2227Bjx46Oq9/Extu3b8cVV1yB/fv3n7G9StIuZQy2Wi1UKpVl9/+6667DddddhyuvvLKt&#xa;nemcCvW7GhMVYPnsZz+Lhx9+GP/6r/+67HovBD3wwAPwPE8HeS6//HJtLP57oTfVp/bVr36VP//8&#xa;823BAtPPqnyvnHO+a9cufscdd5yx3EcffbQt+GCWF4Yh932ff/rTn+bd3d1nLG/16tX8r//6rzsG&#xa;OGZnZ/l/+S//hReLxWX1ua+vj//Zn/2ZLssMipj97eSPNr8zxviXvvQlPjQ09Jb6QZvNJg+CgCta&#xa;v3497+vrO+fy8vk8Hx8f5+vXr+ee53Hbts+rfW8aPMjlcujv78d9992Hbdu2gTHWUYqZEvfHP/4x&#xa;vvSlL+F73/veGcu/55579GclqdIuMcuysGbNGlx//fVnLK+vrw99fX2Ja6q8crmMSqWCarV6xnIA&#xa;4IYbbsD111+fCDub7TLL7kSmOr7mmmtwzTXXLKve8yXHcZDNZuG6bgKWNBqN8/JmbNu2DX/+53+O&#xa;V155BaVSCZ/73OcwODh4zuW9aUzb29uLdevWnRUe+uY3v4l9+/Yt6/5arYannnoKk5OTpzXqBgYG&#xa;sHnz5jOWl81mkc1mE9dUeY1GA0EQLIvRuru7sWrVKqxYsaKjp8O8f3p6GtVqFUEQtPmd1eeenh70&#xa;9vaesf0XghzHQT6f199VW4IgOC9j0LIsjc8tywJj7LwWwZuGabdt24bbbrsNQLt7Kj35J0+exIkT&#xa;J/C3f/u3yzZ2arUaPv/5z+Puu+9OuKlMnAgAa9euxS233II//uM/TjyvjC5KKXzfR09PD7q7uzvW&#xa;deLECVQqlTY3XCcmvu222/COd7wDw8PDievqOd/38dxzz+G5557D3r17kc/ncfHFF+Piiy/G9u3b&#xa;2xh85cqV2LRpEyYmJnDs2LFljc25UldXF1asWNF2/XwlbSaTQS6X09K71Wqh0Wicc3lvCtO6rotL&#xa;L70Ud99995I+SXUtiiI8+uijeOihh846Q+uxxx7D9u3bEUURbLtzV3p7e7F27dq261dddRXWr1+P&#xa;9evXo1KpaGs5HewAgFKpBMdxsHLlSgRBgHq9jiAIEASBvkfdf99992H9+vVtMIBzDsYY/uiP/gg/&#xa;/elP8cwzz2B+fh6A8K5s3LgRX/jCF9Dd3Y1isajLzWQy2LJlC9797nfjK1/5ylmNz9lSp7EihKDV&#xa;ap2XpM3lcjq0roxa3/fPubw3jWn7+/sxMjJyxkgWYwz79+/Hd7/73bOup1arwff906pt27YTqY6K&#xa;duzYgXe/+9249dZbsbi4CNd1kc/nO7q8lAtteHgY9Xpd43OTaRVt3LgRPT09mvlVecrf+vnPfx6N&#xa;RgP1el0/s3//fuzfvx+/93u/h4mJCc206tmBgQFs2rTprMfnbCmbzSZwvdn28/HROo6jfeCMMf13&#xa;rvSmMK2SYMvJF1DQ4FyoXq9jbm4Ok5OTWLt2bcJ9pCjNjOq3DRs2YGhoCJ7nYWhoqK1ss6y77roL&#xa;d911FwBoKRGGIcIwxNe+9jV8/OMf10nrnaQ6ALz66qvYvXt3xwCFatsf/MEf4IMf/CDuvffexO8b&#xa;N25EX18fPvGJT7ypTv5XXnkF+/fvx5NPPgnP81AsFpHJZM47uKEkLSEECwsL5wUNgDeJadesWYM1&#xa;a9YAgE5kAdCRgV988UW8+OKL51QP5xyTk5N4+umnsW7duoR0U5Nr27YeMLN+FXlK50Ck/abmd1We&#xa;GSRRSS47duzAe97zno4LBwB+9KMf4U/+5E+W7AshBDt37sRVV12FZrMJ13W1T7tQKMC2bb3tyGQi&#xa;Fbau1WpoNpvnxdRhGCKKIhw8ePCCLg7VRs45pqamlu2FWYreFO/B+Pg4xsbGtBroNACKaV999VW8&#xa;+uqr51zX3NwcXnvtNQAxboyiSNerLNdCoQDXdfVzmzZtwsDAgH5OPWuqLXUtHQwwIcSxY8dAKcW2&#xa;bdvaJKS67/XXX8fu3btx8uTJjn1Q9ZTLZRw5cgRvvPGGVslKIzmO0+aKIoTg/vvvx9GjR1GtVtFo&#xa;NPDiiy/iwQcfbKujt7cXl19+OW655RZcffXVuOiii7BixYpE6NociwtFlFLk83ntlZienj7vnIoL&#xa;LmkzmQyy2WzbYABJaQaICZ+fnz8v9eP7/mkjVapOx3G0BUwIged5eu/Z+VC9Xkcmk4HnefA8r81l&#xa;BYiJmp6eXnZ5jUajY0KQbdsJKz6Nv5Vk7oQXx8fHce211+Kqq66C7/toNpt44okn8MQTT2htsX79&#xa;emzYsAGDg4NoNps4evQopqencfjw4SXbOzo6ik2bNmm49G//9m8JrG9ZFlzX1YZytVo9LyMMeBOY&#xa;dv369RgdHW3zeSoyB/rpp5/G0aNHz4tpFa5N+0TT37PZrB7MbDaLrq4unYCzHFfWUn2Ym5tDb28v&#xa;urq62pLPlZQ8dOgQXn/99WX1Z25uDvPz8xqCqLbZtg3P8xJMm8/n4XkebNvWWqXZbHbEzZs3b8a7&#xa;3vUu3H333fpaFEV47rnndJ+uuOIKfOADH8C2bdvQbDbx4x//GE899VRHplUQ8J577kkw7eOPP46/&#xa;+Zu/QaVSQaVS0QELz/MAAKdOnUpIWpWTQQhJuNZOa1wvayTPgq6++mpMTEzolZXGsSaD7Nq1C2+8&#xa;8cZ51ReGIZrNZqJ8sz51Te2CAET0K5PJJPIgTjdIp+vD7OwsNm3ahMHBwbbkFkIIyuUyjh07tmxJ&#xa;22lzpmqn67q6r4CQct3d3Yl6FxYWOjLZ2NgYisViYsGZWooQgr6+Pqxdu1bbIwcOHEhAKkVbt27F&#xa;HXfcgTvuuCMRbeSc47rrrgMA/OQnP8GTTz6pF5bqgwqoqMSmj3/84zrvo1qt4tOf/vSS0VNFF5xp&#xa;R0ZGEhlNS0WFCCE4fvz4ee+e5ZwjiqIzMp45ENlsVkuntJRVbTPVvFK3naR4tVrFxMSEDkyk21Aq&#xa;lTA/P79sHNdqtdBqtdoMQRWWNtva29uLbDab6Huz2cTCwkJbucViUcMXdX8YhlpVq/JNWLdUWVu3&#xa;bsWOHTtw/fXXa4GgxjeXy+HWW2/FyZMntRfC9KEreKCy6n7zN39Texd838dnPvOZM0ZELzjTXnLJ&#xa;JRgaGupofQNJ5t23b9+ycl1PR8pIAZKuNNPiJ0QkcSsYUqlU8Id/+If6IJBbbrkFQ0NDba4v9fzU&#xa;1BRc14XnecjlctqKZ4xhZmYG119/PVatWtVx4ezZswczMzPL7o/v+/B9f8m0S/O6WizmwiuVSpic&#xa;nGx71lxYilSgBBDz4rouCoWCLq/RaOgACAAdhv3Sl76EbDar+6rGVbXh4MGDGrL19vYm/OSzs7Oo&#xa;1+sYGxvD6tWrdeojAHz961/v6PtO0wVhWtOqTlvlpuGVntC5uTk0m822Mw3OhhzH0VjSrMdkXMYY&#xa;arWaHpCpqSn8/u//vi7jy1/+Mq644ooE0yqf4tzcHC699FK9+0I5ylW/fN/H1q1bl/T1ni0E6mTI&#xa;LTV+a9asQW9vb4KRl0pWHx0dTcCDxcXFBIaklMLzPG3lM8ZQr9dRKpV0GZs3b8bWrVvR39/f0X2p&#xa;/p2ZmdGLoa+vL8Hg5XIZrVYLN954I+67775E2z/72c8ua4wumKRVGGXVqlUJHJSWtEotqUE5UyLK&#xa;mSiXy+lFkq5T1ccYQ6PRWLKe9evXJyJB6r5SqYSjR4/C9/3TSoCVK1cmJJRZ9+7du88qD1VJM3My&#xa;lepNY71Vq1YlpKdKmO/kTenp6UlIvDQ0S8ODKIpQr9exuLio77n66qvx4Q9/WMMxhVNPnTql57+v&#xa;r09LU0Awreknn5mZQTabxY4dO3DTTTeBMYaDBw/i4MGD2nV5JrpgTGt2wiRTWqjPKmHifLOHAOjI&#xa;zVL+xeVkFJkY12SWer1+RviSzWaRyWQ6Gp6A0CZnEwFSkEWRuQAUJFFkMqL6PQiChEtJ9cdsIyAW&#xa;pGnUKc2h5pBzrl1jykU4NDSE8fHxhPacnp7GAw88oK/9zu/8DprNph7zfD6fwMmlUglDQ0M6xE8I&#xa;wdGjR/HEE08se4wuCNOahoJacaZKM9UH5xz1eh0zMzM6gnM+1NPTg1WrVrVdV3Uq78Lp6unp6dEu&#xa;GdPwmZ+fTwQulnq2WCy2uajUInrjjTfOythUPl+TVFlBECSYdmRkRKt8pcE6SVpCiHbxqe/Hjh1L&#xa;qP5MJpPwpyrtpNo+ODiIdevWYXx8PGEv/Omf/ik+97nPJeqamZnRhufg4GACvpXLZdx8883Yvn07&#xa;OOcol8t49tln8Q//8A/LHqMLJmlVYkp68gC0STC1dUVJ2XNlXEII+vv7sXHjxrbfVJlhGC4p6cz9&#xa;ZIpRzLbOz8+f0b+qnk1DIBOWnE1an5kRpfqoonymMUkp1UaOqjcIgra0PyUB09ogzbRDQ0MoFAra&#xa;FlBSW8G3sbExjI6O6roWFhYwPz+PL3/5y4n2/8Vf/AUGBwe1Adff369DuICAGFdddRVGR0dBCMGD&#xa;Dz6Ip59+GsePH1/2GF0wplWRjzRESDvtTVfL+UpZQggKhQKGhoaWdHlFUYQwDDv+RinVTvtOGwjT&#xa;1nMnMgMU6YXaCYeeiVzX7egbVTDHdL+l2326DKq0MCmVSoncZeUSU+1Ph9+LxWICPy8sLODQoUNt&#xa;WmRxcTGBg3O5XMK7c+WVVyb8+N///vd1rsNy6YJL2rRbxmQmdf1cd7amyXVd9PT0JCRA2lvh+/6S&#xa;CRr5fB7FYjGh3s32Li4u4ujRo6dtQ9pzkXZVpXHomUi1hzGmw8xK0pplZTKZNuNK3ZO2E5Q7y7Zt&#xa;3b7JycmEpFWBCjMUbJaTdgnu3bt3Wemkynug6v3gBz+IXC6Her2Oer2O73znO2ftObqgTGuGbtOW&#xa;tLoGQKu68yUlHYB4cTDGtAtNSZSlGE95HpSKTRuNCnufjpRUXMoQPFttojCyuXOZMaZVtcm0XV1d&#xa;ifyJ020LUlEpNS/pbKvx8XF0d3frvjebTW0LUEqxYsUKzbTKd/3SSy+dsT9pCKP2hj3++ON4/PHH&#xa;z2lHxAWFB47jaEmbxrVAUhp18jScLQ0ODiKfzyfSH9MS7/jx43jmmWc6Pp/P59u2l5gMUC6XzxjJ&#xa;Uup5qSjOUsxsknrWtm309vYmmIcQgmazicXFxUQyttpmbvZbGX1mfdlsVm91MTXQwsJCwnug3Haq&#xa;rFqtppk6l8uht7c34darVCrLwqHd3d0Jw1Lh/IcffhgPPPDAGZ/vRG/pqYnmAF+IQyjGxsb0BC9F&#xa;5XK5Y4QIEBOa3jRoeh1ardYZIzRnCjmacOVM9ylokMlkEs9Vq1WcPHkywYyd3GLKcW+S53l6jNRC&#xa;SBt1ALR3QUlyczuRiUsVBUGwLFdeOp0SQBvUOVu6YEyrMFBazSoyB9zzPBQKhWVP6FJ0++23Y8OG&#xa;DW0BDLPu48ePY9euXR2f7+vrw/r169ueAUTcXW3nOR2lPQbp/qQx/ulo9erVGB4eRjabTUz05OQk&#xa;nnrqqUQfFWObbVA41RwHte9LtUNBjTSDDw8PI5/P62er1arezKk0mjlGrVZrWa68QqGQMPA453Ac&#xa;B319fRgZGVnWuKTpgjGtimObid+K0uoxl8thcHBQbys+F8Z1XRd33HEHNmzY0LEuzjmq1SomJydx&#xa;6NChjmX09fUlnjf/VXmtZ6I0hkwbhAoynY4UFr/yyisTE6nKOnbsGHbu3Jl4RuUcmHV3YtrBwUFs&#xa;3rxZt0d5U9LBhYGBAe2aUmOnoJHKilOkBNRy8gSUBFf8wTmH53nYvHkzbrnlljM+34kuGKZVKud0&#xa;/ln1WSVmqKTmc4mKua6LiYmJ0x6zVKlUsLi4mJgck0x4kF5YKj/0THS6pGyF3Ze7KNesWYOenp62&#xa;65VKpS1/wTyfQFEneKCOPlWkFkh6h62KCioy4UFaxZ+tC8+yLA0nFL4dGBjARRddtOxyTLpgkrbV&#xa;aqFUKiX8iOnJUkzc1dWlUxhN1XE2dNNNN51WUlNKceLEiSWTVSilGBgYwMaNG3VbVTmUUrRarSWZ&#xa;3aRyuZx4Nm1sqqSW5ZDKFlPEOUetVsORI0fwyiuvJO5VznmzbpWoYo7HyMgIduzYob8reGBqQ9d1&#xa;EzkChBDtkgLQdhDe2WhHBQ9effVVPPjgg3phbdq0Ce973/t0FPVseOCCMK2JlUzJaQ6qOZnq88qV&#xa;K5HP588JkP/Kr/wKgFhydOr0gQMHcODAgY7PU0r10U1pycE5b3OSL0Xz8/M68SfdR0II3vWud2H1&#xa;6tWnLUO1Q8EDE2IsLCxgZmamTYKuXLmyrZzFxUW0Wi2tfRzHwcjICLZu3ZoIdqgghRIimUxG+1MV&#xa;mUxr7rlTbTOz605HKhJXrVYxPT2Nl19+GdPT0ygWixgfH0/kfSyXLqghFoZhYjvFmdw9t956K9at&#xa;W7fsOszzB9773vcmIkRmO1SG0pEjR3DixImOmFLtbjUd7qYxtVymPXXqlI61mzF51e+77rrrjGrw&#xa;hhtuwCc/+UnYtp1oKyEEr732Wsfsp+UcYVosFjEyMqIZXAVbzIw3FVlT4VY1FqbLS6V1muPU3d19&#xa;2sWotKmSyiq6+MQTT+Do0aN6a/873/lOTExMnLYfabogTKvcKGEYYteuXThx4kSbhAXazz34+Z//&#xa;+bPCNYwx3H777fjiF7+oIzxKvajyVT7Bd77zHbz44ouo1WpLhjXVn3rWdAuZhsiZaM+ePZidnW3r&#xa;M2MMl156KS6++OLTHri2fft2fOQjH0kwu1o8S+0vMzGtqm9kZASFQkFrussuuwyXX355AvbUajWc&#xa;OHGizZdrUhAEqFQqWtKqLTLmol69ejVuvPFG/UyhUMDw8DA++tGPJr4r1a/g40MPPYQ9e/bocXrf&#xa;+9531geRXHA/7eTkpHaFpCVPWjKMj4/r5OTl0ODgICYmJrBp06aO5Zrfd+7cuaR/FkBbECRdlloQ&#xa;y6HXXntNZ+p3atPExMSS0uSee+7Btm3bOu5enpubw/T0dEfXkhlQUXT55ZfrM8SGh4exZcsWnZWl&#xa;qNVqaQmq2pk+Ukrlhigj00ygV+O1Zs0a3HzzzVixYgWGh4dx44034td//dd1hFAZ22aZrVYLMzMz&#xa;WFxc1Eb7JZdcguHh4bPy21/w7TaPPPIIVqxYgWuvvbZNyqpVqgZrbGwMt9xyC3bu3IlHHnmkze8I&#xa;9TznKBaL+NSnPoUrrriiTTqbTKK2q3zzm988rR9RSdml3FFjY2MYHx/Hyy+/3GYopL0d3/nud9Hd&#xa;3Y0rr7yyzSDjXCSJfOhDH8L4xAR+9KMf6d0P7//5n8f999+P/v7+tgOdCSH41re+hV27di3LH8o5&#xa;x5133onBwUFcdNFFWLt2LXbs2KEXi2pPpVJNnOjDOU9IWhWBq1Qq0uVHdEZXo9HQbrENGzZgzZo1&#xa;+NSnPgVCCC655BJcfPHF+MQnPgEA+iR2RQoenDp1CocPH8apU6cwOjqKK6+8Ejt37sTg4OCyk+Uv&#xa;ONPu2rULV111Fer1ets7BswJVYy2fft2/NpHPoJVq1bh7/7+78FSCR9Dg4MYHBzEhz70IXz0ox9t&#xa;C16YbjVCCA4cOICXXnqpLYIkWyD/5SCGpE2XwznHRRddhF/7tV/TZ+uq++bn5/GXf/mX8YIC8Pzz&#xa;z+Omm25CFEUdJeaKFSvwi7/4i7jxxhtx7TXX6Eyu97///Vi5cmXH/hBC8JWvfEWEStNGJueoSS+B&#xa;2cfR0VHceeedeM973rPk+9mq1QpOnEiOTa/ctaHKqzcaMo9BSNpWq4Xjx4/j5MkprF0rduoqe+A3&#xa;fuM3EvOrdh0rTAsImFStVvU2oEOHDuHQoUMYGxuD67oYHR3FZZddhocffritvZ3ogjNtqVTSvlEV&#xa;9eoULVKfc7kc3nHddRgfH8fXv/ENhBIfAwBkNGbLli342Mc+lqgnPWGKDh8+jEcfffS8dkSokOrt&#xa;t9+Om2++OfG+h9dff10wrbgR4ByNeh2+9HummVa1U6nRrVu3atwtutienaZo3/79aJoBDlkfgMSB&#xa;HuY4qA2YpkfF/N33fdRqyay3vBQu6r4gCBCl7IBSuYxSuZS4ll7sql2qHQWjXN/3NUZOG7nd3d1n&#xa;ZYydG9PGAku1Pv6Nc+zduw979+5NnIbdicnUtfHxcUxMTOD48eM4ceIEjh8/Ds441q1fh76+PvRL&#xa;S1ntTVIutjSVSiV9WIRul9FWMbgEnDNETPylXTnmRJvvHVCkomuEUIBSECos4xd378Y3HnoIv/LL&#xa;vyzK4lyPi4lv0056NQYqOw0Anty5E0/ufBIL8/MglILatmg3IUAUgUchDh87lsDPnbSOeiuNmXJY&#xa;q9VwamYG1LLBOQNnDEMrku4z5UslhACy3D179mLPnj3Yfvnlif4ASCwQxYxmUCOKIlSrVZ2bfOTI&#xa;ERw5ckS3fePGjbjzzjtjYXAGOnumNTEbEd/lFdmBCLtf2o3dL72EG264IfFoelWaTMw5R3exiO5i&#xa;EVtk2FExpqkyTYmUllKPPfY4HnvscXHNUjiU6narNvOII/R9RGGIMLX9eakFoeiExF2CmRwQm4LY&#xa;Dh576mk8u/tl/PIv/VJbeWZbO2WkmZ+r1Sq+/e1v44EH/gTUcUCoBWI7cTkAGOd4/oUXE1rMlNxq&#xa;vJ7+6S6Ac9x+23v0tXqzidn5eVDHAQtDcMYwPJrMASiVymg1W4BFAcuG7bg4cvwNPP/Ci7juundg&#xa;9aqJhPAw50Wlcvb09OhDPwCRy6GYtlQq4dChQzhw4ICOjC512mQnWh7TJgaX6hUIQGNDyEGzCMFi&#xa;qYyf/ORJDK8cwX/6hbsSE3Y6SlvE6Qk2t4Wnmf/7P/gB/vEf/wdeevklWI4LYlkglIBod5gRxaEU&#xa;rUoJ9XoD1UoVxQ5vkFyKXj90CAABdRxYmSyo42pmKC2ewP/zzW9h6+bNuHjLZl2eSWZ/1ISbVvw/&#xa;fevb+OZ3vgvL80C9DKhlgdoOQCk4AZSIOPbGSVSqVbjyYLp4fsTvP3z0x/jRI49g7erVIITADwLY&#xa;loV6vYGZuXlQLwNOAoARjIynjLVaFa3AF4vFywK2DTCGL//N3+Irf/d3OLxvr0h5zGb1nD744IN4&#xa;8KGHtHvuhz/8IV584UX87u/+btvRVVEU4Qtf+AK++MUvto3LcujMTKslm5BShFDBCFLCCokm/kBi&#xa;Jj72xgk89pMn8Z9+4a62yUpbyer3paSw+p6WzOa/3/72t7H/tddAbQeUWqC2nWRaasmFJq5F2Tym&#xa;5ufx/EsvYeXK4UQblhpAQgjK1SqI64K6nmAsxxN9th3YmSy+96NHAEqxcf260x7Cl24/IQTff+QR&#xa;PPv8cyiVyqCOC9vLiMXnuMY8CGnrt3zs/LdnsW71KqxfvTouV9bz7X8ukJBoAAAgAElEQVT+Z5yc&#xa;msK69euxWC6jXKmAcY6p2VlUanUQKcXhuJhZWMSTu8TBcWEQ4ImnnsHRN06CuB6o54HYDsAYOIsQ&#xa;co7/9vkviBer9PYC4Dg1NYUXXngB+/bt08KsXq9jZnYmESlNj8Ppvp+OCGJkmp4hPZiCEQWjUouC&#xa;UMEQIEQwB6GgaruKZQEccD0XruvhW9/471i5YgVGhoe1GjOlZSemXaoDnaTgCy/uxgu7d+P+++8H&#xa;AwexbFDLhu26gF5gkP/KxUYogijC6olxrJqYwDf+8s/F1m1jH1XnISH48G/+Z3z9f/wj7GwOdjYL&#xa;28uCUwq5rBE0G7jx2mvwv/7Gr+PKyy5FRm567FSW6lO5WkWlWsUH7rkHJ6emcWqxDDuThdPVBWLZ&#xa;QtLJxcYh4HLgt7DjkovxczffiDtuehdGVgyhWqtj7/4D2HvgAP733/99dA8MYPuVV2P9urWoLCwg&#xa;9H3s3b8f+w8fRotQcNsBLAcXb9mMomsjbDYRtJqYnDyOaq2GehhJpnUBzsGDADwMQIMWCtkMCtkM&#xa;EAQ4NT0lzobwW+AgAGOCrRS2v8DUkWlN9U+pBSJDnQrHWbYtsBaloI4DalmwbEf+bgGEauPixuuu&#xa;xZ23vht3vufd6E4dgJZmwE5Yr5N0Vfd89/s/wL8+/H3868MP49SpU3AyGWQKXbAdB5aUTjDhi+wX&#xa;tRyBF+UIfOZ/+zi2rl+HLevX6rJFVUmpSAjBe+/9EP7tpVfhdBXhFLrgFnvEQpWTFPg+PMvCVZds&#xa;wWWbL8K9P3crcq6LnOt07DMhBAvlMhbLFVyy4ypYuTy8gSHY2Tycrm6AErHY5EQJIw/gLEKjVsWG&#xa;8VFsHB/DaF8PFqensf/113Hg4OuYm5+Hk8vBzhXACRBWq+BhKObRdeF2FWFnMrC8LPwwRFirgkcR&#xa;eBjCssV8WtmsxtVREMBvNBCFAZjfAms1wVpNRPUaEAXgjAGMgQUheBQCnAmG1V6cC8e8neGBwbRK&#xa;Wqk/atuaUQm1YDkOqGXDcl0QSmHZdizRAPzwJzuxdvUqvPPqK9Fj7OY8HW5cDhFC8L0f/BAvvPAC&#xa;jk9OotjfD8fLIFMowHJcUFuqVColGrX0YrRdD04mAw4h8X/w1DPIeF6CaQEOzmN1rFrb4gTZnl54&#xa;vX1we/qQ7RuE5TpCEnGOiHEEzQaeP/IGXjx0DLe841oMdhWQdVOuMPkv5xz5XB5eJovs4DDgZWD1&#xa;DcIqFGEVuoXhKG4EiyIQLhk3CpHN5vDa9Cx2HzgIWq+iMXUSrufCcV14PX2wMxm4+TwotRBmsmBR&#xa;BM6EB8bOZGFnMrC9DDzLQpTNaUFj2bYQRJ4nNCmAoNkEIwSs5YvfHQdMzjlr1gXDRxEIg2BgAMC5&#xa;v1fhtHMPYwnEHoEYp1LXge24ovGWBdvLwMlkBXa0bUCq1WwuB8fz4BaKcL0MMsVuWJ6HiAOMcUSM&#xa;4b//n5/ARH/syFaT1um7ojQW5lIR3/e//Db+6aGvI5vPI5vLo9DTB9vLwM7mAcsCtSwhXS2JZYn4&#xa;lwPoXbsRpWI/SBQBjKF0ago2C7FhsA9rVwxhtOCh0WxiYXYW9WoVJ+bmUW80UW80cOz4ceRXjsHp&#xa;G4DT2w+72CvqkaqQRSHAIviVCoJaFQtHD8ElQAYMlDOsHh/FL935c/jQnXe0aY5f+K3fxZGpaRyv&#xa;+3CKPbCyeenqC8GiCIiEtc8ZAw8DOGAgTPz5zQZ4GALUAqcUVqEbVi4P2t0H7njg2SzguCC5LsDN&#xa;APkucMsGt22AWqatHbvzLEvwARgoY7ArJdBaGc2XdyFcnEOwMIcg8BFVyuCBLyRwvQrWbEomDoEw&#xa;lAs6umBQIWZaw+AictIJpbBdD7aXERLVcUBdD9l8AV42CzebRd/EGiEVegcAx4WTzYEBYISCEwIS&#xa;RQgbNQTNOtBq4U//5w9htK8Xo/29HY0R3bEOTB0xhnqrhXrLxzt/8UPIORa6VqxEYWglBtdtgOt5&#xa;yGRzoBZF6PvgUYTIDxCxCFEgXFxRFKFluTjeCITPkzGEzQb8ehWlE5NoLM6jcmISPBKDTCiB43h6&#xa;PLLFHmQHV8ApdMHJF+DmxEtIkq5rIRV5FCGqVRE16mgtzCFsNhA0G/jNX/wF/MYH7sZQT7yBEQC+&#xa;9eMn8NC/fB8/eP5ldA+PwO7pBfUysHJ5EMsGzxUA2wFsB9zLoWW74ISIseYcnEAsIGqBuVlwaoFb&#xa;tpxlrqSA/MwlPBJt50xc5/HQt7MJoWJBWBZIaQ6kPI/gse+hMfUGuN8C81sIy4uI6gKKcAklwJke&#xa;zwvBuES3XhoohBBYjgNiCcnqZLJwc3ktWcc3bUFh4xbAcQHHQ4vaIJzDIirDSp4JJSeZEgHMOedo&#xa;Lc5ifmYWG0ZXYv3oCD76vvcg53nozufgWGK1K8e8eCwVLTIY+rf+6L/hmd2voG9iNfom1qBv1WpY&#xa;tgs7Iyxu27IlXHFALXlUk5okzkGUxOIcURgg8n3USwtoNWqoLpYQhQEC30fEOZpBJIMRHD5j8AFE&#xa;HAhBEAQ+OAMIGAg4CIu0lOFSlXPGEPkBeBRhYWEO779mB95/7ZW48+rLAchDNjjHXKWK/+sfHsJf&#xa;/8uPkOnuhbV5G5orJtAYHJOq15h4xkAV4+nlQvT4mMGNsyWeEhzpUggATkSwwyJA9E9fRViaR7A4&#xa;j2BhHmFlURhtgQ/WbIhxjkJhoGmmPXfmteOGKQexgV+lj5DaDnI9vch394AOjyGwhMeAcKmeCBLS&#xa;RruWVBcpBeUcTjaPXFcL1ZaPw2+cwNcf+QmynoPuXA6ubYESgjAMcPHqCVy2MZlna0aZCIBLNm3E&#xa;ky++Ap5oNwEBEeEEY3IBFbWR/l4AQcTgRxFaEcNC00crCFANCHzmoGUXwGiEyArBOEfgCnTGOBdh&#xa;ZqlFOAgYZ0IISUOMMKHG0ayDBAGsmogQUdsCtygKXUXM1Zt4/tBR3Hl1HF0iAAqZDFb096GYy6LW&#xa;rAt1GwSgUSgMGq6CLdDeCj3eiegkSVxS/GxqA8IBrngcyXuVgWo8qj/rC0pLAqBbrgA9+hos30dY&#xa;rYLajsTHkfDaGPe2RVPPgQxDTLq2qCXcRpJZbc9DttCF4sg4ihNrEHT3I5RWNeEABQPVAQdIS1cy&#xa;EhQjURACuIVu9DgOgmYTU80GvvXMcyBRCIuFoBAM1mw0cOcN74CXz2PzaJxMkiDOccc7rsHf/+DH&#xa;sGwLQaOuB4YQgBIxaQQcFBwWOJphhGbE0GIMi60Q5SBEM2JohgzlkCFgDK2QgHEPzHXlqIoZYqY8&#xa;00xBtMFKCECkVQ9wgEUgvg8SBrCriyBBC1Z5HqRZQ86ycGR+EScXFvHb77sVxawIE1NKUchmcOlF&#xa;G7F25RCefP5FFFbXwZpNkDAAkapbzRUlADczS1UTicFt6d86cEzMlCaoTV3VZSbnQhmFZMsVsDxx&#xa;ulBYXgT3s2KcOAP35flhUSQfSDfu7MkihPwfIASUEFAJCSzHFREf24GTyWFo3Xq4QyuBvkHhazUk&#xa;MiXxEZHay6C+E6qvQ0IGYbln4eW74GY82J4nJBaliEAQEgruOJhv+Lh+y8Z48CT2U4PYU8jj4PQs&#xa;OGM4NTuL7hXDGoNTaRyCEFRDhnk/xGuVBo7VWjhabeFwpYE36i3MNAPMt0I0GIPPOCKl5AkBJ9Kv&#xa;K117OlRp+GSFrDUmQqlk6QPlroeo0I2o0A3m5cAyOZBqGdV6A3PlEt6xaT1WrxjURighBBnPw57X&#xa;DuLZ3S/BHhoBL3QD3WKPmRpHaOdOiglNd6JmOEgpqzwhqp3ix9i9yeMHU4BAeWASBUtIqbWfZYEW&#xa;uxEdeEkYhNIzw4NAYGUWJ0GdL8WSVjdeSY+YCfMDQwizeYQMsKgehSRpyWNeMwZASSUJOwDAcmy4&#xa;YR4sVwCLQrAoRBSGqMPCvuMnDQjbEblh2/o1aDSbOHDkKCLfh+W4wo0FIW0ZB0p+gJPNAK8s1hEx&#xa;od49JR2JCDsnsV9nqZKURObvHaQdV1Ia4IqBewaB7n5YJ48h5IAfhDg8PYObtm1JaJOuXA49hTxc&#xa;20bYaoGGASjj4DQ5tAlZmdDvS5C6p9N9p3neHO+lCuaMgXhZkN5BEOlRArUSvvGYNy4A0yZgsS5f&#xa;RL6obcN2bdD+QVBqg0i1EfOmsCg1gIo1avxFPYNYdUO6VCwqHPykUNBYlQAIfR8LfgunqlXkXQd5&#xa;eTKhmbvAGMP/dOlWnJyawk+aTVTnZ5HnHLmuImyb4I16C69XmjhYaYEBsKlQqbZ0exFCtbUcD4Bo&#xa;c2KiePI75wDVCxFK1opumiQFAE2Fnxvbb4B97DX0Th7EN37yDO67+Z1oBQFaQYjp+UUsVKuYK5fR&#xa;VyxgtlGF1WqAsgiEOtpfG9ehRxY8wcYGppX3M86EpLYdEcFTmJ9zIAzihWsavAaw5cY1sWaFeBDw&#xa;D4DjgbkZ2LkuhLU6YIXg1AZTkUjIBhGFcc/HEIOS9EYWFbW0J4FQC1YmL/IrIy4iNAkdIfslv1It&#xa;sIVRJLI8iDZcoFWtjLYR6DCxStuzXQ8ey+P/fmIXrt+wBjdsXNNxa/pAsQvrx8dwxcVbcejEcVgE&#xa;mMoXMU8aeLYSwiJE/KmRJ9JRwgl4wvFNoF1AqavGz+IjBzhVrArt6YgHQn1XC0BhQyV5LbD+YQRe&#xa;Dq899xjG7v5lNBbmUV+YR1haAAhBJp9HJp+HO7oBsF1ZFIstJ9U2ZeCkVoz4jWlIAADEccBPnQCO&#xa;vQZarwkfe74A5LoQrd2ijbyktRULp3gIuDFWgsEJ59LVRkFzBRB7FrAtQ+LKtw+dozcjTeaBUNDw&#xa;DPF2Y89xUJehZC1hDWmvmIhCMqlKUNFgisfS22y0BvcEFGYSjsxvsICfTk5juLcHW0dWoDefSa14&#xa;QTs2b8L4yAj+8399ANNuBqfcPkxaWeQymQTTCRin9YOBBolmyNgAJx2ksGozB5iJ/zgERDCvQa/i&#xa;OIWFiPXLIrBcATzfBavYB5sDBTeDfE8vWBRqQQFCgJ5e8EIBcOw2NW3KQmHfKAmZEijqIcsG6jXg&#xa;1EmgWQPxsrAWZ0EJELgZBGNrhSsQ6LB81VSSuArjB0OXgngeYMVhfkKVJGsv8lypcxiXJ5OLQQnA&#xa;4kHQRkCaCROiCbH6WmKFKcggeTt1EbAtG9VWgMmFMvoKqTdASsOs4Lkg3V3oyudRZQz1RgNO3kNy&#xa;WtFhxtvbZEqPuE9UuLCUSrNsg/WNAg1pnMS2RP9OIL0PUrPwbA60XhGyi1JQHkGNKyEE3PXAbAec&#xa;SHWeaitPVMpT9ab7zOOxVViTis/UbxlCJNUvo7ZEn0Vn0LZYzdRVNbmKoU3NjHMnO9kv4XRnUQTQ&#xa;ECDi7CduJPpSS/I5EZJDOrjkWAs3mAkPCIkbq9d/G7OT+H7E0juby2GyXMOj+w/jsvHhNj4LwhCu&#xa;ZcHJ5zCxajVemV1EaWEejpsFMh4UpwgD13w4NdlmWyA1JQF4aR68NA+UF6VjPALyXbDWX2yo0VQZ&#xa;6iuRyMi8RbmSJOPwnn7QxTkRenUzAFEVC6zJvIxIS6QUYB22D3E1ftxoglpAoi4lBfXPCl5JDwmn&#xa;FojflHUo538H80tVobVLB7lPIBeEdHVqKBnP+/mbYVLSKsDOGQMDQKJQT2C9UsbiK8/Dcj1YXgZe&#xa;oRtuV1Fk/6g/5dZS4sRcZGqstMQjHZg3fk4NKiEUbiaDuYaP2XIVj+47hEaljMBvyR23AWqNJqJI&#xa;nLn1+smTmKv5YF0OeOCL+T9dznmC6cyLRKQCVhbAX38V/MQxoNmIJ9O2wYdXAa4L4nqxoWYwZyyA&#xa;2icegGYOXugGWCikuWWJUeKI8baS9B00VaL49JpJ8m3c15hzTzMwHcrSt6vVaOLbxC/Q/nrNCEBs&#xa;0/Al23w2ZJtWoYo66aQMxtCq11HauxtOrgA7mwcfHIY1vhrI5mDJUKnOtwU0UwKIrbKEuoC+T9Ub&#xa;d9qQtHKVBhzwI47HDhzG7BvHUa+UUatWUK01UGk0Ech4/qFKDaS7H3b3UDxbXNUr+7fkMKQUvmWD&#xa;V8vA3DRQXQScTJwt1qyD1ysgtAieyQKRMugMSGFOZkLtSlyrfnNcwcCWfIbH/CWkrTlGqbGT3MQT&#xa;nEk6rMN2iWhK3cS/qfFIYHkVPCEG5jWwPzGfe5PJ1uoIHOAMnHHwiIIBAhZIpmQhQ1CvI6hVUDsx&#xa;Cdt1YbkuMv2DcHJ5ZAeHYecLcLp6xG4GaoEQS0o7xTw05ZwXTEr1d574RgiBm/HgeC72Tp3CzGsH&#xa;4deqaFUrIOAiSJHxUCh2werPgOYLsLr7xRYRCmOhcM0sAoqpSUlLwljNkUYNCAKQbBe0ZQ2AOC5o&#xa;swZkMlraEcU4xGAeObkipKzaor7I6mwXLFJWPonhJBe5qToQAIBQkoCbhBKhFYmR8CLLJxwAJTEO&#xa;Jmp0DS0H1Ra+tGAx6jcZXHWT6++xR0cP4JtItsJAaoAIgCgKQTkDoRGilmhgZPmgloUoDMEyIQJf&#xa;5NEGvg/LcdCYmYZl2/C6umFnssgPDMLNdyHTLxzORO5z0r5WPUhKIKqdBXKwoHY2CCYu9PXD2Xop&#xa;eBiChSGoReB4GYSEIqAW7HIkws+ZjMiEAgyjIg54xlLBAGlSl2oJqBmFis19LBaPnIvztrS643JB&#xa;cIPB5H+195Sn7XHZPybyCTgn4My4w0jm0bKRM+mqU+0goCQlObULDIbhxjVGVonZqk2iGZIDmfwz&#xa;3QOKGXV+hRobpQXks0riy1yUtGK40GQnes04OBErlTEOECZzTpjYd0UpoiBA5DdBLZEoHLaysBxH&#xa;RKRcFza14LkuWo06SpUKGkePyvQ5gloQoqd/AMXubnT19KCruweW7cCVmwNDxlK4i+iBczM5eJk8&#xa;1IRTy4JrO6hEQMgATuoiw0xuSTFDo0SrzdiHyoWIhIn1zMkX7jsLsBgEQBZEqQWu86vMJCHE6lIW&#xa;K6CSqa8lA8gFyhu1+F6D6QWTtI9FoiQDGwrtwUHMDBizzgQsU2hJqR5DS2hFYTK0qkyNGQHAkOx4&#xa;LMPPA6oum1IuL7VyuRZ4Gt9CZDmBhALfSexL5NtVqN0ScoWFCABQJwNic3gOk2zGQWUic61cQrNe&#xa;Q2VhAZbtIJPLw3Vd5Lq6YNk2LDvTdmSRmXhDILKmqNzmEinntvZCdOoTSU102pRIkWFlQ+N1yL1x&#xa;qpjU0zxeAHFOgnxQSTztcqJAs27gxZhpdUZbLFdh6ghVFzcXjbnwNBZVkwhD63Tua+J3bnwwoU0C&#xa;1xp91nWJZ95sZGswrWRVDikN5IRF4lJEhaoWh1tE2nnMORNbnMFBAxdRsRscROwkJQSOMSAZwhFF&#xa;EjezCM1qBSAEjWpFBBROWbAsG9lCAa7nIV8ows148DwPrueJvWlEBCkItWBZFJxHCAmLNzAKMaJV&#xa;oBmRjA0IcwjMCZHSTfplCSUg3DIkLQEokwk1atRU4dwsEfGvadws/6UUmD8lEnPARb6soWYVpl2K&#xa;AUx2VnBEQ3TDf8rj0Ug+2KnE0yazqDLNsuLPuh0adpyxwnOmpKTtWBEH5wxgFJwwUAAsUonUFJHc&#xa;XUupBc4YquUyXGcGmWwBVi4HksuBQIaFKeB5NmxbMpy0vFkkkqxbrabI+C9HaNkW/FpN5PRaFAwU&#xa;mVxOMnAGPf0DcJ2MEIIWleFlgCvXmx5AFn+WeanEbwF+Q+SoRpFw8bEIJAyENc8YUJ4XCo8SgCt3&#xa;HgFYBGY7wrfKjeTAtLQypHrbxPktgNWB2SljcakFZuDLFMsSoyStySU+iCO5JHFjJyxt3qaUe/pb&#xa;vA554rq2ORNtSWutFCS6wLTkuQft1XJD08TqS2Tmi4RfRASNWgURAaxCUaQl5gvSyLIACEMgiiIw&#xa;zuO0RteDRSmKff1y6IQR4tcbqJcXUa/XUK41kS8UUOgqIl8sIl/sFgvCEhY6V0YctcCpBQnGpZDk&#xa;wjkfBkDgg1QWgfKCZN6WcK6zCCTwBWMHgYybp4xGyEiV48rFYfxmOjS1GiVa6MUQkIh2NOtAvSr2&#xa;aylXoxprPb7JEGnandYZ5EIbRmmFstREt+UEpO/tIGR1nemFyttAU7Kxnco5S0oyrcbdNJ4ky9Ju&#xa;LxAit5Rb2jcr3FsG2A8jhJUKKgf3omYfhNfdAyebh53NIzMyClLsFc9atmg9IdKAIgjCAATiHWPE&#xa;spHpzSLX1w9KCRzbRqPeAGdiR+m+53eh1WoitD0ETgaWVxBBgHoFVhTCCX2xB8yXjBj6MTMQIlSo&#xa;2W6NXy0gs/QZJsT1RFBAZUqR9IyaMx5LLQ1xbRs4eRR47RWxsZBJ/MU4QOU9jIlFxnl79liiMUmN&#xa;aIL2ZCvQkVk4JJLoELwAELsr1YNLBWu0Ow8GE4sKCT/zy//OlhL5tOaxQXo3ri0YjKoECFtuwdFM&#xa;K36jjjzRxZJuIipUdthogAU+gnoZQWUB2d4+2Lk8rGwebt+g3IumyjcNizhCxxkBYxx2JiOS1SlF&#xa;sX9InA4YBmBhiFa9ipbnYZE3UG/4WKyK1/8EYYgoYiIQIhmTpiVjPAjtGFCNv2SkaHgM3MvG7ioG&#xa;uRtX3qhj/MazhMTZcT/+Z/BaBbxWBrEcAb2UoaTjFML4pZrTZJawofJN1tBXtbsqXiWxUyCNR41m&#xa;cg5ROYf+CrmwAXCF6bmweTjlcX8RIzC5lSE5bm8CpSRtnF9AJNNRWwQRqLTmqeOJjY8qEia3GVN1&#xa;dpYlGJqq7cdSmikhFzRbYBEDbTZhcYYqLLQcF45to7enF47jws2od2/FFjylVIcdwDkYZ2gFLRAQ&#xa;ENuB192LLKUYWLUalm3DoRYC30e9VkXg+5ieOolKpYJKuSJeusGl+4vIrDJIZjWteKmSWSYL1t0H&#xa;1t2PaHStwMByvKD8mMrLYPp7AcCxgMAH9r8CfuSAiLRRAli2yHHVdSHOHosigEUJ74CKOCrWo4To&#xa;akEgzhrQ6jp1Eo/2gJAk33IJ9fTpO0zfLoZCGIOUWMIdCi6CFkQBRgP7qIacznK8QExsq4rifFrF&#xa;jMbhHLaUhBaF7bpwMhn5XRzWoU50YQDCIIgNGEL1AtAH1bV1hiMKIrAowmKpBNuyxTYcy0Yun4dt&#xa;WeJwCNpBN8UgUEMaLhN+Iinh3EwWjuthxQhFrx8gCHx9nqzIYWihWq2JgyhsR2y59jJi+7XjCozs&#xa;ZcG9LJiXicVKyhhRfUk0jBBgZgooL4BPHQcaNclY8h7DRZZ43nAttZdtVNHps0YrCkiTeCGabrT0&#xa;VJh1G2UR1VbtuzVhkCFZFVR5k6SrSbbuGDGSv+UJI8SykO0qIjcwJM48cFw4uTzsbE4wo+0IKSwj&#xa;XhwErFUHwgjcbwFRiCiM3+pHaHyeAiFUbIhkHGHog3Gg1fRBCJEnnIhXJjm2OOo9l88hm83Bsm3Y&#xa;6t1TiFWcStjhnINHDBEggxIZUEKR7+4GpQSUUITyQLQw8BEGAfaeWkCZcZRhg9i2yLiyLJ3lD2rH&#xa;E6S2tRuDKELEMQMK7cpjrMoBFIpi2/3CKcD3xd6pRGjWjFRxYUQCCQiT5G8D3hiROJGeHvvZY2Zq&#xa;F3UmijHLSa6P04nOZP3iM0vdZUjgNGw6RxI7F5SkNY8+kge55Xv70b1th5bAcBxxBKSUvNSyxaRR&#xa;sQXcBcSAh75IJglaQtVFIRCEwqqVC8JxbBAWgrFIQkzBdKHvgxOg1WzqU7Ndz0M2k9FHv+e7iigU&#xa;umDLIAMl8VGYCYnORZRP4GMCTjhsx4WbycC2LDiWhTdyfai3IkR+GNsa5kQYaYEcMPIJEGPjlCRU&#xa;Eor3D4H0DQDD4wImzE+Dz04Dc1Pg87P6dJoEE7IInLN4t6tZuUk8dVF/bNMB7c+nJfnpaCkGS/im&#xa;JfZu89MaBZDz4lVN7d4Dg3kJpeLwi6ERHfPn3DhEl3FQMJFZRwCAghFxYB08D4RayFAKhD54FIDU&#xa;6ggaVY2hhNQVE6TBv6F3CSHgjCNiEephHZVSCY7rihcC+yEyGXE+qq3ajNTWlzRJyMDBwRgHIwwR&#xa;EbkWPIqAiMXaeylSNpxRZNpjkKxTcAfJZMGzOZCBYSDzGsAjsJkpgMTngJllCDzZqdSkek6yjQFL&#xa;lmGxa95aaszMEGJ6baQhSXtDkeBevqwmLYts3TgDz1Lz3APHBYkiYclaVGxwlIMswroK9CuGEz2g&#xa;XCSUB+Ag1AaxHCBbRMa2oU5jKboOajOz4JWaiJRJg8uypKonpiFCYFs2OOPwWz6mpk7ixBvHYTsO&#xa;bMfGwMAgunt6MDQ8DC/jwrLt+CA0jdfjP7ELREAixriePFMA6QldCj9qSqrEpMqNPxAArFkHWTkB&#xa;OrYW0ew0sLgQ36juVcGFtP4mQFtmWltFS1s8ul9nlLByFMz1gfahiG8TDSXKvki0aLnifPlkE82w&#xa;hiFmWfp0REvuhFW7VwUujc87EBpSMLBOm1DWquHvhWSUiMvDPSjFIqfID67Axv5BhGGEWrWKZqOO&#xa;SrmMMAwQRUxHxKiRr6uGkBIId1cY4vjRozh+7CgO7NsH13UxODQkmHjliDh3zHX1G9KhIIo8t4Ep&#xa;x77RH7MqTpUxg9gtJ3mDmPahwg5GcEH/zs1j5gUMousvQbjzYbn5TwZfAH1sps6kImmG06oo6X2Q&#xa;DSbxFZgcxyE3IaYOMxTbeQz20r7rzlJdew8kPNKnC2mhyo27mfHDhWHgpJ/WsPLjY5HEyUmq/UZw&#xa;SHy3bFgkTkYR52/Fq57KJBdIvEmJsSKlNLEsG47jolDsEplkYYQwCFAuLaIpXw9Ur1QRsvhFIcSy&#xa;4o2SHLrdke+j3mrhcLkMzjm8TAaZbBaj4xPo7u1BsbcXxa5u2I4NSxqDURCI1EBuqFhozR67oiA/&#xa;SyOLg8SZVZCzzkRn1cRRg0EIEccoERYBIQddMQIehMaeaFmPsgFUFpoSuVovcw2d9NzpBsO4N54n&#xa;fV4soMc/FpU8cbv6WUM27TmQN2k/rXxG1au263TEARwX6ujPJc6LPfYAAB7gSURBVEI/RmKvznGV&#xa;v0imSxs8CiLYxq6zGPsY96ny1fNGNEXsABYTYts2Cl1FZHN5FKMIrd4mGvUagkBstWk2m/EQEAKq&#xa;GQ56gRAi37rt+5idOYVyuQR3ago9PT3o7e9HV1dRvG8BEP1UErWTHaMnn+s+KTtM1aekaUJQcSmj&#xa;tFQ0ClanfEvHqKjaxLfcqNO4Zn4kMZOZ495JpiXxfpwQbv6Z1ZpASUtyA+4obZKgtNsO5IJJWEVL&#xa;xys5JByQkS/E+FV8J/EKh4mHjXfN6mK4Lk/rOhIzrSpLcTmlBMSypT9YSEPOGfxWC0HgIwgCNGp1&#xa;eWS6jyAQvlYexa+DV4cB8yiCzyLMzTRFdhnnyOayKHb3oFAooNDVhWpIEILCZgDhEcCkGuXG66Qs&#xa;G9yyEPWvlJOlWCM+fNkcuuQVoq/G7kwi9pi5rnzNEtMCkrdJKyGl0mckJuuMZWXcMlUTEO8IMRun&#xa;vidXabucJB0/pu8ngAxLy/Zr6a4kPEkogyWg9xkpce4B5xxEZbdzeQym7wufqGxEvLVCMiohUC/k&#xa;iK/HZ3sJDCfVqYm/RC/i5xVsIIDahkx0uyIQy0IunwehXboNYRghCHyEvo9qtYLA98V7XH0fdfki&#xa;5ygMBH60LSF9KUWr2cJMcwqz02L0SC4HDsCRg024mnrVTCJ2z1ILQcQQrBiD6ZfV6tbkVoMxNBuZ&#xa;E84h9qIZL+EgRDqOmEpNTAeUU0xHCAiJmUJjWp68LZ5ijrQ/mXPI9MjOJJcaCOHJdUTalyUAfeav&#xa;EhD6BS9aaJ0/2YJRjUL1n/getpqSGaUuUrLVNODMjij4oFU/kYaXzMeVndLGjxwULX2l2orBs/oc&#xa;70rlEBg2k/OQo3kQSjFERtFqNjE/N4t6rYqTk5MIfB9+JKJtttIQhMXqXJVXq2iNAcmguk5VH+eg&#xa;nMGaeQP+yomEBDEEqf6iBQoxb4CEIPJHWU+8dUde53JzaVp5JxilAwOY7ViKP3j7bzpjrVN5utwO&#xa;hXZwramsPyiDz+CpC5U4o7fbqPcPMJlmSGU2VX1xAX3VCrjrgjuejD3HpwjCZF5CxDzA/E7jvhMC&#xa;1/PizZIy5MoieUhFYpSME2m0FCbGrwQ8isAYASgHt8QbdUbHJ0AtG5fsuBJ+o4H5UzOoVis4+vpB&#xa;tJpNNJtNobZkMERJUb1wxMhLKS+DChoOWaCLcyBBEDM3AM5SijvJsUky5o0Q8VIVcBhMCr1HLMlg&#xa;JtOQZDVm2YYwkGhL4m3jceWIUf207KSwUnvPjH4kEw5J8lZpCxDOwYJAbItnkRy/lHblqX/PgeS5&#xa;BzKFTB1AHASIpGSLwgClPS8iM74G3thqEBbBkIcJBk74a3UjuZZa6jwnwgEwLk7rth1QmcAdSgZW&#xa;m+dUlMzEzgkJnDgMQrjcGGcAC9GsR6CEYGB4GIN0BBdtuwyRDN/OzZzC4f37UFpcQGlhQTxJKWzb&#xa;0a+W4gYTE6jdCgQ0DEEadbGIPQ+UpWeBxEjAUKkJgauYRb2qgTGRJEOteMw64Np4Y6M09lQ5Rrm6&#xa;LnMWtEWooF/cYg4u3snATZ82kkwlo3NilAkAFmsQZacELSBoIWqJdz9wI2CjX9EkuAvnS7boOBFZ&#xa;PIppI5HFTwCErRYq01NghAJhgPz6LfqUveSbvKnxB51wk2Zq7d+lNMay0mea8cT5W5wL+BD5gRxs&#xa;bsAOxM8jLgsqF0EuEJr4Lo6ZJ4TA9lyMrl6D8bVr9bHx5YUFVEuLOP76QSzMzaJaKoncA0vFXgwo&#xa;EclkclsqKSmFSEcLWS5kA0pwBZ2goI78n0xzJGIChEGjPCskfXibOu/AOEMMXEu8hANELSCuFo7U&#xa;LCwCvAyY6yEaXCnYUTGz8VYf8YjYiycYWzCp6JGYE27ZsGp12HOngICgGtZBwhYQhjL/mQn3JldZ&#xa;EecHE2zVYeFzVNhDqCfGIrBQnBvrV0oAAdz+IXg9fSDSRRQfg4QkUwGaafTYm9egnjMlqRgQSi1x&#xa;LKfc0pIMaRoYWk0CTKnSCWPHi4USIt6LAKoNBOq4sAtF5EYnEHX3ozo9LXYV1KpQ+FQlfOs9XIY1&#xa;ozF/mtKXuG5uwm4wRZ/elp7Cf+Zx853Kjf+NxzIBG4iqS6RD8mwevKcfvLtfNIoxcxT1mPIlrphw&#xa;iBAC1qwhWJiCHVH0RQU0ogh1pk5oN4MN508CHnAuVCATjWLylZCcM4StBizbBgsD+JUSCKHoWrUO&#xa;TqEAu9AFkslL7U8T2DYtYdU97dKZJKJrIstL5uhSw3qWAF+5g/RBFWqhSKlm6WuxlIvCCDXOEIIj&#xa;4kCTcTQYR8jF9vOAUkQ0C39gFGEfB+saBI4fAqlVBIMy6GPradTpTC0TawqRprfZqAWn0QaX/xdC&#xa;goeBxOYcegOlwrQxX6T+5ZoJzRNr0g8oXtX6vlAExtaBOw6inn6gUATPF7WKj9mRpzg2iWcT/xIK&#xa;2mogmjuJ8Mg+hEEdng94QRY9oYXjbDHpBrsAzKtdXgK0MxHRkXu4OBMhV59asEIHLHRRPX4Efr2M&#xa;fLEfuWI/wkGxE8Ht6RPvieVKfXdi3KTxljbizJdFK8xEZTmWZcl5km4UQDAvZ2CMoxZxhATwIyaP&#xa;wRfoyWeCURsMCDlHyDiaHGhFTLz0g3FwxwUhgKWmLFsQWFsPtp59aTSaZMbQ2okv8RmAwH2+LzAg&#xa;Vwo37mPCNEiUQDpe7dQe/ZlzoH8I6B0Etx0Q1439wQqXop2pTIna3i8CUIJo908RTB5CMDuFVmsO&#xa;VquKfECRiwhWRD2oszoqPAB7syJi6uRE1TAWiXdwKWwZ2TYatRKsFoO90ABvleENDsHu7hZva9Rn&#xa;WxmMmRgCI5igjbfk/TH2MrEfZKCBaImtDKuIhagwjibjWGQELRA0OEcgGZSp51T9nIt3KUCc/dvx&#xa;jAvFOOowZzmp2mAx+2RKJSL9slxp65ROV985hESVr69X0jpWpoqRjFYRIrlQScNOsES1Ry0AQ1u5&#xa;Xly3XHzc0EgJUuohTcZt6qi04LWXEVQWEQRNhEETraiGJmthnrWwjW3EHCOoo4IIJsY5d0oGF+RH&#xa;xuQ7sThD6Ivf2P/b3pn9SJLcdfwTGZl1dlX13T19zvTOzuzttb0+AbOy1jIgJLAQsgQS4g3xxL/A&#xa;v4F48ht+AIMxwhbwYmMjWbZsr3d2dnemZ3Z6jr6768ysPCKCh8jMyurp7un1k0fqn9RHZWVkZkR8&#xa;8xe/O+KYWEqUSvhUsoLnlXG9MoPIR2w/wjzukTQn8F6+jqhUENXaiIPmCtO4MpWbnDL52BkVZ87a&#xa;OIW2BUEYIRxq9TrtgU83jPnhwEE6AlemYY/GatgyDZs8OSfZfJ/khDnP0RqT2DywQli1NZ5n10h/&#xa;2Zdw1DpjkgLzdKarESNAxSEqGOQ4zl6q3MOWKwMmvf64S92kXxWeJr9ONpsiN1+JbDll9Ls4IOZp&#xa;oKYdHCtyJ0BLF0clOEmM971/pbETIEMXGU7hBBITtawSFicEesCamWdVz7BvjviIByfv/InpRN2D&#xa;HLYYnZmnEmI0ZVWm7EiumQV+rn9p63NJSTmqIb0S5aSOe+ghn9xicnKRmZuvIRfmcCdaI2nJSQvT&#xa;kfNbBFmhaDEqnJZZFjLum1khHGcE+lTedaSkVC5TDuIsl3JsSjKj/Vg1lhwlJ4XF9JxUESWvtZUq&#xa;WwLLoWQheo3UY5c9azqxmTfrqXoEhfuboY8JfFs21CuhM49V9jYVufKYpSC9d1FYzoBlDAZNvqdE&#xa;dp2cKZ/se0bFFyK9v7EcP18NpWv3yjjYRt+9RXL3Fv2DHV7vL7ITbfMw3KY/3IUoSm21CZgEDLRo&#xa;0GKCT3OTHQ7Z4fA3Vs5OjT3INVdjMELxQrKOFgYlDL80tyjrCkIm4Dgkica4HjoOMa7DV6pf5Hg4&#xa;4HH3f9GeYGp9g/rCMvXFZeRE0xbHyJb+LHkx46ap3AoFUOcihEm5cPatfb5SuUy9XMXpt/MKW3ag&#xa;ySSadF6L61ph7igyoHGFyi7belxz1wYhZP5MmY03C4YZmXTG07hHQsKo78n2VpqOX+CNJ8WJ4kNn&#xa;EkbWvyJlL6vAAjZNdLSnWcfFU6uLScdFjJrbs9OXVKY7yjvg+APYfB/9ZIvhvduYOEan++L+eHCf&#xa;q/Esb8XXuB0G7MbbqS3ewWhbg6JjenTosc0eV1lig2Xu8xj9GwD3zICZbJmeYxLfBMQoYhKEMmiR&#xa;7RubsjZtmBQNWqrFY/GYQMWEDgjl4h/so+OEqNelPrdIdX4B6ZWQad2D3OyVjXuuhI0Am4E3m50c&#xa;5KNWJ4B42sQLRqb5p74al0sz019mFM+VMTu7QqY7rRet9CcpB9iJYxmoHBd1uJdWkxRPNyQbl7SX&#xa;J0SZjGuOy8+j78bvW3hD0/7Z7mbHC4WbjcHRGhFHmE4fEQ1xul2EPyB58jFxZ99u2BxH6DjChENk&#xa;pOgmxzyIfVqqTmyaDHVAYILxlxWDxnBElwY1lphjQMCQiIDwlEE8nU4FbY0KFVOmShmDoWP6KKFI&#xa;SJBGYnSMSlPDK4mgKWvUYkEk+zwKHyNciTus4nolVDBksLuLLJWYmJ1nde01VKMKzRrVmVmrpct0&#xa;c5GiFeGEeWwUv1D4cRyEESOQFpfUM4B78pgpLrGF5dHaqhWZQjZaIiWUy4wrRQX5cgwtYgwo2V8T&#xa;RaCHRHdu5Q6MPBds7HFPVAHPu2lXgvwZRk9Q6J4Y56oj22Buj7fbxBqM30cMfZvDFkW2CvowQHeO&#xa;IPBRx4fUQ4HXH6CSHuGwC3GEiSNUECDDIT3Vo5PELCQtltUMXdOjaxw6pp+xmfzROvTRaCaoscAM&#xa;ASFDQvY4uhDfHQNthTIVSlxjKb/RoWkzx+ToJGUHuKRLeHi0dAPpuAySiI7TYyou29TyyMWRAjcU&#xa;CNfgeAkLPsRHd9CNMqpRwlxZxG02qCxfwZuoj8IanUJmRIHTjv+MLAJnVWEx+dL3dAnK0+I/8lF1&#xa;S5BWgzRKWVtrOtHOlTWbVTu2OTEjMbRwmfEj6TEpoX2AONhF+gOS84JIChVwzBn9GFshCjJP5oYW&#xa;mBEwkwQnGFhwDvo2hiKOaPgGf3CAE8XIKIFO2ypSYQiJRkdDasqjEXrIZIqdKEAlBqUMRAIiz0YH&#xa;ao1SERXtUWOGZTNL3wwYEhESF7WKbHaoUaHFBC6SSRp8xFbh29PpBGhLtJhglQX6BPTxWWKOMV+J&#xa;ESijaJg6DWo0aXBgOihjqItpBBK0QOCm4CuD60DisGHm+Uju4KgYOXAJ2j3c+Rnc5gReYwKR1uDK&#xa;xISCnDD+OTuWDYPI1ZdR2zGOVZzZjAMVUrQLlzVg99xy7DZIJlXGsmJ1NKfT4nOAUadzu0z+EE+h&#xa;CqSHEwQ4h7t4pQpx6I9Gt8jR8+fOrnFCiC0qVylIRXG80r/CaIRQ4Pft/mFH+xAMEAd7EIaY4ZBJ&#xa;NUukDihpiaccZCwQSuJEJVAaJwStElqRy2zSQMYDYhUSqRAnsWOTxx8bTWJiJpigaeqss8ghHdr0&#xa;kch8LLLeJCgqlKhSZopmDtrzKAftEnOUcDmgzXf54dMLaWHcb5qr9PHZw+HX+i5CC7IMB6FtHIGM&#xa;7V5SUax51b3OK/I6/xT+G05sC3tI16NSb+D6D6kcbOKWysy9/BoTV5aZXNvA9WzJozFuCyOxIFWA&#xa;UMYqR5mEVjCWi/zjSNwX6Rrs5CpbUctKr5HEyLUXQMXo7YdQquJMzSCmZnFWrmGicCSLazOWgJlX&#xa;ys6mJpOP01gG7/5tkif3CHfu8WLzBTaDuxhlMEozTNTI4J/VS8j6pDW6IBYhbcZDpjTLOEIc7oDf&#xa;w/g9KkcdomGXqH0AYYROwtSMl8YDRDFGK7ROcOI2a8kMj/QOd9U2MraikU7i9NwobWtrWfxJ8jab&#xa;ZptN/TED5Y+n2RRWDgNssEyLCY7p8jHbT+Gq+LmExzt8gSfs8YQ9jumfCloxz7RZZJp92uxy9Eyv&#xa;xRd4jR4++xyzzzGZ3JarRQXjPwK+Id9hUz5m03lM7BlKpaotxuG6eNWqNZfVJ3BLZZrlBpOVKerr&#xa;qyQLDVY+9Xm7uXQa3Z9FYGX38KSLrzS+0nz38TEOVoEcH7aM4xVMRibTpEdZuONLbCovpiae7GUw&#xa;GFtR8QRI88i14nRk3C8LgwwGiH6H5L/+hSQJieMhb/jL3I03UUahTIJwJUZKEg0qSah846+Rc1eQ&#xa;U7OYJLb7fQUDzNBHHO9jOocQ+JhggG4foaPQgkwpmnGZhqnha58dfYATJ6kzI7YZHtqWNTVKEyYB&#xa;v6te59Acc6iP2Yv3rGk4jdAyysr2NgJPI3TMDXOVG2adH+gfEpnU7Z8L0eNLe4sJNlhmhhb/zU/P&#xa;xRfAMvMsMUfAkD2O2eNo7HtxgzXzLJbsINhgmQ2WucU9HrN/ztkWxC+Ja7wkrvF95//QwtYYkK7d&#xa;3dxWr3Hw0rpgTqUMruRP619jq7TPk3oH6XqUGw1aS6s0l1a48ubn8EoVMhAKR+JKh0hpQq35562j&#xa;cStDwcOUrdiZQJHncWXnFK0XjMZdFNoWWUO2MUiRw45Rxl2FAK+E6BxhfvUT9L0PiP0BOhqioiE3&#xa;gjm6cYcefXqmb9PzpS3wJ4Sg+vm30YD2ezDoMdVWhCIhJCEkGm3tpFNAqThNilT4SY8behWZwKba&#xa;sjbn1GFiTAbEVNlUmlj7vGFu8Ia5wbfVf6aRdun1VRoXm8V+oHCNxDUO3zBf5dviB2Tx2GdRhRJl&#xa;SnyZN7jLI+7y8Fy5FWCDJZpM0KHPFjuolKFK4O/PMzc4OLzKC0gc2vQ4pENIfOb5IJgXUzRFnTY9&#xa;dsVRtgiTa9OGVHa18vE0LVbNPD3hc6TbBIT5zjpGa5JwSDQY5NYDr1q1ZZnsFXGF4L22PxIhC1Aa&#xa;eZty41F6/KRpadRqTII8cb3cIJC3OQW2mUPEkYjH9zE7W6iHm+h+B+X76DCEaEg9lFRih6EKGKi+&#xa;Dd/Lltp0oxDda6N7XbTfpxwavERQTzza8THEMTqKc9OTiUK7lMcxJg7xYkM9cplMquwne5gktgqW&#xa;SizAUzndJDYUUhrBUA9pqRrGJPh6ALmsyuhvrmYaPCQLYgaAAcE5uMiEMZPKtuAzPPd8gIiEOhUW&#xa;mOGYXj43p8JdIpE4rLNIlTL7tDmgTUxy7k1usk5JeBzTY48jIpGQeYusA8Fq/giB4zrU5QTr3ioz&#xa;copflDcRrkzFBo9KbQJZsjXEyvUJptY3mJiapzE9z9TSKvXlRTzXxXNdvnN3m77S+MqkpTzTwc31&#xa;pPElXRTclic5bXoS2cHcxASpcjO6rkjNXqaoLIYB5nAH0++gbv8S3WsTH+5iooik37XgiSNmoiqv&#xa;JOt8zCPum0c4wu4AZMtOOXaXnqyWrxCUHZdVFlkxi/yP+TGOknl8hEmrnGecF53ganhRr3DNrPB9&#xa;/SOMsTIsJlUws36mpfIdY93mX9ZvckSbB+YJPfyCsyn/lbct4fEmNwkYEhByl4fn4sPBYZZJpmmi&#xa;0dxJzz+L6zo4zDHFDC36DOgwwN1geewkg6FKmRoValQo4XGfJ9SosMrCmQ+TtVlhgX1zTEDICvOj&#xa;dXlsnbZyZ0V7zIlZSkmZtnPEXFzFcSRuWLYyr+/geA6OB+5Ao/uPoDTAKbc5XNqht7FEZXqK6vQk&#xa;rzerbAUx9/2YxJDWds2wds4ydIqmOQbiUyZqRJlFw5YuJQyRh7s4nQ7y4ZY1yh91LOfzXUykMUEV&#xa;Eg+SEpXEYV1NoxgQ0UOSOhocmZcDzdKBQKBEzAyCeePygmkR6WQkimg12lIpC3oymrLRhKbHF82L&#xa;tOnS1X2rhBaVpsx5ktLADFhgmhY1djhAZZaWM4bymC4LTPMia7SY4ID2aIPvM2iCGtM0maZJQEhA&#xa;RESMc0abIWFqyTLjoLVea8M0TZrUaVLn12yyzpWxRxi3Ptp207SYZZJ9jmlQw8PFSZORxvzvWqS1&#xa;eQ2TNJgUTQIiYhExayatmQwXEonUHk7sWlenLqONx1w0wVzY4oNgm87ePtWVRaoriyy/9Qa+Mjwa&#xa;KiKlT+36adA1Y/+P9+wsqBe7Y4SD0BoR+DidNu4H7+F2B9SOA0pKUgnqiDhBBC4kMSKsIbK9HhLN&#xa;nG4QME1MhIebixYIRuBNEywTFDPUqQIvmVV6up8v36MwQ8gcBzZ00xCagE9zg20O2DOHSFNIZMzb&#xa;jA6FRMzQopTeLSYeF63GRkIQkTBJgwmqfJaX+ICP85X6rLHTaCJiPscrtOlzTI8+Pm4qOoyuPpqb&#xa;mASJHBcP6lSpU+Ul1nnADg/YPmPaxmmDZWpU2OGQA9rnn1xA/jfF17klNnnPuWuPyVQWdNPADNdD&#xa;pvuVqZLDK5WXqHhVym6VW9UnVKqTVmlxPYxXYWppBfnKZ+hMLTIo121KidZP31+n4kEqIY0BV4g8&#xa;NDNb7sesA9LFMQrRbUOvjX64Sbz5HhOxRz1y6UbH+MmAvm+1eTUcYJIYPQwgSewmISYNxlEJf6f/&#xa;ip/yLj/lXatoZHEZhfuPXKySFjWa1HjTvMq/mx/kfaBY2ecECDHwZ+ZrPGKX99mkZwbPnFOJw2d4&#xa;mTe5wT/ynWeen9F1VlhghofsssXOhdrcYI0XWeMnvMsx3Ween4N2nSssMktEzC/44MIP+ee8w2P2&#xa;eZ97tOld4IaCz/EKb/EK3+J7JEIRiySVGkYuXCvzyrxmrvQkf+v9BT+XH/Iz+SHlygROpYzwSlYG&#xa;rNTA9RCVqnUNr17HzMxhrt5ENKZRRQfDqXGKIzKAoxXO0IcoxBzugN+3m9Ud7KGPrFKj4xgdRURR&#xa;n+V4mqV4igfhx/SSLr3wCKMS9DC0yk4cWXNUHNvl3GiMiflL/pgPuM9t7uMT2BEaq0MgTvyvMCj+&#xa;hm/yD+bbkBr6xr1zJxBrjW+8wQ0whl/x0TPnCazIV6XMF3mdOzzkzgUM/wCv8QIuEhfJz7h9oTYA&#xa;b/NZtjngkM65zE8A5g/5Mm163OHhszllSjdZ5wbrvM89julydIE3BODrfIn91Pb2iL3RU6T/jLIb&#xa;QAi7DZQWij+Qb3PbfUDfCek7QzyvjCiV0xBJF1Gu2P8rNYTroaRgVs5Qq7YYeAp/pgnlCpTKiHI1&#xa;VW7S26q0dtYwgDii5UMc+fhBm0RFqGiY2yutaclySaNidBgSRQOuqUWuqkVuRx/SV316cQeTgdWk&#xa;ipLO4hlIgaX5ffMWB6LNAcfscghPCTYnP1sQ/h6f4R7b9OjTzZjFmUlkljZYZpZJOvT58BPEtf4R&#xa;v0OXAXfYYveEzfQseoEVNlhmjyN2OWKHwwu1+wqfJiRiSMSvuHPqOe6rbPCYfXr4FzJBAFxliRIe&#xa;h3Q4pnvhCJ1FZhAIQmK6nLFEZQZ/AzjGvrGmRIMqHdEm1gbjGFQqZwmlEDKxOfzSRWiDcD0iF0py&#xa;EqFDuu4xmCCvnSW8UmrBABA2G0FrdBKiVcL1aJWjJKIb91A6GYE21dKLKdI22ikAFSGVsoEkOkIn&#xa;UcEwr8e9RmQdhDa9NHikyu7pA3Lq0QOOucYSW2yPQHsOCQQd+rnClAVjn28ptXSHh0zRoEmdfdoX&#xa;Sps5pss9YJUFImI69C+EkwfsMEGVCWosM0+PwVNYcQVwl4fEJM80ZwFcZ5UZWhzRZZuDC3FYDxcX&#xa;l9e5zl0eckR3/EEKGvyYsm4UV8Q861zhgX5MR3dwhN3d3CSJ3fcr33UnsKKEVwYpmfamqckhA7dP&#xa;x9mmIitjlWOKadykjobEJCijWNUrDEwbXz/OC1CYzNCexJgkGYE4iVEqwNFTlHWMTgZo46P10AJU&#xa;aWxQfQbYAmgNPGGPOTPFCvNs8oiLwQgesM1X+TwJEU/YJWFUGOMsOqZHhwELzDDHFAOGz7StAtxh&#xa;ixUWWGOBeab5Ce8WZ+tUOkpX3xIeVSosMssT9q1T5Bn9mkwDxmeZZJIGuyd0JfcW9y40TFM0maLJ&#xa;IjPcYYsBAf0LdBjgCrOsssA+x8+041myTzRvZpgzk8zQ4j/Ej+w8C40Rxm5Wp0Y1cJ00YBl3CELw&#xa;WfdT7DsdtuQTED6xHKS2YgeTZ0Vk90vrxRqDZwTKHBKZXYZ6F1c7VhbNtHSl821ITfrZ6CGuiagY&#xa;jVFDDCEY64AxmYKUx+QWbZ7QY8AaC6yxeKGxzMhnSJsuAsEMrWcu25lh/yG7tOnxJd7gI7a4w1YK&#xa;+PNphwMa1LjGEuss0qZ/IR3mNveZZ4pl5pljkne5Q4I6955terTpMSBgmibLzDNDKw+mcS/2XlvQ&#xa;brDMfiqjfBKaZZKXuMq3+N4najfPNAC7HBKZmBxleSypAWE1bluV3AGTYIRmWU1x6BwycDoIYVAy&#xa;HnHXonYOKdMzuMalQomBbhPRx+gApR1GlVksxxR5nK3NBEbHCDQyNdobrKs0f9b0Hhl3LZJC4+HR&#xa;pP6JxgYsVxoS0mTiwnMyICBgyHVWOaLLPR5dCLQJih0OCYlYYxHDzoVAC7DPMUvM8TJX+YgHDIku&#xa;dM8D2iQobrLGGgvcSV2/Z3rELumSflvp7BqPl3RJv6V0CdpLeu7oErSX9NzRJWgv6bmjS9Be0nNH&#xa;l6C9pOeOLkF7Sc8dXYL2kp47ugTtJT139P84WGaZUimIJgAAAABJRU5ErkJggg==&#xa;" id="image3163"/>
- <rect width="282.94818" x="28.049149" y="81.03817" rx="0" height="279.91772" ry="0" style="fill:none;fill-opacity:1;stroke:none;stroke-width:5.44153594999999960;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="rect2995"/>
- </g>
- <g id="layer2"/>
-</svg>
diff --git a/tests/manual/rotation/main.cpp b/tests/manual/rotation/main.cpp
deleted file mode 100644
index 9c44b41e..00000000
--- a/tests/manual/rotation/main.cpp
+++ /dev/null
@@ -1,63 +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/QApplication>
-#include "qdeclarativeview3d.h"
-
-#include "../../shared/qmlres.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
-
- QDeclarativeView3D view;
- QString qml = q_get_qmldir(QLatin1String("qml/tst_rotation.qml"));
- view.setSource(QUrl::fromLocalFile(qml));
-
- if (QApplication::arguments().contains(QLatin1String("-maximize")))
- view.showMaximized();
- else if (QApplication::arguments().contains(QLatin1String("-fullscreen")))
- view.showFullScreen();
- else
- view.show();
-
- return app.exec();
-}
diff --git a/tests/manual/rotation/qml/TestCase.qml b/tests/manual/rotation/qml/TestCase.qml
deleted file mode 100644
index e07805fe..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 QtQuick3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 1.0
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-
-Rectangle {
- id: container
- 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)}
- Cube
- {
- id: model
- scale: 8.0
- transform: container.rotation
- }
- }
- }
-}
diff --git a/tests/manual/rotation/qml/tst_rotation.qml b/tests/manual/rotation/qml/tst_rotation.qml
deleted file mode 100644
index 9a783e15..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 QtQuick3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 1.0
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-
-// QTBUG-17408
-Item {
- id: screen
- width: aTestCase.defaultWidth * 3
- height: aTestCase.defaultHeight * 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/qtquick3d.png b/tests/manual/rotation/qtquick3d.png
deleted file mode 100644
index 8351083e..00000000
--- a/tests/manual/rotation/qtquick3d.png
+++ /dev/null
Binary files differ
diff --git a/tests/manual/rotation/rotation.pro b/tests/manual/rotation/rotation.pro
deleted file mode 100644
index e806e3f9..00000000
--- a/tests/manual/rotation/rotation.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-TEMPLATE = app
-TARGET = tst_rotation
-CONFIG += qt warn_on
-
-INSTALL_DIRS = qml
-CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg
-include(../../../pkg.pri)
-qtcAddDeployment()
-
-SOURCES += main.cpp
diff --git a/tests/manual/rotation/tst_rotation_qml.desktop b/tests/manual/rotation/tst_rotation_qml.desktop
deleted file mode 100644
index 37bf2fc6..00000000
--- a/tests/manual/rotation/tst_rotation_qml.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=tst_rotation
-Icon=/usr/share/icons/hicolor/80x80/apps/qtquick3d.png
-Exec=/usr/bin/invoker --type=e -s /usr/bin/tst_rotation -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_tst_rotation_qml
diff --git a/tests/manual/scaling/main.cpp b/tests/manual/scaling/main.cpp
deleted file mode 100644
index b4112b44..00000000
--- a/tests/manual/scaling/main.cpp
+++ /dev/null
@@ -1,63 +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/QApplication>
-#include "qdeclarativeview3d.h"
-
-#include "../../shared/qmlres.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
-
- QDeclarativeView3D view;
- QString qml = q_get_qmldir(QLatin1String("qml/tst_scaling.qml"));
- view.setSource(QUrl::fromLocalFile(qml));
-
- if (QApplication::arguments().contains(QLatin1String("-maximize")))
- view.showMaximized();
- else if (QApplication::arguments().contains(QLatin1String("-fullscreen")))
- view.showFullScreen();
- else
- view.show();
-
- return app.exec();
-}
diff --git a/tests/manual/scaling/qml/ScalingTestCase.qml b/tests/manual/scaling/qml/ScalingTestCase.qml
deleted file mode 100644
index 14ba7fb8..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 QtQuick3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 1.0
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-
-Rectangle {
- id: container
- // Parameters for editting
- property string text;
- property variant 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/tst_scaling.qml b/tests/manual/scaling/qml/tst_scaling.qml
deleted file mode 100644
index 4c6b60c0..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 QtQuick3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 1.0
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-
-// QTBUG-17408
-Item {
- id: screen
- width: aTestCase.defaultWidth * 3
- height: aTestCase.defaultHeight * 4
- 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/qtquick3d.png b/tests/manual/scaling/qtquick3d.png
deleted file mode 100644
index 8351083e..00000000
--- a/tests/manual/scaling/qtquick3d.png
+++ /dev/null
Binary files differ
diff --git a/tests/manual/scaling/scaling.pro b/tests/manual/scaling/scaling.pro
deleted file mode 100644
index ad71ce81..00000000
--- a/tests/manual/scaling/scaling.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-TEMPLATE = app
-TARGET = tst_scaling
-CONFIG += qt warn_on
-
-INSTALL_DIRS = qml
-CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg
-include(../../../pkg.pri)
-qtcAddDeployment()
-
-SOURCES += main.cpp
diff --git a/tests/manual/scaling/tst_scaling_qml.desktop b/tests/manual/scaling/tst_scaling_qml.desktop
deleted file mode 100644
index 5b036b5c..00000000
--- a/tests/manual/scaling/tst_scaling_qml.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=tst_scaling
-Icon=/usr/share/icons/hicolor/80x80/apps/qtquick3d.png
-Exec=/usr/bin/invoker --type=e -s /usr/bin/tst_scaling -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_tst_scaling_qml
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 374b7c73..00000000
--- a/tests/manual/shapes/main.cpp
+++ /dev/null
@@ -1,63 +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/QApplication>
-#include "qdeclarativeview3d.h"
-
-#include "../../shared/qmlres.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
-
- QDeclarativeView3D view;
- QString qml = q_get_qmldir(QLatin1String("qml/tst_shapes.qml"));
- view.setSource(QUrl::fromLocalFile(qml));
-
- if (QApplication::arguments().contains(QLatin1String("-maximize")))
- view.showMaximized();
- else if (QApplication::arguments().contains(QLatin1String("-fullscreen")))
- view.showFullScreen();
- else
- view.show();
-
- return app.exec();
-}
diff --git a/tests/manual/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 d4950ff5..00000000
--- a/tests/manual/shapes/shapes.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-TEMPLATE = app
-TARGET = tst_shapes
-CONFIG += qt warn_on
-
-INSTALL_DIRS = qml
-CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg
-include(../../../pkg.pri)
-qtcAddDeployment()
-
-SOURCES += main.cpp
diff --git a/tests/manual/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/main.cpp b/tests/manual/submesh/main.cpp
deleted file mode 100644
index 67e68746..00000000
--- a/tests/manual/submesh/main.cpp
+++ /dev/null
@@ -1,63 +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/QApplication>
-#include "qdeclarativeview3d.h"
-
-#include "../../shared/qmlres.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
-
- QDeclarativeView3D view;
- QString qml = q_get_qmldir(QLatin1String("qml/tst_submesh.qml"));
- view.setSource(QUrl::fromLocalFile(qml));
-
- if (QApplication::arguments().contains(QLatin1String("-maximize")))
- view.showMaximized();
- else if (QApplication::arguments().contains(QLatin1String("-fullscreen")))
- view.showFullScreen();
- else
- view.show();
-
- return app.exec();
-}
diff --git a/tests/manual/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 2fb42e66..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 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
-
-// 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/qtquick3d.png b/tests/manual/submesh/qtquick3d.png
deleted file mode 100644
index 8351083e..00000000
--- a/tests/manual/submesh/qtquick3d.png
+++ /dev/null
Binary files differ
diff --git a/tests/manual/submesh/submesh.pro b/tests/manual/submesh/submesh.pro
deleted file mode 100644
index 6f39b010..00000000
--- a/tests/manual/submesh/submesh.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-TEMPLATE = app
-TARGET = tst_submesh
-CONFIG += qt warn_on
-
-INSTALL_DIRS = qml
-CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg
-include(../../../pkg.pri)
-qtcAddDeployment()
-
-SOURCES += main.cpp
diff --git a/tests/manual/submesh/tst_submesh_qml.desktop b/tests/manual/submesh/tst_submesh_qml.desktop
deleted file mode 100644
index 7bd7fd92..00000000
--- a/tests/manual/submesh/tst_submesh_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/transformations/main.cpp b/tests/manual/transformations/main.cpp
deleted file mode 100644
index 56ac5a46..00000000
--- a/tests/manual/transformations/main.cpp
+++ /dev/null
@@ -1,63 +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/QApplication>
-#include "qdeclarativeview3d.h"
-
-#include "../../shared/qmlres.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
-
- QDeclarativeView3D view;
- QString qml = q_get_qmldir(QLatin1String("qml/tst_transformations.qml"));
- view.setSource(QUrl::fromLocalFile(qml));
-
- if (QApplication::arguments().contains(QLatin1String("-maximize")))
- view.showMaximized();
- else if (QApplication::arguments().contains(QLatin1String("-fullscreen")))
- view.showFullScreen();
- else
- view.show();
-
- return app.exec();
-}
diff --git a/tests/manual/transformations/qml/ComposedItemTransformationsTestCase.qml b/tests/manual/transformations/qml/ComposedItemTransformationsTestCase.qml
deleted file mode 100644
index 93598afa..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 QtQuick3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 1.0
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-
-Rectangle {
- id: container
- 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 c3b66aea..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 QtQuick3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 1.0
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-
-Rectangle {
- id: container
- 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/tst_transformations.qml b/tests/manual/transformations/qml/tst_transformations.qml
deleted file mode 100644
index b07bded5..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 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
-
-// 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/qtquick3d.png b/tests/manual/transformations/qtquick3d.png
deleted file mode 100644
index 8351083e..00000000
--- a/tests/manual/transformations/qtquick3d.png
+++ /dev/null
Binary files differ
diff --git a/tests/manual/transformations/transformations.pro b/tests/manual/transformations/transformations.pro
deleted file mode 100644
index 577f43bf..00000000
--- a/tests/manual/transformations/transformations.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-TEMPLATE = app
-TARGET = tst_transformations
-CONFIG += qt warn_on
-
-INSTALL_DIRS = qml
-CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg
-include(../../../pkg.pri)
-qtcAddDeployment()
-
-SOURCES += main.cpp
diff --git a/tests/manual/transformations/tst_transformations_qml.desktop b/tests/manual/transformations/tst_transformations_qml.desktop
deleted file mode 100644
index 8dc16d05..00000000
--- a/tests/manual/transformations/tst_transformations_qml.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=tst_transformations
-Icon=/usr/share/icons/hicolor/80x80/apps/qtquick3d.png
-Exec=/usr/bin/invoker --type=e -s /usr/bin/tst_transformations -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_tst_transformations_qml
diff --git a/tests/manual/translation/README b/tests/manual/translation/README
deleted file mode 100644
index bbffedd5..00000000
--- a/tests/manual/translation/README
+++ /dev/null
@@ -1 +0,0 @@
-The "One teapot" test is ensuring that the two different ways of specifying position (x,y,z vs position) both have the same result. Two teapots are being rendered. To pass, the two teapots should be rendered in exactly the same position, so it looks like only one teapot. This test fails if the teapots are not aligned - e.g. there are two spouts, or the teapot is distorted.
diff --git a/tests/manual/translation/main.cpp b/tests/manual/translation/main.cpp
deleted file mode 100644
index 2755fd86..00000000
--- a/tests/manual/translation/main.cpp
+++ /dev/null
@@ -1,63 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (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/QApplication>
-#include "qdeclarativeview3d.h"
-
-#include "../../shared/qmlres.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
-
- QDeclarativeView3D view;
- QString qml = q_get_qmldir(QLatin1String("qml/tst_translation.qml"));
- view.setSource(QUrl::fromLocalFile(qml));
-
- if (QApplication::arguments().contains(QLatin1String("-maximize")))
- view.showMaximized();
- else if (QApplication::arguments().contains(QLatin1String("-fullscreen")))
- view.showFullScreen();
- else
- view.show();
-
- return app.exec();
-}
diff --git a/tests/manual/translation/qml/AxesVsVectorTestCase.qml b/tests/manual/translation/qml/AxesVsVectorTestCase.qml
deleted file mode 100644
index c5357322..00000000
--- a/tests/manual/translation/qml/AxesVsVectorTestCase.qml
+++ /dev/null
@@ -1,155 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (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
-
-Rectangle {
- id: container
- // Parameters for editting
- property string text;
- property variant translationVectorA: Qt.vector3d(1,1,1)
- property variant translationVectorB: Qt.vector3d(1,1,1)
- property variant camera: defaultCamera
- property real itemX: 0
- property real itemY: 0
- property real itemZ: 0
- property int animationDuration: 2000
-
- // Default values:
- property variant defaultCamera: Camera {eye: Qt.vector3d(0,5,30)}
- property real defaultWidth: 220
- property real defaultHeight: 150
- property variant itemPosition:
- Qt.vector3d((translationVectorB.x * animationFactor +
- translationVectorA.x * (1.0 - animationFactor)),
- translationVectorB.y * animationFactor +
- translationVectorA.y * (1.0 - animationFactor),
- translationVectorB.z * animationFactor +
- translationVectorA.z * (1.0 - animationFactor))
- property real animationFactor: 0.0
-
- SequentialAnimation on animationFactor {
- loops: Animation.Infinite
- PropertyAnimation {
- from: 0.0
- to: 1.0
- duration: animationDuration
- }
- }
-
- border.width: 2
- border.color: "black"
- radius: 5
- width: defaultWidth
- height: defaultHeight
-
- Text {
- id: textItem
- wrapMode: "WordWrap"
- horizontalAlignment: "AlignHCenter"
- text: container.text
- anchors.left: parent.left
- anchors.right: parent.right
- }
-
- Rectangle {
- id: viewportContainer
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.margins: 1
- anchors.topMargin: 2
- anchors.top: textItem.bottom
- anchors.bottom: container.bottom
- color: "#aaccee"
-
- Viewport {
- id: view
- anchors.fill: parent
- picking: true
- camera: container.camera
-
- Material {
- // Distinctive red Color
- id: red
- ambientColor: "#884422"
- diffuseColor: "#EE4422"
- specularColor: "#FF6644"
- shininess: 200
- }
-
- Material {
- // Distinctive blue Color
- id: blue
- ambientColor: "#224488"
- diffuseColor: "#2244EE"
- specularColor: "#4466FF"
- shininess: 200
- }
-
- Effect {
- id: redEffect; material: red
- objectName: "redEffect"
- }
-
- Effect {
- id: blueEffect; material: blue
- objectName: "blueEffect"
- }
-
- Teapot
- {
- id: vectorModel
-// effect: redEffect
- position: itemPosition
- }
- Teapot
- {
- id: axesModel
-// effect: blueEffect
- x: itemX
- y: itemY
- z: itemZ
- }
- }
- }
-}
diff --git a/tests/manual/translation/qml/TranslationTestCase.qml b/tests/manual/translation/qml/TranslationTestCase.qml
deleted file mode 100644
index 9526cc1e..00000000
--- a/tests/manual/translation/qml/TranslationTestCase.qml
+++ /dev/null
@@ -1,110 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (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
-
-Rectangle {
- id: container
- // Parameters for editting
- property string text;
- property real itemX: 0
- property real itemY: 0
- property real itemZ: 0
- property variant camera: defaultCamera
-
- // Default values:
- property variant defaultCamera: Camera { eye: Qt.vector3d(0,5,30) }
- property real defaultWidth: 220
- property real defaultHeight: 150
- property real animationFactor: 0.0
- property real animationDuration: 2000
-
- SequentialAnimation on animationFactor {
- loops: Animation.Infinite
- PropertyAnimation {
- from: 0.0
- to: 1.0
- duration: animationDuration
- }
- }
-
- border.width: 2
- border.color: "black"
- radius: 5
- width: defaultWidth
- height: defaultHeight
-
- Text {
- id: textItem
- wrapMode: "WordWrap"
- horizontalAlignment: "AlignHCenter"
- text: container.text
- anchors.left: parent.left
- anchors.right: parent.right
- }
-
- Rectangle {
- id: viewportContainer
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.margins: 1
- anchors.topMargin: 2
- anchors.top: textItem.bottom
- anchors.bottom: container.bottom
- color: "#aaccee"
-
- Viewport {
- id: view
- anchors.fill: parent
- picking: true
- camera: container.camera
- Teapot
- {
- id: model
- x: itemX
- y: itemY
- z: itemZ
- }
- }
- }
-}
diff --git a/tests/manual/translation/qml/TranslationVectorTestCase.qml b/tests/manual/translation/qml/TranslationVectorTestCase.qml
deleted file mode 100644
index 79bbe8fd..00000000
--- a/tests/manual/translation/qml/TranslationVectorTestCase.qml
+++ /dev/null
@@ -1,114 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (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
-
-Rectangle {
- id: container
- // Parameters for editting
- property string text;
- property variant translationVectorA: Qt.vector3d(1,1,1)
- property variant translationVectorB: Qt.vector3d(1,1,1)
- property variant camera: defaultCamera
-
- // Default values:
- property variant defaultCamera: Camera {eye: Qt.vector3d(0,5,30)}
- property real defaultWidth: 220
- property real defaultHeight: 150
- property variant itemPosition:
- Qt.vector3d((translationVectorB.x * animationFactor +
- translationVectorA.x * (1.0 - animationFactor)),
- translationVectorB.y * animationFactor +
- translationVectorA.y * (1.0 - animationFactor),
- translationVectorB.z * animationFactor +
- translationVectorA.z * (1.0 - animationFactor))
- property real animationFactor: 0.0
- property int animationDuration: 2000
-
- SequentialAnimation on animationFactor {
- loops: Animation.Infinite
- PropertyAnimation {
- from: 0.0
- to: 1.0
- duration: animationDuration
- }
- }
-
- border.width: 2
- border.color: "black"
- radius: 5
- width: defaultWidth
- height: defaultHeight
-
- Text {
- id: textItem
- wrapMode: "WordWrap"
- horizontalAlignment: "AlignHCenter"
- text: container.text
- anchors.left: parent.left
- anchors.right: parent.right
- }
-
- Rectangle {
- id: viewportContainer
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.margins: 1
- anchors.topMargin: 2
- anchors.top: textItem.bottom
- anchors.bottom: container.bottom
- color: "#aaccee"
-
- Viewport {
- id: view
- anchors.fill: parent
- picking: true
- camera: container.camera
- Teapot
- {
- id: model
- position: itemPosition
- }
- }
- }
-}
diff --git a/tests/manual/translation/qml/tst_translation.qml b/tests/manual/translation/qml/tst_translation.qml
deleted file mode 100644
index 0cea31b7..00000000
--- a/tests/manual/translation/qml/tst_translation.qml
+++ /dev/null
@@ -1,158 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (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
-
-// QTBUG-17408
-Item {
- id: screen
- width: aTestCase.defaultWidth * 3
- height: aTestCase.defaultHeight * 4
-
- Flow {
- anchors.fill: parent
- TranslationVectorTestCase {
- id: aTestCase
- text: "X Translation\n(Left to Right)"
- translationVectorA: Qt.vector3d(-4,1,1)
- translationVectorB: Qt.vector3d(4,1,1)
- }
-
- TranslationVectorTestCase {
- text: "Y Translation\n(Bottom to Top)"
- translationVectorA: Qt.vector3d(1,-4,1)
- translationVectorB: Qt.vector3d(1,4,1)
- }
-
- TranslationVectorTestCase {
- text: "Z Translation\n(Back to Front)"
- translationVectorA: Qt.vector3d(1,1,-4)
- translationVectorB: Qt.vector3d(1,1,4)
- }
-
- TranslationVectorTestCase {
- text: "-X Translation\n(Right to Left)"
- translationVectorA: Qt.vector3d(4,1,1)
- translationVectorB: Qt.vector3d(-4,1,1)
- }
-
- TranslationVectorTestCase {
- text: "-Y Translation\n(Top to Bottom)"
- translationVectorA: Qt.vector3d(1,4,1)
- translationVectorB: Qt.vector3d(1,-4,1)
- }
-
- TranslationVectorTestCase {
- text: "-Z Translation\n(Front to Back)"
- translationVectorA: Qt.vector3d(1,1,4)
- translationVectorB: Qt.vector3d(1,1,-4)
- }
-
- TranslationVectorTestCase {
- text: "Sequential Translation in X,Y,Z\n(Previous 6 in order)"
- id: sequentialTestCase
- property real itemX:-4;
- property real itemY:-4;
- property real itemZ:-4;
- itemPosition: Qt.vector3d(itemX,itemY,itemZ)
- // itemPosition: Qt.vector3d(itemX,4,4)
- SequentialAnimation {
- loops: Animation.Infinite
- running: true
- PropertyAnimation {
- target: sequentialTestCase; property: "itemX";
- to: 4; duration: 1000
- }
- PropertyAnimation {
- target: sequentialTestCase; property: "itemY";
- to: 4; duration: 1000
- }
- PropertyAnimation {
- target: sequentialTestCase; property: "itemZ";
- to: 4; duration: 1000
- }
- PropertyAnimation {
- target: sequentialTestCase; property: "itemX";
- to: -4; duration: 1000
- }
- PropertyAnimation {
- target: sequentialTestCase; property: "itemY";
- to: -4; duration: 1000
- }
- PropertyAnimation {
- target: sequentialTestCase; property: "itemZ";
- to: -4; duration: 1000
- }
- }
- }
-
- TranslationTestCase {
- text: "Translation in X,Y,Z properties\n(Smooth Animation)"
- id: attributeTestCase
- itemX: 4 * Math.sin(animationFactor * Math.PI * 2.0 * 3.0);
- itemY: 4 * Math.sin(animationFactor * Math.PI * 2.0 * 5.0);
- itemZ: 4 * Math.sin(animationFactor * Math.PI * 2.0 * 7.0);
- animationDuration: 15000
- }
-
- TranslationVectorTestCase {
- text: "Translation in Qt.Vector3d(X,Y,Z)\n(Smooth Animation)"
- id: combinedVectorTestCase
- property real itemX: 4 * Math.sin(animationFactor * Math.PI * 2.0 * 3.0);
- property real itemY: 4 * Math.sin(animationFactor * Math.PI * 2.0 * 5.0);
- property real itemZ: 4 * Math.sin(animationFactor * Math.PI * 2.0 * 7.0);
- itemPosition: Qt.vector3d(itemX,itemY,itemZ)
- animationDuration: 15000
- }
-
- AxesVsVectorTestCase {
- text: "Last two overlaid\n(Should look like one teapot)"
- id: axesVsVectorTestCase
- itemX: 4 * Math.sin(animationFactor * Math.PI * 2.0 * 3.0);
- itemY: 4 * Math.sin(animationFactor * Math.PI * 2.0 * 5.0);
- itemZ: 4 * Math.sin(animationFactor * Math.PI * 2.0 * 7.0);
- itemPosition: Qt.vector3d(itemX,itemY,itemZ)
- animationDuration: 15000
- }
- }
-}
diff --git a/tests/manual/translation/qtquick3d.png b/tests/manual/translation/qtquick3d.png
deleted file mode 100644
index 8351083e..00000000
--- a/tests/manual/translation/qtquick3d.png
+++ /dev/null
Binary files differ
diff --git a/tests/manual/translation/translation.pro b/tests/manual/translation/translation.pro
deleted file mode 100644
index f88fb24a..00000000
--- a/tests/manual/translation/translation.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-TEMPLATE = app
-TARGET = tst_translation
-CONFIG += qt warn_on
-
-INSTALL_DIRS = qml
-CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg
-include(../../../pkg.pri)
-qtcAddDeployment()
-
-SOURCES += main.cpp
diff --git a/tests/manual/translation/tst_translation_qml.desktop b/tests/manual/translation/tst_translation_qml.desktop
deleted file mode 100644
index bbdab15c..00000000
--- a/tests/manual/translation/tst_translation_qml.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=tst_translation
-Icon=/usr/share/icons/hicolor/80x80/apps/qtquick3d.png
-Exec=/usr/bin/invoker --type=e -s /usr/bin/tst_translation -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_tst_translation_qml
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 872d71a1..00000000
--- a/tests/shared/qmlres.h
+++ /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$
-**
-****************************************************************************/
-
-
-#ifndef QMLRES_H
-#define QMLRES_H
-
-#include <QtCore/qdir.h>
-#include <QtCore/qcoreapplication.h>
-
-#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;
-}
-
-#endif // QMLRES_H
diff --git a/tests/shared/qtest_helpers.h b/tests/shared/qtest_helpers.h
deleted file mode 100644
index 0d198cbf..00000000
--- a/tests/shared/qtest_helpers.h
+++ /dev/null
@@ -1,160 +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"
-#include <QByteArray>
-
-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/systemtests/sys_quick3d.pro b/tests/systemtests/sys_quick3d.pro
deleted file mode 100644
index b9d6c694..00000000
--- a/tests/systemtests/sys_quick3d.pro
+++ /dev/null
@@ -1,11 +0,0 @@
-CONFIG+=systemtest
-SOURCES=sys_quick3d.qtt
-
-unix:!symbian {
- maemo5 {
- target.path = /opt/usr/bin
- } else {
- target.path = /usr/local/bin
- }
- INSTALLS += target
-}
diff --git a/tests/systemtests/sys_quick3d.qtt b/tests/systemtests/sys_quick3d.qtt
deleted file mode 100644
index 1a335823..00000000
--- a/tests/systemtests/sys_quick3d.qtt
+++ /dev/null
@@ -1,1094 +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 Qt Mobility Components.
-**
-** $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$
-**
-****************************************************************************/
-
-//TESTED_COMPONENT=src/qtquick3d
-
-testcase = {
-
- basket_test: function()
- {
- //test meta data
- testTitle = "Qt3D - Basket";
- testBinary = "basket";
- testSource = "$QTDIR/qtquick3d/examples/qt3d/";
- testGoal = "Test animating objects in Qt3D.";
- testPreconditions = "OpenGL/OpenGL ES required";
- testGroups = "BAT, TP1, TP2, 1.0";
- testRequirements = "NA";
- //Test Steps
- prompt(twiki('---+++ ' + testTitle + '<br><br>
- *Goal:* ' + testGoal + '<br>
- *Pre-Requisites:* ' + testPreconditions + '<br>
- *Tested Binary:* ' + testBinary + '<br>
- *Requirements:* ' + testRequirements + '<br>
- | *Step* | *Verification* |
- | Launch the basket C++ example | the application starts and shows animation of a rotating basket with textures |
- | Use the mouse or touch pad to rotate the view | the view rotates fine, user can view the basket from all angles |
- | Maximize/minimize/resize the view | the animation maximizes/minimizes/resize with the viewport, shows fine, no crash |
- | Close the application | application closes without warning or errors |
- '));
- },
-
- basket_qml_test: function()
- {
- //test meta data
- testTitle = "Quick3D - Basket";
- testBinary = "basket_qml";
- testSource = "$QTDIR/qtquick3d/examples/quick3d/";
- testGoal = "Test animating objects in Quick3D.";
- testPreconditions = "OpenGL/OpenGL ES required";
- testGroups = "BAT, TP1, TP2, 1.0";
- testRequirements = "NA";
- //Test Steps
- prompt(twiki('---+++ ' + testTitle + '<br><br>
- *Goal:* ' + testGoal + '<br>
- *Pre-Requisites:* ' + testPreconditions + '<br>
- *Tested Binary:* ' + testBinary + '<br>
- *Requirements:* ' + testRequirements + '<br>
- | *Step* | *Verification* |
- | Launch the basket_qml example | the application starts and showss animation of a rotating basket with textures |
- | Use the mouse or touch pad to rotate the view | the view rotates fine, user can view the basket from all angles |
- | Maximize/minimize/resize the view | the animation does not change size with the viewport, shows fine with no crash |
- | Close the application | application closes without warning or errors |
- '));
- },
-
- builder_test: function()
- {
- //test meta data
- testTitle = "Qt3D - Builder";
- testBinary = "builder";
- testSource = "$QTDIR/qtquick3d/examples/qt3d/";
- testGoal = "Test creating scenes using Builder";
- testPreconditions = "OpenGL/OpenGL ES required";
- testGroups = "BAT, TP1, TP2, 1.0";
- testRequirements = "NA";
- //Test Steps
- prompt(twiki('---+++ ' + testTitle + '<br><br>
- *Goal:* ' + testGoal + '<br>
- *Pre-Requisites:* ' + testPreconditions + '<br>
- *Tested Binary:* ' + testBinary + '<br>
- *Requirements:* ' + testRequirements + '<br>
- | *Step* | *Verification* |
- | Launch the builder example | the application starts and shows three cans with picture textures |
- | Use the mouse or touch pad to rotate the view | the view rotates fine, user can view the cans from all angles, no culling out of any can |
- | Maximize/minimize/resize the view | the animation maximizes/minimizes/resize with the viewport, shows fine, no crash |
- | Close the application | application closes without warning or errors |
- '));
- },
-
- cube_test: function()
- {
- //test meta data
- testTitle = "Qt3D - Cube";
- testBinary = "cube";
- testSource = "$QTDIR/qtquick3d/examples/qt3d/";
- testGoal = "Test applying transformations and materials to objects.";
- testPreconditions = "OpenGL/OpenGL ES required";
- testGroups = "BAT, TP1, TP2, 1.0";
- testRequirements = "NA";
- //Test Steps
- prompt(twiki('---+++ ' + testTitle + '<br><br>
- *Goal:* ' + testGoal + '<br>
- *Pre-Requisites:* ' + testPreconditions + '<br>
- *Tested Binary:* ' + testBinary + '<br>
- *Requirements:* ' + testRequirements + '<br>
- | *Step* | *Verification* |
- | Launch the cube C++ example | the application starts and show a cube with Qt logo textures on each face |
- | Use the mouse or touch pad to rotate the view | the cube rotates fine, user can view all faces of the cube |
- | Maximize/minimize/resize the view | the cube maximizes/minizes/resize with the viewport, shows fine without crash |
- | Close the application | application closes without warning or errors |
- '));
- },
-
- cubehouse_test: function()
- {
- //test meta data
- testTitle = "Qt3D - Cube House";
- testBinary = "cubehouse";
- testSource = "$QTDIR/qtquick3d/demos/qt3d/";
- testGoal = "Test rendering, accelerometers handling";
- testPreconditions = "OpenGL/OpenGL ES required, GLSL Extension Required";
- testGroups = "BAT, TP1, TP2, 1.0";
- testRequirements = "NA";
- //Test Steps
- prompt(twiki('---+++ ' + testTitle + '<br><br>
- *Goal:* ' + testGoal + '<br>
- *Pre-Requisites:* ' + testPreconditions + '<br>
- *Tested Binary:* ' + testBinary + '<br>
- *Requirements:* ' + testRequirements + '<br>
- | *Step* | *Verification* |
- | Launch the cube house demo | the application starts and shows a teapot with a semi-transparent rotating cube with Qt logo texture, in a colored block house |
- | Maximize/minimize/resize the view | the house resizes, the models scales retaining the aspect ratio, animation keeps going |
- | Close the application | application closes without warning or errors |
- '));
- },
-
- cube_qml_test: function()
- {
- //test meta data
- testTitle = "Quick3D - Cube";
- testBinary = "cube_qml";
- testSource = "$QTDIR/qtquick3d/examples/quick3d/";
- testGoal = "Test applying transformations and materials to objects using QML.";
- testPreconditions = "OpenGL/OpenGL ES required";
- testGroups = "BAT, TP1, TP2, 1.0";
- testRequirements = "NA";
- //Test Steps
- prompt(twiki('---+++ ' + testTitle + '<br><br>
- *Goal:* ' + testGoal + '<br>
- *Pre-Requisites:* ' + testPreconditions + '<br>
- *Tested Binary:* ' + testBinary + '<br>
- *Requirements:* ' + testRequirements + '<br>
- | *Step* | *Verification* |
- | Launch the cube qml example | the application starts and show a cube with Qt logo textures on each face |
- | Use the mouse or touch pad to rotate the view | the cube rotates fine, user can view all faces of the cube |
- | Maximize/minimize/resize the view | the cube does not change in size |
- | Close the application | application closes without warning or errors |
- '));
- },
-
- cylinder_test: function()
- {
- //test meta data
- testTitle = "Qt3D - Cylinder";
- testBinary = "cylinder";
- testSource = "$QTDIR/qtquick3d/examples/qt3d/";
- testGoal = "Test Builder, material, network transparency";
- testPreconditions = "OpenGL/OpenGL ES required, Internet required";
- testGroups = "BAT, TP1, TP2, 1.0";
- testRequirements = "NA";
- //Test Steps
- prompt(twiki('---+++ ' + testTitle + '<br><br>
- *Goal:* ' + testGoal + '<br>
- *Pre-Requisites:* ' + testPreconditions + '<br>
- *Tested Binary:* ' + testBinary + '<br>
- *Requirements:* ' + testRequirements + '<br>
- | *Step* | *Verification* |
- | Launch the cylinder example | the application starts and shows a cup of cappucino, with Qt 3D label and a coffee teapot texture on top |
- | Use the mouse or touch pad to rotate the view | the cup rotates fine, user can view all faces of the cube |
- | Maximize/minimize/resize the view | the cup maximizes/minimizes/resizes without crash |
- | Close the application | application closes without warning or errors |
- '));
- },
-
- flickr3d_test: function()
- {
- //test meta data
- testTitle = "Quick3D - Flickr 3D";
- testBinary = "flickr3d";
- testSource = "$QTDIR/qtquick3d/demos/quick3d/";
- testGoal = "Test camera use with QML, skybox in QML";
- testPreconditions = "OpenGL/OpenGL ES required";
- testGroups = "BAT, TP1, TP2, 1.0";
- testRequirements = "NA";
- //Test Steps
- prompt(twiki('---+++ ' + testTitle + '<br><br>
- *Goal:* ' + testGoal + '<br>
- *Pre-Requisites:* ' + testPreconditions + '<br>
- *Tested Binary:* ' + testBinary + '<br>
- *Requirements:* ' + testRequirements + '<br>
- | *Step* | *Verification* |
- | Launch the flickr3d demo | the application starts and shows a swing lake surrounded with mountains, together with a green cube floating on the center |
- | Drag mouse or touch | the green cube will slightly swing |
- | Maximize/minimize/resize the view | the view keeps size without resizing |
- | Close the application | application closes without warning or errors |
- '));
- },
-
- forest_qml_test: function()
- {
- //test meta data
- testTitle = "Quick3D - Forest";
- testBinary = "forest_qml";
- testSource = "$QTDIR/qtquick3d/examples/quick3d/";
- testGoal = "Test creating billboard objects.";
- testPreconditions = "OpenGL/OpenGL ES required";
- testGroups = "BAT, TP1, TP2, 1.0";
- testRequirements = "NA";
- //Test Steps
- prompt(twiki('---+++ ' + testTitle + '<br><br>
- *Goal:* ' + testGoal + '<br>
- *Pre-Requisites:* ' + testPreconditions + '<br>
- *Tested Binary:* ' + testBinary + '<br>
- *Requirements:* ' + testRequirements + '<br>
- | *Step* | *Verification* |
- | Launch the forest qml example | the application starts and shows a brown earth plain with 11 green trees planted |
- | Use the mouse or touch pad to rotate the view | the objects rotates fine, user can view from all angles |
- | Maximize/minimize/resize the view | the view keeps size without resizing |
- | Close the application | application closes without warning or errors |
- '));
- },
-
- geometry_test: function()
- {
- //test meta data
- testTitle = "Qt3D - Geometry";
- testBinary = "geometry";
- testSource = "$QTDIR/qtquick3d/examples/qt3d/";
- testGoal = "Test geometry building and painter building";
- testPreconditions = "OpenGL/OpenGL ES required";
- testGroups = "BAT, TP1, TP2, 1.0";
- testRequirements = "NA";
- //Test Steps
- prompt(twiki('---+++ ' + testTitle + '<br><br>
- *Goal:* ' + testGoal + '<br>
- *Pre-Requisites:* ' + testPreconditions + '<br>
- *Tested Binary:* ' + testBinary + '<br>
- *Requirements:* ' + testRequirements + '<br>
- | *Step* | *Verification* |
- | Launch the geometry | the application starts and shows a paper polyhedron with number textures, together with its unfolded plain view |
- | Use the mouse or touch pad to rotate the view | the objects rotates fine, user can view from all angles |
- | Maximize/minimize/resize the view | the view resizes accordingly, animation continues |
- | Close the application | application closes without warning or errors |
- '));
- },
-
- graphicsview_test: function()
- {
- //test meta data
- testTitle = "Qt3D - Graphicsview";
- testBinary = "graphicsview";
- testSource = "$QTDIR/qtquick3d/examples/qt3d/";
- testGoal = "Test frame buffer and interactions.";
- testPreconditions = "OpenGL/OpenGL ES required";
- testGroups = "BAT, TP1, TP2, 1.0";
- testRequirements = "NA";
- //Test Steps
- prompt(twiki('---+++ ' + testTitle + '<br><br>
- *Goal:* ' + testGoal + '<br>
- *Pre-Requisites:* ' + testPreconditions + '<br>
- *Tested Binary:* ' + testBinary + '<br>
- *Requirements:* ' + testRequirements + '<br>
- | *Step* | *Verification* |
- | Launch the graphicsview example | the application starts, showing a teapot with rubber band textures on it |
- | Use the mouse or touch pad to rotate the view | the teapot rotates fine |
- | Click and drag the rubber band end points | the rubber band texture should be dragged, presenting a texture animation |
- | Maximize/minimize/resize the view | the view resizes accordingly, animation continues |
- | Click on the cube on top left corner | the main object change from teapot to cube, retaining the texture |
- | Repeat 2-4 for the cube | the behavior are same as the teapot |
- | Close the application | application closes without warning or errors |
- '));
- },
-
- lander_test: function()
- {
- //test meta data
- testTitle = "Quick3D - Lander";
- testBinary = "lander";
- testSource = "$QTDIR/qtquick3d/examples/quick3d/";
- testGoal = "Test QML integration, shaders, submesh, materials, mouse events";
- testPreconditions = "OpenGL/OpenGL ES required, GLSL Extension Required";
- testGroups = "BAT, TP1, TP2, 1.0";
- testRequirements = "NA";
- //Test Steps
- prompt(twiki('---+++ ' + testTitle + '<br><br>
- *Goal:* ' + testGoal + '<br>
- *Pre-Requisites:* ' + testPreconditions + '<br>
- *Tested Binary:* ' + testBinary + '<br>
- *Requirements:* ' + testRequirements + '<br>
- | *Step* | *Verification* |
- | Launch the lander example | the application starts, showing a galaxy background with color flashing Qt-Lander and tap to play text |
- | Click to start play | over the galaxy background there is a lunar land, a lunar ship floating on top with shadow projected |
- | Click and hold mouse/tap to navigate the ship | the ship flames and accelerates to the sky |
- | Navigate the ship to land on the surface | the game finishes when the ship hits the surface, return to the welcome screen |
- | Navigate the ship to land outside the surface | the game finishes when the ship hits the surface, return to the welcome screen |
- | Maximize/minimize/resize the view | the view keeps size without resizing |
- | Close the application | application closes without warning or errors |
- '));
- },
-
- matrix_animation_test: function()
- {
- //test meta data
- testTitle = "Qt3D - Matrix Animation";
- testBinary = "matrix_animation";
- testSource = "$QTDIR/qtquick3d/examples/quick3d/";
- testGoal = "Test matrix animation.";
- testPreconditions = "OpenGL/OpenGL ES required";
- testGroups = "BAT, TP1, TP2, 1.0";
- testRequirements = "NA";
- //Test Steps
- prompt(twiki('---+++ ' + testTitle + '<br><br>
- *Goal:* ' + testGoal + '<br>
- *Pre-Requisites:* ' + testPreconditions + '<br>
- *Tested Binary:* ' + testBinary + '<br>
- *Requirements:* ' + testRequirements + '<br>
- | *Step* | *Verification* |
- | Launch the matrix animation example | the application starts, showing a Qt logo textured teapot, rotating and jumping up and down |
- | Click on the screen | the teapot stretches/squeezes in response to click |
- | Maximize/minimize/resize the view | the view keeps size without resizing |
- | Close the application | application closes without warning or errors |
- '));
- },
-
- model_viewer_test: function()
- {
- //test meta data
- testTitle = "Qt3D - Model Viewer";
- testBinary = "model_viewer";
- testSource = "$QTDIR/qtquick3d/demos/quick3d/";
- testGoal = "Test model loading and zooming.";
- testPreconditions = "OpenGL/OpenGL ES required";
- testGroups = "BAT, TP1, TP2, 1.0";
- testRequirements = "NA";
- //Test Steps
- prompt(twiki('---+++ ' + testTitle + '<br><br>
- *Goal:* ' + testGoal + '<br>
- *Pre-Requisites:* ' + testPreconditions + '<br>
- *Tested Binary:* ' + testBinary + '<br>
- *Requirements:* ' + testRequirements + '<br>
- | *Step* | *Verification* |
- | Launch the model viewer demo | the application starts, showing a gray monkey head and buttons with an address bar on bottom |
- | Rotate the model by mouse/tap | the model rotates as desired |
- | Click on +/- button | the model zoom in/out accordingly |
- | Fill in a file address/url to the address bar, click on the arrow | the model get loaded and displayed |
- | Repeat step 4 for all supported model formats | all supported formats load and display fine |
- | Close the application | application closes without warning or errors |
- '));
- },
-
- monkeygod_test: function()
- {
- //test meta data
- testTitle = "Quick3D - Monkey God";
- testBinary = "monkeygod";
- testSource = "$QTDIR/qtquick3d/examples/quick3d/";
- testGoal = "Test building up complex 3D scenes including materials and animations.";
- testPreconditions = "OpenGL/OpenGL ES required";
- testGroups = "BAT, TP1, TP2, 1.0";
- testRequirements = "NA";
- //Test Steps
- prompt(twiki('---+++ ' + testTitle + '<br><br>
- *Goal:* ' + testGoal + '<br>
- *Pre-Requisites:* ' + testPreconditions + '<br>
- *Tested Binary:* ' + testBinary + '<br>
- *Requirements:* ' + testRequirements + '<br>
- | *Step* | *Verification* |
- | Launch the monkeygod example | the application starts, showing a wooden textured cube, a monkey head watching some penguins dancing |
- | Rotate the view with mouse/tap | the material/lights are correctly rendered, animation works while rotating |
- | Maximize/minimize/resize the view | the view keeps size without resizing |
- | Close the application | application closes without warning or errors |
- '));
- },
-
- moon_test: function()
- {
- //test meta data
- testTitle = "Quick3D - Moon";
- testBinary = "moon";
- testSource = "$QTDIR/qtquick3d/examples/quick3d/";
- testGoal = "Test sphere and textures.";
- testPreconditions = "OpenGL/OpenGL ES required";
- testGroups = "BAT, TP1, TP2, 1.0";
- testRequirements = "NA";
- //Test Steps
- prompt(twiki('---+++ ' + testTitle + '<br><br>
- *Goal:* ' + testGoal + '<br>
- *Pre-Requisites:* ' + testPreconditions + '<br>
- *Tested Binary:* ' + testBinary + '<br>
- *Requirements:* ' + testRequirements + '<br>
- | *Step* | *Verification* |
- | Launch the moon example | the application starts, showing a moon ball in the center of the view, with moon texture |
- | Rotate the moon | the lights from right side to left renders fine |
- | Maximize/minimize/resize the view | the view keeps size without resizing |
- | Close the application | application closes without warning or errors |
- '));
- },
-
- nesting_test: function()
- {
- //test meta data
- testTitle = "Qt3D - Nesting";
- testBinary = "nesting";
- testSource = "$QTDIR/qtquick3d/examples/qt3d/";
- testGoal = "Test drawing into framebuffer objects.";
- testPreconditions = "OpenGL/OpenGL ES required";
- testGroups = "BAT, TP1, TP2, 1.0";
- testRequirements = "NA";
- //Test Steps
- prompt(twiki('---+++ ' + testTitle + '<br><br>
- *Goal:* ' + testGoal + '<br>
- *Pre-Requisites:* ' + testPreconditions + '<br>
- *Tested Binary:* ' + testBinary + '<br>
- *Requirements:* ' + testRequirements + '<br>
- | *Step* | *Verification* |
- | Launch the nesting example | the application starts, showing two rotating cubes, one brown with Qt logo texture, the other blue with spinning teapot animating texture |
- | Rotate the view | the objects get rotated while spinning |
- | Maximize/minimize/resize the view | the resizes accordingly |
- | Close the application | application closes without warning or errors |
- '));
- },
-
- pageflip_test: function()
- {
- //test meta data
- testTitle = "Qt3D - Page Flip";
- testBinary = "pageflip";
- testSource = "$QTDIR/qtquick3d/demos/qt3d/";
- testGoal = "Test using shaders to combine textures.";
- testPreconditions = "OpenGL/OpenGL ES required, GLSL Extension Required";
- testGroups = "BAT, TP1, TP2, 1.0";
- testRequirements = "NA";
- //Test Steps
- prompt(twiki('---+++ ' + testTitle + '<br><br>
- *Goal:* ' + testGoal + '<br>
- *Pre-Requisites:* ' + testPreconditions + '<br>
- *Tested Binary:* ' + testBinary + '<br>
- *Requirements:* ' + testRequirements + '<br>
- | *Step* | *Verification* |
- | Launch the pageflip demo | the application starts, showing a page flipping book with Qt Quarterly content |
- | Observe the animation | the shadow is projected properly while page flips |
- | Maximize/minimize/resize the view | the view keeps size without resizing |
- | Close the application | application closes without warning or errors |
- '));
- },
-
- photobrowser3d_test: function()
- {
- //test meta data
- testTitle = "Qt3D - Photo Browser 3D";
- testBinary = "photobrowser3d";
- testSource = "$QTDIR/qtquick3d/demos/qt3d/";
- testGoal = "Test skybox, animation, mouse intraction and camera.";
- testPreconditions = "OpenGL/OpenGL ES required";
- testGroups = "BAT, TP1, TP2, 1.0";
- testRequirements = "NA";
- //Test Steps
- prompt(twiki('---+++ ' + testTitle + '<br><br>
- *Goal:* ' + testGoal + '<br>
- *Pre-Requisites:* ' + testPreconditions + '<br>
- *Tested Binary:* ' + testBinary + '<br>
- *Requirements:* ' + testRequirements + '<br>
- | *Step* | *Verification* |
- | Launch the photo browser 3d demo | the application starts, a lake surrounded with mountain appears, plus a photo frame with some pictures |
- | Click on one of the pictures | the picture shows full screen |
- | Maximize/minimize/resize the view | the resizes accordingly |
- | Click again on the picture | the picture goes back to the frame |
- | Close the application | application closes without warning or errors |
- | Click on the << or >> button | the camera swings around |
- '));
- },
-
- photoroom_test: function()
- {
- //test meta data
- testTitle = "Quick3D - Photo Room";
- testBinary = "photoroom";
- testSource = "$QTDIR/qtquick3d/examples/quick3d/";
- testGoal = "Test mouse events on items, model view";
- testPreconditions = "OpenGL/OpenGL ES required";
- testGroups = "BAT, TP1, TP2, 1.0";
- testRequirements = "NA";
- //Test Steps
- prompt(twiki('---+++ ' + testTitle + '<br><br>
- *Goal:* ' + testGoal + '<br>
- *Pre-Requisites:* ' + testPreconditions + '<br>
- *Tested Binary:* ' + testBinary + '<br>
- *Requirements:* ' + testRequirements + '<br>
- | *Step* | *Verification* |
- | Launch the photo room example | the application starts, showing 10 pictures in two rows |
- | Move mouse cursor over the pictures | the pictures hovered pops up with bouncing effect (this is not applicable for touch screen devices) |
- | Maximize/minimize/resize the view | the view keeps size without resizing |
- | Click on one of the pictures | the picture shows full screen |
- | Close the application | application closes without warning or errors |
- | Click on the picture again | the picture falls back with effects |
- '));
- },
-
- qglinfo_test: function()
- {
- //test meta data
- testTitle = "Qt3D - QGLInfo";
- testBinary = "qglinfo";
- testSource = "$QTDIR/qtquick3d/utils/qt3d/";
- testGoal = "Test OpenGL information.";
- testPreconditions = "OpenGL/OpenGL ES required";
- testGroups = "BAT, TP1, TP2, 1.0";
- testRequirements = "NA";
- //Test Steps
- prompt(twiki('---+++ ' + testTitle + '<br><br>
- *Goal:* ' + testGoal + '<br>
- *Pre-Requisites:* ' + testPreconditions + '<br>
- *Tested Binary:* ' + testBinary + '<br>
- *Requirements:* ' + testRequirements + '<br>
- | *Step* | *Verification* |
- | Launch qglinfo utility (called QtQuick3D on Windows) | the application starts, showing a window with OpenGL informations |
- | Read the information | the information displayed reflects the system OpenGL ability |
- | Click on menu File - Save as | the displayed information can be saved as a text file |
- | Click on menu Edit - Copy | the information are copied to the clipboard |
- | Click on menu View - Run FPS Test | a test window pops up with a green cube rotating |
- | Close the test window | a frame per second number is shown in the main windows status bar |
- | Click on menu Help - About | correct about information are displayed |
- | Close the application | application closes without warning or errors |
- '));
- },
-
- penguin_advanced_test: function()
- {
- //test meta data
- testTitle = "Qt3D - Penguin Advanced";
- testBinary = "qt3d/tutorials/penguin_advanced";
- testSource = "$QTDIR/qtquick3d/tutorials/qt3d/";
- testGoal = "Test 3DS model loading and camera.";
- testPreconditions = "OpenGL/OpenGL ES required";
- testGroups = "BAT, TP1, TP2, 1.0";
- testRequirements = "NA";
- //Test Steps
- prompt(twiki('---+++ ' + testTitle + '<br><br>
- *Goal:* ' + testGoal + '<br>
- *Pre-Requisites:* ' + testPreconditions + '<br>
- *Tested Binary:* ' + testBinary + '<br>
- *Requirements:* ' + testRequirements + '<br>
- | *Step* | *Verification* |
- | Launch the penguin advanced application in tutorial (not available in binary packages) | the application starts, showing a penguin on dark background |
- | Maximize/minimize/resize the view | the view keeps size without resizing |
- | Rotate the view | the object get rotated |
- | Close the application | application closes without warning or errors |
- '));
- },
-
- robo_bounce_test: function()
- {
- //test meta data
- testTitle = "Qt3D - Robot Bounce";
- testBinary = "robo_bounce";
- testSource = "$QTDIR/qtquick3d/demos/quick3d/";
- testGoal = "Test building complex objects using models, materials, and interactions.";
- testPreconditions = "OpenGL/OpenGL ES required";
- testGroups = "BAT, TP1, TP2, 1.0";
- testRequirements = "NA";
- //Test Steps
- prompt(twiki('---+++ ' + testTitle + '<br><br>
- *Goal:* ' + testGoal + '<br>
- *Pre-Requisites:* ' + testPreconditions + '<br>
- *Tested Binary:* ' + testBinary + '<br>
- *Requirements:* ' + testRequirements + '<br>
- | *Step* | *Verification* |
- | Launch the robo bounce demo | the application starts, showing a calculator |
- | Try some simple calculation on the calculator | correct results are got |
- | Click on QML 3D icon on top left corner | the scene changes to a face of a cube, rotates |
- | Watch the animation | a scene with modern city background, a celled plain, a robot fells down and stand up, a magic cube and three icons appears on top of the scene |
- | Click on the magic cube or the cube icon | the magic cube fells down, the robot catch up and push it down the plain, then return to the center |
- | Click on the spin icon | the plain spins around |
- | Click on the specification icon | a specification appears on left |
- | Rotate the view | the objects get rotated properly |
- | Close the application | application closes without warning or errors |
- '));
- },
-
- shaders_test: function()
- {
- //test meta data
- testTitle = "Quick3D - Shaders";
- testBinary = "shaders";
- testSource = "$QTDIR/qtquick3d/examples/quick3d/";
- testGoal = "Test using GLSL shaders in QML";
- testPreconditions = "OpenGL/OpenGL ES required, GLSL Extension Required";
- testGroups = "BAT, TP1, TP2, 1.0";
- testRequirements = "NA";
- //Test Steps
- prompt(twiki('---+++ ' + testTitle + '<br><br>
- *Goal:* ' + testGoal + '<br>
- *Pre-Requisites:* ' + testPreconditions + '<br>
- *Tested Binary:* ' + testBinary + '<br>
- *Requirements:* ' + testRequirements + '<br>
- | *Step* | *Verification* |
- | Launch the shader example | a rotating teapot with Qt logo texture is shown |
- | Click on the collapsing shader button | the teapot collapses into a Qt logo icon piece repeatly |
- | Click on the animation shader button | the teapot is squeezed into a flat teapot shape repeatly |
- | Close the application | application closes without warning or errors |
- '));
- },
-
- shapes_test: function()
- {
- //test meta data
- testTitle = "Qt3D - Shapes";
- testBinary = "shapes";
- testSource = "$QTDIR/qtquick3d/demos/qt3d/";
- testGoal = "Test paints all of the basic OpenGL shapes.";
- testPreconditions = "OpenGL/OpenGL ES required";
- testGroups = "BAT, TP1, TP2, 1.0";
- testRequirements = "NA";
- //Test Steps
- prompt(twiki('---+++ ' + testTitle + '<br><br>
- *Goal:* ' + testGoal + '<br>
- *Pre-Requisites:* ' + testPreconditions + '<br>
- *Tested Binary:* ' + testBinary + '<br>
- *Requirements:* ' + testRequirements + '<br>
- | *Step* | *Verification* |
- | Lauch the shapes demo | nine basic shapes are drawn on the view port |
- | Observe the shapes | the correct names and shapes are drawn (on small screens the dots might not be big enough to see) |
- | Maximize/minimize/resize the view | the view resizes accordingly |
- | Close the application | application closes without warning or errors |
- '));
- },
-
- solarsystem_test: function()
- {
- //test meta data
- testTitle = "Qt3D - Solar System";
- testBinary = "solarsystem";
- testSource = "$QTDIR/qtquick3d/examples/qt3d/";
- testGoal = "Test shaders effects, QGLBuilder, nest tranformations and translations";
- testPreconditions = "OpenGL/OpenGL ES required, GLSL Extension Required";
- testGroups = "BAT, TP1, TP2, 1.0";
- testRequirements = "NA";
- //Test Steps
- prompt(twiki('---+++ ' + testTitle + '<br><br>
- *Goal:* ' + testGoal + '<br>
- *Pre-Requisites:* ' + testPreconditions + '<br>
- *Tested Binary:* ' + testBinary + '<br>
- *Requirements:* ' + testRequirements + '<br>
- | *Step* | *Verification* |
- | Launch the solar system example | a sun, an earth, a moon appears and moves on their tracks |
- | Observe the animation | the sun glares with shader effects, earth and moon moves correct following track |
- | Rotate the view | the objects get rotated properly |
- | Close the application | application closes without warning or errors |
- '));
- },
-
- sphere_test: function()
- {
- //test meta data
- testTitle = "Quick3D - Sphere";
- testBinary = "sphere";
- testSource = "$QTDIR/qtquick3d/examples/quick3d/";
- testGoal = "Test sphers.";
- testPreconditions = "OpenGL/OpenGL ES required";
- testGroups = "BAT, TP1, TP2, 1.0";
- testRequirements = "NA";
- //Test Steps
- prompt(twiki('---+++ ' + testTitle + '<br><br>
- *Goal:* ' + testGoal + '<br>
- *Pre-Requisites:* ' + testPreconditions + '<br>
- *Tested Binary:* ' + testBinary + '<br>
- *Requirements:* ' + testRequirements + '<br>
- | *Step* | *Verification* |
- | Launch the sphere example | ten spheres with different smootheness appear |
- | Observe the spheres | all spheres are drawn properly |
- | Rotate the view | the objects get rotated properly |
- | Close the application | application closes without warning or errors |
- '));
- },
-
- tank_test: function()
- {
- //test meta data
- testTitle = "Qt3D - Tank";
- testBinary = "tank";
- testSource = "$QTDIR/qtquick3d/examples/qt3d/";
- testGoal = "Test blending, texture, property animation and interactions.";
- testPreconditions = "OpenGL/OpenGL ES required";
- testGroups = "BAT, TP1, TP2, 1.0";
- testRequirements = "NA";
- //Test Steps
- prompt(twiki('---+++ ' + testTitle + '<br><br>
- *Goal:* ' + testGoal + '<br>
- *Pre-Requisites:* ' + testPreconditions + '<br>
- *Tested Binary:* ' + testBinary + '<br>
- *Requirements:* ' + testRequirements + '<br>
- | *Step* | *Verification* |
- | Launch the tank example | a grided plane appears with one rising transparent water tank |
- | Double click on the grided plane | a new water tank with different color appears and grow |
- | Rotate the view | the objects get rotated properly |
- | Close the application | application closes without warning or errors |
- '));
- },
-
- teapot_test: function()
- {
- //test meta data
- testTitle = "Qt3D - Teapot";
- testBinary = "teapot";
- testSource = "$QTDIR/qtquick3d/examples/qt3d/";
- testGoal = "Test drawing a basic object in Qt3D.";
- testPreconditions = "OpenGL/OpenGL ES required";
- testGroups = "BAT, TP1, TP2, 1.0";
- testRequirements = "NA";
- //Test Steps
- prompt(twiki('---+++ ' + testTitle + '<br><br>
- *Goal:* ' + testGoal + '<br>
- *Pre-Requisites:* ' + testPreconditions + '<br>
- *Tested Binary:* ' + testBinary + '<br>
- *Requirements:* ' + testRequirements + '<br>
- | *Step* | *Verification* |
- | Launch the teapot example | the application starts and shows a gray teapot |
- | Use the mouse or touch pad to rotate the view | the view rotates fine, user can view the teapot from all angles |
- | Maximize/minimize/resize the view | the teapot maximizes/minimizes/resize with the viewport, shows fine, no crash |
- | Close the application | application closes without warning or errors |
- '));
- },
-
- teapot_bounce_qml_test: function()
- {
- //test meta data
- testTitle = "Quick3D - Teapot Bounce";
- testBinary = "teapot_bounce_qml";
- testSource = "$QTDIR/qtquick3d/demos/quick3d/";
- testGoal = "Test QML integration.";
- testPreconditions = "OpenGL/OpenGL ES required";
- testGroups = "BAT, TP1, TP2, 1.0";
- testRequirements = "NA";
- //Test Steps
- prompt(twiki('---+++ ' + testTitle + '<br><br>
- *Goal:* ' + testGoal + '<br>
- *Pre-Requisites:* ' + testPreconditions + '<br>
- *Tested Binary:* ' + testBinary + '<br>
- *Requirements:* ' + testRequirements + '<br>
- | *Step* | *Verification* |
- | Launch the teapot bounce qml example | the application starts and shows a gray teapot bouncing repeatly |
- | Use the mouse or touch pad to rotate the view | the view rotates fine, user can view the teapot from all angles |
- | Maximize/minimize/resize the view | the teapot maximizes/minimizes/resize with the viewport, shows fine, no crash |
- | Close the application | application closes without warning or errors |
- '));
- },
-
- teapot_qml_test: function()
- {
- //test meta data
- testTitle = "Quick3D - Teapot";
- testBinary = "teapot_qml";
- testSource = "$QTDIR/qtquick3d/demos/quick3d/";
- testGoal = "Test drawing a basic object in Quick3D.";
- testPreconditions = "OpenGL/OpenGL ES required";
- testGroups = "BAT, TP1, TP2, 1.0";
- testRequirements = "NA";
- //Test Steps
- prompt(twiki('---+++ ' + testTitle + '<br><br>
- *Goal:* ' + testGoal + '<br>
- *Pre-Requisites:* ' + testPreconditions + '<br>
- *Tested Binary:* ' + testBinary + '<br>
- *Requirements:* ' + testRequirements + '<br>
- | *Step* | *Verification* |
- | Launch the teapot qml example | the application starts and shows a gray teapot |
- | Use the mouse or touch pad to rotate the view | the view rotates fine, user can view the teapot from all angles |
- | Maximize/minimize/resize the view | the teapot maximizes/minimizes/resize with the viewport, shows fine, no crash |
- | Close the application | application closes without warning or errors |
- '));
- },
-
- teaservice_test: function()
- {
- //test meta data
- testTitle = "Qt3D - Tea Service";
- testBinary = "teaservice";
- testSource = "$QTDIR/qtquick3d/demos/quick3d/";
- testGoal = "Test complex scenes and object picking.";
- testPreconditions = "OpenGL/OpenGL ES required";
- testGroups = "BAT, TP1, TP2, 1.0";
- testRequirements = "NA";
- //Test Steps
- prompt(twiki('---+++ ' + testTitle + '<br><br>
- *Goal:* ' + testGoal + '<br>
- *Pre-Requisites:* ' + testPreconditions + '<br>
- *Tested Binary:* ' + testBinary + '<br>
- *Requirements:* ' + testRequirements + '<br>
- | *Step* | *Verification* |
- | Launch the tea service C++ example | the application starts and shows a set of tea stuff |
- | Move mouse over the teapot and cups | the material/reflection of object changes |
- | Maximize/minimize/resize the view | the teapot maximizes/minimizes/resize with the viewport, shows fine, no crash |
- | Close the application | application closes without warning or errors |
- '));
- },
-
- tea_service_test: function()
- {
- //test meta data
- testTitle = "Quick3D - Tea Service";
- testBinary = "tea_service";
- testSource = "$QTDIR/qtquick3d/demos/quick3d/";
- testGoal = "Test complex scenes and object picking with QML.";
- testPreconditions = "OpenGL/OpenGL ES required";
- testGroups = "BAT, TP1, TP2, 1.0";
- testRequirements = "NA";
- //Test Steps
- prompt(twiki('---+++ ' + testTitle + '<br><br>
- *Goal:* ' + testGoal + '<br>
- *Pre-Requisites:* ' + testPreconditions + '<br>
- *Tested Binary:* ' + testBinary + '<br>
- *Requirements:* ' + testRequirements + '<br>
- | *Step* | *Verification* |
- | Launch the tea service qml example | the application starts and shows a set of tea stuff |
- | Click on the tepot and cups | the object clicked will bounce up in response |
- | Maximize/minimize/resize the view | the teapot does not resize with the viewport, shows fine, no crash |
- | Close the application | application closes without warning or errors |
- '));
- },
-
- tst_animations_test: function()
- {
- //test meta data
- testTitle = "Qt3D - Animation Tests";
- testBinary = "tst_animations";
- testSource = "$QTDIR/qtquick3d/tests/manual/";
- testGoal = "Test basic animations.";
- testPreconditions = "OpenGL/OpenGL ES required";
- testGroups = "BAT, TP1, TP2, 1.0";
- testRequirements = "NA";
- //Test Steps
- prompt(twiki('---+++ ' + testTitle + '<br><br>
- *Goal:* ' + testGoal + '<br>
- *Pre-Requisites:* ' + testPreconditions + '<br>
- *Tested Binary:* ' + testBinary + '<br>
- *Requirements:* ' + testRequirements + '<br>
- | *Step* | *Verification* |
- | observe the first scene | the cube rotates to the left as described |
- | Launch the tst_animation test | four test scenes are displayed with animations |
- | observe the second scene | the cube rotates to the left as described |
- | observe the third scene | the cube rotates to the left once (not continuesly, so start the application and observe immediately) |
- | observe the fourth scene | the cube rotates to the left once with spring effect (not continuesly, so start the application and observe immediately) |
- | Close the application | application closes without warning or errors |
- '));
- },
-
- tst_displaymodel_test: function()
- {
- //test meta data
- testTitle = "Qt3D - Display Model Tests";
- testBinary = "tst_displaymodel";
- testSource = "$QTDIR/qtquick3d/tests/manual/";
- testGoal = "Test building/loading model and display.";
- testPreconditions = "OpenGL/OpenGL ES required";
- testGroups = "BAT, TP1, TP2, 1.0";
- testRequirements = "NA";
- //Test Steps
- prompt(twiki('---+++ ' + testTitle + '<br><br>
- *Goal:* ' + testGoal + '<br>
- *Pre-Requisites:* ' + testPreconditions + '<br>
- *Tested Binary:* ' + testBinary + '<br>
- *Requirements:* ' + testRequirements + '<br>
- | *Step* | *Verification* |
- | Launch the tst_displaymodel test | nine models should be loaded and displayed |
- | observe the nine scenes | the correct model is displayed as described |
- | Close the application | application closes without warning or errors |
- '));
- },
-
- tst_model3ds_test: function()
- {
- //test meta data
- testTitle = "Qt3D - 3DS Model Tests";
- testBinary = "tst_model3ds";
- testSource = "$QTDIR/qtquick3d/tests/manual/";
- testGoal = "Test loading 3DS model and display.";
- testPreconditions = "OpenGL/OpenGL ES required";
- testGroups = "BAT, TP1, TP2, 1.0";
- testRequirements = "NA";
- //Test Steps
- prompt(twiki('---+++ ' + testTitle + '<br><br>
- *Goal:* ' + testGoal + '<br>
- *Pre-Requisites:* ' + testPreconditions + '<br>
- *Tested Binary:* ' + testBinary + '<br>
- *Requirements:* ' + testRequirements + '<br>
- | *Step* | *Verification* |
- | Launch the tst_model3ds test | four scenes are created displayiing one 3ds model each |
- | Observe the four scenes | the models get properly drawn as described |
- | Close the application | application closes without warning or errors |
- | Rotate the models with mouse/tap | the models rotates fine |
- '));
- },
-
- tst_navigation1_test: function()
- {
- //test meta data
- testTitle = "Qt3D - Navigation";
- testBinary = "tst_navigation1";
- testSource = "$QTDIR/qtquick3d/tests/manual/";
- testGoal = "Test rotating/zooming model.";
- testPreconditions = "OpenGL/OpenGL ES required";
- testGroups = "BAT, TP1, TP2, 1.0";
- testRequirements = "NA";
- //Test Steps
- prompt(twiki('---+++ ' + testTitle + '<br><br>
- *Goal:* ' + testGoal + '<br>
- *Pre-Requisites:* ' + testPreconditions + '<br>
- *Tested Binary:* ' + testBinary + '<br>
- *Requirements:* ' + testRequirements + '<br>
- | *Step* | *Verification* |
- | Launch the tst_navigation1 test | two scenes are created with a dark gray monkey head in each |
- | Rotate the monkey heads with mouse/tap | the models rotates properly |
- | Zoom in using mouse wheel/multi-touch | the model on the left get culled when zoomed in to a certain level, the model on the right does not, as described |
- | Close the application | application closes without warning or errors |
- '));
- },
-
- tst_qrc_test: function()
- {
- //test meta data
- testTitle = "Qt3D - QRC resource Tests";
- testBinary = "tst_qrc";
- testSource = "$QTDIR/qtquick3d/tests/manual/";
- testGoal = "Test loading resources from QRC files.";
- testPreconditions = "OpenGL/OpenGL ES required";
- testGroups = "BAT, TP1, TP2, 1.0";
- testRequirements = "NA";
- //Test Steps
- prompt(twiki('---+++ ' + testTitle + '<br><br>
- *Goal:* ' + testGoal + '<br>
- *Pre-Requisites:* ' + testPreconditions + '<br>
- *Tested Binary:* ' + testBinary + '<br>
- *Requirements:* ' + testRequirements + '<br>
- | *Step* | *Verification* |
- | Launch the tst_qrc test | two scenes are created with a textured cube in each |
- | Observe the cubes | they are identical |
- | Rotate the two cubes | they are fully textured with Qt logo and identical |
- | Close the application | application closes without warning or errors |
- '));
- },
-
- tst_rotation_test: function()
- {
- //test meta data
- testTitle = "Qt3D - Rotation Tests";
- testBinary = "tst_rotation";
- testSource = "$QTDIR/qtquick3d/tests/manual/";
- testGoal = "Test rotating objects.";
- testPreconditions = "OpenGL/OpenGL ES required";
- testGroups = "BAT, TP1, TP2, 1.0";
- testRequirements = "NA";
- //Test Steps
- prompt(twiki('---+++ ' + testTitle + '<br><br>
- *Goal:* ' + testGoal + '<br>
- *Pre-Requisites:* ' + testPreconditions + '<br>
- *Tested Binary:* ' + testBinary + '<br>
- *Requirements:* ' + testRequirements + '<br>
- | *Step* | *Verification* |
- | Launch the tst_rotation test | nine scenes are created with rotating cube animations |
- | Observe each scene | the cubes animates as described |
- | Close the application | application closes without warning or errors |
- '));
- },
-
- tst_scaling_test: function()
- {
- //test meta data
- testTitle = "Qt3D - Scaling Tests";
- testBinary = "tst_scaling";
- testSource = "$QTDIR/qtquick3d/tests/manual/";
- testGoal = "Testing scaling objects.";
- testPreconditions = "OpenGL/OpenGL ES required";
- testGroups = "BAT, TP1, TP2, 1.0";
- testRequirements = "NA";
- //Test Steps
- prompt(twiki('---+++ ' + testTitle + '<br><br>
- *Goal:* ' + testGoal + '<br>
- *Pre-Requisites:* ' + testPreconditions + '<br>
- *Tested Binary:* ' + testBinary + '<br>
- *Requirements:* ' + testRequirements + '<br>
- | *Step* | *Verification* |
- | Launch the tst_scaling test | nine scenes are created with scaling teapot animations |
- | Observe each scene | the teapots animates as described |
- | Close the application | application closes without warning or errors |
- '));
- },
-
- tst_submesh_test: function()
- {
- //test meta data
- testTitle = "Qt3D - Submesh Tests";
- testBinary = "tst_submesh";
- testSource = "$QTDIR/qtquick3d/tests/manual/";
- testGoal = "Testing operating sub-meshes in object.";
- testPreconditions = "OpenGL/OpenGL ES required";
- testGroups = "BAT, TP1, TP2, 1.0";
- testRequirements = "NA";
- //Test Steps
- prompt(twiki('---+++ ' + testTitle + '<br><br>
- *Goal:* ' + testGoal + '<br>
- *Pre-Requisites:* ' + testPreconditions + '<br>
- *Tested Binary:* ' + testBinary + '<br>
- *Requirements:* ' + testRequirements + '<br>
- | *Step* | *Verification* |
- | Launch the tst_submesh test | a scene of animation is created |
- | Observe the scene | the sub meshes move as described |
- | Close the application | application closes without warning or errors |
- '));
- },
-
- tst_transformations_test: function()
- {
- //test meta data
- testTitle = "Qt3D - Transformation Tests";
- testBinary = "tst_transformations";
- testSource = "$QTDIR/qtquick3d/tests/manual/";
- testGoal = "Testing transformations on objects.";
- testPreconditions = "OpenGL/OpenGL ES required";
- testGroups = "BAT, TP1, TP2, 1.0";
- testRequirements = "NA";
- //Test Steps
- prompt(twiki('---+++ ' + testTitle + '<br><br>
- *Goal:* ' + testGoal + '<br>
- *Pre-Requisites:* ' + testPreconditions + '<br>
- *Tested Binary:* ' + testBinary + '<br>
- *Requirements:* ' + testRequirements + '<br>
- | *Step* | *Verification* |
- | Launch the tst_transformation test | two scenes are created with moving teapot animations |
- | Observe each scene | the teapots animates as described |
- | Close the application | application closes without warning or errors |
- '));
- },
-
- tst_translation_test: function()
- {
- //test meta data
- testTitle = "Qt3D - Translation Tests";
- testBinary = "tst_translation";
- testSource = "$QTDIR/qtquick3d/tests/manual/";
- testGoal = "Testing object translation.";
- testPreconditions = "OpenGL/OpenGL ES required";
- testGroups = "BAT, TP1, TP2, 1.0";
- testRequirements = "NA";
- //Test Steps
- prompt(twiki('---+++ ' + testTitle + '<br><br>
- *Goal:* ' + testGoal + '<br>
- *Pre-Requisites:* ' + testPreconditions + '<br>
- *Tested Binary:* ' + testBinary + '<br>
- *Requirements:* ' + testRequirements + '<br>
- | *Step* | *Verification* |
- | Launch the tst_translation test | ten scenes are created with moving teapot animations |
- | Observe each scene | the teapots animates as described |
- | Close the application | application closes without warning or errors |
- '));
- }
-
-}
diff --git a/tests/tests.pro b/tests/tests.pro
deleted file mode 100644
index 6f7cec58..00000000
--- a/tests/tests.pro
+++ /dev/null
@@ -1,8 +0,0 @@
-TEMPLATE = subdirs
-
-# load this since its needed to turn qtc_harmattan->maemo
-include(../pkg.pri)
-
-# we dont package unit tests for maemo
-!maemo: SUBDIRS = manual
-!package: SUBDIRS += auto benchmarks
diff --git a/tutorials/qt3d/cube1/cube1.pro b/tutorials/qt3d/cube1/cube1.pro
deleted file mode 100644
index 4b2ff551..00000000
--- a/tutorials/qt3d/cube1/cube1.pro
+++ /dev/null
@@ -1,17 +0,0 @@
-TEMPLATE = app
-TARGET = cube1
-CONFIG += qt warn_on qt3d
-SOURCES = cubeview.cpp main.cpp
-HEADERS = cubeview.h
-DESTDIR = ../../../bin/qt3d/tutorials
-
-symbian {
- vendorinfo = \
- "%{\"Nokia\"}" \
- ":\"Nokia\""
-
- my_deployment.pkg_prerules = vendorinfo
- DEPLOYMENT += my_deployment
-
- ICON = ../qt3d.svg
-}
diff --git a/tutorials/qt3d/cube1/cubeview.cpp b/tutorials/qt3d/cube1/cubeview.cpp
deleted file mode 100644
index 51e074f6..00000000
--- a/tutorials/qt3d/cube1/cubeview.cpp
+++ /dev/null
@@ -1,67 +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$
-**
-****************************************************************************/
-
-#include "cubeview.h"
-#include "qglbuilder.h"
-#include "qglcube.h"
-
-//! [1]
-CubeView::CubeView(QWidget *parent)
- : QGLView(parent)
-{
- QGLBuilder builder;
- builder << QGL::Faceted;
- builder << QGLCube();
-
- cube = builder.finalizedSceneNode();
-}
-//! [1]
-
-CubeView::~CubeView()
-{
- delete cube;
-}
-
-//! [2]
-void CubeView::paintGL(QGLPainter *painter)
-{
- cube->draw(painter);
-}
-//! [2]
diff --git a/tutorials/qt3d/cube1/cubeview.h b/tutorials/qt3d/cube1/cubeview.h
deleted file mode 100644
index de1156bc..00000000
--- a/tutorials/qt3d/cube1/cubeview.h
+++ /dev/null
@@ -1,66 +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$
-**
-****************************************************************************/
-
-#ifndef CUBEVIEW_H
-#define CUBEVIEW_H
-
-#include "qglview.h"
-
-QT_BEGIN_NAMESPACE
-class QGLSceneNode;
-QT_END_NAMESPACE
-
-//! [1]
-class CubeView : public QGLView
-{
- Q_OBJECT
-public:
- CubeView(QWidget *parent = 0);
- ~CubeView();
-
-protected:
- void paintGL(QGLPainter *painter);
-
-private:
- QGLSceneNode *cube;
-};
-//! [1]
-
-#endif
diff --git a/tutorials/qt3d/cube1/main.cpp b/tutorials/qt3d/cube1/main.cpp
deleted file mode 100644
index 28fc9bb1..00000000
--- a/tutorials/qt3d/cube1/main.cpp
+++ /dev/null
@@ -1,50 +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$
-**
-****************************************************************************/
-
-#include <QApplication>
-#include "cubeview.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
- CubeView view;
- view.show();
- return app.exec();
-}
diff --git a/tutorials/qt3d/cube2/cube2.pro b/tutorials/qt3d/cube2/cube2.pro
deleted file mode 100644
index 420779e9..00000000
--- a/tutorials/qt3d/cube2/cube2.pro
+++ /dev/null
@@ -1,17 +0,0 @@
-TEMPLATE = app
-TARGET = cube2
-CONFIG += qt warn_on qt3d
-SOURCES = cubeview.cpp main.cpp
-HEADERS = cubeview.h
-DESTDIR = ../../../bin/qt3d/tutorials
-
-symbian {
- vendorinfo = \
- "%{\"Nokia\"}" \
- ":\"Nokia\""
-
- my_deployment.pkg_prerules = vendorinfo
- DEPLOYMENT += my_deployment
-
- ICON = ../qt3d.svg
-}
diff --git a/tutorials/qt3d/cube2/cubeview.cpp b/tutorials/qt3d/cube2/cubeview.cpp
deleted file mode 100644
index 1dca459a..00000000
--- a/tutorials/qt3d/cube2/cubeview.cpp
+++ /dev/null
@@ -1,66 +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$
-**
-****************************************************************************/
-
-#include "cubeview.h"
-#include "qglbuilder.h"
-#include "qglcube.h"
-
-CubeView::CubeView(QWidget *parent)
- : QGLView(parent)
-{
- QGLBuilder builder;
- builder << QGL::Faceted;
- builder << QGLCube();
-
- cube = builder.finalizedSceneNode();
-}
-
-CubeView::~CubeView()
-{
- delete cube;
-}
-
-//! [2]
-void CubeView::paintGL(QGLPainter *painter)
-{
- painter->modelViewMatrix().rotate(45.0f, 1.0f, 1.0f, 1.0f);
- cube->draw(painter);
-}
-//! [2]
diff --git a/tutorials/qt3d/cube2/cubeview.h b/tutorials/qt3d/cube2/cubeview.h
deleted file mode 100644
index de1156bc..00000000
--- a/tutorials/qt3d/cube2/cubeview.h
+++ /dev/null
@@ -1,66 +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$
-**
-****************************************************************************/
-
-#ifndef CUBEVIEW_H
-#define CUBEVIEW_H
-
-#include "qglview.h"
-
-QT_BEGIN_NAMESPACE
-class QGLSceneNode;
-QT_END_NAMESPACE
-
-//! [1]
-class CubeView : public QGLView
-{
- Q_OBJECT
-public:
- CubeView(QWidget *parent = 0);
- ~CubeView();
-
-protected:
- void paintGL(QGLPainter *painter);
-
-private:
- QGLSceneNode *cube;
-};
-//! [1]
-
-#endif
diff --git a/tutorials/qt3d/cube2/main.cpp b/tutorials/qt3d/cube2/main.cpp
deleted file mode 100644
index 28fc9bb1..00000000
--- a/tutorials/qt3d/cube2/main.cpp
+++ /dev/null
@@ -1,50 +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$
-**
-****************************************************************************/
-
-#include <QApplication>
-#include "cubeview.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
- CubeView view;
- view.show();
- return app.exec();
-}
diff --git a/tutorials/qt3d/cube3/cube3.pro b/tutorials/qt3d/cube3/cube3.pro
deleted file mode 100644
index 8045b690..00000000
--- a/tutorials/qt3d/cube3/cube3.pro
+++ /dev/null
@@ -1,17 +0,0 @@
-TEMPLATE = app
-TARGET = cube3
-CONFIG += qt warn_on qt3d
-SOURCES = cubeview.cpp main.cpp
-HEADERS = cubeview.h
-DESTDIR = ../../../bin/qt3d/tutorials
-
-symbian {
- vendorinfo = \
- "%{\"Nokia\"}" \
- ":\"Nokia\""
-
- my_deployment.pkg_prerules = vendorinfo
- DEPLOYMENT += my_deployment
-
- ICON = ../qt3d.svg
-}
diff --git a/tutorials/qt3d/cube3/cubeview.cpp b/tutorials/qt3d/cube3/cubeview.cpp
deleted file mode 100644
index 80c3e0f1..00000000
--- a/tutorials/qt3d/cube3/cubeview.cpp
+++ /dev/null
@@ -1,69 +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$
-**
-****************************************************************************/
-
-#include "cubeview.h"
-#include "qglbuilder.h"
-#include "qglcube.h"
-
-CubeView::CubeView(QWidget *parent)
- : QGLView(parent)
-{
- QGLBuilder builder;
- builder << QGL::Faceted;
- builder << QGLCube();
-
- cube = builder.finalizedSceneNode();
-}
-
-CubeView::~CubeView()
-{
- delete cube;
-}
-
-//! [2]
-void CubeView::paintGL(QGLPainter *painter)
-{
- painter->setStandardEffect(QGL::LitMaterial);
- painter->setFaceColor(QGL::AllFaces, QColor(170, 202, 0));
-
- painter->modelViewMatrix().rotate(45.0f, 1.0f, 1.0f, 1.0f);
- cube->draw(painter);
-}
-//! [2]
diff --git a/tutorials/qt3d/cube3/cubeview.h b/tutorials/qt3d/cube3/cubeview.h
deleted file mode 100644
index de1156bc..00000000
--- a/tutorials/qt3d/cube3/cubeview.h
+++ /dev/null
@@ -1,66 +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$
-**
-****************************************************************************/
-
-#ifndef CUBEVIEW_H
-#define CUBEVIEW_H
-
-#include "qglview.h"
-
-QT_BEGIN_NAMESPACE
-class QGLSceneNode;
-QT_END_NAMESPACE
-
-//! [1]
-class CubeView : public QGLView
-{
- Q_OBJECT
-public:
- CubeView(QWidget *parent = 0);
- ~CubeView();
-
-protected:
- void paintGL(QGLPainter *painter);
-
-private:
- QGLSceneNode *cube;
-};
-//! [1]
-
-#endif
diff --git a/tutorials/qt3d/cube3/main.cpp b/tutorials/qt3d/cube3/main.cpp
deleted file mode 100644
index 28fc9bb1..00000000
--- a/tutorials/qt3d/cube3/main.cpp
+++ /dev/null
@@ -1,50 +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$
-**
-****************************************************************************/
-
-#include <QApplication>
-#include "cubeview.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
- CubeView view;
- view.show();
- return app.exec();
-}
diff --git a/tutorials/qt3d/cube4/cube.qml b/tutorials/qt3d/cube4/cube.qml
deleted file mode 100644
index d4ba6d99..00000000
--- a/tutorials/qt3d/cube4/cube.qml
+++ /dev/null
@@ -1,61 +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 Qt 4.7
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-
-Viewport {
- width: 640; height: 480
-
- Cube {
- transform: Rotation3D {
- angle: 45; axis: Qt.vector3d(1, 1, 1)
- }
-
- effect: Effect {
- color: "#aaca00";
- texture: "qtlogo.png"
- decal: true
- }
- }
-}
-//! [1]
diff --git a/tutorials/qt3d/cube4/cube.qrc b/tutorials/qt3d/cube4/cube.qrc
deleted file mode 100644
index 70f5024d..00000000
--- a/tutorials/qt3d/cube4/cube.qrc
+++ /dev/null
@@ -1,5 +0,0 @@
-<!DOCTYPE RCC><RCC version="1.0">
-<qresource>
- <file>qtlogo.png</file>
-</qresource>
-</RCC>
diff --git a/tutorials/qt3d/cube4/cube4.pro b/tutorials/qt3d/cube4/cube4.pro
deleted file mode 100644
index ada9c329..00000000
--- a/tutorials/qt3d/cube4/cube4.pro
+++ /dev/null
@@ -1,18 +0,0 @@
-TEMPLATE = app
-TARGET = cube4
-CONFIG += qt warn_on qt3d
-SOURCES = cubeview.cpp main.cpp
-HEADERS = cubeview.h
-RESOURCES = cube.qrc
-DESTDIR = ../../../bin/qt3d/tutorials
-
-symbian {
- vendorinfo = \
- "%{\"Nokia\"}" \
- ":\"Nokia\""
-
- my_deployment.pkg_prerules = vendorinfo
- DEPLOYMENT += my_deployment
-
- ICON = ../qt3d.svg
-}
diff --git a/tutorials/qt3d/cube4/cubeview.cpp b/tutorials/qt3d/cube4/cubeview.cpp
deleted file mode 100644
index e3045292..00000000
--- a/tutorials/qt3d/cube4/cubeview.cpp
+++ /dev/null
@@ -1,76 +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$
-**
-****************************************************************************/
-
-#include "cubeview.h"
-#include "qglbuilder.h"
-#include "qglcube.h"
-
-//! [1]
-CubeView::CubeView(QWidget *parent)
- : QGLView(parent)
-{
-//! [1]
- QGLBuilder builder;
- builder << QGL::Faceted;
- builder << QGLCube();
-
- cube = builder.finalizedSceneNode();
-
-//! [2]
- logo.setImage(QImage(QLatin1String(":/qtlogo.png")));
-}
-//! [2]
-
-CubeView::~CubeView()
-{
- delete cube;
-}
-
-//! [3]
-void CubeView::paintGL(QGLPainter *painter)
-{
- painter->setStandardEffect(QGL::LitDecalTexture2D);
- painter->setFaceColor(QGL::AllFaces, QColor(170, 202, 0));
- logo.bind();
-
- painter->modelViewMatrix().rotate(45.0f, 1.0f, 1.0f, 1.0f);
- cube->draw(painter);
-}
-//! [3]
diff --git a/tutorials/qt3d/cube4/cubeview.h b/tutorials/qt3d/cube4/cubeview.h
deleted file mode 100644
index af8d336d..00000000
--- a/tutorials/qt3d/cube4/cubeview.h
+++ /dev/null
@@ -1,70 +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$
-**
-****************************************************************************/
-
-#ifndef CUBEVIEW_H
-#define CUBEVIEW_H
-
-#include "qglview.h"
-#include "qgltexture2d.h"
-
-QT_BEGIN_NAMESPACE
-class QGLSceneNode;
-QT_END_NAMESPACE
-
-//! [1]
-class CubeView : public QGLView
-{
-//! [1]
- Q_OBJECT
-public:
- CubeView(QWidget *parent = 0);
- ~CubeView();
-
-protected:
- void paintGL(QGLPainter *painter);
-
-//! [2]
-private:
- QGLSceneNode *cube;
- QGLTexture2D logo;
-};
-//! [2]
-
-#endif
diff --git a/tutorials/qt3d/cube4/main.cpp b/tutorials/qt3d/cube4/main.cpp
deleted file mode 100644
index 28fc9bb1..00000000
--- a/tutorials/qt3d/cube4/main.cpp
+++ /dev/null
@@ -1,50 +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$
-**
-****************************************************************************/
-
-#include <QApplication>
-#include "cubeview.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
- CubeView view;
- view.show();
- return app.exec();
-}
diff --git a/tutorials/qt3d/cube4/qtlogo.png b/tutorials/qt3d/cube4/qtlogo.png
deleted file mode 100644
index 7d3e97eb..00000000
--- a/tutorials/qt3d/cube4/qtlogo.png
+++ /dev/null
Binary files differ
diff --git a/tutorials/qt3d/penguin/main.cpp b/tutorials/qt3d/penguin/main.cpp
deleted file mode 100644
index e5c995db..00000000
--- a/tutorials/qt3d/penguin/main.cpp
+++ /dev/null
@@ -1,51 +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$
-**
-****************************************************************************/
-
-#include <QApplication>
-
-#include "modelview.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
- ModelView view;
- view.show();
- return app.exec();
-}
diff --git a/tutorials/qt3d/penguin/model.qrc b/tutorials/qt3d/penguin/model.qrc
deleted file mode 100644
index 2c330de0..00000000
--- a/tutorials/qt3d/penguin/model.qrc
+++ /dev/null
@@ -1,5 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>penguin.3ds</file>
- </qresource>
-</RCC>
diff --git a/tutorials/qt3d/penguin/modelview.cpp b/tutorials/qt3d/penguin/modelview.cpp
deleted file mode 100644
index 3ba6b735..00000000
--- a/tutorials/qt3d/penguin/modelview.cpp
+++ /dev/null
@@ -1,64 +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$
-**
-****************************************************************************/
-
-#include "modelview.h"
-#include "qglabstractscene.h"
-
-ModelView::~ModelView()
-{
- delete m_scene;
-}
-
-//! [initialize]
-void ModelView::initializeGL(QGLPainter *painter)
-{
- Q_UNUSED(painter);
-
- m_scene = QGLAbstractScene::loadScene(QLatin1String(":/penguin.3ds"));
-}
-//! [initialize]
-
-//! [paint]
-void ModelView::paintGL(QGLPainter *painter)
-{
- QGLSceneNode *o = m_scene->mainNode();
- o->draw(painter);
-}
-//! [paint]
diff --git a/tutorials/qt3d/penguin/modelview.h b/tutorials/qt3d/penguin/modelview.h
deleted file mode 100644
index cb6b87af..00000000
--- a/tutorials/qt3d/penguin/modelview.h
+++ /dev/null
@@ -1,68 +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$
-**
-****************************************************************************/
-
-#ifndef MODELVIEW_H
-#define MODELVIEW_H
-
-//! [class-defn]
-#include "qglview.h"
-
-QT_BEGIN_NAMESPACE
-class QGLAbstractScene;
-class QGLSceneNode;
-QT_END_NAMESPACE
-
-class ModelView : public QGLView
-{
- Q_OBJECT
-public:
- ModelView(QWidget *parent = 0) : QGLView(parent) {}
- ~ModelView();
-
-protected:
- void initializeGL(QGLPainter *painter);
- void paintGL(QGLPainter *painter);
-
-private:
- QGLAbstractScene *m_scene;
-};
-//! [class-defn]
-
-#endif
diff --git a/tutorials/qt3d/penguin/penguin.3ds b/tutorials/qt3d/penguin/penguin.3ds
deleted file mode 100644
index 26c09ac0..00000000
--- a/tutorials/qt3d/penguin/penguin.3ds
+++ /dev/null
Binary files differ
diff --git a/tutorials/qt3d/penguin/penguin.pro b/tutorials/qt3d/penguin/penguin.pro
deleted file mode 100644
index 6640c796..00000000
--- a/tutorials/qt3d/penguin/penguin.pro
+++ /dev/null
@@ -1,21 +0,0 @@
-TEMPLATE = app
-TARGET = penguin
-CONFIG += qt warn_on qt3d
-SOURCES = modelview.cpp \
- main.cpp
-HEADERS = modelview.h
-RESOURCES = model.qrc
-DESTDIR = ../../../bin/qt3d/tutorials
-
-symbian {
- vendorinfo = \
- "%{\"Nokia\"}" \
- ":\"Nokia\""
-
- my_deployment.pkg_prerules = vendorinfo
- DEPLOYMENT += my_deployment
-
- ICON = ../qt3d.svg
-
- TARGET.EPOCHEAPSIZE = 0x40000 0x4000000
-}
diff --git a/tutorials/qt3d/penguin_advanced/main.cpp b/tutorials/qt3d/penguin_advanced/main.cpp
deleted file mode 100644
index e5c995db..00000000
--- a/tutorials/qt3d/penguin_advanced/main.cpp
+++ /dev/null
@@ -1,51 +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$
-**
-****************************************************************************/
-
-#include <QApplication>
-
-#include "modelview.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
- ModelView view;
- view.show();
- return app.exec();
-}
diff --git a/tutorials/qt3d/penguin_advanced/model_advanced.qrc b/tutorials/qt3d/penguin_advanced/model_advanced.qrc
deleted file mode 100644
index 2c330de0..00000000
--- a/tutorials/qt3d/penguin_advanced/model_advanced.qrc
+++ /dev/null
@@ -1,5 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>penguin.3ds</file>
- </qresource>
-</RCC>
diff --git a/tutorials/qt3d/penguin_advanced/modelview.cpp b/tutorials/qt3d/penguin_advanced/modelview.cpp
deleted file mode 100644
index a7249533..00000000
--- a/tutorials/qt3d/penguin_advanced/modelview.cpp
+++ /dev/null
@@ -1,76 +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$
-**
-****************************************************************************/
-
-#include "modelview.h"
-#include "qglabstractscene.h"
-#include "qglscenenode.h"
-
-ModelView::ModelView(QWidget *parent)
- : QGLView(parent)
- , m_scene(0)
- , m_main(0)
-{
-}
-
-//! [initialize]
-void ModelView::initializeGL(QGLPainter *painter)
-{
- Q_UNUSED(painter);
- camera()->setEye(QVector3D(0.0f, 2.0f, 25.0f));
-
- m_scene = QGLAbstractScene::loadScene(QLatin1String(":/penguin.3ds"));
- if (m_scene)
- m_main = m_scene->mainNode();
-
- QQuaternion xt = QQuaternion::fromAxisAndAngle(1.0f, 0.0f, 0.0f, -90.0f);
- QQuaternion yt = QQuaternion::fromAxisAndAngle(0.0f, 1.0f, 0.0f, 30.0f);
- m_pose = yt * xt;
-}
-//! [initialize]
-
-//! [paint]
-void ModelView::paintGL(QGLPainter *painter)
-{
- painter->modelViewMatrix().rotate(m_pose);
-
- if (m_main)
- m_main->draw(painter);
-}
-//! [paint]
diff --git a/tutorials/qt3d/penguin_advanced/modelview.h b/tutorials/qt3d/penguin_advanced/modelview.h
deleted file mode 100644
index 3ec5c955..00000000
--- a/tutorials/qt3d/penguin_advanced/modelview.h
+++ /dev/null
@@ -1,68 +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$
-**
-****************************************************************************/
-
-#ifndef MODELVIEW_H
-#define MODELVIEW_H
-
-#include "qglview.h"
-
-QT_BEGIN_NAMESPACE
-class QGLAbstractScene;
-class QGLSceneNode;
-QT_END_NAMESPACE
-
-class ModelView : public QGLView
-{
- Q_OBJECT
-public:
- ModelView(QWidget *parent = 0);
- ~ModelView() {}
-
-protected:
- void initializeGL(QGLPainter *painter);
- void paintGL(QGLPainter *painter);
-
-private:
- QGLAbstractScene *m_scene;
- QGLSceneNode *m_main;
- QQuaternion m_pose;
-};
-
-#endif
diff --git a/tutorials/qt3d/penguin_advanced/penguin.3ds b/tutorials/qt3d/penguin_advanced/penguin.3ds
deleted file mode 100644
index 26c09ac0..00000000
--- a/tutorials/qt3d/penguin_advanced/penguin.3ds
+++ /dev/null
Binary files differ
diff --git a/tutorials/qt3d/penguin_advanced/penguin_advanced.pro b/tutorials/qt3d/penguin_advanced/penguin_advanced.pro
deleted file mode 100644
index 9885dd87..00000000
--- a/tutorials/qt3d/penguin_advanced/penguin_advanced.pro
+++ /dev/null
@@ -1,21 +0,0 @@
-TEMPLATE = app
-TARGET = penguin_advanced
-DESTDIR = ../../../bin/qt3d/tutorials
-CONFIG += qt warn_on qt3d
-SOURCES = modelview.cpp \
- main.cpp
-HEADERS = modelview.h
-RESOURCES = model_advanced.qrc
-
-symbian {
- vendorinfo = \
- "%{\"Nokia\"}" \
- ":\"Nokia\""
-
- my_deployment.pkg_prerules = vendorinfo
- DEPLOYMENT += my_deployment
-
- ICON = ../qt3d.svg
-
- TARGET.EPOCHEAPSIZE = 0x40000 0x4000000
-}
diff --git a/tutorials/qt3d/qt3d.pro b/tutorials/qt3d/qt3d.pro
deleted file mode 100644
index 8c3fdf36..00000000
--- a/tutorials/qt3d/qt3d.pro
+++ /dev/null
@@ -1,3 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS += penguin penguin_advanced
-SUBDIRS += cube1 cube2 cube3 cube4
diff --git a/tutorials/qt3d/qt3d.svg b/tutorials/qt3d/qt3d.svg
deleted file mode 100644
index 4b25ec50..00000000
--- a/tutorials/qt3d/qt3d.svg
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<!-- Converted with SVG Converter - Version 0.9.5 (Compiled Mon May 30 09:08:51 2011) - Copyright (C) 2011 Nokia -->
-<svg xmlns="http://www.w3.org/2000/svg" width="287" version="1.1" height="286" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="tiny" id="svg2">
- <defs id="defs4">
- <linearGradient id="linearGradient4309">
- <stop offset="0" style="stop-color:#d4f301;stop-opacity:1;" id="stop4311"/>
- <stop offset="1" style="stop-color:#d4f301;stop-opacity:0;" id="stop4313"/>
- </linearGradient>
- <linearGradient gradientTransform="matrix(1.0104795,0,0,1.004441,23.387309,76.758859)" id="linearGradient3730-2" y1="131.35715" y2="156.39526" x1="23.626827" gradientUnits="userSpaceOnUse" x2="303.57144">
- <stop offset="0" style="stop-color:#038d30;stop-opacity:1;" id="stop3726-7"/>
- <stop offset="1" style="stop-color:#038d30;stop-opacity:0;" id="stop3728-1"/>
- </linearGradient>
- <linearGradient id="linearGradient3724-7">
- <stop offset="0" style="stop-color:#038d30;stop-opacity:1;" id="stop3726-7"/>
- <stop offset="1" style="stop-color:#038d30;stop-opacity:0;" id="stop3728-1"/>
- </linearGradient>
- <linearGradient id="linearGradient4315" y1="62.920685" y2="62.920685" x1="72.492188" gradientUnits="userSpaceOnUse" x2="165.83203">
- <stop offset="0" style="stop-color:#d4f301;stop-opacity:1;" id="stop4311"/>
- <stop offset="1" style="stop-color:#d4f301;stop-opacity:0;" id="stop4313"/>
- </linearGradient>
- </defs>
- <metadata id="metadata7"/>
- <g id="layer1" transform="translate(-25.071424,-77.933617)">
- <path style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#d4f301;stroke-width:8.85648727;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="path3722" d="M 149.39285,339.37194 C 118.29002,338.06386 93.410274,329.21846 78.267585,314.08502 66.239667,302.06444 58.159936,285.11057 54.818135,264.88047 c -1.962614,-11.881 -2.442596,-20.11519 -2.455216,-42.1199 -0.01051,-18.36712 0.160997,-23.0644 1.239861,-33.95521 2.529982,-25.53941 11.482605,-46.43472 25.677112,-59.93007 16.042727,-15.25252 39.462148,-23.21337 72.203768,-24.54383 6.77105,-0.27512 31.97542,0.38686 41.46813,1.08915 17.85829,1.32123 29.86273,4.01251 41.92069,9.39824 16.71724,7.46685 28.60768,18.52238 36.44553,33.88638 5.7477,11.26691 9.34961,23.29707 11.69339,39.05536 2.22754,14.97664 2.81073,44.00559 1.22086,60.77114 -2.76934,29.20404 -10.704,50.36949 -24.19378,64.53629 -8.65346,9.08774 -21.29946,16.39504 -35.37578,20.44137 -13.11053,3.76868 -25.14568,5.0858 -52.44498,5.73944 -13.81368,0.33078 -17.4242,0.35023 -22.82487,0.12311 l 0,0 z"/>
- <rect width="236.93414" x="49.282932" y="102.78797" rx="95.84404" ry="92.255867" height="239.43414" style="opacity:0;fill:none;stroke:#008000;stroke-width:3.29858350999999980;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="rect2852"/>
- <rect width="175" x="28.571428" y="19.214285" rx="95.84404" ry="92.255867" height="206.07143" style="opacity:0;fill:#b94b4b;fill-opacity:1;stroke:#05d105;stroke-width:4.147;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="rect3704" transform="translate(25.071424,77.933617)"/>
- <image width="172.71428" x="86.571419" y="214.50505" height="93.14286" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIkAAABMCAYAAABZAZTOAAAABHNCSVQICAgIfAhkiAAAF+NJREFU eJztXVlzHMeR/qq6e06ABE9QomTJlu0IKdaxftmH/Xf783Zf1l7FWpbWFiXSFA+QIIDBYDBXd+1D ZlZlVdcMTpLYBTKi0T19d9fXmV8eVTAAHG7kRtaI/dg3cCNXX25AciMnSvmxb+CDiwEMAGPW7+Zc PL/Ocu1A0ukAvT5QdQFjAWsUYBzQOKBeAssFMD0GFvMboFwLkBgDdHtApwfc3wbubQMbt4CiBMoK sJa0S+OA5RyYToHpBNh9Dbx9DRwfAYsFri3FvxYgAYBuH9jcAh4+Bh59Bty+QwCpukBR0D5NA8yn wPGEgFFWwGxKWmWx+Lj3/zHleoDEUIN3e8CdB8CDT4BbW0BVkXaxBWmbpiZQTI6AyRiYHQM7L0jj XGe5Ho/vgMkhcY3Xz4mT1EsGSZdBYGjdfAYcHQLjEfD6BXDwjsByXU0NcE1A4hybkAnw0/fEPyrW LDBA6UiTLBekRXbfAO92gJ//h+Y3xPWayeyYTMliAVQdIq1lSZ6Oc4BraPtkTJ7NjVxDkBxPSFMc vCPCWnWA/pDAcmyA+Rx4+xLY3yXyet21CHANQeIccY53O2RuXEOmxhjaNjkERnvESZbX2KPRcu1A AhBBPT4id3fJgTNb0Hw2JVNU1zdaROTagaTTBe7cBwYbpFF++JY5iSFgTI6ArXtkhgRM110M/j86 d5yfcY6JaUWNLhyk6pCpMYYIq4TlHcj81EvSMHMOpDVNCNHLuYHro2mupCaRRut0QxzDWjIJlvPW Pu9iQ2PLfmVF6wrev6jI5bWW1jmoBs40tFH5HPF4plMCScNmyKkcT63WOUfndI7A1TR0TF3zvks+ T/OeX+IFxFh6ZpErBRJp7LKixhxuAP0NBkrB68sAgKII0VIBg4DEWs7JMLgKtd+Z9Cc3+HJJDdzU 1MACksWC1zGYBDBNTdsFHIs5ud/zOXA8prkA6H2LB70Cv/F/wnZ5l84Bi1kA+tUBiQFsScC4fZfM wa3bwGAT6A2okTtdjm0UxCPKkoAhD1iWQVsYGwBhlUnRLwxh5kWbEOf/MDAaNXcEgHoZGrupCUxN HfI9TU2AmB0zWZ4BhwfAaJ/WHR68X6BYS6mHwRAoO6RRiwoo1DuRj6jqUYHRaJ/SEYs50MyvEEgs Z2rv3KfcSn9ID9br00NqPiHaoigDIESrCCBEi5gMSPQXBSiOgXhBmyWnQSLmhsEhPEbMigcJr1vM CRyzTQLOcJOeazImrjM7fj/vtOoQQd9+TInNwQa9006PPijnQklEvQCOjoDxfvoyrhBIjAGqklP6 rDEKBQRtXsSUWAuYggCmzYsnpDYUGEUaRJFPveytUI6vGAB8PjDvsLzsjAIT72sdUDguQWAtt+S3 3elSVrppQgb6fUhZUUnE9mPgs18Dw1sE0G6frtvUpN3evSFP781r0iCjPQK18KYrA5Jun0zLcJNe YlkG4pkCAMpciERawCTLLr9JrxRvSPb3WiTRKn7u0AaRCbfmgerC/RcFHVNWpEkMqHxhPrv8wF1/ CPzun4D7j4Cvviag9AZ03aKkeNDxGHjzCvjHE2DvLfDLTwSY1Gs7F0iM/vQQiKT/itU2v7imXLAo AkB6A9YiZWJCeBJT4af4VmJyZlZf1rQWkuUcsV1DeD1uDWJN5kjbGX4W5+jZqg6d6+4DzjofrH4/ Z5VuD3j8JfCHfyEQ3t+m91uWpB3G74BXzwkY3/8JePI93cMqj+tsIDFAr8cVXZ3gMfT6wK07ZPOq iolQGbiA9ypsu1GNBQ73gd0dQr8HSKkAIgBEMC1GN4bWLhktk65vgbilXuJjDaixW8emgEy8CNEo 1hBRtBYAm56qousNNqi2ZT4NRPi8Ivdy/xHw+z8QOPpDoD+g68MR/3n6d+Db/6DKu5fPSJOti/mc CBJ58P6Q0Hj7DpkD+eJtQSAZbhKCS/EsVMNmPQpeNxnTC6o6wTvJmZhUe/hzIOEdrQc4+eVGPEQf 5+Kf6emymDLEUVIuJN6Wc0HLiEfW6QbQXMTRES9lsKHMdhU0mFTe7b6mj/Lw4HSgXAkSY+gim7eJ Lzx8DDz8BLj7kIuJB6RNrA3aQ9v1ls120cy/vNc1ub79AYFMIqOeoKa8JNEgOfBIA4WHQb6VVz58 sqvmNmqug24pICJzo0DhwDEfRWKHt4CjUShhOG8kVz7e+4/IjIlmNpbiHvMZ8OIZ8ONfgJdPQ2T5 JMmCxBg6+fZnwG++plzG9uNQ8tc0RLTm88CQ5zN6QAljiyvolMuoo3jglznap+O7/aBNVvERkwML nwspWBLVn4KkxUl4LlrFgDRCxHa1meHtWZBwEZNlFd+o+4YD6iKURJYdig0NNsmlnh7TuzuPdHuk 6R88AjY2qX63ZC/m8ICmv/wn8PxnIq6nlZWapKwIHJ99Sdrj3jY14mJOKutoTOn0xRyYcdXXfBZC zgsOQUtsAS4mRkJC6yVHVzdVBNW2Gzl1YdMG02BJt/lrrtEmEmmMwKH3zWgTMS1+PwXAVMshXaeA L7kl0cjnBYl4Tf2B4oyWYiDTCZdk/kIk9Uznza3sDwmNv/0G+OJ3pA6XS+DtK+DNSyKaL55Sd4Pp hIDhw9N1sH86zwEETeJcCIY9+pyupTWIkDxjedmE/jHpi86SVQ0utSpaUECITBNIE6TerTOZfV0C PDXp+7RQGhEh5uMcfellRQ3b1NSAy3OYnKpDMZHNLU5ldOjaDZdu7rwkj+bNy7O721mQbD8GfvUV 8PlXBBg4Asj3fwZ++C+66PiA7JyOQJ7lwaouTRI8KysVGylUviU1NRlOYtWEXGOyrAKM079V3CQi rupgp8Bl1Pas9hPvzNEzAYFrFS54Or0hNWi3T+b3LNrEGKDbJROzeZvAUnZoW72kj/rlM4qHHE9O f16RFkiKki60dZ/mAHGP3dfAs78Dz39SJuSckrrNHiBlTFRNMq36UrONg2CCUrWfmqGc+UnicJ6n yP37fRSovHbj9alpsQaASjjCBXe/0yVN0h8A44r4yWmTkMYC3QGweYc0SZcDZjWnBEb7ZGZePD2f i21bFzSxNyEZzcWcyI5zp773tQ8lNR1RxnYdAIAAEMRT2sgJLYnP0bqZNatTMCXb9PH+OgjPcSow q2hsWZKZEA/vtGItl1X0QsbcmACS6XGojTmPZM2NqHshc00TCKvkLc4r1nJc5RYxenkoq7wZvexN inATGzdGLlejGyj1blJTA8QAih5NtETGfZdzCNk1FrBNzF2sod8N37ezdA7/AdrAT6oScB3Or4zp nU/Gp3ifnB3f3CLPZvM2/QaIDowPgN1XF6vZbWkSIJiTxoWHLbjxWiTxjGIs+fL9IdlRT1hVIs9r MhNrGZ/V1eBITYwGhdIgGhyt7RpEa85p2Fx4DaPWCx+KMs/KzPjaFj2pj0L6JQ84+y0NfZJ0e8RB 7tyjEMWQzbcEzkb7oT/zeaUFEteQWZlOCInG0AN02bUqOOt6XikKerBeN46L5AJnOU2SU9+Riwm1 vAYQkVkQSc3WCrMh+6agjDhI5ncE/ISgF1wbU3WATj8k4tZJWREw7j4A7j0ksPSGdL6a41dSuzKf nbvJ2uamaeiE82noJG25lqPTZTV5AdJqC2Lzvje/IqVrbXem0VMiC7SP0XKS2QHa5iY1RaJBnCKy Lr0fledx6ppyD61JaxnJ7XAOax3RLCtOl2zQXLxEYwG3JIdDx67OKy2QOAeMDoC9XbJnW/fowptb 1Nm6NyBNc54uB12ukNq4RZpJyhRT7dHSJNrLWQOeVFPkTAigtqt9WuLibf6nWu84gmqA4M3IaeW+ HXxo3qacxAVgFAV9fEVJ78iAu5wmkVF5xm6PirM+/YK8xC3uASBdV+dz4GAvRLQvUv2WVWiTMfVw Gx1wYUwJbNymrOKtLSJB8xngznjh4SarxEGc6S2U+jUFgAKAtu0G4UPVQFhBVr0bKiCxiEChG1PW +UWT9+C01vDLvN4n7RxaILZ8jLM8V/doQc9r6hA3kTKCpiF+MT7gELoJprqqCCCffEGpk8GQCStn 6F1D2d69N8D+W2rP80ZxgRUgkWqlnV+AX/2G3LLBkBJHn35JUbujMTA/44WlIkvGBFlVbeYjrClR TQhsRDiR0SbatJhkLpKYJZeaGBWeN0BUSS6WJdIeBpCSCIncmgQYjTyLow+ksUCtvJ2youv2+qx1 B2SCBpvA1l36yG5vUbrkzgPebzP0CJhPCRij/RDBvYhkQeIaIq2SmZRsYn9IbtbxEedxTqhDSMVm ABE1vvrKV5FT31h60iYmlVXblCnKHmYCYHLP6I9TWici0XKvLr5Xl3muyKSa8G46XQIJLAFnuAHc uhtAMdig+h5fEsCorbnP0PiAHJCLdt/IgkQ6I736BfjlKf1+9CtC8eMv6WHe7TC5PWXP+6LkUDxH V6NYiG3PtWu5jtBa9Vt8NYN4fY6wZvmJLnPQ+8SbY8TJuZtwPQe6F+uYuEpQ0gKmUfetNKOPm6h3 I2O7CS/sD7lOpEfbxF2WEZvAgc/phOpUd17QR36acoB1stLJqpfUu/7JX0lzDDaIHD38hLa/2yFV Nto/OdRrjKp87yalABnNos1OzsxkiaoNjeo5xxqQrCKvEQgUWCJtokHC5FV7OFq7yXZ9zwIIIH52 pyr/Gx4Oo7BETqtOiKiWFcWYpPOaZM6Xc/poj5hTSpb+It4osAYkzhE4dnfoBscj4O42+eFDzjZ2 B0AxPl0+QKqvfFlj0uCrYhGnmpSk54M6lcx9HYhyVVuu8KptibbR19XurlwnfY6cG58zPdaGuhwx 974XQRm/TyFHNff7mfG4b3V9OT0F14Zr6pqyv+MReTdb98hG3r1PFdjLBZHYH787OVhji5DI00Gk KNxu4xflzY+sQ0a7aO2hAZJoltw8dZU9EwWywPFASESbMGNBpoeJqVPrxQXWw11Y8W7YJBWJO2wL 6qzW6XL6X7nM0pvRcf3O9IjLAl5QIvasnHGVnFjjenxE09/+mzjJ13/kqrXHhNqt+2T3XjxdzU8K 7k8TdZNQDZ8lr3p7zryo7VEjp5pIFlPNohtbmRdn4DO7QMxPUs9HjoHaJvfjeO7vHyvuXwG69YGw GRlucnS64nuxIeot2mY2BQ5HYay3N68u5vZqOXW1/OvnwJ//nR7i3jYNc/nJZwScxZwa/uUzIryt i1RcE1vFZHWlqUkAsA44KWDSCXpfZLSJlmSda68KG5JjxHzpub8WE1Z/SAYsonly+R0BoM8M83ll IMDlgvjh21dED14+O11y8LRyapA0NQ0R9exHQu1gg0xPfwBsfwqMeJTCN69DhZqItTEXQdLQuoFb Lm6qDdQ26PkpNciZRZmgaLVRqzP8JL1HWaezxC0Srvc1wdROJ8ElFq3lu5IyWT2ekBOx94Y8m8sc UKQA8G+n2dE5AoEEaKwN+YI797lGlXMNUgsr6q7ToyTUYCPUTEgNps8AC5vnCKwspyUDkXuccpbU C0rJ8YrGyWmwXKPJexAwpw2hf0Ydz13gIv63C8v+o3KIRiZYcmf0kjtyDTbIzPg6kQlpjKND8kSf /g149Q/SJpcpZ+qc5RwF2KTn/HhEAPnqawLB1/9MYfu9t0Sc3u2QOkw9mtQmpBoFutGgGu2kSR+r j0H4vU6rpO0uPATpOkDF5ONz68CaFFTrZ/Che3XMKr5lLTsHL+g8W3fpg5Nhu45G7OoeAs+fUA3r aB+XLmfu5ukcBdHe7VDjj/aoluHTL4jENo40zGJBX8XRIS1LPiXiG6cR1dBnshpm9XL0Mz2pEFFe 9hoEaBVI63NEATi9X+aDkNW5/FAKbIC8lOU8jO0mVYJTHrpitEftITm1y5Zz9QUWLTIe0e/FjDon f/l74OGnpF3uPgRefU5If/ksVIdrF7PV6Ep7ZOUs4JLzyeIqoCQnlMYzGiz8u+X+Jtpk5c2l15CH zxyXey8yRIQMVTGfETCkbvXwgNze9zW+26WMKvDDt9Th57ffAH/8V+InW3eBzVuE+Nt3gCc/UP+P plA2Wk7g4imy7VjjZeidTkJP0iD62kbvkmqC5D5OukZ2PxdmDupjcfGy/NaT1PdMxlS+0TTERXZe AE++o9TJ+x4x6VJAUteE7O/+RP07tu4BX31DHbv6A2DrAeD+GiKATUPV4EaVSTYOAP+2QvB44Biw ffeA4cCTa1TDcgALoHMYw+dMuY5TxyCsB58bDSIAybJb0YhCRmUEJMdV7nrAG7/Nhed3yTrH76Bu 4v3rZci2i3k5PKCQxOH+xfMyp5FLHZ9kuaAbbxqg/zMAR9lKZxAVVusXlJsax8kx2ZcbX48LYtT+ XolkNIDXEhkSIACJBqDR59AaYBVIZB+X7OMPVOvUMzcunDf3/H40Je6iOZ2QyT46pGKk6fGHG5zv 0kEy2uPxNvYJ7YMNCr4tmbxKfqFckjvXcD1Fw/1QahV4Ehc6jYEYfvHWhWJtqc/wmoOjkrq/rpwr t+wlNXcuXpYvHwiNHmmOjMaQwfiaRJNKtLSugWUdhtOSjtxL7p75+he6hsRGlssP+0+aLn2kIyFZ o31CfFFSfqeoCCx1P+RwAOUCcnSRTqLyHAj7WQaGjpFYDs61+u1Y6sqQur0rCax/gLOBRGuJRpuO ug2Sekn7CABcw8vLMLqjdJldLihAdnhAdSEX7RB3EXmvw2Et+WFnx9x7fjNUctd10Cy2BgrWGtKw cPBxldogqtD37jTgE2iyfxoQS93KlvZIgbLK9EBpCW1GmMOk/EP3hfbjuer1Ah498bp6GULu3qx8 IK2Rkw82ZtpyDhzuAa6miKtlgGhtYYvQEMYCtQPKBr7OwloClK4sj7pdJJokDf8DaMdcMiYnCqBp XiKjIyT8BIhBEGkSF5sRPeJ0U5PWWCwojFDXFIOasZs7PiCOd9F6kIvKBx1Yb7TPyUBu9G6P24hf uqTIGxcA4ZZAw90EJINsEMyTjEfqM6MJUFogAdbGSYD1IIkIqvzGCk3Cy37YziXvw+amqYH5gj6g +ZzAM5tS/OnokOqMp+fo4H3Z8kFBMuevRcr2BhtB7bqGGr2qidRJ/9i6JFNkLWDLABKdJdXJsCjM L/smWsRHPl2yHsh6N7KoPZQsSBK3V4OkpUl4uPEFg2TGpaACjvGI+MjHNDMiH3yITin3nxzBdxz3 ZYxNaGjpdS/SWOpy4BgMToJyTGSdZJjRBkmT0ySrgm+pG524wanrLmYn0iAOMScRDyYxN96TWYRO VPJfu+ZnGInofcsHB0nDINnf5RK7Zfj6ZADauiYzUlSkRYqatEE0lrwuotagMIlmQQwekWiZ5y0r k/FsUqDkQOKBkdEkjXg0MiIU95YccSxk721Iol4FLQJ8pMF+pexgPouZvfzzxIo7K5U19/JbJiDR pkaZn1aVvYDDhsCZSA4wKRdJXeGWuVFTFiSsSWqlSXysg0spZseUxd3f5dT/YeAuV0U+2ojQTQOg CX14un2gUZXfEpqnneG7VIrn42xYNoY5jXKBG61ZGpyOuCYNk4uReJAg/p31biQ+okHShH9OoP/F 7NEhmZurBhDgCgwbvpjTV+QcdbsAmLQ61X4SXHO83gZOIkBolIlpEdgUFGlsJLE3KXHV7q9f5g06 79I0gBPtoThJrYJlTUOJTuEge7uU5r/McsPLlo8OEoBe3miPvrbegLSKRF99dFWq2ETTpAXVmUJq DYg0TiKiNYyvCdE7SBxEeUNSMuAcIB2vDGuyxvD6Omg42S7nq5vwnyvkv4ZeZbkSIAFCctDVZK97 gzACtVSKd/thZKSyopELbZkQ2RQoUIBRyz4xuMrcrOAkIS0cPBkdPKszJmU2BdwYOOYBd0f7gbhP Dq+eeUnlyoAEoJc1nxORk7E1pNimKLkHWydolS4P+CIxlZbHk9S/AiHg5qBAlNxDdi6AELOjEnXi wYh2kP+WJbGQ+YzGuhXeMRmHcW+vOkAAZKvoPqpIg0uEteyq/58nBdPc8L0+daKOttn4HD4amxZF a4CkwTTxXhCWI2Kq4h9LxTumkzB2i/xrNdEuNY+gLUk97fpfdblyIGmJJp5JEExGBIqCZxle4jmJ Njnq/JHkPBwFGOcAKUzy3g248WUUbO0e8zl1nuf/mlx9kNzIRxd78i43ct3lBiQ3cqLcgORGTpQb kNzIiXIDkhs5Uf4XvCkz5B6wzDwAAAAASUVORK5CYII= " id="image3149"/>
- <image width="156.57143" x="89.857132" y="140.67836" height="65.897751" id="image3075" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPMAAABoCAIAAACrNVHoAAAAA3NCSVQICAjb4U/gAAAgAElEQVR4 nO29ebR9SVXn+Yk4w73vvvd+7zfkPJFJAmKiKS0qMpQMIlQJBYhoaQMKWpZFid2WrdCuokpKWykX WtqKJbZDtraKUoWKE6JLUFBAlDlBSCAHciCH3/SGe+8ZYug/dkTcc+f3ywGl+7fXXW+de96558SJ 2LHju8eA83SeztN5Ok9fKKQe3NsVRfGox1xx9aOOHL/MXXlNfuWJ8qKNo+3Gme2eHtbu5vF9e/vu 4Iz77Cfb2z/Z3PGZ4d4pOx6aB7cNX4i0ublx5TUnLr92MDiito/mR47nWb/dOZLtbGa9QtetOzU+ qCvfDNVdt47vunW4e8oenHGn76mr8fneW0z5A7/FxmDjWc/88mc96zGPf/zFX/IllxdFBqfgPtiF IRyH2+K1TfeHlpMtnDzwv/nes+/5vfyDb2/uuKlyzj/wJv3Tp6uvvfQF3/RFT/yKK6691lx77eb2 9gBKAE7GS05P/+IMAMfgDNwLPaBlb2z48G363Tf6t/+P3Y+9Z3T3ba017vP2Fv+U6f7L7LIsXvCC p73sZc946lOvL8scdjuDIZydwx7oDmff0b2DcDawz/4228Dt1fCG37V/9N/sx987tvb/ayOUZfqZ z33sC77++n/xL7708suPxdOfhFFka5Zz9gHUAFgYAfK1pgZ6bNYMK6rM9n/93fVv/eTw7942amr7 ABv8p3/6dU996hWQgdyqAKCNxzKaV8FnZ37oPd7f4RzO4Zx3Du9xzreOg9bfMjp1duTPjPw9J4f7 p/3eKfZPqXtus6fudGfv9fun7fiAauj8AxNx94ezd3aO/OAP/q/f/d3fesEFwrtngWnOPgs3gwbA wal4/o44KoB17BnQsMd+n4GCs+x72GZ7d+xf+WOn/+D1zXD3gQ7PPwXK8/wlL33iq3/o2Q9/+IVz /zwLQ7gXBnAx3BTPn4QCDqCB7Xh8Jv5333KQsdVyABRstRyMGA0YAAeMenbwY79z+pdeObzvzmbu iYelt7/9WU972pcAsAsZHAUDu5HFT8WTpxb9ujvWXbI1ewos7LPvsIAHCxbXYjwodIv9+Of8+9/p P/JO+5F3uDtv8u4cGeHcODvP81e84jte/eofOnHiOAxhP95hD26LnK3hNNwaf3Q6znhgHz4Xj/cM 1kEOYxpPpmCffQ9bbAP77AO/+PvmdS8ZjQ++gCHKS1/6nNe85rse9jDhiWX0YQC+LB70oyA8AGCr c3wQQd0ZwNICGduW/cTZIshbbEH2X/9g/NoXnRkd3B843uHsRCLL6Ejus53x7VJ3rCfk2KuxGXgY 04wZCQNVuBajICevMQ1WoTze4Szeo97x1/6NP+o//HZnD/cq+rBvCQ9/+DXvetdf/vRPv+7EieMA ZGDgs3Aa0tM0ODgOV8bPZucefdiKn1yTOazFajJAmFf+pgn33c/PP7RXvuiHc509yMru54HKsnzj G7/7hhte9rCHXQoXwEWwc7ifXgw7i9h6C9qEuSNbF2Bl5Y/gpCds3aN4xXPzj997waO/cnPRU+4H HYOHwQCIkttCBqPpzz704Vi8knSlJgcUaMjINJkmy8jAe8jIAYsVnvZ4i2/wFv+UJ6s3vE3/ea1e +l9Uf3M9MxyWs5/3vOd+6EPv/+qvfjwA+7APLWzC0c5VZ0HAcRcjnpi+ING2ZhNw4CIr+9imqWYp /uNrsrfevn38kgdB3/28UZbpN7/55d/yLY+HXbgd9uEiuGTd7/oRT/eAObYm8tMZIKOfUcQzAC2t MLewtZzc2VDved+Rf/7SQ06qw1DewdxHpnlAaBfOwtHuTPZhkd9Og1tRAR485Oic3IPBOLpLtFLg 8XJSa176Kt66p575nUqtZO9Dcfa3fdu3vPnNv769vQ0NGNiOnx24Aq6Gq+FL4Wo4Dsenl6djsBE/ bTxZQA5ln0FBSZim5BQ5mcN6KChAGbxCZ+jrLvXvv3Nw/VPuD3MrpbRWSiulldYLjrVWep6y2c+a vpym173um5/znEeBhUF88Q0oYLDocwIKsPAIuAjOQgGXwRHIIYeteNyHI1BEruqDg15BnpH16Fls TdtnQ5ErcsggK+n99g1bz3rJ8XPsuTJybTMtxURyS8MeBg+DSzrvUkAPaqii5O5BpsgtBhqL1eSa 3OBErlnIyHMKAagG7UGBxcsFLd7gTfzqtf/3v+x//O0UvaVNX88o3/7tL7zhhp9VysNB7GJR5A2Y KGCAI/CweJwAZQ/OwEb8uglDIK6qFWxoKDkYMgJbUBCUCVtQGJzFFGThJbV/y18OXvKN9V//bnro errsmo07b74m4iXpiXrJcRmbug/A9sytXv7jd73hP9x8mId+1ZO/+Pu+73lwd9T/5G4t3AtboOIj gCFYuAQU3A0XwxVwD2SQwz4ciQKo6qxnx+Ly6CCDPuy2mC22Ndkuw37s8z69fYZH2NZkf/LrW4/8 QHPzxw4O1XGBNmETboEzcM20eD4TdcQSroNbYA8acHBJXGdMd6wzgNbi5S1ychNxbIs1KIsHcrTD 2jhmwmd9lHA28bWvezK/eiv/5pGMF73QGpn9tKc98Zd+6VVKmQiYEp420EAZRfJC6kHZUeeBxTJj dSNETrpwx/xNb968/muKVT9YQIdh67rzdg+UfvYnXzQn4A/gLgAui7hCaA/uAeBioHPsZO2evjjR JmxHVfIIIL3ocJFdHLiGpgxiyJXkwF/+zaW9/uHXvRxuAeAaAG6ZxpMXx+UlXSPLctExYs5SS530 gU366XxN28YlPQvSLZDDC4cYZi2Bxy/h5z68WHKvYqpLLrvozW/+xaIQA2rXeJTYWl5+4Wv04vm2 c1LWpvujzSjIALDwpr/YOHphdvjfNtSHYGvAwS6M4+8M+C5mKMulA9alJzzlMY9//CM6J4awF3WP y4CopbRRV2ERc28uZ+tE/cjWe9DbnOvYfYbAduf85Tv6e3923vK4jC4FljP3UbgcLu9cs7OarYly KuoDOn08ygXxhcGZKMsSicBWTGFwa7ngCv7D7y140CrO/rUbvvfYsT2ooY4OxSGMIn7S0RJSwg7s RPB9AezAUbgMjsHF0IufCrbgMuhBAZlgRIGDJT2FbnElvZKixXpURiY6suBIWZi28vyN798+JOr1 oS/K+LIyFbXFwgbsTB9baGALNmAvWrgCtW274AFz9N0ve1LkWmnv6QjP+rAPN8Kn4GT8DKPWuBvF hxxvQj/eQUTYRnybLrrbhj1LDcdyeoKqbZADmUXF18/S5ye+69iJiwaLGj5PBTwMjkEFvc5xl47C paChgh24CI7C0Y4RbAsGiQdycrGHWFzTWSRzMh9fz3a41+BNEKVegI4XxONwlqbCGq5/Kk/4htmm L+Xsl7zk6c985pfDWTiYXoOGnTFoII/HaY4N4BrYAgMFnIA+9OEEHImz4sKo+ghGpMX02ejRN9g+ vT4bBqdQBYUP8EsrMheWKnvdlfzz7+hzCFIoTR6RhuhwY8gyetCCh63OsY3a0pF4LFRBY9r13oIs y573vMfBLtwNpzufk/Bx+Cu4NS4/QmfgTjiAfbgTRmDjT3ZhF1ScEgJqRSia9BkxtjgoG6x8PJno WxsMapqaxuG7n+/7ucsP03VgIIuAs4EMrpwzXI7BwAnYkV6Kw112PkVHPGcO7dE5vYKemahr1nTe qo0MXeHbqGXm4GDc0jTeGpoxtiXLMS3/9vVk0yBrMWdrrX/4h5/TObEHd3SUHqCCEeRxBvcj62yC WoS8N2EQdam7O48+0jkOWHCGCooiGrAy0GCxFvPzv7BRlOdgj09kJ2o7yTbsaWckdIcq2JuTVYvp mkdedPRoC7fOuccBC9tw7bQltIWNKA7nHlxt3XDDZ178v/z9k571ge/5sfd/6lN7EZdNZnU+N4qD aEXeYbulVaimAyZzej/0jcd7/XPVVYS24cS0VUfuLG80goPl3TihnEIUAIWST/e/Hu+j2Pbx7RS0 +HYurMhZrKHs85XPnnnEInr+tz7u2mu7ckUCcWzHXCAmDpmF0stj2IywdYpGo/Iv/uLWD9342auv 6D/hCUce8Ygx3A0uYURNb3s5+M7nGpmRgy8Kvu7b+n/yywtduGvIUmcAfajgDBxT9D0VAQgOibZ2 DbDraDT9w6CRr3jaJXB3XJp3u8bmSKfg7DTfH1l4q5Mne096yv+46eMh2Obdf8YvvuYTP/lb13/f N30plHC7nJ+f3H2KktLQQL+gaKNyVlLm9KCfZXzF04//zZ/cs/Z1DkHJVibO9q1oFVlGpbTEw6jj fi8p2yg7PF4ckOm/glLaBsS+3SETx+T5/573vmVyfjFn/+sXPbqDDj08HGyU3DvT5jDXWSWBYcQn Ym0df+ITd33ds37xjs/eK1drrd/ylmc95zlboGEb7jTUOZeUUahkFKArGkXh8WIVmvHdFLHZr/4v G2s5W2tVMIAsSkcUFeCwGiuNjP9qfBASB1DAhqeGxtGCgqpp1htPvuQrMvgMEHvvKJwF3VFM5ykB +q4diR/95RsTWwtZY3/o2z/2vS/48iwj3XBMC2wzHtECm/QdLeQaB06TG2rAUA/Ygj6MoffiV1x0 CM7uxxfZhJ1pEJVoG4ZxmgkMFtvuAQxgC0ZR6xuLXUGRC6oTyCFkOpYpizJRbJsIiRIQ9N6LnPYe 7wMKti0XXU1vQB3ZYQFn9/u9Zzwjg9shg+Oxu8VgNyO5gSqiFB2tWlfEK2vgNa/974mtAefcN/+r dwwPXqzUHuDwOT3AiIcJNhmMaUY0GwwsrcUS2Xoe5F55Ql1wWXnyrrVBP8dg12MUfdjtTJOmi50U mQo+0VZzFvoZwNkDqpICxv4QEbY7D9uNcAvYgTulpXAGduc0/hnq4j3e9POfmr+iGje//rYbX/b1 Fzt25TU8vqCAoShkffCoFgPaUo9oxxhggxLymj2gx/a3PEG/fO3L0Mb2XxB7aX7V2o0xQlfHWJEr oYx2emlj7dl7+gvvKfJ+OTCDHff0b26/4St7Rd6v4iuPqZPiqEDsJIJSrMUpdEe2mRYJkJK/1gSG PnYJd0d/wwKc+ugvu7AodGw0cKwTx+Fi8JN8JORFGF0mgLC1TJyRte6Pf/cjM/cfj6qbbrLx8Ucj 1Amt6VGOaErKTXqHAdFf/ow1eNF7oG+pFA5wHcTpwQfMHb66iXreCBY31AeLY9YW0xdflUUbkY+S +EoAbl8ZEbWg2ffcub/wX+985x6dkdtia4PtPfaBAf0+xdacnrNBuUGvZgz0OA5sHt3b3F5rxJQp enU8Prnoc2fnmmRIFS2ziq/cAu/9k/0//507//iGe/77z9z38ifefln/5u9/9V6Dk4+Ztoe0YFBt tJN4j3OYNnwkSMqa8BG27g24KLkKF3L2k77+onh4Bm6B0+A7Tq+uorPfcdcdi2x9B5wVz84HP/ix g4Ph/CPe/bdJqokS7RPecCBsTbQnr7btPfH5s8tO0cu2doqd4/0TF23tHO9dek3BZB3d7d4t3lzG o0qcLSTMPaIGcnRDe/HV2c7x3s7x3tET/SPHescuGOwc72s91YdXnQjtceyB77A1cBUcO2REw96e 8UsilE/f08RH0IJFt5iadkB/nqf79Av0Bj0HLa2wdc1pB5dceRjHwtXAEoVY6HjnGrF6dUmYu1Bz Tjpn3W/82Omf/IkmtnMioQxepLXHqwisZ0L8nMU0ALYF6A0ALrxycsECNPKML+s24kz8nOoMSXKx 1nArbHX0pDtiKIyG5tSpW+bvD9x496mudg8bDSNgQN/R5OQ11kErkevxooUmtyc9eZZRvuNHTrz6 lf4yLtRc44IHoYDMgafNUDP8YiGjGrKnO50rE2CXs2cZbrFRYU6y/wPfU77qey5OvyrJaurHXnrq 1N0Tb3/b3z/gMx4/ZLxFvcHuPiON3mbg+Og+I2BjkZ4NjCehCnzi7FJP4Z237MHdB7QFfUFrGWyx ZbGn2MvINthosGPGGdkWGwpVYV0YJL3H3RXVhVx46dX9z3x82UOE+tDCTXAWHrnkmnz6mrNRTie9 Qg60W5RK8tuvrX7gVSWQkyU0YkFFx431AXKYdjJuIqqVxjRYg1LYFms40rE5Lei+h18z7/fynYj4 e6NspuMhs50rT8BxuBk+s7fXNYRP6PTJUYyjEGplUDOKBl9HXaLB1DigR56j7SLv98Mv1Fqrbo6Z VtqDwZccNFgNJcbEOe/nfOgOcsb7DPscSRK9pm6xYxqHa7H3sX+WsaYedJhyFwPKuakBM/3hbQwl MO0+9kpyO4et+wsMJgAVLTCgt83g9rNLlYezJ+uzHHiUpRLzwhYDgzvJmQyOszOiPsMusMOORhv8 mAokLHD3DAfAGLN5bG3W0hBugwMCaEx0Zs60J5hkD4JO1bLbzcABFi5Boz07ipfUsaMaQSDy81p5 7733bSdWqImzpqkAlArcv3Px5JoFnH311WfnDDeXwolFwYrztAFbcFrsA3t7i+1Zwz0Lx6MbmTH7 hHWz0BT1tCKVQUlmwaE1et5a0h8Uo4MpPogG3bN0QM4ykgsazAANNNQtTgzABRlkQ6o2YHQnoaEV jQgVj54Zr0zLPVWIukSBnmfuhdSjN2AgiOLMeCm4t9YD22yOO8MkEaE77Fg4w66GHXY22FgBfTa2 DukNODFnl2yZBCw8IPKeW+7111y0AHIGQOL9MlTWvQmgFDsdKDTL2XmeHTkyz+5iBTsMZ1fw2ZjM d+3e3k0LLxrtGxgl7b6l7dPfmMOIGfTIC7THN7gNNjRacm2iywZgsJ2NOjNRad0LML3Jg0pdsRLe urAC4mHE2OAyMkKYjqvnDAJjmowMdDuFzKdIo8TxpFEDNkbUa/nb4VpaR0+jV7RWKTJQOIfqMdik r8HgMkpgl10Nx9kpl0aqBeoNDh+UOxtoADxYzH3nLYs5u0tKqWX9LCTMffSiyZlZJi57ckbBzvRM PQPtIsk9hM+Bg81OOJGCAXzyE6c/urAdZ0/XonrGQMzM4GqGhPS4ShS+lqakVGQjRi1skgMOp0EF Hywl+cbmFBuY1jZRrgsV3DfucOdCvF7jznCQkVUYh9M44ekG21XbSyrggCZ5zmaS7XcZp+9bceCH 1BXtNv0WO6LJlmvFA0oxP58ZLkUj3rPPqMUNqSyNoeei2XTEfku7yeaYZkgjnbBP5aCgaHGG3Qor cKgerZGFdqnPRSyYPjLDLhzANpxJFs9ddsUIXTBwuIrKL2FNWZxm+nmqGQZnZ/9lDc5GCN6gNEC/ g6PnZHap4ADUdLiIKNEycQdwXzy/0TFd7HcmcQW3wV333bdYoR4NR/ucTC6oEZWFPv2ScsyophXO VmiPbvAj2hZyKqCiLWO0YUHRoyz6UwNQ16ahngbT9TJpOabRaGBEW7EvonpE3U4wnwXKaFypaBvs OM4OD34aZzfYonNx3ckQUVTRtLxUO2xwDSOHGR4sjVFpmuaAsUjohsbhDEq8jC2mR5HTa8ITGVGP MIBDAS0VqApzmt3T966xZu4xhFsXQbn9ySXdy/ncaU726cvjWrwYtEdUw+WxCQdnzAjdYCdhq562 Dp3WVN7EOZ7MI209cT2KNpmXAGUn0Gt20Sv7aqW37JC0J16b7e3Z4P3V1NA0tD16EitSzsVD6ujJ FbY+ygDIe1Ndr9XsW60AAaOOOcLhxNTQ4prFkp0aM6Qdt7bFs8gi2ZUtLbY9HMLukryjXh6lm+Xq ODtZYFP69HtxcehTbFJmney7hkZBQZFTiPEnRf2tzZsehui3c6A+fVnKRNXJYkjnCrRRP3B2i9TF cPNoJHH2IQMdZ2gX7uvEIp9Zc/kcbbDRozzggGmfKnHIq2m2Psson+H/Q6PHMQ3QIx+TLMQOKNA5 irjEA23HlTBurWnIi8W29gZbd1pdoPvkDdathIkz72jALPerHruwB+yyS8ipC5SFHLJ2RCvzyUOL ETHh4zVp9O/97GEyLa4CDuE9nZBEfYwYNTQ9em4J/EvUHirSbA2J+Q9QKmDuuWCjQsy9Y4XtzNcB HIFB9K6neIMebMDFILlk/RgxgphC9/cWe9Ha1tzHWUOTRe2toHDRG1vTxNzPosYZzBgDmaGtMAf4 jKyHOqCuaD0+y6cYzLR2vDI7Jg3RkCZD7TLaZTwvpEcYgxf91URnb9s605CXFCgP7Zwtyzif6Ul7 PH6IaXEaDI3F9xZHX8SfY0Ly3/KJ0Nu093EmQ/foNTQ1lQ3PCnHcLv7VMVKyojGYHkVJUdHUmBpz 7x1rku4sXqDzHge9qSmU5RyB0QEHG/QzjsBoj4MRI48aMBgxGlG7EKBXVTRj2mUmjmrkxniHM/GC ejxBIGLXy3Lq0QSNpJOmDZ6agEk61tRZzlbaCSTamvqXpNovNOGN4dbOtExLSwOnqmqx5DHGjGmK YJEoM6hoRrTJ4tFiC3KDGlKJAa5E71GNsRmZwh3Q2IlncYop66rd76C6gsLhDCYEIcQyAkBDY7EV DhC7r/xEch2q1gFFQdU6ayhK3VQx6aNh7B1g2lmb1HOytYLwUOkLK6jcbA/QfcqGscVKzLrHtFgf 2K6Ufo9JTa2MaY+iot2jAmxTVKM14eb77NfcdobdDDbZsRFrWazlTFo0DGdOsUsIT/B7DGXJdbHy SY3Zp169aHl8Ytz59cqaWR+knJwYtsfASs4uSpXF2Am/0lL2oFBJucWxIcOaWgcFF9WRNJGtS0DY epOiiWwtcGWmFMkn/tb+6i8H7snz/KovUl/7BLGoaGHursys8Qo1ILeQsk2Fs+XYRsXFNHz8b/iH 96Tx8c6Cp10j+B58+poXbmwxABra1A/SdOmIEY2DLcoVq8ObfqM9ZHmxrNNjq21vqnNlzNpQHi8q 7DKU6L1z0/9TSq21Ya+leZkNka0f6tI1JeUxjrUg7OvxFgWosIq1gknKYAQIbE0UutKJBYVWU1Lw I++sPvLOicy+8IryqbdvabQwd/e1bGgGIrmTvVnYWrLRkku4bdwfvd7/7R8+0B5/gKSUev4Lcx1D XGSVk1BPTdajBBxNQdGnaJevD3/yS+tnZFJDTWdZXGNYBiIciterHnlG3ilzMP2UKD611jMO3ftD sX2znG2tG1J7yMl7MbTD4/YZ5VSDkNPWpVFMkuvDqGa/xwYUjtFZ9qtq8ctYYwELd3N6TANG5GVO XlCYiBF9QCbOYCzkqBG1CNcMxEJnqc3K2pbOulG8PzEmQWZFjXG4JkIUC9aRaRyY1kcrqfXem4am 6tQE+MejL35i7svqDJWHHK1xQEmRh1KWDTCgLCgampbWoaSYmBguK9oae+dd+hPvW8/ZDsaMK6o+ /ZRym0HNeMSopd1g44DxPqOadosNMTKOaSraAWXiLQ81y6zV4LRDgW+bxf1rmtlsAzo2bMC0WBNg d6JZznbWVTQa9rFDhg40eoutnLymrqlzzoqNqaBQXAA4Kqg04wOGHnpsA0OamnZZQLO1bkQjw5DJ CWwWu14WrxIabBMsccphJQhEgUNZrPg7HHZ1YWLvqbENrdzfhRpc6T6B5S1+PHRKqd4A03qxp5pa Os43438StdeOnMj+2zt6gIc+eY6OfegM3qMI41Ic0DbRwm2xJVmPvKLdpwZ++NnmMNWcq7q+jxbo U+4yHjFSuAxaWgs9elAe0FS0DrfLsMWmpN0RTVLK25XWEWudR7e1S/DatF7inyS1UdBglk9B7XSc 0HZWBG1SaAGQjqMejlvaMXUymrqYlr1PZTgNaHaAPXYVbHMcOMU9pzhVL1l9upSwsuTHDzH71BYr qk+3P0Q36pGJuM2hRyYJz6uT2JVCYbvXp/tYrMN5nMM1tSMGQ0ocWQr/Fbbu3T8r6AMmpVTR08cu yl/8nwZvvXdD0hdL8i0GGp3DFsUGpZj/RD9paMaMbaf/PFSixsFPf6/6zIcOVaB1f3doYYcdYJdd GVAB0BYc7oCDMWOF0g+5RhbisOXTZXGZD+VGuCbRnDNMTdAV6E02ALF59elnZB6lyUuOAC0Hjl3N jmbnCKU4IEecrg+RDJt1/nY5WKQLIJI7izpJFnnaYgk1DsMPV1dnEF2ke326T1ITFeQlZU8D46GT TKSkOBLZ+qGrWp8X6uU/2+tt0Buo/hb9LXp9+lvqsouLK46rCtMnB6qI2QYMDIxpSwrJE5Ukf+Hv ZfC6JPuZH3R/8PpzcI1cyA5wml3gGMcyGDHKOiKpoBC70wYbhgWx+GtJKa1QWuuuyTzLpwQ2LLCN COUlWQGdAMBwfunzoKU9HRfxGOxme/RaTEWVkYFSaMe9onuZ6MZrogK6TMG11o1pc3KPMpgam7KX Rbq0WNvx1ERYbIUdFXisw1nIWVNZ2TlvoniW69N9mhbnfBT5yuLTOjjpTeXLDUBVwwesri8nnfE/ /9us63ZJZKY1NmFrYMTI4z1ZDQZjcD6adLrSuiTLyfsU45bvfMb+R955Dqac3kaxz2hErdEDeoZR FYKNsZNWhbjIMfWQKifXqBpTR/+rRuuo2Cwk733beGtCBHZeBE4Ia2Y0V8+TNXQd76ZdafXDT3rF 4iRiuCBvY5dZlEZXjIEBmw59lqFcUwVM1s9iwb8VvJAHwSw9lSXOlooZhFD0ELahJbevdToXRjSt 986orKCB1bsjeO9rjOle3xq5T9e0NMPTpvUpBwmohh5WBuA9UJqtTNCl9NiS/AgDBSNGPdDkJrhR sxw9CuFWYtuZkhS//Wv1z728qcfnpgKPh80IDzjcuBNzYTutamgqGnlej9zCXqh0nMk6k5E12DHN soiotnGm7fi2vKfDtUpNjkVNDG0wk2Te5H1ciUY6VFKUFBbrUaKJb1AodEGvT89iW5yw9VE2FTlU FVVFlZPLcriCFTw+lQpQqKRkKMjJdFgorEJpfAaGwNZivxM2jUJ9lTBVSnm0My5dn+6TFXahE7ub WgdTxw8RKaUK8pnXmA+3yNEeK1kaIrkFT1tsjUvGUE+WKom96y/df3xPHo4AACAASURBVH1Zffet D9VGTbI+qFjbaUgLbFFqVNMZ02KlDbm/qauhA7JcZLY3LXlJltOMEacv08gkDUryqwO2M5rrixfa EAdcpBA2QikGIxL3KJvAPkNF1qdfUe0zcrC9MnjXhhi6EhhRV3EkhLNVtKlnkMXSE8KOclnWaY06 hI116vp4H9NIOI733nfBuhhG+pvK+ynJ7R4q9oBOEfFE6WtJ3o+dOaZtYMCghorKA2QW2+KzuOgL OMnI3vYH9sf/1Ti5Ts+ZViowDY04cYleCGHlLUpgj9oGh2iKYV88TFIOybQ+svWEAsYoJ4aRmZRe VuDvme/OhUB7jzGR2wryHA0MqS2uIPMB/6mCvKYZ07YYTSaZJi6YWrN2eYEO8ZuI5O4GxHkwUsJL NviQNGYXXiAvnW1RmVNKWaW8922lVuNf771xpnu9zsJ9rPHE5c/7qeVMVj1Rw8t+OH4IgXaY0lOU 1Iy8Y3lQZAP6wIiRwWh0RiZwzsRA0BoUpUU95bnmn42Lt/6G/X/+o7vn1nPm73rcenKFajAGV1Ao lME43AaFQqn43PQTYesDmhaXh1KMxmLt8hQNQAR2XijTemtoa99M2yC6gMQ0E/1yxk6SdWLj5jk7 pCHqKONydI4e06TmC9LokW2z5VB7sdJFE7bmkHpcbp9R0yxW0r2XkuBKdtzRFCkYX9ZWMbnrgsa7 qQS4Cmcp+hIxI+lxazyx3kmnyBqAaVWhfVP5ppqKZhLYncKCgbb2EcAp0/hlsuHBIt1xTQtPqGhr 78Y8ZhTAiJGGLUqLAZuRWXTiMAG4DXUOkD33xfnzX8w7/8y99lvr/dPnwN9KBXt5QVaiiZjeMjmf oROSFKPWAQ2wRSFs7TE+mtcWUts4UMLWos8kmjePCDKRACmR3DN27kRrdKIcXZIV5DMxzzlZn15B 4eYcc6lC69oujIqIzlihOs+1OINYQuVcScwg8zNhRaDCgxLDcBjSU8dSDHsBWayw9VEGm/SjNdN2 U9oUPsXbpNpxX/NM/fv3lY975jlsGqEzyQQNrpb0LJicrzrP9fjI1mWPXOxRxHCJFdTf1Mzhiiyn N5g16SZkkgBJt1BlF2ev4mxha8DgehSb9DbjrhElvRbuZfcke8ntlKSOiZXvV5BH5+R98pzMYAS0 Rdy2gLKcvAwfWZhEq8iLiZd1MSnS/hyJTeV40pjIu2qOPj9srZQq4jYA4hGzWBU1wu7gtrTC1sAu VQ2GrIa2s9aLTiU6TE3d0IxpDmhabV/3tvwF33/Y5EWpo1CElFCbnlV3mNtNP5cOzj6gHePqENOy dJASzgaKnip6isjWMOUwF7qfOLtLBufwEsxdTsSqFkbUczslHVJUx5v7AmOCQ2vqRx5vrdNag0oL EEwZL5Wa1JpYE87h6apQ4oIxbsFGmilLusv0MqOSBeohIqUoyTRFRiZSVuDppBnxYIOsT9/DWUbN HM6WayxsUGoY00RHBNajFTX2u36Ku2/O3v3761e9trUtFpyPrnuJglShepNz+IIsDV+Lk3D24Zzu tMKmScTZiZJ1rx5NneySsETC2SKtV+HsqRcL7pJMdawCedDExc7d68aE+nXZE5MrvdQBspKl231t h4sqnQclqENnmNbbaPVUWpnWm0aB4hylapZjWq81OpvqrJm7BNGeTQRDlpPlhwl0uz+klNpgIyOz WIPJyXPyhZxdUFjYC2VGluJsYesGMoqQvqUmfqDXvplnDEZdpWIhaa2ABqMhJxe2LikzsoamCk5i VU32mnHydT5HbsWTrHFSZDW1J4Q3RXPesvSibtB2iC3pcPaqhTyhCxePJWZSIvKAimomPuGcKAkb h7PeykfiGJVSqarYjMCGIKRDwO05avxyvcA1YjmLZZOjKzkOswfhAyeR2QazLOrGYseMCji2EmdX NLaDs7Ppkc40z/qO9YBb6eC4S0FEMmSi5d//l7xflJ2DggBr7dkpOmrOZZADHvPA369bBpyIdGeK 5XX1Re+9syKtURp9jvzmvV/WR6moRV5ODHwyo4StxUr4UFBd2Re9cHdrJxscVVtH1GCHctM84n/K vvq67Oh0VZA21JEaWDgIeWLBnq07fty6g7PdIoT4nT/JH/3CmlZ55xWqJHeQwKbUV1CoPFRTechj oe4fzQ6y977BATkKvMMpnEanDPsCL9uw5uQZRROnb0ZWYypMSZahDcazvLqPh07sgUZ3p451AVu3 xs2sRHJDpZMtb9WOgMso/ZZpSG3bhDqmkv5lJswYpB5cssb91ZsXZ4mXvfzCy8vv+okj//qFG4DH ZlBjFtqz5Sdtx1ewkK2B/oDt42r/9KqXstY3GDGX5miNDqZTvI1AIHvAnB2Acrs4SDVhkoRPZDi6 jGHj+UPZRnxMr5LCdhW2xfpOGtXkvtiGZkQ9pLE4HatoWuwKCKxTIur0Ja1x4wNrrfVY07ouWhAz vuiUkoDovbeGBcrg1Iv4LpFCbQy2VWIWNQ22pRp578kL5T2mCR/pVoGAM6nEnx9qanPnzaPXfNPd 11/yudtPO8FHllEPtil7kGN7UKLtpL56JjBd4fLlFrdrrl/zOtZ6i63D3jeemFwjcW82BpY9wBd0 Fu+mClKKXc80eDeFpGWk0tekO6aE3+7cWMrZDW6IqfB13ImkRCnUCHOGkXzOMq7BU9Yx6HQzuKDa tuPrWUhRWgO0LXXFeORGQzs+cN5LeN2s6iDA+pw20mXRuKb7dDm+bTzQH6hsST3uc8V5Dzqdvqf6 l4+5p2p8RjZgcIQj/Wmc3fHmZMLWZTQaLuyyr3z2GnHrnJMFIZuEDVuxzM6cf0CkALwPq2XyL84Y c7uWvimBbYDgJz4UZ3ftFTqydRPrEwi5GMFYUvbIha2HNDXGS/7Lci60PuolKljTRKDmhepvaqXU TLitNXgXknnPyRoyc2n3PkS7aV6SF4vZOsuDkVXsrP+4dPLu6t99255kaexRd+3ZlWgIoS6ccbS5 VOkFljD3l/yz9U9cuDfS/J5JD5CUpijVTNCInO8KlBSgNuVRzwNbzzjkFwii6BoUhyrgPK7BOcjQ WzF9AzC4MY2j0ugBpcFLLblNcos1y9Vn571SOJxxTmmvc1TmQ1N81lTOtB58N/9HsPWMoaqtg5t+ FXm8n+igAsjaOoRlK6XkEd1yPF3M948uqmfo3X94sNfpWIl89GHPFpv8AzqEywe8J2/d1bYd7srr 1gkIr2tosD0yiyTd2R5ZSS4Fg3pkM5WD2uADmaXWrCkllBVICMOKDk/RI13gkZVTgCTRnAbpggap cCmWQ8Vq6hY3pPHRwJRSlHPw2CoCEoUagVmZoZijrCBgi9ISbaeUUm3jxAShlLatT+YIa5Br5Ktp EPyQl+ttzDPVKqT8SlZ4pSYLRbezupgvL5RMp0PK7MuuzWVR0ZnOtC6KHGhbUxT5JNZNURST1UGO 27aVqCyhg7PujpsXbD9XjeyNHxs87TE5IBv6mFC2D9vxD1iQl/A+JJvoDKdcWu68973NIC+WkbMh iMigRMGR0MsGGzOeVHdXUvlqnQe65YRa49ZWxzSNlzJo8/mOws2i8yTvejdyVdi67K/LFtOLzHwr SKM1mXhWN0NhEPHjpDIYC8jirHdK451q6+BNBG+NV0ppvSCCbwrbKF/0gra3FprMuK9sS1aQFxOl W/TuejyZRSk7IyuCneSQwvt3Pp0XoENpQo6xBZzh4BhbabvVPCYXCvU4AozZAzZCGt7ol9973797 wuKNFf/shuZpP5kTEt663pwQCiFSXCvtfIxE6DlrfTsKwcDEpJCiN5tk1SXnPNG6ZwIr5y00GAUD cqKnPVxP4GnrfF27JJVM67Veil9M46thGIveBkA9mkCLmbETu9a8FWUeZy8YLhVLWKg5C/8MaXSE +yh0TgYMaVqcRhVkerm12VgRbOgMNQWblHcKyApvmsVMG2x/SpnmUJjbuyl1RNgayHKUVmI6n4Fu EnomX88VYffC3tvnRt00QENjlgeD3/7p0X0YwOOzaG820UzRhcJa+RCzb30zxvuAZVOn9TdVM17V gV22TsdZDCccTUsuE6V1ppVVU+ve2j7M8jAo9XjaN7zOE5c0zjU423vS1jCyeLbgURlKoVu86VSD VaiSTEesUmNkG2kxOY1oV+RxZZkWYKgUSk8h8mDRqydvKBkAosyZxkt9CcES5SG2qM5yZiq0iBiW AS5K5b1PBuy8UEohmXnS12KT8u5QWpMm0xTNJHezXruoWEYmFO3WLaNd9lvagV5a1333ZJSF+DFW hZJxzkLrvbPkeTDXOu+snQTYFD3l7JSTYXXvee+CXwIvkdkqHo8xFm+tzzJl7WSty3Lq2itFWeoy qi6tce3KbshylAplQ+yiwOfFeZBNF0CGpTjRXCUdE3YJKUK5ZQi1GbzFarSkcBLMSc7gxAusYuXS HK9xBm+X50F675t6gvmsmbCRaX27yDuTF+Sl6sakizcxL9fAbNGtBCsnPCO/FUEueL0r19uoyuSF Ejs30zXjVlBOLs2Pxe3bFIywjBqaOuQO9hxNS2ux+83S4tbD04mzXUNgK49KRQbbVjnrnfPeT3QG 72kqscp3WrvypZzz1ltCxp133mmFQhnv21qSu5Qxk/xR4U7xss2gkVWPCddMxT91SSzZM2jQNpPy xGkydGfFHGe3k7MyH4ogrQEXHVqZFLS1qDZMAxRKoX0szis5efcjOG4WV0XgkZfMhP+nQMf7lxMw I8jzUs07z9v4xBV27hmqMWBKaCAjKyj79BfmX9hJAJlW9GrqPXZNqCK0CtRXQ7Er2zrW8PadjvLe O+fs9CYBywLTV79Ulqlk9Rf9XgSFUirLlTXeTu/s5z22FROquh+DkgoEd++ZYlbzctprMwbobUyJ +VU429ogrRNbAy1OoQt0rJ0uhYKoUaDiFlKesPNQyl88N5KCY9ZMZGcaLZjNIEpsPWPdXEYzgalK hyCRiZyuJ+tGl7KcojwsWwMWuxFLo0hdm2VXusm+7mh0j15La5br3Il8cPFONifPofbee7ox5cs0 kODe8/J2a9y3EsiTmNt5sRT5LA/MPaPDCFuvfYWpp3SaIMxtO3npouCm9GrJjJT1TNTN+QDu0JKZ 7y6gEeVBhY3MlGdSrMGHUiRSUjYAcRf0YuexHhQelEPPby8SbuJoKpcSkqNhJFjmkyiNrqbgEp+h 6iCcXJtfY9rJnmtZEQIGQm7OdHyIAJ70LJkPsm/s4Q3b4uLOyBSFwUt96zLGlmUwoN/E45rxPqOZ 6I4R9e6ZpVVpnHUV1pNlqMq13vvGM9oL2EwY15rJjluACFeZt9bgnBf+my2qP/MgQ1sL2FBZjlLh WGc0lbcmVC43004GwTzWTMZFqVUPSgEhiUdnfM9ZHlYD007GC6ZweTJzJZqX2b5Bgc9RDp9qHkQ7 bBB90bPlbVwQhXx0g1XOe7fKni3KcpiaKlQCVxqlMTFDcR5dTd6q6XTEuoLU1TD0cpbj3cRPO6+v dFcGqcySF0QNWR0mYrZqKOIoNjQ1oXKs6ViZauxB3GWhDUVaCmI2uHC580vnq/dUzoOR+oOynoih d0YPkWY3Fbal3KBtJqn4UXte9S625eCsB8q+dzaZjSfHSnnnFut8XUGeIP5C0jpAi/n9aLotMS2j s6HxMPvQecvsLOOYJuSTWshQGd5G6ZJNQp28Rkm5x3SLVF1FSrs7u7Yo2WShkfntHd7hHNYEgSp1 1oh8PG95lUE9ZE6kmIeC3TT2TlYsaKesvykPb+3M6dK4IW1nbs8RmClULKu5Zg4lyFH0BCrM+i+m LyYrvPezRVS8X/NqpmMqTt6QmeOFfWhNQHdFb32YT7ZydiVq5jLEQv7vzCvEGTTH2TVA2mRDmFuF HTvpFsLL4vI6c9sWjFVaqyJDqcW5+EpjGu+9CI/Qv9OxqSomnIc3WQGm19ZmV2oBW6fMZ5kYaQTE mJhwfDUElKzjaxIuAdg7ZTe3fBbFR3k4th5PKtNmkFmwdtV8VQqtMqts9Mv6+UoGMySQr4yuEJkM K3bDkaesZms51nrWCCbjJX2+Vu4c0ujEzMCt+9V8VQYqR67ReFANyFYELd4Hb4IyDu99lvkM1Y3a 6AZZW+O8X6qg5IW3RnmPeB+dxbTeWXSWjHSTTCGBU3mxIBTbO0y7Zgsf76mGlP0QPaKzyUPlOC4v HibPIrhzvTWUfXQerlxL1TD4SlpaR1vFyZlKPHoo0Bk6HUshPIfX+JpaEirMkmLSAMrXlbXGtnVA z0pN2SJEF09+9O7Mlxqz8u5Au5KzrfFtrZrKm5ayz8yxtT72oerGBUiwcdFTs+hoyVPyguoAOq6W 7hS1bdhfnY6nPS8nEa3C6OJ4N5085wUw9s6b/RWPkO0DPRGZGBdqzaRsbu9pnE/4VetJGrP3yrTe VUv1BlF0vE8tDu+fYhRlMJTCxgjdtNfOPK0eHmlUKGCisS7cfOZYRU9kcrZ3UfXhK8Pvn/atweVS u3oy21PNkBIUqo7HqV74gNzg6xhRVC13DeaFb6rQ8miq985OtMbuYp06U0j+pWMi4GqZ3daMD3wa i7b2zgb5Ijb+2IfhWFhQ+rCpvIBjWIPoto7R1hP2nad6SD2aRENAKDaSqpFMCm83kwm0YH397I0L kJHWwSIzv92CsLVpqUbhI+qCziiWuLiKnmgwHuWT/68beisCQKz3yxg60Wqrn0g1caFL4xcetzVt PfHxQqgAca508nbnPd6HPsyjSi250hshjzADMmxDMwzZXxLhZO26NG+mDRpKhYhc0y7mnu460+0H maXnuslOVqAzlF7ah9HEBBKb2gtBwkVv6Vtd+oipvXeZVgTtEg9O6gR53EzhERZy9ifeu7hzhblF BiTpFaR1lKzRnh9yzpdVeUxRBEqhNHkxgVCmnTJXHYZWl9vzbhVDp2Nk4LPQgMU2mUM06Z7byAqf KbJOELP0lgxu2vXL42u8Rg86MRgScZKTFcutwkleRDMzOlN5QX+TotdBBQ3VcIrdpWPlfVsxNy6O uVpKPooAFvWhdxO2TmTb2QWwS1pPpamnltcH8bO8XOhqtWfBAH7mA97GfUDyHI9AzODE8k5mrRIt QWe0ErLQiYAR5JAsG/OUFb6K5toQM9Bg2omAmcEe3cStGTo4u6bcnutEh+XFpOS78HGbch8LdBas S7I6CU8049Aqa5YuQV2669N+uGuzAqWUs8EW6yy9DTXK2rp1zqpe39b4eKz3aaXgRrlBC80Y723R X/pWWT4BCUBagBNkEmOF5FjQWdPST6QfTDMbRTTbdSYYTGfGsa3D+CZLc0oRSHzv7Ox4LXyfwY7o 6NOBqXMDLSMoVloZwU44Rpg8TNcnWcDZd30aDWWJB2OihTz6XETKCoqaaYc1zHhVlgXcbO5M4jSk oc044niNaSYO1eDBUUsn6J03LT6fyDvSLJoZ2uTr0tmUNFJqcqWzKbssOL1W0+m7aGvBY15nypoA QK3xsSKPl8oT6VgYpegx3p9YHjaPLX1EXlINF9hAmwrRd1MHBpv9dOicjzv9jffWaA5pKW7rqZtM lKuMhO8TQwslT43E5yyDlJc9Mhwsk1zyL0mIlBUmWWyFhdKds2IKXC3g7DN3hwMvKGeMd+Tlqp3A l9E1X7b4/CMeF8wgiZQGh/eYemLn7rZbqdCPkxduMQ23fHBNGxZK9GR+UWoBROtSsi5lOf3NNc8C ztzj81KBMq131oMKoDOWfJin5KLrGtS2jy99xGB7sZVGqRgIurw4WOpn4NYb17/OCpI+DBLKLV05 vZ8Kypuhp3874wMAbydgz3Z8F2GBLWOgSEcZCz5s8dEU9DYYdbaMXjCkzZhbbuTSawFMnBnnFNsk AAN47NctvuAxXxOwR15M7L3SQV2Tc/KfC0kw90QqtDjDzR9a0xhZChb2e15MSuos/XmUat6zsbXq SqGTt4fcH2eVVKI6JDkngaYATcVgZykaufaxq2waEniTKiMzh0cFZJqGf/ibw7ZtBYmEUppMz7Jv wtzWLLDYln2e/T1cfHW8Tz41st2bJN5bZs8WtgbO3jM5uXhU3/oGvuN1YUERSCAsLpJb8ElYC8xk UUgezjScwjozw5CXHDkRWu8cXvaDmJ6jyeScyLTYCFEEIzpDVnDvbQvfYEKCRsr+pLWJlUXqdJcw ObYmHMhKGqycjvIQ2x7sn+bgTFBIyin04vOYnpMXOKvqsResn8CuXJDYcb7rhL74yRN81aUp614b hFzXWDZpige45SNr3sW0YSBEuUoUZmC0G0r7Z/R+QfzCMKJHXXot3tHb5MKreNRX8civmCmQtDhk j2j28Q5rqcchUsA2oZC2UD3GNBO4wTLOfv+f8u2vnYyu93iHswENJ/nnTRC9glOFBHilTMwX/Qi/ 9r93bq142U8ELS0xkOlk1HbPd220KRTGdMbv5g8uHuMu+a49O0PpMGALKWwA2QQJKiBbBqCtecTj 1jxL2nznpzh+6VSdeaGiF55b9CSiiKI3pWmlr0UPbzhxGffcOnv/vGQQE81E7U493+0Z0SKKPvVw MRLQGWc+t+5dDAdnYM404T1NhWwg19aT6VduTBojql7oZ08z5tv+D8oBLuL+ehh6OFGa4TOjM/Hg jINHhghIUqQUkOXsn5r8ajFnf+4z3PpRLn9UWESSy2oe3s3D30RicHjyC7n04bz3Ldx5E1ddx+Of y6WPCG0ietS7ekywTGXimMS16OV+1Lf9ytJ/TW7oQl84G15EZ7h1aUiy8swAle0T9DfXz6W//2O+ /uVrrkmYWCwzIurygtZNsPLXfSe/+Z9mgzxf9JrOV730Xbr3X0h3fnJ99G/XdFsNF/eY9xNT44y7 PvGGcGo5IMvxdtIwcesmO8FhqBslIVl/IkHkvMxDoaUY81d+gB99G8QJJAwhZcFmlRKFzoJ1LMFW YWspb3D19Tz8seFlJlXFYqyI0mRFzMyJc1Eelxeo3uTkDH3ib7n7M+v7wnvGe2wcCb18SOb2Dtfx TSZ62U/wrjfx2Y+F3RecxbnZif13f7Kes4VSpdmZlojkvv5pHH0Df/VG7rkFnXPlo/nq53HldWFJ TKvQindZYel/528fon1qKnxq4X5a0oBlPSm8UfRAzSXFRCf/YWJLupSS2FMya/q7d3Jy2VLO/uR7 ufkjXPrwkCUh3CzxYoK6dDbluRXvhpTuFTu3GU1hjIAKIo82lfjqZ8/Xo4DMkrOzHWNatKbohbmh NaM9fu+nDtsXt97I1V+CUmQl3mHbcNwdKmswUYSEN3K09ZTPNcu57FF846vCsWgRwI8+b2odvOcW Rrvoua410eyaDsKjW5oqSJ1ODCpKcdVjePGPTrnGxvuTJnXfRdSJQ6Q7T/pkLYk11jm8Xbqjo3eM 9zE1WY7KJogoWUsTiUxLDBOAmSZFCqR/zRg05XzXT5mFSovhWCZGU02Z55dytvf86HP5qfcGF2PX TulduIWzk64UNm06icczzt5UNYKo2IpiKq8hPaLj+a7dJ9nC2jo+1/B/fd+amIcufe5TXPEoYFZZ 7GpFExttHrg84Pt4Pu9hmhBLWQ6m7N8z1jzv+N3X8exXzDaju1vDVNFkj2koN3C2U0pTz4I02wT0 PC/hBOzK9DgMvfcPDyUmRbNCovkcZn7rFiDa0Wd0hmX2qK6jQLTbpIPKs2ZdmHGdrw4m5XKUDheX Ma3GtNz4V1M/XOWgPDjN6//NgvPJ4SRyWsLzz6mWktZTPvlECUWtgIB3fJLXv3w92O3SyTsOe6X3 tNUCrSudJ+LF1fSetwQz7WEoGfu67G4aqoPJpx7OSorZm2iK3qHibOsR7/uDQzVMZ7Mu9IX3X4jp TUMzXoX3unh19qEdidON7ureHCg3piJgP/m+6fssfTIAH/1LbnjVAoAlzN21NR6SsriCtzXVwcTQ o4sQgW5qmiVRUE3FW/5P3vTac5DWQje9b/01U43M6W1S9GffLssPxdaAs/zqD57bQ2eE6PKUmlW0 wlmb6Pd/5tC4thNnspq5mWu/aHXz5vyuKDTNVHURCZxCeGMYPqazR16WijCWU2yd5XzmgyEUNtH6 UXr3mzk4zct/fnImeJv1xM6d3jYZ7MKVanJewqDFmjavTCS8OEMCSUcHvPO3+PQH7ueWYtWQj76T L/2akNkaLPTNlAWzm6snEroZh/THmfPzk27hsnvnJ3njf+Yb/rfJmVSmsFuvsEsp0oNFOJVu+ISZ UzrdlJ95Gb3n9/jcp5f+d4bahtHegvgQgU/prWXEZ7bCKnpBExPPke0Euk00qHoCz4h5WDO8kRVB u0ua3iTxLwaF24a/+6PZxh8KQ3zkHbzm6/n+X2Pz2HTvu9BiUYG7YRghDjgLRhmZwSnsDvB2CnKl V01zIy+oK/72Ldz0PnbvO0wzV9Ff/N88/MvobQSeJioGRL5c5rWR7IQV0Z4rRPhH/4qNIzzj28NX UcjoGLZFqiWbtIQpCy3Dqd2YENfpw26cRhqXGfqHd/P+P13a2oXPEgg03y3E7QtTNJLwZWp/VwbZ ZmI47mb9iZiDEBaS/AYznrLUaXQMIyQzWs7v/cwC+HpYdHzPrfzQ0/mG7+drvnXqvJjSumwhCWAy tyS70blJOP9h6LYbef+fct/ts+vLA6F6xA2v5Dt/iqIMTBMTKWCJ0D0MpaSyZfS+P+SuT/HiH0Ev igrKiuACS6n7CbDKEHahczfgMe0oN6NoCnhlOj5E6IN/xgf+/H6+5gpKOHhma/TV1wsdxt4nPNMb UI/CYpvACTDa461vWKzSnEOUk/f8w7t53x9w7LLg7g/JAxri8jSVPaCD8zI1pWtLoVP5tzsA3vGB t3HT+84ZTK+ltubjf82jv5qyA6ATc89TEoHLKLH1e9+yKmNt7yTv/1OuvI6dC6NyooHgZWij5Scl sxFTtRObCokEzfJOTEicnHKrpNnbdqqUijH80ev5zAfWddAc58+0mQAABI9JREFUXfUYLnvE0v+K 5cTaifWT6TCbREHSuWA6U53IJ9NOLOIT37YLKZiy5ouTRGwpE0jjef9befebly6n5xy/Nz7gg3/G 37wZrbjk4cEgKIZVaUdThSUsCGyLM9g2BDA5SzvG1LRVuDL558WsKybkc9X5DknNmPe/jf1TXP5F YeyTg3pG1xFTvdarMKsi4IG/f+uaXEzT8OG/4OYPc/WXTrxdzhJSJt2UZ6CtMC1FT0pKh4Q/04RI VzkZAFsZOCn0sJkslSk++8Pv4M9/Zco5d3i6/NFc9oiA30I4bvdYh1iovAhjF1xXFinbEDQZFyx3 MrJZPjGSinYotj/bhqIfITRfBeaR0Bok8NjRNijNje/ir36T+25ftdg+oMr1WnPJtXzVv+Rxz8La KfRDdIB1bZzOBowoAQYzZqyJ08fxq69kvM9DR0WPa7+cx34tRy4AgsadqItlVySM+Wjm/5UfZHj2 UM8V58tTvoXjl01yFpetyCn8JuURdlNm0jXpQBiOaAu/8V189B1rcgtW0xNewGOfDtM7gi88TjMt jX5bT7S9FEBS9sPETtek8I0UZiOWCRt3uE3nqyGfeA9338xwXa6J0IO2J0Nvg6OXcPkjOXEFRy7k 6EXsXMBWJ3xeDPLiksgL2nopZwN7J3nnb3PPrdEHdo6bPh6e8oKjFzM4wuAIW8fYvoDNHXROkbOx E/T9rCCfwyRZPhmVX/kBhos3BltKW8e4/mlc/zTycilnJ+5JQQEsMq51L/aeWz/Kx97FyTsehE57 0gt57NeuYmgi0kj7RnQ5m2jKEC4XtoYpzhYFXVak8UHI1mlrhrsMdxnvMdqnGdM2a3IC5+mh3Xvl G1/JY54cjgPGikrSas6e/+qWlObRGX/8C9z+8QetzZ9nKvscv5Qrr+Oqx3DhVVOug8Q63XSsec42 Dbd9jFs/ysnbGe4+hFLgC4se2l1YJJoi5TgmzDRPgh1FRiZ8NlVBy4WSRTAVHWbN8koWXwjUVNx9 C3ffwt/9MRDihza2KPrB4JAXFCW6CPY1weimDsKsa1c+T116yDl7vB+NDAXeT6J2kpW+a7OUBA1Z fJEdhDs+oCTjU9zsOQVAfkGQqCLLKkmfp8PTQ8vZw5j0nxVkeTDCz4htifUh2miTf0TwWRdHpoyj vJzMBK0fakh1nr4g6aHl7HtvCxpSqECppgzeSQmTFBtiMWzxaOpsNoK0m+KQpPV8ZZ/zdJ54qDn7 vttC3ZJE3eR7STpKlRhSlrJox6JrzmSGJses2PbDnDkPNM/THD3Q7eBXkzV87K8heobn83GI0cmT qO54vDbxu5uBd57O0ww9tJwNvPUNfPbjh4ob7pI4lmcqrZ2n83R4esDbwR+CPvYu7voUV15HUU7F BkyOO9GkIqpTmc0Z/3ZK7ewef+rvpxLgztN54qHG2ULec8uHecMr2DrG0Yu56GFcdR0nLqfoL04a 9S7MOLF/J9u24JnDFxI/T/9/pn8CBjMVAtaWWqZ9+hN/oeJ5MY/Y896K83SeztN5Ok/n6Tydp/N0 ns7TeTpP5+k83T/6fwEfb2KSI/kgFgAAAABJRU5ErkJggg== "/>
- <rect width="285.97864" x="26.028843" y="78.512794" rx="0" height="284.96848" ry="0" style="fill:#000000;fill-opacity:1;stroke:none;opacity:0" id="rect2995"/>
- </g>
- <g id="layer2"/>
-</svg>
diff --git a/tutorials/quick3d/qmlres.h b/tutorials/quick3d/qmlres.h
deleted file mode 100644
index cae7d29a..00000000
--- a/tutorials/quick3d/qmlres.h
+++ /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$
-**
-****************************************************************************/
-
-#ifndef QMLRES_H
-#define QMLRES_H
-
-#include <QtCore/qdir.h>
-#include <QtCore/qcoreapplication.h>
-
-#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())
- {
- QString app = QCoreApplication::applicationFilePath();
- 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;
-}
-
-#endif // QMLRES_H
diff --git a/tutorials/quick3d/qtquick3d.svg b/tutorials/quick3d/qtquick3d.svg
deleted file mode 100644
index 3b8a5c7a..00000000
--- a/tutorials/quick3d/qtquick3d.svg
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0"?>
-<!-- Converted with SVG Converter - Version 0.9.5 (Compiled Mon May 30 09:08:51 2011) - Copyright (C) 2011 Nokia -->
-<svg xmlns="http://www.w3.org/2000/svg" width="287" version="1.1" height="286" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="tiny" id="svg2">
- <defs id="defs4">
- <linearGradient gradientTransform="matrix(1.0104795,0,0,1.004441,23.387309,76.758859)" id="linearGradient3730-2" y1="131.35715" y2="156.39526" x1="23.626827" gradientUnits="userSpaceOnUse" x2="303.57144">
- <stop offset="0" style="stop-color:#038d30;stop-opacity:1;" id="stop3726-7"/>
- <stop offset="1" style="stop-color:#038d30;stop-opacity:0;" id="stop3728-1"/>
- </linearGradient>
- <linearGradient id="linearGradient3724-7">
- <stop offset="0" style="stop-color:#038d30;stop-opacity:1;" id="stop3726-7"/>
- <stop offset="1" style="stop-color:#038d30;stop-opacity:0;" id="stop3728-1"/>
- </linearGradient>
- </defs>
- <metadata id="metadata7"/>
- <g id="layer1" transform="translate(-25.071424,-77.933617)">
- <path style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#00ffff;stroke-width:8.85648727000000060;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="path3722" d="M 149.39285,339.37194 C 118.29002,338.06386 93.410274,329.21846 78.267585,314.08502 66.239667,302.06444 58.159936,285.11057 54.818135,264.88047 c -1.962614,-11.881 -2.442596,-20.11519 -2.455216,-42.1199 -0.01051,-18.36712 0.160997,-23.0644 1.239861,-33.95521 2.529982,-25.53941 11.482605,-46.43472 25.677112,-59.93007 16.042727,-15.25252 39.462148,-23.21337 72.203768,-24.54383 6.77105,-0.27512 31.97542,0.38686 41.46813,1.08915 17.85829,1.32123 29.86273,4.01251 41.92069,9.39824 16.71724,7.46685 28.60768,18.52238 36.44553,33.88638 5.7477,11.26691 9.34961,23.29707 11.69339,39.05536 2.22754,14.97664 2.81073,44.00559 1.22086,60.77114 -2.76934,29.20404 -10.704,50.36949 -24.19378,64.53629 -8.65346,9.08774 -21.29946,16.39504 -35.37578,20.44137 -13.11053,3.76868 -25.14568,5.0858 -52.44498,5.73944 -13.81368,0.33078 -17.4242,0.35023 -22.82487,0.12311 l 0,0 z"/>
- <rect width="236.93414" x="49.282932" y="102.78797" rx="95.84404" ry="92.255867" height="239.43414" style="opacity:0;fill:none;stroke:#008000;stroke-width:3.29858350999999980;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="rect2852"/>
- <rect width="175" x="28.571428" y="19.214285" rx="95.84404" ry="92.255867" height="206.07143" style="opacity:0;fill:#b94b4b;fill-opacity:1;stroke:#05d105;stroke-width:4.147;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="rect3704" transform="translate(25.071424,77.933617)"/>
- <image width="191.18274" x="73.931854" y="148.93103" height="144.13199" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAK0AAACDCAYAAAD/CZsFAAAABHNCSVQICAgIfAhkiAAAIABJREFU&#xa;eJzsvXmUXdV5L/jb+0x3qltzqVSTZglJIECI0QYMjTEE45jwVszCcUgcp1fil3ZC2unl9PJb7tXL&#xa;dl4Sk7x46DhJ20mcvNjQL7Ed2wkewIARYIVJDJoQmkpIVarxzveeYe/+Yw9nn3NvSaUBnO7w2YXu&#xa;PfecPX77+37fsPchADjeprfp/0NEf9YNeJveprMl+2fdgNMRIUR/5vxthfA2Cfp3LWkVoxJCEgz8&#xa;Nv3Hpn93kra7uxvr1q3DwMAABgYGYFkWbNtGFEWYnZ1FqVRCqVTC3r17EUXRz7q5b9PPgP5dMO3Y&#xa;2BjGxsZwzTXXYGhoCFu3btVMSymFZVngnGNmZgblchmlUgkvvPAC9uzZg/3792Pfvn1vw4f/QETw&#xa;M/QeZLNZbNu2DR/4wAewefNmXH311chkMshkMvoexYyUUjDG9PVWq4V9+/Zhz5492LNnD772ta+h&#xa;XC6jXC6/5f14m9564j+rv76+Pv6xj32MT05OcsYYZ4zxKIp4FEVt3znnPAxD/ad+bzabvFwu86uv&#xa;vpqPjY39zPry9t9b+vfWVkgI4ZlMhheLRT43N8er1SoPw1Azp/mnGFR9Nhk6fQ/nnH/1q1/lq1at&#xa;+lkP6Nt/b/LfW+49cBwH999/P15//XX09vYil8t19AwQQkApBSEEnHNQGjfV9CpQSkEpBecc9957&#xa;L+677z7kcrm3rD9v01tPbzmmffrpp7XhZRpPijnTZDJo+n71u2Jqzjmmp6dx6tQpXH755Ynnz0SE&#xa;EHz4wx/Gr/7qr2J6ehpzc3M4dOgQFhcXceLECUxOTuLYsWOYm5s7574DgOu6GBkZwcjICIaGhlCv&#xa;1zE1NYWpqSmcOnXqvMr+j0Jvqffg6quvxujoKLq6ujQzcc4TDLkUk6WvL3VfPp/H0NAQNmzYgLm5&#xa;uWUzmWVZ6O3txfj4OPr6+lCv17FmzRo0m01UKhU89dRTIIScNdOqxTU6OorR0VHccccd6OrqQldX&#xa;F/L5PIIgQLVaRbVaxbPPPov9+/fj1VdfRRiGZ1XPfyR6S5jWcRzYto1PfvKTGB0dBRAz61K01O+m&#xa;5FWkgg+cc+TzeeRyOdx///34l3/5F3zve9/T0vhMbRwYGMD4+HjHunzfx969e5ffaYOuuOIK3Hvv&#xa;vdi0aRNuv/32JbXHvn378Oqrr+Kv/uqv8NRTT6FWq51Tff9/p7eEabds2YJLL70Ut912WxvTLcW4&#xa;CsMGQYAwDEEpheu6p2V0xQSEEHzwgx9EvV7HM888g9nZ2TO20XVdOI6jv6eZvNFonBM0+MhHPoJ3&#xa;vetdeO9734tCodD2u7k4N2/ejA0bNqCvrw87d+7EZz7zGURR9JYHUbZv3w7f91EqlVCv17GwsLCs&#xa;hf9W0VtiiG3atAl33nknLMtaVkhW3UMIQRRFaDabaLVaietLlaMMs66uLqxcuRJ9fX3LGmwVxEiX&#xa;abaj1WqdXcchmPbGG29EV1dXW5nqs/mvbdu47rrr8Fu/9VtwHAeWZZ11nedLl19+OS6++GKMjY2h&#xa;r6/v310Y/U2TtKqTfX192LZtG+644w5EUaQl6OlU/+HDh3H48GH89m//NmZnZzEzMwPOOa699lrc&#xa;dtttuO2227Bjx46Oq9/Extu3b8cVV1yB/fv3n7G9StIuZQy2Wi1UKpVl9/+6667DddddhyuvvLKt&#xa;nemcCvW7GhMVYPnsZz+Lhx9+GP/6r/+67HovBD3wwAPwPE8HeS6//HJtLP57oTfVp/bVr36VP//8&#xa;823BAtPPqnyvnHO+a9cufscdd5yx3EcffbQt+GCWF4Yh932ff/rTn+bd3d1nLG/16tX8r//6rzsG&#xa;OGZnZ/l/+S//hReLxWX1ua+vj//Zn/2ZLssMipj97eSPNr8zxviXvvQlPjQ09Jb6QZvNJg+CgCta&#xa;v3497+vrO+fy8vk8Hx8f5+vXr+ee53Hbts+rfW8aPMjlcujv78d9992Hbdu2gTHWUYqZEvfHP/4x&#xa;vvSlL+F73/veGcu/55579GclqdIuMcuysGbNGlx//fVnLK+vrw99fX2Ja6q8crmMSqWCarV6xnIA&#xa;4IYbbsD111+fCDub7TLL7kSmOr7mmmtwzTXXLKve8yXHcZDNZuG6bgKWNBqN8/JmbNu2DX/+53+O&#xa;V155BaVSCZ/73OcwODh4zuW9aUzb29uLdevWnRUe+uY3v4l9+/Yt6/5arYannnoKk5OTpzXqBgYG&#xa;sHnz5jOWl81mkc1mE9dUeY1GA0EQLIvRuru7sWrVKqxYsaKjp8O8f3p6GtVqFUEQtPmd1eeenh70&#xa;9vaesf0XghzHQT6f199VW4IgOC9j0LIsjc8tywJj7LwWwZuGabdt24bbbrsNQLt7Kj35J0+exIkT&#xa;J/C3f/u3yzZ2arUaPv/5z+Puu+9OuKlMnAgAa9euxS233II//uM/TjyvjC5KKXzfR09PD7q7uzvW&#xa;deLECVQqlTY3XCcmvu222/COd7wDw8PDievqOd/38dxzz+G5557D3r17kc/ncfHFF+Piiy/G9u3b&#xa;2xh85cqV2LRpEyYmJnDs2LFljc25UldXF1asWNF2/XwlbSaTQS6X09K71Wqh0Wicc3lvCtO6rotL&#xa;L70Ud99995I+SXUtiiI8+uijeOihh846Q+uxxx7D9u3bEUURbLtzV3p7e7F27dq261dddRXWr1+P&#xa;9evXo1KpaGs5HewAgFKpBMdxsHLlSgRBgHq9jiAIEASBvkfdf99992H9+vVtMIBzDsYY/uiP/gg/&#xa;/elP8cwzz2B+fh6A8K5s3LgRX/jCF9Dd3Y1isajLzWQy2LJlC9797nfjK1/5ylmNz9lSp7EihKDV&#xa;ap2XpM3lcjq0roxa3/fPubw3jWn7+/sxMjJyxkgWYwz79+/Hd7/73bOup1arwff906pt27YTqY6K&#xa;duzYgXe/+9249dZbsbi4CNd1kc/nO7q8lAtteHgY9Xpd43OTaRVt3LgRPT09mvlVecrf+vnPfx6N&#xa;RgP1el0/s3//fuzfvx+/93u/h4mJCc206tmBgQFs2rTprMfnbCmbzSZwvdn28/HROo6jfeCMMf13&#xa;rvSmMK2SYMvJF1DQ4FyoXq9jbm4Ok5OTWLt2bcJ9pCjNjOq3DRs2YGhoCJ7nYWhoqK1ss6y77roL&#xa;d911FwBoKRGGIcIwxNe+9jV8/OMf10nrnaQ6ALz66qvYvXt3xwCFatsf/MEf4IMf/CDuvffexO8b&#xa;N25EX18fPvGJT7ypTv5XXnkF+/fvx5NPPgnP81AsFpHJZM47uKEkLSEECwsL5wUNgDeJadesWYM1&#xa;a9YAgE5kAdCRgV988UW8+OKL51QP5xyTk5N4+umnsW7duoR0U5Nr27YeMLN+FXlK50Ck/abmd1We&#xa;GSRRSS47duzAe97zno4LBwB+9KMf4U/+5E+W7AshBDt37sRVV12FZrMJ13W1T7tQKMC2bb3tyGQi&#xa;Fbau1WpoNpvnxdRhGCKKIhw8ePCCLg7VRs45pqamlu2FWYreFO/B+Pg4xsbGtBroNACKaV999VW8&#xa;+uqr51zX3NwcXnvtNQAxboyiSNerLNdCoQDXdfVzmzZtwsDAgH5OPWuqLXUtHQwwIcSxY8dAKcW2&#xa;bdvaJKS67/XXX8fu3btx8uTJjn1Q9ZTLZRw5cgRvvPGGVslKIzmO0+aKIoTg/vvvx9GjR1GtVtFo&#xa;NPDiiy/iwQcfbKujt7cXl19+OW655RZcffXVuOiii7BixYpE6NociwtFlFLk83ntlZienj7vnIoL&#xa;LmkzmQyy2WzbYABJaQaICZ+fnz8v9eP7/mkjVapOx3G0BUwIged5eu/Z+VC9Xkcmk4HnefA8r81l&#xa;BYiJmp6eXnZ5jUajY0KQbdsJKz6Nv5Vk7oQXx8fHce211+Kqq66C7/toNpt44okn8MQTT2htsX79&#xa;emzYsAGDg4NoNps4evQopqencfjw4SXbOzo6ik2bNmm49G//9m8JrG9ZFlzX1YZytVo9LyMMeBOY&#xa;dv369RgdHW3zeSoyB/rpp5/G0aNHz4tpFa5N+0TT37PZrB7MbDaLrq4unYCzHFfWUn2Ym5tDb28v&#xa;urq62pLPlZQ8dOgQXn/99WX1Z25uDvPz8xqCqLbZtg3P8xJMm8/n4XkebNvWWqXZbHbEzZs3b8a7&#xa;3vUu3H333fpaFEV47rnndJ+uuOIKfOADH8C2bdvQbDbx4x//GE899VRHplUQ8J577kkw7eOPP46/&#xa;+Zu/QaVSQaVS0QELz/MAAKdOnUpIWpWTQQhJuNZOa1wvayTPgq6++mpMTEzolZXGsSaD7Nq1C2+8&#xa;8cZ51ReGIZrNZqJ8sz51Te2CAET0K5PJJPIgTjdIp+vD7OwsNm3ahMHBwbbkFkIIyuUyjh07tmxJ&#xa;22lzpmqn67q6r4CQct3d3Yl6FxYWOjLZ2NgYisViYsGZWooQgr6+Pqxdu1bbIwcOHEhAKkVbt27F&#xa;HXfcgTvuuCMRbeSc47rrrgMA/OQnP8GTTz6pF5bqgwqoqMSmj3/84zrvo1qt4tOf/vSS0VNFF5xp&#xa;R0ZGEhlNS0WFCCE4fvz4ee+e5ZwjiqIzMp45ENlsVkuntJRVbTPVvFK3naR4tVrFxMSEDkyk21Aq&#xa;lTA/P79sHNdqtdBqtdoMQRWWNtva29uLbDab6Huz2cTCwkJbucViUcMXdX8YhlpVq/JNWLdUWVu3&#xa;bsWOHTtw/fXXa4GgxjeXy+HWW2/FyZMntRfC9KEreKCy6n7zN39Texd838dnPvOZM0ZELzjTXnLJ&#xa;JRgaGupofQNJ5t23b9+ycl1PR8pIAZKuNNPiJ0QkcSsYUqlU8Id/+If6IJBbbrkFQ0NDba4v9fzU&#xa;1BRc14XnecjlctqKZ4xhZmYG119/PVatWtVx4ezZswczMzPL7o/v+/B9f8m0S/O6WizmwiuVSpic&#xa;nGx71lxYilSgBBDz4rouCoWCLq/RaOgACAAdhv3Sl76EbDar+6rGVbXh4MGDGrL19vYm/OSzs7Oo&#xa;1+sYGxvD6tWrdeojAHz961/v6PtO0wVhWtOqTlvlpuGVntC5uTk0m822Mw3OhhzH0VjSrMdkXMYY&#xa;arWaHpCpqSn8/u//vi7jy1/+Mq644ooE0yqf4tzcHC699FK9+0I5ylW/fN/H1q1bl/T1ni0E6mTI&#xa;LTV+a9asQW9vb4KRl0pWHx0dTcCDxcXFBIaklMLzPG3lM8ZQr9dRKpV0GZs3b8bWrVvR39/f0X2p&#xa;/p2ZmdGLoa+vL8Hg5XIZrVYLN954I+67775E2z/72c8ua4wumKRVGGXVqlUJHJSWtEotqUE5UyLK&#xa;mSiXy+lFkq5T1ccYQ6PRWLKe9evXJyJB6r5SqYSjR4/C9/3TSoCVK1cmJJRZ9+7du88qD1VJM3My&#xa;lepNY71Vq1YlpKdKmO/kTenp6UlIvDQ0S8ODKIpQr9exuLio77n66qvx4Q9/WMMxhVNPnTql57+v&#xa;r09LU0Awreknn5mZQTabxY4dO3DTTTeBMYaDBw/i4MGD2nV5JrpgTGt2wiRTWqjPKmHifLOHAOjI&#xa;zVL+xeVkFJkY12SWer1+RviSzWaRyWQ6Gp6A0CZnEwFSkEWRuQAUJFFkMqL6PQiChEtJ9cdsIyAW&#xa;pGnUKc2h5pBzrl1jykU4NDSE8fHxhPacnp7GAw88oK/9zu/8DprNph7zfD6fwMmlUglDQ0M6xE8I&#xa;wdGjR/HEE08se4wuCNOahoJacaZKM9UH5xz1eh0zMzM6gnM+1NPTg1WrVrVdV3Uq78Lp6unp6dEu&#xa;GdPwmZ+fTwQulnq2WCy2uajUInrjjTfOythUPl+TVFlBECSYdmRkRKt8pcE6SVpCiHbxqe/Hjh1L&#xa;qP5MJpPwpyrtpNo+ODiIdevWYXx8PGEv/Omf/ik+97nPJeqamZnRhufg4GACvpXLZdx8883Yvn07&#xa;OOcol8t49tln8Q//8A/LHqMLJmlVYkp68gC0STC1dUVJ2XNlXEII+vv7sXHjxrbfVJlhGC4p6cz9&#xa;ZIpRzLbOz8+f0b+qnk1DIBOWnE1an5kRpfqoonymMUkp1UaOqjcIgra0PyUB09ogzbRDQ0MoFAra&#xa;FlBSW8G3sbExjI6O6roWFhYwPz+PL3/5y4n2/8Vf/AUGBwe1Adff369DuICAGFdddRVGR0dBCMGD&#xa;Dz6Ip59+GsePH1/2GF0wplWRjzRESDvtTVfL+UpZQggKhQKGhoaWdHlFUYQwDDv+RinVTvtOGwjT&#xa;1nMnMgMU6YXaCYeeiVzX7egbVTDHdL+l2326DKq0MCmVSoncZeUSU+1Ph9+LxWICPy8sLODQoUNt&#xa;WmRxcTGBg3O5XMK7c+WVVyb8+N///vd1rsNy6YJL2rRbxmQmdf1cd7amyXVd9PT0JCRA2lvh+/6S&#xa;CRr5fB7FYjGh3s32Li4u4ujRo6dtQ9pzkXZVpXHomUi1hzGmw8xK0pplZTKZNuNK3ZO2E5Q7y7Zt&#xa;3b7JycmEpFWBCjMUbJaTdgnu3bt3Wemkynug6v3gBz+IXC6Her2Oer2O73znO2ftObqgTGuGbtOW&#xa;tLoGQKu68yUlHYB4cTDGtAtNSZSlGE95HpSKTRuNCnufjpRUXMoQPFttojCyuXOZMaZVtcm0XV1d&#xa;ifyJ020LUlEpNS/pbKvx8XF0d3frvjebTW0LUEqxYsUKzbTKd/3SSy+dsT9pCKP2hj3++ON4/PHH&#xa;z2lHxAWFB47jaEmbxrVAUhp18jScLQ0ODiKfzyfSH9MS7/jx43jmmWc6Pp/P59u2l5gMUC6XzxjJ&#xa;Uup5qSjOUsxsknrWtm309vYmmIcQgmazicXFxUQyttpmbvZbGX1mfdlsVm91MTXQwsJCwnug3Haq&#xa;rFqtppk6l8uht7c34darVCrLwqHd3d0Jw1Lh/IcffhgPPPDAGZ/vRG/pqYnmAF+IQyjGxsb0BC9F&#xa;5XK5Y4QIEBOa3jRoeh1ardYZIzRnCjmacOVM9ylokMlkEs9Vq1WcPHkywYyd3GLKcW+S53l6jNRC&#xa;SBt1ALR3QUlyczuRiUsVBUGwLFdeOp0SQBvUOVu6YEyrMFBazSoyB9zzPBQKhWVP6FJ0++23Y8OG&#xa;DW0BDLPu48ePY9euXR2f7+vrw/r169ueAUTcXW3nOR2lPQbp/qQx/ulo9erVGB4eRjabTUz05OQk&#xa;nnrqqUQfFWObbVA41RwHte9LtUNBjTSDDw8PI5/P62er1arezKk0mjlGrVZrWa68QqGQMPA453Ac&#xa;B319fRgZGVnWuKTpgjGtimObid+K0uoxl8thcHBQbys+F8Z1XRd33HEHNmzY0LEuzjmq1SomJydx&#xa;6NChjmX09fUlnjf/VXmtZ6I0hkwbhAoynY4UFr/yyisTE6nKOnbsGHbu3Jl4RuUcmHV3YtrBwUFs&#xa;3rxZt0d5U9LBhYGBAe2aUmOnoJHKilOkBNRy8gSUBFf8wTmH53nYvHkzbrnlljM+34kuGKZVKud0&#xa;/ln1WSVmqKTmc4mKua6LiYmJ0x6zVKlUsLi4mJgck0x4kF5YKj/0THS6pGyF3Ze7KNesWYOenp62&#xa;65VKpS1/wTyfQFEneKCOPlWkFkh6h62KCioy4UFaxZ+tC8+yLA0nFL4dGBjARRddtOxyTLpgkrbV&#xa;aqFUKiX8iOnJUkzc1dWlUxhN1XE2dNNNN51WUlNKceLEiSWTVSilGBgYwMaNG3VbVTmUUrRarSWZ&#xa;3aRyuZx4Nm1sqqSW5ZDKFlPEOUetVsORI0fwyiuvJO5VznmzbpWoYo7HyMgIduzYob8reGBqQ9d1&#xa;EzkChBDtkgLQdhDe2WhHBQ9effVVPPjgg3phbdq0Ce973/t0FPVseOCCMK2JlUzJaQ6qOZnq88qV&#xa;K5HP588JkP/Kr/wKgFhydOr0gQMHcODAgY7PU0r10U1pycE5b3OSL0Xz8/M68SfdR0II3vWud2H1&#xa;6tWnLUO1Q8EDE2IsLCxgZmamTYKuXLmyrZzFxUW0Wi2tfRzHwcjICLZu3ZoIdqgghRIimUxG+1MV&#xa;mUxr7rlTbTOz605HKhJXrVYxPT2Nl19+GdPT0ygWixgfH0/kfSyXLqghFoZhYjvFmdw9t956K9at&#xa;W7fsOszzB9773vcmIkRmO1SG0pEjR3DixImOmFLtbjUd7qYxtVymPXXqlI61mzF51e+77rrrjGrw&#xa;hhtuwCc/+UnYtp1oKyEEr732Wsfsp+UcYVosFjEyMqIZXAVbzIw3FVlT4VY1FqbLS6V1muPU3d19&#xa;2sWotKmSyiq6+MQTT+Do0aN6a/873/lOTExMnLYfabogTKvcKGEYYteuXThx4kSbhAXazz34+Z//&#xa;+bPCNYwx3H777fjiF7+oIzxKvajyVT7Bd77zHbz44ouo1WpLhjXVn3rWdAuZhsiZaM+ePZidnW3r&#xa;M2MMl156KS6++OLTHri2fft2fOQjH0kwu1o8S+0vMzGtqm9kZASFQkFrussuuwyXX355AvbUajWc&#xa;OHGizZdrUhAEqFQqWtKqLTLmol69ejVuvPFG/UyhUMDw8DA++tGPJr4r1a/g40MPPYQ9e/bocXrf&#xa;+9531geRXHA/7eTkpHaFpCVPWjKMj4/r5OTl0ODgICYmJrBp06aO5Zrfd+7cuaR/FkBbECRdlloQ&#xa;y6HXXntNZ+p3atPExMSS0uSee+7Btm3bOu5enpubw/T0dEfXkhlQUXT55ZfrM8SGh4exZcsWnZWl&#xa;qNVqaQmq2pk+Ukrlhigj00ygV+O1Zs0a3HzzzVixYgWGh4dx44034td//dd1hFAZ22aZrVYLMzMz&#xa;WFxc1Eb7JZdcguHh4bPy21/w7TaPPPIIVqxYgWuvvbZNyqpVqgZrbGwMt9xyC3bu3IlHHnmkze8I&#xa;9TznKBaL+NSnPoUrrriiTTqbTKK2q3zzm988rR9RSdml3FFjY2MYHx/Hyy+/3GYopL0d3/nud9Hd&#xa;3Y0rr7yyzSDjXCSJfOhDH8L4xAR+9KMf6d0P7//5n8f999+P/v7+tgOdCSH41re+hV27di3LH8o5&#xa;x5133onBwUFcdNFFWLt2LXbs2KEXi2pPpVJNnOjDOU9IWhWBq1Qq0uVHdEZXo9HQbrENGzZgzZo1&#xa;+NSnPgVCCC655BJcfPHF+MQnPgEA+iR2RQoenDp1CocPH8apU6cwOjqKK6+8Ejt37sTg4OCyk+Uv&#xa;ONPu2rULV111Fer1ets7BswJVYy2fft2/NpHPoJVq1bh7/7+78FSCR9Dg4MYHBzEhz70IXz0ox9t&#xa;C16YbjVCCA4cOICXXnqpLYIkWyD/5SCGpE2XwznHRRddhF/7tV/TZ+uq++bn5/GXf/mX8YIC8Pzz&#xa;z+Omm25CFEUdJeaKFSvwi7/4i7jxxhtx7TXX6Eyu97///Vi5cmXH/hBC8JWvfEWEStNGJueoSS+B&#xa;2cfR0VHceeedeM973rPk+9mq1QpOnEiOTa/ctaHKqzcaMo9BSNpWq4Xjx4/j5MkprF0rduoqe+A3&#xa;fuM3EvOrdh0rTAsImFStVvU2oEOHDuHQoUMYGxuD67oYHR3FZZddhocffritvZ3ogjNtqVTSvlEV&#xa;9eoULVKfc7kc3nHddRgfH8fXv/ENhBIfAwBkNGbLli342Mc+lqgnPWGKDh8+jEcfffS8dkSokOrt&#xa;t9+Om2++OfG+h9dff10wrbgR4ByNeh2+9HummVa1U6nRrVu3atwtutienaZo3/79aJoBDlkfgMSB&#xa;HuY4qA2YpkfF/N33fdRqyay3vBQu6r4gCBCl7IBSuYxSuZS4ll7sql2qHQWjXN/3NUZOG7nd3d1n&#xa;ZYydG9PGAku1Pv6Nc+zduw979+5NnIbdicnUtfHxcUxMTOD48eM4ceIEjh8/Ds441q1fh76+PvRL&#xa;S1ntTVIutjSVSiV9WIRul9FWMbgEnDNETPylXTnmRJvvHVCkomuEUIBSECos4xd378Y3HnoIv/LL&#xa;vyzK4lyPi4lv0056NQYqOw0Anty5E0/ufBIL8/MglILatmg3IUAUgUchDh87lsDPnbSOeiuNmXJY&#xa;q9VwamYG1LLBOQNnDEMrku4z5UslhACy3D179mLPnj3Yfvnlif4ASCwQxYxmUCOKIlSrVZ2bfOTI&#xa;ERw5ckS3fePGjbjzzjtjYXAGOnumNTEbEd/lFdmBCLtf2o3dL72EG264IfFoelWaTMw5R3exiO5i&#xa;EVtk2FExpqkyTYmUllKPPfY4HnvscXHNUjiU6narNvOII/R9RGGIMLX9eakFoeiExF2CmRwQm4LY&#xa;Dh576mk8u/tl/PIv/VJbeWZbO2WkmZ+r1Sq+/e1v44EH/gTUcUCoBWI7cTkAGOd4/oUXE1rMlNxq&#xa;vJ7+6S6Ac9x+23v0tXqzidn5eVDHAQtDcMYwPJrMASiVymg1W4BFAcuG7bg4cvwNPP/Ci7juundg&#xa;9aqJhPAw50Wlcvb09OhDPwCRy6GYtlQq4dChQzhw4ICOjC512mQnWh7TJgaX6hUIQGNDyEGzCMFi&#xa;qYyf/ORJDK8cwX/6hbsSE3Y6SlvE6Qk2t4Wnmf/7P/gB/vEf/wdeevklWI4LYlkglIBod5gRxaEU&#xa;rUoJ9XoD1UoVxQ5vkFyKXj90CAABdRxYmSyo42pmKC2ewP/zzW9h6+bNuHjLZl2eSWZ/1ISbVvw/&#xa;fevb+OZ3vgvL80C9DKhlgdoOQCk4AZSIOPbGSVSqVbjyYLp4fsTvP3z0x/jRI49g7erVIITADwLY&#xa;loV6vYGZuXlQLwNOAoARjIynjLVaFa3AF4vFywK2DTCGL//N3+Irf/d3OLxvr0h5zGb1nD744IN4&#xa;8KGHtHvuhz/8IV584UX87u/+btvRVVEU4Qtf+AK++MUvto3LcujMTKslm5BShFDBCFLCCokm/kBi&#xa;Jj72xgk89pMn8Z9+4a62yUpbyer3paSw+p6WzOa/3/72t7H/tddAbQeUWqC2nWRaasmFJq5F2Tym&#xa;5ufx/EsvYeXK4UQblhpAQgjK1SqI64K6nmAsxxN9th3YmSy+96NHAEqxcf260x7Cl24/IQTff+QR&#xa;PPv8cyiVyqCOC9vLiMXnuMY8CGnrt3zs/LdnsW71KqxfvTouV9bz7X8ukJBoAAAgAElEQVT+Z5yc&#xa;msK69euxWC6jXKmAcY6p2VlUanUQKcXhuJhZWMSTu8TBcWEQ4ImnnsHRN06CuB6o54HYDsAYOIsQ&#xa;co7/9vkviBer9PYC4Dg1NYUXXngB+/bt08KsXq9jZnYmESlNj8Ppvp+OCGJkmp4hPZiCEQWjUouC&#xa;UMEQIEQwB6GgaruKZQEccD0XruvhW9/471i5YgVGhoe1GjOlZSemXaoDnaTgCy/uxgu7d+P+++8H&#xa;AwexbFDLhu26gF5gkP/KxUYogijC6olxrJqYwDf+8s/F1m1jH1XnISH48G/+Z3z9f/wj7GwOdjYL&#xa;28uCUwq5rBE0G7jx2mvwv/7Gr+PKyy5FRm567FSW6lO5WkWlWsUH7rkHJ6emcWqxDDuThdPVBWLZ&#xa;QtLJxcYh4HLgt7DjkovxczffiDtuehdGVgyhWqtj7/4D2HvgAP733/99dA8MYPuVV2P9urWoLCwg&#xa;9H3s3b8f+w8fRotQcNsBLAcXb9mMomsjbDYRtJqYnDyOaq2GehhJpnUBzsGDADwMQIMWCtkMCtkM&#xa;EAQ4NT0lzobwW+AgAGOCrRS2v8DUkWlN9U+pBSJDnQrHWbYtsBaloI4DalmwbEf+bgGEauPixuuu&#xa;xZ23vht3vufd6E4dgJZmwE5Yr5N0Vfd89/s/wL8+/H3868MP49SpU3AyGWQKXbAdB5aUTjDhi+wX&#xa;tRyBF+UIfOZ/+zi2rl+HLevX6rJFVUmpSAjBe+/9EP7tpVfhdBXhFLrgFnvEQpWTFPg+PMvCVZds&#xa;wWWbL8K9P3crcq6LnOt07DMhBAvlMhbLFVyy4ypYuTy8gSHY2Tycrm6AErHY5EQJIw/gLEKjVsWG&#xa;8VFsHB/DaF8PFqensf/113Hg4OuYm5+Hk8vBzhXACRBWq+BhKObRdeF2FWFnMrC8LPwwRFirgkcR&#xa;eBjCssV8WtmsxtVREMBvNBCFAZjfAms1wVpNRPUaEAXgjAGMgQUheBQCnAmG1V6cC8e8neGBwbRK&#xa;Wqk/atuaUQm1YDkOqGXDcl0QSmHZdizRAPzwJzuxdvUqvPPqK9Fj7OY8HW5cDhFC8L0f/BAvvPAC&#xa;jk9OotjfD8fLIFMowHJcUFuqVColGrX0YrRdD04mAw4h8X/w1DPIeF6CaQEOzmN1rFrb4gTZnl54&#xa;vX1we/qQ7RuE5TpCEnGOiHEEzQaeP/IGXjx0DLe841oMdhWQdVOuMPkv5xz5XB5eJovs4DDgZWD1&#xa;DcIqFGEVuoXhKG4EiyIQLhk3CpHN5vDa9Cx2HzgIWq+iMXUSrufCcV14PX2wMxm4+TwotRBmsmBR&#xa;BM6EB8bOZGFnMrC9DDzLQpTNaUFj2bYQRJ4nNCmAoNkEIwSs5YvfHQdMzjlr1gXDRxEIg2BgAMC5&#xa;v1fhtHMPYwnEHoEYp1LXge24ovGWBdvLwMlkBXa0bUCq1WwuB8fz4BaKcL0MMsVuWJ6HiAOMcUSM&#xa;4b//n5/ARH/syFaT1um7ojQW5lIR3/e//Db+6aGvI5vPI5vLo9DTB9vLwM7mAcsCtSwhXS2JZYn4&#xa;lwPoXbsRpWI/SBQBjKF0ago2C7FhsA9rVwxhtOCh0WxiYXYW9WoVJ+bmUW80UW80cOz4ceRXjsHp&#xa;G4DT2w+72CvqkaqQRSHAIviVCoJaFQtHD8ElQAYMlDOsHh/FL935c/jQnXe0aY5f+K3fxZGpaRyv&#xa;+3CKPbCyeenqC8GiCIiEtc8ZAw8DOGAgTPz5zQZ4GALUAqcUVqEbVi4P2t0H7njg2SzguCC5LsDN&#xa;APkucMsGt22AWqatHbvzLEvwARgoY7ArJdBaGc2XdyFcnEOwMIcg8BFVyuCBLyRwvQrWbEomDoEw&#xa;lAs6umBQIWZaw+AictIJpbBdD7aXERLVcUBdD9l8AV42CzebRd/EGiEVegcAx4WTzYEBYISCEwIS&#xa;RQgbNQTNOtBq4U//5w9htK8Xo/29HY0R3bEOTB0xhnqrhXrLxzt/8UPIORa6VqxEYWglBtdtgOt5&#xa;yGRzoBZF6PvgUYTIDxCxCFEgXFxRFKFluTjeCITPkzGEzQb8ehWlE5NoLM6jcmISPBKDTCiB43h6&#xa;PLLFHmQHV8ApdMHJF+DmxEtIkq5rIRV5FCGqVRE16mgtzCFsNhA0G/jNX/wF/MYH7sZQT7yBEQC+&#xa;9eMn8NC/fB8/eP5ldA+PwO7pBfUysHJ5EMsGzxUA2wFsB9zLoWW74ISIseYcnEAsIGqBuVlwaoFb&#xa;tpxlrqSA/MwlPBJt50xc5/HQt7MJoWJBWBZIaQ6kPI/gse+hMfUGuN8C81sIy4uI6gKKcAklwJke&#xa;zwvBuES3XhoohBBYjgNiCcnqZLJwc3ktWcc3bUFh4xbAcQHHQ4vaIJzDIirDSp4JJSeZEgHMOedo&#xa;Lc5ifmYWG0ZXYv3oCD76vvcg53nozufgWGK1K8e8eCwVLTIY+rf+6L/hmd2voG9iNfom1qBv1WpY&#xa;tgs7Iyxu27IlXHFALXlUk5okzkGUxOIcURgg8n3USwtoNWqoLpYQhQEC30fEOZpBJIMRHD5j8AFE&#xa;HAhBEAQ+OAMIGAg4CIu0lOFSlXPGEPkBeBRhYWEO779mB95/7ZW48+rLAchDNjjHXKWK/+sfHsJf&#xa;/8uPkOnuhbV5G5orJtAYHJOq15h4xkAV4+nlQvT4mMGNsyWeEhzpUggATkSwwyJA9E9fRViaR7A4&#xa;j2BhHmFlURhtgQ/WbIhxjkJhoGmmPXfmteOGKQexgV+lj5DaDnI9vch394AOjyGwhMeAcKmeCBLS&#xa;RruWVBcpBeUcTjaPXFcL1ZaPw2+cwNcf+QmynoPuXA6ubYESgjAMcPHqCVy2MZlna0aZCIBLNm3E&#xa;ky++Ap5oNwEBEeEEY3IBFbWR/l4AQcTgRxFaEcNC00crCFANCHzmoGUXwGiEyArBOEfgCnTGOBdh&#xa;ZqlFOAgYZ0IISUOMMKHG0ayDBAGsmogQUdsCtygKXUXM1Zt4/tBR3Hl1HF0iAAqZDFb096GYy6LW&#xa;rAt1GwSgUSgMGq6CLdDeCj3eiegkSVxS/GxqA8IBrngcyXuVgWo8qj/rC0pLAqBbrgA9+hos30dY&#xa;rYLajsTHkfDaGPe2RVPPgQxDTLq2qCXcRpJZbc9DttCF4sg4ihNrEHT3I5RWNeEABQPVAQdIS1cy&#xa;EhQjURACuIVu9DgOgmYTU80GvvXMcyBRCIuFoBAM1mw0cOcN74CXz2PzaJxMkiDOccc7rsHf/+DH&#xa;sGwLQaOuB4YQgBIxaQQcFBwWOJphhGbE0GIMi60Q5SBEM2JohgzlkCFgDK2QgHEPzHXlqIoZYqY8&#xa;00xBtMFKCECkVQ9wgEUgvg8SBrCriyBBC1Z5HqRZQ86ycGR+EScXFvHb77sVxawIE1NKUchmcOlF&#xa;G7F25RCefP5FFFbXwZpNkDAAkapbzRUlADczS1UTicFt6d86cEzMlCaoTV3VZSbnQhmFZMsVsDxx&#xa;ulBYXgT3s2KcOAP35flhUSQfSDfu7MkihPwfIASUEFAJCSzHFREf24GTyWFo3Xq4QyuBvkHhazUk&#xa;MiXxEZHay6C+E6qvQ0IGYbln4eW74GY82J4nJBaliEAQEgruOJhv+Lh+y8Z48CT2U4PYU8jj4PQs&#xa;OGM4NTuL7hXDGoNTaRyCEFRDhnk/xGuVBo7VWjhabeFwpYE36i3MNAPMt0I0GIPPOCKl5AkBJ9Kv&#xa;K117OlRp+GSFrDUmQqlk6QPlroeo0I2o0A3m5cAyOZBqGdV6A3PlEt6xaT1WrxjURighBBnPw57X&#xa;DuLZ3S/BHhoBL3QD3WKPmRpHaOdOiglNd6JmOEgpqzwhqp3ix9i9yeMHU4BAeWASBUtIqbWfZYEW&#xa;uxEdeEkYhNIzw4NAYGUWJ0GdL8WSVjdeSY+YCfMDQwizeYQMsKgehSRpyWNeMwZASSUJOwDAcmy4&#xa;YR4sVwCLQrAoRBSGqMPCvuMnDQjbEblh2/o1aDSbOHDkKCLfh+W4wo0FIW0ZB0p+gJPNAK8s1hEx&#xa;od49JR2JCDsnsV9nqZKURObvHaQdV1Ia4IqBewaB7n5YJ48h5IAfhDg8PYObtm1JaJOuXA49hTxc&#xa;20bYaoGGASjj4DQ5tAlZmdDvS5C6p9N9p3neHO+lCuaMgXhZkN5BEOlRArUSvvGYNy4A0yZgsS5f&#xa;RL6obcN2bdD+QVBqg0i1EfOmsCg1gIo1avxFPYNYdUO6VCwqHPykUNBYlQAIfR8LfgunqlXkXQd5&#xa;eTKhmbvAGMP/dOlWnJyawk+aTVTnZ5HnHLmuImyb4I16C69XmjhYaYEBsKlQqbZ0exFCtbUcD4Bo&#xa;c2KiePI75wDVCxFK1opumiQFAE2Fnxvbb4B97DX0Th7EN37yDO67+Z1oBQFaQYjp+UUsVKuYK5fR&#xa;VyxgtlGF1WqAsgiEOtpfG9ehRxY8wcYGppX3M86EpLYdEcFTmJ9zIAzihWsavAaw5cY1sWaFeBDw&#xa;D4DjgbkZ2LkuhLU6YIXg1AZTkUjIBhGFcc/HEIOS9EYWFbW0J4FQC1YmL/IrIy4iNAkdIfslv1It&#xa;sIVRJLI8iDZcoFWtjLYR6DCxStuzXQ8ey+P/fmIXrt+wBjdsXNNxa/pAsQvrx8dwxcVbcejEcVgE&#xa;mMoXMU8aeLYSwiJE/KmRJ9JRwgl4wvFNoF1AqavGz+IjBzhVrArt6YgHQn1XC0BhQyV5LbD+YQRe&#xa;Dq899xjG7v5lNBbmUV+YR1haAAhBJp9HJp+HO7oBsF1ZFIstJ9U2ZeCkVoz4jWlIAADEccBPnQCO&#xa;vQZarwkfe74A5LoQrd2ijbyktRULp3gIuDFWgsEJ59LVRkFzBRB7FrAtQ+LKtw+dozcjTeaBUNDw&#xa;DPF2Y89xUJehZC1hDWmvmIhCMqlKUNFgisfS22y0BvcEFGYSjsxvsICfTk5juLcHW0dWoDefSa14&#xa;QTs2b8L4yAj+8399ANNuBqfcPkxaWeQymQTTCRin9YOBBolmyNgAJx2ksGozB5iJ/zgERDCvQa/i&#xa;OIWFiPXLIrBcATzfBavYB5sDBTeDfE8vWBRqQQFCgJ5e8EIBcOw2NW3KQmHfKAmZEijqIcsG6jXg&#xa;1EmgWQPxsrAWZ0EJELgZBGNrhSsQ6LB81VSSuArjB0OXgngeYMVhfkKVJGsv8lypcxiXJ5OLQQnA&#xa;4kHQRkCaCROiCbH6WmKFKcggeTt1EbAtG9VWgMmFMvoKqTdASsOs4Lkg3V3oyudRZQz1RgNO3kNy&#xa;WtFhxtvbZEqPuE9UuLCUSrNsg/WNAg1pnMS2RP9OIL0PUrPwbA60XhGyi1JQHkGNKyEE3PXAbAec&#xa;SHWeaitPVMpT9ab7zOOxVViTis/UbxlCJNUvo7ZEn0Vn0LZYzdRVNbmKoU3NjHMnO9kv4XRnUQTQ&#xa;ECDi7CduJPpSS/I5EZJDOrjkWAs3mAkPCIkbq9d/G7OT+H7E0juby2GyXMOj+w/jsvHhNj4LwhCu&#xa;ZcHJ5zCxajVemV1EaWEejpsFMh4UpwgD13w4NdlmWyA1JQF4aR68NA+UF6VjPALyXbDWX2yo0VQZ&#xa;6iuRyMi8RbmSJOPwnn7QxTkRenUzAFEVC6zJvIxIS6QUYB22D3E1ftxoglpAoi4lBfXPCl5JDwmn&#xa;FojflHUo538H80tVobVLB7lPIBeEdHVqKBnP+/mbYVLSKsDOGQMDQKJQT2C9UsbiK8/Dcj1YXgZe&#xa;oRtuV1Fk/6g/5dZS4sRcZGqstMQjHZg3fk4NKiEUbiaDuYaP2XIVj+47hEaljMBvyR23AWqNJqJI&#xa;nLn1+smTmKv5YF0OeOCL+T9dznmC6cyLRKQCVhbAX38V/MQxoNmIJ9O2wYdXAa4L4nqxoWYwZyyA&#xa;2icegGYOXugGWCikuWWJUeKI8baS9B00VaL49JpJ8m3c15hzTzMwHcrSt6vVaOLbxC/Q/nrNCEBs&#xa;0/Al23w2ZJtWoYo66aQMxtCq11HauxtOrgA7mwcfHIY1vhrI5mDJUKnOtwU0UwKIrbKEuoC+T9Ub&#xa;d9qQtHKVBhzwI47HDhzG7BvHUa+UUatWUK01UGk0Ech4/qFKDaS7H3b3UDxbXNUr+7fkMKQUvmWD&#xa;V8vA3DRQXQScTJwt1qyD1ysgtAieyQKRMugMSGFOZkLtSlyrfnNcwcCWfIbH/CWkrTlGqbGT3MQT&#xa;nEk6rMN2iWhK3cS/qfFIYHkVPCEG5jWwPzGfe5PJ1uoIHOAMnHHwiIIBAhZIpmQhQ1CvI6hVUDsx&#xa;Cdt1YbkuMv2DcHJ5ZAeHYecLcLp6xG4GaoEQS0o7xTw05ZwXTEr1d574RgiBm/HgeC72Tp3CzGsH&#xa;4deqaFUrIOAiSJHxUCh2werPgOYLsLr7xRYRCmOhcM0sAoqpSUlLwljNkUYNCAKQbBe0ZQ2AOC5o&#xa;swZkMlraEcU4xGAeObkipKzaor7I6mwXLFJWPonhJBe5qToQAIBQkoCbhBKhFYmR8CLLJxwAJTEO&#xa;Jmp0DS0H1Ra+tGAx6jcZXHWT6++xR0cP4JtItsJAaoAIgCgKQTkDoRGilmhgZPmgloUoDMEyIQJf&#xa;5NEGvg/LcdCYmYZl2/C6umFnssgPDMLNdyHTLxzORO5z0r5WPUhKIKqdBXKwoHY2CCYu9PXD2Xop&#xa;eBiChSGoReB4GYSEIqAW7HIkws+ZjMiEAgyjIg54xlLBAGlSl2oJqBmFis19LBaPnIvztrS643JB&#xa;cIPB5H+195Sn7XHZPybyCTgn4My4w0jm0bKRM+mqU+0goCQlObULDIbhxjVGVonZqk2iGZIDmfwz&#xa;3QOKGXV+hRobpQXks0riy1yUtGK40GQnes04OBErlTEOECZzTpjYd0UpoiBA5DdBLZEoHLaysBxH&#xa;RKRcFza14LkuWo06SpUKGkePyvQ5gloQoqd/AMXubnT19KCruweW7cCVmwNDxlK4i+iBczM5eJk8&#xa;1IRTy4JrO6hEQMgATuoiw0xuSTFDo0SrzdiHyoWIhIn1zMkX7jsLsBgEQBZEqQWu86vMJCHE6lIW&#xa;K6CSqa8lA8gFyhu1+F6D6QWTtI9FoiQDGwrtwUHMDBizzgQsU2hJqR5DS2hFYTK0qkyNGQHAkOx4&#xa;LMPPA6oum1IuL7VyuRZ4Gt9CZDmBhALfSexL5NtVqN0ScoWFCABQJwNic3gOk2zGQWUic61cQrNe&#xa;Q2VhAZbtIJPLw3Vd5Lq6YNk2LDvTdmSRmXhDILKmqNzmEinntvZCdOoTSU102pRIkWFlQ+N1yL1x&#xa;qpjU0zxeAHFOgnxQSTztcqJAs27gxZhpdUZbLFdh6ghVFzcXjbnwNBZVkwhD63Tua+J3bnwwoU0C&#xa;1xp91nWJZ95sZGswrWRVDikN5IRF4lJEhaoWh1tE2nnMORNbnMFBAxdRsRscROwkJQSOMSAZwhFF&#xa;EjezCM1qBSAEjWpFBBROWbAsG9lCAa7nIV8ows148DwPrueJvWlEBCkItWBZFJxHCAmLNzAKMaJV&#xa;oBmRjA0IcwjMCZHSTfplCSUg3DIkLQEokwk1atRU4dwsEfGvadws/6UUmD8lEnPARb6soWYVpl2K&#xa;AUx2VnBEQ3TDf8rj0Ug+2KnE0yazqDLNsuLPuh0adpyxwnOmpKTtWBEH5wxgFJwwUAAsUonUFJHc&#xa;XUupBc4YquUyXGcGmWwBVi4HksuBQIaFKeB5NmxbMpy0vFkkkqxbrabI+C9HaNkW/FpN5PRaFAwU&#xa;mVxOMnAGPf0DcJ2MEIIWleFlgCvXmx5AFn+WeanEbwF+Q+SoRpFw8bEIJAyENc8YUJ4XCo8SgCt3&#xa;HgFYBGY7wrfKjeTAtLQypHrbxPktgNWB2SljcakFZuDLFMsSoyStySU+iCO5JHFjJyxt3qaUe/pb&#xa;vA554rq2ORNtSWutFCS6wLTkuQft1XJD08TqS2Tmi4RfRASNWgURAaxCUaQl5gvSyLIACEMgiiIw&#xa;zuO0RteDRSmKff1y6IQR4tcbqJcXUa/XUK41kS8UUOgqIl8sIl/sFgvCEhY6V0YctcCpBQnGpZDk&#xa;wjkfBkDgg1QWgfKCZN6WcK6zCCTwBWMHgYybp4xGyEiV48rFYfxmOjS1GiVa6MUQkIh2NOtAvSr2&#xa;aylXoxprPb7JEGnandYZ5EIbRmmFstREt+UEpO/tIGR1nemFyttAU7Kxnco5S0oyrcbdNJ4ky9Ju&#xa;LxAit5Rb2jcr3FsG2A8jhJUKKgf3omYfhNfdAyebh53NIzMyClLsFc9atmg9IdKAIgjCAATiHWPE&#xa;spHpzSLX1w9KCRzbRqPeAGdiR+m+53eh1WoitD0ETgaWVxBBgHoFVhTCCX2xB8yXjBj6MTMQIlSo&#xa;2W6NXy0gs/QZJsT1RFBAZUqR9IyaMx5LLQ1xbRs4eRR47RWxsZBJ/MU4QOU9jIlFxnl79liiMUmN&#xa;aIL2ZCvQkVk4JJLoELwAELsr1YNLBWu0Ow8GE4sKCT/zy//OlhL5tOaxQXo3ri0YjKoECFtuwdFM&#xa;K36jjjzRxZJuIipUdthogAU+gnoZQWUB2d4+2Lk8rGwebt+g3IumyjcNizhCxxkBYxx2JiOS1SlF&#xa;sX9InA4YBmBhiFa9ipbnYZE3UG/4WKyK1/8EYYgoYiIQIhmTpiVjPAjtGFCNv2SkaHgM3MvG7ioG&#xa;uRtX3qhj/MazhMTZcT/+Z/BaBbxWBrEcAb2UoaTjFML4pZrTZJawofJN1tBXtbsqXiWxUyCNR41m&#xa;cg5ROYf+CrmwAXCF6bmweTjlcX8RIzC5lSE5bm8CpSRtnF9AJNNRWwQRqLTmqeOJjY8qEia3GVN1&#xa;dpYlGJqq7cdSmikhFzRbYBEDbTZhcYYqLLQcF45to7enF47jws2od2/FFjylVIcdwDkYZ2gFLRAQ&#xa;ENuB192LLKUYWLUalm3DoRYC30e9VkXg+5ieOolKpYJKuSJeusGl+4vIrDJIZjWteKmSWSYL1t0H&#xa;1t2PaHStwMByvKD8mMrLYPp7AcCxgMAH9r8CfuSAiLRRAli2yHHVdSHOHosigEUJ74CKOCrWo4To&#xa;akEgzhrQ6jp1Eo/2gJAk33IJ9fTpO0zfLoZCGIOUWMIdCi6CFkQBRgP7qIacznK8QExsq4rifFrF&#xa;jMbhHLaUhBaF7bpwMhn5XRzWoU50YQDCIIgNGEL1AtAH1bV1hiMKIrAowmKpBNuyxTYcy0Yun4dt&#xa;WeJwCNpBN8UgUEMaLhN+Iinh3EwWjuthxQhFrx8gCHx9nqzIYWihWq2JgyhsR2y59jJi+7XjCozs&#xa;ZcG9LJiXicVKyhhRfUk0jBBgZgooL4BPHQcaNclY8h7DRZZ43nAttZdtVNHps0YrCkiTeCGabrT0&#xa;VJh1G2UR1VbtuzVhkCFZFVR5k6SrSbbuGDGSv+UJI8SykO0qIjcwJM48cFw4uTzsbE4wo+0IKSwj&#xa;XhwErFUHwgjcbwFRiCiM3+pHaHyeAiFUbIhkHGHog3Gg1fRBCJEnnIhXJjm2OOo9l88hm83Bsm3Y&#xa;6t1TiFWcStjhnINHDBEggxIZUEKR7+4GpQSUUITyQLQw8BEGAfaeWkCZcZRhg9i2yLiyLJ3lD2rH&#xa;E6S2tRuDKELEMQMK7cpjrMoBFIpi2/3CKcD3xd6pRGjWjFRxYUQCCQiT5G8D3hiROJGeHvvZY2Zq&#xa;F3UmijHLSa6P04nOZP3iM0vdZUjgNGw6RxI7F5SkNY8+kge55Xv70b1th5bAcBxxBKSUvNSyxaRR&#xa;sQXcBcSAh75IJglaQtVFIRCEwqqVC8JxbBAWgrFIQkzBdKHvgxOg1WzqU7Ndz0M2k9FHv+e7iigU&#xa;umDLIAMl8VGYCYnORZRP4GMCTjhsx4WbycC2LDiWhTdyfai3IkR+GNsa5kQYaYEcMPIJEGPjlCRU&#xa;Eor3D4H0DQDD4wImzE+Dz04Dc1Pg87P6dJoEE7IInLN4t6tZuUk8dVF/bNMB7c+nJfnpaCkGS/im&#xa;JfZu89MaBZDz4lVN7d4Dg3kJpeLwi6ERHfPn3DhEl3FQMJFZRwCAghFxYB08D4RayFAKhD54FIDU&#xa;6ggaVY2hhNQVE6TBv6F3CSHgjCNiEephHZVSCY7rihcC+yEyGXE+qq3ajNTWlzRJyMDBwRgHIwwR&#xa;EbkWPIqAiMXaeylSNpxRZNpjkKxTcAfJZMGzOZCBYSDzGsAjsJkpgMTngJllCDzZqdSkek6yjQFL&#xa;lmGxa95aaszMEGJ6baQhSXtDkeBevqwmLYts3TgDz1Lz3APHBYkiYclaVGxwlIMswroK9CuGEz2g&#xa;XCSUB+Ag1AaxHCBbRMa2oU5jKboOajOz4JWaiJRJg8uypKonpiFCYFs2OOPwWz6mpk7ixBvHYTsO&#xa;bMfGwMAgunt6MDQ8DC/jwrLt+CA0jdfjP7ELREAixriePFMA6QldCj9qSqrEpMqNPxAArFkHWTkB&#xa;OrYW0ew0sLgQ36juVcGFtP4mQFtmWltFS1s8ul9nlLByFMz1gfahiG8TDSXKvki0aLnifPlkE82w&#xa;hiFmWfp0REvuhFW7VwUujc87EBpSMLBOm1DWquHvhWSUiMvDPSjFIqfID67Axv5BhGGEWrWKZqOO&#xa;SrmMMAwQRUxHxKiRr6uGkBIId1cY4vjRozh+7CgO7NsH13UxODQkmHjliDh3zHX1G9KhIIo8t4Ep&#xa;x77RH7MqTpUxg9gtJ3mDmPahwg5GcEH/zs1j5gUMousvQbjzYbn5TwZfAH1sps6kImmG06oo6X2Q&#xa;DSbxFZgcxyE3IaYOMxTbeQz20r7rzlJdew8kPNKnC2mhyo27mfHDhWHgpJ/WsPLjY5HEyUmq/UZw&#xa;SHy3bFgkTkYR52/Fq57KJBdIvEmJsSKlNLEsG47jolDsEplkYYQwCFAuLaIpXw9Ur1QRsvhFIcSy&#xa;4o2SHLrdke+j3mrhcLkMzjm8TAaZbBaj4xPo7u1BsbcXxa5u2I4NSxqDURCI1EBuqFhozR67oiA/&#xa;SyOLg8SZVZCzzkRn1cRRg0EIEccoERYBIQddMQIehMaeaFmPsgFUFpoSuVovcw2d9NzpBsO4N54n&#xa;fV4soMc/FpU8cbv6WUM27TmQN2k/rXxG1au263TEARwX6ujPJc6LPfYAAB7gSURBVEI/RmKvznGV&#xa;v0imSxs8CiLYxq6zGPsY96ny1fNGNEXsABYTYts2Cl1FZHN5FKMIrd4mGvUagkBstWk2m/EQEAKq&#xa;GQ56gRAi37rt+5idOYVyuQR3ago9PT3o7e9HV1dRvG8BEP1UErWTHaMnn+s+KTtM1aekaUJQcSmj&#xa;tFQ0ClanfEvHqKjaxLfcqNO4Zn4kMZOZ495JpiXxfpwQbv6Z1ZpASUtyA+4obZKgtNsO5IJJWEVL&#xa;xys5JByQkS/E+FV8J/EKh4mHjXfN6mK4Lk/rOhIzrSpLcTmlBMSypT9YSEPOGfxWC0HgIwgCNGp1&#xa;eWS6jyAQvlYexa+DV4cB8yiCzyLMzTRFdhnnyOayKHb3oFAooNDVhWpIEILCZgDhEcCkGuXG66Qs&#xa;G9yyEPWvlJOlWCM+fNkcuuQVoq/G7kwi9pi5rnzNEtMCkrdJKyGl0mckJuuMZWXcMlUTEO8IMRun&#xa;vidXabucJB0/pu8ngAxLy/Zr6a4kPEkogyWg9xkpce4B5xxEZbdzeQym7wufqGxEvLVCMiohUC/k&#xa;iK/HZ3sJDCfVqYm/RC/i5xVsIIDahkx0uyIQy0IunwehXboNYRghCHyEvo9qtYLA98V7XH0fdfki&#xa;5ygMBH60LSF9KUWr2cJMcwqz02L0SC4HDsCRg024mnrVTCJ2z1ILQcQQrBiD6ZfV6tbkVoMxNBuZ&#xa;E84h9qIZL+EgRDqOmEpNTAeUU0xHCAiJmUJjWp68LZ5ijrQ/mXPI9MjOJJcaCOHJdUTalyUAfeav&#xa;EhD6BS9aaJ0/2YJRjUL1n/getpqSGaUuUrLVNODMjij4oFU/kYaXzMeVndLGjxwULX2l2orBs/oc&#xa;70rlEBg2k/OQo3kQSjFERtFqNjE/N4t6rYqTk5MIfB9+JKJtttIQhMXqXJVXq2iNAcmguk5VH+eg&#xa;nMGaeQP+yomEBDEEqf6iBQoxb4CEIPJHWU+8dUde53JzaVp5JxilAwOY7ViKP3j7bzpjrVN5utwO&#xa;hXZwramsPyiDz+CpC5U4o7fbqPcPMJlmSGU2VX1xAX3VCrjrgjuejD3HpwjCZF5CxDzA/E7jvhMC&#xa;1/PizZIy5MoieUhFYpSME2m0FCbGrwQ8isAYASgHt8QbdUbHJ0AtG5fsuBJ+o4H5UzOoVis4+vpB&#xa;tJpNNJtNobZkMERJUb1wxMhLKS+DChoOWaCLcyBBEDM3AM5SijvJsUky5o0Q8VIVcBhMCr1HLMlg&#xa;JtOQZDVm2YYwkGhL4m3jceWIUf207KSwUnvPjH4kEw5J8lZpCxDOwYJAbItnkRy/lHblqX/PgeS5&#xa;BzKFTB1AHASIpGSLwgClPS8iM74G3thqEBbBkIcJBk74a3UjuZZa6jwnwgEwLk7rth1QmcAdSgZW&#xa;m+dUlMzEzgkJnDgMQrjcGGcAC9GsR6CEYGB4GIN0BBdtuwyRDN/OzZzC4f37UFpcQGlhQTxJKWzb&#xa;0a+W4gYTE6jdCgQ0DEEadbGIPQ+UpWeBxEjAUKkJgauYRb2qgTGRJEOteMw64Np4Y6M09lQ5Rrm6&#xa;LnMWtEWooF/cYg4u3snATZ82kkwlo3NilAkAFmsQZacELSBoIWqJdz9wI2CjX9EkuAvnS7boOBFZ&#xa;PIppI5HFTwCErRYq01NghAJhgPz6LfqUveSbvKnxB51wk2Zq7d+lNMay0mea8cT5W5wL+BD5gRxs&#xa;bsAOxM8jLgsqF0EuEJr4Lo6ZJ4TA9lyMrl6D8bVr9bHx5YUFVEuLOP76QSzMzaJaKoncA0vFXgwo&#xa;EclkclsqKSmFSEcLWS5kA0pwBZ2goI78n0xzJGIChEGjPCskfXibOu/AOEMMXEu8hANELSCuFo7U&#xa;LCwCvAyY6yEaXCnYUTGz8VYf8YjYiycYWzCp6JGYE27ZsGp12HOngICgGtZBwhYQhjL/mQn3JldZ&#xa;EecHE2zVYeFzVNhDqCfGIrBQnBvrV0oAAdz+IXg9fSDSRRQfg4QkUwGaafTYm9egnjMlqRgQSi1x&#xa;LKfc0pIMaRoYWk0CTKnSCWPHi4USIt6LAKoNBOq4sAtF5EYnEHX3ozo9LXYV1KpQ+FQlfOs9XIY1&#xa;ozF/mtKXuG5uwm4wRZ/elp7Cf+Zx853Kjf+NxzIBG4iqS6RD8mwevKcfvLtfNIoxcxT1mPIlrphw&#xa;iBAC1qwhWJiCHVH0RQU0ogh1pk5oN4MN508CHnAuVCATjWLylZCcM4StBizbBgsD+JUSCKHoWrUO&#xa;TqEAu9AFkslL7U8T2DYtYdU97dKZJKJrIstL5uhSw3qWAF+5g/RBFWqhSKlm6WuxlIvCCDXOEIIj&#xa;4kCTcTQYR8jF9vOAUkQ0C39gFGEfB+saBI4fAqlVBIMy6GPradTpTC0TawqRprfZqAWn0QaX/xdC&#xa;goeBxOYcegOlwrQxX6T+5ZoJzRNr0g8oXtX6vlAExtaBOw6inn6gUATPF7WKj9mRpzg2iWcT/xIK&#xa;2mogmjuJ8Mg+hEEdng94QRY9oYXjbDHpBrsAzKtdXgK0MxHRkXu4OBMhV59asEIHLHRRPX4Efr2M&#xa;fLEfuWI/wkGxE8Ht6RPvieVKfXdi3KTxljbizJdFK8xEZTmWZcl5km4UQDAvZ2CMoxZxhATwIyaP&#xa;wRfoyWeCURsMCDlHyDiaHGhFTLz0g3FwxwUhgKWmLFsQWFsPtp59aTSaZMbQ2okv8RmAwH2+LzAg&#xa;Vwo37mPCNEiUQDpe7dQe/ZlzoH8I6B0Etx0Q1439wQqXop2pTIna3i8CUIJo908RTB5CMDuFVmsO&#xa;VquKfECRiwhWRD2oszoqPAB7syJi6uRE1TAWiXdwKWwZ2TYatRKsFoO90ABvleENDsHu7hZva9Rn&#xa;WxmMmRgCI5igjbfk/TH2MrEfZKCBaImtDKuIhagwjibjWGQELRA0OEcgGZSp51T9nIt3KUCc/dvx&#xa;jAvFOOowZzmp2mAx+2RKJSL9slxp65ROV985hESVr69X0jpWpoqRjFYRIrlQScNOsES1Ry0AQ1u5&#xa;Xly3XHzc0EgJUuohTcZt6qi04LWXEVQWEQRNhEETraiGJmthnrWwjW3EHCOoo4IIJsY5d0oGF+RH&#xa;xuQ7sThD6Ivf2P/b3pn9SJLcdfwTGZl1dlX13T19zvTOzuzttb0+AbOy1jIgJLAQsgQS4g3xxL/A&#xa;v4F48ht+AIMxwhbwYmMjWbZsr3d2dnemZ3Z6jr6768ysPCKCh8jMyurp7un1k0fqn9RHZWVkZkR8&#xa;8xe/O+KYWEqUSvhUsoLnlXG9MoPIR2w/wjzukTQn8F6+jqhUENXaiIPmCtO4MpWbnDL52BkVZ87a&#xa;OIW2BUEYIRxq9TrtgU83jPnhwEE6AlemYY/GatgyDZs8OSfZfJ/khDnP0RqT2DywQli1NZ5n10h/&#xa;2Zdw1DpjkgLzdKarESNAxSEqGOQ4zl6q3MOWKwMmvf64S92kXxWeJr9ONpsiN1+JbDll9Ls4IOZp&#xa;oKYdHCtyJ0BLF0clOEmM971/pbETIEMXGU7hBBITtawSFicEesCamWdVz7BvjviIByfv/InpRN2D&#xa;HLYYnZmnEmI0ZVWm7EiumQV+rn9p63NJSTmqIb0S5aSOe+ghn9xicnKRmZuvIRfmcCdaI2nJSQvT&#xa;kfNbBFmhaDEqnJZZFjLum1khHGcE+lTedaSkVC5TDuIsl3JsSjKj/Vg1lhwlJ4XF9JxUESWvtZUq&#xa;WwLLoWQheo3UY5c9azqxmTfrqXoEhfuboY8JfFs21CuhM49V9jYVufKYpSC9d1FYzoBlDAZNvqdE&#xa;dp2cKZ/se0bFFyK9v7EcP18NpWv3yjjYRt+9RXL3Fv2DHV7vL7ITbfMw3KY/3IUoSm21CZgEDLRo&#xa;0GKCT3OTHQ7Z4fA3Vs5OjT3INVdjMELxQrKOFgYlDL80tyjrCkIm4Dgkica4HjoOMa7DV6pf5Hg4&#xa;4HH3f9GeYGp9g/rCMvXFZeRE0xbHyJb+LHkx46ap3AoFUOcihEm5cPatfb5SuUy9XMXpt/MKW3ag&#xa;ySSadF6L61ph7igyoHGFyi7belxz1wYhZP5MmY03C4YZmXTG07hHQsKo78n2VpqOX+CNJ8WJ4kNn&#xa;EkbWvyJlL6vAAjZNdLSnWcfFU6uLScdFjJrbs9OXVKY7yjvg+APYfB/9ZIvhvduYOEan++L+eHCf&#xa;q/Esb8XXuB0G7MbbqS3ewWhbg6JjenTosc0eV1lig2Xu8xj9GwD3zICZbJmeYxLfBMQoYhKEMmiR&#xa;7RubsjZtmBQNWqrFY/GYQMWEDgjl4h/so+OEqNelPrdIdX4B6ZWQad2D3OyVjXuuhI0Am4E3m50c&#xa;5KNWJ4B42sQLRqb5p74al0sz019mFM+VMTu7QqY7rRet9CcpB9iJYxmoHBd1uJdWkxRPNyQbl7SX&#xa;J0SZjGuOy8+j78bvW3hD0/7Z7mbHC4WbjcHRGhFHmE4fEQ1xul2EPyB58jFxZ99u2BxH6DjChENk&#xa;pOgmxzyIfVqqTmyaDHVAYILxlxWDxnBElwY1lphjQMCQiIDwlEE8nU4FbY0KFVOmShmDoWP6KKFI&#xa;SJBGYnSMSlPDK4mgKWvUYkEk+zwKHyNciTus4nolVDBksLuLLJWYmJ1nde01VKMKzRrVmVmrpct0&#xa;c5GiFeGEeWwUv1D4cRyEESOQFpfUM4B78pgpLrGF5dHaqhWZQjZaIiWUy4wrRQX5cgwtYgwo2V8T&#xa;RaCHRHdu5Q6MPBds7HFPVAHPu2lXgvwZRk9Q6J4Y56oj22Buj7fbxBqM30cMfZvDFkW2CvowQHeO&#xa;IPBRx4fUQ4HXH6CSHuGwC3GEiSNUECDDIT3Vo5PELCQtltUMXdOjaxw6pp+xmfzROvTRaCaoscAM&#xa;ASFDQvY4uhDfHQNthTIVSlxjKb/RoWkzx+ToJGUHuKRLeHi0dAPpuAySiI7TYyou29TyyMWRAjcU&#xa;CNfgeAkLPsRHd9CNMqpRwlxZxG02qCxfwZuoj8IanUJmRIHTjv+MLAJnVWEx+dL3dAnK0+I/8lF1&#xa;S5BWgzRKWVtrOtHOlTWbVTu2OTEjMbRwmfEj6TEpoX2AONhF+gOS84JIChVwzBn9GFshCjJP5oYW&#xa;mBEwkwQnGFhwDvo2hiKOaPgGf3CAE8XIKIFO2ypSYQiJRkdDasqjEXrIZIqdKEAlBqUMRAIiz0YH&#xa;ao1SERXtUWOGZTNL3wwYEhESF7WKbHaoUaHFBC6SSRp8xFbh29PpBGhLtJhglQX6BPTxWWKOMV+J&#xa;ESijaJg6DWo0aXBgOihjqItpBBK0QOCm4CuD60DisGHm+Uju4KgYOXAJ2j3c+Rnc5gReYwKR1uDK&#xa;xISCnDD+OTuWDYPI1ZdR2zGOVZzZjAMVUrQLlzVg99xy7DZIJlXGsmJ1NKfT4nOAUadzu0z+EE+h&#xa;CqSHEwQ4h7t4pQpx6I9Gt8jR8+fOrnFCiC0qVylIRXG80r/CaIRQ4Pft/mFH+xAMEAd7EIaY4ZBJ&#xa;NUukDihpiaccZCwQSuJEJVAaJwStElqRy2zSQMYDYhUSqRAnsWOTxx8bTWJiJpigaeqss8ghHdr0&#xa;kch8LLLeJCgqlKhSZopmDtrzKAftEnOUcDmgzXf54dMLaWHcb5qr9PHZw+HX+i5CC7IMB6FtHIGM&#xa;7V5SUax51b3OK/I6/xT+G05sC3tI16NSb+D6D6kcbOKWysy9/BoTV5aZXNvA9WzJozFuCyOxIFWA&#xa;UMYqR5mEVjCWi/zjSNwX6Rrs5CpbUctKr5HEyLUXQMXo7YdQquJMzSCmZnFWrmGicCSLazOWgJlX&#xa;ys6mJpOP01gG7/5tkif3CHfu8WLzBTaDuxhlMEozTNTI4J/VS8j6pDW6IBYhbcZDpjTLOEIc7oDf&#xa;w/g9KkcdomGXqH0AYYROwtSMl8YDRDFGK7ROcOI2a8kMj/QOd9U2MraikU7i9NwobWtrWfxJ8jab&#xa;ZptN/TED5Y+n2RRWDgNssEyLCY7p8jHbT+Gq+LmExzt8gSfs8YQ9jumfCloxz7RZZJp92uxy9Eyv&#xa;xRd4jR4++xyzzzGZ3JarRQXjPwK+Id9hUz5m03lM7BlKpaotxuG6eNWqNZfVJ3BLZZrlBpOVKerr&#xa;qyQLDVY+9Xm7uXQa3Z9FYGX38KSLrzS+0nz38TEOVoEcH7aM4xVMRibTpEdZuONLbCovpiae7GUw&#xa;GFtR8QRI88i14nRk3C8LgwwGiH6H5L/+hSQJieMhb/jL3I03UUahTIJwJUZKEg0qSah846+Rc1eQ&#xa;U7OYJLb7fQUDzNBHHO9jOocQ+JhggG4foaPQgkwpmnGZhqnha58dfYATJ6kzI7YZHtqWNTVKEyYB&#xa;v6te59Acc6iP2Yv3rGk4jdAyysr2NgJPI3TMDXOVG2adH+gfEpnU7Z8L0eNLe4sJNlhmhhb/zU/P&#xa;xRfAMvMsMUfAkD2O2eNo7HtxgzXzLJbsINhgmQ2WucU9HrN/ztkWxC+Ja7wkrvF95//QwtYYkK7d&#xa;3dxWr3Hw0rpgTqUMruRP619jq7TPk3oH6XqUGw1aS6s0l1a48ubn8EoVMhAKR+JKh0hpQq35562j&#xa;cStDwcOUrdiZQJHncWXnFK0XjMZdFNoWWUO2MUiRw45Rxl2FAK+E6BxhfvUT9L0PiP0BOhqioiE3&#xa;gjm6cYcefXqmb9PzpS3wJ4Sg+vm30YD2ezDoMdVWhCIhJCEkGm3tpFNAqThNilT4SY8behWZwKba&#xa;sjbn1GFiTAbEVNlUmlj7vGFu8Ia5wbfVf6aRdun1VRoXm8V+oHCNxDUO3zBf5dviB2Tx2GdRhRJl&#xa;SnyZN7jLI+7y8Fy5FWCDJZpM0KHPFjuolKFK4O/PMzc4OLzKC0gc2vQ4pENIfOb5IJgXUzRFnTY9&#xa;dsVRtgiTa9OGVHa18vE0LVbNPD3hc6TbBIT5zjpGa5JwSDQY5NYDr1q1ZZnsFXGF4L22PxIhC1Aa&#xa;eZty41F6/KRpadRqTII8cb3cIJC3OQW2mUPEkYjH9zE7W6iHm+h+B+X76DCEaEg9lFRih6EKGKi+&#xa;Dd/Lltp0oxDda6N7XbTfpxwavERQTzza8THEMTqKc9OTiUK7lMcxJg7xYkM9cplMquwne5gktgqW&#xa;SizAUzndJDYUUhrBUA9pqRrGJPh6ALmsyuhvrmYaPCQLYgaAAcE5uMiEMZPKtuAzPPd8gIiEOhUW&#xa;mOGYXj43p8JdIpE4rLNIlTL7tDmgTUxy7k1usk5JeBzTY48jIpGQeYusA8Fq/giB4zrU5QTr3ioz&#xa;copflDcRrkzFBo9KbQJZsjXEyvUJptY3mJiapzE9z9TSKvXlRTzXxXNdvnN3m77S+MqkpTzTwc31&#xa;pPElXRTclic5bXoS2cHcxASpcjO6rkjNXqaoLIYB5nAH0++gbv8S3WsTH+5iooik37XgiSNmoiqv&#xa;JOt8zCPum0c4wu4AZMtOOXaXnqyWrxCUHZdVFlkxi/yP+TGOknl8hEmrnGecF53ganhRr3DNrPB9&#xa;/SOMsTIsJlUws36mpfIdY93mX9ZvckSbB+YJPfyCsyn/lbct4fEmNwkYEhByl4fn4sPBYZZJpmmi&#xa;0dxJzz+L6zo4zDHFDC36DOgwwN1geewkg6FKmRoValQo4XGfJ9SosMrCmQ+TtVlhgX1zTEDICvOj&#xa;dXlsnbZyZ0V7zIlZSkmZtnPEXFzFcSRuWLYyr+/geA6OB+5Ao/uPoDTAKbc5XNqht7FEZXqK6vQk&#xa;rzerbAUx9/2YxJDWds2wds4ydIqmOQbiUyZqRJlFw5YuJQyRh7s4nQ7y4ZY1yh91LOfzXUykMUEV&#xa;Eg+SEpXEYV1NoxgQ0UOSOhocmZcDzdKBQKBEzAyCeePygmkR6WQkimg12lIpC3oymrLRhKbHF82L&#xa;tOnS1X2rhBaVpsx5ktLADFhgmhY1djhAZZaWM4bymC4LTPMia7SY4ID2aIPvM2iCGtM0maZJQEhA&#xa;RESMc0abIWFqyTLjoLVea8M0TZrUaVLn12yyzpWxRxi3Ptp207SYZZJ9jmlQw8PFSZORxvzvWqS1&#xa;eQ2TNJgUTQIiYhExayatmQwXEonUHk7sWlenLqONx1w0wVzY4oNgm87ePtWVRaoriyy/9Qa+Mjwa&#xa;KiKlT+36adA1Y/+P9+wsqBe7Y4SD0BoR+DidNu4H7+F2B9SOA0pKUgnqiDhBBC4kMSKsIbK9HhLN&#xa;nG4QME1MhIebixYIRuBNEywTFDPUqQIvmVV6up8v36MwQ8gcBzZ00xCagE9zg20O2DOHSFNIZMzb&#xa;jA6FRMzQopTeLSYeF63GRkIQkTBJgwmqfJaX+ICP85X6rLHTaCJiPscrtOlzTI8+Pm4qOoyuPpqb&#xa;mASJHBcP6lSpU+Ul1nnADg/YPmPaxmmDZWpU2OGQA9rnn1xA/jfF17klNnnPuWuPyVQWdNPADNdD&#xa;pvuVqZLDK5WXqHhVym6VW9UnVKqTVmlxPYxXYWppBfnKZ+hMLTIo121KidZP31+n4kEqIY0BV4g8&#xa;NDNb7sesA9LFMQrRbUOvjX64Sbz5HhOxRz1y6UbH+MmAvm+1eTUcYJIYPQwgSewmISYNxlEJf6f/&#xa;ip/yLj/lXatoZHEZhfuPXKySFjWa1HjTvMq/mx/kfaBY2ecECDHwZ+ZrPGKX99mkZwbPnFOJw2d4&#xa;mTe5wT/ynWeen9F1VlhghofsssXOhdrcYI0XWeMnvMsx3Ween4N2nSssMktEzC/44MIP+ee8w2P2&#xa;eZ97tOld4IaCz/EKb/EK3+J7JEIRiySVGkYuXCvzyrxmrvQkf+v9BT+XH/Iz+SHlygROpYzwSlYG&#xa;rNTA9RCVqnUNr17HzMxhrt5ENKZRRQfDqXGKIzKAoxXO0IcoxBzugN+3m9Ud7KGPrFKj4xgdRURR&#xa;n+V4mqV4igfhx/SSLr3wCKMS9DC0yk4cWXNUHNvl3GiMiflL/pgPuM9t7uMT2BEaq0MgTvyvMCj+&#xa;hm/yD+bbkBr6xr1zJxBrjW+8wQ0whl/x0TPnCazIV6XMF3mdOzzkzgUM/wCv8QIuEhfJz7h9oTYA&#xa;b/NZtjngkM65zE8A5g/5Mm163OHhszllSjdZ5wbrvM89julydIE3BODrfIn91Pb2iL3RU6T/jLIb&#xa;QAi7DZQWij+Qb3PbfUDfCek7QzyvjCiV0xBJF1Gu2P8rNYTroaRgVs5Qq7YYeAp/pgnlCpTKiHI1&#xa;VW7S26q0dtYwgDii5UMc+fhBm0RFqGiY2yutaclySaNidBgSRQOuqUWuqkVuRx/SV316cQeTgdWk&#xa;ipLO4hlIgaX5ffMWB6LNAcfscghPCTYnP1sQ/h6f4R7b9OjTzZjFmUlkljZYZpZJOvT58BPEtf4R&#xa;v0OXAXfYYveEzfQseoEVNlhmjyN2OWKHwwu1+wqfJiRiSMSvuHPqOe6rbPCYfXr4FzJBAFxliRIe&#xa;h3Q4pnvhCJ1FZhAIQmK6nLFEZQZ/AzjGvrGmRIMqHdEm1gbjGFQqZwmlEDKxOfzSRWiDcD0iF0py&#xa;EqFDuu4xmCCvnSW8UmrBABA2G0FrdBKiVcL1aJWjJKIb91A6GYE21dKLKdI22ikAFSGVsoEkOkIn&#xa;UcEwr8e9RmQdhDa9NHikyu7pA3Lq0QOOucYSW2yPQHsOCQQd+rnClAVjn28ptXSHh0zRoEmdfdoX&#xa;Sps5pss9YJUFImI69C+EkwfsMEGVCWosM0+PwVNYcQVwl4fEJM80ZwFcZ5UZWhzRZZuDC3FYDxcX&#xa;l9e5zl0eckR3/EEKGvyYsm4UV8Q861zhgX5MR3dwhN3d3CSJ3fcr33UnsKKEVwYpmfamqckhA7dP&#xa;x9mmIitjlWOKadykjobEJCijWNUrDEwbXz/OC1CYzNCexJgkGYE4iVEqwNFTlHWMTgZo46P10AJU&#xa;aWxQfQbYAmgNPGGPOTPFCvNs8oiLwQgesM1X+TwJEU/YJWFUGOMsOqZHhwELzDDHFAOGz7StAtxh&#xa;ixUWWGOBeab5Ce8WZ+tUOkpX3xIeVSosMssT9q1T5Bn9mkwDxmeZZJIGuyd0JfcW9y40TFM0maLJ&#xa;IjPcYYsBAf0LdBjgCrOsssA+x8+041myTzRvZpgzk8zQ4j/Ej+w8C40Rxm5Wp0Y1cJ00YBl3CELw&#xa;WfdT7DsdtuQTED6xHKS2YgeTZ0Vk90vrxRqDZwTKHBKZXYZ6F1c7VhbNtHSl821ITfrZ6CGuiagY&#xa;jVFDDCEY64AxmYKUx+QWbZ7QY8AaC6yxeKGxzMhnSJsuAsEMrWcu25lh/yG7tOnxJd7gI7a4w1YK&#xa;+PNphwMa1LjGEuss0qZ/IR3mNveZZ4pl5pljkne5Q4I6955terTpMSBgmibLzDNDKw+mcS/2XlvQ&#xa;brDMfiqjfBKaZZKXuMq3+N4najfPNAC7HBKZmBxleSypAWE1bluV3AGTYIRmWU1x6BwycDoIYVAy&#xa;HnHXonYOKdMzuMalQomBbhPRx+gApR1GlVksxxR5nK3NBEbHCDQyNdobrKs0f9b0Hhl3LZJC4+HR&#xa;pP6JxgYsVxoS0mTiwnMyICBgyHVWOaLLPR5dCLQJih0OCYlYYxHDzoVAC7DPMUvM8TJX+YgHDIku&#xa;dM8D2iQobrLGGgvcSV2/Z3rELumSflvp7BqPl3RJv6V0CdpLeu7oErSX9NzRJWgv6bmjS9Be0nNH&#xa;l6C9pOeOLkF7Sc8dXYL2kp47ugTtJT139P84WGaZUimIJgAAAABJRU5ErkJggg==&#xa;" id="image3163"/>
- <rect width="282.94818" x="28.049149" y="81.03817" rx="0" height="279.91772" ry="0" style="fill:none;fill-opacity:1;stroke:none;stroke-width:5.44153594999999960;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="rect2995"/>
- </g>
- <g id="layer2"/>
-</svg>
diff --git a/tutorials/quick3d/quick3d.pro b/tutorials/quick3d/quick3d.pro
deleted file mode 100644
index 85436d8c..00000000
--- a/tutorials/quick3d/quick3d.pro
+++ /dev/null
@@ -1,2 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS += shaders teapot_bounce_qml teapot_qml
diff --git a/tutorials/quick3d/shaders/TutorialTeapot.qml b/tutorials/quick3d/shaders/TutorialTeapot.qml
deleted file mode 100644
index 306d25cd..00000000
--- a/tutorials/quick3d/shaders/TutorialTeapot.qml
+++ /dev/null
@@ -1,65 +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 1.0
-import Qt3D 1.0
-
-Item3D {
- mesh: Mesh { source: "meshes/teapot.bez" }
- effect: Effect {}
- property int xRotation : 0.0
- property int yRotation : 0.0
- property int zRotation : 0.0
-
- transform: [
- Rotation3D {
- angle: xRotation
- axis: Qt.vector3d(1, 0, 0)
- },
- Rotation3D {
- angle: yRotation
- axis: Qt.vector3d(0, 1, 0)
- },
- Rotation3D {
- angle: zRotation
- axis: Qt.vector3d(0, 0, 1)
- }
- ]
-}
diff --git a/tutorials/quick3d/shaders/meshes/teapot.bez b/tutorials/quick3d/shaders/meshes/teapot.bez
deleted file mode 100644
index 02b2ac44..00000000
--- a/tutorials/quick3d/shaders/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/tutorials/quick3d/shaders/shader-tutorial-1-textures.qml b/tutorials/quick3d/shaders/shader-tutorial-1-textures.qml
deleted file mode 100644
index 134ca362..00000000
--- a/tutorials/quick3d/shaders/shader-tutorial-1-textures.qml
+++ /dev/null
@@ -1,105 +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 1.0
-import Qt3D 1.0
-
-Viewport {
- width: 640; height: 480
-
- TutorialTeapot {
- effect: program
- }
-
- ShaderProgram {
- id: program
- texture: "textures/qtlogo.png"
- property real textureOffsetX : 1.0
- NumberAnimation on textureOffsetX
- {
- running: true; loops: Animation.Infinite
- from: 0.0; to: 1.0;
- duration: 1000
- }
-
- property string texture2: "textures/basket.jpg"
- property real interpolationFactor : 1.0
- SequentialAnimation on interpolationFactor
- {
- running: true; loops: Animation.Infinite
- NumberAnimation { from: 0.0; to: 1.0; duration: 2000 }
- PauseAnimation { duration: 500 }
- NumberAnimation { from: 1.0; to: 0.0; duration: 2000 }
- PauseAnimation { duration: 500 }
- }
-
- vertexShader: "
- attribute highp vec4 qt_Vertex;
- uniform mediump mat4 qt_ModelViewProjectionMatrix;
-
- attribute highp vec4 qt_MultiTexCoord0;
- uniform mediump float textureOffsetX;
- varying mediump vec4 texCoord;
-
- void main(void)
- {
- gl_Position = qt_ModelViewProjectionMatrix * qt_Vertex;
- texCoord.st = vec2(-qt_MultiTexCoord0.s - textureOffsetX,
- -qt_MultiTexCoord0.t);
- texCoord.pq = vec2(-qt_MultiTexCoord0.s + textureOffsetX,
- -qt_MultiTexCoord0.t);
- }
- "
- fragmentShader: "
- varying highp vec4 texCoord;
- uniform sampler2D qt_Texture0;
- uniform sampler2D texture2;
- uniform mediump float interpolationFactor;
-
- void main(void)
- {
- mediump vec4 texture1Color = texture2D(qt_Texture0, texCoord.st);
- mediump vec4 texture2Color = texture2D(texture2, texCoord.pq);
- mediump vec4 textureColor = mix(texture1Color, texture2Color, interpolationFactor);
- gl_FragColor = textureColor;
- }
- "
- }
-}
diff --git a/tutorials/quick3d/shaders/shader-tutorial-2-vertex-shader.qml b/tutorials/quick3d/shaders/shader-tutorial-2-vertex-shader.qml
deleted file mode 100644
index 62018bbc..00000000
--- a/tutorials/quick3d/shaders/shader-tutorial-2-vertex-shader.qml
+++ /dev/null
@@ -1,117 +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 1.0
-import Qt3D 1.0
-
-Viewport {
- width: 640; height: 480
-
- TutorialTeapot {
- id: teapot
- effect: program
- xRotation: 30
- }
-
- ShaderProgram {
- id: program
- texture: "textures/qtlogo.png"
-
- property real textureOffsetX : 0.0
- property real squashFactor : 0.0
- NumberAnimation on textureOffsetX
- {
- running: true; loops: Animation.Infinite
- from: 0.0; to: 1.0;
- duration: 1000
- }
-
- SequentialAnimation on squashFactor
- {
- running: true; loops: Animation.Infinite
- NumberAnimation {
- from: 0.0; to: 1.0; duration: 1000
- easing.type: "InQuad"
- }
- PauseAnimation {
- duration: 250
- }
- NumberAnimation {
- from: 1.0; to: 0.0; duration: 1000
- easing.type: "OutQuad"
- }
- }
-
- vertexShader: "
- attribute highp vec4 qt_Vertex;
- uniform mediump mat4 qt_ModelViewProjectionMatrix;
-
- attribute highp vec4 qt_MultiTexCoord0;
- varying highp vec4 texCoord;
- uniform mediump float textureOffsetX;
- uniform mediump float squashFactor;
-
- void main(void)
- {
- const float modelSize = 2.0;
- const float modelBottom = -1.0;
- float newY = max(qt_Vertex.y - squashFactor * modelSize,
- qt_Vertex.y * 0.01 + modelBottom);
- gl_Position = qt_ModelViewProjectionMatrix *
- vec4(qt_Vertex.x, newY, qt_Vertex.zw);
-
- texCoord = vec4(-qt_MultiTexCoord0.s
- - textureOffsetX,
- -qt_MultiTexCoord0.t,
- qt_MultiTexCoord0.pq);
- }
- "
- fragmentShader: "
- varying highp vec4 texCoord;
- uniform sampler2D qt_Texture0;
-
- void main(void)
- {
- mediump vec4 textureColor = texture2D(qt_Texture0, texCoord.st);
- gl_FragColor = textureColor;
- }
- "
- }
-}
diff --git a/tutorials/quick3d/shaders/shader-tutorial-3-transformed-coordinates.qml b/tutorials/quick3d/shaders/shader-tutorial-3-transformed-coordinates.qml
deleted file mode 100644
index 491a9a17..00000000
--- a/tutorials/quick3d/shaders/shader-tutorial-3-transformed-coordinates.qml
+++ /dev/null
@@ -1,126 +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 1.0
-import Qt3D 1.0
-
-Viewport {
- width: 640; height: 480
-
-
- Item3D {
- z: -8.0
- transform: [
- Rotation3D {
- NumberAnimation on angle {
- running: true; loops: Animation.Infinite
- from: 0; to: 360; duration: 5000
- }
- axis: Qt.vector3d(0, 0, 1.0)
- }
- ]
-
- TutorialTeapot {id: teapot1; effect: program; y:2.0; x:0.0}
- TutorialTeapot {id: teapot2; effect: program; y:-1.0; x:-1.732}
- TutorialTeapot {id: teapot3; effect: program; y:-1.0; x:1.732}
- }
-
- ShaderProgram {
- id: program
- texture: "textures/qtlogo.png"
-
- property real textureOffsetX : 0.0
- property real squashFactor : 0.0
- NumberAnimation on textureOffsetX
- {
- running: true; loops: Animation.Infinite
- from: 0.0; to: 1.0;
- duration: 1000
- }
-
- SequentialAnimation on squashFactor
- {
- running: true; loops: Animation.Infinite
- NumberAnimation {
- from: 0.0; to: 1.0; duration: 1000
- easing.type: "InQuad"
- }
- PauseAnimation {
- duration: 250
- }
- NumberAnimation {
- from: 1.0; to: 0.0; duration: 1000
- easing.type: "OutQuad"
- }
- }
-
-
- vertexShader: "
- attribute highp vec4 qt_Vertex;
- uniform mediump mat4 qt_ModelViewProjectionMatrix;
-
- attribute mediump vec4 qt_MultiTexCoord0;
- varying mediump vec4 texCoord;
-
- void main(void)
- {
- const float modelBottom = -4.0;
-
- vec4 workingPosition = qt_ModelViewProjectionMatrix * qt_Vertex;
- float newY = max(workingPosition.y,
- workingPosition.y * 0.15 + modelBottom);
- workingPosition.y = newY;
- gl_Position = workingPosition;
-
- texCoord = -qt_MultiTexCoord0;
- }
- "
- fragmentShader: "
- varying mediump vec4 texCoord;
- uniform sampler2D qt_Texture0;
-
- void main(void)
- {
- mediump vec4 textureColor = texture2D(qt_Texture0, texCoord.st);
- gl_FragColor = textureColor;
- }
- "
- }
-}
diff --git a/tutorials/quick3d/shaders/shader-tutorial-lighting.qml b/tutorials/quick3d/shaders/shader-tutorial-lighting.qml
deleted file mode 100644
index daaa7b4c..00000000
--- a/tutorials/quick3d/shaders/shader-tutorial-lighting.qml
+++ /dev/null
@@ -1,85 +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 1.0
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-
-Viewport {
- width: 640; height: 480
-
-
- Cube {
- id: teapot
- effect: program
-// xRotation: 30
- }
-
- ShaderProgram {
- id: program
- texture: "textures/qtlogo.png"
-
- vertexShader: "
- attribute highp vec4 qt_Vertex;
- uniform highp mat4 qt_ModelViewProjectionMatrix;
-
- attribute highp vec4 qt_MultiTexCoord0;
- varying highp vec4 texCoord;
-
- void main(void)
- {
- gl_Position = qt_ModelViewProjectionMatrix * qt_Vertex;
-// texCoord = -qt_MultiTexCoord0;
- texCoord = qt_Vertex;
- }
- "
- fragmentShader: "
- varying highp vec4 texCoord;
- uniform sampler2D qt_Texture0;
-
- void main(void)
- {
- mediump vec4 textureColor = texture2D(qt_Texture0, texCoord.st);
-// gl_FragColor = textureColor;
- gl_FragColor = vec4(texCoord.xyz , 1.0);
- }
- "
- }
-}
diff --git a/tutorials/quick3d/shaders/shader-tutorial-varying.qml b/tutorials/quick3d/shaders/shader-tutorial-varying.qml
deleted file mode 100644
index 26f3ea2d..00000000
--- a/tutorials/quick3d/shaders/shader-tutorial-varying.qml
+++ /dev/null
@@ -1,77 +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 1.0
-import Qt3D 1.0
-
-Viewport {
- width: 640; height: 480
-
- Pane {
- effect: ShaderProgram {
- id: program
-
- vertexShader: "
- attribute highp vec4 qt_Vertex;
- uniform mediump mat4 qt_ModelViewProjectionMatrix;
-
- attribute highp vec4 qt_MultiTexCoord0;
- varying highp vec4 texCoord;
-
- void main(void)
- {
- gl_Position = qt_ModelViewProjectionMatrix * qt_Vertex;
- texCoord = vec4(qt_MultiTexCoord0.st, 0, 0);
- }
- "
- fragmentShader: "
- varying highp vec4 texCoord;
-
- void main(void)
- {
- gl_FragColor = vec4(mod(texCoord.x, 1.0),
- mod(texCoord.y, 1.0),
- 0.0,
- 1.0);
- }
- "
- }
- }
-}
diff --git a/tutorials/quick3d/shaders/shader-tutorial.qml b/tutorials/quick3d/shaders/shader-tutorial.qml
deleted file mode 100644
index 57d6083c..00000000
--- a/tutorials/quick3d/shaders/shader-tutorial.qml
+++ /dev/null
@@ -1,83 +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
-
-Viewport {
- width: 640; height: 480
-
-
- TutorialTeapot {
- id: teapot
- effect: program
- xRotation: 30
- }
-
- ShaderProgram {
- id: program
- texture: "textures/qtlogo.png"
-
- vertexShader: "
- attribute highp vec4 qt_Vertex;
- uniform highp mat4 qt_ModelViewProjectionMatrix;
-
- attribute highp vec4 qt_MultiTexCoord0;
- varying highp vec4 texCoord;
-
- void main(void)
- {
- texCoord = qt_MultiTexCoord0;
- gl_Position = qt_ModelViewProjectionMatrix * qt_Vertex;
- }
- "
- fragmentShader: "
- varying highp vec4 texCoord;
- uniform sampler2D qt_Texture0;
-
- void main(void)
- {
- mediump vec4 textureColor = texture2D(qt_Texture0, texCoord.st);
- gl_FragColor = textureColor;
- }
- "
- }
-}
-//! [1]
diff --git a/tutorials/quick3d/shaders/shaders.pro b/tutorials/quick3d/shaders/shaders.pro
deleted file mode 100644
index e33763fb..00000000
--- a/tutorials/quick3d/shaders/shaders.pro
+++ /dev/null
@@ -1,7 +0,0 @@
-TEMPLATE = subdirs
-
-# These examples contain no C++ and can simply be copied
-sources.files = .
-
-sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials
-INSTALLS += sources
diff --git a/tutorials/quick3d/shaders/shaders.qmlproject b/tutorials/quick3d/shaders/shaders.qmlproject
deleted file mode 100644
index d4909f86..00000000
--- a/tutorials/quick3d/shaders/shaders.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: [ " ../exampleplugin " ]
-}
diff --git a/tutorials/quick3d/teapot_bounce_qml/main.cpp b/tutorials/quick3d/teapot_bounce_qml/main.cpp
deleted file mode 100644
index 8884f056..00000000
--- a/tutorials/quick3d/teapot_bounce_qml/main.cpp
+++ /dev/null
@@ -1,69 +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/QApplication>
-#include "qdeclarativeview3d.h"
-
-#include "../qmlres.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
-
- QDeclarativeView3D view;
- QString qml = q_get_qmldir(QLatin1String("qml/teapot-bounce.qml"));
- view.setSource(QUrl::fromLocalFile(qml));
-
-#ifdef Q_OS_SYMBIAN
- view.setAttribute(Qt::WA_LockLandscapeOrientation, true);
- view.setResizeMode(QDeclarativeView::SizeRootObjectToView);
- view.showFullScreen();
-#else
- if (QApplication::arguments().contains(QLatin1String("-maximize")))
- view.showMaximized();
- else if (QApplication::arguments().contains(QLatin1String("-fullscreen")))
- view.showFullScreen();
- else
- view.show();
-#endif
-
- return app.exec();
-}
diff --git a/tutorials/quick3d/teapot_bounce_qml/qml/teapot-bounce.qml b/tutorials/quick3d/teapot_bounce_qml/qml/teapot-bounce.qml
deleted file mode 100644
index 692a0f5d..00000000
--- a/tutorials/quick3d/teapot_bounce_qml/qml/teapot-bounce.qml
+++ /dev/null
@@ -1,76 +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 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 1.0
-import Qt3D 1.0
-
-Viewport {
- width: 640; height: 480
-
-//! [1]
- Item3D {
- id: teapot
- mesh: Mesh { source: "teapot.bez" }
-
- effect: Effect {
- material: china
- }
-
- Material {
- id: china
- ambientColor: "#c09680"
- specularColor: "#3c3c3c"
- shininess: 128
- }
-//! [1]
-
-//! [3]
- SequentialAnimation on y {
- running: true
- loops: Animation.Infinite
- PauseAnimation { duration: 500 }
- NumberAnimation { to : 1.0; duration: 300; easing.type: "OutQuad" }
- NumberAnimation { to : 0.0; duration: 300; easing.type: "OutBounce" }
- }
-//! [3]
-//! [2]
- }
-//! [2]
-}
diff --git a/tutorials/quick3d/teapot_bounce_qml/qml/teapot.bez b/tutorials/quick3d/teapot_bounce_qml/qml/teapot.bez
deleted file mode 100644
index 02b2ac44..00000000
--- a/tutorials/quick3d/teapot_bounce_qml/qml/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/tutorials/quick3d/teapot_bounce_qml/teapot_bounce_qml.desktop b/tutorials/quick3d/teapot_bounce_qml/teapot_bounce_qml.desktop
deleted file mode 100644
index 13bc1a48..00000000
--- a/tutorials/quick3d/teapot_bounce_qml/teapot_bounce_qml.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=Teapot Bounce
-Icon=/usr/share/icons/hicolor/80x80/apps/qtquick3d.png
-Exec=/usr/bin/invoker --type=e -s /usr/bin/teapot_bounce_qml -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_teapot_bounce_qml
diff --git a/tutorials/quick3d/teapot_bounce_qml/teapot_bounce_qml.pro b/tutorials/quick3d/teapot_bounce_qml/teapot_bounce_qml.pro
deleted file mode 100644
index 00296cf1..00000000
--- a/tutorials/quick3d/teapot_bounce_qml/teapot_bounce_qml.pro
+++ /dev/null
@@ -1,25 +0,0 @@
-TEMPLATE = app
-TARGET = teapot_bounce_qml
-CONFIG += qt warn_on
-
-SOURCES += main.cpp
-HEADERS += ../qmlres.h
-
-DESTDIR = ../../../bin
-
-INSTALL_DIRS = qml
-
-CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg
-include(../../../pkg.pri)
-qtcAddDeployment()
-
-symbian {
- vendorinfo = \
- "%{\"Nokia\"}" \
- ":\"Nokia\""
-
- my_deployment.pkg_prerules = vendorinfo
- DEPLOYMENT += my_deployment
-
- ICON = ../qtquick3d.svg
-}
diff --git a/tutorials/quick3d/teapot_bounce_qml/teapot_bounce_qml.rc b/tutorials/quick3d/teapot_bounce_qml/teapot_bounce_qml.rc
deleted file mode 100644
index 1b6228c9..00000000
--- a/tutorials/quick3d/teapot_bounce_qml/teapot_bounce_qml.rc
+++ /dev/null
@@ -1 +0,0 @@
-IDI_ICON1 ICON DISCARDABLE "qtquick3d.ico"
diff --git a/tutorials/quick3d/teapot_qml/main.cpp b/tutorials/quick3d/teapot_qml/main.cpp
deleted file mode 100644
index db995465..00000000
--- a/tutorials/quick3d/teapot_qml/main.cpp
+++ /dev/null
@@ -1,69 +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/QApplication>
-#include "qdeclarativeview3d.h"
-
-#include "../qmlres.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
-
- QDeclarativeView3D view;
- QString qml = q_get_qmldir(QLatin1String("qml/teapot.qml"));
- view.setSource(QUrl::fromLocalFile(qml));
-
-#ifdef Q_OS_SYMBIAN
- view.setAttribute(Qt::WA_LockLandscapeOrientation, true);
- view.setResizeMode(QDeclarativeView::SizeRootObjectToView);
- view.showFullScreen();
-#else
- if (QApplication::arguments().contains(QLatin1String("-maximize")))
- view.showMaximized();
- else if (QApplication::arguments().contains(QLatin1String("-fullscreen")))
- view.showFullScreen();
- else
- view.show();
-#endif
-
- return app.exec();
-}
diff --git a/tutorials/quick3d/teapot_qml/qml/teapot.bez b/tutorials/quick3d/teapot_qml/qml/teapot.bez
deleted file mode 100644
index 02b2ac44..00000000
--- a/tutorials/quick3d/teapot_qml/qml/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/tutorials/quick3d/teapot_qml/qml/teapot.qml b/tutorials/quick3d/teapot_qml/qml/teapot.qml
deleted file mode 100644
index c037380a..00000000
--- a/tutorials/quick3d/teapot_qml/qml/teapot.qml
+++ /dev/null
@@ -1,59 +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 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]
-//![2]
-import QtQuick 1.0
-import Qt3D 1.0
-//![2]
-
-//![3]
-Viewport {
- width: 640; height: 480
-//![3]
-//![4]
- Item3D {
- id: teapot
- mesh: Mesh { source: "teapot.bez" }
- effect: Effect {}
- }
-//![4]
-}
-//![1]
diff --git a/tutorials/quick3d/teapot_qml/teapot_qml.desktop b/tutorials/quick3d/teapot_qml/teapot_qml.desktop
deleted file mode 100644
index 9d5c550e..00000000
--- a/tutorials/quick3d/teapot_qml/teapot_qml.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=Teapot
-Icon=/usr/share/icons/hicolor/80x80/apps/qtquick3d.png
-Exec=/usr/bin/invoker --type=e -s /usr/bin/teapot_qml -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_teapot_qml
diff --git a/tutorials/quick3d/teapot_qml/teapot_qml.pro b/tutorials/quick3d/teapot_qml/teapot_qml.pro
deleted file mode 100644
index 4a48a79b..00000000
--- a/tutorials/quick3d/teapot_qml/teapot_qml.pro
+++ /dev/null
@@ -1,25 +0,0 @@
-TEMPLATE = app
-TARGET = teapot_qml
-CONFIG += qt warn_on
-
-SOURCES += main.cpp
-HEADERS += ../qmlres.h
-
-DESTDIR = ../../../bin
-
-INSTALL_DIRS = qml
-
-CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg
-include(../../../pkg.pri)
-qtcAddDeployment()
-
-symbian {
- vendorinfo = \
- "%{\"Nokia\"}" \
- ":\"Nokia\""
-
- my_deployment.pkg_prerules = vendorinfo
- DEPLOYMENT += my_deployment
-
- ICON = ../qtquick3d.svg
-}
diff --git a/tutorials/quick3d/teapot_qml/teapot_qml.rc b/tutorials/quick3d/teapot_qml/teapot_qml.rc
deleted file mode 100644
index 1b6228c9..00000000
--- a/tutorials/quick3d/teapot_qml/teapot_qml.rc
+++ /dev/null
@@ -1 +0,0 @@
-IDI_ICON1 ICON DISCARDABLE "qtquick3d.ico"
diff --git a/tutorials/tutorials.pro b/tutorials/tutorials.pro
deleted file mode 100644
index 7855f3f1..00000000
--- a/tutorials/tutorials.pro
+++ /dev/null
@@ -1,9 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS += qt3d quick3d
-
-# These tutorial directories contain code that is of instructive value only,
-# and therefore it is not packaged for installation along with demos and
-# examples, by default.
-
-# To install these apps as part of learning Qt Quick 3D simply follow the
-# technique used in the examples directories.
diff --git a/util/gencube/gencube.cpp b/util/gencube/gencube.cpp
deleted file mode 100644
index 9cfa3f8e..00000000
--- a/util/gencube/gencube.cpp
+++ /dev/null
@@ -1,152 +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$
-**
-****************************************************************************/
-
-// Used to generate the cube vertex arrays for qglcube.cpp.
-
-#include <stdio.h>
-
-static float const normals[6 * 3] = {
- -1.0f, 0.0f, 0.0f,
- 0.0f, 1.0f, 0.0f,
- 1.0f, 0.0f, 0.0f,
- 0.0f, -1.0f, 0.0f,
- 0.0f, 0.0f, 1.0f,
- 0.0f, 0.0f, -1.0f
-};
-
-static float const vertices[8 * 3] = {
- -0.5f, -0.5f, -0.5f,
- -0.5f, -0.5f, 0.5f,
- -0.5f, 0.5f, 0.5f,
- -0.5f, 0.5f, -0.5f,
- 0.5f, -0.5f, -0.5f,
- 0.5f, -0.5f, 0.5f,
- 0.5f, 0.5f, 0.5f,
- 0.5f, 0.5f, -0.5f
-};
-
-static float const texCoords[4 * 2] = {
- 1.0f, 0.0f,
- 1.0f, 1.0f,
- 0.0f, 1.0f,
- 0.0f, 0.0f
-};
-
-static unsigned short const indices[6 * 4] = {
- 0, 1, 2, 3, 3, 2, 6, 7, 7, 6, 5, 4,
- 4, 5, 1, 0, 5, 6, 2, 1, 7, 4, 0, 3
-};
-
-int main(int argc, char *argv[])
-{
- float vert[6][6][3];
- float norm[6][6][3];
- float tcoords[6][6][2];
- for (int face = 0; face < 6; ++face) {
- norm[face][0][0] = normals[face * 3 + 0];
- norm[face][0][1] = normals[face * 3 + 1];
- norm[face][0][2] = normals[face * 3 + 2];
- norm[face][1][0] = normals[face * 3 + 0];
- norm[face][1][1] = normals[face * 3 + 1];
- norm[face][1][2] = normals[face * 3 + 2];
- norm[face][2][0] = normals[face * 3 + 0];
- norm[face][2][1] = normals[face * 3 + 1];
- norm[face][2][2] = normals[face * 3 + 2];
- norm[face][3][0] = normals[face * 3 + 0];
- norm[face][3][1] = normals[face * 3 + 1];
- norm[face][3][2] = normals[face * 3 + 2];
- norm[face][4][0] = normals[face * 3 + 0];
- norm[face][4][1] = normals[face * 3 + 1];
- norm[face][4][2] = normals[face * 3 + 2];
- norm[face][5][0] = normals[face * 3 + 0];
- norm[face][5][1] = normals[face * 3 + 1];
- norm[face][5][2] = normals[face * 3 + 2];
-
- vert[face][0][0] = vertices[indices[face * 4] * 3 + 0];
- vert[face][0][1] = vertices[indices[face * 4] * 3 + 1];
- vert[face][0][2] = vertices[indices[face * 4] * 3 + 2];
- vert[face][1][0] = vertices[indices[face * 4 + 1] * 3 + 0];
- vert[face][1][1] = vertices[indices[face * 4 + 1] * 3 + 1];
- vert[face][1][2] = vertices[indices[face * 4 + 1] * 3 + 2];
- vert[face][2][0] = vertices[indices[face * 4 + 2] * 3 + 0];
- vert[face][2][1] = vertices[indices[face * 4 + 2] * 3 + 1];
- vert[face][2][2] = vertices[indices[face * 4 + 2] * 3 + 2];
- vert[face][3][0] = vertices[indices[face * 4] * 3 + 0];
- vert[face][3][1] = vertices[indices[face * 4] * 3 + 1];
- vert[face][3][2] = vertices[indices[face * 4] * 3 + 2];
- vert[face][4][0] = vertices[indices[face * 4 + 2] * 3 + 0];
- vert[face][4][1] = vertices[indices[face * 4 + 2] * 3 + 1];
- vert[face][4][2] = vertices[indices[face * 4 + 2] * 3 + 2];
- vert[face][5][0] = vertices[indices[face * 4 + 3] * 3 + 0];
- vert[face][5][1] = vertices[indices[face * 4 + 3] * 3 + 1];
- vert[face][5][2] = vertices[indices[face * 4 + 3] * 3 + 2];
-
- tcoords[face][0][0] = texCoords[0];
- tcoords[face][0][1] = texCoords[1];
- tcoords[face][1][0] = texCoords[2];
- tcoords[face][1][1] = texCoords[3];
- tcoords[face][2][0] = texCoords[4];
- tcoords[face][2][1] = texCoords[5];
- tcoords[face][3][0] = texCoords[0];
- tcoords[face][3][1] = texCoords[1];
- tcoords[face][4][0] = texCoords[4];
- tcoords[face][4][1] = texCoords[5];
- tcoords[face][5][0] = texCoords[6];
- tcoords[face][5][1] = texCoords[7];
- }
- printf("#define QGL_CUBE_SIZE (6 * 6 * (3 + 3 + 2))\n");
- printf("static float const cubeVertices[QGL_CUBE_SIZE] = {\n");
- for (int face = 0; face < 6; ++face) {
- for (int index = 0; index < 6; ++index) {
- printf(" %.1ff, %.1ff, %.1ff, ",
- vert[face][index][0], vert[face][index][1],
- vert[face][index][2]);
- printf("%.1ff, %.1ff, %.1ff, ",
- norm[face][index][0], norm[face][index][1],
- norm[face][index][2]);
- printf("%.1ff, %.1ff,\n",
- tcoords[face][index][0], tcoords[face][index][1]);
- }
- printf("\n");
- }
- printf("};\n\n");
- return 0;
-}
diff --git a/util/gencube/genobjcube.cpp b/util/gencube/genobjcube.cpp
deleted file mode 100644
index dc78837a..00000000
--- a/util/gencube/genobjcube.cpp
+++ /dev/null
@@ -1,106 +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$
-**
-****************************************************************************/
-
-// Used to generate cube.obj.
-
-#include <stdio.h>
-
-static float const normals[6 * 3] = {
- -1.0f, 0.0f, 0.0f,
- 0.0f, 1.0f, 0.0f,
- 1.0f, 0.0f, 0.0f,
- 0.0f, -1.0f, 0.0f,
- 0.0f, 0.0f, 1.0f,
- 0.0f, 0.0f, -1.0f
-};
-
-static float const vertices[8 * 3] = {
- -0.5f, -0.5f, -0.5f,
- -0.5f, -0.5f, 0.5f,
- -0.5f, 0.5f, 0.5f,
- -0.5f, 0.5f, -0.5f,
- 0.5f, -0.5f, -0.5f,
- 0.5f, -0.5f, 0.5f,
- 0.5f, 0.5f, 0.5f,
- 0.5f, 0.5f, -0.5f
-};
-
-static float const texCoords[4 * 2] = {
- 1.0f, 0.0f,
- 1.0f, 1.0f,
- 0.0f, 1.0f,
- 0.0f, 0.0f
-};
-
-static unsigned short const indices[6 * 4] = {
- 0, 1, 2, 3, 3, 2, 6, 7, 7, 6, 5, 4,
- 4, 5, 1, 0, 5, 6, 2, 1, 7, 4, 0, 3
-};
-
-int main(int argc, char *argv[])
-{
- printf("s 0\n");
- for (int vert = 0; vert < 8; ++vert) {
- printf("v %.1f %.1f %.1f\n",
- vertices[vert * 3 + 0],
- vertices[vert * 3 + 1],
- vertices[vert * 3 + 2]);
- }
- for (int norm = 0; norm < 6; ++norm) {
- printf("vn %.1f %.1f %.1f\n",
- normals[norm * 3 + 0],
- normals[norm * 3 + 1],
- normals[norm * 3 + 2]);
- }
- for (int tex = 0; tex < 4; ++tex) {
- printf("vt %.1f %.1f\n",
- texCoords[tex * 2 + 0],
- texCoords[tex * 2 + 1]);
- }
- for (int face = 0; face < 6; ++face) {
- printf("f %d/%d/%d %d/%d/%d %d/%d/%d %d/%d/%d\n",
- indices[face * 4 + 0] + 1, 1, face + 1,
- indices[face * 4 + 1] + 1, 2, face + 1,
- indices[face * 4 + 2] + 1, 3, face + 1,
- indices[face * 4 + 3] + 1, 4, face + 1);
- }
- return 0;
-}
diff --git a/util/meshcvt/README b/util/meshcvt/README
deleted file mode 100644
index 71679eff..00000000
--- a/util/meshcvt/README
+++ /dev/null
@@ -1,32 +0,0 @@
-This program converts an object defined as a set of Bezier patches
-into vertex array data that can be used to draw it. A Bezier patch
-is a curved surface defined in terms of 16 control points.
-The object is decomposed into triangles for rendering.
-
-The primary use for this program is to convert the patch data from
-http://www.sjbaker.org/teapot/teaset.tgz for the classic 3D teapot,
-but it should work on other objects defined as Bezier patches
-or triangle meshes.
-
-The usage for this utility is:
-
- meshcvt mesh-filename name [depth]
-
-The data to represent the object will be written to standard output.
-The "depth" parameter indicates the recursive depth for sub-dividing
-Bezier patches into triangles. The default value is 4.
-
-The input file format starts with the number of patches.
-The following lines contain 16 indices to define a patch.
-The indices should be comma-separated.
-
-Following the index groups is the number of vertices, and then that
-many vertex definitions. Each vertex definition consists of three
-floating-point values, comma-separated. Three more comma-separated
-floating-point values can appear on the line after the vertex
-co-ordinates to define a vertex normal.
-
-The teapot.txt file provides the data for the classic 3D teapot
-from the above URL as an example of what a Bezier patch definition
-file looks like. The above URL also has Bezier patch data for a
-teacup and a teaspoon, to complete your tea service.
diff --git a/util/meshcvt/meshcvt.cpp b/util/meshcvt/meshcvt.cpp
deleted file mode 100644
index e01b0452..00000000
--- a/util/meshcvt/meshcvt.cpp
+++ /dev/null
@@ -1,216 +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 <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <QtGui/qvector3d.h>
-#include "qarray.h"
-
-static void meshError(const char *filename)
-{
- qWarning("%s: does not contain valid mesh data\n", filename);
- exit(1);
-}
-
-static int numPatches = 0;
-static int numVertices = 0;
-static int *patches = 0;
-
-int main(int argc, char *argv[])
-{
- int depth = 4;
- int teapotAdjust = 0;
- int reversePatches = 0;
- char buffer[BUFSIZ];
- char *filename;
- char *name;
- QArray<QVector3D> vertices;
-
- // Validate the command-line arguments.
- if (argc < 3) {
- qWarning("Usage: %s [--teapot-adjust] [--reverse-patches] mesh-filename name [depth]\n", argv[0]);
- return 1;
- }
- if (!strcmp(argv[1], "--teapot-adjust")) {
- // Adjust the vertices to correctly size and position the teapot.
- ++argv;
- --argc;
- teapotAdjust = 1;
- }
- if (!strcmp(argv[1], "--reverse-patches")) {
- // Reverse the coordinate order of patches (fixes teacup).
- ++argv;
- --argc;
- reversePatches = 1;
- }
- filename = argv[1];
- name = argv[2];
- if (argc > 3)
- depth = atoi(argv[3]);
-
- // Read the mesh data from the input file and determine
- // if it is a Bezier patch mesh or a triangle mesh.
- FILE *file;
- if ((file = fopen(filename, "r")) == NULL) {
- perror(filename);
- return 1;
- }
- if (fscanf(file, "%i\n", &numPatches) != 1)
- meshError(filename);
- patches = new int [numPatches * 17];
- for (int patch = 0; patch < numPatches; ++patch) {
- int *p = patches + patch * 17;
- if (!fgets(buffer, sizeof(buffer), file))
- meshError(filename);
- if (sscanf(buffer, "%i, %i, %i, %i, %i, %i, %i, %i, "
- "%i, %i, %i, %i, %i, %i, %i, %i, %i\n",
- p, p + 1, p + 2, p + 3,
- p + 4, p + 5, p + 6, p + 7,
- p + 8, p + 9, p + 10, p + 11,
- p + 12, p + 13, p + 14, p + 15, p + 16) != 17) {
- if (sscanf(buffer, "%i, %i, %i, %i, %i, %i, %i, %i, "
- "%i, %i, %i, %i, %i, %i, %i, %i\n",
- p, p + 1, p + 2, p + 3,
- p + 4, p + 5, p + 6, p + 7,
- p + 8, p + 9, p + 10, p + 11,
- p + 12, p + 13, p + 14, p + 15) != 16) {
- meshError(filename);
- } else {
- p[16] = -1; // Use the default minimum depth value.
- }
- }
- if (reversePatches) {
- int reversed[16];
- for (int i = 0; i < 16; ++i)
- reversed[i] = p[(i & 0x0C) + (3 - (i % 4))];
- for (int i = 0; i < 16; ++i)
- p[i] = reversed[i];
- }
- // The standard patch indices are 1-based, not 0-based.
- // Correct for that problem here.
- for (int offset = 0; offset < 16; ++offset)
- --(p[offset]);
- }
- if (fscanf(file, "%i\n", &numVertices) != 1)
- meshError(filename);
- for (int vertex = 0; vertex < numVertices; ++vertex) {
- float x, y, z, xnormal, ynormal, znormal;
- if (!fgets(buffer, sizeof(buffer), file))
- meshError(filename);
- if (sscanf(buffer, "%f, %f, %f, %f, %f, %f\n",
- &x, &y, &z, &xnormal, &ynormal, &znormal) != 6) {
- if (sscanf(buffer, "%f, %f, %f\n", &x, &y, &z) != 3)
- meshError(filename);
- }
- if (teapotAdjust) {
- // Do the equivalent of the following transformation:
- // matrix.rotate(270.0f, 1.0f, 0.0f, 0.0f);
- // matrix.scale(0.5f, 0.5f, 0.5f);
- // matrix.translate(0.0f, 0.0f, -1.5f);
- z -= 1.5f;
- x *= 0.5f;
- y *= 0.5f;
- z *= 0.5f;
- float y2 = z;
- float z2 = -y;
- y = y2;
- z = z2;
- }
- vertices.append(QVector3D(x, y, z));
- }
- fclose(file);
-
- // Generate the output data.
- printf("// Generated from %s by meshcvt, depth = %d\n\n", filename, depth);
- printf("#define %sBezierVertexCount %d\n", name, numVertices);
- printf("#define %sPatchCount %d\n", name, numPatches);
- printf("#define %sDepth %d\n", name, depth);
- printf("static float const %sBezierVertexData[] = {\n", name);
- for (int vertex = 0; vertex < vertices.count(); ++vertex) {
- QVector3D v = vertices[vertex];
- printf(" %ff, %ff, %ff", v.x(), v.y(), v.z());
- if (vertex < (vertices.count() - 1))
- printf(",\n");
- else
- printf("\n");
- }
- printf("};\n\n");
- printf("static ushort const %sPatchData[] = {\n", name);
- for (int patch = 0; patch < numPatches; ++patch) {
- int *p = patches + patch * 17;
- printf(" %d, %d, %d, %d, %d, %d, %d, %d, "
- "%d, %d, %d, %d, %d, %d, %d, %d",
- p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7],
- p[8], p[9], p[10], p[11], p[12], p[13], p[14], p[15]);
- if (patch < (numPatches - 1))
- printf(",\n");
- else
- printf("\n");
- }
- printf("};\n");
- printf("\n");
- printf("class %sPatches : public QGLBezierPatches\n{\n", name);
- printf("public:\n");
- printf(" %sPatches()\n", name);
- printf(" {\n");
- printf(" QVector3DArray positions;\n");
- printf(" for (int pindex = 0; pindex < %sPatchCount * 16; ++pindex) {\n", name);
- printf(" int vindex = %sPatchData[pindex];\n", name);
- printf(" positions.append(%sBezierVertexData[vindex * 3],\n", name);
- printf(" %sBezierVertexData[vindex * 3 + 1],\n", name);
- printf(" %sBezierVertexData[vindex * 3 + 2]);\n", name);
- printf(" }\n");
- printf(" setPositions(positions);\n");
- printf(" setSubdivisionDepth(%sDepth);\n", name);
- printf(" }\n");
- printf("};\n");
-
- // Dump some statistics to stderr.
- qWarning("Depth: %d\n", depth);
- qWarning("Number of vertices: %d\n", numVertices);
- qWarning("Number of patches: %d\n", numPatches);
- int storage = numVertices * sizeof(float) * 3;
- storage += numPatches * sizeof(ushort);
- qWarning("Bezier storage: %d bytes\n", storage);
-
- return 0;
-}
diff --git a/util/meshcvt/meshcvt.pro b/util/meshcvt/meshcvt.pro
deleted file mode 100644
index 53f336af..00000000
--- a/util/meshcvt/meshcvt.pro
+++ /dev/null
@@ -1,8 +0,0 @@
-TARGET = meshcvt
-
-CONFIG += qt3d
-
-SOURCES += \
- meshcvt.cpp \
-
-win32:DEFINES+=_CRT_SECURE_NO_WARNINGS
diff --git a/util/meshcvt/teapot.txt b/util/meshcvt/teapot.txt
deleted file mode 100644
index 9f62bb5e..00000000
--- a/util/meshcvt/teapot.txt
+++ /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
-1.4,0.0,2.4
-1.4,-0.784,2.4
-0.784,-1.4,2.4
-0.0,-1.4,2.4
-1.3375,0.0,2.53125
-1.3375,-0.749,2.53125
-0.749,-1.3375,2.53125
-0.0,-1.3375,2.53125
-1.4375,0.0,2.53125
-1.4375,-0.805,2.53125
-0.805,-1.4375,2.53125
-0.0,-1.4375,2.53125
-1.5,0.0,2.4
-1.5,-0.84,2.4
-0.84,-1.5,2.4
-0.0,-1.5,2.4
--0.784,-1.4,2.4
--1.4,-0.784,2.4
--1.4,0.0,2.4
--0.749,-1.3375,2.53125
--1.3375,-0.749,2.53125
--1.3375,0.0,2.53125
--0.805,-1.4375,2.53125
--1.4375,-0.805,2.53125
--1.4375,0.0,2.53125
--0.84,-1.5,2.4
--1.5,-0.84,2.4
--1.5,0.0,2.4
--1.4,0.784,2.4
--0.784,1.4,2.4
-0.0,1.4,2.4
--1.3375,0.749,2.53125
--0.749,1.3375,2.53125
-0.0,1.3375,2.53125
--1.4375,0.805,2.53125
--0.805,1.4375,2.53125
-0.0,1.4375,2.53125
--1.5,0.84,2.4
--0.84,1.5,2.4
-0.0,1.5,2.4
-0.784,1.4,2.4
-1.4,0.784,2.4
-0.749,1.3375,2.53125
-1.3375,0.749,2.53125
-0.805,1.4375,2.53125
-1.4375,0.805,2.53125
-0.84,1.5,2.4
-1.5,0.84,2.4
-1.75,0.0,1.875
-1.75,-0.98,1.875
-0.98,-1.75,1.875
-0.0,-1.75,1.875
-2.0,0.0,1.35
-2.0,-1.12,1.35
-1.12,-2.0,1.35
-0.0,-2.0,1.35
-2.0,0.0,0.9
-2.0,-1.12,0.9
-1.12,-2.0,0.9
-0.0,-2.0,0.9
--0.98,-1.75,1.875
--1.75,-0.98,1.875
--1.75,0.0,1.875
--1.12,-2.0,1.35
--2.0,-1.12,1.35
--2.0,0.0,1.35
--1.12,-2.0,0.9
--2.0,-1.12,0.9
--2.0,0.0,0.9
--1.75,0.98,1.875
--0.98,1.75,1.875
-0.0,1.75,1.875
--2.0,1.12,1.35
--1.12,2.0,1.35
-0.0,2.0,1.35
--2.0,1.12,0.9
--1.12,2.0,0.9
-0.0,2.0,0.9
-0.98,1.75,1.875
-1.75,0.98,1.875
-1.12,2.0,1.35
-2.0,1.12,1.35
-1.12,2.0,0.9
-2.0,1.12,0.9
-2.0,0.0,0.45
-2.0,-1.12,0.45
-1.12,-2.0,0.45
-0.0,-2.0,0.45
-1.5,0.0,0.225
-1.5,-0.84,0.225
-0.84,-1.5,0.225
-0.0,-1.5,0.225
-1.5,0.0,0.15
-1.5,-0.84,0.15
-0.84,-1.5,0.15
-0.0,-1.5,0.15
--1.12,-2.0,0.45
--2.0,-1.12,0.45
--2.0,0.0,0.45
--0.84,-1.5,0.225
--1.5,-0.84,0.225
--1.5,0.0,0.225
--0.84,-1.5,0.15
--1.5,-0.84,0.15
--1.5,0.0,0.15
--2.0,1.12,0.45
--1.12,2.0,0.45
-0.0,2.0,0.45
--1.5,0.84,0.225
--0.84,1.5,0.225
-0.0,1.5,0.225
--1.5,0.84,0.15
--0.84,1.5,0.15
-0.0,1.5,0.15
-1.12,2.0,0.45
-2.0,1.12,0.45
-0.84,1.5,0.225
-1.5,0.84,0.225
-0.84,1.5,0.15
-1.5,0.84,0.15
--1.6,0.0,2.025
--1.6,-0.3,2.025
--1.5,-0.3,2.25
--1.5,0.0,2.25
--2.3,0.0,2.025
--2.3,-0.3,2.025
--2.5,-0.3,2.25
--2.5,0.0,2.25
--2.7,0.0,2.025
--2.7,-0.3,2.025
--3.0,-0.3,2.25
--3.0,0.0,2.25
--2.7,0.0,1.8
--2.7,-0.3,1.8
--3.0,-0.3,1.8
--3.0,0.0,1.8
--1.5,0.3,2.25
--1.6,0.3,2.025
--2.5,0.3,2.25
--2.3,0.3,2.025
--3.0,0.3,2.25
--2.7,0.3,2.025
--3.0,0.3,1.8
--2.7,0.3,1.8
--2.7,0.0,1.575
--2.7,-0.3,1.575
--3.0,-0.3,1.35
--3.0,0.0,1.35
--2.5,0.0,1.125
--2.5,-0.3,1.125
--2.65,-0.3,0.9375
--2.65,0.0,0.9375
--2.0,-0.3,0.9
--1.9,-0.3,0.6
--1.9,0.0,0.6
--3.0,0.3,1.35
--2.7,0.3,1.575
--2.65,0.3,0.9375
--2.5,0.3,1.125
--1.9,0.3,0.6
--2.0,0.3,0.9
-1.7,0.0,1.425
-1.7,-0.66,1.425
-1.7,-0.66,0.6
-1.7,0.0,0.6
-2.6,0.0,1.425
-2.6,-0.66,1.425
-3.1,-0.66,0.825
-3.1,0.0,0.825
-2.3,0.0,2.1
-2.3,-0.25,2.1
-2.4,-0.25,2.025
-2.4,0.0,2.025
-2.7,0.0,2.4
-2.7,-0.25,2.4
-3.3,-0.25,2.4
-3.3,0.0,2.4
-1.7,0.66,0.6
-1.7,0.66,1.425
-3.1,0.66,0.825
-2.6,0.66,1.425
-2.4,0.25,2.025
-2.3,0.25,2.1
-3.3,0.25,2.4
-2.7,0.25,2.4
-2.8,0.0,2.475
-2.8,-0.25,2.475
-3.525,-0.25,2.49375
-3.525,0.0,2.49375
-2.9,0.0,2.475
-2.9,-0.15,2.475
-3.45,-0.15,2.5125
-3.45,0.0,2.5125
-2.8,0.0,2.4
-2.8,-0.15,2.4
-3.2,-0.15,2.4
-3.2,0.0,2.4
-3.525,0.25,2.49375
-2.8,0.25,2.475
-3.45,0.15,2.5125
-2.9,0.15,2.475
-3.2,0.15,2.4
-2.8,0.15,2.4
-0.0,0.0,3.15
-0.0,-0.002,3.15
-0.002,0.0,3.15
-0.8,0.0,3.15
-0.8,-0.45,3.15
-0.45,-0.8,3.15
-0.0,-0.8,3.15
-0.0,0.0,2.85,0.0,0.0,1.0
-0.2,0.0,2.7
-0.2,-0.112,2.7
-0.112,-0.2,2.7
-0.0,-0.2,2.7
--0.002,0.0,3.15
--0.45,-0.8,3.15
--0.8,-0.45,3.15
--0.8,0.0,3.15
--0.112,-0.2,2.7
--0.2,-0.112,2.7
--0.2,0.0,2.7
-0.0,0.002,3.15
--0.8,0.45,3.15
--0.45,0.8,3.15
-0.0,0.8,3.15
--0.2,0.112,2.7
--0.112,0.2,2.7
-0.0,0.2,2.7
-0.45,0.8,3.15
-0.8,0.45,3.15
-0.112,0.2,2.7
-0.2,0.112,2.7
-0.4,0.0,2.55
-0.4,-0.224,2.55
-0.224,-0.4,2.55
-0.0,-0.4,2.55
-1.3,0.0,2.55
-1.3,-0.728,2.55
-0.728,-1.3,2.55
-0.0,-1.3,2.55
-1.3,0.0,2.4
-1.3,-0.728,2.4
-0.728,-1.3,2.4
-0.0,-1.3,2.4
--0.224,-0.4,2.55
--0.4,-0.224,2.55
--0.4,0.0,2.55
--0.728,-1.3,2.55
--1.3,-0.728,2.55
--1.3,0.0,2.55
--0.728,-1.3,2.4
--1.3,-0.728,2.4
--1.3,0.0,2.4
--0.4,0.224,2.55
--0.224,0.4,2.55
-0.0,0.4,2.55
--1.3,0.728,2.55
--0.728,1.3,2.55
-0.0,1.3,2.55
--1.3,0.728,2.4
--0.728,1.3,2.4
-0.0,1.3,2.4
-0.224,0.4,2.55
-0.4,0.224,2.55
-0.728,1.3,2.55
-1.3,0.728,2.55
-0.728,1.3,2.4
-1.3,0.728,2.4
-0.0,0.0,0.0,0.0,0.0,-1.0
-1.5,0.0,0.15
-1.5,0.84,0.15
-0.84,1.5,0.15
-0.0,1.5,0.15
-1.5,0.0,0.075
-1.5,0.84,0.075
-0.84,1.5,0.075
-0.0,1.5,0.075
-1.425,0.0,0.0
-1.425,0.798,0.0
-0.798,1.425,0.0
-0.0,1.425,0.0
--0.84,1.5,0.15
--1.5,0.84,0.15
--1.5,0.0,0.15
--0.84,1.5,0.075
--1.5,0.84,0.075
--1.5,0.0,0.075
--0.798,1.425,0.0
--1.425,0.798,0.0
--1.425,0.0,0.0
--1.5,-0.84,0.15
--0.84,-1.5,0.15
-0.0,-1.5,0.15
--1.5,-0.84,0.075
--0.84,-1.5,0.075
-0.0,-1.5,0.075
--1.425,-0.798,0.0
--0.798,-1.425,0.0
-0.0,-1.425,0.0
-0.84,-1.5,0.15
-1.5,-0.84,0.15
-0.84,-1.5,0.075
-1.5,-0.84,0.075
-0.798,-1.425,0.0
-1.425,-0.798,0.0
diff --git a/util/qt3d/assetviewer/assetviewer.desktop b/util/qt3d/assetviewer/assetviewer.desktop
deleted file mode 100644
index 1d682515..00000000
--- a/util/qt3d/assetviewer/assetviewer.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=3D Asset Viewer
-Icon=/usr/share/icons/hicolor/80x80/apps/qtquick3d.png
-Exec=/usr/bin/invoker --type=e -s /usr/bin/modeltweak -fullscreen
-OnlyShowIn=X-MeeGo;
-X-MeeGo-Logical-Id=qtn_comm_appname_assetviewer
diff --git a/util/qt3d/assetviewer/assetviewer.pro b/util/qt3d/assetviewer/assetviewer.pro
deleted file mode 100644
index ee4737d3..00000000
--- a/util/qt3d/assetviewer/assetviewer.pro
+++ /dev/null
@@ -1,25 +0,0 @@
-TEMPLATE = app
-TARGET = assetviewer
-CONFIG += qt warn_on
-
-INSTALL_DIRS = qml
-CONFIG += qt3d_deploy_qml qt3dquick_deploy_pkg
-include(../../../pkg.pri)
-qtcAddDeployment()
-
-SOURCES += main.cpp \
- quickfile.cpp
-
-symbian {
- qmlDeployment2.sources = qml\meshes\*
- qmlDeployment2.path = qml\meshes
- DEPLOYMENT += qmlDeployment2
-}
-
-OTHER_FILES += \
- assetviewer.rc
-
-RC_FILE = assetviewer.rc
-
-HEADERS += \
- quickfile.h
diff --git a/util/qt3d/assetviewer/assetviewer.rc b/util/qt3d/assetviewer/assetviewer.rc
deleted file mode 100644
index 1b6228c9..00000000
--- a/util/qt3d/assetviewer/assetviewer.rc
+++ /dev/null
@@ -1 +0,0 @@
-IDI_ICON1 ICON DISCARDABLE "qtquick3d.ico"
diff --git a/util/qt3d/assetviewer/main.cpp b/util/qt3d/assetviewer/main.cpp
deleted file mode 100644
index 954ed4c6..00000000
--- a/util/qt3d/assetviewer/main.cpp
+++ /dev/null
@@ -1,100 +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/QApplication>
-#include "qdeclarativeview3d.h"
-#include <QGraphicsObject>
-#include <QDebug>
-#include <QtDeclarative>
-
-#include "../../../demos/quick3d/qmlres.h"
-#include "quickfile.h"
-
-QString filename;
-
-int main(int argc, char *argv[])
-{
- qmlRegisterType<QuickFile>("AssetViewer", 1, 0, "QuickFile");
-
- QApplication app(argc, argv);
- QDeclarativeView3D view;
-
- QString qml = q_get_qmldir(QLatin1String("qml/AssetViewer.qml"));
- view.setSource(QUrl::fromLocalFile(qml));
- view.setWindowTitle(QString("3D Asset Viewer"));
-
- //disable close button
- // view.setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowMaximizeButtonHint | Qt::WindowMinimizeButtonHint);
-
- QString fn;
- QStringList args = QApplication::arguments();
- for (int i = 0; i < args.size(); ++i)
- {
- //FIXME: QML likes files relative to QML directory above, or full paths.
- // We need to sort out how this is implemented once we've worked how how it's going to
- // be called via Qt Creator.
- if (args.at(i).startsWith(QLatin1String("-model")) && (i+1 < args.size()))
- {
- fn = args.at(i+1);
- qDebug() << fn;
- QGraphicsObject *object = view.rootObject();
- object->setProperty("targetMesh", args.at(i+1));
- break;
- }
- }
-
- view.setResizeMode(QDeclarativeView::SizeRootObjectToView);
-
-#ifdef Q_OS_SYMBIAN
- view.setAttribute(Qt::WA_LockLandscapeOrientation, true);
- view.setResizeMode(QDeclarativeView::SizeRootObjectToView);
- view.showFullScreen();
-#else
- if (QApplication::arguments().contains(QLatin1String("-maximize")))
- view.showMaximized();
- else if (QApplication::arguments().contains(QLatin1String("-fullscreen")))
- view.showFullScreen();
- else
- view.show();
-#endif
-
- return app.exec();
-}
diff --git a/util/qt3d/assetviewer/qml/AssetViewer.qml b/util/qt3d/assetviewer/qml/AssetViewer.qml
deleted file mode 100644
index af5b4b96..00000000
--- a/util/qt3d/assetviewer/qml/AssetViewer.qml
+++ /dev/null
@@ -1,292 +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 1.0
-import Qt3D 1.0
-import AssetViewer 1.0
-import "fileHandling.js" as FileHandler
-import "Widgets"
-import "ColorUtils.js" as ColorUtils
-
-Rectangle {
- id: outerWindow;
- width: 1024
- height: 768
- property alias modelEffect: customEffect
- property alias modelMaterial: customMaterial
- property bool useCustomEffect: false
- property bool useCustomMaterial: false
-
- property bool changed: false
- Component.onCompleted: {
- outerWindow.changed = false;
- }
-
- Component.onDestruction: {
- if (outerWindow.changed)
- {
- FileHandler.save_qml(true);
- }
- }
-
- Rectangle {
- id: menu
- x: parent.x
- y: parent.y
- height: 24
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.top: parent.top
-
- color: "#B4B4B4"
- border.color: "black"
-
- ButtonBarPane {
- id: buttonBarPane
- anchors.fill: parent
- }
- }
-
- Rectangle {
- id: mainwindow
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.top: menu.bottom
- anchors.bottom: outerWindow.bottom
-
- color: "#444444"
- border.color: "black"
-
- property alias targetMesh: quickFile.filename
-
- QuickFile {
- id: quickFile
- filename: "meshes/penguin.3ds"
- title: "Open 3D Asset File"
- filter: "Asset files (*.*)"
- }
-
- QuickFile {
- id: textureFile
- filename: ""
- title: "Open Texture File"
- filter: "Images (*.gif *.png *.jpg *.tif *.bmp)"
- }
-
- Mesh {
- id: source_mesh
- source: quickFile.filename
- }
-
- Translation3D { id: transformTranslate; translate: Qt.vector3d(0, 0, 0); }
- Rotation3D { id: transformRotateX; axis: Qt.vector3d(1, 0, 0); angle: 0; }
- Rotation3D { id: transformRotateY; axis: Qt.vector3d(0, 1, 0); angle: 0; }
- Rotation3D { id: transformRotateZ; axis: Qt.vector3d(0, 0, 1); angle: 0; }
- Scale3D { id: transformScale; scale: Qt.vector3d(1, 1, 1); }
-
- Effect {
- id: customEffect;
- property alias hsv: hsvColor
- material: useCustomMaterial ? customMaterial : null;
- color: hsv.color
- blending: (hsv.alpha < 1.0)
- || (useCustomMaterial && (hsvAmbColor.alpha*hsvDifColor.alpha*hsvSpecColor.alpha < 1.0))
- texture: textureFile.filename
- }
- Material {
- id: customMaterial
- property alias amb_hsv: hsvAmbColor
- property alias dif_hsv: hsvDifColor
- property alias spec_hsv: hsvSpecColor
- ambientColor: hsvAmbColor.color
- diffuseColor: hsvDifColor.color
- specularColor: hsvSpecColor.color
- textureUrl: textureFile.filename
- }
- HSVColor { id: hsvColor }
- HSVColor { id: hsvAmbColor }
- HSVColor { id: hsvDifColor }
- HSVColor { id: hsvSpecColor }
-
- ModelViewport {
- id: mvpZY
- x: 0;
- y: 0;
- camera.eye: Qt.vector3d(20, 0, 0);
- stateName: "ZYMaximised"
- viewportName: "Z,Y axis (right)"
-
- rightVector: Qt.vector3d(0, 0, -1)
- upVector: Qt.vector3d(0, 1, 0)
-
- property alias position: transformTranslate.translate;
-
- onMouseTranslateX: if (!modelPropertiesPane.translateLocked) position = Qt.vector3d(position.x, position.y, translate.z + (down.x - mouse.x)/translateSensitivity)
- onMouseTranslateY: if (!modelPropertiesPane.translateLocked)position = Qt.vector3d(position.x, translate.y + (down.y - mouse.y)/translateSensitivity, position.z)
- onMouseRotateX: if (!modelPropertiesPane.rotateLocked)transformRotateY.angle = rotate.y - (down.x - mouse.x)/rotateSensitivity
- onMouseRotateY: if (!modelPropertiesPane.rotateLocked)transformRotateZ.angle = rotate.z - (down.y - mouse.y)/rotateSensitivity
- onMouseScaleX: if (!modelPropertiesPane.scaleLocked) {
- var s = scale3d.z - (down.x - mouse.x)/scaleSensitivity;
- transformScale.scale = Qt.vector3d(transformScale.scale.x, transformScale.scale.y, s<0 ? 0 : s)
- }
- onMouseScaleY: if (!modelPropertiesPane.scaleLocked) {
- var s = scale3d.y + (down.y - mouse.y)/scaleSensitivity;
- transformScale.scale = Qt.vector3d(transformScale.scale.x, s<0 ? 0 : s, transformScale.scale.z)
- }
- }
-
- ModelViewport {
- id: mvpXY
- x: parent.width/2
- y: 0;
- camera.eye: Qt.vector3d(0, 0, 20);
- stateName: "XYMaximised"
- viewportName: "X,Y axis (front)"
-
- rightVector: Qt.vector3d(1, 0, 0)
- upVector: Qt.vector3d(0, 1, 0)
-
- property alias position: transformTranslate.translate;
-
- onMouseTranslateX: if (!modelPropertiesPane.translateLocked)position = Qt.vector3d(translate.x - (down.x - mouse.x)/translateSensitivity, position.y, position.z)
- onMouseTranslateY: if (!modelPropertiesPane.translateLocked)position = Qt.vector3d(position.x, translate.y + (down.y - mouse.y)/translateSensitivity, position.z)
- onMouseRotateX: if (!modelPropertiesPane.rotateLocked) transformRotateY.angle = rotate.y - (down.x - mouse.x)/rotateSensitivity
- onMouseRotateY: if (!modelPropertiesPane.rotateLocked) transformRotateX.angle = rotate.x - (down.y - mouse.y)/rotateSensitivity
- onMouseScaleX: if (!modelPropertiesPane.scaleLocked) {
- var s = scale3d.x - (down.x - mouse.x)/scaleSensitivity
- transformScale.scale = Qt.vector3d(s<0 ? 0 : s, transformScale.scale.y, transformScale.scale.z)
- }
- onMouseScaleY: if (!modelPropertiesPane.scaleLocked) {
- var s = scale3d.y + (down.y - mouse.y)/scaleSensitivity
- transformScale.scale = Qt.vector3d(transformScale.scale.x, s<0 ? 0 : s, transformScale.scale.z)
- }
- }
-
- ModelViewport {
- id: mvpXZ
- x: parent.width/2;
- y: parent.height/2;
- camera.eye: Qt.vector3d(0, 20, 0);
- camera.upVector: Qt.vector3d(0, 0, -1);
- stateName: "XZMaximised"
- viewportName: "X,Z axis (top)"
-
- rightVector: Qt.vector3d(1, 0, 0)
- upVector: Qt.vector3d(0, 0, -1)
-
- property alias position: transformTranslate.translate;
-
- onMouseTranslateX: if (!modelPropertiesPane.translateLocked)position = Qt.vector3d(translate.x - (down.x - mouse.x)/translateSensitivity, position.y, position.z)
- onMouseTranslateY: if (!modelPropertiesPane.translateLocked)position = Qt.vector3d(position.x, position.y, translate.z - (down.y - mouse.y)/translateSensitivity)
- onMouseRotateX: if (!modelPropertiesPane.rotateLocked)transformRotateZ.angle = rotate.z + (down.x - mouse.x)/rotateSensitivity
- onMouseRotateY: if (!modelPropertiesPane.rotateLocked)transformRotateX.angle = rotate.x - (down.y - mouse.y)/rotateSensitivity
- onMouseScaleX: if (!modelPropertiesPane.scaleLocked) {
- var s = scale3d.x - (down.x - mouse.x)/scaleSensitivity;
- transformScale.scale = Qt.vector3d(s<0 ? 0 : s, transformScale.scale.y, transformScale.scale.z)
- }
- onMouseScaleY: if (!modelPropertiesPane.scaleLocked) {
- var s = scale3d.z + (down.y - mouse.y)/scaleSensitivity;
- transformScale.scale = Qt.vector3d(transformScale.scale.x, transformScale.scale.y, s<0 ? 0 : s)
- }
- }
-
- Rectangle {
- id: meshName
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.bottomMargin: 10
- anchors.bottom: parent.bottom
- radius: 10
- border.width: 1
- border.color: "black"
- color: "white"
- width: parent.width - 20
- height: 20
-
- Text {
- anchors.verticalCenter: parent.verticalCenter
- anchors.horizontalCenter: parent.horizontalCenter
- text: "Hold left mouse button to move, middle button to scale, and right button to rotate the asset."
- }
- }
-
- ModelPropertiesPane {
- id: modelPropertiesPane
- x: 16;
- y: parent.height / 2 + 16
- onChanged: {outerWindow.changed=true}
- }
-
- ColorPicker {
- id: colorPicker
- visible: false
- }
-
- HelpOverlay {
- id: helpOverlay
- visible: false
- }
-
- states: [
- State {
- name: "3Views"
- },
- State {
- name: "ZYMaximised"
- PropertyChanges { target: mvpZY; x: 0; y: 0; width: mainwindow.width; height: mainwindow.height; }
- PropertyChanges { target: mvpXY; x: mainwindow.width; y: 0; width: 0; height: mainwindow.height/2; }
- PropertyChanges { target: mvpXZ; x: mainwindow.width; y: mainwindow.height; width: 0; height: 0; }
- },
- State {
- name: "XYMaximised"
- PropertyChanges { target: mvpZY; x: 0; y: 0; width: 0; height: mainwindow.height/2; }
- PropertyChanges { target: mvpXY; x: 0; y: 0; width: mainwindow.width; height: mainwindow.height; }
- PropertyChanges { target: mvpXZ; x: mainwindow.width/2; y: mainwindow.height; width: mainwindow.width/2; height: 0; }
- },
- State {
- name: "XZMaximised"
- PropertyChanges { target: mvpZY; x: 0; y: 0; width: 0; height: 0; }
- PropertyChanges { target: mvpXY; x: mainwindow.width/2; y: 0; width: mainwindow.width/2; height: 0; }
- PropertyChanges { target: mvpXZ; x: 0; y: 0; width: mainwindow.width; height: mainwindow.height; }
- }
- ]
-
- state: "3Views"
- }
-}
diff --git a/util/qt3d/assetviewer/qml/BlenderValueSlider.qml b/util/qt3d/assetviewer/qml/BlenderValueSlider.qml
deleted file mode 100644
index 2f223380..00000000
--- a/util/qt3d/assetviewer/qml/BlenderValueSlider.qml
+++ /dev/null
@@ -1,175 +0,0 @@
-import QtQuick 1.0
-import Qt3D 1.0
-import AssetViewer 1.0
-
-Item {
- id: valueSlider
-
- property string label: "";
- property alias value: textInput.text;
- property double delta: 0.1;
- property double max: 1;
- property double min: -1;
- property bool limitMax: false;
- property bool limitMin: false;
- property bool locked: false
-
- width: rect.width
- height: 20
-
- property int textWidth: 80
-
- signal next
- signal prev
- signal gotFocus
- signal fail
- signal changed
-
- Rectangle {
- id: rect
- radius: 8
- border.width: 1
- border.color: "#191919"
- color: "#B4B4B4"
- width: radius/2 + valueSlider.textWidth + plus.width + minus.width
- height: parent.height
-
-
- Text {
- id: textLabel
- color: "black"
- width: textInput.width
- height: textInput.height
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- text: valueSlider.label + " " + textInput.text
- visible: true
- onTextChanged: changed();
- }
-
-
- TextInput {
- id: textInput
- readOnly: valueSlider.locked
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
- horizontalAlignment: TextInput.AlignHCenter
- width: valueSlider.textWidth
- validator: DoubleValidator{}
- onAccepted: {
- parent.parent.update(text)
- focus = false
- }
- visible: false
- onFocusChanged: {
- if (focus == false) {
- parent.parent.update(text)
- visible = false
- textLabel.visible = true
- }
- else {
- visible = true
- textLabel.visible = false
- }
- }
-
- Keys.onTabPressed: valueSlider.next()
- Keys.onBacktabPressed: valueSlider.prev()
- }
- Image {
- id: plus
- source: "images/plus.png"
- anchors.left: textInput.right
- anchors.verticalCenter: parent.verticalCenter
- }
- Image {
- id: minus
- source: "images/minus.png"
- anchors.right: textInput.left
- anchors.verticalCenter: parent.verticalCenter
- }
- MouseArea {
- id: mouseArea
- anchors.fill: parent
- onEntered: parent.color = "#999999"
- onExited: parent.color = "#B4B4B4"
- hoverEnabled: true
- onClicked: {
- if (!valueSlider.locked)
- {
- if (mouse.x<width/3)
- decDelta();
- else if (mouse.x>width/3*2)
- incDelta();
- else {
- valueSlider.gotFocus()
- }
- } else {
- valueSlider.fail();
- }
-
- }
- onPressed: parent.color = "#808080"
- onReleased: parent.color = "#999999"
- }
- }
-
- Timer {
- interval: 100;
- running: mouseArea.pressedButtons & Qt.LeftButton && (mouseArea.mouseX > valueSlider.width/3*2)
- repeat: true
- onTriggered: if (!valueSlider.locked) incDelta()
- }
-
- Timer {
- interval: 100;
- running: mouseArea.pressedButtons & Qt.LeftButton && (mouseArea.mouseX < valueSlider.width/3)
- repeat: true
- onTriggered: if (!valueSlider.locked) decDelta()
- }
-
- function updateMe() {
- update(textInput.text)
- }
-
- function incDelta() {
- var t = value*1 + delta;
- if (limitMax)
- update(t>max ? max : t);
- else
- update(t);
-
- }
-
- function decDelta() {
- var t = value*1 - delta;
- if (limitMin)
- update(t<min ? min : t);
- else
- update(t);
- }
-
- onGotFocus: {
- textLabel.visible = false;
- textInput.visible = true;
- textInput.focus = true;
- textInput.selectAll();
- }
-
- onFocusChanged: if (focus) valueSlider.gotFocus()
-
- Keys.onUpPressed: {
- if (!valueSlider.locked) incDelta();
- else valueSlider.fail();
- }
- Keys.onDownPressed: {
- if (!valueSlider.locked) decDelta();
- else valueSlider.fail();
- }
- Keys.onReturnPressed: {
- if (!valueSlider.locked) updateMe();
- else valueSlider.fail();
- }
-}
diff --git a/util/qt3d/assetviewer/qml/ButtonBarPane.qml b/util/qt3d/assetviewer/qml/ButtonBarPane.qml
deleted file mode 100644
index bd85d5c8..00000000
--- a/util/qt3d/assetviewer/qml/ButtonBarPane.qml
+++ /dev/null
@@ -1,51 +0,0 @@
-import QtQuick 1.0
-import Qt3D 1.0
-import AssetViewer 1.0
-import "fileHandling.js" as FileHandler
-import "Widgets"
-
-Flow {
- id: menu
- anchors.left: parent.left
- anchors.leftMargin: 2
- anchors.top: parent.top
- anchors.topMargin: 2
- width: buttonWidth * 4 + spacing * 3
- height: parent.height
- spacing: 5
-
- property double buttonWidth: 105
-
- SaveButton {
- id: save
- width: buttonWidth
- buttonText: "Save QML"
- imageSrc: "images/save.png"
- }
-
- BlenderToggle {
- id: load
- width: buttonWidth
- onClicked:
- {
- if (outerWindow.changed)
- {
- FileHandler.save_qml(true);
- }
- var useEffect = useCustomEffect;
- useCustomEffect = false;
- quickFile.load();
- useCustomEffect = useEffect;
- }
- buttonText: "Load Asset"
- imageSrc: "images/model.png"
- }
-
- BlenderToggle {
- id: help
- width: buttonWidth
- onClicked: helpOverlay.visible = true
- buttonText: "Help!"
- imageSrc: "images/help.png"
- }
-}
diff --git a/util/qt3d/assetviewer/qml/CheckBox.qml b/util/qt3d/assetviewer/qml/CheckBox.qml
deleted file mode 100644
index efadd539..00000000
--- a/util/qt3d/assetviewer/qml/CheckBox.qml
+++ /dev/null
@@ -1,45 +0,0 @@
-import QtQuick 1.0
-
-Item {
- id: checkBox
- height: Math.max (textBox.height, check.height)
- width: textBox.width + check.width
- property alias text: textBox.text
- property bool checked: false
- signal clicked(bool checked)
- property variant color: Qt.rgba(1,1,1,1)
-
- Text {
- id: textBox
- anchors.left: parent.left
- color: checkBox.color
- }
-
- Rectangle {
- id: check
- width: 16
- height: 16
- anchors.right: parent.right
-
- border.color: checkBox.color
- border.width: 1
- color: Qt.rgba(0,0,0,0)
-
- Rectangle {
- anchors.centerIn: parent
-
- border.color: checkBox.color
- border.width: 1
-
- width: parent.width - 6
- height: parent.height - 6
- color: checkBox.color
- opacity: checked
- }
- }
-
- MouseArea {
- anchors.fill: parent
- onClicked: { checked = !checked; checkBox.clicked(checked) }
- }
-}
diff --git a/util/qt3d/assetviewer/qml/ColorPicker.qml b/util/qt3d/assetviewer/qml/ColorPicker.qml
deleted file mode 100644
index 641a6acc..00000000
--- a/util/qt3d/assetviewer/qml/ColorPicker.qml
+++ /dev/null
@@ -1,286 +0,0 @@
-import QtQuick 1.0
-import "Widgets"
-import "ColorUtils.js" as ColorUtils
-
-Rectangle {
- id: picker
- property alias alpha: alphaSlider.value
- property alias hue: hueSlider.value
- property alias sat: colorSelector.sat
- property alias val: colorSelector.val
- property variant colorSelect: Qt.hsla(hsl_hue, hsl_sat, hsl_lum, alpha)
- property HSVColor targetColor
-
- HSVColor { id: oldColor }
-
- property real hsl_hue: hue
- property real hsl_sat: sat*val*((hsl_lum <= 2) ? hsl_lum*2 : 2*(1 - hsl_lum))
- property real hsl_lum: ((2.0 - sat)*val)/2
-
- property int red: rgb[0]
- property int green: rgb[1]
- property int blue: rgb[2]
-
- property variant rgb: ColorUtils.hsvToRgb(hue, sat, val)
-
- onRgbChanged: updateTarget()
- onAlphaChanged: updateTarget()
-
- anchors.fill: parent
- property real bgAlpha: 0.5
- color: Qt.rgba(1,1,1,bgAlpha)
-
- function apply() {
- updateTarget();
- picker.visible = false;
- }
-
- function cancel() {
- resetTarget();
- picker.visible = false;
- }
-
- function setTarget(target) {
- targetColor = target;
- hue = target.hue;
- sat = target.sat;
- val = target.val;
- alpha = target.alpha;
- oldColor.hue = target.hue;
- oldColor.sat = target.sat;
- oldColor.val = target.val;
- oldColor.alpha = target.alpha
- }
-
- function updateTarget() {
- if (targetColor === null || !picker.visible) return;
- targetColor.hue = hue;
- targetColor.sat = sat;
- targetColor.val = val;
- targetColor.alpha = alpha;
- }
-
- function resetTarget() {
- if (targetColor === null) return;
- targetColor.hue = oldColor.hue;
- targetColor.sat = oldColor.sat;
- targetColor.val = oldColor.val;
- targetColor.alpha = oldColor.alpha;
- }
-
- MouseArea {
- anchors.fill: parent
- onClicked: {}
- }
-
- Rectangle {
- width: pickerLayout.implicitWidth+20
- height: 250
- anchors.centerIn: parent
-
- border.width: 2
- border.color: "white"
- color: mainwindow.color
-
- Row {
- id: pickerLayout
- anchors {
- top: parent.top
- horizontalCenter: parent.horizontalCenter
- margins: 10
- }
- height: 200
- spacing: 10
-
- Item {
- id: colorViewer
- width: height
- height: parent.height
- Rectangle {
- anchors.fill: parent
- rotation: -90
- gradient: Gradient {
- GradientStop { position: 0.0; color: Qt.hsla(hueSlider.value, 1.0, 1.0) }
- GradientStop { position: 1.0; color: Qt.hsla(hueSlider.value, 1.0, 0.5) }
- }
- }
- Rectangle {
- anchors.fill: parent
- border.color: "lightgray"
- gradient: Gradient {
- GradientStop { position: 0.0; color: Qt.rgba(0,0,0,0) }
- GradientStop { position: 1.0; color: Qt.rgba(0,0,0,1) }
- }
- }
-
- ColorSelector {
- id: colorSelector
- anchors.fill: parent
- }
- }
-
- Item {
- width: 20
- height: parent.height
- Rectangle {
- anchors.fill: parent
- border.color: "lightgray"
- gradient: Gradient {
- GradientStop { position: 1.0; color: Qt.hsla(1.0, 1.0, 0.5) }
- GradientStop { position: 0.85; color: Qt.hsla(0.85, 1.0, 0.5) }
- GradientStop { position: 0.76; color: Qt.hsla(0.76, 1.0, 0.5) }
- GradientStop { position: 0.5; color: Qt.hsla(0.5, 1.0, 0.5) }
- GradientStop { position: 0.33; color: Qt.hsla(0.33, 1.0, 0.5) }
- GradientStop { position: 0.16; color: Qt.hsla(0.16, 1.0, 0.5) }
- GradientStop { position: 0.0; color: Qt.hsla(0.0, 1.0, 0.5) }
- }
- }
-
- SliderHandle {
- id: hueSlider
- anchors.fill: parent
- }
- }
-
- Item {
- width: 20
- height: parent.height
-
- Checkered {
- anchors.fill: parent
- }
-
- Rectangle {
- anchors.fill: parent
- border.color: "lightgray"
- gradient: Gradient {
- GradientStop {
- position: 0.0;
- color: Qt.hsla(picker.hsl_hue, picker.hsl_sat, picker.hsl_lum)
- }
- GradientStop {
- position: 1.0;
- color: Qt.hsla(picker.hsl_hue, picker.hsl_sat, picker.hsl_lum, 0)
- }
- }
- }
-
- SliderHandle {
- id: alphaSlider
- anchors.fill: parent
- inverted: true
- }
- }
-
- Item {
- width: 60
- height: parent.height
-
- Item {
- id: preview
- width: parent.width; height: 40
- Checkered {
- anchors.fill: parent
- }
- Rectangle {
- anchors.fill: parent
- border.color: "lightgray"
- color: picker.colorSelect
- }
- }
-
- Column {
- anchors.top: preview.bottom
- anchors.topMargin: 5
- spacing: 3
- width: parent.width
-
- InputBox {
- id: redIn
- width: parent.width; height: 20
- label: "R:"
- }
-
- InputBox {
- id: greenIn
- width: parent.width; height: 20
- label: "G:"
- }
-
- InputBox {
- id: blueIn
- width: parent.width; height: 20
- label: "B:"
- }
-
- Binding {
- target: redIn.input; property: "text"
- value: Math.round(rgb[0])
- }
- Binding {
- target: greenIn.input; property: "text"
- value: Math.round(rgb[1])
- }
- Binding {
- target: blueIn.input; property: "text"
- value: Math.round(rgb[2])
- }
-
- Item {
- width: 5; height: 5
- }
-
- InputBox {
- id: hueIn
- width: parent.width; height: 20
- label: "H:"
- }
-
- InputBox {
- id: satIn
- width: parent.width; height: 20
- label: "S:"
- }
-
- InputBox {
- id: valIn
- width: parent.width; height: 20
- label: "V:"
- }
-
- Binding {
- target: hueIn.input; property: "text"
- value: Math.round(picker.hue*100)/100
- }
- Binding {
- target: satIn.input; property: "text"
- value: Math.round(picker.sat*100)/100
- }
- Binding {
- target: valIn.input; property: "text"
- value: Math.round(picker.val*100)/100
- }
- }
- }
- }
-
- Row {
- anchors {
- margins: 5
- top: pickerLayout.bottom
- horizontalCenter: parent.horizontalCenter
- }
- spacing: 10
- BlenderToggle {
- width: 80
- buttonText: "Apply"
- onClicked: picker.apply()
- }
- BlenderToggle {
- width: 80
- buttonText: "Cancel"
- onClicked: picker.cancel()
- }
- }
- }
-}
diff --git a/util/qt3d/assetviewer/qml/ColorUtils.js b/util/qt3d/assetviewer/qml/ColorUtils.js
deleted file mode 100644
index 5addf394..00000000
--- a/util/qt3d/assetviewer/qml/ColorUtils.js
+++ /dev/null
@@ -1,61 +0,0 @@
-.pragma library
-
-function rgbToHsv(r, g, b) {
- r = r/255; g = g/255; b = b/255;
- var max = Math.max(r, g, b), min = Math.min(r, g, b);
- var h, s, v = max;
-
- var d = max - min;
- s = max == 0 ? 0 : d / max;
-
- if (max == min){
- h = 0; // achromatic
- } else {
- switch (max) {
- case r: h = (g - b) / d + (g < b ? 6 : 0); break;
- case g: h = (b - r) / d + 2; break;
- case b: h = (r - g) / d + 4; break;
- }
- h /= 6;
- }
-
- return new Array(h, s, v);
-}
-
-function hsvToRgb(h, s, v) {
- var r, g, b;
-
- var i = Math.floor(h * 6);
- var f = h * 6 - i;
- var p = v * (1 - s);
- var q = v * (1 - f * s);
- var t = v * (1 - (1 - f) * s);
-
- switch (i % 6){
- case 0: r = v; g = t; b = p; break;
- case 1: r = q; g = v; b = p; break;
- case 2: r = p; g = v; b = t; break;
- case 3: r = p; g = q; b = v; break;
- case 4: r = t; g = p; b = v; break;
- case 5: r = v; g = p; b = q; break;
- }
-
- return new Array(r * 255, g * 255, b * 255);
-}
-
-function hsvToHsl(h, s, v) {
- var ss, l;
-
- l = ((2.0 - s)*v);
-
- ss = s*v*((l <= 1) ? l : 2 - l);
-
- l /= 2;
-
- return new Array(h, ss, l);
-}
-
-function hsvToColor(h, s, v, a) {
- var hsl = hsvToHsl(h,s,v);
- return Qt.hsla(hsl[0], hsl[1], hsl[2], a);
-}
diff --git a/util/qt3d/assetviewer/qml/HelpOverlay.qml b/util/qt3d/assetviewer/qml/HelpOverlay.qml
deleted file mode 100644
index 7b233e6f..00000000
--- a/util/qt3d/assetviewer/qml/HelpOverlay.qml
+++ /dev/null
@@ -1,56 +0,0 @@
-import QtQuick 1.0
-import Qt3D 1.0
-import AssetViewer 1.0
-
-Rectangle {
- anchors.fill: parent
- color: "#00000000"
-
- Rectangle {
- id: helpScreen
- width: parent.width/2
- height: parent.height/2
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
-
- border.width: 4
- radius: 4
- color: "lightyellow"
-
- Text {
- id: header
- font { pixelSize: 32; italic: true }
- text: "3D Asset Viewer Help"
- anchors.top: parent.top
- anchors.topMargin: 16
- anchors.horizontalCenter: parent.horizontalCenter
- }
- Text {
- anchors.top: header.bottom
- anchors.topMargin: 16
- anchors.left: parent.left
- anchors.leftMargin: 16
- anchors.right: parent.right
- anchors.rightMargin: 16
- textFormat: Text.RichText
- wrapMode: Text.WordWrap
- text: "Altering model parameters with the mouse:" +
- "<ul><li>Clicking on one of the panes with the <b>Left Mouse Button</b> and dragging will translate the position.</li>" +
- "<li>Clicking on one of the panes with the <b>Right Mouse Button</b> and dragging will rotate the position.</li>" +
- "<li>Clicking on one of the panes with the <b>Middle Mouse Button</b> and dragging will resize the model."
- }
-
- Text {
- anchors.bottom: parent.bottom
- anchors.bottomMargin: 16
- anchors.horizontalCenter: parent.horizontalCenter
- text: "[ Click to Close ]"
- }
- }
- MouseArea {
- anchors.fill: parent
- acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
- onClicked: parent.visible = false
- }
-}
-
diff --git a/util/qt3d/assetviewer/qml/ModelPropertiesPane.qml b/util/qt3d/assetviewer/qml/ModelPropertiesPane.qml
deleted file mode 100644
index 384a8b6e..00000000
--- a/util/qt3d/assetviewer/qml/ModelPropertiesPane.qml
+++ /dev/null
@@ -1,543 +0,0 @@
-import QtQuick 1.0
-import Qt3D 1.0
-import AssetViewer 1.0
-import "Widgets"
-import "ColorUtils.js" as ColorUtils
-
-Row {
- id: properties
- spacing: 30
- property alias rotateLocked: imageR.isLocked
- property alias scaleLocked: imageS.isLocked
- property alias translateLocked: imageP.isLocked;
-
- signal changed;
- Column {
- width: posX.width
- height: parent.height
- spacing: 4
-
- // POSITION
- Item {
- id: positionPanel
- width: parent.width
- height: imageP.height
-
- Text {
- anchors.left: parent.left
- anchors.leftMargin: 8
- text: "Position";
- color: "#FFFFFF";
- font.bold: true;
- }
- Image {
- id: imageP
- anchors.right: parent.right
- anchors.rightMargin: 8
-
- //Animation to pulse the lock icon if attempting to modify while locked.
- property bool bounce: false
-
- SequentialAnimation on scale{
- running: imageP.bounce
- NumberAnimation { to : 2.0; duration: 150; easing.type: "OutQuad" }
- NumberAnimation { to : 1.0; duration: 150; easing.type: "OutQuad" }
- NumberAnimation { to : 2.0; duration: 150; easing.type: "OutQuad" }
- NumberAnimation { to : 1.0; duration: 150; easing.type: "OutQuad" }
- onCompleted: imageP.bounce = false
- }
-
- //Manage locked/unlocked state
- state: "UNLOCKED"
- property bool isLocked: false
-
- states: [
- State {
- name: "UNLOCKED"
- PropertyChanges { target: imageP; source: "images/unlock.png"}
- PropertyChanges { target: imageP; isLocked: false;}
- },
- State {
- name: "LOCKED"
- PropertyChanges { target: imageP; source: "images/lock.png"}
- PropertyChanges { target: imageP; isLocked: true;}
- }
- ]
-
- MouseArea {
- anchors.fill: parent
- onDoubleClicked: {
- if (parent.state=="LOCKED")
- parent.state="UNLOCKED"
- else
- parent.state="LOCKED"
- }
- }
- }
- }
- BlenderValueSlider {
- focus: true
- id: posX
- label: "X:"
- locked: imageP.isLocked
- value: transformTranslate.translate.x.toFixed(3)
- function update (f) {
- transformTranslate.translate = Qt.vector3d(f, transformTranslate.translate.y, transformTranslate.translate.z);
- }
- onNext: { updateMe(); focus = false; posY.focus = true; }
- onPrev: { updateMe(); focus = false; scaleZ.focus = true; }
- onFail: { imageP.bounce=true; }
- onChanged: { properties.changed(); }
- }
- BlenderValueSlider {
- id: posY
- label: "Y:"
- locked: imageP.isLocked
- value: transformTranslate.translate.y.toFixed(3)
- function update (f) {
- transformTranslate.translate = Qt.vector3d(transformTranslate.translate.x, f, transformTranslate.translate.z);
- }
- onNext: { updateMe(); focus = false; posZ.focus = true; }
- onPrev: { updateMe(); focus = false; posX.focus = true; }
- onFail: { imageP.bounce=true; }
- onChanged: { properties.changed(); }
- }
- BlenderValueSlider {
- id: posZ
- label: "Z:"
- locked: imageP.isLocked
- value: transformTranslate.translate.z.toFixed(3)
- function update (f) {
- transformTranslate.translate = Qt.vector3d(transformTranslate.translate.x, transformTranslate.translate.y, f);
- }
- onNext: { updateMe(); focus = false; rotX.focus = true; }
- onPrev: { updateMe(); focus = false; posY.focus = true; }
- onFail: { imageP.bounce=true; }
- onChanged: { properties.changed(); }
- }
-
- // ROTATE
- Item {
- id: rotationPanel
- width: parent.width
- height: imageR.height
- property bool dirty: false
- Text {
- anchors.left: parent.left
- anchors.leftMargin: 8
- text: "Rotation";
- color: "#FFFFFF"
- font.bold: true
- }
-
- Image {
- id: imageR
- anchors.right: parent.right
- anchors.rightMargin: 8
-
- //Animation to pulse the lock icon if attempting to modify while locked.
- property bool bounce: false
-
- SequentialAnimation on scale{
- running: imageR.bounce
- NumberAnimation { to : 2.0; duration: 150; easing.type: "OutQuad" }
- NumberAnimation { to : 1.0; duration: 150; easing.type: "OutQuad" }
- NumberAnimation { to : 2.0; duration: 150; easing.type: "OutQuad" }
- NumberAnimation { to : 1.0; duration: 150; easing.type: "OutQuad" }
- onCompleted: imageR.bounce = false
- }
-
- //Manage locked/unlocked state
- state: "UNLOCKED"
- property bool isLocked: false
-
- states: [
- State {
- name: "UNLOCKED"
- PropertyChanges { target: imageR; source: "images/unlock.png"}
- PropertyChanges { target: imageR; isLocked: false;}
- },
- State {
- name: "LOCKED"
- PropertyChanges { target: imageR; source: "images/lock.png"}
- PropertyChanges { target: imageR; isLocked: true;}
- }
- ]
-
- MouseArea {
- anchors.fill: parent
- onDoubleClicked: {
- if (parent.state=="LOCKED")
- parent.state="UNLOCKED"
- else
- parent.state="LOCKED"
- }
- }
- }
- }
- BlenderValueSlider {
- id: rotX
- label: "X:"
- delta: 1
- locked: imageR.isLocked
- min: 0; limitMin: true
- max: 360; limitMax: true
- value: transformRotateX.angle.toFixed(3)
- function update (f) { transformRotateX.angle = f }
- onNext: { updateMe(); focus = false; rotY.focus = true; }
- onPrev: { updateMe(); focus = false; posZ.focus = true; }
- onFail: { imageR.bounce=true; }
- onChanged: { properties.changed(); }
- }
- BlenderValueSlider {
- id: rotY
- label: "Y:"
- delta: 1
- locked: imageR.isLocked
- min: 0; limitMin: true
- max: 360; limitMax: true
- value: transformRotateY.angle.toFixed(3)
- function update (f) { transformRotateY.angle = f }
- onNext: { updateMe(); focus = false; rotZ.focus = true; }
- onPrev: { updateMe(); focus = false; rotX.focus = true; }
- onFail: { imageR.bounce=true; }
- onChanged: { properties.changed(); }
- }
- BlenderValueSlider {
- id: rotZ
- label: "Z:"
- delta: 1
- locked: imageR.isLocked
- min: 0; limitMin: true
- max: 360; limitMax: true
- value: transformRotateZ.angle.toFixed(3)
- function update (f) { transformRotateZ.angle = f }
- onNext: { updateMe(); focus = false; scaleX.focus = true; }
- onPrev: { updateMe(); focus = false; rotY.focus = true; }
- onFail: { imageR.bounce=true; }
- onChanged: { properties.changed(); }
- }
-
- // SCALE
- Item {
- id: scalePanel
- width: parent.width
- height: imageS.height
- property bool dirty: false
-
- Item {
- width: parent.width
- height: scaleText.height
- Text {
- id: scaleText
- anchors.left: parent.left
- anchors.leftMargin: 8
- text: "Scale";
- color: "#FFFFFF"
- font.bold: true
- }
- }
-
- Image {
- id: imageS
- anchors.right: parent.right
- anchors.rightMargin: 8
-
- //Animation to pulse the lock icon if attempting to modify while locked.
- property bool bounce: false
-
- SequentialAnimation on scale{
- running: imageS.bounce
- NumberAnimation { to : 2.0; duration: 150; easing.type: "OutQuad" }
- NumberAnimation { to : 1.0; duration: 150; easing.type: "OutQuad" }
- NumberAnimation { to : 2.0; duration: 150; easing.type: "OutQuad" }
- NumberAnimation { to : 1.0; duration: 150; easing.type: "OutQuad" }
- onCompleted: imageS.bounce = false
- }
-
- //Manage locked/unlocked state
- state: "UNLOCKED"
- property bool isLocked: false
-
- states: [
- State {
- name: "UNLOCKED"
- PropertyChanges { target: imageS; source: "images/unlock.png"}
- PropertyChanges { target: imageS; isLocked: false;}
- },
- State {
- name: "LOCKED"
- PropertyChanges { target: imageS; source: "images/lock.png"}
- PropertyChanges { target: imageS; isLocked: true;}
- }
- ]
-
- MouseArea {
- anchors.fill: parent
- onDoubleClicked: {
- if (parent.state=="LOCKED")
- parent.state="UNLOCKED"
- else
- parent.state="LOCKED"
- }
- }
- }
- }
- BlenderValueSlider {
- id: scaleX
- label: "X:"
- locked: imageS.isLocked
- min: 0; limitMin: true
- value: transformScale.scale.x.toFixed(3)
- function update (f) { transformScale.scale = Qt.vector3d(f, transformScale.scale.y, transformScale.scale.z); }
- onNext: { updateMe(); focus = false; scaleY.focus = true; }
- onPrev: { updateMe(); focus = false; rotZ.focus = true; }
- onFail: { imageS.bounce=true; }
- onChanged: { properties.changed(); }
- }
- BlenderValueSlider {
- id: scaleY
- label: "Y:"
- locked: imageS.isLocked
- min: 0; limitMin: true
- value: transformScale.scale.y.toFixed(3)
- function update (f) { transformScale.scale = Qt.vector3d(transformScale.scale.x, f, transformScale.scale.z); }
- onNext: { updateMe(); focus = false; scaleZ.focus = true; }
- onPrev: { updateMe(); focus = false; scaleX.focus = true; }
- onFail: { imageS.bounce=true; }
- onChanged: { properties.changed(); }
- }
- BlenderValueSlider {
- id: scaleZ
- label: "Z:"
- locked: imageS.isLocked
- min: 0; limitMin: true
- value: transformScale.scale.z.toFixed(3)
- function update (f) { transformScale.scale = Qt.vector3d(transformScale.scale.x, transformScale.scale.y, f); }
- onNext: { updateMe(); focus = false; posX.focus = true; }
- onPrev: { updateMe(); focus = false; scaleY.focus = true; }
- onFail: { imageS.bounce=true; }
- onChanged: { properties.changed(); }
- }
- }
-
- // Material, Effect
- Column {
- width: 150
- spacing: 5
- Item {
- id: effectPanel
- width: parent.width
- height: imageS.height
- property bool dirty: false
-
- Item {
- width: parent.width
- height: effectText.height
- Text {
- id: effectText
- anchors.left: parent.left
- anchors.leftMargin: 8
- text: "Effect";
- color: "#FFFFFF"
- font.bold: true
- }
- }
- }
-
-
- CheckBox {
- id: fromMesh
- width: parent.width
- text: "From Mesh"
- checked: true
- onClicked: {
- useCustomEffect = !checked;
- if (checked) {
- // A horrible hack to reload the default mesh material
- // TODO: Find a better way of doing this (i.e. no runtime errors)
- source_mesh.source = "";
- source_mesh.source = targetMesh;
- }
- }
- }
-
- Column {
- enabled: !fromMesh.checked
- opacity: enabled ? 1.0: 0.5
- width: parent.width; spacing: 5
-
- move: Transition {
- NumberAnimation {
- properties: "y"
- easing.type: Easing.InOutQuad;
- duration: 150
- }
- }
-
- Behavior on opacity {
- NumberAnimation { easing.type: Easing.InOutQuad; duration: 100 }
- }
-
- CheckBox {
- width: parent.width
- text: "Decal"
- checked: false
- onClicked: {
- modelEffect.decal = checked
- }
- }
-
- Item {
- width: parent.width
- height: colorText.height
- Text {
- id: colorText
- anchors.left: parent.left
- anchors.leftMargin: 8
- text: "- Color";
- color: "#FFFFFF"
- font.bold: true
- }
- }
-
- CheckBox {
- id: simpleColor
- width: parent.width
- text: "Simple"
- checked: true
- onClicked: {
- useCustomMaterial = !checked;
- }
- }
-
- ColorWidget {
- id: flat
- visible: opacity != 0
- opacity: simpleColor.checked
- width: parent.width; height: 16
- targetColor: modelEffect.hsv
- text: "Flat Color"
- Behavior on opacity {
- NumberAnimation { easing.type: Easing.InOutQuad; duration: 100 }
- }
- }
-
- ColorWidget {
- id: ambient
- visible: opacity != 0
- opacity: !flat.visible
- width: parent.width; height: 16
- targetColor: modelMaterial.amb_hsv
- text: "Ambient Color"
- Behavior on opacity {
- NumberAnimation { easing.type: Easing.InOutQuad; duration: 100 }
- }
- }
-
- ColorWidget {
- id: diffuse
- visible: opacity != 0
- opacity: !flat.visible
- width: parent.width; height: 16
- targetColor: modelMaterial.dif_hsv
- text: "Diffuse Color"
- Behavior on opacity {
- NumberAnimation { easing.type: Easing.InOutQuad; duration: 100 }
- }
- }
-
- ColorWidget {
- id: specular
- visible: opacity != 0
- opacity: !flat.visible
- width: parent.width; height: 16
- targetColor: modelMaterial.spec_hsv
- text: "Specular Color"
- Behavior on opacity {
- NumberAnimation { easing.type: Easing.InOutQuad; duration: 100 }
- }
- }
-
- Item { width: parent.width; height: 5 }
-
- Item {
- visible: opacity != 0
- opacity: !flat.visible
- height: shineText.height + shinyValue.height + 5
- width: parent.width
-
- Behavior on opacity {
- NumberAnimation { easing.type: Easing.InOutQuad; duration: 100 }
- }
-
- Text {
- id: shineText
- text: "Shininess:"
- color: "white"
- }
- InputBox {
- anchors.right: parent.right
- width: parent.width - shineText.width - 5
- height: shineText.height
- input.text: modelMaterial.shininess
- }
- Rectangle {
- width: parent.width - 8; height: 1
- anchors.centerIn: shinyValue
- color: "gray"
- }
-
- SliderHandle {
- id: shinyValue
- width: parent.width; height: 10
- anchors { top: shineText.bottom; topMargin: 5 }
- horizontal: true
- onValueChanged: {
- modelMaterial.shininess = Math.round(value * 128)
- }
- }
- }
-
- Item { width: parent.width; height: 5 }
-
- Item {
- width: parent.width
- height: textureText.height
- Text {
- id: textureText
- anchors.left: parent.left
- anchors.leftMargin: 8
- text: "- Texture";
- color: "#FFFFFF"
- font.bold: true
- }
- }
-
- Item {
- width: parent.width
- height: texturePreview.height
- Image {
- id: texturePreview
- width: 60; height: width
- source: textureFile.filename
- }
- Rectangle {
- anchors.fill: texturePreview
- border.color: "white"
- border.width: 1
- color: "transparent"
- }
-
- BlenderToggle {
- width: 60; height: 20
- anchors.right: parent.right
- buttonText: "Open..."
- onClicked: {
- textureFile.load();
- }
- }
- }
- }
- }
-}
diff --git a/util/qt3d/assetviewer/qml/ModelViewport.qml b/util/qt3d/assetviewer/qml/ModelViewport.qml
deleted file mode 100644
index 541c147a..00000000
--- a/util/qt3d/assetviewer/qml/ModelViewport.qml
+++ /dev/null
@@ -1,452 +0,0 @@
-import QtQuick 1.0
-import Qt3D 1.0
-import Qt3D.Shapes 1.0
-import AssetViewer 1.0
-import "Widgets"
-
-Rectangle {
- id: view
- width: parent.width/2;
- height: parent.height/2
-
- color: parent.color
- border.color: parent.border.color
-
- property alias itemPosition: mainItem.position;
- property alias itemScale: mainItem.scale;
- property alias camera: viewport.camera
- property alias viewportName: viewportText.text;
-
- // the current x/y positions of the mouse when the onPressed event was triggered;
- // values are invalid if onRelease has occured
- property variant down;
-
- // current xyz values of the Translation3D/Rotation3Ds/Scale3D when onPressed was triggered;
- // values are invalid if onRelease has occured
- property variant translate;
- property variant rotate;
- property variant scale3d;
-
- // the pixel sensitivity values of the mousemovements
- // TODO: expose via api
- // TODO: maybe save in settings api?
- property double translateSensitivity: 32;
- property double rotateSensitivity: 8;
- property double scaleSensitivity: 32;
-
- // the name of this viewport's state
- property string stateName;
-
- property variant upVector: Qt.vector3d(0, 1, 0)
- property variant rightVector: Qt.vector3d(0, 1, 0)
-
- // the smoothness values for the state change transformations
- // TODO: this should be alterable via the gui and saved in a settings file
- Behavior on x { NumberAnimation { duration: 300 } }
- Behavior on y { NumberAnimation { duration: 300 } }
- Behavior on width { NumberAnimation { duration: 300 } }
- Behavior on height { NumberAnimation { duration: 300 } }
-
- signal mouseTranslateX(variant mouse)
- signal mouseTranslateY(variant mouse)
- signal mouseRotateX(variant mouse)
- signal mouseRotateY(variant mouse)
- signal mouseScaleX(variant mouse)
- signal mouseScaleY(variant mouse)
-
- property real cameraZoom: 1.0
-
- Viewport {
- id: viewport
- anchors.fill: parent
- picking: false
- blending: true
-
- // TODO: camera's position/rotation-around-origin/farplane should be alterable via gui
- camera: Camera {
- farPlane: 2000 // debugging
- projectionType: Camera.Orthographic
- viewSize: Qt.size(2*cameraZoom, 2*cameraZoom)
- }
- navigation: false
-
- Item3D {
- id: mainItem
- mesh: source_mesh
- transform: [
- transformScale,
- transformRotateX,
- transformRotateY,
- transformRotateZ,
- transformTranslate,
- ]
- effect: useCustomEffect ? modelEffect : null;
- }
-
- Effect {
- id: coordLinesThickEffect
- color: "white"
- }
- Effect {
- id: coordLinesThinEffect
- color: "black"
- }
-
- // horizontal lines
- Line {
- id: lineAxisRight
- width: 3.0
- vertices: [
- cameraZoom*(-10*rightVector.x), cameraZoom*(-10*rightVector.y), cameraZoom*(-10*rightVector.z),
- cameraZoom*(10*rightVector.x), cameraZoom*(10*rightVector.y), cameraZoom*(10*rightVector.z),
- cameraZoom*(10*rightVector.x + 0.001*upVector.x), cameraZoom*(10*rightVector.y + 0.001*upVector.y), cameraZoom*(10*rightVector.z + 0.001*upVector.z)
- ]
- effect: coordLinesThickEffect
- }
- Line {
- width: 1.0
- vertices: [
- cameraZoom*(-10*rightVector.x + 0.25*upVector.x), cameraZoom*(-10*rightVector.y + 0.25*upVector.y), cameraZoom*(-10*rightVector.z + 0.25*upVector.z),
- cameraZoom*(10*rightVector.x + 0.25*upVector.x), cameraZoom*(10*rightVector.y + 0.25*upVector.y), cameraZoom*(10*rightVector.z + 0.25*upVector.z),
- cameraZoom*(10*rightVector.x + 0.251*upVector.x), cameraZoom*(10*rightVector.y + 0.251*upVector.y), cameraZoom*(10*rightVector.z + 0.251*upVector.z)
- ]
- effect: coordLinesThinEffect
- }
- Line {
- width: 1.0
- vertices: [
- cameraZoom*(-10*rightVector.x + 0.5*upVector.x), cameraZoom*(-10*rightVector.y + 0.5*upVector.y), cameraZoom*(-10*rightVector.z + 0.5*upVector.z),
- cameraZoom*(10*rightVector.x + 0.5*upVector.x), cameraZoom*(10*rightVector.y + 0.5*upVector.y), cameraZoom*(10*rightVector.z + 0.5*upVector.z),
- cameraZoom*(10*rightVector.x + 0.501*upVector.x), cameraZoom*(10*rightVector.y + 0.501*upVector.y), cameraZoom*(10*rightVector.z + 0.501*upVector.z)
- ]
- effect: coordLinesThinEffect
- }
- Line {
- width: 1.0
- vertices: [
- cameraZoom*(-10*rightVector.x + 0.75*upVector.x), cameraZoom*(-10*rightVector.y + 0.75*upVector.y), cameraZoom*(-10*rightVector.z + 0.75*upVector.z),
- cameraZoom*(10*rightVector.x + 0.75*upVector.x), cameraZoom*(10*rightVector.y + 0.75*upVector.y), cameraZoom*(10*rightVector.z + 0.75*upVector.z),
- cameraZoom*(10*rightVector.x + 0.751*upVector.x), cameraZoom*(10*rightVector.y + 0.751*upVector.y), cameraZoom*(10*rightVector.z + 0.751*upVector.z)
- ]
- effect: coordLinesThinEffect
- }
- Line {
- width: 1.0
- vertices: [
- cameraZoom*(-10*rightVector.x - 0.25*upVector.x), cameraZoom*(-10*rightVector.y - 0.25*upVector.y), cameraZoom*(-10*rightVector.z - 0.25*upVector.z),
- cameraZoom*(10*rightVector.x - 0.25*upVector.x), cameraZoom*(10*rightVector.y - 0.25*upVector.y), cameraZoom*(10*rightVector.z - 0.25*upVector.z),
- cameraZoom*(10*rightVector.x - 0.251*upVector.x), cameraZoom*(10*rightVector.y - 0.251*upVector.y), cameraZoom*(10*rightVector.z - 0.251*upVector.z)
- ]
- effect: coordLinesThinEffect
- }
- Line {
- width: 1.0
- vertices: [
- cameraZoom*(-10*rightVector.x - 0.5*upVector.x), cameraZoom*(-10*rightVector.y - 0.5*upVector.y), cameraZoom*(-10*rightVector.z - 0.5*upVector.z),
- cameraZoom*(10*rightVector.x - 0.5*upVector.x), cameraZoom*(10*rightVector.y - 0.5*upVector.y), cameraZoom*(10*rightVector.z - 0.5*upVector.z),
- cameraZoom*(10*rightVector.x - 0.501*upVector.x), cameraZoom*(10*rightVector.y - 0.501*upVector.y), cameraZoom*(10*rightVector.z - 0.501*upVector.z)
- ]
- effect: coordLinesThinEffect
- }
- Line {
- width: 1.0
- vertices: [
- cameraZoom*(-10*rightVector.x - 0.75*upVector.x), cameraZoom*(-10*rightVector.y - 0.75*upVector.y), cameraZoom*(-10*rightVector.z - 0.75*upVector.z),
- cameraZoom*(10*rightVector.x - 0.75*upVector.x), cameraZoom*(10*rightVector.y - 0.75*upVector.y), cameraZoom*(10*rightVector.z - 0.75*upVector.z),
- cameraZoom*(10*rightVector.x - 0.751*upVector.x), cameraZoom*(10*rightVector.y - 0.751*upVector.y), cameraZoom*(10*rightVector.z - 0.751*upVector.z)
- ]
- effect: coordLinesThinEffect
- }
-
- // vertical lines
- Line {
- id: lineAxisUp
- width: 3.0
- vertices: [
- cameraZoom*(-10*upVector.x), cameraZoom*(-10*upVector.y), cameraZoom*(-10*upVector.z),
- cameraZoom*(10*upVector.x), cameraZoom*(10*upVector.y), cameraZoom*(10*upVector.z),
- cameraZoom*(10*upVector.x + 0.01*rightVector.x), cameraZoom*(10*upVector.y + 0.01*rightVector.y), cameraZoom*(10*upVector.z + 0.01*rightVector.z)
- ]
- effect: coordLinesThickEffect
- }
- Line {
- width: 1.0
- vertices: [
- cameraZoom*(-10*upVector.x + 0.25*rightVector.x), cameraZoom*(-10*upVector.y + 0.25*rightVector.y), cameraZoom*(-10*upVector.z + 0.25*rightVector.z),
- cameraZoom*(10*upVector.x + 0.25*rightVector.x), cameraZoom*(10*upVector.y + 0.25*rightVector.y), cameraZoom*(10*upVector.z + 0.25*rightVector.z),
- cameraZoom*(10*upVector.x + 0.251*rightVector.x), cameraZoom*(10*upVector.y + 0.251*rightVector.y), cameraZoom*(10*upVector.z + 0.251*rightVector.z)
- ]
- effect: coordLinesThinEffect
- }
- Line {
- width: 1.0
- vertices: [
- cameraZoom*(-10*upVector.x + 0.5*rightVector.x), cameraZoom*(-10*upVector.y + 0.5*rightVector.y), cameraZoom*(-10*upVector.z + 0.5*rightVector.z),
- cameraZoom*(10*upVector.x + 0.5*rightVector.x), cameraZoom*(10*upVector.y + 0.5*rightVector.y), cameraZoom*(10*upVector.z + 0.5*rightVector.z),
- cameraZoom*(10*upVector.x + 0.501*rightVector.x), cameraZoom*(10*upVector.y + 0.501*rightVector.y), cameraZoom*(10*upVector.z + 0.501*rightVector.z)
- ]
- effect: coordLinesThinEffect
- }
- Line {
- width: 1.0
- vertices: [
- cameraZoom*(-10*upVector.x + 0.75*rightVector.x), cameraZoom*(-10*upVector.y + 0.75*rightVector.y), cameraZoom*(-10*upVector.z + 0.75*rightVector.z),
- cameraZoom*(10*upVector.x + 0.75*rightVector.x), cameraZoom*(10*upVector.y + 0.75*rightVector.y), cameraZoom*(10*upVector.z + 0.75*rightVector.z),
- cameraZoom*(10*upVector.x + 0.751*rightVector.x), cameraZoom*(10*upVector.y + 0.751*rightVector.y), cameraZoom*(10*upVector.z + 0.751*rightVector.z)
- ]
- effect: coordLinesThinEffect
- }
- Line {
- width: 1.0
- vertices: [
- cameraZoom*(-10*upVector.x + 1.00*rightVector.x), cameraZoom*(-10*upVector.y + 1.00*rightVector.y), cameraZoom*(-10*upVector.z + 1.00*rightVector.z),
- cameraZoom*(10*upVector.x + 1.00*rightVector.x), cameraZoom*(10*upVector.y + 1.00*rightVector.y), cameraZoom*(10*upVector.z + 1.00*rightVector.z),
- cameraZoom*(10*upVector.x + 1.001*rightVector.x), cameraZoom*(10*upVector.y + 1.001*rightVector.y), cameraZoom*(10*upVector.z + 1.001*rightVector.z)
- ]
- effect: coordLinesThinEffect
- }
- Line {
- width: 1.0
- vertices: [
- cameraZoom*(-10*upVector.x - 0.25*rightVector.x), cameraZoom*(-10*upVector.y - 0.25*rightVector.y), cameraZoom*(-10*upVector.z - 0.25*rightVector.z),
- cameraZoom*(10*upVector.x - 0.25*rightVector.x), cameraZoom*(10*upVector.y - 0.25*rightVector.y), cameraZoom*(10*upVector.z - 0.25*rightVector.z),
- cameraZoom*(10*upVector.x - 0.251*rightVector.x), cameraZoom*(10*upVector.y - 0.251*rightVector.y), cameraZoom*(10*upVector.z - 0.251*rightVector.z)
- ]
- effect: coordLinesThinEffect
- }
- Line {
- width: 1.0
- vertices: [
- cameraZoom*(-10*upVector.x - 0.5*rightVector.x), cameraZoom*(-10*upVector.y - 0.5*rightVector.y), cameraZoom*(-10*upVector.z - 0.5*rightVector.z),
- cameraZoom*(10*upVector.x - 0.5*rightVector.x), cameraZoom*(10*upVector.y - 0.5*rightVector.y), cameraZoom*(10*upVector.z - 0.5*rightVector.z),
- cameraZoom*(10*upVector.x - 0.501*rightVector.x), cameraZoom*(10*upVector.y - 0.501*rightVector.y), cameraZoom*(10*upVector.z - 0.501*rightVector.z)
- ]
- effect: coordLinesThinEffect
- }
- Line {
- width: 1.0
- vertices: [
- cameraZoom*(-10*upVector.x - 0.75*rightVector.x), cameraZoom*(-10*upVector.y - 0.75*rightVector.y), cameraZoom*(-10*upVector.z - 0.75*rightVector.z),
- cameraZoom*(10*upVector.x - 0.75*rightVector.x), cameraZoom*(10*upVector.y - 0.75*rightVector.y), cameraZoom*(10*upVector.z - 0.75*rightVector.z),
- cameraZoom*(10*upVector.x - 0.751*rightVector.x), cameraZoom*(10*upVector.y - 0.751*rightVector.y), cameraZoom*(10*upVector.z - 0.751*rightVector.z)
- ]
- effect: coordLinesThinEffect
- }
- Line {
- width: 1.0
- vertices: [
- cameraZoom*(-10*upVector.x - 1.00*rightVector.x), cameraZoom*(-10*upVector.y - 1.00*rightVector.y), cameraZoom*(-10*upVector.z - 1.00*rightVector.z),
- cameraZoom*(10*upVector.x - 1.00*rightVector.x), cameraZoom*(10*upVector.y - 1.00*rightVector.y), cameraZoom*(10*upVector.z - 1.00*rightVector.z),
- cameraZoom*(10*upVector.x - 1.001*rightVector.x), cameraZoom*(10*upVector.y - 1.001*rightVector.y), cameraZoom*(10*upVector.z - 1.001*rightVector.z)
- ]
- effect: coordLinesThinEffect
- }
-
- }
-
- MouseArea {
- property int mouseDown: Qt.NoButton
-
- anchors.fill: parent
- acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
-
- onMouseXChanged: {
- if (mouseDown & Qt.LeftButton)
- mouseTranslateX(mouse)
- else if (mouseDown === Qt.RightButton)
- mouseRotateX(mouse);
- else if (mouseDown === Qt.MiddleButton)
- mouseScaleX(mouse)
- }
-
- onMouseYChanged: {
- if (mouseDown & Qt.LeftButton)
- mouseTranslateY(mouse)
- else if (mouseDown === Qt.RightButton)
- mouseRotateY(mouse);
- else if (mouseDown === Qt.MiddleButton)
- mouseScaleY(mouse)
- }
-
- onPressed: {
- // if we already have a mouse button down we don't want to do anything else until it's up again
- if (mouseDown !== Qt.NoButton)
- return;
-
- mouseDown = mouse.button;
- down = Qt.point(mouse.x, mouse.y)
- translate = transformTranslate.translate
- rotate = Qt.vector3d(transformRotateX.angle, transformRotateY.angle, transformRotateZ.angle)
- scale3d = transformScale.scale
- }
-
- // clear the current mouse button upon release
- onReleased: { mouseDown = Qt.NoButton }
- }
-
- ModelViewportResize {
- anchors {
- top: view.top; topMargin: 2;
- right: view.right; rightMargin: 2;
- }
- }
-
- ZoomControls {
- anchors {
- top: view.top; topMargin: 24;
- right: view.right; rightMargin: 2;
- }
- onZoomIn: {
- cameraZoom = 0.5 * cameraZoom;
- }
- onZoomOut: {
- cameraZoom = 2.0 * cameraZoom;
- }
- }
-
- Text {
- id: viewportText
- anchors {
- top: view.top; topMargin: 4;
- left: view.left; leftMargin: 4;
- }
- color: "white"
- font.pixelSize: 16
- }
-
- // --------- grid text begin ---------
-
- property bool bTall: view.width<view.height;
- property int minimalDimension: (bTall) ? view.width : view.height;
- property int textStep: minimalDimension/8;
-
- // horizontal
-
- Text {
- id: h_minus100
- text: -1.0*cameraZoom
- x: view.width/2 - 4*textStep - 10
- y: (view.height/2) - 14
- color: "white"
- font.pixelSize: 12
- visible: bTall==false
- }
- Text {
- id: h_minus075
- text: -0.75*cameraZoom
- x: view.width/2 - 3*textStep - 10
- y: (view.height/2) - 14
- color: "white"
- font.pixelSize: 12
- }
- Text {
- id: h_minus050
- text: -0.5*cameraZoom
- x: view.width/2 - 2*textStep - 10
- y: (view.height/2) - 14
- color: "white"
- font.pixelSize: 12
- }
- Text {
- id: h_minus025
- text: -0.25*cameraZoom
- x: view.width/2 - textStep - 10
- y: (view.height/2) - 14
- color: "white"
- font.pixelSize: 12
- }
- Text {
- id: h_zero
- text: "0.0"
- x: (view.width/2) - 10
- y: (view.height/2) - 14
- color: "white"
- font.pixelSize: 12
- }
- Text {
- id: h_plus025
- text: 0.25*cameraZoom
- x: view.width/2 + textStep - 5
- y: (view.height/2) - 14
- color: "white"
- font.pixelSize: 12
- }
- Text {
- id: h_plus050
- text: 0.5*cameraZoom
- x: view.width/2 + 2*textStep - 5
- y: (view.height/2) - 14
- color: "white"
- font.pixelSize: 12
- }
- Text {
- id: h_plus075
- text: 0.75*cameraZoom
- x: view.width/2 + 3*textStep - 5
- y: (view.height/2) - 14
- color: "white"
- font.pixelSize: 12
- }
- Text {
- id: h_plus100
- text: 1.0*cameraZoom
- x: view.width/2 + 4*textStep
- y: (view.height/2) - 14
- color: "white"
- font.pixelSize: 12
- visible: bTall==false
- }
-
- // vertical
-
- Text {
- id: v_minus075
- text: -0.75*cameraZoom
- x: (view.width/2)
- y: view.height/2 - 3*textStep - 5
- color: "white"
- font.pixelSize: 12
- }
- Text {
- id: v_minus050
- text: -0.5*cameraZoom
- x: (view.width/2)
- y: view.height/2 - 2*textStep - 6
- color: "white"
- font.pixelSize: 12
- }
- Text {
- id: v_minus025
- text: -0.25*cameraZoom
- x: (view.width/2)
- y: view.height/2 - textStep - 7
- color: "white"
- font.pixelSize: 12
- }
- Text {
- id: v_plus025
- text: 0.25*cameraZoom
- x: (view.width/2)
- y: view.height/2 + textStep - 8
- color: "white"
- font.pixelSize: 12
- }
- Text {
- id: v_plus050
- text: 0.5*cameraZoom
- x: (view.width/2)
- y: view.height/2 + 2*textStep - 9
- color: "white"
- font.pixelSize: 12
- }
- Text {
- id: v_plus075
- text: 0.75*cameraZoom
- x: (view.width/2)
- y: view.height/2 + 3*textStep - 10
- color: "white"
- font.pixelSize: 12
- }
-
- // --------- grid text end ---------
-}
diff --git a/util/qt3d/assetviewer/qml/SaveButton.qml b/util/qt3d/assetviewer/qml/SaveButton.qml
deleted file mode 100644
index 7cf788b1..00000000
--- a/util/qt3d/assetviewer/qml/SaveButton.qml
+++ /dev/null
@@ -1,12 +0,0 @@
-import QtQuick 1.0
-import Qt3D 1.0
-import AssetViewer 1.0
-import "Widgets"
-import "fileHandling.js" as FileHandler
-
-
-BlenderToggle {
- onClicked: {
- FileHandler.save_qml(false);
- }
-}
diff --git a/util/qt3d/assetviewer/qml/Widgets/BlenderToggle.qml b/util/qt3d/assetviewer/qml/Widgets/BlenderToggle.qml
deleted file mode 100644
index a9258fc8..00000000
--- a/util/qt3d/assetviewer/qml/Widgets/BlenderToggle.qml
+++ /dev/null
@@ -1,48 +0,0 @@
-import QtQuick 1.0
-import Qt3D 1.0
-import AssetViewer 1.0
-
-Rectangle {
- anchors.topMargin: 15
- anchors.leftMargin: 15
- border.width: 1
- border.color: "#191919"
- radius: 8
- height: 20
- color: "#999999"
-
- property alias buttonText: text.text
- property alias imageSrc: img.source
- property alias textColor: text.color
-
- signal clicked
-
-
- Image {
- id: img
- anchors.left: parent.left
- anchors.leftMargin: 5
- anchors.verticalCenter: parent.verticalCenter
- }
-
- Text {
- id: text
- anchors.fill: parent
- font.pixelSize: 12
- anchors.left: img.left
- anchors.leftMargin: 5
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- }
-
- MouseArea {
- anchors.fill: parent
- onClicked: parent.clicked()
- onPressed: parent.color = "#646464"
- onReleased: parent.color = "#999999"
- hoverEnabled: true
- onEntered: parent.color = "#BEBEBE"
- onExited: parent.color = "#999999"
- }
-}
-
diff --git a/util/qt3d/assetviewer/qml/Widgets/Checkered.qml b/util/qt3d/assetviewer/qml/Widgets/Checkered.qml
deleted file mode 100644
index 49bf1d82..00000000
--- a/util/qt3d/assetviewer/qml/Widgets/Checkered.qml
+++ /dev/null
@@ -1,27 +0,0 @@
-import QtQuick 1.0
-
-Grid {
- property variant color1: "#FFFFFF"
- property variant color2: "#BBBBBB"
- property variant cellSize: 10
- width: 20
- height: parent.height
- clip: true
-
- rows: height/cellSize
- columns: width/cellSize
- Repeater {
- model: parent.rows * parent.columns
- Rectangle {
- width: cellSize; height: cellSize;
- color: {
- var check;
- if (columns%2) check = index;
- else check = Math.floor(index/columns)%2 + index;
-
- if (check%2) return color1;
- else return color2;
- }
- }
- }
-}
diff --git a/util/qt3d/assetviewer/qml/Widgets/ColorSelector.qml b/util/qt3d/assetviewer/qml/Widgets/ColorSelector.qml
deleted file mode 100644
index a55a743f..00000000
--- a/util/qt3d/assetviewer/qml/Widgets/ColorSelector.qml
+++ /dev/null
@@ -1,72 +0,0 @@
-import QtQuick 1.0
-
-Item {
- id: select
- property real sat: 1.0
- property real val: 1.0
- width: parent.width
- height: parent.height
-
- Binding {
- target: handle; property: "x"
- value: select.sat * select.width
- }
- Binding {
- target: select; property: "sat"
- value: handle.x/width
- }
-
- Binding {
- target: handle; property: "y"
- value: (1.0 - select.val) * select.height
- }
- Binding {
- target: select; property: "val"
- value: 1.0 - handle.y/height
- }
-
- Item {
- id: handle
- width: 20
- height: width
- x: 0.0; y: 0.0
-
- Rectangle {
- x: -width/2
- y: x
- width: parent.width-2
- height: width
- radius: width/2
-
- border.color: "white"
- color: "transparent"
- }
- Rectangle {
- x: -width/2
- y: x
- width: parent.width
- height: width
- radius: width/2
-
- border.width: 2
- border.color: "black"
- color: "transparent"
- }
- }
-
- MouseArea {
- anchors.fill: parent
- function mouseEvent(mouse) {
- if (mouse.buttons & Qt.LeftButton) {
- handle.x = Math.max(0, Math.min(height, mouse.x))
- handle.y = Math.max(0, Math.min(height, mouse.y))
- }
- }
- onPressed: mouseEvent(mouse);
- onPositionChanged: mouseEvent(mouse);
- hoverEnabled: true
- onEntered: handle.opacity = 0.5;
- onExited: { if (!pressed) handle.opacity = 1.0 }
- onReleased: { if (!containsMouse) handle.opacity = 1.0 }
- }
-}
diff --git a/util/qt3d/assetviewer/qml/Widgets/ColorWidget.qml b/util/qt3d/assetviewer/qml/Widgets/ColorWidget.qml
deleted file mode 100644
index f60ff1b0..00000000
--- a/util/qt3d/assetviewer/qml/Widgets/ColorWidget.qml
+++ /dev/null
@@ -1,37 +0,0 @@
-import QtQuick 1.0
-
-Item {
- id: colorWidget
- width: parent.width; height: 16
-
- property variant targetColor
- property alias text: flatText.text
-
- Rectangle {
- height: 2
- anchors {
- left: parent.left; right: flatSet.right
- bottom: parent.bottom
- rightMargin: flatSet.width/2
- }
- color: colorWidget.targetColor.color
- }
- Text {
- id: flatText
- anchors { top: parent.top; left: parent.left }
- text:"Color"
- color: "white"
- }
- BlenderToggle {
- id: flatSet
- width: 32
- anchors { right: parent.right }
- height: parent.height
- buttonText: "Set"
- radius: 6
- onClicked: {
- colorPicker.setTarget(colorWidget.targetColor);
- colorPicker.visible = true
- }
- }
-}
diff --git a/util/qt3d/assetviewer/qml/Widgets/HSVColor.qml b/util/qt3d/assetviewer/qml/Widgets/HSVColor.qml
deleted file mode 100644
index 9e137428..00000000
--- a/util/qt3d/assetviewer/qml/Widgets/HSVColor.qml
+++ /dev/null
@@ -1,15 +0,0 @@
-import QtQuick 1.0
-import "../ColorUtils.js" as ColorUtils
-
-Item {
- property real hue: 0.0
- property real sat: 0.0
- property real val: 1.0
- property real alpha: 1.0
- property color color: ColorUtils.hsvToColor(hue, sat, val, alpha)
- property int red: rgb[0]
- property int green: rgb[1]
- property int blue: rgb[2]
-
- property variant rgb: ColorUtils.hsvToRgb(hue, sat, val)
-}
diff --git a/util/qt3d/assetviewer/qml/Widgets/InputBox.qml b/util/qt3d/assetviewer/qml/Widgets/InputBox.qml
deleted file mode 100644
index d3d31837..00000000
--- a/util/qt3d/assetviewer/qml/Widgets/InputBox.qml
+++ /dev/null
@@ -1,39 +0,0 @@
-import QtQuick 1.0
-
-Item {
- id: textInput
- width: 60
- height: 20
- property alias label: lbl.text
- property alias input: inputBox
-
-// Binding {
-// target: textInput; property: "value"
-// value: inputBox.text
-// }
-// Binding {
-// target: inputBox; property: "text"
-// value: { var result = textInput.value*100; return Math.round(result)/100 }
-// }
-
- Text {
- id: lbl
- color: "lightgray"
- anchors.left: parent.left
- }
-
- Rectangle {
- border.color: "gray"
- color: "transparent"
- width: 40
- height: inputBox.height
- anchors.right: parent.right
- TextInput {
- id: inputBox
- anchors { fill: parent; leftMargin: 5 }
- color: "white"
- text: { var result = textInput.value*100; return Math.round(result)/100 }
- selectByMouse: true; readOnly: true
- }
- }
-}
diff --git a/util/qt3d/assetviewer/qml/Widgets/ModelViewportResize.qml b/util/qt3d/assetviewer/qml/Widgets/ModelViewportResize.qml
deleted file mode 100644
index 96e8a2d6..00000000
--- a/util/qt3d/assetviewer/qml/Widgets/ModelViewportResize.qml
+++ /dev/null
@@ -1,30 +0,0 @@
-import QtQuick 1.0
-import Qt3D 1.0
-import AssetViewer 1.0
-
-Rectangle {
- radius: 4
- border.width: 1
- border.color: "#191919"
- width: 16 + 2
- height: 16 + 2
- color: "#999999"
-
- Image {
- id: img
- source: mainwindow.state !== "3Views" ? "images/shrink.png" : "images/grow.png"
- x: 2
- y: 2
- MouseArea {
- anchors.fill: parent
- onClicked: {
- if (view.stateName) {
- if (mainwindow.state !== "3Views")
- mainwindow.state = "3Views"
- else
- mainwindow.state = view.stateName
- }
- }
- }
- }
-}
diff --git a/util/qt3d/assetviewer/qml/Widgets/SliderHandle.qml b/util/qt3d/assetviewer/qml/Widgets/SliderHandle.qml
deleted file mode 100644
index 9f72cabc..00000000
--- a/util/qt3d/assetviewer/qml/Widgets/SliderHandle.qml
+++ /dev/null
@@ -1,76 +0,0 @@
-import QtQuick 1.0
-
-Item {
- id: slider
- width: parent.width
- height: parent.height
- property real value: 0.0
- property bool inverted: false
- property bool horizontal: false
-
- signal changed;
-
- Binding {
- target: slider; property: "value"
- value: {
- var res;
- var pos = horizontal ? handle.x : handle.y;
- var delta = horizontal ? width-handle.width : height-handle.height;
- res = pos/delta;
- return inverted ? 1-res : res
- }
- }
- Binding {
- target: handle; property: "y"
- value: {
- var res = inverted ? 1 - slider.value : slider.value
- if (!horizontal) return res*(height-handle.height);
- }
- }
- Binding {
- target: handle; property: "x"
- value: {
- var res = inverted ? 1 - slider.value : slider.value
- if (horizontal) return res*(width-handle.width);
- }
- }
-
- Rectangle {
- id: handle
- width: 8 + (horizontal ? 0 : parent.width)
- height: 8 + (!horizontal ? 0 : parent.height)
- anchors.horizontalCenter: horizontal ? undefined : parent.horizontalCenter
- anchors.verticalCenter: !horizontal ? undefined : parent.verticalCenter
- radius: 2
- Behavior on opacity {
- NumberAnimation { easing.type: Easing.InOutQuad; duration: 80 }
- }
- gradient: Gradient {
- GradientStop { position: 0.0; color: "#FFFFFF" }
- GradientStop { position: 1.0; color: "#FFFFFF" }
- }
- border.width: 1
- border.color: "darkgray"
- onXChanged: slider.changed()
- onYChanged: slider.changed()
- }
-
- MouseArea {
- id: mouseArea
- anchors.fill: parent
- function mouseEvent(mouse) {
- if (mouse.buttons & Qt.LeftButton) {
- if (horizontal)
- handle.x = Math.max(0, Math.min(width-handle.width, mouse.x-handle.width/2))
- else
- handle.y = Math.max(0, Math.min(height-handle.height, mouse.y-handle.height/2));
- }
- }
- onPressed: mouseEvent(mouse);
- onPositionChanged: mouseEvent(mouse);
- hoverEnabled: true
- onEntered: handle.opacity = 0.5;
- onExited: { if (!pressed) handle.opacity = 1.0 }
- onReleased: { if (!containsMouse) handle.opacity = 1.0 }
- }
-}
diff --git a/util/qt3d/assetviewer/qml/Widgets/ZoomControls.qml b/util/qt3d/assetviewer/qml/Widgets/ZoomControls.qml
deleted file mode 100644
index 7ad01ce0..00000000
--- a/util/qt3d/assetviewer/qml/Widgets/ZoomControls.qml
+++ /dev/null
@@ -1,41 +0,0 @@
-import QtQuick 1.0
-import Qt3D 1.0
-import AssetViewer 1.0
-
-Rectangle {
- radius: 4
- border.width: 1
- border.color: "#191919"
- width: 16 + 2
- height: 16 + 2 + 16 + 2
- color: "#999999"
-
- signal zoomIn()
- signal zoomOut()
-
- Image {
- id: imgIn
- source: "images/zoomin.png"
- x: 2
- y: 2
- MouseArea {
- anchors.fill: parent
- onClicked: {
- zoomIn()
- }
- }
- }
-
- Image {
- id: imgOut
- source: "images/zoomout.png"
- x: 2
- y: 20
- MouseArea {
- anchors.fill: parent
- onClicked: {
- zoomOut()
- }
- }
- }
-}
diff --git a/util/qt3d/assetviewer/qml/Widgets/images/grow.png b/util/qt3d/assetviewer/qml/Widgets/images/grow.png
deleted file mode 100644
index df154010..00000000
--- a/util/qt3d/assetviewer/qml/Widgets/images/grow.png
+++ /dev/null
Binary files differ
diff --git a/util/qt3d/assetviewer/qml/Widgets/images/shrink.png b/util/qt3d/assetviewer/qml/Widgets/images/shrink.png
deleted file mode 100644
index 285d3a9d..00000000
--- a/util/qt3d/assetviewer/qml/Widgets/images/shrink.png
+++ /dev/null
Binary files differ
diff --git a/util/qt3d/assetviewer/qml/Widgets/images/zoomin.png b/util/qt3d/assetviewer/qml/Widgets/images/zoomin.png
deleted file mode 100644
index e4434a07..00000000
--- a/util/qt3d/assetviewer/qml/Widgets/images/zoomin.png
+++ /dev/null
Binary files differ
diff --git a/util/qt3d/assetviewer/qml/Widgets/images/zoomout.png b/util/qt3d/assetviewer/qml/Widgets/images/zoomout.png
deleted file mode 100644
index 4c853bc6..00000000
--- a/util/qt3d/assetviewer/qml/Widgets/images/zoomout.png
+++ /dev/null
Binary files differ
diff --git a/util/qt3d/assetviewer/qml/fileHandling.js b/util/qt3d/assetviewer/qml/fileHandling.js
deleted file mode 100644
index 6ccfb1a1..00000000
--- a/util/qt3d/assetviewer/qml/fileHandling.js
+++ /dev/null
@@ -1,106 +0,0 @@
-function save_qml(closePrompt) {
-
- var effectData = "";
- if (useCustomEffect) {
- effectData +=
- " effect: Effect {\n" +
- " decal: " + customEffect.decal + "\n" +
- " blending: " + customEffect.blending + "\n";
-
- if (useCustomMaterial) {
- effectData +=
- " material: Material {\n" +
- " ambientColor: \"" + modelMaterial.ambientColor + "\"\n" +
- " diffuseColor: \"" + modelMaterial.diffuseColor + "\"\n" +
- " specularColor: \"" + modelMaterial.specularColor + "\"\n" +
- " shininess: " + modelMaterial.shininess + "\n" +
- " textureUrl: \"" + modelMaterial.textureUrl + "\"\n" +
- " }\n"
- } else {
- effectData +=
- " color: \"" + modelEffect.color + "\"\n" +
- " texture: \"" + modelEffect.texture + "\"\n"
- }
-
- effectData += " }\n"
- }
-
- var saveData =
- "// --------| WARNING |--------!!\n" +
- "// This is a generated file. Modifying the text or layout of \n" +
- "// this file will mean that the 3D Asset Viewer application will no \n" +
- "// longer be able to read it. \n\n" +
- "// Changing numeric values is allowable, though care should be taken\n" +
- "// not to inadvertantly change the file structure.\n\n" +
- "import QtQuick 1.0\n" +
- "import Qt3D 1.0\n" +
- "\n" +
- "Item3D {\n" +
- " property double translateX: 0; \n"+
- " property double translateY: 0; \n"+
- " property double translateZ: 0; \n"+
- " property double rotationX: 0; \n"+
- " property double rotationY: 0; \n"+
- " property double rotationZ: 0; \n"+
- " property double assetScale: 1.0; \n"+
-
- " Translation3D {\n" +
- " id: transformTranslate\n" +
- " translate: Qt.vector3d(" +
- transformTranslate.translate.x + "+translateX, " +
- transformTranslate.translate.y + "+translateY, " +
- transformTranslate.translate.z + "+translateZ)\n" +
- " }\n" +
- "\n" +
- " Rotation3D {\n" +
- " id: transformRotateX\n" +
- " angle: " + transformRotateX.angle + "+rotationX\n" +
- " axis: Qt.vector3d(1, 0, 0)\n" +
- " }\n" +
- "\n" +
- " Rotation3D {\n" +
- " id: transformRotateY\n" +
- " angle: " + transformRotateY.angle + "+rotationY\n" +
- " axis: Qt.vector3d(0, 1, 0)\n" +
- " }\n" +
- "\n" +
- " Rotation3D {\n" +
- " id: transformRotateZ\n" +
- " angle: " + transformRotateZ.angle + "+rotationZ\n" +
- " axis: Qt.vector3d(0, 0, 1)\n" +
- " }\n" +
- "\n" +
- " Scale3D {\n" +
- " id: transformScale\n" +
- " scale: Qt.vector3d(" +
- transformScale.scale.x + "*assetScale, " +
- transformScale.scale.y + "*assetScale, " +
- transformScale.scale.z + "*assetScale)\n" +
- " }\n" +
- "\n" +
- " Mesh {\n" +
- " id: source_mesh\n" +
- " source: \"%1\"\n" +
- " }\n" +
- "\n" +
- " mesh: source_mesh\n" +
- " transform: [\n" +
- " transformScale,\n" +
- " transformRotateX,\n" +
- " transformRotateY,\n" +
- " transformRotateZ,\n" +
- " transformTranslate,\n" +
- " ]\n" +
- effectData +
- "}\n";
-
- quickFile.filename = source_mesh.source
- quickFile.data = saveData
- if (closePrompt)
- var result = quickFile.promptSave()
- else
- result = quickFile.save()
-
- if (result !== "")
- console.log("If there was an error it will be after here:" + result)
-}
diff --git a/util/qt3d/assetviewer/qml/images/help.png b/util/qt3d/assetviewer/qml/images/help.png
deleted file mode 100644
index 452ac525..00000000
--- a/util/qt3d/assetviewer/qml/images/help.png
+++ /dev/null
Binary files differ
diff --git a/util/qt3d/assetviewer/qml/images/lock.png b/util/qt3d/assetviewer/qml/images/lock.png
deleted file mode 100644
index cafd8fc5..00000000
--- a/util/qt3d/assetviewer/qml/images/lock.png
+++ /dev/null
Binary files differ
diff --git a/util/qt3d/assetviewer/qml/images/minus.png b/util/qt3d/assetviewer/qml/images/minus.png
deleted file mode 100644
index a93156ea..00000000
--- a/util/qt3d/assetviewer/qml/images/minus.png
+++ /dev/null
Binary files differ
diff --git a/util/qt3d/assetviewer/qml/images/model.png b/util/qt3d/assetviewer/qml/images/model.png
deleted file mode 100644
index 62054e3c..00000000
--- a/util/qt3d/assetviewer/qml/images/model.png
+++ /dev/null
Binary files differ
diff --git a/util/qt3d/assetviewer/qml/images/open.png b/util/qt3d/assetviewer/qml/images/open.png
deleted file mode 100644
index 5db00d52..00000000
--- a/util/qt3d/assetviewer/qml/images/open.png
+++ /dev/null
Binary files differ
diff --git a/util/qt3d/assetviewer/qml/images/plus.png b/util/qt3d/assetviewer/qml/images/plus.png
deleted file mode 100644
index b1ba3774..00000000
--- a/util/qt3d/assetviewer/qml/images/plus.png
+++ /dev/null
Binary files differ
diff --git a/util/qt3d/assetviewer/qml/images/save.png b/util/qt3d/assetviewer/qml/images/save.png
deleted file mode 100644
index e1db4498..00000000
--- a/util/qt3d/assetviewer/qml/images/save.png
+++ /dev/null
Binary files differ
diff --git a/util/qt3d/assetviewer/qml/images/unlock.png b/util/qt3d/assetviewer/qml/images/unlock.png
deleted file mode 100644
index 80c3f945..00000000
--- a/util/qt3d/assetviewer/qml/images/unlock.png
+++ /dev/null
Binary files differ
diff --git a/util/qt3d/assetviewer/qml/meshes/monkey.3ds b/util/qt3d/assetviewer/qml/meshes/monkey.3ds
deleted file mode 100644
index e9a007b2..00000000
--- a/util/qt3d/assetviewer/qml/meshes/monkey.3ds
+++ /dev/null
Binary files differ
diff --git a/util/qt3d/assetviewer/qml/meshes/penguin.3ds b/util/qt3d/assetviewer/qml/meshes/penguin.3ds
deleted file mode 100644
index 26c09ac0..00000000
--- a/util/qt3d/assetviewer/qml/meshes/penguin.3ds
+++ /dev/null
Binary files differ
diff --git a/util/qt3d/assetviewer/qtquick3d.ico b/util/qt3d/assetviewer/qtquick3d.ico
deleted file mode 100644
index c695ac72..00000000
--- a/util/qt3d/assetviewer/qtquick3d.ico
+++ /dev/null
Binary files differ
diff --git a/util/qt3d/assetviewer/qtquick3d.png b/util/qt3d/assetviewer/qtquick3d.png
deleted file mode 100644
index 8351083e..00000000
--- a/util/qt3d/assetviewer/qtquick3d.png
+++ /dev/null
Binary files differ
diff --git a/util/qt3d/assetviewer/quickfile.cpp b/util/qt3d/assetviewer/quickfile.cpp
deleted file mode 100644
index 3fead170..00000000
--- a/util/qt3d/assetviewer/quickfile.cpp
+++ /dev/null
@@ -1,163 +0,0 @@
-#include "quickfile.h"
-#include <QFileDialog>
-#include <QUrl>
- #include <QMessageBox>
-
-/*!
- \qmlclass QuickFile QuickFile
- \brief QuickFile is a quick-and-dirty file handling object that supports file-io that QML/Javascript doesn't.
- \inherits QObject
-
- The QuickFile element is part of the \c{ModelTweak} namespace,
- so the following must appear at the top of any QML file that
- references it:
-
- \code
- import ModelTweak 1.0
- \endcode
-
- \sa QObject
-*/
-
-/*!
- \internal
-*/
-QuickFile::QuickFile(QObject *parent) :
- QObject(parent)
-{
-}
-
-/*!
- Prompts for a location and filename to save the qml \c{QuickFile::data} generated by ModelTweaker.
- Returns an error message if the file was unsuccessfully saved,
- or an empty string if the save was successful/cancelled.
-*/
-QString QuickFile::save() const
-{
- QString filename = QFileDialog::getSaveFileName(0, tr("Save QML File"), "",tr("Files (*.qml)"));
-
- //If cancel button pressed (ie. filename empty), we can just drop out immediately
- if (filename.isEmpty()) {
- return QString();
- }
-
- // FIXME: ensure fileName is appropriate as a qml Component
- if (!filename.endsWith(".qml"))
- filename.append(".qml");
-
- QDir outputDir = QFileInfo(filename).absoluteDir();
-
- QString modelFilename = QUrl(_filename).toLocalFile();
- QString modelFN = QFileInfo(modelFilename).fileName();
-
- QString dstModelLocation = outputDir.path() + QDir::separator() + modelFN;
- if (dstModelLocation.compare(modelFilename,Qt::CaseInsensitive) != 0) {
- // src and dst model paths are different.
- // Copy model file over.
- qDebug("Attempting to copy:");
- qDebug(" from: %s",modelFilename.toAscii().constData());
- qDebug(" to : %s",dstModelLocation.toAscii().constData());
- QFile dstModelFile(dstModelLocation);
- if (dstModelFile.exists()) {
- if (!dstModelFile.remove()) {
- qDebug(" failed to remove dst file!");
- }
- }
- QFile srcModelFile(modelFilename);
- if (srcModelFile.copy(dstModelLocation)) {
- qDebug(" Model was copied successfully.");
- } else {
- qDebug(" failed to copy model file !");
- }
- }
-
- QFile file(filename);
-
- qDebug("Attempting to write: %s", file.fileName().toAscii().constData());
-
- if (!file.open(QFile::WriteOnly))
- return file.errorString();
-
- QString dataToWrite = _data.arg(modelFN);
-
- file.write(dataToWrite.toUtf8());
-
- file.close();
-
- return QString();
-}
-
-/*!
- Save/Close dialog for unsaved changes to QML files. This is shown if the user
- closes the app without saving the modifications they have made.
-
- Returns an error message if the file was unsuccessfully saved,
- or an empty string if the save was successful/cancelled.
-*/
-QString QuickFile::promptSave() const
-{
- QMessageBox msgBox;
- msgBox.setText("The document has been modified.");
- msgBox.setInformativeText("Do you want to save your changes?");
- msgBox.setStandardButtons(QMessageBox::Save | QMessageBox::Discard);
- msgBox.setDefaultButton(QMessageBox::Save);
- int ret = msgBox.exec();
-
- if (ret==QMessageBox::Save) {
- return save();
- } else {
- return QString();
- }
-}
-
-/*!
- Prompts for a location to load a model file from and stores it into the the \c{QuickFile::filename}
- variable.
-*/
-void QuickFile::load()
-{
- QString qmlFilename = QFileDialog::getOpenFileName(0, _title, "", _filter);
- setFilename(qmlFilename);
-}
-
-
-QString QuickFile::filename() const {
- return _filename;
-}
-
-void QuickFile::setFilename(const QString filename) {
- if (_filename != filename)
- _filename = filename;
- emit filenameChanged(filename);
-}
-
-QString QuickFile::title() const {
- return _title;
-}
-
-void QuickFile::setTitle(const QString title) {
- if (_title != title)
- _title = title;
- emit titleChanged(title);
-}
-
-QString QuickFile::filter() const {
- return _filter;
-}
-
-void QuickFile::setFilter(const QString filter) {
- if (_filter != filter)
- _filter = filter;
- emit filterChanged(filter);
-}
-
-QString QuickFile::data() const {
- return _data;
-}
-
-void QuickFile::setData(const QString data) {
- if (_data != data)
- _data = data;
- emit dataChanged(data);
-}
-
diff --git a/util/qt3d/assetviewer/quickfile.h b/util/qt3d/assetviewer/quickfile.h
deleted file mode 100644
index 1c66c60b..00000000
--- a/util/qt3d/assetviewer/quickfile.h
+++ /dev/null
@@ -1,46 +0,0 @@
-#ifndef QUICKFILE_H
-#define QUICKFILE_H
-
-#include <QObject>
-
-class QuickFile : public QObject
-{
- Q_OBJECT
-
- QString _filename;
- QString _title;
- QString _filter;
- QString _data;
-
- Q_PROPERTY(QString filename READ filename WRITE setFilename NOTIFY filenameChanged)
- Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged)
- Q_PROPERTY(QString filter READ filter WRITE setFilter NOTIFY filterChanged)
- Q_PROPERTY(QString data READ data WRITE setData NOTIFY dataChanged)
-
-public:
- explicit QuickFile(QObject *parent = 0);
-
- QString filename() const;
- void setFilename(const QString filename);
-
- QString title() const;
- void setTitle(const QString title);
-
- QString filter() const;
- void setFilter(const QString filter);
-
- QString data() const;
- void setData(const QString data);
-
- Q_INVOKABLE QString save() const;
- Q_INVOKABLE void load();
- Q_INVOKABLE QString promptSave() const;
-
-signals:
- void filenameChanged(const QString newFilename);
- void titleChanged(const QString newTitle);
- void filterChanged(const QString newFilter);
- void dataChanged(const QString newData);
-};
-
-#endif // QUICKFILE_H
diff --git a/util/qt3d/qglinfo/aboutdialog.cpp b/util/qt3d/qglinfo/aboutdialog.cpp
deleted file mode 100644
index 8598cd55..00000000
--- a/util/qt3d/qglinfo/aboutdialog.cpp
+++ /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 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 "aboutdialog.h"
-#include "ui_aboutdialog.h"
-
-AboutDialog::AboutDialog(QWidget *parent) :
- QDialog(parent),
- ui(new Ui::AboutDialog)
-{
- ui->setupUi(this);
-}
-
-AboutDialog::~AboutDialog()
-{
- delete ui;
-}
-
-void AboutDialog::changeEvent(QEvent *e)
-{
- QDialog::changeEvent(e);
- switch (e->type()) {
- case QEvent::LanguageChange:
- ui->retranslateUi(this);
- break;
- default:
- break;
- }
-}
-
-void AboutDialog::on_pushButton_clicked()
-{
- close();
-}
diff --git a/util/qt3d/qglinfo/aboutdialog.h b/util/qt3d/qglinfo/aboutdialog.h
deleted file mode 100644
index fee94a28..00000000
--- a/util/qt3d/qglinfo/aboutdialog.h
+++ /dev/null
@@ -1,67 +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 ABOUTDIALOG_H
-#define ABOUTDIALOG_H
-
-#include <QDialog>
-
-namespace Ui {
- class AboutDialog;
-}
-
-class AboutDialog : public QDialog {
- Q_OBJECT
-public:
- AboutDialog(QWidget *parent = 0);
- ~AboutDialog();
-
-protected:
- void changeEvent(QEvent *e);
-
-private:
- Ui::AboutDialog *ui;
-
-private slots:
- void on_pushButton_clicked();
-};
-
-#endif // ABOUTDIALOG_H
diff --git a/util/qt3d/qglinfo/aboutdialog.ui b/util/qt3d/qglinfo/aboutdialog.ui
deleted file mode 100644
index 7408bc1e..00000000
--- a/util/qt3d/qglinfo/aboutdialog.ui
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>AboutDialog</class>
- <widget class="QDialog" name="AboutDialog">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>157</width>
- <height>170</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>About</string>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <widget class="QLabel" name="label">
- <property name="text">
- <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
-&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
-p, li { white-space: pre-wrap; }
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Lucida Grande'; font-size:13pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:20pt;&quot;&gt;QGL Info Tool&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="label_2">
- <property name="text">
- <string/>
- </property>
- <property name="pixmap">
- <pixmap resource="qglinfo.qrc">:/images/teapot</pixmap>
- </property>
- <property name="alignment">
- <set>Qt::AlignCenter</set>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="pushButton">
- <property name="text">
- <string>Ok</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- <resources>
- <include location="qglinfo.qrc"/>
- </resources>
- <connections/>
-</ui>
diff --git a/util/qt3d/qglinfo/fpswidget.cpp b/util/qt3d/qglinfo/fpswidget.cpp
deleted file mode 100644
index 3c9ee1e8..00000000
--- a/util/qt3d/qglinfo/fpswidget.cpp
+++ /dev/null
@@ -1,279 +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 "fpswidget.h"
-
-#include <QtCore/qtimer.h>
-#include <QtCore/qdatetime.h>
-
-static GLfloat materialColor[] = { 0.1f, 0.85f, 0.25f, 1.0f };
-
-// dont drive the updates any faster than every this many millisecondss
-#define MAX_ANIM_FREQUENCY 5
-
-#define QGL_CUBE_SIZE (6 * 6 * (3 + 3))
-static float const cubeVertices[QGL_CUBE_SIZE] = {
- -0.5f, -0.5f, -0.5f, -1.0f, 0.0f, 0.0f,
- -0.5f, -0.5f, 0.5f, -1.0f, 0.0f, 0.0f,
- -0.5f, 0.5f, 0.5f, -1.0f, 0.0f, 0.0f,
- -0.5f, -0.5f, -0.5f, -1.0f, 0.0f, 0.0f,
- -0.5f, 0.5f, 0.5f, -1.0f, 0.0f, 0.0f,
- -0.5f, 0.5f, -0.5f, -1.0f, 0.0f, 0.0f,
-
- -0.5f, 0.5f, -0.5f, 0.0f, 1.0f, 0.0f,
- -0.5f, 0.5f, 0.5f, 0.0f, 1.0f, 0.0f,
- 0.5f, 0.5f, 0.5f, 0.0f, 1.0f, 0.0f,
- -0.5f, 0.5f, -0.5f, 0.0f, 1.0f, 0.0f,
- 0.5f, 0.5f, 0.5f, 0.0f, 1.0f, 0.0f,
- 0.5f, 0.5f, -0.5f, 0.0f, 1.0f, 0.0f,
-
- 0.5f, 0.5f, -0.5f, 1.0f, 0.0f, 0.0f,
- 0.5f, 0.5f, 0.5f, 1.0f, 0.0f, 0.0f,
- 0.5f, -0.5f, 0.5f, 1.0f, 0.0f, 0.0f,
- 0.5f, 0.5f, -0.5f, 1.0f, 0.0f, 0.0f,
- 0.5f, -0.5f, 0.5f, 1.0f, 0.0f, 0.0f,
- 0.5f, -0.5f, -0.5f, 1.0f, 0.0f, 0.0f,
-
- 0.5f, -0.5f, -0.5f, 0.0f, -1.0f, 0.0f,
- 0.5f, -0.5f, 0.5f, 0.0f, -1.0f, 0.0f,
- -0.5f, -0.5f, 0.5f, 0.0f, -1.0f, 0.0f,
- 0.5f, -0.5f, -0.5f, 0.0f, -1.0f, 0.0f,
- -0.5f, -0.5f, 0.5f, 0.0f, -1.0f, 0.0f,
- -0.5f, -0.5f, -0.5f, 0.0f, -1.0f, 0.0f,
-
- 0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f,
- 0.5f, 0.5f, 0.5f, 0.0f, 0.0f, 1.0f,
- -0.5f, 0.5f, 0.5f, 0.0f, 0.0f, 1.0f,
- 0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f,
- -0.5f, 0.5f, 0.5f, 0.0f, 0.0f, 1.0f,
- -0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f,
-
- 0.5f, 0.5f, -0.5f, 0.0f, 0.0f, -1.0f,
- 0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f,
- -0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f,
- 0.5f, 0.5f, -0.5f, 0.0f, 0.0f, -1.0f,
- -0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f,
- -0.5f, 0.5f, -0.5f, 0.0f, 0.0f, -1.0f,
-};
-
-FPSWidget::FPSWidget(QWidget *parent)
- : QGLWidget(parent)
- , time(new QTime())
- , frameTime(new QTime())
- , timer(new QTimer(this))
- , goAwayTimer(new QTimer(this))
- , xrot(0)
- , yrot(0)
- , zrot(0)
- , frameElapsed(0)
- , frameCount(0)
- , totalFrameTime(0)
-{
- setAttribute(Qt::WA_DeleteOnClose);
- setWindowTitle(tr("Generating Frames/Second"));
- time->start();
- frameTime->start();
- connect(timer, SIGNAL(timeout()),
- this, SLOT(animate()));
- timer->start(0); // call the animation as soon as we return to the event loop
- goAwayTimer = new QTimer(this);
- connect(goAwayTimer, SIGNAL(timeout()),
- this, SLOT(close()));
- goAwayTimer->start(30000);
-}
-
-FPSWidget::~FPSWidget()
-{
- delete time;
-}
-
-#if defined(QT_OPENGL_ES_2)
-
-void FPSWidget::setupShaders()
-{
- QGLShader *vshader = new QGLShader(QGLShader::Vertex, this);
- const char *vsrc = {
- "attribute highp vec4 vertex;\n"
- "attribute mediump vec3 normal;\n"
- "uniform mediump mat4 matrix;\n"
- "varying mediump float angle;\n"
- "void main(void)\n"
- "{\n"
- " vec3 toLight = normalize(vec3(0.5, 5.0, 7.0));\n"
- " angle = max(dot(normal, toLight), 0.0);\n"
- " gl_Position = matrix * vertex;\n"
- "}\n"
- };
- vshader->compileSourceCode(vsrc);
-
- QGLShader *fshader = new QGLShader(QGLShader::Fragment, this);
- const char *fsrc = {
- "uniform mediump vec4 material;\n"
- "varying mediump float angle;\n"
- "void main(void)\n"
- "{\n"
- " gl_FragColor = material * 0.2 + material * 0.8 * angle;\n"
- "}\n"
- };
- fshader->compileSourceCode(fsrc);
-
- program.addShader(vshader);
- program.addShader(fshader);
- program.link();
-
- vertexAttr = program.attributeLocation("vertex");
- normalAttr = program.attributeLocation("normal");
- matrixUniform = program.uniformLocation("matrix");
- materialUniform = program.uniformLocation("material");
-
- program.bind();
-}
-
-#endif
-
-#ifndef GL_MULTISAMPLE
-#define GL_MULTISAMPLE 0x809D
-#endif
-
-void FPSWidget::initializeGL()
-{
- glClearColor(0.9f, 0.95f, 0.8f, 1.0f);
- glEnable(GL_DEPTH_TEST);
- glEnable(GL_CULL_FACE);
-#if defined(QT_OPENGL_ES_2)
- setupShaders();
-#else
- glShadeModel(GL_SMOOTH);
- glEnable(GL_LIGHTING);
- glEnable(GL_LIGHT0);
- glEnable(GL_MULTISAMPLE);
- static GLfloat lightPosition[4] = { 0.5, 5.0, 7.0, 1.0 };
- glLightfv(GL_LIGHT0, GL_POSITION, lightPosition);
-#endif
-}
-
-void FPSWidget::resizeGL(int w, int h)
-{
- glViewport(0, 0, w, h);
-#if !defined(QT_OPENGL_ES_2)
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
-#endif
- int side = qMin(w, h);
- qreal ws = (qreal)w / (qreal)side;
- qreal hs = (qreal)h / (qreal)side;
-#if defined(QT_OPENGL_ES_2)
- projection.setToIdentity();
- projection.ortho(-ws, ws, -hs, hs, -10.0f, 10.0f);
-#else
- glOrtho(-ws, ws, -hs, hs, -10.0f, 10.0f);
-#endif
-}
-
-void FPSWidget::paintGL()
-{
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
-#if !defined(QT_OPENGL_ES_2)
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
-
- glRotatef(xrot, 1.0, 0.0, 0.0);
- glRotatef(yrot, 0.0, 1.0, 0.0);
- glRotatef(zrot, 0.0, 0.0, 1.0);
-
- glVertexPointer(3, GL_FLOAT, 6 * sizeof(GLfloat), cubeVertices);
- glEnableClientState(GL_VERTEX_ARRAY);
- glNormalPointer(GL_FLOAT, 6 * sizeof(GLfloat), cubeVertices);
- glEnableClientState(GL_NORMAL_ARRAY);
-
- glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, materialColor);
- glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, materialColor);
-#else
- modelView.setToIdentity();
- modelView.rotate(xrot, 1.0f, 0.0f, 0.0f);
- modelView.rotate(yrot, 0.0f, 1.0f, 0.0f);
- modelView.rotate(zrot, 0.0f, 0.0f, 1.0f);
- program.setUniformValue(matrixUniform, projection * modelView);
-
- QVector4D mat(materialColor[0], materialColor[1],
- materialColor[2], materialColor[3]);
- program.setUniformValue(materialUniform, mat);
-
- program.setAttributeArray(vertexAttr, cubeVertices, 3, 6 * sizeof(GLfloat));
- program.setAttributeArray(normalAttr, cubeVertices+3, 3, 6 * sizeof(GLfloat));
- program.enableAttributeArray(vertexAttr);
- program.enableAttributeArray(normalAttr);
-#endif
-
- glDrawArrays(GL_TRIANGLES, 0, 36);
-
-#if !defined(QT_OPENGL_ES_2)
- glDisableClientState(GL_VERTEX_ARRAY);
- glDisableClientState(GL_NORMAL_ARRAY);
-#else
- program.disableAttributeArray(vertexAttr);
- program.disableAttributeArray(normalAttr);
-#endif
- QString framesPerSecond = QString::fromLatin1("%1 fps").arg(1000.0f / ((qreal)totalFrameTime / (qreal)frameCount));
-}
-
-void FPSWidget::animate()
-{
- int elapsed = time->restart();
- frameElapsed += elapsed;
- if (frameElapsed > MAX_ANIM_FREQUENCY)
- {
- frameElapsed += elapsed;
- int adv = frameElapsed / 10;
- if (adv > 0)
- {
- frameCount += 1;
- totalFrameTime += frameElapsed;
- emit fps(1000.0f / ((qreal)frameTime->elapsed() / (qreal)frameCount));
- xrot = (xrot + adv) % 360;
- yrot = (xrot + adv) % 360;
- zrot = (xrot + adv) % 360;
- update();
- frameElapsed = 0;
- }
- }
-}
diff --git a/util/qt3d/qglinfo/fpswidget.h b/util/qt3d/qglinfo/fpswidget.h
deleted file mode 100644
index 495de4b9..00000000
--- a/util/qt3d/qglinfo/fpswidget.h
+++ /dev/null
@@ -1,93 +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 FPSWIDGET_H
-#define FPSWIDGET_H
-
-#include <QGLWidget>
-#if defined(QT_OPENGL_ES_2)
-#include <QtGui/qvector3d.h>
-#include <QtGui/qmatrix4x4.h>
-#include <QtOpenGL/qglshaderprogram.h>
-#endif
-
-class QTime;
-class QTimer;
-
-class FPSWidget : public QGLWidget
-{
- Q_OBJECT
-public:
- FPSWidget(QWidget *parent = 0);
- ~FPSWidget();
- void initializeGL();
- void resizeGL(int, int);
- void paintGL();
-protected:
- void keyPressEvent(QKeyEvent *) { close(); }
- void mousePressEvent(QMouseEvent *) { close(); }
-signals:
- void fps(int);
-private slots:
- void animate();
-private:
- QTime *time;
- QTime *frameTime;
- QTimer *timer;
- QTimer *goAwayTimer;
- int xrot, yrot, zrot;
- int frameElapsed;
- int frameCount;
- int totalFrameTime;
-#if defined(QT_OPENGL_ES_2)
- void setupShaders();
-
- QGLShaderProgram program;
- QMatrix4x4 projection;
- QMatrix4x4 modelView;
- int vertexAttr;
- int normalAttr;
- int matrixUniform;
- int materialUniform;
-#endif
-};
-
-#endif // FPSWIDGET_H
diff --git a/util/qt3d/qglinfo/images/teapot-logo.png b/util/qt3d/qglinfo/images/teapot-logo.png
deleted file mode 100644
index a82c33c1..00000000
--- a/util/qt3d/qglinfo/images/teapot-logo.png
+++ /dev/null
Binary files differ
diff --git a/util/qt3d/qglinfo/main.cpp b/util/qt3d/qglinfo/main.cpp
deleted file mode 100644
index 317676c4..00000000
--- a/util/qt3d/qglinfo/main.cpp
+++ /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 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 <QApplication>
-
-#include "qglinfowindow.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
-
- // for QSettings
- QCoreApplication::setOrganizationName("Nokia");
- QCoreApplication::setOrganizationDomain("nokia.com");
- QCoreApplication::setApplicationName("qglinfo");
-
- QGLInfoWindow w;
- if (QApplication::arguments().contains(QLatin1String("-maximize")))
- w.showMaximized();
- else if (QApplication::arguments().contains(QLatin1String("-fullscreen")))
- w.showFullScreen();
- else
- w.show();
-
- return app.exec();
-}
diff --git a/util/qt3d/qglinfo/qglinfo.cpp b/util/qt3d/qglinfo/qglinfo.cpp
deleted file mode 100644
index e58d1005..00000000
--- a/util/qt3d/qglinfo/qglinfo.cpp
+++ /dev/null
@@ -1,344 +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 "qglinfo.h"
-
-#include <QtOpenGL/qgl.h>
-#include <QtOpenGL/qglpixelbuffer.h>
-#include <QtOpenGL/qglframebufferobject.h>
-#include <QtOpenGL/qglshaderprogram.h>
-
-#include <QtCore/qtimer.h>
-#include <QtCore/qdatetime.h>
-
-#include <QtCore/qsettings.h>
-
-#if !defined(QT_NO_EGL) && defined(QT_BUILD_INTERNAL)
-#include <QtGui/private/qegl_p.h>
-#include <QtGui/private/qeglproperties_p.h>
-#endif
-
-QGLInfo::QGLInfo(QObject *parent)
- : QObject(parent)
-{
- QTimer::singleShot(0, this, SLOT(initialize()));
-}
-
-static QString nice(const QString &s)
-{
- QString r(s);
- r.replace(QLatin1String("\n"), QLatin1String("<br>\n"));
- r.replace(QLatin1String("true"), QLatin1String("<span style=\"color: green\">true</span>"));
- r.replace(QLatin1String("false"), QLatin1String("<span style=\"color: red\">false</span>"));
- return r;
-}
-
-void QGLInfo::initialize()
-{
- QWidget *win = qobject_cast<QGLWidget *>(parent());
- // We need some kind of GL context to do the querying.
- QGLWidget *glWidget = new QGLWidget(win);
- glWidget->makeCurrent();
- m_qtGLVersionInfo = reportQtGLVersionInfo();
- m_qtGLFeatures = reportQtGLFeatures();
- m_glVersionInfo = reportGLVersionInfo();
- m_glExtensionInfo = reportGLExtensionInfo();
- m_eglVersionInfo = reportEGLVersionInfo();
- m_eglExtensionInfo = reportEGLExtensionInfo();
- m_eglConfigInfo = reportEGLConfigInfo();
- glWidget->doneCurrent();
- delete glWidget;
-
- QString welcome;
- {
- QSettings freshStart;
- if (!freshStart.contains(QLatin1String("new_install")))
- {
- welcome = QLatin1String("<h1>Welcome to QtQuick 3D!</h1>"
- "<p>Try running the FPS test from the "
- "View menu above to confirm that Qt3Quick 3D "
- "is installed correctly.</p><hr>");
- }
- freshStart.setValue(QLatin1String("new_install"), true);
- }
-
- QString html = tr("<h1>Qt GL Info Report</h1>"
- "<p>Generated at: %1</p>"
- "<h2>Qt GL Version Info</h2>"
- "<p>%2</p>"
- "<h2>Qt GL Features</h2>"
- "<p>%3</p>"
- "<h2>GL Version Info</h2>"
- "<p>%4</p>"
- "<h2>GL Extension Info</h2>"
- "<p>%5</p>")
- .arg(QDateTime::currentDateTime().toString())
- .arg(nice(m_qtGLVersionInfo))
- .arg(nice(m_qtGLFeatures))
- .arg(nice(m_glVersionInfo))
- .arg(nice(m_glExtensionInfo));
- if (!welcome.isEmpty())
- html.prepend(welcome);
-
-#if !defined(QT_NO_EGL)
- html += tr("<h2>EGL Version Info</h2>"
- "<p>%1</p>"
- "<h2>EGL Extension Info</h2>"
- "<p>%2</p>"
- "<h2>EGL Configurations</h2>"
- "<p>%3</p>")
- .arg(nice(m_eglVersionInfo))
- .arg(nice(m_eglExtensionInfo))
- .arg(nice(m_eglConfigInfo));
-#endif
- emit reportHtml(html);
-}
-
-QString QGLInfo::report() const
-{
- QString report;
- report += m_qtGLVersionInfo;
- report += QLatin1Char('\n');
- report += m_qtGLFeatures;
- report += m_glVersionInfo;
- report += tr("OpenGL extensions:\n");
- report += m_glExtensionInfo;
-#if !defined(QT_NO_EGL)
- report += m_eglVersionInfo;
- report += tr("EGL extensions:\n");
- report += m_eglExtensionInfo;
- report += tr("EGL configurations:\n");
- report += m_eglConfigInfo;
-#endif
- return report;
-}
-
-QString QGLInfo::reportQtGLVersionInfo() const
-{
- // Dump what Qt thinks the version is.
- QGLFormat::OpenGLVersionFlags flags = QGLFormat::openGLVersionFlags();
- QByteArray version;
- if ((flags & QGLFormat::OpenGL_Version_1_1) != 0)
- version += "1.1 ";
- if ((flags & QGLFormat::OpenGL_Version_1_2) != 0)
- version += "1.2 ";
- if ((flags & QGLFormat::OpenGL_Version_1_3) != 0)
- version += "1.3 ";
- if ((flags & QGLFormat::OpenGL_Version_1_4) != 0)
- version += "1.4 ";
- if ((flags & QGLFormat::OpenGL_Version_1_5) != 0)
- version += "1.5 ";
- if ((flags & QGLFormat::OpenGL_Version_2_0) != 0)
- version += "2.0 ";
- if ((flags & QGLFormat::OpenGL_Version_2_1) != 0)
- version += "2.1 ";
- if ((flags & QGLFormat::OpenGL_Version_3_0) != 0)
- version += "3.0 ";
- if ((flags & QGLFormat::OpenGL_Version_3_1) != 0)
- version += "3.1 ";
- if ((flags & QGLFormat::OpenGL_Version_3_2) != 0)
- version += "3.2 ";
- if ((flags & QGLFormat::OpenGL_Version_3_3) != 0)
- version += "3.3 ";
- if ((flags & QGLFormat::OpenGL_Version_4_0) != 0)
- version += "4.0 ";
- if ((flags & QGLFormat::OpenGL_ES_Common_Version_1_0) != 0)
- version += "ES/1.0 ";
- if ((flags & QGLFormat::OpenGL_ES_CommonLite_Version_1_0) != 0)
- version += "ES/1.0CL ";
- if ((flags & QGLFormat::OpenGL_ES_Common_Version_1_1) != 0)
- version += "ES/1.1 ";
- if ((flags & QGLFormat::OpenGL_ES_CommonLite_Version_1_1) != 0)
- version += "ES/1.1CL ";
- if ((flags & QGLFormat::OpenGL_ES_Version_2_0) != 0)
- version += "ES/2.0 ";
- flags &= ~(QGLFormat::OpenGL_Version_1_1 |
- QGLFormat::OpenGL_Version_1_2 |
- QGLFormat::OpenGL_Version_1_3 |
- QGLFormat::OpenGL_Version_1_4 |
- QGLFormat::OpenGL_Version_1_5 |
- QGLFormat::OpenGL_Version_2_0 |
- QGLFormat::OpenGL_Version_2_1 |
- QGLFormat::OpenGL_Version_3_0 |
- QGLFormat::OpenGL_Version_3_1 |
- QGLFormat::OpenGL_Version_3_2 |
- QGLFormat::OpenGL_Version_3_3 |
- QGLFormat::OpenGL_Version_4_0 |
- QGLFormat::OpenGL_ES_Common_Version_1_0 |
- QGLFormat::OpenGL_ES_CommonLite_Version_1_0 |
- QGLFormat::OpenGL_ES_Common_Version_1_1 |
- QGLFormat::OpenGL_ES_CommonLite_Version_1_1 |
- QGLFormat::OpenGL_ES_Version_2_0);
- if (flags != 0)
- version += "Other=0x" + QByteArray::number(int(flags), 16);
- return QLatin1String("QGLFormat::openGLVersionFlags: ") +
- QString::fromLatin1(version.constData());
-}
-
-static QString printBool(const char *text, bool value)
-{
- return QLatin1String(text) + (value ? QLatin1String("true\n") : QLatin1String("false\n"));
-}
-
-QString QGLInfo::reportQtGLFeatures() const
-{
- QString d;
- d += printBool("QGLFormat::hasOpenGL: ", QGLFormat::hasOpenGL());
- d += printBool("QGLFormat::hasOpenGLOverlays: ", QGLFormat::hasOpenGLOverlays());
- d += printBool("QGLPixelBuffer::hasOpenGLPbuffers: ", QGLPixelBuffer::hasOpenGLPbuffers());
- d += printBool("QGLFramebufferObject::hasOpenGLFramebufferObjects: ",
- QGLFramebufferObject::hasOpenGLFramebufferObjects());
- d += printBool("QGLFramebufferObject::hasOpenGLFramebufferBlit: ",
- QGLFramebufferObject::hasOpenGLFramebufferBlit());
- d += printBool("QGLShaderProgram::hasOpenGLShaderPrograms: ",
- QGLShaderProgram::hasOpenGLShaderPrograms());
- return d;
-}
-
-QString QGLInfo::reportGLVersionInfo() const
-{
- QString d;
- d += QLatin1String("OpenGL vendor string: ");
- d += QLatin1String(reinterpret_cast<const char *>(glGetString(GL_VENDOR)));
- d += QLatin1String("\n");
- d += QLatin1String("OpenGL renderer string: ");
- d += QLatin1String(reinterpret_cast<const char *>(glGetString(GL_RENDERER)));
- d += QLatin1String("\n");
- d += QLatin1String("OpenGL version string: ");
- d += QLatin1String(reinterpret_cast<const char *>(glGetString(GL_VERSION)));
- d += QLatin1String("\n");
- return d;
-}
-
-QString QGLInfo::reportGLExtensionInfo() const
-{
- QByteArray extString
- (reinterpret_cast<const char *>(glGetString(GL_EXTENSIONS)));
- return formatExtensions(extString);
-}
-
-QString QGLInfo::formatExtensions(const QByteArray& extString) const
-{
- QString d;
- QList<QByteArray> extns = extString.split(' ');
- qSort(extns);
- QByteArray line;
- foreach (QByteArray extn, extns) {
- if (extn.isEmpty())
- continue;
- if (!line.isEmpty() && (line.size() + extn.size() + 1) > 70) {
- d += QLatin1String(" ") +
- QString::fromLatin1(line.constData()) +
- QLatin1String("\n");
- line = QByteArray();
- }
- line += extn;
- line += char(' ');
- }
- if (!line.isEmpty()) {
- d += QLatin1String(" ") +
- QString::fromLatin1(line.constData()) +
- QLatin1String("\n");
- }
- return d;
-}
-
-QString QGLInfo::reportEGLVersionInfo() const
-{
-#if !defined(QT_NO_EGL) && defined(QT_BUILD_INTERNAL)
- QString d;
- EGLDisplay dpy = eglGetCurrentDisplay();
- d += "EGL vendor string: ";
- d += reinterpret_cast<const char *>(eglQueryString(dpy, EGL_VENDOR));
- d += "\n";
- d += "EGL version string: ";
- d += reinterpret_cast<const char *>(eglQueryString(dpy, EGL_VERSION));
- d += "\n";
-#ifdef EGL_CLIENT_APIS
- d += "EGL client API's: ";
- d += reinterpret_cast<const char *>(eglQueryString(dpy, EGL_CLIENT_APIS));
- d += "\n";
-#endif
- return d;
-#else
- return QString();
-#endif
-}
-
-QString QGLInfo::reportEGLExtensionInfo() const
-{
-#if !defined(QT_NO_EGL) && defined(QT_BUILD_INTERNAL)
- EGLDisplay dpy = eglGetCurrentDisplay();
- QByteArray extString
- (reinterpret_cast<const char *>(eglQueryString(dpy, EGL_EXTENSIONS)));
- return formatExtensions(extString);
-#else
- return QString();
-#endif
-}
-
-QString QGLInfo::reportEGLConfigInfo() const
-{
-#if !defined(QT_NO_EGL) && defined(QT_BUILD_INTERNAL)
- QString d;
- QEglProperties props;
- EGLint count = 0;
- EGLDisplay dpy = eglGetCurrentDisplay();
- EGLContext ctx = eglGetCurrentContext();
- EGLint cfgnum = 0;
- if (eglQueryContext(dpy, ctx, EGL_CONFIG_ID, &cfgnum)) {
- d += QLatin1String("Window configuration in use: ") + QString::number(cfgnum) +
- QLatin1String("\n\n");
- }
- if (!eglGetConfigs(dpy, 0, 0, &count) || count < 1)
- return d;
- EGLConfig *configs = new EGLConfig [count];
- eglGetConfigs(dpy, configs, count, &count);
- for (EGLint index = 0; index < count; ++index) {
- props = QEglProperties(configs[index]);
- d += props.toString() + QLatin1String("\n\n");
- }
- delete [] configs;
- return d;
-#else
- return QString();
-#endif
-}
diff --git a/util/qt3d/qglinfo/qglinfo.h b/util/qt3d/qglinfo/qglinfo.h
deleted file mode 100644
index 53aa47dc..00000000
--- a/util/qt3d/qglinfo/qglinfo.h
+++ /dev/null
@@ -1,78 +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 QGLINFO_H
-#define QGLINFO_H
-
-#include <QtCore/qstring.h>
-#include <QtCore/qobject.h>
-#include <QtCore/qbytearray.h>
-
-class QGLInfo : public QObject
-{
- Q_OBJECT
-public:
- QGLInfo(QObject *parent = 0);
- QString report() const;
-signals:
- void reportHtml(const QString &);
-private slots:
- void initialize();
-private:
- QString reportQtGLVersionInfo() const;
- QString reportQtGLFeatures() const;
- QString reportGLVersionInfo() const;
- QString reportGLExtensionInfo() const;
- QString reportEGLVersionInfo() const;
- QString reportEGLExtensionInfo() const;
- QString reportEGLConfigInfo() const;
- QString formatExtensions(const QByteArray& extString) const;
-
- QString m_qtGLVersionInfo;
- QString m_qtGLFeatures;
- QString m_glVersionInfo;
- QString m_glExtensionInfo;
- QString m_eglVersionInfo;
- QString m_eglExtensionInfo;
- QString m_eglConfigInfo;
-};
-
-#endif // QGLINFO_H
diff --git a/util/qt3d/qglinfo/qglinfo.pro b/util/qt3d/qglinfo/qglinfo.pro
deleted file mode 100644
index a2b6a140..00000000
--- a/util/qt3d/qglinfo/qglinfo.pro
+++ /dev/null
@@ -1,25 +0,0 @@
-TARGET = qglinfo
-
-CONFIG += qt3d_deploy_pkg
-include(../../../pkg.pri)
-
-SOURCES += main.cpp \
- qglinfowindow.cpp \
- qglinfo.cpp \
- aboutdialog.cpp \
- fpswidget.cpp
-
-FORMS += qglinfowindow.ui \
- aboutdialog.ui
-HEADERS += qglinfowindow.h \
- qglinfo.h \
- aboutdialog.h \
- fpswidget.h
-RESOURCES += qglinfo.qrc
-
-!contains(QT_CONFIG, egl):DEFINES += QT_NO_EGL
-
-OTHER_FILES += \
- qglinfo.rc
-
-RC_FILE = qglinfo.rc
diff --git a/util/qt3d/qglinfo/qglinfo.qrc b/util/qt3d/qglinfo/qglinfo.qrc
deleted file mode 100644
index 1406cc27..00000000
--- a/util/qt3d/qglinfo/qglinfo.qrc
+++ /dev/null
@@ -1,5 +0,0 @@
-<RCC>
- <qresource prefix="/images">
- <file alias="teapot">images/teapot-logo.png</file>
- </qresource>
-</RCC>
diff --git a/util/qt3d/qglinfo/qglinfo.rc b/util/qt3d/qglinfo/qglinfo.rc
deleted file mode 100644
index 1b6228c9..00000000
--- a/util/qt3d/qglinfo/qglinfo.rc
+++ /dev/null
@@ -1 +0,0 @@
-IDI_ICON1 ICON DISCARDABLE "qtquick3d.ico"
diff --git a/util/qt3d/qglinfo/qglinfowindow.cpp b/util/qt3d/qglinfo/qglinfowindow.cpp
deleted file mode 100644
index ba189ba6..00000000
--- a/util/qt3d/qglinfo/qglinfowindow.cpp
+++ /dev/null
@@ -1,162 +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 "qglinfowindow.h"
-#include "qglinfo.h"
-#include "ui_qglinfowindow.h"
-#include "aboutdialog.h"
-#include "fpswidget.h"
-
-#include <QtOpenGL/qgl.h>
-#include <QtGui/qfiledialog.h>
-#include <QtGui/qfont.h>
-#include <QtCore/qdir.h>
-#include <QtCore/qfile.h>
-#include <QtCore/QTextStream>
-
-QGLInfoWindow::QGLInfoWindow(QWidget *parent) :
- QMainWindow(parent),
- ui(new Ui::QGLInfoWindow)
-{
- ui->setupUi(this);
- setStatusBar(0);
- if (QApplication::arguments().contains(QLatin1String("-maximize")) ||
- QApplication::arguments().contains(QLatin1String("-fullscreen")))
- {
- ui->verticalLayout->setMargin(1);
- ui->verticalLayout->setContentsMargins(1, 1, 1, 1);
- ui->verticalLayout_2->setMargin(1);
- ui->verticalLayout_2->setContentsMargins(1, 1, 1, 1);
- ui->menubar->setVisible(false);
- connect(ui->quitPushButton, SIGNAL(clicked()),
- this, SLOT(on_actionQuit_triggered()));
- connect(ui->runFPSTestPushButton, SIGNAL(clicked()),
- this, SLOT(on_actionRun_FPS_Test_triggered()));
- connect(ui->saveAsPushButton, SIGNAL(clicked()),
- this, SLOT(on_action_Save_As_triggered()));
- QFont f = font();
- f.setPointSize(f.pointSize() * 1.4);
- setFont(f);
- }
- else
- {
- ui->buttonsWidget->setVisible(false);
- }
- info = new QGLInfo();
- connect(info, SIGNAL(reportHtml(QString)),
- ui->textBrowser, SLOT(setHtml(QString)));
- ui->fpsWidget->setVisible(false);
-}
-
-QGLInfoWindow::~QGLInfoWindow()
-{
- delete ui;
- delete info;
-}
-
-void QGLInfoWindow::changeEvent(QEvent *e)
-{
- QMainWindow::changeEvent(e);
- switch (e->type()) {
- case QEvent::LanguageChange:
- ui->retranslateUi(this);
- break;
- default:
- break;
- }
-}
-
-void QGLInfoWindow::on_actionQuit_triggered()
-{
- qApp->quit();
-}
-
-void QGLInfoWindow::on_action_Save_As_triggered()
-{
- QString defName = QDir::home().absoluteFilePath(QLatin1String("qglinfo.txt"));
-
- QString fileName = QFileDialog::getSaveFileName(this, tr("Save File"),
- defName,
- tr("Text (*.txt)"));
- if (!fileName.isEmpty())
- {
- QFile saveFile(fileName);
- saveFile.open(QFile::WriteOnly);
- {
- QTextStream s(&saveFile);
- s << info->report();
- }
- saveFile.close();
- }
-}
-
-void QGLInfoWindow::on_actionAbout_triggered()
-{
- AboutDialog *about = new AboutDialog(this);
- about->exec();
-}
-
-void QGLInfoWindow::on_actionRun_FPS_Test_triggered()
-{
- fps = new FPSWidget(0);
- fps->setGeometry(rect());
- fps->move(this->pos());
- connect(fps, SIGNAL(fps(int)),
- ui->fpsLcdNumber, SLOT(display(int)));
- ui->fpsWidget->setVisible(true);
- fps->show();
-}
-
-void QGLInfoWindow::on_actionCopy_triggered()
-{
- if (ui->textBrowser->textCursor().hasSelection()) {
- ui->textBrowser->copy();
- }
- else {
- ui->textBrowser->selectAll();
- ui->textBrowser->copy();
-
- QTextCursor tc(ui->textBrowser->textCursor());
- tc.clearSelection();
- tc.setPosition(0);
- ui->textBrowser->setTextCursor(tc);
- }
-}
diff --git a/util/qt3d/qglinfo/qglinfowindow.h b/util/qt3d/qglinfo/qglinfowindow.h
deleted file mode 100644
index 84f7d41a..00000000
--- a/util/qt3d/qglinfo/qglinfowindow.h
+++ /dev/null
@@ -1,77 +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 QGLINFOWINDOW_H
-#define QGLINFOWINDOW_H
-
-#include <QMainWindow>
-
-namespace Ui {
- class QGLInfoWindow;
-}
-
-class QGLInfo;
-class FPSWidget;
-
-class QGLInfoWindow : public QMainWindow {
- Q_OBJECT
-public:
- QGLInfoWindow(QWidget *parent = 0);
- ~QGLInfoWindow();
-public slots:
- void on_actionQuit_triggered();
- void on_action_Save_As_triggered();
-
-protected:
- void changeEvent(QEvent *e);
-
-private:
- Ui::QGLInfoWindow *ui;
- QGLInfo *info;
- FPSWidget *fps;
-
-private slots:
- void on_actionRun_FPS_Test_triggered();
- void on_actionAbout_triggered();
- void on_actionCopy_triggered();
-};
-
-#endif // QGLINFOWINDOW_H
diff --git a/util/qt3d/qglinfo/qglinfowindow.ui b/util/qt3d/qglinfo/qglinfowindow.ui
deleted file mode 100644
index 67723d35..00000000
--- a/util/qt3d/qglinfo/qglinfowindow.ui
+++ /dev/null
@@ -1,218 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>QGLInfoWindow</class>
- <widget class="QMainWindow" name="QGLInfoWindow">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>555</width>
- <height>584</height>
- </rect>
- </property>
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="windowTitle">
- <string>QGLInfo Window</string>
- </property>
- <widget class="QWidget" name="centralwidget">
- <layout class="QVBoxLayout" name="verticalLayout_2">
- <item>
- <widget class="QScrollArea" name="scrollArea">
- <property name="widgetResizable">
- <bool>true</bool>
- </property>
- <widget class="QWidget" name="scrollAreaWidgetContents">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>527</width>
- <height>420</height>
- </rect>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <widget class="QTextBrowser" name="textBrowser"/>
- </item>
- </layout>
- </widget>
- </widget>
- </item>
- <item>
- <widget class="QWidget" name="fpsWidget" native="true">
- <layout class="QHBoxLayout" name="horizontalLayout">
- <item>
- <widget class="QLabel" name="fpsLabel">
- <property name="text">
- <string>Frames Per Second:</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLCDNumber" name="fpsLcdNumber">
- <property name="layoutDirection">
- <enum>Qt::RightToLeft</enum>
- </property>
- <property name="frameShape">
- <enum>QFrame::Panel</enum>
- </property>
- <property name="frameShadow">
- <enum>QFrame::Sunken</enum>
- </property>
- <property name="lineWidth">
- <number>1</number>
- </property>
- <property name="midLineWidth">
- <number>3</number>
- </property>
- <property name="segmentStyle">
- <enum>QLCDNumber::Flat</enum>
- </property>
- </widget>
- </item>
- <item>
- <spacer name="horizontalSpacer_2">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>301</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </widget>
- </item>
- <item>
- <widget class="QWidget" name="buttonsWidget" native="true">
- <layout class="QHBoxLayout" name="horizontalLayout_2">
- <item>
- <widget class="QPushButton" name="saveAsPushButton">
- <property name="text">
- <string>Save As</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="runFPSTestPushButton">
- <property name="text">
- <string> FPS Test</string>
- </property>
- </widget>
- </item>
- <item>
- <spacer name="horizontalSpacer">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>241</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QPushButton" name="quitPushButton">
- <property name="text">
- <string>Quit</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- </layout>
- </widget>
- <widget class="QMenuBar" name="menubar">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>555</width>
- <height>22</height>
- </rect>
- </property>
- <widget class="QMenu" name="menuFile">
- <property name="title">
- <string>File</string>
- </property>
- <addaction name="action_Save_As"/>
- <addaction name="actionQuit"/>
- </widget>
- <widget class="QMenu" name="menuEdit">
- <property name="title">
- <string>Edit</string>
- </property>
- <addaction name="actionCopy"/>
- </widget>
- <widget class="QMenu" name="menuAbout">
- <property name="title">
- <string>Help</string>
- </property>
- <addaction name="actionAbout"/>
- </widget>
- <widget class="QMenu" name="menuView">
- <property name="title">
- <string>View</string>
- </property>
- <addaction name="actionRun_FPS_Test"/>
- </widget>
- <addaction name="menuFile"/>
- <addaction name="menuEdit"/>
- <addaction name="menuView"/>
- <addaction name="menuAbout"/>
- </widget>
- <action name="action_Save_As">
- <property name="text">
- <string>&amp;Save As</string>
- </property>
- <property name="shortcut">
- <string>Ctrl+S</string>
- </property>
- </action>
- <action name="actionQuit">
- <property name="text">
- <string>&amp;Quit</string>
- </property>
- <property name="shortcut">
- <string>Ctrl+Q</string>
- </property>
- </action>
- <action name="actionCopy">
- <property name="text">
- <string>&amp;Copy</string>
- </property>
- <property name="shortcut">
- <string>Ctrl+C</string>
- </property>
- </action>
- <action name="actionAbout">
- <property name="text">
- <string>About</string>
- </property>
- </action>
- <action name="actionRun_FPS_Test">
- <property name="text">
- <string>&amp;Run FPS Test</string>
- </property>
- <property name="shortcut">
- <string>Ctrl+R</string>
- </property>
- </action>
- </widget>
- <resources/>
- <connections/>
-</ui>
diff --git a/util/qt3d/qglinfo/qtquick3d.ico b/util/qt3d/qglinfo/qtquick3d.ico
deleted file mode 100644
index b3b85e37..00000000
--- a/util/qt3d/qglinfo/qtquick3d.ico
+++ /dev/null
Binary files differ
diff --git a/util/qt3d/qt3d.pro b/util/qt3d/qt3d.pro
deleted file mode 100644
index 4539ef6f..00000000
--- a/util/qt3d/qt3d.pro
+++ /dev/null
@@ -1,2 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS = qglinfo assetviewer
diff --git a/util/qt3d/qt3d.svg b/util/qt3d/qt3d.svg
deleted file mode 100644
index 4b25ec50..00000000
--- a/util/qt3d/qt3d.svg
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<!-- Converted with SVG Converter - Version 0.9.5 (Compiled Mon May 30 09:08:51 2011) - Copyright (C) 2011 Nokia -->
-<svg xmlns="http://www.w3.org/2000/svg" width="287" version="1.1" height="286" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="tiny" id="svg2">
- <defs id="defs4">
- <linearGradient id="linearGradient4309">
- <stop offset="0" style="stop-color:#d4f301;stop-opacity:1;" id="stop4311"/>
- <stop offset="1" style="stop-color:#d4f301;stop-opacity:0;" id="stop4313"/>
- </linearGradient>
- <linearGradient gradientTransform="matrix(1.0104795,0,0,1.004441,23.387309,76.758859)" id="linearGradient3730-2" y1="131.35715" y2="156.39526" x1="23.626827" gradientUnits="userSpaceOnUse" x2="303.57144">
- <stop offset="0" style="stop-color:#038d30;stop-opacity:1;" id="stop3726-7"/>
- <stop offset="1" style="stop-color:#038d30;stop-opacity:0;" id="stop3728-1"/>
- </linearGradient>
- <linearGradient id="linearGradient3724-7">
- <stop offset="0" style="stop-color:#038d30;stop-opacity:1;" id="stop3726-7"/>
- <stop offset="1" style="stop-color:#038d30;stop-opacity:0;" id="stop3728-1"/>
- </linearGradient>
- <linearGradient id="linearGradient4315" y1="62.920685" y2="62.920685" x1="72.492188" gradientUnits="userSpaceOnUse" x2="165.83203">
- <stop offset="0" style="stop-color:#d4f301;stop-opacity:1;" id="stop4311"/>
- <stop offset="1" style="stop-color:#d4f301;stop-opacity:0;" id="stop4313"/>
- </linearGradient>
- </defs>
- <metadata id="metadata7"/>
- <g id="layer1" transform="translate(-25.071424,-77.933617)">
- <path style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#d4f301;stroke-width:8.85648727;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="path3722" d="M 149.39285,339.37194 C 118.29002,338.06386 93.410274,329.21846 78.267585,314.08502 66.239667,302.06444 58.159936,285.11057 54.818135,264.88047 c -1.962614,-11.881 -2.442596,-20.11519 -2.455216,-42.1199 -0.01051,-18.36712 0.160997,-23.0644 1.239861,-33.95521 2.529982,-25.53941 11.482605,-46.43472 25.677112,-59.93007 16.042727,-15.25252 39.462148,-23.21337 72.203768,-24.54383 6.77105,-0.27512 31.97542,0.38686 41.46813,1.08915 17.85829,1.32123 29.86273,4.01251 41.92069,9.39824 16.71724,7.46685 28.60768,18.52238 36.44553,33.88638 5.7477,11.26691 9.34961,23.29707 11.69339,39.05536 2.22754,14.97664 2.81073,44.00559 1.22086,60.77114 -2.76934,29.20404 -10.704,50.36949 -24.19378,64.53629 -8.65346,9.08774 -21.29946,16.39504 -35.37578,20.44137 -13.11053,3.76868 -25.14568,5.0858 -52.44498,5.73944 -13.81368,0.33078 -17.4242,0.35023 -22.82487,0.12311 l 0,0 z"/>
- <rect width="236.93414" x="49.282932" y="102.78797" rx="95.84404" ry="92.255867" height="239.43414" style="opacity:0;fill:none;stroke:#008000;stroke-width:3.29858350999999980;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="rect2852"/>
- <rect width="175" x="28.571428" y="19.214285" rx="95.84404" ry="92.255867" height="206.07143" style="opacity:0;fill:#b94b4b;fill-opacity:1;stroke:#05d105;stroke-width:4.147;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="rect3704" transform="translate(25.071424,77.933617)"/>
- <image width="172.71428" x="86.571419" y="214.50505" height="93.14286" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIkAAABMCAYAAABZAZTOAAAABHNCSVQICAgIfAhkiAAAF+NJREFU eJztXVlzHMeR/qq6e06ABE9QomTJlu0IKdaxftmH/Xf783Zf1l7FWpbWFiXSFA+QIIDBYDBXd+1D ZlZlVdcMTpLYBTKi0T19d9fXmV8eVTAAHG7kRtaI/dg3cCNXX25AciMnSvmxb+CDiwEMAGPW7+Zc PL/Ocu1A0ukAvT5QdQFjAWsUYBzQOKBeAssFMD0GFvMboFwLkBgDdHtApwfc3wbubQMbt4CiBMoK sJa0S+OA5RyYToHpBNh9Dbx9DRwfAYsFri3FvxYgAYBuH9jcAh4+Bh59Bty+QwCpukBR0D5NA8yn wPGEgFFWwGxKWmWx+Lj3/zHleoDEUIN3e8CdB8CDT4BbW0BVkXaxBWmbpiZQTI6AyRiYHQM7L0jj XGe5Ho/vgMkhcY3Xz4mT1EsGSZdBYGjdfAYcHQLjEfD6BXDwjsByXU0NcE1A4hybkAnw0/fEPyrW LDBA6UiTLBekRXbfAO92gJ//h+Y3xPWayeyYTMliAVQdIq1lSZ6Oc4BraPtkTJ7NjVxDkBxPSFMc vCPCWnWA/pDAcmyA+Rx4+xLY3yXyet21CHANQeIccY53O2RuXEOmxhjaNjkERnvESZbX2KPRcu1A AhBBPT4id3fJgTNb0Hw2JVNU1zdaROTagaTTBe7cBwYbpFF++JY5iSFgTI6ArXtkhgRM110M/j86 d5yfcY6JaUWNLhyk6pCpMYYIq4TlHcj81EvSMHMOpDVNCNHLuYHro2mupCaRRut0QxzDWjIJlvPW Pu9iQ2PLfmVF6wrev6jI5bWW1jmoBs40tFH5HPF4plMCScNmyKkcT63WOUfndI7A1TR0TF3zvks+ T/OeX+IFxFh6ZpErBRJp7LKixhxuAP0NBkrB68sAgKII0VIBg4DEWs7JMLgKtd+Z9Cc3+HJJDdzU 1MACksWC1zGYBDBNTdsFHIs5ud/zOXA8prkA6H2LB70Cv/F/wnZ5l84Bi1kA+tUBiQFsScC4fZfM wa3bwGAT6A2okTtdjm0UxCPKkoAhD1iWQVsYGwBhlUnRLwxh5kWbEOf/MDAaNXcEgHoZGrupCUxN HfI9TU2AmB0zWZ4BhwfAaJ/WHR68X6BYS6mHwRAoO6RRiwoo1DuRj6jqUYHRaJ/SEYs50MyvEEgs Z2rv3KfcSn9ID9br00NqPiHaoigDIESrCCBEi5gMSPQXBSiOgXhBmyWnQSLmhsEhPEbMigcJr1vM CRyzTQLOcJOeazImrjM7fj/vtOoQQd9+TInNwQa9006PPijnQklEvQCOjoDxfvoyrhBIjAGqklP6 rDEKBQRtXsSUWAuYggCmzYsnpDYUGEUaRJFPveytUI6vGAB8PjDvsLzsjAIT72sdUDguQWAtt+S3 3elSVrppQgb6fUhZUUnE9mPgs18Dw1sE0G6frtvUpN3evSFP781r0iCjPQK18KYrA5Jun0zLcJNe YlkG4pkCAMpciERawCTLLr9JrxRvSPb3WiTRKn7u0AaRCbfmgerC/RcFHVNWpEkMqHxhPrv8wF1/ CPzun4D7j4Cvviag9AZ03aKkeNDxGHjzCvjHE2DvLfDLTwSY1Gs7F0iM/vQQiKT/itU2v7imXLAo AkB6A9YiZWJCeBJT4af4VmJyZlZf1rQWkuUcsV1DeD1uDWJN5kjbGX4W5+jZqg6d6+4DzjofrH4/ Z5VuD3j8JfCHfyEQ3t+m91uWpB3G74BXzwkY3/8JePI93cMqj+tsIDFAr8cVXZ3gMfT6wK07ZPOq iolQGbiA9ypsu1GNBQ73gd0dQr8HSKkAIgBEMC1GN4bWLhktk65vgbilXuJjDaixW8emgEy8CNEo 1hBRtBYAm56qousNNqi2ZT4NRPi8Ivdy/xHw+z8QOPpDoD+g68MR/3n6d+Db/6DKu5fPSJOti/mc CBJ58P6Q0Hj7DpkD+eJtQSAZbhKCS/EsVMNmPQpeNxnTC6o6wTvJmZhUe/hzIOEdrQc4+eVGPEQf 5+Kf6emymDLEUVIuJN6Wc0HLiEfW6QbQXMTRES9lsKHMdhU0mFTe7b6mj/Lw4HSgXAkSY+gim7eJ Lzx8DDz8BLj7kIuJB6RNrA3aQ9v1ls120cy/vNc1ub79AYFMIqOeoKa8JNEgOfBIA4WHQb6VVz58 sqvmNmqug24pICJzo0DhwDEfRWKHt4CjUShhOG8kVz7e+4/IjIlmNpbiHvMZ8OIZ8ONfgJdPQ2T5 JMmCxBg6+fZnwG++plzG9uNQ8tc0RLTm88CQ5zN6QAljiyvolMuoo3jglznap+O7/aBNVvERkwML nwspWBLVn4KkxUl4LlrFgDRCxHa1meHtWZBwEZNlFd+o+4YD6iKURJYdig0NNsmlnh7TuzuPdHuk 6R88AjY2qX63ZC/m8ICmv/wn8PxnIq6nlZWapKwIHJ99Sdrj3jY14mJOKutoTOn0xRyYcdXXfBZC zgsOQUtsAS4mRkJC6yVHVzdVBNW2Gzl1YdMG02BJt/lrrtEmEmmMwKH3zWgTMS1+PwXAVMshXaeA L7kl0cjnBYl4Tf2B4oyWYiDTCZdk/kIk9Uznza3sDwmNv/0G+OJ3pA6XS+DtK+DNSyKaL55Sd4Pp hIDhw9N1sH86zwEETeJcCIY9+pyupTWIkDxjedmE/jHpi86SVQ0utSpaUECITBNIE6TerTOZfV0C PDXp+7RQGhEh5uMcfellRQ3b1NSAy3OYnKpDMZHNLU5ldOjaDZdu7rwkj+bNy7O721mQbD8GfvUV 8PlXBBg4Asj3fwZ++C+66PiA7JyOQJ7lwaouTRI8KysVGylUviU1NRlOYtWEXGOyrAKM079V3CQi rupgp8Bl1Pas9hPvzNEzAYFrFS54Or0hNWi3T+b3LNrEGKDbJROzeZvAUnZoW72kj/rlM4qHHE9O f16RFkiKki60dZ/mAHGP3dfAs78Dz39SJuSckrrNHiBlTFRNMq36UrONg2CCUrWfmqGc+UnicJ6n yP37fRSovHbj9alpsQaASjjCBXe/0yVN0h8A44r4yWmTkMYC3QGweYc0SZcDZjWnBEb7ZGZePD2f i21bFzSxNyEZzcWcyI5zp773tQ8lNR1RxnYdAIAAEMRT2sgJLYnP0bqZNatTMCXb9PH+OgjPcSow q2hsWZKZEA/vtGItl1X0QsbcmACS6XGojTmPZM2NqHshc00TCKvkLc4r1nJc5RYxenkoq7wZvexN inATGzdGLlejGyj1blJTA8QAih5NtETGfZdzCNk1FrBNzF2sod8N37ezdA7/AdrAT6oScB3Or4zp nU/Gp3ifnB3f3CLPZvM2/QaIDowPgN1XF6vZbWkSIJiTxoWHLbjxWiTxjGIs+fL9IdlRT1hVIs9r MhNrGZ/V1eBITYwGhdIgGhyt7RpEa85p2Fx4DaPWCx+KMs/KzPjaFj2pj0L6JQ84+y0NfZJ0e8RB 7tyjEMWQzbcEzkb7oT/zeaUFEteQWZlOCInG0AN02bUqOOt6XikKerBeN46L5AJnOU2SU9+Riwm1 vAYQkVkQSc3WCrMh+6agjDhI5ncE/ISgF1wbU3WATj8k4tZJWREw7j4A7j0ksPSGdL6a41dSuzKf nbvJ2uamaeiE82noJG25lqPTZTV5AdJqC2Lzvje/IqVrbXem0VMiC7SP0XKS2QHa5iY1RaJBnCKy Lr0fledx6ppyD61JaxnJ7XAOax3RLCtOl2zQXLxEYwG3JIdDx67OKy2QOAeMDoC9XbJnW/fowptb 1Nm6NyBNc54uB12ukNq4RZpJyhRT7dHSJNrLWQOeVFPkTAigtqt9WuLibf6nWu84gmqA4M3IaeW+ HXxo3qacxAVgFAV9fEVJ78iAu5wmkVF5xm6PirM+/YK8xC3uASBdV+dz4GAvRLQvUv2WVWiTMfVw Gx1wYUwJbNymrOKtLSJB8xngznjh4SarxEGc6S2U+jUFgAKAtu0G4UPVQFhBVr0bKiCxiEChG1PW +UWT9+C01vDLvN4n7RxaILZ8jLM8V/doQc9r6hA3kTKCpiF+MT7gELoJprqqCCCffEGpk8GQCStn 6F1D2d69N8D+W2rP80ZxgRUgkWqlnV+AX/2G3LLBkBJHn35JUbujMTA/44WlIkvGBFlVbeYjrClR TQhsRDiR0SbatJhkLpKYJZeaGBWeN0BUSS6WJdIeBpCSCIncmgQYjTyLow+ksUCtvJ2youv2+qx1 B2SCBpvA1l36yG5vUbrkzgPebzP0CJhPCRij/RDBvYhkQeIaIq2SmZRsYn9IbtbxEedxTqhDSMVm ABE1vvrKV5FT31h60iYmlVXblCnKHmYCYHLP6I9TWici0XKvLr5Xl3muyKSa8G46XQIJLAFnuAHc uhtAMdig+h5fEsCorbnP0PiAHJCLdt/IgkQ6I736BfjlKf1+9CtC8eMv6WHe7TC5PWXP+6LkUDxH V6NYiG3PtWu5jtBa9Vt8NYN4fY6wZvmJLnPQ+8SbY8TJuZtwPQe6F+uYuEpQ0gKmUfetNKOPm6h3 I2O7CS/sD7lOpEfbxF2WEZvAgc/phOpUd17QR36acoB1stLJqpfUu/7JX0lzDDaIHD38hLa/2yFV Nto/OdRrjKp87yalABnNos1OzsxkiaoNjeo5xxqQrCKvEQgUWCJtokHC5FV7OFq7yXZ9zwIIIH52 pyr/Gx4Oo7BETqtOiKiWFcWYpPOaZM6Xc/poj5hTSpb+It4osAYkzhE4dnfoBscj4O42+eFDzjZ2 B0AxPl0+QKqvfFlj0uCrYhGnmpSk54M6lcx9HYhyVVuu8KptibbR19XurlwnfY6cG58zPdaGuhwx 974XQRm/TyFHNff7mfG4b3V9OT0F14Zr6pqyv+MReTdb98hG3r1PFdjLBZHYH787OVhji5DI00Gk KNxu4xflzY+sQ0a7aO2hAZJoltw8dZU9EwWywPFASESbMGNBpoeJqVPrxQXWw11Y8W7YJBWJO2wL 6qzW6XL6X7nM0pvRcf3O9IjLAl5QIvasnHGVnFjjenxE09/+mzjJ13/kqrXHhNqt+2T3XjxdzU8K 7k8TdZNQDZ8lr3p7zryo7VEjp5pIFlPNohtbmRdn4DO7QMxPUs9HjoHaJvfjeO7vHyvuXwG69YGw GRlucnS64nuxIeot2mY2BQ5HYay3N68u5vZqOXW1/OvnwJ//nR7i3jYNc/nJZwScxZwa/uUzIryt i1RcE1vFZHWlqUkAsA44KWDSCXpfZLSJlmSda68KG5JjxHzpub8WE1Z/SAYsonly+R0BoM8M83ll IMDlgvjh21dED14+O11y8LRyapA0NQ0R9exHQu1gg0xPfwBsfwqMeJTCN69DhZqItTEXQdLQuoFb Lm6qDdQ26PkpNciZRZmgaLVRqzP8JL1HWaezxC0Srvc1wdROJ8ElFq3lu5IyWT2ekBOx94Y8m8sc UKQA8G+n2dE5AoEEaKwN+YI797lGlXMNUgsr6q7ToyTUYCPUTEgNps8AC5vnCKwspyUDkXuccpbU C0rJ8YrGyWmwXKPJexAwpw2hf0Ydz13gIv63C8v+o3KIRiZYcmf0kjtyDTbIzPg6kQlpjKND8kSf /g149Q/SJpcpZ+qc5RwF2KTn/HhEAPnqawLB1/9MYfu9t0Sc3u2QOkw9mtQmpBoFutGgGu2kSR+r j0H4vU6rpO0uPATpOkDF5ONz68CaFFTrZ/Che3XMKr5lLTsHL+g8W3fpg5Nhu45G7OoeAs+fUA3r aB+XLmfu5ukcBdHe7VDjj/aoluHTL4jENo40zGJBX8XRIS1LPiXiG6cR1dBnshpm9XL0Mz2pEFFe 9hoEaBVI63NEATi9X+aDkNW5/FAKbIC8lOU8jO0mVYJTHrpitEftITm1y5Zz9QUWLTIe0e/FjDon f/l74OGnpF3uPgRefU5If/ksVIdrF7PV6Ep7ZOUs4JLzyeIqoCQnlMYzGiz8u+X+Jtpk5c2l15CH zxyXey8yRIQMVTGfETCkbvXwgNze9zW+26WMKvDDt9Th57ffAH/8V+InW3eBzVuE+Nt3gCc/UP+P plA2Wk7g4imy7VjjZeidTkJP0iD62kbvkmqC5D5OukZ2PxdmDupjcfGy/NaT1PdMxlS+0TTERXZe AE++o9TJ+x4x6VJAUteE7O/+RP07tu4BX31DHbv6A2DrAeD+GiKATUPV4EaVSTYOAP+2QvB44Biw ffeA4cCTa1TDcgALoHMYw+dMuY5TxyCsB58bDSIAybJb0YhCRmUEJMdV7nrAG7/Nhed3yTrH76Bu 4v3rZci2i3k5PKCQxOH+xfMyp5FLHZ9kuaAbbxqg/zMAR9lKZxAVVusXlJsax8kx2ZcbX48LYtT+ XolkNIDXEhkSIACJBqDR59AaYBVIZB+X7OMPVOvUMzcunDf3/H40Je6iOZ2QyT46pGKk6fGHG5zv 0kEy2uPxNvYJ7YMNCr4tmbxKfqFckjvXcD1Fw/1QahV4Ehc6jYEYfvHWhWJtqc/wmoOjkrq/rpwr t+wlNXcuXpYvHwiNHmmOjMaQwfiaRJNKtLSugWUdhtOSjtxL7p75+he6hsRGlssP+0+aLn2kIyFZ o31CfFFSfqeoCCx1P+RwAOUCcnSRTqLyHAj7WQaGjpFYDs61+u1Y6sqQur0rCax/gLOBRGuJRpuO ug2Sekn7CABcw8vLMLqjdJldLihAdnhAdSEX7RB3EXmvw2Et+WFnx9x7fjNUctd10Cy2BgrWGtKw cPBxldogqtD37jTgE2iyfxoQS93KlvZIgbLK9EBpCW1GmMOk/EP3hfbjuer1Ah498bp6GULu3qx8 IK2Rkw82ZtpyDhzuAa6miKtlgGhtYYvQEMYCtQPKBr7OwloClK4sj7pdJJokDf8DaMdcMiYnCqBp XiKjIyT8BIhBEGkSF5sRPeJ0U5PWWCwojFDXFIOasZs7PiCOd9F6kIvKBx1Yb7TPyUBu9G6P24hf uqTIGxcA4ZZAw90EJINsEMyTjEfqM6MJUFogAdbGSYD1IIkIqvzGCk3Cy37YziXvw+amqYH5gj6g +ZzAM5tS/OnokOqMp+fo4H3Z8kFBMuevRcr2BhtB7bqGGr2qidRJ/9i6JFNkLWDLABKdJdXJsCjM L/smWsRHPl2yHsh6N7KoPZQsSBK3V4OkpUl4uPEFg2TGpaACjvGI+MjHNDMiH3yITin3nxzBdxz3 ZYxNaGjpdS/SWOpy4BgMToJyTGSdZJjRBkmT0ySrgm+pG524wanrLmYn0iAOMScRDyYxN96TWYRO VPJfu+ZnGInofcsHB0nDINnf5RK7Zfj6ZADauiYzUlSkRYqatEE0lrwuotagMIlmQQwekWiZ5y0r k/FsUqDkQOKBkdEkjXg0MiIU95YccSxk721Iol4FLQJ8pMF+pexgPouZvfzzxIo7K5U19/JbJiDR pkaZn1aVvYDDhsCZSA4wKRdJXeGWuVFTFiSsSWqlSXysg0spZseUxd3f5dT/YeAuV0U+2ojQTQOg CX14un2gUZXfEpqnneG7VIrn42xYNoY5jXKBG61ZGpyOuCYNk4uReJAg/p31biQ+okHShH9OoP/F 7NEhmZurBhDgCgwbvpjTV+QcdbsAmLQ61X4SXHO83gZOIkBolIlpEdgUFGlsJLE3KXHV7q9f5g06 79I0gBPtoThJrYJlTUOJTuEge7uU5r/McsPLlo8OEoBe3miPvrbegLSKRF99dFWq2ETTpAXVmUJq DYg0TiKiNYyvCdE7SBxEeUNSMuAcIB2vDGuyxvD6Omg42S7nq5vwnyvkv4ZeZbkSIAFCctDVZK97 gzACtVSKd/thZKSyopELbZkQ2RQoUIBRyz4xuMrcrOAkIS0cPBkdPKszJmU2BdwYOOYBd0f7gbhP Dq+eeUnlyoAEoJc1nxORk7E1pNimKLkHWydolS4P+CIxlZbHk9S/AiHg5qBAlNxDdi6AELOjEnXi wYh2kP+WJbGQ+YzGuhXeMRmHcW+vOkAAZKvoPqpIg0uEteyq/58nBdPc8L0+daKOttn4HD4amxZF a4CkwTTxXhCWI2Kq4h9LxTumkzB2i/xrNdEuNY+gLUk97fpfdblyIGmJJp5JEExGBIqCZxle4jmJ Njnq/JHkPBwFGOcAKUzy3g248WUUbO0e8zl1nuf/mlx9kNzIRxd78i43ct3lBiQ3cqLcgORGTpQb kNzIiXIDkhs5Uf4XvCkz5B6wzDwAAAAASUVORK5CYII= " id="image3149"/>
- <image width="156.57143" x="89.857132" y="140.67836" height="65.897751" id="image3075" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPMAAABoCAIAAACrNVHoAAAAA3NCSVQICAjb4U/gAAAgAElEQVR4 nO29ebR9SVXn+Yk4w73vvvd+7zfkPJFJAmKiKS0qMpQMIlQJBYhoaQMKWpZFid2WrdCuokpKWykX WtqKJbZDtraKUoWKE6JLUFBAlDlBSCAHciCH3/SGe+8ZYug/dkTcc+f3ywGl+7fXXW+de96558SJ 2LHju8eA83SeztN5Ok9fKKQe3NsVRfGox1xx9aOOHL/MXXlNfuWJ8qKNo+3Gme2eHtbu5vF9e/vu 4Iz77Cfb2z/Z3PGZ4d4pOx6aB7cNX4i0ublx5TUnLr92MDiito/mR47nWb/dOZLtbGa9QtetOzU+ qCvfDNVdt47vunW4e8oenHGn76mr8fneW0z5A7/FxmDjWc/88mc96zGPf/zFX/IllxdFBqfgPtiF IRyH2+K1TfeHlpMtnDzwv/nes+/5vfyDb2/uuKlyzj/wJv3Tp6uvvfQF3/RFT/yKK6691lx77eb2 9gBKAE7GS05P/+IMAMfgDNwLPaBlb2z48G363Tf6t/+P3Y+9Z3T3ba017vP2Fv+U6f7L7LIsXvCC p73sZc946lOvL8scdjuDIZydwx7oDmff0b2DcDawz/4228Dt1fCG37V/9N/sx987tvb/ayOUZfqZ z33sC77++n/xL7708suPxdOfhFFka5Zz9gHUAFgYAfK1pgZ6bNYMK6rM9n/93fVv/eTw7942amr7 ABv8p3/6dU996hWQgdyqAKCNxzKaV8FnZ37oPd7f4RzO4Zx3Du9xzreOg9bfMjp1duTPjPw9J4f7 p/3eKfZPqXtus6fudGfv9fun7fiAauj8AxNx94ezd3aO/OAP/q/f/d3fesEFwrtngWnOPgs3gwbA wal4/o44KoB17BnQsMd+n4GCs+x72GZ7d+xf+WOn/+D1zXD3gQ7PPwXK8/wlL33iq3/o2Q9/+IVz /zwLQ7gXBnAx3BTPn4QCDqCB7Xh8Jv5333KQsdVyABRstRyMGA0YAAeMenbwY79z+pdeObzvzmbu iYelt7/9WU972pcAsAsZHAUDu5HFT8WTpxb9ujvWXbI1ewos7LPvsIAHCxbXYjwodIv9+Of8+9/p P/JO+5F3uDtv8u4cGeHcODvP81e84jte/eofOnHiOAxhP95hD26LnK3hNNwaf3Q6znhgHz4Xj/cM 1kEOYxpPpmCffQ9bbAP77AO/+PvmdS8ZjQ++gCHKS1/6nNe85rse9jDhiWX0YQC+LB70oyA8AGCr c3wQQd0ZwNICGduW/cTZIshbbEH2X/9g/NoXnRkd3B843uHsRCLL6Ejus53x7VJ3rCfk2KuxGXgY 04wZCQNVuBajICevMQ1WoTze4Szeo97x1/6NP+o//HZnD/cq+rBvCQ9/+DXvetdf/vRPv+7EieMA ZGDgs3Aa0tM0ODgOV8bPZucefdiKn1yTOazFajJAmFf+pgn33c/PP7RXvuiHc509yMru54HKsnzj G7/7hhte9rCHXQoXwEWwc7ifXgw7i9h6C9qEuSNbF2Bl5Y/gpCds3aN4xXPzj997waO/cnPRU+4H HYOHwQCIkttCBqPpzz704Vi8knSlJgcUaMjINJkmy8jAe8jIAYsVnvZ4i2/wFv+UJ6s3vE3/ea1e +l9Uf3M9MxyWs5/3vOd+6EPv/+qvfjwA+7APLWzC0c5VZ0HAcRcjnpi+ING2ZhNw4CIr+9imqWYp /uNrsrfevn38kgdB3/28UZbpN7/55d/yLY+HXbgd9uEiuGTd7/oRT/eAObYm8tMZIKOfUcQzAC2t MLewtZzc2VDved+Rf/7SQ06qw1DewdxHpnlAaBfOwtHuTPZhkd9Og1tRAR485Oic3IPBOLpLtFLg 8XJSa176Kt66p575nUqtZO9Dcfa3fdu3vPnNv769vQ0NGNiOnx24Aq6Gq+FL4Wo4Dsenl6djsBE/ bTxZQA5ln0FBSZim5BQ5mcN6KChAGbxCZ+jrLvXvv3Nw/VPuD3MrpbRWSiulldYLjrVWep6y2c+a vpym173um5/znEeBhUF88Q0oYLDocwIKsPAIuAjOQgGXwRHIIYeteNyHI1BEruqDg15BnpH16Fls TdtnQ5ErcsggK+n99g1bz3rJ8XPsuTJybTMtxURyS8MeBg+DSzrvUkAPaqii5O5BpsgtBhqL1eSa 3OBErlnIyHMKAagG7UGBxcsFLd7gTfzqtf/3v+x//O0UvaVNX88o3/7tL7zhhp9VysNB7GJR5A2Y KGCAI/CweJwAZQ/OwEb8uglDIK6qFWxoKDkYMgJbUBCUCVtQGJzFFGThJbV/y18OXvKN9V//bnro errsmo07b74m4iXpiXrJcRmbug/A9sytXv7jd73hP9x8mId+1ZO/+Pu+73lwd9T/5G4t3AtboOIj gCFYuAQU3A0XwxVwD2SQwz4ciQKo6qxnx+Ly6CCDPuy2mC22Ndkuw37s8z69fYZH2NZkf/LrW4/8 QHPzxw4O1XGBNmETboEzcM20eD4TdcQSroNbYA8acHBJXGdMd6wzgNbi5S1ychNxbIs1KIsHcrTD 2jhmwmd9lHA28bWvezK/eiv/5pGMF73QGpn9tKc98Zd+6VVKmQiYEp420EAZRfJC6kHZUeeBxTJj dSNETrpwx/xNb968/muKVT9YQIdh67rzdg+UfvYnXzQn4A/gLgAui7hCaA/uAeBioHPsZO2evjjR JmxHVfIIIL3ocJFdHLiGpgxiyJXkwF/+zaW9/uHXvRxuAeAaAG6ZxpMXx+UlXSPLctExYs5SS530 gU366XxN28YlPQvSLZDDC4cYZi2Bxy/h5z68WHKvYqpLLrvozW/+xaIQA2rXeJTYWl5+4Wv04vm2 c1LWpvujzSjIALDwpr/YOHphdvjfNtSHYGvAwS6M4+8M+C5mKMulA9alJzzlMY9//CM6J4awF3WP y4CopbRRV2ERc28uZ+tE/cjWe9DbnOvYfYbAduf85Tv6e3923vK4jC4FljP3UbgcLu9cs7OarYly KuoDOn08ygXxhcGZKMsSicBWTGFwa7ngCv7D7y140CrO/rUbvvfYsT2ooY4OxSGMIn7S0RJSwg7s RPB9AezAUbgMjsHF0IufCrbgMuhBAZlgRIGDJT2FbnElvZKixXpURiY6suBIWZi28vyN798+JOr1 oS/K+LIyFbXFwgbsTB9baGALNmAvWrgCtW274AFz9N0ve1LkWmnv6QjP+rAPN8Kn4GT8DKPWuBvF hxxvQj/eQUTYRnybLrrbhj1LDcdyeoKqbZADmUXF18/S5ye+69iJiwaLGj5PBTwMjkEFvc5xl47C paChgh24CI7C0Y4RbAsGiQdycrGHWFzTWSRzMh9fz3a41+BNEKVegI4XxONwlqbCGq5/Kk/4htmm L+Xsl7zk6c985pfDWTiYXoOGnTFoII/HaY4N4BrYAgMFnIA+9OEEHImz4sKo+ghGpMX02ejRN9g+ vT4bBqdQBYUP8EsrMheWKnvdlfzz7+hzCFIoTR6RhuhwY8gyetCCh63OsY3a0pF4LFRBY9r13oIs y573vMfBLtwNpzufk/Bx+Cu4NS4/QmfgTjiAfbgTRmDjT3ZhF1ScEgJqRSia9BkxtjgoG6x8PJno WxsMapqaxuG7n+/7ucsP03VgIIuAs4EMrpwzXI7BwAnYkV6Kw112PkVHPGcO7dE5vYKemahr1nTe qo0MXeHbqGXm4GDc0jTeGpoxtiXLMS3/9vVk0yBrMWdrrX/4h5/TObEHd3SUHqCCEeRxBvcj62yC WoS8N2EQdam7O48+0jkOWHCGCooiGrAy0GCxFvPzv7BRlOdgj09kJ2o7yTbsaWckdIcq2JuTVYvp mkdedPRoC7fOuccBC9tw7bQltIWNKA7nHlxt3XDDZ178v/z9k571ge/5sfd/6lN7EZdNZnU+N4qD aEXeYbulVaimAyZzej/0jcd7/XPVVYS24cS0VUfuLG80goPl3TihnEIUAIWST/e/Hu+j2Pbx7RS0 +HYurMhZrKHs85XPnnnEInr+tz7u2mu7ckUCcWzHXCAmDpmF0stj2IywdYpGo/Iv/uLWD9342auv 6D/hCUce8Ygx3A0uYURNb3s5+M7nGpmRgy8Kvu7b+n/yywtduGvIUmcAfajgDBxT9D0VAQgOibZ2 DbDraDT9w6CRr3jaJXB3XJp3u8bmSKfg7DTfH1l4q5Mne096yv+46eMh2Obdf8YvvuYTP/lb13/f N30plHC7nJ+f3H2KktLQQL+gaKNyVlLm9KCfZXzF04//zZ/cs/Z1DkHJVibO9q1oFVlGpbTEw6jj fi8p2yg7PF4ckOm/glLaBsS+3SETx+T5/573vmVyfjFn/+sXPbqDDj08HGyU3DvT5jDXWSWBYcQn Ym0df+ITd33ds37xjs/eK1drrd/ylmc95zlboGEb7jTUOZeUUahkFKArGkXh8WIVmvHdFLHZr/4v G2s5W2tVMIAsSkcUFeCwGiuNjP9qfBASB1DAhqeGxtGCgqpp1htPvuQrMvgMEHvvKJwF3VFM5ykB +q4diR/95RsTWwtZY3/o2z/2vS/48iwj3XBMC2wzHtECm/QdLeQaB06TG2rAUA/Ygj6MoffiV1x0 CM7uxxfZhJ1pEJVoG4ZxmgkMFtvuAQxgC0ZR6xuLXUGRC6oTyCFkOpYpizJRbJsIiRIQ9N6LnPYe 7wMKti0XXU1vQB3ZYQFn9/u9Zzwjg9shg+Oxu8VgNyO5gSqiFB2tWlfEK2vgNa/974mtAefcN/+r dwwPXqzUHuDwOT3AiIcJNhmMaUY0GwwsrcUS2Xoe5F55Ql1wWXnyrrVBP8dg12MUfdjtTJOmi50U mQo+0VZzFvoZwNkDqpICxv4QEbY7D9uNcAvYgTulpXAGduc0/hnq4j3e9POfmr+iGje//rYbX/b1 Fzt25TU8vqCAoShkffCoFgPaUo9oxxhggxLymj2gx/a3PEG/fO3L0Mb2XxB7aX7V2o0xQlfHWJEr oYx2emlj7dl7+gvvKfJ+OTCDHff0b26/4St7Rd6v4iuPqZPiqEDsJIJSrMUpdEe2mRYJkJK/1gSG PnYJd0d/wwKc+ugvu7AodGw0cKwTx+Fi8JN8JORFGF0mgLC1TJyRte6Pf/cjM/cfj6qbbrLx8Ucj 1Amt6VGOaErKTXqHAdFf/ow1eNF7oG+pFA5wHcTpwQfMHb66iXreCBY31AeLY9YW0xdflUUbkY+S +EoAbl8ZEbWg2ffcub/wX+985x6dkdtia4PtPfaBAf0+xdacnrNBuUGvZgz0OA5sHt3b3F5rxJQp enU8Prnoc2fnmmRIFS2ziq/cAu/9k/0//507//iGe/77z9z38ifefln/5u9/9V6Dk4+Ztoe0YFBt tJN4j3OYNnwkSMqa8BG27g24KLkKF3L2k77+onh4Bm6B0+A7Tq+uorPfcdcdi2x9B5wVz84HP/ix g4Ph/CPe/bdJqokS7RPecCBsTbQnr7btPfH5s8tO0cu2doqd4/0TF23tHO9dek3BZB3d7d4t3lzG o0qcLSTMPaIGcnRDe/HV2c7x3s7x3tET/SPHescuGOwc72s91YdXnQjtceyB77A1cBUcO2REw96e 8UsilE/f08RH0IJFt5iadkB/nqf79Av0Bj0HLa2wdc1pB5dceRjHwtXAEoVY6HjnGrF6dUmYu1Bz Tjpn3W/82Omf/IkmtnMioQxepLXHqwisZ0L8nMU0ALYF6A0ALrxycsECNPKML+s24kz8nOoMSXKx 1nArbHX0pDtiKIyG5tSpW+bvD9x496mudg8bDSNgQN/R5OQ11kErkevxooUmtyc9eZZRvuNHTrz6 lf4yLtRc44IHoYDMgafNUDP8YiGjGrKnO50rE2CXs2cZbrFRYU6y/wPfU77qey5OvyrJaurHXnrq 1N0Tb3/b3z/gMx4/ZLxFvcHuPiON3mbg+Og+I2BjkZ4NjCehCnzi7FJP4Z237MHdB7QFfUFrGWyx ZbGn2MvINthosGPGGdkWGwpVYV0YJL3H3RXVhVx46dX9z3x82UOE+tDCTXAWHrnkmnz6mrNRTie9 Qg60W5RK8tuvrX7gVSWQkyU0YkFFx431AXKYdjJuIqqVxjRYg1LYFms40rE5Lei+h18z7/fynYj4 e6NspuMhs50rT8BxuBk+s7fXNYRP6PTJUYyjEGplUDOKBl9HXaLB1DigR56j7SLv98Mv1Fqrbo6Z VtqDwZccNFgNJcbEOe/nfOgOcsb7DPscSRK9pm6xYxqHa7H3sX+WsaYedJhyFwPKuakBM/3hbQwl MO0+9kpyO4et+wsMJgAVLTCgt83g9rNLlYezJ+uzHHiUpRLzwhYDgzvJmQyOszOiPsMusMOORhv8 mAokLHD3DAfAGLN5bG3W0hBugwMCaEx0Zs60J5hkD4JO1bLbzcABFi5Boz07ipfUsaMaQSDy81p5 7733bSdWqImzpqkAlArcv3Px5JoFnH311WfnDDeXwolFwYrztAFbcFrsA3t7i+1Zwz0Lx6MbmTH7 hHWz0BT1tCKVQUlmwaE1et5a0h8Uo4MpPogG3bN0QM4ykgsazAANNNQtTgzABRlkQ6o2YHQnoaEV jQgVj54Zr0zLPVWIukSBnmfuhdSjN2AgiOLMeCm4t9YD22yOO8MkEaE77Fg4w66GHXY22FgBfTa2 DukNODFnl2yZBCw8IPKeW+7111y0AHIGQOL9MlTWvQmgFDsdKDTL2XmeHTkyz+5iBTsMZ1fw2ZjM d+3e3k0LLxrtGxgl7b6l7dPfmMOIGfTIC7THN7gNNjRacm2iywZgsJ2NOjNRad0LML3Jg0pdsRLe urAC4mHE2OAyMkKYjqvnDAJjmowMdDuFzKdIo8TxpFEDNkbUa/nb4VpaR0+jV7RWKTJQOIfqMdik r8HgMkpgl10Nx9kpl0aqBeoNDh+UOxtoADxYzH3nLYs5u0tKqWX9LCTMffSiyZlZJi57ckbBzvRM PQPtIsk9hM+Bg81OOJGCAXzyE6c/urAdZ0/XonrGQMzM4GqGhPS4ShS+lqakVGQjRi1skgMOp0EF Hywl+cbmFBuY1jZRrgsV3DfucOdCvF7jznCQkVUYh9M44ekG21XbSyrggCZ5zmaS7XcZp+9bceCH 1BXtNv0WO6LJlmvFA0oxP58ZLkUj3rPPqMUNqSyNoeei2XTEfku7yeaYZkgjnbBP5aCgaHGG3Qor cKgerZGFdqnPRSyYPjLDLhzANpxJFs9ddsUIXTBwuIrKL2FNWZxm+nmqGQZnZ/9lDc5GCN6gNEC/ g6PnZHap4ADUdLiIKNEycQdwXzy/0TFd7HcmcQW3wV333bdYoR4NR/ucTC6oEZWFPv2ScsyophXO VmiPbvAj2hZyKqCiLWO0YUHRoyz6UwNQ16ahngbT9TJpOabRaGBEW7EvonpE3U4wnwXKaFypaBvs OM4OD34aZzfYonNx3ckQUVTRtLxUO2xwDSOHGR4sjVFpmuaAsUjohsbhDEq8jC2mR5HTa8ITGVGP MIBDAS0VqApzmt3T966xZu4xhFsXQbn9ySXdy/ncaU726cvjWrwYtEdUw+WxCQdnzAjdYCdhq562 Dp3WVN7EOZ7MI209cT2KNpmXAGUn0Gt20Sv7aqW37JC0J16b7e3Z4P3V1NA0tD16EitSzsVD6ujJ FbY+ygDIe1Ndr9XsW60AAaOOOcLhxNTQ4prFkp0aM6Qdt7bFs8gi2ZUtLbY9HMLukryjXh6lm+Xq ODtZYFP69HtxcehTbFJmney7hkZBQZFTiPEnRf2tzZsehui3c6A+fVnKRNXJYkjnCrRRP3B2i9TF cPNoJHH2IQMdZ2gX7uvEIp9Zc/kcbbDRozzggGmfKnHIq2m2Psson+H/Q6PHMQ3QIx+TLMQOKNA5 irjEA23HlTBurWnIi8W29gZbd1pdoPvkDdathIkz72jALPerHruwB+yyS8ipC5SFHLJ2RCvzyUOL ETHh4zVp9O/97GEyLa4CDuE9nZBEfYwYNTQ9em4J/EvUHirSbA2J+Q9QKmDuuWCjQsy9Y4XtzNcB HIFB9K6neIMebMDFILlk/RgxgphC9/cWe9Ha1tzHWUOTRe2toHDRG1vTxNzPosYZzBgDmaGtMAf4 jKyHOqCuaD0+y6cYzLR2vDI7Jg3RkCZD7TLaZTwvpEcYgxf91URnb9s605CXFCgP7Zwtyzif6Ul7 PH6IaXEaDI3F9xZHX8SfY0Ly3/KJ0Nu093EmQ/foNTQ1lQ3PCnHcLv7VMVKyojGYHkVJUdHUmBpz 7x1rku4sXqDzHge9qSmU5RyB0QEHG/QzjsBoj4MRI48aMBgxGlG7EKBXVTRj2mUmjmrkxniHM/GC ejxBIGLXy3Lq0QSNpJOmDZ6agEk61tRZzlbaCSTamvqXpNovNOGN4dbOtExLSwOnqmqx5DHGjGmK YJEoM6hoRrTJ4tFiC3KDGlKJAa5E71GNsRmZwh3Q2IlncYop66rd76C6gsLhDCYEIcQyAkBDY7EV DhC7r/xEch2q1gFFQdU6ayhK3VQx6aNh7B1g2lmb1HOytYLwUOkLK6jcbA/QfcqGscVKzLrHtFgf 2K6Ufo9JTa2MaY+iot2jAmxTVKM14eb77NfcdobdDDbZsRFrWazlTFo0DGdOsUsIT/B7DGXJdbHy SY3Zp169aHl8Ytz59cqaWR+knJwYtsfASs4uSpXF2Am/0lL2oFBJucWxIcOaWgcFF9WRNJGtS0DY epOiiWwtcGWmFMkn/tb+6i8H7snz/KovUl/7BLGoaGHursys8Qo1ILeQsk2Fs+XYRsXFNHz8b/iH 96Tx8c6Cp10j+B58+poXbmwxABra1A/SdOmIEY2DLcoVq8ObfqM9ZHmxrNNjq21vqnNlzNpQHi8q 7DKU6L1z0/9TSq21Ya+leZkNka0f6tI1JeUxjrUg7OvxFgWosIq1gknKYAQIbE0UutKJBYVWU1Lw I++sPvLOicy+8IryqbdvabQwd/e1bGgGIrmTvVnYWrLRkku4bdwfvd7/7R8+0B5/gKSUev4Lcx1D XGSVk1BPTdajBBxNQdGnaJevD3/yS+tnZFJDTWdZXGNYBiIciterHnlG3ilzMP2UKD611jMO3ftD sX2znG2tG1J7yMl7MbTD4/YZ5VSDkNPWpVFMkuvDqGa/xwYUjtFZ9qtq8ctYYwELd3N6TANG5GVO XlCYiBF9QCbOYCzkqBG1CNcMxEJnqc3K2pbOulG8PzEmQWZFjXG4JkIUC9aRaRyY1kcrqfXem4am 6tQE+MejL35i7svqDJWHHK1xQEmRh1KWDTCgLCgampbWoaSYmBguK9oae+dd+hPvW8/ZDsaMK6o+ /ZRym0HNeMSopd1g44DxPqOadosNMTKOaSraAWXiLQ81y6zV4LRDgW+bxf1rmtlsAzo2bMC0WBNg d6JZznbWVTQa9rFDhg40eoutnLymrqlzzoqNqaBQXAA4Kqg04wOGHnpsA0OamnZZQLO1bkQjw5DJ CWwWu14WrxIabBMsccphJQhEgUNZrPg7HHZ1YWLvqbENrdzfhRpc6T6B5S1+PHRKqd4A03qxp5pa Os43438StdeOnMj+2zt6gIc+eY6OfegM3qMI41Ic0DbRwm2xJVmPvKLdpwZ++NnmMNWcq7q+jxbo U+4yHjFSuAxaWgs9elAe0FS0DrfLsMWmpN0RTVLK25XWEWudR7e1S/DatF7inyS1UdBglk9B7XSc 0HZWBG1SaAGQjqMejlvaMXUymrqYlr1PZTgNaHaAPXYVbHMcOMU9pzhVL1l9upSwsuTHDzH71BYr qk+3P0Q36pGJuM2hRyYJz6uT2JVCYbvXp/tYrMN5nMM1tSMGQ0ocWQr/Fbbu3T8r6AMmpVTR08cu yl/8nwZvvXdD0hdL8i0GGp3DFsUGpZj/RD9paMaMbaf/PFSixsFPf6/6zIcOVaB1f3doYYcdYJdd GVAB0BYc7oCDMWOF0g+5RhbisOXTZXGZD+VGuCbRnDNMTdAV6E02ALF59elnZB6lyUuOAC0Hjl3N jmbnCKU4IEecrg+RDJt1/nY5WKQLIJI7izpJFnnaYgk1DsMPV1dnEF2ke326T1ITFeQlZU8D46GT TKSkOBLZ+qGrWp8X6uU/2+tt0Buo/hb9LXp9+lvqsouLK46rCtMnB6qI2QYMDIxpSwrJE5Ukf+Hv ZfC6JPuZH3R/8PpzcI1cyA5wml3gGMcyGDHKOiKpoBC70wYbhgWx+GtJKa1QWuuuyTzLpwQ2LLCN COUlWQGdAMBwfunzoKU9HRfxGOxme/RaTEWVkYFSaMe9onuZ6MZrogK6TMG11o1pc3KPMpgam7KX Rbq0WNvx1ERYbIUdFXisw1nIWVNZ2TlvoniW69N9mhbnfBT5yuLTOjjpTeXLDUBVwwesri8nnfE/ /9us63ZJZKY1NmFrYMTI4z1ZDQZjcD6adLrSuiTLyfsU45bvfMb+R955Dqac3kaxz2hErdEDeoZR FYKNsZNWhbjIMfWQKifXqBpTR/+rRuuo2Cwk733beGtCBHZeBE4Ia2Y0V8+TNXQd76ZdafXDT3rF 4iRiuCBvY5dZlEZXjIEBmw59lqFcUwVM1s9iwb8VvJAHwSw9lSXOlooZhFD0ELahJbevdToXRjSt 986orKCB1bsjeO9rjOle3xq5T9e0NMPTpvUpBwmohh5WBuA9UJqtTNCl9NiS/AgDBSNGPdDkJrhR sxw9CuFWYtuZkhS//Wv1z728qcfnpgKPh80IDzjcuBNzYTutamgqGnlej9zCXqh0nMk6k5E12DHN soiotnGm7fi2vKfDtUpNjkVNDG0wk2Te5H1ciUY6VFKUFBbrUaKJb1AodEGvT89iW5yw9VE2FTlU FVVFlZPLcriCFTw+lQpQqKRkKMjJdFgorEJpfAaGwNZivxM2jUJ9lTBVSnm0My5dn+6TFXahE7ub WgdTxw8RKaUK8pnXmA+3yNEeK1kaIrkFT1tsjUvGUE+WKom96y/df3xPHo4AACAASURBVH1Zffet D9VGTbI+qFjbaUgLbFFqVNMZ02KlDbm/qauhA7JcZLY3LXlJltOMEacv08gkDUryqwO2M5rrixfa EAdcpBA2QikGIxL3KJvAPkNF1qdfUe0zcrC9MnjXhhi6EhhRV3EkhLNVtKlnkMXSE8KOclnWaY06 hI116vp4H9NIOI733nfBuhhG+pvK+ynJ7R4q9oBOEfFE6WtJ3o+dOaZtYMCghorKA2QW2+KzuOgL OMnI3vYH9sf/1Ti5Ts+ZViowDY04cYleCGHlLUpgj9oGh2iKYV88TFIOybQ+svWEAsYoJ4aRmZRe VuDvme/OhUB7jzGR2wryHA0MqS2uIPMB/6mCvKYZ07YYTSaZJi6YWrN2eYEO8ZuI5O4GxHkwUsJL NviQNGYXXiAvnW1RmVNKWaW8922lVuNf771xpnu9zsJ9rPHE5c/7qeVMVj1Rw8t+OH4IgXaY0lOU 1Iy8Y3lQZAP6wIiRwWh0RiZwzsRA0BoUpUU95bnmn42Lt/6G/X/+o7vn1nPm73rcenKFajAGV1Ao lME43AaFQqn43PQTYesDmhaXh1KMxmLt8hQNQAR2XijTemtoa99M2yC6gMQ0E/1yxk6SdWLj5jk7 pCHqKONydI4e06TmC9LokW2z5VB7sdJFE7bmkHpcbp9R0yxW0r2XkuBKdtzRFCkYX9ZWMbnrgsa7 qQS4Cmcp+hIxI+lxazyx3kmnyBqAaVWhfVP5ppqKZhLYncKCgbb2EcAp0/hlsuHBIt1xTQtPqGhr 78Y8ZhTAiJGGLUqLAZuRWXTiMAG4DXUOkD33xfnzX8w7/8y99lvr/dPnwN9KBXt5QVaiiZjeMjmf oROSFKPWAQ2wRSFs7TE+mtcWUts4UMLWos8kmjePCDKRACmR3DN27kRrdKIcXZIV5DMxzzlZn15B 4eYcc6lC69oujIqIzlihOs+1OINYQuVcScwg8zNhRaDCgxLDcBjSU8dSDHsBWayw9VEGm/SjNdN2 U9oUPsXbpNpxX/NM/fv3lY975jlsGqEzyQQNrpb0LJicrzrP9fjI1mWPXOxRxHCJFdTf1Mzhiiyn N5g16SZkkgBJt1BlF2ev4mxha8DgehSb9DbjrhElvRbuZfcke8ntlKSOiZXvV5BH5+R98pzMYAS0 Rdy2gLKcvAwfWZhEq8iLiZd1MSnS/hyJTeV40pjIu2qOPj9srZQq4jYA4hGzWBU1wu7gtrTC1sAu VQ2GrIa2s9aLTiU6TE3d0IxpDmhabV/3tvwF33/Y5EWpo1CElFCbnlV3mNtNP5cOzj6gHePqENOy dJASzgaKnip6isjWMOUwF7qfOLtLBufwEsxdTsSqFkbUczslHVJUx5v7AmOCQ2vqRx5vrdNag0oL EEwZL5Wa1JpYE87h6apQ4oIxbsFGmilLusv0MqOSBeohIqUoyTRFRiZSVuDppBnxYIOsT9/DWUbN HM6WayxsUGoY00RHBNajFTX2u36Ku2/O3v3761e9trUtFpyPrnuJglShepNz+IIsDV+Lk3D24Zzu tMKmScTZiZJ1rx5NneySsETC2SKtV+HsqRcL7pJMdawCedDExc7d68aE+nXZE5MrvdQBspKl231t h4sqnQclqENnmNbbaPVUWpnWm0aB4hylapZjWq81OpvqrJm7BNGeTQRDlpPlhwl0uz+klNpgIyOz WIPJyXPyhZxdUFjYC2VGluJsYesGMoqQvqUmfqDXvplnDEZdpWIhaa2ABqMhJxe2LikzsoamCk5i VU32mnHydT5HbsWTrHFSZDW1J4Q3RXPesvSibtB2iC3pcPaqhTyhCxePJWZSIvKAimomPuGcKAkb h7PeykfiGJVSqarYjMCGIKRDwO05avxyvcA1YjmLZZOjKzkOswfhAyeR2QazLOrGYseMCji2EmdX NLaDs7Ppkc40z/qO9YBb6eC4S0FEMmSi5d//l7xflJ2DggBr7dkpOmrOZZADHvPA369bBpyIdGeK 5XX1Re+9syKtURp9jvzmvV/WR6moRV5ODHwyo4StxUr4UFBd2Re9cHdrJxscVVtH1GCHctM84n/K vvq67Oh0VZA21JEaWDgIeWLBnq07fty6g7PdIoT4nT/JH/3CmlZ55xWqJHeQwKbUV1CoPFRTechj oe4fzQ6y977BATkKvMMpnEanDPsCL9uw5uQZRROnb0ZWYypMSZahDcazvLqPh07sgUZ3p451AVu3 xs2sRHJDpZMtb9WOgMso/ZZpSG3bhDqmkv5lJswYpB5cssb91ZsXZ4mXvfzCy8vv+okj//qFG4DH ZlBjFtqz5Sdtx1ewkK2B/oDt42r/9KqXstY3GDGX5miNDqZTvI1AIHvAnB2Acrs4SDVhkoRPZDi6 jGHj+UPZRnxMr5LCdhW2xfpOGtXkvtiGZkQ9pLE4HatoWuwKCKxTIur0Ja1x4wNrrfVY07ouWhAz vuiUkoDovbeGBcrg1Iv4LpFCbQy2VWIWNQ22pRp578kL5T2mCR/pVoGAM6nEnx9qanPnzaPXfNPd 11/yudtPO8FHllEPtil7kGN7UKLtpL56JjBd4fLlFrdrrl/zOtZ6i63D3jeemFwjcW82BpY9wBd0 Fu+mClKKXc80eDeFpGWk0tekO6aE3+7cWMrZDW6IqfB13ImkRCnUCHOGkXzOMq7BU9Yx6HQzuKDa tuPrWUhRWgO0LXXFeORGQzs+cN5LeN2s6iDA+pw20mXRuKb7dDm+bTzQH6hsST3uc8V5Dzqdvqf6 l4+5p2p8RjZgcIQj/Wmc3fHmZMLWZTQaLuyyr3z2GnHrnJMFIZuEDVuxzM6cf0CkALwPq2XyL84Y c7uWvimBbYDgJz4UZ3ftFTqydRPrEwi5GMFYUvbIha2HNDXGS/7Lci60PuolKljTRKDmhepvaqXU TLitNXgXknnPyRoyc2n3PkS7aV6SF4vZOsuDkVXsrP+4dPLu6t99255kaexRd+3ZlWgIoS6ccbS5 VOkFljD3l/yz9U9cuDfS/J5JD5CUpijVTNCInO8KlBSgNuVRzwNbzzjkFwii6BoUhyrgPK7BOcjQ WzF9AzC4MY2j0ugBpcFLLblNcos1y9Vn571SOJxxTmmvc1TmQ1N81lTOtB58N/9HsPWMoaqtg5t+ FXm8n+igAsjaOoRlK6XkEd1yPF3M948uqmfo3X94sNfpWIl89GHPFpv8AzqEywe8J2/d1bYd7srr 1gkIr2tosD0yiyTd2R5ZSS4Fg3pkM5WD2uADmaXWrCkllBVICMOKDk/RI13gkZVTgCTRnAbpggap cCmWQ8Vq6hY3pPHRwJRSlHPw2CoCEoUagVmZoZijrCBgi9ISbaeUUm3jxAShlLatT+YIa5Br5Ktp EPyQl+ttzDPVKqT8SlZ4pSYLRbezupgvL5RMp0PK7MuuzWVR0ZnOtC6KHGhbUxT5JNZNURST1UGO 27aVqCyhg7PujpsXbD9XjeyNHxs87TE5IBv6mFC2D9vxD1iQl/A+JJvoDKdcWu68973NIC+WkbMh iMigRMGR0MsGGzOeVHdXUvlqnQe65YRa49ZWxzSNlzJo8/mOws2i8yTvejdyVdi67K/LFtOLzHwr SKM1mXhWN0NhEPHjpDIYC8jirHdK451q6+BNBG+NV0ppvSCCbwrbKF/0gra3FprMuK9sS1aQFxOl W/TuejyZRSk7IyuCneSQwvt3Pp0XoENpQo6xBZzh4BhbabvVPCYXCvU4AozZAzZCGt7ol9973797 wuKNFf/shuZpP5kTEt663pwQCiFSXCvtfIxE6DlrfTsKwcDEpJCiN5tk1SXnPNG6ZwIr5y00GAUD cqKnPVxP4GnrfF27JJVM67Veil9M46thGIveBkA9mkCLmbETu9a8FWUeZy8YLhVLWKg5C/8MaXSE +yh0TgYMaVqcRhVkerm12VgRbOgMNQWblHcKyApvmsVMG2x/SpnmUJjbuyl1RNgayHKUVmI6n4Fu EnomX88VYffC3tvnRt00QENjlgeD3/7p0X0YwOOzaG820UzRhcJa+RCzb30zxvuAZVOn9TdVM17V gV22TsdZDCccTUsuE6V1ppVVU+ve2j7M8jAo9XjaN7zOE5c0zjU423vS1jCyeLbgURlKoVu86VSD VaiSTEesUmNkG2kxOY1oV+RxZZkWYKgUSk8h8mDRqydvKBkAosyZxkt9CcES5SG2qM5yZiq0iBiW AS5K5b1PBuy8UEohmXnS12KT8u5QWpMm0xTNJHezXruoWEYmFO3WLaNd9lvagV5a1333ZJSF+DFW hZJxzkLrvbPkeTDXOu+snQTYFD3l7JSTYXXvee+CXwIvkdkqHo8xFm+tzzJl7WSty3Lq2itFWeoy qi6tce3KbshylAplQ+yiwOfFeZBNF0CGpTjRXCUdE3YJKUK5ZQi1GbzFarSkcBLMSc7gxAusYuXS HK9xBm+X50F675t6gvmsmbCRaX27yDuTF+Sl6sakizcxL9fAbNGtBCsnPCO/FUEueL0r19uoyuSF Ejs30zXjVlBOLs2Pxe3bFIywjBqaOuQO9hxNS2ux+83S4tbD04mzXUNgK49KRQbbVjnrnfPeT3QG 72kqscp3WrvypZzz1ltCxp133mmFQhnv21qSu5Qxk/xR4U7xss2gkVWPCddMxT91SSzZM2jQNpPy xGkydGfFHGe3k7MyH4ogrQEXHVqZFLS1qDZMAxRKoX0szis5efcjOG4WV0XgkZfMhP+nQMf7lxMw I8jzUs07z9v4xBV27hmqMWBKaCAjKyj79BfmX9hJAJlW9GrqPXZNqCK0CtRXQ7Er2zrW8PadjvLe O+fs9CYBywLTV79Ulqlk9Rf9XgSFUirLlTXeTu/s5z22FROquh+DkgoEd++ZYlbzctprMwbobUyJ +VU429ogrRNbAy1OoQt0rJ0uhYKoUaDiFlKesPNQyl88N5KCY9ZMZGcaLZjNIEpsPWPdXEYzgalK hyCRiZyuJ+tGl7KcojwsWwMWuxFLo0hdm2VXusm+7mh0j15La5br3Il8cPFONifPofbee7ox5cs0 kODe8/J2a9y3EsiTmNt5sRT5LA/MPaPDCFuvfYWpp3SaIMxtO3npouCm9GrJjJT1TNTN+QDu0JKZ 7y6gEeVBhY3MlGdSrMGHUiRSUjYAcRf0YuexHhQelEPPby8SbuJoKpcSkqNhJFjmkyiNrqbgEp+h 6iCcXJtfY9rJnmtZEQIGQm7OdHyIAJ70LJkPsm/s4Q3b4uLOyBSFwUt96zLGlmUwoN/E45rxPqOZ 6I4R9e6ZpVVpnHUV1pNlqMq13vvGM9oL2EwY15rJjluACFeZt9bgnBf+my2qP/MgQ1sL2FBZjlLh WGc0lbcmVC43004GwTzWTMZFqVUPSgEhiUdnfM9ZHlYD007GC6ZweTJzJZqX2b5Bgc9RDp9qHkQ7 bBB90bPlbVwQhXx0g1XOe7fKni3KcpiaKlQCVxqlMTFDcR5dTd6q6XTEuoLU1TD0cpbj3cRPO6+v dFcGqcySF0QNWR0mYrZqKOIoNjQ1oXKs6ViZauxB3GWhDUVaCmI2uHC580vnq/dUzoOR+oOynoih d0YPkWY3Fbal3KBtJqn4UXte9S625eCsB8q+dzaZjSfHSnnnFut8XUGeIP5C0jpAi/n9aLotMS2j s6HxMPvQecvsLOOYJuSTWshQGd5G6ZJNQp28Rkm5x3SLVF1FSrs7u7Yo2WShkfntHd7hHNYEgSp1 1oh8PG95lUE9ZE6kmIeC3TT2TlYsaKesvykPb+3M6dK4IW1nbs8RmClULKu5Zg4lyFH0BCrM+i+m LyYrvPezRVS8X/NqpmMqTt6QmeOFfWhNQHdFb32YT7ZydiVq5jLEQv7vzCvEGTTH2TVA2mRDmFuF HTvpFsLL4vI6c9sWjFVaqyJDqcW5+EpjGu+9CI/Qv9OxqSomnIc3WQGm19ZmV2oBW6fMZ5kYaQTE mJhwfDUElKzjaxIuAdg7ZTe3fBbFR3k4th5PKtNmkFmwdtV8VQqtMqts9Mv6+UoGMySQr4yuEJkM K3bDkaesZms51nrWCCbjJX2+Vu4c0ujEzMCt+9V8VQYqR67ReFANyFYELd4Hb4IyDu99lvkM1Y3a 6AZZW+O8X6qg5IW3RnmPeB+dxbTeWXSWjHSTTCGBU3mxIBTbO0y7Zgsf76mGlP0QPaKzyUPlOC4v HibPIrhzvTWUfXQerlxL1TD4SlpaR1vFyZlKPHoo0Bk6HUshPIfX+JpaEirMkmLSAMrXlbXGtnVA z0pN2SJEF09+9O7Mlxqz8u5Au5KzrfFtrZrKm5ayz8yxtT72oerGBUiwcdFTs+hoyVPyguoAOq6W 7hS1bdhfnY6nPS8nEa3C6OJ4N5085wUw9s6b/RWPkO0DPRGZGBdqzaRsbu9pnE/4VetJGrP3yrTe VUv1BlF0vE8tDu+fYhRlMJTCxgjdtNfOPK0eHmlUKGCisS7cfOZYRU9kcrZ3UfXhK8Pvn/atweVS u3oy21PNkBIUqo7HqV74gNzg6xhRVC13DeaFb6rQ8miq985OtMbuYp06U0j+pWMi4GqZ3daMD3wa i7b2zgb5Ijb+2IfhWFhQ+rCpvIBjWIPoto7R1hP2nad6SD2aRENAKDaSqpFMCm83kwm0YH397I0L kJHWwSIzv92CsLVpqUbhI+qCziiWuLiKnmgwHuWT/68beisCQKz3yxg60Wqrn0g1caFL4xcetzVt PfHxQqgAca508nbnPd6HPsyjSi250hshjzADMmxDMwzZXxLhZO26NG+mDRpKhYhc0y7mnu460+0H maXnuslOVqAzlF7ah9HEBBKb2gtBwkVv6Vtd+oipvXeZVgTtEg9O6gR53EzhERZy9ifeu7hzhblF BiTpFaR1lKzRnh9yzpdVeUxRBEqhNHkxgVCmnTJXHYZWl9vzbhVDp2Nk4LPQgMU2mUM06Z7byAqf KbJOELP0lgxu2vXL42u8Rg86MRgScZKTFcutwkleRDMzOlN5QX+TotdBBQ3VcIrdpWPlfVsxNy6O uVpKPooAFvWhdxO2TmTb2QWwS1pPpamnltcH8bO8XOhqtWfBAH7mA97GfUDyHI9AzODE8k5mrRIt QWe0ErLQiYAR5JAsG/OUFb6K5toQM9Bg2omAmcEe3cStGTo4u6bcnutEh+XFpOS78HGbch8LdBas S7I6CU8049Aqa5YuQV2669N+uGuzAqWUs8EW6yy9DTXK2rp1zqpe39b4eKz3aaXgRrlBC80Y723R X/pWWT4BCUBagBNkEmOF5FjQWdPST6QfTDMbRTTbdSYYTGfGsa3D+CZLc0oRSHzv7Ox4LXyfwY7o 6NOBqXMDLSMoVloZwU44Rpg8TNcnWcDZd30aDWWJB2OihTz6XETKCoqaaYc1zHhVlgXcbO5M4jSk oc044niNaSYO1eDBUUsn6J03LT6fyDvSLJoZ2uTr0tmUNFJqcqWzKbssOL1W0+m7aGvBY15nypoA QK3xsSKPl8oT6VgYpegx3p9YHjaPLX1EXlINF9hAmwrRd1MHBpv9dOicjzv9jffWaA5pKW7rqZtM lKuMhO8TQwslT43E5yyDlJc9Mhwsk1zyL0mIlBUmWWyFhdKds2IKXC3g7DN3hwMvKGeMd+Tlqp3A l9E1X7b4/CMeF8wgiZQGh/eYemLn7rZbqdCPkxduMQ23fHBNGxZK9GR+UWoBROtSsi5lOf3NNc8C ztzj81KBMq131oMKoDOWfJin5KLrGtS2jy99xGB7sZVGqRgIurw4WOpn4NYb17/OCpI+DBLKLV05 vZ8Kypuhp3874wMAbydgz3Z8F2GBLWOgSEcZCz5s8dEU9DYYdbaMXjCkzZhbbuTSawFMnBnnFNsk AAN47NctvuAxXxOwR15M7L3SQV2Tc/KfC0kw90QqtDjDzR9a0xhZChb2e15MSuos/XmUat6zsbXq SqGTt4fcH2eVVKI6JDkngaYATcVgZykaufaxq2waEniTKiMzh0cFZJqGf/ibw7ZtBYmEUppMz7Jv wtzWLLDYln2e/T1cfHW8Tz41st2bJN5bZs8WtgbO3jM5uXhU3/oGvuN1YUERSCAsLpJb8ElYC8xk UUgezjScwjozw5CXHDkRWu8cXvaDmJ6jyeScyLTYCFEEIzpDVnDvbQvfYEKCRsr+pLWJlUXqdJcw ObYmHMhKGqycjvIQ2x7sn+bgTFBIyin04vOYnpMXOKvqsResn8CuXJDYcb7rhL74yRN81aUp614b hFzXWDZpige45SNr3sW0YSBEuUoUZmC0G0r7Z/R+QfzCMKJHXXot3tHb5MKreNRX8civmCmQtDhk j2j28Q5rqcchUsA2oZC2UD3GNBO4wTLOfv+f8u2vnYyu93iHswENJ/nnTRC9glOFBHilTMwX/Qi/ 9r93bq142U8ELS0xkOlk1HbPd220KRTGdMbv5g8uHuMu+a49O0PpMGALKWwA2QQJKiBbBqCtecTj 1jxL2nznpzh+6VSdeaGiF55b9CSiiKI3pWmlr0UPbzhxGffcOnv/vGQQE81E7U493+0Z0SKKPvVw MRLQGWc+t+5dDAdnYM404T1NhWwg19aT6VduTBojql7oZ08z5tv+D8oBLuL+ehh6OFGa4TOjM/Hg jINHhghIUqQUkOXsn5r8ajFnf+4z3PpRLn9UWESSy2oe3s3D30RicHjyC7n04bz3Ldx5E1ddx+Of y6WPCG0ietS7ekywTGXimMS16OV+1Lf9ytJ/TW7oQl84G15EZ7h1aUiy8swAle0T9DfXz6W//2O+ /uVrrkmYWCwzIurygtZNsPLXfSe/+Z9mgzxf9JrOV730Xbr3X0h3fnJ99G/XdFsNF/eY9xNT44y7 PvGGcGo5IMvxdtIwcesmO8FhqBslIVl/IkHkvMxDoaUY81d+gB99G8QJJAwhZcFmlRKFzoJ1LMFW YWspb3D19Tz8seFlJlXFYqyI0mRFzMyJc1Eelxeo3uTkDH3ib7n7M+v7wnvGe2wcCb18SOb2Dtfx TSZ62U/wrjfx2Y+F3RecxbnZif13f7Kes4VSpdmZlojkvv5pHH0Df/VG7rkFnXPlo/nq53HldWFJ TKvQindZYel/528fon1qKnxq4X5a0oBlPSm8UfRAzSXFRCf/YWJLupSS2FMya/q7d3Jy2VLO/uR7 ufkjXPrwkCUh3CzxYoK6dDbluRXvhpTuFTu3GU1hjIAKIo82lfjqZ8/Xo4DMkrOzHWNatKbohbmh NaM9fu+nDtsXt97I1V+CUmQl3mHbcNwdKmswUYSEN3K09ZTPNcu57FF846vCsWgRwI8+b2odvOcW Rrvoua410eyaDsKjW5oqSJ1ODCpKcdVjePGPTrnGxvuTJnXfRdSJQ6Q7T/pkLYk11jm8Xbqjo3eM 9zE1WY7KJogoWUsTiUxLDBOAmSZFCqR/zRg05XzXT5mFSovhWCZGU02Z55dytvf86HP5qfcGF2PX TulduIWzk64UNm06icczzt5UNYKo2IpiKq8hPaLj+a7dJ9nC2jo+1/B/fd+amIcufe5TXPEoYFZZ 7GpFExttHrg84Pt4Pu9hmhBLWQ6m7N8z1jzv+N3X8exXzDaju1vDVNFkj2koN3C2U0pTz4I02wT0 PC/hBOzK9DgMvfcPDyUmRbNCovkcZn7rFiDa0Wd0hmX2qK6jQLTbpIPKs2ZdmHGdrw4m5XKUDheX Ma3GtNz4V1M/XOWgPDjN6//NgvPJ4SRyWsLzz6mWktZTPvlECUWtgIB3fJLXv3w92O3SyTsOe6X3 tNUCrSudJ+LF1fSetwQz7WEoGfu67G4aqoPJpx7OSorZm2iK3qHibOsR7/uDQzVMZ7Mu9IX3X4jp TUMzXoX3unh19qEdidON7ureHCg3piJgP/m+6fssfTIAH/1LbnjVAoAlzN21NR6SsriCtzXVwcTQ o4sQgW5qmiVRUE3FW/5P3vTac5DWQje9b/01U43M6W1S9GffLssPxdaAs/zqD57bQ2eE6PKUmlW0 wlmb6Pd/5tC4thNnspq5mWu/aHXz5vyuKDTNVHURCZxCeGMYPqazR16WijCWU2yd5XzmgyEUNtH6 UXr3mzk4zct/fnImeJv1xM6d3jYZ7MKVanJewqDFmjavTCS8OEMCSUcHvPO3+PQH7ueWYtWQj76T L/2akNkaLPTNlAWzm6snEroZh/THmfPzk27hsnvnJ3njf+Yb/rfJmVSmsFuvsEsp0oNFOJVu+ISZ UzrdlJ95Gb3n9/jcp5f+d4bahtHegvgQgU/prWXEZ7bCKnpBExPPke0Euk00qHoCz4h5WDO8kRVB u0ua3iTxLwaF24a/+6PZxh8KQ3zkHbzm6/n+X2Pz2HTvu9BiUYG7YRghDjgLRhmZwSnsDvB2CnKl V01zIy+oK/72Ldz0PnbvO0wzV9Ff/N88/MvobQSeJioGRL5c5rWR7IQV0Z4rRPhH/4qNIzzj28NX UcjoGLZFqiWbtIQpCy3Dqd2YENfpw26cRhqXGfqHd/P+P13a2oXPEgg03y3E7QtTNJLwZWp/VwbZ ZmI47mb9iZiDEBaS/AYznrLUaXQMIyQzWs7v/cwC+HpYdHzPrfzQ0/mG7+drvnXqvJjSumwhCWAy tyS70blJOP9h6LYbef+fct/ts+vLA6F6xA2v5Dt/iqIMTBMTKWCJ0D0MpaSyZfS+P+SuT/HiH0Ev igrKiuACS6n7CbDKEHahczfgMe0oN6NoCnhlOj5E6IN/xgf+/H6+5gpKOHhma/TV1wsdxt4nPNMb UI/CYpvACTDa461vWKzSnEOUk/f8w7t53x9w7LLg7g/JAxri8jSVPaCD8zI1pWtLoVP5tzsA3vGB t3HT+84ZTK+ltubjf82jv5qyA6ATc89TEoHLKLH1e9+yKmNt7yTv/1OuvI6dC6NyooHgZWij5Scl sxFTtRObCokEzfJOTEicnHKrpNnbdqqUijH80ev5zAfWddAc58+0mQAABI9JREFUXfUYLnvE0v+K 5cTaifWT6TCbREHSuWA6U53IJ9NOLOIT37YLKZiy5ouTRGwpE0jjef9befebly6n5xy/Nz7gg3/G 37wZrbjk4cEgKIZVaUdThSUsCGyLM9g2BDA5SzvG1LRVuDL558WsKybkc9X5DknNmPe/jf1TXP5F YeyTg3pG1xFTvdarMKsi4IG/f+uaXEzT8OG/4OYPc/WXTrxdzhJSJt2UZ6CtMC1FT0pKh4Q/04RI VzkZAFsZOCn0sJkslSk++8Pv4M9/Zco5d3i6/NFc9oiA30I4bvdYh1iovAhjF1xXFinbEDQZFyx3 MrJZPjGSinYotj/bhqIfITRfBeaR0Bok8NjRNijNje/ir36T+25ftdg+oMr1WnPJtXzVv+Rxz8La KfRDdIB1bZzOBowoAQYzZqyJ08fxq69kvM9DR0WPa7+cx34tRy4AgsadqItlVySM+Wjm/5UfZHj2 UM8V58tTvoXjl01yFpetyCn8JuURdlNm0jXpQBiOaAu/8V189B1rcgtW0xNewGOfDtM7gi88TjMt jX5bT7S9FEBS9sPETtek8I0UZiOWCRt3uE3nqyGfeA9338xwXa6J0IO2J0Nvg6OXcPkjOXEFRy7k 6EXsXMBWJ3xeDPLiksgL2nopZwN7J3nnb3PPrdEHdo6bPh6e8oKjFzM4wuAIW8fYvoDNHXROkbOx E/T9rCCfwyRZPhmVX/kBhos3BltKW8e4/mlc/zTycilnJ+5JQQEsMq51L/aeWz/Kx97FyTsehE57 0gt57NeuYmgi0kj7RnQ5m2jKEC4XtoYpzhYFXVak8UHI1mlrhrsMdxnvMdqnGdM2a3IC5+mh3Xvl G1/JY54cjgPGikrSas6e/+qWlObRGX/8C9z+8QetzZ9nKvscv5Qrr+Oqx3DhVVOug8Q63XSsec42 Dbd9jFs/ysnbGe4+hFLgC4se2l1YJJoi5TgmzDRPgh1FRiZ8NlVBy4WSRTAVHWbN8koWXwjUVNx9 C3ffwt/9MRDihza2KPrB4JAXFCW6CPY1weimDsKsa1c+T116yDl7vB+NDAXeT6J2kpW+a7OUBA1Z fJEdhDs+oCTjU9zsOQVAfkGQqCLLKkmfp8PTQ8vZw5j0nxVkeTDCz4htifUh2miTf0TwWRdHpoyj vJzMBK0fakh1nr4g6aHl7HtvCxpSqECppgzeSQmTFBtiMWzxaOpsNoK0m+KQpPV8ZZ/zdJ54qDn7 vttC3ZJE3eR7STpKlRhSlrJox6JrzmSGJses2PbDnDkPNM/THD3Q7eBXkzV87K8heobn83GI0cmT qO54vDbxu5uBd57O0ww9tJwNvPUNfPbjh4ob7pI4lmcqrZ2n83R4esDbwR+CPvYu7voUV15HUU7F BkyOO9GkIqpTmc0Z/3ZK7ewef+rvpxLgztN54qHG2ULec8uHecMr2DrG0Yu56GFcdR0nLqfoL04a 9S7MOLF/J9u24JnDFxI/T/9/pn8CBjMVAtaWWqZ9+hN/oeJ5MY/Y896K83SeztN5Ok/n6Tydp/N0 ns7TeTpP5+k83T/6fwEfb2KSI/kgFgAAAABJRU5ErkJggg== "/>
- <rect width="285.97864" x="26.028843" y="78.512794" rx="0" height="284.96848" ry="0" style="fill:#000000;fill-opacity:1;stroke:none;opacity:0" id="rect2995"/>
- </g>
- <g id="layer2"/>
-</svg>
diff --git a/util/qt3d/qtquick3d.svg b/util/qt3d/qtquick3d.svg
deleted file mode 100644
index 3b8a5c7a..00000000
--- a/util/qt3d/qtquick3d.svg
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0"?>
-<!-- Converted with SVG Converter - Version 0.9.5 (Compiled Mon May 30 09:08:51 2011) - Copyright (C) 2011 Nokia -->
-<svg xmlns="http://www.w3.org/2000/svg" width="287" version="1.1" height="286" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="tiny" id="svg2">
- <defs id="defs4">
- <linearGradient gradientTransform="matrix(1.0104795,0,0,1.004441,23.387309,76.758859)" id="linearGradient3730-2" y1="131.35715" y2="156.39526" x1="23.626827" gradientUnits="userSpaceOnUse" x2="303.57144">
- <stop offset="0" style="stop-color:#038d30;stop-opacity:1;" id="stop3726-7"/>
- <stop offset="1" style="stop-color:#038d30;stop-opacity:0;" id="stop3728-1"/>
- </linearGradient>
- <linearGradient id="linearGradient3724-7">
- <stop offset="0" style="stop-color:#038d30;stop-opacity:1;" id="stop3726-7"/>
- <stop offset="1" style="stop-color:#038d30;stop-opacity:0;" id="stop3728-1"/>
- </linearGradient>
- </defs>
- <metadata id="metadata7"/>
- <g id="layer1" transform="translate(-25.071424,-77.933617)">
- <path style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#00ffff;stroke-width:8.85648727000000060;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="path3722" d="M 149.39285,339.37194 C 118.29002,338.06386 93.410274,329.21846 78.267585,314.08502 66.239667,302.06444 58.159936,285.11057 54.818135,264.88047 c -1.962614,-11.881 -2.442596,-20.11519 -2.455216,-42.1199 -0.01051,-18.36712 0.160997,-23.0644 1.239861,-33.95521 2.529982,-25.53941 11.482605,-46.43472 25.677112,-59.93007 16.042727,-15.25252 39.462148,-23.21337 72.203768,-24.54383 6.77105,-0.27512 31.97542,0.38686 41.46813,1.08915 17.85829,1.32123 29.86273,4.01251 41.92069,9.39824 16.71724,7.46685 28.60768,18.52238 36.44553,33.88638 5.7477,11.26691 9.34961,23.29707 11.69339,39.05536 2.22754,14.97664 2.81073,44.00559 1.22086,60.77114 -2.76934,29.20404 -10.704,50.36949 -24.19378,64.53629 -8.65346,9.08774 -21.29946,16.39504 -35.37578,20.44137 -13.11053,3.76868 -25.14568,5.0858 -52.44498,5.73944 -13.81368,0.33078 -17.4242,0.35023 -22.82487,0.12311 l 0,0 z"/>
- <rect width="236.93414" x="49.282932" y="102.78797" rx="95.84404" ry="92.255867" height="239.43414" style="opacity:0;fill:none;stroke:#008000;stroke-width:3.29858350999999980;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="rect2852"/>
- <rect width="175" x="28.571428" y="19.214285" rx="95.84404" ry="92.255867" height="206.07143" style="opacity:0;fill:#b94b4b;fill-opacity:1;stroke:#05d105;stroke-width:4.147;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="rect3704" transform="translate(25.071424,77.933617)"/>
- <image width="191.18274" x="73.931854" y="148.93103" height="144.13199" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAK0AAACDCAYAAAD/CZsFAAAABHNCSVQICAgIfAhkiAAAIABJREFU&#xa;eJzsvXmUXdV5L/jb+0x3qltzqVSTZglJIECI0QYMjTEE45jwVszCcUgcp1fil3ZC2unl9PJb7tXL&#xa;dl4Sk7x46DhJ20mcvNjQL7Ed2wkewIARYIVJDJoQmkpIVarxzveeYe/+Yw9nn3NvSaUBnO7w2YXu&#xa;PfecPX77+37fsPchADjeprfp/0NEf9YNeJveprMl+2fdgNMRIUR/5vxthfA2Cfp3LWkVoxJCEgz8&#xa;Nv3Hpn93kra7uxvr1q3DwMAABgYGYFkWbNtGFEWYnZ1FqVRCqVTC3r17EUXRz7q5b9PPgP5dMO3Y&#xa;2BjGxsZwzTXXYGhoCFu3btVMSymFZVngnGNmZgblchmlUgkvvPAC9uzZg/3792Pfvn1vw4f/QETw&#xa;M/QeZLNZbNu2DR/4wAewefNmXH311chkMshkMvoexYyUUjDG9PVWq4V9+/Zhz5492LNnD772ta+h&#xa;XC6jXC6/5f14m9564j+rv76+Pv6xj32MT05OcsYYZ4zxKIp4FEVt3znnPAxD/ad+bzabvFwu86uv&#xa;vpqPjY39zPry9t9b+vfWVkgI4ZlMhheLRT43N8er1SoPw1Azp/mnGFR9Nhk6fQ/nnH/1q1/lq1at&#xa;+lkP6Nt/b/LfW+49cBwH999/P15//XX09vYil8t19AwQQkApBSEEnHNQGjfV9CpQSkEpBecc9957&#xa;L+677z7kcrm3rD9v01tPbzmmffrpp7XhZRpPijnTZDJo+n71u2Jqzjmmp6dx6tQpXH755Ynnz0SE&#xa;EHz4wx/Gr/7qr2J6ehpzc3M4dOgQFhcXceLECUxOTuLYsWOYm5s7574DgOu6GBkZwcjICIaGhlCv&#xa;1zE1NYWpqSmcOnXqvMr+j0Jvqffg6quvxujoKLq6ujQzcc4TDLkUk6WvL3VfPp/H0NAQNmzYgLm5&#xa;uWUzmWVZ6O3txfj4OPr6+lCv17FmzRo0m01UKhU89dRTIIScNdOqxTU6OorR0VHccccd6OrqQldX&#xa;F/L5PIIgQLVaRbVaxbPPPov9+/fj1VdfRRiGZ1XPfyR6S5jWcRzYto1PfvKTGB0dBRAz61K01O+m&#xa;5FWkgg+cc+TzeeRyOdx///34l3/5F3zve9/T0vhMbRwYGMD4+HjHunzfx969e5ffaYOuuOIK3Hvv&#xa;vdi0aRNuv/32JbXHvn378Oqrr+Kv/uqv8NRTT6FWq51Tff9/p7eEabds2YJLL70Ut912WxvTLcW4&#xa;CsMGQYAwDEEpheu6p2V0xQSEEHzwgx9EvV7HM888g9nZ2TO20XVdOI6jv6eZvNFonBM0+MhHPoJ3&#xa;vetdeO9734tCodD2u7k4N2/ejA0bNqCvrw87d+7EZz7zGURR9JYHUbZv3w7f91EqlVCv17GwsLCs&#xa;hf9W0VtiiG3atAl33nknLMtaVkhW3UMIQRRFaDabaLVaietLlaMMs66uLqxcuRJ9fX3LGmwVxEiX&#xa;abaj1WqdXcchmPbGG29EV1dXW5nqs/mvbdu47rrr8Fu/9VtwHAeWZZ11nedLl19+OS6++GKMjY2h&#xa;r6/v310Y/U2TtKqTfX192LZtG+644w5EUaQl6OlU/+HDh3H48GH89m//NmZnZzEzMwPOOa699lrc&#xa;dtttuO2227Bjx46Oq9/Extu3b8cVV1yB/fv3n7G9StIuZQy2Wi1UKpVl9/+6667DddddhyuvvLKt&#xa;nemcCvW7GhMVYPnsZz+Lhx9+GP/6r/+67HovBD3wwAPwPE8HeS6//HJtLP57oTfVp/bVr36VP//8&#xa;823BAtPPqnyvnHO+a9cufscdd5yx3EcffbQt+GCWF4Yh932ff/rTn+bd3d1nLG/16tX8r//6rzsG&#xa;OGZnZ/l/+S//hReLxWX1ua+vj//Zn/2ZLssMipj97eSPNr8zxviXvvQlPjQ09Jb6QZvNJg+CgCta&#xa;v3497+vrO+fy8vk8Hx8f5+vXr+ee53Hbts+rfW8aPMjlcujv78d9992Hbdu2gTHWUYqZEvfHP/4x&#xa;vvSlL+F73/veGcu/55579GclqdIuMcuysGbNGlx//fVnLK+vrw99fX2Ja6q8crmMSqWCarV6xnIA&#xa;4IYbbsD111+fCDub7TLL7kSmOr7mmmtwzTXXLKve8yXHcZDNZuG6bgKWNBqN8/JmbNu2DX/+53+O&#xa;V155BaVSCZ/73OcwODh4zuW9aUzb29uLdevWnRUe+uY3v4l9+/Yt6/5arYannnoKk5OTpzXqBgYG&#xa;sHnz5jOWl81mkc1mE9dUeY1GA0EQLIvRuru7sWrVKqxYsaKjp8O8f3p6GtVqFUEQtPmd1eeenh70&#xa;9vaesf0XghzHQT6f199VW4IgOC9j0LIsjc8tywJj7LwWwZuGabdt24bbbrsNQLt7Kj35J0+exIkT&#xa;J/C3f/u3yzZ2arUaPv/5z+Puu+9OuKlMnAgAa9euxS233II//uM/TjyvjC5KKXzfR09PD7q7uzvW&#xa;deLECVQqlTY3XCcmvu222/COd7wDw8PDievqOd/38dxzz+G5557D3r17kc/ncfHFF+Piiy/G9u3b&#xa;2xh85cqV2LRpEyYmJnDs2LFljc25UldXF1asWNF2/XwlbSaTQS6X09K71Wqh0Wicc3lvCtO6rotL&#xa;L70Ud99995I+SXUtiiI8+uijeOihh846Q+uxxx7D9u3bEUURbLtzV3p7e7F27dq261dddRXWr1+P&#xa;9evXo1KpaGs5HewAgFKpBMdxsHLlSgRBgHq9jiAIEASBvkfdf99992H9+vVtMIBzDsYY/uiP/gg/&#xa;/elP8cwzz2B+fh6A8K5s3LgRX/jCF9Dd3Y1isajLzWQy2LJlC9797nfjK1/5ylmNz9lSp7EihKDV&#xa;ap2XpM3lcjq0roxa3/fPubw3jWn7+/sxMjJyxkgWYwz79+/Hd7/73bOup1arwff906pt27YTqY6K&#xa;duzYgXe/+9249dZbsbi4CNd1kc/nO7q8lAtteHgY9Xpd43OTaRVt3LgRPT09mvlVecrf+vnPfx6N&#xa;RgP1el0/s3//fuzfvx+/93u/h4mJCc206tmBgQFs2rTprMfnbCmbzSZwvdn28/HROo6jfeCMMf13&#xa;rvSmMK2SYMvJF1DQ4FyoXq9jbm4Ok5OTWLt2bcJ9pCjNjOq3DRs2YGhoCJ7nYWhoqK1ss6y77roL&#xa;d911FwBoKRGGIcIwxNe+9jV8/OMf10nrnaQ6ALz66qvYvXt3xwCFatsf/MEf4IMf/CDuvffexO8b&#xa;N25EX18fPvGJT7ypTv5XXnkF+/fvx5NPPgnP81AsFpHJZM47uKEkLSEECwsL5wUNgDeJadesWYM1&#xa;a9YAgE5kAdCRgV988UW8+OKL51QP5xyTk5N4+umnsW7duoR0U5Nr27YeMLN+FXlK50Ck/abmd1We&#xa;GSRRSS47duzAe97zno4LBwB+9KMf4U/+5E+W7AshBDt37sRVV12FZrMJ13W1T7tQKMC2bb3tyGQi&#xa;Fbau1WpoNpvnxdRhGCKKIhw8ePCCLg7VRs45pqamlu2FWYreFO/B+Pg4xsbGtBroNACKaV999VW8&#xa;+uqr51zX3NwcXnvtNQAxboyiSNerLNdCoQDXdfVzmzZtwsDAgH5OPWuqLXUtHQwwIcSxY8dAKcW2&#xa;bdvaJKS67/XXX8fu3btx8uTJjn1Q9ZTLZRw5cgRvvPGGVslKIzmO0+aKIoTg/vvvx9GjR1GtVtFo&#xa;NPDiiy/iwQcfbKujt7cXl19+OW655RZcffXVuOiii7BixYpE6NociwtFlFLk83ntlZienj7vnIoL&#xa;LmkzmQyy2WzbYABJaQaICZ+fnz8v9eP7/mkjVapOx3G0BUwIged5eu/Z+VC9Xkcmk4HnefA8r81l&#xa;BYiJmp6eXnZ5jUajY0KQbdsJKz6Nv5Vk7oQXx8fHce211+Kqq66C7/toNpt44okn8MQTT2htsX79&#xa;emzYsAGDg4NoNps4evQopqencfjw4SXbOzo6ik2bNmm49G//9m8JrG9ZFlzX1YZytVo9LyMMeBOY&#xa;dv369RgdHW3zeSoyB/rpp5/G0aNHz4tpFa5N+0TT37PZrB7MbDaLrq4unYCzHFfWUn2Ym5tDb28v&#xa;urq62pLPlZQ8dOgQXn/99WX1Z25uDvPz8xqCqLbZtg3P8xJMm8/n4XkebNvWWqXZbHbEzZs3b8a7&#xa;3vUu3H333fpaFEV47rnndJ+uuOIKfOADH8C2bdvQbDbx4x//GE899VRHplUQ8J577kkw7eOPP46/&#xa;+Zu/QaVSQaVS0QELz/MAAKdOnUpIWpWTQQhJuNZOa1wvayTPgq6++mpMTEzolZXGsSaD7Nq1C2+8&#xa;8cZ51ReGIZrNZqJ8sz51Te2CAET0K5PJJPIgTjdIp+vD7OwsNm3ahMHBwbbkFkIIyuUyjh07tmxJ&#xa;22lzpmqn67q6r4CQct3d3Yl6FxYWOjLZ2NgYisViYsGZWooQgr6+Pqxdu1bbIwcOHEhAKkVbt27F&#xa;HXfcgTvuuCMRbeSc47rrrgMA/OQnP8GTTz6pF5bqgwqoqMSmj3/84zrvo1qt4tOf/vSS0VNFF5xp&#xa;R0ZGEhlNS0WFCCE4fvz4ee+e5ZwjiqIzMp45ENlsVkuntJRVbTPVvFK3naR4tVrFxMSEDkyk21Aq&#xa;lTA/P79sHNdqtdBqtdoMQRWWNtva29uLbDab6Huz2cTCwkJbucViUcMXdX8YhlpVq/JNWLdUWVu3&#xa;bsWOHTtw/fXXa4GgxjeXy+HWW2/FyZMntRfC9KEreKCy6n7zN39Texd838dnPvOZM0ZELzjTXnLJ&#xa;JRgaGupofQNJ5t23b9+ycl1PR8pIAZKuNNPiJ0QkcSsYUqlU8Id/+If6IJBbbrkFQ0NDba4v9fzU&#xa;1BRc14XnecjlctqKZ4xhZmYG119/PVatWtVx4ezZswczMzPL7o/v+/B9f8m0S/O6WizmwiuVSpic&#xa;nGx71lxYilSgBBDz4rouCoWCLq/RaOgACAAdhv3Sl76EbDar+6rGVbXh4MGDGrL19vYm/OSzs7Oo&#xa;1+sYGxvD6tWrdeojAHz961/v6PtO0wVhWtOqTlvlpuGVntC5uTk0m822Mw3OhhzH0VjSrMdkXMYY&#xa;arWaHpCpqSn8/u//vi7jy1/+Mq644ooE0yqf4tzcHC699FK9+0I5ylW/fN/H1q1bl/T1ni0E6mTI&#xa;LTV+a9asQW9vb4KRl0pWHx0dTcCDxcXFBIaklMLzPG3lM8ZQr9dRKpV0GZs3b8bWrVvR39/f0X2p&#xa;/p2ZmdGLoa+vL8Hg5XIZrVYLN954I+67775E2z/72c8ua4wumKRVGGXVqlUJHJSWtEotqUE5UyLK&#xa;mSiXy+lFkq5T1ccYQ6PRWLKe9evXJyJB6r5SqYSjR4/C9/3TSoCVK1cmJJRZ9+7du88qD1VJM3My&#xa;lepNY71Vq1YlpKdKmO/kTenp6UlIvDQ0S8ODKIpQr9exuLio77n66qvx4Q9/WMMxhVNPnTql57+v&#xa;r09LU0Awreknn5mZQTabxY4dO3DTTTeBMYaDBw/i4MGD2nV5JrpgTGt2wiRTWqjPKmHifLOHAOjI&#xa;zVL+xeVkFJkY12SWer1+RviSzWaRyWQ6Gp6A0CZnEwFSkEWRuQAUJFFkMqL6PQiChEtJ9cdsIyAW&#xa;pGnUKc2h5pBzrl1jykU4NDSE8fHxhPacnp7GAw88oK/9zu/8DprNph7zfD6fwMmlUglDQ0M6xE8I&#xa;wdGjR/HEE08se4wuCNOahoJacaZKM9UH5xz1eh0zMzM6gnM+1NPTg1WrVrVdV3Uq78Lp6unp6dEu&#xa;GdPwmZ+fTwQulnq2WCy2uajUInrjjTfOythUPl+TVFlBECSYdmRkRKt8pcE6SVpCiHbxqe/Hjh1L&#xa;qP5MJpPwpyrtpNo+ODiIdevWYXx8PGEv/Omf/ik+97nPJeqamZnRhufg4GACvpXLZdx8883Yvn07&#xa;OOcol8t49tln8Q//8A/LHqMLJmlVYkp68gC0STC1dUVJ2XNlXEII+vv7sXHjxrbfVJlhGC4p6cz9&#xa;ZIpRzLbOz8+f0b+qnk1DIBOWnE1an5kRpfqoonymMUkp1UaOqjcIgra0PyUB09ogzbRDQ0MoFAra&#xa;FlBSW8G3sbExjI6O6roWFhYwPz+PL3/5y4n2/8Vf/AUGBwe1Adff369DuICAGFdddRVGR0dBCMGD&#xa;Dz6Ip59+GsePH1/2GF0wplWRjzRESDvtTVfL+UpZQggKhQKGhoaWdHlFUYQwDDv+RinVTvtOGwjT&#xa;1nMnMgMU6YXaCYeeiVzX7egbVTDHdL+l2326DKq0MCmVSoncZeUSU+1Ph9+LxWICPy8sLODQoUNt&#xa;WmRxcTGBg3O5XMK7c+WVVyb8+N///vd1rsNy6YJL2rRbxmQmdf1cd7amyXVd9PT0JCRA2lvh+/6S&#xa;CRr5fB7FYjGh3s32Li4u4ujRo6dtQ9pzkXZVpXHomUi1hzGmw8xK0pplZTKZNuNK3ZO2E5Q7y7Zt&#xa;3b7JycmEpFWBCjMUbJaTdgnu3bt3Wemkynug6v3gBz+IXC6Her2Oer2O73znO2ftObqgTGuGbtOW&#xa;tLoGQKu68yUlHYB4cTDGtAtNSZSlGE95HpSKTRuNCnufjpRUXMoQPFttojCyuXOZMaZVtcm0XV1d&#xa;ifyJ020LUlEpNS/pbKvx8XF0d3frvjebTW0LUEqxYsUKzbTKd/3SSy+dsT9pCKP2hj3++ON4/PHH&#xa;z2lHxAWFB47jaEmbxrVAUhp18jScLQ0ODiKfzyfSH9MS7/jx43jmmWc6Pp/P59u2l5gMUC6XzxjJ&#xa;Uup5qSjOUsxsknrWtm309vYmmIcQgmazicXFxUQyttpmbvZbGX1mfdlsVm91MTXQwsJCwnug3Haq&#xa;rFqtppk6l8uht7c34darVCrLwqHd3d0Jw1Lh/IcffhgPPPDAGZ/vRG/pqYnmAF+IQyjGxsb0BC9F&#xa;5XK5Y4QIEBOa3jRoeh1ardYZIzRnCjmacOVM9ylokMlkEs9Vq1WcPHkywYyd3GLKcW+S53l6jNRC&#xa;SBt1ALR3QUlyczuRiUsVBUGwLFdeOp0SQBvUOVu6YEyrMFBazSoyB9zzPBQKhWVP6FJ0++23Y8OG&#xa;DW0BDLPu48ePY9euXR2f7+vrw/r169ueAUTcXW3nOR2lPQbp/qQx/ulo9erVGB4eRjabTUz05OQk&#xa;nnrqqUQfFWObbVA41RwHte9LtUNBjTSDDw8PI5/P62er1arezKk0mjlGrVZrWa68QqGQMPA453Ac&#xa;B319fRgZGVnWuKTpgjGtimObid+K0uoxl8thcHBQbys+F8Z1XRd33HEHNmzY0LEuzjmq1SomJydx&#xa;6NChjmX09fUlnjf/VXmtZ6I0hkwbhAoynY4UFr/yyisTE6nKOnbsGHbu3Jl4RuUcmHV3YtrBwUFs&#xa;3rxZt0d5U9LBhYGBAe2aUmOnoJHKilOkBNRy8gSUBFf8wTmH53nYvHkzbrnlljM+34kuGKZVKud0&#xa;/ln1WSVmqKTmc4mKua6LiYmJ0x6zVKlUsLi4mJgck0x4kF5YKj/0THS6pGyF3Ze7KNesWYOenp62&#xa;65VKpS1/wTyfQFEneKCOPlWkFkh6h62KCioy4UFaxZ+tC8+yLA0nFL4dGBjARRddtOxyTLpgkrbV&#xa;aqFUKiX8iOnJUkzc1dWlUxhN1XE2dNNNN51WUlNKceLEiSWTVSilGBgYwMaNG3VbVTmUUrRarSWZ&#xa;3aRyuZx4Nm1sqqSW5ZDKFlPEOUetVsORI0fwyiuvJO5VznmzbpWoYo7HyMgIduzYob8reGBqQ9d1&#xa;EzkChBDtkgLQdhDe2WhHBQ9effVVPPjgg3phbdq0Ce973/t0FPVseOCCMK2JlUzJaQ6qOZnq88qV&#xa;K5HP588JkP/Kr/wKgFhydOr0gQMHcODAgY7PU0r10U1pycE5b3OSL0Xz8/M68SfdR0II3vWud2H1&#xa;6tWnLUO1Q8EDE2IsLCxgZmamTYKuXLmyrZzFxUW0Wi2tfRzHwcjICLZu3ZoIdqgghRIimUxG+1MV&#xa;mUxr7rlTbTOz605HKhJXrVYxPT2Nl19+GdPT0ygWixgfH0/kfSyXLqghFoZhYjvFmdw9t956K9at&#xa;W7fsOszzB9773vcmIkRmO1SG0pEjR3DixImOmFLtbjUd7qYxtVymPXXqlI61mzF51e+77rrrjGrw&#xa;hhtuwCc/+UnYtp1oKyEEr732Wsfsp+UcYVosFjEyMqIZXAVbzIw3FVlT4VY1FqbLS6V1muPU3d19&#xa;2sWotKmSyiq6+MQTT+Do0aN6a/873/lOTExMnLYfabogTKvcKGEYYteuXThx4kSbhAXazz34+Z//&#xa;+bPCNYwx3H777fjiF7+oIzxKvajyVT7Bd77zHbz44ouo1WpLhjXVn3rWdAuZhsiZaM+ePZidnW3r&#xa;M2MMl156KS6++OLTHri2fft2fOQjH0kwu1o8S+0vMzGtqm9kZASFQkFrussuuwyXX355AvbUajWc&#xa;OHGizZdrUhAEqFQqWtKqLTLmol69ejVuvPFG/UyhUMDw8DA++tGPJr4r1a/g40MPPYQ9e/bocXrf&#xa;+9531geRXHA/7eTkpHaFpCVPWjKMj4/r5OTl0ODgICYmJrBp06aO5Zrfd+7cuaR/FkBbECRdlloQ&#xa;y6HXXntNZ+p3atPExMSS0uSee+7Btm3bOu5enpubw/T0dEfXkhlQUXT55ZfrM8SGh4exZcsWnZWl&#xa;qNVqaQmq2pk+Ukrlhigj00ygV+O1Zs0a3HzzzVixYgWGh4dx44034td//dd1hFAZ22aZrVYLMzMz&#xa;WFxc1Eb7JZdcguHh4bPy21/w7TaPPPIIVqxYgWuvvbZNyqpVqgZrbGwMt9xyC3bu3IlHHnmkze8I&#xa;9TznKBaL+NSnPoUrrriiTTqbTKK2q3zzm988rR9RSdml3FFjY2MYHx/Hyy+/3GYopL0d3/nud9Hd&#xa;3Y0rr7yyzSDjXCSJfOhDH8L4xAR+9KMf6d0P7//5n8f999+P/v7+tgOdCSH41re+hV27di3LH8o5&#xa;x5133onBwUFcdNFFWLt2LXbs2KEXi2pPpVJNnOjDOU9IWhWBq1Qq0uVHdEZXo9HQbrENGzZgzZo1&#xa;+NSnPgVCCC655BJcfPHF+MQnPgEA+iR2RQoenDp1CocPH8apU6cwOjqKK6+8Ejt37sTg4OCyk+Uv&#xa;ONPu2rULV111Fer1ets7BswJVYy2fft2/NpHPoJVq1bh7/7+78FSCR9Dg4MYHBzEhz70IXz0ox9t&#xa;C16YbjVCCA4cOICXXnqpLYIkWyD/5SCGpE2XwznHRRddhF/7tV/TZ+uq++bn5/GXf/mX8YIC8Pzz&#xa;z+Omm25CFEUdJeaKFSvwi7/4i7jxxhtx7TXX6Eyu97///Vi5cmXH/hBC8JWvfEWEStNGJueoSS+B&#xa;2cfR0VHceeedeM973rPk+9mq1QpOnEiOTa/ctaHKqzcaMo9BSNpWq4Xjx4/j5MkprF0rduoqe+A3&#xa;fuM3EvOrdh0rTAsImFStVvU2oEOHDuHQoUMYGxuD67oYHR3FZZddhocffritvZ3ogjNtqVTSvlEV&#xa;9eoULVKfc7kc3nHddRgfH8fXv/ENhBIfAwBkNGbLli342Mc+lqgnPWGKDh8+jEcfffS8dkSokOrt&#xa;t9+Om2++OfG+h9dff10wrbgR4ByNeh2+9HummVa1U6nRrVu3atwtutienaZo3/79aJoBDlkfgMSB&#xa;HuY4qA2YpkfF/N33fdRqyay3vBQu6r4gCBCl7IBSuYxSuZS4ll7sql2qHQWjXN/3NUZOG7nd3d1n&#xa;ZYydG9PGAku1Pv6Nc+zduw979+5NnIbdicnUtfHxcUxMTOD48eM4ceIEjh8/Ds441q1fh76+PvRL&#xa;S1ntTVIutjSVSiV9WIRul9FWMbgEnDNETPylXTnmRJvvHVCkomuEUIBSECos4xd378Y3HnoIv/LL&#xa;vyzK4lyPi4lv0056NQYqOw0Anty5E0/ufBIL8/MglILatmg3IUAUgUchDh87lsDPnbSOeiuNmXJY&#xa;q9VwamYG1LLBOQNnDEMrku4z5UslhACy3D179mLPnj3Yfvnlif4ASCwQxYxmUCOKIlSrVZ2bfOTI&#xa;ERw5ckS3fePGjbjzzjtjYXAGOnumNTEbEd/lFdmBCLtf2o3dL72EG264IfFoelWaTMw5R3exiO5i&#xa;EVtk2FExpqkyTYmUllKPPfY4HnvscXHNUjiU6narNvOII/R9RGGIMLX9eakFoeiExF2CmRwQm4LY&#xa;Dh576mk8u/tl/PIv/VJbeWZbO2WkmZ+r1Sq+/e1v44EH/gTUcUCoBWI7cTkAGOd4/oUXE1rMlNxq&#xa;vJ7+6S6Ac9x+23v0tXqzidn5eVDHAQtDcMYwPJrMASiVymg1W4BFAcuG7bg4cvwNPP/Ci7juundg&#xa;9aqJhPAw50Wlcvb09OhDPwCRy6GYtlQq4dChQzhw4ICOjC512mQnWh7TJgaX6hUIQGNDyEGzCMFi&#xa;qYyf/ORJDK8cwX/6hbsSE3Y6SlvE6Qk2t4Wnmf/7P/gB/vEf/wdeevklWI4LYlkglIBod5gRxaEU&#xa;rUoJ9XoD1UoVxQ5vkFyKXj90CAABdRxYmSyo42pmKC2ewP/zzW9h6+bNuHjLZl2eSWZ/1ISbVvw/&#xa;fevb+OZ3vgvL80C9DKhlgdoOQCk4AZSIOPbGSVSqVbjyYLp4fsTvP3z0x/jRI49g7erVIITADwLY&#xa;loV6vYGZuXlQLwNOAoARjIynjLVaFa3AF4vFywK2DTCGL//N3+Irf/d3OLxvr0h5zGb1nD744IN4&#xa;8KGHtHvuhz/8IV584UX87u/+btvRVVEU4Qtf+AK++MUvto3LcujMTKslm5BShFDBCFLCCokm/kBi&#xa;Jj72xgk89pMn8Z9+4a62yUpbyer3paSw+p6WzOa/3/72t7H/tddAbQeUWqC2nWRaasmFJq5F2Tym&#xa;5ufx/EsvYeXK4UQblhpAQgjK1SqI64K6nmAsxxN9th3YmSy+96NHAEqxcf260x7Cl24/IQTff+QR&#xa;PPv8cyiVyqCOC9vLiMXnuMY8CGnrt3zs/LdnsW71KqxfvTouV9bz7X8ukJBoAAAgAElEQVT+Z5yc&#xa;msK69euxWC6jXKmAcY6p2VlUanUQKcXhuJhZWMSTu8TBcWEQ4ImnnsHRN06CuB6o54HYDsAYOIsQ&#xa;co7/9vkviBer9PYC4Dg1NYUXXngB+/bt08KsXq9jZnYmESlNj8Ppvp+OCGJkmp4hPZiCEQWjUouC&#xa;UMEQIEQwB6GgaruKZQEccD0XruvhW9/471i5YgVGhoe1GjOlZSemXaoDnaTgCy/uxgu7d+P+++8H&#xa;AwexbFDLhu26gF5gkP/KxUYogijC6olxrJqYwDf+8s/F1m1jH1XnISH48G/+Z3z9f/wj7GwOdjYL&#xa;28uCUwq5rBE0G7jx2mvwv/7Gr+PKyy5FRm567FSW6lO5WkWlWsUH7rkHJ6emcWqxDDuThdPVBWLZ&#xa;QtLJxcYh4HLgt7DjkovxczffiDtuehdGVgyhWqtj7/4D2HvgAP733/99dA8MYPuVV2P9urWoLCwg&#xa;9H3s3b8f+w8fRotQcNsBLAcXb9mMomsjbDYRtJqYnDyOaq2GehhJpnUBzsGDADwMQIMWCtkMCtkM&#xa;EAQ4NT0lzobwW+AgAGOCrRS2v8DUkWlN9U+pBSJDnQrHWbYtsBaloI4DalmwbEf+bgGEauPixuuu&#xa;xZ23vht3vufd6E4dgJZmwE5Yr5N0Vfd89/s/wL8+/H3868MP49SpU3AyGWQKXbAdB5aUTjDhi+wX&#xa;tRyBF+UIfOZ/+zi2rl+HLevX6rJFVUmpSAjBe+/9EP7tpVfhdBXhFLrgFnvEQpWTFPg+PMvCVZds&#xa;wWWbL8K9P3crcq6LnOt07DMhBAvlMhbLFVyy4ypYuTy8gSHY2Tycrm6AErHY5EQJIw/gLEKjVsWG&#xa;8VFsHB/DaF8PFqensf/113Hg4OuYm5+Hk8vBzhXACRBWq+BhKObRdeF2FWFnMrC8LPwwRFirgkcR&#xa;eBjCssV8WtmsxtVREMBvNBCFAZjfAms1wVpNRPUaEAXgjAGMgQUheBQCnAmG1V6cC8e8neGBwbRK&#xa;Wqk/atuaUQm1YDkOqGXDcl0QSmHZdizRAPzwJzuxdvUqvPPqK9Fj7OY8HW5cDhFC8L0f/BAvvPAC&#xa;jk9OotjfD8fLIFMowHJcUFuqVColGrX0YrRdD04mAw4h8X/w1DPIeF6CaQEOzmN1rFrb4gTZnl54&#xa;vX1we/qQ7RuE5TpCEnGOiHEEzQaeP/IGXjx0DLe841oMdhWQdVOuMPkv5xz5XB5eJovs4DDgZWD1&#xa;DcIqFGEVuoXhKG4EiyIQLhk3CpHN5vDa9Cx2HzgIWq+iMXUSrufCcV14PX2wMxm4+TwotRBmsmBR&#xa;BM6EB8bOZGFnMrC9DDzLQpTNaUFj2bYQRJ4nNCmAoNkEIwSs5YvfHQdMzjlr1gXDRxEIg2BgAMC5&#xa;v1fhtHMPYwnEHoEYp1LXge24ovGWBdvLwMlkBXa0bUCq1WwuB8fz4BaKcL0MMsVuWJ6HiAOMcUSM&#xa;4b//n5/ARH/syFaT1um7ojQW5lIR3/e//Db+6aGvI5vPI5vLo9DTB9vLwM7mAcsCtSwhXS2JZYn4&#xa;lwPoXbsRpWI/SBQBjKF0ago2C7FhsA9rVwxhtOCh0WxiYXYW9WoVJ+bmUW80UW80cOz4ceRXjsHp&#xa;G4DT2w+72CvqkaqQRSHAIviVCoJaFQtHD8ElQAYMlDOsHh/FL935c/jQnXe0aY5f+K3fxZGpaRyv&#xa;+3CKPbCyeenqC8GiCIiEtc8ZAw8DOGAgTPz5zQZ4GALUAqcUVqEbVi4P2t0H7njg2SzguCC5LsDN&#xa;APkucMsGt22AWqatHbvzLEvwARgoY7ArJdBaGc2XdyFcnEOwMIcg8BFVyuCBLyRwvQrWbEomDoEw&#xa;lAs6umBQIWZaw+AictIJpbBdD7aXERLVcUBdD9l8AV42CzebRd/EGiEVegcAx4WTzYEBYISCEwIS&#xa;RQgbNQTNOtBq4U//5w9htK8Xo/29HY0R3bEOTB0xhnqrhXrLxzt/8UPIORa6VqxEYWglBtdtgOt5&#xa;yGRzoBZF6PvgUYTIDxCxCFEgXFxRFKFluTjeCITPkzGEzQb8ehWlE5NoLM6jcmISPBKDTCiB43h6&#xa;PLLFHmQHV8ApdMHJF+DmxEtIkq5rIRV5FCGqVRE16mgtzCFsNhA0G/jNX/wF/MYH7sZQT7yBEQC+&#xa;9eMn8NC/fB8/eP5ldA+PwO7pBfUysHJ5EMsGzxUA2wFsB9zLoWW74ISIseYcnEAsIGqBuVlwaoFb&#xa;tpxlrqSA/MwlPBJt50xc5/HQt7MJoWJBWBZIaQ6kPI/gse+hMfUGuN8C81sIy4uI6gKKcAklwJke&#xa;zwvBuES3XhoohBBYjgNiCcnqZLJwc3ktWcc3bUFh4xbAcQHHQ4vaIJzDIirDSp4JJSeZEgHMOedo&#xa;Lc5ifmYWG0ZXYv3oCD76vvcg53nozufgWGK1K8e8eCwVLTIY+rf+6L/hmd2voG9iNfom1qBv1WpY&#xa;tgs7Iyxu27IlXHFALXlUk5okzkGUxOIcURgg8n3USwtoNWqoLpYQhQEC30fEOZpBJIMRHD5j8AFE&#xa;HAhBEAQ+OAMIGAg4CIu0lOFSlXPGEPkBeBRhYWEO779mB95/7ZW48+rLAchDNjjHXKWK/+sfHsJf&#xa;/8uPkOnuhbV5G5orJtAYHJOq15h4xkAV4+nlQvT4mMGNsyWeEhzpUggATkSwwyJA9E9fRViaR7A4&#xa;j2BhHmFlURhtgQ/WbIhxjkJhoGmmPXfmteOGKQexgV+lj5DaDnI9vch394AOjyGwhMeAcKmeCBLS&#xa;RruWVBcpBeUcTjaPXFcL1ZaPw2+cwNcf+QmynoPuXA6ubYESgjAMcPHqCVy2MZlna0aZCIBLNm3E&#xa;ky++Ap5oNwEBEeEEY3IBFbWR/l4AQcTgRxFaEcNC00crCFANCHzmoGUXwGiEyArBOEfgCnTGOBdh&#xa;ZqlFOAgYZ0IISUOMMKHG0ayDBAGsmogQUdsCtygKXUXM1Zt4/tBR3Hl1HF0iAAqZDFb096GYy6LW&#xa;rAt1GwSgUSgMGq6CLdDeCj3eiegkSVxS/GxqA8IBrngcyXuVgWo8qj/rC0pLAqBbrgA9+hos30dY&#xa;rYLajsTHkfDaGPe2RVPPgQxDTLq2qCXcRpJZbc9DttCF4sg4ihNrEHT3I5RWNeEABQPVAQdIS1cy&#xa;EhQjURACuIVu9DgOgmYTU80GvvXMcyBRCIuFoBAM1mw0cOcN74CXz2PzaJxMkiDOccc7rsHf/+DH&#xa;sGwLQaOuB4YQgBIxaQQcFBwWOJphhGbE0GIMi60Q5SBEM2JohgzlkCFgDK2QgHEPzHXlqIoZYqY8&#xa;00xBtMFKCECkVQ9wgEUgvg8SBrCriyBBC1Z5HqRZQ86ycGR+EScXFvHb77sVxawIE1NKUchmcOlF&#xa;G7F25RCefP5FFFbXwZpNkDAAkapbzRUlADczS1UTicFt6d86cEzMlCaoTV3VZSbnQhmFZMsVsDxx&#xa;ulBYXgT3s2KcOAP35flhUSQfSDfu7MkihPwfIASUEFAJCSzHFREf24GTyWFo3Xq4QyuBvkHhazUk&#xa;MiXxEZHay6C+E6qvQ0IGYbln4eW74GY82J4nJBaliEAQEgruOJhv+Lh+y8Z48CT2U4PYU8jj4PQs&#xa;OGM4NTuL7hXDGoNTaRyCEFRDhnk/xGuVBo7VWjhabeFwpYE36i3MNAPMt0I0GIPPOCKl5AkBJ9Kv&#xa;K117OlRp+GSFrDUmQqlk6QPlroeo0I2o0A3m5cAyOZBqGdV6A3PlEt6xaT1WrxjURighBBnPw57X&#xa;DuLZ3S/BHhoBL3QD3WKPmRpHaOdOiglNd6JmOEgpqzwhqp3ix9i9yeMHU4BAeWASBUtIqbWfZYEW&#xa;uxEdeEkYhNIzw4NAYGUWJ0GdL8WSVjdeSY+YCfMDQwizeYQMsKgehSRpyWNeMwZASSUJOwDAcmy4&#xa;YR4sVwCLQrAoRBSGqMPCvuMnDQjbEblh2/o1aDSbOHDkKCLfh+W4wo0FIW0ZB0p+gJPNAK8s1hEx&#xa;od49JR2JCDsnsV9nqZKURObvHaQdV1Ia4IqBewaB7n5YJ48h5IAfhDg8PYObtm1JaJOuXA49hTxc&#xa;20bYaoGGASjj4DQ5tAlZmdDvS5C6p9N9p3neHO+lCuaMgXhZkN5BEOlRArUSvvGYNy4A0yZgsS5f&#xa;RL6obcN2bdD+QVBqg0i1EfOmsCg1gIo1avxFPYNYdUO6VCwqHPykUNBYlQAIfR8LfgunqlXkXQd5&#xa;eTKhmbvAGMP/dOlWnJyawk+aTVTnZ5HnHLmuImyb4I16C69XmjhYaYEBsKlQqbZ0exFCtbUcD4Bo&#xa;c2KiePI75wDVCxFK1opumiQFAE2Fnxvbb4B97DX0Th7EN37yDO67+Z1oBQFaQYjp+UUsVKuYK5fR&#xa;VyxgtlGF1WqAsgiEOtpfG9ehRxY8wcYGppX3M86EpLYdEcFTmJ9zIAzihWsavAaw5cY1sWaFeBDw&#xa;D4DjgbkZ2LkuhLU6YIXg1AZTkUjIBhGFcc/HEIOS9EYWFbW0J4FQC1YmL/IrIy4iNAkdIfslv1It&#xa;sIVRJLI8iDZcoFWtjLYR6DCxStuzXQ8ey+P/fmIXrt+wBjdsXNNxa/pAsQvrx8dwxcVbcejEcVgE&#xa;mMoXMU8aeLYSwiJE/KmRJ9JRwgl4wvFNoF1AqavGz+IjBzhVrArt6YgHQn1XC0BhQyV5LbD+YQRe&#xa;Dq899xjG7v5lNBbmUV+YR1haAAhBJp9HJp+HO7oBsF1ZFIstJ9U2ZeCkVoz4jWlIAADEccBPnQCO&#xa;vQZarwkfe74A5LoQrd2ijbyktRULp3gIuDFWgsEJ59LVRkFzBRB7FrAtQ+LKtw+dozcjTeaBUNDw&#xa;DPF2Y89xUJehZC1hDWmvmIhCMqlKUNFgisfS22y0BvcEFGYSjsxvsICfTk5juLcHW0dWoDefSa14&#xa;QTs2b8L4yAj+8399ANNuBqfcPkxaWeQymQTTCRin9YOBBolmyNgAJx2ksGozB5iJ/zgERDCvQa/i&#xa;OIWFiPXLIrBcATzfBavYB5sDBTeDfE8vWBRqQQFCgJ5e8EIBcOw2NW3KQmHfKAmZEijqIcsG6jXg&#xa;1EmgWQPxsrAWZ0EJELgZBGNrhSsQ6LB81VSSuArjB0OXgngeYMVhfkKVJGsv8lypcxiXJ5OLQQnA&#xa;4kHQRkCaCROiCbH6WmKFKcggeTt1EbAtG9VWgMmFMvoKqTdASsOs4Lkg3V3oyudRZQz1RgNO3kNy&#xa;WtFhxtvbZEqPuE9UuLCUSrNsg/WNAg1pnMS2RP9OIL0PUrPwbA60XhGyi1JQHkGNKyEE3PXAbAec&#xa;SHWeaitPVMpT9ab7zOOxVViTis/UbxlCJNUvo7ZEn0Vn0LZYzdRVNbmKoU3NjHMnO9kv4XRnUQTQ&#xa;ECDi7CduJPpSS/I5EZJDOrjkWAs3mAkPCIkbq9d/G7OT+H7E0juby2GyXMOj+w/jsvHhNj4LwhCu&#xa;ZcHJ5zCxajVemV1EaWEejpsFMh4UpwgD13w4NdlmWyA1JQF4aR68NA+UF6VjPALyXbDWX2yo0VQZ&#xa;6iuRyMi8RbmSJOPwnn7QxTkRenUzAFEVC6zJvIxIS6QUYB22D3E1ftxoglpAoi4lBfXPCl5JDwmn&#xa;FojflHUo538H80tVobVLB7lPIBeEdHVqKBnP+/mbYVLSKsDOGQMDQKJQT2C9UsbiK8/Dcj1YXgZe&#xa;oRtuV1Fk/6g/5dZS4sRcZGqstMQjHZg3fk4NKiEUbiaDuYaP2XIVj+47hEaljMBvyR23AWqNJqJI&#xa;nLn1+smTmKv5YF0OeOCL+T9dznmC6cyLRKQCVhbAX38V/MQxoNmIJ9O2wYdXAa4L4nqxoWYwZyyA&#xa;2icegGYOXugGWCikuWWJUeKI8baS9B00VaL49JpJ8m3c15hzTzMwHcrSt6vVaOLbxC/Q/nrNCEBs&#xa;0/Al23w2ZJtWoYo66aQMxtCq11HauxtOrgA7mwcfHIY1vhrI5mDJUKnOtwU0UwKIrbKEuoC+T9Ub&#xa;d9qQtHKVBhzwI47HDhzG7BvHUa+UUatWUK01UGk0Ech4/qFKDaS7H3b3UDxbXNUr+7fkMKQUvmWD&#xa;V8vA3DRQXQScTJwt1qyD1ysgtAieyQKRMugMSGFOZkLtSlyrfnNcwcCWfIbH/CWkrTlGqbGT3MQT&#xa;nEk6rMN2iWhK3cS/qfFIYHkVPCEG5jWwPzGfe5PJ1uoIHOAMnHHwiIIBAhZIpmQhQ1CvI6hVUDsx&#xa;Cdt1YbkuMv2DcHJ5ZAeHYecLcLp6xG4GaoEQS0o7xTw05ZwXTEr1d574RgiBm/HgeC72Tp3CzGsH&#xa;4deqaFUrIOAiSJHxUCh2werPgOYLsLr7xRYRCmOhcM0sAoqpSUlLwljNkUYNCAKQbBe0ZQ2AOC5o&#xa;swZkMlraEcU4xGAeObkipKzaor7I6mwXLFJWPonhJBe5qToQAIBQkoCbhBKhFYmR8CLLJxwAJTEO&#xa;Jmp0DS0H1Ra+tGAx6jcZXHWT6++xR0cP4JtItsJAaoAIgCgKQTkDoRGilmhgZPmgloUoDMEyIQJf&#xa;5NEGvg/LcdCYmYZl2/C6umFnssgPDMLNdyHTLxzORO5z0r5WPUhKIKqdBXKwoHY2CCYu9PXD2Xop&#xa;eBiChSGoReB4GYSEIqAW7HIkws+ZjMiEAgyjIg54xlLBAGlSl2oJqBmFis19LBaPnIvztrS643JB&#xa;cIPB5H+195Sn7XHZPybyCTgn4My4w0jm0bKRM+mqU+0goCQlObULDIbhxjVGVonZqk2iGZIDmfwz&#xa;3QOKGXV+hRobpQXks0riy1yUtGK40GQnes04OBErlTEOECZzTpjYd0UpoiBA5DdBLZEoHLaysBxH&#xa;RKRcFza14LkuWo06SpUKGkePyvQ5gloQoqd/AMXubnT19KCruweW7cCVmwNDxlK4i+iBczM5eJk8&#xa;1IRTy4JrO6hEQMgATuoiw0xuSTFDo0SrzdiHyoWIhIn1zMkX7jsLsBgEQBZEqQWu86vMJCHE6lIW&#xa;K6CSqa8lA8gFyhu1+F6D6QWTtI9FoiQDGwrtwUHMDBizzgQsU2hJqR5DS2hFYTK0qkyNGQHAkOx4&#xa;LMPPA6oum1IuL7VyuRZ4Gt9CZDmBhALfSexL5NtVqN0ScoWFCABQJwNic3gOk2zGQWUic61cQrNe&#xa;Q2VhAZbtIJPLw3Vd5Lq6YNk2LDvTdmSRmXhDILKmqNzmEinntvZCdOoTSU102pRIkWFlQ+N1yL1x&#xa;qpjU0zxeAHFOgnxQSTztcqJAs27gxZhpdUZbLFdh6ghVFzcXjbnwNBZVkwhD63Tua+J3bnwwoU0C&#xa;1xp91nWJZ95sZGswrWRVDikN5IRF4lJEhaoWh1tE2nnMORNbnMFBAxdRsRscROwkJQSOMSAZwhFF&#xa;EjezCM1qBSAEjWpFBBROWbAsG9lCAa7nIV8ows148DwPrueJvWlEBCkItWBZFJxHCAmLNzAKMaJV&#xa;oBmRjA0IcwjMCZHSTfplCSUg3DIkLQEokwk1atRU4dwsEfGvadws/6UUmD8lEnPARb6soWYVpl2K&#xa;AUx2VnBEQ3TDf8rj0Ug+2KnE0yazqDLNsuLPuh0adpyxwnOmpKTtWBEH5wxgFJwwUAAsUonUFJHc&#xa;XUupBc4YquUyXGcGmWwBVi4HksuBQIaFKeB5NmxbMpy0vFkkkqxbrabI+C9HaNkW/FpN5PRaFAwU&#xa;mVxOMnAGPf0DcJ2MEIIWleFlgCvXmx5AFn+WeanEbwF+Q+SoRpFw8bEIJAyENc8YUJ4XCo8SgCt3&#xa;HgFYBGY7wrfKjeTAtLQypHrbxPktgNWB2SljcakFZuDLFMsSoyStySU+iCO5JHFjJyxt3qaUe/pb&#xa;vA554rq2ORNtSWutFCS6wLTkuQft1XJD08TqS2Tmi4RfRASNWgURAaxCUaQl5gvSyLIACEMgiiIw&#xa;zuO0RteDRSmKff1y6IQR4tcbqJcXUa/XUK41kS8UUOgqIl8sIl/sFgvCEhY6V0YctcCpBQnGpZDk&#xa;wjkfBkDgg1QWgfKCZN6WcK6zCCTwBWMHgYybp4xGyEiV48rFYfxmOjS1GiVa6MUQkIh2NOtAvSr2&#xa;aylXoxprPb7JEGnandYZ5EIbRmmFstREt+UEpO/tIGR1nemFyttAU7Kxnco5S0oyrcbdNJ4ky9Ju&#xa;LxAit5Rb2jcr3FsG2A8jhJUKKgf3omYfhNfdAyebh53NIzMyClLsFc9atmg9IdKAIgjCAATiHWPE&#xa;spHpzSLX1w9KCRzbRqPeAGdiR+m+53eh1WoitD0ETgaWVxBBgHoFVhTCCX2xB8yXjBj6MTMQIlSo&#xa;2W6NXy0gs/QZJsT1RFBAZUqR9IyaMx5LLQ1xbRs4eRR47RWxsZBJ/MU4QOU9jIlFxnl79liiMUmN&#xa;aIL2ZCvQkVk4JJLoELwAELsr1YNLBWu0Ow8GE4sKCT/zy//OlhL5tOaxQXo3ri0YjKoECFtuwdFM&#xa;K36jjjzRxZJuIipUdthogAU+gnoZQWUB2d4+2Lk8rGwebt+g3IumyjcNizhCxxkBYxx2JiOS1SlF&#xa;sX9InA4YBmBhiFa9ipbnYZE3UG/4WKyK1/8EYYgoYiIQIhmTpiVjPAjtGFCNv2SkaHgM3MvG7ioG&#xa;uRtX3qhj/MazhMTZcT/+Z/BaBbxWBrEcAb2UoaTjFML4pZrTZJawofJN1tBXtbsqXiWxUyCNR41m&#xa;cg5ROYf+CrmwAXCF6bmweTjlcX8RIzC5lSE5bm8CpSRtnF9AJNNRWwQRqLTmqeOJjY8qEia3GVN1&#xa;dpYlGJqq7cdSmikhFzRbYBEDbTZhcYYqLLQcF45to7enF47jws2od2/FFjylVIcdwDkYZ2gFLRAQ&#xa;ENuB192LLKUYWLUalm3DoRYC30e9VkXg+5ieOolKpYJKuSJeusGl+4vIrDJIZjWteKmSWSYL1t0H&#xa;1t2PaHStwMByvKD8mMrLYPp7AcCxgMAH9r8CfuSAiLRRAli2yHHVdSHOHosigEUJ74CKOCrWo4To&#xa;akEgzhrQ6jp1Eo/2gJAk33IJ9fTpO0zfLoZCGIOUWMIdCi6CFkQBRgP7qIacznK8QExsq4rifFrF&#xa;jMbhHLaUhBaF7bpwMhn5XRzWoU50YQDCIIgNGEL1AtAH1bV1hiMKIrAowmKpBNuyxTYcy0Yun4dt&#xa;WeJwCNpBN8UgUEMaLhN+Iinh3EwWjuthxQhFrx8gCHx9nqzIYWihWq2JgyhsR2y59jJi+7XjCozs&#xa;ZcG9LJiXicVKyhhRfUk0jBBgZgooL4BPHQcaNclY8h7DRZZ43nAttZdtVNHps0YrCkiTeCGabrT0&#xa;VJh1G2UR1VbtuzVhkCFZFVR5k6SrSbbuGDGSv+UJI8SykO0qIjcwJM48cFw4uTzsbE4wo+0IKSwj&#xa;XhwErFUHwgjcbwFRiCiM3+pHaHyeAiFUbIhkHGHog3Gg1fRBCJEnnIhXJjm2OOo9l88hm83Bsm3Y&#xa;6t1TiFWcStjhnINHDBEggxIZUEKR7+4GpQSUUITyQLQw8BEGAfaeWkCZcZRhg9i2yLiyLJ3lD2rH&#xa;E6S2tRuDKELEMQMK7cpjrMoBFIpi2/3CKcD3xd6pRGjWjFRxYUQCCQiT5G8D3hiROJGeHvvZY2Zq&#xa;F3UmijHLSa6P04nOZP3iM0vdZUjgNGw6RxI7F5SkNY8+kge55Xv70b1th5bAcBxxBKSUvNSyxaRR&#xa;sQXcBcSAh75IJglaQtVFIRCEwqqVC8JxbBAWgrFIQkzBdKHvgxOg1WzqU7Ndz0M2k9FHv+e7iigU&#xa;umDLIAMl8VGYCYnORZRP4GMCTjhsx4WbycC2LDiWhTdyfai3IkR+GNsa5kQYaYEcMPIJEGPjlCRU&#xa;Eor3D4H0DQDD4wImzE+Dz04Dc1Pg87P6dJoEE7IInLN4t6tZuUk8dVF/bNMB7c+nJfnpaCkGS/im&#xa;JfZu89MaBZDz4lVN7d4Dg3kJpeLwi6ERHfPn3DhEl3FQMJFZRwCAghFxYB08D4RayFAKhD54FIDU&#xa;6ggaVY2hhNQVE6TBv6F3CSHgjCNiEephHZVSCY7rihcC+yEyGXE+qq3ajNTWlzRJyMDBwRgHIwwR&#xa;EbkWPIqAiMXaeylSNpxRZNpjkKxTcAfJZMGzOZCBYSDzGsAjsJkpgMTngJllCDzZqdSkek6yjQFL&#xa;lmGxa95aaszMEGJ6baQhSXtDkeBevqwmLYts3TgDz1Lz3APHBYkiYclaVGxwlIMswroK9CuGEz2g&#xa;XCSUB+Ag1AaxHCBbRMa2oU5jKboOajOz4JWaiJRJg8uypKonpiFCYFs2OOPwWz6mpk7ixBvHYTsO&#xa;bMfGwMAgunt6MDQ8DC/jwrLt+CA0jdfjP7ELREAixriePFMA6QldCj9qSqrEpMqNPxAArFkHWTkB&#xa;OrYW0ew0sLgQ36juVcGFtP4mQFtmWltFS1s8ul9nlLByFMz1gfahiG8TDSXKvki0aLnifPlkE82w&#xa;hiFmWfp0REvuhFW7VwUujc87EBpSMLBOm1DWquHvhWSUiMvDPSjFIqfID67Axv5BhGGEWrWKZqOO&#xa;SrmMMAwQRUxHxKiRr6uGkBIId1cY4vjRozh+7CgO7NsH13UxODQkmHjliDh3zHX1G9KhIIo8t4Ep&#xa;x77RH7MqTpUxg9gtJ3mDmPahwg5GcEH/zs1j5gUMousvQbjzYbn5TwZfAH1sps6kImmG06oo6X2Q&#xa;DSbxFZgcxyE3IaYOMxTbeQz20r7rzlJdew8kPNKnC2mhyo27mfHDhWHgpJ/WsPLjY5HEyUmq/UZw&#xa;SHy3bFgkTkYR52/Fq57KJBdIvEmJsSKlNLEsG47jolDsEplkYYQwCFAuLaIpXw9Ur1QRsvhFIcSy&#xa;4o2SHLrdke+j3mrhcLkMzjm8TAaZbBaj4xPo7u1BsbcXxa5u2I4NSxqDURCI1EBuqFhozR67oiA/&#xa;SyOLg8SZVZCzzkRn1cRRg0EIEccoERYBIQddMQIehMaeaFmPsgFUFpoSuVovcw2d9NzpBsO4N54n&#xa;fV4soMc/FpU8cbv6WUM27TmQN2k/rXxG1au263TEARwX6ujPJc6LPfYAAB7gSURBVEI/RmKvznGV&#xa;v0imSxs8CiLYxq6zGPsY96ny1fNGNEXsABYTYts2Cl1FZHN5FKMIrd4mGvUagkBstWk2m/EQEAKq&#xa;GQ56gRAi37rt+5idOYVyuQR3ago9PT3o7e9HV1dRvG8BEP1UErWTHaMnn+s+KTtM1aekaUJQcSmj&#xa;tFQ0ClanfEvHqKjaxLfcqNO4Zn4kMZOZ495JpiXxfpwQbv6Z1ZpASUtyA+4obZKgtNsO5IJJWEVL&#xa;xys5JByQkS/E+FV8J/EKh4mHjXfN6mK4Lk/rOhIzrSpLcTmlBMSypT9YSEPOGfxWC0HgIwgCNGp1&#xa;eWS6jyAQvlYexa+DV4cB8yiCzyLMzTRFdhnnyOayKHb3oFAooNDVhWpIEILCZgDhEcCkGuXG66Qs&#xa;G9yyEPWvlJOlWCM+fNkcuuQVoq/G7kwi9pi5rnzNEtMCkrdJKyGl0mckJuuMZWXcMlUTEO8IMRun&#xa;vidXabucJB0/pu8ngAxLy/Zr6a4kPEkogyWg9xkpce4B5xxEZbdzeQym7wufqGxEvLVCMiohUC/k&#xa;iK/HZ3sJDCfVqYm/RC/i5xVsIIDahkx0uyIQy0IunwehXboNYRghCHyEvo9qtYLA98V7XH0fdfki&#xa;5ygMBH60LSF9KUWr2cJMcwqz02L0SC4HDsCRg024mnrVTCJ2z1ILQcQQrBiD6ZfV6tbkVoMxNBuZ&#xa;E84h9qIZL+EgRDqOmEpNTAeUU0xHCAiJmUJjWp68LZ5ijrQ/mXPI9MjOJJcaCOHJdUTalyUAfeav&#xa;EhD6BS9aaJ0/2YJRjUL1n/getpqSGaUuUrLVNODMjij4oFU/kYaXzMeVndLGjxwULX2l2orBs/oc&#xa;70rlEBg2k/OQo3kQSjFERtFqNjE/N4t6rYqTk5MIfB9+JKJtttIQhMXqXJVXq2iNAcmguk5VH+eg&#xa;nMGaeQP+yomEBDEEqf6iBQoxb4CEIPJHWU+8dUde53JzaVp5JxilAwOY7ViKP3j7bzpjrVN5utwO&#xa;hXZwramsPyiDz+CpC5U4o7fbqPcPMJlmSGU2VX1xAX3VCrjrgjuejD3HpwjCZF5CxDzA/E7jvhMC&#xa;1/PizZIy5MoieUhFYpSME2m0FCbGrwQ8isAYASgHt8QbdUbHJ0AtG5fsuBJ+o4H5UzOoVis4+vpB&#xa;tJpNNJtNobZkMERJUb1wxMhLKS+DChoOWaCLcyBBEDM3AM5SijvJsUky5o0Q8VIVcBhMCr1HLMlg&#xa;JtOQZDVm2YYwkGhL4m3jceWIUf207KSwUnvPjH4kEw5J8lZpCxDOwYJAbItnkRy/lHblqX/PgeS5&#xa;BzKFTB1AHASIpGSLwgClPS8iM74G3thqEBbBkIcJBk74a3UjuZZa6jwnwgEwLk7rth1QmcAdSgZW&#xa;m+dUlMzEzgkJnDgMQrjcGGcAC9GsR6CEYGB4GIN0BBdtuwyRDN/OzZzC4f37UFpcQGlhQTxJKWzb&#xa;0a+W4gYTE6jdCgQ0DEEadbGIPQ+UpWeBxEjAUKkJgauYRb2qgTGRJEOteMw64Np4Y6M09lQ5Rrm6&#xa;LnMWtEWooF/cYg4u3snATZ82kkwlo3NilAkAFmsQZacELSBoIWqJdz9wI2CjX9EkuAvnS7boOBFZ&#xa;PIppI5HFTwCErRYq01NghAJhgPz6LfqUveSbvKnxB51wk2Zq7d+lNMay0mea8cT5W5wL+BD5gRxs&#xa;bsAOxM8jLgsqF0EuEJr4Lo6ZJ4TA9lyMrl6D8bVr9bHx5YUFVEuLOP76QSzMzaJaKoncA0vFXgwo&#xa;EclkclsqKSmFSEcLWS5kA0pwBZ2goI78n0xzJGIChEGjPCskfXibOu/AOEMMXEu8hANELSCuFo7U&#xa;LCwCvAyY6yEaXCnYUTGz8VYf8YjYiycYWzCp6JGYE27ZsGp12HOngICgGtZBwhYQhjL/mQn3JldZ&#xa;EecHE2zVYeFzVNhDqCfGIrBQnBvrV0oAAdz+IXg9fSDSRRQfg4QkUwGaafTYm9egnjMlqRgQSi1x&#xa;LKfc0pIMaRoYWk0CTKnSCWPHi4USIt6LAKoNBOq4sAtF5EYnEHX3ozo9LXYV1KpQ+FQlfOs9XIY1&#xa;ozF/mtKXuG5uwm4wRZ/elp7Cf+Zx853Kjf+NxzIBG4iqS6RD8mwevKcfvLtfNIoxcxT1mPIlrphw&#xa;iBAC1qwhWJiCHVH0RQU0ogh1pk5oN4MN508CHnAuVCATjWLylZCcM4StBizbBgsD+JUSCKHoWrUO&#xa;TqEAu9AFkslL7U8T2DYtYdU97dKZJKJrIstL5uhSw3qWAF+5g/RBFWqhSKlm6WuxlIvCCDXOEIIj&#xa;4kCTcTQYR8jF9vOAUkQ0C39gFGEfB+saBI4fAqlVBIMy6GPradTpTC0TawqRprfZqAWn0QaX/xdC&#xa;goeBxOYcegOlwrQxX6T+5ZoJzRNr0g8oXtX6vlAExtaBOw6inn6gUATPF7WKj9mRpzg2iWcT/xIK&#xa;2mogmjuJ8Mg+hEEdng94QRY9oYXjbDHpBrsAzKtdXgK0MxHRkXu4OBMhV59asEIHLHRRPX4Efr2M&#xa;fLEfuWI/wkGxE8Ht6RPvieVKfXdi3KTxljbizJdFK8xEZTmWZcl5km4UQDAvZ2CMoxZxhATwIyaP&#xa;wRfoyWeCURsMCDlHyDiaHGhFTLz0g3FwxwUhgKWmLFsQWFsPtp59aTSaZMbQ2okv8RmAwH2+LzAg&#xa;Vwo37mPCNEiUQDpe7dQe/ZlzoH8I6B0Etx0Q1439wQqXop2pTIna3i8CUIJo908RTB5CMDuFVmsO&#xa;VquKfECRiwhWRD2oszoqPAB7syJi6uRE1TAWiXdwKWwZ2TYatRKsFoO90ABvleENDsHu7hZva9Rn&#xa;WxmMmRgCI5igjbfk/TH2MrEfZKCBaImtDKuIhagwjibjWGQELRA0OEcgGZSp51T9nIt3KUCc/dvx&#xa;jAvFOOowZzmp2mAx+2RKJSL9slxp65ROV985hESVr69X0jpWpoqRjFYRIrlQScNOsES1Ry0AQ1u5&#xa;Xly3XHzc0EgJUuohTcZt6qi04LWXEVQWEQRNhEETraiGJmthnrWwjW3EHCOoo4IIJsY5d0oGF+RH&#xa;xuQ7sThD6Ivf2P/b3pn9SJLcdfwTGZl1dlX13T19zvTOzuzttb0+AbOy1jIgJLAQsgQS4g3xxL/A&#xa;v4F48ht+AIMxwhbwYmMjWbZsr3d2dnemZ3Z6jr6768ysPCKCh8jMyurp7un1k0fqn9RHZWVkZkR8&#xa;8xe/O+KYWEqUSvhUsoLnlXG9MoPIR2w/wjzukTQn8F6+jqhUENXaiIPmCtO4MpWbnDL52BkVZ87a&#xa;OIW2BUEYIRxq9TrtgU83jPnhwEE6AlemYY/GatgyDZs8OSfZfJ/khDnP0RqT2DywQli1NZ5n10h/&#xa;2Zdw1DpjkgLzdKarESNAxSEqGOQ4zl6q3MOWKwMmvf64S92kXxWeJr9ONpsiN1+JbDll9Ls4IOZp&#xa;oKYdHCtyJ0BLF0clOEmM971/pbETIEMXGU7hBBITtawSFicEesCamWdVz7BvjviIByfv/InpRN2D&#xa;HLYYnZmnEmI0ZVWm7EiumQV+rn9p63NJSTmqIb0S5aSOe+ghn9xicnKRmZuvIRfmcCdaI2nJSQvT&#xa;kfNbBFmhaDEqnJZZFjLum1khHGcE+lTedaSkVC5TDuIsl3JsSjKj/Vg1lhwlJ4XF9JxUESWvtZUq&#xa;WwLLoWQheo3UY5c9azqxmTfrqXoEhfuboY8JfFs21CuhM49V9jYVufKYpSC9d1FYzoBlDAZNvqdE&#xa;dp2cKZ/se0bFFyK9v7EcP18NpWv3yjjYRt+9RXL3Fv2DHV7vL7ITbfMw3KY/3IUoSm21CZgEDLRo&#xa;0GKCT3OTHQ7Z4fA3Vs5OjT3INVdjMELxQrKOFgYlDL80tyjrCkIm4Dgkica4HjoOMa7DV6pf5Hg4&#xa;4HH3f9GeYGp9g/rCMvXFZeRE0xbHyJb+LHkx46ap3AoFUOcihEm5cPatfb5SuUy9XMXpt/MKW3ag&#xa;ySSadF6L61ph7igyoHGFyi7belxz1wYhZP5MmY03C4YZmXTG07hHQsKo78n2VpqOX+CNJ8WJ4kNn&#xa;EkbWvyJlL6vAAjZNdLSnWcfFU6uLScdFjJrbs9OXVKY7yjvg+APYfB/9ZIvhvduYOEan++L+eHCf&#xa;q/Esb8XXuB0G7MbbqS3ewWhbg6JjenTosc0eV1lig2Xu8xj9GwD3zICZbJmeYxLfBMQoYhKEMmiR&#xa;7RubsjZtmBQNWqrFY/GYQMWEDgjl4h/so+OEqNelPrdIdX4B6ZWQad2D3OyVjXuuhI0Am4E3m50c&#xa;5KNWJ4B42sQLRqb5p74al0sz019mFM+VMTu7QqY7rRet9CcpB9iJYxmoHBd1uJdWkxRPNyQbl7SX&#xa;J0SZjGuOy8+j78bvW3hD0/7Z7mbHC4WbjcHRGhFHmE4fEQ1xul2EPyB58jFxZ99u2BxH6DjChENk&#xa;pOgmxzyIfVqqTmyaDHVAYILxlxWDxnBElwY1lphjQMCQiIDwlEE8nU4FbY0KFVOmShmDoWP6KKFI&#xa;SJBGYnSMSlPDK4mgKWvUYkEk+zwKHyNciTus4nolVDBksLuLLJWYmJ1nde01VKMKzRrVmVmrpct0&#xa;c5GiFeGEeWwUv1D4cRyEESOQFpfUM4B78pgpLrGF5dHaqhWZQjZaIiWUy4wrRQX5cgwtYgwo2V8T&#xa;RaCHRHdu5Q6MPBds7HFPVAHPu2lXgvwZRk9Q6J4Y56oj22Buj7fbxBqM30cMfZvDFkW2CvowQHeO&#xa;IPBRx4fUQ4HXH6CSHuGwC3GEiSNUECDDIT3Vo5PELCQtltUMXdOjaxw6pp+xmfzROvTRaCaoscAM&#xa;ASFDQvY4uhDfHQNthTIVSlxjKb/RoWkzx+ToJGUHuKRLeHi0dAPpuAySiI7TYyou29TyyMWRAjcU&#xa;CNfgeAkLPsRHd9CNMqpRwlxZxG02qCxfwZuoj8IanUJmRIHTjv+MLAJnVWEx+dL3dAnK0+I/8lF1&#xa;S5BWgzRKWVtrOtHOlTWbVTu2OTEjMbRwmfEj6TEpoX2AONhF+gOS84JIChVwzBn9GFshCjJP5oYW&#xa;mBEwkwQnGFhwDvo2hiKOaPgGf3CAE8XIKIFO2ypSYQiJRkdDasqjEXrIZIqdKEAlBqUMRAIiz0YH&#xa;ao1SERXtUWOGZTNL3wwYEhESF7WKbHaoUaHFBC6SSRp8xFbh29PpBGhLtJhglQX6BPTxWWKOMV+J&#xa;ESijaJg6DWo0aXBgOihjqItpBBK0QOCm4CuD60DisGHm+Uju4KgYOXAJ2j3c+Rnc5gReYwKR1uDK&#xa;xISCnDD+OTuWDYPI1ZdR2zGOVZzZjAMVUrQLlzVg99xy7DZIJlXGsmJ1NKfT4nOAUadzu0z+EE+h&#xa;CqSHEwQ4h7t4pQpx6I9Gt8jR8+fOrnFCiC0qVylIRXG80r/CaIRQ4Pft/mFH+xAMEAd7EIaY4ZBJ&#xa;NUukDihpiaccZCwQSuJEJVAaJwStElqRy2zSQMYDYhUSqRAnsWOTxx8bTWJiJpigaeqss8ghHdr0&#xa;kch8LLLeJCgqlKhSZopmDtrzKAftEnOUcDmgzXf54dMLaWHcb5qr9PHZw+HX+i5CC7IMB6FtHIGM&#xa;7V5SUax51b3OK/I6/xT+G05sC3tI16NSb+D6D6kcbOKWysy9/BoTV5aZXNvA9WzJozFuCyOxIFWA&#xa;UMYqR5mEVjCWi/zjSNwX6Rrs5CpbUctKr5HEyLUXQMXo7YdQquJMzSCmZnFWrmGicCSLazOWgJlX&#xa;ys6mJpOP01gG7/5tkif3CHfu8WLzBTaDuxhlMEozTNTI4J/VS8j6pDW6IBYhbcZDpjTLOEIc7oDf&#xa;w/g9KkcdomGXqH0AYYROwtSMl8YDRDFGK7ROcOI2a8kMj/QOd9U2MraikU7i9NwobWtrWfxJ8jab&#xa;ZptN/TED5Y+n2RRWDgNssEyLCY7p8jHbT+Gq+LmExzt8gSfs8YQ9jumfCloxz7RZZJp92uxy9Eyv&#xa;xRd4jR4++xyzzzGZ3JarRQXjPwK+Id9hUz5m03lM7BlKpaotxuG6eNWqNZfVJ3BLZZrlBpOVKerr&#xa;qyQLDVY+9Xm7uXQa3Z9FYGX38KSLrzS+0nz38TEOVoEcH7aM4xVMRibTpEdZuONLbCovpiae7GUw&#xa;GFtR8QRI88i14nRk3C8LgwwGiH6H5L/+hSQJieMhb/jL3I03UUahTIJwJUZKEg0qSah846+Rc1eQ&#xa;U7OYJLb7fQUDzNBHHO9jOocQ+JhggG4foaPQgkwpmnGZhqnha58dfYATJ6kzI7YZHtqWNTVKEyYB&#xa;v6te59Acc6iP2Yv3rGk4jdAyysr2NgJPI3TMDXOVG2adH+gfEpnU7Z8L0eNLe4sJNlhmhhb/zU/P&#xa;xRfAMvMsMUfAkD2O2eNo7HtxgzXzLJbsINhgmQ2WucU9HrN/ztkWxC+Ja7wkrvF95//QwtYYkK7d&#xa;3dxWr3Hw0rpgTqUMruRP619jq7TPk3oH6XqUGw1aS6s0l1a48ubn8EoVMhAKR+JKh0hpQq35562j&#xa;cStDwcOUrdiZQJHncWXnFK0XjMZdFNoWWUO2MUiRw45Rxl2FAK+E6BxhfvUT9L0PiP0BOhqioiE3&#xa;gjm6cYcefXqmb9PzpS3wJ4Sg+vm30YD2ezDoMdVWhCIhJCEkGm3tpFNAqThNilT4SY8behWZwKba&#xa;sjbn1GFiTAbEVNlUmlj7vGFu8Ia5wbfVf6aRdun1VRoXm8V+oHCNxDUO3zBf5dviB2Tx2GdRhRJl&#xa;SnyZN7jLI+7y8Fy5FWCDJZpM0KHPFjuolKFK4O/PMzc4OLzKC0gc2vQ4pENIfOb5IJgXUzRFnTY9&#xa;dsVRtgiTa9OGVHa18vE0LVbNPD3hc6TbBIT5zjpGa5JwSDQY5NYDr1q1ZZnsFXGF4L22PxIhC1Aa&#xa;eZty41F6/KRpadRqTII8cb3cIJC3OQW2mUPEkYjH9zE7W6iHm+h+B+X76DCEaEg9lFRih6EKGKi+&#xa;Dd/Lltp0oxDda6N7XbTfpxwavERQTzza8THEMTqKc9OTiUK7lMcxJg7xYkM9cplMquwne5gktgqW&#xa;SizAUzndJDYUUhrBUA9pqRrGJPh6ALmsyuhvrmYaPCQLYgaAAcE5uMiEMZPKtuAzPPd8gIiEOhUW&#xa;mOGYXj43p8JdIpE4rLNIlTL7tDmgTUxy7k1usk5JeBzTY48jIpGQeYusA8Fq/giB4zrU5QTr3ioz&#xa;copflDcRrkzFBo9KbQJZsjXEyvUJptY3mJiapzE9z9TSKvXlRTzXxXNdvnN3m77S+MqkpTzTwc31&#xa;pPElXRTclic5bXoS2cHcxASpcjO6rkjNXqaoLIYB5nAH0++gbv8S3WsTH+5iooik37XgiSNmoiqv&#xa;JOt8zCPum0c4wu4AZMtOOXaXnqyWrxCUHZdVFlkxi/yP+TGOknl8hEmrnGecF53ganhRr3DNrPB9&#xa;/SOMsTIsJlUws36mpfIdY93mX9ZvckSbB+YJPfyCsyn/lbct4fEmNwkYEhByl4fn4sPBYZZJpmmi&#xa;0dxJzz+L6zo4zDHFDC36DOgwwN1geewkg6FKmRoValQo4XGfJ9SosMrCmQ+TtVlhgX1zTEDICvOj&#xa;dXlsnbZyZ0V7zIlZSkmZtnPEXFzFcSRuWLYyr+/geA6OB+5Ao/uPoDTAKbc5XNqht7FEZXqK6vQk&#xa;rzerbAUx9/2YxJDWds2wds4ydIqmOQbiUyZqRJlFw5YuJQyRh7s4nQ7y4ZY1yh91LOfzXUykMUEV&#xa;Eg+SEpXEYV1NoxgQ0UOSOhocmZcDzdKBQKBEzAyCeePygmkR6WQkimg12lIpC3oymrLRhKbHF82L&#xa;tOnS1X2rhBaVpsx5ktLADFhgmhY1djhAZZaWM4bymC4LTPMia7SY4ID2aIPvM2iCGtM0maZJQEhA&#xa;RESMc0abIWFqyTLjoLVea8M0TZrUaVLn12yyzpWxRxi3Ptp207SYZZJ9jmlQw8PFSZORxvzvWqS1&#xa;eQ2TNJgUTQIiYhExayatmQwXEonUHk7sWlenLqONx1w0wVzY4oNgm87ePtWVRaoriyy/9Qa+Mjwa&#xa;KiKlT+36adA1Y/+P9+wsqBe7Y4SD0BoR+DidNu4H7+F2B9SOA0pKUgnqiDhBBC4kMSKsIbK9HhLN&#xa;nG4QME1MhIebixYIRuBNEywTFDPUqQIvmVV6up8v36MwQ8gcBzZ00xCagE9zg20O2DOHSFNIZMzb&#xa;jA6FRMzQopTeLSYeF63GRkIQkTBJgwmqfJaX+ICP85X6rLHTaCJiPscrtOlzTI8+Pm4qOoyuPpqb&#xa;mASJHBcP6lSpU+Ul1nnADg/YPmPaxmmDZWpU2OGQA9rnn1xA/jfF17klNnnPuWuPyVQWdNPADNdD&#xa;pvuVqZLDK5WXqHhVym6VW9UnVKqTVmlxPYxXYWppBfnKZ+hMLTIo121KidZP31+n4kEqIY0BV4g8&#xa;NDNb7sesA9LFMQrRbUOvjX64Sbz5HhOxRz1y6UbH+MmAvm+1eTUcYJIYPQwgSewmISYNxlEJf6f/&#xa;ip/yLj/lXatoZHEZhfuPXKySFjWa1HjTvMq/mx/kfaBY2ecECDHwZ+ZrPGKX99mkZwbPnFOJw2d4&#xa;mTe5wT/ynWeen9F1VlhghofsssXOhdrcYI0XWeMnvMsx3Ween4N2nSssMktEzC/44MIP+ee8w2P2&#xa;eZ97tOld4IaCz/EKb/EK3+J7JEIRiySVGkYuXCvzyrxmrvQkf+v9BT+XH/Iz+SHlygROpYzwSlYG&#xa;rNTA9RCVqnUNr17HzMxhrt5ENKZRRQfDqXGKIzKAoxXO0IcoxBzugN+3m9Ud7KGPrFKj4xgdRURR&#xa;n+V4mqV4igfhx/SSLr3wCKMS9DC0yk4cWXNUHNvl3GiMiflL/pgPuM9t7uMT2BEaq0MgTvyvMCj+&#xa;hm/yD+bbkBr6xr1zJxBrjW+8wQ0whl/x0TPnCazIV6XMF3mdOzzkzgUM/wCv8QIuEhfJz7h9oTYA&#xa;b/NZtjngkM65zE8A5g/5Mm163OHhszllSjdZ5wbrvM89julydIE3BODrfIn91Pb2iL3RU6T/jLIb&#xa;QAi7DZQWij+Qb3PbfUDfCek7QzyvjCiV0xBJF1Gu2P8rNYTroaRgVs5Qq7YYeAp/pgnlCpTKiHI1&#xa;VW7S26q0dtYwgDii5UMc+fhBm0RFqGiY2yutaclySaNidBgSRQOuqUWuqkVuRx/SV316cQeTgdWk&#xa;ipLO4hlIgaX5ffMWB6LNAcfscghPCTYnP1sQ/h6f4R7b9OjTzZjFmUlkljZYZpZJOvT58BPEtf4R&#xa;v0OXAXfYYveEzfQseoEVNlhmjyN2OWKHwwu1+wqfJiRiSMSvuHPqOe6rbPCYfXr4FzJBAFxliRIe&#xa;h3Q4pnvhCJ1FZhAIQmK6nLFEZQZ/AzjGvrGmRIMqHdEm1gbjGFQqZwmlEDKxOfzSRWiDcD0iF0py&#xa;EqFDuu4xmCCvnSW8UmrBABA2G0FrdBKiVcL1aJWjJKIb91A6GYE21dKLKdI22ikAFSGVsoEkOkIn&#xa;UcEwr8e9RmQdhDa9NHikyu7pA3Lq0QOOucYSW2yPQHsOCQQd+rnClAVjn28ptXSHh0zRoEmdfdoX&#xa;Sps5pss9YJUFImI69C+EkwfsMEGVCWosM0+PwVNYcQVwl4fEJM80ZwFcZ5UZWhzRZZuDC3FYDxcX&#xa;l9e5zl0eckR3/EEKGvyYsm4UV8Q861zhgX5MR3dwhN3d3CSJ3fcr33UnsKKEVwYpmfamqckhA7dP&#xa;x9mmIitjlWOKadykjobEJCijWNUrDEwbXz/OC1CYzNCexJgkGYE4iVEqwNFTlHWMTgZo46P10AJU&#xa;aWxQfQbYAmgNPGGPOTPFCvNs8oiLwQgesM1X+TwJEU/YJWFUGOMsOqZHhwELzDDHFAOGz7StAtxh&#xa;ixUWWGOBeab5Ce8WZ+tUOkpX3xIeVSosMssT9q1T5Bn9mkwDxmeZZJIGuyd0JfcW9y40TFM0maLJ&#xa;IjPcYYsBAf0LdBjgCrOsssA+x8+041myTzRvZpgzk8zQ4j/Ej+w8C40Rxm5Wp0Y1cJ00YBl3CELw&#xa;WfdT7DsdtuQTED6xHKS2YgeTZ0Vk90vrxRqDZwTKHBKZXYZ6F1c7VhbNtHSl821ITfrZ6CGuiagY&#xa;jVFDDCEY64AxmYKUx+QWbZ7QY8AaC6yxeKGxzMhnSJsuAsEMrWcu25lh/yG7tOnxJd7gI7a4w1YK&#xa;+PNphwMa1LjGEuss0qZ/IR3mNveZZ4pl5pljkne5Q4I6955terTpMSBgmibLzDNDKw+mcS/2XlvQ&#xa;brDMfiqjfBKaZZKXuMq3+N4najfPNAC7HBKZmBxleSypAWE1bluV3AGTYIRmWU1x6BwycDoIYVAy&#xa;HnHXonYOKdMzuMalQomBbhPRx+gApR1GlVksxxR5nK3NBEbHCDQyNdobrKs0f9b0Hhl3LZJC4+HR&#xa;pP6JxgYsVxoS0mTiwnMyICBgyHVWOaLLPR5dCLQJih0OCYlYYxHDzoVAC7DPMUvM8TJX+YgHDIku&#xa;dM8D2iQobrLGGgvcSV2/Z3rELumSflvp7BqPl3RJv6V0CdpLeu7oErSX9NzRJWgv6bmjS9Be0nNH&#xa;l6C9pOeOLkF7Sc8dXYL2kp47ugTtJT139P84WGaZUimIJgAAAABJRU5ErkJggg==&#xa;" id="image3163"/>
- <rect width="282.94818" x="28.049149" y="81.03817" rx="0" height="279.91772" ry="0" style="fill:none;fill-opacity:1;stroke:none;stroke-width:5.44153594999999960;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" id="rect2995"/>
- </g>
- <g id="layer2"/>
-</svg>
diff --git a/util/util.pro b/util/util.pro
deleted file mode 100644
index 481fd5f8..00000000
--- a/util/util.pro
+++ /dev/null
@@ -1,4 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS = qt3d
-include(../pkg.pri)
-!package: SUBDIRS += meshcvt